Revert incorrect RCL_3 drop: RCL_3
authorPat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:34:56 +0100
branchRCL_3
changeset 257 3e88ff8f41d5
parent 256 c1f20ce4abcf
child 258 880ff05ad710
child 263 9e2d4f7f5028
Revert incorrect RCL_3 drop: Revision: 201035 Kit: 201035
baseapitest/basesvs/validation/f32/sfsrv/inc/T_FsData.h
brdbootldr/ubootldr/flash_nor.cpp
bsptemplate/asspandvariant/template_assp/dma_v2.mmp
bsptemplate/asspandvariant/template_assp/dmapsl_v2.cpp
bsptemplate/asspandvariant/template_assp/gpio.cpp
bsptemplate/asspandvariant/template_assp/pa_usbc.cpp
bsptemplate/asspandvariant/template_assp/template_assp.inf
bsptemplate/asspandvariant/template_assp/traces_usbcc/OstTraceDefinitions.h
bsptemplate/asspandvariant/template_assp/traces_usbcc/fixed_id.definitions
bsptemplate/asspandvariant/template_assp/usbcc.mmp
bsptemplate/asspandvariant/template_variant/bld.inf
bsptemplate/asspandvariant/template_variant/camerasc/camerasc.cpp
bsptemplate/asspandvariant/template_variant/camerasc/camerasc_plat.h
bsptemplate/asspandvariant/template_variant/camerasc/camerasc_sensor.cpp
bsptemplate/asspandvariant/template_variant/camerasc/logo.cpp
bsptemplate/asspandvariant/template_variant/camerasc/logoyuv2.cpp
bsptemplate/asspandvariant/template_variant/camerasctemplate.mmp
bsptemplate/asspandvariant/template_variant/exiic.mmp
bsptemplate/asspandvariant/template_variant/rom/base_template.iby
bsptemplate/asspandvariant/template_variant/rom/kernel.iby
bsptemplate/asspandvariant/template_variant/soundsctemplate_v2.mmp
bsptemplate/asspandvariant/template_variant/specific/power.cpp
bsptemplate/asspandvariant/template_variant/specific/uart.cpp
bsptemplate/asspandvariant/template_variant/specific/variant.cpp
bsptemplate/asspandvariant/template_variant/variant.mmh
build.config.xml
halservices/hal/bld.inf
halservices/hal/inc/hal_data.h
kernel/eka/base_e32.history.xml
kernel/eka/bld.inf
kernel/eka/bmarm/dma2u.def
kernel/eka/bmarm/ekernsmp.def
kernel/eka/bmarm/ekernu.def
kernel/eka/bmarm/euseru.def
kernel/eka/bmarm/usbcscu.def
kernel/eka/bwins/ekernu.def
kernel/eka/bwins/euseru.def
kernel/eka/bx86/ekernsmp.def
kernel/eka/bx86/ekernu.def
kernel/eka/bx86/euseru.def
kernel/eka/bx86gcc/ekernsmp.def
kernel/eka/bx86gcc/ekernu.def
kernel/eka/bx86gcc/euseru.def
kernel/eka/common/alloc.cpp
kernel/eka/common/arm/cheap.cia
kernel/eka/common/common.h
kernel/eka/common/debugfunction.cpp
kernel/eka/common/des16.cpp
kernel/eka/common/heap.cpp
kernel/eka/common/heap_hybrid.cpp
kernel/eka/common/mem.cpp
kernel/eka/common/win32/cmem.cpp
kernel/eka/compsupp/ARM EABI LICENCE.txt
kernel/eka/debug/crashMonitor/inc/crashlogwalker.h
kernel/eka/debug/crashMonitor/inc/scmbytestreamutil.inl
kernel/eka/debug/crashMonitor/inc/scmdatatypes.h
kernel/eka/debug/securityServer/group/rm_debug_svr.mmp
kernel/eka/debug/securityServer/inc/c_process_pair.h
kernel/eka/debug/securityServer/inc/c_security_svr_async.h
kernel/eka/debug/securityServer/inc/c_security_svr_server.h
kernel/eka/debug/securityServer/inc/c_security_svr_session.h
kernel/eka/debug/securityServer/inc/c_shutdown_timer.h
kernel/eka/debug/securityServer/inc/low_mem_requests.h
kernel/eka/debug/securityServer/inc/rm_debug_logging.h
kernel/eka/debug/securityServer/src/c_process_pair.cpp
kernel/eka/debug/securityServer/src/c_security_svr_async.cpp
kernel/eka/debug/securityServer/src/c_security_svr_server.cpp
kernel/eka/debug/securityServer/src/c_security_svr_session.cpp
kernel/eka/debug/securityServer/src/c_shutdown_timer.cpp
kernel/eka/debug/securityServer/src/rm_debug_svr.cpp
kernel/eka/debug/trkdummyapp/group/bld.inf
kernel/eka/doit.cmd
kernel/eka/drivers/bsp/bld.inf
kernel/eka/drivers/camerasc/base_drivers_camerasc.mrp
kernel/eka/drivers/camerasc/bld.inf
kernel/eka/drivers/camerasc/cameraldd.cpp
kernel/eka/drivers/camerasc/ecamerasc.mmp
kernel/eka/drivers/debug/common/d_debug_functionality.cpp
kernel/eka/drivers/debug/common/debug_utils.h
kernel/eka/drivers/debug/group/base_e32_drivers_debug.mrp
kernel/eka/drivers/debug/group/bld.inf
kernel/eka/drivers/debug/group/rm_debug_kerneldriver.mmh
kernel/eka/drivers/debug/group/rm_debug_kerneldriver.mmp
kernel/eka/drivers/debug/group/rm_debug_kerneldriver_ext.mmp
kernel/eka/drivers/debug/group/sm_debug_kerneldriver.mmp
kernel/eka/drivers/debug/rmdebug/d_debug_agent.cpp
kernel/eka/drivers/debug/rmdebug/d_debug_agent.h
kernel/eka/drivers/debug/rmdebug/d_debug_agent.inl
kernel/eka/drivers/debug/rmdebug/d_driver_event_info.cpp
kernel/eka/drivers/debug/rmdebug/d_driver_event_info.h
kernel/eka/drivers/debug/rmdebug/d_list_manager.cpp
kernel/eka/drivers/debug/rmdebug/d_list_manager.h
kernel/eka/drivers/debug/rmdebug/d_process_tracker.cpp
kernel/eka/drivers/debug/rmdebug/d_process_tracker.h
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/debug/rmdebug/d_rmd_stepping.cpp
kernel/eka/drivers/debug/rmdebug/d_rmd_stepping.h
kernel/eka/drivers/debug/rmdebug/d_rmd_stepping.inl
kernel/eka/drivers/debug/rmdebug/d_target_process.cpp
kernel/eka/drivers/debug/rmdebug/d_target_process.h
kernel/eka/drivers/debug/rmdebug/rm_debug_eventhandler.cpp
kernel/eka/drivers/debug/rmdebug/rm_debug_kerneldriver.cpp
kernel/eka/drivers/debug/smdebug/d_sm_codeseg.cpp
kernel/eka/drivers/debug/smdebug/d_sm_process.cpp
kernel/eka/drivers/debug/smdebug/d_sm_staticinfo.cpp
kernel/eka/drivers/debug/smdebug/d_stopmode.cpp
kernel/eka/drivers/debug/smdebug/sm_debug_kerneldriver.cpp
kernel/eka/drivers/dma/dma2_lib.mmp
kernel/eka/drivers/dma/dma2_pil.cpp
kernel/eka/drivers/dma/dma2_shared.cpp
kernel/eka/drivers/dma/dmapil.cpp
kernel/eka/drivers/eabi/rm_debug_extu.def
kernel/eka/drivers/hcr/hcr_api.cpp
kernel/eka/drivers/hcr/hcr_hai.h
kernel/eka/drivers/hcr/hcr_pil.h
kernel/eka/drivers/iic/iic.cpp
kernel/eka/drivers/iic/iic_channel.cpp
kernel/eka/drivers/locmedia/dmasupport.cpp
kernel/eka/drivers/locmedia/locmedia.cpp
kernel/eka/drivers/locmedia/traces/OstTraceDefinitions.h
kernel/eka/drivers/medmmc/bgahsmmcptn.cpp
kernel/eka/drivers/medmmc/bgahsmmcptn.h
kernel/eka/drivers/medmmc/bgahsmmcptn.mmp
kernel/eka/drivers/medmmc/medmmc.cpp
kernel/eka/drivers/medmmc/toc.cpp
kernel/eka/drivers/medmmc/toc.h
kernel/eka/drivers/medmmc/traces/OstTraceDefinitions.h
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/eabi/sdcard3c/sdio/epbusmu.def
kernel/eka/drivers/pbus/mmc/sdcard/sdcard3c/sdcard.cpp
kernel/eka/drivers/pbus/mmc/sdcard/sdcard3c/sdio/sdiostack.cpp
kernel/eka/drivers/pbus/mmc/session.cpp
kernel/eka/drivers/pbus/mmc/stack.cpp
kernel/eka/drivers/pbus/mmc/traces/OstTraceDefinitions.h
kernel/eka/drivers/pbus/pccard/epoc/pccd_init.cpp
kernel/eka/drivers/pbus/pccard/socket.cpp
kernel/eka/drivers/pbus/spbus.cpp
kernel/eka/drivers/power/smppower/idlehelper.cia
kernel/eka/drivers/power/smppower/idlehelper.cpp
kernel/eka/drivers/power/smppower/idlehelper_lib.mmp
kernel/eka/drivers/power/smppower/sample_idlehandler/smpidlehandler.cpp
kernel/eka/drivers/power/smppower/sample_idlehandler/smpidlehandler_lib.mmp
kernel/eka/drivers/resmanus/d_resmanus.cpp
kernel/eka/drivers/resourceman/rescontrol_export.cpp
kernel/eka/drivers/resourceman/resourcecontrol.cpp
kernel/eka/drivers/resourceman/resourcecontrol_extended.cpp
kernel/eka/drivers/sdapc/d_sdapc.cpp
kernel/eka/drivers/usbc/d_usbc.cpp
kernel/eka/drivers/usbc/traces/OstTraceDefinitions.h
kernel/eka/drivers/usbc/traces/fixed_id.definitions
kernel/eka/drivers/usbc/usbc.mmp
kernel/eka/drivers/usbc/usbdma.cpp
kernel/eka/drivers/usbcc/chapter9.cpp
kernel/eka/drivers/usbcc/descriptors.cpp
kernel/eka/drivers/usbcc/misc.cpp
kernel/eka/drivers/usbcc/ps_usbc.cpp
kernel/eka/drivers/usbcc/queue.cpp
kernel/eka/drivers/usbcsc/d_usbcsc.cpp
kernel/eka/drivers/usbcsc/traces/OstTraceDefinitions.h
kernel/eka/drivers/usbcsc/traces/fixed_id.definitions
kernel/eka/drivers/usbcsc/usbcsc.mmp
kernel/eka/drivers/usbcsc/usbcsc_bil.cpp
kernel/eka/drivers/usbcsc/usbcsc_bil.mmp
kernel/eka/drivers/usbho/usbdescriptors/usbdescparser.cpp
kernel/eka/drivers/usbho/usbdi_utils/usbtransfers.cpp
kernel/eka/eabi/dma2u.def
kernel/eka/eabi/ekernsmp.def
kernel/eka/eabi/ekernu.def
kernel/eka/eabi/euseru.def
kernel/eka/eabi/rm_debug_extu.def
kernel/eka/eabi/sm_debugu.def
kernel/eka/eabi/usbcscu.def
kernel/eka/eabi/usbdi_utilsu.def
kernel/eka/euser/epoc/arm/uc_trp.cia
kernel/eka/euser/epoc/arm/uc_utl.cia
kernel/eka/euser/epoc/win32/uc_utl.cpp
kernel/eka/euser/epoc/x86/uc_utl.cia
kernel/eka/euser/euser.mmh
kernel/eka/euser/unicode/Compare.cpp
kernel/eka/euser/unicode/collate.cpp
kernel/eka/euser/unicode/perl/Unicode, Inc License Agreement - Data Files and Software.txt
kernel/eka/euser/us_exec.cpp
kernel/eka/euser/us_ksvr.cpp
kernel/eka/ewsrv/ky_capt.cpp
kernel/eka/ewsrv/ky_tran.cpp
kernel/eka/include/cpudefs.h
kernel/eka/include/d32camerasc.h
kernel/eka/include/d32camerasc.inl
kernel/eka/include/d32comm.h
kernel/eka/include/d32public.h
kernel/eka/include/d32usbcsc.h
kernel/eka/include/d32usbcsc.inl
kernel/eka/include/d32usbtransfers.h
kernel/eka/include/dla.h
kernel/eka/include/drivers/camerasc.h
kernel/eka/include/drivers/camerasc.inl
kernel/eka/include/drivers/dma.h
kernel/eka/include/drivers/dma.inl
kernel/eka/include/drivers/dma_compat.inl
kernel/eka/include/drivers/dma_hai.h
kernel/eka/include/drivers/dma_hai.inl
kernel/eka/include/drivers/dma_v1.h
kernel/eka/include/drivers/dma_v1.inl
kernel/eka/include/drivers/dma_v2.h
kernel/eka/include/drivers/dma_v2.inl
kernel/eka/include/drivers/dmadefs.h
kernel/eka/include/drivers/gpio.h
kernel/eka/include/drivers/iic.h
kernel/eka/include/drivers/iic_channel.h
kernel/eka/include/drivers/iic_transaction.h
kernel/eka/include/drivers/iic_transaction.inl
kernel/eka/include/drivers/mmc.h
kernel/eka/include/drivers/mmc.inl
kernel/eka/include/drivers/resmanus.h
kernel/eka/include/drivers/resmanus_trace.h
kernel/eka/include/drivers/resource.h
kernel/eka/include/drivers/resourcecontrol.h
kernel/eka/include/drivers/resourcecontrol.inl
kernel/eka/include/drivers/resourcecontrol_clientsettings.h
kernel/eka/include/drivers/resourcecontrol_settings.h
kernel/eka/include/drivers/resourcecontrol_trace.h
kernel/eka/include/drivers/rm_debug_driver.h
kernel/eka/include/drivers/rm_debug_eventhandler.h
kernel/eka/include/drivers/rm_debug_eventhandler.inl
kernel/eka/include/drivers/rm_debug_kerneldriver.h
kernel/eka/include/drivers/sdcard.h
kernel/eka/include/drivers/smppower/idlehelper.h
kernel/eka/include/drivers/smppower/sample_idlehandler/smpidlehandler.h
kernel/eka/include/drivers/usbcsc.h
kernel/eka/include/e32atomics.h
kernel/eka/include/e32base.h
kernel/eka/include/e32btrace.h
kernel/eka/include/e32cia.h
kernel/eka/include/e32cmn.h
kernel/eka/include/e32cmn.inl
kernel/eka/include/e32des16.h
kernel/eka/include/e32keys.h
kernel/eka/include/e32ktran.h
kernel/eka/include/e32std.h
kernel/eka/include/e32std.inl
kernel/eka/include/e32ver.h
kernel/eka/include/heap_hybrid.h
kernel/eka/include/k32keys.h
kernel/eka/include/k32keys.inl
kernel/eka/include/kernel/arm/arm.h
kernel/eka/include/kernel/cache.h
kernel/eka/include/kernel/cache_maintenance.h
kernel/eka/include/kernel/cache_maintenance.inl
kernel/eka/include/kernel/kern_priv.h
kernel/eka/include/kernel/kerncorestats.h
kernel/eka/include/kernel/kernel.h
kernel/eka/include/kernel/kpower.h
kernel/eka/include/memmodel/epoc/flexible/memmodel.h
kernel/eka/include/memmodel/epoc/mmubase/mmubase.h
kernel/eka/include/memmodel/epoc/multiple/memmodel.h
kernel/eka/include/memmodel/epoc/platform.h
kernel/eka/include/nkern/nk_cpu.h
kernel/eka/include/nkern/nk_priv.h
kernel/eka/include/nkern/nk_trace.h
kernel/eka/include/nkern/nkern.h
kernel/eka/include/nkern/nklib.h
kernel/eka/include/nkernsmp/arm/arm_tmr.h
kernel/eka/include/nkernsmp/arm/entry.h
kernel/eka/include/nkernsmp/arm/ncern.h
kernel/eka/include/nkernsmp/arm/nk_plat.h
kernel/eka/include/nkernsmp/nk_priv.h
kernel/eka/include/nkernsmp/nkern.h
kernel/eka/include/nkernsmp/x86/ncern.h
kernel/eka/include/nkernsmp/x86/nk_plat.h
kernel/eka/include/opensystemtrace.h
kernel/eka/include/page_alloc.h
kernel/eka/include/rm_debug_api.h
kernel/eka/include/slab.h
kernel/eka/include/sm_debug_api.h
kernel/eka/include/u32hal.h
kernel/eka/include/u32std.h
kernel/eka/kernel/arm/cache.cpp
kernel/eka/kernel/arm/cache_external.cpp
kernel/eka/kernel/arm/cache_maintenance.cpp
kernel/eka/kernel/arm/cinit.cpp
kernel/eka/kernel/arm/ckernel.cpp
kernel/eka/kernel/arm/cutils.cia
kernel/eka/kernel/arm/cutils.cpp
kernel/eka/kernel/arm/vfp.cpp
kernel/eka/kernel/device.cpp
kernel/eka/kernel/ekern.mmp
kernel/eka/kernel/eventq.cpp
kernel/eka/kernel/execs.txt
kernel/eka/kernel/exmoncommon.mmp
kernel/eka/kernel/kerncorestats.cpp
kernel/eka/kernel/object.cpp
kernel/eka/kernel/power.cpp
kernel/eka/kernel/sbtrace.cpp
kernel/eka/kernel/scodeseg.cpp
kernel/eka/kernel/server.cpp
kernel/eka/kernel/sexec.cpp
kernel/eka/kernel/sinit.cpp
kernel/eka/kernel/sipc.cpp
kernel/eka/kernel/skernel.cpp
kernel/eka/kernel/smonitor.cpp
kernel/eka/kernel/sprocess.cpp
kernel/eka/kernel/sthread.cpp
kernel/eka/kernel/stimer.cpp
kernel/eka/kernel/sutils.cpp
kernel/eka/kernel/win32/cache.cpp
kernel/eka/kernel/win32/cinit.cpp
kernel/eka/kernel/x86/cache.cpp
kernel/eka/kernel/x86/ckernel.cpp
kernel/eka/kernel/x86/cutils.cpp
kernel/eka/klib/kheap.cpp
kernel/eka/memmodel/emul/win32/mcodeseg.cpp
kernel/eka/memmodel/epoc/direct/arm/xinit.cpp
kernel/eka/memmodel/epoc/direct/minit.cpp
kernel/eka/memmodel/epoc/direct/mutils.cpp
kernel/eka/memmodel/epoc/flexible/arm/xipc.cia
kernel/eka/memmodel/epoc/flexible/arm/xipc.cpp
kernel/eka/memmodel/epoc/flexible/arm/xsched.cpp
kernel/eka/memmodel/epoc/flexible/mcodeseg.cpp
kernel/eka/memmodel/epoc/flexible/mmu/arm/xmmu.cpp
kernel/eka/memmodel/epoc/flexible/mmu/maddressspace.cpp
kernel/eka/memmodel/epoc/flexible/mmu/mcodepaging.cpp
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/mmu.cpp
kernel/eka/memmodel/epoc/flexible/mmu/mmu.h
kernel/eka/memmodel/epoc/flexible/mmu/mpager.cpp
kernel/eka/memmodel/epoc/flexible/mmu/mpager.h
kernel/eka/memmodel/epoc/flexible/mmu/mrom.cpp
kernel/eka/memmodel/epoc/flexible/mmu/x86/xmmu.cpp
kernel/eka/memmodel/epoc/mmubase/mmubase.cpp
kernel/eka/memmodel/epoc/moving/arm/xmmu.cpp
kernel/eka/memmodel/epoc/moving/mprocess.cpp
kernel/eka/memmodel/epoc/multiple/arm/xmmu.cpp
kernel/eka/memmodel/epoc/multiple/mcodeseg.cpp
kernel/eka/memmodel/memmodel.mmp
kernel/eka/nkern/arm/ncmonitor.cpp
kernel/eka/nkern/arm/ncsched.cia
kernel/eka/nkern/arm/ncutils.cpp
kernel/eka/nkern/arm/nklib.cia
kernel/eka/nkern/nk_mon.cpp
kernel/eka/nkern/nk_timer.cpp
kernel/eka/nkern/nkern.cpp
kernel/eka/nkern/nkern.mmp
kernel/eka/nkern/nklib.cpp
kernel/eka/nkern/sched.cpp
kernel/eka/nkern/x86/ncmonitor.cpp
kernel/eka/nkern/x86/ncutils.cia
kernel/eka/nkern/x86/ncutils.cpp
kernel/eka/nkernsmp/arm/nccpu.cpp
kernel/eka/nkernsmp/arm/ncglob.cpp
kernel/eka/nkernsmp/arm/ncmonitor.cpp
kernel/eka/nkernsmp/arm/ncsched.cia
kernel/eka/nkernsmp/arm/ncsched.cpp
kernel/eka/nkernsmp/arm/ncthrd.cia
kernel/eka/nkernsmp/arm/ncthrd.cpp
kernel/eka/nkernsmp/arm/ncutilf.cia
kernel/eka/nkernsmp/arm/ncutils.cia
kernel/eka/nkernsmp/arm/ncutils.cpp
kernel/eka/nkernsmp/arm/vectors.cia
kernel/eka/nkernsmp/dfcs.cpp
kernel/eka/nkernsmp/nk_bal.cpp
kernel/eka/nkernsmp/nk_bal.h
kernel/eka/nkernsmp/nk_irq.cpp
kernel/eka/nkernsmp/nk_mon.cpp
kernel/eka/nkernsmp/nk_timer.cpp
kernel/eka/nkernsmp/nkern.cpp
kernel/eka/nkernsmp/nkern.mmp
kernel/eka/nkernsmp/nkerns.cpp
kernel/eka/nkernsmp/sched.cpp
kernel/eka/nkernsmp/x86/nccpu.cpp
kernel/eka/nkernsmp/x86/ncglob.cpp
kernel/eka/nkernsmp/x86/ncmonitor.cpp
kernel/eka/nkernsmp/x86/ncsched.cia
kernel/eka/nkernsmp/x86/ncsched.cpp
kernel/eka/nkernsmp/x86/ncthrd.cpp
kernel/eka/nkernsmp/x86/ncutilf.cia
kernel/eka/nkernsmp/x86/ncutilf.cpp
kernel/eka/nkernsmp/x86/ncutils.cia
kernel/eka/nkernsmp/x86/ncutils.cpp
kernel/eka/nkernsmp/x86/vectors.cia
kernel/eka/nkernsmp/x86/vectors.cpp
kernel/eka/release.txt
kernel/eka/rombuild/alltests.oby
kernel/eka/rombuild/autotest.oby
kernel/eka/rombuild/autotest_e32tests.oby
kernel/eka/rombuild/autotest_f32tests.oby
kernel/eka/rombuild/base.iby
kernel/eka/rombuild/f32_perf_tests.oby
kernel/eka/rombuild/f32_perf_tests_fat_exfat.oby
kernel/eka/rombuild/f32tests.oby
kernel/eka/rombuild/h4usbmmctest_load.oby
kernel/eka/rombuild/h4usbmmctest_test.oby
kernel/eka/rombuild/h4usbstress.oby
kernel/eka/rombuild/h4usbtest.iby
kernel/eka/rombuild/kernel.hby
kernel/eka/rombuild/mmctest_load.oby
kernel/eka/rombuild/mmctest_load_rel.oby
kernel/eka/rombuild/mmctest_test.oby
kernel/eka/rombuild/mmctest_test_e32tests.oby
kernel/eka/rombuild/mmctest_test_f32tests.oby
kernel/eka/rombuild/nandtest_erase.oby
kernel/eka/rombuild/nandtest_load.oby
kernel/eka/rombuild/nandtest_test.oby
kernel/eka/rombuild/nandtest_test_e32tests.oby
kernel/eka/rombuild/nandtest_test_f32tests.oby
kernel/eka/rombuild/not_data_paged.txt
kernel/eka/rombuild/rm_debug_svr.iby
kernel/eka/rombuild/sm_debug.iby
kernel/eka/rombuild/t_soak.oby
kernel/eka/rombuild/ubootldr.oby
kernel/eka/rombuild/user.iby
kernelhwsrv_info/doc_pub/Base_SMP_Power_Management_Impacts_on_Kernel_Use_of_Hardware_Timers.docx
kernelhwsrv_info/doc_pub/Base_SMP_a_Brief_Description_of_the_Load_Balancer.docx
kernelhwsrv_info/doc_pub/base_how_to_armv7_cache_and_access_remapping_-_design.doc
kernelhwsrv_info/doc_pub/base_how_to_crash_logging.doc
kernelhwsrv_info/doc_pub/base_how_to_publish_and_subscribe.doc
kernelhwsrv_info/doc_pub/base_how_to_use_t_fatcharsetconv_framework.doc
kernelhwsrv_info/doc_pub/base_migrating_device_drivers_dfc_q.doc
kernelhwsrv_info/doc_pub/base_migrating_kernel api preconditions checking.doc
kerneltest/e32test/active/t_ctimer.cpp
kerneltest/e32test/active/t_messge.cpp
kerneltest/e32test/active/t_timerduration.cpp
kerneltest/e32test/bench/d_kernasmfnc.cpp
kerneltest/e32test/bench/t_dhry.cpp
kerneltest/e32test/bench/t_exec.cpp
kerneltest/e32test/bench/t_r64bm.cpp
kerneltest/e32test/bench/t_r64fnc.cpp
kerneltest/e32test/bmarm/d_dma2_simu.def
kerneltest/e32test/bmarm/i2c_ctrlessu.def
kerneltest/e32test/bmarm/i2c_masterstubs_ctrlessu.def
kerneltest/e32test/bmarm/i2c_slavestubs_ctrlessu.def
kerneltest/e32test/bmarm/spi_ctrlessu.def
kerneltest/e32test/buffer/Unicode, Inc License Agreement - Data Files and Software.txt
kerneltest/e32test/buffer/t_bflat.cpp
kerneltest/e32test/buffer/t_bma.cpp
kerneltest/e32test/buffer/t_buf.cpp
kerneltest/e32test/buffer/t_circ.cpp
kerneltest/e32test/buffer/t_collate.cpp
kerneltest/e32test/buffer/t_des.cpp
kerneltest/e32test/buffer/t_farray.cpp
kerneltest/e32test/buffer/t_match.cpp
kerneltest/e32test/buffer/t_parray.cpp
kerneltest/e32test/buffer/t_que.cpp
kerneltest/e32test/buffer/t_regn.cpp
kerneltest/e32test/buffer/t_sque.cpp
kerneltest/e32test/bwins/d_dma2_simu.def
kerneltest/e32test/bwins/i2c_masterstubs_ctrlessu.def
kerneltest/e32test/bwins/i2c_slavestubs_ctrlessu.def
kerneltest/e32test/bx86/d_dma2_simu.def
kerneltest/e32test/cppexceptions/second_excp.h
kerneltest/e32test/debug/t_btrace.cpp
kerneltest/e32test/debug/t_context.cpp
kerneltest/e32test/debug/t_heapcorruption.cpp
kerneltest/e32test/defrag/d_ramdefrag.cpp
kerneltest/e32test/defrag/t_ramdefrag.cpp
kerneltest/e32test/defrag/t_ramdefrag.h
kerneltest/e32test/demandpaging/t_chunkheapcreate.cpp
kerneltest/e32test/demandpaging/t_datapaging.cpp
kerneltest/e32test/demandpaging/t_dpcmn.h
kerneltest/e32test/demandpaging/t_pagetable_limit.cpp
kerneltest/e32test/demandpaging/t_printsysinfo.cpp
kerneltest/e32test/demandpaging/t_tbus_datapaging.cpp
kerneltest/e32test/demandpaging/t_threadcreate.cpp
kerneltest/e32test/device/t_commsk.cpp
kerneltest/e32test/device/t_dtenot.cpp
kerneltest/e32test/device/t_sirco2.cpp
kerneltest/e32test/device/t_usb.cpp
kerneltest/e32test/device/t_usb.h
kerneltest/e32test/device/t_usbapi.cpp
kerneltest/e32test/device/t_usbco2.cpp
kerneltest/e32test/device/t_usbcsc.cpp
kerneltest/e32test/dll/t_dll1.cpp
kerneltest/e32test/dll/t_dll2.cpp
kerneltest/e32test/dll/t_xxver2.cpp
kerneltest/e32test/dma/d_dma.cpp
kerneltest/e32test/dma/dmasim.cpp
kerneltest/e32test/dma/t_dma.cpp
kerneltest/e32test/dmav2/cap_reqs.h
kerneltest/e32test/dmav2/d_dma2.cpp
kerneltest/e32test/dmav2/d_dma2.h
kerneltest/e32test/dmav2/d_dma2_cmn.cpp
kerneltest/e32test/dmav2/dma2_sim.cpp
kerneltest/e32test/dmav2/self_test.cpp
kerneltest/e32test/dmav2/t_dma2.cpp
kerneltest/e32test/dmav2/t_dma2.h
kerneltest/e32test/dmav2/test_cases.cpp
kerneltest/e32test/dmav2/test_thread.cpp
kerneltest/e32test/dmav2/test_thread.h
kerneltest/e32test/domainmgr/dm_autoexec.bat
kerneltest/e32test/domainmgr/dm_tests.iby
kerneltest/e32test/domainmgr/dmtest.auto.bat
kerneltest/e32test/domainmgr/domainpolicy99.mmp
kerneltest/e32test/domainmgr/domainpolicytest.cpp
kerneltest/e32test/domainmgr/domainpolicytest.h
kerneltest/e32test/domainmgr/t_domain.cpp
kerneltest/e32test/domainmgr/t_domain.mmp
kerneltest/e32test/domainmgr/t_domain_slave.cpp
kerneltest/e32test/domainmgr/t_domain_slave.mmp
kerneltest/e32test/domainmgr/test.inf
kerneltest/e32test/domainmgr/tshell_dmtest.oby
kerneltest/e32test/eabi/d_dma2_simu.def
kerneltest/e32test/eabi/d_second_excp2_40u.def
kerneltest/e32test/eabi/d_second_excp_40u.def
kerneltest/e32test/eabi/i2c_ctrlessu.def
kerneltest/e32test/eabi/i2c_masterstubs_ctrlessu.def
kerneltest/e32test/eabi/i2c_slavestubs_ctrlessu.def
kerneltest/e32test/eabi/spi_ctrlessu.def
kerneltest/e32test/eabi/t_usb_tranhandlesrvu.def
kerneltest/e32test/eabi/t_usb_transfersrvu.def
kerneltest/e32test/group/bld.inf
kerneltest/e32test/group/ccthrash.mmp
kerneltest/e32test/group/d_dma2.mmp
kerneltest/e32test/group/d_dma2_compat.mmp
kerneltest/e32test/group/d_dma2_sim.mmp
kerneltest/e32test/group/d_dma_compat.mmp
kerneltest/e32test/group/d_frqchg.mmh
kerneltest/e32test/group/d_kerncorestats.mmp
kerneltest/e32test/group/d_khal.mmp
kerneltest/e32test/group/d_rescontrolclisync.mmp
kerneltest/e32test/group/d_second_excp.mmp
kerneltest/e32test/group/d_second_excp2.mmp
kerneltest/e32test/group/d_timestamp.mmp
kerneltest/e32test/group/domainPolicyTest.mmp
kerneltest/e32test/group/refkeymap.mmp
kerneltest/e32test/group/rescontrol_extended_psl.mmp
kerneltest/e32test/group/rescontrol_psl.mmp
kerneltest/e32test/group/romstuff.mke
kerneltest/e32test/group/sdapctest.mmp
kerneltest/e32test/group/t_atomicu.mmp
kerneltest/e32test/group/t_camera_api.mmp
kerneltest/e32test/group/t_camera_gen.mmp
kerneltest/e32test/group/t_datapaging.mmp
kerneltest/e32test/group/t_dma2.mmp
kerneltest/e32test/group/t_domain.mmp
kerneltest/e32test/group/t_domain_slave.mmp
kerneltest/e32test/group/t_drtaeabi.mmp
kerneltest/e32test/group/t_extendedrescontrolcli.mmp
kerneltest/e32test/group/t_frqchg.mmp
kerneltest/e32test/group/t_heap.mmp
kerneltest/e32test/group/t_heap2.mmp
kerneltest/e32test/group/t_heapcheck.mmp
kerneltest/e32test/group/t_heapcorruption.mmp
kerneltest/e32test/group/t_heapdb.mmp
kerneltest/e32test/group/t_heapdl.mmp
kerneltest/e32test/group/t_heappagealloc.mmp
kerneltest/e32test/group/t_heapslab.mmp
kerneltest/e32test/group/t_heapstress.mmp
kerneltest/e32test/group/t_kerncorestats.mmp
kerneltest/e32test/group/t_khal.mmp
kerneltest/e32test/group/t_loadsim.mmp
kerneltest/e32test/group/t_pci.mmp
kerneltest/e32test/group/t_printsysinfo.mmp
kerneltest/e32test/group/t_reason2.mmp
kerneltest/e32test/group/t_rescontrolclisync.mmp
kerneltest/e32test/group/t_schedhook.mmp
kerneltest/e32test/group/t_semutx.mmp
kerneltest/e32test/group/t_timestamp.mmp
kerneltest/e32test/group/t_usb.mmp
kerneltest/e32test/group/t_usb_device.mmp
kerneltest/e32test/group/t_usb_scdevice.mmp
kerneltest/e32test/group/t_usb_tranhandleclient.mmp
kerneltest/e32test/group/t_usb_transfersrv.mmp
kerneltest/e32test/group/t_usb_transfersrvclient.mmp
kerneltest/e32test/group/t_usbapi.mmp
kerneltest/e32test/group/t_usbcsc.mmp
kerneltest/e32test/group/ymodemtx.mmp
kerneltest/e32test/hcr/d_hcrsim.cpp
kerneltest/e32test/hcr/d_hcrsim_testdata.h
kerneltest/e32test/hcr/filerepos_cds.dat
kerneltest/e32test/hcr/filerepos_cds.txt
kerneltest/e32test/hcr/hcr.inf
kerneltest/e32test/hcr/hcr_tests.iby
kerneltest/e32test/hcr/t_hcr.cpp
kerneltest/e32test/heap/t_fail.cpp
kerneltest/e32test/heap/t_hcomp.cpp
kerneltest/e32test/heap/t_heap.cpp
kerneltest/e32test/heap/t_heap2.cpp
kerneltest/e32test/heap/t_heapcheck.cpp
kerneltest/e32test/heap/t_heapdb.cpp
kerneltest/e32test/heap/t_heapdl.cpp
kerneltest/e32test/heap/t_heappagealloc.cpp
kerneltest/e32test/heap/t_heapslab.cpp
kerneltest/e32test/heap/t_heapstress.cpp
kerneltest/e32test/heap/t_kheap.cpp
kerneltest/e32test/iic/iic_psl/d_iic_client_ctrless.mmp
kerneltest/e32test/iic/iic_psl/d_iic_client_stubs.mmp
kerneltest/e32test/iic/iic_psl/d_iic_slaveclient_ctrless.mmp
kerneltest/e32test/iic/iic_psl/d_iic_slaveclient_stubs.mmp
kerneltest/e32test/iic/iic_psl/i2c.cpp
kerneltest/e32test/iic/iic_psl/i2c.h
kerneltest/e32test/iic/iic_psl/i2c_ctrless.mmp
kerneltest/e32test/iic/iic_psl/i2c_masterstubs_ctrless.mmp
kerneltest/e32test/iic/iic_psl/i2c_slavestubs_ctrless.mmp
kerneltest/e32test/iic/iic_psl/iic_client.cpp
kerneltest/e32test/iic/iic_psl/iic_slaveclient.cpp
kerneltest/e32test/iic/iic_psl/iic_testpsl.cpp
kerneltest/e32test/iic/iic_psl/iic_testpsl.h
kerneltest/e32test/iic/iic_psl/iic_testpsl.mmp
kerneltest/e32test/iic/iic_psl/spi.cpp
kerneltest/e32test/iic/t_iic.cpp
kerneltest/e32test/iic/t_iic.h
kerneltest/e32test/lffs/loadlffs.cpp
kerneltest/e32test/math/t_i64.cpp
kerneltest/e32test/math/t_r32.cpp
kerneltest/e32test/mediaext/d_nfe.cpp
kerneltest/e32test/mediaext/t_nfe.cpp
kerneltest/e32test/misc/ccthrash.cpp
kerneltest/e32test/misc/cpumeter.cpp
kerneltest/e32test/misc/d_TestKernCoreStats.cpp
kerneltest/e32test/misc/d_TestKernCoreStats.h
kerneltest/e32test/misc/t_cputime.cpp
kerneltest/e32test/misc/t_kerncorestats.cpp
kerneltest/e32test/misc/t_loadsim.cpp
kerneltest/e32test/misc/t_svr3.cpp
kerneltest/e32test/misc/t_svr6.cpp
kerneltest/e32test/misc/t_tmout.cpp
kerneltest/e32test/misc/t_uid.cpp
kerneltest/e32test/misc/t_ymodemz.cpp
kerneltest/e32test/misc/t_zip.cpp
kerneltest/e32test/misc/ymodemtx.cpp
kerneltest/e32test/mmu/d_demandpaging.cpp
kerneltest/e32test/mmu/d_gobble.cpp
kerneltest/e32test/mmu/d_memorytest.cpp
kerneltest/e32test/mmu/d_sharedchunk.cpp
kerneltest/e32test/mmu/freeram.h
kerneltest/e32test/mmu/t_chunk3.cpp
kerneltest/e32test/mmu/t_demandpaging.cpp
kerneltest/e32test/mmu/t_mmubm.cpp
kerneltest/e32test/mmu/t_shadow.cpp
kerneltest/e32test/mmu/t_sharedio.cpp
kerneltest/e32test/mmu/t_shbuf.cpp
kerneltest/e32test/mmu/t_wsd_tst.h
kerneltest/e32test/multimedia/t_camera_api.cpp
kerneltest/e32test/multimedia/t_camera_bitmap.cpp
kerneltest/e32test/multimedia/t_camera_bitmap.h
kerneltest/e32test/multimedia/t_camera_display.cpp
kerneltest/e32test/multimedia/t_camera_display.h
kerneltest/e32test/multimedia/t_camera_gen.cpp
kerneltest/e32test/nkern/t_nktrace.cpp
kerneltest/e32test/nkernsa/arm/armutils.cia
kerneltest/e32test/nkernsa/fastmutex.cpp
kerneltest/e32test/nkernsa/kprintf.cpp
kerneltest/e32test/nkernsa/testdfc.cpp
kerneltest/e32test/nkernsa/threadbasic.cpp
kerneltest/e32test/nkernsa/tlsf.cpp
kerneltest/e32test/nkernsa/utils.h
kerneltest/e32test/notifier/t_textnotifier.cpp
kerneltest/e32test/pccd/sdapctest.cpp
kerneltest/e32test/pccd/t_atadrv.cpp
kerneltest/e32test/pccd/t_idrv.cpp
kerneltest/e32test/pccd/t_medch.cpp
kerneltest/e32test/pccd/t_pccdsr.cpp
kerneltest/e32test/pccd/t_setkey.cpp
kerneltest/e32test/pci/t_pci.cpp
kerneltest/e32test/pci/t_pci.h
kerneltest/e32test/personality/example/main.cpp
kerneltest/e32test/pipe/t_pipe.cpp
kerneltest/e32test/power/d_frqchg.cpp
kerneltest/e32test/power/d_frqchg.h
kerneltest/e32test/power/d_powermisctest.cpp
kerneltest/e32test/power/d_powermisctest.h
kerneltest/e32test/power/d_powermisctest.mmp
kerneltest/e32test/power/domainpolicytest.cpp
kerneltest/e32test/power/domainpolicytest.h
kerneltest/e32test/power/t_domain.cpp
kerneltest/e32test/power/t_domain_slave.cpp
kerneltest/e32test/power/t_frqchg.cpp
kerneltest/e32test/power/t_powermisctest.cpp
kerneltest/e32test/power/t_powermisctest.mmp
kerneltest/e32test/prime/t_semutx.cpp
kerneltest/e32test/realtime/t_lat2.cpp
kerneltest/e32test/resmanus/d_resmanusbtrace.cpp
kerneltest/e32test/resmanus/d_resmanusbtrace.h
kerneltest/e32test/resmanus/d_resmanusbtrace.mmp
kerneltest/e32test/resmanus/d_resmanusbtraceconst.h
kerneltest/e32test/resmanus/resourcecontrol.mmp
kerneltest/e32test/resmanus/resourcecontrollerextended.mmp
kerneltest/e32test/resmanus/t_resmanus.cpp
kerneltest/e32test/resmanus/t_resmanus.mmp
kerneltest/e32test/resmanus/t_resmanusbtrace.cpp
kerneltest/e32test/resmanus/t_resmanusbtrace.mmp
kerneltest/e32test/resmanus/t_resmanusextended.mmp
kerneltest/e32test/resmanus/t_resmanuskern.mmp
kerneltest/e32test/resourceman/d_rescontrolcli.cpp
kerneltest/e32test/resourceman/d_rescontrolclisync.cpp
kerneltest/e32test/resourceman/d_rescontrolclisync.h
kerneltest/e32test/resourceman/resourceman_psl/rescontrol_extended_psl.cpp
kerneltest/e32test/resourceman/resourceman_psl/rescontrol_psl.cpp
kerneltest/e32test/resourceman/resourceman_psl/rescontrol_psl.h
kerneltest/e32test/resourceman/t_rescontrolcli.cpp
kerneltest/e32test/resourceman/t_rescontrolclisync.cpp
kerneltest/e32test/rm_debug/basic_tests/r_kernel_low_memory_security_svr_session.cpp
kerneltest/e32test/rm_debug/basic_tests/r_kernel_low_memory_security_svr_session.h
kerneltest/e32test/rm_debug/basic_tests/r_low_memory_security_svr_session.cpp
kerneltest/e32test/rm_debug/basic_tests/r_low_memory_security_svr_session.h
kerneltest/e32test/rm_debug/basic_tests/r_user_low_memory_security_svr_session.cpp
kerneltest/e32test/rm_debug/basic_tests/r_user_low_memory_security_svr_session.h
kerneltest/e32test/rm_debug/basic_tests/t_rmdebug2.cpp
kerneltest/e32test/rm_debug/basic_tests/t_rmdebug2.h
kerneltest/e32test/rm_debug/basic_tests/t_rmdebug2_oemtoken.cpp
kerneltest/e32test/rm_debug/common/t_target_launcher.cpp
kerneltest/e32test/rm_debug/common/t_target_launcher.h
kerneltest/e32test/rm_debug/crashmonitor/t_crashmonitor.h
kerneltest/e32test/rm_debug/debug_targets/d_demand_paging.cia
kerneltest/e32test/rm_debug/debug_targets/d_demand_paging.h
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.h
kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_step_test.s
kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_step_test_armv4.h
kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_step_test_armv4.s
kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthread.cpp
kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthread.h
kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthread2.cpp
kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthread2.h
kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthreadasm.cia
kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthreadasm2.cia
kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_app.cpp
kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_app.h
kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_dll.cpp
kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_dll.h
kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_security.cpp
kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_security.h
kerneltest/e32test/rm_debug/group/t_multi_agent_launcher.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug2.mmh
kerneltest/e32test/rm_debug/group/t_rmdebug2.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug2_oem.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug2_oem2.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug2_oemtoken.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug2_oemtoken2.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_app.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_app1.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_app10.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_app2.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_app3.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_app4.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_app5.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_app6.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_app7.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_app8.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_app9.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_dll.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_multi_agent.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_multi_target.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_security0.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_security1.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_security2.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_security3.mmp
kerneltest/e32test/rm_debug/group/t_rmdebug_target_launcher.mmp
kerneltest/e32test/rm_debug/group/t_trkdummyapp.mmp
kerneltest/e32test/rm_debug/metro_trk/d_rmdebugclient.h
kerneltest/e32test/rm_debug/metro_trk/d_rmdebugserver.cpp
kerneltest/e32test/rm_debug/metro_trk/d_rmdebugserver.h
kerneltest/e32test/rm_debug/metro_trk/t_rmdebug.cpp
kerneltest/e32test/rm_debug/metro_trk/t_rmdebug.h
kerneltest/e32test/rm_debug/multi_agent_tests/t_agent_eventhandler.cpp
kerneltest/e32test/rm_debug/multi_agent_tests/t_agent_eventhandler.h
kerneltest/e32test/rm_debug/multi_agent_tests/t_debug_logging.h
kerneltest/e32test/rm_debug/multi_agent_tests/t_multi_agent.cpp
kerneltest/e32test/rm_debug/multi_agent_tests/t_multi_agent.h
kerneltest/e32test/rm_debug/multi_agent_tests/t_multi_agent_launcher.cpp
kerneltest/e32test/rm_debug/multi_agent_tests/t_multi_agent_launcher.h
kerneltest/e32test/rm_debug/multi_target_tests/t_multi_target.cpp
kerneltest/e32test/rm_debug/multi_target_tests/t_multi_target.h
kerneltest/e32test/secure/t_platsecconfig.cpp
kerneltest/e32test/secure/t_sdrivers.cpp
kerneltest/e32test/secure/t_shal.cpp
kerneltest/e32test/secure/t_sobject.cpp
kerneltest/e32test/secure/t_sprocess.cpp
kerneltest/e32test/smpsoak/t_smpsoak.cpp
kerneltest/e32test/smpsoak/t_smpsoak.h
kerneltest/e32test/system/d_khal.cpp
kerneltest/e32test/system/d_khal.h
kerneltest/e32test/system/d_mstim.cpp
kerneltest/e32test/system/d_tick.cpp
kerneltest/e32test/system/t_atomic_common.cpp
kerneltest/e32test/system/t_atomicu.cpp
kerneltest/e32test/system/t_cobj.cpp
kerneltest/e32test/system/t_ctrap.cpp
kerneltest/e32test/system/t_inact.cpp
kerneltest/e32test/system/t_inf.cpp
kerneltest/e32test/system/t_khal.cpp
kerneltest/e32test/system/t_panic.cpp
kerneltest/e32test/system/t_prot.cpp
kerneltest/e32test/system/t_reason2.cpp
kerneltest/e32test/thread/t_killer.cpp
kerneltest/e32test/thread/t_thread.cpp
kerneltest/e32test/timestamp/d_timestamp.cpp
kerneltest/e32test/timestamp/d_timestamp.h
kerneltest/e32test/timestamp/d_timestamp_dev.h
kerneltest/e32test/timestamp/t_timestamp.cpp
kerneltest/e32test/traces_t_usb/OstTraceDefinitions.h
kerneltest/e32test/traces_t_usb/fixed_id.definitions
kerneltest/e32test/traces_t_usb_device/OstTraceDefinitions.h
kerneltest/e32test/traces_t_usb_device/fixed_id.definitions
kerneltest/e32test/traces_t_usb_scdevice/OstTraceDefinitions.h
kerneltest/e32test/traces_t_usb_scdevice/fixed_id.definitions
kerneltest/e32test/traces_t_usb_transfersrv/OstTraceDefinitions.h
kerneltest/e32test/traces_t_usb_transfersrv/fixed_id.definitions
kerneltest/e32test/traces_t_usb_transfersrvclient/OstTraceDefinitions.h
kerneltest/e32test/traces_t_usb_transfersrvclient/fixed_id.definitions
kerneltest/e32test/traces_t_usbapi/OstTraceDefinitions.h
kerneltest/e32test/traces_t_usbapi/fixed_id.definitions
kerneltest/e32test/traces_t_usbcsc/OstTraceDefinitions.h
kerneltest/e32test/traces_t_usbcsc/fixed_id.definitions
kerneltest/e32test/usb/t_usb_device/configs/scvascobm.xml
kerneltest/e32test/usb/t_usb_device/configs/scvascoif0.xml
kerneltest/e32test/usb/t_usb_device/configs/scvascoif0a3.xml
kerneltest/e32test/usb/t_usb_device/configs/scvascoif0a3if1a2if2.xml
kerneltest/e32test/usb/t_usb_device/include/activecontrol.h
kerneltest/e32test/usb/t_usb_device/include/activedevicestatenotifier.h
kerneltest/e32test/usb/t_usb_device/include/activerw.h
kerneltest/e32test/usb/t_usb_device/include/activestallnotifier.h
kerneltest/e32test/usb/t_usb_device/include/general.h
kerneltest/e32test/usb/t_usb_device/include/tranhandleserver.h
kerneltest/e32test/usb/t_usb_device/include/tranhandleserverconsts.h
kerneltest/e32test/usb/t_usb_device/include/tranhandleserversecuritypolicy.h
kerneltest/e32test/usb/t_usb_device/include/tranhandlesession.h
kerneltest/e32test/usb/t_usb_device/include/tranhandlesrv.h
kerneltest/e32test/usb/t_usb_device/include/tranhandlsession.h
kerneltest/e32test/usb/t_usb_device/include/transferhandle.h
kerneltest/e32test/usb/t_usb_device/include/transferserver.h
kerneltest/e32test/usb/t_usb_device/include/transferserversecuritypolicy.h
kerneltest/e32test/usb/t_usb_device/include/transfersession.h
kerneltest/e32test/usb/t_usb_device/include/transfersrv.h
kerneltest/e32test/usb/t_usb_device/src/activecontrol.cpp
kerneltest/e32test/usb/t_usb_device/src/activedevicestatenotifier.cpp
kerneltest/e32test/usb/t_usb_device/src/activerw.cpp
kerneltest/e32test/usb/t_usb_device/src/activestallnotifier.cpp
kerneltest/e32test/usb/t_usb_device/src/activetimer.cpp
kerneltest/e32test/usb/t_usb_device/src/apitests.cpp
kerneltest/e32test/usb/t_usb_device/src/config.cpp
kerneltest/e32test/usb/t_usb_device/src/main.cpp
kerneltest/e32test/usb/t_usb_device/src/tranhandleserver.cpp
kerneltest/e32test/usb/t_usb_device/src/tranhandlesession.cpp
kerneltest/e32test/usb/t_usb_device/src/tranhandlesrv.cpp
kerneltest/e32test/usb/t_usb_device/src/transferhandle.cpp
kerneltest/e32test/usb/t_usb_device/src/transferserver.cpp
kerneltest/e32test/usb/t_usb_device/src/transfersession.cpp
kerneltest/e32test/usb/t_usb_device/src/transfersrv.cpp
kerneltest/e32test/usb/t_usb_device/src/transfersrvmain.cpp
kerneltest/e32test/usb/t_usb_device/src/usbms.cpp
kerneltest/e32test/usbho/t_otgdi/group/t_otgdi.mmp
kerneltest/e32test/usbho/t_otgdi/group/t_otgdi_fdfactor.mmp
kerneltest/e32test/usbho/t_otgdi/inc/b2bwatchers.h
kerneltest/e32test/usbho/t_otgdi/inc/debugmacros.h
kerneltest/e32test/usbho/t_otgdi/src/b2bwatchers.cpp
kerneltest/e32test/usbho/t_otgdi/src/exampletestcase.cpp
kerneltest/e32test/usbho/t_otgdi/src/otgroot.cpp
kerneltest/e32test/usbho/t_otgdi/src/t_otgdi.cpp
kerneltest/e32test/usbho/t_otgdi/src/t_otgdi_fdfactor.cpp
kerneltest/e32test/usbho/t_otgdi/src/t_otgdi_fdfactor_main.cpp
kerneltest/e32test/usbho/t_otgdi/src/t_otgdi_uid.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0456.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0457.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0458.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0459.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0460.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0461.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0462.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0463.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0464.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0465.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0466.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0467.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0468.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0469.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0670.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0671.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0675.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0676.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0677.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0678.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0679.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0680.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0681.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0682.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0683.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase0684.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcase1233.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcasecontroller.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcasefactory.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcaseroot.cpp
kerneltest/e32test/usbho/t_otgdi/src/testcasewd.cpp
kerneltest/e32test/usbho/t_otgdi/src/testengine.cpp
kerneltest/e32test/usbho/t_otgdi/src/testpolicy.cpp
kerneltest/e32test/usbho/t_otgdi/traces_t_otgdi/OstTraceDefinitions.h
kerneltest/e32test/usbho/t_otgdi/traces_t_otgdi/fixed_id.definitions
kerneltest/e32test/usbho/t_otgdi/traces_t_otgdi_fdfactor/OstTraceDefinitions.h
kerneltest/e32test/usbho/t_otgdi/traces_t_otgdi_fdfactor/fixed_id.definitions
kerneltest/e32test/usbho/t_usbdi/group/t_usbdi.mmp
kerneltest/e32test/usbho/t_usbdi/group/t_usbhost_usbman.mmp
kerneltest/e32test/usbho/t_usbdi/inc/BasicWatcher.h
kerneltest/e32test/usbho/t_usbdi/inc/EndpointStallWatcher.h
kerneltest/e32test/usbho/t_usbdi/inc/HostTransfers.h
kerneltest/e32test/usbho/t_usbdi/inc/testdebug.h
kerneltest/e32test/usbho/t_usbdi/src/BaseBulkTestCase.cpp
kerneltest/e32test/usbho/t_usbdi/src/BaseTestCase.cpp
kerneltest/e32test/usbho/t_usbdi/src/BasicWatcher.cpp
kerneltest/e32test/usbho/t_usbdi/src/Ep0Reader.cpp
kerneltest/e32test/usbho/t_usbdi/src/FDFActor.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0472.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0473.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0474.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0475.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0476.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0477.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0478.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0479.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0480.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0481.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0482.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0483.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0484.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0485.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0486.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0487.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0488.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0489.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0490.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0491.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0492.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0493.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0494.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0495.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0496.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0497.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0498.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0499.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0500.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1229.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1230.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1231.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1232.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1234.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1235.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1236.cpp
kerneltest/e32test/usbho/t_usbdi/src/SoftwareConnectTimer.cpp
kerneltest/e32test/usbho/t_usbdi/src/TestCaseController.cpp
kerneltest/e32test/usbho/t_usbdi/src/TestCaseFactory.cpp
kerneltest/e32test/usbho/t_usbdi/src/TestDeviceBase.cpp
kerneltest/e32test/usbho/t_usbdi/src/TestEngine.cpp
kerneltest/e32test/usbho/t_usbdi/src/TestInterfaceBase.cpp
kerneltest/e32test/usbho/t_usbdi/src/TestPolicy.cpp
kerneltest/e32test/usbho/t_usbdi/src/UsbClientStateWatcher.cpp
kerneltest/e32test/usbho/t_usbdi/src/controlendpointreader.cpp
kerneltest/e32test/usbho/t_usbdi/src/controltransferrequests.cpp
kerneltest/e32test/usbho/t_usbdi/src/endpointreader.cpp
kerneltest/e32test/usbho/t_usbdi/src/endpointwriter.cpp
kerneltest/e32test/usbho/t_usbdi/src/hostbulktransfers.cpp
kerneltest/e32test/usbho/t_usbdi/src/hostinterrupttransfers.cpp
kerneltest/e32test/usbho/t_usbdi/src/hostisochronoustransfers.cpp
kerneltest/e32test/usbho/t_usbdi/src/main.cpp
kerneltest/e32test/usbho/t_usbdi/src/testdeviceA.cpp
kerneltest/e32test/usbho/t_usbdi/src/testdeviceC.cpp
kerneltest/e32test/usbho/t_usbdi/src/testdeviceD.cpp
kerneltest/e32test/usbho/t_usbdi/src/testdeviceb.cpp
kerneltest/e32test/usbho/t_usbdi/src/testinterfacesettingbase.cpp
kerneltest/e32test/usbho/t_usbdi/src/vendordevice.cpp
kerneltest/e32test/usbho/t_usbdi/src/wakeuptimer.cpp
kerneltest/e32test/usbho/t_usbdi/t_usbhost_usbman_src/t_usbhost_usbman.cpp
kerneltest/e32test/usbho/t_usbdi/traces_t_usbdi/OstTraceDefinitions.h
kerneltest/e32test/usbho/t_usbdi/traces_t_usbdi/fixed_id.definitions
kerneltest/e32test/usbho/t_usbdi/traces_t_usbhost_usbman/OstTraceDefinitions.h
kerneltest/e32test/usbho/t_usbdi/traces_t_usbhost_usbman/fixed_id.definitions
kerneltest/e32test/video/t_video.cpp
kerneltest/e32test/video/t_videomemory.cpp
kerneltest/e32test/window/t_keys.cpp
kerneltest/e32test/window/t_mmcpw.cpp
kerneltest/e32utils/group/bld.inf
kerneltest/e32utils/hcrscripts/hcrdat.pm
kerneltest/e32utils/hcrscripts/hcrmd.bat
kerneltest/e32utils/hcrscripts/hcrrec.pm
kerneltest/e32utils/hcrscripts/hcrscripts.inf
kerneltest/e32utils/hcrscripts/makehcrdat.pl
kerneltest/e32utils/hcrscripts/test/array_hcrfile.dat
kerneltest/e32utils/hcrscripts/test/array_hcrfile.dat.img
kerneltest/e32utils/hcrscripts/test/array_test.txt
kerneltest/e32utils/hcrscripts/test/integer_hcrfile.dat
kerneltest/e32utils/hcrscripts/test/integer_hcrfile.dat.img
kerneltest/e32utils/hcrscripts/test/integer_test.txt
kerneltest/e32utils/hcrscripts/test/large_hcrfile.dat
kerneltest/e32utils/hcrscripts/test/large_hcrfile.dat.img
kerneltest/e32utils/hcrscripts/test/large_test.txt
kerneltest/e32utils/nistsecurerng/include/cephes.h
kerneltest/e32utils/nistsecurerng/include/config.h
kerneltest/e32utils/nistsecurerng/include/decls.h
kerneltest/e32utils/nistsecurerng/include/defs.h
kerneltest/e32utils/nistsecurerng/include/externs.h
kerneltest/e32utils/nistsecurerng/include/generators.h
kerneltest/e32utils/nistsecurerng/include/genutils.h
kerneltest/e32utils/nistsecurerng/include/matrix.h
kerneltest/e32utils/nistsecurerng/include/stat_fncs.h
kerneltest/e32utils/nistsecurerng/include/utilities.h
kerneltest/e32utils/nistsecurerng/include/utils/openc.h
kerneltest/e32utils/nistsecurerng/src/approximateEntropy.cpp
kerneltest/e32utils/nistsecurerng/src/assess.cpp
kerneltest/e32utils/nistsecurerng/src/blockFrequency.cpp
kerneltest/e32utils/nistsecurerng/src/cephes.cpp
kerneltest/e32utils/nistsecurerng/src/cusum.cpp
kerneltest/e32utils/nistsecurerng/src/dfft.cpp
kerneltest/e32utils/nistsecurerng/src/discreteFourierTransform.cpp
kerneltest/e32utils/nistsecurerng/src/frequency.cpp
kerneltest/e32utils/nistsecurerng/src/generators.cpp
kerneltest/e32utils/nistsecurerng/src/genutils.cpp
kerneltest/e32utils/nistsecurerng/src/linearComplexity.cpp
kerneltest/e32utils/nistsecurerng/src/longestRunOfOnes.cpp
kerneltest/e32utils/nistsecurerng/src/math/erf.cpp
kerneltest/e32utils/nistsecurerng/src/matrix.cpp
kerneltest/e32utils/nistsecurerng/src/nonOverlappingTemplateMatchings.cpp
kerneltest/e32utils/nistsecurerng/src/overlappingTemplateMatchings.cpp
kerneltest/e32utils/nistsecurerng/src/randomExcursions.cpp
kerneltest/e32utils/nistsecurerng/src/randomExcursionsVariant.cpp
kerneltest/e32utils/nistsecurerng/src/rank.cpp
kerneltest/e32utils/nistsecurerng/src/runs.cpp
kerneltest/e32utils/nistsecurerng/src/serial.cpp
kerneltest/e32utils/nistsecurerng/src/universal.cpp
kerneltest/e32utils/nistsecurerng/src/utilities.cpp
kerneltest/e32utils/nistsecurerng/src/utils/openc.cpp
kerneltest/e32utils/nistsecurerng/src/utils/qsort.cpp
kerneltest/e32utils/nistsecurerng/testdata/testdata.zip
kerneltest/e32utils/trace/btrace_analyse.cpp
kerneltest/e32utils/trace/btracevw.pl
kerneltest/f32test/bench/t_fcachebm.cpp
kerneltest/f32test/bench/t_fsysbm.cpp
kerneltest/f32test/concur/t_cfsbench.cpp
kerneltest/f32test/concur/t_cfsmain.cpp
kerneltest/f32test/concur/t_cfsperform.cpp
kerneltest/f32test/demandpaging/t_wdpstress.cpp
kerneltest/f32test/fileshare/handshare.cpp
kerneltest/f32test/fileshare/handshare64bit.cpp
kerneltest/f32test/fileshare/t_handshare.cpp
kerneltest/f32test/filesystem/automounter/automounter.inf
kerneltest/f32test/filesystem/automounter/bld.inf
kerneltest/f32test/filesystem/fat/b_fat32.cpp
kerneltest/f32test/filesystem/fat/group/fatfs.inf
kerneltest/f32test/filesystem/fat/group/t_nonrugged.mmp
kerneltest/f32test/filesystem/fat/t_checkdisk.cpp
kerneltest/f32test/filesystem/fat/t_compat32.cpp
kerneltest/f32test/filesystem/fat/t_fatcorrupt.cpp
kerneltest/f32test/filesystem/fat/t_mount.cpp
kerneltest/f32test/filesystem/fat/t_nonrugged.cpp
kerneltest/f32test/filesystem/fat/t_raw.cpp
kerneltest/f32test/filesystem/fat/t_scn32dr1.cpp
kerneltest/f32test/filesystem/fat/t_scn32dr2.cpp
kerneltest/f32test/filesystem/fat/t_scn32dr3.cpp
kerneltest/f32test/filesystem/fat/t_server.h
kerneltest/f32test/filesystem/fat/t_tscan32.cpp
kerneltest/f32test/fileutils/inc/f32_test_utils.h
kerneltest/f32test/fileutils/inc/tf32testtimer.h
kerneltest/f32test/fileutils/src/f32_test_utils.cpp
kerneltest/f32test/fsstress/t_ramstr.cpp
kerneltest/f32test/fsstress/t_remote.cpp
kerneltest/f32test/fsstress/t_rmain.cpp
kerneltest/f32test/fsstress/t_sesfs.cpp
kerneltest/f32test/group/b_file.mmp
kerneltest/f32test/group/b_mtst.mmp
kerneltest/f32test/group/b_open.mmp
kerneltest/f32test/group/b_osfil.mmp
kerneltest/f32test/group/b_rand.mmp
kerneltest/f32test/group/b_rep.mmp
kerneltest/f32test/group/bld.inf
kerneltest/f32test/group/clean_prepdc.mmp
kerneltest/f32test/group/t_alert.mmp
kerneltest/f32test/group/t_appins.mmp
kerneltest/f32test/group/t_bigfile.mmp
kerneltest/f32test/group/t_blockmap.mmp
kerneltest/f32test/group/t_cfileman.mmp
kerneltest/f32test/group/t_chkuid.mmp
kerneltest/f32test/group/t_clobbr.mmp
kerneltest/f32test/group/t_dcallcaps.mmp
kerneltest/f32test/group/t_dcallfiles.mmp
kerneltest/f32test/group/t_dcdiskadmin.mmp
kerneltest/f32test/group/t_dcdiskadminallfiles.mmp
kerneltest/f32test/group/t_dcnone.mmp
kerneltest/f32test/group/t_dctcb.mmp
kerneltest/f32test/group/t_dctcballfiles.mmp
kerneltest/f32test/group/t_dctcbdiskadmin.mmp
kerneltest/f32test/group/t_dircache.mmp
kerneltest/f32test/group/t_dlocl.mmp
kerneltest/f32test/group/t_dspace.mmp
kerneltest/f32test/group/t_fman.mmp
kerneltest/f32test/group/t_fnames.mmp
kerneltest/f32test/group/t_fragmentdp.mmp
kerneltest/f32test/group/t_fsched.mmp
kerneltest/f32test/group/t_fsrvbm.mmp
kerneltest/f32test/group/t_fsy2k.mmp
kerneltest/f32test/group/t_fsysbm.mmp
kerneltest/f32test/group/t_ftrace.mmp
kerneltest/f32test/group/t_gdir.mmp
kerneltest/f32test/group/t_gen.mmp
kerneltest/f32test/group/t_gen32.mmp
kerneltest/f32test/group/t_handshare.mmp
kerneltest/f32test/group/t_localtime.mmp
kerneltest/f32test/group/t_locate.mmp
kerneltest/f32test/group/t_lock.mmp
kerneltest/f32test/group/t_misc.mmp
kerneltest/f32test/group/t_nmbs.mmp
kerneltest/f32test/group/t_notifier.mmp
kerneltest/f32test/group/t_notify.mmp
kerneltest/f32test/group/t_notify_mfs.mmp
kerneltest/f32test/group/t_notify_perf.mmp
kerneltest/f32test/group/t_notifydismount.mmp
kerneltest/f32test/group/t_oom.mmp
kerneltest/f32test/group/t_open.mmp
kerneltest/f32test/group/t_parse.mmp
kerneltest/f32test/group/t_proc.mmp
kerneltest/f32test/group/t_ramstr.mmp
kerneltest/f32test/group/t_rand.mmp
kerneltest/f32test/group/t_rcount.mmp
kerneltest/f32test/group/t_rdsect.mmp
kerneltest/f32test/group/t_resize.mmp
kerneltest/f32test/group/t_romg.mmp
kerneltest/f32test/group/t_scan.mmp
kerneltest/f32test/group/t_sess.mmp
kerneltest/f32test/group/t_soak1.mmp
kerneltest/f32test/group/t_vfat.mmp
kerneltest/f32test/group/t_virus.mmp
kerneltest/f32test/group/t_wcache.mmp
kerneltest/f32test/group/t_whet.mmp
kerneltest/f32test/group/t_whetvfp.mmp
kerneltest/f32test/group/wintest.bat
kerneltest/f32test/loader/dlltree.pl
kerneltest/f32test/loader/exet.cpp
kerneltest/f32test/loader/ldrtst.flm
kerneltest/f32test/loader/security/exet.cpp
kerneltest/f32test/loader/t_ldrtst.cpp
kerneltest/f32test/locl/t_filematch.cpp
kerneltest/f32test/manager/t_clobbr.cpp
kerneltest/f32test/manager/t_oom.cpp
kerneltest/f32test/manager/t_romg.cpp
kerneltest/f32test/plugins/version_2/crypto_encryption/group/t_encplugin.mmp
kerneltest/f32test/plugins/version_2/file64bit/group/t_file64bit_plugin.mmp
kerneltest/f32test/plugins/version_2/group/t_plugin_v2.mmp
kerneltest/f32test/plugins/version_2beta/t_plugin_v2beta.cpp
kerneltest/f32test/rofs/rofs_tests.mrp
kerneltest/f32test/server/b_file.cpp
kerneltest/f32test/server/b_gen.cpp
kerneltest/f32test/server/b_mtst.cpp
kerneltest/f32test/server/b_open.cpp
kerneltest/f32test/server/b_osfil.cpp
kerneltest/f32test/server/b_rand.cpp
kerneltest/f32test/server/b_rep.cpp
kerneltest/f32test/server/clean_prepdc.cpp
kerneltest/f32test/server/t_alert.cpp
kerneltest/f32test/server/t_appins.cpp
kerneltest/f32test/server/t_bigfile.cpp
kerneltest/f32test/server/t_blockmap.cpp
kerneltest/f32test/server/t_chkuid.cpp
kerneltest/f32test/server/t_corruptlog.cpp
kerneltest/f32test/server/t_cp_plugin.cpp
kerneltest/f32test/server/t_cp_plugintest.cpp
kerneltest/f32test/server/t_dcallcaps.cpp
kerneltest/f32test/server/t_dcallfiles.cpp
kerneltest/f32test/server/t_dcdiskadmin.cpp
kerneltest/f32test/server/t_dcdiskadminallfiles.cpp
kerneltest/f32test/server/t_dcnone.cpp
kerneltest/f32test/server/t_dctcb.cpp
kerneltest/f32test/server/t_dctcballfiles.cpp
kerneltest/f32test/server/t_dctcbdiskadmin.cpp
kerneltest/f32test/server/t_dircache.cpp
kerneltest/f32test/server/t_dirs.cpp
kerneltest/f32test/server/t_dlocl.cpp
kerneltest/f32test/server/t_dspace.cpp
kerneltest/f32test/server/t_ext1.cpp
kerneltest/f32test/server/t_falsespace.cpp
kerneltest/f32test/server/t_fatcharsetconv_aux.cpp
kerneltest/f32test/server/t_fatcharsetconv_aux.h
kerneltest/f32test/server/t_fatcharsetconv_main.cpp
kerneltest/f32test/server/t_file.cpp
kerneltest/f32test/server/t_file64bit.cpp
kerneltest/f32test/server/t_filecache.cpp
kerneltest/f32test/server/t_findcapall.cpp
kerneltest/f32test/server/t_findcapnone.cpp
kerneltest/f32test/server/t_fman.cpp
kerneltest/f32test/server/t_fname.cpp
kerneltest/f32test/server/t_fnames.cpp
kerneltest/f32test/server/t_format.cpp
kerneltest/f32test/server/t_fsched.cpp
kerneltest/f32test/server/t_fsrv.cpp
kerneltest/f32test/server/t_fsy2k.cpp
kerneltest/f32test/server/t_fsys.cpp
kerneltest/f32test/server/t_ftrace.cpp
kerneltest/f32test/server/t_gdir.cpp
kerneltest/f32test/server/t_hungfs.cpp
kerneltest/f32test/server/t_localeutils_cp932.cpp
kerneltest/f32test/server/t_locate.cpp
kerneltest/f32test/server/t_lock.cpp
kerneltest/f32test/server/t_main.cpp
kerneltest/f32test/server/t_misc.cpp
kerneltest/f32test/server/t_mmc.cpp
kerneltest/f32test/server/t_mvdr.cpp
kerneltest/f32test/server/t_nmbs.cpp
kerneltest/f32test/server/t_notifier.cpp
kerneltest/f32test/server/t_notify.cpp
kerneltest/f32test/server/t_notifydismount.cpp
kerneltest/f32test/server/t_open.cpp
kerneltest/f32test/server/t_parse.cpp
kerneltest/f32test/server/t_proxydrive1.cpp
kerneltest/f32test/server/t_pwstr.cpp
kerneltest/f32test/server/t_rand.cpp
kerneltest/f32test/server/t_rcache.cpp
kerneltest/f32test/server/t_rcount.cpp
kerneltest/f32test/server/t_rdsect.cpp
kerneltest/f32test/server/t_rename.cpp
kerneltest/f32test/server/t_resize.cpp
kerneltest/f32test/server/t_scan.cpp
kerneltest/f32test/server/t_vfat.cpp
kerneltest/f32test/server/t_wcache.cpp
kerneltest/f32test/smassstorage/scsiprot/t_ms_scsi.cpp
kerneltest/f32test/smassstorage/src/t_ms_fsunit.cpp
package_definition.xml
package_map.xml
userlibandfileserver/fileserver/automounter/base_f32_automounter.mrp
userlibandfileserver/fileserver/bmarm/efileu.def
userlibandfileserver/fileserver/bwins/efileu.def
userlibandfileserver/fileserver/bx86/efileu.def
userlibandfileserver/fileserver/eabi/efileu.def
userlibandfileserver/fileserver/etshell/ts_com.cpp
userlibandfileserver/fileserver/etshell/ts_edshl.cpp
userlibandfileserver/fileserver/etshell/ts_std.h
userlibandfileserver/fileserver/ftrace/d_ftrace.cpp
userlibandfileserver/fileserver/ftrace/f32trace.h
userlibandfileserver/fileserver/group/bld.inf
userlibandfileserver/fileserver/group/efile.mmh
userlibandfileserver/fileserver/group/efile.mmp
userlibandfileserver/fileserver/group/efile_instrumented.mmp
userlibandfileserver/fileserver/group/efsrv.mmh
userlibandfileserver/fileserver/group/efsrv.mmp
userlibandfileserver/fileserver/group/efsrv_instrumented.mmp
userlibandfileserver/fileserver/group/ftrace.mmp
userlibandfileserver/fileserver/group/release.txt
userlibandfileserver/fileserver/inc/F32plugin.h
userlibandfileserver/fileserver/inc/f32dbg.h
userlibandfileserver/fileserver/inc/f32file.h
userlibandfileserver/fileserver/inc/f32fsys.h
userlibandfileserver/fileserver/inc/f32fsys.inl
userlibandfileserver/fileserver/inc/f32notification.h
userlibandfileserver/fileserver/inc/f32tracedef.h
userlibandfileserver/fileserver/inc/f32ver.h
userlibandfileserver/fileserver/inc/utraceefile.h
userlibandfileserver/fileserver/inc/utraceefsrv.h
userlibandfileserver/fileserver/rom/f32.iby
userlibandfileserver/fileserver/sfat32/fat_table32.cpp
userlibandfileserver/fileserver/sfat32/inc/fat_table32.h
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_dir_cache.cpp
userlibandfileserver/fileserver/sfat32/sl_dir_cache.h
userlibandfileserver/fileserver/sfat32/sl_dir_cache.inl
userlibandfileserver/fileserver/sfat32/sl_disk.cpp
userlibandfileserver/fileserver/sfat32/sl_drv.cpp
userlibandfileserver/fileserver/sfat32/sl_fatcache32.cpp
userlibandfileserver/fileserver/sfat32/sl_file.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/efile.mmh
userlibandfileserver/fileserver/sfile/efile.mmp
userlibandfileserver/fileserver/sfile/sf_cache.cpp
userlibandfileserver/fileserver/sfile/sf_cache_client.cpp
userlibandfileserver/fileserver/sfile/sf_cache_client.h
userlibandfileserver/fileserver/sfile/sf_dat.cpp
userlibandfileserver/fileserver/sfile/sf_debug.cpp
userlibandfileserver/fileserver/sfile/sf_dir.cpp
userlibandfileserver/fileserver/sfile/sf_drv.cpp
userlibandfileserver/fileserver/sfile/sf_ext.cpp
userlibandfileserver/fileserver/sfile/sf_file.cpp
userlibandfileserver/fileserver/sfile/sf_file_cache.cpp
userlibandfileserver/fileserver/sfile/sf_file_cache.h
userlibandfileserver/fileserver/sfile/sf_fmt.cpp
userlibandfileserver/fileserver/sfile/sf_main.cpp
userlibandfileserver/fileserver/sfile/sf_memory_client.cpp
userlibandfileserver/fileserver/sfile/sf_memory_man.cpp
userlibandfileserver/fileserver/sfile/sf_memory_man.h
userlibandfileserver/fileserver/sfile/sf_mnt.cpp
userlibandfileserver/fileserver/sfile/sf_obj.cpp
userlibandfileserver/fileserver/sfile/sf_ops.h
userlibandfileserver/fileserver/sfile/sf_plugin.cpp
userlibandfileserver/fileserver/sfile/sf_plugin.h
userlibandfileserver/fileserver/sfile/sf_plugin_man.cpp
userlibandfileserver/fileserver/sfile/sf_plugin_ops.cpp
userlibandfileserver/fileserver/sfile/sf_plugin_shim.cpp
userlibandfileserver/fileserver/sfile/sf_prel.cpp
userlibandfileserver/fileserver/sfile/sf_raw.cpp
userlibandfileserver/fileserver/sfile/sf_request.cpp
userlibandfileserver/fileserver/sfile/sf_std.h
userlibandfileserver/fileserver/sfile/sf_svr.cpp
userlibandfileserver/fileserver/sfile/sf_sys.cpp
userlibandfileserver/fileserver/sfile/sf_thread.cpp
userlibandfileserver/fileserver/sfile/sf_utl.cpp
userlibandfileserver/fileserver/sfile/traces/OstTraceDefinitions.h
userlibandfileserver/fileserver/sfile/traces/fixed_id.definitions
userlibandfileserver/fileserver/sfsrv/cl_cli.cpp
userlibandfileserver/fileserver/sfsrv/cl_dir.cpp
userlibandfileserver/fileserver/sfsrv/cl_file.cpp
userlibandfileserver/fileserver/sfsrv/cl_fman.cpp
userlibandfileserver/fileserver/sfsrv/cl_fmt.cpp
userlibandfileserver/fileserver/sfsrv/cl_main.cpp
userlibandfileserver/fileserver/sfsrv/cl_plugin.cpp
userlibandfileserver/fileserver/sfsrv/cl_scan.cpp
userlibandfileserver/fileserver/sfsrv/cl_std.h
userlibandfileserver/fileserver/sfsrv/efsrv.mmh
userlibandfileserver/fileserver/sfsrv/efsrv.mmp
userlibandfileserver/fileserver/sfsrv/traces/OstTraceDefinitions.h
userlibandfileserver/fileserver/sfsrv/traces/fixed_id.definitions
userlibandfileserver/fileserver/shostmassstorage/msproxy/hostusbmsproxy.cpp
--- a/baseapitest/basesvs/validation/f32/sfsrv/inc/T_FsData.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/baseapitest/basesvs/validation/f32/sfsrv/inc/T_FsData.h	Wed Sep 01 12:34:56 2010 +0100
@@ -33,7 +33,6 @@
 //	EPOC includes
 #include <e32std.h>
 #include <f32file.h>
-#include <f32file_private.h>
 #include <f32fsys.h>
 
 //	User includes
--- a/brdbootldr/ubootldr/flash_nor.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/brdbootldr/ubootldr/flash_nor.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -28,7 +28,7 @@
 #include <u32hal.h>
 #include "flash_nor.h"
 
-#define KFlashRetries 1000000
+const TUint KFlashRetries = 1000000;
 
 #ifdef __SUPPORT_FLASH_REPRO__
 _LIT(KLitThreadName,"Flash");
--- a/bsptemplate/asspandvariant/template_assp/dma_v2.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-// 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"
-// 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:
-// template/template_assp/dma_v2.mmp
-//
-//
-
-#include		<variant.mmh>
-#include		"kernel/kern_ext.mmh"
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-SYMBIAN_BASE_SYSTEMINCLUDE(assp/template_assp)
-
-target			VariantTarget(dma_v2,dll)
-targettype		kext
-linkas			dma.dll
-noexportlibrary
-
-sourcepath		../../../kernel/eka/drivers/dma
-source			dma2_pil.cpp dma2_shared.cpp
-
-sourcepath		.
-source			dmapsl_v2.cpp
-
-library			VariantTarget(katemplate,lib)
-
-deffile			../../../kernel/eka/~/dma2.def
-
-epocallowdlldata
-
-capability		all
-
-VENDORID 0x70000001
-
-MACRO DMA_APIV2
--- a/bsptemplate/asspandvariant/template_assp/dmapsl_v2.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,480 +0,0 @@
-// 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"
-// 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:
-// bsptemplate/asspvariant/template_assp/dmapsl_v2.cpp
-// Template DMA Platform Specific Layer (PSL).
-//
-//
-
-
-#include <kernel/kern_priv.h>
-#include <template_assp.h>									// /assp/template_assp/
-
-#include <drivers/dma.h>
-#include <drivers/dma_hai.h>
-
-
-// Debug support
-static const char KDmaPanicCat[] = "DMA PSL - " __FILE__;
-
-static const TInt KMaxTransferLen = 0x1FE0;	// max transfer length for this DMAC
-static const TInt KMemAlignMask = 7; // memory addresses passed to DMAC must be multiple of 8
-static const TInt KChannelCount = 16;			// we got 16 channels
-static const TInt KDesCount = 160;				// Initial DMA descriptor count
-
-
-class TDmaDesc
-//
-// Hardware DMA descriptor
-//
-	{
-public:
-	enum {KStopBitMask = 1};
-public:
-	TPhysAddr iDescAddr;
-	TPhysAddr iSrcAddr;
-	TPhysAddr iDestAddr;
-	TUint32 iCmd;
-	};
-
-
-//////////////////////////////////////////////////////////////////////////////
-// Test Support
-//////////////////////////////////////////////////////////////////////////////
-
-/**
-TO DO: Fill in to provide information to the V1 test harness (t_dma.exe)
-*/
-TDmaTestInfo TestInfo =
-	{
-	0,
-	0,
-	0,
-	0,
-	NULL,
-	0,
-	NULL,
-	0,
-	NULL
-	};
-
-
-EXPORT_C const TDmaTestInfo& DmaTestInfo()
-//
-//
-//
-	{
-	return TestInfo;
-	}
-
-/**
-TO DO: Fill in to provide information to the V2 test harness (t_dma2.exe)
-*/
-TDmaV2TestInfo TestInfov2 =
-	{
-	0,
-	0,
-	0,
-	0,
-	{0},
-	0,
-	{0},
-	0,
-	{0}
-	};
-
-EXPORT_C const TDmaV2TestInfo& DmaTestInfoV2()
-	{
-	return TestInfov2;
-	}
-
-//////////////////////////////////////////////////////////////////////////////
-// Helper Functions
-//////////////////////////////////////////////////////////////////////////////
-
-inline TBool IsHwDesAligned(TAny* aDes)
-//
-// Checks whether given hardware descriptor is 16-bytes aligned.
-//
-	{
-	return ((TLinAddr)aDes & 0xF) == 0;
-	}
-
-
-static TUint32 DmaCmdReg(TUint aCount, TUint aFlags, TUint32 aSrcPslInfo, TUint32 aDstPslInfo)
-//
-// Returns value to set in DMA command register or in descriptor command field.
-//
-	{
-	// TO DO: Construct CMD word from input values.
-	// The return value should reflect the actual control word.
-	return (aCount | aFlags | aSrcPslInfo | aDstPslInfo);
-	}
-
-
-//////////////////////////////////////////////////////////////////////////////
-// Derived Channel (Scatter/Gather)
-//////////////////////////////////////////////////////////////////////////////
-
-class TTemplateSgChannel : public TDmaSgChannel
-	{
-public:
-	TDmaDesc* iTmpDes;
-	TPhysAddr iTmpDesPhysAddr;
-	};
-
-
-//////////////////////////////////////////////////////////////////////////////
-// Derived Controller Class
-//////////////////////////////////////////////////////////////////////////////
-
-class TTemplateDmac : public TDmac
-	{
-public:
-	TTemplateDmac();
-	TInt Create();
-private:
-	// from TDmac (PIL pure virtual)
-	virtual void StopTransfer(const TDmaChannel& aChannel);
-	virtual TBool IsIdle(const TDmaChannel& aChannel);
-	virtual TUint MaxTransferLength(TDmaChannel& aChannel, TUint aSrcFlags,
-									TUint aDstFlags, TUint32 aPslInfo);
-	virtual TUint AddressAlignMask(TDmaChannel& aChannel, TUint aSrcFlags,
-								   TUint aDstFlags, TUint32 aPslInfo);
-	// from TDmac (PIL virtual)
-	virtual void Transfer(const TDmaChannel& aChannel, const SDmaDesHdr& aHdr);
-	virtual TInt InitHwDes(const SDmaDesHdr& aHdr, const TDmaTransferArgs& aTransferArgs);
-	virtual void ChainHwDes(const SDmaDesHdr& aHdr, const SDmaDesHdr& aNextHdr);
-	virtual void AppendHwDes(const TDmaChannel& aChannel, const SDmaDesHdr& aLastHdr,
-							 const SDmaDesHdr& aNewHdr);
-	virtual void UnlinkHwDes(const TDmaChannel& aChannel, SDmaDesHdr& aHdr);
-	// other
-	static void Isr(TAny* aThis);
-	inline TDmaDesc* HdrToHwDes(const SDmaDesHdr& aHdr);
-private:
-	static const SCreateInfo KInfo;
-public:
-	TTemplateSgChannel iChannels[KChannelCount];
-	};
-
-
-static TTemplateDmac Controller;
-
-
-const TDmac::SCreateInfo TTemplateDmac::KInfo =
-	{
-	ETrue,													// iCapsHwDes
-	KDesCount,												// iDesCount
-	sizeof(TDmaDesc),										// iDesSize
-	EMapAttrSupRw | EMapAttrFullyBlocking					// iDesChunkAttribs
-	};
-
-
-TTemplateDmac::TTemplateDmac()
-//
-// Constructor.
-//
-	: TDmac(KInfo)
-	{}
-
-
-TInt TTemplateDmac::Create()
-//
-// Second phase construction.
-//
-	{
-	TInt r = TDmac::Create(KInfo);							// Base class Create()
-	if (r == KErrNone)
-		{
-		__DMA_ASSERTA(ReserveSetOfDes(KChannelCount) == KErrNone);
-		for (TInt i=0; i < KChannelCount; ++i)
-			{
-			TDmaDesc* pD = HdrToHwDes(*iFreeHdr);
-			iChannels[i].iTmpDes = pD;
-			iChannels[i].iTmpDesPhysAddr = HwDesLinToPhys(pD);
-			iFreeHdr = iFreeHdr->iNext;
-			}
-		r = Interrupt::Bind(EAsspIntIdDma, Isr, this);
-		if (r == KErrNone)
-			{
-			// TO DO: Map DMA clients (requests) to DMA channels here.
-
-			r = Interrupt::Enable(EAsspIntIdDma);
-			}
-		}
-	return r;
-	}
-
-
-void TTemplateDmac::Transfer(const TDmaChannel& aChannel, const SDmaDesHdr& aHdr)
-//
-// Initiates a (previously constructed) request on a specific channel.
-//
-	{
-	const TUint8 i = static_cast<TUint8>(aChannel.PslId());
-	TDmaDesc* pD = HdrToHwDes(aHdr);
-
-	__KTRACE_OPT(KDMA, Kern::Printf(">TTemplateDmac::Transfer channel=%d des=0x%08X", i, pD));
-
-	// TO DO (for instance): Load the first descriptor address into the DMAC and start it
-	// by setting the RUN bit.
-	(void) *pD, (void) i;
-
-	}
-
-
-void TTemplateDmac::StopTransfer(const TDmaChannel& aChannel)
-//
-// Stops a running channel.
-//
-	{
-	const TUint8 i = static_cast<TUint8>(aChannel.PslId());
-
-	__KTRACE_OPT(KDMA, Kern::Printf(">TTemplateDmac::StopTransfer channel=%d", i));
-
-	// TO DO (for instance): Clear the RUN bit of the channel.
-	(void) i;
-
-	}
-
-
-TBool TTemplateDmac::IsIdle(const TDmaChannel& aChannel)
-//
-// Returns the state of a given channel.
-//
-	{
-	const TUint8 i = static_cast<TUint8>(aChannel.PslId());
-
-	__KTRACE_OPT(KDMA, Kern::Printf(">TTemplateDmac::IsIdle channel=%d", i));
-
-	// TO DO (for instance): Return the state of the RUN bit of the channel.
-	// The return value should reflect the actual state.
-	(void) i;
-
-	return ETrue;
-	}
-
-
-TUint TTemplateDmac::MaxTransferLength(TDmaChannel& /*aChannel*/, TUint /*aSrcFlags*/,
-									   TUint /*aDstFlags*/, TUint32 /*aPslInfo*/)
-//
-// Returns the maximum transfer length in bytes for a given transfer.
-//
-	{
-	// TO DO: Determine the proper return value, based on the arguments.
-
-	// For instance:
-	return KMaxTransferLen;
-	}
-
-
-TUint TTemplateDmac::AddressAlignMask(TDmaChannel& aChannel, TUint /*aSrcFlags*/,
-									  TUint /*aDstFlags*/, TUint32 /*aPslInfo*/)
-//
-// Returns the memory buffer alignment restrictions mask for a given transfer.
-//
-	{
-	// TO DO: Determine the proper return value, based on the arguments.
-
-	// For instance:
-	return KMemAlignMask;
-	}
-
-
-TInt TTemplateDmac::InitHwDes(const SDmaDesHdr& aHdr, const TDmaTransferArgs& aTransferArgs)
-//
-// Sets up (from a passed in request) the descriptor with that fragment's
-// source and destination address, the fragment size, and the (driver/DMA
-// controller) specific transfer parameters (mem/peripheral, burst size,
-// transfer width).
-//
-	{
-	TDmaDesc* pD = HdrToHwDes(aHdr);
-
-	__KTRACE_OPT(KDMA, Kern::Printf("TTemplateDmac::InitHwDes 0x%08X", pD));
-
-	// Unaligned descriptor? Bug in generic layer!
-	__DMA_ASSERTD(IsHwDesAligned(pD));
-
-	const TDmaTransferConfig& src = aTransferArgs.iSrcConfig;
-	const TDmaTransferConfig& dst = aTransferArgs.iDstConfig;
-	pD->iSrcAddr  = (src.iFlags & KDmaPhysAddr) ? src.iAddr : Epoc::LinearToPhysical(src.iAddr);
-	__DMA_ASSERTD(pD->iSrcAddr != KPhysAddrInvalid);
-	pD->iDestAddr = (dst.iFlags & KDmaPhysAddr) ? dst.iAddr : Epoc::LinearToPhysical(dst.iAddr);
-	__DMA_ASSERTD(pD->iDestAddr != KPhysAddrInvalid);
-	pD->iCmd = DmaCmdReg(aTransferArgs.iTransferCount, aTransferArgs.iFlags,
-					   src.iPslTargetInfo, dst.iPslTargetInfo);
-	pD->iDescAddr = TDmaDesc::KStopBitMask;
-
-	return KErrNone;
-	}
-
-
-void TTemplateDmac::ChainHwDes(const SDmaDesHdr& aHdr, const SDmaDesHdr& aNextHdr)
-//
-// Chains hardware descriptors together by setting the next pointer of the original descriptor
-// to the physical address of the descriptor to be chained.
-//
-	{
-	TDmaDesc* pD = HdrToHwDes(aHdr);
-	TDmaDesc* pN = HdrToHwDes(aNextHdr);
-
-	__KTRACE_OPT(KDMA, Kern::Printf("TTemplateDmac::ChainHwDes des=0x%08X next des=0x%08X", pD, pN));
-
-	// Unaligned descriptor? Bug in generic layer!
-	__DMA_ASSERTD(IsHwDesAligned(pD) && IsHwDesAligned(pN));
-
-	// TO DO: Modify pD->iCmd so that no end-of-transfer interrupt gets raised any longer.
-
-	pD->iDescAddr = HwDesLinToPhys(pN);
-	}
-
-
-void TTemplateDmac::AppendHwDes(const TDmaChannel& aChannel, const SDmaDesHdr& aLastHdr,
-								const SDmaDesHdr& aNewHdr)
-//
-// Appends a descriptor to the chain while the channel is running.
-//
-	{
-	const TUint8 i = static_cast<TUint8>(aChannel.PslId());
-
-	TDmaDesc* pL = HdrToHwDes(aLastHdr);
-	TDmaDesc* pN = HdrToHwDes(aNewHdr);
-
-	__KTRACE_OPT(KDMA, Kern::Printf(">TTemplateDmac::AppendHwDes channel=%d last des=0x%08X new des=0x%08X",
-									i, pL, pN));
-	// Unaligned descriptor? Bug in generic layer!
-	__DMA_ASSERTD(IsHwDesAligned(pL) && IsHwDesAligned(pN));
-
-	TPhysAddr newPhys = HwDesLinToPhys(pN);
-
-	const TInt irq = NKern::DisableAllInterrupts();
-	StopTransfer(aChannel);
-
-	pL->iDescAddr = newPhys;
-	const TTemplateSgChannel& channel = static_cast<const TTemplateSgChannel&>(aChannel);
-	TDmaDesc* pD = channel.iTmpDes;
-
-	// TO DO: Implement the appropriate algorithm for appending a descriptor here.
-	(void) *pD, (void) i;
-
-	NKern::RestoreInterrupts(irq);
-
-	__KTRACE_OPT(KDMA, Kern::Printf("<TTemplateDmac::AppendHwDes"));
-	}
-
-
-void TTemplateDmac::UnlinkHwDes(const TDmaChannel& /*aChannel*/, SDmaDesHdr& aHdr)
-//
-// Unlink the last item in the h/w descriptor chain from a subsequent chain that it was
-// possibly linked to.
-//
-	{
- 	__KTRACE_OPT(KDMA, Kern::Printf(">TTemplateDmac::UnlinkHwDes"));
-  	TDmaDesc* pD = HdrToHwDes(aHdr);
-  	pD->iDescAddr = TDmaDesc::KStopBitMask;
-
-	// TO DO: Modify pD->iCmd so that an end-of-transfer interrupt will get raised.
-
-	}
-
-
-void TTemplateDmac::Isr(TAny* aThis)
-//
-// This ISR reads the interrupt identification and calls back into the base class
-// interrupt service handler with the channel identifier and an indication whether the
-// transfer completed correctly or with an error.
-//
-	{
-	TTemplateDmac& me = *static_cast<TTemplateDmac*>(aThis);
-
-	// TO DO: Implement the behaviour described above, call HandleIsr().
-
-	HandleIsr(me.iChannels[5], EDmaCallbackRequestCompletion, ETrue); // Example
-
-	}
-
-
-inline TDmaDesc* TTemplateDmac::HdrToHwDes(const SDmaDesHdr& aHdr)
-//
-// Changes return type of base class call.
-//
-	{
-	return static_cast<TDmaDesc*>(TDmac::HdrToHwDes(aHdr));
-	}
-
-
-//////////////////////////////////////////////////////////////////////////////
-// Channel Opening/Closing (Channel Allocator)
-//////////////////////////////////////////////////////////////////////////////
-
-TDmaChannel* DmaChannelMgr::Open(TUint32 aOpenId, TBool /*aDynChannel*/, TUint /*aPriority*/)
-//
-//
-//
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf(">DmaChannelMgr::Open aOpenId=%d", aOpenId));
-
-	__DMA_ASSERTA(aOpenId < static_cast<TUint32>(KChannelCount));
-
-	TDmaChannel* pC = Controller.iChannels + aOpenId;
-	if (pC->IsOpened())
-		{
-		pC = NULL;
-		}
-	else
-		{
-		pC->iController = &Controller;
-		pC->iPslId = aOpenId;
-		}
-
-	return pC;
-	}
-
-
-void DmaChannelMgr::Close(TDmaChannel* /*aChannel*/)
-//
-//
-//
-	{
-	// NOP
-	}
-
-
-TInt DmaChannelMgr::StaticExtension(TInt /*aCmd*/, TAny* /*aArg*/)
-//
-//
-//
-	{
-	return KErrNotSupported;
-	}
-
-
-//////////////////////////////////////////////////////////////////////////////
-// DLL Exported Function
-//////////////////////////////////////////////////////////////////////////////
-
-DECLARE_STANDARD_EXTENSION()
-//
-// Creates and initializes a new DMA controller object on the kernel heap.
-//
-	{
-	__KTRACE_OPT2(KBOOT, KDMA, Kern::Printf("Starting DMA Extension"));
-
-	const TInt r = DmaChannelMgr::Initialise();
-	if (r != KErrNone)
-		{
-		return r;
-		}
-	return Controller.Create();
-	}
--- a/bsptemplate/asspandvariant/template_assp/gpio.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/bsptemplate/asspandvariant/template_assp/gpio.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -39,87 +39,6 @@
 
 static TInt32	GpioInterruptId; // place to store interrupt handle returned from Interrupt::Bind()
 
-
-/**
-Calculate 16-bit device pin Id from 32-bit pin Id. Use DeviceId() to 
-get device Id.
-@param   aId         32-bit pin Id
-@return  16-bit device specific pin Id
- */
-static inline TUint16 DevicePinId(TInt aId)
-    {return static_cast<TUint16>(aId & 0x0000FFFF);}
-
-
-//Commented out to satisfy compiler(as method is not used in the code) but can  
-//be usefull later
-/**
-Calculate and return GPIO device Id(either SOC or one of the extenders)
-defined in TGpioBaseId from the 32-bit pin Id
-@param   aId         32-bit pin Id
-@return
-   - EInternalId              SOC GPIO 
-   - EExtender0-15            GPIO extenders from 0-15
-
-static inline GPIO::TGpioBaseId ExtenderId(TInt aId)
-    {return static_cast<GPIO::TGpioBaseId>((aId & 0xFFFF0000));}
-*/
-
-//Commented out to satisfy compiler(as method is not used in the code) but can  
-//be usefull later
-/**
-Generate 32-bit pin Id from the device Id and device specific 16-bit 
-pin Id.
-@param   aExtenderId     Device Id is defined in TGpioBaseId
-@param   aPinId          16-bit device pin Id
-return   32-bit pin Id  
-
-static inline TInt Id(GPIO::TGpioBaseId aExtenderId, TUint16 aPinId)
-    {return static_cast<TInt>(aExtenderId |aPinId);}
-*/
-
-//Commented out to satisfy compiler(as method is not used in the code) but can  
-//be usefull later
-/**
-Find index in extender GPIO device table.
-@param   aExtenderId     Extender Id is defined in TGpioBaseId
-@return  singned 32-bit integer index device, possible value 
-        from 0 to 15
- 
-static TInt DeviceIndex(GPIO::TGpioBaseId aExtenderId)
-    {
-    TUint16 val = (TUint16)((aExtenderId & 0xFFFF0000) >> 16);
-    if(val == 0) return GPIO::EInternalId;
-
-    //The algorithm steps througth the value until first non-zero bit is
-    //found.
-    //
-    TInt index = 0;
-    if(val & 0xFF00) {index  = 8; val = val >> 8;} // 2 x 8-bits
-    if(val & 0x00F0) {index += 4; val = val >> 4;} // 2 x 4-bits
-    if(val & 0x000C) {index += 2; val = val >> 2;} // 2 x 2 bits
-    if(val & 0x0002) {index += 1; val = val >> 1;} // 2 x 1 bits
-
-    return index;
-    }
-*/
-
-
-//Commented out to satisfy compiler(as method is not used in the code) but can  
-//be usefull later
-/**
-Find index in extender GPIO device table.
-@param   aId    32-bit GPIO pin Id
-@return  singned 32-bit integer index device, possible value 
-         from 0 to 15
-
-static TInt DeviceIndex(TInt aId){return DeviceIndex(ExtenderId(aId));}
-*/
-
-
-
-
-
-
 /**
 GPIO interrupt handler
 generic argument (TAny*) is a pointer to the GpioPins array
@@ -153,8 +72,7 @@
    	TGpioMode aMode
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
@@ -168,8 +86,7 @@
    	TGpioMode & aMode
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
@@ -183,8 +100,7 @@
    	TGpioDirection aDirection
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax || aDirection == ETriStated)
+	if (aId < 0 || aId > KHwGpioPinMax || aDirection == ETriStated)
 		{
 		return KErrArgument;
 		}
@@ -198,8 +114,7 @@
    	TGpioDirection & aDirection
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
@@ -213,8 +128,7 @@
    	TGpioBias aBias
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
@@ -228,8 +142,7 @@
    	TGpioBias & aBias
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
@@ -243,8 +156,7 @@
    	TInt		/*aConf*/
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
@@ -258,8 +170,7 @@
    	TInt	  & aBias
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
@@ -274,19 +185,18 @@
    	TAny *   aPtr
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax || aIsr == NULL)
+	if (aId < 0 || aId > KHwGpioPinMax || aIsr == NULL)
 		{
 		return KErrArgument;
 		}
-	if (GpioPins[pinId].iIsr != NULL)
+	if (GpioPins[aId].iIsr != NULL)
 		{
 		// already bound
 		return KErrInUse;
 		}
 	// record isr and arg bound to this pin
-	GpioPins[pinId].iIsr = aIsr;
-	GpioPins[pinId].iPtr = aPtr;
+	GpioPins[aId].iIsr = aIsr;
+	GpioPins[aId].iPtr = aPtr;
 	return KErrNone;
 	}
 
@@ -295,19 +205,18 @@
 	TInt aId
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
-	if (GpioPins[pinId].iIsr == NULL)
+	if (GpioPins[aId].iIsr == NULL)
 		{
 		// nothing bound
 		return KErrGeneral;
 		}
 	// NULL isr bound to this pin
-	GpioPins[pinId].iIsr = NULL;
-	GpioPins[pinId].iPtr = NULL;
+	GpioPins[aId].iIsr = NULL;
+	GpioPins[aId].iPtr = NULL;
 	return KErrNone;
 	}
 
@@ -316,12 +225,11 @@
 	TInt aId
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
-	if (GpioPins[pinId].iIsr == NULL)
+	if (GpioPins[aId].iIsr == NULL)
 		{
 		// nothing bound
 		return KErrGeneral;
@@ -335,12 +243,11 @@
 	TInt aId
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
-	if (GpioPins[pinId].iIsr == NULL)
+	if (GpioPins[aId].iIsr == NULL)
 		{
 		// nothing bound
 		return KErrGeneral;
@@ -355,12 +262,11 @@
    	TBool & aEnable
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
-	if (GpioPins[pinId].iIsr == NULL)
+	if (GpioPins[aId].iIsr == NULL)
 		{
 		// nothing bound
 		return KErrGeneral;
@@ -374,12 +280,11 @@
 	TInt aId
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
-	if (GpioPins[pinId].iIsr == NULL)
+	if (GpioPins[aId].iIsr == NULL)
 		{
 		// nothing bound
 		return KErrGeneral;
@@ -394,8 +299,7 @@
    	TBool & aActive
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
@@ -409,8 +313,7 @@
    	TBool & aActive
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
@@ -424,8 +327,7 @@
    	TGpioDetectionTrigger aTrigger
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
@@ -438,8 +340,7 @@
 	TInt aId
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
@@ -452,8 +353,7 @@
 	TInt aId
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
@@ -467,8 +367,7 @@
    	TBool & aEnable
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
@@ -482,8 +381,7 @@
    	TGpioDetectionTrigger aTrigger
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
@@ -497,8 +395,7 @@
    	TInt aTime
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
@@ -513,8 +410,7 @@
    	TInt & aTime
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
@@ -528,8 +424,7 @@
    	TGpioState & aState
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
@@ -547,8 +442,7 @@
    	TGpioState aState
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
@@ -562,8 +456,7 @@
    	TGpioState & aState
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
@@ -577,8 +470,7 @@
    	TGpioCallback		* aCb
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
@@ -593,8 +485,7 @@
    	TGpioCallback		* aCb
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
@@ -610,8 +501,7 @@
 	TAny	* aArg2
 	)
 	{
-    TUint16 pinId = DevicePinId(aId);
-	if (pinId > KHwGpioPinMax)
+	if (aId < 0 || aId > KHwGpioPinMax)
 		{
 		return KErrArgument;
 		}
--- a/bsptemplate/asspandvariant/template_assp/pa_usbc.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/bsptemplate/asspandvariant/template_assp/pa_usbc.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1904,7 +1904,7 @@
 #ifdef _DEBUG
 	_LIT(KIns, "inserted");
 	_LIT(KRem, "removed");
-	__KTRACE_OPT(KUSB, Kern::Printf(" > USB cable now %S", ptr->iCableConnected ? &KIns : &KRem));
+	__KTRACE_OPT(KUSB, Kern::Printf(" > USB cable now %lS", ptr->iCableConnected ? &KIns : &KRem));
 #endif
 	if (ptr->iCableConnected)
 		{
--- a/bsptemplate/asspandvariant/template_assp/template_assp.inf	Tue Aug 31 16:34:26 2010 +0300
+++ b/bsptemplate/asspandvariant/template_assp/template_assp.inf	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-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"
@@ -38,6 +38,5 @@
 
 katemplate
 dma
-dma_v2
 usbcc
 gpio
--- a/bsptemplate/asspandvariant/template_assp/traces_usbcc/OstTraceDefinitions.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-// 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:
-// 
-//
-
-
-#ifndef __OSTTRACEDEFINITIONS_H__
-#define __OSTTRACEDEFINITIONS_H__
-// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
-// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
-// #define OST_TRACE_COMPILER_IN_USE
-#include <opensystemtrace.h>
-#endif
--- a/bsptemplate/asspandvariant/template_assp/traces_usbcc/fixed_id.definitions	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,767 +0,0 @@
-#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
-[GROUP]TRACE_FATAL=0x81
-[GROUP]TRACE_FLOW=0x8a
-[GROUP]TRACE_NORMAL=0x86
-[TRACE]TRACE_FATAL[0x81]_DUP1_TUSBCCONFIGDESCRIPTOR_CONSTRUCT_DUP1=0x43
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_ACTIVATEHARDWARECONTROLLER_DUP2=0xe7
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_ACTIVATEHARDWARECONTROLLER_DUP3=0xe8
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CABLESTATUSTIMERCALLBACK_DUP1=0xfa
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CANCELREADBUFFER_DUP1=0xaa
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CANCELWRITEBUFFER_DUP1=0xab
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP3=0x3f
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CHECKEPAVAILABILITY_DUP1=0xd2
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP1=0xda
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP2=0xdb
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP3=0xdc
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP4=0xdd
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP5=0xde
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP6=0xdf
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP1=0xd3
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP10=0xd9
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP3=0xd4
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP5=0xd5
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP6=0xd6
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP8=0xd7
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP9=0xd8
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_DEACTIVATEHARDWARECONTROLLER_DUP2=0xe9
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_DELETEINTERFACESET_DUP1=0xea
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_DELETEINTERFACESET_DUP2=0xeb
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_DELETEINTERFACE_DUP1=0xec
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_DELETEINTERFACE_DUP2=0xed
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_DISABLECLIENTSTACK_DUP2=0x8d
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_ENABLECLIENTSTACK_DUP2=0x8e
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_ENABLECLIENTSTACK_DUP3=0x8f
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_ENDPOINTPACKETSIZE_DUP1=0xcc
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_ENDPOINTPACKETSIZE_DUP4=0xcd
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP1=0xee
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP3=0xef
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP4=0xf0
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP5=0xf1
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP3=0xf7
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP6=0xf8
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETCSENDPOINTDESCRIPTORBLOCKSIZE_DUP1=0xca
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETCSENDPOINTDESCRIPTORBLOCKSIZE_DUP2=0xcb
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETCSENDPOINTDESCRIPTORBLOCK_DUP1=0xc7
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETCSINTERFACEDESCRIPTORBLOCKSIZE_DUP1=0xc5
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETCSINTERFACEDESCRIPTORBLOCKSIZE_DUP2=0xc6
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETCSINTERFACEDESCRIPTORBLOCK_DUP1=0xc2
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETENDPOINTDESCRIPTORSIZE_DUP1=0xc0
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETENDPOINTDESCRIPTORSIZE_DUP2=0xc1
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETENDPOINTDESCRIPTOR_DUP1=0xbe
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETINTERFACEDESCRIPTORSIZE_DUP1=0xbd
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETINTERFACEDESCRIPTOR_DUP1=0xb4
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETINTERFACENUMBER_DUP1=0x9a
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_GETINTERFACENUMBER_DUP2=0x9b
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_HANDLEHNPREQUEST_DUP1=0xd0
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_HANDLEHNPREQUEST_DUP2=0xd1
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP3=0xcf
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP3=0x41
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP4=0x42
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_INTERFACESETUP_DUP3=0x40
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_NEXTDEVICESTATE_DUP2=0xf2
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_NEXTDEVICESTATE_DUP3=0xf3
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_POWERDOWNDFC_DUP1=0xfc
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_POWERUPDFC_DUP1=0xfb
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_POWERUPUDC_DUP3=0x97
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSCABLEINSERTEVENT_DUP1=0xf5
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSCABLEREMOVEEVENT_DUP1=0xf6
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP2=0xf
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP3=0x10
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP4=0x11
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP13=0x2
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP21=0x3
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP22=0x4
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP26=0x5
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP27=0x6
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP36=0x7
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP37=0x8
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP38=0x9
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP40=0xa
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP41=0xb
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP42=0xc
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP44=0xd
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP48=0xe
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSEP0TRANSMITDONE_DUP1=0x1
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION_DUP1=0x30
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION_DUP2=0x31
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION_DUP3=0x32
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR_DUP1=0x2d
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR_DUP4=0x2e
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETDEVICESTATUS_DUP1=0x12
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETENDPOINTSTATUS_DUP1=0x15
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETENDPOINTSTATUS_DUP2=0x16
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETINTERFACESTATUS_DUP1=0x13
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETINTERFACESTATUS_DUP2=0x14
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETINTERFACE_DUP1=0x35
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETINTERFACE_DUP2=0x36
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSGETINTERFACE_DUP3=0x37
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSRESETEVENT_DUP5=0xf4
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETADDRESS_DUP1=0x2b
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETADDRESS_DUP2=0x2c
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP1=0x17
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP10=0x20
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP11=0x21
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP12=0x22
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP13=0x23
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP14=0x24
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP15=0x25
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP2=0x18
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP3=0x19
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP4=0x1a
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP5=0x1b
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP6=0x1c
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP7=0x1d
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP8=0x1e
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP9=0x1f
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEAREPFEATURE_DUP1=0x27
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEAREPFEATURE_DUP2=0x28
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEAREPFEATURE_DUP3=0x29
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEAREPFEATURE_DUP4=0x2a
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARIFCFEATURE_DUP1=0x26
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCONFIGURATION_DUP1=0x33
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETCONFIGURATION_DUP2=0x34
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETDESCRIPTOR_DUP1=0x2f
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE_DUP1=0x38
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE_DUP2=0x39
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE_DUP3=0x3a
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE_DUP4=0x3b
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSYNCHFRAME_DUP1=0x3c
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSYNCHFRAME_DUP2=0x3d
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_PROCESSSYNCHFRAME_DUP3=0x3e
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_RECONNECTTIMERCALLBACK_DUP1=0xf9
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_REENUMERATE_DUP3=0x96
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_REGISTERCLIENTCALLBACK_DUP1=0x90
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_REGISTERFORENDPOINTSTATUSCHANGE_DUP1=0x99
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_REGISTERFOROTGFEATURECHANGE_DUP1=0xb3
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_REGISTERFORSTATUSCHANGE_DUP1=0x98
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_REGISTERUDC_DUP1=0xce
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_RELEASEDEVICECONTROL_DUP2=0xae
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_RELEASEDEVICECONTROL_DUP3=0xaf
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETCSENDPOINTDESCRIPTORBLOCK_DUP1=0xc8
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETCSENDPOINTDESCRIPTORBLOCK_DUP2=0xc9
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETCSINTERFACEDESCRIPTORBLOCK_DUP1=0xc3
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETCSINTERFACEDESCRIPTORBLOCK_DUP2=0xc4
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETDEVICECONTROL_DUP1=0xac
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETDEVICECONTROL_DUP2=0xad
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETENDPOINTDESCRIPTOR_DUP1=0xbf
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETENDPOINTZEROMAXPACKETSIZE_DUP1=0xb0
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP1=0xb5
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP2=0xb6
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP3=0xb7
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP4=0xb8
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP5=0xb9
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP6=0xba
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP7=0xbb
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP8=0xbc
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACE_DUP2=0x92
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACE_DUP3=0x93
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACE_DUP4=0x94
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETINTERFACE_DUP5=0x95
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP1=0xb1
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP3=0xb2
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP1=0xe0
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP2=0xe1
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP3=0xe2
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP4=0xe3
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP5=0xe4
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP6=0xe5
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP7=0xe6
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP13=0xa1
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP3=0x9c
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP4=0x9d
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP5=0x9e
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP7=0x9f
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP8=0xa0
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP10=0xa8
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP11=0xa9
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP3=0xa2
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP4=0xa3
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP5=0xa4
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP6=0xa5
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP7=0xa6
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP8=0xa7
-[TRACE]TRACE_FATAL[0x81]_DUSBCLIENTCONTROLLER_USBCCONTROLLERPOINTER_DUP1=0x91
-[TRACE]TRACE_FATAL[0x81]_TSGLQUEBASE_DOREMOVE=0xfd
-[TRACE]TRACE_FATAL[0x81]_TUSBCCLASSSPECIFICDESCRIPTOR_CONSTRUCT_DUP1=0x48
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP1=0x79
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP2=0x7a
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP8=0x7b
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_DELETEIFCDESCRIPTOR_DUP1=0x5c
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP1=0x50
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP12=0x58
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP13=0x59
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP2=0x51
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP3=0x52
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP4=0x53
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP5=0x54
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP6=0x55
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP7=0x56
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP8=0x57
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDEPDESCRIPTOR_DUP1=0x76
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDEPDESCRIPTOR_DUP2=0x77
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDEPDESCRIPTOR_DUP3=0x78
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_FINDIFCDESCRIPTOR_DUP1=0x75
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP2=0x7d
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP5=0x7e
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP6=0x7f
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETCSENDPOINTDESCRIPTORSIZE=0x6b
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETCSENDPOINTDESCRIPTORTC=0x69
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETCSINTERFACEDESCRIPTORSIZE=0x68
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETCSINTERFACEDESCRIPTORTC=0x66
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETDEVICEQUALIFIERDESCRIPTORTC_DUP1=0x62
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETENDPOINTDESCRIPTORSIZE_DUP1=0x61
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETENDPOINTDESCRIPTORTC_DUP1=0x5f
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETINTERFACEDESCRIPTORTC_DUP1=0x5d
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_GETOTHERSPEEDCONFIGURATIONDESCRIPTORTC_DUP1=0x64
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_INITHS_DUP2=0x4e
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_INITHS_DUP3=0x4f
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_INIT_DUP1=0x4c
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_INIT_DUP3=0x4d
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_INSERTEPDESC_DUP1=0x74
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETCONFIGURATIONSTRINGDESCRIPTORTC=0x6c
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETCONFIGURATIONSTRINGDESCRIPTORTC_DUP1=0x6d
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETCONFIGURATIONSTRINGDESCRIPTORTC_DUP2=0x6e
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETCONFIGURATIONSTRINGDESCRIPTORTC_DUP3=0x6f
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETCSENDPOINTDESCRIPTORTC=0x6a
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETCSINTERFACEDESCRIPTORTC=0x67
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETDEVICEQUALIFIERDESCRIPTORTC_DUP1=0x63
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETDEVICESTRINGDESCRIPTORTC_DUP1=0x80
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETDEVICESTRINGDESCRIPTORTC_DUP2=0x81
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETDEVICESTRINGDESCRIPTORTC_DUP3=0x82
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETDEVICESTRINGDESCRIPTORTC_DUP4=0x83
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETENDPOINTDESCRIPTORTC_DUP1=0x60
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETIFCSTRINGDESCRIPTOR_DUP1=0x5a
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETIFCSTRINGDESCRIPTOR_DUP2=0x5b
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETINTERFACEDESCRIPTOR_DUP1=0x5e
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETOTHERSPEEDCONFIGURATIONDESCRIPTORTC_DUP1=0x65
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETSTRINGDESCRIPTORTC_DUP1=0x70
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETSTRINGDESCRIPTORTC_DUP2=0x71
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETSTRINGDESCRIPTORTC_DUP3=0x72
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_SETSTRINGDESCRIPTORTC_DUP4=0x73
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_STRINGDESCRIPTOREXISTS_DUP1=0x84
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_STRINGDESCRIPTOREXISTS_DUP2=0x85
-[TRACE]TRACE_FATAL[0x81]_TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORNUMIFCS_DUP2=0x7c
-[TRACE]TRACE_FATAL[0x81]_TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP1=0x44
-[TRACE]TRACE_FATAL[0x81]_TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP4=0x45
-[TRACE]TRACE_FATAL[0x81]_TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP5=0x46
-[TRACE]TRACE_FATAL[0x81]_TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP6=0x47
-[TRACE]TRACE_FATAL[0x81]_TUSBCENDPOINTINFO_ADJUSTEPSIZES=0x86
-[TRACE]TRACE_FATAL[0x81]_TUSBCENDPOINTINFO_ADJUSTEPSIZES_DUP1=0x87
-[TRACE]TRACE_FATAL[0x81]_TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP1=0x8a
-[TRACE]TRACE_FATAL[0x81]_TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP3=0x8b
-[TRACE]TRACE_FATAL[0x81]_TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP5=0x8c
-[TRACE]TRACE_FATAL[0x81]_TUSBCPHYSICALENDPOINT_DIRAVAILABLE_DUP1=0x89
-[TRACE]TRACE_FATAL[0x81]_TUSBCPHYSICALENDPOINT_TYPEAVAILABLE_DUP1=0x88
-[TRACE]TRACE_FATAL[0x81]_TUSBCSTRINGDESCRIPTORBASE_SETWORD=0x4a
-[TRACE]TRACE_FATAL[0x81]_TUSBCSTRINGDESCRIPTORBASE_WORD=0x49
-[TRACE]TRACE_FATAL[0x81]_TUSBCSTRINGDESCRIPTOR_CONSTRUCT_DUP1=0x4b
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_ACTIVATEHARDWARECONTROLLER=0xc6
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_ALLOCATEENDPOINTRESOURCE=0xb0
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_CABLEDETECTWITHOUTPOWERCAPS=0xb9
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_CABLESTATUSTIMERCALLBACK=0xda
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_CHANGECONFIGURATION=0x14
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_CHANGEINTERFACE=0x17
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_CHECKEPAVAILABILITY=0xc3
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_CLEARHALTFEATURE=0x13
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS=0xc4
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_CURRENTLYUSINGHIGHSPEED=0xb3
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DEACTIVATEHARDWARECONTROLLER=0xc7
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DEALLOCATEENDPOINTRESOURCE=0xb1
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACK=0xc8
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACKS=0xc9
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DEREGISTERCLIENTCALLBACK=0xc2
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DEREGISTERFORENDPOINTSTATUSCHANGE=0x86
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DEREGISTERFOROTGFEATURECHANGE=0x9c
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DEREGISTERFORSTATUSCHANGE=0x84
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DEVICECAPS=0x7d
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DEVICEEVENTNOTIFICATION=0xb7
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DEVICEHIGHSPEEDCAPS=0xba
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DEVICEHNPHANDLEDBYHARDWARECAPS=0xbc
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DEVICERESOURCEALLOCV2CAPS=0xbb
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DISABLECLIENTSTACK=0x77
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DOFOREVERYENDPOINTINUSE=0x18
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DUSBCLIENTCONTROLLER_CONS=0xb6
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_DUSBCLIENTCONTROLLER_DES=0x76
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_ENABLECLIENTSTACK=0x78
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_ENDPOINTCAPS=0x7c
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_ENDPOINTZEROMAXPACKETSIZES=0x90
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_ENTERFULLSPEED=0xd6
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_ENTERHIGHSPEED=0xd7
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_EP0STALL=0x88
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY=0xcb
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS=0xd8
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETCONFIGURATIONDESCRIPTOR=0x94
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETCONFIGURATIONDESCRIPTORSIZE=0x96
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETCONFIGURATIONSTRINGDESCRIPTOR=0xad
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETCURRENTOTGFEATURES=0x9a
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETDEVICEDESCRIPTOR=0x91
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETDEVICEDESCRIPTORSIZE=0x93
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETDEVICEQUALIFIERDESCRIPTOR=0x9e
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETDEVICESTATUS=0x8a
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETENDPOINTSTATUS=0x8b
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETINTERFACEDESCRIPTORSIZE=0x9d
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETINTERFACENUMBER=0x87
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETMANUFACTURERSTRINGDESCRIPTOR=0xa4
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETOTGDESCRIPTOR=0x97
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETOTGFEATURES=0x99
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETOTHERSPEEDCONFIGURATIONDESCRIPTOR=0xa0
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETPRODUCTSTRINGDESCRIPTOR=0xa7
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETSERIALNUMBERSTRINGDESCRIPTOR=0xaa
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_GETSTRINGDESCRIPTORLANGID=0xa2
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_INITIALISEBASECLASS=0xb5
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN=0x16
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_INTERFACESETUP=0x15
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_ISACTIVE=0x79
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_MOVETOADDRESSSTATE=0xb8
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_NEXTDEVICESTATE=0xcf
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_OTGDISABLEUDC=0xc1
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_OTGENABLEUDC=0xc0
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_OTGFEATURESNOTIFY=0xcc
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_POWERDOWN=0xbe
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_POWERDOWNDFC=0xdc
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_POWERDOWNWHENACTIVE=0xbd
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_POWERUP=0xbf
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_POWERUPDFC=0xdb
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_POWERUPUDC=0x80
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCEEDSETDESCRIPTOR=0x11
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSCABLEINSERTEVENT=0xd4
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSCABLEREMOVEEVENT=0xd5
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSDATATRANSFERDONE=0xce
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED=0x2
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED=0x1
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION=0xc
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR=0xa
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSGETDEVICESTATUS=0x3
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSGETENDPOINTSTATUS=0x5
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSGETINTERFACE=0xe
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSGETINTERFACESTATUS=0x4
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSRESETEVENT=0xd3
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSRESUMEEVENT=0xd2
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSSETADDRESS=0x9
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE=0x6
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSSETCLEAREPFEATURE=0x8
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSSETCLEARIFCFEATURE=0x7
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSSETCONFIGURATION=0xd
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSSETDESCRIPTOR=0xb
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE=0xf
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSSUSPENDEVENT=0xd0
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSSUSPENDEVENTPROCEED=0xd1
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_PROCESSSYNCHFRAME=0x10
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_QUERYENDPOINTRESOURCE=0xb2
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_RECONNECTTIMERCALLBACK=0xd9
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_REENUMERATE=0x7f
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_REGISTERCLIENTCALLBACK=0x7a
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_REGISTERFORENDPOINTSTATUSCHANGE=0x85
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_REGISTERFOROTGFEATURECHANGE=0x9b
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_REGISTERFORSTATUSCHANGE=0x83
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_REGISTERUDC=0xb4
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_RELEASEDEVICECONTROL=0x8f
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_REMOVECONFIGURATIONSTRINGDESCRIPTOR=0xaf
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_REMOVEMANUFACTURERSTRINGDESCRIPTOR=0xa6
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_REMOVEPRODUCTSTRINGDESCRIPTOR=0xa9
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_REMOVESERIALNUMBERSTRINGDESCRIPTOR=0xac
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_RUNCLIENTCALLBACKS=0xcd
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SENDEP0STATUSPACKET=0x89
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETCLEARHALTFEATURE=0x12
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETCONFIGURATIONDESCRIPTOR=0x95
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETCONFIGURATIONSTRINGDESCRIPTOR=0xae
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETDEVICECONTROL=0x8e
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETDEVICEDESCRIPTOR=0x92
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETDEVICEQUALIFIERDESCRIPTOR=0x9f
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETINTERFACE=0x7e
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETMANUFACTURERSTRINGDESCRIPTOR=0xa5
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR=0x98
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETOTHERSPEEDCONFIGURATIONDESCRIPTOR=0xa1
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETPRODUCTSTRINGDESCRIPTOR=0xa8
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETSERIALNUMBERSTRINGDESCRIPTOR=0xab
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETSTRINGDESCRIPTORLANGID=0xa3
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR=0xc5
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER=0x8c
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER=0x8d
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_STATUSNOTIFY=0xca
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_USBCCONTROLLERPOINTER=0x7b
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_USBCONNECT=0x81
-[TRACE]TRACE_FLOW[0x8A]_DUSBCLIENTCONTROLLER_USBDISCONNECT=0x82
-[TRACE]TRACE_FLOW[0x8A]_TUSBCAUDIOENDPOINTDESCRIPTOR_CONSTRUCT=0x34
-[TRACE]TRACE_FLOW[0x8A]_TUSBCAUDIOENDPOINTDESCRIPTOR_NEW=0x33
-[TRACE]TRACE_FLOW[0x8A]_TUSBCAUDIOENDPOINTDESCRIPTOR_TUSBCAUDIOENDPOINTDESCRIPTOR_CONS=0x32
-[TRACE]TRACE_FLOW[0x8A]_TUSBCCLASSSPECIFICDESCRIPTOR_CONSTRUCT=0x3b
-[TRACE]TRACE_FLOW[0x8A]_TUSBCCLASSSPECIFICDESCRIPTOR_NEW=0x3a
-[TRACE]TRACE_FLOW[0x8A]_TUSBCCLASSSPECIFICDESCRIPTOR_TUSBCCLASSSPECIFICDESCRIPTOR_CONS=0x38
-[TRACE]TRACE_FLOW[0x8A]_TUSBCCLASSSPECIFICDESCRIPTOR_TUSBCCLASSSPECIFICDESCRIPTOR_DES=0x39
-[TRACE]TRACE_FLOW[0x8A]_TUSBCCONFIGDESCRIPTOR_CONSTRUCT=0x27
-[TRACE]TRACE_FLOW[0x8A]_TUSBCCONFIGDESCRIPTOR_NEW=0x26
-[TRACE]TRACE_FLOW[0x8A]_TUSBCCONFIGDESCRIPTOR_TUSBCCONFIGDESCRIPTOR_CONS=0x25
-[TRACE]TRACE_FLOW[0x8A]_TUSBCCONFIGURATION_TUSBCCONFIGURATION_CONS=0x74
-[TRACE]TRACE_FLOW[0x8A]_TUSBCCONFIGURATION_TUSBCCONFIGURATION_DES=0x75
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORBASE_TUSBCDESCRIPTORBASE_CONS=0x19
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORBASE_TUSBCDESCRIPTORBASE_DES=0x1a
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS=0x61
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_EXCHANGESTRINGDESCRIPTOR=0x67
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_FINDAVAILABLESTRINGPOS=0x69
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR=0x4c
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTORTC=0x50
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETDEVICEDESCRIPTOR=0x62
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETDEVICEDESCRIPTORTC=0x4e
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETDEVICEQUALIFIERDESCRIPTORTC=0x57
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETDEVICESTRINGDESCRIPTORTC=0x64
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETENDPOINTDESCRIPTORSIZE=0x56
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETENDPOINTDESCRIPTORTC=0x54
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETINTERFACEDESCRIPTORTC=0x52
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETOTGDESCRIPTOR=0x63
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETOTHERSPEEDCONFIGURATIONDESCRIPTORTC=0x59
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETSTRINGDESCRIPTORTC=0x5b
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_GETSTRINGDESCRIPTORTC_DUP1=0x5c
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_INIT=0x48
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_INITHS=0x49
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_INSERTDESCRIPTOR=0x4d
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_INSERTEPDESC=0x60
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_INSERTIFCDESC=0x5f
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_REMOVEDEVICESTRINGDESCRIPTOR=0x66
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR=0x5e
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_SETCONFIGURATIONDESCRIPTORTC=0x51
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_SETDEVICEDESCRIPTORTC=0x4f
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_SETDEVICEQUALIFIERDESCRIPTORTC=0x58
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_SETDEVICESTRINGDESCRIPTORTC=0x65
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_SETENDPOINTDESCRIPTORTC=0x55
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_SETINTERFACEDESCRIPTOR=0x53
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_SETOTHERSPEEDCONFIGURATIONDESCRIPTORTC=0x5a
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_SETSTRINGDESCRIPTORTC=0x5d
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_STRINGDESCRIPTOREXISTS=0x68
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_TUSBCDESCRIPTORPOOL_CONS=0x46
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_TUSBCDESCRIPTORPOOL_DES=0x47
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_UPDATEDESCRIPTORSFS=0x4a
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDESCRIPTORPOOL_UPDATEDESCRIPTORSHS=0x4b
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDEVICEDESCRIPTOR_CONSTRUCT=0x1d
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDEVICEDESCRIPTOR_NEW=0x1c
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDEVICEDESCRIPTOR_TUSBCDEVICEDESCRIPTOR_CONS=0x1b
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDEVICEDESCRIPTOR_UPDATEFS=0x1e
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDEVICEDESCRIPTOR_UPDATEHS=0x1f
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDEVICEQUALIFIERDESCRIPTOR_CONSTRUCT=0x22
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDEVICEQUALIFIERDESCRIPTOR_NEW=0x21
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDEVICEQUALIFIERDESCRIPTOR_TUSBCDEVICEQUALIFIERDESCRIPTOR_CONS=0x20
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDEVICEQUALIFIERDESCRIPTOR_UPDATEFS=0x23
-[TRACE]TRACE_FLOW[0x8A]_TUSBCDEVICEQUALIFIERDESCRIPTOR_UPDATEHS=0x24
-[TRACE]TRACE_FLOW[0x8A]_TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT=0x2c
-[TRACE]TRACE_FLOW[0x8A]_TUSBCENDPOINTDESCRIPTORBASE_TUSBCENDPOINTDESCRIPTORBASE_CONS=0x2b
-[TRACE]TRACE_FLOW[0x8A]_TUSBCENDPOINTDESCRIPTORBASE_UPDATEFS=0x2d
-[TRACE]TRACE_FLOW[0x8A]_TUSBCENDPOINTDESCRIPTORBASE_UPDATEHS=0x2e
-[TRACE]TRACE_FLOW[0x8A]_TUSBCENDPOINTDESCRIPTOR_CONSTRUCT=0x31
-[TRACE]TRACE_FLOW[0x8A]_TUSBCENDPOINTDESCRIPTOR_NEW=0x30
-[TRACE]TRACE_FLOW[0x8A]_TUSBCENDPOINTDESCRIPTOR_TUSBCENDPOINTDESCRIPTOR_CONS=0x2f
-[TRACE]TRACE_FLOW[0x8A]_TUSBCINTERFACEDESCRIPTOR_CONSTRUCT=0x2a
-[TRACE]TRACE_FLOW[0x8A]_TUSBCINTERFACEDESCRIPTOR_NEW=0x29
-[TRACE]TRACE_FLOW[0x8A]_TUSBCINTERFACEDESCRIPTOR_TUSBCINTERFACEDESCRIPTOR_CONS=0x28
-[TRACE]TRACE_FLOW[0x8A]_TUSBCINTERFACESET_TUSBCINTERFACESET_CONS=0x72
-[TRACE]TRACE_FLOW[0x8A]_TUSBCINTERFACESET_TUSBCINTERFACESET_DES=0x73
-[TRACE]TRACE_FLOW[0x8A]_TUSBCINTERFACE_TUSBCINTERFACE_CONS=0x70
-[TRACE]TRACE_FLOW[0x8A]_TUSBCINTERFACE_TUSBCINTERFACE_DES=0x71
-[TRACE]TRACE_FLOW[0x8A]_TUSBCLANGIDDESCRIPTOR_CONSTRUCT=0x45
-[TRACE]TRACE_FLOW[0x8A]_TUSBCLANGIDDESCRIPTOR_NEW=0x44
-[TRACE]TRACE_FLOW[0x8A]_TUSBCLANGIDDESCRIPTOR_TUSBCLANGIDDESCRIPTOR_CONS=0x42
-[TRACE]TRACE_FLOW[0x8A]_TUSBCLANGIDDESCRIPTOR_TUSBCLANGIDDESCRIPTOR_DES=0x43
-[TRACE]TRACE_FLOW[0x8A]_TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS=0x6f
-[TRACE]TRACE_FLOW[0x8A]_TUSBCOTGDESCRIPTOR_CONSTRUCT=0x37
-[TRACE]TRACE_FLOW[0x8A]_TUSBCOTGDESCRIPTOR_NEW=0x35
-[TRACE]TRACE_FLOW[0x8A]_TUSBCOTGDESCRIPTOR_TUSBCOTGDESCRIPTOR_CONS=0x36
-[TRACE]TRACE_FLOW[0x8A]_TUSBCPHYSICALENDPOINT_DIRAVAILABLE=0x6c
-[TRACE]TRACE_FLOW[0x8A]_TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE=0x6d
-[TRACE]TRACE_FLOW[0x8A]_TUSBCPHYSICALENDPOINT_TUSBCPHYSICALENDPOINT_CONS=0x6a
-[TRACE]TRACE_FLOW[0x8A]_TUSBCPHYSICALENDPOINT_TUSBCPHYSICALENDPOINT_DES=0x6e
-[TRACE]TRACE_FLOW[0x8A]_TUSBCPHYSICALENDPOINT_TYPEAVAILABLE=0x6b
-[TRACE]TRACE_FLOW[0x8A]_TUSBCSTRINGDESCRIPTORBASE_TUSBCSTRINGDESCRIPTORBASE_CONS=0x3c
-[TRACE]TRACE_FLOW[0x8A]_TUSBCSTRINGDESCRIPTORBASE_TUSBCSTRINGDESCRIPTORBASE_DES=0x3d
-[TRACE]TRACE_FLOW[0x8A]_TUSBCSTRINGDESCRIPTOR_CONSTRUCT=0x41
-[TRACE]TRACE_FLOW[0x8A]_TUSBCSTRINGDESCRIPTOR_NEW=0x40
-[TRACE]TRACE_FLOW[0x8A]_TUSBCSTRINGDESCRIPTOR_TUSBCSTRINGDESCRIPTOR_CONS=0x3e
-[TRACE]TRACE_FLOW[0x8A]_TUSBCSTRINGDESCRIPTOR_TUSBCSTRINGDESCRIPTOR_DES=0x3f
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ACTIVATEHARDWARECONTROLLER_DUP1=0x100
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ACTIVATEHARDWARECONTROLLER_DUP4=0x101
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CANCELREADBUFFER=0xbc
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CANCELTRANSFERREQUESTS=0x107
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CANCELWRITEBUFFER=0xbd
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP1=0x3e
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP2=0x3f
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP4=0x40
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP5=0x41
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP6=0x42
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP7=0x43
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP8=0x44
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP9=0x45
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHANGEINTERFACE_DUP1=0x4d
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHANGEINTERFACE_DUP2=0x4e
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHECKEPAVAILABILITY_DUP2=0xf2
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHECKEPAVAILABILITY_DUP3=0xf3
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CHECKEPAVAILABILITY_DUP4=0xf4
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CLEARHALTENDPOINT=0xbf
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CLOSEDMACHANNEL=0xee
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP10=0xfc
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP11=0xfd
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP12=0xfe
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP13=0xff
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP7=0xf9
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP8=0xfa
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP9=0xfb
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CREATEINTERFACE=0xf5
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP2=0xf6
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP4=0xf7
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP7=0xf8
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEACTIVATEHARDWARECONTROLLER_DUP1=0x102
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEACTIVATEHARDWARECONTROLLER_DUP3=0x103
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DELETEINTERFACE=0x105
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DELETEINTERFACESET=0x104
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DELETEINTERFACE_DUP3=0x106
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACKS_DUP1=0x10a
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACKS_DUP2=0x10b
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACK_DUP1=0x108
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACK_DUP2=0x109
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEREGISTERCLIENT=0xae
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEREGISTERCLIENTCALLBACK_DUP1=0xf0
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEREGISTERCLIENTCALLBACK_DUP2=0xf1
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEREGISTERCLIENT_DUP1=0xaf
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEREGISTERFORENDPOINTSTATUSCHANGE_DUP1=0xac
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEREGISTERFORENDPOINTSTATUSCHANGE_DUP2=0xad
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEREGISTERFOROTGFEATURECHANGE_DUP1=0xca
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEREGISTERFOROTGFEATURECHANGE_DUP2=0xcb
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEREGISTERFORSTATUSCHANGE_DUP1=0xa9
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DEREGISTERFORSTATUSCHANGE_DUP2=0xaa
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DISABLECLIENTSTACK_DUP1=0x97
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DOFOREVERYENDPOINTINUSE_DUP1=0x4f
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_DUSBCLIENTCONTROLLER_DES_DUP1=0x96
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENABLECLIENTSTACK_DUP1=0x98
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENDPOINTCAPS_DUP1=0x9a
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENDPOINTCAPS_DUP2=0x9b
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENDPOINTPACKETSIZE=0xda
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENDPOINTPACKETSIZE_DUP2=0xdb
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENDPOINTPACKETSIZE_DUP3=0xdc
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENDPOINTREQUESTCOMPLETE=0xe5
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENQUIREEP0NEXTSTATE=0x1
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENQUIREEP0NEXTSTATE_DUP1=0x2
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENQUIREEP0NEXTSTATE_DUP2=0x3
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENQUIREEP0NEXTSTATE_DUP3=0x4
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_ENTERTESTMODE=0xef
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EP0PACKETSIZE=0xb0
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EP0PACKETSIZE_DUP1=0xb1
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EP0REQUESTCOMPLETE=0xe7
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EP0REQUESTCOMPLETE_DUP1=0xe8
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EP0REQUESTCOMPLETE_DUP2=0xe9
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EP0REQUESTCOMPLETE_DUP3=0xea
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EP0REQUESTCOMPLETE_DUP4=0xeb
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP2=0x10d
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP6=0x10e
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP7=0x10f
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP8=0x110
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP9=0x111
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP1=0x11b
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP2=0x11c
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP4=0x11d
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP5=0x11e
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP7=0x11f
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_GETCSENDPOINTDESCRIPTORBLOCK=0xd4
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_GETCSENDPOINTDESCRIPTORBLOCKSIZE=0xd6
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_GETCSINTERFACEDESCRIPTORBLOCK=0xd1
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_GETCSINTERFACEDESCRIPTORBLOCKSIZE=0xd3
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_GETENDPOINTDESCRIPTOR=0xce
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_GETENDPOINTDESCRIPTORSIZE=0xd0
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_GETINTERFACEDESCRIPTOR=0xcc
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_GETSTRINGDESCRIPTOR=0xd7
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_HALTENDPOINT=0xbe
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_HANDLEHNPREQUEST=0xe6
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP1=0xdd
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP2=0xde
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP4=0xdf
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP5=0xe0
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP6=0xe1
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP7=0xe2
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP8=0xe3
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP9=0xe4
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP1=0x49
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP2=0x4a
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP5=0x4b
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP6=0x4c
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INTERFACESETUP_DUP1=0x46
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INTERFACESETUP_DUP2=0x47
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_INTERFACESETUP_DUP4=0x48
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_NEXTDEVICESTATE_DUP1=0x114
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_NEXTDEVICESTATE_DUP4=0x115
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_OPENDMACHANNEL=0xed
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_POWERDOWNDFC_DUP2=0x120
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_POWERDOWNDFC_DUP3=0x121
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_POWERDOWNDFC_DUP4=0x122
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_POWERUPUDC_DUP1=0xa5
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_POWERUPUDC_DUP2=0xa6
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSDATATRANSFERDONE_DUP1=0x113
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP1=0x2a
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP5=0x2b
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP6=0x2c
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0RECEIVEDONE=0x5
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP1=0x7
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP10=0x10
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP11=0x11
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP12=0x12
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP14=0x13
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP15=0x14
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP16=0x15
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP17=0x16
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP18=0x17
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP19=0x18
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP2=0x8
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP20=0x19
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP23=0x1a
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP24=0x1b
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP25=0x1c
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP28=0x1d
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP29=0x1e
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP3=0x9
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP30=0x1f
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP31=0x20
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP32=0x21
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP33=0x22
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP34=0x23
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP35=0x24
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP39=0x25
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP4=0xa
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP43=0x26
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP45=0x27
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP46=0x28
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP47=0x29
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP5=0xb
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP6=0xc
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP7=0xd
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP8=0xe
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP9=0xf
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSEP0TRANSMITDONE=0x6
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION_DUP4=0x34
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION_DUP5=0x35
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR_DUP2=0x31
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR_DUP3=0x32
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR_DUP5=0x33
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSGETDEVICESTATUS_DUP2=0x2d
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSGETENDPOINTSTATUS_DUP3=0x2f
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSGETINTERFACESTATUS_DUP3=0x2e
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSGETINTERFACE_DUP4=0x38
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSRESETEVENT_DUP1=0x117
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSRESETEVENT_DUP2=0x118
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSRESETEVENT_DUP3=0x119
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSRESETEVENT_DUP4=0x11a
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSSETADDRESS_DUP3=0x30
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSSETCONFIGURATION_DUP3=0x36
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSSETCONFIGURATION_DUP4=0x37
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE_DUP5=0x39
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_PROCESSSUSPENDEVENTPROCEED_DUP1=0x116
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_REENUMERATE_DUP1=0xa3
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_REENUMERATE_DUP2=0xa4
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_REGISTERCLIENTCALLBACK_DUP2=0x99
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_REGISTERFORENDPOINTSTATUSCHANGE_DUP2=0xab
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_REGISTERFOROTGFEATURECHANGE_DUP2=0xc9
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_REGISTERFORSTATUSCHANGE_DUP2=0xa8
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_RELEASEDEVICECONTROL_DUP1=0xc0
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_RELEASEINTERFACE=0x9d
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_RELEASEINTERFACE_DUP1=0x9e
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_RELEASEINTERFACE_DUP2=0x9f
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_RELEASEINTERFACE_DUP3=0xa0
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_RELEASEINTERFACE_DUP4=0xa1
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_RELEASEINTERFACE_DUP5=0xa2
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_REMOVESTRINGDESCRIPTOR=0xd9
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_RUNCLIENTCALLBACKS_DUP1=0x112
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETCLEARHALTFEATURE_DUP1=0x3a
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETCLEARHALTFEATURE_DUP2=0x3b
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETCLEARHALTFEATURE_DUP3=0x3c
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETCLEARHALTFEATURE_DUP4=0x3d
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETCSENDPOINTDESCRIPTORBLOCK=0xd5
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETCSINTERFACEDESCRIPTORBLOCK=0xd2
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETCURRENT=0xec
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETENDPOINTDESCRIPTOR=0xcf
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETENDPOINTZEROMAXPACKETSIZE=0xc1
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETENDPOINTZEROMAXPACKETSIZE_DUP2=0xc2
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR=0xcd
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETINTERFACE_DUP1=0x9c
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP2=0xc3
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP4=0xc4
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP5=0xc5
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP6=0xc6
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP7=0xc7
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP8=0xc8
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETSTRINGDESCRIPTOR=0xd8
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP1=0xb2
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP10=0xb6
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP11=0xb7
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP12=0xb8
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP2=0xb3
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP6=0xb4
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP9=0xb5
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP1=0xb9
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP2=0xba
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP9=0xbb
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_STATUSNOTIFY_DUP1=0x10c
-[TRACE]TRACE_NORMAL[0x86]_DUSBCLIENTCONTROLLER_USBCONNECT_DUP1=0xa7
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP3=0x6f
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP4=0x70
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP5=0x71
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP6=0x72
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP7=0x73
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_DELETEIFCDESCRIPTOR=0x5e
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_EXCHANGESTRINGDESCRIPTOR_DUP1=0x87
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_EXCHANGESTRINGDESCRIPTOR_DUP2=0x88
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_FINDAVAILABLESTRINGPOS_DUP1=0x89
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP10=0x59
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP11=0x5a
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP9=0x58
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_FINDEPDESCRIPTOR=0x6e
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_FINDIFCDESCRIPTOR=0x6d
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR=0x7d
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP1=0x7e
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP3=0x7f
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP4=0x80
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP7=0x81
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETCONFIGURATIONSTRINGDESCRIPTORTC=0x60
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETCONFIGURATIONSTRINGDESCRIPTORTC_DUP1=0x61
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETDEVICEDESCRIPTOR_DUP1=0x7b
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETDEVICEDESCRIPTOR_DUP2=0x7c
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETDEVICESTRINGDESCRIPTORTC_DUP1=0x84
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETDEVICESTRINGDESCRIPTORTC_DUP2=0x85
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETOTGDESCRIPTOR_DUP1=0x82
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_GETSTRINGDESCRIPTOR=0x83
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_INITHS_DUP1=0x57
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_INIT_DUP2=0x54
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_INIT_DUP4=0x55
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_INIT_DUP5=0x56
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_INSERTDESCRIPTOR_DUP1=0x5b
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_INSERTIFCDESC_DUP1=0x6a
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_INSERTIFCDESC_DUP2=0x6b
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_INSERTIFCDESC_DUP3=0x6c
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_REMOVECONFIGURATIONSTRINGDESCRIPTOR=0x62
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_REMOVEDEVICESTRINGDESCRIPTOR_DUP1=0x86
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP1=0x63
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP2=0x64
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP3=0x65
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP4=0x66
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP5=0x67
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP6=0x68
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP7=0x69
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_SETCSINTERFACEDESCRIPTORTC_DUP1=0x5f
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_SETIFCSTRINGDESCRIPTOR=0x5c
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_SETIFCSTRINGDESCRIPTOR_DUP3=0x5d
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_TUSBCDESCRIPTORPOOL_DES_DUP1=0x52
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_TUSBCDESCRIPTORPOOL_DES_DUP2=0x53
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORLENGTH=0x74
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORLENGTH_DUP1=0x75
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORLENGTH_DUP2=0x76
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORNUMIFCS=0x77
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORNUMIFCS_DUP1=0x78
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORNUMIFCS_DUP3=0x79
-[TRACE]TRACE_NORMAL[0x86]_TUSBCDESCRIPTORPOOL_UPDATEIFCNUMBERS=0x7a
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP2=0x50
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP3=0x51
-[TRACE]TRACE_NORMAL[0x86]_TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP2=0x90
-[TRACE]TRACE_NORMAL[0x86]_TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP4=0x91
-[TRACE]TRACE_NORMAL[0x86]_TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_DES=0x92
-[TRACE]TRACE_NORMAL[0x86]_TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_DES_DUP1=0x93
-[TRACE]TRACE_NORMAL[0x86]_TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_DES_DUP2=0x94
-[TRACE]TRACE_NORMAL[0x86]_TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_DES_DUP3=0x95
-[TRACE]TRACE_NORMAL[0x86]_TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP1=0x8a
-[TRACE]TRACE_NORMAL[0x86]_TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP2=0x8b
-[TRACE]TRACE_NORMAL[0x86]_TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP3=0x8c
-[TRACE]TRACE_NORMAL[0x86]_TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP4=0x8d
-[TRACE]TRACE_NORMAL[0x86]_TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP5=0x8e
-[TRACE]TRACE_NORMAL[0x86]_TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP6=0x8f
--- a/bsptemplate/asspandvariant/template_assp/usbcc.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/bsptemplate/asspandvariant/template_assp/usbcc.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -26,8 +26,6 @@
 linkas				usbcc.dll
 noexportlibrary
 
-USERINCLUDE traces_usbcc
-
 sourcepath			../../../kernel/eka/drivers/usbcc
 source				chapter9.cpp
 source				descriptors.cpp
@@ -48,4 +46,3 @@
 capability			all
 
 VENDORID 0x70000001
-uid           0x100039d0 0x1000015f
--- a/bsptemplate/asspandvariant/template_variant/bld.inf	Tue Aug 31 16:34:26 2010 +0300
+++ b/bsptemplate/asspandvariant/template_variant/bld.inf	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-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"
@@ -81,7 +81,7 @@
 cakdtemplate
 medlffstemplate
 soundsctemplate
-soundsctemplate_v2
+camerasctemplate
 exi2s
 //epbus
 //exbusab
@@ -113,6 +113,12 @@
 
 start		extension		base.bootstrap bootstrap
 
+#ifdef SYMBIAN_OLD_EXPORT_LOCATION
+option INC_PATH   $(EPOCROOT)epoc32/include
+#else
+option INC_PATH   $(EPOCROOT)epoc32/include/platform
+#endif
+
 option		NAME			_template_bootrom
 option		CPU				arm
 option		MEMMODEL		Multiple
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bsptemplate/asspandvariant/template_variant/camerasc/camerasc.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,535 @@
+// 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:
+// template\template_variant\camerasc\camerasc.cpp
+// Implementation of the template shared chunk camera physical device driver (PDD).
+// This file is part of the Template Base port
+// 
+//
+#include "camerasc_plat.h"
+
+_LIT(KCameraScPddName, "CameraSc.TE");
+_LIT(KCameraScDfcQueueName, "CameraSc.TE.DfcQ");
+
+/**
+Standard export function for PDD factories.  This creates a DPhysicalDevice derived object, in this case,
+DTemplateCameraScPddFactory.
+*/
+DECLARE_STANDARD_PDD()
+	{
+	return new DTemplateCameraScPddFactory;
+	}
+
+/**
+Constructor for the shared chunk camera PDD factory class.
+*/
+DTemplateCameraScPddFactory::DTemplateCameraScPddFactory()
+	{
+	// We currently support only unit 0
+	iUnitsMask = 0x01;
+
+	// Set the version number for this device.  This is used to allow code to specify that it requires a
+	// minimum version of the device in order to operate.  If the version requested is less than this then
+	// the device is safe to be used
+	iVersion = RDevCameraSc::VersionRequired();
+	}
+
+/**
+Destructor for the shared chunk camera PDD factory class.
+*/
+DTemplateCameraScPddFactory::~DTemplateCameraScPddFactory()
+	{
+	}
+
+/**
+Second stage constructor for the shared chunk camera PDD factory class.  This must at least set a name for
+the driver object.
+@return KErrNone if successful, otherwise one of the system wide error codes.
+*/
+TInt DTemplateCameraScPddFactory::Install()
+	{
+	__KTRACE_CAM(Kern::Printf("> DTemplateCameraScPddFactory::Install()"));
+
+	TInt r;
+
+	// Create a DFC queue so that handling of both camera hardware callbacks and requests made to the LDD from
+	// user mode can be processed in the same thread, to avoid the use of semaphores
+	if ((r = Kern::DynamicDfcQCreate(iDfcQ, 26, KCameraScDfcQueueName)) == KErrNone)
+		{
+		// All PDD factories must have a unique name
+		r = SetName(&KCameraScPddName);
+		}
+
+	__KTRACE_CAM(Kern::Printf("< DTemplateCameraScPddFactory::Install() => Returning %d", r));
+
+	return r;
+	}
+
+/**
+Returns the PDD's capabilities.  This is not used by the Symbian OS device driver framework
+or by the LDD but is here as some LDDs will make use of it.
+@param aDes	A descriptor into which to write capability information.
+*/
+void DTemplateCameraScPddFactory::GetCaps(TDes8& /*aDes*/) const
+	{
+	}
+
+/**
+Called by the kernel's device driver framework to check if this PDD is suitable for use
+with a logical channel.  This is called in the context of the client thread which requested
+the creation of a logical channel, through a call to RBusLogicalChannel::DoCreate().  The
+thread is in a critical section.
+@param aUnit	The unit argument supplied by the client to RBusLogicalChannel::DoCreate()
+				This is used to determine which sensor to use.
+@param aInfo	The info argument supplied by the client to RBusLogicalChannel::DoCreate().
+@param aVer		The version number of the logical channel which will use this physical channel.
+@return KErrNone if successful, otherwise one of the system wide error codes.
+*/
+TInt DTemplateCameraScPddFactory::Validate(TInt aUnit, const TDesC8* /*aInfo*/, const TVersion& aVer)
+	{
+	// Check that the version requested is less than or equal to the version of this PDD
+	if (!Kern::QueryVersionSupported(RDevCameraSc::VersionRequired(), aVer))
+		{
+		return KErrNotSupported;
+		}
+
+	// Check that the unit number specifies the available sensor
+	if ((aUnit < 0) || (aUnit > 0))
+		{
+		return KErrNotSupported;
+		}
+
+	return KErrNone;
+	}
+
+/**
+Called by the kernel's device driver framework to create a physical channel object.  This
+is called in the context of the client thread which requested the creation of a logical
+channel, through a call to RBusLogicalChannel::DoCreate().  The thread is in a critical section.
+@param aChannel	Set by this function to point to the created physical channel object.
+@param aUnit	The unit argument supplied by the client to RBusLogicalChannel::DoCreate().
+@param aInfo	The info argument supplied by the client to RBusLogicalChannel::DoCreate().
+@param aVer		The version number of the logical channel which will use this physical channel.
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt DTemplateCameraScPddFactory::Create(DBase*& aChannel, TInt aUnit, const TDesC8* /*anInfo*/, const TVersion& /*aVer*/)
+	{
+	__KTRACE_CAM(Kern::Printf("> DTemplateCameraScPddFactory::Create()"));
+
+	// Create an instance of the PDD channel object that will work with the Template sensor
+	DTemplateCameraScPdd* pD = new DTemplateCameraScPdd;
+
+	aChannel = pD;
+	TInt r = KErrNoMemory;
+
+	if (pD)
+		{
+		r = pD->DoCreate(this, aUnit);
+		}
+
+	__KTRACE_CAM(Kern::Printf("< DTemplateCameraScPddFactory::Create() => Returning %d", r));
+
+	return r;
+	}
+
+/**
+Called by SetUnitOpen() to see if a particular unit is open.  When called, the
+iUnitInfoMutex fast mutex will be taken, ensuring safe access to iUnitsOpenMask.
+@param aUnit	The unit number to be checked for being open.
+@return ETrue if the unit specified by aUnit is already open, otherwise EFalse.
+*/
+TBool DTemplateCameraScPddFactory::IsUnitOpen(TInt aUnit)
+	{
+	return (iUnitsOpenMask & (1 << aUnit));
+	}
+
+/**
+Attempt to change the state of the unit open state for a particular unit.
+@param aUnit	The unit number to be set to open or closed state.
+@param aIsOpen	The required new state for the unit;  either ETrue to set the state
+				to open or EFalse to set the state to closed.
+@return KErrNone if the state was updated successfully, otherwise KErrInUse if an attempt
+		was made to set the unit status to open while it is already open.
+*/
+TInt DTemplateCameraScPddFactory::SetUnitOpen(TInt aUnit, TBool aIsOpen)
+	{
+	// Wait until it is safe to access the unit state mask
+	NKern::FMWait(&iUnitInfoMutex);
+
+	// Fail a request to open a unit that is already open
+	if (aIsOpen && IsUnitOpen(aUnit))
+		{
+		__KTRACE_CAM(Kern::Printf("+ DTemplateCameraScPddFactory::SetUnitOpen() => Unit %d is already in use", aUnit));
+
+		// Release the unit state mask mutex
+		NKern::FMSignal(&iUnitInfoMutex);
+
+		return KErrInUse;
+		}
+
+	// Set or clear the unit's open status bit as required
+	if (aIsOpen)
+		{
+		iUnitsOpenMask |= (1 << aUnit);
+		}
+	else
+		{
+		iUnitsOpenMask &= ~(1 << aUnit);
+		}
+
+	// Release the unit state mask mutex
+	NKern::FMSignal(&iUnitInfoMutex);
+
+	return KErrNone;
+	}
+
+/**
+Constructor for the shared chunk camera PDD class.
+*/
+DTemplateCameraScPdd::DTemplateCameraScPdd()
+	{
+	// Set the unit number to -1 to indicate that this channel has never been registered
+	// with the PDD factory
+	iUnit = -1;
+
+	// The channel has been created but not yet configured */
+	iState = EUnconfigured;
+	}
+
+/**
+Destructor for the shared chunk camera PDD class.  This is called in the context of the client thread
+once an 'ECloseMsg' message has been sent to the device driver DFC thread.
+*/
+DTemplateCameraScPdd::~DTemplateCameraScPdd()
+	{
+	delete [] iCapsBuffer;
+	delete iSensor;
+
+	// Indicate that a physical channel is no longer open on this unit
+	if (iUnit >= 0)
+		{
+		iPhysicalDevice->SetUnitOpen(iUnit, EFalse);
+		}
+	}
+
+/**
+Second stage constructor for the H4 camera PDD.
+@param aPhysicalDevice	A pointer to the factory class that is creating this PDD
+@param aUnit			The unit argument supplied by the client to RBusLogicalChannel::DoCreate().
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt DTemplateCameraScPdd::DoCreate(DTemplateCameraScPddFactory* aPhysicalDevice, TInt aUnit)
+	{
+	__KTRACE_CAM(Kern::Printf("> DTemplateCameraScPdd::DoCreate()"));
+
+	TInt r;
+
+	iPhysicalDevice = aPhysicalDevice;
+
+	// Check that a physical channel hasn't already been opened on this unit
+	if ((r = iPhysicalDevice->SetUnitOpen(aUnit, ETrue)) == KErrNone)
+		{
+		iUnit = aUnit;
+
+		// Create an abstracted sensor interface
+		if ((iSensor = new DTemplateSensorIf(*this, DfcQ(aUnit))) != NULL)
+			{
+			if ((r = iSensor->DoCreate()) == KErrNone)
+				{
+				// Setup the capabilities of this device for later reference
+				if ((r = iSensor->GetCaps(iCaps)) > 0)
+					{
+					// And save the size as returned from the sensor
+					iCapsSize = r;
+
+					// Although iCaps now points to a TCameraCapsV02 structure, it is actually a variable
+					// sized structure that was allocated as an array of TUint8 so save it to a TUint8
+					// ptr so that it can be deleted properly
+					iCapsBuffer = (TUint8*) iCaps;
+
+					// Enable the clocks needed by the camera subsystem and power up the sensor
+					r = iSensor->RequestPower();
+
+					// Some sensors power themselves up automatically in their DoCreate() function,
+					// so take this into account here
+					if (r == KErrAlreadyExists)
+						{
+						r = KErrNone;
+						}
+					}
+				}
+			}
+		else
+			{
+			r = KErrNoMemory;
+			}
+		}
+
+	__KTRACE_CAM(Kern::Printf("< DTemplateCameraScPdd::DoCreate() => Returning %d", r));
+
+	return r;
+	}
+
+/**
+An appropriate DFC queue to use for processing client requests (that is, those that won't be processed
+in the context of the client thread), and also for processing image completion requests from the sensor
+will have been setup by the PDD factory.  Anything needing to run in this same DFC thread can access the
+queue via this function.
+@param	aUnit	The unit number for which to get the DFC queue.
+@return	The DFC queue to be used.
+*/
+TDfcQue* DTemplateCameraScPdd::DfcQ(TInt /*aUnit*/)
+	{
+	return iPhysicalDevice->iDfcQ;
+	}
+
+/**
+Called by the LDD in order to query the capabilities of the PDD.
+@param	aCapsBuf	A reference to a descriptor owned by the LDD, containing a TCameraCapsV02 structure
+					for the capabilities.
+*/
+void DTemplateCameraScPdd::Caps(TDes8& aCapsBuf) const
+	{
+	__KTRACE_CAM(Kern::Printf("> DTemplateCameraScPdd::Caps()"));
+
+	// The iCaps structure will already have been created by a call to iSensor->SetCaps() in DoCreate().
+	// Simply copy it into the supplied TPckgBuf, taking into account the fact that the TCameraCapsV02
+	// buffer is of a variable size *and* may be smaller or larger than the iCaps structure
+	TPtrC8 ptr((const TUint8*) iCaps, iCapsSize);
+	aCapsBuf.FillZ(aCapsBuf.MaxLength());
+	aCapsBuf = ptr.Left(Min(ptr.Length(), aCapsBuf.MaxLength()));
+
+	__KTRACE_CAM(Kern::Printf("< DTemplateCameraScPdd::Caps()"));
+	}
+
+/**
+Called by the LDD to setup a new image configuration, including such things as image size, framerate
+and pixel format.
+@param	aConfigBuf	A reference to a TPckgBuf containing a TCameraConfigV02 configuration structure.
+@return KErrNone if successful, otherwise one of the system wide error codes.
+*/
+TInt DTemplateCameraScPdd::SetConfig(const TDesC8& aConfigBuf)
+	{
+	__KTRACE_CAM(Kern::Printf("> DTemplateCameraScPdd::SetConfig()"));
+
+	TInt r;
+
+	// It is only legal to call this if image capture is not already underway, so check for this
+	// before doing anything
+	if (iState <= EConfigured)
+		{
+		// Read the new configuration from the LDD into a local copy of the configuration structure,
+		// taking into account for compatibility that the TPckgBuf may be smaller or larger than the
+		// TCameraConfigV02 structure
+		TCameraConfigV02 config;
+		TPtr8 ptr((TUint8*) &config, sizeof(config));
+		Kern::InfoCopy(ptr, aConfigBuf);
+
+		// Save the new configuration for later and let the sensor also know about it
+		iConfig = config;
+		iSensor->SetConfig(config);
+
+		// Signal success and set the channel to the configured state
+		r = KErrNone;
+		iState = EConfigured;
+		}
+	else
+		{
+		r = KErrInUse;
+		}
+
+	__KTRACE_CAM(Kern::Printf("< DTemplateCameraScPdd::SetConfig() => Returning %d", r));
+
+	return r;
+	}
+
+/**
+Begins capture into the address pointed to by aLinAddr and aPhysAddr.  Both of these addresses point to
+the same buffer;  The address used by the sensor is hardware dependent.
+@param	aCaptureMode	Whether to capture in video, viewfinder or single image mode.
+@param	aLinAddr		The virtual address of the buffer into which to capture the image.
+@param	aPhysAddr		The physical address of the buffer into which to capture the image.
+@return	KErrNone if successful, otherwise one of the other system wide error codes.
+@pre	SetConfig() must first have been called.
+*/
+TInt DTemplateCameraScPdd::Start(TDevCamCaptureMode aCaptureMode, TLinAddr aLinAddr, TPhysAddr aPhysAddr)
+	{
+	__KTRACE_CAM(Kern::Printf("> DTemplateCameraScPdd::Start() => Configuring sensor for %d x %d capture", iConfig.iFrameSize.iWidth, iConfig.iFrameSize.iHeight));
+
+	// Ensure the precondition is met
+	__ASSERT_DEBUG((iState == EConfigured), Kern::Fault("camerasc", ENotConfigured));
+
+	// Save the capture mode for use when we call back into the LDD with the captured image
+	iCaptureMode = aCaptureMode;
+
+	// And start the sensor running
+	TInt r = iSensor->Start(aCaptureMode, aLinAddr, aPhysAddr);
+
+	// If everything was ok, set the channel to the capturing state
+	if (r == KErrNone)
+		{
+		iState = ECapturing;
+		}
+
+	__KTRACE_CAM(Kern::Printf("< DTemplateCameraScPdd::Start() => Returning %d", r));
+
+	return r;
+	}
+
+/**
+Sets the address of the buffer info which the next image will be captured.  Called by the LDD for successive
+images that are requested after the initial call to Start().
+@param	aLinAddr		The virtual address of the buffer into which to capture the image.
+@param	aPhysAddr		The physical address of the buffer into which to capture the image.
+@return	KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt DTemplateCameraScPdd::CaptureNextImage(TLinAddr aLinAddr, TPhysAddr aPhysAddr)
+	{
+	__KTRACE_CAM(Kern::Printf("> DTemplateCameraScPdd::CaptureNextImage()"));
+
+	// Pass the call directly to the sensor abstraction
+	TInt r = iSensor->CaptureNextImage(aLinAddr, aPhysAddr);
+
+	__KTRACE_CAM(Kern::Printf("< DTemplateCameraScPdd::CaptureNextImage()=> Returning %d", r));
+
+	return(r);
+	}
+
+/**
+Stops any image capturing that is currently underway.  It is safe to call this without having called Start().
+@return	KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt DTemplateCameraScPdd::Stop()
+	{
+	__KTRACE_CAM(Kern::Printf("> DTemplateCameraScPdd::Stop()"));
+
+	// Pass the call directly to the sensor abstraction
+	iSensor->Stop();
+
+	// Det the channel back to the configured state as it is now safe to call Start() again
+	iState = EConfigured;
+
+	__KTRACE_CAM(Kern::Printf("< DTemplateCameraScPdd::Stop()"));
+
+	return KErrNone;
+	}
+
+/**
+Power down the camera device.  This is called by the LDD when the driver channel is being closed or
+when the system is being powered down.  This is always called in the context of the DFC thread.
+*/
+void DTemplateCameraScPdd::PowerDown()
+	{
+
+#ifdef _DEBUG
+
+	// Power off the camera
+	TInt r = iSensor->RelinquishPower();
+
+	// Not being able to power down indicates a serious programming error
+	__ASSERT_DEBUG((r == KErrNone), Kern::Fault("camerasc", ECannotPowerDown));
+
+#else // ! _DEBUG
+
+	// Power off the camera
+	iSensor->RelinquishPower();
+
+#endif // ! _DEBUG
+
+	}
+
+/**
+Return the shared chunk creation information to be used by this device.
+@param	aChunkCreateInfo	A structure to be filled with the settings required for this device.
+*/
+void DTemplateCameraScPdd::GetChunkCreateInfo(TChunkCreateInfo& aChunkCreateInfo)
+	{
+	// Can be opened by any number of user side processes
+	aChunkCreateInfo.iType = TChunkCreateInfo::ESharedKernelMultiple;
+	// Use both L1 and L2 cache if available.  LDD will take care of pre and post DMA cache handling
+#ifdef __WINS__
+	aChunkCreateInfo.iMapAttr = 0xFF000;
+#else
+	aChunkCreateInfo.iMapAttr = EMapAttrCachedMax;
+#endif
+	// Chunk owns the memory which will be freed when the chunk is destroyed
+	aChunkCreateInfo.iOwnsMemory = ETrue;
+	// Don't queue the chunk's destruction on an DFC
+	aChunkCreateInfo.iDestroyedDfc = NULL;
+	}
+
+/**
+Returns the size of the variable sized capabilities structure in bytes.  The buffer passed into
+DTemplateCameraScPdd::GetCaps() must be at least this large to hold the fixed portion of the TCameraCapsV02
+structure, as well as the array of SDevCamPixelFormat structures that follows it.
+@return	The size in bytes of the variable sized capabilities structure.
+*/
+TInt DTemplateCameraScPdd::CapsSize()
+	{
+	return iCapsSize;
+	}
+
+/**
+Obtains information regarding the frame sizes and frame rates supported for a given combination of capture mode
+and pixel format.
+@param	aCaptureMode		The capture mode for which to obtain the information.
+@param	aUidPixelFormat		The pixel format for which to obtain the information.
+@param	aFrameSizeCapsBuf	A reference to an array of packaged SDevCamFrameSize structures, owned by the LDD, into
+							which to place the information.
+@@return	KErrNone if successful, else one of the other system wide error codes.
+*/
+TInt DTemplateCameraScPdd::FrameSizeCaps(TDevCamCaptureMode aCaptureMode, TUidPixelFormat aUidPixelFormat, TDes8& aFrameSizeCapsBuf)
+	{
+	return iSensor->FrameSizeCaps(aCaptureMode, aUidPixelFormat, aFrameSizeCapsBuf);
+	}
+
+/**
+Called by the sensor abstraction when an image is available.
+@param	aResult	KErrNone if successful, otherwise one of the system wide error codes.
+@param	aLinAddr		The virtual address of the buffer into which to capture the image.
+@param	aPhysAddr		The physical address of the buffer into which to capture the image.
+*/
+TInt DTemplateCameraScPdd::NotifyImageCaptureEvent(TInt aResult, TLinAddr& aLinAddr, TPhysAddr& aPhysAddr)
+	{
+	__KTRACE_CAM(Kern::Printf("> DTemplateCameraScPdd::NotifyImageCaptureEvent() => aResult = %d", aResult));
+
+	// Inform the LDD that a new image has been received
+	TInt r = iLdd->ImageCaptureCallback(iCaptureMode, aResult, &aLinAddr, &aPhysAddr);
+
+	// If the LDD has returned KErrAbort then something has gone wrong, and if it has returned KErrNotReady
+	// then it has no more frames available, so call Stop()
+	if (r != KErrNone)
+		{
+		Stop();
+		}
+
+	__KTRACE_CAM(Kern::Printf("< DTemplateCameraScPdd::NotifyImageCaptureEvent() => Returning %d", r));
+
+	return r;
+	}
+
+TInt DTemplateCameraScPdd::SetBrightness(TUint /*aBrightness*/)
+	{
+	return KErrNone;
+	}
+
+TInt DTemplateCameraScPdd::SetContrast(TUint /*aContrast*/)
+	{
+	return KErrNone;
+	}
+
+TInt DTemplateCameraScPdd::SetColorEffect(TUint /*aColorEffect*/)
+	{
+	return KErrNone;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bsptemplate/asspandvariant/template_variant/camerasc/camerasc_plat.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,342 @@
+// 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:
+// template\template_variant\camerasc\camerasc_plat.h
+// Implementation of the Template shared chunk camera physical device driver (PDD).
+// This file is part of the Template Base port
+// 
+//
+
+#ifndef __CAMERASC_PLAT_H__
+#define __CAMERASC_PLAT_H__
+
+#include <drivers/camerasc.h>
+#include <pixelformats.h>
+
+// Comment out the first #define, and uncomment the second #define in order to have debug
+// output for the shared chunk camera driver
+#define __KTRACE_CAM(s)
+//#define __KTRACE_CAM(s) s
+
+/** Total number of image capture requests that can be handled by the sensor at one time */
+const TInt KTotalCameraRequests = 2;
+
+/** NaviEngine specific panics that can be thrown by the shared chunk camera driver */
+enum TTemplateCameraScPddPanic
+	{
+	/** Start() has been called before SetConfig() */
+	ENotConfigured,
+	/** Unable to power down the camera hardware */
+	ECannotPowerDown,
+	/** Buffer passed to DSensorIf::FrameSizeCaps() by LDD is too small */
+	ECapsBufferTooSmall
+	};
+
+/**
+The physical device (factory class) for the NaviEngine shared chunk camera driver.
+
+This class is used by the device driver framework to instantiate one or more shared chunk camera driver
+PDDs.  An instance of one PDD is allowed for each physical sensor on the device.
+*/
+class DTemplateCameraScPddFactory : public DPhysicalDevice
+	{
+public:
+
+	DTemplateCameraScPddFactory();
+	~DTemplateCameraScPddFactory();
+	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);
+	TBool IsUnitOpen(TInt aUnit);
+	TInt SetUnitOpen(TInt aUnit, TBool aIsOpen);
+
+private:
+
+	/** The DFC queue to be used by both the LDD and the PDD to serialise access to the PDD. */
+	TDynamicDfcQue*	iDfcQ;
+	/** Mask to keep track of which units have a channel open on them. */
+	TUint			iUnitsOpenMask;
+	/** A mutex to protect access to the unit information mask. */
+	NFastMutex		iUnitInfoMutex;
+
+	friend class DTemplateCameraScPdd;
+	};
+
+/**
+Defines the interface for notification of an image being captured.
+
+Used by concrete instances of the DSensorIf abstract base class in order to notify an observer class
+(typically an DCameraScPdd derived class) that an image has been captured for processing.
+*/
+class MSensorObserver
+	{
+public:
+
+	virtual TInt NotifyImageCaptureEvent(TInt aResult, TLinAddr& aLinAddr, TPhysAddr& aPhysAddr) = 0;
+	};
+
+/**
+Defines an abstract base class for implementing concrete classes for camera sensors.
+
+This class provides an abstract interface to the sensor;  one class is derived from this and implemented
+for each sensor available to the camera driver.
+*/
+class DSensorIf : public DBase
+	{
+public:
+
+	/**
+	Second phase constructor for the sensor interface.  Acquires any resources required for communication with the sensor.
+	When this returns, the sensor is ready for use.
+	*/
+	virtual TInt DoCreate() = 0;
+
+	/**
+	Obtains information regarding the frame sizes and frame rates supported for a given combination of capture mode and pixel format.
+	@param	aCaptureMode		The capture mode for which to obtain the information.
+	@param	aUidPixelFormat		The pixel format for which to obtain the information.
+	@param	aFrameSizeCapsBuf	A referenced to an array of packaged SDevCamFrameSize structures into which to place the information.
+	@return	KErrNone if successful, else one of the other system wide error codes.
+	*/
+	virtual TInt FrameSizeCaps(TDevCamCaptureMode aCaptureMode, TUidPixelFormat aUidPixelFormat, TDes8& aFrameSizeCapsBuf) = 0;
+
+	/**
+	Obtains the capabilities of the sensor.  This either interrogates the sensor to find out its capabilities, or hard codes
+	them into aCameraCaps, or a combination of the two.
+	@param	aCameraCaps		A reference to a ptr to the structure into which to place the capabilities of the sensor.
+							This structure is of a variable size and contains the fixed part, followed by an array of
+							SDevCamPixelFormat structures.
+	@return	The size of the variable length structure pointed to by aCameraCaps if successful, else one of the other
+			system wide error codes.
+	*/
+	virtual TInt GetCaps(TCameraCapsV02*& aCameraCaps) = 0;
+
+	/**
+	Powers up the sensor.
+	*/
+	virtual TInt RequestPower() = 0;
+
+	/**
+	Powers down the sensor.
+	*/
+	virtual TInt RelinquishPower() = 0;
+
+	/**
+	Configures the sensor for capture in the configuration previously set by SetConfig(), and begins capture into the
+	address pointed to by aLinAddr and aPhysAddr.  Both of these addresses point to the same buffer;  The address used
+	by the sensor is hardware dependent.
+	@param	aCaptureMode	Whether to capture in video, viewfinder or single image mode.
+	@param	aLinAddr		The virtual address of the buffer into which to capture the image.
+	@param	aPhysAddr		The physical address of the buffer into which to capture the image.
+	@return	KErrNone if successful, otherwise one of the other system wide error codes.
+	@pre	SetConfig() must first have been called.
+	*/
+	virtual TInt Start(TDevCamCaptureMode aCaptureMode, TLinAddr aLinAddr, TPhysAddr aPhysAddr) = 0;
+
+	/**
+	Sets the address of the buffer into which the next image will be captured.  If is common for this to be called by Start() as
+	well as by the class that owns the sensor interface.
+	@param	aLinAddr		The virtual address of the buffer into which to capture the image.
+	@param	aPhysAddr		The physical address of the buffer into which to capture the image.
+	@return	KErrNone if successful, otherwise one of the other system wide error codes.
+	@pre	Start() must first have been called.
+	*/
+	virtual TInt CaptureNextImage(TLinAddr aLinAddr, TPhysAddr aPhysAddr) = 0;
+
+	/**
+	Stops any image capturing that is currently underway.  It is safe to call this without having called Start().
+	@return	KErrNone if successful, otherwise one of the other system wide error codes.
+	*/
+	virtual TInt Stop() = 0;
+
+	/**
+	Saves a configuration specifying such details as dimensions and pixel format in which the sensor should
+	capture images.  The shared implementation of this contains generic code, but this can be overridden by
+	derived classes if desired.
+	@param	aConfig	A TCameraConfigV02 structure containing the settings to be used.
+	@return	KErrNone if successful, otherwise one of the other system wide error codes.
+	*/
+	virtual TInt SetConfig(const TCameraConfigV02& aConfig);
+
+protected:
+
+	/** Pointer to the observer to call when a frame of data is available */
+	MSensorObserver*	iObserver;
+	/** ETrue if capture is under way, else EFalse*/
+	TBool				iEnabled;
+	/** Width of the frames to be captured in pixels */
+	TInt				iWidth;
+	/** Height of the frames to be captured in pixels */
+	TInt				iHeight;
+	/** Number of bytes from the start of one line to the start of the next */
+	TInt				iLineOffset;
+	/** The number of requests setup ready for transfer */
+	TInt				iPendingRequests;
+	/** The next request to be setup ready for transfer */
+	TUint				iNextRequest;
+	/** The configuration in which to capture images */
+	TCameraConfigV02	iConfig;
+	};
+
+/**
+This class provides an abstract interface to the Template sensor.
+*/
+class DTemplateSensorIf : public DSensorIf
+	{
+public:
+
+	DTemplateSensorIf(MSensorObserver& aObserver, TDfcQue* aDFCQueue);
+	TInt DoCreate();
+	~DTemplateSensorIf();
+	TInt BufferDoneCallback(TInt aResult);
+	void FillBuffer(TLinAddr aBuffer);
+	TInt FrameSizeCaps(TDevCamCaptureMode aCaptureMode, TUidPixelFormat aUidPixelFormat, TDes8& aFrameSizeCapsBuf);
+	TInt GetCaps(TCameraCapsV02*& aCameraCaps);
+	TInt RequestPower();
+	TInt RelinquishPower();
+	TInt Start(TDevCamCaptureMode aCaptureMode, TLinAddr aLinAddr, TPhysAddr aPhysAddr);
+	TInt Stop();
+	TInt CaptureNextImage(TLinAddr aLinAddr, TPhysAddr aPhysAddr);
+
+	// Static callbacks for various sensor related asynchronous functions
+	static TInt HostPowerCallback(TAny* aPtr, TAny* aPoweredUp);
+	static TInt SensorClkReqCallback(TAny* aPtr);
+
+private:
+
+	/** X position at which to display the logo */
+	TInt		iX;
+	/** Y position at which to display the logo */
+	TInt		iY;
+	/** Current X direction and speed at which the logo is moving */
+	TInt		iXDirection;
+	/** Current Y direction and speed at which the logo is moving */
+	TInt		iYDirection;
+	/** Number of nanokernel ticks that represent the time to capture one frame */
+	TInt		iImageTimerTicks;
+	/** Timers used for emulating images being captured */
+	NTimer		iImageTimers[KTotalCameraRequests];
+	/** DFC queue used for completing image capture requests */
+	TDfcQue*	iDFCQueue;
+	/** DFCs used for image capture timer callbacks happeing in our DFC thread */
+	TDfc		*iImageTimerDFCs[KTotalCameraRequests];
+    
+    /* Used for cheesy animation effect */
+    TUint8 iCounter;
+    TBool iFlipSwitch;
+	};
+
+/**
+The physical device driver for the NaviEngine shared chunk camera driver.
+
+This is the concrete implementation of the abstract DCameraScPdd base class.  One instance of this
+class will be created by the factory class per physical sensor on the device.  Only one instance
+per sensor can be instantiated at any given time.  Access to the sensor itself is achieved via the
+appropriate DSensorIf derived class.
+*/
+class DTemplateCameraScPdd : public DCameraScPdd, public MSensorObserver
+	{
+private:
+
+	/** States in which the channel can be */
+	enum TState
+		{
+		/** Channel created but not yet configured */
+		EUnconfigured,
+		/** Channel configured but idle and not capturing images */
+		EConfigured,
+		/** Channel capturing images */
+		ECapturing
+		};
+
+public:
+
+	DTemplateCameraScPdd();
+	TInt DoCreate(DTemplateCameraScPddFactory* aPhysicalDevice, TInt aUnit);
+	~DTemplateCameraScPdd();
+	TDfcQue* DfcQ(TInt aUnit);
+	void Caps(TDes8& aCapsBuf) const;
+	void GetChunkCreateInfo(TChunkCreateInfo& aChunkCreateInfo);
+	TInt SetConfig(const TDesC8& aConfigBuf);
+	TInt Start(TDevCamCaptureMode aCaptureMode,TLinAddr aLinAddr, TPhysAddr aPhysAddr);
+	TInt CaptureNextImage(TLinAddr aLinAddr, TPhysAddr aPhysAddr);
+	TInt Stop();
+	void PowerDown();
+	TInt CapsSize();
+	TInt FrameSizeCaps(TDevCamCaptureMode aCaptureMode, TUidPixelFormat aUidPixelFormat, TDes8& aFrameSizeCapsBuf);
+
+	/**
+	Sets the sensor brightness to the desired setting.
+
+	@param aValue A verified brightness setting.
+	@return KErrNone if successful, KErrNotSupported if not supported.
+	*/
+	TInt SetBrightness(TUint aBrightness);
+
+	/**
+	Sets the sensor contrast to the desired setting.
+
+	@param aValue A verified contrast setting.
+	@return KErrNone if successful, KErrNotSupported if not supported.
+	*/
+	TInt SetContrast(TUint aContrast);
+
+	/**
+	Sets the sensor color effect to the desired setting.
+
+	@param aValue A verified color effect setting.
+	@return KErrNone if successful, KErrNotSupported if not supported.
+	*/
+	TInt SetColorEffect(TUint aColorEffect);
+
+private:
+
+	TInt NotifyImageCaptureEvent(TInt aResult, TLinAddr& aLinAddr, TPhysAddr& aPhysAddr);
+
+private:
+
+	/** The unit number of this channel.  The unit number determines the sensor used. */
+	TInt						iUnit;
+	/** A pointer to the PDD factory that created this device. */
+	DTemplateCameraScPddFactory* iPhysicalDevice;
+	/** Ptr to a buffer large enough to hold the variable sized capabilities structure. */
+	TUint8*						iCapsBuffer;
+	/** The size of the variable sized capabilities structure. */
+	TUint						iCapsSize;
+	/** The capabilities of this device. */
+	TCameraCapsV02*				iCaps;
+	/** The current configuration of this device. */
+	TCameraConfigV02			iConfig;
+	/** The current capture mode of the camera. */
+	TDevCamCaptureMode			iCaptureMode;
+	/** Abstracted interface to the sensor */
+	DSensorIf*					iSensor;
+	/** Current state of the channel (configured, capturing etc) */
+	TState						iState;
+	};
+
+/**
+XXX - This structure holds information pertaining to the logo to be rendered in
+"photos" returned by the template camera driver.  This structure is temporary and
+should be removed when changing this template into a "real" camera driver.
+*/
+struct SLogo
+	{
+	TUint	iWidth;
+	TUint	iHeight;
+	TUint8	iPixelData[80 * 61 * 3 + 1];
+    TUint8  iPixelData2[80 * 61 * 3 + 1];
+	};
+
+#endif /* __CAMERASC_PLAT_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bsptemplate/asspandvariant/template_variant/camerasc/camerasc_sensor.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,552 @@
+// 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:
+// template\template_variant\camerasc\camerasc_sensor.cpp
+// Implementation of the template shared chunk camera physical device driver (PDD).
+// This file is part of the Template Base port
+// 
+//
+
+/**
+ @file
+*/
+
+#include "camerasc_plat.h"
+#include <kernel/cache.h>
+
+// XXX - Temporary structure containing a logo to be displayed.  Remove this when
+//       changing this template into a "real" camera driver
+#include "logoyuv2.cpp"
+
+
+#define RGBtoBGR565(red, green, blue) (((blue & 0xf8) << 8) | ((green & 0xfc) << 3) | ((red & 0xf8) >> 3));
+
+#define YUVtoYUV565(luma, blueC, redC) (((luma & 0xf8) << 8) | ((blueC & 0xfc) << 3) | ((redC & 0xf8) >> 3));
+
+// Frame sizes and their associated frame rates supported by the Template sensor.  This selection was
+// obtained by observation of typical formats supported by phones already on the market;  It is arbitrary
+// and can be easily added to if desired
+static const SDevCamFrameSize FrameSizes[] =
+	{
+		{ 320, 240, 1, 30 }	,		// QVGA - 0.075 MP
+		// XXX: Although not used in this template driver, the following are suggested standard frame sizes
+		// that should be implemented in your camera driver, as well as 320 x 240 above.  Remember to change
+		// KNumFrameSizes below if you change the number of sizes defined in here!
+		{ 640, 480, 1, 30 },		// VGA - 0.3 MP
+		{ 800, 600, 1, 30 },		// SVGA - 0.5 MP
+		{ 1024, 768, 1, 30 },		// XGA - 0.8 MP
+		{ 2048, 1536, 1, 15 },	// QXGA - 3 MP
+		//{ 2560, 1600, 1, 30 }		// WQXGA - 4.1 MP
+	};
+
+// This constant must be updated if the number of frame sizes listed above changes
+static const TInt KNumFrameSizes = sizeof(FrameSizes) / sizeof(SDevCamFrameSize);
+
+// Pixel formats supported by the three different capture modes.  These are mapped onto the appropriate
+// array of supported frame rates by the FrameSizeCaps() function
+static const SDevCamPixelFormat PixelFormats[] =
+	{
+		// Image pixel formats
+		{ EUidPixelFormatYUV_422Interleaved, KNumFrameSizes, 2 },
+		
+		// Video pixel formats
+		{ EUidPixelFormatYUV_422Interleaved, KNumFrameSizes, 2 },
+
+		// View finder pixel formats
+		{ EUidPixelFormatYUV_422Interleaved, KNumFrameSizes, 2 }
+
+	};
+
+// These constants must be updated if the number of pixel formats listed above changes
+static const TInt KNumImagePixelFormats = 1;
+static const TInt KNumVideoPixelFormats = 1;
+static const TInt KNumViewFinderPixelFormats = 1;
+
+// Alternate logo images after this many frames
+static const TInt KAlternateLogoFrameInterval = 5;
+
+static void ImageTimerCallback(TAny* aSensorIf)
+	{
+	DTemplateSensorIf* sensor = (DTemplateSensorIf*) aSensorIf;
+
+	// XXX - Call the buffer done function in the sensor class.  In this case we are just emulating the
+	// interrupt and DFC callback that would happen when an image is captured, so we always pass in KErrNone.
+	// In a real driver, we would read the hardware here to check that the capture happened successfully and
+	// would pass in the appropriate error code
+	sensor->BufferDoneCallback(KErrNone);
+	}
+
+/**
+Saves a configuration specifying such details as dimensions and pixel format in which the sensor should
+capture images.
+@param	aConfig	A TCameraConfigV02 structure containing the settings to be used.
+@return	KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt DSensorIf::SetConfig(const TCameraConfigV02& aConfig)
+	{
+	// Manual settings for flash mode, focus, white balance etc. are not supported by the sensor,
+	// so check for these and return KErrNotSupported if they have been requested
+	if ((aConfig.iFlashMode != ECamFlashNone) ||
+		(aConfig.iExposureMode != ECamExposureAuto) ||
+		(aConfig.iZoom != 0) /*||
+        (aConfig.iWhiteBalanceMode != ECamWBAuto) ||
+		(aConfig.iContrast != ECamContrastAuto) ||
+		(aConfig.iBrightness != ECamBrightnessAuto)*/)
+		{
+		// XXX: Remove this once support is addded for these modes
+		return KErrNotSupported;
+		}
+
+	// As well as saving the configuration, also save copies of the width and height for easy access,
+	// as they are accessed frequently, as well as the offset in bytes between lines
+	iConfig = aConfig;
+	iWidth = aConfig.iFrameSize.iWidth;
+	iHeight = aConfig.iFrameSize.iHeight;
+	iLineOffset = (iWidth * iConfig.iPixelFormat.iPixelWidthInBytes);
+
+	return KErrNone;
+	}
+
+/**
+Constructor for the Template sensor class.
+*/
+
+DTemplateSensorIf::DTemplateSensorIf(MSensorObserver& aObserver, TDfcQue* aDFCQueue)
+	: iDFCQueue(aDFCQueue)
+	{
+	iObserver = &aObserver;
+	iXDirection = iYDirection = 1;
+	
+	iCounter = 0;
+	iFlipSwitch = EFalse;
+	}
+
+/**
+Second stage constructor for the Template sensor class.
+
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt DTemplateSensorIf::DoCreate()
+	{
+	__KTRACE_CAM(Kern::Printf("> DTemplateSensorIf::DoCreate()"));
+
+	TInt r = KErrNone;
+
+	for (TInt index = 0; index < KTotalCameraRequests; ++index)
+		{
+		if ((iImageTimerDFCs[index] = new TDfc(ImageTimerCallback, this, iDFCQueue, 0)) == NULL)
+			{
+			r = KErrNoMemory;
+
+			break;
+			}
+		}
+
+	__KTRACE_CAM(Kern::Printf("< DTemplateSensorIf::DoCreate() => Returning %d", r));
+
+	return r;
+	}
+
+/**
+Destructor for the Template sensor class.
+*/
+DTemplateSensorIf::~DTemplateSensorIf()
+	{
+	for (TInt index = 0; index < KTotalCameraRequests; ++index)
+		{
+		iImageTimers[index].Cancel();
+		delete iImageTimerDFCs[index];
+		}
+	}
+
+/**
+Called by the underlying sensor class when an image has been captured.
+@param aResult	KErrNone if the image was captured successfully, otherwise one of
+				the other system wide error codes.
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt DTemplateSensorIf::BufferDoneCallback(TInt aResult)
+	{
+	TInt r = KErrNone;
+
+	NKern::LockedDec(iPendingRequests);
+
+	TLinAddr linAddr;
+	TPhysAddr physAddr;
+
+	// Call the LDD to let it know that an image capture has completed.  If the LDD needs more images
+	// to be captured, then it will return KErrNone and the virtual and physical addresses of the
+	// next buffer to be filled will be returned in linAddr and physAddr respectively.  Note that as
+	// will as starting a capture of an image in here, the LDD may also call CaptureNextImage() to start
+	// capture as well
+	r = iObserver->NotifyImageCaptureEvent(aResult, linAddr, physAddr);
+
+	if (r == KErrNone)
+		{
+		iNextRequest = ((iNextRequest + 1) % KTotalCameraRequests);
+		NKern::LockedInc(iPendingRequests);
+
+		// XXX: Temporary code to be removed in a real driver.  Fill the buffer for testing
+		//      with user side code
+		FillBuffer(linAddr);
+
+		// XXX: Send buffer to sensor.  Normally the address of the buffer passed in in aLinAddr and
+		//      aPhysAddr would be programmed into the sensor and/or bus hardware here and an interrupt
+		//      would be generated when the iamge had been captured into the buffer.  In this simulated
+		//      driver we will use a nanokernel timer to simulate this process
+		iImageTimers[iNextRequest].OneShot(iImageTimerTicks, *iImageTimerDFCs[iNextRequest]);
+		}
+
+	return r;
+	}
+
+/**
+Fills a buffer with a white background with a moving logo on top.
+@param aBuffer	Pointer to the buffer to be filled.
+*/
+void DTemplateSensorIf::FillBuffer(TLinAddr aBuffer)
+	{
+	const TUint8* LogoData = Logo.iPixelData;
+	const TUint8* LogoData2 = Logo.iPixelData2;
+	TInt index = 0;
+	TInt numPixels = (iConfig.iFrameSize.iWidth * iConfig.iFrameSize.iHeight);
+	TUint yC, uC, vC;
+	TUint16* buffer = (TUint16*) aBuffer;
+
+    // Alternate between the two logos for cheesy animation effect
+    if( ++iCounter == KAlternateLogoFrameInterval )
+         {
+         iFlipSwitch ^= 1;
+         iCounter = 0;
+         }
+	
+	
+	// Set the "photo" background to be all white
+	memset(buffer, 0xff, (numPixels * 2));
+
+	// Point to the correct location in the buffer at which to render the logo
+	buffer += ((iY * iConfig.iFrameSize.iWidth) + iX);
+
+	// Iterate through the data for the logo and copy it into the "photo"
+	for (TUint y = 0; y < Logo.iHeight; ++y)
+		{
+		for (TUint x = 0; x < Logo.iWidth; ++x)
+			{
+			// The logo is in 24 bit BGR format so read each pixel and convert it to 16 bit BGR565
+			// before writing it into the "photo" buffer
+			if( iFlipSwitch )
+			    {
+                yC = LogoData[index];
+                uC = LogoData[index + 1];
+                vC = LogoData[index + 2];
+			    }
+			else
+                {
+                yC = LogoData2[index];
+                uC = LogoData2[index + 1];
+                vC = LogoData2[index + 2];
+                }
+
+			*buffer++ = YUVtoYUV565(yC, uC, vC);
+			// Point to the next source pixel
+			index += 3;
+			}
+
+			// Point to the start of the next line in the buffer, taking into account that the logo
+			// is narrower than the buffer
+			buffer += (iConfig.iFrameSize.iWidth - Logo.iWidth);
+		}
+
+	// Bounce the logo around in the X direction.  This will take effect the next time this is called
+	iX += iXDirection;
+
+	if (iX <= 0)
+		{
+		iX = 0;
+		iXDirection = -iXDirection;
+		}
+	else if (iX >= (TInt) (iConfig.iFrameSize.iWidth - Logo.iWidth))
+		{
+		iX = (iConfig.iFrameSize.iWidth - Logo.iWidth);
+		iXDirection = -iXDirection;
+		}
+
+	// Bounce the logo around in the Y direction.  This will take effect the next time this is called
+	iY += iYDirection;
+
+	if (iY <= 0)
+		{
+		iY = 0;
+		iYDirection = -iYDirection;
+		}
+	else if (iY >= (TInt) (iConfig.iFrameSize.iHeight - Logo.iHeight))
+		{
+		iY = (iConfig.iFrameSize.iHeight - Logo.iHeight);
+		iYDirection = -iYDirection;
+		}
+
+	// Now flush the cache to memory, taking into account the size of each pixel.  This is not normally
+	// necessary but given that we are emulating a camera driver in software we must ensure that the
+	// cache is flushed to memory.  This is because in a real driver the buffer will have been filled
+	// by DMA so upon return to the LDD, the LDD will discard the contents of the cache to ensure the
+	// DMA-written data is ok.  In the case of filling the buffer using the CPU in this virtual camera
+	// driver, that would result in the data being discarded!
+	Cache::SyncMemoryBeforeDmaWrite((TLinAddr) aBuffer, (numPixels * iConfig.iPixelFormat.iPixelWidthInBytes));
+	}
+
+/**
+Based on the capture mode and pixel format passed in, copies an array of supported SFrameSize
+structures into a buffer supplied by the LDD.  These frame sizes and their associated frame rates
+will reflect the capabilities of the given capture mode and pixel format.
+@param aCaptureMode			The capture mode for which to obtain the supported frame sizes.
+@param aUidPixelFormat		The UID of the pixel format (as defined in \epoc32\include\pixelformats.h)
+							for which to obtain the supported frame sizes.
+@param aFrameSizeCapsBuf	A reference to a descriptor that contains a buffer into which to place
+							the frame size structures.  It is up to the LDD to ensure that this is
+							large enough to hold all of the frame sizes.
+@return Always KErrNone.
+*/
+TInt DTemplateSensorIf::FrameSizeCaps(TDevCamCaptureMode /*aCaptureMode*/, TUidPixelFormat /*aUidPixelFormat*/, TDes8& aFrameSizeCapsBuf)
+	{
+	TPtrC8 sourceFrameSizes((const TUint8*) FrameSizes, sizeof(FrameSizes));
+
+	// Ensure the buffer passed in from the LDD is large enough and copy the requested frame sizes
+	if (aFrameSizeCapsBuf.Size() < sourceFrameSizes.Size())
+		{
+		Kern::Printf("*** ECapsBufferTooSmall: %d vs %d",
+				aFrameSizeCapsBuf.Size(),
+				sourceFrameSizes.Size());
+		Kern::Fault("camerasc", ECapsBufferTooSmall);
+		}
+	
+	//__ASSERT_DEBUG((aFrameSizeCapsBuf.Size() >= sourceFrameSizes.Size()), Kern::Fault("camerasc", ECapsBufferTooSmall));
+	aFrameSizeCapsBuf = sourceFrameSizes;
+
+	return KErrNone;
+	}
+
+/**
+Allocates a buffer large enough to hold the TCameraCapsV02 structure and its succeeding array of
+pixel formats, and populates the structure and array with information about the capabilities of
+the sensor.
+@param aCameraCaps	Reference to a pointer into which to place the pointer to allocated buffer
+@return	Size of the capabilities structure if successful, otherwise one of the other system wide
+		error codes.
+*/
+TInt DTemplateSensorIf::GetCaps(TCameraCapsV02*& aCameraCaps)
+	{
+	// Allocate a buffer large enough to hold the TCameraCapsV02 structure and the array of pixel formats
+	// that will follow it
+	TInt r = (sizeof(TCameraCapsV02) + sizeof(PixelFormats));
+	TUint8* capsBuffer = new TUint8[r];
+
+	if (capsBuffer)
+		{
+		aCameraCaps = (TCameraCapsV02*) capsBuffer;
+
+		// No special modes are supported at the moment
+		aCameraCaps->iFlashModes = ECamFlashNone;
+		aCameraCaps->iExposureModes = ECamExposureAuto; // or None?
+		// do we still need whitebalance mode filed?
+		aCameraCaps->iWhiteBalanceModes = ECamWBAuto | ECamWBDaylight | ECamWBCloudy | ECamWBTungsten | ECamWBFluorescent | ECamWBFlash | ECamWBSnow | ECamWBBeach;
+		aCameraCaps->iMinZoom = 0;
+		aCameraCaps->iMaxZoom = 0;
+		aCameraCaps->iCapsMisc = KCamMiscContrast | KCamMiscBrightness | KCamMiscColorEffect;
+
+		// There isn't really such thing as inwards or outwards orientation on an SDP, but we'll pretend it's
+		// an outwards facing camera
+		aCameraCaps->iOrientation = ECamOrientationOutwards;
+
+		// Initialise the number of different pixel formats supported
+		aCameraCaps->iNumImagePixelFormats = KNumImagePixelFormats;
+		aCameraCaps->iNumVideoPixelFormats = KNumVideoPixelFormats;
+		aCameraCaps->iNumViewFinderPixelFormats = KNumViewFinderPixelFormats;
+
+		for (TInt i = 0; i < ECamAttributeMax; i++)
+		    {
+		    if (ECamAttributeColorEffect == (TDevCamDynamicAttribute)(i))
+		        {
+		        // WhiteBalance
+		        // In case of white balance, we shouldn't use MIN and MAX values as some of them in between MIN and MAX can be missed out.
+		        // As this is fake driver, There doesn't seem to be any major issue though.
+		        aCameraCaps->iDynamicRange[i].iMin = ECamWBAuto;
+		        aCameraCaps->iDynamicRange[i].iMax = ECamWBBeach;
+		        aCameraCaps->iDynamicRange[i].iDefault = ECamWBAuto;
+		        }
+		    else
+		        {    
+		        // TBC :: Contrast, Brightness
+		        aCameraCaps->iDynamicRange[i].iMin = 0;
+		        aCameraCaps->iDynamicRange[i].iMax = 6;
+		        aCameraCaps->iDynamicRange[i].iDefault = 3;
+		        }
+		    }
+
+		// Setup some descriptors pointing to the pixel format array and the array passed in by the LDD
+		// (located at the end of the TCameraCapsV02 structure) and copy the pixel format array
+		TPtrC8 sourcePixelFormats((const TUint8*) PixelFormats, sizeof(PixelFormats));
+		TPtr8 destPixelFormats((capsBuffer + sizeof(TCameraCapsV02)), sizeof(PixelFormats), sizeof(PixelFormats));
+		destPixelFormats = sourcePixelFormats;
+		}
+	else
+		{
+		r = KErrNoMemory;
+		}
+
+	return r;
+	}
+
+/**
+Powers up the sensor hardware.
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt DTemplateSensorIf::RequestPower()
+	{
+	__KTRACE_CAM(Kern::Printf("> DTemplateSensorIf::RequestPower()"));
+
+	TInt r = KErrNone;
+
+	__KTRACE_CAM(Kern::Printf("< DTemplateSensorIf::RequestPower() => Returning %d", r));
+
+	return r;
+	}
+
+/**
+Powers down the sensor hardware.
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt DTemplateSensorIf::RelinquishPower()
+	{
+	__KTRACE_CAM(Kern::Printf("> DTemplateSensorIf::RelinquishPower()"));
+
+	TInt r = KErrNone;
+
+	__KTRACE_CAM(Kern::Printf("< DTemplateSensorIf::RelinquishPower() => Returning %d", r));
+
+	return r;
+	}
+
+/**
+Begins capture of the next image into the buffer provided.  This function assumes that
+Start() has already been called to start capture.  However, Stop() may also have been
+subsequently called (for example to pause capture) and in this case, this function will
+handle restarting the sensor.
+@param aLinAddr		A virtual pointer to the buffer into which to capture the image.
+@param aPhysAddr	A physical pointer to the buffer into which to capture the image.
+					This points to the same memory as aLinAddr.
+@return KErrNone if successful.
+		KErrNotReady if there are no free requests to capture the image.
+		Otherwise one of the other system wide error codes.
+*/
+TInt DTemplateSensorIf::CaptureNextImage(TLinAddr aLinAddr, TPhysAddr /*aPhysAddr*/)
+	{
+	TInt r = KErrNone;
+
+	// Only start capturing the next image if there are any pending request slots available
+	if (iPendingRequests < KTotalCameraRequests)
+		{
+		// Queue a transfer on the next available channel and indicate that the channel is
+		// in use
+		iNextRequest = ((iNextRequest + 1) % KTotalCameraRequests);
+		NKern::LockedInc(iPendingRequests);
+
+		// XXX: Temporary code to be removed in a real driver.  Fill the buffer for testing
+		//      with user side code.  This is to simulate an image being captured into the buffer that
+		//      has been passed in in aLinAddr.  As well as aLinAddr, which points to the virtual
+		//      address of the buffer, the LDD will pass in the physical address as well, in aPhysAddr.
+		//      Depending on the underlying sensor hardware and/or bus in use, you will have to choose
+		//      which of these to use
+		FillBuffer(aLinAddr);
+
+		// XXX: Send buffer to sensor.  Normally the address of the buffer passed in in aLinAddr and
+		//      aPhysAddr would be programmed into the sensor and/or bus hardware here and an interrupt
+		//      would be generated when the iamge had been captured into the buffer.  In this simulated
+		//      driver we will use a nanokernel timer to simulate this process
+		iImageTimers[iNextRequest].OneShot(iImageTimerTicks, *iImageTimerDFCs[iNextRequest]);
+
+		// If capturing has not yet started or has been paused by Stop(), start it
+		if (!(iEnabled))
+			{
+			iEnabled = ETrue;
+			}
+		}
+	else
+		{
+		r = KErrNotReady;
+		}
+
+	return r;
+	}
+
+/**
+Begins capture of the first image into the buffer provided.  This function is similar to
+CaptureNextImage(), except that it will perform any extra sensor intitialisation required
+to start capture.
+@param aCaptureMode	The capture mode for which to start capturing.
+@param aLinAddr		A virtual pointer to the buffer into which to capture the image.
+@param aPhysAddr	A physical pointer to the buffer into which to capture the image.
+					This points to the same memory as aLinAddr.
+@return KErrNone if successful
+		KErrInUse if capture is already under way.
+		KErrNotSupported if the frame size and/or frame rate are out of range.
+		Otherwise one of the other system wide error codes.
+*/
+TInt DTemplateSensorIf::Start(TDevCamCaptureMode /*aCaptureMode*/, TLinAddr aLinAddr, TPhysAddr aPhysAddr)
+	{
+	__KTRACE_CAM(Kern::Printf("> DTemplateSensorIf::Start()"));
+
+	TInt r = KErrNone;
+
+	// XXX - In a real camera driver, in here we would initialise start the capturing process in here.
+	//       When an image is captured, the sensor hardware (or maybe the CSI bus) will generate an
+	//       which will then be enqueued into the DFC queue that was passed into the constructor of
+	//       the sensor class.  It is important to do the DFC processing in this DFC queue rather than
+	//       a separate one because it ensures that fucntions in the PDD and LDD are called in a serialised
+	//       manner, without the need for mutexts.  In this example camera driver we will convert the
+	//       framerate into a nanokernel tick count and will use an NTimer.OneShot() call to simulate
+	//       the sensor interrupt and DFC callback.  Divides are slow so we'll calculate the tick count
+	//       here and will save it for later use
+	iImageTimerTicks = ((1000000 / NKern::TickPeriod()) / iConfig.iFrameRate);
+
+	// XXX - Once the one off hardware initialisation has been done for starting a new capture, then
+	//       subsequent captures can usually reuse the same code in CaptureNextImage() for starting
+	//       the next capture
+	r = CaptureNextImage(aLinAddr, aPhysAddr);
+
+	__KTRACE_CAM(Kern::Printf("< DTemplateSensorIf::Start() => Returning %d", r));
+
+	return r;
+	}
+
+/**
+Stops capturing any image capture that is currently in progress.  This function will act
+more like a Pause() than a Stop() capturing can be restarted from where it was stopped.
+*/
+TInt DTemplateSensorIf::Stop()
+	{
+	__KTRACE_CAM(Kern::Printf("> DTemplateSensorIf::Stop()"));
+
+	iEnabled = EFalse;
+	iPendingRequests = iNextRequest = 0;
+
+	// XXX - Cancel all of our pending image timer callbacks.  In a real driver we would write to the
+	//       sensor and/or bus hardware here to cause them to cancel any pending image captures
+	for (TInt index = 0; index < KTotalCameraRequests; ++index)
+		{
+		iImageTimers[index].Cancel();
+		}
+
+	__KTRACE_CAM(Kern::Printf("< DTemplateSensorIf::Stop()"));
+
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bsptemplate/asspandvariant/template_variant/camerasc/logo.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,883 @@
+// 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:
+// template\template_variant\camerasc\logo.cpp
+// This file contains the binary data for the logo that gets rendered in the
+// "photos" taken by this template camera driver.
+// 
+//
+
+#include "camerasc_plat.h"
+
+/** The logo rendered in "photos" returned by the template camera driver. */
+const struct SLogo Logo =
+	{
+	124, 47,
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\342\347\373\320\332\371\321\332\371\321\333\371\322\333\372\321\333\371"
+	"\322\333\371\322\333\371\321\333\371\321\332\371\322\333\371\321\332\371"
+	"\322\333\372\321\333\371\321\332\371\315\327\370\367\371\376\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\0""7\336\0K\341\0J\341\0L\343\0J\341"
+	"\0J\341\0L\343\0J\341\0I\341\36n\347\362\363\375\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\300\322\370\22`\346\0G\341\0J\341\0L\343\0A\340j\241\360\377\377\377\377"
+	"\377\377\364\367\376\213\252\361\7]\345\0K\341\0O\342\0O\342\0O\342\0O\342"
+	"\0P\344\0O\342\0O\342\0O\342\0O\342\0P\342\0O\342\0O\342\0P\344\0O\342\0"
+	"P\342\0H\3414q\347\317\334\370\377\377\377\377\377\377\377\377\377E{\351"
+	"\0F\340\0J\341\0L\341\0K\343\0C\341\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\267\314\367\0L\342"
+	"\0K\343\0J\341\0L\343\0J\341\0G\341\0M\342k\227\355\377\377\377\340\346\372"
+	"F\202\352\0E\342\0J\341\0K\341\0F\341(r\347\314\330\367\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377K\212\353\0I\340\0K\343\0J\341\0K\341\0K\341\0J\341\0?\341"
+	"\272\321\367\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\0L\343\0]\344\0_\346\0^"
+	"\344\0_\346\0_\346\0_\346\0]\344\0\\\344\0[\344[\215\354\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\310\327\371*q\347\0[\344\0]\345\0]\344\0T\343y\253\362\377\377\377"
+	"\365\367\374`\226\356\0S\343\0[\344\0^\345\0]\344\0^\345\0]\344\0^\345\0"
+	"]\344\0]\344\0_\346\0]\344\0_\346\0]\344\0]\344\0]\344\0_\344\0]\344\0]\344"
+	"\0_\346\0Y\344\0O\341\316\332\371\377\377\377\377\377\377Y\210\353\0X\343"
+	"\0]\345\0]\344\0\\\344\0U\342\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\374\374\375\215\256\361\0T\344\0]\344\0]\344"
+	"\0]\344\0\\\344\0Z\345\36m\347\267\310\367\377\377\377\377\377\377\343\351"
+	"\373Y\216\354\0W\343\0]\345\0_\344\0Z\344>\200\353\322\335\370\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\275\316\366%q\350\0[\344\0^\346\0_\344\0]\344\0^\345\0]\344"
+	"\0Y\343N\204\352\357\363\375\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\0J\341\0]\344\0]\344"
+	"\0]\345\0]\344\0]\344\0]\344\0]\345\0]\344\0[\344\4^\344\200\243\360\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\310\327\371*o\347\0Z\344\0]\345\0_\345\0U\343y\253\362\377\377\377"
+	"\256\305\365\36k\350\0Z\344\0]\345\0_\344\0]\345\0^\344\0]\344\0^\346\0^"
+	"\346\0\\\344\0^\344\0]\344\0\\\344\0^\346\0]\344\0]\344\0^\346\0]\344\0]"
+	"\344\0_\346\0]\344\0X\3444s\350\377\377\377\377\377\377Y\211\355\0X\343\0"
+	"]\344\0]\344\0^\346\0S\342\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\372\372\376\212\256\361\0K\343\0^\346\0]\344\0]\344\0\\\344"
+	"\0Y\344.w\350\334\341\371\377\377\377\377\377\377\377\377\377\343\351\373"
+	"Y\217\354\0X\345\0_\346\0]\344\0X\344>\200\353\322\335\371\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\375"
+	"\373\376>\204\352\0T\343\0]\345\0]\344\0]\344\0]\344\0_\346\0]\344\0]\345"
+	"\0N\342\243\276\364\377\376\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\0L\343\0]\344\0_\345\0]\344\0]\344"
+	"\0]\344\0^\344\0]\344\0^\345\0]\344\0Z\344\10b\345\234\266\363\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\310\327\370"
+	"*p\347\0Z\344\0]\345\0_\345\0U\343y\253\362\377\377\377s\250\361\0Q\342\0"
+	"^\345\0]\344\0]\344\0^\346\0]\344\1^\344\1]\344\1]\344\1]\345\1]\345\1]\345"
+	"\1]\344\1_\346\1]\344\1_\344\2_\346\0\\\344\0]\344\0]\344\0^\345\0]\344\0"
+	"H\342\377\377\377\377\377\377Y\211\354\0Z\345\0]\344\0^\345\0\\\344\0S\343"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\363\366\375]\215\354\0N"
+	"\343\0^\345\0_\346\0]\344\0[\344\0^\345J\211\353\361\357\373\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\343\351\372Y\217\354\0X\345\0]\344\0"
+	"_\346\0X\344>\200\352\322\335\370\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\230\265\364\24f\346\0[\344\0"
+	"]\345\0]\344\0]\344\0]\344\0]\344\0^\345\0]\345\0Z\344-o\350\353\360\375"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\0J\341\0_\344\0_\346\0]\344\1_\344%q\350\0\\\344\0]\344\0_\346"
+	"\0]\344\0_\346\0X\344\23i\347\304\322\370\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\310\330\370*q\350\0Z\344\0]\344\0]\345\0U\343"
+	"y\253\362\377\377\377y\253\362\0T\343\0_\346\0]\344\0]\345\20h\347V\213\355"
+	"r\231\356o\227\356o\227\356o\230\357o\230\357o\230\357m\227\356m\227\356"
+	"o\227\356o\227\357v\233\356/w\350\0^\344\0]\344\0]\344\0^\345\0M\342\343"
+	"\351\373\377\377\377Y\210\353\0X\343\0]\345\0]\344\0\\\344\0U\342\377\377"
+	"\377\377\377\377\377\377\377\356\362\374N\202\354\0Q\342\0^\345\0^\345\0"
+	"]\344\0\\\346\12a\345k\231\356\377\375\376\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\342\351\373W\216\354\0W\343\0_\346\0]\344\0"
+	"X\344>\201\353\322\335\371\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\346\353\373:\201\352\0V\343\0]\345\0^\344\0[\344"
+	"\32l\346\14d\346\0]\344\0]\344\0]\344\0_\345\0Q\344\204\251\361\374\375\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\0K\342\0]\344\0]\344\0\\\344\10c\347\260\301\365Q\207\352\0W\344\0_\345"
+	"\0]\344\0]\344\0]\344\0Y\3440y\350\342\350\373\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\310\327\370*p\347\0Z\344\0^\345\0]\344\0T\343y\253\362"
+	"\377\377\377y\253\362\0T\343\0]\344\0_\345\0V\343u\242\357\377\375\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\341\344\373\20f"
+	"\346\0[\344\0]\344\0_\346\0P\343\311\325\367\377\377\377Y\210\353\0X\343"
+	"\0]\344\0^\345\0]\345\0S\343\377\377\377\377\377\377\334\345\371-n\347\0"
+	"T\343\0]\344\0_\346\0^\345\0Z\344\26j\350\226\263\363\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\343\351"
+	"\374Y\217\355\0X\345\0]\344\0]\345\0Y\344>\200\353\322\335\371\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\215\257\362"
+	"\17c\346\0\\\344\0]\345\0^\344\0U\344\206\254\361\216\252\362\22g\346\0["
+	"\344\0]\344\0_\346\0\\\344\7Z\343\343\353\373\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\0L\343\0]\344\0]\344\0\\\344"
+	"\4_\345\264\305\366\373\375\375\27j\347\0Y\345\0]\344\0]\344\0^\345\0^\344"
+	"\0Y\344N\207\352\371\370\376\377\377\377\377\377\377\377\377\377\310\327"
+	"\370*q\350\0[\345\0_\346\0]\344\0T\343y\253\362\377\377\377y\253\362\0T\343"
+	"\0^\345\0_\346\0T\343}\251\361\370\371\376\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\352\354\373\20h\347\0[\344\0]\345\0^\344\0O"
+	"\342\313\330\370\377\377\377Y\211\354\0Y\344\0]\344\0_\346\0^\345\0U\344"
+	"\377\377\377\327\342\372\32d\345\0V\343\0]\344\0^\345\0]\344\0Z\344&t\350"
+	"\263\304\364\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\343\351\373Y\216\354\0W\344\0^\344\0"
+	"]\345\0Z\344>\202\353\322\335\371\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\317\332\3700y\350\0Y\345\0]\344\0]\344\0Z\344\14d\345"
+	"\313\335\371\377\377\377=\203\353\0Z\344\0]\344\0]\344\0_\345\0T\343d\224"
+	"\354\372\373\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\0J\341\0]\344\0]\344\0]\346\4_\345\257\302\365\377\377\377\327\342\372"
+	"\2^\344\0Y\344\0]\344\0_\346\0^\344\0\\\344\5^\345r\234\356\377\377\377\377"
+	"\377\377\377\377\377\310\327\371*o\347\0Z\344\0^\345\0]\344\0T\343y\253\362"
+	"\377\377\377y\253\361\0T\343\0_\346\0]\344\0T\343|\250\361\367\370\376\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\347\353\373\17g"
+	"\345\0[\344\0]\345\0_\344\0O\342\313\330\370\377\377\377Y\210\353\0Z\345"
+	"\0]\344\0^\345\0]\344\0X\343\314\333\370\7Y\343\0Z\345\0^\344\0^\345\0^\344"
+	"\0]\344/x\351\353\354\373\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\343\351\374"
+	"Y\217\355\0X\345\0_\344\0]\344\0Y\344>\201\351\322\335\370\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\376\375\376n\235\357\1[\344\0]\344\0]\344"
+	"\0]\345\0T\343\221\263\362\373\372\376\377\377\377\271\311\365\24i\347\0"
+	"Z\344\0^\345\0]\345\0]\344\0R\342\317\335\371\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\0K\341\0^\345\0^\344\0]\346\4_\345\256\300"
+	"\364\377\377\377\377\377\376\262\307\365\1]\344\0[\344\0]\344\0]\344\0_\346"
+	"\0Z\344\12c\345\215\256\362\377\377\377\377\377\377\310\327\371*o\347\0Z"
+	"\344\0_\346\0]\344\0T\343y\253\362\377\377\377y\253\361\0U\344\0^\345\0]"
+	"\344\0T\343}\250\361\367\370\376\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\350\353\374\17g\346\0[\344\0]\344\0]\344\0P\343\314"
+	"\330\371\377\377\377Y\210\354\0X\343\0^\344\0_\346\0]\345\0[\344'r\350\0"
+	"V\343\0^\346\0^\344\0^\346\0\\\344\11c\345\223\262\362\377\376\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\343\351\373X\217\355\0W\343\0^\345\0^\345\0"
+	"Z\344>\200\352\322\335\370\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\271\314\366%r\350\0Y\344\0^\345\0]\344\0Z\345)p\350\330\344\372\377\377"
+	"\377\377\377\377\377\377\377G\210\353\0[\344\0]\344\0]\344\0]\344\0X\344"
+	"A|\352\370\371\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0L\341\0"
+	"_\346\0_\344\0]\346\4_\345\256\300\364\377\377\377\377\377\377\376\376\376"
+	"\214\256\361\0Z\344\0\\\345\0^\344\0]\344\0^\345\0X\344\33n\347\270\314\366"
+	"\377\377\377\311\330\371*p\347\0Z\344\0^\345\0]\344\0T\343y\253\362\377\377"
+	"\377y\253\361\0T\343\0_\345\0^\345\0T\343|\250\360\367\370\376\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\347\353\373\17g\346\0\\"
+	"\345\0^\345\0^\344\0O\342\313\327\370\377\377\377Y\210\354\0Y\343\0]\344"
+	"\0_\346\0^\345\0V\343\354\354\374/y\350\0X\344\0]\344\0]\344\0_\345\0\\\345"
+	"\0Z\344o\231\357\361\364\375\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\342\351\373X\216\354"
+	"\0W\344\0_\346\0_\346\0Y\344>\202\353\322\335\372\377\377\377\377\377\377"
+	"\377\377\377\372\371\375]\226\355\0X\344\0]\344\0]\344\0]\345\0X\344\230"
+	"\270\363\372\370\375\376\375\376\374\373\376\377\377\377\320\330\367\34n"
+	"\347\0[\344\0^\345\0^\345\0_\345\0M\342\270\315\366\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\0K\341\0_\346\0^\344\0]\345\4`\346\256\301\365\377"
+	"\377\377\377\377\377\377\377\377\370\372\376b\222\355\0Y\345\0^\345\0]\344"
+	"\0_\345\0]\344\0V\344&v\351\334\346\372\321\335\371*q\350\0[\345\0^\345\0"
+	"^\344\0T\343y\253\361\377\377\377y\253\361\0U\344\0_\345\0_\345\0T\343~\250"
+	"\361\370\370\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\351\353\373\17g\345\0\\\345\0^\345\0^\344\0P\342\314\330\370\377\377"
+	"\377Y\210\353\0Y\344\0]\344\0^\345\0\\\344\0T\343\377\377\377\362\363\374"
+	"0y\350\0X\344\0\\\345\0_\344\0]\344\0\\\344\0Y\343Q\206\353\342\351\373\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\343\351\374Y\217\355\0X\345\0^\345\0^\345\0X\343>\201\353\322\335"
+	"\371\377\377\377\377\377\377\377\377\377\241\276\364\27h\347\0[\344\0]\344"
+	"\0]\344\0^\346\24e\346\177\250\361\241\277\365\233\272\363\233\272\363\232"
+	"\273\364\246\301\365\32m\347\0[\344\0^\345\0_\346\0_\346\0Z\344\"i\346\364"
+	"\365\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\0K\342\0^\345\0]\344\0\\\344"
+	"\4_\345\256\300\364\377\377\377\377\377\377\377\377\377\377\377\377\351\357"
+	"\374>~\351\0Y\345\0]\345\0]\344\0]\344\0^\345\0X\344I\212\354\265\310\365"
+	"1t\350\0Z\344\0^\345\0^\344\0U\344y\253\361\377\377\377y\253\362\0T\343\0"
+	"^\345\0_\345\0U\343y\245\361\372\371\376\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\347\351\373\20h\346\0[\344\0]\344\0]\345\0P"
+	"\342\312\326\370\377\377\377Y\210\353\0X\344\0^\345\0]\344\0\\\344\0U\344"
+	"\377\377\377\377\377\377\357\361\374=\202\353\3]\345\0\\\344\0]\344\0^\345"
+	"\0\\\344\0Y\344>|\351\300\325\370\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\343\351\373X\217\355\0X\344\0^\344\0^\345"
+	"\0Y\344>\200\352\322\335\370\377\377\377\377\377\377\346\354\374F\210\354"
+	"\0U\343\0]\344\0^\345\0]\344\0^\345\0\\\345\0U\343\0R\343\0R\343\0R\343\0"
+	"S\344\0T\344\0[\344\0^\345\0]\344\0^\345\0_\345\0^\345\0Q\344\224\264\363"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\0K\342\0]\344\0]\344\0]\345\4`\346\256"
+	"\301\365\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\317"
+	"\335\371\"p\350\0X\344\0^\345\0]\344\0]\344\0\\\344\11b\3454v\350(r\350\0"
+	"\\\345\0]\344\0^\345\0U\344y\253\361\377\377\377y\253\361\0T\343\0]\344\0"
+	"^\345\0Y\344A\202\352\270\315\366\331\343\372\324\340\372\325\340\372\325"
+	"\340\372\325\340\371\325\340\372\325\341\372\325\340\371\325\341\372\325"
+	"\341\372\334\345\372\234\271\364\12d\347\0\\\345\0]\344\0]\344\0O\343\323"
+	"\335\371\377\377\377Y\210\353\0X\343\0^\345\0]\345\0\\\344\0U\342\377\377"
+	"\377\377\377\377\377\377\377\377\377\377i\226\355\0\\\345\0Z\344\0^\345\0"
+	"]\345\0]\344\0X\343\32l\347\257\310\366\376\374\376\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\342\351\373X\216\354\0W\343\0_\345\0^\345\0Z\345"
+	">\200\352\322\335\371\377\377\377\377\377\377\217\262\362\15b\345\0\\\344"
+	"\0]\344\0^\345\0]\344\0]\344\0^\345\0]\344\0]\345\0^\344\0^\345\0]\344\0"
+	"]\344\0^\344\0]\344\0^\345\0]\344\0^\344\0_\346\0\\\345\0X\343\347\354\374"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\0J\341\0^\345\0]\344\0]\345\4_\345\256\301\365\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\256"
+	"\306\365\20e\345\0Z\345\0]\344\0^\345\0]\344\0\\\344\0Z\344\0[\344\0]\344"
+	"\0]\344\0^\345\0T\343y\253\362\377\377\377w\251\361\0T\344\0^\345\0]\344"
+	"\0^\345\0V\343\31h\3463t\350/r\3500s\3500r\3500s\3500r\3510s\3510r\3500s"
+	"\3510s\3513t\350\10a\345\0^\345\0^\345\0]\344\0]\344\0L\342\362\365\375\377"
+	"\377\377Y\210\354\0Y\344\0]\344\0^\345\0\\\344\0U\343\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\376\375\377m\231\355\22f\346\0Y\344\0^\345\0"
+	"]\345\0]\345\0X\343\11b\346\230\267\363\356\362\375\377\377\377\377\377\377"
+	"\377\377\377\343\351\374Y\217\355\0W\343\0^\345\0]\344\0Z\344>\200\353\322"
+	"\335\371\377\377\377\321\335\3718~\351\0X\344\0]\345\0^\345\0]\344\0[\344"
+	"\0W\343\0V\343\0W\343\0V\343\0W\343\0W\344\0V\343\0V\343\0X\344\0V\343\0"
+	"Z\345\0]\344\0]\344\0^\345\0^\345\0U\344d\225\355\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\0K\342\0_\346\0^\345\0\\\344\4`\346\256\300\364\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\375\374\376\230\266\362"
+	"\6_\345\0[\344\0^\345\0]\344\0^\345\0]\344\0^\345\0]\344\0^\345\0]\344\0"
+	"T\343y\253\362\377\377\377\213\263\363\0\\\345\0]\345\0^\344\0]\344\0^\344"
+	"\0\\\345\0Z\344\0Z\344\0[\344\0Z\344\0[\345\0Z\344\0Z\344\0Z\344\0Z\344\0"
+	"Z\344\0Z\344\0]\345\0_\346\0]\344\0^\345\0[\344\0Y\344\377\377\377\377\377"
+	"\377Y\211\355\0Y\344\0^\345\0]\344\0\\\344\0U\344\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\376\376\232\266\363\20d\346\0Y\344"
+	"\0]\345\0]\344\0^\344\0[\345\0\\\344m\233\357\346\354\373\377\377\377\377"
+	"\377\377\343\351\374Y\217\355\0W\344\0]\344\0]\345\0Z\344>\201\353\324\337"
+	"\372\377\377\377{\245\360\0Z\344\0]\344\0]\345\0^\345\0X\344%u\350P\217\355"
+	"S\222\355R\223\355R\222\355R\222\355R\222\355R\222\355R\222\355R\223\356"
+	"V\224\355;\200\352\1^\345\0]\344\0]\344\0_\345\0]\345\0R\343\330\340\372"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\0K\342\0_\346\0^\345\0\\\344\4`\346\256\301\365\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\363\366\375s\236\356\1\\\344\0\\\345\0]\344\0^\345\0^\345\0^\345\0]\344"
+	"\0]\344\0^\345\0U\343y\253\362\377\377\377\321\334\370=\177\352\0V\343\0"
+	"]\344\0]\345\0^\344\0]\344\0]\344\0^\345\0]\344\0]\344\0^\345\0^\344\0]\344"
+	"\0^\345\0]\344\0_\346\0]\344\0]\344\0_\346\0]\344\0\\\344\0S\343|\242\360"
+	"\377\377\377\377\377\377X\210\354\0X\343\0^\345\0^\345\0\\\344\0U\344\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\233\267\364\34l\346\0V\343\0^\345\0^\344\0]\344\0[\345\0\\\344U"
+	"\212\353\326\340\372\377\377\377\346\353\374X\217\355\0X\344\0]\344\0]\345"
+	"\0Y\344>\201\352\333\343\372\305\326\371)t\350\0Y\344\0^\344\0]\345\0\\\344"
+	"\11a\345\246\301\364\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\355"
+	"\355\373!n\347\0[\344\0]\344\0_\345\0^\345\0V\343J\205\353\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0B\340"
+	"\0V\344\0U\343\0T\343\0W\344\251\275\364\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\344\353"
+	"\373R\212\354\0T\343\0U\343\0U\344\0V\344\0U\344\0U\343\0U\343\0V\344\0L"
+	"\341r\246\361\377\377\377\377\377\376\243\302\3641x\351\0[\344\0U\343\0W"
+	"\344\0W\343\0X\343\0W\343\0W\343\0X\344\0W\343\0X\343\0W\343\0W\343\0W\343"
+	"\0X\344\0W\343\0W\344\0X\344\0T\343\17b\345N\214\353\356\361\375\377\377"
+	"\377\377\377\377O\202\352\0P\342\0U\343\0V\344\0T\343\0L\342\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\262\307\365't\350\0R\344\0U\343\0U\344\0V\344\0S\343\0S\344"
+	"1u\351\256\311\366\332\342\371Q\211\353\0N\342\0V\344\0U\343\0P\3437|\351"
+	"\277\315\366`\230\356\0N\342\0U\343\0U\344\0U\343\0N\342^\223\356\353\357"
+	"\374\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\177\243"
+	"\357\0X\344\0T\343\0V\344\0U\343\0U\344\0D\341\252\302\365\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377T\223\355f\237\360"
+	"f\237\357d\236\357h\237\357\316\332\371\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\317\336\372g\236\356d\235\357f\237\360f\236\357f\237\360f\236\357f\236\357"
+	"f\236\357]\231\356\257\314\367\377\377\377\377\377\377\377\377\376\312\327"
+	"\370y\246\360S\221\355N\215\355O\215\354O\215\354O\215\354O\215\354O\216"
+	"\355O\215\355O\215\354O\215\354O\215\354O\214\354O\216\354O\215\354O\216"
+	"\355N\214\354Y\226\356\225\264\363\362\364\374\377\377\377\377\377\377\377"
+	"\377\377\233\267\363a\233\356e\237\357f\236\357e\235\357]\230\356\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\307\326\371[\231\357f\237\357f\237\360f\237"
+	"\357f\236\357c\236\357\\\230\356\215\265\362\340\347\372\235\275\364_\232"
+	"\356f\237\360f\236\357`\234\357\217\266\363\303\322\367\211\261\362`\233"
+	"\356f\237\357f\237\360f\236\357\\\230\356\277\326\370\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\351\354\373p\243\360"
+	"c\235\360f\237\357f\236\357f\237\360^\233\357\224\261\362\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\372"
+	"\371\377\360\361\374\361\362\375\361\361\375\361\361\375\361\362\374\361"
+	"\362\375\361\362\375\361\362\374\361\362\375\361\361\375\361\361\375\361"
+	"\362\375\360\362\375\361\362\374\357\361\374\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\367\371\376\276"
+	"\317\366\355\361\374\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\366\370\375\265\311\366\320"
+	"\334\371\374\375\376\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\337\345\373v\250\361j\241\357"
+	"l\243\360\255\304\365\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\323\336\371\356\362\375\377"
+	"\377\377\377\377\377\256\303\364\32i\347\244\276\364\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\367\370"
+	"\376\262\312\366n\244\360l\243\360u\247\360\243\277\364\346\354\373\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\350\355"
+	"\374-s\350\201\246\357\367\371\376\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\356\361\3759~\351\24b\345\\"
+	"\224\355^\225\356\207\250\360\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377F\205\352\301\323\370"
+	"\377\377\377\377\377\377\270\313\3663y\351\254\303\365\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\356\362"
+	"\375b\223\355\0X\344P\212\353?~\352,p\350g\233\357\347\355\373\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\351\354\374\11d\347q\234"
+	"\355\367\370\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\203\245\361\0J\341\245\274\364\371\370\375\364"
+	"\365\375\343\352\373\377\377\377\377\377\377\355\360\374\363\364\375\377"
+	"\377\377\377\377\377\377\377\377\373\374\376\361\363\375\377\377\377\377"
+	"\376\376\356\357\374\372\372\376\377\377\377\377\377\377\371\371\375\365"
+	"\365\375\377\377\377\376\374\376\356\360\375\377\375\376\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\373\372\376\356\360\374\377\375\376\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\366\366\376\357"
+	"\361\374\366\370\375\372\372\375\304\321\367\0Z\344\241\274\363\360\360\374"
+	"\372\373\376\352\355\374\300\315\366\355\361\375\377\377\377\355\357\374"
+	"\377\377\377\377\377\377\357\360\375\356\360\375\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\355\357\374\363\363\376\377\377\377"
+	"\370\371\376\367\370\376\377\377\377\377\377\377\377\377\377\360\363\375"
+	"f\226\355\37p\350\337\342\372\336\345\373v\244\361\7`\346\227\266\363\377"
+	"\377\377\377\377\377\377\377\376\356\360\374\372\371\376\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\367\367\375\356\360\375\377"
+	"\377\377\377\377\377\377\377\377\371\372\376\367\371\376\377\377\377\376"
+	"\374\376\361\362\374\372\372\376\377\377\377\377\377\377\351\354\373\16f"
+	"\346t\235\356\370\371\376\377\377\377\377\377\377\362\363\375\357\360\375"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\2Y\344#n\347\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\367\371\376\200\247\360;\201\352>\203\353n\242\360"
+	"\357\360\374\377\377\377\322\342\372a\227\356\265\313\366S\221\355;\201\353"
+	"]\224\355\301\322\367\377\377\377\264\316\366y\245\360\244\301\365M\215\354"
+	"<\201\353h\232\356\322\337\371\377\377\377\377\377\377\306\326\370]\224\355"
+	":\200\352S\220\355\272\320\367\373\373\376\377\377\377\365\366\375\215\263"
+	"\363G\210\3542|\351\234\272\364\224\262\3623y\351\0Y\344,w\3506~\352\261"
+	"\306\365N\215\354C\207\353\331\343\372\377\377\377=\202\352\323\333\370d"
+	"\234\356:\177\352A\206\353\224\263\362\377\377\377\377\377\377\377\377\376"
+	"\207\253\361:\202\353C\206\354\227\266\362\226\264\363\301\322\367\377\377"
+	"\377\377\377\377\377\377\377\360\363\375f\226\355\37q\350\357\360\374\377"
+	"\377\377\312\333\371\25d\346\\\225\356\377\377\377\320\337\371c\227\355:"
+	"\201\353L\213\354\251\307\366\377\377\376\377\377\377\366\366\375\222\267"
+	"\363A\206\353<\201\353m\235\357\332\344\372\377\377\377\320\335\371\231\266"
+	"\363\262\306\366e\233\356;\202\353T\221\354\306\327\367\377\377\377\352\354"
+	"\373\15f\345t\236\357\370\371\376\377\377\377\244\276\364E\207\353:\200\353"
+	"]\227\356\340\347\372\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\343\350\373\0I\342o\226\355\377\377\377\377\377\377"
+	"\377\377\377\375\374\377\223\261\362\2[\344g\231\356~\253\362\16_\345d\233"
+	"\356\377\377\377\300\330\371\0R\3438|\351[\221\355v\246\361\25d\346X\221"
+	"\355\377\377\377\224\274\364\0Z\3457{\352m\236\356j\237\357\17a\346u\244"
+	"\360\377\376\376\335\344\373D\203\3533z\351\201\255\3628|\351;z\351\325\342"
+	"\371\377\377\377\207\260\362\5_\345Q\215\355\214\266\362\276\322\370\260"
+	"\306\365V\215\354\0Z\344N\212\353j\235\357\312\327\370N\207\354\0I\341\303"
+	"\323\370\377\377\377\0N\3432z\3519x\351\235\302\365(n\347\0W\344\372\371"
+	"\375\377\377\377\245\274\363\0W\344`\225\356\204\257\362)l\346\36m\350\252"
+	"\277\363\377\377\377\377\377\377\377\377\377\360\363\375f\226\355\37q\350"
+	"\355\356\374\377\377\377\325\340\372&m\347Q\223\356\363\364\375M\207\353"
+	"\"q\347\202\255\361>\204\3523x\351\314\332\370\377\377\377\227\273\363\27"
+	"g\346Z\223\355q\241\357\30g\345f\226\355\361\363\375\303\323\3678{\352\31"
+	"h\346l\240\357\203\255\362\10c\345=|\351\353\361\375\356\357\374\15f\346"
+	"t\235\356\377\377\377\305\322\367\15c\344T\216\355\216\267\362\17a\346T\211"
+	"\352\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\321\333\371\0K\342\234\264\362\377\377\377\377\377\377\377\377\377\363"
+	"\367\375\31h\3469z\351\377\375\376\375\373\376k\231\356\13d\345\335\343\371"
+	"\313\337\372\0I\341+x\351\362\362\374\364\365\375]\223\355(u\350\343\347"
+	"\373\240\303\366\0I\342N\216\354\375\372\375\350\354\373A\203\352C\203\353"
+	"\354\357\373\224\270\364\23c\346\233\273\363\377\377\377\246\276\364\21c"
+	"\345\240\301\365\355\355\373,y\350@\201\352\332\343\372\377\377\377\377\377"
+	"\377\377\377\377\257\302\364\0Z\344\251\302\364\367\367\375\377\377\377\246"
+	"\273\364\0Q\343\305\324\370\377\377\377\0X\344\0H\342\325\336\372\377\377"
+	"\377\252\276\364\0I\341\270\310\365\377\377\377\12`\345'o\347\376\373\376"
+	"\377\377\377r\234\356\0Z\345\261\303\364\377\377\377\377\377\377\377\377"
+	"\377\360\363\375f\226\355\37q\350\355\356\374\377\377\377\317\336\371\24"
+	"b\345]\231\356\272\322\367\14_\345\212\257\362\377\377\377\266\314\366\40"
+	"k\347\211\264\363\366\366\375D\206\3539}\352\337\346\372\377\377\377e\230"
+	"\356\20a\345\277\326\367\316\331\370\36n\3478|\351\336\347\373\377\377\377"
+	"m\234\357\0V\344\307\332\371\356\356\374\15f\346t\236\356\377\377\377J\207"
+	"\353\16`\345\340\350\373\377\377\377s\233\356\0O\342\354\360\374\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\324\334\371\0L\342\250"
+	"\274\363\377\377\377\377\377\377\377\377\377\334\351\373\0R\343\204\245\361"
+	"\377\377\377\377\377\376\260\312\366\0Y\343\246\274\364\316\341\372\0Q\342"
+	"v\241\360\377\377\377\371\371\376}\251\360\37n\350\324\335\371\237\303\365"
+	"\0S\343\214\262\361\377\377\377\364\364\375Y\224\355;}\351\337\345\372g\240"
+	"\3572v\351\333\344\372\377\377\377\337\344\372%r\347\211\263\362\305\321"
+	"\367\30l\347\207\255\362\373\372\376\377\377\377\377\377\377\377\377\377"
+	"\267\310\366\0Y\344\260\307\366\377\377\377\377\377\377\254\300\364\0Q\343"
+	"\305\324\367\377\377\377\0T\343&l\347\377\377\377\377\377\377\333\340\372"
+	"\0I\341\242\270\362\370\371\376\0H\341u\233\356\377\377\377\377\377\377\260"
+	"\306\365\0W\344\261\303\364\377\377\377\377\377\377\377\377\377\360\363\375"
+	"f\225\355#s\350\377\373\376\377\377\377\214\261\361\11_\345\215\257\361\216"
+	"\266\363\36n\350\317\332\371\377\377\377\343\351\373<~\352f\235\357\271\312"
+	"\366\33i\346y\252\361\377\377\377\377\377\377\230\267\363\1Y\344\254\315"
+	"\366\323\333\371\32l\347\200\251\360\370\370\376\377\377\377\263\305\365"
+	"\3^\345\251\305\366\351\352\374\16g\346u\237\357\377\377\376\15g\346`\216"
+	"\354\377\377\377\377\377\377\305\321\366\0L\341\320\334\371\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\323\333\371\0K\342\246\273\363"
+	"\377\377\377\377\377\377\377\377\377\277\321\370\0T\343\252\300\365\377\377"
+	"\377\377\377\377\313\336\371\0S\343\217\256\363\320\342\372\0V\343\221\256"
+	"\362\377\377\377\371\371\376}\252\361\40n\347\326\336\371\235\302\365\7\\"
+	"\344\246\277\364\377\377\377\364\365\376Z\224\356=\177\352\317\331\370Y\225"
+	"\356\32j\347s\234\357\213\255\361w\236\357\6_\345\210\261\362\241\270\364"
+	"\10`\345\237\300\365\377\377\377\377\377\377\377\377\377\377\377\377\265"
+	"\307\366\0Z\345\257\306\366\377\377\376\377\377\377\253\300\365\0Q\344\305"
+	"\324\367\377\377\377\0R\343L\177\352\377\377\377\377\377\377\335\342\372"
+	"\0H\342\246\273\362\336\345\374\0L\341\237\270\363\377\377\377\377\377\377"
+	"\324\341\372\0S\343\261\303\364\377\377\377\377\377\377\377\377\377\360\363"
+	"\375k\230\356\0\\\344=\204\3536\201\352\24e\346W\215\354\345\352\373\200"
+	"\253\362\12a\346j\227\356\215\256\361o\232\356\21d\346[\226\356\242\272\364"
+	"\20a\344\206\263\363\377\377\377\377\377\377\270\313\366\25g\346\215\265"
+	"\362\304\321\367\33l\347\207\257\362\372\372\376\377\377\377\275\315\366"
+	"\10b\346\242\277\365\350\351\374\17g\347x\241\357\350\352\374\11e\345;z\351"
+	"\205\252\361\212\255\361m\227\355\0G\340\313\330\371\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\321\332\372\0K\341\253\277\364\377"
+	"\377\377\377\377\377\377\377\376\264\311\366\0W\344\265\307\364\377\377\377"
+	"\377\377\377\323\343\372\0R\343\212\252\361\320\342\372\0U\343\216\255\361"
+	"\377\377\377\370\371\376}\252\361\40o\350\327\337\372\235\302\365\12^\344"
+	"\250\301\365\377\377\377\364\364\375Z\224\356>\200\352\312\325\367V\223\356"
+	"\31g\347g\223\356y\236\356t\234\356_\220\354\277\323\370\225\261\363\0[\345"
+	"\257\314\366\377\377\377\377\377\377\377\377\377\377\377\377\265\307\366"
+	"\0Z\344\257\306\366\377\377\376\377\377\377\254\277\364\0P\343\305\325\367"
+	"\377\377\377\0R\343I}\353\377\377\377\377\377\377\335\341\373\0G\341\247"
+	"\273\362\330\342\373\0L\341\252\300\364\377\377\377\377\377\377\344\353\373"
+	"\0S\343\261\303\364\377\377\377\377\377\377\377\377\377\360\363\375k\231"
+	"\356\0]\344U\212\354o\236\357\236\275\364\345\354\373\375\374\376|\251\361"
+	"\7^\345]\215\355z\237\357s\233\356a\222\355\246\301\364\250\300\365\21c\346"
+	"\205\263\362\377\377\377\377\377\377\305\323\370\36n\347\205\257\361\300"
+	"\316\366\32l\347\206\256\362\371\371\376\377\377\377\275\315\366\10b\345"
+	"\243\277\365\350\351\374\17h\347x\241\357\340\343\373\11e\3467w\350v\234"
+	"\357w\235\357u\234\357U\214\354\337\346\373\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\346\354\374\0H\341y\234\360\377\377\377\377"
+	"\377\377\377\377\377\311\332\372\0S\343\223\257\361\377\377\377\377\377\377"
+	"\303\330\371\0W\345\237\270\363\316\341\372\0U\343\216\255\361\377\377\377"
+	"\371\371\376}\252\361\40o\347\326\336\371\235\302\364\11]\344\250\300\365"
+	"\377\377\377\364\364\376Z\224\356=\177\352\316\330\370W\224\3569{\352\306"
+	"\324\370\354\361\374\347\355\374\350\355\373\376\376\377\266\310\365\14d"
+	"\347\232\274\364\376\375\376\377\377\377\377\377\377\377\377\377\264\306"
+	"\365\0Y\344\257\306\365\377\377\376\377\377\377\254\300\365\0P\343\305\323"
+	"\367\377\377\377\0S\343I~\353\377\377\377\377\377\377\334\342\373\0H\340"
+	"\246\273\363\341\351\374\0K\342\241\270\362\377\377\377\377\377\376\304\324"
+	"\370\0U\343\261\303\364\377\377\377\377\377\377\377\377\377\360\363\375g"
+	"\227\355\33n\350\331\337\372\365\367\375\377\376\376\377\377\377\370\367"
+	"\376x\245\360\40n\350\272\314\367\356\362\375\350\356\374\350\356\374\374"
+	"\373\376\256\305\366\15_\345\201\260\362\377\377\377\377\377\377\253\302"
+	"\365\11`\345\237\303\365\316\330\370\31l\347\206\255\361\371\371\376\377"
+	"\377\377\270\311\366\6`\344\237\275\364\347\351\373\17h\346w\240\356\347"
+	"\351\373\5c\345k\226\355\345\354\373\351\357\374\350\356\374\347\355\374"
+	"\372\373\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\1W\343\15e\346\377\377\377\377\377\377\377\377\377\353\363\375"
+	"\0R\342\\\214\355\377\377\377\377\376\376\233\271\364\5`\345\303\320\367"
+	"\312\336\372\0V\343\216\256\362\377\377\377\370\371\376}\252\361\40n\347"
+	"\327\336\371\235\302\365\11^\345\250\300\365\377\377\377\364\364\376Z\224"
+	"\357;~\351\344\351\373e\236\360\27e\346\314\332\370\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\320\332\370\30l\350\206\254\361\374\373\375\377"
+	"\377\377\377\377\377\377\377\377\265\306\366\0Y\344\262\310\365\377\377\377"
+	"\377\377\377\254\300\365\0Q\344\305\324\370\377\377\377\0T\344I}\352\377"
+	"\377\377\377\377\377\333\340\372\0G\340\245\272\363\377\377\377\0P\342d\220"
+	"\354\377\377\377\377\377\377\253\302\366\0X\344\260\303\364\377\377\377\377"
+	"\377\377\377\377\377\360\363\375f\225\355\40q\350\357\360\374\377\377\377"
+	"\377\377\377\377\377\377\376\375\376\204\257\361\22e\346\300\317\367\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\311\327\370(r\350g\235\357\372"
+	"\371\375\377\377\377\217\262\362\16]\344\266\320\367\320\332\370\31k\347"
+	"\211\260\362\376\374\376\377\377\377{\242\360\0V\343\310\333\371\357\357"
+	"\374\15f\346s\235\356\377\377\377\3d\345>y\350\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377n\227\356\0M\343\220\256\362\377\374\375"
+	"\367\367\376\345\354\373@|\352\15d\346\344\347\373\360\361\3748w\350\21j"
+	"\347\375\372\376\305\332\371\0V\343\216\255\362\377\377\377\367\371\376}"
+	"\251\361\40o\347\326\336\371\235\302\365\11^\345\250\300\365\377\377\377"
+	"\364\364\375Z\225\355:}\351\343\352\373\253\304\365\22d\345_\224\355\361"
+	"\361\374\377\377\376\331\340\371\362\364\375\377\376\376;\202\352\21f\346"
+	"\277\321\367\377\376\376\357\362\375\377\377\377\261\304\366\0[\344\236\271"
+	"\362\376\373\376\377\376\376\254\301\364\0P\343\305\325\370\377\377\377\0"
+	"R\343G}\352\377\377\377\377\377\377\335\341\372\0H\341\243\271\363\377\377"
+	"\377F\177\351\0\\\344\317\327\370\333\343\371/t\350\1^\345\261\304\364\377"
+	"\377\377\377\377\377\377\377\377\360\363\375f\226\355\37p\350\354\356\374"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\267\315\367\23b\345R\216"
+	"\354\361\361\374\377\376\377\323\334\371\343\350\372\374\373\376S\223\355"
+	"\27g\346\305\324\367\353\354\373>\201\352;{\351\336\346\372\314\327\370\33"
+	"m\350z\245\360\352\354\373\300\315\366\24h\346G\203\352\356\363\375\356\360"
+	"\374\15f\345s\236\356\377\377\377m\232\356\0X\344\233\266\363\377\377\377"
+	"\372\370\375\314\326\370\377\377\376\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\362\365\375E\177\351\0P\343\22j\347"
+	"\23j\347u\235\360\330\342\373\20^\344\5a\345\15f\346\7_\346\254\304\365\377"
+	"\377\377\273\323\370\0G\341\203\245\360\377\377\377\367\367\375q\241\360"
+	"\14b\345\321\332\371\222\274\363\0O\342\237\272\364\377\377\377\361\363\374"
+	"K\212\354)r\350\325\340\371\376\375\376s\237\356\4[\345\14e\346\24k\346\0"
+	"V\343\257\314\366\377\377\377\270\314\367\33k\346\5`\346\15g\346C\177\352"
+	"\351\360\374\351\354\373\1^\344\0]\344\7d\347\222\261\361\237\267\363\0B"
+	"\341\276\320\367\377\377\377\0E\3408r\351\377\377\377\377\377\377\327\334"
+	"\372\0""9\336\231\261\362\377\377\377\334\344\372\20^\344\0[\344\21g\345"
+	"Z\212\353\0]\344\260\304\364\377\377\377\377\377\377\377\377\377\355\361"
+	"\374X\215\354\13e\346\351\353\374\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\362\365\375y\243\357\0X\344\15g\346\24k\350\0Z\345z\252\361\377"
+	"\377\377\312\331\370/w\347\0^\345\10c\345\25c\345\242\276\364\377\377\377"
+	"\307\324\367's\350\1`\346\21h\346\0X\344<{\352\322\336\371\377\377\377\346"
+	"\352\373\0Z\344g\224\355\372\372\376\365\365\3744u\350\0Y\345\26m\350\22"
+	"i\346\0N\342\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\354\360\374\270\320\367\240\275\364"
+	"\244\300\364\324\337\371\377\377\377\333\346\372\252\305\366\244\301\365"
+	"\312\333\371\377\375\376\377\377\377\366\371\376\325\344\372\356\362\374"
+	"\377\377\377\376\376\376\353\362\374\333\350\373\372\373\376\360\366\375"
+	"\330\345\372\362\365\375\377\377\377\376\376\376\345\356\374\340\352\373"
+	"\372\373\376\377\377\377\364\366\375\304\327\371\246\302\365\236\274\364"
+	"\276\324\370\363\370\375\377\377\377\375\375\376\334\347\373\253\306\365"
+	"\234\272\364\311\330\371\372\374\376\377\377\377\312\334\371\247\302\365"
+	"\234\273\364\334\345\372\362\366\375\323\343\372\367\371\376\377\377\377"
+	"\323\343\372\342\353\374\377\377\377\377\377\377\372\373\376\317\341\372"
+	"\361\364\375\377\377\377\377\377\377\351\360\374\300\326\370\324\344\373"
+	"\325\342\372\0U\343\254\300\363\377\377\377\377\377\377\377\377\377\375\375"
+	"\376\347\356\374\333\350\373\375\375\376\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\364\367\375\307\330\370\240\275\364\241\276"
+	"\364\266\316\367\352\362\375\377\377\377\377\376\376\332\345\373\253\306"
+	"\366\245\303\365\321\337\371\371\372\376\377\377\377\305\323\367\37o\347"
+	"S\215\354\234\273\363\275\324\371\347\355\374\377\377\377\377\377\377\374"
+	"\374\376\330\347\373\351\357\374\377\376\377\377\377\377\352\360\374\264"
+	"\315\370\242\276\364\237\274\365\314\337\372\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\375\375\376\376\375\376\377\377\376\377\377\377\377"
+	"\377\377\377\376\377\376\375\376\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\376\376\376\375\375\376\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\376\376\375\374\376\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\376\375\376\375\375\376\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\376\266\310\365\262"
+	"\306\365\325\333\370\335\342\371I\202\352\0X\344\333\341\371\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\375\375\376\375\375\376\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\376\377\376\376\376\377\377\377\377\377\377"
+	"\377\377\377\305\323\367\32k\347\206\256\361\370\367\375\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\376\375\376\375\374\376\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\376\240\270\362\26b\346\0U\343\0W\344\10_\344\255\303\365"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\276\316\366\4]\345{\247\360\371\371"
+	"\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\371\372\376\353\361\374\346\360"
+	"\374\347\360\374\354\363\375\377\376\376\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\373\374\376\353\362\375\365\370\375\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+	};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bsptemplate/asspandvariant/template_variant/camerasc/logoyuv2.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,1238 @@
+// 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:
+// template\template_variant\camerasc\logo.cpp
+// This file contains the binary data for the logo that gets rendered in the
+// "photos" taken by this template camera driver.
+// 
+//
+
+#include "camerasc_plat.h"
+
+#ifdef __ARMCC__
+#pragma diag_suppress=177 // Disable the warning on  LogoYUV not being in use
+#endif
+/** The logo rendered in "photos" returned by the template camera driver. */
+const struct SLogo Logo =
+	{
+    80, 61,
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377"
+    "\377\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\376\377\377"
+    "\377\377\377\376\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377"
+    "\376\377\377\377\377\377\372\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\376\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377"
+    "\374\377\377[\377\377\216QQ\222PPY\16\16\230\377\377\262\377\377\347\377\377\377\377\377\376\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\376\377\377\377\377\377N\377\377\177jj\377\203"
+    "\203\354\203\203\302rr\310ll\27__\36\377\377\256\377\377\376\377\377\376\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\377\377\377"
+    "\376\377\377\377\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\376\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\330\377\377Uee\375\200\200\375\200\200\376\200"
+    "\200\377\200\200\377\200\200\326\201\201&PP\344\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\376\0"
+    "\0\377\377\377\376\377\377\376\377\377\376\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\376\377\377\376\0"
+    "\0\377\377\377\377\377\377\374\377\377\377\377\377|\377\377\242bb\376\200\200\376\200\200\377"
+    "\200\200\373\200\200\322\201\201EPP\212\377\377\376\377\377\376\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\377\377\377\376\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\376\0"
+    "\0\332\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\377\0"
+    "\0\234\377\377c22\212>>\201>>,::{qq\375\200\200\377\200\200\221\200\200d\200"
+    "\200\0\204\204'\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\376\377\377\377\0"
+    "\0\376\377\377\377\377\377\377\377\377\377\377\377\376\377\377\376\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\377\377\377\376\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\334\377\377e\377\377\23CClCCb\6\6\342"
+    "\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\376\377\377\377\377\377\375\377\377\377\377\377\225\377\377J//z\177\177\307\203\203\255"
+    "\203\203z\203\203A\200\200\371\177\177\377\200\200\250\200\200\22\200\200"
+    "\0\204\204\22\377\377\317\377\377\377\377\377\377\377\377\376\377\377\376\377\377\377\377\377\376\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377"
+    "\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\376\377\377\377\377\377\315\377\377*\377\377\202dd\202\205\205~\205\205"
+    "\177ppV\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\376\377\377\377\377\377\317\377\377\"\36\36\351\205\205\376\200\200"
+    "\376\200\200\376\200\200\375\200\200\377\200\200\375\200\200\376\200\200"
+    "\376\200\200\377\200\200\202\200\200\30nnA\377\377\312\377\377\347\377\377\376\377\377\377"
+    "\377\377\377\377\377\377\377\377\354\377\377\334\377\377\335\377\377\335\377\377\336\377\377\265\377\377\12\0"
+    "\0\24\377\377\25\377\377\25\377\377\15\377\377k\377\377\333\377\377\335\377\377\336\377\377\377\377\377\377\0"
+    "\0\377\377\377\376\377\377\377\377\377\377\377\377\376\377\377\376\377\377\377\377\377\376\377\377\377\0"
+    "\0\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\204\377\377\277hh\375\200\200\375"
+    "\177\177\377\177\177\352\211\211=\1\1\377\377\377\377\377\377\377\377\377\376\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\274\5\5[\217"
+    "\217\376\177\177\376\200\200\377\200\200\376\200\200\376\200\200\377\200"
+    "\200\377\200\200\377\200\200\376\200\200\377\200\200\377\200\200\377\200"
+    "\200\246\210\210\15\221\2217\12\12\377\377\377\370\377\377\251\377\377s\16\16%\24\24"
+    "\10\220\220\15\207\207\14\207\207\14\207\207g\207\207\215\207\207\212\207"
+    "\207\212\207\207\213\207\207\203\207\207*\207\207\14\207\207\15\210\210\3"
+    "]]H\13\13m\22\22\210\377\377\351\377\377\343\377\377\341\377\377\376\377\377\377\377\377\377\377\377"
+    "\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\377\377\377"
+    "\376\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\377\377\377\204\377\377\317kk\377"
+    "\200\200\377\200\200\344\200\200\36\211\211G\1\1\377\377\377\377\377\377\376\377\377"
+    "\376\377\377\377\377\377\377\377\377\376\377\377\377\377\377\377\377\377\376\377\377\377\377\377\377\377\377"
+    "\26\5\5\241\211\211\377\200\200\376\200\200\376\200\200\377\200\200\377\200"
+    "\200\251\200\200\226\200\200\261\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\376\200\200\371\205\205K88s11g110++Z}}a\210\210\350\177"
+    "\177\354\200\200\353\200\200\353\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\353\200\200\355\177"
+    "\177\276\203\203X\211\211Z\215\215\\..211\32""11\21""55\222\377\377\223\377\377\216"
+    "\377\377\262\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\376\377\377\376"
+    "\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\213\377\377\205"
+    "kk\377\200\200\344\200\200c\200\200\15\211\211%\377\377\251\377\377\370\377\377\377\0"
+    "\0\377\377\377\376\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\377\377\5\5\250\211\211\377\200\200\376\200\200\377\177\177\375\200\200\211"
+    "\205\205\0\211\211\0\211\211\0\211\211Z\211\211\256\212\212\377\200\200\376"
+    "\200\200\377\200\200\327\177\1774\204\2048\205\205\271\205\205\337\205\205"
+    "\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200"
+    "\377\200\200\376\200\200\377\200\200\377\200\200\376\200\200\376\200\200"
+    "\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\177\177"
+    "\377\205\205\317\205\205\272\205\205\275\210\210\246UUCUUMUUAUU/UU9DD\215"
+    "\377\377\243\377\377\346\377\377\377\377\377\377\377\377\376\377\377\376\377\377\377\377\377\376\377\377\376"
+    "\377\377\377\377\377\377\377\377\377\377\377\245\377\377\4kk\306\200\200\324\200\200=\200\200"
+    "\244\202\202SVVEWW5**\311\377\377\377\377\377\376\377\377\376\377\377\377\377\377\376\377\377\377"
+    "\377\377\376\377\377\377\377\377\377\377\377\244\5\5:\216\216\372\177\177\377\200\200\374"
+    "\200\200\233\205\205\0>>\235\10\10\303\13\13\305\13\13\205\13\13\4\2\2\224"
+    "\200\200\377\206\206\330\201\201%\177\1776\200\200\377\200\200\377\200\200"
+    "\377\200\200\376\200\200\377\200\200\376\200\200\376\200\200\377\200\200"
+    "\376\200\200\377\200\200\377\200\200\376\200\200\377\200\200\377\200\200"
+    "\377\200\200\376\200\200\377\200\200\376\200\200\376\200\200\377\200\200"
+    "\377\200\200\376\200\200\377\200\200\377\200\200\377\177\177\377\200\200"
+    "\377\200\200\377\200\200\343\200\200\301\200\200\261~~1ss\6}}#\377\377?\377\377\266"
+    "\377\377\377\377\377\377\377\377\377\377\377\376\377\377\376\377\377\373\377\377\373\377\377\271\377\377\21\0"
+    "\0\12jj\347\200\200\376\200\200\377\200\200\375\177\177\377\200\200\377\201"
+    "\201\247\202\2026\31\31G\377\377\377\377\377\376\377\377\376\377\377\377\377\377\377\377\377\377"
+    "\377\377\376\377\377\377\377\377\336\377\377""6\33\33\235\204\204\262yy\24vv\36\377\377\247\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\210\377\377?\377\377\336\1\1A\\\\,\202\202\377"
+    "\200\200\376\200\200\376\200\200\377\200\200\377\200\200\376\200\200\377"
+    "\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377"
+    "\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377"
+    "\200\200\377\200\200\377\200\200\376\200\200\377\200\200\376\200\200\377"
+    "\200\200\377\200\200\377\200\200\377\200\200\376\200\200\377\200\200\377"
+    "\200\200\377\200\200\377\200\200\352\177\177V\204\204D}}\0**n\5\5\242\4\4"
+    "\351\377\377\374\377\377\377\377\377\24\377\377\0cc\30jj\233\207\207\376\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\376\200\200\376\200\200\377\177"
+    "\177\252\214\214F\15\15Y\3\3\377\377\377\376\377\377\376\377\377\377\377\377\376\377\377\377"
+    "\377\377\376\377\377\377\377\377\305\377\377""644*\11\11\264\377\377\350\377\377\377\377\377\376\377\377"
+    "\376\377\377\376\377\377\376\377\377\377\377\377\377\377\377\324\6\6\15\\\\\336\202\202\377\200"
+    "\200\376\200\200\377\200\200\376\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\376\200\200\377\200\200\377\200\200\377\200\200\376\200\200\311\206"
+    "\206e\215\2155^^2\36\36t\377\377\304\377\377O99\233\204\204\341\202\202\377\177\177"
+    "\377\200\200\377\200\200\377\200\200\377\200\200\376\200\200\376\200\200"
+    "\377\200\200\376\200\200\377\177\177\377\212\212\0KK\307\377\377\377\377\377\376"
+    "\377\377\377\377\377\377\377\377\376\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377a\12"
+    "\12xvv\372\201\201\376\200\200\377\200\200\376\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\376\200"
+    "\200\377\200\200\377\200\200\377\200\200\376\200\200\377\200\200\376\200"
+    "\200\377\200\200\377\200\200\377\177\177\377\202\202\244\201\201SDD\0GGt"
+    "``\377\200\200\377\200\200\377\177\177\317\202\202^\202\202_\202\202V\202"
+    "\202\322\200\200\377\177\177\376\200\200\376\200\200\377\200\200\377\177"
+    "\177DssP\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\376"
+    "\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\376\377\377\377\377\377\377\377\377\376"
+    "\377\377\377\377\377\266\377\377\22\6\6\377\212\212\377\177\177\377\200\200\376\200\200"
+    "\377\200\200\377\200\200\377\200\200\376\200\200\377\200\200\377\200\200"
+    "\376\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200"
+    "\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200"
+    "\377\200\200\377\200\200\376\200\200\377\200\200\377\200\200\376\200\200"
+    "\376\200\200\377\200\200\377\200\200\376\200\200\377\200\200\377\200\200"
+    "\377\200\200\377\200\200\376\200\200\377\200\200\376\200\200\376\200\200"
+    "\376\200\200\377\200\200\355\202\202E\202\202\0\201\201V\177\177\377\202"
+    "\202q\213\213\15kk\0ff\0ff\0dd?\201\201\377\200\200\377\200\200\377\200\200"
+    "\377\200\200\374\200\2004pp\256\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\376\377\377\376\377\377\377\377\377Z\377\377\332\210\210\377\177\177\376\200\200"
+    "\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200"
+    "\376\200\200\376\200\200\377\200\200\376\200\200\377\200\200\376\200\200"
+    "\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200"
+    "\376\200\200\377\200\200\377\200\200\377\200\200\376\200\200\376\200\200"
+    "\376\200\200\377\200\200\377\200\200\376\200\200\375\200\200\375\200\200"
+    "\374\200\200\323\200\200\325\200\200\333\200\200\375\200\200\377\200\200"
+    "\377\200\200\377\200\200\377\200\200\376\200\200\377\200\200\377\200\200"
+    "3\200\200\0\200\200\17[[\20\377\377\311\377\377\377\377\377\377\377\377\301\377\377\26\377\377@}"
+    "}\342\177\177\326\200\200\346\200\200\31\200\200\27oo\354\377\377\377\377\377\376"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\376\377\377\376\377\377\377\377\377\306\377\377@\24\24\374\205"
+    "\205\377\200\200\375\200\200\331\200\200\327\200\200\327\200\200\327\200"
+    "\200\327\200\200\330\200\200\377\200\200\377\200\200\377\200\200\376\200"
+    "\200\376\200\200\377\200\200\376\200\200\376\200\200\377\200\200\376\200"
+    "\200\377\200\200\377\200\200\377\200\200\376\200\200\376\200\200\377\200"
+    "\200\377\200\200\377\200\200\376\200\200\333\200\200\327\200\200\305\200"
+    "\200o\200\200f\200\200f\200\200\0\200\200\0\200\200\0\200\200\277\200\200"
+    "\377\200\200\377\200\200\377\200\200\377\200\200\376\200\200\375\200\200"
+    "\377\200\200\336\200\200\7\200\200\23\\\\\313\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\277\377\377r\377\377\0&&\0kk\0ff\0iim\377\377\372\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377I\377\377\202\201\201\377\177\177\377"
+    "\200\200\375\200\200%\200\200\16\200\200\17\200\200\17\200\200\17\200\200"
+    "\17\200\200\203\200\200\177\200\200\326\200\200\371\200\200\377\200\200\377"
+    "\200\200\376\200\200\377\200\200\376\200\200\377\200\200\376\200\200\376"
+    "\200\200\376\200\200\377\200\200\377\200\200\377\200\200\377\200\200\245"
+    "\200\200v\200\200\31\200\200\17\200\200\14\200\200\0\200\200\0\200\200\0"
+    "\200\200\0\200\200\0\200\200\0\200\200\224\200\200\377\200\200\377\200\200"
+    "\377\200\200\377\200\200\377\200\200\376\200\200\376\200\200\377\200\200"
+    "I\200\200\15\\\\\276\377\377\377\377\377\376\377\377\376\377\377\376\377\377\377\377\377\377\377\377"
+    "\223\377\377s\377\377u\377\377\201\377\377\377\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\345\377\377$\377\377tyy\377\200\200\377\200\200\377\200"
+    "\200\221\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200"
+    "\200\0\200\200\40\200\200X\200\200\244\200\200\334\200\200\377\200\200\377"
+    "\200\200\375\200\200\376\200\200\376\200\200\377\200\200\377\200\200\350"
+    "\200\200\242\200\200O\200\200.\200\200\12\200\200\0\200\200\0\200\200\0\200"
+    "\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200"
+    "\230\200\200\377\200\200\377\200\200\377\200\200\377\200\200\376\200\200"
+    "\377\200\200\376\200\200\377\200\200\216\200\200\20\\\\\275\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\376\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376"
+    "\377\377\376\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\252"
+    "\377\377\32XX\341\200\200\377\200\200\376\200\200\377\200\200\261\200\200\0\200"
+    "\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200"
+    "\1\200\200\4\200\200\33\200\200\"\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\"\200\200!\200\200\3\200\200\0\200\200\0\200"
+    "\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200"
+    "\0\200\200\0\200\200\0\200\200\0\200\200\226\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\376\200\200\377\200\200\377\200"
+    "\200\377\200\200\26\\\\\273\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\376"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\376\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\372\377\377\202\377\377\31``\355\200\200\377\200\200"
+    "\377\200\200\376\200\200\377\200\200J\200\200\0\200\200\0\200\200\0\200\200"
+    "\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0"
+    "\200\200\20\200\200\265\200\200\374\200\200\377\200\200\32\200\200\0\200"
+    "\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200"
+    "\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\17"
+    "\200\200\275\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377"
+    "\200\200\377\200\200\376\200\200\377\200\200\265\177\177\21SS\273\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\354"
+    "\377\377>>>\0\211\211\226\177\177\377\200\200\376\200\200\376\200\200\377\200"
+    "\200\312\200\200\0\200\200\0\200\200\15\200\200_\200\200Z\200\200=\200\200"
+    "\10\200\200\0\200\200\0\200\200\0\200\200\0\200\200\10\200\200\235\200\200"
+    "\377\200\200\377\200\200(\200\200\0\200\200\0\200\200\0\200\200\0\200\200"
+    "\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\3\200\200\0\200\200\0"
+    "\200\200\0\200\200\0\200\200\27\200\200\273\200\200\377\200\200\376\200\200"
+    "\376\200\200\377\200\200\376\200\200\377\200\200\377\200\200\376\200\200"
+    "\377\200\200Jzz!\3\3\327\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377R\16\16\0qqf\200\200\333\200\200\377"
+    "\200\200\376\200\200\376\200\200\372\200\200y\200\200\12\200\200\0\200\200"
+    "\241\200\200\324\200\200\273\200\200\213\200\200\0\200\200\0\200\200\0\200"
+    "\200\16\200\200\267\200\200\377\200\200\377\200\200\377\200\200\35\200\200"
+    "\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\16\200\200\215\200\200"
+    "\276\200\200\267\200\200p\200\200\15\200\200\0\200\200\0\200\200>\200\200"
+    "\263\200\200\377\200\200\376\200\200\377\200\200\377\200\200\376\200\200"
+    "\377\200\200\376\200\200\377\200\200\377\200\200\275\177\177\31\202\202w"
+    "\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\340\377\377&\377\377\5\200\200\34\206\206\303\177\177\377\200"
+    "\200\377\200\200\377\200\200\374\200\200\313\200\200\213\200\200\0\200\200"
+    "\12\200\200\20\200\200\15\200\200\0\200\200\25\200\200\242\200\200\315\200"
+    "\200\377\200\200\375\200\200\377\200\200\346\200\200\16\200\200\0\200\200"
+    "\0\200\200\0\200\200\0\200\200\0\200\200\23\200\200Z\200\200_\200\200W\200"
+    "\200\11\200\200\0\200\200-\200\200\237\200\200\377\200\200\374\200\200\376"
+    "\200\200\376\200\200\377\200\200\377\200\200\377\200\200\376\200\200\377"
+    "\200\200\351\200\200z\200\200\23\206\206\4\10\10\377\377\377\377\377\377\376\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\375\377\377"
+    "\377\377\377\353\377\377""7\377\377\7\11\11\0\202\202|~~\332\200\200\371\200\200\371"
+    "\177\177\377\200\200\377\200\200\377\200\200\277\200\200\26\200\200\305\200"
+    "\200\377\200\200\371\200\200\377\200\200\377\200\200\376\200\200\377\200"
+    "\200\376\200\200\377\200\200\370\200\200\371\200\200\265\200\200*\200\200"
+    "1\200\2002\200\2001\200\200.\200\200.\200\200.\200\200+\200\200\223\200\200"
+    "\376\200\200\377\200\200\376\200\200\376\200\200\377\200\200\377\200\200"
+    "\377\200\200\376\200\200\376\200\200\374\200\200\377\200\200f\200\200\0\200"
+    "\200\0\207\207\224\377\377\377\377\377\376\377\377\376\377\377\376\377\377\377\377\377\376\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\376\377\377\376\377\377\375\377\377\377\377\377\377\377\377\251"
+    "\377\377\210\377\377""2::\14^^]__h\202\202\263\200\200\321\200\200\377\200\200\377"
+    "\200\200\377\200\200\377\200\200\377\200\200\377\200\200\376\200\200\376"
+    "\200\200\377\200\200\377\200\200\376\200\200\376\200\200\377\200\200\377"
+    "\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377"
+    "\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\376"
+    "\200\200\377\200\200\377\200\200\377\200\200\376\200\200\377\200\200\377"
+    "\200\200\377\200\200\241\200\200N\200\200\5\200\2007\200\2007\205\205\6\35"
+    "\35\203\377\377\374\377\377\377\377\377\376\377\377\376\377\377\377\377\377\377\377\377\377\377\377\376\0"
+    "\0\376\377\377\377\377\377\377\377\377\376\377\377\377\377\377\377\377\377\376\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\376\377\377\376\377\377\376\377\377\377\377\377\377\377\377\377\0"
+    "\0\225\377\377)\2\2\0\212\212\0\200\200\17\200\200v\200\200\225\200\200\375\200"
+    "\200\377\200\200\376\200\200\376\200\200\377\200\200\377\200\200\376\200"
+    "\200\376\200\200\377\200\200\377\200\200\377\200\200\376\200\200\376\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\376\200\200\376\200\200\377\200"
+    "\200\376\200\200\377\200\200\377\200\200\377\200\200\314\177\177w\205\205"
+    "\0\210\210\12\207\207\316\177\177\377\200\200\377\177\177\247\204\204\6+"
+    "+I\377\377\331\377\377\377\377\377\377\377\377\376\377\377\376\377\377\376\377\377\377\377\377\376\377\377\377"
+    "\377\377\377\377\377\376\377\377\376\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\376\377\377\377\377\377\377\377\377\377\377\377\376\377\377\376\377\377\377\377\377\377\377\377\222"
+    "\10\10\3\211\211V\200\200Z\200\200\0\200\200\4\200\200H\200\200\216\200\200"
+    "\377\200\200\376\200\200\376\200\200\377\200\200\377\200\200\377\200\200"
+    "\377\200\200\377\200\200\376\200\200\377\200\200\377\200\200\376\200\200"
+    "\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200"
+    "\376\200\200\377\200\200\376\200\200\375\200\200\377\200\200\377\200\200"
+    "\260\200\200\224\177\177~\211\211\13\216\216\0::h\26\26\36!!\263\216\216"
+    "\377\177\177\377\200\200\377\200\200\266{{*oo\35\11\11\227\377\377\377\377\377\377"
+    "\377\377\376\377\377\376\377\377\377\377\377\377\377\377\302\377\377\377\377\377\377\377\377\377\377\377\375"
+    "\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376"
+    "\377\377\377\377\377\374\377\377\377\377\377/\377\377\23\10\10*\211\211\316\200\200\373\200\200"
+    "\324\200\200\13\200\200\0\200\200\0\200\200m\200\200\377\200\200\377\200"
+    "\200\376\200\200\376\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\376\200\200\375\200"
+    "\200\377\200\200\245\200\200\32\200\200\11\200\200\0\203\203\377\377\0F\377\377\316"
+    "\377\377\377\377\377,\377\377\0++\212\206\206\374\200\200\376\200\200\377\200\200\375"
+    "\200\2008\200\200\5}}O\377\377\377\377\377\376\377\377\376\377\377V\377\377!\377\377\14\377\377\40\0"
+    "\0""4\377\377\351\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\376\377\377\376\377\377\377\377\377\376\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\343\377\377\320\377\377l\6\6>\20\20\225~~\377\210\210\377\177\177"
+    "\377\177\177\350\202\202\336\201\201\17ff\20hh\0gg\0\200\200u\200\200\321"
+    "\200\200\377\200\200\376\200\200\377\200\200\376\200\200\377\200\200\346"
+    "\200\200\377\200\200\377\200\200\370\200\200\377\200\200\376\200\200\377"
+    "\200\200\377\200\200\377\200\200\377\200\200\376\200\200\377\200\200\373"
+    "\200\200\236\200\200\0\200\200\0\206\206!\30\30k\377\377\216\377\377\377\377\377\377"
+    "\377\377\376\377\377\371\377\377""6\34\34\0dd\216\200\200\373\177\177\377\200\200\376"
+    "\200\200\377\200\200\301\200\200\12ii\22\20\20\207\27\27f\27\27\0**\21\220"
+    "\220a\210\210l\210\2107{{1\6\6\347\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376"
+    "\377\377\377\377\377\271\377\377\223\377\377\377\377\377\377\377\377\376\377\377\376\377\377\377\377\377\377"
+    "\377\377\371\377\377\262\377\377\207\377\377\"66x88\222VV\372\214\214\377\200\200\377\177"
+    "\177\377\200\200\260\212\2122OO#CC\205\377\377\300\377\377\"\377\377\0\200\200\0\200"
+    "\200[\200\200\377\200\200\377\200\200\376\200\200\377\200\200\334\200\200"
+    "4\200\200\207\200\200\272\200\200g\200\200\337\200\200\377\200\200\376\200"
+    "\200\377\200\200\377\200\200\377\200\200\376\200\200\377\200\200\275\200"
+    "\200\0\200\200\0\200\200\0||\260\32\32\377\377\377\377\377\377\376\377\377\376\377\377\376"
+    "\377\377\377\377\377\344\377\377:\377\377\0::y\202\202\377\177\177\377\200\200\376\200\200"
+    "\377\200\200\302\202\202A\211\211\0\210\210\0\210\210\12\207\207\246\177"
+    "\177\377\200\200\377\200\200\335\202\202\22TT\271\377\377\377\377\377\377\377\377\377"
+    "\377\377\376\377\377\377\377\377\253\377\377$\21\21""4jj.\7\7\270\377\377\377\377\377\377\377\377\375"
+    "\377\377\271\377\377*\6\6""0dd>ZZ\265\202\202\373\204\204\377\202\202\342\204\204"
+    "\312\206\206Z\211\211#||\33""88C\377\377\301\377\377\376\377\377\377\377\377""9\377\377\0\211"
+    "\211*\177\177\245\200\200\340\200\200\376\200\200\377\200\200\377\200\200"
+    "{\200\200\0\200\200i\200\200\262\200\200\0\200\200\257\200\200\377\200\200"
+    "\377\200\200\377\200\200\377\200\200\376\200\200\377\200\200\373\200\200"
+    "H\200\200\0\200\200\0\200\200\0||B\32\32\345\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\376\377\377\377\377\377\345\377\377""6\377\377\0\215\215r\206\206\375\177\177\377"
+    "\200\200\376\200\200\377\200\200\377\200\200h\200\2004\200\200\250\200\200"
+    "\377\200\200\377\200\200\377\200\200\326\202\202\17UU\270\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\225\377\377\27\377\377\347\204\204\373\201\201g\203\203\3\0"
+    "\0V\377\377S\377\377""1\377\377xww\260zz\337\200\200\370\200\200\377\200\200\350\177"
+    "\177J\205\205#HH\3**\7\4\4\256\5\5\315\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\277\377\377\0\6\6\20\215\215\270\202\202\377\177\177\376\200\200\377\200\200"
+    "\351\200\200,\200\200\0\200\200\334\200\200\252\200\200\0\200\200\256\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\370\200\200\"\200\200\0\200\200/\177\1774\211\211\0!!\226\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\376\377\377\375\377\377\377\377\377\377\377\377""0\6\6\0))\204"
+    "\210\210\374\177\177\375\200\200\376\200\200\377\200\200\370\200\200\377"
+    "\200\200\347\200\200O\200\200S\177\177U\204\204#uu=\377\377\377\377\377\377\377\377\376"
+    "\377\377\377\377\377\376\377\377:\377\377\370\212\212\377\177\177\376\200\200\377\177\177"
+    "\377\206\206)\206\2063\206\206d\207\207\377\200\200\377\200\200\375\200\200"
+    "\370\200\200a\200\200\0ss\20EE2\377\377\377\377\377\374\377\377\377\377\377\377\377\377\376\0"
+    "\0\377\377\377\376\377\377\376\377\377\377\377\377\267\377\377)\377\377\0""99\213\203\203\375\200"
+    "\200\377\200\200\376\200\200\373\200\200\374\200\200\377\200\200\265\200"
+    "\200e\200\200\377\200\200\376\200\200\377\200\200\377\200\200\377\200\200"
+    "\377\200\200\376\200\200\376\200\200\377\200\200^\177\177\334\201\201'99"
+    "I\377\377\373\377\377\376\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377"
+    "\377\377\377\377\377\266\377\377\0==\233\201\201\373\177\177\377\200\200\376\200\200"
+    "\377\200\200\270\200\200\0\200\200\0\200\200\0\207\207\11\377\377M\377\377\377\0"
+    "\0\377\377\377\376\377\377\376\377\377\377\377\377\240\377\377h99\377\201\201\376\200\200\376"
+    "\200\200\376\200\200\377\200\200\377\200\200\377\200\200\377\200\200\376"
+    "\200\200\372\200\200\244\200\200H\200\200\0\204\204K\377\377\312\377\377\377\377\377"
+    "\377\377\377\377\377\377\376\377\377\376\377\377\377\377\377\376\377\377\377\377\377\376\377\377\376\377\377"
+    "\377\377\377\373\377\377A==H\203\203\370\200\200\377\200\200\376\200\200\377\200"
+    "\200\377\200\200\375\200\200\377\200\200\377\200\200\377\200\200\376\200"
+    "\200\377\200\200\377\200\200\377\200\200\376\200\200\376\200\200\377\200"
+    "\200\377\177\177\327\205\205*>>O\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\376\377\377\377\377\377\376\377\377\377\377\377\377\377\377\240\377\377\0AA"
+    "\205\200\200\373\200\200\377\200\200\377\200\200\345\200\200\213\200\200"
+    "\0\204\204\0OO\245\2\2\377\377\377\377\377\377\375\377\377\377\377\377\376\377\377\374\377\377G."
+    ".\234\177\177\377\177\177\376\200\200\376\200\200\376\200\200\374\200\200"
+    "\352\200\200\373\200\200\377\200\200\376\200\200\372\200\200\211\200\200"
+    "\0\200\200\0\204\204\355\377\377\377\377\377\377\377\377\376\377\377\376\377\377\377\377\377\377"
+    "\377\377\376\377\377\377\377\377\376\377\377\377\377\377\377\377\377\376\377\377\377\377\377k==\213\203\203"
+    "\377\200\200\376\200\200\377\200\200\377\200\200\377\200\200\376\200\200"
+    "\377\200\200\377\200\200\375\200\200\377\200\200\376\200\200\377\200\200"
+    "\377\200\200\376\200\200\377\200\200\377\200\200{\205\205\31//F\377\377\377\0"
+    "\0\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\0"
+    "\0\377\377\377\376\377\377\377\377\377\377\377\377\257\377\377\0\201\201\341\200\200\377\200"
+    "\200\376\200\200\377\200\200\336\200\200\0\207\207I\36\36\370\377\377\377\377\377"
+    "\376\377\377\376\377\377\377\377\377\377\377\377\262\377\377\0PP\246\201\201\377\200\200\377"
+    "\200\200\377\200\200\377\200\200\373\200\200\"\200\200\332\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200:\200\200\0\204\204\223\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\376\377\377\346\377\377""2==M\203\203\241\200\200\377\200\200\377\200"
+    "\200\227\200\200\371\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\376\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\210\200\200\0\211\211\377\377\0\373\377\377\377\377\377\376\377\377\377\377\377\376\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\376\377\377"
+    "\377\377\377\233\377\377""2\201\201\377\200\200\377\200\200\377\200\200\376\200\200"
+    "\376\200\200s\207\207z!!\374\377\377\376\377\377\377\377\377\377\377\377\376\377\377\377\377\377"
+    "\371\377\377NFF\3{{\344\200\200\377\200\200\377\177\177\377\200\2005\200\200"
+    "\33\200\200\330\200\200\377\200\200\377\200\200\376\200\200\377\200\200\333"
+    "\200\200\15\204\204'\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\312\377\377\0==\0\203\203\0"
+    "\200\200\220\200\200$\200\200\2\200\200\26\200\200o\200\200=\200\200K\200"
+    "\200\331\200\200\376\200\200\377\200\200\344\200\200\344\200\200\344\200"
+    "\200\377\177\177~\200\200\0\204\204\266\377\377\377\377\377\376\377\377\376\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\0"
+    "\0\377\377\377\246\377\377\2\377\377\204\201\201\377\200\200\376\200\200\376\200\200"
+    "\377\200\200\331\200\200\0\204\204~\40\40\374\377\377\377\377\377\376\377\377\377\377\377"
+    "\377\377\377\376\377\377\377\377\377\255\377\377B\377\377\22bb#iiA\205\205\207\203\203\16\203"
+    "\203\36\203\203\330\177\177\377\200\200\377\200\200\376\200\200\376\200\200"
+    "\377\200\200t\204\204%\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\376\377\377\262\377\377:::\210\203\203"
+    "O\200\200\0\200\200F\200\200\214\200\200\21\200\200\0\200\200Q\200\200\40"
+    "\200\200\0\200\200\233\200\200\244\200\200\11\200\200\27\200\200\27\177\177"
+    "\37\201\2016ww\31\11\11\343\377\377\377\377\377\376\377\377\377\377\377\376\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\210"
+    "\377\377\31ss\377\177\177\376\200\200\376\200\200\377\200\200\372\177\177\201"
+    "\177\177\0--\246\377\377\375\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376"
+    "\377\377\377\377\377\377\377\377\311\377\377l\12\12q??v<<\12<<\37JJ\336\204\204\377\200\200"
+    "\377\200\200\377\200\200\377\200\200\241\177\177\22\214\214$\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\375\377\377@\14\14\230dd\321\201\201'\200\200\30\200\200\377\200\200"
+    "\345\200\200\31\200\200\11\200\200\232\200\200\354\200\200A\200\200\0\200"
+    "\200\31\200\200\210\200\200\337\200\200\331\200\200eqq\0\24\24\225\377\377\377"
+    "\377\377\376\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\355\377\377H\"\"\20ww\377\200\200\377\200"
+    "\200\377\200\200\377\200\200k\200\200\0++L\377\377\377\377\377\376\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\376\377\377\377\377\377\376\377\377\377\377\377\377\377\377\376\377\377\376"
+    "\377\377\377\377\377\311\377\377\2\32\32\244\220\220\272\201\201\372\177\177\277\177"
+    "\177\221\177\177\20\216\216\0\37\37V\377\377\377\377\377\377\377\377\376\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\375\377\377/\31\31T"
+    "\216\216\34\211\2114\211\211!\177\177\340\200\2006\200\200\0\200\200\0\200"
+    "\200Z\200\200\377\200\200Q\177\177\0\211\211\0\211\211~\203\203\377\177\177"
+    "\377\200\200Xhhz\377\377\372\377\377\376\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\350"
+    "\377\377""9OO\0\214\214r\177\177\377\200\200\346\177\177[\207\207\0\212\212>"
+    "\377\377\354\377\377\377\377\377\376\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\376\377\377\377\377\377\377\377\377\376\377\377\377\377\377\371\377\377_\377\377\0\15\15"
+    "\0mm6\201\201\0\201\201\0\207\207\0$$X\377\377\375\377\377\377\377\377\376\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\375\0"
+    "\0,\34\34\0LLm\377\377\317\377\377\0\210\210+\200\200\0\201\201\2\201\201\0\201\201"
+    "\35\201\201\250\200\200\37\207\207\5\377\377[\377\377\14LLD\202\202D}}#\377\377\346\0"
+    "\0\377\377\377\375\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\375\377\377\177\377\377\4\377\377"
+    "\1\202\202@\201\201\36\211\211\0\33\33.\1\1\377\377\377\377\377\377\375\377\377\376\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\376\377\377\377\377\377\376\377\377\377\377\377\377\377\377\260\377\377I\377\377G\377\377L\377\377A\377\377\314"
+    "\377\377\377\377\377\377\377\377\376\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\375\377\377e\377\377g\377\377\377\377\377\333\377\377\30"
+    "\11\11\10CC\216\377\377\370\377\377@\377\377""6\377\377\5JJ6\3\3y\377\377\377\377\377\213\377\377\16"
+    "aa\21\377\377\261\377\377\377\377\377\376\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377"
+    "\377\377\377\377\377\377n\377\377J\377\377G\377\377=\377\377\306\377\377\377\377\377\377\377\377\376\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\376\377\377\377\377\377\376\377\377\376\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\377\377\377\376\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\375\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\325\377\377\271\377\377\373\377\377\377\377\377\377\377\377\377"
+    "\377\377\253\377\377\377\377\377\377\377\377\377\377\377\377\377\377\275\377\377\277\377\377\377\377\377\375"
+    "\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\375\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\376\377\377\377\377\377\376\377\377\376\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\372\377\377\311"
+    "\377\377S\377\377\373\377\377\377\377\377\377\377\377\253\377\377S\377\377\373\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\354\377\377\377\377\377\377\377\377\377\377\377\376\377\377\376\377\377\377\377\377\376"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\376\377\377\376\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\376\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\376"
+    "\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\325\377\377\0@@\0\33\33\220\377\377"
+    "\377\377\377\304\377\377\24\16\16\0wwx\377\377\377\377\377\376\377\377\377\377\377_\377\377\36\377\377\320"
+    "\377\377\377\377\377\377\377\377\377\377\377\376\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377"
+    "\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376"
+    "\377\377\377\377\377\374\377\377""7\377\377\12CC\3\221\221&\2\2\322\377\377\10\377\377\203aa#\205"
+    "\205c\377\377\377\377\377\377\377\377O\377\377\3\23\23\32kk\40\377\377\326\377\377\37\377\377\201\377\377"
+    "\377\377\377\376\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\322\377\377\33??\252"
+    "\213\213P\205\205\0,,\0((JRR\377\206\206\236\203\203\0%%e**S**\0%%\257\214"
+    "\214\327\205\205\1RR\0((***\37\37\37\252\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377B\377\377\5\217\217\231\177\177c\177\177\0\206\206\0\206"
+    "\2061\203\203t\177\177q\177\177\0\206\206\0\206\206\0\206\206\0\206\206\377"
+    "\177\177\303\177\177\0\203\203H\206\206\344\206\206duup\26\26\377\377\377\377"
+    "\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\376\377\377\377\377\377\313\377\377\0oo+\201\201\0\200\200\0\200\200]\200"
+    "\200\325\200\200G\200\200E\200\200B\200\200\212\200\200\350\200\200]\200"
+    "\200\0\200\200\26\200\200\24\200\200\0\200\200a\200\200\271\200\200Pttw\36"
+    "\36\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\376\377\377\377\377\377\305\377\377\20\377\377F\200\200\377\200\200r\200"
+    "\200\233\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\275\200\200\266\200\200;\200\200"
+    "\6\200\200\12\200\200\0\200\200\0ss{\33\33\377\377\377\376\377\377\377\377\377\376\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\375\0"
+    "\0\210\377\377\1ppv\177\177\377\200\200\377\200\200\377\200\200\377\200\200\376"
+    "\200\200\377\200\200\377\200\200\377\200\200\377\200\200\376\200\200\377"
+    "\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200c\200"
+    "\200Jvv\3""33\245\4\4\376\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377l\377\377\2ooy\177\177\370\200\200"
+    "\377\200\200\376\200\200\376\200\200\377\200\200\377\200\200\377\200\200"
+    "\376\200\200\377\200\200\377\200\200\377\200\200\377\200\200\376\200\200"
+    "\377\200\200\377\200\200\376\200\200\377\177\177\336\200\200\12\214\214O"
+    "\31\31\377\377\377\376\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\376\377\377\377\377\377\265\377\377\11\17\17\10\211\211O\177\177\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\376\200\200\376\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\376\200\200\377\200\200\377\200"
+    "\200\376\200\200\376\200\200\377\200\200\371\177\177g\210\210\4\21\21\333"
+    "\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\376\377\377\377\377\377\377\377\377\243\377\377\0\2\2\0\212\212\30\201\201b\177\177"
+    "\375\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200"
+    "\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200"
+    "\377\200\200\377\200\200\377\200\200\201\200\200\0\206\206a\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376"
+    "\377\377\376\377\377\377\377\377\250\377\377)\377\377\32//\0nn\16\201\201$\201\201\307\201\201"
+    "\312\202\202\312\200\200\312\200\200\312\200\200\312\200\200\312\200\200"
+    "\312\200\200\312\200\200\312\200\200\312\200\200\312\200\200\320\200\200"
+    "h\177\177\0\212\212\6\377\377\377\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\376\377\377\376\377\377\377\377\377\377\377\377"
+    "\320\377\377]\377\377""9II8KK)KK\0GG\0\203\203\0\206\206\0\206\206\0\206\206\0\206"
+    "\206\0\206\206\0\206\206\0\206\206\0\206\206\0\206\206\0\206\206\0\212\212"
+    "\0\\\\w\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\346\377\377\347\377\377\341\377\377\252\377\377\233$$\233''\233''\233''\233''\233''\233"
+    "''\233''\233''\233''\233''\234**\225\3\3\377\377\377\377\377\377\376\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\376\377\377\377\377\377\377\377\377\377\377\377\376\377\377\376\377\377"
+    "\376\377\377\376\377\377\376\377\377\376\377\377\376\377\377\376\377\377\376\377\377\376\377\377\376\377\377"
+    "\376\377\377\376\377\377\376\377\377\376\377\377\376\377\377\376\377\377\377\377\377\376\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377",
+    
+    
+    // second image
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377[\377\377\216QQ\222PPY\16\16\230\377\377\262\377\377\347\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377N\377\377\177jj\377\203"
+    "\203\354\203\203\302rr\310ll\27__\36\377\377\256\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\330\377\377Uee\375\200\200\375\200\200\376\200"
+    "\200\377\200\200\377\200\200\326\201\201&PP\344\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377|\377\377\242bb\376\200\200\376\200\200\377"
+    "\200\200\373\200\200\322\201\201EPP\212\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\332\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\234\377\377c22\212>>\201>>,::{qq\375\200\200\377\200\200\221\200\200d\200"
+    "\200\0\204\204'\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\334\377\377e\377\377\23CClCCb\6\6\342"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\225\377\377J//z\177\177\307\203\203\255"
+    "\203\203z\203\203A\200\200\371\177\177\377\200\200\250\200\200\22\200\200"
+    "\0\204\204\22\377\377\317\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\315\377\377*\377\377\202dd\202\205\205~\205\205"
+    "\177ppV\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\317\377\377\"\36\36\351\205\205\376\200\200"
+    "\376\200\200\376\200\200\375\200\200\377\200\200\375\200\200\376\200\200"
+    "\376\200\200\377\200\200\202\200\200\30nnA\377\377\312\377\377\347\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\354\377\377\334\377\377\335\377\377\335\377\377\336\377\377\265\377\377\12\0"
+    "\0\24\377\377\25\377\377\25\377\377\15\377\377k\377\377\333\377\377\335\377\377\336\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\204\377\377\277hh\375\200\200\375"
+    "\177\177\377\177\177\352\211\211=\1\1\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\274\5\5[\217"
+    "\217\376\177\177\376\200\200\377\200\200\376\200\200\376\200\200\377\200"
+    "\200\377\200\200\377\200\200\376\200\200\377\200\200\377\200\200\377\200"
+    "\200\246\210\210\15\221\2217\12\12\377\377\377\377\377\377\251\377\377s\16\16%\24\24"
+    "\10\220\220\15\207\207\14\207\207\14\207\207g\207\207\215\207\207\212\207"
+    "\207\212\207\207\213\207\207\203\207\207*\207\207\14\207\207\15\210\210\3"
+    "]]H\13\13m\22\22\210\377\377\351\377\377\343\377\377\341\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\204\377\377\317kk\377"
+    "\200\200\377\200\200\344\200\200\36\211\211G\1\1\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\26\5\5\241\211\211\377\200\200\376\200\200\376\200\200\377\200\200\377\200"
+    "\200\251\200\200\226\200\200\261\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\376\200\200\371\205\205K88s11g110++Z}}a\210\210\350\177"
+    "\177\354\200\200\353\200\200\353\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\353\200\200\355\177"
+    "\177\276\203\203X\211\211Z\215\215\\..211\32""11\21""55\222\377\377\223\377\377\216"
+    "\377\377\262\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\213\377\377\205"
+    "kk\377\200\200\344\200\200c\200\200\15\211\211%\377\377\251\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\377\377\5\5\250\211\211\377\200\200\376\200\200\377\177\177\375\200\200\211"
+    "\205\205\0\211\211\0\211\211\0\211\211Z\211\211\256\212\212\377\200\200\376"
+    "\200\200\377\200\200\327\177\1774\204\2048\205\205\271\205\205\337\205\205"
+    "\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200"
+    "\377\200\200\376\200\200\377\200\200\377\200\200\376\200\200\376\200\200"
+    "\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\177\177"
+    "\377\205\205\317\205\205\272\205\205\275\210\210\246UUCUUMUUAUU/UU9DD\215"
+    "\377\377\243\377\377\346\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\245\377\377\4kk\306\200\200\324\200\200=\200\200"
+    "\244\202\202SVVEWW5**\311\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\244\5\5:\216\216\372\177\177\377\200\200\374"
+    "\200\200\233\205\205\0>>\235\10\10\303\13\13\305\13\13\205\13\13\4\2\2\224"
+    "\200\200\377\206\206\330\201\201%\177\1776\200\200\377\200\200\377\200\200"
+    "\377\200\200\376\200\200\377\200\200\376\200\200\376\200\200\377\200\200"
+    "\376\200\200\377\200\200\377\200\200\376\200\200\377\200\200\377\200\200"
+    "\377\200\200\376\200\200\377\200\200\376\200\200\376\200\200\377\200\200"
+    "\377\200\200\376\200\200\377\200\200\377\200\200\377\177\177\377\200\200"
+    "\377\200\200\377\200\200\343\200\200\301\200\200\261~~1ss\6}}#\377\377?\377\377\266"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\271\377\377\21\0"
+    "\0\12jj\347\200\200\376\200\200\377\200\200\375\177\177\377\200\200\377\201"
+    "\201\247\202\2026\31\31G\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\336\377\377""6\33\33\235\204\204\262yy\24vv\36\377\377\247\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\210\377\377?\377\377\336\1\1A\\\\,\202\202\377"
+    "\200\200\376\200\200\376\200\200\377\200\200\377\200\200\376\200\200\377"
+    "\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377"
+    "\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377"
+    "\200\200\377\200\200\377\200\200\376\200\200\377\200\200\376\200\200\377"
+    "\200\200\377\200\200\377\200\200\377\200\200\376\200\200\377\200\200\377"
+    "\200\200\377\200\200\377\200\200\352\177\177V\204\204D}}\0**n\5\5\242\4\4"
+    "\351\377\377\377\377\377\377\377\377\24\377\377\0cc\30jj\233\207\207\376\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\376\200\200\376\200\200\377\177"
+    "\177\252\214\214F\15\15Y\3\3\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\305\377\377""644*\11\11\264\377\377\350\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\324\6\6\15\\\\\336\202\202\377\200"
+    "\200\376\200\200\377\200\200\376\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\376\200\200\377\200\200\377\200\200\377\200\200\376\200\200\311\206"
+    "\206e\215\2155^^2\36\36t\377\377\304\377\377O99\233\204\204\341\202\202\377\177\177"
+    "\377\200\200\377\200\200\377\200\200\377\200\200\376\200\200\376\200\200"
+    "\377\200\200\376\200\200\377\177\177\377\212\212\0KK\307\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377a\12"
+    "\12xvv\372\201\201\376\200\200\377\200\200\376\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\376\200"
+    "\200\377\200\200\377\200\200\377\200\200\376\200\200\377\200\200\376\200"
+    "\200\377\200\200\377\200\200\377\177\177\377\202\202\244\201\201SDD\0GGt"
+    "``\377\200\200\377\200\200\377\177\177\317\202\202^\202\202_\202\202V\202"
+    "\202\322\200\200\377\177\177\376\200\200\376\200\200\377\200\200\377\177"
+    "\177DssP\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\266\377\377\22\6\6\377\212\212\377\177\177\377\200\200\376\200\200"
+    "\377\200\200\377\200\200\377\200\200\376\200\200\377\200\200\377\200\200"
+    "\376\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200"
+    "\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200"
+    "\377\200\200\377\200\200\376\200\200\377\200\200\377\200\200\376\200\200"
+    "\376\200\200\377\200\200\377\200\200\376\200\200\377\200\200\377\200\200"
+    "\377\200\200\377\200\200\376\200\200\377\200\200\376\200\200\376\200\200"
+    "\376\200\200\377\200\200\355\202\202E\202\202\0\201\201V\177\177\377\202"
+    "\202q\213\213\15kk\0ff\0ff\0dd?\201\201\377\200\200\377\200\200\377\200\200"
+    "\377\200\200\374\200\2004pp\256\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377Z\377\377\332\210\210\377\177\177\376\200\200"
+    "\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200"
+    "\376\200\200\376\200\200\377\200\200\376\200\200\377\200\200\376\200\200"
+    "\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200"
+    "\376\200\200\377\200\200\377\200\200\377\200\200\376\200\200\376\200\200"
+    "\376\200\200\377\200\200\377\200\200\376\200\200\375\200\200\375\200\200"
+    "\374\200\200\323\200\200\325\200\200\333\200\200\375\200\200\377\200\200"
+    "\377\200\200\377\200\200\377\200\200\376\200\200\377\200\200\377\200\200"
+    "3\200\200\0\200\200\17[[\20\377\377\311\377\377\377\377\377\377\377\377\301\377\377\26\377\377@}"
+    "}\342\177\177\326\200\200\346\200\200\31\200\200\27oo\354\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\306\377\377@\24\24\374\205"
+    "\205\377\200\200\375\200\200\331\200\200\327\200\200\327\200\200\327\200"
+    "\200\327\200\200\330\200\200\377\200\200\377\200\200\377\200\200\376\200"
+    "\200\376\200\200\377\200\200\376\200\200\376\200\200\377\200\200\376\200"
+    "\200\377\200\200\377\200\200\377\200\200\376\200\200\376\200\200\377\200"
+    "\200\377\200\200\377\200\200\376\200\200\333\200\200\327\200\200\305\200"
+    "\200o\200\200f\200\200f\200\200\0\200\200\0\200\200\0\200\200\277\200\200"
+    "\377\200\200\377\200\200\377\200\200\377\200\200\376\200\200\375\200\200"
+    "\377\200\200\336\200\200\7\200\200\23\\\\\313\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\277\377\377r\377\377\0&&\0kk\0ff\0iim\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377I\377\377\202\201\201\377\177\177\377"
+    "\200\200\375\200\200%\200\200\16\200\200\17\200\200\17\200\200\17\200\200"
+    "\17\200\200\203\200\200\177\200\200\326\200\200\371\200\200\377\200\200\377"
+    "\200\200\376\200\200\377\200\200\376\200\200\377\200\200\376\200\200\376"
+    "\200\200\376\200\200\377\200\200\377\200\200\377\200\200\377\200\200\245"
+    "\200\200v\200\200\31\200\200\17\200\200\14\200\200\0\200\200\0\200\200\0"
+    "\200\200\0\200\200\0\200\200\0\200\200\224\200\200\377\200\200\377\200\200"
+    "\377\200\200\377\200\200\377\200\200\376\200\200\376\200\200\377\200\200"
+    "I\200\200\15\\\\\276\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\223\377\377s\377\377u\377\377\201\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\345\377\377$\377\377tyy\377\200\200\377\200\200\377\200"
+    "\200\221\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200"
+    "\200\0\200\200\40\200\200X\200\200\244\200\200\334\200\200\377\200\200\377"
+    "\200\200\375\200\200\376\200\200\376\200\200\377\200\200\377\200\200\350"
+    "\200\200\242\200\200O\200\200.\200\200\12\200\200\0\200\200\0\200\200\0\200"
+    "\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200"
+    "\230\200\200\377\200\200\377\200\200\377\200\200\377\200\200\376\200\200"
+    "\377\200\200\376\200\200\377\200\200\216\200\200\20\\\\\275\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\252"
+    "\377\377\32XX\341\200\200\377\200\200\376\200\200\377\200\200\261\200\200\0\200"
+    "\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200"
+    "\1\200\200\4\200\200\33\200\200\"\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\"\200\200!\200\200\3\200\200\0\200\200\0\200"
+    "\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200"
+    "\0\200\200\0\200\200\0\200\200\0\200\200\226\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\376\200\200\377\200\200\377\200"
+    "\200\377\200\200\26\\\\\273\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\202\377\377\31``\355\200\200\377\200\200"
+    "\377\200\200\376\200\200\377\200\200J\200\200\0\200\200\0\200\200\0\200\200"
+    "\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0"
+    "\200\200\20\200\200\265\200\200\374\200\200\377\200\200\32\200\200\0\200"
+    "\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200"
+    "\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\17"
+    "\200\200\275\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377"
+    "\200\200\377\200\200\376\200\200\377\200\200\265\177\177\21SS\273\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\354"
+    "\377\377>>>\0\211\211\226\177\177\377\200\200\376\200\200\376\200\200\377\200"
+    "\200\312\200\200\0\200\200\0\200\200\15\200\200_\200\200Z\200\200=\200\200"
+    "\10\200\200\0\200\200\0\200\200\0\200\200\0\200\200\10\200\200\235\200\200"
+    "\377\200\200\377\200\200(\200\200\0\200\200\0\200\200\0\200\200\0\200\200"
+    "\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\3\200\200\0\200\200\0"
+    "\200\200\0\200\200\0\200\200\27\200\200\273\200\200\377\200\200\376\200\200"
+    "\376\200\200\377\200\200\376\200\200\377\200\200\377\200\200\376\200\200"
+    "\377\200\200Jzz!\3\3\327\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377R\16\16\0qqf\200\200\333\200\200\377"
+    "\200\200\376\200\200\376\200\200\372\200\200y\200\200\12\200\200\0\200\200"
+    "\241\200\200\324\200\200\273\200\200\213\200\200\0\200\200\0\200\200\0\200"
+    "\200\16\200\200\267\200\200\377\200\200\377\200\200\377\200\200\35\200\200"
+    "\0\200\200\0\200\200\0\200\200\0\200\200\0\200\200\16\200\200\215\200\200"
+    "\276\200\200\267\200\200p\200\200\15\200\200\0\200\200\0\200\200>\200\200"
+    "\263\200\200\377\200\200\376\200\200\377\200\200\377\200\200\376\200\200"
+    "\377\200\200\376\200\200\377\200\200\377\200\200\275\177\177\31\202\202w"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\340\377\377&\377\377\5\200\200\34\206\206\303\177\177\377\200"
+    "\200\377\200\200\377\200\200\374\200\200\313\200\200\213\200\200\0\200\200"
+    "\12\200\200\20\200\200\15\200\200\0\200\200\25\200\200\242\200\200\315\200"
+    "\200\377\200\200\375\200\200\377\200\200\346\200\200\16\200\200\0\200\200"
+    "\0\200\200\0\200\200\0\200\200\0\200\200\23\200\200Z\200\200_\200\200W\200"
+    "\200\11\200\200\0\200\200-\200\200\237\200\200\377\200\200\374\200\200\376"
+    "\200\200\376\200\200\377\200\200\377\200\200\377\200\200\376\200\200\377"
+    "\200\200\351\200\200z\200\200\23\206\206\4\10\10\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\353\377\377""7\377\377\7\11\11\0\202\202|~~\332\200\200\371\200\200\371"
+    "\177\177\377\200\200\377\200\200\377\200\200\277\200\200\26\200\200\305\200"
+    "\200\377\200\200\371\200\200\377\200\200\377\200\200\376\200\200\377\200"
+    "\200\376\200\200\377\200\200\370\200\200\371\200\200\265\200\200*\200\200"
+    "1\200\2002\200\2001\200\200.\200\200.\200\200.\200\200+\200\200\223\200\200"
+    "\376\200\200\377\200\200\376\200\200\376\200\200\377\200\200\377\200\200"
+    "\377\200\200\376\200\200\376\200\200\374\200\200\377\200\200f\200\200\0\200"
+    "\200\0\207\207\224\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\251"
+    "\377\377\210\377\377""2::\14^^]__h\202\202\263\200\200\321\200\200\377\200\200\377"
+    "\200\200\377\200\200\377\200\200\377\200\200\377\200\200\376\200\200\376"
+    "\200\200\377\200\200\377\200\200\376\200\200\376\200\200\377\200\200\377"
+    "\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377"
+    "\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\376"
+    "\200\200\377\200\200\377\200\200\377\200\200\376\200\200\377\200\200\377"
+    "\200\200\377\200\200\241\200\200N\200\200\5\200\2007\200\2007\205\205\6\35"
+    "\35\203\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\225\377\377)\2\2\0\212\212\0\200\200\17\200\200v\200\200\225\200\200\375\200"
+    "\200\377\200\200\376\200\200\376\200\200\377\200\200\377\200\200\376\200"
+    "\200\376\200\200\377\200\200\377\200\200\377\200\200\376\200\200\376\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\376\200\200\376\200\200\377\200"
+    "\200\376\200\200\377\200\200\377\200\200\377\200\200\314\177\177w\205\205"
+    "\0\210\210\12\207\207\316\177\177\377\200\200\377\177\177\247\204\204\6+"
+    "+I\377\377\331\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\222"
+    "\10\10\3\211\211V\200\200Z\200\200\0\200\200\4\200\200H\200\200\216\200\200"
+    "\377\200\200\376\200\200\376\200\200\377\200\200\377\200\200\377\200\200"
+    "\377\200\200\377\200\200\376\200\200\377\200\200\377\200\200\376\200\200"
+    "\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200"
+    "\376\200\200\377\200\200\376\200\200\375\200\200\377\200\200\377\200\200"
+    "\260\200\200\224\177\177~\211\211\13\216\216\0::h\26\26\36!!\263\216\216"
+    "\377\177\177\377\200\200\377\200\200\266{{*oo\35\11\11\227\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\302\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377/\377\377\23\10\10*\211\211\316\200\200\373\200\200"
+    "\324\200\200\13\200\200\0\200\200\0\200\200m\200\200\377\200\200\377\200"
+    "\200\376\200\200\376\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\376\200\200\375\200"
+    "\200\377\200\200\245\200\200\32\200\200\11\200\200\0\203\203\377\377\0F\377\377\316"
+    "\377\377\377\377\377,\377\377\0++\212\206\206\374\200\200\376\200\200\377\200\200\375"
+    "\200\2008\200\200\5}}O\377\377\377\377\377\377\377\377\377\377\377V\377\377!\377\377\14\377\377\40\0"
+    "\0""4\377\377\351\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\343\377\377\320\377\377l\6\6>\20\20\225~~\377\210\210\377\177\177"
+    "\377\177\177\350\202\202\336\201\201\17ff\20hh\0gg\0\200\200u\200\200\321"
+    "\200\200\377\200\200\376\200\200\377\200\200\376\200\200\377\200\200\346"
+    "\200\200\377\200\200\377\200\200\370\200\200\377\200\200\376\200\200\377"
+    "\200\200\377\200\200\377\200\200\377\200\200\376\200\200\377\200\200\373"
+    "\200\200\236\200\200\0\200\200\0\206\206!\30\30k\377\377\216\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377""6\34\34\0dd\216\200\200\373\177\177\377\200\200\376"
+    "\200\200\377\200\200\301\200\200\12ii\22\20\20\207\27\27f\27\27\0**\21\220"
+    "\220a\210\210l\210\2107{{1\6\6\347\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\271\377\377\223\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\262\377\377\207\377\377\"66x88\222VV\372\214\214\377\200\200\377\177"
+    "\177\377\200\200\260\212\2122OO#CC\205\377\377\300\377\377\"\377\377\0\200\200\0\200"
+    "\200[\200\200\377\200\200\377\200\200\376\200\200\377\200\200\334\200\200"
+    "4\200\200\207\200\200\272\200\200g\200\200\337\200\200\377\200\200\376\200"
+    "\200\377\200\200\377\200\200\377\200\200\376\200\200\377\200\200\275\200"
+    "\200\0\200\200\0\200\200\0||\260\32\32\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\344\377\377:\377\377\0::y\202\202\377\177\177\377\200\200\376\200\200"
+    "\377\200\200\302\202\202A\211\211\0\210\210\0\210\210\12\207\207\246\177"
+    "\177\377\200\200\377\200\200\335\202\202\22TT\271\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\253\377\377$\21\21""4jj.\7\7\270\377\377\377\377\377\377\377\377\377"
+    "\377\377\271\377\377*\6\6""0dd>ZZ\265\202\202\373\204\204\377\202\202\342\204\204"
+    "\312\206\206Z\211\211#||\33""88C\377\377\301\377\377\377\377\377\377\377\377""9\377\377\0\211"
+    "\211*\177\177\245\200\200\340\200\200\376\200\200\377\200\200\377\200\200"
+    "{\200\200\0\200\200i\200\200\262\200\200\0\200\200\257\200\200\377\200\200"
+    "\377\200\200\377\200\200\377\200\200\376\200\200\377\200\200\373\200\200"
+    "H\200\200\0\200\200\0\200\200\0||B\32\32\345\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\345\377\377""6\377\377\0\215\215r\206\206\375\177\177\377"
+    "\200\200\376\200\200\377\200\200\377\200\200h\200\2004\200\200\250\200\200"
+    "\377\200\200\377\200\200\377\200\200\326\202\202\17UU\270\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\225\377\377\27\377\377\347\204\204\373\201\201g\203\203\3\0"
+    "\0V\377\377S\377\377""1\377\377xww\260zz\337\200\200\370\200\200\377\200\200\350\177"
+    "\177J\205\205#HH\3**\7\4\4\256\5\5\315\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\277\377\377\0\6\6\20\215\215\270\202\202\377\177\177\376\200\200\377\200\200"
+    "\351\200\200,\200\200\0\200\200\334\200\200\252\200\200\0\200\200\256\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\370\200\200\"\200\200\0\200\200/\177\1774\211\211\0!!\226\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377""0\6\6\0))\204"
+    "\210\210\374\177\177\375\200\200\376\200\200\377\200\200\370\200\200\377"
+    "\200\200\347\200\200O\200\200S\177\177U\204\204#uu=\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377:\377\377\370\212\212\377\177\177\376\200\200\377\177\177"
+    "\377\206\206)\206\2063\206\206d\207\207\377\200\200\377\200\200\375\200\200"
+    "\370\200\200a\200\200\0ss\20EE2\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\267\377\377)\377\377\0""99\213\203\203\375\200"
+    "\200\377\200\200\376\200\200\373\200\200\374\200\200\377\200\200\265\200"
+    "\200e\200\200\377\200\200\376\200\200\377\200\200\377\200\200\377\200\200"
+    "\377\200\200\376\200\200\376\200\200\377\200\200^\177\177\334\201\201'99"
+    "I\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\266\377\377\0==\233\201\201\373\177\177\377\200\200\376\200\200"
+    "\377\200\200\270\200\200\0\200\200\0\200\200\0\207\207\11\377\377M\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\240\377\377h99\377\201\201\376\200\200\376"
+    "\200\200\376\200\200\377\200\200\377\200\200\377\200\200\377\200\200\376"
+    "\200\200\372\200\200\244\200\200H\200\200\0\204\204K\377\377\312\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377A==H\203\203\370\200\200\377\200\200\376\200\200\377\200"
+    "\200\377\200\200\375\200\200\377\200\200\377\200\200\377\200\200\376\200"
+    "\200\377\200\200\377\200\200\377\200\200\376\200\200\376\200\200\377\200"
+    "\200\377\177\177\327\205\205*>>O\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\240\377\377\0AA"
+    "\205\200\200\373\200\200\377\200\200\377\200\200\345\200\200\213\200\200"
+    "\0\204\204\0OO\245\2\2\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377G."
+    ".\234\177\177\377\177\177\376\200\200\376\200\200\376\200\200\374\200\200"
+    "\352\200\200\373\200\200\377\200\200\376\200\200\372\200\200\211\200\200"
+    "\0\200\200\0\204\204\355\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377k==\213\203\203"
+    "\377\200\200\376\200\200\377\200\200\377\200\200\377\200\200\376\200\200"
+    "\377\200\200\377\200\200\375\200\200\377\200\200\376\200\200\377\200\200"
+    "\377\200\200\376\200\200\377\200\200\377\200\200{\205\205\31//F\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\257\377\377\0\201\201\341\200\200\377\200"
+    "\200\376\200\200\377\200\200\336\200\200\0\207\207I\36\36\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\262\377\377\0PP\246\201\201\377\200\200\377"
+    "\200\200\377\200\200\377\200\200\373\200\200\"\200\200\332\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200:\200\200\0\204\204\223\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\346\377\377""2==M\203\203\241\200\200\377\200\200\377\200"
+    "\200\227\200\200\371\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\376\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\210\200\200\0\211\211\377\377\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\233\377\377""2\201\201\377\200\200\377\200\200\377\200\200\376\200\200"
+    "\376\200\200s\207\207z!!\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377NFF\3{{\344\200\200\377\200\200\377\177\177\377\200\2005\200\200"
+    "\33\200\200\330\200\200\377\200\200\377\200\200\376\200\200\377\200\200\333"
+    "\200\200\15\204\204'\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\312\377\377\0==\0\203\203\0"
+    "\200\200\220\200\200$\200\200\2\200\200\26\200\200o\200\200=\200\200K\200"
+    "\200\331\200\200\376\200\200\377\200\200\344\200\200\344\200\200\344\200"
+    "\200\377\177\177~\200\200\0\204\204\266\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\246\377\377\2\377\377\204\201\201\377\200\200\376\200\200\376\200\200"
+    "\377\200\200\331\200\200\0\204\204~\40\40\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\255\377\377B\377\377\22bb#iiA\205\205\207\203\203\16\203"
+    "\203\36\203\203\330\177\177\377\200\200\377\200\200\376\200\200\376\200\200"
+    "\377\200\200t\204\204%\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\262\377\377<::\211\203\203"
+    "O\200\200\0\200\200F\200\200\214\200\200\21\200\200\0\200\200Q\200\200\40"
+    "\200\200\0\200\200\233\200\200\244\200\200\12\200\200\30\200\200\27\200\200"
+    "\37\200\2006uu\31\11\11\343\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\210"
+    "\377\377\31ss\377\177\177\376\200\200\376\200\200\377\200\200\372\177\177\201"
+    "\177\177\0--\246\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\311\377\377l\12\12q??v<<\12<<\37JJ\336\204\204\377\200\200"
+    "\377\200\200\377\200\200\377\200\200\241\177\177\22\214\214$\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377A\14\14~dd\255\201\201+\200\200\30\200\200\377\200\200\345"
+    "\200\200\31\200\200\11\200\200\232\200\200\354\200\200A\200\200\0\200\200"
+    "\31\200\200\211\200\200\341\200\200\331\200\200f\203\203\0""88\226\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\355\377\377H\"\"\20ww\377\200\200\377\200"
+    "\200\377\200\200\377\200\200k\200\200\0++L\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\311\377\377\2\32\32\244\220\220\272\201\201\372\177\177\277\177"
+    "\177\221\177\177\20\216\216\0\37\37V\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377-\31\31\16"
+    "\212\212\6\177\177\0\200\200$\200\200\340\200\2007\200\200\0\200\200\0\200"
+    "\200Z\200\200\377\200\200R\200\200\0\200\200\0\200\200(\200\200\335\200\200"
+    "\377\200\200O\203\203H==\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\350\377\377""9OO\0\214\214r\177\177\377\200\200\346\177\177[\207\207\0\212\212"
+    ">\377\377\354\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377_\377\377\0\15\15"
+    "\0mm6\201\201\0\201\201\0\207\207\0$$X\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
+    "\0.\31\31\0\210\210\0\200\200\0\200\200\13\200\200+\200\200\0\200\200\235"
+    "\200\200\0\200\200\31\200\200R\200\200\27\200\200\0\200\200\1\200\200\0\200"
+    "\200(\200\200D\200\200\0\203\203\4==\323\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\177\377\377\4\377\377\1\202\202@\201\201\36\211\211\0\33\33"
+    ".\1\1\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\260\377\377I\377\377G\377\377L\377\377A\377\377\314\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377,\31\31B\210\210\203\200\200\4\200\200\0\200\200\0\200\200\217\200"
+    "\200\374\200\200!\200\200\0\200\200\0\200\200\0\200\200\31\200\200\332\200"
+    "\200m\200\200\0\200\200\0\200\200\17\203\203\7==\324\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377n\377\377J\377\377G\377\377=\377\377\306\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\341\377\377\31\23\23>\210\210\373\200\200\22\200\200\0\200\200\12"
+    "\200\200\215\200\200\254\200\200g\200\200\0\200\200\0\200\200\0\200\200L"
+    "\200\200\377\200\200j\200\200\0\200\200[\200\200\244\203\203\26==\323\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\225\377\377\0hh\13\202\2021\200\200"
+    "\0\200\200}\200\200r\200\200\25\200\200\36\200\200\"\200\200\241\200\200"
+    "\216\200\200\4\200\200\13\200\200N\200\200\37\200\200\0\200\200\326\200\200"
+    "\311\203\203\32==\322\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\240\377\377\7\377\377\201"
+    "\211\211\232\177\177K\200\200\221\200\200\377\200\200\372\200\200\377\200"
+    "\200\377\200\200\377\200\200\376\200\200\377\200\200\236\200\200{\200\200"
+    "[\200\200\0\200\200\0\200\200\4\200\200\11\203\203\7==\331\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377""9\377\377\2\206\206\326\177\177\376\200\200\373\200\200"
+    "\377\200\200\376\200\200\376\200\200\377\200\200\377\200\200\377\200\200"
+    "\376\200\200\376\200\200\377\200\200\377\200\200\374\200\200\346\200\200"
+    "\350\200\200\323\200\200\26\203\203\14CCP\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\267"
+    "\377\377\20\377\377\"\205\205\311\177\177\377\200\200\377\200\200\375\200\200\377"
+    "\200\200\377\200\200\377\200\200\377\200\200\376\200\200\377\200\200\377"
+    "\200\200\377\200\200\376\200\200\377\200\200\377\200\200\377\200\200\377"
+    "\200\200\377\177\177\203\213\213\0??\313\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377""7\0"
+    "\0\12""221\205\205\304\200\200\377\200\200\377\200\200\376\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\376\200"
+    "\200\377\200\200\377\200\200\377\200\200\376\200\200\377\200\200\377\200"
+    "\200\303\177\177\17\216\216\\\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\352\377\377$\377\377\0\221"
+    "\221\11\204\204z\200\200\305\177\177\377\200\200\377\200\200\376\200\200"
+    "\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200"
+    "\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\372\200\200"
+    "*\211\211\2\377\377\331\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\352\377\377$\377\377\4//\0zz\7||D\200"
+    "\200\220\200\200\371\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200\200\377\200"
+    "\200\377\200\200\377\200\200(\200\200\0\177\177W\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\344\377\377r\377\377\30\377\377\21hh\23bb\6__\0\201\201\0\203\203"
+    "\0\203\203\0\203\203\0\203\203\0\203\203\0\203\203\0\203\203\0\203\203\0"
+    "\203\203\0\203\203\0\203\203\0\215\215\377\377\0\230\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\303\377\377\300\377\377\304\377\377\226\377\377c::a"
+    ">>a>>a>>a>>a>>a>>a>>a>>a>>a>>a>>bCCe\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+    "\377\377\377"
+    };
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bsptemplate/asspandvariant/template_variant/camerasctemplate.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,52 @@
+// 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:
+// template/template_variant/camerasctemplate.mmp
+// soundsc.pdd Template shared chunk camera PDD
+// 
+//
+
+/**
+ @file
+*/
+#define __USING_ASSP_REGISTER_API__
+#define __USING_ASSP_INTERRUPT_API__
+
+#include		<variant.mmh>
+#include		"kernel/kern_ext.mmh"
+
+#if defined(WINS) || defined(WINSCW)
+TARGET			_template_camerasc.pdd
+#else
+//
+// This will generate a file '_template_camerasc.pdd'
+TARGET			VariantTarget(camerasc,pdd)
+#endif
+
+TARGETTYPE		pdd
+ROMTARGET		camerasc.pdd
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+USERINCLUDE		camerasc
+
+SOURCEPATH		camerasc
+SOURCE			camerasc.cpp
+SOURCE			camerasc_sensor.cpp
+SOURCE			logoyuv2.cpp
+
+UID			0x100039d0 0x100039eb
+VENDORID		0x70000001
+
+CAPABILITY		all
+
+SMPSAFE
--- a/bsptemplate/asspandvariant/template_variant/exiic.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/bsptemplate/asspandvariant/template_variant/exiic.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -17,8 +17,6 @@
 
 #define __USING_ASSP_REGISTER_API__
 #define __USING_ASSP_INTERRUPT_API__
-#define __USING_MHA_GPIO_API__
-
 
 #include <variant.mmh>
 
@@ -59,6 +57,10 @@
 //SYMBIAN_BASE_SYSTEMINCLUDE(template)
 //SYMBIAN_BASE_SYSTEMINCLUDE(template/specific)
 
+//library			iic.lib			// commented out as this iic.lib is now included from iic_channel.mmh
+
+library     VariantTarget(gpio,lib)
+
 
 //VENDORID 0x70000001
 
--- a/bsptemplate/asspandvariant/template_variant/rom/base_template.iby	Tue Aug 31 16:34:26 2010 +0300
+++ b/bsptemplate/asspandvariant/template_variant/rom/base_template.iby	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-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"
@@ -39,11 +39,7 @@
 extension[VARID]=KERNEL_DIR\DEBUG_DIR\_template_exmoncommon.dll			\sys\bin\exmoncommon.dll
 extension[VARID]=KERNEL_DIR\DEBUG_DIR\_template_exmondebug.dll			\sys\bin\exmondebug.dll
 extension[VARID]=KERNEL_DIR\DEBUG_DIR\_template_power.dll				\sys\bin\power.dll
-#ifdef SYMBIAN_USE_DMA_V2
-extension[VARID]=KERNEL_DIR\DEBUG_DIR\_template_dma_v2.dll			\sys\bin\dma.dll
-#else
 extension[VARID]=KERNEL_DIR\DEBUG_DIR\_template_dma.dll					\sys\bin\dma.dll
-#endif
 extension[VARID]=KERNEL_DIR\DEBUG_DIR\_template_lcd.dll					\sys\bin\lcd.dll
 extension[VARID]=KERNEL_DIR\DEBUG_DIR\_template_ekeyb.dll				\sys\bin\ekeyb.dll
 extension[VARID]=KERNEL_DIR\DEBUG_DIR\_template_exyin.dll				\sys\bin\exyin.dll
@@ -62,6 +58,8 @@
 device[VARID]	=KERNEL_DIR\DEBUG_DIR\pipelib.ldd						\sys\bin\pipelib.ldd
 device[VARID]	=KERNEL_DIR\DEBUG_DIR\minkda.ldd						\sys\bin\minkda.ldd
 extension[VARID]=KERNEL_DIR\DEBUG_DIR\exstart.dll						\sys\bin\exstart.dll
+device[VARID]	=KERNEL_DIR\DEBUG_DIR\ecamerasc.ldd						\sys\bin\ecamerasc.ldd
+device[VARID]	=KERNEL_DIR\DEBUG_DIR\_template_camerasc.pdd					\sys\bin\camerasc.pdd
 
 // USB Drivers
 extension[VARID]=KERNEL_DIR\DEBUG_DIR\_template_usbcc.dll				\sys\bin\usbcc.dll
--- a/bsptemplate/asspandvariant/template_variant/rom/kernel.iby	Tue Aug 31 16:34:26 2010 +0300
+++ b/bsptemplate/asspandvariant/template_variant/rom/kernel.iby	Wed Sep 01 12:34:56 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+* 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"
@@ -30,11 +30,7 @@
 extension[VARID]=	\Epoc32\Release\##KMAIN##\##BUILD##\_##VARIANT##_EXMONCOMMON.DLL \sys\bin\exmoncommon.dll
 extension[VARID]=	\Epoc32\Release\##KMAIN##\##BUILD##\_##VARIANT##_EXMONDEBUG.DLL \sys\bin\exmondebug.dll
 extension[VARID]=	\Epoc32\Release\##KMAIN##\##BUILD##\_##VARIANT##_POWER.DLL		\sys\bin\power.dll
-#ifdef SYMBIAN_USE_DMA_V2
-extension[VARID]=	\Epoc32\Release\##KMAIN##\##BUILD##\_##VARIANT##_DMA_V2.DLL		\sys\bin\dma.dll
-#else
-extension[VARID]=	\Epoc32\Release\##KMAIN##\##BUILD##\_##VARIANT##_DMA.DLL		\sys\bin\dma.dll
-#endif
+extension[VARID]=	\Epoc32\Release\##KMAIN##\##BUILD##\_##VARIANT##_DMA.DLL		\sys\bin\DMA.DLL
 //
 // TO DO: (mandatory)
 //
@@ -50,11 +46,7 @@
 extension[VARID]=	\Epoc32\Release\##KMAIN##\##BUILD##\_##VARIANT##_EXYIN.DLL		\sys\bin\exyin.dll
 device[VARID]=		\Epoc32\Release\##KMAIN##\##BUILD##\_##VARIANT##_EUART.PDD		\sys\bin\euart.pdd
 // SYM_BRANCH: Delete old sound driver
-#ifdef SYMBIAN_USE_DMA_V2
-device[VARID]= 		\Epoc32\Release\##KMAIN##\##BUILD##\_##VARIANT##_SOUNDSC_V2.PDD		\sys\bin\soundsc.pdd
-#else
 device[VARID]= 		\Epoc32\Release\##KMAIN##\##BUILD##\_##VARIANT##_SOUNDSC.PDD    	\sys\bin\soundsc.pdd
-#endif
 extension[VARID]=	\Epoc32\Release\##KMAIN##\##BUILD##\ELOCD.LDD					\sys\bin\elocd.ldd
 extension[VARID]=	\Epoc32\Release\##KMAIN##\##BUILD##\_##VARIANT##_MEDINT.PDD		\sys\bin\medint.pdd
 //extension[VARID]=	\Epoc32\Release\##KMAIN##\##BUILD##\_##VARIANT##_EPBUS.DLL		\sys\bin\epbus.dll
@@ -66,6 +58,8 @@
 device[VARID]=		\Epoc32\Release\##KMAIN##\##BUILD##\PIPELIB.LDD					\sys\bin\pipelib.ldd
 device[VARID]= 		\Epoc32\Release\##KMAIN##\##BUILD##\ESOUNDSC.LDD				\sys\bin\esoundsc.ldd
 extension[VARID]=	\Epoc32\Release\##KMAIN##\##BUILD##\EXSTART.DLL					\sys\bin\exstart.dll
+device[VARID]=		\Epoc32\Release\##KMAIN##\##BUILD##\ECAMERASC.LDD			\sys\bin\ecamerasc.ldd
+device[VARID]=		\Epoc32\Release\##KMAIN##\##BUILD##\_##VARIANT##_CAMERASC.PDD		\sys\bin\camerasc.pdd
 
 // USB Client
 device[VARID]=		\Epoc32\Release\##KMAIN##\##BUILD##\USBC.LDD					\sys\bin\EUSBC.LDD
@@ -90,15 +84,10 @@
 // Include optional test drivers for e32test
 
 // Include if platform supports the standard Symbian DMA framework
-#ifdef SYMBIAN_USE_DMA_V2
-device[VARID]=		\epoc32\release\##KMAIN##\##BUILD##\d_dma2.ldd					\sys\bin\d_dma2.ldd
-device[VARID]=		\epoc32\release\##KMAIN##\##BUILD##\d_dma_compat.ldd			\sys\bin\d_dma_compat.ldd
-#else
-device[VARID]=		\epoc32\release\##KMAIN##\##BUILD##\d_dma.ldd					\sys\bin\d_dma.ldd
-device[VARID]=		\epoc32\release\##KMAIN##\##BUILD##\d_dma2_compat.ldd			\sys\bin\d_dma2_compat.ldd
-#endif
+//device[VARID]=		\epoc32\release\##KMAIN##\##BUILD##\d_dma.ldd					\sys\bin\d_dma.ldd
 
 // Include if platform supports MMC
 //device[VARID]=		\epoc32\release\##KMAIN##\##BUILD##\d_medch.ldd					\sys\bin\d_medch.ldd
 
 #endif
+
--- a/bsptemplate/asspandvariant/template_variant/soundsctemplate_v2.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-// 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"
-// 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:
-// template/template_variant/soundsctemplate.mmp
-// soundsc.pdd Template shared chunk sound PDD
-// 
-//
-
-/**
- @file
-*/
-#define __USING_ASSP_REGISTER_API__
-#define __USING_ASSP_INTERRUPT_API__
-
-#include		<variant.mmh>
-#include		"kernel/kern_ext.mmh"
-
-target          	VariantTarget(soundsc_v2,pdd)
-targettype      	pdd
-romtarget		soundsc.pdd
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-SYMBIAN_BASE_SYSTEMINCLUDE(assp/template_assp)
-SYMBIAN_BASE_SYSTEMINCLUDE(template)
-SYMBIAN_BASE_SYSTEMINCLUDE(template/specific)
-USERINCLUDE		inc
-
-sourcepath		specific
-source          	soundsc_tx.cpp
-source          	soundsc_rx.cpp
-
-library         	dma2.lib
-library			VariantTarget(ecust,lib)
-
-uid             	0x100039d0 0x1000015c
-
-VENDORID 0x70000001
-
-capability		all
-EPOCALLOWDLLDATA
-
-MACRO DMA_APIV2
--- a/bsptemplate/asspandvariant/template_variant/specific/power.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/bsptemplate/asspandvariant/template_variant/specific/power.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -133,12 +133,6 @@
 		// bring it back from that state. Therefore we stop tracking wakeup events as the Power Manager will
 		// complete any pending notifications anyway. When the driver delivers its notification, we just ignore
 		// it.
-
-		if(wakeupRTC)
-			{
-			//Handle this if needed
-			}
-
 		iWakeupEventsOn = EFalse;		// tracking of wakeup events is now done in hardware
 		}
 	else
--- a/bsptemplate/asspandvariant/template_variant/specific/uart.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/bsptemplate/asspandvariant/template_variant/specific/uart.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -82,8 +82,6 @@
 	EUartDataLength8/* =bitmask for eight data bits */
 	};
 
-//Remove the #if block if this code needs to be used or referenced.
-#if 0	//RVCT40 warning
 //
 // TO DO: (mandatory)
 //
@@ -108,7 +106,6 @@
 // Lookup table to convert EPOC parity settings into hardware-specific values
 //
 // EXAMPLE ONLY
-
 static const TUartParity Parity[3] =
 	{
 	EUartParityNone,EUartParityEven,EUartParityOdd
@@ -120,7 +117,6 @@
 // Lookup table to convert EPOC stop bit values into hardware-specific values
 //
 // EXAMPLE ONLY
-
 static const TUartStopBit StopBit[2] =
 	{
 	EUartStopBitOne,EUartStopBitTwo
@@ -132,14 +128,12 @@
 // Lookup table to convert EPOC data bit settings into hardware-specific values
 //
 // EXAMPLE ONLY
-
 static const TUartDataLength DataLength[4] =
 	{
 	EUartDataLength5,EUartDataLength6,	
 	EUartDataLength7,EUartDataLength8
 	};
 
-#endif	//RVCT40 warning
 
 
 class DDriverComm : public DPhysicalDevice
--- a/bsptemplate/asspandvariant/template_variant/specific/variant.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/bsptemplate/asspandvariant/template_variant/specific/variant.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -27,12 +27,8 @@
 const TUint KHtCustomRestartMask  = KHtCustomRestartMax << KHtCustomRestartShift; 
 
 const TUint KHtRestartStartupModesMax = 0xf; // Variable, platform dependant 
-
-#undef USE_MODE_SHIFT_MASK
-#ifdef USE_MODE_SHIFT_MASK
 const TUint KHtRestartStartupModesShift = 16; // Variable, platform dependant 
 const TUint KHtRestartStartupModesMask = KHtRestartStartupModesMax << KHtRestartStartupModesShift;
-#endif
 
 void TemplateVariantFault(TInt aLine)
 	{
@@ -434,11 +430,8 @@
 			// TO DO: (optional)
 			//
 			// Read the restart startup mode, e.g:
-#undef USE_MODE_SHIFT_MASK
-#ifdef USE_MODE_SHIFT_MASK
-			TInt startup = (Kern::SuperPage().iHwStartupReason & KHtRestartStartupModesMask) >> KHtRestartStartupModesShift;
-			kumemput32(a1, &startup, sizeof(TInt));
-#endif
+			// TInt startup = (Kern::SuperPage().iHwStartupReason & KHtRestartStartupModesMask) >> KHtRestartStartupModesShift;
+			// kumemput32(a1, &startup, sizeof(TInt));
 			break; 			
 			}
 
--- a/bsptemplate/asspandvariant/template_variant/variant.mmh	Tue Aug 31 16:34:26 2010 +0300
+++ b/bsptemplate/asspandvariant/template_variant/variant.mmh	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-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"
@@ -149,13 +149,10 @@
 // For the status of errata of L210 & L220 cache, see the header of source file:
 // e32\kernel\arm\cachel2.cpp
 
-// Modular Hardware Adaptation - Service API library macros
-// MMP files define the relevant macro to add the library statement
-// 
-#if defined(__USING_ASSP_INTERRUPT_API__) || defined(__USING_ASSP_REGISTER_API__)
+#if defined(__USING_USING_ASSP_REGISTER_API__) || defined(__USING_INTERRUPT_API__) || defined(__USING_ASSP_REGISTER_API__)
 library	VariantTarget(katemplate,lib)
 #endif
 
-#if defined(__USING_MHA_GPIO_API__)
-library	VariantTarget(gpio,lib)
-#endif
+// Uncomment the following if IIC Controller is required
+// library		iic.lib  // commented out as this iic.lib is now included from iic_channel.mmh
+
--- a/build.config.xml	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,287 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE SystemDefinition [
- <!ELEMENT SystemDefinition (systemModel?, build?)>
- <!ATTLIST SystemDefinition
-  name CDATA #REQUIRED
-  schema CDATA #REQUIRED>
- <!ELEMENT systemModel (layer+)>
- <!ELEMENT layer (logicalset* | module*)*>
- <!ATTLIST layer
-  name CDATA #REQUIRED
-  levels CDATA #IMPLIED
-  span CDATA #IMPLIED>
- <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
- <!ATTLIST logicalset 
-  name CDATA #REQUIRED
-  levels CDATA #IMPLIED  
-  span CDATA #IMPLIED
-  level CDATA #IMPLIED>
- <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
- <!ATTLIST logicalsubset name CDATA #REQUIRED>
- <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
- <!ATTLIST module
-  name CDATA #REQUIRED
-  level CDATA #IMPLIED>
- <!ELEMENT component (unit* | package* | prebuilt*)*>
- <!ATTLIST component name CDATA #REQUIRED>
- <!ELEMENT unit EMPTY>
- <!ATTLIST unit
-  unitID ID #REQUIRED
-  name CDATA #REQUIRED
-  mrp CDATA #REQUIRED
-  filter CDATA #IMPLIED
-  bldFile CDATA #REQUIRED
-  priority CDATA #IMPLIED
-  contract CDATA #IMPLIED>
- <!ELEMENT package EMPTY>
- <!ATTLIST package
-  name CDATA #REQUIRED
-  mrp CDATA #REQUIRED
-  filter CDATA #IMPLIED
-  contract CDATA #IMPLIED>
- <!ELEMENT prebuilt EMPTY>
- <!ATTLIST prebuilt
-  name CDATA #REQUIRED
-  version CDATA #REQUIRED
-  late (Y|N) #IMPLIED
-  filter CDATA #IMPLIED
-  contract CDATA #IMPLIED>
- <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
- <!ELEMENT unitList (unitRef+)>
- <!ATTLIST unitList
-  name ID #REQUIRED
-  description CDATA #REQUIRED>
- <!ELEMENT unitRef EMPTY>
- <!ATTLIST unitRef unit IDREF #REQUIRED>
- <!ELEMENT targetList EMPTY>
- <!ATTLIST targetList
-  name ID #REQUIRED
-  description CDATA #REQUIRED
-  target IDREFS #REQUIRED>
- <!ELEMENT target EMPTY>
- <!ATTLIST target
-  name ID #REQUIRED
-  abldTarget CDATA #REQUIRED
-  description CDATA #REQUIRED>
- <!ELEMENT option EMPTY>
- <!ATTLIST option
-  name ID #REQUIRED
-  abldOption CDATA #REQUIRED
-  description CDATA #REQUIRED
-  enable (Y | N | y | n) #REQUIRED>
- <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
- <!ATTLIST configuration
-  name ID #REQUIRED
-  description CDATA #REQUIRED
-  filter CDATA #REQUIRED>
- <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
- <!ELEMENT unitListRef EMPTY>
- <!ATTLIST unitListRef unitList IDREF #REQUIRED>
- <!ELEMENT layerRef EMPTY>
- <!ATTLIST layerRef layerName CDATA #REQUIRED>
- <!ELEMENT buildLayer EMPTY>
- <!ATTLIST buildLayer
-  command CDATA #REQUIRED
-  targetList IDREFS #IMPLIED
-  unitParallel (Y | N | y | n) #REQUIRED
-  targetParallel (Y | N | y | n) #IMPLIED>
- <!ELEMENT specialInstructions EMPTY>
- <!ATTLIST specialInstructions
-  name CDATA #REQUIRED
-  cwd CDATA #REQUIRED
-  command CDATA #REQUIRED>
- <!ENTITY layer_real_source_path "/sf/os/kernelhwsrv" >
-]>
-<SystemDefinition name="KHS" schema="1.4.0">
-  <systemModel>
-	<layer name="os_layer">
-
-		<module name="KHS_HalServices"> 
-			<unit name="khs_hal" unitID="sos.khs_hal" bldFile="\sf\os\kernelhwsrv\halservices\hal" mrp="\sf\os\kernelhwsrv\halservices\hal\base_hal.mrp"/> 
-		</module> 
-		<module name="KHS_Kernel"> 
-			<unit name="eka" unitID="sos.eka" bldFile="\sf\os\kernelhwsrv\kernel\eka" mrp="\sf\os\kernelhwsrv\kernel\eka\base_e32.mrp"/>
-			<unit name="eka_compsupp" unitID="sos.eka_compsupp" bldFile="\sf\os\kernelhwsrv\kernel\eka\compsupp" mrp="\sf\os\kernelhwsrv\kernel\eka\compsupp\base_e32_compsupp.mrp"/>
-			<unit name="eka_drivers_bsp" unitID="sos.eka_drivers_bsp" bldFile="\sf\os\kernelhwsrv\kernel\eka\drivers\bsp\" mrp="\sf\os\kernelhwsrv\kernel\eka\drivers\bsp\base_e32_drivers_bsp.mrp.mrp"/>
-			<unit name="eka_drivers_cf_unistore2" unitID="sos.eka_drivers_cf_unistore2" bldFile="\sf\os\kernelhwsrv\kernel\eka\drivers\crashflash\unistore2" mrp="\sf\os\kernelhwsrv\kernel\eka\drivers\crashflash\unistore2\base_crashflash_unistore2.mrp"/>
-			<unit name="eka_drivers_debug" unitID="sos.eka_drivers_debug" bldFile="\sf\os\kernelhwsrv\kernel\eka\drivers\debug\group" mrp="\sf\os\kernelhwsrv\kernel\eka\drivers\debug\group\base_e32_drivers_debug.mrp"/>
-			<unit name="eka_drivers_display" unitID="sos.eka_drivers_display" bldFile="\sf\os\kernelhwsrv\kernel\eka\drivers\display" mrp="\sf\os\kernelhwsrv\kernel\eka\drivers\display\base_e32_drivers_display.mrp"/>
-			<unit name="eka_drivers_ecomm" unitID="sos.eka_drivers_ecomm" bldFile="\sf\os\kernelhwsrv\kernel\eka\drivers\ecomm" mrp="\sf\os\kernelhwsrv\kernel\eka\drivers\ecomm\base_e32_drivers_ecomm.mrp"/>
-			<unit name="eka_drivers_ethernet" unitID="sos.eka_drivers_ethernet" bldFile="\sf\os\kernelhwsrv\kernel\eka\drivers\ethernet" mrp="\sf\os\kernelhwsrv\kernel\eka\drivers\ethernet\base_e32_drivers_ethernet.mrp"/>
-			<unit name="eka_drivers_locmedia" unitID="sos.eka_drivers_locmedia" bldFile="\sf\os\kernelhwsrv\kernel\eka\drivers\locmedia" mrp="\sf\os\kernelhwsrv\kernel\eka\drivers\locmedia\base_e32_drivers_locmedia.mrp"/>
-			<unit name="eka_drivers_media" unitID="sos.eka_drivers_media" bldFile="\sf\os\kernelhwsrv\kernel\eka\drivers\media" mrp="\sf\os\kernelhwsrv\kernel\eka\drivers\media\base_e32_drivers_media.mrp"/>
-			<unit name="eka_drivers_medsd3c" unitID="sos.eka_drivers_medsd3c" bldFile="\sf\os\kernelhwsrv\kernel\eka\drivers\medsd3c" mrp="\sf\os\kernelhwsrv\kernel\eka\drivers\medsd3c\base_e32_sd3c.mrp"/>
-			<unit name="eka_drivers_sdcard4c" unitID="sos.eka_drivers_sdcard4c" bldFile="\sf\os\kernelhwsrv\kernel\eka\drivers\pbus\mmc\sdcard\sdcard4c" mrp="\sf\os\kernelhwsrv\kernel\eka\drivers\pbus\mmc\sdcard\sdcard4c\base_e32_sd4c.mrp"/>
-			<unit name="eka_drivers_soundsc" unitID="sos.eka_drivers_soundsc" bldFile="\sf\os\kernelhwsrv\kernel\eka\drivers\soundsc" mrp="\sf\os\kernelhwsrv\kernel\eka\drivers\soundsc\base_e32_drivers_sound.mrp"/>
-			<unit name="eka_drivers_trace" unitID="sos.eka_drivers_trace" bldFile="\sf\os\kernelhwsrv\kernel\eka\drivers\trace" mrp="\sf\os\kernelhwsrv\kernel\eka\drivers\trace\base_e32_drivers_trace.mrp"/>
-			<unit name="eka_drivers_unistore2" unitID="sos.eka_drivers_unistore2" bldFile="\sf\os\kernelhwsrv\kernel\eka\drivers\unistore2" mrp="\sf\os\kernelhwsrv\kernel\eka\drivers\unistore2\base_drivers_unistore2.mrp"/>
-			<unit name="eka_drivers_usbdescriptors" unitID="sos.eka_drivers_usbdescriptors" bldFile="\sf\os\kernelhwsrv\kernel\eka\drivers\usbho\usbdescriptors" mrp="\sf\os\kernelhwsrv\kernel\eka\drivers\usbho\usbdescriptors\base_drivers_usbdescriptors.mrp"/>
-			<unit name="eka_drivers_usbdi_utils" unitID="sos.eka_drivers_usbdi_utils" bldFile="\sf\os\kernelhwsrv\kernel\eka\drivers\usbho\usbdi_utils" mrp="\sf\os\kernelhwsrv\kernel\eka\drivers\usbho\usbdi_utils\base_drivers_usbdi_utils.mrp"/>
-			<unit name="eka_drivers_usbc" unitID="sos.eka_drivers_usbc" bldFile="\sf\os\kernelhwsrv\kernel\eka\drivers\usbc" mrp="\sf\os\kernelhwsrv\kernel\eka\drivers\usbc\base_e32_drivers_usbcli.mrp"/>
-			<unit name="eka_drivers_usbho" unitID="sos.eka_drivers_usbho" bldFile="\sf\os\kernelhwsrv\kernel\eka\drivers\usbho" mrp="\sf\os\kernelhwsrv\kernel\eka\drivers\usbho\base_drivers_usbhostotg.mrp"/>
-			<unit name="eka_euser" unitID="sos.eka_euser" bldFile="\sf\os\kernelhwsrv\kernel\eka\euser" mrp="\sf\os\kernelhwsrv\kernel\eka\euser\base_e32_euser.mrp"/>
-			<unit name="eka_ewsrv" unitID="sos.eka_ewsrv" bldFile="\sf\os\kernelhwsrv\kernel\eka\ewsrv\" mrp="\sf\os\kernelhwsrv\kernel\eka\ewsrv\base_e32_ewsrv.mrp"/>
-		</module> 
-
-		<module name="KHS_UserLibraryAndFileServer"> 
-			<unit name="usrlibflsrv_domainmgr" unitID="sos.usrlibflsrv_domainmgr" bldFile="\sf\os\kernelhwsrv\userlibandfileserver\domainmgr\group" mrp="\sf\os\kernelhwsrv\userlibandfileserver\domainmgr\group\base_domain.mrp"/>
-			<unit name="usrlibflsrv_flsrv_automounter" unitID="sos.usrlibflsrv_flsrv_automounter" bldFile="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\automounter" mrp="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\automounter\base_domain.mrp"/>
-			<unit name="usrlibflsrv_flsrv_estart" unitID="sos.usrlibflsrv_flsrv_estart" bldFile="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\estart" mrp="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\estart\base_f32_estart.mrp"/>
-			<unit name="usrlibflsrv_flsrv_etshell" unitID="sos.usrlibflsrv_flsrv_etshell" bldFile="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\etshell" mrp="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\etshell\base_f32_eshell.mrp"/>
-			<unit name="usrlibflsrv_flsrv" unitID="sos.usrlibflsrv_flsrv" bldFile="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\group" mrp="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\group\base_f32.mrp"/>
-			<unit name="usrlibflsrv_flsrv_iso9660" unitID="sos.usrlibflsrv_flsrv_iso9660" bldFile="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\iso9660" mrp="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\base_f32_siso9660.mrp"/>
-			<unit name="usrlibflsrv_flsrv_ntfs" unitID="sos.usrlibflsrv_flsrv_ntfs" bldFile="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\ntfs" mrp="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\ntfs\base_f32_sntfs.mrp"/>
-			<unit name="usrlibflsrv_flsrv_scomp" unitID="sos.usrlibflsrv_flsrv_scomp" bldFile="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\scomp" mrp="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\scomp\base_f32_scomp.mrp"/>
-			<unit name="usrlibflsrv_flsrv_sfat" unitID="sos.usrlibflsrv_flsrv_sfat" bldFile="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\sfat" mrp="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\sfat\base_f32_sfat.mrp"/>
-			<unit name="usrlibflsrv_flsrv_sfat32" unitID="sos.usrlibflsrv_flsrv_sfat32" bldFile="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\sfat32" mrp="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\sfat32\base_f32_sfat32.mrp"/>
-			<unit name="usrlibflsrv_flsrv_shostmassstorage" unitID="sos.usrlibflsrv_flsrv_shostmassstorage" bldFile="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\shostmassstorage" mrp="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\shostmassstorage\base_f32_shostmassstorage.mrp"/>
-			<unit name="usrlibflsrv_flsrv_smassstorage" unitID="sos.usrlibflsrv_flsrv_smassstorage" bldFile="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\smassstorage" mrp="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\smassstorage\base_f32_smassstorage.mrp"/>
-			<unit name="usrlibflsrv_flsrv_srofs" unitID="sos.usrlibflsrv_flsrv_srofs" bldFile="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\srofs" mrp="\sf\os\kernelhwsrv\userlibandfileserver\fileserver\srofs\base_f32_srofs.mrp"/>
-		</module> 
-
-		<module name="KHS_Unistore2"> 
-			<unit name="unistore2_uiibootsupport" unitID="sos.unistore2_uiibootsupport" bldFile="\sf\os\kernelhwsrv\unistore2\uiibootsupport" mrp="\sf\os\kernelhwsrv\unistore2\uiibootsupport\base_nandboot_unistore2.mrp"/>
-		</module>
-
-		<module name="KHS_E32utils"> 
-			<unit name="e32utils" unitID="sos.e32utils" bldFile="\sf\os\kernelhwsrv\kerneltest\e32utils\group" mrp="\sf\os\kernelhwsrv\kerneltest\e32utils\group\base_e32utils.mrp"/>
-			<unit name="e32utils_restricted" unitID="sos.e32utils_restricted" bldFile="\sf\os\kernelhwsrv\kerneltest\e32utils\group\restricted" mrp="\sf\os\kernelhwsrv\kerneltest\e32utils\group\restricted\base_e32utils_restricted.mrp"/>
-		</module>
-
-		<module name="BSP_Emulator"> 
-			<unit name="emulatorbsp" unitID="sos.emulatorbsp" bldFile="\sf\os\boardsupport\emulator\emulatorbsp" mrp="\sf\os\boardsupport\emulator\emulatorbsp\base_wins.mrp"/>
-			<unit name="unistore2emulatorsupport" unitID="sos.unistore2emulatorsupport" bldFile="\sf\os\boardsupport\emulator\unistore2emulatorsupport" mrp="\sf\os\boardsupport\emulator\unistore2emulatorsupport\base_wins_unistore2.mrp"/>
-		</module>
-		<!--
-		<module name="BSP_NaviEngine"> 
-			<unit name="navienginebootldr" unitID="sos.navienginebootldr" bldFile="\sf\os\boardsupport\naviengine\navienginebootldr" mrp="\sf\os\boardsupport\naviengine\navienginebootldr\base_wins.mrp"/>
-			<unit name="navienginebsp_ne1_tb" unitID="sos.navienginebsp_ne1_tb" bldFile="\sf\os\boardsupport\naviengine\navienginebsp\ne1_tb" mrp=""/>
-			<unit name="navienginebsp_ne1_tb_single" unitID="sos.navienginebsp_ne1_tb_single" bldFile="\sf\os\boardsupport\naviengine\navienginebsp\ne1_tb\single" mrp=""/>
-			<unit name="navienginebspflexible" unitID="sos.navienginebspflexible" bldFile="\sf\os\boardsupport\naviengine\navienginebspflexible" mrp="\sf\os\boardsupport\naviengine\navienginebspflexible\base_naviengine_flexible.mrp"/>
-			<unit name="naviengineunistore2" unitID="sos.naviengineunistore2" bldFile="\sf\os\boardsupport\naviengine\naviengineunistore2" mrp="\sf\os\boardsupport\naviengine\naviengineunistore2\base_nec_naviengine_unistore2.mrp"/>
-			<unit name="naviengineunistore2flex" unitID="sos.naviengineunistore2flex" bldFile="\sf\os\boardsupport\naviengine\naviengineunistore2flex" mrp="\sf\os\boardsupport\naviengine\naviengineunistore2flex\base_nec_naviengine_unistore2_flexible.mrp"/>
-			<unit name="naviengineusbhcd" unitID="sos.naviengineusbhcd" bldFile="\sf\os\boardsupport\naviengine\naviengineusbhcd" mrp="\sf\os\boardsupport\naviengine\naviengineusbhcd\base_naviengine_usbhost.mrp"/>
-			<unit name="naviengineusbhcd_flexible" unitID="sos.naviengineusbhcd_flexible" bldFile="\sf\os\boardsupport\naviengine\naviengineusbhcd\flexible" mrp=""/>
-		</module>
-		-->
-		<module name="BSP_OMAP3Variants"> 
-			<unit name="34xx_sdp" unitID="sos.34xx_sdp" bldFile="\sf\os\boardsupport\omap3variants\tiomap3bsp\variant\34xx_sdp" mrp=""/>
-			<unit name="34xx_sdp_bootloader" unitID="sos.34xx_sdp_bootloader" bldFile="\sf\os\boardsupport\omap3variants\tiomap3bsp\variant\34xx_sdp\34xx_sdp_bootloader" mrp=""/>
-			<unit name="34xx_sdp_bootstrap" unitID="sos.34xx_sdp_bootstrap" bldFile="\sf\os\boardsupport\omap3variants\tiomap3bsp\variant\34xx_sdp\bootstrap" mrp=""/>
-			<unit name="34xx_sdp_flexible" unitID="sos.34xx_sdp_flexible" bldFile="\sf\os\boardsupport\omap3variants\tiomap3bsp\variant\34xx_sdp\flexible" mrp="\sf\os\boardsupport\omap3variants\tiomap3bsp\variant\34xx_sdp\flexible\base_tiomap3_flexible.mrp"/>
-			<unit name="34xx_sdp_restricted_sdio" unitID="sos.34xx_sdp_restricted_sdio" bldFile="\sf\os\boardsupport\omap3variants\tiomap3bsp\variant\34xx_sdp_restricted\sdio" mrp="\sf\os\boardsupport\omap3variants\tiomap3bsp\variant\34xx_sdp_restricted\sdio\base_tiomap3_sdio.mrp"/>
-			<unit name="34xx_sdp_restricted_unistore2" unitID="sos.34xx_sdp_restricted_unistore2" bldFile="\sf\os\boardsupport\omap3variants\tiomap3bsp\variant\34xx_sdp_restricted\unistore2" mrp=""/>
-			<unit name="34xx_sdp_restricted_unistore2_flexible" unitID="sos.34xx_sdp_restricted_unistore2_flexible" bldFile="\sf\os\boardsupport\omap3variants\tiomap3bsp\variant\34xx_sdp_restricted\unistore2\flexible" mrp="\sf\os\boardsupport\omap3variants\tiomap3bsp\variant\34xx_sdp_restricted\unistore2\flexible\base_tiomap3_unistore2_flexible.mrp"/>
-			<unit name="lab" unitID="sos.lab" bldFile="\sf\os\boardsupport\omap3variants\tiomap3bsp\variant\lab" mrp="\base_tiomap3_lab.mrp"/>
-			<unit name="lab_bootloader" unitID="sos.lab_bootloader" bldFile="\sf\os\boardsupport\omap3variants\tiomap3bsp\variant\lab\lab_bootloader" mrp=""/>
-			<unit name="lab_restricted_sdio" unitID="sos.lab_restricted_sdio" bldFile="\sf\os\boardsupport\omap3variants\tiomap3bsp\variant\lab_restricted\sdio" mrp="\sf\os\boardsupport\omap3variants\tiomap3bsp\variant\lab_restricted\sdio\base_tiomap3_lab_sdio.mrp"/>
-			<unit name="lab_restricted_unistore2" unitID="sos.lab_restricted_unistore2" bldFile="\sf\os\boardsupport\omap3variants\tiomap3bsp\variant\lab_restricted\unistore2" mrp="\sf\os\boardsupport\omap3variants\tiomap3bsp\variant\lab_restricted\unistore2\base_tiomap3_lab_unistore2.mrp"/>
-		</module>
-		<module name="BSP_OMAPH2"> 
-			<unit name="omaph2bsp_h2" unitID="sos.omaph2bsp_h2" bldFile="\sf\os\boardsupport\omaph2\omaph2bsp\h2" mrp="\sf\os\boardsupport\omaph2\omaph2bsp\h2\base_omaph2.mrp"/>
-			<unit name="omaph2bsp_h2_single" unitID="sos.omaph2bsp_h2_single" bldFile="\sf\os\boardsupport\omaph2\omaph2bsp\h2\single" mrp=""/>
-			<unit name="omaph2sdio" unitID="sos.omaph2sdio" bldFile="\sf\os\boardsupport\omaph2\omaph2sdio" mrp="\sf\os\boardsupport\omaph2\omaph2sdio\base_h2_sdio.mrp"/>
-			<unit name="omaph2unistore2" unitID="sos.omaph2unistore2" bldFile="\sf\os\boardsupport\omaph2\omaph2unistore2" mrp="\sf\os\boardsupport\omaph2\omaph2unistore2\base_h2_unistore2.mrp"/>
-		</module>
-		<module name="BSP_OMAPH4"> 
-			<unit name="h4bootloader" unitID="sos.h4bootloader" bldFile="\sf\os\boardsupport\omaph4\h4bootloader" mrp="\sf\os\boardsupport\omaph4\h4bootloader\base_omaph4hrp_bootldr.mrp"/>
-			<unit name="omaph4bsp_h4" unitID="sos.omaph4bsp_h4" bldFile="\sf\os\boardsupport\omaph4\omaph4bsp\h4" mrp="\sf\os\boardsupport\omaph4\omaph4bsp\h4\base_omaph4hrp.mrp"/>
-			<!--<unit name="omaph4bsp_h4_flexible" unitID="sos.omaph4bsp_h4_flexible" bldFile="\sf\os\boardsupport\omaph4\omaph4bsp\h4\flexible" mrp="\sf\os\boardsupport\omaph4\omaph4bsp\h4\flexible\base_omaph4hrp_flexible.mrp"/>-->
-			<unit name="omaph4minienvbootloader" unitID="sos.omaph4minienvbootloader" bldFile="\sf\os\boardsupport\omaph4\omaph4minienvbootloader" mrp="\sf\os\boardsupport\omaph4\omaph4minienvbootloader\base_omaph4hrp_mebootldr.mrp"/>
-			<unit name="omaph4sdio" unitID="sos.omaph4sdio" bldFile="\sf\os\boardsupport\omaph4\omaph4sdio" mrp="\sf\os\boardsupport\omaph4\omaph4sdio\base_omaph4hrp_sdio.mrp"/>
-			<unit name="omaph4unistore2" unitID="sos.omaph4unistore2" bldFile="\sf\os\boardsupport\omaph4\omaph4unistore2" mrp="\sf\os\boardsupport\omaph4\omaph4unistore2\base_omaph4hrp_unistore2.mrp"/>
-			<!-- <unit name="omapusbhotgdrivers" unitID="sos.omapusbhotgdrivers" bldFile="\sf\os\boardsupport\omaph4\omapusbhotgdrivers" mrp="\sf\os\boardsupport\omaph4\omapusbhotgdrivers\base_omaph4hrp_usbhostotg_usbware.mrp"/> -->
-		</module>
-		<!-- 
-		<module name="BSP_STVariants"> 
-			<unit name="montblanc_test" unitID="sos.montblanc_test" bldFile="\sf\os\boardsupport\stvariants\montblanc\test" mrp=""/>
-			<unit name="nokia_smpower" unitID="sos.nokia_smpower" bldFile="\sf\os\boardsupport\emulator\unistore2emulatorsupport" mrp=""/>
-		</module>
-		-->
-		<module name="NCP_Rapu"> 
-			<!-- <unit name="PRM" unitID="sos.PRM" bldFile="\ncp_sw\core7.0\base_rapu\rapu\PowerResourceManager" mrp=""/> -->
-			<unit name="power" unitID="sos.power" bldFile="\ncp_sw\core7.0\base_rapu\rapu\power" mrp=""/>
-			<unit name="ip_devices_keymap" unitID="sos.ip_devices_keymap" bldFile="\ncp_sw\corecom\bbc_components\input_devices\keymap\group" mrp=""/>
-			<unit name="security_components" unitID="sos.security_components" bldFile="\ncp_sw\corecom\security_components\group" mrp=""/>
-			<unit name="power_common" unitID="sos.power_common" bldFile="\ncp_sw\corecom\base_components\power_common\group" mrp=""/>
-
-			<unit name="I2C" unitID="sos.I2C" bldFile="\ncp_sw\corecom\base_components\I2C\group" mrp=""/>
-			<unit name="hal" unitID="sos.hal" bldFile="\overlay\10.1_overlay\79.01_vasco_overlay\variation\group" mrp=""/>
-			<unit name="ip_devices_mednand_common" unitID="sos.ip_devices_mednand_common" bldFile="\ncp_sw\corecom\bbc_components\memory\mednand_common" mrp=""/>
-			<unit name="ip_devices_medusii17" unitID="sos.ip_devices_medusii17" bldFile="\ncp_sw\corecom\bbc_components\memory\medusii17\group" mrp=""/>
-			<unit name="ip_devices_memcard_sd_devlon" unitID="sos.ip_devices_memcard_sd_devlon" bldFile="\ncp_sw\corecom\bbc_components\memory\memcard\rapu\devlon70" mrp=""/>
-			<unit name="display_chipset" unitID="sos.display_chipset" bldFile="\ncp_sw\core7.0\IVE3_Engine\IVE3_rapu_drivers\display\display_chipset_drv_ive_bc" mrp=""/>
-
-			<unit name="vcdriver" unitID="sos.vcdriver" bldFile="\ncp_sw\core7.0\IVE3_Engine\IVE3_rapu_drivers\interface\vcdriver\group" mrp=""/>
-			<unit name="vchi" unitID="sos.vchi" bldFile="\ncp_sw\core7.0\IVE3_Engine\IVE3_rapu_drivers\interface\vchi" mrp=""/>
-			<unit name="rmi" unitID="sos.rmi" bldFile="\ncp_sw\core7.0\IVE3_Engine\IVE3_rapu_drivers\interface\rmi" mrp=""/>
-			<unit name="test_logger" unitID="sos.test_logger" bldFile="\ncp_sw\core7.0\IVE3_Engine\IVE3_rapu_drivers\test\logger" mrp=""/>
-			<unit name="dispcommanddrv" unitID="sos.dispcommanddrv" bldFile="\ncp_sw\core7.0\IVE3_Engine\IVE3_rapu_drivers\display\dispcommanddrv" mrp=""/>
-			<unit name="tv_out" unitID="sos.tv_out" bldFile="\ncp_sw\core7.0\IVE3_Engine\IVE3_rapu_drivers\display\tv_out" mrp=""/>
-			<unit name="vc_dispman" unitID="sos.vc_dispman" bldFile="\ncp_sw\core7.0\IVE3_Engine\IVE3_rapu_drivers\display\vc_dispman\group" mrp=""/>
-			<unit name="dgsw_s60display_group_common" unitID="sos.dgsw_s60display_group_common" bldFile="\ncp_sw\corecom\dgsw_s60display\group_common" mrp=""/>
-			<unit name="dgsw_s60display_group_variation" unitID="sos.dgsw_s60display_group_variation" bldFile="\ncp_sw\corecom\dgsw_s60display\group_variation" mrp=""/>
-			<unit name="cts79" unitID="sos.cts79" bldFile="\ncp_sw\corecom\dgsw_s60display\group_variation\cts79" mrp=""/>
-			<unit name="isaaccessdriver" unitID="sos.isaaccessdriver" bldFile="\ncp_sw\corecom\modemadaptation_ext\connectivitylayer_ext\isaaccessdriver\group" mrp=""/>
-			<unit name="ist" unitID="sos.ist" bldFile="\ncp_sw\corecom\modemadaptation_ext\connectivitylayer_ext\ist\group" mrp=""/>
-			<unit name="isimessage" unitID="sos.isimessage" bldFile="\ncp_sw\corecom\modemadaptation_ext\connectivitylayer_ext\isimessage\group" mrp=""/>
-			<!-- <unit name="TraceCore" unitID="sos.TraceCore" bldFile="\ncp_sw\corecom\SWATI_Symbian_Tools\Trace\TraceCore\group" mrp=""/> -->
-			<unit name="rapu" unitID="sos.rapu" bldFile="\ncp_sw\core7.0\base_rapu\rapu" mrp=""/>
-            <!-- RJC added -->
-			<unit name="rapu_flexible" unitID="sos.rapu.flexible" bldFile="\ncp_sw\core7.0\base_rapu\rapu\flexible" mrp=""/>
-			<unit name="gape" unitID="sos.gape" bldFile="\ncp_sw\corecom\base_components\gape\group" mrp=""/>
-			<unit name="srawfs" unitID="sos.srawfs" bldFile="\ncp_sw\corecom\bbc_components\memory\srawfs\group" mrp=""/>
-			<unit name="rebootdrv" unitID="sos.rebootdrv" bldFile="\ncp_sw\corecom\modemadaptation_ext\adaptationlayer_ext\rebootdriver\group" mrp=""/>
-			<unit name="vcbufmanx" unitID="sos.vcbufmanx" bldFile="\ncp_sw\core7.0\IVE3_Engine\IVE3_rapu_drivers\interface\bufmanx" mrp=""/>
-            
-		</module>
-	</layer>
-	
-	<layer name="api_test_layer">
-		<module name="KHS_Test_E32test"> 
-			<unit name="e32test_dll" unitID="sos.e32test_dll" bldFile="\sf\os\kernelhwsrv\kerneltest\e32test\dll\oe\group" mrp=""/>
-			<unit name="e32test" unitID="sos.e32test" bldFile="\sf\os\kernelhwsrv\kerneltest\e32test\group" mrp="\sf\os\kernelhwsrv\kerneltest\e32test\groupbase_e32test.mrp"/>
-			<unit name="e32test_resourceman_acctst" unitID="sos.e32test_resourceman_acctst" bldFile="\sf\os\kernelhwsrv\kerneltest\e32test\resourceman\acctst" mrp=""/>
-			<unit name="e32test_otgdi" unitID="sos.e32test_otgdi" bldFile="\sf\os\kernelhwsrv\kerneltest\e32test\usbho\t_otgdi" mrp=""/>
-			<unit name="e32test_usbdi" unitID="sos.e32test_usbdi" bldFile="\sf\os\kernelhwsrv\kerneltest\e32test\usbho\t_usbdi" mrp=""/>
-		</module> 
-
-		<module name="KHS_Test_F32test"> 
-			<unit name="f32test" unitID="sos.f32test" bldFile="\sf\os\kernelhwsrv\kerneltest\f32test\group" mrp="\sf\os\kernelhwsrv\kerneltest\f32test\group\base_f32test.mrp"/>
-			<unit name="f32test_loader" unitID="sos.f32test_loader" bldFile="\sf\os\kernelhwsrv\kerneltest\f32test\loader" mrp="\sf\os\kernelhwsrv\kerneltest\f32test\loader\base_loader.mrp"/>
-			<unit name="f32test_rofs" unitID="sos.f32test_rofs" bldFile="\sf\os\kernelhwsrv\kerneltest\f32test\rofs" mrp=""/>
-			<unit name="f32test_shostmassstorage" unitID="sos.f32test_shostmassstorage" bldFile="\sf\os\kernelhwsrv\kerneltest\f32test\shostmassstorage" mrp=""/>
-			<unit name="f32test_tools" unitID="sos.f32test_tools" bldFile="\sf\os\kernelhwsrv\kerneltest\f32test\tools" mrp=""/>
-		</module>
-
-        <!--
-		<module name="KHS_Test_SDIOTest"> 
-			<unit name="sdiotest" unitID="sos.sdiotest" bldFile="\sf\os\kernelhwsrv\kerneltest\sdiotest" mrp="\sf\os\kernelhwsrv\kerneltest\sdiotest\base_sdiotests.mrp"/>
-			<unit name="sdiotest_restricted" unitID="sos.sdiotest_restricted" bldFile="\sf\os\kernelhwsrv\kerneltest\sdiotest_restricted" mrp="\sf\os\kernelhwsrv\kerneltest\sdiotest_restricted\base_sdiotests_restricted.mrp"/>
-		</module>
-
-
-		<module name="BSP_Test_Emulator"> 
-			<unit name="emulatorbsp_test" unitID="sos.emulatorbsp_test" bldFile="\sf\os\boardsupport\emulator\emulatorbsp\test" mrp=""/>
-		</module>
-		<module name="BSP_Test_NaviEngine"> 
-			<unit name="navienginebsp_ne1_tb_test" unitID="sos.navienginebsp_ne1_tb_test" bldFile="\sf\os\boardsupport\naviengine\navienginebsp\ne1_tb\test" mrp=""/>
-			<unit name="navienginebspflexible_test" unitID="sos.navienginebspflexible_test" bldFile="\sf\os\boardsupport\naviengine\navienginebspflexible\test" mrp=""/>
-		</module>
-		<module name="BSP_Test_OMAPH2"> 
-			<unit name="omaph2bsp_h2_test" unitID="sos.omaph2bsp_h2_test" bldFile="\sf\os\boardsupport\omaph2\omaph2bsp\h2\test" mrp=""/>
-		</module>
-		-->
-
-		<module name="BSP_Test_OMAP3Variants"> 
-			<unit name="34xx_sdp_flexible_test" unitID="sos.34xx_sdp_flexible_test" bldFile="\sf\os\boardsupport\omap3variants\tiomap3bsp\variant\34xx_sdp\flexible\test" mrp=""/>
-			<unit name="34xx_sdp_test" unitID="sos.34xx_sdp_test" bldFile="\sf\os\boardsupport\omap3variants\tiomap3bsp\variant\34xx_sdp\test" mrp=""/>
-			<unit name="lab_test" unitID="sos.lab_test" bldFile="\sf\os\boardsupport\omap3variants\tiomap3bsp\variant\lab\test" mrp=""/>
-		</module>
-		<module name="BSP_Test_OMAPH4"> 
-			<unit name="omaph4bsp_h4_test" unitID="sos.omaph4bsp_h4_test" bldFile="\sf\os\boardsupport\omaph4\omaph4bsp\h4\test" mrp=""/>
-			<unit name="omaph4bsp_h4_flexible_test" unitID="sos.omaph4bsp_h4_flexible_test" bldFile="\sf\os\boardsupport\omaph4\omaph4bsp\h4\flexible\test" mrp=""/>
-		</module>
-	</layer>
-  </systemModel>
-</SystemDefinition>
--- a/halservices/hal/bld.inf	Tue Aug 31 16:34:26 2010 +0300
+++ b/halservices/hal/bld.inf	Wed Sep 01 12:34:56 2010 +0100
@@ -41,6 +41,9 @@
 rom/haltests.iby		/epoc32/rom/include/haltests.iby
 rom/haltests.auto.bat	/epoc32/rom/include/haltests.auto.bat
 
+rom/tshell_haltests.oby	 ../../kernel/eka/rombuild/tshell_haltests.oby
+
+
 
 PRJ_MMPFILES
 src/hal_lib
--- a/halservices/hal/inc/hal_data.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/halservices/hal/inc/hal_data.h	Wed Sep 01 12:34:56 2010 +0100
@@ -114,7 +114,7 @@
 		@see HALData::TCPU
 		*/
 		ECPU,
-		
+		  
 		
 		/**
 		A revision number for the CPU architecture.
@@ -1097,14 +1097,12 @@
 		Serial number of this board
 		*/
 		ESerialNumber,
-		
-		
+				
 		/**
 		Interrupt used by sampling profiler - applicable for SMP only. Each CPU_i is interrupted by interrupt number ECpuProfilingInterrupt + i
 		*/
 		ECpuProfilingDefaultInterruptBase,
 
-
 		/**
 		Number of processors present on the device. Returns 1 on unicore. This number is constant and does not take account of power management
 		*/
--- a/kernel/eka/base_e32.history.xml	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<relnotes name="Kernel Architecture 2">
-  <purpose>
-  </purpose>
-
-  <minorchange revision="001">
-    MINOR CHANGE: Improved test code T_Match by adding more cases to test for INC092513 (SYSLIB-UNICODE-CT-3337)
-  </minorchange>
-</relnotes>
--- a/kernel/eka/bld.inf	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/bld.inf	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-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"
@@ -41,6 +41,7 @@
 #include "drivers/media/bld.inf"
 #include "drivers/trace/bld.inf"
 #include "drivers/usbc/bld.inf"
+#include "drivers/camerasc/bld.inf"
 #include "drivers/display/bld.inf"
 #include "euser/bld.inf"
 #include "ewsrv/bld.inf"
@@ -114,7 +115,6 @@
 include/kernel/sproperty.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(kernel/)
 include/kernel/kernboot.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(kernel/)
 include/kernel/kbma.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(kernel/)
-include/kernel/kerncorestats.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(kernel/)
 
 // Export a stub localisation header under the old name. This just inclides "localise.h" ...
 include/kernel/ls_std.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(kernel/)
@@ -201,21 +201,14 @@
 include/drivers/ethernet.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
 include/drivers/ethernet.inl					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
 include/drivers/dma.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
-include/drivers/dma_v1.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
-include/drivers/dma_v1.inl						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
-include/drivers/dma_v2.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
-include/drivers/dma_v2.inl						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
-include/drivers/dmadefs.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
-include/drivers/dma_compat.inl					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
-include/drivers/dma_hai.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
-include/drivers/dma_hai.inl						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
+include/drivers/dma.inl							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
 include/drivers/iic.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
 include/drivers/iic.inl							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
 include/drivers/iic_channel.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
 include/drivers/iic_channel.inl					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
 include/drivers/iic_trace.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
-include/drivers/iic_transaction.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
-include/drivers/iic_transaction.inl				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
+include/drivers/iic_transaction.h				drivers/						//
+include/drivers/iic_transaction.inl				drivers/
 
 include/drivers/gpio.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
 include/drivers/mmccd_ifc.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
@@ -241,12 +234,16 @@
 include/drivers/usbdi_hub.h                     drivers/						//
 include/drivers/usbdi_channel.h                 drivers/						//
 
+include/drivers/camerasc.h						drivers/						//
+include/drivers/camerasc.inl					drivers/						//
+
 include/drivers/otgdi.h                         drivers/
 
 include/drivers/crashflash.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
 include/drivers/crashflashnor.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
 include/drivers/crashflashnand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
 
+include/rm_debug_api.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(rm_debug_api.h)
 include/sm_debug_api.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(sm_debug_api.h)
 
 include/drivers/resourceman.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
@@ -257,8 +254,6 @@
 include/drivers/resourcecontrol_trace.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
 include/drivers/resource_category.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
 include/drivers/resource_extend.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
-include/drivers/resourcecontrol_settings.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
-include/drivers/resourcecontrol_clientsettings.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
 
 // Power Resource Manager User-Side API
 include/drivers/resmanus_trace.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(drivers/)
@@ -360,6 +355,8 @@
 include/d32usbdi_hubdriver.inl					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(d32usbdi_hubdriver.inl)
 include/d32usbtransfers.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(d32usbtransfers.h)
 include/d32usbdescriptors.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(d32usbdescriptors.h)
+include/d32camerasc.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(d32camerasc.h)
+include/d32camerasc.inl							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(d32camerasc.inl)
 include/d32otgdi.h								SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(d32otgdi.h)
 include/d32otgdi.inl							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(d32otgdi.inl)
 include/d32otgdi_errors.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(d32otgdi_errors.h)
@@ -374,8 +371,6 @@
 include/d32resmanus.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(d32resmanus.h)
 include/d32resmanus.inl							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(d32resmanus.inl)
 
-include/heap_hybrid.h							SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(kernel/)
-
 //Unified Trace Framework API
 include/e32utf.h								SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(e32utf.h)
 include/e32utrace.inl							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(e32utrace.inl)
@@ -383,20 +378,20 @@
 include/e32utrace.mmh							SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(e32utrace.mmh)
 
 //Open System Trace API
-include/opensystemtrace.h                       SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(opensystemtrace.h)
-include/opensystemtrace.inl                     SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(opensystemtrace.inl)
-include/opensystemtrace_types.h                 SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(opensystemtrace_types.h)
-include/opensystemtrace.mmh                     SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(opensystemtrace.mmh)
+include/opensystemtrace.h					/epoc32/include/platform/
+include/opensystemtrace.inl					/epoc32/include/platform/
+include/opensystemtrace_types.h					/epoc32/include/platform/
+include/opensystemtrace.mmh					/epoc32/include/platform/
 
 // ROM building scripts
-rombuild/base.iby								/epoc32/rom/include/
-rombuild/PlatSecEnforcement.oby					/epoc32/rom/include/
-rombuild/PlatSecDiagnostics.oby					/epoc32/rom/include/
-rombuild/btrace.iby								/epoc32/rom/include/
+rombuild/base.iby								/epoc32/rom/include/			//
+rombuild/PlatSecEnforcement.oby					/epoc32/rom/include/			//
+rombuild/PlatSecDiagnostics.oby					/epoc32/rom/include/			//
+rombuild/btrace.iby								/epoc32/rom/include/			//
 rombuild/kernel.hby								/epoc32/rom/include/
-rombuild/sm_debug.iby						    /epoc32/rom/include/			
-rombuild/utrace.iby								/epoc32/rom/include/
-rombuild/ost.iby								/epoc32/rom/include/
+rombuild/rm_debug_svr.iby						/epoc32/rom/include/			// Run mode debug driver
+rombuild/utrace.iby								/epoc32/rom/include/			//utrace
+rombuild/ost.iby								/epoc32/rom/include/			//ost
 
 // Byte pair compressor
 include/byte_pair_compress.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(byte_pair_compress.h)
--- a/kernel/eka/bmarm/dma2u.def	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-EXPORTS
-	__18TDmaTransferConfigUlUiUiUiiiUiUi13TDmaBurstSizeUiUii @ 1 NONAME ; TDmaTransferConfig::TDmaTransferConfig(unsigned long, unsigned int, unsigned int, unsigned int, int, int, unsigned int, unsigned int, TDmaBurstSize, unsigned int, unsigned int, int)
-	CancelAll__11TDmaChannel @ 2 NONAME R3UNUSED ; TDmaChannel::CancelAll(void)
-	Close__11TDmaChannel @ 3 NONAME R3UNUSED ; TDmaChannel::Close(void)
-	DisableDstElementCounting__11DDmaRequest @ 4 NONAME R3UNUSED ; DDmaRequest::DisableDstElementCounting(void)
-	DisableSrcElementCounting__11DDmaRequest @ 5 NONAME R3UNUSED ; DDmaRequest::DisableSrcElementCounting(void)
-	DmaTestInfoV2__Fv @ 6 NONAME R3UNUSED ; DmaTestInfoV2(void)
-	DmaTestInfo__Fv @ 7 NONAME R3UNUSED ; DmaTestInfo(void)
-	DmacCaps__11TDmaChannel @ 8 NONAME R3UNUSED ; TDmaChannel::DmacCaps(void)
-	DstFragmentCount__11DDmaRequest @ 9 NONAME R3UNUSED ; DDmaRequest::DstFragmentCount(void)
-	EnableDstElementCounting__11DDmaRequesti @ 10 NONAME R3UNUSED ; DDmaRequest::EnableDstElementCounting(int)
-	EnableSrcElementCounting__11DDmaRequesti @ 11 NONAME R3UNUSED ; DDmaRequest::EnableSrcElementCounting(int)
-	ExpandDesList__11DDmaRequesti @ 12 NONAME R3UNUSED ; DDmaRequest::ExpandDesList(int)
-	ExpandDstDesList__11DDmaRequesti @ 13 NONAME R3UNUSED ; DDmaRequest::ExpandDstDesList(int)
-	ExpandSrcDesList__11DDmaRequesti @ 14 NONAME R3UNUSED ; DDmaRequest::ExpandSrcDesList(int)
-	Extension__11TDmaChanneliPv @ 15 NONAME R3UNUSED ; TDmaChannel::Extension(int, void *)
-	FailNext__11TDmaChanneli @ 16 NONAME R3UNUSED ; TDmaChannel::FailNext(int)
-	FragmentCount__11DDmaRequest @ 17 NONAME R3UNUSED ; DDmaRequest::FragmentCount(void)
-	Fragment__11DDmaRequestRC16TDmaTransferArgs @ 18 NONAME R3UNUSED ; DDmaRequest::Fragment(TDmaTransferArgs const &)
-	Fragment__11DDmaRequestUlUliUiUl @ 19 NONAME ; DDmaRequest::Fragment(unsigned long, unsigned long, int, unsigned int, unsigned long)
-	FreeDesList__11DDmaRequest @ 20 NONAME R3UNUSED ; DDmaRequest::FreeDesList(void)
-	FreeDstDesList__11DDmaRequest @ 21 NONAME R3UNUSED ; DDmaRequest::FreeDstDesList(void)
-	FreeSrcDesList__11DDmaRequest @ 22 NONAME R3UNUSED ; DDmaRequest::FreeSrcDesList(void)
-	IsrRedoRequest__11TDmaChannelUlUlUiUli @ 23 NONAME ; TDmaChannel::IsrRedoRequest(unsigned long, unsigned long, unsigned int, unsigned long, int)
-	LinkToChannel__11TDmaChannelP11TDmaChannel @ 24 NONAME R3UNUSED ; TDmaChannel::LinkToChannel(TDmaChannel *)
-	MaxTransferLength__11TDmaChannelUiUiUl @ 25 NONAME ; TDmaChannel::MaxTransferLength(unsigned int, unsigned int, unsigned long)
-	MissNextInterrupts__11TDmaChanneli @ 26 NONAME R3UNUSED ; TDmaChannel::MissNextInterrupts(int)
-	Open__11TDmaChannelRCQ211TDmaChannel11SCreateInfoRP11TDmaChannel @ 27 NONAME R3UNUSED ; TDmaChannel::Open(TDmaChannel::SCreateInfo const &, TDmaChannel *&)
-	Pause__11TDmaChannel @ 28 NONAME R3UNUSED ; TDmaChannel::Pause(void)
-	Queue__11DDmaRequest @ 29 NONAME R3UNUSED ; DDmaRequest::Queue(void)
-	Resume__11TDmaChannel @ 30 NONAME R3UNUSED ; TDmaChannel::Resume(void)
-	SrcFragmentCount__11DDmaRequest @ 31 NONAME R3UNUSED ; DDmaRequest::SrcFragmentCount(void)
-	StaticExtension__11TDmaChanneliPv @ 32 NONAME R3UNUSED ; TDmaChannel::StaticExtension(int, void *)
-	TotalNumDstElementsTransferred__11DDmaRequest @ 33 NONAME R3UNUSED ; DDmaRequest::TotalNumDstElementsTransferred(void)
-	TotalNumSrcElementsTransferred__11DDmaRequest @ 34 NONAME R3UNUSED ; DDmaRequest::TotalNumSrcElementsTransferred(void)
-	"_._11DDmaRequest" @ 35 NONAME R3UNUSED ; DDmaRequest::~DDmaRequest(void)
-	__11DDmaRequestR11TDmaChannelPFQ211DDmaRequest7TResultPv_vPvi @ 36 NONAME ; DDmaRequest::DDmaRequest(TDmaChannel &, void (*)(DDmaRequest::TResult, void *), void *, int)
-	__11DDmaRequestR11TDmaChannelPFUi10TDmaResultPvP10SDmaDesHdr_vPvUi @ 37 NONAME ; DDmaRequest::DDmaRequest(TDmaChannel &, void (*)(unsigned int, TDmaResult, void *, SDmaDesHdr *), void *, unsigned int)
-	__16TDmaTransferArgs @ 38 NONAME R3UNUSED ; TDmaTransferArgs::TDmaTransferArgs(void)
-	__16TDmaTransferArgsRC18TDmaTransferConfigT1UlUiUi15TDmaGraphicsOpsUl @ 39 NONAME ; TDmaTransferArgs::TDmaTransferArgs(TDmaTransferConfig const &, TDmaTransferConfig const &, unsigned long, unsigned int, unsigned int, TDmaGraphicsOps, unsigned long)
-	__16TDmaTransferArgsUiUiUiUiUiUi12TDmaAddrModeUiUi13TDmaBurstSizeUi15TDmaGraphicsOpsUl @ 40 NONAME ; TDmaTransferArgs::TDmaTransferArgs(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, TDmaAddrMode, unsigned int, unsigned int, TDmaBurstSize, unsigned int, TDmaGraphicsOps, unsigned long)
-	__18TDmaTransferConfig @ 41 NONAME R3UNUSED ; TDmaTransferConfig::TDmaTransferConfig(void)
-	__18TDmaTransferConfigUlUi12TDmaAddrModeUi13TDmaBurstSizeUiUiUii @ 42 NONAME ; TDmaTransferConfig::TDmaTransferConfig(unsigned long, unsigned int, TDmaAddrMode, unsigned int, TDmaBurstSize, unsigned int, unsigned int, unsigned int, int)
-	AddressAlignMask__11TDmaChannelUiUiUl @ 43 NONAME ; TDmaChannel::AddressAlignMask(unsigned int, unsigned int, unsigned long)
-
--- a/kernel/eka/bmarm/ekernsmp.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/bmarm/ekernsmp.def	Wed Sep 01 12:34:56 2010 +0100
@@ -1047,15 +1047,13 @@
 	RandomSalt__4KernPCUcUiUi @ 1046 NONAME R3UNUSED ; Kern::RandomSalt(unsigned char const *, unsigned int, unsigned int)
 	SecureRandom__4KernR5TDes8 @ 1047 NONAME R3UNUSED ; Kern::SecureRandom(TDes8 &)
 	NotificationLock__13DPagingDevice @ 1048 NONAME R3UNUSED ; DPagingDevice::NotificationLock(void)
-	Configure__13KernCoreStatsUi @ 1049 NONAME R3UNUSED ; KernCoreStats::Configure(unsigned int)
-	Engage__13KernCoreStatsi @ 1050 NONAME R3UNUSED ; KernCoreStats::Engage(int)
-	Retire__13KernCoreStatsii @ 1051 NONAME R3UNUSED ; KernCoreStats::Retire(int, int)
-	Stats__13KernCoreStatsPv @ 1052 NONAME R3UNUSED ; KernCoreStats::Stats(void *)
-	SetNumberOfActiveCpus__5NKerni @ 1053 NONAME
-	SetIdleHandler__3ArmPFPvUlPVv_vPv @ 1054 NONAME R3UNUSED ; Arm::SetIdleHandler(void (*)(void *, unsigned long, void volatile *), void *)
-	FreeRamZone__4EpocUi @ 1055 NONAME R3UNUSED ; Epoc::FreeRamZone(unsigned int)
+	Configure__13KernCoreStatsUi @ 1049 NONAME R3UNUSED ABSENT ; KernCoreStats::Configure(unsigned int)
+	Engage__13KernCoreStatsi @ 1050 NONAME R3UNUSED ABSENT ; KernCoreStats::Engage(int)
+	Retire__13KernCoreStatsii @ 1051 NONAME R3UNUSED ABSENT ; KernCoreStats::Retire(int, int)
+	Stats__13KernCoreStatsPv @ 1052 NONAME R3UNUSED ABSENT ; KernCoreStats::Stats(void *)
+	SetNumberOfActiveCpus__5NKerni @ 1053 NONAME ABSENT
+	SetIdleHandler__3ArmPFPvUlPVv_vPv @ 1054 NONAME R3UNUSED ABSENT ; Arm::SetIdleHandler(void (*)(void *, unsigned long, void volatile *), void *)
+	FreeRamZone__4EpocUi @ 1055 NONAME R3UNUSED ABSENT ; Epoc::FreeRamZone(unsigned int)
 	SelectiveAlloc__16TBitMapAllocatorii @ 1056 NONAME R3UNUSED ; TBitMapAllocator::SelectiveAlloc(int, int)
 	SetKeyOffset__10RArrayBasei @ 1057  NONAME R3UNUSED ; RArrayBase::SetKeyOffset(int)
-	CpuRetires__5Cache @ 1058 NONAME R3UNUSED ; Cache::CpuRetires(void)
-	KernelRetires__5Cache @ 1059 NONAME R3UNUSED ; Cache::KernelRetires(void)
 
--- a/kernel/eka/bmarm/ekernu.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/bmarm/ekernu.def	Wed Sep 01 12:34:56 2010 +0100
@@ -1043,15 +1043,13 @@
 	RandomSalt__4KernPCUcUiUi @ 1042 NONAME R3UNUSED ; Kern::RandomSalt(unsigned char const *, unsigned int, unsigned int)
 	SecureRandom__4KernR5TDes8 @ 1043 NONAME R3UNUSED ; Kern::SecureRandom(TDes8 &)
 	NotificationLock__13DPagingDevice @ 1044 NONAME R3UNUSED ; DPagingDevice::NotificationLock(void)
-	Configure__13KernCoreStatsUi @ 1045 NONAME R3UNUSED ; KernCoreStats::Configure(unsigned int)
-	Engage__13KernCoreStatsi @ 1046 NONAME R3UNUSED ; KernCoreStats::Engage(int)
-	EnterIdle__13KernCoreStats @ 1047 NONAME R3UNUSED ; KernCoreStats::EnterIdle()
-	LeaveIdle__13KernCoreStatsUi @ 1048 NONAME R3UNUSED ; KernCoreStats::LeaveIdle(unsigned int)
-	Retire__13KernCoreStatsii @ 1049 NONAME R3UNUSED ; KernCoreStats::Retire(int, int)
-	Stats__13KernCoreStatsPv @ 1050 NONAME R3UNUSED ; KernCoreStats::Stats(void *)
-	SetIdleHandler__3ArmPFPvUl_vPv @ 1051 NONAME R3UNUSED ; Arm::SetIdleHandler(void (*)(void *, unsigned long), void *)
-	FreeRamZone__4EpocUi @ 1052 NONAME R3UNUSED ; Epoc::FreeRamZone(unsigned int)
+	Configure__13KernCoreStatsUi @ 1045 NONAME R3UNUSED ABSENT ; KernCoreStats::Configure(unsigned int)
+	Engage__13KernCoreStatsi @ 1046 NONAME R3UNUSED ABSENT ; KernCoreStats::Engage(int)
+	EnterIdle__13KernCoreStats @ 1047 NONAME R3UNUSED ABSENT ; KernCoreStats::EnterIdle()
+	LeaveIdle__13KernCoreStatsUi @ 1048 NONAME R3UNUSED ABSENT ; KernCoreStats::LeaveIdle(unsigned int)
+	Retire__13KernCoreStatsii @ 1049 NONAME R3UNUSED ABSENT ; KernCoreStats::Retire(int, int)
+	Stats__13KernCoreStatsPv @ 1050 NONAME R3UNUSED ABSENT ; KernCoreStats::Stats(void *)
+	SetIdleHandler__3ArmPFPvUl_vPv @ 1051 NONAME R3UNUSED ABSENT ; Arm::SetIdleHandler(void (*)(void *, unsigned long), void *)
+	FreeRamZone__4EpocUi @ 1052 NONAME R3UNUSED ABSENT ; Epoc::FreeRamZone(unsigned int)
 	SelectiveAlloc__16TBitMapAllocatorii @ 1053 NONAME R3UNUSED ; TBitMapAllocator::SelectiveAlloc(int, int)
 	SetKeyOffset__10RArrayBasei @ 1054  NONAME R3UNUSED ; RArrayBase::SetKeyOffset(int)
-	CpuRetires__5Cache @ 1055 NONAME R3UNUSED ; Cache::CpuRetires(void)
-	KernelRetires__5Cache @ 1056 NONAME R3UNUSED ; Cache::KernelRetires(void)
--- a/kernel/eka/bmarm/euseru.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/bmarm/euseru.def	Wed Sep 01 12:34:56 2010 +0100
@@ -620,7 +620,7 @@
 	FsRegisterThread__7UserSvr @ 619 NONAME R3UNUSED ; UserSvr::FsRegisterThread(void)
 	FullName__C11RHandleBase @ 620 NONAME R3UNUSED ; RHandleBase::FullName(void) const
 	FullName__C7CObject @ 621 NONAME R3UNUSED ; CObject::FullName(void) const
-	GetAddress__C5RHeapPCv @ 622 NONAME R3UNUSED ABSENT ; RHeap::GetAddress(void const *) const
+	GetAddress__C5RHeapPCv @ 622 NONAME R3UNUSED ; RHeap::GetAddress(void const *) const
 	GetBdCategory__C5TChar @ 623 NONAME R3UNUSED ; TChar::GetBdCategory(void) const
 	GetCaps__C7RDeviceR5TDes8 @ 624 NONAME R3UNUSED ; RDevice::GetCaps(TDes8 &) const
 	GetCategory__C5TChar @ 625 NONAME R3UNUSED ; TChar::GetCategory(void) const
@@ -1616,8 +1616,8 @@
 	__5RBuf8 @ 1615 NONAME R3UNUSED ; RBuf8::RBuf8(void)
 	__5RBuf8P6HBufC8 @ 1616 NONAME R3UNUSED ; RBuf8::RBuf8(HBufC8 *)
 	__5RBuf8iii @ 1617 NONAME ; RBuf8::RBuf8(int, int, int)
-	__5RHeapiii @ 1618 NONAME ABSENT ; RHeap::RHeap(int, int, int)
-	__5RHeapiiiiiii @ 1619 NONAME ABSENT ; RHeap::RHeap(int, int, int, int, int, int, int)
+	__5RHeapiii @ 1618 NONAME ; RHeap::RHeap(int, int, int)
+	__5RHeapiiiiiii @ 1619 NONAME ; RHeap::RHeap(int, int, int, int, int, int, int)
 	__5RTestRC7TDesC16 @ 1620 NONAME R3UNUSED ; RTest::RTest(TDesC16 const &)
 	__5RTestRC7TDesC16i @ 1621 NONAME R3UNUSED ; RTest::RTest(TDesC16 const &, int)
 	__5RTestRC7TDesC16iPCUs @ 1622 NONAME ; RTest::RTest(TDesC16 const &, int, unsigned short const *)
@@ -1832,7 +1832,7 @@
 	__negdi2 @ 1831 NONAME ; (null)
 	__negsf2 @ 1832 NONAME ; (null)
 	__nesf2 @ 1833 NONAME ; (null)
-	__nw__5RHeapUiPv @ 1834 NONAME R3UNUSED ABSENT ; RHeap::operator new(unsigned int, void *)
+	__nw__5RHeapUiPv @ 1834 NONAME R3UNUSED ; RHeap::operator new(unsigned int, void *)
 	__nw__FUiUi @ 1835 NONAME R3UNUSED ; operator new(unsigned int, unsigned int)
 	__opUi__C6TRealX @ 1836 NONAME R3UNUSED ; TRealX::operator unsigned int(void) const
 	__opd__C6TRealX @ 1837 NONAME R3UNUSED ; TRealX::operator double(void) const
@@ -2234,43 +2234,38 @@
 	RandomL__4MathR5TDes8 @ 2233 NONAME R3UNUSED ; Math::RandomL(TDes8 &)
 	RandomL__4Math @ 2234 NONAME R3UNUSED ; Math::RandomL(void)
 	Random__4MathR5TDes8 @ 2235 NONAME R3UNUSED ; Math::Random(TDes8 &)
-	Append2__6TDes16G5TChar @ 2236  NONAME R3UNUSED ; TDes16::Append2(TChar)
-	AppendFill2__6TDes16G5TChari @ 2237  NONAME R3UNUSED ; TDes16::AppendFill2(TChar, int)
-	AppendJustify2__6TDes16PCUsi6TAlignG5TChar @ 2238  NONAME ; TDes16::AppendJustify2(unsigned short const *, int, TAlign, TChar)
-	AppendJustify2__6TDes16PCUsii6TAlignG5TChar @ 2239  NONAME ; TDes16::AppendJustify2(unsigned short const *, int, int, TAlign, TChar)
-	AppendJustify2__6TDes16RC7TDesC16i6TAlignG5TChar @ 2240  NONAME ; TDes16::AppendJustify2(TDesC16 const &, int, TAlign, TChar)
-	AppendJustify2__6TDes16RC7TDesC16ii6TAlignG5TChar @ 2241  NONAME ; TDes16::AppendJustify2(TDesC16 const &, int, int, TAlign, TChar)
-	Capitalize2__6TDes16 @ 2242  NONAME R3UNUSED ; TDes16::Capitalize2(void)
-	Collate2__6TDes16 @ 2243  NONAME R3UNUSED ; TDes16::Collate2(void)
-	CopyC2__6TDes16RC7TDesC16 @ 2244  NONAME R3UNUSED ; TDes16::CopyC2(TDesC16 const &)
-	CopyCP2__6TDes16RC7TDesC16 @ 2245  NONAME R3UNUSED ; TDes16::CopyCP2(TDesC16 const &)
-	CopyF2__6TDes16RC7TDesC16 @ 2246  NONAME R3UNUSED ; TDes16::CopyF2(TDesC16 const &)
-	CopyLC2__6TDes16RC7TDesC16 @ 2247  NONAME R3UNUSED ; TDes16::CopyLC2(TDesC16 const &)
-	CopyUC2__6TDes16RC7TDesC16 @ 2248  NONAME R3UNUSED ; TDes16::CopyUC2(TDesC16 const &)
-	Fill2__6TDes16G5TChar @ 2249  NONAME R3UNUSED ; TDes16::Fill2(TChar)
-	Fill2__6TDes16G5TChari @ 2250  NONAME R3UNUSED ; TDes16::Fill2(TChar, int)
-	FindCorruptSurrogate__C7TDesC16 @ 2251  NONAME R3UNUSED ; TDesC16::FindCorruptSurrogate(void) const
-	Fold2__6TDes16 @ 2252  NONAME R3UNUSED ; TDes16::Fold2(void)
-	Justify2__6TDes16RC7TDesC16i6TAlignG5TChar @ 2253  NONAME ; TDes16::Justify2(TDesC16 const &, int, TAlign, TChar)
-	Locate2__C7TDesC16G5TChar @ 2254  NONAME R3UNUSED ; TDesC16::Locate2(TChar) const
-	LocateF2__C7TDesC16G5TChar @ 2255  NONAME R3UNUSED ; TDesC16::LocateF2(TChar) const
-	LocateReverse2__C7TDesC16G5TChar @ 2256  NONAME R3UNUSED ; TDesC16::LocateReverse2(TChar) const
-	LocateReverseF2__C7TDesC16G5TChar @ 2257  NONAME R3UNUSED ; TDesC16::LocateReverseF2(TChar) const
-	LowerCase2__6TDes16 @ 2258  NONAME R3UNUSED ; TDes16::LowerCase2(void)
-	Match2__C7TDesC16RC7TDesC16 @ 2259  NONAME R3UNUSED ; TDesC16::Match2(TDesC16 const &) const
-	UpperCase2__6TDes16 @ 2260  NONAME R3UNUSED ; TDes16::UpperCase2(void)
-	AgainHighRes__6RTimerR14TRequestStatusG27TTimeIntervalMicroSeconds32 @ 2261 NONAME R3UNUSED ; RTimer::AgainHighRes(TRequestStatus &, TTimeIntervalMicroSeconds32)
-	Align__C10RAllocatorPv @ 2262 NONAME R3UNUSED ; RAllocator::Align(void *) const
-	Align__C10RAllocatori @ 2263 NONAME R3UNUSED ; RAllocator::Align(int) const
-	Base__C10RAllocator @ 2264 NONAME R3UNUSED ; RAllocator::Base(void) const
-	MaxLength__C10RAllocator @ 2265 NONAME R3UNUSED ; RAllocator::MaxLength(void) const
-	Size__C10RAllocator @ 2266 NONAME R3UNUSED ; RAllocator::Size(void) const
-	__DbgGetAllocFail__10RAllocator @ 2267 NONAME R3UNUSED ; RAllocator::__DbgGetAllocFail(void)
-	__DbgGetAllocFail__4Useri @ 2268 NONAME R3UNUSED ; User::__DbgGetAllocFail(int)
+	Append2__6TDes16G5TChar @ 2236  NONAME R3UNUSED ABSENT ; TDes16::Append2(TChar)
+	AppendFill2__6TDes16G5TChari @ 2237  NONAME R3UNUSED ABSENT ; TDes16::AppendFill2(TChar, int)
+	AppendJustify2__6TDes16PCUsi6TAlignG5TChar @ 2238  NONAME ABSENT ; TDes16::AppendJustify2(unsigned short const *, int, TAlign, TChar)
+	AppendJustify2__6TDes16PCUsii6TAlignG5TChar @ 2239  NONAME ABSENT ; TDes16::AppendJustify2(unsigned short const *, int, int, TAlign, TChar)
+	AppendJustify2__6TDes16RC7TDesC16i6TAlignG5TChar @ 2240  NONAME ABSENT ; TDes16::AppendJustify2(TDesC16 const &, int, TAlign, TChar)
+	AppendJustify2__6TDes16RC7TDesC16ii6TAlignG5TChar @ 2241  NONAME ABSENT ; TDes16::AppendJustify2(TDesC16 const &, int, int, TAlign, TChar)
+	Capitalize2__6TDes16 @ 2242  NONAME R3UNUSED ABSENT ; TDes16::Capitalize2(void)
+	Collate2__6TDes16 @ 2243  NONAME R3UNUSED ABSENT ; TDes16::Collate2(void)
+	CopyC2__6TDes16RC7TDesC16 @ 2244  NONAME R3UNUSED ABSENT ; TDes16::CopyC2(TDesC16 const &)
+	CopyCP2__6TDes16RC7TDesC16 @ 2245  NONAME R3UNUSED ABSENT ; TDes16::CopyCP2(TDesC16 const &)
+	CopyF2__6TDes16RC7TDesC16 @ 2246  NONAME R3UNUSED ABSENT ; TDes16::CopyF2(TDesC16 const &)
+	CopyLC2__6TDes16RC7TDesC16 @ 2247  NONAME R3UNUSED ABSENT ; TDes16::CopyLC2(TDesC16 const &)
+	CopyUC2__6TDes16RC7TDesC16 @ 2248  NONAME R3UNUSED ABSENT ; TDes16::CopyUC2(TDesC16 const &)
+	Fill2__6TDes16G5TChar @ 2249  NONAME R3UNUSED ABSENT ; TDes16::Fill2(TChar)
+	Fill2__6TDes16G5TChari @ 2250  NONAME R3UNUSED ABSENT ; TDes16::Fill2(TChar, int)
+	FindCorruptSurrogate__C7TDesC16 @ 2251  NONAME R3UNUSED ABSENT ; TDesC16::FindCorruptSurrogate(void) const
+	Fold2__6TDes16 @ 2252  NONAME R3UNUSED ABSENT ; TDes16::Fold2(void)
+	Justify2__6TDes16RC7TDesC16i6TAlignG5TChar @ 2253  NONAME ABSENT ; TDes16::Justify2(TDesC16 const &, int, TAlign, TChar)
+	Locate2__C7TDesC16G5TChar @ 2254  NONAME R3UNUSED ABSENT ; TDesC16::Locate2(TChar) const
+	LocateF2__C7TDesC16G5TChar @ 2255  NONAME R3UNUSED ABSENT ; TDesC16::LocateF2(TChar) const
+	LocateReverse2__C7TDesC16G5TChar @ 2256  NONAME R3UNUSED ABSENT ; TDesC16::LocateReverse2(TChar) const
+	LocateReverseF2__C7TDesC16G5TChar @ 2257  NONAME R3UNUSED ABSENT ; TDesC16::LocateReverseF2(TChar) const
+	LowerCase2__6TDes16 @ 2258  NONAME R3UNUSED ABSENT ; TDes16::LowerCase2(void)
+	Match2__C7TDesC16RC7TDesC16 @ 2259  NONAME R3UNUSED ABSENT ; TDesC16::Match2(TDesC16 const &) const
+	UpperCase2__6TDes16 @ 2260  NONAME R3UNUSED ABSENT ; TDes16::UpperCase2(void)
+	AgainHighRes__6RTimerR14TRequestStatusG27TTimeIntervalMicroSeconds32 @ 2261 NONAME R3UNUSED ABSENT ; RTimer::AgainHighRes(TRequestStatus &, TTimeIntervalMicroSeconds32)
+	Align__C10RAllocatorPv @ 2262 NONAME R3UNUSED ABSENT ; RAllocator::Align(void *) const
+	Align__C10RAllocatori @ 2263 NONAME R3UNUSED ABSENT ; RAllocator::Align(int) const
+	Base__C10RAllocator @ 2264 NONAME R3UNUSED ABSENT ; RAllocator::Base(void) const
+	MaxLength__C10RAllocator @ 2265 NONAME R3UNUSED ABSENT ; RAllocator::MaxLength(void) const
+	Size__C10RAllocator @ 2266 NONAME R3UNUSED ABSENT ; RAllocator::Size(void) const
+	__DbgGetAllocFail__10RAllocator @ 2267 NONAME R3UNUSED ABSENT ; RAllocator::__DbgGetAllocFail(void)
+	__DbgGetAllocFail__4Useri @ 2268 NONAME R3UNUSED ABSENT ; User::__DbgGetAllocFail(int)
 	SetKeyOffset__10RArrayBasei @ 2269  NONAME R3UNUSED ; RArrayBase::SetKeyOffset(int)
-	Poll__10RSemaphore @ 2270 NONAME R3UNUSED ; RSemaphore::Poll(void)
-	Wait__6RMutexi @ 2271 NONAME R3UNUSED ; RMutex::Wait(int)
-	Poll__6RMutex @ 2272 NONAME R3UNUSED ; RMutex::Poll(void)
-	Poll__9RFastLock @ 2273 NONAME R3UNUSED ; RFastLock::Poll(void)
-	Wait__9RFastLocki @ 2274 NONAME R3UNUSED ; RFastLock::Wait(int)
 	
--- a/kernel/eka/bmarm/usbcscu.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/bmarm/usbcscu.def	Wed Sep 01 12:34:56 2010 +0100
@@ -18,5 +18,4 @@
 	Expire__15TEndpointBuffer @ 17 NONAME R3UNUSED ; TEndpointBuffer::Expire(void)
 	TakeBuffer__15TEndpointBufferRPvRUiRiR14TRequestStatusUi @ 18 NONAME ; TEndpointBuffer::TakeBuffer(void *&, unsigned int &, int &, TRequestStatus &, unsigned int)
 	Expire__15TEndpointBufferPv @ 19 NONAME R3UNUSED ; TEndpointBuffer::Expire(void *)
-	ResetAltSetting__16RDevUsbcScClient @ 20 NONAME R3UNUSED ; RDevUsbcScClient::ResetAltSetting(void)
 
--- a/kernel/eka/bwins/ekernu.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/bwins/ekernu.def	Wed Sep 01 12:34:56 2010 +0100
@@ -930,12 +930,10 @@
 	?RandomSalt@Kern@@SAXPBEII@Z @ 929 NONAME ; void Kern::RandomSalt(unsigned char const *, unsigned int, unsigned int)
 	?SecureRandom@Kern@@SAHAAVTDes8@@@Z @ 930 NONAME ; int Kern::SecureRandom(class TDes8 &)
 	?NotificationLock@DPagingDevice@@QAEPAVNFastMutex@@XZ @ 931 NONAME ; public: class NFastMutex * __thiscall DPagingDevice::NotificationLock(void)
-	?Configure@KernCoreStats@@SAHI@Z @ 932 NONAME	;  public: static int KernCoreStats::Configure(unsigned int)
-	?Engage@KernCoreStats@@SAHH@Z @ 933 NONAME	;  public: static int KernCoreStats::Engage(int)
-	?Retire@KernCoreStats@@SAHHH@Z @ 934 NONAME	;  public: static int KernCoreStats::Retire(int, int)
-	?Stats@KernCoreStats@@SAHPAX@Z @ 935 NONAME	;  public: static int KernCoreStats::Stats(void *)
+	?Configure@KernCoreStats@@SAHI@Z @ 932 NONAME ABSENT ; public: static int KernCoreStats::Configure(unsigned int)
+	?Engage@KernCoreStats@@SAHH@Z @ 933 NONAME ABSENT ; public: static int KernCoreStats::Engage(int)
+	?Retire@KernCoreStats@@SAHHH@Z @ 934 NONAME ABSENT ; public: static int KernCoreStats::Retire(int, int)
+	?Stats@KernCoreStats@@SAHPAX@Z @ 935 NONAME ABSENT ; public: static int KernCoreStats::Stats(void *)
 	?SelectiveAlloc@TBitMapAllocator@@QAEIHH@Z @ 936 NONAME ; public: unsigned int __thiscall TBitMapAllocator::SelectiveAlloc(int,int)
 	?SetKeyOffset@RArrayBase@@IAEXH@Z @ 937  NONAME ; void RArrayBase::SetKeyOffset(int)
-	?CpuRetires@Cache@@SAXXZ @ 938 NONAME ; public: static void __cdecl Cache::CpuRetires(void)
-	?KernelRetires@Cache@@SAXXZ @ 939 NONAME ; public: static void __cdecl Cache::KernelRetires(void)
 
--- a/kernel/eka/bwins/euseru.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/bwins/euseru.def	Wed Sep 01 12:34:56 2010 +0100
@@ -48,8 +48,8 @@
 	??0RBuf8@@QAE@PAVHBufC8@@@Z @ 47 NONAME ; public: __thiscall RBuf8::RBuf8(class HBufC8 *)
 	??0RBuf8@@QAE@XZ @ 48 NONAME ; public: __thiscall RBuf8::RBuf8(void)
 	??0RCriticalSection@@QAE@XZ @ 49 NONAME ; public: __thiscall RCriticalSection::RCriticalSection(void)
-	??0RHeap@@QAE@HHH@Z @ 50 NONAME ABSENT ; public: __thiscall RHeap::RHeap(int,int,int)
-	??0RHeap@@QAE@HHHHHHH@Z @ 51 NONAME ABSENT ; public: __thiscall RHeap::RHeap(int,int,int,int,int,int,int)
+	??0RHeap@@QAE@HHH@Z @ 50 NONAME ; public: __thiscall RHeap::RHeap(int,int,int)
+	??0RHeap@@QAE@HHHHHHH@Z @ 51 NONAME ; public: __thiscall RHeap::RHeap(int,int,int,int,int,int,int)
 	??0RMessage2@@QAE@ABVRMessagePtr2@@@Z @ 52 NONAME ; public: __thiscall RMessage2::RMessage2(class RMessagePtr2 const &)
 	??0RNotifier@@QAE@XZ @ 53 NONAME ; public: __thiscall RNotifier::RNotifier(void)
 	??0RPointerArrayBase@@IAE@H@Z @ 54 NONAME ; protected: __thiscall RPointerArrayBase::RPointerArrayBase(int)
@@ -216,7 +216,7 @@
 	??1CSession2@@UAE@XZ @ 215 NONAME ; public: virtual __thiscall CSession2::~CSession2(void)
 	??1CTimer@@UAE@XZ @ 216 NONAME ; public: virtual __thiscall CTimer::~CTimer(void)
 	??1CTrapCleanup@@UAE@XZ @ 217 NONAME ; public: virtual __thiscall CTrapCleanup::~CTrapCleanup(void)
-	??2RHeap@@SAPAXIPAX@Z @ 218 NONAME ABSENT ; public: static void * __cdecl RHeap::operator new(unsigned int,void *)
+	??2RHeap@@SAPAXIPAX@Z @ 218 NONAME ; public: static void * __cdecl RHeap::operator new(unsigned int,void *)
 	??4HBufC16@@QAEAAV0@ABVTDesC16@@@Z @ 219 NONAME ; public: class HBufC16 & __thiscall HBufC16::operator=(class TDesC16 const &)
 	??4HBufC16@@QAEAAV0@PBG@Z @ 220 NONAME ; public: class HBufC16 & __thiscall HBufC16::operator=(unsigned short const *)
 	??4HBufC8@@QAEAAV0@ABVTDesC8@@@Z @ 221 NONAME ; public: class HBufC8 & __thiscall HBufC8::operator=(class TDesC8 const &)
@@ -943,7 +943,7 @@
 	?Get@RProperty@@SAHVTUid@@IAAVTDes8@@@Z @ 942 NONAME ; public: static int __cdecl RProperty::Get(class TUid,unsigned int,class TDes8 &)
 	?Get@TLex16@@QAE?AVTChar@@XZ @ 943 NONAME ; public: class TChar  __thiscall TLex16::Get(void)
 	?Get@TLex8@@QAE?AVTChar@@XZ @ 944 NONAME ; public: class TChar  __thiscall TLex8::Get(void)
-	?GetAddress@RHeap@@IBEPAUSCell@1@PBX@Z @ 945 NONAME ABSENT ; protected: struct RHeap::SCell * __thiscall RHeap::GetAddress(void const *)const 
+	?GetAddress@RHeap@@IBEPAUSCell@1@PBX@Z @ 945 NONAME ; protected: struct RHeap::SCell * __thiscall RHeap::GetAddress(void const *)const 
 	?GetBdCategory@TChar@@QBE?AW4TBdCategory@1@XZ @ 946 NONAME ; public: enum TChar::TBdCategory  __thiscall TChar::GetBdCategory(void)const 
 	?GetCaps@RDevice@@QBEXAAVTDes8@@@Z @ 947 NONAME ; public: void __thiscall RDevice::GetCaps(class TDes8 &)const 
 	?GetCategory@TChar@@QBE?AW4TCategory@1@XZ @ 948 NONAME ; public: enum TChar::TCategory  __thiscall TChar::GetCategory(void)const 
@@ -2182,42 +2182,38 @@
 	?RandomL@Math@@SAXAAVTDes8@@@Z @ 2181 NONAME ; void Math::RandomL(class TDes8 &)
 	?Random@Math@@SAXAAVTDes8@@@Z @ 2182 NONAME ; void Math::Random(class TDes8 &)
 	?RandomL@Math@@SAKXZ @ 2183 NONAME ; unsigned long Math::RandomL(void)
-	?Append2@TDes16@@QAEXVTChar@@@Z @ 2184 NONAME ; void TDes16::Append2(class TChar)
-	?CopyC2@TDes16@@QAEXABVTDesC16@@@Z @ 2185 NONAME ; void TDes16::CopyC2(class TDesC16 const &)
-	?Collate2@TDes16@@QAEXXZ @ 2186 NONAME ; void TDes16::Collate2(void)
-	?CopyF2@TDes16@@QAEXABVTDesC16@@@Z @ 2187 NONAME ; void TDes16::CopyF2(class TDesC16 const &)
-	?Fill2@TDes16@@QAEXVTChar@@@Z @ 2188 NONAME ; void TDes16::Fill2(class TChar)
-	?Locate2@TDesC16@@QBEHVTChar@@@Z @ 2189 NONAME ; int TDesC16::Locate2(class TChar) const
-	?AppendFill2@TDes16@@QAEXVTChar@@H@Z @ 2190 NONAME ; void TDes16::AppendFill2(class TChar, int)
-	?AppendJustify2@TDes16@@QAEXABVTDesC16@@HHW4TAlign@@VTChar@@@Z @ 2191 NONAME ; void TDes16::AppendJustify2(class TDesC16 const &, int, int, enum TAlign, class TChar)
-	?AppendJustify2@TDes16@@QAEXPBGHW4TAlign@@VTChar@@@Z @ 2192 NONAME ; void TDes16::AppendJustify2(unsigned short const *, int, enum TAlign, class TChar)
-	?Fold2@TDes16@@QAEXXZ @ 2193 NONAME ; void TDes16::Fold2(void)
-	?AppendJustify2@TDes16@@QAEXABVTDesC16@@HW4TAlign@@VTChar@@@Z @ 2194 NONAME ; void TDes16::AppendJustify2(class TDesC16 const &, int, enum TAlign, class TChar)
-	?LowerCase2@TDes16@@QAEXXZ @ 2195 NONAME ; void TDes16::LowerCase2(void)
-	?CopyUC2@TDes16@@QAEXABVTDesC16@@@Z @ 2196 NONAME ; void TDes16::CopyUC2(class TDesC16 const &)
-	?FindCorruptSurrogate@TDesC16@@QBEHXZ @ 2197 NONAME ; int TDesC16::FindCorruptSurrogate(void) const
-	?Justify2@TDes16@@QAEXABVTDesC16@@HW4TAlign@@VTChar@@@Z @ 2198 NONAME ; void TDes16::Justify2(class TDesC16 const &, int, enum TAlign, class TChar)
-	?UpperCase2@TDes16@@QAEXXZ @ 2199 NONAME ; void TDes16::UpperCase2(void)
-	?Capitalize2@TDes16@@QAEXXZ @ 2200 NONAME ; void TDes16::Capitalize2(void)
-	?AppendJustify2@TDes16@@QAEXPBGHHW4TAlign@@VTChar@@@Z @ 2201 NONAME ; void TDes16::AppendJustify2(unsigned short const *, int, int, enum TAlign, class TChar)
-	?CopyLC2@TDes16@@QAEXABVTDesC16@@@Z @ 2202 NONAME ; void TDes16::CopyLC2(class TDesC16 const &)
-	?Fill2@TDes16@@QAEXVTChar@@H@Z @ 2203 NONAME ; void TDes16::Fill2(class TChar, int)
-	?LocateF2@TDesC16@@QBEHVTChar@@@Z @ 2204 NONAME ; int TDesC16::LocateF2(class TChar) const
-	?Match2@TDesC16@@QBEHABV1@@Z @ 2205 NONAME ; int TDesC16::Match2(class TDesC16 const &) const
-	?LocateReverse2@TDesC16@@QBEHVTChar@@@Z @ 2206 NONAME ; int TDesC16::LocateReverse2(class TChar) const
-	?LocateReverseF2@TDesC16@@QBEHVTChar@@@Z @ 2207 NONAME ; int TDesC16::LocateReverseF2(class TChar) const
-	?CopyCP2@TDes16@@QAEXABVTDesC16@@@Z @ 2208 NONAME ; void TDes16::CopyCP2(class TDesC16 const &)
-	?AgainHighRes@RTimer@@QAEXAAVTRequestStatus@@VTTimeIntervalMicroSeconds32@@@Z @ 2209 NONAME ; public: void __thiscall RTimer::AgainHighRes(class TRequestStatus &,class TTimeIntervalMicroSeconds32)
-	?Align@RAllocator@@QBEPAXPAX@Z @ 2210 NONAME ; void * RAllocator::Align(void *) const
-	?Align@RAllocator@@QBEHH@Z @ 2211 NONAME ; int RAllocator::Align(int) const
-	?Size@RAllocator@@QBEHXZ @ 2212 NONAME ; int RAllocator::Size(void) const
-	?Base@RAllocator@@QBEPAEXZ @ 2213 NONAME ; void * RAllocator::Base(void) const
-	?MaxLength@RAllocator@@QBEHXZ @ 2214 NONAME ; int RAllocator::MaxLength(void) const
-	?__DbgGetAllocFail@RAllocator@@QAE?AW4TAllocFail@1@XZ @ 2215 NONAME ; enum RAllocator::TAllocFail RAllocator::__DbgGetAllocFail(void)
-	?__DbgGetAllocFail@User@@SA?AW4TAllocFail@RAllocator@@H@Z @ 2216 NONAME ; enum RAllocator::TAllocFail User::__DbgGetAllocFail(int)
+	?Append2@TDes16@@QAEXVTChar@@@Z @ 2184 NONAME ABSENT ; void TDes16::Append2(class TChar)
+	?CopyC2@TDes16@@QAEXABVTDesC16@@@Z @ 2185 NONAME ABSENT ; void TDes16::CopyC2(class TDesC16 const &)
+	?Collate2@TDes16@@QAEXXZ @ 2186 NONAME ABSENT ; void TDes16::Collate2(void)
+	?CopyF2@TDes16@@QAEXABVTDesC16@@@Z @ 2187 NONAME ABSENT ; void TDes16::CopyF2(class TDesC16 const &)
+	?Fill2@TDes16@@QAEXVTChar@@@Z @ 2188 NONAME ABSENT ; void TDes16::Fill2(class TChar)
+	?Locate2@TDesC16@@QBEHVTChar@@@Z @ 2189 NONAME ABSENT ; int TDesC16::Locate2(class TChar) const
+	?AppendFill2@TDes16@@QAEXVTChar@@H@Z @ 2190 NONAME ABSENT ; void TDes16::AppendFill2(class TChar, int)
+	?AppendJustify2@TDes16@@QAEXABVTDesC16@@HHW4TAlign@@VTChar@@@Z @ 2191 NONAME ABSENT ; void TDes16::AppendJustify2(class TDesC16 const &, int, int, enum TAlign, class TChar)
+	?AppendJustify2@TDes16@@QAEXPBGHW4TAlign@@VTChar@@@Z @ 2192 NONAME ABSENT ; void TDes16::AppendJustify2(unsigned short const *, int, enum TAlign, class TChar)
+	?Fold2@TDes16@@QAEXXZ @ 2193 NONAME ABSENT ; void TDes16::Fold2(void)
+	?AppendJustify2@TDes16@@QAEXABVTDesC16@@HW4TAlign@@VTChar@@@Z @ 2194 NONAME ABSENT ; void TDes16::AppendJustify2(class TDesC16 const &, int, enum TAlign, class TChar)
+	?LowerCase2@TDes16@@QAEXXZ @ 2195 NONAME ABSENT ; void TDes16::LowerCase2(void)
+	?CopyUC2@TDes16@@QAEXABVTDesC16@@@Z @ 2196 NONAME ABSENT ; void TDes16::CopyUC2(class TDesC16 const &)
+	?FindCorruptSurrogate@TDesC16@@QBEHXZ @ 2197 NONAME ABSENT ; int TDesC16::FindCorruptSurrogate(void) const
+	?Justify2@TDes16@@QAEXABVTDesC16@@HW4TAlign@@VTChar@@@Z @ 2198 NONAME ABSENT ; void TDes16::Justify2(class TDesC16 const &, int, enum TAlign, class TChar)
+	?UpperCase2@TDes16@@QAEXXZ @ 2199 NONAME ABSENT ; void TDes16::UpperCase2(void)
+	?Capitalize2@TDes16@@QAEXXZ @ 2200 NONAME ABSENT ; void TDes16::Capitalize2(void)
+	?AppendJustify2@TDes16@@QAEXPBGHHW4TAlign@@VTChar@@@Z @ 2201 NONAME ABSENT ; void TDes16::AppendJustify2(unsigned short const *, int, int, enum TAlign, class TChar)
+	?CopyLC2@TDes16@@QAEXABVTDesC16@@@Z @ 2202 NONAME ABSENT ; void TDes16::CopyLC2(class TDesC16 const &)
+	?Fill2@TDes16@@QAEXVTChar@@H@Z @ 2203 NONAME ABSENT ; void TDes16::Fill2(class TChar, int)
+	?LocateF2@TDesC16@@QBEHVTChar@@@Z @ 2204 NONAME ABSENT ; int TDesC16::LocateF2(class TChar) const
+	?Match2@TDesC16@@QBEHABV1@@Z @ 2205 NONAME ABSENT ; int TDesC16::Match2(class TDesC16 const &) const
+	?LocateReverse2@TDesC16@@QBEHVTChar@@@Z @ 2206 NONAME ABSENT ; int TDesC16::LocateReverse2(class TChar) const
+	?LocateReverseF2@TDesC16@@QBEHVTChar@@@Z @ 2207 NONAME ABSENT ; int TDesC16::LocateReverseF2(class TChar) const
+	?CopyCP2@TDes16@@QAEXABVTDesC16@@@Z @ 2208 NONAME ABSENT ; void TDes16::CopyCP2(class TDesC16 const &)
+	?AgainHighRes@RTimer@@QAEXAAVTRequestStatus@@VTTimeIntervalMicroSeconds32@@@Z @ 2209 NONAME ABSENT ; public: void __thiscall RTimer::AgainHighRes(class TRequestStatus &,class TTimeIntervalMicroSeconds32)
+	?Align@RAllocator@@QBEPAXPAX@Z @ 2210 NONAME ABSENT ; void * RAllocator::Align(void *) const
+	?Align@RAllocator@@QBEHH@Z @ 2211 NONAME ABSENT ; int RAllocator::Align(int) const
+	?Size@RAllocator@@QBEHXZ @ 2212 NONAME ABSENT ; int RAllocator::Size(void) const
+	?Base@RAllocator@@QBEPAEXZ @ 2213 NONAME ABSENT ; void * RAllocator::Base(void) const
+	?MaxLength@RAllocator@@QBEHXZ @ 2214 NONAME ABSENT ; int RAllocator::MaxLength(void) const
+	?__DbgGetAllocFail@RAllocator@@QAE?AW4TAllocFail@1@XZ @ 2215 NONAME ABSENT ; enum RAllocator::TAllocFail RAllocator::__DbgGetAllocFail(void)
+	?__DbgGetAllocFail@User@@SA?AW4TAllocFail@RAllocator@@H@Z @ 2216 NONAME ABSENT ; enum RAllocator::TAllocFail User::__DbgGetAllocFail(int)
 	?SetKeyOffset@RArrayBase@@IAEXH@Z @ 2217  NONAME ; void RArrayBase::SetKeyOffset(int)
-	?Poll@RFastLock@@QAEHXZ @ 2218 NONAME ; public: int __thiscall RFastLock::Poll(void)
-	?Poll@RMutex@@QAEHXZ @ 2219 NONAME ; public: int __thiscall RMutex::Poll(void)
-	?Poll@RSemaphore@@QAEHXZ @ 2220 NONAME ; public: int __thiscall RSemaphore::Poll(void)
-	?Wait@RMutex@@QAEHH@Z @ 2221 NONAME ; public: int __thiscall RMutex::Wait(int)
-	?Wait@RFastLock@@QAEHH@Z @ 2222 NONAME ; public: int __thiscall RFastLock::Wait(int)
+
--- a/kernel/eka/bx86/ekernsmp.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/bx86/ekernsmp.def	Wed Sep 01 12:34:56 2010 +0100
@@ -1005,14 +1005,12 @@
 	?RandomSalt@Kern@@SAXPBEII@Z @ 1004 NONAME ; void Kern::RandomSalt(unsigned char const *, unsigned int, unsigned int)
 	?SecureRandom@Kern@@SAHAAVTDes8@@@Z @ 1005 NONAME ; int Kern::SecureRandom(class TDes8 &)
 	?NotificationLock@DPagingDevice@@QAEPAVNFastMutex@@XZ @ 1006 NONAME ; public: class NFastMutex * __thiscall DPagingDevice::NotificationLock(void)
-	?Configure@KernCoreStats@@SAHI@Z @ 1007 NONAME	;  public: static int KernCoreStats::Configure(unsigned int)
-	?Engage@KernCoreStats@@SAHH@Z @ 1008 NONAME	;  public: static int KernCoreStats::Engage(int)
-	?Retire@KernCoreStats@@SAHHH@Z @ 1009 NONAME	;  public: static int KernCoreStats::Retire(int, int)
-	?Stats@KernCoreStats@@SAHPAX@Z @ 1010 NONAME	;  public: static int KernCoreStats::Stats(void *)
-	?SetNumberOfActiveCpus@NKern@@SAXH@Z @ 1011 NONAME ; public: static void __cdecl NKern::SetNumberOfActiveCpus(int)
-	?FreeRamZone@Epoc@@SAHI@Z @ 1012 NONAME ; public: static int Epoc::FreeRamZone(unsigned int)
+	?Configure@KernCoreStats@@SAHI@Z @ 1007 NONAME ABSENT ;  public: static int KernCoreStats::Configure(unsigned int)
+	?Engage@KernCoreStats@@SAHH@Z @ 1008 NONAME ABSENT	;  public: static int KernCoreStats::Engage(int)
+	?Retire@KernCoreStats@@SAHHH@Z @ 1009 NONAME ABSENT	;  public: static int KernCoreStats::Retire(int, int)
+	?Stats@KernCoreStats@@SAHPAX@Z @ 1010 NONAME ABSENT	;  public: static int KernCoreStats::Stats(void *)
+	?SetNumberOfActiveCpus@NKern@@SAXH@Z @ 1011 NONAME ABSENT ; public: static void __cdecl NKern::SetNumberOfActiveCpus(int)
+	?FreeRamZone@Epoc@@SAHI@Z @ 1012 NONAME ABSENT ; public: static int Epoc::FreeRamZone(unsigned int)
 	?SelectiveAlloc@TBitMapAllocator@@QAEIHH@Z @ 1013 NONAME ; public: unsigned int __thiscall TBitMapAllocator::SelectiveAlloc(int,int)
 	?SetKeyOffset@RArrayBase@@IAEXH@Z @ 1014  NONAME ; void RArrayBase::SetKeyOffset(int)
-	?CpuRetires@Cache@@SAXXZ @ 1015 NONAME ; public: static void __cdecl Cache::CpuRetires(void)
-	?KernelRetires@Cache@@SAXXZ @ 1016 NONAME ; public: static void __cdecl Cache::KernelRetires(void)
 
--- a/kernel/eka/bx86/ekernu.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/bx86/ekernu.def	Wed Sep 01 12:34:56 2010 +0100
@@ -949,15 +949,13 @@
 	?RandomSalt@Kern@@SAXPBEII@Z @ 948 NONAME ; void Kern::RandomSalt(unsigned char const *, unsigned int, unsigned int)
 	?SecureRandom@Kern@@SAHAAVTDes8@@@Z @ 949 NONAME ; int Kern::SecureRandom(class TDes8 &)
 	?NotificationLock@DPagingDevice@@QAEPAVNFastMutex@@XZ @ 950 NONAME ; public: class NFastMutex * __thiscall DPagingDevice::NotificationLock(void)
-	?Configure@KernCoreStats@@SAHI@Z @ 951 NONAME	;  public: static int KernCoreStats::Configure(unsigned int)
-	?Engage@KernCoreStats@@SAHH@Z @ 952 NONAME	;  public: static int KernCoreStats::Engage(int)
-	?EnterIdle@KernCoreStats@@SAIXZ @ 953 NONAME	;  public: static unsigned int KernCoreStats::EnterIdle()
-	?LeaveIdle@KernCoreStats@@SAXI@Z @ 954 NONAME	;  public: static void KernCoreStats::LeaveIdle(unsigned int)
-	?Retire@KernCoreStats@@SAHHH@Z @ 955 NONAME	;  public: static int KernCoreStats::Retire(int, int)
-	?Stats@KernCoreStats@@SAHPAX@Z @ 956 NONAME	;  public: static int KernCoreStats::Stats(void *)
-	?FreeRamZone@Epoc@@SAHI@Z @ 957 NONAME ; public: static int Epoc::FreeRamZone(unsigned int)
+	?Configure@KernCoreStats@@SAHI@Z @ 951 NONAME ABSENT ; public: static int KernCoreStats::Configure(unsigned int)
+	?Engage@KernCoreStats@@SAHH@Z @ 952 NONAME ABSENT ; public: static int KernCoreStats::Engage(int)
+	?EnterIdle@KernCoreStats@@SAIXZ @ 953 NONAME ABSENT ; public: static unsigned int KernCoreStats::EnterIdle()
+	?LeaveIdle@KernCoreStats@@SAXI@Z @ 954 NONAME ABSENT ; public: static void KernCoreStats::LeaveIdle(unsigned int)
+	?Retire@KernCoreStats@@SAHHH@Z @ 955 NONAME ABSENT ; public: static int KernCoreStats::Retire(int, int)
+	?Stats@KernCoreStats@@SAHPAX@Z @ 956 NONAME ABSENT ; public: static int KernCoreStats::Stats(void *)
+	?FreeRamZone@Epoc@@SAHI@Z @ 957 NONAME ABSENT ; public: static int Epoc::FreeRamZone(unsigned int)
 	?SelectiveAlloc@TBitMapAllocator@@QAEIHH@Z @ 958 NONAME ; public: unsigned int __thiscall TBitMapAllocator::SelectiveAlloc(int,int)
 	?SetKeyOffset@RArrayBase@@IAEXH@Z @ 959  NONAME ; void RArrayBase::SetKeyOffset(int)
-	?CpuRetires@Cache@@SAXXZ @ 960 NONAME ; public: static void __cdecl Cache::CpuRetires(void)
-	?KernelRetires@Cache@@SAXXZ @ 961 NONAME ; public: static void __cdecl Cache::KernelRetires(void)
 
--- a/kernel/eka/bx86/euseru.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/bx86/euseru.def	Wed Sep 01 12:34:56 2010 +0100
@@ -48,8 +48,8 @@
 	??0RBuf8@@QAE@PAVHBufC8@@@Z @ 47 NONAME ; public: __thiscall RBuf8::RBuf8(class HBufC8 *)
 	??0RBuf8@@QAE@XZ @ 48 NONAME ; public: __thiscall RBuf8::RBuf8(void)
 	??0RCriticalSection@@QAE@XZ @ 49 NONAME ; public: __thiscall RCriticalSection::RCriticalSection(void)
-	??0RHeap@@QAE@HHH@Z @ 50 NONAME ABSENT ; public: __thiscall RHeap::RHeap(int,int,int)
-	??0RHeap@@QAE@HHHHHHH@Z @ 51 NONAME ABSENT ; public: __thiscall RHeap::RHeap(int,int,int,int,int,int,int)
+	??0RHeap@@QAE@HHH@Z @ 50 NONAME ; public: __thiscall RHeap::RHeap(int,int,int)
+	??0RHeap@@QAE@HHHHHHH@Z @ 51 NONAME ; public: __thiscall RHeap::RHeap(int,int,int,int,int,int,int)
 	??0RMessage2@@QAE@ABVRMessagePtr2@@@Z @ 52 NONAME ; public: __thiscall RMessage2::RMessage2(class RMessagePtr2 const &)
 	??0RNotifier@@QAE@XZ @ 53 NONAME ; public: __thiscall RNotifier::RNotifier(void)
 	??0RPointerArrayBase@@IAE@H@Z @ 54 NONAME ; protected: __thiscall RPointerArrayBase::RPointerArrayBase(int)
@@ -216,7 +216,7 @@
 	??1CSession2@@UAE@XZ @ 215 NONAME ; public: virtual __thiscall CSession2::~CSession2(void)
 	??1CTimer@@UAE@XZ @ 216 NONAME ; public: virtual __thiscall CTimer::~CTimer(void)
 	??1CTrapCleanup@@UAE@XZ @ 217 NONAME ; public: virtual __thiscall CTrapCleanup::~CTrapCleanup(void)
-	??2RHeap@@SAPAXIPAX@Z @ 218 NONAME ABSENT ; public: static void * __cdecl RHeap::operator new(unsigned int,void *)
+	??2RHeap@@SAPAXIPAX@Z @ 218 NONAME ; public: static void * __cdecl RHeap::operator new(unsigned int,void *)
 	??4HBufC16@@QAEAAV0@ABVTDesC16@@@Z @ 219 NONAME ; public: class HBufC16 & __thiscall HBufC16::operator=(class TDesC16 const &)
 	??4HBufC16@@QAEAAV0@PBG@Z @ 220 NONAME ; public: class HBufC16 & __thiscall HBufC16::operator=(unsigned short const *)
 	??4HBufC8@@QAEAAV0@ABVTDesC8@@@Z @ 221 NONAME ; public: class HBufC8 & __thiscall HBufC8::operator=(class TDesC8 const &)
@@ -943,7 +943,7 @@
 	?Get@RProperty@@SAHVTUid@@IAAVTDes8@@@Z @ 942 NONAME ; public: static int __cdecl RProperty::Get(class TUid,unsigned int,class TDes8 &)
 	?Get@TLex16@@QAE?AVTChar@@XZ @ 943 NONAME ; public: class TChar  __thiscall TLex16::Get(void)
 	?Get@TLex8@@QAE?AVTChar@@XZ @ 944 NONAME ; public: class TChar  __thiscall TLex8::Get(void)
-	?GetAddress@RHeap@@IBEPAUSCell@1@PBX@Z @ 945 NONAME ABSENT ; protected: struct RHeap::SCell * __thiscall RHeap::GetAddress(void const *)const 
+	?GetAddress@RHeap@@IBEPAUSCell@1@PBX@Z @ 945 NONAME ; protected: struct RHeap::SCell * __thiscall RHeap::GetAddress(void const *)const 
 	?GetBdCategory@TChar@@QBE?AW4TBdCategory@1@XZ @ 946 NONAME ; public: enum TChar::TBdCategory  __thiscall TChar::GetBdCategory(void)const 
 	?GetCaps@RDevice@@QBEXAAVTDes8@@@Z @ 947 NONAME ; public: void __thiscall RDevice::GetCaps(class TDes8 &)const 
 	?GetCategory@TChar@@QBE?AW4TCategory@1@XZ @ 948 NONAME ; public: enum TChar::TCategory  __thiscall TChar::GetCategory(void)const 
@@ -2182,42 +2182,38 @@
 	?RandomL@Math@@SAXAAVTDes8@@@Z @ 2181 NONAME ; void Math::RandomL(class TDes8 &)
 	?Random@Math@@SAXAAVTDes8@@@Z @ 2182 NONAME ; void Math::Random(class TDes8 &)
  	?RandomL@Math@@SAKXZ @ 2183 NONAME ; unsigned long Math::RandomL(void)
-	?Append2@TDes16@@QAEXVTChar@@@Z @ 2184 NONAME ; void TDes16::Append2(class TChar)
-	?CopyC2@TDes16@@QAEXABVTDesC16@@@Z @ 2185 NONAME ; void TDes16::CopyC2(class TDesC16 const &)
-	?Collate2@TDes16@@QAEXXZ @ 2186 NONAME ; void TDes16::Collate2(void)
-	?CopyF2@TDes16@@QAEXABVTDesC16@@@Z @ 2187 NONAME ; void TDes16::CopyF2(class TDesC16 const &)
-	?Fill2@TDes16@@QAEXVTChar@@@Z @ 2188 NONAME ; void TDes16::Fill2(class TChar)
-	?Locate2@TDesC16@@QBEHVTChar@@@Z @ 2189 NONAME ; int TDesC16::Locate2(class TChar) const
-	?AppendFill2@TDes16@@QAEXVTChar@@H@Z @ 2190 NONAME ; void TDes16::AppendFill2(class TChar, int)
-	?AppendJustify2@TDes16@@QAEXABVTDesC16@@HHW4TAlign@@VTChar@@@Z @ 2191 NONAME ; void TDes16::AppendJustify2(class TDesC16 const &, int, int, enum TAlign, class TChar)
-	?AppendJustify2@TDes16@@QAEXPBGHW4TAlign@@VTChar@@@Z @ 2192 NONAME ; void TDes16::AppendJustify2(unsigned short const *, int, enum TAlign, class TChar)
-	?Fold2@TDes16@@QAEXXZ @ 2193 NONAME ; void TDes16::Fold2(void)
-	?AppendJustify2@TDes16@@QAEXABVTDesC16@@HW4TAlign@@VTChar@@@Z @ 2194 NONAME ; void TDes16::AppendJustify2(class TDesC16 const &, int, enum TAlign, class TChar)
-	?LowerCase2@TDes16@@QAEXXZ @ 2195 NONAME ; void TDes16::LowerCase2(void)
-	?CopyUC2@TDes16@@QAEXABVTDesC16@@@Z @ 2196 NONAME ; void TDes16::CopyUC2(class TDesC16 const &)
-	?FindCorruptSurrogate@TDesC16@@QBEHXZ @ 2197 NONAME ; int TDesC16::FindCorruptSurrogate(void) const
-	?Justify2@TDes16@@QAEXABVTDesC16@@HW4TAlign@@VTChar@@@Z @ 2198 NONAME ; void TDes16::Justify2(class TDesC16 const &, int, enum TAlign, class TChar)
-	?UpperCase2@TDes16@@QAEXXZ @ 2199 NONAME ; void TDes16::UpperCase2(void)
-	?Capitalize2@TDes16@@QAEXXZ @ 2200 NONAME ; void TDes16::Capitalize2(void)
-	?AppendJustify2@TDes16@@QAEXPBGHHW4TAlign@@VTChar@@@Z @ 2201 NONAME ; void TDes16::AppendJustify2(unsigned short const *, int, int, enum TAlign, class TChar)
-	?CopyLC2@TDes16@@QAEXABVTDesC16@@@Z @ 2202 NONAME ; void TDes16::CopyLC2(class TDesC16 const &)
-	?Fill2@TDes16@@QAEXVTChar@@H@Z @ 2203 NONAME ; void TDes16::Fill2(class TChar, int)
-	?LocateF2@TDesC16@@QBEHVTChar@@@Z @ 2204 NONAME ; int TDesC16::LocateF2(class TChar) const
-	?Match2@TDesC16@@QBEHABV1@@Z @ 2205 NONAME ; int TDesC16::Match2(class TDesC16 const &) const
-	?LocateReverse2@TDesC16@@QBEHVTChar@@@Z @ 2206 NONAME ; int TDesC16::LocateReverse2(class TChar) const
-	?LocateReverseF2@TDesC16@@QBEHVTChar@@@Z @ 2207 NONAME ; int TDesC16::LocateReverseF2(class TChar) const
-	?CopyCP2@TDes16@@QAEXABVTDesC16@@@Z @ 2208 NONAME ; void TDes16::CopyCP2(class TDesC16 const &)
-	?AgainHighRes@RTimer@@QAEXAAVTRequestStatus@@VTTimeIntervalMicroSeconds32@@@Z @ 2209 NONAME ; public: void __thiscall RTimer::AgainHighRes(class TRequestStatus &,class TTimeIntervalMicroSeconds32)
-	?Align@RAllocator@@QBEHH@Z @ 2210 NONAME ; public: int __thiscall RAllocator::Align(int)const 
-	?Align@RAllocator@@QBEPAXPAX@Z @ 2211 NONAME ; public: void * __thiscall RAllocator::Align(void *)const 
-	?Base@RAllocator@@QBEPAEXZ @ 2212 NONAME ; public: void * __thiscall RAllocator::Base(void)const 
-	?MaxLength@RAllocator@@QBEHXZ @ 2213 NONAME ; public: int __thiscall RAllocator::MaxLength(void)const 
-	?Size@RAllocator@@QBEHXZ @ 2214 NONAME ; public: int __thiscall RAllocator::Size(void)const 
-	?__DbgGetAllocFail@RAllocator@@QAE?AW4TAllocFail@1@XZ @ 2215 NONAME ; enum RAllocator::TAllocFail RAllocator::__DbgGetAllocFail(void)
-	?__DbgGetAllocFail@User@@SA?AW4TAllocFail@RAllocator@@H@Z @ 2216 NONAME ; enum RAllocator::TAllocFail User::__DbgGetAllocFail(int)
+	?Append2@TDes16@@QAEXVTChar@@@Z @ 2184 NONAME ABSENT ; void TDes16::Append2(class TChar)
+	?CopyC2@TDes16@@QAEXABVTDesC16@@@Z @ 2185 NONAME ABSENT ; void TDes16::CopyC2(class TDesC16 const &)
+	?Collate2@TDes16@@QAEXXZ @ 2186 NONAME ABSENT ; void TDes16::Collate2(void)
+	?CopyF2@TDes16@@QAEXABVTDesC16@@@Z @ 2187 NONAME ABSENT ; void TDes16::CopyF2(class TDesC16 const &)
+	?Fill2@TDes16@@QAEXVTChar@@@Z @ 2188 NONAME ABSENT ; void TDes16::Fill2(class TChar)
+	?Locate2@TDesC16@@QBEHVTChar@@@Z @ 2189 NONAME ABSENT ; int TDesC16::Locate2(class TChar) const
+	?AppendFill2@TDes16@@QAEXVTChar@@H@Z @ 2190 NONAME ABSENT ; void TDes16::AppendFill2(class TChar, int)
+	?AppendJustify2@TDes16@@QAEXABVTDesC16@@HHW4TAlign@@VTChar@@@Z @ 2191 NONAME ABSENT ; void TDes16::AppendJustify2(class TDesC16 const &, int, int, enum TAlign, class TChar)
+	?AppendJustify2@TDes16@@QAEXPBGHW4TAlign@@VTChar@@@Z @ 2192 NONAME ABSENT ; void TDes16::AppendJustify2(unsigned short const *, int, enum TAlign, class TChar)
+	?Fold2@TDes16@@QAEXXZ @ 2193 NONAME ABSENT ; void TDes16::Fold2(void)
+	?AppendJustify2@TDes16@@QAEXABVTDesC16@@HW4TAlign@@VTChar@@@Z @ 2194 NONAME ABSENT ; void TDes16::AppendJustify2(class TDesC16 const &, int, enum TAlign, class TChar)
+	?LowerCase2@TDes16@@QAEXXZ @ 2195 NONAME ABSENT ; void TDes16::LowerCase2(void)
+	?CopyUC2@TDes16@@QAEXABVTDesC16@@@Z @ 2196 NONAME ABSENT ; void TDes16::CopyUC2(class TDesC16 const &)
+	?FindCorruptSurrogate@TDesC16@@QBEHXZ @ 2197 NONAME ABSENT ; int TDesC16::FindCorruptSurrogate(void) const
+	?Justify2@TDes16@@QAEXABVTDesC16@@HW4TAlign@@VTChar@@@Z @ 2198 NONAME ABSENT ; void TDes16::Justify2(class TDesC16 const &, int, enum TAlign, class TChar)
+	?UpperCase2@TDes16@@QAEXXZ @ 2199 NONAME ABSENT ; void TDes16::UpperCase2(void)
+	?Capitalize2@TDes16@@QAEXXZ @ 2200 NONAME ABSENT ; void TDes16::Capitalize2(void)
+	?AppendJustify2@TDes16@@QAEXPBGHHW4TAlign@@VTChar@@@Z @ 2201 NONAME ABSENT ; void TDes16::AppendJustify2(unsigned short const *, int, int, enum TAlign, class TChar)
+	?CopyLC2@TDes16@@QAEXABVTDesC16@@@Z @ 2202 NONAME ABSENT ; void TDes16::CopyLC2(class TDesC16 const &)
+	?Fill2@TDes16@@QAEXVTChar@@H@Z @ 2203 NONAME ABSENT ; void TDes16::Fill2(class TChar, int)
+	?LocateF2@TDesC16@@QBEHVTChar@@@Z @ 2204 NONAME ABSENT ; int TDesC16::LocateF2(class TChar) const
+	?Match2@TDesC16@@QBEHABV1@@Z @ 2205 NONAME ABSENT ; int TDesC16::Match2(class TDesC16 const &) const
+	?LocateReverse2@TDesC16@@QBEHVTChar@@@Z @ 2206 NONAME ABSENT ; int TDesC16::LocateReverse2(class TChar) const
+	?LocateReverseF2@TDesC16@@QBEHVTChar@@@Z @ 2207 NONAME ABSENT ; int TDesC16::LocateReverseF2(class TChar) const
+	?CopyCP2@TDes16@@QAEXABVTDesC16@@@Z @ 2208 NONAME ABSENT ; void TDes16::CopyCP2(class TDesC16 const &)
+	?AgainHighRes@RTimer@@QAEXAAVTRequestStatus@@VTTimeIntervalMicroSeconds32@@@Z @ 2209 NONAME ABSENT ; public: void __thiscall RTimer::AgainHighRes(class TRequestStatus &,class TTimeIntervalMicroSeconds32)
+	?Align@RAllocator@@QBEHH@Z @ 2210 NONAME ABSENT ; public: int __thiscall RAllocator::Align(int)const 
+	?Align@RAllocator@@QBEPAXPAX@Z @ 2211 NONAME ABSENT ; public: void * __thiscall RAllocator::Align(void *)const 
+	?Base@RAllocator@@QBEPAEXZ @ 2212 NONAME ABSENT ; public: void * __thiscall RAllocator::Base(void)const 
+	?MaxLength@RAllocator@@QBEHXZ @ 2213 NONAME ABSENT ; public: int __thiscall RAllocator::MaxLength(void)const 
+	?Size@RAllocator@@QBEHXZ @ 2214 NONAME ABSENT ; public: int __thiscall RAllocator::Size(void)const 
+	?__DbgGetAllocFail@RAllocator@@QAE?AW4TAllocFail@1@XZ @ 2215 NONAME ABSENT ; enum RAllocator::TAllocFail RAllocator::__DbgGetAllocFail(void)
+	?__DbgGetAllocFail@User@@SA?AW4TAllocFail@RAllocator@@H@Z @ 2216 NONAME ABSENT ; enum RAllocator::TAllocFail User::__DbgGetAllocFail(int)
 	?SetKeyOffset@RArrayBase@@IAEXH@Z @ 2217  NONAME ; void RArrayBase::SetKeyOffset(int)
-	?Poll@RFastLock@@QAEHXZ @ 2218 NONAME ; public: int __thiscall RFastLock::Poll(void)
-	?Poll@RMutex@@QAEHXZ @ 2219 NONAME ; public: int __thiscall RMutex::Poll(void)
-	?Poll@RSemaphore@@QAEHXZ @ 2220 NONAME ; public: int __thiscall RSemaphore::Poll(void)
-	?Wait@RMutex@@QAEHH@Z @ 2221 NONAME ; public: int __thiscall RMutex::Wait(int)
-	?Wait@RFastLock@@QAEHH@Z @ 2222 NONAME ; public: int __thiscall RFastLock::Wait(int)
+	
--- a/kernel/eka/bx86gcc/ekernsmp.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/bx86gcc/ekernsmp.def	Wed Sep 01 12:34:56 2010 +0100
@@ -1093,15 +1093,12 @@
 	_ZN4Kern10RandomSaltEPKhjj @ 1092 NONAME
 	_ZN4Kern12SecureRandomER5TDes8 @ 1093 NONAME
 	_ZN13DPagingDevice16NotificationLockEv @ 1094 NONAME
-	_ZN13KernCoreStats5StatsEPv @ 1095 NONAME
-	_ZN13KernCoreStats6EngageEi @ 1096 NONAME
-	_ZN13KernCoreStats6RetireEii @ 1097 NONAME
-	_ZN13KernCoreStats9ConfigureEj @ 1098 NONAME
-	_ZN5NKern21SetNumberOfActiveCpusEi @ 1099 NONAME
-	_ZN4Epoc11FreeRamZoneEj @ 1100 NONAME
+	_ZN13KernCoreStats5StatsEPv @ 1095 NONAME ABSENT
+	_ZN13KernCoreStats6EngageEi @ 1096 NONAME ABSENT
+	_ZN13KernCoreStats6RetireEii @ 1097 NONAME ABSENT
+	_ZN13KernCoreStats9ConfigureEj @ 1098 NONAME ABSENT
+	_ZN5NKern21SetNumberOfActiveCpusEi @ 1099 NONAME ABSENT
+	_ZN4Epoc11FreeRamZoneEj @ 1100 NONAME ABSENT
 	_ZN16TBitMapAllocator14SelectiveAllocEii @ 1101 NONAME
 	_ZN10RArrayBase12SetKeyOffsetEi @ 1102 NONAME
-	_ZN5Cache10CpuRetiresEv @ 1103 NONAME
-	_ZN5Cache13KernelRetiresEv @ 1104 NONAME
 
-
--- a/kernel/eka/bx86gcc/ekernu.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/bx86gcc/ekernu.def	Wed Sep 01 12:34:56 2010 +0100
@@ -1032,15 +1032,13 @@
 	_ZN4Kern10RandomSaltEPKhjj @ 1031 NONAME
 	_ZN4Kern12SecureRandomER5TDes8 @ 1032 NONAME
 	_ZN13DPagingDevice16NotificationLockEv @ 1033 NONAME
-	_ZN13KernCoreStats5StatsEPv @ 1034 NONAME
-	_ZN13KernCoreStats6EngageEi @ 1035 NONAME
-	_ZN13KernCoreStats6RetireEii @ 1036 NONAME
-	_ZN13KernCoreStats9ConfigureEj @ 1037 NONAME
-	_ZN13KernCoreStats9EnterIdleEv @ 1038 NONAME
-	_ZN13KernCoreStats9LeaveIdleEj @ 1039 NONAME
-	_ZN4Epoc11FreeRamZoneEj @ 1040 NONAME
+	_ZN13KernCoreStats5StatsEPv @ 1034 NONAME ABSENT
+	_ZN13KernCoreStats6EngageEi @ 1035 NONAME ABSENT
+	_ZN13KernCoreStats6RetireEii @ 1036 NONAME ABSENT
+	_ZN13KernCoreStats9ConfigureEj @ 1037 NONAME ABSENT
+	_ZN13KernCoreStats9EnterIdleEv @ 1038 NONAME ABSENT
+	_ZN13KernCoreStats9LeaveIdleEj @ 1039 NONAME ABSENT
+	_ZN4Epoc11FreeRamZoneEj @ 1040 NONAME ABSENT
 	_ZN16TBitMapAllocator14SelectiveAllocEii @ 1041 NONAME
 	_ZN10RArrayBase12SetKeyOffsetEi @ 1042 NONAME
-	_ZN5Cache10CpuRetiresEv @ 1043 NONAME
-	_ZN5Cache13KernelRetiresEv @ 1044 NONAME
 
--- a/kernel/eka/bx86gcc/euseru.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/bx86gcc/euseru.def	Wed Sep 01 12:34:56 2010 +0100
@@ -697,11 +697,11 @@
 	_ZN5RHeap5ResetEv @ 696 NONAME ; RHeap::Reset()
 	_ZN5RHeap7ReAllocEPvii @ 697 NONAME ; RHeap::ReAlloc(void*, int, int)
 	_ZN5RHeap8CompressEv @ 698 NONAME ; RHeap::Compress()
-	_ZN5RHeapC1Eiii @ 699 NONAME ABSENT ; RHeap::RHeap(int, int, int)
-	_ZN5RHeapC1Eiiiiiii @ 700 NONAME ABSENT ; RHeap::RHeap(int, int, int, int, int, int, int)
-	_ZN5RHeapC2Eiii @ 701 NONAME ABSENT ; RHeap::RHeap(int, int, int)
-	_ZN5RHeapC2Eiiiiiii @ 702 NONAME ABSENT ; RHeap::RHeap(int, int, int, int, int, int, int)
-	_ZN5RHeapnwEjPv @ 703 NONAME ABSENT ; RHeap::operator new(unsigned int, void*)
+	_ZN5RHeapC1Eiii @ 699 NONAME ; RHeap::RHeap(int, int, int)
+	_ZN5RHeapC1Eiiiiiii @ 700 NONAME ; RHeap::RHeap(int, int, int, int, int, int, int)
+	_ZN5RHeapC2Eiii @ 701 NONAME ; RHeap::RHeap(int, int, int)
+	_ZN5RHeapC2Eiiiiiii @ 702 NONAME ; RHeap::RHeap(int, int, int, int, int, int, int)
+	_ZN5RHeapnwEjPv @ 703 NONAME ; RHeap::operator new(unsigned int, void*)
 	_ZN5RTest3EndEv @ 704 NONAME ; RTest::End()
 	_ZN5RTest4NextERK7TDesC16 @ 705 NONAME ; RTest::Next(TDesC16 const&)
 	_ZN5RTest5CloseEv @ 706 NONAME ; RTest::Close()
@@ -1601,7 +1601,7 @@
 	_ZNK4TUid4NameEv @ 1600 NONAME ; TUid::Name() const
 	_ZNK4TUideqERKS_ @ 1601 NONAME ; TUid::operator==(TUid const&) const
 	_ZNK4TUidneERKS_ @ 1602 NONAME ; TUid::operator!=(TUid const&) const
-	_ZNK5RHeap10GetAddressEPKv @ 1603 NONAME ABSENT ; RHeap::GetAddress(void const*) const
+	_ZNK5RHeap10GetAddressEPKv @ 1603 NONAME ; RHeap::GetAddress(void const*) const
 	_ZNK5RHeap8AllocLenEPKv @ 1604 NONAME ; RHeap::AllocLen(void const*) const
 	_ZNK5RHeap9AllocSizeERi @ 1605 NONAME ; RHeap::AllocSize(int&) const
 	_ZNK5RHeap9AvailableERi @ 1606 NONAME ; RHeap::Available(int&) const
@@ -1935,7 +1935,7 @@
 	_ZTV20CActiveSchedulerWait @ 1934 NONAME ; vtable for CActiveSchedulerWait
 	_ZTV4TKey @ 1935 NONAME ; vtable for TKey
 	_ZTV5CIdle @ 1936 NONAME ; vtable for CIdle
-	_ZTV5RHeap @ 1937 NONAME ABSENT ; vtable for RHeap
+	_ZTV5RHeap @ 1937 NONAME ; vtable for RHeap
 	_ZTV5TSwap @ 1938 NONAME ; vtable for TSwap
 	_ZTV6CTimer @ 1939 NONAME ; vtable for CTimer
 	_ZTV7CActive @ 1940 NONAME ; vtable for CActive
@@ -2461,42 +2461,38 @@
 	_ZN4Math7RandomLER5TDes8 @ 2460 NONAME
 	_ZN4Math6RandomER5TDes8 @ 2461 NONAME
 	_ZN4Math7RandomLEv @ 2462 NONAME
-	_ZN6TDes1610LowerCase2Ev @ 2463 NONAME
-	_ZN6TDes1610UpperCase2Ev @ 2464 NONAME
-	_ZN6TDes1611AppendFill2E5TChari @ 2465 NONAME
-	_ZN6TDes1611Capitalize2Ev @ 2466 NONAME
-	_ZN6TDes1614AppendJustify2EPKti6TAlign5TChar @ 2467 NONAME
-	_ZN6TDes1614AppendJustify2EPKtii6TAlign5TChar @ 2468 NONAME
-	_ZN6TDes1614AppendJustify2ERK7TDesC16i6TAlign5TChar @ 2469 NONAME
-	_ZN6TDes1614AppendJustify2ERK7TDesC16ii6TAlign5TChar @ 2470 NONAME
-	_ZN6TDes165Fill2E5TChar @ 2471 NONAME
-	_ZN6TDes165Fill2E5TChari @ 2472 NONAME
-	_ZN6TDes165Fold2Ev @ 2473 NONAME
-	_ZN6TDes166CopyC2ERK7TDesC16 @ 2474 NONAME
-	_ZN6TDes166CopyF2ERK7TDesC16 @ 2475 NONAME
-	_ZN6TDes167Append2E5TChar @ 2476 NONAME
-	_ZN6TDes167CopyCP2ERK7TDesC16 @ 2477 NONAME
-	_ZN6TDes167CopyLC2ERK7TDesC16 @ 2478 NONAME
-	_ZN6TDes167CopyUC2ERK7TDesC16 @ 2479 NONAME
-	_ZN6TDes168Collate2Ev @ 2480 NONAME
-	_ZN6TDes168Justify2ERK7TDesC16i6TAlign5TChar @ 2481 NONAME
-	_ZNK7TDesC1614LocateReverse2E5TChar @ 2482 NONAME
-	_ZNK7TDesC1615LocateReverseF2E5TChar @ 2483 NONAME
-	_ZNK7TDesC1620FindCorruptSurrogateEv @ 2484 NONAME
-	_ZNK7TDesC166Match2ERKS_ @ 2485 NONAME
-	_ZNK7TDesC167Locate2E5TChar @ 2486 NONAME
-	_ZNK7TDesC168LocateF2E5TChar @ 2487 NONAME
-	_ZN6RTimer12AgainHighResER14TRequestStatus27TTimeIntervalMicroSeconds32 @ 2488 NONAME ; RTimer::AgainHighRes(TRequestStatus&, TTimeIntervalMicroSeconds32)
-	_ZNK10RAllocator4BaseEv @ 2489 NONAME
-	_ZNK10RAllocator4SizeEv @ 2490 NONAME
-	_ZNK10RAllocator5AlignEPv @ 2491 NONAME
-	_ZNK10RAllocator5AlignEi @ 2492 NONAME
-	_ZNK10RAllocator9MaxLengthEv @ 2493 NONAME
-	_ZN10RAllocator17__DbgGetAllocFailEv @ 2494 NONAME
-	_ZN4User17__DbgGetAllocFailEi @ 2495 NONAME
+	_ZN6TDes1610LowerCase2Ev @ 2463 NONAME ABSENT
+	_ZN6TDes1610UpperCase2Ev @ 2464 NONAME ABSENT
+	_ZN6TDes1611AppendFill2E5TChari @ 2465 NONAME ABSENT
+	_ZN6TDes1611Capitalize2Ev @ 2466 NONAME ABSENT
+	_ZN6TDes1614AppendJustify2EPKti6TAlign5TChar @ 2467 NONAME ABSENT
+	_ZN6TDes1614AppendJustify2EPKtii6TAlign5TChar @ 2468 NONAME ABSENT
+	_ZN6TDes1614AppendJustify2ERK7TDesC16i6TAlign5TChar @ 2469 NONAME ABSENT
+	_ZN6TDes1614AppendJustify2ERK7TDesC16ii6TAlign5TChar @ 2470 NONAME ABSENT
+	_ZN6TDes165Fill2E5TChar @ 2471 NONAME ABSENT
+	_ZN6TDes165Fill2E5TChari @ 2472 NONAME ABSENT
+	_ZN6TDes165Fold2Ev @ 2473 NONAME ABSENT
+	_ZN6TDes166CopyC2ERK7TDesC16 @ 2474 NONAME ABSENT
+	_ZN6TDes166CopyF2ERK7TDesC16 @ 2475 NONAME ABSENT
+	_ZN6TDes167Append2E5TChar @ 2476 NONAME ABSENT
+	_ZN6TDes167CopyCP2ERK7TDesC16 @ 2477 NONAME ABSENT
+	_ZN6TDes167CopyLC2ERK7TDesC16 @ 2478 NONAME ABSENT
+	_ZN6TDes167CopyUC2ERK7TDesC16 @ 2479 NONAME ABSENT
+	_ZN6TDes168Collate2Ev @ 2480 NONAME ABSENT
+	_ZN6TDes168Justify2ERK7TDesC16i6TAlign5TChar @ 2481 NONAME ABSENT
+	_ZNK7TDesC1614LocateReverse2E5TChar @ 2482 NONAME ABSENT
+	_ZNK7TDesC1615LocateReverseF2E5TChar @ 2483 NONAME ABSENT
+	_ZNK7TDesC1620FindCorruptSurrogateEv @ 2484 NONAME ABSENT
+	_ZNK7TDesC166Match2ERKS_ @ 2485 NONAME ABSENT
+	_ZNK7TDesC167Locate2E5TChar @ 2486 NONAME ABSENT
+	_ZNK7TDesC168LocateF2E5TChar @ 2487 NONAME ABSENT
+	_ZN6RTimer12AgainHighResER14TRequestStatus27TTimeIntervalMicroSeconds32 @ 2488 NONAME ABSENT
+	_ZNK10RAllocator4BaseEv @ 2489 NONAME ABSENT
+	_ZNK10RAllocator4SizeEv @ 2490 NONAME ABSENT
+	_ZNK10RAllocator5AlignEPv @ 2491 NONAME ABSENT
+	_ZNK10RAllocator5AlignEi @ 2492 NONAME ABSENT
+	_ZNK10RAllocator9MaxLengthEv @ 2493 NONAME ABSENT
+	_ZN10RAllocator17__DbgGetAllocFailEv @ 2494 NONAME ABSENT
+	_ZN4User17__DbgGetAllocFailEi @ 2495 NONAME ABSENT
 	_ZN10RArrayBase12SetKeyOffsetEi @ 2496 NONAME
-	_ZN10RSemaphore4PollEv @ 2497 NONAME ; RSemaphore::Poll()
-	_ZN6RMutex4WaitEi @ 2498 NONAME ; RMutex::Wait(int)
-	_ZN6RMutex4PollEv @ 2499 NONAME ; RMutex::Poll()
-	_ZN9RFastLock4PollEv @ 2500 NONAME ; RFastLock::Poll()
-	_ZN9RFastLock4WaitEi @ 2501 NONAME ; RFastLock::Wait(int)
+
--- a/kernel/eka/common/alloc.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/common/alloc.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -11,7 +11,7 @@
 // Contributors:
 //
 // Description:
-// kernel\eka\common\alloc.cpp
+// e32\common\alloc.cpp
 // 
 //
 
@@ -19,6 +19,7 @@
 #include <e32atomics.h>
 
 
+
 #ifndef __KERNEL_MODE__
 /**
 Opens this heap for shared access.
@@ -279,8 +280,7 @@
 */
 EXPORT_C TInt RAllocator::Count() const
 	{
-	TInt totalAllocSize; 
-	return ((RAllocator*)this)->AllocSize(totalAllocSize);
+	return iCellCount;
 	}
 
 
@@ -461,22 +461,6 @@
 
 
 /**
-Obtains the current heap failure simulation type.
-
-After calling __DbgSetAllocFail(), this function may be called to retrieve the
-value set.  This is useful primarily for test code that doesn't know if a heap
-has been set to fail and needs to check.
-
-@return RAllocator::ENone if heap is not in failure simulation mode;
-		Otherwise one of the other RAllocator::TAllocFail enumerations
-*/
-UEXPORT_C RAllocator::TAllocFail RAllocator::__DbgGetAllocFail()
-	{
-	return((TAllocFail) DebugFunction(EGetFail));
-	}
-
-
-/**
 Simulates a burst of heap allocation failures for this heap.
 
 The failure occurs for aBurst allocations attempt via subsequent calls 
@@ -532,66 +516,7 @@
 	return DebugFunction(ECheckFailure);
 	}
 
-/**
-Gets the current size of the heap.
 
-This is the total number of bytes committed by the host chunk, less the number
-of bytes used by the heap's metadata (the internal structures used for keeping
-track of allocated and free memory).
-
-Size = (Rounded committed size - size of heap metadata).
-
-@return The size of the heap, in bytes.
-*/		
-UEXPORT_C TInt RAllocator::Size() const	
-	{
-	return ((RAllocator*)this)->DebugFunction(EGetSize);
-	}
-
-/**
-@return The maximum length to which the heap can grow.
-
-@publishedAll
-@released
-*/
-UEXPORT_C TInt RAllocator::MaxLength() const	
-	{
-	return ((RAllocator*)this)->DebugFunction(EGetMaxLength);
-	}
-
-/**
-Gets a pointer to the start of the heap.
-
-Note that this function exists mainly for compatibility reasons.  In a modern
-heap implementation such as that present in Symbian it is not appropriate to
-concern oneself with details such as the address of the start of the heap, as
-it is not as meaningful as it was in older heap implementations.  In fact, the
-"base" might not even be the base of the heap at all!
-
-In other words, you can call this but it's not guaranteed to point to the start
-of the heap (and in fact it never really was, even in legacy implementations).
-
-@return A pointer to the base of the heap.  Maybe.
-*/
-UEXPORT_C TUint8* RAllocator::Base() const	
-	{
-	TUint8* base;
-	((RAllocator*)this)->DebugFunction(EGetBase, &base);	
-	return base;
-	}
-
-UEXPORT_C TInt RAllocator::Align(TInt a) const	
-	{
-	return ((RAllocator*)this)->DebugFunction(EAlignInteger, (TAny*)a);
-	}
-
-UEXPORT_C TAny* RAllocator::Align(TAny* a) const	
-	{
-	TAny* result;
-	((RAllocator*)this)->DebugFunction(EAlignAddr, a, &result);
-	return result;
-	}
-	
 UEXPORT_C TInt RAllocator::Extension_(TUint, TAny*& a0, TAny*)
 	{
 	a0 = NULL;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/common/arm/cheap.cia	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,142 @@
+// Copyright (c) 1994-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:
+// e32\common\arm\cheap.cia
+// 
+//
+
+#include <e32cia.h>
+#include "../common.h"
+
+#if defined(__HEAP_MACHINE_CODED__) && !defined(_DEBUG)
+GLREF_C void RHeap_PanicBadAllocatedCellSize();
+GLREF_C void RHeap_PanicBadNextCell();
+GLREF_C void RHeap_PanicBadPrevCell();
+GLREF_C void RHeap_PanicBadCellAddress();
+
+IMPORT_D extern const TInt KHeapShrinkHysRatio;
+
+
+__NAKED__ RHeap::SCell* RHeap::DoAlloc(TInt /*aSize*/, SCell*& /*aLastFree*/)
+//
+// Allocate a cell.
+//
+	{
+	asm("stmfd sp!, {r4,r5,lr} ");
+	asm("mov r4, r0 ");										// r4=this
+	asm("add r3, r0, #%a0" : : "i" _FOFF(RHeap,iFree));		// r3=pP=&iFree
+	asm("ldr r0, [r3, #4] ");								// r0=pC=pP->next
+	asm("cmp r0, #0 ");
+	asm("beq 0f ");								// if no free cells, alloc failed
+
+	// optimised unfolded scanning loop
+	asm("2: ");
+	asm("ldmia r0, {r12,r14} ");				// r12=pC->size, r14=pC->next
+	asm("cmp r1, r12 ");						// compare aSize to size
+	asm("movhi r3, r0 ");						// if aSize>size, pP=pC
+	asm("movhis r0, r14 ");						// and pC=pC->next
+#ifndef __CPU_ARMV6 // don't unroll on armv6
+	asm("ldmhiia r0, {r12,r14} ");				// r12=pC->size, r14=pC->next
+	asm("cmphi r1, r12 ");						// compare aSize to size
+	asm("movhi r3, r0 ");						// if aSize>size, pP=pC
+	asm("movhis r0, r14 ");						// and pC=pC->next
+#endif
+	asm("bhi 2b ");								// branch back if scan not finished
+	
+	asm("1: ");
+	asm("subs r5, r12, r1 ");					// r5 = pC->len - aSize
+	asm("ldrhs r2, [r4, #%a0]" : : "i" _FOFF(RHeap,iMinCell));		// if big enough, r2=iMinCell
+	asm("blo 0f ");								// branch if no free cell was big enough
+	asm("cmp r5, r2 ");							// leftover big enough?
+	asm("movlo r1, r12 ");						// if not, aSize=pC->len ...
+	asm("strlo r14, [r3, #4] ");				// ... and pP->next = pC->next
+	asm("addhs r2, r0, r1 ");					// else r2 = pE = address of new free cell ...
+	asm("stmhsia r2, {r5, r14} ");				// ... pE->len = pC->len - aSize, pE->next = pC->next ...
+	asm("strhs r2, [r3, #4] ");					// ... and pP->next = pE
+	asm("str r1, [r0] ");						// pC->len = aSize
+	__POPRET("r4,r5,");							// restore and exit, return pC
+
+	asm("0: ");
+	asm("str r3, [r2] ");						// alloc failed - aLastFree=pP
+	asm("mov r0, #0 ");							// return NULL
+	__POPRET("r4,r5,");
+	}
+
+__NAKED__ void RHeap::DoFree(SCell* /*pC*/)
+//
+// Free a cell.
+//
+	{
+	asm("add r2, r0, #%a0" : : "i" _FOFF(RHeap,iFree));	// r2=pP=&iFree
+	asm("ldr r3, [r2, #4] ");					// r3=pE=pP->next
+	asm("stmfd sp!, {r4, r5} ");
+
+	asm("1: ");
+	asm("cmp r3, #0 ");						// check if pE=NULL
+	asm("cmphi r1, r3 ");					// if not, check if pC>pE
+	asm("movhi r2, r3 ");					// if so, pP=pE
+	asm("ldrhi r3, [r3, #4] ");				// and pE=pE->next
+#ifndef __CPU_ARMV6    // don't unroll on armv6
+	asm("cmphi r3, #0 ");					// check if pE=NULL
+	asm("cmphi r1, r3 ");					// if not, check if pC>pE
+	asm("movhi r2, r3 ");					// if so, pP=pE
+	asm("ldrhi r3, [r3, #4] ");				// and pE=pE->next
+#endif
+	asm("bhi 1b ");							// loop if free cell position not found
+
+	asm("ldr r4, [r1, #0] ");				// r4=pC->len
+	asm("cmp r3, #0 ");						// is there a following free cell ?
+	asm("streq r3, [r1, #4] ");				// if not, pC->next=NULL
+	asm("beq 2f ");							// and skip next section
+	asm("add r5, r1, r4 ");					// r5=pN=pC + pC->len (cell after pC)
+	asm("cmp r5, r3 ");						// compare pN with pE
+	asm("ldmeqia r3, {r5, r12} ");			// if pN==pE, r5=pE->len, r12=pE->next
+	asm("bhi " CSM_Z22RHeap_PanicBadNextCellv );	// if pN>pE, panic
+	asm("strne r3, [r1, #4] ");				// if pN<pE, pC->next=pE
+	asm("addeq r4, r4, r5 ");				// if pN==pE r4 = pC->len + pE->len
+	asm("stmeqia r1, {r4,r12} ");			// if pN==pE pC->len+=pE->len, pC->next=pE->next
+	asm("2: ");
+	asm("ldr r3, [r2, #0] ");				// r3=pP->len
+	asm("sub r5, r1, r2 ");					// r5=pC-pP (gap between preceding free cell and this one)
+	asm("cmp r5, r3 ");						// compare gap with predecessor length
+	asm("ldreq r12, [r1, #4] ");			// if predecessor is adjacent, r12=pC->next
+	asm("blo RHeap_PanicBadPrevCell__Fv ");	// if predecessor overlaps, panic
+	asm("addeq r4, r4, r3 ");				// if predecessor is adjacent, r4=pC->len + pP->len
+	asm("stmeqia r2, {r4,r12} ");			// if predecessor is adjacent, pP->len+=pC->len, pP->next=pC->next
+	asm("strne r1, [r2, #4] ");				// else pP->next = pC
+	asm("moveq r1, r2 ");					// if predecessor is adjacent, pC=pP (final amalgamated free cell)
+	asm("3: ");
+	asm("ldr r12, [r0, #%a0]" : : "i" _FOFF(RHeap,iTop));	// r12=iTop
+	asm("add r3, r1, r4 ");					// end of amalgamated free cell
+	asm("cmp r3, r12 ");					// end of amalgamated free cell = iTop ?
+	asm("ldmneia sp!, {r4,r5} ");			// restore registers
+	__JUMP(ne,lr);							// if not, finished
+	asm("ldr r12, [r0, #%a0]" : : "i" _FOFF(RHeap,iFlags));	// r12=iFlags
+	asm("tst r12, #%a0" : : "i" ((TInt)RAllocator::EFixedSize));	// check fixed size flag
+	asm("ldmneia sp!, {r4,r5} ");			// restore registers
+	__JUMP(ne,lr);							// if set, finished
+	asm("ldr r2, [r0, #%a0]" : : "i" _FOFF(RHeap,iGrowBy));	// r2=iGrowBy
+	asm("mov r3, r2, LSR #8");				// r3=iGrowBy>>8
+	asm("ldr r2, const_addr");				// r2=&KHeapShrinkHysRatio
+	asm("ldr r5, [r2]");					// r5=KHeapShrinkHysRatio
+	asm("mul r2, r5, r3");					// r2=KHeapShrinkHysRatio*(iGrowBy>>8) - low order bits
+	asm("cmp r4, r2");						// compare len(r4) to (iGrowBy>>8)*KHeapShrinkHysRatio(r2)
+	asm("ldmia sp!, {r4,r5} ");				// restore registers
+	__JUMP(lo,lr);							// if less, finished
+	asm("b Reduce__5RHeapPQ25RHeap5SCell ");	// else reduce heap
+	
+	asm("const_addr:");
+	asm(".word %a0" : : "i" ((TInt)&KHeapShrinkHysRatio));	
+	}
+#endif
+
--- a/kernel/eka/common/common.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/common/common.h	Wed Sep 01 12:34:56 2010 +0100
@@ -51,7 +51,7 @@
 #define __KERNEL_CHECK_RADIX(r)		__ASSERT_ALWAYS(((r)==EDecimal)||((r)==EHex),Panic(EInvalidRadix))
 #define	APPEND_BUF_SIZE				10
 #define	APPEND_BUF_SIZE_64			20
-#define	HEAP_PANIC(r)				Kern::Printf("HEAP CORRUPTED %s %d", __FILE__, __LINE__), RHeapK::Fault(r)
+#define	HEAP_PANIC(r)				RHeapK::Fault(r)
 #define	GET_PAGE_SIZE(x)			x = M::PageSizeInBytes()
 #define	DIVISION_BY_ZERO()			FAULT()
 
@@ -71,7 +71,7 @@
 #define __KERNEL_CHECK_RADIX(r)
 #define	APPEND_BUF_SIZE				32
 #define	APPEND_BUF_SIZE_64			64
-#define	HEAP_PANIC(r)				RDebug::Printf("HEAP CORRUPTED %s %d", __FILE__, __LINE__), Panic(r)
+#define	HEAP_PANIC(r)				Panic(r)
 #define	GET_PAGE_SIZE(x)			UserHal::PageSizeInBytes(x)
 #define	DIVISION_BY_ZERO()			User::RaiseException(EExcIntegerDivideByZero)
 #define	__CHECK_THREAD_STATE
--- a/kernel/eka/common/debugfunction.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1124 +0,0 @@
-// Copyright (c) 1994-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:
-// kernel\eka\common\debugfunction.cpp
-// 
-//
-
-#include "common.h"
-#ifdef __KERNEL_MODE__
-#include <kernel/kern_priv.h>
-#endif
-#include "dla.h"
-#ifndef __KERNEL_MODE__
-#include "slab.h"
-#include "page_alloc.h"
-#endif
-#include "heap_hybrid.h"
-
-#define GM  (&iGlobalMallocState)
-#define __HEAP_CORRUPTED_TRACE(t,p,l) BTraceContext12(BTrace::EHeap, BTrace::EHeapCorruption, (TUint32)t, (TUint32)p, (TUint32)l);
-#define __HEAP_CORRUPTED_TEST(c,x, p,l) if (!c) { if (iFlags & (EMonitorMemory+ETraceAllocs) )  __HEAP_CORRUPTED_TRACE(this,p,l)  HEAP_PANIC(x); }
-#define __HEAP_CORRUPTED_TEST_STATIC(c,t,x,p,l) if (!c) { if (t && (t->iFlags & (EMonitorMemory+ETraceAllocs) )) __HEAP_CORRUPTED_TRACE(t,p,l) HEAP_PANIC(x); }
-
-TInt RHybridHeap::DebugFunction(TInt aFunc, TAny* a1, TAny* a2)
-{
-    TInt r = KErrNone;
-    switch(aFunc)
-        {
-        
-        case RAllocator::ECount:
-            struct HeapInfo info;
-            Lock();
-            GetInfo(&info, NULL);
-            *(unsigned*)a1 = info.iFreeN;
-            r = info.iAllocN;
-            Unlock();
-            break;
-            
-        case RAllocator::EMarkStart:
-            __DEBUG_ONLY(DoMarkStart());
-            break;
-            
-        case RAllocator::EMarkEnd:
-            __DEBUG_ONLY( r = DoMarkEnd((TInt)a1) );
-            break;
-            
-        case RAllocator::ECheck:
-            r = DoCheckHeap((SCheckInfo*)a1);
-            break;
-            
-        case RAllocator::ESetFail:
-            __DEBUG_ONLY(DoSetAllocFail((TAllocFail)(TInt)a1, (TInt)a2));
-            break;
-
-        case RAllocator::EGetFail:
-            __DEBUG_ONLY(r = iFailType);
-            break;
-
-        case RAllocator::ESetBurstFail:
-#if _DEBUG
-            {
-            SRAllocatorBurstFail* fail = (SRAllocatorBurstFail*) a2;
-            DoSetAllocFail((TAllocFail)(TInt)a1, fail->iRate, fail->iBurst);
-            }
-#endif
-            break;
-            
-        case RAllocator::ECheckFailure:
-            // iRand will be incremented for each EFailNext, EBurstFailNext,
-            // EDeterministic and EBurstDeterministic failure.
-            r = iRand;
-            break;
-            
-        case RAllocator::ECopyDebugInfo:
-            {
-            TInt nestingLevel = ((SDebugCell*)a1)[-1].nestingLevel;
-            ((SDebugCell*)a2)[-1].nestingLevel = nestingLevel;
-            break;
-            }
-
-		case RAllocator::EGetSize:
-			{
-			r = iChunkSize - sizeof(RHybridHeap);
-			break;
-			}
-
-		case RAllocator::EGetMaxLength:
-			{
-			r = iMaxLength;
-			break;
-			}
-
-		case RAllocator::EGetBase:
-			{
-			*(TAny**)a1 = iBase;
-			break;
-			}
-
-		case RAllocator::EAlignInteger:
-			{
-			r = _ALIGN_UP((TInt)a1, iAlign);
-			break;
-			}
-
-		case RAllocator::EAlignAddr:
-			{
-            *(TAny**)a2 = (TAny*)_ALIGN_UP((TLinAddr)a1, iAlign);
-			break;
-			}
-
-        case RHybridHeap::EWalk:
-            struct HeapInfo hinfo;
-            SWalkInfo winfo;
-            Lock();
-            winfo.iFunction = (TWalkFunc)a1;
-            winfo.iParam    = a2;
-			winfo.iHeap     = (RHybridHeap*)this; 	
-            GetInfo(&hinfo, &winfo);
-            Unlock();
-            break;
-
-#ifndef __KERNEL_MODE__
-			
-        case RHybridHeap::EHybridHeap:
-            {
-			if ( !a1 )
-				return KErrGeneral;
-			STestCommand* cmd = (STestCommand*)a1;
-			switch ( cmd->iCommand )
-				{
-				case EGetConfig:
-					cmd->iConfig.iSlabBits = iSlabConfigBits;
-					cmd->iConfig.iDelayedSlabThreshold = iPageThreshold;
-					cmd->iConfig.iPagePower = iPageThreshold;
-					break;
-					
-				case ESetConfig:
-					//
-					// New configuration data for slab and page allocator.
-					// Reset heap to get data into use
-					//
-#if USE_HYBRID_HEAP
-					iSlabConfigBits  = cmd->iConfig.iSlabBits & 0x3fff;
-					iSlabInitThreshold = cmd->iConfig.iDelayedSlabThreshold;
-					iPageThreshold = (cmd->iConfig.iPagePower & 0x1f);
-					Reset();
-#endif
-					break;
-					
-				case EHeapMetaData:
-					cmd->iData = this;
-					break;
-					
-				case ETestData:
-					iTestData = cmd->iData;
-					break;
-
-				default:
-					return KErrNotSupported;
-					
-				}
-
-            break;
-			}
-#endif  // __KERNEL_MODE            
-            
-        default:
-            return KErrNotSupported;
-            
-        }
-    return r;
-}
-
-void RHybridHeap::Walk(SWalkInfo* aInfo, TAny* aBfr, TInt aLth, TCellType aBfrType, TAllocatorType aAllocatorType)
-{
-    //
-    // This function is always called from RHybridHeap::GetInfo.
-    // Actual walk function is called if SWalkInfo pointer is defined
-    // 
-    //
-    if ( aInfo )
-        {
-#ifdef __KERNEL_MODE__
-		(void)aAllocatorType;
-#if defined(_DEBUG)		
-		if ( aBfrType == EGoodAllocatedCell )
-			aInfo->iFunction(aInfo->iParam, aBfrType, ((TUint8*)aBfr+EDebugHdrSize), (aLth-EDebugHdrSize) );
-		else
-			aInfo->iFunction(aInfo->iParam, aBfrType,  aBfr, aLth );
-#else
-		aInfo->iFunction(aInfo->iParam, aBfrType, aBfr, aLth );
-#endif
-		
-#else  // __KERNEL_MODE__
-		
-        if ( aAllocatorType & (EFullSlab + EPartialFullSlab + EEmptySlab + ESlabSpare) )
-			{
-			if ( aInfo->iHeap )
-				{
-				TUint32 dummy;
-				TInt    npages;
-				aInfo->iHeap->DoCheckSlab((slab*)aBfr, aAllocatorType);
-				__HEAP_CORRUPTED_TEST_STATIC(aInfo->iHeap->CheckBitmap(Floor(aBfr, PAGESIZE), PAGESIZE, dummy, npages),
-											 aInfo->iHeap, ETHeapBadCellAddress, aBfr, aLth);
-				}
-			if ( aAllocatorType & EPartialFullSlab )
-				 WalkPartialFullSlab(aInfo, (slab*)aBfr, aBfrType, aLth);	
-            else if ( aAllocatorType & EFullSlab )
-					WalkFullSlab(aInfo, (slab*)aBfr, aBfrType, aLth);
-			}
-#if defined(_DEBUG)     
-        else  if ( aBfrType == EGoodAllocatedCell )
-            aInfo->iFunction(aInfo->iParam, aBfrType, ((TUint8*)aBfr+EDebugHdrSize), (aLth-EDebugHdrSize) );
-        else
-            aInfo->iFunction(aInfo->iParam, aBfrType,  aBfr, aLth );
-#else
-        else
-            aInfo->iFunction(aInfo->iParam, aBfrType, aBfr, aLth );
-#endif
-
-#endif // __KERNEL_MODE	
-        }
-}
-
-#ifndef __KERNEL_MODE__
-void RHybridHeap::WalkPartialFullSlab(SWalkInfo* aInfo, slab* aSlab, TCellType /*aBfrType*/, TInt /*aLth*/)
-{
-	if ( aInfo )
-		{
-		//
-		// Build bitmap of free buffers in the partial full slab
-		//
-		TUint32 bitmap[4];
-		__HEAP_CORRUPTED_TEST_STATIC( (aInfo->iHeap != NULL), aInfo->iHeap, ETHeapBadCellAddress, 0, aSlab);
-		aInfo->iHeap->BuildPartialSlabBitmap(bitmap, aSlab);
-		//
-		// Find used (allocated) buffers from iPartial full slab
-		//
-		TUint32 h = aSlab->iHeader;
-		TUint32 size = SlabHeaderSize(h);
-		TUint32 count = KMaxSlabPayload / size;  // Total buffer count in slab
-		TUint32 i = 0;
-		TUint32 ix = 0;
-		TUint32 bit = 1;				
-
-		while ( i < count )
-			{
-
-			if ( bitmap[ix] & bit )
-				{
-				aInfo->iFunction(aInfo->iParam, EGoodFreeCell, &aSlab->iPayload[i*size], size ); 
-				} 
-			else
-				{
-#if defined(_DEBUG)
-				aInfo->iFunction(aInfo->iParam, EGoodAllocatedCell, (&aSlab->iPayload[i*size]+EDebugHdrSize), (size-EDebugHdrSize) );
-#else				
-				aInfo->iFunction(aInfo->iParam, EGoodAllocatedCell, &aSlab->iPayload[i*size], size );
-#endif
-				}
-			bit <<= 1;
-			if ( bit == 0 )
-				{
-				bit = 1;
-				ix ++;
-				}
-
-			i ++;
-			}
-		}
-
-}
-
-void RHybridHeap::WalkFullSlab(SWalkInfo* aInfo, slab* aSlab, TCellType aBfrType, TInt /*aLth*/)
-{
-	if ( aInfo )
-		{
-		TUint32 h = aSlab->iHeader;
-		TUint32 size = SlabHeaderSize(h);
-		TUint32 count = (SlabHeaderUsedm4(h) + 4) / size;
-		TUint32 i = 0;
-		while ( i < count )
-			{
-#if defined(_DEBUG)
-			if ( aBfrType == EGoodAllocatedCell )
-				aInfo->iFunction(aInfo->iParam, aBfrType, (&aSlab->iPayload[i*size]+EDebugHdrSize), (size-EDebugHdrSize) );
-			else
-				aInfo->iFunction(aInfo->iParam, aBfrType, &aSlab->iPayload[i*size], size );
-#else
-			aInfo->iFunction(aInfo->iParam, aBfrType, &aSlab->iPayload[i*size], size );
-#endif      
-			i ++;
-			}
-		}
-}
-
-void RHybridHeap::BuildPartialSlabBitmap(TUint32* aBitmap, slab* aSlab, TAny* aBfr)
-{
-	//
-	// Build a bitmap of free buffers in a partial full slab
-	//
-	TInt i;
-	TUint32 bit = 0;
-	TUint32 index;  
-	TUint32 h = aSlab->iHeader;
-	TUint32 used = SlabHeaderUsedm4(h)+4;
-	TUint32 size = SlabHeaderSize(h);
-	TInt    count = (KMaxSlabPayload / size);
-	TInt    free_count = count -  (used / size); // Total free buffer count in slab
-	aBitmap[0] = 0, aBitmap[1] = 0,	aBitmap[2] = 0, aBitmap[3] = 0;
-	TUint32 offs = (h & 0xff) << 2;
-
-	//
-	// Process first buffer in partial slab free buffer chain
-	//
-	while ( offs )
-		{
-		unsigned char* p = (unsigned char*)Offset(aSlab, offs); 		
-		__HEAP_CORRUPTED_TEST( (sizeof(slabhdr) <= offs), ETHeapBadCellAddress, p, aSlab);
-		offs -= sizeof(slabhdr);
-		__HEAP_CORRUPTED_TEST( (offs % size == 0), ETHeapBadCellAddress, p, aSlab);
-		index = (offs / size);  // Bit index in bitmap
-		i = 0;
-		while ( i < 4 )
-			{
-			if ( index < 32 )
-				{
-				bit = (1 << index);
-				break;
-				}
-			index -= 32;
-			i ++;
-			}
-
-		__HEAP_CORRUPTED_TEST( ((aBitmap[i] & bit) == 0), ETHeapBadCellAddress, p, aSlab);  // Buffer already in chain
-
-		aBitmap[i] |= bit;
-		free_count --;
-		offs = ((unsigned)*p) << 2; // Next in free chain
-		}
-
-	__HEAP_CORRUPTED_TEST( (free_count >= 0), ETHeapBadCellAddress, aBfr, aSlab);  // free buffer count/size mismatch	
-	//
-	// Process next rest of the free buffers which are in the
-	// wilderness (at end of the slab)
-	//
-	index = count - 1;
-	i = index / 32;
-	index = index % 32;
-	while ( free_count && (i >= 0))
-		{
-		bit = (1 << index);
-		__HEAP_CORRUPTED_TEST( ((aBitmap[i] & bit) == 0), ETHeapBadCellAddress, aBfr, aSlab);  // Buffer already in chain
-		aBitmap[i] |= bit;
-		if ( index )
-			index --;
-		else
-			{
-			index = 31;
-			i --;
-			}
-		free_count --;
-		}
-
-	if ( aBfr )  // Assure that specified buffer does NOT exist in partial slab free buffer chain
-		{
-		offs = LowBits(aBfr, SLABSIZE);
-		__HEAP_CORRUPTED_TEST( (sizeof(slabhdr) <= offs), ETHeapBadCellAddress, aBfr, aSlab);
-		offs -= sizeof(slabhdr);
-		__HEAP_CORRUPTED_TEST( ((offs % size) == 0), ETHeapBadCellAddress, aBfr, aSlab);
-		index = (offs / size);  // Bit index in bitmap
-		i = 0;
-		while ( i < 4 )
-			{
-			if ( index < 32 )
-				{
-				bit = (1 << index);
-				break;
-				}
-			index -= 32;
-			i ++;
-			}
-		__HEAP_CORRUPTED_TEST( ((aBitmap[i] & bit) == 0), ETHeapBadCellAddress, aBfr, aSlab);  // Buffer already in chain
-		}
-}
-
-#endif	// __KERNEL_MODE__
-
-void RHybridHeap::WalkCheckCell(TAny* aPtr, TCellType aType, TAny* aCell, TInt aLen)
-{
-    (void)aCell;
-    SHeapCellInfo& info = *(SHeapCellInfo*)aPtr;
-    switch(aType)
-        {
-        case EGoodAllocatedCell:
-            {
-            ++info.iTotalAlloc;
-            info.iTotalAllocSize += aLen; 
-#if defined(_DEBUG)
-            RHybridHeap& h = *info.iHeap;
-            SDebugCell* DbgCell = (SDebugCell*)((TUint8*)aCell-EDebugHdrSize);
-            if ( DbgCell->nestingLevel == h.iNestingLevel )
-                {
-                if (++info.iLevelAlloc==1)
-                    info.iStranded = DbgCell;
-#ifdef __KERNEL_MODE__
-                if (KDebugNum(KSERVER) || KDebugNum(KTESTFAST))
-                    {
-                    Kern::Printf("LEAKED KERNEL HEAP CELL @ %08x : len=%d", aCell, aLen);
-                    TLinAddr base = ((TLinAddr)aCell)&~0x0f;
-                    TLinAddr end = ((TLinAddr)aCell)+(TLinAddr)aLen;
-                    while(base<end)
-                        {
-                        const TUint32* p = (const TUint32*)base;
-                        Kern::Printf("%08x: %08x %08x %08x %08x", p, p[0], p[1], p[2], p[3]);
-                        base += 16;
-                        }
-                    }
-#endif
-                }
-#endif  
-            break;
-            }
-        case EGoodFreeCell:
-            ++info.iTotalFree;
-            break;
-        case EBadAllocatedCellSize:
-            HEAP_PANIC(ETHeapBadAllocatedCellSize);
-        case EBadAllocatedCellAddress:
-            HEAP_PANIC(ETHeapBadAllocatedCellAddress);
-        case EBadFreeCellAddress:
-            HEAP_PANIC(ETHeapBadFreeCellAddress);
-        case EBadFreeCellSize:
-            HEAP_PANIC(ETHeapBadFreeCellSize);
-        default:
-            HEAP_PANIC(ETHeapWalkBadCellType);
-        }
-}
-
-
-TInt RHybridHeap::DoCheckHeap(SCheckInfo* aInfo)
-{
-    (void)aInfo;
-    SHeapCellInfo info;
-    memclr(&info, sizeof(info));
-    info.iHeap = this;
-    struct HeapInfo hinfo;
-    SWalkInfo winfo;
-    Lock();
-	DoCheckMallocState(GM);  // Check DL heap internal structure
-#ifndef __KERNEL_MODE__
-	TUint32 dummy;
-	TInt    npages;
-	__HEAP_CORRUPTED_TEST(CheckBitmap(NULL, 0, dummy, npages), ETHeapBadCellAddress, this, 0);  // Check page allocator buffers
-	DoCheckSlabTrees();	
-	DoCheckCommittedSize(npages, GM);
-#endif				   
-    winfo.iFunction = WalkCheckCell;
-    winfo.iParam    = &info;
-	winfo.iHeap     = (RHybridHeap*)this; 		
-    GetInfo(&hinfo, &winfo);
-    Unlock();
-    
-#if defined(_DEBUG)
-    if (!aInfo)
-        return KErrNone;
-    TInt expected = aInfo->iCount;
-    TInt actual = aInfo->iAll ? info.iTotalAlloc : info.iLevelAlloc;
-    if (actual!=expected && !iTestData)
-        {
-#ifdef __KERNEL_MODE__
-        Kern::Fault("KERN-ALLOC COUNT", (expected<<16)|actual );
-#else
-        User::Panic(_L("ALLOC COUNT"), (expected<<16)|actual );
-#endif
-        }
-#endif
-    return KErrNone;
-}
-
-#ifdef _DEBUG
-void RHybridHeap::DoMarkStart()
-{
-    if (iNestingLevel==0)
-        iAllocCount=0;
-    iNestingLevel++;
-}
-
-TUint32 RHybridHeap::DoMarkEnd(TInt aExpected)
-{
-    if (iNestingLevel==0)
-        return 0;
-    SHeapCellInfo info;
-    SHeapCellInfo* p = iTestData ? (SHeapCellInfo*)iTestData : &info;
-    memclr(p, sizeof(info));
-    p->iHeap = this;
-    struct HeapInfo hinfo;
-    SWalkInfo winfo;
-    Lock();
-    winfo.iFunction = WalkCheckCell;
-    winfo.iParam    = p;
-	winfo.iHeap     = (RHybridHeap*)this; 	
-    GetInfo(&hinfo, &winfo);
-    Unlock();
-    
-    if (p->iLevelAlloc != aExpected && !iTestData)
-        return (TUint32)(p->iStranded + 1);
-    if (--iNestingLevel == 0)
-        iAllocCount = 0;
-    return 0;
-}
-
-void RHybridHeap::DoSetAllocFail(TAllocFail aType, TInt aRate)
-{// Default to a burst mode of 1, as aType may be a burst type.
-    DoSetAllocFail(aType, aRate, 1);
-}
-
-void ResetAllocCellLevels(TAny* aPtr, RHybridHeap::TCellType aType, TAny* aCell, TInt aLen)
-{
-    (void)aPtr;
-    (void)aLen;
-    
-    if (aType == RHybridHeap::EGoodAllocatedCell)
-        {
-        RHybridHeap::SDebugCell* DbgCell = (RHybridHeap::SDebugCell*)((TUint8*)aCell-RHeap::EDebugHdrSize);
-        DbgCell->nestingLevel = 0;
-        }
-}
-
-// Don't change as the ETHeapBadDebugFailParameter check below and the API 
-// documentation rely on this being 16 for RHybridHeap.
-LOCAL_D const TInt KBurstFailRateShift = 16;
-LOCAL_D const TInt KBurstFailRateMask = (1 << KBurstFailRateShift) - 1;
-
-void RHybridHeap::DoSetAllocFail(TAllocFail aType, TInt aRate, TUint aBurst)
-{
-    if (aType==EReset)
-        {
-        // reset levels of all allocated cells to 0
-        // this should prevent subsequent tests failing unnecessarily
-        iFailed = EFalse;       // Reset for ECheckFailure relies on this.
-        struct HeapInfo hinfo;
-        SWalkInfo winfo;
-        Lock();
-        winfo.iFunction = (TWalkFunc)&ResetAllocCellLevels;
-        winfo.iParam    = NULL;
-		winfo.iHeap     = (RHybridHeap*)this; 	
-        GetInfo(&hinfo, &winfo);
-        Unlock();
-        // reset heap allocation mark as well
-        iNestingLevel=0;
-        iAllocCount=0;
-        aType=ENone;
-        }
-    
-    switch (aType)
-        {
-        case EBurstRandom:
-        case EBurstTrueRandom:
-        case EBurstDeterministic:
-        case EBurstFailNext:
-            // If the fail type is a burst type then iFailRate is split in 2:
-            // the 16 lsbs are the fail rate and the 16 msbs are the burst length.
-            if (TUint(aRate) > (TUint)KMaxTUint16 || aBurst > KMaxTUint16)
-                HEAP_PANIC(ETHeapBadDebugFailParameter);
-            
-            iFailed = EFalse;
-            iFailType = aType;
-            iFailRate = (aRate == 0) ? 1 : aRate;
-            iFailAllocCount = -iFailRate;
-            iFailRate = iFailRate | (aBurst << KBurstFailRateShift);
-            break;
-            
-        default:
-            iFailed = EFalse;
-            iFailType = aType;
-            iFailRate = (aRate == 0) ? 1 : aRate; // A rate of <1 is meaningless
-            iFailAllocCount = 0;
-            break;
-        }
-    
-    // Set up iRand for either:
-    //      - random seed value, or
-    //      - a count of the number of failures so far.
-    iRand = 0;
-#ifndef __KERNEL_MODE__
-    switch (iFailType)
-        {
-        case ETrueRandom:
-        case EBurstTrueRandom:
-            {
-            TTime time;
-            time.HomeTime();
-            TInt64 seed = time.Int64();
-            iRand = Math::Rand(seed);
-            break;
-            }
-        case ERandom:
-        case EBurstRandom:
-            {
-            TInt64 seed = 12345;
-            iRand = Math::Rand(seed);
-            break;
-            }
-        default:
-            break;
-        }
-#endif
-}
-
-TBool RHybridHeap::CheckForSimulatedAllocFail()
-//
-// Check to see if the user has requested simulated alloc failure, and if so possibly 
-// Return ETrue indicating a failure.
-//
-{
-    // For burst mode failures iFailRate is shared
-    TUint16 rate  = (TUint16)(iFailRate &  KBurstFailRateMask);
-    TUint16 burst = (TUint16)(iFailRate >> KBurstFailRateShift);
-    TBool r = EFalse;
-    switch (iFailType)
-        {
-#ifndef __KERNEL_MODE__
-        case ERandom:
-        case ETrueRandom:
-            if (++iFailAllocCount>=iFailRate) 
-                {   
-                iFailAllocCount=0;
-                if (!iFailed) // haven't failed yet after iFailRate allocations so fail now
-                    return(ETrue); 
-                iFailed=EFalse;
-                }
-            else   
-                {
-                if (!iFailed)
-                    {
-                    TInt64 seed=iRand;
-                    iRand=Math::Rand(seed);
-                    if (iRand%iFailRate==0)
-                        {
-                        iFailed=ETrue;
-                        return(ETrue);
-                        }
-                    }
-                }
-            break;
-            
-        case EBurstRandom:
-        case EBurstTrueRandom:
-            if (++iFailAllocCount < 0) 
-                {
-                // We haven't started failing yet so should we now?
-                TInt64 seed = iRand;
-                iRand = Math::Rand(seed);
-                if (iRand % rate == 0)
-                    {// Fail now.  Reset iFailAllocCount so we fail burst times
-                    iFailAllocCount = 0;
-                    r = ETrue;
-                    }
-                }
-            else
-                {
-                if (iFailAllocCount < burst)
-                    {// Keep failing for burst times
-                    r = ETrue;
-                    }
-                else
-                    {// We've now failed burst times so start again.
-                    iFailAllocCount = -(rate - 1);
-                    }
-                }
-            break;
-#endif
-        case EDeterministic:
-            if (++iFailAllocCount%iFailRate==0)
-                {
-                r=ETrue;
-                iRand++;    // Keep count of how many times we have failed
-                }
-            break;
-            
-        case EBurstDeterministic:
-            // This will fail burst number of times, every rate attempts.
-            if (++iFailAllocCount >= 0)
-                {
-                if (iFailAllocCount == burst - 1)
-                    {// This is the burst time we have failed so make it the last by
-                    // reseting counts so we next fail after rate attempts.
-                    iFailAllocCount = -rate;
-                    }
-                r = ETrue;
-                iRand++;    // Keep count of how many times we have failed
-                }
-            break;
-            
-        case EFailNext:
-            if ((++iFailAllocCount%iFailRate)==0)
-                {
-                iFailType=ENone;
-                r=ETrue;
-                iRand++;    // Keep count of how many times we have failed
-                }
-            break;
-            
-        case EBurstFailNext:
-            if (++iFailAllocCount >= 0)
-                {
-                if (iFailAllocCount == burst - 1)
-                    {// This is the burst time we have failed so make it the last.
-                    iFailType = ENone;
-                    }
-                r = ETrue;
-                iRand++;    // Keep count of how many times we have failed
-                }
-            break;
-            
-        default:
-            break;
-        }
-    return r;
-}
-
-#endif  // DEBUG
-
-//
-//  Methods for Doug Lea allocator detailed check
-//
-
-void RHybridHeap::DoCheckAnyChunk(mstate m, mchunkptr p)
-{
-    __HEAP_CORRUPTED_TEST(((IS_ALIGNED(CHUNK2MEM(p))) || (p->iHead == FENCEPOST_HEAD)), ETHeapBadCellAddress, p, 0);
-	(void)m;
-}
-
-/* Check properties of iTop chunk */
-void RHybridHeap::DoCheckTopChunk(mstate m, mchunkptr p)
-{
-    msegmentptr sp = &m->iSeg;
-    size_t  sz = CHUNKSIZE(p);
-    __HEAP_CORRUPTED_TEST((sp != 0), ETHeapBadCellAddress, p, 0);
-    __HEAP_CORRUPTED_TEST(((IS_ALIGNED(CHUNK2MEM(p))) || (p->iHead == FENCEPOST_HEAD)), ETHeapBadCellAddress, p,0);
-    __HEAP_CORRUPTED_TEST((sz == m->iTopSize), ETHeapBadCellAddress,p,0);
-    __HEAP_CORRUPTED_TEST((sz > 0), ETHeapBadCellAddress,p,0);
-    __HEAP_CORRUPTED_TEST((sz == ((sp->iBase + sp->iSize) - (TUint8*)p) - TOP_FOOT_SIZE), ETHeapBadCellAddress,p,0);
-    __HEAP_CORRUPTED_TEST((PINUSE(p)), ETHeapBadCellAddress,p,0);
-    __HEAP_CORRUPTED_TEST((!NEXT_PINUSE(p)), ETHeapBadCellAddress,p,0);
-}
-
-/* Check properties of inuse chunks */
-void RHybridHeap::DoCheckInuseChunk(mstate m, mchunkptr p)
-{
-    DoCheckAnyChunk(m, p);
-    __HEAP_CORRUPTED_TEST((CINUSE(p)), ETHeapBadCellAddress,p,0);
-    __HEAP_CORRUPTED_TEST((NEXT_PINUSE(p)), ETHeapBadCellAddress,p,0);
-    /* If not PINUSE and not mmapped, previous chunk has OK offset */
-    __HEAP_CORRUPTED_TEST((PINUSE(p) || NEXT_CHUNK(PREV_CHUNK(p)) == p), ETHeapBadCellAddress,p,0);
-}
-
-/* Check properties of free chunks */
-void RHybridHeap::DoCheckFreeChunk(mstate m, mchunkptr p)
-{
-    size_t sz = p->iHead & ~(PINUSE_BIT|CINUSE_BIT);
-    mchunkptr next = CHUNK_PLUS_OFFSET(p, sz);
-    DoCheckAnyChunk(m, p);
-    __HEAP_CORRUPTED_TEST((!CINUSE(p)), ETHeapBadCellAddress,p,0);
-    __HEAP_CORRUPTED_TEST((!NEXT_PINUSE(p)), ETHeapBadCellAddress,p,0);
-    if (p != m->iDv && p != m->iTop)
-        {
-        if (sz >= MIN_CHUNK_SIZE)
-            {
-            __HEAP_CORRUPTED_TEST(((sz & CHUNK_ALIGN_MASK) == 0), ETHeapBadCellAddress,p,0);
-            __HEAP_CORRUPTED_TEST((IS_ALIGNED(CHUNK2MEM(p))), ETHeapBadCellAddress,p,0);
-            __HEAP_CORRUPTED_TEST((next->iPrevFoot == sz), ETHeapBadCellAddress,p,0);
-            __HEAP_CORRUPTED_TEST((PINUSE(p)), ETHeapBadCellAddress,p,0);
-            __HEAP_CORRUPTED_TEST( (next == m->iTop || CINUSE(next)), ETHeapBadCellAddress,p,0);
-            __HEAP_CORRUPTED_TEST((p->iFd->iBk == p), ETHeapBadCellAddress,p,0);
-            __HEAP_CORRUPTED_TEST((p->iBk->iFd == p), ETHeapBadCellAddress,p,0);
-            }
-        else    /* markers are always of size SIZE_T_SIZE */
-            __HEAP_CORRUPTED_TEST((sz == SIZE_T_SIZE), ETHeapBadCellAddress,p,0);
-        }
-}
-
-/* Check properties of malloced chunks at the point they are malloced */
-void RHybridHeap::DoCheckMallocedChunk(mstate m, void* mem, size_t s)
-{
-    if (mem != 0)
-        {
-        mchunkptr p = MEM2CHUNK(mem);
-        size_t sz = p->iHead & ~(PINUSE_BIT|CINUSE_BIT);
-        DoCheckInuseChunk(m, p);
-        __HEAP_CORRUPTED_TEST(((sz & CHUNK_ALIGN_MASK) == 0), ETHeapBadCellAddress,p,0);
-        __HEAP_CORRUPTED_TEST((sz >= MIN_CHUNK_SIZE), ETHeapBadCellAddress,p,0);
-        __HEAP_CORRUPTED_TEST((sz >= s), ETHeapBadCellAddress,p,0);
-        /* unless mmapped, size is less than MIN_CHUNK_SIZE more than request */
-        __HEAP_CORRUPTED_TEST((sz < (s + MIN_CHUNK_SIZE)), ETHeapBadCellAddress,p,0);
-        }
-}
-
-/* Check a tree and its subtrees.   */
-void RHybridHeap::DoCheckTree(mstate m, tchunkptr t)
-{
-    tchunkptr head = 0;
-    tchunkptr u = t;
-    bindex_t tindex = t->iIndex;
-    size_t tsize = CHUNKSIZE(t);
-    bindex_t idx;
-    DoComputeTreeIndex(tsize, idx);
-    __HEAP_CORRUPTED_TEST((tindex == idx), ETHeapBadCellAddress,u,0);
-    __HEAP_CORRUPTED_TEST((tsize >= MIN_LARGE_SIZE), ETHeapBadCellAddress,u,0);
-    __HEAP_CORRUPTED_TEST((tsize >= MINSIZE_FOR_TREE_INDEX(idx)), ETHeapBadCellAddress,u,0);
-    __HEAP_CORRUPTED_TEST(((idx == NTREEBINS-1) || (tsize < MINSIZE_FOR_TREE_INDEX((idx+1)))), ETHeapBadCellAddress,u,0);
-    
-    do
-        { /* traverse through chain of same-sized nodes */
-        DoCheckAnyChunk(m, ((mchunkptr)u));
-        __HEAP_CORRUPTED_TEST((u->iIndex == tindex), ETHeapBadCellAddress,u,0);
-        __HEAP_CORRUPTED_TEST((CHUNKSIZE(u) == tsize), ETHeapBadCellAddress,u,0);
-        __HEAP_CORRUPTED_TEST((!CINUSE(u)), ETHeapBadCellAddress,u,0);
-        __HEAP_CORRUPTED_TEST((!NEXT_PINUSE(u)), ETHeapBadCellAddress,u,0);
-        __HEAP_CORRUPTED_TEST((u->iFd->iBk == u), ETHeapBadCellAddress,u,0);
-        __HEAP_CORRUPTED_TEST((u->iBk->iFd == u), ETHeapBadCellAddress,u,0);
-        if (u->iParent == 0)
-            {
-            __HEAP_CORRUPTED_TEST((u->iChild[0] == 0), ETHeapBadCellAddress,u,0);
-            __HEAP_CORRUPTED_TEST((u->iChild[1] == 0), ETHeapBadCellAddress,u,0);
-            }
-        else
-            {
-            __HEAP_CORRUPTED_TEST((head == 0), ETHeapBadCellAddress,u,0); /* only one node on chain has iParent */
-            head = u;
-            __HEAP_CORRUPTED_TEST((u->iParent != u), ETHeapBadCellAddress,u,0);
-            __HEAP_CORRUPTED_TEST( (u->iParent->iChild[0] == u ||
-                    u->iParent->iChild[1] == u ||
-                    *((tbinptr*)(u->iParent)) == u), ETHeapBadCellAddress,u,0);
-            if (u->iChild[0] != 0)
-                {
-                __HEAP_CORRUPTED_TEST((u->iChild[0]->iParent == u), ETHeapBadCellAddress,u,0);
-                __HEAP_CORRUPTED_TEST((u->iChild[0] != u), ETHeapBadCellAddress,u,0);
-                DoCheckTree(m, u->iChild[0]);
-                }
-            if (u->iChild[1] != 0)
-                {
-                __HEAP_CORRUPTED_TEST((u->iChild[1]->iParent == u), ETHeapBadCellAddress,u,0);
-                __HEAP_CORRUPTED_TEST((u->iChild[1] != u), ETHeapBadCellAddress,u,0);
-                DoCheckTree(m, u->iChild[1]);
-                }
-            if (u->iChild[0] != 0 && u->iChild[1] != 0)
-                {
-                __HEAP_CORRUPTED_TEST((CHUNKSIZE(u->iChild[0]) < CHUNKSIZE(u->iChild[1])), ETHeapBadCellAddress,u,0);
-                }
-            }
-        u = u->iFd;
-        }
-    while (u != t);
-    __HEAP_CORRUPTED_TEST((head != 0), ETHeapBadCellAddress,u,0);
-}
-
-/*  Check all the chunks in a treebin.  */
-void RHybridHeap::DoCheckTreebin(mstate m, bindex_t i)
-{
-    tbinptr* tb = TREEBIN_AT(m, i);
-    tchunkptr t = *tb;
-    int empty = (m->iTreeMap & (1U << i)) == 0;
-    if (t == 0)
-        __HEAP_CORRUPTED_TEST((empty), ETHeapBadCellAddress,t,0);
-    if (!empty)
-        DoCheckTree(m, t);
-}
-
-/*  Check all the chunks in a smallbin. */
-void RHybridHeap::DoCheckSmallbin(mstate m, bindex_t i)
-{
-    sbinptr b = SMALLBIN_AT(m, i);
-    mchunkptr p = b->iBk;
-    unsigned int empty = (m->iSmallMap & (1U << i)) == 0;
-    if (p == b)
-        __HEAP_CORRUPTED_TEST((empty), ETHeapBadCellAddress,p,0);
-    if (!empty)
-        {
-        for (; p != b; p = p->iBk)
-            {
-            size_t size = CHUNKSIZE(p);
-            mchunkptr q;
-            /* each chunk claims to be free */
-            DoCheckFreeChunk(m, p);
-            /* chunk belongs in bin */
-            __HEAP_CORRUPTED_TEST((SMALL_INDEX(size) == i), ETHeapBadCellAddress,p,0);
-            __HEAP_CORRUPTED_TEST((p->iBk == b || CHUNKSIZE(p->iBk) == CHUNKSIZE(p)), ETHeapBadCellAddress,p,0);
-            /* chunk is followed by an inuse chunk */
-            q = NEXT_CHUNK(p);
-            if (q->iHead != FENCEPOST_HEAD)
-                DoCheckInuseChunk(m, q);
-            }
-        }
-}
-
-/* Find x in a bin. Used in other check functions. */
-TInt RHybridHeap::BinFind(mstate m, mchunkptr x)
-{
-    size_t size = CHUNKSIZE(x);
-    if (IS_SMALL(size))
-        {
-        bindex_t sidx = SMALL_INDEX(size);
-        sbinptr b = SMALLBIN_AT(m, sidx);
-        if (SMALLMAP_IS_MARKED(m, sidx))
-            {
-            mchunkptr p = b;
-            do
-                {
-                if (p == x)
-                    return 1;
-                }
-            while ((p = p->iFd) != b);
-            }
-        }
-    else
-        {
-        bindex_t tidx;
-        DoComputeTreeIndex(size, tidx);
-        if (TREEMAP_IS_MARKED(m, tidx))
-            {
-            tchunkptr t = *TREEBIN_AT(m, tidx);
-            size_t sizebits = size << LEFTSHIFT_FOR_TREE_INDEX(tidx);
-            while (t != 0 && CHUNKSIZE(t) != size)
-                {
-                t = t->iChild[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1];
-                sizebits <<= 1;
-                }
-            if (t != 0)
-                {
-                tchunkptr u = t;
-                do
-                    {
-                    if (u == (tchunkptr)x)
-                        return 1;
-                    }
-                while ((u = u->iFd) != t);
-                }
-            }
-        }
-    return 0;
-}
-
-/* Traverse each chunk and check it; return total */
-size_t RHybridHeap::TraverseAndCheck(mstate m)
-{
-    size_t sum = 0;
-    msegmentptr s = &m->iSeg;
-    sum += m->iTopSize + TOP_FOOT_SIZE;
-    mchunkptr q = ALIGN_AS_CHUNK(s->iBase);
-    mchunkptr lastq = 0;
-    __HEAP_CORRUPTED_TEST((PINUSE(q)), ETHeapBadCellAddress,q,0);
-    while (q != m->iTop && q->iHead != FENCEPOST_HEAD)
-        {
-        sum += CHUNKSIZE(q);
-        if (CINUSE(q))
-            {
-            __HEAP_CORRUPTED_TEST((!BinFind(m, q)), ETHeapBadCellAddress,q,0);
-            DoCheckInuseChunk(m, q);
-            }
-        else
-            {
-            __HEAP_CORRUPTED_TEST((q == m->iDv || BinFind(m, q)), ETHeapBadCellAddress,q,0);
-            __HEAP_CORRUPTED_TEST((lastq == 0 || CINUSE(lastq)), ETHeapBadCellAddress,q,0); /* Not 2 consecutive free */
-            DoCheckFreeChunk(m, q);
-            }
-        lastq = q;
-        q = NEXT_CHUNK(q);
-        }
-    return sum;
-}
-
-/* Check all properties of malloc_state. */
-void RHybridHeap::DoCheckMallocState(mstate m)
-{
-    bindex_t i;
-//    size_t total;
-    /* check bins */
-    for (i = 0; i < NSMALLBINS; ++i)
-        DoCheckSmallbin(m, i);
-    for (i = 0; i < NTREEBINS; ++i)
-        DoCheckTreebin(m, i);
-    
-    if (m->iDvSize != 0)
-        { /* check iDv chunk */
-        DoCheckAnyChunk(m, m->iDv);
-        __HEAP_CORRUPTED_TEST((m->iDvSize == CHUNKSIZE(m->iDv)), ETHeapBadCellAddress,m->iDv,0);
-        __HEAP_CORRUPTED_TEST((m->iDvSize >= MIN_CHUNK_SIZE), ETHeapBadCellAddress,m->iDv,0);
-        __HEAP_CORRUPTED_TEST((BinFind(m, m->iDv) == 0), ETHeapBadCellAddress,m->iDv,0);
-        }
-    
-    if (m->iTop != 0)
-        {    /* check iTop chunk */
-        DoCheckTopChunk(m, m->iTop);
-        __HEAP_CORRUPTED_TEST((m->iTopSize == CHUNKSIZE(m->iTop)), ETHeapBadCellAddress,m->iTop,0);
-        __HEAP_CORRUPTED_TEST((m->iTopSize > 0), ETHeapBadCellAddress,m->iTop,0);
-        __HEAP_CORRUPTED_TEST((BinFind(m, m->iTop) == 0), ETHeapBadCellAddress,m->iTop,0);
-        }
-    
-//    total =
-    TraverseAndCheck(m);
-}
-
-#ifndef __KERNEL_MODE__
-//
-//  Methods for Slab allocator detailed check
-//
-void RHybridHeap::DoCheckSlabTree(slab** aS, TBool aPartialPage)
-{
-	slab* s = *aS;
-	if (!s)
-		return;
-
-	TUint size = SlabHeaderSize(s->iHeader);
-	slab** parent = aS;
-	slab** child2 = &s->iChild2;
-
-	while ( s )
-		{
-		__HEAP_CORRUPTED_TEST((s->iParent == parent), ETHeapBadCellAddress,s,SLABSIZE);
-		__HEAP_CORRUPTED_TEST((!s->iChild1 || s < s->iChild1), ETHeapBadCellAddress,s,SLABSIZE);
-		__HEAP_CORRUPTED_TEST((!s->iChild2 || s < s->iChild2), ETHeapBadCellAddress,s,SLABSIZE);
-
-		if ( aPartialPage )
-			{
-			if ( s->iChild1 )
-				size = SlabHeaderSize(s->iChild1->iHeader);
-			}
-		else
-			{
-			__HEAP_CORRUPTED_TEST((SlabHeaderSize(s->iHeader) == size), ETHeapBadCellAddress,s,SLABSIZE);
-			}
-		parent = &s->iChild1;
-		s = s->iChild1;
-
-		}
-
-	parent = child2;
-	s = *child2;
-
-	while ( s )
-		{
-		__HEAP_CORRUPTED_TEST((s->iParent == parent), ETHeapBadCellAddress,s,SLABSIZE);
-		__HEAP_CORRUPTED_TEST((!s->iChild1 || s < s->iChild1), ETHeapBadCellAddress,s,SLABSIZE);
-		__HEAP_CORRUPTED_TEST((!s->iChild2 || s < s->iChild2), ETHeapBadCellAddress,s,SLABSIZE);
-
-		if ( aPartialPage )
-			{
-			if ( s->iChild2 )
-				size = SlabHeaderSize(s->iChild2->iHeader);
-			}
-		else
-			{
-			__HEAP_CORRUPTED_TEST((SlabHeaderSize(s->iHeader) == size), ETHeapBadCellAddress,s,SLABSIZE);
-			}
-		parent = &s->iChild2;
-		s = s->iChild2;
-
-		}
-
-}
-
-void RHybridHeap::DoCheckSlabTrees()
-{
-	for (TInt i = 0; i < (MAXSLABSIZE>>2); ++i)
-		DoCheckSlabTree(&iSlabAlloc[i].iPartial, EFalse);
-	DoCheckSlabTree(&iPartialPage, ETrue);
-}
-
-void RHybridHeap::DoCheckSlab(slab* aSlab, TAllocatorType aSlabType, TAny* aBfr)
-{
-   if ( (aSlabType == ESlabSpare) || (aSlabType == EEmptySlab) )
-	  return;
-   
-   unsigned h = aSlab->iHeader;
-   __HEAP_CORRUPTED_TEST((ZEROBITS(h)), ETHeapBadCellAddress,aBfr,aSlab);   
-   unsigned used = SlabHeaderUsedm4(h)+4;
-   unsigned size = SlabHeaderSize(h);
-   __HEAP_CORRUPTED_TEST( (used < SLABSIZE),ETHeapBadCellAddress, aBfr, aSlab);
-   __HEAP_CORRUPTED_TEST( ((size > 3 ) && (size < MAXSLABSIZE)), ETHeapBadCellAddress,aBfr,aSlab);         
-	unsigned count = 0;
-
-	switch ( aSlabType )
-		{
-		case EFullSlab:
-			count = (KMaxSlabPayload / size );			
-  			__HEAP_CORRUPTED_TEST((used == count*size), ETHeapBadCellAddress,aBfr,aSlab);	
-			__HEAP_CORRUPTED_TEST((HeaderFloating(h)), ETHeapBadCellAddress,aBfr,aSlab);
-			break;
-
-		case EPartialFullSlab:
-			__HEAP_CORRUPTED_TEST(((used % size)==0),ETHeapBadCellAddress,aBfr,aSlab);
-			__HEAP_CORRUPTED_TEST(((SlabHeaderFree(h) == 0) || (((SlabHeaderFree(h)<<2)-sizeof(slabhdr)) % SlabHeaderSize(h) == 0)),
-								  ETHeapBadCellAddress,aBfr,aSlab);
-			break;
-
-		default:
-            break;
-			
-		}
-}
-
-//
-//  Check that committed size in heap equals number of pages in bitmap
-//  plus size of Doug Lea region
-//
-void RHybridHeap::DoCheckCommittedSize(TInt aNPages, mstate aM)
-{
-	TInt total_committed = (aNPages * iPageSize) + aM->iSeg.iSize + (iBase - (TUint8*)this);
-	__HEAP_CORRUPTED_TEST((total_committed == iChunkSize), ETHeapBadCellAddress,total_committed,iChunkSize);	
-}
-
-#endif  // __KERNEL_MODE__  
--- a/kernel/eka/common/des16.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/common/des16.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -765,13 +765,6 @@
 #endif
 	}
 
-// Surrogate-aware version of lookup() above.
-// aChar can be over 0xFFFF.
-inline TUint lookup2(const TUint aChar, const TText *aConv)
-	{
-	return TUnicode(aChar).Fold((TInt)aConv, GetLocaleCharSet()->iCharDataSet);
-	}
-
 TInt DoMatch16(const TDesC16 &aLeftD,const TDesC16 &aRightD,TMatchType aType)
 	{
 	const TText* table=convTable(aType);
@@ -1375,557 +1368,6 @@
 
 #endif  // !defined(__DES16_MACHINE_CODED__)
 
-
-/**
- * A helper function, which moves a pointer one Unicode character forward.
- * 
- * @aStart points to the head of the string to process.
- * @aEnd   points to the end of the string. Note that aEnd points to the first
- *         16-bit unit after the string. That is, the string length (i.e, count
- *         of 16-bit units) is (aEnd-aStart).
- * 
- * On return,
- *      if find valid character, then return KErrNone, with aNewStart pointing
- *          to the 16-bit unit after the found character;
- *      if meet corrupt surrogate before find a valid character, then return
- *          KErrCorruptSurrogateFound, with aNewStart pointing to the corrupt surrogate;
- *      if meet aEnd before find a valid character, then return KErrNotFound.
- * 
- * @return KErrNone if ok;
- *         KErrNotFound if get to aEnd;
- *         KErrCorruptSurrogateFound if meet corrupt surrogate.
- */
-TInt ProceedOneCharacter(const TText16* aStart, const TText16* aEnd, TText16*& aNewStart, TUint& aCurrentChar)
-	{
-	if (!aStart || !aEnd || aStart>=aEnd)
-		return KErrNotFound;
-	if (!TChar::IsSurrogate(aStart[0]))
-		{
-		aCurrentChar = aStart[0];
-		aNewStart = const_cast<TText16*> (aStart + 1);
-		return KErrNone;
-		}
-	else if (TChar::IsHighSurrogate(aStart[0]))
-		{
-		if (aEnd < aStart + 2)
-			return KErrCorruptSurrogateFound;
-		if (!TChar::IsLowSurrogate(aStart[1]))
-			{
-			aNewStart = const_cast<TText16*> (aStart + 2);
-			return KErrCorruptSurrogateFound;
-			}
-		aCurrentChar = TChar::JoinSurrogate(aStart[0], aStart[1]);
-		aNewStart = const_cast<TText16*> (aStart + 2);
-		return KErrNone;
-		}
-	else
-		{
-		aNewStart = const_cast<TText16*> (aStart);
-		return KErrCorruptSurrogateFound;
-		}
-	}
-
-/**
- * A helper function, which moves a pointer one or more Unicode characters forward.
- * 
- * This function starts from aStart, stops when one of below conditions matched:
- *   1) 16-bit position >= (aEnd - aStart);
- *   2) 16-bit position >= aMaxInt16Position;
- *   3) character position >= aMaxCharacterPosition;
- * 
- * Specify a huge integer (say KMaskDesLength16) for aMaxInt16Position or 
- * aMaxCharacterPosition to indicate unlimited 16-bit position or character 
- * position.
- * 
- * When return, aOutInt16Position, aOutCharacterPosition and aLastChar will 
- *              indicate the same one character, whose 
- *              16-bit position <= aMaxInt16Position, and 
- *              character position <= aMaxCharacterPosition.
- * 
- * @return KErrNone if no error found;
- *         KErrNotFound if get to aEnd before find wanted position; or,
- *                      if aMaxIntPosition<=0 or aMaxCharacterPosition<=0;
- *         KErrCorruptSurrogateFound if meet corrupt surrogate.
- */
-TInt ProceedMultiCharacters(const TText16* aStart, const TText16* aEnd,
-							const TInt aMaxInt16Position, const TInt aMaxCharacterPosition,
-							TInt& aOutInt16Position, TInt& aOutCharacterPosition, TUint& aLastChar)
-	{
-	TText16 *next;
-	TInt status = KErrNotFound;
-	aOutInt16Position = 0;
-	aOutCharacterPosition = 0;
-	while (aOutInt16Position <= aMaxInt16Position && aOutCharacterPosition <= aMaxCharacterPosition)
-		{
-		status = ::ProceedOneCharacter(aStart+aOutInt16Position, aEnd, next, aLastChar);
-		if (status == KErrNotFound || status == KErrCorruptSurrogateFound)
-			return status;
-		if (next - aStart > aMaxInt16Position || aOutInt16Position == aMaxInt16Position || aOutCharacterPosition == aMaxCharacterPosition)
-			{
-			return status;
-			}
-		aOutInt16Position = (next - aStart);
-		++aOutCharacterPosition;
-		}
-	return status;
-	}
-
-EXPORT_C TInt TDesC16::FindCorruptSurrogate() const
-/**
-Look for the first corrupt surrogate in the descriptor.
-
-@return The 16-bit position of the first corrupt surrogate. KErrNotFound, if 
-        not found.
-*/
-	{
-	// Do not use TUTF32Iterator, because it hides some characters, including corrupt surrogate.
-	TInt strLength = Length();
-
-	const TText16* start = Ptr();
-	const TText16* end = Ptr() + strLength;
-	TInt int16Pos;
-	TInt charPos;
-	TUint lastChar;
-	TInt status = ::ProceedMultiCharacters(start, end, KMaskDesLength16, KMaskDesLength16, int16Pos, charPos, lastChar);
-	if (status == KErrCorruptSurrogateFound)
-		return int16Pos;
-	return KErrNotFound;
-	}
-
-EXPORT_C TInt TDesC16::Locate2(TChar aChar) const
-/**
-The surrogate aware version of Locate().
-
-Searches for the first occurrence of a character within this descriptor's 
-data.
-
-The search starts at the beginning of the data, i.e. at the leftmost 
-position.
-
-@param aChar The Unicode character to be found. Can be inside or outside BMP.
-
-@return The offset of the character position from the beginning of the data.
-        KErrNotFound, if no matching character can be found.
-        KErrCorruptSurrogateFound, if meet corrupt surrogate in the searching.
-
-@see TDesC16::Locate()
-*/
-	{
-	TInt strLength = Length();
-	const TText16* start = Ptr();
-	const TText16* end = Ptr() + strLength;
-	TText16* next;
-	TUint currentChar;
-	TInt int16Index = 0;
-	TInt status = KErrNone;
-	FOREVER
-		{
-		status = ::ProceedOneCharacter(start+int16Index, end, next, currentChar);
-		if (status != KErrNone)
-			return status;
-		if (currentChar == aChar)
-			return int16Index;
-		int16Index = (next - start);
-		}
-	}
-
-LOCAL_C TInt DoLocateF16_2(const TDesC16& aDes, TUint aChar)
-// Surrogate-aware version of DoLocateF16().
-// Locate character aChar in the descriptor folded.
-	{
-	const TText* table = convTable(EMatchFolded);
-	TUint aChar32 = aChar;
-	aChar = lookup2(aChar32, table);
-	
-	// find aChar in aDes
-	TInt strLength = aDes.Length();
-	const TText16* start = aDes.Ptr();
-	const TText16* end = aDes.Ptr() + strLength;
-	TText16* next;
-	TUint currentChar;
-	TInt int16Index = 0;
-	TInt status = KErrNone;
-	while (status == KErrNone)
-		{
-		status = ::ProceedOneCharacter(start+int16Index, end, next, currentChar);
-        if (status != KErrNone)
-            break;
-		if (lookup2(currentChar, table) == aChar)
-			return int16Index;
-		int16Index = (next - start);
-		}
-	return status;
-	}
-
-EXPORT_C TInt TDesC16::LocateF2(TChar aChar) const
-/**
-The surrogate aware version of LocateF().
-
-Searches for the first occurrence of a folded character within this
-descriptor's folded data.
-
-The search starts at the beginning of the data, i.e. at the leftmost 
-position.
-
-Note that folding is locale-independent behaviour. It is also important to 
-note that there can be no guarantee that folding is in any way culturally 
-appropriate, and should not be used for searching strings in natural language.
-
-@param aChar The Unicode character to be found. Can be inside or outside BMP.
-
-@return The offset of the character position from the beginning of the data.
-        KErrNotFound, if no matching character can be found.
-        KErrCorruptSurrogateFound, if meet corrupt surrogate in the searching.
-
-@see TDesC16::LocateF()
-*/
-	{
-	return DoLocateF16_2(*this, aChar);
-	}
-
-/**
- * Proceed backward from aEnd toward aStart by one character.
- * 
- * @aStart points to the first 16-bit unit in a descriptor.
- * @aEnd   points to the 16-bit unit after the last one. So, count of 16-bit 
- *         units to process is (aEnd-aStart).
- * 
- * On return,
- *      if valid character found, then return KErrNone, with aNewEnd pointing 
- *          to the character found;
- *      if meet corrupt surrogate before find a valid character, then return 
- *          KErrCorruptSurrogateFound, with aNewStart point to the corrupt
- *          surrogate;
- *      if aStart met, then return KErrNotFound.
- * 
- * @return KErrNone if ok;
- *         KErrNotFound if get to aStart;
- *         KErrCorruptSurrogateFound if meet corrupt surrogate.
- */
-TInt RecedeOneCharacter(const TText16* aStart, const TText16* aEnd, TText16*& aNewEnd, TUint& aCurrentChar)
-	{
-	if (!aStart || !aEnd || aStart>=aEnd)
-		return KErrNotFound;
-	if (!TChar::IsSurrogate(aEnd[-1]))
-		{
-		aCurrentChar = aEnd[-1];
-		aNewEnd = const_cast<TText16*> (aEnd - 1);
-		return KErrNone;
-		}
-	else if (TChar::IsLowSurrogate(aEnd[-1]))
-		{
-		if (aEnd < aStart + 2)
-			return KErrNotFound;
-		if (!TChar::IsHighSurrogate(aEnd[-2]))
-			{
-			aNewEnd = const_cast<TText16*> (aEnd - 2);
-			return KErrCorruptSurrogateFound;
-			}
-		aCurrentChar = TChar::JoinSurrogate(aEnd[-2], aEnd[-1]);
-		aNewEnd = const_cast<TText16*> (aEnd - 2);
-		return KErrNone;
-		}
-	else
-		{
-		aNewEnd = const_cast<TText16*> (aEnd);
-		return KErrCorruptSurrogateFound;
-		}
-	}
-
-EXPORT_C TInt TDesC16::LocateReverse2(TChar aChar) const
-/**
-The surrogate aware version of LocateReverse().
-
-Searches for the first occurrence of a character within this descriptor's 
-data, searching from the end of the data.
-
-The search starts at the rightmost position.
-
-@param aChar The Unicode character to be found. Can be inside or outside BMP.
-
-@return The offset of the character position from the beginning of the data.
-        KErrNotFound, if no matching character can be found.
-        KErrCorruptSurrogateFound, if meet corrupt surrogate in the searching.
-
-@see TDesC16::LocateReverse()
-*/
-	{
-	TInt strLength = Length();
-	const TText16* start = Ptr();
-	TText16* newEnd;
-	TUint currentChar;
-	TInt int16Index = strLength;
-	TInt status = KErrNone;
-	FOREVER
-		{
-		status = ::RecedeOneCharacter(start, start+int16Index, newEnd, currentChar);
-		if (status != KErrNone)
-		    return status;
-		int16Index = (newEnd - start);
-		if (currentChar == aChar)
-			return int16Index;
-		}
-	}
-
-EXPORT_C TInt TDesC16::LocateReverseF2(TChar aChar) const
-/**
-The surrogate aware version of LocateReverseF().
-
-Searches for the first occurrence of a folded character within this descriptor's 
-folded data, searching from the end of the data.
-
-The search starts at the rightmost position.
-
-Note that folding is locale-independent behaviour. It is also important to 
-note that there can be no guarantee that folding is in any way culturally 
-appropriate, and should not be used for searching strings in natural language.
-
-@param aChar The Unicode character to be found. Can be inside or outside BMP.
-
-@return The offset of the character position from the beginning of the data.
-        KErrNotFound, if no matching character can be found.
-        KErrCorruptSurrogateFound, if meet corrupt surrogate in the searching.
-
-@see TDesC16::LocateReverseF()
-*/
-	{
-	TInt strLength = Length();
-	const TText16* start = Ptr();
-	TText16* newEnd;
-	TUint currentChar;
-	TInt int16Index = strLength;
-	TInt status = KErrNone;
-	FOREVER
-		{
-		status = ::RecedeOneCharacter(start, start+int16Index, newEnd, currentChar);
-		if (status != KErrNone)
-		    return status;
-		int16Index = (newEnd - start);
-		TCharF c(currentChar);
-		if (c == aChar)
-		    return int16Index;
-		}
-	}
-
-inline TUint conv2(TUint aChar, const TText *aConv, const TUnicodeDataSet* aCharDataSet)
-// Surrogate-aware version of conv().
-// If aConv is not NULL then convert the character.
-	{
-	if (aConv)
-		return TUnicode(aChar).Fold((TInt)aConv, aCharDataSet);
-	else
-		return aChar;
-	}
-
-// Surrogate-aware version of DoMatch16().
-// This helper function uses the same search algorithm as DoMatch16().
-TInt DoMatch16_2(const TDesC16 &aLeftD, const TDesC16 &aRightD, TMatchType aType)
-	{
-	const TText* table=convTable(aType);
-	const TUint16* const pRight=aRightD.Ptr();
-	const TUint16* pM=pRight-1;						// pre-increment addressing
-	const TUint16* const pP=pM+aRightD.Length();
-	const TUint16* const pLeft=aLeftD.Ptr()-1;		// pre-increment addressing
-	const TUint16* pB=pLeft;	
-	const TUint16* pB2=pLeft;						// always points to current char; pB2==pB or pB-1
-	const TUint16* const pE=pB+aLeftD.Length();
-
-	// Note: pM and pB always point to the int16 unit before the character to handle.
-	//       so, pM[0] and pB[0] may be a low surrogate.
-	//       but, pM[1] and pB[1] must be start of a character.
-	// Note: pB2 always points to current character being handled.
-	//       pB2 is used to generated return value.
-	//       if pB[0] is low surrogate, then pB2=pB-1;
-	//       if pB[0] is BMP, then pB2=pB.
-	//
-	// A 'diagram' shows the pointers:
-	//
-	// before search:
-	//     left:       ############################
-	//                ^                           ^
-	//             pLeft/pB/pB2                   pE
-	//
-	//     right:      ############################
-	//                ^^                          ^
-	//              pM  pRight                    pP
-	//
-	//
-	// after several iterations (C is the next character going to be checked):
-    //     left:       ###############C############
-    //                ^              ^            ^
-    //             pLeft             pB/pB2       pE
-    //
-    //     right:      ##########C#################
-    //                 ^        ^                 ^
-    //                 pRight   pM                pP
-	//
-
-	const TUnicodeDataSet* charDataSet = GetLocaleCharSet()->iCharDataSet;
-
-	// Match any pattern up to the first star
-	TUint c;
-	TInt status;
-	TText* newStart;
-	for (;;)
-		{
-		status = ::ProceedOneCharacter(pM+1, pP+1, newStart, c);
-		if (status == KErrCorruptSurrogateFound)
-		    return KErrCorruptSurrogateFound;
-		if (status == KErrNotFound)		// exhausted the pattern
-			return pB==pE ? 0 : KErrNotFound;
-		pM = newStart - 1;
-		c = conv2(c, table, charDataSet);
-		if (c==KMatchAny)
-			break;
-		if (pB==pE)			// no more input
-			return KErrNotFound;
-		TUint c2;
-		pB2 = pB + 1;
-		status = ::ProceedOneCharacter(pB+1, pE+1, newStart, c2);
-        if (status == KErrCorruptSurrogateFound)
-            return KErrCorruptSurrogateFound;
-		pB = newStart - 1;
-		if (c != conv2(c2, table, charDataSet) && c != KMatchOne)	// match failed
-			return KErrNotFound;
-		}
-	// reached a star
-	if (pM==pP)
-		return 0;
-	TInt r=pM==pRight ? -1 : 0;		// r = how many int16 has been matched in candidate (aLeftD)
-	for (;;)
-		{
-		status = ::ProceedOneCharacter(pM+1, pP+1, newStart, c);
-        if (status == KErrCorruptSurrogateFound)
-            return KErrCorruptSurrogateFound;
-		pM = newStart - 1;
-		c = conv2(c, table, charDataSet);
-		if (c==KMatchAny)
-			{
-star:		if (pM==pP)		// star at end of pattern, always matches
-				return Max(r,0);
-			if (r<-1)		// skipped some '?', matches at beginning
-				r=0;
-			continue;
-			}
-		if (pB==pE)			// no more input
-			return KErrNotFound;
-		if (c==KMatchOne)
-			{				// skip a character in the input
-			if (pM==pP)
-				return r+((r>=0) ? 0 : (pE-pLeft));
-			TUint dummyC;
-			pB2 = pB + 1;
-			status = ::ProceedOneCharacter(pB+1, pE+1, newStart, dummyC);
-	        if (status == KErrCorruptSurrogateFound)
-	            return KErrCorruptSurrogateFound;
-			pB = newStart - 1;
-			if (r < 0)
-				r -= (newStart - pB2);	// back r by 1 or 2, depending on dummyC is BMP or non-BMP.
-			continue;
-			}
-	// Matching a non-wild character
-		for (;;)
-			{
-			if (table)
-				{
-				TUint c2;
-				for (;;)
-					{
-					pB2 = pB + 1;
-					status = ::ProceedOneCharacter(pB+1, pE+1, newStart, c2);
-			        if (status == KErrCorruptSurrogateFound)
-			            return KErrCorruptSurrogateFound;
-					pB = newStart - 1;
-					if (lookup2(c2, table) == c)
-						break;
-					if (pB==pE)				// no more input
-						return KErrNotFound;
-					}
-				}
-			else
-				{
-				TUint c2;
-				for (;;)
-					{
-					pB2 = pB + 1;
-					status = ::ProceedOneCharacter(pB+1, pE+1, newStart, c2);
-			        if (status == KErrCorruptSurrogateFound)
-			            return KErrCorruptSurrogateFound;
-					pB = newStart - 1;
-					if (c2 == c)
-						break;
-					if (pB==pE)				// no more input
-						return KErrNotFound;
-					}
-				}
-			// Try to match up to the next star
-			const TUint16* pb=pB;
-			const TUint16* pm=pM;
-			for (;;)
-				{
-				if (pm<pP)
-					{
-					TUint cc;
-					status = ::ProceedOneCharacter(pm+1, pP+1, newStart, cc);
-			        if (status == KErrCorruptSurrogateFound)
-			            return KErrCorruptSurrogateFound;
-					pm = newStart - 1;
-					cc = conv2(cc, table, charDataSet);
-					if (cc==KMatchAny)
-						{	// sub-match successful, back to main loop
-						r+=(r>=0 ? 0 : pB2-pLeft);
-						pB=pb;
-						pM=pm;
-						goto star;
-						}
-					if (pb==pE)
-						return KErrNotFound;	// no more input
-					TUint cc2;
-					status = ::ProceedOneCharacter(pb+1, pE+1, newStart, cc2);
-			        if (status == KErrCorruptSurrogateFound)
-			            return KErrCorruptSurrogateFound;
-					pb = newStart - 1;
-					if (cc != conv2(cc2, table, charDataSet) && cc != KMatchOne)
-						break;	// sub-match failed, try next input character
-					}
-				else if (pb==pE)	// end of matching pattern
-					{
-					return r+(r>=0 ? 0 : pB2-pLeft);	// end of input, so have a match
-					}
-				else
-					break;		// try next input character
-				}
-			}
-		}
-	}
-
-EXPORT_C TInt TDesC16::Match2(const TDesC16 &aDes) const
-/**
-The surrogate aware version of Match().
-
-Searches this descriptor's data for a match with the match pattern supplied 
-in the specified descriptor.
-
-The match pattern can contain the wildcard characters "*" and "?", where "*" 
-matches zero or more consecutive occurrences of any character and "?" matches 
-a single occurrence of any character.
-
-Note that there is no 'escape character', which means that it is not possible
-to match either the "*" character itself or the "?" character itself using
-this function.
-
-@param aDes A 16-bit non-modifable descriptor containing the match pattern.
-
-@return If a match is found, the offset within this descriptor's data where 
-        the match first occurs. KErrNotFound, if there is no match.
-        KErrCorruptSurrogateFound, if meet corrupt surrogate in the searching.
-
-@see TDesC16::Match()
-*/
-	{
-	return DoMatch16_2(*this, aDes, EMatchNormal);
-	}
-
 #if !defined( __DES16_MACHINE_CODED__) | defined(__EABI_CTORS__)
 EXPORT_C TBufCBase16::TBufCBase16()
 //
@@ -3941,936 +3383,6 @@
     AppendFormatList(aFmt,list);
     }
 
-EXPORT_C void TDes16::Append2(TChar aChar)
-/**
-The surrogate aware version of Append().
-
-Appends data onto the end of this descriptor's data.
-
-The length of this descriptor is incremented to reflect the new content. The
-length will be increased by 1 if aChar is inside BMP or 2 if aChar is outside
-BMP.
-
-@param aChar A single character to be appended. Can be inside or outside BMP.
-
-@panic USER 11  if the resulting new length of this descriptor is greater than
-                its maximum length.
-
-@panic USER 217 if corrupt surrogate found in aChar. This functions will not
-                validate already existing surrogate in the descriptor.
-
-@see TDes16::Append()
-*/
-	{
-	__ASSERT_ALWAYS(TChar::IsSupplementary(aChar) || !TChar::IsSurrogate((TText16)aChar), Panic(ECorruptSurrogateFound));
-
-	TInt len = Length();
-	TUint16 *pB = WPtr() + len;
-	if (TChar::IsSupplementary(aChar))
-		{
-		SetLength(len + 2);
-		*pB++ = TChar::GetHighSurrogate(aChar);
-		*pB = TChar::GetLowSurrogate(aChar);
-		}
-	else
-		{
-		SetLength(len + 1);
-		*pB = (TText16)aChar;
-		}
-	}
-
-EXPORT_C void TDes16::Fill2(TChar aChar)
-/**
-The surrogate aware version of Fill().
-
-Fills the descriptor's data area with the specified character, replacing any 
-existing data.
-
-The descriptor is filled from the beginning up to its current length. The 
-descriptor's length does not change. It is not filled to its maximum length.
-If aChar is supplementary character, and available space to fill is odd in
-16-bit unit, then the last 16-bit unit will be filled with high surrogate, 
-and the length will keep unchanged.
-
-@param aChar The fill character. Can be inside or outside BMP.
-
-@see TDes16::Fill()
-*/
-	{
-	TUint16 *pB = WPtr();
-	TUint16 *pE = pB + Length();
-	if (!TChar::IsSupplementary(aChar))
-		{
-		while (pB < pE)
-			*pB++ = (TUint16)aChar;
-		}
-	else
-		{
-		while (pB < pE - 1)
-			{
-			*pB++ = TChar::GetHighSurrogate(aChar);
-			*pB++ = TChar::GetLowSurrogate(aChar);
-			}
-		// fill the last 16-bit unit
-		if (pB < pE)
-		    *pB++ = TChar::GetHighSurrogate(aChar);
-		}
-	}
-
-EXPORT_C void TDes16::Fill2(TChar aChar, TInt aLength)
-/**
-The surrogate aware version of Fill().
-
-Fills the descriptor's data area with the specified character, replacing any 
-existing data.
-
-The descriptor is filled with the specified number of characters,
-and its length is changed to reflect this.
-
-If aChar is supplementary character, and available space to fill is odd in
-16-bit unit, then the last 16-bit unit will be left unchanged.
-
-@param aChar   The fill character. Can be inside or outside BMP.
-@param aLength The new length of the descriptor.
-
-@panic USER 11  if aLength is negative or is greater than the maximum length
-                of this descriptor.
-
-@panic USER 217 if corrupt surrogate found in aChar. These functions will not 
-                validate already existing surrogate in the descriptor.
-
-@see TDes16::Fill()
-*/
-	{
-	__ASSERT_ALWAYS(TChar::IsSupplementary(aChar) || !TChar::IsSurrogate((TText16)aChar), Panic(ECorruptSurrogateFound));
-
-	SetLength(aLength);
-	Fill2(aChar);
-	}
-
-EXPORT_C void TDes16::AppendFill2(TChar aChar, TInt aLength)
-/**
-The surrogate aware version of AppendFill().
-
-Appends and fills this descriptor with the specified character.
-
-The descriptor is appended with the specified number of characters, and its
-length is changed to reflect this.
-
-If aChar is supplementary character, and available space to fill is odd in 
-16-bit unit, then the last 16-bit unit will be filled with high surrogate.
-
-@param aChar   The fill character. Can be inside or outside BMP.
-@param aLength The length of additional space to append into.
-
-@panic USER 11  if aLength is negative, or the resulting length of this
-                descriptor is greater than its maximum length.
-
-@panic USER 217 if corrupt surrogate found in aChar. These functions will not 
-                validate already existing surrogate in the descriptor.
-
-@see TDes16::AppendFill()
-*/
-	{
-	__ASSERT_ALWAYS(TChar::IsSupplementary(aChar) || !TChar::IsSurrogate((TText16)aChar), Panic(ECorruptSurrogateFound));
-
-	TInt len=Length();
-	TUint16 *pB=WPtr()+len;
-	SetLength(len+aLength);
-	TUint16 *pE=pB+aLength;
-	if (!TChar::IsSupplementary(aChar))
-		{
-		while (pB < pE)
-			*pB++ = (TUint16)aChar;
-		}
-	else
-		{
-		while (pB < pE - 1)
-			{
-			*pB++ = TChar::GetHighSurrogate(aChar);
-			*pB++ = TChar::GetLowSurrogate(aChar);
-			}
-        // fill the last 16-bit unit
-        if (pB < pE)
-            *pB++ = TChar::GetHighSurrogate(aChar);
-		}
-	}
-
-EXPORT_C void TDes16::Justify2(const TDesC16 &aDes, TInt aWidth, TAlign anAlignment, TChar aFill)
-/**
-The surrogate aware version of Justify().
-
-Copies data into this descriptor and justifies it, replacing any existing data.
-
-The length of this descriptor is set to reflect the new data.
-
-The target area is considered to be an area of specified width positioned at
-the beginning of this descriptor's data area. Source data is copied into, and
-aligned within this target area according to the specified alignment
-instruction.
-
-If the length of the target area is larger than the length of the source, then
-spare space within the target area is padded with the fill character.
-
-@param aDes        A 16-bit non-modifiable descriptor containing the source data.
-                   The length of the data to be copied is the smaller of:
-                   the length of the source descriptor, and 
-                   the width of the target area (only if this is not the
-                   explicit negative value KDefaultJustifyWidth).
-
-@param aWidth      The width of the target area. If this has the specific
-                   negative value KDefaultJustifyWidth, then the width is
-                   re-set to the length of the data source.
-
-@param anAlignment The alignment of the data within the target area
-
-@param aFill       The fill character used to pad the target area. Can be
-                   inside or outside BMP.
-
-@panic USER 11  if the resulting length of this descriptor is greater than
-                its maximum length or aWidth has a negative value other 
-                than KDefaultJustifyWidth.
-
-@panic USER 217 if corrupt surrogate found in the parameters or in the 
-                descriptor.
-
-@see TDes16::Justify()
-*/
-	{
-    Zero();
-    AppendJustify2(aDes.Ptr(),aDes.Length(),aWidth,anAlignment,aFill);
-	}
-
-EXPORT_C void TDes16::AppendJustify2(const TDesC16 &aDes, TInt aWidth, TAlign anAlignment, TChar aFill)
-/**
-The surrogate aware version of AppendJustify.
-
-Appends data onto the end of this descriptor's data and justifies it.
-    
-The source of the appended data is an existing descriptor.
-    
-The target area is considered to be an area of specified width, immediately 
-following this descriptor's existing data. Source data is copied into, and 
-aligned within this target area according to the specified alignment instruction.
-    
-If the length of the target area is larger than the length of the source, 
-then spare space within the target area is padded with the fill character.
-        
-@param aDes        A 16-bit non-modifiable descriptor containing the source
-                   data. The length of the data to be copied is the smaller of:
-                   the length of the source descriptor, and
-                   the width of the target area (only if this is not the
-                   explicit negative value KDefaultJustifyWidth). 
-    
-@param aWidth      The width of the target area. If this has the specific
-                   negative value KDefaultJustifyWidth, then the width is
-                   re-set to the length of the data source.
-    
-@param anAlignment The alignment of the data within the target area. 
-    
-@param aFill       The fill character used to pad the target area. Can be
-                   inside or outside BMP.
-
-@panic USER 11  if the resulting length of this descriptor is greater than
-                its maximum length or aWidth has a negative value other 
-                than KDefaultJustifyWidth.
-
-@panic USER 217 if corrupt surrogate found in the parameters or in the 
-                descriptor.
-
-@see TDes16::AppendJustify()
-*/
-	{
-    AppendJustify2(aDes.Ptr(),aDes.Length(),aWidth,anAlignment,aFill);
-	}
-
-EXPORT_C void TDes16::AppendJustify2(const TDesC16 &aDes, TInt aLength, TInt aWidth, TAlign anAlignment, TChar aFill)
-/**
-The surrogate aware version of AppendJustify.
-
-Appends data onto the end of this descriptor's data and justifies it.
-    
-The source of the appended data is an existing descriptor.
-    
-The target area is considered to be an area of specified width, immediately 
-following this descriptor's existing data. Source data is copied into, and 
-aligned within this target area according to the specified alignment instruction.
-    
-If the length of the target area is larger than the length of the source, 
-then spare space within the target area is padded with the fill character.
-    
-@param aDes        An 8-bit non-modifiable descriptor containing the source data. 
-
-@param aLength     The length of data to be copied from the source descriptor. 
-                   If this is greater than the width of the target area, then
-                   the length of data copied is limited to the width.
-                   The length of data to be copied must not be  greater than
-                   the length of the source descriptor. Note that this
-                   condition is not automatically tested. 
-                   
-@param aWidth      The width of the target area. If this has the specific negative 
-                   value KDefaultJustifyWidth, then the width is
-                   re-set to the length of the data source.
-
-@param anAlignment The alignment of the data within the target area. 
-
-@param aFill       The fill character used to pad the target area. Can be
-                   inside or outside BMP.
-
-@panic USER 11  if the resulting length of this descriptor is greater than
-                its maximum length or aWidth has a negative value other 
-                than KDefaultJustifyWidth.
-
-@panic USER 217 if corrupt surrogate found in the parameters or in the 
-                descriptor.
-
-@see TDes16::AppendJustify()
-*/
-	{
-    AppendJustify2(aDes.Ptr(),aLength,aWidth,anAlignment,aFill);
-	}
-
-EXPORT_C void TDes16::AppendJustify2(const TUint16 *aString, TInt aWidth, TAlign anAlignment, TChar aFill)
-/**
-The surrogate aware version of AppendJustify.
-
-Appends a zero terminated string onto the end of this descriptor's data and 
-justifies it.
-
-The zero terminator is not copied.
-
-The target area is considered to be an area of specified width, immediately 
-following this descriptor's existing data. Source data is copied into, and 
-aligned within, this target area according to the specified alignment instruction.
-
-If the length of the target area is larger than the length of the source, 
-then spare space within the target area is padded with the fill character.
-
-@param aString     A pointer to a zero terminated string The length of the data 
-                   to be copied is the smaller of: the length of the string (excluding the zero 
-                   terminator), the width of the target area (only if this is not the explicit 
-                   negative value KDefaultJustifyWidth). 
-                    
-@param aWidth      The width of the target area. If this has the specific negative 
-                   value KDefaultJustifyWidth, then the width is re-set to the length of the 
-                   zero terminated string (excluding the zero terminator).
-                    
-@param anAlignment The alignment of the data within the target area. 
-
-@param aFill       The fill character used to pad the target area. Can be
-                   inside or outside BMP.
-
-@panic USER 11  if the resulting length of this descriptor is greater than
-                its maximum length or aWidth has a negative value other 
-                than KDefaultJustifyWidth.
-
-@panic USER 217 if corrupt surrogate found in the parameters or in the 
-                descriptor.
-
-@see TDes16::AppendJustify()
-*/
-	{
- 	__CHECK_ALIGNMENT(aString,ETDes16AppendJustify1);
-	AppendJustify2(aString,STRING_LENGTH_16(aString),aWidth,anAlignment,aFill);
-	}
-
-EXPORT_C void TDes16::AppendJustify2(const TUint16 *aString, TInt aLength, TInt aWidth, TAlign anAlignment, TChar aFill)
-/**
-The surrogate aware version of AppendJustify.
-
-Appends data onto the end of this descriptor's data and justifies it.
-
-The source of the appended data is a memory location.
-
-The target area is considered to be an area of specified width, immediately 
-following this descriptor's existing data. Source data is copied into, and 
-aligned within, this target area according to the specified alignment instruction.
-
-If the length of the target area is larger than the length of the source, 
-then spare space within the target area is padded with the fill character.
-
-@param aString     A pointer to a source memory location. 
-
-@param aLength     The length of data to be copied. If this is greater than the 
-                   width of the target area, then the length of data copied is
-                   limited to the width.
-               
-@param aWidth      The width of the target area. If this has the specific negative 
-                   value KDefaultJustifyWidth, then the width is
-                   re-set to the length of the data source. 
-               
-@param anAlignment The alignment of the data within the target area. 
-
-@param aFill       The fill character used to pad the target area. Can be
-                   inside or outside BMP.
-
-@panic USER 11  if the resulting length of this descriptor is greater than
-                its maximum length or aWidth has a negative value other 
-                than KDefaultJustifyWidth.
-
-@panic USER 17  if aLength is negative.
-  
-@panic USER 217 if corrupt surrogate found in the parameters or in the 
-                descriptor.
-
-@see TDes16::AppendJustify()
-*/
-	{
-	__ASSERT_ALWAYS(aLength>=0,Panic(ETDes16LengthNegative));
-	__CHECK_ALIGNMENT(aString,ETDes16AppendJustify2);
-	if (aWidth==KDefaultJustifyWidth)
-		aWidth=aLength;
-	if (aLength>aWidth)
-		aLength=aWidth;
-	TInt offset=Length();
-	AppendFill2(aFill,aWidth);
-	TInt r=aWidth-aLength;
-	if (anAlignment==ECenter)
-		r>>=1;
-	else if (anAlignment==ELeft)
-		r=0;
-	memCopy(WPtr()+offset+r,aString,aLength);
-	}
-
-EXPORT_C void TDes16::Fold2()
-/**
-The surrogate aware version of Fold().
-
-Performs folding on the content of this descriptor.
-
-Note that folding is locale-independent behaviour. It is also important to 
-note that there can be no guarantee that folding is in any way culturally 
-appropriate, and should not be used when dealing with strings in natural
-language.
-
-@panic USER 217 if corrupt surrogate found in the descriptor.
-
-@see TDes16::Fold()
-*/
-	{
-	TInt strLength = Length();
-	TText16* start = WPtr();
-	const TText16* end = Ptr() + strLength;
-	TText16* next;
-	TUint currentChar;
-	TInt int16Index = 0;
-	TInt status = KErrNone;
-	FOREVER
-		{
-		status = ::ProceedOneCharacter(start+int16Index, end, next, currentChar);
-		__ASSERT_ALWAYS(status != KErrCorruptSurrogateFound, Panic(ECorruptSurrogateFound));
-		if (status == KErrNotFound)
-			break;
-		TCharF c(currentChar);
-		// at present, c and currentChar always in the same plane
-		if (TChar::IsSupplementary(c))
-			{
-			start[int16Index] = TChar::GetHighSurrogate(c);
-			start[int16Index+1] = TChar::GetLowSurrogate(c);
-			}
-		else
-			{
-			start[int16Index] = (TText16)c;
-			}
-		int16Index = (next - start);
-		}
-	}
-
-EXPORT_C void TDes16::Collate2()
-/**
-The surrogate aware version of Collate().
-
-Performs collation on the content of this descriptor.
-
-@panic USER 217 if corrupt surrogate found in the descriptor.
-
-@see TDes16::Collate()
-*/
-	{
-	TInt strLength = Length();
-	TText16* start = WPtr();
-	const TText16* end = Ptr() + strLength;
-	TText16* next;
-	TUint currentChar;
-	TInt int16Index = 0;
-	TInt status = KErrNone;
-	FOREVER
-		{
-		status = ::ProceedOneCharacter(start+int16Index, end, next, currentChar);
-		__ASSERT_ALWAYS(status != KErrCorruptSurrogateFound, Panic(ECorruptSurrogateFound));
-		if (status == KErrNotFound)
-			break;
-		TChar c = User::Collate(currentChar);
-		// at present, c and currentChar always in the same plane
-		if (TChar::IsSupplementary(c))
-			{
-			start[int16Index] = TChar::GetHighSurrogate(c);
-			start[int16Index+1] = TChar::GetLowSurrogate(c);
-			}
-		else
-			{
-			start[int16Index] = (TText16)c;
-			}
-		int16Index = (next - start);
-		}
-	}
-
-EXPORT_C void TDes16::LowerCase2()
-/**
-The surrogate aware version of LowerCase().
-
-Converts the content of this descriptor to lower case.
-
-Conversion is implemented as appropriate to the current locale.
-
-@panic USER 217 if corrupt surrogate found in the descriptor.
-
-@see TDes16::LowerCase()
-*/
-	{
-	TInt strLength = Length();
-	TText16* start = WPtr();
-	const TText16* end = Ptr() + strLength;
-	TText16* next;
-	TUint currentChar;
-	TInt int16Index = 0;
-	TInt status = KErrNone;
-	FOREVER
-		{
-		status = ::ProceedOneCharacter(start+int16Index, end, next, currentChar);
-		__ASSERT_ALWAYS(status != KErrCorruptSurrogateFound, Panic(ECorruptSurrogateFound));
-		if (status == KErrNotFound)
-			break;
-		TCharLC c(currentChar);
-		// at present, c and currentChar always in the same plane
-		if (TChar::IsSupplementary(c))
-			{
-			start[int16Index] = TChar::GetHighSurrogate(c);
-			start[int16Index+1] = TChar::GetLowSurrogate(c);
-			}
-		else
-			{
-			start[int16Index] = (TText16)c;
-			}
-		int16Index = (next - start);
-		}
-	}
-
-EXPORT_C void TDes16::UpperCase2()
-/**
-The surrogate aware version of UpperCase().
-
-Converts the content of this descriptor to upper case.
-
-Conversion is implemented as appropriate to the current locale.
-
-@panic USER 217 if corrupt surrogate found in the descriptor.
-
-@see TDes16::UpperCase()
-*/
-	{
-	TInt strLength = Length();
-	TText16* start = WPtr();
-	const TText16* end = Ptr() + strLength;
-	TText16* next;
-	TUint currentChar;
-	TInt int16Index = 0;
-	TInt status = KErrNone;
-	FOREVER
-		{
-		status = ::ProceedOneCharacter(start+int16Index, end, next, currentChar);
-		__ASSERT_ALWAYS(status != KErrCorruptSurrogateFound, Panic(ECorruptSurrogateFound));
-		if (status == KErrNotFound)
-			break;
-		TCharUC c(currentChar);
-		// at present, c and currentChar always in the same plane
-		if (TChar::IsSupplementary(c))
-			{
-			start[int16Index] = TChar::GetHighSurrogate(c);
-			start[int16Index+1] = TChar::GetLowSurrogate(c);
-			}
-		else
-			{
-			start[int16Index] = (TText16)c;
-			}
-		int16Index = (next - start);
-		}
-	}
-
-EXPORT_C void TDes16::Capitalize2()
-/**
-The surrogate aware version of Capitalize().
-
-Capitalises the content of this descriptor.
-
-Capitalisation is implemented as appropriate to the current locale.
-
-@panic USER 217 if corrupt surrogate found in the descriptor.
-
-@see TDes16::Capitalize()
-*/
-	{
-	TInt strLength = Length();
-	TText16* start = WPtr();
-	const TText16* end = Ptr() + strLength;
-	TText16* next;
-	TUint currentChar;
-	TInt int16Index = 0;
-	TInt status = KErrNone;
-	
-	// the first character: title case
-	status = ::ProceedOneCharacter(start, end, next, currentChar);
-	__ASSERT_ALWAYS(status != KErrCorruptSurrogateFound, Panic(ECorruptSurrogateFound));
-	TChar c = User::TitleCase(currentChar);
-	// at present, c and currentChar always in the same plane
-	if (TChar::IsSupplementary(c))
-		{
-		start[0] = TChar::GetHighSurrogate(c);
-		start[1] = TChar::GetLowSurrogate(c);
-		}
-	else
-		{
-		start[0] = (TText16)c;
-		}
-	int16Index = (next - start);
-	
-	// following characters: lower case
-	FOREVER
-		{
-		status = ::ProceedOneCharacter(start+int16Index, end, next, currentChar);
-		__ASSERT_ALWAYS(status != KErrCorruptSurrogateFound, Panic(ECorruptSurrogateFound));
-		if (status == KErrNotFound)
-			break;
-		TChar c = User::LowerCase(currentChar);
-		// at present, c and currentChar always in the same plane
-		if (TChar::IsSupplementary(c))
-			{
-			start[int16Index] = TChar::GetHighSurrogate(c);
-			start[int16Index+1] = TChar::GetLowSurrogate(c);
-			}
-		else
-			{
-			start[int16Index] = (TText16)c;
-			}
-		int16Index = (next - start);
-		}
-	}
-
-EXPORT_C void TDes16::CopyF2(const TDesC16 &aDes)
-/**
-The surrogate aware version of CopyF().
-
-Copies and folds data from the specified descriptor into this descriptor replacing 
-any existing data.
-
-The length of this descriptor is set to reflect the new 
-data.
-
-Note that folding is locale-independent behaviour. It is also important to 
-note that there can be no guarantee that folding is in any way culturally 
-appropriate, and should not be used when dealing with strings in natural
-language.
-
-@param aDes A 16-bit non-modifiable descriptor.
-
-@panic USER 11  if the length of aDes is greater than the maximum length of
-                this target descriptor.
-
-@panic USER 217 if corrupt surrogate found in aDes or in the descriptor.
-
-@see TDes16::CopyF()
-*/
-	{
-	TText16* pT = WPtr();
-	TInt len = 0;
-	const TInt maxLen = MaxLength();
-	
-	// iterate through aDes
-	TInt strLength = aDes.Length();
-	const TText16* start = aDes.Ptr();
-	const TText16* end = aDes.Ptr() + strLength;
-	TText16* next;
-	TUint currentChar;
-	TInt int16Index = 0;
-	TInt status = KErrNone;
-	FOREVER
-		{
-		status = ::ProceedOneCharacter(start+int16Index, end, next, currentChar);
-		__ASSERT_ALWAYS(status != KErrCorruptSurrogateFound, Panic(ECorruptSurrogateFound));
-		if (status == KErrNotFound)
-			break;
-		int16Index = (next - start);
-		TCharF c(currentChar);
-		if (TChar::IsSupplementary(c))
-			{
-			len += 2;
-			__ASSERT_ALWAYS(len<=maxLen, Panic(ETDes16Overflow));
-			pT[len-2] = TChar::GetHighSurrogate(c);
-			pT[len-1] = TChar::GetLowSurrogate(c);
-			}
-		else
-			{
-			++len;
-			__ASSERT_ALWAYS(len<=maxLen, Panic(ETDes16Overflow));
-			pT[len-1] = (TText16)c;
-			}
-		}
-	SetLength(len);
-	}
-
-EXPORT_C void TDes16::CopyC2(const TDesC16 &aDes)
-/**
-The surrogate aware version of CopyC().
-
-Copies and collates data from the specified descriptor
-into this descriptor replacing any existing data.
-
-The length of this descriptor is set to reflect the new data.
-
-@param aDes A 16-bit non-modifiable descriptor.
-
-@panic USER 11  if the length of aDes is greater than the maximum length of
-                this target descriptor.
-
-@panic USER 217 if corrupt surrogate found in aDes or in the descriptor.
-
-@see TDes16::CopyC()
-*/
-	{
-	TText16* pT = WPtr();
-	TInt len = 0;
-	const TInt maxLen = MaxLength();
-	
-	// iterate through aDes
-	TInt strLength = aDes.Length();
-	const TText16* start = aDes.Ptr();
-	const TText16* end = aDes.Ptr() + strLength;
-	TText16* next;
-	TUint currentChar;
-	TInt int16Index = 0;
-	TInt status = KErrNone;
-	FOREVER
-		{
-		status = ::ProceedOneCharacter(start+int16Index, end, next, currentChar);
-		__ASSERT_ALWAYS(status != KErrCorruptSurrogateFound, Panic(ECorruptSurrogateFound));
-		if (status == KErrNotFound)
-			break;
-		int16Index = (next - start);
-		TChar c = User::Collate(currentChar);
-		if (TChar::IsSupplementary(c))
-			{
-			len += 2;
-			__ASSERT_ALWAYS(len<=maxLen, Panic(ETDes16Overflow));
-			pT[len-2] = TChar::GetHighSurrogate(c);
-			pT[len-1] = TChar::GetLowSurrogate(c);
-			}
-		else
-			{
-			++len;
-			__ASSERT_ALWAYS(len<=maxLen, Panic(ETDes16Overflow));
-			pT[len-1] = (TText16)c;
-			}
-		}
-	SetLength(len);
-	}
-
-EXPORT_C void TDes16::CopyLC2(const TDesC16 &aDes)
-/**
-The surrogate aware version of CopyLC().
-
-Copies text from the specified descriptor and converts it to lower case before 
-putting it into this descriptor, replacing any existing data.
-
-The length of this descriptor is set to reflect the new data.
-
-Conversion to lower case is implemented as appropriate to the current locale.
-
-@param aDes A 16-bit non modifiable descriptor.
-
-@panic USER 11  if the length of aDes is greater than the maximum length of
-                this target descriptor.
-
-@panic USER 217 if corrupt surrogate found in aDes or in the descriptor.
-
-@see TDes16::CopyLC()
-*/
-	{
-	TText16* pT = WPtr();
-	TInt len = 0;
-	const TInt maxLen = MaxLength();
-	
-	// iterate through aDes
-	TInt strLength = aDes.Length();
-	const TText16* start = aDes.Ptr();
-	const TText16* end = aDes.Ptr() + strLength;
-	TText16* next;
-	TUint currentChar;
-	TInt int16Index = 0;
-	TInt status = KErrNone;
-	FOREVER
-		{
-		status = ::ProceedOneCharacter(start+int16Index, end, next, currentChar);
-		__ASSERT_ALWAYS(status != KErrCorruptSurrogateFound, Panic(ECorruptSurrogateFound));
-		if (status == KErrNotFound)
-			break;
-		int16Index = (next - start);
-		TCharLC c(currentChar);
-		if (TChar::IsSupplementary(c))
-			{
-			len += 2;
-			__ASSERT_ALWAYS(len<=maxLen, Panic(ETDes16Overflow));
-			pT[len-2] = TChar::GetHighSurrogate(c);
-			pT[len-1] = TChar::GetLowSurrogate(c);
-			}
-		else
-			{
-			++len;
-			__ASSERT_ALWAYS(len<=maxLen, Panic(ETDes16Overflow));
-			pT[len-1] = (TText16)c;
-			}
-		}
-	SetLength(len);
-	}
-
-EXPORT_C void TDes16::CopyUC2(const TDesC16 &aDes)
-/**
-The surrogate aware version of CopyUC().
-
-Copies text from the specified descriptor and converts it to upper case before 
-putting it into this descriptor, replacing any existing data.
-
-The length of this descriptor is set to reflect the new data.
-
-Conversion to upper case is implemented as appropriate to the current locale.
-
-@param aDes A 16-bit non modifiable descriptor.
-
-@panic USER 11  if the length of aDes is greater than the maximum length of
-                this target descriptor.
-
-@panic USER 217 if corrupt surrogate found in aDes or in the descriptor.
-
-@see TDes16::CopyUC()
-*/
-	{
-	TText16* pT = WPtr();
-	TInt len = 0;
-	const TInt maxLen = MaxLength();
-	
-	// iterate through aDes
-	TInt strLength = aDes.Length();
-	const TText16* start = aDes.Ptr();
-	const TText16* end = aDes.Ptr() + strLength;
-	TText16* next;
-	TUint currentChar;
-	TInt int16Index = 0;
-	TInt status = KErrNone;
-	FOREVER
-		{
-		status = ::ProceedOneCharacter(start+int16Index, end, next, currentChar);
-		__ASSERT_ALWAYS(status != KErrCorruptSurrogateFound, Panic(ECorruptSurrogateFound));
-		if (status == KErrNotFound)
-			break;
-		int16Index = (next - start);
-		TCharUC c(currentChar);
-		if (TChar::IsSupplementary(c))
-			{
-			len += 2;
-			__ASSERT_ALWAYS(len<=maxLen, Panic(ETDes16Overflow));
-			pT[len-2] = TChar::GetHighSurrogate(c);
-			pT[len-1] = TChar::GetLowSurrogate(c);
-			}
-		else
-			{
-			++len;
-			__ASSERT_ALWAYS(len<=maxLen, Panic(ETDes16Overflow));
-			pT[len-1] = (TText16)c;
-			}
-		}
-	SetLength(len);
-	}
-
-EXPORT_C void TDes16::CopyCP2(const TDesC16 &aDes)
-/**
-The surrogate aware version of CopyCP().
-
-Copies text from the specified descriptor and capitalises it before putting 
-it into this descriptor, replacing any existing data.
-
-The length of this descriptor is set to reflect the new data.
-
-Capitalisation is implemented as appropriate to the current locale.
-
-@param aDes A 16-bit non-modifiable descriptor.
-
-@panic USER 11  if the length of aDes is greater than the maximum length of
-                this target descriptor.
-
-@panic USER 217 if corrupt surrogate found in aDes or in the descriptor.
-
-@see TDes16::CopyCP()
-*/
-	{
-	TText16* pT = WPtr();
-	TInt len = 0;
-	const TInt maxLen = MaxLength();
-	
-	// iterate through aDes
-	TInt strLength = aDes.Length();
-	const TText16* start = aDes.Ptr();
-	const TText16* end = aDes.Ptr() + strLength;
-	TText16* next;
-	TUint currentChar;
-	TInt int16Index = 0;
-	TInt status = KErrNone;
-	
-	// first character: title case
-	status = ::ProceedOneCharacter(start, end, next, currentChar);
-	__ASSERT_ALWAYS(status != KErrCorruptSurrogateFound, Panic(ECorruptSurrogateFound));
-	int16Index = (next - start);
-	TChar c(currentChar);
-	c.TitleCase();
-	if (TChar::IsSupplementary(c))
-		{
-		len += 2;
-		__ASSERT_ALWAYS(len<=maxLen, Panic(ETDes16Overflow));
-		pT[len-2] = TChar::GetHighSurrogate(c);
-		pT[len-1] = TChar::GetLowSurrogate(c);
-		}
-	else
-		{
-		++len;
-		__ASSERT_ALWAYS(len<=maxLen, Panic(ETDes16Overflow));
-		pT[len-1] = (TText16)c;
-		}
-	
-	// following characters: lower case
-	FOREVER
-		{
-		status = ::ProceedOneCharacter(start+int16Index, end, next, currentChar);
-		__ASSERT_ALWAYS(status != KErrCorruptSurrogateFound, Panic(ECorruptSurrogateFound));
-		if (status == KErrNotFound)
-			break;
-		int16Index = (next - start);
-		TCharLC c(currentChar);
-		if (TChar::IsSupplementary(c))
-			{
-			len += 2;
-			__ASSERT_ALWAYS(len<=maxLen, Panic(ETDes16Overflow));
-			pT[len-2] = TChar::GetHighSurrogate(c);
-			pT[len-1] = TChar::GetLowSurrogate(c);
-			}
-		else
-			{
-			++len;
-			__ASSERT_ALWAYS(len<=maxLen, Panic(ETDes16Overflow));
-			pT[len-1] = (TText16)c;
-			}
-		}
-	SetLength(len);
-	}
-
-
 #if !defined(__DES16_MACHINE_CODED__) | defined(__EABI_CTORS__)
 EXPORT_C TPtrC16::TPtrC16()
 	: TDesC16(EPtrC,0),iPtr(0)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/common/heap.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,1713 @@
+// Copyright (c) 1994-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:
+// e32\common\heap.cpp
+// 
+//
+
+#include "common.h"
+#ifdef __KERNEL_MODE__
+#include <kernel/kern_priv.h>
+#endif
+
+#ifdef _DEBUG
+#define __SIMULATE_ALLOC_FAIL(s)	if (CheckForSimulatedAllocFail()) {s}
+#define	__CHECK_CELL(p)				CheckCell(p)
+#define	__ZAP_CELL(p)				memset( ((TUint8*)p) + RHeap::EAllocCellSize, 0xde, p->len - RHeap::EAllocCellSize)
+#define __DEBUG_SAVE(p)				TInt dbgNestLevel = ((SDebugCell*)p)->nestingLevel
+#define __DEBUG_RESTORE(p)			((SDebugCell*)(((TUint8*)p)-EAllocCellSize))->nestingLevel = dbgNestLevel
+#else
+#define __SIMULATE_ALLOC_FAIL(s)
+#define	__CHECK_CELL(p)
+#define	__ZAP_CELL(p)
+#define __DEBUG_SAVE(p)
+#define __DEBUG_RESTORE(p)
+#endif
+
+#define __NEXT_CELL(p)				((SCell*)(((TUint8*)p)+p->len))
+
+#define __POWER_OF_2(x)				((TUint32)((x)^((x)-1))>=(TUint32)(x))
+
+#define __MEMORY_MONITOR_CHECK_CELL(p) \
+					{ \
+					TLinAddr m = TLinAddr(iAlign-1); \
+					SCell* c = (SCell*)(((TUint8*)p)-EAllocCellSize); \
+					if((c->len & m) || (c->len<iMinCell) || ((TUint8*)c<iBase) || ((TUint8*)__NEXT_CELL(c)>iTop)) \
+						BTraceContext12(BTrace::EHeap, BTrace::EHeapCorruption, (TUint32)this, (TUint32)p, (TUint32)c->len-EAllocCellSize); \
+					}
+					
+/**
+@SYMPatchable
+@publishedPartner
+@released
+
+Defines the minimum cell size of  a heap.
+
+The constant can be changed at ROM build time using patchdata OBY keyword.
+*/
+#ifdef __X86GCC__	// For X86GCC we dont use the proper data import attribute
+#undef IMPORT_D		// since the constant is not really imported. GCC doesn't 
+#define IMPORT_D	// allow imports from self.
+#endif
+IMPORT_D extern const TInt KHeapMinCellSize;
+
+/**
+@SYMPatchable
+@publishedPartner
+@released
+
+This constant defines the ratio that determines the amount of hysteresis between heap growing and heap
+shrinking.
+It is a 32-bit fixed point number where the radix point is defined to be
+between bits 7 and 8 (where the LSB is bit 0) i.e. using standard notation, a Q8 or a fx24.8
+fixed point number.  For example, for a ratio of 2.0, set KHeapShrinkHysRatio=0x200.
+
+The heap shrinking hysteresis value is calculated to be:
+@code
+KHeapShrinkHysRatio*(iGrowBy>>8)
+@endcode
+where iGrowBy is a page aligned value set by the argument, aGrowBy, to the RHeap constructor.
+The default hysteresis value is iGrowBy bytes i.e. KHeapShrinkHysRatio=2.0.
+
+Memory usage may be improved by reducing the heap shrinking hysteresis
+by setting 1.0 < KHeapShrinkHysRatio < 2.0.  Heap shrinking hysteresis is disabled/removed
+when KHeapShrinkHysRatio <= 1.0.
+
+The constant can be changed at ROM build time using patchdata OBY keyword.
+*/
+IMPORT_D extern const TInt KHeapShrinkHysRatio;
+
+#pragma warning( disable : 4705 )	// statement has no effect
+UEXPORT_C RHeap::RHeap(TInt aMaxLength, TInt aAlign, TBool aSingleThread)
+/**
+@internalComponent
+*/
+//
+// Constructor for fixed size heap
+//
+	:	iMinLength(aMaxLength), iMaxLength(aMaxLength), iOffset(0), iGrowBy(0), iChunkHandle(0),
+		iNestingLevel(0), iAllocCount(0), iFailType(ENone), iTestData(NULL)
+	{
+	iAlign = aAlign ? aAlign : ECellAlignment;
+	iPageSize = 0;
+	iFlags = aSingleThread ? (ESingleThreaded|EFixedSize) : EFixedSize;
+	Initialise();
+	}
+#pragma warning( default : 4705 )
+
+
+
+
+UEXPORT_C RHeap::RHeap(TInt aChunkHandle, TInt aOffset, TInt aMinLength, TInt aMaxLength, TInt aGrowBy, TInt aAlign, TBool aSingleThread)
+/**
+@internalComponent
+*/
+//
+// Constructor for chunk heaps.
+//
+	:	iOffset(aOffset), iChunkHandle(aChunkHandle),
+		iNestingLevel(0), iAllocCount(0), iFailType(ENone), iTestData(NULL)
+	{
+	TInt sz = iBase - ((TUint8*)this - iOffset);
+	GET_PAGE_SIZE(iPageSize);
+	__ASSERT_ALWAYS(iOffset>=0, HEAP_PANIC(ETHeapNewBadOffset));
+	iMinLength = Max(aMinLength, sz + EAllocCellSize);
+	iMinLength = _ALIGN_UP(iMinLength, iPageSize);
+	iMaxLength = Max(aMaxLength, iMinLength);
+	iMaxLength = _ALIGN_UP(iMaxLength, iPageSize);
+	iGrowBy = _ALIGN_UP(aGrowBy, iPageSize);
+	iFlags = aSingleThread ? ESingleThreaded : 0;
+	iAlign = aAlign ? aAlign : ECellAlignment;
+	Initialise();
+	}
+
+
+
+
+UEXPORT_C TAny* RHeap::operator new(TUint aSize, TAny* aBase) __NO_THROW
+/**
+@internalComponent
+*/
+	{
+	__ASSERT_ALWAYS(aSize>=sizeof(RHeap), HEAP_PANIC(ETHeapNewBadSize));
+	RHeap* h = (RHeap*)aBase;
+	h->iAlign = 0x80000000;	// garbage value
+	h->iBase = ((TUint8*)aBase) + aSize;
+	return aBase;
+	}
+
+void RHeap::Initialise()
+//
+// Initialise the heap.
+//
+	{
+
+	__ASSERT_ALWAYS((TUint32)iAlign>=sizeof(TAny*) && __POWER_OF_2(iAlign), HEAP_PANIC(ETHeapNewBadAlignment));
+	iCellCount = 0;
+	iTotalAllocSize = 0;
+	iBase = (TUint8*)Align(iBase + EAllocCellSize);
+	iBase -= EAllocCellSize;
+	TInt b = iBase - ((TUint8*)this - iOffset);
+	TInt len = _ALIGN_DOWN(iMinLength - b, iAlign);
+	iTop = iBase + len;
+	iMinLength = iTop - ((TUint8*)this - iOffset);
+	iMinCell = Align(KHeapMinCellSize + Max((TInt)EAllocCellSize, (TInt)EFreeCellSize));
+#ifdef _DEBUG
+	memset(iBase, 0xa5, len);
+#endif
+	SCell* pM=(SCell*)iBase; // First free cell
+	iFree.next=pM; // Free list points to first free cell
+	iFree.len=0; // Stop free from joining this with a free block
+	pM->next=NULL; // Terminate the free list
+	pM->len=len; // Set the size of the free cell
+	}
+
+#ifdef _DEBUG
+void RHeap::CheckCell(const SCell* aCell) const
+	{
+	TLinAddr m = TLinAddr(iAlign - 1);
+
+	__ASSERT_DEBUG(!(aCell->len & m), HEAP_PANIC(ETHeapBadCellAddress));
+	__ASSERT_DEBUG(aCell->len >= iMinCell, HEAP_PANIC(ETHeapBadCellAddress));
+	__ASSERT_DEBUG((TUint8*)aCell>=iBase, HEAP_PANIC(ETHeapBadCellAddress));
+	__ASSERT_DEBUG((TUint8*)__NEXT_CELL(aCell)<=iTop, HEAP_PANIC(ETHeapBadCellAddress));
+	}
+#endif
+
+UEXPORT_C RHeap::SCell* RHeap::GetAddress(const TAny* aCell) const
+//
+// As much as possible, check a cell address and backspace it
+// to point at the cell header.
+//
+	{
+
+	TLinAddr m = TLinAddr(iAlign - 1);
+	__ASSERT_ALWAYS(!(TLinAddr(aCell)&m), HEAP_PANIC(ETHeapBadCellAddress));
+
+	SCell* pC = (SCell*)(((TUint8*)aCell)-EAllocCellSize);
+	__CHECK_CELL(pC);
+
+	return pC;
+	}
+
+
+
+
+UEXPORT_C TInt RHeap::AllocLen(const TAny* aCell) const
+/**
+Gets the length of the available space in the specified allocated cell.
+
+@param aCell A pointer to the allocated cell.
+
+@return The length of the available space in the allocated cell.
+
+@panic USER 42 if aCell does not point to  a valid cell.
+*/
+	{
+
+	SCell* pC = GetAddress(aCell);
+	return pC->len - EAllocCellSize;
+	}
+
+
+
+
+
+#if !defined(__HEAP_MACHINE_CODED__) || defined(_DEBUG)
+RHeap::SCell* RHeap::DoAlloc(TInt aSize, SCell*& aLastFree)
+//
+// Allocate without growing. aSize includes cell header and alignment.
+// Lock already held.
+//
+	{
+	SCell* pP = &iFree;
+	SCell* pC = pP->next;
+	for (; pC; pP=pC, pC=pC->next) // Scan the free list
+		{
+		__CHECK_CELL(pC);
+		SCell* pE;
+		if (pC->len >= aSize)				// Block size bigger than request
+			{
+			if (pC->len - aSize < iMinCell)	// Leftover must be large enough to hold an SCell
+			   	{
+			   	aSize = pC->len;			// It isn't, so take it all
+			   	pE = pC->next;				// Set the next field
+			   	}
+			else
+			   	{
+			   	pE = (SCell*)(((TUint8*)pC)+aSize); // Take amount required
+			   	pE->len = pC->len - aSize;	// Initialize new free cell
+			   	pE->next = pC->next;
+			   	}
+			pP->next = pE;					// Update previous pointer
+			pC->len = aSize;				// Set control size word
+#if defined(_DEBUG)														
+			((SDebugCell*)pC)->nestingLevel = iNestingLevel;
+			((SDebugCell*)pC)->allocCount = ++iAllocCount;
+#endif
+			return pC;
+			}
+		}
+	aLastFree = pP;
+	return NULL;
+	}
+#endif
+
+
+
+
+UEXPORT_C TAny* RHeap::Alloc(TInt aSize)
+/**
+Allocates a cell of the specified size from the heap.
+
+If there is insufficient memory available on the heap from which to allocate
+a cell of the required size, the function returns NULL.
+
+The cell is aligned according to the alignment value specified at construction,
+or the default alignment value, if an explict value was not specified.
+
+The resulting size of the allocated cell may be rounded up to a
+value greater than aSize, but is guaranteed to be not less than aSize.
+
+@param aSize The 
+size of the cell to be allocated from the heap
+
+@return A pointer to the allocated cell. NULL if there is insufficient memory 
+        available.
+        
+@panic USER 47 if the maximum unsigned value of aSize is greater than or equal
+       to the value of KMaxTInt/2; for example, calling Alloc(-1) raises
+       this panic.
+       
+@see KMaxTInt        
+*/
+	{
+
+	__CHECK_THREAD_STATE;
+	__ASSERT_ALWAYS((TUint)aSize<(KMaxTInt/2),HEAP_PANIC(ETHeapBadAllocatedCellSize));
+	__SIMULATE_ALLOC_FAIL(return NULL;)
+	
+	TInt origSize = aSize;
+	aSize = Max(Align(aSize + EAllocCellSize), iMinCell);
+	SCell* pL = NULL;
+	Lock();
+	SCell* pC = (SCell*)DoAlloc(aSize, pL);
+	if (!pC && !(iFlags & EFixedSize))
+		{
+		// try to grow chunk heap
+		TInt r = TryToGrowHeap(aSize, pL);
+		if (r==KErrNone)
+			pC = DoAlloc(aSize, pL);
+		}
+	if (pC)
+		++iCellCount, iTotalAllocSize += (pC->len - EAllocCellSize);
+	Unlock();
+	if (pC)
+		{
+		TAny* result=((TUint8*)pC) + EAllocCellSize;
+		if (iFlags & ETraceAllocs)
+			{
+			TUint32 traceData[2];
+			traceData[0] = AllocLen(result);
+			traceData[1] = origSize;
+			BTraceContextN(BTrace::EHeap, BTrace::EHeapAlloc, (TUint32)this, (TUint32)result, traceData, sizeof(traceData));
+			}
+#ifdef __KERNEL_MODE__
+		memclr(result, pC->len - EAllocCellSize);
+#endif		
+		return result;
+		}
+	if (iFlags & ETraceAllocs)						
+			BTraceContext8(BTrace::EHeap, BTrace::EHeapAllocFail, (TUint32)this, (TUint32)origSize);
+	return NULL;
+	}
+
+
+
+
+TInt RHeap::TryToGrowHeap(TInt aSize, SCell* aLastFree)
+	{
+	TBool at_end = IsLastCell(aLastFree);
+	TInt extra = at_end ? aSize - aLastFree->len : aSize;
+	extra = (extra + iGrowBy - 1) / iGrowBy;
+	extra *= iGrowBy;
+	TInt cur_len = _ALIGN_UP(iTop - ((TUint8*)this - iOffset), iPageSize);
+	TInt new_len = cur_len + extra;
+	TInt r = KErrNoMemory;
+	if (new_len <= iMaxLength)
+		{
+		r = SetBrk(new_len);
+		if (r == KErrNone)
+			{
+			if (at_end)
+				aLastFree->len += extra;
+			else
+				{
+				SCell* pC = (SCell*)iTop;
+				pC->len = extra;
+				pC->next = NULL;
+				aLastFree->next = pC;
+				}
+			iTop += extra;
+			}
+		}
+	return r;
+	}
+
+
+
+
+#ifndef __KERNEL_MODE__
+EXPORT_C TInt RHeap::Compress()
+/**
+Compresses the heap.
+
+The function frees excess committed space from the top 
+of the heap. The size of the heap is never reduced below the minimum size 
+specified during creation of the heap.
+
+@return The space reclaimed. If no space can be reclaimed, then this value 
+        is zero.
+*/
+	{
+
+	if (iFlags & EFixedSize)
+		return 0;
+	TInt r = 0;
+	Lock();
+	SCell* pC = &iFree;
+	for (; pC->next; pC=pC->next) {}
+	if (pC!=&iFree)
+		{
+		__CHECK_CELL(pC);
+		if (IsLastCell(pC))
+			r = Reduce(pC);
+		}
+	Unlock();
+	return r;
+	}
+#endif
+
+
+
+
+#if !defined(__HEAP_MACHINE_CODED__) || defined(_DEBUG)
+void RHeap::DoFree(SCell* pC)
+	{
+	__ZAP_CELL(pC);
+
+	SCell* pP = &iFree;
+	SCell* pE = pP->next;
+	for (; pE && pE<pC; pP=pE, pE=pE->next) {}
+	if (pE)			// Is there a following free cell?
+		{
+		SCell* pN = __NEXT_CELL(pC);
+		__ASSERT_ALWAYS(pN<=pE, HEAP_PANIC(ETHeapFreeBadNextCell)); // Following cell overlaps
+		if (pN==pE) // Is it adjacent
+			{
+			pC->len += pE->len; // Yes - coalesce adjacent free cells
+			pC->next = pE->next;
+			}
+		else					// pN<pE, non-adjacent free cells
+			pC->next = pE;		// Otherwise just point to it
+		}
+	else
+		pC->next = NULL;		// No following free cell
+	SCell* pN = __NEXT_CELL(pP);	// pN=pP=&iFree if no preceding free cell
+	__ASSERT_ALWAYS(pN<=pC, HEAP_PANIC(ETHeapFreeBadPrevCell)); // Previous cell overlaps
+	if (pN==pC) // Is it adjacent
+		{
+		pP->len += pC->len;		// Yes - coalesce adjacent free cells
+		pP->next = pC->next;
+		pC = pP;				// for size reduction check
+		}
+	else						// pN<pC, non-adjacent free cells
+		pP->next = pC;			// point previous cell to the one being freed
+	pN = __NEXT_CELL(pC);		// End of amalgamated free cell
+	if ((TUint8*)pN==iTop && !(iFlags & EFixedSize) && 
+		pC->len >= KHeapShrinkHysRatio*(iGrowBy>>8))
+		Reduce(pC);
+	}
+#endif
+
+
+
+
+UEXPORT_C void RHeap::Free(TAny* aCell)
+/**
+Frees the specified cell and returns it to the heap.
+
+@param aCell A pointer to a valid cell; this pointer can also be NULL,
+             in which case the function does nothing and just returns.
+
+@panic USER 42 if aCell points to an invalid cell.
+*/
+	{
+	__CHECK_THREAD_STATE;
+	if (!aCell)
+		return;
+	Lock();
+	if (iFlags & EMonitorMemory)
+		__MEMORY_MONITOR_CHECK_CELL(aCell);
+	SCell* pC = GetAddress(aCell);
+	--iCellCount;
+	iTotalAllocSize -= (pC->len - EAllocCellSize);
+	DoFree(pC);
+	if (iFlags & ETraceAllocs)
+		BTraceContext8(BTrace::EHeap, BTrace::EHeapFree, (TUint32)this, (TUint32)aCell);
+	Unlock();
+	}
+
+
+
+
+TInt RHeap::Reduce(SCell* aCell)
+	{
+	TInt reduce=0;
+	TInt offset=((TUint8*)aCell)-((TUint8*)this - iOffset);
+	if (offset>=iMinLength)
+		reduce = aCell->len;						// length of entire free cell
+	else
+		reduce = offset + aCell->len - iMinLength;	// length of free cell past minimum heap size
+	reduce = _ALIGN_DOWN(reduce, iPageSize);		// round down to page multiple
+	if (reduce<=0)
+		return 0;									// can't reduce this heap
+	TInt new_cell_len = aCell->len - reduce;		// length of last free cell after reduction
+	if (new_cell_len == 0)
+		{
+		// the free cell can be entirely eliminated
+		SCell* pP = &iFree;
+		for (; pP->next!=aCell; pP=pP->next) {}
+		pP->next = NULL;
+		}
+	else
+		{
+		if (new_cell_len < iMinCell)
+			{
+			// max reduction would leave a cell too small
+			reduce -= iPageSize;
+			new_cell_len += iPageSize;
+			}
+		aCell->len = new_cell_len;	// reduce the cell length
+		}
+	iTop -= reduce;
+	TInt new_len = _ALIGN_UP(iTop - ((TUint8*)this - iOffset), iPageSize);
+	TInt r = SetBrk(new_len);
+	__ASSERT_ALWAYS(r==KErrNone, HEAP_PANIC(ETHeapReduceFailed));
+	return reduce;
+	}
+
+
+
+
+#ifndef __KERNEL_MODE__
+EXPORT_C void RHeap::Reset()
+/**
+Frees all allocated cells on this heap.
+*/
+	{
+
+	Lock();
+	if (!(iFlags & EFixedSize))
+		{
+		TInt r = SetBrk(iMinLength);
+		__ASSERT_ALWAYS(r==KErrNone, HEAP_PANIC(ETHeapResetFailed));
+		}
+	Initialise();
+	Unlock();
+	}
+#endif
+
+
+
+
+inline void RHeap::FindFollowingFreeCell(SCell* aCell, SCell*& aPrev, SCell*& aNext)
+//
+// Find the free cell that immediately follows aCell, if one exists
+// If found, aNext is set to point to it, else it is set to NULL.
+// aPrev is set to the free cell before aCell or the dummy free cell where there are no free cells before aCell.
+// Called with lock enabled.
+//
+	{
+	aPrev = &iFree;
+	aNext = aPrev->next;
+	for (; aNext && aNext<aCell; aPrev=aNext, aNext=aNext->next) {}	
+	
+	if (aNext) // If there is a following free cell, check its directly after aCell.
+		{
+			SCell* pNextCell = __NEXT_CELL(aCell);			// end of this cell
+			__ASSERT_ALWAYS(pNextCell<=aNext, (Unlock(), HEAP_PANIC(ETHeapReAllocBadNextCell)));	// Following free cell overlaps
+			if (pNextCell!=aNext) 
+				aNext=NULL;		
+		}
+	}
+
+
+
+
+TInt RHeap::TryToGrowCell(SCell* aCell,SCell* aPrev, SCell* aNext, TInt aSize)
+//
+// Try to grow the heap cell 'aCell' in place, to size 'aSize'.
+// Requires the free cell immediately after aCell (aNext), and the free cell prior to
+// that (aPrev), to be provided.  (As found by FindFollowingFreeCell)
+//
+
+	{
+	TInt extra = aSize - aCell->len;
+	if (aNext && (aNext->len>=extra)) // Is there a following free cell big enough?
+		{
+		if (aNext->len - extra >= iMinCell)	// take part of free cell ?
+			{
+			SCell* pX = (SCell*)((TUint8*)aNext + extra);	// remainder of free cell
+			pX->next = aNext->next;			// remainder->next = original free cell->next
+			pX->len = aNext->len - extra;		// remainder length = original free cell length - extra
+			aPrev->next = pX;					// put remainder into free chain
+			}
+		else
+			{
+			extra = aNext->len;					// Take whole free cell
+			aPrev->next = aNext->next;			// remove from free chain
+			}
+#ifdef __KERNEL_MODE__
+		memclr(((TUint8*)aCell) + aCell->len, extra);
+#endif		
+		aCell->len += extra;					// update reallocated cell length
+		iTotalAllocSize += extra;
+		return KErrNone;
+		}
+	return KErrGeneral;  // No space to grow cell
+	}
+
+
+
+
+// UEXPORT_C TAny* RHeap::ReAlloc(TAny* aCell, TInt aSize, TInt aMode)
+/**
+Increases or decreases the size of an existing cell in the heap.
+
+If the cell is being decreased in size, then it is guaranteed not to move,
+and the function returns the pointer originally passed in aCell. Note that the
+length of the cell will be the same if the difference between the old size
+and the new size is smaller than the minimum cell size.
+
+If the cell is being increased in size, i.e. aSize is bigger than its
+current size, then the function tries to grow the cell in place.
+If successful, then the function returns the pointer originally
+passed in aCell. If unsuccessful, then:
+
+1. if the cell cannot be moved, i.e. aMode has the ENeverMove bit set, then
+   the function returns NULL.
+2. if the cell can be moved, i.e. aMode does not have the ENeverMove bit set,
+   then the function tries to allocate a new replacement cell, and, if
+   successful, returns a pointer to the new cell; if unsuccessful, it
+   returns NULL.
+
+Note that in debug mode, the function returns NULL if the cell cannot be grown
+in place, regardless of whether the ENeverMove bit is set.
+
+If the reallocated cell is at a different location from the original cell, then
+the content of the original cell is copied to the reallocated cell.
+
+If the supplied pointer, aCell is NULL, then the function attempts to allocate
+a new cell, but only if the cell can be moved, i.e. aMode does not have
+the ENeverMove bit set.
+
+Note the following general points:
+
+1. If reallocation fails, the content of the original cell is preserved.
+
+2. The resulting size of the re-allocated cell may be rounded up to a value
+   greater than aSize, but is guaranteed to be not less than aSize.
+ 
+@param aCell A pointer to the cell to be reallocated. This may be NULL.
+
+@param aSize The new size of the cell. This may be bigger or smaller than the
+             size of the original cell.
+             
+@param aMode Flags controlling the reallocation. The only bit which has any
+             effect on this function is that defined by the enumeration
+             ENeverMove of the enum RAllocator::TReAllocMode.
+             If this is set, then any successful reallocation guarantees not
+             to have changed the start address of the cell.
+             By default, this parameter is zero.
+
+@return A pointer to the reallocated cell. This may be the same as the original
+        pointer supplied through aCell. NULL if there is insufficient memory to
+        reallocate the cell, or to grow it in place.
+
+@panic USER 42, if aCell is not NULL, and does not point to a valid cell.
+@panic USER 47, if the maximum unsigned value of aSize is greater
+                than or equal to KMaxTInt/2. For example,
+                calling ReAlloc(someptr,-1) raises this panic.
+
+@see RAllocator::TReAllocMode
+*/
+UEXPORT_C TAny* RHeap::ReAlloc(TAny* aCell, TInt aSize, TInt aMode)
+	{
+	if (aCell && iFlags&EMonitorMemory)
+		__MEMORY_MONITOR_CHECK_CELL(aCell);
+	TAny* retval = ReAllocImpl(aCell, aSize, aMode);
+	if (iFlags & ETraceAllocs)
+		{
+		if (retval)
+			{
+			TUint32 traceData[3];
+			traceData[0] = AllocLen(retval);
+			traceData[1] = aSize;
+			traceData[2] = (TUint32)aCell;
+			BTraceContextN(BTrace::EHeap, BTrace::EHeapReAlloc,(TUint32)this, (TUint32)retval,traceData, sizeof(traceData));
+			}
+		else
+			BTraceContext12(BTrace::EHeap, BTrace::EHeapReAllocFail, (TUint32)this, (TUint32)aCell, (TUint32)aSize);
+		}
+	return retval;
+	}
+inline TAny* RHeap::ReAllocImpl(TAny* aCell, TInt aSize, TInt aMode)
+	{
+	__CHECK_THREAD_STATE;
+	if (!aCell)
+		return (aMode & ENeverMove) ? NULL : Alloc(aSize);
+	__ASSERT_ALWAYS((TUint)aSize<(KMaxTInt/2),HEAP_PANIC(ETHeapBadAllocatedCellSize));
+	Lock();
+	SCell* pC = GetAddress(aCell);
+	TInt old_len = pC->len;
+	__DEBUG_SAVE(pC);
+	aSize = Max(Align(aSize + EAllocCellSize), iMinCell);
+	if (aSize > old_len)	// Trying to grow cell
+		{
+		__SIMULATE_ALLOC_FAIL({	Unlock(); return NULL;})			
+		
+		// Try to grow cell in place, without reallocation
+		SCell* pPrev;
+		SCell* pNext;
+		FindFollowingFreeCell(pC,pPrev, pNext);
+		TInt r = TryToGrowCell(pC, pPrev, pNext, aSize);
+		
+		if (r==KErrNone) 
+			{
+			Unlock();
+			return aCell;
+			}
+
+		if (!(aMode & ENeverMove))
+		// If moving allowed, try re-alloc. 
+		// If we need to extend heap,and cell is at the end, try and grow in place
+			{
+			SCell* pLastFree;
+			SCell* pNewCell = (SCell*)DoAlloc(aSize, pLastFree);
+			if (!pNewCell && !(iFlags & EFixedSize))
+			// if we need to extend the heap to alloc
+				{
+				if (IsLastCell(pC) || (pNext && IsLastCell(pNext)))
+				// if last used Cell, try and extend heap and then cell 
+					{
+					TInt r = TryToGrowHeap(aSize - old_len, pLastFree);
+					if (r==KErrNone)
+						{
+						r = TryToGrowCell(pC, pPrev, pPrev->next, aSize);
+						Unlock();
+						__ASSERT_DEBUG(r == KErrNone, HEAP_PANIC(ETHeapCellDidntGrow));						
+						return aCell;
+						}
+					}
+				else
+				// try to grow chunk heap and Alloc on it
+					{
+					TInt r = TryToGrowHeap(aSize, pLastFree);
+					if (r==KErrNone)
+						pNewCell = DoAlloc(aSize, pLastFree);
+					}
+				}
+
+			if (pNewCell)
+			// if we created a new cell, adjust tellies, copy the contents and delete old cell.
+				{
+				iCellCount++;
+				iTotalAllocSize += (pNewCell->len - EAllocCellSize);
+
+				Unlock();
+				TUint8* raw = ((TUint8*) pNewCell);
+				
+				memcpy(raw + EAllocCellSize, aCell, old_len - EAllocCellSize);
+#ifdef __KERNEL_MODE__
+				memclr(raw + old_len, pNewCell->len - old_len);
+#endif		
+				Free(aCell);
+				__DEBUG_RESTORE(raw + EAllocCellSize);
+				return raw + EAllocCellSize;
+				}
+			}
+		else 
+		// No moving, but still posible to extend the heap (if heap extendable)
+			{
+			if (!(iFlags & EFixedSize) && (IsLastCell(pC) || (pNext && IsLastCell(pNext))))
+				{
+				SCell* pLastFree = pNext ? pNext : pPrev;
+				TInt r = TryToGrowHeap(aSize - old_len, pLastFree);
+				if (r==KErrNone)
+					{
+					r = TryToGrowCell(pC, pPrev, pPrev->next, aSize);
+					Unlock();
+					__ASSERT_DEBUG(r==KErrNone, HEAP_PANIC(ETHeapCellDidntGrow));					
+					return aCell;
+					}
+				}
+			}			
+		Unlock();
+		return NULL;
+		}
+	if (old_len - aSize >= iMinCell)
+		{
+		// cell shrinking, remainder big enough to form a new free cell
+		SCell* pX = (SCell*)((TUint8*)pC + aSize);	// pointer to new free cell
+		pC->len = aSize;			// update cell size
+		pX->len = old_len - aSize;	// size of remainder
+		iTotalAllocSize -= pX->len;
+		DoFree(pX);					// link new free cell into chain, shrink heap if necessary
+		}
+	Unlock();
+	return aCell;
+	}
+
+
+
+
+#ifndef __KERNEL_MODE__
+
+EXPORT_C TInt RHeap::Available(TInt& aBiggestBlock) const
+/**
+Gets the total free space currently available on the heap and the space 
+available in the largest free block.
+
+The space available represents the total space which can be allocated.
+
+Note that compressing the heap may reduce the total free space available and 
+the space available in the largest free block.
+
+@param aBiggestBlock On return, contains the space available 
+                     in the largest free block on the heap.
+                     
+@return The total free space currently available on the heap.
+*/
+	{
+
+	TInt total = 0;
+	TInt max = 0;
+	Lock();
+	SCell* pC = iFree.next;
+	for (; pC; pC=pC->next)
+		{
+		TInt l = pC->len - EAllocCellSize;
+		if (l > max)
+			max = l;
+		total += l;
+		}
+	Unlock();
+	aBiggestBlock = max;
+	return total;
+	}
+
+
+
+
+EXPORT_C TInt RHeap::AllocSize(TInt& aTotalAllocSize) const
+/**
+Gets the number of cells allocated on this heap, and the total space 
+allocated to them.
+
+@param aTotalAllocSize On return, contains the total space allocated
+                       to the cells.
+
+@return The number of cells allocated on this heap.
+*/
+	{
+	Lock();
+	TInt c = iCellCount;
+	aTotalAllocSize = iTotalAllocSize;
+	Unlock();
+	return c;
+	}
+
+
+
+
+EXPORT_C RHeap* UserHeap::FixedHeap(TAny* aBase, TInt aMaxLength, TInt aAlign, TBool aSingleThread)
+/**
+Creates a fixed length heap at a specified location.
+
+On successful return from this function, aMaxLength bytes are committed by the chunk.
+The heap cannot be extended.
+
+@param aBase         A pointer to the location where the heap is to be constructed.
+@param aMaxLength    The length of the heap. If the supplied value is less
+                     than KMinHeapSize, it is discarded and the value KMinHeapSize
+                     is used instead.
+@param aAlign        The alignment of heap cells.
+@param aSingleThread Indicates whether single threaded or not.
+
+@return A pointer to the new heap, or NULL if the heap could not be created.
+
+@panic USER 56 if aMaxLength is negative.
+@panic USER 172 if aAlign is not a power of 2 or is less than the size of a TAny*.
+*/
+//
+// Force construction of the fixed memory.
+//
+	{
+
+	__ASSERT_ALWAYS(aMaxLength>=0, ::Panic(ETHeapMaxLengthNegative));
+	if (aMaxLength<KMinHeapSize)
+		aMaxLength=KMinHeapSize;
+	RHeap* h = new(aBase) RHeap(aMaxLength, aAlign, aSingleThread);
+	if (!aSingleThread)
+		{
+		TInt r = h->iLock.CreateLocal();
+		if (r!=KErrNone)
+			return NULL;
+		h->iHandles = (TInt*)&h->iLock;
+		h->iHandleCount = 1;
+		}
+	return h;
+	}
+
+
+/**
+Constructor where minimum and maximum length of the heap can be defined.
+It defaults the chunk heap to be created to have use a new local chunk, 
+to have a grow by value of KMinHeapGrowBy, to be unaligned, not to be 
+single threaded and not to have any mode flags set.
+
+@param aMinLength    The minimum length of the heap to be created.
+@param aMaxLength    The maximum length to which the heap to be created can grow.
+                     If the supplied value is less than KMinHeapSize, then it
+                     is discarded and the value KMinHeapSize used instead.
+*/
+EXPORT_C TChunkHeapCreateInfo::TChunkHeapCreateInfo(TInt aMinLength, TInt aMaxLength) :
+	iVersionNumber(EVersion0), iMinLength(aMinLength), iMaxLength(aMaxLength),
+	iAlign(0), iGrowBy(1), iSingleThread(EFalse), 
+	iOffset(0), iPaging(EUnspecified), iMode(0), iName(NULL)
+	{
+	}
+
+
+/**
+Sets the chunk heap to create a new chunk with the specified name.
+
+This overriddes any previous call to TChunkHeapCreateInfo::SetNewChunkHeap() or
+TChunkHeapCreateInfo::SetExistingChunkHeap() for this TChunkHeapCreateInfo object.
+
+@param aName	The name to be given to the chunk heap to be created
+				If NULL, the function constructs a local chunk to host the heap.
+				If not NULL, a pointer to a descriptor containing the name to be 
+				assigned to the global chunk hosting the heap.
+*/
+EXPORT_C void TChunkHeapCreateInfo::SetCreateChunk(const TDesC* aName)
+	{
+	iName = (TDesC*)aName;
+	iChunk.SetHandle(KNullHandle);
+	}
+
+
+/**
+Sets the chunk heap to be created to use the chunk specified.
+
+This overriddes any previous call to TChunkHeapCreateInfo::SetNewChunkHeap() or
+TChunkHeapCreateInfo::SetExistingChunkHeap() for this TChunkHeapCreateInfo object.
+
+@param aChunk	A handle to the chunk to use for the heap.
+*/
+EXPORT_C void TChunkHeapCreateInfo::SetUseChunk(const RChunk aChunk)
+	{
+	iName = NULL;
+	iChunk = aChunk;
+	}
+
+
+/**
+Creates a chunk heap of the type specified by the parameter aCreateInfo.
+
+@param aCreateInfo	A reference to a TChunkHeapCreateInfo object specifying the
+					type of chunk heap to create.
+
+@return A pointer to the new heap or NULL if the heap could not be created.
+
+@panic USER 41 if the heap's specified minimum length is greater than the specified maximum length.
+@panic USER 55 if the heap's specified minimum length is negative.
+@panic USER 172 if the heap's specified alignment is not a power of 2 or is less than the size of a TAny*.
+*/
+EXPORT_C RHeap* UserHeap::ChunkHeap(const TChunkHeapCreateInfo& aCreateInfo)
+	{
+	// aCreateInfo must have been configured to use a new chunk or an exiting chunk.
+	__ASSERT_ALWAYS(!(aCreateInfo.iMode & (TUint32)~EChunkHeapMask), ::Panic(EHeapCreateInvalidMode));
+	RHeap* h = NULL;
+
+	if (aCreateInfo.iChunk.Handle() == KNullHandle)
+		{// A new chunk is to be created for this heap.
+		__ASSERT_ALWAYS(aCreateInfo.iMinLength >= 0, ::Panic(ETHeapMinLengthNegative));
+		__ASSERT_ALWAYS(aCreateInfo.iMaxLength >= aCreateInfo.iMinLength, ::Panic(ETHeapCreateMaxLessThanMin));
+
+		TInt maxLength = aCreateInfo.iMaxLength;
+		if (maxLength < KMinHeapSize)
+			maxLength = KMinHeapSize;
+
+		TChunkCreateInfo chunkInfo;
+		chunkInfo.SetNormal(0, maxLength);
+		chunkInfo.SetOwner((aCreateInfo.iSingleThread)? EOwnerThread : EOwnerProcess);
+		if (aCreateInfo.iName)
+			chunkInfo.SetGlobal(*aCreateInfo.iName);
+		// Set the paging attributes of the chunk.
+		if (aCreateInfo.iPaging == TChunkHeapCreateInfo::EPaged)
+			chunkInfo.SetPaging(TChunkCreateInfo::EPaged);
+		if (aCreateInfo.iPaging == TChunkHeapCreateInfo::EUnpaged)
+			chunkInfo.SetPaging(TChunkCreateInfo::EUnpaged);
+		// Create the chunk.
+		RChunk chunk;
+		if (chunk.Create(chunkInfo) != KErrNone)
+			return NULL;
+		// Create the heap using the new chunk.
+		TUint mode = aCreateInfo.iMode | EChunkHeapDuplicate;	// Must duplicate the handle.
+		h = OffsetChunkHeap(chunk, aCreateInfo.iMinLength, aCreateInfo.iOffset,
+							aCreateInfo.iGrowBy, maxLength, aCreateInfo.iAlign,
+							aCreateInfo.iSingleThread, mode);
+		chunk.Close();
+		}
+	else
+		{
+		h = OffsetChunkHeap(aCreateInfo.iChunk, aCreateInfo.iMinLength, aCreateInfo.iOffset,
+							aCreateInfo.iGrowBy, aCreateInfo.iMaxLength, aCreateInfo.iAlign,
+							aCreateInfo.iSingleThread, aCreateInfo.iMode);
+		}
+	return h;
+	}
+
+
+EXPORT_C RHeap* UserHeap::ChunkHeap(const TDesC* aName, TInt aMinLength, TInt aMaxLength, TInt aGrowBy, TInt aAlign, TBool aSingleThread)
+/**
+Creates a heap in a local or global chunk.
+
+The chunk hosting the heap can be local or global.
+
+A local chunk is one which is private to the process creating it and is not
+intended for access by other user processes.
+A global chunk is one which is visible to all processes.
+
+The hosting chunk is local, if the pointer aName is NULL, otherwise
+the hosting chunk is global and the descriptor *aName is assumed to contain
+the name to be assigned to it.
+
+Ownership of the host chunk is vested in the current process.
+
+A minimum and a maximum size for the heap can be specified. On successful
+return from this function, the size of the heap is at least aMinLength.
+If subsequent requests for allocation of memory from the heap cannot be
+satisfied by compressing the heap, the size of the heap is extended in
+increments of aGrowBy until the request can be satisfied. Attempts to extend
+the heap causes the size of the host chunk to be adjusted.
+
+Note that the size of the heap cannot be adjusted by more than aMaxLength.
+
+@param aName         If NULL, the function constructs a local chunk to host
+                     the heap.
+                     If not NULL, a pointer to a descriptor containing the name
+                     to be assigned to the global chunk hosting the heap.
+@param aMinLength    The minimum length of the heap.
+@param aMaxLength    The maximum length to which the heap can grow.
+                     If the supplied value is less than KMinHeapSize, then it
+                     is discarded and the value KMinHeapSize used instead.
+@param aGrowBy       The increments to the size of the host chunk. If a value is
+                     not explicitly specified, the value KMinHeapGrowBy is taken
+                     by default
+@param aAlign        The alignment of heap cells.
+@param aSingleThread Indicates whether single threaded or not.
+
+@return A pointer to the new heap or NULL if the heap could not be created.
+
+@panic USER 41 if aMinLength is greater than the supplied value of aMaxLength.
+@panic USER 55 if aMinLength is negative.
+@panic USER 172 if aAlign is not a power of 2 or is less than the size of a TAny*.
+*/
+//
+// Allocate a Chunk of the requested size and force construction.
+//
+	{
+	TChunkHeapCreateInfo createInfo(aMinLength, aMaxLength);
+	createInfo.SetCreateChunk(aName);
+	createInfo.SetGrowBy(aGrowBy);
+	createInfo.SetAlignment(aAlign);
+	createInfo.SetSingleThread(aSingleThread);
+	return ChunkHeap(createInfo);
+	}
+
+
+
+
+EXPORT_C RHeap* UserHeap::ChunkHeap(RChunk aChunk, TInt aMinLength, TInt aGrowBy, TInt aMaxLength, TInt aAlign, TBool aSingleThread, TUint32 aMode)
+/**
+Creates a heap in an existing chunk.
+
+This function is intended to be used to create a heap in a user writable code
+chunk as created by a call to RChunk::CreateLocalCode().
+This type of heap can be used to hold code fragments from a JIT compiler.
+
+The maximum length to which the heap can grow is the same as
+the maximum size of the chunk.
+
+@param aChunk        The chunk that will host the heap.
+@param aMinLength    The minimum length of the heap.
+@param aGrowBy       The increments to the size of the host chunk. 
+@param aMaxLength    The maximum length to which the heap can grow.
+@param aAlign        The alignment of heap cells.
+@param aSingleThread Indicates whether single threaded or not.
+@param aMode         Flags controlling the heap creation.  This should be set 
+					 from one or more of the values in TChunkHeapCreateMode.
+                     
+@return A pointer to the new heap or NULL if the heap could not be created.
+
+@panic USER 172 if aAlign is not a power of 2 or is less than the size of a TAny*.
+*/
+//
+// Construct a heap in an already existing chunk
+//
+	{
+	
+	return OffsetChunkHeap(aChunk, aMinLength, 0, aGrowBy, aMaxLength, aAlign, aSingleThread, aMode);
+	}
+
+
+
+
+EXPORT_C RHeap* UserHeap::OffsetChunkHeap(RChunk aChunk, TInt aMinLength, TInt aOffset, TInt aGrowBy, TInt aMaxLength, TInt aAlign, TBool aSingleThread, TUint32 aMode)
+/**
+Creates a heap in an existing chunk, offset from the beginning of the chunk.
+
+This function is intended to be used to create a heap where a fixed amount of
+additional data must be stored at a known location. The additional data can be
+placed at the base address of the chunk, allowing it to be located without
+depending on the internals of the heap structure.
+
+The maximum length to which the heap can grow is the maximum size of the chunk,
+minus the offset.
+
+@param aChunk        The chunk that will host the heap.
+@param aMinLength    The minimum length of the heap.
+@param aOffset       The offset from the start of the chunk, to the start of the heap.
+@param aGrowBy       The increments to the size of the host chunk. 
+@param aMaxLength    The maximum length to which the heap can grow.
+@param aAlign        The alignment of heap cells.
+@param aSingleThread Indicates whether single threaded or not.
+@param aMode         Flags controlling the heap creation.  This should be set 
+					 from one or more of the values in TChunkHeapCreateMode.
+                     
+@return A pointer to the new heap or NULL if the heap could not be created.
+
+@panic USER 172 if aAlign is not a power of 2 or is less than the size of a TAny*.
+*/
+//
+// Construct a heap in an already existing chunk
+//
+	{
+
+	TInt page_size;
+	UserHal::PageSizeInBytes(page_size);
+	if (!aAlign)
+		aAlign = RHeap::ECellAlignment;
+	TInt maxLength = aChunk.MaxSize();
+	TInt round_up = Max(aAlign, page_size);
+	TInt min_cell = _ALIGN_UP(Max((TInt)RHeap::EAllocCellSize, (TInt)RHeap::EFreeCellSize), aAlign);
+	aOffset = _ALIGN_UP(aOffset, 8);
+	if (aMaxLength && aMaxLength+aOffset<maxLength)
+		maxLength = _ALIGN_UP(aMaxLength+aOffset, round_up);
+	__ASSERT_ALWAYS(aMinLength>=0, ::Panic(ETHeapMinLengthNegative));
+	__ASSERT_ALWAYS(maxLength>=aMinLength, ::Panic(ETHeapCreateMaxLessThanMin));
+	aMinLength = _ALIGN_UP(Max(aMinLength, (TInt)sizeof(RHeap) + min_cell) + aOffset, round_up);
+	TInt r=aChunk.Adjust(aMinLength);
+	if (r!=KErrNone)
+		return NULL;
+
+	RHeap* h = new (aChunk.Base() + aOffset) RHeap(aChunk.Handle(), aOffset, aMinLength, maxLength, aGrowBy, aAlign, aSingleThread);
+
+	TBool duplicateLock = EFalse;
+	if (!aSingleThread)
+		{
+		duplicateLock = aMode & EChunkHeapSwitchTo;
+		if(h->iLock.CreateLocal(duplicateLock ? EOwnerThread : EOwnerProcess)!=KErrNone)
+			{
+			h->iChunkHandle = 0;
+			return NULL;
+			}
+		}
+
+	if (aMode & EChunkHeapSwitchTo)
+		User::SwitchHeap(h);
+
+	h->iHandles = &h->iChunkHandle;
+	if (!aSingleThread)
+		{
+		// now change the thread-relative chunk/semaphore handles into process-relative handles
+		h->iHandleCount = 2;
+		if(duplicateLock)
+			{
+			RHandleBase s = h->iLock;
+			r = h->iLock.Duplicate(RThread());
+			s.Close();
+			}
+		if (r==KErrNone && (aMode & EChunkHeapDuplicate))
+			{
+			r = ((RChunk*)&h->iChunkHandle)->Duplicate(RThread());
+			if (r!=KErrNone)
+				h->iLock.Close(), h->iChunkHandle=0;
+			}
+		}
+	else
+		{
+		h->iHandleCount = 1;
+		if (aMode & EChunkHeapDuplicate)
+			r = ((RChunk*)&h->iChunkHandle)->Duplicate(RThread(), EOwnerThread);
+		}
+
+	// return the heap address
+	return (r==KErrNone) ? h : NULL;
+	}
+
+
+
+#define UserTestDebugMaskBit(bit) (TBool)(UserSvr::DebugMask(bit>>5) & (1<<(bit&31)))
+
+_LIT(KLitDollarHeap,"$HEAP");
+EXPORT_C TInt UserHeap::CreateThreadHeap(SStdEpocThreadCreateInfo& aInfo, RHeap*& aHeap, TInt aAlign, TBool aSingleThread)
+/**
+@internalComponent
+*/
+//
+// Create a user-side heap
+//
+	{
+	TInt page_size;
+	UserHal::PageSizeInBytes(page_size);
+	TInt minLength = _ALIGN_UP(aInfo.iHeapInitialSize, page_size);
+	TInt maxLength = Max(aInfo.iHeapMaxSize, minLength);
+	if (UserTestDebugMaskBit(96)) // 96 == KUSERHEAPTRACE in nk_trace.h
+		aInfo.iFlags |= ETraceHeapAllocs;
+
+	// Create the thread's heap chunk.
+	RChunk c;
+	TChunkCreateInfo createInfo;
+	createInfo.SetThreadHeap(0, maxLength, KLitDollarHeap());	// Initialise with no memory committed.
+
+	// Set the paging policy of the heap chunk based on the thread's paging policy.
+	TUint pagingflags = aInfo.iFlags & EThreadCreateFlagPagingMask;
+	switch (pagingflags)
+		{
+		case EThreadCreateFlagPaged:
+			createInfo.SetPaging(TChunkCreateInfo::EPaged);
+			break;
+		case EThreadCreateFlagUnpaged:
+			createInfo.SetPaging(TChunkCreateInfo::EUnpaged);
+			break;
+		case EThreadCreateFlagPagingUnspec:
+			// Leave the chunk paging policy unspecified so the process's 
+			// paging policy is used.
+			break;
+		}
+
+	TInt r = c.Create(createInfo);
+	if (r!=KErrNone)
+		return r;
+
+	aHeap = ChunkHeap(c, minLength, page_size, maxLength, aAlign, aSingleThread, EChunkHeapSwitchTo|EChunkHeapDuplicate);
+	c.Close();
+	if (!aHeap)
+		return KErrNoMemory;
+	if (aInfo.iFlags & ETraceHeapAllocs)
+		{
+		aHeap->iFlags |= RHeap::ETraceAllocs;
+		BTraceContext8(BTrace::EHeap, BTrace::EHeapCreate,(TUint32)aHeap, RHeap::EAllocCellSize);
+		TInt handle = aHeap->ChunkHandle();
+		TInt chunkId = ((RHandleBase&)handle).BTraceId();
+		BTraceContext8(BTrace::EHeap, BTrace::EHeapChunkCreate, (TUint32)aHeap, chunkId);
+		}
+	if (aInfo.iFlags & EMonitorHeapMemory)
+		aHeap->iFlags |= RHeap::EMonitorMemory;
+	return KErrNone;
+	}
+
+#endif	// __KERNEL_MODE__
+
+void RHeap::WalkCheckCell(TAny* aPtr, TCellType aType, TAny* aCell, TInt aLen)
+	{
+	(void)aCell;
+	SHeapCellInfo& info = *(SHeapCellInfo*)aPtr;
+	switch(aType)
+		{
+		case EGoodAllocatedCell:
+			{
+			++info.iTotalAlloc;
+			info.iTotalAllocSize += (aLen-EAllocCellSize);
+#if defined(_DEBUG)
+			RHeap& h = *info.iHeap;
+			if ( ((SDebugCell*)aCell)->nestingLevel == h.iNestingLevel )
+				{
+				if (++info.iLevelAlloc==1)
+					info.iStranded = (SDebugCell*)aCell;
+#ifdef __KERNEL_MODE__
+				if (KDebugNum(KSERVER) || KDebugNum(KTESTFAST))
+					{
+//				__KTRACE_OPT(KSERVER,Kern::Printf("LEAKED KERNEL HEAP CELL @ %08x : len=%d", aCell, aLen));
+					Kern::Printf("LEAKED KERNEL HEAP CELL @ %08x : len=%d", aCell, aLen);
+					TLinAddr base = ((TLinAddr)aCell)&~0x0f;
+					TLinAddr end = ((TLinAddr)aCell)+(TLinAddr)aLen;
+					while(base<end)
+						{
+						const TUint32* p = (const TUint32*)base;
+						Kern::Printf("%08x: %08x %08x %08x %08x", p, p[0], p[1], p[2], p[3]);
+						base += 16;
+						}
+					}
+#endif
+				}
+#endif	
+			break;
+			}
+		case EGoodFreeCell:
+			++info.iTotalFree;
+			break;
+		case EBadAllocatedCellSize:
+			HEAP_PANIC(ETHeapBadAllocatedCellSize);
+		case EBadAllocatedCellAddress:
+			HEAP_PANIC(ETHeapBadAllocatedCellAddress);
+		case EBadFreeCellAddress:
+			HEAP_PANIC(ETHeapBadFreeCellAddress);
+		case EBadFreeCellSize:
+			HEAP_PANIC(ETHeapBadFreeCellSize);
+		default:
+			HEAP_PANIC(ETHeapWalkBadCellType);
+		}
+	}
+
+TInt RHeap::DoCountAllocFree(TInt& aFree)
+	{
+	SHeapCellInfo info;
+	memclr(&info, sizeof(info));
+	info.iHeap = this;
+	Walk(&WalkCheckCell, &info);
+	aFree = info.iTotalFree;
+	return info.iTotalAlloc;
+	}
+
+
+UEXPORT_C TInt RHeap::DebugFunction(TInt aFunc, TAny* a1, TAny* a2)
+/**
+@internalComponent
+*/
+	{
+	TInt r = KErrNone;
+	switch(aFunc)
+		{
+		case RAllocator::ECount:
+			r = DoCountAllocFree(*(TInt*)a1);
+			break;
+		case RAllocator::EMarkStart:
+			__DEBUG_ONLY(DoMarkStart());
+			break;
+		case RAllocator::EMarkEnd:
+			__DEBUG_ONLY( r = DoMarkEnd((TInt)a1) );
+			break;
+		case RAllocator::ECheck:
+			r = DoCheckHeap((SCheckInfo*)a1);
+			break;
+		case RAllocator::ESetFail:
+			__DEBUG_ONLY(DoSetAllocFail((TAllocFail)(TInt)a1, (TInt)a2));
+			break;
+		case RAllocator::ESetBurstFail:
+#if _DEBUG
+			{
+			SRAllocatorBurstFail* fail = (SRAllocatorBurstFail*) a2;
+			DoSetAllocFail((TAllocFail)(TInt)a1, fail->iRate, fail->iBurst);
+			}
+#endif
+			break;
+
+		case RAllocator::ECheckFailure:
+				// iRand will be incremented for each EFailNext, EBurstFailNext,
+				// EDeterministic and EBurstDeterministic failure.
+				r = iRand;
+				break;
+
+		case RAllocator::ECopyDebugInfo:
+			{
+			TInt nestingLevel = ((SDebugCell*)a1)[-1].nestingLevel;
+			((SDebugCell*)a2)[-1].nestingLevel = nestingLevel;
+			break;
+			}
+		case RHeap::EWalk:
+			Walk((TWalkFunc)a1, a2);
+			break;
+		default:
+			return KErrNotSupported;
+		}
+	return r;
+	}
+
+
+
+
+void RHeap::Walk(TWalkFunc aFunc, TAny* aPtr)
+//
+// Walk the heap calling the info function.
+//
+	{
+
+	Lock();
+	SCell* pC = (SCell*)iBase;		// allocated cells
+	SCell* pF = &iFree;				// free cells
+	FOREVER
+		{
+		pF = pF->next;				// next free cell
+		if (!pF)
+			pF = (SCell*)iTop;		// to make size checking work
+		else if ( (TUint8*)pF>=iTop || (pF->next && pF->next<=pF) )
+			{
+			if (iFlags & ETraceAllocs)
+				BTraceContext12(BTrace::EHeap, BTrace::EHeapCorruption, (TUint32)this, (TUint32)pF+EFreeCellSize, 0);
+			// free cell pointer off the end or going backwards
+			Unlock();
+			(*aFunc)(aPtr, EBadFreeCellAddress, pF, 0);
+			return;
+			}
+		else
+			{
+			TInt l = pF->len;
+			if (l<iMinCell || (l & (iAlign-1)))
+				{
+				if (iFlags & ETraceAllocs)
+					BTraceContext12(BTrace::EHeap, BTrace::EHeapCorruption, (TUint32)this, (TUint32)pF+EFreeCellSize, l-EFreeCellSize);
+				// free cell length invalid
+				Unlock();
+				(*aFunc)(aPtr, EBadFreeCellSize, pF, l);
+				return;
+				}
+			}
+		while (pC!=pF)				// walk allocated cells up to next free cell
+			{
+			TInt l = pC->len;
+			if (l<iMinCell || (l & (iAlign-1)))
+				{
+				if (iFlags & ETraceAllocs)
+					BTraceContext12(BTrace::EHeap, BTrace::EHeapCorruption, (TUint32)this, (TUint32)pC+EAllocCellSize, l-EAllocCellSize);
+				// allocated cell length invalid
+				Unlock();
+				(*aFunc)(aPtr, EBadAllocatedCellSize, pC, l);
+				return;
+				}
+			(*aFunc)(aPtr, EGoodAllocatedCell, pC, l);
+			SCell* pN = __NEXT_CELL(pC);
+			if (pN > pF)
+				{
+				if (iFlags & ETraceAllocs)
+					BTraceContext12(BTrace::EHeap, BTrace::EHeapCorruption, (TUint32)this, (TUint32)pC+EAllocCellSize, l-EAllocCellSize);			
+				// cell overlaps next free cell
+				Unlock();
+				(*aFunc)(aPtr, EBadAllocatedCellAddress, pC, l);
+				return;
+				}
+			pC = pN;
+			}
+		if ((TUint8*)pF == iTop)
+			break;		// reached end of heap
+		pC = __NEXT_CELL(pF);	// step to next allocated cell
+		(*aFunc)(aPtr, EGoodFreeCell, pF, pF->len);
+		}
+	Unlock();
+	}
+
+TInt RHeap::DoCheckHeap(SCheckInfo* aInfo)
+	{
+	(void)aInfo;
+	SHeapCellInfo info;
+	memclr(&info, sizeof(info));
+	info.iHeap = this;
+	Walk(&WalkCheckCell, &info);
+#if defined(_DEBUG)
+	if (!aInfo)
+		return KErrNone;
+	TInt expected = aInfo->iCount;
+	TInt actual = aInfo->iAll ? info.iTotalAlloc : info.iLevelAlloc;
+	if (actual!=expected && !iTestData)
+		{
+#ifdef __KERNEL_MODE__
+		Kern::Fault("KERN-ALLOC COUNT", (expected<<16)|actual );
+#else
+		User::Panic(_L("ALLOC COUNT"), (expected<<16)|actual );
+#endif
+		}
+#endif
+	return KErrNone;
+	}
+
+#ifdef _DEBUG
+void RHeap::DoMarkStart()
+	{
+	if (iNestingLevel==0)
+		iAllocCount=0;
+	iNestingLevel++;
+	}
+
+TUint32 RHeap::DoMarkEnd(TInt aExpected)
+	{
+	if (iNestingLevel==0)
+		return 0;
+	SHeapCellInfo info;
+	SHeapCellInfo* p = iTestData ? (SHeapCellInfo*)iTestData : &info;
+	memclr(p, sizeof(info));
+	p->iHeap = this;
+	Walk(&WalkCheckCell, p);
+	if (p->iLevelAlloc != aExpected && !iTestData)
+		return (TUint32)(p->iStranded + 1);
+	if (--iNestingLevel == 0)
+		iAllocCount = 0;
+	return 0;
+	}
+
+void ResetAllocCellLevels(TAny* aPtr, RHeap::TCellType aType, TAny* aCell, TInt aLen)
+	{
+	(void)aPtr;
+	(void)aLen;
+	RHeap::SDebugCell* cell = (RHeap::SDebugCell*)aCell;
+	if (aType == RHeap::EGoodAllocatedCell)
+		{
+		cell->nestingLevel = 0;
+		}
+	}
+
+void RHeap::DoSetAllocFail(TAllocFail aType, TInt aRate)
+	{// Default to a burst mode of 1, as aType may be a burst type.
+	DoSetAllocFail(aType, aRate, 1);
+	}
+
+// Don't change as the ETHeapBadDebugFailParameter check below and the API 
+// documentation rely on this being 16 for RHeap.
+LOCAL_D const TInt KBurstFailRateShift = 16;
+LOCAL_D const TInt KBurstFailRateMask = (1 << KBurstFailRateShift) - 1;
+
+void RHeap::DoSetAllocFail(TAllocFail aType, TInt aRate, TUint aBurst)
+	{
+	if (aType==EReset)
+		{
+		// reset levels of all allocated cells to 0
+		// this should prevent subsequent tests failing unnecessarily
+		iFailed = EFalse;		// Reset for ECheckFailure relies on this.
+		Walk(&ResetAllocCellLevels, NULL);
+		// reset heap allocation mark as well
+		iNestingLevel=0;
+		iAllocCount=0;
+		aType=ENone;
+		}
+
+	switch (aType)
+		{
+		case EBurstRandom:
+		case EBurstTrueRandom:
+		case EBurstDeterministic:
+		case EBurstFailNext:
+			// If the fail type is a burst type then iFailRate is split in 2:
+			// the 16 lsbs are the fail rate and the 16 msbs are the burst length.
+			if (TUint(aRate) > (TUint)KMaxTUint16 || aBurst > KMaxTUint16)
+				HEAP_PANIC(ETHeapBadDebugFailParameter);
+
+			iFailed = EFalse;
+			iFailType = aType;
+			iFailRate = (aRate == 0) ? 1 : aRate;
+			iFailAllocCount = -iFailRate;
+			iFailRate = iFailRate | (aBurst << KBurstFailRateShift);
+			break;
+
+		default:
+			iFailed = EFalse;
+			iFailType = aType;
+			iFailRate = (aRate == 0) ? 1 : aRate; // A rate of <1 is meaningless
+			iFailAllocCount = 0;
+			break;
+		}
+
+	// Set up iRand for either:
+	//		- random seed value, or
+	//		- a count of the number of failures so far.
+	iRand = 0;
+#ifndef __KERNEL_MODE__
+	switch (iFailType)
+		{
+		case ETrueRandom:
+		case EBurstTrueRandom:
+			{
+			TTime time;
+			time.HomeTime();
+			TInt64 seed = time.Int64();
+			iRand = Math::Rand(seed);
+			break;
+			}
+		case ERandom:
+		case EBurstRandom:
+	        {
+	        TInt64 seed = 12345;
+			iRand = Math::Rand(seed);
+			break;
+	        }
+		default:
+			break;
+		}
+#endif
+	}
+
+TBool RHeap::CheckForSimulatedAllocFail()
+//
+// Check to see if the user has requested simulated alloc failure, and if so possibly 
+// Return ETrue indicating a failure.
+//
+	{
+	// For burst mode failures iFailRate is shared
+	TUint16 rate  = (TUint16)(iFailRate &  KBurstFailRateMask);
+	TUint16 burst = (TUint16)(iFailRate >> KBurstFailRateShift);
+	TBool r = EFalse;
+	switch (iFailType)
+		{
+#ifndef __KERNEL_MODE__
+		case ERandom:
+		case ETrueRandom:
+			if (++iFailAllocCount>=iFailRate) 
+				{	
+				iFailAllocCount=0;
+				if (!iFailed) // haven't failed yet after iFailRate allocations so fail now
+					return(ETrue); 
+				iFailed=EFalse;
+				}
+			else   
+				{
+				if (!iFailed)
+					{
+	                TInt64 seed=iRand;
+					iRand=Math::Rand(seed);
+					if (iRand%iFailRate==0)
+						{
+						iFailed=ETrue;
+						return(ETrue);
+						}
+					}
+				}
+			break;
+
+		case EBurstRandom:
+		case EBurstTrueRandom:
+			if (++iFailAllocCount < 0) 
+				{
+				// We haven't started failing yet so should we now?
+				TInt64 seed = iRand;
+				iRand = Math::Rand(seed);
+				if (iRand % rate == 0)
+					{// Fail now.  Reset iFailAllocCount so we fail burst times
+					iFailAllocCount = 0;
+					r = ETrue;
+					}
+				}
+			else
+				{
+				if (iFailAllocCount < burst)
+					{// Keep failing for burst times
+					r = ETrue;
+					}
+				else
+					{// We've now failed burst times so start again.
+					iFailAllocCount = -(rate - 1);
+					}
+				}
+			break;
+#endif
+		case EDeterministic:
+			if (++iFailAllocCount%iFailRate==0)
+				{
+				r=ETrue;
+				iRand++;	// Keep count of how many times we have failed
+				}
+			break;
+
+		case EBurstDeterministic:
+			// This will fail burst number of times, every rate attempts.
+			if (++iFailAllocCount >= 0)
+				{
+				if (iFailAllocCount == burst - 1)
+					{// This is the burst time we have failed so make it the last by
+					// reseting counts so we next fail after rate attempts.
+					iFailAllocCount = -rate;
+					}
+				r = ETrue;
+				iRand++;	// Keep count of how many times we have failed
+				}
+			break;
+
+		case EFailNext:
+			if ((++iFailAllocCount%iFailRate)==0)
+				{
+				iFailType=ENone;
+				r=ETrue;
+				iRand++;	// Keep count of how many times we have failed
+				}
+			break;
+
+		case EBurstFailNext:
+			if (++iFailAllocCount >= 0)
+				{
+				if (iFailAllocCount == burst - 1)
+					{// This is the burst time we have failed so make it the last.
+					iFailType = ENone;
+					}
+				r = ETrue;
+				iRand++;	// Keep count of how many times we have failed
+				}
+			break;
+		default:
+			break;
+		}
+	return r;
+	}
+#endif	// ifdef _DEBUG
+
+UEXPORT_C TInt RHeap::Extension_(TUint aExtensionId, TAny*& a0, TAny* a1)
+	{
+	return RAllocator::Extension_(aExtensionId, a0, a1);
+	}
+
+#if defined(__HEAP_MACHINE_CODED__) && !defined(_DEBUG)
+GLDEF_C void RHeap_PanicBadAllocatedCellSize()
+	{
+	HEAP_PANIC(ETHeapBadAllocatedCellSize);
+	}
+
+GLDEF_C void RHeap_PanicBadNextCell()
+	{
+	HEAP_PANIC(ETHeapFreeBadNextCell);
+	}
+
+GLDEF_C void RHeap_PanicBadPrevCell()
+	{
+	HEAP_PANIC(ETHeapFreeBadPrevCell);
+	}
+
+GLDEF_C void RHeap_PanicBadCellAddress()
+	{
+	HEAP_PANIC(ETHeapBadCellAddress);
+	}
+#endif
+
+
+
+
+
--- a/kernel/eka/common/heap_hybrid.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3319 +0,0 @@
-// Copyright (c) 1994-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:
-// kernel\eka\common\heap_hybrid.cpp
-// 
-// Uses malloc (aka dlmalloc) written by Doug Lea version 2.8.4
-//
-
-#include "common.h"
-#ifdef __KERNEL_MODE__
-#include <kernel/kern_priv.h>
-#endif
-#include "dla.h"
-#ifndef __KERNEL_MODE__
-#include "slab.h"
-#include "page_alloc.h"
-#endif
-#include "heap_hybrid.h"
-
-// enables btrace code compiling into 
-#define ENABLE_BTRACE
-
-// if non zero this causes the iSlabs to be configured only when the chunk size exceeds this level
-#define DELAYED_SLAB_THRESHOLD (64*1024)		// 64KB seems about right based on trace data
-#define SLAB_CONFIG 0xabe						// Use slabs of size 48, 40, 32, 24, 20, 16, 12, and 8 bytes
-
-#ifdef _DEBUG
-#define __SIMULATE_ALLOC_FAIL(s)	if (CheckForSimulatedAllocFail()) {s}
-#define __ALLOC_DEBUG_HEADER(s)  	(s += EDebugHdrSize)
-#define __SET_DEBUG_DATA(p,n,c)   	(((SDebugCell*)(p))->nestingLevel = (n), ((SDebugCell*)(p))->allocCount = (c))
-#define __GET_USER_DATA_BFR(p)   	((p!=0) ? (TUint8*)(p) + EDebugHdrSize : NULL)
-#define __GET_DEBUG_DATA_BFR(p)   	((p!=0) ? (TUint8*)(p) - EDebugHdrSize : NULL)
-#define	__ZAP_CELL(p)				memset( (TUint8*)p, 0xde, (AllocLen(__GET_USER_DATA_BFR(p))+EDebugHdrSize))
-#define __DEBUG_SAVE(p)				TInt dbgNestLevel = ((SDebugCell*)p)->nestingLevel
-#define __DEBUG_RESTORE(p)			if (p) {((SDebugCell*)p)->nestingLevel = dbgNestLevel;}
-#define __DEBUG_HDR_SIZE			EDebugHdrSize
-#define __REMOVE_DBG_HDR(n) 		(n*EDebugHdrSize)
-#define __GET_AVAIL_BLOCK_SIZE(s)   ( (s<EDebugHdrSize) ? 0 : s-EDebugHdrSize )
-#define __UPDATE_ALLOC_COUNT(o,n,c)	if (o!=n && n) {((SDebugCell*)n)->allocCount = (c);}
-#define __INIT_COUNTERS(i)	        iCellCount=i,iTotalAllocSize=i
-#define __INCREMENT_COUNTERS(p)	    iCellCount++, iTotalAllocSize += AllocLen(p)
-#define __DECREMENT_COUNTERS(p)	    iCellCount--, iTotalAllocSize -= AllocLen(p)
-#define __UPDATE_TOTAL_ALLOC(p,s)	iTotalAllocSize += (AllocLen(__GET_USER_DATA_BFR(p)) - s)
-
-#else
-#define __SIMULATE_ALLOC_FAIL(s)
-#define __ALLOC_DEBUG_HEADER(s)
-#define __SET_DEBUG_DATA(p,n,c)
-#define __GET_USER_DATA_BFR(p)  (p)
-#define __GET_DEBUG_DATA_BFR(p) (p)
-#define	__ZAP_CELL(p)
-#define __DEBUG_SAVE(p)			
-#define __DEBUG_RESTORE(p)
-#define __DEBUG_HDR_SIZE		0
-#define __REMOVE_DBG_HDR(n) 	0
-#define __GET_AVAIL_BLOCK_SIZE(s)   (s)
-#define __UPDATE_ALLOC_COUNT(o,n,c)	
-#define __INIT_COUNTERS(i)	        iCellCount=i,iTotalAllocSize=i
-#define __INCREMENT_COUNTERS(p)
-#define __DECREMENT_COUNTERS(p)
-#define __UPDATE_TOTAL_ALLOC(p,s)
-
-#endif
-
-
-#define MEMORY_MONITORED  (iFlags & EMonitorMemory)
-#define GM  (&iGlobalMallocState)
-#define IS_FIXED_HEAP  (iFlags & EFixedSize)
-#define __INIT_COUNTERS(i)	iCellCount=i,iTotalAllocSize=i
-#define __POWER_OF_2(x)		(!((x)&((x)-1)))
-
-#define __DL_BFR_CHECK(M,P) \
-		  if ( MEMORY_MONITORED ) \
-             if ( !IS_ALIGNED(P) || ((TUint8*)(P)<M->iSeg.iBase) || ((TUint8*)(P)>(M->iSeg.iBase+M->iSeg.iSize))) \
-                  BTraceContext12(BTrace::EHeap, BTrace::EHeapCorruption, (TUint32)this, (TUint32)P, (TUint32)0), HEAP_PANIC(ETHeapBadCellAddress); \
-			 else DoCheckInuseChunk(M, MEM2CHUNK(P)) 
-
-#ifndef __KERNEL_MODE__
-
-#define __SLAB_BFR_CHECK(S,P,B) \
-	  if ( MEMORY_MONITORED ) \
-		  if ( ((TUint32)P & 0x3) || ((TUint8*)P<iMemBase) || ((TUint8*)(P)>(TUint8*)this))  \
-			   BTraceContext12(BTrace::EHeap, BTrace::EHeapCorruption, (TUint32)this, (TUint32)P, (TUint32)S), HEAP_PANIC(ETHeapBadCellAddress); \
-		  else DoCheckSlab(S, EPartialFullSlab, P), BuildPartialSlabBitmap(B,S,P) 					  
-#define __PAGE_BFR_CHECK(P) \
-		if ( MEMORY_MONITORED ) \
-			if ( ((TUint32)P &  ((1 << iPageSize)-1)) || ((TUint8*)P<iMemBase) || ((TUint8*)(P)>(TUint8*)this))  \
-				BTraceContext12(BTrace::EHeap, BTrace::EHeapCorruption, (TUint32)this, (TUint32)P, (TUint32)0), HEAP_PANIC(ETHeapBadCellAddress)
-
-#endif
-
-#ifdef _MSC_VER
-// This is required while we are still using VC6 to compile, so as to avoid warnings that cannot be fixed
-// without having to edit the original Doug Lea source.  The 4146 warnings are due to the original code having
-// a liking for negating unsigned numbers and the 4127 warnings are due to the original code using the RTCHECK
-// macro with values that are always defined as 1.  It is better to turn these warnings off than to introduce
-// diffs between the original Doug Lea implementation and our adaptation of it
-#pragma warning( disable : 4146 ) /* unary minus operator applied to unsigned type, result still unsigned */
-#pragma warning( disable : 4127 ) /* conditional expression is constant */
-#endif // _MSC_VER
-
-
-/**
-@SYMPatchable
-@publishedPartner
-@released
-
-Defines the minimum cell size of  a heap.
-
-The constant can be changed at ROM build time using patchdata OBY keyword.
-
-@deprecated Patching this constant no longer has any effect.
-*/
-#ifdef __X86GCC__	// For X86GCC we dont use the proper data import attribute
-#undef IMPORT_D		// since the constants are not really imported. GCC doesn't 
-#define IMPORT_D	// allow imports from self.
-#endif
-IMPORT_D extern const TInt KHeapMinCellSize;
-
-/**
-@SYMPatchable
-@publishedPartner
-@released
-
-This constant defines the ratio that determines the amount of hysteresis between heap growing and heap
-shrinking.
-It is a 32-bit fixed point number where the radix point is defined to be
-between bits 7 and 8 (where the LSB is bit 0) i.e. using standard notation, a Q8 or a fx24.8
-fixed point number.  For example, for a ratio of 2.0, set KHeapShrinkHysRatio=0x200.
-
-The heap shrinking hysteresis value is calculated to be:
-@code
-KHeapShrinkHysRatio*(iGrowBy>>8)
-@endcode
-where iGrowBy is a page aligned value set by the argument, aGrowBy, to the RHeap constructor.
-The default hysteresis value is iGrowBy bytes i.e. KHeapShrinkHysRatio=2.0.
-
-Memory usage may be improved by reducing the heap shrinking hysteresis
-by setting 1.0 < KHeapShrinkHysRatio < 2.0.  Heap shrinking hysteresis is disabled/removed
-when KHeapShrinkHysRatio <= 1.0.
-
-The constant can be changed at ROM build time using patchdata OBY keyword.
-*/
-IMPORT_D extern const TInt KHeapShrinkHysRatio;
-
-UEXPORT_C TInt RHeap::AllocLen(const TAny* aCell) const
-{
-	const MAllocator* m = this;
-	return m->AllocLen(aCell);
-}
-
-UEXPORT_C TAny* RHeap::Alloc(TInt aSize)
-{
-	const MAllocator* m = this;
-	return ((MAllocator*)m)->Alloc(aSize);
-}
-
-UEXPORT_C void RHeap::Free(TAny* aCell)
-{
-	const MAllocator* m = this;
-	((MAllocator*)m)->Free(aCell);
-}
-
-UEXPORT_C TAny* RHeap::ReAlloc(TAny* aCell, TInt aSize, TInt aMode)
-{
-	const MAllocator* m = this;
-	return ((MAllocator*)m)->ReAlloc(aCell, aSize, aMode);
-}
-
-UEXPORT_C TInt RHeap::DebugFunction(TInt aFunc, TAny* a1, TAny* a2)
-{
-	const MAllocator* m = this;
-	return ((MAllocator*)m)->DebugFunction(aFunc, a1, a2);
-}
-
-UEXPORT_C TInt RHeap::Extension_(TUint aExtensionId, TAny*& a0, TAny* a1)
-{
-	const MAllocator* m = this;
-	return ((MAllocator*)m)->Extension_(aExtensionId, a0, a1);
-}
-
-#ifndef __KERNEL_MODE__
-
-EXPORT_C TInt RHeap::AllocSize(TInt& aTotalAllocSize) const
-{
-	const MAllocator* m = this;
-	return m->AllocSize(aTotalAllocSize);
-}
-
-EXPORT_C TInt RHeap::Available(TInt& aBiggestBlock) const
-{
-	const MAllocator* m = this;
-	return m->Available(aBiggestBlock);
-}
-
-EXPORT_C void RHeap::Reset()
-{
-	const MAllocator* m = this;
-	((MAllocator*)m)->Reset();
-}
-
-EXPORT_C TInt RHeap::Compress()
-{
-	const MAllocator* m = this;
-	return ((MAllocator*)m)->Compress();
-}
-#endif
-
-RHybridHeap::RHybridHeap()
-	{
-	// This initialisation cannot be done in RHeap() for compatibility reasons
-	iMaxLength = iChunkHandle = iNestingLevel = 0;
-	iTop = NULL;
-	iFailType = ENone;
-	iTestData = NULL;
-	}
-
-void RHybridHeap::operator delete(TAny*, TAny*) 
-/**
-Called if constructor issued by operator new(TUint aSize, TAny* aBase) throws exception.
-This is dummy as corresponding new operator does not allocate memory.
-*/
-{}
-
-
-#ifndef __KERNEL_MODE__
-void RHybridHeap::Lock() const
-   /**
-   @internalComponent
-*/
-   {((RFastLock&)iLock).Wait();}
-
-
-void RHybridHeap::Unlock() const
-   /**
-   @internalComponent
-*/
-   {((RFastLock&)iLock).Signal();}
-
-
-TInt RHybridHeap::ChunkHandle() const
-   /**
-   @internalComponent
-*/
-{
-	return iChunkHandle;
-}
-
-#else
-//
-//  This method is implemented in kheap.cpp
-//
-//void RHybridHeap::Lock() const
-   /**
-   @internalComponent
-*/
-//   {;}
-
-
-
-//
-//  This method is implemented in kheap.cpp
-//
-//void RHybridHeap::Unlock() const
-   /**
-   @internalComponent
-*/
-//   {;}
-
-
-TInt RHybridHeap::ChunkHandle() const
-   /**
-   @internalComponent
-*/
-{
-	return 0;
-}
-#endif
-
-RHybridHeap::RHybridHeap(TInt aChunkHandle, TInt aOffset, TInt aMinLength, TInt aMaxLength, TInt aGrowBy, TInt aAlign, TBool aSingleThread, TBool aDLOnly, TBool aUseAdjust)
-/**
-Constructor for a non fixed heap.  Unlike the fixed heap, this heap is quite flexible in terms of its minimum and
-maximum lengths and in that it can use the hybrid allocator if all of its requirements are met.
-*/
-	: iOffset(aOffset), iChunkSize(aMinLength)
-	{
-	__ASSERT_ALWAYS(iOffset>=0, HEAP_PANIC(ETHeapNewBadOffset));	
-
-	iChunkHandle = aChunkHandle;
-	iMinLength = aMinLength;
-	iMaxLength = aMaxLength;
-
-	// If the user has explicitly specified 0 as the aGrowBy value, set it to 1 so that it will be rounded up to the nearst page size
-	if (aGrowBy == 0)
-		aGrowBy = 1;
-	GET_PAGE_SIZE(iPageSize);
-	iGrowBy = _ALIGN_UP(aGrowBy, iPageSize);
-
-	Construct(aSingleThread, aDLOnly, aUseAdjust, aAlign);
-	}
-
-RHybridHeap::RHybridHeap(TInt aMaxLength, TInt aAlign, TBool aSingleThread)
-/**
-Constructor for a fixed heap.  We have restrictions in that we have fixed minimum and maximum lengths and cannot grow
-and we only use DL allocator.
-*/
-	: iOffset(0), iChunkSize(aMaxLength)
-	{
-	iChunkHandle = NULL;
-	iMinLength = aMaxLength;
-	iMaxLength = aMaxLength;
-	iGrowBy = 0;
-
-	Construct(aSingleThread, ETrue, ETrue, aAlign);
-	}
-
-TAny* RHybridHeap::operator new(TUint aSize, TAny* aBase) __NO_THROW
-{
-	__ASSERT_ALWAYS(aSize>=sizeof(RHybridHeap), HEAP_PANIC(ETHeapNewBadSize));
-	RHybridHeap* h = (RHybridHeap*)aBase;
-	h->iBase = ((TUint8*)aBase) + aSize;
-	return aBase;
-}
-
-void RHybridHeap::Construct(TBool aSingleThread, TBool aDLOnly, TBool aUseAdjust, TInt aAlign)
-{
-	iAlign = aAlign ? aAlign : RHybridHeap::ECellAlignment;
-	__ASSERT_ALWAYS((TUint32)iAlign>=sizeof(TAny*) && __POWER_OF_2(iAlign), HEAP_PANIC(ETHeapNewBadAlignment));
-
-	// This initialisation cannot be done in RHeap() for compatibility reasons
-	iTop = NULL;
-	iFailType = ENone;
-	iNestingLevel = 0;
-	iTestData = NULL;
-
-	iHighWaterMark = iMinLength;
-	iAllocCount = 0;
-	iFlags = aSingleThread ? ESingleThreaded : 0;
-	iGrowBy = _ALIGN_UP(iGrowBy, iPageSize);
-	
-	if ( iMinLength == iMaxLength )
-		{
-		iFlags |= EFixedSize;
-		aDLOnly = ETrue;
-		}
-#ifndef __KERNEL_MODE__
-#ifdef DELAYED_SLAB_THRESHOLD
-	iSlabInitThreshold = DELAYED_SLAB_THRESHOLD;
-#else
-	iSlabInitThreshold = 0;
-#endif // DELAYED_SLAB_THRESHOLD
-	iUseAdjust = aUseAdjust;
-	iDLOnly    = aDLOnly;
-#else
-	(void)aUseAdjust;	
-#endif 
-	// Initialise suballocators
-	// if DL only is required then it cannot allocate slab or page memory
-	// so these sub-allocators should be disabled. Otherwise initialise with default values
-	if ( aDLOnly )
-		{
-		Init(0, 0);
-		}
-	else
-		{
-		Init(SLAB_CONFIG, 16);
-		}
-	
-#ifdef ENABLE_BTRACE
-	
-	TUint32 traceData[4];
-	traceData[0] = iMinLength;
-	traceData[1] = iMaxLength;
-	traceData[2] = iGrowBy;
-	traceData[3] = iAlign;
-	BTraceContextN(BTrace::ETest1, 90, (TUint32)this, 11, traceData, sizeof(traceData));
-#endif
-	
-}
-
-#ifndef __KERNEL_MODE__
-TInt RHybridHeap::ConstructLock(TUint32 aMode)
-{
-	TBool duplicateLock = EFalse;
-	TInt r = KErrNone;
-	if (!(iFlags & ESingleThreaded))
-		{
-		duplicateLock = aMode & UserHeap::EChunkHeapSwitchTo;
-		r = iLock.CreateLocal(duplicateLock ? EOwnerThread : EOwnerProcess);
-		if( r != KErrNone)
-			{
-			iChunkHandle = 0;
-			return r;
-			}
-		}
-	
-	if ( aMode & UserHeap::EChunkHeapSwitchTo )
-		User::SwitchHeap(this);
-	
-	iHandles = &iChunkHandle;
-	if (!(iFlags & ESingleThreaded))
-		{
-		// now change the thread-relative chunk/semaphore handles into process-relative handles
-		iHandleCount = 2;
-		if(duplicateLock)
-			{
-			RHandleBase s = iLock;
-			r = iLock.Duplicate(RThread());
-			s.Close();
-			}
-		if (r==KErrNone && (aMode & UserHeap::EChunkHeapDuplicate))
-			{
-			r = ((RChunk*)&iChunkHandle)->Duplicate(RThread());
-			if (r!=KErrNone)
-				iLock.Close(), iChunkHandle=0;
-			}
-		}
-	else
-		{
-		iHandleCount = 1;
-		if (aMode & UserHeap::EChunkHeapDuplicate)
-			r = ((RChunk*)&iChunkHandle)->Duplicate(RThread(), EOwnerThread);
-		}
-	
-	return r;
-}
-#endif
-
-void RHybridHeap::Init(TInt aBitmapSlab, TInt aPagePower)
-{
-	/*Moved code which does initilization */
-	iTop  = (TUint8*)this + iMinLength;
-	iBase = Ceiling(iBase, ECellAlignment);	// Align iBase address 
-	
-    __INIT_COUNTERS(0);
-	//	memset(&mparams,0,sizeof(mparams));
-	
-	InitDlMalloc(iTop - iBase, 0);
-	
-#ifndef __KERNEL_MODE__	
-	SlabInit();
-	iSlabConfigBits = aBitmapSlab;
-	if ( iChunkSize > iSlabInitThreshold )
-		{
-		iSlabInitThreshold = KMaxTInt32;
-		SlabConfig(aBitmapSlab);   // Delayed slab configuration done
-		}
-	if ( aPagePower )
-		{
-		RChunk chunk;
-		chunk.SetHandle(iChunkHandle);
-		iMemBase = chunk.Base();    // Store base address for paged allocator
-		}
-
-	/*10-1K,11-2K,12-4k,13-8K,14-16K,15-32K,16-64K*/
-	PagedInit(aPagePower);
-
-#ifdef ENABLE_BTRACE
-	TUint32 traceData[3];
-	traceData[0] = aBitmapSlab;
-	traceData[1] = aPagePower;
-	traceData[2] = GM->iTrimCheck;
-	BTraceContextN(BTrace::ETest1, 90, (TUint32)this, 0, traceData, sizeof(traceData));
-#endif
-#else
-	(void)aBitmapSlab;
-	(void)aPagePower;
-#endif	// __KERNEL_MODE__
-	
-}
-
-
-TInt RHybridHeap::AllocLen(const TAny* aCell) const
-{
-	aCell = __GET_DEBUG_DATA_BFR(aCell);
-	
-	if (PtrDiff(aCell, this) >= 0)
-		{
-		mchunkptr m = MEM2CHUNK(aCell);
-		return CHUNKSIZE(m) - OVERHEAD_FOR(m) - __DEBUG_HDR_SIZE;
-		}
-#ifndef __KERNEL_MODE__		
-	if ( aCell )
-		{
-		if (LowBits(aCell, iPageSize) )
-			return SlabHeaderSize(slab::SlabFor(aCell)->iHeader) - __DEBUG_HDR_SIZE;
-		
-		return PagedSize((void*)aCell) - __DEBUG_HDR_SIZE;
-		}
-#endif	
-	return 0; // NULL pointer situation, should PANIC !!
-}
-
-#ifdef __KERNEL_MODE__
-TAny* RHybridHeap::Alloc(TInt aSize)
-{
-	__CHECK_THREAD_STATE;
-	__ASSERT_ALWAYS((TUint)aSize<(KMaxTInt/2),HEAP_PANIC(ETHeapBadAllocatedCellSize));
-	__SIMULATE_ALLOC_FAIL(return NULL;)
-	Lock();
-	__ALLOC_DEBUG_HEADER(aSize);
-	TAny* addr = DlMalloc(aSize);
-	if ( addr )
-		{
-//		iCellCount++;
-		__SET_DEBUG_DATA(addr, iNestingLevel, ++iAllocCount);
-		addr = __GET_USER_DATA_BFR(addr);
-		__INCREMENT_COUNTERS(addr);
-		memclr(addr, AllocLen(addr));
-		}
-	Unlock();
-#ifdef ENABLE_BTRACE
-	if (iFlags & ETraceAllocs)
-		{
-		if ( addr )
-			{
-			TUint32 traceData[3];
-			traceData[0] = AllocLen(addr);
-			traceData[1] = aSize - __DEBUG_HDR_SIZE;
-			traceData[2] = 0;
-			BTraceContextN(BTrace::EHeap, BTrace::EHeapAlloc, (TUint32)this, (TUint32)addr, traceData, sizeof(traceData));
-			}
-		else
-			BTraceContext8(BTrace::EHeap, BTrace::EHeapAllocFail, (TUint32)this, (TUint32)(aSize - __DEBUG_HDR_SIZE));			
-		}
-#endif
-	return addr;
-}
-#else
-
-TAny* RHybridHeap::Alloc(TInt aSize)
-{
-	__ASSERT_ALWAYS((TUint)aSize<(KMaxTInt/2),HEAP_PANIC(ETHeapBadAllocatedCellSize));
-	__SIMULATE_ALLOC_FAIL(return NULL;)
-			
-	TAny* addr;
-#ifdef ENABLE_BTRACE
-	TInt aSubAllocator=0;
-#endif
-	
-	Lock();
-	
-	__ALLOC_DEBUG_HEADER(aSize);
-	
-	if (aSize < iSlabThreshold)
-		{
-		TInt ix = iSizeMap[(aSize+3)>>2];
-		HEAP_ASSERT(ix != 0xff);
-		addr = SlabAllocate(iSlabAlloc[ix]);
-		if ( !addr )
-			{ // Slab allocation has failed, try to allocate from DL
-			addr = DlMalloc(aSize);
-			}
-#ifdef ENABLE_BTRACE
-		else
-			aSubAllocator=1;
-#endif
-		}else if((aSize >> iPageThreshold)==0)
-			{
-			addr = DlMalloc(aSize);
-			}
-		else
-			{
-			addr = PagedAllocate(aSize);
-			if ( !addr )
-				{ // Page allocation has failed, try to allocate from DL
-				addr = DlMalloc(aSize);
-				}
-#ifdef ENABLE_BTRACE
-			else
-	      		aSubAllocator=2;
-#endif
-			}
-	
-	if ( addr )
-		{
-//		iCellCount++;
-		__SET_DEBUG_DATA(addr, iNestingLevel, ++iAllocCount);
-		addr = __GET_USER_DATA_BFR(addr);
-		__INCREMENT_COUNTERS(addr);
-		}
-	Unlock();
-	
-#ifdef ENABLE_BTRACE
-	if (iFlags & ETraceAllocs)
-		{
-		if ( addr )
-			{
-		    TUint32 traceData[3];
-		    traceData[0] = AllocLen(addr);
-		    traceData[1] = aSize - __DEBUG_HDR_SIZE;
-			traceData[2] = aSubAllocator;
-		    BTraceContextN(BTrace::EHeap, BTrace::EHeapAlloc, (TUint32)this, (TUint32)addr, traceData, sizeof(traceData));
-			}
-		else
-			BTraceContext8(BTrace::EHeap, BTrace::EHeapAllocFail, (TUint32)this, (TUint32)(aSize - __DEBUG_HDR_SIZE));			
-		}
-#endif
-	
-	return addr;
-}
-#endif // __KERNEL_MODE__
-
-#ifndef __KERNEL_MODE__
-TInt RHybridHeap::Compress()
-{
-	if ( IS_FIXED_HEAP )
-		return 0;
-	
-	Lock();
-	TInt Reduced = SysTrim(GM, 0);
-	if (iSparePage)
-		{
-		Unmap(iSparePage, iPageSize);
-		iSparePage = 0;
-		Reduced += iPageSize;
-		}
-	Unlock();
-	return Reduced;
-}
-#endif
-
-void RHybridHeap::Free(TAny* aPtr)
-{
-	__CHECK_THREAD_STATE;
-	if ( !aPtr )
-		return;
-#ifdef ENABLE_BTRACE
-	TInt aSubAllocator=0;
-#endif
-	Lock();
-	
-	aPtr = __GET_DEBUG_DATA_BFR(aPtr);
-
-#ifndef __KERNEL_MODE__				
-	if (PtrDiff(aPtr, this) >= 0)
-		{
-#endif
-		__DL_BFR_CHECK(GM, aPtr);
-		__DECREMENT_COUNTERS(__GET_USER_DATA_BFR(aPtr));
-		__ZAP_CELL(aPtr);		
-		DlFree( aPtr);
-#ifndef __KERNEL_MODE__			
-		}
-
-	else if ( LowBits(aPtr, iPageSize) == 0 )
-		{
-#ifdef ENABLE_BTRACE
-		aSubAllocator = 2;
-#endif
-		__PAGE_BFR_CHECK(aPtr);	
-		__DECREMENT_COUNTERS(__GET_USER_DATA_BFR(aPtr));
-		PagedFree(aPtr);
-		}
-	else
-		{
-#ifdef ENABLE_BTRACE
-		aSubAllocator = 1;
-#endif
-		TUint32 bm[4];   		
-		__SLAB_BFR_CHECK(slab::SlabFor(aPtr),aPtr,bm);
-		__DECREMENT_COUNTERS(__GET_USER_DATA_BFR(aPtr));  
-		__ZAP_CELL(aPtr);		
-		SlabFree(aPtr);
-		}
-#endif  // __KERNEL_MODE__	
-//	iCellCount--;
-	Unlock();
-#ifdef ENABLE_BTRACE
-	if (iFlags & ETraceAllocs)
-		{
-		TUint32 traceData;
-		traceData = aSubAllocator;
-		BTraceContextN(BTrace::EHeap, BTrace::EHeapFree, (TUint32)this, (TUint32)__GET_USER_DATA_BFR(aPtr), &traceData, sizeof(traceData));
-		}
-#endif
-}
-
-#ifndef __KERNEL_MODE__
-void RHybridHeap::Reset()
-/**
-Frees all allocated cells on this heap.
-*/
-{
-	Lock();
-	if ( !IS_FIXED_HEAP )
-		{
-		if ( GM->iSeg.iSize > (iMinLength - sizeof(*this)) )
-			Unmap(GM->iSeg.iBase + (iMinLength - sizeof(*this)), (GM->iSeg.iSize - (iMinLength - sizeof(*this))));
-		ResetBitmap();
-		if ( !iDLOnly )
-			Init(iSlabConfigBits, iPageThreshold);
-		else
-			Init(0,0);		
-		}
-	else Init(0,0);
-	Unlock();	
-}
-#endif
-
-TAny* RHybridHeap::ReAllocImpl(TAny* aPtr, TInt aSize, TInt aMode)
-{
-	// First handle special case of calling reallocate with NULL aPtr
-	if (!aPtr)
-		{
-		if (( aMode & ENeverMove ) == 0 )
-			{
-			aPtr = Alloc(aSize - __DEBUG_HDR_SIZE);
-			aPtr = __GET_DEBUG_DATA_BFR(aPtr);
-			}
-		return aPtr;
-		}
-	
-	TInt oldsize = AllocLen(__GET_USER_DATA_BFR(aPtr)) + __DEBUG_HDR_SIZE;
-	
-	// Insist on geometric growth when reallocating memory, this reduces copying and fragmentation
-	// generated during arithmetic growth of buffer/array/vector memory
-	// Experiments have shown that 25% is a good threshold for this policy
-	if (aSize <= oldsize)
-		{
-		if (aSize >= oldsize - (oldsize>>2))
-			return aPtr;		// don't change if >75% original size
-		}
-	else
-		{
-		__SIMULATE_ALLOC_FAIL(return NULL;)
-		if (aSize < oldsize + (oldsize>>2))
-			{
-			aSize = _ALIGN_UP(oldsize + (oldsize>>2), 4);	// grow to at least 125% original size
-			}
-		}
-	__DEBUG_SAVE(aPtr);		
-	
-	TAny* newp;
-#ifdef __KERNEL_MODE__
-	Lock();
-	__DL_BFR_CHECK(GM, aPtr);				
-	newp = DlRealloc(aPtr, aSize, aMode);
-	Unlock();
-	if ( newp )
-		{
-	    if ( aSize > oldsize )
-			memclr(((TUint8*)newp) + oldsize, (aSize-oldsize)); // Buffer has grown in place, clear extra
-		__DEBUG_RESTORE(newp);
-		__UPDATE_ALLOC_COUNT(aPtr, newp, ++iAllocCount);
-		__UPDATE_TOTAL_ALLOC(newp, oldsize);
-		}
-#else
-	// Decide how to reallocate based on (a) the current cell location, (b) the mode requested and (c) the new size
-	if ( PtrDiff(aPtr, this) >= 0 )
-		{	// current cell in Doug Lea iArena
-		if ( (aMode & ENeverMove) 
-			 ||
-			 (!(aMode & EAllowMoveOnShrink) && (aSize < oldsize))
-			 ||
-			 ((aSize >= iSlabThreshold) && ((aSize >> iPageThreshold) == 0)) )
-			{
-			Lock();
-			__DL_BFR_CHECK(GM, aPtr);			
-			newp = DlRealloc(aPtr, aSize, aMode);			// old and new in DL allocator
-			Unlock();
-			__DEBUG_RESTORE(newp);
-			__UPDATE_ALLOC_COUNT(aPtr,newp, ++iAllocCount);
-			__UPDATE_TOTAL_ALLOC(newp, oldsize);
-			return newp;
-			}
-		}
-	else if (LowBits(aPtr, iPageSize) == 0)
-		{	// current cell in paged iArena
-		if ( (aMode & ENeverMove)     
-			 ||
-			 (!(aMode & EAllowMoveOnShrink) && (aSize < oldsize)) 
-			 ||
-			 ((aSize >> iPageThreshold) != 0) )
-			{
-			Lock();
-			__PAGE_BFR_CHECK(aPtr);			
-			newp = PagedReallocate(aPtr, aSize, aMode);		// old and new in paged allocator
-			Unlock();
-			__DEBUG_RESTORE(newp);
-			__UPDATE_ALLOC_COUNT(aPtr,newp, ++iAllocCount);
-			__UPDATE_TOTAL_ALLOC(newp, oldsize);
-			return newp;
-			}
-		}
-	else
-		{	// current cell in slab iArena
-		TUint32 bm[4];
-		Lock();
-		__SLAB_BFR_CHECK(slab::SlabFor(aPtr), aPtr, bm);
-		Unlock();
-		if ( aSize <= oldsize)
-			return aPtr;
-		if (aMode & ENeverMove)
-			return NULL;		// cannot grow in slab iArena
-		// just use alloc/copy/free...
-		}
-	
-	// fallback to allocate and copy
-	// shouldn't get here if we cannot move the cell
-	//  	__ASSERT(mode == emobile || (mode==efixshrink && size>oldsize));
-	
-	newp = Alloc(aSize - __DEBUG_HDR_SIZE);
-	newp = __GET_DEBUG_DATA_BFR(newp);
-	if (newp)
-		{
-		memcpy(newp, aPtr, oldsize<aSize ? oldsize : aSize);
-		__DEBUG_RESTORE(newp);
-		Free(__GET_USER_DATA_BFR(aPtr));
-		}
-	
-#endif	// __KERNEL_MODE__
-	return newp;
-}
-
-
-TAny* RHybridHeap::ReAlloc(TAny* aPtr, TInt aSize, TInt aMode )
-{
-	
-	aPtr = __GET_DEBUG_DATA_BFR(aPtr);
-	__ALLOC_DEBUG_HEADER(aSize);
-	
-	TAny* retval = ReAllocImpl(aPtr, aSize, aMode);
-	
-	retval = __GET_USER_DATA_BFR(retval);
-	
-#ifdef ENABLE_BTRACE
-	if (iFlags & ETraceAllocs)
-		{
-		if ( retval )
-			{
-			TUint32 traceData[3];
-			traceData[0] = AllocLen(retval);
-			traceData[1] = aSize - __DEBUG_HDR_SIZE;
-			traceData[2] = (TUint32)aPtr;
-			BTraceContextN(BTrace::EHeap, BTrace::EHeapReAlloc,(TUint32)this, (TUint32)retval, traceData, sizeof(traceData));
-			}
-  		else
-  		    BTraceContext12(BTrace::EHeap, BTrace::EHeapReAllocFail, (TUint32)this, (TUint32)aPtr, (TUint32)(aSize - __DEBUG_HDR_SIZE));
-		}
-#endif
-	return retval;
-}
-
-#ifndef __KERNEL_MODE__
-TInt RHybridHeap::Available(TInt& aBiggestBlock) const
-/**
-Gets the total free space currently available on the heap and the space
-available in the largest free block.
-
-Note that this function exists mainly for compatibility reasons.  In a modern
-heap implementation such as that present in Symbian it is not appropriate to
-concern oneself with details such as the amount of free memory available on a
-heap and its largeset free block, because the way that a modern heap implmentation
-works is not simple.  The amount of available virtual memory != physical memory
-and there are multiple allocation strategies used internally, which makes all
-memory usage figures "fuzzy" at best.
-
-In short, if you want to see if there is enough memory available to allocate a
-block of memory, call Alloc() and if it succeeds then there is enough memory!
-Messing around with functions like this is somewhat pointless with modern heap
-allocators.
-
-@param aBiggestBlock On return, contains the space available in the largest
-                     free block on the heap.  Due to the internals of modern
-                     heap implementations, you can probably still allocate a
-                     block larger than this!
-
-@return The total free space currently available on the heap.  Again, you can
-        probably still allocate more than this!
-*/
-{
-	struct HeapInfo info;
-	Lock();
-	TInt Biggest  = GetInfo(&info);
-	aBiggestBlock = __GET_AVAIL_BLOCK_SIZE(Biggest);
-	Unlock();
-	return __GET_AVAIL_BLOCK_SIZE(info.iFreeBytes);
-	
-}
-
-TInt RHybridHeap::AllocSize(TInt& aTotalAllocSize) const
-   /**
-   Gets the number of cells allocated on this heap, and the total space 
-   allocated to them.
-   
-   @param aTotalAllocSize On return, contains the total space allocated
-   to the cells.
-   
-   @return The number of cells allocated on this heap.
-*/   
-{
-	struct HeapInfo info;
-	Lock();
-	GetInfo(&info);
-	aTotalAllocSize = info.iAllocBytes - __REMOVE_DBG_HDR(info.iAllocN);
-	Unlock();
-	return info.iAllocN;
-}
-
-#endif
-
-TInt RHybridHeap::Extension_(TUint /* aExtensionId */, TAny*& /* a0 */, TAny* /* a1 */)
-{
-	return KErrNotSupported;
-}
-
-
-
-///////////////////////////////////////////////////////////////////////////////
-// imported from dla.cpp
-///////////////////////////////////////////////////////////////////////////////
-
-//#include <unistd.h>
-//#define DEBUG_REALLOC
-#ifdef DEBUG_REALLOC
-#include <e32debug.h>
-#endif
-
-inline void RHybridHeap::InitBins(mstate m)
-{
-	/* Establish circular links for iSmallBins */
-	bindex_t i;
-	for (i = 0; i < NSMALLBINS; ++i) {
-		sbinptr bin = SMALLBIN_AT(m,i);
-		bin->iFd = bin->iBk = bin;
-		}
-	}
-/* ---------------------------- malloc support --------------------------- */
-
-/* allocate a large request from the best fitting chunk in a treebin */
-void* RHybridHeap::TmallocLarge(mstate m, size_t nb) {
-	tchunkptr v = 0;
-	size_t rsize = -nb; /* Unsigned negation */
-	tchunkptr t;
-	bindex_t idx;
-	ComputeTreeIndex(nb, idx);
-	
-	if ((t = *TREEBIN_AT(m, idx)) != 0)
-		{
-		/* Traverse tree for this bin looking for node with size == nb */
-		size_t sizebits = nb << LEFTSHIFT_FOR_TREE_INDEX(idx);
-		tchunkptr rst = 0;  /* The deepest untaken right subtree */
-		for (;;)
-			{
-			tchunkptr rt;
-			size_t trem = CHUNKSIZE(t) - nb;
-			if (trem < rsize)
-				{
-				v = t;
-				if ((rsize = trem) == 0)
-					break;
-				}
-			rt = t->iChild[1];
-			t = t->iChild[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1];
-			if (rt != 0 && rt != t)
-				rst = rt;
-			if (t == 0)
-				{
-				t = rst; /* set t to least subtree holding sizes > nb */
-				break;
-				}
-			sizebits <<= 1;
-			}
-		}
-	if (t == 0 && v == 0)
-		{ /* set t to root of next non-empty treebin */
-		binmap_t leftbits = LEFT_BITS(IDX2BIT(idx)) & m->iTreeMap;
-		if (leftbits != 0)
-			{
-			bindex_t i;
-			binmap_t leastbit = LEAST_BIT(leftbits);
-			ComputeBit2idx(leastbit, i);
-			t = *TREEBIN_AT(m, i);
-			}
-		}
-	while (t != 0)
-		{ /* Find smallest of tree or subtree */
-		size_t trem = CHUNKSIZE(t) - nb;
-		if (trem < rsize) {
-			rsize = trem;
-			v = t;
-			}
-		t = LEFTMOST_CHILD(t);
-		}
-	/*  If iDv is a better fit, return 0 so malloc will use it */
-	if (v != 0 && rsize < (size_t)(m->iDvSize - nb))
-		{
-		if (RTCHECK(OK_ADDRESS(m, v)))
-			{ /* split */
-			mchunkptr r = CHUNK_PLUS_OFFSET(v, nb);
-			HEAP_ASSERT(CHUNKSIZE(v) == rsize + nb);
-			if (RTCHECK(OK_NEXT(v, r)))
-				{
-				UnlinkLargeChunk(m, v);
-				if (rsize < MIN_CHUNK_SIZE)
-					SET_INUSE_AND_PINUSE(m, v, (rsize + nb));
-				else
-					{
-					SET_SIZE_AND_PINUSE_OF_INUSE_CHUNK(m, v, nb);
-					SET_SIZE_AND_PINUSE_OF_FREE_CHUNK(r, rsize);
-					InsertChunk(m, r, rsize);
-					}
-				return CHUNK2MEM(v);
-				}
-			}
-		//    CORRUPTION_ERROR_ACTION(m);
-		}
-	return 0;
-	}
-
-/* allocate a small request from the best fitting chunk in a treebin */
-void* RHybridHeap::TmallocSmall(mstate m, size_t nb)
-{
-	tchunkptr t, v;
-	size_t rsize;
-	bindex_t i;
-	binmap_t leastbit = LEAST_BIT(m->iTreeMap);
-	ComputeBit2idx(leastbit, i);
-	
-	v = t = *TREEBIN_AT(m, i);
-	rsize = CHUNKSIZE(t) - nb;
-	
-	while ((t = LEFTMOST_CHILD(t)) != 0)
-		{
-		size_t trem = CHUNKSIZE(t) - nb;
-		if (trem < rsize)
-			{
-			rsize = trem;
-			v = t;
-			}
-		}
-	
-	if (RTCHECK(OK_ADDRESS(m, v)))
-		{
-		mchunkptr r = CHUNK_PLUS_OFFSET(v, nb);
-		HEAP_ASSERT(CHUNKSIZE(v) == rsize + nb);
-		if (RTCHECK(OK_NEXT(v, r)))
-			{
-			UnlinkLargeChunk(m, v);
-			if (rsize < MIN_CHUNK_SIZE)
-				SET_INUSE_AND_PINUSE(m, v, (rsize + nb));
-			else
-				{
-				SET_SIZE_AND_PINUSE_OF_INUSE_CHUNK(m, v, nb);
-				SET_SIZE_AND_PINUSE_OF_FREE_CHUNK(r, rsize);
-				ReplaceDv(m, r, rsize);
-				}
-			return CHUNK2MEM(v);
-			}
-		}
-	//  CORRUPTION_ERROR_ACTION(m);
-	//  return 0;
-	}
-
-inline void RHybridHeap::InitTop(mstate m, mchunkptr p, size_t psize)
-{
-	/* Ensure alignment */
-	size_t offset = ALIGN_OFFSET(CHUNK2MEM(p));
-	p = (mchunkptr)((TUint8*)p + offset);
-	psize -= offset;
-	m->iTop = p;
-	m->iTopSize = psize;
-	p->iHead = psize | PINUSE_BIT;
-	/* set size of fake trailing chunk holding overhead space only once */
-	mchunkptr chunkPlusOff = CHUNK_PLUS_OFFSET(p, psize);
-	chunkPlusOff->iHead = TOP_FOOT_SIZE;
-	m->iTrimCheck = KHeapShrinkHysRatio*(iGrowBy>>8);
-}
-
-
-/* Unlink the first chunk from a smallbin */
-inline void RHybridHeap::UnlinkFirstSmallChunk(mstate M,mchunkptr B,mchunkptr P,bindex_t& I)
-{
-	mchunkptr F = P->iFd;
-	HEAP_ASSERT(P != B);
-	HEAP_ASSERT(P != F);
-	HEAP_ASSERT(CHUNKSIZE(P) == SMALL_INDEX2SIZE(I));
-	if (B == F)
-		CLEAR_SMALLMAP(M, I);
-	else if (RTCHECK(OK_ADDRESS(M, F)))
-		{
-		B->iFd = F;
-		F->iBk = B;
-		}
-	else
-		{
-		CORRUPTION_ERROR_ACTION(M);
-		}
-}
-/* Link a free chunk into a smallbin  */
-inline void RHybridHeap::InsertSmallChunk(mstate M,mchunkptr P, size_t S)
-{
-	bindex_t I  = SMALL_INDEX(S);
-	mchunkptr B = SMALLBIN_AT(M, I);
-	mchunkptr F = B;
-	HEAP_ASSERT(S >= MIN_CHUNK_SIZE);
-	if (!SMALLMAP_IS_MARKED(M, I))
-		MARK_SMALLMAP(M, I);
-	else if (RTCHECK(OK_ADDRESS(M, B->iFd)))
-		F = B->iFd;
-	else
-		{
-		CORRUPTION_ERROR_ACTION(M);
-		}
-	B->iFd = P;
-	F->iBk = P;
-	P->iFd = F;
-	P->iBk = B;
-}
-
-
-inline void RHybridHeap::InsertChunk(mstate M,mchunkptr P,size_t S)
-{
-	if (IS_SMALL(S))
-		InsertSmallChunk(M, P, S);
-	else
-		{
-		tchunkptr TP = (tchunkptr)(P); InsertLargeChunk(M, TP, S);
-		}
-}
-
-inline void RHybridHeap::UnlinkLargeChunk(mstate M,tchunkptr X)
-{
-	tchunkptr XP = X->iParent;
-	tchunkptr R;
-	if (X->iBk != X)
-		{
-		tchunkptr F = X->iFd;
-		R = X->iBk;
-		if (RTCHECK(OK_ADDRESS(M, F)))
-			{
-			F->iBk = R;
-			R->iFd = F;
-			}
-		else
-			{
-			CORRUPTION_ERROR_ACTION(M);
-			}
-		}
-	else
-		{
-		tchunkptr* RP;
-		if (((R = *(RP = &(X->iChild[1]))) != 0) ||
-			  ((R = *(RP = &(X->iChild[0]))) != 0))
-			{
-			tchunkptr* CP;
-			while ((*(CP = &(R->iChild[1])) != 0) ||
-				   (*(CP = &(R->iChild[0])) != 0))
-				{
-				R = *(RP = CP);
-				}
-			if (RTCHECK(OK_ADDRESS(M, RP)))
-				*RP = 0;
-			else
-				{
-				CORRUPTION_ERROR_ACTION(M);
-				}
-			}
-		}
-	if (XP != 0)
-		{
-		tbinptr* H = TREEBIN_AT(M, X->iIndex);
-		if (X == *H)
-			{
-			if ((*H = R) == 0)
-				CLEAR_TREEMAP(M, X->iIndex);
-			}
-		else if (RTCHECK(OK_ADDRESS(M, XP)))
-			{
-			if (XP->iChild[0] == X)
-				XP->iChild[0] = R;
-			else
-				XP->iChild[1] = R;
-			}
-		else
-			CORRUPTION_ERROR_ACTION(M);
-		if (R != 0)
-			{
-			if (RTCHECK(OK_ADDRESS(M, R)))
-				{
-				tchunkptr C0, C1;
-				R->iParent = XP;
-				if ((C0 = X->iChild[0]) != 0)
-					{
-					if (RTCHECK(OK_ADDRESS(M, C0)))
-						{
-						R->iChild[0] = C0;
-						C0->iParent = R;
-						}
-					else
-						CORRUPTION_ERROR_ACTION(M);
-					}
-				if ((C1 = X->iChild[1]) != 0)
-					{
-					if (RTCHECK(OK_ADDRESS(M, C1)))
-						{
-						R->iChild[1] = C1;
-						C1->iParent = R;
-						}
-					else
-						CORRUPTION_ERROR_ACTION(M);
-					}
-				}
-			else
-				CORRUPTION_ERROR_ACTION(M);
-			}
-		}
-}
-
-/* Unlink a chunk from a smallbin  */
-inline void RHybridHeap::UnlinkSmallChunk(mstate M, mchunkptr P,size_t S)
-{
-	mchunkptr F = P->iFd;
-	mchunkptr B = P->iBk;
-	bindex_t I = SMALL_INDEX(S);
-	HEAP_ASSERT(P != B);
-	HEAP_ASSERT(P != F);
-	HEAP_ASSERT(CHUNKSIZE(P) == SMALL_INDEX2SIZE(I));
-	if (F == B)
-		CLEAR_SMALLMAP(M, I);
-	else if (RTCHECK((F == SMALLBIN_AT(M,I) || OK_ADDRESS(M, F)) &&
-					 (B == SMALLBIN_AT(M,I) || OK_ADDRESS(M, B))))
-		{
-		F->iBk = B;
-		B->iFd = F;
-		}
-	else
-		{
-		CORRUPTION_ERROR_ACTION(M);
-		}
-}
-
-inline void RHybridHeap::UnlinkChunk(mstate M, mchunkptr P, size_t S)
-{
-	if (IS_SMALL(S))
-		UnlinkSmallChunk(M, P, S);
-	else
-		{
-		tchunkptr TP = (tchunkptr)(P); UnlinkLargeChunk(M, TP);
-		}
-}
-
-// For DL debug functions
-void RHybridHeap::DoComputeTreeIndex(size_t S, bindex_t& I)
-{
-	ComputeTreeIndex(S, I);
-}	
-
-inline void RHybridHeap::ComputeTreeIndex(size_t S, bindex_t& I)
-{
-	size_t X = S >> TREEBIN_SHIFT;
-	if (X == 0)
-		I = 0;
-	else if (X > 0xFFFF)
-		I = NTREEBINS-1;
-	else
-		{
-		unsigned int Y = (unsigned int)X;
-		unsigned int N = ((Y - 0x100) >> 16) & 8;
-		unsigned int K = (((Y <<= N) - 0x1000) >> 16) & 4;
-		N += K;
-		N += K = (((Y <<= K) - 0x4000) >> 16) & 2;
-		K = 14 - N + ((Y <<= K) >> 15);
-		I = (K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1));
-		}
-}
-
-/* ------------------------- Operations on trees ------------------------- */
-
-/* Insert chunk into tree */
-inline void RHybridHeap::InsertLargeChunk(mstate M,tchunkptr X,size_t S)
-{
-	tbinptr* H;
-	bindex_t I;
-	ComputeTreeIndex(S, I);
-	H = TREEBIN_AT(M, I);
-	X->iIndex = I;
-	X->iChild[0] = X->iChild[1] = 0;
-	if (!TREEMAP_IS_MARKED(M, I))
-		{
-		MARK_TREEMAP(M, I);
-		*H = X;
-		X->iParent = (tchunkptr)H;
-		X->iFd = X->iBk = X;
-		}
-	else
-		{
-		tchunkptr T = *H;
-		size_t K = S << LEFTSHIFT_FOR_TREE_INDEX(I);
-		for (;;)
-			{
-			if (CHUNKSIZE(T) != S) {
-				tchunkptr* C = &(T->iChild[(K >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]);
-				K <<= 1;
-				if (*C != 0)
-					T = *C;
-				else if (RTCHECK(OK_ADDRESS(M, C)))
-					{
-					*C = X;
-					X->iParent = T;
-					X->iFd = X->iBk = X;
-					break;
-					}
-				else
-					{
-					CORRUPTION_ERROR_ACTION(M);
-					break;
-					}
-				}
-			else
-				{
-				tchunkptr F = T->iFd;
-				if (RTCHECK(OK_ADDRESS(M, T) && OK_ADDRESS(M, F)))
-					{
-					T->iFd = F->iBk = X;
-					X->iFd = F;
-					X->iBk = T;
-					X->iParent = 0;
-					break;
-					}
-				else
-					{
-					CORRUPTION_ERROR_ACTION(M);
-					break;
-					}
-				}
-			}
-		}
-}
-
-/*
-Unlink steps:
-
-1. If x is a chained node, unlink it from its same-sized iFd/iBk links
-and choose its iBk node as its replacement.
-2. If x was the last node of its size, but not a leaf node, it must
-be replaced with a leaf node (not merely one with an open left or
-right), to make sure that lefts and rights of descendents
-correspond properly to bit masks.  We use the rightmost descendent
-of x.  We could use any other leaf, but this is easy to locate and
-tends to counteract removal of leftmosts elsewhere, and so keeps
-paths shorter than minimally guaranteed.  This doesn't loop much
-because on average a node in a tree is near the bottom.
-3. If x is the base of a chain (i.e., has iParent links) relink
-x's iParent and children to x's replacement (or null if none).
-*/
-
-/* Replace iDv node, binning the old one */
-/* Used only when iDvSize known to be small */
-inline void RHybridHeap::ReplaceDv(mstate M, mchunkptr P, size_t S)
-{
-	size_t DVS = M->iDvSize;
-	if (DVS != 0)
-		{
-		mchunkptr DV = M->iDv;
-		HEAP_ASSERT(IS_SMALL(DVS));
-		InsertSmallChunk(M, DV, DVS);
-		}
-	M->iDvSize = S;
-	M->iDv = P;
-}
-
-
-inline void RHybridHeap::ComputeBit2idx(binmap_t X,bindex_t& I)
-{
-	unsigned int Y = X - 1;
-	unsigned int K = Y >> (16-4) & 16;
-	unsigned int N = K;        Y >>= K;
-	N += K = Y >> (8-3) &  8;  Y >>= K;
-	N += K = Y >> (4-2) &  4;  Y >>= K;
-	N += K = Y >> (2-1) &  2;  Y >>= K;
-	N += K = Y >> (1-0) &  1;  Y >>= K;
-	I = (bindex_t)(N + Y);
-}
-
-
-
-int RHybridHeap::SysTrim(mstate m, size_t pad)
-{
-	size_t extra = 0;
-	
-	if ( IS_INITIALIZED(m) )
-		{
-		pad += TOP_FOOT_SIZE; /* ensure enough room for segment overhead */
-		
-		if (m->iTopSize > pad)
-			{
-			extra = Floor(m->iTopSize - pad, iPageSize);
-			if ( (m->iSeg.iSize - extra) < (iMinLength - sizeof(*this)) )			  
-				{
-				if ( m->iSeg.iSize > (iMinLength - sizeof(*this)) )				  
-					extra = Floor(m->iSeg.iSize - (iMinLength - sizeof(*this)), iPageSize); /* do not shrink heap below min length */
-				else extra = 0;
-				}
-			
-			if ( extra )
-				{
-				Unmap(m->iSeg.iBase + m->iSeg.iSize - extra, extra);
-				
-				m->iSeg.iSize -= extra;
-				InitTop(m, m->iTop, m->iTopSize - extra);
-				CHECK_TOP_CHUNK(m, m->iTop);
-				}
-			}
-		
-		}
-	
-	return extra;
-}
-
-/* Get memory from system using MORECORE */
-
-void* RHybridHeap::SysAlloc(mstate m, size_t nb)
-{
-	HEAP_ASSERT(m->iTop);
-	/* Subtract out existing available iTop space from MORECORE request. */
-//	size_t asize = _ALIGN_UP(nb - m->iTopSize + TOP_FOOT_SIZE + SIZE_T_ONE, iGrowBy);  
-  	TInt asize = _ALIGN_UP(nb - m->iTopSize + SYS_ALLOC_PADDING, iGrowBy);  // From DLA version 2.8.4
-	
-	char* br = (char*)Map(m->iSeg.iBase+m->iSeg.iSize, asize);
-	if (!br)
-		return 0;
-	HEAP_ASSERT(br == (char*)m->iSeg.iBase+m->iSeg.iSize);
-	
-	/* Merge with an existing segment */
-	m->iSeg.iSize += asize;
-	InitTop(m, m->iTop, m->iTopSize + asize);
-	
-	if (nb < m->iTopSize)
-		{ /* Allocate from new or extended iTop space */
-		size_t rsize = m->iTopSize -= nb;
-		mchunkptr p = m->iTop;
-		mchunkptr r = m->iTop = CHUNK_PLUS_OFFSET(p, nb);
-		r->iHead = rsize | PINUSE_BIT;
-		SET_SIZE_AND_PINUSE_OF_INUSE_CHUNK(m, p, nb);
-		CHECK_TOP_CHUNK(m, m->iTop);
-		CHECK_MALLOCED_CHUNK(m, CHUNK2MEM(p), nb);
-		return CHUNK2MEM(p);
-		}
-	
-	return 0;
-}	
-
-
-void RHybridHeap::InitDlMalloc(size_t capacity, int /*locked*/)
-{
-	memset(GM,0,sizeof(malloc_state));
-	// The maximum amount that can be allocated can be calculated as:-
-	// 2^sizeof(size_t) - sizeof(malloc_state) - TOP_FOOT_SIZE - page Size(all accordingly padded)
-	// If the capacity exceeds this, no allocation will be done.
-	GM->iSeg.iBase = iBase;
-	GM->iSeg.iSize = capacity;
-	InitBins(GM);
-	InitTop(GM, (mchunkptr)iBase, capacity - TOP_FOOT_SIZE);
-}
-
-void* RHybridHeap::DlMalloc(size_t bytes) 
-{
-	/*
-	Basic algorithm:
-	If a small request (< 256 bytes minus per-chunk overhead):
-	1. If one exists, use a remainderless chunk in associated smallbin.
-	(Remainderless means that there are too few excess bytes to
-	represent as a chunk.)
-	2. If it is big enough, use the iDv chunk, which is normally the
-	chunk adjacent to the one used for the most recent small request.
-	3. If one exists, split the smallest available chunk in a bin,
-	saving remainder in iDv.
-	4. If it is big enough, use the iTop chunk.
-	5. If available, get memory from system and use it
-	Otherwise, for a large request:
-	1. Find the smallest available binned chunk that fits, and use it
-	if it is better fitting than iDv chunk, splitting if necessary.
-	2. If better fitting than any binned chunk, use the iDv chunk.
-	3. If it is big enough, use the iTop chunk.
-	4. If request size >= mmap threshold, try to directly mmap this chunk.
-	5. If available, get memory from system and use it
-*/
-	void* mem;
-	size_t nb;
-	if (bytes <= MAX_SMALL_REQUEST)
-		{
-		bindex_t idx;
-		binmap_t smallbits;
-		nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : PAD_REQUEST(bytes);
-		idx = SMALL_INDEX(nb);
-		smallbits = GM->iSmallMap >> idx;
-		
-		if ((smallbits & 0x3U) != 0)
-			{ /* Remainderless fit to a smallbin. */
-			mchunkptr b, p;
-			idx += ~smallbits & 1;			 /* Uses next bin if idx empty */
-			b = SMALLBIN_AT(GM, idx);
-			p = b->iFd;
-			HEAP_ASSERT(CHUNKSIZE(p) == SMALL_INDEX2SIZE(idx));
-			UnlinkFirstSmallChunk(GM, b, p, idx);
-			SET_INUSE_AND_PINUSE(GM, p, SMALL_INDEX2SIZE(idx));
-			mem = CHUNK2MEM(p);
-			CHECK_MALLOCED_CHUNK(GM, mem, nb);
-			return mem;
-			}
-		
-		else if (nb > GM->iDvSize)
-			{
-			if (smallbits != 0)
-				{ /* Use chunk in next nonempty smallbin */
-				mchunkptr b, p, r;
-				size_t rsize;
-				bindex_t i;
-				binmap_t leftbits = (smallbits << idx) & LEFT_BITS(IDX2BIT(idx));
-				binmap_t leastbit = LEAST_BIT(leftbits);
-				ComputeBit2idx(leastbit, i);
-				b = SMALLBIN_AT(GM, i);
-				p = b->iFd;
-				HEAP_ASSERT(CHUNKSIZE(p) == SMALL_INDEX2SIZE(i));
-				UnlinkFirstSmallChunk(GM, b, p, i);
-				rsize = SMALL_INDEX2SIZE(i) - nb;
-				/* Fit here cannot be remainderless if 4byte sizes */
-				if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE)
-					SET_INUSE_AND_PINUSE(GM, p, SMALL_INDEX2SIZE(i));
-				else
-					{
-					SET_SIZE_AND_PINUSE_OF_INUSE_CHUNK(GM, p, nb);
-					r = CHUNK_PLUS_OFFSET(p, nb);
-					SET_SIZE_AND_PINUSE_OF_FREE_CHUNK(r, rsize);
-					ReplaceDv(GM, r, rsize);
-					}
-				mem = CHUNK2MEM(p);
-				CHECK_MALLOCED_CHUNK(GM, mem, nb);
-				return mem;
-				}
-			
-			else if (GM->iTreeMap != 0 && (mem = TmallocSmall(GM, nb)) != 0)
-				{
-				CHECK_MALLOCED_CHUNK(GM, mem, nb);
-				return mem;
-				}
-			}
-		}
-	else if (bytes >= MAX_REQUEST)
-		nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */
-	else
-		{
-		nb = PAD_REQUEST(bytes);
-		if (GM->iTreeMap != 0 && (mem = TmallocLarge(GM, nb)) != 0)
-			{
-			CHECK_MALLOCED_CHUNK(GM, mem, nb);
-			return mem;
-			}
-		}
-	
-	if (nb <= GM->iDvSize)
-		{
-		size_t rsize = GM->iDvSize - nb;
-		mchunkptr p = GM->iDv;
-		if (rsize >= MIN_CHUNK_SIZE)
-			{ /* split iDv */
-			mchunkptr r = GM->iDv = CHUNK_PLUS_OFFSET(p, nb);
-			GM->iDvSize = rsize;
-			SET_SIZE_AND_PINUSE_OF_FREE_CHUNK(r, rsize);
-			SET_SIZE_AND_PINUSE_OF_INUSE_CHUNK(GM, p, nb);
-			}
-		else
-			{ /* exhaust iDv */
-			size_t dvs = GM->iDvSize;
-			GM->iDvSize = 0;
-			GM->iDv = 0;
-			SET_INUSE_AND_PINUSE(GM, p, dvs);
-			}
-		mem = CHUNK2MEM(p);
-		CHECK_MALLOCED_CHUNK(GM, mem, nb);
-		return mem;
-		}
-	
-	else if (nb < GM->iTopSize)
-		{ /* Split iTop */
-		size_t rsize = GM->iTopSize -= nb;
-		mchunkptr p = GM->iTop;
-		mchunkptr r = GM->iTop = CHUNK_PLUS_OFFSET(p, nb);
-		r->iHead = rsize | PINUSE_BIT;
-		SET_SIZE_AND_PINUSE_OF_INUSE_CHUNK(GM, p, nb);
-		mem = CHUNK2MEM(p);
-		CHECK_TOP_CHUNK(GM, GM->iTop);
-		CHECK_MALLOCED_CHUNK(GM, mem, nb);
-		return mem;
-		}
-	
-	return SysAlloc(GM, nb);
-}
-
-
-void RHybridHeap::DlFree(void* mem)
-{
-	/*
-	Consolidate freed chunks with preceeding or succeeding bordering
-	free chunks, if they exist, and then place in a bin.	Intermixed
-	with special cases for iTop, iDv, mmapped chunks, and usage errors.
-*/
-	mchunkptr p	= MEM2CHUNK(mem);
-	CHECK_INUSE_CHUNK(GM, p);
-	if (RTCHECK(OK_ADDRESS(GM, p) && OK_CINUSE(p)))
-		{
-		size_t psize = CHUNKSIZE(p);
-		mchunkptr next = CHUNK_PLUS_OFFSET(p, psize);
-		if (!PINUSE(p))
-			{
-			size_t prevsize = p->iPrevFoot;
-			mchunkptr prev = CHUNK_MINUS_OFFSET(p, prevsize);
-			psize += prevsize;
-			p = prev;
-			if (RTCHECK(OK_ADDRESS(GM, prev)))
-				{ /* consolidate backward */
-				if (p != GM->iDv)
-					{
-					UnlinkChunk(GM, p, prevsize);
-					}
-				else if ((next->iHead & INUSE_BITS) == INUSE_BITS)
-					{
-					GM->iDvSize = psize;
-					SET_FREE_WITH_PINUSE(p, psize, next);
-					return;
-					}
-				}
-			else
-				{
-				USAGE_ERROR_ACTION(GM, p);
-				return;
-				}
-			}
-		
-		if (RTCHECK(OK_NEXT(p, next) && OK_PINUSE(next)))
-			{
-			if (!CINUSE(next))
-				{	/* consolidate forward */
-				if (next == GM->iTop)
-					{
-					size_t tsize = GM->iTopSize += psize;
-					GM->iTop = p;
-					p->iHead = tsize | PINUSE_BIT;
-					if (p == GM->iDv)
-						{
-						GM->iDv = 0;
-						GM->iDvSize = 0;
-						}
-					if ( !IS_FIXED_HEAP && SHOULD_TRIM(GM, tsize)  )					
-						SysTrim(GM, 0);
-					return;
-					}
-				else if (next == GM->iDv)
-					{
-					size_t dsize = GM->iDvSize += psize;
-					GM->iDv = p;
-					SET_SIZE_AND_PINUSE_OF_FREE_CHUNK(p, dsize);
-					return;
-					}
-				else
-					{
-					size_t nsize = CHUNKSIZE(next);
-					psize += nsize;
-					UnlinkChunk(GM, next, nsize);
-					SET_SIZE_AND_PINUSE_OF_FREE_CHUNK(p, psize);
-					if (p == GM->iDv)
-						{
-						GM->iDvSize = psize;
-						return;
-						}
-					}
-				}
-			else
-				SET_FREE_WITH_PINUSE(p, psize, next);
-			InsertChunk(GM, p, psize);
-			CHECK_FREE_CHUNK(GM, p);
-			return;
-			}
-		}
-}
-
-
-void* RHybridHeap::DlRealloc(void* oldmem, size_t bytes, TInt mode)
-{
-	mchunkptr oldp = MEM2CHUNK(oldmem);
-	size_t oldsize = CHUNKSIZE(oldp);
-	mchunkptr next = CHUNK_PLUS_OFFSET(oldp, oldsize);
-	mchunkptr newp = 0;
-	void* extra = 0;
-	
-	/* Try to either shrink or extend into iTop. Else malloc-copy-free */
-	
-	if (RTCHECK(OK_ADDRESS(GM, oldp) && OK_CINUSE(oldp) &&
-				OK_NEXT(oldp, next) && OK_PINUSE(next)))
-		{
-		size_t nb = REQUEST2SIZE(bytes);
-		if (oldsize >= nb) { /* already big enough */
-			size_t rsize = oldsize - nb;
-			newp = oldp;
-			if (rsize >= MIN_CHUNK_SIZE)
-				{     
-				mchunkptr remainder = CHUNK_PLUS_OFFSET(newp, nb);
-				SET_INUSE(GM, newp, nb);
-//				SET_INUSE(GM, remainder, rsize);
- 				SET_INUSE_AND_PINUSE(GM, remainder, rsize);  // corrected in original DLA version V2.8.4
-				extra = CHUNK2MEM(remainder);
-				}
-			}
-		else if (next == GM->iTop && oldsize + GM->iTopSize > nb)
-			{
-			/* Expand into iTop */
-			size_t newsize = oldsize + GM->iTopSize;
-			size_t newtopsize = newsize - nb;
-			mchunkptr newtop = CHUNK_PLUS_OFFSET(oldp, nb);
-			SET_INUSE(GM, oldp, nb);
-			newtop->iHead = newtopsize |PINUSE_BIT;
-			GM->iTop = newtop;
-			GM->iTopSize = newtopsize;
-			newp = oldp;
-			}
-		}
-	else
-		{
-		USAGE_ERROR_ACTION(GM, oldmem);
-		}
-	
-	if (newp != 0)
-		{
-		if (extra != 0)
-			{
-			DlFree(extra);
-			}
-		CHECK_INUSE_CHUNK(GM, newp);
-		return CHUNK2MEM(newp);
-		}
-	else
-		{
-		if ( mode & ENeverMove )
-			return 0;		// cannot move
-		void* newmem = DlMalloc(bytes);
-		if (newmem != 0)
-			{
-			size_t oc = oldsize - OVERHEAD_FOR(oldp);
-			memcpy(newmem, oldmem, (oc < bytes)? oc : bytes);
-			DlFree(oldmem);
-			}
-		return newmem;
-		}
-	//	return 0;
-}
-
-size_t RHybridHeap::DlInfo(struct HeapInfo* i, SWalkInfo* wi) const
-{
-	TInt max = ((GM->iTopSize-1) & ~CHUNK_ALIGN_MASK) - CHUNK_OVERHEAD;
-	if ( max < 0 )
-		max = 0;
-	else ++i->iFreeN;			// iTop always free
-	i->iFreeBytes += max;
-	
-	Walk(wi, GM->iTop, max, EGoodFreeCell, EDougLeaAllocator); // Introduce DL iTop buffer to the walk function 
-	
-	for (mchunkptr q = ALIGN_AS_CHUNK(GM->iSeg.iBase); q != GM->iTop; q = NEXT_CHUNK(q))
-		{
-		TInt sz = CHUNKSIZE(q);
-		if (!CINUSE(q))
-			{
-			if ( sz > max )
-				max = sz;
-			i->iFreeBytes += sz;
-			++i->iFreeN;
-			Walk(wi, CHUNK2MEM(q), sz, EGoodFreeCell, EDougLeaAllocator); // Introduce DL free buffer to the walk function 
-			}
-		else
-			{
-			i->iAllocBytes += sz - CHUNK_OVERHEAD;
-			++i->iAllocN;
-			Walk(wi, CHUNK2MEM(q), (sz- CHUNK_OVERHEAD), EGoodAllocatedCell, EDougLeaAllocator); // Introduce DL allocated buffer to the walk function 
-			}
-		}
-	return max;  // return largest available chunk size
-}
-
-//
-// get statistics about the state of the allocator
-//
-TInt RHybridHeap::GetInfo(struct HeapInfo* i, SWalkInfo* wi) const
-{
-	memset(i,0,sizeof(HeapInfo));
-	i->iFootprint = iChunkSize;
-	i->iMaxSize = iMaxLength;
-#ifndef __KERNEL_MODE__		
-	PagedInfo(i, wi);
-	SlabInfo(i, wi);
-#endif	
-	return DlInfo(i,wi);
-}
-
-//
-// Methods to commit/decommit memory pages from chunk
-//
-
-
-void* RHybridHeap::Map(void* p, TInt sz)
-//
-// allocate pages in the chunk
-// if p is NULL, Find an allocate the required number of pages (which must lie in the lower half)
-// otherwise commit the pages specified
-//
-{
-	HEAP_ASSERT(sz > 0);
-
-	if ( iChunkSize + sz > iMaxLength)
-		return 0;
-
-#ifdef __KERNEL_MODE__
-
-	TInt r = ((DChunk*)iChunkHandle)->Adjust(iChunkSize + iOffset + sz);
-	if (r < 0)
-		return 0;
-
-	iChunkSize += sz;
-	
-#else	
-
-	RChunk chunk;
-	chunk.SetHandle(iChunkHandle);
-	if ( p )
-		{
-		TInt r;
-		if ( iUseAdjust )
-			r = chunk.Adjust(iChunkSize + sz);
-		else
-			{
-			HEAP_ASSERT(sz == Ceiling(sz, iPageSize));
-			HEAP_ASSERT(p == Floor(p, iPageSize));
-			r = chunk.Commit(iOffset + PtrDiff(p, this),sz);
-			}			
-		if (r < 0)
-			return 0;
-		}
-	else
-		{
-		TInt r = chunk.Allocate(sz);
-		if (r < 0)
-			return 0;
-		if (r > iOffset)
-			{
-			// can't allow page allocations in DL zone
-			chunk.Decommit(r, sz);
-			return 0;
-			}
-		p = Offset(this, r - iOffset);
-		}
-	iChunkSize += sz;
-	
-	if (iChunkSize >= iSlabInitThreshold)
-		{	// set up slab system now that heap is large enough
-		SlabConfig(iSlabConfigBits);
-		iSlabInitThreshold = KMaxTInt32;
-		}
-
-#endif //	__KERNEL_MODE__
-	
-#ifdef ENABLE_BTRACE
-	if(iChunkSize > iHighWaterMark)
-		{
-		iHighWaterMark = Ceiling(iChunkSize,16*iPageSize);
-		TUint32 traceData[6];
-		traceData[0] = iChunkHandle;
-		traceData[1] = iMinLength;
-		traceData[2] = iMaxLength;
-		traceData[3] = sz;
-		traceData[4] = iChunkSize;
-		traceData[5] = iHighWaterMark;
-		BTraceContextN(BTrace::ETest1, 90, (TUint32)this, 33, traceData, sizeof(traceData));
-		}
-#endif
-
-	return p;
-}
-
-void RHybridHeap::Unmap(void* p, TInt sz)
-{
-	HEAP_ASSERT(sz > 0);
-	
-#ifdef __KERNEL_MODE__
-	
-	(void)p;
-	HEAP_ASSERT(sz == Ceiling(sz, iPageSize));
-#if defined(_DEBUG)		
-	TInt r =
-#endif				
-   ((DChunk*)iChunkHandle)->Adjust(iChunkSize + iOffset - sz);
-	HEAP_ASSERT(r >= 0);
-	
-#else
-
-	RChunk chunk;
-	chunk.SetHandle(iChunkHandle);
-	if ( iUseAdjust )
-		{
-		HEAP_ASSERT(sz == Ceiling(sz, iPageSize));
-#if defined(_DEBUG)		
-		TInt r =
-#endif				
-		chunk.Adjust(iChunkSize - sz);
-		HEAP_ASSERT(r >= 0);		
-		}
-	else
-		{
-		HEAP_ASSERT(sz == Ceiling(sz, iPageSize));
-		HEAP_ASSERT(p == Floor(p, iPageSize));
-#if defined(_DEBUG)		
-		TInt r =
-#endif
-		chunk.Decommit(PtrDiff(p, Offset(this,-iOffset)), sz);
-		HEAP_ASSERT(r >= 0);				
-		}			
-#endif  // __KERNEL_MODE__
-	
-	iChunkSize -= sz;
-}
-
-
-#ifndef __KERNEL_MODE__
-//
-// Slab allocator code
-//
-
-//inline slab* slab::SlabFor(void* p)
-slab* slab::SlabFor( const void* p)
-{
-	return (slab*)(Floor(p, SLABSIZE));
-}
-
-//
-// Remove slab s from its tree/heap (not necessarily the root), preserving the address order
-// invariant of the heap
-//
-void RHybridHeap::TreeRemove(slab* s)
-{
-	slab** r = s->iParent;
-	slab* c1 = s->iChild1;
-	slab* c2 = s->iChild2;
-	for (;;)
-		{
-		if (!c2)
-			{
-			*r = c1;
-			if (c1)
-				c1->iParent = r;
-			return;
-			}
-		if (!c1)
-			{
-			*r = c2;
-			c2->iParent = r;
-			return;
-			}
-		if (c1 > c2)
-			{
-			slab* c3 = c1;
-			c1 = c2;
-			c2 = c3;
-			}
-		slab* newc2 = c1->iChild2;
-		*r = c1;
-		c1->iParent = r;
-		c1->iChild2 = c2;
-		c2->iParent = &c1->iChild2;
-		s = c1;
-		c1 = s->iChild1;
-		c2 = newc2;
-		r = &s->iChild1;
-		}
-}
-//
-// Insert slab s into the tree/heap rooted at r, preserving the address ordering
-// invariant of the heap
-//
-void RHybridHeap::TreeInsert(slab* s,slab** r)
-{
-	slab* n = *r;
-	for (;;)
-		{
-		if (!n)
-			{	// tree empty
-			*r = s;
-			s->iParent = r;
-			s->iChild1 = s->iChild2 = 0;
-			break;
-			}
-		if (s < n)
-			{	// insert between iParent and n
-			*r = s;
-			s->iParent = r;
-			s->iChild1 = n;
-			s->iChild2 = 0;
-			n->iParent = &s->iChild1;
-			break;
-			}
-		slab* c1 = n->iChild1;
-		slab* c2 = n->iChild2;
-		if ((c1 - 1) > (c2 - 1))
-			{
-			r = &n->iChild1;
-			n = c1;
-			}
-		else
-			{
-			r = &n->iChild2;
-			n = c2;
-			}
-		}
-}
-
-void* RHybridHeap::AllocNewSlab(slabset& allocator)
-//
-// Acquire and initialise a new slab, returning a cell from the slab
-// The strategy is:
-// 1. Use the lowest address free slab, if available. This is done by using the lowest slab
-//    in the page at the root of the iPartialPage heap (which is address ordered). If the
-//    is now fully used, remove it from the iPartialPage heap.
-// 2. Allocate a new page for iSlabs if no empty iSlabs are available
-//
-{
-	page* p = page::PageFor(iPartialPage);
-	if (!p)
-		return AllocNewPage(allocator);
-	
-	unsigned h = p->iSlabs[0].iHeader;
-	unsigned pagemap = SlabHeaderPagemap(h);
-	HEAP_ASSERT(&p->iSlabs[HIBIT(pagemap)] == iPartialPage);
-	
-	unsigned slabix = LOWBIT(pagemap);
-	p->iSlabs[0].iHeader = h &~ (0x100<<slabix);
-	if (!(pagemap &~ (1<<slabix)))
-		{
-		TreeRemove(iPartialPage);	// last free slab in page
-		}
-	
-	return InitNewSlab(allocator, &p->iSlabs[slabix]);
-}
-
-/**Defination of this functionis not there in proto code***/
-#if 0
-void RHybridHeap::partial_insert(slab* s)
-{
-	// slab has had first cell freed and needs to be linked back into iPartial tree
-	slabset& ss = iSlabAlloc[iSizeMap[s->clz]];
-	
-	HEAP_ASSERT(s->used == slabfull);
-	s->used = ss.fulluse - s->clz;		// full-1 loading
-	TreeInsert(s,&ss.iPartial);
-	CHECKTREE(&ss.iPartial);
-}
-/**Defination of this functionis not there in proto code***/
-#endif
-
-void* RHybridHeap::AllocNewPage(slabset& allocator)
-//
-// Acquire and initialise a new page, returning a cell from a new slab
-// The iPartialPage tree is empty (otherwise we'd have used a slab from there)
-// The iPartialPage link is put in the highest addressed slab in the page, and the
-// lowest addressed slab is used to fulfill the allocation request
-//
-{
-	page* p	 = iSparePage;
-	if (p)
-		iSparePage = 0;
-	else
-		{
-		p = static_cast<page*>(Map(0, iPageSize));
-		if (!p)
-			return 0;
-		}
-	HEAP_ASSERT(p == Floor(p, iPageSize));
-	// Store page allocated for slab into paged_bitmap (for RHybridHeap::Reset())
-	if (!PagedSetSize(p, iPageSize))
-		{
-		Unmap(p, iPageSize);
-		return 0;
-		}
-	p->iSlabs[0].iHeader = ((1<<3) + (1<<2) + (1<<1))<<8;		// set pagemap
-	p->iSlabs[3].iParent = &iPartialPage;
-	p->iSlabs[3].iChild1 = p->iSlabs[3].iChild2 = 0;
-	iPartialPage = &p->iSlabs[3];
-	return InitNewSlab(allocator,&p->iSlabs[0]);
-}
-
-void RHybridHeap::FreePage(page* p)
-//
-// Release an unused page to the OS
-// A single page is cached for reuse to reduce thrashing
-// the OS allocator.
-//
-{
-	HEAP_ASSERT(Ceiling(p, iPageSize) == p);
-	if (!iSparePage)
-		{
-		iSparePage = p;
-		return;
-		}
-	
-	// unmapped slab page must be cleared from paged_bitmap, too
-	PagedZapSize(p, iPageSize);		// clear page map
-	
-	Unmap(p, iPageSize);
-}
-
-void RHybridHeap::FreeSlab(slab* s)
-//
-// Release an empty slab to the slab manager
-// The strategy is:
-// 1. The page containing the slab is checked to see the state of the other iSlabs in the page by
-//    inspecting the pagemap field in the iHeader of the first slab in the page.
-// 2. The pagemap is updated to indicate the new unused slab
-// 3. If this is the only unused slab in the page then the slab iHeader is used to add the page to
-//    the iPartialPage tree/heap
-// 4. If all the iSlabs in the page are now unused the page is release back to the OS
-// 5. If this slab has a higher address than the one currently used to track this page in
-//    the iPartialPage heap, the linkage is moved to the new unused slab
-//
-{
-	TreeRemove(s);
-	CHECKTREE(s->iParent);
-	HEAP_ASSERT(SlabHeaderUsedm4(s->iHeader) == SlabHeaderSize(s->iHeader)-4);
-
-	page* p = page::PageFor(s);
-	unsigned h = p->iSlabs[0].iHeader;
-	int slabix = s - &p->iSlabs[0];
-	unsigned pagemap = SlabHeaderPagemap(h);
-	p->iSlabs[0].iHeader = h | (0x100<<slabix);
-	if (pagemap == 0)
-		{	// page was full before, use this slab as link in empty heap
-		TreeInsert(s, &iPartialPage);
-		}
-	else
-		{	// Find the current empty-link slab
-		slab* sl = &p->iSlabs[HIBIT(pagemap)];
-		pagemap ^= (1<<slabix);
-		if (pagemap == 0xf)
-			{	// page is now empty so recycle page to os
-			TreeRemove(sl);
-			FreePage(p);
-			return;
-			}
-		// ensure the free list link is in highest address slab in page
-		if (s > sl)
-			{	// replace current link with new one. Address-order tree so position stays the same
-			slab** r = sl->iParent;
-			slab* c1 = sl->iChild1;
-			slab* c2 = sl->iChild2;
-			s->iParent = r;
-			s->iChild1 = c1;
-			s->iChild2 = c2;
-			*r = s;
-			if (c1)
-				c1->iParent = &s->iChild1;
-			if (c2)
-				c2->iParent = &s->iChild2;
-			}
-		CHECK(if (s < sl) s=sl);
-		}
-	HEAP_ASSERT(SlabHeaderPagemap(p->iSlabs[0].iHeader) != 0);
-	HEAP_ASSERT(HIBIT(SlabHeaderPagemap(p->iSlabs[0].iHeader)) == unsigned(s - &p->iSlabs[0]));
-}
-
-
-void RHybridHeap::SlabInit()
-{
-	iSlabThreshold=0;
-	iPartialPage = 0;
-	iFullSlab = 0;
-	iSparePage = 0;
-	memset(&iSizeMap[0],0xff,sizeof(iSizeMap));
-	memset(&iSlabAlloc[0],0,sizeof(iSlabAlloc));
-}
-
-void RHybridHeap::SlabConfig(unsigned slabbitmap)
-{
-	HEAP_ASSERT((slabbitmap & ~EOkBits) == 0);
-	HEAP_ASSERT(MAXSLABSIZE <= 60);
-	
-	unsigned int ix = 0xff;
-	unsigned int bit = 1<<((MAXSLABSIZE>>2)-1);
-	for (int sz = MAXSLABSIZE; sz >= 0; sz -= 4, bit >>= 1)
-		{
-		if (slabbitmap & bit)
-			{
-			if (ix == 0xff)
-				iSlabThreshold=sz+1;
-			ix = (sz>>2)-1;
-			}
-		iSizeMap[sz>>2] = (TUint8) ix;
-		}
-}
-
-
-void* RHybridHeap::SlabAllocate(slabset& ss)
-//
-// Allocate a cell from the given slabset
-// Strategy:
-// 1. Take the partially full slab at the iTop of the heap (lowest address).
-// 2. If there is no such slab, allocate from a new slab
-// 3. If the slab has a non-empty freelist, pop the cell from the front of the list and update the slab
-// 4. Otherwise, if the slab is not full, return the cell at the end of the currently used region of
-//    the slab, updating the slab
-// 5. Otherwise, release the slab from the iPartial tree/heap, marking it as 'floating' and go back to
-//    step 1
-//
-{
-	for (;;)
-		{
-		slab *s = ss.iPartial;
-		if (!s)
-			break;
-		unsigned h = s->iHeader;
-		unsigned free = h & 0xff;		// extract free cell positioning
-		if (free)
-			{
-			HEAP_ASSERT(((free<<2)-sizeof(slabhdr))%SlabHeaderSize(h) == 0);
-			void* p = Offset(s,free<<2);
-			free = *(unsigned char*)p;	// get next pos in free list
-			h += (h&0x3C000)<<6;		// update usedm4
-			h &= ~0xff;
-			h |= free;					// update freelist
-			s->iHeader = h;
-			HEAP_ASSERT(SlabHeaderFree(h) == 0 || ((SlabHeaderFree(h)<<2)-sizeof(slabhdr))%SlabHeaderSize(h) == 0);
-			HEAP_ASSERT(SlabHeaderUsedm4(h) <= 0x3F8u);
-			HEAP_ASSERT((SlabHeaderUsedm4(h)+4)%SlabHeaderSize(h) == 0);
-			return p;
-			}
-		unsigned h2 = h + ((h&0x3C000)<<6);
-//		if (h2 < 0xfc00000)
-  		if (h2 < MAXUSEDM4BITS)		
-			{
-			HEAP_ASSERT((SlabHeaderUsedm4(h2)+4)%SlabHeaderSize(h2) == 0);
-			s->iHeader = h2;
-			return Offset(s,(h>>18) + sizeof(unsigned) + sizeof(slabhdr));
-			}
-		h |= FLOATING_BIT;				// mark the slab as full-floating
-		s->iHeader = h;
-		TreeRemove(s);
-		slab* c = iFullSlab;			// add to full list
-		iFullSlab = s;
-		s->iParent = &iFullSlab;
-		s->iChild1 = c;
-		s->iChild2 = 0;
-		if (c)
-			c->iParent = &s->iChild1;
-		
-		CHECKTREE(&ss.iPartial);
-		// go back and try the next slab...
-		}
-	// no iPartial iSlabs found, so allocate from a new slab
-	return AllocNewSlab(ss);
-}
-
-void RHybridHeap::SlabFree(void* p)
-//
-// Free a cell from the slab allocator
-// Strategy:
-// 1. Find the containing slab (round down to nearest 1KB boundary)
-// 2. Push the cell into the slab's freelist, and update the slab usage count
-// 3. If this is the last allocated cell, free the slab to the main slab manager
-// 4. If the slab was full-floating then insert the slab in it's respective iPartial tree
-//
-{
-	HEAP_ASSERT(LowBits(p,3)==0);
-	slab* s = slab::SlabFor(p);
-	CHECKSLAB(s,ESlabAllocator,p);
-	CHECKSLABBFR(s,p);	
-
-	unsigned pos = LowBits(p, SLABSIZE);
-	unsigned h = s->iHeader;
-	HEAP_ASSERT(SlabHeaderUsedm4(h) != 0x3fC);		// slab is empty already
-	HEAP_ASSERT((pos-sizeof(slabhdr))%SlabHeaderSize(h) == 0);
-	*(unsigned char*)p = (unsigned char)h;
-	h &= ~0xFF;
-	h |= (pos>>2);
-	unsigned size = h & 0x3C000;
-	if (int(h) >= 0)
-		{
-		h -= size<<6;
-		if (int(h)>=0)
-			{
-			s->iHeader = h;
-			return;
-			}
-		FreeSlab(s);
-		return;
-		}
-	h -= size<<6;
-    h &= ~FLOATING_BIT;	
-	s->iHeader = h;
-	slab** full = s->iParent;		// remove from full list
-	slab* c = s->iChild1;
-	*full = c;
-	if (c)
-		c->iParent = full;
-	
-	slabset& ss = iSlabAlloc[iSizeMap[size>>14]];
-	TreeInsert(s,&ss.iPartial);
-	CHECKTREE(&ss.iPartial);
-}
-
-void* RHybridHeap::InitNewSlab(slabset& allocator, slab* s)
-//
-// initialise an empty slab for this allocator and return the fist cell
-// pre-condition: the slabset has no iPartial iSlabs for allocation
-//
-{
-	HEAP_ASSERT(allocator.iPartial==0);
-	TInt size = 4 + ((&allocator-&iSlabAlloc[0])<<2);	// infer size from slab allocator address
-	unsigned h = s->iHeader & 0xF00;	// preserve pagemap only
-	h |= (size<<12);					// set size
-	h |= (size-4)<<18;					// set usedminus4 to one object minus 4
-	s->iHeader = h;
-	allocator.iPartial = s;
-	s->iParent = &allocator.iPartial;
-	s->iChild1 = s->iChild2 = 0;
-	return Offset(s,sizeof(slabhdr));
-}
-
-const unsigned char slab_bitcount[16] = {0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4};
-
-const unsigned char slab_ext_frag[16] =
-{
-	0,
-	16 + (1008 % 4),
-	16 + (1008 % 8),
-	16 + (1008 % 12),
-	16 + (1008 % 16),
-	16 + (1008 % 20),
-	16 + (1008 % 24),
-	16 + (1008 % 28),
-	16 + (1008 % 32),
-	16 + (1008 % 36),
-	16 + (1008 % 40),
-	16 + (1008 % 44),
-	16 + (1008 % 48),
-	16 + (1008 % 52),
-	16 + (1008 % 56),
-	16 + (1008 % 60)
-};
-
-void RHybridHeap::TreeWalk(slab* const* root, void (*f)(slab*, struct HeapInfo*, SWalkInfo*), struct HeapInfo* i, SWalkInfo* wi)
-{
-	// iterative walk around the tree at root
-	
-	slab* s = *root;
-	if (!s)
-		return;
-	
-	for (;;)
-		{
-		slab* c;
-		while ((c = s->iChild1) != 0)
-			s = c;		// walk down left side to end
-		for (;;)
-			{
-			f(s, i, wi);
-			c = s->iChild2;
-			if (c)
-				{	// one step down right side, now try and walk down left
-				s = c;
-				break;
-				}
-			for (;;)
-				{	// loop to walk up right side
-				slab** pp = s->iParent;
-				if (pp == root)
-					return;
-				s = slab::SlabFor(pp);
-				if (pp == &s->iChild1)
-					break;
-				}
-			}
-		}
-}
-
-void RHybridHeap::SlabEmptyInfo(slab* s, struct HeapInfo* i, SWalkInfo* wi)
-{
-	Walk(wi, s, SLABSIZE, EGoodFreeCell, EEmptySlab); // Introduce an empty slab to the walk function 
-	int nslab = slab_bitcount[SlabHeaderPagemap(page::PageFor(s)->iSlabs[0].iHeader)];
-	i->iFreeN += nslab;
-	i->iFreeBytes += nslab << SLABSHIFT;
-}
-
-void RHybridHeap::SlabPartialInfo(slab* s, struct HeapInfo* i, SWalkInfo* wi)
-{
-	Walk(wi, s, SLABSIZE, EGoodAllocatedCell, EPartialFullSlab); // Introduce a full slab to the walk function 
-	unsigned h = s->iHeader;
-	unsigned used = SlabHeaderUsedm4(h)+4;
-	unsigned size = SlabHeaderSize(h);
-	unsigned free = 1024 - slab_ext_frag[size>>2] - used;
-	i->iFreeN += (free/size);
-	i->iFreeBytes += free;
-	i->iAllocN += (used/size);
-	i->iAllocBytes += used;
-}
-
-void RHybridHeap::SlabFullInfo(slab* s, struct HeapInfo* i, SWalkInfo* wi)
-{
-	Walk(wi, s, SLABSIZE, EGoodAllocatedCell, EFullSlab); // Introduce a full slab to the walk function 
-	unsigned h = s->iHeader;
-	unsigned used = SlabHeaderUsedm4(h)+4;
-	unsigned size = SlabHeaderSize(h);
-	HEAP_ASSERT(1024 - slab_ext_frag[size>>2] - used == 0);
-	i->iAllocN += (used/size);
-	i->iAllocBytes += used;
-}
-
-void RHybridHeap::SlabInfo(struct HeapInfo* i, SWalkInfo* wi) const
-{
-	if (iSparePage)
-		{
-		i->iFreeBytes += iPageSize;
-		i->iFreeN = 4;
-		Walk(wi, iSparePage, iPageSize, EGoodFreeCell, ESlabSpare); // Introduce Slab spare page to the walk function 
-		}
-	TreeWalk(&iFullSlab, &SlabFullInfo, i, wi);
-	for (int ix = 0; ix < (MAXSLABSIZE>>2); ++ix)
-		TreeWalk(&iSlabAlloc[ix].iPartial, &SlabPartialInfo, i, wi);
-	TreeWalk(&iPartialPage, &SlabEmptyInfo, i, wi);
-}
-
-
-//
-// Bitmap class implementation for large page allocator 
-//
-inline unsigned char* paged_bitmap::Addr() const {return iBase;}
-inline unsigned paged_bitmap::Size() const {return iNbits;}
-//
-
-void paged_bitmap::Init(unsigned char* p, unsigned size, unsigned bit)
-{
-	iBase = p;
-	iNbits=size;
-	int bytes=Ceiling(size,8)>>3;
-	memset(p,bit?0xff:0,bytes);
-}
-
-inline void paged_bitmap::Set(unsigned ix, unsigned bit)
-{
-	if (bit)
-		iBase[ix>>3] |= (1<<(ix&7));
-	else
-		iBase[ix>>3] &= ~(1<<(ix&7));
-}
-
-inline unsigned paged_bitmap::operator[](unsigned ix) const
-{
-	return 1U&(iBase[ix>>3] >> (ix&7));
-}
-
-void paged_bitmap::Setn(unsigned ix, unsigned len, unsigned bit)
-{
-	int l=len;
-	while (--l>=0)
-		Set(ix++,bit);
-}
-
-void paged_bitmap::Set(unsigned ix, unsigned len, unsigned val)
-{
-	int l=len;
-	while (--l>=0)
-		{
-		Set(ix++,val&1);
-		val>>=1;
-		}
-}
-
-unsigned paged_bitmap::Bits(unsigned ix, unsigned len) const
-{
-	int l=len;
-	unsigned val=0;
-	unsigned bit=0;
-	while (--l>=0)
-		val |= (*this)[ix++]<<bit++;
-	return val;
-}
-
-bool paged_bitmap::Is(unsigned ix, unsigned len, unsigned bit) const
-{
-	unsigned i2 = ix+len;
-	if (i2 > iNbits)
-		return false;
-	for (;;)
-		{
-		if ((*this)[ix] != bit)
-			return false;
-		if (++ix==i2)
-			return true;
-		}
-}
-
-int paged_bitmap::Find(unsigned start, unsigned bit) const
-{
-	if (start<iNbits) do
-		{
-		if ((*this)[start]==bit)
-			return start;
-		} while (++start<iNbits);
-	return -1;
-}
-
-
-//
-// Page allocator code
-//
-void RHybridHeap::PagedInit(TInt aPagePower)
-{
-	if (aPagePower > 0)
-		{
-		if (aPagePower < MINPAGEPOWER)
-			aPagePower = MINPAGEPOWER;
-		}
-	else aPagePower = 31;
-
-	iPageThreshold = aPagePower;
-	/*-------------------------------------------------------------
-	 * Initialize page bitmap
-	 *-------------------------------------------------------------*/
-	iPageMap.Init((unsigned char*)&iBitMapBuffer, MAXSMALLPAGEBITS, 0);
-}
-
-void* RHybridHeap::PagedAllocate(unsigned size)
-{
-	TInt nbytes = Ceiling(size, iPageSize);
-	void* p = Map(0, nbytes);
-	if (!p)
-		return 0;
-	if (!PagedSetSize(p, nbytes))
-		{
-		Unmap(p, nbytes);
-		return 0;
-		}
-	return p;
-}
-
-void* RHybridHeap::PagedReallocate(void* p, unsigned size, TInt mode)
-{
-	
-	HEAP_ASSERT(Ceiling(p, iPageSize) == p);
-	unsigned nbytes = Ceiling(size, iPageSize);
-	
-	unsigned osize = PagedSize(p);
-	if ( nbytes == 0 )  // Special case to handle shrinking below min page threshold 
-		nbytes = Min((1 << MINPAGEPOWER), osize);
-	
-	if (osize == nbytes)
-		return p;
-	
-	if (nbytes < osize)
-		{	// shrink in place, unmap final pages and rewrite the pagemap
-		Unmap(Offset(p, nbytes), osize-nbytes);
-		// zap old code and then write new code (will not fail)
-		PagedZapSize(p, osize);
-
-		TBool check = PagedSetSize(p, nbytes);
-        __ASSERT_ALWAYS(check, HEAP_PANIC(ETHeapBadCellAddress));
-		
-		return p;
-		}
-	
-	// nbytes > osize
-	// try and extend current region first
-			
-	void* newp = Map(Offset(p, osize), nbytes-osize);
-	if (newp)
-		{	// In place growth. Possibility that pagemap may have to grow AND then fails
-		if (!PagedSetSize(p, nbytes))
-			{	// must release extra mapping
-			Unmap(Offset(p, osize), nbytes-osize);
-			return 0;
-			}
-		// if successful, the new length code will have overwritten the old one (it is at least as long)
-		return p;
-		}
-	
-	// fallback to  allocate/copy/free
-	if (mode & ENeverMove)
-		return 0;		// not allowed to move cell
-	
-	newp = PagedAllocate(nbytes);
-	if (!newp)
-		return 0;
-	memcpy(newp, p, osize);
-	PagedFree(p);
-	return newp;
-}
-
-void RHybridHeap::PagedFree(void* p)
-{
-	HEAP_ASSERT(Ceiling(p, iPageSize) == p);
-
-	
-	unsigned size = PagedSize(p);
-	
-	PagedZapSize(p, size);		// clear page map
-	Unmap(p, size);
-}
-
-void RHybridHeap::PagedInfo(struct HeapInfo* i, SWalkInfo* wi) const
-{
-	for (int ix = 0;(ix = iPageMap.Find(ix,1)) >= 0;)
-		{
-		int npage = PagedDecode(ix);
-		// Introduce paged buffer to the walk function 
-		TAny* bfr = Bitmap2addr(ix);
-		int len = npage << PAGESHIFT;
-		if ( len > iPageSize )
-			{ // If buffer is not larger than one page it must be a slab page mapped into bitmap
-			i->iAllocBytes += len;
-			++i->iAllocN;
-			Walk(wi, bfr, len, EGoodAllocatedCell, EPageAllocator);
-			}
-		ix += (npage<<1);
-		}
-}
-
-void RHybridHeap::ResetBitmap()
-/*---------------------------------------------------------
- * Go through paged_bitmap and unmap all buffers to system
- * This method is called from RHybridHeap::Reset() to unmap all page
- * allocated - and slab pages which are stored in bitmap, too
- *---------------------------------------------------------*/ 
-{
-	unsigned iNbits = iPageMap.Size();
-	if ( iNbits )
-		{
-		for (int ix = 0;(ix = iPageMap.Find(ix,1)) >= 0;)
-			{
-			int npage = PagedDecode(ix);
-			void* p = Bitmap2addr(ix);
-			unsigned size = PagedSize(p);
-			PagedZapSize(p, size);		// clear page map
-			Unmap(p, size);
-			ix += (npage<<1);
-			}
-		if ( (TInt)iNbits > MAXSMALLPAGEBITS )
-			{
-			// unmap page reserved for enlarged bitmap
-			Unmap(iPageMap.Addr(), (iNbits >> 3) );
-			}
-		}
-}
-
-TBool RHybridHeap::CheckBitmap(void* aBfr, TInt aSize, TUint32& aDummy, TInt& aNPages)
-/*---------------------------------------------------------
- * If aBfr = NULL
- *   Go through paged_bitmap and unmap all buffers to system
- *   and assure that by reading the first word of each page of aBfr
- *   that aBfr is still accessible
- * else  
- *   Assure that specified buffer is mapped with correct length in
- *   page map
- *---------------------------------------------------------*/ 
-{
-	TBool ret;
-	if ( aBfr )
-		{
-		__ASSERT_ALWAYS((Ceiling(aBfr, iPageSize) == aBfr), HEAP_PANIC(ETHeapBadCellAddress));		
-        ret = ( aSize == (TInt)PagedSize(aBfr));
-		}
-	else
-		{
-		ret = ETrue;
-		unsigned iNbits = iPageMap.Size();
-		if ( iNbits )
-			{
-			TInt npage;
-			aNPages = 0;
-			for (int ix = 0;(ix = iPageMap.Find(ix,1)) >= 0;)
-				{
-				npage = PagedDecode(ix);
-				aNPages += npage;
-				void* p = Bitmap2addr(ix);
-				__ASSERT_ALWAYS((Ceiling(p, iPageSize) == p), HEAP_PANIC(ETHeapBadCellAddress));						
-				unsigned s = PagedSize(p);
-				__ASSERT_ALWAYS((Ceiling(s, iPageSize) == s), HEAP_PANIC(ETHeapBadCellAddress));	
-				while ( s )
-					{
-					aDummy += *(TUint32*)((TUint8*)p + (s-iPageSize));
-					s -= iPageSize;
-					}
-				ix += (npage<<1);
-				}
-			if ( (TInt)iNbits > MAXSMALLPAGEBITS )
-				{
-				// add enlarged bitmap page(s) to total page count
-                npage = (iNbits >> 3); 
-				__ASSERT_ALWAYS((Ceiling(npage, iPageSize) == npage), HEAP_PANIC(ETHeapBadCellAddress));
-				aNPages += (npage / iPageSize);
-				}
-			}
-		}
-	
-	return ret;
-}
-
-
-// The paged allocations are tracked in a bitmap which has 2 bits per page
-// this allows us to store allocations as small as 4KB
-// The presence and size of an allocation is encoded as follows:
-// let N = number of pages in the allocation, then
-// 10            : N = 1			// 4KB
-// 110n			 : N = 2 + n		// 8-12KB
-// 1110nnnn      : N = nnnn			// 16-60KB
-// 1111n[18]	 : N = n[18]		// 64KB-1GB
-
-const struct etab { unsigned char offset, len, codelen, code;} encode_table[] =
-{
-	{1,2,2,0x1},
-	{2,4,3,0x3},
-	{0,8,4,0x7},
-	{0,22,4,0xf}
-};
-
-// Return code length for specified allocation Size(assumed to be aligned to pages)
-inline unsigned paged_codelen(unsigned size, unsigned pagesz)
-{
-	HEAP_ASSERT(size == Ceiling(size, pagesz));
-	
-	if (size == pagesz)
-		return 2;
-	else if (size < 4*pagesz)
-		return 4;
-	else if (size < 16*pagesz)
-		return 8;
-	else
-		return 22;
-}
-
-inline const etab& paged_coding(unsigned npage)
-{
-	if (npage < 4)
-		return encode_table[npage>>1];
-	else if (npage < 16)
-		return encode_table[2];
-	else
-		return encode_table[3];
-}
-
-bool RHybridHeap::PagedEncode(unsigned pos, unsigned npage)
-{
-	const etab& e = paged_coding(npage);
-	if (pos + e.len > iPageMap.Size())
-		{
-		// need to grow the page bitmap to fit the cell length into the map
-		// if we outgrow original bitmap buffer in RHybridHeap metadata, then just get enough pages to cover the full space:
-		// * initial 68 byte bitmap mapped (68*8*4kB):2 = 1,1MB
-		// * 4KB can Map(4096*8*4kB):2 = 64MB
-		unsigned maxsize = Ceiling(iMaxLength, iPageSize);
-		unsigned mapbits = maxsize >> (PAGESHIFT-1);
-		maxsize = Ceiling(mapbits>>3, iPageSize);
-		void* newb = Map(0, maxsize);
-		if (!newb)
-			return false;
-		
-		unsigned char* oldb = iPageMap.Addr();
-		iPageMap.Init((unsigned char*)newb, (maxsize<<3), 0);
-		memcpy(newb, oldb, Ceiling(MAXSMALLPAGEBITS,8)>>3);
-		}
-	// encode the allocation block size into the bitmap, starting at the bit for the start page
-	unsigned bits = e.code;
-	bits |= (npage - e.offset) << e.codelen;
-	iPageMap.Set(pos, e.len, bits);
-	return true;
-}
-
-unsigned RHybridHeap::PagedDecode(unsigned pos) const
-{
-	__ASSERT_ALWAYS(pos + 2 <= iPageMap.Size(), HEAP_PANIC(ETHeapBadCellAddress));
-	
-	unsigned bits = iPageMap.Bits(pos,2);
-	__ASSERT_ALWAYS(bits & 1, HEAP_PANIC(ETHeapBadCellAddress));
-	bits >>= 1;
-	if (bits == 0)
-		return 1;
-	__ASSERT_ALWAYS(pos + 4 <= iPageMap.Size(), HEAP_PANIC(ETHeapBadCellAddress));
-	bits = iPageMap.Bits(pos+2,2);
-	if ((bits & 1) == 0)
-		return 2 + (bits>>1);
-	else if ((bits>>1) == 0)
-		{
-		__ASSERT_ALWAYS(pos + 8 <= iPageMap.Size(), HEAP_PANIC(ETHeapBadCellAddress));
-		return iPageMap.Bits(pos+4, 4);
-		}
-	else
-		{
-		__ASSERT_ALWAYS(pos + 22 <= iPageMap.Size(), HEAP_PANIC(ETHeapBadCellAddress));
-		return iPageMap.Bits(pos+4, 18);
-		}
-}
-
-inline void RHybridHeap::PagedZapSize(void* p, unsigned size)
-{iPageMap.Setn(PtrDiff(p, iMemBase) >> (PAGESHIFT-1), paged_codelen(size, iPageSize) ,0);}
-
-inline unsigned RHybridHeap::PagedSize(void* p) const
-   { return PagedDecode(PtrDiff(p, iMemBase) >> (PAGESHIFT-1)) << PAGESHIFT; }
-
-inline bool RHybridHeap::PagedSetSize(void* p, unsigned size)
-{ return PagedEncode(PtrDiff(p, iMemBase) >> (PAGESHIFT-1), size >> PAGESHIFT); }
-
-inline void* RHybridHeap::Bitmap2addr(unsigned pos) const
-   { return iMemBase + (1 << (PAGESHIFT-1))*pos; }
-
-
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-/**
-Constructor where minimum and maximum length of the heap can be defined.
-It defaults the chunk heap to be created to have use a new local chunk, 
-to have a grow by value of KMinHeapGrowBy, to be unaligned, not to be 
-single threaded and not to have any mode flags set.
-
-@param aMinLength    The minimum length of the heap to be created.
-@param aMaxLength    The maximum length to which the heap to be created can grow.
-                     If the supplied value is less than a page size, then it
-                     is discarded and the page size is used instead.
-*/
-EXPORT_C TChunkHeapCreateInfo::TChunkHeapCreateInfo(TInt aMinLength, TInt aMaxLength) :
-   iVersionNumber(EVersion0), iMinLength(aMinLength), iMaxLength(aMaxLength),
-iAlign(0), iGrowBy(1), iSingleThread(EFalse), 
-iOffset(0), iPaging(EUnspecified), iMode(0), iName(NULL)
-{
-}
-
-
-/**
-Sets the chunk heap to create a new chunk with the specified name.
-
-This overriddes any previous call to TChunkHeapCreateInfo::SetNewChunkHeap() or
-TChunkHeapCreateInfo::SetExistingChunkHeap() for this TChunkHeapCreateInfo object.
-
-@param aName	The name to be given to the chunk heap to be created
-If NULL, the function constructs a local chunk to host the heap.
-If not NULL, a pointer to a descriptor containing the name to be 
-assigned to the global chunk hosting the heap.
-*/
-EXPORT_C void TChunkHeapCreateInfo::SetCreateChunk(const TDesC* aName)
-{
-	iName = (TDesC*)aName;
-	iChunk.SetHandle(KNullHandle);
-}
-
-
-/**
-Sets the chunk heap to be created to use the chunk specified.
-
-This overriddes any previous call to TChunkHeapCreateInfo::SetNewChunkHeap() or
-TChunkHeapCreateInfo::SetExistingChunkHeap() for this TChunkHeapCreateInfo object.
-
-@param aChunk	A handle to the chunk to use for the heap.
-*/
-EXPORT_C void TChunkHeapCreateInfo::SetUseChunk(const RChunk aChunk)
-{
-	iName = NULL;
-	iChunk = aChunk;
-}
-
-EXPORT_C RHeap* UserHeap::FixedHeap(TAny* aBase, TInt aMaxLength, TInt aAlign, TBool aSingleThread)
-/**
-Creates a fixed length heap at a specified location.
-
-On successful return from this function, the heap is ready to use.  This assumes that
-the memory pointed to by aBase is mapped and able to be used.  You must ensure that you
-pass in a large enough value for aMaxLength.  Passing in a value that is too small to
-hold the metadata for the heap (~1 KB) will result in the size being rounded up and the
-heap thereby running over the end of the memory assigned to it.  But then if you were to
-pass in such as small value then you would not be able to do any allocations from the
-heap anyway.  Moral of the story: Use a sensible value for aMaxLength!
-
-@param aBase         A pointer to the location where the heap is to be constructed.
-@param aMaxLength    The maximum length in bytes to which the heap can grow.  If the
-                     supplied value is too small to hold the heap's metadata, it
-                     will be increased.
-@param aAlign        From Symbian^4 onwards, this value is ignored but EABI 8
-                     byte alignment is guaranteed for all allocations 8 bytes or
-                     more in size.  4 byte allocations will be aligned to a 4
-                     byte boundary.  Best to pass in zero.
-@param aSingleThread EFalse if the heap is to be accessed from multiple threads.
-                     This will cause internal locks to be created, guaranteeing
-                     thread safety.
-
-@return A pointer to the new heap, or NULL if the heap could not be created.
-
-@panic USER 56 if aMaxLength is negative.
-*/
-{
-	__ASSERT_ALWAYS( aMaxLength>=0, ::Panic(ETHeapMaxLengthNegative));
-	if ( aMaxLength < (TInt)sizeof(RHybridHeap) )
-		aMaxLength = sizeof(RHybridHeap);
-	
-	RHybridHeap* h = new(aBase) RHybridHeap(aMaxLength, aAlign, aSingleThread);
-	
-	if (!aSingleThread)
-		{
-		TInt r = h->iLock.CreateLocal();
-		if (r!=KErrNone)
-			return NULL; // No need to delete the RHybridHeap instance as the new above is only a placement new
-		h->iHandles = (TInt*)&h->iLock;
-		h->iHandleCount = 1;
-		}
-	return h;
-}
-
-/**
-Creates a chunk heap of the type specified by the parameter aCreateInfo.
-
-@param aCreateInfo	A reference to a TChunkHeapCreateInfo object specifying the
-type of chunk heap to create.
-
-@return A pointer to the new heap or NULL if the heap could not be created.
-
-@panic USER 41 if the heap's specified minimum length is greater than the specified maximum length.
-@panic USER 55 if the heap's specified minimum length is negative.
-@panic USER 172 if the heap's specified alignment is not a power of 2 or is less than the size of a TAny*.
-*/
-EXPORT_C RHeap* UserHeap::ChunkHeap(const TChunkHeapCreateInfo& aCreateInfo)
-{
-	// aCreateInfo must have been configured to use a new chunk or an exiting chunk.
-	__ASSERT_ALWAYS(!(aCreateInfo.iMode & (TUint32)~EChunkHeapMask), ::Panic(EHeapCreateInvalidMode));
-	RHeap* h = NULL;
-	
-	if (aCreateInfo.iChunk.Handle() == KNullHandle)
-		{
-		// A new chunk is to be created for this heap.
-		
-		__ASSERT_ALWAYS(aCreateInfo.iMinLength >= 0, ::Panic(ETHeapMinLengthNegative));
-		__ASSERT_ALWAYS(aCreateInfo.iMaxLength >= aCreateInfo.iMinLength, ::Panic(ETHeapCreateMaxLessThanMin));
-
-		TInt maxLength = aCreateInfo.iMaxLength;
-		TInt page_size;
-		GET_PAGE_SIZE(page_size);
-
-		if (maxLength < page_size)
-			maxLength = page_size;
-		
-		TChunkCreateInfo chunkInfo;
-#if USE_HYBRID_HEAP
-		if ( aCreateInfo.iOffset )
-			chunkInfo.SetNormal(0, maxLength);  // Create DL only heap
-		else
-			{
-			maxLength = 2*maxLength;
-			chunkInfo.SetDisconnected(0, 0, maxLength); // Create hybrid heap
-			}
-#else
-		chunkInfo.SetNormal(0, maxLength);  // Create DL only heap		
-#endif			
-		chunkInfo.SetOwner((aCreateInfo.iSingleThread)? EOwnerThread : EOwnerProcess);
-		if (aCreateInfo.iName)
-			chunkInfo.SetGlobal(*aCreateInfo.iName);
-		// Set the paging attributes of the chunk.
-		if (aCreateInfo.iPaging == TChunkHeapCreateInfo::EPaged)
-			chunkInfo.SetPaging(TChunkCreateInfo::EPaged);
-		if (aCreateInfo.iPaging == TChunkHeapCreateInfo::EUnpaged)
-			chunkInfo.SetPaging(TChunkCreateInfo::EUnpaged);
-		// Create the chunk.
-		RChunk chunk;
-		if (chunk.Create(chunkInfo) != KErrNone)
-			return NULL;
-		// Create the heap using the new chunk.
-		TUint mode = aCreateInfo.iMode | EChunkHeapDuplicate;	// Must duplicate the handle.
-		h = OffsetChunkHeap(chunk, aCreateInfo.iMinLength, aCreateInfo.iOffset,
-							aCreateInfo.iGrowBy, maxLength, aCreateInfo.iAlign,
-							aCreateInfo.iSingleThread, mode);
-		chunk.Close();
-		}
-	else
-		{
-		h = OffsetChunkHeap(aCreateInfo.iChunk, aCreateInfo.iMinLength, aCreateInfo.iOffset,
-							aCreateInfo.iGrowBy, aCreateInfo.iMaxLength, aCreateInfo.iAlign,
-							aCreateInfo.iSingleThread, aCreateInfo.iMode);
-		}
-	return h;
-}
-
-
-
-EXPORT_C RHeap* UserHeap::ChunkHeap(const TDesC* aName, TInt aMinLength, TInt aMaxLength, TInt aGrowBy, TInt aAlign, TBool aSingleThread)
-/**
-Creates a heap in a local or global chunk.
-
-The chunk hosting the heap can be local or global.
-
-A local chunk is one which is private to the process creating it and is not
-intended for access by other user processes.  A global chunk is one which is
-visible to all processes.
-
-The hosting chunk is local, if the pointer aName is NULL, otherwise the
-hosting chunk is global and the descriptor *aName is assumed to contain
-the name to be assigned to it.
-
-Ownership of the host chunk is vested in the current process.
-
-A minimum and a maximum size for the heap can be specified. On successful
-return from this function, the size of the heap is at least aMinLength.
-If subsequent requests for allocation of memory from the heap cannot be
-satisfied by compressing the heap, the size of the heap is extended in
-increments of aGrowBy until the request can be satisfied.  Attempts to extend
-the heap causes the size of the host chunk to be adjusted.
-
-Note that the size of the heap cannot be adjusted by more than aMaxLength.
-
-@param aName         If NULL, the function constructs a local chunk to host
-                     the heap.  If not NULL, a pointer to a descriptor containing
-                     the name to be assigned to the global chunk hosting the heap.
-@param aMinLength    The minimum length of the heap in bytes.  This will be
-                     rounded up to the nearest page size by the allocator.
-@param aMaxLength    The maximum length in bytes to which the heap can grow.  This
-                     will be rounded up to the nearest page size by the allocator.
-@param aGrowBy       The number of bytes by which the heap will grow when more
-                     memory is required.  This will be rounded up to the nearest
-                     page size by the allocator.  If a value is not explicitly
-                     specified, the page size is taken by default.
-@param aAlign        From Symbian^4 onwards, this value is ignored but EABI 8
-                     byte alignment is guaranteed for all allocations 8 bytes or
-                     more in size.  4 byte allocations will be aligned to a 4
-                     byte boundary.  Best to pass in zero.
-@param aSingleThread EFalse if the heap is to be accessed from multiple threads.
-                     This will cause internal locks to be created, guaranteeing
-                     thread safety.
-
-@return A pointer to the new heap or NULL if the heap could not be created.
-
-@panic USER 41 if aMaxLength is < aMinLength.
-@panic USER 55 if aMinLength is negative.
-@panic USER 56 if aMaxLength is negative.
-*/
-	{
-	TInt page_size;
-	GET_PAGE_SIZE(page_size);
-	TInt minLength = _ALIGN_UP(aMinLength, page_size);
-	TInt maxLength = Max(aMaxLength, minLength);
-
-	TChunkHeapCreateInfo createInfo(minLength, maxLength);
-	createInfo.SetCreateChunk(aName);
-	createInfo.SetGrowBy(aGrowBy);
-	createInfo.SetAlignment(aAlign);
-	createInfo.SetSingleThread(aSingleThread);
-
-	return ChunkHeap(createInfo);
-	}
-
-EXPORT_C RHeap* UserHeap::ChunkHeap(RChunk aChunk, TInt aMinLength, TInt aGrowBy, TInt aMaxLength, TInt aAlign, TBool aSingleThread, TUint32 aMode)
-/**
-Creates a heap in an existing chunk.
-
-This function is intended to be used to create a heap in a user writable code
-chunk as created by a call to RChunk::CreateLocalCode().  This type of heap can
-be used to hold code fragments from a JIT compiler.
-
-@param aChunk        The chunk that will host the heap.
-@param aMinLength    The minimum length of the heap in bytes.  This will be
-                     rounded up to the nearest page size by the allocator.
-@param aGrowBy       The number of bytes by which the heap will grow when more
-                     memory is required.  This will be rounded up to the nearest
-                     page size by the allocator.  If a value is not explicitly
-                     specified, the page size is taken by default.
-@param aMaxLength    The maximum length in bytes to which the heap can grow.  This
-                     will be rounded up to the nearest page size by the allocator.
-                     If 0 is passed in, the maximum lengt of the chunk is used.
-@param aAlign        From Symbian^4 onwards, this value is ignored but EABI 8
-                     byte alignment is guaranteed for all allocations 8 bytes or
-                     more in size.  4 byte allocations will be aligned to a 4
-                     byte boundary.  Best to pass in zero.
-@param aSingleThread EFalse if the heap is to be accessed from multiple threads.
-                     This will cause internal locks to be created, guaranteeing
-                     thread safety.
-@param aMode         Flags controlling the heap creation.  See RAllocator::TFlags.
-
-@return A pointer to the new heap or NULL if the heap could not be created.
-
-@see UserHeap::OffsetChunkHeap()
-*/
-	{
-	return OffsetChunkHeap(aChunk, aMinLength, 0, aGrowBy, aMaxLength, aAlign, aSingleThread, aMode);
-	}
-
-EXPORT_C RHeap* UserHeap::OffsetChunkHeap(RChunk aChunk, TInt aMinLength, TInt aOffset, TInt aGrowBy, TInt aMaxLength, TInt aAlign, TBool aSingleThread, TUint32 aMode)
-/**
-Creates a heap in an existing chunk, offset from the beginning of the chunk.
-
-This function is intended to be used to create a heap using a chunk which has
-some of its memory already used, at the start of that that chunk.  The maximum
-length to which the heap can grow is the maximum size of the chunk, minus the
-data at the start of the chunk.
-
-The offset at which to create the heap is passed in as the aOffset parameter.
-Legacy heap implementations always respected the aOffset value, however more
-modern heap implementations are more sophisticated and cannot necessarily respect
-this value.  Therefore, if possible, you should always use an aOffset of 0 unless
-you have a very explicit requirement for using a non zero value.  Using a non zero
-value will result in a less efficient heap algorithm being used in order to respect
-the offset.
-
-Another issue to consider when using this function is the type of the chunk passed
-in.  In order for the most efficient heap algorithms to be used, the chunk passed
-in should always be a disconnected chunk.  Passing in a non disconnected chunk will
-again result in a less efficient heap algorithm being used.
-
-Finally, another requirement for the most efficient heap algorithms to be used is
-for the heap to be able to expand.  Therefore, unless you have a specific reason to
-do so, always specify aMaxLength > aMinLength.
-
-So, if possible, use aOffset == zero, aMaxLength > aMinLength and a disconnected
-chunk for best results!
-
-@param aChunk        The chunk that will host the heap.
-@param aMinLength    The minimum length of the heap in bytes.  This will be
-                     rounded up to the nearest page size by the allocator.
-@param aOffset       The offset in bytes from the start of the chunk at which to
-                     create the heap.  If used (and it shouldn't really be!)
-                     then it will be rounded up to a multiple of 8, to respect
-                     EABI 8 byte alignment requirements.
-@param aGrowBy       The number of bytes by which the heap will grow when more
-                     memory is required.  This will be rounded up to the nearest
-                     page size by the allocator.  If a value is not explicitly
-                     specified, the page size is taken by default.
-@param aMaxLength    The maximum length in bytes to which the heap can grow.  This
-                     will be rounded up to the nearest page size by the allocator.
-                     If 0 is passed in, the maximum length of the chunk is used.
-@param aAlign        From Symbian^4 onwards, this value is ignored but EABI 8
-                     byte alignment is guaranteed for all allocations 8 bytes or
-                     more in size.  4 byte allocations will be aligned to a 4
-                     byte boundary.  Best to pass in zero.
-@param aSingleThread EFalse if the heap is to be accessed from multiple threads.
-                     This will cause internal locks to be created, guaranteeing
-                     thread safety.
-@param aMode         Flags controlling the heap creation.  See RAllocator::TFlags.
-
-@return A pointer to the new heap or NULL if the heap could not be created.
-
-@panic USER 41 if aMaxLength is < aMinLength.
-@panic USER 55 if aMinLength is negative.
-@panic USER 56 if aMaxLength is negative.
-@panic USER 168 if aOffset is negative.
-*/
-	{
-	TBool dlOnly = EFalse;
-	TInt pageSize;
-	GET_PAGE_SIZE(pageSize);
-	TInt align = RHybridHeap::ECellAlignment; // Always use EABI 8 byte alignment
-
-	__ASSERT_ALWAYS(aMinLength>=0, ::Panic(ETHeapMinLengthNegative));
-	__ASSERT_ALWAYS(aMaxLength>=0, ::Panic(ETHeapMaxLengthNegative));
-
-	if ( aMaxLength > 0 ) 
-		__ASSERT_ALWAYS(aMaxLength>=aMinLength, ::Panic(ETHeapCreateMaxLessThanMin));
-
-	// Stick to EABI alignment for the start offset, if any
-	aOffset = _ALIGN_UP(aOffset, align);
-
-	// Using an aOffset > 0 means that we can't use the hybrid allocator and have to revert to Doug Lea only
-	if (aOffset > 0)
-		dlOnly = ETrue;
-
-	// Ensure that the minimum length is enough to hold the RHybridHeap object itself
-	TInt minCell = _ALIGN_UP(Max((TInt)RHybridHeap::EAllocCellSize, (TInt)RHybridHeap::EFreeCellSize), align);
-	TInt hybridHeapSize = (sizeof(RHybridHeap) + minCell);
-	if (aMinLength < hybridHeapSize)
-		aMinLength = hybridHeapSize;
-
-	// Round the minimum length up to a multiple of the page size, taking into account that the
-	// offset takes up a part of the chunk's memory
-	aMinLength = _ALIGN_UP((aMinLength + aOffset), pageSize);
-
-	// If aMaxLength is 0 then use the entire chunk
-	TInt chunkSize = aChunk.MaxSize();
-	if (aMaxLength == 0)
-		{
-		aMaxLength = chunkSize;
-		}
-	// Otherwise round the maximum length up to a multiple of the page size, taking into account that
-	// the offset takes up a part of the chunk's memory.  We also clip the maximum length to the chunk
-	// size, so the user may get a little less than requested if the chunk size is not large enough
-	else
-		{
-		aMaxLength = _ALIGN_UP((aMaxLength + aOffset), pageSize);
-		if (aMaxLength > chunkSize)
-			aMaxLength = chunkSize;
-		}
-	
-	// If the rounded up values don't make sense then a crazy aMinLength or aOffset must have been passed
-	// in, so fail the heap creation
-	if (aMinLength > aMaxLength)
-		return NULL;
-
-	// Adding the offset into the minimum and maximum length was only necessary for ensuring a good fit of
-	// the heap into the chunk.  Re-adjust them now back to non offset relative sizes
-	aMinLength -= aOffset;
-	aMaxLength -= aOffset;
-
-	// If we are still creating the hybrid allocator (call parameter
-	// aOffset is 0 and aMaxLength > aMinLength), we must reduce heap
-	// aMaxLength size to the value aMaxLength/2 and set the aOffset to point in the middle of chunk.
-	TInt offset = aOffset;
-	TInt maxLength = aMaxLength;
-	if (!dlOnly && (aMaxLength > aMinLength))
-		maxLength = offset = _ALIGN_UP(aMaxLength >> 1, pageSize);
-
-	// Try to use commit to map aMinLength physical memory for the heap, taking into account the offset.  If
-	// the operation fails, suppose that the chunk is not a disconnected heap and try to map physical memory
-	// with adjust.  In this case, we also can't use the hybrid allocator and have to revert to Doug Lea only
-	TBool useAdjust = EFalse;
-	TInt r = aChunk.Commit(offset, aMinLength);
-	if (r == KErrGeneral)
-		{
-		dlOnly = useAdjust = ETrue;
-		r = aChunk.Adjust(aMinLength);
-		if (r != KErrNone)
-			return NULL;
-		}
-	else if (r == KErrNone)
-		{
-		// We have a disconnected chunk reset aOffset and aMaxlength
-		aOffset = offset;
-		aMaxLength = maxLength;
-		}
-
-	else
-		return NULL;
-
-	// Parameters have been mostly verified and we know whether to use the hybrid allocator or Doug Lea only.  The
-	// constructor for the hybrid heap will automatically drop back to Doug Lea if it determines that aMinLength
-	// == aMaxLength, so no need to worry about that requirement here.  The user specified alignment is not used but
-	// is passed in so that it can be sanity checked in case the user is doing something totally crazy with it
-	RHybridHeap* h = new (aChunk.Base() + aOffset) RHybridHeap(aChunk.Handle(), aOffset, aMinLength, aMaxLength,
-		aGrowBy, aAlign, aSingleThread, dlOnly, useAdjust);
-
-	if (h->ConstructLock(aMode) != KErrNone)
-		return NULL;
-
-	// Return the heap address
-	return h;
-	}
-
-#define UserTestDebugMaskBit(bit) (TBool)(UserSvr::DebugMask(bit>>5) & (1<<(bit&31)))
-
-_LIT(KLitDollarHeap,"$HEAP");
-EXPORT_C TInt UserHeap::CreateThreadHeap(SStdEpocThreadCreateInfo& aInfo, RHeap*& aHeap, TInt aAlign, TBool aSingleThread)
-/**
-@internalComponent
-*/
-//
-// Create a user-side heap
-//
-{
-	TInt page_size;
-	GET_PAGE_SIZE(page_size);
-	TInt minLength = _ALIGN_UP(aInfo.iHeapInitialSize, page_size);
-	TInt maxLength = Max(aInfo.iHeapMaxSize, minLength);
-	if (UserTestDebugMaskBit(96)) // 96 == KUSERHEAPTRACE in nk_trace.h
-		aInfo.iFlags |= ETraceHeapAllocs;
-	// Create the thread's heap chunk.
-	RChunk c;
-	TChunkCreateInfo createInfo;
-
-	createInfo.SetThreadHeap(0, maxLength, KLitDollarHeap());	// Initialise with no memory committed.	
-#if USE_HYBRID_HEAP
-	//
-	// Create disconnected chunk for hybrid heap with double max length value
-	//
-	maxLength = 2*maxLength;
-	createInfo.SetDisconnected(0, 0, maxLength);
-#endif	
-	// Set the paging policy of the heap chunk based on the thread's paging policy.
-	TUint pagingflags = aInfo.iFlags & EThreadCreateFlagPagingMask;
-	switch (pagingflags)
-		{
-		case EThreadCreateFlagPaged:
-			createInfo.SetPaging(TChunkCreateInfo::EPaged);
-			break;
-		case EThreadCreateFlagUnpaged:
-			createInfo.SetPaging(TChunkCreateInfo::EUnpaged);
-			break;
-		case EThreadCreateFlagPagingUnspec:
-			// Leave the chunk paging policy unspecified so the process's 
-			// paging policy is used.
-			break;
-		}
-	
-	TInt r = c.Create(createInfo);
-	if (r!=KErrNone)
-		return r;
-	
-	aHeap = ChunkHeap(c, minLength, page_size, maxLength, aAlign, aSingleThread, EChunkHeapSwitchTo|EChunkHeapDuplicate);
-	c.Close();
-	
-	if ( !aHeap )
-		return KErrNoMemory;
-	
-	if (aInfo.iFlags & ETraceHeapAllocs)
-		{
-		aHeap->iFlags |= RHeap::ETraceAllocs;
-    	BTraceContext8(BTrace::EHeap, BTrace::EHeapCreate,(TUint32)aHeap, RHybridHeap::EAllocCellSize);
-		TInt chunkId = ((RHandleBase&)((RHybridHeap*)aHeap)->iChunkHandle).BTraceId();
-		BTraceContext8(BTrace::EHeap, BTrace::EHeapChunkCreate, (TUint32)aHeap, chunkId);
-		}
-	if (aInfo.iFlags & EMonitorHeapMemory)
-		aHeap->iFlags |= RHeap::EMonitorMemory;
-	
-	return KErrNone;
-}
-
-#endif  // __KERNEL_MODE__
--- a/kernel/eka/common/mem.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/common/mem.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -26,8 +26,6 @@
 
 extern "C" {
 
-#ifndef __MEMMOVE_MACHINE_CODED__
-
 // See header file e32cmn.h for the in-source documentation.
 EXPORT_C TAny* memcpy(TAny* aTrg, const TAny* aSrc, unsigned int aLength)
 	{
@@ -76,7 +74,7 @@
 	return aTrg;
 	}
 
-#endif // ! __MEMMOVE_MACHINE_CODED__
+
 
 // See header file e32cmn.h for the in-source documentation.
 EXPORT_C TAny* memclr(TAny* aTrg, unsigned int aLength)
--- a/kernel/eka/common/win32/cmem.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +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:
-// e32\common\win32\cmem.cpp
-//
-//
-
-#include "common.h"
-
-#ifdef __MEMMOVE_MACHINE_CODED__
-
-extern "C" {
-
-// See header file e32cmn.h for the in-source documentation.
-EXPORT_C __NAKED__ TAny* memmove(TAny* , const TAny* , unsigned int)
-	{
-	_asm push      ebx							; // Save used registers
-	_asm push      esi
-	_asm push      edi
-	_asm push      ebp
-
-	_asm cmp       dword ptr [esp+0x1c],0x0		; // Is aLength == 0?
-	_asm mov       eax,dword ptr [esp+0x14]		; // Ptr to destination
-	_asm mov       ebx,dword ptr [esp+0x18]		; // Ptr to source
-	_asm je        End							; // aLength is 0, just return
-
-	_asm mov       ecx,eax						; // Copy destination
-	_asm xor       ebp,ebp						; // ebp = 0
-	_asm test      ecx,0x3						; // Dest word aligned?
-	_asm mov       edx,ebx						; // Copy ptr to source
-	_asm jne       Misaligned					; // No
-	_asm test      edx,0x3						; // Source word aligned?
-	_asm jne       Misaligned					; // No
-	_asm mov       ebp,dword ptr [esp+0x1c]		; // ebp = aLength
-	_asm shr       ebp,0x2						; // ebp = aLength in words
-
-Misaligned:
-
-	_asm lea       edx,dword ptr [ebp*4+0x0]	; // edx = aLength in words
-	_asm sal       ebp,0x2						; // ebp = aLength in bytes
-	_asm add       ebp,ecx						; // Point to end of destination
-	_asm mov       edi,dword ptr [esp+0x1c]		; // Get number of bytes to copy
-	_asm sub       edi,edx						; // Find remainder (aLength % 3)
-	_asm cmp       eax,ebx						; // Dest >= source?
-	_asm mov       edx,ebp						; // Ptr to end of destination
-	_asm jae       DoDescendingCopy				; // Yes, copy downwards
-
-	_asm jmp       AscendingCopy				; // No, copy upwards
-
-AscendingCopyLoop:
-
-	_asm mov       ebp,dword ptr [ebx]			; // Get a word
-	_asm mov       dword ptr [ecx],ebp			; // And store it
-	_asm add       ebx,0x4						; // Increment source by a word
-	_asm add       ecx,0x4						; // Increment destination by a word
-
-AscendingCopy:
-
-	_asm cmp       ecx,edx						; // Still data to copy?
-	_asm jb        AscendingCopyLoop			; // Yes
-
-	_asm mov       ebp,eax						; // Copy ptr to destination
-	_asm add       ebp,dword ptr [esp+0x1c]		; // Point to end of destination
-	_asm jmp       CopyRemainder				; // Copy left over (aLength % 3) bytes
-
-CopyRemainderLoop:
-
-	_asm movzx     edx,byte ptr [ebx]			; // Get a byte
-	_asm mov       byte ptr [ecx],dl			; // And store it
-	_asm inc       ebx							; // Increment source by a byte
-	_asm inc       ecx							; // Increment destination by a byte
-
-CopyRemainder:
-
-	_asm cmp       ecx,ebp						; // Any remaining bytes to copy?
-	_asm jb        CopyRemainderLoop			; // Yes, go do it
-
-	_asm jmp       End							; // All done
-
-DoDescendingCopy:
-
-	_asm cmp       eax,ebx						; // Still data to copy?
-	_asm jbe       End							; // No, all done
-
-	_asm lea       esi,dword ptr [edi+ebp]		; // Get ptr to end of destination
-	_asm mov       edi,ebx						; // Get ptr to source
-	_asm add       edi,dword ptr [esp+0x1c]		; // Point to end of source
-	_asm jmp       DescendingCopyRemainder		; // Copy copy some data
-
-DescendingCopyRemainderLoop:
-
-	_asm dec       edi							; // Decrement source by a byte
-	_asm dec       esi							; // Decrement dest by a byte
-	_asm movzx     ebx,byte ptr [edi]			; // Get a byte
-	_asm mov       byte ptr [esi],bl			; // And store it
-
-DescendingCopyRemainder:
-
-	_asm cmp       esi,ebp						; // Still data to copy?
-	_asm ja        DescendingCopyRemainderLoop	; // Yes, go do it
-
-	_asm jmp       DescendingCopy				; // Go copy the bulk of the data
-
-DescendingCopyLoop:
-
-	_asm sub       edi,0x4						; // Decrement source by a word
-	_asm sub       edx,0x4						; // Decrement dest by a word
-	_asm mov       ebx,dword ptr [edi]			; // Get a word
-	_asm mov       dword ptr [edx],ebx			; // And store it
-
-DescendingCopy:
-
-	_asm cmp       edx,ecx						; // Still data to copy
-	_asm ja        DescendingCopyLoop			; // Yes, go do it
-
-End:
-
-	_asm pop       ebp							; // Restore used registers
-	_asm pop       edi
-	_asm pop       esi
-	_asm pop       ebx
-	_asm ret
-	}
-
-// See header file e32cmn.h for the in-source documentation.
-EXPORT_C __NAKED__ TAny* memcpy(TAny* , const TAny* , unsigned int)
-	{
-	__asm jmp (memmove);						; // memmove() will perform the same function
-	}
-}
-
-#endif // defined(__MEMMOVE_MACHINE_CODED__)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/compsupp/ARM EABI LICENCE.txt	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,130 @@
+The Specimen Implementations of the Exception Handling Components of the ABI for the ARM(R) Architecture consists of copyright owned by ARM Limited and copyright owned by Nokia Corporation. Each is licensed to you separately by the respective copyright owner, on the terms set out in this file.
+
+1. LICENSE TO ARM COPYRIGHT
+
+IMPORTANT: THIS IS A LEGAL AGREEMENT ("LICENCE") BETWEEN YOU (AN INDIVIDUAL OR
+SINGLE ENTITY WHO IS RECEIVING THIS SOURCE CODE DIRECTLY FROM ARM LIMITED)
+("LICENSEE") AND ARM LIMITED ("ARM") FOR THE VERSION OF THE SOURCE CODE SUPPLIED
+WITH THIS LICENCE ("SOURCE CODE"). THE SOURCE CODE IS A SPECIMEN IMPLEMENTATION OF
+EXCEPTION HANDLING COMPONENTS COMPLYING WITH THE SPECIFICATION DEFINED IMMEDIATELY
+BELOW. BY DOWNLOADING OR OTHERWISE USING THE SOURCE CODE, YOU AGREE TO BE BOUND BY
+ALL OF THE TERMS OF THIS LICENCE. IF YOU DO NOT AGREE TO THIS, DO NOT DOWNLOAD OR
+USE THE SOURCE CODE.
+
+“Specification” means, and is limited to, version 2 of the specification for the
+Applications Binary Interface for the ARM Architecture published by ARM.
+Notwithstanding the foregoing,  Specification” shall not include (i) the
+implementation of other published specifications referenced in this  Specification;
+(ii) any enabling technologies that may be necessary to make or use any product or
+portion thereof that complies with this Specification, but are not themselves
+expressly set forth in this Specification (e.g. compiler front ends, code
+generators, back ends, libraries or other compiler, assembler or linker
+technologies; validation or debug software or hardware; applications, operating
+system or driver software; RISC architecture; processor microarchitecture);
+(iii) maskworks and physical layouts of integrated circuit designs; or (iv) RTL or
+other high level representations of integrated circuit designs.
+
+Use, copying or disclosure by the US Government is subject to the restrictions set
+out in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software
+clause at DFARS 252.227-7013 or subparagraphs (c)(1) and (2) of the Commercial
+Computer Software - Restricted Rights at 48 C.F.R. 52.227-19, as applicable.
+
+The Source Code is owned by ARM or its licensors and is protected by copyright laws
+and international copyright treaties as well as other intellectual property laws and
+treaties. The Source Code is licensed not sold.
+
+1.  Subject to the provisions of Clauses 2 and 3, ARM hereby grants to LICENSEE,
+under any intellectual property that is (i) owned or freely licensable by ARM
+without payment to unaffiliated third parties and (ii) either embodied in the Source
+Code, or Necessary to copy or implement an applications binary interface compliant
+with the Specification, a perpetual, non-exclusive, non-transferable, fully paid,
+worldwide limited licence to use, copy, modify and sublicense this Source Code (in
+source or object code form) solely for the purpose of developing, having developed,
+manufacturing, having manufactured, offering to sell, selling, supplying or
+otherwise distributing products which comply with the Specification, provided that
+LICENSEE preserves all copyright notices included in the Source Code. All other
+rights are reserved to ARM or its licensors.
+
+2. THIS SOURCE CODE IS PROVIDED "AS IS" WITH NO WARRANTIES EXPRESS, IMPLIED OR
+STATUTORY, INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF SATISFACTORY QUALITY,
+MERCHANTABILITY, NONINFRINGEMENT OR FITNESS FOR A PARTICULAR PURPOSE. THE SOURCE
+CODE MAY INCLUDE ERRORS. ARM RESERVES THE RIGHT TO INCORPORATE MODIFICATIONS TO THE
+SOURCE CODE IN LATER REVISIONS OF IT, AND TO MAKE IMPROVEMENTS OR CHANGES IN THE
+SPECIFICATION OR THE PRODUCTS OR TECHNOLOGIES DESCRIBED THEREIN AT ANY TIME.
+
+3.  This Licence shall immediately terminate and shall be unavailable to LICENSEE if
+LICENSEE or any party affiliated to LICENSEE asserts any patents against ARM, ARM
+affiliates, third parties who have a valid licence from ARM for the Specification or
+the Source Code, or any customers or distributors of any of them based upon a claim
+that a LICENSEE (or LICENSEE affiliate) patent is Necessary to implement the
+Specification. In this Licence; (i) "affiliate" means any entity controlling,
+controlled by or under common control with a party (in fact or in law, via voting
+securities, management control or otherwise) and "affiliated" shall be construed
+accordingly; (ii) "assert" means to allege infringement in legal or administrative
+proceedings, or proceedings before any other competent trade, arbitral or
+international authority; (iii) “Necessary” means with respect to any claims of any
+patent, those claims which, without the appropriate permission of the patent owner,
+will be infringed when implementing the Specification because no alternative,
+commercially reasonable, non-infringing way of implementing the Specification is
+known; and (iv) English law and the jurisdiction of the English courts shall apply
+to all aspects of this Licence, its interpretation and enforcement. The total
+liability of ARM and any of its suppliers and licensors under or in relation to this
+Licence shall be limited to the greater of the amount actually paid by LICENSEE for
+the Specification or US$10.00. The limitations, exclusions and disclaimers in this
+Licence shall apply to the maximum extent allowed by applicable law.
+
+
+ARM contract reference number LEC-ELA-00080-V2.0.
+
+
+2. LICENSE TO NOKIA COPYRIGHT
+
+IMPORTANT: THIS IS A LEGAL AGREEMENT ("LICENCE") BETWEEN YOU (AN INDIVIDUAL OR
+SINGLE ENTITY WHO IS RECEIVING THIS SOURCE CODE FROM NOKIA CORPORATION)
+("LICENSEE") AND NOKIA CORPORATION ("NOKIA") FOR THE VERSION OF THE SOURCE CODE SUPPLIED WITH THIS LICENCE ("SOURCE CODE"). THE SOURCE CODE IS A SPECIMEN IMPLEMENTATION OF EXCEPTION HANDLING COMPONENTS COMPLYING WITH THE SPECIFICATION DEFINED IMMEDIATELY BELOW. BY DOWNLOADING OR OTHERWISE USING THE SOURCE CODE, YOU AGREE TO BE BOUND BY ALL OF THE TERMS OF THIS LICENCE. IF YOU DO NOT AGREE TO THIS, DO NOT DOWNLOAD OR USE THE SOURCE CODE.
+
+“Specification” means, and is limited to, version 2 of the specification for the
+Applications Binary Interface for the ARM Architecture published by ARM LIMITED.
+Notwithstanding the foregoing,  Specification” shall not include (i) the
+implementation of other published specifications referenced in this Specification;
+(ii) any enabling technologies that may be necessary to make or use any product or
+portion thereof that complies with this Specification, but are not themselves
+expressly set forth in this Specification (e.g. compiler front ends, code
+generators, back ends, libraries or other compiler, assembler or linker
+technologies; validation or debug software or hardware; applications, operating
+system or driver software; RISC architecture; processor microarchitecture);
+(iii) maskworks and physical layouts of integrated circuit designs; or (iv) RTL or
+other high level representations of integrated circuit designs.
+
+Use, copying or disclosure by the US Government is subject to the restrictions set
+out in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software
+clause at DFARS 252.227-7013 or subparagraphs (c)(1) and (2) of the Commercial
+Computer Software - Restricted Rights at 48 C.F.R. 52.227-19, as applicable.
+
+The Source Code is owned by Nokia or its licensors and is protected by copyright laws
+and international copyright treaties as well as other intellectual property laws and
+treaties. The Source Code is licensed not sold.
+
+1.  Subject to the provisions of Clauses 2 and 3, Nokia hereby grants to LICENSEE,
+under any intellectual property that is (i) owned or freely licensable by Nokia
+without payment to unaffiliated third parties and (ii) either embodied in the Source
+Code, or Necessary to copy or implement an applications binary interface compliant
+with the Specification, a perpetual, non-exclusive, non-transferable, fully paid,
+worldwide limited licence to use, copy, modify and sublicense this Source Code (in
+source or object code form) solely for the purpose of developing, having developed,
+manufacturing, having manufactured, offering to sell, selling, supplying or
+otherwise distributing products which comply with the Specification, provided that
+LICENSEE preserves all copyright notices included in the Source Code. All other
+rights are reserved to Nokia or its licensors.
+
+2. THIS SOURCE CODE IS PROVIDED "AS IS" WITH NO WARRANTIES EXPRESS, IMPLIED OR
+STATUTORY, INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF SATISFACTORY QUALITY,
+MERCHANTABILITY, NONINFRINGEMENT OR FITNESS FOR A PARTICULAR PURPOSE. THE SOURCE
+CODE MAY INCLUDE ERRORS. ARM RESERVES THE RIGHT TO INCORPORATE MODIFICATIONS TO THE
+SOURCE CODE IN LATER REVISIONS OF IT, AND TO MAKE IMPROVEMENTS OR CHANGES IN THE
+SPECIFICATION OR THE PRODUCTS OR TECHNOLOGIES DESCRIBED THEREIN AT ANY TIME.
+
+3.  English law and the jurisdiction of the English courts shall apply
+to all aspects of this Licence, its interpretation and enforcement. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL NOKIA, ITS EMPLOYEES OR LICENSORS OR AFFILIATES BE LIABLE FOR ANY LOST PROFITS, REVENUE, SALES, DATA, OR COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, PROPERTY DAMAGE, PERSONAL INJURY, INTERRUPTION OF BUSINESS, LOSS OF BUSINESS INFORMATION, OR FOR ANY SPECIAL, DIRECT, INDIRECT, INCIDENTAL, ECONOMIC, COVER, PUNITIVE, OR CONSEQUENTIAL DAMAGES, HOWEVER CAUSED AND WHETHER ARISING UNDER CONTRACT, TORT, NEGLIGENCE, OR OTHER THEORY OF LIABILITY ARISING OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE, EVEN IF NOKIA OR ITS LICENSORS OR AFFILIATES ARE ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. BECAUSE SOME COUNTRIES/STATES/JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF LIABILITY, BUT MAY ALLOW LIABILITY TO BE LIMITED, IN SUCH CASES, NOKIA, ITS EMPLOYEES OR LICENSORS OR AFFILIATES' LIABILITY SHALL BE LIMITED TO U.S. $50. Nothing contained in this Agreement shall prejudice the statutory rights of any party dealing as a consumer. Nothing contained in this Agreement limits Nokia's liability to You in the event of death or personal injury resulting from Nokia's negligence. Nokia is acting on behalf of its employees and licensors or affiliates for the purpose of disclaiming, excluding, and/or restricting obligations, warranties, and liability as provided in this clause 9, but in no other respects and for no other purpose.
+
+</End>
--- a/kernel/eka/debug/crashMonitor/inc/crashlogwalker.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/debug/crashMonitor/inc/crashlogwalker.h	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -23,6 +23,7 @@
 #define __CRASH_LOG_WALKER_H_INCLUDED__
 
 #include <e32cmn.h> 
+#include <rm_debug_api.h>
 
 #include <scmdatatypes.h>
 
--- a/kernel/eka/debug/crashMonitor/inc/scmbytestreamutil.inl	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/debug/crashMonitor/inc/scmbytestreamutil.inl	Wed Sep 01 12:34:56 2010 +0100
@@ -62,9 +62,7 @@
 	 */		
 	inline TUint64 TByteStreamReader::ReadInt64()
 		{
-		TUint32 high = ReadInt();
-		TUint32 low = ReadInt();
-		return  MAKE_TUINT64(high, low) ;
+		return  MAKE_TUINT64(ReadInt(), ReadInt()) ;
 		}
 	
 	/**
--- a/kernel/eka/debug/crashMonitor/inc/scmdatatypes.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/debug/crashMonitor/inc/scmdatatypes.h	Wed Sep 01 12:34:56 2010 +0100
@@ -22,7 +22,7 @@
 #ifndef __SCMDATATYPES_H_INCLUDED__
 #define __SCMDATATYPES_H_INCLUDED__
 
-
+#include <rm_debug_api.h>
 #include <e32rom.h>
 
 #include <scmbytestreamutil.h>
@@ -45,88 +45,6 @@
 	static const TInt KSCMDataTypesBuildNumber = 0;
 
 	/**
-	  Specifies the type of a code segment.
-	  @see TCodeSegListEntry
-	  */
-	enum TCodeSegType
-	    {
-	    EUnknownCodeSegType = 0, /**< Signifies an unknown code segment type. */
-	    EExeCodeSegType = 1,     /**< Signifies a code segment belonging to an executable. */
-	    EDllCodeSegType = 2      /**< Signifies a code segment belonging to a library. */
-	    };
-	
-	
-	/**
-	  Used for storing the contents of a 32 bit register
-	  */
-	typedef TUint32 TRegisterValue32;
-	
-	/**
-	  Structure containing information about the state of the registers when a
-	  hardware exception occurred
-	  */
-	class TRmdArmExcInfo
-	    {
-	public:
-	    /** Enumeration detailing the types of exception which may occur. */
-	    enum TExceptionType
-	        {
-	        /** Enumerator signifying that a prefetch abort error has occurred. */
-	        EPrefetchAbort = 0,
-	        /** Enumerator signifying that a data abort error has occurred. */
-	        EDataAbort = 1,
-	        /** Enumerator signifying that an undefined instruction error has occurred. */
-	        EUndef =2
-	        };
-
-	    /** Value of CPSR. */
-	    TRegisterValue32 iCpsr;
-	    /** Type of exception which has occurred. */
-	    TExceptionType iExcCode;
-	    /** Value of R13 supervisor mode banked register. */
-	    TRegisterValue32 iR13Svc;
-	    /** Value of user mode register R4. */
-	    TRegisterValue32 iR4;
-	    /** Value of user mode register R5. */
-	    TRegisterValue32 iR5;
-	    /** Value of user mode register R6. */
-	    TRegisterValue32 iR6;
-	    /** Value of user mode register R7. */
-	    TRegisterValue32 iR7;
-	    /** Value of user mode register R8. */
-	    TRegisterValue32 iR8;
-	    /** Value of user mode register R9. */
-	    TRegisterValue32 iR9;
-	    /** Value of user mode register R10. */
-	    TRegisterValue32 iR10;
-	    /** Value of user mode register R11. */
-	    TRegisterValue32 iR11;
-	    /** Value of R14 supervisor mode banked register. */
-	    TRegisterValue32 iR14Svc;
-	    /** Address which caused exception (System Control Coprocessor Fault Address Register) */
-	    TRegisterValue32 iFaultAddress;
-	    /** Value of System Control Coprocessor Fault Status Register. */
-	    TRegisterValue32 iFaultStatus;
-	    /** Value of SPSR supervisor mode banked register. */
-	    TRegisterValue32 iSpsrSvc;
-	    /** Value of user mode register R13. */
-	    TRegisterValue32 iR13;
-	    /** Value of user mode register R14. */
-	    TRegisterValue32 iR14;
-	    /** Value of user mode register R0. */
-	    TRegisterValue32 iR0;
-	    /** Value of user mode register R1. */
-	    TRegisterValue32 iR1;
-	    /** Value of user mode register R2. */
-	    TRegisterValue32 iR2;
-	    /** Value of user mode register R3. */
-	    TRegisterValue32 iR3;
-	    /** Value of user mode register R12. */
-	    TRegisterValue32 iR12;
-	    /** Value of user mode register R15, points to instruction which caused exception. */
-	    TRegisterValue32 iR15;
-	    };
-	/**
 	 * This enum defines the type of struct we are dealing with when we
 	 * are serialising/deserialising
 	 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/debug/securityServer/group/rm_debug_svr.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,48 @@
+// 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:
+//
+
+ALWAYS_BUILD_AS_ARM 
+
+target         rm_debug_svr.exe
+targettype     exe
+
+sourcepath	   	../src
+source		c_shutdown_timer.cpp
+source		c_process_pair.cpp
+source        	c_security_svr_server.cpp 
+source        	c_security_svr_session.cpp 
+source		c_security_svr_async.cpp
+source        	rm_debug_svr.cpp
+
+library		euser.lib
+library         efsrv.lib
+library         btracec.lib
+
+userinclude ../inc
+userinclude ../../../include
+userinclude ../../../include/drivers
+SYMBIAN_BASE_SYSTEMINCLUDE(nkern)
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+UID            0x100039CE 0x102834E2
+SECUREID       0x102834E2
+VENDORID       0x70000001
+
+
+// Enables UTrace logging of DSS public API calls
+macro SYMBIAN_TRACE_ENABLE
+
+//TCB is added for the RLocalDrive methods.
+CAPABILITY AllFiles TCB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/debug/securityServer/inc/c_process_pair.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,53 @@
+// 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 a helper class for process security management
+// 
+//
+
+#ifndef C_PROCESS_PAIR_H
+#define C_PROCESS_PAIR_H
+
+/**
+@file
+@internalTechnology
+@released
+*/
+
+/**
+CProcessPair is a mapping between a debug agent's process Id, and
+the process fileName of a process the agent is interested in debugging.
+*/
+class CProcessPair : public CBase
+	{
+public:
+	static CProcessPair* NewL(const TDesC& aProcessName, const TProcessId aProcessId);
+	~CProcessPair();
+	TBool operator==(const CProcessPair &aProcessPair) const;
+	TBool Equals(const TDesC& aProcessName, const TProcessId aProcessId) const;
+	TBool ProcessIdMatches(const CProcessPair &aProcessPair) const;
+	TBool ProcessNameMatches(const CProcessPair &aProcessPair) const;
+	TBool ProcessIdMatches(const TProcessId &aProcessId) const;
+	TBool ProcessNameMatches(const TDesC& aProcessName) const;
+
+private:
+	CProcessPair();
+	void ConstructL(const TDesC& aProcessName, TProcessId aProcessId);
+
+private:
+	HBufC16* iProcessName;
+	TProcessId iProcessId;
+	};
+
+#endif //C_PROCESS_PAIR_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/debug/securityServer/inc/c_security_svr_async.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,91 @@
+// 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:
+// Asynchronous security server responder active object class.
+// 
+//
+
+#ifndef C_SECURITY_SVR_ASYNC_H
+#define C_SECURITY_SVR_ASYNC_H
+
+#include <rm_debug_api.h>
+
+#include "c_security_svr_session.h"
+#include "c_security_svr_server.h"
+
+// forward declaration
+class CSecuritySvrSession;
+
+/**
+Class used to handle asynchronous events within a DSS session. Currently this
+is only used to handle GetEvent() calls. It sets up an active object when a 
+client makes a GetEvent() call, and completes it when ready, or cancels it
+if the client so wishes.
+
+Only one outstanding active object per client session is permitted.
+*/
+class CSecuritySvrAsync : public CActive
+{
+public:
+	~CSecuritySvrAsync();
+	static CSecuritySvrAsync* NewL(CSecuritySvrSession* aSession, const TDesC8& aProcessName, TProcessId aAgentId);
+
+	void GetEvent(const RMessage2& aMessage);
+	const TDesC8& ProcessName(void);
+
+protected:
+	CSecuritySvrAsync(CSecuritySvrSession* aSession, TProcessId aAgentId);
+
+	void ConstructL(const TDesC8& aProcessName);
+
+	virtual void RunL();
+	virtual void DoCancel();
+	virtual TInt RunError(TInt aError);
+
+private:
+
+    /*
+     * The last GetEvent message details. Needed for completion by RunL()
+     */
+    RMessagePtr2 iMessage;			
+
+    /*
+     * Temporary storage area for rm_debug.ldd to return data asynchronously
+     */
+	Debug::TEventInfo iInfo;
+
+	/*
+	 * Identity of this server session. Used for completing iMessage
+	 */
+	CSecuritySvrSession* iSession;
+
+	/*
+	 * Name of the process being debugged associated with this AO
+	 */
+	RBuf8 iProcessName;
+
+	/*
+	 * Debug Agent Id
+	 */
+	TProcessId iAgentId;
+	
+	/*
+	 * Balance between event requests and event deliveries.
+	 * @see GetEvent()
+	 * @see NotifyEvent()
+	 * @see DoCancel()
+	 */
+	TInt iEventBalance;
+};
+ 
+#endif	// C_SECURITY_SVR_ASYNC_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/debug/securityServer/inc/c_security_svr_server.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,80 @@
+// 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 security server server.
+// 
+//
+
+#ifndef C_SECURITY_SVR_SERVER_H
+#define C_SECURITY_SVR_SERVER_H
+
+/**
+@file
+@internalTechnology
+@released
+*/
+
+#include <rm_debug_api.h>
+#include "c_process_pair.h"
+#include "c_shutdown_timer.h"
+#include "rm_debug_kerneldriver.h"
+
+_LIT(KDebugDriverFileName,"rm_debug.ldd");
+class CSecuritySvrSession;
+
+/**
+Definition of a Debug Security Server. Responsible for managing all debug agent clients,
+including attachment/detachment from target executables. Keeps track of which executables
+are being debugged.
+*/
+class CSecuritySvrServer : public CServer2
+	{
+	public:
+		CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const;
+		TInt AttachProcessL(const TDesC& aTargetProcessName, const TProcessId aDebugAgentProcessId, const TBool aPassive);
+		TInt DetachProcess(const TDesC& aTargetProcessName, const TProcessId aDebugAgentProcessId);
+		void DetachAllProcesses(const TProcessId aDebugAgentProcessId);
+		TBool CheckAttached(const TThreadId aTargetThreadId, const RMessage2& aMessage, const TBool aPassive);
+		TBool CheckAttached(const TProcessId aTargetProcessId, const RMessage2& aMessage, const TBool aPassive);
+		TBool CheckAttachedProcess(const TDesC& aTargetProcessName, const RMessage2& aMessage, const TBool aPassive) const;
+		TBool IsDebugged(const TDesC& aTargetProcessName, const TBool aPassive) const;
+		void SessionClosed();
+		void SessionOpened();
+		static CSecuritySvrServer* NewLC();
+
+		TBool OEMTokenPermitsDebugL(const TCapabilitySet aTokenCaps, const TCapabilitySet aTargetCaps);
+		TBool OEMTokenPermitsFlashAccessL(const TCapabilitySet aTokenCaps);
+
+	protected:
+		CSecuritySvrServer(CActive::TPriority aActiveObjectPriority);
+		void ConstructL();
+		
+	private:
+		~CSecuritySvrServer();
+		TBool IsActiveDebugger(const TDesC& aTargetProcessName, const TProcessId aDebugAgentProcessId) const;
+		TBool IsDebugger(const TDesC& aTargetProcessName, const TProcessId aDebugAgentProcessId) const;
+		TInt GetProcessIdFromMessage(TProcessId& aProcessId, const RMessage2& aMessage) const;
+
+	private:
+		RPointerArray<CProcessPair> iActiveDebugMap;
+		RPointerArray<CProcessPair> iPassiveDebugMap;
+		TInt iSessionCount;
+		CShutdownTimer iShutdown;
+		RRM_DebugDriver iKernelDriver;
+
+	// Declare the CSecuritySvrAsync as a friend so it can use the iKernelDriver too
+	friend class CSecuritySvrAsync;
+	friend class CSecuritySvrSession;
+	};
+
+#endif // C_SECURITY_SVR_SERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/debug/securityServer/inc/c_security_svr_session.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,206 @@
+// 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"
+// 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 security server server side session.
+// 
+//
+
+#ifndef C_SECURITY_SVR_SESSION_H
+#define C_SECURITY_SVR_SESSION_H
+
+/**
+@file
+@internalTechnology
+@released
+*/
+
+// forward declaration
+class CSecuritySvrAsync;
+
+#include "c_security_svr_async.h"
+#include <f32file.h>
+#include <d32locd.h>
+
+#include <rm_debug_api.h>
+
+#include "rm_debug_kerneldriver.h"
+
+// Server name
+_LIT(KDebugDriverName,"RunMode Debug Driver");
+
+class CSecuritySvrServer;
+
+/**
+Debug Security Server session. Manages the session with one debug agent and
+as many target executables as it has attached to.
+*/
+class CSecuritySvrSession : public CSession2
+	{
+public:
+	CSecuritySvrSession();
+	~CSecuritySvrSession();
+	void ConstructL ();
+	void CreateL();
+
+	TInt OpenHandle(const TRM_DebugDriverInfo& aDriverInfo);
+	void ServiceL(const RMessage2& aMessage);
+	void ServiceError(const RMessage2 &aMessage, TInt aError);
+
+	void ResumeThreadL(const RMessage2& aMessage);
+	void SuspendThreadL(const RMessage2& aMessage);
+	//break
+	void SetBreakL(const RMessage2& aMessage);
+	void ClearBreakL(const RMessage2& aMessage);
+	void ModifyBreakL(const RMessage2& aMessage);
+	void BreakInfoL(const RMessage2& aMessage);
+
+	void StepRangeL(const RMessage2& aMessage);
+
+	void GetEventL(const RMessage2& aMessage);
+	void CancelGetEventL(const RMessage2& aMessage);
+
+	void AttachProcessL(const RMessage2& aMessage);
+	void DetachProcessL(const RMessage2& aMessage);
+	//debug functionality
+	void GetDebugFunctionalityBufSizeL(const RMessage2& aMessage);
+	void GetDebugFunctionalityL(const RMessage2& aMessage);
+	//memory
+	void ReadMemoryL(const RMessage2& aMessage);
+	void WriteMemoryL(const RMessage2& aMessage);
+	//registers
+	void ReadRegistersL(const RMessage2& aMessage);
+	void WriteRegistersL(const RMessage2& aMessage);
+	//event
+	void SetEventActionL(const RMessage2& aMessage);
+
+	void GetListL(const RMessage2& aMessage);
+	void StepL(const RMessage2& aMessage);
+	void TraceExecutableL(const RMessage2& aMessage);
+	
+	//crash log
+	void ReadCrashLogL(const RMessage2& aMessage);
+	void WriteCrashConfigL(const RMessage2& aMessage);
+	void EraseCrashLogL(const RMessage2& aMessage);
+	void EraseEntireCrashLogL(const RMessage2& aMessage);
+
+	void SetProcessBreakL(const RMessage2& aMessage);
+	void ModifyProcessBreakL(const RMessage2& aMessage);
+	void ProcessBreakInfoL(const RMessage2& aMessage);
+
+	void KillProcessL(const RMessage2& aMessage);
+
+	TCapabilitySet GetOEMDebugCapabilities(void) const { return iOEMDebugCapabilities; };
+
+#ifdef _DEBUG
+	void DoFailAlloc(const RMessage2& aMessage);
+#endif
+
+private:
+	CSecuritySvrServer& Server() const;
+	void HeapWatcher(const TUint32 aFunction, const TBool aEntry) const;
+	void WriteDataL(const RMessage2& aMessage, const TInt aIndex, const TAny* aPtr, const TUint32 aPtrSize) const;
+	void StoreDebugAgentId(const TProcessId aDebugAgentProcessId);
+	void CheckAttachedL(const TThreadId aThreadId, const RMessage2& aMessage, const TBool aPassive) const;
+	void CheckAttachedL(const TProcessId aProcessId, const RMessage2& aMessage, const TBool aPassive) const;
+	TBool PermitDebugL(const TProcessId aDebugAgentProcessId, const TDesC& aTargetProcessName) const;
+	TBool IsDebugged(const TDesC& aFileName, const TBool aPassive) const;
+	void OpenFileHandleL(const TDesC& aFileName, RFs& aFs, RFile& aFileHandle);
+	TBool IsTraceBitSet(const TDesC8& aHeaderData, const TBool aXip);
+	TBool IsDebugBitSet(const TDesC8& aHeaderData, const TBool aXip);
+	TBool CheckSufficientData(const TDesC8& aHeaderData, const TBool aXip) const;
+
+	void ValidateMemoryInfoL(const TThreadId aThreadId, const Debug::TMemoryInfo &aMemoryInfo, const TBool aReadOperation);
+	void ValidateRegisterBuffersL(const RMessage2& aMessage, TUint32& aNumberOfRegisters);
+
+	TInt GetExecutablesListL(TDes8& aBuffer, TUint32& aSize) const;
+	void AppendExecutableData(TDes8& aBuffer, TUint32& aSize, const TDesC& aEntryName) const;
+	void GetSecureIdL(const TDesC& aFileName, TUid& aSecureId);
+	TUid GetSecureIdL(const TDesC8& aHeaderData, TBool aXip);
+
+	void IsDebuggableL(const TDesC& aFileName);
+	TThreadId ReadTThreadIdL(const RMessagePtr2& aMessage, const TInt aIndex) const;
+	TProcessId ReadTProcessIdL(const RMessagePtr2& aMessage, const TInt aIndex) const;
+	TBool IsExecutableXipL(RFile& aExecutable);
+	
+	void ConnectCrashPartitionL(void);
+
+	void GetDebugAgentOEMTokenCapsL();
+	TInt CheckFlashAccessPermissionL(const RThread aClientThread);
+
+	// Declare the CSecuritySvrAsync as a friend so it can use the iKernelDriver too
+	friend class CSecuritySvrAsync;
+
+private:
+	/**
+	Flag to indicate whether we have stored the TProcessId associated with the Debug Agent.
+	*/
+	TBool iDebugAgentProcessIdStored;
+
+	/**
+	The TProcessId of the Debug Agent associated with this session. A convenience to
+	save looking it up repeatedly.
+	*/
+	TProcessId iDebugAgentProcessId;
+	/**
+	Need an array of async completion objects, one for each target executable.
+	*/
+	RPointerArray<CSecuritySvrAsync> iAsyncHandlers;
+
+	/**
+	Used to track whether the Debug Agent has been notified when closing the session.
+	*/
+	TBool iServerNotified;
+
+	/**
+	OEM Debug token support. This is only used when the Debug Agent has OEM debug 
+	authority provided by a specific authorisation token file. This token confers
+	the ability to debug certain executables which have not been built as 'Debuggable'.
+	
+	The OEM Debug token executable must be marked with 'AllFiles', as this is analogous
+	to looking 'inside' executables - with AllFiles, it could read all the data out of an
+	executable in \sys\bin\. In addition, since debug control of an executable implies the
+	ability to execute arbitrary code within the target process space, this would imply that
+	a Debug Agent could use any PlatSec capability which that target process possessed.
+	
+	Therefore, we require that the OEM Debug Token must also be marked with a superset of
+	the PlatSec capabilities of the executable which is to be debugged. This means the
+	Debug Agent is not granted more access/PlatSec capabilities than its authorisation
+	token allows, and cannot exploit a target executable to leverage greater access than
+	should be permitted.
+
+	iTargetCapabilities tracks which PlatSec capabilities the target executables may
+	possess and still be debugged by this debug agent. The capabilities are NOT those
+	of the debug agent process, they are the capabilites indicated in the OEM Debug Token
+	which describe the capabilities the debug agent is authorised to debug. E.g. a Debug
+	Agent might use CommsDD, but wish to debug a DRM capable executable. In that case, the
+	Debug Agent exe must be signed with CommsDD, but the OEM Debug Token need only possess
+	DRM and AllFiles (permission to look inside another executable).
+	*/
+	TCapabilitySet iOEMDebugCapabilities;
+	
+	//RLocalDrive to access the crash Flash
+	RLocalDrive iLocalDrive;
+	
+	//For NOR flash 
+	TLocalDriveCapsV2 iCaps;
+	
+	/**
+	 * If true means the local drive connected to the crash partition else connect 
+	 * when access required to crash flash partition for read operation
+	*/	
+	TBool iCrashConnected;
+	};
+
+
+#endif // C_SECURITY_SVR_SESSION_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/debug/securityServer/inc/c_shutdown_timer.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,46 @@
+// 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 for the security server's shutdown timer.
+// 
+//
+
+#ifndef C_SHUTDOWN_TIMER_H
+#define C_SHUTDOWN_TIMER_H
+
+/**
+@file
+@internalTechnology
+@released
+*/
+
+#include <e32base.h>
+
+const TInt KShutdownDelay = 5000000; // approx 5 seconds
+const TInt KActivePriorityShutdown = -1; // priority for shutdown AO
+
+/**
+Timer class used to manage shutdown of the DSS
+*/
+class CShutdownTimer : public CTimer
+	{
+public:
+	CShutdownTimer();
+	void ConstructL();
+	void Start();
+private:
+	void RunL();
+	};
+
+#endif // C_SHUTDOWN_TIMER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/debug/securityServer/inc/low_mem_requests.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,37 @@
+// 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:
+// Request numbers for use with the Debug Security Server and low mem tests
+// 
+//
+
+#ifndef LOW_MEM_REQUESTS_H
+#define LOW_MEM_REQUESTS_H
+
+/**
+@file
+@internalTechnology
+@released
+*/
+
+#ifdef _DEBUG
+// enumerators to use to call Debug Security Server in debug mode for low mem tests
+enum TLowMemDebugServRqst
+	{
+	EDebugServFailAlloc = 0x10000001,
+	EDebugServMarkEnd = 0x10000002,
+	EDebugServMarkHeap = 0x10000003
+	};
+#endif
+
+#endif //LOW_MEM_REQUESTS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/debug/securityServer/inc/rm_debug_logging.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,83 @@
+// 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:
+// Logging macros for use in debug subsystem
+// 
+//
+
+#ifndef RM_DEBUG_LOGGING_H
+#define RM_DEBUG_LOGGING_H
+
+/* Debug messages
+ * 
+ * Debug messages are only generated for debug builds.
+ * 
+ * For kernel mode, use __KTRACE_OPT(KDEBUGGER, Kern::Printf(), 
+ * for user mode use RDebug::Printf(). 
+ * 
+ */
+
+#ifdef _DEBUG
+
+  #ifdef __KERNEL_MODE__
+
+    #include <kernel/kernel.h>
+    #include <nkern/nk_trace.h>
+
+    #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(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(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
+
+#endif //RM_DEBUG_LOGGING_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/debug/securityServer/src/c_process_pair.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,131 @@
+// 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 a helper class for process security management
+// 
+//
+
+#include <e32base.h>
+#include <e32base_private.h>
+
+// Required for logging
+#include <rm_debug_api.h>
+
+#include "c_process_pair.h"
+#include "rm_debug_logging.h"
+
+
+CProcessPair* CProcessPair::NewL(const TDesC& aProcessName, const TProcessId aProcessId)
+	{
+	CProcessPair* self=new (ELeave) CProcessPair();
+	CleanupStack::PushL(self);
+	self->ConstructL(aProcessName, aProcessId);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+void CProcessPair::ConstructL(const TDesC& aProcessName, const TProcessId aProcessId)
+	{
+	//allocate the process name buffer and fill with aProcessName
+	iProcessName = aProcessName.Alloc();
+	if(iProcessName == NULL)
+		User::Leave(KErrNoMemory);
+
+	LOG_MSG2( "CProcessPair::ConstructL() process name: %S", &TPtr8((TUint8*)iProcessName->Ptr(), 2*iProcessName->Length(), 2*iProcessName->Length()) );
+
+	//set process id
+	iProcessId = aProcessId;
+	}
+
+CProcessPair::CProcessPair()
+	{
+	}
+
+CProcessPair::~CProcessPair()
+	{
+	delete iProcessName;
+	}
+
+/**
+Check whether two CProcessPair objects are equal
+
+@param aProcessPair a CProcessPair object to match with this one
+
+@return 0 if process ids and names do not match, non-zero if they do
+*/
+TBool CProcessPair::operator==(const CProcessPair &aProcessPair) const
+	{
+	return Equals(*aProcessPair.iProcessName, aProcessPair.iProcessId);
+	}
+	
+/**
+Check whether this CProcessPair object has these values set
+
+@param aProcessName process name to check
+@param aProcessId process id to check
+
+@return 0 if process ids and names do not match, non-zero if they do
+*/
+TBool CProcessPair::Equals(const TDesC& aProcessName, const TProcessId aProcessId) const
+	{
+	return (ProcessIdMatches(aProcessId) && (ProcessNameMatches(aProcessName)));
+	}
+
+/**
+Check whether the process ids of two objects match
+
+@param aProcessPair a CProcessPair object to compare with this one
+
+@return 0 if process ids do not match, non-zero if they do
+*/
+TBool CProcessPair::ProcessIdMatches(const CProcessPair &aProcessPair) const
+	{
+	return ProcessIdMatches(aProcessPair.iProcessId);
+	}
+
+/**
+Check whether two process ids match
+
+@param aProcessId a process ID to compare with this pair's process ID
+
+@return 0 if process ids do not match, non-zero if they do
+*/
+TBool CProcessPair::ProcessIdMatches(const TProcessId &aProcessId) const
+	{
+	return iProcessId == aProcessId;
+	}
+
+/**
+Check whether the process names of two objects match in-case-sensitively
+
+@param aProcessPair a CProcessPair object to compare with this one
+
+@return 0 if process names do not match, non-zero if they do
+*/
+TBool CProcessPair::ProcessNameMatches(const CProcessPair &aProcessPair) const
+	{
+	return ProcessNameMatches(*aProcessPair.iProcessName);
+	}
+
+/**
+Check whether two strings match in-case-sensitively
+
+@param aProcessName a process name to compare with this pair's process name
+
+@return 0 if process names do not match, non-zero if they do
+*/
+TBool CProcessPair::ProcessNameMatches(const TDesC& aProcessName) const
+	{
+	return iProcessName->CompareF(aProcessName) == 0;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/debug/securityServer/src/c_security_svr_async.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,152 @@
+// 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:
+// Asynchronous security server active object class.
+// 
+//
+
+#include <e32base.h>
+#include <e32base_private.h>
+
+#include "c_security_svr_async.h"
+#include "rm_debug_logging.h"
+
+using namespace Debug;
+
+// ctor
+CSecuritySvrAsync::CSecuritySvrAsync(CSecuritySvrSession* aSession, TProcessId aAgentId)
+	: CActive(CActive::EPriorityStandard),
+	iSession(aSession),
+	iProcessName(NULL),
+	iAgentId(aAgentId),
+	iEventBalance(0)
+	{
+	LOG_MSG("CSecuritySvrAsync::CSecuritySvrAsync()");
+	CActiveScheduler::Add(this);
+	}
+
+// returns a CSecuritySvrAsync active object associated with
+// the specified agent and debugged process.
+CSecuritySvrAsync* CSecuritySvrAsync::NewL(CSecuritySvrSession* aSession, const TDesC8& aProcessName, TProcessId aAgentId)
+	{
+	LOG_MSG("CSecuritySvrAsync::NewL()");
+	CSecuritySvrAsync* me = new (ELeave) CSecuritySvrAsync(aSession, aAgentId);
+
+	CleanupStack::PushL(me);
+
+	me->ConstructL(aProcessName);
+
+	CleanupStack::Pop(me);
+
+	return (me);
+	}
+
+// dtor
+CSecuritySvrAsync::~CSecuritySvrAsync()
+	{
+	LOG_MSG("CSecuritySvrAsync::~CSecuritySvrAsync()");
+
+	// NOTE: the Cancel() function calls DoCancel() which may rely on class members so be careful not
+	// to destroy/close data members before this call if they are needed
+	Cancel();
+	iProcessName.Close();
+	}
+
+// Associates the agent id and process name with the Active Object being constructed
+void CSecuritySvrAsync::ConstructL(const TDesC8& aProcessName)
+	{
+	LOG_MSG("CSecuritySvrAsync::ConstructL()");
+	iProcessName.CreateL(aProcessName.Length());
+	iProcessName.Copy(aProcessName);
+	}
+
+// RunL() completes a previously issued call (currently only GetEvent() completion)
+void CSecuritySvrAsync::RunL()
+	{
+
+	LOG_MSG3("CSecuritySvrAsync::RunL() &iInfo=0x%08x, iEventBalance=%d", (TUint8*)&iInfo, iEventBalance);
+
+	// Something bad happened in the driver
+	User::LeaveIfError(iStatus.Int());
+
+	// Write back the event data to the debug agent.
+	// For compatibility we need to check the size of the buffer that the
+	// client has passed in as the size of TEventInfo will increase over time.
+	// Clients can calculate the required size from the EApiConstantsTEventInfoSize entry 
+	// in the Debug Functionality block but may still pass in buffers which
+	// are smaller than the Debug Security Server's calculation of sizeof(TEventInfo), 
+	// returning KErrTooBig in this case would be
+	// inappropriate as we would break compatibility.
+	TInt dataLengthToReturn = sizeof(TEventInfo);
+	TInt maxLengthClientSide = iMessage.GetDesMaxLengthL(1);
+	if(maxLengthClientSide < dataLengthToReturn)
+		{
+		dataLengthToReturn = maxLengthClientSide;
+		}
+
+	TPtr8 data((TUint8*)&iInfo,dataLengthToReturn,dataLengthToReturn);
+
+	iMessage.WriteL(1,data,0);
+
+	iMessage.Complete(KErrNone);
+	--iEventBalance;
+	}
+
+// Cancels the oustanding GetEvent call. May cope with other async calls in future.
+void CSecuritySvrAsync::DoCancel()
+	{
+	LOG_MSG2("CSecuritySvrAsync::DoCancel() iEventBalance=%d", iEventBalance);
+	iSession->Server().iKernelDriver.CancelGetEvent(iProcessName,iAgentId.Id());
+
+	iMessage.Complete(KErrCancel);
+	iEventBalance=0;
+	}
+
+// Report any leave to the client if possible.
+TInt CSecuritySvrAsync::RunError(TInt aError)
+	{
+	LOG_MSG2("CSecuritySvrAsync::RunError()=%d", aError);
+	iMessage.Complete(aError);
+
+	return KErrNone;
+	}
+
+/*
+ * Start an asynchronous GetEvent call to the debug driver
+ * and activates this active object. 
+ */
+void CSecuritySvrAsync::GetEvent(const RMessage2& aMessage)
+	{
+	iMessage = aMessage;
+
+	iEventBalance++;
+	LOG_MSG5("CSecuritySvrAsync::GetEvent() this = 0x%08x, iInfo=0x%08x, iStatus=0x%08x \
+		iEventBalance=%d : >SetActive() > GetEvent() ",
+		this, &iInfo, &iStatus, iEventBalance );
+
+	/* 
+	SetActive is called before sending the message to the driver so 
+	that we do not get stray signal panics, since the driver may complete immediately
+ 	*/
+	SetActive();
+	iSession->Server().iKernelDriver.GetEvent(iProcessName,iAgentId.Id(),iStatus,iInfo);
+	}
+
+// Used for identifying which AO is associated with a debugged process
+const TDesC8& CSecuritySvrAsync::ProcessName(void)
+	{
+	return iProcessName;
+	}
+
+// End of file - c_security_svr_async.cpp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/debug/securityServer/src/c_security_svr_server.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,655 @@
+// 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 security server server implementation.
+// 
+//
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+
+#include <e32base.h>
+#include <e32base_private.h>
+#include <rm_debug_api.h>
+#include "c_process_pair.h"
+#include "c_security_svr_session.h"
+#include "c_security_svr_server.h"
+#include "rm_debug_logging.h"
+
+using namespace Debug;
+
+/**
+Server constructor, sessions are created as ESharableSessions, meaning that
+each session will be used by at most one debug agent
+*/
+CSecuritySvrServer::CSecuritySvrServer(CActive::TPriority aActiveObjectPriority)
+	: CServer2(aActiveObjectPriority, ESharableSessions),
+	  iSessionCount(0),
+	  iShutdown()
+	{
+	LOG_MSG("CSecuritySvrServer::CSecuritySvrServer()\n");
+	}
+
+/**
+Standard implementation
+
+@return pointer to new CSecuritySvrServer object
+*/
+CSecuritySvrServer* CSecuritySvrServer::NewLC()
+	{
+	LOG_MSG("CSecuritySvrServer::NewLC()\n");
+
+	CSecuritySvrServer* self=new(ELeave) CSecuritySvrServer(EPriorityStandard);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+
+/**
+Server destructor, performs cleanup for the server
+*/
+CSecuritySvrServer::~CSecuritySvrServer()
+	{
+	LOG_MSG("CSecuritySvrServer::~CSecuritySvrServer()\n");
+
+	// stop the kernel side driver
+	iKernelDriver.Close();
+	User::FreeLogicalDevice(KDebugDriverName);
+
+	//deallocate both the debug maps
+	iPassiveDebugMap.ResetAndDestroy();
+	iActiveDebugMap.ResetAndDestroy();
+	}
+
+/**
+Starts the server and constructs and starts the servers shutdown timer
+*/
+void CSecuritySvrServer::ConstructL()
+	{
+	LOG_MSG("CSecuritySvrServer::ConstructL()");
+
+	StartL(KSecurityServerName);
+	iShutdown.ConstructL();
+	iShutdown.Start();
+
+	//load the kernel driver
+	TInt err = User::LoadLogicalDevice(KDebugDriverFileName);
+	if(! ((KErrNone == err) || (KErrAlreadyExists == err)))
+		{
+		User::Leave(err);
+		}
+	//create an information object for initialising the driver
+	TRM_DebugDriverInfo driverInfo;
+	driverInfo.iUserLibraryEnd = 0;
+	User::LeaveIfError(iKernelDriver.Open(driverInfo));
+	}
+
+/**
+Creates a new session with the DSS. A version check is done to ensure that an
+up to date version of the DSS is available (according to the DA's needs).
+The device driver is loaded if necessary and a session with the server and a 
+handle to the driver opened.
+
+@param aRequiredVersion the minimal version of the DSS required by the DA
+
+@return a pointer to the new sever session, or NULL if any of the 
+        initialisation process failed
+*/
+CSession2* CSecuritySvrServer::NewSessionL(const TVersion& aRequiredVersion, const RMessage2& aMessage) const
+//
+// Session constructor
+//
+	{
+	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))
+		{
+		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()");
+	CSecuritySvrSession* servSession = new(ELeave) CSecuritySvrSession();
+
+	CleanupStack::PushL(servSession);
+	servSession->ConstructL();
+	CleanupStack::Pop(servSession);
+	return servSession;
+	}
+
+/**
+Manages requests from debug agents to attach to target debug processes
+
+Given the debug agent process ID and the target process name:
+(1) checks whether the pair is already in either of the debug maps, if so
+    then returns KErrAlreadyExists
+(2) if aPassive == ETrue then just add the pair to the passive map and return
+    whatever the return value of the array write was
+(3) if aPassive == EFalse then check whether the target debug process is 
+    already reserved by another debug agent. If it is then return KErrInUse,
+    otherwise add the pair to the active debug map and return the status 
+    value of the array write.
+
+@param aTargetProcessName original FileName of the process to attach to
+@param aDebugAgentProcessId process ID of the debug agent
+@param aPassive ETrue if wish to attach passively, EFalse otherwise
+
+@return KErrNone if successfully attached, otherwise another system wide error
+        code as above
+*/
+TInt CSecuritySvrServer::AttachProcessL(const TDesC& aTargetProcessName, const TProcessId aDebugAgentProcessId, const TBool aPassive)
+	{
+	//store the pair of values
+	LOG_MSG( "CSecuritySvrServer::AttachProcessL()\n" );
+
+	CProcessPair *processPair = CProcessPair::NewL(aTargetProcessName, aDebugAgentProcessId);
+	if(processPair == NULL)
+		return KErrNoMemory;
+
+	//check whether the pair already exists in the active debug map
+	for(TInt i=0; i<iActiveDebugMap.Count(); i++)
+		{
+		if(*processPair == *(iActiveDebugMap[i]))
+			{
+			//process already exists
+			LOG_MSG( "  AttachProcessL() error : KErrAlreadyExists in active map\n" );
+			delete processPair;
+			return KErrAlreadyExists;
+			}
+		}
+
+	//check whether the pair already exists in the passive map
+	for(TInt i=0; i<iPassiveDebugMap.Count(); i++)
+		{
+		if(*processPair == *(iPassiveDebugMap[i]))
+			{
+			//process already exists
+			LOG_MSG( "  AttachProcessL() error : KErrAlreadyExists in passive map\n" );
+			delete processPair;
+			return KErrAlreadyExists;
+			}
+		}
+
+	if(aPassive)
+		{
+		//just add the pair and return
+		TInt err = iPassiveDebugMap.Append(processPair);
+		if(err != KErrNone)
+			{
+			// couldn't add pair for some unknown reason, so delete the pair
+			LOG_MSG2( "  AttachProcessL() error %d appending passive process pair \n", err );
+			delete processPair;
+			}
+		return err;
+		}
+	else
+		{
+		//check whether the process Id has already been reserved
+		for(TInt i=0; i<iActiveDebugMap.Count(); i++)
+			{
+			if(processPair->ProcessNameMatches(*(iActiveDebugMap[i])))
+				{
+				//process already being debugged
+				LOG_MSG( "  AttachProcessL() error : process already being debugged\n" );
+				delete processPair;
+				return KErrInUse;
+				}
+			}
+		//try to add the pair	
+		TInt err = iActiveDebugMap.Append(processPair);
+		if(err != KErrNone)
+			{
+			// couldn't add pair for some unknown reason, so delete the pair
+			LOG_MSG2( "  AttachProcessL() error %d appending active process pair \n", err );
+			delete processPair;
+			}
+		return err;
+		}
+	}
+
+/*
+Detach from debugging the specified process
+
+@param aTargetProcessName name of the process to detach from
+@param aDebugAgentProcessId process ID of the debug agent
+
+@return KErrNone if successfully detached, KErrNotFound if an attempt is made
+        to detach from a process which the debug agent hasn't previously attached to
+*/
+TInt CSecuritySvrServer::DetachProcess(const TDesC& aTargetProcessName, const TProcessId aDebugAgentProcessId)
+	{
+	//check whether the pair is in the active debug map
+	for(TInt i=0; i<iActiveDebugMap.Count(); i++)
+		{
+		if(iActiveDebugMap[i]->Equals(aTargetProcessName, aDebugAgentProcessId))
+			{
+			//remove the process pair from the active debug map
+			delete iActiveDebugMap[i];
+			iActiveDebugMap.Remove(i);
+			return KErrNone;
+			}
+		}
+
+	//check whether the pair is in the passive debug map
+	for(TInt i=0; i<iPassiveDebugMap.Count(); i++)
+		{
+		if(iPassiveDebugMap[i]->Equals(aTargetProcessName, aDebugAgentProcessId))
+			{
+			//remove the process pair from the active debug map
+			delete iPassiveDebugMap[i];
+			iPassiveDebugMap.Remove(i);
+			return KErrNone;
+			}
+		}
+
+	//process pair wasn't in either map
+	return KErrNotFound;
+	}
+
+/**
+Given a debug agent process ID, removes all references to that debug agent
+from the debug maps
+
+@param aMessage message from the debug agent
+
+@return returns KErrNone if successful, another system wide error code otherwise
+*/
+void CSecuritySvrServer::DetachAllProcesses(const TProcessId aDebugAgentProcessId)
+	{
+	//check whether the debug agent process ID is in the active debug map
+	for(TInt i=iActiveDebugMap.Count()-1; i>=0; i--)
+		{
+		if(iActiveDebugMap[i]->ProcessIdMatches(aDebugAgentProcessId))
+			{
+			//remove the process pair from the active debug map
+			delete iActiveDebugMap[i];
+			iActiveDebugMap.Remove(i);
+			}
+		}
+
+	//check whether the debug agent process ID is in the passive debug map
+	for(TInt i=iPassiveDebugMap.Count()-1; i>=0; i--)
+		{
+		if(iPassiveDebugMap[i]->ProcessIdMatches(aDebugAgentProcessId))
+			{
+			//remove the process pair from the passive debug map
+			delete iPassiveDebugMap[i];
+			iPassiveDebugMap.Remove(i);
+			}
+		}
+	}
+
+/*
+Check whether the specified debug agent is attaced to the specfied target
+process.
+
+@param aTargetThreadId thread ID of a thread in the target process
+@param aMessage a message which originates with the debug agent
+@param aPassive if EFalse then checks whether the debug agent is the active
+       debugger of the target process. If ETrue then checks whether the debug
+       agent is attached to the target process, irrespective of whether it is
+       attached passively or actively
+
+@return ETrue if attached, EFalse otherwise
+*/
+TBool CSecuritySvrServer::CheckAttached(const TThreadId aTargetThreadId, const RMessage2& aMessage, const TBool aPassive)
+	{
+	
+	//get a handle to the target thread
+	RThread targetThread;
+	TInt err = targetThread.Open(aTargetThreadId);
+	if(err != KErrNone)
+		{
+		return EFalse;
+		}
+
+	//get a handle to the target process
+	RProcess targetProcess;
+	err = targetThread.Process(targetProcess);
+	//finshed with the thread handle so close it
+	targetThread.Close();
+	if(err != KErrNone)
+		return EFalse;
+
+	//get the target process' file name
+	TFileName targetFileName = targetProcess.FileName();
+
+	// Tamperproofing. Ensure that the debug agent really has a superset
+	// of the target process PlatSec capabilities, as authorised
+	// by an OEM Debug Token (if any)
+
+	TSecurityInfo targetSecInfo(targetProcess);
+
+	// Now compare the capabilities, to ensure the DebugAgent has been authorised with
+	// sufficient capabilities from its OEM Debug token
+	CSecuritySvrSession* session = (CSecuritySvrSession*)aMessage.Session();
+
+	// Presume we need to check the target process is debuggable unless a valid OEM Debug token in effect?
+	if (!OEMTokenPermitsDebugL(session->GetOEMDebugCapabilities(), targetSecInfo.iCaps) )
+		{
+		// No debug token therefore check if the process is debuggable
+		err = iKernelDriver.IsDebuggable(targetProcess.Id());
+		}
+
+	//finished with the process handle so close it
+	targetProcess.Close();
+
+	if (err != KErrNone)
+	{
+		// The process was not marked as debuggable by the loader, and the OEM
+		// debug token did not override the lack of a debuggable bit.
+		// The process was not marked as debuggable by the loader
+		return EFalse;
+	}
+
+	return CheckAttachedProcess(targetFileName, aMessage, aPassive);
+	}
+
+/*
+Check whether the specified debug agent is attaced to the specfied target
+process.
+
+@param aTargetProcessId process ID of the target process
+@param aMessage a message which originates with the debug agent
+@param aPassive if EFalse then checks whether the debug agent is the active
+       debugger of the target process. If ETrue then checks whether the debug
+       agent is attached to the target process, irrespective of whether it is
+       attached passively or actively
+
+@return ETrue if attached, EFalse otherwise
+*/
+TBool CSecuritySvrServer::CheckAttached(const TProcessId aTargetProcessId, const RMessage2& aMessage, const TBool aPassive)
+	{
+	//get a handle to the target process
+	RProcess targetProcess;
+	TInt err =targetProcess.Open(aTargetProcessId);
+	if(err != KErrNone)
+		{
+		return EFalse;
+		}
+
+	//get the target process' file name
+	TFileName targetFileName = targetProcess.FileName();
+
+	// Tamperproofing. Ensure that the debug agent really has a superset
+	// of the target process PlatSec capabilities, as authorised
+	// by an OEM Debug Token (if any)
+
+	TSecurityInfo targetSecInfo(targetProcess);
+
+	// Now compare the capabilities, to ensure the DebugAgent has been authorised with
+	// sufficient capabilities from its OEM Debug token
+	CSecuritySvrSession* session = (CSecuritySvrSession*)aMessage.Session();
+
+	// Presume we need to check the target process is debuggable unless a valid OEM Debug token in effect?
+	if ( !OEMTokenPermitsDebugL(session->GetOEMDebugCapabilities(), targetSecInfo.iCaps) )
+		{
+		// No debug token therefore check if the process is debuggable
+		err = iKernelDriver.IsDebuggable(targetProcess.Id());
+		}
+
+	//finished with the process handle so close it
+	targetProcess.Close();
+
+	if (err != KErrNone)
+	{
+		return EFalse;
+	}
+
+	return CheckAttachedProcess(targetFileName, aMessage, aPassive);
+	}
+
+/*
+Check whether the specified debug agent is attaced to the specfied target
+process.
+
+@param aTargetProcessName 
+@param aMessage a message which originates with the debug agent
+
+@return ETrue if attached, EFalse otherwise
+*/
+TBool CSecuritySvrServer::CheckAttachedProcess(const TDesC& aTargetProcessName, const RMessage2& aMessage, const TBool aPassive) const
+	{
+	//get the debug agent's process id
+	TProcessId clientProcessId = 0;
+	TInt err = GetProcessIdFromMessage(clientProcessId, aMessage);
+	if(err != KErrNone)
+		return EFalse;
+
+	//check permissions
+	if(aPassive)
+		return IsDebugger(aTargetProcessName, clientProcessId);
+	else
+		return IsActiveDebugger(aTargetProcessName, clientProcessId);
+	}
+
+/**
+Tests whether the debug agent is attached actively to the target debug process
+
+@param aTargetProcessName target debug process' FileName
+@param aDebugAgentProcessId process ID of a debug agent
+
+@return ETrue if the specified debug agent is actively attached to the 
+        specified target debug process, EFalse otherwise
+*/
+TBool CSecuritySvrServer::IsActiveDebugger(const TDesC& aTargetProcessName, const TProcessId aDebugAgentProcessId) const
+	{
+	//check whether the pair is in the active debug map
+	for(TInt i=0; i<iActiveDebugMap.Count(); i++)
+		{
+		if(iActiveDebugMap[i]->Equals(aTargetProcessName, aDebugAgentProcessId))
+			return ETrue;
+		}
+	//not found so return false
+	return EFalse;
+	}
+
+/**
+Tests whether the target process is being debugged
+
+@param aTargetProcessName target process' FileName
+@param aPassive indicates whether to check for the process being actively debugged,
+or passively debugged
+
+@return ETrue if the specified target process is being debugged,
+        EFalse otherwise
+*/
+TBool CSecuritySvrServer::IsDebugged(const TDesC& aTargetProcessName, const TBool aPassive) const
+	{
+	//get a reference to the appropriate list
+	const RPointerArray<CProcessPair>& map = (aPassive) ? iPassiveDebugMap : iActiveDebugMap;
+
+	//iterate through the map trying to match the aTargetProcessName
+	for(TInt i=0; i<map.Count(); i++)
+		{
+		if(map[i]->ProcessNameMatches(aTargetProcessName))
+			{
+			return ETrue;
+			}
+		}
+	return EFalse;
+	}
+
+/**
+Tests whether the debug agent is attached to the target debug process
+
+@param aTargetProcessName target debug process' FileName
+@param aDebugAgentProcessId process ID of a debug agent
+
+@return ETrue if the specified debug agent is attached to the 
+        specified target debug process (regardless of whether it is attached
+	passively or actively), EFalse otherwise
+*/
+TBool CSecuritySvrServer::IsDebugger(const TDesC& aTargetProcessName, const TProcessId aDebugAgentProcessId) const
+	{
+	//check whether the pair is in the active debug map
+	if(IsActiveDebugger(aTargetProcessName, aDebugAgentProcessId))
+		return ETrue; 
+
+	//check whether the pair is in the passive debug map
+	for(TInt i=0; i<iPassiveDebugMap.Count(); i++)
+		{
+		if(iPassiveDebugMap[i]->Equals(aTargetProcessName, aDebugAgentProcessId))
+			return ETrue;
+		}
+	//not found so return false
+	return EFalse;
+	}
+
+/**
+Decrements the server's count of how many sessions are connected to it and
+starts the shutdown timer if there are no sessions connected
+*/
+void CSecuritySvrServer::SessionClosed()
+	{
+	if(--iSessionCount < 1)
+		{
+		iShutdown.Start();
+		}
+	}
+
+/**
+Increments the servers count of how many sessions are connected to it and
+cancels the shutdown timer if it is running
+*/
+void CSecuritySvrServer::SessionOpened()
+	{
+	iSessionCount++;
+	iShutdown.Cancel();
+	}
+
+/** 
+  Get the process id of the thread which sent aMessage
+  @param aProcessId process id of the thread which sent aMessage
+  @param aMessage message object sent by thread 
+
+  @return KErrNone if aProcessId could be set, or one of the system wide error codes if not
+  */
+TInt CSecuritySvrServer::GetProcessIdFromMessage(TProcessId& aProcessId, const RMessage2& aMessage) const
+	{
+	//get the debug agent's thread
+	RThread clientThread;
+	TInt err = aMessage.Client(clientThread);
+	if(err != KErrNone)
+		{
+		return err;
+		}
+
+	//get the debug agent's process
+	RProcess clientProcess;
+	err = clientThread.Process(clientProcess);
+
+	//finished with the thread handle so close it
+	clientThread.Close();
+
+	//check if there was an error from getting the process
+	if(err != KErrNone)
+		{
+		return err;
+		}
+
+	//get the debug agent's process id
+	aProcessId = clientProcess.Id();
+
+	//finished with the process handle so close it
+	clientProcess.Close();
+
+	return KErrNone;
+	}
+
+/**
+  Helper function which determines whether the capabilities of the
+  OEM Token are sufficient to permit debug of an application.
+
+  Normally, we use the AllFiles capability as a proxy which
+  means a Debug Agent can debug non-debuggable executables,
+  provided it has a superset of the capabilities of the executable
+  to be debugged.
+ 
+  However, this causes the problem that all OEM Debug Tokens implicitly
+  give the power to debug an AllFiles executable, even if all that
+  is really needed is the power to debug an app with no capabilities,
+  or capabilities other than AllFiles.
+  
+  To address this, we treat the AllFiles capability in a special way.
+  The AllFiles capability in a token is taken to mean that an OEM has
+  signed the token, and hence can debug other executables. But this does
+  not inclue the ability to debug an AllFiles executable. To debug an AllFiles
+  executable, the token must also have TCB.
+
+  @param aTokenCaps - The PlatSec capabilities of a token
+  @param aTargetCaps - The PlatSec capabilities of a target app to be debugged
+
+  @return ETrue if authorised for debugging, EFalse otherwise.
+
+  @leave Any system error code.
+  */
+TBool CSecuritySvrServer::OEMTokenPermitsDebugL(const TCapabilitySet aTokenCaps, const TCapabilitySet aTargetCaps)
+	{	
+	LOG_MSG("CSecuritySvrSession::OEMTokenPermitsDebugL\n");
+
+	// Is the token valid - i.e. does it have AllFiles.
+	if ( !aTokenCaps.HasCapability(ECapabilityAllFiles) )
+		{
+		// Token is not valid, as it does not have AllFiles.
+		LOG_MSG("CSecuritySvrSession::OEMTokenPermitsDebugL - Token does not have AllFiles\n");
+			
+		return EFalse;
+		}
+
+	// Token MUST have a strict superset of capabilities
+	if ( !aTokenCaps.HasCapabilities(aTargetCaps) )
+		{
+		// Token does not have at least all the capabilities of the target
+		LOG_MSG("CSecuritySvrSession::OEMTokenPermitsDebugL - Token does not have superset of target capabilities\n");
+
+		return EFalse;
+		}
+
+	// Special case: If the target has AllFiles, the Token must have TCB
+	if ( aTargetCaps.HasCapability(ECapabilityAllFiles) )
+		{
+		// Target has AllFiles, so does the Token have TCB?
+		if ( !aTokenCaps.HasCapability(ECapabilityTCB) )
+			{
+			// Token does not have TCB.
+			LOG_MSG("CSecuritySvrSession::OEMTokenPermitsDebugL - Token does not have TCB when target has AllFiles\n");
+	
+			return EFalse;
+			}
+		}
+
+	// If we have passed all the above tests, the token permits debug
+	return ETrue;
+	}
+
+/**
+ * This looks at a debug tokens capability and ensures it is sufficient 
+ * to provide access to the flash partition
+ * @param aTokenCaps Capabilties of the Token
+ * @return TBool Whether or not flash access is permitted
+ */
+TBool CSecuritySvrServer::OEMTokenPermitsFlashAccessL(const TCapabilitySet aTokenCaps)
+	{	
+	//Must have TCB to access flash
+	return aTokenCaps.HasCapability(ECapabilityTCB);
+	}
+
+//eof
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/debug/securityServer/src/c_security_svr_session.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,2593 @@
+// 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"
+// 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 security server session implementation.
+// 
+//
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+
+// Needed so we get the text strings for capabilities
+#define __INCLUDE_CAPABILITY_NAMES__
+
+#include <e32std.h>
+#include <e32std_private.h>
+#include <e32btrace.h>
+#include <d32btrace.h>
+#include <e32base.h>
+#include <e32base_private.h>
+#include <e32uid.h>
+#include <f32file.h>
+#include <e32capability.h>
+#include <rm_debug_api.h>
+
+// required for direct parsing of e32image/tromimage headers
+#include <f32image.h>
+#include <e32rom.h>
+
+//added for direct access to media driver
+#include <partitions.h>
+#include <ftlcontrolio.h>
+
+#include "c_security_svr_session.h"
+#include "c_security_svr_server.h"
+#include "c_security_svr_async.h"
+#include "rm_debug_logging.h"
+#ifdef _DEBUG
+#include "low_mem_requests.h"
+#endif
+
+using namespace Debug;
+
+CSecuritySvrSession::CSecuritySvrSession()
+	: iDebugAgentProcessIdStored(EFalse),
+	  iDebugAgentProcessId(0),
+	  iServerNotified(EFalse),
+	  iCrashConnected(EFalse)
+	{
+	// Ensure that this debug agent has no target capability override
+	// by default
+	iOEMDebugCapabilities.SetEmpty();
+	}
+
+void CSecuritySvrSession::ServiceError(const RMessage2 &aMessage, TInt aError)
+	{
+	LOG_MSG2("CSecuritySvrSession::ServiceError(), aError: %d\n", aError);
+
+	//insert ending heap markers
+	HeapWatcher(aMessage.Function(), EFalse);
+
+	aMessage.Complete(aError);
+	}
+
+/**
+Called by the client/server framework as part of session creation.
+
+Notifies the server that a session is being created
+*/
+void CSecuritySvrSession::CreateL()
+	{
+	LOG_MSG("CSecuritySvrSession::CreateL()\n");
+
+	//notify the server that the session has been opened
+	Server().SessionOpened();
+	iServerNotified = ETrue;
+	}
+
+/**
+  Returns a reference to the DSS
+
+  @return a reference to the DSS
+  */
+CSecuritySvrServer& CSecuritySvrSession::Server() const
+    {
+    return *static_cast<CSecuritySvrServer*>(const_cast<CServer2*>(CSession2::Server()));
+    }
+
+/**
+Session destructor. Performs necessary cleanup and notifies the server that the
+session is being closed
+*/
+CSecuritySvrSession::~CSecuritySvrSession()
+	{
+	LOG_MSG("CSecuritySvrSession::~CSecuritySvrSession!()\n");
+
+	//forced detachment if attached to processes
+	if(iDebugAgentProcessIdStored)
+		{
+		// Cancel any outstanding async objects.
+		iAsyncHandlers.ResetAndDestroy();
+		
+		// Inform the device driver of the agent detach.
+		Server().iKernelDriver.DetachAgent(iDebugAgentProcessId.Id());
+
+		LOG_MSG( "CSecuritySvrSession::~CSecuritySvrSession() : -> securityServer.DetachAllProcesses()\n" );
+		Server().DetachAllProcesses(iDebugAgentProcessId);
+		}
+
+	//notify the server that the session has closed
+	if(iServerNotified)
+		{
+		Server().SessionClosed();
+		}
+	}
+
+void CSecuritySvrSession::ConstructL()
+	{
+	// nothing to do
+	}
+
+/**
+  Used to insert heap checking markers.
+
+  @param aFunction The function that heap markers should be added for
+  @param aEntry if ETrue indicates that heap checking is starting, if EFalse
+  that heap checking is ending.
+  */
+void CSecuritySvrSession::HeapWatcher(const TUint32 aFunction, const TBool aEntry) const
+	{
+	switch(aFunction)
+		{
+		case EDebugServAttachExecutable:
+			return;
+		case EDebugServDetachExecutable:
+			return;
+		case EDebugServSuspendThread:
+			return;
+		case EDebugServResumeThread:
+			return;
+// used for out-of-memory testing in debug mode
+#ifdef _DEBUG
+		// start heap marking in on entry, do nothing on exit
+		case EDebugServMarkHeap:
+			{
+			if(aEntry)
+				{
+				__UHEAP_MARK;
+				}
+			return;
+			}
+		// stop heap marking on exit, do nothing on entry
+		case EDebugServMarkEnd:
+			{
+			if(!aEntry)
+				{
+				__UHEAP_MARKEND;
+				}
+			return;
+			}
+#endif
+		default:
+			if(aEntry)
+				{
+				__UHEAP_MARK;
+				}
+			else
+				{
+				__UHEAP_MARKEND;
+				}
+			return;
+		}
+	}
+
+void CSecuritySvrSession::ServiceL(const RMessage2& aMessage)
+//
+// Session service handler
+//
+	{
+	//insert starting heap markers
+	HeapWatcher(aMessage.Function(), ETrue);
+
+	switch(aMessage.Function())
+		{
+		case EDebugServResumeThread:
+			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServResumeThread\n" );
+			ResumeThreadL(aMessage);
+			break;
+
+		case EDebugServSuspendThread:
+			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServSuspendThread\n" );
+			SuspendThreadL(aMessage);
+			break;
+
+		case EDebugServReadMemory:
+			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServReadMemory\n" );
+			ReadMemoryL(aMessage);
+			break;
+
+		case EDebugServWriteMemory:
+			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServWriteMemory\n" );
+			WriteMemoryL(aMessage);
+			break;
+
+		case EDebugServSetBreak:
+			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServSetBreak\n" );
+			SetBreakL(aMessage);
+			break;
+
+		case EDebugServClearBreak:
+			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServClearBreak\n" );
+			ClearBreakL(aMessage);
+			break;
+
+		case EDebugServModifyBreak:
+			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServModifyBreak\n" );
+			ModifyBreakL(aMessage);
+			break;
+
+		case EDebugServModifyProcessBreak:
+			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServModifyProcessBreak\n" );
+			ModifyProcessBreakL(aMessage);
+			break;
+
+		case EDebugServBreakInfo:
+			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServBreakInfo\n" );
+			BreakInfoL(aMessage);
+			break;
+
+		case EDebugServReadRegisters:
+			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServReadRegisters\n" );
+			ReadRegistersL(aMessage);
+			break;
+
+		case EDebugServWriteRegisters:
+			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServWriteRegisters\n" );
+			WriteRegistersL(aMessage);
+			break;
+
+		case EDebugServGetEvent:
+			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServGetEvent\n" );
+			GetEventL(aMessage);
+			break;
+
+		case EDebugServCancelGetEvent:
+			CancelGetEventL(aMessage);
+			break;
+
+		case EDebugServAttachExecutable:
+			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServAttachExecutable\n" );
+			AttachProcessL(aMessage);
+			break;
+
+		case EDebugServDetachExecutable:
+			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServDetachExecutable\n" );
+			DetachProcessL(aMessage);
+			break;
+
+		case EDebugServGetDebugFunctionalityBufSize:
+			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServGetDebugFunctionalityBufSize\n" );
+			GetDebugFunctionalityBufSizeL(aMessage);
+			break;
+
+		case EDebugServGetDebugFunctionality:
+			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServGetDebugFunctionality\n" );
+			GetDebugFunctionalityL(aMessage);
+			break;
+
+		case EDebugServSetEventAction:
+			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServSetEventAction\n" );
+			SetEventActionL(aMessage);
+			break;
+
+		case EDebugServGetList:
+			LOG_MSG( "CSecuritySvrSession::ServiceL() EDebugServGetList\n" );
+			GetListL(aMessage);
+			break;
+
+		case EDebugServStep:
+			LOG_MSG("CSecuritySvrSession::ServiceL() EDebugServStep\n");
+			StepL(aMessage);
+			break;
+
+		case EDebugServSetProcessBreak:
+			LOG_MSG("CSecuritySvrSession::ServiceL() EDebugServSetProcessBreak\n");
+			SetProcessBreakL(aMessage);
+			break;
+		
+		case EDebugServProcessBreakInfo:
+			LOG_MSG("CSecuritySvrSession::ServiceL() EDebugServProcessBreakInfo\n");
+			ProcessBreakInfoL(aMessage);
+			break;
+
+		case EDebugServKillProcess:
+			LOG_MSG("CSecuritySvrSession::ServiceL() EDebugServKillProcess\n");
+			KillProcessL(aMessage);
+			break;
+
+#ifdef _DEBUG
+		case EDebugServMarkHeap:
+			LOG_MSG("CSecuritySvrSession::ServiceL() EDebugServMarkHeap\n");
+			// all taken care of in HeapWatcher
+			aMessage.Complete(KErrNone);
+			break;
+
+		case EDebugServMarkEnd:
+			LOG_MSG("CSecuritySvrSession::ServiceL() EDebugServMarkEnd\n");
+			// all taken care of in HeapWatcher
+			aMessage.Complete(KErrNone);
+			break;
+
+		case EDebugServFailAlloc:
+			LOG_MSG("CSecuritySvrSession::ServiceL() EDebugServFailAlloc\n");
+			DoFailAlloc(aMessage);
+			break;
+#endif
+		case EDebugServReadCrashFlash:
+			ReadCrashLogL(aMessage);
+			break;		
+		case EDebugServWriteCrashFlash:
+			LOG_MSG("CSecuritySvrSession::ServiceL() EDebugServWriteCrashFlash\n");
+			WriteCrashConfigL(aMessage);
+			break;
+		case EDebugServEraseCrashFlash:
+			LOG_MSG("CSecuritySvrSession::ServiceL() EDebugServEraseCrashFlash\n");
+			EraseCrashLogL(aMessage);
+			break;
+		case EDebugServEraseEntireCrashFlash:
+			LOG_MSG("CSecuritySvrSession::ServiceL() EDebugServEraseEntireCrashFlash\n");
+			EraseEntireCrashLogL(aMessage);
+			break;
+		default:
+			LOG_MSG( "CSecuritySvrSession::ServiceL() Unknown request, calling User::Leave(KErrNotSupported);\n" );
+			User::Leave(KErrNotSupported);
+			break;
+		}
+
+	//insert ending heap markers
+	HeapWatcher(aMessage.Function(), EFalse);
+	}
+
+#ifdef _DEBUG
+/**
+  Used to control heap failure in debug mode.
+  @param aMessage If aMessage.Int0 is non-zero then heap will be set to fail on that allocation.
+  If aMessage.Int0 is zero then the heap failure count is reset
+  */
+void CSecuritySvrSession::DoFailAlloc(const RMessage2& aMessage)
+	{
+	TInt count = aMessage.Int0();
+	if(count == 0)
+		{
+		__UHEAP_RESET;
+		}
+	else
+		{
+		__UHEAP_FAILNEXT(count);
+		}
+	aMessage.Complete(KErrNone);
+	}
+#endif
+
+/**
+Suspends execution of the specified thread.
+
+@param aMessage contains an integer representation of the target thread's
+       thread ID at offset 0.
+
+@leave KErrPermissionDenied if security check fails or KErrArgument if the
+       thread does not exist
+*/
+void CSecuritySvrSession::SuspendThreadL(const RMessage2& aMessage)
+	{
+
+	LOG_MSG( "CSecuritySvrSession::SuspendThreadL()\n" );
+
+	//get thread ID
+	TThreadId threadId = ReadTThreadIdL(aMessage, 0);
+	//check attached
+	CheckAttachedL(threadId, aMessage, EFalse);
+
+	//security check passed so can perform actions
+	User::LeaveIfError(Server().iKernelDriver.SuspendThread(threadId));
+
+	aMessage.Complete(KErrNone);
+	}
+
+/**
+Resumes execution of the specified thread.
+
+@param aMessage contains an integer representation of the target thread's
+       thread ID at offset 0.
+
+@leave KErrPermissionDenied if security check fails or KErrArgument if the
+       thread does not exist
+*/
+void CSecuritySvrSession::ResumeThreadL(const RMessage2& aMessage)
+	{
+	LOG_MSG( "CSecuritySvrSession::ResumeThreadL()\n" );
+
+	//get thread ID
+	TThreadId threadId = ReadTThreadIdL(aMessage, 0);
+
+	//check attached
+	CheckAttachedL(threadId, aMessage, EFalse);
+	
+	//security check passed so can perform actions
+	TInt err = Server().iKernelDriver.ResumeThread(threadId);
+	aMessage.Complete(err);
+	}
+
+void CSecuritySvrSession::GetDebugFunctionalityBufSizeL(const RMessage2& aMessage)
+//
+// Retrieve size of functionality data buffer in bytes which must be allocated
+// by the client
+//
+	{
+	LOG_MSG( "CSecuritySvrSession::GetDebugFunctionalityBufSizeL()\n" );
+
+	TUint32 result = 0;
+	// Get Buffer size from the kernel driver
+	User::LeaveIfError(Server().iKernelDriver.GetDebugFunctionalityBufSize(result));
+
+	TPtr8 stuff((TUint8*)&result,4, 4);
+
+	aMessage.WriteL(0,stuff);
+
+	aMessage.Complete(KErrNone);
+	}
+
+void CSecuritySvrSession::GetDebugFunctionalityL(const RMessage2& aMessage)
+//
+// Retrieve the functionality data and place it in a buffer
+// allocated by the client.
+//
+	{
+	LOG_MSG( "CSecuritySvrSession::GetDebugFunctionalityL()\n" );
+
+	TUint32 dfsize = 0;
+
+	// Get Buffer size from the kernel driver
+	User::LeaveIfError(Server().iKernelDriver.GetDebugFunctionalityBufSize(dfsize));
+
+	// Allocate space for the functionality data
+	HBufC8* dftext = HBufC8::NewLC(dfsize);
+
+	const TPtr8& dfPtr = dftext->Des();
+
+	// Extract said data from the device driver
+	User::LeaveIfError(Server().iKernelDriver.GetDebugFunctionality((TDes8&)dfPtr));
+
+	// Return data to client
+	aMessage.WriteL(0,dfPtr);
+
+	// Free buffer
+	CleanupStack::PopAndDestroy(dftext);
+
+	aMessage.Complete(KErrNone);
+	}
+
+/**
+Reads memory from a specified thread using the passed parameters. The user 
+should ensure that the TPtr8 that is passed in has size greater than or equal
+to the size of the memory that is trying to be read.
+
+@param aMessage The RMessage2 object should be constructed as follows:
+    * aMessage.Int0() is the thread ID of the target debug app
+    * aMessage.Ptr1() is a TMemoryInfo object which contains the following:
+        * the address of the memory to be read from the target debug thread
+        * the size of the memory block to be read from the target debug thread
+	* the access size to use
+	* the endianess to interpret the data as
+    * aMessage.Ptr2() is the address of the buffer in the debug agent thread 
+      that the data from the target debug app should be written into 
+
+@leave KErrPermissionDenied if client is not attached to the target
+       thread's process,
+       KErrNoMemory if memory could not be allocated,
+       KErrArgument if there are problems with the aMessage object,
+       KErrBadHandle if the thread represented by aMessage.Ptr0() is invalid,
+       an error value from CSecuritySvrSession::ValidateMemoryInfo if checking
+       the memory attributes failed,
+       or another of the system wide error codes
+*/
+void CSecuritySvrSession::ReadMemoryL(const RMessage2& aMessage)
+	{
+	LOG_MSG( "CSecuritySvrSession::ReadMemoryL()\n" );
+
+	//get debug app thread ID
+	TThreadId threadId = ReadTThreadIdL(aMessage, 0);
+
+	CheckAttachedL(threadId, aMessage, ETrue);
+
+	//create and initialise the memory info object
+	TMemoryInfo targetMemory;
+	TPtr8 targetMemoryPtr( (TUint8 *)&targetMemory, sizeof(TMemoryInfo) );
+
+	aMessage.ReadL(1,targetMemoryPtr);
+
+	//check memory info is acceptable
+	ValidateMemoryInfoL(threadId, targetMemory, ETrue);
+
+	RBuf8 data;
+	data.CreateL(targetMemory.iSize);
+	data.CleanupClosePushL();
+
+	//fill buffer with data from target debug thread
+	User::LeaveIfError(Server().iKernelDriver.ReadMemory(threadId, targetMemory.iAddress, targetMemory.iSize, data));
+
+	//attempt to write the data from the target debug thread back to the agent
+	aMessage.WriteL(2, data);
+
+	//delete temporary buffer
+	CleanupStack::PopAndDestroy(&data);
+
+	aMessage.Complete(KErrNone);
+	}
+
+/**
+Writes memory to a specified thread using the passed parameters. 
+
+@param aMessage The RMessage2 object should be constructed as follows:
+    * aMessage.Ptr0() is the thread ID of the target debug app
+    * aMessage.Ptr1() is a TMemoryInfo object which contains the following:
+        * the address of the memory to be written to the target debug thread
+        * the size of the memory block to be written to the target debug thread
+	* the access size to use
+	* the endianess to interpret the data as
+    * aMessage.Ptr2() is the address of the buffer in the debug agent thread 
+      that the data to write to the target debug app should be read from
+
+@leave KErrPermissionDenied if client is not attached (actively) to the target
+       thread's process,
+       KErrNoMemory if memory could not be allocated,
+       KErrArgument if there are problems with the aMessage object,
+       KErrBadHandle if the thread represented by aMessage.Ptr0() is invalid,
+       an error value from CSecuritySvrSession::ValidateMemoryInfo if checking
+       the memory attributes failed,
+       or another of the system wide error codes
+*/
+void CSecuritySvrSession::WriteMemoryL(const RMessage2& aMessage)
+	{
+	LOG_MSG( "CSecuritySvrSession::WriteMemoryL()\n" );
+
+	//get debug app thread ID
+	TThreadId threadId = ReadTThreadIdL(aMessage, 0);
+
+	CheckAttachedL(threadId, aMessage, EFalse);
+
+	//create and initialise the memory info object
+	TMemoryInfo targetMemory;
+	TPtr8 targetMemoryPtr( (TUint8 *)&targetMemory, sizeof(TMemoryInfo) );
+
+	aMessage.ReadL(1,targetMemoryPtr);
+
+	//check memory info is acceptable
+	ValidateMemoryInfoL(threadId, targetMemory, EFalse);
+
+	//create temporary buffer and read data from client
+	RBuf8 data;
+	data.CreateL(targetMemory.iSize);
+	data.CleanupClosePushL();
+	
+	aMessage.ReadL(2, data);
+
+	// what about telling the driver about endianess/access size?
+	User::LeaveIfError(Server().iKernelDriver.WriteMemory(threadId, targetMemory.iAddress, targetMemory.iSize, data));
+
+	//free temporary buffer
+	CleanupStack::PopAndDestroy(&data);
+
+	aMessage.Complete(KErrNone);
+	}
+
+/**
+@internalTechnology
+
+Notes: This call is used to set a thread specific breakpoint. Its input arguments
+are the thread id, address and architecture type of the breakpoint. It returns success
+or failure, and if successful, it sets the TBreakId in the Debug Agent to the 
+breakpoint id by which it can be referenced in future calls to ModifyBreak,ClearBreak and
+BreakInfo.
+
+@param aMessage.Ptr0() - aThreadId is thread id of the target debug process
+@param aMessage.Ptr1() - Address of a TBreakInfo in the Debug Agent
+@param aMessage.Ptr2() - Address of a TBreakId in the Debug Agent
+@leave KErrPermissionDenied if the security check fails.
+ KErrAlreadyExists if there is a breakpoint overlapping the desired address.
+ KErrNotSupported if the architecture type is unrecognised.
+ KErrNoMemory if there is no more memory to complete the operation.
+ KErrArgument if the breakpoint address alignment is unsuitable for the requested
+ breakpoint.
+ KErrOverflow if there are too many breakpoints set.
+*/
+void CSecuritySvrSession::SetBreakL(const RMessage2& aMessage)
+	{
+	LOG_MSG( "CSecuritySvrSession::SetBreakL!()\n" );
+
+	//get debug app thread ID
+	TThreadId threadId = ReadTThreadIdL(aMessage, 0);
+
+	//check that the agent has attached to the target process
+	CheckAttachedL(threadId, aMessage, EFalse);
+
+	//create and initialise the memory info object
+	TBreakInfo breakInfo;
+	TPtr8 breakInfoPtr( (TUint8 *)&breakInfo, sizeof(TBreakInfo) );
+
+	aMessage.ReadL(1,breakInfoPtr);
+
+	//set break in target app
+	TBreakId breakId = 0;
+	User::LeaveIfError(Server().iKernelDriver.SetBreak(breakId, threadId, breakInfo.iAddress, breakInfo.iArchitectureMode));
+
+	//attempt to write the break id back to the debug agent
+	WriteDataL(aMessage, 2, &breakId, sizeof(breakId));
+
+	aMessage.Complete(KErrNone);
+	}
+
+/**
+Clears a breakpoint previously set by a SetBreak() call.
+
+@param aMessage.Int0() - TBreakId of the breakpoint to be removed.
+*/
+void CSecuritySvrSession::ClearBreakL(const RMessage2& aMessage)
+	{
+	LOG_MSG( "CSecuritySvrSession::ClearBreakL()\n" );
+
+	const TInt breakId = aMessage.Int0();
+
+	// Check that the breakpoint exists
+	TUint64 objectId;
+	TUint32 address;
+	TArchitectureMode mode;
+	TBool threadSpecific = EFalse;
+
+	User::LeaveIfError(Server().iKernelDriver.BreakInfo(breakId,objectId,address,mode,threadSpecific));
+
+	if(threadSpecific)
+		{
+		// Check that the debug agent is attached to the thread for which the
+		// breakpoint is currently set.
+		CheckAttachedL(TThreadId(objectId), aMessage, EFalse);
+		}
+	else
+		{
+		// Check that the debug agent is attached to the process for which the
+		// breakpoint is currently set.
+		CheckAttachedL(TProcessId(objectId), aMessage, EFalse);
+		}
+
+	// Finally clear the breakpoint
+	User::LeaveIfError(Server().iKernelDriver.ClearBreak(breakId));
+
+	aMessage.Complete(KErrNone);
+	}
+
+/**
+@param aMessage.Int0() - Breakpoint Id of interest
+@param aMessage.Ptr1() - Address in Debug Agent to place threadId of the breakpoint
+@param aMessage.Ptr2() - Address in Debug Agent to place address of the breakpoint
+@param aMessage.Ptr3() - Address in Debug Agent to place the architecture mode of the breakpoint
+@leave Any error which may be returned by RSessionBase::SendReceive()
+*/
+void CSecuritySvrSession::BreakInfoL(const RMessage2& aMessage)
+	{
+	const TBreakId breakId = (TBreakId)aMessage.Int0();
+
+	TThreadId threadId;
+	TUint32 address;
+	TArchitectureMode mode;
+	TBool threadSpecific = ETrue;
+
+	TUint64 threadIdData;
+	User::LeaveIfError(Server().iKernelDriver.BreakInfo(breakId,threadIdData,address,mode,threadSpecific));
+
+	if(!threadSpecific)
+		{
+		User::Leave(KErrNotFound);
+		}
+
+	threadId = TThreadId(threadIdData);
+
+	//check that the agent has attached to the target process
+	CheckAttachedL(threadId, aMessage, EFalse);
+
+	// return the threadId
+	WriteDataL(aMessage, 1, &threadId, sizeof(threadId));
+
+	// return the address
+	WriteDataL(aMessage, 2, &address, sizeof(address));
+
+	// return the mode
+	WriteDataL(aMessage, 3, &mode, sizeof(mode));
+
+	aMessage.Complete(KErrNone);
+	}
+
+/**
+@internalTechnology
+
+Modify a previously set breakpoint.
+
+@param aMessage.Int0() - The breakpoint id of the breakpoint to modify
+@param aMessage.Ptr1() - The new Thread Id for the breakpoint
+@param aMessage.Int2() - The new virtual memory address for the breakpoint
+@param aMessage.Int3() - The new architecture mode for the breakpoint
+@return KErrNone if succesful. KErrPermissionDenied if the security check fails.
+ KErrAlreadyExists if there is a breakpoint overlapping the desired address.
+ KErrNotSupported if the architecture type is unrecognised.
+ KErrNoMemory if there is no more memory to complete the operation.
+ KErrArgument if the breakpoint address alignment is unsuitable for the requested
+ breakpoint.
+ KErrOverflow if there are too many breakpoints set.
+*/
+void CSecuritySvrSession::ModifyBreakL(const RMessage2& aMessage)
+	{
+	const TBreakId breakId = (TBreakId)aMessage.Int0();
+	const TThreadId threadId = ReadTThreadIdL(aMessage, 1);
+	const TUint32 address = aMessage.Int2();
+	const TArchitectureMode mode = (TArchitectureMode)aMessage.Int3();
+
+	// Get information on the breakpoint to check the security status
+	TUint64 checkThreadId;
+	TUint32 checkAddress;
+	TArchitectureMode checkMode;
+	TBool threadSpecific;
+
+	User::LeaveIfError(Server().iKernelDriver.BreakInfo(breakId,checkThreadId,checkAddress,checkMode,threadSpecific));
+
+	// Security check that the thread Id is associated with the debug agent
+
+	//check that the agent has attached to the target process
+	CheckAttachedL(TThreadId(checkThreadId), aMessage, EFalse);
+
+	// now check that the thread Id which is being set is permitted
+	//check that the agent has attached to the target process
+	CheckAttachedL(threadId, aMessage, EFalse);
+
+	User::LeaveIfError(Server().iKernelDriver.ModifyBreak(breakId,threadId,address,mode));
+
+	aMessage.Complete(KErrNone);
+	}
+
+/**
+@internalTechnology
+
+Notes: This call is used to set a process wide breakpoint. Its input arguments
+are the process id, address and architecture type of the breakpoint. It returns success
+or failure, and if successful, it sets the TBreakId in the Debug Agent to the 
+breakpoint id by which it can be referenced in future calls to ModifyBreak,ClearBreak and
+BreakInfo.
+
+@param aMessage.Ptr0() - aProcessId is process id of the target debug process
+@param aMessage.Ptr1() - Address of a TBreakInfo in the Debug Agent
+@param aMessage.Ptr2() - Address of a TBreakId in the Debug Agent
+@leave KErrPermissionDenied if the security check fails.
+ KErrAlreadyExists if there is a breakpoint overlapping the desired address.
+ KErrNotSupported if the architecture type is unrecognised.
+ KErrNoMemory if there is no more memory to complete the operation.
+ KErrArgument if the breakpoint address alignment is unsuitable for the requested
+ breakpoint.
+ KErrOverflow if there are too many breakpoints set.
+*/
+void CSecuritySvrSession::SetProcessBreakL(const RMessage2& aMessage)
+	{
+	LOG_MSG( "CSecuritySvrSession::SetProcessBreakL()\n" );
+
+	//get debug app thread ID
+	TProcessId procId = ReadTProcessIdL(aMessage, 0);
+
+	//check that the agent has attached to the target process
+	CheckAttachedL(procId, aMessage, EFalse);
+
+	//create and initialise the memory info object
+	TBreakInfo breakInfo;
+	TPtr8 breakInfoPtr( (TUint8 *)&breakInfo, sizeof(TBreakInfo) );
+
+	aMessage.ReadL(1,breakInfoPtr);
+
+	//set break in target app
+	TBreakId breakId = 0;
+	User::LeaveIfError(Server().iKernelDriver.SetProcessBreak(breakId, procId, breakInfo.iAddress, breakInfo.iArchitectureMode));
+
+	//attempt to write the break id back to the debug agent
+	WriteDataL(aMessage, 2, &breakId, sizeof(breakId));
+
+	aMessage.Complete(KErrNone);
+	}
+
+/**
+@internalTechnology
+
+Modify a previously set process breakpoint.
+
+@param aMessage.Int0() - The breakpoint id of the breakpoint to modify
+@param aMessage.Ptr1() - The new Process Id for the breakpoint
+@param aMessage.Int2() - The new virtual memory address for the breakpoint
+@param aMessage.Int3() - The new architecture mode for the breakpoint
+@return KErrNone if succesful. KErrPermissionDenied if the security check fails.
+ KErrAlreadyExists if there is a breakpoint overlapping the desired address.
+ KErrNotSupported if the architecture type is unrecognised.
+ KErrNoMemory if there is no more memory to complete the operation.
+ KErrArgument if the breakpoint address alignment is unsuitable for the requested
+ breakpoint.
+ KErrOverflow if there are too many breakpoints set.
+*/
+void CSecuritySvrSession::ModifyProcessBreakL(const RMessage2& aMessage)
+	{
+	const TBreakId breakId = (TBreakId)aMessage.Int0();
+	const TProcessId processId = ReadTProcessIdL(aMessage, 1);
+	const TUint32 address = aMessage.Int2();
+	const TArchitectureMode mode = (TArchitectureMode)aMessage.Int3();
+
+	// Get information on the breakpoint to check the security status
+	TUint64 checkProcessId;
+	TUint32 checkAddress;
+	TArchitectureMode checkMode;
+	TBool threadSpecific;
+
+	User::LeaveIfError(Server().iKernelDriver.BreakInfo(breakId,checkProcessId,checkAddress,checkMode,threadSpecific));
+
+	// Security check that the thread Id is associated with the debug agent
+
+	//check that the agent has attached to the target process
+	CheckAttachedL(TProcessId(checkProcessId), aMessage, EFalse);
+
+	// now check that the thread Id which is being set is permitted
+	//check that the agent has attached to the target process
+	CheckAttachedL(processId, aMessage, EFalse);
+
+	User::LeaveIfError(Server().iKernelDriver.ModifyProcessBreak(breakId,processId,address,mode));
+
+	aMessage.Complete(KErrNone);
+	}
+
+/**
+@param aMessage.Int0() - Breakpoint Id of interest
+@param aMessage.Ptr1() - Address in Debug Agent to place process Id of the breakpoint
+@param aMessage.Ptr2() - Address in Debug Agent to place address of the breakpoint
+@param aMessage.Ptr3() - Address in Debug Agent to place the architecture mode of the breakpoint
+@leave Any error which may be returned by RSessionBase::SendReceive()
+*/
+void CSecuritySvrSession::ProcessBreakInfoL(const RMessage2& aMessage)
+	{
+	const TBreakId breakId = (TBreakId)aMessage.Int0();
+
+	TProcessId procId;
+	TUint32 address;
+	TArchitectureMode mode;
+	TBool threadSpecific;
+
+	TUint64 procIdData;
+	User::LeaveIfError(Server().iKernelDriver.BreakInfo(breakId,procIdData,address,mode,threadSpecific));
+	if(threadSpecific)
+		{
+		User::Leave(KErrNotFound);
+		}
+	procId = TProcessId(procIdData);
+
+	//check that the agent has attached to the target process
+	CheckAttachedL(procId, aMessage, EFalse);
+
+	// return the processId
+	WriteDataL(aMessage, 1, &procId, sizeof(procId));
+
+	// return the address
+	WriteDataL(aMessage, 2, &address, sizeof(address));
+
+	// return the mode
+	WriteDataL(aMessage, 3, &mode, sizeof(mode));
+
+	aMessage.Complete(KErrNone);
+	}
+
+/**
+Read register values.
+
+@param aMessage should contain:
+        * at offset 0 a pointer to the thread ID of the target thread
+        * at offset 1 a descriptor representing an array of TRegisterInfo 
+          register IDs
+        * at offset 2 a descriptor representing an array into which TRegisterValue 
+          register values will be written
+        * at offset 3 a descriptor representing an array into which TUint8 
+          register flags will be written
+
+@leave KErrArgument if the max length of the array at offset 1 is not a 
+       multiple of sizeof(TRegisterInfo), if the max length of the array 
+       at offset 2 is not a multiple of sizeof(TRegisterValue), if the max 
+       length of the array at offset 3 is not a multiple of sizeof(TUint8), if
+       any of the descriptors have max length of 0, or if the three 
+       descriptors do not represent the same number of registers,
+       KErrNoMemory if there is insufficient memory,
+       KErrDied, if the thread with thread ID aThreadId is dead
+*/
+void CSecuritySvrSession::ReadRegistersL(const RMessage2& aMessage)
+	{
+	LOG_MSG( "CSecuritySvrSession::ReadRegistersL()\n" );
+
+	const TThreadId threadId = ReadTThreadIdL(aMessage, 0);
+
+	//check the agent is attached to the thread
+	CheckAttachedL(threadId, aMessage, ETrue);
+
+	//number of registers being requested
+	TUint32 numberOfRegisters;
+
+	//check length of descriptors is acceptable
+	ValidateRegisterBuffersL(aMessage, numberOfRegisters);
+
+	// Passed data will be saved in this descriptor.
+	RBuf8 ids;
+	ids.CreateL(numberOfRegisters * sizeof(TRegisterInfo));
+	// Do the right cleanup if anything subsequently goes wrong
+	ids.CleanupClosePushL();
+	
+	//read the data from the client thread
+	aMessage.ReadL(1, ids);
+
+	//create buffer to fill with data from target debug thread
+	HBufC8 *data = HBufC8::NewLC(aMessage.GetDesMaxLength(2));
+	TPtr8 values(data->Des());   
+	
+	HBufC8 *flagsData = HBufC8::NewLC(numberOfRegisters * sizeof(TUint8));
+	TPtr8 flags(flagsData->Des());   
+	
+	//get register info and return relevant parts back to agent
+	User::LeaveIfError(Server().iKernelDriver.ReadRegisters(threadId, ids, values, flags));
+	aMessage.WriteL(2, values);
+	aMessage.WriteL(3, flags);
+	
+	//delete temporary buffers and return status
+	CleanupStack::PopAndDestroy(flagsData);
+	CleanupStack::PopAndDestroy(data);
+	CleanupStack::PopAndDestroy(&ids);
+
+	aMessage.Complete(KErrNone);
+	}
+
+/**
+Write register values.
+
+@param aMessage should contain:
+        * at offset 0 a pointer to the thread ID of the target thread
+        * at offset 1 a descriptor representing an array of TRegisterInfo 
+          register IDs
+        * at offset 2 a descriptor representing an array of TRegisterValue register 
+          values
+        * at offset 3 a descriptor representing an array into which TUint8 
+          register flags will be written
+
+@leave KErrArgument if the max length of the array at offset 1 is not a 
+       multiple of sizeof(TRegisterInfo), if the max length of the array 
+       at offset 2 is not a multiple of sizeof(TRegisterValue), if the max 
+       length of the array at offset 3 is not a multiple of sizeof(TUint8), if
+       any of the descriptors have max length of 0, or if the three 
+       descriptors do not represent the same number of registers,
+       KErrNoMemory if there is insufficient memory,
+       KErrDied, if the thread with thread ID aThreadId is dead
+*/
+void CSecuritySvrSession::WriteRegistersL(const RMessage2& aMessage)
+	{
+	LOG_MSG( "CSecuritySvrSession::WriteRegistersL()\n" );
+
+	const TThreadId threadId = ReadTThreadIdL(aMessage, 0);
+
+	CheckAttachedL(threadId, aMessage, EFalse);
+
+	//number of registers attempting to set
+	TUint32 numberOfRegisters;
+
+	//check length of descriptors is acceptable
+	ValidateRegisterBuffersL(aMessage, numberOfRegisters);
+
+	// Passed register ids will be saved in this descriptor.
+	RBuf8 ids;
+
+	//allocate buffer
+	ids.CreateL(numberOfRegisters * sizeof(TRegisterInfo));
+
+	// Do the right cleanup if anything subsequently goes wrong
+	ids.CleanupClosePushL();
+
+	//read the data from the client thread
+	aMessage.ReadL(1, ids);
+
+	// Passed register values will be saved in this descriptor.
+	RBuf8 values;
+
+	//allocate buffer
+	values.CreateL(aMessage.GetDesMaxLength(2));
+	// Do the right cleanup if anything subsequently goes wrong
+	values.CleanupClosePushL();
+	//read the data from the client thread
+	aMessage.ReadL(2,values);
+
+	HBufC8 *flagsData = HBufC8::NewLC(numberOfRegisters*sizeof(TUint8));
+	TPtr8 flags(flagsData->Des());
+
+	//get register info and return relevant parts back to agent
+	User::LeaveIfError(Server().iKernelDriver.WriteRegisters(threadId, ids, values, flags));
+
+	//write flags data back
+	aMessage.WriteL(3, flags);
+
+	CleanupStack::PopAndDestroy(flagsData);
+	CleanupStack::PopAndDestroy(&values);
+	CleanupStack::PopAndDestroy(&ids);
+
+	aMessage.Complete(KErrNone);
+	}
+
+/**
+Processes an attach request from a debug agent. Gets the target debug
+processes' original FileName as an argument. The method sets completion
+status of the aMessage argument to KErrNone if successfully attached and to
+another of the system wide error codes if there were problems.
+
+@param aMessage contains:
+       * a boolean at offset 0 which indicates whether the agent wishes to
+       attach passively
+       * a buffer at offset 1 which contains the FileName
+       of the target debug process.
+*/
+void CSecuritySvrSession::AttachProcessL(const RMessage2& aMessage)
+	{
+	LOG_MSG( "CSecuritySvrSession::AttachProcessL()\n" );
+
+	const TBool passive = aMessage.Int0();
+
+	TInt deslen = aMessage.GetDesLengthL(1);
+
+	// Passed data will be saved in this descriptor.
+	RBuf processName;
+
+	// Max length set to the value of "deslen", but current length is zero
+	processName.CreateL(deslen);
+
+	// Do the right cleanup if anything subsequently goes wrong
+	processName.CleanupClosePushL();
+
+	// Copy the client's descriptor data into our buffer.
+	aMessage.ReadL(1,processName);
+
+	//
+	// Security Check
+	//
+	// It is not permitted to debug the debug security server!
+	//
+	// get the secure id of the executable
+	TUid secureId(TUid::Null());
+	GetSecureIdL(processName, secureId);
+	if (KUidDebugSecurityServer.iUid == secureId.iUid)
+		{
+		// The debug agent has requested to debug the Debug Security Server
+		// This is either an error, or an attempt to breach security. We
+		// therefore refuse to agree to this request, and return KErrPermissionDenied
+		LOG_MSG("CSecuritySvrSession::AttachProcessL() - Debug Agent attempted to debug the Debug Security Server\n");
+
+		User::Leave(KErrPermissionDenied);
+		}
+
+	//get the debug agent's thread and push handle onto clean up stack
+	RThread clientThread;
+	User::LeaveIfError(aMessage.Client(clientThread));
+	CleanupClosePushL(clientThread);
+
+	//get the debug agent's process
+	RProcess clientProcess;
+	User::LeaveIfError(clientThread.Process(clientProcess));
+
+	//finished with thread so close handle and destroy
+	CleanupStack::PopAndDestroy(&clientThread);
+	
+	//get the debug agent's process id
+	TProcessId processId = clientProcess.Id();
+
+	//store the debug agent's process id for forced detaching later if the
+	//agent doesn't tidy up after itself
+	StoreDebugAgentId(processId);
+
+	// Read the OEM Debug token capabilities (if any)
+	GetDebugAgentOEMTokenCapsL();
+
+	//finished with process so close handle
+	clientProcess.Close();
+	
+	// Get the Security info via rlibrary::getinfo
+	RLibrary::TInfo info;
+	TPckg<RLibrary::TInfo> infoBuf(info);
+
+	TInt err = RLibrary::GetInfo(processName, infoBuf);
+	if (err != KErrNone)
+		{
+		LOG_MSG("CSecuritySvrSession::AttachProcessL() - Cannot parse the target executable header\n");
+		
+		// Could not read the header for this executable :-(
+
+		CleanupStack::PopAndDestroy(&processName);
+		
+		aMessage.Complete(KErrPermissionDenied);
+ 
+		return;
+		}
+	
+	// Special case for AllFiles - OEM Debug tokens MUST have
+	// AllFiles, as this is what allows them to read contents
+	// of other executables.
+	TBool checkDebuggable = ETrue;
+
+	// Does an OEM Debug Token permit debug where it would normally not be
+	// permitted?
+	if ( Server().OEMTokenPermitsDebugL(iOEMDebugCapabilities, info.iSecurityInfo.iCaps) )
+		{
+		// OEM Debug token is valid and has sufficient capabilities
+		LOG_MSG("CSecuritySvrSession::AttachProcessL() - Debug Agent has sufficient capabilites based on OEM Debug Token");	
+		
+		checkDebuggable = EFalse;
+		}
+
+	if (checkDebuggable)
+		{
+		// OEM Debug token (if any), does not confer sufficient capabilities to
+		// debug the specified target executable. Therefore debugging can only
+		// be permitted if the target executable itself has been built as 'Debuggable'
+		LOG_MSG("CSecuritySvrSession::AttachProcessL() - Debug Agent has insufficient capabilites based on OEM Debug Token");	
+
+		IsDebuggableL(processName);
+		}
+
+	User::LeaveIfError(Server().AttachProcessL(processName, processId, passive));
+
+	// Inform the kernel driver about the attachment, so that it
+	// can track per-agent data about the process.
+	RBuf8 processName8;
+
+	processName8.CreateL(deslen);
+
+	processName8.CleanupClosePushL();
+
+	processName8.Copy(processName);
+
+	User::LeaveIfError(Server().iKernelDriver.AttachProcess(processName8, processId.Id()));
+
+	// Create an Active Object to handle asynchronous calls to GetEvent
+	CSecuritySvrAsync* handler = CSecuritySvrAsync::NewL(this,processName8,processId);
+
+	err = iAsyncHandlers.Insert(handler,0);
+	if (err != KErrNone)
+		{
+		// If we don't have an asynchronous handler, we should detach
+		// the driver as well.
+		if( (KErrNone != Server().iKernelDriver.DetachProcess(processName8,processId.Id()))
+			|| (KErrNone != Server().DetachProcess(processName, processId)) )
+			{
+			// this is a serious error, neither of these calls should fail so
+			// we panic the server after closing the driver and printing a message
+
+			LOG_MSG("CSecuritySvrSession::AttachProcessL(): critical error during cleanup\n");
+			Server().iKernelDriver.Close();
+			RProcess process;
+			process.Panic(_L("AttachProcessL() failed"), KErrServerTerminated);
+			}
+		}
+
+	User::LeaveIfError(err);
+
+	CleanupStack::PopAndDestroy(&processName8);
+
+	CleanupStack::PopAndDestroy(&processName);
+
+	aMessage.Complete(KErrNone);
+	}
+
+/**
+Reads the OEM Debug Token associated with the debug agent if any. The OEM Debug Token
+allows the Debug Agent to debug certain executables which have not been built as
+'Debuggable'.
+
+This works as follows: The OEM Debug Token is an executable with a special name
+of the form "OEMDebug_<DA_SID>.exe" where <DA_SID> is the Secure ID of the Debug Agent
+in hexadecimal. For example: "OEMDebug_F123ABCD.exe" would be a valid name. This token executable
+must be signed with 'AllFiles' + X, where X is the set of PlatSec capabilities that are
+possessed by the target executable to be debugged.
+
+This function reads the capabilities possessed by the token by creating a process based
+on the executable, and reading the TSecurityInfo associated with the process. This ensures
+that the loader has validated the token has not been tampered with and that the security
+information is valid.
+
+The security information is then stored for future use as member data in iOEMDebugCapabilities.
+
+Leaves if there is an error, otherwise simply fills in the capabilities
+in iOEMDebugCapabilities.
+
+It is not an error for the OEM Debug token not to exist. In this case, the function simply returns.
+*/
+void CSecuritySvrSession::GetDebugAgentOEMTokenCapsL(void)
+	{
+	// Sanity check
+	if (!iDebugAgentProcessIdStored)
+		{
+		LOG_MSG("CSecuritySvrSession::GetDebugAgentOEMTokenCapsL() - Debug Agent Process Id not stored");
+		
+		// We have not stored the debug agent process id!
+		User::Leave(KErrNotReady);
+		}
+
+	// Obtain the security info about the debug agent process
+	//get the debug agent's process
+	RProcess debugAgentProcess;
+
+	CleanupClosePushL(debugAgentProcess);
+
+	debugAgentProcess.Open(iDebugAgentProcessId);
+
+	// We have now obtained a process handle based on the token executable, so we can check its security properties.
+	TSecurityInfo secInfo(debugAgentProcess);
+
+// Compute the name of the OEM debug token based on the SID of the debug agent
+_LIT(KDSSOEMDebugTokenPrefix,"OEMDebug_");
+_LIT(KDSSOEMDebugTokenAppendFmt,"%08X.exe");
+
+	RBuf agentTokenName;
+	agentTokenName.CreateL(KDSSOEMDebugTokenPrefix().Size()+8+1);	// allow space for SID+null terminator
+	agentTokenName.CleanupClosePushL();
+
+	agentTokenName.SetLength(0);
+
+	// Add OEMDebug_
+	agentTokenName.Append(KDSSOEMDebugTokenPrefix());
+
+	// Add debug agent Secure ID
+	agentTokenName.AppendFormat(KDSSOEMDebugTokenAppendFmt,secInfo.iSecureId.iId);
+	
+	// just log the token name for the moment.
+	RBuf8 agentTokenName8;
+
+	agentTokenName8.CreateL(agentTokenName.Length()+1);
+
+	agentTokenName8.CleanupClosePushL();
+
+	agentTokenName8.Copy(agentTokenName);
+
+	agentTokenName8.Append(TChar(0));
+
+	//LOG_MSG2("CSecuritySvrSession::GetDebugAgentOEMTokenCapsL() - OEM Debug Token Name is %s",agentTokenName8.Ptr()); 
+
+	// Cleanup
+	CleanupStack::PopAndDestroy(&agentTokenName8);
+
+	// Now locate and start the executable...
+	RProcess agentToken;
+	TInt err = agentToken.Create(agentTokenName, KNullDesC);
+	if (KErrNone != err)
+		{
+		// Failed to create a process based on the token, just give up
+		LOG_MSG2("CSecuritySvrSession::GetDebugAgentOEMTokenCapsL() - Could not create process based on token due to err 0x%8x\n",err);
+		
+		// Cleanup remaining items from the stack
+		CleanupStack::PopAndDestroy(&agentTokenName);
+
+		CleanupStack::PopAndDestroy(&debugAgentProcess);
+		return;
+		}
+
+	// Synchronise with the process to make sure it hasn't died straight away
+	TRequestStatus stat;
+	agentToken.Rendezvous(stat);
+	if (stat != KRequestPending)
+		{
+		// logon failed - agentToken is not yet running, so cannot have terminated
+		agentToken.Kill(0);             // Abort startup
+		}
+
+	// store the OEM Debug Token security data 
+	TSecurityInfo agentSecInfo(agentToken);
+
+	// Note capabilities for future use
+	iOEMDebugCapabilities=agentSecInfo.iCaps;
+	
+	// resume the token. It _should_ just exit, but we don't really care.
+	agentToken.Resume();
+
+	// Wait to synchronise with agentToken - if it dies in the meantime, it
+	// also gets completed
+	User::WaitForRequest(stat);
+
+	// Just close the handle to it again.
+	agentToken.Close();
+
+	// Cleanup remaining items from the stack
+	CleanupStack::PopAndDestroy(&agentTokenName);
+
+	CleanupStack::PopAndDestroy(&debugAgentProcess);
+
+	}
+
+/**
+  Checks whether the file passed in as aExecutable is XIP or not
+
+  @param aExecutable file to check
+  @return ETrue if the file is XIP, EFalse otherwise
+  */
+TBool CSecuritySvrSession::IsExecutableXipL(RFile& aExecutable)
+	{
+	TUint atts;
+	User::LeaveIfError(aExecutable.Att(atts));
+
+	return atts & KEntryAttXIP;
+	}
+/**
+  Gets access to the symbian crash partition for crash access operation.
+  */
+void CSecuritySvrSession::ConnectCrashPartitionL (void)
+	{
+	LOG_MSG("CSecuritySvrSession::ConnectCrashPartitionL()");
+	
+	TBool changed;
+	TInt error = KErrNone;
+	TInt i=0;
+	
+	//Intialising to EFalse
+	iCrashConnected = EFalse;
+	
+	TPckg<TLocalDriveCapsV2> capsBuf(iCaps);
+	
+	//check for the symbian crash partition
+	for (i=0; i<KMaxLocalDrives; i++)
+		{
+		error = iLocalDrive.Connect (i, changed);
+		if ( error == KErrNone)
+			{
+			error = iLocalDrive.Caps(capsBuf);
+			if ( error != KErrNone)
+				{
+				//continue if not found
+				continue;
+				}
+			if ( iCaps.iPartitionType == (TUint16)KPartitionTypeSymbianCrashLog)
+				{				
+				LOG_MSG2("Found Symbian crash log partition on drive: %d",i);
+				iCrashConnected = ETrue;
+				break;
+				}			
+			}
+		}
+	if ( i == KMaxLocalDrives)
+		{
+		LOG_MSG("No crash log partition found with valid crash log signature found.  Exiting...");
+		User::Leave (KErrNotFound);
+		}
+
+	// Nand Flash not currently supported.
+	if (iCaps.iType == EMediaNANDFlash)
+		{
+		LOG_MSG( "CSecuritySvrSession::ConnectCrashPartitionL()  Nand Flash not currently supported\n" );
+		User::Leave (KErrNotSupported);
+		}
+	}
+/** Checks that aHeaderData contains enough data to cast it to the
+  appropriate header type.
+
+  @param aHeaderData buffer containing header data read from a file
+  @param aXip boolean indicating whether the header data is for an XIP image
+
+  @return ETrue if enough data in buffer, EFalse otherwise
+  */
+TBool CSecuritySvrSession::CheckSufficientData(const TDesC8& aHeaderData, const TBool aXip) const
+	{
+	TUint minimumHeaderSize = aXip ? sizeof(TRomImageHeader) : sizeof(E32ImageHeaderV);
+	return (aHeaderData.Length() >= minimumHeaderSize);
+	}
+
+/**
+  Opens a file handle to aFileName using aFileHandle
+  @param aFileName file to open handle to
+  @param aFs file system to use to open the handle
+  @param aFileHandle file handle to open
+
+  @leave one of the system wide error codes
+  */
+void CSecuritySvrSession::OpenFileHandleL(const TDesC& aFileName, RFs& aFs, RFile& aFileHandle)
+	{
+	TInt err = aFileHandle.Open(aFs, aFileName, EFileRead | EFileShareReadersOnly);
+	if (err != KErrNone)
+		{
+		// Could not open the file for reading
+		LOG_MSG("CSecuritySvrSession::OpenFileHandleL - Failed to open executable\n");
+
+		User::Leave(err);
+		}
+	}
+
+/**
+  Checks whether an executable has the debug bit set
+
+  @param aHeaderData buffer containing the header of the executable
+  @param aXip indication of whether the executable is XIP or not
+
+  @return ETrue if debug bit is set, EFalse otherwise
+  */
+TBool CSecuritySvrSession::IsDebugBitSet(const TDesC8& aHeaderData, const TBool aXip)
+	{
+	if(!CheckSufficientData(aHeaderData, aXip))
+		{
+		return EFalse;
+		}
+
+	if (aXip)
+		{
+		TRomImageHeader* hdr = (TRomImageHeader*)aHeaderData.Ptr();
+		return (hdr->iFlags & KRomImageDebuggable);
+		}
+	else
+		{
+		// it is an epoc32 image
+		E32ImageHeaderV* hdr = (E32ImageHeaderV*)aHeaderData.Ptr();
+		return (hdr->iFlags & KImageDebuggable);
+		}
+	}
+
+/**
+Determines whether a particular executable is marked as 'debuggable'
+
+Notes:
+This function is currently hard coded to understand the format of e32 and
+TRomImage file headers. Ideally this will be replaced by a call to RLibrary::GetInfo
+which can return the 'debuggable' information. Unfortunately, this call currently
+does not provide the information for XIP executables :-(
+
+@leave KErrPermissionDenied if the debug bit is not set, or one of the other
+system wide error codes
+*/
+void CSecuritySvrSession::IsDebuggableL(const TDesC& aFileName)
+	{
+#ifndef IGNORE_DEBUGGABLE_BIT
+
+	RFs fs;
+	User::LeaveIfError(fs.Connect());
+	CleanupClosePushL(fs);
+
+	RFile targetExe;
+	OpenFileHandleL(aFileName, fs, targetExe);
+	CleanupClosePushL(targetExe);
+
+	// Read in the entire header
+	RBuf8 e32HdrBuf;
+	e32HdrBuf.CreateL(RLibrary::KRequiredImageHeaderSize);
+	e32HdrBuf.CleanupClosePushL();
+
+	// Read the entire header as far as possible
+	TInt err = targetExe.Read(e32HdrBuf);
+	if (err != KErrNone)
+		{
+		// Could not read the file 
+		LOG_MSG("CSecuritySvrSession::IsDebuggableL - Failed to read executable\n");
+
+		User::Leave(err);
+		}
+
+	if(!CheckSufficientData(e32HdrBuf, IsExecutableXipL(targetExe)))
+		{
+		User::Leave(KErrGeneral);
+		}
+
+	if(! IsDebugBitSet(e32HdrBuf, IsExecutableXipL(targetExe)))
+		{
+		User::Leave(KErrPermissionDenied);
+		}
+	CleanupStack::PopAndDestroy(3, &fs);
+
+#else
+	LOG_MSG("CSecuritySvrSession::IsDebuggableL() Debuggable bit temporarily ignored!!!");
+#endif
+	}
+
+/**
+Processes a detach request from a debug agent. Gets the target debug
+processes' original FileName as an argument. The method sets completion
+status of the aMessage argument to KErrNone if successfully detached and to
+another of the system wide error codes if there were problems.
+
+@param aMessage contains:
+       * a buffer at offset 0 which contains the FileName
+       of the target debug process.
+*/
+void CSecuritySvrSession::DetachProcessL(const RMessage2& aMessage)
+	{
+	LOG_MSG( "CSecuritySvrSession::DetachProcessL()\n" );
+
+	TInt deslen = aMessage.GetDesLengthL(0);
+	// Passed data will be saved in this descriptor.
+	RBuf processName;
+
+	// Max length set to the value of "deslen", but current length is zero
+	processName.CreateL(deslen);
+
+	// Do the right cleanup if anything subsequently goes wrong
+	processName.CleanupClosePushL();
+
+	// Copy the client's descriptor data into our buffer.
+	aMessage.ReadL(0,processName);
+
+	User::LeaveIfError(Server().DetachProcess(processName, iDebugAgentProcessId));
+
+	// Inform the kernel driver about the detachment, so that
+	// it can stop tracking per-agent data for the debugged process.
+	RBuf8 processName8;
+
+	processName8.CreateL(deslen);
+
+	processName8.CleanupClosePushL();
+
+	processName8.Copy(processName);
+
+	// Remove the Asynchronous Object associated with this process
+	for(TInt i=0; i<iAsyncHandlers.Count(); i++)
+		{
+		if (processName8.Compare(iAsyncHandlers[i]->ProcessName()) == 0)
+			{
+			delete iAsyncHandlers[i];
+			iAsyncHandlers.Remove(i);
+
+			break;
+			}
+		}
+	
+	// Inform the driver that we are no longer attached to this process
+	User::LeaveIfError(Server().iKernelDriver.DetachProcess(processName8,iDebugAgentProcessId.Id()));
+	
+	CleanupStack::PopAndDestroy(&processName8);
+	CleanupStack::PopAndDestroy(&processName);
+
+	aMessage.Complete(KErrNone);
+	}
+
+/**
+@param aMessage The RMessage2 object is expected to contain:
+  * aMessage.Int0() - TDes8 Containing the process name.
+  * aMessage.Int1() - Address of TPtr8 containing TEventInfo
+
+*/
+void CSecuritySvrSession::GetEventL(const RMessage2& aMessage)
+	{
+	LOG_MSG( "CSecuritySvrSession::GetEventL()\n" );
+
+	// Local descriptor to contain target process name
+	TInt deslen = aMessage.GetDesLengthL(0);
+
+	RBuf processName;
+
+	processName.CreateL(deslen);
+	
+	processName.CleanupClosePushL();
+
+	// Read the target process name into processName
+	aMessage.ReadL(0,processName);
+
+	// Check if debug agent is attached to process
+	if(!Server().CheckAttachedProcess(processName, aMessage, EFalse))
+		{
+		LOG_MSG("CSecuritySvrSession::GetEventL() - Not attached to this process\n");
+
+		// Debug Agent is not attached at all to the requested process
+		User::Leave(KErrPermissionDenied);
+		}
+
+	// Identify which process is being debugged, so that
+	// we can locate the appropriate active object handler.
+	RBuf8 processName8;
+
+	processName8.CreateL(processName.Length());
+
+	processName8.CleanupClosePushL();
+
+	processName8.Copy(processName);
+
+	// Find the Asynchronous Object associated with this process,
+	// as it is permissible to have an outstanding GetEvent call
+	// for each attached process.
+	TBool foundHandler = EFalse;
+	for(TInt i=0; i<iAsyncHandlers.Count(); i++)
+		{
+		if (processName8.Compare(iAsyncHandlers[i]->ProcessName()) == 0)
+			{
+			iAsyncHandlers[i]->GetEvent(aMessage);
+			foundHandler = ETrue;
+			break;
+			}
+		}
+
+	if (foundHandler == EFalse)
+		{
+		// could not find an async handler object. Report the problem.
+		LOG_MSG("CSecuritySvrSessionL - Could not find a handler object\n");
+		User::Leave(KErrNotFound);
+		}
+
+	// Actually make the driver call, passing in the agent Id
+	// so that the driver knows which per-agent event queue
+	// to interrogate to retrieve the latest event.
+	CleanupStack::PopAndDestroy(&processName8);
+	CleanupStack::PopAndDestroy(&processName);
+	}
+
+/**
+Cancels a pre-issued GetEvent call for a specific debugged process.
+
+@param aMessage.Int0() - TDes8 containing aProcessName
+*/
+void CSecuritySvrSession::CancelGetEventL(const RMessage2& aMessage)
+	{
+	LOG_MSG( "CSecuritySvrSession::CancelGetEventL()\n" );
+
+	// Local descriptor to contain target process name
+	TInt deslen = aMessage.GetDesLengthL(0);
+
+	RBuf processName;
+
+	processName.CreateL(deslen);
+
+	processName.CleanupClosePushL();
+
+	// Read the target process name into processName
+	aMessage.ReadL(0,processName,0);
+
+	// Debug Agent is not an active debugger. Check if the DA is passively attached
+	if(!Server().CheckAttachedProcess(processName, aMessage, EFalse))
+		{
+		// Debug Agent is not attached at all to the requested process
+		User::Leave(KErrPermissionDenied);
+		}
+
+	// Identify the appropriate active object associate
+	// with this process.
+	RBuf8 processName8;
+
+	processName8.CreateL(processName.Length());
+
+	processName8.CleanupClosePushL();
+
+	processName8.Copy(processName);
+
+	// Find the Asynchronous Object associated with this process
+	TBool foundHandler = EFalse;
+	for(TInt i=0; i<iAsyncHandlers.Count(); i++)
+		{
+		if (processName8.Compare(iAsyncHandlers[i]->ProcessName()) == 0)
+			{
+
+			// Found the AO handler, so cancel the outstanding getevent call.
+			iAsyncHandlers[i]->Cancel();
+			foundHandler = ETrue;
+			break;
+			}
+		}
+
+	if(!foundHandler)
+		{
+		// We could not found a handler, so report the problem to the debug agent
+		User::Leave(KErrNotFound);
+		}
+
+	//do cleanup
+	CleanupStack::PopAndDestroy(&processName8);
+	CleanupStack::PopAndDestroy(&processName);
+
+	aMessage.Complete(KErrNone);
+	}
+
+/*
+ Purpose: Sets the required event action to be taken for a specific
+ process and event combination
+
+@param aMessage The RMessage2 object is expected to contain:
+  * aMessage.Int0() - TDes8 Containing the process name.
+  * aMessage.Int1() - TEventType
+  * aMessage.Int2() - TKernelEventAction
+  *
+*/
+void CSecuritySvrSession::SetEventActionL(const RMessage2& aMessage)
+	{
+	LOG_MSG( "CSecuritySvrSession::SetEventActionL()\n" );
+
+	// Local descriptor to contain target process name
+	TInt deslen = aMessage.GetDesLengthL(0);
+
+	RBuf processName;
+
+	processName.CreateL(deslen);
+
+	processName.CleanupClosePushL();
+
+	// Read the target process name into processName
+	aMessage.ReadL(0,processName);
+
+	//check that the agent has attached to the target process
+	if(!Server().CheckAttachedProcess(processName, aMessage, EFalse))
+		{
+		// Debug Agent is not attached at all to the requested process
+		User::Leave(KErrPermissionDenied);
+		}
+
+	// Extract and validate the arguments from aMessage
+	TUint32 event  = aMessage.Int1();
+	if (event >= EEventsLast)
+		{
+		// Supplied event Id was not recognised
+		User::Leave(KErrArgument);
+		}
+
+	TUint32 action = aMessage.Int2();
+	if(action >= EActionLast)
+	{
+		// Supplied event action was not recognised
+		User::Leave(KErrArgument);
+	}
+
+	RBuf8 processName8;
+
+	processName8.CreateL(processName.Length());
+
+	processName8.CleanupClosePushL();
+
+	processName8.Copy(processName);
+
+	// Make the call to the device driver
+	TInt err = Server().iKernelDriver.SetEventAction(processName8, \
+		(TEventType)event,\
+		(TKernelEventAction)action,\
+		iDebugAgentProcessId.Id());
+
+	User::LeaveIfError(err);
+
+	CleanupStack::PopAndDestroy(&processName8);
+	CleanupStack::PopAndDestroy(&processName);
+
+	aMessage.Complete(KErrNone);
+}
+
+/**
+Purpose: Single-step a thread for a specified number of instructions
+
+@param aMessage.Ptr0() - Thread Id of the thread to be stepped
+@param aMessage.Int1() - Number of instructions to step.
+
+@leave one of the system wide error codes
+
+*/
+void CSecuritySvrSession::StepL(const RMessage2& aMessage)
+	{
+	LOG_MSG( "CSecuritySvrSession::StepL()\n" );
+
+	const TThreadId threadId = ReadTThreadIdL(aMessage, 0);
+	const TInt32 numSteps = aMessage.Int1();
+
+	CheckAttachedL(threadId, aMessage, EFalse);
+
+	User::LeaveIfError(Server().iKernelDriver.Step( threadId, numSteps ));
+
+	aMessage.Complete(KErrNone);
+	}
+
+/**
+ * This checks whether or not the agent is permitted access to the flash partition
+ * @return KErrNone if allowed, otherwise one of the system wide error codes
+ * @leave one of the system wide error codes
+ */
+TInt CSecuritySvrSession::CheckFlashAccessPermissionL(const RThread aClientThread)
+	{
+	//get the debug agent's process
+	RProcess clientProcess;
+	User::LeaveIfError(aClientThread.Process(clientProcess));
+	
+	//get the debug agent's process id
+	TProcessId processId = clientProcess.Id();
+
+	//store the debug agent's process id for forced detaching later if the
+	//agent doesn't tidy up after itself
+	StoreDebugAgentId(processId);
+	
+	// Read the OEM Debug token capabilities (if any)
+	GetDebugAgentOEMTokenCapsL();
+	
+	if(Server().OEMTokenPermitsFlashAccessL((iOEMDebugCapabilities)))
+		{
+		return KErrNone;
+		}
+
+	return KErrPermissionDenied;
+	}
+
+/**
+Purpose: Read the crash log from the crash flash partition
+@param aMessage.Int0() - Position to read from.
+@param aMessage.Ptr1() - Buffer to hold the data retrieved
+@param aMessage.Int2() - Size of the data to read.
+
+@leave one of the system wide error codes
+*/
+void CSecuritySvrSession::ReadCrashLogL (const RMessage2& aMessage)
+	{	
+	//get the debug agent's thread and push handle onto clean up stack
+	RThread clientThread;
+	User::LeaveIfError(aMessage.Client(clientThread));
+	CleanupClosePushL(clientThread);
+	
+	TInt err = CheckFlashAccessPermissionL(clientThread);
+	
+	CleanupStack::PopAndDestroy(&clientThread);
+	
+	if(KErrNone != err)
+		{
+		LOG_MSG2( "CSecuritySvrSession::ReadCrashLogL()  Access Not Granted - [%d]\n", err );
+		aMessage.Complete(err);
+		return;
+		}
+	
+	//Check whether drive connected.
+	if(!iCrashConnected)
+		ConnectCrashPartitionL();	
+
+	TInt readPosition = aMessage.Int0(); //read position
+	
+	TInt readSize = aMessage.Int2(); //read size
+	
+	RBuf8 readBuf;
+	readBuf.CreateL(readSize);
+	readBuf.CleanupClosePushL();
+	
+	err = iLocalDrive.Read (readPosition, readSize, readBuf);
+	
+	//write the list data back
+	aMessage.WriteL (1, readBuf);	
+	
+	CleanupStack::PopAndDestroy (&readBuf);	
+	
+	//Complete message
+	aMessage.Complete(err);	
+	}
+/**
+Purpose: Function to write the crash config to the crash flash partition
+
+@param aMessage.Int0() - write position in bytes from start position in flash partition.
+@param aMessage.Ptr1() - Buffer containing the data to be written onto the flash. 
+                         The size could be 0 if only flash partition size is needed. 
+@param aMessage.Int2() - returns the size of the flash partition.
+
+@leave one of the system wide error codes
+*/
+void CSecuritySvrSession::WriteCrashConfigL(const RMessage2& aMessage)
+	{
+	LOG_MSG( "CSecuritySvrSession::WriteCrashConfigL()\n" );
+	
+	//get the debug agent's thread and push handle onto clean up stack
+	RThread clientThread;
+	User::LeaveIfError(aMessage.Client(clientThread));
+	CleanupClosePushL(clientThread);
+	
+	TInt err = CheckFlashAccessPermissionL(clientThread);
+	
+	CleanupStack::PopAndDestroy(&clientThread);
+	
+	if(KErrNone != err)
+		{
+		LOG_MSG2( "CSecuritySvrSession::WriteCrashConfigL()  Access Not Granted - [%d]\n", err );
+		aMessage.Complete(err);
+		return;
+		}
+	
+	//Check whether drive connected.
+	if(!iCrashConnected)
+		ConnectCrashPartitionL();	
+	
+	// Get the length of the buffer
+	TInt deslen = aMessage.GetDesLengthL(1);
+
+	RBuf8 dataBuf;
+	dataBuf.CreateL(deslen);
+	dataBuf.CleanupClosePushL();
+
+	// data to be written to flash
+	aMessage.ReadL(1,dataBuf);
+	
+	TUint32 position = aMessage.Int0(); //position to start from
+		
+	err = iLocalDrive.Write(position,(const TDesC8&)dataBuf);
+	
+	TPtr8 dataSize((TUint8*)&deslen,4, 4);
+	
+	//write the size of the data written back
+	aMessage.WriteL(2,dataSize);
+		
+	//destroy buffer
+	CleanupStack::PopAndDestroy(&dataBuf); 
+	
+	aMessage.Complete(err);	
+	}
+/**
+Purpose: Method to erase the crash flash block
+
+@param aMessage.Int0() - write position in bytes from start position in flash partition.
+@param aMessage.Int2() - Number of blocks to erase.
+
+@leave one of the system wide error codes
+*/
+
+void CSecuritySvrSession::EraseCrashLogL(const RMessage2& aMessage)
+	{	
+	LOG_MSG( "CSecuritySvrSession::EraseCrashLogL()\n" );
+	
+	//get the debug agent's thread and push handle onto clean up stack
+	RThread clientThread;
+	User::LeaveIfError(aMessage.Client(clientThread));
+	CleanupClosePushL(clientThread);
+	
+	TInt err = CheckFlashAccessPermissionL(clientThread);
+	
+	CleanupStack::PopAndDestroy(&clientThread);
+	
+	if(KErrNone != err)
+		{
+		LOG_MSG2( "CSecuritySvrSession::EraseCrashLogL()  Access Not Granted - [%d]\n", err );
+		aMessage.Complete(err);
+		return;
+		}
+			
+	//Check whether drive connected.
+	if(!iCrashConnected)
+		ConnectCrashPartitionL();	
+	
+	TInt64 position = aMessage.Int0();	
+	TInt size = aMessage.Int1();
+	
+	//Format drive
+	err = iLocalDrive.Format(position,size*iCaps.iEraseBlockSize);		
+ 
+	aMessage.Complete(err);	
+	}
+
+/**
+Purpose: Method to erase the entire crash flash block
+@leave one of the system wide error codes
+*/
+
+void CSecuritySvrSession::EraseEntireCrashLogL(const RMessage2& aMessage)
+	{
+	LOG_MSG( "CSecuritySvrSession::EraseEntireCrashLogL()\n" );
+	
+	//get the debug agent's thread and push handle onto clean up stack
+	RThread clientThread;
+	User::LeaveIfError(aMessage.Client(clientThread));
+	CleanupClosePushL(clientThread);
+	
+	TInt err = CheckFlashAccessPermissionL(clientThread);
+	
+	CleanupStack::PopAndDestroy(&clientThread);
+	
+	if(KErrNone != err)
+		{
+		LOG_MSG2( "CSecuritySvrSession::EraseEntireCrashLogL()  Access Not Granted - [%d]\n", err );
+		aMessage.Complete(err);
+		return;
+		}	
+	
+	//Check whether drive connected.
+	if(!iCrashConnected)
+		ConnectCrashPartitionL();
+	
+	TUint numberBlocks = iCaps.iSize /iCaps.iEraseBlockSize;
+	
+	//Format drive
+	for(TInt i = 0; i < numberBlocks; i++)
+		{
+		err = iLocalDrive.Format(i*iCaps.iEraseBlockSize,iCaps.iEraseBlockSize);
+		if(KErrNone != err)
+			{
+			RDebug::Printf("err = %d", err);
+			aMessage.Complete(err);
+			return;
+			}
+		}
+	
+	
+	aMessage.Complete(err);
+	}
+
+
+/**
+Purpose: Kill a specified process
+
+@param aMessage.Ptr0() - Process Id of the thread to be stepped
+@param aMessage.Int1() - Reason code to supply when killing the process.
+
+@leave one of the system wide error codes
+
+*/
+void CSecuritySvrSession::KillProcessL(const RMessage2& aMessage)
+	{
+	LOG_MSG( "CSecuritySvrSession::KillProcessL()\n" );
+
+	const TProcessId processId = ReadTProcessIdL(aMessage, 0);
+	const TInt32 reason = aMessage.Int1();
+
+	CheckAttachedL(processId, aMessage, EFalse);
+
+	User::LeaveIfError(Server().iKernelDriver.KillProcess( processId, reason ));
+
+	aMessage.Complete(KErrNone);
+	}
+
+/** Gets the secure id of aFileName
+  @param aFileName file name of executable to get SID for
+  @param aSecureId on return will contain the SID of aFileName
+
+  @leave one of the system wide error codes
+  */
+void CSecuritySvrSession::GetSecureIdL(const TDesC& aFileName, TUid& aSecureId)
+	{
+	RFs fs;
+	User::LeaveIfError(fs.Connect());
+	CleanupClosePushL(fs);
+
+	RFile targetExe;
+	OpenFileHandleL(aFileName, fs, targetExe);
+	CleanupClosePushL(targetExe);
+
+	// Read in the entire header
+	RBuf8 e32HdrBuf;
+	e32HdrBuf.CreateL(RLibrary::KRequiredImageHeaderSize);
+	e32HdrBuf.CleanupClosePushL();
+
+	// Read the entire header as far as possible
+	TInt err = targetExe.Read(e32HdrBuf);
+	if (err != KErrNone)
+		{
+		// Could not read the file 
+		LOG_MSG("CSecuritySvrSession::GetSecureIdL - Failed to read executable\n");
+
+		User::Leave(err);
+		}
+
+	if(!CheckSufficientData(e32HdrBuf, IsExecutableXipL(targetExe)))
+		{
+		User::Leave(KErrGeneral);
+		}
+
+	aSecureId = GetSecureIdL(e32HdrBuf, IsExecutableXipL(targetExe));
+
+	CleanupStack::PopAndDestroy(3, &fs);
+	}
+
+/** Get the secure id from aHeaderData
+  @param aHeaderData an executable's header data to read SID from
+  @param aXip indication of whether the header data is from an XIP file
+
+  @return secure ID from aHeaderData
+  */
+TUid CSecuritySvrSession::GetSecureIdL(const TDesC8& aHeaderData, TBool aXip)
+	{
+	if(!CheckSufficientData(aHeaderData, aXip))
+		{
+		User::Leave(KErrGeneral);
+		}
+
+	if (aXip)
+		{
+		TRomImageHeader* hdr = (TRomImageHeader*)aHeaderData.Ptr();
+		return TUid::Uid(hdr->iS.iSecureId);
+		}
+	else
+		{
+		// it is an epoc32 image
+		E32ImageHeaderV* hdr = (E32ImageHeaderV*)aHeaderData.Ptr();
+		return TUid::Uid(hdr->iS.iSecureId);
+		}
+	}
+
+/**
+@param aMessage contains:
+ * aMessage.Ptr0() a TListDetails object
+ * aMessage.Ptr1() a client supplied TDes8 for the driver to return data in
+ * aMessage.Ptr2() a TUint32 for the driver to return the size of the requested listing's data in
+
+@leave KErrTooBig if the buffer passed as argument 1 of aMessage is too
+       small to contain the requested data,
+       KErrNoMemory if a temporary buffer could not be allocated,
+       or one of the other system wide error codes
+*/
+void CSecuritySvrSession::GetListL(const RMessage2& aMessage)
+	{
+	LOG_MSG("CSecuritySvrSession::GetListL()");
+
+	// buffer to write list data into before copying back to agent
+	RBuf8 listDetailsBuf;
+
+	//allocate buffer
+	listDetailsBuf.CreateL(sizeof(TListDetails));
+
+	// Do the right cleanup if anything subsequently goes wrong
+	listDetailsBuf.CleanupClosePushL();
+
+	//read the data from the client thread
+	aMessage.ReadL(0, listDetailsBuf);
+	TListDetails* listDetails = (TListDetails*)listDetailsBuf.Ptr();
+
+	//get the type of list requested
+	TListId type = (TListId)aMessage.Int0();
+
+	//create a buffer to store the data in
+	RBuf8 buffer;
+	buffer.CreateL(aMessage.GetDesMaxLength(1));
+	buffer.CleanupClosePushL();
+
+	//create a temporary variable to potentially store data length in
+	TUint32 size = 0;
+
+	TInt err = KErrNone;
+
+	// the executables list is generated in the DSS rather than in the driver
+	// so is treated separately
+	if(listDetails->iListId == EExecutables)
+		{
+		if(listDetails->iListScope != EScopeGlobal)
+			{
+			User::Leave(KErrArgument);
+			}
+		if(listDetails->iTargetId != 0)
+			{
+			User::Leave(KErrArgument);
+			}
+		err = GetExecutablesListL(buffer, size);
+		}
+	else
+		{
+		err = Server().iKernelDriver.GetList(listDetails->iListId, listDetails->iListScope, listDetails->iTargetId, iDebugAgentProcessId, buffer, size);
+		}
+
+	if(err == KErrNone)
+		{
+		//write the list data back
+		aMessage.WriteL(1, buffer);
+		}
+
+	TPtr8 sizePtr((TUint8*)&size, sizeof(TUint32), sizeof(TUint32));
+	//write size back to agent
+	aMessage.WriteL(2, sizePtr);
+
+	CleanupStack::PopAndDestroy(&buffer);
+	CleanupStack::PopAndDestroy(&listDetailsBuf);
+
+	aMessage.Complete(err);
+	}
+
+/**
+Gets the executables list and returns it in aBuffer if it's big enough
+
+@param aBuffer caller supplied buffer to write data into
+@param aSize on return contains the size of the data in the buffer, or the
+       size that the buffer would need to be to contain the data
+
+@return KErrNone on success, or KErrTooBig if the requested data will not fit in aBuffer
+
+@leave one of the system wide error codes
+*/
+TInt CSecuritySvrSession::GetExecutablesListL(TDes8& aBuffer, TUint32& aSize) const
+	{
+	LOG_MSG("CSecuritySvrSession::GetExecutablesList()");
+
+	//initialise values and connect to file system
+	aSize = 0;
+	aBuffer.SetLength(0);
+	RFs fs;
+	User::LeaveIfError(fs.Connect());
+	CleanupClosePushL(fs);
+
+	// uids corresponding to executable image
+	TUidType uids(KExecutableImageUid, KNullUid, KNullUid);
+
+	//create a string containing the directory name. The drive letter is represented
+	//by X but will be replaced by the appropriate drive letter for each drive
+	_LIT(KColonSysBin,":\\sys\\bin\\");
+
+	//create a modifiable copy of KColonSysBin, preceeded by an empty space for the drive letter
+	RBuf dirName;
+	dirName.CreateL(1 + KColonSysBin().Length());
+	dirName.CleanupClosePushL();
+
+	//set the length to 1 (to later fill with the drive letter) and then append KColonSysBin
+	dirName.SetLength(1);
+	dirName.Append(KColonSysBin());
+
+	//get the list of valid drives for the device
+	TDriveList driveList;
+	User::LeaveIfError(fs.DriveList(driveList));
+
+	//check each valid sys/bin directory for executables
+	for(TInt i=0; i<KMaxDrives; i++)
+		{
+		//if the drive is not valid then skip this drive
+		if(!driveList[i])
+			{
+			//skip processing this drive
+			continue;
+			}
+
+		//get the drive letter and insert it as the drive letter for dirName
+		TChar driveLetter;
+	       	User::LeaveIfError(fs.DriveToChar(i, driveLetter));
+		dirName[0] = (TUint)driveLetter;
+
+		//get a list of the exes in this drive's sys/bin directory
+		CDir* localDir = NULL;
+		TInt err = fs.GetDir(dirName, uids, ESortByName, localDir);
+		if(KErrNoMemory == err)
+			{
+			User::Leave(err);
+			}
+		if(!localDir)
+			{
+			//skip processing this drive
+			continue;
+			}
+
+		//push onto cleanup stack in case we leave
+		CleanupStack::PushL(localDir);
+
+		//iterate through the files
+		for(TInt j=0; j<localDir->Count(); j++)
+			{
+			//will store x:\sys\bin\<file-name> type string
+			RBuf fullPathName;
+
+			TUint16 nameLength = dirName.Length() + (*localDir)[j].iName.Length();
+			fullPathName.CreateL(nameLength);
+			fullPathName.CleanupClosePushL();
+			fullPathName.Copy(dirName);
+			fullPathName.Append((*localDir)[j].iName);
+
+			//add the data to the buffer
+			AppendExecutableData(aBuffer, aSize, fullPathName);
+
+			//do cleanup
+			CleanupStack::PopAndDestroy(&fullPathName);
+			}
+
+		//do cleanup
+		CleanupStack::PopAndDestroy(localDir);
+		}
+
+	//do cleanup
+	CleanupStack::PopAndDestroy(2, &fs);
+
+	//return appropriate value as to whether the kernel's data was too big
+	return (aSize <= aBuffer.MaxLength()) ? KErrNone : KErrTooBig;
+	}
+
+
+/**
+  Append data to aBuffer and update size of aSize if the data will fit. If it will
+  not fit then just puts the nee size in aSize.
+
+  @param aBuffer buffer to append the data to
+  @param aSize on return contains the new size of the buffer if the data could be
+  appended, otherwise aSize is updated to reflect the size the buffer would have if
+  the data had fitted.
+  @param aEntryName file name of the entry to add to the buffer
+  */
+void CSecuritySvrSession::AppendExecutableData(TDes8& aBuffer, TUint32& aSize, const TDesC& aEntryName) const
+	{
+	//update aSize to include the size of the data for this entry
+	aSize = Align4(aSize + sizeof(TExecutablesListEntry) + (2*aEntryName.Length()) - sizeof(TUint16));
+
+	//if the data will fit, and we haven't already stopped putting data in, then append the data,
+	//if we've stopped putting data in then aSize will be bigger than aBuffer.MaxLength()
+	if(aSize <= aBuffer.MaxLength())
+		{
+		TExecutablesListEntry& entry = *(TExecutablesListEntry*)(aBuffer.Ptr() + aBuffer.Length());
+		//check whether an agent has registered to actively debug fullPathName
+		TBool activelyDebugged = IsDebugged(aEntryName, EFalse);
+		entry.iIsActivelyDebugged = activelyDebugged ? 1 : 0;
+
+		//check whether any agents have registered to passively debug fullPathName
+		TBool passivelyDebugged = IsDebugged(aEntryName, ETrue);
+		entry.iIsPassivelyDebugged = passivelyDebugged ? 1 : 0;
+
+		entry.iNameLength = aEntryName.Length();
+		TPtr name(&(entry.iName[0]), aEntryName.Length(), aEntryName.Length());
+		name = aEntryName;
+		//pad the buffer to a four byte boundary
+		aBuffer.SetLength(aSize);
+		}
+	}
+/**
+Helper function
+
+Write data back to the thread that owns aMessage
+
+@param aMessage the message which is passed between processes
+@param aIndex the message slot which the data will be passed back in
+@param aPtr pointer to data in this thread to be written into aMessage
+@param aPtrSize size in bytes of the data to be written
+
+@leave one of the system wide error codes
+*/
+void CSecuritySvrSession::WriteDataL(const RMessage2& aMessage, const TInt aIndex, const TAny* aPtr, const TUint32 aPtrSize) const
+	{
+	TPtr8 dataPtr((TUint8*)aPtr, aPtrSize, aPtrSize);
+
+	aMessage.WriteL(aIndex, dataPtr);
+	}
+
+/**
+Stores the PID of the debug agent, if it is not already stored.
+
+@param aDebugAgentProcessId PID of the debug agent
+*/
+void CSecuritySvrSession::StoreDebugAgentId(const TProcessId aDebugAgentProcessId)
+	{
+	if(! iDebugAgentProcessIdStored)
+		{
+		iDebugAgentProcessIdStored = ETrue;
+		iDebugAgentProcessId = aDebugAgentProcessId;
+		}
+	}
+
+/**
+Helper function.
+
+Checks whether the debug agent (the owner of the aMessage) is attached to the
+thread with thread id of aThreadId.
+
+@param aThreadId thread ID of target debug thread
+@param aMessage message owned by the debug agent
+@param aPassive indicates whether to check if attached passively or actively
+
+@leave KErrPermissionDenied if the agent is not attached to the process,
+       KErrNoMemory if the security server could not be accessed
+*/
+void CSecuritySvrSession::CheckAttachedL(const TThreadId aThreadId, const RMessage2& aMessage, const TBool aPassive) const
+	{
+	//check that the agent has attached to the target process
+	if(! Server().CheckAttached(aThreadId, aMessage, aPassive))
+		{
+		LOG_MSG("CSecuritySvrSession::CheckAttachedL() failed");
+		User::Leave(KErrPermissionDenied);
+		}
+	}
+
+/**
+Helper function.
+
+Checks whether the debug agent (the owner of the aMessage) is attached to the
+process with process id of aProcessId.
+
+@param aProcessId process ID of target debug thread
+@param aMessage message owned by the debug agent
+@param aPassive indicates whether to check if attached passively or actively
+
+@leave KErrPermissionDenied if the agent is not attached to the process,
+       KErrNoMemory if the security server could not be accessed
+*/
+void CSecuritySvrSession::CheckAttachedL(const TProcessId aProcessId, const RMessage2& aMessage, const TBool aPassive) const
+	{
+	
+	//check that the agent has attached to the target process
+	if(! Server().CheckAttached(aProcessId, aMessage, aPassive))
+		{
+		LOG_MSG("CSecuritySvrSession::CheckAttachedL() (process) failed");
+		User::Leave(KErrPermissionDenied);
+		}
+	}
+
+/**
+Check whether the debug agent is permitted to attach to the target process.
+Note that this function does not actually attach the agent to the process, it
+simply tests whether an attach call would potentially be successful.
+
+Currently this method returns ETrue in all cases but will be updated once
+the security checking framework is in place.
+
+@param aDebugAgentProcessId process id of the debug agent
+@param aTargetProcessName original file name of the target process
+
+@return ETrue if the debug agent would be allowed to attch to the target process,
+        EFalse otherwise
+*/
+TBool CSecuritySvrSession::PermitDebugL(const TProcessId aDebugAgentProcessId, const TDesC& aTargetProcessName) const
+	{
+	return ETrue;
+	}
+
+/**
+Helper function
+
+Validates that the memory info passed in meets the debug driver's requirements
+
+@param aMemoryInfo memory info passed in from client
+
+@leave KErrArgument if:
+	  * size is zero
+	  * size is greater than the max block size
+	  * size + address > 0xffffffff
+	  * address is not access size aligned
+	  * size is not a multiple of the access size
+	KErrNotSupported if:
+	  * iAccess is not TAccess::EAccess32
+	  * iEndianess is not TEndianess::EEndLE8
+	KErrUnknown if:
+	  * the max memory block size cannot be determined
+        or one of the other system wide error codes
+*/
+void CSecuritySvrSession::ValidateMemoryInfoL(const TThreadId aThreadId, const TMemoryInfo &aMemoryInfo, const TBool aReadOperation)
+	{
+	//check size is not 0
+	if(aMemoryInfo.iSize == 0)
+		User::Leave(KErrArgument);
+
+	//get the max block size supported
+	TUint32 maxSize = 0;
+	User::LeaveIfError(Server().iKernelDriver.GetMemoryOperationMaxBlockSize(maxSize));
+
+	//check that the block size given is less than the max block size
+	if(aMemoryInfo.iSize > maxSize)
+		User::Leave(KErrArgument);
+
+	//must ensure that address + size <= 0xffffffff as will attempt to
+	//read past 0xffffffff, which wouldn't be good
+	TUint32 maxAddress = (~aMemoryInfo.iSize) + 1;
+	if(aMemoryInfo.iAddress > maxAddress)
+		User::Leave(KErrArgument);
+
+	//check that arguments are supported
+	if(aMemoryInfo.iAccess != EAccess32)
+		User::Leave(KErrNotSupported);
+
+	if(aMemoryInfo.iEndianess != EEndLE8)
+		User::Leave(KErrNotSupported);
+
+	//check that address is multiple of access size
+	TInt addressIndicator = aMemoryInfo.iAddress % aMemoryInfo.iAccess;
+	if(addressIndicator != 0)
+		{
+		User::Leave(KErrArgument);
+		}
+
+	//check that size is multiple of access size
+	TInt sizeIndicator = aMemoryInfo.iSize % aMemoryInfo.iAccess;
+	if(sizeIndicator != 0)
+		User::Leave(KErrArgument);
+	}
+
+/**
+Helper function
+
+Validates that the three buffers relating to reading register data are of
+appropriate sizes, and calculates the number of registers being requested.
+
+@param aMessage message which in offsets 1, 2 and 3 contains descriptors
+@param aNumberOfRegisters if the function returns with KErrNone this will
+       contain the number of registers being requested, guaranteed to be non-zero
+
+@leave KErrArgument if descriptors do not represent the same number of
+       registers, if any of the descriptors have max length of 0, if any of
+       the descriptors have max lengths which are not multiples of their data
+       type's size or if any of the descriptors have max lengths greater than
+       the max block size for memory operations
+       or one of the other system wide error codes if there were problems 
+       in getting the descriptors' lengths.
+*/
+void CSecuritySvrSession::ValidateRegisterBuffersL(const RMessage2& aMessage, TUint32& aNumberOfRegisters)
+	{
+	//get lengths of buffers, if error occurs returned value will be less then zero
+	TInt idsBufferLength = aMessage.GetDesMaxLength(1);
+	if(idsBufferLength < 0)
+		{
+		User::Leave(idsBufferLength);
+		}
+	TInt valuesBufferLength = aMessage.GetDesMaxLength(2);
+	if(valuesBufferLength < 0)
+		{
+		User::Leave(valuesBufferLength);
+		}
+	TInt flagsBufferLength = aMessage.GetDesMaxLength(3);
+	if(flagsBufferLength < 0)
+		{
+		User::Leave(flagsBufferLength);
+		}
+
+	//get the max block size supported
+	TUint32 maxSize = 0;
+	User::LeaveIfError(Server().iKernelDriver.GetMemoryOperationMaxBlockSize(maxSize));
+
+	//check none of the descriptors have size greater than the max block size
+	if((idsBufferLength > maxSize) || (valuesBufferLength > maxSize) || (flagsBufferLength > maxSize))
+		User::Leave(KErrArgument);
+
+	//get sizes of the three types of data the buffers represent arrays of
+	//and validate that the buffer lengths are multiples of the data sizes
+	TUint idSize = sizeof(TRegisterInfo);
+	if(idsBufferLength % idSize != 0)
+		User::Leave(KErrArgument);
+
+	TUint flagSize = sizeof(TUint8);
+	if(flagsBufferLength % flagSize != 0)
+		User::Leave(KErrArgument);
+
+	//perform check on id buffer length
+	if(idsBufferLength == 0)
+		User::Leave(KErrArgument);
+
+	//calculate number of registers being requested
+	aNumberOfRegisters = idsBufferLength / idSize;
+
+	//check flags buffer is of appropriate size
+	if(flagsBufferLength != (aNumberOfRegisters * flagSize))
+		User::Leave(KErrArgument);
+	}
+
+/**
+Establish whether any agents have registered to debug the specified aFileName
+
+@param aFileName originating file name of the target process
+@param aPassive indicates whether to check if there has been active attachment,
+or passive attachment.
+
+@return ETrue if aFileName is being debugged, EFalse otherwise
+
+*/
+TBool CSecuritySvrSession::IsDebugged(const TDesC& aFileName, const TBool aPassive) const
+	{
+	//check whether the target process is being debugged
+	return Server().IsDebugged(aFileName, aPassive);
+	}
+
+/**
+  Helper function which reads a TThreadId object from a client
+
+  @param aMessage the message object containing the reference to the TThreadId
+  @param aIndex the message argument containing the reference
+
+  @return the TThreadId passed in by the client
+  @leave KErrArgument if aIndex is outside of the valid range
+  */
+TThreadId CSecuritySvrSession::ReadTThreadIdL(const RMessagePtr2& aMessage, const TInt aIndex) const
+	{
+	//create a temporary TThreadId to read the data into
+	TThreadId tempThreadId;
+	TPtr8 threadIdPtr((TUint8*)&tempThreadId, sizeof(TThreadId));
+
+	// read the data in from the client
+	aMessage.ReadL(aIndex, threadIdPtr);
+
+	return tempThreadId;
+	}
+
+/**
+  Helper function which reads a TProcessId object from a client
+
+  @param aMessage the message object containing the reference to the TProcessId
+  @param aIndex the message argument containing the reference
+
+  @return the TProcessId passed in by the client
+  @leave KErrArgument if aIndex is outside of the valid range
+  */
+TProcessId CSecuritySvrSession::ReadTProcessIdL(const RMessagePtr2& aMessage, const TInt aIndex) const
+	{
+	//create a temporary TProcessId to read the data into
+	TProcessId tempProcessId;
+	TPtr8 processIdPtr((TUint8*)&tempProcessId, sizeof(TProcessId));
+
+	// read the data in from the client
+	aMessage.ReadL(aIndex, processIdPtr);
+
+	return tempProcessId;
+	}
+
+// End of file - c_security_svr_session.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/debug/securityServer/src/c_shutdown_timer.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,65 @@
+// 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:
+// Provides the debug security server's shutdown timer implementation
+// 
+//
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+
+#include <rm_debug_api.h>
+#include "c_shutdown_timer.h"
+#include "rm_debug_logging.h"
+
+/**
+Constructor. Adds the timer to the thread's active scheduler,
+*/
+CShutdownTimer::CShutdownTimer()
+	:CTimer(KActivePriorityShutdown)
+	{
+	LOG_MSG("CShutdownTimer::CShutdownTimer()\n");
+	CActiveScheduler::Add(this);
+	}
+
+/**
+Initialisation of timer
+*/
+void CShutdownTimer::ConstructL()
+	{
+	LOG_MSG("CShutdownTimer::ConstructL()\n");
+	CTimer::ConstructL();
+	}
+
+/**
+Starts the timer which would expire after KShutdownDelay
+*/
+void CShutdownTimer::Start()
+	{
+	LOG_MSG("CShutdownTimer::Start()\n");
+	After(KShutdownDelay);
+	}
+
+/**
+Stops the active scheduler. Stopping the active scheduler effectively closes
+the Debug Security Server
+*/
+void CShutdownTimer::RunL()
+	{
+	LOG_MSG("CShutdownTimer::RunL()\n");
+	CActiveScheduler::Stop();
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/debug/securityServer/src/rm_debug_svr.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,81 @@
+// 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:
+// Entry point to debug security server, sets up server/session
+// 
+//
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+
+#include <e32base.h>
+#include <e32base_private.h>
+#include <rm_debug_api.h>
+
+#include "c_security_svr_server.h"
+#include "c_security_svr_session.h"
+#include "rm_debug_logging.h"
+
+using namespace Debug;
+
+/**
+Perform all server initialisation, in particular creation of the
+scheduler and server and then run the scheduler
+*/
+void RunServerL()
+	{
+	LOG_MSG( "rm_debug_svr.cpp::RunServerL() : -> new(ELeave) CActiveScheduler\n" );
+	CActiveScheduler* s=new(ELeave) CActiveScheduler;
+
+	LOG_MSG( "rm_debug_svr.cpp::RunServerL() : -> CleanupStack::PushL(s)\n" );
+	CleanupStack::PushL(s);
+
+	LOG_MSG( "rm_debug_svr.cpp::RunServerL() : -> CActiveScheduler::Install()\n" );
+	CActiveScheduler::Install(s);
+
+	LOG_MSG( "rm_debug_svr.cpp::RunServerL() : -> CSecuritySvrServer::NewLC()\n" );
+	CSecuritySvrServer::NewLC();
+
+	LOG_MSG( "rm_debug_svr.cpp::RunServerL() : -> Rendezvous(KErrNone)\n" );
+	// Signal whoever has started us that we have done so.
+	RProcess::Rendezvous(KErrNone);
+	LOG_MSG( "rm_debug_svr.cpp::RunServerL() : <- Rendezvous()\n" );
+
+	LOG_MSG( "rm_debug_svr.cpp::RunServerL() : -> CActiveScheduler::Start()\n" );
+	CActiveScheduler::Start();
+	LOG_MSG( "rm_debug_svr.cpp::RunServerL() <- CActiveScheduler::Start()\n" );
+
+	LOG_MSG( "rm_debug_svr.cpp::RunServerL() : -> CleanupStack::PopAndDestroy()\n" );
+	CleanupStack::PopAndDestroy(2, s);
+	LOG_MSG( "rm_debug_svr.cpp::RunServerL() : <- CleanupStack::PopAndDestroy()\n" );
+	}
+
+/**
+Entry point for debug security server
+*/
+GLDEF_C TInt E32Main()
+	{
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup=CTrapCleanup::New();
+	TInt r = KErrNoMemory;
+	if (cleanup)
+		{
+		TRAP(r,RunServerL());
+		delete cleanup;
+		}
+	__UHEAP_MARKEND;
+	return r;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/debug/trkdummyapp/group/bld.inf	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,23 @@
+// 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:
+//
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_MMPFILES
+trkdummyapp.mmp
+trkdummyapp2.mmp
+trkdummyapp200159D8.mmp
+trkdummyapp200170BC.mmp
--- a/kernel/eka/doit.cmd	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/doit.cmd	Wed Sep 01 12:34:56 2010 +0100
@@ -18,7 +18,6 @@
 call setupprj
 call bld rel
 
-
 cd \
 perl e32\configure.pl %* >e32rt.txt
 call genbuild e32rt.txt
--- a/kernel/eka/drivers/bsp/bld.inf	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/bsp/bld.inf	Wed Sep 01 12:34:56 2010 +0100
@@ -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"
@@ -28,8 +28,6 @@
 
 #include "../hcr/hcr.inf"
 
-PRJ_EXPORTS
-../../include/drivers/smppower/idlehelper.h      SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(smppower/idlehelper.h)
 
 PRJ_MMPFILES
 
@@ -39,7 +37,6 @@
 #if !defined(WINS) 
 #if !defined(X86)
 ../dma/dma_lib
-../dma/dma2_lib
 #endif
 #endif
 
@@ -50,10 +47,11 @@
 ../resourceman/resman_extended_lib
 ../resmanus/resmanus
 ../resmanus/resmanusextended
+../resmanus/resmanusextendedcore
+#endif
 
+#if !defined(X86)
 #if !defined(WINS)
-../power/smppower/idlehelper_lib.mmp
-../power/smppower/sample_idlehandler/smpidlehandler_lib.mmp
 ../iic/iic
 #endif
 #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/camerasc/base_drivers_camerasc.mrp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,13 @@
+# component name "Camera Driver - Shared Chunk"
+
+component	base_drivers_camerasc
+
+source	\sf\os\kernelhwsrv\kernel\eka\drivers\camerasc
+exports	\sf\os\kernelhwsrv\kernel\eka\drivers\camerasc
+binary	\sf\os\kernelhwsrv\kernel\eka\drivers\camerasc	all
+
+notes_source	\component_defs\release.src
+
+
+
+ipr E
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/camerasc/bld.inf	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,35 @@
+// Copyright (c) 1998-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:
+// e32/drivers/camerasc/bld.inf
+// Shared Chunk Camera driver LDD
+// 
+//
+
+/**
+ @file
+*/
+
+#include <variant/platform_paths.hrh>
+
+PRJ_PLATFORMS
+
+BASEDEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+
+#if !defined(WINS) || !defined(WINSCW)
+ecamerasc
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/camerasc/cameraldd.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,2223 @@
+// 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:
+// e32/drivers/camerasc/cameraldd.cpp
+// 
+//
+
+#include <drivers/camerasc.h>
+#include <kernel/kern_priv.h>
+#include <kernel/cache.h>
+
+//#define __KTRACE_CAM(s) s;
+#define __KTRACE_CAM(s)
+
+#define DISCARD_COMPLETED_TO_AVOID_OVERFLOW
+
+static const char KCameraLddPanic[]="CameraSc LDD";
+
+/**
+Standard export function for LDDs. This creates a DLogicalDevice derived object,
+in this case, DSoundScLddFactory.
+*/
+DECLARE_STANDARD_LDD()
+	{
+	return new DCameraScLddFactory;
+	}
+
+/**
+Constructor for the camera driver factory class.
+*/
+DCameraScLddFactory::DCameraScLddFactory()
+	{
+//	iUnitsOpenMask=0;
+
+	__KTRACE_CAM(Kern::Printf(">DCameraScLddFactory::DCameraScLddFactory"));
+
+	// Set version number for this device.
+	iVersion=RDevCameraSc::VersionRequired();
+
+	// Indicate that units / PDD are supported.
+	iParseMask=KDeviceAllowUnit|KDeviceAllowPhysicalDevice;
+
+	// Leave the units decision to the PDD
+	iUnitsMask=0xffffffff;
+	}
+
+/**
+Second stage constructor for the camera driver factory class.
+This must at least set a name for the driver object.
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt DCameraScLddFactory::Install()
+	{
+	return(SetName(&KDevCameraScName));
+	}
+
+/**
+Return the 'capabilities' of the camera driver in general.
+Called in the response to an RDevice::GetCaps() request.
+@param aDes A user-side descriptor to write the capabilities information into.
+*/
+void DCameraScLddFactory::GetCaps(TDes8 &aDes) const
+	{
+	// Create a capabilities object
+	TCapsDevCameraV01 caps;
+	caps.iVersion=iVersion;
+
+	// Write it back to user memory
+	Kern::InfoCopy(aDes,(TUint8*)&caps,sizeof(caps));
+	}
+
+/**
+Called by the kernel's device driver framework to create a logical channel.
+This is called in the context of the client thread which requested the creation of a logical
+channel - through a call to RBusLogicalChannel::DoCreate().
+The thread is in a critical section.
+@param aChannel Set by this function to point to the created logical channel.
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt DCameraScLddFactory::Create(DLogicalChannelBase*& aChannel)
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLddFactory::Create"));
+
+	aChannel=new DCameraScLdd;
+	if (!aChannel)
+		return(KErrNoMemory);
+
+	return(KErrNone);
+	}
+
+/**
+Check whether a channel has is currently open on the specified unit.
+@param aUnit The number of the unit to be checked.
+@return ETrue if a channel is open on the specified channel, EFalse otherwise.
+@pre The unit info. mutex must be held.
+*/
+TBool DCameraScLddFactory::IsUnitOpen(TInt aUnit)
+	{
+	return(iUnitsOpenMask&(1<<aUnit));
+	}
+
+/**
+Attempt to change the state of the channel open status for a particular channel.
+@param aUnit The number of the unit to be updated.
+@param aIsOpenSetting	The required new state for the channel open status: either ETrue to set the status to open or
+						EFalse to set the status to closed.
+@return KErrNone if the status was updated successfully;
+		KErrInUse if an attempt has been made to set the channnel status to open while it is already open.
+*/
+TInt DCameraScLddFactory::SetUnitOpen(TInt aUnit,TBool aIsOpenSetting)
+	{
+	NKern::FMWait(&iUnitInfoMutex); // Acquire the unit info. mutex.
+
+	// Fail a request to open an channel that is already open
+	if (aIsOpenSetting && IsUnitOpen(aUnit))
+		{
+		NKern::FMSignal(&iUnitInfoMutex); // Release the unit info. mutex.
+		return(KErrInUse);
+		}
+
+	// Update the open status as requested
+	if (aIsOpenSetting)
+		iUnitsOpenMask|=(1<<aUnit);
+	else
+		iUnitsOpenMask&=~(1<<aUnit);
+
+	NKern::FMSignal(&iUnitInfoMutex); // Release the unit info. mutex.
+	return(KErrNone);
+	}
+
+/**
+Constructor for the camera driver logical channel.
+*/
+DCameraScLdd::DCameraScLdd()
+	:	iRequestQueue(&iMutex),
+		iRestartDfc(DCameraScLdd::RestartDfc,this,5),
+		iPowerDownDfc(DCameraScLdd::PowerDownDfc,this,3),
+		iPowerUpDfc(DCameraScLdd::PowerUpDfc,this,3)
+	{
+	iState=EOpen;
+//	iCaptureMode=ECaptureModeImage;
+//	iFrameHeight=0;
+//	iFrameWidth=0;
+//	iBufManager=NULL;
+//	iPowerHandler=NULL;
+//	iImageGatherCount=0;
+
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::DCameraScLdd"));
+
+	iUnit=-1;	// Invalid unit number
+
+	// Get pointer to client thread's DThread object
+	iOwningThread=&Kern::CurrentThread();
+
+	// Open a reference on client thread so it's control block can't dissapear until
+	// this driver has finished with it. Note, this call to Open() can't fail since
+	// it is the thread we are currently running in
+	iOwningThread->Open();
+	}
+
+/**
+Destructor for the camera driver logical channel.
+This is called in the context of the client thread once a 'ECloseMsg' message has been
+sent to the device driver DFC thread.
+*/
+DCameraScLdd::~DCameraScLdd()
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::~DCameraScLdd"));
+
+	TInt captureMode;
+
+	// Remove and delete the power handler.
+	if (iPowerHandler)
+		{
+		iPowerHandler->Remove();
+		delete iPowerHandler;
+		}
+
+	if (iCaptureModeConfig)
+		{
+		// Delete any buffers and shared chunk we created.
+		for (captureMode=0; captureMode < ECamCaptureModeMax; captureMode++)
+			{
+			if (iCaptureModeConfig[captureMode].iBufManager)
+				delete iCaptureModeConfig[captureMode].iBufManager;
+			}
+
+		// Delete the buffer config. info. structure.
+		for (captureMode=0; captureMode < ECamCaptureModeMax; captureMode++)
+			{
+			if (iCaptureModeConfig[captureMode].iBufConfig)
+				Kern::Free(iCaptureModeConfig[captureMode].iBufConfig);
+			}
+
+			if (iCaptureModeConfig)
+				delete[] iCaptureModeConfig;
+		}
+	// Close our reference on the client thread
+	Kern::SafeClose((DObject*&)iOwningThread,NULL);
+
+	// Clear the 'units open mask' in the LDD factory.
+	if (iUnit>=0)
+		((DCameraScLddFactory*)iDevice)->SetUnitOpen(iUnit,EFalse);
+	}
+
+/**
+Second stage constructor for the camera driver - called by the kernel's device driver framework.
+This is called in the context of the client thread which requested the creation of a logical channel
+(e.g. through a call to RBusLogicalChannel::DoCreate()).
+The thread is in a critical section.
+@param aUnit The unit argument supplied by the client. This is checked by the PDD and not used here.
+@param aInfo The info argument supplied by the client. Always NULL in this case.
+@param aVer The version argument supplied by the client.
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt DCameraScLdd::DoCreate(TInt aUnit, const TDesC8* /*aInfo*/, const TVersion& aVer)
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::DoCreate"));
+
+	// Check the client has EMultimediaDD capability.
+	if (!Kern::CurrentThreadHasCapability(ECapabilityMultimediaDD,__PLATSEC_DIAGNOSTIC_STRING("Checked by ECAMERA.LDD (Camera driver)")))
+		return(KErrPermissionDenied);
+
+	// Check that the camera driver version specified by the client is compatible.
+	if (!Kern::QueryVersionSupported(RDevCameraSc::VersionRequired(),aVer))
+		return(KErrNotSupported);
+
+	// Check that a channel hasn't already been opened on this unit.
+	TInt r=((DCameraScLddFactory*)iDevice)->SetUnitOpen(aUnit,ETrue); // Try to update 'units open mask' in the LDD factory.
+	if (r!=KErrNone)
+		return(r);
+	iUnit=aUnit;
+
+	// Create the power handler
+	iPowerHandler=new DCameraScPowerHandler(this);
+	if (!iPowerHandler)
+		return(KErrNoMemory);
+	iPowerHandler->Add();
+
+	// Create the pending capture request list
+	r=iRequestQueue.Create(iOwningThread);
+	if (r!=KErrNone)
+		return(r);
+
+	// Initialise the PDD
+	((DCameraScPdd*)iPdd)->iLdd=this;
+
+	// Setup the default camera config
+	iCaptureMode=ECamCaptureModeImage;
+
+	iCaptureModeConfig = new TCaptureModeConfig[ECamCaptureModeMax];
+	if(!iCaptureModeConfig)
+		return KErrNoMemory;
+	TInt capsSize = Pdd()->CapsSize();
+	TInt captureMode;
+	TAny* capsBuf;
+	capsBuf = Kern::Alloc(capsSize);
+	if(!capsBuf)
+		return KErrNoMemory;
+
+	// Query the driver for its capabilities and set a default pixel format
+	// and frame size for each available capture mode.
+	TPtr8 capsPtr( (TUint8*)capsBuf, capsSize, capsSize );
+	Pdd()->Caps(capsPtr);
+
+	TCameraCapsV02* caps = (TCameraCapsV02*) capsPtr.Ptr();
+	SDevCamPixelFormat* pixelFormat = (SDevCamPixelFormat*) (caps + 1);
+	SDevCamFrameSize* frameSize;
+	TAny* frameSizeCapsBuf=0;
+	TPtr8 frameSizeCapsPtr(0,0,0);
+
+	// Set the cache to hold the default dynamic attribute values.
+	iBrightnessValue = caps->iDynamicRange[ECamAttributeBrightness].iDefault;
+	iContrastValue = caps->iDynamicRange[ECamAttributeContrast].iDefault;
+	iColorEffectValue = caps->iDynamicRange[ECamAttributeColorEffect].iDefault;
+	
+	for (captureMode=0; captureMode < ECamCaptureModeMax; captureMode++)
+		{
+		if ((captureMode==ECamCaptureModeImage) && (caps->iNumImagePixelFormats==0))
+			continue;
+
+		if ((captureMode==ECamCaptureModeVideo) && (caps->iNumVideoPixelFormats==0))
+			continue;
+
+		if ((captureMode==ECamCaptureModeViewFinder) && (caps->iNumViewFinderPixelFormats==0))
+			continue;
+
+		iCaptureModeConfig[captureMode].iCamConfig.iPixelFormat=*pixelFormat;
+		frameSizeCapsBuf = Kern::Alloc(pixelFormat->iNumFrameSizes*sizeof(SDevCamFrameSize));
+		new (&frameSizeCapsPtr) TPtr8((TUint8*)frameSizeCapsBuf, pixelFormat->iNumFrameSizes*sizeof(SDevCamFrameSize), pixelFormat->iNumFrameSizes*sizeof(SDevCamFrameSize));
+		r=Pdd()->FrameSizeCaps((TDevCamCaptureMode)captureMode, pixelFormat->iPixelFormat, frameSizeCapsPtr);
+		if(r!=KErrNone)
+			{
+			Kern::Free(frameSizeCapsBuf);
+			return r;
+			}
+		frameSize=(SDevCamFrameSize*) frameSizeCapsPtr.Ptr();
+		iCaptureModeConfig[captureMode].iCamConfig.iFrameSize = *frameSize;
+		iCaptureModeConfig[captureMode].iCamConfig.iFrameRate = frameSize->iMinFrameRate;
+		Kern::Free(frameSizeCapsBuf);
+
+		iCaptureModeConfig[captureMode].iCamConfig.iFlashMode = ECamFlashNone;
+		iCaptureModeConfig[captureMode].iCamConfig.iExposureMode = ECamExposureAuto;
+		iCaptureModeConfig[captureMode].iCamConfig.iWhiteBalanceMode = ECamWBAuto;
+		iCaptureModeConfig[captureMode].iCamConfig.iZoom = 0;
+		iCaptureModeConfig[captureMode].iCamConfig.iPixelWidthInBytes = 0;
+		}
+	Kern::Free(capsBuf);
+	// Setup the default buffer config.
+	r=ReAllocBufferConfigInfo(0);	// Zeros the structure
+	if (r!=KErrNone)
+		return(r);
+	for (captureMode=0; captureMode < ECamCaptureModeMax; captureMode++)
+		{
+		iCaptureModeConfig[captureMode].iBufConfig->iNumBuffers=KDefaultNumClientBuffers;
+		}
+
+	// Set up the correct DFC queue and enable the reception of client messages.
+	TDfcQue* dfcq=((DCameraScPdd*)iPdd)->DfcQ(aUnit);
+	SetDfcQ(dfcq);
+	iRestartDfc.SetDfcQ(dfcq);
+	iPowerDownDfc.SetDfcQ(dfcq);
+	iPowerUpDfc.SetDfcQ(dfcq);
+	iMsgQ.Receive();
+
+	__KTRACE_CAM(Kern::Printf("<DCameraScLdd::DoCreate"));
+
+	return(KErrNone);
+	}
+
+/**
+Shutdown the camera device.
+Terminate all device activity and power down the hardware.
+*/
+void DCameraScLdd::Shutdown()
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::Shutdown"));
+
+	iState=EOpen;
+
+	// Power down the hardware
+	Pdd()->PowerDown();
+
+	// Cancel any requests that we may be handling
+	DoCancel(RDevCameraSc::EAllRequests);
+
+	// Make sure DFCs are not queued.
+	iRestartDfc.Cancel();
+	iPowerDownDfc.Cancel();
+	iPowerUpDfc.Cancel();
+	}
+
+/**
+Notification to the driver that a handle to it has been requested by a user thread.
+The use of a camera driver channel is restricted here to a single thread (that has
+EMultimediaDD capability).
+@param aThread A pointer to thread which is requesting the handle.
+@param aType Whether the requested handle is thread or process relative.
+@return	KErrNone, if the request is for a thread relative handle - originating from
+		the same the thread that created the channel object;
+		KErrAccessDenied, otherwise.
+*/
+TInt DCameraScLdd::RequestUserHandle(DThread* aThread, TOwnerType aType)
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::RequestUserHandle"));
+
+	// Ensure that each channel can only be used by a single thread.
+	if (aType!=EOwnerThread || aThread!=iOwningThread)
+		return(KErrAccessDenied);
+	return(KErrNone);
+	}
+
+/**
+Process a request on this logical channel
+Called in the context of the client thread.
+@param aReqNo	The request number:
+				==KMaxTInt: a 'DoCancel' message;
+				>=0: a 'DoControl' message with function number equal to value.
+				<0: a 'DoRequest' message with function number equal to ~value.
+@param a1 The first request argument. For DoRequest(), this is a pointer to the TRequestStatus.
+@param a2 The second request argument. For DoRequest(), this is a pointer to the 2 actual TAny* arguments.
+@return The result of the request. This is ignored by device driver framework for DoRequest().
+*/
+TInt DCameraScLdd::Request(TInt aReqNo, TAny* a1, TAny* a2)
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::Request(%d)",aReqNo));
+	TInt r;
+	if (aReqNo<RDevCameraSc::EMsgControlMax && aReqNo>(~RDevCameraSc::EMsgRequestMax))
+		{
+		// Implement in the context of the kernel thread - prepare and issue a kernel message.
+		r=DLogicalChannel::Request(aReqNo,a1,a2);
+		}
+	else
+		{
+		// Implement in the context of the client thread.
+		// Decode the message type and dispatch it to the relevent handler function.
+		if ((TUint)aReqNo<(TUint)KMaxTInt)
+			r=DoControl(aReqNo,a1,a2);		// DoControl - process the request.
+
+		else if (aReqNo==KMaxTInt)
+			{
+			r=DoCancel((TInt)a1);			// DoCancel - cancel the request.
+			}
+
+		else
+			{
+			// DoRequest
+			TInt func=~aReqNo;
+
+			// NotifyNewImage() during image capture mode is another case which must be handled in the kernel thread.
+			if (iCaptureMode==ECamCaptureModeImage && func==RDevCameraSc::ERequestNotifyNewImage)
+				r=DLogicalChannel::Request(aReqNo,a1,a2);
+			else
+				{
+				// Read the arguments from the client thread and process the request.
+				TAny* a[2];
+				kumemget32(a,a2,sizeof(a));
+				TRequestStatus* status=(TRequestStatus*)a1;
+				r=DoRequest(func,status,a[0],a[1]);
+
+				// Complete request if there was an error
+				if (r!=KErrNone)
+					Kern::RequestComplete(iOwningThread,status,r);
+				r=KErrNone;
+				}
+			}
+		}
+	__KTRACE_CAM(Kern::Printf("<DCameraScLdd::Request - %d",r));
+	return(r);
+	}
+
+/**
+Process a message for this logical channel.
+This function is called in the context of the DFC thread.
+@param aMsg The message to process.
+			The iValue member of this distinguishes the message type:
+			iValue==ECloseMsg, channel close message.
+			iValue==KMaxTInt, a 'DoCancel' message.
+			iValue>=0, a 'DoControl' message with function number equal to iValue.
+			iValue<0, a 'DoRequest' message with function number equal to ~iValue.
+*/
+void DCameraScLdd::HandleMsg(TMessageBase* aMsg)
+	{
+	TThreadMessage& m=*(TThreadMessage*)aMsg;
+	TInt id=m.iValue;
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::HandleMsg(%d)",id));
+
+	// Decode the message type and dispatch it to the relevent handler function.
+	if (id==(TInt)ECloseMsg)
+		{
+		// Channel close.
+		Shutdown();
+		m.Complete(KErrNone,EFalse);
+		return;
+		}
+	else if (id<0)	// The only DoRequest handled in the kernel thread is NotifyNewImage(ECamCaptureModeImage).
+		{
+		// DoRequest
+		TRequestStatus* pS=(TRequestStatus*)m.Ptr0();
+		TInt r=DoRequest(~id,pS,m.Ptr1(),m.Ptr2());
+		if (r!=KErrNone)
+			Kern::RequestComplete(iOwningThread,pS,r);
+		m.Complete(KErrNone,ETrue);
+		}
+	else
+		{
+		// Must be DoControl (Cancel is handled in the client thread).
+		TInt r=DoControl(id,m.Ptr0(),m.Ptr1());
+		m.Complete(r,ETrue);
+		}
+	}
+
+/**
+Process a synchronous 'DoControl' request.
+This function is called in the context of the DFC thread.
+@param aFunction The request number.
+@param a1 The first request argument.
+@param a2 The second request argument.
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt DCameraScLdd::DoControl(TInt aFunction, TAny* a1, TAny* a2)
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::DoControl(%d)",aFunction));
+
+	TInt r=KErrNotSupported;
+	switch (aFunction)
+		{
+		case RDevCameraSc::EControlCaps:
+			{
+			r = GetSensorCaps(a1);
+			break;
+			}
+		case RDevCameraSc::EControlSetCaptureMode:
+			{
+			// Change the capture mode.
+			r=SetCaptureMode((TInt)a1);
+			break;
+			}
+		case RDevCameraSc::EControlSetCamConfig:
+			{
+			// Set the new camera configuration.
+			NKern::ThreadEnterCS();
+			r=SetCamConfig((TInt)a1, (const TDesC8*)a2);
+			NKern::ThreadLeaveCS();
+			break;
+			}
+		case RDevCameraSc::EControlGetCamConfig:
+			{
+			// Write the config to the client.
+			TPtrC8 ptr((const TUint8*)&iCaptureModeConfig[(TInt)a1].iCamConfig,sizeof(iCaptureModeConfig[(TInt)a1].iCamConfig));
+			Kern::InfoCopy(*((TDes8*)a2),ptr);
+			r=KErrNone;
+			break;
+			}
+		case RDevCameraSc::EControlGetBufferConfig:
+			if (iCaptureModeConfig[(TInt)a1].iBufConfig)
+				{
+				// Write the buffer config to the client.
+				TPtrC8 ptr((const TUint8*)&(*iCaptureModeConfig[(TInt)a1].iBufConfig),iCaptureModeConfig[(TInt)a1].iBufConfigSize);
+				Kern::InfoCopy(*((TDes8*)a2),ptr);
+				r=KErrNone;
+				}
+			break;
+		case RDevCameraSc::EControlSetBufConfigChunkCreate:
+			// Need to be in critical section while deleting an exisiting config and creating a new one
+			NKern::ThreadEnterCS();
+			r=SetBufConfig((TInt)a1,(TInt)a2);
+			NKern::ThreadLeaveCS();
+			break;
+		case RDevCameraSc::EControlSetBufConfigChunkOpen:
+			SSetBufConfigChunkOpenInfo info;
+			r=Kern::ThreadRawRead(iOwningThread,a2,&info,sizeof(info));
+			if (r==KErrNone)
+				{
+				// Need to be in critical section while deleting an exisiting config and creating a new one
+				NKern::ThreadEnterCS();
+				r=SetBufConfig((TInt)a1,info.iBufferConfigBuf,info.iChunkHandle);
+				NKern::ThreadLeaveCS();
+				}
+			break;
+		case RDevCameraSc::EControlChunkClose:
+			r=ChunkClose((TInt)a1);
+			break;
+		case RDevCameraSc::EControlStart:
+			r=Start();
+			break;
+		case RDevCameraSc::EControlStop:
+			if (iState==ECapturing)
+				{
+				r=Pdd()->Stop();
+				DoCancel(1<<RDevCameraSc::ERequestNotifyNewImage);
+				if (r==KErrNone)
+					iState=EConfigured;
+				}
+			else
+				{
+				r=KErrGeneral;
+				}
+			break;
+		case RDevCameraSc::EControlReleaseBuffer:
+			r=ReleaseBuffer((TInt)a1);
+			break;
+		case RDevCameraSc::EControlNotifyNewImageSpecificCancel:
+			{
+			NKern::FMWait(&iMutex); 		// Acquire the buffer/request list mutex.
+			iRequestQueue.Cancel((TRequestStatus*)a1);
+			NKern::FMSignal(&iMutex); 		// Release the buffer/request list mutex.
+			r=KErrNone;
+			break;
+			}
+			
+		case RDevCameraSc::EControlBufferIdToOffset:
+			{
+			// a1 has pointer to buffer for search criteria
+			// a2 has pointer to offset for result
+			TDevCamBufferModeAndId info;
+			TPtr8 inDesc((TUint8*)(&info), sizeof(info));
+
+			r = Kern::ThreadDesRead(iOwningThread,a1,inDesc,0);
+			if (r == KErrNone)
+				{
+				TInt id = info.iId;
+				TDevCamCaptureMode captureMode = info.iCaptureMode;
+
+				r = KErrNotFound;
+				DBufferManager* mgr = iCaptureModeConfig[captureMode].iBufManager;
+				if (mgr)
+					{
+					if (mgr->iImageBuffer[id].iId == id)
+						{
+						kumemput32(a2, &mgr->iImageBuffer[id].iChunkOffset, sizeof(TInt));
+						r = KErrNone;
+						}
+					}
+				}
+			
+			break;
+			}
+		case RDevCameraSc::EControlCapsSize:
+			{
+			r = Pdd()->CapsSize();
+			break;
+			}
+		case RDevCameraSc::EControlFrameSizeCaps:
+			{
+			r = GetFrameSizeCaps(a1, a2);
+			break;
+			}
+			
+		case RDevCameraSc::EControlSetDynamicAttribute:
+			{
+			NKern::ThreadEnterCS();
+			r = SetDynamicAttribute((TInt)a1, (TUint)a2);
+			NKern::ThreadLeaveCS();
+			break;
+			}
+			
+		case RDevCameraSc::EControlGetDynamicAttribute:
+			{
+			TInt attribute = (TInt)(a1);
+			TUint value = 0;
+			
+			r = GetDynamicAttribute(attribute, value);
+			if (r == KErrNone)
+				{
+				kumemput32(a2, &value, sizeof(TUint));
+				}
+				
+			break;
+			}
+			
+		}
+	return(r);
+	}
+
+/**
+Process an asynchronous 'DoRequest' request.
+This function is called in the context of the DFC thread.
+@param aFunction The request number.
+@param aStatus A pointer to the TRequestStatus.
+@param a1 The first request argument.
+@param a2 The second request argument.
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt DCameraScLdd::DoRequest(TInt aFunction, TRequestStatus* aStatus, TAny* /*a1*/, TAny* /*a2*/)
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::DoRequest(%d)",aFunction));
+
+	TInt r=KErrNotSupported;
+	switch (aFunction)
+		{
+		case RDevCameraSc::ERequestNotifyNewImage:
+			r=NotifyNewImage(aStatus);
+			break;
+		}
+
+	__KTRACE_CAM(Kern::Printf("<DCameraScLdd::DoRequest - %d",r));
+	return(r);
+	}
+
+/**
+Process the cancelling of asynchronous requests.
+This function is called in the context of the DFC thread.
+@param aMask A mask indicating which requests need to be cancelled.
+@return The result of the cancel. Either KErrNone if successful, otherwise one of the other
+	system wide error codes.
+*/
+TInt DCameraScLdd::DoCancel(TUint aMask)
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::DoCancel(%08x)",aMask));
+
+	if (aMask&(1<<RDevCameraSc::ERequestNotifyNewImage))
+		{
+		NKern::FMWait(&iMutex); 		// Acquire the buffer/request list mutex.
+		iRequestQueue.CancelAll();
+		NKern::FMSignal(&iMutex); 		// Release the buffer/request list mutex.
+		}
+	return(KErrNone);
+	}
+
+/**
+@pre The thread must be in a critical section.
+*/
+TInt DCameraScLdd::ReAllocBufferConfigInfo(TInt aNumBuffers)
+	{
+	for (TInt captureMode=0; captureMode < ECamCaptureModeMax; captureMode++)
+		{
+		if (iCaptureModeConfig[captureMode].iBufConfig)
+			{
+			Kern::Free(iCaptureModeConfig[captureMode].iBufConfig);
+			iCaptureModeConfig[captureMode].iBufConfig=NULL;
+			}
+
+		iCaptureModeConfig[captureMode].iBufConfigSize=aNumBuffers*(sizeof(SBufSpecList)); // Size of the three integers that hold the offset to the start of each buffer and the buffer id.
+		iCaptureModeConfig[captureMode].iBufConfigSize+=sizeof(TSharedChunkBufConfigBase);
+		iCaptureModeConfig[captureMode].iBufConfig=(TCameraSharedChunkBufConfig*)Kern::AllocZ(iCaptureModeConfig[captureMode].iBufConfigSize);
+		if (!iCaptureModeConfig[captureMode].iBufConfig)
+			return(KErrNoMemory);
+		}
+	return(KErrNone);
+	}
+
+/**
+Reallocate memory for the new buffer configuration.
+@param aNumBuffers The number of buffers.
+@pre The thread must be in a critical section.
+*/
+TInt DCameraScLdd::ReAllocBufferConfigInfo(TInt aCaptureMode, TInt aNumBuffers)
+	{
+	if (iCaptureModeConfig[aCaptureMode].iBufConfig)
+		{
+		Kern::Free(iCaptureModeConfig[aCaptureMode].iBufConfig);
+		iCaptureModeConfig[aCaptureMode].iBufConfig=NULL;
+		}
+
+	iCaptureModeConfig[aCaptureMode].iBufConfigSize=aNumBuffers*(sizeof(SBufSpecList)); // Size of the three integers that hold the offset to the start of each buffer and the buffer id.
+	iCaptureModeConfig[aCaptureMode].iBufConfigSize+=sizeof(TSharedChunkBufConfigBase);
+	iCaptureModeConfig[aCaptureMode].iBufConfig=(TCameraSharedChunkBufConfig*)Kern::AllocZ(iCaptureModeConfig[aCaptureMode].iBufConfigSize);
+	if (!iCaptureModeConfig[aCaptureMode].iBufConfig)
+		return(KErrNoMemory);
+
+	return(KErrNone);
+	}
+
+/**
+@return	A handle to the shared chunk for the owning thread (a value >0), if successful;
+		otherwise one of the other system wide error codes, (a value <0).
+@param aCamConfigBuf The supplied camera configuration.
+@pre The thread must be in a critical section.
+*/
+TInt DCameraScLdd::SetCamConfig(TInt aCaptureMode, const TDesC8* aCamConfigBuf)
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::SetCamConfig()"));
+
+	// Set the configuration of the sensor
+	TInt r=DoSetConfig(aCaptureMode, aCamConfigBuf);
+	return(r);
+	}
+
+/**
+Allows changing of the dynamic settings.
+Checks locally the validity of the arguments passed so as to increase performance by not
+forcing a context switch.
+
+If the setting has been accepted by the sensor the new value is cached by the LDD so further
+querying does not involve another context switch.
+
+@param aAttribute An enum identifying the dynamic attribute to change.
+@param aValue The attributes value.
+@return KErrNone if successful, KErrNotSupported if not supported, KErrArgument if aValue out of range.
+		Otherwise, one of the system wide error codes.
+@pre The thread must be in a critical section.
+*/
+TInt DCameraScLdd::SetDynamicAttribute(TInt aAttribute, TUint aValue)
+	{
+	TUint* attrCachePtr = NULL;
+	TInt err = KErrNotSupported;
+	
+	switch (aAttribute)
+		{
+		case ECamAttributeBrightness:
+			err = Pdd()->SetBrightness(aValue);
+			attrCachePtr = &iBrightnessValue;
+			break;
+			
+		case ECamAttributeContrast:
+			err = Pdd()->SetContrast(aValue);
+			attrCachePtr = &iContrastValue;
+			break;
+			
+		case ECamAttributeColorEffect:
+			err = Pdd()->SetColorEffect(aValue);
+			attrCachePtr = &iColorEffectValue;
+			break;
+			
+		default:
+			return err;
+		}
+	
+	if (err == KErrNone)
+		{
+		// Cache the set value.
+		__ASSERT_DEBUG(attrCachePtr, Kern::Fault(KCameraLddPanic, __LINE__));
+		*attrCachePtr = aValue;
+		}
+		
+	return err;
+	}
+
+
+/**
+Allows querying of a dynamic setting.
+The value is read from the cached LDD values.
+
+@param aAttribute An enum identifying the dynamic attribute to change.
+@param aValue A reference to a variable that will receive the attribute value.
+@return KErrNone if successful, KErrNotFound if aAttribute is an unsupported
+        setting. The parameter aValue is not changed if this function fails.
+*/
+TInt DCameraScLdd::GetDynamicAttribute(TInt aAttribute, TUint& aValue)
+	{
+	switch (aAttribute)
+		{
+		case ECamAttributeBrightness:
+			aValue = iBrightnessValue;
+			break;
+			
+		case ECamAttributeContrast:
+			aValue = iContrastValue;
+			break;
+			
+		case ECamAttributeColorEffect:
+			aValue = iColorEffectValue;
+			break;
+			
+		default:
+			return KErrNotFound;
+		}
+		
+	return KErrNone;
+	}
+
+
+/**
+Updates the buffer configuration of the camera for the specified capture mode.
+@return	A handle to the shared chunk for the owning thread (a value >0), if successful;
+		otherwise one of the other system wide error codes, (a value <0).
+*/
+TInt DCameraScLdd::SetBufConfig(TInt aCaptureMode, TInt aNumBuffers)
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::SetBufConfig(CaptureMode=%d,NumBuffers=%d)",aCaptureMode,aNumBuffers));
+
+	// Free any memory and chunk already allocated
+	TInt r=ChunkClose(aCaptureMode);
+	if (r!=KErrNone)
+		return(r);
+
+	// Allocate a new shared chunk and create the specified number of buffers within it.
+	TInt buffersize=((iCaptureModeConfig[aCaptureMode].iCamConfig.iFrameSize.iWidth*iCaptureModeConfig[aCaptureMode].iCamConfig.iFrameSize.iHeight) * iCaptureModeConfig[aCaptureMode].iCamConfig.iPixelWidthInBytes);
+	__KTRACE_CAM(Kern::Printf(">>DCameraScLdd::SetBufConfig - iFrameSize:%d, iPixelWidthInBytes:%d => bufferSize:%d",(iCaptureModeConfig[aCaptureMode].iCamConfig.iFrameSize.iWidth*iCaptureModeConfig[aCaptureMode].iCamConfig.iFrameSize.iHeight),iCaptureModeConfig[aCaptureMode].iCamConfig.iPixelWidthInBytes,buffersize));
+	iCaptureModeConfig[aCaptureMode].iBufManager=new DBufferManager(this);
+	if (!iCaptureModeConfig[aCaptureMode].iBufManager)
+		return(KErrNoMemory);
+	r=iCaptureModeConfig[aCaptureMode].iBufManager->Create(aNumBuffers,buffersize);
+	if (r!=KErrNone)
+		return(r);
+
+	// Update the LDD's chunk/buffer geometry info.
+	r=ReAllocBufferConfigInfo(aCaptureMode, aNumBuffers);
+	if (r!=KErrNone)
+		return(r);
+	iCaptureModeConfig[aCaptureMode].iBufManager->GetBufConfig(*iCaptureModeConfig[aCaptureMode].iBufConfig);
+
+	// Create handle to the shared chunk for the owning thread.
+	r=Kern::MakeHandleAndOpen(iOwningThread,iCaptureModeConfig[aCaptureMode].iBufManager->iChunk);
+	if (r>0)
+		{
+		// And save the the chunk and handle for later.  Normally the chunk handle will be closed when the chunk
+		// is closed, but if the chunk is re-allocated then it will need to be closed before re-allocation.
+		iCaptureModeConfig[aCaptureMode].iChunkHandle=r;
+		}
+
+	__KTRACE_CAM(Kern::Printf("<DCameraScLdd::SetBufConfig - %d",r));
+	return(r);
+	}
+
+/**
+Updates the buffer configuration of the camera, which has been supplied by the user, for the specified capture mode.
+@param aCaptureMode		The capture mode for which the setting of the buffer configuration is made.
+@param aBufferConfigBuf	A buffer that holds the buffer configuration for the camera.
+@param aChunkHandle		A handle for the shared chunk supplied by the client.
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+@pre The thread must be in a critical section.
+*/
+TInt DCameraScLdd::SetBufConfig(TInt aCaptureMode,const TDesC8* aBufferConfigBuf,TInt aChunkHandle)
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::SetConfig(Handle-%d)",aChunkHandle));
+
+	// Read the buffer config structure from the client.
+	TInt numBuffers;
+	TPtr8 ptr((TUint8*)&numBuffers,sizeof(numBuffers));
+	TInt r=Kern::ThreadDesRead(iOwningThread,aBufferConfigBuf,ptr,0);
+	if (r!=KErrNone)
+		return(r);
+	// Calculate the minimum length of the descriptor.
+	TInt minDesLen=(numBuffers*sizeof(SBufSpecList))+sizeof(TSharedChunkBufConfigBase);
+	r=Kern::ThreadGetDesLength(iOwningThread,aBufferConfigBuf);
+	if (r<minDesLen)
+		return(KErrArgument);
+	r=ReAllocBufferConfigInfo(aCaptureMode, numBuffers);
+	if (r!=KErrNone)
+		return(r);
+	ptr.Set((TUint8*)iCaptureModeConfig[aCaptureMode].iBufConfig,0,iCaptureModeConfig[aCaptureMode].iBufConfigSize);
+	r=Kern::ThreadDesRead(iOwningThread,aBufferConfigBuf,ptr,0);
+	if (r!=KErrNone)
+		return(r);
+
+	// Free any memory and chunk already allocated
+	r=ChunkClose(aCaptureMode);
+	if (r!=KErrNone)
+		return(r);
+
+	// Open the shared chunk supplied and create buffer objects for the committed buffers within it.
+	iCaptureModeConfig[aCaptureMode].iBufManager=new DBufferManager(this);
+	if (!iCaptureModeConfig[aCaptureMode].iBufManager)
+		return(KErrNoMemory);
+	r=iCaptureModeConfig[aCaptureMode].iBufManager->Create(*iCaptureModeConfig[aCaptureMode].iBufConfig,aChunkHandle,iOwningThread);
+	if (r!=KErrNone)
+		return(r);
+
+	__KTRACE_CAM(Kern::Printf("<DCameraScLdd::SetConfig - %d",KErrNone));
+	return(r);
+	}
+
+/**
+Frees the buffer manager associated with a chunk, and closes the chunk itself.  The chunk being closed,
+and its associated DBufferManager instance should have been allocated by the device driver.  However,
+this is not a requirement.
+@param aCaptureMode The capture mode for which to free the buffer manager and chunk.
+@return	KErrNone if successful.
+		KErrInUse if an attempt has been made to free the memory and chunk while they are in use.
+		Otherwise one of the other system-wide error codes.
+*/
+TInt DCameraScLdd::ChunkClose(TInt aCaptureMode)
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::ChunkClose(Capture Mode-%d)",aCaptureMode));
+
+	if(iCaptureMode == aCaptureMode)
+        {
+        if (iState==ECapturing)
+            return(KErrInUse);
+        }
+
+	// Delete any existing buffers
+	if (iCaptureModeConfig[aCaptureMode].iBufManager)
+		{
+		delete iCaptureModeConfig[aCaptureMode].iBufManager;
+		iCaptureModeConfig[aCaptureMode].iBufManager=NULL;
+		}
+
+	// If a handle to the shared chunk was created, close it, using the handle of the thread on which
+	// it was created, in case a different thread is now calling us
+	if (iCaptureModeConfig[aCaptureMode].iChunkHandle>0)
+		{
+		Kern::CloseHandle(iOwningThread,iCaptureModeConfig[aCaptureMode].iChunkHandle);
+		iCaptureModeConfig[aCaptureMode].iChunkHandle=0;
+		}
+
+	return(KErrNone);
+	}
+
+/**
+Set the current capture mode and submits the camera configuration to the PDD, passing it as a descriptor
+to support future changes to the config structure.
+
+@param aCaptureMode	The capture mode that the camera switches to.
+@return KErrNone if successful;
+		otherwise one of the other system-wide error codes.
+*/
+TInt DCameraScLdd::SetCaptureMode(TInt aCaptureMode)
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::SetCaptureMode(Mode-%d)",aCaptureMode));
+
+	TInt r=KErrNone;
+	if(aCaptureMode >= ECamCaptureModeMax || aCaptureMode < 0)
+		{
+		r=KErrNotFound;
+		return(r);
+		}
+
+	if (!iCaptureModeConfig[aCaptureMode].iBufManager)
+		{
+		r=KErrNotReady;
+		return(r);
+		}
+
+	iCaptureMode=(TDevCamCaptureMode)aCaptureMode;	// The capture mode has already been checked for its validity.
+
+	__KTRACE_CAM(Kern::Printf("DCameraScLdd::SetCaptureMode: iFrameSize:%dx%d)",iCaptureModeConfig[iCaptureMode].iCamConfig.iFrameSize.iWidth, iCaptureModeConfig[iCaptureMode].iCamConfig.iFrameSize.iHeight));
+
+	// Call the PDD to change the hardware configuration according to the new capture mode.
+	// Pass it as a descriptor - to support future changes to the config structure.
+	TPtr8 ptr((TUint8*)&iCaptureModeConfig[iCaptureMode].iCamConfig,sizeof(iCaptureModeConfig[iCaptureMode].iCamConfig),sizeof(iCaptureModeConfig[iCaptureMode].iCamConfig));
+	r=Pdd()->SetConfig(ptr);
+	if (r!=KErrNone)
+		return(r);
+	return KErrNone;
+	}
+
+
+/**
+Process a start image capture request from the client - in the capture mode supplied.
+If this is a free running mode then the PDD is called straight away to commence capturing frames. In one shot mode the driver postpones the capturing
+of frames until a NotifyNewImage() request is received.
+@return KErrNone if successful; whether capture mode was actually started or deferred until NotifyNewImage();
+		KErrNotReady if SetConfig() has not been previously called;
+		otherwise one of the other system-wide error codes.
+*/
+TInt DCameraScLdd::Start()
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::Start(Current Mode-%d)",iCaptureMode));
+
+	if (iState==ECapturing)
+		return(KErrInUse);
+	TInt r=KErrNone;
+
+	// Only continue if the mode being started has been configured
+	if (iCaptureModeConfig[iCaptureMode].iBufManager)
+		iState=EConfigured;
+
+	if (iState==EOpen)
+		r=KErrNotReady;
+	else if (iState==EConfigured)
+		{
+		iCaptureModeConfig[iCaptureMode].iBufManager->Reset();
+		if (iCaptureMode!=ECamCaptureModeImage)
+			r=DoStart();
+		if (r==KErrNone)
+			iState=ECapturing;
+		}
+	else
+		r=KErrGeneral;
+	return(r);
+	}
+
+/**
+Start the PDD capturing images.
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt DCameraScLdd::DoStart()
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::DoStart()"));
+
+	DBufferManager* bufManager=iCaptureModeConfig[iCaptureMode].iBufManager;
+	TLinAddr linAddr=(bufManager->iChunkBase)+(bufManager->iCurrentBuffer->iChunkOffset);
+	TPhysAddr physAddr=bufManager->iCurrentBuffer->iPhysicalAddress;
+	TInt r=Pdd()->Start(iCaptureMode,linAddr,physAddr);
+
+/*
+ * 	James Cooper: Uncommenting this code will cause the ASSERT_DEBUG in SetImageCaptured() to fail
+ * 	if (r==KErrNone && bufManager->iNextBuffer)
+		{
+		linAddr=(bufManager->iChunkBase)+(bufManager->iNextBuffer->iChunkOffset);
+		physAddr=bufManager->iNextBuffer->iPhysicalAddress;
+		r=Pdd()->CaptureNextImage(linAddr,physAddr);
+		}
+*/	
+	return(r);
+	}
+
+/**
+Process a notify a new image request from the client.
+If there is an image already available then the request is completed straight away, otherwise it is added to the capture request queue.
+@param aStatus	The request status to be signalled when the request is complete. If the request is successful then this is set
+				to the offset within the shared chunk where the record data resides. Alternatively, if an error occurs,
+				it will be set to one of the system wide error values.
+@return KErrNone if successful - whether the request was completed or simply queued;
+		KErrNotReady if Start() hasn't been previousely called;
+		KErrInUse: if the client needs to free up buffers before further requests can be accepted;
+		KErrGeneral: if the client has more requests queued than there are buffers;
+		otherwise one of the other system wide error codes.
+*/
+TInt DCameraScLdd::NotifyNewImage(TRequestStatus* aStatus)
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::NotifyNewImage(%x) - iState(%d)",aStatus,iState));
+	DBufferManager* bufManager=iCaptureModeConfig[iCaptureMode].iBufManager;
+	TInt r;
+	if (iState!=ECapturing || !bufManager)
+		return(KErrNotReady);
+
+	NKern::FMWait(&iMutex); 		// Acquire the buffer/request list mutex.
+	if (iCaptureMode!=ECamCaptureModeImage)
+		{
+		// We're operating in one of the free running modes, see if an image is already available.
+		__KTRACE_CAM(Kern::Printf(">DCameraScLdd::NotifyNewImage - Getting image for client"));
+		TImageBuffer* buf=bufManager->GetImageForClient(EFalse);
+		if (buf)
+			{
+			__KTRACE_CAM(Kern::Printf(">DCameraScLdd::NotifyNewImage - There is an image available already"));
+			// There is an image available already - complete the request.
+			r=buf->iResult;
+			NKern::FMSignal(&iMutex); 	// Release the buffer/request list mutex.
+			if (r==KErrNone)
+				{
+				// Only complete if successful here. Errors will be completed on returning from this method.
+				__KTRACE_CAM(Kern::Printf(">DCameraScLdd::NotifyNewImage(iId:%d)",buf->iId));
+				Kern::RequestComplete(iOwningThread,aStatus,(buf->iId));
+				}
+			return(r);
+			}
+
+		// The buffer 'completed' list is empty. If the 'in-use' list contains all the buffers apart from the one being filled
+		// then let the client know they need to free some buffers.
+		if (bufManager->iFreeBufferQ.IsEmpty() && !bufManager->iNextBuffer)
+			{
+			NKern::FMSignal(&iMutex); 	// Release the buffer/request list mutex.
+			return(KErrInUse);
+			}
+		}
+	else
+		{
+		// We're operating in one shot image capture mode. Check if the client needs to free up some buffers
+		// before we can accept the request.
+		if (bufManager->iCompletedBufferQ.IsEmpty() && bufManager->iFreeBufferQ.IsEmpty() && !bufManager->iNextBuffer)
+			{
+			NKern::FMSignal(&iMutex); 	// Release the buffer/request list mutex.
+			return(KErrInUse);
+			}
+
+		// Enough buffers are available so we can start capturing data. First
+		// check that there isn't already a capture request in progress.
+		if (iRequestQueue.IsEmpty())
+			{
+			// No previous request in progress so start the PDD.
+			NKern::FMSignal(&iMutex); 	// Release the buffer/request list mutex.
+			r=DoStart();
+			if (r!=KErrNone)
+				return(r);
+			NKern::FMWait(&iMutex); 		// Acquire the buffer/request list mutex again.
+			}
+		}
+
+	// Save the request in the pending queue and return. The request will be completed from the PDD and the DFC thread when
+	// an image is available.
+	r=iRequestQueue.Add(aStatus);
+	NKern::FMSignal(&iMutex); 	// Release the buffer/request list mutex.
+	return(r);
+	}
+
+/**
+Process a release buffer request from the client.
+@param aChunkOffset The chunk offset corresponding to the buffer to be freed.
+@return KErrNone if successful;
+		KErrNotFound if no 'in use' buffer had the specified chunk offset;
+		KErrNotReady if the driver hasn't been configured for the current capture mode.
+*/
+TInt DCameraScLdd::ReleaseBuffer(TInt aBufferId)
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::ReleaseBuffer(%d)",aBufferId));
+	if(!iCaptureModeConfig[iCaptureMode].iBufManager)
+		return KErrNotReady;
+	DBufferManager* bufManager=iCaptureModeConfig[iCaptureMode].iBufManager;
+	TInt chunkOffset = 0;
+
+	TInt r=KErrNone;
+	/*	The driver is left in an ECapturing state after capturing frames. However, it can be left in an
+		EConfigured state as a result of Stop() being called. Stop() cancels all pending capture requests and
+		leaves the driver in a state in which it can be restarted without needing reconfiguring.	*/
+	if (iState!=EOpen && bufManager)
+		{
+		chunkOffset = bufManager->iImageBuffer[aBufferId].iChunkOffset;
+		TImageBuffer* buf=NULL;
+		NKern::FMWait(&iMutex); 		// Acquire the buffer/request list mutex.
+		buf=bufManager->FindInUseImage(chunkOffset);
+		NKern::FMSignal(&iMutex); 		// Release the buffer/request list mutex.
+		if (buf)
+			{
+			// The buffer specified by the client has been found in the 'in-use' list.
+			bufManager->Purge(buf);
+			}
+		else
+			r=KErrNotFound;
+
+		if (r==KErrNone)
+			{
+			NKern::FMWait(&iMutex); 		// Acquire the buffer/request list mutex.
+			// Release it from the 'in-use list into the 'free' list.
+			r=bufManager->ReleaseImage(chunkOffset);
+			if (r>0)
+				{
+				// The buffer needs to be queued straight away - so signal this to the PDD
+				TLinAddr linAddr=(bufManager->iChunkBase)+(bufManager->iNextBuffer->iChunkOffset);
+				TPhysAddr physAddr=bufManager->iNextBuffer->iPhysicalAddress;
+				buf=bufManager->iNextBuffer;
+				NKern::FMSignal(&iMutex); 	// Release the buffer/request list mutex.
+				r=Pdd()->CaptureNextImage(linAddr,physAddr);
+				if (r==KErrNotReady)
+					r=KErrNone;
+				}
+			else
+				NKern::FMSignal(&iMutex); 	// Release the buffer/request list mutex.
+			}
+		}
+	else
+		r=KErrNotReady;
+	__KTRACE_CAM(Kern::Printf("<DCameraScLdd::ReleaseBuffer() - r(%d)",r));
+	return(r);
+	}
+
+/**
+Called from the PDD in the DFC thread each time it finishes capturing an image frame.
+This will complete a pending capture request and update buffer lists.
+@param aCaptureMode The capture mode of the image captured. @see TDevCamCaptureMode.
+@param aResult The result of the image capture request being completed.
+@param aLinAddr	If this function returns KErrNone then on return, this holds the linear address of the start of the next buffer
+				to use for image capture.
+@param aPhysAddr If this function returns KErrNone then on return, this holds the physical address that corresponds to the
+				 linear address: aLinAddr.
+@return KErrNone if capturing should continue - with holding information on the next buffer to use for image capture.
+		KErrNotReady if capturing should continue - but with no further buffer available for image capture just yet.
+		KErrAbort if image capturing should now be terminated.
+*/
+TInt DCameraScLdd::ImageCaptureCallback(TDevCamCaptureMode /*aCaptureMode*/,TInt aResult,TLinAddr* aLinAddr,TPhysAddr* aPhysAddr)
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::ImageCaptureCallback"));
+
+	DBufferManager* bufManager=iCaptureModeConfig[iCaptureMode].iBufManager;
+	// Update the buffer list and get the next buffer for capture.
+	NKern::FMWait(&iMutex); 				// Acquire the buffer/request list mutex.
+	TImageBuffer* nextBuffer=bufManager->SetImageCaptured(aResult);	// Puts the captured image's buffer in the completed buffer queue.
+
+	// Check if there is a capture request pending.
+	if (!iRequestQueue.IsEmpty())
+		{
+		// A capture request is pending.
+		TBool removeLast=((iCaptureMode==ECamCaptureModeImage) ? (TBool) ETrue : (TBool) EFalse);
+		TImageBuffer* buf=bufManager->GetImageForClient(removeLast);	// Retrieved the captured image from the buffer in the completed buffer queue.
+		if (buf)
+			{
+			// Update the request pending list and complete the request.
+			TRequestStatus* rs=iRequestQueue.Remove();
+			TInt reason=(buf->iResult==KErrNone) ? buf->iId : buf->iResult;
+			NKern::FMSignal(&iMutex); 													// Release the buffer/request list mutex.
+			buf->SyncMemoryAfterDmaRead();
+			Kern::RequestComplete(iOwningThread,rs,reason);								// Complete the request.
+			}
+		else
+			NKern::FMSignal(&iMutex); 													// Release the buffer/request list mutex.
+		}
+	else
+		NKern::FMSignal(&iMutex); 														// Release the buffer/request list mutex.
+
+	// Now work out what instruction to give to the PDD
+	TInt r=KErrNone;
+	if (iCaptureMode==ECamCaptureModeImage)
+		{
+		// Image capture mode. If we've just completed a one shot request, see if there is yet another one pending.
+		if (!iRequestQueue.IsEmpty())
+			{
+			// Another request is pending so let the PDD carry on.
+			// If an error occured we need to first stop and re-start image capture
+			if (aResult!=KErrNone)
+				{
+				iRestartDfc.Enque();	// Queue a DFC to re-start the PDD later.
+				r=KErrAbort;
+				}
+			}
+		else
+			{
+			r=KErrAbort;	// End of image gather mode so stop the PDD.
+			}
+		}
+	else
+		{
+		// One of the free running modes. If an error occured we need to first stop and re-start image capture
+		if (aResult!=KErrNone)
+			{
+			iRestartDfc.Enque();	// Queue a DFC to re-start the PDD later.
+			r=KErrAbort;
+			}
+		}
+
+	// If capture should continue, check if there is a further buffer available to use for image capture.
+	if (r==KErrNone)
+		{
+		if (nextBuffer)
+			{
+			*aLinAddr=(bufManager->iChunkBase)+(nextBuffer->iChunkOffset);
+			*aPhysAddr=nextBuffer->iPhysicalAddress;
+			}
+		else
+			r=KErrNotReady;
+		}
+	return(r);
+	}
+
+/**
+Stores the camera configuration passed in from the user after checking and validating it.
+@param	aCaptureMode	The capture mode for which the setting of the camera configuration is made.
+@param	aCamConfigBuf	A buffer that contains the camera configuration.
+@return	KErrNone if successful
+		KErrInUse if the camera is capturing an image
+		KErrArgument if the camera configuration passed in is invalid
+		otherwise a system wide error code.
+*/
+TInt DCameraScLdd::DoSetConfig(TInt aCaptureMode, const TDesC8* aCamConfigBuf)
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::DoSetConfig(CaptureMode=%d)",aCaptureMode));
+	
+    if(iCaptureMode == aCaptureMode)
+        {
+        if (iState==ECapturing)
+            return(KErrInUse);
+        }
+
+	// Read the config structure from the client
+	TCameraConfigV02 config;
+	TPtr8 ptr((TUint8*)&config,sizeof(config));
+	TInt r=Kern::ThreadDesRead(iOwningThread,aCamConfigBuf,ptr,0);
+	if (r!=KErrNone)
+		return(r);
+
+	// Check that it is compatible with this camera device
+	r=ValidateConfig(aCaptureMode, config);
+	if (r!=KErrNone)
+		{
+		if (r == KErrNotFound)
+			r = KErrArgument;
+		return(r);
+		}
+
+	// We're about to replace any previous configuration - so set the
+	// status back to un-configured. A new buffer configuration must be calculated as a result of that.
+	//iState=EOpen;
+
+	// Save the new configuration.
+	iCaptureModeConfig[aCaptureMode].iCamConfig=config;
+	iCaptureModeConfig[aCaptureMode].iFrameHeight=iCaptureModeConfig[aCaptureMode].iCamConfig.iFrameSize.iHeight;
+	iCaptureModeConfig[aCaptureMode].iFrameWidth=iCaptureModeConfig[aCaptureMode].iCamConfig.iFrameSize.iWidth;
+
+	__KTRACE_CAM(Kern::Printf("<DCameraScLdd::DoSetConfig - %d",KErrNone));
+	return(r);
+	}
+
+/**
+Validates the configuration that is about to be used with the driver.
+@param aCaptureMode	The capture mode that the configuration is for.
+@param aConfig 		The buffer that contains the camera configuration, as passed in from the user.
+@return	KErrNotFound if the configuration is not supported by the camera sensor.
+		KErrNotSupported if the driver does not support aCaptureMode
+		KErrNone if successful.
+*/
+TInt DCameraScLdd::ValidateConfig(TInt aCaptureMode, TCameraConfigV02& aConfig)
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::ValidateConfig"));
+
+	TInt capsSize = Pdd()->CapsSize();
+	NKern::ThreadEnterCS();
+	TAny* capsBuf = Kern::Alloc(capsSize);
+	if(!capsBuf)
+		{
+		NKern::ThreadLeaveCS();
+		return KErrNoMemory;
+		}
+
+	TPtr8 capsPtr( (TUint8*)capsBuf, capsSize, capsSize );
+	Pdd()->Caps(capsPtr);
+	NKern::ThreadLeaveCS();
+
+	TCameraCapsV02* camCaps = (TCameraCapsV02*) capsPtr.Ptr();
+
+	TInt r;
+	if(aCaptureMode==ECamCaptureModeImage && camCaps->iNumImagePixelFormats)
+		{
+		r=DoValidateConfig(camCaps, aCaptureMode, aConfig);
+		}
+	else if(aCaptureMode==ECamCaptureModeVideo && camCaps->iNumVideoPixelFormats)
+		{
+		r=DoValidateConfig(camCaps, aCaptureMode, aConfig);
+		}
+	else if(aCaptureMode==ECamCaptureModeViewFinder && camCaps->iNumViewFinderPixelFormats)
+		{
+		r=DoValidateConfig(camCaps, aCaptureMode, aConfig);
+		}
+	else
+		r=KErrNotSupported;
+
+	if(r==KErrNone)
+		{
+		// Calculate the pixel width (in bytes) for the format specified
+		aConfig.iPixelWidthInBytes=aConfig.iPixelFormat.iPixelWidthInBytes;
+		}
+
+	NKern::ThreadEnterCS();
+	Kern::Free(capsBuf);
+	NKern::ThreadLeaveCS();
+
+	__KTRACE_CAM(Kern::Printf("<DCameraScLdd::ValidateConfig - %d",r));
+	return(r);
+	}
+
+/**
+Validates the configuration that is about to be used with the driver by checking it against what the camera sensor supports.
+@param aCamCaps		The buffer that contains the capabilities of the camera driver.
+@param aCaptureMode	The capture mode that the configuration is for.
+@param aConfig 		The buffer that contains the camera configuration, as passed in from the user.
+@return	KErrNotFound if the configuration is not supported by the camera sensor
+		KErrNone if successful
+		or one of the system wide error values.
+*/
+TInt DCameraScLdd::DoValidateConfig(TCameraCapsV02* aCamCaps, TInt& aCaptureMode, TCameraConfigV02& aConfig)
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::DoValidateConfig"));
+	TAny* frameSizeCapsBuf;
+	TInt frameSizeCapsSize;
+	SFrameSizeCapsInfo info;
+	SDevCamFrameSize* frameSize;
+	TUint i;
+	TUint l;
+	SDevCamPixelFormat* pixelFormat;
+	TUint start;
+	TUint end;
+	TInt r;
+	pixelFormat = (SDevCamPixelFormat*) (aCamCaps + 1);
+	if(aCaptureMode==ECamCaptureModeImage)
+		{
+		start=0;
+		end=aCamCaps->iNumImagePixelFormats;
+		}
+	else if(aCaptureMode==ECamCaptureModeVideo)
+		{
+		start=aCamCaps->iNumImagePixelFormats;
+		end=aCamCaps->iNumImagePixelFormats + aCamCaps->iNumVideoPixelFormats;
+		pixelFormat += aCamCaps->iNumImagePixelFormats;
+		}
+	else if(aCaptureMode==ECamCaptureModeViewFinder)
+		{
+		start=aCamCaps->iNumImagePixelFormats+aCamCaps->iNumVideoPixelFormats;
+		end=aCamCaps->iNumImagePixelFormats + aCamCaps->iNumVideoPixelFormats + aCamCaps->iNumViewFinderPixelFormats;
+		pixelFormat += aCamCaps->iNumImagePixelFormats;
+		pixelFormat += aCamCaps->iNumVideoPixelFormats;
+		}
+	else
+		return KErrNotSupported;
+
+	for (i=start; i<end; i++)
+		{
+		if(aConfig.iPixelFormat.iPixelFormat==pixelFormat->iPixelFormat)
+			{
+			info.iUidPixelFormat = pixelFormat->iPixelFormat;
+			info.iCaptureMode = (TDevCamCaptureMode) aCaptureMode;
+			frameSizeCapsSize = pixelFormat->iNumFrameSizes*sizeof(SDevCamFrameSize);
+			NKern::ThreadEnterCS();
+			frameSizeCapsBuf = Kern::Alloc(frameSizeCapsSize);
+			NKern::ThreadLeaveCS();
+			if (!frameSizeCapsBuf)
+				{
+				return KErrNoMemory;
+				}
+			TPtr8 frameSizeCapsPtr( (TUint8*)frameSizeCapsBuf, frameSizeCapsSize, frameSizeCapsSize );
+			if ((r = Pdd()->FrameSizeCaps(info.iCaptureMode, info.iUidPixelFormat, frameSizeCapsPtr)) == KErrNone)
+				{
+				frameSize = (SDevCamFrameSize*) frameSizeCapsPtr.Ptr();
+				for(l=0; l<pixelFormat->iNumFrameSizes; l++ )
+					{
+					if (aConfig.iFrameSize.iWidth == frameSize->iWidth &&
+						aConfig.iFrameSize.iHeight == frameSize->iHeight &&
+						aConfig.iFrameRate >= frameSize->iMinFrameRate &&
+						aConfig.iFrameRate <= frameSize->iMaxFrameRate)
+						{
+						NKern::ThreadEnterCS();
+						Kern::Free(frameSizeCapsBuf);
+						NKern::ThreadLeaveCS();
+						__KTRACE_CAM(Kern::Printf("<DCameraScLdd::DoValidateConfig"));
+						return KErrNone;
+						}
+					frameSize++;
+					}
+				NKern::ThreadEnterCS();
+				Kern::Free(frameSizeCapsBuf);
+				NKern::ThreadLeaveCS();
+				return KErrNotFound;
+				}
+			else
+				{
+				NKern::ThreadEnterCS();
+				Kern::Free(frameSizeCapsBuf);
+				NKern::ThreadLeaveCS();
+				return r;
+				}
+			}
+		pixelFormat++;
+		}
+	return KErrNotFound;
+	}
+
+/**
+The DFC used to re-start the PDD following a data capture error.
+@param aChannel A pointer to the camera driver logical channel object.
+*/
+void DCameraScLdd::RestartDfc(TAny* aChannel)
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::RestartDfc"));
+
+	DCameraScLdd& drv=*(DCameraScLdd*)aChannel;
+
+	if (!drv.iCaptureModeConfig[drv.iCaptureMode].iBufManager->iCurrentBuffer)
+		drv.iCaptureModeConfig[drv.iCaptureMode].iBufManager->iCurrentBuffer=drv.iCaptureModeConfig[drv.iCaptureMode].iBufManager->NextAvailableForCapture();
+	__ASSERT_ALWAYS(drv.iCaptureModeConfig[drv.iCaptureMode].iBufManager->iCurrentBuffer,Kern::Fault(KCameraLddPanic,__LINE__));
+
+	if (!drv.iCaptureModeConfig[drv.iCaptureMode].iBufManager->iNextBuffer)
+		drv.iCaptureModeConfig[drv.iCaptureMode].iBufManager->iNextBuffer=drv.iCaptureModeConfig[drv.iCaptureMode].iBufManager->NextAvailableForCapture();
+
+	drv.DoStart();
+	}
+
+/**
+The DFC used to handle power down requests from the power manager before a transition into system
+shutdown/standby.
+@param aChannel A pointer to the camera driver logical channel object.
+*/
+void DCameraScLdd::PowerDownDfc(TAny* aChannel)
+	{
+	DCameraScLdd& drv=*(DCameraScLdd*)aChannel;
+	drv.Shutdown();
+	drv.iPowerHandler->PowerDownDone();
+	}
+
+/**
+The DFC used to handle power up requests from the power manager following a transition out of system standby.
+@param aChannel A pointer to the camera driver logical channel object.
+*/
+void DCameraScLdd::PowerUpDfc(TAny* aChannel)
+	{
+	DCameraScLdd& drv=*(DCameraScLdd*)aChannel;
+	drv.iPowerHandler->PowerUpDone();
+	}
+
+void DCameraScLdd::PanicClientThread(TInt aReason)
+	{
+	Kern::ThreadKill(iOwningThread, EExitPanic, aReason, KDevCameraScName);
+	}
+
+/**
+Retrieves the capabilities of the camera sensor.
+@param aBuffer	A pointer to a descriptor passed in by the user.
+*/
+TInt DCameraScLdd::GetSensorCaps(TAny* aBuffer)
+	{
+	// Return the capabilities for this device. Read this from the PDD and
+	// then write it to the client
+	TInt capsSize = Pdd()->CapsSize();
+	TInt bufferSize;
+	TInt maxBufferSize;
+	Kern::KUDesInfo(*((TDes8*)aBuffer), bufferSize, maxBufferSize);
+	if(capsSize>maxBufferSize)
+		{
+		return KErrArgument;
+		}
+	NKern::ThreadEnterCS();
+	TAny* capsBuf = Kern::Alloc(capsSize);
+	if(!capsBuf)
+		{
+		NKern::ThreadLeaveCS();
+		return KErrNoMemory;
+		}
+
+	TPtr8 capsPtr( (TUint8*)capsBuf, capsSize, capsSize );
+	Pdd()->Caps(capsPtr);
+	NKern::ThreadLeaveCS();
+	Kern::InfoCopy(*((TDes8*)aBuffer), capsPtr.Ptr(), capsSize);
+	NKern::ThreadEnterCS();
+	Kern::Free((TAny*)capsBuf);
+	NKern::ThreadLeaveCS();
+	return KErrNone;
+	}
+
+/**
+Retrieves the frame sizes supported for a given pixel format.
+@param aBuffer	A pointer to descriptor passed in by the user.
+@param aFrameSizeCapsInfo A structure that holds information regarding the requested capabilities.
+*/
+TInt DCameraScLdd::GetFrameSizeCaps(TAny* aBuffer, TAny* aFrameSizeCapsInfo)
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScLdd::GetFrameSizeCaps()"));
+	TInt frameSizeCapsMaxSize;
+	TInt frameSizeCapsSize;
+	Kern::KUDesInfo(*((TDes8*)aBuffer),frameSizeCapsSize,frameSizeCapsMaxSize);
+	SFrameSizeCapsInfo info;
+	kumemget((TAny*)&info,aFrameSizeCapsInfo,sizeof(info));
+	NKern::ThreadEnterCS();
+	// Allocate memory on the heap for the frame size structure.
+	TAny* frameSizeCapsBuf = Kern::Alloc(frameSizeCapsMaxSize);
+	if (!frameSizeCapsBuf)
+		{
+		NKern::ThreadLeaveCS();
+		return KErrNoMemory;
+		}
+	TPtr8 frameSizeCapsPtr( (TUint8*)frameSizeCapsBuf, frameSizeCapsMaxSize, frameSizeCapsMaxSize );
+	// Request the frame sizes from the Pdd.
+	TInt r=Pdd()->FrameSizeCaps(info.iCaptureMode, info.iUidPixelFormat, frameSizeCapsPtr);
+	NKern::ThreadLeaveCS();
+	if (r!=KErrNone)
+		{
+		NKern::ThreadEnterCS();
+		Kern::Free((TAny*)frameSizeCapsBuf);
+		NKern::ThreadLeaveCS();
+		return r;
+		}
+	Kern::InfoCopy(*((TDes8*)aBuffer),frameSizeCapsPtr.Ptr(), frameSizeCapsMaxSize);
+	NKern::ThreadEnterCS();
+	Kern::Free((TAny*)frameSizeCapsBuf);
+	NKern::ThreadLeaveCS();
+	return KErrNone;
+	}
+
+
+/**
+Constructor for the buffer manager.
+*/
+DBufferManager::DBufferManager(DCameraScLdd* aLdd)
+	: iLdd(aLdd)
+	{
+//	iChunk=NULL;
+//	iNumBuffers=0;
+//	iImageBuffer=NULL;
+	}
+
+/**
+Destructor for the buffer manager.
+@pre The thread must be in a critical section.
+*/
+DBufferManager::~DBufferManager()
+	{
+	if (iChunk)
+		Kern::ChunkClose(iChunk);
+	delete[] iImageBuffer;
+	}
+
+/**
+Second stage constructor for the buffer manager. This version creates a shared chunk and a buffer object for each
+buffer specified within this. Then it commits memory within the chunk for each of these buffers. This also involves the
+creation of a set of buffer lists to manage the buffers.
+@param aNumBuffers The number of buffers required in the shared chunk.
+@param aBufferSize The size of each buffer required in the shared chunk.
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+@pre The thread must be in a critical section.
+*/
+TInt DBufferManager::Create(TInt aNumBuffers,TInt aBufferSize)
+	{
+	__KTRACE_CAM(Kern::Printf(">DBufferManager::Create(Bufs-%d,Sz-%d)",aNumBuffers,aBufferSize));
+
+	TInt r=CreateBufferLists(aNumBuffers);
+	if (r!=KErrNone)
+		return(r);
+
+	// Calculate the size of the chunk required for the buffer configuration specified.
+	aBufferSize=Kern::RoundToPageSize(aBufferSize);
+	TInt pageSize=Kern::RoundToPageSize(1);
+	// Leave space for guard pages around each buffer.  There is a guard page in between each buffer but
+	// NO guard page before the first buffer or after the last buffer
+	TUint64 chunkSize=TUint64(aBufferSize+pageSize)*aNumBuffers-pageSize;
+	if (chunkSize>(TUint64)KMaxTInt)
+		return(KErrNoMemory); // Need more than 2GB of memory!
+
+	// Create the shared chunk. The PDD supplies most of the chunk create info - but not the maximum size.
+	TChunkCreateInfo info;
+	info.iMaxSize=(TInt)chunkSize;
+	iLdd->Pdd()->GetChunkCreateInfo(info);		// Call down to the PDD for the rest.
+
+	r = Kern::ChunkCreate(info,iChunk,iChunkBase,iChunkMapAttr);
+	if (r!=KErrNone)
+		return(r);
+
+	// Commit memory in the chunk for each buffer.
+	TInt offset=0;
+	TBool isContiguous;
+	for (TInt i=0; i<aNumBuffers ; i++)
+		{
+		r=CommitMemoryForBuffer(offset,aBufferSize,isContiguous);
+		if (r!=KErrNone)
+			return(r);
+		r=iImageBuffer[i].Create(iChunk,offset,aBufferSize,i,isContiguous);
+		iImageBuffer[i].iId=i;
+		if (r!=KErrNone)
+			return(r);
+		offset += (aBufferSize+pageSize);
+		}
+
+	return(KErrNone);
+	}
+
+/**
+Second stage constructor for the buffer manager. This version opens an existing shared chunk using a client supplied
+handle. It then creates a buffer object for each buffer that exists within the chunk as well as creating a set of buffer
+lists to manage the buffers.
+@param aBufConfig The shared chunk buffer configuration object - specifying the geometry of the buffer configuration
+within the shared chunk supplied.
+@param aChunkHandle A handle for the shared chunk supplied by the client.
+@param anOwningThread The thread in which the given handle is valid.
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+@pre The thread must be in a critical section.
+*/
+TInt DBufferManager::Create(TCameraSharedChunkBufConfig& aBufConfig,TInt aChunkHandle,DThread* anOwningThread)
+	{
+	__KTRACE_CAM(Kern::Printf(">DBufferManager::Create(Handle-%d)",aChunkHandle));
+
+	// Validate the buffer configuration information
+	if (!aBufConfig.iFlags&KScFlagBufOffsetListInUse)
+		return(KErrArgument);
+
+	TInt numBuffers=aBufConfig.iNumBuffers;
+	TInt r=CreateBufferLists(numBuffers);
+	if (r!=KErrNone)
+		return(r);
+
+	DChunk* chunk;
+	chunk=Kern::OpenSharedChunk(anOwningThread,aChunkHandle,ETrue);
+	if (!chunk)
+		return(KErrBadHandle);
+	iChunk=chunk;
+
+	// Read the physical address for the 1st buffer in order to determine the kernel address and the map attributes.
+	TInt bufferSizeInBytes=aBufConfig.iBufferSizeInBytes;
+
+	SBufSpecList* bufferSpec=&aBufConfig.iSpec;
+
+	TInt offset=bufferSpec[0].iBufferOffset;
+
+	TPhysAddr physAddr;
+	r=Kern::ChunkPhysicalAddress(iChunk,offset,bufferSizeInBytes,iChunkBase,iChunkMapAttr,physAddr,NULL);
+	if (r!=KErrNone)
+		return(r);
+
+	// Store the supplied buffer info. into each buffer object.
+
+	for (TInt i=0; i<numBuffers; i++)
+		{
+		offset=bufferSpec[i].iBufferOffset;
+		// Assume it isn't contiguous here - Create() will detect and do the right thing if it is contiguous.
+		r=iImageBuffer[i].Create(iChunk,offset,bufferSizeInBytes,i,EFalse);
+		iImageBuffer[i].iId=i;
+		if (r!=KErrNone)
+			return(r);
+		}
+	__KTRACE_CAM(Kern::Printf("<DBufferManager::Create - %d",KErrNone));
+	return(KErrNone);
+	}
+
+/**
+Copies the contents of the Buffer Manager's configuration into aBufConfig
+@param aBufConfig The buffer that the data is copied into.
+*/
+void DBufferManager::GetBufConfig(TCameraSharedChunkBufConfig& aBufConfig)
+	{
+	__KTRACE_CAM(Kern::Printf(">DBufferManager::GetBufConfig"));
+	TInt numBuffers=iNumBuffers;
+	if (numBuffers<=0)
+		return;
+
+	SBufSpecList* bufferSpec=&aBufConfig.iSpec;
+
+	while (numBuffers--)
+		{
+		bufferSpec[numBuffers].iBufferOffset=iImageBuffer[numBuffers].iChunkOffset;
+		bufferSpec[numBuffers].iBufferId=iImageBuffer[numBuffers].iId;
+		}
+
+	aBufConfig.iNumBuffers=iNumBuffers;
+	aBufConfig.iBufferSizeInBytes=iImageBuffer[0].iSize;	// They're all the same size - so read from the 1st one.
+	aBufConfig.iFlags|=KScFlagBufOffsetListInUse;
+	return;
+	}
+
+/**
+Allocate an array of buffer objects, - one for each buffer contained within the shared chunk.
+@param aNumBuffers The number of buffer objects required.
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+@pre The thread must be in a critical section.
+*/
+TInt DBufferManager::CreateBufferLists(TInt aNumBuffers)
+	{
+	__KTRACE_CAM(Kern::Printf(">DBufferManager::CreateBufferLists(Bufs-%d)",aNumBuffers));
+
+	// Construct the array of buffers.
+	iNumBuffers=aNumBuffers;
+	iImageBuffer=new TImageBuffer[aNumBuffers];
+	if (!iImageBuffer)
+		return(KErrNoMemory);
+	return(KErrNone);
+	}
+
+TInt DBufferManager::CommitMemoryForBuffer(TInt aChunkOffset,TInt aSize,TBool& aIsContiguous)
+	{
+	__KTRACE_CAM(Kern::Printf(">DBufferManager::CommitMemoryForBuffer(Offset-%x,Sz-%d)",aChunkOffset,aSize));
+
+	// Try for physically contiguous memory first.
+	TPhysAddr physicalAddress;
+	TInt r=Kern::ChunkCommitContiguous(iChunk,aChunkOffset,aSize,physicalAddress);
+	if (r==KErrNone)
+		{
+		aIsContiguous=ETrue;
+		return(r);
+		}
+
+	// Commit memory that isn't contiguous instead.
+	aIsContiguous=EFalse;
+	r=Kern::ChunkCommit(iChunk,aChunkOffset,aSize);
+	return(r);
+	}
+
+/**
+Reset all image buffer lists to reflect the state at the start of the image capture process.
+@pre The buffer/request queue mutex must be held.
+*/
+void DBufferManager::Reset()
+	{
+	__KTRACE_CAM(Kern::Printf(">DBufferManager::Reset"));
+
+	TImageBuffer* pBuf;
+
+	// Before reseting buffer lists, purge the cache for all cached buffers currently in use by client.
+	pBuf=(TImageBuffer*)iInUseBufferQ.First();
+	SDblQueLink* anchor=&iInUseBufferQ.iA;
+	while (pBuf!=anchor)
+		{
+		Purge(pBuf);
+		pBuf=(TImageBuffer*)pBuf->iNext;
+		}
+
+	// Start by reseting all the lists.
+	iFreeBufferQ.iA.iNext=iFreeBufferQ.iA.iPrev=&iFreeBufferQ.iA;
+	iCompletedBufferQ.iA.iNext=iCompletedBufferQ.iA.iPrev=&iCompletedBufferQ.iA;
+	iInUseBufferQ.iA.iNext=iInUseBufferQ.iA.iPrev=&iInUseBufferQ.iA;
+
+	// Set the pointers to the current and the next record buffers.
+	pBuf=iImageBuffer; 		// This is the first buffer
+	iCurrentBuffer=pBuf++;
+	iNextBuffer = pBuf++;
+
+	// Add all other buffers to the free list.
+	TImageBuffer* bufferLimit=iImageBuffer+iNumBuffers;
+	while(pBuf<bufferLimit)
+		iFreeBufferQ.Add(pBuf++);
+	}
+
+/**
+Purge the cache for a cached image buffer.
+@param aBuffer The buffer to be purged.
+*/
+void DBufferManager::Purge(TImageBuffer* aBuffer)
+	{
+	aBuffer->SyncMemoryBeforeDmaRead();
+	}
+
+/**
+Update buffer lists after an image has been captured.
+@param aResult The result of the image capture operation that has just completed.
+@return A pointer to the next image buffer for capture - or NULL if none are available.
+@pre The buffer/request queue mutex must be held.
+*/
+TImageBuffer* DBufferManager::SetImageCaptured(TInt aResult)
+	{
+	// Take a copy of the buffer with the image just captured.
+	__ASSERT_DEBUG(iCurrentBuffer,Kern::Fault(KCameraLddPanic,__LINE__));
+	TImageBuffer* cur=iCurrentBuffer;
+
+	// Make the queued buffer the current one.
+	iCurrentBuffer=iNextBuffer;
+
+	// Now we need to identify the next image buffer to queue.
+	iNextBuffer=NextAvailableForCapture();
+
+	// Now add the buffer with the image just captured to the 'completed' list.
+	if (cur)
+		{
+		cur->iResult=aResult;						// Store the result of the capture operation in the image buffer object.
+		iCompletedBufferQ.Add(cur);
+		}
+
+	__KTRACE_CAM(Kern::Printf("<DBufferManager::SetImageCaptured(buf=%08x)-%d",cur->iChunkOffset,aResult));
+	return(iNextBuffer);
+	}
+
+/**
+Remove from the buffer lists the next buffer that is available to queue for transfer.
+@return A pointer to the next image buffer for capture - or NULL if none are available.
+@pre The buffer/request queue mutex must be held.
+*/
+TImageBuffer* DBufferManager::NextAvailableForCapture()
+	{
+	// We need to identify the next image buffer to queue. Try to get one from the 'free' list.
+	TImageBuffer* buffer=(TImageBuffer*)iFreeBufferQ.GetFirst();
+#ifdef DISCARD_COMPLETED_TO_AVOID_OVERFLOW
+	// If there are none left on the 'free' list then take one from the completed list.
+	if (!buffer)
+		buffer=(TImageBuffer*)iCompletedBufferQ.GetFirst();
+#endif
+	return(buffer);
+	}
+
+/**
+Get the next image from the 'completed' capture list. If there is no error associated with the buffer,
+make it 'in use' by the client. Otherwise, return the buffer to the free list.
+@param aRemoveLast	If true, the buffer is removed from the tail of the completed capture list, otherwise
+					it is removed from the head of this list.
+@return A pointer to the next completed image buffer - or NULL if there is no buffer available.
+@pre The buffer/request queue mutex must be held.
+*/
+TImageBuffer* DBufferManager::GetImageForClient(TBool aRemoveLast)
+	{
+	__KTRACE_CAM(Kern::Printf("<DBufferManager::GetImageForClient"));
+	TImageBuffer* buffer=NULL;
+	if (!iCompletedBufferQ.IsEmpty())
+		{
+		buffer = (aRemoveLast) ? (TImageBuffer*)iCompletedBufferQ.Last() : (TImageBuffer*)iCompletedBufferQ.First();
+		buffer->Deque();
+
+		if (buffer->iResult==KErrNone)
+			iInUseBufferQ.Add(buffer);
+		else
+			iFreeBufferQ.Add(buffer);
+		}
+	return(buffer);
+	}
+
+/**
+Release (move to free list) the 'in use' image specified by the given chunk offset.
+@param aChunkOffset The chunk offset corresponding to the buffer to be freed.
+@return The freed image buffer, or NULL if no 'in use' buffer had the specified chunk offset.
+@return KErrNone if buffer moved to the free list;
+		1 if the buffer needs to be queued straight away
+		KErrArgument if no 'in use' buffer had the specified chunk offset;
+@pre The buffer/request queue mutex must be held.
+*/
+TInt DBufferManager::ReleaseImage(TInt aChunkOffset)
+	{
+	__KTRACE_CAM(Kern::Printf(">DBufferManager::ReleaseImage(chunkOffset=%08x)",aChunkOffset));
+	TInt r=KErrArgument;
+
+	// Scan 'in use' list for the image buffer
+	TImageBuffer* pBuf;
+	pBuf=(TImageBuffer*)iInUseBufferQ.First();
+	SDblQueLink* anchor=&iInUseBufferQ.iA;
+	while (pBuf!=anchor && pBuf->iChunkOffset!=aChunkOffset)
+		pBuf=(TImageBuffer*)pBuf->iNext;
+
+	if (pBuf!=anchor)
+		{
+		// Buffer found in 'in-use' list.
+		if (!iNextBuffer)
+			{
+			// We need to signal the pdd to queue this buffer straight away.
+			iNextBuffer=(TImageBuffer*)pBuf->Deque();
+			r=1;
+			}
+		else
+			{
+			// Move buffer to the free list.
+			iFreeBufferQ.Add(pBuf->Deque());
+			r=KErrNone;
+			}
+		}
+
+	__KTRACE_CAM(Kern::Printf("<DBufferManager::ReleaseImage(buf=%08x)",((pBuf!=anchor) ? pBuf->iChunkOffset : -1)));
+	return(r);
+	}
+
+/**
+Find the 'in use' image specified by the given chunk offset
+@param aChunkOffset The chunk offset corresponding to the buffer to be freed
+@return The image buffer, or NULL if no 'in use' buffer had the specified chunk offset
+@pre The buffer/request queue mutex must be held.
+*/
+TImageBuffer* DBufferManager::FindInUseImage(TInt aChunkOffset)
+	{
+	// Scan 'in use' list for the image buffer
+	TImageBuffer* pBuf;
+	pBuf=(TImageBuffer*)iInUseBufferQ.First();
+	SDblQueLink* anchor=&iInUseBufferQ.iA;
+	while (pBuf!=anchor && pBuf->iChunkOffset!=aChunkOffset)
+		pBuf=(TImageBuffer*)pBuf->iNext;
+
+	return((pBuf!=anchor)?pBuf:NULL);
+	}
+
+/**
+Constructor for the image buffer class.
+Clears all member data
+*/
+TImageBuffer::TImageBuffer()
+	{
+	memclr(this,sizeof(*this));
+	}
+
+/**
+Destructor for the image buffer class.
+*/
+TImageBuffer::~TImageBuffer()
+	{
+	delete[] iPhysicalPages;
+	}
+
+/**
+Second stage constructor for the image buffer class - get information on the memory
+allocated to this buffer.
+@param aChunk	The chunk into which the memory is to be commited
+@param aOffset	The offset within aChunk for the start of the comitted memory.
+				Must be a multiple of the MMU page size.
+@param aSize	The number of bytes of memory commited.
+				Must be a multiple of the MMU page size.
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+@pre The thread must be in a critical section.
+*/
+TInt TImageBuffer::Create(DChunk* aChunk,TInt aOffset,TInt aSize, TInt aId, TBool aIsContiguous)
+	{
+	__KTRACE_CAM(Kern::Printf(">TImageBuffer::Create(Off-%x,Sz-%d,Contig-%d)",aOffset,aSize,aIsContiguous));
+
+	// Save info. on the chunk the buffer is in, and the offset and size of the buffer.
+	iChunk=aChunk;
+	iChunkOffset=aOffset;
+	iId=aId;
+	iSize=aSize;
+
+	TInt r=KErrNone;
+	iPhysicalPages=NULL;
+	if (!aIsContiguous)
+		{
+		// Allocate an array for a list of the physical pages.
+		iPhysicalPages = new TPhysAddr[aSize/Kern::RoundToPageSize(1)+2];
+		if (!iPhysicalPages)
+			r=KErrNoMemory;
+		}
+
+	if (r==KErrNone)
+		{
+		// Get the physical addresses of the pages in the buffer.
+		TUint32 mapAttr;
+		r=Kern::ChunkPhysicalAddress(aChunk,aOffset,aSize,iLinearAddress,mapAttr,iPhysicalAddress,iPhysicalPages);
+		// r = 0 or 1 on success. (1 meaning the physical pages are not contiguous).
+		if (r==1)
+			{
+			// The physical pages are not contiguous.
+			iPhysicalAddress=KPhysAddrInvalid;	// Mark the physical address as invalid.
+			r=(aIsContiguous) ? KErrGeneral : KErrNone;
+			}
+		if (r==0)
+			{
+			delete[] iPhysicalPages;	// We shouldn't retain this info. if the physical pages are contiguous.
+			iPhysicalPages=NULL;
+			}
+		}
+	__KTRACE_CAM(Kern::Printf("<TImageBuffer::Create - %d",r));
+	return(r);
+	}
+
+/**
+Prepares a cacheable buffer for use by the DMA engine, before an image capture.
+*/
+void TImageBuffer::SyncMemoryBeforeDmaRead()
+	{
+#ifndef __WINS__
+	if (iChunk->iMapAttr&EMapAttrCachedMax)
+		{
+		Cache::SyncMemoryBeforeDmaRead(iLinearAddress,iSize);
+		}
+#endif
+	}
+
+/**
+Prepare a cacheable buffer for use by the CPU, after an image capture using DMA.
+*/
+void TImageBuffer::SyncMemoryAfterDmaRead()
+	{
+#ifndef __WINS__
+	if (iChunk->iMapAttr&EMapAttrCachedMax)
+		{
+		Cache::SyncMemoryAfterDmaRead(iLinearAddress,iSize);
+		}
+#endif
+	}
+
+/**
+Constructor for the capture request queue.
+*/
+TCameraScRequestQueue::TCameraScRequestQueue(NFastMutex* aMutexPtr)
+	: iMutexPtr(aMutexPtr)
+	{
+	iOwningThread=NULL;
+	memclr(&iRequest[0],sizeof(TCameraScRequest*)*KMaxCamScRequestsPending);
+	}
+
+/**
+Destructor for the capture request queue.
+*/
+TCameraScRequestQueue::~TCameraScRequestQueue()
+	{
+	for (TInt i=0 ; i<KMaxCamScRequestsPending ; i++)
+		delete iRequest[i];
+	}
+
+/**
+Second stage constructor for the capture request queue.
+@param anOwningThread A pointer to the owning client thread.
+@return KErrNone if successful;
+		KErrNoMemory if unable to allocate memory for the capture request queue.
+@pre The thread must be in a critical section.
+*/
+TInt TCameraScRequestQueue::Create(DThread* anOwningThread)
+	{
+	iOwningThread=anOwningThread;
+
+	// Create the set of available request objects and add them to the unused request queue.
+	for (TInt i=0 ; i<KMaxCamScRequestsPending ; i++)
+		{
+		iRequest[i]=new TCameraScRequest;
+		if (!iRequest[i])
+			return(KErrNoMemory);
+		iUnusedRequestQ.Add(iRequest[i]);
+		}
+
+	return(KErrNone);
+	}
+
+/**
+Store a request status pointer onto the tail of the capture request queue.
+@param aStatus The request status pointer to be stored.
+@return KErrNone if successful;
+		KErrGeneral if the limit on the number of pending capture request (KMaxCamScRequestsPending) would be exceeded.
+@pre The buffer/request queue mutex must be held.
+*/
+TInt TCameraScRequestQueue::Add(TRequestStatus* aStatus)
+	{
+	TCameraScRequest* req=(TCameraScRequest*)iUnusedRequestQ.GetFirst();
+	if (!req)
+		return(KErrGeneral);								// Must have exceeded KMaxCamScRequestsPending
+
+	req->iStatus=aStatus;
+	iPendRequestQ.Add(req);
+	return(KErrNone);
+	}
+
+/**
+Retrieve the next request status pointer from the head of the capture request queue.
+@return The request status pointer removed or NULL if the list is empty.
+@pre The buffer/request queue mutex must be held.
+*/
+TRequestStatus* TCameraScRequestQueue::Remove()
+	{
+	TRequestStatus* status=NULL;
+	TCameraScRequest* req=(TCameraScRequest*)iPendRequestQ.GetFirst();
+	if (req)
+		{
+		status=req->iStatus;
+		iUnusedRequestQ.Add(req);
+		}
+	return(status);
+	}
+
+/**
+Remove a specifc request status pointer from the the capture request queue, completing it with a 'KErrCancel' completion reason.
+@param aStatus The request status pointer to be completed.
+@pre The buffer/request queue mutex must be held.
+*/
+void TCameraScRequestQueue::Cancel(TRequestStatus* aStatus)
+	{
+	// Find the entry concerned
+	TCameraScRequest* req=(TCameraScRequest*)iPendRequestQ.First();
+	SDblQueLink* anchor=&iPendRequestQ.iA;
+	while (req!=anchor && req->iStatus!=aStatus)
+		req=(TCameraScRequest*)req->iNext;
+	if (req==anchor)
+		return;
+
+	// Remove and cancel it.
+	req->Deque();
+	iUnusedRequestQ.Add(req);
+	NKern::FMSignal(iMutexPtr); 	// Release the request list mutex while we complete the request. This is safe.
+	Kern::RequestComplete(iOwningThread,req->iStatus,KErrCancel);
+	NKern::FMWait(iMutexPtr); 		// Re-acquire the request list mutex.
+	}
+
+/**
+Remove each request status pointer from the the capture request queue, completing each with a 'KErrCancel' completion reason.
+@pre The buffer/request queue mutex must be held.
+*/
+void TCameraScRequestQueue::CancelAll()
+	{
+
+	TRequestStatus* status;
+	while ((status=Remove())!=NULL)
+		{
+		NKern::FMSignal(iMutexPtr); 	// Release the request list mutex while we complete the request. This is safe.
+		Kern::RequestComplete(iOwningThread,status,KErrCancel);
+		NKern::FMWait(iMutexPtr); 		// Re-acquire the request list mutex.
+		}
+	}
+
+/**
+Constructor for the camera driver power handler class.
+@param aChannel A pointer to the camera driver logical channel which owns this power handler.
+*/
+DCameraScPowerHandler::DCameraScPowerHandler(DCameraScLdd* aChannel)
+:	DPowerHandler(KDevCameraScName),
+	iChannel(aChannel)
+	{
+	}
+
+/**
+A request from the power manager for the power down of the camera device.
+This is called during a transition of the phone into standby or power off.
+@param aState The target power state; can be EPwStandby or EPwOff only.
+*/
+void DCameraScPowerHandler::PowerDown(TPowerState aPowerState)
+	{
+	(void)aPowerState;
+	__KTRACE_CAM(Kern::Printf(">DCameraScPowerHandler::PowerDown(State-%d)",aPowerState));
+
+	// Power-down involves hardware access so queue a DFC to perform this from the driver thread.
+	iChannel->iPowerDownDfc.Enque();
+	}
+
+/**
+A request from the power manager for the power up of the camera device.
+This is called during a transition of the phone out of standby.
+*/
+void DCameraScPowerHandler::PowerUp()
+	{
+	__KTRACE_CAM(Kern::Printf(">DCameraScPowerHandler::PowerUp"));
+
+	// Power-up involves hardware access so queue a DFC to perform this from the driver thread.
+	iChannel->iPowerUpDfc.Enque();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/camerasc/ecamerasc.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,39 @@
+// 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:
+// e32/drivers/camerasc/ecamerasc.mmp
+// ecamerasc.ldd camera logical device driver
+// 
+//
+
+/**
+ @file
+*/
+
+#include		"../../kernel/kern_ext.mmh"
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+TARGET			ecamerasc.ldd
+TARGETTYPE		ldd
+
+SOURCE			cameraldd.cpp
+
+UID 			0 0x100000c9
+VENDORID 		0x70000001
+
+CAPABILITY		all
+
+START WINS
+win32_headers
+END
--- a/kernel/eka/drivers/debug/common/d_debug_functionality.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/debug/common/d_debug_functionality.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -22,8 +22,10 @@
 #include <e32cmn_private.h>
 #include <u32std.h>
 #include <kernel/kernel.h>
+#include <rm_debug_api.h>
 #include <sm_debug_api.h>
-
+#include "d_rmd_breakpoints.h"
+#include "rm_debug_kerneldriver.h"
 #include "d_debug_functionality.h"
 #include "d_buffer_manager.h"
 
@@ -87,9 +89,15 @@
 
 const TTag StopModeFunctionalityFunctionsInfo[] =
 	{
+#ifdef __LAUNCH_AS_EXTENSION__
 	{EStopModeFunctionsExitPoint,ETagTypePointer,0,(TUint32)&StopModeDebug::ExitPoint}, 
 	{EStopModeFunctionsGetList,ETagTypePointer,0,(TUint32)&StopModeDebug::GetList},
 	{EStopModeFunctionsTestAPI,ETagTypePointer,0,(TUint32)&StopModeDebug::TestAPI} 
+#else
+	{EStopModeFunctionsExitPoint,ETagTypePointer,0,NULL}, 
+	{EStopModeFunctionsGetList,ETagTypePointer,0,NULL},
+	{EStopModeFunctionsTestAPI,ETagTypePointer,0,NULL} 
+#endif
 	};
 
 const TSubBlock StopModeFunctionalityFunctions[]=
--- a/kernel/eka/drivers/debug/common/debug_utils.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/debug/common/debug_utils.h	Wed Sep 01 12:34:56 2010 +0100
@@ -24,6 +24,7 @@
 #define DEBUG_UTILS_H
 
 #include <kernel/kern_priv.h>
+#include <rm_debug_api.h>
 
 class DebugUtils
 	{
--- a/kernel/eka/drivers/debug/group/base_e32_drivers_debug.mrp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/debug/group/base_e32_drivers_debug.mrp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-# component name "Stop mode debugger"
+# component name "Run mode debugger"
 
 component	base_e32_drivers_debug
 
--- a/kernel/eka/drivers/debug/group/bld.inf	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/debug/group/bld.inf	Wed Sep 01 12:34:56 2010 +0100
@@ -34,8 +34,8 @@
 ../../../debug/crashMonitor/inc/crashlogwalker.h         SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(crashlogwalker.h)
 ../../../debug/crashMonitor/inc/scmconfig.h              SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(scmconfig.h)
 ../../../debug/crashMonitor/inc/scmconfigitem.h          SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(scmconfigitem.h)
-../../../debug/crashMonitor/inc/scmdatasave.h            SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(scmdatasave.h)
-../../../debug/crashMonitor/inc/scmtrace.h               SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(scmtrace.h)
+../../../debug/crashmonitor/inc/scmdatasave.h            SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(scmdatasave.h)
+../../../debug/crashmonitor/inc/scmtrace.h               SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(scmtrace.h)
 
 PRJ_MMPFILES
 
@@ -51,7 +51,10 @@
 
 #if defined(MARM_ARMV5) || defined(MARM_ARMV4)
 
-sm_debug_kerneldriver
+
+rm_debug_kerneldriver
+rm_debug_kerneldriver_ext
+../../../debug/securityServer/group/rm_debug_svr
 
 #if defined(GENERIC_MARM) 
 ../../../debug/crashMonitor/group/scmusr_lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/group/rm_debug_kerneldriver.mmh	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,53 @@
+// 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:
+//
+
+#include "../../../kernel/kern_ext.mmh"
+
+UID             0x100000AF 0x101F7157
+
+SOURCEPATH      ../common
+SOURCE          debug_utils.cpp
+SOURCE          d_debug_functionality.cpp
+
+SOURCEPATH      ../rmdebug
+SOURCE          d_list_manager.cpp
+SOURCE          rm_debug_kerneldriver.cpp
+SOURCE          rm_debug_eventhandler.cpp
+SOURCE          d_process_tracker.cpp
+SOURCE          d_target_process.cpp
+SOURCE          d_debug_agent.cpp
+SOURCE          d_rmd_breakpoints.cpp
+SOURCE          d_rmd_stepping.cpp
+SOURCE          d_driver_event_info.cpp
+
+SOURCEPATH		../smdebug
+SOURCE			d_buffer_manager.cpp
+
+systeminclude     ../../../include/drivers
+#ifdef SYMBIAN_OLD_EXPORT_LOCATION
+SYMBIAN_BASE_SYSTEMINCLUDE(memmodel/epoc/mmubase)
+SYMBIAN_BASE_SYSTEMINCLUDE(drivers)
+#endif
+
+userinclude		../common
+userinclude		../rmdebug
+userinclude		../smdebug
+
+VENDORID 0x70000001
+
+//Specified to allow global data
+EPOCALLOWDLLDATA
+
+capability			all
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/group/rm_debug_kerneldriver.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,20 @@
+// 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:
+//
+
+#include "rm_debug_kerneldriver.mmh"
+
+TARGET			rm_debug.ldd
+
+TARGETTYPE LDD
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/group/rm_debug_kerneldriver_ext.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,32 @@
+// 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:
+//
+
+macro __LAUNCH_AS_EXTENSION__
+
+#include "rm_debug_kerneldriver.mmh"
+
+SOURCEPATH		../smdebug
+SOURCE 			d_stopmode.cpp
+SOURCE			d_sm_codeseg.cpp
+SOURCE			d_sm_process.cpp
+SOURCE          d_sm_staticinfo.cpp
+
+TARGET			rm_debug_ext.ldd
+
+TARGETTYPE KEXT
+
+deffile ../../../~/rm_debug_ext.def
+
+linkas rm_debug.ldd
--- a/kernel/eka/drivers/debug/group/sm_debug_kerneldriver.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-// 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 "../../../kernel/kern_ext.mmh"
-
-UID             0x100000AF 0x101F7157
-
-userinclude		../common
-userinclude		../smdebug
-
-SOURCEPATH      ../common
-SOURCE          debug_utils.cpp
-SOURCE          d_debug_functionality.cpp
-
-SOURCEPATH		../smdebug
-SOURCE          sm_debug_kerneldriver.cpp
-SOURCE			d_buffer_manager.cpp
-SOURCE			d_sm_codeseg.cpp
-SOURCE			d_sm_process.cpp
-SOURCE          d_sm_staticinfo.cpp 
-SOURCE 			d_stopmode.cpp
-
-
-TARGET			sm_debug.dll
-
-TARGETTYPE KEXT
-
-systeminclude     ../../../include/drivers
-#ifdef SYMBIAN_OLD_EXPORT_LOCATION
-SYMBIAN_BASE_SYSTEMINCLUDE(memmodel/epoc/mmubase)
-SYMBIAN_BASE_SYSTEMINCLUDE(drivers)
-#endif
-
-
-deffile ../../../~/sm_debug.def
-
-VENDORID 0x70000001
-
-//Specified to allow global data
-EPOCALLOWDLLDATA
-
-capability			all
-
-SMPSAFE
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/rmdebug/d_debug_agent.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,420 @@
+// 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:
+// Purpose: Kernel-side tracking of debug agent information associated
+// with each process being debugged.
+// 
+//
+
+#include <e32def.h>
+#include <e32def_private.h>
+#include <e32cmn.h>
+#include <e32cmn_private.h>
+#include <kernel/kernel.h> 
+#include <kernel/kern_priv.h>
+#include <nk_trace.h>
+#include <arm.h>
+
+#include "d_process_tracker.h"
+#include "debug_logging.h"
+
+#include "d_debug_agent.h"
+#include "debug_utils.h"
+
+#include "d_debug_agent.inl"
+
+using namespace Debug;
+
+// ctor
+DDebugAgent::DDebugAgent(TUint64 aId) :
+	iId(aId),
+	iRequestGetEventStatus(NULL),
+	iClientThread(0),
+	iEventQueue(KNumberOfEventsToQueue, 0),
+	iHead(0),
+	iTail(0),
+	iEventQueueLock(NULL),
+	iFreeSlots(KNumberOfEventsToQueue),
+	iIgnoringTrace(EFalse),
+	iEventBalance(0)
+	{
+	LOG_MSG2("DDebugAgent::DDebugAgent(), this=0x%x ", this);
+
+	// Initialize all the Event Actions to Ignore
+	for(TInt i=0; i<EEventsLast; i++)
+		{
+		iEventActions[i] = EActionIgnore;
+		}
+	}
+
+DDebugAgent* DDebugAgent::New(TUint64 aId)
+	{
+	LOG_MSG("DDebugAgent::New()");
+	DDebugAgent* agent = new DDebugAgent(aId);
+	if(agent == NULL)
+		{
+		return (NULL);
+		}
+	if(KErrNone != agent->Construct())
+		{
+		delete agent;
+		return (NULL);
+		}
+
+	// Use a semaphore to serialise access
+	TInt err = Kern::SemaphoreCreate(agent->iEventQueueLock, _L("RM_DebugAgentQueueLock"), 1 /* Initial count */);
+	if (err != KErrNone)
+		return NULL;
+
+	return agent;
+	}
+
+/** Standard contructor.
+ * Fills event queue with empty events
+ * @return : standard system error code
+ */
+TInt DDebugAgent::Construct()
+	{
+	// Empty the event queue
+	LOG_MSG("DDebugAgent::Construct()");
+	TDriverEventInfo emptyEvent;
+	TInt err = KErrNone;
+
+	for (TInt i=0; i<KNumberOfEventsToQueue; i++)
+		{
+		err = iEventQueue.Append(emptyEvent);
+		if (err != KErrNone)
+			{
+			LOG_MSG("Error appending blank event entry");
+			return err;
+			}
+		}
+
+	err = Kern::CreateClientDataRequest(iRequestGetEventStatus);
+	if(err != KErrNone)
+		{
+		LOG_MSG("Error creating TClientDataRequest");
+		return err;
+		}
+
+	LOG_MSG2("DDebugAgent::Construct() iRequestGetEventStatus=0x%08x", iRequestGetEventStatus);
+
+	return err;
+	}
+
+// dtor
+DDebugAgent::~DDebugAgent()
+	{
+	iEventQueue.Reset();
+
+	if (iEventQueueLock)
+		iEventQueueLock->Close(NULL);
+	
+	if(iRequestGetEventStatus)
+		Kern::DestroyClientRequest(iRequestGetEventStatus);
+	
+	}
+
+// Associate an action with a particular kernel event
+TInt DDebugAgent::SetEventAction(TEventType aEvent, TKernelEventAction aEventAction)
+	{
+	// Valid Event?
+	if (aEvent >= EEventsLast)
+		{
+		LOG_MSG2("DDebugAgent::EventAction: Bad Event number %d",aEvent);
+		return KErrArgument;
+		}
+
+	iEventActions[aEvent] = aEventAction;
+
+	return KErrNone;
+	}
+
+/** Get the aEventAction associated with aEvent
+ *
+ * @return : aEventAction (always +ve), or KErrArgument.
+ */
+TInt DDebugAgent::EventAction(TEventType aEvent)
+	{
+	// Validate the Event id
+	if (aEvent >= EEventsLast)
+		{
+		LOG_MSG2("DDebugAgent::EventAction: Bad Event number %d",aEvent);
+		return KErrArgument;
+		}
+
+	// Return the action associated with this event
+	return iEventActions[aEvent];
+	}
+
+/** Obtain the details of the latest kernel event (if it exists) and place the details in aEventInfo
+ * If there is no event in the queue for this process+agent combination, store the details
+ * so that it can be notified later when an event actually occurs.
+ * 
+ * @param aAsyncGetValueRequest - TClientDataRequest object used for pinning user memory
+ * @param aClientThread - The ThreadId of the requesting user-side process. In this case the DSS.
+ */
+void DDebugAgent::GetEvent(TClientDataRequest<TEventInfo>* aAsyncGetValueRequest, DThread* aClientThread)
+	{
+	LockEventQueue();
+
+	iRequestGetEventStatus->Reset();
+	TInt err = iRequestGetEventStatus->SetStatus( aAsyncGetValueRequest->StatusPtr() );
+	if (err != KErrNone)
+		{
+		LOG_MSG2("Error :iRequestGetEventStatus->SetStatus ret %d", err);
+		return;
+		}
+	
+	iRequestGetEventStatus->SetDestPtr( aAsyncGetValueRequest->DestPtr() );
+
+	iEventBalance++;
+	
+	LOG_MSG4("DDebugAgent::GetEvent: this=0x%08x, iRequestGetEventStatus=0x%08x, iEventBalance=%d", 
+		this, iRequestGetEventStatus, iEventBalance );
+	
+	iClientThread = aClientThread;
+	
+	if (BufferEmpty())
+		{
+		LOG_MSG2("Event buffer empty, iEventBalance=%d", iEventBalance);		
+		UnlockEventQueue();
+		return;
+		}
+
+	LOG_MSG2("Event already available at queue pos=%d", iTail);
+
+	// returning the event to the client
+	err = iEventQueue[iTail].WriteEventToClientThread(iRequestGetEventStatus,iClientThread);
+	if (err != KErrNone)
+		{
+		LOG_MSG2("Error writing event info: %d", err);
+		UnlockEventQueue();
+		return;
+		}
+
+	// signal the DSS thread
+	Kern::QueueRequestComplete(iClientThread, iRequestGetEventStatus, KErrNone);
+	iEventBalance--;
+
+	iEventQueue[iTail].Reset();
+
+	// move to the next slot
+	IncrementTailPosition();
+
+	UnlockEventQueue();
+	}
+
+/**
+ * Stop waiting for an event to occur. This means events will be placed 
+ * in the iEventQueue (by setting iEventBalance to 0) until GetEvent is called. 
+ */ 
+TInt DDebugAgent::CancelGetEvent(void)
+	{
+	LOG_MSG2("DDebugAgent::CancelGetEvent. iEventBalance=%d. > QueueRequestComplete", iEventBalance);
+	Kern::QueueRequestComplete(iClientThread, iRequestGetEventStatus, KErrCancel);
+	iEventBalance=0;
+	iClientThread = 0;
+	return KErrNone;
+	}
+
+/** Signal a kernel event to the user-side DSS when it occurs, or queue it for later
+ * if the user-side has not called GetEvent (see above).
+ * 
+ * @param aEventInfo - the details of the event to queue.
+ */
+void DDebugAgent::NotifyEvent(const TDriverEventInfo& aEventInfo)
+	{
+
+	if(aEventInfo.iEventType >= EEventsLast)
+		{
+		LOG_MSG3("DDebugAgent::NotifyEvent(),iEventType %d, this=0x%x. Ignoring since > EEventsLast", aEventInfo.iEventType, this);
+		return;
+		}
+
+	LockEventQueue();
+
+	DThread* currentThread = &Kern::CurrentThread();
+	
+	LOG_MSG5("DDebugAgent::NotifyEvent(), iEventType %d, this=0x%x currThrd=0x%08x, iEventBalance=%d",
+		aEventInfo.iEventType, this, currentThread, iEventBalance );
+	TKernelEventAction action = iEventActions[aEventInfo.iEventType];
+
+	switch (action)
+		{
+		case EActionSuspend:
+			{
+			LOG_MSG("DDebugAgent::NotifyEvent() Suspend thread");
+
+			switch(aEventInfo.iEventType)
+				{
+				case EEventsAddLibrary:
+				case EEventsRemoveLibrary:
+					currentThread = DebugUtils::OpenThreadHandle(aEventInfo.iThreadId);
+					if(currentThread)
+						{
+						currentThread->Close(NULL);
+						}
+					break;
+				default:
+					break;
+				}
+			TInt err = TheDProcessTracker.SuspendThread(currentThread, aEventInfo.FreezeOnSuspend());
+			if((err != KErrNone) && (err != KErrAlreadyExists))
+				{
+				// Is there anything we can do in the future to deal with this error having happened?
+				LOG_MSG2("DDebugAgent::NotifyEvent() Problem while suspending thread: %d", err);
+				}
+
+			// now drop through to the continue case, which typically notifies
+			// the debug agent of the event
+			}
+		case EActionContinue:
+			{
+			// Queue this event
+			QueueEvent(aEventInfo);
+
+			// Tell the user about the oldest event in the queue
+			if ( iClientThread )
+				{
+				if( iRequestGetEventStatus && (iEventBalance > 0) )
+					{
+					// Fill the event data
+					TInt err = iEventQueue[iTail].WriteEventToClientThread(iRequestGetEventStatus,iClientThread);
+					if (err != KErrNone)
+						{
+						LOG_MSG2("Error writing event info: %d", err);
+						}
+
+					// signal the debugger thread 
+					LOG_MSG4("> QueueRequestComplete iRequestGetEventStatus=0x%08x, iEventBalance=%d, iTail=%d",
+						iRequestGetEventStatus->iStatus, iEventBalance, iTail );
+					Kern::QueueRequestComplete(iClientThread, iRequestGetEventStatus, KErrNone);
+
+					iEventBalance--;
+
+					iEventQueue[iTail].Reset();
+
+					// move to the next slot
+					IncrementTailPosition();
+					}
+				else
+					{
+					if( !iRequestGetEventStatus )
+						{
+						LOG_MSG("iRequestGetEventStatus is NULL so not signalling client" );
+						}
+					else
+						{
+						LOG_MSG2("Queued event. iEventBalance=%d (unbalanced event requests vs notifications)", 
+							iEventBalance );
+						}
+					}
+				}
+			else
+				{
+				 LOG_MSG("DDebugAgent::NotifyEvent() : Not informing client since its thread is NULL");
+				}
+			break;
+			}
+		case EActionIgnore:
+		default:
+			LOG_EVENT_MSG("DDebugAgent::NotifyEvent() fallen through to default case");
+			// Ignore everything we don't understand.
+
+		}
+
+	UnlockEventQueue();
+
+	}
+
+// Used to identify which Debug Agent this DDebugAgent is associated with.
+TUint64 DDebugAgent::Id(void)
+	{
+	return iId;
+	}
+
+/**
+ * Used to add an event to the event queue for this debug agent if event 
+ * queue is not at critical level. If it is at critical and it is trace event, 
+ * we start ignoring trace events and insert a lost trace event.
+ * If the buffer cannot store an event, only insert a buffer full event.
+ * @see EEventsBufferFull
+ * @see EEventsUserTracesLost
+ * @see TDriverEventInfo
+ * @see iEventQueue
+ */
+void DDebugAgent::QueueEvent(const TDriverEventInfo& aEventInfo)
+	{
+	// Have we caught the tail?
+	if(BufferFull())
+		{
+		LOG_MSG("DDebugAgent::QueueEvent : BufferFull. Not queueing");
+		return;
+		}
+
+	// Assert if we think there is space but the slot is not marked empty
+	__NK_ASSERT_DEBUG(iEventQueue[iHead].iEventType == EEventsUnknown);
+
+	const TBool bufferAtCritical = BufferAtCriticalLevel();
+
+	if(!bufferAtCritical)
+		{
+		//reset the iIgnoringTrace flag as we are not at 
+		//critical level and can store event
+		iIgnoringTrace = EFalse; 
+		
+		// Insert the event into the ring buffer at iHead
+		iEventQueue[iHead] = aEventInfo;
+		IncrementHeadPosition();
+		}
+	else if(bufferAtCritical && BufferCanStoreEvent())
+		{
+		LOG_MSG("DDebugAgent::QueueEvent : BufferCritical");
+		if(aEventInfo.iEventType == EEventsUserTrace)
+			{
+			if(!iIgnoringTrace)
+				{
+				//if this is the first time we are ignoring trace events, 
+				//we need to issue a EEventsUserTracesLost event
+				iEventQueue[iHead].Reset();
+				iEventQueue[iHead].iEventType = EEventsUserTracesLost;
+				IncrementHeadPosition();
+
+				iIgnoringTrace = ETrue;
+				}
+			else
+				{
+				//otherwise, ignore this event
+				LOG_MSG("DDebugAgent::QueueEvent : Ignore EEventsUserTrace event");
+				}
+			}
+		else
+			{
+			// Store the event since its not a trace event
+			iEventQueue[iHead] = aEventInfo;
+			IncrementHeadPosition();
+			}
+		}
+	else
+		{
+		//At critical level and cannot store new events, so 
+		//only one space left. Store a EEventsBufferFull event
+		LOG_MSG("DDebugAgent::QueueEvent : Event Buffer Full, ignoring event");
+		iEventQueue[iHead].Reset();
+		iEventQueue[iHead].iEventType = EEventsBufferFull;
+		IncrementHeadPosition();
+		}
+	}
+
+// End of file - d_debug_agent.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/rmdebug/d_debug_agent.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,146 @@
+// 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:
+// Purpose: Kernel-side tracking of debug agent information associated
+// with each process being debugged.
+// 
+//
+
+#ifndef D_DEBUG_AGENT_H
+#define D_DEBUG_AGENT_H
+
+#include <rm_debug_api.h>
+#include "d_driver_event_info.h"
+
+/**
+* Handles events from the kernel, filters them according to the debug agent's requests, 
+* and signals these events to the user side in FIFO-style. 
+* @see TKernelEventAction
+* @see TEventInfo
+*/
+class DDebugAgent : public DBase
+{
+public:
+	static DDebugAgent* New(TUint64);
+	~DDebugAgent();
+
+	TInt SetEventAction(Debug::TEventType aEvent, Debug::TKernelEventAction aEventAction);
+	void GetEvent(TClientDataRequest<Debug::TEventInfo>* aAsyncGetValueRequest, DThread* aClientThread);
+	TInt EventAction(Debug::TEventType aEvent);
+
+	TInt CancelGetEvent(void);
+	void NotifyEvent(const TDriverEventInfo& aEventInfo);
+	TUint64 Id();
+
+protected:
+	DDebugAgent(TUint64 aId);
+	TInt Construct();
+
+private:
+	void QueueEvent(const TDriverEventInfo& aEventInfo);
+	TBool BufferEmpty() const;
+	TBool BufferFull() const;
+	TBool BufferCanStoreEvent() const;
+	TBool BufferAtCriticalLevel() const;
+	void IncrementHeadPosition(void);
+	void IncrementTailPosition(void);
+	TInt NumberOfEmptySlots() const;
+	void LockEventQueue(void);
+	void UnlockEventQueue(void);
+
+private:
+
+	TUint64	iId;
+	Debug::TKernelEventAction iEventActions[Debug::EEventsLast];
+
+	/**
+	* Object used to write events back to DSS thread
+	* @see TEventInfo
+	*/
+	TClientDataRequest<Debug::TEventInfo>* iRequestGetEventStatus;
+
+	DThread* iClientThread;
+
+	/** 
+	* Ring buffer of pending events. Access to it is controlled by 
+	* @see iEventQueueLock
+	*/
+	RArray<TDriverEventInfo> iEventQueue;
+
+	/**
+	* Ring buffer head. Points to the next empty slot in iEventQueue
+	* @see iEventQueue
+	*/
+	TInt iHead;	
+
+	/**
+	* Ring buffer tail. Points to the oldest full slot in iEventQueue
+	* @see iEventQueue 
+	*/
+	TInt iTail;
+
+	/** 
+	* Control access to event queue.
+	* @see iEventQueue
+	*/
+	DSemaphore* iEventQueueLock;
+
+	/**
+	* Keeps track of how many free slots are available in the event queue.
+	* @see iEventQueue
+	*/
+	TInt iFreeSlots;
+
+	/**
+	* Boolean to indicate if we have told the agent that we are ignoring trace events
+	* @see QueueEvent
+	*/
+	TBool iIgnoringTrace;
+	
+	/**
+	* Used to control the delivery of events to the client so that only 
+	* when more requests than deliveries have taken place can we deliver the 
+	* next event
+	* 
+	* Incremented when a request for event takes place
+	* @see GetEvent
+	* 
+	* Decremented when an event is delivered. 
+	* @see NotifyEvent
+	* 
+	* Cleared when event requests are cancelled
+	* @see CancelGetEvent
+	* 
+	*/
+	TInt   iEventBalance;
+
+	/**
+	* Length of kernel-event queue.
+	* This is a power of two for efficiency when using the 
+	* remainder operator
+	* @see DDebugAgent::iEventQueue
+	*/
+	static const TUint KNumberOfEventsToQueue = 128;
+
+	/**
+	* This determines the number of events at which we stop accepting 
+	* low priority events into the event queue.
+	* @see DDebugAgent::BufferAtCriticalLevel
+	* @see DDebugAgent::iEventQueue
+	*/
+	static const TUint KCriticalBufferSize = 64;
+
+};
+
+#endif // D_DEBUG_AGENT_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/rmdebug/d_debug_agent.inl	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,106 @@
+// 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 for debug agent class
+//
+
+
+/**
+ @file
+ @internalComponent
+ @released
+*/
+
+#ifndef D_DEBUG_AGENT_INL
+#define D_DEBUG_AGENT_INL
+
+
+/**
+ Checks whether the event queue is empty
+*/
+inline TBool DDebugAgent::BufferEmpty() const
+	{
+	return (NumberOfEmptySlots() == KNumberOfEventsToQueue);
+	}
+
+/**
+ Checks whether the event queue is full
+*/
+inline TBool DDebugAgent::BufferFull() const
+	{
+	return (NumberOfEmptySlots() == 0);
+	}
+
+/**
+ Checks whether there is room in the event queue to store an event
+*/
+inline TBool DDebugAgent::BufferCanStoreEvent() const
+	{
+	return (NumberOfEmptySlots() > 0);
+	}
+
+/**
+ This looks to see if the buffer is close to being full and should only
+ accept higher priority debug events (user trace is the only low priority event) 
+*/
+inline TBool DDebugAgent::BufferAtCriticalLevel() const
+	{
+	return (NumberOfEmptySlots() < KNumberOfEventsToQueue - KCriticalBufferSize);
+	}
+
+/**
+ Increments Head position, wrapping at KNumberOfEventsToQueue if necessary
+*/
+inline void DDebugAgent::IncrementHeadPosition(void)
+	{
+	iHead = (iHead + 1) % KNumberOfEventsToQueue;
+
+	iFreeSlots--;
+	}
+
+/**
+ Increments Tail position, wrapping at KNumberOfEventsToQueue if necessary
+*/
+inline void DDebugAgent::IncrementTailPosition(void)
+	{
+	iTail = (iTail + 1) % KNumberOfEventsToQueue;
+
+	iFreeSlots++;
+}
+
+/**
+ Returns the number of free slots in the event queue
+*/
+inline TInt DDebugAgent::NumberOfEmptySlots() const
+	{
+	return iFreeSlots;
+	}
+
+/**
+ Lock access to this agent's event queue
+*/
+inline void DDebugAgent::LockEventQueue(void)
+	{
+	Kern::SemaphoreWait(*iEventQueueLock);
+	}
+
+/**
+ Release the lock on this agent's event queue
+*/
+inline void DDebugAgent::UnlockEventQueue(void)
+	{
+	Kern::SemaphoreSignal(*iEventQueueLock);
+	}
+
+
+#endif	// D_DEBUG_AGENT_INL
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/rmdebug/d_driver_event_info.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,337 @@
+// 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 "d_driver_event_info.h"
+#include <kernel/kernel.h>
+#include <kernel/kern_priv.h>
+
+using namespace Debug;
+
+TDriverEventInfo::TDriverEventInfo()
+	{
+	Reset();
+	}
+
+void TDriverEventInfo::Reset()
+	{
+	iProcessId = 0;
+	iThreadId = 0;
+	iCurrentPC = 0;
+	iExceptionNumber = 0;
+	iFileName.FillZ();
+	iPanicCategory.FillZ();
+	iCodeAddress = 0;
+	iDataAddress = 0;
+	iThreadIdValid = (TUint8)EFalse;
+	iProcessIdValid = (TUint8)EFalse;
+	iEventType = EEventsUnknown;
+	iUidsValid = (TUint8)EFalse;
+	};
+
+/**
+  Copy the data from this object into the object pointed to by aEventInfo in
+  the client thread aClientThread. It is assumed that the write is performed
+  on behalf of aClientThread.
+
+  @param aClientThread client thread to write the data to
+  @param aEventInfo TEventInfo object in the client thread to populate with data
+  @param aAsyncGetValueRequest TClientDataRequest object used for pinning user memory
+
+  @return KErrNone on success, or one of the other system wide error codes
+  */
+TInt TDriverEventInfo::WriteEventToClientThread(TClientDataRequest<TEventInfo>* aAsyncGetValueRequest, DThread* aClientThread) const
+	{
+	// create a temporary TEventInfo to populate with the relevant data
+	TEventInfo eventInfo;
+	TInt err = KErrNone;	
+	
+	// populate the data that is common to all events
+	err = PopulateCommonEventInfo(eventInfo);
+
+	if(KErrNone != err)
+		{
+		return err;
+		}
+	
+	// populate the event specific data (means filling in the correct union member)
+	err = PopulateEventSpecificInfo(eventInfo);
+
+	// write the data to the client and return any error
+	if(KErrNone == err)
+		{
+		aAsyncGetValueRequest->Data() = eventInfo;
+		}
+	
+	return err;
+	}
+	
+/**
+  Write the common event values into aEventInfo
+
+  @param aEventInfo TEventInfo object to write data into
+  */
+TInt TDriverEventInfo::PopulateCommonEventInfo(TEventInfo& aEventInfo) const
+	{
+	aEventInfo.iEventType = iEventType;
+	aEventInfo.iProcessId = iProcessId;
+	aEventInfo.iProcessIdValid = iProcessIdValid;
+	aEventInfo.iThreadId = iThreadId;
+	aEventInfo.iThreadIdValid = iThreadIdValid;
+	
+	return KErrNone;
+	}
+
+/**
+  Write the event specific values into aEventInfo
+
+  @param aEventInfo TEventInfo object to write data into
+  */
+TInt TDriverEventInfo::PopulateEventSpecificInfo(TEventInfo& aEventInfo) const
+	{
+	TInt ret = KErrNone;
+	
+	switch(aEventInfo.iEventType)
+		{
+		case EEventsBreakPoint:
+			ret = PopulateThreadBreakPointInfo(aEventInfo);
+			return ret;
+		case EEventsProcessBreakPoint:
+			ret = PopulateThreadBreakPointInfo(aEventInfo);
+			return ret;
+		case EEventsSwExc:
+			ret = PopulateThreadSwExceptionInfo(aEventInfo);
+			return ret;
+		case EEventsHwExc:
+			ret = PopulateThreadHwExceptionInfo(aEventInfo);
+			return ret;
+		case EEventsKillThread:
+			ret = PopulateThreadKillInfo(aEventInfo);
+			return ret;
+		case EEventsAddLibrary:
+			ret = PopulateLibraryLoadedInfo(aEventInfo);
+			return ret;
+		case EEventsRemoveLibrary:
+			ret = PopulateLibraryUnloadedInfo(aEventInfo);
+			return ret;
+		case EEventsUserTrace:
+			ret = PopulateUserTraceInfo(aEventInfo);
+			return ret;
+		case EEventsStartThread:
+			ret = PopulateStartThreadInfo(aEventInfo);
+			return ret;
+		case EEventsUserTracesLost:
+			//no event specific data to be filled here
+			return KErrNone;
+		case EEventsAddProcess:
+			ret = PopulateAddProcessInfo(aEventInfo);
+			return ret;
+		case EEventsRemoveProcess:
+			ret = PopulateRemoveProcessInfo(aEventInfo);
+			return ret;
+		}
+	
+	return KErrArgument;
+	}
+
+/**
+  Write the event specific values for a break point event into TEventInfo
+
+  @param aEventInfo TEventInfo object to write data into
+  */
+TInt TDriverEventInfo::PopulateThreadBreakPointInfo(TEventInfo& aEventInfo) const
+	{
+	aEventInfo.iThreadBreakPointInfo.iExceptionNumber = (TExcType)iExceptionNumber;
+	TInt ret = PopulateRmdArmExcInfo(aEventInfo);
+	
+	return ret;
+	}
+
+/**
+  Write the event specific values for a thread exception event into TEventInfo
+
+  @param aEventInfo TEventInfo object to write data into
+  */
+TInt TDriverEventInfo::PopulateThreadSwExceptionInfo(TEventInfo& aEventInfo) const
+	{
+	aEventInfo.iThreadSwExceptionInfo.iCurrentPC = iCurrentPC;
+	aEventInfo.iThreadSwExceptionInfo.iExceptionNumber = (TExcType)iExceptionNumber;
+	
+	return KErrNone;
+	}
+
+/**
+  Write the event specific values for a thread exception event into TEventInfo
+
+  @param aEventInfo TEventInfo object to write data into
+  */
+TInt TDriverEventInfo::PopulateThreadHwExceptionInfo(TEventInfo& aEventInfo) const
+	{
+	aEventInfo.iThreadHwExceptionInfo.iExceptionNumber = (TExcType)iExceptionNumber;
+	TInt ret = PopulateRmdArmExcInfo(aEventInfo);
+	return ret;
+	}
+
+/**
+  Write the event specific values for a thread panic event into TEventInfo
+
+  @param aEventInfo TEventInfo object to write data into
+  */
+TInt TDriverEventInfo::PopulateThreadKillInfo(TEventInfo& aEventInfo) const
+	{
+	aEventInfo.iThreadKillInfo.iCurrentPC = iCurrentPC;
+	aEventInfo.iThreadKillInfo.iExitReason = iExceptionNumber;
+	aEventInfo.iThreadKillInfo.iExitType = iExitType;
+	aEventInfo.iThreadKillInfo.iPanicCategoryLength = iPanicCategory.Length();
+	TPtr8 panicCategoryPtr(&(aEventInfo.iThreadKillInfo.iPanicCategory[0]), iPanicCategory.Length());
+	panicCategoryPtr = iPanicCategory;
+	
+	return KErrNone;
+	}
+
+/**
+  Write the event specific values for a library loaded event into TEventInfo
+
+  @param aEventInfo TEventInfo object to write data into
+  */
+TInt TDriverEventInfo::PopulateStartThreadInfo(TEventInfo& aEventInfo) const
+	{
+	aEventInfo.iStartThreadInfo.iFileNameLength = iFileName.Length();
+	TPtr8 fileNamePtr(&(aEventInfo.iStartThreadInfo.iFileName[0]), iFileName.Length());
+	fileNamePtr = iFileName;
+	
+	return KErrNone;
+	}
+
+/**
+  Write the event specific values for an AddProcess event into TEventInfo
+
+  @param aEventInfo TEventInfo object to write data into
+  */
+TInt TDriverEventInfo::PopulateAddProcessInfo(TEventInfo& aEventInfo) const
+	{
+	aEventInfo.iAddProcessInfo.iFileNameLength = iFileName.Length();
+	TPtr8 fileNamePtr(&(aEventInfo.iAddProcessInfo.iFileName[0]), iFileName.Length());
+	fileNamePtr = iFileName;
+
+	const TInt uid3offset = 2;
+	aEventInfo.iAddProcessInfo.iUid3 = iUids.iUid[uid3offset].iUid;
+	aEventInfo.iAddProcessInfo.iCreatorThreadId = iCreatorThreadId;
+
+	return KErrNone;
+	}
+
+/**
+  Write the event specific values for a RemoveProcess event into TEventInfo
+
+  @param aEventInfo TEventInfo object to write data into
+  */
+TInt TDriverEventInfo::PopulateRemoveProcessInfo(TEventInfo& aEventInfo) const
+	{
+	aEventInfo.iRemoveProcessInfo.iFileNameLength = iFileName.Length();
+	TPtr8 fileNamePtr(&(aEventInfo.iRemoveProcessInfo.iFileName[0]), iFileName.Length());
+	fileNamePtr = iFileName;
+	
+	return KErrNone;
+	}
+
+/**
+  Write the event specific values for a library loaded event into TEventInfo
+
+  @param aEventInfo TEventInfo object to write data into
+  */
+TInt TDriverEventInfo::PopulateLibraryLoadedInfo(TEventInfo& aEventInfo) const
+	{
+	aEventInfo.iLibraryLoadedInfo.iCodeAddress = iCodeAddress;
+	aEventInfo.iLibraryLoadedInfo.iDataAddress = iDataAddress;
+	aEventInfo.iLibraryLoadedInfo.iFileNameLength = iFileName.Length();
+	TPtr8 fileNamePtr(&(aEventInfo.iLibraryLoadedInfo.iFileName[0]), iFileName.Length());
+	fileNamePtr = iFileName;
+	
+	return KErrNone;
+	}
+
+/**
+  Write the event specific values for a library unloaded event into TEventInfo
+
+  @param aEventInfo TEventInfo object to write data into
+  */
+TInt TDriverEventInfo::PopulateLibraryUnloadedInfo(TEventInfo& aEventInfo) const
+	{
+	aEventInfo.iLibraryUnloadedInfo.iFileNameLength = iFileName.Length();
+	TPtr8 fileNamePtr(&(aEventInfo.iLibraryUnloadedInfo.iFileName[0]), iFileName.Length());
+	fileNamePtr = iFileName;
+	
+	return KErrNone;
+	}
+
+/**
+  Write the ArmExcInfo values into TEventInfo
+
+  @param aEventInfo TEventInfo object to write data into
+  */
+TInt TDriverEventInfo::PopulateRmdArmExcInfo(TEventInfo& aEventInfo) const
+	{
+	switch(iEventType)
+		{
+		case EEventsProcessBreakPoint:
+		case EEventsBreakPoint:
+			aEventInfo.iThreadBreakPointInfo.iRmdArmExcInfo = iRmdArmExcInfo;
+			break;
+		case EEventsHwExc:
+			aEventInfo.iThreadHwExceptionInfo.iRmdArmExcInfo = iRmdArmExcInfo;
+			break;
+		}
+	
+	return KErrNone;
+	}
+
+/**
+ * Writes the user trace into TEventInfo
+ * 
+ * @param aEventInfo TEventInfo object to write data into
+ */
+TInt TDriverEventInfo::PopulateUserTraceInfo(TEventInfo& aEventInfo) const
+	{	
+	aEventInfo.iUserTraceInfo.iUserTraceLength = (TInt)iArg2;
+	
+	TPtr8 ptr(aEventInfo.iUserTraceInfo.iUserTraceText, (TInt)iArg2, TUserTraceSize );
+	ptr.Copy(iUserTraceText, (TInt)iArg2);
+		
+	return KErrNone;
+	}
+
+TBool TDriverEventInfo::FreezeOnSuspend() const
+	{
+	switch(iEventType)
+		{
+		case EEventsHwExc:
+		case EEventsBreakPoint:
+		case EEventsProcessBreakPoint:
+			return ETrue;
+		case EEventsKillThread:
+			{
+			return (iExitType == EExitPanic);
+			}
+		}
+	return EFalse;
+	}
+
+TBool TDriverEventInfo::TookException() const
+	{
+	return iExitType == EExitPanic &&
+		iExceptionNumber == ECausedException &&
+		iPanicCategory == KLitKernExec;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/rmdebug/d_driver_event_info.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,88 @@
+// 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:
+// Purpose: Kernel-side tracking of event information
+//
+//
+
+#ifndef T_DRIVER_EVENT_INFO_H
+#define T_DRIVER_EVENT_INFO_H
+
+#include <rm_debug_api.h>
+#include <kernel/kernel.h> 
+
+/**
+@file
+@internalComponent
+*/
+
+class TDriverEventInfo
+	{
+public:
+	TDriverEventInfo();
+	void Reset();
+	TInt WriteEventToClientThread(TClientDataRequest<Debug::TEventInfo>* aAsyncGetValueRequest, DThread* aClientThread) const;
+	TBool FreezeOnSuspend() const;
+
+private:
+	TInt PopulateCommonEventInfo(Debug::TEventInfo& aEventInfo) const;
+	TInt PopulateEventSpecificInfo(Debug::TEventInfo& aEventInfo) const;
+	TInt PopulateThreadBreakPointInfo(Debug::TEventInfo& aEventInfo) const;
+	TInt PopulateThreadHwExceptionInfo(Debug::TEventInfo& aEventInfo) const;
+	TInt PopulateThreadSwExceptionInfo(Debug::TEventInfo& aEventInfo) const;
+	TInt PopulateThreadKillInfo(Debug::TEventInfo& aEventInfo) const;
+	TInt PopulateLibraryLoadedInfo(Debug::TEventInfo& aEventInfo) const;
+	TInt PopulateLibraryUnloadedInfo(Debug::TEventInfo& aEventInfo) const;
+	TInt PopulateRmdArmExcInfo(Debug::TEventInfo& aEventInfo) const;
+	TInt PopulateUserTraceInfo(Debug::TEventInfo& aEventInfo) const;
+	TInt PopulateStartThreadInfo(Debug::TEventInfo& aEventInfo) const;
+	TInt PopulateAddProcessInfo(Debug::TEventInfo& aEventInfo) const;
+	TInt PopulateRemoveProcessInfo(Debug::TEventInfo& aEventInfo) const;
+	TBool TookException() const;
+
+public:
+	Debug::TEventType iEventType;
+	TUint64 iProcessId;
+	TUint64 iThreadId;
+	TUint64 iCreatorThreadId;
+	TUint32 iCurrentPC;
+	TInt iExceptionNumber;
+	TBuf8<KMaxName> iFileName;
+	TBuf8<Debug::KPanicCategoryMaxName> iPanicCategory;
+	TUint32 iCodeAddress;
+	TUint32 iDataAddress;
+	TUint8 iExitType;
+	TUint8 iThreadIdValid;
+	TUint8 iProcessIdValid;
+	TUidType iUids;
+	TUint8 iUidsValid;
+
+	//The objects that these pointers point to are not
+	//owned by the Debug::TEventInfo class so no cleanup is required
+	TAny* iArg1;	// a1
+	TAny* iArg2;	// a2
+
+	union
+	{
+		Debug::TRmdArmExcInfo iRmdArmExcInfo;
+		//To store Trace info
+		TUint8 iUserTraceText[Debug::TUserTraceSize];
+	};
+
+	//status of trace message
+	Debug::TUserTraceMessageContext iMessageStatus;
+
+	};
+
+
+#endif //T_DRIVER_EVENT_INFO_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/rmdebug/d_list_manager.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,1007 @@
+// 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:
+// Provides a class to manage the generation of lists
+// 
+//
+
+#include "d_list_manager.h"
+#include "d_process_tracker.h"
+#include "debug_utils.h"
+#include "plat_priv.h"
+#include "debug_logging.h"
+#include <arm.h>
+
+// make accessing DThread's MState more intuitive
+#define iMState iWaitLink.iSpare1
+// make accessing NThread's NState more intuitive
+#define iNState iSpare3
+
+//constants to match against a rom entry's attributes,
+//these are defined in the file server (can't be included kernel side)
+//and in the ROM tools (also inaccessible) so redefined here
+const TUint KEntryAttXIP=0x0080;
+const TUint KEntryAttDir=0x0010;
+
+using namespace Debug;
+
+/**
+  Get thread listing for the specified thread, if the thread data will not fit
+  in the buffer then an error is returned.
+
+  @param aBuffer buffer to put data in
+  @param aDataSize on return will contain size of data
+  @param aTargetThreadId thread ID to return listing for
+
+  @return KErrNone on success,
+  KErrTooBig if data won't fit in aBuffer
+  or one of the other system wide error codes on failure
+  */
+TInt TListManager::GetThreadListForThread(TDes8& aBuffer, TUint32& aDataSize, const TUint64 aTargetThreadId) const
+	{
+	LOG_MSG("TListManager::GetThreadListForThread()");
+
+	// open a handle to check whether the thread actually exists
+	DThread* thread = DebugUtils::OpenThreadHandle(aTargetThreadId);
+	if(!thread)
+		{
+		return KErrArgument;
+		}
+	DProcess* process = thread->iOwningProcess;
+	if(!process)
+		{
+		return KErrArgument;
+		}
+	TUint64 processId = process->iId;
+	thread->Close(NULL);
+
+	//request a process specific list
+	return GetThreadListForProcess(aBuffer, aDataSize, processId);
+	}
+
+TInt TListManager::GetThreadListForProcess(TDes8& aBuffer, TUint32& aDataSize, const TUint64 aTargetProcessId) const
+	{
+	LOG_MSG("TListManager::GetThreadListForProcess()");
+
+	// open a handle to check whether the process actually exists
+	DProcess* process = DebugUtils::OpenProcessHandle(aTargetProcessId);
+	if(!process)
+		{
+		return KErrArgument;
+		}
+	process->Close(NULL);
+
+	//request a process specific list
+	return GetThreadList(aBuffer, aDataSize, EFalse, aTargetProcessId);
+	}
+
+/**
+  Get global thread listing
+
+  @param aBuffer buffer to put data in
+  @param aDataSize on return will contain size of data
+
+  @return KErrNone on success,
+  KErrTooBig if data won't fit in aBuffer
+  or one of the other system wide error codes on failure
+  */
+TInt TListManager::GetGlobalThreadList(TDes8& aBuffer, TUint32& aDataSize) const
+	{
+	LOG_MSG("TListManager::GetGlobalThreadList()");
+
+	//request a global list
+	return GetThreadList(aBuffer, aDataSize, ETrue, 0);
+	}
+
+/**
+  Get thread listing, if the thread data will not fit
+  in the buffer then an error is returned.
+
+  @param aBuffer buffer to put data in
+  @param aDataSize on return will contain size of data
+  @param aGlobal whether or not the listing should be global or thread specific
+  @param aTargetProcessId process ID to return listing for, relevant only if aGlobal == ETrue
+
+  @return KErrNone on success,
+  KErrTooBig if data won't fit in aBuffer
+  or one of the other system wide error codes on failure
+  */
+TInt TListManager::GetThreadList(TDes8& aBuffer, TUint32& aDataSize, TBool aGlobal, const TUint64 aTargetProcessId) const
+	{
+
+	LOG_MSG("TListManager::GetThreadList\n");
+
+	//have to read the threads in a critical section
+	NKern::ThreadEnterCS();
+
+	//get a pointer to the kernel's thread list
+	DObjectCon *threads = Kern::Containers()[EThread];
+
+	//if can't get container then exit
+	if(threads == NULL)
+		{
+		NKern::ThreadLeaveCS();
+
+		return KErrGeneral;
+		}
+
+	//stop the thread list from changing while we are processing them
+	threads->Wait();
+
+	aDataSize = 0;
+	aBuffer.SetLength(0);
+	//iterate through the threads adding them to the buffer
+	for(TInt i=0; i<threads->Count(); i++)
+		{
+		DThread* thread = (DThread*)(*threads)[i];
+
+		//skip this thread pointer is the thread is NULL
+		if(thread)
+			{
+			NThread& nThread = thread->iNThread;
+
+			// if the thread is marked as being dead then don't return information about it in the listing
+#ifndef __SMP__
+			if((NThread::EDead != nThread.iNState) && (DThread::EDead != thread->iMState))
+#else
+ 			if((!nThread.IsDead()) && (DThread::EDead != thread->iMState))
+#endif
+				{
+				if( aGlobal || (aTargetProcessId == (TUint64)thread->iOwningProcess->iId))
+					{
+					//store the data in the buffer
+					AppendThreadData(aBuffer, aDataSize, thread);
+					}
+				}
+			}
+		}
+
+	//leave critical section
+	threads->Signal();
+	NKern::ThreadLeaveCS();
+
+	//return indication of whether the kernel's data was too big
+	return (aDataSize > aBuffer.Length()) ? KErrTooBig : KErrNone;
+	}
+
+/**
+  Helper function for writing thread data into a buffer
+
+  @pre call in a critical section
+  @pre call only on threads which have NThread state not equal to NThread::EDead
+
+  @param aBuffer buffer to put data in
+  @param aDataSize on return will contain size of data
+  @param aThread thread object to include information about
+
+  @return KErrNone on success, or one of the other system wide error codes
+*/
+void TListManager::AppendThreadData(TDes8& aBuffer, TUint32& aDataSize, DThread* aThread) const
+	{
+	//get aThread's name
+	TFileName fileName;
+	aThread->FullName(fileName);
+	TUint16 nameLength = fileName.Length();
+
+	//increase aDataSize by the size of this entry
+	aDataSize = Align4(aDataSize + (2*nameLength) + sizeof(TThreadListEntry) - sizeof(TUint16));
+	//if the data would not cause overflow then add it to the buffer
+	if(aDataSize <= aBuffer.MaxLength())
+		{
+		//Create a TThreadListEntry which references the buffer.
+		TThreadListEntry& entry = *(TThreadListEntry*)(aBuffer.Ptr()+aBuffer.Length());
+		//add data to entry
+		entry.iProcessId = (TUint64)aThread->iOwningProcess->iId;
+		entry.iThreadId = (TUint64)aThread->iId;
+		entry.iSupervisorStackBase = (TUint32)aThread->iSupervisorStack;
+		entry.iSupervisorStackBaseValid = ETrue;
+		entry.iSupervisorStackSize = aThread->iSupervisorStackSize;
+		entry.iSupervisorStackSizeValid = ETrue;
+		entry.iNameLength = nameLength;
+
+		//only ask for the supervisor stack pointer if aThread is suspended
+		entry.iSupervisorStackPtrValid = EInValid;
+		entry.iSupervisorStackPtr = 0;
+		if(TheDProcessTracker.CheckSuspended(aThread))
+			{
+			NThread& nThread = aThread->iNThread;
+
+			TArmRegSet regSet;
+			TUint32 flags;
+			NKern::ThreadGetSystemContext(&nThread, &regSet, flags);
+			entry.iSupervisorStackPtr = (TUint32)regSet.iR13;
+			//need to check that the stack pointer flag is valid
+			if(flags & (1<<EArmSp))
+				{
+				entry.iSupervisorStackPtrValid = EValid;
+				}
+			}
+
+		//copy name data into the buffer
+		TUint16* ptr = &(entry.iName[0]);
+		const TUint8* ptr8 = fileName.Ptr();
+		const TUint8* ptr8End = ptr8 + nameLength;
+		while(ptr8 < ptr8End)
+			{
+			*ptr++ = (TUint16)*ptr8++;
+			}
+ 
+		aBuffer.SetLength(aDataSize);
+		}
+	}
+
+/**
+  Get global process listing
+
+  @param aBuffer buffer to put data in
+  @param aDataSize on return will contain size of data
+
+  @return KErrNone on success,
+  KErrTooBig if data won't fit in aBuffer
+  or one of the other system wide error codes on failure
+  */
+TInt TListManager::GetProcessList(TDes8& aBuffer, TUint32& aDataSize) const
+	{
+	LOG_MSG("TListManager::GetProcessList()");
+
+	//get a pointer to the kernel's process list
+	DObjectCon* processes = Kern::Containers()[EProcess];
+
+	if(processes == NULL)
+		{
+		//if can't get container then something is seriously wrong
+		return KErrNotFound;
+		}
+
+	//have to read the processes in a critical section
+	NKern::ThreadEnterCS();
+	processes->Wait();
+
+	aDataSize = 0;
+	//iterate through the processes adding them to the buffer
+	for(TInt i=0; i<processes->Count(); i++)
+		{
+		DProcess* process = (DProcess*)(*processes)[i];
+		if(process)
+			{
+			//get process's file name length
+			DCodeSeg* codeSeg = process->iCodeSeg;
+			TUint16 fileNameLength = (codeSeg) ? (*codeSeg->iFileName).Length() : 0;
+
+			//get process's dynamic name length and name
+			TFullName fullName;
+			process->FullName(fullName);
+			TUint16 dynamicNameLength = fullName.Length();
+
+			//increase aDataSize to reflect size of entry
+			aDataSize = Align4(aDataSize + (2*fileNameLength) + (2*dynamicNameLength) + sizeof(TProcessListEntry) - sizeof(TUint16));
+			//if the data would not cause overflow then add it to the buffer
+			if(aDataSize <= aBuffer.MaxLength())
+				{
+				//Create a TProcessListEntry which references the buffer.
+				TProcessListEntry& entry = *(TProcessListEntry*)(aBuffer.Ptr() + aBuffer.Length());
+
+				//set values
+				entry.iProcessId = (TUint64)process->iId;
+				entry.iFileNameLength = fileNameLength;
+				entry.iDynamicNameLength = dynamicNameLength;
+				entry.iUid3 = process->iUids.iUid[2].iUid;
+
+				if(codeSeg)
+					{
+					//create TPtr to where the file name should be written
+					TPtr name = TPtr((TUint8*)&(entry.iNames[0]), fileNameLength*2, fileNameLength*2);
+					//copy the file name
+					TInt err = CopyAndExpandDes(*codeSeg->iFileName, name);
+					if(err != KErrNone)
+						{
+						processes->Signal();
+						NKern::ThreadLeaveCS();
+						return KErrGeneral;
+						}
+					}
+
+				//create TPtr to where the dynamic name should be written
+				TPtr name = TPtr((TUint8*)(&(entry.iNames[0]) + fileNameLength), dynamicNameLength*2, dynamicNameLength*2);
+				//copy the dynamic name
+				TInt err = CopyAndExpandDes(fullName, name);
+				if(err != KErrNone)
+					{
+					processes->Signal();
+					NKern::ThreadLeaveCS();
+					return KErrGeneral;
+					}
+
+				//set length same as aDataSize
+				aBuffer.SetLength(aDataSize);
+				}
+			}
+		}
+
+	//leave critical section
+	processes->Signal();
+	NKern::ThreadLeaveCS();
+
+	//return indication of whether the kernel's data was too big
+	return (aDataSize > aBuffer.Length()) ? KErrTooBig : KErrNone;
+	}
+
+/**
+  Copy the descriptor aSrc to aDest and converting each byte from aSrc
+  into the two-byte equivalent. For example if aSrc contains 'XYZ' then
+  aDest will be filled with 'X\0Y\0Z\0' where \0 is the null character.
+  The length of aDest is set to twice the length of aSrc.
+
+  @param aSrc source descriptor
+  @param aDest destination descriptor to copy and expand aSrc into
+
+  @return KErrNone on success,
+  KErrArgument if the max length of aDest is less than twice the length of aSrc
+  */
+TInt TListManager::CopyAndExpandDes(const TDesC& aSrc, TDes& aDest) const
+	{
+	//check bounds
+	if(aSrc.Length() * 2 > aDest.MaxLength())
+		{
+		return KErrArgument;
+		}
+
+	//get a pointer to the start of the destination descriptor
+	TUint16* destPtr = (TUint16*)aDest.Ptr();
+
+	//get pointers to the start and end of the aSrc descriptor
+	const TUint8* srcPtr = aSrc.Ptr();
+	const TUint8* srcEnd = srcPtr + aSrc.Length();
+
+	//copy the characters from aSrc into aDest, expanding to make them 16-bit characters
+	while(srcPtr < srcEnd)
+		{
+		*destPtr = (TUint16)*srcPtr;
+		destPtr++;
+		srcPtr++;
+		}
+
+	//set aDest's length to reflect the new contents
+	aDest.SetLength(2*aSrc.Length());
+	return KErrNone;
+	}
+
+/**
+  Get global code segment listing
+
+  @param aBuffer buffer to put data in
+  @param aDataSize on return will contain size of data
+
+  @return KErrNone on success,
+  KErrTooBig if data won't fit in aBuffer,
+  or one of the other system wide error codes
+  */
+TInt TListManager::GetGlobalCodeSegList(TDes8& aBuffer, TUint32& aDataSize) const
+	{
+	LOG_MSG("TListManager::GetGlobalCodeSegList()");
+
+	// Acquire code seg lock mutex
+	NKern::ThreadEnterCS();
+	DMutex* codeMutex = Kern::CodeSegLock();
+	Kern::MutexWait(*codeMutex);
+
+	//get global code seg list
+	SDblQue* codeSegList = Kern::CodeSegList();
+
+	//create a memory info object for use in the loop
+	TModuleMemoryInfo memoryInfo;
+
+	//iterate through the list
+	aDataSize = 0;
+	for (SDblQueLink* codeSegPtr= codeSegList->First(); codeSegPtr!=(SDblQueLink*) (codeSegList); codeSegPtr=codeSegPtr->iNext)
+		{
+		DEpocCodeSeg* codeSeg = (DEpocCodeSeg*)_LOFF(codeSegPtr,DCodeSeg, iLink);
+		//the code seg shouldn't be null as we're in critical section, ignore if it is null
+		if(codeSeg)
+			{
+			//get the memory info
+			TInt err = codeSeg->GetMemoryInfo(memoryInfo, NULL);
+			if(err != KErrNone)
+				{
+				// Release the codeseglock mutex again
+				Kern::MutexSignal(*codeMutex);
+				NKern::ThreadLeaveCS();
+
+				//there's been an error so return it
+				return err;
+				}
+			//calculate data values
+			TFileName fileName(codeSeg->iFileName->Ptr());
+			TBool isXip = (TBool)(codeSeg->iXIP);
+
+			//get the code seg type, can ignore error as have already checked codeSeg is not NULL
+			TCodeSegType type = EUnknownCodeSegType;
+			err = GetCodeSegType(codeSeg, type);
+			if(err != KErrNone)
+				{
+				LOG_MSG("TListManager::GetGlobalCodeSegList() : code seg is NULL");
+				}
+
+			TUint32 uid3 = codeSeg->iUids.iUid[2].iUid;
+			//append data to buffer
+			err = AppendCodeSegData(aBuffer, aDataSize, memoryInfo, isXip, type, fileName, uid3);
+			if(err != KErrNone)
+				{
+				// Release the codeseglock mutex again
+				Kern::MutexSignal(*codeMutex);
+				NKern::ThreadLeaveCS();
+
+				return KErrGeneral;
+				}
+			}
+		}
+
+	// Release the codeseglock mutex again
+	Kern::MutexSignal(*codeMutex);
+	NKern::ThreadLeaveCS();
+
+	return (aDataSize > aBuffer.MaxLength()) ? KErrTooBig : KErrNone;
+	}
+
+/**
+  Get code segment list for a thread
+
+  @param aBuffer buffer to store data in
+  @param aDataSize size of kernel's data
+  @param thread ID to get listing for
+
+  @return KErrNone on success,
+  KErrTooBig if data won't fit in aBuffer,
+  or one of the other system wide error codes
+  */
+TInt TListManager::GetCodeSegListForThread(TDes8& aBuffer, TUint32& aDataSize, const TUint64 aTargetThreadId) const
+	{
+	LOG_MSG("TListManager::GetCodeSegListForThread()");
+
+	// open a handle to check whether the thread actually exists
+	DThread* thread = DebugUtils::OpenThreadHandle(aTargetThreadId);
+	if(!thread)
+		{
+		return KErrArgument;
+		}
+	DProcess* process = thread->iOwningProcess;
+	if(!process)
+		{
+		return KErrArgument;
+		}
+	TUint64 processId = process->iId;
+	thread->Close(NULL);
+
+	return GetCodeSegListForProcess(aBuffer, aDataSize, processId);
+	}
+/**
+  Get code segment list for a process
+
+  @param aBuffer buffer to store data in
+  @param aDataSize size of kernel's data
+  @param process ID to get listing for
+
+  @return KErrNone on success,
+  KErrTooBig if data won't fit in aBuffer,
+  or one of the other system wide error codes
+  */
+TInt TListManager::GetCodeSegListForProcess(TDes8& aBuffer, TUint32& aDataSize, const TUint64 aTargetProcessId) const
+	{
+	LOG_MSG("TListManager::GetCodeSegListForProcess()");
+
+	//get the process
+	DProcess* process = DebugUtils::OpenProcessHandle(aTargetProcessId);
+
+	if(!process)
+		{
+		return KErrArgument;
+		}
+
+	//enter thread critical section and acquire code segment mutex
+	Kern::AccessCode();
+
+	//memory info object to use in loop
+	TModuleMemoryInfo memoryInfo;
+
+	//get code seg list
+	SDblQue queue;
+	process->TraverseCodeSegs(&queue, NULL, DCodeSeg::EMarkDebug, DProcess::ETraverseFlagAdd);
+
+	//iterate through the list
+	aDataSize = 0;
+	for(SDblQueLink* codeSegPtr= queue.First(); codeSegPtr!=(SDblQueLink*) (&queue); codeSegPtr=codeSegPtr->iNext)
+		{
+		//get the code seg
+		DEpocCodeSeg* codeSeg = (DEpocCodeSeg*)_LOFF(codeSegPtr,DCodeSeg, iTempLink);
+
+		//the code seg shouldn't be null as we're in critical section, ignore if it is null
+		if(codeSeg)
+			{
+			TInt err = codeSeg->GetMemoryInfo(memoryInfo, NULL);
+			if(err != KErrNone)
+				{
+				process->Close(NULL);
+				return err;
+				}
+
+			TFileName fileName(codeSeg->iFileName->Ptr());
+			TBool isXip = (TBool)(codeSeg->iXIP);
+
+			//get the code seg type, can ignore error as have already checked codeSeg is not NULL
+			TCodeSegType type = EUnknownCodeSegType;
+			err = GetCodeSegType(codeSeg, type);
+			if(err != KErrNone)
+				{
+				LOG_MSG("TListManager::GetCodeSegListForProcess() : code seg is NULL");
+				}
+
+			TUint32 uid3 = codeSeg->iUids.iUid[2].iUid;
+			//append data to buffer
+			err = AppendCodeSegData(aBuffer, aDataSize, memoryInfo, isXip, type, fileName, uid3);
+			if(err != KErrNone)
+				{
+				process->Close(NULL);
+				return KErrGeneral;
+				}
+			}
+		}
+
+	//un mark the code segs that we've iterated over
+	DCodeSeg::EmptyQueue(queue, DCodeSeg::EMarkDebug);
+
+	//release mutex and leave CS
+	Kern::EndAccessCode();
+
+	process->Close(NULL);
+	return (aDataSize > aBuffer.MaxLength()) ? KErrTooBig : KErrNone;
+	}
+
+/**
+  Appends data to a specified buffer and puts the resulting size in aDataSize.
+  If the data won't fit then aDataSize is updated to reflect what the new length
+  would be.
+
+  @param aBuffer buffer to append data to
+  @param aDataSize will contain buffer size (or the size the buffer would be) on return
+  @param aMemoryInfo info to append to buffer
+  @param aIsXip boolean indicating whether the code segment is XIP
+  @param aFileName file name to append to buffer
+
+  @return KErrNone on success, or one of the other system wide error codes
+  */
+TInt TListManager::AppendCodeSegData(TDes8& aBuffer, TUint32& aDataSize, const TModuleMemoryInfo& aMemoryInfo, const TBool aIsXip, const TCodeSegType aCodeSegType, const TDesC8& aFileName, const TUint32 aUid3) const
+	{
+	//get some data elements to put in buffer
+	TUint16 fileNameLength = aFileName.Length();
+
+	//calculate the resultant size
+	aDataSize = Align4(aDataSize + sizeof(TCodeSegListEntry) + (2*fileNameLength) - sizeof(TUint16));
+	if(aDataSize <= aBuffer.MaxLength())
+		{
+		//Create a TCodeSegListEntry which references the buffer.
+		TCodeSegListEntry& entry = *(TCodeSegListEntry*)(aBuffer.Ptr() + aBuffer.Length());
+		entry.iCodeBase = aMemoryInfo.iCodeBase;
+		entry.iCodeSize = aMemoryInfo.iCodeSize;
+		entry.iConstDataSize = aMemoryInfo.iConstDataSize;
+		entry.iInitialisedDataBase = aMemoryInfo.iInitialisedDataBase;
+		entry.iInitialisedDataSize = aMemoryInfo.iInitialisedDataSize;
+		entry.iUninitialisedDataSize = aMemoryInfo.iUninitialisedDataSize;
+		entry.iIsXip = aIsXip;
+		entry.iCodeSegType = aCodeSegType;
+		entry.iNameLength = fileNameLength;
+		entry.iUid3 = aUid3;
+
+		//have to convert the stored name to 16 bit unicode
+		TPtr name = TPtr((TUint8*)&(entry.iName[0]), fileNameLength*2, fileNameLength*2);
+		TInt err = CopyAndExpandDes(aFileName, name);
+		if(err != KErrNone)
+			{
+			return KErrGeneral;
+			}
+
+		//increase length
+		aBuffer.SetLength(aDataSize);
+		}
+
+	return KErrNone;
+	}
+
+/**
+  Get global XIP libraries list. The ROM file system is searched for files in
+  z:\sys\bin. The files are filtered to only include library files which
+  correspond to the correct hardware variant.
+
+  In the rom, a directory is represented as a list of TRomEntrys, corresponding to
+  the files and directories in that directory. A TRomEntry corresponding to a file
+  contains a pointer to that file's location in the rom. If the TRomEntry
+  corresponds to a directory then it contains a pointer to that directory in the
+  ROM header. As such, from a pointer to the root directory of the z: drive, it is
+  possible to extract the directory contents for a particular directory (i.e. z:\sys\bin)
+  by recursively finding the subdirectories (i.e. find 'sys' in 'z:', then 'bin' in 'sys')
+  and then listing the contents of that directory.
+
+  @param aBuffer buffer to store data in
+  @param aDataSize size of kernel's data
+
+  @return KErrNone on success,
+  KErrTooBig if data won't fit in aBuffer,
+  or one of the other system wide error codes
+  */
+TInt TListManager::GetXipLibrariesList(TDes8& aBuffer, TUint32& aDataSize) const
+	{
+	LOG_MSG("TListManager::GetXipLibrariesList()");
+
+	// z:\sys\bin expressed as 16 bit unicode..
+	_LIT(KZSysBin, "z\0:\0\\\0s\0y\0s\0\\\0b\0i\0n\0\\\0");
+
+	//array to store pointers to directory entries in
+	RPointerArray<TRomEntry> entries;
+	//get the entries in KZSysBin
+	TInt err = GetDirectoryEntries(entries, KZSysBin());
+	if(KErrNone != err)
+		{
+		entries.Close();
+		return err;
+		}
+
+	aDataSize = 0;
+	for(TInt i=0; i<entries.Count(); i++)
+		{
+		//if the entry is XIP and it's not a directory then it's a candidate to add
+		if( (entries[i]->iAtt & KEntryAttXIP) && ! (entries[i]->iAtt & KEntryAttDir) )
+			{
+			//get a reference to the dll's header
+			const TRomImageHeader& header = *(const TRomImageHeader*)(entries[i]->iAddressLin);
+
+			//check that it's uid1 value corresponds to that for a library
+			if(header.iUid1 == KDynamicLibraryUidValue)
+				{
+				//get the current hardware variant
+				TSuperPage& superPage = Kern::SuperPage();
+				TUint variant = superPage.iActiveVariant;
+				TUint cpu = (variant >> 16) & 0xff;
+				TUint asic = (variant >> 24);
+
+				//check this dll is compatible with the current variant
+				if(THardwareVariant(header.iHardwareVariant).IsCompatibleWith(cpu,asic,variant))
+					{
+					const TInt fileNameLength16 = entries[i]->iNameLength;
+					const TInt fullNameLength16 = (KZSysBin().Length() / 2) + fileNameLength16;
+					aDataSize += Align4((2 * fullNameLength16) + sizeof(TXipLibraryListEntry) - sizeof(TUint16));
+
+					if(aDataSize <= aBuffer.MaxLength())
+						{
+						//Create a TXipLibraryListEntry which references the buffer.
+						TXipLibraryListEntry& libraryInfo = *(TXipLibraryListEntry*)(aBuffer.Ptr() + aBuffer.Length());
+
+						//add the data
+						libraryInfo.iCodeBase = header.iCodeAddress;
+						libraryInfo.iCodeSize = header.iTextSize;
+						libraryInfo.iConstDataSize = header.iCodeSize - header.iTextSize;
+						libraryInfo.iInitialisedDataBase = header.iDataBssLinearBase;
+						libraryInfo.iInitialisedDataSize = header.iDataSize;
+						libraryInfo.iUninitialisedDataSize = header.iBssSize;
+						libraryInfo.iNameLength = fullNameLength16;
+
+						//create a TPtr8 to contain the fully qualified name (i.e. z:\sys\bin\ prefixed)
+						TPtr8 name((TUint8*)&(libraryInfo.iName[0]), 0, 2 * fullNameLength16);
+						name.Append(KZSysBin());
+						name.Append(TPtr8((TUint8*)&(entries[i]->iName), 2 * fileNameLength16, 2 * fileNameLength16));
+
+						//increase the buffer's length to reflect the new data size
+						aBuffer.SetLength(aDataSize);
+						}
+					}
+				}
+			}
+		}
+	entries.Close();
+	return (aDataSize == aBuffer.Length()) ? KErrNone : KErrTooBig;
+	}
+
+/**
+Get the list of TRomEntry objects in the specified directory aDirectory
+
+@param aRomEntryArray array to store pointers to the TRomEntry objects in
+@param aDirectoryName directory to get contents of. The passed in string should be
+16 bit unicode and should begin with z:. Single backslashes should be used as delimiters
+rather than forward slashes and a terminating backslash is optional.
+For example: z:\sys\bin
+
+@return KErrNone on success, or one of the other system wide error codes
+*/
+TInt TListManager::GetDirectoryEntries(RPointerArray<TRomEntry>& aRomEntryArray, const TDesC& aDirectoryName) const
+	{
+	LOG_MSG("TListManager::GetDirectoryEntries()");
+
+	//definition in 16 bit unicode
+	_LIT(KForwardSlash, "/\0");
+
+	//if directory has forward slashes then exit
+	if(aDirectoryName.Find(KForwardSlash()) != KErrNotFound)
+		{
+		return KErrArgument;
+		}
+
+	//create an array to hold the folders in aDirectoryName
+	RArray<TPtr8> folders;
+
+	//split the directory up into its folders, i.e. z:\sys\bin is split into { 'z:', 'sys', 'bin' }
+	TInt err = SplitDirectoryName(aDirectoryName, folders);
+	if(KErrNone != err)
+		{
+		folders.Close();
+		return err;
+		}
+
+	if(folders.Count() == 0)
+		{
+		folders.Close();
+		//empty string passed in
+		return KErrArgument;
+		}
+
+	// z: as 16 bit unicode
+	_LIT(KZColon, "z\0:\0");
+	if(folders[0].CompareF(KZColon()) != 0)
+		{
+		//first argument must be z: otherwise not in rom
+		folders.Close();
+		return KErrArgument;
+		}
+	//remove z: from array
+	folders.Remove(0);
+	for(TInt i=0; i<folders.Count(); i++)
+		{
+		if(folders[i].Length() == 0)
+			{
+			// there were two backslashes in a row
+			folders.Close();
+			return KErrArgument;
+			}
+		}
+
+	//get a pointer to the start of the rom root directory list
+	TLinAddr romRootDirectoryList = Epoc::RomHeader().iRomRootDirectoryList;
+
+	//the first 4 bytes of the rom root directory list is a count of how many sections (rom roots) there are
+	TUint32 rootDirectoryCount = (TUint32)*(TLinAddr*)romRootDirectoryList;
+
+	//rootDirectoryPointer will be shifted through the rom root directory list and will contain pointers to the sections in the rom
+	TLinAddr rootDirectoryPointer = romRootDirectoryList;
+	for(TInt i=0; i<rootDirectoryCount; i++)
+		{
+		//the address of the section is stored in the second four bytes of the 8 byte pair reserved for each section
+		rootDirectoryPointer += 8;
+
+		//romRoot contains the address of the root of the section
+		TLinAddr romRoot = *(TLinAddr*)rootDirectoryPointer;
+
+		//append the directory entries from romRoot's z:\sys\bin subdirectory
+		TInt err = GetDirectoryEntries(aRomEntryArray, folders, romRoot);
+		if(KErrNone != err)
+			{
+			folders.Close();
+			return err;
+			}
+		}
+	folders.Close();
+	return KErrNone;
+	}
+
+/**
+  Recursively finds the subdirectories in aArray and stores references to the
+  entries in the most derived subdirectory in aRomEntryArray
+
+  @param aRomEntryArray on return will contain the entries in the directory corresponding to aArray
+  @param aArray an array containing the directory to get the entries for, i.e. { 'sys', 'bin' }
+  @param aAddress address in rom to being searching from
+
+  @param KErrNone on success, or one of the other system wide error codes
+*/
+TInt TListManager::GetDirectoryEntries(RPointerArray<TRomEntry>& aRomEntryArray, RArray<TPtr8>& aArray, TLinAddr& aAddress) const
+	{
+	LOG_MSG2("TListManager::GetDirectoryEntries() aAddress: 0x%08x", aAddress);
+
+	//find the next subdirectory and store its address in aAddress, return error if we can't find it
+	TInt err = FindDirectory(aArray[0], aAddress);
+	if(err != KErrNone)
+		{
+		return err;
+		}
+
+	//if this is the most derived sub-directory (i.e. the bin of z:\sys\bin) then get the dir contents
+	if(aArray.Count() == 1)
+		{
+		return GetDirectoryContents(aRomEntryArray, aAddress);
+		}
+	else
+		{
+		//get the next subdirectory's contents
+		aArray.Remove(0);
+		return GetDirectoryEntries(aRomEntryArray, aArray, aAddress);
+		}
+	}
+
+/**
+Return the entries of a directory in the rom
+
+@param aRomEntryArray array to store the entries in
+@param aAddress address of a directory block in the rom
+*/
+TInt TListManager::GetDirectoryContents(RPointerArray<TRomEntry>& aRomEntryArray, const TLinAddr aAddress) const
+	{
+	LOG_MSG("TListManager::GetDirectoryContents()");
+
+	TLinAddr address = aAddress;
+
+	//get the size in bytes of the block of rom to iterate over
+	const TUint32 sizeInBytes = *(TUint32*)aAddress;
+
+	//get address of first TRomEntry
+	const TLinAddr initialAddress = aAddress + sizeof(TUint32);
+
+	//get pointer to subdir count
+	address = initialAddress + sizeInBytes;
+
+	//the upper two bytes of this entry contain the number of files in this directory, and the lower two bytes
+	//contains the number of subdirectories in this directory
+	TUint32 filesAndDirectories = *(TUint32*)address;
+
+	//get number of subdirectories in this directory
+	const TUint16 subDirCount = filesAndDirectories & 0xFFFF;
+
+	//get the number of files in this dir
+	const TUint16 filesCount = filesAndDirectories >> 16;
+
+	//get total number of entries in dir
+	const TUint numDirectoryEntries = subDirCount + filesCount;
+
+	//set address to start of first entry
+	address = initialAddress;
+
+	for(TInt i=0; i<numDirectoryEntries; i++)
+		{
+		TRomEntry* romEntry = (TRomEntry*)address;
+
+		//store the entry
+		TInt err = aRomEntryArray.Append(romEntry);
+		if(KErrNone != err)
+			{
+			return err;
+			}
+
+		//length of the name of the rom entry
+		TInt nameLength = romEntry->iNameLength;
+
+		//get the size of the entry including the name
+		TUint32 romEntrySize = sizeof(TRomEntry) - sizeof(romEntry->iName) + (2 * nameLength);
+		//adjust the address to the next entry
+		address += Align4(romEntrySize);
+		}
+	return KErrNone;
+	}
+
+/**
+  Finds the subdirectory with name aDirectory in the directory at aAddress
+
+  @param aDirectory name of subdirectory to search for (i.e. 'bin')
+  @param aAddress address in rom of containing directory (i.e. address of 'sys' directory)
+
+  @param KErrNone if aDirectory could be found in aAddress, KErrNotFound if it could not be found
+  */
+TInt TListManager::FindDirectory(const TDesC& aDirectory, TLinAddr& aAddress) const
+	{
+	LOG_MSG3("TListManager::FindDirectory() aDirectory: %S, aAddress: 0x%08x", &aDirectory, aAddress);
+
+	//get the directory's contents
+	RPointerArray<TRomEntry> dirContents;
+	TInt err = GetDirectoryContents(dirContents, aAddress);
+	if(KErrNone != err)
+		{
+		dirContents.Close();
+		return err;
+		}
+	for(TInt i=0; i<dirContents.Count(); i++)
+		{
+		//create a reference to the TRomEntry in the rom to access its attributes
+		TRomEntry& romEntry = *(dirContents[i]);
+		if(romEntry.iAtt & KEntryAttDir)
+			{
+			// this entry's a directory so check if it matches aDirectory
+			const TInt nameLength = romEntry.iNameLength;
+			TPtr8 name((TUint8*)&(romEntry.iName), nameLength * 2, nameLength * 2);
+			if(0 == aDirectory.CompareF(name))
+				{
+				// names matched so get the address of this directory's contents
+				aAddress = romEntry.iAddressLin;
+				dirContents.Close();
+				return KErrNone;
+				}
+			}
+		}
+	dirContents.Close();
+	//couldn't find it so return error
+	return KErrNotFound;
+	}
+
+/**
+  Helper function to get code seg type.
+
+  @param aCodeSeg code seg to get type of
+  @param aType will contain type on return
+
+  @return KErrNone on success, KErrNotFound if aCodeSeg is NULL
+  */
+TInt TListManager::GetCodeSegType(const DCodeSeg* aCodeSeg, TCodeSegType& aType) const
+	{
+	if(!aCodeSeg)
+		{
+		return KErrNotFound;
+		}
+
+	if(aCodeSeg->IsExe())
+		{
+		aType = EExeCodeSegType;
+		return KErrNone;
+		}
+
+	if(aCodeSeg->IsDll())
+		{
+		aType = EDllCodeSegType;
+		return KErrNone;
+		}
+
+	aType = EUnknownCodeSegType;
+	return KErrNone;
+	}
+
+
+/**
+  Split a directory name into its subdirectories, using a 16-bit backslash ('\\\0') as a delimiter.
+  For example z:\sys\bin would be split into { 'z:', 'sys', 'bin' }
+
+  @param aDirectoryName directory name to split into subdirectories
+  @param aSubDirectories array to store the subdirectories in
+  */
+TInt TListManager::SplitDirectoryName(const TDesC& aDirectoryName, RArray<TPtr8>& aSubDirectories) const
+	{
+	//definition in 16 bit unicode
+	_LIT(KBackSlash, "\\\0");
+
+	//split the directory up into its folders, i.e. z:\sys\bin is split into 
+	TPtr8 string((TUint8*)aDirectoryName.Ptr(), aDirectoryName.Length(), aDirectoryName.Length());
+	while(string.Ptr() < aDirectoryName.Ptr() + aDirectoryName.Length())
+		{
+		TInt offset = string.Find(KBackSlash());
+		if(offset == KErrNotFound)
+			{
+			//reached the end of the string
+			offset = string.Length();
+			}
+		//adjustedOffset takes account of the end of the string case
+		TInt adjustedOffset = (offset == string.Length()) ? offset : offset + KBackSlash().Length();
+		//add sub-folder name
+		TInt err = aSubDirectories.Append(TPtr8((TUint8*)string.Ptr(), offset, offset));
+		if(KErrNone != err)
+			{
+			return err;
+			}
+		//remove the sub-folder name and continue
+		string.Set((TUint8*)string.Ptr() + adjustedOffset, string.Length() - adjustedOffset, string.Length() - adjustedOffset);
+		}
+	return KErrNone;
+	}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/rmdebug/d_list_manager.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,57 @@
+// 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 for the list manager
+// 
+//
+
+#ifndef T_LIST_MANAGER_H
+#define T_LIST_MANAGER_H
+
+#include <e32cmn.h>
+#include <kernel/kern_priv.h>
+#include <rm_debug_api.h>
+
+/**
+@file
+@internalComponent
+@released
+*/
+
+class TListManager
+{
+public:
+	TInt GetThreadListForThread(TDes8& aBuffer, TUint32& aDataSize, const TUint64 aTargetThreadId) const;
+	TInt GetThreadListForProcess(TDes8& aBuffer, TUint32& aDataSize, const TUint64 aTargetProcessId) const;
+	TInt GetGlobalThreadList(TDes8& aBuffer, TUint32& aDataSize) const;
+	TInt GetProcessList(TDes8& aBuffer, TUint32& aDataSize) const;
+	TInt GetCodeSegListForThread(TDes8& aBuffer, TUint32& aDataSize, const TUint64 aTargetThreadId) const;
+	TInt GetCodeSegListForProcess(TDes8& aBuffer, TUint32& aDataSize, const TUint64 aTargetProcessId) const;
+	TInt GetGlobalCodeSegList(TDes8& aBuffer, TUint32& aDataSize) const;
+	TInt GetXipLibrariesList(TDes8& aBuffer, TUint32& aDataSize) const;
+private:
+	TInt GetThreadList(TDes8& aBuffer, TUint32& aDataSize, TBool aGlobal, const TUint64 aTargetProcessId) const;
+	TInt GetDirectoryContents(RPointerArray<TRomEntry>& aRomEntryArray, const TLinAddr aAddress) const;
+	TInt GetDirectoryEntries(RPointerArray<TRomEntry>& aRomEntryArray, const TDesC& aDirectoryName) const;
+	TInt FindDirectory(const TDesC& aDirectory, TLinAddr& aAddress) const;
+	TInt GetDirectoryEntries(RPointerArray<TRomEntry>& aRomEntryArray, RArray<TPtr8>& aArray, TLinAddr& aAddress) const;
+
+	TInt AppendCodeSegData(TDes8& aBuffer, TUint32& aDataSize, const TModuleMemoryInfo& aMemoryInfo, const TBool aIsXip, const Debug::TCodeSegType aCodeSegType, const TDesC8& aFileName, const TUint32 aUid3) const;
+	void AppendThreadData(TDes8& aBuffer, TUint32& aDataSize, DThread* aThread) const;
+	TInt CopyAndExpandDes(const TDesC& aSrc, TDes& aDest) const;
+	TInt GetCodeSegType(const DCodeSeg* aCodeSeg, Debug::TCodeSegType& aType) const;
+	TInt SplitDirectoryName(const TDesC& aDirectoryName, RArray<TPtr8>& aSubDirectories) const;
+};
+
+#endif //T_LIST_MANAGER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/rmdebug/d_process_tracker.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,500 @@
+// 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:
+// Purpose: The DProcessTracker object tracks which processes are being
+// debugged. The DProcessTracker class uses a DTargetProcess object for
+// each process being debugged.
+// Note: Although TheDProcessTracker object is a global, it will be unique
+// as only the Debug Security Server can load and use rm_debug.ldd.
+// 
+//
+
+#include <e32def.h>
+#include <e32def_private.h>
+#include <e32cmn.h>
+#include <e32cmn_private.h>
+#include <kernel/kernel.h>
+#include <kernel/kern_priv.h>
+
+#include <rm_debug_api.h>
+#include "debug_logging.h"
+#include "d_process_tracker.h"
+#include "debug_utils.h"
+
+// Global Run-mode debugged process tracking object
+DProcessTracker TheDProcessTracker;
+
+// ctor
+DProcessTracker::DProcessTracker()
+	{
+	}
+
+/**
+ * dtor
+ * @internalTechnology
+ */
+DProcessTracker::~DProcessTracker()
+	{
+	// Forget about all the iProcesses
+	iProcesses.ResetAndDestroy();
+	}
+
+/**
+ * @internalTechnology
+ *
+ * Creates and stores an internal mapping of debug agent to debugged process.
+ * Note that an individual process may be mapped to a number of debug agents.
+ *
+ * @param aProcessName - The fullly qualified path of the debugged process. E.g. z:\sys\bin\hello_world.exe
+ * @param aAgentId - The process id of the debug agent which is attaching to aProcessName, as returned by RProcess.Id()
+ * @return KErrNone if there are no errors. KErrArgument if the processname is too long/short for a valid filepath.
+ *  KErrNoMemory if there is insufficient memory.
+ */
+TInt DProcessTracker::AttachProcess(const TDesC8& aProcessName,TUint64 aAgentId)
+	{
+	LOG_MSG("DProcessTracker::AttachProcess()");
+
+	// Valid ProcessName?
+	if (aProcessName.Length() < 1 || aProcessName.Length() >= KMaxPath)
+		{
+		return KErrArgument;
+		}
+
+	// Create an DTargetProcess to store
+	DTargetProcess* tmpProcess = new DTargetProcess;
+	if (tmpProcess == 0)
+		{
+		return KErrNoMemory;
+		}
+	LOG_MSG2(" AttachProcess: < new DTargetProcess=0x%08x", tmpProcess );
+	
+	// Set the name
+	TInt err = KErrNone;
+	err = tmpProcess->SetProcessName(aProcessName);
+	if (err != KErrNone)
+		{
+		LOG_MSG2(" AttachProcess: < SetProcessName returned %d", err );
+		return err;
+		}
+
+	// Is this process being debugged (ie already attached?)
+	TInt index;
+	TBool found = EFalse;
+	
+	TInt numberOfProcesses = iProcesses.Count();
+	for(index=0; index<numberOfProcesses; index++)
+		{
+		const TPtr8& tmpPtr8(iProcesses[index]->ProcessName() );
+
+		if ( tmpPtr8.CompareF(aProcessName) == 0)
+			{
+			LOG_MSG3(" Proc count=%d, found proc in iProcesses at %d. Count=%d",
+				index, iProcesses.Count() );
+			found = ETrue;
+			break;
+			}
+		}
+
+	if (found)
+		{
+		// Yes, it is being debugged
+
+		// Add the agent to the list of agents for this process
+		LOG_MSG3(" > AddAgent(agent id %d) to existing iProcesses[%d]", I64LOW(aAgentId), index ); 
+
+		iProcesses[index]->AddAgent(aAgentId);
+
+		return KErrNone;
+		}
+	else
+		{
+		// No, it is not being debugged
+			
+		// Add the agent to the list of agents for this process
+		LOG_MSG2(" > AddAgent(agent %d) to new proc at index 0", I64LOW(aAgentId) ); 
+
+		tmpProcess->AddAgent(aAgentId);
+
+		// Add the process to the list of processes being debugged
+		return iProcesses.Insert(tmpProcess,0);
+		}
+	}
+
+/**
+ * @internalTechnology
+ * 
+ * Removes a previously created mapping between a debug agent and a debugged process,
+ * as created by AttachProcess.
+ *
+ * @param aProcessName - The fully qualified path of the debugged process. E.g. z:\sys\bin\hello_world.exe
+ * @param aAgentId - The process id of the debug agent which is attaching to aProcessName, as returned by RProcess.Id()
+ * @return KErrNone if there are no problems. KErrArgument if the processname is too long/short for a valid filepath.
+ * KErrNotFound if the mapping does not exist (and therefore cannot be removed).
+ */
+TInt DProcessTracker::DetachProcess(const TDesC8& aProcessName, TUint64 aAgentId)
+	{
+	// Valid ProcessName?
+	if (aProcessName.Length() < 1 || aProcessName.Length() >= KMaxPath)
+		{
+		return KErrArgument;
+		};
+
+	// Are we debugging this process?
+	TInt i;
+	TBool found = EFalse;
+	DTargetProcess* foundProcess = 0;
+
+	TInt numberOfProcesses = iProcesses.Count();
+	for(i=0; i<numberOfProcesses; i++)
+		{
+		foundProcess = iProcesses[i];
+
+		const TPtr8& tmpPtr8( foundProcess->ProcessName() );
+
+		if ( tmpPtr8.CompareF(aProcessName) == 0)
+			{
+			found = ETrue;
+			break;
+			}
+		}
+
+	if (found == EFalse)
+		{
+		return KErrNotFound;
+		}
+
+	// remove the agent from the process
+	iProcesses[i]->RemoveAgent(aAgentId);
+
+	// Found it, are there any more attached agents, or suspended threads in the process?
+	if ((iProcesses[i]->AgentCount() == 0) && !iProcesses[i]->HasSuspendedThreads() )
+		{
+		// Delete the process as no more agents are still attached
+		delete iProcesses[i];
+
+		// Remove the now obsolete pointer from our array.
+		iProcesses.Remove(i);
+		}
+
+	return KErrNone;
+	}
+
+/**
+ * @internalTechnology
+ *
+ * Detachs a debug agent from every process being debugged. Used when a debug agent is being detached
+ * from the debug security server and has not supplied a specific process name from which to detach.
+ */
+TInt DProcessTracker::DetachAgent(const TUint64 aAgentId)
+	{
+	// Remove this agent from all the processes being tracked.
+	TInt numberOfProcesses = iProcesses.Count();
+	for(TInt i=0; i<numberOfProcesses; i++)
+		{
+		// remove the agent from the process (we don't care about the return code)
+		iProcesses[i]->RemoveAgent(aAgentId);
+		}
+
+	// Increment down through the array as we then don't have to worry about
+	// missing entries which have been shifted after deletes.
+	// The initial value of i correspnds to the index of the final element 
+	// in the array.
+	for(TInt i = iProcesses.Count()-1; i>=0; i--)
+		{
+		if (iProcesses[i]->AgentCount() == 0)
+			{
+			// No agents remain for this process. Delete the
+			// process object and remove the pointer from the array
+			delete iProcesses[i];
+			iProcesses.Remove(i);
+			}
+		}
+	return KErrNone;
+	}
+
+/**
+ * @internalTechnology
+ *
+ * Returns a pointer to a DTargetProcess object representing the mapping of a debugged process
+ * with all the relevant debug agents interested in that process, as determined
+ * by AttachProcess.
+ *
+ * @param aProcessName - The fully qualified path of the debugged process. E.g. z:\sys\bin\hello_world.exe
+ * @return DTargetProcess* pointer to an object representing the internal mapping of a process to all associated
+ * debug agents. Returns 0 if the mapping cannot be found or the aProcessName is invalid.
+ */
+DTargetProcess* DProcessTracker::FindProcess(const TDesC8& aProcessName)
+	{
+	// Valid ProcessName?
+	if (aProcessName.Length() < 1 || aProcessName.Length() >= KMaxPath)
+		{
+		return 0;	// not found
+		}
+
+	// Can we find this in the array?
+	TInt i;
+	TBool found = EFalse;
+	DTargetProcess* foundProcess = 0;
+
+	TInt numberOfProcesses = iProcesses.Count();
+	for(i=0; i<numberOfProcesses; i++)
+		{
+		foundProcess = iProcesses[i];
+
+		const TPtr8& tmpPtr8( foundProcess->ProcessName() );
+
+		if ( tmpPtr8.CompareF(aProcessName) == 0)
+			{
+			found = ETrue;
+			break;
+			}
+		}
+
+	if (found == EFalse)
+		{
+		LOG_EVENT_MSG("DProcessTracker::FindProcess, not found" );
+		return 0;	// not found
+		}
+
+	return foundProcess;
+	}
+
+/**
+ * @internalTechnology
+ *
+ * Returns a pointer to a DTargetProcess object representing the mapping of a debugged process
+ * with all the relevant debug agents interested in that process, as determined
+ * by AttachProcess.
+ *
+ * Note: This does not attempt an exact match, because the AddProcess event does not provide
+ * a fully-qualified path, it provides something like [t_rmdebug_security0.exe].
+ *
+ * So for the purposes of dealing with this event, we need a "fuzzier" match which does not use the complete
+ * path.
+ *
+ * @param aProcessName - The fully qualified path of the debugged process. E.g. z:\sys\bin\hello_world.exe
+ * @return DTargetProcess* pointer to an object representing the internal mapping of a process to all associated
+ * debug agents. Returns 0 if the mapping cannot be found or the aProcessName is invalid.
+ */
+DTargetProcess*	DProcessTracker::FuzzyFindProcess(const TDesC8& aProcessName)
+	{
+	// Valid ProcessName?
+	if (aProcessName.Length() < 1 || aProcessName.Length() >= KMaxPath)
+		{
+		return 0;	// not found
+		}
+
+	// Can we find this in the array?
+	TBool found = EFalse;
+	DTargetProcess* foundProcess = 0;
+	const TChar KBackSlash('\\');
+
+	TInt numberOfProcesses = iProcesses.Count();
+	for(TInt i=0; i < numberOfProcesses; i++)
+		{
+		foundProcess = iProcesses[i];
+
+		TInt procListBackSlash = foundProcess->ProcessName().LocateReverse( KBackSlash );
+		if( procListBackSlash == KErrNotFound )
+			{
+			procListBackSlash = 0;
+			}
+		else
+			{
+			//Now move to the char after the backlash
+			procListBackSlash++;
+			}
+
+		TInt eventBackSlash = aProcessName.LocateReverse( KBackSlash );
+		if( eventBackSlash == KErrNotFound )
+			{
+			eventBackSlash = 0;
+			}
+		else
+			{
+			//Now move to the char after the backlash
+			eventBackSlash++;
+			}
+
+		if( ( procListBackSlash == 0 ) && ( eventBackSlash == 0 ) )
+			{
+			//There were no backslashes on either name, so no point in continuing
+			break;
+			}
+
+		TPtrC8 eventCleanName( aProcessName.Mid( eventBackSlash ) );		
+		TPtrC8 procListCleanName( foundProcess->ProcessName().Mid( procListBackSlash ) );
+
+		if ( eventCleanName.CompareF( procListCleanName ) == 0 )
+			{
+			LOG_MSG2("DProcessTracker::FuzzyFindProcess() found a match : process list[%d]", i );
+			found = ETrue;
+			break;
+			}
+		}
+
+	if (found == EFalse)
+		{
+		return 0;	// not found
+		}
+
+	return foundProcess;
+	}
+
+TBool DProcessTracker::CheckSuspended(DThread* aTargetThread) const
+	{
+	//get the file name and return if NULL
+	HBuf* name = GetFileName(aTargetThread);
+	if(!name)
+		{
+		return EFalse;
+		}
+
+	//iterate through the processes trying to match the name, and check suspended if found
+	TInt numberOfProcesses = iProcesses.Count();
+	for(TInt i=0; i < numberOfProcesses; i++)
+		{
+		if(iProcesses[i]->ProcessName().CompareF(*name) == 0)
+			{
+			return iProcesses[i]->CheckSuspended(aTargetThread);
+			}
+		}
+
+	//couldn't find the process so return EFalse
+	return EFalse;
+	}
+
+TBool DProcessTracker::CheckSuspended(const TUint64 aTargetThreadId) const
+	{
+	//get a handle to the thread and return false if it's NULL
+	DThread* thread = DebugUtils::OpenThreadHandle(aTargetThreadId);
+	if(!thread)
+		{
+		return EFalse;
+		}
+
+	//check if the thread's suspended and then close the thread handle and return
+	TBool suspended = CheckSuspended(thread);
+	thread->Close(NULL);
+	return suspended;
+	}
+
+/**
+  Attempts to suspend the specified thread
+
+  @param aTargetThread thread to suspend
+
+  @return KErrNone on success, KErrAlreadyExists if the thread is already suspended,
+  or one of the other system wide error codes
+  */
+TInt DProcessTracker::SuspendThread(DThread* aTargetThread, TBool aFreezeThread)
+	{
+	LOG_MSG3("DProcessTracker::SuspendThread() Requesting suspend for: 0x%08x, freeze thread: %d", aTargetThread->iId, aFreezeThread?1:0);
+
+	//get the file name and return if NULL
+	HBuf* name = GetFileName(aTargetThread);
+	if(!name)
+		{
+		return KErrNotFound;
+		}
+
+	//iterate through the processes trying to match the name, try to suspend the thread if found
+	TInt numberOfProcesses = iProcesses.Count();
+	for(TInt i=0; i < numberOfProcesses; i++)
+		{
+		if(iProcesses[i]->ProcessName().CompareF(*name) == 0)
+			{
+			return iProcesses[i]->SuspendThread(aTargetThread, aFreezeThread);
+			}
+		}
+
+	//couldn't find process so return error
+	return KErrPermissionDenied;
+	}
+
+void DProcessTracker::FSWait()
+	{
+	TInt numberOfProcesses = iProcesses.Count();
+	for(TInt i=0; i < numberOfProcesses; i++)
+		{
+		iProcesses[i]->FSWait();
+		}
+	}
+
+/**
+  Attempts to resume the specified thread
+
+  @param aTargetThread thread to resume
+
+  @return KErrNone on success, KErrInUse if the thread is not suspended,
+  or one of the other system wide error codes
+  */
+TInt DProcessTracker::ResumeThread(DThread* aTargetThread)
+	{
+	LOG_MSG2("DProcessTracker::ResumeThread() Requesting resume for: 0x%08x", aTargetThread->iId);
+
+	//get the file name and return if NULL
+	HBuf* name = GetFileName(aTargetThread);
+	if(!name)
+		{
+		return KErrNotFound;
+		}
+
+	//iterate through the processes trying to match the name, try to resume the thread if found
+	TInt numberOfProcesses = iProcesses.Count();
+	for(TInt i=0; i < numberOfProcesses; i++)
+		{
+		if(iProcesses[i]->ProcessName().CompareF(*name) == 0)
+			{
+			return iProcesses[i]->ResumeThread(aTargetThread);
+			}
+		}
+
+	//couldn't find process so return error
+	return KErrPermissionDenied;
+	}
+
+/**
+  Get a thread's originating file name
+
+  @param aThread the thread to get the file name for
+
+  @return a pointer to the thread's file name, if there are problems accessing
+  the file name then NULL will be returned
+  */
+HBuf* DProcessTracker::GetFileName(DThread* aThread) const
+	{
+	//check if the thread is NULL and return if so
+	if(!aThread)
+		{
+		return NULL;
+		}
+
+	//get the owning process and return if it is NULL
+	DProcess* process = aThread->iOwningProcess;
+	if(!process)
+		{
+		return NULL;
+		}
+
+	//get the process' code seg and return if it is NULL
+	DCodeSeg* codeSeg = process->iCodeSeg;
+	if(!codeSeg)
+		{
+		return NULL;
+		}
+
+	//return the code seg's stored file name (which could theoretically be NULL)
+	return codeSeg->iFileName;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/rmdebug/d_process_tracker.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,68 @@
+// 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:
+// Purpose: Kernel-side tracking of process state
+// 
+//
+ 
+#ifndef D_PROCESS_TRACKER_H
+#define D_PROCESS_TRACKER_H
+
+#include "d_target_process.h"
+
+// The global class which tracks all debugged processes.
+// 
+// Note that multiple debug agents may attach to a process,
+// as the security server will ensure only one is an 'active'
+// agent, preventing conflicts. Other agents will be 'passive',
+// typically interested only in recording events.
+//
+// The above requirement generates the requirement for the class
+// to track the agent IDs, as multiple debug agents may be interested
+// in a process.
+
+class DProcessTracker : public DBase
+{
+public:
+	DProcessTracker();
+	~DProcessTracker();
+
+	TInt AttachProcess(const TDesC8& aProcessName, TUint64 aAgentId);
+
+	TInt DetachProcess(const TDesC8& aProcessName, TUint64 aAgentId);
+
+	TInt DetachAgent(TUint64 aAgentId);
+
+	DTargetProcess* FindProcess(const TDesC8& aProcessName);
+
+	DTargetProcess* FuzzyFindProcess(const TDesC8& aProcessName);
+
+	TBool CheckSuspended(const TUint64 aTargetThreadId) const;
+	TBool CheckSuspended(DThread* aTargetThread) const;
+	TInt SuspendThread(DThread* aTargetThread, TBool aFreezeThread=EFalse);
+	TInt ResumeThread(DThread* aTargetThread);
+	void FSWait();
+
+private:
+	TInt RemoveSuspendedThread(DThread* aThread);
+	TInt AddSuspendedThread(DThread* aThread);
+	HBuf* GetFileName(DThread* aThread) const;
+
+private:
+	RPointerArray<DTargetProcess> iProcesses;
+};
+
+// static global object
+extern DProcessTracker TheDProcessTracker;
+
+#endif // D_PROCESS_TRACKER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/rmdebug/d_rmd_breakpoints.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,1741 @@
+// 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"
+// 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 <e32def.h>
+#include <e32def_private.h>
+#include <e32cmn.h>
+#include <e32cmn_private.h>
+#include <u32std.h>
+#include <kernel/kernel.h>
+#include <kernel/kern_priv.h>
+#include <nk_trace.h>
+#include <arm.h>
+#include <kernel/cache.h>
+#include <platform.h>
+#include <nkern.h>
+#include <u32hal.h>
+
+#include <rm_debug_api.h>
+#include <sm_debug_api.h>
+#include "d_rmd_breakpoints.h"
+#include "d_process_tracker.h"
+#include "d_rmd_stepping.h"
+#include "rm_debug_kerneldriver.h"	// needed to access DRM_DebugChannel
+#include "rm_debug_driver.h"
+#include "debug_utils.h"
+#include "debug_logging.h"
+
+using namespace Debug;
+
+/* @internalTechnology
+ *
+ * Checks whether aAddress is correctly aligned for placing a breakpoint of
+ * cpu architecture aMode.
+ *
+ * @param aAddress - Virtual memory address to check
+ * @param aMode - The CPU architecture mode of the breakpoint to be placed at aAddress
+ * @return ETrue if aAddress is suitably aligned, EFalse otherwise.
+ */
+TBool D_RMD_Breakpoints::Aligned(TUint32 aAddress, Debug::TArchitectureMode aMode)
+	{
+	switch(aMode)
+		{
+		case Debug::EArmMode:
+			// ARM breakpoints must be 32-bit aligned (lower two bits must be zero)
+			if (aAddress & 0x3)
+			{
+				// Not 32-bit aligned.
+				return EFalse;
+			}
+			break;
+		case Debug::EThumbMode:
+			// Thumb breakpoints must be 16-bit aligned (low bit must be zero)
+			if (aAddress & 0x1)
+			{
+				// Not 16-bit aligned
+				return EFalse;
+			}
+			break;
+		case Debug::EThumb2EEMode:
+			// Thumb-EE instructions are half-word aligned. See ARM ARM DDI0406A, section A3.2 Alignment Support
+			// Note that some instructions need to be word-aligned, but this function does not know which ones.
+			// It may also depend on the System Control register U bit.
+			if (aAddress & 0x1)
+			{
+				// Not 16-bit aligned
+				return EFalse;
+			}
+			break;
+		default:
+			{
+			// No idea
+			return EFalse;
+			}
+		}
+
+	// Must be OK
+	return ETrue;
+	};
+
+/* @internalTechnology
+ *
+ * Returns the size of a breakpoint of architecture aMode in bytes
+ * 
+ * @param aMode - The architure of the breakpoint
+ * @return The size of the breakpoints in bytes. 0 if un-recognised architecture.
+ */
+TInt D_RMD_Breakpoints::BreakSize(Debug::TArchitectureMode aMode)
+	{
+	switch(aMode)
+		{
+		case Debug::EArmMode:
+			{
+				return 4;
+			}
+		case Debug::EThumbMode:
+			{
+				return 2;
+			}
+		case Debug::EThumb2EEMode:
+			{
+			// Only needs to be two bytes in size.
+			return 2;
+			}
+		default:
+			{
+				// No idea
+				return 0;
+			}
+		}
+	};
+
+/* @internalTechnology
+ *
+ * Checks whether two TBreakEntrys overlap
+ *
+ * @param aFirst - A TBreakEntry with valid iAddress and iMode fields.
+ * @param aSecond  - A TBreakEntry with valid iAddress and iMode fields.
+ * @return ETrue if the aFirst and aSecond overlap or the overlap cannot be determined
+ *         , EFalse otherwise
+ */
+TBool D_RMD_Breakpoints::BreakpointsOverlap(TBreakEntry& aFirst, TBreakEntry& aSecond)
+	{
+	TInt firstSize = BreakSize(aFirst.iMode);
+	TInt secondSize = BreakSize(aSecond.iMode);
+
+	// Do we know the size of each breakpoint?
+	if ((firstSize <= 0) || (secondSize <= 0))
+		{
+		// We don't know the size of the breakpoint, so assume they overlap
+		return ETrue;
+		}
+
+	TInt firstStartAddress = aFirst.iAddress;
+	TInt secondStartAddress = aSecond.iAddress;
+	TInt firstEndAddress = firstStartAddress + firstSize - 1;
+	TInt secondEndAddress = secondStartAddress + secondSize - 1;
+
+	// If second breakpoint is past the end of the first then we're ok
+	if(firstEndAddress < secondStartAddress)
+		{
+		return EFalse;
+		}
+
+	// If first breakpoint is past the end of the second then we're ok
+	if(secondEndAddress < firstStartAddress)
+		{
+		return EFalse;
+		}
+
+	// The breakpoints overlap
+	return ETrue;
+	}
+
+/* @internalTechnology
+ * 
+ * Returns the breakpoint bitpattern to use for each architecture type
+ *
+ * @param aMode - the cpu architecture type
+ * @return The bit-pattern to use for the specified architecture, or 0 if unsupported.
+ */
+TUint32 D_RMD_Breakpoints::BreakInst(Debug::TArchitectureMode aMode)
+	{
+	switch(aMode)
+		{
+		case Debug::EArmMode:
+			{
+				return KArmBreakPoint;
+			}
+		case Debug::EThumbMode:
+			{
+				return KThumbBreakPoint;
+			}
+		case Debug::EThumb2EEMode:
+			{
+			return KT2EEBreakPoint;
+			}
+		default:
+			{
+				// No idea what the breakpoint should be
+				return 0;
+			}
+		}
+	};
+
+/**
+Constructor. Initialises its internal list of empty breakpoints.
+*/
+D_RMD_Breakpoints::D_RMD_Breakpoints(DRM_DebugChannel* aChannel)
+: iBreakPointList(NUMBER_OF_TEMP_BREAKPOINTS, 0),
+  iNextBreakId(NUMBER_OF_TEMP_BREAKPOINTS),
+  iChannel(aChannel),
+  iInitialised(EFalse)
+	{
+	iBreakPointList.Reset();	
+	TBreakEntry emptyTempBreak;
+	
+	for (TInt i = 0; i < NUMBER_OF_TEMP_BREAKPOINTS; i++)
+		{
+		emptyTempBreak.iBreakId = i;
+		
+		if (KErrNone != iBreakPointList.Append(emptyTempBreak))
+			{
+			LOG_MSG("D_RMD_Breakpoints::D_RMD_Breakpoints() - Error appending blank temp break entry");
+			}
+		}
+	}
+
+/**
+Destructor. Clears all the breakpoints in the system, deletes its internal list of breakpoints,
+and closes the exclusivity semaphore.
+*/
+D_RMD_Breakpoints::~D_RMD_Breakpoints()
+	{
+	ClearAllBreakPoints();
+	
+	// close the breakpoint list and free the memory associated with it
+	iBreakPointList.Close();
+
+	if (iLock)
+		iLock->Close(NULL);
+	}
+
+/**
+Initialises the breakpoint list exclusion semaphore. This should be called once immediately after
+the constructor.
+
+@return KErrNone if successful, one of the other system wide error codes otherwise.
+*/
+TInt D_RMD_Breakpoints::Init()
+	{
+	TInt err = KErrNone;
+
+	// Only create a semaphore if we are not initialised
+	if(!iInitialised)
+		{
+		// Initialise the semaphore ensuring exclusive access to the breakpoint list
+		err = Kern::SemaphoreCreate(iLock, _L("RM_DebugBreakpointLock"), 1 /* Initial count */);
+		if (err == KErrNone)
+			{
+			iInitialised = ETrue;
+			}
+		}
+	else
+		{
+		err = KErrNone;
+		}
+
+	return err;
+	}
+
+/** 
+Public member function which sets a thread-specific breakpoint in the specified thread
+and returns an opaque handle to the caller.
+
+Note 1:
+This function ensures exclusive access to the breakpoint data structures
+by using a semaphore to serialise access.
+
+@see priv_DoSetBreak
+
+Note 2:
+As implied by Note 1, the caller must have previously called Init() or this
+function will return KErrNotReady;
+ 
+@param aBreakId - Reference to a TUint32 into which the function will return a unique breakpoint Id.
+@param aThreadId - The thread Id in which to place the breakpoint
+@param aAddress - Address to place the breakpoint
+@param aMode - The cpu instruction set architecture type breakpoint (e.g. EArmMode or EThumbMode)
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt D_RMD_Breakpoints::DoSetBreak(TInt32 &aBreakId, const TUint64 aId, const TBool aThreadSpecific, const TUint32 aAddress, const TArchitectureMode aMode)
+	{
+	// Ensure we have a valid semaphore
+	if (!iInitialised || !iLock)
+		{
+		return KErrNotReady;
+		}
+
+	// Acquire the lock
+	NKern::ThreadEnterCS();
+	Kern::SemaphoreWait(*iLock);
+
+	// Really do the work
+	TInt err = priv_DoSetBreak(aBreakId, aId, aThreadSpecific, aAddress,aMode);
+	
+	// Release the lock
+	Kern::SemaphoreSignal(*iLock);
+	NKern::ThreadLeaveCS();
+	
+	return err;
+	}
+/**
+Private member function which sets a thread-specific breakpoint in the specified thread
+and returns an opaque handle to the caller.
+
+@see DoSetBreak
+
+@param aBreakId - Reference to a TUint32 into which the function will return a unique breakpoint Id.
+@param aThreadId - The thread Id in which to place the breakpoint
+@param aAddress - Address to place the breakpoint
+@param aMode - The cpu instruction set architecture type breakpoint (e.g. EArmMode or EThumbMode)
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt D_RMD_Breakpoints::priv_DoSetBreak(TInt32 &aBreakId, const TUint64 aId, const TBool aThreadSpecific, const TUint32 aAddress, const TArchitectureMode aMode)
+	{
+	LOG_MSG4("D_RMD_Breakpoints::priv_DoSetBreak(aThreadId = 0x%016lx, aAddress = 0x%08x, aMode = %d)",aId,aAddress,aMode);
+
+	// EThumb2EEMode breakpoints are not supported
+	if (EThumb2EEMode == aMode)
+		{
+		LOG_MSG("D_RMD_Breakpoints::priv_DoSetBreak() - EThumb2EEMode breakpoints are not supported");
+		return KErrNotSupported;
+		}
+
+	// Check how many breakpoints we have in existence
+	if ((iBreakPointList.Count()+1) >= NUMBER_OF_MAX_BREAKPOINTS)
+		{
+		// Too many breakpoints are set!
+		LOG_MSG("D_RMD_Breakpoints::priv_DoSetBreak() - Too many breakpoints set");
+		return KErrOverflow;
+		}
+
+	// check the alignment of the breakpoint
+	if (!Aligned(aAddress,aMode))
+		{
+		LOG_MSG("D_RMD_Breakpoints::priv_DoSetBreak() - Unaligned address");
+		return KErrArgument;
+		}
+
+	// make sure there is not already a breakpoint at this address
+	for (TInt i = NUMBER_OF_TEMP_BREAKPOINTS; i < iBreakPointList.Count(); i++)
+		{
+		/* We need to check if the breakpoint overlaps the address at all,
+		 * and this depends upon the size of the two breakpoints as well as 
+		 * their address.
+		 */
+
+		// newInstSize = size in bytes of new breakpoint
+		TInt newInstSize = BreakSize(aMode);
+		if (newInstSize == 0)
+			{
+			LOG_MSG("D_RMD_Breakpoints::priv_DoSetBreak() - Unknown architecture type for new breakpoint");
+			return KErrNotSupported;
+			}
+
+		// oldInstSize = size in bytes of the existing breakpoint
+		TInt oldInstSize = BreakSize(iBreakPointList[i].iMode);
+		if (oldInstSize == 0)
+			{
+			LOG_MSG("D_RMD_Breakpoints::priv_DoSetBreak() - : Unknown architecture type of existing breakpoint");
+			return KErrNotSupported;
+			}
+
+		// Overlap checking - temp is used as the new breakpoint description for checking purposes only
+		TBreakEntry temp;
+
+		temp.iAddress = aAddress;
+		temp.iMode = aMode;
+
+		// do they overlap?
+		if ( BreakpointsOverlap(temp,iBreakPointList[i]) )
+			{
+			// Yes
+			if(iBreakPointList[i].iThreadSpecific && aThreadSpecific)
+				{
+				if(aId == iBreakPointList[i].iId)
+					{
+					LOG_MSG("D_RMD_Breakpoints::priv_DoSetBreak() - New thread specific breakpoint overlaps an existing thread specific breakpoint");
+					return KErrAlreadyExists;
+					}
+				}
+			else if(!iBreakPointList[i].iThreadSpecific && aThreadSpecific)
+				{
+				DThread* thread = DebugUtils::OpenThreadHandle(aId);
+				if(!thread)
+					{
+					return KErrNotFound;
+					}
+				if(thread->iOwningProcess->iId == iBreakPointList[i].iId)
+					{
+					LOG_MSG("D_RMD_Breakpoints::priv_DoSetBreak() - New thread specific breakpoint overlaps an existing breakpoint");
+					thread->Close(NULL);
+					return KErrAlreadyExists;
+					}
+				thread->Close(NULL);
+				}
+			else if(iBreakPointList[i].iThreadSpecific && !aThreadSpecific)
+				{
+				DThread* thread = DebugUtils::OpenThreadHandle(iBreakPointList[i].iId);
+				if(!thread)
+					{
+					return KErrNotFound;
+					}
+				if(thread->iOwningProcess->iId == aId)
+					{
+					LOG_MSG("D_RMD_Breakpoints::priv_DoSetBreak() - New breakpoint overlaps an existing thread specific breakpoint");
+					thread->Close(NULL);
+					return KErrAlreadyExists;
+					}
+				thread->Close(NULL);
+				}
+			else // !iBreakPointList[i].iThreadSpecific && !aThreadSpecific
+				{
+				if(iBreakPointList[i].iId == aId)
+					{
+					LOG_MSG("D_RMD_Breakpoints::priv_DoSetBreak() - New breakpoint overlaps an existing breakpoint");
+					return KErrAlreadyExists;
+					}
+				}
+			}
+		}
+
+	// increment the break id
+	aBreakId = iNextBreakId++;	
+
+	// create the new breakpoint entry
+	TBreakEntry breakEntry(aBreakId, aId, aThreadSpecific, aAddress, aMode);
+
+	TInt err = priv_DoEnableBreak(breakEntry, ETrue);
+	if (KErrNone != err)
+		{
+		LOG_MSG("D_RMD_Breakpoints::priv_DoSetBreak() - Could not enable the breakpoint");
+		
+		return err;
+		}
+
+	err = iBreakPointList.Append(breakEntry);
+	if (err != KErrNone)
+		{
+		LOG_MSG("D_RMD_Breakpoints::priv_DoSetBreak() - Failed to append breakpoint");
+		}
+
+	LOG_MSG2("D_RMD_Breakpoints::priv_DoSetBreak(breakId = 0x%08x) done",aBreakId);
+
+	return err;
+	}
+
+/**
+Public member function which enables a previously set breakpoint.
+
+Note 1:
+This function ensures exclusive access to the breakpoint data structures
+by using a semaphore to serialise access.
+
+@see priv_DoEnableBreak
+
+Note 2:
+As implied by Note 1, the caller must have previously called Init() or this
+function will return KErrNotReady;
+
+Note 3
+Historically, this function accepted a reference to a TBreakEntry in the class' own
+iBreakPointList. It now checks whether the reference is to an element of its own list,
+or one invented by the caller.
+
+@param aEntry reference to a TBreakEntry datastructure describing the breakpoint to be re-enabled.
+@param aSaveOldInstruction ETrue preserves the instruction at the breakpoint address, EFalse otherwise.
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt D_RMD_Breakpoints::DoEnableBreak(TBreakEntry &aEntry, TBool aSaveOldInstruction)
+	{
+	// Ensure we have a valid semaphore
+	if (!iInitialised || !iLock)
+		{
+		return KErrNotReady;
+		}
+
+	// Acquire the lock
+	NKern::ThreadEnterCS();
+	Kern::SemaphoreWait(*iLock);
+
+	// Really do the work
+	TInt err = priv_DoEnableBreak(aEntry,aSaveOldInstruction);
+	
+	// Release the lock
+	Kern::SemaphoreSignal(*iLock);
+	NKern::ThreadLeaveCS();
+
+	return err;
+	}
+
+/**
+Private member function which enables a previously set breakpoint, as per DoEnableBreak, but
+does not serialise access.
+
+@see DoEnableBreak
+
+@param aEntry reference to a TBreakEntry datastructure describing the breakpoint to be re-enabled.
+@param aSaveOldInstruction ETrue preserves the instruction at the breakpoint address, EFalse otherwise.
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt D_RMD_Breakpoints::priv_DoEnableBreak(TBreakEntry &aEntry, TBool aSaveOldInstruction)
+	{
+	LOG_MSG("D_RMD_Breakpoints::DoEnableBreak()");
+
+	TUint32 inst = BreakInst(aEntry.iMode);	
+	TInt instSize = BreakSize(aEntry.iMode);
+	if (instSize == 0 || inst == 0)
+		{
+		// not supported
+		LOG_MSG("D_RMD_Breakpoints::priv_DoEnableBreak - unsupported breakpoint architecture");
+		return KErrNotSupported;
+		}
+
+	TInt err = KErrNone;
+
+	// Get thread id
+	TUint64 threadId = aEntry.iId + (aEntry.iThreadSpecific ? 0 : 1);
+
+	DThread* threadObj = DebugUtils::OpenThreadHandle(threadId);
+	if (!threadObj)
+		{
+		LOG_MSG("D_RMD_Breakpoints::priv_DoEnableBreak - bad handle. Could not identify a threadObj");
+		return KErrBadHandle;
+		}
+
+	if (aSaveOldInstruction)
+		{
+		TUint32 instruction;
+
+		// read the instruction at the address so we can store it in the break entry for when we clear this breakpoint
+		// trap exceptions in case the address is invalid
+		XTRAPD(r, XT_DEFAULT, err = iChannel->TryToReadMemory(threadObj, (TAny *)aEntry.iAddress, (TAny *)&instruction, instSize));
+
+		//consider the leave as more important than the error code so store the leave if it's not KErrNone
+		if(KErrNone != r)
+			{
+			err = r;
+			}
+
+		if(KErrNone != err)
+			{
+			threadObj->Close(NULL);
+			LOG_MSG("D_RMD_Breakpoints::priv_DoEnableBreak() - failed to read memory");
+			return err;
+			}
+
+		aEntry.iInstruction.Copy((TUint8 *)&instruction, instSize);
+		}
+
+	TBool breakpointAlredySet = EFalse;
+	for (TInt i = NUMBER_OF_TEMP_BREAKPOINTS; i < iBreakPointList.Count(); i++)
+		{
+		if(iBreakPointList[i].iAddress == aEntry.iAddress && !iBreakPointList[i].iDisabledForStep )
+			{
+			breakpointAlredySet = ETrue;
+			break;
+			}
+		}
+	if(!breakpointAlredySet)
+		{
+		XTRAPD(r, XT_DEFAULT, err = DebugSupport::ModifyCode(threadObj, aEntry.iAddress, instSize, inst, DebugSupport::EBreakpointGlobal));
+		if(r != DebugSupport::EBreakpointGlobal)
+			{
+			err = r;
+			}
+		}
+
+	// Close the thread handle which has been opened by OpenThreadHandle
+	threadObj->Close(NULL);
+
+	return err;
+	}
+
+/**
+Public member function which clears a previously set breakpoint.
+
+Note 1:
+This function ensures exclusive access to the breakpoint data structures
+by using a semaphore to serialise access.
+
+@see priv_DoClearBreak
+
+Note 2:
+As implied by Note 1, the caller must have previously called Init() or this
+function will return KErrNotReady;
+
+@param aBreakId A breakpoint Id as previously returned by DoSetBreak.
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt D_RMD_Breakpoints::DoClearBreak(const TInt32 aBreakId, TBool aIgnoreTerminatedThreads)
+	{
+	// Ensure we have a valid semaphore
+	if (!iInitialised || !iLock)
+		{
+		return KErrNotReady;
+		}
+
+	// Acquire the lock
+	NKern::ThreadEnterCS();
+	Kern::SemaphoreWait(*iLock);
+
+	// Really do the work
+	TInt err = priv_DoClearBreak(aBreakId, aIgnoreTerminatedThreads);
+	
+	// Release the lock
+	Kern::SemaphoreSignal(*iLock);
+	NKern::ThreadLeaveCS();
+
+	return err;
+	}
+
+/**
+Private member function which clears a previously set breakpoint, as per DoClearBreak, but
+does not serialise access.
+
+@see DoClearBreak
+
+@param aBreakId A breakpoint Id as previously returned by DoSetBreak.
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt D_RMD_Breakpoints::priv_DoClearBreak(const TInt32 aBreakId, TBool aIgnoreTerminatedThreads)
+	{
+	LOG_MSG2("D_RMD_Breakpoints::priv_DoClearBreak(0x%08x)",aBreakId);
+
+	// find the break entry matching this id.  note that the breakpoints are already sorted in ascending order by id
+	TBreakEntry entry;
+	entry.iBreakId = aBreakId;
+	TInt index = iBreakPointList.FindInSignedKeyOrder(entry);
+
+	TInt err = KErrNone;
+	if (index >= 0)
+		{
+		//only let the agent clear the break if they have previously suspended the thread
+		//iThreadSpecific value decides whether the the iBreakPointList.Id has a thread id(TID) or the process id(PID) 
+		//the assumption here that TID = PID + 1
+		if(!TheDProcessTracker.CheckSuspended((iBreakPointList[index].iId + (iBreakPointList[index].iThreadSpecific ? 0 : 1))))
+			{
+			LOG_MSG2("D_RMD_Breakpoints::priv_DoClearBreak() - Thread with id 0x%08x not suspended", iBreakPointList[index].iId);
+			// should be "return KErrInUse;" but not always possible, e.g. cleaning up threads which die after debugger disconnects
+			}
+ 		// if this breakpoint was set in a library and that library has already been unloaded, don't try to clear it
+		if (!iBreakPointList[index].iObsoleteLibraryBreakpoint)
+			{
+			DThread* threadObj = DebugUtils::OpenThreadHandle(iBreakPointList[index].iId + (iBreakPointList[index].iThreadSpecific ? 0 : 1));
+			if (threadObj)
+				{
+				TBool needToCallCodeModifier = ETrue;
+				for (TInt i = NUMBER_OF_TEMP_BREAKPOINTS; i < iBreakPointList.Count(); i++)
+					{
+					if (i != index)
+						{
+						if ( BreakpointsOverlap(iBreakPointList[index],iBreakPointList[i]) )
+							{
+							needToCallCodeModifier = EFalse;
+							break;
+							}
+						}
+					}
+				if(needToCallCodeModifier)
+					{
+					XTRAPD(r, XT_DEFAULT, err = DebugSupport::RestoreCode(threadObj, iBreakPointList[index].iAddress));
+					if (r != KErrNone)
+						{
+						LOG_MSG2("D_RMD_Breakpoints::priv_DoClearBreak() - restore code trap harness returned error %d",r);
+						}
+
+				if (err != KErrNone)
+						{
+						LOG_MSG2("D_RMD_Breakpoints::priv_DoClearBreak() - restore code returned error %d",err);
+						}
+					err = (KErrNone == r) ? err : r;
+					}
+
+				// Close the thread handle opened by OpenThreadHandle
+				threadObj->Close(NULL);
+				}
+			else
+				{
+				err = KErrBadHandle;
+				}
+			}
+		
+		LOG_MSG4("D_RMD_Breakpoints::priv_DoClearBreak() - Clearing breakpoint at address: %x, err: %d, ignore terminated: %d", iBreakPointList[index].iAddress, err, aIgnoreTerminatedThreads?1:0);
+		if ((aIgnoreTerminatedThreads && KErrBadHandle == err) || KErrNone == err)
+			{
+			// if this is a temp breakpoint, just clear out the values, otherwise remove it from the list
+			err = KErrNone;
+			if (index < NUMBER_OF_TEMP_BREAKPOINTS)
+				{
+				iBreakPointList[index].Reset();
+				}
+			else
+				{
+				LOG_MSG3("D_RMD_Breakpoints::priv_DoClearBreak() - Removing breakpoint 0x%08x as breakid 0x%08x\n",index, entry.iBreakId);
+				iBreakPointList.Remove(index);
+				}			
+			}
+				
+		return err;
+		}
+
+	LOG_MSG2("D_RMD_Breakpoints::priv_DoClearBreak() - Break Id %d not found", aBreakId);
+
+	return KErrNotFound;
+	}
+
+/**
+Public member function which modifies a previously set breakpoint.
+
+Note 1:
+This function ensures exclusive access to the breakpoint data structures
+by using a semaphore to serialise access.
+
+@see priv_DoModifyBreak
+
+Note 2:
+As implied by Note 1, the caller must have previously called Init() or this
+function will return KErrNotReady;
+
+@param aBreakInfo A TModifyBreakInfo describing the breakpoint properties that are wanted.
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt D_RMD_Breakpoints::DoModifyBreak(TModifyBreakInfo* aBreakInfo)
+	{
+	// Ensure we have a valid semaphore
+	if (!iInitialised || !iLock)
+		{
+		return KErrNotReady;
+		}
+
+	// Acquire the lock
+	NKern::ThreadEnterCS();
+	Kern::SemaphoreWait(*iLock); 
+
+	// Really do the work
+	TInt err = priv_DoModifyBreak(aBreakInfo);
+	
+	// Release the lock
+	Kern::SemaphoreSignal(*iLock);
+	NKern::ThreadLeaveCS();
+
+	return err;
+	}
+
+/**
+Private member function which modifies a previously set breakpoint, as per DoModifyBreak, but
+does not serialise access.
+
+@see DoModifyBreak
+
+@param aBreakInfo A TModifyBreakInfo describing the breakpoint properties that are wanted.
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt D_RMD_Breakpoints::priv_DoModifyBreak(TModifyBreakInfo* aBreakInfo)
+	{
+	LOG_MSG("D_RMD_Breakpoints::priv_DoModifyBreak()");
+
+	// Check arguments
+	if (!aBreakInfo)
+		{
+		LOG_MSG("D_RMD_Breakpoints::priv_DoModifyBreak() was passed a NULL argument");
+		return KErrArgument;
+		}
+
+	//User side memory is not accessible directly
+	TSetBreakInfo info;
+	TInt err = Kern::ThreadRawRead(iChannel->iClientThread, aBreakInfo, (TUint8*)&info, sizeof(TSetBreakInfo));
+	if (err != KErrNone)
+		{
+		LOG_MSG("D_RMD_Breakpoints::priv_DoModifyBreak() was passed a bad argument");
+		return err;
+		}
+
+	// EThumb2EEMode breakpoints are not supported
+	if (EThumb2EEMode == info.iMode)
+		{
+		LOG_MSG("D_RMD_Breakpoints::priv_DoModifyBreak() - EThumb2EEMode breakpoints are not supported");
+		return KErrNotSupported;
+		}
+
+	// find the break entry matching this id.  note that the breakpoints are already sorted in ascending order by id
+	TBreakEntry entry;
+	entry.iBreakId = (TUint32)info.iBreakId;
+	TInt index = iBreakPointList.FindInSignedKeyOrder(entry);
+	if (index < 0)
+		{
+		// Could not find the breakpoint
+		LOG_MSG2("D_RMD_Breakpoints::priv_DoModifyBreak() - Could not find the breakpoint id 0x%08x",(TUint32)info.iBreakId);
+		return KErrNotFound;
+		}
+
+	//assert that the thread we're moving the break from is suspended
+	if(!TheDProcessTracker.CheckSuspended(iBreakPointList[index].iId))
+		{
+		LOG_MSG2("D_RMD_Breakpoints::priv_DoModifyBreak() - Thread with id 0x%08x not suspended", iBreakPointList[index].iId);
+		return KErrInUse;
+		}
+
+	//assert that the thread we're moving the break to is suspended
+	if(!TheDProcessTracker.CheckSuspended(info.iId))
+		{
+		LOG_MSG2("D_RMD_Breakpoints::priv_DoModifyBreak() - Thread with id 0x%08x not suspended", info.iId);
+		return KErrInUse;
+		}
+
+	// first check its not obsolete
+	if (!iBreakPointList[index].iObsoleteLibraryBreakpoint)
+		{
+		// its still a valid breakpoint
+
+		// remove the old breakpoint
+		DThread* threadObj = DebugUtils::OpenThreadHandle(iBreakPointList[index].iId);
+		if (threadObj)
+			{
+			LOG_MSG2("D_RMD_Breakpoints::priv_DoModifyBreak - Unsetting breakpoint at address 0x%08x",iBreakPointList[index].iAddress);
+
+			XTRAPD(r, XT_DEFAULT, err = DebugSupport::RestoreCode(threadObj, iBreakPointList[index].iAddress));
+			if (r != 0)
+				{
+				LOG_MSG("Failed to construct trap handler for DebugSupport::RestoreCode");
+				}
+
+			// Close the thread handle which has been opened by OpenThreadHandle
+			threadObj->Close(NULL);
+			}
+		else
+			{
+			// Bad handle
+			LOG_MSG("D_RMD_Breakpoints::priv_DoModifyBreak - Could not identify the breakpoint thread id");
+			return KErrBadHandle;
+			}
+		}
+
+	// make sure there is not already a breakpoint at the new address
+	for (TInt i = NUMBER_OF_TEMP_BREAKPOINTS; i < iBreakPointList.Count(); i++)
+		{
+		// Ignore data for the breakpoint entry being modified.
+		if (i != index)
+			{
+			/* We need to check if the breakpoint overlaps the address at all,
+			 * and this depends upon the size of the two breakpoints as well as 
+			 * their address.
+			 */
+
+			// newInstSize = size in bytes of new breakpoint
+			TInt newInstSize = BreakSize(info.iMode);
+			if (newInstSize == 0)
+			{
+				LOG_MSG("D_RMD_Breakpoints::priv_DoModifyBreak - Unknown architecture type for new breakpoint");
+				return KErrNotSupported;
+			}
+
+			// oldInstSize = size in bytes of the existing breakpoint
+			TInt oldInstSize = BreakSize(iBreakPointList[i].iMode);
+			if (oldInstSize == 0)
+			{
+				LOG_MSG("D_RMD_Breakpoints::priv_DoModifyBreak - Unknown architecture type of existing breakpoint");
+				return KErrNotSupported;
+			}
+
+			// Overlap checking - temp is used as the new breakpoint description for checking purposes only
+			TBreakEntry temp;
+
+			temp.iAddress = info.iAddress;
+			temp.iMode = info.iMode;
+
+			// do they overlap?
+			if ( BreakpointsOverlap(temp,iBreakPointList[i]) )
+				{
+				// Yes
+				LOG_MSG("D_RMD_Breakpoints::priv_DoModifyBreak() - New breakpoint overlaps an existing breakpoint");
+				return KErrAlreadyExists;
+				}
+			}
+		}
+
+	// Prepare iBreakPointList[index] with the new information, then set the breakpoint
+	iBreakPointList[index].iId = info.iId;
+	iBreakPointList[index].iAddress = info.iAddress;
+	iBreakPointList[index].iMode = info.iMode;
+
+	TBreakEntry& newBreakEntry = iBreakPointList[index];
+
+	// Decide the size of the breakpoint instruction
+	TUint32 inst = BreakInst(newBreakEntry.iMode);
+	TInt instSize = BreakSize(newBreakEntry.iMode);
+
+	if (inst == 0 || instSize == 0)
+		{
+		// Unsupported architecture
+		LOG_MSG("D_RMD_Breakpoints::priv_DoModifyBreak - unsupported breakpoint architecture");
+		return KErrNotSupported;
+		}
+
+
+	//if thread id is 0xFFFFFFFF, then the breakpoint is not thread specific
+	if (newBreakEntry.iId != 0xFFFFFFFF)
+		{
+		newBreakEntry.iThreadSpecific = ETrue;
+		}
+
+	// Get thread id from the process that we are debugging
+	TProcessInfo * proc = NULL;
+	TUint64 threadId = NULL;
+
+	threadId = newBreakEntry.iId;
+
+	DThread* threadObj = DebugUtils::OpenThreadHandle(threadId);
+	//if we don't have the right thread id for the address, 
+	//then try with the thread id of the process that we are debugging 	
+	if (!threadObj && iChannel->iDebugProcessList.Count())
+		{
+		proc = &iChannel->iDebugProcessList[0];
+		if (proc)
+			{
+			threadId = proc->iId+1;	
+			}
+		threadObj = DebugUtils::OpenThreadHandle(threadId);
+		}
+
+	if(!threadObj)
+		{
+		LOG_MSG("D_RMD_Breakpoints::priv_DoModifyBreak() - bad handle. Could not identify a threadObj");
+		return KErrBadHandle;
+		}
+
+	// save the old instruction
+	TUint32 instruction;
+
+	// read the instruction at the address so we can store it in the break entry for when we clear this breakpoint
+	// trap exceptions in case the address is invalid
+	XTRAPD(r, XT_DEFAULT, err = iChannel->TryToReadMemory(threadObj, (TAny *)newBreakEntry.iAddress, (TAny *)&instruction, instSize));
+
+	//consider the leave as more important than the error code so store the leave if it's not KErrNone
+	if(KErrNone != r)
+		{
+		err = r;
+		}
+	if(KErrNone != err)
+		{
+		threadObj->Close(NULL);
+		return err;
+		}
+
+	newBreakEntry.iInstruction.Copy((TUint8 *)&instruction, instSize);
+
+	newBreakEntry.iId = threadId; //set the thread ID here 
+	LOG_MSG3("ModifyCode2 instSize:%d, inst: 0x%08x", instSize, inst);
+	XTRAPD(s, XT_DEFAULT, err = DebugSupport::ModifyCode(threadObj, newBreakEntry.iAddress, instSize, inst, DebugSupport::EBreakpointGlobal));
+	if(s != DebugSupport::EBreakpointGlobal)
+		{
+		err = s;
+		}
+
+	// Close the thread handle which has been opened by OpenThreadHandle
+	threadObj->Close(NULL);
+
+	return err;
+	}	
+
+//
+// D_RMD_Breakpoints::DoModifyProcessBreak
+//
+TInt D_RMD_Breakpoints::DoModifyProcessBreak(TModifyProcessBreakInfo* aBreakInfo)
+	{
+	// Ensure we have a valid semaphore
+	if (!iInitialised || !iLock)
+		{
+		return KErrNotReady;
+		}
+
+	// Acquire the lock
+	NKern::ThreadEnterCS();
+	Kern::SemaphoreWait(*iLock); 
+
+	// Really do the work
+	TInt err = priv_DoModifyProcessBreak(aBreakInfo);
+	
+	// Release the lock
+	Kern::SemaphoreSignal(*iLock);
+	NKern::ThreadLeaveCS();
+
+	return err;
+	}
+	
+TInt D_RMD_Breakpoints::priv_DoModifyProcessBreak(TModifyProcessBreakInfo* aBreakInfo)
+	{	
+	LOG_MSG("D_RMD_Breakpoints::priv_DoModifyProcessBreak()");
+
+	// Check arguments
+	if (!aBreakInfo)
+		{
+		LOG_MSG("D_RMD_Breakpoints::priv_DoModifyProcessBreak() was passed a NULL argument");
+		return KErrArgument;
+		}
+
+	//User side memory is not accessible directly
+	TSetBreakInfo info;
+	TInt err = Kern::ThreadRawRead(iChannel->iClientThread, aBreakInfo, (TUint8*)&info, sizeof(TModifyProcessBreakInfo));
+	if (err != KErrNone)
+		{
+		LOG_MSG("D_RMD_Breakpoints::priv_DoModifyProcessBreak() was passed a bad argument");
+		return err;
+		}
+
+	// EThumb2EEMode breakpoints are not supported
+	if (EThumb2EEMode == info.iMode)
+		{
+		LOG_MSG("D_RMD_Breakpoints::priv_DoModifyProcessBreak() - EThumb2EEMode breakpoints are not supported");
+		return KErrNotSupported;
+		}
+
+	// find the break entry matching this id.  note that the breakpoints are already sorted in ascending order by id
+	TBreakEntry entry;
+	entry.iBreakId = (TUint32)info.iBreakId;
+	TInt index = iBreakPointList.FindInSignedKeyOrder(entry);
+	if (index < 0)
+		{
+		// Could not find the breakpoint
+		LOG_MSG2("D_RMD_Breakpoints::priv_DoModifyProcessBreak() - Could not find the breakpoint id 0x%08x",(TUint32)info.iBreakId);
+		return KErrNotFound;
+		}
+
+	// first check its not obsolete
+	if (!iBreakPointList[index].iObsoleteLibraryBreakpoint)
+		{
+		// its still a valid breakpoint
+
+		// remove the old breakpoint
+		DProcess *process = DebugUtils::OpenProcessHandle(iBreakPointList[index].iId);
+		DThread* threadObj = NULL;
+		if(process)
+			{
+			threadObj = process->FirstThread();
+			if(threadObj)
+				{
+				threadObj = DebugUtils::OpenThreadHandle(threadObj->iId);
+				}
+			process->Close(NULL);
+			}
+
+		if (threadObj)
+			{
+			LOG_MSG2("D_RMD_Breakpoints::priv_DoModifyProcessBreak() - Unsetting breakpoint at address 0x%08x",iBreakPointList[index].iAddress);
+
+			XTRAPD(r, XT_DEFAULT, err = DebugSupport::RestoreCode(threadObj, iBreakPointList[index].iAddress));
+			if (r != 0)
+				{
+				LOG_MSG("D_RMD_Breakpoints::priv_DoModifyProcessBreak() - Failed to construct trap handler for DebugSupport::RestoreCode");
+				}
+
+			// Close the thread handle which has been opened by OpenThreadHandle
+			threadObj->Close(NULL);
+			}
+		else
+			{
+			// Bad handle
+			LOG_MSG("D_RMD_Breakpoints::priv_DoModifyProcessBreak() - Could not identify the breakpoint process id");
+			return KErrBadHandle;
+			}
+		}
+
+	// make sure there is not already a breakpoint at the new address
+	for (TInt i = NUMBER_OF_TEMP_BREAKPOINTS; i < iBreakPointList.Count(); i++)
+		{
+		// Ignore data for the breakpoint entry being modified.
+		if (i != index)
+			{
+			/* We need to check if the breakpoint overlaps the address at all,
+			 * and this depends upon the size of the two breakpoints as well as 
+			 * their address.
+			 */
+
+			// newInstSize = size in bytes of new breakpoint
+			TInt newInstSize = BreakSize(info.iMode);
+			if (newInstSize == 0)
+				{
+				LOG_MSG("D_RMD_Breakpoints::priv_DoModifyProcessBreak() - Unknown architecture type for new breakpoint");
+				return KErrNotSupported;
+				}
+
+			// oldInstSize = size in bytes of the existing breakpoint
+			TInt oldInstSize = BreakSize(iBreakPointList[i].iMode);
+			if (oldInstSize == 0)
+				{
+				LOG_MSG("D_RMD_Breakpoints::priv_DoModifyProcessBreak() - : Unknown architecture type of existing breakpoint");
+				return KErrNotSupported;
+				}
+
+			// Overlap checking - temp is used as the new breakpoint description for checking purposes only
+			TBreakEntry temp;
+
+			temp.iAddress = info.iAddress;
+			temp.iMode = info.iMode;
+
+			// do they overlap?
+			if ( BreakpointsOverlap(temp,iBreakPointList[i]) )
+				{
+				// Yes
+				LOG_MSG("D_RMD_Breakpoints::priv_DoModifyProcessBreak() - New breakpoint overlaps an existing breakpoint");
+				return KErrAlreadyExists;
+				}
+			}
+		}
+
+	// Prepare iBreakPointList[index] with the new information, then set the breakpoint
+	iBreakPointList[index].iId = info.iId;
+	iBreakPointList[index].iAddress = info.iAddress;
+	iBreakPointList[index].iMode = info.iMode;
+
+	TBreakEntry& newBreakEntry = iBreakPointList[index];
+
+	// Decide the size of the breakpoint instruction
+	TUint32 inst = BreakInst(newBreakEntry.iMode);
+	TInt instSize = BreakSize(newBreakEntry.iMode);
+
+	if (inst == 0 || instSize == 0)
+		{
+		// Unsupported architecture
+		LOG_MSG("D_RMD_Breakpoints::priv_DoModifyProcessBreak() - unsupported breakpoint architecture");
+		return KErrNotSupported;
+		}
+
+	newBreakEntry.iThreadSpecific = EFalse;
+
+	DProcess* process = DebugUtils::OpenProcessHandle(newBreakEntry.iId);
+	if(!process)
+		{
+		LOG_MSG("D_RMD_Breakpoints::priv_DoModifyProcessBreak() - bad handle. Could not identify a process");
+		return KErrBadHandle;
+		}
+
+	DThread* threadObj = process->FirstThread();
+	if(threadObj)
+		{
+		threadObj = DebugUtils::OpenThreadHandle(threadObj->iId);
+		}
+	process->Close(NULL);
+	if(!threadObj)
+		{
+		return KErrNotFound;
+		}
+	// save the old instruction
+	TUint32 instruction;
+
+	// read the instruction at the address so we can store it in the break entry for when we clear this breakpoint
+	// trap exceptions in case the address is invalid
+	XTRAPD(r, XT_DEFAULT, err = iChannel->TryToReadMemory(threadObj, (TAny *)newBreakEntry.iAddress, (TAny *)&instruction, instSize));
+
+	//consider the leave as more important than the error code so store the leave if it's not KErrNone
+	if(KErrNone != r)
+		{
+		err = r;
+		}
+	if(KErrNone != err)
+		{
+		threadObj->Close(NULL);
+		return err;
+		}
+
+	newBreakEntry.iInstruction.Copy((TUint8 *)&instruction, instSize);
+
+	XTRAPD(s, XT_DEFAULT, err = DebugSupport::ModifyCode(threadObj, newBreakEntry.iAddress, instSize, inst, DebugSupport::EBreakpointGlobal));
+	if(s != DebugSupport::EBreakpointGlobal)
+		{
+		err = s;
+		}
+
+	// Close the thread handle which has been opened by OpenThreadHandle
+	threadObj->Close(NULL);
+
+	return err;
+	}
+
+/**
+Public member function which returns information about a previously set breakpoint.
+
+Note 1:
+This function ensures exclusive access to the breakpoint data structures
+by using a semaphore to serialise access.
+
+@see priv_DoBreakInfo
+
+Note 2:
+As implied by Note 1, the caller must have previously called Init() or this
+function will return KErrNotReady;
+
+@param aBreakInfo Address of aBreakInfo structure in user-side memory within the DSS client thread. CAN ONLY BE ACCESSED VIA Kern::ThreadRawRead()
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt D_RMD_Breakpoints::DoBreakInfo(TGetBreakInfo* aBreakInfo)
+	{
+	// Ensure we have a valid semaphore
+	if (!iInitialised || !iLock)
+		{
+		return KErrNotReady;
+		}
+
+	// Acquire the lock
+	NKern::ThreadEnterCS();
+	Kern::SemaphoreWait(*iLock);
+
+	// Really do the work
+	TInt err = priv_DoBreakInfo(aBreakInfo);
+	
+	// Release the lock
+	Kern::SemaphoreSignal(*iLock);
+	NKern::ThreadLeaveCS();
+
+	return err;
+	}
+
+/**
+Private member function function which returns information about a previously set breakpoint..
+
+@see DoBreakInfo
+
+@param aBreakInfo Address of aBreakInfo structure in user-side memory within the DSS client thread. CAN ONLY BE ACCESSED VIA Kern::ThreadRawRead()
+@return KErrNone if successful, otherwise one of the other system wide error codes.
+*/
+TInt D_RMD_Breakpoints::priv_DoBreakInfo(TGetBreakInfo* aBreakInfo)
+	{
+	LOG_MSG("D_RMD_Breakpoints::priv_DoBreakInfo()");
+
+	if (!aBreakInfo)
+		{
+		LOG_MSG("D_RMD_Breakpoints::priv_DoBreakInfo() was passed a NULL argument");
+
+		return KErrArgument;
+		}
+
+	//User side memory is not accessible directly
+	TGetBreakInfo info;
+	TInt err = Kern::ThreadRawRead(iChannel->iClientThread, aBreakInfo, (TUint8*)&info, sizeof(TGetBreakInfo));
+	if (err != KErrNone)
+		{
+		LOG_MSG("D_RMD_Breakpoints::priv_DoBreakInfo() was passed a bad argument");
+
+		return err;
+		}
+
+	// find the break entry matching this id.  note that the breakpoints are already sorted in ascending order by id
+	TBreakEntry entry;
+	entry.iBreakId = (TUint32)info.iBreakId;
+	TInt index = iBreakPointList.FindInSignedKeyOrder(entry);
+	
+	if (index >=0)
+		{
+		// get the thread id for this breakpoint
+		TUint64 threadId = iBreakPointList[index].iId;
+
+		err = Kern::ThreadRawWrite(iChannel->iClientThread,(TUint8*)info.iId,&threadId,sizeof(TUint64));
+		if (err != KErrNone)
+			{
+			LOG_MSG("D_RMD_Breakpoints::priv_DoBreakInfo() - failed to return breakpoint iThreadId information");
+			return err;
+			}
+
+		// get the threadSpecific-ness
+		TBool threadSpecific = iBreakPointList[index].iThreadSpecific;
+
+		err = Kern::ThreadRawWrite(iChannel->iClientThread,(TUint8*)info.iThreadSpecific,&threadSpecific,sizeof(TBool));
+		if (err != KErrNone)
+			{
+			LOG_MSG("D_RMD_Breakpoints::priv_DoBreakInfo() - failed to return thread specific information");
+			return err;
+			}
+
+
+		// get the address
+		TUint32 address = iBreakPointList[index].iAddress;
+
+		err = Kern::ThreadRawWrite(iChannel->iClientThread,(TUint8*)info.iAddress,&address,sizeof(TUint32));
+		if (err != KErrNone)
+			{
+			LOG_MSG("D_RMD_Breakpoints::priv_DoBreakInfo() - failed to return breakpoint iAddress information");
+			return err;
+			}
+
+
+		// get the architecture
+		TArchitectureMode mode = iBreakPointList[index].iMode;
+
+		err = Kern::ThreadRawWrite(iChannel->iClientThread,(TUint8*)info.iMode,&mode,sizeof(TUint32));
+		if (err != KErrNone)
+			{
+			LOG_MSG("D_RMD_Breakpoints::priv_DoBreakInfo() - failed to return breakpoint iMode information");
+			return err;
+			}
+
+		return err;
+		}
+
+	LOG_MSG2("D_RMD_Breakpoints::priv_DoBreakInfo - Could not find the breakpoint id specified 0x%08x", entry.iBreakId);
+	return KErrNotFound;
+	}
+
+/**
+Public member function which clears all the breakpoints in the system. Generally used for shutting down
+the debug device driver.
+
+Note 1:
+This function ensures exclusive access to the breakpoint data structures
+by using a semaphore to serialise access.
+
+@see priv_ClearAllBreakPoints
+
+Note 2:
+As implied by Note 1, the caller must have previously called Init() or this
+function will return KErrNotReady;
+*/
+void D_RMD_Breakpoints::ClearAllBreakPoints()
+	{
+	// Ensure we have a valid semaphore
+	if (!iInitialised || !iLock)
+		{
+		return;
+		}
+
+	// Acquire the lock
+	NKern::ThreadEnterCS();
+	Kern::SemaphoreWait(*iLock);
+
+	// Really do the work
+	priv_ClearAllBreakPoints();
+	
+	// Release the lock
+	Kern::SemaphoreSignal(*iLock);
+	NKern::ThreadLeaveCS();
+	}
+
+/**
+Private member function which clears all the breakpoints in the system. Generally used for shutting down
+the debug device driver. 
+
+@see DoClearAllBreakPoints
+*/
+void D_RMD_Breakpoints::priv_ClearAllBreakPoints()
+	{
+	LOG_MSG("D_RMD_Breakpoints::priv_ClearAllBreakPoints()");
+
+	TInt err = KErrNone;
+
+	for (TInt i=0; i<iBreakPointList.Count(); i++)
+		{
+		if ((iBreakPointList[i].iAddress != 0) && !iBreakPointList[i].iObsoleteLibraryBreakpoint)
+			{
+			LOG_MSG2("D_RMD_Breakpoints::priv_ClearAllBreakPoints() - Clearing breakpoint at address %x", iBreakPointList[i].iAddress);
+			TUint32 id = iBreakPointList[i].iId + (iBreakPointList[i].iThreadSpecific ? 0 : 1);
+			DThread *threadObj = DebugUtils::OpenThreadHandle(id);
+			if (threadObj)
+				{
+				XTRAPD(r, XT_DEFAULT, err = DebugSupport::RestoreCode(threadObj, iBreakPointList[i].iAddress));
+				err = (KErrNone == r) ? err : r;
+				threadObj->Close(NULL);
+				}
+			else
+				{
+				err = KErrBadHandle;
+				}
+
+			if (KErrNone != err)
+				{
+				LOG_MSG2("D_RMD_Breakpoints::priv_ClearAllBreakPoints() - Error 0x%08x while clearing breakpoint", err);
+				}
+			}
+		}
+
+	iBreakPointList.Reset();
+	}
+
+/**
+Public member function which disables the breakpoint at the specified address.
+
+Note 1:
+This function ensures exclusive access to the breakpoint data structures
+by using a semaphore to serialise access.
+
+@see priv_DisableBreakAtAddress
+
+Note 2:
+As implied by Note 1, the caller must have previously called Init() or this
+function will return KErrNotReady;
+
+@param aAddress Address at which to disable breakpoints (all threads)
+@return KErrNone if successful, one of the other system wide error codes otherwise.
+*/
+TInt D_RMD_Breakpoints::DisableBreakAtAddress(TUint32 aAddress)
+	{
+	// Ensure we have a valid semaphore
+	if (!iInitialised || !iLock)
+		{
+		return KErrNotReady;
+		}
+
+	// Acquire the lock
+	NKern::ThreadEnterCS();
+	Kern::SemaphoreWait(*iLock);
+
+	// Really do the work
+	TInt err = priv_DisableBreakAtAddress(aAddress);
+	
+	// Release the lock
+	Kern::SemaphoreSignal(*iLock);
+	NKern::ThreadLeaveCS();
+
+	return err;
+	}
+
+/**
+Private member function which clears all the breakpoints in the system. Generally used for shutting down
+the debug device driver. 
+
+@see DisableBreakAtAddress
+
+@param aAddress clears the breakpoint at the specified address
+@return KErrNone if successful, one of the other system wide error codes otherwise.
+*/
+TInt D_RMD_Breakpoints::priv_DisableBreakAtAddress(TUint32 aAddress)
+	{
+	LOG_MSG("D_RMD_Breakpoints::priv_DisableBreakAtAddress()");
+
+	TInt err = KErrNone;
+
+	for (TInt i = NUMBER_OF_TEMP_BREAKPOINTS; i < iBreakPointList.Count(); i++)
+		{
+		if (iBreakPointList[i].iAddress == aAddress)
+			{
+			iBreakPointList[i].iDisabledForStep = ETrue;
+			LOG_MSG2("D_RMD_Breakpoints::priv_DisableBreakAtAddress - Disabling breakpoint at address 0x%x", iBreakPointList[i].iAddress);
+
+			//clear the breakpoint with code modifier
+			//code modifier will restore the org instruction and also frees the shadow page if necessary
+			TUint64 id = iBreakPointList[i].iId + (iBreakPointList[i].iThreadSpecific ? 0 : 1);
+			DThread* threadObj = NULL;
+			if(iBreakPointList[i].iThreadSpecific)
+				{
+				threadObj = DebugUtils::OpenThreadHandle(id);
+				}
+			else
+				{
+				DProcess *process = DebugUtils::OpenProcessHandle(iBreakPointList[i].iId);
+				if(process)
+					{
+					threadObj = process->FirstThread();
+					if(threadObj)
+						{
+						if(KErrNone != threadObj->Open())
+							{
+							LOG_MSG("Couldn't open threadObj");
+							threadObj = NULL;
+							}
+						}
+					else
+						{
+						LOG_MSG("threadObj is NULL");
+						}
+					}
+				else
+					{
+					LOG_MSG("Process is NULL");
+					}
+				}
+			if (threadObj)
+				{
+				XTRAPD(r, XT_DEFAULT, err = DebugSupport::RestoreCode(threadObj, aAddress));			
+				if(KErrNone != err || KErrNone != r)
+					{
+					LOG_MSG3("Error from DebugSupport::RestoreCode: r: %d, err: %d", r, err);
+					}
+				err = (KErrNone == r) ? err : r;
+				threadObj->Close(NULL);
+				}
+			else
+				{
+				err = KErrBadHandle;
+				break;
+				}
+			}
+		}
+		
+	return err;
+	}
+
+/**
+Public member function which enables previously disabled breakpoints within a given thread.
+
+Note 1:
+This function ensures exclusive access to the breakpoint data structures
+by using a semaphore to serialise access. 
+
+@see priv_DoEnableDisabledBreak
+
+Note 2:
+As implied by Note 1, the caller must have previously called Init() or this
+function will return KErrNotReady;
+
+@param aThreadId Thread in which to enable all previously disabled breakpoints
+@return KErrNone if successful, one of the system wide error codes otherwise.
+*/
+TInt D_RMD_Breakpoints::DoEnableDisabledBreak(TUint64 aThreadId)
+	{
+	// Ensure we have a valid semaphore
+	if (!iInitialised || !iLock)
+		{
+		return KErrNotReady;
+		}
+
+	// Acquire the lock
+	NKern::ThreadEnterCS();
+	Kern::SemaphoreWait(*iLock);
+
+	// Really do the work
+	TInt err = priv_DoEnableDisabledBreak(aThreadId);
+	
+	// Release the lock
+	Kern::SemaphoreSignal(*iLock);
+	NKern::ThreadLeaveCS();
+
+	return err;
+	}
+
+/**
+Private member function which enables previously disabled breakpoints within a given thread.
+
+@see DoEnableDisabledBreak
+
+@param aThreadId Thread in which to enable all previously disabled breakpoints
+@return KErrNone if successful, one of the system wide error codes otherwise.
+*/
+TInt D_RMD_Breakpoints::priv_DoEnableDisabledBreak(TUint64 aThreadId)
+	{
+	LOG_MSG("D_RMD_Breakpoints::priv_DoEnableDisabledBreak()");
+	DThread* thread = DebugUtils::OpenThreadHandle(aThreadId);
+	if(!thread)
+		{
+		LOG_MSG2("Thread: 0x%08x does not exist", aThreadId);
+		return KErrNotFound;
+		}
+	TUint64 processId = thread->iOwningProcess->iId;
+	thread->Close(NULL);
+
+	for (TInt i = NUMBER_OF_TEMP_BREAKPOINTS; i < iBreakPointList.Count(); i++)
+		{
+		TBool needsEnabling = EFalse;
+		if(iBreakPointList[i].iDisabledForStep)
+			{
+			if(iBreakPointList[i].iThreadSpecific)
+				{
+				needsEnabling = (aThreadId == iBreakPointList[i].iId);
+				}
+			else
+				{
+				needsEnabling = (processId == iBreakPointList[i].iId);
+				}
+			}
+		if (needsEnabling)
+			{
+			LOG_MSG2("Re-enabling breakpoint at address %x", iBreakPointList[i].iAddress);
+			TInt err = priv_DoEnableBreak(iBreakPointList[i], EFalse);
+			if(KErrNone != err)
+				{
+				LOG_MSG2("Error returned from DoEnableBreak: %d", err);
+				iBreakPointList[i].iDisabledForStep = EFalse;
+				return err;
+				}
+			}
+		}
+	
+	return KErrNone;
+	}
+
+/**
+Public member function which removes all the breakpoints within a given thread.
+
+Note 1:
+This function ensures exclusive access to the breakpoint data structures
+by using a semaphore to serialise access.
+
+@see priv_DoRemoveThreadBreaks
+
+Note 2:
+As implied by Note 1, the caller must have previously called Init() or this
+function will return KErrNotReady;
+
+@param aThreadId Thread from which to remove all existing breakpoints
+@return KErrNone if successful, one of the system wide error codes otherwise.
+*/
+void D_RMD_Breakpoints::DoRemoveThreadBreaks(TUint64 aThreadId)
+	{
+	// Ensure we have a valid semaphore
+	if (!iInitialised || !iLock)
+		{
+		return;
+		}
+
+	// Acquire the lock
+	NKern::ThreadEnterCS();
+	Kern::SemaphoreWait(*iLock);
+
+	// Really do the work
+	priv_DoRemoveThreadBreaks(aThreadId);
+
+	// Release the lock
+	Kern::SemaphoreSignal(*iLock);
+	NKern::ThreadLeaveCS();
+	}
+
+/**
+Private member function which removes all the breakpoints particular to a particular thread
+
+@see DoRemoveThreadBreaks
+
+@param aThreadId Thread from which to remove all existing breakpoints
+@return KErrNone if successful, one of the system wide error codes otherwise.
+*/
+void D_RMD_Breakpoints::priv_DoRemoveThreadBreaks(TUint64 aThreadId)
+	{
+	LOG_MSG2("D_RMD_Breakpoints::priv_DoRemoveThreadBreaks(aThreadId = 0x%016lx)\n",aThreadId);
+
+	TInt err = KErrNone;
+	TUint64 threadId;
+
+	for (TInt i=iBreakPointList.Count()-1; i >= 0; i--)
+		{
+		if ((iBreakPointList[i].iAddress != 0) && !iBreakPointList[i].iObsoleteLibraryBreakpoint)
+			{
+			threadId = iBreakPointList[i].iId + (iBreakPointList[i].iThreadSpecific ? 0 : 1);
+			if (threadId == aThreadId)
+				{
+				LOG_MSG4("D_RMD_Breakpoints::priv_DoRemoveThreadBreaks() - Clearing breakpoint at address 0x%08x for thread id 0x%016lx with id 0x%08x", iBreakPointList[i].iAddress, iBreakPointList[i].iId, iBreakPointList[i].iBreakId);
+
+				err = priv_DoClearBreak(iBreakPointList[i].iBreakId, EFalse);
+
+				if (err != KErrNone)
+					{
+					LOG_MSG2("D_RMD_Breakpoints::priv_DoRemoveThreadBreaks()  - failed to remove break id 0x%08x\n",iBreakPointList[i].iBreakId);
+					return;
+					}
+				}
+			}
+		}	
+	}
+
+// Remove the process breakpoints for process with PID aProcessId in the range [aCodeAddress, aCodeAddress + aCodeSize)
+void D_RMD_Breakpoints::RemoveBreaksForProcess(TUint64 aProcessId, TUint32 aCodeAddress, TUint32 aCodeSize)
+	{
+	LOG_MSG("D_RMD_Breakpoints::RemoveBreaksForProcess()");
+	for (TInt i=iBreakPointList.Count() - 1; i>=0; i--)
+		{
+		TBreakEntry& breakEntry = iBreakPointList[i];
+		if(!breakEntry.iThreadSpecific && breakEntry.iId == aProcessId)
+			{
+			if ((breakEntry.iAddress >= aCodeAddress) && (breakEntry.iAddress < (aCodeAddress + aCodeSize)))
+				{
+				LOG_MSG2("Removing process breakpoint at address %x", (TUint32)breakEntry.iAddress);
+				TInt err = DoClearBreak(breakEntry.iBreakId, ETrue);
+				if(KErrNone != err)
+					{
+					LOG_MSG2("Error removing process breakpoint: %d", err);
+					}
+				}
+			}
+		}
+	}
+
+// mark the breakpoints in the range [aCodeAddress, aCodeAddress + aCodeSize)
+void D_RMD_Breakpoints::InvalidateLibraryBreakPoints(TUint32 aCodeAddress, TUint32 aCodeSize)
+	{
+	LOG_MSG("D_RMD_Breakpoints::InvalidateLibraryBreakPoints()");
+	for (TInt i=0; i<iBreakPointList.Count(); i++)
+		{
+		if ((iBreakPointList[i].iAddress >= aCodeAddress) && (iBreakPointList[i].iAddress < (aCodeAddress + aCodeSize)))
+			{
+			LOG_EVENT_MSG2("Disabling library breakpoint at address %x", iBreakPointList[i].iAddress);
+			iBreakPointList[i].iObsoleteLibraryBreakpoint = ETrue;
+			}
+		}
+	}
+
+TInt D_RMD_Breakpoints::BreakPointCount() const
+	{
+	return iBreakPointList.Count();
+	}
+
+/**
+  Gets next breakpoint in list.
+  @param aBreakEntry The break entry to get the successor of. If NULL then returns the first entry.
+  @return A pointer to the next break entry, or NULL if the end of the list has been reached
+  */
+TBreakEntry* D_RMD_Breakpoints::GetNextBreak(const TBreakEntry* aBreakEntry) const
+	{
+	if(!aBreakEntry)
+		{
+		return (TBreakEntry*)&(iBreakPointList[0]);
+		}
+	TInt index = iBreakPointList.FindInSignedKeyOrder(*aBreakEntry) + 1;
+	return (index < BreakPointCount()) ? (TBreakEntry*)&(iBreakPointList[index]) : NULL;
+	}
+
+TBool D_RMD_Breakpoints::IsTemporaryBreak(const TBreakEntry& aBreakEntry) const
+	{
+	// Ensure we have a valid semaphore
+	if (!iInitialised || !iLock)
+		{
+		return EFalse;
+		}
+
+	// Acquire the lock
+	NKern::ThreadEnterCS();
+	Kern::SemaphoreWait(*iLock);
+
+	// Really do the work
+	TBool tempBreak = priv_IsTemporaryBreak(aBreakEntry);
+	
+	// Release the lock
+	Kern::SemaphoreSignal(*iLock);
+	NKern::ThreadLeaveCS();
+	
+	return tempBreak;
+	}
+
+/**
+Private member function which tells us if a breakpoint is temporary
+
+@see IsTemporaryBreak
+
+@param aBreakEntry
+@return TBool indicating if the break is temporary or not
+*/
+TBool D_RMD_Breakpoints::priv_IsTemporaryBreak(const TBreakEntry& aBreakEntry) const 
+	{
+	return aBreakEntry.iBreakId < NUMBER_OF_TEMP_BREAKPOINTS;
+	}
+
+
+// End of file - d_rmd_breakpoints.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/rmdebug/d_rmd_breakpoints.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,213 @@
+// 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"
+// 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:
+// Refactored class containing breakpoint related code from rm_debug_kerneldriver.cpp
+//
+
+
+
+/**
+ @file
+ @internalComponent
+ @released
+*/
+
+#ifndef D_RMD_BREAKPOINTS_H
+#define D_RMD_BREAKPOINTS_H
+
+#include <rm_debug_api.h>
+#include <kernel/kern_priv.h>
+#include "rm_debug_kerneldriver.h"
+
+// fwd declaration of friend classes needed due to re-factoring
+class DRM_DebugChannel;
+
+class DRMDStepper;
+
+//
+// Macros
+//
+const TUint32 KArmBreakPoint = 0xE7F123F4;
+const TUint16 KThumbBreakPoint = 0xDE56;
+const TUint16 KT2EEBreakPoint = 0xC100;	// From ARM ARM DDI0406A, section A9.2.1 Undefined instruction encoding for Thumb2-EE.
+
+#define NUMBER_OF_TEMP_BREAKPOINTS 10
+
+#define NUMBER_OF_MAX_BREAKPOINTS 100
+
+//
+// class TBreakEntry
+//
+class TBreakEntry
+{
+public:
+
+	inline TBreakEntry() { Reset(); };
+
+	inline TBreakEntry(Debug::TBreakId aBreakId, TUint64 aId, TBool aThreadSpecific, TUint32 aAddress, Debug::TArchitectureMode aMode)
+			: iBreakId(aBreakId),
+			  iId(aId),
+			  iAddress(aAddress),
+			  iMode(aMode),
+			  iThreadSpecific(aThreadSpecific)
+	{
+		 iInstruction.FillZ(4);
+		 iPageAddress = 0;
+		 iDisabledForStep = EFalse;
+		 iObsoleteLibraryBreakpoint = EFalse;
+		 iResumeOnceOutOfRange = EFalse;
+		 iSteppingInto = EFalse;
+		 iRangeStart = 0;
+		 iRangeEnd = 0;
+		 iStepTarget = EFalse;
+		 iNumSteps = 0;
+	};
+	
+	inline void Reset()
+	{
+		 iId = 0;
+		 iAddress = 0;
+		 iMode = Debug::EArmMode;
+		 iInstruction.FillZ(4);
+		 iPageAddress = 0;
+		 iDisabledForStep = EFalse;
+		 iObsoleteLibraryBreakpoint = EFalse;
+		 iResumeOnceOutOfRange = EFalse;
+		 iSteppingInto = EFalse;
+		 iRangeStart = 0;
+		 iRangeEnd = 0;
+		 iStepTarget = EFalse;
+		 iNumSteps = 0;
+	};
+
+public:
+	// Unique Id for this breakpoint. Assigned by D_RMD_Breakpoints::DoSetBreak(). @see D_RMD_Breakpoints::DoSetBreak
+	TInt32		iBreakId;
+	// Consider making the iId into a union of TProcessId, TThreadId, global etc. to make things more obvious
+	// Object Id in which this breakpoint should operate.
+	TUint64		iId;
+	// Address at which this breakpoint should operate
+	TUint32		iAddress;
+	// CPU ISA which this breakpoint uses, e.g. EArmMode/EThumbMode.
+	Debug::TArchitectureMode iMode;
+	// The original instruction which was stored at iAddress.
+	TBuf8<4>	iInstruction;
+	TUint32		iPageAddress;   //not used: BC if we remove it
+
+	// Indicates whether this breakpoint has been temporarily replaced with original instruction to enable step-off this breakpoint
+	TBool		iDisabledForStep;
+	/* This is used when libraries and processes are removed, so that
+	 * the driver can say 'ok' when requested to remove breakpoints
+	 * that existed in these cases, rather than 'Not Found'.
+	 *
+	 * Its not logical, but its a BC break if we change it :-(
+	 */
+	TBool		iObsoleteLibraryBreakpoint;
+	// Indicates whether this thread should be resumed after stepping off this breakpoint
+	TBool		iResumeOnceOutOfRange;
+	TBool		iSteppingInto;
+	TUint32		iRangeStart;
+	TUint32		iRangeEnd;
+	TBool		iThreadSpecific;
+	TBool		iStepTarget;
+
+	// Indicates how many more instruction steps should occur after hitting this breakpoint
+	TInt		iNumSteps;
+};
+/**
+@internalTechnology
+
+This class encapsulates all the data concerning run-mode and stop mode breakpoints
+as understood by the run-mode and stop-mode debug system.
+
+Note:                                                                        
+	The internal list of breakpoints is currently divided into two sections. The range from
+	0...NUMBER_OF_TEMP_BREAKPOINTS is used internally by the debug driver for implementing
+	stepping. The range from NUMBER_OF_TEMP_BREAKPOINTS to NUMBER_OF_MAX_BREAKPOINTS is used
+	to store information about breakpoints set by the client debug agents.
+                                                                                                                                                            
+	In future, this should change, so that each breakpoint knows what kind of breakpoint it
+	is (user/temp etc).
+
+
+*/
+class D_RMD_Breakpoints : public DBase
+{
+public:
+	D_RMD_Breakpoints(DRM_DebugChannel* aChannel);
+	~D_RMD_Breakpoints();
+
+	TInt Init();
+
+	// from rm_debug_driver.h
+	TInt DoSetBreak(TInt32 &aBreakId, const TUint64 aId, const TBool aThreadSpecific, const TUint32 aAddress, const Debug::TArchitectureMode aMode );
+	TInt DoEnableBreak(TBreakEntry &aEntry, TBool aSaveOldInstruction);
+	TInt DoClearBreak(const TInt32 aBreakId, TBool aIgnoreTerminatedThreads=EFalse);
+	TInt DoModifyBreak(TModifyBreakInfo* aBreakInfo);
+	TInt DoModifyProcessBreak(TModifyProcessBreakInfo* aBreakInfo);
+	TInt DoBreakInfo(TGetBreakInfo* aBreakInfo);
+	void ClearAllBreakPoints();
+	TInt DisableBreakAtAddress(TUint32 aAddress);
+	TInt DoEnableDisabledBreak(TUint64 aThreadId);
+
+	void DoRemoveThreadBreaks(TUint64 aThreadId);
+	void RemoveBreaksForProcess(TUint64 aProcessId, TUint32 aCodeAddress, TUint32 aCodeSize);
+	void InvalidateLibraryBreakPoints(TUint32 aCodeAddress, TUint32 aCodeSize);
+	TInt BreakPointCount() const;
+	TBreakEntry* GetNextBreak(const TBreakEntry* aBreakEntry) const;
+	TBool IsTemporaryBreak(const TBreakEntry& aBreakEntry) const;
+
+	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 );
+	TInt priv_DoEnableBreak(TBreakEntry &aEntry, TBool aSaveOldInstruction);
+	TInt priv_DoClearBreak(const TInt32 aBreakId, TBool aIgnoreTerminatedThreads);
+	TInt priv_DoModifyBreak(TModifyBreakInfo* aBreakInfo);
+	TInt priv_DoModifyProcessBreak(TModifyProcessBreakInfo* aBreakInfo);
+	TInt priv_DoBreakInfo(TGetBreakInfo* aBreakInfo);	
+	TInt priv_DisableBreakAtAddress(TUint32 aAddress);
+	TInt priv_DoEnableDisabledBreak(TUint64 aThreadId);
+	void priv_DoRemoveThreadBreaks(TUint64 aThreadId);
+	void priv_ClearAllBreakPoints();
+	TBool priv_IsTemporaryBreak(const TBreakEntry& aBreakEntry) const;
+
+	// helper functions
+	TBool Aligned(TUint32 aAddress, Debug::TArchitectureMode aMode);
+	TInt BreakSize(Debug::TArchitectureMode aMode);
+	TBool BreakpointsOverlap(TBreakEntry& aFirst, TBreakEntry& aSecond);
+	TUint32 BreakInst(Debug::TArchitectureMode aMode);
+
+private:
+	RArray<TBreakEntry> iBreakPointList;
+	TInt iNextBreakId;
+
+	DRM_DebugChannel* iChannel;	// temporary reference back to DRM_DebugChannel to help with refactoring
+
+	/* Protect access to the breakpoint list with a DSemaphore
+	 *
+	 * This means that stop-mode debuggers know when the list is being updated by the run-mode debug subsystem.
+	 */
+	DSemaphore* iLock;
+
+	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 Sep 01 12:34:56 2010 +0100
@@ -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 );
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/rmdebug/d_rmd_stepping.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,1884 @@
+// 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:
+// This file contains stepping code refactored from rm_debug_kerneldriver.cpp/rm_debug_kerneldriver.h
+//
+
+#include <e32def.h>
+#include <e32def_private.h>
+#include <e32cmn.h>
+#include <e32cmn_private.h>
+#include <kernel/kernel.h> 
+#include <kernel/kern_priv.h>
+#include <nk_trace.h>
+#include <arm.h>
+#include <rm_debug_api.h>
+
+#include "d_rmd_stepping.h"
+#include "d_rmd_breakpoints.h"
+#include "rm_debug_kerneldriver.h"	// needed to access DRM_DebugChannel
+#include "rm_debug_driver.h"
+#include "debug_logging.h"
+
+using namespace Debug;
+
+//
+// DRMDStepping::DRMDStepping
+//
+DRMDStepping::DRMDStepping(DRM_DebugChannel* aChannel)
+:
+	iChannel(aChannel)
+	{
+	// to do
+	}
+
+//
+// DRMDStepping::~DRM_DebugChannel
+//
+DRMDStepping::~DRMDStepping()
+	{
+	// to do
+	}
+
+//
+// DRMDStepping::IsExecuted
+//
+TBool DRMDStepping::IsExecuted(TUint8 aCondition ,TUint32 aStatusRegister)
+	{
+	LOG_MSG("DRMDStepping::IsExecuted()");
+
+	TBool N = ((aStatusRegister >> 28) & 0x0000000F) & 0x00000008;
+	TBool Z = ((aStatusRegister >> 28) & 0x0000000F) & 0x00000004;
+	TBool C = ((aStatusRegister >> 28) & 0x0000000F) & 0x00000002;
+	TBool V = ((aStatusRegister >> 28) & 0x0000000F) & 0x00000001;
+
+	switch(aCondition)
+		{
+		case 0:
+			return Z;
+		case 1:
+			return !Z;
+		case 2:
+			return C;
+		case 3:
+			return !C;
+		case 4:
+			return N;
+		case 5:
+			return !N;
+		case 6:
+			return V;
+		case 7:
+			return !V;
+		case 8:
+			return (C && !Z);
+		case 9:
+			return (!C || Z);
+		case 10:
+			return (N == V);
+		case 11:
+			return (N != V);
+		case 12:
+			return ((N == V) && !Z);
+		case 13:
+			return (Z || (N != V));
+		case 14:
+		case 15:
+			return ETrue;
+		}
+	
+	return EFalse;
+	}
+
+//
+// DRMDStepping::IsPreviousInstructionMovePCToLR
+//
+TBool DRMDStepping::IsPreviousInstructionMovePCToLR(DThread *aThread)
+	{
+	LOG_MSG("DRMDStepping::IsPreviousInstructionMovePCToLR()");
+
+	TInt err = KErrNone;
+	
+	// there are several types of instructions that modify the PC that aren't
+	// designated as linked or non linked branches.  the way gcc generates the
+	// code can tell us whether or not these instructions are to be treated as
+	// linked branches.  the main cases are bx and any type of mov or load or
+	// arithmatic operation that changes the PC.  if these are really just
+	// function calls that will return, gcc will generate a mov	lr, pc
+	// instruction as the previous instruction.  note that this is just for arm
+	// and armi
+	
+	// get the address of the previous instruction
+	TUint32 address = 0;
+	err = iChannel->ReadKernelRegisterValue(aThread, PC_REGISTER, address);
+	if(err != KErrNone)
+		{
+		LOG_MSG2("Non-zero error code discarded: %d", err);
+		}
+	address -= 4;
+
+	TBuf8<4> previousInstruction;
+	err = iChannel->DoReadMemory(aThread, address, 4, previousInstruction);
+	if (KErrNone != err)
+		{
+		LOG_MSG2("Error %d reading memory at address %x", address);
+		return EFalse;
+		}
+
+	const TUint32 movePCToLRIgnoringCondition = 0x01A0E00F;
+
+	TUint32 inst = *(TUint32 *)previousInstruction.Ptr();
+	
+	if ((inst & 0x0FFFFFFF) == movePCToLRIgnoringCondition)
+		{
+		return ETrue;
+		}
+		
+	return EFalse;
+	}
+
+//
+// DRMDStepping::DecodeDataProcessingInstruction
+//
+void DRMDStepping::DecodeDataProcessingInstruction(TUint8 aOpcode, TUint32 aOp1, TUint32 aOp2, TUint32 aStatusRegister, TUint32 &aBreakAddress)
+	{
+	LOG_MSG("DRMDStepping::DecodeDataProcessingInstruction()");
+
+	switch(aOpcode)
+		{
+		case 0:
+			{
+			// AND
+			aBreakAddress = aOp1 & aOp2;
+			break;
+			}
+		case 1:
+			{
+			// EOR
+			aBreakAddress = aOp1 ^ aOp2;
+			break;
+			}
+		case 2:
+			{
+			// SUB
+			aBreakAddress = aOp1 - aOp2;
+			break;
+			}
+		case 3:
+			{
+			// RSB
+			aBreakAddress = aOp2 - aOp1;
+			break;
+			}
+		case 4:
+			{
+			// ADD
+			aBreakAddress = aOp1 + aOp2;
+			break;
+			}
+		case 5:
+			{
+			// ADC
+			aBreakAddress = aOp1 + aOp2 + (aStatusRegister & arm_carry_bit()) ? 1 : 0;
+			break;
+			}
+		case 6:
+			{
+			// SBC
+			aBreakAddress = aOp1 - aOp2 - (aStatusRegister & arm_carry_bit()) ? 0 : 1;
+			break;
+			}
+		case 7:
+			{
+			// RSC
+			aBreakAddress = aOp2 - aOp1 - (aStatusRegister & arm_carry_bit()) ? 0 : 1;
+			break;
+			}
+		case 12:
+			{
+			// ORR
+			aBreakAddress = aOp1 | aOp2;
+			break;
+			}
+		case 13:
+			{
+			// MOV
+			aBreakAddress = aOp2;
+			break;
+			}
+		case 14:
+			{
+			// BIC
+			aBreakAddress = aOp1 & ~aOp2;
+			break;
+			}
+		case 15:
+			{
+			// MVN
+			aBreakAddress = ~aOp2;
+			break;
+			}
+		}
+	}
+
+//
+// DRMDStepping::CurrentInstruction
+//
+// Returns the current instruction bitpattern (either 32-bits or 16-bits) if possible
+TInt DRMDStepping::CurrentInstruction(DThread* aThread, TUint32& aInstruction)
+	{
+	LOG_MSG("DRMDStepping::CurrentInstruction");
+
+	// What is the current PC?
+	TUint32 pc;	
+	ReturnIfError(CurrentPC(aThread,pc));
+
+	// Read it one byte at a time to ensure alignment doesn't matter
+	TUint32 inst = 0;
+	for(TInt i=3;i>=0;i--)
+		{
+
+		TBuf8<1> instruction;
+		TInt err = iChannel->DoReadMemory(aThread, (pc+i), 1, instruction); 
+		if (KErrNone != err)
+			{
+			LOG_MSG2("DRMDStepping::CurrentInstruction : Failed to read memory at current PC: return 0x%08x",pc);
+			return err;
+			}
+
+		inst = (inst << 8) | (*(TUint8 *)instruction.Ptr());
+		}
+
+	aInstruction = inst;
+
+	LOG_MSG2("DRMDStepping::CurrentInstruction 0x%08x", aInstruction);
+
+	return KErrNone;
+	}
+
+//
+// DRMDStepping::CurrentArchMode
+//
+// Determines architecture mode from the supplied cpsr
+TInt DRMDStepping::CurrentArchMode(const TUint32 aCpsr, Debug::TArchitectureMode& aMode)
+	{
+// Thumb2 work will depend on having a suitable cpu architecture to compile for...
+#ifdef ECpuJf
+	// State table as per ARM ARM DDI0406A, section A.2.5.1
+	if(aCpsr & ECpuJf)
+		{
+		if (aCpsr & ECpuThumb)
+			{
+			// ThumbEE (Thumb2)
+			aMode = Debug::EThumb2EEMode;
+			}
+		else
+			{
+			// Jazelle mode - not supported
+			return KErrNotSupported;
+			}
+		}
+	else
+#endif
+		{
+		if (aCpsr & ECpuThumb)
+			{
+			// Thumb mode
+			aMode = Debug::EThumbMode;
+			}
+		else
+			{
+			// ARM mode
+			aMode = Debug::EArmMode;
+			}
+		}
+
+	return KErrNone;
+	}
+
+//
+// DRMDStepping::PCAfterInstructionExecutes
+//
+// Note, this function pretty much ignores all the arguments except for aThread.
+// The arguments continue to exist so that the function has the same prototype as
+// the original from Nokia. In the long term this function will be re-factored
+// to remove obsolete parameters.
+//
+TUint32 DRMDStepping::PCAfterInstructionExecutes(DThread *aThread, TUint32 aCurrentPC, TUint32 aStatusRegister, TInt aInstSize, /*TBool aStepInto,*/ TUint32 &aNewRangeEnd, TBool &aChangingModes)
+	{
+	LOG_MSG("DRMDStepping::PCAfterInstructionExecutes()");
+
+	// by default we will set the breakpoint at the next instruction
+	TUint32 breakAddress = aCurrentPC + aInstSize;
+
+	TInt err = KErrNone;
+
+	// determine the architecture
+	TUint32 cpuid;
+	asm("mrc p15, 0, cpuid, c0, c0, 0 ");
+	LOG_MSG2("DRMDStepping::PCAfterInstructionExecutes() - cpuid = 0x%08x\n",cpuid);
+
+	cpuid >>= 8;
+	cpuid &= 0xFF;
+
+	// determine the architecture mode for the current instruction
+	TArchitectureMode mode = EArmMode;	// Default assumption is ARM 
+
+	// Now we must examine the CPSR to read the T and J bits. See ARM ARM DDI0406A, section B1.3.3
+	TUint32 cpsr;
+
+	ReturnIfError(CurrentCPSR(aThread,cpsr));
+	LOG_MSG2("DRMDStepping::PCAfterInstructionExecutes() - cpsr = 0x%08x\n",cpsr);
+
+	// Determine the mode
+	ReturnIfError(CurrentArchMode(cpsr,mode));
+
+	// Decode instruction based on current CPU mode
+	switch(mode)
+		{
+		case Debug::EArmMode:
+			{
+			// Obtain the current instruction bit pattern
+			TUint32 inst;
+			ReturnIfError(CurrentInstruction(aThread,inst));
+			
+			LOG_MSG2("Current instruction: %x", inst);
+
+			// check the conditions to see if this will actually get executed
+			if (IsExecuted(((inst>>28) & 0x0000000F), aStatusRegister)) 
+				{
+				switch(arm_opcode(inst)) // bits 27-25
+					{
+					case 0:
+						{
+						switch((inst & 0x00000010) >> 4) // bit 4
+							{
+							case 0:
+								{
+								switch((inst & 0x01800000) >> 23) // bits 24-23
+									{
+									case 2:
+										{
+										// move to/from status register.  pc updates not allowed
+										// or TST, TEQ, CMP, CMN which don't modify the PC
+										break;
+										}
+									default:
+										{
+										// Data processing immediate shift
+										if (arm_rd(inst) == PC_REGISTER)
+											{
+											TUint32 rn = aCurrentPC + 8;
+											if (arm_rn(inst) != PC_REGISTER) // bits 19-16
+												{
+												err = iChannel->ReadKernelRegisterValue(aThread, arm_rn(inst), rn);
+												if(err != KErrNone)
+													{
+													LOG_MSG2("Non-zero error code discarded: %d", err);
+													}
+												}
+
+											TUint32 shifter = ShiftedRegValue(aThread, inst, aCurrentPC, aStatusRegister);
+
+											DecodeDataProcessingInstruction(((inst & 0x01E00000) >> 21), rn, shifter, aStatusRegister, breakAddress);
+											}
+										break;
+										}
+									}
+								break;
+								}
+							case 1:
+								{
+								switch((inst & 0x00000080) >> 7) // bit 7
+									{
+									case 0:
+										{
+										switch((inst & 0x01900000) >> 20) // bits 24-23 and bit 20
+											{
+											case 0x10:
+												{
+												// from figure 3-3
+												switch((inst & 0x000000F0) >> 4) // bits 7-4
+													{
+													case 1:
+														{
+														if (((inst & 0x00400000) >> 22) == 0) // bit 22
+															{
+															// BX
+															// this is a strange case.  normally this is used in the epilogue to branch the the link
+															// register.  sometimes it is used to call a function, and the LR is stored in the previous
+															// instruction.  since what we want to do is different for the two cases when stepping over,
+															// we need to read the previous instruction to see what we should do
+															err = iChannel->ReadKernelRegisterValue(aThread, (inst & 0x0000000F), breakAddress);
+															if(err != KErrNone)
+																{
+																LOG_MSG2("Non-zero error code discarded: %d", err);
+																}
+
+															if ((breakAddress & 0x00000001) == 1)
+																{
+																aChangingModes = ETrue;
+																}
+
+															breakAddress &= 0xFFFFFFFE;
+															}
+														break;
+														}
+													case 3:
+														{
+														// BLX
+															{
+															err = iChannel->ReadKernelRegisterValue(aThread, (inst & 0x0000000F), breakAddress);
+															if(err != KErrNone)
+																{
+																LOG_MSG2("Non-zero error code discarded: %d", err);
+																}
+
+															if ((breakAddress & 0x00000001) == 1)
+																{
+																aChangingModes = ETrue;
+																}
+															
+															breakAddress &= 0xFFFFFFFE;
+															}
+														break;
+														}
+													default:
+														{
+														// either doesn't modify the PC or it is illegal to
+														break;
+														}
+													}
+												break;
+												}
+											default:
+												{
+												// Data processing register shift
+												if (((inst & 0x01800000) >> 23) == 2) // bits 24-23
+													{
+													// TST, TEQ, CMP, CMN don't modify the PC
+													}
+												else if (arm_rd(inst) == PC_REGISTER)
+													{
+													// destination register is the PC
+													TUint32 rn = aCurrentPC + 8;
+													if (arm_rn(inst) != PC_REGISTER) // bits 19-16
+														{
+														err = iChannel->ReadKernelRegisterValue(aThread, arm_rn(inst), rn);
+														if(err != KErrNone)
+															{
+															LOG_MSG2("Non-zero error code discarded: %d", err);
+															}
+														}
+													
+													TUint32 shifter = ShiftedRegValue(aThread, inst, aCurrentPC, aStatusRegister);
+													
+													DecodeDataProcessingInstruction(((inst & 0x01E00000) >> 21), rn, shifter, aStatusRegister, breakAddress);
+													}
+												break;
+												}
+											}
+										break;
+										}
+									default:
+										{
+										// from figure 3-2, updates to the PC illegal
+										break;
+										}
+									}
+								break;
+								}
+							}
+						break;
+						}
+					case 1:
+						{
+						if (((inst & 0x01800000) >> 23) == 2) // bits 24-23
+							{
+							// cannot modify the PC
+							break;
+							}
+						else if (arm_rd(inst) == PC_REGISTER)
+							{
+							// destination register is the PC
+							TUint32 rn;
+							err = iChannel->ReadKernelRegisterValue(aThread, arm_rn(inst), rn); // bits 19-16
+							if(err != KErrNone)
+								{
+								LOG_MSG2("Non-zero error code discarded: %d", err);
+								}
+							TUint32 shifter = ((arm_data_imm(inst) >> arm_data_rot(inst)) | (arm_data_imm(inst) << (32 - arm_data_rot(inst)))) & 0xffffffff;
+
+							DecodeDataProcessingInstruction(((inst & 0x01E00000) >> 21), rn, shifter, aStatusRegister, breakAddress);
+							}
+						break;
+						}
+					case 2:
+						{
+						// load/store immediate offset
+						if (arm_load(inst)) // bit 20
+							{
+							// loading a register from memory
+							if (arm_rd(inst) == PC_REGISTER)
+								{
+								// loading the PC register
+								TUint32 base;
+								err = iChannel->ReadKernelRegisterValue(aThread, arm_rn(inst), base);
+								if(err != KErrNone)
+									{
+									LOG_MSG2("Non-zero error code discarded: %d", err);
+									}
+
+								/* Note: At runtime the PC would be 8 further on
+								 */
+								if (arm_rn(inst) == PC_REGISTER)
+									{
+									base = aCurrentPC + 8;
+									}
+
+								TUint32 offset = 0;
+
+								if (arm_single_pre(inst))
+									{
+									// Pre-indexing
+									offset = arm_single_imm(inst);
+
+									if (arm_single_u(inst))
+										{
+										base += offset;
+										}
+									else
+										{
+										base -= offset;
+										}
+									}
+
+								TBuf8<4> destination;
+								err = iChannel->DoReadMemory(aThread, base, 4, destination);
+								
+								if (KErrNone == err)
+									{
+									breakAddress = *(TUint32 *)destination.Ptr();
+
+									if ((breakAddress & 0x00000001) == 1)
+										{
+										aChangingModes = ETrue;
+										}
+									breakAddress &= 0xFFFFFFFE;
+									}
+								else
+									{
+									LOG_MSG("Error reading memory in decoding step instruction");
+									}
+								}
+							}
+						break;
+						}
+					case 3:
+						{
+						if (((inst & 0xF0000000) != 0xF0000000) && ((inst & 0x00000010) == 0))
+							{
+							// load/store register offset
+							if (arm_load(inst)) // bit 20
+								{
+								// loading a register from memory
+								if (arm_rd(inst) == PC_REGISTER)
+									{
+									// loading the PC register
+									TUint32 base = 0;
+									if(arm_rn(inst) == PC_REGISTER)
+										{
+										base = aCurrentPC + 8;
+										}
+									else
+										{
+										err = iChannel->ReadKernelRegisterValue(aThread, arm_rn(inst), base);
+										if(err != KErrNone)
+											{
+											LOG_MSG2("Non-zero error code discarded: %d", err);
+											}
+										}
+
+									TUint32 offset = 0;
+
+									if (arm_single_pre(inst))
+										{
+										offset = ShiftedRegValue(aThread, inst, aCurrentPC, aStatusRegister);
+
+										if (arm_single_u(inst))
+											{
+											base += offset;
+											}
+										else
+											{
+											base -= offset;
+											}
+										}
+
+									TBuf8<4> destination;
+									err = iChannel->DoReadMemory(aThread, base, 4, destination);
+
+									if (KErrNone == err)
+										{
+										breakAddress = *(TUint32 *)destination.Ptr();
+
+										if ((breakAddress & 0x00000001) == 1)
+											{
+											aChangingModes = ETrue;
+											}
+										breakAddress &= 0xFFFFFFFE;
+										}
+									else
+										{
+										LOG_MSG("Error reading memory in decoding step instruction");
+										}
+									}
+								}
+							}
+						break;
+						}
+					case 4:
+						{
+						if ((inst & 0xF0000000) != 0xF0000000)
+							{
+							// load/store multiple
+							if (arm_load(inst)) // bit 20
+								{
+								// loading a register from memory
+								if (((inst & 0x00008000) >> 15))
+									{
+									// loading the PC register
+									TInt offset = 0;	
+									if (arm_block_u(inst))
+										{
+										TUint32 reglist = arm_block_reglist(inst);
+										offset = iChannel->Bitcount(reglist) * 4 - 4;
+										if (arm_block_pre(inst))
+											offset += 4;
+										}
+									else if (arm_block_pre(inst))
+										{
+										offset = -4;
+										}
+
+									TUint32 temp = 0;
+									err = iChannel->ReadKernelRegisterValue(aThread, arm_rn(inst), temp);
+									if(err != KErrNone)
+										{
+										LOG_MSG2("Non-zero error code discarded: %d", err);
+										}
+
+									temp += offset;
+
+									TBuf8<4> destination;
+									err = iChannel->DoReadMemory(aThread, temp, 4, destination);
+
+									if (KErrNone == err)
+										{
+										breakAddress = *(TUint32 *)destination.Ptr();
+										if ((breakAddress & 0x00000001) == 1)
+											{
+											aChangingModes = ETrue;
+											}
+										breakAddress &= 0xFFFFFFFE;
+										}
+									else
+										{
+										LOG_MSG("Error reading memory in decoding step instruction");
+										}
+									}
+								}
+							}
+						break;
+						}
+					case 5:
+						{
+						if ((inst & 0xF0000000) == 0xF0000000)
+							{
+							// BLX
+							breakAddress = (TUint32)arm_instr_b_dest(inst, aCurrentPC);
+
+							// Unconditionally change into Thumb mode
+							aChangingModes = ETrue;
+							breakAddress &= 0xFFFFFFFE;
+							}
+						else
+							{
+							if ((inst & 0x01000000)) // bit 24
+								{
+								// BL
+									breakAddress = (TUint32)arm_instr_b_dest(inst, aCurrentPC);
+								}
+							else
+								{
+								// B
+								breakAddress = (TUint32)arm_instr_b_dest(inst, aCurrentPC);
+								}
+							}
+						break;
+						} // case 5
+					} //switch(arm_opcode(inst)) // bits 27-25
+				} // if (IsExecuted(((inst>>28) & 0x0000000F), aStatusRegister)) 
+			} // case Debug::EArmMode:
+		break;
+
+		case Debug::EThumbMode:
+			{
+			// Thumb Mode
+			//
+			// Notes: This now includes the extra code
+			// required to decode V6T2 instructions
+			
+			LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Thumb Instruction");
+
+			TUint16 inst;
+
+			// Obtain the current instruction bit pattern
+			TUint32 inst32;
+			ReturnIfError(CurrentInstruction(aThread,inst32));
+
+			inst = static_cast<TUint16>(inst32 & 0xFFFF);
+
+			LOG_MSG2("Current Thumb instruction: 0x%x", inst);
+
+			// v6T2 instructions
+
+			// Note: v6T2 decoding is only enabled for DEBUG builds or if using an
+			// an ARM_V6T2 supporting build system. At the time of writing, no
+			// ARM_V6T2 supporting build system exists, so the stepping code cannot
+			// be said to be known to work. Hence it is not run for release builds
+
+			TBool use_v6t2_decodings = EFalse;
+
+#if defined(DEBUG) || defined(__ARMV6T2__)
+			use_v6t2_decodings = ETrue;
+#endif
+			// coverity[dead_error_line]
+			if (use_v6t2_decodings)
+				{
+				// 16-bit encodings
+
+				// A6.2.5 Misc 16-bit instructions
+				// DONE Compare and branch on zero (page A8-66)
+				// If then hints
+
+				// ARM ARM DDI0406A - section A8.6.27 CBNZ, CBZ
+				//
+				// Compare and branch on Nonzero and Compare and Branch on Zero.
+				if ((inst & 0xF500) == 0xB100)
+					{
+					LOG_MSG("ARM ARM DDI0406A - section A8.6.27 CBNZ, CBZ");
+
+					// Decoding as per ARM ARM description
+					TUint32 op = (inst & 0x0800) >> 11;
+					TUint32 i = (inst & 0x0200) >> 9;
+					TUint32 imm5 = (inst & 0x00F8) >> 3;
+					TUint32 Rn = inst & 0x0007;
+
+					TUint32 imm32 = (i << 6) | (imm5 << 1);
+
+					// Obtain value for register Rn
+					TUint32 RnVal = 0;
+					ReturnIfError(RegisterValue(aThread,Rn,RnVal));
+
+					if (op)
+						{
+						// nonzero
+						if (RnVal != 0x0)
+							{
+							// Branch
+							breakAddress = aCurrentPC + imm32;
+							}
+						}
+					else
+						{
+						// zero
+						if (RnVal == 0x0)
+							{
+							// Branch
+							breakAddress = aCurrentPC + imm32;
+							}
+						}
+				}
+
+				// ARM ARM DDI0406A - section A8.6.50 IT
+				//
+				// If Then instruction
+				if ((inst & 0xFF00) == 0xBF00)
+					{
+					LOG_MSG("ARM ARM DDI0406A - section A8.6.50 IT");
+
+					// Decoding as per ARM ARM description
+					TUint32 firstcond = inst & 0x00F0 >> 4;
+					TUint32 mask = inst & 0x000F;
+
+					if (firstcond == 0xF)
+						{
+						// unpredictable
+						LOG_MSG("ARM ARM DDI0406A - section A8.6.50 IT - Unpredictable");
+						break;
+						}
+
+					if ((firstcond == 0xE) && (BitCount(mask) != 1))
+						{
+						// unpredictable
+						LOG_MSG("ARM ARM DDI0406A - section A8.6.50 IT - Unpredictable");
+						break;
+						}
+
+					// should check if 'in-it-block'
+					LOG_MSG("Cannot step IT instructions.");
+
+					// all the conds are as per Table A8-1 (i.e. the usual 16 cases)
+					// no idea how to decode the it block 'after-the-fact'
+					// so probably need to treat instructions in the it block
+					// as 'may' be executed. So breakpoints at both possible locations
+					// depending on whether the instruction is executed or not.
+
+					// also, how do we know if we have hit a breakpoint whilst 'in' an it block?
+					// can we check the status registers to find out?
+					//
+					// see arm arm page 390.
+					//
+					// seems to depend on the itstate field. this also says what the condition code
+					// actually is, and how many instructions are left in the itblock.
+					// perhaps we can just totally ignore this state, and always do the two-instruction
+					// breakpoint thing? Not if there is any possibility that the address target
+					// would be invalid for the non-taken branch address...
+					}
+
+
+				// 32-bit encodings.
+				//
+
+				// Load word A6-23
+				// Data processing instructions a6-28
+				// 
+
+				// ARM ARM DDI0406A - section A8.6.26
+				if (inst32 & 0xFFF0FFFF == 0xE3C08F00)
+					{
+					LOG_MSG("ARM ARM DDI0406A - section A8.6.26 - BXJ is not supported");
+
+					// Decoding as per ARM ARM description
+					// TUint32 Rm = inst32 & 0x000F0000;	// not needed yet
+					}
+
+				// return from exception... SUBS PC,LR. page b6-25
+				//
+				// ARM ARM DDi046A - section B6.1.13 - SUBS PC,LR
+				//
+				// Encoding T1
+				if (inst32 & 0xFFFFFF00 == 0xF3DE8F00)
+					{
+					LOG_MSG("ARM ARM DDI0406A - section B6.1.13 - SUBS PC,LR Encoding T1");
+
+					// Decoding as per ARM ARM description
+					TUint32 imm8 = inst32 & 0x000000FF;
+					TUint32 imm32 = imm8;
+
+					// TUint32 register_form = EFalse;	// not needed for this decoding
+					// TUint32 opcode = 0x2;	// SUB	// not needed for this decoding
+					TUint32 n = 14;
+
+					// Obtain LR
+					TUint32 lrVal;
+					ReturnIfError(RegisterValue(aThread,n,lrVal));
+
+					TUint32 operand2 = imm32;	// always for Encoding T1
+					
+					TUint32 result = lrVal - operand2;
+					
+					breakAddress = result;
+					}
+
+				// ARM ARM DDI0406A - section A8.6.16 - B
+				//
+				// Branch Encoding T3
+				if (inst32 & 0xF800D000 == 0xF0008000)
+					{
+					LOG_MSG("ARM ARM DDI0406A - section A8.6.16 - B Encoding T3");
+
+					// Decoding as per ARM ARM description
+					TUint32 S = inst32 & 0x04000000 >> 26;
+					// TUint32 cond = inst32 & 0x03C00000 >> 22;	// not needed for this decoding
+					TUint32 imm6 = inst32 & 0x003F0000 >> 16;
+					TUint32 J1 = inst32 & 0x00002000 >> 13;
+					TUint32 J2 = inst32 & 0x00000800 >> 11;
+					TUint32 imm11 = inst32 & 0x000007FF;
+
+					TUint32 imm32 = S ? 0xFFFFFFFF : 0 ;
+					imm32 = (imm32 << 1) | J2;
+					imm32 = (imm32 << 1) | J1;
+					imm32 = (imm32 << 6) | imm6;
+					imm32 = (imm32 << 11) | imm11;
+					imm32 = (imm32 << 1) | 0;
+
+					breakAddress = aCurrentPC + imm32;
+					}
+
+				// ARM ARM DDI0406A - section A8.6.16 - B
+				//
+				// Branch Encoding T4
+				if (inst32 & 0xF800D000 == 0xF0009000)
+					{
+					LOG_MSG("ARM ARM DDI0406A - section A8.6.16 - B");
+
+					// Decoding as per ARM ARM description
+					TUint32 S = inst32 & 0x04000000 >> 26;
+					TUint32 imm10 = inst32 & 0x03FF0000 >> 16;
+					TUint32 J1 = inst32 & 0x00002000 >> 12;
+					TUint32 J2 = inst32 & 0x00000800 >> 11;
+					TUint32 imm11 = inst32 & 0x000003FF;
+
+					TUint32 I1 = !(J1 ^ S);
+					TUint32 I2 = !(J2 ^ S);
+
+					TUint32 imm32 = S ? 0xFFFFFFFF : 0;
+					imm32 = (imm32 << 1) | S;
+					imm32 = (imm32 << 1) | I1;
+					imm32 = (imm32 << 1) | I2;
+					imm32 = (imm32 << 10) | imm10;
+					imm32 = (imm32 << 11) | imm11;
+					imm32 = (imm32 << 1) | 0;
+
+					breakAddress = aCurrentPC + imm32;
+					}
+
+
+				// ARM ARM DDI0406A - section A8.6.225 - TBB, TBH
+				//
+				// Table Branch Byte, Table Branch Halfword
+				if (inst32 & 0xFFF0FFE0 == 0xE8D0F000)
+						{
+					LOG_MSG("ARM ARM DDI0406A - section A8.6.225 TBB,TBH Encoding T1");
+
+					// Decoding as per ARM ARM description
+					TUint32 Rn = inst32 & 0x000F0000 >> 16;
+					TUint32 H = inst32 & 0x00000010 >> 4;
+					TUint32 Rm = inst32 & 0x0000000F;
+
+					// Unpredictable?
+					if (Rm == 13 || Rm == 15)
+						{
+						LOG_MSG("ARM ARM DDI0406A - section A8.6.225 TBB,TBH Encoding T1 - Unpredictable");
+						break;
+						}
+
+					TUint32 halfwords;
+					TUint32 address;
+					ReturnIfError(RegisterValue(aThread,Rn,address));
+
+					TUint32 offset;
+					ReturnIfError(RegisterValue(aThread,Rm,offset));
+
+					if (H)
+						{
+						address += offset << 1;
+						}
+					else
+						{
+						address += offset;
+						}
+
+					ReturnIfError(ReadMem32(aThread,address,halfwords));
+
+					breakAddress = aCurrentPC + 2*halfwords;
+					break;
+					}
+
+				// ARM ARM DDI0406A - section A8.6.55 - LDMDB, LDMEA
+				//
+				// LDMDB Encoding T1
+				if (inst32 & 0xFFD02000 == 0xE9100000)
+					{
+					LOG_MSG("ARM ARM DDI0406 - section A8.6.55 LDMDB Encoding T1");
+
+					// Decoding as per ARM ARM description
+					// TUint32 W = inst32 & 0x00200000 >> 21;	// Not needed for this encoding
+					TUint32 Rn = inst32 & 0x000F0000 >> 16;
+					TUint32 P = inst32 & 0x00008000 >> 15;
+					TUint32 M = inst32 & 0x00004000 >> 14;
+					TUint32 registers = inst32 & 0x00001FFF;
+
+					//TBool wback = (W == 1);	// not needed for this encoding
+
+					// Unpredictable?
+					if (Rn == 15 || BitCount(registers) < 2 || ((P == 1) && (M==1)))
+						{
+						LOG_MSG("ARM ARM DDI0406 - section A8.6.55 LDMDB Encoding T1 - Unpredictable");
+						break;
+						}
+
+					TUint32 address;
+					ReturnIfError(RegisterValue(aThread,Rn,address));
+
+					address -= 4*BitCount(registers);
+
+					for(TInt i=0; i<15; i++)
+						{
+						if (IsBitSet(registers,i))
+							{
+							address +=4;
+							}
+						}
+
+					if (IsBitSet(registers,15))
+						{
+						TUint32 RnVal = 0;
+						ReturnIfError(ReadMem32(aThread,address,RnVal));
+
+						breakAddress = RnVal;
+						}
+					break;
+					}
+
+				// ARM ARM DDI0406A - section A8.6.121 POP
+				//
+				// POP.W Encoding T2
+				if (inst32 & 0xFFFF2000 == 0xE8BD0000)
+					{
+					LOG_MSG("ARM ARM DDI0406A - section A8.6.121 POP Encoding T2");
+
+					// Decoding as per ARM ARM description
+					TUint32 registers = inst32 & 0x00001FFF;
+					TUint32 P = inst32 & 0x00008000;
+					TUint32 M = inst32 & 0x00004000;
+
+					// Unpredictable?
+					if ( (BitCount(registers)<2) || ((P == 1)&&(M == 1)) )
+						{
+						LOG_MSG("ARM ARM DDI0406A - section A8.6.121 POP Encoding T2 - Unpredictable");
+						break;
+						}
+
+					TUint32 address;
+					ReturnIfError(RegisterValue(aThread,13,address));
+					
+					for(TInt i=0; i< 15; i++)
+						{
+						if (IsBitSet(registers,i))
+							{
+							address += 4;
+							}
+						}
+
+					// Is the PC written?
+					if (IsBitSet(registers,15))
+						{
+						// Yes
+						ReturnIfError(ReadMem32(aThread,address,breakAddress));
+						}
+					}
+
+				// POP Encoding T3
+				if (inst32 & 0xFFFF0FFFF == 0xF85D0B04)
+					{
+					LOG_MSG("ARM ARM DDI0406A - section A8.6.121 POP Encoding T3");
+
+					// Decoding as per ARM ARM description
+					TUint32 Rt = inst32 & 0x0000F000 >> 12;
+					TUint32 registers = 1 << Rt;
+
+					// Unpredictable?
+					if (Rt == 13 || Rt == 15)
+						{
+						LOG_MSG("ARM ARM DDI0406A - section A8.6.121 POP Encoding T3 - Unpredictable");
+						break;
+						}
+					
+					TUint32 address;
+					ReturnIfError(RegisterValue(aThread,13,address));
+					
+					for(TInt i=0; i< 15; i++)
+						{
+						if (IsBitSet(registers,i))
+							{
+							address += 4;
+							}
+						}
+
+					// Is the PC written?
+					if (IsBitSet(registers,15))
+						{
+						// Yes
+						ReturnIfError(ReadMem32(aThread,address,breakAddress));
+						}
+
+					break;
+					}
+
+				// ARM ARM DDI0406A - section A8.6.53 LDM
+				//
+				// Load Multiple Encoding T2 
+				if ((inst32 & 0xFFD02000) == 0xE8900000)
+					{
+					LOG_MSG("ARM ARM DDI0406A - section A8.6.53 LDM Encoding T2");
+
+					// Decoding as per ARM ARM description
+					TUint32 W = inst32 & 0x0020000 >> 21;
+					TUint32 Rn = inst32 & 0x000F0000 >> 16;
+					TUint32 P = inst32 & 0x00008000 >> 15;
+					TUint32 M = inst32 & 0x00004000 >> 14;
+					TUint32 registers = inst32 & 0x0000FFFF;
+					TUint32 register_list = inst32 & 0x00001FFF;
+				
+					// POP?
+					if ( (W == 1) && (Rn == 13) )
+						{
+						// POP instruction
+						LOG_MSG("ARM ARM DDI0406A - section A8.6.53 LDM Encoding T2 - POP");
+						}
+
+					// Unpredictable?
+					if (Rn == 15 || BitCount(register_list) < 2 || ((P == 1) && (M == 1)) )
+						{
+						LOG_MSG("ARM ARM DDI0406A - section A8.6.53 LDM Encoding T2 - Unpredictable");
+						break;
+						}
+					
+					TUint32 RnVal;
+					ReturnIfError(RegisterValue(aThread,Rn,RnVal));
+
+					TUint32 address = RnVal;
+
+					// Calculate offset of address
+					for(TInt i = 0; i < 15; i++)
+						{
+						if (IsBitSet(registers,i))
+						{
+							address += 4;
+						}
+						}
+
+					// Does it load the PC?
+					if (IsBitSet(registers,15))
+						{
+						// Obtain the value loaded into the PC
+						ReturnIfError(ReadMem32(aThread,address,breakAddress));
+						}
+					break;
+
+					}
+
+				// ARM ARM DDI0406A - section B6.1.8 RFE
+				//
+				// Return From Exception Encoding T1 RFEDB
+				if ((inst32 & 0xFFD0FFFF) == 0xE810C000)
+					{
+					LOG_MSG("ARM ARM DDI0406A - section B6.1.8 RFE Encoding T1");
+
+					// Decoding as per ARM ARM description
+					// TUint32 W = (inst32 & 0x00200000) >> 21;	// not needed for this encoding
+					TUint32 Rn = (inst32 & 0x000F0000) >> 16;
+					
+					// TBool wback = (W == 1);	// not needed for this encoding
+					TBool increment = EFalse;
+					TBool wordhigher = EFalse;
+
+					// Do calculation
+					if (Rn == 15)
+						{
+						// Unpredictable 
+						LOG_MSG("ARM ARM DDI0406A - section B6.1.8 RFE Encoding T1 - Unpredictable");
+						break;
+						}
+
+					TUint32 RnVal = 0;
+					ReturnIfError(RegisterValue(aThread,Rn,RnVal));
+
+					TUint32 address = 0;
+					ReturnIfError(ReadMem32(aThread,RnVal,address));
+
+					if (increment)
+						{
+						address -= 8;
+						}
+
+					if (wordhigher)
+						{
+						address += 4;
+						}
+
+					breakAddress = address;
+					break;
+					}
+
+				// Return From Exception Encoding T2 RFEIA
+				if ((inst32 & 0xFFD0FFFF) == 0xE990C000)
+					{
+					LOG_MSG("ARM ARM DDI0406A - section B6.1.8 RFE Encoding T2");
+
+					// Decoding as per ARM ARM description
+					// TUint32 W = (inst32 & 0x00200000) >> 21;	// not needed for this encoding
+					TUint32 Rn = (inst32 & 0x000F0000) >> 16;
+					
+					// TBool wback = (W == 1);	// not needed for this encoding
+					TBool increment = ETrue;
+					TBool wordhigher = EFalse;
+
+					// Do calculation
+					if (Rn == 15)
+						{
+						// Unpredictable 
+						LOG_MSG("ARM ARM DDI0406A - section B6.1.8 RFE Encoding T2 - Unpredictable");
+						break;
+						}
+
+					TUint32 RnVal = 0;
+					ReturnIfError(RegisterValue(aThread,Rn,RnVal));
+
+					TUint32 address = 0;
+					ReturnIfError(ReadMem32(aThread,RnVal,address));
+
+					if (increment)
+						{
+						address -= 8;
+						}
+
+					if (wordhigher)
+						{
+						address += 4;
+						}
+
+					breakAddress = RnVal;
+					break;
+					}
+
+				// Return From Exception Encoding A1 RFE<amode>
+				if ((inst32 & 0xFE50FFFF) == 0xF8100A00)
+					{
+					LOG_MSG("ARM ARM DDI0406A - section B6.1.8 RFE Encoding A1");
+
+					// Decoding as per ARM ARM description
+					TUint32 P = (inst32 & 0x01000000) >> 24;
+					TUint32 U = (inst32 & 0x00800000) >> 23;
+					// TUint32 W = (inst32 & 0x00200000) >> 21; // not needed for this encoding
+					TUint32 Rn = (inst32 & 0x000F0000) >> 16;	
+					
+					// TBool wback = (W == 1);	// not needed for this encoding
+					TBool increment = (U == 1);
+					TBool wordhigher = (P == U);
+
+					// Do calculation
+					if (Rn == 15)
+						{
+						// Unpredictable 
+						LOG_MSG("ARM ARM DDI0406A - section B6.1.8 RFE Encoding A1 - Unpredictable");
+						break;
+						}
+
+					TUint32 RnVal = 0;
+					ReturnIfError(RegisterValue(aThread,Rn,RnVal));
+
+					TUint32 address = 0;
+					ReturnIfError(ReadMem32(aThread,RnVal,address));
+
+					if (increment)
+						{
+						address -= 8;
+						}
+
+					if (wordhigher)
+						{
+						address += 4;
+						}
+
+					breakAddress = address;
+					break;
+					}
+				}
+
+			// v4T/v5T/v6T instructions
+			switch(thumb_opcode(inst))
+				{
+				case 0x08:
+					{
+					// Data-processing. See ARM ARM DDI0406A, section A6-8, A6.2.2.
+
+					if ((thumb_inst_7_15(inst) == 0x08F))
+						{
+						// BLX(2)
+						err = iChannel->ReadKernelRegisterValue(aThread, ((inst & 0x0078) >> 3), breakAddress);
+						if(err != KErrNone)
+							{
+							LOG_MSG2("Non-zero error code discarded: %d", err);
+							}
+
+						if ((breakAddress & 0x00000001) == 0)
+							{
+							aChangingModes = ETrue;
+							}
+
+						breakAddress &= 0xFFFFFFFE;
+
+						// Report how we decoded this instruction
+						LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Decoded as BLX (2)");
+						}
+					else if (thumb_inst_7_15(inst) == 0x08E)
+						{
+						// BX
+						err = iChannel->ReadKernelRegisterValue(aThread, ((inst & 0x0078) >> 3), breakAddress);
+						if(err != KErrNone)
+							{
+							LOG_MSG2("Non-zero error code discarded: %d", err);
+							}
+
+						if ((breakAddress & 0x00000001) == 0)
+							{
+							aChangingModes = ETrue;
+							}
+						
+						breakAddress &= 0xFFFFFFFE;
+
+						// Report how we decoded this instruction
+						LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Decoded as BX");
+						}
+					else if ((thumb_inst_8_15(inst) == 0x46) && ((inst & 0x87) == 0x87))
+						{
+						// MOV with PC as the destination
+						err = iChannel->ReadKernelRegisterValue(aThread, ((inst & 0x0078) >> 3), breakAddress);
+						if(err != KErrNone)
+							{
+							LOG_MSG2("Non-zero error code discarded: %d", err);
+							}
+
+						// Report how we decoded this instruction
+						LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Decoded as MOV with PC as the destination");
+						}
+					else if ((thumb_inst_8_15(inst) == 0x44) && ((inst & 0x87) == 0x87))
+						{
+						// ADD with PC as the destination
+						err = iChannel->ReadKernelRegisterValue(aThread, ((inst & 0x0078) >> 3), breakAddress);
+						if(err != KErrNone)
+							{
+							LOG_MSG2("Non-zero error code discarded: %d", err);
+							}
+						breakAddress += aCurrentPC + 4; // +4 because we need to use the PC+4 according to ARM ARM DDI0406A, section A6.1.2.
+
+						// Report how we decoded this instruction
+						LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Decoded as ADD with PC as the destination");
+						}
+					break;
+					}
+				case 0x13:
+					{
+					// Load/Store single data item. See ARM ARM DDI0406A, section A6-10
+
+					//This instruction doesn't modify the PC.
+
+					//if (thumb_inst_8_15(inst) == 0x9F)
+					//{
+						// LDR(4) with the PC as the destination
+					//	breakAddress = ReadRegister(aThread, SP_REGISTER) + (4 * (inst & 0x00FF));
+					//}
+
+					// Report how we decoded this instruction
+					LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Decoded as This instruction doesn't modify the PC.");
+					break;
+					}
+				case 0x17:
+					{
+					// Misc 16-bit instruction. See ARM ARM DDI0406A, section A6-11
+
+					if (thumb_inst_8_15(inst) == 0xBD)
+						{
+						// POP with the PC in the list
+						TUint32 regList = (inst & 0x00FF);
+						TInt offset = 0;
+						err = iChannel->ReadKernelRegisterValue(aThread,  SP_REGISTER, (T4ByteRegisterValue&)offset);
+						if(err != KErrNone)
+							{
+							LOG_MSG2("Non-zero error code discarded: %d", err);
+							}
+						offset += (iChannel->Bitcount(regList) * 4);
+
+						TBuf8<4> destination;
+						err = iChannel->DoReadMemory(aThread, offset, 4, destination);
+						
+						if (KErrNone == err)
+							{
+							breakAddress = *(TUint32 *)destination.Ptr();
+
+							if ((breakAddress & 0x00000001) == 0)
+								{
+								aChangingModes = ETrue;
+								}
+
+							breakAddress &= 0xFFFFFFFE;
+							}
+						else
+							{
+							LOG_MSG("Error reading memory in decoding step instruction");
+							}
+
+						// Report how we decoded this instruction
+						LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Decoded as POP with the PC in the list");
+						}
+					break;
+					}
+				case 0x1A:
+				case 0x1B:
+					{
+					// Conditional branch, and supervisor call. See ARM ARM DDI0406A, section A6-13
+
+					if (thumb_inst_8_15(inst) < 0xDE)
+						{
+						// B(1) conditional branch
+						if (IsExecuted(((inst & 0x0F00) >> 8), aStatusRegister))
+							{
+							TUint32 offset = ((inst & 0x000000FF) << 1);
+							if (offset & 0x00000100)
+								{
+								offset |= 0xFFFFFF00;
+								}
+							
+							breakAddress = aCurrentPC + 4 + offset;
+
+							// Report how we decoded this instruction
+							LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Decoded as B(1) conditional branch");
+							}
+						}
+					break;
+					}
+				case 0x1C:
+					{
+					// Unconditional branch, See ARM ARM DDI0406A, section A8-44.
+
+					// B(2) unconditional branch
+					TUint32 offset = (inst & 0x000007FF) << 1;
+					if (offset & 0x00000800)
+						{
+						offset |= 0xFFFFF800;
+						}
+					
+					breakAddress = aCurrentPC + 4 + offset;
+
+					// Report how we decoded this instruction
+					LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Decoded as B(2) unconditional branch");
+
+					break;
+					}
+				case 0x1D:
+					{
+					if (!(inst & 0x0001))
+						{
+						// BLX(1)
+						err = iChannel->ReadKernelRegisterValue(aThread, LINK_REGISTER, breakAddress);
+						if(err != KErrNone)
+							{
+							LOG_MSG2("Non-zero error code discarded: %d", err);
+							}
+						breakAddress +=  ((inst & 0x07FF) << 1);
+						if ((breakAddress & 0x00000001) == 0)
+							{
+							aChangingModes = ETrue;
+							}
+
+						breakAddress &= 0xFFFFFFFC;
+
+						// Report how we decoded this instruction
+						LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Decoded as BLX(1)");
+
+						}
+					break;
+					}
+				case 0x1E:
+					{
+					// Check for ARMv7 CPU
+					if(cpuid == 0xC0)
+						{
+						// BL/BLX 32-bit instruction
+						aNewRangeEnd += 4;
+
+						breakAddress = (TUint32)thumb_instr_b_dest(inst32, aCurrentPC);
+
+						if((inst32 >> 27) == 0x1D)
+							{
+							// BLX(1)
+							if ((breakAddress & 0x00000001) == 0)
+								{
+								aChangingModes = ETrue;
+								}
+
+							breakAddress &= 0xFFFFFFFC;
+
+							// Report how we decoded this instruction
+							LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Decoded as 32-bit BLX(1)");
+							}
+						else
+							{
+							// Report how we decoded this instruction
+							LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: 32-bit BL instruction");
+							}
+						LOG_MSG2(" 32-bit BL/BLX instruction: breakAddress = 0x%X", breakAddress);
+						} // if(cpuid == 0xC0)
+					else
+						{
+						// BL/BLX prefix - destination is encoded in this and the next instruction
+						aNewRangeEnd += 2;
+
+						// Report how we decoded this instruction
+						LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: BL/BLX prefix - destination is encoded in this and the next instruction");
+						}
+
+					break;
+					}
+				case 0x1F:
+					{
+					// BL
+					err = iChannel->ReadKernelRegisterValue(aThread, LINK_REGISTER, breakAddress);
+					if(err != KErrNone)
+						{
+						LOG_MSG2("Non-zero error code discarded: %d", err);
+						}
+					breakAddress += ((inst & 0x07FF) << 1);
+
+					// Report how we decoded this instruction
+					LOG_MSG("DRMDStepping::PCAfterInstructionExecutes: Decoded as BL");
+					break;
+					}
+				default:
+					{
+					// Don't know any better at this point!
+					LOG_MSG("DRMDStepping::PCAfterInstructionExecutes:- default to next instruction");
+					}
+					break;
+				} // switch(thumb_opcode(inst))
+			} // case Debug::EThumbMode:
+		break;
+
+		case Debug::EThumb2EEMode:
+			{
+			// Not yet supported
+			LOG_MSG("DRMDStepping::PCAfterInstructionExecutes - Debug::EThumb2Mode is not supported");
+
+			}
+			break;
+
+		default:
+			LOG_MSG("DRMDStepping::PCAfterInstructionExecutes - Cannot determine CPU mode architecture");
+		} // switch(mode)
+
+	LOG_MSG2("DRMDStepping::PCAfterInstructionExecutes : return 0x%08x",breakAddress);
+	return breakAddress;
+	}
+
+// Obtain a 32-bit memory value with minimum fuss
+TInt DRMDStepping::ReadMem32(DThread* aThread, const TUint32 aAddress, TUint32& aValue)
+	{
+	TBuf8<4> valBuf;
+	TInt err = iChannel->DoReadMemory(aThread, aAddress, 4, valBuf);
+	if (err != KErrNone)
+		{
+		LOG_MSG2("DRMDStepping::ReadMem32 failed to read memory at 0x%08x", aAddress);
+		return err;
+		}
+
+	aValue = *(TUint32 *)valBuf.Ptr();
+
+	return KErrNone;
+	}
+
+// Obtain a 16-bit memory value with minimum fuss
+TInt DRMDStepping::ReadMem16(DThread* aThread, const TUint32 aAddress, TUint16& aValue)
+	{
+	TBuf8<2> valBuf;
+	TInt err = iChannel->DoReadMemory(aThread, aAddress, 2, valBuf);
+	if (err != KErrNone)
+		{
+		LOG_MSG2("DRMDStepping::ReadMem16 failed to read memory at 0x%08x", aAddress);
+		return err;
+		}
+
+	aValue = *(TUint16 *)valBuf.Ptr();
+
+	return KErrNone;
+	}
+
+// Obtain a 16-bit memory value with minimum fuss
+TInt DRMDStepping::ReadMem8(DThread* aThread, const TUint32 aAddress, TUint8& aValue)
+	{
+	TBuf8<1> valBuf;
+	TInt err = iChannel->DoReadMemory(aThread, aAddress, 1, valBuf);
+	if (err != KErrNone)
+		{
+		LOG_MSG2("DRMDStepping::ReadMem8 failed to read memory at 0x%08x", aAddress);
+		return err;
+		}
+
+	aValue = *(TUint8 *)valBuf.Ptr();
+
+	return KErrNone;
+	}
+
+// Obtain a core register value with minimum fuss
+TInt DRMDStepping::RegisterValue(DThread *aThread, const TUint32 aKernelRegisterId, TUint32 &aValue)
+	{
+	TInt err = iChannel->ReadKernelRegisterValue(aThread, aKernelRegisterId, aValue);
+	if(err != KErrNone)
+		{
+		LOG_MSG3("DRMDStepping::RegisterValue failed to read register %d err = %d", aKernelRegisterId, err);
+		}
+		return err;
+	}
+
+
+// Encodings from ARM ARM DDI0406A, section 9.2.1
+enum TThumb2EEOpcode
+	{
+	EThumb2HDP,		// Handler Branch with Parameter
+	EThumb2UNDEF,	// UNDEFINED
+	EThumb2HB,		// Handler Branch, Handler Branch with Link
+	EThumb2HBLP,	// Handle Branch with Link and Parameter
+	EThumb2LDRF,	// Load Register from a frame
+	EThumb2CHKA,	// Check Array
+	EThumb2LDRL,	// Load Register from a literal pool
+	EThumb2LDRA,	// Load Register (array operations)
+	EThumb2STR		// Store Register to a frame
+	};
+
+//
+// DRMDStepping::ShiftedRegValue
+//
+TUint32 DRMDStepping::ShiftedRegValue(DThread *aThread, TUint32 aInstruction, TUint32 aCurrentPC, TUint32 aStatusRegister)
+	{
+	LOG_MSG("DRMDStepping::ShiftedRegValue()");
+
+	TUint32 shift = 0;
+	if (aInstruction & 0x10)	// bit 4
+		{
+		shift = (arm_rs(aInstruction) == PC_REGISTER ? aCurrentPC + 8 : aStatusRegister) & 0xFF;
+		}
+	else
+		{
+		shift = arm_data_c(aInstruction);
+		}
+	
+	TInt rm = arm_rm(aInstruction);
+	
+	TUint32 res = 0;
+	if(rm == PC_REGISTER)
+		{
+		res = aCurrentPC + ((aInstruction & 0x10) ? 12 : 8);
+		}
+	else
+		{
+		TInt err = iChannel->ReadKernelRegisterValue(aThread, rm, res);
+		if(err != KErrNone)
+			{
+			LOG_MSG2("DRMDStepping::ShiftedRegValue - Non-zero error code discarded: %d", err);
+			}
+		}
+
+	switch(arm_data_shift(aInstruction))
+		{
+		case 0:			// LSL
+			{
+			res = shift >= 32 ? 0 : res << shift;
+			break;
+			}
+		case 1:			// LSR
+			{
+			res = shift >= 32 ? 0 : res >> shift;
+			break;
+			}
+		case 2:			// ASR
+			{
+			if (shift >= 32)
+			shift = 31;
+			res = ((res & 0x80000000L) ? ~((~res) >> shift) : res >> shift);
+			break;
+			}
+		case 3:			// ROR/RRX
+			{
+			shift &= 31;
+			if (shift == 0)
+				{
+				res = (res >> 1) | ((aStatusRegister & arm_carry_bit()) ? 0x80000000L : 0);
+				}
+			else
+				{
+				res = (res >> shift) | (res << (32 - shift));
+				}
+			break;
+			}
+		}
+
+	return res & 0xFFFFFFFF;
+}
+
+//
+// DRMDStepping::CurrentPC
+//
+// 
+//
+TInt DRMDStepping::CurrentPC(DThread* aThread, TUint32& aPC)
+	{
+	LOG_MSG("DRMDStepping::CurrentPC");
+
+	TInt err = iChannel->ReadKernelRegisterValue(aThread, PC_REGISTER, aPC);
+	if(err != KErrNone)
+		{
+		// We don't know the current PC for this thread!
+		LOG_MSG("DRMDStepping::CurrentPC - Failed to read the current PC");
+		
+		return KErrGeneral;
+		}
+
+	LOG_MSG2("DRMDStepping::CurrentPC 0x%08x", aPC);
+
+	return KErrNone;
+	}
+
+//
+// DRMDStepping::CurrentCPSR
+//
+// 
+//
+TInt DRMDStepping::CurrentCPSR(DThread* aThread, TUint32& aCPSR)
+	{
+	LOG_MSG("DRMDStepping::CurrentCPSR");
+
+	TInt err = iChannel->ReadKernelRegisterValue(aThread, STATUS_REGISTER, aCPSR);
+	if(err != KErrNone)
+		{
+		// We don't know the current PC for this thread!
+		LOG_MSG("DRMDStepping::CurrentPC - Failed to read the current CPSR");
+		
+		return KErrGeneral;
+		}
+
+	LOG_MSG2("DRMDStepping::CurrentCPSR 0x%08x", aCPSR);
+	
+	return KErrNone;
+	}
+
+//
+// DRMDStepping::ModifyBreaksForStep
+//
+// Set a temporary breakpoint at the next instruction to be executed after the one at the current PC
+// Disable the breakpoint at the current PC if one exists
+//
+TInt DRMDStepping::ModifyBreaksForStep(DThread *aThread, TUint32 aRangeStart, TUint32 aRangeEnd, /*TBool aStepInto,*/ TBool aResumeOnceOutOfRange, TBool aCheckForStubs, const TUint32 aNumSteps)
+	{
+	LOG_MSG2("DRMDStepping::ModifyBreaksForStep() Numsteps 0x%d",aNumSteps);
+
+	// Validate arguments
+	if (!aThread)
+		{
+		LOG_MSG("DRMDStepping::ModifyBreaksForStep() - No aThread specified to step");
+		return KErrArgument;
+		}
+
+	// Current PC
+	TUint32 currentPC;
+
+	ReturnIfError(CurrentPC(aThread,currentPC));
+	LOG_MSG2("Current PC: 0x%x", currentPC);
+
+	// disable breakpoint at the current PC if necessary
+	ReturnIfError(iChannel->iBreakManager->DisableBreakAtAddress(currentPC));
+
+	// Current CPSR
+	TUint32 statusRegister;
+
+	ReturnIfError(CurrentCPSR(aThread,statusRegister));
+	LOG_MSG2("Current CPSR: %x", statusRegister);
+
+	TBool thumbMode = (statusRegister & ECpuThumb);
+	if (thumbMode)
+		LOG_MSG("Thumb Mode");
+
+	TInt instSize = thumbMode ? 2 : 4;
+
+	TBool changingModes = EFalse;
+
+	TUint32 breakAddress = 0;
+
+	TUint32 newRangeEnd = aRangeEnd;
+
+	breakAddress = PCAfterInstructionExecutes(aThread, currentPC, statusRegister, instSize, /* aStepInto, */ newRangeEnd, changingModes);
+
+	/*
+	If there is already a user breakpoint at this address, we do not need to set a temp breakpoint. The program
+	should simply stop at that address.	
+	*/
+	TBreakEntry* breakEntry = NULL;
+	do
+		{
+		breakEntry = iChannel->iBreakManager->GetNextBreak(breakEntry);
+		if(breakEntry && !iChannel->iBreakManager->IsTemporaryBreak(*breakEntry))
+			{
+			if ((breakEntry->iAddress == breakAddress) && ((breakEntry->iThreadSpecific && breakEntry->iId == aThread->iId) || (!breakEntry->iThreadSpecific && breakEntry->iId == aThread->iOwningProcess->iId)))
+				{
+				LOG_MSG("DRMDStepping::ModifyBreaksForStep - Breakpoint already exists at the step target address\n");
+
+				// note also that if this is the case, we will not keep stepping if we hit a real breakpoint, so may as well set
+				// the step count = 0.
+				breakEntry->iNumSteps = 0;
+
+				return KErrNone;
+				}
+			}
+		} while(breakEntry);
+
+	breakEntry = NULL;
+	do
+		{
+		breakEntry = iChannel->iBreakManager->GetNextBreak(breakEntry);
+		if(breakEntry && iChannel->iBreakManager->IsTemporaryBreak(*breakEntry))
+			{
+			if (breakEntry->iAddress == 0)
+				{
+				breakEntry->iId = aThread->iId;
+				breakEntry->iAddress = breakAddress;
+				breakEntry->iThreadSpecific = ETrue;
+
+				TBool realThumbMode = (thumbMode && !changingModes) || (!thumbMode && changingModes);
+
+				// Need to set the correct type of breakpoint for the mode we are in
+				// and the the one we are changing into
+				if(realThumbMode)
+					{
+					// We are remaining in Thumb mode
+					breakEntry->iMode = EThumbMode;
+					}
+				else
+					{
+					// We are switching to ARM mode
+					breakEntry->iMode = EArmMode;
+					}
+
+				breakEntry->iResumeOnceOutOfRange = aResumeOnceOutOfRange;
+				breakEntry->iSteppingInto = ETrue /* aStepInto */;
+				breakEntry->iRangeStart = 0;	// no longer used
+				breakEntry->iRangeEnd = 0;		// no longer used
+
+				LOG_MSG2("Adding temp breakpoint with id: %d", breakEntry->iBreakId);
+				LOG_MSG2("Adding temp breakpoint with thread id: %d", aThread->iId);
+
+				// Record how many more steps to go after we hit this one
+				breakEntry->iNumSteps = aNumSteps;
+
+				LOG_MSG3("Setting temp breakpoint id %d with %d steps to go\n", breakEntry->iBreakId, aNumSteps);
+
+				return iChannel->iBreakManager->DoEnableBreak(*breakEntry, ETrue);			
+				}
+			}
+		} while(breakEntry);
+	LOG_MSG("ModifyBreaksForStep : Failed to set suitable breakpoint for stepping");
+	return KErrNoMemory;	// should never get here
+}
+
+// End of file - d-rmd-stepping.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/rmdebug/d_rmd_stepping.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,126 @@
+// 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:
+//
+
+#ifndef D_RMD_STEPPING_H
+#define D_RMD_STEPPING_H
+
+// fwd declaration of DRM_DebugChannel
+class DRM_DebugChannel;
+
+// extracted from rm_debug_kerneldriver.h
+// Register definitions
+#define SP_REGISTER			13
+#define LINK_REGISTER		14
+#define PC_REGISTER			15
+#define STATUS_REGISTER		16
+
+class DRMDStepping : public DBase
+{
+public:
+	// ctor
+	DRMDStepping(DRM_DebugChannel* aChannel);
+
+	// dtor
+	~DRMDStepping();
+
+	// extracted from rm_debug_kerneldriver.cpp
+	TBool IsExecuted(TUint8 aCondition, TUint32 aStatusRegister);
+	TBool IsPreviousInstructionMovePCToLR(DThread *aThread);
+	void DecodeDataProcessingInstruction(TUint8 aOpcode, TUint32 aOp1, TUint32 aOp2, TUint32 aStatusRegister, TUint32 &aBreakAddress);
+	TUint32 PCAfterInstructionExecutes(DThread *aThread, TUint32 aCurrentPC, TUint32 aStatusRegister, TInt aInstSize, TUint32 &aNewRangeEnd, TBool &aChangingModes);
+	TUint32 ShiftedRegValue(DThread *aThread, TUint32 aInstruction, TUint32 aCurrentPC, TUint32 aStatusRegister);
+	TInt ModifyBreaksForStep(DThread *aThread, TUint32 aRangeStart, TUint32 aRangeEnd,TBool aResumeOnceOutOfRange, TBool aCheckForStubs, const TUint32 aNumSteps);
+
+private:
+
+	// Needed to access private data until re-structuring work is complete.
+	friend class DRM_DebugChannel;
+
+	DRM_DebugChannel* iChannel;	// temporary reference back to DRM_DebugChannel to help with refactoring
+
+	// Set of inline functions for decoding instructions. Formerly these were all macros
+
+	// ARM instruction bitmasks
+	inline TUint32 arm_opcode(const TUint32 aInst);
+
+	// Generic instruction defines
+	inline TUint32 arm_rm(const TUint32 aInst);
+	inline TUint32 arm_rs(const TUint32 aInst);
+	inline TUint32 arm_rd(const TUint32 aInst);
+	inline TUint32 arm_rn(const TUint32 aInst);
+	inline TUint32 arm_load(const TUint32 aInst);
+
+	// Data processing instruction defines
+	inline TUint32 arm_data_shift(const TUint32 aInst);
+	inline TUint32 arm_data_c(const TUint32 aInst);
+	inline TUint32 arm_data_imm(const TUint32 aInst);
+	inline TUint32 arm_data_rot(const TUint32 aInst);
+
+	// Single date transfer instruction defines
+	inline TUint32 arm_single_imm(const TUint32 aInst);
+	inline TUint32 arm_single_byte(const TUint32 aInst);
+	inline TUint32 arm_single_u(const TUint32 aInst);
+	inline TUint32 arm_single_pre(const TUint32 aInst);
+
+	// Block data transfer instruction defines
+	inline TUint32 arm_block_reglist(const TUint32 aInst);
+	inline TUint32 arm_block_u(const TUint32 aInst);
+	inline TUint32 arm_block_pre(const TUint32 aInst);
+
+	// Branch instruction defines
+	inline TUint32 arm_b_addr(const TUint32 aInst);
+	inline TUint32 arm_instr_b_dest(const TUint32 aInst, TUint32& aAddr);
+	inline TUint32 thumb_b_addr(const TUint32 aInst);
+	inline TUint32 thumb_instr_b_dest(const TUint32 aInst, TUint32& aAddr);
+	inline TUint32 arm_carry_bit(void);
+	
+
+	// Thumb instruction bitmasks
+	inline TUint16 thumb_opcode(const TUint16 aInst);
+	inline TUint16 thumb_inst_7_15(const TUint16 aInst);
+	inline TUint16 thumb_inst_8_15(const TUint16 aInst);
+
+	// Thumb2 decode support functions
+	inline TUint16 t2opcode16(const TUint16 aInst);
+
+	inline TUint16 t2opcode16special(const TUint16 aInst);
+
+	// Helper functions
+	TInt CurrentPC(DThread* aThread, TUint32& aPC);
+
+	TInt CurrentCPSR(DThread* aThread, TUint32& aCPSR);	
+
+	TInt CurrentInstruction(DThread* aThread, TUint32& aInstruction);
+
+	TInt CurrentArchMode(const TUint32 cpsr, Debug::TArchitectureMode& mode);
+
+	TInt RegisterValue(DThread *aThread, const TUint32 aKernelRegisterId, TUint32 &aValue);
+
+	TInt ReadMem32(DThread* aThread, const TUint32 aAddress, TUint32& aValue);
+
+	TInt ReadMem16(DThread* aThread, const TUint32 aAddress, TUint16& aValue);
+
+	TInt ReadMem8(DThread* aThread, const TUint32 aAddress, TUint8& aValue);
+
+	inline TUint32 BitCount(const TUint32 aVal);
+
+	inline TUint32 IsBitSet(const TUint32 aBitset, const TUint8 aBitNum);
+};
+
+#include "d_rmd_stepping.inl"
+
+#endif	// D_RMD_STEPPPING_H
+
+// End of file - d-rmd-stepping.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/rmdebug/d_rmd_stepping.inl	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,313 @@
+// 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:
+//
+
+
+
+/**
+ @file
+ @internalComponent
+ @released
+*/
+
+#ifndef D_RMD_STEPPING_INL
+#define D_RMD_STEPPING_INL
+
+//
+// IsBitSet
+//
+// Returns 1 if the bit 'aNum' is set within aBitset, 0 otherwise
+inline TUint32 DRMDStepping::IsBitSet(const TUint32 aBitset, const TUint8 aNum)
+	{
+	return (aBitset & (1 << aNum) );
+	}
+
+// 
+// BitCount
+//
+// Count number of bits in aVal
+inline TUint32 DRMDStepping::BitCount(const TUint32 aVal)
+	{
+	TUint32 num = 0;
+
+	for(TInt i = 0; i < 32; i++)
+		{
+		if ((1 << i) & aVal)
+			{
+			num++;
+			}
+		}
+	return num;
+	}
+
+//
+// Thumb2 opcode decoding
+//
+// Special data instructions and branch and exchange.
+//
+// Returns Opcode as defined in ARM ARM DDI0406A, section A6.2.3
+inline TUint16 DRMDStepping::t2opcode16special(const TUint16 aInst)
+	{
+	TUint8 aVal = (aInst & 0x03C0) >> 5;
+
+	return aVal;
+	}
+
+
+// Thumb2 opcode decoding instructions
+// 
+// Returns Opcode as defined in ARM ARM DDI0406A, section A6.2
+// 16-bit Thumb instruction encoding
+inline TUint16 DRMDStepping::t2opcode16(const TUint16 aInst)
+{
+	TUint16 aVal = (aInst & 0xFC00) >> 9;
+
+	return aVal;
+}
+
+// ARM opcode decoding functions
+inline TUint32 DRMDStepping::arm_opcode(const TUint32 aInst)
+{
+// #define ARM_OPCODE(x)		(((TUint32)(x) & 0x0E000000) >> 25)
+
+	TUint32 aVal = ((aInst) & 0x0E000000) >> 25;
+
+	return aVal;
+}
+
+inline TUint32 DRMDStepping:: arm_rm(const TUint32 aInst)
+{
+//#define ARM_RM(x)				((TUint32)(x) & 0x0000000F)			// bit 0- 4
+
+	TUint32 aVal = (aInst) & 0x0000000F;
+
+	return aVal;
+}
+
+inline TUint32 DRMDStepping:: arm_rs(const TUint32 aInst)
+{
+//#define ARM_RS(x)				(((TUint32)(x) & 0x00000F00) >> 8)	// bit 8-11
+
+	TUint32 aVal = ((aInst) & 0x00000F00) >> 8;
+
+	return aVal;
+}
+
+inline TUint32 DRMDStepping:: arm_rd(const TUint32 aInst)
+{
+//#define ARM_RD(x)				(((TUint32)(x) & 0x0000F000) >> 12)	// bit 12-15
+
+	TUint32 aVal = ((aInst) & 0x0000F000) >> 12;
+
+	return aVal;
+}
+
+inline TUint32 DRMDStepping:: arm_rn(const TUint32 aInst)
+{
+//#define ARM_RN(x)				(((TUint32)(x) & 0x000F0000) >> 16)	// bit 16-19
+
+	TUint32 aVal = ((aInst) & 0x000F0000) >> 16;
+
+	return aVal;
+}
+
+inline TUint32 DRMDStepping::arm_load(const TUint32 aInst)
+{
+//#define ARM_LOAD(x)				(((TUint32)(x) & 0x00100000) >> 20)	// bit 20
+
+	TUint32 aVal = ((aInst) & 0x00100000) >> 20;
+
+	return aVal;
+}
+
+// Data processing instruction defines
+inline TUint32 DRMDStepping::arm_data_shift(const TUint32 aInst)
+{
+//#define ARM_DATA_SHIFT(x)		(((TUint32)(x) & 0x00000060) >> 5) 	// bit 5- 6
+	
+	TUint32 aVal = ((aInst) & 0x00000060) >> 5;
+
+	return aVal;
+}
+
+inline TUint32 DRMDStepping::arm_data_c(const TUint32 aInst)
+{
+//#define ARM_DATA_C(x)			(((TUint32)(x) & 0x00000F80) >> 7) 	// bit 7-11
+
+	TUint32 aVal = ((aInst) & 0x00000F80) >> 7;
+
+	return aVal;
+}
+
+inline TUint32 DRMDStepping::arm_data_imm(const TUint32 aInst)
+{
+//#define ARM_DATA_IMM(x)			((TUint32)(x) & 0x000000FF)			// bit 0-7
+
+	TUint32 aVal = (aInst) & 0x000000FF;
+
+	return aVal;
+}
+
+inline TUint32 DRMDStepping::arm_data_rot(const TUint32 aInst)
+{
+//#define ARM_DATA_ROT(x)			(((TUint32)(x) & 0x00000F00) >> 8) 	// bit 8-11
+
+	TUint32 aVal = ((aInst) & 0x00000F00) >> 8;
+
+	return aVal;
+}
+
+// Single date transfer instruction defines
+inline TUint32 DRMDStepping::arm_single_imm(const TUint32 aInst)
+{
+//#define ARM_SINGLE_IMM(x)		((TUint32)(x) & 0x00000FFF)			// bit 0-11
+
+	TUint32 aVal = (aInst) & 0x00000FFF;
+
+	return aVal;
+}
+
+inline TUint32 DRMDStepping::arm_single_byte(const TUint32 aInst)
+{
+//#define ARM_SINGLE_BYTE(x)		(((TUint32)(x) & 0x00400000) >> 22)	// bit 22
+
+	TUint32 aVal = ((aInst) & 0x00400000) >> 22;
+
+	return aVal;
+}
+
+inline TUint32 DRMDStepping::arm_single_u(const TUint32 aInst)
+{
+//#define ARM_SINGLE_U(x)			(((TUint32)(x) & 0x00800000) >> 23)	// bit 23
+
+	TUint32 aVal = ((aInst) & 0x00800000) >> 23;
+
+	return aVal;
+}
+
+inline TUint32 DRMDStepping::arm_single_pre(const TUint32 aInst)
+{
+//#define ARM_SINGLE_PRE(x)		(((TUint32)(x) & 0x01000000) >> 24)	// bit 24
+
+	TUint32 aVal = ((aInst) & 0x01000000) >> 24;
+
+	return aVal;
+}
+
+// Block data transfer instruction defines
+inline TUint32 DRMDStepping::arm_block_reglist(const TUint32 aInst)
+{
+//#define ARM_BLOCK_REGLIST(x)	((TUint32)(x) & 0x0000FFFF)		// bit 0-15
+
+	TUint32 aVal = (aInst) & 0x0000FFFF;
+
+	return aVal;
+}
+
+inline TUint32 DRMDStepping::arm_block_u(const TUint32 aInst)
+{
+//#define ARM_BLOCK_U(x)			(((TUint32)(x) & 0x00800000) >> 23)	// bit 23
+
+	TUint32 aVal = ((aInst) & 0x00800000) >> 23;
+
+	return aVal;
+}
+
+inline TUint32 DRMDStepping::arm_block_pre(const TUint32 aInst)
+{
+//#define ARM_BLOCK_PRE(x)		(((TUint32)(x) & 0x01000000) >> 24)	// bit 24
+
+	TUint32 aVal = ((aInst) & 0x01000000) >> 24;
+
+	return aVal;
+}
+
+// Branch instruction defines
+inline TUint32 DRMDStepping::arm_b_addr(const TUint32 aInst)
+{
+//#define ARM_B_ADDR(x)			((x & 0x00800000) ? ((TUint32)(x) & 0x00FFFFFF | 0xFF000000) : (TUint32)(x) & 0x00FFFFFF)
+
+	TUint32 aVal = ((aInst & 0x00800000) ? ((TUint32)(aInst) & 0x00FFFFFF | 0xFF000000) : (TUint32)(aInst) & 0x00FFFFFF);
+
+	return aVal;
+}
+
+inline TUint32 DRMDStepping::arm_instr_b_dest(const TUint32 aInst, TUint32& aAddress)
+{
+//#define ARM_INSTR_B_DEST(x,a)	(ARM_B_ADDR(x) << 2) + ((TUint32)(a) + 8)
+
+	TUint32 aVal = (arm_b_addr(aInst) << 2) + ((TUint32)(aAddress) + 8);
+
+	return aVal;
+}
+
+inline TUint32 DRMDStepping::thumb_b_addr(const TUint32 aInst)
+{
+//#define THUMB_B_ADDR(x) ((x & 0x0400) ? ((((TUint32)(x) & 0x07FF)<<11) | (((TUint32)(x) & 0x07FF0000)>>16) | 0xFFC00000) :\
+                                            ((TUint32)(x) & 0x07FF)<<11) | (((TUint32)(x) & 0x07FF0000)>>16)
+
+	TUint32 aVal = ((((TUint32)(aInst) & 0x07FF)<<11) | ((TUint32)(aInst) & 0x07FF0000)>>16);
+
+	return ((aInst & 0x0400) ? (aVal | 0xFFC00000) : aVal);
+}
+
+inline TUint32 DRMDStepping::thumb_instr_b_dest(const TUint32 aInst, TUint32& aAddress)
+{
+//#define THUMB_INSTR_B_DEST(x,a)	(THUMB_B_ADDR(x) << 1) + ((TUint32)(a) + 4)
+
+	TUint32 aVal = (thumb_b_addr(aInst) << 1) + ((TUint32)(aAddress) + 4);
+
+	return aVal;
+}
+
+inline TUint32 DRMDStepping::arm_carry_bit(void)
+{
+//#define ARM_CARRY_BIT			0x20000000	// bit 30
+
+	TUint32 aVal = 0x20000000;
+
+	return aVal;
+}
+
+// Thumb instruction bitmasks
+inline TUint16 DRMDStepping::thumb_opcode(const TUint16 aInst)
+{
+//	#define THUMB_OPCODE(x)		(((TUint16)(x) & 0xF800) >> 11)
+
+	TUint16 aVal = ((aInst) & 0xF800) >> 11;
+
+	return aVal;
+}
+
+inline TUint16 DRMDStepping::thumb_inst_7_15(const TUint16 aInst)
+{
+//	#define THUMB_INST_7_15(x)	(((TUint16)(x) & 0xFF80) >> 7)
+
+	TUint16 aVal = ((aInst) & 0xFF80) >> 7;
+
+	return aVal;
+}
+
+inline TUint16 DRMDStepping::thumb_inst_8_15(const TUint16 aInst)
+{
+//	#define THUMB_INST_8_15(x)	(((TUint16)(x) & 0xFF00) >> 8)
+
+	TUint16 aVal = ((aInst) & 0xFF00) >> 8;
+
+	return aVal;
+}
+
+#endif	// D_RMD_STEPPPING_INL
+
+// End of file - d-rmd-stepping.inl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/rmdebug/d_target_process.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,420 @@
+// 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:
+// Purpose: The DProcessTracker object tracks which processes are being
+// debugged. The DProcessTracker class uses a DTargetProcess object for
+// each process being debugged.
+// Note: Although TheDProcessTracker object is a global, it should be unique
+// as only the Debug Security Server should load and use this driver.
+//
+//
+
+#include <e32def.h>
+#include <e32def_private.h>
+#include <e32cmn.h>
+#include <e32cmn_private.h>
+#include <kernel/kernel.h>
+#include <kernel/kern_priv.h>
+#include "nk_priv.h"
+#include <rm_debug_api.h>
+
+#include "d_target_process.h"
+#include "debug_logging.h"
+#include "debug_utils.h"
+
+// ctor
+DTargetProcess::DTargetProcess()
+	:iProcessName(0,0,0)
+	{
+	}
+
+// dtor
+DTargetProcess::~DTargetProcess()
+	{
+	// Delete the space allocated for the name if any
+	if (iProcessName.Ptr() != 0)
+		{
+		NKern::ThreadEnterCS();
+		Kern::Free((TAny*)iProcessName.Ptr());
+		NKern::ThreadLeaveCS();
+		}
+	//Reset the array and delete the objects that its members point to
+	NKern::ThreadEnterCS();
+	iAgentList.ResetAndDestroy();
+	NKern::ThreadLeaveCS();
+	}
+
+// Compare two DTargetProcess items. They are the same if they have the same name.
+TInt DTargetProcess::Compare(const DTargetProcess& aFirst, const DTargetProcess& aSecond)
+	{
+	return aFirst.iProcessName.Compare(aSecond.iProcessName);
+	}
+
+// Set the name of the process we are tracking
+TInt DTargetProcess::SetProcessName(const TDesC8& aProcessName)
+	{
+	// Argument checking
+	if (aProcessName.Length() < 1)
+		{
+		return KErrArgument;
+		}
+
+	// Allocate some memory to store the name
+	TUint length = aProcessName.Length();
+
+	NKern::ThreadEnterCS();
+	TUint8* buffer = (TUint8*)Kern::AllocZ(length);
+	NKern::ThreadLeaveCS();
+	if (buffer==NULL)
+		{
+		// Out of memory
+		return KErrNoMemory;
+		}
+
+	// Set iProcessName to use the alloc'd buffer
+	iProcessName.Set(buffer,length,length);
+
+	// Store aProcessName within this object
+	iProcessName.Copy(aProcessName);
+
+	return KErrNone;
+	}
+
+// Obtain the name of the process being tracked
+const TPtr8& DTargetProcess::ProcessName(void)
+	{
+	return iProcessName;
+	}
+
+// Returns a pointer to the DDebugAgent with aAgentId.
+// If the agent is not in the list, it returns NULL.
+DDebugAgent* DTargetProcess::Agent(TUint64 aAgentId)
+	{
+	for(TInt i = 0; i < iAgentList.Count(); i++)
+		{
+		if (iAgentList[i]->Id() == aAgentId)
+			{
+			return iAgentList[i];
+			}
+		}
+
+	// what do we return if we don't have any agents?
+	return NULL;
+	}
+
+// Adds aAgentId as a tracking agent for this process.
+TInt DTargetProcess::AddAgent(TUint64 aAgentId)
+	{
+	
+	DDebugAgent* agent = DDebugAgent::New(aAgentId);
+	LOG_MSG4("DTargetProcess::AddAgent(), agentId=%d, curr iAgentList.Count=%d, new agent=0x%08x",
+		I64LOW(aAgentId), iAgentList.Count(), agent );
+
+	if(agent == NULL)
+		{
+		LOG_MSG("DTargetProcess::AddAgent() couldn't allocate memory for DDebugAgent");
+		return KErrNoMemory;
+		}
+	return iAgentList.Insert(agent,0);
+	}
+
+// Stops tracking the process with this agent
+TInt DTargetProcess::RemoveAgent(TUint64 aAgentId)
+	{
+	// We need to find and then remove the agent
+	for(TUint i = 0; i < iAgentList.Count(); i++)
+		{
+		if (iAgentList[i]->Id() == aAgentId)
+			{
+			delete iAgentList[i];
+			iAgentList.Remove(i);
+			return KErrNone;
+			}
+		}
+
+	return KErrNotFound;
+	}
+
+// Index through the agents by position
+DDebugAgent* DTargetProcess::operator[](TInt aIndex)
+	{
+	return iAgentList[aIndex];
+	}
+
+// returns the number of agents tracking this process.
+TInt DTargetProcess::AgentCount(void)
+	{
+	return iAgentList.Count();
+	}
+
+/**
+  Resume the specified thread
+
+  @param aThread thread to resume
+
+  @return KErrNone if the thread has previously been suspended and is resumed,
+  KErrNotFound if the thread has not previously been suspended
+  */
+TInt DTargetProcess::ResumeThread(DThread* aThread)
+	{
+	LOG_MSG2("DTargetProcess::ResumeSuspendedThread(): thread=0x%08x", aThread);
+	TInt err1 = ResumeSuspendedThread(aThread);
+	LOG_MSG2("DTargetProcess::ResumeSuspendedThread(): ret=%d)", err1); 
+	TInt err2 = ResumeFrozenThread(aThread->iNThread);
+	LOG_MSG2("DTargetProcess::ResumeFrozenThread(): ret=%d)", err2);
+	//if resuming the suspended thread failed for an obscure reason return it
+	if((err1 != KErrNotFound) && (err1 != KErrNone))
+		{
+		LOG_MSG2("DTargetProcess::ResumeThread() BUG : unexpected exit, err1: %d", err1);
+		return err1;
+		}
+	//if resuming the frozen thread failed for an obscure reason return it
+	if((err2 != KErrNotFound) && (err2 != KErrNone))
+		{
+		LOG_MSG2("DTargetProcess::ResumeThread() BUG : unexpected exit, err2: %d", err2);
+		return err2;
+		}
+	// if resuming the suspended thread succeeded in both cases, we have a consistency problem
+	if ((err1 == KErrNone) && (err2 == KErrNone))
+		{
+		LOG_MSG("DTargetProcess::ResumeThread() BUG : unexpected exit, err1 == err2 == KErrNone");
+		}
+
+	//if the thread was in neither list return KErrNotFound, otherwise KErrNone
+	return ((err1 == KErrNone) || (err2 == KErrNone)) ? KErrNone : KErrNotFound;
+	}
+
+/**
+  Resume the specified frozen thread
+
+  @param aThread thread to resume
+
+  @return KErrNone if the thread has previously been suspended and is resumed,
+  KErrNotFound if the thread has not previously been suspended
+  */
+TInt DTargetProcess::ResumeFrozenThread(NThread& aThread)
+	{
+	for(TInt i=0; i<iFrozenThreadSemaphores.Count(); i++)
+		{
+		if(iFrozenThreadSemaphores[i]->iOwningThread == &aThread)
+			{
+			NKern::FSSignal(iFrozenThreadSemaphores[i]);
+			NKern::ThreadEnterCS();
+			delete iFrozenThreadSemaphores[i];
+			NKern::ThreadLeaveCS();
+			iFrozenThreadSemaphores.Remove(i);
+			return KErrNone;
+			}
+		}
+	return KErrNotFound;
+	}
+
+/**
+  Resume the specified suspended thread
+
+  @param aThread thread to resume
+
+  @return KErrNone if the thread has previously been suspended and is resumed,
+  KErrNotFound if the thread has not previously been suspended
+  */
+TInt DTargetProcess::ResumeSuspendedThread(DThread* aThread)
+	{
+	TUint64 threadId = (TUint64)aThread->iId;
+	for(TInt i=0; i<iSuspendedThreads.Count(); i++)
+		{
+		if(iSuspendedThreads[i] == threadId)
+			{
+			iSuspendedThreads.Remove(i);
+			LOG_MSG2("DTargetProcess::ResumeSuspendedThread()> Kern::ThreadResume() 0x%08x", aThread);
+			Kern::ThreadResume(*aThread);
+			return KErrNone;
+			}
+		}
+	return KErrNotFound;
+	}
+
+/**
+  Suspend the specified thread
+
+  @param aThread thread to suspend
+
+  @param aFreezeThread suspend the thread on a Fast Semaphore if
+  ETrue. EFalse means suspend by calling Kern::Suspend.
+
+  @return KErrNone if the thread is successfully suspended,
+  KErrAlreadyExists if the agent has already suspended the thread,
+  or one of the other system wide error codes
+  
+   This function suspends a thread by calling Kern::Thread Suspend.
+                                                                                                       
+  An alternative means of suspending the _current_ thread only
+  is by call DTargetProcess::FreezeThread. This will ensure that
+  the current thread is suspended when exception processing for this
+  thread completes (see rm_debug_eventhandler.cpp)
+  
+  */
+TInt DTargetProcess::SuspendThread(DThread* aThread, TBool aFreezeThread)
+	{
+	// should check if this thread is already suspended/frozen and return if so
+	// but just warn for the moment.
+	if (CheckSuspended(aThread))
+		{
+		// thread was already suspended, don't bother doing it again
+		LOG_MSG2("DTargetProcess::SuspendThread - Thread Id 0x%08x already suspended\n",aThread->iId);
+		//return KErrAlreadyExists;	
+		}
+
+	return aFreezeThread ? FreezeThread() : DoSuspendThread(aThread);
+	}
+
+/**
+  Freeze the current thread
+
+  @return KErrNone if the thread is successfully suspended,
+  KErrAlreadyExists if the agent has already suspended the thread,
+  or one of the other system wide error codes
+
+  This marks the current thread for waiting on a Fast Semaphore
+  when exception handling for this thread has completed - see
+  rm_debug_eventhandler.cpp for details.
+  */
+TInt DTargetProcess::FreezeThread()
+	{
+	// create and store a fast semaphore to stop the thread on
+	NKern::ThreadEnterCS();
+	NFastSemaphore* sem = new NFastSemaphore();
+	NKern::ThreadLeaveCS();
+	sem->iOwningThread = &(Kern::CurrentThread().iNThread);
+	LOG_MSG3("DTargetProcess::FreezeThread(): new NFastSemaphore() owning thread==curr NThread=0x%08x, DThread=0x%08x", 
+		sem->iOwningThread, &(Kern::CurrentThread()) );
+	return iFrozenThreadSemaphores.Append(sem);
+	}
+
+/**
+  Suspend the specified thread
+
+  @param aThread thread to suspend
+
+  @return KErrNone if the thread is successfully suspended,
+  KErrAlreadyExists if the agent has already suspended the thread,
+  or one of the other system wide error codes
+  */
+TInt DTargetProcess::DoSuspendThread(DThread* aThread)
+	{
+	TUint64 threadId = (TUint64)aThread->iId;
+	
+	// Don't suspend if this thread is already suspended (by FSWait or
+	// Kern::ThreadSuspend
+	if (CheckSuspended(aThread))
+		{
+		// thread was already suspended, don't bother doing it again
+		LOG_MSG2("DTargetProcess::SuspendThread - Thread Id 0x%08x already suspended\n",threadId);
+		return KErrAlreadyExists;	
+		}
+
+	// Add thread to the suspend list
+	TInt err = iSuspendedThreads.Append(threadId);
+	if(err == KErrNone)
+		{
+		LOG_MSG2("DTargetProcess::DoSuspendThread >Kern::ThreadSuspend() 0x%08x", aThread ); 
+		Kern::ThreadSuspend(*aThread, 1);
+		}
+	return err;
+	}
+
+/**
+ Waits the current thread on a Fast Semaphore.
+
+ This is useful for situations where the current thread
+ has hit a breakpoint within a critical section, and
+ otherwise could not be suspended at this point.
+
+ Note that the Fast Semaphore structure on which the thread
+ waits must be a member data item of this class instance,
+ as it needs to be FSSignal()'d by another thread to resume
+ again.
+ */
+void DTargetProcess::FSWait()
+	{
+	NThread* currentNThread = &(Kern::CurrentThread().iNThread);	
+	for(TInt i=0; i<iFrozenThreadSemaphores.Count(); i++)
+		{
+		if(iFrozenThreadSemaphores[i]->iOwningThread == currentNThread)
+			{
+			LOG_MSG4("DTargetProcess::FSWait(): > FSWait frozen sem %d, currentNThread=0x%08x, id=0x%x", 
+				i, currentNThread, Kern::CurrentThread().iId );
+			NKern::FSWait(iFrozenThreadSemaphores[i]);
+			return;
+			}
+		}
+	}
+
+/**
+  Checks that the thread has been suspended
+
+  @param aThread thread to check suspended
+
+  @return ETrue if the thread has been suspended,
+  EFalse if the thread has not been suspended
+  */
+TBool DTargetProcess::CheckSuspended(DThread* aThread) const
+	{
+	if(!aThread)
+		{
+		return EFalse;
+		}
+	//check if the thread is in the suspended threads list
+	for(TInt i=0; i<iSuspendedThreads.Count(); i++)
+		{
+		if(iSuspendedThreads[i] == (TUint64)aThread->iId)
+			{
+			return ETrue;
+			}
+		}
+	// not in the suspended threads list so check in the frozen threads list
+	NThread* nThread = &(aThread->iNThread);
+	for(TInt i=0; i<iFrozenThreadSemaphores.Count(); i++)
+		{
+		if(iFrozenThreadSemaphores[i]->iOwningThread == nThread)
+			{
+			return ETrue;
+			}
+		}
+	return EFalse;
+	}
+
+/*
+@return ETrue if the debug driver has suspended any of the process' threads, EFalse otherwise
+*/
+TBool DTargetProcess::HasSuspendedThreads() const
+	{
+	return (iSuspendedThreads.Count() > 0) || (iFrozenThreadSemaphores.Count() > 0);
+	}
+
+void DTargetProcess::NotifyEvent(const TDriverEventInfo& aEventInfo)
+	{
+	// Stuff the event info into all the tracking agents event queues
+	LOG_MSG4("DTargetProcess::NotifyEvent(): num attached agents: %d, iEventType=%d, this=0x%08x", 
+		AgentCount(), aEventInfo.iEventType, this);
+
+	for(TInt i = 0; i < AgentCount(); i++)
+		{
+		// Index through all the relevant debug agents
+		DDebugAgent* debugAgent = iAgentList[i];
+		if(debugAgent != NULL)
+			{
+			debugAgent->NotifyEvent(aEventInfo);
+			}
+		}
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/rmdebug/d_target_process.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,70 @@
+// 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:
+// Purpose: Kernel-side tracking of process state
+// 
+//
+ 
+#ifndef D_TARGET_PROCESS_H
+#define D_TARGET_PROCESS_H
+
+#include "d_debug_agent.h"
+
+// Debug Process Tracker class
+class DTargetProcess : public DBase
+{
+public:
+	DTargetProcess();
+	~DTargetProcess();
+
+	static TInt Compare(const DTargetProcess& aFirst, const DTargetProcess& aSecond);
+
+	TInt SetProcessName(const TDesC8& aProcessName);
+
+	const TPtr8& ProcessName(void);
+
+	TInt AddAgent(const TUint64 aAgentId);
+
+	TInt RemoveAgent(TUint64 aAgentId);
+
+	DDebugAgent* operator[](TInt aIndex);
+
+	DDebugAgent* Agent(TUint64 aAgentId);
+
+	TInt AgentCount(void);
+	TInt ResumeThread(DThread* aThread);
+	TInt SuspendThread(DThread* aThread, TBool aFreezeThread=EFalse);
+	TBool CheckSuspended(DThread* aThread) const;
+	void FSWait();
+	TBool HasSuspendedThreads() const;
+	void NotifyEvent(const TDriverEventInfo& aEventInfo);
+
+private:
+	TInt ResumeFrozenThread(NThread& aThread);
+	TInt ResumeSuspendedThread(DThread* aThread);
+	TInt FreezeThread();
+	TInt DoSuspendThread(DThread* aThread);
+
+private:
+	TPtr8 iProcessName;
+
+	RPointerArray<DDebugAgent> iAgentList;
+
+	RArray<TUint64> iSuspendedThreads;
+
+	RPointerArray<NFastSemaphore> iFrozenThreadSemaphores;
+
+};
+
+#endif // D_TARGET_PROCESS_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/rmdebug/rm_debug_eventhandler.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,176 @@
+// 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:
+// Kernel Event handler for Run Mode Debug.
+//
+
+#include <e32def.h>
+#include <e32def_private.h>
+#include <e32cmn.h>
+#include <e32cmn_private.h>
+#include <kernel/arm/arm.h>
+#include <kernel/kernel.h>
+#include <kernel/kern_priv.h>
+#include <nk_trace.h>
+
+#include <rm_debug_api.h>
+#include "debug_logging.h"
+#include "d_process_tracker.h"
+#include "d_rmd_stepping.h"
+#include "rm_debug_kerneldriver.h"
+#include "rm_debug_driver.h"
+#include "rm_debug_eventhandler.h"
+
+
+DRM_DebugEventHandler::DRM_DebugEventHandler()
+	:	DKernelEventHandler(EventHandler, this)
+{
+	LOG_MSG("DRM_DebugEventHandler::DRM_DebugEventHandler()");
+
+	for(TInt i=0; i<EEventLimit; i++)
+		{
+		iEventHandlers[i] = &DRM_DebugChannel::HandleUnsupportedEvent;
+		}
+	iEventHandlers[EEventUserTrace] = &DRM_DebugChannel::HandleUserTrace;
+	iEventHandlers[EEventRemoveLibrary] = &DRM_DebugChannel::RemoveLibrary;
+	iEventHandlers[EEventAddLibrary] = &DRM_DebugChannel::AddLibrary;
+	iEventHandlers[EEventStartThread] = &DRM_DebugChannel::StartThread;
+	iEventHandlers[EEventSwExc] = &DRM_DebugChannel::HandleSwException;
+	iEventHandlers[EEventHwExc] = &DRM_DebugChannel::HandleHwException;
+	iEventHandlers[EEventKillThread] = &DRM_DebugChannel::HandleEventKillThread;
+	iEventHandlers[EEventAddProcess] = &DRM_DebugChannel::HandleAddProcessEvent;
+	iEventHandlers[EEventRemoveProcess] = &DRM_DebugChannel::HandleRemoveProcessEvent;
+}
+
+TInt DRM_DebugEventHandler::Create(DLogicalDevice* aDevice, DLogicalChannel* aChannel, DThread* aClient)
+{
+	LOG_MSG3("DRM_DebugEventHandler::Create(), aClientthread=0x%08x id=%d", aClient, aClient->iId);
+
+	TInt err;
+	err = aDevice->Open();
+	if (err != KErrNone)
+		return err;
+	iDevice = aDevice;
+	
+	iChannel = (DRM_DebugChannel*)aChannel; //Don't add ref the channel, since channel closes the event handler before it ever gets destroyed.
+
+	err = aClient->Open();
+	if (err != KErrNone)
+		return err;
+	iClientThread = aClient;
+
+	// Use a semaphore to protect our data structures from concurrent access.
+	err = Kern::SemaphoreCreate(iProtectionLock, _L("RM_DebugEventHandlerLock"), 1 /* Initial count */);
+	if (err != KErrNone)
+		return err;
+
+
+	return Add();
+}
+
+
+DRM_DebugEventHandler::~DRM_DebugEventHandler()
+{
+	LOG_MSG("DRM_DebugEventHandler::~DRM_DebugEventHandler()");
+
+	if (iProtectionLock)
+		iProtectionLock->Close(NULL);
+	
+	if (iDevice)
+		iDevice->Close(NULL);	
+	
+	if (iClientThread)
+		Kern::SafeClose((DObject*&)iClientThread, NULL);
+		
+}
+
+
+TInt DRM_DebugEventHandler::Start()
+{
+	LOG_MSG("DRM_DebugEventHandler::Start()");
+
+	iTracking = ETrue;
+
+	return KErrNone;
+}
+
+
+TInt DRM_DebugEventHandler::Stop()
+{
+	LOG_MSG("DRM_DebugEventHandler::Stop()");
+
+	iTracking = EFalse;
+
+	return KErrNone;
+}
+
+
+TUint DRM_DebugEventHandler::EventHandler(TKernelEvent aType, TAny* a1, TAny* a2, TAny* aThis)
+{
+	return ((DRM_DebugEventHandler*)aThis)->HandleEvent(aType, a1, a2);
+}
+
+
+
+TUint DRM_DebugEventHandler::HandleEvent(TKernelEvent aType, TAny* a1, TAny* a2)
+	{
+	
+	/*
+	 * Check if we are tracking things at all OR 
+	 * this event is beyond the limit of known events OR 
+	 * this event is from the debug thread itself (don't want to debug ourselves) OR
+	 * this event has a handler (there is no point in proceeding without a handler)
+	 */
+	if( (!iTracking) || 
+			(aType > (TUint32)EEventLimit) ||
+			(iClientThread == &Kern::CurrentThread()) ||
+	    (iEventHandlers[aType] == &DRM_DebugChannel::HandleUnsupportedEvent) )
+		{
+		return ERunNext;
+		}
+	
+	return HandleSpecificEvent(aType,a1,a2) ? EExcHandled : ERunNext;
+
+	}
+
+TBool DRM_DebugEventHandler::HandleSpecificEvent(TKernelEvent aType, TAny* a1, TAny* a2)
+	{
+	TBool ret = EFalse;
+
+	NKern::ThreadEnterCS();
+	LockDataAccess();
+
+
+	if (iChannel)
+		{
+		ret = (iChannel->*(iEventHandlers[aType]))(a1, a2);
+		}
+	ReleaseDataAccess();
+	NKern::ThreadLeaveCS();
+
+	switch(aType)
+		{
+		case EEventHwExc:
+		case EEventKillThread:
+			{
+			LOG_MSG2("DRM_DebugEventHandler::HandleEvent() -> FSWait(), kernel event type: %d", (TUint32)aType);
+			TheDProcessTracker.FSWait();
+			LOG_MSG("DRM_DebugEventHandler::HandleEvent() <- FSWait()");
+			break;
+			}
+		default:
+			break;
+		}
+	return ret;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/rmdebug/rm_debug_kerneldriver.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,3791 @@
+// 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:
+// Device driver for kernel side debug assist
+//
+
+#ifdef __WINS__
+#error - this driver cannot be built for emulation
+#endif
+
+#include <e32def.h>
+#include <e32def_private.h>
+#include <e32cmn.h>
+#include <e32cmn_private.h>
+#include <e32ldr.h>
+#include <u32std.h>
+#include <kernel/kernel.h>
+#include <kernel/kern_priv.h>
+#include <nk_trace.h>
+#include <arm.h>
+#include <kernel/cache.h>
+#include <platform.h>
+#include <nkern.h>
+#include <u32hal.h>
+#include <kernel/kdebug.h>
+#include <rm_debug_api.h>
+
+#include "debug_logging.h"
+#include "d_rmd_breakpoints.h"	// moved breakpoints code lives here
+#include "d_rmd_stepping.h"		// moved stepping code lives here
+#include "rm_debug_kerneldriver.h"
+#include "d_list_manager.h"
+#include "rm_debug_driver.h"
+#include "rm_debug_eventhandler.h"
+#include "d_debug_functionality.h"
+#include "d_process_tracker.h"
+#include "debug_utils.h"
+#include "d_buffer_manager.h"
+
+using namespace Debug;
+
+/////////////////////////////////////////////////////////////////////////
+//
+// DRM_DebugDriverFactory implementation
+//
+/////////////////////////////////////////////////////////////////////////
+
+//
+// DRM_DebugDriverFactory constructor
+//
+DRM_DebugDriverFactory::DRM_DebugDriverFactory()
+	{
+	iVersion = TVersion(KMajorVersionNumber,KMinorVersionNumber,KBuildVersionNumber);
+	}
+
+//
+// DRM_DebugDriverFactory::Create
+//
+TInt DRM_DebugDriverFactory::Create(DLogicalChannelBase*& aChannel)
+	{
+	if (iOpenChannels != 0)
+		return KErrInUse; // a channel is already open
+
+	aChannel = new DRM_DebugChannel(this);
+
+	return aChannel ? KErrNone : KErrNoMemory;
+	}
+
+//
+// DRM_DebugDriverFactory::Install
+//
+TInt DRM_DebugDriverFactory::Install()
+	{
+	return(SetName(&KRM_DebugDriverName));
+	}
+
+//
+// DRM_DebugDriverFactory::Install
+//
+void DRM_DebugDriverFactory::GetCaps(TDes8& aDes) const
+	{
+	TCapsRM_DebugDriver b;
+	b.iVersion = TVersion(KMajorVersionNumber, KMinorVersionNumber, KBuildVersionNumber);
+
+	Kern::InfoCopy(aDes,(TUint8*)&b,sizeof(b));
+	}
+
+/////////////////////////////////////////////////////////////////////////
+//
+// DRM_DebugChannel implementation
+//
+/////////////////////////////////////////////////////////////////////////
+
+//
+// DRM_DebugChannel constructor
+//
+DRM_DebugChannel::DRM_DebugChannel(DLogicalDevice* aLogicalDevice)
+	: iExcludedROMAddressStart(ROM_LINEAR_BASE),
+	iExcludedROMAddressEnd(0),
+	iPageSize(0x1000),
+	iBreakManager(0),
+	iStepper(0),
+	iStepLock(0),
+	iDfcQ(NULL),
+	iInitialisedCodeModifier(0),
+	iAsyncGetValueRequest(NULL)
+	{
+	LOG_MSG("DRM_DebugChannel::DRM_DebugChannel()");
+
+	iDevice = aLogicalDevice;
+
+	iClientThread = &Kern::CurrentThread();	
+	iClientThread->Open();
+
+	LOG_MSG3("DRM_DebugChannel::DRM_DebugChannel() clientThread = 0x%08x, id=%d", 
+	            iClientThread, iClientThread->iId );
+
+
+	iPageSize = Kern::RoundToPageSize(1);
+	}
+
+//
+// DRM_DebugChannel destructor
+//
+DRM_DebugChannel::~DRM_DebugChannel()
+	{
+	LOG_MSG("DRM_DebugChannel::~DRM_DebugChannel()");
+
+	if (iAsyncGetValueRequest)
+		{
+		Kern::QueueRequestComplete(iClientThread, iAsyncGetValueRequest, KErrCancel); // does nothing if request not pending
+		Kern::DestroyClientRequest(iAsyncGetValueRequest);
+		}
+
+	NKern::ThreadEnterCS();
+	Kern::SafeClose((DObject*&)iClientThread, NULL);
+	NKern::ThreadLeaveCS();
+
+	// Close breakpoint manager
+	if (iBreakManager)
+		{
+		NKern::ThreadEnterCS();
+		delete iBreakManager;
+		NKern::ThreadLeaveCS();
+		}
+
+	// Close stepping manager
+	if (iStepper)
+		{
+		NKern::ThreadEnterCS();
+		delete iStepper;
+		NKern::ThreadLeaveCS();
+		}
+
+	//close the debug process list
+	iDebugProcessList.Close();
+
+	DestroyDfcQ();
+
+	//close the code modifier
+	if (iInitialisedCodeModifier)
+		{
+		DebugSupport::CloseCodeModifier();
+		}
+	}
+
+void DRM_DebugChannel::DestroyDfcQ()
+	{
+	LOG_MSG("DRM_DebugChannel::DestroyDfcQ()");
+	if (iDfcQ)
+		{
+		NKern::ThreadEnterCS();
+		iDfcQ->Destroy();
+		NKern::ThreadLeaveCS();
+		}
+	}
+
+//
+// DRM_DebugChannel::DoCreate
+//
+TInt DRM_DebugChannel::DoCreate(TInt /*aUnit*/, const TDesC* anInfo, const TVersion& aVer)
+	{
+	LOG_MSG("DRM_DebugChannel::DoCreate()");
+	TInt err = Kern::CreateClientDataRequest(iAsyncGetValueRequest);
+	if(err != KErrNone)
+		return err;
+
+	if (!Kern::QueryVersionSupported(TVersion(KMajorVersionNumber, KMinorVersionNumber, KBuildVersionNumber), aVer))
+		return KErrNotSupported;
+
+	// Do the security check here so that any arbitrary application doesn't make
+	// use of Trk kernel driver.
+	if (!DoSecurityCheck())
+		{
+		LOG_MSG("DRM_DebugChannel::DoCreate() - permission denied!");
+			return KErrPermissionDenied;
+		}
+
+	if (anInfo)
+		{
+		// this is the end address of the user library.
+		// this doesn't seem to be valid for EKA2.
+		// right now we dont need this for EKA2 since we are not worried
+		// about kernel being stopped as kernel is multithreaded.
+		// just retaining this for future use.
+		TBuf8<32> buf;
+		TInt err = Kern::ThreadRawRead(iClientThread, anInfo, &buf, 32);
+		if(err != KErrNone)
+			return err;
+		}
+
+	// Allocate a D_RMD_Breakpoints class as a breakpoint manager
+	NKern::ThreadEnterCS();
+	iBreakManager = new D_RMD_Breakpoints(this);
+	NKern::ThreadLeaveCS();
+	if (iBreakManager == NULL)
+		{
+		LOG_MSG("DRM_DebugChannel::DRM_DebugChannel - could not construct breakpoint manager");
+		return KErrNoMemory;
+		}
+
+	// Initialise the new breakpoint manager object
+	iBreakManager->Init();
+
+	// Allocate a DRMDStepping class as the stepping manager
+	NKern::ThreadEnterCS();
+	iStepper = new DRMDStepping(this);
+	NKern::ThreadLeaveCS();
+	if (iStepper == NULL)
+		{
+		LOG_MSG("DRM_DebugChannel::DRM_DebugChannel - could not construct stepper manager");
+		return KErrNoMemory;
+		}
+
+	// Initialize the code modifier for managing breakpoints.
+	TUint caps; //ignored for now
+	err = DebugSupport::InitialiseCodeModifier(caps, NUMBER_OF_MAX_BREAKPOINTS);
+	//if code modifier initializer failed,
+	//return here, since we can't set an breakpoints
+	if(err != KErrNone)
+		{
+		return err;
+		}
+	else
+		{
+		iInitialisedCodeModifier = ETrue;
+		}
+
+	//create and set the driver's Dfc queue
+	err = CreateDfcQ();
+	if(err != KErrNone)
+		{
+		LOG_MSG("DRM_DebugChannel::DoCreate() Creating Dfc queue failed.");
+		}
+	SetDfcQ(iDfcQ);
+
+	iMsgQ.Receive();
+
+	iEventHandler = new DRM_DebugEventHandler;
+	if (!iEventHandler)
+		return KErrNoMemory;
+	err = iEventHandler->Create(iDevice, this, iClientThread);
+	if (err != KErrNone)
+		return err;
+
+	//return KErrNone;
+	return iEventHandler->Start();
+	}
+
+/**
+Forward call to either synch or asynch methods while serialising all calls via lock.
+ 
+Protect access via a the event handler lock to 
+serialise all calls and protect concurrent access to data structures
+
+@param aMsg pointer to a TMessageBase object 
+
+@return error returned by called methods
+
+@see DRM_DebugEventHandler::HandleSpecificEvent where lock is also used
+@see DRM_DebugEventHandler::iProtectionLock
+
+*/
+TInt DRM_DebugChannel::SendMsg(TMessageBase* aMsg)
+	{
+	DThread * currThread = &Kern::CurrentThread();
+	LOG_MSG3("DRM_DebugChannel::SendMsg() currThread = 0x%08x, iClientThread=0x%08x", currThread, iClientThread );
+
+	iEventHandler->LockDataAccess();
+	
+	TThreadMessage& m = *(TThreadMessage*)aMsg;
+	TInt id = m.iValue;
+	TInt err = KErrNone;
+
+	if (id != (TInt)ECloseMsg && id != KMaxTInt && id < 0)
+		{
+		// DoRequest
+		TRequestStatus* pStatus = (TRequestStatus*)m.Ptr0();
+		err = SendRequest(aMsg);
+		if (err != KErrNone)
+			Kern::RequestComplete(pStatus,err);
+		}
+	else
+		{
+		err = DLogicalChannel::SendMsg(aMsg);
+		}
+	
+	iEventHandler->ReleaseDataAccess();
+	return err;
+	}
+
+//
+// DRM_DebugChannel::SendRequest
+//
+TInt DRM_DebugChannel::SendRequest(TMessageBase* aMsg)
+	{
+	LOG_MSG("DRM_DebugChannel::SendRequest()");
+
+	TThreadMessage& m = *(TThreadMessage*)aMsg;
+	TInt function = ~m.iValue;
+	TRequestStatus* pStatus = (TRequestStatus*)m.Ptr0();
+	TAny* a1 = m.Ptr1();
+
+	TInt err = KErrNotSupported;
+	switch(function)
+		{
+		case RRM_DebugDriver::ERequestGetEvent:
+			err = PreAsyncGetValue((TEventInfo*)a1,pStatus);
+			break;
+		}
+	if (err == KErrNone)
+		err = DLogicalChannel::SendMsg(aMsg);
+	return err;
+	}
+
+//
+// DRM_DebugChannel::PreAsyncGetValue
+//
+TInt DRM_DebugChannel::PreAsyncGetValue(TEventInfo* aValue, TRequestStatus* aStatus)
+	{
+	LOG_MSG3("DRM_DebugChannel::PreAsyncGetValue() TEventInfo=0x%08x, TRequestStatus=0x%08x",
+		aValue, aStatus );
+	
+	iAsyncGetValueRequest->Reset();
+	
+	TInt err = iAsyncGetValueRequest->SetStatus(aStatus);
+	if (err != KErrNone)
+		return err;
+	
+	iAsyncGetValueRequest->SetDestPtr(aValue);
+	return KErrNone;
+	}
+
+/**
+  Create the Dfc queue for receiving messages
+  */
+TInt DRM_DebugChannel::CreateDfcQ()
+	{
+	LOG_MSG("DRM_DebugChannel::CreateDfcQ()");
+	TInt r = Kern::DynamicDfcQCreate(iDfcQ, KRmDebugDriverThreadPriority, KRM_DebugDriverName);
+	// Fix to stop t_rmdebug2 etc crashing the device.
+	// This should be removed once the rm debug driver has been updated for WDP.
+	if (r == KErrNone)
+		iDfcQ->SetRealtimeState(ERealtimeStateOff);
+	return r;
+	}
+
+//
+// DRM_DebugChannel::DoCancel
+//
+// New: The cancel call does not take an enum parameter describing
+// the request to be cancelled. Rather it supplies a pointer
+// to a user-side struct defining the cancellation
+//
+void DRM_DebugChannel::DoCancel(TInt aReqNo)
+	{
+	LOG_MSG("DRM_DebugChannel::DoCancel()");
+
+	TRMD_DebugCancelInfo info;
+
+	TInt err = Kern::ThreadRawRead(iClientThread,(TAny*)aReqNo,(TAny*)&info,sizeof(info));
+	if (err != KErrNone)
+		{
+		// How do we cancel something we know nothing about???
+		LOG_MSG("DRM_DebugChannel::DoCancel - bad arguments");
+		return;
+		}
+
+	// Find the process
+	DTargetProcess* pProcess = TheDProcessTracker.FindProcess(info.iProcessName);
+	if (pProcess == NULL)
+		{
+		// We are doomed. We don't know which event to cancel..
+		LOG_MSG2("Cannot determine which process is being debugged: %S", &(info.iProcessName));
+
+		return;
+		}
+
+	// Find the agent
+	DDebugAgent* debugAgent = pProcess->Agent(info.iAgentId);
+	if (debugAgent == NULL)
+		{
+		// Bad agent means there is no tracking agent
+		LOG_MSG2("Cannot locate debug agent with pid 0x%0x16lx",info.iAgentId);
+		return;
+		}
+
+	// Agent completes/pends the request as appropriate.
+	debugAgent->CancelGetEvent();
+
+	}
+
+//
+// DRM_DebugChannel::DoRequest
+//
+void DRM_DebugChannel::DoRequest(TInt aReqNo, TRequestStatus* aStatus, TAny* a1, TAny* a2)
+	{
+	LOG_MSG4("DRM_DebugChannel::DoRequest(), iClientThread=0x%08x, tid=0x%08x, TRequestStatus=0x%08x", 
+		iClientThread, I64LOW(iClientThread->iId), aStatus);
+
+	switch(aReqNo)
+		{
+		case RRM_DebugDriver::ERequestGetEvent:
+			{
+			TEventMetaData eventMetaData;
+			TInt err = Kern::ThreadRawRead(iClientThread, a2, (TUint8 *)&eventMetaData, sizeof(TEventMetaData) );
+			if (err != KErrNone)
+				{
+				LOG_MSG("Error: could not read argument data from the DSS (TEventMetaData)");
+
+				// We could not read information from the user, so the a2 argument is probably wrong
+				Kern::RequestComplete(iClientThread, aStatus, KErrArgument);
+				return;
+				}
+
+			// Find the process
+			DTargetProcess* pProcess = TheDProcessTracker.FindProcess(eventMetaData.iTargetProcessName);
+			if (pProcess == NULL)
+				{
+				LOG_MSG("Cannot identify process being debugged");
+
+				// We could not locate the process, so the user asked for the wrong one.
+				Kern::RequestComplete(iClientThread, aStatus, KErrArgument);
+				return;
+				}
+
+			// Find the agent
+			DDebugAgent* debugAgent = pProcess->Agent(eventMetaData.iDebugAgentProcessId);
+			LOG_MSG5(" For agent pid=%d, DTargetProcess=0x%08x, Agent=0x%08x, iAsyncGetValueRequest0x%08x", 
+				I64LOW(eventMetaData.iDebugAgentProcessId), pProcess, debugAgent, iAsyncGetValueRequest );
+
+			if (debugAgent == NULL)
+				{
+				// Bad agent means there is no tracking agent
+				LOG_MSG2("Cannot locate debug agent with pid 0x%0x16lx",eventMetaData.iDebugAgentProcessId);
+				return;
+				}
+			// Agent completes/pends the request as appropriate.
+			debugAgent->GetEvent(iAsyncGetValueRequest, iClientThread);
+
+			break;
+			}
+		default:
+			{
+			// Don't know what to do, should not get here!
+			LOG_MSG("DRM_DebugChannel::DoRequest was passed an unsupported request aReqNo");
+
+			Kern::RequestComplete(iClientThread, aStatus, KErrNotSupported);
+			}
+		}
+	}
+
+//
+// DRM_DebugChannel::DoControl
+//
+TInt DRM_DebugChannel::DoControl(TInt aFunction, TAny* a1, TAny* a2)
+	{
+	LOG_MSG("DRM_DebugChannel::DoControl()");
+
+	LOG_MSG2("DoControl Function %d", aFunction);
+
+	TInt err = KErrBadHandle;
+	DThread* threadObj = NULL;
+
+	switch(aFunction)
+		{
+		/* Security first */
+		case RRM_DebugDriver::EControlIsDebuggable:
+			{
+			err = IsDebuggable((TUint32)a1);
+			break;
+			}
+		case RRM_DebugDriver::EControlSetBreak:
+			{
+			err = SetBreak((TSetBreakInfo*)a1);
+			break;
+			}
+		case RRM_DebugDriver::EControlClearBreak:
+			{
+			err = iBreakManager->DoClearBreak((TInt32)a1);
+			break;
+			}
+		case RRM_DebugDriver::EControlModifyBreak:
+			{
+			err = iBreakManager->DoModifyBreak((TModifyBreakInfo*)a1);
+			break;
+			}
+		case RRM_DebugDriver::EControlModifyProcessBreak:
+			{
+			err = iBreakManager->DoModifyProcessBreak((TModifyProcessBreakInfo*)a1);
+			break;
+			}
+		case RRM_DebugDriver::EControlBreakInfo:
+			{
+			err = iBreakManager->DoBreakInfo((TGetBreakInfo*)a1);
+			break;
+			}
+		case RRM_DebugDriver::EControlSuspendThread:
+			{
+			threadObj = DebugUtils::OpenThreadHandle((TUint32)a1);
+			if (threadObj)
+			{
+				err = DoSuspendThread(threadObj);
+			}
+			break;
+			}
+		case RRM_DebugDriver::EControlResumeThread:
+			{
+			threadObj = DebugUtils::OpenThreadHandle((TUint32)a1);
+			if (threadObj)
+				{
+				err = DoResumeThread(threadObj);
+				}
+			break;
+			}
+		case RRM_DebugDriver::EControlStepRange:
+			{
+			threadObj = DebugUtils::OpenThreadHandle((TUint32)a1);
+			if (threadObj)
+				{
+				err = StepRange(threadObj, (TRM_DebugStepInfo*)a2);
+				}
+			break;
+			}
+		case RRM_DebugDriver::EControlReadMemory:
+			{
+			threadObj = DebugUtils::OpenThreadHandle((TUint32)a1);
+			if (threadObj)
+				{
+				err = ReadMemory(threadObj, (TRM_DebugMemoryInfo*)a2);
+				}
+			break;
+			}
+		case RRM_DebugDriver::EControlWriteMemory:
+			{
+			threadObj = DebugUtils::OpenThreadHandle((TUint32)a1);
+			if (threadObj)
+				{
+				err = WriteMemory(threadObj, (TRM_DebugMemoryInfo*)a2);
+				}
+			break;
+			}
+		case RRM_DebugDriver::EControlReadRegistersLegacy:
+			{
+			threadObj = DebugUtils::OpenThreadHandle((TUint32)a1);
+			if (threadObj)
+				{
+				err = ReadRegistersLegacy(threadObj, (TRM_DebugRegisterInfo*)a2);
+				}
+			break;
+			}
+		case RRM_DebugDriver::EControlWriteRegistersLegacy:
+			{
+			threadObj = DebugUtils::OpenThreadHandle((TUint32)a1);
+			if (threadObj)
+				{
+				err = WriteRegistersLegacy(threadObj, (TRM_DebugRegisterInfo*)a2);
+				}
+			break;
+			}
+		case RRM_DebugDriver::EControlReadRegisters:
+			{
+			threadObj = DebugUtils::OpenThreadHandle((TUint32)a1);
+			if (threadObj)
+				{
+				err = ReadRegisters(threadObj, (TRM_DebugRegisterInformation*)a2);
+				}
+			break;
+			}
+		case RRM_DebugDriver::EControlWriteRegisters:
+			{
+			threadObj = DebugUtils::OpenThreadHandle((TUint32)a1);
+			if (threadObj)
+				{
+				err = WriteRegisters(threadObj, (TRM_DebugRegisterInformation*)a2);
+				}
+			break;
+			}
+		case RRM_DebugDriver::EControlGetDebugFunctionalityBufSize:
+			{
+			LOG_MSG("RRM_DebugDriver::EControlGetDebugFunctionalityBufSize\n");
+
+			TDebugFunctionality df;
+
+			TUint size = df.GetDebugFunctionalityBufSize();
+
+			// Return size to user-side in a safe manner
+			err = Kern::ThreadRawWrite(iClientThread, a1, (TUint8*)&size, sizeof(TUint), iClientThread);
+			break;
+			}
+		case RRM_DebugDriver::EControlGetDebugFunctionality:
+			{
+			LOG_MSG("RRM_DebugDriver::EControlGetDebugFunctionality\n");
+
+			TDebugFunctionality df;
+
+			TUint32 dfsize = df.GetDebugFunctionalityBufSize();
+
+			// Alloc tmp buffer for Debug Functionality data
+			NKern::ThreadEnterCS();
+			TUint8* dfbuffer = (TUint8*)Kern::AllocZ(dfsize);
+			NKern::ThreadLeaveCS();
+			if (dfbuffer==NULL)
+				{
+				LOG_MSG2("Could not allocate memory for %d bytes\n",dfsize);
+
+				// could not allocate memory
+				return KErrNoMemory;
+				}
+
+			// Temporary descriptor to hold DF data
+			TPtr8 tmpPtr(dfbuffer,0,dfsize);
+
+			// Obtain the DF data
+			if (df.GetDebugFunctionality(tmpPtr) )
+				{
+				// Return the DF data to the user-side
+				err = Kern::ThreadDesWrite(iClientThread, a1, tmpPtr, 0, KChunkShiftBy0, iClientThread);
+				}
+			else
+				{
+				// Failed.
+				err = KErrGeneral;
+				}
+
+			// Free tmp buffer
+			NKern::ThreadEnterCS();
+			Kern::Free(dfbuffer);
+			NKern::ThreadLeaveCS();
+			break;
+			}
+		case RRM_DebugDriver::EControlAttachProcess:
+			{
+			LOG_MSG("RRM_DebugDriver::EControlAttachProcess");
+
+			err = AttachProcess(a1,a2);
+			break;
+			}
+		case RRM_DebugDriver::EControlDetachProcess:
+			{
+			LOG_MSG("RRM_DebugDriver::EControlDetachProcess");
+
+			err = DetachProcess(a1,a2);
+			break;
+			}
+		case RRM_DebugDriver::EControlDetachAgent:
+			{
+			LOG_MSG("RRM_DebugDriver::EControlDetachAgent");
+
+			err = DetachAgent(a1,a2);
+			break;
+			}
+		case RRM_DebugDriver::EControlSetEventAction:
+			{
+			LOG_MSG("RRM_DebugDriver::EControlSetEventAction");
+
+			err = SetEventAction(a1,a2);
+			break;
+			}
+		case RRM_DebugDriver::EControlGetMemoryOperationMaxBlockSize:
+			{
+			LOG_MSG("RRM_DebugDriver::EControlGetMemoryOperationMaxBlockSize\n");
+
+			TUint32 maxSize = TDebugFunctionality::GetMemoryOperationMaxBlockSize();
+
+			// Return size to user-side in a safe manner
+			err = Kern::ThreadRawWrite(iClientThread, a1, (TUint8*)&maxSize, sizeof(TUint32), iClientThread);
+			break;
+			}
+		case RRM_DebugDriver::EControlGetList:
+			{
+			LOG_MSG("RRM_DebugDriver::EControlGetList\n");
+			err = GetList((TListInformation*)a1);
+			break;
+			}
+		case RRM_DebugDriver::EControlStep:
+			{
+			LOG_MSG("RRM_DebugDriver::EControlStep\n");
+
+			err = Step((TUint32)a1,(TUint32)a2);
+			break;
+			}
+		case RRM_DebugDriver::EControlKillProcess:
+			{
+			LOG_MSG("RRM_DebugDriver::EControlKillProcess\n");
+
+			err = KillProcess((TUint32)a1,(TUint32)a2);
+			break;
+			}
+		default:
+			{
+			err = KErrGeneral;
+			}
+		}
+
+	if (KErrNone != err)
+		{
+		LOG_MSG2("Error %d from control function", err);
+		}
+
+	if (threadObj)
+		{
+		// Close the thread handle which has been opened by DebugUtils::OpenThreadHandle
+		threadObj->Close(NULL);
+		}
+
+	return err;
+	}
+
+void DRM_DebugChannel::HandleMsg(TMessageBase* aMsg)
+	{
+	LOG_MSG("DRM_DebugChannel::HandleMsg()");
+
+	TThreadMessage& m = *(TThreadMessage*)aMsg;
+	TInt id = m.iValue;
+
+	if (id == (TInt)ECloseMsg)
+		{
+		if (iEventHandler)
+			{
+			iEventHandler->Stop();
+			iEventHandler->Close();
+			iEventHandler = NULL;
+			}
+		m.Complete(KErrNone, EFalse);
+		return;
+		}
+
+	if (id == KMaxTInt)
+		{
+		// DoCancel
+		DoCancel(m.Int0());
+		m.Complete(KErrNone, ETrue);
+		return;
+		}
+
+	if (id < 0)
+		{
+		// DoRequest
+		TRequestStatus* pStatus = (TRequestStatus*)m.Ptr0();
+		DoRequest(~id, pStatus, m.Ptr1(), m.Ptr2());
+		m.Complete(KErrNone, ETrue);
+		}
+	else
+		{
+		// DoControl
+		TInt err = DoControl(id, m.Ptr0(), m.Ptr1());
+		m.Complete(err, ETrue);
+		}
+	}
+
+//
+// DRM_DebugChannel::RemoveProcess
+//
+TBool DRM_DebugChannel::RemoveProcess(TAny* a1, TAny* a2)
+	{
+	LOG_MSG("DRM_DebugChannel::RemoveProcess()");
+
+	DProcess *aProcess = (DProcess*)a1;
+
+	// Sanity check
+	if (!aProcess)
+		{
+		// No process was specified!
+		LOG_MSG("DRM_DebugChannel::RemoveProcess was called with an invalid process ID");
+		return EFalse;
+		}
+
+	// this is called when a process dies.  we want to mark any breakpoints in this
+	// process space as obsolete.  the main reason for this is so we don't return
+	// an error when the host debugger tries to clear breakpoints for the process
+
+	TUint32 codeAddress = 0;
+	TUint32 codeSize = 0;
+
+	LOG_EVENT_MSG2("Process being removed, Name %S", aProcess->iName);
+
+	DCodeSeg* codeSeg = aProcess->iCodeSeg;
+
+	if (codeSeg)
+		{
+		TModuleMemoryInfo processMemoryInfo;
+		TInt err = codeSeg->GetMemoryInfo(processMemoryInfo, aProcess);
+		if (err != KErrNone)
+			{
+			codeAddress = processMemoryInfo.iCodeBase;
+			codeSize = processMemoryInfo.iCodeSize;
+			}
+		else
+			{
+			LOG_MSG2("Error in getting memory info: %d", err);
+			}
+		}
+
+	if (!codeAddress || !codeSize)
+		{
+		LOG_EVENT_MSG2("Code segment not available for process %d", aProcess->iId);
+		// make sure there is not already a breakpoint at this address
+		for (TInt i = 0; i < iDebugProcessList.Count(); i++)
+			{
+			if (iDebugProcessList[i].iId == aProcess->iId)
+				{
+				codeAddress = iDebugProcessList[i].iCodeAddress;
+				codeSize = iDebugProcessList[i].iCodeSize;
+
+				//now remove from the list
+				iDebugProcessList.Remove(i);
+				break;
+				}
+			}
+		}
+
+	if (!codeAddress || !codeSize)
+		{
+		return EFalse;
+		}
+
+	iBreakManager->RemoveBreaksForProcess(aProcess->iId, codeAddress, codeSize);
+	return EFalse;
+	}
+
+//
+// DRM_DebugChannel::StartThread
+//
+TBool DRM_DebugChannel::StartThread(TAny* a1, TAny* a2)
+	{
+	LOG_EVENT_MSG("DRM_DebugChannel::StartThread()");
+
+	DThread *aThread = (DThread*)a1;
+	if(!aThread)
+		{
+		LOG_MSG("Error getting DThread object");
+		__NK_ASSERT_DEBUG(aThread);
+		return EFalse;
+		}
+
+	//a2 points to the thread creating the new thread.
+	//We have no use for it at the moment so just ignore it for now
+
+	TDriverEventInfo info;
+	info.iEventType = EEventsStartThread;
+	info.iThreadId = aThread->iId;
+	info.iThreadIdValid = ETrue;
+	DProcess* owningProcess = aThread->iOwningProcess;
+	if(owningProcess)
+		{
+		info.iProcessId = owningProcess->iId;
+		info.iProcessIdValid = ETrue;
+		DCodeSeg* p = owningProcess->iCodeSeg;
+		if(p && p->iFileName)
+			{
+			info.iFileName.Copy(*(p->iFileName));
+			DTargetProcess* foundProcess = TheDProcessTracker.FindProcess(*(p->iFileName));
+			if(foundProcess)
+				{
+				foundProcess->NotifyEvent(info);
+				}
+			else
+				{
+				LOG_EVENT_MSG2("Couldn't find process with name [%S]", p->iFileName);
+				}
+			}
+		else
+			{
+			if(p)
+				{
+				LOG_EVENT_MSG("\tCode segment name missing");
+				}
+			else
+				{
+				LOG_EVENT_MSG("\tCode segment is NULL");
+				}
+			}
+		}
+	return EFalse;
+	}
+
+//
+// DRM_DebugChannel::HandleAddProcessEvent
+//
+TBool DRM_DebugChannel::HandleAddProcessEvent(TAny* a1, TAny* a2)
+	{
+	LOG_EVENT_MSG("DRM_DebugChannel::AddProcess()");
+
+	DProcess *aProcess = (DProcess*)a1;
+	// a2 points to the thread creating the new process.
+	DThread *aThread = (DThread*)a2;
+
+	if(!aProcess)
+		{
+		LOG_MSG("Error getting DProcess object");
+		__NK_ASSERT_DEBUG(aProcess);
+		return EFalse;
+		}
+
+	TDriverEventInfo info;
+	info.iEventType = EEventsAddProcess;
+	info.iProcessId = aProcess->iId;
+
+	info.iCreatorThreadId  = aThread ? aThread->iId : 0;
+	info.iProcessIdValid = ETrue;
+
+	// Copy TUids
+	info.iUids = aProcess->iUids;
+
+	info.iUidsValid = ETrue;
+
+	// copy name of the process
+	if (aProcess->iName)
+		{
+		// copy the name of the process
+		info.iFileName.Copy(*aProcess->iName);
+
+		DTargetProcess* foundProcess = TheDProcessTracker.FindProcess(*(aProcess->iName));
+		if(foundProcess)
+			{
+			foundProcess->NotifyEvent(info);
+			}
+		else
+			{
+			// AddProcess event does not have fully-qualified path, it has "filename.exe"
+			// So we try a less-precise match
+			DTargetProcess* foundProcess = TheDProcessTracker.FuzzyFindProcess(*(aProcess->iName));
+			if(foundProcess)
+				{
+				foundProcess->NotifyEvent(info);
+				}
+			else
+				{
+				LOG_EVENT_MSG2("Couldn't find process with name [%S]", aProcess->iName);
+				}
+			}
+		}
+	else
+		{
+		LOG_EVENT_MSG("DRM_DebugChannel::AddProcess - No iName for this process");
+		}
+
+	return EFalse;
+	}
+
+//
+// DRM_DebugChannel::HandleRemoveProcessEvent
+//
+TBool DRM_DebugChannel::HandleRemoveProcessEvent(TAny* a1, TAny* a2)
+	{
+	LOG_MSG("DRM_DebugChannel::HandleRemoveProcessEvent()");
+
+	DProcess *aProcess = (DProcess*)a1;
+	if(!aProcess)
+		{
+		LOG_MSG("Error getting DProcess object");
+		__NK_ASSERT_DEBUG(aProcess);
+		return EFalse;
+		}
+
+	// a2 points to the thread creating the new process.
+	// We have no use for it at the moment so just ignore it for now
+	// Also, it may not be known and therefore NULL
+
+	TDriverEventInfo info;
+	info.iEventType = EEventsRemoveProcess;
+	info.iProcessId = aProcess->iId;
+	info.iProcessIdValid = ETrue;
+
+	// copy name of the process
+	if (aProcess->iName)
+		{
+		// copy the name of the process
+		info.iFileName.Copy(*aProcess->iName);
+
+		DTargetProcess* foundProcess = TheDProcessTracker.FindProcess(*(aProcess->iName));
+		if(foundProcess)
+			{
+			foundProcess->NotifyEvent(info);
+			}
+		else
+			{
+			// RemoveProcess event does not have fully-qualified path, it has "filename.exe"
+			// So we try a less-precise match
+			DTargetProcess* foundProcess = TheDProcessTracker.FuzzyFindProcess(*(aProcess->iName));
+			if(foundProcess)
+				{
+				foundProcess->NotifyEvent(info);
+				}
+			else
+				{
+				LOG_EVENT_MSG2("Couldn't find process with name [%S]", aProcess->iName);
+				}
+			}
+
+		}
+	else
+		{
+		LOG_EVENT_MSG("DRM_DebugChannel::AddProcess - No iName for this process");
+		}
+
+	return EFalse;
+	}
+
+//
+// DRM_DebugChannel::AddLibrary
+//
+TBool DRM_DebugChannel::AddLibrary(TAny* a1, TAny* a2)
+	{
+	LOG_EVENT_MSG("DRM_DebugChannel::AddLibrary()");
+
+	DLibrary *aLibrary = (DLibrary*)a1;
+	DThread *aThread = (DThread*)a2;
+
+	// sanity check
+	if (!aLibrary)
+		{
+		LOG_EVENT_MSG("DRM_DebugChannel::AddLibrary called with no library specified");
+		return EFalse;
+		}
+
+	if (!aThread)
+		{
+		LOG_EVENT_MSG("DRM_DebugChannel::AddLibrary called with no thread specified");
+		return EFalse;
+		}
+
+	LOG_EVENT_MSG2(("Lib loaded: %S"), aLibrary->iName);
+
+	if (aThread)
+		{
+		// make sure this is not the debugger thread
+		if ((aThread != iClientThread) && (aThread->iOwningProcess->iId != iClientThread->iOwningProcess->iId))
+			{
+			TDriverEventInfo info;
+
+			info.iEventType = EEventsAddLibrary;
+			info.iProcessId = aThread->iOwningProcess->iId;
+			info.iProcessIdValid = ETrue;
+			info.iThreadId = aThread->iId;
+			info.iThreadIdValid = ETrue;
+
+			//get the code address
+			DCodeSeg* codeSeg = aLibrary->iCodeSeg;
+			if (!codeSeg)
+				{
+				LOG_EVENT_MSG2("Code segment not available for library %S", aLibrary->iName);
+				return EFalse;
+				}
+
+			// Uid3
+			info.iUids = codeSeg->iUids;
+			info.iUidsValid = ETrue;
+
+			TModuleMemoryInfo memoryInfo;
+			TInt err = codeSeg->GetMemoryInfo(memoryInfo, NULL); //NULL for DProcess should be ok;
+			if (err != KErrNone)
+				{
+				LOG_EVENT_MSG2("Error in getting memory info: %d", err);
+				return EFalse;
+				}
+
+			info.iCodeAddress = memoryInfo.iCodeBase;
+			info.iDataAddress = memoryInfo.iInitialisedDataBase;
+
+			info.iFileName.Copy(*(aLibrary->iName)); //just the name, without uid info.
+
+			//queue up or complete the event
+			info.iArg1 = a1;
+			info.iArg2 = a2;
+			NotifyEvent(info);
+			}
+
+		}
+	return EFalse;
+	}
+
+//
+// DRM_DebugChannel::RemoveLibrary
+//
+TBool DRM_DebugChannel::RemoveLibrary(TAny* a1, TAny* a2)
+	{
+	LOG_EVENT_MSG("DRM_DebugChannel::RemoveLibrary()");
+	DLibrary *aLibrary = (DLibrary*)a1;
+
+	// sanity check
+	if (!aLibrary)
+		{
+		LOG_EVENT_MSG("DRM_DebugChannel::RemoveLibrary called with no library specified");
+		return EFalse;
+		}
+
+	LOG_EVENT_MSG2(("Lib unloaded: %S"), aLibrary->iName);
+
+	// this is called when all handles to this library have been closed.  this can happen when a process dies, or when a dll is
+	// unloaded while the process lives on.  in former case, we don't need to notify the host debugger because that process is
+	// dying anyway.  for the latter case, we do need to notify the host so it can unload the symbolics, etc.
+
+	DThread* aThread = &Kern::CurrentThread();
+
+	if ((aThread) &&
+			(aThread != iClientThread) &&
+			(aThread->iOwningProcess->iId != iClientThread->iOwningProcess->iId))
+		{
+		//the library gets unloaded only when the mapcount is 0.
+		if (aLibrary->iMapCount != 0)
+			return EFalse;
+
+		DCodeSeg* codeSeg = aLibrary->iCodeSeg;
+		if (!codeSeg)
+			{
+			LOG_EVENT_MSG2("Code segment not available for library %S", aLibrary->iName);
+			return EFalse;
+			}
+
+		TModuleMemoryInfo processMemoryInfo;
+		TInt err = codeSeg->GetMemoryInfo(processMemoryInfo, NULL); //passing NULL for the DProcess argument should be ok;
+		if (err != KErrNone)
+			{
+			LOG_EVENT_MSG2("Error in getting memory info: %d", err);
+			return EFalse;
+			}
+
+		TUint32 codeAddress = processMemoryInfo.iCodeBase;
+		TUint32 codeSize = processMemoryInfo.iCodeSize;
+
+		// first invalidate all breakpoints that were set in the library code
+		iBreakManager->InvalidateLibraryBreakPoints(codeAddress, codeSize);
+		DProcess *process = &Kern::CurrentProcess();
+		RArray<SCodeSegEntry>* dynamicCode = &(process->iDynamicCode);
+
+		for (TInt j=0; j<dynamicCode->Count(); j++)
+			{
+			if ((*dynamicCode)[j].iLib == aLibrary)
+				{
+				TDriverEventInfo info;
+
+				info.iEventType = EEventsRemoveLibrary;
+				info.iFileName.Copy(*(aLibrary->iName)); //lib name without uid info
+				//info.iFileName.ZeroTerminate();
+				info.iProcessId = process->iId;
+				info.iProcessIdValid = ETrue;
+				info.iThreadId = 0xFFFFFFFF; // don't care!
+				info.iThreadIdValid = EFalse;
+				// Uid3
+				info.iUids = codeSeg->iUids;
+				info.iUidsValid = ETrue;
+
+				//queue up or complete the event
+				info.iArg1 = a1;
+				info.iArg2 = a2;
+				NotifyEvent(info);
+				}
+			}
+		}
+	return EFalse;
+	}
+
+//
+// DRM_DebugChannel::HandleEventKillThread
+//
+TBool DRM_DebugChannel::HandleEventKillThread(TAny* a1, TAny* a2)
+	{
+
+	LOG_MSG2("DRM_DebugChannel::HandleEventKillThread(Thread a1=0x%08x)", a1 );
+
+	DThread* currentThread = &Kern::CurrentThread();
+	if (!currentThread)
+		{
+		LOG_MSG("Error getting current thread");
+		__NK_ASSERT_DEBUG(currentThread);
+		return EFalse;
+		}
+
+	// a1 should point to the current thread, check this to make sure it does
+	__NK_ASSERT_DEBUG((DThread*)a1 == currentThread);
+
+	TDriverEventInfo info;
+
+	info.iProcessId = currentThread->iOwningProcess->iId;
+	info.iProcessIdValid = ETrue;
+	info.iThreadId = currentThread->iId;
+	info.iThreadIdValid = ETrue;
+	// 14 should probably be replaced by PC_REGISTER, for some reason PC_REGISTER had been replaced with 14 in the code
+	TInt err = ReadKernelRegisterValue(currentThread, 14, info.iCurrentPC);
+	if(err != KErrNone)
+		{
+		LOG_EVENT_MSG2("DRM_DebugChannel::HandleEventKillThread - Non-zero error code discarded: %d", err);
+		}
+
+	if (currentThread->iExitType == EExitPanic)
+		{
+		info.iPanicCategory.Copy(currentThread->iExitCategory);
+		}
+	info.iExceptionNumber = currentThread->iExitReason;
+	info.iExitType = currentThread->iExitType;
+	info.iEventType = EEventsKillThread;
+
+	// Are we debugging this process - decide based on iFileName
+	DCodeSeg* codeSeg = currentThread->iOwningProcess->iCodeSeg;
+
+	// remove all the breakpoints in this thread, whether we are debugging it or not.
+	iBreakManager->DoRemoveThreadBreaks(info.iThreadId);
+
+	// if the code seg exists then get the file name from it and check we're debugging it
+	if(codeSeg)
+		{
+		DTargetProcess* foundProcess = TheDProcessTracker.FindProcess(*(codeSeg->iFileName));
+		if(!foundProcess)
+			{
+			// not debugging this process so return false
+			return EFalse;
+			}
+		}
+	else
+		{
+		// can't validate that we are debugging the thread
+		return EFalse;
+		}
+
+	info.iArg1 = a1;
+	info.iArg2 = a2;
+	NotifyEvent(info);
+
+	return ETrue;
+	}
+
+//
+// DRM_DebugChannel::HandleSwException
+//
+TBool DRM_DebugChannel::HandleSwException(TAny* a1, TAny* a2)
+	{
+	LOG_EVENT_MSG("DRM_DebugChannel::HandleSwException");
+	TExcType aExcType = (TExcType)(TInt)a1;
+
+	TDriverEventInfo info;
+
+	DThread* currentThread = &Kern::CurrentThread();
+	if (!currentThread)
+		{
+		LOG_MSG("Error getting current thread");
+		__NK_ASSERT_DEBUG(currentThread);
+		return EFalse;
+		}
+
+	info.iProcessId = currentThread->iOwningProcess->iId;
+	info.iProcessIdValid = ETrue;
+	info.iThreadId = currentThread->iId;
+	info.iThreadIdValid = ETrue;
+	TInt err = ReadKernelRegisterValue(currentThread, PC_REGISTER, info.iCurrentPC);
+	if(err != KErrNone)
+		{
+		LOG_EVENT_MSG2("DRM_DebugChannel::HandleSwException - Non-zero error code discarded: %d", err);
+		}
+	info.iExceptionNumber = aExcType;
+	info.iEventType = EEventsSwExc;
+	info.iArg1 = a1;
+	info.iArg2 = a2;
+
+	NotifyEvent(info);
+
+	return EFalse;
+	}
+
+//
+// DRM_DebugChannel::HandleHwException
+//
+TBool DRM_DebugChannel::HandleHwException(TAny* a1, TAny* a2)
+	{
+	TArmExcInfo* aExcInfo = (TArmExcInfo*)a1;
+
+	// sanity check
+	if (!aExcInfo)
+		{
+		LOG_MSG("DRM_DebugChannel::HandleHwException called with no aExcInfo");
+		__NK_ASSERT_DEBUG(aExcInfo);
+		return EFalse;
+		}
+
+	TDriverEventInfo info;
+
+	DThread* currentThread = &Kern::CurrentThread();
+
+	if (!currentThread)
+		{
+		LOG_MSG("Error getting current thread");
+		__NK_ASSERT_DEBUG(currentThread);
+		return EFalse;
+		}
+
+	info.iProcessId = currentThread->iOwningProcess->iId;
+	info.iProcessIdValid = ETrue;
+	info.iThreadId = currentThread->iId;
+	info.iThreadIdValid = ETrue;
+	info.iRmdArmExcInfo.iFaultAddress= aExcInfo->iFaultAddress;
+	info.iRmdArmExcInfo.iFaultStatus= aExcInfo->iFaultStatus;
+
+	LOG_MSG5("DRM_DebugChannel::HandleHwException current thread = 0x%08x, CritSect count=%d,\n"
+		" iFaultAddress=0x%08x, iFaultStatus=0x%08x",
+		currentThread, currentThread->iNThread.iCsCount, aExcInfo->iFaultAddress, aExcInfo->iFaultStatus);
+
+	info.iRmdArmExcInfo.iR0= aExcInfo->iR0;
+	info.iRmdArmExcInfo.iR1= aExcInfo->iR1;
+	info.iRmdArmExcInfo.iR2= aExcInfo->iR2;
+	info.iRmdArmExcInfo.iR3= aExcInfo->iR3;
+
+	info.iRmdArmExcInfo.iR4= aExcInfo->iR4;
+	info.iRmdArmExcInfo.iR5= aExcInfo->iR5;
+	info.iRmdArmExcInfo.iR6= aExcInfo->iR6;
+	info.iRmdArmExcInfo.iR7= aExcInfo->iR7;
+	info.iRmdArmExcInfo.iR8= aExcInfo->iR8;
+	info.iRmdArmExcInfo.iR9= aExcInfo->iR9;
+	info.iRmdArmExcInfo.iR10= aExcInfo->iR10;
+	info.iRmdArmExcInfo.iR11= aExcInfo->iR11;
+	info.iRmdArmExcInfo.iR12= aExcInfo->iR12;
+
+	info.iRmdArmExcInfo.iR13= aExcInfo->iR13;
+	info.iRmdArmExcInfo.iR14= aExcInfo->iR14;
+	info.iRmdArmExcInfo.iR15= aExcInfo->iR15;
+
+	info.iRmdArmExcInfo.iCpsr= aExcInfo->iCpsr;
+	info.iRmdArmExcInfo.iR13Svc= aExcInfo->iR13Svc;
+	info.iRmdArmExcInfo.iR14Svc= aExcInfo->iR14Svc;
+	info.iRmdArmExcInfo.iSpsrSvc= aExcInfo->iSpsrSvc;
+	LOG_MSG5(" iCpsr=0x%x, iExcCode=0x%x, R14=0x%x, R15=0x%x",
+			aExcInfo->iCpsr, aExcInfo->iExcCode, aExcInfo->iR14, aExcInfo->iR15);
+
+	switch (aExcInfo->iExcCode)
+		{
+		case 0:
+			info.iExceptionNumber = EExcCodeAbort;
+			LOG_EVENT_MSG(" iExcCode == 0 => EExcCodeAbort");
+			break;
+		case 1:
+			info.iExceptionNumber = EExcDataAbort;
+			LOG_EVENT_MSG(" iExcCode == 1 => EExcDataAbort");
+			break;
+		case 2:
+			info.iExceptionNumber = EExcInvalidOpCode;
+			LOG_EVENT_MSG(" iExcCode == 2 => EExcInvalidOpCode");
+			break;
+		default:
+			// new event? Something gone wrong?
+			__NK_ASSERT_DEBUG(EFalse);
+			return EFalse;
+		}
+
+	info.iEventType = EEventsHwExc;
+
+	info.iArg1 = a1;
+	info.iArg2 = a2;
+
+	if(EExcInvalidOpCode == info.iExceptionNumber)
+		{
+		return HandleInvalidOpCodeException(info, currentThread);
+		}
+
+	NotifyEvent(info);
+	return EFalse;
+	}
+
+//
+// DRM_DebugChannel::HandUserTrace
+//
+TBool DRM_DebugChannel::HandleUserTrace(TAny* a1, TAny* a2)
+	{
+	LOG_EVENT_MSG("DRM_DebugChannel::HandleUserTrace()");
+
+	DThread* currentThread = &Kern::CurrentThread();
+	if (!currentThread)
+		{
+		LOG_EVENT_MSG("Error getting current thread");
+		__NK_ASSERT_DEBUG(currentThread);
+		return EFalse;
+		}
+
+	TDriverEventInfo info;
+	info.iProcessId = currentThread->iOwningProcess->iId;
+	info.iProcessIdValid = ETrue;
+	info.iThreadId = currentThread->iId;
+	info.iThreadIdValid = ETrue;
+	info.iEventType = EEventsUserTrace;
+	info.iArg1 = a1;
+	info.iArg2 = a2;
+
+	TInt err = KErrNone;
+
+	//User Trace info
+	XTRAP(err, XT_DEFAULT, kumemget(info.iUserTraceText, info.iArg1, (TInt)a2));
+	if(KErrNone != err)
+		{
+		return EFalse;
+		}
+
+	info.iMessageStatus = ESingleMessage;
+
+	NotifyEvent(info);
+
+	return EFalse;
+	}
+
+//
+// DRM_DebugChannel::HandleException
+//
+TBool DRM_DebugChannel::HandleInvalidOpCodeException(TDriverEventInfo& aEventInfo, DThread* aCurrentThread)
+	{
+	LOG_MSG("DRM_DebugChannel::HandleInvalidOpCodeException()");
+
+	TInt err = KErrNone;
+
+	TUint32 inst = KArmBreakPoint;
+	TInt instSize = 4;
+
+	// change these for thumb mode
+	TUint32 regValue;
+	err = ReadKernelRegisterValue(aCurrentThread, STATUS_REGISTER, regValue);
+	if(err != KErrNone)
+		{
+		LOG_MSG2("DRM_DebugChannel::HandleInvalidOpCodeException - Non-zero error code discarded: %d", err);
+		}
+
+	if (regValue & ECpuThumb)
+		{
+		inst = KThumbBreakPoint;
+		instSize = 2;
+		}
+
+	TUint32 instruction = 0;
+	err = Kern::ThreadRawRead(aCurrentThread, (TUint32 *)aEventInfo.iRmdArmExcInfo.iR15, (TUint8 *)&instruction, instSize);
+
+	if (KErrNone != err)
+		LOG_MSG2("Error reading instruction at currentpc: %d", err);
+
+	if (!memcompare((TUint8 *)&inst, instSize, (TUint8 *)&instruction, instSize))
+		{
+		TInt err = DoSuspendThread(aCurrentThread);
+		if(! ((KErrNone == err) || (KErrAlreadyExists == err)) )
+			{
+			LOG_MSG2("DRM_DebugChannel::HandleInvalidOpCodeException() Thread with id 0x%08x could not be suspended.", aCurrentThread->iId);
+			return EFalse;
+			}
+
+		// the exception was a breakpoint instruction.  see if we have a breakpoint at that address
+		TBreakEntry* breakEntry = NULL;
+		do
+			{
+			breakEntry = iBreakManager->GetNextBreak(breakEntry);
+			if (breakEntry && ((breakEntry->iThreadSpecific && breakEntry->iId == aEventInfo.iThreadId) || (!breakEntry->iThreadSpecific && breakEntry->iId == aEventInfo.iProcessId)) && breakEntry->iAddress == aEventInfo.iRmdArmExcInfo.iR15)
+				{
+				LOG_MSG2("Breakpoint with Id %d has been hit", breakEntry->iBreakId);
+
+				TBreakEntry tempBreakEntry = *breakEntry;
+
+				//change the event type to breakpoint type
+				aEventInfo.iEventType = breakEntry->iThreadSpecific ? EEventsBreakPoint : EEventsProcessBreakPoint;
+
+				// enable any breakpoints we had to disable for this thread
+				err = iBreakManager->DoEnableDisabledBreak(aEventInfo.iThreadId);
+				if (KErrNone != err)
+					LOG_MSG2("Error %d enabling disabled breakpoints", err);
+
+				// see if this is a temp breakpoint
+				if (iBreakManager->IsTemporaryBreak(*breakEntry))
+					{
+					// this was a temp breakpoint, so we need to clear it now
+					err = iBreakManager->DoClearBreak(breakEntry->iBreakId);
+					if (KErrNone != err)
+						LOG_MSG2("Error %d clearing temp breakpoint", err);
+
+					// Find out how many steps remain to be done
+
+					// reduce the number of steps to complete by 1
+					tempBreakEntry.iNumSteps--;
+
+					LOG_MSG2("There are %d steps remaining\n", tempBreakEntry.iNumSteps);
+
+					// New. If we have not finished do all the steps, continue stepping and don't notify event
+					if (tempBreakEntry.iNumSteps)
+						{
+						LOG_MSG("Continuing stepping...not telling the agent yet\n");
+						err = DoStepRange(aCurrentThread, aEventInfo.iRmdArmExcInfo.iR15, aEventInfo.iRmdArmExcInfo.iR15, ETrue, tempBreakEntry.iResumeOnceOutOfRange /*EFalse*/, tempBreakEntry.iNumSteps, ETrue);
+						if (err != KErrNone)
+							{
+							LOG_EVENT_MSG("Failed to continue stepping\n");
+
+							// what do we do? might as well stop here and tell the user
+							NotifyEvent(aEventInfo);
+
+							return ETrue;
+							}
+
+						// continue as though no event occured. No need to suspend/resume anything...
+						LOG_MSG("Continuing to step\n");
+						return ETrue;
+						}
+
+					// Is this a case where we just want to continue?
+					if (tempBreakEntry.iResumeOnceOutOfRange)
+						{
+						LOG_MSG("PC is out of range, continuing thread");
+						DoResumeThread(aCurrentThread);
+
+						return ETrue;
+						}
+					}
+
+				// if the breakpoint is thread specific, make sure it's the right thread
+				// if not, just continue the thread.  take special care if it's the debugger
+				// thread.  if it hits a regular breakpoint, we NEVER want to stop at it.  if
+				// it hits a temp breakpoint, we're probably just stepping past a real breakpoint
+				// and we do need to handle it.
+				TBool needToResume = (tempBreakEntry.iThreadSpecific && tempBreakEntry.iId != aEventInfo.iThreadId) ||
+					(!tempBreakEntry.iThreadSpecific && tempBreakEntry.iId != aEventInfo.iProcessId);
+
+				if (needToResume)
+					{
+					LOG_MSG("breakpoint does not match threadId, calling DoResumeThread");
+					err = DoResumeThread(aCurrentThread);
+					if (KErrNone != err)
+						LOG_MSG2("Error in DoResumeThread: %d", err);
+
+					return EFalse;
+					}
+
+				//normal user break point, just notify the event
+				break;
+				}
+			} while(breakEntry);
+		}
+
+	NotifyEvent(aEventInfo);
+
+	return (aEventInfo.iEventType == EEventsBreakPoint) || (aEventInfo.iEventType == EEventsProcessBreakPoint);
+	}
+
+//
+// DRM_DebugChannel::SetBreak
+//
+TInt DRM_DebugChannel::SetBreak(TSetBreakInfo* aBreakInfo)
+	{
+	LOG_MSG("DRM_DebugChannel::SetBreak()");
+
+	TInt err = KErrNone;
+
+	if (!aBreakInfo)
+		{
+		LOG_MSG("DRM_DebugChannel::SetBreak() was passed a NULL argument");
+		return KErrArgument;
+		}
+
+	//User side memory is not accessible directly
+	TSetBreakInfo info;
+	err = Kern::ThreadRawRead(iClientThread, aBreakInfo, (TUint8*)&info, sizeof(TSetBreakInfo));
+	if (err != KErrNone)
+		{
+		LOG_MSG("DRM_DebugChannel::SetBreak() was passed a bad argument");
+		return err;
+		}
+
+	DProcess* process = NULL;
+	if(info.iThreadSpecific)
+		{
+		// if the target thread is not suspended then return KErrInUse
+		if(!TheDProcessTracker.CheckSuspended(info.iId))
+			{
+			LOG_MSG2("DRM_DebugChannel::SetBreak() Thread with id 0x%08x not suspended.", info.iId);
+			return KErrInUse;
+			}
+		DThread* thread = DebugUtils::OpenThreadHandle(info.iId);
+		if(!thread)
+			{
+			LOG_MSG2("DRM_DebugChannel::SetBreak() Thread with id 0x%08x not found", info.iId);
+			return KErrNotFound;
+			}
+		process = DebugUtils::OpenProcessHandle(thread->iOwningProcess->iId);
+		thread->Close(NULL);
+		}
+	else
+		{
+		process = DebugUtils::OpenProcessHandle(info.iId);
+		}
+
+	if(!process)
+		{
+		LOG_MSG2("DRM_DebugChannel::SetBreak() Process with id 0x%08x not found", process->iId);
+		return KErrNotFound;
+		}
+
+	TBool found = EFalse;
+	for(TInt i=0; i<iDebugProcessList.Count(); i++)
+		{
+		if(process->iId == iDebugProcessList[i].iId)
+			{
+			found = ETrue;
+			}
+		}
+
+	if(!found)
+		{
+		DCodeSeg* codeSeg = process->iCodeSeg;
+		if (!codeSeg)
+			{
+			LOG_MSG2("DRM_DebugChannel::SetBreak() Code seg for process with id 0x%08x not found", process->iId);
+			return KErrNotFound;
+			}
+
+		TModuleMemoryInfo memoryInfo;
+		TInt err = codeSeg->GetMemoryInfo(memoryInfo, process);
+		if (err != KErrNone)
+			{
+			LOG_MSG2("DRM_DebugChannel::SetBreak() Error getting memory info for process with id 0x%08x", process->iId);
+			return err;
+			}
+
+		//add this process to the list of processes that we are debugging
+		TProcessInfo processInfo(process->iId, memoryInfo.iCodeBase, memoryInfo.iCodeSize, memoryInfo.iInitialisedDataBase);
+		iDebugProcessList.Append(processInfo);
+		process->Close(NULL);
+		}
+
+	if (!info.iBreakId) //first check if the iId address is valid
+		return KErrArgument;
+
+	if (err == KErrNone)
+		{
+		TInt32 iBreakId;
+
+		err = iBreakManager->DoSetBreak(iBreakId, info.iId, info.iThreadSpecific, info.iAddress, info.iMode );
+
+		if (err == KErrNone)
+			{
+			err = Kern::ThreadRawWrite(iClientThread, (TUint8 *)info.iBreakId, &iBreakId, sizeof(TInt32), iClientThread);
+			}
+		}
+
+	return err;
+	}
+
+//
+// DRM_DebugChannel::StepRange
+//
+TInt DRM_DebugChannel::StepRange(DThread* aThread, TRM_DebugStepInfo* aStepInfo)
+	{
+	LOG_MSG("DRM_DebugChannel::StepRange()");
+
+	TInt err = KErrNone;
+
+	if(!TheDProcessTracker.CheckSuspended(aThread))
+		{
+		LOG_MSG2("DRM_DebugChannel::StepRange() Thread with id 0x%08x not suspended.", aThread->iId);
+		return KErrInUse;
+		}
+
+	if (!aStepInfo)
+		return KErrArgument;
+
+	TRM_DebugStepInfo info(0, 0, 0);
+	err = Kern::ThreadRawRead(iClientThread, aStepInfo, (TUint8*)&info, sizeof(TRM_DebugStepInfo));
+
+	if (err != KErrNone)
+		return err;
+
+	err = DoStepRange(aThread, info.iStartAddress, info.iStopAddress, info.iStepInto, EFalse, ETrue);
+
+	return err;
+	}
+
+/**
+Read memory from a target thread and return the data to the client. If the
+memory block has breakpoints in it then the correct values are placed in the
+returned data
+
+@param aThread pointer to thread whose memory space the memory is to be read from
+@param aMemoryInfo information about what memory to read
+
+@return KErrNone if memory read successfully,
+        KErrArgument if aMemoryInfo is not initialised correctly,
+        KErrNoMemory if a temporary buffer could not be allocated,
+        KErrBadHandle if aThread is invalid,
+        or another of the system wide error codes
+*/
+TInt DRM_DebugChannel::ReadMemory(DThread* aThread, TRM_DebugMemoryInfo* aMemoryInfo)
+	{
+	LOG_MSG("DRM_DebugChannel::ReadMemory()");
+
+	TInt err = KErrNone;
+
+	if (!aMemoryInfo)
+		return KErrArgument;
+
+	TRM_DebugMemoryInfo info(0, 0, 0);
+	err = Kern::ThreadRawRead(iClientThread, aMemoryInfo, (TUint8*)&info, sizeof(TRM_DebugMemoryInfo));
+	if (err != KErrNone)
+		return err;
+
+	if (!info.iData)
+		return KErrArgument;
+
+	NKern::ThreadEnterCS();
+	TUint8 *data = (TUint8*)Kern::Alloc(info.iLength);
+	NKern::ThreadLeaveCS();
+	if (!data)
+		{
+		return KErrNoMemory;
+		}
+
+	TPtr8 dataDes(data, info.iLength);
+
+	err = DoReadMemory(aThread, info.iAddress, info.iLength, dataDes);
+	if (err == KErrNone)
+		{
+		err = Kern::ThreadDesWrite(iClientThread, info.iData, dataDes, 0, KChunkShiftBy0, iClientThread);
+		}
+
+	NKern::ThreadEnterCS();
+	Kern::Free(data);
+	NKern::ThreadLeaveCS();
+
+	return err;
+	}
+
+/**
+Attempt to write memory to aThread's address space
+
+@param aThread thread to whose address space memory is to be written
+@param aMemoryInfo memory info object representing the data to write
+
+@return KErrNone if memory written successfully,
+        KErrNoMemory if memory could not be allocated
+        KErrArgument if aMemoryInfo is NULL, if aMemoryInfo.iData is NULL,
+        if aMemoryInfo.iLength is greater than than the length of the passed
+        in descrptor
+        KErrBadHandle if aThread is invalid,
+	or another of the system wide error codes
+*/
+TInt DRM_DebugChannel::WriteMemory(DThread* aThread, TRM_DebugMemoryInfo* aMemoryInfo)
+	{
+	LOG_MSG("DRM_DebugChannel::WriteMemory()");
+
+	TInt err = KErrNone;
+
+	if (!aMemoryInfo)
+		return KErrArgument;
+
+	TRM_DebugMemoryInfo info(0, 0, 0);
+	err = Kern::ThreadRawRead(iClientThread, aMemoryInfo, (TUint8*)&info, sizeof(TRM_DebugMemoryInfo));
+	if (err != KErrNone)
+		return err;
+
+	if (!info.iData)
+		return KErrArgument;
+
+	NKern::ThreadEnterCS();
+	TUint8 *data = (TUint8*)Kern::Alloc(info.iLength);
+	NKern::ThreadLeaveCS();
+	if (!data)
+		{
+		return KErrNoMemory;
+		}
+
+	TPtr8 dataDes(data, info.iLength);
+
+	err = Kern::ThreadDesRead(iClientThread, info.iData, dataDes, 0);
+	if (err == KErrNone)
+		{
+		err = DoWriteMemory(aThread, info.iAddress, info.iLength, dataDes);
+		}
+
+	NKern::ThreadEnterCS();
+	Kern::Free(data);
+	NKern::ThreadLeaveCS();
+
+	return err;
+	}
+
+//
+// DRM_DebugChannel::ReadRegisters
+//
+TInt DRM_DebugChannel::ReadRegistersLegacy(DThread* aThread, TRM_DebugRegisterInfo* aRegisterInfo)
+	{
+	LOG_MSG("DRM_DebugChannel::ReadRegistersLegacy()");
+
+	TInt err = KErrNone;
+
+	if (!aRegisterInfo)
+		return KErrArgument;
+
+	TRM_DebugRegisterInfo info(0, 0, 0);
+	err = Kern::ThreadRawRead(iClientThread, aRegisterInfo, (TUint8*)&info, sizeof(TRM_DebugRegisterInfo));
+	if (err != KErrNone)
+		return err;
+
+	if (!info.iValues)
+		return KErrArgument;
+
+	TUint length = (info.iLastRegister - info.iFirstRegister + 1) * 4;
+
+	NKern::ThreadEnterCS();
+	TUint8 *values = (TUint8*)Kern::Alloc(length);
+	NKern::ThreadLeaveCS();
+	if (!values)
+		{
+		return KErrNoMemory;
+		}
+
+	TPtr8 valuesDes(values, length);
+
+	err = DoReadRegisters(aThread, info.iFirstRegister, info.iLastRegister, valuesDes);
+	if (err == KErrNone)
+		{
+		err = Kern::ThreadDesWrite(iClientThread, info.iValues, valuesDes, 0, KChunkShiftBy0, iClientThread);
+		}
+
+	NKern::ThreadEnterCS();
+	Kern::Free(values);
+	NKern::ThreadLeaveCS();
+
+	return err;
+	}
+
+/**
+Get listing information.
+
+@param aListInformation pointer to a TListInformation object containing the
+       user specified listings information
+
+@return KErrNone on success,
+        KErrTooBig if the kernel's data is too big to fit in the passed buffer,
+        KErrArgument if aListInformation is NULL,
+	or one of the other system-wide error codes
+*/
+TInt DRM_DebugChannel::GetList(TListInformation* aListInformation) const
+	{
+	LOG_MSG("DRM_DebugChannel::GetList()");
+
+	TInt err = KErrNone;
+
+	if(aListInformation == NULL)
+		{
+		return KErrArgument;
+		}
+
+	//read DSS' data into local structure
+	TListInformation info;
+	err = Kern::ThreadRawRead(iClientThread, aListInformation, (TUint8*)&info, sizeof(TListInformation));
+	if(err != KErrNone)
+		{
+		return err;
+		}
+
+	//check arguments
+	TPtr8 buffer(NULL, 0);
+	err = AllocAndReadDes(iClientThread, *info.iBuffer, buffer);
+	if(err != KErrNone)
+		{
+		//need to free the buffer if it was allocated
+		if(err != KErrNoMemory)
+			{
+			NKern::ThreadEnterCS();
+			Kern::Free((TAny*)buffer.Ptr());
+			NKern::ThreadLeaveCS();
+			}
+		return err;
+		}
+
+	//get the list
+	TUint32 dataSize = 0;
+	TListManager manager;
+	err = KErrArgument;
+	switch(info.iType)
+		{
+		case EXipLibraries:
+			if(Debug::EScopeGlobal == info.iListScope)
+				{
+				err = manager.GetXipLibrariesList(buffer, dataSize);
+				}
+			break;
+
+		case EThreads:
+			if(Debug::EScopeGlobal == info.iListScope)
+				{
+				err = manager.GetGlobalThreadList(buffer, dataSize);
+				}
+			else if(Debug::EScopeProcessSpecific == info.iListScope)
+				{
+				err = manager.GetThreadListForProcess(buffer, dataSize, info.iTargetId);
+				}
+			else if(Debug::EScopeThreadSpecific == info.iListScope)
+				{
+				err = manager.GetThreadListForThread(buffer, dataSize, info.iTargetId);
+				}
+			break;
+
+		case EProcesses:
+			if(Debug::EScopeGlobal == info.iListScope)
+				{
+				err = manager.GetProcessList(buffer, dataSize);
+				}
+			break;
+
+		case ECodeSegs:
+			if(Debug::EScopeGlobal == info.iListScope)
+				{
+				err = manager.GetGlobalCodeSegList(buffer, dataSize);
+				}
+			else if(Debug::EScopeProcessSpecific == info.iListScope)
+				{
+				err = manager.GetCodeSegListForProcess(buffer, dataSize, info.iTargetId);
+				}
+			else if(Debug::EScopeThreadSpecific == info.iListScope)
+				{
+				err = manager.GetCodeSegListForThread(buffer, dataSize, info.iTargetId);
+				}
+			break;
+
+		default:
+			err = KErrNotSupported;
+		}
+
+	if(err == KErrNone)
+		{
+		//if no error then write the buffer back
+		err = Kern::ThreadDesWrite(iClientThread, info.iBuffer, buffer, 0, KChunkShiftBy0, iClientThread);
+		}
+
+	//write back the size of the data regardless of any error
+	TInt writeErr = Kern::ThreadRawWrite(iClientThread, info.iDataSize, (TUint8*)&dataSize, sizeof(TUint32), iClientThread);
+	if(writeErr != KErrNone)
+		{
+		//if there was an error writing the size return that error instead
+		err = writeErr;
+		}
+
+	//free the buffer
+	NKern::ThreadEnterCS();
+	Kern::Free((TAny*)buffer.Ptr());
+	NKern::ThreadLeaveCS();
+
+	return err;
+	}
+
+/**
+Read registers and store register data in aRegisterInfo
+
+@param aThread thread to read registers from
+@param aRegisterInfo structure specifying which registers to read and providing
+       descriptors to write the register data into
+
+@return KErrNone if registers were read successfully. Note that this does not
+        mean that all the registers could be read, the
+        aRegisterInfo.iRegisterFlags array should be checked as to whether each
+        individual register could be read,
+        KErrArgument if aRegisterInfo is NULL, or if any of the pointers that
+        are members of aRegisterInfo are NULL, if an unknown register is
+        specified or if the passed in register values buffer is too small
+        KErrNoMemory if there is insufficient memory,
+        KErrDied, if the thread with thread ID aThreadId is dead
+*/
+TInt DRM_DebugChannel::ReadRegisters(DThread* aThread, TRM_DebugRegisterInformation* aRegisterInfo) const
+	{
+	LOG_MSG("DRM_DebugChannel::ReadRegisters()");
+
+	TInt err = KErrNone;
+
+	if (!aRegisterInfo)
+		return KErrArgument;
+
+	TRM_DebugRegisterInformation info;
+	err = Kern::ThreadRawRead(iClientThread, aRegisterInfo, (TUint8*)&info, sizeof(TRM_DebugRegisterInformation));
+	if (err != KErrNone)
+		return err;
+
+	if ((!info.iRegisterIds) || (!info.iRegisterValues) || (!info.iRegisterFlags))
+		return KErrArgument;
+
+	//read ids from client thread
+	TPtr8 ids(NULL, 0);
+	err = AllocAndReadDes(iClientThread, *info.iRegisterIds, ids);
+	if(err != KErrNone)
+		{
+		if(err == KErrNoMemory)
+			{
+			NKern::ThreadEnterCS();
+			Kern::Free((TAny*)ids.Ptr());
+			NKern::ThreadLeaveCS();
+			}
+		return err;
+		}
+
+	//read values from client thread
+	TPtr8 values(NULL, 0);
+	err = AllocAndReadDes(iClientThread, *info.iRegisterValues, values, EFalse);
+	if(err != KErrNone)
+		{
+		if(err == KErrNoMemory)
+			{
+			NKern::ThreadEnterCS();
+			Kern::Free((TAny*)values.Ptr());
+			NKern::ThreadLeaveCS();
+			}
+
+		NKern::ThreadEnterCS();
+		Kern::Free((TAny*)ids.Ptr());
+		NKern::ThreadLeaveCS();
+		return err;
+		}
+
+	//read flags from client thread
+	TPtr8 flags(NULL, 0);
+	err = AllocAndReadDes(iClientThread, *info.iRegisterFlags, flags, EFalse);
+	if(err != KErrNone)
+		{
+		if(err == KErrNoMemory)
+			{
+			NKern::ThreadEnterCS();
+			Kern::Free((TAny*)flags.Ptr());
+			NKern::ThreadLeaveCS();
+			}
+		NKern::ThreadEnterCS();
+		Kern::Free((TAny*)ids.Ptr());
+		Kern::Free((TAny*)values.Ptr());
+		NKern::ThreadLeaveCS();
+		return err;
+		}
+
+	err = DoReadRegisters(aThread, ids, values, flags);
+	if (err == KErrNone)
+		{
+		err = Kern::ThreadDesWrite(iClientThread, info.iRegisterValues, values, 0, KChunkShiftBy0, iClientThread);
+		if(err == KErrNone)
+			{
+			err = Kern::ThreadDesWrite(iClientThread, info.iRegisterFlags, flags, 0, KChunkShiftBy0, iClientThread);
+			}
+		}
+
+	NKern::ThreadEnterCS();
+	Kern::Free((TAny*)ids.Ptr());
+	Kern::Free((TAny*)values.Ptr());
+	Kern::Free((TAny*)flags.Ptr());
+	NKern::ThreadLeaveCS();
+
+	return err;
+	}
+
+/**
+@deprecated use DRM_DebugChannel::WriteRegisters(DThread* aThread, TRM_DebugRegisterInformation* aRegisterInfo) instead
+*/
+TInt DRM_DebugChannel::WriteRegistersLegacy(DThread* aThread, const TRM_DebugRegisterInfo* aRegisterInfo)
+	{
+	LOG_MSG("DRM_DebugChannel::WriteRegistersLegacy()");
+
+	TInt err = KErrNone;
+
+	if (!aRegisterInfo)
+		return KErrArgument;
+
+	TRM_DebugRegisterInfo info(0, 0, 0);
+	err = Kern::ThreadRawRead(iClientThread, aRegisterInfo, (TUint8*)&info, sizeof(TRM_DebugRegisterInfo));
+	if (err != KErrNone)
+		return err;
+
+	if (!info.iValues)
+		return KErrArgument;
+
+	TUint length = (info.iLastRegister - info.iFirstRegister + 1) * 4;
+
+	NKern::ThreadEnterCS();
+	TUint8 *values = (TUint8*)Kern::Alloc(length);
+	NKern::ThreadLeaveCS();
+	if (!values)
+		{
+		return KErrNoMemory;
+		}
+
+	TPtr8 valuesDes(values, length);
+
+	err = Kern::ThreadDesRead(iClientThread, info.iValues, valuesDes, 0);
+	if (err == KErrNone)
+		{
+		err = DoWriteRegisters(aThread, info.iFirstRegister, info.iLastRegister, valuesDes);
+		}
+
+	NKern::ThreadEnterCS();
+	Kern::Free(values);
+	NKern::ThreadLeaveCS();
+
+	return err;
+	}
+
+/**
+Write registers and store flags data in aRegisterInfo
+
+@param aThread thread to write registers to
+@param aRegisterInfo structure specifying which registers to write and providing
+       descriptors to write the register flags data into
+
+@return KErrNone if registers were written successfully. Note that this does not
+        mean that all the registers could be written, the flags array
+        should be checked as to whether each individual register could be read,
+        KErrArgument if aRegisterInfo is NULL, or if any of the pointers that
+        are members of aRegisterInfo are NULL, if an unknown register is
+        specified or if the passed in register values buffer is too small, or
+        if aThread is NULL,
+        KErrGeneral if there was a problem initialising the register set,
+        KErrNoMemory if there is insufficient memory,
+        KErrDied, if the thread with thread ID aThreadId is dead
+*/
+TInt DRM_DebugChannel::WriteRegisters(DThread* aThread, TRM_DebugRegisterInformation* aRegisterInfo) const
+	{
+	LOG_MSG("DRM_DebugChannel::WriteRegisters()");
+
+	TInt err = KErrNone;
+
+	if (!aRegisterInfo)
+		return KErrArgument;
+
+	TRM_DebugRegisterInformation info;
+	err = Kern::ThreadRawRead(iClientThread, aRegisterInfo, (TUint8*)&info, sizeof(TRM_DebugRegisterInformation));
+	if (err != KErrNone)
+		return err;
+
+	if ((!info.iRegisterIds) || (!info.iRegisterValues) ||(!info.iRegisterFlags))
+		return KErrArgument;
+
+	//read ids from client thread
+	TPtr8 ids(NULL, 0);
+	err = AllocAndReadDes(iClientThread, *info.iRegisterIds, ids);
+	if(err != KErrNone)
+		{
+		if(err == KErrNoMemory)
+			{
+			NKern::ThreadEnterCS();
+			Kern::Free((TAny*)ids.Ptr());
+			NKern::ThreadLeaveCS();
+			}
+		return err;
+		}
+
+	//read values from client thread
+	TPtr8 values(NULL, 0);
+	err = AllocAndReadDes(iClientThread, *info.iRegisterValues, values);
+	if(err != KErrNone)
+		{
+		if(err == KErrNoMemory)
+			{
+			NKern::ThreadEnterCS();
+			Kern::Free((TAny*)values.Ptr());
+			NKern::ThreadLeaveCS();
+			}
+		NKern::ThreadEnterCS();
+		Kern::Free((TAny*)ids.Ptr());
+		NKern::ThreadLeaveCS();
+		return err;
+		}
+
+	//read flags from client thread
+	TPtr8 flags(NULL, 0);
+	err = AllocAndReadDes(iClientThread, *info.iRegisterFlags, flags, EFalse);
+	if(err != KErrNone)
+		{
+		if(err == KErrNoMemory)
+			{
+			NKern::ThreadEnterCS();
+			Kern::Free((TAny*)flags.Ptr());
+			NKern::ThreadLeaveCS();
+			}
+		NKern::ThreadEnterCS();
+		Kern::Free((TAny*)ids.Ptr());
+		Kern::Free((TAny*)values.Ptr());
+		NKern::ThreadLeaveCS();
+		return err;
+		}
+
+	err = DoWriteRegisters(aThread, ids, values, flags);
+	if(err == KErrNone)
+		{
+		err = Kern::ThreadDesWrite(iClientThread, info.iRegisterFlags, flags, 0, KChunkShiftBy0, iClientThread);
+		}
+
+	NKern::ThreadEnterCS();
+	Kern::Free((TAny*)ids.Ptr());
+	Kern::Free((TAny*)values.Ptr());
+	Kern::Free((TAny*)flags.Ptr());
+	NKern::ThreadLeaveCS();
+
+	return err;
+	}
+
+/**
+Suspends execution of the specified thread.
+
+@param aThread thread to resume
+
+@return KErrNone if there were no problems or KErrArgument if aThread is NULL
+*/
+TInt DRM_DebugChannel::DoSuspendThread(DThread *aThread)
+	{
+	LOG_MSG("DRM_DebugChannel::DoSuspendThread()");
+
+	if (!aThread)
+		{
+		LOG_MSG("Invalid dthread object");
+		return KErrArgument;
+		}
+
+	return TheDProcessTracker.SuspendThread(aThread);
+	}
+
+/**
+Resumes execution of the specified thread.
+
+@param aThread thread to resume
+
+@return KErrNone if there were no problems, KErrArgument if aThread is NULL
+        or an error value returned from DoStepRange()
+*/
+TInt DRM_DebugChannel::DoResumeThread(DThread *aThread)
+	{
+	LOG_MSG("DRM_DebugChannel::DoResumeThread()");
+
+	if (!aThread)
+		return KErrArgument;
+
+	// get the current PC
+	TUint32 currentPC;
+	TInt err = ReadKernelRegisterValue(aThread, PC_REGISTER, currentPC);
+	if(err != KErrNone)
+		{
+		LOG_MSG2("DRM_DebugChannel::DoResumeThread - Non-zero error code discarded: %d", err);
+		}
+
+	// if there is a breakpoint at the current PC, we need to single step past it
+	TBreakEntry* breakEntry = NULL;
+	do
+		{
+		breakEntry = iBreakManager->GetNextBreak(breakEntry);
+		if(breakEntry && !iBreakManager->IsTemporaryBreak(*breakEntry))
+			{
+			if (breakEntry->iAddress == currentPC)
+				{
+				return DoStepRange(aThread, currentPC, currentPC+1, ETrue, 1, ETrue);
+				}
+			}
+		} while(breakEntry);
+
+	return TheDProcessTracker.ResumeThread(aThread);
+	}
+
+//
+// DRM_DebugChannel::DoStepRange
+//
+TInt DRM_DebugChannel::DoStepRange(DThread *aThread, const TUint32 aStartAddress, const TUint32 aStopAddress, TBool aStepInto, TBool aResumeOnceOutOfRange, const TUint32 aNumSteps, TBool aUserRequest)
+	{
+	LOG_MSG("DRM_DebugChannel::DoStepRange()");
+
+	if (!aThread)
+		return KErrArgument;
+
+	//check that the thread is suspended
+	if(!TheDProcessTracker.CheckSuspended(aThread))
+		{
+		LOG_MSG2("DRM_DebugChannel::DoStepRange() Thread with id 0x%08x not suspended.", aThread->iId);
+		return KErrInUse;
+		}
+
+	TUint32 startAddress = (aStartAddress & 0x1) ? aStartAddress + 1 : aStartAddress;
+	TUint32 stopAddress = (aStopAddress & 0x1) ? aStopAddress + 1 : aStopAddress;;
+
+	// don't allow the user to step in the excluded ROM region.  this could be called
+	// internally however.  for example, the the special breakpoints we set to handle
+	// panics, exceptions, and library loaded events are in the user library, and we
+	// will need to step past the breakpoint before continuing the thread.
+	//if (aUserRequest && (startAddress >= iExcludedROMAddressStart) && (startAddress < iExcludedROMAddressEnd))
+	//{
+	//	return KErrNotSupported;
+	//}
+
+	// set the temp breakpoint, and disable the breakpoint at the current PC if necessary
+	// if its not a user request, and we are just trying to resume from a breakpoint,
+	// then we don't need to check for stubs. The last parameter aUserRequest tells
+	// ModifyBreaksForStep to check for stubs or not. In some cases, the check for stubs
+	// is true even if its not a user request.For example, this is true in cases where
+	// we are doing a step range and the instruction in the range modified PC.
+	// in this case, DoStepRange will be called from the exception handler where
+	// we need to check for the stubs for the valid behavior. So truly, we don't need to check
+	// for stubs only when resuming from  a breakpoint.
+	ReturnIfError(iStepper->ModifyBreaksForStep(aThread, startAddress, stopAddress, aResumeOnceOutOfRange, aUserRequest, aNumSteps));
+
+	LOG_MSG("DRM_DebugChannel::DoStepRange() - resuming thread\n");
+
+	return TheDProcessTracker.ResumeThread(aThread);
+	}
+
+/**
+Read memory from the specified addres into the aData descriptor. If there is a
+breakpoint set in the region of memory returned then the correct data value is
+inserted into the descriptor
+
+@param aThread pointer to thread whose address space memory is to be read from
+@param aAddress address to start reading memory from
+@param aLength length of memory block to read
+@param aData descriptor to read memory into
+
+@return KErrNone if memory read successfully,
+        KErrNotSupported if reading from the rom section is not supported,
+        KErrBadHandle if aThread is invalid,
+        or one of the other system wide error codes
+*/
+TInt DRM_DebugChannel::DoReadMemory(const DThread *aThread, const TUint32 aAddress, const TUint32 aLength, TDes8 &aData) const
+	{
+	LOG_MSG("DRM_DebugChannel::DoReadMemory()");
+
+	// make sure the parameters are valid
+	if (aLength > aData.MaxSize())
+		return KErrArgument;
+
+	TInt err = KErrNone;
+
+	// trap exceptions in case the address is invalid
+	XTRAPD(r, XT_DEFAULT, err = TryToReadMemory(aThread, (TAny *)aAddress, (TAny *)aData.Ptr(), aLength));
+
+	err = (KErrNone == r) ? err : r;
+
+	if (KErrNone == err)
+		{
+		aData.SetLength(aLength);
+
+		TPtr8 data((TUint8 *)aData.Ptr(), aLength, aLength);
+
+		// if we have any breakpoints in this range, put the actual instruction in the buffer
+		TBreakEntry* breakEntry = NULL;
+		do
+			{
+			breakEntry = iBreakManager->GetNextBreak(breakEntry);
+			if(breakEntry && !iBreakManager->IsTemporaryBreak(*breakEntry))
+				{
+				if ((breakEntry->iAddress >= aAddress) && (breakEntry->iAddress < (aAddress + aLength)))
+					{
+					TInt instSize;
+
+					switch(breakEntry->iMode)
+						{
+						case EArmMode:
+							instSize = 4;
+							break;
+
+						case EThumbMode:
+							instSize = 2;
+							break;
+
+						case EThumb2EEMode:
+						default:
+							LOG_MSG("DRM_DebugChannel::DoReadMemory() cannot fixup breakpoints with unsupported architecture");
+							return KErrNotSupported;
+						}
+					memcpy((TAny*)&data[breakEntry->iAddress - aAddress], (TAny *)breakEntry->iInstruction.Ptr(), instSize);
+					}
+				}
+			} while(breakEntry);
+		}
+
+	return err;
+	}
+
+/**
+Attempt to write memory to aThread's address space
+
+@param aThread thread to whose address space memory is to be written
+@param aAddress memory location to write memory to
+@param aLength number of bytes of data to write
+@param aData descriptor containing memory to write
+
+@return KErrNone if memory written successfully,
+        KErrArgument if aLength is greater than than the length of the aData
+        KErrBadHandle if aThread is invalid,
+	or another of the system wide error codes
+*/
+TInt DRM_DebugChannel::DoWriteMemory(DThread *aThread, const TUint32 aAddress, const TUint32 aLength, TDes8 &aData)
+	{
+	LOG_MSG("DRM_DebugChannel::DoWriteMemory()");
+
+	// make sure the parameters are valid
+	if (aLength > aData.Length())
+		return KErrArgument;
+
+	TInt err = KErrNone;
+
+	// trap exceptions in case the address is invalid
+	XTRAPD(r, XT_DEFAULT, err = TryToWriteMemory(aThread, (TAny *)aAddress, (TAny *)aData.Ptr(), aLength));
+
+	err = (KErrNone == r) ? err : r;
+
+	// reset any breakpoints we may have just overwritten
+	if (KErrNone == err)
+		{
+		TPtr8 data((TUint8 *)aData.Ptr(), aLength, aLength);
+
+		TBreakEntry* breakEntry = NULL;
+		do
+			{
+			breakEntry = iBreakManager->GetNextBreak(breakEntry);
+			if(breakEntry && !iBreakManager->IsTemporaryBreak(*breakEntry))
+				{
+				if ((breakEntry->iAddress >= aAddress) && (breakEntry->iAddress < (aAddress + aLength)))
+					{
+					// default to arm mode
+					TUint32 inst;
+					TInt instSize;
+
+					switch (breakEntry->iMode)
+						{
+						case EArmMode:
+							inst = KArmBreakPoint;
+							instSize = 4;
+							break;
+
+						case EThumbMode:
+							inst = KThumbBreakPoint;
+							instSize = 2;
+							break;
+
+						case EThumb2EEMode:
+						default:
+							LOG_MSG("DRM_DebugChannel::DoWriteMemory() cannot fixup breakpoints of unsupported architecture type");
+
+							return KErrNotSupported;
+						}
+
+					breakEntry->iInstruction.Copy(&data[breakEntry->iAddress - aAddress], instSize);
+					memcpy((TAny*)breakEntry->iAddress, (TAny *)&inst, instSize);
+					}
+				}
+
+			} while(breakEntry);
+		}
+	return err;
+	}
+
+//
+// DRM_DebugChannel::DoReadRegisters
+//
+TInt DRM_DebugChannel::DoReadRegisters(DThread *aThread, const TInt16 aFirstRegister, const TInt16 aLastRegister, TDes8 &aValues)
+	{
+	LOG_EVENT_MSG("DRM_DebugChannel::DoReadRegisters()");
+
+	// make sure the parameters are valid
+	if (!aThread || (aFirstRegister < 0) || (aLastRegister >= (TInt16)(sizeof(TArmRegSet)/sizeof(TArmReg))))
+		return KErrArgument;
+
+	// make sure the descriptor is big enough to hold the requested data
+	if ((TInt)((aLastRegister - aFirstRegister + 1) * sizeof(TArmReg)) > (aValues.MaxSize()))
+		return KErrArgument;
+
+	TArmRegSet regSet;
+	TUint32 unused;
+
+	NKern::ThreadGetUserContext(&aThread->iNThread, &regSet, unused);
+
+	LOG_MSG2( "DRM_DebugChannel::DoReadRegistersLegacy() : unused = 0x%X\n", unused );
+
+	TArmReg *reg = &regSet.iR0;
+
+	if (!reg)
+		return KErrGeneral;
+
+	for (TInt16 i = aFirstRegister; i <= aLastRegister; i++)
+		aValues.Append((TUint8 *)&reg[i], sizeof(TArmReg));
+
+	return KErrNone;
+}
+
+/**
+  @prototype
+
+  Experimental function for determining whether a thread is suspended.
+
+  @param aThread thread to check if suspended
+
+  @return ETrue if the thread is suspended, EFalse if it isn't or does not exist
+  */
+TBool DRM_DebugChannel::CheckSuspended(const DThread *aThread) const
+	{
+	if(!aThread)
+		{
+		return EFalse;
+		}
+
+	if( (aThread->iNThread.iCsCount>0) && (aThread->iNThread.iCsFunction>0) )
+		{
+		return ETrue;
+		}
+
+	if(aThread->iNThread.iSuspendCount > 0)
+		{
+		return ETrue;
+		}
+	return EFalse;
+	}
+
+/**
+Read registers and store register values in aRegisterValues and the flags
+indicating which registers could be read in aRegisterFlags
+
+@param aThread thread to read registers from
+@param aRegisterIds array containing register IDs to read
+@param aRegisterValues array to store register values in
+@param aRegisterFlags array to store flags in
+
+@return KErrNone if registers were read successfully. Note that this does not
+        mean that all the registers could be read, the aRegisterFlags array
+        should be checked as to whether each individual register could be read,
+        KErrArgument if aThread is NULL, if an unknown register is specified in
+        aRegisterValues or if aRegisterValues is too small
+        KErrGeneral if there was a problem initialising the register set
+*/
+TInt DRM_DebugChannel::DoReadRegisters(DThread *aThread, const TDesC8 &aRegisterIds, TDes8 &aRegisterValues, TDes8& aRegisterFlags) const
+	{
+	LOG_MSG("DRM_DebugChannel::DoReadRegisters()");
+
+	// make sure the parameters are valid
+	if (!aThread)
+		return KErrArgument;
+
+	//Need to revisit this to determine whether there is a way to validate this
+#if 0
+	if ( !CheckSuspended(aThread) )
+		{
+		LOG_MSG2("DRM_DebugChannel::DoReadRegisters() thread with id 0x%08x is not suspended", aThread->iId);
+		return KErrInUse;
+		}
+#endif
+
+	//set lengths of output descriptors to 0 prior to filling
+	aRegisterValues.SetLength(0);
+	aRegisterFlags.SetLength(0);
+
+	TArmRegSet regSet;
+	TUint32 flags;
+
+	NKern::ThreadGetUserContext(&aThread->iNThread, &regSet, flags);
+
+	LOG_MSG2( "DRM_DebugChannel::DoReadRegisters() : flags = 0x%X\n", flags );
+
+	TArmReg *regPtr = &regSet.iR0;
+
+	if (!regPtr)
+		return KErrGeneral;
+
+	TUint numberOfRegisters = aRegisterIds.Length() / sizeof(TRegisterInfo);
+
+	//iterate through registers setting the relevant aFlags value
+	for(TUint i=0; i<numberOfRegisters; i++)
+		{
+		//get current register id
+		TRegisterInfo reg;
+		TInt err = GetTRegisterInfo(aRegisterIds, i, reg);
+		//exit with the error value if there was an error
+		if(err != KErrNone)
+			return err;
+
+		//if unknown register then exit as can't know how many bytes this entry will
+		//represent in aRegisterValues
+		TTag registerTag;
+		TDebugFunctionality::GetRegister(reg, registerTag);
+		if(registerTag.iValue == EAccessUnknown)
+			{
+			return KErrArgument;
+			}
+
+		//get the current register id as a kernel register
+		TArmReg armReg;
+		err = GetKernelRegisterId(reg, armReg);
+		if((err == KErrNotSupported) || (registerTag.iValue == EAccessNone) || (registerTag.iValue == EAccessWriteOnly))
+			{
+			//reading this register is not supported
+			aRegisterFlags.Append(ENotSupported);
+			//just skip over this entry in the values buffer
+			if(aRegisterValues.Length() + registerTag.iSize > aRegisterValues.MaxLength())
+				{
+				//writing this value would cause overflow so exit
+				return KErrArgument;
+				}
+			aRegisterValues.SetLength(aRegisterValues.Length() + registerTag.iSize);
+			}
+		else
+			{
+			if(registerTag.iSize == sizeof(TArmReg))
+				{
+				if(GetFlagAtOffset(flags, armReg))
+					{
+					//set flag as valid
+					aRegisterFlags.Append(EValid);
+					}
+				else
+					{
+					// Even though the flag is invalid, we can return the value of the register
+					// and let the user decide what to do
+					aRegisterFlags.Append(EInValid);
+					}
+
+				if(aRegisterValues.Length() + sizeof(TArmReg) > aRegisterValues.MaxLength())
+					{
+					//writing this value would cause overflow so exit
+					return KErrArgument;
+					}
+				//write value into register into regSet
+				aRegisterValues.Append((TUint8 *)&regPtr[armReg], registerTag.iSize);
+				}
+			else
+				{
+				//currently all kernel supported registers are 4 bytes so
+				//return EBadSize. Would need updating if/when other register
+				//value sizes are supported
+				aRegisterFlags.Append(EBadSize);
+				aRegisterValues.SetLength(aRegisterValues.Length() + registerTag.iSize);
+				}
+			}
+		}
+	return KErrNone;
+	}
+
+//
+// DRM_DebugChannel::DoWriteRegisters
+//
+TInt DRM_DebugChannel::DoWriteRegisters(DThread *aThread, const TInt16 aFirstRegister, const TInt16 aLastRegister, TDesC8 &aValues)
+	{
+	LOG_MSG("DRM_DebugChannel::DoWriteRegisters()");
+
+	// make sure the parameters are valid
+	if (!aThread || (aFirstRegister < 0) || (aLastRegister >= (TInt16)(sizeof(TArmRegSet)/sizeof(TArmReg))))
+		return KErrArgument;
+
+	// make sure the descriptor is big enough to hold the data to write
+	if ((TInt)((aLastRegister - aFirstRegister + 1) * sizeof(TArmReg)) > (aValues.Length()))
+		return KErrArgument;
+
+	TArmRegSet regSet;
+	TUint32 unused;
+
+	NKern::ThreadGetUserContext(&aThread->iNThread, &regSet, unused);
+
+	TArmReg *reg = &regSet.iR0;
+
+	for (TInt16 i = aFirstRegister; i <= aLastRegister; i++)
+		reg[i] = *(TUint32 *)&aValues[(i-aFirstRegister)*sizeof(TArmReg)];
+
+	NKern::ThreadSetUserContext(&aThread->iNThread, &regSet);
+
+	return KErrNone;
+	}
+
+/**
+Write registers and store flags indicating which registers could be read in
+aRegisterFlags
+
+@param aThread thread to write registers to
+@param aRegisterIds array containing register IDs to write
+@param aRegisterValues array containing register values to write
+@param aRegisterFlags array to store flags in
+
+@return KErrNone if registers were written successfully. Note that this does not
+        mean that all the registers could be written, the aRegisterFlags array
+        should be checked as to whether each individual register could be read,
+        KErrArgument if aThread is NULL, if the buffer passed in as
+        aRegisterValue is too small, or if an unknown register is requested,
+        KErrGeneral if there was a problem initialising the register set
+*/
+TInt DRM_DebugChannel::DoWriteRegisters(DThread *aThread, const TDesC8 &aRegisterIds, TDesC8 &aRegisterValues, TDes8 &aRegisterFlags) const
+	{
+	LOG_MSG("DRM_DebugChannel::DoWriteRegisters()");
+
+	// make sure the parameters are valid
+	if (!aThread)
+		return KErrArgument;
+
+	//check that the thread is suspended before reading the registers
+	if(!TheDProcessTracker.CheckSuspended(aThread))
+		{
+		LOG_MSG2("DRM_DebugChannel::DoWriteRegisters() thread with id 0x%08x is not suspended", aThread->iId);
+		return KErrInUse;
+		}
+
+	//get register values from kernel
+	TArmRegSet regSet;
+	TUint32 flags;
+	NKern::ThreadGetUserContext(&aThread->iNThread, &regSet, flags);
+
+	//set lengths of output descriptors to 0 prior to filling
+	aRegisterFlags.SetLength(0);
+
+	//pointer to first kernel register
+	TArmReg *regPtr = &regSet.iR0;
+
+	if (!regPtr)
+		return KErrGeneral;
+
+	//calculate number of registers
+	TUint numberOfRegisters = aRegisterIds.Length() / sizeof(TRegisterInfo);
+
+	//iterate through registers setting the relevant aRegisterFlags value and
+	//setting the necessary value in regSet ready to write to kernel
+	for(TUint i=0, offset = 0; i<numberOfRegisters; i++)
+		{
+		//get current register id
+		TRegisterInfo reg;
+		TInt err = GetTRegisterInfo(aRegisterIds, i, reg);
+		//exit with the error value if there was an error
+		if(err != KErrNone)
+			{
+			return err;
+			}
+
+		//if unknown register then exit as can't know how many bytes this entry will
+		//represent in aRegisterValues
+		TTag registerTag;
+		TDebugFunctionality::GetRegister(reg, registerTag);
+		if(registerTag.iValue == EAccessUnknown)
+			{
+			return KErrArgument;
+			}
+
+		//get the current register id as a kernel register
+		TArmReg armReg;
+		err = GetKernelRegisterId(reg, armReg);
+		if((err == KErrNotSupported) || (registerTag.iValue == EAccessNone) || (registerTag.iValue == EAccessReadOnly))
+			{
+			//writing to this register is not supported
+			aRegisterFlags.Append(ENotSupported);
+			}
+		else if(GetFlagAtOffset(flags, armReg))
+			{
+			if(registerTag.iSize == sizeof(TArmReg))
+				{
+				//set flag as valid
+				aRegisterFlags.Append(EValid);
+				if(offset + sizeof(TArmReg) > aRegisterValues.Length())
+					{
+					//getting this value would cause overflow so exit
+					return KErrArgument;
+					}
+				//write value into register into regSet
+				regPtr[armReg] = *(TUint32 *)&aRegisterValues[offset];
+				}
+			else
+				{
+				//currently all kernel supported registers are 4 bytes so
+				//return EBadSize. Would need updating if/when other register
+				//value sizes are supported
+				aRegisterFlags.Append(EBadSize);
+				}
+
+			}
+		else
+			{
+			//set flag as invalid as register value couldn't be read
+			aRegisterFlags.Append(EInValid);
+			}
+		offset+=registerTag.iSize;
+		}
+
+	//write the input data into the registers
+	NKern::ThreadSetUserContext(&aThread->iNThread, &regSet);
+
+	//return normally
+	return KErrNone;
+	}
+
+//
+// DRM_DebugChannel::DoSecurityCheck
+//
+TBool DRM_DebugChannel::DoSecurityCheck()
+	{
+	LOG_MSG("DRM_DebugChannel::DoSecurityCheck");
+	DProcess* clientProcess = iClientThread->iOwningProcess;
+	if (clientProcess)
+		{
+		SSecurityInfo secureInfo = clientProcess->iS;
+
+		LOG_MSG2("DoSecurityCheck - client secure id is 0x%08x",secureInfo.iSecureId);
+
+		// Ensure we really are communicating with the Debug Security Server
+		if (secureInfo.iSecureId == KUidDebugSecurityServer.iUid )
+			{
+			return ETrue;
+			}
+		}
+	return EFalse;
+	}
+
+/**
+Attempt to read memory from aThread's address space
+
+@param aThread thread from whose address space memory is to be read
+@param aSrc pointer to memory location to read memory from
+@param aDest pointer to memory location to write memory to
+@param aLength number of bytes of data to read
+
+@return KErrNone if memory read successfully,
+	or another of the system wide error codes
+*/
+TInt DRM_DebugChannel::TryToReadMemory(const DThread *aThread, const TAny *aSrc, TAny *aDest, const TUint32 aLength) const
+	{
+	LOG_MSG("DRM_DebugChannel::TryToReadMemory()");
+
+	// make sure the parameters are valid
+	if (!aThread)
+		return KErrArgument;
+
+	//Need to revisit this to determine whether there is a way to validate this
+#if 0
+	//check that the thread is suspended before reading the memory
+	if ( !CheckSuspended(aThread) )
+		{
+		LOG_MSG2("DRM_DebugChannel::TryToReadMemory() thread with id 0x%08x is not suspended", aThread->iId);
+		return KErrInUse;
+		}
+#endif
+
+	LOG_MSG2("Using Kern::ThreadRawRead to read memory at address %x", aSrc);
+	return Kern::ThreadRawRead((DThread *)aThread, aSrc, aDest, aLength);
+	}
+
+/**
+Attempt to write memory to aThread's address space
+
+@param aThread thread to whose address space memory is to be written
+@param aDest pointer to memory location to write memory to
+@param aSrc pointer to memory location to read memory from
+@param aLength number of bytes of data to write
+
+@return KErrNone if memory written successfully, or another of the system wide
+        error codes
+*/
+TInt DRM_DebugChannel::TryToWriteMemory(const DThread *aThread, TAny *aDest, const TAny *aSrc, const TUint32 aLength)
+	{
+	LOG_MSG("DRM_DebugChannel::TryToWriteMemory()");
+
+	//check that the thread is suspended before writing the memory
+	if(!TheDProcessTracker.CheckSuspended((DThread*)aThread))
+		{
+		LOG_MSG2("DRM_DebugChannel::TryToWriteMemory() thread with id 0x%08x is not suspended", aThread->iId);
+		return KErrInUse;
+		}
+
+	LOG_MSG2("Using Kern::ThreadRawWrite to write memory at address %x", (TUint32)aDest);
+	return Kern::ThreadRawWrite((DThread *)aThread, aDest, aSrc, aLength, iClientThread);
+	}
+
+/**
+@deprecated use DRM_DebugChannel::ReadKernelRegisterValue(DThread *aThread, const TArmReg aKernelRegisterId, T4ByteRegisterValue &aValue) instead
+*/
+TInt32 DRM_DebugChannel::ReadRegister(DThread *aThread, TInt aNum)
+	{
+	LOG_MSG("DRM_DebugChannel::ReadRegister()");
+
+	if (!aThread || (aNum < 0) || (aNum >= (TInt16)(sizeof(TArmRegSet)/sizeof(TArmReg))))
+		{
+		LOG_MSG2("Invalid register number (%d) passed to ReadRegister", aNum);
+		return 0;
+		}
+
+	TArmRegSet regSet;
+	TUint32 unused;
+
+	NKern::ThreadGetUserContext(&aThread->iNThread, &regSet, unused);
+
+	TArmReg *reg = &regSet.iR0;
+
+	return ((TUint32 *)reg)[aNum];
+	}
+
+/**
+Given a TArmReg register ID, read the value of the register. The register value
+will be stored in aValue if the register could be read.
+
+@param aThread thread to read register from
+@param aKernelRegisterId ID of register to read from
+@param aValue value read from register
+
+@return KErrNone if value was successfully stored in aValue,
+        KErrNotSupported if aKernelRegister is not supported by the debug
+	security server,
+        or a return value from DRM_DebugChannel::ReadDebugRegisterValue()
+*/
+TInt32 DRM_DebugChannel::ReadKernelRegisterValue(DThread *aThread, const TArmReg aKernelRegisterId, T4ByteRegisterValue &aValue) const
+	{
+	//get register ID as a TRegisterInfo ID
+	TRegisterInfo regId;
+	TInt err = GetDebugRegisterId(aKernelRegisterId, regId);
+	if(err != KErrNone)
+		return err;
+
+	//get the value for the register
+	err = ReadDebugRegisterValue(aThread, regId, aValue);
+	return err;
+	}
+
+/**
+Given a TRegisterInfo register ID, read the value of this register. The
+register value will be stored in aValue if the register could be read.
+
+@param aThread thread to read register from
+@param aDebugRegisterId ID of register to read from
+@param aValue value read from register
+
+@return KErrNone if value was successfully stored in aValue,
+        TRegisterFlag::EInValid if value could not be read from the register,
+        TRegisterFlag::ENotSupported if the register is not supported,
+        KErrNoMemory if temporary memory could not be allocated,
+        or a return value from DRM_DebugChannel::DoReadRegisters
+*/
+TInt32 DRM_DebugChannel::ReadDebugRegisterValue(DThread *aThread, const TRegisterInfo aDebugRegisterId, T4ByteRegisterValue &aValue) const
+	{
+	//allocate temporary buffers to store data
+	NKern::ThreadEnterCS();
+	TUint8* id = (TUint8*)Kern::Alloc(sizeof(TRegisterInfo));
+	NKern::ThreadLeaveCS();
+	if(id == NULL)
+		{
+		return KErrNoMemory;
+		}
+
+	TPtr8 idPtr(id, sizeof(TRegisterInfo));
+
+	NKern::ThreadEnterCS();
+	TUint8* value = (TUint8*)Kern::Alloc(sizeof(T4ByteRegisterValue));
+	NKern::ThreadLeaveCS();
+	if(value == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TPtr8 valuePtr(value, sizeof(T4ByteRegisterValue));
+
+	NKern::ThreadEnterCS();
+	TUint8* flag = (TUint8*)Kern::Alloc(sizeof(TUint8));
+	NKern::ThreadLeaveCS();
+	if(flag == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TPtr8 flagPtr(flag, sizeof(TUint8));
+
+	//store register id in buffer
+	idPtr.Append((TUint8*)&aDebugRegisterId, sizeof(TRegisterInfo));
+
+	//read registers
+	TInt err = DoReadRegisters(aThread, idPtr, valuePtr, flagPtr);
+	if(err == KErrNone)
+		{
+		if(*flag == EValid)
+			{
+			//register could be read so store value
+			aValue = *(T4ByteRegisterValue*)value;
+			}
+		else
+			{
+			//register couldn't be read for some reason
+			err = *flag;
+			}
+		}
+
+	//free memory
+	NKern::ThreadEnterCS();
+	Kern::Free(id);
+	Kern::Free(value);
+	Kern::Free(flag);
+	NKern::ThreadLeaveCS();
+
+	return err;
+	}
+
+//
+// DRM_DebugChannel::NotifyEvent
+//
+void DRM_DebugChannel::NotifyEvent(const TDriverEventInfo& aEventInfo)
+	{
+	LOG_EVENT_MSG("DRM_DebugChannel::NotifyEvent()");
+
+	// Look for the relevant DTargetProcess
+	// We can find out the relevant process id from aEventInfo
+	TUint32 pid = aEventInfo.iProcessId;
+
+	//opening handle to process
+	DProcess* targetProcess = DebugUtils::OpenProcessHandle(pid);
+
+	if(!targetProcess)
+		{
+		LOG_EVENT_MSG("DRM_DebugChannel::NotifyEvent - process does not exist!");
+		return;
+		}
+
+	// Are we debugging this process - decide based on iFileName
+	DCodeSeg* p = targetProcess->iCodeSeg;
+	DTargetProcess* foundProcess;
+	if (p)
+		{
+		 foundProcess = TheDProcessTracker.FindProcess(*(p->iFileName));
+		}
+	else
+		{
+		// special case: may not have a code seg in some cases. in which case we tell everyone!
+		if (targetProcess->iName)
+			{
+			// copy the name of the process
+			foundProcess = TheDProcessTracker.FindProcess(*(targetProcess->iName));
+			}
+		else
+			{
+			foundProcess = NULL;
+			}
+		}
+
+	//close the handle
+	targetProcess->Close(NULL);
+
+	if (!foundProcess)
+		{
+		// No: just ignore this exception
+		LOG_EVENT_MSG("DRM_DebugChannel::NotifyEvent - we are not debugging this process!");
+		return;
+		}
+
+	foundProcess->NotifyEvent(aEventInfo);
+	}
+
+#ifndef __LAUNCH_AS_EXTENSION__
+DECLARE_STANDARD_LDD()
+	{
+	return new DRM_DebugDriverFactory;
+	}
+#else
+
+DStopModeExtension* TheStopModeExtension = NULL;
+
+DECLARE_EXTENSION_LDD()
+	{
+	return new DRM_DebugDriverFactory;
+	}
+
+/**
+  This value is used as an initialiser for the size of the Stop-Mode Debug API's
+  default request buffer.
+  */
+const TInt KRequestBufferSize = 0x200;
+/**
+  This value is used as an initialiser for the size of the Stop-Mode Debug API's
+  default response buffer.
+  */
+const TInt KResponseBufferSize = 0x1000;
+
+DECLARE_STANDARD_EXTENSION()
+	{
+	__KTRACE_OPT(KBOOT,Kern::Printf("Starting RM_DEBUG extension"));
+
+	// get a reference to the DDebuggerInfo and to the DStopModeExtension
+	TSuperPage& superPage = Kern::SuperPage();
+
+	if(!superPage.iDebuggerInfo)
+		{
+		//kdebug has not been installed so create DDebuggerInfo using our stub constructor
+		superPage.iDebuggerInfo = new DDebuggerInfo();
+		}
+
+	if(!TheStopModeExtension)
+		{
+		TheStopModeExtension = new DStopModeExtension();
+		}
+
+	// create the request buffer and store a reference to it
+	TTag tag;
+	tag.iTagId = EBuffersRequest;
+	tag.iType = ETagTypePointer;
+	tag.iSize = KRequestBufferSize;
+	TInt err = TheDBufferManager.CreateBuffer(tag);
+	if(KErrNone != err)
+		{
+		return KErrNone;
+		}
+
+	// create the response buffer and store a reference to it
+	tag.iTagId = EBuffersResponse;
+	tag.iSize = KResponseBufferSize;
+	err = TheDBufferManager.CreateBuffer(tag);
+	if(KErrNone != err)
+		{
+		return KErrNone;
+		}
+	// create the debug functionality buffer and store a reference to it
+	TDebugFunctionality df;
+	TUint dfSize = df.GetStopModeFunctionalityBufSize();
+	tag.iTagId = EBuffersFunctionality;
+	tag.iSize = dfSize;
+	err = TheDBufferManager.CreateBuffer(tag);
+	if(KErrNone != err)
+		{
+		return KErrNone;
+		}
+
+	// fill the functionality buffer with the functionality data and store it in
+	// the super page
+	TPtr8 dfBlockPtr((TUint8*)tag.iValue, dfSize);
+	if(!df.GetStopModeFunctionality(dfBlockPtr))
+		{
+		return KErrNone;
+		}
+	TheStopModeExtension->iFunctionalityBlock = (DFunctionalityBlock*)tag.iValue;
+
+	DStopModeExtension::Install(TheStopModeExtension);
+
+	return KErrNone;
+	}
+
+/**
+ * This stub constructor is intended to be used in the case where the old deprecated
+ * stop mode api, kdebug, is not in place. It will initialise all values to NULL except
+ * the pointer to the new stop mode api extension. This allows the new stop mode solution
+ * to both co-exist and exist independantly of the existing one *
+ */
+DDebuggerInfo::DDebuggerInfo():
+	iObjectOffsetTable(NULL),
+	iObjectOffsetTableCount(NULL),
+	iThreadContextTable(NULL),
+	iStopModeExtension(new DStopModeExtension()),
+	iContainers(NULL),
+	iCodeSegLock(NULL),
+	iCodeSegGlobalList(NULL),
+	iScheduler(NULL),
+	iShadowPages(NULL),
+	iShadowPageCount(0),
+	iCurrentThread(NULL),
+	iEventMask(),
+	iEventHandlerBreakpoint(0),
+	iMemModelObjectOffsetTable(NULL),
+	iMemModelObjectOffsetTableCount(0)
+	{
+	}
+
+/**
+ * Installs the stop-mode debugger extension
+ * Make the stop-mode API visible to a JTAG debugger, by publishing its
+ * existence in the superpage
+*/
+void DStopModeExtension::Install(DStopModeExtension* aExt)
+	{
+	Kern::SuperPage().iDebuggerInfo->iStopModeExtension = aExt;
+	}
+
+#endif
+
+/**
+Helper function
+
+Allocates memory in current thread with a max length the same as aSrcDes. If
+aReadFromClient is true (as it is by default) then the data from aSrdDes is
+copied into the allocated aDestDes buffer.
+
+Use of this function should be followed at a later time by a call such as
+Kern::Free(aDestDes.Ptr())
+
+@param aThread pointer to thread to read data from
+@param aSrcDes descriptor in aThread to read data from
+@param aDestDes location to read data to. Memory is allocated at this location,
+       if memory is already allocated at this location then the function will
+       return KErrArgument
+@param aReadFromClient if false then data is not actually read from the
+       client, the memory is simply allocated
+@param aOffest offset into aSrcDes to start reading from. Default is 0.
+
+@return KErrNone if there were no problems,
+        KErrArgument if aDestDes.Ptr() != NULL or aSrcDes has max length 0,
+        KErrNoMemory if could not allocate memory,
+        or one of the other system wide error codes
+*/
+TInt DRM_DebugChannel::AllocAndReadDes(DThread *aThread, const TDesC8& aSrcDes, TPtr8& aDestDes, const TBool aReadFromClient, const TUint aOffset) const
+	{
+
+	//check thread is not null
+	if(!aThread)
+		{
+		return KErrArgument;
+		}
+
+	//check aDestDes is empty
+	if(aDestDes.Ptr() != NULL)
+		{
+		return KErrArgument;
+		}
+
+	//get the source descriptor's max length and exit if 0
+	TUint srcMaxLength = Kern::ThreadGetDesMaxLength(aThread, &aSrcDes);
+	if(srcMaxLength == 0)
+		{
+		return KErrNone;
+		}
+
+	//allocate memory and return if none available
+	NKern::ThreadEnterCS();
+	TUint8 *destPtr = (TUint8*)Kern::Alloc(srcMaxLength);
+	NKern::ThreadLeaveCS();
+	if (!destPtr)
+		{
+		return KErrNoMemory;
+		}
+
+	//point the TPtr8 at the target memory
+	aDestDes.Set(destPtr, srcMaxLength, srcMaxLength);
+
+	if(aReadFromClient)
+		{
+		//read data from the client thread and return status code
+		return Kern::ThreadDesRead(aThread, &aSrcDes, aDestDes, aOffset);
+		}
+	else
+		{
+		return KErrNone;
+		}
+	}
+
+/**
+Helper function to extract a TRegisterInfo value from a descriptor containing
+binary data.
+
+@param aRegisterIds descriptor containing register IDs
+@param aOffset offset in bytes into the descriptor to start reading data from.
+       If this value is not a multiple of sizeof(TRegisterInfo) then a
+       KErrArgument error is returned.
+@param aValue will contain the returned value
+
+@return KErrNone if aValue was set correctly, KErrArgument if bad arguments
+        were passed in
+*/
+TInt DRM_DebugChannel::GetTRegisterInfo(const TDesC8 &aRegisterIds, const TUint aIndex, TRegisterInfo &aValue) const
+	{
+	TUint length = aRegisterIds.Length();
+
+	TUint size = sizeof(TRegisterInfo);
+
+	//check that not trying to read past end of descriptor
+	if((aIndex + 1) * size > length)
+		return KErrArgument;
+
+	//get pointer to descriptor's data
+	const TUint8 *dataPtr = aRegisterIds.Ptr();
+	const TRegisterInfo *registerId = reinterpret_cast<const TRegisterInfo*>(dataPtr + (aIndex * size));
+
+	aValue = *registerId;
+
+	return KErrNone;
+	}
+
+/**
+Helper function to get the kernel register ID of the TRegisterInfo defined register.
+
+@param aDebugRegister the debug register ID to return the kernel ID for
+@param aKernelRegister corresponding value of register aDebugRegister
+
+@return KErrNone if translation occurred without problems
+        KErrNotSupported if aDebugRegister is not supported by the kernel
+*/
+TInt DRM_DebugChannel::GetKernelRegisterId(const TRegisterInfo aDebugRegister, TArmReg& aKernelRegister) const
+	{
+	if(Register::IsCoreReg(aDebugRegister))
+		{
+		TUint id = Register::GetCoreRegId(aDebugRegister);
+		//first 17 registers match the first 17 kernel registers
+		if(id < 17)
+			{
+			aKernelRegister = id;
+			}
+		else
+			{
+			return KErrNotSupported;
+			}
+		}
+	else if(Register::IsCoproReg(aDebugRegister))
+		{
+		TUint32 crn = Register::GetCRn(aDebugRegister);
+		TUint32 crm = Register::GetCRm(aDebugRegister);
+		TUint32 opcode1 = Register::GetOpcode1(aDebugRegister);
+		TUint32 opcode2 = Register::GetOpcode2(aDebugRegister);
+		TUint32 coproNum = Register::GetCoproNum(aDebugRegister);
+
+		//each coprocessor register has potentially different characteristics
+		//so need to identify each individually
+
+		//this is the DACR, the ARM ARM specifies that the CRn and the
+		//Opcodes are not relevant, section B3-24, point 3.7.3
+		if((coproNum == 15) && (crm == 3))
+			{
+			aKernelRegister = EArmDacr;
+			}
+		else
+			{
+			return KErrNotSupported;
+			}
+		}
+	else // might be supported at a later date
+		{
+		return KErrNotSupported;
+		}
+
+	return KErrNone;
+	}
+
+/**
+Helper function to get the debug register ID of the kernel defined register.
+
+@param aKernelRegister the kernel register ID to return the debug ID for
+@param aDebugRegister corresponding value of register aKernelRegister
+
+@return KErrNone if translation occured without problems
+        KErrNotSupported if aKernelRegister is not supported by the debug
+	security server
+*/
+TInt DRM_DebugChannel::GetDebugRegisterId(const TArmReg aKernelRegister, TRegisterInfo &aDebugRegister) const
+	{
+
+	// registers 0 - 15 and the CPSR share the same values as with the debug enums
+	if(aKernelRegister < 17)
+		{
+		TUint32 id = aKernelRegister;
+		aDebugRegister = id << 8;
+		}
+	//the DACR value is special and corresponds to EDF_Register_DACR
+	else if(aKernelRegister == EArmDacr)
+		{
+		aDebugRegister = 0x00300f01;
+		}
+	// must be an unsupported register, return an error as such
+	else
+		{
+		return KErrNotSupported;
+		}
+
+	//found a supported register so return KErrNone
+	return KErrNone;
+	}
+
+/**
+Helper function to find out whether the aIndex flag is set. This is equivalent
+to the aIndex bit of aFlags being non-zero.
+
+@param aFlags set of flags
+@param aIndex offset into aFlags to get flag from
+
+@return ETrue if bit is set, EFalse if not
+*/
+TBool DRM_DebugChannel::GetFlagAtOffset(const TUint32 aFlags, const TArmReg aIndex) const
+	{
+	return aFlags & (1<<aIndex);
+	}
+
+/* Register the attachment of a debug agent to a process to be debugged
+ *
+ * @param a1 - TDes8 target process name
+ * @param a2 - &TUint64 - Debug Agent Id
+ *
+ * @return - KErrNone if successful. KErrArgument if the filepath is not a valid size.
+ * KErrOutOfMemory if there is insufficient memory. Or one of the other system wide error codes
+ * if appropriate.
+ */
+TInt DRM_DebugChannel::AttachProcess(TAny* a1, TAny* a2)
+	{
+	LOG_MSG("DRM_DebugChannel::AttachProcess()");
+
+	// Validate the supplied TDes8 target process name in a1
+	TInt length, maxLength;
+	TUint8* aPtr;
+
+	TInt err = Kern::ThreadGetDesInfo(iClientThread,\
+		a1,\
+		length,\
+		maxLength,\
+		aPtr,\
+		EFalse);
+	if (err != KErrNone)
+		{
+		// Could not read the descriptor information
+		return err;
+		}
+
+	// Check the processname is a valid size for a filepath
+	if (length < 1 || length >= KMaxPath)
+		{
+		return KErrArgument;
+		}
+
+	if (maxLength < 1 || maxLength >= KMaxPath)
+		{
+		return KErrArgument;
+		}
+
+	// Allocate space to store the target process name in a kernel-side TPtr8
+	NKern::ThreadEnterCS();
+	TUint8* buffer = (TUint8*)Kern::AllocZ(length);
+	NKern::ThreadLeaveCS();
+	if (buffer==NULL)
+		{
+		// Out of memory
+		return KErrNoMemory;
+		}
+
+	// A temporary descriptor to store the target process name
+	TPtr8 targetProcessName(buffer,length,length);
+
+	// Read the user-side data into targetProcessName
+	err = Kern::ThreadDesRead(iClientThread,a1,targetProcessName,0,KChunkShiftBy0);
+	if (err != KErrNone)
+		{
+		// Could not read the user-side descriptor containing the target process name
+		NKern::ThreadEnterCS();
+		Kern::Free(buffer);
+		NKern::ThreadLeaveCS();
+
+		return err;
+		}
+
+	// Obtain the Debug Agent Id
+	TUint64 debugAgentId = 0;
+
+	err = Kern::ThreadRawRead(iClientThread,a2,&debugAgentId,sizeof(debugAgentId));
+	if (err != KErrNone)
+		{
+		// Something bad happened so free the memory and return
+		NKern::ThreadEnterCS();
+		Kern::Free(buffer);
+		NKern::ThreadLeaveCS();
+		return err;
+		}
+
+	// Add the target process to our list of tracked processes
+	err = TheDProcessTracker.AttachProcess(targetProcessName, debugAgentId);
+
+	// Free the kernel-side memory containing targetProcessName data
+	NKern::ThreadEnterCS();
+	Kern::Free(buffer);
+	NKern::ThreadLeaveCS();
+
+	return err;
+	}
+
+/* Register the detachment of a debug agent to a process to be debugged.
+ *
+ * @param - a1 TDes8 target process name in a1
+ * @param a2 - &TUint64 - Debug Agent Id
+ *
+ * @return - KErrNone if successful. KErrArgument if the filepath is not a valid size.
+ * KErrOutOfMemory if there is insufficient memory. Or one of the other system wide error codes
+ * if appropriate.
+ */
+TInt DRM_DebugChannel::DetachProcess(TAny* a1, TAny* a2)
+	{
+	// Validate the supplied TDes8 target process name in a1
+	TInt length, maxLength;
+	TUint8* aPtr;
+
+	TInt err = Kern::ThreadGetDesInfo(iClientThread,\
+		a1,\
+		length,\
+		maxLength,\
+		aPtr,\
+		EFalse);
+	if (err != KErrNone)
+		{
+		return err;
+		}
+
+	if (length < 1 || length >= KMaxPath)
+		{
+		return KErrArgument;
+		}
+
+	if (maxLength < 1 || maxLength >= KMaxPath)
+		{
+		return KErrArgument;
+		}
+
+	// Allocate space to store the target process name in a kernel-side TPtr8
+	NKern::ThreadEnterCS();
+	TUint8* buffer = (TUint8*)Kern::AllocZ(length);
+	NKern::ThreadLeaveCS();
+	if (buffer==NULL)
+		{
+		// Out of memory
+		return KErrNoMemory;
+		}
+
+	TPtr8 targetProcessName(buffer,length,length);
+
+	// Read the user-side data into targetProcessName
+	err = Kern::ThreadDesRead(iClientThread,a1,targetProcessName,0,KChunkShiftBy0);
+	if (err != KErrNone)
+		{
+		// Something bad happened so free the memory and return
+		NKern::ThreadEnterCS();
+		Kern::Free(buffer);
+		NKern::ThreadLeaveCS();
+
+		return err;
+		}
+
+	// Obtain the AgentId
+	TUint64 debugAgentId = 0;
+
+	err = Kern::ThreadRawRead(iClientThread,a2,&debugAgentId,sizeof(debugAgentId));
+	if (err != KErrNone)
+		{
+		// Something bad happened so free the memory and return
+		NKern::ThreadEnterCS();
+		Kern::Free(buffer);
+		NKern::ThreadLeaveCS();
+
+		return err;
+		}
+
+	// Remove the process from our list of tracked processes
+	err = TheDProcessTracker.DetachProcess(targetProcessName, debugAgentId);
+
+	// Free the kernel-side memory containing targetProcessName data
+	NKern::ThreadEnterCS();
+	Kern::Free(buffer);
+	NKern::ThreadLeaveCS();
+
+	return err;
+	}
+
+/* Register the detachment of a debug agent from all processes being debugged.
+ *
+ * @param - a1 - &TUint64 Debug Agent Id.
+ * @return - KErrNone if successful. One of the system-wide error codes otherwise.
+ */
+TInt DRM_DebugChannel::DetachAgent(TAny* a1, TAny* a2)
+	{
+	// Obtain the AgentId
+	TUint64 debugAgentId = 0;
+
+	TInt err = Kern::ThreadRawRead(iClientThread,a1,&debugAgentId,sizeof(debugAgentId));
+	if (err != KErrNone)
+		{
+		return err;
+		}
+
+	// Remove the process from our list of tracked processes
+	return TheDProcessTracker.DetachAgent(debugAgentId);
+	}
+
+/* Set the action associated with a particular kernel event for a given agent and target process
+ *
+ * @param - a1 TDes8 target process name in a1
+ * @param - a2 &TRM_DebugEventActionInfo
+ * @return - KErrNone if successful. KErrArgument if the filepath is an invalid size. Or one of
+ * the other system wide error codes if appropriate.
+ */
+TInt DRM_DebugChannel::SetEventAction(TAny* a1, TAny* a2)
+	{
+	// Validate the supplied TDes8 target process name in a1
+	TInt length, maxLength;
+	TUint8* aPtr;
+
+	TInt err = Kern::ThreadGetDesInfo(iClientThread,\
+		a1,\
+		length,\
+		maxLength,\
+		aPtr,\
+		EFalse);
+	if (err != KErrNone)
+		{
+		return err;
+		}
+
+	if (length < 1 || length >= KMaxPath)
+		{
+		return KErrArgument;
+		}
+
+	if (maxLength < 1 || maxLength >= KMaxPath)
+		{
+		return KErrArgument;
+		}
+
+	// Allocate space to store the target process name in a kernelspace TPtr8
+	NKern::ThreadEnterCS();
+	TUint8* buffer = (TUint8*)Kern::AllocZ(length);
+	NKern::ThreadLeaveCS();
+	if (buffer==NULL)
+		{
+		// Out of memory
+		return KErrNoMemory;
+		}
+	TPtr8 targetProcessName(buffer,length,length);
+
+	// Read the user-side data into targetProcessName
+	err = Kern::ThreadDesRead(iClientThread,a1,targetProcessName,0,KChunkShiftBy0);
+	if (err != KErrNone)
+		{
+		// Something bad happened so free the memory and return
+		NKern::ThreadEnterCS();
+		Kern::Free(buffer);
+		NKern::ThreadLeaveCS();
+
+		return err;
+		}
+
+	// Read the Event and Action from the user-side
+	TRM_DebugEventActionInfo info(0,0,0);
+
+	err = Kern::ThreadRawRead(iClientThread, a2, &info, sizeof(info));
+	if (err != KErrNone)
+		{
+		// Could not read event action data from the user-side
+
+		// Free memory used for targetProcessName
+		NKern::ThreadEnterCS();
+		Kern::Free(buffer);
+		NKern::ThreadLeaveCS();
+
+		return err;
+		}
+
+	// Find the target process
+	DTargetProcess* pProcess = TheDProcessTracker.FindProcess(targetProcessName);
+	if (pProcess == NULL)
+		{
+		// Could not find this process
+
+		// Free memory used for targetProcessName
+		NKern::ThreadEnterCS();
+		Kern::Free(buffer);
+		NKern::ThreadLeaveCS();
+
+		return KErrArgument;
+		}
+
+	TUint64 debugAgentId = info.iAgentId;
+
+	// Find the agent
+	DDebugAgent* debugAgent = pProcess->Agent(debugAgentId);
+	if (debugAgent == NULL)
+		{
+		// Bad agent means there is no tracking agent
+		LOG_MSG2("Cannot locate debug agent with pid 0x%0x16lx",info.iAgentId);
+
+		// Free memory used for targetProcessName
+		NKern::ThreadEnterCS();
+		Kern::Free(buffer);
+		NKern::ThreadLeaveCS();
+
+		return KErrGeneral;
+		}
+
+	// Set the event action
+	debugAgent->SetEventAction((TEventType)info.iEvent,(TKernelEventAction)info.iAction);
+
+	// Free memory used for targetProcessName
+	NKern::ThreadEnterCS();
+	Kern::Free(buffer);
+	NKern::ThreadLeaveCS();
+
+	return KErrNone;
+	}
+
+TInt DRM_DebugChannel::Step(const TUint32 aThreadId, const TUint32 aNumSteps)
+	{
+	LOG_MSG3("DRM_DebugChannel::Step(aThreadId = 0x%08x, aNumSteps = 0x%08x)\n",aThreadId,aNumSteps);
+
+	DThread* thread = DebugUtils::OpenThreadHandle(aThreadId);
+
+	if (thread == NULL)
+		{
+		// The thread terminated before we could open it.
+		LOG_MSG2("DRM_DebugChannel::Step - Could not open thread %u", aThreadId);
+
+		return KErrArgument;
+		}
+
+	// We simply repeat this for desired number of steps
+	TInt err = KErrNone;
+
+	// Need to step from the current location for 'n' steps
+	TUint32 startAddress;
+
+	// We always step from the current PC.
+	err = ReadKernelRegisterValue(thread, PC_REGISTER, startAddress);
+	if(err != KErrNone)
+		{
+		LOG_MSG2("DRM_DebugChannel::Step - Could not read the PC: %d", err);
+
+		// Close the handle
+		thread->Close(NULL);
+
+		return err;
+		}
+
+	err = DoStepRange(thread, startAddress, startAddress, ETrue, EFalse, aNumSteps, ETrue);
+
+	if (err != KErrNone)
+		{
+		// There was a problem, return straightaway
+		LOG_MSG("DRM_DebugChannel::Step - failed to step");
+		}
+
+	// Close the handle
+	thread->Close(NULL);
+
+	return err;
+	}
+
+TInt DRM_DebugChannel::KillProcess(const TUint32 aProcessId, const TInt aReason)
+	{
+	LOG_MSG3("DRM_DebugChannel::KillProcess(aProcessId = 0x%08x, aReason = 0x%08x)\n",aProcessId,aReason);
+
+	DProcess* process = DebugUtils::OpenProcessHandle(aProcessId);
+
+	if (process == NULL)
+		{
+		// The process terminated before we could open it to kill it ourselves.
+		LOG_MSG2("DRM_DebugChannel::KillProcess - Could not open process %u", aProcessId);
+
+		return KErrArgument;
+		}
+
+	TInt err = KErrNone;
+
+	DebugSupport::TerminateProcess(process,aReason);
+
+	// Close the handle
+	process->Close(NULL);
+
+	return err;
+	}
+
+/* Security critical - this checks whether the specified process is debuggable or not
+ *
+ * @param aProcessId - The process id of the process to check
+ * @return KErrNone if debuggable, KErrPermissionDenied if not debuggable.
+ */
+TInt DRM_DebugChannel::IsDebuggable(const TUint32 aProcessId)
+	{
+	/* In order to ensure that only processes which are debuggable
+	 * can be debugged, this function enables the security server
+	 * to read the DProcess.iDebugAttributes field and ensure
+	 * the process was created from a debuggable executable.
+	 */
+	LOG_MSG2("DRM_DebugChannel::IsDebuggable(aProcessId 0x%08x)\n",aProcessId);
+
+	TInt err = KErrPermissionDenied;
+
+	DProcess* process = DebugUtils::OpenProcessHandle(aProcessId);
+	if (process)
+		{
+		if (process->iDebugAttributes & TProcessCreateInfo::EDebugAllowed)
+			{
+			// Yes this process exists and is debuggable
+			err = KErrNone;
+			}
+		process->Close(NULL);
+		}
+
+	if (err == KErrNone)
+		{
+		LOG_MSG2("DRM_DebugChannel::IsDebuggable(aProcessId 0x%08x) - Yes it is debuggable\n",aProcessId);
+		}
+
+	return err;
+	}
--- a/kernel/eka/drivers/debug/smdebug/d_sm_codeseg.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/debug/smdebug/d_sm_codeseg.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,7 +20,11 @@
  * @prototype
 */
 
+#ifdef __LAUNCH_AS_EXTENSION__
+
+#include <rm_debug_api.h>
 #include <sm_debug_api.h>
+#include "d_rmd_breakpoints.h"
 
 using namespace Debug;
 
@@ -180,3 +184,5 @@
 	return KErrNone;
 	}
 
+#endif
+
--- a/kernel/eka/drivers/debug/smdebug/d_sm_process.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/debug/smdebug/d_sm_process.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,7 +20,11 @@
  * @prototype
  */
 
+#ifdef __LAUNCH_AS_EXTENSION__
+
+#include <rm_debug_api.h>
 #include <sm_debug_api.h>
+#include "d_rmd_breakpoints.h"
 
 using namespace Debug;
 
@@ -145,4 +149,5 @@
 		}
 	}
 
+#endif
 
--- a/kernel/eka/drivers/debug/smdebug/d_sm_staticinfo.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/debug/smdebug/d_sm_staticinfo.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,8 +20,12 @@
  * @prototype
  */
 
+#ifdef __LAUNCH_AS_EXTENSION__
+
+#include <rm_debug_api.h>
 #include <sm_debug_api.h>
 #include <e32rom.h>
+#include "d_rmd_breakpoints.h"
 
 using namespace Debug;
 
@@ -76,4 +80,5 @@
 	return KErrNone;
 	}
 
+#endif
 
--- a/kernel/eka/drivers/debug/smdebug/d_stopmode.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/debug/smdebug/d_stopmode.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,8 +20,14 @@
 @prototype
 */
 
+#include <rm_debug_api.h>
 #include <sm_debug_api.h>
 
+#include "d_rmd_breakpoints.h"
+
+
+#ifdef __LAUNCH_AS_EXTENSION__
+
 using namespace Debug;
 
 _LIT(KLitLocal,"Local-");
@@ -163,4 +169,7 @@
         }
 	}
 
+#endif
+
+
 // End of file d_stopmode.cpp
--- a/kernel/eka/drivers/debug/smdebug/sm_debug_kerneldriver.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +0,0 @@
-// 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"
-// 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:
-// Device driver for kernel side stop mode debugging
-//
-
-#ifdef __WINS__
-#error - this driver cannot be built for emulation
-#endif
-
-#include <e32def.h>
-#include <e32def_private.h>
-#include <e32cmn.h>
-#include <e32cmn_private.h>
-#include <e32ldr.h>
-#include <u32std.h>
-#include <kernel/kernel.h>
-#include <kernel/kern_priv.h>
-#include <nk_trace.h>
-#include <arm.h>
-#include <kernel/cache.h>
-#include <platform.h>
-#include <nkern.h>
-#include <u32hal.h>
-#include <kernel/kdebug.h>
-
-
-#include "debug_logging.h"
-#include "d_debug_functionality.h"
-#include "debug_utils.h"
-#include "d_buffer_manager.h"
-
-
-using namespace Debug;
-
-
-DStopModeExtension* TheStopModeExtension = NULL;
-
-/**
-  This value is used as an initialiser for the size of the Stop-Mode Debug API's
-  default request buffer.
-  */
-const TInt KRequestBufferSize = 0x200;
-/**
-  This value is used as an initialiser for the size of the Stop-Mode Debug API's
-  default response buffer.
-  */
-const TInt KResponseBufferSize = 0x1000;
-
-DECLARE_STANDARD_EXTENSION()
-	{
-	__KTRACE_OPT(KBOOT,Kern::Printf("Starting Stop Mode Debugger V2"));
-
-	// get a reference to the DDebuggerInfo and to the DStopModeExtension
-	TSuperPage& superPage = Kern::SuperPage();
-
-	if(!superPage.iDebuggerInfo)
-		{
-		//kdebug has not been installed so create DDebuggerInfo using our stub constructor
-		superPage.iDebuggerInfo = new DDebuggerInfo();
-		}
-
-	if(!TheStopModeExtension)
-		{
-		TheStopModeExtension = new DStopModeExtension();
-		}
-
-	// create the request buffer and store a reference to it
-	TTag tag;
-	tag.iTagId = EBuffersRequest;
-	tag.iType = ETagTypePointer;
-	tag.iSize = KRequestBufferSize;
-	TInt err = TheDBufferManager.CreateBuffer(tag);
-	if(KErrNone != err)
-		{
-		return KErrNone;
-		}
-
-	// create the response buffer and store a reference to it
-	tag.iTagId = EBuffersResponse;
-	tag.iSize = KResponseBufferSize;
-	err = TheDBufferManager.CreateBuffer(tag);
-	if(KErrNone != err)
-		{
-		return KErrNone;
-		}
-	// create the debug functionality buffer and store a reference to it
-	TDebugFunctionality df;
-	TUint dfSize = df.GetStopModeFunctionalityBufSize();
-	tag.iTagId = EBuffersFunctionality;
-	tag.iSize = dfSize;
-	err = TheDBufferManager.CreateBuffer(tag);
-	if(KErrNone != err)
-		{
-		return KErrNone;
-		}
-
-	// fill the functionality buffer with the functionality data and store it in
-	// the super page
-	TPtr8 dfBlockPtr((TUint8*)tag.iValue, dfSize);
-	if(!df.GetStopModeFunctionality(dfBlockPtr))
-		{
-		return KErrNone;
-		}
-	TheStopModeExtension->iFunctionalityBlock = (DFunctionalityBlock*)tag.iValue;
-
-	DStopModeExtension::Install(TheStopModeExtension);
-
-	return KErrNone;
-	}
-
-/**
- * This stub constructor is intended to be used in the case where the old deprecated
- * stop mode api, kdebug, is not in place. It will initialise all values to NULL except
- * the pointer to the new stop mode api extension. This allows the new stop mode solution
- * to both co-exist and exist independantly of the existing one *
- */
-DDebuggerInfo::DDebuggerInfo():
-	iObjectOffsetTable(NULL),
-	iObjectOffsetTableCount(NULL),
-	iThreadContextTable(NULL),
-	iStopModeExtension(new DStopModeExtension()),
-	iContainers(NULL),
-	iCodeSegLock(NULL),
-	iCodeSegGlobalList(NULL),
-	iScheduler(NULL),
-	iShadowPages(NULL),
-	iShadowPageCount(0),
-	iCurrentThread(NULL),
-	iEventMask(),
-	iEventHandlerBreakpoint(0),
-	iMemModelObjectOffsetTable(NULL),
-	iMemModelObjectOffsetTableCount(0)
-	{
-	}
-
-/**
- * Installs the stop-mode debugger extension
- * Make the stop-mode API visible to a JTAG debugger, by publishing its
- * existence in the superpage
-*/
-void DStopModeExtension::Install(DStopModeExtension* aExt)
-	{
-	Kern::SuperPage().iDebuggerInfo->iStopModeExtension = aExt;
-	}
--- a/kernel/eka/drivers/dma/dma2_lib.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +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 "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:
-// e32\drivers\dma\dma2_lib.mmp
-// 
-//
-
-target			dma2.lib
-targettype		implib
-linkas			dma.dll
-
-#if defined(EABI)
-deffile				../../eabi/dma2.def 
-#elif defined(GCC32)
-deffile				../../bmarm/dma2.def 
-#endif
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/kernel/eka/drivers/dma/dma2_pil.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3131 +0,0 @@
-// 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"
-// 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:
-// e32/drivers/dma2_pil.cpp
-// DMA Platform Independent Layer (PIL)
-//
-//
-
-#include <drivers/dma.h>
-#include <drivers/dma_hai.h>
-
-#include <kernel/kern_priv.h>
-
-
-// Symbian _Min() & _Max() are broken, so we have to define them ourselves
-inline TUint _Min(TUint aLeft, TUint aRight)
-	{return(aLeft < aRight ? aLeft : aRight);}
-inline TUint _Max(TUint aLeft, TUint aRight)
-	{return(aLeft > aRight ? aLeft : aRight);}
-
-
-// The following section is used only when freezing the DMA2 export library
-/*
-TInt DmaChannelMgr::StaticExtension(TInt, TAny*) {return 0;}
-TDmaChannel* DmaChannelMgr::Open(TUint32, TBool, TUint) {return 0;}
-void DmaChannelMgr::Close(TDmaChannel*) {}
-EXPORT_C const TDmaTestInfo& DmaTestInfo() {static TDmaTestInfo a; return a;}
-EXPORT_C const TDmaV2TestInfo& DmaTestInfoV2() {static TDmaV2TestInfo a; return a;}
-*/
-
-static const char KDmaPanicCat[] = "DMA " __FILE__;
-
-//////////////////////////////////////////////////////////////////////
-// DmaChannelMgr
-//
-// Wait, Signal, and Initialise are defined here in the PIL.
-// Open, Close and Extension must be defined in the PSL.
-
-NFastMutex DmaChannelMgr::Lock;
-
-
-void DmaChannelMgr::Wait()
-	{
-	NKern::FMWait(&Lock);
-	}
-
-
-void DmaChannelMgr::Signal()
-	{
-	NKern::FMSignal(&Lock);
-	}
-
-
-TInt DmaChannelMgr::Initialise()
-	{
-	return KErrNone;
-	}
-
-
-class TDmaCancelInfo : public SDblQueLink
-	{
-public:
-	TDmaCancelInfo();
-	void Signal();
-public:
-	NFastSemaphore iSem;
-	};
-
-
-TDmaCancelInfo::TDmaCancelInfo()
-	: iSem(0)
-	{
-	iNext = this;
-	iPrev = this;
-	}
-
-
-void TDmaCancelInfo::Signal()
-	{
-	TDmaCancelInfo* p = this;
-	FOREVER
-		{
-		TDmaCancelInfo* next = (TDmaCancelInfo*)p->iNext;
-		if (p!=next)
-			p->Deque();
-		NKern::FSSignal(&p->iSem);	// Don't dereference p after this
-		if (p==next)
-			break;
-		p = next;
-		}
-	}
-
-
-//////////////////////////////////////////////////////////////////////////////
-
-#ifdef __DMASIM__
-#ifdef __WINS__
-typedef TLinAddr TPhysAddr;
-#endif
-static inline TPhysAddr LinToPhys(TLinAddr aLin) {return aLin;}
-#else
-static inline TPhysAddr LinToPhys(TLinAddr aLin) {return Epoc::LinearToPhysical(aLin);}
-#endif
-
-//
-// Return minimum of aMaxSize and size of largest physically contiguous block
-// starting at aLinAddr.
-//
-static TUint MaxPhysSize(TLinAddr aLinAddr, const TUint aMaxSize)
-	{
-	const TPhysAddr physBase = LinToPhys(aLinAddr);
-	__DMA_ASSERTD(physBase != KPhysAddrInvalid);
-	TLinAddr lin = aLinAddr;
-	TUint size = 0;
-	for (;;)
-		{
-		// Round up the linear address to the next MMU page boundary
-		const TLinAddr linBoundary = Kern::RoundToPageSize(lin + 1);
-		size += linBoundary - lin;
-		if (size >= aMaxSize)
-			return aMaxSize;
-		if ((physBase + size) != LinToPhys(linBoundary))
-			return size;
-		lin = linBoundary;
-		}
-	}
-
-
-//////////////////////////////////////////////////////////////////////////////
-// TDmac
-
-TDmac::TDmac(const SCreateInfo& aInfo)
-	: iMaxDesCount(aInfo.iDesCount),
-	  iAvailDesCount(aInfo.iDesCount),
-	  iHdrPool(NULL),
-#ifndef __WINS__
-	  iHwDesChunk(NULL),
-#endif
-	  iDesPool(NULL),
-	  iDesSize(aInfo.iDesSize),
-	  iCapsHwDes(aInfo.iCapsHwDes),
-	  iFreeHdr(NULL)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmac::TDmac"));
-	__DMA_ASSERTD(iMaxDesCount > 0);
-	__DMA_ASSERTD(iDesSize > 0);
-	}
-
-
-//
-// Second-phase c'tor
-//
-TInt TDmac::Create(const SCreateInfo& aInfo)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmac::Create"));
-	iHdrPool = new SDmaDesHdr[iMaxDesCount];
-	if (iHdrPool == NULL)
-		{
-		return KErrNoMemory;
-		}
-
-	TInt r = AllocDesPool(aInfo.iDesChunkAttribs);
-	if (r != KErrNone)
-		{
-		return KErrNoMemory;
-		}
-
-	// Link all descriptor headers together on the free list
-	iFreeHdr = iHdrPool;
-	for (TInt i = 0; i < iMaxDesCount - 1; i++)
-		iHdrPool[i].iNext = iHdrPool + i + 1;
-	iHdrPool[iMaxDesCount-1].iNext = NULL;
-
-	__DMA_INVARIANT();
-	return KErrNone;
-	}
-
-
-TDmac::~TDmac()
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmac::~TDmac"));
-	__DMA_INVARIANT();
-
-	FreeDesPool();
-	delete[] iHdrPool;
-	}
-
-
-void TDmac::Transfer(const TDmaChannel& /*aChannel*/, const SDmaDesHdr& /*aHdr*/)
-	{
-	// TDmac needs to override this function if it has reported the channel
-	// type for which the PIL calls it.
-	__DMA_UNREACHABLE_DEFAULT();
-	}
-
-
-void TDmac::Transfer(const TDmaChannel& /*aChannel*/, const SDmaDesHdr& /*aSrcHdr*/,
-					 const SDmaDesHdr& /*aDstHdr*/)
-	{
-	// TDmac needs to override this function if it has reported the channel
-	// type for which the PIL calls it.
-	__DMA_UNREACHABLE_DEFAULT();
-	}
-
-
-TInt TDmac::PauseTransfer(const TDmaChannel& /*aChannel*/)
-	{
-	// TDmac needs to override this function if it has reported support for
-	// channel pausing/resuming.
-	return KErrNotSupported;
-	}
-
-
-TInt TDmac::ResumeTransfer(const TDmaChannel& /*aChannel*/)
-	{
-	// TDmac needs to override this function if it has reported support for
-	// channel pausing/resuming.
-	return KErrNotSupported;
-	}
-
-
-TInt TDmac::AllocDesPool(TUint aAttribs)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmac::AllocDesPool"));
-	// Calling thread must be in CS
-	__ASSERT_CRITICAL;
-	TInt r;
-	if (iCapsHwDes)
-		{
-		const TInt size = iMaxDesCount * iDesSize;
-#ifdef __WINS__
-		(void)aAttribs;
-		iDesPool = new TUint8[size];
-		r = iDesPool ? KErrNone : KErrNoMemory;
-#else
-		// Chunk not mapped as supervisor r/w user none? incorrect mask passed by PSL
-		__DMA_ASSERTD((aAttribs & EMapAttrAccessMask) == EMapAttrSupRw);
-		TPhysAddr phys;
-		r = Epoc::AllocPhysicalRam(size, phys);
-		if (r == KErrNone)
-			{
-			r = DPlatChunkHw::New(iHwDesChunk, phys, size, aAttribs);
-			if (r == KErrNone)
-				{
-				iDesPool = (TAny*)iHwDesChunk->LinearAddress();
-				__KTRACE_OPT(KDMA, Kern::Printf("descriptor hw chunk created lin=0x%08X phys=0x%08X, size=0x%X",
-												iHwDesChunk->iLinAddr, iHwDesChunk->iPhysAddr, size));
-				}
-			else
-				Epoc::FreePhysicalRam(phys, size);
-			}
-#endif
-		}
-	else
-		{
-		iDesPool = Kern::Alloc(iMaxDesCount * sizeof(TDmaTransferArgs));
-		r = iDesPool ? KErrNone : KErrNoMemory;
-		}
-	return r;
-	}
-
-
-void TDmac::FreeDesPool()
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmac::FreeDesPool"));
-	// Calling thread must be in CS
-	__ASSERT_CRITICAL;
-	if (iCapsHwDes)
-		{
-#ifdef __WINS__
-		delete[] iDesPool;
-#else
-		if (iHwDesChunk)
-			{
-			const TPhysAddr phys = iHwDesChunk->PhysicalAddress();
-			const TInt size = iHwDesChunk->iSize;
-			iHwDesChunk->Close(NULL);
-			Epoc::FreePhysicalRam(phys, size);
-			}
-#endif
-		}
-	else
-		{
-		Kern::Free(iDesPool);
-		}
-	}
-
-
-//
-// Prealloc the given number of descriptors.
-//
-TInt TDmac::ReserveSetOfDes(TInt aCount)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmac::ReserveSetOfDes count=%d", aCount));
-	__DMA_ASSERTD(aCount > 0);
-	TInt r = KErrTooBig;
-	Wait();
-	if (iAvailDesCount - aCount >= 0)
-		{
-		iAvailDesCount -= aCount;
-		r = KErrNone;
-		}
-	Signal();
-	__DMA_INVARIANT();
-	return r;
-	}
-
-
-//
-// Return the given number of preallocated descriptors to the free pool.
-//
-void TDmac::ReleaseSetOfDes(TInt aCount)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmac::ReleaseSetOfDes count=%d", aCount));
-	__DMA_ASSERTD(aCount >= 0);
-	Wait();
-	iAvailDesCount += aCount;
-	Signal();
-	__DMA_INVARIANT();
-	}
-
-
-//
-// Queue DFC and update word used to communicate with channel DFC.
-//
-// Called in interrupt context by PSL.
-//
-void TDmac::HandleIsr(TDmaChannel& aChannel, TUint aEventMask, TBool aIsComplete)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmac::HandleIsr"));
-
-	// Function needs to be called by PSL in ISR context
-	__DMA_ASSERTD(NKern::CurrentContext() == NKern::EInterrupt);
-
-	// First the ISR callback stuff
-
-	// Is this a transfer completion notification?
-	if (aEventMask & EDmaCallbackRequestCompletion)
-		{
-		// If so, has the client requested an ISR callback?
-		if (__e32_atomic_load_acq32(&aChannel.iIsrCbRequest))
-			{
-			__KTRACE_OPT(KDMA, Kern::Printf("ISR callback"));
-
-			// Since iIsrCbRequest was set no threads will be
-			// modifying the request queue.
-			const DDmaRequest* const req = _LOFF(aChannel.iReqQ.First(), DDmaRequest, iLink);
-
-			// We expect the request to have requested
-			// ISR callback
-			__NK_ASSERT_DEBUG(req->iIsrCb);
-
-			TDmaCallback const cb = req->iDmaCb;
-			TAny* const arg = req->iDmaCbArg;
-			// Execute the client callback
-			(*cb)(EDmaCallbackRequestCompletion,
-				  (aIsComplete ? EDmaResultOK : EDmaResultError),
-				  arg,
-				  NULL);
-			// Now let's see if the callback rescheduled the transfer request
-			// (see TDmaChannel::IsrRedoRequest()).
-			const TBool redo = aChannel.iRedoRequest;
-			aChannel.iRedoRequest = EFalse;
-			const TBool stop = __e32_atomic_load_acq32(&aChannel.iIsrDfc) &
-				(TUint32)TDmaChannel::KCancelFlagMask;
-			// There won't be another ISR callback if this callback didn't
-			// reschedule the request, or the client cancelled all requests, or
-			// this callback rescheduled the request with a DFC callback.
-			if (!redo || stop || !req->iIsrCb)
-				{
-				__e32_atomic_store_rel32(&aChannel.iIsrCbRequest, EFalse);
-				}
-			if (redo && !stop)
-				{
-				// We won't queue the channel DFC in this case and just return.
-				__KTRACE_OPT(KDMA, Kern::Printf("CB rescheduled xfer -> no DFC"));
-				return;
-				}
-			// Not redoing or being cancelled means we've been calling the
-			// request's ISR callback for the last time. We're going to
-			// complete the request via the DFC in the usual way.
-			}
-		}
-	else
-		{
-		// The PIL doesn't support yet any completion types other than
-		// EDmaCallbackRequestCompletion.
-		__DMA_CANT_HAPPEN();
-		}
-
-	// Now queue a DFC if necessary. The possible scenarios are:
-	// a) DFC not queued (orig == 0)              -> update iIsrDfc + queue DFC
-	// b) DFC queued, not running yet (orig != 0) -> just update iIsrDfc
-	// c) DFC running / iIsrDfc not reset yet (orig != 0) -> just update iIsrDfc
-	// d) DFC running / iIsrDfc already reset (orig == 0) -> update iIsrDfc + requeue DFC
-
-	// Set error flag if necessary.
-	const TUint32 inc = aIsComplete ? 1u : TUint32(TDmaChannel::KErrorFlagMask) | 1u;
-
-	// Add 'inc' (interrupt count increment + poss. error flag) to 'iIsrDfc' if
-	// cancel flag is not set, do nothing otherwise. Assign original value of
-	// 'iIsrDfc' to 'orig' in any case.
-	const TUint32 orig = __e32_atomic_tau_ord32(&aChannel.iIsrDfc,
-												TUint32(TDmaChannel::KCancelFlagMask),
-												0,
-												inc);
-
-	// As transfer should be suspended when an error occurs, we
-	// should never get there with the error flag already set.
-	__DMA_ASSERTD((orig & inc & (TUint32)TDmaChannel::KErrorFlagMask) == 0);
-
-	if (orig == 0)
-		{
-		aChannel.iDfc.Add();
-		}
-	}
-
-
-TInt TDmac::InitDes(const SDmaDesHdr& aHdr, const TDmaTransferArgs& aTransferArgs)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmac::InitDes"));
-	TInt r;
-	if (iCapsHwDes)
-		{
-		__KTRACE_OPT(KDMA, Kern::Printf("iCaps.iHwDescriptors"));
-		r = InitHwDes(aHdr, aTransferArgs);
-		}
-	else
-		{
-		TDmaTransferArgs& args = HdrToDes(aHdr);
-		args = aTransferArgs;
-		r = KErrNone;
-		}
-	return r;
-	}
-
-
-TInt TDmac::InitHwDes(const SDmaDesHdr& /*aHdr*/, const TDmaTransferArgs& /*aTransferArgs*/)
-	{
-	// concrete controller must override if SDmacCaps::iHwDescriptors set
-	__DMA_UNREACHABLE_DEFAULT();
-	return KErrGeneral;
-	}
-
-
-TInt TDmac::InitSrcHwDes(const SDmaDesHdr& /*aHdr*/, const TDmaTransferArgs& /*aTransferArgs*/)
-	{
-	// concrete controller must override if SDmacCaps::iAsymHwDescriptors set
-	__DMA_UNREACHABLE_DEFAULT();
-	return KErrGeneral;
-	}
-
-
-TInt TDmac::InitDstHwDes(const SDmaDesHdr& /*aHdr*/, const TDmaTransferArgs& /*aTransferArgs*/)
-	{
-	// concrete controller must override if SDmacCaps::iAsymHwDescriptors set
-	__DMA_UNREACHABLE_DEFAULT();
-	return KErrGeneral;
-	}
-
-
-TInt TDmac::UpdateDes(const SDmaDesHdr& aHdr, TUint32 aSrcAddr, TUint32 aDstAddr,
-					  TUint aTransferCount, TUint32 aPslRequestInfo)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmac::UpdateDes"));
-	TInt r;
-	if (iCapsHwDes)
-		{
-		__KTRACE_OPT(KDMA, Kern::Printf("iCaps.iHwDescriptors"));
-		r = UpdateHwDes(aHdr, aSrcAddr, aDstAddr, aTransferCount, aPslRequestInfo);
-		}
-	else
-		{
-		TDmaTransferArgs& args = HdrToDes(aHdr);
-		if (aSrcAddr != KPhysAddrInvalid)
-			args.iSrcConfig.iAddr = aSrcAddr;
-		if (aDstAddr != KPhysAddrInvalid)
-			args.iDstConfig.iAddr = aDstAddr;
-		if (aTransferCount)
-			args.iTransferCount = aTransferCount;
-		if (aPslRequestInfo)
-			args.iPslRequestInfo = aPslRequestInfo;
-		r = KErrNone;
-		}
-	return r;
-	}
-
-
-TInt TDmac::UpdateHwDes(const SDmaDesHdr& /*aHdr*/, TUint32 /*aSrcAddr*/, TUint32 /*aDstAddr*/,
-						TUint /*aTransferCount*/, TUint32 /*aPslRequestInfo*/)
-	{
-	// concrete controller must override if SDmacCaps::iHwDescriptors set
-	__DMA_UNREACHABLE_DEFAULT();
-	return KErrGeneral;
-	}
-
-
-TInt TDmac::UpdateSrcHwDes(const SDmaDesHdr& /*aHdr*/, TUint32 /*aSrcAddr*/,
-						   TUint /*aTransferCount*/, TUint32 /*aPslRequestInfo*/)
-	{
-	// concrete controller must override if SDmacCaps::iAsymHwDescriptors set
-	__DMA_UNREACHABLE_DEFAULT();
-	return KErrGeneral;
-	}
-
-
-TInt TDmac::UpdateDstHwDes(const SDmaDesHdr& /*aHdr*/, TUint32 /*aDstAddr*/,
-						   TUint /*aTransferCount*/, TUint32 /*aPslRequestInfo*/)
-	{
-	// concrete controller must override if SDmacCaps::iAsymHwDescriptors set
-	__DMA_UNREACHABLE_DEFAULT();
-	return KErrGeneral;
-	}
-
-
-void TDmac::ChainHwDes(const SDmaDesHdr& /*aHdr*/, const SDmaDesHdr& /*aNextHdr*/)
-	{
-	// concrete controller must override if SDmacCaps::iHwDescriptors set
-	__DMA_UNREACHABLE_DEFAULT();
-	}
-
-
-void TDmac::AppendHwDes(const TDmaChannel& /*aChannel*/, const SDmaDesHdr& /*aLastHdr*/,
-						const SDmaDesHdr& /*aNewHdr*/)
-	{
- 	// concrete controller must override if SDmacCaps::iHwDescriptors set
-	__DMA_UNREACHABLE_DEFAULT();
-	}
-
-
-void TDmac::AppendHwDes(const TDmaChannel& /*aChannel*/,
-						const SDmaDesHdr& /*aSrcLastHdr*/, const SDmaDesHdr& /*aSrcNewHdr*/,
-						const SDmaDesHdr& /*aDstLastHdr*/, const SDmaDesHdr& /*aDstNewHdr*/)
-	{
-	// concrete controller must override if SDmacCaps::iAsymHwDescriptors set
-	__DMA_UNREACHABLE_DEFAULT();
-	}
-
-
-void TDmac::UnlinkHwDes(const TDmaChannel& /*aChannel*/, SDmaDesHdr& /*aHdr*/)
-	{
- 	// concrete controller must override if SDmacCaps::iHwDescriptors set
-	__DMA_UNREACHABLE_DEFAULT();
-	}
-
-
-void TDmac::ClearHwDes(const SDmaDesHdr& /*aHdr*/)
-	{
-	// default implementation - NOP; concrete controller may override
-	return;
-	}
-
-
-TInt TDmac::LinkChannels(TDmaChannel& /*a1stChannel*/, TDmaChannel& /*a2ndChannel*/)
-	{
-	// default implementation - NOP; concrete controller may override
-	return KErrNotSupported;
-	}
-
-
-TInt TDmac::UnlinkChannel(TDmaChannel& /*aChannel*/)
-	{
-	// default implementation - NOP; concrete controller may override
-	return KErrNotSupported;
-	}
-
-
-TInt TDmac::FailNext(const TDmaChannel& /*aChannel*/)
-	{
-	// default implementation - NOP; concrete controller may override
-	return KErrNotSupported;
-	}
-
-
-TInt TDmac::MissNextInterrupts(const TDmaChannel& /*aChannel*/, TInt /*aInterruptCount*/)
-	{
-	// default implementation - NOP; concrete controller may override
-	return KErrNotSupported;
-	}
-
-
-TInt TDmac::Extension(TDmaChannel& /*aChannel*/, TInt /*aCmd*/, TAny* /*aArg*/)
-	{
-	// default implementation - NOP; concrete controller may override
-	return KErrNotSupported;
-	}
-
-
-TUint32 TDmac::HwDesNumDstElementsTransferred(const SDmaDesHdr& /*aHdr*/)
-	{
- 	// Concrete controller must override if SDmacCaps::iHwDescriptors set.
-	__DMA_UNREACHABLE_DEFAULT();
-	return 0;
-	}
-
-
-TUint32 TDmac::HwDesNumSrcElementsTransferred(const SDmaDesHdr& /*aHdr*/)
-	{
- 	// Concrete controller must override if SDmacCaps::iHwDescriptors set.
-	__DMA_UNREACHABLE_DEFAULT();
-	return 0;
-	}
-
-
-#ifdef _DEBUG
-
-void TDmac::Invariant()
-	{
-	Wait();
-	__DMA_ASSERTD(0 <= iAvailDesCount && iAvailDesCount <= iMaxDesCount);
-	__DMA_ASSERTD(!iFreeHdr || IsValidHdr(iFreeHdr));
-	for (TInt i = 0; i < iMaxDesCount; i++)
-		__DMA_ASSERTD(iHdrPool[i].iNext == NULL || IsValidHdr(iHdrPool[i].iNext));
-	Signal();
-	}
-
-
-TBool TDmac::IsValidHdr(const SDmaDesHdr* aHdr)
-	{
-	return (iHdrPool <= aHdr) && (aHdr < iHdrPool + iMaxDesCount);
-	}
-
-#endif
-
-
-//
-// Internal compat version, used by legacy Fragment()
-//
-TDmaTransferConfig::TDmaTransferConfig(TUint32 aAddr, TUint aFlags, TBool aAddrInc)
-	: iAddr(aAddr),
-	  iAddrMode(aAddrInc ? KDmaAddrModePostIncrement : KDmaAddrModeConstant),
-	  iElementSize(0),
-	  iElementsPerFrame(0),
-	  iElementsPerPacket(0),
-	  iFramesPerTransfer(0),
-	  iElementSkip(0),
-	  iFrameSkip(0),
-	  iBurstSize(KDmaBurstSizeAny),
-	  iFlags(aFlags),
-	  iSyncFlags(KDmaSyncAuto),
-	  iPslTargetInfo(0),
-	  iRepeatCount(0),
-	  iDelta(~0u),
-	  iReserved(0)
-	{
-	__KTRACE_OPT(KDMA,
-				 Kern::Printf("TDmaTransferConfig::TDmaTransferConfig "
-							  "aAddr=0x%08X aFlags=0x%08X aAddrInc=%d",
-							  aAddr, aFlags, aAddrInc));
-	}
-
-
-//
-// Internal compat version, used by legacy Fragment()
-//
-TDmaTransferArgs::TDmaTransferArgs(TUint32 aSrc, TUint32 aDest, TInt aCount,
-								   TUint aFlags, TUint32 aPslInfo)
-	: iSrcConfig(aSrc, RequestFlags2SrcConfigFlags(aFlags), (aFlags & KDmaIncSrc)),
-	  iDstConfig(aDest, RequestFlags2DstConfigFlags(aFlags), (aFlags & KDmaIncDest)),
-	  iTransferCount(aCount),
-	  iGraphicsOps(KDmaGraphicsOpNone),
-	  iColour(0),
-	  iFlags(0),
-	  iChannelPriority(KDmaPriorityNone),
-	  iPslRequestInfo(aPslInfo),
-	  iChannelCookie(0),
-	  iDelta(~0u),
-	  iReserved1(0),
-	  iReserved2(0)
-	{
-	__KTRACE_OPT(KDMA,
-				 Kern::Printf("TDmaTransferArgs::TDmaTransferArgs"));
-	__KTRACE_OPT(KDMA,
-				 Kern::Printf("  aSrc=0x%08X aDest=0x%08X aCount=%d aFlags=0x%08X aPslInfo=0x%08X",
-							  aSrc, aDest, aCount, aFlags, aPslInfo));
-	}
-
-
-//
-// As DDmaRequest is derived from DBase, the initializations with zero aren't
-// strictly necessary here, but this way it's nicer.
-//
-EXPORT_C DDmaRequest::DDmaRequest(TDmaChannel& aChannel, TCallback aCb,
-								  TAny* aCbArg, TInt aMaxTransferSize)
-	: iChannel(aChannel),
-	  iCb(aCb),
-	  iCbArg(aCbArg),
-	  iDmaCb(NULL),
-	  iDmaCbArg(NULL),
-	  iIsrCb(EFalse),
-	  iDesCount(0),
-	  iFirstHdr(NULL),
-	  iLastHdr(NULL),
-	  iSrcDesCount(0),
-	  iSrcFirstHdr(NULL),
-	  iSrcLastHdr(NULL),
-	  iDstDesCount(0),
-	  iDstFirstHdr(NULL),
-	  iDstLastHdr(NULL),
-	  iQueued(EFalse),
-	  iMaxTransferSize(aMaxTransferSize),
-	  iTotalNumSrcElementsTransferred(0),
-	  iTotalNumDstElementsTransferred(0)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::DDmaRequest =0x%08X (old style)", this));
-	iChannel.iReqCount++;
-	__DMA_ASSERTD(0 <= aMaxTransferSize);
-	__DMA_INVARIANT();
-	}
-
-
-//
-// As DDmaRequest is derived from DBase, the initializations with zero aren't
-// strictly necessary here, but this way it's nicer.
-//
-EXPORT_C DDmaRequest::DDmaRequest(TDmaChannel& aChannel, TDmaCallback aDmaCb,
-								  TAny* aCbArg, TUint aMaxTransferSize)
-	: iChannel(aChannel),
-	  iCb(NULL),
-	  iCbArg(NULL),
-	  iDmaCb(aDmaCb),
-	  iDmaCbArg(aCbArg),
-	  iIsrCb(EFalse),
-	  iDesCount(0),
-	  iFirstHdr(NULL),
-	  iLastHdr(NULL),
-	  iSrcDesCount(0),
-	  iSrcFirstHdr(NULL),
-	  iSrcLastHdr(NULL),
-	  iDstDesCount(0),
-	  iDstFirstHdr(NULL),
-	  iDstLastHdr(NULL),
-	  iQueued(EFalse),
-	  iMaxTransferSize(aMaxTransferSize),
-	  iTotalNumSrcElementsTransferred(0),
-	  iTotalNumDstElementsTransferred(0)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::DDmaRequest =0x%08X (new style)", this));
-	__e32_atomic_add_ord32(&iChannel.iReqCount, 1);
-	__DMA_INVARIANT();
-	}
-
-
-EXPORT_C DDmaRequest::~DDmaRequest()
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::~DDmaRequest"));
-	__DMA_ASSERTD(!iQueued);
-	__DMA_INVARIANT();
-	if (iChannel.iDmacCaps->iAsymHwDescriptors)
-		{
-		FreeSrcDesList();
-		FreeDstDesList();
-		}
-	else
-		{
-		FreeDesList();
-		}
-	__e32_atomic_add_ord32(&iChannel.iReqCount, TUint32(-1));
-	}
-
-
-EXPORT_C TInt DDmaRequest::Fragment(TUint32 aSrc, TUint32 aDest, TInt aCount,
-									TUint aFlags, TUint32 aPslInfo)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::Fragment thread %O (old style)",
-									&Kern::CurrentThread()));
-
-	__DMA_ASSERTD(aCount > 0);
-
-	TDmaTransferArgs args(aSrc, aDest, aCount, aFlags, aPslInfo);
-
-	return Frag(args);
-	}
-
-
-EXPORT_C TInt DDmaRequest::Fragment(const TDmaTransferArgs& aTransferArgs)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::Fragment thread %O (new style)",
-									&Kern::CurrentThread()));
-
-	// Writable temporary working copy of the transfer arguments.
-	// We need this because we may have to modify some fields before passing it
-	// to the PSL (for example iChannelCookie, iTransferCount,
-	// iDstConfig::iAddr, and iSrcConfig::iAddr).
-	TDmaTransferArgs args(aTransferArgs);
-
-	return Frag(args);
-	}
-
-
-TInt DDmaRequest::CheckTransferConfig(const TDmaTransferConfig& aTarget, TUint aCount) const
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::CheckTransferConfig"));
-
-	if (aTarget.iElementSize != 0)
-		{
-		if ((aCount % aTarget.iElementSize) != 0)
-			{
-			// 2, 7 (These strange numbers refer to some test cases documented
-			// elsewhere - they will be removed eventually.)
-			__KTRACE_OPT(KPANIC,
-						 Kern::Printf("Error: ((aCount %% iElementSize) != 0)"));
-			return KErrArgument;
-			}
-		if (aTarget.iElementsPerFrame != 0)
-			{
-			if ((aTarget.iElementSize * aTarget.iElementsPerFrame *
-				 aTarget.iFramesPerTransfer) != aCount)
-				{
-				// 3, 8
-				__KTRACE_OPT(KPANIC,
-							 Kern::Printf("Error: ((iElementSize * "
-										  "iElementsPerFrame * "
-										  "iFramesPerTransfer) != aCount)"));
-				return KErrArgument;
-				}
-			}
-		}
-	else
-		{
-		if (aTarget.iElementsPerFrame != 0)
-			{
-			// 4, 9
-			__KTRACE_OPT(KPANIC,
-						 Kern::Printf("Error: (iElementsPerFrame != 0)"));
-			return KErrArgument;
-			}
-		if (aTarget.iFramesPerTransfer != 0)
-			{
-			// 5, 10
-			__KTRACE_OPT(KPANIC,
-						 Kern::Printf("Error: (iFramesPerTransfer != 0)"));
-			return KErrArgument;
-			}
-		if (aTarget.iElementsPerPacket != 0)
-			{
-			// 6, 11
-			__KTRACE_OPT(KPANIC,
-						 Kern::Printf("Error: (iElementsPerPacket != 0)"));
-			return KErrArgument;
-			}
-		}
-	return KErrNone;
-	}
-
-
-TInt DDmaRequest::CheckMemFlags(const TDmaTransferConfig& aTarget) const
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::CheckMemFlags"));
-
-	const TBool mem_target = (aTarget.iFlags & KDmaMemAddr);
-
-	if (mem_target && (aTarget.iFlags & KDmaPhysAddr) && !(aTarget.iFlags & KDmaMemIsContiguous))
-		{
-		// Physical memory address implies contiguous range
-		// 13, 15
-		__KTRACE_OPT(KPANIC, Kern::Printf("Error: mem_target && KDmaPhysAddr && !KDmaMemIsContiguous"));
-		return KErrArgument;
-		}
-	else if ((aTarget.iFlags & KDmaMemIsContiguous) && !mem_target)
-		{
-		// Contiguous range implies memory address
-		// 14, 16
-		__KTRACE_OPT(KPANIC, Kern::Printf("Error: KDmaMemIsContiguous && !mem_target"));
-		return KErrArgument;
-		}
-	return KErrNone;
-	}
-
-
-// Makes sure an element or frame never straddles two DMA subtransfer
-// fragments. This would be a fragmentation error by the PIL.
-//
-TInt DDmaRequest::AdjustFragmentSize(TUint& aFragSize, TUint aElementSize,
-									 TUint aFrameSize)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::AdjustFragmentSize FragSize=%d ES=%d FS=%d",
-									aFragSize, aElementSize, aFrameSize));
-
-	TUint rem = 0;
-	TInt r = KErrNone;
-
-	FOREVER
-		{
-		// If an element size is defined, make sure the fragment size is
-		// greater or equal.
-		if (aElementSize)
-			{
-			if (aFragSize < aElementSize)
-				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("Error: aFragSize < aElementSize"));
-				r = KErrArgument;
-				break;
-				}
-			}
-		// If a frame size is defined, make sure the fragment size is greater
-		// or equal.
-		if (aFrameSize)
-			{
-			if (aFragSize < aFrameSize)
-				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("Error: aFragSize < aFrameSize"));
-				r = KErrArgument;
-				break;
-				}
-			}
-		// If a frame size is defined, make sure the fragment ends on a frame
-		// boundary.
-		if (aFrameSize)
-			{
-			rem = aFragSize % aFrameSize;
-			if (rem != 0)
-				{
-				aFragSize -= rem;
-				// 20, 22
-				__KTRACE_OPT(KDMA, Kern::Printf("aFragSize %% aFrameSize != 0 --> aFragSize = %d",
-												aFragSize));
-				// aFragSize has changed, so we have to do all the checks
-				// again.
-				continue;
-				}
-			}
-		// If an element size is defined, make sure the fragment ends on an
-		// element boundary.
-		if (aElementSize)
-			{
-			rem = aFragSize % aElementSize;
-			if (rem != 0)
-				{
-				aFragSize -= rem;
-				// 21, 23
-				__KTRACE_OPT(KDMA, Kern::Printf("aFragSize %% aElementSize != 0 --> aFragSize = %d",
-												aFragSize));
-				// aFragSize has changed, so we have to do all the checks
-				// again.
-				continue;
-				}
-			}
-		// Done - all checks passed. Let's get out.
-		break;
-		}
-
-	return r;
-	}
-
-
-TUint DDmaRequest::GetTransferCount(const TDmaTransferArgs& aTransferArgs) const
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::GetTransferCount"));
-
-	const TDmaTransferConfig& src = aTransferArgs.iSrcConfig;
-#ifdef _DEBUG
-	const TDmaTransferConfig& dst = aTransferArgs.iDstConfig;
-#endif	// #ifdef _DEBUG
-
-	TUint count = aTransferArgs.iTransferCount;
-	if (count == 0)
-		{
-		__KTRACE_OPT(KDMA, Kern::Printf("iTransferCount == 0"));
-		count = src.iElementSize * src.iElementsPerFrame *
-			src.iFramesPerTransfer;
-#ifdef _DEBUG
-		const TUint dst_cnt = dst.iElementSize * dst.iElementsPerFrame *
-			dst.iFramesPerTransfer;
-		if (count != dst_cnt)
-			{
-			// 1
-			__KTRACE_OPT(KPANIC, Kern::Printf("Error: (count != dst_cnt)"));
-			return 0;
-			}
-#endif	// #ifdef _DEBUG
-		}
-	else
-		{
-		__KTRACE_OPT(KDMA, Kern::Printf("iTransferCount == %d", count));
-#ifdef _DEBUG
-		// Client shouldn't specify contradictory or incomplete things
-		if (CheckTransferConfig(src, count) != KErrNone)
-			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("Error: CheckTransferConfig(src)"));
-			return 0;
-			}
-		if (CheckTransferConfig(dst, count) != KErrNone)
-			{
-			__KTRACE_OPT(KPANIC, Kern::Printf("Error: CheckTransferConfig(dst)"));
-			return 0;
-			}
-#endif	// #ifdef _DEBUG
-		}
-	return count;
-	}
-
-
-TUint DDmaRequest::GetMaxTransferlength(const TDmaTransferArgs& aTransferArgs, TUint aCount) const
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::GetMaxTransferlength"));
-
-	const TDmaTransferConfig& src = aTransferArgs.iSrcConfig;
-	const TDmaTransferConfig& dst = aTransferArgs.iDstConfig;
-
-	// Ask the PSL what the maximum length is for a single transfer
-	TUint max_xfer_len = iChannel.MaxTransferLength(src.iFlags, dst.iFlags,
-													aTransferArgs.iPslRequestInfo);
-	if (iMaxTransferSize)
-		{
-		// (User has set a transfer size cap)
-		__KTRACE_OPT(KDMA, Kern::Printf("iMaxTransferSize: %d", iMaxTransferSize));
-		if ((max_xfer_len != 0) && (iMaxTransferSize > max_xfer_len))
-			{
-			// Not really an error, but still...
-			__KTRACE_OPT(KPANIC, Kern::Printf("Warning: iMaxTransferSize > max_xfer_len"));
-			}
-		max_xfer_len = iMaxTransferSize;
-		}
-	else
-		{
-		// (User doesn't care about max transfer size)
-		if (max_xfer_len == 0)
-			{
-			// '0' = no maximum imposed by controller
-			max_xfer_len = aCount;
-			}
-		}
-	__KTRACE_OPT(KDMA, Kern::Printf("max_xfer_len: %d", max_xfer_len));
-
-	// Some sanity checks
-#ifdef _DEBUG
-	if ((max_xfer_len < src.iElementSize) || (max_xfer_len < dst.iElementSize))
-		{
-		// 18
-		__KTRACE_OPT(KPANIC, Kern::Printf("Error: max_xfer_len < iElementSize"));
-		return 0;
-		}
-	if ((max_xfer_len < (src.iElementSize * src.iElementsPerFrame)) ||
-		(max_xfer_len < (dst.iElementSize * dst.iElementsPerFrame)))
-		{
-		// 19
-		__KTRACE_OPT(KPANIC,
-					 Kern::Printf("Error: max_xfer_len < (iElementSize * iElementsPerFrame)"));
-		return 0;
-		}
-#endif	// #ifdef _DEBUG
-
-	return max_xfer_len;
-	}
-
-
-// Unified internal fragmentation routine, called by both the old and new
-// exported Fragment() functions.
-//
-// Depending on whether the DMAC uses a single or two separate descriptor
-// chains, this function branches into either FragSym() or FragAsym(), and the
-// latter function further into either FragAsymSrc()/FragAsymDst() or
-// FragBalancedAsym().
-//
-TInt DDmaRequest::Frag(TDmaTransferArgs& aTransferArgs)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::Frag"));
-	__DMA_ASSERTD(!iQueued);
-
-	// Transfer count + checks
-	const TUint count = GetTransferCount(aTransferArgs);
-	if (count == 0)
-		{
-		return KErrArgument;
-		}
-
-	// Max transfer length + checks
-	const TUint max_xfer_len = GetMaxTransferlength(aTransferArgs, count);
-	if (max_xfer_len == 0)
-		{
-		return KErrArgument;
-		}
-
-	// ISR callback requested?
-	const TBool isr_cb = (aTransferArgs.iFlags & KDmaRequestCallbackFromIsr);
-	if (isr_cb)
-		{
-		// Requesting an ISR callback w/o supplying one?
-		if (!iDmaCb)
-			{
-			// 12
-			__KTRACE_OPT(KPANIC, Kern::Printf("Error: !iDmaCb"));
-			return KErrArgument;
-			}
-		}
-
-	// Set the channel cookie for the PSL
-	aTransferArgs.iChannelCookie = iChannel.PslId();
-
-	// Client shouldn't specify contradictory or invalid things
-	TInt r = CheckMemFlags(aTransferArgs.iSrcConfig);
-	if (r != KErrNone)
-		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("Error: CheckMemFlags(src)"));
-		return r;
-		}
-	r =  CheckMemFlags(aTransferArgs.iDstConfig);
-	if (r != KErrNone)
-		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("Error: CheckMemFlags(dst)"));
-		return r;
-		}
-
-	// Now the actual fragmentation
-	if (iChannel.iDmacCaps->iAsymHwDescriptors)
-		{
-		r = FragAsym(aTransferArgs, count, max_xfer_len);
-		}
-	else
-		{
-		r = FragSym(aTransferArgs, count, max_xfer_len);
-		}
-
-	if (r == KErrNone)
-		{
-		iIsrCb = isr_cb;
-		}
-
-	__DMA_INVARIANT();
-	return r;
-	};
-
-
-TInt DDmaRequest::FragSym(TDmaTransferArgs& aTransferArgs, TUint aCount,
-						  TUint aMaxTransferLen)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::FragSym"));
-
-	TDmaTransferConfig& src = aTransferArgs.iSrcConfig;
-	TDmaTransferConfig& dst = aTransferArgs.iDstConfig;
-	const TBool mem_src = (src.iFlags & KDmaMemAddr);
-	const TBool mem_dst = (dst.iFlags & KDmaMemAddr);
-
-	const TUint align_mask_src = iChannel.AddressAlignMask(src.iFlags,
-														   src.iElementSize,
-														   aTransferArgs.iPslRequestInfo);
-	__KTRACE_OPT(KDMA, Kern::Printf("align_mask_src: 0x%x", align_mask_src));
-	const TUint align_mask_dst = iChannel.AddressAlignMask(dst.iFlags,
-														   dst.iElementSize,
-														   aTransferArgs.iPslRequestInfo);
-	__KTRACE_OPT(KDMA, Kern::Printf("align_mask_dst: 0x%x", align_mask_dst));
-
-	// Memory buffers must satisfy alignment constraint
-	__DMA_ASSERTD(!mem_src || ((src.iAddr & align_mask_src) == 0));
-	__DMA_ASSERTD(!mem_dst || ((dst.iAddr & align_mask_dst) == 0));
-
-	// Max aligned length is used to make sure the beginnings of subtransfers
-	// (i.e. fragments) are correctly aligned.
-	const TUint max_aligned_len = (aMaxTransferLen &
-								   ~(_Max(align_mask_src, align_mask_dst)));
-	__KTRACE_OPT(KDMA, Kern::Printf("max_aligned_len: %d", max_aligned_len));
-	// Client and PSL sane?
-	__DMA_ASSERTD(max_aligned_len > 0);
-
-	if (mem_src && mem_dst &&
-		align_mask_src && align_mask_dst &&
-		(align_mask_src != align_mask_dst) &&
-		(!(src.iFlags & KDmaMemIsContiguous) || !(dst.iFlags & KDmaMemIsContiguous)))
-		{
-		// We don't support transfers which satisfy ALL of the following conditions:
-		// 1) from memory to memory,
-		// 2) both sides have address alignment requirements,
-		// 3) those alignment requirements are not the same,
-		// 4) the memory is non-contiguous on at least one end.
-		//
-		// [A 5th condition is that the channel doesn't support fully
-		// asymmetric h/w descriptor lists,
-		// i.e. TDmaChannel::DmacCaps::iAsymHwDescriptors is reported as EFalse
-		// or iBalancedAsymSegments as ETrue. Hence this check is done in
-		// FragSym() and FragBalancedAsym() but not in FragAsym().]
-		//
-		// The reason for this is that fragmentation could be impossible. The
-		// memory layout (page break) on the side with the less stringent
-		// alignment requirement can result in a misaligned target address on
-		// the other side.
-		//
-		// Here is an example:
-		//
-		// src.iAddr =  3964 (0x0F7C), non-contiguous,
-		// align_mask_src = 1 (alignment = 2 bytes)
-		// dst.iAddr = 16384 (0x4000), contiguous,
-		// align_mask_dst = 7 (alignment = 8 bytes)
-		// count = max_xfer_len = 135 bytes
-		// => max_aligned_len = 128 bytes
-		//
-		// Now, suppose MaxPhysSize() returns 132 bytes because src has 132
-		// contiguous bytes to the end of its current mem page.
-		// Trying to fragment this leads to:
-		//
-		// frag_1 = 128 bytes: src reads from 3964 (0x0F7C),
-		//                     dst writes to 16384 (0x4000).
-		// (Fragment 1 uses the max_aligned_len instead of 132 bytes because
-		// otherwise the next fragment would start for the destination at
-		// dst.iAddr + 132 = 16516 (0x4084), which is not 8-byte aligned.)
-		//
-		// frag_2 = 4 bytes: src reads from 4092 (0x0FFC),
-		//                   dst writes to 16512 (0x4080).
-		// (Fragment 2 uses just 4 bytes instead of the remaining 7 bytes
-		// because there is a memory page break on the source side after 4 bytes.)
-		//
-		// frag_3 = 3 bytes: src reads from 4096 (0x1000),
-		//                   dst writes to 16516 (0x4084).
-		//
-		// And there's the problem: the start address of frag_3 is going to be
-		// misaligned for the destination side - it's not 8-byte aligned!
-		//
-		// 17
-		__KTRACE_OPT(KPANIC, Kern::Printf("Error: Different alignments for src & dst"
-										  " + non-contiguous target(s)"));
-		return KErrArgument;
-		}
-
-	TInt r;
-	// Revert any previous fragmentation attempt
-	FreeDesList();
-	do
-		{
-		// Allocate fragment
-		r = ExpandDesList(/*1*/);
-		if (r != KErrNone)
-			{
-			break;
-			}
-		// Compute fragment size
-		TUint c = _Min(aMaxTransferLen, aCount);
-		__KTRACE_OPT(KDMA, Kern::Printf("c = _Min(aMaxTransferLen, aCount) = %d", c));
-
-		// SRC
-		if (mem_src && !(src.iFlags & KDmaMemIsContiguous))
-			{
-			c = MaxPhysSize(src.iAddr, c);
-			__KTRACE_OPT(KDMA, Kern::Printf("c = MaxPhysSize(src.iAddr, c) = %d", c));
-			}
-
-		// DST
-		if (mem_dst && !(dst.iFlags & KDmaMemIsContiguous))
-			{
-			c = MaxPhysSize(dst.iAddr, c);
-			__KTRACE_OPT(KDMA, Kern::Printf("c = MaxPhysSize(dst.iAddr, c) = %d", c));
-			}
-
-		// SRC & DST
-		if ((mem_src || mem_dst) && (c < aCount) && (c > max_aligned_len))
-			{
-			// This is not the last fragment of a transfer to/from memory.
-			// We must round down the fragment size so the next one is
-			// correctly aligned.
-			c = max_aligned_len;
-			__KTRACE_OPT(KDMA, Kern::Printf("c = max_aligned_len = %d", c));
-			//
-			// But can this condition actually occur if src and dst are
-			// properly aligned to start with?
-			//
-			// If we disallow unequal alignment requirements in connection with
-			// non-contiguous memory buffers (see the long comment above in
-			// this function for why) and if both target addresses are
-			// correctly aligned at the beginning of the transfer then it
-			// doesn't seem possible to end up with a fragment which is not
-			// quite the total remaining size (c < aCount) but still larger
-			// than the greatest aligned length (c > max_aligned_len).
-			//
-			// That's because address alignment values are always a power of
-			// two (at least that's what we assume - otherwise
-			// AddressAlignMask() doesn't work), and memory page sizes are also
-			// always a power of two and hence a multiple of the alignment
-			// value (as long as the alignment is not greater than the page
-			// size, which seems a reasonable assumption regardless of the
-			// actual page size). So if we start properly aligned anywhere in a
-			// memory page then the number of bytes to the end of that page is
-			// always a multiple of the aligment value - there's no remainder.
-			//
-			// So let's see if we ever hit this assertion:
-			Kern::Printf("Unexpected: (mem_src || mem_dst) && (c < aCount) && (c > max_aligned_len)");
-			__DMA_ASSERTA(EFalse);
-			}
-
-		// If this is not the last fragment...
-		if (c < aCount)
-			{
-			const TUint es_src = src.iElementSize;
-			const TUint es_dst = dst.iElementSize;
-			const TUint fs_src = es_src * src.iElementsPerFrame;
-			const TUint fs_dst = es_dst * dst.iElementsPerFrame;
-			TUint c_prev;
-			do
-				{
-				c_prev = c;
-				// If fs_src is !0 then es_src must be !0 as well (see
-				// CheckTransferConfig).
-				if (es_src)
-					{
-					r = AdjustFragmentSize(c, es_src, fs_src);
-					if (r != KErrNone)
-						{
-						break;							// while (c != c_prev);
-						}
-					}
-				// If fs_dst is !0 then es_dst must be !0 as well (see
-				// CheckTransferConfig).
-				if (es_dst)
-					{
-					r = AdjustFragmentSize(c, es_dst, fs_dst);
-					if (r != KErrNone)
-						{
-						break;							// while (c != c_prev);
-						}
-					}
-				} while (c != c_prev);
-			if (r != KErrNone)
-				{
-				break;									 // while (aCount > 0);
-				}
-			}
-
-		// Set transfer count for the PSL
-		aTransferArgs.iTransferCount = c;
-		__KTRACE_OPT(KDMA, Kern::Printf("this fragm.: %d (0x%x) total remain.: %d (0x%x)",
-										c, c, aCount, aCount));
-		// Initialise fragment
-		r = iChannel.iController->InitDes(*iLastHdr, aTransferArgs);
-		if (r != KErrNone)
-			{
-			break;
-			}
-		// Update for next iteration
-		aCount -= c;
-		if (mem_src)
-			{
-			src.iAddr += c;
-			}
-		if (mem_dst)
-			{
-			dst.iAddr += c;
-			}
-		} while (aCount > 0);
-
-	if (r != KErrNone)
-		{
-		FreeDesList();
-		}
-	return r;
-	}
-
-
-TInt DDmaRequest::FragAsym(TDmaTransferArgs& aTransferArgs, TUint aCount,
-						   TUint aMaxTransferLen)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::FragAsym"));
-
-	TInt r;
-	if (iChannel.iDmacCaps->iBalancedAsymSegments)
-		{
-		r = FragBalancedAsym(aTransferArgs, aCount, aMaxTransferLen);
-		if (r != KErrNone)
-			{
-			FreeSrcDesList();
-			FreeDstDesList();
-			}
-		return r;
-		}
-	r = FragAsymSrc(aTransferArgs, aCount, aMaxTransferLen);
-	if (r != KErrNone)
-		{
-		FreeSrcDesList();
-		return r;
-		}
-	r = FragAsymDst(aTransferArgs, aCount, aMaxTransferLen);
-	if (r != KErrNone)
-		{
-		FreeSrcDesList();
-		FreeDstDesList();
-		}
-	return r;
-	}
-
-
-TInt DDmaRequest::FragAsymSrc(TDmaTransferArgs& aTransferArgs, TUint aCount,
-							  TUint aMaxTransferLen)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::FragAsymSrc"));
-
-	TDmaTransferConfig& src = aTransferArgs.iSrcConfig;
-	const TBool mem_src = (src.iFlags & KDmaMemAddr);
-
-	const TUint align_mask = iChannel.AddressAlignMask(src.iFlags,
-													   src.iElementSize,
-													   aTransferArgs.iPslRequestInfo);
-	__KTRACE_OPT(KDMA, Kern::Printf("align_mask: 0x%x", align_mask));
-
-	// Memory buffers must satisfy alignment constraint
-	__DMA_ASSERTD(!mem_src || ((src.iAddr & align_mask) == 0));
-
-	// Max aligned length is used to make sure the beginnings of subtransfers
-	// (i.e. fragments) are correctly aligned.
-	const TUint max_aligned_len = (aMaxTransferLen & ~align_mask);
-	__KTRACE_OPT(KDMA, Kern::Printf("max_aligned_len: %d", max_aligned_len));
-	// Client and PSL sane?
-	__DMA_ASSERTD(max_aligned_len > 0);
-
-	TInt r;
-	// Revert any previous fragmentation attempt
-	FreeSrcDesList();
-	do
-		{
-		// Allocate fragment
-		r = ExpandSrcDesList(/*1*/);
-		if (r != KErrNone)
-			{
-			break;
-			}
-		// Compute fragment size
-		TUint c = _Min(aMaxTransferLen, aCount);
-		__KTRACE_OPT(KDMA, Kern::Printf("c = _Min(aMaxTransferLen, aCount) = %d", c));
-
-		if (mem_src && !(src.iFlags & KDmaMemIsContiguous))
-			{
-			c = MaxPhysSize(src.iAddr, c);
-			__KTRACE_OPT(KDMA, Kern::Printf("c = MaxPhysSize(src.iAddr, c) = %d", c));
-			}
-
-		if (mem_src && (c < aCount) && (c > max_aligned_len))
-			{
-			// This is not the last fragment of a transfer from memory.
-			// We must round down the fragment size so the next one is
-			// correctly aligned.
-			__KTRACE_OPT(KDMA, Kern::Printf("c = max_aligned_len = %d", c));
-			//
-			// But can this condition actually occur if src is properly aligned
-			// to start with?
-			//
-			// If the target address is correctly aligned at the beginning of
-			// the transfer then it doesn't seem possible to end up with a
-			// fragment which is not quite the total remaining size (c <
-			// aCount) but still larger than the greatest aligned length (c >
-			// max_aligned_len).
-			//
-			// That's because address alignment values are always a power of
-			// two (at least that's what we assume - otherwise
-			// AddressAlignMask() doesn't work), and memory page sizes are also
-			// always a power of two and hence a multiple of the alignment
-			// value (as long as the alignment is not greater than the page
-			// size, which seems a reasonable assumption regardless of the
-			// actual page size). So if we start properly aligned anywhere in a
-			// memory page then the number of bytes to the end of that page is
-			// always a multiple of the aligment value - there's no remainder.
-			//
-			// So let's see if we ever hit this assertion:
-			Kern::Printf("Unexpected: mem_src && (c < aCount) && (c > max_aligned_len)");
-			__DMA_ASSERTA(EFalse);
-			}
-
-		// If this is not the last fragment...
-		if (c < aCount)
-			{
-			const TUint es = src.iElementSize;
-			const TUint fs = es * src.iElementsPerFrame;
-			// If fs is !0 then es must be !0 as well (see
-			// CheckTransferConfig).
-			if (es)
-				{
-				r = AdjustFragmentSize(c, es, fs);
-				if (r != KErrNone)
-					{
-					break;								 // while (aCount > 0);
-					}
-				}
-			}
-
-		// Set transfer count for the PSL
-		aTransferArgs.iTransferCount = c;
-		__KTRACE_OPT(KDMA, Kern::Printf("this fragm.: %d (0x%x) total remain.: %d (0x%x)",
-										c, c, aCount, aCount));
-		// Initialise fragment
-		r = iChannel.iController->InitSrcHwDes(*iSrcLastHdr, aTransferArgs);
-		if (r != KErrNone)
-			{
-			break;
-			}
-		// Update for next iteration
-		aCount -= c;
-		if (mem_src)
-			{
-			src.iAddr += c;
-			}
-		} while (aCount > 0);
-
-	return r;
-	}
-
-
-TInt DDmaRequest::FragAsymDst(TDmaTransferArgs& aTransferArgs, TUint aCount,
-							  TUint aMaxTransferLen)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::FragAsymDst"));
-
-	TDmaTransferConfig& dst = aTransferArgs.iDstConfig;
-	const TBool mem_dst = (dst.iFlags & KDmaMemAddr);
-
-	const TUint align_mask = iChannel.AddressAlignMask(dst.iFlags,
-													   dst.iElementSize,
-													   aTransferArgs.iPslRequestInfo);
-	__KTRACE_OPT(KDMA, Kern::Printf("align_mask: 0x%x", align_mask));
-
-	// Memory buffers must satisfy alignment constraint
-	__DMA_ASSERTD(!mem_dst || ((dst.iAddr & align_mask) == 0));
-
-	// Max aligned length is used to make sure the beginnings of subtransfers
-	// (i.e. fragments) are correctly aligned.
-	const TUint max_aligned_len = (aMaxTransferLen & ~align_mask);
-	__KTRACE_OPT(KDMA, Kern::Printf("max_aligned_len: %d", max_aligned_len));
-	// Client and PSL sane?
-	__DMA_ASSERTD(max_aligned_len > 0);
-
-	TInt r;
-	// Revert any previous fragmentation attempt
-	FreeDstDesList();
-	do
-		{
-		// Allocate fragment
-		r = ExpandDstDesList(/*1*/);
-		if (r != KErrNone)
-			{
-			break;
-			}
-		// Compute fragment size
-		TUint c = _Min(aMaxTransferLen, aCount);
-		__KTRACE_OPT(KDMA, Kern::Printf("c = _Min(aMaxTransferLen, aCount) = %d", c));
-
-		if (mem_dst && !(dst.iFlags & KDmaMemIsContiguous))
-			{
-			c = MaxPhysSize(dst.iAddr, c);
-			__KTRACE_OPT(KDMA, Kern::Printf("c = MaxPhysSize(dst.iAddr, c) = %d", c));
-			}
-
-		if (mem_dst && (c < aCount) && (c > max_aligned_len))
-			{
-			// This is not the last fragment of a transfer to memory.
-			// We must round down the fragment size so the next one is
-			// correctly aligned.
-			__KTRACE_OPT(KDMA, Kern::Printf("c = max_aligned_len = %d", c));
-			//
-			// But can this condition actually occur if dst is properly aligned
-			// to start with?
-			//
-			// If the target address is correctly aligned at the beginning of
-			// the transfer then it doesn't seem possible to end up with a
-			// fragment which is not quite the total remaining size (c <
-			// aCount) but still larger than the greatest aligned length (c >
-			// max_aligned_len).
-			//
-			// That's because address alignment values are always a power of
-			// two (at least that's what we assume - otherwise
-			// AddressAlignMask() doesn't work), and memory page sizes are also
-			// always a power of two and hence a multiple of the alignment
-			// value (as long as the alignment is not greater than the page
-			// size, which seems a reasonable assumption regardless of the
-			// actual page size). So if we start properly aligned anywhere in a
-			// memory page then the number of bytes to the end of that page is
-			// always a multiple of the aligment value - there's no remainder.
-			//
-			// So let's see if we ever hit this assertion:
-			Kern::Printf("Unexpected: mem_dst && (c < aCount) && (c > max_aligned_len)");
-			__DMA_ASSERTA(EFalse);
-			}
-
-		// If this is not the last fragment...
-		if (c < aCount)
-			{
-			const TUint es = dst.iElementSize;
-			const TUint fs = es * dst.iElementsPerFrame;
-			// If fs is !0 then es must be !0 as well (see
-			// CheckTransferConfig).
-			if (es)
-				{
-				r = AdjustFragmentSize(c, es, fs);
-				if (r != KErrNone)
-					{
-					break;								 // while (aCount > 0);
-					}
-				}
-			}
-
-		// Set transfer count for the PSL
-		aTransferArgs.iTransferCount = c;
-		__KTRACE_OPT(KDMA, Kern::Printf("this fragm.: %d (0x%x) total remain.: %d (0x%x)",
-										c, c, aCount, aCount));
-		// Initialise fragment
-		r = iChannel.iController->InitDstHwDes(*iDstLastHdr, aTransferArgs);
-		if (r != KErrNone)
-			{
-			break;
-			}
-		// Update for next iteration
-		aCount -= c;
-		if (mem_dst)
-			{
-			dst.iAddr += c;
-			}
-		}
-	while (aCount > 0);
-
-	return r;
-	}
-
-
-TInt DDmaRequest::FragBalancedAsym(TDmaTransferArgs& aTransferArgs, TUint aCount,
-								   TUint aMaxTransferLen)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::FragBalancedAsym"));
-
-	TDmaTransferConfig& src = aTransferArgs.iSrcConfig;
-	TDmaTransferConfig& dst = aTransferArgs.iDstConfig;
-	const TBool mem_src = (src.iFlags & KDmaMemAddr);
-	const TBool mem_dst = (dst.iFlags & KDmaMemAddr);
-
-	const TUint align_mask_src = iChannel.AddressAlignMask(src.iFlags,
-														   src.iElementSize,
-														   aTransferArgs.iPslRequestInfo);
-	__KTRACE_OPT(KDMA, Kern::Printf("align_mask_src: 0x%x", align_mask_src));
-	const TUint align_mask_dst = iChannel.AddressAlignMask(dst.iFlags,
-														   dst.iElementSize,
-														   aTransferArgs.iPslRequestInfo);
-	__KTRACE_OPT(KDMA, Kern::Printf("align_mask_dst: 0x%x", align_mask_dst));
-
-	// Memory buffers must satisfy alignment constraint
-	__DMA_ASSERTD(!mem_src || ((src.iAddr & align_mask_src) == 0));
-	__DMA_ASSERTD(!mem_dst || ((dst.iAddr & align_mask_dst) == 0));
-
-	// Max aligned length is used to make sure the beginnings of subtransfers
-	// (i.e. fragments) are correctly aligned.
-	const TUint max_aligned_len = (aMaxTransferLen &
-								   ~(_Max(align_mask_src, align_mask_dst)));
-	__KTRACE_OPT(KDMA, Kern::Printf("max_aligned_len: %d", max_aligned_len));
-	// Client and PSL sane?
-	__DMA_ASSERTD(max_aligned_len > 0);
-
-	if (mem_src && mem_dst &&
-		align_mask_src && align_mask_dst &&
-		(align_mask_src != align_mask_dst) &&
-		(!(src.iFlags & KDmaMemIsContiguous) || !(dst.iFlags & KDmaMemIsContiguous)))
-		{
-		// We don't support transfers which satisfy ALL of the following conditions:
-		// 1) from memory to memory,
-		// 2) both sides have address alignment requirements,
-		// 3) those alignment requirements are not the same,
-		// 4) the memory is non-contiguous on at least one end.
-		//
-		// [A 5th condition is that the channel doesn't support fully
-		// asymmetric h/w descriptor lists,
-		// i.e. TDmaChannel::DmacCaps::iAsymHwDescriptors is reported as EFalse
-		// or iBalancedAsymSegments as ETrue. Hence this check is done in
-		// FragSym() and FragBalancedAsym() but not in FragAsym().]
-		//
-		// The reason for this is that fragmentation could be impossible. The
-		// memory layout (page break) on the side with the less stringent
-		// alignment requirement can result in a misaligned target address on
-		// the other side.
-		//
-		// Here is an example:
-		//
-		// src.iAddr =  3964 (0x0F7C), non-contiguous,
-		// align_mask_src = 1 (alignment = 2 bytes)
-		// dst.iAddr = 16384 (0x4000), contiguous,
-		// align_mask_dst = 7 (alignment = 8 bytes)
-		// count = max_xfer_len = 135 bytes
-		// => max_aligned_len = 128 bytes
-		//
-		// Now, suppose MaxPhysSize() returns 132 bytes because src has 132
-		// contiguous bytes to the end of its current mem page.
-		// Trying to fragment this leads to:
-		//
-		// frag_1 = 128 bytes: src reads from 3964 (0x0F7C),
-		//                     dst writes to 16384 (0x4000).
-		// (Fragment 1 uses the max_aligned_len instead of 132 bytes because
-		// otherwise the next fragment would start for the destination at
-		// dst.iAddr + 132 = 16516 (0x4084), which is not 8-byte aligned.)
-		//
-		// frag_2 = 4 bytes: src reads from 4092 (0x0FFC),
-		//                   dst writes to 16512 (0x4080).
-		// (Fragment 2 uses just 4 bytes instead of the remaining 7 bytes
-		// because there is a memory page break on the source side after 4 bytes.)
-		//
-		// frag_3 = 3 bytes: src reads from 4096 (0x1000),
-		//                   dst writes to 16516 (0x4084).
-		//
-		// And there's the problem: the start address of frag_3 is going to be
-		// misaligned for the destination side - it's not 8-byte aligned!
-		//
-		__KTRACE_OPT(KPANIC, Kern::Printf("Error: Different alignments for src & dst"
-										  " + non-contiguous target(s)"));
-		return KErrArgument;
-		}
-
-	TInt r;
-	// Revert any previous fragmentation attempt
-	FreeSrcDesList();
-	FreeDstDesList();
-	__DMA_ASSERTD(iSrcDesCount == iDstDesCount);
-	do
-		{
-		// Allocate fragment
-		r = ExpandSrcDesList(/*1*/);
-		if (r != KErrNone)
-			{
-			break;
-			}
-		r = ExpandDstDesList(/*1*/);
-		if (r != KErrNone)
-			{
-			break;
-			}
-		__DMA_ASSERTD(iSrcDesCount == iDstDesCount);
-		// Compute fragment size
-		TUint c = _Min(aMaxTransferLen, aCount);
-		__KTRACE_OPT(KDMA, Kern::Printf("c = _Min(aMaxTransferLen, aCount) = %d", c));
-
-		// SRC
-		if (mem_src && !(src.iFlags & KDmaMemIsContiguous))
-			{
-			c = MaxPhysSize(src.iAddr, c);
-			__KTRACE_OPT(KDMA, Kern::Printf("c = MaxPhysSize(src.iAddr, c) = %d", c));
-			}
-
-		// DST
-		if (mem_dst && !(dst.iFlags & KDmaMemIsContiguous))
-			{
-			c = MaxPhysSize(dst.iAddr, c);
-			__KTRACE_OPT(KDMA, Kern::Printf("c = MaxPhysSize(dst.iAddr, c) = %d", c));
-			}
-
-		// SRC & DST
-		if ((mem_src || mem_dst) && (c < aCount) && (c > max_aligned_len))
-			{
-			// This is not the last fragment of a transfer to/from memory.
-			// We must round down the fragment size so the next one is
-			// correctly aligned.
-			c = max_aligned_len;
-			__KTRACE_OPT(KDMA, Kern::Printf("c = max_aligned_len = %d", c));
-			//
-			// But can this condition actually occur if src and dst are
-			// properly aligned to start with?
-			//
-			// If we disallow unequal alignment requirements in connection with
-			// non-contiguous memory buffers (see the long comment above in
-			// this function for why) and if both target addresses are
-			// correctly aligned at the beginning of the transfer then it
-			// doesn't seem possible to end up with a fragment which is not
-			// quite the total remaining size (c < aCount) but still larger
-			// than the greatest aligned length (c > max_aligned_len).
-			//
-			// That's because address alignment values are always a power of
-			// two (at least that's what we assume - otherwise
-			// AddressAlignMask() doesn't work), and memory page sizes are also
-			// always a power of two and hence a multiple of the alignment
-			// value (as long as the alignment is not greater than the page
-			// size, which seems a reasonable assumption regardless of the
-			// actual page size). So if we start properly aligned anywhere in a
-			// memory page then the number of bytes to the end of that page is
-			// always a multiple of the aligment value - there's no remainder.
-			//
-			// So let's see if we ever hit this assertion:
-			Kern::Printf("Unexpected: (mem_src || mem_dst) && (c < aCount) && (c > max_aligned_len)");
-			__DMA_ASSERTA(EFalse);
-			}
-
-		// If this is not the last fragment...
-		if (c < aCount)
-			{
-			const TUint es_src = src.iElementSize;
-			const TUint es_dst = dst.iElementSize;
-			const TUint fs_src = es_src * src.iElementsPerFrame;
-			const TUint fs_dst = es_dst * dst.iElementsPerFrame;
-			TUint c_prev;
-			do
-				{
-				c_prev = c;
-				// If fs_src is !0 then es_src must be !0 as well (see
-				// CheckTransferConfig).
-				if (es_src)
-					{
-					r = AdjustFragmentSize(c, es_src, fs_src);
-					if (r != KErrNone)
-						{
-						break;							// while (c != c_prev);
-						}
-					}
-				// If fs_dst is !0 then es_dst must be !0 as well (see
-				// CheckTransferConfig).
-				if (es_dst)
-					{
-					r = AdjustFragmentSize(c, es_dst, fs_dst);
-					if (r != KErrNone)
-						{
-						break;							// while (c != c_prev);
-						}
-					}
-				} while (c != c_prev);
-			if (r != KErrNone)
-				{
-				break;									 // while (aCount > 0);
-				}
-			}
-
-		// Set transfer count for the PSL
-		aTransferArgs.iTransferCount = c;
-		__KTRACE_OPT(KDMA, Kern::Printf("this fragm.: %d (0x%x) total remain.: %d (0x%x)",
-										c, c, aCount, aCount));
-		// Initialise SRC fragment
-		r = iChannel.iController->InitSrcHwDes(*iSrcLastHdr, aTransferArgs);
-		if (r != KErrNone)
-			{
-			break;
-			}
-		// Initialise DST fragment
-		r = iChannel.iController->InitDstHwDes(*iDstLastHdr, aTransferArgs);
-		if (r != KErrNone)
-			{
-			break;
-			}
-		// Update for next iteration
-		aCount -= c;
-		if (mem_src)
-			{
-			src.iAddr += c;
-			}
-		if (mem_dst)
-			{
-			dst.iAddr += c;
-			}
-		}
-	while (aCount > 0);
-
-	return r;
-	}
-
-
-EXPORT_C TInt DDmaRequest::Queue()
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::Queue thread %O", &Kern::CurrentThread()));
-	// Not configured? Call Fragment() first!
-	if (iChannel.iDmacCaps->iAsymHwDescriptors)
-		{
-		__DMA_ASSERTD((iSrcDesCount > 0) && (iDstDesCount > 0));
-		}
-	else
-		{
-		__DMA_ASSERTD(iDesCount > 0);
-		}
-	__DMA_ASSERTD(!iQueued);
-
-	// Append request to queue and link new descriptor list to existing one.
-	iChannel.Wait();
-
-	TUint32 req_count = iChannel.iQueuedRequests++;
-	if (iChannel.iCallQueuedRequestFn)
-		{
-		if (req_count == 0)
-			{
-			iChannel.Signal();
-			iChannel.QueuedRequestCountChanged();
-			iChannel.Wait();
-			}
-		}
-
-	TInt r = KErrGeneral;
-	const TBool ch_isr_cb = __e32_atomic_load_acq32(&iChannel.iIsrCbRequest);
-	if (ch_isr_cb)
-		{
-		// Client mustn't try to queue any new request while one with an ISR
-		// callback is already queued on this channel. This is to make sure
-		// that the channel's Transfer() function is not called by both the ISR
-		// and the client thread at the same time.
-		__KTRACE_OPT(KPANIC, Kern::Printf("An ISR cb request exists - not queueing"));
-		// Undo the request count increment...
-		req_count = --iChannel.iQueuedRequests;
-		__DMA_INVARIANT();
-		iChannel.Signal();
-		if (iChannel.iCallQueuedRequestFn)
-			{
-			if (req_count == 0)
-				{
-				iChannel.QueuedRequestCountChanged();
-				}
-			}
-		}
-	else if (iIsrCb && !iChannel.IsQueueEmpty())
-		{
-		// Client mustn't try to queue an ISR callback request whilst any
-		// others are still queued on this channel. This is to make sure that
-		// the ISR callback doesn't get executed together with the DFC(s) of
-		// any previous request(s).
-		__KTRACE_OPT(KPANIC, Kern::Printf("Request queue not empty - not queueing"));
-		// Undo the request count increment...
-		req_count = --iChannel.iQueuedRequests;
-		__DMA_INVARIANT();
-		iChannel.Signal();
-		if (iChannel.iCallQueuedRequestFn)
-			{
-			if (req_count == 0)
-				{
-				iChannel.QueuedRequestCountChanged();
-				}
-			}
-		}
-	else if (iChannel.iIsrDfc & (TUint32)TDmaChannel::KCancelFlagMask)
-		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("Channel requests cancelled - not queueing"));
-		// Someone is cancelling all requests - undo the request count increment...
-		req_count = --iChannel.iQueuedRequests;
-		__DMA_INVARIANT();
-		iChannel.Signal();
-		if (iChannel.iCallQueuedRequestFn)
-			{
-			if (req_count == 0)
-				{
-				iChannel.QueuedRequestCountChanged();
-				}
-			}
-		}
-	else
-		{
-		iQueued = ETrue;
-		iChannel.iReqQ.Add(&iLink);
-		iChannel.SetNullPtr(*this);
-		if (iIsrCb)
-			{
-			// Since we've made sure that there is no other request in the
-			// queue before this, the only thing of relevance is the channel
-			// DFC which might yet have to complete for the previous request,
-			// and this function might indeed have been called from there via
-			// the client callback. This should be all right though as once
-			// we've set the following flag no further Queue()'s will be
-			// possible.
-			__e32_atomic_store_rel32(&iChannel.iIsrCbRequest, ETrue);
-			}
-		iChannel.DoQueue(*this);
-		r = KErrNone;
-		__DMA_INVARIANT();
-		iChannel.Signal();
-		}
-
-	return r;
-	}
-
-
-EXPORT_C TInt DDmaRequest::ExpandDesList(TInt aCount)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::ExpandDesList aCount=%d", aCount));
-	return ExpandDesList(aCount, iDesCount, iFirstHdr, iLastHdr);
-	}
-
-
-EXPORT_C TInt DDmaRequest::ExpandSrcDesList(TInt aCount)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::ExpandSrcDesList"));
-	return ExpandDesList(aCount, iSrcDesCount, iSrcFirstHdr, iSrcLastHdr);
-	}
-
-
-EXPORT_C TInt DDmaRequest::ExpandDstDesList(TInt aCount)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::ExpandDstDesList"));
-	return ExpandDesList(aCount, iDstDesCount, iDstFirstHdr, iDstLastHdr);
-	}
-
-
-TInt DDmaRequest::ExpandDesList(TInt aCount, TInt& aDesCount,
-								SDmaDesHdr*& aFirstHdr,
-								SDmaDesHdr*& aLastHdr)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::ExpandDesList"));
-	__DMA_ASSERTD(!iQueued);
-	__DMA_ASSERTD(aCount > 0);
-
-	if (aCount > iChannel.iAvailDesCount)
-		{
-		return KErrTooBig;
-		}
-
-	iChannel.iAvailDesCount -= aCount;
-	aDesCount += aCount;
-
-	TDmac& c = *(iChannel.iController);
-	c.Wait();
-
-	if (aFirstHdr == NULL)
-		{
-		// Handle an empty list specially to simplify the following loop
-		aFirstHdr = aLastHdr = c.iFreeHdr;
-		c.iFreeHdr = c.iFreeHdr->iNext;
-		--aCount;
-		}
-	else
-		{
-		aLastHdr->iNext = c.iFreeHdr;
-		}
-
-	// Remove as many descriptors and headers from the free pool as necessary
-	// and ensure hardware descriptors are chained together.
-	while (aCount-- > 0)
-		{
-		__DMA_ASSERTD(c.iFreeHdr != NULL);
-		if (c.iCapsHwDes)
-			{
-			c.ChainHwDes(*aLastHdr, *(c.iFreeHdr));
-			}
-		aLastHdr = c.iFreeHdr;
-		c.iFreeHdr = c.iFreeHdr->iNext;
-		}
-
-	c.Signal();
-
-	aLastHdr->iNext = NULL;
-
-	__DMA_INVARIANT();
-	return KErrNone;
-	}
-
-
-EXPORT_C void DDmaRequest::FreeDesList()
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::FreeDesList"));
-	FreeDesList(iDesCount, iFirstHdr, iLastHdr);
-	}
-
-
-EXPORT_C void DDmaRequest::FreeSrcDesList()
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::FreeSrcDesList"));
-	FreeDesList(iSrcDesCount, iSrcFirstHdr, iSrcLastHdr);
-	}
-
-
-EXPORT_C void DDmaRequest::FreeDstDesList()
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::FreeDstDesList"));
-	FreeDesList(iDstDesCount, iDstFirstHdr, iDstLastHdr);
-	}
-
-
-void DDmaRequest::FreeDesList(TInt& aDesCount, SDmaDesHdr*& aFirstHdr, SDmaDesHdr*& aLastHdr)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::FreeDesList count=%d", aDesCount));
-	__DMA_ASSERTD(!iQueued);
-
-	if (aDesCount > 0)
-		{
-		iChannel.iAvailDesCount += aDesCount;
-		TDmac& c = *(iChannel.iController);
-		const SDmaDesHdr* hdr = aFirstHdr;
-		while (hdr)
-			{
-			__DMA_ASSERTD(c.IsValidHdr(hdr));
-
-			// This (potential) PSL call doesn't follow the "overhead
-			// principle", and something should be done about this.
-			c.ClearHwDes(*hdr);
-			hdr = hdr->iNext;
-			};
-
-		c.Wait();
-		__DMA_ASSERTD(c.IsValidHdr(c.iFreeHdr));
-		aLastHdr->iNext = c.iFreeHdr;
-		c.iFreeHdr = aFirstHdr;
-		c.Signal();
-
-		aFirstHdr = aLastHdr = NULL;
-		aDesCount = 0;
-		}
-	}
-
-
-EXPORT_C void DDmaRequest::EnableSrcElementCounting(TBool /*aResetElementCount*/)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::EnableSrcElementCounting"));
-
-	// Not yet implemented.
-	return;
-	}
-
-
-EXPORT_C void DDmaRequest::EnableDstElementCounting(TBool /*aResetElementCount*/)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::EnableDstElementCounting"));
-
-	// Not yet implemented.
-	return;
-	}
-
-
-EXPORT_C void DDmaRequest::DisableSrcElementCounting()
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::DisableSrcElementCounting"));
-
-	// Not yet implemented.
-	return;
-	}
-
-
-EXPORT_C void DDmaRequest::DisableDstElementCounting()
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::DisableDstElementCounting"));
-
-	// Not yet implemented.
-	return;
-	}
-
-
-EXPORT_C TUint32 DDmaRequest::TotalNumSrcElementsTransferred()
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::TotalNumSrcElementsTransferred"));
-
-	// Not yet implemented.
-	return iTotalNumSrcElementsTransferred;
-	}
-
-
-EXPORT_C TUint32 DDmaRequest::TotalNumDstElementsTransferred()
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::TotalNumDstElementsTransferred"));
-
-	// Not yet implemented.
-	return iTotalNumDstElementsTransferred;
-	}
-
-
-EXPORT_C TInt DDmaRequest::FragmentCount()
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::FragmentCount"));
-	return FragmentCount(iFirstHdr);
-	}
-
-
-EXPORT_C TInt DDmaRequest::SrcFragmentCount()
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::SrcFragmentCount"));
-	return FragmentCount(iSrcFirstHdr);
-	}
-
-
-EXPORT_C TInt DDmaRequest::DstFragmentCount()
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::DstFragmentCount"));
-	return FragmentCount(iDstFirstHdr);
-	}
-
-
-TInt DDmaRequest::FragmentCount(const SDmaDesHdr* aHdr)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DDmaRequest::FragmentCount aHdr=0x%08x", aHdr));
-	TInt count = 0;
-	for (const SDmaDesHdr* pH = aHdr; pH != NULL; pH = pH->iNext)
-		{
-		count++;
-		}
-	return count;
-	}
-
-
-//
-// Called when request is removed from request queue in channel
-//
-inline void DDmaRequest::OnDeque()
-	{
-	iQueued = EFalse;
-	if (iChannel.iDmacCaps->iAsymHwDescriptors)
-		{
-		iSrcLastHdr->iNext = NULL;
-		iDstLastHdr->iNext = NULL;
-		iChannel.DoUnlink(*iSrcLastHdr);
-		iChannel.DoUnlink(*iDstLastHdr);
-		}
-	else
-		{
-		iLastHdr->iNext = NULL;
-		iChannel.DoUnlink(*iLastHdr);
-		}
-	}
-
-
-#ifdef _DEBUG
-void DDmaRequest::Invariant()
-	{
-	// This invariant may be called either with,
-	// or without the channel lock already held
-	TBool channelLockAquired=EFalse;
-	if(!iChannel.iLock.HeldByCurrentThread())
-		{
-		iChannel.Wait();
-		channelLockAquired = ETrue;
-		}
-
-	__DMA_ASSERTD(LOGICAL_XOR(iCb, iDmaCb));
-	if (iChannel.iDmacCaps->iAsymHwDescriptors)
-		{
-		__DMA_ASSERTD((0 <= iSrcDesCount) && (iSrcDesCount <= iChannel.iMaxDesCount) &&
-					  (0 <= iDstDesCount) && (iDstDesCount <= iChannel.iMaxDesCount));
-		if (iSrcDesCount == 0)
-			{
-			// Not fragmented yet
-			__DMA_ASSERTD(iDstDesCount == 0);
-			__DMA_ASSERTD(!iQueued);
-			__DMA_ASSERTD(!iSrcFirstHdr && !iSrcLastHdr &&
-						  !iDstFirstHdr && !iDstLastHdr);
-			}
-		else if (iDstDesCount == 0)
-			{
-			// Src side only fragmented yet
-			__DMA_ASSERTD(iChannel.iController->IsValidHdr(iSrcFirstHdr));
-			__DMA_ASSERTD(iChannel.iController->IsValidHdr(iSrcLastHdr));
-			}
-		else
-			{
-			// Src & Dst sides fragmented
-			__DMA_ASSERTD(iChannel.iController->IsValidHdr(iSrcFirstHdr));
-			__DMA_ASSERTD(iChannel.iController->IsValidHdr(iSrcLastHdr));
-			__DMA_ASSERTD(iChannel.iController->IsValidHdr(iDstFirstHdr));
-			__DMA_ASSERTD(iChannel.iController->IsValidHdr(iDstLastHdr));
-			}
-		}
-	else
-		{
-		__DMA_ASSERTD((0 <= iDesCount) && (iDesCount <= iChannel.iMaxDesCount));
-		if (iDesCount == 0)
-			{
-			__DMA_ASSERTD(!iQueued);
-			__DMA_ASSERTD(!iFirstHdr && !iLastHdr);
-			}
-		else
-			{
-			__DMA_ASSERTD(iChannel.iController->IsValidHdr(iFirstHdr));
-			__DMA_ASSERTD(iChannel.iController->IsValidHdr(iLastHdr));
-			}
-		}
-
-	if(channelLockAquired)
-			{
-			iChannel.Signal();
-			}
-	}
-#endif
-
-
-//////////////////////////////////////////////////////////////////////////////
-// TDmaChannel
-
-TDmaChannel::TDmaChannel()
-	: iController(NULL),
-	  iDmacCaps(NULL),
-	  iPslId(0),
-	  iDynChannel(EFalse),
-	  iPriority(KDmaPriorityNone),
-	  iCurHdr(NULL),
-	  iNullPtr(&iCurHdr),
-	  iDfc(Dfc, NULL, 0),
-	  iMaxDesCount(0),
-	  iAvailDesCount(0),
-	  iIsrDfc(0),
-	  iReqQ(),
-	  iReqCount(0),
-	  iQueuedRequests(0),
-	  iCallQueuedRequestFn(ETrue),
-	  iCancelInfo(NULL),
-	  iRedoRequest(EFalse),
-	  iIsrCbRequest(EFalse)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmaChannel::TDmaChannel =0x%08X", this));
-	__DMA_INVARIANT();
-	}
-
-
-//
-// static member function
-//
-EXPORT_C TInt TDmaChannel::Open(const SCreateInfo& aInfo, TDmaChannel*& aChannel)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmaChannel::Open thread %O", &Kern::CurrentThread()));
-
-	if (aInfo.iDesCount < 1)
-		{
-		__KTRACE_OPT(KPANIC, Kern::Printf("DMA channel failed to open: iDescount<1"));
-		return KErrArgument;
-		}
-
-	__DMA_ASSERTD(aInfo.iPriority <= KDmaPriority8);
-	__DMA_ASSERTD(aInfo.iDfcQ != NULL);
-	__DMA_ASSERTD(aInfo.iDfcPriority < KNumDfcPriorities);
-
-	aChannel = NULL;
-
-	DmaChannelMgr::Wait();
-	TDmaChannel* pC = DmaChannelMgr::Open(aInfo.iCookie, aInfo.iDynChannel, aInfo.iPriority);
-	DmaChannelMgr::Signal();
-	if (!pC)
-		{
-		return KErrInUse;
-		}
-	__DMA_ASSERTD(pC->iController != NULL);
-	__DMA_ASSERTD(pC->iDmacCaps != NULL);
-	__DMA_ASSERTD(pC->iController->iCapsHwDes == pC->DmacCaps().iHwDescriptors);
-	// PSL needs to set iDynChannel if and only if dynamic channel was requested
-	__DMA_ASSERTD(!LOGICAL_XOR(aInfo.iDynChannel, pC->iDynChannel));
-
-	const TInt r = pC->iController->ReserveSetOfDes(aInfo.iDesCount);
-	if (r != KErrNone)
-		{
-		pC->Close();
-		return r;
-		}
-	pC->iAvailDesCount = pC->iMaxDesCount = aInfo.iDesCount;
-
-	new (&pC->iDfc) TDfc(&Dfc, pC, aInfo.iDfcQ, aInfo.iDfcPriority);
-
-	aChannel = pC;
-
-#ifdef _DEBUG
-	pC->Invariant();
-#endif
-	__KTRACE_OPT(KDMA, Kern::Printf("opened channel %d", pC->iPslId));
-	return KErrNone;
-	}
-
-
-EXPORT_C void TDmaChannel::Close()
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmaChannel::Close %d iReqCount=%d", iPslId, iReqCount));
-	__DMA_ASSERTD(IsQueueEmpty());
-	__DMA_ASSERTD(iReqCount == 0);
-
-	__DMA_ASSERTD(iQueuedRequests == 0);
-
-	// Descriptor leak? -> bug in request code
-	__DMA_ASSERTD(iAvailDesCount == iMaxDesCount);
-
-	__DMA_ASSERTD(!iRedoRequest);
-	__DMA_ASSERTD(!iIsrCbRequest);
-
-	iController->ReleaseSetOfDes(iMaxDesCount);
-	iAvailDesCount = iMaxDesCount = 0;
-
-	DmaChannelMgr::Wait();
-	DmaChannelMgr::Close(this);
-	// The following assignment will be removed once IsOpened() has been
-	// removed. That's because 'this' shouldn't be touched any more once
-	// Close() has returned from the PSL.
-	iController = NULL;
-	DmaChannelMgr::Signal();
-	}
-
-
-EXPORT_C TInt TDmaChannel::LinkToChannel(TDmaChannel* aChannel)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmaChannel::LinkToChannel thread %O",
-									&Kern::CurrentThread()));
-	if (aChannel)
-		{
-		return iController->LinkChannels(*this, *aChannel);
-		}
-	else
-		{
-		return iController->UnlinkChannel(*this);
-		}
-	}
-
-
-EXPORT_C TInt TDmaChannel::Pause()
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmaChannel::Pause thread %O",
-									&Kern::CurrentThread()));
-	return iController->PauseTransfer(*this);
-	}
-
-
-EXPORT_C TInt TDmaChannel::Resume()
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmaChannel::Resume thread %O",
-									&Kern::CurrentThread()));
-	return iController->ResumeTransfer(*this);
-	}
-
-
-EXPORT_C void TDmaChannel::CancelAll()
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmaChannel::CancelAll thread %O channel - %d",
-									&Kern::CurrentThread(), iPslId));
-	NThread* const nt = NKern::CurrentThread();
-	TBool wait = EFalse;
-	TDmaCancelInfo cancelinfo;
-	TDmaCancelInfo* waiters = NULL;
-
-	NKern::ThreadEnterCS();
-	Wait();
-	const TUint32 req_count_before = iQueuedRequests;
-	NThreadBase* const dfc_nt = iDfc.Thread();
-	// Shouldn't be NULL (i.e. an IDFC)
-	__DMA_ASSERTD(dfc_nt);
-
-	__e32_atomic_store_ord32(&iIsrDfc, (TUint32)KCancelFlagMask);
-	// ISRs after this point will not post a DFC, however a DFC may already be
-	// queued or running or both.
-	if (!IsQueueEmpty())
-		{
-		// There is a transfer in progress. It may complete before the DMAC
-		// has stopped, but the resulting ISR will not post a DFC.
-		// ISR should not happen after this function returns.
-		iController->StopTransfer(*this);
-
-		DoCancelAll();
-		ResetNullPtr();
-
-		// Clean-up the request queue.
-		SDblQueLink* pL;
-		while ((pL = iReqQ.GetFirst()) != NULL)
-			{
-			iQueuedRequests--;
-			DDmaRequest* pR = _LOFF(pL, DDmaRequest, iLink);
-			pR->OnDeque();
-			}
-		}
-	if (dfc_nt == nt)
-		{
-		// DFC runs in this thread, so just cancel it and we're finished
-		iDfc.Cancel();
-
-		// If other calls to CancelAll() are waiting for the DFC, release them here
-		waiters = iCancelInfo;
-		iCancelInfo = NULL;
-
-		// Reset the ISR count
-		__e32_atomic_store_rel32(&iIsrDfc, 0);
-		}
-	else
-		{
-		// DFC runs in another thread. Make sure it's queued and then wait for it to run.
-		if (iCancelInfo)
-			{
-			// Insert cancelinfo into the list so that it precedes iCancelInfo
-			cancelinfo.InsertBefore(iCancelInfo);
-			}
-		else
-			{
-			iCancelInfo = &cancelinfo;
-			}
-		wait = ETrue;
-		iDfc.Enque();
-		}
-
-	const TUint32 req_count_after = iQueuedRequests;
-
-	Signal();
-
-	if (waiters)
-		{
-		waiters->Signal();
-		}
-	else if (wait)
-		{
-		NKern::FSWait(&cancelinfo.iSem);
-		}
-
- 	NKern::ThreadLeaveCS();
-
-	// Only call PSL if there were requests queued when we entered AND there
-	// are now no requests left on the queue.
-	if (iCallQueuedRequestFn)
-		{
-		if ((req_count_before != 0) && (req_count_after == 0))
-			{
-			QueuedRequestCountChanged();
-			}
-		}
-
-	__DMA_INVARIANT();
-	}
-
-
-EXPORT_C TInt TDmaChannel::IsrRedoRequest(TUint32 aSrcAddr, TUint32 aDstAddr,
-										  TUint aTransferCount,
-										  TUint32 aPslRequestInfo,
-										  TBool aIsrCb)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmaChannel::IsrRedoRequest src=0x%08X, "
-									"dst=0x%08X, count=%d, pslInfo=0x%08X, isrCb=%d",
-									aSrcAddr, aDstAddr, aTransferCount, aPslRequestInfo,
-									aIsrCb));
-	// Function needs to be called in ISR context.
-	__DMA_ASSERTD(NKern::CurrentContext() == NKern::EInterrupt);
-
-	__DMA_ASSERTD(!iReqQ.IsEmpty());
-	__DMA_ASSERTD(iIsrCbRequest);
-
-#ifdef _DEBUG
-	if ((aSrcAddr != KPhysAddrInvalid) && (aSrcAddr == aDstAddr))
-		{
-		__KTRACE_OPT(KPANIC,
-					 Kern::Printf("Error: Updating src & dst to same address: 0x%08X",
-								  aSrcAddr));
-		return KErrArgument;
-		}
-#endif
-
-	// We assume here that the just completed request is the first one in the
-	// queue, i.e. that even if there is more than one request in the queue,
-	// their respective last and first (hw) descriptors are *not* linked.
-	// (Although that's what apparently happens in TDmaSgChannel::DoQueue() /
-	// TDmac::AppendHwDes() @@@).
-	DDmaRequest* const pCurReq = _LOFF(iReqQ.First(), DDmaRequest, iLink);
-	TInt r;
-
-	if (iDmacCaps->iAsymHwDescriptors)
-		{
-		// We don't allow multiple-descriptor chains to be updated here.
-		// That we just panic (instead of returning an error), and also only in
-		// the UDEB case (instead of always) is not ideal, but done here in the
-		// interest of performance.
-		__DMA_ASSERTD((pCurReq->iSrcDesCount == 1) && (pCurReq->iDstDesCount == 1));
-
-		// Adjust parameters if necessary (asymmetrical s/g variety)
-		const SDmaDesHdr* const pSrcFirstHdr = pCurReq->iSrcFirstHdr;
-		if ((aSrcAddr != KPhysAddrInvalid) || aTransferCount || aPslRequestInfo)
-			{
-			r = iController->UpdateSrcHwDes(*pSrcFirstHdr, aSrcAddr,
-											aTransferCount, aPslRequestInfo);
-			if (r != KErrNone)
-				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("Src descriptor updating failed in PSL"));
-				return r;
-				}
-			}
-		const SDmaDesHdr* const pDstFirstHdr = pCurReq->iDstFirstHdr;
-		if ((aDstAddr != KPhysAddrInvalid) || aTransferCount || aPslRequestInfo)
-			{
-			r = iController->UpdateDstHwDes(*pDstFirstHdr, aSrcAddr,
-											aTransferCount, aPslRequestInfo);
-			if (r != KErrNone)
-				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("Dst descriptor updating failed in PSL"));
-				return r;
-				}
-			}
-		// Reschedule the request
-		iController->Transfer(*this, *pSrcFirstHdr, *pDstFirstHdr);
-		}
-	else
-		{
-		// We don't allow a multiple-descriptor chain to be updated here.
-		// That we just panic (instead of returning an error), and also only in
-		// the UDEB case (instead of always) is not ideal, but done here in the
-		// interest of performance.
-		__DMA_ASSERTD(pCurReq->iDesCount == 1);
-
-		// Adjust parameters if necessary (symmetrical s/g and non-s/g variety)
-		const SDmaDesHdr* const pFirstHdr = pCurReq->iFirstHdr;
-		if ((aSrcAddr != KPhysAddrInvalid) || (aDstAddr != KPhysAddrInvalid) ||
-			aTransferCount || aPslRequestInfo)
-			{
-			r = iController->UpdateDes(*pFirstHdr, aSrcAddr, aDstAddr,
-									   aTransferCount, aPslRequestInfo);
-			if (r != KErrNone)
-				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("Descriptor updating failed"));
-				return r;
-				}
-			}
-		// Reschedule the request
-		iController->Transfer(*this, *pFirstHdr);
-		}
-
-	if (!aIsrCb)
-		{
-		// Not another ISR callback please
-		pCurReq->iIsrCb = aIsrCb;
-		}
-	iRedoRequest = ETrue;
-
-	return KErrNone;
-	}
-
-
-EXPORT_C TInt TDmaChannel::FailNext(TInt /*aFragmentCount*/)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmaChannel::FailNext"));
-	return iController->FailNext(*this);
-	}
-
-
-EXPORT_C TInt TDmaChannel::MissNextInterrupts(TInt aInterruptCount)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmaChannel::MissNextInterrupts"));
-	return iController->MissNextInterrupts(*this, aInterruptCount);
-	}
-
-
-EXPORT_C TInt TDmaChannel::Extension(TInt aCmd, TAny* aArg)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmaChannel::Extension"));
-	return iController->Extension(*this, aCmd, aArg);
-	}
-
-
-//
-// static member function
-//
-EXPORT_C TInt TDmaChannel::StaticExtension(TInt aCmd, TAny* aArg)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmaChannel::StaticExtension"));
-	return DmaChannelMgr::StaticExtension(aCmd, aArg);
-	}
-
-
-EXPORT_C TUint TDmaChannel::MaxTransferLength(TUint aSrcFlags, TUint aDstFlags,
-											  TUint32 aPslInfo)
-	{
-	return iController->MaxTransferLength(*this, aSrcFlags, aDstFlags, aPslInfo);
-	}
-
-
-EXPORT_C TUint TDmaChannel::AddressAlignMask(TUint aTargetFlags, TUint aElementSize,
-											 TUint32 aPslInfo)
-	{
-	return iController->AddressAlignMask(*this, aTargetFlags, aElementSize, aPslInfo);
-	}
-
-
-EXPORT_C const SDmacCaps& TDmaChannel::DmacCaps()
-	{
-	return *iDmacCaps;
-	}
-
-
-//
-// DFC callback function (static member).
-//
-void TDmaChannel::Dfc(TAny* aArg)
-	{
-	static_cast<TDmaChannel*>(aArg)->DoDfc();
-	}
-
-
-//
-// This is quite a long function, but what can you do...
-//
-void TDmaChannel::DoDfc()
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmaChannel::DoDfc thread %O channel - %d",
-									&Kern::CurrentThread(), iPslId));
-	Wait();
-
-	// Atomically fetch and reset the number of DFCs queued by the ISR and the
-	// error flag. Leave the cancel flag alone for now.
-	const TUint32 w = __e32_atomic_and_ord32(&iIsrDfc, (TUint32)KCancelFlagMask);
-	TUint32 count = w & KDfcCountMask;
-	const TBool error = w & (TUint32)KErrorFlagMask;
-	TBool stop = w & (TUint32)KCancelFlagMask;
-	const TUint32 req_count_before = iQueuedRequests;
-	TUint32 req_count_after = 0;
-
-	__DMA_ASSERTD((count > 0) || stop);
-	__DMA_ASSERTD(!iRedoRequest); // We shouldn't be here if this is true
-
-	while (count && !stop)
-		{
-		--count;
-
-		__DMA_ASSERTA(!iReqQ.IsEmpty());
-
-		// If an error occurred it must have been reported on the last
-		// interrupt since transfers are suspended after an error.
-		DDmaRequest::TResult const res = (count == 0 && error) ?
-			DDmaRequest::EError : DDmaRequest::EOk;
-		DDmaRequest* pCompletedReq = NULL;
-		DDmaRequest* const pCurReq = _LOFF(iReqQ.First(), DDmaRequest, iLink);
-
-		if (res == DDmaRequest::EOk)
-			{
-			// Update state machine, current fragment, completed fragment and
-			// tell the DMAC to transfer the next fragment if necessary.
-			TBool complete;
-			if (iDmacCaps->iAsymHwDescriptors)
-				{
-				SDmaDesHdr* pCompletedSrcHdr = NULL;
-				SDmaDesHdr* pCompletedDstHdr = NULL;
-				DoDfc(*pCurReq, pCompletedSrcHdr, pCompletedDstHdr);
-				// We don't support asymmetrical ISR notifications and request
-				// completions yet, hence we can do the following assert test
-				// here; also 'complete' is determined equally by either the
-				// SRC or DST side.
-				__DMA_ASSERTD(!LOGICAL_XOR((pCompletedSrcHdr == pCurReq->iSrcLastHdr),
-										   (pCompletedDstHdr == pCurReq->iDstLastHdr)));
-				complete = (pCompletedDstHdr == pCurReq->iDstLastHdr);
-				}
-			else
-				{
-				SDmaDesHdr* pCompletedHdr = NULL;
-				DoDfc(*pCurReq, pCompletedHdr);
-				complete = (pCompletedHdr == pCurReq->iLastHdr);
-				}
-			// If just completed last fragment from current request, switch to
-			// next request (if any).
-			if (complete)
-				{
-				pCompletedReq = pCurReq;
-				pCurReq->iLink.Deque();
-				iQueuedRequests--;
-				if (iReqQ.IsEmpty())
-					ResetNullPtr();
-				pCompletedReq->OnDeque();
-				}
-			}
-		else
-			{
-			pCompletedReq = pCurReq;
-			}
-
-		if (pCompletedReq && !pCompletedReq->iIsrCb)
-			{
-			// Don't execute ISR callbacks here (they have already been called)
-			DDmaRequest::TCallback const cb = pCompletedReq->iCb;
-			if (cb)
-				{
-				// Old style callback
-				TAny* const arg = pCompletedReq->iCbArg;
-				Signal();
-				__KTRACE_OPT(KDMA, Kern::Printf("Client CB res=%d", res));
-				(*cb)(res, arg);
-				Wait();
-				}
-			else
-				{
-				// New style callback
-				TDmaCallback const ncb = pCompletedReq->iDmaCb;
-				if (ncb)
-					{
-					TAny* const arg = pCompletedReq->iDmaCbArg;
-					TDmaResult const result = (res == DDmaRequest::EOk) ?
-						EDmaResultOK : EDmaResultError;
-					Signal();
-					__KTRACE_OPT(KDMA, Kern::Printf("Client CB result=%d", result));
-					(*ncb)(EDmaCallbackRequestCompletion, result, arg, NULL);
-					Wait();
-					}
-				}
-			}
-		// Allow another thread in, in case they are trying to cancel
-		if (pCompletedReq || Flash())
-			{
-			stop = __e32_atomic_load_acq32(&iIsrDfc) & (TUint32)KCancelFlagMask;
-			}
-		}
-
-	if (stop)
-		{
-		// If another thread set the cancel flag, it should have
-		// cleaned up the request queue
-		__DMA_ASSERTD(IsQueueEmpty());
-
-		TDmaCancelInfo* const waiters = iCancelInfo;
-		iCancelInfo = NULL;
-
-		// make sure DFC doesn't run again until a new request completes
-		iDfc.Cancel();
-
-		// reset the ISR count - new requests can now be processed
-		__e32_atomic_store_rel32(&iIsrDfc, 0);
-
-		req_count_after = iQueuedRequests;
-		Signal();
-
-		// release threads doing CancelAll()
-		waiters->Signal();
-		}
-	else
-		{
-		req_count_after = iQueuedRequests;
-		Signal();
-		}
-
-	// Only call PSL if there were requests queued when we entered AND there
-	// are now no requests left on the queue (after also having executed all
-	// client callbacks).
-	if (iCallQueuedRequestFn)
-		{
-		if ((req_count_before != 0) && (req_count_after == 0))
-			{
-			QueuedRequestCountChanged();
-			}
-		}
-
-	__DMA_INVARIANT();
-	}
-
-
-void TDmaChannel::DoQueue(const DDmaRequest& /*aReq*/)
-	{
-	// Must be overridden
-	__DMA_UNREACHABLE_DEFAULT();
-	}
-
-
-//
-// Unlink the last item of a LLI chain from the next chain.
-// Default implementation does nothing. This is overridden by scatter-gather
-// channels.
-//
-void TDmaChannel::DoUnlink(SDmaDesHdr& /*aHdr*/)
-	{
-	}
-
-
-void TDmaChannel::DoDfc(const DDmaRequest& /*aCurReq*/, SDmaDesHdr*& /*aCompletedHdr*/)
-	{
-	// To make sure this version of the function isn't called for channels for
-	// which it isn't appropriate (and which therefore don't override it) we
-	// put this check in here.
-	__DMA_UNREACHABLE_DEFAULT();
-	}
-
-
-void TDmaChannel::DoDfc(const DDmaRequest& /*aCurReq*/, SDmaDesHdr*& /*aSrcCompletedHdr*/,
-						SDmaDesHdr*& /*aDstCompletedHdr*/)
-	{
-	// To make sure this version of the function isn't called for channels for
-	// which it isn't appropriate (and which therefore don't override it) we
-	// put this check in here.
-	__DMA_UNREACHABLE_DEFAULT();
-	}
-
-
-void TDmaChannel::SetNullPtr(const DDmaRequest& aReq)
-	{
-	// iNullPtr points to iCurHdr for an empty queue
-	*iNullPtr = aReq.iFirstHdr;
-	iNullPtr = &(aReq.iLastHdr->iNext);
-	}
-
-
-void TDmaChannel::ResetNullPtr()
-	{
-	iCurHdr = NULL;
-	iNullPtr = &iCurHdr;
-	}
-
-
-/** PSL may override */
-void TDmaChannel::QueuedRequestCountChanged()
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmaChannel::QueuedRequestCountChanged(): "
-									"disabling further calls"));
-	Wait();
-	iCallQueuedRequestFn = EFalse;
-	Signal();
-	}
-
-
-#ifdef _DEBUG
-void TDmaChannel::Invariant()
-	{
-	Wait();
-
-	__DMA_ASSERTD(iReqCount >= 0);
-
-	__DMA_ASSERTD(iCurHdr == NULL || iController->IsValidHdr(iCurHdr));
-
-	// should always point to NULL pointer ending fragment queue
-	__DMA_ASSERTD(*iNullPtr == NULL);
-
-	__DMA_ASSERTD((0 <= iAvailDesCount) && (iAvailDesCount <= iMaxDesCount));
-
-	__DMA_ASSERTD(LOGICAL_XOR(iCurHdr, IsQueueEmpty()));
-	if (iCurHdr == NULL)
-		{
-		__DMA_ASSERTD(iNullPtr == &iCurHdr);
-		}
-
-	Signal();
-	}
-#endif
-
-
-//////////////////////////////////////////////////////////////////////////////
-// TDmaSbChannel
-
-void TDmaSbChannel::DoQueue(const DDmaRequest& /*aReq*/)
-	{
-	if (iState != ETransferring)
-		{
-		iController->Transfer(*this, *iCurHdr);
-		iState = ETransferring;
-		}
-	}
-
-
-void TDmaSbChannel::DoCancelAll()
-	{
-	__DMA_ASSERTD(iState == ETransferring);
-	iState = EIdle;
-	}
-
-
-void TDmaSbChannel::DoDfc(const DDmaRequest& /*aCurReq*/, SDmaDesHdr*& aCompletedHdr)
-	{
-	__DMA_ASSERTD(iState == ETransferring);
-	aCompletedHdr = iCurHdr;
-	iCurHdr = iCurHdr->iNext;
-	if (iCurHdr != NULL)
-		{
-		iController->Transfer(*this, *iCurHdr);
-		}
-	else
-		{
-		iState = EIdle;
-		}
-	}
-
-
-//////////////////////////////////////////////////////////////////////////////
-// TDmaDbChannel
-
-void TDmaDbChannel::DoQueue(const DDmaRequest& aReq)
-	{
-	switch (iState)
-		{
-	case EIdle:
-		iController->Transfer(*this, *iCurHdr);
-		if (iCurHdr->iNext)
-			{
-			iController->Transfer(*this, *(iCurHdr->iNext));
-			iState = ETransferring;
-			}
-		else
-			iState = ETransferringLast;
-		break;
-	case ETransferring:
-		// nothing to do
-		break;
-	case ETransferringLast:
-		iController->Transfer(*this, *(aReq.iFirstHdr));
-		iState = ETransferring;
-		break;
-	default:
-		__DMA_CANT_HAPPEN();
-		}
-	}
-
-
-void TDmaDbChannel::DoCancelAll()
-	{
-	iState = EIdle;
-	}
-
-
-void TDmaDbChannel::DoDfc(const DDmaRequest& /*aCurReq*/, SDmaDesHdr*& aCompletedHdr)
-	{
-	aCompletedHdr = iCurHdr;
-	iCurHdr = iCurHdr->iNext;
-	switch (iState)
-		{
-	case ETransferringLast:
-		iState = EIdle;
-		break;
-	case ETransferring:
-		if (iCurHdr->iNext == NULL)
-			iState = ETransferringLast;
-		else
-			iController->Transfer(*this, *(iCurHdr->iNext));
-		break;
-	default:
-		__DMA_CANT_HAPPEN();
-		}
-	}
-
-
-//////////////////////////////////////////////////////////////////////////////
-// TDmaSgChannel
-
-void TDmaSgChannel::DoQueue(const DDmaRequest& aReq)
-	{
-	if (iState == ETransferring)
-		{
-		__DMA_ASSERTD(!aReq.iLink.Alone());
-		DDmaRequest* pReqPrev = _LOFF(aReq.iLink.iPrev, DDmaRequest, iLink);
-		iController->AppendHwDes(*this, *(pReqPrev->iLastHdr), *(aReq.iFirstHdr));
-		}
-	else
-		{
-		iController->Transfer(*this, *(aReq.iFirstHdr));
-		iState = ETransferring;
-		}
-	}
-
-
-void TDmaSgChannel::DoCancelAll()
-	{
-	__DMA_ASSERTD(iState == ETransferring);
-	iState = EIdle;
-	}
-
-
-void TDmaSgChannel::DoUnlink(SDmaDesHdr& aHdr)
-	{
-	iController->UnlinkHwDes(*this, aHdr);
-	}
-
-
-void TDmaSgChannel::DoDfc(const DDmaRequest& aCurReq, SDmaDesHdr*& aCompletedHdr)
-	{
-	__DMA_ASSERTD(iState == ETransferring);
-	aCompletedHdr = aCurReq.iLastHdr;
-	iCurHdr = aCompletedHdr->iNext;
-	iState = (iCurHdr != NULL) ? ETransferring : EIdle;
-	}
-
-
-//////////////////////////////////////////////////////////////////////////////
-// TDmaAsymSgChannel
-
-TDmaAsymSgChannel::TDmaAsymSgChannel()
-	: iSrcCurHdr(NULL),
-	  iSrcNullPtr(&iSrcCurHdr),
-	  iDstCurHdr(NULL),
-	  iDstNullPtr(&iDstCurHdr)
-	{
-	__DMA_INVARIANT();
-	}
-
-
-void TDmaAsymSgChannel::SetNullPtr(const DDmaRequest& aReq)
-	{
-	// i{Src|Dst}NullPtr points to i{Src|Dst}CurHdr for an empty queue
-	*iSrcNullPtr = aReq.iSrcFirstHdr;
-	*iDstNullPtr = aReq.iDstFirstHdr;
-	iSrcNullPtr = &(aReq.iSrcLastHdr->iNext);
-	iDstNullPtr = &(aReq.iDstLastHdr->iNext);
-	}
-
-
-void TDmaAsymSgChannel::ResetNullPtr()
-	{
-	iSrcCurHdr = NULL;
-	iSrcNullPtr = &iSrcCurHdr;
-	iDstCurHdr = NULL;
-	iDstNullPtr = &iDstCurHdr;
-	}
-
-
-void TDmaAsymSgChannel::DoQueue(const DDmaRequest& aReq)
-	{
-	if (iState == ETransferring)
-		{
-		__DMA_ASSERTD(!aReq.iLink.Alone());
-		DDmaRequest* pReqPrev = _LOFF(aReq.iLink.iPrev, DDmaRequest, iLink);
-		iController->AppendHwDes(*this,
-								 *(pReqPrev->iSrcLastHdr), *(aReq.iSrcFirstHdr),
-								 *(pReqPrev->iDstLastHdr), *(aReq.iDstFirstHdr));
-		}
-	else
-		{
-		iController->Transfer(*this, *(aReq.iSrcFirstHdr), *(aReq.iDstFirstHdr));
-		iState = ETransferring;
-		}
-	}
-
-
-void TDmaAsymSgChannel::DoCancelAll()
-	{
-	__DMA_ASSERTD(iState == ETransferring);
-	iState = EIdle;
-	}
-
-
-void TDmaAsymSgChannel::DoUnlink(SDmaDesHdr& aHdr)
-	{
-	iController->UnlinkHwDes(*this, aHdr);
-	}
-
-
-void TDmaAsymSgChannel::DoDfc(const DDmaRequest& aCurReq, SDmaDesHdr*& aSrcCompletedHdr,
-							  SDmaDesHdr*& aDstCompletedHdr)
-	{
-	__DMA_ASSERTD(iState == ETransferring);
-	aSrcCompletedHdr = aCurReq.iSrcLastHdr;
-	iSrcCurHdr = aSrcCompletedHdr->iNext;
-	aDstCompletedHdr = aCurReq.iDstLastHdr;
-	iDstCurHdr = aDstCompletedHdr->iNext;
-	// Must be either both NULL or none of them.
-	__DMA_ASSERTD(!LOGICAL_XOR(iSrcCurHdr, iDstCurHdr));
-	iState = (iSrcCurHdr != NULL) ? ETransferring : EIdle;
-	}
-
-
-#ifdef _DEBUG
-void TDmaAsymSgChannel::Invariant()
-	{
-	Wait();
-
-	__DMA_ASSERTD(iReqCount >= 0);
-
-	__DMA_ASSERTD(iSrcCurHdr == NULL || iController->IsValidHdr(iSrcCurHdr));
-	__DMA_ASSERTD(iDstCurHdr == NULL || iController->IsValidHdr(iDstCurHdr));
-
-	// should always point to NULL pointer ending fragment queue
-	__DMA_ASSERTD(*iSrcNullPtr == NULL);
-	__DMA_ASSERTD(*iDstNullPtr == NULL);
-
-	__DMA_ASSERTD((0 <= iAvailDesCount) && (iAvailDesCount <= iMaxDesCount));
-
-	__DMA_ASSERTD((iSrcCurHdr && iDstCurHdr && !IsQueueEmpty()) ||
-				  (!iSrcCurHdr && !iDstCurHdr && IsQueueEmpty()));
-	if (iSrcCurHdr == NULL)
-		{
-		__DMA_ASSERTD(iSrcNullPtr == &iSrcCurHdr);
-		}
-	if (iDstCurHdr == NULL)
-		{
-		__DMA_ASSERTD(iDstNullPtr == &iDstCurHdr);
-		}
-
-	Signal();
-	}
-#endif
--- a/kernel/eka/drivers/dma/dma2_shared.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,210 +0,0 @@
-// 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"
-// 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:
-// e32/drivers/dma2_shared.cpp
-// DMA Platform Independent Layer (PIL)
-//
-//
-
-#include <drivers/dmadefs.h>
-
-
-//
-// Exported default constructor.
-//
-#ifdef DMA_APIV2
-KEXPORT_C
-#endif
-TDmaTransferConfig::TDmaTransferConfig()
-	: iAddr(0),
-	  iAddrMode(KDmaAddrModeConstant),
-	  iElementSize(0),
-	  iElementsPerFrame(0),
-	  iElementsPerPacket(0),
-	  iFramesPerTransfer(0),
-	  iElementSkip(0),
-	  iFrameSkip(0),
-	  iBurstSize(KDmaBurstSizeAny),
-	  iFlags(0),
-	  iSyncFlags(KDmaSyncAuto),
-	  iPslTargetInfo(0),
-	  iRepeatCount(0),
-	  iDelta(~0u),
-	  iReserved(0)
-	{
-	}
-
-
-//
-// General use version.
-//
-#ifdef DMA_APIV2
-KEXPORT_C
-#endif
-TDmaTransferConfig::TDmaTransferConfig(
-	TUint32 aAddr,
-	TUint aTransferFlags,
-	TDmaAddrMode aAddrMode,
-	TUint aSyncFlags,
-	TDmaBurstSize aBurstSize,
-	TUint aElementSize,
-	TUint aElementsPerPacket,
-	TUint aPslTargetInfo,
-	TInt aRepeatCount
-	)
-	:
-	iAddr(aAddr),
-	iAddrMode(aAddrMode),
-	iElementSize(aElementSize),
-	iElementsPerFrame(0),
-	iElementsPerPacket(aElementsPerPacket),
-	iFramesPerTransfer(0),
-	iElementSkip(0),
-	iFrameSkip(0),
-	iBurstSize(aBurstSize),
-	iFlags(aTransferFlags),
-	iSyncFlags(aSyncFlags),
-	iPslTargetInfo(aPslTargetInfo),
-	iRepeatCount(aRepeatCount),
-	iDelta(~0u),
-	iReserved(0)
-	{
-	}
-
-
-//
-// 1D/2D version.
-//
-#ifdef DMA_APIV2
-KEXPORT_C
-#endif
-TDmaTransferConfig::TDmaTransferConfig(
-	TUint32 aAddr,
-	TUint aElementSize,
-	TUint aElementsPerFrame,
-	TUint aFramesPerTransfer,
-	TInt aElementSkip,
-	TInt aFrameSkip,
-	TUint aTransferFlags,
-	TUint aSyncFlags,
-	TDmaBurstSize aBurstSize,
-	TUint aElementsPerPacket,
-	TUint aPslTargetInfo,
-	TInt aRepeatCount
-	)
-	:
-	iAddr(aAddr),
-	iAddrMode( // deduce transfer mode from skips
-		(aFrameSkip != 0) ? KDmaAddrMode2DIndex :
-		(aElementSkip != 0)? KDmaAddrMode1DIndex :
-		KDmaAddrModePostIncrement),
-	iElementSize(aElementSize),
-	iElementsPerFrame(aElementsPerFrame),
-	iElementsPerPacket(aElementsPerPacket),
-	iFramesPerTransfer(aFramesPerTransfer),
-	iElementSkip(aElementSkip),
-	iFrameSkip(aFrameSkip),
-	iBurstSize(aBurstSize),
-	iFlags(aTransferFlags),
-	iSyncFlags(aSyncFlags),
-	iPslTargetInfo(aPslTargetInfo),
-	iRepeatCount(aRepeatCount),
-	iDelta(~0u),
-	iReserved(0)
-	{
-	}
-
-
-//
-// Exported default constructor.
-//
-#ifdef DMA_APIV2
-KEXPORT_C
-#endif
-TDmaTransferArgs::TDmaTransferArgs()
-	: iTransferCount(0),
-	  iGraphicsOps(KDmaGraphicsOpNone),
-	  iFlags(0),
-	  iChannelPriority(KDmaPriorityNone),
-	  iPslRequestInfo(0),
-	  iChannelCookie(0),
-	  iDelta(~0u),
-	  iReserved1(0),
-	  iReserved2(0)
-	{
-	}
-
-
-//
-// .
-//
-#ifdef DMA_APIV2
-KEXPORT_C
-#endif
-TDmaTransferArgs::TDmaTransferArgs (
-	TUint aSrcAddr,
-	TUint aDstAddr,
-	TUint aCount,
-	TUint aDmaTransferFlags,
-	TUint aDmaSyncFlags,
-	TUint aDmaPILFlags,
-	TDmaAddrMode aMode,
-	TUint aElementSize,
-	TUint aChannelPriority,
-	TDmaBurstSize aBurstSize,
-	TUint aPslRequestInfo,
-	TDmaGraphicsOps aGraphicOp,
-	TUint32 aColour
-	)
-	:
-	iSrcConfig(aSrcAddr, aDmaTransferFlags, aMode, aDmaSyncFlags, aBurstSize, aElementSize),
-	iDstConfig(aDstAddr, aDmaTransferFlags, aMode, aDmaSyncFlags, aBurstSize, aElementSize),
-	iTransferCount(aCount),
-	iGraphicsOps(aGraphicOp),
-	iColour(aColour),
-	iFlags(aDmaPILFlags),
-	iChannelPriority(aChannelPriority),
-	iPslRequestInfo(aPslRequestInfo)
-	{
-	}
-
-
-//
-// .
-//
-#ifdef DMA_APIV2
-KEXPORT_C
-#endif
-TDmaTransferArgs::TDmaTransferArgs(
-	const TDmaTransferConfig& aSrc,
-	const TDmaTransferConfig& aDst,
-	TUint32 aFlags,
-	TUint aChannelPriority,
-	TUint aPslRequestInfo,
-	TDmaGraphicsOps aGraphicOp,
-	TUint32 aColour
-	)
-	: iSrcConfig(aSrc),
-	  iDstConfig(aDst),
-	  iTransferCount(0),
-	  iGraphicsOps(aGraphicOp),
-	  iColour(aColour),
-	  iFlags(aFlags),
-	  iChannelPriority(aChannelPriority),
-	  iPslRequestInfo(aPslRequestInfo),
-	  iChannelCookie(0),
-	  iDelta(~0u),
-	  iReserved1(0),
-	  iReserved2(0)
-	{
-	}
--- a/kernel/eka/drivers/dma/dmapil.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/dma/dmapil.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -13,7 +13,7 @@
 // Description:
 // e32\drivers\dmapil.cpp
 // DMA Platform Independent Layer (PIL)
-//
+// 
 //
 
 #include <drivers/dma.h>
@@ -477,14 +477,11 @@
 	iChannel.Wait();
 
 	TUint32 req_count = iChannel.iQueuedRequests++;
-	if (iChannel.iCallQueuedRequestFn)
+	if (req_count == 0)
 		{
-		if (req_count == 0)
-			{
-			iChannel.Signal();
-			iChannel.QueuedRequestCountChanged();
-			iChannel.Wait();
-			}
+		iChannel.Signal();
+		iChannel.QueuedRequestCountChanged();
+		iChannel.Wait();
 		}
 
 	if (!(iChannel.iIsrDfc & (TUint32)TDmaChannel::KCancelFlagMask))
@@ -503,12 +500,9 @@
 		req_count = --iChannel.iQueuedRequests;
 		__DMA_INVARIANT();
 		iChannel.Signal();
-		if (iChannel.iCallQueuedRequestFn)
+		if (req_count == 0)
 			{
-			if (req_count == 0)
-				{
-				iChannel.QueuedRequestCountChanged();
-				}
+			iChannel.QueuedRequestCountChanged();
 			}
 		}
 	}
@@ -634,7 +628,6 @@
 	  iReqQ(),
 	  iReqCount(0),
 	  iQueuedRequests(0),
-	  iCallQueuedRequestFn(ETrue),
 	  iCancelInfo(NULL)
 	{
 	__DMA_INVARIANT();
@@ -767,12 +760,9 @@
 
 	// Only call PSL if there were requests queued when we entered AND there
 	// are now no requests left on the queue.
-	if (iCallQueuedRequestFn)
+	if ((req_count_before != 0) && (req_count_after == 0))
 		{
-		if ((req_count_before != 0) && (req_count_after == 0))
-			{
-			QueuedRequestCountChanged();
-			}
+		QueuedRequestCountChanged();
 		}
 
 	__DMA_INVARIANT();
@@ -810,7 +800,7 @@
 		// If an error occurred it must have been reported on the last interrupt since transfers are
 		// suspended after an error.
 		DDmaRequest::TResult res = (count==0 && error) ? DDmaRequest::EError : DDmaRequest::EOk;
-		__DMA_ASSERTA(!iReqQ.IsEmpty());
+		__DMA_ASSERTD(!iReqQ.IsEmpty());
 		DDmaRequest* pCompletedReq = NULL;
 		DDmaRequest* pCurReq = _LOFF(iReqQ.First(), DDmaRequest, iLink);
 		DDmaRequest::TCallback cb = 0;
@@ -952,12 +942,9 @@
 	// Only call PSL if there were requests queued when we entered AND there
 	// are now no requests left on the queue (after also having executed all
 	// client callbacks).
-	if (iCallQueuedRequestFn)
+	if ((req_count_before != 0) && (req_count_after == 0))
 		{
-		if ((req_count_before != 0) && (req_count_after == 0))
-			{
-			QueuedRequestCountChanged();
-			}
+		QueuedRequestCountChanged();
 		}
 
 	__DMA_INVARIANT();
@@ -985,11 +972,14 @@
 /** PSL may override */
 void TDmaChannel::QueuedRequestCountChanged()
 	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TDmaChannel::QueuedRequestCountChanged(): "
-									"disabling further calls"));
+#ifdef _DEBUG
 	Wait();
-	iCallQueuedRequestFn = EFalse;
+	__KTRACE_OPT(KDMA,
+				 Kern::Printf("TDmaChannel::QueuedRequestCountChanged() %d",
+							  iQueuedRequests));
+	__DMA_ASSERTA(iQueuedRequests >= 0);
 	Signal();
+#endif
 	}
 
 
--- a/kernel/eka/drivers/eabi/rm_debug_extu.def	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-EXPORTS
-	_Z19CreateLogicalDevicev @ 1 NONAME
-	_ZN5Debug7GetListEPKNS_9TListItemEi @ 2 NONAME
-	_ZTI11DDebugAgent @ 3 NONAME
-	_ZTI12DRMDStepping @ 4 NONAME
-	_ZTI14DBufferManager @ 5 NONAME
-	_ZTI14DTargetProcess @ 6 NONAME
-	_ZTI15DProcessTracker @ 7 NONAME
-	_ZTI16DRM_DebugChannel @ 8 NONAME
-	_ZTI17D_RMD_Breakpoints @ 9 NONAME
-	_ZTI21DRM_DebugEventHandler @ 10 NONAME
-	_ZTI22DRM_DebugDriverFactory @ 11 NONAME
-	_ZTV11DDebugAgent @ 12 NONAME
-	_ZTV12DRMDStepping @ 13 NONAME
-	_ZTV14DBufferManager @ 14 NONAME
-	_ZTV14DTargetProcess @ 15 NONAME
-	_ZTV15DProcessTracker @ 16 NONAME
-	_ZTV16DRM_DebugChannel @ 17 NONAME
-	_ZTV17D_RMD_Breakpoints @ 18 NONAME
-	_ZTV21DRM_DebugEventHandler @ 19 NONAME
-	_ZTV22DRM_DebugDriverFactory @ 20 NONAME
-
--- a/kernel/eka/drivers/hcr/hcr_api.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/hcr/hcr_api.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -34,7 +34,6 @@
 
 // -- FUNCTIONS ---------------------------------------------------------------
 
-
 #ifndef MAKE_DEF_FILE
 namespace HCR 
 {
@@ -374,9 +373,6 @@
 #ifndef MAKE_DEF_FILE
     HCR_FUNC("HCR::GetDataTUint8");
     
-    if(aValue == NULL || aMaxLen == 0)
-        HCR_TRACE_RETURN(KErrArgument);
-    
     TInt err = GetUValueLargeSettingTUint8(aId, ETypeBinData, aMaxLen, aValue, aLen);
     if (err != KErrNone)
         HCR_TRACE_RETURN(err);        
@@ -393,9 +389,6 @@
 #ifndef MAKE_DEF_FILE
     HCR_FUNC("HCR::GetDataTDes8");
     
-    if(aValue.MaxLength()==0)
-        HCR_TRACE_RETURN(KErrArgument);
-    
     TInt err = GetUValueLargeSettingTDes8(aId, ETypeBinData, aValue);
     if (err != KErrNone)
         HCR_TRACE_RETURN(err);  
@@ -413,9 +406,6 @@
 #ifndef MAKE_DEF_FILE
     HCR_FUNC("HCR::GetStringTUint8");
     
-    if(aValue == NULL || aMaxLen == 0)
-            HCR_TRACE_RETURN(KErrArgument);
-    
     TInt err = GetUValueLargeSettingTUint8(aId, ETypeText8, aMaxLen, aValue, aLen);
     if (err != KErrNone)
         HCR_TRACE_RETURN(err);        
@@ -432,9 +422,6 @@
 #ifndef MAKE_DEF_FILE
     HCR_FUNC("HCR::GetStringTUint8");
     
-    if(aValue.MaxLength() == 0)
-            HCR_TRACE_RETURN(KErrArgument);
-        
     TInt err = GetUValueLargeSettingTDes8(aId, ETypeText8, aValue);
     if (err != KErrNone)
         HCR_TRACE_RETURN(err);        
@@ -451,9 +438,6 @@
 #ifndef MAKE_DEF_FILE
     HCR_FUNC("HCR::GetArrayTInt32");
     
-    if(aValue == NULL || aMaxLen == 0)
-                HCR_TRACE_RETURN(KErrArgument);
-        
     TInt err = GetUValueLargeSettingArray(aId, ETypeArrayInt32, aMaxLen, (TUint32*)aValue, aLen);
     if (err != KErrNone)
         HCR_TRACE_RETURN(err);        
@@ -470,9 +454,6 @@
 #ifndef MAKE_DEF_FILE
     HCR_FUNC("HCR::GetArrayTUInt32");
     
-    if(aValue == NULL || aMaxLen == 0)
-                HCR_TRACE_RETURN(KErrArgument);
-    
     TInt err = GetUValueLargeSettingArray(aId, ETypeArrayUInt32, aMaxLen, aValue, aLen);
     if (err != KErrNone)
         HCR_TRACE_RETURN(err);        
@@ -500,21 +481,6 @@
         HCR_TRACE_RETURN(KErrArgument);
     
     TInt err = KErrNone;
-    
-    //Only UDEB, check is the user provided array aIds ordered?    
-#ifdef _DEBUG
-    for(TInt cursor = 0; cursor < aNum - 1; cursor ++)
-        {
-    //Check the element at cursor position and one above 
-    err = CompareSSettingIds(aIds[cursor], aIds[cursor+1]);
-    //if next element is less than previous one then array is not ordered.
-    //Critical error, report to user
-    if(err >= 0)
-        HCR_TRACE_RETURN(KErrArgument);
-        }
-#endif
-
-
 
     //Don't leave while the resources are not fully allocated/deallocated
     NKern::ThreadEnterCS();
--- a/kernel/eka/drivers/hcr/hcr_hai.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/hcr/hcr_hai.h	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -100,7 +100,7 @@
     	/**
         This method returns the address of the override repository that 
         provides override values for the variant. Typically this repository
-        is held in local media and shadowed in RAM by the OS loader. It is
+        is held in NAND flash and shadowed in RAM by the OS loader. It is
         a read-only settings repository. This repository is optional and may 
         be absent in which case 0 should be returned in aAddr.
          
@@ -154,7 +154,7 @@
         };
 
     /** Union type used to hold either the literal value or an offset from the 
-    start of the setting repository to the setting value. Used in file and RAM
+    start if the setting repository to the setting value. Used in file and RAM
     mapped settings.   
     */
     union USettingValueF
@@ -204,7 +204,7 @@
         USettingValueC  iValue;
         };
 
-    /** This structure holds a setting defined in a file or memory within a file
+    /** This structure holds a setting define in a file or memory within a file
     based repository.     
     @see SRepositoryFile
     */
@@ -266,7 +266,7 @@
  
     /** This class is the root object for a file or memory based settings 
     repository. It assumes the repository has a flat contiguous layout and
-    employes offsets to data rather then C++ pointers as in compiled 
+    employees offsets to data rather then C++ pointers as in compiled 
     setting repositories.                 
     All offsets are relative to the address of &iHdr member.
     The last two members are expected to be present in the file/memory as shown
@@ -335,9 +335,7 @@
 
 /**
 Global macro for use in setting the length attribute of a SSettingC 
-instance in the PSL compiled repository static data. Used when the setting is
-a word sized setting and the size field is Not Applicable. Not to be used 
-for large data settings i.e. where size > 4bytes, i.e. type > 0xffff.
+instance in the PSL compiled repository static data.
 
 @see HCR::MVariant
 @see HCR::SRepositoryCompiled
@@ -369,7 +367,7 @@
 /**
 Global macro used as last entry in a PSL compiled repository static data. 
 The main use of this is to avoid the "last entry needs no following comma" issue
-and to aid HCR initial thread testing. 
+and to aid HCR initial thead testing. 
 The Setting (0xffffffff, 0xffffffff) was choosen as it should never appear in
 a real variant as this category UID can not be allocated offically. Testers
 should also be aware of the special use of this setting so as not to use it in
--- a/kernel/eka/drivers/hcr/hcr_pil.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/hcr/hcr_pil.h	Wed Sep 01 12:34:56 2010 +0100
@@ -38,10 +38,6 @@
 #include "hcr_hai.h"
 
 
-// -- INTERNAL/HELPER FUNCTIONS PROTOTYPE --------------------------------------
-TInt CompareSSettingIds(const HCR::TSettingId& a1, const HCR::SSettingId& a2);
-
-
 // -- CLASSES -----------------------------------------------------------------
 
 namespace HCR
--- a/kernel/eka/drivers/iic/iic.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/iic/iic.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -26,10 +26,6 @@
 // Global Controller pointer
 static DIicBusController* TheController = NULL;
 
-#ifdef IIC_SIMULATED_PSL
-DIicBusController*& gTheController = TheController;
-#endif
-
 //
 //		Implementation of generic IicBus API for client interface
 //
@@ -1018,8 +1014,63 @@
 
 #endif
 
+#ifdef IIC_SIMULATED_PSL
+TVersion DIicPdd::VersionRequired()
+	{
+	const TInt KIicMajorVersionNumber=1;
+	const TInt KIicMinorVersionNumber=0;
+	const TInt KIicBuildVersionNumber=KE32BuildVersionNumber;
+	return TVersion(KIicMajorVersionNumber,KIicMinorVersionNumber,KIicBuildVersionNumber);
+	}
+
+/** Factory class constructor */
+DIicPdd::DIicPdd()
+	{
+    iVersion = DIicPdd::VersionRequired();
+	}
+
+DIicPdd::~DIicPdd()
+	{
+	delete TheController;
+	}
+
+TInt DIicPdd::Install()
+    {
+    return(SetName(&KPddName));
+    }
+
+/**  Called by the kernel's device driver framework to create a Physical Channel. */
+TInt DIicPdd::Create(DBase*& /*aChannel*/, TInt /*aUint*/, const TDesC8* /*anInfo*/, const TVersion& /*aVer*/)
+    {
+    return KErrNone;
+    }
+
+/**  Called by the kernel's device driver framework to check if this PDD is suitable for use with a Logical Channel.*/
+TInt DIicPdd::Validate(TInt /*aUnit*/, const TDesC8* /*anInfo*/, const TVersion& aVer)
+    {
+   	if (!Kern::QueryVersionSupported(DIicPdd::VersionRequired(),aVer))
+		return(KErrNotSupported);
+    return KErrNone;
+    }
+
+/** Return the driver capabilities */
+void DIicPdd::GetCaps(TDes8& aDes) const
+    {
+	// Create a capabilities object
+	TCaps caps;
+	caps.iVersion = iVersion;
+	// Zero the buffer
+	TInt maxLen = aDes.MaxLength();
+	aDes.FillZ(maxLen);
+	// Copy cpabilities
+	TInt size=sizeof(caps);
+	if(size>maxLen)
+	   size=maxLen;
+	aDes.Copy((TUint8*)&caps,size);
+    }
+#endif
+
 #ifndef IIC_SIMULATED_PSL
-
 // Client interface entry point
 DECLARE_EXTENSION_WITH_PRIORITY(KExtensionMaximumPriority-1)	// highest priority after Resource Manager
 	{
@@ -1029,6 +1080,26 @@
 	TInt r=TheController->Create();
 	return r;
 	}
+#else
+static DIicPdd* TheIicPdd;
+
+DECLARE_STANDARD_PDD()
+	{
+	TheController = new DIicBusController;
+	if(!TheController)
+		return NULL;
+	TInt r = TheController->Create();
+	if(r == KErrNone)
+		{
+		TheIicPdd = new DIicPdd;
+		if(TheIicPdd)
+			return TheIicPdd;
+		}
+	
+	delete TheController; 
+	return NULL;
+	}
 #endif
 
 
+
--- a/kernel/eka/drivers/iic/iic_channel.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/iic/iic_channel.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -129,9 +129,6 @@
 
 void DIicBusChannelMaster::CompleteRequest(TInt aResult)
 	{
-	// Ensure the timeout timer has been cancelled
-	CancelTimeOut();
-
 	TIicBusTransaction* nextTrans=NextTrans(iCurrentTransaction);
 
 	if((aResult != KErrNone)||(nextTrans == NULL))
@@ -359,13 +356,7 @@
 
 void DIicBusChannelMaster::CancelTimeOut()
 	{
-	// Silently cancel the timer and associated DFC
-	//
-	// NTimer::Cancel returns ETrue if cancelled, EFalse otherwise - which may mean it wasn't active
-	// TDfc::Cancel returns ETrue if actually de-queued, EFalse otherwise - which may mean it wasn't queued
-	//
 	iTimeoutTimer.Cancel();
-	iSlaveTimeoutDfc->Cancel();
 	}
 
 void DIicBusChannelMaster::Complete(TInt aResult, TIicBusTransaction* aTransaction) //Completes a kernel message and receive the next one
@@ -490,7 +481,7 @@
 	r=SetNotificationTrigger(0);			// Attempt to clear notification requests
 	if((r!=KErrNone)&&(r!=KErrTimedOut))	// KErrTimedOut refers to an earlier transaction, and is for information only
 		return r;
-	StopTimer();
+	iTimeoutTimer.Cancel();
 	r=DoRequest(EPowerDown);
 	if(r == KErrNone)
 		{
@@ -897,13 +888,7 @@
 
 void DIicBusChannelSlave::StopTimer()
 	{
-	// Silently cancel the timer and associated DFC
-	//
-	// NTimer::Cancel returns ETrue if cancelled, EFalse otherwise - which may mean it wasn't active
-	// TDfc::Cancel returns ETrue if actually de-queued, EFalse otherwise - which may mean it wasn't queued
-	//
 	iTimeoutTimer.Cancel();
-	iClientTimeoutDfc->Cancel();
 	}
 
 TInt DIicBusChannelSlave::UpdateReqTrig(TInt8& aCbTrigVal, TInt& aCallbackRet)
@@ -916,15 +901,14 @@
 	if(iNotif->iTrigger & EGeneralBusError)
 		{
 		// In the event of a bus error, always cancel the timer and call the Client callback
-		StopTimer();
+		nextSteps |= (EStopTimer | EInvokeCb);
 		iTimerState = EInactive;
-		nextSteps = EInvokeCb;
 		aCallbackRet = KErrGeneral;
 		}
 	else if(iNotif->iTrigger == EAsyncCaptChan)
 		{
 		// For asynchronous channel capture, no timers are involved - just call the Client callback
-		nextSteps = EInvokeCb;
+		nextSteps |= EInvokeCb;
 		aCallbackRet = KErrCompletion;
 		}
 	else if((iNotif->iTrigger & iReqTrig) != 0)
@@ -963,8 +947,7 @@
 				{
 				// All triggers required have occurred, so transition to state EWaitForClient
 				iTimerState = EWaitForClient;
-				StopTimer();
-				nextSteps = (EInvokeCb | EStartTimer);
+				nextSteps |= (EStopTimer | EInvokeCb | EStartTimer);
 				}
 			else
 				{
@@ -1003,7 +986,7 @@
 		TInt nextSteps = UpdateReqTrig(callbackTrig, callbackRet);
 		if(nextSteps & EStopTimer)
 			{
-			__ASSERT_DEBUG(NULL, Kern::Fault(KIicChannelPanic,__LINE__));
+			iTimeoutTimer.Cancel();
 			}
 		if(nextSteps & EInvokeCb)
 			{
--- a/kernel/eka/drivers/locmedia/dmasupport.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/locmedia/dmasupport.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -278,7 +278,7 @@
 	TInt r;
 	do
 		{
-		__KTRACE_DMA(Kern::Printf(">PHYSADDR:SendReceive() iReqLen %d; iLenConsumed %d; fragments %d",iReqLenClient, iLenConsumed, fragments));
+		__KTRACE_DMA(Kern::Printf(">PHYSADDR:SendReceive() iReqLen %d; iLenConsumed %d; fragments %d",iReqLen, iLenConsumed, fragments));
 		OstTraceExt2( TRACE_DMASUPPORT, DDMAHELPER_SENDRECEIVE1, "PHYSADDR:SendReceive() iLenConsumed=%d; fragments=%d", iLenConsumed, fragments);
 		r = RequestStart();
 		if (r != KErrNone)
--- a/kernel/eka/drivers/locmedia/locmedia.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/locmedia/locmedia.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1630,7 +1630,7 @@
 //		    Otherwise the media driver adjust it internally
 		case DMediaPagingDevice::ECodePageInRequest:
 			__KTRACE_OPT(KLOCDPAGING,Kern::Printf("Adjusted Paging read request %lx@%lx",Length(),Pos()));
-			OstTraceDefExt4(OST_TRACE_CATEGORY_RND, TRACE_DEMANDPAGING, TLOCDRVREQUESTCHECKANDADJUSTFORPARTITION5, "Adjusted Paging read request length=%x:%x; position=%x%:%x", (TUint) I64HIGH(Length()), (TUint) I64LOW(Length()),  (TUint) I64HIGH (Pos()), (TUint) I64LOW (Pos()));
+			OstTraceDefExt4(OST_TRACE_CATEGORY_RND, TRACE_DEMANDPAGING, TLOCDRVREQUESTCHECKANDADJUSTFORPARTITION5, "Adjusted Paging read request length=%x:%x; position=%x:%x", (TUint) I64HIGH(Length()), (TUint) I64LOW(Length()),  (TUint) I64HIGH(Pos()), (TUint) I64LOW(Pos()));
 			if (Pos()+Length()>d.iPartitionLen)
 			    {
 				r = KErrArgument;
@@ -2654,7 +2654,7 @@
 		}
 
 	__KTRACE_OPT(KFAIL,Kern::Printf("mdrq %d",m.Id()));
-	__KTRACE_OPT(KLOCDRV,Kern::Printf("DPrimaryMediaBase(%d)::HandleMsg(%08X) state %d req %d",iMediaId,&m,iState,m.Id()));
+	__KTRACE_OPT(KLOCDRV,Kern::Printf("DPrimaryMediaBase(%d)::HandleMsg state %d req %d",iMediaId,iState,m.Id()));
 
 	OstTraceDefExt3( OST_TRACE_CATEGORY_RND, TRACE_REQUEST, DPRIMARYMEDIABASE_HANDLEMSG2, "iMediaId=%d; iState=%d; req Id=%d", iMediaId, iState, m.Id());
 	
@@ -2754,7 +2754,7 @@
 */
 	{
 	OstTraceFunctionEntry1( DPRIMARYMEDIABASE_DOREQUEST_ENTRY, this );
-	__KTRACE_OPT2(KLOCDRV,KLOCDPAGING,Kern::Printf("DPrimaryMediaBase(%d)::DoRequest(%08X) req %d", iMediaId, &m, m.Id()));
+	__KTRACE_OPT2(KLOCDRV,KLOCDPAGING,Kern::Printf("DPrimaryMediaBase::DoRequest %d",m.Id()));
 	TLocDrv* pL=m.Drive();
 	DMedia* media=pL->iMedia;
 	TInt r=KErrNone;
@@ -3138,16 +3138,11 @@
 #ifdef __DEMAND_PAGING__
 			if (DataPagingMedia(this))
 				{
-				__KTRACE_OPT(KLOCDRV,Kern::Printf("DoPartitionInfoComplete() Close Media Driver aborted for data paging media %08X", this));
+				__KTRACE_OPT(KLOCDRV,Kern::Printf("DoPartitionInfoComplete(%d) Close Media Driver aborted for data paging media %08X", this));
 				OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_DEMANDPAGING, DPRIMARYMEDIABASE_DOPARTITIONINFOCOMPLETE2, "Close Media Driver for data paging media 0x%08x", this);
 				}
 			else
 #endif
-			if (iBody->iMediaExtension)
-				{
-				__KTRACE_OPT(KLOCDRV,Kern::Printf("DoPartitionInfoComplete() Close Media Driver aborted for extension media %08X", this));
-				}
-			else
 				{
 				pM->iDriver->Close();
 				pM->iDriver=NULL;
@@ -3304,10 +3299,6 @@
 	{
 	OstTraceFunctionEntry1( DPRIMARYMEDIABASE_COMPLETEREQUEST_ENTRY, this );
 	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_REQUEST, DPRIMARYMEDIABASE_COMPLETEREQUEST1, "TLocDrvRequest Object=0x%x; aResult=%d", (TUint) &aMsg, aResult);
-
-
-	__KTRACE_OPT(KLOCDRV,Kern::Printf("DPrimaryMediaBase(%d)::CompleteRequest(%08x) r %d",iMediaId,&aMsg, aResult));
-
 	aMsg.Complete(aResult,EFalse);
 	OstTraceFunctionExit1( DPRIMARYMEDIABASE_COMPLETEREQUEST_EXIT, this );
 	}
--- a/kernel/eka/drivers/locmedia/traces/OstTraceDefinitions.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/locmedia/traces/OstTraceDefinitions.h	Wed Sep 01 12:34:56 2010 +0100
@@ -17,5 +17,5 @@
 // OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
 // REMOVE BEFORE CHECK-IN TO VERSION CONTROL
 //#define OST_TRACE_COMPILER_IN_USE
-#include <opensystemtrace.h>
+#include <OpenSystemTrace.h>
 #endif
--- a/kernel/eka/drivers/medmmc/bgahsmmcptn.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/medmmc/bgahsmmcptn.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -17,10 +17,9 @@
 
 #include <emmcptn.h>
 #include "bgahsmmcptn.h"
-#include "toc.h"
-//#define __DEBUG_PARTITIONS_
-//#define __DEBUG_CHECK_PARTITION_
-const TInt    KDiskSectorShift          = 9;
+
+const TInt	  KDiskSectorShift		= 9;
+const TUint32 KPIOffsetFromMediaEnd = 1;
 
 class DBB5PartitionInfo : public DEMMCPartitionInfo
 	{
@@ -37,7 +36,6 @@
 	void SetPartitionEntry(TPartitionEntry* aEntry, TUint aFirstSector, TUint aNumSectors);
 
 private:
-	virtual TInt ReadPartition(TUint32 aPtOffset);
 	static void SessionEndCallBack(TAny* aSelf);
 		   void DoSessionEndCallBack();
 	virtual TInt DecodePartitionInfo();
@@ -51,13 +49,10 @@
 	TMMCard*		iCard;
 	TUint8* 		iIntBuf;
 	TUint32 		iPartitionAttributes[KMaxLocalDrives];
-	TBool           iCheckTOC;
-	Toc*            iTocPtr;
 	};
 
 DBB5PartitionInfo::DBB5PartitionInfo()
-  : iSessionEndCallBack(DBB5PartitionInfo::SessionEndCallBack, this),
-    iCheckTOC(EFalse)
+  : iSessionEndCallBack(DBB5PartitionInfo::SessionEndCallBack, this)
 	{
 	}
 
@@ -96,19 +91,13 @@
 	iPartitionInfo = &aInfo;
 	iCallBack = aCallBack;
 
-	// Preferred partition scheme is BB5, which is located in the last block of the media.
-    const TUint32 ptiOffset = (I64LOW(iCard->DeviceSize64() >> KDiskSectorShift)) - KPIOffsetFromMediaEnd;
-	return ReadPartition(ptiOffset);
-	}
-	
-TInt DBB5PartitionInfo::ReadPartition(TUint32 aPtOffset)
-    {
 	// If media driver is persistent (see EMediaDriverPersistent)
 	// the card may have changed since last power down, so reset CID
 	iSession->SetCard(iCard);
 
-	iSession->SetupCIMReadBlock(aPtOffset, iIntBuf);
-	
+	const TUint32 ptiOffset = (I64LOW(iCard->DeviceSize64() >> KDiskSectorShift)) - KPIOffsetFromMediaEnd;
+	iSession->SetupCIMReadBlock(ptiOffset, iIntBuf);
+
 	TInt r = iDriver->InCritical();
 	if (r == KErrNone)
 		r = iSession->Engage();
@@ -128,25 +117,6 @@
 		Info().iFileSystemId = KDriveFileNone;
 		Info().iDriveAtt |= KDriveAttHidden;
 		}
-	else if (aDrive.iPartitionType == KPartitionTypeRofs)
-		{
-		Info().iFileSystemId = KDriveFileSysROFS;
-		Info().iMediaAtt &= ~KMediaAttFormattable;
-		Info().iMediaAtt |= KMediaAttWriteProtected;
-		}
-	else if ((aDrive.iPartitionType == KPartitionTypeROM) ||
-			 (aDrive.iPartitionType == KPartitionTypeEmpty))
-		{
-		Info().iFileSystemId = KDriveFileNone;
-		Info().iMediaAtt &= ~KMediaAttFormattable;
-		Info().iMediaAtt |= KMediaAttWriteProtected;
-		}
-    else if ((aDrive.iPartitionType == KPartitionTypePartitionMagic) || //CPS/PMM
-             (aDrive.iPartitionType == KPartitionTypeSymbianCrashLog))
-        {
-        Info().iFileSystemId = KDriveFileNone;
-        Info().iMediaAtt |= KMediaAttFormattable;
-        }
 	else if ( PartitionIsFAT(aDrive.iPartitionType) || PartitionIsFAT32(aDrive.iPartitionType)	)
 		{		
 		Info().iDriveAtt |= iPartitionAttributes[aDrive.iPartitionNumber];
@@ -170,200 +140,81 @@
 	if (r == KErrNone)
 		r = DecodePartitionInfo();
 
-	if (!iCheckTOC)
-	    {        
-	    iDriver->PartitionInfoComplete(r == KErrNone ? r : KErrNotReady);
-	    }
+	iDriver->PartitionInfoComplete(r == KErrNone ? r : KErrNotReady);
 	}
 
 TInt DBB5PartitionInfo::DecodePartitionInfo()
 //
-// Decode partition info that was read into internal buffer
+// decode partition info that was read into internal buffer
 //
 	{
 	__KTRACE_OPT(KPBUSDRV, Kern::Printf(">Mmc:PartitionInfo()"));
 	TUint partitionCount = iPartitionInfo->iPartitionCount = 0;
 
-	
-	if (iCheckTOC)
-	    {
-        // Try utilising the TOC (Table Of Contents) partitioning scheme 
-        const TText8* KRofsNames[KNoOfROFSPartitions] = { KTocRofs1Generic,
-                                                          KTocRofs2Generic,
-                                                          KTocRofs3Generic,
-                                                          KTocRofs4Generic,
-                                                          KTocRofs5Generic,                                                            
-                                                          KTocRofs6Generic,                                                            
-                                                          };
-                                        
-        STocItem item;
-        iTocPtr = reinterpret_cast<Toc*>(&iIntBuf[0]);
-        iTocPtr->iTocStartSector = KTocStartSector;
-        TInt r = KErrNone;
+	// For internal devices it is only valid to report up to 1 SWAP partition
+	TBool foundSwap = EFalse;
 
-// USER Drive - Only 1        
-        r = iTocPtr->GetItemByName(KTocUserName, item); 
-        if (KErrNone == r)
-            {
-            __KTRACE_OPT(KPBUSDRV, Kern::Printf("[MD  :   ] (%11s) in TOC found : Start addr = 0x%X  Size = 0x%X", item.iFileName, item.iStart, item.iSize));
-            iPartitionInfo->iEntry[partitionCount].iPartitionType     = KPartitionTypeFAT16;           
-            iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr = (Int64)item.iStart;                         
-            iPartitionInfo->iEntry[partitionCount].iPartitionLen      = (Int64)item.iSize;
-            iPartitionAttributes[partitionCount] = 0; // No Additional Attributes required.           
-            partitionCount++;
-            }   
-        
-// ROM Drive        
-        r = iTocPtr->GetItemByName(KTocRomGeneric, item); 
-        if (KErrNone == r)
-            {
-            __KTRACE_OPT(KPBUSDRV, Kern::Printf("[MD  :   ] (%11s) in TOC found : Start addr = 0x%x  Size = 0x%x", item.iFileName, item.iStart, item.iSize));
-            iPartitionInfo->iEntry[partitionCount].iPartitionType     = KPartitionTypeROM;           
-            iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr = (Int64) item.iStart + (KBB5HeaderSizeInSectors << KDiskSectorShift);                         
-            iPartitionInfo->iEntry[partitionCount].iPartitionLen      = (Int64) item.iSize - (KBB5HeaderSizeInSectors << KDiskSectorShift);          
-            partitionCount++;
-            }
-        
-// ROFS            
-        for (TUint i = 0; i < KNoOfROFSPartitions; i++)
-            {
-            /* Search ROFSn item */            
-            r = iTocPtr->GetItemByName(KRofsNames[i], item);
-            if (r == KErrNone)
-                {
-                __KTRACE_OPT(KPBUSDRV, Kern::Printf("[MD  :   ] (%11s) in TOC found : Start addr = 0x%X  Size = 0x%X", item.iFileName, item.iStart, item.iSize));
-                iPartitionInfo->iEntry[partitionCount].iPartitionType     = KPartitionTypeRofs;           
-                iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr = (Int64) item.iStart + (KBB5HeaderSizeInSectors << KDiskSectorShift);                         
-                iPartitionInfo->iEntry[partitionCount].iPartitionLen      = (Int64) item.iSize - (KBB5HeaderSizeInSectors << KDiskSectorShift);
-                partitionCount++;
-                }
-            }         
+	BGAHSMMCPTN_PI_STR *partitionTable = (BGAHSMMCPTN_PI_STR*)(&iIntBuf[0]);
 
-// CPS Drive - Only 1        
-        r = iTocPtr->GetItemByName(KTocCps, item); 
-        if (KErrNone == r)
-            {
-            __KTRACE_OPT(KPBUSDRV, Kern::Printf("[MD  :   ] (%11s) in TOC found : Start addr = 0x%X  Size = 0x%X", item.iFileName, item.iStart, item.iSize));
-            iPartitionInfo->iEntry[partitionCount].iPartitionType     = KPartitionTypePartitionMagic;           
-            iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr = (Int64) item.iStart;                         
-            iPartitionInfo->iEntry[partitionCount].iPartitionLen      = (Int64) item.iSize;
-            partitionCount++;
-            }
-        
-// CRASH Drive - Only 1        
-        r = iTocPtr->GetItemByName(KTocCrashLog, item); 
-        if (KErrNone == r)
-            {
-            __KTRACE_OPT(KPBUSDRV, Kern::Printf("[MD  :   ] (%11s) in TOC found : Start addr = 0x%X  Size = 0x%X", item.iFileName, item.iStart, item.iSize));
-            iPartitionInfo->iEntry[partitionCount].iPartitionType     = KPartitionTypeSymbianCrashLog;           
-            iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr = (Int64) item.iStart;                         
-            iPartitionInfo->iEntry[partitionCount].iPartitionLen      = (Int64) item.iSize;
-            partitionCount++;
-            }
-        
-// SWAP Partition - Only 1        
-        r = iTocPtr->GetItemByName(KTocSwap, item); 
-        if (KErrNone == r)
-            {
-            __KTRACE_OPT(KPBUSDRV, Kern::Printf("[MD  :   ] (%11s) in TOC found : Start addr = 0x%X  Size = 0x%X", item.iFileName, item.iStart, item.iSize));
-            iPartitionInfo->iEntry[partitionCount].iPartitionType     = KPartitionTypePagedData;           
-            iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr = (Int64) item.iStart;                         
-            iPartitionInfo->iEntry[partitionCount].iPartitionLen      = (Int64) item.iSize;
-            partitionCount++;
-            }                
-
-#ifdef __DEBUG_PARTITIONS_
-        for (TInt i = 0; i<partitionCount; i++)
-            {
-            Kern::Printf("iPartitionType....: %d", iPartitionInfo->iEntry[i].iPartitionType);                
-            Kern::Printf("iPartitionBaseAddr: 0x%lx (sectors: %d)", iPartitionInfo->iEntry[i].iPartitionBaseAddr, (TUint32)(iPartitionInfo->iEntry[i].iPartitionBaseAddr >> KDiskSectorShift));                
-            Kern::Printf("iPartitionLen.....: 0x%lx (sectors: %d)", iPartitionInfo->iEntry[i].iPartitionLen, iPartitionInfo->iEntry[i].iPartitionLen >> KDiskSectorShift);
-            Kern::Printf("iPartitionAttribs.: 0x%x", iPartitionAttributes[i]);
-            Kern::Printf(" ");
-            }
-#endif //__DEBUG_PARTITIONS_
-        
-        iCheckTOC = EFalse;
-	    }
-	else
-	    {
-        // Try utilising the BB5 partitioning scheme	
-        BGAHSMMCPTN_PI_STR *partitionTable = (BGAHSMMCPTN_PI_STR*)(&iIntBuf[0]);
+	// Verify that this is the Nokia partition table
+	if( memcompare( (TUint8*)&(partitionTable->iId[0]), sizeof(BGAHSMMCPTN_PI_ID), (TUint8*)BGAHSMMCPTN_PI_ID, sizeof(BGAHSMMCPTN_PI_ID)) == 0 )
+		{
+		__KTRACE_OPT(KPBUSDRV, Kern::Printf("Nokia partition structure found"));
+		__KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionTable->id..............: %s", partitionTable->iId ));
+		__KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionTable->sector_size.....: %d = 0x%x", partitionTable->iSector_size, partitionTable->iSector_size));
+		__KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionTable->major_ver.......: %d", partitionTable->iMajor_ver));
+		__KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionTable->minor_ver.......: %d", partitionTable->iMinor_ver));
+		__KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionTable->partition_amount: %d", partitionTable->iPartition_amount));
+		
+		
+		TUint8 PartitionType = 0;		
+		// Check Supported Version is present
+		if (partitionTable->iMajor_ver <= BGAHSMMCPTN_PI_VER_MAJOR)
+		    {
+            for( TUint8 index = 0; (index < partitionTable->iPartition_amount) && (index < BGAHSMMCPTN_LAST_DRIVE); index++ )
+                {
+                if (partitionTable->iMinor_ver >= BGAHSMMCPTN_PART_TYPE_SUPP_VER_MINOR)
+                    PartitionType = partitionTable->iPartitions[index].iPartition_type;
+                else                    
+                    PartitionType = partitionTable->iPartitions[index].iPartition_id;
+            
+                if( (partitionTable->iPartitions[index].iSize > 0) &&
+                    ( PartitionIsFAT(PartitionType) ||
+                      PartitionIsFAT32(PartitionType) ||
+                     (KPartitionTypePagedData == PartitionType && !foundSwap) ) )
+                    {                   
+                    iPartitionInfo->iEntry[partitionCount].iPartitionType	  = PartitionType;                    
+                    iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr = (Int64) partitionTable->iPartitions[index].iStart_sector << KDiskSectorShift;
+                    iPartitionInfo->iEntry[partitionCount].iPartitionLen	  = (Int64) partitionTable->iPartitions[index].iSize << KDiskSectorShift;
+                    iPartitionAttributes[partitionCount]					  = partitionTable->iPartitions[index].iPartition_attributes;
     
-        // Verify that this is the Nokia partition table
-        if( memcompare( (TUint8*)&(partitionTable->iId[0]), sizeof(BGAHSMMCPTN_PI_ID), (TUint8*)BGAHSMMCPTN_PI_ID, sizeof(BGAHSMMCPTN_PI_ID)) == 0 )
-            {
-			__KTRACE_OPT(KPBUSDRV, Kern::Printf("Nokia partition structure found"));
-			__KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionTable->id..............: %s", partitionTable->iId ));
-			__KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionTable->sector_size.....: %d = 0x%x", partitionTable->iSector_size, partitionTable->iSector_size));
-			__KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionTable->major_ver.......: %d", partitionTable->iMajor_ver));
-			__KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionTable->minor_ver.......: %d", partitionTable->iMinor_ver));
-			__KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionTable->partition_amount: %d", partitionTable->iPartition_amount));
-            
-            TUint8 partitionType = 0;		
-            // Check Supported Version is present
-            if (partitionTable->iMajor_ver <= BGAHSMMCPTN_PI_VER_MAJOR)
-                {
-                for( TUint8 index = 0; (index < partitionTable->iPartition_amount) && (index < BGAHSMMCPTN_LAST_DRIVE); index++ )
-                    {
-                    if (partitionTable->iMinor_ver >= BGAHSMMCPTN_PART_TYPE_SUPP_VER_MINOR)
-                        partitionType = partitionTable->iPartitions[index].iPartition_type;
-                    else                    
-                        partitionType = partitionTable->iPartitions[index].iPartition_id;
-                
-                    // FAT/PMM/CPS/SWAP/CORE/ROFS/CRASH
-                    if( (partitionTable->iPartitions[index].iSize > 0) &&
-                        ( PartitionIsFAT(partitionType) ||
-                          PartitionIsFAT32(partitionType) ||
-                         (KPartitionTypeSymbianCrashLog == partitionType) ||
-                         (KPartitionTypePartitionMagic == partitionType) || //CPS/PMM
-                         (KPartitionTypeRofs == partitionType) || 
-                         (KPartitionTypeEmpty == partitionType) ||
-                         (KPartitionTypeROM == partitionType) ||
-                         (KPartitionTypePagedData == partitionType) ) )
-                        {                   
-                        iPartitionInfo->iEntry[partitionCount].iPartitionType	  = partitionType;
-                        iPartitionAttributes[partitionCount]                      = partitionTable->iPartitions[index].iPartition_attributes;
-                        
-                        // ROM/ROFS partitions have a BB5 checksum header that must be offset for the Symbian OS.
-                        const TUint32 KstartOffset = ((KPartitionTypeROM == partitionType) || (KPartitionTypeRofs == partitionType) || (KPartitionTypeEmpty == partitionType)) ? KBB5HeaderSizeInSectors : 0;
-                        
-                        iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr = (Int64) ((partitionTable->iPartitions[index].iStart_sector + KstartOffset) << KDiskSectorShift);
-                        iPartitionInfo->iEntry[partitionCount].iPartitionLen      = (Int64) ((partitionTable->iPartitions[index].iSize - KstartOffset) << KDiskSectorShift);
-        
-                    	__KTRACE_OPT(KPBUSDRV, Kern::Printf("Registering partition #%d:", partitionCount));
-                    	__KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionCount....: %d", partitionCount));
-                    	__KTRACE_OPT(KPBUSDRV, Kern::Printf("startSector.......: 0x%x", partitionTable->iPartitions[index].iStart_sector ));
-                    	__KTRACE_OPT(KPBUSDRV, Kern::Printf("iPartitionBaseAddr: 0x%lx (sectors: %d)", iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr, (TUint32)(iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr >> KDiskSectorShift)));
-                    	__KTRACE_OPT(KPBUSDRV, Kern::Printf("size..............: 0x%lx", partitionTable->iPartitions[index].iSize ));
-                    	__KTRACE_OPT(KPBUSDRV, Kern::Printf("iPartitionLen.....: 0x%lx (sectors: %d)", iPartitionInfo->iEntry[partitionCount].iPartitionLen, iPartitionInfo->iEntry[partitionCount].iPartitionLen >> KDiskSectorShift));
-                    	__KTRACE_OPT(KPBUSDRV, Kern::Printf("iPartitionType....: %d", iPartitionInfo->iEntry[partitionCount].iPartitionType));
-                    	__KTRACE_OPT(KPBUSDRV, Kern::Printf("iPartitionAttribs.: 0x%x", iPartitionAttributes[partitionCount]));
-                    	__KTRACE_OPT(KPBUSDRV, Kern::Printf(" "));
-        
-                        partitionCount++;
+                    __KTRACE_OPT(KPBUSDRV, Kern::Printf("Registering partition #%d:", partitionCount));
+                    __KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionCount....: %d", partitionCount));
+                    __KTRACE_OPT(KPBUSDRV, Kern::Printf("startSector.......: 0x%x", partitionTable->iPartitions[index].iStart_sector ));
+                    __KTRACE_OPT(KPBUSDRV, Kern::Printf("iPartitionBaseAddr: 0x%lx (sectors: %d)", iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr, (TUint32)(iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr >> KDiskSectorShift)));
+                    __KTRACE_OPT(KPBUSDRV, Kern::Printf("size..............: 0x%lx", partitionTable->iPartitions[index].iSize ));
+                    __KTRACE_OPT(KPBUSDRV, Kern::Printf("iPartitionLen.....: 0x%lx (sectors: %d)", iPartitionInfo->iEntry[partitionCount].iPartitionLen, iPartitionInfo->iEntry[partitionCount].iPartitionLen >> KDiskSectorShift));
+                    __KTRACE_OPT(KPBUSDRV, Kern::Printf("iPartitionType....: %d", iPartitionInfo->iEntry[partitionCount].iPartitionType));
+                    __KTRACE_OPT(KPBUSDRV, Kern::Printf("iPartitionAttribs.: 0x%x", iPartitionAttributes[partitionCount]));
+                    __KTRACE_OPT(KPBUSDRV, Kern::Printf(" "));
+    
+                    if(KPartitionTypePagedData == PartitionType)
+                        {
+                        foundSwap = ETrue;
                         }
+    
+                    partitionCount++;
                     }
-                } 
-            }
-        else
-            {
-            __KTRACE_OPT(KPBUSDRV, Kern::Printf("BGAHSMMC signature not found - try TOC layout"));
-            iCheckTOC = ETrue;
-            
-            TInt r = ReadPartition(KTocStartSector);
-            return r;
-            }
-	    }
-	
-	
+                }
+            } 
+		} 
+
 	// Validate partition address boundaries
 	if(partitionCount == 0)
 		{
 		__KTRACE_OPT(KPBUSDRV, Kern::Printf("Mmc: No supported partitions found!"));
 		return KErrCorrupt;
 		}
-#ifdef __DEBUG_CHECK_PARTITION_	
 	else
 		{
 		// at least one entry for a supported partition found
@@ -391,7 +242,6 @@
 				}
 			}
 		}
-#endif // _DEBUG_CHECK_PARTITION_
 
 	iPartitionInfo->iPartitionCount = partitionCount;
 	iPartitionInfo->iMediaSizeInBytes = iCard->DeviceSize64();
--- a/kernel/eka/drivers/medmmc/bgahsmmcptn.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/medmmc/bgahsmmcptn.h	Wed Sep 01 12:34:56 2010 +0100
@@ -33,7 +33,7 @@
 /* Partition type field supported from version 1.1 onwards */
 #define BGAHSMMCPTN_PART_TYPE_SUPP_VER_MINOR    1
 
-#define BGAHSMMCPTN_LAST_DRIVE		16 /* MMC1_DRIVECOUNT - defined in variantmediadef.h */
+#define BGAHSMMCPTN_LAST_DRIVE		7 /* MMC1_DRIVECOUNT - defined in variantmediadef.h */
 
 typedef struct
 {
@@ -62,7 +62,4 @@
 
 #define BGAHSMMCPTN_PI_STR_SIZE sizeof( BGAHSMMCPTN_PI_STR )
 
-const TUint32 KBB5HeaderSizeInSectors   = 8;
-const TUint32 KPIOffsetFromMediaEnd     = 1;
-
 #endif /*BGAHSMMCPTN_H*/
--- a/kernel/eka/drivers/medmmc/bgahsmmcptn.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/medmmc/bgahsmmcptn.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -22,7 +22,6 @@
 systeminclude	../../include/drivers
 
 source			bgahsmmcptn.cpp
-source			toc.cpp
 
 library			epbusmmc.lib
 library			elocd.lib
--- a/kernel/eka/drivers/medmmc/medmmc.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/medmmc/medmmc.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1132,8 +1132,8 @@
 		iPhysStart = aStart & ~iBlkMsk;
 
 		// formats are always block-aligned, and the buffer is initialized to 0xff
-		//  Check whether erase commands are supported by this card		
-		if ( (iCard->CSD().CCC() & KMMCCmdClassErase) && iEraseInfo.iEraseFlags) 		       
+		//  Check whether erase commands are supported by this card
+		if (iCard->CSD().CCC() & KMMCCmdClassErase)
 			{
 			// Determine the erase end point for the next command. We don't erase past the preferred erase unit
 			// size. Therefore, check which is lower, the preferred erase unit size or the end of the requested range.
@@ -2726,9 +2726,6 @@
 	iMedReq = aRequest;
 	SetCurrentConsumption(aCurrent);
 
-	// Reset the card pointer just in case the stack has changed it.
-	iSession->SetCard(iCard);
-
 	TInt r = InCritical();
 	if (r == KErrNone)
 		{
--- a/kernel/eka/drivers/medmmc/toc.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-// 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:
-// TOC Partition Management for Embedded MMC devices
-// 
-//
-
-#include "toc.h"
-
-
-/*
- * Search entry in TOC with aName as part of ItemName.
- */
-TInt Toc::GetItemByName(const TText8* aName, STocItem& aItem)
-    {
-    if ( aName == NULL )
-        {
-        return KErrNotFound;
-        }
-    
-	// calculate length for name to be searched
-    TUint nameLen = 0;
-    for (; nameLen < KMaxItemNameLen && aName[nameLen] != 0; nameLen++) {};
-        
-	if ( !nameLen ) 
-	    return KErrGeneral; // zero length or Blank Name
-
-	// check all items in TOC	 
-	for (TUint i=0; i < KMaxNbrOfTocItems && iTOC[i].iStart != KEndOfToc; i++)
-		{	
-		// calculate length of current item 
-        TUint fileNameLen = 0;
-		for (; fileNameLen < KMaxItemNameLen && iTOC[i].iFileName[fileNameLen] != 0; fileNameLen++) {};
-		    
-		if ( fileNameLen < nameLen ) 
-		    continue;  // file name too short
-	
-		// compare Item with aName
-		for (TUint k = 0; k <= (fileNameLen - nameLen); k++ )				
-			{
-            TUint l=0;
-            for (; l < nameLen; l++ )
-                {
-                if ( aName[l] != iTOC[i].iFileName[k+l] ) 
-                    break;
-                }
-
-            if ( l == nameLen )
-                {
-                // item found
-                aItem = iTOC[i];
-                aItem.iStart += (iTocStartSector << KSectorShift);
-                return KErrNone;
-                }
-			}		
-		}
-	
-	return KErrNotFound;
-    }
-
-//  End of File
--- a/kernel/eka/drivers/medmmc/toc.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-// 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:
-// TOC Partition Management for Embedded MMC devices
-// 
-//
-
-
-#ifndef __EMMC_TOC_H__
-#define __EMMC_TOC_H__
-
-#include <emmcptn.h>
-
-// TOC item
-const TUint  KMaxItemNameLen = 12;
-
-struct STocItem
-    {
-    TUint32 iStart;
-    TUint32 iSize;
-    TUint32 iFlags;
-    TUint32 iAlign;
-    TUint32 iLoadAddress;
-    TText8  iFileName[KMaxItemNameLen];
-	};
-
-//- Constants ---------------------------------------------------------------
-
-const TUint32 KTocStartSector       = 1280; // TOC starts from 0xA0000 / 0x200
-
-const TText8  KTocRofsName[]        = "SOS-ROFS";
-const TText8  KTocRofsName1[]       = "SOS+ROFS"; 
-const TText8  KTocRofsExtName[]     = "SOS-ROFX";
-const TText8  KTocRofsGeneric[]     = "ROFS";  
-const TText8  KTocRomGeneric[]      = "SOS+CORE";  
-
-const TText8  KTocCps[]             = "SOS-CPS";
-const TText8  KTocRofsExtGeneric[]  = "ROFX";    
-const TText8  KTocSwap[]            = "SOS-SWAP";
-const TText8  KTocUserName[]        = "SOS-USER";
-const TText8  KTocCrashLog[]        = "SOS-CRASH";
-const TText8  KTocToc[]             = "TOC";
-const TText8  KTocSosToc[]          = "SOS-TOC";
-
-const TUint8  KMaxNbrOfTocItems     = 16;
-const TUint8  KXMaxNbrOfTocItems    = 16;
-const TUint32 KEndOfToc             = 0xFFFFFFFFUL;
-
-const TText8  KTocRofs1Generic[]    = "ROFS1";
-const TText8  KTocRofs2Generic[]    = "ROFS2";
-const TText8  KTocRofs3Generic[]    = "ROFS3"; 
-const TText8  KTocRofs4Generic[]    = "ROFS4";
-const TText8  KTocRofs5Generic[]    = "ROFS5";
-const TText8  KTocRofs6Generic[]    = "ROFS6";
-const TUint   KNoOfROFSPartitions   = 6;
-
-const TInt    KSectorShift          = 9;
-/**
-TOC access for kernel side clients.
-*/
-class Toc
-    {
-    public:
-        /**
-         *  Search entry in TOC with aName as part of ItemName.
-         *  @return KErrNone if successful 
-         */
-        TInt GetItemByName(const TText8* aName, STocItem& aItem);
-		
-	public:
-		/**	Array for keep whole TOC */
-		STocItem iTOC[KMaxNbrOfTocItems];
-				
-		/** Offset of TOC from beginning*/
-		TUint32  iTocStartSector;
-    };
-
-#endif // __EMMC_TOC_H__
-
--- a/kernel/eka/drivers/medmmc/traces/OstTraceDefinitions.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/medmmc/traces/OstTraceDefinitions.h	Wed Sep 01 12:34:56 2010 +0100
@@ -17,5 +17,5 @@
 // OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
 // REMOVE BEFORE CHECK-IN TO VERSION CONTROL
 //#define OST_TRACE_COMPILER_IN_USE
-#include <opensystemtrace.h>
+#include <OpenSystemTrace.h>
 #endif
--- a/kernel/eka/drivers/pbus/mmc/sdcard/bmarm/sdcard3c/epbusmu.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/bmarm/sdcard3c/epbusmu.def	Wed Sep 01 12:34:56 2010 +0100
@@ -106,7 +106,7 @@
 	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)
-	GetInterface__8DSDStackQ29DMMCStack12TInterfaceIdRPQ29DMMCStack10MInterface @ 108  NONAME R3UNUSED ; DSDStack::GetInterface(DMMCStack::TInterfaceId, DMMCStack::MInterface *&)
+	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)
--- a/kernel/eka/drivers/pbus/mmc/sdcard/bmarm/sdcard3c/sdio/epbusmu.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/bmarm/sdcard3c/sdio/epbusmu.def	Wed Sep 01 12:34:56 2010 +0100
@@ -106,7 +106,7 @@
 	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)
-	GetInterface__8DSDStackQ29DMMCStack12TInterfaceIdRPQ29DMMCStack10MInterface @ 108  NONAME R3UNUSED ; DSDStack::GetInterface(DMMCStack::TInterfaceId, DMMCStack::MInterface *&)
+	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)
--- a/kernel/eka/drivers/pbus/mmc/sdcard/bwins/sdcard3c/epbusmu.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/bwins/sdcard3c/epbusmu.def	Wed Sep 01 12:34:56 2010 +0100
@@ -107,7 +107,7 @@
 	?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)
-	?GetInterface@DSDStack@@MAEXW4TInterfaceId@DMMCStack@@AAPAVMInterface@3@@Z @ 109  NONAME ; protected: virtual void __thiscall DSDStack::GetInterface(enum DMMCStack::TInterfaceId,class DMMCStack::MInterface * &)
+	?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)
--- a/kernel/eka/drivers/pbus/mmc/sdcard/bwins/sdcard3c/sdio/epbusmu.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/bwins/sdcard3c/sdio/epbusmu.def	Wed Sep 01 12:34:56 2010 +0100
@@ -107,7 +107,7 @@
 	?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)
-	?GetInterface@DSDStack@@MAEXW4TInterfaceId@DMMCStack@@AAPAVMInterface@3@@Z @ 109  NONAME ; protected: virtual void __thiscall DSDStack::GetInterface(enum DMMCStack::TInterfaceId,class DMMCStack::MInterface * &)
+	?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)
--- a/kernel/eka/drivers/pbus/mmc/sdcard/bx86/sdcard3c/epbusmu.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/bx86/sdcard3c/epbusmu.def	Wed Sep 01 12:34:56 2010 +0100
@@ -107,7 +107,7 @@
 	?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)
-	?GetInterface@DSDStack@@MAEXW4TInterfaceId@DMMCStack@@AAPAVMInterface@3@@Z @ 109  NONAME ; protected: virtual void __thiscall DSDStack::GetInterface(enum DMMCStack::TInterfaceId,class DMMCStack::MInterface * &)
+	?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)
--- a/kernel/eka/drivers/pbus/mmc/sdcard/bx86/sdcard3c/sdio/epbusmu.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/bx86/sdcard3c/sdio/epbusmu.def	Wed Sep 01 12:34:56 2010 +0100
@@ -107,7 +107,7 @@
 	?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)
-	?GetInterface@DSDStack@@MAEXW4TInterfaceId@DMMCStack@@AAPAVMInterface@3@@Z @ 109  NONAME ; protected: virtual void __thiscall DSDStack::GetInterface(enum DMMCStack::TInterfaceId,class DMMCStack::MInterface * &)
+	?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)
--- a/kernel/eka/drivers/pbus/mmc/sdcard/eabi/sdcard3c/epbusmu.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/eabi/sdcard3c/epbusmu.def	Wed Sep 01 12:34:56 2010 +0100
@@ -134,7 +134,7 @@
 	_ZN8DSDStack4InitEv @ 133 NONAME
 	_ZN8DSDStack6Dummy1Ev @ 134 NONAME
 	_ZN8DSDStack6Dummy2Ev @ 135 NONAME
-	_ZN8DSDStack12GetInterfaceEN9DMMCStack12TInterfaceIdERPNS0_10MInterfaceE @ 136 NONAME
+	_ZN8DSDStack6Dummy3Ev @ 136 NONAME
 	_ZN8DSDStack8CardTypeEii @ 137 NONAME
 	_ZNK8DSDStack12AllocSessionERK12TMMCCallBack @ 138 NONAME
 	_ZTI12TSDCardArray @ 139 NONAME ; #<TI>#
--- a/kernel/eka/drivers/pbus/mmc/sdcard/eabi/sdcard3c/sdio/epbusmu.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/eabi/sdcard3c/sdio/epbusmu.def	Wed Sep 01 12:34:56 2010 +0100
@@ -134,7 +134,7 @@
 	_ZN8DSDStack4InitEv @ 133 NONAME
 	_ZN8DSDStack6Dummy1Ev @ 134 NONAME
 	_ZN8DSDStack6Dummy2Ev @ 135 NONAME
-	_ZN8DSDStack12GetInterfaceEN9DMMCStack12TInterfaceIdERPNS0_10MInterfaceE @ 136 NONAME
+	_ZN8DSDStack6Dummy3Ev @ 136 NONAME
 	_ZN8DSDStack8CardTypeEii @ 137 NONAME
 	_ZNK8DSDStack12AllocSessionERK12TMMCCallBack @ 138 NONAME
 	_ZTI12TSDCardArray @ 139 NONAME ; #<TI>#
--- a/kernel/eka/drivers/pbus/mmc/sdcard/sdcard3c/sdcard.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/sdcard3c/sdcard.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -29,7 +29,6 @@
 TSDCard::TSDCard()
 :	iProtectedAreaSize(0), iPARootDirEnd(KPARootDirEndUnknown), iClientCountSD(0)
 	{
-	// empty
 	}
 
 TInt64 TSDCard::DeviceSize64() const
@@ -424,10 +423,6 @@
 EXPORT_C TInt DSDStack::Init()
 	{
 	OstTraceFunctionEntry1( DSDSTACK_INIT_ENTRY, this );
-
-	if((iAddressCard = new DAddressCard(*this)) == NULL)
-        return KErrNoMemory;
-	
 	TInt ret = DMMCStack::Init();
 	OstTraceFunctionExitExt( DSDSTACK_INIT_EXIT, this, ret );
 	return ret;
@@ -1140,7 +1135,7 @@
 		    {
 			AddressCard(KBroadcastToAllCards);
 			__KTRACE_OPT(KPBUS1, Kern::Printf("<DSDStack::InitStackAfterUnlockSM()"));
- 		    }
+		    }
 
 	SMF_END
 	
@@ -1658,31 +1653,6 @@
     }
 
 
-DAddressCard::DAddressCard(DSDStack& aStack) :iStack(aStack)
-	{
-	}
-
-void DAddressCard::AddressCard(TInt aCardNumber)
-	{
-	iStack.AddressCard(aCardNumber);
-	}
-
-/**
-Gets an interface from a derived class
-
-N.B the derived class should call this function if it does not support the specified interface
-*/
-EXPORT_C void DSDStack::GetInterface(TInterfaceId aInterfaceId, MInterface*& aInterfacePtr)
-	{
-	if (aInterfaceId == KInterfaceAddressCard)
-		{
-		aInterfacePtr = (DMMCStack::MInterface*) iAddressCard;
-		}
-	else
-		{
-		DMMCStack::GetInterface(aInterfaceId, aInterfacePtr);
-		}
-	}
-
 EXPORT_C void DSDStack::Dummy1() {}
 EXPORT_C void DSDStack::Dummy2() {}
+EXPORT_C void DSDStack::Dummy3() {}
--- a/kernel/eka/drivers/pbus/mmc/sdcard/sdcard3c/sdio/sdiostack.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/sdcard3c/sdio/sdiostack.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -2823,6 +2823,3 @@
 EXPORT_C void DSDIOStack::Dummy2() {}
 EXPORT_C void DSDIOStack::Dummy3() {}
 EXPORT_C void DSDIOStack::Dummy4() {}
-#if defined(__WINS__) || defined (__X86__)
-EXPORT_C void Dummy1() {}
-#endif
--- a/kernel/eka/drivers/pbus/mmc/session.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/session.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -464,10 +464,6 @@
 		return KErrNotReady;
 	    }
 
-	// Save the callers card pointer as some state machines 
-	// (e.g. ECIMLockUnlock, ECIMInitStackAfterUnlock) can change it
-	SaveCard();
-
 	SetupCIMControl(iSessionID);
 
 	iStackP->Add(this);
--- a/kernel/eka/drivers/pbus/mmc/stack.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/stack.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1804,11 +1804,9 @@
 	if( sessP->iCardP != NULL && sessP->iCardP->iUsingSessionP == sessP )
 		sessP->iCardP->iUsingSessionP = NULL;
 
-	// Some sessions may attach to more than once card, so need to iterate 
+	// iAutoUnlockSession may attach to more than once card, so need to iterate 
 	// through all cards and clear their session pointers if they match sessP
-	if (sessP == &iAutoUnlockSession || 
-		sessP->iSessionID == ECIMLockUnlock || 
-		sessP->iSessionID == ECIMInitStackAfterUnlock)
+	if (sessP == &iAutoUnlockSession)
 		{
 		for (TUint i = 0; i < iMaxCardsInStack; i++)
 			{
@@ -1944,11 +1942,6 @@
 
 			if(doCallback)
 				{
-				// Restore the callers card pointer as some state machines 
-				// (e.g. ECIMLockUnlock, ECIMInitStackAfterUnlock) can change it
-				sessP->RestoreCard();
-
-
 				// call media driver completion routine or StackSessionCBST().
 				sessP->iCallBack.CallBack();
 				}
@@ -6070,8 +6063,6 @@
 			return KMMCErrNotSupported;
 		    }
 
-		DoAddressCard(s.iCardP->iIndex-1);
-
 		s.iState |= KMMCSessStateInProgress;
 		m.SetTraps( KMMCErrInitContext );
 
@@ -6417,9 +6408,6 @@
 			{
 			EStBegin=0,
 			EStNextIndex,
-			EStSendStatus,
-			EStGetStatus,
-			EStUnlock,
 			EStInitStackAfterUnlock,
 			EStIssuedLockUnlock,
 			EStDone,
@@ -6482,32 +6470,12 @@
 		//
 		// Upon completion, test the next card before performing further initialisation.
 		//
+
+		TMMCard &cd = *(iCardArray->CardP(iAutoUnlockIndex++));
+		OstTrace1( TRACE_INTERNALS, DMMCSTACK_CIMAUTOUNLOCKSM4, "Attempting to unlock card %d", cd.Number() );
 		
-		DoAddressCard(iAutoUnlockIndex); 	// Address the card
-		TMMCard* cd = iCardArray->CardP(iAutoUnlockIndex);
-		s.SetCard(cd);
-
-	SMF_STATE(EStSendStatus)
-		        
-		s.FillCommandDesc(ECmdSendStatus, 0);
-		                        
-		SMF_INVOKES(ExecCommandSMST,EStGetStatus)
-		                        
-	SMF_STATE(EStGetStatus)
-		                        
-		const TMMCStatus st = s.LastStatus();
-		if((st & KMMCStatCardIsLocked) == 0)
-			{
-			SMF_GOTOS(EStNextIndex);
-		    }
-		                        
-	SMF_STATE(EStUnlock)
-		                        
-		const TMapping *mp = NULL;
-		mp = iSocket->iPasswordStore->FindMappingInStore(iCardArray->CardP(iAutoUnlockIndex)->CID());
-
-		OstTrace1( TRACE_INTERNALS, DMMCSTACK_CIMAUTOUNLOCKSM4, "Attempting to unlock card %d", iCardArray->CardP(iAutoUnlockIndex)->Number() );
-		
+		s.SetCard(&cd);
+
 		const TInt kPWD_LEN = mp->iPWD.Length();
 		iPSLBuf[0] = 0;				// LOCK_UNLOCK = 0; unlock
 		iPSLBuf[1] = static_cast<TUint8>(kPWD_LEN);
@@ -6784,21 +6752,6 @@
 	return busWidth;
 	}
 
-void DMMCStack::DoAddressCard(TInt aCardNumber)
-	{
-	MAddressCard* addressCardInterface = NULL;
-	GetInterface(KInterfaceAddressCard, (MInterface*&) addressCardInterface);
-	if (addressCardInterface)
-		addressCardInterface->AddressCard(aCardNumber);
-	else
-		{
-		// if the interface isn't supported on a multiplexed bus, then panic if the card number > 0 - 
-		// one cause of this panic is if the PSL 's implementation of GetInterface() does not call the 
-		// base class's implementation of GetInterface()
-		__ASSERT_ALWAYS((!iMultiplexedBus) || (aCardNumber <= 0), DMMCSocket::Panic(DMMCSocket::EMMCAddressCardNotSupported));
-		}
-	}
-
 /**
  * class DMMCSocket 
  */
--- a/kernel/eka/drivers/pbus/mmc/traces/OstTraceDefinitions.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/pbus/mmc/traces/OstTraceDefinitions.h	Wed Sep 01 12:34:56 2010 +0100
@@ -17,5 +17,5 @@
 // OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
 // REMOVE BEFORE CHECK-IN TO VERSION CONTROL
 //#define OST_TRACE_COMPILER_IN_USE
-#include <opensystemtrace.h>
+#include <OpenSystemTrace.h>
 #endif
--- a/kernel/eka/drivers/pbus/pccard/epoc/pccd_init.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/pbus/pccard/epoc/pccd_init.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -122,7 +122,7 @@
 			if (!pM)
 				return KErrNoMemory;
 			r=LocDrv::RegisterMediaDevice(mdi.iDevice,mdi.iDriveCount,mdi.iDriveList,pM,mdi.iNumMedia,*mdi.iDeviceName);
-			__KTRACE_OPT(KPBUS1,Kern::Printf("Registering PcCard device %S (socket %d) for %d drives returns %d",mdi.iDeviceName,pM->iSocket->iSocketNumber,mdi.iDriveCount,r));
+			__KTRACE_OPT(KPBUS1,Kern::Printf("Registering PcCard device %lS (socket %d) for %d drives returns %d",mdi.iDeviceName,pM->iSocket->iSocketNumber,mdi.iDriveCount,r));
 			if (r!=KErrNone)
 				return r;
 			}
--- a/kernel/eka/drivers/pbus/pccard/socket.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/pbus/pccard/socket.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -141,7 +141,7 @@
 //
 	{
 
-	__KTRACE_OPT(KPBUS1,Kern::Printf(">Skt(%d):Create(%S)",iSocketNumber,aName));
+	__KTRACE_OPT(KPBUS1,Kern::Printf(">Skt(%d):Create(%lS)",iSocketNumber,aName));
 
 	TInt r=DPBusSocket::Create(aName);
 	if (r!=KErrNone)
--- a/kernel/eka/drivers/pbus/spbus.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/pbus/spbus.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -683,7 +683,7 @@
 TInt DPBusSocket::Create(const TDesC* aName)
 	{
 	OstTraceFunctionEntry1( DPBUSSOCKET_CREATE_ENTRY, this );
-	__KTRACE_OPT(KPBUS1,Kern::Printf(">DPBusSocket(%d)::Create %S",iSocketNumber,aName));
+	__KTRACE_OPT(KPBUS1,Kern::Printf(">DPBusSocket(%d)::Create %lS",iSocketNumber,aName));
 	OstTrace1(TRACE_INTERNALS, DPBUSSOCKET_CREATE, "iSocketNumber=%d",iSocketNumber);
 	iName=aName;
 	DPBusPowerHandler* pH=new DPBusPowerHandler(this);
--- a/kernel/eka/drivers/power/smppower/idlehelper.cia	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,304 +0,0 @@
-// 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:
-// os\kernelhwsrv\kernel\eka\drivers\power\smpidlehelper.cpp
-// Impelentation of helper classes required to implement CPU idle
-// functionality in a SMP BSP.
-
-/**
- @file
- @prototype
-*/
-
-
-
-#ifdef __SMP__
-
-
-#include <smppower/idlehelper.h>
-
-
-#ifndef DISABLE_TRACE
-
-extern "C" void btrace_printfn(const TAny *aPtr,const TInt regNum)
-    {
-    PMBTRACE4(KPrintReg,regNum,aPtr);
-    }
-
-extern "C" void btrace_printfnId(const TAny *aPtr,const TInt regNum, TUint aId)
-    {
-    PMBTRACE8(KPrintReg,0xffu,regNum,aPtr);
-    }
-
-#define PRINTREG(Rn)                 \
-        asm("stmfd sp!,{r0-r12,lr}"); \
-        asm("mov r0,r"#Rn); \
-        asm("mov r1,#"#Rn); \
-        asm("bl btrace_printfn"); \
-        asm("ldmfd sp!,{r0-r12,lr}"); 
-
-#define PRINTREGID(Rn,n)               \
-        asm("stmfd sp!,{r0-r12,lr}"); \
-        asm("mov r0,r"#Rn); \
-        asm("mov r1,#"#Rn); \
-        asm("mov r2,#"#n); \
-        asm("bl btrace_printfnId"); \
-        asm("ldmfd sp!,{r0-r12,lr}"); 
-
-
-#else
-#define PRINTREG(Rn)
-#define PRINTREGID(Rn,n)
-#endif
-
-
-/**
-   Atomically does the following:
-     sets the current cpu idle mask bit to indicate current core wants to idle
-     if all enaged cores have set their bit the flag KGlobalIdleFlag is also 
-     orred into the idle mask to indicate all cores are going down. In this case
-     the function returned true. False otherwise
-
-   aCMask- Bit mask with only current CPU bit set
-   Normal Usage:use in idle handler before waiting for all cores down IPI
-   
-   @pre 
- */		
-	
-__NAKED__ TBool TIdleSupport::SetLocalAndCheckSetGlobalIdle(TUint32 /*aCpuMask*/)
-    {
-	asm("ldr    r1,__iAllEngagedCpusMask");                           //r1 = address of iAllEngagedCpusMask
-	asm("ldr	r2, [r1]");                                           //r2 = iAllEngagedCpusMask
-    asm("add    r1,r1,#4");                                           //r1 = address of iIdlingCpus 
-    __DATA_MEMORY_BARRIER_Z__(r12);   
-    asm("1: ");
-	LDREX(3,1);                                                       // r3 = iIdlingCpus
-    asm("orr    r3,r0,r3");                                           // orr in mask for this CPU
-    asm("cmp    r3,r2");                                              // compare to iAllEngagedCpusMask
-    asm("orreq  r3,r3,#%a0" : : "i" ((TInt)TIdleSupport::KGlobalIdleFlag)); // if equal orr in KGlobalIdleFlag
-    STREX(12,3,1);
-    asm("cmp    r12, #0 ");                                              // 
-	asm("bne    1b ");                                                   // write didn't succeed try again
-    __DATA_MEMORY_BARRIER__(r12);
-    asm("and    r0,r3,#%a0" : : "i" ((TInt)TIdleSupport::KGlobalIdleFlag));
-	__JUMP(,lr);
-    asm("__iAllEngagedCpusMask:");
-    asm(".word %a0" : : "i" ((TInt)&TIdleSupport::iAllEngagedCpusMask));//
-    }
-
-/** 
-
-Wait for all CPUs to reach the sync point. A CPU will only exit this function when all other CPUs
-have reached it. 
-
-Works like this:
-
-cpuMask = 1 << NKern::CurrentCpu()
-BEGIN_ATOMIC
-    stage = iStageAndCPUWaitingMask >> 16
-    waitingCpus = iStageAndCPUWaitingMask&iAllCpusMask
-    oldstage = stage;
-    if (waitingCpus == iAllCpusMask) // we synched already and this is new 
-             waitingCpus = 0;
-     waitingCpus |= cpuMask
-     if (waitingCpus == iAllCpusMask) stage++
-     iStageAndCPUWaitingMask = (stage << 16) | waitingCpus
-END_ATOMIC
-FOREVER 
-   if (oldstage!=stage) return
-   stage = iStageAndCPUWaitingMask >> 16 // reread stage
-END_FOREVER   
-
-*/
-__NAKED__ void TSyncPoint::DoSW(TUint32 /*aCpuMask*/)
-    {
-    asm("stmfd sp!, {r4-r5,lr} ");	
-    asm("add r0,r0,#%a0" : : "i"  _FOFF(TSyncPointBase, iStageAndCPUWaitingMask)); // skip vt
-    asm("ldr r4,[r0,#4]"); 
-    asm("ldr r4,[r4]");
-   __DATA_MEMORY_BARRIER_Z__(r12);          // 
-    asm("1: ");
-	LDREX(2,0);                             // r2 =  iStageAndCPUWaitingMask, r4 = iAllEnagedCpusMask
-    asm("mov r5,r2,lsr #16");               // r5 has old staging value
-    asm("and r2,r2,r4");                    // r2 has currently waiting cpus
-    asm("cmp r2,r4");                       // if r2 == r4 then we previously have had all cpus synched 
-    asm("moveq r2,#0");                     // reset 
-    asm("orr r2, r2, r1");                  // orr mask for this CPU 
-    asm("mov r3,r5");                       // r3 will have new stage
-    asm("cmp r2,r4");                       // if r2 == r4 then all cpus have set
-    asm("addeq r3,r3,#1");                  // increment new stage count
-    asm("orr r2,r2,r3, lsl #16");          
-	STREX(12,2,0);                           // try to atomically iStageAndCPUWaitingMask
-	asm("cmp r12, #0 ");
-	asm("bne 1b ");                         // write didn't succeed try again
-    __DATA_MEMORY_BARRIER__(r12);          // ensure that's written
-#ifdef SYNCPOINT_WFE	
-	asm("ands r2,r2,r4");
-    asm("cmp r2,r4");                       // if r2 == r4 then all cpus have set      			
-	ARM_SEVcc(CC_EQ);
-#endif		
-    asm("2: ");
-    asm("cmp r3,r5");                       // all (old stage does not equal new stage)
-    asm("ldmnefd sp!, {r4-r5,pc}");         // yup return
-#ifdef SYNCPOINT_WFE		
-	__DATA_MEMORY_BARRIER__(r12);        
-	ARM_WFE;
-#endif	
-    asm("ldr r2,[r0]");                     // otherwise re read iWaitingCpusMask into r5
-    __DATA_MEMORY_BARRIER__(r12);           // ensure read is observed
-    asm("mov r3,r2,lsr #16");               // re-read new stage
-    asm("b 2b");                            // loop back
-    }
-
-/** 
-
-Wait for all CPUs to reach the sync point. A CPU will only exit this function when all other CPUs
-have reached it or if another CPU has called the Break function. An attempt to wait on a broken
-syncpoint will return immediately.
-
-Works like this:
-
-cpuMask = 1 << NKern::CurrentCpu()
-BEGIN_ATOMIC
-     waitingCpus = iStageAndCPUWaitingMask&iAllEnagedCpusMask
-     if (iStageAndCPUWaitingMask & 0x80000000) // sync point is broken
-        END_ATOMIC and return
-
-     waitingCpus |= cpuMask
-     if (waitingCpus == iAllEnagedCpusMask) waitingCpus |= 0x80000000
-     iStageAndCPUWaitingMask = waitingCpus
-END_ATOMIC
-FOREVER 
-     if (iStageAndCPUWaitingMask&0x80000000) break
-END_FOREVER   
-
-*/
-__NAKED__ void TBreakableSyncPoint::DoSW(TUint32 /*aCpuMask*/)
-    {
-    asm("stmfd sp!, {r4,lr} ");	
-    asm("add r0,r0,#%a0" : : "i"  _FOFF(TSyncPointBase, iStageAndCPUWaitingMask)); // skip vt
-    asm("ldr r4,[r0,#4]");
-    asm("ldr r4,[r4]");
-    __DATA_MEMORY_BARRIER_Z__(r12);          // 
-    asm("1: ");
-	LDREX(2,0);                             // r2 =  iStageAndCPUWaitingMask, r4 = iAllEnagedCpusMask
-    asm("ands r3,r2,#0x80000000");          // 
-    asm("bne 3f");                          // sync point broken so return
-    asm("and r2,r2,r4");                    // r2 has currently waiting cpus
-    asm("orr r2, r2, r1");                  // orr mask for this CPU 
-    asm("cmp r2,r4");                       // if r2 == r4 then all cpus have set
-    asm("orreq r2,r2,#0x80000000");         // set MSB
-	STREX(12,2,0);                          // try to atomically iStageAndCPUWaitingMask
-	asm("cmp r12, #0 ");
-	asm("bne 1b ");                         // write didn't succeed try again		
-    __DATA_MEMORY_BARRIER__(r12);           // ensure that's written
-#ifdef SYNCPOINT_WFE	
-	asm("ands r3,r2,#0x80000000");          // MSB set?
-	ARM_SEVcc(CC_NE);
-#endif		
-    asm("2: ");
-    asm("ands r3,r2,#0x80000000");          // MSB set?	
-    asm("ldmnefd sp!, {r4,pc}");            // yup return
-#ifdef SYNCPOINT_WFE		
-	__DATA_MEMORY_BARRIER__(r12);
-	ARM_WFE;
-#endif	
-    asm("ldr r2,[r0]");                     // otherwise re read iWaitingCpusMask into r5
-    //__DATA_MEMORY_BARRIER_Z__(r12);        // ensure read is observed
-    asm("b 2b");                            // loop back
-    asm("3:");
-    CLREX;
-#ifdef SYNCPOINT_WFE	 
-    __DATA_MEMORY_BARRIER__(r12);           // ensure that's written
-	ARM_SEV;
-#endif	
-    asm("ldmfd sp!, {r4,pc}");            // yup return
-    }
-	
-	
-#ifdef PROPER_WFI
-__NAKED__ void TIdleSupport::DoWFI()
-    {
-    __DATA_SYNC_BARRIER_Z__(r12);  // generally good idea to a barrier before WFI            
-    ARM_WFI;
-	__JUMP(,lr);
-    }
-#else
-void TIdleSupport::DoWFI()
-    {
-    TInt c=NKern::CurrentCpu();
-    FOREVER
-        {
-        TInt isr = Pending();
-        if (isr!=1023) 
-            {
-            BTRACE0(KIsrPendingCat,isr&0xff);
-            break;
-            }
-        }
-    }
-#endif
-
-__NAKED__ void TIdleSupport::DoIdleIPI(TUint32 /*aMask*/) 
-    {
-	//r0 = cpu mask
-    asm("ldr    r2,__EnagedCpusMask");  // only IPI enaged cores r2 has enaged core mask addr
-    asm("ldr    r2,[r2]");   
-    asm("and    r0,r0,r2");            // and out retired cores
-    asm("ldr	r1,__KGICAddr");//r1 = address off iGlobalIntDistAddress
-    asm("ldr	r1, [r1]");//r1 = address of Hw GIC interrupt dispatcher base			
-    __DATA_SYNC_BARRIER_Z__(r12);			// need DSB before sending any IPI
-    asm("movs	r0, r0, lsl #16 ");		// CPU mask into bits 16-23 - any bits set in aMask?
-    asm("orrne	r0, r0, #%a0" : : "i" ((TInt) IDLE_WAKEUP_IPI_VECTOR));
-    asm("strne	r0, [r1, #%a0]" : : "i" _FOFF(GicDistributor, iSoftIrq));	// trigger IPIs if any
-    __JUMP(,lr);
-    asm("__KGICAddr:");
-    asm(".word %a0" : : "i" ((TInt)&TIdleSupport::iGlobalIntDistAddress));
-    asm("__EnagedCpusMask:");
-    asm(".word %a0" : : "i" ((TInt)&TIdleSupport::iAllEngagedCpusMask));
-    }
-
-#ifdef _DEBUG
-__NAKED__  TInt TIdleSupport::DoClearIdleIPI()
-#else
-__NAKED__  void TIdleSupport::ClearIdleIPI()
-#endif
-    {
-    __DATA_SYNC_BARRIER_Z__(r12);			// DSB    
-    asm("ldr    r1,__KCPUIFAddr");//r1 = address of iBaseIntIfAddress
-    asm("ldr	r1, [r1]");//r1 = address of Hw GIC CPU interrupt interface base address
-    asm("ldr    r0,[r1, #%a0]" : : "i" _FOFF(GicCpuIfc, iAck));
-    // asm("mov    r0,#%a0" : : "i" ((TInt) IDLE_WAKEUP_IPI_VECTOR)); // has to be!
-    asm("str    r0, [r1, #%a0]" : : "i" _FOFF(GicCpuIfc, iEoi));
-	__JUMP(,lr);
-    asm("__KCPUIFAddr:");
-    asm(".word %a0" : : "i" ((TInt)&TIdleSupport::iBaseIntIfAddress));// CPU interrupt interface base address
-    }
-
-#ifndef _DEBUG
-TInt TIdleSupport::DoClearIdleIPI()
-    {
-    return 0;
-    }
-#endif
-
-__NAKED__  TInt TIdleSupport::IntPending()  
-    {
-	asm("ldr    r1,__KCPUIFAddr");//r1 = address of iBaseIntIfAddress
-	asm("ldr	r1, [r1]");//r1 = address of Hw GIC CPU interrupt interface base address
-	asm("ldr    r0, [r1, #%a0]" : : "i" _FOFF(GicCpuIfc, iHighestPending));    
-	__JUMP(,lr);
-    }	
-
-
-#endif // ifdef __SMP__
--- a/kernel/eka/drivers/power/smppower/idlehelper.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,302 +0,0 @@
-// 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:
-// os\kernelhwsrv\kernel\eka\drivers\power\smppower\idlehelper.cpp
-// Impelentation of helper classes required to implement CPU idle
-// functionality in a SMP BSP.
-
-/**
- @file
- @prototype
-*/
-
-#include <kernel/arm/arm.h>
-#include <smppower/idlehelper.h>
-
-#ifdef __SMP__
-//-/-/-/-/-/-/-/-/-/ class TIdleSupport/-/-/-/-/-/-/-/-/-/
-
-TUint TIdleSupport::iGlobalIntDistAddress=0;
-TUint TIdleSupport::iBaseIntIfAddress=0;
-volatile TUint32* TIdleSupport::iTimerCount=0;
-volatile TUint32 TIdleSupport::iIdlingCpus=0;
-volatile TUint32 TIdleSupport::iAllEngagedCpusMask=0;
-volatile TUint32 TIdleSupport::iRousingCpus=0;
-volatile TUint32 TIdleSupport::iExitRequired=EFalse;
-
-/**
-   Setup interrupt access for static library  by setting up
-   interrupt distributor and CPU interrupt interface addresses
-   aGlobalIntDistAddress = interrupt distributor base address
-   aBaseIntIfAddress = CPU interrupt base address
-   aTimerCount = optional pointer to hw timer counter reg from bsp (only used for btrace)   
-   @pre 
- */
- 
-void TIdleSupport::SetupIdleSupport(TUint32 aGlobalIntDistAddress, TUint32 aBaseIntIfAddress, TUint32* aTimerCount)
-	{
-	iGlobalIntDistAddress=aGlobalIntDistAddress;
-	iBaseIntIfAddress=aBaseIntIfAddress;
-	iTimerCount=aTimerCount; /*NULL by default*/
-    iAllEngagedCpusMask=AllCpusMask();
-	}
-/**
-   Returns the current HW timer count reg value by default
-   Only used for btrace. If this is not set NKern::FastCounter is
-   returned.
-*/	
-	
-TUint32 TIdleSupport::GetTimerCount()
-	{
-    if(iTimerCount)
-        return *iTimerCount;
-    else
-        return NKern::FastCounter();
-	}
-
-/**
-   Returns TRUE if any interrupt is pending,FALSE otherwise 
-*/	
-
-TBool TIdleSupport::IsIntPending()
-	{
-	return ((TUint32)IntPending()!=KNoInterruptsPending);
-	}
-		
-/**
-   Set the piroity of the Idle IPI to be the highest
-   @pre 
-*/		
-	
-void TIdleSupport::SetIdleIPIToHighestPriority()
-	{	
-    // Set Idle IPI to highest priority
-    NKern::ThreadEnterCS();
-    TInt frz = NKern::FreezeCpu();
-    __PM_IDLE_ASSERT_ALWAYS(!frz);
-    TInt orig_cpu = NKern::CurrentCpu();
-    TInt ncpu = NKern::NumberOfCpus();
-    TInt cpu = orig_cpu;
-    TUint32 orig_affinity = 0;
-    do	
-        {
-        TUint32 affinity = NKern::ThreadSetCpuAffinity(NKern::CurrentThread(), (TUint32)cpu);
-        if (cpu == orig_cpu)
-            {
-            orig_affinity = affinity;
-            NKern::EndFreezeCpu(frz);
-            }
-        TInt cpu_now = NKern::CurrentCpu();
-        __PM_IDLE_ASSERT_ALWAYS(cpu_now == cpu);
-          
-        // here we can set the priority of the IPI vector for each CPU in turn
-        GicDistributor* theGIC = (GicDistributor*) TIdleSupport::iGlobalIntDistAddress;
-        TUint8* priorities = (TUint8*) &(theGIC->iPriority);
-        priorities[IDLE_WAKEUP_IPI_VECTOR]=0x0;
-        __e32_io_completion_barrier();
-        if (++cpu == ncpu)
-            cpu = 0;
-        } while (cpu != orig_cpu);
-    NKern::ThreadSetCpuAffinity(NKern::CurrentThread(), orig_affinity);
-    NKern::ThreadLeaveCS(); 
-	}
-
-
-/**
-   Atomically clears the current cpu idle mask bit to indicate current core has woken 
-   up from an interrupt or IPI.   
-   return TRUE only if all other cores are in idle and we were woken from an IPI from the last 
-   core going idle (otherwisw FALSE). 
-   aCpuMask- Bit mask with only current CPU bit set
-   Normal usage:use in idle handler after waking from all cores down IPI    
-      
-   @pre 
- */	
-TBool TIdleSupport::ClearLocalAndCheckGlobalIdle(TUint32 aCpuMask)
-    {
-    return (__e32_atomic_and_ord32(&iIdlingCpus,~aCpuMask) & KGlobalIdleFlag);
-    }
-
-
-/**
-	Atomically sets the cpu bit rousing mask only to indicate current CPU has woken. 
-	return TRUE only if this is first CPU awake.(otherwise FALSE).
-	aCMask- Bit mask with only current CPU bit set	
-	Normal usage: use in idle handler just after core is woken
-	
-   @pre  */		
-	
-	
-TBool TIdleSupport::FirstCoreAwake(TUint32 aCMask)
-	{
-	//TInt c = NKern::CurrentCpu();
-    //TUint32 cMask = (1<<c);//only current cpu mask is set 
-	return (!__e32_atomic_ior_acq32(&iRousingCpus,aCMask));	
-	}
-
-/**
-   Sets the exit required flag in TIdleSupport. Exit required is
-   normaly required be set if an interrupt is pending on a Core
-   aBreakSyncPoint- TBreakableSyncPoint* that all cores were waiting on
-   before interrupt occured. Normal usage: after interrupt pending check	
-      
-   @pre */
-   
-void TIdleSupport::SetExitRequired(TBreakableSyncPoint* aBreakSyncPoint)	
-	{
-	iExitRequired=ETrue;
-	if(aBreakSyncPoint)
-		aBreakSyncPoint->Break();
-	}
-	
-/**
-   Sets the exit required flag in TIdleSupport. Exit required is
-   normaly required be set if an interrupt is pending on a Core
-   aBreakSyncPoint- TBreakableSyncPoint that all cores were waiting on
-   before interrupt occured.  
-      
-   @pre */	
-
-TBool TIdleSupport::GetExitRequired()
-	{
-	return iExitRequired;
-	}
-	
-/**
-   Resets all the control flags/syncpoints. This is normally done by the 
-   last core when all cores are confirmed to be idle.
-   
-      
-   @pre */		
-	
-void TIdleSupport::ResetLogic()	
-	{
-    iIdlingCpus = 0;         // clear idle CPUs
-    iRousingCpus = 0;         // clear rousing CPUs
-    iExitRequired = EFalse; 
-	}
-
-
-/**
-   mark a core as retired
-
-   @pre called by idle handler as part of idle entry before 
-          any syncpoint or calls to SetLocalAndCheckSetGlobalIdle
-*/	
-void TIdleSupport::MarkCoreRetired(TUint32 aCpuMask)
-    {
-    __e32_atomic_and_rlx32(&iAllEngagedCpusMask,~aCpuMask);
-    PMBTRACE4(KRetireCore,KRetireMarkCoreRetired,aCpuMask);
-    }
-
-/**
-   mark a core as enaged
-   @pre called outside idle handler ( can be called in idle entry before 
-        any syncpoint or calls to SetLocalAndCheckSetGlobalIdle
- */	
-void TIdleSupport::MarkCoreEngaged(TUint32 aCpuMask)
-    {
-    __e32_atomic_ior_rlx32(&iAllEngagedCpusMask,aCpuMask);
-    PMBTRACE4(KEngageCore,KEngageMarkCoreEngaged,aCpuMask);
-    }
-
-/**
-   Returns the current cpu idling bit mask
-   @pre */	
-
-TUint32 TIdleSupport::GetCpusIdleMask()
-	{
-	return iIdlingCpus;
-	}
-
-/**
-   Returns address of enaged cpus mask, needed for synch point construction
-
-   */	
-
-volatile TUint32* TIdleSupport::EngagedCpusMaskAddr()
-    { 
-    return &iAllEngagedCpusMask; 
-    }
-
-/**
-   Returns address of enaged cpus mask, needed for synch point construction
-
-   */	
-
-TUint32 TIdleSupport::AllCpusMask()
-    { 
-    return ((0x1<<NKern::NumberOfCpus())-1); 
-    }
-
-/**
-   clears IPI and asserts so in 
-   @pre */	
-#ifdef _DEBUG
-void TIdleSupport::ClearIdleIPI()
-    {
-    __PM_IDLE_ASSERT_ALWAYS((DoClearIdleIPI()&0x1ff)==IDLE_WAKEUP_IPI_VECTOR);
-    }
-#endif
-
-
-//-/-/-/-/-/-/-/-/-/ class TSyncPointBase /-/-/-/-/-/-/-/-/-/
-TSyncPointBase::TSyncPointBase()
-    :iStageAndCPUWaitingMask(0),
-     iAllEnagedCpusMask(TIdleSupport::EngagedCpusMaskAddr())
-    {
-    }
-
-
-#ifdef _DEBUG
-void TSyncPointBase::SignalAndWait(TUint32 aStage)
-    {	
-    PMBTRACE8(KSyncPoint,KSignalAndWaitEntry,aStage,*iAllEnagedCpusMask);    
-#else
-void TSyncPointBase::SignalAndWait()
-    {
-#endif	
-    TInt c = NKern::CurrentCpu();
-    DoSW(1<<c);
-#ifdef _DEBUG
-	PMBTRACE0(KSyncPoint,KSignalAndWaiteXit);	
-#endif
-    }
-
-
-/**
-   Resets a syncpoint. 
-   No barriers are used in function so add them if required. For breakable synchpoints this must be called before sync point can be used, 
-   for normal syncpoints this must be called whenever a CPU gets enaged
-   @pre Should be called from one CPU. 
- */
-void TSyncPointBase::Reset()
-    {
-    // Could assert it is already broken // not using atomics because this must be called from only one cpu before
-    // and be synchronised
-    iStageAndCPUWaitingMask = 0;
-    }
-
-
-//-/-/-/-/-/-/-/-/-/ class TBreakableSyncPoint /-/-/-/-/-/-/-/-/-/
-
-/**
-   Breaks the sync point until it is reset again. Any attempt to wait on the point will return inmediatelly until the point is reset
- */
-void TBreakableSyncPoint::Break()
-    {
-    __e32_atomic_ior_ord32(&iStageAndCPUWaitingMask,0x80000000);
-    }
-
-
-#endif //__SMP__
--- a/kernel/eka/drivers/power/smppower/idlehelper_lib.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-// 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:
-// \drivers\power\smppower\smpidlehelper_lib.mmp
-// Helper library required to implement CPU idle
-// functionality in a SMP BSP.
-
-
-#define NO_EKERN_LIB
-#include "kernel/kern_ext.mmh"
-
-target				idlehelper.lib
-targettype			klib
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-sourcepath       ../../power/smppower
-source           idlehelper.cpp idlehelper.cia
-
-start wins
-win32_headers
-end
-
-capability		all
-
-vendorid 0x70000001
-
-SMPSAFE
-
--- a/kernel/eka/drivers/power/smppower/sample_idlehandler/smpidlehandler.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,306 +0,0 @@
-// 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:
-// eka\drivers\power\smppower\sample_idlehandler\smpidlehandler.cpp
-// implements a basic smp idle handler generic layer that can be derived from 
-// to create platform specific SMP idle handlers
-
-/**
- @file
- @prototype
-*/
-#ifndef __WINS__
-#include <kernel/arm/arm.h>
-#endif
-#include "smpidlehandler.h"
-
-#ifdef __SMP__
-
-//-/-/-/-/-/-/-/-/-/ class DDSMPIdleHandler /-/-/-/-/-/-/-/-/-/
-
-DSMPIdleHandler* gTheIdleHandler = NULL;
-
-DSMPIdleHandler::DSMPIdleHandler ()
-    :iAllCpusMask(TIdleSupport::AllCpusMask()),
-     iStartAfterExtInitDfc(StartAfterExtIntDfcFn,this,Kern::SvMsgQue(),0),
-     iInitialised(EFalse)
-      {
-      // singleton class
-      __PM_IDLE_ASSERT_DEBUG(!gTheIdleHandler);
-      gTheIdleHandler = this;
-      }
-
-
-DSMPIdleHandler::~DSMPIdleHandler()
-	{
-	}
-
-
-/**
-   To be called after construction in a thread context with interrupts enabled. Power extension entry point ideal
-   @pre thread context ints enable no kernel locks or fast mutexes
-   @param aGlobalIntDistAddress GIC address
-   @param aBaseIntIfAddress GIC CPU interface address
- */
-void DSMPIdleHandler::Initialise(TUint32 aGlobalIntDistAddress, TUint32 aBaseIntIfAddress)
-    {
-	TIdleSupport::SetupIdleSupport(aGlobalIntDistAddress,aBaseIntIfAddress);
-    //Set Idle IPI to highest priority
-	TIdleSupport::SetIdleIPIToHighestPriority();
-    Arm::SetIdleHandler((TCpuIdleHandlerFn)DSMPIdleHandler::IdleHandler, this);
-    iStartAfterExtInitDfc.Enque();
-    }
-
-
-/**
-   Must be called when cores are enaged or retired
-   @pre calling code must be outside idle handler, or in DoEnterIdle call
-*/
-void DSMPIdleHandler::ResetSyncPoints()
-    {
-    iIdleSync.Reset();
-    iStage2.Reset();
-    }
-
-
-/**
-   Called by idle handler inmediatelly after idle entry. Can be used for things such as checking 
-   if a core is going to be retired. Can return EFalse to force the idle handler to return 
-   at that point
-   @param aCpuMask mask of current cpu
-   @param aStage passed from kernel indicated things such core retiring or postamble
-   @param aU points to some per-CPU uncached memory used for handshaking in 
-       during power up/power down of a core for support of core retiring. This 
-       memory is provided by baseport to the kernel via the VIB
-
-   @return EFalse if the cpu should exit idle, ETrue otherwise
- */
-TBool DSMPIdleHandler::DoEnterIdle(TInt aCpuMask, TInt aStage,  volatile TAny* aU)
-    {
-    return ETrue;
-    }
-
- /**
-    Called by idle handler all cpus to enter idle once all have entered idle but
-    before NTimeQ::IdleTime is called to check time to next timer expiry. Can be used 
-    for things such as idle timer pre-idle processing. In such cases only the last CPU
-    should do the idle timer processing
-    @param aCpuMask mask of current cpu
-    @param aLastCPu indicates if this is last CPU.
- */
-void DSMPIdleHandler::CpusHaveEnteredIdle(TInt aCpuMask, TInt aLastCpu)
-    {
-    }
-
-
-/**
-   Called after wakeup can be used for status restoring
-   a sync point is placed after the call to this function
-   This can be a good place to do idle tick restoration
-   @param TInt aCpuMask indicates calling CPU
-   @param aLastCPu indicates if this is last CPU.
-   @see EnterLowPowerMode
-*/
-void DSMPIdleHandler::PostWakeup(TInt aCpuMask, TBool aLastCpu)
-    {
-    }
-
-/**
-   Called at exit of idle handler not synchronised in any way
-   @param aExitPoint point at which you might exit the idle handler
-   @param TInt aCpuMask indicates calling CPU
-   @param aLastCPu indicates if this is last CPU.
-*/
-void DSMPIdleHandler::DoExitIdle(TIdleExit aExitPoint, TInt aCpuMask, TBool aLastCpu)
-    {
-    }
-
-/**
-   IdleHandler just calls DoIdle
-*/
-void DSMPIdleHandler::IdleHandler(TAny* /*aPtr*/, TInt aStage, volatile TAny* aU)
-    {
-    gTheIdleHandler->DoIdle(aStage,aU);
-    }
-
-/**
-   Idle handling per se
-*/
-void DSMPIdleHandler::DoIdle(TInt aStage, volatile TAny* aU)
-    {
-    // wait after all extensions have initialsed before running
-    if (!iInitialised) return;
-    
-    TInt c = NKern::CurrentCpu();
-	TUint32 cMask = (1<<c);
-	TUint32 allButC = (~cMask) & iAllCpusMask;
-
-    if (!DoEnterIdle(cMask,aStage,aU)) return;
-
-	if (TIdleSupport::SetLocalAndCheckSetGlobalIdle(cMask)) // check if last down
-		{
-        //LastCpuIdle:                               
-        PMBTRACE4(KIdleEntry,KIdleEntryLastCpu,TIdleSupport::GetCpusIdleMask());
-        // we have now managed to lock the system into all cpus waiting, by setting MSB we are now informing any leaving CPUs 
-        // that we intend to take the system down
-        // other CPUs with an STI so they can proceed with power down
-        // when we get there, all other CPUs can be in of the following states:
-        // 1. In the DoWFI of the section above (allButC!=_....) 
-        // 2. They could have already got past the DoWFI due to another interrupt waking them up
-        TIdleSupport::DoIdleIPI(allButC);          // wake all sleeping CPUs   
-        PMBTRACE0(KSendIPI,0);
-        SYNCPOINT(iIdleSync,0);  // After this point all should be awake and then other will clear the pending IPI 
-        CpusHaveEnteredIdle(cMask,ETrue);
-        iStage2.Reset();
-        TIdleSupport::ResetLogic(); // 
-        SYNCPOINT(iIdleSync,1);  // sync on IPI clearing
-
-        // here do we have
-        // a/ Interrupt pending?
-        // b/ Timer coming up soon? 
-        // if (a or b) just allow all idle handlers to return
-        TInt nextTimer = NTimerQ::IdleTime();
-        TBool exitNow = !GetLowPowerMode(nextTimer,iLowPowerMode);
-        
-        PMBTRACE8(KMisc,2,nextTimer,iLowPowerMode);
-        
-        if (TIdleSupport::IsIntPending() || exitNow)
-            {
-            // clear idling cpus this will cause all cpus to exit idle handler
-            TIdleSupport::SetExitRequired(&iStage2);		
-            }
-        
-        SYNCPOINT(iStage2,2);
-        if(TIdleSupport::GetExitRequired())            
-            {
-            DoExitIdle(EExitBeforeLPM,cMask,ETrue);
-            PMBTRACE4(KIdleeXit,KIdleeXitLastCpu1,TIdleSupport::GetCpusIdleMask());
-            return;
-            }
-        
-        // We enter LPM here!!!
-        TBool exitRouseRequired = EnterLowPowerMode(iLowPowerMode,cMask,ETrue);
-
-        TBool firstToWake = EFalse;
-
-        if (exitRouseRequired)
-            {
-            firstToWake = TIdleSupport::FirstCoreAwake(cMask);
-            if (firstToWake)
-                {
-                // we are probaly first to rouse so wake the others
-                PMBTRACE0(KMisc,0x50);
-                TIdleSupport::DoIdleIPI (allButC);
-                }
-            }
-
-        PostWakeup(cMask,ETrue);
-        PMBTRACE4(KMisc,3,exitRouseRequired);
-        SYNCPOINT(iIdleSync,3);  
-        if (exitRouseRequired)
-            {
-            if (!firstToWake)
-                {
-                TIdleSupport::ClearIdleIPI();
-                PMBTRACE0(KMisc,0x51);
-                }
-            }
-        DoExitIdle(EExitAfterLPM,cMask,ETrue);    
-        PMBTRACE4(KMisc,0x52,TIdleSupport::IntPending()&0x1ff);
-        PMBTRACE4(KIdleeXit,KIdleeXitLastCpu0,TIdleSupport::GetCpusIdleMask());
-        }
-	else
-        {
-        //NormalIdle:                               
-        PMBTRACE4(KIdleEntry,KIdleEntryNormalCpu,TIdleSupport::GetCpusIdleMask());	
-        TIdleSupport::DoWFI();	// CPU in WFI
-        // here we could have woken up because of the Idle IPI or because of another interrupt
-        if (!TIdleSupport::ClearLocalAndCheckGlobalIdle(cMask)) 
-            {
-            // not all other cores are idling we were woken up by some interrupt so exit
-            DoExitIdle(EExitOtherCPUsNotIdle,cMask,EFalse);
-            PMBTRACE4(KIdleeXit,KIdleeXitNormalCpu0,TIdleSupport::GetCpusIdleMask());
-            return;
-            }
-
-        // we are all idling
-        SYNCPOINT(iIdleSync,0x10);
-        // clear IdleIPI, we could actually have another interrupt pending but 
-        // we ignore this for now as it is checked later
-        
-        TIdleSupport::ClearIdleIPI(); 
-        PMBTRACE0(KClearIPI,0x10);
-        CpusHaveEnteredIdle(cMask,EFalse);
-        SYNCPOINT(iIdleSync,0x11);
-
-        if (TIdleSupport::IsIntPending())
-				{
-                // clear idling cpus this will cause all cpus to exit idle handler
-                TIdleSupport::SetExitRequired(&iStage2);				           
-				}
-
-        SYNCPOINT(iStage2,0x12);			
-        if (TIdleSupport::GetExitRequired())
-            {
-            DoExitIdle(EExitBeforeLPM,cMask,EFalse);
-            PMBTRACE4(KIdleeXit,KIdleeXitNormalCpu1,TIdleSupport::GetCpusIdleMask());
-            return;
-            }
-
-        // We enter LPM here!!!
-        TBool exitRouseRequired = EnterLowPowerMode(iLowPowerMode,cMask,EFalse);
-
-        TBool firstToWake = EFalse;
-        
-        if (exitRouseRequired)
-            {
-            firstToWake = TIdleSupport::FirstCoreAwake(cMask);
-            if (firstToWake)
-                {
-                // we are probaly first to rouse so wake the others
-                PMBTRACE0(KMisc,0x50);
-                TIdleSupport::DoIdleIPI (allButC);
-                }
-            }
-
-        PostWakeup(cMask,EFalse);
-        PMBTRACE4(KMisc,3,exitRouseRequired);
-        SYNCPOINT(iIdleSync,0x13);  
-        if (exitRouseRequired)
-            {
-            if (!firstToWake)
-                {
-                TIdleSupport::ClearIdleIPI();
-                PMBTRACE0(KMisc,0x51);
-                }
-            }
-        
-        DoExitIdle(EExitAfterLPM,cMask,EFalse);    
-        PMBTRACE4(KMisc,0x52,TIdleSupport::IntPending()&0x1ff);
-        PMBTRACE4(KIdleeXit,KIdleeXitNormalCpu0,TIdleSupport::GetCpusIdleMask());
-        }
-    }
-
-
-/**
-   Dfc queued on init to delay idle handler entry until after all
-   extensions have initialised
-*/
-void DSMPIdleHandler::StartAfterExtIntDfcFn(TAny* aPtr)
-    {
-    DSMPIdleHandler* pD = (DSMPIdleHandler*) aPtr;
-    pD->iInitialised = ETrue;
-    }
-
-
-#endif //__SMP__
--- a/kernel/eka/drivers/power/smppower/sample_idlehandler/smpidlehandler_lib.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +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:
-// eka\drivers\power\smppower\sample_idlehandler\smpidlehandler_lib.mmp
-// Helper library required to implement CPU idle
-// functionality in a SMP BSP.
-
-
-#define NO_EKERN_LIB
-#include "kernel/kern_ext.mmh"
-
-target				sample_smpidlehandler.lib
-targettype			klib
-
-userinclude      ../../../../include/drivers/smppower/sample_idlehandler
-sourcepath       .
-source 		 smpidlehandler.cpp
-
-capability		all
-
-vendorid 0x70000001
-
-SMPSAFE
-
--- a/kernel/eka/drivers/resmanus/d_resmanus.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/resmanus/d_resmanus.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1995-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1995-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"
@@ -473,7 +473,7 @@
 	TInt r = KErrNone;
 	TTrackingBuffer *trackBuf = NULL;
 	TUint parms[4];
-	TPowerResourceCb *callBack = NULL;
+	TPowerResourceCb *callBack;
 	DPowerResourceNotification *prn;
 
 	switch(id)
@@ -482,7 +482,8 @@
 			{
 			__ASSERT_ALWAYS(m.Ptr2() != NULL, RESMANUS_FAULT());
 #ifdef _DUMP_TRACKERS
-			DumpTracker(iSetStateTracker);
+			if((r=DumpTracker(iSetStateTracker))!=KErrNone)
+				break;
 #endif
 			r = GetAndInitTrackingBuffer(iSetStateTracker, trackBuf, (TUint)m.Ptr1(), pS);
 			if( r != KErrNone)
@@ -499,7 +500,8 @@
 			__ASSERT_ALWAYS(m.Ptr2() != NULL, RESMANUS_FAULT());
 			umemget32(&(parms[0]), m.Ptr2(), 3*sizeof(TInt));
 #ifdef _DUMP_TRACKERS
-			DumpTracker(iGetStateTracker);
+			if((r=DumpTracker(iGetStateTracker))!=KErrNone)
+				break;
 #endif
 			r = GetStateBuffer(iGetStateTracker, trackBuf, (TUint)m.Ptr1(), (TInt*)parms[1], (TInt*)parms[2], callBack, pS);
 			if(r != KErrNone)
@@ -1267,8 +1269,10 @@
 				if((r==KErrNone) && (stateRes[2]>0))
 					r=InitTrackingControl(iListenableTracker,ENotify,stateRes[2]);
 #ifdef _DUMP_TRACKERS
-				DumpTracker(iGetStateTracker);
-				DumpTracker(iSetStateTracker);
+			if((r=DumpTracker(iGetStateTracker))!=KErrNone)
+				break;
+			if((r=DumpTracker(iSetStateTracker))!=KErrNone)
+				break;
 #endif
 				}
 			break;
@@ -2010,16 +2014,14 @@
 	return r;
 	}
 
+
 #ifdef _DUMP_TRACKERS
-void DChannelResManUs::DumpTracker(TTrackingControl* aTracker)
+TInt DChannelResManUs::DumpTracker(TTrackingControl* aTracker)
 	{
 	Kern::Printf("\nDChannelResManUs::DumpTracker");
 	Kern::Printf("Tracker at 0x%x\n",aTracker);
-	if(!aTracker)
-		{
-		Kern::Printf("Nothing to dump..");
-		return;
-		}
+	if(NULL==aTracker)
+		return KErrGeneral;
 	Kern::Printf("iType=%d",aTracker->iType);
 	switch(aTracker->iType)
 		{
@@ -2041,14 +2043,14 @@
 		buf=aTracker->iFreeQue->First();
 		while(buf!=aTracker->iFreeQue->Last())
 			{
-			Kern::Printf("iFreeQue first buffer at 0x%x\n",buf);
+			Kern::Printf("iFreeQue buffer at 0x%x\n",buf);
 			TAny* intermediatePtr = (TAny*)buf;
 			if((aTracker->iType == EGetState)||(aTracker->iType == ESetState))
 				{
-				TTrackSetStateBuf* tempBuf =(TTrackSetStateBuf*)intermediatePtr;
-				Kern::Printf("buffer control block at 0x%x\n",(TInt)&tempBuf->iCtrlBlock);
+				TTrackStateBuf* tempBuf =(TTrackStateBuf*)intermediatePtr;
+				Kern::Printf("buffer control block at 0x%x\n",tempBuf->iCtrlBlock);
 				}
-			buf = buf->iNext;
+			buf= buf->iNext;
 			};
 		}
 	Kern::Printf("iBusyQue at 0x%x\n",aTracker->iBusyQue);
@@ -2061,12 +2063,14 @@
 			TAny* intermediatePtr = (TAny*)buf;
 			if((aTracker->iType == EGetState)||(aTracker->iType == ESetState))
 				{
-				TTrackSetStateBuf* tempBuf =(TTrackSetStateBuf*)intermediatePtr;
-				Kern::Printf("buffer control block at 0x%x\n", (TInt)&tempBuf->iCtrlBlock);
+				TTrackStateBuf* tempBuf =(TTrackStateBuf*)intermediatePtr;
+				Kern::Printf("buffer control block at 0x%x\n",tempBuf->iCtrlBlock);
 				}
 			buf= buf->iNext;
 			};
 		}
+
+	return KErrNone;
 	}
 #endif
 
@@ -2161,11 +2165,13 @@
     __KTRACE_OPT(KRESMANAGER, Kern::Printf("DChannelResManUs::RemoveTrackingControl()"));
 
 	// Free the resource-tracking links and their respective queues
+	TAny* buf;
 	if(aTracker->iFreeQue!=NULL)
 		{
 		while(!aTracker->iFreeQue->IsEmpty())
 			{
-			delete aTracker->iFreeQue->GetFirst(); // Dequeues the element;
+			buf = (TAny*)(aTracker->iFreeQue->GetFirst()); // Dequeues the element
+			delete buf;
 			}
 		delete aTracker->iFreeQue;
 		}
@@ -2174,7 +2180,8 @@
 		{
 		while(!aTracker->iBusyQue->IsEmpty())
 			{
-			delete aTracker->iBusyQue->GetFirst(); // Dequeues the element;
+			buf = (TAny*)(aTracker->iBusyQue->GetFirst()); // Dequeues the element
+			delete buf;
 			}
 		delete aTracker->iBusyQue;
 		}
--- a/kernel/eka/drivers/resourceman/rescontrol_export.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/resourceman/rescontrol_export.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -12,7 +12,7 @@
 //
 // Description:
 // e32\drivers\resourceman\rescontrol_export.cpp
-//
+// 
 //
 
 #include <drivers/resourcecontrol.h>
@@ -55,7 +55,7 @@
 	if(!pRC)
 		return KErrNotFound;
 	pRC->Lock();
-    CHECK_CONTEXT(thread);
+    CHECK_CONTEXT(thread)
 	//Accept the postboot level only if issued before controller is fully initialised.
 	if(pRC->iInitialised == EResConStartupCompleted)
 		{
@@ -66,15 +66,15 @@
 #ifndef PRM_ENABLE_EXTENDED_VERSION
     // coverity[deref_ptr]
     // aResId is checked to be more than the array entries before dereferencing pRC->iStaticResourceArray
-	if((!aResId) || (aResId > (TUint)pRC->iStaticResourceArray.Count()) || (!pRC->iStaticResourceArray[aResId-1]))
+	if((!aResId) || (aResId > pRC->iStaticResourceArrayEntries) || (!pRC->iStaticResourceArray[aResId-1]))
 		{
 		pRC->UnLock();
 		LOCK_AND_CRITICAL_SECTION_COUNT_CHECK(thread)
 		return KErrNotFound;
 		}
 #else
-	if(!aResId || ((aResId & KIdMaskResourceWithDependencies) && ((aResId & ID_INDEX_BIT_MASK) > (TUint)pRC->iStaticResDependencyArray.Count())) 
-				|| (!(aResId & KIdMaskResourceWithDependencies) && ((aResId > (TUint)pRC->iStaticResourceArray.Count())
+	if(!aResId || ((aResId & KIdMaskResourceWithDependencies) && ((aResId & ID_INDEX_BIT_MASK) > pRC->iStaticResDependencyCount)) 
+				|| (!(aResId & KIdMaskResourceWithDependencies) && ((aResId > pRC->iStaticResourceArrayEntries)
 				|| (!pRC->iStaticResourceArray[aResId-1]))))
 		{
 		pRC->UnLock();
@@ -90,7 +90,7 @@
 		}
 	else
 #endif
-    if((TUint)pRC->iStaticResourceArray.Count() > aResId - 1)
+    if(pRC->iStaticResourceArray) 
 		{
 		DStaticPowerResource* pR=pRC->iStaticResourceArray[--aResId];
 		pR->iPostBootLevel=aLevel;
@@ -107,9 +107,7 @@
 	Kernel extensions or variants can call this API to register the static resources before resource controller
 	is fully initialised.
 	@Param aClientId             ID of the client that is requesting resource registration
-	@Param aStaticResourceArray  Static resources to register with RC.
-	                             Note, that in the special case, when aResCount equals to one, this parameter is treated as a pointer to the
-	                             DStaticPowerResource (DStaticPowerResource*). Otherwise - is the pointer to array of such pointers (DStaticPowerResource*).
+	@Param aStaticResourceArray  Static resources to register with RC. 
 	@Param aResCount             Number of static resources to register with RC. This equals the size of the passed array.
 	@return KErrNone, if operation is success
 	        KErrAccessDenied if clientId could not be found in the current list of registered clients or if this
@@ -129,7 +127,7 @@
 
 	if(!aStaticResourceArray || (aResCount == 0))
 		return KErrArgument;
-	CHECK_CONTEXT(thread);
+    CHECK_CONTEXT(thread)
 	//Accept the registration of static resource only if issued before controller is fully initialised.
 	if(pRC->iInitialised == EResConStartupCompleted)
 		{
@@ -141,10 +139,10 @@
 		return KErrNotSupported;
 		}
 #ifdef PRM_ENABLE_EXTENDED_VERSION
-	// if aResCount equals to 1 aStaticResourceArray contains not an array, but simply a pointer to the resource.
 	if(aResCount == 1)
 		{
-		if(((DStaticPowerResource*)aStaticResourceArray)->iResourceId & (KIdMaskResourceWithDependencies | KIdMaskDynamic))
+		if((((DStaticPowerResource*)aStaticResourceArray)->iResourceId & KIdMaskResourceWithDependencies) ||
+										(((DStaticPowerResource*)aStaticResourceArray)->iResourceId & KIdMaskDynamic))
 			{
 			return KErrNotSupported;
 			}
@@ -153,60 +151,56 @@
 		{
 		for(TUint rescount = 0; rescount < aResCount; rescount++)
 			{
-			if(aStaticResourceArray[rescount] &&
-			  (aStaticResourceArray[rescount]->iResourceId & (KIdMaskResourceWithDependencies | KIdMaskDynamic)))
+			if(aStaticResourceArray[rescount] && ((aStaticResourceArray[rescount]->iResourceId & KIdMaskResourceWithDependencies) || 
+				                          (aStaticResourceArray[rescount]->iResourceId & KIdMaskDynamic)))
 				{
 				return KErrNotSupported;
 				}
 			}
 		}
 #endif
-	SPowerResourceClient* pC = pRC->iClientList[(TUint16)(aClientId & ID_INDEX_BIT_MASK)];
-	if(!pC)
-		{
-		__KTRACE_OPT(KRESMANAGER, Kern::Printf("Client ID not Found"));
-		return KErrAccessDenied;
-		}
-	if(pC->iClientId != aClientId)
-		{
-		__KTRACE_OPT(KRESMANAGER, Kern::Printf("Client ID instance count does not match"));
-		return KErrAccessDenied;
+	SPowerResourceClient* pC = pRC->iClientList[(TUint16)(aClientId & ID_INDEX_BIT_MASK)];								
+	if(!pC)																										
+		{																										
+		__KTRACE_OPT(KRESMANAGER, Kern::Printf("Client ID not Found"));											
+		return KErrAccessDenied;																		
+		}																										
+	if(pC->iClientId != aClientId)				
+		{																										
+		__KTRACE_OPT(KRESMANAGER, Kern::Printf("Client ID instance count does not match"));						
+		return KErrAccessDenied;																		
+		}																										
+	if(pC->iClientId & CLIENT_THREAD_RELATIVE_BIT_MASK)															
+		{																										
+		if(pC->iThreadId != thread.iId)																				
+			{																									
+			__KTRACE_OPT(KRESMANAGER, Kern::Printf("Client not called from thread context(Thread Relative)"));	
+			return KErrAccessDenied;																	
+			}																									
 		}
-	if(pC->iClientId & CLIENT_THREAD_RELATIVE_BIT_MASK)
+ 
+    TInt r = Kern::SafeReAlloc((TAny*&)pRC->iStaticResourceArray, pRC->iStaticResourceArrayEntries*sizeof(DStaticPowerResource*), 
+		                                         (pRC->iStaticResourceArrayEntries + aResCount)*sizeof(DStaticPowerResource*));
+    if(r != KErrNone)
 		{
-		if(pC->iThreadId != thread.iId)
-			{
-			__KTRACE_OPT(KRESMANAGER, Kern::Printf("Client not called from thread context(Thread Relative)"));
-			return KErrAccessDenied;
-			}
+        return r;
 		}
-
-    TInt r = KErrNone;
 	if(aResCount == 1)
 		{
-		// if aResCount equals to one, threat the pointer as a pointer to resource
-		r = pRC->iStaticResourceArray.Append((DStaticPowerResource*)aStaticResourceArray);
-		// increment count of valid resources
-		if(r == KErrNone && aStaticResourceArray)
+		pRC->iStaticResourceArray[pRC->iStaticResourceArrayEntries++] = (DStaticPowerResource*)aStaticResourceArray;
+		if((DStaticPowerResource*)aStaticResourceArray)
 			pRC->iStaticResourceCount++;
 		}
 	else
 		{
 		for(TUint count = 0; count < aResCount; count++)
 			{
-			r = pRC->iStaticResourceArray.Append(aStaticResourceArray[count]);
-			if(r != KErrNone)
-				{
-				__KTRACE_OPT(KRESMANAGER, Kern::Printf("Could not add new static resources, r = %d", r));
-				break;
-				}
-			// increment count of valid resources
+			pRC->iStaticResourceArray[pRC->iStaticResourceArrayEntries++] = aStaticResourceArray[count];
 			if(aStaticResourceArray[count])
 				pRC->iStaticResourceCount++;
 			}
 		}
-
-	return r;
+    return KErrNone;
 	}
 
 /**
@@ -235,10 +229,6 @@
 	This function initialises the controller. 
 	@return KErrNone, if operation is success or one of the system wide errors.
 	*/
-RPointerArray <DStaticPowerResource> *StaticResourceArrayPtr;
-#ifdef PRM_ENABLE_EXTENDED_VERSION
-RPointerArray <DStaticPowerResourceD> *StaticResourceDependencyArrayPtr;
-#endif
 EXPORT_C TInt DPowerResourceController::InitController()
 	{
     __KTRACE_OPT(KRESMANAGER, Kern::Printf(">DPowerResourceController::InitController()"));
@@ -262,31 +252,13 @@
 	if(!pRC->iMsgQDependency)
 		return KErrNoMemory;
 #endif
-	// This method can be called in two situations - before the constructor of DPowerResourceController was called 
-	// for the second time (placement new in the extension psl entry macro) e.g. as a result of the call to InitResources() 
-	// from the variant::Init3() method) or after that.
-
-	// In order not to make any assumption on number of constructor invocations, a copy (binary) of the iStaticResourceArray object 
-	// is created below, so that it could be used to later restore the original iStaticResoureceArray object if the constructor
-	// was called after this method. The reason for that is, that in this destructor calls the default RPointerArrayBase()
-	// which resets the array, i.e. it looses the information, but allocated area and pointers still exist in the memory. 
-	// It is then valid to restore the object directly (which will copy all members, including iSize and iEntries pointers). 
-	// This temporary object will be deleted in DPowerResourceController::InitResources() at the last stage of initialization.
-	// (see also comments in DPowerResourceController::DPowerResourceController()) 
-
-	StaticResourceArrayPtr = new RPointerArray <DStaticPowerResource>;
-	if(!StaticResourceArrayPtr)
-		return KErrNoMemory;
-
-	r = pRC->DoRegisterStaticResources(pRC->iStaticResourceArray);
-	if(r != KErrNone)
+	// Call PSL to create all static resources and populate the iStaticResourceArray with pointers to resources and
+	// update static resource count
+    r=pRC->DoRegisterStaticResources(pRC->iStaticResourceArray, pRC->iStaticResourceArrayEntries);
+    if(r!=KErrNone)
 		return r;
-
-	// make a copy (see above comment)
-	*StaticResourceArrayPtr = pRC->iStaticResourceArray; 
-
-	// Get the actual number of static resource registered count
-	for(TInt resCnt = 0; resCnt < pRC->iStaticResourceArray.Count(); resCnt++)
+	//Get the actual number of static resource registered count
+	for(TInt resCnt = 0; resCnt < pRC->iStaticResourceArrayEntries; resCnt++)
 		{
 		if(pRC->iStaticResourceArray[resCnt])
 			pRC->iStaticResourceCount++;
@@ -297,7 +269,7 @@
 	DStaticPowerResource* pR = NULL;
 	TPowerResourceInfoBuf01 resInfo;
 	TPowerResourceInfoV01 *pResInfo;
-	for(TInt resCount = 0; resCount < pRC->iStaticResourceArray.Count(); resCount++)
+	for(TInt resCount = 0; resCount < pRC->iStaticResourceArrayEntries; resCount++)
 		{
 		pR = pRC->iStaticResourceArray[resCount];
 		if(!pR)
@@ -309,25 +281,16 @@
 #endif
 
 #ifdef PRM_ENABLE_EXTENDED_VERSION
-	StaticResourceDependencyArrayPtr = new RPointerArray <DStaticPowerResourceD>;
-	if(!StaticResourceDependencyArrayPtr)
-		return KErrNoMemory;
-
-	// Call PSL to register static resources with dependency if any exists
-	r = pRC->DoRegisterStaticResourcesDependency(pRC->iStaticResDependencyArray);
-
+	//Call PSL to register static resources with dependency if any exists
+	r = pRC->DoRegisterStaticResourcesDependency(pRC->iStaticResDependencyArray, pRC->iStaticResDependencyCount);
 	if(r != KErrNone)
 		return r;
-
-	// make a copy (see above comments for StaticResourceArrayPtr)
-	*StaticResourceDependencyArrayPtr = pRC->iStaticResDependencyArray;
-
-	if(pRC->iStaticResDependencyArray.Count())
+	if(pRC->iStaticResDependencyCount)
 		{
 		DStaticPowerResourceD* pRD = NULL;
 		TUint count;
 		//Assign resource index in resource id
-		for(count = 0; count < (TUint)pRC->iStaticResDependencyArray.Count(); count++)
+		for(count = 0; count < pRC->iStaticResDependencyCount; count++)
 			{
 			pRD = pRC->iStaticResDependencyArray[count];
 			if(!pRD)
@@ -335,7 +298,7 @@
 			pRD->iResourceId |= ((count + 1) & ID_INDEX_BIT_MASK);
 			}
 		//Check for dependency closed loops
-		for(count = 0; count < (TUint)pRC->iStaticResDependencyArray.Count(); count++)
+		for(count = 0; count < pRC->iStaticResDependencyCount; count++)
 			{
 			pRD = pRC->iStaticResDependencyArray[count];
 			if(!(pRD->iResourceId & KIdMaskStaticWithDependencies))
@@ -346,7 +309,7 @@
 			pRC->CheckForDependencyLoop(pRD, pRD->iResourceId, pRD->iResourceId);
 			}
 #ifdef PRM_INSTRUMENTATION_MACRO
-		for(count = 0; count < (TUint)pRC->iStaticResDependencyArray.Count(); count++)
+		for(count = 0; count < pRC->iStaticResDependencyCount; count++)
 			{
 			pR = pRC->iStaticResDependencyArray[count];
 			pR->GetInfo((TDes8*)resInfo.Ptr());
--- a/kernel/eka/drivers/resourceman/resourcecontrol.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/resourceman/resourcecontrol.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -12,7 +12,7 @@
 //
 // Description:
 // e32\drivers\resourceman\resourcecontrol.cpp
-//
+// 
 //
 
 #include <drivers/resourcecontrol.h>
@@ -313,44 +313,19 @@
     return PowerResourceController->GetInterface(aClientId, aFunction, aParam1, aParam2, aParam3);
     }
 
-/** Resource controller panic */
+/** Resouce controller panic */
 void DPowerResourceController::Panic(TUint8 aPanic)
 	{
 	Kern::Fault("Power Resource Controller", aPanic);
 	}
 
 /** Constructor for power controller. Creates message queue and generates ID for power controller to use. */
-extern RPointerArray <DStaticPowerResource> *StaticResourceArrayPtr;
-#ifdef PRM_ENABLE_EXTENDED_VERSION
-extern RPointerArray <DStaticPowerResourceD> *StaticResourceDependencyArrayPtr;
-#endif
 DPowerResourceController::DPowerResourceController()
 	{
-	__KTRACE_OPT(KRESMANAGER, Kern::Printf("DPowerResourceController::DPowerResouceController()"));
-	// Constructor is expected to invoke multiple times, i.e.: 
-	// during creation: variant init 0(KModuleEntryReasonVariantInit0) and later extension init 1 (KModuleEntryReasonExtensionInit1)
-	if(PowerResourceController)
-		{
-		// If InitController() was called in the Init3() static resource arrays were populated already and invocation of this 
-		// constructor has zeroed the dynamic pointer arrays (calling their default constructors). In such case we need to 
-		// restore these arrays from their temporary shadow copies (i.e. copies of RPointerArray objects, not their content)
-		// (See comments in RegisterStaticResources())
-		if(StaticResourceArrayPtr)
-			{
-			// by making a (binary) copy of RPointerArray object (compiler's auto-generated code)
-			// we are taking the ownership of content (pointers stored/owned by that array) of this temporary array
-			iStaticResourceArray = *StaticResourceArrayPtr;
-			}
-#ifdef PRM_ENABLE_EXTENDED_VERSION
-		// the same applies to static resources with dependencies for extended version.
-		// Temporary object are de-allocated in InitResources()
-		if(StaticResourceDependencyArrayPtr)
-			{
-			iStaticResDependencyArray = *StaticResourceDependencyArrayPtr;
-			}
-#endif
+    __KTRACE_OPT(KRESMANAGER, Kern::Printf("DPowerResourceController::DPowerResouceController()"));
+	//Constructor is expected to invoke multiple times (during creation, variant init 0 and extension init 1)
+	if(PowerResourceController) 
 		return;
-		}
     PowerResourceController = this;
 	iClientList.Initialise(0);
 	iUserSideClientList.Initialise(0);
@@ -361,6 +336,58 @@
 #endif
 	}
 
+/** Destructor for power controller. Frees the memory allocated in kernel heap. */
+DPowerResourceController::~DPowerResourceController()
+	{
+	__KTRACE_OPT(KRESMANAGER, Kern::Printf("DPowerResourceController::~DPowerResourceController()"));
+#ifdef RESOURCE_MANAGER_SIMULATED_PSL
+	iCleanList.ResetAndDestroy();
+#endif
+	iClientList.Delete();
+	iUserSideClientList.Delete();
+
+
+		
+#ifdef PRM_ENABLE_EXTENDED_VERSION
+	iDynamicResourceList.Delete();
+	iDynamicResDependencyList.Delete();
+#endif
+
+	SPowerResourceClientLevel *pCL = iClientLevelPool;
+	while(iClientLevelPool) //Find the starting position of array to delete
+		{
+		if(iClientLevelPool < pCL)
+			pCL = iClientLevelPool;
+		iClientLevelPool = iClientLevelPool->iNextInList;
+		}
+	//delete pCL;
+	delete []pCL;
+	SPowerRequest *pReq = iRequestPool;
+	while(iRequestPool) //Find the starting position of array to delete
+		{
+		if(iRequestPool < pReq)
+			pReq = iRequestPool;
+		iRequestPool = iRequestPool->iNext;
+		}
+	//delete pR
+	delete []pReq;
+#ifdef PRM_ENABLE_EXTENDED_VERSION
+	pCL = iResourceLevelPool;
+	while(iResourceLevelPool)
+		{
+		if(iResourceLevelPool < pCL)
+			pCL = iResourceLevelPool;
+		iResourceLevelPool = iResourceLevelPool->iNextInList;
+		}
+	//delete resource pool
+	delete []pCL;
+	//delete Message Queue dependency
+	delete iMsgQDependency;
+#endif
+	//delete Message Queue
+	delete iMsgQ;
+	}
+
 /** Send notificatins to clients registered for it for the specified resource. */
 void DPowerResourceController::CompleteNotifications(TInt aClientId, DStaticPowerResource* aResource, TInt aState, 
 													      TInt aReturnCode, TInt aLevelOwnerId, TBool aLock)
@@ -376,9 +403,6 @@
 		//If dyanmic resource is deregistering, send notification to all clients requested for it
 		if((pN->iCallback.iResourceId & KIdMaskDynamic) && (aClientId == KDynamicResourceDeRegistering))
 			{
-			pN->iCallback.iResult=aReturnCode;			
-			pN->iCallback.iMutex = iResourceMutex;
-			pN->iCallback.iPendingRequestCount++;
 			pN->iCallback.iResult = aReturnCode;
 			pN->iCallback.iLevel = aState;
 			pN->iCallback.iClientId = aClientId;
@@ -394,19 +418,14 @@
 				(pN->iDirection && ((pN->iPreviousLevel < pN->iThreshold) && (aState >= pN->iThreshold))) ||
 				(!pN->iDirection && ((pN->iPreviousLevel > pN->iThreshold) && (aState <= pN->iThreshold))))
 			{
-			pN->iCallback.iResult=aReturnCode;
-			pN->iCallback.iMutex = iResourceMutex;
-            pN->iCallback.iPendingRequestCount++;			
-			pN->iCallback.iLevel=aState;
-			pN->iCallback.iClientId = aClientId;
+            pN->iCallback.iResult=aReturnCode;
+            pN->iCallback.iLevel=aState;
+            pN->iCallback.iClientId = aClientId;
 			pN->iCallback.iLevelOwnerId = aLevelOwnerId;
-			
 			__KTRACE_OPT(KRESMANAGER, Kern::Printf("Notifications ClientId = 0x%x, ResourceId = %d, State = %d, Result = %d",
 										pN->iCallback.iClientId, pN->iCallback.iResourceId, aState, aReturnCode));
 			PRM_POSTNOTIFICATION_SENT_TRACE
-
-			pN->iCallback.Enque();
-
+            pN->iCallback.Enque();
 			}
 		pN->iPreviousLevel = aState; //Update the state
 		}
@@ -685,12 +704,10 @@
 		PRM_CLIENT_CHANGE_STATE_END_TRACE
 		}
 #endif
-	//Check whether callback is canceled and if not queue the DFC.
+	//Check whether callback is cancelled and if not queue the DFC.
     TPowerResourceCb* pCb = aReq->ResourceCb();
     if(pCb)
 		{
-        pCb->iMutex = pRC->iResourceMutex;
-        pCb->iPendingRequestCount++;    
         pCb->iResult=aReq->ReturnCode();
         pCb->iLevel=aReq->Level();
         pCb->iResourceId=aReq->ResourceId();
@@ -731,18 +748,10 @@
 		pC->iClientId = aReq->ClientId();
 		DDynamicPowerResourceD* pDRes;
 		if(aReq->ClientId() & KIdMaskDynamic)
-			pDRes = pRC->iDynamicResDependencyList[(aReq->ClientId() & ID_INDEX_BIT_MASK)];	
+			pDRes = pRC->iDynamicResDependencyList[(TUint16)(aReq->ClientId() & ID_INDEX_BIT_MASK)];	
 		else
 			pDRes = (DDynamicPowerResourceD*)pRC->iStaticResDependencyArray[(aReq->ClientId() & ID_INDEX_BIT_MASK) - 1];
-		
-		if (pDRes != NULL)
-		    {
-            pC->iName = pDRes->iName;
-		    }
-		else
-		    {
-            pC->iName = &KNullDesC;
-		    }
+		pC->iName = pDRes->iName;
 		}
 	else if((aReq->ClientId() == -1) || (aReq->ClientId() == KDynamicResourceDeRegistering))
 		{
@@ -768,12 +777,10 @@
 		PRM_CLIENT_CHANGE_STATE_END_TRACE
 		}
 #endif
-	//Check whether callback is canceled and if not queue the DFC.
+	//Check whether callback is cancelled and if not queue the DFC.
     TPowerResourceCb* pCb = aReq->ResourceCb();
     if(pCb)
 		{
-        pCb->iMutex = pRC->iResourceMutex;
-        pCb->iPendingRequestCount++;       
         pCb->iResult=aReq->ReturnCode();
         pCb->iLevel=aReq->Level();
         pCb->iResourceId=aReq->ResourceId();
@@ -837,13 +844,13 @@
 TInt DPowerResourceController::InitResources()
 	{
     __KTRACE_OPT(KRESMANAGER, Kern::Printf(">DPowerResourceController::InitResources()"));
-	TInt count;
+	TUint16 count;
 	//Create a Kernel client object for Power Controller
 	Lock();
 	SPowerResourceClient * pC = NULL;
 	// By now client pool should be created
 	LIST_POP(iClientPool, pC, iNextInList);
-	TInt growBy = iClientList.GrowBy();
+	TUint16 growBy = iClientList.GrowBy();
 	if(!pC)
 		{
 		UnLock();
@@ -881,15 +888,7 @@
 	iPowerControllerId = pC->iClientId;
     iClientCount++;
     if(TPowerController::PowerController())
-		{
-		if(TPowerController::PowerController()->RegisterResourceController(this, iPowerControllerId))
-			{
-#ifndef RESOURCE_MANAGER_SIMULATED_PSL
-			Panic(EControllerAlreadyExists);	//	Panic with this error for any error returned by RegisterResourceController
-#endif
-			}
-		}
-
+       TPowerController::PowerController()->RegisterResourceController(this, iPowerControllerId);
 	iInitialised =EResConStartupCompleted;
 	UnLock();
 	//Check the resource for postboot level and send notifications to clients registered for it.
@@ -897,7 +896,7 @@
 	TInt r;
 	TPowerRequest req = TPowerRequest::Get();
 	//For Static resource with no dependencies
-    for(count = 0; count < iStaticResourceArray.Count(); count++)
+    for(count = 0; count< iStaticResourceArrayEntries; count++)
 		{
 		pR = iStaticResourceArray[count];
 		if(pR && (pR->iFlags & SET_VALID_POST_BOOT_LEVEL))
@@ -920,7 +919,7 @@
 		}
 #ifdef PRM_ENABLE_EXTENDED_VERSION
 	//For Static resource with dependencies 
-	for(count = 0; count < iStaticResDependencyArray.Count(); count++)
+	for(count = 0; count < iStaticResDependencyCount; count++)
 		{
 		pR = iStaticResDependencyArray[count];
 		if(pR->iFlags & SET_VALID_POST_BOOT_LEVEL)
@@ -937,21 +936,6 @@
 			}
 		}
 #endif
-	
-	// delete the temporary copy of static resource array used during initialization.
-	if(StaticResourceArrayPtr)
-		{
-		delete StaticResourceArrayPtr;
-		StaticResourceArrayPtr = NULL;
-		}
-#ifdef PRM_ENABLE_EXTENDED_VERSION
-	// the same applies to dependency resources array for extended version.
-	if(StaticResourceDependencyArrayPtr)
-		{
-		delete StaticResourceDependencyArrayPtr;
-		StaticResourceDependencyArrayPtr = NULL;
-		}
-#endif
 	__KTRACE_OPT(KRESMANAGER, Kern::Printf("<DPowerResourceController::InitResources()"));
     return KErrNone;
 	}
@@ -1265,9 +1249,9 @@
 		}
 #ifdef PRM_ENABLE_EXTENDED_VERSION
 	SPowerResourceClientLevel* pRL = NULL;
-	if(iStaticResDependencyArray.Count())
+	if(iStaticResDependencyCount)
 		{
-		pRL = new SPowerResourceClientLevel[iStaticResDependencyArray.Count()];
+		pRL = new SPowerResourceClientLevel[iStaticResDependencyCount];
 		if(!pRL)
 			{
 			__KTRACE_OPT(KRESMANAGER, Kern::Printf("Resource level Pool Allocation Failed"));
@@ -1283,12 +1267,12 @@
 	iCleanList.Append(pC);
 #endif
 	Lock();
-	TInt c;
-	for(c = 0; c < iStaticResDependencyArray.Count(); c++)
+	TUint16 c;
+	for(c = 0; c < iStaticResDependencyCount; c++)
 		{
 		LIST_PUSH(iResourceLevelPool, &pRL[c], iNextInList);
 		}
-	iResourceLevelPoolCount = (TUint16)iStaticResDependencyArray.Count();
+	iResourceLevelPoolCount = iStaticResDependencyCount;
 #else
 #ifdef RESOURCE_MANAGER_SIMULATED_PSL
     iCleanList.Append(pC);
@@ -1297,7 +1281,7 @@
     TUint16 c;
 #endif
     // Create Client pool list
-    for(c = 0; c < TUint16(aKClients + aUClients); c++)
+    for(c = 0; c< (aKClients + aUClients); c++)
 		{
         LIST_PUSH(iClientPool, &pC[c], iNextInList);
 		}
@@ -1383,7 +1367,7 @@
 	req->SendReceive(iMsgQ);
 	if(req->ReturnCode() == KErrNone)
 		{
-		pC = iClientList[(req->ClientId() & ID_INDEX_BIT_MASK)];
+		pC = iClientList[(TUint16)(req->ClientId() & ID_INDEX_BIT_MASK)];
 		if(aType == EOwnerThread)
 			{
 			pC->iClientId |= CLIENT_THREAD_RELATIVE_BIT_MASK; //Set 31st bit;
@@ -1392,9 +1376,9 @@
 			}
 		pC->iName = &aName;
 		aClientId = pC->iClientId;
-	    PRM_CLIENT_REGISTER_TRACE
-	    __KTRACE_OPT(KRESMANAGER, Kern::Printf(">DPowerResourceController::RegisterClient, clientId = 0x%x", aClientId));
 		}
+    PRM_CLIENT_REGISTER_TRACE
+	__KTRACE_OPT(KRESMANAGER, Kern::Printf(">DPowerResourceController::RegisterClient, clientId = 0x%x", aClientId));
 	return(req->ReturnCode());
 	}
 
@@ -1432,7 +1416,7 @@
 		//Get Next client from FreePool
 		LIST_POP(iClientPool, pC, iNextInList);
 
-		TInt growBy = iClientList.GrowBy();
+		TUint16 growBy = iClientList.GrowBy();
 		if(!pC)
 			{
 			//Free Pool is empty, so try to grow the pool.
@@ -1477,7 +1461,7 @@
 		{
 		//Get Next client from FreePool
 		LIST_POP(iClientPool, pC, iNextInList);
-		TInt growBy = iUserSideClientList.GrowBy();
+		TUint16 growBy = iUserSideClientList.GrowBy();
 		if(!pC)
 			{
 			//Free Pool is empty, so try to grow the pool.
@@ -1490,7 +1474,7 @@
 			iCleanList.Append(pCL);
 #endif
 			Lock();
-			TInt count;
+			TUint16 count;
 			for(count = 0; count < growBy - 1; count++)
 				LIST_PUSH(iClientPool, &pCL[count], iNextInList);
 			UnLock();
@@ -1556,29 +1540,29 @@
 		{
         __KTRACE_OPT(KRESMANAGER, Kern::Printf("Client 0x%x has requirement on resource %d", pCL->iClientId, pCL->iResourceId));
 #ifdef PRM_ENABLE_EXTENDED_VERSION
-		switch((pCL->iResourceId >>RESOURCE_BIT_IN_ID_CHECK) & 0x3)
-			{
-			case PRM_STATIC_RESOURCE:
-			pR = iStaticResourceArray[pCL->iResourceId - 1];
-				break;
-			case PRM_DYNAMIC_RESOURCE:
-			pR = (iDynamicResourceList[(pCL->iResourceId & ID_INDEX_BIT_MASK)]);
-				break;
-			case PRM_STATIC_DEPENDENCY_RESOURCE:
-			pR = (iStaticResDependencyArray[(pCL->iResourceId & ID_INDEX_BIT_MASK) - 1]);
-				break;
-			case PRM_DYNAMIC_DEPENDENCY_RESOURCE:
-			pR = (iDynamicResDependencyList[(pCL->iResourceId & ID_INDEX_BIT_MASK)]);
-				break;
-			}
+		switch((pCL->iResourceId >>RESOURCE_BIT_IN_ID_CHECK) & 0x3)													
+		{																		
+		case PRM_STATIC_RESOURCE:												
+			pR = iStaticResourceArray[pCL->iResourceId - 1];								
+			break;																
+		case PRM_DYNAMIC_RESOURCE:												
+			pR = (iDynamicResourceList[(TUint16)(pCL->iResourceId & ID_INDEX_BIT_MASK)]);			
+			break;																
+		case PRM_STATIC_DEPENDENCY_RESOURCE:									
+			pR = (iStaticResDependencyArray[(TUint16)(pCL->iResourceId & ID_INDEX_BIT_MASK) - 1]);						
+			break;																
+		case PRM_DYNAMIC_DEPENDENCY_RESOURCE:									
+			pR = (iDynamicResDependencyList[(TUint16)(pCL->iResourceId & ID_INDEX_BIT_MASK)]);		
+			break;																
+		}
 #else
-		pR = iStaticResourceArray[pCL->iResourceId - 1];
+		pR = iStaticResourceArray[pCL->iResourceId -1];
 #endif
 #ifdef PRM_ENABLE_EXTENDED_VERSION
-		if(pR  &&  (((pR->Sense() == DStaticPowerResource::ECustom) || ((TInt)pCL->iClientId == pR->iLevelOwnerId)) && (!(pCL->iResourceId & KIdMaskDynamic) ||
-			         ((pCL->iResourceId & KIdMaskDynamic) && (((DDynamicPowerResource*)pR)->LockCount() != 0)))))
+		if(((pR->Sense() == DStaticPowerResource::ECustom) || ((TInt)pCL->iClientId == pR->iLevelOwnerId)) && (!(pCL->iResourceId & KIdMaskDynamic) ||
+			         ((pCL->iResourceId & KIdMaskDynamic) && (((DDynamicPowerResource*)pR)->LockCount() != 0))))
 #else
-		if(pR  &&  ((pR->Sense() == DStaticPowerResource::ECustom) || ((TInt)pCL->iClientId == pR->iLevelOwnerId))) 
+		if((pR->Sense() == DStaticPowerResource::ECustom) || ((TInt)pCL->iClientId == pR->iLevelOwnerId)) 
 #endif
 		    {
             pReq->ReqType() = TPowerRequest::ESetDefaultLevel;
@@ -1697,7 +1681,7 @@
 		return KErrArgument;
 	//Get the index from client ID
 	Lock();
-	SPowerResourceClient* pC = iClientList[(aClientId & ID_INDEX_BIT_MASK)];
+	SPowerResourceClient* pC = iClientList[(TUint16)(aClientId & ID_INDEX_BIT_MASK)];
     if(!pC)
 	    {
         __KTRACE_OPT(KRESMANAGER, Kern::Printf("Client ID not Found"));
@@ -1741,7 +1725,7 @@
 	iRequestPoolCount = (TUint16)(iRequestPoolCount + (TUint16)pC->iReservedRm);
 	PRM_CLIENT_DEREGISTER_TRACE
 	//Increment the free pool count for client level and request level.
-	iClientList.Remove(pC, (pC->iClientId & ID_INDEX_BIT_MASK));
+	iClientList.Remove(pC, (TUint16)(pC->iClientId & ID_INDEX_BIT_MASK));
 	pC->iName = NULL;
 	iClientCount--; //Decrement client count
 	LIST_PUSH(iClientPool, pC, iNextInList);
@@ -1878,9 +1862,9 @@
 		return KErrTooBig;
 	Lock();
 	VALIDATE_CLIENT(thread);
-	TInt count = 0;
+	TUint count = 0;
 	//Search in static resource with no dependencies array for specified resource name.
-	for(count = 0; count < iStaticResourceArray.Count(); count++)
+	for(count = 0; count < iStaticResourceArrayEntries; count++)
 		{
 		if((iStaticResourceArray[count]) && (!(aResourceName.Compare(*(const TDesC8*)iStaticResourceArray[count]->iName))))
 			{
@@ -1900,7 +1884,7 @@
 		UNLOCK_RETURN(KErrNone);
 		}
 	//Search in static resource with dependencies (if exists) for specified resource name
-	for(count = 0; count < iStaticResDependencyArray.Count(); count++)
+	for(count = 0; count < iStaticResDependencyCount; count++)
 		{
 		if(!(aResourceName.Compare(*(const TDesC8*)iStaticResDependencyArray[count]->iName)))
 			{
@@ -1969,7 +1953,7 @@
 	   UNLOCK_RETURN(KErrArgument);
 
 #ifndef PRM_ENABLE_EXTENDED_VERSION
-	if((!aResourceId) || (aResourceId > (TUint)iStaticResourceArray.Count()))
+	if((!aResourceId) || (aResourceId > iStaticResourceArrayEntries))
 		UNLOCK_RETURN(KErrNotFound);
 	//Get resource from static resource array. 0(1) operation.
 	pR = iStaticResourceArray[aResourceId-1];
@@ -2040,7 +2024,7 @@
 	if(!aTargetClientId)
 		{
 #ifdef PRM_ENABLE_EXTENDED_VERSION
-		aNumResource = iStaticResourceCount + iDynamicResourceCount + iStaticResDependencyArray.Count() + 
+		aNumResource = iStaticResourceCount + iDynamicResourceCount + iStaticResDependencyCount + 
 			                                                          iDynamicResDependencyCount; 
 #else
 		aNumResource = iStaticResourceCount;
@@ -2119,22 +2103,22 @@
          UNLOCK_RETURN(KErrArgument);
     TPowerResourceInfoBuf01 buf;
 
-	TInt count = 0;
+	TUint16 count = 0;
 	TInt r = KErrNone;
 	//Special case, if aTargetClientId is 0 fill with all the resource
 	if(!aTargetClientId)
 		{
-		TInt numResources = aNumResources;
+		TUint numResources = aNumResources;
 #ifndef PRM_ENABLE_EXTENDED_VERSION
 		aNumResources = iStaticResourceCount;
 #else
-		aNumResources = iStaticResourceCount + iDynamicResourceCount + iStaticResDependencyArray.Count() + 
+		aNumResources = iStaticResourceCount + iDynamicResourceCount + iStaticResDependencyCount + 
 			                                                           iDynamicResDependencyCount;
 #endif
 		UnLock();
-		while(count < iStaticResourceArray.Count())
+		while(count < iStaticResourceArrayEntries)
 			{
-			if(numResources == 0)
+			if(numResources <=0)
 				return KErrNone;
 			pR = iStaticResourceArray[count++];
 			if(!pR)
@@ -2149,7 +2133,7 @@
 			}	
 #ifdef PRM_ENABLE_EXTENDED_VERSION
 		count = 0;
-		while(count < iStaticResDependencyArray.Count())
+		while(count < iStaticResDependencyCount)
 			{
 			if(count >= numResources)
 				return KErrNone;
@@ -2161,11 +2145,11 @@
 				return r;
 			pInfo->Append(buf);
 			}
-		numResources -= iStaticResDependencyArray.Count();
+		numResources -= iStaticResDependencyCount;
 		if((!numResources) || (!iDynamicResourceCount && !iDynamicResDependencyCount))
 			return r;
 		Lock();
-		TInt resCount = 0;
+		TUint resCount = 0;
 		for(count = 0; count < iDynamicResourceList.Allocd(); count++)
 			{
 			pR = iDynamicResourceList[count];
@@ -2182,7 +2166,7 @@
 			}
 		numResources -= resCount;
 		resCount = 0;
-		for(count = 0; count < (TInt)iDynamicResDependencyList.Allocd(); count++) 
+		for(count = 0; count < iDynamicResDependencyList.Allocd(); count++) 
 			{
 			pR = iDynamicResDependencyList[count];
 			if(!pR)
@@ -2204,7 +2188,7 @@
 	SPowerResourceClientLevel* pCL = pC->iLevelList;
 	for (count= 0; pCL; count++, pCL = pCL->iNextInList)
 		{
-		if(count >= (TInt)aNumResources)
+		if(count >= aNumResources)
 			continue;
 #ifndef PRM_ENABLE_EXTENDED_VERSION
 		pR = iStaticResourceArray[pCL->iResourceId-1];
@@ -2271,7 +2255,7 @@
 	DStaticPowerResource* pR = NULL;
 	GET_RESOURCE_FROM_LIST(aResourceId, pR) 
 #else
-	if(aResourceId > (TUint)iStaticResourceArray.Count())
+	if(aResourceId > iStaticResourceArrayEntries)
 		UNLOCK_RETURN(KErrNotFound);
 	DStaticPowerResource* pR = iStaticResourceArray[aResourceId-1];
 	if(!pR)
@@ -2375,7 +2359,7 @@
 	DStaticPowerResource* pR = NULL;
 	GET_RESOURCE_FROM_LIST(aResourceId, pR) 
 #else
-	if(aResourceId > (TUint)iStaticResourceArray.Count())
+	if(aResourceId > iStaticResourceArrayEntries)
 		UNLOCK_RETURN(KErrNotFound);
 	DStaticPowerResource* pR = iStaticResourceArray[aResourceId-1];
 	if(!pR)
@@ -2389,9 +2373,9 @@
 			continue;
 		pCL = (SPowerResourceClientLevel*)pRC;
 		if(pCL->iClientId & USER_SIDE_CLIENT_BIT_MASK)
-			pC = iUserSideClientList[(pCL->iClientId & ID_INDEX_BIT_MASK)];
+			pC = iUserSideClientList[(TUint16)(pCL->iClientId & ID_INDEX_BIT_MASK)];
 		else
-			pC = iClientList[(pCL->iClientId & ID_INDEX_BIT_MASK)];
+			pC = iClientList[(TUint16)(pCL->iClientId & ID_INDEX_BIT_MASK)];
 		info.iClientId = pC->iClientId;
 		info.iClientName =  (TDesC8*)pC->iName;
         pInfo->Append(TPckgC<TPowerClientInfoV01>(info));
@@ -2409,7 +2393,7 @@
 NOTE: If a resource callback is specified for instantaneous resource, then callback
       will be called after resource change and will be executed in the context of the
       client thread.
-      If a resource callback is specified for long latency resources, then it will be
+      If a resource callback is specified for long latency reosurces, then it will be
       executed asynchronously.When the request is accepted the API returns immediately
 	  and the calling thread is unblocked: the callback (called in the client's context) 
 	  will be invoked when the resource change finally takes place.
@@ -2428,7 +2412,7 @@
 @param aCb         For Long latency resource
                        A pointer to a resource callback object which encapsulates a
                        callback function to be called whenever the resource state change
-                       happens (if left NULL the API will execute synchronously).
+                       happens (if left NULL the API will execute synchrounously).
                    For Instantaneous resource
                        A pointer to a resource callback object which encapsulates a callback
                        function to be called after resource change. This executes in the
@@ -2483,7 +2467,7 @@
 	DStaticPowerResource *pR = NULL;
 	GET_RESOURCE_FROM_LIST(aResourceId, pR) 
 #else
-	if(aResourceId > (TUint)iStaticResourceArray.Count())
+	if(aResourceId > iStaticResourceArrayEntries)
 		UNLOCK_RETURN(KErrNotFound);
 	DStaticPowerResource* pR = iStaticResourceArray[aResourceId-1];
 	if(!pR)
@@ -2491,29 +2475,8 @@
 #endif
 	//Return if the resource is already in that state and client is also the same.
 	if((aNewState == pR->iCachedLevel) && ((TInt)aClientId == pR->iLevelOwnerId))
-		{
-		if(aCb)
-			{
-			//Invoke callback function
-            TUint ClientId = aClientId;
-            TUint ResourceId = aResourceId;
-            TInt Level = aNewState;
-            TInt LevelOwnerId = pR->iLevelOwnerId;
-            TInt Result = KErrNone;
-            TAny* Param = aCb->iParam;
-            aCb->iPendingRequestCount++;
-            UnLock();
-            // Call the client specified callback function
-            aCb->iCallback(ClientId, ResourceId, Level, LevelOwnerId, Result, Param);   
-            Lock();
-            aCb->iPendingRequestCount--;
-            if(aCb->iPendingRequestCount == 0)
-                {
-                aCb->iResult = KErrCompletion;
-                }
-			}
-        UNLOCK_RETURN(KErrNone);
-		}
+		UNLOCK_RETURN(KErrNone);
+
 	
 	PRM_CLIENT_CHANGE_STATE_START_TRACE
 	//If long latency resource requested synchronously from DFC thread 0 Panic
@@ -2567,8 +2530,8 @@
 	SPowerRequest* pS=NULL;
 	if(pR->LatencySet() && aCb)
 		{
-		// Get request object from free pool, as it is long latency resource as client
-		// will be unblocked once message is sent to controller, so can't use thread message.
+		// Get request object from free pool, as it is long latency reosurce as client
+		// will be unblocked once message is sent to controller, so cant use thread message.
 		if(pC->iReservedRm ==0 && !iRequestPoolCount)
 			{
             r = KErrUnderflow;
@@ -2621,7 +2584,7 @@
 			else
 #endif
 				{
-				req->Send(iMsgQ); // Send the request to Resource Controller thread.
+				req->Send(iMsgQ); // Send the request to Resource Controler thread.
 				return KErrNone;
 				}
 			}
@@ -2653,29 +2616,16 @@
 		    if(aResourceId & KIdMaskDynamic)
 				((DDynamicPowerResource*)pR)->UnLock();
 #endif
+			UnLock();
 			if(aCb)
 				{
-                //Invoke callback function
-                TUint ClientId = req->ClientId();
-                TUint ResourceId = aResourceId;
-                TInt Level = req->Level();
-                TInt LevelOwnerId = pR->iLevelOwnerId;
-                TInt Result = r;
-                TAny* Param = aCb->iParam;
-                aCb->iPendingRequestCount++;
-                UnLock();
-                // Call the client specified callback function
-                aCb->iCallback(ClientId, ResourceId, Level, LevelOwnerId, Result, Param);   
-                Lock();
-                aCb->iPendingRequestCount--;
-                if(aCb->iPendingRequestCount == 0)
-                    {
-                    aCb->iResult = KErrCompletion;
-                    }
-                }
-
+				//Invoke callback function
+				aCb->iCallback(req->ClientId(), aResourceId, req->Level(), pR->iLevelOwnerId, r, aCb->iParam);
+				//Mark the callback object to act properly during cancellation of this request.
+				aCb->iResult = KErrCompletion; 
+				}
 			PRM_CLIENT_CHANGE_STATE_END_TRACE
-			UNLOCK_RETURN(r);
+			return(r);
 			}
 		}
 	else if(pR->iLevelOwnerId == -1)
@@ -2734,29 +2684,16 @@
 	if(aResourceId & KIdMaskDynamic)
 		((DDynamicPowerResource*)pR)->UnLock();
 #endif
+	UnLock();
 	if(aCb)
 		{
-        //Invoke callback function
-        TUint ClientId = req->ClientId();
-        TUint ResourceId = aResourceId;
-        TInt Level = req->Level();
-        TInt LevelOwnerId = pR->iLevelOwnerId;
-        TInt Result = r;
-        TAny* Param = aCb->iParam;
-        aCb->iPendingRequestCount++;
-        UnLock();
-        // Call the client specified callback function
-        aCb->iCallback(ClientId, ResourceId, Level, LevelOwnerId, Result, Param);   
-        Lock();
-        aCb->iPendingRequestCount--;
-        if(aCb->iPendingRequestCount == 0)
-            {
-            aCb->iResult = KErrCompletion;
-            }
+		//Invoke callback function
+		aCb->iCallback(req->ClientId(), aResourceId, req->Level(), pR->iLevelOwnerId, r, aCb->iParam);
+		aCb->iResult = KErrCompletion; //Mark the callback object to act properly during cancellation of this request.
 		}
 	__KTRACE_OPT(KRESMANAGER, Kern::Printf(">DPowerResourceController::ChangeResourceState, Level = %d", req->Level()));
     PRM_CLIENT_CHANGE_STATE_END_TRACE
-    UNLOCK_RETURN(r);
+    return r;
 	}
 
 /**
@@ -2772,7 +2709,7 @@
                    state is read from resource.
 @param aState      Returns the resource state if operation was successful. This
                    could be a binary value for a binary resource, an integer level
-                   for a multilevel resource or some platform specific token for a
+                   for a multilevel resource or some platform specific tolen for a
                    multi-property resource.
 @param aLevelOwnerId Returns the Id of the client that is currently holding the resource.
 					 -1	is returned when no client is holding the resource.
@@ -2819,7 +2756,7 @@
 			UNLOCK_RETURN(KErrNotFound);
 		}
 #else
-	if(aResourceId > (TUint)iStaticResourceArray.Count())
+	if(aResourceId > iStaticResourceArrayEntries)
 		UNLOCK_RETURN(KErrNotFound);
 	DStaticPowerResource *pR = iStaticResourceArray[aResourceId-1];
 	if(!pR)
@@ -2903,7 +2840,7 @@
 @publishedPartner
 @prototype 9.5
 
-Request the state of the resource asynchronously for long latency resource and
+Request the state of the resource asynchrounously for long latency resource and
 synchronously for instantaneous resource
 
 @param aClientId  ID of the client which is requesting the resource state.
@@ -2965,7 +2902,7 @@
 			UNLOCK_RETURN(KErrNotFound);
 		}
 #else
-	if(aResourceId > (TUint)iStaticResourceArray.Count())
+	if(aResourceId > iStaticResourceArrayEntries)
 		UNLOCK_RETURN(KErrNotFound);
 	DStaticPowerResource *pR = iStaticResourceArray[aResourceId-1];
 	if(!pR)
@@ -2978,28 +2915,14 @@
 	PRM_RESOURCE_GET_STATE_START_TRACE
 	if(aCached) //Call the callback directly
 		{
-        //Invoke callback function
-        TUint ClientId = aClientId;
-        TUint ResourceId = aResourceId;
-        TInt Level = pR->iCachedLevel;
-        TInt LevelOwnerId = pR->iLevelOwnerId;
-        TInt Result = KErrNone;
-        TAny* Param = aCb.iParam;
-        aCb.iPendingRequestCount++;
-        UnLock();
-        // Call the client specified callback function
-        aCb.iCallback(ClientId, ResourceId, Level, LevelOwnerId, Result, Param);   
-        Lock();
-        aCb.iPendingRequestCount--;
-        if(aCb.iPendingRequestCount == 0)
-            {
-            aCb.iResult = KErrCompletion; //Mark the callback object to act properly during cancellation of this request.
-            }
+		UnLock();
+		aCb.iCallback(aClientId, aResourceId, pR->iCachedLevel, pR->iLevelOwnerId, KErrNone, aCb.iParam);
+		aCb.iResult = KErrCompletion; //Mark the callback object to act properly during cancellation of this request.
 #ifdef PRM_INSTRUMENTATION_MACRO
 		TInt aState = pR->iCachedLevel;
         PRM_RESOURCE_GET_STATE_END_TRACE
 #endif
-		UNLOCK_RETURN(KErrNone);
+		return(KErrNone);
 		}
 	TPowerRequest* req=NULL;
 	if(pR->LatencyGet())
@@ -3064,25 +2987,10 @@
 		if(aResourceId & KIdMaskDynamic)
 			((DDynamicPowerResource*)pR)->UnLock();
 #endif
-
-        //Invoke callback function
-        TUint ClientId = aClientId;
-        TUint ResourceId = aResourceId;
-        TInt Level = req->Level();
-        TInt LevelOwnerId = pR->iLevelOwnerId;
-        TInt Result = r;
-        TAny* Param = aCb.iParam;
-        aCb.iPendingRequestCount++;
-        UnLock();
-        // Call the client specified callback function
-        aCb.iCallback(ClientId, ResourceId, Level, LevelOwnerId, Result, Param);   
-        Lock();
-        aCb.iPendingRequestCount--;
-        if(aCb.iPendingRequestCount == 0)
-            {
-            aCb.iResult = KErrCompletion; //Mark the callback object to act properly during cancellation of this request.
-            }       
-        UnLock(); 
+		UnLock();
+		// Call the client callback function directly as it is already executing in the context of client thread.
+		aCb.iCallback(aClientId, aResourceId, req->Level(), pR->iLevelOwnerId, r, aCb.iParam);
+		aCb.iResult = KErrCompletion; //Mark the callback object to act properly during cancellation of this request.
 		}
 	__KTRACE_OPT(KRESMANAGER, Kern::Printf(">DPowerResourceController::GetResourceState(asynchronous), Level = %d", req->Level()));
 	if(pR->LatencyGet())
@@ -3102,19 +3010,19 @@
 Cancel an asynchronous request(or its callback).
 
 @param aClientId       ID of the client which is requesting the cancellation of the request.
-@param aResourceId     ID for the resource which the request that is being canceled operates
+@param aResourceId     ID for the resource which the request that is being cancelled operates
                        upon.
 @param aCb             A reference to the resource callback object specified with the request
-                       that is being canceled.
+                       that is being cancelled.
 
-@return KErrCancel if the request was canceled.
+@return KErrCancel if the request was cancelled.
         KErrNotFound if this resource ID could not be found in the current list of controllable
                      resources.
         KErrCompletion if request is no longer pending.
         KErrAccessDenied if the client ID could not be found in the current list of registered
 		clients or if the client was registered to be thread relative and this API is not called
 		from the same thread or if client is not the same that requested the resource state change.
-		KErrInUse if the request cannot be canceled as processing of the request already started 
+		KErrInUse if the request cannot be cancelled as processing of the request already started 
 		and will run to completion. 
 
 @pre Interrupts must be enabled
@@ -3234,7 +3142,7 @@
 NOTE: This API should return immediately; however the notification will
 only happen when a resource change occurs.Notification request is idempotent, 
 if the same notification has already been requested for this resource ID, 
-the API returns with no further action.Notifications remain queued until they are canceled.
+the API returns with no further action.Notifications remain queued until they are cancelled.
 
 @pre Interrupts must be enabled
 @pre Kernel must be unlocked
@@ -3262,7 +3170,7 @@
 	DStaticPowerResource *pR = NULL;
 	GET_RESOURCE_FROM_LIST(aResourceId, pR)
 #else
-	if(aResourceId > (TUint)iStaticResourceArray.Count())
+	if(aResourceId > iStaticResourceArrayEntries)
 		{
         r = KErrNotFound;
 		PRM_POSTNOTIFICATION_REGISTER_TRACE
@@ -3326,7 +3234,7 @@
 
 @return KErrNone if the operation of requesting a notification was successful.
         KErrNotFound if this resource ID could not be found in the current list
-                     of controllable resources.
+                     of controllable reosurces.
         KErrAccessDenied if the client ID could not be found in the list of
                          registered clients or if the client was registered to be thread
 						 relative and this API is not called from the same thread. 
@@ -3335,7 +3243,7 @@
 NOTE: This API should return immediately; however the notification will only
 happen when a resource change occurs. Notification request is idempotent, 
 if the same notification has already been requested for this resource ID, 
-the API returns with no further action. Notification remain queued until they are canceled.
+the API returns with no further action. Notification remain queued until they are cancelled.
 
 @pre Interrupts must be enabled
 @pre Kernel must be unlocked
@@ -3365,7 +3273,7 @@
 	DStaticPowerResource *pR = NULL;
 	GET_RESOURCE_FROM_LIST(aResourceId, pR)
 #else
-	if(aResourceId > (TUint)iStaticResourceArray.Count())
+	if(aResourceId > iStaticResourceArrayEntries)
 		{
         r = KErrNotFound;
         PRM_POSTNOTIFICATION_REGISTER_TRACE
@@ -3429,12 +3337,12 @@
 
 @param aClientId ID of the client which is requesting to cancel the notification
 @param aResourceId for the resource whose pending notification of state changes
-                   is being canceled.
+                   is being cancelled.
 @param aN          A reference to the notification object that was associated with
-                   the notification request that is being canceled. This will be
-                   used to identify the notification that is being canceled.
+                   the notification request that is being cancelled. This will be
+                   used to identify the notification that is being cancelled.
 
-@return KErrCancel if the notification request was successfully canceled.
+@return KErrCancel if the notification request was successfully cancelled.
         KErrNotFound if the specified notification object is 
 					 not found in the current list of notification objects for the 
 					 specified resource.
@@ -3588,9 +3496,9 @@
 	TInt requestPoolCount = iRequestPoolCount;
 	SPowerResourceClient* pC;
 	if(aRequest.ClientId() & USER_SIDE_CLIENT_BIT_MASK)
-		pC = iUserSideClientList[(aRequest.ClientId() & ID_INDEX_BIT_MASK)];
+		pC = iUserSideClientList[(TUint16)(aRequest.ClientId() & ID_INDEX_BIT_MASK)];
 	else																				
-		pC = iClientList[(aRequest.ClientId() & ID_INDEX_BIT_MASK)];
+		pC = iClientList[(TUint16)(aRequest.ClientId() & ID_INDEX_BIT_MASK)];
 	UnLock();
 
 	if(clientPoolCount < aRequest.ClientLevelCount())
@@ -3689,14 +3597,14 @@
 	req->SendReceive(iMsgQ);
 	if(req->ReturnCode() == KErrNone)
 		{
-		pC = iUserSideClientList[(req->ClientId() & ID_INDEX_BIT_MASK)];
+		pC = iUserSideClientList[(TUint16)(req->ClientId() & ID_INDEX_BIT_MASK)];
 		pC->iName=&aName;
 		//Store the current thread Id;
 		pC->iThreadId = t.iId;
 		aClientId = pC->iClientId;
-	    __KTRACE_OPT(KRESMANAGER, Kern::Printf(">DPowerResourceController::RegisterProxyClient, clientId = 0x%x", aClientId));
-	    PRM_CLIENT_REGISTER_TRACE
 		}
+	__KTRACE_OPT(KRESMANAGER, Kern::Printf(">DPowerResourceController::RegisterProxyClient, clientId = 0x%x", aClientId));
+    PRM_CLIENT_REGISTER_TRACE
 	LOCK_AND_CRITICAL_SECTION_COUNT_CHECK
 	return KErrNone;
 	}
@@ -3714,7 +3622,7 @@
 	if(!(aClientId & USER_SIDE_CLIENT_BIT_MASK))
 		return KErrArgument;
 	Lock();
-	SPowerResourceClient* pC = iUserSideClientList[(aClientId & ID_INDEX_BIT_MASK)];
+	SPowerResourceClient* pC = iUserSideClientList[(TUint16)(aClientId & ID_INDEX_BIT_MASK)];
 	if(!pC)
 		{
 		UnLock();
@@ -3762,7 +3670,7 @@
 	iRequestPoolCount = (TUint16)(iRequestPoolCount + pC->iReservedRm);
 	PRM_CLIENT_DEREGISTER_TRACE
 	//Increment the free pool count for client level and request level.
-	iUserSideClientList.Remove(pC, (pC->iClientId & ID_INDEX_BIT_MASK));
+	iUserSideClientList.Remove(pC, (TUint16)(pC->iClientId & ID_INDEX_BIT_MASK));
 	pC->iName = NULL;
 	iUserSideClientCount--; //Decrement client count
 	LIST_PUSH(iClientPool, pC, iNextInList);
@@ -3799,7 +3707,7 @@
 	for(count=0;count<aNumResources;count++) //Check for valid resource ID.
 		{
 #ifndef PRM_ENABLE_EXTENDED_VERSION
-		if((!pS->iResourceId) || (pS->iResourceId > (TUint)iStaticResourceArray.Count()) || (!iStaticResourceArray[pS->iResourceId-1]))
+		if((!pS->iResourceId) || (pS->iResourceId > iStaticResourceArrayEntries) || (!iStaticResourceArray[pS->iResourceId-1]))
 			{
 			UnLock();
 			LOCK_AND_CRITICAL_SECTION_COUNT_CHECK
@@ -3813,8 +3721,8 @@
 			return KErrNotSupported;
 			}
 		if((!pS->iResourceId) || ((pS->iResourceId & KIdMaskResourceWithDependencies) && 
-			     (pS->iResourceId > (TUint)iStaticResDependencyArray.Count())) || (!(pS->iResourceId & KIdMaskResourceWithDependencies) && 
-					((pS->iResourceId > (TUint)iStaticResourceArray.Count()) || (!iStaticResourceArray[pS->iResourceId-1]))))
+			     (pS->iResourceId > iStaticResDependencyCount)) || (!(pS->iResourceId & KIdMaskResourceWithDependencies) && 
+					((pS->iResourceId > iStaticResourceArrayEntries) || (!iStaticResourceArray[pS->iResourceId-1]))))
 			{
 			UnLock();
 			LOCK_AND_CRITICAL_SECTION_COUNT_CHECK
@@ -3839,6 +3747,7 @@
 		pS++;
 		}
 	iListForIdle=(SIdleResourceInfo*)aBuf->Ptr();
+	pS = (SIdleResourceInfo*)aBuf->Ptr();
 	UnLock();
 	LOCK_AND_CRITICAL_SECTION_COUNT_CHECK
 	return KErrNone;
@@ -3888,7 +3797,7 @@
 	if(aResourceId & KIdMaskDynamic)
 		((DDynamicPowerResource*)pR)->Lock();
 #else
-	if(aResourceId > (TUint)iStaticResourceArray.Count())
+	if(aResourceId > iStaticResourceArrayEntries)
 		{
 		UNLOCK_RETURN(KErrNotFound);
 		}
--- a/kernel/eka/drivers/resourceman/resourcecontrol_extended.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/resourceman/resourcecontrol_extended.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -35,14 +35,14 @@
 		iResourceLevelPoolCount = (TUint16)(iResourceLevelPoolCount - aCount);
 	else
 		{
-		TUint allocCount = (iStaticResDependencyArray.Count() / 2) + aCount;
+		TUint allocCount = (iStaticResDependencyCount / 2) + aCount;
 		// coverity[alloc_fn]
 		SPowerResourceClientLevel* pCL = new SPowerResourceClientLevel[allocCount];
 		if(!pCL)
 			return KErrNoMemory;
 		for(TUint count = 0;count<(TUint)(allocCount);count++)
 			LIST_PUSH(iResourceLevelPool, &pCL[count], iNextInList);
-		iResourceLevelPoolCount= (TUint16)(iResourceLevelPoolCount + (iStaticResDependencyArray.Count() / 2));
+		iResourceLevelPoolCount= (TUint16)(iResourceLevelPoolCount + (iStaticResDependencyCount / 2));
 #ifdef PRM_INSTRUMENTATION_MACRO
 		TUint size = allocCount * sizeof(SPowerResourceClientLevel);
 		PRM_MEMORY_USAGE_TRACE
@@ -79,16 +79,16 @@
 	SNode* pN;
 	if(aResourceId & KIdMaskDynamic)
 		{
-		DDynamicPowerResourceD* pDR = iDynamicResDependencyList[(aResourceId & ID_INDEX_BIT_MASK)];		
+		DDynamicPowerResourceD* pDR = iDynamicResDependencyList[(TUint16)(aResourceId & ID_INDEX_BIT_MASK)];		
 		if(!pDR)														
 			return KErrNotFound;
 		pN = pDR->iDependencyList;
 		}
 	else
 		{
-		if((aResourceId & ID_INDEX_BIT_MASK) > (TUint)iStaticResDependencyArray.Count())
+		if((aResourceId & ID_INDEX_BIT_MASK) > iStaticResDependencyCount)
 			return KErrNotFound;
-		DStaticPowerResourceD* pDR = iStaticResDependencyArray[(aResourceId & ID_INDEX_BIT_MASK) - 1];
+		DStaticPowerResourceD* pDR = iStaticResDependencyArray[(TUint16)(aResourceId & ID_INDEX_BIT_MASK) - 1];
 		pN = pDR->iDependencyList;
 		}
 	*aNumResources = 0;
@@ -123,16 +123,16 @@
 	SNode* pN;
 	if(aResourceId & KIdMaskDynamic)
 		{
-		DDynamicPowerResourceD* pDR = iDynamicResDependencyList[(aResourceId & ID_INDEX_BIT_MASK)];
+		DDynamicPowerResourceD* pDR = iDynamicResDependencyList[(TUint16)(aResourceId & ID_INDEX_BIT_MASK)];
 		if(!pDR)
 			return KErrNotFound;
 		pN = pDR->iDependencyList;
 		}
 	else
 		{
-		if((aResourceId & ID_INDEX_BIT_MASK) > (TUint)iStaticResDependencyArray.Count())
+		if((aResourceId & ID_INDEX_BIT_MASK) > iStaticResDependencyCount)
 			return KErrNotFound;
-		DStaticPowerResourceD* pDR = iStaticResDependencyArray[(aResourceId & ID_INDEX_BIT_MASK) -1];
+		DStaticPowerResourceD* pDR = iStaticResDependencyArray[(TUint16)(aResourceId & ID_INDEX_BIT_MASK) -1];
 		pN = pDR->iDependencyList;
 		}
 	TUint count = 0;
@@ -184,31 +184,31 @@
 	//Retrieve resource1 from the corresponding list.
 	if(aInfo1->iResourceId & KIdMaskDynamic)
 		{
-		pR1 = iDynamicResDependencyList[(aInfo1->iResourceId & ID_INDEX_BIT_MASK)];
+		pR1 = iDynamicResDependencyList[(TUint16)(aInfo1->iResourceId & ID_INDEX_BIT_MASK)];
 		if(!pR1)
 			return KErrNotFound;
 		pN1 = pR1->iDependencyList;
 		}
 	else 
 		{
-		if((aInfo1->iResourceId & ID_INDEX_BIT_MASK) > (TUint)iStaticResDependencyArray.Count())
+		if((aInfo1->iResourceId & ID_INDEX_BIT_MASK) > iStaticResDependencyCount)
 			return KErrNotFound;
-		pR1 = (DDynamicPowerResourceD*)iStaticResDependencyArray[(aInfo1->iResourceId & ID_INDEX_BIT_MASK) - 1];
+		pR1 = (DDynamicPowerResourceD*)iStaticResDependencyArray[(TUint16)(aInfo1->iResourceId & ID_INDEX_BIT_MASK) - 1];
 		pN1 = ((DStaticPowerResourceD*)pR1)->iDependencyList;
 		}
 	//Retrieve resource2 from the corresponding list.
 	if(aInfo2->iResourceId & KIdMaskDynamic)
 		{
-		pR2 = iDynamicResDependencyList[(aInfo2->iResourceId & ID_INDEX_BIT_MASK)];
+		pR2 = iDynamicResDependencyList[(TUint16)(aInfo2->iResourceId & ID_INDEX_BIT_MASK)];
 		if(!pR2)
 			return KErrNotFound;
 		pN2 = pR2->iDependencyList;
 		}
 	else
 		{
-		if((aInfo2->iResourceId & ID_INDEX_BIT_MASK) > (TUint)iStaticResDependencyArray.Count())
+		if((aInfo2->iResourceId & ID_INDEX_BIT_MASK) > iStaticResDependencyCount)
 			return KErrNotFound;
-		pR2 = (DDynamicPowerResourceD*)iStaticResDependencyArray[(aInfo2->iResourceId & ID_INDEX_BIT_MASK) - 1];
+		pR2 = (DDynamicPowerResourceD*)iStaticResDependencyArray[(TUint16)(aInfo2->iResourceId & ID_INDEX_BIT_MASK) - 1];
 		pN2 = ((DStaticPowerResourceD*)pR2)->iDependencyList;
 		}
 
@@ -325,13 +325,13 @@
 	//Get the resource from appropriate container
 	if(aResourceId & KIdMaskResourceWithDependencies)
 		{
-		pDR = iDynamicResDependencyList[(aResourceId & ID_INDEX_BIT_MASK)];		
+		pDR = iDynamicResDependencyList[(TUint16)(aResourceId & ID_INDEX_BIT_MASK)];		
 		if(!pDR)														
 			return KErrNotFound;
 		}
 	else
 		{
-		pDR = iDynamicResourceList[(aResourceId & ID_INDEX_BIT_MASK)];		
+		pDR = iDynamicResourceList[(TUint16)(aResourceId & ID_INDEX_BIT_MASK)];		
 		if(!pDR)														
 			return KErrNotFound;
 		}
@@ -460,9 +460,9 @@
 		{
 		pCL = (SPowerResourceClientLevel*)pRC;
 		if(pCL->iClientId & USER_SIDE_CLIENT_BIT_MASK)
-			pC = iUserSideClientList[(pCL->iClientId & ID_INDEX_BIT_MASK)];								
+			pC = iUserSideClientList[(TUint16)(pCL->iClientId & ID_INDEX_BIT_MASK)];								
 		else																										
-			pC = iClientList[(pCL->iClientId & ID_INDEX_BIT_MASK)];										
+			pC = iClientList[(TUint16)(pCL->iClientId & ID_INDEX_BIT_MASK)];										
 		LIST_REMOVE(pC->iLevelList, pCL, iNextInList, SPowerResourceClientLevel);
 		LIST_PUSH(iClientLevelPool, pCL, iNextInList);
 		if(pC->iUnderFlowClCount > 0)
@@ -477,12 +477,12 @@
 	aClientPtr->iDynamicResCount--;
 	if(aResourceId & KIdMaskResourceWithDependencies)
 		{
-		iDynamicResDependencyList.Remove((DDynamicPowerResourceD*)pDR, (pDR->iResourceId & ID_INDEX_BIT_MASK));
+		iDynamicResDependencyList.Remove((DDynamicPowerResourceD*)pDR, (TUint16)(pDR->iResourceId & ID_INDEX_BIT_MASK));
 		iDynamicResDependencyCount--;
 		}
 	else
 		{
-		iDynamicResourceList.Remove(pDR, (pDR->iResourceId & ID_INDEX_BIT_MASK));
+		iDynamicResourceList.Remove(pDR, (TUint16)(pDR->iResourceId & ID_INDEX_BIT_MASK));
 		iDynamicResourceCount--;
 		}
 	__KTRACE_OPT(KRESMANAGER, Kern::Printf("<DExtendedResourceController::DeregisterDynamicResource"));
@@ -498,10 +498,12 @@
 @prototype 9.6
 Default implementation, PSL re-implements this if features supported.
 */
-TInt DPowerResourceController::DoRegisterStaticResourcesDependency(RPointerArray <DStaticPowerResourceD> & aStaticResourceDArray)
+TInt DPowerResourceController::DoRegisterStaticResourcesDependency(DStaticPowerResourceD**& aStaticResourceDArray, 
+																    TUint16& aStaticResourceDCount)
 	{
 	__KTRACE_OPT(KRESMANAGER, Kern::Printf("DExtendedResourceController::DoRegisterStaticResourcesDependency default implementation"));
-	aStaticResourceDArray.Reset();
+	aStaticResourceDArray = NULL;
+	aStaticResourceDCount = 0;
 	return KErrNone;
 	}
 
@@ -706,18 +708,18 @@
 			{																							
 			DStaticPowerResourceD* pResource;												
 			if(aRequest.ClientId() & KIdMaskDynamic)										
-				pResource = (DStaticPowerResourceD*)iDynamicResDependencyList[(aRequest.ClientId() & ID_INDEX_BIT_MASK)];
+				pResource = (DStaticPowerResourceD*)iDynamicResDependencyList[(TUint16)(aRequest.ClientId() & ID_INDEX_BIT_MASK)];
 			else																						
-				pResource = iStaticResDependencyArray[(aRequest.ClientId() & ID_INDEX_BIT_MASK)  - 1];	
+				pResource = iStaticResDependencyArray[(TUint16)(aRequest.ClientId() & ID_INDEX_BIT_MASK)  - 1];	
 			name = pResource->iName;																	
 			}																							
 		else																							
 			{																							
 			SPowerResourceClient* pClient;																
 			if(aRequest.ClientId() & USER_SIDE_CLIENT_BIT_MASK)										
-				pClient = iUserSideClientList[(aRequest.ClientId() & ID_INDEX_BIT_MASK)];	
+				pClient = iUserSideClientList[(TUint16)(aRequest.ClientId() & ID_INDEX_BIT_MASK)];	
 			else // coverity[returned_null]
-				pClient = iClientList[(aRequest.ClientId() & ID_INDEX_BIT_MASK)];			
+				pClient = iClientList[(TUint16)(aRequest.ClientId() & ID_INDEX_BIT_MASK)];			
 			name = pClient->iName;				
 			}
 		}
@@ -760,7 +762,7 @@
 
 	if(aResId1 & KIdMaskDynamic)
 		{
-		pDR1 = iDynamicResDependencyList[(aResId1 & ID_INDEX_BIT_MASK)];	
+		pDR1 = iDynamicResDependencyList[(TUint16)(aResId1 & ID_INDEX_BIT_MASK)];	
 		if(!pDR1)															
 			UNLOCK_RETURN(KErrNotFound);
 		pN1 = pDR1->iDependencyList;
@@ -768,7 +770,7 @@
 		}
 	else
 		{
-		if((aResId1 & ID_INDEX_BIT_MASK) > (TUint)iStaticResDependencyArray.Count())			
+		if((aResId1 & ID_INDEX_BIT_MASK) > iStaticResDependencyCount)			
 			UNLOCK_RETURN(KErrNotFound);			
 		pDR1 = (DDynamicPowerResourceD*)iStaticResDependencyArray[(aResId1 & ID_INDEX_BIT_MASK) - 1];
 		pN1 = ((DStaticPowerResourceD*)pDR1)->iDependencyList;
@@ -778,7 +780,7 @@
 	//Get second resource from list
 	if(aResId2 & KIdMaskDynamic)
 		{
-		pDR2 = iDynamicResDependencyList[(aResId2 & ID_INDEX_BIT_MASK)];	
+		pDR2 = iDynamicResDependencyList[(TUint16)(aResId2 & ID_INDEX_BIT_MASK)];	
 		if(!pDR2)															
 			UNLOCK_RETURN(KErrNotFound);
 		pN2 = pDR2->iDependencyList;
@@ -786,9 +788,9 @@
 		}
 	else
 		{
-		if((aResId2 & ID_INDEX_BIT_MASK)> (TUint)iStaticResDependencyArray.Count())			
+		if((aResId2 & ID_INDEX_BIT_MASK)> iStaticResDependencyCount)			
 				UNLOCK_RETURN(KErrNotFound);			
-		pDR2 = (DDynamicPowerResourceD*)iStaticResDependencyArray[(aResId2 & ID_INDEX_BIT_MASK) - 1];
+		pDR2 = (DDynamicPowerResourceD*)iStaticResDependencyArray[(TUint16)(aResId2 & ID_INDEX_BIT_MASK) - 1];
 		pN2 = ((DStaticPowerResourceD*)pDR2)->iDependencyList;
 		pCL2 = ((DStaticPowerResourceD*)pDR2)->iResourceClientList;
 		}
--- a/kernel/eka/drivers/sdapc/d_sdapc.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/sdapc/d_sdapc.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -132,12 +132,9 @@
 
 void DSDAuxiliaryPowerControlFactory::GetCaps(TDes8& aDes) const
 //
-// Get capabilities - overriding pure virtual
+// Stub - overriding pure virtual
 //
 	{
-	TCapsTestV01 b;
-	b.iVersion=TVersion(KMajorVersionNumber,KMinorVersionNumber,KBuildVersionNumber);
-    Kern::InfoCopy(aDes,(TUint8*)&b,sizeof(b));
 	}
 
 /**
--- a/kernel/eka/drivers/usbc/d_usbc.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/usbc/d_usbc.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -23,11 +23,6 @@
 */
 
 #include <drivers/usbc.h>
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "d_usbcTraces.h"
-#endif
-
 
 
 _LIT(KUsbLddName, "Usbc");
@@ -100,9 +95,7 @@
 	// Only proceed if we have the Controller underneath us
 	if (!DUsbClientController::UsbcControllerPointer())
 		{
-		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLOGDEVICE_INSTALL,
-		        "LDD Install: USB Controller Not Present" );
-		
+		__KTRACE_OPT(KPANIC, Kern::Printf("LDD Install: USB Controller Not Present"));
 		return KErrGeneral;
 		}
 	return SetName(&KUsbLddName);
@@ -141,9 +134,7 @@
 	  iDeviceStatusNeeded(EFalse),
 	  iChannelClosing(EFalse)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCCHANNEL_DLDDUSBCCHANNEL_CONS, 
-	        "*** DLddUsbcChannel::DLddUsbcChannel CTOR" );
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("*** DLddUsbcChannel::DLddUsbcChannel CTOR"));
 	iClient = &Kern::CurrentThread();
 	iClient->Open();
 	for (TInt i = 1; i <= KMaxEndpointsPerClient; i++)
@@ -159,9 +150,7 @@
 
 DLddUsbcChannel::~DLddUsbcChannel()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCCHANNEL_DLDDUSBCCHANNEL_DES, 
-	        "DLddUsbcChannel::~DLddUsbcChannel()" );
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcChannel::~DLddUsbcChannel()"));
 	if (iController)
 		{
 		iController->DeRegisterClient(this);
@@ -207,9 +196,8 @@
 //
 TInt DLddUsbcChannel::DoCreate(TInt /*aUnit*/, const TDesC8* /*aInfo*/, const TVersion& aVer)
 	{
-	OstTraceDefExt3( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCREATE, 
-	        "LDD DoCreateL 1 Ver = %02d %02d %02d", aVer.iMajor, aVer.iMinor, aVer.iBuild );
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("LDD DoCreateL 1 Ver = %02d %02d %02d",
+									aVer.iMajor, aVer.iMinor, aVer.iBuild));
 	if (!Kern::CurrentThreadHasCapability(ECapabilityCommDD,
 										  __PLATSEC_DIAGNOSTIC_STRING("Checked by USBC.LDD (USB Driver)")))
 		{
@@ -439,8 +427,7 @@
 //
 TInt DLddUsbcChannel::RequestUserHandle(DThread* aThread, TOwnerType /*aType*/)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_REQUESTUSERHANDLE,
-	        "DLddUsbcChannel::RequestUserHandle" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcChannel::RequestUserHandle"));
 	// The USB client LDD is not designed for a channel to be shared between
 	// threads. It saves a pointer to the current thread when it is opened, and
 	// uses this to complete any asynchronous requests.
@@ -463,8 +450,7 @@
 void DLddUsbcChannel::DoRequest(TInt aReqNo, TRequestStatus* aStatus, TAny* a1, TAny* a2)
 	{
 	// Check on request status
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOREQUEST, 
-	        "DoRequest 0x%08x", aReqNo );
+	__KTRACE_OPT(KUSB, Kern::Printf("DoRequest 0x%08x", aReqNo));
 		TInt r = KErrNone;
 		if (iRequestStatus[aReqNo] != NULL)
 			{
@@ -533,8 +519,7 @@
 		{
 	case RDevUsbcClient::ERequestAlternateDeviceStatusNotify:
 		{
-		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOOTHERASYNCREQ, 
-		        "EControlReqDeviceStatusNotify" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlReqDeviceStatusNotify"));
 		if (a1 != NULL)
 			{
 			iDeviceStatusNeeded = ETrue;
@@ -547,16 +532,14 @@
 		}
 	case RDevUsbcClient::ERequestReEnumerate:
 		{
-	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOOTHERASYNCREQ_DUP1, 
-	            "ERequestReEnumerate" );
+		__KTRACE_OPT(KUSB, Kern::Printf("ERequestReEnumerate"));
 		// If successful, this will complete via the status notification.
 		r = iController->ReEnumerate();
 		break;
 		}
 	case RDevUsbcClient::ERequestEndpointStatusNotify:
 		{
-	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOOTHERASYNCREQ_DUP2, 
-	            "ERequestEndpointStatusNotify" );
+		__KTRACE_OPT(KUSB, Kern::Printf("ERequestEndpointStatusNotify"));
 		if (a1 != NULL)
 			{
 			iEndpointStatusChangePtr = a1;
@@ -567,8 +550,7 @@
 			}
 	case RDevUsbcClient::ERequestOtgFeaturesNotify:
 		{
-		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOOTHERASYNCREQ_DUP3, 
-		        "ERequestOtgFeaturesNotify" );
+		__KTRACE_OPT(KUSB, Kern::Printf("ERequestOtgFeaturesNotify"));
 		if (a1 != NULL)
 			{
             iOtgFeatureChangePtr = a1;
@@ -607,8 +589,7 @@
 		// ep0 requests
 		if (!(iValidInterface || iOwnsDeviceControl))
 			{
-			OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ,
-			        "DoRequest rejected: not configured (Ep0)" );
+			__KTRACE_OPT(KUSB, Kern::Printf("DoRequest rejected: not configured (Ep0)"));
 			r = KErrUsbInterfaceNotReady;
 			goto exit;
 			}
@@ -620,8 +601,7 @@
 		                          iDeviceState == EUsbcDeviceStateSuspended))
 		   )
 			{
-			OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP1,
-			        "DoRequest rejected not configured (Ep %d)", aEndpointNum );
+			__KTRACE_OPT(KUSB, Kern::Printf("DoRequest rejected not configured (Ep %d)", aEndpointNum));
 			r = KErrUsbInterfaceNotReady;
 			goto exit;
 			}
@@ -629,8 +609,7 @@
 
 	if (!ValidEndpoint(aEndpointNum))
 		{
-		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP2,
-		        "  Error: DoRequest Read: in error complete" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: DoRequest Read: in error complete"));
 		r = KErrUsbEpNotInInterface;
 		goto exit;
  		}
@@ -650,15 +629,13 @@
 	pEndpoint = iEndpoint[aEndpointNum];
 	if (!pEndpoint)
 		{
-		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP3,
-		        "  Error: DoRequest Read: in error complete" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: DoRequest Read: in error complete"));
 		r = KErrUsbEpNotInInterface;
 		goto exit;
 		}
 
 	pEndpointInfo = pEndpoint->EndpointInfo();
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP4,
-	        "DoRequest %d", aEndpointNum );
+	__KTRACE_OPT(KUSB, Kern::Printf("DoRequest %d", aEndpointNum));
 
 	switch (pTfr->iTransferType)
 		{
@@ -668,25 +645,21 @@
 	case ETransferTypeReadUntilShort:
 	case ETransferTypeReadOneOrMore:
 		{
-		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP5,
-		        "DoRequest Read" );
+		__KTRACE_OPT(KUSB, Kern::Printf("DoRequest Read"));
 		if (pEndpoint->iDmaBuffers->RxIsActive())
 			{
-			OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP6,
-			        "**** ReadReq ep%d RxActive", aEndpointNum );
+			__KTRACE_OPT(KUSB, Kern::Printf("**** ReadReq ep%d RxActive", aEndpointNum));
 			}
 		else
 			{
-			OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP7,
-			        "**** ReadReq ep%d RxInActive", aEndpointNum );
+			__KTRACE_OPT(KUSB, Kern::Printf("**** ReadReq ep%d RxInActive", aEndpointNum));
 			}
 
 		if (pEndpointInfo->iDir != KUsbEpDirOut &&
 			pEndpointInfo->iDir != KUsbEpDirBidirect)
 			{
 			// Trying to do the wrong thing
-			OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP8,
-			        "  Error: DoRequest Read: in error complete" );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: DoRequest Read: in error complete"));
 			r = KErrUsbEpBadDirection;
 			break;
 			}
@@ -704,8 +677,7 @@
 			{
 			if (pTfr->iTransferType == ETransferTypeReadPacket)
 				{
-				OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP9,
-				        "DoRequest Read packet: data available complete" );
+				__KTRACE_OPT(KUSB, Kern::Printf("DoRequest Read packet: data available complete"));
 				r = pEndpoint->CopyToClient(iClient,iClientAsynchNotify[aEndpointNum]->iClientBuffer);
 				aNeedsCompletion = ETrue;
 				break;
@@ -714,8 +686,7 @@
 				{
 				if (pTfr->iTransferSize <= pEndpoint->RxBytesAvailable())
 					{
-					OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP10,
-					        "DoRequest Read data: data available complete");
+					__KTRACE_OPT(KUSB, Kern::Printf("DoRequest Read data: data available complete"));
 					r = pEndpoint->CopyToClient(iClient,iClientAsynchNotify[aEndpointNum]->iClientBuffer);
 					aNeedsCompletion = ETrue;
 					break;
@@ -729,8 +700,7 @@
 				{
 				if (pEndpoint->RxBytesAvailable() > 0)
 					{
-					OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP11,
-					        "DoRequest Read data: data available complete" );
+					__KTRACE_OPT(KUSB, Kern::Printf("DoRequest Read data: data available complete"));
 					r = pEndpoint->CopyToClient(iClient,iClientAsynchNotify[aEndpointNum]->iClientBuffer);
 					aNeedsCompletion = ETrue;
 					break;
@@ -748,9 +718,7 @@
 					(nRx < maxPacketSize) ||
 					pEndpoint->iDmaBuffers->ShortPacketExists())
 					{
-                    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP12,
-                            "DoRequest Read data: data available complete" );
-
+					__KTRACE_OPT(KUSB, Kern::Printf("DoRequest Read data: data available complete"));
 					r = pEndpoint->CopyToClient(iClient,iClientAsynchNotify[aEndpointNum]->iClientBuffer);
 					aNeedsCompletion = ETrue;
 					}
@@ -763,9 +731,7 @@
 		r = pEndpoint->TryToStartRead(EFalse);
 		if (r != KErrNone)
 			{
-            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP13,
-                    "DoRequest Read: couldn't start read" );
-
+			__KTRACE_OPT(KUSB, Kern::Printf("DoRequest Read: couldn't start read"));
 			r = KErrNone;									// Reader full isn't a userside error;
 			}
 		break;
@@ -773,48 +739,42 @@
 
 	case ETransferTypeWrite:
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP14,
-                "DoRequest Write 1" );
+		__KTRACE_OPT(KUSB, Kern::Printf("DoRequest Write 1"));
 		if (pEndpointInfo->iDir != KUsbEpDirIn &&
 			pEndpointInfo->iDir != KUsbEpDirBidirect)
 			{
-			OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP15,
-			        "  Error: DoRequest Write: wrong direction complete" );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: DoRequest Write: wrong direction complete"));
 			r = KErrUsbEpBadDirection;
 			break;
 			}
-		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP16,
-		        "DoRequest Write 2" );
+		__KTRACE_OPT(KUSB, Kern::Printf("DoRequest Write 2"));
 
 
 		TInt desLength=iClientAsynchNotify[aEndpointNum]->iClientBuffer->Length();
 		
 		if (desLength < pTfr->iTransferSize)
 			{
-			OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP17,
-			        "  Error: DoRequest Write: user buffer too short" );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: DoRequest Write: user buffer too short"));
 			r = KErrUsbTransferSize;
 			break;
 			}
 
-		OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP18,
-		        "DoRequest Write 3 length=%d maxlength=%d", pTfr->iTransferSize, desLength);
+		__KTRACE_OPT(KUSB, Kern::Printf("DoRequest Write 3 length=%d maxlength=%d",
+										pTfr->iTransferSize, desLength));
 		// Zero length writes are acceptable
 		pEndpoint->SetClientWritePending(ETrue);
 		r = pEndpoint->TryToStartWrite(pTfr);
 		if (r != KErrNone)
 			{
-			OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP19,
-			        "  Error: DoRequest Write: couldn't start write" );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: DoRequest Write: couldn't start write"));
 			pEndpoint->SetClientWritePending(EFalse);
 			}
 		break;
 		}
 
 	default:
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP20,
-                "  Error: DoTransferAsyncReq: pTfr->iTransferType = %d not supported", pTfr->iTransferType);
-
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: DoTransferAsyncReq: pTfr->iTransferType = %d not supported",
+										  pTfr->iTransferType));
 		r = KErrNotSupported;
 		break;
 		}
@@ -830,20 +790,15 @@
 TInt DLddUsbcChannel::DoCancel(TInt aReqNo)
 	{
 	TInt r = KErrNone;
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCANCEL, 
-	        "DoCancel: 0x%x", aReqNo );
+	__KTRACE_OPT(KUSB, Kern::Printf("DoCancel: 0x%x", aReqNo));
 	if (aReqNo <= iNumberOfEndpoints)
 		{
-		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCANCEL_DUP1, 
-		        "DoCancel endpoint: 0x%x", aReqNo );
-
+		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel endpoint: 0x%x", aReqNo));
 		iEndpoint[aReqNo]->CancelTransfer(iClient,iClientAsynchNotify[aReqNo]->iClientBuffer);
 		}
 	else if (aReqNo == RDevUsbcClient::ERequestAlternateDeviceStatusNotify)
 		{
-		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCANCEL_DUP2, 
-		        "DoCancel: ERequestAlternateDeviceStatusNotify 0x%x", aReqNo );
-
+		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel: ERequestAlternateDeviceStatusNotify 0x%x", aReqNo));
 		iDeviceStatusNeeded = EFalse;
 		iStatusFifo->FlushQueue();
 		if (iStatusChangePtr)
@@ -861,15 +816,11 @@
 		}
 	else if (aReqNo == RDevUsbcClient::ERequestReEnumerate)
 		{
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCANCEL_DUP3, 
-                "DoCancel ERequestReEnumerate: 0x%x", aReqNo );
-
+		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel ERequestReEnumerate: 0x%x", aReqNo));
 		}
 	else if (aReqNo == RDevUsbcClient::ERequestEndpointStatusNotify)
 		{
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCANCEL_DUP4,
-                "DoCancel ERequestEndpointStatusNotify: 0x%x", aReqNo );
-
+		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel ERequestEndpointStatusNotify: 0x%x", aReqNo));
 		CancelNotifyEndpointStatus();
 		if (iEndpointStatusChangeReq->IsReady())
 			{
@@ -880,9 +831,7 @@
 		}
 	else if (aReqNo == RDevUsbcClient::ERequestOtgFeaturesNotify)
 		{
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCANCEL_DUP5,
-                "DoCancel ERequestOtgFeaturesNotify: 0x%x", aReqNo );
-
+		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel ERequestOtgFeaturesNotify: 0x%x", aReqNo));
 		CancelNotifyOtgFeatures();
 		if (iOtgFeatureChangeReq->IsReady())
 			{
@@ -892,9 +841,7 @@
 		}
 	else
 		{
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCANCEL_DUP6,
-                "DoCancel Unknown! 0x%x", aReqNo );
-
+		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel Unknown! 0x%x", aReqNo));
 		}
 
 		if (r == KErrNone)
@@ -1171,8 +1118,7 @@
 
 TInt DLddUsbcChannel::DoControl(TInt aFunction, TAny* a1, TAny* a2)
 	{
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL, 
-            "DoControl: %d", aFunction );
+	__KTRACE_OPT(KUSB, Kern::Printf("DoControl: %d", aFunction));
 
 	TInt r = KErrNone;
 	TInt ep;
@@ -1187,9 +1133,7 @@
 	switch (aFunction)
 		{
 	case RDevUsbcClient::EControlEndpointZeroRequestError:
-	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP1, 
-	            "EControlEndpointZeroRequestError" );
-
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlEndpointZeroRequestError"));
 		r = KErrNone;
 		if (iOwnsDeviceControl || (iValidInterface && iDeviceState == EUsbcDeviceStateConfigured))
 			{
@@ -1205,9 +1149,7 @@
 		break;
 
 	case RDevUsbcClient::EControlGetAlternateSetting:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP2,
-                "EControlGetAlternateSetting" );
-
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetAlternateSetting"));
 		if (iValidInterface && iDeviceState == EUsbcDeviceStateConfigured)
 			{
 			r = iController->GetInterfaceNumber(this, *(TInt*)a1);
@@ -1222,16 +1164,12 @@
 		break;
 
 	case RDevUsbcClient::EControlDeviceStatus:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP3,
-                "EControlDeviceStatus" );
-
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlDeviceStatus"));
 		*(TInt*)a1 = iController->GetDeviceStatus();
 		break;
 
 	case RDevUsbcClient::EControlEndpointStatus:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP4,
-                "EControlEndpointStatus" );
-
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlEndpointStatus"));
 		if (iValidInterface && ValidEndpoint((TInt) a1))
 			{
 			pEndpoint = iEndpoint[(TInt)a1];
@@ -1252,9 +1190,7 @@
 		break;
 
 	case RDevUsbcClient::EControlQueryReceiveBuffer:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP5,
-                "EControlQueryReceiveBuffer" );
-
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlQueryReceiveBuffer"));
 		if (iValidInterface && ValidEndpoint((TInt) a1))
 			{
 			pEndpoint=iEndpoint[(TInt) a1];
@@ -1262,8 +1198,7 @@
 				r = KErrNotSupported;
 			else if (pEndpoint->EndpointInfo()->iDir != KUsbEpDirIn)
 				{
-		        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP6,
-		                "  bytes = %d", pEndpoint->RxBytesAvailable());
+				__KTRACE_OPT(KUSB, Kern::Printf("  bytes = %d", pEndpoint->RxBytesAvailable()));
 				*(TInt*)a2 = pEndpoint->RxBytesAvailable();
 				}
 			}
@@ -1277,8 +1212,7 @@
 		break;
 
 	case RDevUsbcClient::EControlEndpointCaps:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP7,
-                "EControlEndpointCaps" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlEndpointCaps"));
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0, 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1286,8 +1220,7 @@
 		break;
 
 	case RDevUsbcClient::EControlDeviceCaps:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP8,
-                "EControlDeviceCaps" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlDeviceCaps"));
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0, 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1295,14 +1228,12 @@
 		break;
 
 	case RDevUsbcClient::EControlSendEp0StatusPacket:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP9,
-                "EControlSendEp0StatusPacket" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSendEp0StatusPacket"));
 		iController->SendEp0StatusPacket(this);
 		break;
 
 	case RDevUsbcClient::EControlHaltEndpoint:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP10,
-                "EControlHaltEndpoint" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlHaltEndpoint"));
 		if (iValidInterface && ValidEndpoint((TInt) a1))
 			{
 			r = iController->HaltEndpoint(this, iEndpoint[(TInt)a1]->RealEpNumber());
@@ -1317,8 +1248,7 @@
 		break;
 
 	case RDevUsbcClient::EControlClearHaltEndpoint:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP11,
-                "EControlClearHaltEndpoint" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlClearHaltEndpoint"));
 		if (iValidInterface && ValidEndpoint((TInt) a1))
 			{
 			r = iController->ClearHaltEndpoint(this, iEndpoint[(TInt)a1]->RealEpNumber());
@@ -1333,39 +1263,33 @@
 		break;
 
 	case RDevUsbcClient::EControlDumpRegisters:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP12,
-                "EControlDumpRegisters" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlDumpRegisters"));
 		iController->DumpRegisters();
 		break;
 
 	case RDevUsbcClient::EControlReleaseDeviceControl:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP13,
-                "EControlReleaseDeviceControl" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlReleaseDeviceControl"));
 		iController->ReleaseDeviceControl(this);
 		iOwnsDeviceControl = EFalse;
 		break;
 
 	case RDevUsbcClient::EControlEndpointZeroMaxPacketSizes:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP14,
-                "EControlEndpointZeroMaxPacketSizes" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlEndpointZeroMaxPacketSizes"));
 		r = iController->EndpointZeroMaxPacketSizes();
 		break;
 
 	case RDevUsbcClient::EControlSetEndpointZeroMaxPacketSize:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP15,
-                "EControlSetEndpointZeroMaxPacketSize" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetEndpointZeroMaxPacketSize"));
 		r = iController->SetEndpointZeroMaxPacketSize(reinterpret_cast<TInt>(a1));
 		break;
 
 	case RDevUsbcClient::EControlGetEndpointZeroMaxPacketSize:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP16,
-                "EControlGetEndpointZeroMaxPacketSize" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetEndpointZeroMaxPacketSize"));
 		r = iController->Ep0PacketSize();
 		break;
 
 	case RDevUsbcClient::EControlGetDeviceDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP17,
-                "EControlGetDeviceDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetDeviceDescriptor"));
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0, 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1373,8 +1297,7 @@
 		break;
 
 	case RDevUsbcClient::EControlSetDeviceDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP18,
-                "EControlSetDeviceDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetDeviceDescriptor"));
 		if (a1 != NULL)
 			r = iController->SetDeviceDescriptor(iClient, *((TDes8*) a1));
 		else
@@ -1382,8 +1305,7 @@
 		break;
 
 	case RDevUsbcClient::EControlGetDeviceDescriptorSize:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP19,
-                "EControlGetDeviceDescriptorSize" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetDeviceDescriptorSize"));
 		if (a1 != NULL)
 			r = iController->GetDeviceDescriptorSize(iClient, *((TDes8*) a1));
 		else
@@ -1391,8 +1313,7 @@
 		break;
 
 	case RDevUsbcClient::EControlGetConfigurationDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP20,
-                "EControlGetConfigurationDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetConfigurationDescriptor"));
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0 , 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1400,8 +1321,7 @@
 		break;
 
 	case RDevUsbcClient::EControlGetConfigurationDescriptorSize:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP21,
-                "EControlGetConfigurationDescriptorSize" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetConfigurationDescriptorSize"));
 		if (a1 != NULL)
 			{
 			r = iController->GetConfigurationDescriptorSize(iClient, *((TDes8*) a1));
@@ -1411,32 +1331,27 @@
 		break;
 
 	case RDevUsbcClient::EControlSetConfigurationDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP22,
-                "EControlSetConfigurationDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetConfigurationDescriptor"));
 		r = iController->SetConfigurationDescriptor(iClient, *((TDes8*) a1));
 		break;
 
 	case RDevUsbcClient::EControlGetInterfaceDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP23,
-                "EControlGetInterfaceDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetInterfaceDescriptor"));
 		r = iController->GetInterfaceDescriptor(iClient, this, (TInt) a1, *((TDes8*) a2));
 		break;
 
 	case RDevUsbcClient::EControlGetInterfaceDescriptorSize:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP24,
-                "EControlGetInterfaceDescriptorSize" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetInterfaceDescriptorSize"));
 		r = iController->GetInterfaceDescriptorSize(iClient, this, (TInt) a1, *(TDes8*) a2);
 		break;
 
 	case RDevUsbcClient::EControlSetInterfaceDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP25,
-                "EControlSetInterfaceDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetInterfaceDescriptor"));
 		r = iController->SetInterfaceDescriptor(iClient, this, (TInt) a1, *((TDes8*) a2));
 		break;
 
 	case RDevUsbcClient::EControlGetEndpointDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP26,
-                "EControlGetEndpointDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetEndpointDescriptor"));
 		r = Kern::ThreadRawRead(iClient, a1, &epInfo, sizeof(epInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1446,8 +1361,7 @@
 		break;
 
 	case RDevUsbcClient::EControlGetEndpointDescriptorSize:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP27,
-                "EControlGetEndpointDescriptorSize" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetEndpointDescriptorSize"));
 		r = Kern::ThreadRawRead(iClient, a1, &epInfo, sizeof(epInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1457,8 +1371,7 @@
 		break;
 
 	case RDevUsbcClient::EControlSetEndpointDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP28,
-                "EControlSetEndpointDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetEndpointDescriptor"));
 		r = Kern::ThreadRawRead(iClient, a1, &epInfo, sizeof(epInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1468,8 +1381,7 @@
 		break;
 
 	case RDevUsbcClient::EControlGetDeviceQualifierDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP29,
-                "EControlGetDeviceQualifierDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetDeviceQualifierDescriptor"));
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0, 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1477,8 +1389,7 @@
 		break;
 
 	case RDevUsbcClient::EControlSetDeviceQualifierDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP30,
-                "EControlSetDeviceQualifierDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetDeviceQualifierDescriptor"));
 		if (a1 != NULL)
 			r = iController->SetDeviceQualifierDescriptor(iClient, *((TDes8*) a1));
 		else
@@ -1486,8 +1397,7 @@
 		break;
 
 	case RDevUsbcClient::EControlGetOtherSpeedConfigurationDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP31,
-                "EControlGetOtherSpeedConfigurationDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetOtherSpeedConfigurationDescriptor"));
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0 , 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1495,27 +1405,23 @@
 		break;
 
 	case RDevUsbcClient::EControlSetOtherSpeedConfigurationDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP32,
-                "EControlSetOtherSpeedConfigurationDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetOtherSpeedConfigurationDescriptor"));
 		r = iController->SetOtherSpeedConfigurationDescriptor(iClient, *((TDes8*) a1));
 		break;
 
 
 	case RDevUsbcClient::EControlGetCSInterfaceDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP33,
-                "EControlGetCSInterfaceDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetCSInterfaceDescriptor"));
 		r = iController->GetCSInterfaceDescriptorBlock(iClient, this, (TInt) a1, *((TDes8*) a2));
 		break;
 
 	case RDevUsbcClient::EControlGetCSInterfaceDescriptorSize:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP34,
-                "EControlGetCSInterfaceDescriptorSize" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetCSInterfaceDescriptorSize"));
 		r = iController->GetCSInterfaceDescriptorBlockSize(iClient, this, (TInt) a1, *(TDes8*) a2);
 		break;
 
 	case RDevUsbcClient::EControlGetCSEndpointDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP35,
-                "EControlGetCSEndpointDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetCSEndpointDescriptor"));
 		r = Kern::ThreadRawRead(iClient, a1, &epInfo, sizeof(epInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1525,8 +1431,7 @@
 		break;
 
 	case RDevUsbcClient::EControlGetCSEndpointDescriptorSize:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP36,
-                "EControlGetCSEndpointDescriptorSize" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetCSEndpointDescriptorSize"));
 		r = Kern::ThreadRawRead(iClient, a1, &epInfo, sizeof(epInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1536,46 +1441,38 @@
 		break;
 
 	case RDevUsbcClient::EControlSignalRemoteWakeup:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP37,
-                "EControlSignalRemoteWakeup" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSignalRemoteWakeup"));
 		r = iController->SignalRemoteWakeup();
 		break;
 
 	case RDevUsbcClient::EControlDeviceDisconnectFromHost:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP38,
-                "EControlDeviceDisconnectFromHost" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlDeviceDisconnectFromHost"));
 		r = iController->UsbDisconnect();
 		break;
 
 	case RDevUsbcClient::EControlDeviceConnectToHost:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP39,
-                "EControlDeviceConnectToHost" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlDeviceConnectToHost"));
 		r = iController->UsbConnect();
 		break;
 
 	case RDevUsbcClient::EControlDevicePowerUpUdc:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP40,
-                "EControlDevicePowerUpUdc" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlDevicePowerUpUdc"));
 		r = iController->PowerUpUdc();
 		break;
 
 	case RDevUsbcClient::EControlSetDeviceControl:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP41,
-                "EControlSetDeviceControl" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetDeviceControl"));
 		r = iController->SetDeviceControl(this);
 		if (r == KErrNone)
 			{
 			iOwnsDeviceControl = ETrue;
 			if (iEndpoint[0] == NULL)
 				{
-		        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP42,
-		                "EControlSetDeviceControl 11" );
+				__KTRACE_OPT(KUSB, Kern::Printf("EControlSetDeviceControl 11"));
 				r = SetupEp0();
 				if (r != KErrNone)
 					{
-	               OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_DOCONTROL_DUP43,
-	                       "  Error: SetupEp0() failed" );
-
+					__KTRACE_OPT(KPANIC, Kern::Printf("  Error: SetupEp0() failed"));
 					iController->ReleaseDeviceControl(this);
 					DestroyEp0();
 					iOwnsDeviceControl = EFalse;
@@ -1588,14 +1485,12 @@
 		break;
 
 	case RDevUsbcClient::EControlCurrentlyUsingHighSpeed:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP44,
-                "EControlCurrentlyUsingHighSpeed" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlCurrentlyUsingHighSpeed"));
 		r = iController->CurrentlyUsingHighSpeed();
 		break;
 
 	case RDevUsbcClient::EControlSetInterface:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP45,
-                "EControlSetInterface" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetInterface"));
 		r = Kern::ThreadRawRead(iClient, a2, &ifcInfo, sizeof(ifcInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1621,8 +1516,7 @@
 		break;
 
 	case RDevUsbcClient::EControlReleaseInterface:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP46,
-                "EControlReleaseInterface" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlReleaseInterface"));
 		r = iController->ReleaseInterface(this, (TInt) a1);
 		if (r == KErrNone)
 			{
@@ -1630,14 +1524,12 @@
 			}
 		else
 			{
-	        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_DOCONTROL_DUP47,
-	                "  Error in PIL: LDD interface won't be released." );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error in PIL: LDD interface won't be released."));
 			}
 		break;
 
 	case RDevUsbcClient::EControlSetCSInterfaceDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP48,
-                "EControlSetCSInterfaceDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetCSInterfaceDescriptor"));
 		r = Kern::ThreadRawRead(iClient, a1, &desInfo, sizeof(desInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1647,8 +1539,7 @@
 		break;
 
 	case RDevUsbcClient::EControlSetCSEndpointDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP49,
-                "EControlSetCSEndpointDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetCSEndpointDescriptor"));
 		r = Kern::ThreadRawRead(iClient, a1, &desInfo, sizeof(desInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1659,104 +1550,87 @@
 		break;
 
 	case RDevUsbcClient::EControlGetStringDescriptorLangId:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP50,
-                "EControlGetStringDescriptorLangId" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetStringDescriptorLangId"));
 		r = iController->GetStringDescriptorLangId(iClient, *((TDes8*) a1));
 		break;
 
 	case RDevUsbcClient::EControlSetStringDescriptorLangId:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP51,
-                "EControlSetStringDescriptorLangId" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetStringDescriptorLangId"));
 		r = iController->SetStringDescriptorLangId(reinterpret_cast<TUint>(a1));
 		break;
 
 	case RDevUsbcClient::EControlGetManufacturerStringDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP52,
-                "EControlGetManufacturerStringDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetManufacturerStringDescriptor"));
 		r = iController->GetManufacturerStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcClient::EControlSetManufacturerStringDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP53,
-                "EControlSetManufacturerStringDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetManufacturerStringDescriptor"));
 		r = iController->SetManufacturerStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcClient::EControlRemoveManufacturerStringDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP54,
-                "EControlRemoveManufacturerStringDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlRemoveManufacturerStringDescriptor"));
 		r = iController->RemoveManufacturerStringDescriptor();
 		break;
 
 	case RDevUsbcClient::EControlGetProductStringDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP55,
-                "EControlGetProductStringDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetProductStringDescriptor"));
 		r = iController->GetProductStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcClient::EControlSetProductStringDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP56,
-                "EControlSetProductStringDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetProductStringDescriptor"));
 		r = iController->SetProductStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcClient::EControlRemoveProductStringDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP57,
-                "EControlRemoveProductStringDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlRemoveProductStringDescriptor"));
 		r = iController->RemoveProductStringDescriptor();
 		break;
 
 	case RDevUsbcClient::EControlGetSerialNumberStringDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP58,
-                "EControlGetSerialNumberStringDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetSerialNumberStringDescriptor"));
 		r = iController->GetSerialNumberStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcClient::EControlSetSerialNumberStringDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP59,
-                "EControlSetSerialNumberStringDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetSerialNumberStringDescriptor"));
 		r = iController->SetSerialNumberStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcClient::EControlRemoveSerialNumberStringDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP60,
-                "EControlRemoveSerialNumberStringDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlRemoveSerialNumberStringDescriptor"));
 		r = iController->RemoveSerialNumberStringDescriptor();
 		break;
 
 	case RDevUsbcClient::EControlGetConfigurationStringDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP61,
-                "EControlGetConfigurationStringDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetConfigurationStringDescriptor"));
 		r = iController->GetConfigurationStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcClient::EControlSetConfigurationStringDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP62,
-                "EControlSetConfigurationStringDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetConfigurationStringDescriptor"));
 		r = iController->SetConfigurationStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcClient::EControlRemoveConfigurationStringDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP63,
-                "EControlRemoveConfigurationStringDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlRemoveConfigurationStringDescriptor"));
 		r = iController->RemoveConfigurationStringDescriptor();
 		break;
 
 	case RDevUsbcClient::EControlGetStringDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP64,
-                "EControlGetStringDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetStringDescriptor"));
 		r = iController->GetStringDescriptor(iClient, (TUint8) (TInt) a1, *((TPtr8*) a2));
 		break;
 
 	case RDevUsbcClient::EControlSetStringDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP65,
-                "EControlSetStringDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetStringDescriptor"));
 		r = iController->SetStringDescriptor(iClient, (TUint8) (TInt) a1, *((TPtr8*) a2));
 		break;
 
 	case RDevUsbcClient::EControlRemoveStringDescriptor:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP66,
-                "EControlRemoveStringDescriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlRemoveStringDescriptor"));
 		r = iController->RemoveStringDescriptor((TUint8) (TInt) a1);
 		break;
 
@@ -1815,8 +1689,7 @@
 		break;
 
     default:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOCONTROL_DUP67,
-                "Function code not supported" );
+		__KTRACE_OPT(KUSB, Kern::Printf("Function code not supported"));
 		r = KErrNotSupported;
 		}
 
@@ -1831,16 +1704,14 @@
 	const TInt srcLen = Kern::ThreadGetDesLength(iClient, ifc_info_buf_ptr);
 	if (srcLen < ifc_info_buf.Length())
 		{
-		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE, 
-		        "SetInterface can't copy" );
+		__KTRACE_OPT(KUSB, Kern::Printf("SetInterface can't copy"));
 		PanicClientThread(EDesOverflow);
 		}
 
 	TInt r = Kern::ThreadDesRead(iClient, ifc_info_buf_ptr, ifc_info_buf, 0, KChunkShiftBy0);
 	if (r != KErrNone)
 		{
-	    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP1,
-	            "SetInterface Copy failed reason=%d", r );
+		__KTRACE_OPT(KUSB, Kern::Printf("SetInterface Copy failed reason=%d", r));
 		PanicClientThread(r);
 		}
 
@@ -1849,8 +1720,7 @@
 	// If an alternate interface is being asked for then do nothing,
 	// just pass it down to the Controller.
 	const TInt num_endpoints = ifc_info_buf().iTotalEndpointsUsed;
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP2,
-            "SetInterface num_endpoints=%d", num_endpoints );
+	__KTRACE_OPT(KUSB, Kern::Printf("SetInterface num_endpoints=%d", num_endpoints));
 
 	// [The next 4 variables have to be initialized here because of the goto's that follow.]
 	// Both IN and OUT buffers will be fully cached:
@@ -1861,8 +1731,7 @@
 	TInt real_ep_numbers[6] = {-1, -1, -1, -1, -1, -1};
 
     // See if PIL will accept this interface
-    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP3,
-            "SetInterface Calling controller" );
+	__KTRACE_OPT(KUSB, Kern::Printf("SetInterface Calling controller"));
 	r = iController->SetInterface(this,
 								  iClient,
 								  aInterfaceNumber,
@@ -1873,12 +1742,10 @@
 								  &real_ep_numbers,
 								  ifc_info_buf().iFeatureWord);
 
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP4,
-            "SetInterface controller returned %d", r );
+	__KTRACE_OPT(KUSB, Kern::Printf("SetInterface controller returned %d", r));
 	if (r != KErrNone)
 		{
-	    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP5, 
-	            "SetInterface failed reason=%d", r );
+		__KTRACE_OPT(KPANIC, Kern::Printf("SetInterface failed reason=%d", r));
 		return r;
 		}
 
@@ -1888,13 +1755,11 @@
 	// ep0
 	if (iEndpoint[0] == NULL)
 		{
-	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP6,
-	            "SetInterface 11" );
+		__KTRACE_OPT(KUSB, Kern::Printf("SetInterface 11"));
 		r = SetupEp0();
 		if (r != KErrNone)
 			{
-		    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP7,
-		            "  Error: SetupEp0() failed" );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: SetupEp0() failed"));
 			DestroyEp0();
 			goto F1;
 			}
@@ -1907,15 +1772,13 @@
 		goto F1;
 		}
 
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP8,
-            "DLddUsbcChannel::SetInterface num_endpoints=%d", num_endpoints );
+	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcChannel::SetInterface num_endpoints=%d", num_endpoints));
 
 	// other endpoints
 	// calculate the total buffer size
 	for (TInt i = 1; i <= num_endpoints; i++, pEndpointData++)
 		{
-	    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP9,
-	            "SetInterface for ep=%d", i );
+		__KTRACE_OPT(KUSB, Kern::Printf("SetInterface for ep=%d", i));
 		if (!ValidateEndpoint(pEndpointData))
 			{
 			r = KErrUsbBadEndpoint;
@@ -1935,9 +1798,8 @@
 			goto F2;
 			}
 
-	    OstTraceDefExt3( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP10,
-	            "SetInterface for ep=%d rec=0x%08x ep==0x%08x", i, 
-	            reinterpret_cast<TUint>(alternateSettingListRec), reinterpret_cast<TUint>(ep) );
+		__KTRACE_OPT(KUSB, Kern::Printf("SetInterface for ep=%d rec=0x%08x ep==0x%08x",
+										i, alternateSettingListRec, ep));
 		}
 
 	// buf size of each endpoint
@@ -1957,8 +1819,7 @@
 	    bufSizes[i] = alternateSettingListRec->iEndpoint[i]->BufferSize();
 	    }
 
-    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP11,
-            "Sort the endpoints:" );
+	__KTRACE_OPT(KUSB, Kern::Printf("Sort the endpoints:"));
 
     // sort the endpoint number by the bufsize decreasely
 	for( TInt i=1;i<num_endpoints;i++ )
@@ -1981,13 +1842,11 @@
 
 	    alternateSettingListRec->iEpNumDeOrderedByBufSize[i] = epNum[i];
 
-	    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP12,
-	            " %d:%d", epNum[i], bufSizes[i] );
+	    __KTRACE_OPT(KUSB, Kern::Printf(" %d:%d", epNum[i], bufSizes[i]));
 	    }
     alternateSettingListRec->iEpNumDeOrderedByBufSize[num_endpoints] = epNum[num_endpoints];
-    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP13,
-            " %d:%d", epNum[num_endpoints], bufSizes[num_endpoints] );
-    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP14, "\n" );
+    __KTRACE_OPT(KUSB, Kern::Printf(" %d:%d", epNum[num_endpoints], bufSizes[num_endpoints]));
+    __KTRACE_OPT(KUSB, Kern::Printf("\n"));
 
 	// chain in this alternate setting
 	alternateSettingListRec->iNext = iAlternateSettingList;
@@ -2005,23 +1864,20 @@
 	r = SetupInterfaceMemory(iHwChunks, cacheAttribs );
 	if( r==KErrNone )
 	    {
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP15,
-                "SetInterface ready to exit" );
+        __KTRACE_OPT(KUSB, Kern::Printf("SetInterface ready to exit"));
     
         if (aInterfaceNumber == 0)
             {
             // make sure we're ready to go with the main interface
             iValidInterface = ETrue;
-            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP16,
-                    "SetInterface SelectAlternateSetting" );
+            __KTRACE_OPT(KUSB, Kern::Printf("SetInterface SelectAlternateSetting"));
             SelectAlternateSetting(0);
             }
         return KErrNone;
 	    }
 	else
 	    {
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP17,
-                "Destroying all interfaces" );
+        __KTRACE_OPT(KUSB, Kern::Printf("Destroying all interfaces"));
         DestroyAllInterfaces();
         DestroyEp0();
         return r;
@@ -2033,13 +1889,8 @@
  
  F1:
 #if _DEBUG
-#ifdef OST_TRACE_COMPILER_IN_USE
 	TInt r1 = iController->ReleaseInterface(this, aInterfaceNumber);
-#else
-	(void)  iController->ReleaseInterface(this, aInterfaceNumber);
-#endif
-    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DLDDUSBCCHANNEL_SETINTERFACE_DUP18,
-            "Release Interface controller returned %d", r1 );
+	__KTRACE_OPT(KUSB, Kern::Printf("Release Interface controller returned %d", r1));
 #else
 	(void)	iController->ReleaseInterface(this, aInterfaceNumber);
 #endif
@@ -2058,15 +1909,13 @@
  
     // 1, collect all bufs' sizes for the current interface
     //    to realloc all the chunks
-    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY, 
-            "Collect all buffer sizes:" );
+    __KTRACE_OPT(KUSB, Kern::Printf("Collect all buffer sizes:"));
     RArray<TInt> bufSizes;
     for(TInt i=1;i<=numOfEp;i++)
         {
         TInt nextEp = asRec->iEpNumDeOrderedByBufSize[i];
         TInt epBufCount = asRec->iEndpoint[nextEp]->BufferNumber();
-        OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP1,
-                " ep %d, buf count %d", nextEp, epBufCount );
+        __KTRACE_OPT(KUSB, Kern::Printf(" ep %d, buf count %d", nextEp, epBufCount ));
         for(TInt k=0;k<epBufCount;k++)
             {
             TInt epBufSize = asRec->iEndpoint[nextEp]->BufferSize();
@@ -2077,20 +1926,17 @@
                 bufSizes.Close();
                 return r;
                 }
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP2,
-                    " %d", epBufSize );
+            __KTRACE_OPT(KUSB,Kern::Printf(" %d", epBufSize ));
             }
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP3, "\n" );
+        __KTRACE_OPT(KUSB, Kern::Printf("\n"));
 
         }
    
     // 2, alloc the buffer decreasely, biggest-->smallest
     //   2.1 check the existing chunks
     TInt bufCount = bufSizes.Count();
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP4,
-            " ep buf number needed %d", bufCount );
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP5,
-            " chunks available %d", aHwChunks.Count() );
+    __KTRACE_OPT(KUSB, Kern::Printf(" ep buf number needed %d", bufCount ));
+    __KTRACE_OPT(KUSB, Kern::Printf(" chunks available %d", aHwChunks.Count() ));
 
     TInt chunkInd = 0;
     while( (chunkInd<aHwChunks.Count())&& (chunkInd<bufCount))
@@ -2101,8 +1947,7 @@
         DPlatChunkHw* chunk = ReAllocate(bufSizes[chunkInd], aHwChunks[chunkInd], aCacheAttribs);
         if (chunk == NULL)
             {
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP6,
-                    "Failed to alloc chunks size %d!", bufSizes[chunkInd] );
+            __KTRACE_OPT(KUSB, Kern::Printf("Failed to alloc chunks size %d!", bufSizes[chunkInd]));
             // lost all interfaces:
             // Tell Controller to release Interface and h/w resources associated with this
             iController->DeRegisterClient(this);
@@ -2113,9 +1958,7 @@
             {
             // Parcel out the memory between endpoints
             TUint8* newAddr = reinterpret_cast<TUint8*>(chunk->LinearAddress());
-            OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP7,
-                    "SetupInterfaceMemory alloc new chunk=0x%x, size=%d", 
-                    reinterpret_cast<TUint>(newAddr), bufSizes[chunkInd] );
+            __KTRACE_OPT(KUSB, Kern::Printf("SetupInterfaceMemory alloc new chunk=0x%x, size=%d", newAddr,bufSizes[chunkInd]));
             // The check is important to avoid chunkChanged to be corrupted.
             // This code change is to fix the problem that one chunk is used by multiple interfaces.
             if(!chunkChanged)
@@ -2134,8 +1977,7 @@
         chunk = Allocate( bufSizes[chunkInd], aCacheAttribs);
         if (chunk == NULL)
             {
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP8,
-                    "Failed to alloc chunk, size %d!", bufSizes[chunkInd] );
+            __KTRACE_OPT(KUSB, Kern::Printf("Failed to alloc chunk, size %d!", bufSizes[chunkInd]));
             // lost all interfaces:
             // Tell Controller to release Interface and h/w resources associated with this
             iController->DeRegisterClient(this);
@@ -2145,10 +1987,8 @@
         else
             {
             // Parcel out the memory between endpoints
-            OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP9,
-                    "SetupInterfaceMemory alloc new chunk=0x%x, size=%d",
-                    static_cast<TUint>(chunk->LinearAddress()), bufSizes[chunkInd]);
-
+            __KTRACE_OPT(KUSB, Kern::Printf("SetupInterfaceMemory alloc new chunk=0x%x, size=%d",
+            						reinterpret_cast<TUint8*>(chunk->LinearAddress()), bufSizes[chunkInd]));
             TInt r = aHwChunks.Append(chunk);
             if(r!=KErrNone)
                 {
@@ -2167,14 +2007,12 @@
 
     if(chunkChanged)
         {
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP10,
-                "SetupInterfaceMemory readdressing." );
+        __KTRACE_OPT(KUSB, Kern::Printf("SetupInterfaceMemory readdressing."));
         asRec = asRec->iNext;
         while (asRec)
             {
             // Interfaces are not concurrent so they can all start at the same logical address
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP11,
-                    "SetupInterfaceMemory readdressing setting=%d", asRec->iSetting );
+            __KTRACE_OPT(KUSB, Kern::Printf("SetupInterfaceMemory readdressing setting=%d", asRec->iSetting));
             ReSetInterfaceMemory(asRec, aHwChunks);
             asRec = asRec->iNext;
             }
@@ -2184,8 +2022,7 @@
 
 TInt DLddUsbcChannel::SetupEp0()
 	{
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPEP0, 
-	        "SetupEp0 entry %x", this );
+	__KTRACE_OPT(KUSB, Kern::Printf("SetupEp0 entry %x", this));
 	TInt ep0Size = iController->Ep0PacketSize();
 	TUsbcEndpointInfo ep0Info = TUsbcEndpointInfo(KUsbEpTypeControl, KUsbEpDirBidirect, ep0Size);
 	TUsbcEndpoint* ep0 = new TUsbcEndpoint(this, iController, &ep0Info, 0, 0);
@@ -2221,10 +2058,8 @@
         TUint8 * buf;
         buf = (TUint8*) chunk->LinearAddress();
         ep0->SetBufferAddr( i, buf);
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPEP0_DUP1,
-                "SetupEp0 60 buffer number %d", i );
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_SETUPEP0_DUP2,
-                "SetupEp0 60 buffer size %d", bufferSize );
+        __KTRACE_OPT(KUSB, Kern::Printf("SetupEp0 60 buffer number %d", i));
+        __KTRACE_OPT(KUSB, Kern::Printf("SetupEp0 60 buffer size %d", bufferSize));
         }
 
     ep0->SetRealEpNumber(0);
@@ -2254,17 +2089,11 @@
                 TUint8* pBuf = NULL;
                 pBuf = reinterpret_cast<TUint8*>(aHwChunks[chunkInd]->LinearAddress());
                 ep->SetBufferAddr( k, pBuf);
-                OstTraceDefExt3( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_RESETINTERFACEMEMORY,
-                        "  ep %d, buf %d, addr 0x%x", nextEp, k, reinterpret_cast<TUint>(pBuf) );
+                __KTRACE_OPT(KUSB, Kern::Printf("  ep %d, buf %d, addr 0x%x", nextEp, k, pBuf ));
                 chunkInd++;
-#ifdef _DEBUG
-                if (chunkInd > aHwChunks.Count())
-                    {
-                    OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DLDDUSBCCHANNEL_RESETINTERFACEMEMORY_DUP1,
-                            "  Error: available chunks %d, run out at epInd%d, bufInd%d",
-                            aHwChunks.Count(), i, k );
-                    }
-#endif
+                __ASSERT_DEBUG(chunkInd<=aHwChunks.Count(),
+                               Kern::Printf("  Error: available chunks %d, run out at epInd%d, bufInd%d",
+                                       aHwChunks.Count(), i, k));
                 __ASSERT_DEBUG(chunkInd<=aHwChunks.Count(),
                                    Kern::Fault("usbc.ldd", __LINE__));
                 }
@@ -2360,8 +2189,7 @@
 
 void DLddUsbcChannel::EndpointStatusChangeCallback(TAny* aDLddUsbcChannel)
     {
-    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_ENDPOINTSTATUSCHANGECALLBACK,
-            "EndpointStatusChangeCallback" );
+	__KTRACE_OPT(KUSB, Kern::Printf("EndpointStatusChangeCallback"));
     DLddUsbcChannel* dUsbc = (DLddUsbcChannel*) aDLddUsbcChannel;
 	if (dUsbc->iChannelClosing)
 		return;
@@ -2369,8 +2197,7 @@
 	const TInt reqNo = (TInt) RDevUsbcClient::ERequestEndpointStatusNotify;
 	if (dUsbc->iRequestStatus[reqNo])
 		{
-	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_ENDPOINTSTATUSCHANGECALLBACK_DUP1,
-	            "EndpointStatusChangeCallback Notify status" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EndpointStatusChangeCallback Notify status"));
 		DThread* client = dUsbc->iClient;
 		
 		dUsbc->iEndpointStatusChangeReq->Data() = endpointState;
@@ -2393,8 +2220,7 @@
  		 (i < KUsbcDeviceStateRequests) && ((deviceState = dUsbc->iStatusCallbackInfo.State(i)) != EUsbcNoState);
  		 ++i)
 		{
-		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_STATUSCHANGECALLBACK, 
-		        "StatusChangeCallBack status=%d", static_cast<TInt>(deviceState) );
+ 		__KTRACE_OPT(KUSB, Kern::Printf("StatusChangeCallBack status=%d", deviceState));
 		if (deviceState & KUsbAlternateSetting)
 			{
 			dUsbc->ProcessAlternateSetting(deviceState);
@@ -2424,8 +2250,7 @@
 
 void DLddUsbcChannel::OtgFeatureChangeCallback(TAny* aDLddUsbcChannel)
     {
-    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_OTGFEATURECHANGECALLBACK,
-            "OtgFeatureChangeCallback" );
+	__KTRACE_OPT(KUSB, Kern::Printf("OtgFeatureChangeCallback"));
     DLddUsbcChannel* dUsbc = (DLddUsbcChannel*) aDLddUsbcChannel;
 	if (dUsbc->iChannelClosing)
 		return;
@@ -2437,8 +2262,7 @@
     const TInt reqNo = (TInt) RDevUsbcClient::ERequestOtgFeaturesNotify;
 	if (dUsbc->iRequestStatus[reqNo])
 		{
-	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_OTGFEATURECHANGECALLBACK_DUP1,
-	            "OtgFeatureChangeCallback Notify status" );
+		__KTRACE_OPT(KUSB, Kern::Printf("OtgFeatureChangeCallback Notify status"));
 		dUsbc->iOtgFeatureChangeReq->Data()=features;
 		dUsbc->iRequestStatus[reqNo] = NULL;
 		Kern::QueueRequestComplete(dUsbc->iClient,dUsbc->iOtgFeatureChangeReq,KErrNone);
@@ -2489,15 +2313,14 @@
 				}
 			else
 				{
-				OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_EPFROMALTERNATESETTING,
-				        "  Error: aEndpoint %d wrong for aAlternateSetting %d", aEndpoint, aAlternateSetting );
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: aEndpoint %d wrong for aAlternateSetting %d",
+												  aEndpoint, aAlternateSetting));
 				return -1;
 				}
 			}
 		alternateSettingListRec = alternateSettingListRec->iNext;
 		}
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_EPFROMALTERNATESETTING_DUP1,
-            "  Error: no aAlternateSetting %d found", aAlternateSetting );
+	__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no aAlternateSetting %d found", aAlternateSetting));
 	return -1;
 	}
 
@@ -2505,12 +2328,9 @@
 TInt DLddUsbcChannel::ProcessAlternateSetting(TUint aAlternateSetting)
 	{
 	ResetInterface(KErrUsbInterfaceChange);					// kill any outstanding transfers
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_PROCESSALTERNATESETTING,
-	        "ProcessAlternateSetting 0x%08x", aAlternateSetting );
+	__KTRACE_OPT(KUSB, Kern::Printf("ProcessAlternateSetting 0x%08x", aAlternateSetting));
 	TUint newSetting = aAlternateSetting&(~KUsbAlternateSetting);
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_PROCESSALTERNATESETTING_DUP1,
-            "ProcessAlternateSetting selecting alternate setting 0x%08x", newSetting );
-
+	__KTRACE_OPT(KUSB, Kern::Printf("ProcessAlternateSetting selecting alternate setting 0x%08x", newSetting));
 	TInt r = SelectAlternateSetting(newSetting);
 	if (r != KErrNone)
 		return r;
@@ -2522,23 +2342,19 @@
 
 TInt DLddUsbcChannel::ProcessDeviceState(TUsbcDeviceState aDeviceState)
 	{
-	OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_PROCESSDEVICESTATE,
-	        "ProcessDeviceState(%d -> %d)", iDeviceState, aDeviceState );
+	__KTRACE_OPT(KUSB, Kern::Printf("ProcessDeviceState(%d -> %d)", iDeviceState, aDeviceState));
 	if (iDeviceState == aDeviceState)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP1,
-                "  No state change => nothing to be done." );
+		__KTRACE_OPT(KUSB, Kern::Printf("  No state change => nothing to be done."));
 		return KErrNone;
 		}
 	if (iDeviceState == EUsbcDeviceStateSuspended)
 		{
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP2,
-                "  Coming out of Suspend: old state = %d", iOldDeviceState );
+		__KTRACE_OPT(KUSB, Kern::Printf("  Coming out of Suspend: old state = %d", iOldDeviceState));
 		iDeviceState = iOldDeviceState;
 		if (iDeviceState == aDeviceState)
 			{
-	        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP3,
-	                "  New state same as before Suspend => nothing to be done." );
+			__KTRACE_OPT(KUSB, Kern::Printf("  New state same as before Suspend => nothing to be done."));
 			return KErrNone;
 			}
 		}
@@ -2547,8 +2363,7 @@
 	TInt cancellationCode = KErrNone;
 	if (aDeviceState == EUsbcDeviceStateSuspended)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP4,
-                "  Suspending..." );
+		__KTRACE_OPT(KUSB, Kern::Printf("  Suspending..."));
 		iOldDeviceState = iDeviceState;
 		// Put PSL into low power mode here
 		}
@@ -2568,8 +2383,7 @@
 				cancellationCode = KErrUsbDeviceNotConfigured;
 			}
 		}
-    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP5,
-            "  %d --> %d", iDeviceState, aDeviceState );
+	__KTRACE_OPT(KUSB, Kern::Printf("  %d --> %d", iDeviceState, aDeviceState));
 	iDeviceState = aDeviceState;
 	if (iValidInterface || iOwnsDeviceControl)
 		{
@@ -2612,24 +2426,17 @@
 		const TInt size = iController->EndpointPacketSize(this, iEndpoint[i]->RealEpNumber());
 		if (size < 0)
 			{
-			OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCCHANNEL_UPDATEENDPOINTSIZES,
-			        "  Error: Packet size < 0 for ep %d", i );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Packet size < 0 for ep %d", i));
 			continue;
 			}
 		iEndpoint[i]->SetMaxPacketSize(size);
 		}
-#ifdef _DEBUG
-	if (i != iNumberOfEndpoints + 1)
-	    {
-        OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_FATAL, DLDDUSBCCHANNEL_UPDATEENDPOINTSIZES_DUP1,
-                "  Error: iNumberOfEndpoints wrong (%d)", iNumberOfEndpoints );
-
-	    }
-#endif
+	__ASSERT_DEBUG(i == iNumberOfEndpoints + 1,
+				   Kern::Printf("  Error: iNumberOfEndpoints wrong (%d)", iNumberOfEndpoints));
 	}
 
 
-DPlatChunkHw* DLddUsbcChannel::ReAllocate(TInt aBuffersize, DPlatChunkHw* aHwChunk,TUint32 aCacheAttribs)
+DPlatChunkHw* DLddUsbcChannel::ReAllocate(TInt aBuffersize, DPlatChunkHw* aHwChunk, TUint32 aCacheAttribs)
 	{
 	DPlatChunkHw* chunk = aHwChunk;
 	if ((!chunk) || (chunk->iSize < aBuffersize))
@@ -2638,8 +2445,7 @@
 			{
 			ClosePhysicalChunk(chunk);
 			}
-		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_REALLOCATE, 
-		        "ReAllocate need to get new chunk" );
+		__KTRACE_OPT(KUSB, Kern::Printf("ReAllocate need to get new chunk"));
 		chunk = Allocate(aBuffersize, aCacheAttribs);
 		}
 	return chunk;
@@ -2705,8 +2511,7 @@
 			{
 			// Device state waiting to be sent userside
 			completeNow = ETrue;
-			OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_ALTERNATEDEVICESTATETESTCOMPLETE,
-			        "StatusChangeCallback Notify status" );
+			__KTRACE_OPT(KUSB, Kern::Printf("StatusChangeCallback Notify status"));
 			iStatusChangeReq->Data()=deviceState;
 			iStatusChangePtr = NULL;
 			}
@@ -2723,8 +2528,7 @@
 
 void DLddUsbcChannel::DeConfigure(TInt aErrorCode)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DECONFIGURE,
-	        "DLddUsbcChannel::DeConfigure()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcChannel::DeConfigure()"));
 	// Called after deconfiguration. Cancels transfers on all endpoints.
 	ResetInterface(aErrorCode);
 	// Cancel the endpoint status notify request if it is outstanding.
@@ -2762,8 +2566,7 @@
 		// Reset each endpoint except ep0
 		for (TInt i = 1; i <= iNumberOfEndpoints; i++)
 			{
-			OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_RESETINTERFACE,
-			        "Cancelling transfer ep=%d", i );
+			__KTRACE_OPT(KUSB, Kern::Printf("Cancelling transfer ep=%d", i));
 			iEndpoint[i]->CancelTransfer(iClient,iClientAsynchNotify[i]->iClientBuffer);			// Copies data userside
 			iEndpoint[i]->AbortTransfer();					// kills any ldd->pil outstanding transfers
 			iEndpoint[i]->iDmaBuffers->Flush();
@@ -2808,16 +2611,14 @@
 
 TInt DLddUsbcChannel::DoEmergencyComplete()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOEMERGENCYCOMPLETE,
-	        "TUsbcEndpoint::DoEmergencyComplete" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpoint::DoEmergencyComplete"));
 	// cancel any pending DFCs
 	// complete all client requests
     for (TInt i = 0; i < KUsbcMaxRequests; i++)
         {
         if (iRequestStatus[i])
             {
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCCHANNEL_DOEMERGENCYCOMPLETE_DUP1,
-                    "Complete request 0x%x", iRequestStatus[i] );
+            __KTRACE_OPT(KUSB, Kern::Printf("Complete request 0x%x", iRequestStatus[i]));
 
             if (i == RDevUsbcClient::ERequestAlternateDeviceStatusNotify)
                 {
@@ -2923,8 +2724,7 @@
 	  iBandwidthPriority(aBandwidthPriority)
 	{
  	ResetTransferInfo();
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCENDPOINT_TUSBCENDPOINT_CONS, 
-	        "TUsbcEndpoint::TUsbcEndpoint 2" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpoint::TUsbcEndpoint 2"));
 	}
 
 
@@ -2956,8 +2756,7 @@
 
 TUsbcEndpoint::~TUsbcEndpoint()
 	{
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCENDPOINT_TUSBCENDPOINT_DES, 
-	        "TUsbcEndpoint::~TUsbcEndpoint(%d)", iEndpointNumber );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpoint::~TUsbcEndpoint(%d)", iEndpointNumber));
 	AbortTransfer();
 	delete iRequestCallbackInfo;
 	delete iDmaBuffers;
@@ -2966,8 +2765,7 @@
 
 void TUsbcEndpoint::RequestCallback(TAny* aTUsbcEndpoint)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_REQUESTCALLBACK, 
-	        "TUsbcEndpoint::RequestCallback" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpoint::RequestCallback"));
 	((TUsbcEndpoint*) aTUsbcEndpoint)->EndpointComplete();
 	}
 
@@ -2981,13 +2779,12 @@
 
 TInt TUsbcEndpoint::EndpointComplete()
 	{
-    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_ENDPOINTCOMPLETE, 
-            "TUsbcEndpoint::EndpointComplete ep=%d %d", iEndpointNumber, iRequestCallbackInfo->iEndpointNum );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpoint::EndpointComplete ep=%d %d",
+									iEndpointNumber, iRequestCallbackInfo->iEndpointNum));
 
 	if (iLdd->ChannelClosing())
 		{
-	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP1,
-	            "We're going home -> completions no longer accepted" );
+		__KTRACE_OPT(KUSB, Kern::Printf("We're going home -> completions no longer accepted"));
 		return KErrNone;
 		}
 
@@ -2999,12 +2796,10 @@
 
 	case EControllerWrite:
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP2,
-                "TUsbcEndpoint::EndpointComplete Write 2" );
+		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpoint::EndpointComplete Write 2"));
 		if (!iDmaBuffers->TxIsActive())
 			{
-	        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP3,
-	                "  TX completion but !iDmaBuffers->TxIsActive()" );
+			__KTRACE_OPT(KUSB, Kern::Printf("  TX completion but !iDmaBuffers->TxIsActive()"));
 			break;
 			}
 
@@ -3060,10 +2855,8 @@
 		if (iClientReadPending)
 			{
 			//Complete outstanding read
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP4,
-                    "TUsbcEndpoint::EndpointComplete Read 3 (bytes available=%d)", 
-                    iDmaBuffers->RxBytesAvailable());
-
+			__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpoint::EndpointComplete Read 3 (bytes "
+											"available=%d)", iDmaBuffers->RxBytesAvailable()));
 			TInt bytesReqd = iTransferInfo.iTransferSize - iBytesTransferred;
 			TBool completeNow = EFalse;
 
@@ -3164,8 +2957,7 @@
 	const TBool KReadData = EFalse;
 	const TBool KReadUntilShort = ETrue;
 
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_COPYTOCLIENT, 
-            "CopyToClient: length = %d", length );
+	__KTRACE_OPT(KUSB, Kern::Printf("CopyToClient: length = %d", length));
 
 	if (iTransferInfo.iTransferType == ETransferTypeReadPacket)
 		{
@@ -3201,15 +2993,13 @@
 
 TInt TUsbcEndpoint::TryToStartRead(TBool aReEntrant)
 	{
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_TRYTOSTARTREAD,
-	        "TryToStartRead 1 ep=%d", iEndpointNumber );
+	__KTRACE_OPT(KUSB, Kern::Printf("TryToStartRead 1 ep=%d", iEndpointNumber));
 	TInt r = KErrNone;
 	if (iEndpointInfo.iDir != KUsbEpDirOut &&
 		iEndpointInfo.iDir != KUsbEpDirBidirect)
 		{
 		// Verify ep direction
-		  OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_TRYTOSTARTREAD_DUP1,
-		          "TryToStartRead wrong direction ep=%d", iEndpointNumber );
+		__KTRACE_OPT(KUSB, Kern::Printf("TryToStartRead wrong direction ep=%d", iEndpointNumber));
 		return KErrUsbEpBadDirection;
 		}
 
@@ -3218,15 +3008,12 @@
 		// Can't issue an Ep0 read if reader or writer is active
 		if (iDmaBuffers->TxIsActive())
 			{
-            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_TRYTOSTARTREAD_DUP2,
-                    "TryToStartRead ep0 Tx already active FATAL" );
-
+			__KTRACE_OPT(KUSB, Kern::Printf("TryToStartRead ep0 Tx already active FATAL"));
 			return KErrUsbEpNotReady;
 			}
 		if (iDmaBuffers->RxIsActive())
 			{
-            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_TRYTOSTARTREAD_DUP3,
-                    "TryToStartRead ep0 Rx already active non-FATAL" );
+			__KTRACE_OPT(KUSB, Kern::Printf("TryToStartRead ep0 Rx already active non-FATAL"));
 			}
 		}
 
@@ -3242,15 +3029,14 @@
 			{
 			iDmaBuffers->RxSetActive();
 			iRequestCallbackInfo->SetRxBufferInfo(bufferAddr, physAddr, indexArray, sizeArray, length);
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_TRYTOSTARTREAD_DUP4,
-                    "TryToStartRead 2 bufferAddr=0x%08x", bufferAddr );
+
+			__KTRACE_OPT(KUSB, Kern::Printf("TryToStartRead 2 bufferAddr=0x%08x", bufferAddr));
 
 			r = iController->SetupReadBuffer(*iRequestCallbackInfo);
 			if (r != KErrNone)
 				{
 				iDmaBuffers->RxSetInActive();
-	            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_TRYTOSTARTREAD_DUP5,
-	                    "  Error: TryToStartRead controller rejects read" );
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: TryToStartRead controller rejects read"));
 				}
 			}
 		else
@@ -3276,8 +3062,7 @@
 
 TInt TUsbcEndpoint::TryToStartWrite(TEndpointTransferInfo* pTfr)
 	{
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_TRYTOSTARTWRITE,
-	        "TryToStartWrite 1 ep=%d", iEndpointNumber );
+	__KTRACE_OPT(KUSB, Kern::Printf("TryToStartWrite 1 ep=%d", iEndpointNumber));
 	if (iEndpointInfo.iDir != KUsbEpDirIn &&
 		iEndpointInfo.iDir != KUsbEpDirBidirect)
 		{
@@ -3306,16 +3091,14 @@
 
 TInt TUsbcEndpoint::ContinueWrite()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_CONTINUEWRITE, "ContinueWrite 2" );
+	__KTRACE_OPT(KUSB, Kern::Printf("ContinueWrite 2"));
 	TUint8* bufferAddr;
 	TPhysAddr physAddr;
 	TInt bufferLength;
 	TInt r = iDmaBuffers->TxGetNextXfer(bufferAddr, bufferLength, physAddr);
 	if (r != KErrNone)											// probably already active
 		return r;
-    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_CONTINUEWRITE_DUP1,
-            "ContinueWrite 3" );
-
+	__KTRACE_OPT(KUSB, Kern::Printf("ContinueWrite 3"));
 	iDmaBuffers->TxSetActive();
 	TBool zlpReqd = EFalse;
 	TUint32 transferSize = iTransferInfo.iTransferSize;
@@ -3334,9 +3117,7 @@
 #if 0
 	for (TInt i = 0; i < iRequestCallbackInfo->iLength; i++)
 		{
-	    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_CONTINUEWRITE_DUP2,
-	            "Buffer[%d] = 0x%02x", i, iRequestCallbackInfo->iBufferStart[i] );
-
+		__KTRACE_OPT(KUSB, Kern::Printf("Buffer[%d] = 0x%02x", i, iRequestCallbackInfo->iBufferStart[i]));
 		}
 #endif
 	r = iController->SetupWriteBuffer(*iRequestCallbackInfo);
@@ -3346,21 +3127,19 @@
 
 void TUsbcEndpoint::CancelTransfer(DThread* aThread, TClientBuffer *aTcb)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_CANCELTRANSFER, "CancelTransfer" );
+	__KTRACE_OPT(KUSB, Kern::Printf("CancelTransfer"));
 	if (iDmaBuffers != NULL)
 		{
 		if (iClientWritePending)
 			{
-            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_CANCELTRANSFER_DUP1,
-                    "  (iClientWritePending)" );
+			__KTRACE_OPT(KUSB, Kern::Printf("  (iClientWritePending)"));
 			iClientWritePending = EFalse;
 			iController->CancelWriteBuffer(iLdd, iRealEpNumber);
 			iDmaBuffers->TxSetInActive();
 			}
 		if (iClientReadPending)
 			{
-            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_CANCELTRANSFER_DUP2,
-                    "  (iClientReadPending)" );
+			__KTRACE_OPT(KUSB, Kern::Printf("  (iClientReadPending)"));
 			iClientReadPending = EFalse;
 			CopyToClient(aThread,aTcb);
 			}
@@ -3370,20 +3149,18 @@
 
 void TUsbcEndpoint::AbortTransfer()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_ABORTTRANSFER, "Abort Transfer" );
+	__KTRACE_OPT(KUSB, Kern::Printf("Abort Transfer"));
 	if (iDmaBuffers != NULL)
 		{
 		if (iDmaBuffers->TxIsActive())
 			{
-            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_ABORTTRANSFER_DUP1,
-                    "  (iClientWritePending)" );
+			__KTRACE_OPT(KUSB, Kern::Printf("  (iClientWritePending)"));
 			iController->CancelWriteBuffer(iLdd, iRealEpNumber);
 			iDmaBuffers->TxSetInActive();
 			}
 		if (iDmaBuffers->RxIsActive())
 			{
-            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINT_ABORTTRANSFER_DUP2,
-                    "  (iClientReadPending)" );
+			__KTRACE_OPT(KUSB, Kern::Printf("  (iClientReadPending)"));
 			iController->CancelReadBuffer(iLdd, iRealEpNumber);
 			iDmaBuffers->RxSetInActive();
 			}
@@ -3407,8 +3184,7 @@
 
 TUsbcAlternateSettingList::~TUsbcAlternateSettingList()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCALTERNATESETTINGLIST_TUSBCALTERNATESETTINGLIST_DES,
-	        "TUsbcAlternateSettingList::~TUsbcAlternateSettingList()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcAlternateSettingList::~TUsbcAlternateSettingList()"));
 	for (TInt i = 0; i <= KMaxEndpointsPerClient; i++)
 		{
 		delete iEndpoint[i];
--- a/kernel/eka/drivers/usbc/traces/OstTraceDefinitions.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-// 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:
-// 
-//
-
-
-#ifndef __OSTTRACEDEFINITIONS_H__
-#define __OSTTRACEDEFINITIONS_H__
-// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
-// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
-// #define OST_TRACE_COMPILER_IN_USE
-#include <opensystemtrace.h>
-#endif
--- a/kernel/eka/drivers/usbc/traces/fixed_id.definitions	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,442 +0,0 @@
-#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
-[GROUP]TRACE_FATAL=0x81
-[GROUP]TRACE_FLOW=0x8a
-[GROUP]TRACE_NORMAL=0x86
-[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOCONTROL_DUP43=0x24
-[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOCONTROL_DUP47=0x25
-[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP15=0x20
-[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP17=0x21
-[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP19=0x22
-[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP2=0x1d
-[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP20=0x23
-[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP3=0x1e
-[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP8=0x1f
-[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_EPFROMALTERNATESETTING=0x27
-[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_EPFROMALTERNATESETTING_DUP1=0x28
-[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_SETINTERFACE_DUP7=0x26
-[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_UPDATEENDPOINTSIZES=0x29
-[TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_UPDATEENDPOINTSIZES_DUP1=0x2a
-[TRACE]TRACE_FATAL[0x81]_DUSBCLOGDEVICE_INSTALL=0x1c
-[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCCHANNEL_DLDDUSBCCHANNEL_CONS=0x7
-[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCCHANNEL_DLDDUSBCCHANNEL_DES=0x8
-[TRACE]TRACE_FLOW[0x8A]_TDMABUF_TDMABUF_DES=0x6
-[TRACE]TRACE_FLOW[0x8A]_TUSBCALTERNATESETTINGLIST_TUSBCALTERNATESETTINGLIST_DES=0xb
-[TRACE]TRACE_FLOW[0x8A]_TUSBCENDPOINT_TUSBCENDPOINT_CONS=0x9
-[TRACE]TRACE_FLOW[0x8A]_TUSBCENDPOINT_TUSBCENDPOINT_DES=0xa
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_ALTERNATEDEVICESTATETESTCOMPLETE=0x16d
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DECONFIGURE=0x16e
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL=0xf3
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP1=0xf4
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP2=0xf5
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP3=0xf6
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP4=0xf7
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP5=0xf8
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP6=0xf9
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL=0xfa
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP1=0xfb
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP10=0x104
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP11=0x105
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP12=0x106
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP13=0x107
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP14=0x108
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP15=0x109
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP16=0x10a
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP17=0x10b
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP18=0x10c
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP19=0x10d
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP2=0xfc
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP20=0x10e
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP21=0x10f
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP22=0x110
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP23=0x111
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP24=0x112
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP25=0x113
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP26=0x114
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP27=0x115
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP28=0x116
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP29=0x117
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP3=0xfd
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP30=0x118
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP31=0x119
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP32=0x11a
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP33=0x11b
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP34=0x11c
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP35=0x11d
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP36=0x11e
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP37=0x11f
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP38=0x120
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP39=0x121
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP4=0xfe
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP40=0x122
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP41=0x123
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP42=0x124
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP44=0x125
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP45=0x126
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP46=0x127
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP48=0x128
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP49=0x129
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP5=0xff
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP50=0x12a
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP51=0x12b
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP52=0x12c
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP53=0x12d
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP54=0x12e
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP55=0x12f
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP56=0x130
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP57=0x131
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP58=0x132
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP59=0x133
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP6=0x100
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP60=0x134
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP61=0x135
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP62=0x136
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP63=0x137
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP64=0x138
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP65=0x139
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP66=0x13a
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP67=0x13b
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP7=0x101
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP8=0x102
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP9=0x103
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCREATE=0xde
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOEMERGENCYCOMPLETE=0x170
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOEMERGENCYCOMPLETE_DUP1=0x171
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOOTHERASYNCREQ=0xe1
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOOTHERASYNCREQ_DUP1=0xe2
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOOTHERASYNCREQ_DUP2=0xe3
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOOTHERASYNCREQ_DUP3=0xe4
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOREQUEST=0xe0
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ=0xe5
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP1=0xe6
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP10=0xec
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP11=0xed
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP12=0xee
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP13=0xef
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP14=0xf0
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP16=0xf1
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP18=0xf2
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP4=0xe7
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP5=0xe8
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP6=0xe9
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP7=0xea
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP9=0xeb
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_ENDPOINTSTATUSCHANGECALLBACK=0x15f
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_ENDPOINTSTATUSCHANGECALLBACK_DUP1=0x160
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_OTGFEATURECHANGECALLBACK=0x162
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_OTGFEATURECHANGECALLBACK_DUP1=0x163
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSALTERNATESETTING=0x164
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSALTERNATESETTING_DUP1=0x165
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE=0x166
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP1=0x167
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP2=0x168
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP3=0x169
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP4=0x16a
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP5=0x16b
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_REALLOCATE=0x16c
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_REQUESTUSERHANDLE=0xdf
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_RESETINTERFACE=0x16f
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_RESETINTERFACEMEMORY=0x15d
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_RESETINTERFACEMEMORY_DUP1=0x15e
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE=0x13c
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP1=0x13d
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP10=0x145
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP11=0x146
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP12=0x147
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP13=0x148
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP14=0x149
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP15=0x14a
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP16=0x14b
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP17=0x14c
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP18=0x14d
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP2=0x13e
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP3=0x13f
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP4=0x140
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP5=0x141
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP6=0x142
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP8=0x143
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP9=0x144
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPEP0=0x15a
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPEP0_DUP1=0x15b
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPEP0_DUP2=0x15c
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY=0x14e
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP1=0x14f
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP10=0x158
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP11=0x159
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP2=0x150
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP3=0x151
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP4=0x152
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP5=0x153
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP6=0x154
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP7=0x155
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP8=0x156
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP9=0x157
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_STATUSCHANGECALLBACK=0x161
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_ADDTODRAINQUEUE=0xd9
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_CONSTRUCT=0xdd
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_CONSTRUCT_DUP1=0xb9
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_CONSTRUCT_DUP2=0xbb
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_FLUSH=0xbd
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_ISREADEREMPTY=0xc0
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_NEXTDRAINABLEBUFFER=0xd7
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_READXFERCOMPLETE=0xc1
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYDATATOCLIENT=0xce
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYDATATOCLIENT_DUP1=0xcf
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYDATATOCLIENT_DUP2=0xd0
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYDATATOCLIENT_DUP3=0xd1
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYDATATOCLIENT_DUP4=0xd2
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYDATATOCLIENT_DUP5=0xd3
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYDATATOCLIENT_DUP6=0xd4
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYDATATOCLIENT_DUP7=0xd5
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYDATATOCLIENT_DUP8=0xd6
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYPACKETTOCLIENT=0xc6
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYPACKETTOCLIENT_DUP1=0xc7
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYPACKETTOCLIENT_DUP2=0xc8
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYPACKETTOCLIENT_DUP3=0xc9
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYPACKETTOCLIENT_DUP4=0xcb
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYPACKETTOCLIENT_DUP5=0xcc
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYPACKETTOCLIENT_DUP6=0xcd
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXGETNEXTXFER=0xc2
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXGETNEXTXFER_DUP1=0xc3
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXGETNEXTXFER_DUP2=0xc4
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXGETNEXTXFER_DUP3=0xc5
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXSETACTIVE=0xbe
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXSETINACTIVE=0xbf
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_SETBUFFERADDR=0xbc
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_SHORTPACKETEXISTS=0xd8
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_TXSTOREDATA=0xda
-[TRACE]TRACE_NORMAL[0x86]_TDMABUF_TXSTOREDATA_DUP1=0xdb
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ABORTTRANSFER=0x186
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ABORTTRANSFER_DUP1=0x187
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ABORTTRANSFER_DUP2=0x188
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CANCELTRANSFER=0x183
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CANCELTRANSFER_DUP1=0x184
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CANCELTRANSFER_DUP2=0x185
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CONTINUEWRITE=0x180
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CONTINUEWRITE_DUP1=0x181
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CONTINUEWRITE_DUP2=0x182
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_COPYTOCLIENT=0x178
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ENDPOINTCOMPLETE=0x173
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP1=0x174
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP2=0x175
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP3=0x176
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP4=0x177
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_REQUESTCALLBACK=0x172
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD=0x179
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD_DUP1=0x17a
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD_DUP2=0x17b
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD_DUP3=0x17c
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD_DUP4=0x17d
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD_DUP5=0x17e
-[TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTWRITE=0x17f
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOCANCEL=0xb
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOCANCEL_DUP1=0xc
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOCANCEL_DUP2=0xd
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOCANCEL_DUP3=0xe
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOCANCEL_DUP4=0xf
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOCANCEL_DUP5=0x10
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOCANCEL_DUP6=0x11
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOCONTROL_DUP43=0x12
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOCONTROL_DUP47=0x13
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP15=0x5
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP17=0x6
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP19=0x9
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP2=0x2
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP20=0xa
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP3=0x3
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP8=0x4
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_EPFROMALTERNATESETTING=0x15
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_EPFROMALTERNATESETTING_DUP1=0x16
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_PROCESSALTERNATESETTING=0x17
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_PROCESSALTERNATESETTING_DUP1=0x18
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE=0x19
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_SETINTERFACE_DUP7=0x14
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_UPDATEENDPOINTSIZES=0x1a
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCCHANNEL_UPDATEENDPOINTSIZES_DUP1=0x1b
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DUSBCLOGDEVICE_INSTALL=0x1
-[[OBSOLETE]][TRACE]TRACE_FLOW[0x8A]_DLDDUSBCCHANNEL_DLDDUSBCCHANNEL_CONS=0x1
-[[OBSOLETE]][TRACE]TRACE_FLOW[0x8A]_DLDDUSBCCHANNEL_DLDDUSBCCHANNEL_DES=0x2
-[[OBSOLETE]][TRACE]TRACE_FLOW[0x8A]_TUSBCALTERNATESETTINGLIST_TUSBCALTERNATESETTINGLIST_DES=0x5
-[[OBSOLETE]][TRACE]TRACE_FLOW[0x8A]_TUSBCENDPOINT_TUSBCENDPOINT_CONS=0x3
-[[OBSOLETE]][TRACE]TRACE_FLOW[0x8A]_TUSBCENDPOINT_TUSBCENDPOINT_DES=0x4
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_ALTERNATEDEVICESTATETESTCOMPLETE=0x98
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DECONFIGURE=0x99
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DLDDUSBCCHANNEL=0x1
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DLDDUSBCCHANNEL_CONS=0x3
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DLDDUSBCCHANNEL_DES=0x4
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL=0x1a
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP1=0x1b
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP2=0x1c
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP3=0x1d
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP4=0x1e
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP5=0x1f
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCANCEL_DUP6=0x20
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL=0x21
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP1=0x22
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP10=0x2b
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP11=0x2c
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP12=0x2d
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP13=0x2e
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP14=0x2f
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP15=0x30
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP16=0x31
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP17=0x32
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP18=0x33
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP19=0x34
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP2=0x23
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP20=0x35
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP21=0x36
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP22=0x37
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP23=0x38
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP24=0x39
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP25=0x3a
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP26=0x3b
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP27=0x3c
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP28=0x3d
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP29=0x3e
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP3=0x24
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP30=0x3f
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP31=0x40
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP32=0x41
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP33=0x42
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP34=0x43
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP35=0x44
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP36=0x45
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP37=0x46
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP38=0x47
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP39=0x48
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP4=0x25
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP40=0x49
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP41=0x4a
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP42=0x4b
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP44=0x4c
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP45=0x4d
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP46=0x4e
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP48=0x4f
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP49=0x50
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP5=0x26
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP50=0x51
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP51=0x52
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP52=0x53
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP53=0x54
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP54=0x55
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP55=0x56
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP56=0x57
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP57=0x58
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP58=0x59
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP59=0x5a
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP6=0x27
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP60=0x5b
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP61=0x5c
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP62=0x5d
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP63=0x5e
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP64=0x5f
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP65=0x60
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP66=0x61
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP67=0x62
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP7=0x28
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP8=0x29
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCONTROL_DUP9=0x2a
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOCREATE=0x5
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOEMERGENCYCOMPLETE=0x9b
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOEMERGENCYCOMPLETE_DUP1=0x9c
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOOTHERASYNCREQ=0x8
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOOTHERASYNCREQ_DUP1=0x9
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOOTHERASYNCREQ_DUP2=0xa
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOOTHERASYNCREQ_DUP3=0xb
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOREQUEST=0x7
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ=0xc
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP1=0xd
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP10=0x13
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP11=0x14
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP12=0x15
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP13=0x16
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP14=0x17
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP16=0x18
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP18=0x19
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP4=0xe
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP5=0xf
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP6=0x10
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP7=0x11
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_DOTRANSFERASYNCREQ_DUP9=0x12
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_ENDPOINTSTATUSCHANGECALLBACK=0x8a
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_ENDPOINTSTATUSCHANGECALLBACK_DUP1=0x8b
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_OTGFEATURECHANGECALLBACK=0x8d
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_OTGFEATURECHANGECALLBACK_DUP1=0x8e
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSALTERNATESETTING=0x8f
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSALTERNATESETTING_DUP1=0x90
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE=0x91
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP1=0x92
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP2=0x93
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP3=0x94
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP4=0x95
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_PROCESSDEVICESTATE_DUP5=0x96
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_REALLOCATE=0x97
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_REQUESTUSERHANDLE=0x6
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_RESETINTERFACE=0x9a
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_RESETINTERFACEMEMORY=0x88
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_RESETINTERFACEMEMORY_DUP1=0x87
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_RESETINTERFACEMEMORY_DUP2=0x89
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE=0x63
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP1=0x64
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP10=0x75
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP11=0x6d
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP12=0x6e
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP13=0x6f
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP14=0x70
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP15=0x71
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP16=0x72
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP17=0x73
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP18=0x74
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP2=0x65
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP3=0x66
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP4=0x67
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP5=0x68
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP6=0x69
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP8=0x6a
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETINTERFACE_DUP9=0x6b
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPEP0=0x83
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPEP0_DUP1=0x84
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPEP0_DUP2=0x85
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY=0x76
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP1=0x77
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP10=0x81
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP11=0x82
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP2=0x78
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP3=0x79
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP4=0x7a
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP5=0x7b
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP6=0x7c
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP7=0x7d
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP8=0x7e
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_SETUPINTERFACEMEMORY_DUP9=0x80
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCCHANNEL_STATUSCHANGECALLBACK=0x8c
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DUP1_DLDDUSBCCHANNEL_DLDDUSBCCHANNEL=0x2
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DUP1_TUSBCENDPOINT_TUSBCENDPOINT=0x9e
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TDMABUF_CONSTRUCT=0xdc
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TDMABUF_RXCOPYPACKETTOCLIENT_DUP4=0xca
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TDMABUF_TDMABUF_DES=0xba
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCALTERNATESETTINGLIST_TUSBCALTERNATESETTINGLIST=0xb6
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ABORTTRANSFER=0xb3
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ABORTTRANSFER_DUP1=0xb4
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ABORTTRANSFER_DUP2=0xb5
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CANCELTRANSFER=0xb0
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CANCELTRANSFER_DUP1=0xb1
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CANCELTRANSFER_DUP2=0xb2
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CONTINUEWRITE=0xad
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CONTINUEWRITE_DUP1=0xae
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_CONTINUEWRITE_DUP2=0xaf
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_COPYTOCLIENT=0xa5
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ENDPOINTCOMPLETE=0xa0
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP1=0xa1
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP2=0xa4
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP3=0xa2
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_ENDPOINTCOMPLETE_DUP4=0xa3
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_REQUESTCALLBACK=0x9f
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD=0xa6
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD_DUP1=0xa7
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD_DUP2=0xa8
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD_DUP3=0xa9
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD_DUP4=0xaa
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTREAD_DUP5=0xab
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TRYTOSTARTWRITE=0xac
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_TUSBCENDPOINT_TUSBCENDPOINT=0x9d
--- a/kernel/eka/drivers/usbc/usbc.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/usbc/usbc.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-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"
@@ -18,7 +18,6 @@
 #include "../../kernel/kern_ext.mmh"
 
 USERINCLUDE	../../include/drivers
-USERINCLUDE    traces
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 target			usbc.ldd
--- a/kernel/eka/drivers/usbc/usbdma.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/usbc/usbdma.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -23,11 +23,6 @@
 */
 
 #include <drivers/usbc.h>
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "usbdmaTraces.h"
-#endif
-
 
 
 #if defined(_DEBUG)
@@ -107,25 +102,20 @@
 		// At most 2 packets (clump of max packet size packets) + possible zlp
 		TUsbcPacketArray* bufPtr = iPacketInfoStorage;
 		// this divides up the packet indexing & packet size array over the number of buffers
-		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_CONSTRUCT,
-		        "TDmaBuf::Construct() array base=0x%08x", bufPtr );
+		__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::Construct() array base=0x%08x", bufPtr));
 		for (TInt i = 0; i < iNumberofBuffers; i++)
 			{
 			iPacketIndex[i] = bufPtr;
 			bufPtr += KUsbcDmaBufMaxPkts;
 			iPacketSize[i] = bufPtr;
 			bufPtr += KUsbcDmaBufMaxPkts;
-            OstTraceDefExt4( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_CONSTRUCT_DUP1,
-                    "TDmaBuf::Construct() packetIndex[%d]=0x%08x packetSize[%d]=0x%08x",
-                    i, reinterpret_cast<TUint>(iPacketIndex[i]), i, 
-                    reinterpret_cast<TUint>(iPacketSize[i]) );
-
+			__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::Construct() packetIndex[%d]=0x%08x packetSize[%d]=0x%08x",
+											i, iPacketIndex[i], i, iPacketSize[i]));
 			}
 		}
 	else
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_CONSTRUCT_DUP2,
-                "TDmaBuf::Construct() IN endpoint" );
+		__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::Construct() IN endpoint"));
 		}
 	Flush();
 	return KErrNone;
@@ -134,7 +124,7 @@
 
 TDmaBuf::~TDmaBuf()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TDMABUF_TDMABUF_DES, "TDmaBuf::~TDmaBuf()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::~TDmaBuf()"));
 	}
 
 TInt TDmaBuf::BufferTotalSize() const
@@ -154,9 +144,7 @@
     iDrainable[aBufInd] = iCanBeFreed[aBufInd] = EFalse;
     iBuffers[aBufInd] = aBufAddr;
     iBufferPhys[aBufInd] = Epoc::LinearToPhysical((TLinAddr)aBufAddr);
-    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_SETBUFFERADDR,
-            "TDmaBuf::SetBufferAddr() iBuffers[%d]=0x%08x", aBufInd, 
-            reinterpret_cast<TUint>(iBuffers[aBufInd]) );
+    __KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::SetBufferAddr() iBuffers[%d]=0x%08x", aBufInd, iBuffers[aBufInd]));
     return KErrNone;
     }
 
@@ -173,8 +161,7 @@
 
 void TDmaBuf::Flush()
 	{
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_FLUSH,
-	        "TDmaBuf::Flush %x", this );
+	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::Flush %x", this));
 	iRxActive = EFalse;
 	iTxActive = EFalse;
 	iExtractOffset = 0;
@@ -209,16 +196,14 @@
 
 void TDmaBuf::RxSetActive()
 	{
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_RXSETACTIVE, 
-	        "TDmaBuf::RxSetActive %x", this );
+	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::RxSetActive %x", this));
 	iRxActive = ETrue;
 	}
 
 
 void TDmaBuf::RxSetInActive()
 	{
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_RXSETINACTIVE, 
-	        "TDmaBuf::RxSetInActive %x", this );
+	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::RxSetInActive %x", this));
 	iRxActive = EFalse;
 	}
 
@@ -329,8 +314,8 @@
 // used to decide whether a client read can complete straight away
 TBool TDmaBuf::IsReaderEmpty()
 	{
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_ISREADEREMPTY, 
-	        "TDmaBuf::IsReaderEmpty iTotalRxPacketsAvail=%d", iTotalRxPacketsAvail);
+	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::IsReaderEmpty iTotalRxPacketsAvail=%d",
+									iTotalRxPacketsAvail));
 	return (iTotalRxPacketsAvail == 0);
 	}
 
@@ -355,8 +340,8 @@
 	iNumberofPacketsRxRemain[iCurrentFillingBufferIndex] = aNoPacketsRecv;
 #endif
 
-	OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_READXFERCOMPLETE,
-	        "TDmaBuf::ReadXferComplete 2 # of bytes=%d # of packets=%d", iTotalRxBytesAvail, iTotalRxPacketsAvail );
+	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::ReadXferComplete 2 # of bytes=%d # of packets=%d",
+									iTotalRxBytesAvail, iTotalRxPacketsAvail));
 	iDrainable[iCurrentFillingBufferIndex] = ETrue;
 	iError[iCurrentFillingBufferIndex] = aErrorCode;
 	AddToDrainQueue(iCurrentFillingBufferIndex);
@@ -370,17 +355,15 @@
 TInt TDmaBuf::RxGetNextXfer(TUint8*& aBufferAddr, TUsbcPacketArray*& aIndexArray,
 							TUsbcPacketArray*& aSizeArray, TInt& aLength, TPhysAddr& aBufferPhys)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_RXGETNEXTXFER,
-	        "TDmaBuf::RxGetNextXfer 1" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::RxGetNextXfer 1"));
 	if (RxIsActive())
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_RXGETNEXTXFER_DUP1,
-                " ---> RxIsActive, returning" );
+		__KTRACE_OPT(KUSB, Kern::Printf(" ---> RxIsActive, returning"));
 		return KErrInUse;
 		}
 
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_RXGETNEXTXFER_DUP2,
-            "TDmaBuf::RxGetNextXfer Current buffer=%d", iCurrentFillingBufferIndex );
+	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::RxGetNextXfer Current buffer=%d",
+									iCurrentFillingBufferIndex));
 	if (iDrainable[iCurrentFillingBufferIndex])
 		{
 		// If the controller refused the last read request, then the current buffer will still be marked
@@ -392,8 +375,8 @@
 			}
 		}
 
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_RXGETNEXTXFER_DUP3,
-            "TDmaBuf::RxGetNextXfer New buffer=%d", iCurrentFillingBufferIndex );
+	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::RxGetNextXfer New buffer=%d",
+									iCurrentFillingBufferIndex));
 	aBufferAddr = iBuffers[iCurrentFillingBufferIndex];
 	aBufferPhys = iBufferPhys[iCurrentFillingBufferIndex];
 	aIndexArray = iPacketIndex[iCurrentFillingBufferIndex];
@@ -410,8 +393,7 @@
 
 TInt TDmaBuf::RxCopyPacketToClient(DThread* aThread, TClientBuffer *aTcb, TInt aLength)
 	{
-    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_RXCOPYPACKETTOCLIENT,
-            "TDmaBuf::RxCopyPacketToClient 1" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::RxCopyPacketToClient 1"));
 
 #if defined(USBC_LDD_BUFFER_TRACE)
 	const TInt numPkts = NoRxPackets();
@@ -421,26 +403,25 @@
 
 	if (numPkts != numPktsAlt)
 		{
-	    OstTraceExt2( TRACE_NORMAL, TDMABUF_RXCOPYPACKETTOCLIENT_DUP1,
-	            "TDmaBuf::RxCopyPacketToClient: Error: #pkts mismatch global=%d actual=%d",
-	            numPkts, numPktsAlt);
+		Kern::Printf(
+			"TDmaBuf::RxCopyPacketToClient: Error: #pkts mismatch global=%d actual=%d",
+			numPkts, numPktsAlt);
 		}
 	if (numBytes != numBytesAlt)
 		{
-        OstTraceExt2( TRACE_NORMAL, TDMABUF_RXCOPYPACKETTOCLIENT_DUP2,
-                "TDmaBuf::RxCopyPacketToClient: Error: #bytes mismatch global=%d actual=%d",
-                numBytes, numBytesAlt);
-
+		Kern::Printf(
+			"TDmaBuf::RxCopyPacketToClient: Error: #bytes mismatch global=%d actual=%d",
+			numBytes, numBytesAlt);
 		}
 	if ((numPkts == 0) && (numBytes !=0))
 		{
-    OstTraceExt2( TRACE_NORMAL, TDMABUF_RXCOPYPACKETTOCLIENT_DUP3,
+		Kern::Printf(
 			"TDmaBuf::RxCopyPacketToClient: Error: global bytes & pkts mismatch pkts=%d bytes=%d",
 			numPkts, numBytes);
 		}
 	if ((numPktsAlt == 0) && (numBytesAlt !=0))
 		{
-    OstTraceExt2( TRACE_NORMAL, TDMABUF_RXCOPYPACKETTOCLIENT_DUP4,
+		Kern::Printf(
 			"TDmaBuf::RxCopyPacketToClient: Error: actual bytes & pkts mismatch pkts=%d bytes=%d",
 			numPktsAlt, numBytesAlt);
 		}
@@ -449,8 +430,7 @@
 	if (!NoRxPackets())
 		return KErrNotFound;
 
-    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_RXCOPYPACKETTOCLIENT_DUP5,
-            "TDmaBuf::RxCopyPacketToClient 2" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::RxCopyPacketToClient 2"));
 	// the next condition should be true because we have some packets available
 	// coverity[var_tested_neg]
 	if (iCurrentDrainingBufferIndex == KUsbcInvalidBufferIndex)
@@ -524,9 +504,7 @@
 		{
 		r = errorCode;
 		}
-    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_RXCOPYPACKETTOCLIENT_DUP6,
-            "TDmaBuf::RxCopyPacketToClient 3" );
-
+	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::RxCopyPacketToClient 3"));
 
 	FreeDrainedBuffers();
 
@@ -538,8 +516,7 @@
 TInt TDmaBuf::RxCopyDataToClient(DThread* aThread, TClientBuffer *aTcb, TInt aLength, TUint32& aDestOffset,
 								 TBool aRUS, TBool& aCompleteNow)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_RXCOPYDATATOCLIENT,
-	        "TDmaBuf::RxCopyDataToClient 1" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::RxCopyDataToClient 1"));
 	aCompleteNow = ETrue;
 
 #if defined(USBC_LDD_BUFFER_TRACE)
@@ -550,25 +527,25 @@
 
 	if (numPkts != numPktsAlt)
 		{
-    OstTraceExt2( TRACE_NORMAL, TDMABUF_RXCOPYDATATOCLIENT_DUP1,
+		Kern::Printf(
 			"TDmaBuf::RxCopyDataToClient: Error: #pkts mismatch global=%d actual=%d",
 			numPkts, numPktsAlt);
 		}
 	if (numBytes != numBytesAlt)
 		{
-    OstTraceExt2( TRACE_NORMAL, TDMABUF_RXCOPYDATATOCLIENT_DUP2,
+		Kern::Printf(
 			"TDmaBuf::RxCopyDataToClient: Error: #bytes mismatch global=%d actual=%d",
 			numBytes, numBytesAlt);
 		}
 	if ((numPkts == 0) && (numBytes != 0))
 		{
-    OstTraceExt2( TRACE_NORMAL, TDMABUF_RXCOPYDATATOCLIENT_DUP3,
+		Kern::Printf(
 			"TDmaBuf::RxCopyDataToClient: Error: global bytes & pkts mismatch pkts=%d bytes=%d",
 			numPkts, numBytes);
 		}
 	if ((numPktsAlt == 0) && (numBytesAlt != 0))
 		{
-    OstTraceExt2( TRACE_NORMAL, TDMABUF_RXCOPYDATATOCLIENT_DUP4,
+		Kern::Printf(
 			"TDmaBuf::RxCopyDataToClient: Error: actual bytes & pkts mismatch pkts=%d bytes=%d",
 			numPktsAlt, numBytesAlt);
 		}
@@ -589,9 +566,8 @@
 		if (!NextDrainableBuffer())
 			{
 #if defined(USBC_LDD_BUFFER_TRACE)
-            OstTraceExt2( TRACE_NORMAL, TDMABUF_RXCOPYDATATOCLIENT_DUP5,
-                    "TDmaBuf::RxCopyDataToClient: Error:  No buffer draining=%d, packets=%d",
-				    iCurrentDrainingBufferIndex, iTotalRxPacketsAvail);
+			Kern::Printf("TDmaBuf::RxCopyDataToClient: Error:  No buffer draining=%d, packets=%d",
+						 iCurrentDrainingBufferIndex, iTotalRxPacketsAvail);
 #endif
 			return KErrNotFound;
 			}
@@ -603,13 +579,11 @@
 		
 	if (iDrainingOrder != iFillingOrderArray[iCurrentDrainingBufferIndex])
 		{
-        OstTrace1( TRACE_NORMAL, TDMABUF_RXCOPYDATATOCLIENT_DUP6,
-		        "!!! Out of Order Draining TDmaBuf::RxCopyDataToClient 10 draining=%d",
-			    iCurrentDrainingBufferIndex);
+		Kern::Printf("!!! Out of Order Draining TDmaBuf::RxCopyDataToClient 10 draining=%d",
+					 iCurrentDrainingBufferIndex);
 		}
 #endif
-    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_RXCOPYDATATOCLIENT_DUP7,
-            "TDmaBuf::RxCopyDataToClient 2" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::RxCopyDataToClient 2"));
 
 	TUint8* blockStartAddr = iCurrentDrainingBuffer + iCurrentPacketIndexArray[iCurrentPacket] + iExtractOffset;
 	TUint8* lastEndAddr = blockStartAddr;					// going to track the contiguity of the memory
@@ -629,9 +603,8 @@
 			bufnum = iCurrentDrainingBufferIndex;
 			if (iDrainingOrder != iFillingOrderArray[iCurrentDrainingBufferIndex])
 				{
-                OstTrace1( TRACE_NORMAL, TDMABUF_RXCOPYDATATOCLIENT_DUP8,
-				        "!!! Out of Order Draining TDmaBuf::RxCopyDataToClient 20 draining=%d",
-					    iCurrentDrainingBufferIndex);
+				Kern::Printf("!!! Out of Order Draining TDmaBuf::RxCopyDataToClient 20 draining=%d",
+							 iCurrentDrainingBufferIndex);
 				}
 			}
 #endif
@@ -646,14 +619,7 @@
 			{
 			if (iEndpointType == KUsbEpTypeBulk)
 				{
-                if(iExtractOffset & maxPacketSizeMask)
-                	{
-                    isShortPacket = ((size+iExtractOffset) < iMaxPacketSize) || ((size+iExtractOffset) & maxPacketSizeMask);
-                	}
-                else
-                	{
-                    isShortPacket = (size < iMaxPacketSize) || (size & maxPacketSizeMask);
-                	}
+				isShortPacket = (size < iMaxPacketSize) || (size & maxPacketSizeMask);
 				}
 			else
 				{
@@ -762,9 +728,9 @@
 		TUint& pktsRemain = iNumberofPacketsRxRemain[iCurrentDrainingBufferIndex];
 		if ((bytesRemain != 0) || (pktsRemain != 0))
 			{
-			OstTraceExt3( TRACE_NORMAL, TDMABUF_NEXTDRAINABLEBUFFER,
-				    "TDmaBuf::NextDrainableBuffer: Error: data discarded buffer=%d pkts=%d bytes=%d",
-				    iCurrentDrainingBufferIndex, pktsRemain, bytesRemain);
+			Kern::Printf(
+				"TDmaBuf::NextDrainableBuffer: Error: data discarded buffer=%d pkts=%d bytes=%d",
+				iCurrentDrainingBufferIndex, pktsRemain, bytesRemain);
 			bytesRemain = 0;
 			pktsRemain = 0;
 			}
@@ -846,8 +812,7 @@
 TBool TDmaBuf::ShortPacketExists()
 	{
 	// Actually, a short packet or residue data
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_SHORTPACKETEXISTS,
-	        "TDmaBuf::ShortPacketExists 1" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::ShortPacketExists 1"));
 	TInt index = iCurrentDrainingBufferIndex;
 	TUsbcPacketArray* pktSizeArray = iCurrentPacketSizeArray;
 
@@ -865,7 +830,17 @@
 		if (iEndpointType == KUsbEpTypeBulk)
 			{
 			const TInt mask = iMaxPacketSize - 1;
+			if (iTotalRxBytesAvail & mask)
+				return ETrue;
 
+			// residue==0; this can be because
+			// zlps exist, or short packets combine to n * max_packet_size
+			// This means spadework
+			const TInt s = iCurrentPacketSizeArray[iCurrentPacket] - iExtractOffset;
+			if ((s == 0) || (s & mask))
+				{
+				return ETrue;
+				}
 
 			for (TInt i = 0; i < iNumberofBuffers; i++)
 				{
@@ -926,7 +901,7 @@
 	if (iDrainQueue[iDrainQueueIndex + 1] != KUsbcInvalidBufferIndex)
 		{
 #if defined(USBC_LDD_BUFFER_TRACE)
-		OstTrace0( TRACE_NORMAL, TDMABUF_ADDTODRAINQUEUE, "TDmaBuf::AddToDrainQueue: Error: invalid iDrainQueue[x]" );
+		Kern::Printf("TDmaBuf::AddToDrainQueue: Error: invalid iDrainQueue[x]");
 #endif
 		}
 	iDrainQueue[++iDrainQueueIndex] = aBufferIndex;
@@ -966,13 +941,12 @@
 // We only store 1 transaction, no other buffering is done
 TInt TDmaBuf::TxStoreData(DThread* aThread, TClientBuffer *aTcb, TInt aTxLength, TUint32 aBufferOffset)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_TXSTOREDATA,
-	        "TDmaBuf::TxStoreData 1" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::TxStoreData 1"));
 	if (!IsReaderEmpty())
 		return KErrInUse;
 
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TDMABUF_TXSTOREDATA_DUP1,
-	        "TDmaBuf::TxStoreData 2" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TDmaBuf::TxStoreData 2"));
+	
 	TInt remainTxLength = aTxLength;
 	TUint32 bufferOffset = aBufferOffset;
 	// Store each buffer separately
--- a/kernel/eka/drivers/usbcc/chapter9.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/usbcc/chapter9.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -23,11 +23,6 @@
 */
 
 #include <drivers/usbc.h>
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "chapter9Traces.h"
-#endif
-
 
 
 //#define ENABLE_EXCESSIVE_DEBUG_OUTPUT
@@ -66,8 +61,7 @@
 */
 TUsbcEp0State DUsbClientController::EnquireEp0NextState(const TUint8* aSetupBuf) const
 	{
-    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENQUIREEP0NEXTSTATE,
-            "DUsbClientController::EnquireEp0NextState()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::EnquireEp0NextState()"));
 
 	// This function may be called by the PSL from within an ISR -- so we have
 	// to take care what we do here (and also in all functions that get called
@@ -75,21 +69,17 @@
 
 	if (SWAP_BYTES_16((reinterpret_cast<const TUint16*>(aSetupBuf)[3])) == 0) // iLength
 		{
-	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENQUIREEP0NEXTSTATE_DUP1,
-	            "  --> EEp0StateStatusIn" );
-
+		__KTRACE_OPT(KUSB, Kern::Printf("  --> EEp0StateStatusIn"));
 		return EEp0StateStatusIn;							// No-data Control => Status_IN
 		}
 	else if ((aSetupBuf[0] & KUsbRequestType_DirMask) == KUsbRequestType_DirToDev)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENQUIREEP0NEXTSTATE_DUP2,
-		        "  --> EEp0StateDataOut" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  --> EEp0StateDataOut"));
 		return EEp0StateDataOut;							// Control Write => Data_OUT
 		}
 	else
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENQUIREEP0NEXTSTATE_DUP3,
-		        "  --> EEp0StateDataIn" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  --> EEp0StateDataIn"));
 		return EEp0StateDataIn;								// Control Read => Data_IN
 		}
 	}
@@ -97,8 +87,7 @@
 
 TInt DUsbClientController::ProcessEp0ReceiveDone(TInt aCount)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0RECEIVEDONE,
-	        "DUsbClientController::ProcessEp0ReceiveDone()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessEp0ReceiveDone()"));
 	TInt r;
 	if (iEp0DataReceiving == EFalse)
 		{
@@ -122,8 +111,7 @@
 
 TInt DUsbClientController::ProcessEp0TransmitDone(TInt aCount, TInt aError)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0TRANSMITDONE,
-	        "DUsbClientController::ProcessEp0TransmitDone()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessEp0TransmitDone()"));
 	// In any case: there's now no longer a write pending
 	iEp0WritePending = EFalse;
 	// If it was a client who set up this transmission, we report to that client
@@ -139,8 +127,7 @@
 			ProcessDataTransferDone(*p);
 			return KErrNone;
 			}
-	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0TRANSMITDONE_DUP1,
-		        "  Error: DUsbClientController::ProcessEpTransmitDone: Stalling Ep0" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: DUsbClientController::ProcessEpTransmitDone: Stalling Ep0"));
 		StallEndpoint(KEp0_In);								// request not found
 		return KErrNotFound;
 		}
@@ -148,10 +135,18 @@
 	return KErrNone;
 	}
 
+
+#define USB_PROCESS_REQUEST(request) \
+	if (Process ## request(packet) != KErrNone) \
+		{ \
+		__KTRACE_OPT(KUSB, \
+					 Kern::Printf("  ProcessEp0SetupReceived: Stalling Ep0")); \
+		StallEndpoint(KEp0_In); \
+		}
+
 TInt DUsbClientController::ProcessEp0SetupReceived(TInt aCount)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED, 
-	        "DUsbClientController::ProcessEp0SetupReceived()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessEp0SetupReceived()"));
 
 	if (aCount > iEp0MaxPacketSize)
 		{
@@ -165,73 +160,69 @@
 
 #if defined(_DEBUG) && defined(ENABLE_EXCESSIVE_DEBUG_OUTPUT)
 	// let's see what we've got:
-	OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP1, 
-	        "  bmRequestType = 0x%02x", packet.iRequestType );
+	__KTRACE_OPT(KUSB, Kern::Printf("  bmRequestType = 0x%02x", packet.iRequestType));
 	if ((packet.iRequestType & KUsbRequestType_TypeMask) == KUsbRequestType_TypeStd)
 		{
 		switch (packet.iRequest)
 			{
 		case KUsbRequest_GetStatus:
-		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP2, 
-		            "  bRequest      = 0x%02x (GET_STATUS)", KUsbRequest_GetStatus );
+			__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (GET_STATUS)",
+											KUsbRequest_GetStatus));
 			break;
 		case KUsbRequest_ClearFeature:
-		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP3, 
-		            "  bRequest      = 0x%02x (CLEAR_FEATURE)", KUsbRequest_ClearFeature );
+			__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (CLEAR_FEATURE)",
+											KUsbRequest_ClearFeature));
 			break;
 		case KUsbRequest_SetFeature:
-		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP4, 
-		            "  bRequest      = 0x%02x (SET_FEATURE)", KUsbRequest_SetFeature );
+			__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (SET_FEATURE)",
+											KUsbRequest_SetFeature));
 			break;
 		case KUsbRequest_SetAddress:
-		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP5, 
-		            "  bRequest      = 0x%02x (SET_ADDRESS)", KUsbRequest_SetAddress );
+			__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (SET_ADDRESS)",
+											KUsbRequest_SetAddress));
 			break;
 		case KUsbRequest_GetDescriptor:
-		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP6, 
-		            "  bRequest      = 0x%02x (GET_DESCRIPTOR)", KUsbRequest_GetDescriptor );
+			__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (GET_DESCRIPTOR)",
+											KUsbRequest_GetDescriptor));
 			break;
 		case KUsbRequest_SetDescriptor:
-		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP7, 
-		            "  bRequest      = 0x%02x (SET_DESCRIPTOR)", KUsbRequest_SetDescriptor );
+			__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (SET_DESCRIPTOR)",
+											KUsbRequest_SetDescriptor));
 			break;
 		case KUsbRequest_GetConfig:
-		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP8, 
-		            "  bRequest      = 0x%02x (GET_CONFIGURATION)", KUsbRequest_GetConfig );
+			__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (GET_CONFIGURATION)",
+											KUsbRequest_GetConfig));
 			break;
 		case KUsbRequest_SetConfig:
-		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP9, 
-		            "  bRequest      = 0x%02x (SET_CONFIGURATION)", KUsbRequest_SetConfig );
+			__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (SET_CONFIGURATION)",
+											KUsbRequest_SetConfig));
 			break;
 		case KUsbRequest_GetInterface:
-		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP10, 
-		            "  bRequest      = 0x%02x (GET_INTERFACE)", KUsbRequest_GetInterface );
+			__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (GET_INTERFACE)",
+											KUsbRequest_GetInterface));
 			break;
 		case KUsbRequest_SetInterface:
-		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP11, 
-		            "  bRequest      = 0x%02x (SET_INTERFACE)", KUsbRequest_SetInterface );
+			__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (SET_INTERFACE)",
+											KUsbRequest_SetInterface));
 			break;
 		case KUsbRequest_SynchFrame:
-		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP12, 
-		            "  bRequest      = 0x%02x (SYNCH_FRAME)", KUsbRequest_SynchFrame );
+			__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (SYNCH_FRAME)",
+											KUsbRequest_SynchFrame));
 			break;
 		default:
-		    OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP13, 
-		            "  Error: bRequest = 0x%02x (UNKNWON STANDARD REQUEST)", packet.iRequest );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: bRequest = 0x%02x (UNKNWON STANDARD REQUEST)",
+											  packet.iRequest));
 			break;
 			}
 		}
 	else
 		{
-        OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP14, 
-                "  bRequest      = 0x%02x (NON-STANDARD REQUEST)", packet.iRequest );
+		__KTRACE_OPT(KUSB, Kern::Printf("  bRequest      = 0x%02x (NON-STANDARD REQUEST)",
+										packet.iRequest));
 		}
-	OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP15, 
-	        "  wValue        = 0x%04x", packet.iValue );
-	OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP16, 
-	        "  wIndex        = 0x%04x", packet.iIndex );
-	OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP17, 
-	        "  wLength       = 0x%04x", packet.iLength );
+	__KTRACE_OPT(KUSB, Kern::Printf("  wValue        = 0x%04x", packet.iValue));
+	__KTRACE_OPT(KUSB, Kern::Printf("  wIndex        = 0x%04x", packet.iIndex));
+	__KTRACE_OPT(KUSB, Kern::Printf("  wLength       = 0x%04x", packet.iLength));
 #endif // defined(_DEBUG) && defined(ENABLE_EXCESSIVE_DEBUG_OUTPUT)
 
 	// now the actual analysis
@@ -244,34 +235,18 @@
 			switch (packet.iRequestType & KUsbRequestType_DestMask)
 				{ // Recipient
 			case KUsbRequestType_DestDevice:
-			    if (ProcessGetDeviceStatus(packet) != KErrNone)
-			        {
-                    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP18, 
-                            "ProcessEp0SetupReceived: Stalling Ep0" );
-                    StallEndpoint(KEp0_In);
-                    }
+				USB_PROCESS_REQUEST(GetDeviceStatus);
 				break;
 			case KUsbRequestType_DestIfc:
-                if (ProcessGetInterfaceStatus(packet) != KErrNone)
-                    {
-                    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP19, 
-                            "ProcessEp0SetupReceived: Stalling Ep0" );
-                    StallEndpoint(KEp0_In);
-                    }
+				USB_PROCESS_REQUEST(GetInterfaceStatus);
 				break;
 			case KUsbRequestType_DestEp:
-                if (ProcessGetEndpointStatus(packet) != KErrNone)
-                    {
-                    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP20, 
-                            "ProcessEp0SetupReceived: Stalling Ep0" );
-                    StallEndpoint(KEp0_In);
-                    }
+				USB_PROCESS_REQUEST(GetEndpointStatus);
 				break;
 			default:
-			    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP21, 
-			            "  Error: GET STATUS - Other or Unknown recipient" );
-			    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP22, 
-			            "  -> DUsbClientController::ProcessEp0SetupReceived: Stalling Ep0" );
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: GET STATUS - Other or Unknown recipient"));
+				__KTRACE_OPT(KPANIC, Kern::Printf("  -> DUsbClientController::ProcessEp0SetupReceived: "
+												  "Stalling Ep0"));
 				StallEndpoint(KEp0_In);
 				break;
 				}
@@ -281,107 +256,49 @@
 			switch (packet.iRequestType & KUsbRequestType_DestMask)
 				{ // Recipient
 			case KUsbRequestType_DestDevice:
-                if (ProcessSetClearDevFeature(packet) != KErrNone)
-                    {
-                    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP23, 
-                            "ProcessEp0SetupReceived: Stalling Ep0" );
-                    StallEndpoint(KEp0_In);
-                    }
+				USB_PROCESS_REQUEST(SetClearDevFeature);
 				break;
 			case KUsbRequestType_DestIfc:
-                if (ProcessSetClearIfcFeature(packet) != KErrNone)
-                    {
-                    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP24, 
-                            "ProcessEp0SetupReceived: Stalling Ep0" );
-                    StallEndpoint(KEp0_In);
-                    }
+				USB_PROCESS_REQUEST(SetClearIfcFeature);
 				break;
 			case KUsbRequestType_DestEp:
-                if (ProcessSetClearEpFeature(packet) != KErrNone)
-                    {
-                    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP25, 
-                            "ProcessEp0SetupReceived: Stalling Ep0" );
-                    StallEndpoint(KEp0_In);
-                    }
+				USB_PROCESS_REQUEST(SetClearEpFeature);
 				break;
 			default:
-			    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP26, 
-			            "  Error: SET/CLEAR FEATURE - Other or Unknown recipient" );
-			    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP27, 
-			            "  -> Stalling Ep0" );
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: SET/CLEAR FEATURE - "
+												  "Other or Unknown recipient"));
+				__KTRACE_OPT(KPANIC, Kern::Printf("  -> Stalling Ep0"));
 				StallEndpoint(KEp0_In);
 				break;
 				}
 			break;
 		case KUsbRequest_SetAddress:
-            if (ProcessSetAddress(packet) != KErrNone)
-                {
-                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP28, 
-                        "ProcessEp0SetupReceived: Stalling Ep0" );
-                StallEndpoint(KEp0_In);
-                }
+			USB_PROCESS_REQUEST(SetAddress);
 			break;
 		case KUsbRequest_GetDescriptor:
-            if (ProcessGetDescriptor(packet) != KErrNone)
-                {
-                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP29, 
-                        "ProcessEp0SetupReceived: Stalling Ep0" );
-                StallEndpoint(KEp0_In);
-                }
+			USB_PROCESS_REQUEST(GetDescriptor);
 			break;
 		case KUsbRequest_SetDescriptor:
-            if (ProcessSetDescriptor(packet) != KErrNone)
-                {
-                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP30, 
-                        "ProcessEp0SetupReceived: Stalling Ep0" );
-                StallEndpoint(KEp0_In);
-                }
+			USB_PROCESS_REQUEST(SetDescriptor);
 			break;
 		case KUsbRequest_GetConfig:
-            if (ProcessGetConfiguration(packet) != KErrNone)
-                {
-                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP31, 
-                        "ProcessEp0SetupReceived: Stalling Ep0" );
-                StallEndpoint(KEp0_In);
-                }
+			USB_PROCESS_REQUEST(GetConfiguration);
 			break;
 		case KUsbRequest_SetConfig:
-            if (ProcessSetConfiguration(packet) != KErrNone)
-                {
-                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP32, 
-                        "ProcessEp0SetupReceived: Stalling Ep0" );
-                StallEndpoint(KEp0_In);
-                }
+			USB_PROCESS_REQUEST(SetConfiguration);
 			break;
 		case KUsbRequest_GetInterface:
-            if (ProcessGetInterface(packet) != KErrNone)
-                {
-                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP33, 
-                        "ProcessEp0SetupReceived: Stalling Ep0" );
-                StallEndpoint(KEp0_In);
-                }
+			USB_PROCESS_REQUEST(GetInterface);
 			break;
 		case KUsbRequest_SetInterface:
-            if (ProcessSetInterface(packet) != KErrNone)
-                {
-                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP34, 
-                        "ProcessEp0SetupReceived: Stalling Ep0" );
-                StallEndpoint(KEp0_In);
-                }
+			USB_PROCESS_REQUEST(SetInterface);
 			break;
 		case KUsbRequest_SynchFrame:
-            if (ProcessSynchFrame(packet) != KErrNone)
-                {
-                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP35, 
-                        "ProcessEp0SetupReceived: Stalling Ep0" );
-                StallEndpoint(KEp0_In);
-                }
+			USB_PROCESS_REQUEST(SynchFrame);
 			break;
 		default:
-		    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP36, 
-		            "  Error: Unknown/unsupported Std Setup Request" );
-		    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP37, 
-		            "  -> Stalling Ep0" );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Unknown/unsupported Std Setup Request"));
+			__KTRACE_OPT(KPANIC, Kern::Printf("  -> Stalling Ep0"));
 			StallEndpoint(KEp0_In);
 			break;
 			}
@@ -404,8 +321,7 @@
 		        }
 			if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateConfigured)
 				{
-                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP38, 
-                        "  Error: Invalid device state" );
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
 				}
 			else
 				{
@@ -418,8 +334,7 @@
 					{
 					if (ifcset_ptr->CurrentInterface()->iNoEp0Requests)
 						{
-                        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP39, 
-                                "  Recipient says: NoEp0RequestsPlease" );
+						__KTRACE_OPT(KUSB, Kern::Printf("  Recipient says: NoEp0RequestsPlease"));
 						}
 					else
 						{
@@ -428,8 +343,8 @@
 					}
 				else
 					{
-                    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP40, 
-                            "  Error: Interface 0x%02x does not exist", packet.iIndex );
+					__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface 0x%02x does not exist",
+													  packet.iIndex));
 					}
 				}
 	        if (NKern::CurrentContext() == EThread)
@@ -445,13 +360,12 @@
 	            }
 			if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateConfigured)
 				{
-                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP41, 
-                        "  Error: Invalid device state" );
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
 				}
 			else if (EndpointExists(packet.iIndex) == EFalse)
 				{
-                OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP42, 
-                        "  Error: Endpoint 0x%02x does not exist", packet.iIndex );
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Endpoint 0x%02x does not exist",
+												  packet.iIndex));
 				}
 			else
 				{
@@ -460,8 +374,7 @@
 					iRealEndpoints[idx].iLEndpoint->iInterface->iInterfaceSet;
 				if (ifcset_ptr->CurrentInterface()->iNoEp0Requests)
 					{
-                    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP43, 
-                            "  Recipient says: NoEp0RequestsPlease" );
+					__KTRACE_OPT(KUSB, Kern::Printf("  Recipient says: NoEp0RequestsPlease"));
 					}
 				else
 					{
@@ -474,8 +387,7 @@
                 }
 			break;
 		default:
-		    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP44, 
-		            "  Error: Other or Unknown recipient" );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Other or Unknown recipient"));
 			break;
 			}
 		if (client != NULL)
@@ -489,15 +401,13 @@
 					{
 					__ASSERT_DEBUG((p->iEndpointNum == 0), Kern::Fault(KUsbPILPanicCat, __LINE__));
 					__ASSERT_DEBUG((p->iTransferDir == EControllerRead), Kern::Fault(KUsbPILPanicCat, __LINE__));
-					OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP45, 
-					        "  Found Ep0 read request" );
+					__KTRACE_OPT(KUSB, Kern::Printf("  Found Ep0 read request"));
 					if (packet.iLength != 0)
 						{
 						if ((packet.iRequestType & KUsbRequestType_DirMask) == KUsbRequestType_DirToDev)
 							{
 							// Data transfer & direction OUT => there'll be a DATA_OUT stage
-                            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP46, 
-                                    "  Next is DATA_OUT: setting up DataOutVars" );
+							__KTRACE_OPT(KUSB, Kern::Printf("  Next is DATA_OUT: setting up DataOutVars"));
 							SetEp0DataOutVars(packet, client);
 							}
 						else if ((packet.iRequestType & KUsbRequestType_DirMask) == KUsbRequestType_DirToHost)
@@ -515,16 +425,14 @@
 					return KErrNone;
 					}
 				}
-			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP47, 
-			        "  Ep0 read request not found: setting RxExtra vars (Setup)" );
+			__KTRACE_OPT(KUSB, Kern::Printf("  Ep0 read request not found: setting RxExtra vars (Setup)"));
 			iEp0_RxExtraCount = aCount;
 			iEp0_RxExtraData = ETrue;
 			return KErrNotFound;
 			}
 		else // if (client == NULL)
 			{
-            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0SETUPRECEIVED_DUP48, 
-                    "  Ep0 request error: Stalling Ep0" );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Ep0 request error: Stalling Ep0"));
 			StallEndpoint(KEp0_In);
 			return KErrGeneral;
 			}
@@ -532,16 +440,18 @@
 	return KErrNone;
 	}
 
+#undef USB_PROCESS_REQUEST
+
+
 TInt DUsbClientController::ProcessEp0DataReceived(TInt aCount)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED, 
-	        "DUsbClientController::ProcessEp0DataReceived()" );
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP1, 
-	        "  : %d bytes", aCount );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessEp0DataReceived()"));
+
+	__KTRACE_OPT(KUSB, Kern::Printf("  : %d bytes", aCount));
+
 	if (aCount > iEp0MaxPacketSize)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP2, 
-                "  Error: Too much data" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Too much data"));
 		aCount = iEp0MaxPacketSize;
 		}
 	iEp0DataReceived += aCount;
@@ -557,10 +467,8 @@
 			break;
 #endif
 		default:
-            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP3, 
-                    "  Error: invalid request in iSetup" );
-            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP4, 
-                    "  -> DUsbClientController::ProcessEp0DataReceived: Stalling Ep0" );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: invalid request in iSetup"));
+			__KTRACE_OPT(KPANIC, Kern::Printf("  -> DUsbClientController::ProcessEp0DataReceived: Stalling Ep0"));
 			StallEndpoint(KEp0_In);
 			ResetEp0DataOutVars();
 			break;
@@ -577,8 +485,7 @@
 				{
 				__ASSERT_DEBUG((p->iEndpointNum == 0), Kern::Fault(KUsbPILPanicCat, __LINE__));
 				__ASSERT_DEBUG((p->iTransferDir == EControllerRead), Kern::Fault(KUsbPILPanicCat, __LINE__));
-	            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP5,
-	                    "  Found Ep0 read request" );
+				__KTRACE_OPT(KUSB, Kern::Printf("  Found Ep0 read request"));
 				memcpy(p->iBufferStart, iEp0_RxBuf, aCount);
 				p->iError = KErrNone;						// if it wasn't 'KErrNone' we wouldn't be here
 				*(p->iPacketSize) = aCount;
@@ -588,8 +495,7 @@
 				goto found;
 				}
 			}
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSEP0DATARECEIVED_DUP6,
-                "  Ep0 read request not found: setting RxExtra vars (Data)" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  Ep0 read request not found: setting RxExtra vars (Data)"));
 		iEp0_RxExtraCount = aCount;
 		iEp0_RxExtraData = ETrue;
 		iEp0DataReceived -= aCount;
@@ -609,18 +515,15 @@
 
 TInt DUsbClientController::ProcessGetDeviceStatus(const TUsbcSetup& aPacket)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSGETDEVICESTATUS, 
-	        "DUsbClientController::ProcessGetDeviceStatus()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessGetDeviceStatus()"));
 	if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateAddress)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETDEVICESTATUS_DUP1, 
-                "  Error: Invalid device state" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
 		return KErrGeneral;
 		}
 	const TUint16 status = ((DeviceSelfPowered() ? KUsbDevStat_SelfPowered : 0) |
 					  (iRmWakeupStatus_Enabled ? KUsbDevStat_RemoteWakeup : 0));
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSGETDEVICESTATUS_DUP2, 
-	        "  Reporting device status: 0x%02x", status );
+	__KTRACE_OPT(KUSB, Kern::Printf("  Reporting device status: 0x%02x", status));
 	*reinterpret_cast<TUint16*>(iEp0_TxBuf) = SWAP_BYTES_16(status);
 	if (SetupEndpointZeroWrite(iEp0_TxBuf, sizeof(status)) == KErrNone)
 		{
@@ -632,23 +535,19 @@
 
 TInt DUsbClientController::ProcessGetInterfaceStatus(const TUsbcSetup& aPacket)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSGETINTERFACESTATUS, 
-	        "DUsbClientController::ProcessGetInterfaceStatus()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessGetInterfaceStatus()"));
 	if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateConfigured)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETINTERFACESTATUS_DUP1, 
-                "  Error: Invalid device state" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
 		return KErrGeneral;
 		}
 	if (InterfaceExists(aPacket.iIndex) == EFalse)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETINTERFACESTATUS_DUP2, 
-                "  Error: Interface does not exist" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface does not exist"));
 		return KErrGeneral;
 		}
 	const TUint16 status = 0x0000;							// as of USB Spec 2.0
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSGETINTERFACESTATUS_DUP3,
-            "  Reporting interface status: 0x%02x", status );
+	__KTRACE_OPT(KUSB, Kern::Printf("  Reporting interface status: 0x%02x", status));
 	*reinterpret_cast<TUint16*>(iEp0_TxBuf) = SWAP_BYTES_16(status);
 	if (SetupEndpointZeroWrite(iEp0_TxBuf, sizeof(status)) == KErrNone)
 		{
@@ -660,26 +559,23 @@
 
 TInt DUsbClientController::ProcessGetEndpointStatus(const TUsbcSetup& aPacket)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSGETENDPOINTSTATUS, 
-	        "DUsbClientController::ProcessGetEndpointStatus()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessGetEndpointStatus()"));
 	if (iTrackDeviceState &&
 		((iDeviceState < EUsbcDeviceStateAddress) ||
 		 (iDeviceState == EUsbcDeviceStateAddress && (aPacket.iIndex & KUsbEpAddress_Portmask) != 0)))
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETENDPOINTSTATUS_DUP1, 
-                "  Error: Invalid device state" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
 		return KErrGeneral;
 		}
 	if (EndpointExists(aPacket.iIndex) == EFalse)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETENDPOINTSTATUS_DUP2, 
-                "  Error: Endpoint does not exist" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Endpoint does not exist"));
 		return KErrGeneral;
 		}
 	const TInt ep = EpAddr2Idx(aPacket.iIndex);
 	const TUint16 status = (iRealEndpoints[ep].iHalt) ?	 KUsbEpStat_Halt : 0;
-	OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSGETENDPOINTSTATUS_DUP3, 
-	        "  Reporting endpoint status 0x%02x for real endpoint %d", status, ep );
+	__KTRACE_OPT(KUSB, Kern::Printf("  Reporting endpoint status 0x%02x for real endpoint %d",
+									status, ep));
 	*reinterpret_cast<TUint16*>(iEp0_TxBuf) = SWAP_BYTES_16(status);
 	if (SetupEndpointZeroWrite(iEp0_TxBuf, 2) == KErrNone)
 		{
@@ -691,12 +587,10 @@
 
 TInt DUsbClientController::ProcessSetClearDevFeature(const TUsbcSetup& aPacket)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE,
-	        "DUsbClientController::ProcessSetClearDevFeature()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessSetClearDevFeature()"));
 	if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateDefault)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP1,
-                "  Error: Invalid device state" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
 		return KErrGeneral;
 		}
 
@@ -709,8 +603,7 @@
 		case KUsbFeature_RemoteWakeup:
 			if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateAddress)
 				{
-                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP2,
-                        "  Error: Invalid device state" );
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
 				return KErrGeneral;
 				}
 			iRmWakeupStatus_Enabled = ETrue;
@@ -718,35 +611,30 @@
 		case KUsbFeature_TestMode:
 			if (!iHighSpeed)
 				{
-                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP3,
-                        "  Error: Request only supported in High-Speed mode" );
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Request only supported in High-Speed mode"));
 				return KErrGeneral;
 				}
 			if (LowByte(aPacket.iIndex) != 0)
 				{
-                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP4,
-                        "  Error: Lower byte of wIndex must be zero" );
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Lower byte of wIndex must be zero"));
 				return KErrGeneral;
 				}
 			test_sel = HighByte(aPacket.iIndex);
 			if ((test_sel < KUsbTestSelector_Test_J) || (test_sel > KUsbTestSelector_Test_Force_Enable))
 				{
-                OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP5,
-                        "  Error: Invalid test selector: %d", test_sel );
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid test selector: %d", test_sel));
 				return KErrGeneral;
 				}
 			break;
 		case KUsbFeature_B_HnpEnable:
 			if (!iOtgSupport)
 				{
-                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP6,
-                        "  Error: Request only supported on a OTG device" );
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Request only supported on a OTG device"));
 				return KErrGeneral;
 				}
 			if (!(iOtgFuncMap & KUsbOtgAttr_HnpSupp))
 				{
-                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP7,
-                        "  Error: Request only valid if OTG device supports HNP" );
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Request only valid if OTG device supports HNP"));
 				return KErrGeneral;
 				}
 			iOtgFuncMap |= KUsbOtgAttr_B_HnpEnable;
@@ -755,14 +643,12 @@
 		case KUsbFeature_A_HnpSupport:
 			if (!iOtgSupport)
 				{
-                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP8,
-                        "  Error: Request only supported on a OTG device" );
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Request only supported on a OTG device"));
 				return KErrGeneral;
 				}
 			if (!(iOtgFuncMap & KUsbOtgAttr_HnpSupp))
 				{
-                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP9,
-                        "  Error: Request only valid if OTG device supports HNP" );
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Request only valid if OTG device supports HNP"));
 				return KErrGeneral;
 				}
 			iOtgFuncMap |= KUsbOtgAttr_A_HnpSupport;
@@ -771,22 +657,19 @@
 		case KUsbFeature_A_AltHnpSupport:
 			if (!iOtgSupport)
 				{
-                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP10,
-                        "  Error: Request only supported on a OTG device" );
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Request only supported on a OTG device"));
 				return KErrGeneral;
 				}
 			if (!(iOtgFuncMap & KUsbOtgAttr_HnpSupp))
 				{
-                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP11,
-                        "  Error: Request only valid if OTG device supports HNP" );
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Request only valid if OTG device supports HNP"));
 				return KErrGeneral;
 				}
 			iOtgFuncMap |= KUsbOtgAttr_A_AltHnpSupport;
 			OtgFeaturesNotify();
 			break;
 		default:
-		    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP12,
-		            "  Error: Unknown feature requested" );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Unknown feature requested"));
 			return KErrGeneral;
 			}
 		}
@@ -797,15 +680,13 @@
 		case KUsbFeature_RemoteWakeup:
 			if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateAddress)
 				{
-                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP13,
-                        "  Error: Invalid device state" );
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
 				return KErrGeneral;
 				}
 			iRmWakeupStatus_Enabled = EFalse;
 			break;
 		default:
-		    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP14,
-		            "  Error: Unknown feature requested" );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Unknown feature requested"));
 			return KErrGeneral;
 			}
 		}
@@ -816,8 +697,7 @@
 	// after the status stage of the request."
 	if (test_sel)
 		{
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARDEVFEATURE_DUP15,
-                "  Entering HS Test Mode %d", test_sel );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Entering HS Test Mode %d", test_sel));
 		EnterTestMode(test_sel);
 		}
 
@@ -827,12 +707,10 @@
 
 TInt DUsbClientController::ProcessSetClearIfcFeature(const TUsbcSetup& aPacket)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSSETCLEARIFCFEATURE,
-	        "DUsbClientController::ProcessSetClearIfcFeature()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessSetClearIfcFeature()"));
 	if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateConfigured)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEARIFCFEATURE_DUP1,
-                "  Error: Invalid device state" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
 		return KErrGeneral;
 		}
 	// No interface features defined in USB spec, thus
@@ -842,34 +720,29 @@
 
 TInt DUsbClientController::ProcessSetClearEpFeature(const TUsbcSetup& aPacket)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSSETCLEAREPFEATURE, 
-	        "DUsbClientController::ProcessSetClearEpFeature()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessSetClearEpFeature()"));
 	if (iTrackDeviceState &&
 		((iDeviceState < EUsbcDeviceStateAddress) ||
 		 (iDeviceState == EUsbcDeviceStateAddress && (aPacket.iIndex & KUsbEpAddress_Portmask) != 0)))
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEAREPFEATURE_DUP1, 
-                "  Error: Invalid device state" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
 		return KErrGeneral;
 		}
 	if (aPacket.iValue != KUsbFeature_EndpointHalt)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEAREPFEATURE_DUP2, 
-                "  Error: Unknown feature requested" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Unknown feature requested"));
 		return KErrGeneral;
 		}
 	if (EndpointExists(aPacket.iIndex) == EFalse)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEAREPFEATURE_DUP3, 
-                "  Error: Endpoint does not exist" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Endpoint does not exist"));
 		return KErrGeneral;
 		}
 	const TInt ep = EpAddr2Idx(aPacket.iIndex);
 	if (iRealEndpoints[ep].iLEndpoint->iInfo.iType == KUsbEpTypeControl ||
 		iRealEndpoints[ep].iLEndpoint->iInfo.iType == KUsbEpTypeIsochronous)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCLEAREPFEATURE_DUP4, 
-                "  Error: Endpoint is Control or Isochronous" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Endpoint is Control or Isochronous"));
 		return KErrGeneral;
 		}
 	SetClearHaltFeature(ep, aPacket.iRequest);
@@ -880,19 +753,16 @@
 
 TInt DUsbClientController::ProcessSetAddress(const TUsbcSetup& aPacket)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSSETADDRESS,
-	        "DUsbClientController::ProcessSetAddress()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessSetAddress()"));
 	if (iTrackDeviceState && iDeviceState > EUsbcDeviceStateAddress)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETADDRESS_DUP1,
-                "  Error: Invalid device state" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
 		return KErrGeneral;
 		}
 	const TUint16 addr = aPacket.iValue;
 	if (addr > 127)
 		{
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETADDRESS_DUP2,
-                "  Error: Bad address value: %d (>127)", addr );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Bad address value: %d (>127)", addr));
 		return KErrGeneral;
 		}
 	if (addr == 0)
@@ -900,8 +770,7 @@
 		// Enter Default state (from Default or Address)
 		NextDeviceState(EUsbcDeviceStateDefault);
 		}
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSSETADDRESS_DUP3,
-	        "  USB address: %d", addr );
+	__KTRACE_OPT(KUSB, Kern::Printf("  USB address: %d", addr));
 	// The spec says, under section 9.4.6:
 	// "Stages after the initial Setup packet assume the same device address as the Setup packet. The USB
 	// device does not change its device address until after the Status stage of this request is completed
@@ -916,12 +785,10 @@
 
 TInt DUsbClientController::ProcessGetDescriptor(const TUsbcSetup& aPacket)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR, 
-	        "DUsbClientController::ProcessGetDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessGetDescriptor()"));
 	if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateDefault)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR_DUP1, 
-                "  Error: Invalid device state" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
 		return KErrGeneral;
 		}
 
@@ -937,18 +804,16 @@
 	if ((result != KErrNone) || (size == 0))
 		{
 		// This doesn't have to be an error - protocol-wise it's OK.
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR_DUP2, 
-                "  Couldn't retrieve descriptor" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  Couldn't retrieve descriptor"));
 		return KErrGeneral;
 		}
 
-    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR_DUP3,
-            "  Descriptor found, size: %d (requested: %d)", size, aPacket.iLength );
+	__KTRACE_OPT(KUSB, Kern::Printf("  Descriptor found, size: %d (requested: %d)",
+									size, aPacket.iLength));
 	if (size > KUsbcBufSz_Ep0Tx)
 		{
 		// This should actually not be possible (i.e. we should never get here).
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR_DUP4,
-                "  Error: Ep0_Tx buffer too small" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Ep0_Tx buffer too small"));
 		}
 	if (size > aPacket.iLength)
 		{
@@ -957,8 +822,10 @@
 		}
 
 #ifdef ENABLE_EXCESSIVE_DEBUG_OUTPUT
-    OstTraceDefExt1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSGETDESCRIPTOR_DUP5,
-            "  Data: %{uint8[]}", TOstArray<TUint8>(iEp0_TxBuf, 8) );
+	__KTRACE_OPT(KUSB,
+				 Kern::Printf("  Data: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x ...",
+							  iEp0_TxBuf[0], iEp0_TxBuf[1], iEp0_TxBuf[2], iEp0_TxBuf[3],
+							  iEp0_TxBuf[4], iEp0_TxBuf[5], iEp0_TxBuf[6], iEp0_TxBuf[7]));
 #endif
 	// If we're about to send less bytes than expected by the host AND our number is a
 	// multiple of the packet size, in order to indicate the end of the control transfer,
@@ -975,8 +842,7 @@
 
 TInt DUsbClientController::ProcessSetDescriptor(const TUsbcSetup& aPacket)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSSETDESCRIPTOR, 
-	        "DUsbClientController::ProcessSetDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessSetDescriptor()"));
 #ifndef USB_SUPPORTS_SET_DESCRIPTOR_REQUEST
 	return KErrGeneral;
 #else
@@ -988,8 +854,7 @@
 	if (aPacket.iLength > KUsbcBufSz_Ep0Rx)
 		{
 		// Error: Our Rx buffer is too small! (Raise a defect to make it larger)
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETDESCRIPTOR_DUP1,
-	            "  Error: Ep0_Rx buffer too small" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Ep0_Rx buffer too small"));
 		return KErrGeneral;
 		}
 	SetEp0DataOutVars(aPacket);
@@ -1001,33 +866,27 @@
 
 TInt DUsbClientController::ProcessGetConfiguration(const TUsbcSetup& aPacket)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION, 
-	        "DUsbClientController::ProcessGetConfiguration()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessGetConfiguration()"));
 	if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateAddress)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION_DUP1, 
-                "  Error: Invalid device state" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
 		return KErrGeneral;
 		}
 	if (iTrackDeviceState && iDeviceState == EUsbcDeviceStateAddress && iCurrentConfig != 0)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION_DUP2, 
-                "  Error: DeviceState Address && Config != 0" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: DeviceState Address && Config != 0"));
 		return KErrGeneral;
 		}
 	if (iTrackDeviceState && iDeviceState == EUsbcDeviceStateConfigured && iCurrentConfig == 0)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION_DUP3, 
-                "  Error: DeviceState Configured && Config == 0" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: DeviceState Configured && Config == 0"));
 		return KErrGeneral;
 		}
 	if (aPacket.iLength != 1)								// "unspecified behavior"
 		{
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION_DUP4, 
-                "  Warning: wLength != 1 (= %d)", aPacket.iLength );
+		__KTRACE_OPT(KUSB, Kern::Printf("  Warning: wLength != 1 (= %d)", aPacket.iLength));
 		}
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSGETCONFIGURATION_DUP5, 
-	        "  Reporting configuration value %d", iCurrentConfig );
+	__KTRACE_OPT(KUSB, Kern::Printf("  Reporting configuration value %d", iCurrentConfig));
 	if (SetupEndpointZeroWrite(&iCurrentConfig, sizeof(iCurrentConfig)) == KErrNone)
 		{
 		iEp0WritePending = ETrue;
@@ -1047,36 +906,32 @@
 */
 TInt DUsbClientController::ProcessSetConfiguration(const TUsbcSetup& aPacket)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSSETCONFIGURATION, 
-	        "DUsbClientController::ProcessSetConfiguration()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessSetConfiguration()"));
+
 	// This function may be called by the PSL from within an ISR -- so we have
 	// to take care what we do here (and also in all functions that get called
 	// from here).
 
 	if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateAddress)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCONFIGURATION_DUP1, 
-                "  Error: Invalid device state" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
 		return KErrGeneral;
 		}
 	const TUint16 value = aPacket.iValue;
 	if (value > 1)											// we support only one configuration
 		{
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETCONFIGURATION_DUP2, 
-                "  Error: Configuration value too large: %d", value );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Configuration value too large: %d", value));
 		return KErrGeneral;
 		}
 
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSSETCONFIGURATION_DUP3,
-            "  Configuration value: %d", value );
+	__KTRACE_OPT(KUSB, Kern::Printf("  Configuration value: %d", value));
 	ChangeConfiguration(value);
 
 	// In 9.4.5 under GET_STATUS we read, that after SET_CONFIGURATION the HALT feature
 	// for all endpoints is reset to zero.
 	TInt num = 0;
 	(TAny) DoForEveryEndpointInUse(&DUsbClientController::ClearHaltFeature, num);
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSSETCONFIGURATION_DUP4,
-	        "  Called ClearHaltFeature() for %d endpoints", num );
+	__KTRACE_OPT(KUSB, Kern::Printf("  Called ClearHaltFeature() for %d endpoints", num));
 	SendEp0ZeroByteStatusPacket();							// success: zero bytes data during status stage
 	return KErrNone;
 	}
@@ -1084,32 +939,27 @@
 
 TInt DUsbClientController::ProcessGetInterface(const TUsbcSetup& aPacket)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSGETINTERFACE, 
-	        "DUsbClientController::ProcessGetInterface()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessGetInterface()"));
 	if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateConfigured)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETINTERFACE_DUP1, 
-                "  Error: Invalid device state" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
 		return KErrGeneral;
 		}
 	if (iCurrentConfig == 0)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETINTERFACE_DUP2, 
-                "  Error: Device not configured" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Device not configured"));
 		return KErrGeneral;
 		}
 	const TInt number = aPacket.iIndex;
 	if (!InterfaceExists(number))
 		{
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSGETINTERFACE_DUP3, 
-                "  Error: Bad interface index: %d", number );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Bad interface index: %d", number));
 		return KErrGeneral;
 		}
 	// Send alternate setting code of iCurrentInterface of Interface(set) <number> of the current
 	// config (iCurrentConfig).
 	const TUint8 setting = InterfaceNumber2InterfacePointer(number)->iCurrentInterface;
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSGETINTERFACE_DUP4, 
-	        "  Reporting interface setting %d", setting );
+	__KTRACE_OPT(KUSB, Kern::Printf("  Reporting interface setting %d", setting));
 	if (SetupEndpointZeroWrite(&setting, 1) == KErrNone)
 		{
 		iEp0WritePending = ETrue;
@@ -1120,25 +970,21 @@
 
 TInt DUsbClientController::ProcessSetInterface(const TUsbcSetup& aPacket)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE,
-	        "DUsbClientController::ProcessSetInterface()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessSetInterface()"));
 	if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateConfigured)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE_DUP1,
-                "  Error: Invalid device state" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
 		return KErrGeneral;
 		}
 	if (iCurrentConfig == 0)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE_DUP2,
-                "  Error: Device not configured" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Device not configured"));
 		return KErrGeneral;
 		}
 	const TInt number = aPacket.iIndex;
 	if (!InterfaceExists(number))
 		{
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE_DUP3,
-                "  Error: Bad interface index: %d", number );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Bad interface index: %d", number));
 		return KErrGeneral;
 		}
 	const TInt setting = aPacket.iValue;
@@ -1146,12 +992,10 @@
 	RPointerArray<TUsbcInterface>& ifcs = ifcset_ptr->iInterfaces;
 	if (setting >= ifcs.Count())
 		{
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE_DUP4,
-                "  Error: Alt Setting >= bNumAltSettings: %d", setting );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Alt Setting >= bNumAltSettings: %d", setting));
 		return KErrGeneral;
 		}
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSSETINTERFACE_DUP5,
-            "  Interface setting:: %d", setting );
+	__KTRACE_OPT(KUSB, Kern::Printf("  Interface setting:: %d", setting));
 	// Set iCurrentInterface of Interface(set) <number> of the current config
 	// (iCurrentConfig) to alternate setting <setting>.
 	ChangeInterface(ifcs[setting]);
@@ -1171,25 +1015,21 @@
 
 TInt DUsbClientController::ProcessSynchFrame(const TUsbcSetup& aPacket)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSSYNCHFRAME, 
-	        "DUsbClientController::ProcessSynchFrame()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessSynchFrame()"));
 	if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateConfigured)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSYNCHFRAME_DUP1, 
-                "  Error: Invalid device state" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
 		return KErrGeneral;
 		}
 	const TInt ep = aPacket.iIndex;
 	if (EndpointExists(ep) == EFalse)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSYNCHFRAME_DUP2, 
-                "  Error: Endpoint does not exist" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Endpoint does not exist"));
 		return KErrGeneral;
 		}
 	if (iRealEndpoints[EpAddr2Idx(ep)].iLEndpoint->iInfo.iType != KUsbEpTypeIsochronous)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSSYNCHFRAME_DUP3, 
-                "  Error: Endpoint is not isochronous" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Endpoint is not isochronous"));
 		return KErrGeneral;
 		}
 	// We always send 0:
@@ -1205,8 +1045,7 @@
 #ifdef USB_SUPPORTS_SET_DESCRIPTOR_REQUEST
 void DUsbClientController::ProceedSetDescriptor()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCEEDSETDESCRIPTOR,
-	        "DUsbClientController::ProceedSetDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProceedSetDescriptor()"));
 	// iEp0DataReceived already reflects the current buffer state
 	if (iEp0DataReceived < iSetup.iLength)
 		{
@@ -1239,19 +1078,17 @@
 
 void DUsbClientController::SetClearHaltFeature(TInt aRealEndpoint, TUint8 aRequest)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETCLEARHALTFEATURE, 
-	        "DUsbClientController::SetClearHaltFeature()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetClearHaltFeature()"));
 	if (aRequest == KUsbRequest_SetFeature)
 		{
 		if (iRealEndpoints[aRealEndpoint].iHalt)
 			{
 			// (This condition is not really an error)
-            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETCLEARHALTFEATURE_DUP1, 
-                    "  Warning: HALT feature already set" );
+			__KTRACE_OPT(KUSB, Kern::Printf("  Warning: HALT feature already set"));
 			return;
 			}
-		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETCLEARHALTFEATURE_DUP2, 
-		        "  setting HALT feature for real endpoint %d", aRealEndpoint );
+		__KTRACE_OPT(KUSB, Kern::Printf("  setting HALT feature for real endpoint %d",
+										aRealEndpoint));
 		StallEndpoint(aRealEndpoint);
 		iRealEndpoints[aRealEndpoint].iHalt = ETrue;
 		}
@@ -1260,13 +1097,12 @@
 		if (iRealEndpoints[aRealEndpoint].iHalt == EFalse)
 			{
 			// In this case, before we return, the data toggles are reset to DATA0.
-            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETCLEARHALTFEATURE_DUP3, 
-                    "  Warning: HALT feature already cleared" );
+			__KTRACE_OPT(KUSB, Kern::Printf("  Warning: HALT feature already cleared"));
 			ResetDataToggle(aRealEndpoint);
 			return;
 			}
-		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETCLEARHALTFEATURE_DUP4, 
-		        "  clearing HALT feature for real endpoint %d", aRealEndpoint );
+		__KTRACE_OPT(KUSB, Kern::Printf("  clearing HALT feature for real endpoint %d",
+										aRealEndpoint));
 		ResetDataToggle(aRealEndpoint);
 		ClearStallEndpoint(aRealEndpoint);
 		iRealEndpoints[aRealEndpoint].iHalt = EFalse;
@@ -1277,8 +1113,7 @@
 
 TInt DUsbClientController::ClearHaltFeature(TInt aRealEndpoint)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_CLEARHALTFEATURE, 
-	        "DUsbClientController::ClearHaltFeature()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ClearHaltFeature()"));
 	if (iRealEndpoints[aRealEndpoint].iHalt != EFalse)
 		{
 		ClearStallEndpoint(aRealEndpoint);
@@ -1290,21 +1125,19 @@
 
 void DUsbClientController::ChangeConfiguration(TUint16 aValue)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_CHANGECONFIGURATION, 
-	        "DUsbClientController::ChangeConfiguration()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ChangeConfiguration()"));
 	// New configuration is the same as the old one: 0
 	if (iCurrentConfig == 0 && aValue == 0)
 		{
 		// no-op
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP1, 
-                "  Configuration: New == Old == 0 --> exiting" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  Configuration: New == Old == 0 --> exiting"));
 		return;
 		}
 	// New configuration is the same as the old one (but not 0)
 	if (iCurrentConfig == aValue)
 		{
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP2, 
-                "  Configuration: New == Old == %d --> exiting", aValue );
+		__KTRACE_OPT(KUSB, Kern::Printf("  Configuration: New == Old == %d --> exiting", aValue));
+
 		// From the spec 9.1.1.5, Data toggle is reset to zero here when 
 		// setconfiguration(x->x)(x!=0) received, although we only support
 		// single configuration currently.
@@ -1312,24 +1145,21 @@
 		TInt ret = DoForEveryEndpointInUse(&DUsbClientController::ResetDataToggle, num);
 		if(ret != KErrNone)
 			{
-            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP3, 
-                    "  Error: Endpoint data toggle reset failed" );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Endpoint data toggle reset failed"));
 			}
-		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP4, 
-		        "  Called ResetDataToggle()for %d endpoints", num );	
+		__KTRACE_OPT(KUSB, Kern::Printf("  Called ResetDataToggle()for %d endpoints", num));	
+	
 		return;
 		}
 	// Device is already configured
 	if (iCurrentConfig != 0)
 		{
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP5, 
-                "  Device was configured: %d", iCurrentConfig );
+		__KTRACE_OPT(KUSB, Kern::Printf("  Device was configured: %d", iCurrentConfig));
 		// Tear down all interface(set)s of the old configuration
 		RPointerArray<TUsbcInterfaceSet>& ifcsets = CurrentConfig()->iInterfaceSets;
 		for (TInt i = 0; i < ifcsets.Count(); ++i)
 			{
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP6, 
-                    "  Tearing down InterfaceSet %d", i );
+			__KTRACE_OPT(KUSB, Kern::Printf("  Tearing down InterfaceSet %d", i));
 			InterfaceSetTeardown(ifcsets[i]);
 			}
 		iCurrentConfig = 0;
@@ -1340,8 +1170,7 @@
 	// Device gets a new configuration
 	if (aValue != 0)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP7, 
-                "  Device gets new configuration..." );
+		__KTRACE_OPT(KUSB, Kern::Printf("  Device gets new configuration..."));
 		// Setup all alternate settings 0 of all interfaces
 		// (Don't separate the next two lines of code.)
 		iCurrentConfig = aValue;
@@ -1349,23 +1178,20 @@
 		const TInt n = ifcsets.Count();
 		for (TInt i = 0; i < n; ++i)
 			{
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP8, 
-                    "  Setting up InterfaceSet %d", i );
+			__KTRACE_OPT(KUSB, Kern::Printf("  Setting up InterfaceSet %d", i));
 			InterfaceSetup(ifcsets[i]->iInterfaces[0]);
 			}
 		// Enter Configured state (from Address or Configured)
 		NextDeviceState(EUsbcDeviceStateConfigured);
 		}
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHANGECONFIGURATION_DUP9, 
-            "  New configuration: %d", iCurrentConfig );
+	__KTRACE_OPT(KUSB, Kern::Printf("  New configuration: %d", iCurrentConfig));
 	return;
 	}
 
 
 void DUsbClientController::InterfaceSetup(TUsbcInterface* aIfc)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_INTERFACESETUP, 
-	        "DUsbClientController::InterfaceSetup()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::InterfaceSetup()"));
 	const TInt num_eps = aIfc->iEndpoints.Count();
 	for (TInt i = 0; i < num_eps; i++)
 		{
@@ -1375,27 +1201,24 @@
 		//  adjusted in its constructor.)
 		if (iHighSpeed)
 			{
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INTERFACESETUP_DUP1, 
-                    "  Setting Ep info size to %d (HS)", ep->iEpSize_Hs );
+			__KTRACE_OPT(KUSB, Kern::Printf("  Setting Ep info size to %d (HS)", ep->iEpSize_Hs));
 			ep->iInfo.iSize = ep->iEpSize_Hs;
 			}
 		else
 			{
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INTERFACESETUP_DUP2, 
-                    "  Setting Ep info size to %d (FS)", ep->iEpSize_Fs );
+			__KTRACE_OPT(KUSB, Kern::Printf("  Setting Ep info size to %d (FS)", ep->iEpSize_Fs));
 			ep->iInfo.iSize = ep->iEpSize_Fs;
 			}
 		const TInt idx = EpAddr2Idx(ep->iPEndpoint->iEndpointAddr);
 		if (ConfigureEndpoint(idx, ep->iInfo) != KErrNone)
 			{
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_INTERFACESETUP_DUP3, 
-                    "  Error: Endpoint %d configuration failed", idx );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Endpoint %d configuration failed", idx));
 			continue;
 			}
 		// Should there be a problem with it then we could try resetting the ep
 		// data toggle at this point (or before the Configure) as well.
-        OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INTERFACESETUP_DUP4, 
-                "  Connecting real ep addr 0x%02x & logical ep #%d", ep->iPEndpoint->iEndpointAddr, ep->iLEndpointNum );
+		__KTRACE_OPT(KUSB, Kern::Printf("  Connecting real ep addr 0x%02x & logical ep #%d",
+										ep->iPEndpoint->iEndpointAddr, ep->iLEndpointNum));
 		ep->iPEndpoint->iLEndpoint = ep;
 		}
 	aIfc->iInterfaceSet->iCurrentInterface = aIfc->iSettingCode;
@@ -1405,12 +1228,10 @@
 
 void DUsbClientController::InterfaceSetTeardown(TUsbcInterfaceSet* aIfcSet)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN,
-	        "DUsbClientController::InterfaceSetTeardown()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::InterfaceSetTeardown()"));
 	if (aIfcSet->iInterfaces.Count() == 0)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP1,
-                "  No interfaces exist - returning" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  No interfaces exist - returning"));
 		return;
 		}
 	RPointerArray<TUsbcLogicalEndpoint>& eps = aIfcSet->CurrentInterface()->iEndpoints;
@@ -1424,29 +1245,24 @@
 
 		if (!ep->iPEndpoint->iLEndpoint)
 			{
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP2,
-                    "  real ep %d not configured: skipping", idx );
+			__KTRACE_OPT(KUSB, Kern::Printf("  real ep %d not configured: skipping", idx));
 			continue;
 			}
 		if (ResetDataToggle(idx) != KErrNone)
 			{
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP3,
-                    "  Error: Endpoint %d data toggle reset failed", idx );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Endpoint %d data toggle reset failed", idx));
 			}
 		if (DeConfigureEndpoint(idx) != KErrNone)
 			{
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP4,
-                    "  Error: Endpoint %d de-configuration failed", idx );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Endpoint %d de-configuration failed", idx));
 			}
 
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP5,
-                "  disconnecting real ep & logical ep" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  disconnecting real ep & logical ep"));
 		ep->iPEndpoint->iLEndpoint = NULL;
 		}
 	if (aIfcSet->CurrentInterface() != 0)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INTERFACESETTEARDOWN_DUP6,
-                "  Resetting alternate interface setting to 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)
 		    {
@@ -1465,18 +1281,15 @@
 
 void DUsbClientController::ChangeInterface(TUsbcInterface* aIfc)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_CHANGEINTERFACE, 
-	        "DUsbClientController::ChangeInterface()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ChangeInterface()"));
 	TUsbcInterfaceSet* ifcset = aIfc->iInterfaceSet;
 	const TUint8 setting = aIfc->iSettingCode;
 	if (ifcset->iCurrentInterface == setting)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHANGEINTERFACE_DUP1, 
-                "  New Ifc == old Ifc: nothing to do" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  New Ifc == old Ifc: nothing to do"));
 		return;
 		}
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHANGEINTERFACE_DUP2,
-            "  Setting new interface setting #%d", setting );
+	__KTRACE_OPT(KUSB, Kern::Printf("  Setting new interface setting #%d", setting));
 	InterfaceSetTeardown(ifcset);
 	InterfaceSetup(aIfc);
 	StatusNotify(static_cast<TUsbcDeviceState>(KUsbAlternateSetting | setting), ifcset->iClientId);
@@ -1488,14 +1301,12 @@
 //
 TInt DUsbClientController::DoForEveryEndpointInUse(TInt (DUsbClientController::*aFunction)(TInt), TInt& aCount)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DOFOREVERYENDPOINTINUSE, 
-	        "DUsbClientController::DoForEveryEndpointInUse()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DoForEveryEndpointInUse()"));
 	aCount = 0;
 	TUsbcConfiguration* const config = CurrentConfig();
 	if (!config)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DOFOREVERYENDPOINTINUSE_DUP1, 
-                "  Device is not configured - returning" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  Device is not configured - returning"));
 		return KErrNone;
 		}
 	RPointerArray<TUsbcInterfaceSet>& ifcsets = config->iInterfaceSets;
--- a/kernel/eka/drivers/usbcc/descriptors.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/usbcc/descriptors.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -24,11 +24,6 @@
 
 #include <kernel/kern_priv.h>
 #include <drivers/usbc.h>
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "descriptorsTraces.h"
-#endif
-
 
 
 // Debug Support
@@ -44,15 +39,13 @@
 #endif
 	iBufPtr(NULL, 0)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORBASE_TUSBCDESCRIPTORBASE_CONS,
-	        "TUsbcDescriptorBase::TUsbcDescriptorBase()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorBase::TUsbcDescriptorBase()"));
 	}
 
 
 TUsbcDescriptorBase::~TUsbcDescriptorBase()
 	{
-    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORBASE_TUSBCDESCRIPTORBASE_DES,
-	        "TUsbcDescriptorBase::~TUsbcDescriptorBase()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorBase::~TUsbcDescriptorBase()"));
 	}
 
 
@@ -153,8 +146,7 @@
 TUsbcDeviceDescriptor::TUsbcDeviceDescriptor()
 	: iBuf()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDEVICEDESCRIPTOR_TUSBCDEVICEDESCRIPTOR_CONS, 
-	        "TUsbcDeviceDescriptor::TUsbcDeviceDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDeviceDescriptor::TUsbcDeviceDescriptor()"));
 	}
 
 
@@ -163,8 +155,7 @@
 												  TUint16 aVendorId, TUint16 aProductId,
 												  TUint16 aDeviceRelease, TUint8 aNumConfigurations)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDEVICEDESCRIPTOR_NEW, 
-	        "TUsbcDeviceDescriptor::New()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDeviceDescriptor::New()"));
 	TUsbcDeviceDescriptor* self = new TUsbcDeviceDescriptor();
 	if (self)
 		{
@@ -183,8 +174,7 @@
 									  TUint8 aMaxPacketSize0, TUint16 aVendorId, TUint16 aProductId,
 									  TUint16 aDeviceRelease, TUint8 aNumConfigurations)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDEVICEDESCRIPTOR_CONSTRUCT,
-	        "TUsbcDeviceDescriptor::Construct()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDeviceDescriptor::Construct()"));
 	iBuf.SetMax();
 	SetBufferPointer(iBuf);
 	iBuf[0] = iBuf.Size();									// bLength
@@ -208,16 +198,14 @@
 
 void TUsbcDeviceDescriptor::UpdateFs()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDEVICEDESCRIPTOR_UPDATEFS, 
-	        "TUsbcDeviceDescriptor::UpdateFs()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDeviceDescriptor::UpdateFs()"));
 	SetByte(7, iEp0Size_Fs);								// bMaxPacketSize0
 	}
 
 
 void TUsbcDeviceDescriptor::UpdateHs()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDEVICEDESCRIPTOR_UPDATEHS,
-	        "TUsbcDeviceDescriptor::UpdateHs()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDeviceDescriptor::UpdateHs()"));
 	SetByte(7, 64);											// bMaxPacketSize0
 	}
 
@@ -227,8 +215,7 @@
 TUsbcDeviceQualifierDescriptor::TUsbcDeviceQualifierDescriptor()
 	: iBuf()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDEVICEQUALIFIERDESCRIPTOR_TUSBCDEVICEQUALIFIERDESCRIPTOR_CONS,
-	        "TUsbcDeviceQualifierDescriptor::TUsbcDeviceQualifierDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDeviceDescriptor::TUsbcDeviceQualifierDescriptor()"));
 	}
 
 
@@ -239,8 +226,7 @@
 																	TUint8 aNumConfigurations,
 																	TUint8 aReserved)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDEVICEQUALIFIERDESCRIPTOR_NEW, 
-	        "TUsbcDeviceQualifierDescriptor::New()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDeviceQualifierDescriptor::New()"));
 	TUsbcDeviceQualifierDescriptor* self = new TUsbcDeviceQualifierDescriptor();
 	if (self)
 		{
@@ -259,8 +245,7 @@
 											   TUint8 aDeviceProtocol, TUint8 aMaxPacketSize0,
 											   TUint8 aNumConfigurations, TUint8 aReserved)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDEVICEQUALIFIERDESCRIPTOR_CONSTRUCT,
-	        "TUsbcDeviceQualifierDescriptor::Construct()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDeviceQualifierDescriptor::Construct()"));
 	iBuf.SetMax();
 	SetBufferPointer(iBuf);
 	iBuf[0] = iBuf.Size();									// bLength
@@ -280,8 +265,7 @@
 
 void TUsbcDeviceQualifierDescriptor::UpdateFs()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDEVICEQUALIFIERDESCRIPTOR_UPDATEFS,
-	        "TUsbcDeviceQualifierDescriptor::UpdateFs()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDeviceQualifierDescriptor::UpdateFs()"));
 	// Here we do exactly the opposite of what's done in the Device descriptor (as this one's
 	// documenting the 'other than the current speed').
 	SetByte(7, 64);											// bMaxPacketSize0
@@ -290,8 +274,7 @@
 
 void TUsbcDeviceQualifierDescriptor::UpdateHs()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDEVICEQUALIFIERDESCRIPTOR_UPDATEHS,
-	        "TUsbcDeviceQualifierDescriptor::UpdateHs()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDeviceQualifierDescriptor::UpdateHs()"));
 	// Here we do exactly the opposite of what's done in the Device descriptor (as this one's
 	// documenting the 'other than the current speed').
 	SetByte(7, iEp0Size_Fs);								// bMaxPacketSize0
@@ -303,16 +286,14 @@
 TUsbcConfigDescriptor::TUsbcConfigDescriptor()
 	: iBuf()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCCONFIGDESCRIPTOR_TUSBCCONFIGDESCRIPTOR_CONS,
-	        "TUsbcConfigDescriptor::TUsbcConfigDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcConfigDescriptor::TUsbcConfigDescriptor()"));
 	}
 
 
 TUsbcConfigDescriptor* TUsbcConfigDescriptor::New(TUint8 aConfigurationValue, TBool aSelfPowered,
 												  TBool aRemoteWakeup, TUint16 aMaxPower)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCCONFIGDESCRIPTOR_NEW,
-	        "TUsbcConfigDescriptor::New()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcConfigDescriptor::New()"));
 	TUsbcConfigDescriptor* self = new TUsbcConfigDescriptor();
 	if (self)
 		{
@@ -329,8 +310,7 @@
 TInt TUsbcConfigDescriptor::Construct(TUint8 aConfigurationValue, TBool aSelfPowered,
 									   TBool aRemoteWakeup, TUint16 aMaxPower)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCCONFIGDESCRIPTOR_CONSTRUCT,
-	        "TUsbcConfigDescriptor::Construct()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcConfigDescriptor::Construct()"));
 	iBuf.SetMax();
 	SetBufferPointer(iBuf);
 	iBuf[0] = iBuf.Size();									// bLength
@@ -343,8 +323,7 @@
 		(aSelfPowered ? KUsbDevAttr_SelfPowered : 0) |
 		(aRemoteWakeup ? KUsbDevAttr_RemoteWakeup : 0);		// bmAttributes (bit 7 always 1)
 	if (aMaxPower > 510)
-		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUP1_TUSBCCONFIGDESCRIPTOR_CONSTRUCT_DUP1,
-		        "  Error: Invalid value for bMaxPower: %d", aMaxPower );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid value for bMaxPower: %d", aMaxPower));
 	iBuf[8] = aMaxPower / 2;								// bMaxPower (2mA units!)
 	return KErrNone;
 	}
@@ -355,16 +334,14 @@
 TUsbcInterfaceDescriptor::TUsbcInterfaceDescriptor()
 	: iBuf()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCINTERFACEDESCRIPTOR_TUSBCINTERFACEDESCRIPTOR_CONS,
-	        "TUsbcInterfaceDescriptor::TUsbcInterfaceDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcInterfaceDescriptor::TUsbcInterfaceDescriptor()"));
 	}
 
 
 TUsbcInterfaceDescriptor* TUsbcInterfaceDescriptor::New(TUint8 aInterfaceNumber, TUint8 aAlternateSetting,
 														TInt aNumEndpoints, const TUsbcClassInfo& aClassInfo)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCINTERFACEDESCRIPTOR_NEW,
-	        "TUsbcInterfaceDescriptor::New()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcInterfaceDescriptor::New()"));
 	TUsbcInterfaceDescriptor* self = new TUsbcInterfaceDescriptor();
 	if (self)
 		{
@@ -381,8 +358,7 @@
 TInt TUsbcInterfaceDescriptor::Construct(TUint8 aInterfaceNumber, TUint8 aAlternateSetting,
 										 TInt aNumEndpoints, const TUsbcClassInfo& aClassInfo)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCINTERFACEDESCRIPTOR_CONSTRUCT,
-	        "TUsbcInterfaceDescriptor::Construct()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcInterfaceDescriptor::Construct()"));
 	iBuf.SetMax();
 	SetBufferPointer(iBuf);
 	iBuf[0] = iBuf.Size();									// bLength
@@ -402,24 +378,20 @@
 
 TUsbcEndpointDescriptorBase::TUsbcEndpointDescriptorBase()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCENDPOINTDESCRIPTORBASE_TUSBCENDPOINTDESCRIPTORBASE_CONS,
-	        "TUsbcEndpointDescriptorBase::TUsbcEndpointDescriptorBase()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpointDescriptorBase::TUsbcEndpointDescriptorBase()"));
 	}
 
 
 TInt TUsbcEndpointDescriptorBase::Construct(const TUsbcEndpointInfo& aEpInfo)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT,
-	        "TUsbcEndpointDescriptorBase::Construct()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpointDescriptorBase::Construct()"));
 	//  Adjust FS/HS endpoint sizes
 	if (aEpInfo.AdjustEpSizes(iEpSize_Fs, iEpSize_Hs) != KErrNone)
 		{
-		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP1,
-		        "  Error: Unknown endpoint type: %d", aEpInfo.iType );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Unknown endpoint type: %d", aEpInfo.iType));
 		}
-	OstTraceDefExt3( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP2,
-	        "  Now set: iEpSize_Fs=%d iEpSize_Hs=%d (aEpInfo.iSize=%d)",
-	        iEpSize_Fs, iEpSize_Hs, aEpInfo.iSize );
+	__KTRACE_OPT(KUSB, Kern::Printf("  Now set: iEpSize_Fs=%d iEpSize_Hs=%d (aEpInfo.iSize=%d)",
+									iEpSize_Fs, iEpSize_Hs, aEpInfo.iSize));
 
 	//  Adjust HS endpoint size for additional transactions
 	if ((aEpInfo.iType == KUsbEpTypeIsochronous) || (aEpInfo.iType == KUsbEpTypeInterrupt))
@@ -428,16 +400,14 @@
 			{
 			// Bits 12..11 specify the number of additional transactions per microframe
 			iEpSize_Hs |= (aEpInfo.iTransactions << 12);
-			 OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP3,
-			         "  Adjusted for add. transact.: iEpSize_Hs=0x%02x (aEpInfo.iTransactions=%d)",
-			         iEpSize_Hs, aEpInfo.iTransactions );
-
+			__KTRACE_OPT(KUSB, Kern::Printf("  Adjusted for add. transact.: iEpSize_Hs=0x%02x "
+											"(aEpInfo.iTransactions=%d)",
+											iEpSize_Hs, aEpInfo.iTransactions));
 			}
 		else if (aEpInfo.iTransactions != 0)
 			{
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP4,
-                    "  Warning: Invalid iTransactions value: %d (ignored)", aEpInfo.iTransactions );
-
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Invalid iTransactions value: %d (ignored)",
+											  aEpInfo.iTransactions));
 			}
 		}
 
@@ -445,22 +415,20 @@
 	TUsbcEndpointInfo info(aEpInfo);						// create local writeable copy
 	if (info.AdjustPollInterval() != KErrNone)
 		{
-        OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP5,
-                "  Error: Unknown ep type (%d) or invalid interval value (%d)", info.iType, info.iInterval );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Unknown ep type (%d) or invalid interval value (%d)",
+										  info.iType, info.iInterval));
 		}
 	iInterval_Fs = info.iInterval;
 	iInterval_Hs = info.iInterval_Hs;
-    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCENDPOINTDESCRIPTORBASE_CONSTRUCT_DUP6,
-            "  Now set: iInterval_Fs=%d iInterval_Hs=%d", iInterval_Fs, iInterval_Hs );
-
+	__KTRACE_OPT(KUSB, Kern::Printf("  Now set: iInterval_Fs=%d iInterval_Hs=%d",
+									iInterval_Fs, iInterval_Hs));
 	return KErrNone;
 	}
 
 
 void TUsbcEndpointDescriptorBase::UpdateFs()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCENDPOINTDESCRIPTORBASE_UPDATEFS,
-	        "TUsbcEndpointDescriptorBase::UpdateFs" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpointDescriptorBase::UpdateFs()"));
 	// (TUsbcEndpointDescriptorBase's FS/HS endpoint sizes and interval values got
 	//  adjusted in its Construct() method.)
 	SetWord(4, iEpSize_Fs);									// wMaxPacketSize
@@ -470,8 +438,7 @@
 
 void TUsbcEndpointDescriptorBase::UpdateHs()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCENDPOINTDESCRIPTORBASE_UPDATEHS,
-	        "TUsbcEndpointDescriptorBase::UpdateHs()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpointDescriptorBase::UpdateHs()"));
 	// (TUsbcEndpointDescriptorBase's FS/HS endpoint sizes and interval values get
 	//  adjusted in its Construct() method.)
 	SetWord(4, iEpSize_Hs);									// wMaxPacketSize
@@ -484,16 +451,14 @@
 TUsbcEndpointDescriptor::TUsbcEndpointDescriptor()
 	: iBuf()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCENDPOINTDESCRIPTOR_TUSBCENDPOINTDESCRIPTOR_CONS,
-	        "TUsbcEndpointDescriptor::TUsbcEndpointDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpointDescriptor::TUsbcEndpointDescriptor()"));
 	}
 
 
 TUsbcEndpointDescriptor* TUsbcEndpointDescriptor::New(TUint8 aEndpointAddress,
 													  const TUsbcEndpointInfo& aEpInfo)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCENDPOINTDESCRIPTOR_NEW,
-	        "TUsbcEndpointDescriptor::New()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpointDescriptor::New()"));
 	TUsbcEndpointDescriptor* self = new TUsbcEndpointDescriptor();
 	if (self)
 		{
@@ -509,8 +474,7 @@
 
 TInt TUsbcEndpointDescriptor::Construct(TUint8 aEndpointAddress, const TUsbcEndpointInfo& aEpInfo)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCENDPOINTDESCRIPTOR_CONSTRUCT,
-	        "TUsbcEndpointDescriptor::Construct()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcEndpointDescriptor::Construct()"));
 	(void) TUsbcEndpointDescriptorBase::Construct(aEpInfo);	// Init Base class
 	iBuf.SetMax();
 	SetBufferPointer(iBuf);
@@ -529,16 +493,14 @@
 TUsbcAudioEndpointDescriptor::TUsbcAudioEndpointDescriptor()
 	: iBuf()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCAUDIOENDPOINTDESCRIPTOR_TUSBCAUDIOENDPOINTDESCRIPTOR_CONS,
-	        "TUsbcAudioEndpointDescriptor::TUsbcAudioEndpointDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcAudioEndpointDescriptor::TUsbcAudioEndpointDescriptor()"));
 	}
 
 
 TUsbcAudioEndpointDescriptor* TUsbcAudioEndpointDescriptor::New(TUint8 aEndpointAddress,
 																const TUsbcEndpointInfo& aEpInfo)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCAUDIOENDPOINTDESCRIPTOR_NEW,
-	        "TUsbcAudioEndpointDescriptor::New()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcAudioEndpointDescriptor::New()"));
 	TUsbcAudioEndpointDescriptor* self = new TUsbcAudioEndpointDescriptor();
 	if (self)
 		{
@@ -554,8 +516,7 @@
 
 TInt TUsbcAudioEndpointDescriptor::Construct(TUint8 aEndpointAddress, const TUsbcEndpointInfo& aEpInfo)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCAUDIOENDPOINTDESCRIPTOR_CONSTRUCT,
-	        "TUsbcAudioEndpointDescriptor::Construct()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcAudioEndpointDescriptor::Construct()"));
 	(void) TUsbcEndpointDescriptorBase::Construct(aEpInfo);	// Init Base class
 	iBuf.SetMax();
 	SetBufferPointer(iBuf);
@@ -575,8 +536,7 @@
 
 TUsbcOtgDescriptor* TUsbcOtgDescriptor::New(TBool aHnpSupport, TBool aSrpSupport)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCOTGDESCRIPTOR_NEW,
-	        "TUsbcOtgDescriptor::New()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcOtgDescriptor::New()"));
 	TUsbcOtgDescriptor* self = new TUsbcOtgDescriptor();
 	if (self && (self->Construct(aHnpSupport, aSrpSupport) != KErrNone))
 		{
@@ -590,15 +550,13 @@
 TUsbcOtgDescriptor::TUsbcOtgDescriptor()
 	: iBuf()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCOTGDESCRIPTOR_TUSBCOTGDESCRIPTOR_CONS, 
-	        "TUsbcOtgDescriptor::TUsbcOtgDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcOtgDescriptor::TUsbcOtgDescriptor()"));
 	}
 
 
 TInt TUsbcOtgDescriptor::Construct(TBool aHnpSupport, TBool aSrpSupport)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCOTGDESCRIPTOR_CONSTRUCT,
-	        "TUsbcOtgDescriptor::Construct()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcOtgDescriptor::Construct()"));
 	iBuf.SetMax();
 	SetBufferPointer(iBuf);
 	iBuf[0] = iBuf.Size();									// bLength
@@ -614,23 +572,20 @@
 TUsbcClassSpecificDescriptor::TUsbcClassSpecificDescriptor()
 	: iBuf(NULL)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCCLASSSPECIFICDESCRIPTOR_TUSBCCLASSSPECIFICDESCRIPTOR_CONS,
-	        "TUsbcClassSpecificDescriptor::TUsbcClassSpecificDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcClassSpecificDescriptor::TUsbcClassSpecificDescriptor()"));
 	}
 
 
 TUsbcClassSpecificDescriptor::~TUsbcClassSpecificDescriptor()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCCLASSSPECIFICDESCRIPTOR_TUSBCCLASSSPECIFICDESCRIPTOR_DES,
-	        "TUsbcClassSpecificDescriptor::~TUsbcClassSpecificDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcClassSpecificDescriptor::~TUsbcClassSpecificDescriptor()"));
 	delete iBuf;
 	}
 
 
 TUsbcClassSpecificDescriptor* TUsbcClassSpecificDescriptor::New(TUint8 aType, TInt aSize)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCCLASSSPECIFICDESCRIPTOR_NEW,
-	        "TUsbcClassSpecificDescriptor::New()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcClassSpecificDescriptor::New()"));
 	TUsbcClassSpecificDescriptor* self = new TUsbcClassSpecificDescriptor();
 	if (self)
 		{
@@ -646,13 +601,11 @@
 
 TInt TUsbcClassSpecificDescriptor::Construct(TUint8 aType, TInt aSize)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCCLASSSPECIFICDESCRIPTOR_CONSTRUCT, 
-	        "TUsbcClassSpecificDescriptor::Construct()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcClassSpecificDescriptor::Construct()"));
 	iBuf = HBuf8::New(aSize);
 	if (!iBuf)
 		{
-		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCCLASSSPECIFICDESCRIPTOR_CONSTRUCT_DUP1,
-		        "  Error: Allocation of CS desc buffer failed" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Allocation of CS desc buffer failed"));
 		return KErrNoMemory;
 		}
 	iBuf->SetMax();
@@ -667,15 +620,13 @@
 TUsbcStringDescriptorBase::TUsbcStringDescriptorBase()
 	: /*iIndex(0),*/ iSBuf(0), iBufPtr(NULL, 0)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSTRINGDESCRIPTORBASE_TUSBCSTRINGDESCRIPTORBASE_CONS,
-	        "TUsbcStringDescriptorBase::TUsbcStringDescriptorBase()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcStringDescriptorBase::TUsbcStringDescriptorBase()"));
 	}
 
 
 TUsbcStringDescriptorBase::~TUsbcStringDescriptorBase()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSTRINGDESCRIPTORBASE_TUSBCSTRINGDESCRIPTORBASE_DES, 
-	        "TUsbcStringDescriptorBase::~TUsbcStringDescriptorBase()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcStringDescriptorBase::~TUsbcStringDescriptorBase()"));
 	}
 
 
@@ -683,8 +634,8 @@
 	{
 	if (aPosition <= 1)
 		{
-		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCSTRINGDESCRIPTORBASE_WORD,
-		        "  Error: Word(%d) in string descriptor (TUsbcStringDescriptorBase::Word)", aPosition );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Word(%d) in string descriptor "
+										  "(TUsbcStringDescriptorBase::Word)", aPosition));
 		return 0;
 		}
 	else
@@ -700,8 +651,8 @@
 	{
 	if (aPosition <= 1)
 		{
-		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCSTRINGDESCRIPTORBASE_SETWORD,
-		        "  Error: SetWord(%d) in string descriptor (TUsbcStringDescriptorBase::SetWord)", aPosition );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: SetWord(%d) in string descriptor "
+										  "(TUsbcStringDescriptorBase::SetWord)", aPosition));
 		return;
 		}
 	else
@@ -762,23 +713,20 @@
 TUsbcStringDescriptor::TUsbcStringDescriptor()
 	: iBuf(NULL)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSTRINGDESCRIPTOR_TUSBCSTRINGDESCRIPTOR_CONS, 
-	        "TUsbcStringDescriptor::TUsbcStringDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcStringDescriptor::TUsbcStringDescriptor()"));
 	}
 
 
 TUsbcStringDescriptor::~TUsbcStringDescriptor()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSTRINGDESCRIPTOR_TUSBCSTRINGDESCRIPTOR_DES,
-	        "TUsbcStringDescriptor::~TUsbcStringDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcStringDescriptor::~TUsbcStringDescriptor()"));
 	delete iBuf;
 	}
 
 
 TUsbcStringDescriptor* TUsbcStringDescriptor::New(const TDesC8& aString)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSTRINGDESCRIPTOR_NEW, 
-	        "TUsbcStringDescriptor::New()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcStringDescriptor::New"));
 	TUsbcStringDescriptor* self = new TUsbcStringDescriptor();
 	if (self)
 		{
@@ -794,13 +742,11 @@
 
 TInt TUsbcStringDescriptor::Construct(const TDesC8& aString)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSTRINGDESCRIPTOR_CONSTRUCT,
-	        "TUsbcStringDescriptor::Construct()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcStringDescriptor::Construct"));
 	iBuf = HBuf8::New(aString.Size());						// bytes, not UNICODE chars
 	if (!iBuf)
 		{
-		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCSTRINGDESCRIPTOR_CONSTRUCT_DUP1,
-		        "  Error: Allocation of string buffer failed" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Allocation of string buffer failed"));
 		return KErrNoMemory;
 		}
 	iBuf->SetMax();
@@ -818,22 +764,19 @@
 TUsbcLangIdDescriptor::TUsbcLangIdDescriptor()
 	: iBuf(NULL)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCLANGIDDESCRIPTOR_TUSBCLANGIDDESCRIPTOR_CONS, 
-	        "TUsbcLangIdDescriptor::TUsbcLangIdDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcLangIdDescriptor::TUsbcLangIdDescriptor()"));
 	}
 
 
 TUsbcLangIdDescriptor::~TUsbcLangIdDescriptor()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCLANGIDDESCRIPTOR_TUSBCLANGIDDESCRIPTOR_DES,
-	        "TUsbcLangIdDescriptor::~TUsbcLangIdDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcLangIdDescriptor::~TUsbcLangIdDescriptor()"));
 	}
 
 
 TUsbcLangIdDescriptor* TUsbcLangIdDescriptor::New(TUint16 aLangId)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCLANGIDDESCRIPTOR_NEW, 
-	        "TUsbcLangIdDescriptor::New()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcLangIdDescriptor::New"));
 	TUsbcLangIdDescriptor* self = new TUsbcLangIdDescriptor();
 	if (self)
 		{
@@ -849,8 +792,7 @@
 
 TInt TUsbcLangIdDescriptor::Construct(TUint16 aLangId)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCLANGIDDESCRIPTOR_CONSTRUCT,
-	        "TUsbcLangIdDescriptor::Construct()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcLangIdDescriptor::Construct"));
 	iBuf.SetMax();
 	SetBufferPointer(iBuf);
 	iBufPtr[0] = LowByte(SWAP_BYTES_16(aLangId));			// Language ID value
@@ -870,22 +812,17 @@
 //
 	: iDescriptors(), iStrings(), iIfcIdx(0), iEp0_TxBuf(aEp0_TxBuf), iHighSpeed(EFalse)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_TUSBCDESCRIPTORPOOL_CONS,
-	        "TUsbcDescriptorPool::TUsbcDescriptorPool()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::TUsbcDescriptorPool()"));
 	}
 
 
 TUsbcDescriptorPool::~TUsbcDescriptorPool()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_TUSBCDESCRIPTORPOOL_DES, 
-	        "TUsbcDescriptorPool::~TUsbcDescriptorPool()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::~TUsbcDescriptorPool()"));
 	// The destructor of each <class T> object is called before the objects themselves are destroyed.
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_TUSBCDESCRIPTORPOOL_DES_DUP1,
-	        "  iDescriptors.Count(): %d", iDescriptors.Count() );
+	__KTRACE_OPT(KUSB, Kern::Printf("  iDescriptors.Count(): %d", iDescriptors.Count()));
 	iDescriptors.ResetAndDestroy();
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_TUSBCDESCRIPTORPOOL_DES_DUP2,
-            "  iStrings.Count(): %d", iStrings.Count() );
-
+	__KTRACE_OPT(KUSB, Kern::Printf("  iStrings.Count(): %d", iStrings.Count()));
 	iStrings.ResetAndDestroy();
 	}
 
@@ -895,27 +832,19 @@
 							   TUsbcStringDescriptor* aProduct, TUsbcStringDescriptor* aSerialNum,
 							   TUsbcStringDescriptor* aConfig, TUsbcOtgDescriptor* aOtgDesc)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_INIT, 
-	        "TUsbcDescriptorPool::Init()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::Init()"));
 	if (!aDeviceDesc || !aConfigDesc)
 		{
-		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_INIT_DUP1, 
-		        "  Error: No Device or Config descriptor specified" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: No Device or Config descriptor specified"));
 		return KErrArgument;
 		}
 	for (TInt n = 0; n < KDescPosition_FirstAvailable; n++)
 		{
 		iDescriptors.Append(NULL);
 		}
-#ifdef _DEBUG
-	if (iDescriptors.Count() != KDescPosition_FirstAvailable)
-	    {
-        OstTraceDefExt2( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_INIT_DUP2,
-                "  Error: iDescriptors.Count() (%d) != KDescPosition_FirstAvailable (%d)",
-                iDescriptors.Count(), KDescPosition_FirstAvailable );
-
-	    }
-#endif
+	__ASSERT_DEBUG((iDescriptors.Count() == KDescPosition_FirstAvailable),
+				   Kern::Printf("  Error: iDescriptors.Count() (%d) != KDescPosition_FirstAvailable (%d)",
+								iDescriptors.Count(), KDescPosition_FirstAvailable));
 	iDescriptors[KDescPosition_Device] = aDeviceDesc;
 	iDescriptors[KDescPosition_Config] = aConfigDesc;
 	if (aOtgDesc)
@@ -930,9 +859,7 @@
 		// that contains an array of two-byte LANGID codes supported by the device. ...
 		// USB devices that omit all string descriptors must not return an array of LANGID codes."
 		// So if we have at least one string descriptor, we must also have a LANGID descriptor.
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_INIT_DUP3, 
-                "  Error: No LANGID string descriptor specified" );
-
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: No LANGID string descriptor specified"));
 		return KErrArgument;
 		}
 	iStrings.Insert(aLangId, KStringPosition_Langid);
@@ -940,18 +867,12 @@
 	iStrings.Insert(aProduct, KStringPosition_Product);
 	iStrings.Insert(aSerialNum, KStringPosition_Serial);
 	iStrings.Insert(aConfig, KStringPosition_Config);
-#ifdef _DEBUG
-	if (iStrings.Count() != 5)
-	    {
-        OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_INIT_DUP4,
-                "  Error: iStrings.Count() != 5 (%d)", iStrings.Count() );
-	    }
-#endif
+	__ASSERT_DEBUG((iStrings.Count() == 5),
+				   Kern::Printf("  Error: iStrings.Count() != 5 (%d)", iStrings.Count()));
 #ifdef _DEBUG
 	for (TInt i = KStringPosition_Langid; i <= KStringPosition_Config; i++)
 		{
-        OstTraceDefExt2( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_INIT_DUP5,
-                "TUsbcDescriptorPool.iStrings[%d] = 0x%x", i, reinterpret_cast<TUint>(iStrings[i]) );
+		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool.iStrings[%d] = 0x%x", i, iStrings[i]));
 		}
 #endif
 	// Set string indices
@@ -973,16 +894,9 @@
 
 TInt TUsbcDescriptorPool::InitHs()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_INITHS, 
-	        "TUsbcDescriptorPool::InitHs()" );
-#ifdef _DEBUG
-	if (iDescriptors.Count() < KDescPosition_FirstAvailable)
-	    {
-        OstTraceDef0( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_INITHS_DUP1, 
-                "  Error: Call Init() first)" );
-
-	    }
-#endif
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::InitHs()"));
+	__ASSERT_DEBUG((iDescriptors.Count() >= KDescPosition_FirstAvailable),
+				   Kern::Printf("  Error: Call Init() first)"));
 
 	TUsbcDeviceQualifierDescriptor* const dq_desc = TUsbcDeviceQualifierDescriptor::New(
 		iDescriptors[KDescPosition_Device]->Byte(4),		// aDeviceClass
@@ -992,8 +906,7 @@
 		iDescriptors[KDescPosition_Device]->Byte(17));		// aNumConfigurations
 	if (!dq_desc)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_INITHS_DUP2,
-                "  Error: Memory allocation for dev qualif desc failed." );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Memory allocation for dev qualif desc failed."));
 		return KErrGeneral;
 		}
 	iDescriptors[KDescPosition_DeviceQualifier] = dq_desc;
@@ -1005,8 +918,7 @@
 		iDescriptors[KDescPosition_Config]->Byte(8) * 2);	// aMaxPower (mA)
 	if (!osc_desc)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_INITHS_DUP3,
-                "  Error: Memory allocation for other speed conf desc failed." );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Memory allocation for other speed conf desc failed."));
 		return KErrGeneral;
 		}
 
@@ -1027,8 +939,7 @@
 
 TInt TUsbcDescriptorPool::UpdateDescriptorsFs()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_UPDATEDESCRIPTORSFS,
-	        "TUsbcDescriptorPool::UpdateDescriptorsFs()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::UpdateDescriptorsFs()"));
 	const TInt count = iDescriptors.Count();
 	for (TInt i = KDescPosition_FirstAvailable; i < count; i++)
 		{
@@ -1042,8 +953,7 @@
 
 TInt TUsbcDescriptorPool::UpdateDescriptorsHs()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_UPDATEDESCRIPTORSHS,
-	        "TUsbcDescriptorPool::UpdateDescriptorsHs()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::UpdateDescriptorsHs()"));
 	const TInt count = iDescriptors.Count();
 	for (TInt i = KDescPosition_FirstAvailable; i < count; i++)
 		{
@@ -1060,21 +970,18 @@
 //
 TInt TUsbcDescriptorPool::FindDescriptor(TUint8 aType, TUint8 aIndex, TUint16 aLangid, TInt& aSize) const
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR, 
-	        "TUsbcDescriptorPool::FindDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::FindDescriptor()"));
 	TInt result = KErrGeneral;
 	switch (aType)
 		{
 	case KUsbDescType_Device:
 		if (aLangid != 0)
 			{
-		 OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP1,
-		         "  Error: bad langid: 0x%04x", aLangid );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: bad langid: 0x%04x", aLangid));
 			}
 		else if (aIndex > 0)
 			{
-	       OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP2,
-	               "  Error: bad device index: %d", aIndex );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: bad device index: %d", aIndex));
 			}
 		else
 			{
@@ -1085,13 +992,11 @@
 	case KUsbDescType_Config:
 		if (aLangid != 0)
 			{
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP3,
-                    "  Error: bad langid: 0x%04x", aLangid );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: bad langid: 0x%04x", aLangid));
 			}
 		else if (aIndex > 0)
 			{
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP4,
-                    "  Error: bad config index: %d", aIndex );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: bad config index: %d", aIndex));
 			}
 		else
 			{
@@ -1102,13 +1007,11 @@
 	case KUsbDescType_DeviceQualifier:
 		if (aLangid != 0)
 			{
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP5,
-                    "  Error: bad langid: 0x%04x", aLangid );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: bad langid: 0x%04x", aLangid));
 			}
 		else if (aIndex > 0)
 			{
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP6,
-                    "  Error: bad device index: %d", aIndex );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: bad device index: %d", aIndex));
 			}
 		else
 			{
@@ -1119,13 +1022,11 @@
 	case KUsbDescType_OtherSpeedConfig:
 		if (aLangid != 0)
 			{
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP7,
-                    "  Error: bad langid: 0x%04x", aLangid );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: bad langid: 0x%04x", aLangid));
 			}
 		else if (aIndex > 0)
 			{
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP8,
-                    "  Error: bad config index: %d", aIndex );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: bad config index: %d", aIndex));
 			}
 		else
 			{
@@ -1147,25 +1048,24 @@
 				}
 			else
 				{
-                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP9,
-                        "  No string descriptors: not returning LANGID array" );
+				__KTRACE_OPT(KUSB, Kern::Printf("  No string descriptors: not returning LANGID array"));
 				}
 			}
 		else
 			{
    			if (!aLangid)
    				{
-                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP10,
-                        "  Strange: LANGID=0 for a $ descriptor (ignoring LANGID)" );
+   				__KTRACE_OPT(KUSB,
+ 							 Kern::Printf("  Strange: LANGID=0 for a $ descriptor (ignoring LANGID)"));
 				// The USB spec doesn't really say what to do in this case, but as there are host apps
 				// that fail if we return an error here, we choose to ignore the issue.
    				}
 			else if (aLangid != iStrings[KStringPosition_Langid]->Word(2))
 				{
 				// We have only one (this) language
-                OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP11,
-                        "  Bad LANGID: 0x%04X requested, 0x%04X supported (ignoring LANGID)",
-                        aLangid, iStrings[KStringPosition_Langid]->Word(2) );
+				__KTRACE_OPT(KUSB,
+							 Kern::Printf("  Bad LANGID: 0x%04X requested, 0x%04X supported (ignoring LANGID)",
+										  aLangid, iStrings[KStringPosition_Langid]->Word(2)));
 				// We could return an error here, but rather choose to ignore the discrepancy
 				// (the USB spec is not very clear what to do in such a case anyway).
 				}
@@ -1176,12 +1076,10 @@
 	case KUsbDescType_CS_Interface:
 		/* fall through */
 	case KUsbDescType_CS_Endpoint:
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP12,
-                "  Warning: finding of class specific descriptors not supported" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: finding of class specific descriptors not supported"));
 		break;
 	default:
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDDESCRIPTOR_DUP13,
-                "  Error: unknown descriptor type requested: %d", aType );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: unknown descriptor type requested: %d", aType));
 		break;
 		}
 	return result;
@@ -1190,8 +1088,7 @@
 
 void TUsbcDescriptorPool::InsertDescriptor(TUsbcDescriptorBase* aDesc)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_INSERTDESCRIPTOR, 
-	        "TUsbcDescriptorPool::InsertDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::InsertDescriptor()"));
 	switch (aDesc->Type())
 		{
 	case KUsbDescType_Interface:
@@ -1201,21 +1098,19 @@
 		InsertEpDesc(aDesc);
 		break;
 	default:
-	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_INSERTDESCRIPTOR_DUP1,
-	            "  Error: unsupported descriptor type" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  Error: unsupported descriptor type"));
 		}
 	}
 
 
 void TUsbcDescriptorPool::SetIfcStringDescriptor(TUsbcStringDescriptor* aDesc, TInt aNumber, TInt aSetting)
 	{
-	OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_SETIFCSTRINGDESCRIPTOR,
-	        "TUsbcDescriptorPool::SetIfcDescriptor(%d, %d)", aNumber, aSetting );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::SetIfcDescriptor(%d, %d)", aNumber, aSetting));
 	const TInt i = FindIfcDescriptor(aNumber, aSetting);
 	if (i < 0)
 		{
-	    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETIFCSTRINGDESCRIPTOR_DUP1,
-	           "  Error: Ifc descriptor not found (%d, %d)", aNumber, aSetting );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Ifc descriptor not found (%d, %d)",
+										  aNumber, aSetting));
 		return;
 		}
 	// Try to find available NULL postition
@@ -1231,8 +1126,7 @@
 		str_idx = iStrings.Count();
 		if (str_idx > 0xff)
 			{
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETIFCSTRINGDESCRIPTOR_DUP2,
-                    "  Error: $ descriptor array full (idx=%d)", str_idx );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: $ descriptor array full (idx=%d)", str_idx));
 			return;
 			}
 		while (str_idx < KStringPosition_FirstAvailable)
@@ -1245,21 +1139,19 @@
 		}
 	// Update this ifc descriptor's string index field
 	iDescriptors[i]->SetByte(8, str_idx);
-	OstTraceDefExt4( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_SETIFCSTRINGDESCRIPTOR_DUP3,
-	        "  String for ifc %d/%d (@ pos %d): \"%s\"", aNumber, aSetting, str_idx,
-	        iStrings[str_idx]->StringData() );
+	__KTRACE_OPT(KUSB, Kern::Printf("  String for ifc %d/%d (@ pos %d): \"%S\"", aNumber, aSetting, str_idx,
+									&iStrings[str_idx]->StringData()));
 	}
 
 
 void TUsbcDescriptorPool::DeleteIfcDescriptor(TInt aNumber, TInt aSetting)
 	{
-	OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_DELETEIFCDESCRIPTOR,
-	        "TUsbcDescriptorPool::DeleteIfcDescriptor(%d, %d)", aNumber, aSetting );	        
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::DeleteIfcDescriptor(%d, %d)", aNumber, aSetting));
 	const TInt i = FindIfcDescriptor(aNumber, aSetting);
 	if (i < 0)
 		{
-        OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_DELETEIFCDESCRIPTOR_DUP1,
-                "  Error: DeleteIfcDescriptor - descriptor not found (%d, %d)", aNumber, aSetting );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: DeleteIfcDescriptor - descriptor not found (%d, %d)",
+										  aNumber, aSetting));
 		return;
 		}
 	// Delete (if necessary) specified interface's string descriptor
@@ -1287,16 +1179,14 @@
 
 TInt TUsbcDescriptorPool::GetDeviceDescriptorTC(DThread* aThread, TDes8& aBuffer) const
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETDEVICEDESCRIPTORTC, 
-	        "TUsbcDescriptorPool::GetDeviceDescriptorTC()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetDeviceDescriptorTC()"));
 	return Kern::ThreadDesWrite(aThread, &aBuffer, iDescriptors[KDescPosition_Device]->DescriptorData(), 0);
 	}
 
 
 TInt TUsbcDescriptorPool::SetDeviceDescriptorTC(DThread* aThread, const TDes8& aBuffer)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_SETDEVICEDESCRIPTORTC, 
-	        "TUsbcDescriptorPool::SetDeviceDescriptorTC()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::SetDeviceDescriptorTC()"));
 	TBuf8<KUsbDescSize_Device> device;
 	const TInt r = Kern::ThreadDesRead(aThread, &aBuffer, device, 0);
 	if (r != KErrNone)
@@ -1320,16 +1210,14 @@
 
 TInt TUsbcDescriptorPool::GetConfigurationDescriptorTC(DThread* aThread, TDes8& aBuffer) const
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTORTC, 
-	        "TUsbcDescriptorPool::GetConfigurationDescriptorTC()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetConfigurationDescriptorTC()"));
 	return Kern::ThreadDesWrite(aThread, &aBuffer, iDescriptors[KDescPosition_Config]->DescriptorData(), 0);
 	}
 
 
 TInt TUsbcDescriptorPool::SetConfigurationDescriptorTC(DThread* aThread, const TDes8& aBuffer)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_SETCONFIGURATIONDESCRIPTORTC, 
-	        "TUsbcDescriptorPool::SetConfigurationDescriptorTC()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::SetConfigurationDescriptorTC()"));
 	TBuf8<KUsbDescSize_Config> config;
 	const TInt r = Kern::ThreadDesRead(aThread, &aBuffer, config, 0);
 	if (r != KErrNone)
@@ -1358,13 +1246,11 @@
 TInt TUsbcDescriptorPool::GetInterfaceDescriptorTC(DThread* aThread, TDes8& aBuffer,
 												   TInt aInterface, TInt aSetting) const
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETINTERFACEDESCRIPTORTC,
-	        "TUsbcDescriptorPool::GetInterfaceDescriptorTC()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetInterfaceDescriptorTC()"));
 	const TInt i = FindIfcDescriptor(aInterface, aSetting);
 	if (i < 0)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETINTERFACEDESCRIPTORTC_DUP1,
-                "  Error: no such interface" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such interface"));
 		return KErrNotFound;
 		}
 	return Kern::ThreadDesWrite(aThread, &aBuffer, iDescriptors[i]->DescriptorData(), 0);
@@ -1373,13 +1259,11 @@
 
 TInt TUsbcDescriptorPool::SetInterfaceDescriptor(const TDes8& aBuffer, TInt aInterface, TInt aSetting)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_SETINTERFACEDESCRIPTOR, 
-	        "TUsbcDescriptorPool::SetInterfaceDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::SetInterfaceDescriptor()"));
 	const TInt i = FindIfcDescriptor(aInterface, aSetting);
 	if (i < 0)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETINTERFACEDESCRIPTOR_DUP1,
-                "  Error: no such interface" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such interface"));
 		return KErrNotFound;
 		}
 	iDescriptors[i]->SetByte(2, aBuffer[2]);				// bInterfaceNumber
@@ -1393,13 +1277,11 @@
 TInt TUsbcDescriptorPool::GetEndpointDescriptorTC(DThread* aThread, TDes8& aBuffer,
 												  TInt aInterface, TInt aSetting, TUint8 aEndpointAddress) const
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETENDPOINTDESCRIPTORTC,
-	        "TUsbcDescriptorPool::GetEndpointDescriptorTC()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetEndpointDescriptorTC()"));
 	const TInt i = FindEpDescriptor(aInterface, aSetting, aEndpointAddress);
 	if (i < 0)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETENDPOINTDESCRIPTORTC_DUP1,
-                "  Error: no such endpoint" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such endpoint"));
 		return KErrNotFound;
 		}
 	return Kern::ThreadDesWrite(aThread, &aBuffer, iDescriptors[i]->DescriptorData(), 0);
@@ -1409,13 +1291,11 @@
 TInt TUsbcDescriptorPool::SetEndpointDescriptorTC(DThread* aThread, const TDes8& aBuffer,
 												  TInt aInterface, TInt aSetting, TUint8 aEndpointAddress)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_SETENDPOINTDESCRIPTORTC, 
-	        "TUsbcDescriptorPool::SetEndpointDescriptorTC()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::SetEndpointDescriptorTC()"));
 	const TInt i = FindEpDescriptor(aInterface, aSetting, aEndpointAddress);
 	if (i < 0)
 		{
-	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETENDPOINTDESCRIPTORTC_DUP1, 
-	            "  Error: no such endpoint" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such endpoint"));
 		return KErrNotFound;
 		}
 	TBuf8<KUsbDescSize_AudioEndpoint> ep;					// it could be an audio endpoint
@@ -1438,13 +1318,11 @@
 TInt TUsbcDescriptorPool::GetEndpointDescriptorSize(TInt aInterface, TInt aSetting, TUint8 aEndpointAddress,
 													TInt& aSize) const
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETENDPOINTDESCRIPTORSIZE,
-	        "TUsbcDescriptorPool::GetEndpointDescriptorSize()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetEndpointDescriptorSize()"));
 	const TInt i = FindEpDescriptor(aInterface, aSetting, aEndpointAddress);
 	if (i < 0)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETENDPOINTDESCRIPTORSIZE_DUP1,
-                "  Error: no such endpoint" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such endpoint"));
 		return KErrNotFound;
 		}
 	aSize = iDescriptors[i]->Size();
@@ -1454,12 +1332,10 @@
 
 TInt TUsbcDescriptorPool::GetDeviceQualifierDescriptorTC(DThread* aThread, TDes8& aBuffer) const
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETDEVICEQUALIFIERDESCRIPTORTC, 
-	        "TUsbcDescriptorPool::GetDeviceQualifierDescriptorTC()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetDeviceQualifierDescriptorTC()"));
 	if (iDescriptors[KDescPosition_DeviceQualifier] == NULL)
 		{
-	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETDEVICEQUALIFIERDESCRIPTORTC_DUP1, 
-	            "  Warning: Device_Qualifier descriptor not supported" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Device_Qualifier descriptor not supported"));
 		return KErrNotSupported;
 		}
 	return Kern::ThreadDesWrite(aThread, &aBuffer,
@@ -1469,12 +1345,10 @@
 
 TInt TUsbcDescriptorPool::SetDeviceQualifierDescriptorTC(DThread* aThread, const TDes8& aBuffer)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_SETDEVICEQUALIFIERDESCRIPTORTC,
-	        "TUsbcDescriptorPool::SetDeviceQualifierDescriptorTC()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::SetDeviceQualifierDescriptorTC()"));
 	if (iDescriptors[KDescPosition_DeviceQualifier] == NULL)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETDEVICEQUALIFIERDESCRIPTORTC_DUP1,
-                "  Warning: Device_Qualifier descriptor not supported" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Device_Qualifier descriptor not supported"));
 		return KErrNotSupported;
 		}
 	TBuf8<KUsbDescSize_DeviceQualifier> device;
@@ -1494,12 +1368,10 @@
 
 TInt TUsbcDescriptorPool::GetOtherSpeedConfigurationDescriptorTC(DThread* aThread, TDes8& aBuffer) const
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETOTHERSPEEDCONFIGURATIONDESCRIPTORTC, 
-	        "TUsbcDescriptorPool::GetOtherSpeedConfigurationDescriptorTC()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetOtherSpeedConfigurationDescriptorTC()"));
 	if (iDescriptors[KDescPosition_OtherSpeedConfig] == NULL)
 		{
-	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETOTHERSPEEDCONFIGURATIONDESCRIPTORTC_DUP1, 
-	            "  Warning: Other_Speed_Configuration descriptor not supported" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Other_Speed_Configuration descriptor not supported"));
 		return KErrNotSupported;
 		}
 	return Kern::ThreadDesWrite(aThread, &aBuffer,
@@ -1509,12 +1381,10 @@
 
 TInt TUsbcDescriptorPool::SetOtherSpeedConfigurationDescriptorTC(DThread* aThread, const TDes8& aBuffer)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_SETOTHERSPEEDCONFIGURATIONDESCRIPTORTC, 
-	        "TUsbcDescriptorPool::SetOtherSpeedConfigurationDescriptorTC()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::SetOtherSpeedConfigurationDescriptorTC()"));
 	if (iDescriptors[KDescPosition_OtherSpeedConfig] == NULL)
 		{
-	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETOTHERSPEEDCONFIGURATIONDESCRIPTORTC_DUP1, 
-	            "  Warning: Other_Speed_Configuration descriptor not supported" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Other_Speed_Configuration descriptor not supported"));
 		return KErrNotSupported;
 		}
 	TBuf8<KUsbDescSize_OtherSpeedConfig> config;
@@ -1536,8 +1406,7 @@
 	TInt i = FindIfcDescriptor(aInterface, aSetting);
 	if (i < 0)
 		{
-		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETCSINTERFACEDESCRIPTORTC,
-		        "  Error: no such interface" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such interface"));
 		return KErrNotFound;
 		}
 	TInt r = KErrNotFound;
@@ -1562,8 +1431,7 @@
 	TInt i = FindIfcDescriptor(aInterface, aSetting);
 	if (i < 0)
 		{
-		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETCSINTERFACEDESCRIPTORTC, 
-		        "  Error: no such interface" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such interface"));
 		return KErrNotFound;
 		}
 	// Find a position where to insert the new class specific interface descriptor(s)
@@ -1576,8 +1444,7 @@
 		{
 		return KErrNoMemory;
 		}
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_SETCSINTERFACEDESCRIPTORTC_DUP1,
-            "  inserting descriptor at position %d", i );
+	__KTRACE_OPT(KUSB, Kern::Printf("  inserting descriptor at position %d", i));
 	iDescriptors.Insert(desc, i);
 
 	// Update the config descriptor's wTotalLength field
@@ -1594,8 +1461,7 @@
 	TInt i = FindIfcDescriptor(aInterface, aSetting);
 	if (i < 0)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETCSINTERFACEDESCRIPTORSIZE, 
-                "  Error: no such interface" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such interface"));
 		return KErrNotFound;
 		}
 	TInt r = KErrNotFound;
@@ -1619,8 +1485,7 @@
 	TInt i = FindEpDescriptor(aInterface, aSetting, aEndpointAddress);
 	if (i < 0)
 		{
-		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETCSENDPOINTDESCRIPTORTC,
-		        "  Error: no such endpoint" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such endpoint"));
 		return KErrNotFound;
 		}
 	TInt r = KErrNotFound;
@@ -1645,8 +1510,7 @@
 	TInt i = FindEpDescriptor(aInterface, aSetting, aEndpointAddress);
 	if (i < 0)
 		{
-		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETCSENDPOINTDESCRIPTORTC,
-		        "  Error: no such endpoint" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such endpoint"));
 		return KErrNotFound;
 		}
 	// find a position where to insert the new class specific endpoint descriptor(s)
@@ -1674,8 +1538,7 @@
 	TInt i = FindEpDescriptor(aInterface, aSetting, aEndpointAddress);
 	if (i < 0)
 		{
-		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETCSENDPOINTDESCRIPTORSIZE, 
-		        "  Error: no such endpoint" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such endpoint"));
 		return KErrNotFound;
 		}
 	TInt r = KErrNotFound;
@@ -1773,16 +1636,14 @@
 	if (str_idx)
 		{
 		__ASSERT_ALWAYS((str_idx == KStringPosition_Config), Kern::Fault(KUsbPanicCat, __LINE__));
-		OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETCONFIGURATIONSTRINGDESCRIPTORTC, 
-		        "  String @ pos %d (conf $): \"%s\"", str_idx, iStrings[str_idx]->StringData() );
+		__KTRACE_OPT(KUSB, Kern::Printf("  String @ pos %d (conf $): \"%S\"",
+										str_idx, &iStrings[str_idx]->StringData()));
 		return Kern::ThreadDesWrite(aThread, &aString,
 									iStrings[str_idx]->StringData(), 0);
 		}
 	else
 		{
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETCONFIGURATIONSTRINGDESCRIPTORTC_DUP1,
-                "  No config string descriptor @ pos %d", str_idx );
-
+		__KTRACE_OPT(KUSB, Kern::Printf("  No config string descriptor @ pos %d", str_idx));
 		return KErrNotFound;
 		}
 	}
@@ -1794,15 +1655,13 @@
 	TUint strlen = Kern::ThreadGetDesLength(aThread, &aString);
 	if (strlen > KUsbStringDescStringMaxSize)
 		{
-		OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETCONFIGURATIONSTRINGDESCRIPTORTC,
-		        "  Warning: config $ descriptor too long - will be truncated" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: config $ descriptor too long - will be truncated"));
 		strlen = KUsbStringDescStringMaxSize;
 		}
 	HBuf8* const strbuf = HBuf8::New(strlen);
 	if (!strbuf)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETCONFIGURATIONSTRINGDESCRIPTORTC_DUP1,
-                "  Error: Memory allocation for config $ desc string failed (1)" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Memory allocation for config $ desc string failed (1)"));
 		return KErrNoMemory;
 		}
 	strbuf->SetMax();
@@ -1810,16 +1669,14 @@
 	const TInt r = Kern::ThreadDesRead(aThread, &aString, *strbuf, 0);
 	if (r != KErrNone)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETCONFIGURATIONSTRINGDESCRIPTORTC_DUP2,
-                "  Error: Thread read error" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Thread read error"));
 		delete strbuf;
 		return r;
 		}
 	TUsbcStringDescriptor* sd = TUsbcStringDescriptor::New(*strbuf);
 	if (!sd)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETCONFIGURATIONSTRINGDESCRIPTORTC_DUP3,
-                "  Error: Memory allocation for config $ desc failed (2)" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Memory allocation for config $ desc failed (2)"));
 		delete strbuf;
 		return KErrNoMemory;
 		}
@@ -1840,8 +1697,8 @@
 	{
 	if (iDescriptors[KDescPosition_Config]->Byte(KUsbDescStringIndex_Config) == 0)
 		{
-		OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_REMOVECONFIGURATIONSTRINGDESCRIPTOR,
-		        "  RemoveConfigurationStringDescriptor: no $ desc @ index %d", KUsbDescStringIndex_Config );
+		__KTRACE_OPT(KUSB, Kern::Printf("  RemoveConfigurationStringDescriptor: no $ desc @ index %d",
+										KUsbDescStringIndex_Config));
 		return KErrNotFound;
 		}
 	// Delete old string, put in NULL pointer
@@ -1857,35 +1714,31 @@
 
 TInt TUsbcDescriptorPool::GetStringDescriptorTC(DThread* aThread, TInt aIndex, TDes8& aString) const
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETSTRINGDESCRIPTORTC,
-	        "TUsbcDescriptorPool::GetStringDescriptorTC()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetStringDescriptorTC()"));
 	if (!StringDescriptorExists(aIndex))
 		{
 		return KErrNotFound;
 		}
-	OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETSTRINGDESCRIPTORTC_DUP1,
-	        "  String @ pos %d: \"%s\"", aIndex, iStrings[aIndex]->StringData() );
+	__KTRACE_OPT(KUSB, Kern::Printf("  String @ pos %d: \"%S\"",
+									aIndex, &iStrings[aIndex]->StringData()));
 	return Kern::ThreadDesWrite(aThread, &aString, iStrings[aIndex]->StringData(), 0);
 	}
 
 
 TInt TUsbcDescriptorPool::SetStringDescriptorTC(DThread* aThread, TInt aIndex, const TDes8& aString)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_SETSTRINGDESCRIPTORTC,
-	        "TUsbcDescriptorPool::SetStringDescriptorTC()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::SetStringDescriptorTC()"));
 	// we don't know the length of the string, so we have to allocate memory dynamically
 	TUint strlen = Kern::ThreadGetDesLength(aThread, &aString);
 	if (strlen > KUsbStringDescStringMaxSize)
 		{
-	   OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETSTRINGDESCRIPTORTC_DUP1,
-	           "  Warning: $ descriptor too long - will be truncated" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: $ descriptor too long - will be truncated"));
 		strlen = KUsbStringDescStringMaxSize;
 		}
 	HBuf8* strbuf = HBuf8::New(strlen);
 	if (!strbuf)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETSTRINGDESCRIPTORTC_DUP2,
-                "  Error: Mem alloc for $ desc string failed (1)" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Mem alloc for $ desc string failed (1)"));
 		return KErrNoMemory;
 		}
 	strbuf->SetMax();
@@ -1893,16 +1746,14 @@
 	const TInt r = Kern::ThreadDesRead(aThread, &aString, *strbuf, 0);
 	if (r != KErrNone)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETSTRINGDESCRIPTORTC_DUP3,
-                "  Error: Thread read error" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Thread read error"));
 		delete strbuf;
 		return r;
 		}
 	TUsbcStringDescriptor* const sd = TUsbcStringDescriptor::New(*strbuf);
 	if (!sd)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETSTRINGDESCRIPTORTC_DUP4,
-                "  Error: Mem alloc for $ desc failed (2)" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Mem alloc for $ desc failed (2)"));
 		delete strbuf;
 		return KErrNoMemory;
 		}
@@ -1925,14 +1776,13 @@
 
 TInt TUsbcDescriptorPool::RemoveStringDescriptor(TInt aIndex)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR, 
-	        "TUsbcDescriptorPool::RemoveStringDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::RemoveStringDescriptor()"));
 	if (!StringDescriptorExists(aIndex))
 		{
 		return KErrNotFound;
 		}
-   OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP1, 
-           "  Removing string @ pos %d: \"%s\"", aIndex, iStrings[aIndex]->StringData() );
+	__KTRACE_OPT(KUSB, Kern::Printf("  Removing string @ pos %d: \"%S\"",
+									aIndex, &iStrings[aIndex]->StringData()));
 	ExchangeStringDescriptor(aIndex, NULL);
 
 	// Make sure there's no $ after aIndex.
@@ -1941,33 +1791,28 @@
 		{
 		if (iStrings[i] != NULL)
 			{
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP2, 
-                    "  Found $ @ idx %d - not compressing", i );
+			__KTRACE_OPT(KUSB, Kern::Printf("  Found $ @ idx %d - not compressing", i));
 			return KErrNone;
 			}
 		}
 
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP3,
-            "  No $ found after idx %d - compressing array", aIndex );
+	__KTRACE_OPT(KUSB, Kern::Printf("  No $ found after idx %d - compressing array", aIndex));
 	// Move aIndex back just before the first !NULL element.
 	while (iStrings[--aIndex] == NULL)
 		;
 	// Let aIndex point to first NULL.
 	aIndex++;
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP4,
-            "  Starting at index %d", aIndex );
+	__KTRACE_OPT(KUSB, Kern::Printf("  Starting at index %d", aIndex));
 	// Now remove NULL pointers until (Count() == aIndex).
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP5,
-            "  iStrings.Count() before: %d", iStrings.Count() );
+	__KTRACE_OPT(KUSB, Kern::Printf("  iStrings.Count() before: %d", iStrings.Count()));
 	do
 		{
 		iStrings.Remove(aIndex);
-	    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP6,
-	            "  Removing $" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  Removing $"));
 		}
 	while (iStrings.Count() > aIndex);
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_REMOVESTRINGDESCRIPTOR_DUP7,
-            "  iStrings.Count() after: %d", iStrings.Count() );
+	__KTRACE_OPT(KUSB, Kern::Printf("  iStrings.Count() after: %d", iStrings.Count()));
+
 	// Regain some memory.
 	iStrings.Compress();
 
@@ -1984,8 +1829,7 @@
 //
 void TUsbcDescriptorPool::InsertIfcDesc(TUsbcDescriptorBase* aDesc)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_INSERTIFCDESC, 
-	        "TUsbcDescriptorPool::InsertIfcDesc()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::InsertIfcDesc()"));
 
 	const TInt count = iDescriptors.Count();
 	TBool ifc_exists = EFalse;								// set to 'true' if we're adding an alternate
@@ -1993,8 +1837,7 @@
 	TInt i = KDescPosition_FirstAvailable;
 	while (i < count)
 		{
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_INSERTIFCDESC_DUP1, 
-                "  already descriptors there (%d)...", count );
+		__KTRACE_OPT(KUSB, Kern::Printf("  already descriptors there (%d)...", count));
 		if (iDescriptors[i]->Type() == KUsbDescType_Interface)
 			{
 			if (iDescriptors[i]->Byte(2) > aDesc->Byte(2))
@@ -2013,8 +1856,8 @@
 					}
 				else if (iDescriptors[i]->Byte(3) == aDesc->Byte(3))
 					{
-                    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_INSERTIFCDESC_DUP2, 
-                            "  Error: first delete old desc (TUsbcDescriptorPool::InsertIfcDesc)" );
+					__KTRACE_OPT(KPANIC, Kern::Printf("  Error: first delete old desc "
+													  "(TUsbcDescriptorPool::InsertIfcDesc)"));
 					return;
 					}
 				}
@@ -2022,8 +1865,7 @@
 		++i;
 		}
 	// In any case: put the new descriptor at position i.
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_INSERTIFCDESC_DUP3,
-            "  inserting descriptor at position %d", i );
+	__KTRACE_OPT(KUSB, Kern::Printf("  inserting descriptor at position %d", i));
 	iDescriptors.Insert(aDesc, i);
 
 	// Update the config descriptor's wTotalLength field.
@@ -2044,12 +1886,11 @@
 //
 void TUsbcDescriptorPool::InsertEpDesc(TUsbcDescriptorBase* aDesc)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_INSERTEPDESC, 
-	        "TUsbcDescriptorPool::InsertEpDesc()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::InsertEpDesc()"));
 	if (iIfcIdx == 0)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_INSERTEPDESC_DUP1, 
-                "  Error: only after interface (TUsbcDescriptorPool::InsertEpDesc)" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: only after interface "
+										  "(TUsbcDescriptorPool::InsertEpDesc)"));
 		return;
 		}
 	const TInt count = iDescriptors.Count();
@@ -2072,8 +1913,8 @@
 //
 TInt TUsbcDescriptorPool::FindIfcDescriptor(TInt aIfcNumber, TInt aIfcSetting) const
 	{
-	OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_FINDIFCDESCRIPTOR,
-	        "TUsbcDescriptorPool::FindIfcDescriptor(%d, %d)", aIfcNumber, aIfcSetting );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::FindIfcDescriptor(%d, %d)",
+									aIfcNumber, aIfcSetting));
 	const TInt count = iDescriptors.Count();
 	for (TInt i = KDescPosition_FirstAvailable; i < count; i++)
 		{
@@ -2084,8 +1925,7 @@
 			return i;
 			}
 		}
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDIFCDESCRIPTOR_DUP1,
-	        "  Error: no such interface" );
+	__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such interface"));
 	return -1;
 	}
 
@@ -2095,14 +1935,13 @@
 //
 TInt TUsbcDescriptorPool::FindEpDescriptor(TInt aIfcNumber, TInt aIfcSetting, TUint8 aEpAddress) const
 	{
-	OstTraceDefExt3( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_FINDEPDESCRIPTOR,
-	        "TUsbcDescriptorPool::FindEpDescriptor(%d, %d, 0x%02x)", aIfcNumber, aIfcSetting, aEpAddress );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::FindEpDescriptor(%d, %d, 0x%02x)",
+									aIfcNumber, aIfcSetting, aEpAddress));
 	// first find the interface
 	const TInt ifc = FindIfcDescriptor(aIfcNumber, aIfcSetting);
 	if (ifc < 0)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDEPDESCRIPTOR_DUP1,
-                "  Error: no such interface" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such interface"));
 		return ifc;
 		}
 	const TInt count = iDescriptors.Count();
@@ -2111,8 +1950,7 @@
 		{
 		if (iDescriptors[i]->Type() == KUsbDescType_Interface)
 			{
-            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDEPDESCRIPTOR_DUP2,
-                    "  Error: no such endpoint before next interface" );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such endpoint before next interface"));
 			return -1;
 			}
 		else if ((iDescriptors[i]->Type() == KUsbDescType_Endpoint) &&
@@ -2122,8 +1960,7 @@
 			return i;
 			}
 		}
-    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_FINDEPDESCRIPTOR_DUP3,
-            "  Error: no such endpoint" );
+	__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no such endpoint"));
 	return -1;
 	}
 
@@ -2133,22 +1970,18 @@
 //
 void TUsbcDescriptorPool::DeleteDescriptors(TInt aIndex, TInt aCount)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS, 
-	        "TUsbcDescriptorPool::DeleteDescriptors()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::DeleteDescriptors()"));
 	if (aIndex < KDescPosition_FirstAvailable)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP1, 
-                "  Error: aIndex < KDescPosition_FirstAvailable" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: aIndex < KDescPosition_FirstAvailable"));
 		return;
 		}
 	if (aCount <= 0)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP2, 
-                "  Error: aCount <= 0" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: aCount <= 0"));
 		return;
 		}
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP3, 
-            "  Removing descriptors at index %d:", aIndex );
+	__KTRACE_OPT(KUSB, Kern::Printf("  Removing descriptors at index %d:", aIndex));
 	// Try to update wTotalLength field in Config descriptor
 	while (aCount--)
 		{
@@ -2158,27 +1991,22 @@
 		switch (ptr->Type())
 			{
 		case KUsbDescType_Interface:
-		    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP4,
-		            "  - an interface descriptor" );
+			__KTRACE_OPT(KUSB, Kern::Printf("  - an interface descriptor"));
 			UpdateConfigDescriptorLength(-KUsbDescSize_Interface);
 			break;
 		case KUsbDescType_Endpoint:
-			OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP5,
-			        "  - an endpoint descriptor" );
+			__KTRACE_OPT(KUSB, Kern::Printf("  - an endpoint descriptor"));
 			UpdateConfigDescriptorLength(-ptr->Size());
 			break;
 		case KUsbDescType_CS_Interface:
 			/* fall through */
 		case KUsbDescType_CS_Endpoint:
-		    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP6,
-		            "  - a class specific descriptor" );
+			__KTRACE_OPT(KUSB, Kern::Printf("  - a class specific descriptor"));
 			UpdateConfigDescriptorLength(-ptr->Size());
 			break;
 		default:
-		    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP7,
-		            "  - an unknown descriptor" );
-		    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_DELETEDESCRIPTORS_DUP8,
-		            "  Error: unknown descriptor type" );
+			__KTRACE_OPT(KUSB, Kern::Printf("  - an unknown descriptor"));
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: unknown descriptor type"));
 			}
 		iDescriptors.Remove(aIndex);
 		delete ptr;
@@ -2191,15 +2019,12 @@
 //
 void TUsbcDescriptorPool::UpdateConfigDescriptorLength(TInt aLength)
 	{
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORLENGTH,
-	        "TUsbcDescriptorPool::UpdateConfigDescriptorLength(%d)", aLength );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::UpdateConfigDescriptorLength(%d)", aLength));
 	TUsbcDescriptorBase* const cnf = iDescriptors[KDescPosition_Config];
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORLENGTH_DUP1,
-	        "  wTotalLength old: %d", cnf->Word(2) );
+	__KTRACE_OPT(KUSB, Kern::Printf("  wTotalLength old: %d", cnf->Word(2)));
 	// Update Config descriptor
 	cnf->SetWord(2, cnf->Word(2) + aLength);
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORLENGTH_DUP2,
-	        "  wTotalLength new: %d", cnf->Word(2) );
+	__KTRACE_OPT(KUSB, Kern::Printf("  wTotalLength new: %d", cnf->Word(2)));
 	// Update Other_Speed_Config descriptor as well, if applicable
 	if (iDescriptors[KDescPosition_OtherSpeedConfig])
 		iDescriptors[KDescPosition_OtherSpeedConfig]->SetWord(2, cnf->Word(2));
@@ -2211,22 +2036,18 @@
 //
 void TUsbcDescriptorPool::UpdateConfigDescriptorNumIfcs(TInt aNumber)
 	{
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORNUMIFCS,
-	        "TUsbcDescriptorPool::UpdateConfigDescriptorNumIfcs(%d)", aNumber );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::UpdateConfigDescriptorNumIfcs(%d)", aNumber));
 	TUsbcDescriptorBase* const cnf = iDescriptors[KDescPosition_Config];
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORNUMIFCS_DUP1,
-	        "  bNumInterfaces old: %d", cnf->Byte(4) );
+	__KTRACE_OPT(KUSB, Kern::Printf("  bNumInterfaces old: %d", cnf->Byte(4)));
 	const TInt n = cnf->Byte(4) + aNumber;
 	if (n < 0)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORNUMIFCS_DUP2,
-                "  Error: bNumInterfaces + aNumber < 0" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: bNumInterfaces + aNumber < 0"));
 		return;
 		}
 	// Update Config descriptor
 	cnf->SetByte(4, n);
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_UPDATECONFIGDESCRIPTORNUMIFCS_DUP3,
-            "  bNumInterfaces new: %d", cnf->Byte(4) );
+	__KTRACE_OPT(KUSB, Kern::Printf("  bNumInterfaces new: %d", cnf->Byte(4)));
 	// Update Other_Speed_Config descriptor as well, if applicable
 	if (iDescriptors[KDescPosition_OtherSpeedConfig])
 		iDescriptors[KDescPosition_OtherSpeedConfig]->SetByte(4, n);
@@ -2238,8 +2059,7 @@
 //
 void TUsbcDescriptorPool::UpdateIfcNumbers(TInt aNumber)
 	{
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_UPDATEIFCNUMBERS,
-	        "TUsbcDescriptorPool::UpdateIfcNumbers(%d)", aNumber );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::UpdateIfcNumbers(%d)", aNumber));
 	const TInt count = iDescriptors.Count();
 	for (TInt i = KDescPosition_FirstAvailable; i < count; i++)
 		{
@@ -2261,21 +2081,14 @@
 //
 TInt TUsbcDescriptorPool::GetDeviceDescriptor(TInt aIndex) const
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETDEVICEDESCRIPTOR, 
-	        "TUsbcDescriptorPool::GetDeviceDescriptor()" );
-#ifdef _DEBUG
-	if (!((aIndex == KDescPosition_Device) || (aIndex == KDescPosition_DeviceQualifier)))
-	    {
-        OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETDEVICEDESCRIPTOR_DUP1, 
-                "  Error: invalid descriptor index: %d", aIndex );
-	    }
-#endif
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetDeviceDescriptor()"));
+	__ASSERT_DEBUG((aIndex == KDescPosition_Device) || (aIndex == KDescPosition_DeviceQualifier),
+				   Kern::Printf("  Error: invalid descriptor index: %d", aIndex));
 	if (iDescriptors[aIndex] == NULL)
 		{
 		// This doesn't have to be an error - we might get asked here for the Device_Qualifier descriptor
 		// on a FS-only device.
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETDEVICEDESCRIPTOR_DUP2, 
-                "  Descriptor #%d requested but not available", aIndex );
+		__KTRACE_OPT(KUSB, Kern::Printf("  Descriptor #%d requested but not available", aIndex));
 		return 0;
 		}
 	return iDescriptors[aIndex]->GetDescriptorData(iEp0_TxBuf, KUsbcBufSz_Ep0Tx);
@@ -2289,21 +2102,14 @@
 //
 TInt TUsbcDescriptorPool::GetConfigurationDescriptor(TInt aIndex) const
 	{
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR,
-	        "TUsbcDescriptorPool::GetConfigDescriptor(%d)", aIndex );
-#ifdef _DEBUG
-	if (!((aIndex == KDescPosition_Config) || (aIndex == KDescPosition_OtherSpeedConfig)))
-	    {
-        OstTraceDef1( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP1,
-                "  Error: invalid descriptor index: %d", aIndex );
-	    }
-#endif
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetConfigDescriptor(%d)", aIndex));
+	__ASSERT_DEBUG((aIndex == KDescPosition_Config) || (aIndex == KDescPosition_OtherSpeedConfig),
+				   Kern::Printf("  Error: invalid descriptor index: %d", aIndex));
 	if (iDescriptors[aIndex] == NULL)
 		{
 		// This is always an error: We should always have a Configuration descriptor and we should never
 		// get asked for the Other_Speed_Configuration descriptor if we don't have one (9.6.2).
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP2,
-                "  Warning: Descriptor %d requested but not available", aIndex );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Descriptor %d requested but not available", aIndex));
 		return 0;
 		}
 		
@@ -2332,8 +2138,7 @@
 				if (iDescriptors[KDescPosition_Otg] == NULL)
 					{
 					// Skip since there is no otg descriptor
-                    OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP3,
-                            "  no otg descriptor" );
+					__KTRACE_OPT(KUSB, Kern::Printf("  no otg descriptor"));
 					continue;				
 					}
 				else
@@ -2363,29 +2168,28 @@
 				}
 			}
 
-        OstTraceDefExt3( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP4,
-                "  desc[%02d]: type = 0x%02x size = %d ", pos, ptr->Type(), ptr->Size() );			
+		__KTRACE_OPT(KUSB, Kern::Printf("  desc[%02d]: type = 0x%02x size = %d ",
+										pos, ptr->Type(), ptr->Size()));				
 		const TInt size = ptr->GetDescriptorData(buf, KUsbcBufSz_Ep0Tx - copied);
 		if (size == 0)
 			{
 			
-            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP5,
-                    "  Error: No Tx buffer space to copy this descriptor -> exiting" );
+			__KTRACE_OPT(KPANIC,
+						 Kern::Printf("  Error: No Tx buffer space to copy this descriptor -> exiting"));
 			break;
 			}
 		copied += size;
 		if (copied >= KUsbcBufSz_Ep0Tx)
 			{
-            OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP6,
-                    "  Error: No Tx buffer space left -> stopping here" );
+			__KTRACE_OPT(KPANIC,
+						 Kern::Printf("  Error: No Tx buffer space left -> stopping here"));
 			break;
 			}
 		buf += size;
 		}
 		
 		
-    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETCONFIGURATIONDESCRIPTOR_DUP7,
-            "  copied %d bytes", copied );
+	__KTRACE_OPT(KUSB, Kern::Printf("  copied %d bytes", copied));
 	return copied;
 	}
 
@@ -2396,12 +2200,10 @@
 //
 TInt TUsbcDescriptorPool::GetOtgDescriptor() const
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETOTGDESCRIPTOR,
-	        "TUsbcDescriptorPool::GetOtgDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetOtgDescriptor()"));
 	if (iDescriptors[KDescPosition_Otg] == NULL)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETOTGDESCRIPTOR_DUP1,
-                "  OTG Descriptor not set" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  OTG Descriptor not set"));
 		return 0;
 		}
 	return iDescriptors[KDescPosition_Otg]->GetDescriptorData(iEp0_TxBuf, KUsbcBufSz_Ep0Tx);
@@ -2414,8 +2216,7 @@
 //
 TInt TUsbcDescriptorPool::GetStringDescriptor(TInt aIndex) const
 	{
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETSTRINGDESCRIPTOR,
-	        "TUsbcDescriptorPool::GetStringDescriptor(%d)", aIndex );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetStringDescriptor(%d)", aIndex));
 	// I really would have liked to display the descriptor contents here, but without trailing zero
 	// we got a problem: how can we tell printf where the string ends? We would have to
 	// dynamically allocate memory (since we don't know the size in advance), copy the descriptor
@@ -2435,21 +2236,19 @@
 TInt TUsbcDescriptorPool::GetDeviceStringDescriptorTC(DThread* aThread, TDes8& aString,
 													  TInt aIndex, TInt aPosition) const
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_GETDEVICESTRINGDESCRIPTORTC, 
-	        "TUsbcDescriptorPool::GetDeviceStringDescriptorTC()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::GetDeviceStringDescriptorTC()"));
 	const TInt str_idx = iDescriptors[KDescPosition_Device]->Byte(aIndex);
 	if (str_idx)
 		{
 		__ASSERT_ALWAYS((str_idx == aPosition), Kern::Fault(KUsbPanicCat, __LINE__));
-        OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETDEVICESTRINGDESCRIPTORTC_DUP1, 
-                "  String @ pos %d (device $): \"%s\"", str_idx, iStrings[str_idx]->StringData() );
+		__KTRACE_OPT(KUSB, Kern::Printf("  String @ pos %d (device $): \"%S\"",
+										str_idx, &iStrings[str_idx]->StringData()));
 		return Kern::ThreadDesWrite(aThread, &aString,
 									iStrings[str_idx]->StringData(), 0);
 		}
 	else
 		{
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_GETDEVICESTRINGDESCRIPTORTC_DUP2, 
-                "  No string descriptor @ pos %d", aIndex );
+		__KTRACE_OPT(KUSB, Kern::Printf("  No string descriptor @ pos %d", aIndex));
 		return KErrNotFound;
 		}
 	}
@@ -2462,21 +2261,18 @@
 TInt TUsbcDescriptorPool::SetDeviceStringDescriptorTC(DThread* aThread, const TDes8& aString,
 													  TInt aIndex, TInt aPosition)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_SETDEVICESTRINGDESCRIPTORTC,
-	        "TUsbcDescriptorPool::SetDeviceStringDescriptorTC()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::SetDeviceStringDescriptorTC()"));
 	// we don't know the length of the string, so we have to allocate memory dynamically
 	TUint strlen = Kern::ThreadGetDesLength(aThread, &aString);
 	if (strlen > KUsbStringDescStringMaxSize)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETDEVICESTRINGDESCRIPTORTC_DUP1,
-                "  Warning: $ descriptor too long - will be truncated" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: $ descriptor too long - will be truncated"));
 		strlen = KUsbStringDescStringMaxSize;
 		}
 	HBuf8* const strbuf = HBuf8::New(strlen);
 	if (!strbuf)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETDEVICESTRINGDESCRIPTORTC_DUP2,
-                "  Error: Memory allocation for dev $ desc string failed (1)" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Memory allocation for dev $ desc string failed (1)"));
 		return KErrNoMemory;
 		}
 	strbuf->SetMax();
@@ -2484,16 +2280,14 @@
 	const TInt r = Kern::ThreadDesRead(aThread, &aString, *strbuf, 0);
 	if (r != KErrNone)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETDEVICESTRINGDESCRIPTORTC_DUP3,
-                "  Error: Thread read error" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Thread read error"));
 		delete strbuf;
 		return r;
 		}
 	TUsbcStringDescriptor* const sd = TUsbcStringDescriptor::New(*strbuf);
 	if (!sd)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_SETDEVICESTRINGDESCRIPTORTC_DUP4,
-                "  Error: Memory allocation for dev $ desc failed (2)" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Memory allocation for dev $ desc failed (2)"));
 		delete strbuf;
 		return KErrNoMemory;
 		}
@@ -2510,12 +2304,10 @@
 //
 TInt TUsbcDescriptorPool::RemoveDeviceStringDescriptor(TInt aIndex, TInt aPosition)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_REMOVEDEVICESTRINGDESCRIPTOR, 
-	        "TUsbcDescriptorPool::RemoveDeviceStringDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::RemoveDeviceStringDescriptor()"));
 	if (iDescriptors[KDescPosition_Device]->Byte(aIndex) == 0)
 		{
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_REMOVEDEVICESTRINGDESCRIPTOR_DUP1, 
-                "  RemoveDeviceStringDescriptor: no $ desc @ index %d", aIndex );
+		__KTRACE_OPT(KUSB, Kern::Printf("  RemoveDeviceStringDescriptor: no $ desc @ index %d", aIndex));
 		return KErrNotFound;
 		}
 	ExchangeStringDescriptor(aPosition, NULL);
@@ -2529,15 +2321,12 @@
 //
 void TUsbcDescriptorPool::ExchangeStringDescriptor(TInt aIndex, const TUsbcStringDescriptor* aDesc)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_EXCHANGESTRINGDESCRIPTOR,
-	        "TUsbcDescriptorPool::ExchangeStringDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::ExchangeStringDescriptor()"));
 	TUsbcStringDescriptorBase* const ptr = iStrings[aIndex];
-    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_EXCHANGESTRINGDESCRIPTOR_DUP1,
-            "  Deleting string descriptor at index %d: 0x%x", aIndex, reinterpret_cast<TUint>(ptr) );
+	__KTRACE_OPT(KUSB, Kern::Printf("  Deleting string descriptor at index %d: 0x%x", aIndex, ptr));
 	iStrings.Remove(aIndex);
 	delete ptr;
-    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_EXCHANGESTRINGDESCRIPTOR_DUP2,
-            "  Inserting string descriptor at index %d: 0x%x", aIndex, reinterpret_cast<TUint>(aDesc) );
+	__KTRACE_OPT(KUSB, Kern::Printf("  Inserting string descriptor at index %d: 0x%x", aIndex, aDesc));
 	iStrings.Insert(aDesc, aIndex);
 	}
 
@@ -2562,18 +2351,15 @@
 //
 TBool TUsbcDescriptorPool::StringDescriptorExists(TInt aIndex) const
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_STRINGDESCRIPTOREXISTS, 
-	        "TUsbcDescriptorPool::StringDescriptorExists" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::StringDescriptorExists()"));
 	if (aIndex >= iStrings.Count())
 		{
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_STRINGDESCRIPTOREXISTS_DUP1, 
-                "  Error: Bad string index: %d", aIndex );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Bad string index: %d", aIndex));
 		return EFalse;
 		}
 	else if (iStrings[aIndex] == NULL)
 		{
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCDESCRIPTORPOOL_STRINGDESCRIPTOREXISTS_DUP2,
-                "  Error: No $ descriptor @ pos %d", aIndex );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: No $ descriptor @ pos %d", aIndex));
 		return EFalse;
 		}
 	return ETrue;
@@ -2585,16 +2371,14 @@
 //
 TInt TUsbcDescriptorPool::FindAvailableStringPos() const
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCDESCRIPTORPOOL_FINDAVAILABLESTRINGPOS,
-	        "TUsbcDescriptorPool::FindAvailableStringPos()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcDescriptorPool::FindAvailableStringPos()"));
 	const TInt n = iStrings.Count();
 	// We don't start from 0 because the first few locations are 'reserved'.
 	for (TInt i = KStringPosition_FirstAvailable; i < n; i++)
 		{
 		if (iStrings[i] == NULL)
 			{
-            OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCDESCRIPTORPOOL_FINDAVAILABLESTRINGPOS_DUP1,
-                    " Found available NULL position: %d", i );
+			__KTRACE_OPT(KUSB, Kern::Printf(" Found available NULL position: %d", i));
 			return i;
 			}
 		}
--- a/kernel/eka/drivers/usbcc/misc.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/usbcc/misc.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -23,11 +23,6 @@
 */
 
 #include <drivers/usbc.h>
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "miscTraces.h"
-#endif
-
 
 
 /** Helper function for logical endpoints and endpoint descriptors:
@@ -102,8 +97,8 @@
 			{
 			if (aEpSize_Hs < 513)
 				{
-				OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCENDPOINTINFO_ADJUSTEPSIZES,
-				        "  Warning: Ep size too small: %d < 513. Correcting...", aEpSize_Hs );
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Ep size too small: %d < 513. Correcting...",
+												  aEpSize_Hs));
 				aEpSize_Hs = 513;
 				}
 			}
@@ -111,8 +106,8 @@
 			{
 			if (aEpSize_Hs < 683)
 				{
-                OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCENDPOINTINFO_ADJUSTEPSIZES_DUP1,
-                        "  Warning: Ep size too small: %d < 683. Correcting...", aEpSize_Hs );
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Ep size too small: %d < 683. Correcting...",
+												  aEpSize_Hs));
 				aEpSize_Hs = 683;
 				}
 			}
@@ -199,15 +194,13 @@
 TUsbcPhysicalEndpoint::TUsbcPhysicalEndpoint()
 	: iEndpointAddr(0), iIfcNumber(NULL), iLEndpoint(NULL), iSettingReserve(EFalse), iHalt(EFalse)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCPHYSICALENDPOINT_TUSBCPHYSICALENDPOINT_CONS,
-	        "TUsbcPhysicalEndpoint::TUsbcPhysicalEndpoint()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcPhysicalEndpoint::TUsbcPhysicalEndpoint"));
 	}
 
 
 TInt TUsbcPhysicalEndpoint::TypeAvailable(TUint aType) const
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCPHYSICALENDPOINT_TYPEAVAILABLE, 
-	        "TUsbcPhysicalEndpoint::TypeAvailable" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcPhysicalEndpoint::TypeAvailable"));
 	switch (aType)
 		{
 	case KUsbEpTypeControl:
@@ -219,8 +212,7 @@
 	case KUsbEpTypeInterrupt:
 		return (iCaps.iTypesAndDir & KUsbEpTypeInterrupt);
 	default:
-	    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCPHYSICALENDPOINT_TYPEAVAILABLE_DUP1, 
-	            "  Error: invalid EP type: %d", aType );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: invalid EP type: %d", aType));
 		return 0;
 		}
 	}
@@ -228,8 +220,7 @@
 
 TInt TUsbcPhysicalEndpoint::DirAvailable(TUint aDir) const
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCPHYSICALENDPOINT_DIRAVAILABLE, 
-	        "TUsbcPhysicalEndpoint::DirAvailable" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcPhysicalEndpoint::DirAvailable"));
 	switch (aDir)
 		{
 	case KUsbEpDirIn:
@@ -237,8 +228,7 @@
 	case KUsbEpDirOut:
 		return (iCaps.iTypesAndDir & KUsbEpDirOut);
 	default:
-	    OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCPHYSICALENDPOINT_DIRAVAILABLE_DUP1, 
-	            "  Error: invalid EP direction: %d", aDir );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: invalid EP direction: %d", aDir));
 		return 0;
 		}
 	}
@@ -246,15 +236,12 @@
 
 TInt TUsbcPhysicalEndpoint::EndpointSuitable(const TUsbcEndpointInfo* aEpInfo, TInt aIfcNumber) const
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE,
-	        "TUsbcPhysicalEndpoint::EndpointSuitable" );
-	OstTraceDefExt4( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP1,
-	        "  looking for EP: type=0x%x dir=0x%x size=%d (ifc_num=%d)",
-	        aEpInfo->iType, aEpInfo->iDir, aEpInfo->iSize, aIfcNumber );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcPhysicalEndpoint::EndpointSuitable"));
+	__KTRACE_OPT(KUSB, Kern::Printf("  looking for EP: type=0x%x dir=0x%x size=%d (ifc_num=%d)",
+									aEpInfo->iType, aEpInfo->iDir, aEpInfo->iSize, aIfcNumber));
 	if (iSettingReserve)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP2,
-                "  -> setting conflict" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  -> setting conflict"));
 		return 0;
 		}
 	// (aIfcNumber == -1) means the ep is for a new default interface setting
@@ -267,26 +254,22 @@
 		// to different alternate settings of the *same* interface, and
 		// because we check for available endpoints for every alternate setting
 		// as a whole.
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP3,
-                "  -> ifc conflict" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  -> ifc conflict"));
 		return 0;
 		}
 	else if (!TypeAvailable(aEpInfo->iType))
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP4,
-                "  -> type conflict" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  -> type conflict"));
 		return 0;
 		}
 	else if (!DirAvailable(aEpInfo->iDir))
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP5,
-                "  -> direction conflict" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  -> direction conflict"));
 		return 0;
 		}
 	else if (!(iCaps.iSizes & PacketSize2Mask(aEpInfo->iSize)) && !(iCaps.iSizes & KUsbEpSizeCont))
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCPHYSICALENDPOINT_ENDPOINTSUITABLE_DUP6,
-                "  -> size conflict" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  -> size conflict"));
 		return 0;
 		}
 	else
@@ -296,8 +279,7 @@
 
 TUsbcPhysicalEndpoint::~TUsbcPhysicalEndpoint()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCPHYSICALENDPOINT_TUSBCPHYSICALENDPOINT_DES,
-	        "TUsbcPhysicalEndpoint::~TUsbcPhysicalEndpoint()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcPhysicalEndpoint::~TUsbcPhysicalEndpoint()"));
 	iLEndpoint = NULL;
 	}
 
@@ -308,37 +290,34 @@
 	: iController(aController), iLEndpointNum(aEndpointNum), iInfo(aEpInfo), iInterface(aInterface),
 	  iPEndpoint(aPEndpoint)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS, 
-	        "TUsbcLogicalEndpoint::TUsbcLogicalEndpoint()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcLogicalEndpoint::TUsbcLogicalEndpoint()"));
 	//  Adjust FS/HS endpoint sizes
 	if (iInfo.AdjustEpSizes(iEpSize_Fs, iEpSize_Hs) != KErrNone)
 		{
-        OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP1, 
-                "  Error: Unknown endpoint type: %d", iInfo.iType );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Unknown endpoint type: %d", iInfo.iType));
 		}
-	OstTraceDefExt3( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP2, 
-	        "  Now set: iEpSize_Fs=%d iEpSize_Hs=%d (iInfo.iSize=%d)", iEpSize_Fs, iEpSize_Hs, iInfo.iSize );
+	__KTRACE_OPT(KUSB, Kern::Printf("  Now set: iEpSize_Fs=%d iEpSize_Hs=%d (iInfo.iSize=%d)",
+									iEpSize_Fs, iEpSize_Hs, iInfo.iSize));
 	//  Adjust HS polling interval
 	if (iInfo.AdjustPollInterval() != KErrNone)
 		{
-        OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP3, 
-                "  Error: Unknown ep type (%d) or invalid interval value (%d)", iInfo.iType, iInfo.iInterval );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Unknown ep type (%d) or invalid interval value (%d)",
+										  iInfo.iType, iInfo.iInterval));
 		}
-	OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP4, 
-	        "  Now set: iInfo.iInterval=%d iInfo.iInterval_Hs=%d", iInfo.iInterval, iInfo.iInterval_Hs );
+	__KTRACE_OPT(KUSB, Kern::Printf("  Now set: iInfo.iInterval=%d iInfo.iInterval_Hs=%d",
+									iInfo.iInterval, iInfo.iInterval_Hs));
 	// Additional transactions requested on a non High Bandwidth ep?
 	if ((iInfo.iTransactions > 0) && !aPEndpoint->iCaps.iHighBandwidth)
 		{
-        OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_CONS_DUP5, 
-                "  Warning: Additional transactions requested but not a High Bandwidth ep" );
+		__KTRACE_OPT(KPANIC,
+					 Kern::Printf("  Warning: Additional transactions requested but not a High Bandwidth ep"));
 		}
 	}
 
 
 TUsbcLogicalEndpoint::~TUsbcLogicalEndpoint()
 	{
-	OstTraceDef1( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_DES, 
-	        "TUsbcLogicalEndpoint::~TUsbcLogicalEndpoint: #%d", iLEndpointNum );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcLogicalEndpoint::~TUsbcLogicalEndpoint: #%d", iLEndpointNum));
 	// If the real endpoint this endpoint points to is also used by
 	// any other logical endpoint in any other setting of this interface
 	// then we leave the real endpoint marked as used. Otherwise we mark
@@ -353,20 +332,17 @@
 			const TUsbcLogicalEndpoint* const ep = ifc->iEndpoints[j];
 			if ((ep->iPEndpoint == iPEndpoint) && (ep != this))
 				{
-                OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_DES_DUP1, 
-                        "  Physical endpoint still in use -> we leave it as is" );
+				__KTRACE_OPT(KUSB, Kern::Printf("  Physical endpoint still in use -> we leave it as is"));
 				return;
 				}
 			}
 		}
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_DES_DUP2, 
-	        "  Closing DMA channel" );
+	__KTRACE_OPT(KUSB, Kern::Printf("  Closing DMA channel"));
 	const TInt idx = iController->EpAddr2Idx(iPEndpoint->iEndpointAddr);
 	// If the endpoint doesn't support DMA (now or ever) the next operation will be a no-op.
 	iController->CloseDmaChannel(idx);
-    OstTraceDefExt2( OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCLOGICALENDPOINT_TUSBCLOGICALENDPOINT_DES_DUP3, 
-            "  Setting physical ep 0x%02x ifc number to NULL (was %d)",
-            iPEndpoint->iEndpointAddr, *iPEndpoint->iIfcNumber );
+	__KTRACE_OPT(KUSB, Kern::Printf("  Setting physical ep 0x%02x ifc number to NULL (was %d)",
+									iPEndpoint->iEndpointAddr, *iPEndpoint->iIfcNumber));
 	iPEndpoint->iIfcNumber = NULL;
 	}
 
@@ -374,15 +350,13 @@
 TUsbcInterface::TUsbcInterface(TUsbcInterfaceSet* aIfcSet, TUint8 aSetting, TBool aNoEp0Requests)
 	: iEndpoints(2), iInterfaceSet(aIfcSet), iSettingCode(aSetting), iNoEp0Requests(aNoEp0Requests)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCINTERFACE_TUSBCINTERFACE_CONS,
-	        "TUsbcInterface::TUsbcInterface()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcInterface::TUsbcInterface()"));
 	}
 
 
 TUsbcInterface::~TUsbcInterface()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCINTERFACE_TUSBCINTERFACE_DES,
-	        "TUsbcInterface::~TUsbcInterface()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcInterface::~TUsbcInterface()"));
 	iEndpoints.ResetAndDestroy();
 	}
 
@@ -390,15 +364,13 @@
 TUsbcInterfaceSet::TUsbcInterfaceSet(const DBase* aClientId, TUint8 aIfcNum)
 	: iInterfaces(2), iClientId(aClientId), iInterfaceNumber(aIfcNum), iCurrentInterface(0)
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCINTERFACESET_TUSBCINTERFACESET_CONS, 
-	        "TUsbcInterfaceSet::TUsbcInterfaceSet()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcInterfaceSet::TUsbcInterfaceSet()"));
 	}
 
 
 TUsbcInterfaceSet::~TUsbcInterfaceSet()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCINTERFACESET_TUSBCINTERFACESET_DES,
-	        "TUsbcInterfaceSet::~TUsbcInterfaceSet()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcInterfaceSet::~TUsbcInterfaceSet()"));
 	iInterfaces.ResetAndDestroy();
 	}
 
@@ -406,15 +378,13 @@
 TUsbcConfiguration::TUsbcConfiguration(TUint8 aConfigVal)
 	: iInterfaceSets(1), iConfigValue(aConfigVal)			// iInterfaceSets(1): granularity
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCCONFIGURATION_TUSBCCONFIGURATION_CONS, 
-	        "TUsbcConfiguration::TUsbcConfiguration()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcConfiguration::TUsbcConfiguration()"));
 	}
 
 
 TUsbcConfiguration::~TUsbcConfiguration()
 	{
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCCONFIGURATION_TUSBCCONFIGURATION_DES, 
-	        "TUsbcConfiguration::~TUsbcConfiguration()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcConfiguration::~TUsbcConfiguration()"));
 	iInterfaceSets.ResetAndDestroy();
 	}
 
--- a/kernel/eka/drivers/usbcc/ps_usbc.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/usbcc/ps_usbc.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -23,11 +23,6 @@
 */
 
 #include <drivers/usbc.h>
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "ps_usbcTraces.h"
-#endif
-
 
 
 /**
@@ -123,8 +118,7 @@
 */
 DUsbClientController::~DUsbClientController()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DUSBCLIENTCONTROLLER_DES, "DUsbClientController::~DUsbClientController()" );
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::~DUsbClientController()"));
 	if (iPowerHandler)
 		{
 		iPowerHandler->Remove();
@@ -133,7 +127,7 @@
 	// ResetAndDestroy() will call for every array element the destructor of the pointed-to object,
 	// before deleting the element itself, and closing the array.
 	iConfigs.ResetAndDestroy();
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DUSBCLIENTCONTROLLER_DES_DUP1, "DUsbClientController::~DUsbClientController(): Done." );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::~DUsbClientController(): Done."));
 	}
 
 
@@ -153,17 +147,17 @@
 */
 EXPORT_C void DUsbClientController::DisableClientStack()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DISABLECLIENTSTACK, "DUsbClientController::DisableClientStack()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DisableClientStack()"));
 	if (!iStackIsActive)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DISABLECLIENTSTACK_DUP1, "  Already disabled - returning" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  Already disabled - returning"));
 		return;
 		}
 	iOtgClientConnect = EFalse;
 	TInt r = EvaluateOtgConnectFlags();					 // will disconnect UDC
 	if (r != KErrNone)
 		{
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_DISABLECLIENTSTACK_DUP2, "  Error: EvaluateOtgConnectFlags() failed: %d", r );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: EvaluateOtgConnectFlags() failed: %d", r));
 		}
 
 	// Reset OTG features, leave attributes as is (just as in USB Reset case)
@@ -211,10 +205,10 @@
 */
 EXPORT_C void DUsbClientController::EnableClientStack()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_ENABLECLIENTSTACK, "DUsbClientController::EnableClientStack()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::EnableClientStack()"));
 	if (iStackIsActive)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENABLECLIENTSTACK_DUP1, "  Already enabled - returning" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  Already enabled - returning"));
 		return;
 		}
 	iStackIsActive = ETrue;
@@ -222,13 +216,13 @@
 	TInt r = ActivateHardwareController();
 	if (r != KErrNone)
 		{
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_ENABLECLIENTSTACK_DUP2, "  Error: ActivateHardwareController() failed: %d", r);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: ActivateHardwareController() failed: %d", r));
 		}
 	iOtgClientConnect = ETrue;
 	r = EvaluateOtgConnectFlags();							// may connect UDC
 	if (r != KErrNone)
 		{
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_ENABLECLIENTSTACK_DUP3, "  Error: EvaluateOtgConnectFlags() failed: %d", r);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: EvaluateOtgConnectFlags() failed: %d", r));
 		}
 	}
 
@@ -239,7 +233,7 @@
 */
 EXPORT_C TBool DUsbClientController::IsActive()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_ISACTIVE, "DUsbClientController::IsActive()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::IsActive()"));
 	return iStackIsActive;
 	}
 
@@ -250,12 +244,11 @@
 */
 EXPORT_C TInt DUsbClientController::RegisterClientCallback(TUsbcClientCallback& aCallback)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_REGISTERCLIENTCALLBACK, "DUsbClientController::RegisterClientCallback()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::RegisterClientCallback()"));
 	if (iClientCallbacks.Elements() == KUsbcMaxListLength)
 		{
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_REGISTERCLIENTCALLBACK_DUP1, "  Error: Maximum list length reached: %d",
-                                          KUsbcMaxListLength);
-
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Maximum list length reached: %d",
+										  KUsbcMaxListLength));
 		return KErrGeneral;
 		}
 	TSglQueIter<TUsbcClientCallback> iter(iClientCallbacks);
@@ -263,7 +256,7 @@
 	while ((p = iter++) != NULL)
 		if (p == &aCallback)
 			{
-			OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_REGISTERCLIENTCALLBACK_DUP2, "    Error: ClientCallback @ 0x%x already registered", &aCallback);
+			__KTRACE_OPT(KUSB, Kern::Printf("	 Error: ClientCallback @ 0x%x already registered", &aCallback));
 			return KErrAlreadyExists;
 			}
 	iClientCallbacks.AddLast(aCallback);
@@ -281,10 +274,10 @@
 */
 EXPORT_C DUsbClientController* DUsbClientController::UsbcControllerPointer(TInt aUdc)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_USBCCONTROLLERPOINTER, "DUsbClientController::UsbcControllerPointer()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::UsbcControllerPointer()"));
 	if (aUdc < 0 || aUdc > 1)
 		{
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_USBCCONTROLLERPOINTER_DUP1, "  Error: aUdc out of range (%d)", aUdc);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: aUdc out of range (%d)", aUdc));
 		return NULL;
 		}
 	return UsbClientController[aUdc];
@@ -304,7 +297,7 @@
 */
 EXPORT_C void DUsbClientController::EndpointCaps(const DBase* aClientId, TDes8& aCapsBuf) const
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_ENDPOINTCAPS, "DUsbClientController::EndpointCaps()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::EndpointCaps()"));
 	// Here we do not simply call DUsbClientController::DeviceEndpointCaps(),
 	// because that function fills an array which comprises of _all_ endpoints,
 	// whereas this function omits ep0 and all unusable endpoints.
@@ -313,10 +306,10 @@
 	const TInt ifcset_num = ClientId2InterfaceNumber(aClientId);
 	for (TInt i = 2, j = 0; i < iDeviceTotalEndpoints; ++i)
 		{
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENDPOINTCAPS_DUP1, "DUsbClientController::Caps: RealEndpoint #%d", i);
+		__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::Caps: RealEndpoint #%d", i));
 		if (iRealEndpoints[i].iCaps.iTypesAndDir != KUsbEpNotAvailable)
 			{
-		    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENDPOINTCAPS_DUP2, "DUsbClientController::Caps: --> UsableEndpoint #%d", j);
+			__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::Caps: --> UsableEndpoint #%d", j));
 			data[j].iCaps = iRealEndpoints[i].iCaps;
 			if (ifcset_num < 0)
 				{
@@ -361,7 +354,7 @@
 */
 EXPORT_C void DUsbClientController::DeviceCaps(const DBase* aClientId, TDes8& aCapsBuf) const
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DEVICECAPS, "DUsbClientController::DeviceCaps()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeviceCaps()"));
 	TUsbDeviceCaps caps;
 	caps().iTotalEndpoints = iDeviceUsableEndpoints;		// not DeviceTotalEndpoints()!
 	caps().iConnect = SoftConnectCaps();
@@ -442,18 +435,17 @@
 												 const TUsbcEndpointInfoArray aEndpointData,
 												 TInt aRealEpNumbers[], TUint32 aFeatureWord)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETINTERFACE, "DUsbClientController::SetInterface()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetInterface()"));
 	if (aInterfaceNum != 0)
 		{
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETINTERFACE_DUP1, "  alternate interface setting request: #%d", aInterfaceNum);
-
+		__KTRACE_OPT(KUSB, Kern::Printf("  alternate interface setting request: #%d", aInterfaceNum));
 		}
 #ifndef USB_SUPPORTS_CONTROLENDPOINTS
 	for (TInt i = 0; i < aTotalEndpointsUsed; ++i)
 		{
 		if (aEndpointData[i].iType == KUsbEpTypeControl)
 			{
-		    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACE_DUP2, "  Error: control endpoints not supported");
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: control endpoints not supported"));
 			return KErrNotSupported;
 			}
 		}
@@ -463,21 +455,21 @@
 	// The passed-in ifcset_num may be -1 now, but that's intended.
 	if (!CheckEpAvailability(aTotalEndpointsUsed, aEndpointData, ifcset_num))
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACE_DUP3, "  Error: endpoints not (all) available");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: endpoints not (all) available"));
 		return KErrInUse;
 		}
 	// Create & setup new interface
 	TUsbcInterface* ifc = CreateInterface(aClientId, aInterfaceNum, aFeatureWord);
 	if (ifc == NULL)
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACE_DUP4, "  Error: ifc == NULL");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: ifc == NULL"));
 		return KErrGeneral;
 		}
 	// Create logical endpoints
 	TInt r = CreateEndpoints(ifc, aTotalEndpointsUsed, aEndpointData, aRealEpNumbers);
 	if (r != KErrNone)
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACE_DUP5, "  Error: CreateEndpoints() != KErrNone");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: CreateEndpoints() != KErrNone"));
 		DeleteInterface(ifc->iInterfaceSet->iInterfaceNumber, aInterfaceNum);
 		return r;
 		}
@@ -504,31 +496,31 @@
 */
 EXPORT_C TInt DUsbClientController::ReleaseInterface(const DBase* aClientId, TInt aInterfaceNum)
 	{
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_RELEASEINTERFACE, "DUsbClientController::ReleaseInterface(..., %d)", aInterfaceNum);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ReleaseInterface(..., %d)", aInterfaceNum));
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_RELEASEINTERFACE_DUP1, " interface not found");
+		__KTRACE_OPT(KUSB, Kern::Printf(" interface not found")); // no error
 		return KErrNone;
 		}
 	TUsbcInterfaceSet* const ifcset_ptr = InterfaceNumber2InterfacePointer(ifcset);
 	if (!ifcset_ptr)
 		{
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_RELEASEINTERFACE_DUP2, "Error: interface number %d doesn't exist", ifcset);
+		__KTRACE_OPT(KUSB, Kern::Printf(" Error: interface number %d doesn't exist", ifcset));
 		return KErrNotFound;
 		}
 	const TInt setting_count = ifcset_ptr->iInterfaces.Count();
 	if ((setting_count - 1) != aInterfaceNum)
 		{
-	    OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_RELEASEINTERFACE_DUP3, "> Error: interface settings must be released in descending order:\n\r"
-                                  "   %d setting(s) exist, #%d was requested to be released.\n\r"
-                                  "   (#%d has to be released first)",
-                                  setting_count, aInterfaceNum, setting_count - 1);
+		__KTRACE_OPT(KUSB,
+					 Kern::Printf(" > Error: interface settings must be released in descending order:\n\r"
+								  "   %d setting(s) exist, #%d was requested to be released.\n\r"
+								  "   (#%d has to be released first)",
+								  setting_count, aInterfaceNum, setting_count - 1));
 		return KErrArgument;
 		}
 	// Tear down current setting (invalidate configured state)
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_RELEASEINTERFACE_DUP4, " > tearing down InterfaceSet %d", ifcset);
+	__KTRACE_OPT(KUSB, Kern::Printf(" > tearing down InterfaceSet %d", ifcset));
 	// Cancel all transfers on the current setting of this interface and deconfigure all its endpoints.
 	InterfaceSetTeardown(ifcset_ptr);
 	// 'Setting 0' means: delete all existing settings.
@@ -579,7 +571,7 @@
 	// If it was the last interface(set)...
 	if (iConfigs[0]->iInterfaceSets.Count() == 0)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_RELEASEINTERFACE_DUP5, "  No ifc left -> turning off UDC");
+		__KTRACE_OPT(KUSB, Kern::Printf("  No ifc left -> turning off UDC"));
 		// First disconnect the device from the bus
 		UsbDisconnect();
 		DeActivateHardwareController();
@@ -596,13 +588,13 @@
 */
 EXPORT_C TInt DUsbClientController::ReEnumerate()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_REENUMERATE, "DUsbClientController::ReEnumerate()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ReEnumerate()"));
 	// If, in an OTG setup, the client stack is disabled, there's no point in
 	// trying to reenumerate the device. In fact, we then don't even want to
 	// turn on the UDC via ActivateHardwareController().
 	if (!iStackIsActive)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_REENUMERATE_DUP1, " Client stack disabled -> returning here" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  Client stack disabled -> returning here"));
 		return KErrNotReady;
 		}
 	// We probably don't check here whether SoftConnectCaps() is ETrue, and
@@ -611,7 +603,7 @@
 	// no-ops if not supported by the PSL.
 	if (iConfigs[0]->iInterfaceSets.Count() == 0)
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_REENUMERATE_DUP2, "  > No interface registered -> no need to re-enumerate" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  > No interface registered -> no need to re-enumerate"));
 		return KErrNone;;
 		}
 	if (!iHardwareActivated)
@@ -620,7 +612,7 @@
 		const TInt r = ActivateHardwareController();
 		if (r != KErrNone)
 				{
-		        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_REENUMERATE_DUP3, "  Error: ActivateHardwareController() failed: %d", r);
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: ActivateHardwareController() failed: %d", r));
 				return r;
 				}
 		// Finally connect the device to the bus
@@ -646,25 +638,25 @@
 */
 EXPORT_C TInt DUsbClientController::PowerUpUdc()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_POWERUPUDC, "DUsbClientController::PowerUpUdc()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::PowerUpUdc()"));
 	// If, in an OTG setup, the client stack is disabled, we mustn't turn on
 	// the UDC via ActivateHardwareController() as that would already configure
 	// Ep0.
 	if (!iStackIsActive)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_POWERUPUDC_DUP1, "  Client stack disabled -> returning here" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  Client stack disabled -> returning here"));
 		return KErrNotReady;
 		}
 	if (iConfigs[0]->iInterfaceSets.Count() == 0)
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_POWERUPUDC_DUP2, "   > No interface registered -> won't power up UDC" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  > No interface registered -> won't power up UDC"));
 		return KErrNotReady;
 		}
 	// If the UDC is still off, we switch it on here.
 	const TInt r = ActivateHardwareController();
 	if (r != KErrNone)
 		{
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_POWERUPUDC_DUP3, "  Error: ActivateHardwareController() failed: %d", r);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: ActivateHardwareController() failed: %d", r));
 		}
 	return r;
 	}
@@ -678,14 +670,14 @@
 */
 EXPORT_C TInt DUsbClientController::UsbConnect()
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_USBCONNECT, "DUsbClientController::UsbConnect()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::UsbConnect()"));
 #ifdef USB_OTG_CLIENT
 	iClientSupportReady = ETrue;
 	const TInt r = EvaluateOtgConnectFlags();
     const TInt irq = __SPIN_LOCK_IRQSAVE(iUsbLock);
 	if (iUsbResetDeferred) // implies (iOtgHnpHandledByHw == ETrue)
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_USBCONNECT_DUP1, "  Resetting USB Reset 'defer' flag" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  Resetting USB Reset 'defer' flag"));
 		iUsbResetDeferred = EFalse;
 		(void) ProcessResetEvent(EFalse);
 		}
@@ -705,7 +697,7 @@
 */
 EXPORT_C TInt DUsbClientController::UsbDisconnect()
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_USBDISCONNECT, "DUsbClientController::UsbDisconnect()" );   
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::UsbDisconnect()"));
 #ifdef USB_OTG_CLIENT
 	iClientSupportReady = EFalse;
 	const TInt r = EvaluateOtgConnectFlags();
@@ -741,16 +733,16 @@
 */
 EXPORT_C TInt DUsbClientController::RegisterForStatusChange(TUsbcStatusCallback& aCallback)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_REGISTERFORSTATUSCHANGE, "DUsbClientController::RegisterForStatusChange()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::RegisterForStatusChange()"));
 	if (iStatusCallbacks.Elements() == KUsbcMaxListLength)
 		{
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_REGISTERFORSTATUSCHANGE_DUP1, "  Error: Maximum list length reached: %d",
-                                          KUsbcMaxListLength);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Maximum list length reached: %d",
+										  KUsbcMaxListLength));
 		return KErrGeneral;
 		}
 	if (IsInTheStatusList(aCallback))
 		{
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_REGISTERFORSTATUSCHANGE_DUP2, "  Error: StatusCallback @ 0x%x already registered", &aCallback);
+		__KTRACE_OPT(KUSB, Kern::Printf("  Error: StatusCallback @ 0x%x already registered", &aCallback));
 		return KErrGeneral;
 		}
     const TInt irq = __SPIN_LOCK_IRQSAVE(iUsbLock);
@@ -769,7 +761,7 @@
 */
 EXPORT_C TInt DUsbClientController::DeRegisterForStatusChange(const DBase* aClientId)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DEREGISTERFORSTATUSCHANGE, "DUsbClientController::DeRegisterForStatusChange()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeRegisterForStatusChange()"));
 	__ASSERT_DEBUG((aClientId != NULL), Kern::Fault(KUsbPILPanicCat, __LINE__));
     const TInt irq = __SPIN_LOCK_IRQSAVE(iUsbLock);
 	TSglQueIter<TUsbcStatusCallback> iter(iStatusCallbacks);
@@ -778,13 +770,13 @@
 		{
 		if (p->Owner() == aClientId)
 			{
-			OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEREGISTERFORSTATUSCHANGE_DUP1, "  removing StatusCallback @ 0x%x", p);
+			__KTRACE_OPT(KUSB, Kern::Printf("  removing StatusCallback @ 0x%x", p));
 			iStatusCallbacks.Remove(*p);
 		    __SPIN_UNLOCK_IRQRESTORE(iUsbLock, irq);
 			return KErrNone;
 			}
 		}
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEREGISTERFORSTATUSCHANGE_DUP2, "  client not found");
+	__KTRACE_OPT(KUSB, Kern::Printf("  client not found"));
     __SPIN_UNLOCK_IRQRESTORE(iUsbLock, irq);
 	return KErrNotFound;
 	}
@@ -807,17 +799,16 @@
 */
 EXPORT_C TInt DUsbClientController::RegisterForEndpointStatusChange(TUsbcEndpointStatusCallback& aCallback)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_REGISTERFORENDPOINTSTATUSCHANGE, "DUsbClientController::RegisterForEndpointStatusChange()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::RegisterForEndpointStatusChange()"));
 	if (iEpStatusCallbacks.Elements() == KUsbcMaxListLength)
 		{
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_REGISTERFORENDPOINTSTATUSCHANGE_DUP1, "  Error: Maximum list length reached: %d",
-                                          KUsbcMaxListLength);
-
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Maximum list length reached: %d",
+										  KUsbcMaxListLength));
 		return KErrGeneral;
 		}
 	if (IsInTheEpStatusList(aCallback))
 		{
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_REGISTERFORENDPOINTSTATUSCHANGE_DUP2, "  Error: EpStatusCallback @ 0x%x already registered", &aCallback);
+		__KTRACE_OPT(KUSB, Kern::Printf("  Error: EpStatusCallback @ 0x%x already registered", &aCallback));
 		return KErrGeneral;
 		}
     const TInt irq = __SPIN_LOCK_IRQSAVE(iUsbLock);
@@ -836,7 +827,7 @@
 */
 EXPORT_C TInt DUsbClientController::DeRegisterForEndpointStatusChange(const DBase* aClientId)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DEREGISTERFORENDPOINTSTATUSCHANGE, "DUsbClientController::DeRegisterForEndpointStatusChange()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeRegisterForEndpointStatusChange()"));
 	__ASSERT_DEBUG((aClientId != NULL), Kern::Fault(KUsbPILPanicCat, __LINE__));
     const TInt irq = __SPIN_LOCK_IRQSAVE(iUsbLock);
 	TSglQueIter<TUsbcEndpointStatusCallback> iter(iEpStatusCallbacks);
@@ -845,13 +836,13 @@
 		{
 		if (p->Owner() == aClientId)
 			{
-			OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEREGISTERFORENDPOINTSTATUSCHANGE_DUP1, "  removing EpStatusCallback @ 0x%x", p);
+			__KTRACE_OPT(KUSB, Kern::Printf("  removing EpStatusCallback @ 0x%x", p));
 			iEpStatusCallbacks.Remove(*p);
 		    __SPIN_UNLOCK_IRQRESTORE(iUsbLock, irq);
 			return KErrNone;
 			}
 		}
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEREGISTERFORENDPOINTSTATUSCHANGE_DUP2, "  client not found");
+	__KTRACE_OPT(KUSB, Kern::Printf("  client not found"));
     __SPIN_UNLOCK_IRQRESTORE(iUsbLock, irq);
 	return KErrNotFound;
 	}
@@ -867,18 +858,17 @@
 */
 EXPORT_C TInt DUsbClientController::GetInterfaceNumber(const DBase* aClientId, TInt& aInterfaceNum) const
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETINTERFACENUMBER, "DUsbClientController::GetInterfaceNumber()" );
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetInterfaceNumber()"));
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETINTERFACENUMBER_DUP1, "  Error (ifc < 0)");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error (ifc < 0)"));
 		return KErrNotFound;
 		}
 	const TUsbcInterfaceSet* const ifcset_ptr = InterfaceNumber2InterfacePointer(ifcset);
 	if (!ifcset_ptr)
 		{
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETINTERFACENUMBER_DUP2, "  Error: interface number %d doesn't exist", ifcset);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: interface number %d doesn't exist", ifcset));
 		return KErrNotFound;
 		}
 	aInterfaceNum = ifcset_ptr->iCurrentInterface;
@@ -903,8 +893,7 @@
 */
 EXPORT_C TInt DUsbClientController::DeRegisterClient(const DBase* aClientId)
 	{
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEREGISTERCLIENT, "DUsbClientController::DeRegisterClient(0x%x)", aClientId);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeRegisterClient(0x%x)", aClientId));
 	// Cancel all device state notification requests
 	DeRegisterForStatusChange(aClientId);
 	// Cancel all endpoint state notification requests
@@ -916,7 +905,7 @@
 	const TInt r = ReleaseInterface(aClientId, 0);
 	// Cancel all remaining (if any) read/write requests
 	DeleteRequestCallbacks(aClientId);
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEREGISTERCLIENT_DUP1, "DUsbClientController::DeRegisterClient: Done.");
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeRegisterClient: Done."));
 	return r;
 	}
 
@@ -930,13 +919,12 @@
 	const TUsbcLogicalEndpoint* const ep = iRealEndpoints[0].iLEndpoint;
 	if (iHighSpeed)
 		{
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EP0PACKETSIZE, "  Ep0 size = %d (HS)", ep->iEpSize_Hs);
-		
+		__KTRACE_OPT(KUSB, Kern::Printf("  Ep0 size = %d (HS)", ep->iEpSize_Hs));
 		return ep->iEpSize_Hs;
 		}
 	else
 		{
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EP0PACKETSIZE_DUP1, "  Ep0 size = %d (FS)", ep->iEpSize_Fs);
+		__KTRACE_OPT(KUSB, Kern::Printf("  Ep0 size = %d (FS)", ep->iEpSize_Fs));
 		return ep->iEpSize_Fs;
 		}
 	}
@@ -950,7 +938,7 @@
 */
 EXPORT_C TInt DUsbClientController::Ep0Stall(const DBase* aClientId)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_EP0STALL, "DUsbClientController::Ep0Stall()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::Ep0Stall()"));
 	if (aClientId == iEp0ClientId)
 		{
 		ResetEp0DataOutVars();
@@ -971,7 +959,7 @@
 */
 EXPORT_C void DUsbClientController::SendEp0StatusPacket(const DBase* /* aClientId */)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SENDEP0STATUSPACKET, "DUsbClientController::SendEp0StatusPacket()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SendEp0StatusPacket()"));
 	SendEp0ZeroByteStatusPacket();
 	}
 
@@ -986,7 +974,7 @@
 */
 EXPORT_C TUsbcDeviceState DUsbClientController::GetDeviceStatus() const
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETDEVICESTATUS, "DUsbClientController::GetDeviceStatus()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetDeviceStatus()"));
 	return iDeviceState;
 	}
 
@@ -1003,7 +991,7 @@
 */
 EXPORT_C TEndpointState DUsbClientController::GetEndpointStatus(const DBase* aClientId, TInt aEndpointNum) const
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETENDPOINTSTATUS, "DUsbClientController::GetEndpointStatus()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetEndpointStatus()"));
 	return EndpointStallStatus(aEndpointNum) ?
 		EEndpointStateStalled :
 		EEndpointStateNotStalled;
@@ -1020,23 +1008,23 @@
 */
 EXPORT_C TInt DUsbClientController::SetupReadBuffer(TUsbcRequestCallback& aCallback)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETUPREADBUFFER, "DUsbClientController::SetupReadBuffer()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetupReadBuffer()"));
 	const TInt ep = aCallback.iRealEpNum;
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP1, "  logical ep: #%d", aCallback.iEndpointNum);
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP2, "  real ep:    #%d", ep);
+	__KTRACE_OPT(KUSB, Kern::Printf("  logical ep: #%d", aCallback.iEndpointNum));
+	__KTRACE_OPT(KUSB, Kern::Printf("  real ep:    #%d", ep));
 	TInt err = KErrGeneral;
 	if (ep != 0)
 		{
 		if (iRequestCallbacks[ep])
 			{
-			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP3, "  Warning: RequestCallback already registered for that ep");
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: RequestCallback already registered for that ep"));
 			if (iRequestCallbacks[ep] == &aCallback)
 				{
-	            OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP4, "  (this same RequestCallback @ 0x%x)", &aCallback);
+				__KTRACE_OPT(KPANIC, Kern::Printf("  (this same RequestCallback @ 0x%x)", &aCallback));
 				}
 			else
 				{
-                OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP5, "  (a different RequestCallback @ 0x%x)", &aCallback);
+				__KTRACE_OPT(KPANIC, Kern::Printf("  (a different RequestCallback @ 0x%x)", &aCallback));
 				}
 			return KErrNone;
 			}
@@ -1046,12 +1034,12 @@
 		// an ISR) _before_ the SetupEndpointRead function returns. Since we don't know the
 		// outcome, we have to provide the callback before making the setup call.
 		//
-        OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP6, "  adding RequestCallback[%d] @ 0x%x", ep, (TUint)&aCallback);
+		__KTRACE_OPT(KUSB, Kern::Printf("  adding RequestCallback[%d] @ 0x%x", ep, &aCallback));
 		iRequestCallbacks[ep] = &aCallback;
 		if ((err = SetupEndpointRead(ep, aCallback)) != KErrNone)
 			{
-	        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP7, "  removing RequestCallback @ 0x%x (due to error)",
-                                              &aCallback);
+			__KTRACE_OPT(KPANIC, Kern::Printf("  removing RequestCallback @ 0x%x (due to error)",
+											  &aCallback));
 			iRequestCallbacks[ep] = NULL;
 			}
 		}
@@ -1059,24 +1047,24 @@
 		{
 		if (iEp0ReadRequestCallbacks.Elements() == KUsbcMaxListLength)
 			{
-			OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP8, "  Error: Maximum list length reached: %d",
-                                              KUsbcMaxListLength);
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Maximum list length reached: %d",
+											  KUsbcMaxListLength));
 			return KErrGeneral;
 			}
 		if (IsInTheRequestList(aCallback))
 			{
-			OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP9, "   RequestCallback @ 0x%x already registered", &aCallback);
+			__KTRACE_OPT(KUSB, Kern::Printf("  RequestCallback @ 0x%x already registered", &aCallback));
 			return KErrNone;
 			}
 		// Ep0 reads don't need to be prepared - there's always one pending
-        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP10, "  adding RequestCallback @ 0x%x (ep0)", &aCallback);
+		__KTRACE_OPT(KUSB, Kern::Printf("  adding RequestCallback @ 0x%x (ep0)", &aCallback));
 	    const TInt irq = __SPIN_LOCK_IRQSAVE(iUsbLock);
 		iEp0ReadRequestCallbacks.AddLast(aCallback);
         __SPIN_UNLOCK_IRQRESTORE(iUsbLock, irq);
 		err = KErrNone;
 		if (iEp0_RxExtraData)
 			{
-	        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP11, "  iEp0_RxExtraData: trying again...");
+			__KTRACE_OPT(KUSB, Kern::Printf("  iEp0_RxExtraData: trying again..."));
 			const TBool rx_data = iEp0DataReceiving;
 		    const TInt irq = __SPIN_LOCK_IRQSAVE(iUsbLock);
 			err = ProcessEp0ReceiveDone(iEp0_RxExtraCount);
@@ -1094,11 +1082,11 @@
 					{
 					Ep0ReadSetupPktProceed();
 					}
-	            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP12, "  :-)");
+				__KTRACE_OPT(KUSB, Kern::Printf("  :-)"));
 				}
 			else
 				{
-                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPREADBUFFER_DUP13, "  Error: :-(");
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: :-("));
 				err = KErrGeneral;
 				}
 			return err;
@@ -1118,23 +1106,22 @@
 */
 EXPORT_C TInt DUsbClientController::SetupWriteBuffer(TUsbcRequestCallback& aCallback)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER, "DUsbClientController::SetupWriteBuffer()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetupWriteBuffer()"));
 	TInt ep = aCallback.iRealEpNum;
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP1, "  logical ep: #%d", aCallback.iEndpointNum);
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP2, "  real ep:    #%d", ep);
-
+	__KTRACE_OPT(KUSB, Kern::Printf("  logical ep: #%d", aCallback.iEndpointNum));
+	__KTRACE_OPT(KUSB, Kern::Printf("  real ep:	   #%d", ep));
 	if (iRequestCallbacks[ep])
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP3, "  Warning: RequestCallback already registered for that ep");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: RequestCallback already registered for that ep"));
 		if (iRequestCallbacks[ep] == &aCallback)
 			{
-		    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP4, "  (this same RequestCallback @ 0x%x)", &aCallback);
+			__KTRACE_OPT(KPANIC, Kern::Printf("  (this same RequestCallback @ 0x%x)", &aCallback));
 			return KErrNone;
 			}
 		else
 			{
-	        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP5, "  (a different RequestCallback @ 0x%x - poss. error)",
-                                              &aCallback);
+			__KTRACE_OPT(KPANIC, Kern::Printf("  (a different RequestCallback @ 0x%x - poss. error)",
+											  &aCallback));
 			return KErrGeneral;
 			}
 		}
@@ -1144,15 +1131,15 @@
 			{
 			if (iEp0_TxNonStdCount > aCallback.iLength)
 				{
-				OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP6, "  Warning: Ep0 is sending less data than requested");
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Ep0 is sending less data than requested"));
 				if ((aCallback.iLength % iEp0MaxPacketSize == 0) && !aCallback.iZlpReqd)
 					{
-		            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP7, "  Warning: Zlp should probably be requested");
+					__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Zlp should probably be requested"));
 					}
 				}
 			else if (iEp0_TxNonStdCount < aCallback.iLength)
 				{
-                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP8, "  Warning: Ep0 is sending more data than requested");
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Ep0 is sending more data than requested"));
 				}
 			iEp0_TxNonStdCount = 0;
 			}
@@ -1164,21 +1151,22 @@
 	// However this is necessary because the transfer request might complete (through
 	// an ISR) _before_ the SetupEndpointWrite function returns. Since we don't know the
 	// outcome, we have to provide the callback before making the setup call.
-    OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP9, "  adding RequestCallback[%d] @ 0x%x", ep, (TUint)&aCallback);
+	//
+	__KTRACE_OPT(KUSB, Kern::Printf("  adding RequestCallback[%d] @ 0x%x", ep, &aCallback));
 	iRequestCallbacks[ep] = &aCallback;
 	if (ep == KEp0_Tx)
 		{
 		iEp0ClientDataTransmitting = ETrue;			 // this must be set before calling SetupEndpointZeroWrite
 		if (SetupEndpointZeroWrite(aCallback.iBufferStart, aCallback.iLength, aCallback.iZlpReqd) != KErrNone)
 			{
-		    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP10, "  removing RequestCallback @ 0x%x (due to error)", &aCallback);
+			__KTRACE_OPT(KPANIC, Kern::Printf("  removing RequestCallback @ 0x%x (due to error)", &aCallback));
 			iRequestCallbacks[ep] = NULL;
 			iEp0ClientDataTransmitting = EFalse;
 			}
 		}
 	else if (SetupEndpointWrite(ep, aCallback) != KErrNone)
 		{
-        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPWRITEBUFFER_DUP11, "  removing RequestCallback @ 0x%x (due to error)", &aCallback);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  removing RequestCallback @ 0x%x (due to error)", &aCallback));
 		iRequestCallbacks[ep] = NULL;
 		}
 	return KErrNone;
@@ -1195,11 +1183,10 @@
 */
 EXPORT_C void DUsbClientController::CancelReadBuffer(const DBase* aClientId, TInt aRealEndpoint)
 	{
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CANCELREADBUFFER, "DUsbClientController::CancelReadBuffer(%d)", aRealEndpoint);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::CancelReadBuffer(%d)", aRealEndpoint));
 	if (aRealEndpoint < 0)
 		{
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CANCELREADBUFFER_DUP1, "  Error: ep # < 0: %d", aRealEndpoint);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: ep # < 0: %d", aRealEndpoint));
 		return;
 		}
 	// Note that we here don't cancel Ep0 read requests at the PSL level!
@@ -1222,11 +1209,10 @@
 */
 EXPORT_C void DUsbClientController::CancelWriteBuffer(const DBase* aClientId, TInt aRealEndpoint)
 	{
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CANCELWRITEBUFFER, "DUsbClientController::CancelWriteBuffer(%d)", aRealEndpoint);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::CancelWriteBuffer(%d)", aRealEndpoint));
 	if (aRealEndpoint < 0)
 		{
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CANCELWRITEBUFFER_DUP1, "  Error: ep # < 0: %d", aRealEndpoint);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: ep # < 0: %d", aRealEndpoint));
 		return;
 		}
 	if (aRealEndpoint == 0)
@@ -1254,8 +1240,7 @@
 */
 EXPORT_C TInt DUsbClientController::HaltEndpoint(const DBase* aClientId, TInt aEndpointNum)
 	{
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_HALTENDPOINT, "DUsbClientController::HaltEndpoint(%d)", aEndpointNum);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::HaltEndpoint(%d)", aEndpointNum));
 	const TInt r = StallEndpoint(aEndpointNum);
 	if (r == KErrNone)
 		{
@@ -1279,7 +1264,7 @@
 */
 EXPORT_C TInt DUsbClientController::ClearHaltEndpoint(const DBase* aClientId, TInt aEndpointNum)
 	{
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CLEARHALTENDPOINT, "DUsbClientController::ClearHaltEndpoint(%d)", aEndpointNum);
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ClearHaltEndpoint(%d)", aEndpointNum));
 	const TInt r = ClearStallEndpoint(aEndpointNum);
 	if (r == KErrNone)
 		{
@@ -1306,15 +1291,15 @@
 */
 EXPORT_C TInt DUsbClientController::SetDeviceControl(const DBase* aClientId)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETDEVICECONTROL, "DUsbClientController::SetDeviceControl()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetDeviceControl()"));
 	if (iEp0DeviceControl)
 		{
 		if (iEp0DeviceControl == aClientId)
 			{
-			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETDEVICECONTROL_DUP1, "  Warning: Device Control already owned by this client" );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Device Control already owned by this client"));
 			return KErrNone;
 			}
-        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETDEVICECONTROL_DUP2, "  Error: Device Control already claimed by a different client");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Device Control already claimed by a different client"));
 		return KErrGeneral;
 		}
 	iEp0DeviceControl = aClientId;
@@ -1333,20 +1318,20 @@
 */
 EXPORT_C TInt DUsbClientController::ReleaseDeviceControl(const DBase* aClientId)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_RELEASEDEVICECONTROL, "DUsbClientController::ReleaseDeviceControl()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ReleaseDeviceControl()"));
 	if (iEp0DeviceControl)
 		{
 		if (iEp0DeviceControl == aClientId)
 			{
-			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_RELEASEDEVICECONTROL_DUP1, "  Releasing Device Control" );
+			__KTRACE_OPT(KUSB, Kern::Printf("  Releasing Device Control"));
 			iEp0DeviceControl = NULL;
 			return KErrNone;
 			}
-        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_RELEASEDEVICECONTROL_DUP2, "  Error: Device Control owned by a different client" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Device Control owned by a different client"));
 		}
 	else
 		{
-        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_RELEASEDEVICECONTROL_DUP3, "  Error: Device Control not owned by any client" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Device Control not owned by any client"));
 		}
 	return KErrGeneral;
 	}
@@ -1361,7 +1346,7 @@
 */
 EXPORT_C TUint DUsbClientController::EndpointZeroMaxPacketSizes() const
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_ENDPOINTZEROMAXPACKETSIZES, "DUsbClientController::EndpointZeroMaxPacketSizes()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::EndpointZeroMaxPacketSizes()"));
 	return iRealEndpoints[0].iCaps.iSizes;
 	}
 
@@ -1377,9 +1362,8 @@
 */
 EXPORT_C TInt DUsbClientController::SetEndpointZeroMaxPacketSize(TInt aMaxPacketSize)
 	{
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETENDPOINTZEROMAXPACKETSIZE, "DUsbClientController::SetEndpointZeroMaxPacketSize(%d)",
-                                    aMaxPacketSize);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetEndpointZeroMaxPacketSize(%d)",
+									aMaxPacketSize));
 
 	if (DeviceHighSpeedCaps())
 		{
@@ -1389,12 +1373,12 @@
 
 	if (!(iRealEndpoints[0].iCaps.iSizes & PacketSize2Mask(aMaxPacketSize)))
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETENDPOINTZEROMAXPACKETSIZE_DUP1, "  Error: invalid size");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: invalid size"));
 		return KErrNotSupported;
 		}
 	if (iRealEndpoints[0].iLEndpoint->iEpSize_Fs == aMaxPacketSize)
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETENDPOINTZEROMAXPACKETSIZE_DUP2, "  this packet size already set -> returning");
+		__KTRACE_OPT(KUSB, Kern::Printf("  this packet size already set -> returning"));
 		return KErrNone;
 		}
 	const TUsbcLogicalEndpoint* const ep0_0 = iRealEndpoints[0].iLEndpoint;
@@ -1431,7 +1415,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetDeviceDescriptor(DThread* aThread, TDes8& aDeviceDescriptor)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETDEVICEDESCRIPTOR, "DUsbClientController::GetDeviceDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetDeviceDescriptor()"));
 	return iDescriptors.GetDeviceDescriptorTC(aThread, aDeviceDescriptor);
 	}
 
@@ -1447,7 +1431,7 @@
 */
 EXPORT_C TInt DUsbClientController::SetDeviceDescriptor(DThread* aThread, const TDes8& aDeviceDescriptor)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETDEVICEDESCRIPTOR, "DUsbClientController::SetDeviceDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetDeviceDescriptor()"));
 	return iDescriptors.SetDeviceDescriptorTC(aThread, aDeviceDescriptor);
 	}
 
@@ -1463,7 +1447,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetDeviceDescriptorSize(DThread* aThread, TDes8& aSize)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETDEVICEDESCRIPTORSIZE, "DUsbClientController::GetDeviceDescriptorSize()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetDeviceDescriptorSize()"));
 	// We do not really enquire here....
 	const TPtrC8 size(reinterpret_cast<const TUint8*>(&KUsbDescSize_Device), sizeof(KUsbDescSize_Device));
 	return Kern::ThreadDesWrite(aThread, &aSize, size, 0);
@@ -1481,7 +1465,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetConfigurationDescriptor(DThread* aThread, TDes8& aConfigurationDescriptor)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETCONFIGURATIONDESCRIPTOR, "DUsbClientController::GetConfigurationDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetConfigurationDescriptor()"));
 	return iDescriptors.GetConfigurationDescriptorTC(aThread, aConfigurationDescriptor);
 	}
 
@@ -1498,7 +1482,7 @@
 EXPORT_C TInt DUsbClientController::SetConfigurationDescriptor(DThread* aThread,
 															   const TDes8& aConfigurationDescriptor)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETCONFIGURATIONDESCRIPTOR, "DUsbClientController::SetConfigurationDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetConfigurationDescriptor()"));
 	return iDescriptors.SetConfigurationDescriptorTC(aThread, aConfigurationDescriptor);
 	}
 
@@ -1514,7 +1498,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetConfigurationDescriptorSize(DThread* aThread, TDes8& aSize)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETCONFIGURATIONDESCRIPTORSIZE, "DUsbClientController::GetConfigurationDescriptorSize()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetConfigurationDescriptorSize()"));
 	// We do not really enquire here....
 	const TPtrC8 size(reinterpret_cast<const TUint8*>(&KUsbDescSize_Config), sizeof(KUsbDescSize_Config));
 	return Kern::ThreadDesWrite(aThread, &aSize, size, 0);
@@ -1532,7 +1516,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetOtgDescriptor(DThread* aThread, TDes8& aOtgDesc) const
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETOTGDESCRIPTOR, "DUsbClientController::GetOtgDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetOtgDescriptor()"));
 	if (!iOtgSupport)
 		{
 		return KErrNotSupported;
@@ -1550,7 +1534,7 @@
 */
 EXPORT_C TInt DUsbClientController::SetOtgDescriptor(DThread* aThread, const TDesC8& aOtgDesc)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR, "DUsbClientController::SetOtgDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetOtgDescriptor()"));
 	if (!iOtgSupport)
 		{
 		return KErrNotSupported;
@@ -1564,38 +1548,38 @@
 	// Check descriptor validity
 	if (otg[0] != KUsbDescSize_Otg || otg[1] != KUsbDescType_Otg || otg[2] > 3)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP1, "  Error: Invalid OTG descriptor" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid OTG descriptor"));
 		return KErrGeneral;
 		}
-    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP2, "  iOtgFuncMap before: 0x%x", iOtgFuncMap);
+	__KTRACE_OPT(KUSB, Kern::Printf("  iOtgFuncMap before: 0x%x", iOtgFuncMap));
 	// Update value in controller as well
 	const TUint8 hnp = otg[2] & KUsbOtgAttr_HnpSupp;
 	const TUint8 srp = otg[2] & KUsbOtgAttr_SrpSupp;
 	if (hnp && !srp)
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP3, " Warning: Invalid OTG attribute combination (HNP && !SRP");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: Invalid OTG attribute combination (HNP && !SRP"));
 		}
 	if (hnp && !(iOtgFuncMap & KUsbOtgAttr_HnpSupp))
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP4, "   Setting attribute KUsbOtgAttr_HnpSupp");
+		__KTRACE_OPT(KUSB, Kern::Printf("  Setting attribute KUsbOtgAttr_HnpSupp"));
 		iOtgFuncMap |= KUsbOtgAttr_HnpSupp;
 		}
 	else if (!hnp && (iOtgFuncMap & KUsbOtgAttr_HnpSupp))
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP5, "  Removing attribute KUsbOtgAttr_HnpSupp");
+		__KTRACE_OPT(KUSB, Kern::Printf("  Removing attribute KUsbOtgAttr_HnpSupp"));
 		iOtgFuncMap &= ~KUsbOtgAttr_HnpSupp;
 		}
 	if (srp && !(iOtgFuncMap & KUsbOtgAttr_SrpSupp))
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP6, "  Setting attribute KUsbOtgAttr_SrpSupp");
+		__KTRACE_OPT(KUSB, Kern::Printf("  Setting attribute KUsbOtgAttr_SrpSupp"));
 		iOtgFuncMap |= KUsbOtgAttr_SrpSupp;
 		}
 	else if (!srp && (iOtgFuncMap & KUsbOtgAttr_SrpSupp))
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP7, "  Removing attribute KUsbOtgAttr_SrpSupp");
+		__KTRACE_OPT(KUSB, Kern::Printf("  Removing attribute KUsbOtgAttr_SrpSupp"));
 		iOtgFuncMap &= ~KUsbOtgAttr_SrpSupp;
 		}
-    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETOTGDESCRIPTOR_DUP8, "  iOtgFuncMap after:  0x%x", iOtgFuncMap);
+	__KTRACE_OPT(KUSB, Kern::Printf("  iOtgFuncMap after:  0x%x", iOtgFuncMap));
 	return iDescriptors.SetOtgDescriptor(otg);
 	}
 
@@ -1609,7 +1593,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetOtgFeatures(DThread* aThread, TDes8& aFeatures) const
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETOTGFEATURES, "DUsbClientController::GetOtgFeatures()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetOtgFeatures()"));
 	if (!iOtgSupport)
 		{
 		return KErrNotSupported;
@@ -1628,7 +1612,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetCurrentOtgFeatures(TUint8& aFeatures) const
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETCURRENTOTGFEATURES, "DUsbClientController::GetCurrentOtgFeatures()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetCurrentOtgFeatures()"));
 	if (!iOtgSupport)
 		{
 		return KErrNotSupported;
@@ -1649,16 +1633,16 @@
 */
 EXPORT_C TInt DUsbClientController::RegisterForOtgFeatureChange(TUsbcOtgFeatureCallback& aCallback)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_REGISTERFOROTGFEATURECHANGE, "DUsbClientController::RegisterForOtgFeatureChange()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::RegisterForOtgFeatureChange()"));
 	if (iOtgCallbacks.Elements() == KUsbcMaxListLength)
 		{
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_REGISTERFOROTGFEATURECHANGE_DUP1, "  Error: Maximum list length reached: %d",
-                                          KUsbcMaxListLength);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Maximum list length reached: %d",
+										  KUsbcMaxListLength));
 		return KErrGeneral;
 		}
 	if (IsInTheOtgFeatureList(aCallback))
 		{
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_REGISTERFOROTGFEATURECHANGE_DUP2, "  Error: OtgFeatureCallback @ 0x%x already registered", &aCallback);
+		__KTRACE_OPT(KUSB, Kern::Printf("  Error: OtgFeatureCallback @ 0x%x already registered", &aCallback));
 		return KErrAlreadyExists;
 		}
     const TInt irq = __SPIN_LOCK_IRQSAVE(iUsbLock);
@@ -1677,7 +1661,7 @@
 */
 EXPORT_C TInt DUsbClientController::DeRegisterForOtgFeatureChange(const DBase* aClientId)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DEREGISTERFOROTGFEATURECHANGE, "DUsbClientController::DeRegisterForOtgFeatureChange()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeRegisterForOtgFeatureChange()"));
 	__ASSERT_DEBUG((aClientId != NULL), Kern::Fault(KUsbPILPanicCat, __LINE__));
     const TInt irq = __SPIN_LOCK_IRQSAVE(iUsbLock);
 	TSglQueIter<TUsbcOtgFeatureCallback> iter(iOtgCallbacks);
@@ -1686,13 +1670,13 @@
 		{
 		if (!aClientId || p->Owner() == aClientId)
 			{
-			OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEREGISTERFOROTGFEATURECHANGE_DUP1, "  removing OtgFeatureCallback @ 0x%x", p);
+			__KTRACE_OPT(KUSB, Kern::Printf("  removing OtgFeatureCallback @ 0x%x", p));
 			iOtgCallbacks.Remove(*p);
             __SPIN_UNLOCK_IRQRESTORE(iUsbLock, irq);
 			return KErrNone;
 			}
 		}
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEREGISTERFOROTGFEATURECHANGE_DUP2, "  client not found");
+	__KTRACE_OPT(KUSB, Kern::Printf("  client not found"));
     __SPIN_UNLOCK_IRQRESTORE(iUsbLock, irq);
 	return KErrNotFound;
 	}
@@ -1712,13 +1696,12 @@
 EXPORT_C TInt DUsbClientController::GetInterfaceDescriptor(DThread* aThread, const DBase* aClientId,
 														   TInt aSettingNum, TDes8& aInterfaceDescriptor)
 	{
-	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_GETINTERFACEDESCRIPTOR, "DUsbClientController::GetInterfaceDescriptor(x, 0x%08x, %d, y)",
-                                    (TUint)aClientId, aSettingNum);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetInterfaceDescriptor(x, 0x%08x, %d, y)",
+									aClientId, aSettingNum));
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETINTERFACEDESCRIPTOR_DUP1, "  Error: Interface not found from client ID");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
 		return KErrNotFound;
 		}
 	return iDescriptors.GetInterfaceDescriptorTC(aThread, aInterfaceDescriptor, ifcset, aSettingNum);
@@ -1748,19 +1731,19 @@
 EXPORT_C TInt DUsbClientController::SetInterfaceDescriptor(DThread* aThread, const DBase* aClientId,
 														   TInt aSettingNum, const TDes8& aInterfaceDescriptor)
 	{
-	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR, "DUsbClientController::SetInterfaceDescriptor(x, 0x%08x, %d, y)",
-                                    (TUint)aClientId, aSettingNum);
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetInterfaceDescriptor(x, 0x%08x, %d, y)",
+									aClientId, aSettingNum));
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP1, "  Error: Interface not found from client ID");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
 		return KErrNotFound;
 		}
 	TBuf8<KUsbDescSize_Interface> new_ifc;
 	TInt r = Kern::ThreadDesRead(aThread, &aInterfaceDescriptor, new_ifc, 0);
 	if (r != KErrNone)
 		{
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP2, "  Error: Copying interface descriptor buffer failed (%d)", r);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Copying interface descriptor buffer failed (%d)", r));
 		return r;
 		}
 	const TInt ifcset_new = new_ifc[2];
@@ -1768,7 +1751,7 @@
 	TUsbcInterfaceSet* const ifcset_ptr = InterfaceNumber2InterfacePointer(ifcset);
 	if (!ifcset_ptr)
 		{
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP3, "  Error: interface number %d doesn't exist", ifcset);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: interface number %d doesn't exist", ifcset));
 		return KErrNotFound;
 		}
 	if (ifc_num_changes)
@@ -1777,32 +1760,32 @@
 		if (InterfaceExists(ifcset_new))
 			{
 			// Obviously we cannot accept a number that is already used by another interface.
-		    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP4, "  Error: interface number %d already in use", ifcset_new);
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: interface number %d already in use", ifcset_new));
 			return KErrArgument;
 			}
 		if (ifcset_ptr->iInterfaces.Count() > 1)
 			{
 			// We allow the interface number to be changed only when it's the only setting.
-	        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP5, "  Error: interface has more than one alternate setting");
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: interface has more than one alternate setting"));
 			return KErrArgument;
 			}
 		if (aSettingNum != 0)
 			{
 			// We allow the interface number to be changed only when it's the default setting.
-	        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP6, " Error: interface number can only be changed for setting 0");
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: interface number can only be changed for setting 0"));
 			return KErrArgument;
 			}
 		}
 	if ((r = iDescriptors.SetInterfaceDescriptor(new_ifc, ifcset, aSettingNum)) != KErrNone)
 		{
-        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP7, "  Error: iDescriptors.SetInterfaceDescriptorfailed");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: iDescriptors.SetInterfaceDescriptorfailed"));
 		return r;
 		}
 	if (ifc_num_changes)
 		{
 		// Alright then, let's do it...
-		OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETINTERFACEDESCRIPTOR_DUP8, "  about to change interface number from %d to %d",
-                                        ifcset, ifcset_new);
+		__KTRACE_OPT(KUSB, Kern::Printf("  about to change interface number from %d to %d",
+										ifcset, ifcset_new));
 		ifcset_ptr->iInterfaceNumber = ifcset_new;
 		}
 	return KErrNone;
@@ -1823,11 +1806,11 @@
 EXPORT_C TInt DUsbClientController::GetInterfaceDescriptorSize(DThread* aThread, const DBase* aClientId,
 															   TInt /*aSettingNum*/, TDes8& aSize)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETINTERFACEDESCRIPTORSIZE, "DUsbClientController::GetInterfaceDescriptorSize()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetInterfaceDescriptorSize()"));
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETINTERFACEDESCRIPTORSIZE_DUP1, "  Error: Interface not found from client ID" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
 		return KErrNotFound;
 		}
 	// Actually, we do not really enquire here....
@@ -1854,12 +1837,12 @@
 														  TInt aSettingNum, TInt aEndpointNum,
 														  TDes8& aEndpointDescriptor)
 	{
-	OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_GETENDPOINTDESCRIPTOR, "DUsbClientController::GetEndpointDescriptor(x, 0x%08x, %d, %d, y)",
-                                    (TUint)aClientId, aSettingNum, aEndpointNum);
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetEndpointDescriptor(x, 0x%08x, %d, %d, y)",
+									aClientId, aSettingNum, aEndpointNum));
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETENDPOINTDESCRIPTOR_DUP1, "  Error: Interface not found from client ID");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
 		return KErrNotFound;
 		}
 	return iDescriptors.GetEndpointDescriptorTC(aThread, aEndpointDescriptor, ifcset,
@@ -1885,12 +1868,12 @@
 														  TInt aSettingNum, TInt aEndpointNum,
 														  const TDes8& aEndpointDescriptor)
 	{
-	OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETENDPOINTDESCRIPTOR, "DUsbClientController::SetEndpointDescriptor(x, 0x%08x, %d, %d, y)",
-                                    (TUint)aClientId, aSettingNum, aEndpointNum);
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetEndpointDescriptor(x, 0x%08x, %d, %d, y)",
+									aClientId, aSettingNum, aEndpointNum));
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETENDPOINTDESCRIPTOR_DUP1, "  Error: Interface not found from client ID");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
 		return KErrNotFound;
 		}
 	return iDescriptors.SetEndpointDescriptorTC(aThread, aEndpointDescriptor, ifcset,
@@ -1915,12 +1898,12 @@
 															  TInt aSettingNum, TInt aEndpointNum,
 															  TDes8& aSize)
 	{
-	OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_GETENDPOINTDESCRIPTORSIZE, "DUsbClientController::GetEndpointDescriptorSize(x, 0x%08x, %d, %d, y)",
-                                    (TUint)aClientId, aSettingNum, aEndpointNum);
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetEndpointDescriptorSize(x, 0x%08x, %d, %d, y)",
+									aClientId, aSettingNum, aEndpointNum));
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETENDPOINTDESCRIPTORSIZE_DUP1, "D  Error: Interface not found from client ID");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
 		return KErrNotFound;
 		}
 	TInt s;
@@ -1933,7 +1916,7 @@
 		}
 	else
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETENDPOINTDESCRIPTORSIZE_DUP2, "  Error: endpoint descriptor not found");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: endpoint descriptor not found"));
 		}
 	return r;
 	}
@@ -1953,7 +1936,7 @@
 EXPORT_C TInt DUsbClientController::GetDeviceQualifierDescriptor(DThread* aThread,
 																 TDes8& aDeviceQualifierDescriptor)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETDEVICEQUALIFIERDESCRIPTOR, "DUsbClientController::GetDeviceQualifierDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetDeviceQualifierDescriptor()"));
 	return iDescriptors.GetDeviceQualifierDescriptorTC(aThread, aDeviceQualifierDescriptor);
 	}
 
@@ -1973,7 +1956,7 @@
 EXPORT_C TInt DUsbClientController::SetDeviceQualifierDescriptor(DThread* aThread,
 																 const TDes8& aDeviceQualifierDescriptor)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETDEVICEQUALIFIERDESCRIPTOR, "DUsbClientController::SetDeviceQualifierDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetDeviceQualifierDescriptor()"));
 	return iDescriptors.SetDeviceQualifierDescriptorTC(aThread, aDeviceQualifierDescriptor);
 	}
 
@@ -1992,7 +1975,7 @@
 EXPORT_C TInt DUsbClientController::GetOtherSpeedConfigurationDescriptor(DThread* aThread,
 																		 TDes8& aConfigurationDescriptor)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETOTHERSPEEDCONFIGURATIONDESCRIPTOR, "DUsbClientController::GetOtherSpeedConfigurationDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetOtherSpeedConfigurationDescriptor()"));
 	return iDescriptors.GetOtherSpeedConfigurationDescriptorTC(aThread, aConfigurationDescriptor);
 	}
 
@@ -2012,7 +1995,7 @@
 EXPORT_C TInt DUsbClientController::SetOtherSpeedConfigurationDescriptor(DThread* aThread,
 																		 const TDes8& aConfigurationDescriptor)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETOTHERSPEEDCONFIGURATIONDESCRIPTOR, "DUsbClientController::SetOtherSpeedConfigurationDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetOtherSpeedConfigurationDescriptor()"));
 	return iDescriptors.SetOtherSpeedConfigurationDescriptorTC(aThread, aConfigurationDescriptor);
 	}
 
@@ -2033,12 +2016,12 @@
 																  TInt aSettingNum,
 																  TDes8& aInterfaceDescriptor)
 	{
-	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_GETCSINTERFACEDESCRIPTORBLOCK, "DUsbClientController::GetCSInterfaceDescriptorBlock(x, 0x%08x, %d, y)",
-                                    (TUint)aClientId, aSettingNum);
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetCSInterfaceDescriptorBlock(x, 0x%08x, %d, y)",
+									aClientId, aSettingNum));
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETCSINTERFACEDESCRIPTORBLOCK_DUP1, "D  Error: Interface not found from client ID");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
 		return KErrNotFound;
 		}
 	return iDescriptors.GetCSInterfaceDescriptorTC(aThread, aInterfaceDescriptor, ifcset, aSettingNum);
@@ -2065,17 +2048,18 @@
 																  TInt aSettingNum,
 																  const TDes8& aInterfaceDescriptor, TInt aSize)
 	{
-	OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETCSINTERFACEDESCRIPTORBLOCK, "DUsbClientController::SetCSInterfaceDescriptorBlock(x, 0x%08x, %d, y, %d)",
-                              (TUint)aClientId, aSettingNum, aSize);
+	__KTRACE_OPT(KUSB,
+				 Kern::Printf("DUsbClientController::SetCSInterfaceDescriptorBlock(x, 0x%08x, %d, y, %d)",
+							  aClientId, aSettingNum, aSize));
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETCSINTERFACEDESCRIPTORBLOCK_DUP1, "  Error: Interface not found from client ID");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
 		return KErrNotFound;
 		}
 	if (aSize < 2)
 		{
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETCSINTERFACEDESCRIPTORBLOCK_DUP2, "  Error: aSize < 2 (%d)", aSize);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: aSize < 2 (%d)", aSize));
 		return KErrArgument;
 		}
 	return iDescriptors.SetCSInterfaceDescriptorTC(aThread, aInterfaceDescriptor, ifcset, aSettingNum, aSize);
@@ -2097,12 +2081,13 @@
 EXPORT_C TInt DUsbClientController::GetCSInterfaceDescriptorBlockSize(DThread* aThread, const DBase* aClientId,
 																	  TInt aSettingNum, TDes8& aSize)
 	{
-	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_GETCSINTERFACEDESCRIPTORBLOCKSIZE, "DUsbClientController::GetCSInterfaceDescriptorBlockSize(x, 0x%08x, %d, y)",
-                              (TUint)aClientId, aSettingNum);
+	__KTRACE_OPT(KUSB,
+				 Kern::Printf("DUsbClientController::GetCSInterfaceDescriptorBlockSize(x, 0x%08x, %d, y)",
+							  aClientId, aSettingNum));
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETCSINTERFACEDESCRIPTORBLOCKSIZE_DUP1, "  Error: Interface not found from client ID");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
 		return KErrNotFound;
 		}
 	TInt s;
@@ -2114,7 +2099,7 @@
 		}
 	else
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETCSINTERFACEDESCRIPTORBLOCKSIZE_DUP2, "  Error: cs interface descriptor not found");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: cs interface descriptor not found"));
 		}
 	return r;
 	}
@@ -2137,12 +2122,13 @@
 																 TInt aSettingNum, TInt aEndpointNum,
 																 TDes8& aEndpointDescriptor)
 	{
-	OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_GETCSENDPOINTDESCRIPTORBLOCK, "DUsbClientController::GetCSEndpointDescriptorBlock(x, 0x%08x, %d, %d, y)",
-                              (TUint)aClientId, aSettingNum, aEndpointNum);
+	__KTRACE_OPT(KUSB,
+				 Kern::Printf("DUsbClientController::GetCSEndpointDescriptorBlock(x, 0x%08x, %d, %d, y)",
+							  aClientId, aSettingNum, aEndpointNum));
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETCSENDPOINTDESCRIPTORBLOCK_DUP1, "  Error: Interface not found from client ID");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
 		return KErrNotFound;
 		}
 	return iDescriptors.GetCSEndpointDescriptorTC(aThread, aEndpointDescriptor, ifcset,
@@ -2171,17 +2157,18 @@
 																 TInt aSettingNum, TInt aEndpointNum,
 																 const TDes8& aEndpointDescriptor, TInt aSize)
 	{
-	OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETCSENDPOINTDESCRIPTORBLOCK, "DUsbClientController::SetCSEndpointDescriptorBlock(x, 0x%08x, %d, %d, y)",
-                              (TUint)aClientId, aSettingNum, aEndpointNum);
+	__KTRACE_OPT(KUSB,
+				 Kern::Printf("DUsbClientController::SetCSEndpointDescriptorBlock(x, 0x%08x, %d, %d, y)",
+							  aClientId, aSettingNum, aEndpointNum));
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETCSENDPOINTDESCRIPTORBLOCK_DUP1, "  Error: Interface not found from client ID");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
 		return KErrNotFound;
 		}
 	if (aSize < 2)
 		{
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETCSENDPOINTDESCRIPTORBLOCK_DUP2, "  Error: aSize < 2 (%d)", aSize);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: aSize < 2 (%d)", aSize));
 		return KErrArgument;
 		}
 	return iDescriptors.SetCSEndpointDescriptorTC(aThread, aEndpointDescriptor, ifcset,
@@ -2206,12 +2193,13 @@
 																	 TInt aSettingNum, TInt aEndpointNum,
 																	 TDes8& aSize)
 	{
-	OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_GETCSENDPOINTDESCRIPTORBLOCKSIZE, "DUsbClientController::GetCSEndpointDescriptorBlockSize(x, 0x%08x, %d, %d, y)",
-                              (TUint)aClientId, aSettingNum, aEndpointNum);
+	__KTRACE_OPT(KUSB,
+				 Kern::Printf("DUsbClientController::GetCSEndpointDescriptorBlockSize(x, 0x%08x, %d, %d, y)",
+							  aClientId, aSettingNum, aEndpointNum));
 	const TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	if (ifcset < 0)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETCSENDPOINTDESCRIPTORBLOCKSIZE_DUP1, "  Error: Interface not found from client ID");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Interface not found from client ID"));
 		return KErrNotFound;
 		}
 	TInt s;
@@ -2224,7 +2212,7 @@
 		}
 	else
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_GETCSENDPOINTDESCRIPTORBLOCKSIZE_DUP2, "  Error: cs endpoint descriptor not found");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: cs endpoint descriptor not found"));
 		}
 	return r;
 	}
@@ -2241,7 +2229,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetStringDescriptorLangId(DThread* aThread, TDes8& aLangId)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETSTRINGDESCRIPTORLANGID, "DUsbClientController::GetStringDescriptorLangId()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetStringDescriptorLangId()"));
 	return iDescriptors.GetStringDescriptorLangIdTC(aThread, aLangId);
 	}
 
@@ -2254,7 +2242,7 @@
 */
 EXPORT_C TInt DUsbClientController::SetStringDescriptorLangId(TUint16 aLangId)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETSTRINGDESCRIPTORLANGID, "DUsbClientController::SetStringDescriptorLangId()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetStringDescriptorLangId()"));
 	return iDescriptors.SetStringDescriptorLangId(aLangId);
 	}
 
@@ -2274,7 +2262,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetManufacturerStringDescriptor(DThread* aThread, TDes8& aString)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETMANUFACTURERSTRINGDESCRIPTOR, "DUsbClientController::GetManufacturerStringDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetManufacturerStringDescriptor()"));
 	return iDescriptors.GetManufacturerStringDescriptorTC(aThread, aString);
 	}
 
@@ -2295,7 +2283,7 @@
 */
 EXPORT_C TInt DUsbClientController::SetManufacturerStringDescriptor(DThread* aThread, const TDes8& aString)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETMANUFACTURERSTRINGDESCRIPTOR, "DUsbClientController::SetManufacturerStringDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetManufacturerStringDescriptor()"));
 	return iDescriptors.SetManufacturerStringDescriptorTC(aThread, aString);
 	}
 
@@ -2307,7 +2295,7 @@
 */
 EXPORT_C TInt DUsbClientController::RemoveManufacturerStringDescriptor()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_REMOVEMANUFACTURERSTRINGDESCRIPTOR, "DUsbClientController::RemoveManufacturerStringDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::RemoveManufacturerStringDescriptor()"));
 	return iDescriptors.RemoveManufacturerStringDescriptor();
 	}
 
@@ -2327,7 +2315,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetProductStringDescriptor(DThread* aThread, TDes8& aString)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETPRODUCTSTRINGDESCRIPTOR, "DUsbClientController::GetProductStringDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetProductStringDescriptor()"));
 	return iDescriptors.GetProductStringDescriptorTC(aThread, aString);
 	}
 
@@ -2348,7 +2336,7 @@
 */
 EXPORT_C TInt DUsbClientController::SetProductStringDescriptor(DThread* aThread, const TDes8& aString)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETPRODUCTSTRINGDESCRIPTOR, "DUsbClientController::SetProductStringDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetProductStringDescriptor()"));
 	return iDescriptors.SetProductStringDescriptorTC(aThread, aString);
 	}
 
@@ -2360,7 +2348,7 @@
 */
 EXPORT_C TInt DUsbClientController::RemoveProductStringDescriptor()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_REMOVEPRODUCTSTRINGDESCRIPTOR, "DUsbClientController::RemoveProductStringDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::RemoveProductStringDescriptor()"));
 	return iDescriptors.RemoveProductStringDescriptor();
 	}
 
@@ -2380,7 +2368,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetSerialNumberStringDescriptor(DThread* aThread, TDes8& aString)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETSERIALNUMBERSTRINGDESCRIPTOR, "DUsbClientController::GetSerialNumberStringDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetSerialNumberStringDescriptor()"));
 	return iDescriptors.GetSerialNumberStringDescriptorTC(aThread, aString);
 	}
 
@@ -2401,7 +2389,7 @@
 */
 EXPORT_C TInt DUsbClientController::SetSerialNumberStringDescriptor(DThread* aThread, const TDes8& aString)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETSERIALNUMBERSTRINGDESCRIPTOR, "DUsbClientController::SetSerialNumberStringDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetSerialNumberStringDescriptor()"));
 	return iDescriptors.SetSerialNumberStringDescriptorTC(aThread, aString);
 	}
 
@@ -2413,7 +2401,7 @@
 */
 EXPORT_C TInt DUsbClientController::RemoveSerialNumberStringDescriptor()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_REMOVESERIALNUMBERSTRINGDESCRIPTOR, "DUsbClientController::RemoveSerialNumberStringDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::RemoveSerialNumberStringDescriptor()"));
 	return iDescriptors.RemoveSerialNumberStringDescriptor();
 	}
 
@@ -2433,7 +2421,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetConfigurationStringDescriptor(DThread* aThread, TDes8& aString)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_GETCONFIGURATIONSTRINGDESCRIPTOR, "DUsbClientController::GetConfigurationStringDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetConfigurationStringDescriptor()"));
 	return iDescriptors.GetConfigurationStringDescriptorTC(aThread, aString);
 	}
 
@@ -2454,7 +2442,7 @@
 */
 EXPORT_C TInt DUsbClientController::SetConfigurationStringDescriptor(DThread* aThread, const TDes8& aString)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETCONFIGURATIONSTRINGDESCRIPTOR, "DUsbClientController::SetConfigurationStringDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetConfigurationStringDescriptor()"));
 	return iDescriptors.SetConfigurationStringDescriptorTC(aThread, aString);
 	}
 
@@ -2466,7 +2454,7 @@
 */
 EXPORT_C TInt DUsbClientController::RemoveConfigurationStringDescriptor()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_REMOVECONFIGURATIONSTRINGDESCRIPTOR, "DUsbClientController::RemoveConfigurationStringDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::RemoveConfigurationStringDescriptor()"));
 	return iDescriptors.RemoveConfigurationStringDescriptor();
 	}
 
@@ -2484,8 +2472,7 @@
 */
 EXPORT_C TInt DUsbClientController::GetStringDescriptor(DThread* aThread, TUint8 aIndex, TDes8& aString)
 	{
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_GETSTRINGDESCRIPTOR, "DUsbClientController::GetStringDescriptor(%d)", aIndex);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::GetStringDescriptor(%d)", aIndex));
 	return iDescriptors.GetStringDescriptorTC(aThread, aIndex, aString);
 	}
 
@@ -2504,8 +2491,7 @@
 */
 EXPORT_C TInt DUsbClientController::SetStringDescriptor(DThread* aThread, TUint8 aIndex, const TDes8& aString)
 	{
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETSTRINGDESCRIPTOR, "DUsbClientController::SetStringDescriptor(%d)", aIndex);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetStringDescriptor(%d)", aIndex));
 	return iDescriptors.SetStringDescriptorTC(aThread, aIndex, aString);
 	}
 
@@ -2518,8 +2504,7 @@
 */
 EXPORT_C TInt DUsbClientController::RemoveStringDescriptor(TUint8 aIndex)
 	{
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_REMOVESTRINGDESCRIPTOR, "DUsbClientController::RemoveStringDescriptor(%d)", aIndex);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::RemoveStringDescriptor(%d)", aIndex));
 	return iDescriptors.RemoveStringDescriptor(aIndex);
 	}
 
@@ -2540,7 +2525,7 @@
 EXPORT_C TInt DUsbClientController::AllocateEndpointResource(const DBase* /*aClientId*/, TInt aEndpointNum,
 															 TUsbcEndpointResource aResource)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_ALLOCATEENDPOINTRESOURCE, "DUsbClientController::AllocateEndpointResource()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::AllocateEndpointResource()"));
 	return AllocateEndpointResource(aEndpointNum, aResource);
 	}
 
@@ -2559,7 +2544,7 @@
 EXPORT_C TInt DUsbClientController::DeAllocateEndpointResource(const DBase* /*aClientId*/, TInt aEndpointNum,
 															   TUsbcEndpointResource aResource)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DEALLOCATEENDPOINTRESOURCE, "DUsbClientController::DeAllocateEndpointResource()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeAllocateEndpointResource()"));
 	return DeAllocateEndpointResource(aEndpointNum, aResource);
 	}
 
@@ -2579,19 +2564,20 @@
 EXPORT_C TBool DUsbClientController::QueryEndpointResource(const DBase* /*aClientId*/, TInt aEndpointNum,
 														   TUsbcEndpointResource aResource)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_QUERYENDPOINTRESOURCE, "DUsbClientController::QueryEndpointResource()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::QueryEndpointResource()"));
 	return QueryEndpointResource(aEndpointNum, aResource);
 	}
 
 
 EXPORT_C TInt DUsbClientController::EndpointPacketSize(const DBase* aClientId, TInt aEndpointNum)
 	{
-	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENDPOINTPACKETSIZE, "DUsbClientController::EndpointPacketSize(0x%08x, %d)",
-                                    (TUint)aClientId, aEndpointNum);
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::EndpointPacketSize(0x%08x, %d)",
+									aClientId, aEndpointNum));
+
 	const TUsbcInterfaceSet* const ifcset_ptr = ClientId2InterfacePointer(aClientId);
 	if (!ifcset_ptr)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_ENDPOINTPACKETSIZE_DUP1, "  Error: interface or clientid not found");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: interface or clientid not found"));
 		return -1;
 		}
 	const TUsbcInterface* const ifc_ptr = ifcset_ptr->iInterfaces[ifcset_ptr->iCurrentInterface];
@@ -2602,14 +2588,14 @@
 		const TUsbcLogicalEndpoint* const ep = ep_array[i];
 		if (EpAddr2Idx(ep->iPEndpoint->iEndpointAddr) == static_cast<TUint>(aEndpointNum))
 			{
-		    OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENDPOINTPACKETSIZE_DUP2, "  Endpoint packet sizes: FS = %d  HS = %d",
-                                            ep->iEpSize_Fs, ep->iEpSize_Hs);
+			__KTRACE_OPT(KUSB, Kern::Printf("  Endpoint packet sizes: FS = %d  HS = %d",
+											ep->iEpSize_Fs, ep->iEpSize_Hs));
 			const TInt size = iHighSpeed ? ep->iEpSize_Hs : ep->iEpSize_Fs;
-			OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENDPOINTPACKETSIZE_DUP3, "  Returning %d", size);
+			__KTRACE_OPT(KUSB, Kern::Printf("  Returning %d", size));
 			return size;
 			}
 		}
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_ENDPOINTPACKETSIZE_DUP4, "  Error: endpoint not found");
+	__KTRACE_OPT(KPANIC, Kern::Printf("  Error: endpoint not found"));
 	return -1;
 	}
 
@@ -2620,7 +2606,7 @@
 
 EXPORT_C TBool DUsbClientController::CurrentlyUsingHighSpeed()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_CURRENTLYUSINGHIGHSPEED, "DUsbClientController::CurrentlyUsingHighSpeed()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::CurrentlyUsingHighSpeed()"));
 	return EFalse;
 	}
 
@@ -2640,10 +2626,10 @@
 */
 DUsbClientController* DUsbClientController::RegisterUdc(TInt aUdc)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_REGISTERUDC, "DUsbClientController::RegisterUdc()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::RegisterUdc()"));
 	if (aUdc < 0 || aUdc > (KUsbcMaxUdcs - 1))
 		{
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_REGISTERUDC_DUP1, "  Error: aUdc out of range (%d)", aUdc);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: aUdc out of range (%d)", aUdc));
 		return NULL;
 		}
 	return UsbClientController[aUdc] = this;
@@ -2726,7 +2712,7 @@
 												TUsbcStringDescriptor* aConfig,
                                                 TUsbcOtgDescriptor* aOtgDesc)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_INITIALISEBASECLASS, "DUsbClientController::InitialiseBaseClass()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::InitialiseBaseClass()"));
 	// We don't want the host to see us (at least not yet):
 	UsbDisconnect();
 
@@ -2734,7 +2720,7 @@
 	if (iDescriptors.Init(aDeviceDesc, aConfigDesc, aLangId, aManufacturer, aProduct,
 						  aSerialNum, aConfig, aOtgDesc) !=	KErrNone)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP1, "  Error: Descriptor initialization failed");
+		__KTRACE_OPT(KUSB, Kern::Printf("  Error: Descriptor initialization failed"));
 		return EFalse;
 		}
 
@@ -2775,27 +2761,27 @@
 
 	// Initialise the array of physical endpoints
 	iDeviceTotalEndpoints = DeviceTotalEndpoints();
-    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP2, "  DeviceTotalEndpoints: %d", iDeviceTotalEndpoints);
+	__KTRACE_OPT(KUSB, Kern::Printf("  DeviceTotalEndpoints: %d", iDeviceTotalEndpoints));
 	// KUsbcMaxEndpoints doesn't include ep 0
 	if ((iDeviceTotalEndpoints > (KUsbcMaxEndpoints + 2)) ||
 		((iDeviceTotalEndpoints * sizeof(TUsbcPhysicalEndpoint)) > sizeof(iRealEndpoints)))
 		{
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP3, "  Error: too many endpoints! (change KUsbcMaxEndpoints: %d)",
-                                          KUsbcMaxEndpoints);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: too many endpoints! (change KUsbcMaxEndpoints: %d)",
+										  KUsbcMaxEndpoints));
 		goto exit_1;
 		}
 	caps = DeviceEndpointCaps();
 	for (TInt i = 0; i < iDeviceTotalEndpoints; ++i)
 		{
 		iRealEndpoints[i].iEndpointAddr = EpIdx2Addr(i);
-		OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP4, "  Caps[%02d] - iTypes: 0x%08x iSizes: 0x%08x",
-                                        i, caps[i].iTypesAndDir, caps[i].iSizes);
+		__KTRACE_OPT(KUSB, Kern::Printf("  Caps[%02d] - iTypes: 0x%08x iSizes: 0x%08x",
+										i, caps[i].iTypesAndDir, caps[i].iSizes));
 		iRealEndpoints[i].iCaps = caps[i];
 		iRealEndpoints[i].iCaps.iReserved[0] = 0;
 		iRealEndpoints[i].iCaps.iReserved[1] = 0;
 		if ((i > 1) && (caps[i].iTypesAndDir != KUsbEpNotAvailable))
 			{
-			OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP5, "  --> UsableEndpoint: #%d", i);
+			__KTRACE_OPT(KUSB, Kern::Printf("  --> UsableEndpoint: #%d", i));
 			iDeviceUsableEndpoints++;
 			}
 		}
@@ -2804,14 +2790,14 @@
 	// and virtual 0 is real 0):
 	// -- Ep0 OUT
 	iEp0MaxPacketSize = caps[0].MaxPacketSize();
-    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP6, "  using Ep0 maxpacketsize of %d bytes", iEp0MaxPacketSize);
+	__KTRACE_OPT(KUSB, Kern::Printf("  using Ep0 maxpacketsize of %d bytes", iEp0MaxPacketSize));
 	info.iSize = iEp0MaxPacketSize;
 	ep = new TUsbcLogicalEndpoint(this, 0, info, NULL, &iRealEndpoints[KEp0_Out]);
 	if (!ep)
 		{
 		goto exit_1;
 		}
-    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP7, "  creating ep: mapping real ep %d --> logical ep 0", KEp0_Out);
+	__KTRACE_OPT(KUSB, Kern::Printf("  creating ep: mapping real ep %d --> logical ep 0", KEp0_Out));
 	iRealEndpoints[KEp0_Out].iLEndpoint = ep;
 	// -- Ep0 IN
 	info.iDir = KUsbEpDirIn;
@@ -2820,7 +2806,7 @@
 		{
 		goto exit_2;
 		}
-    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP8, "  creating ep: mapping real ep %d --> logical ep 0", KEp0_In);
+	__KTRACE_OPT(KUSB, Kern::Printf("  creating ep: mapping real ep %d --> logical ep 0", KEp0_In));
 	iRealEndpoints[KEp0_In].iLEndpoint = ep;
 
 	// Create the power handler
@@ -2838,7 +2824,7 @@
 		// There shouldn't really be any PSL that doesn't support Device State
 		// tracking, but we cannot simply enforce it as we have to preserve
 		// backwards compatibility.
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_INITIALISEBASECLASS_DUP9, "  Warning: USB Device State tracking not supported by PSL");
+		__KTRACE_OPT(KUSB, Kern::Printf("  Warning: USB Device State tracking not supported by PSL"));
 		}
 
 	return ETrue;
@@ -2915,7 +2901,7 @@
 	  iDisablePullUpOnDPlus(NULL),
 	  iOtgContext(NULL)
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DUSBCLIENTCONTROLLER_CONS, "DUsbClientController::DUsbClientController()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DUsbClientController()"));
 
 #ifndef SEPARATE_USB_DFC_QUEUE
 	iPowerUpDfc.SetDfcQ(Kern::DfcQue0());
@@ -2941,7 +2927,7 @@
 */
 TInt DUsbClientController::DeviceEventNotification(TUsbcDeviceEvent anEvent)
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DEVICEEVENTNOTIFICATION, "DUsbClientController::DeviceEventNotification()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeviceEventNotification()"));
 
 	// This function may be called by the PSL from within an ISR -- so we have
 	// to take care what we do here (and also in all functions that get called
@@ -2975,8 +2961,8 @@
 */
 void DUsbClientController::EndpointRequestComplete(TUsbcRequestCallback* aCallback)
 	{
-	OstTraceDefExt1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENDPOINTREQUESTCOMPLETE, "DUsbClientController::EndpointRequestComplete(%p)", aCallback);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::EndpointRequestComplete(%p)", aCallback));
+
 	// This function may be called by the PSL from within an ISR -- so we have
 	// to take care what we do here (and also in all functions that get called
 	// from here).
@@ -3009,17 +2995,16 @@
 // This function is called by the PSL from within an ISR -- so we have to take care what we do here
 // (and also in all functions that get called from here).
 	{
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_HANDLEHNPREQUEST, "DUsbClientController::HandleHnpRequest(%d)", aHnpState);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::HandleHnpRequest(%d)", aHnpState));
 
 	if (!iOtgSupport)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_HANDLEHNPREQUEST_DUP1, "  Error: Request only supported on a OTG device");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Request only supported on a OTG device"));
 		return;
 		}
 	if (!(iOtgFuncMap & KUsbOtgAttr_HnpSupp))
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_HANDLEHNPREQUEST_DUP2, "  Error: Request only valid if OTG device supports HNP");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Request only valid if OTG device supports HNP"));
 		return;
 		}
 	//	(case KUsbFeature_B_HnpEnable:)
@@ -3059,8 +3044,8 @@
 */
 TInt DUsbClientController::Ep0RequestComplete(TInt aRealEndpoint, TInt aCount, TInt aError)
 	{
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EP0REQUESTCOMPLETE, "DUsbClientController::Ep0RequestComplete(%d)", aRealEndpoint);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::Ep0RequestComplete(%d)", aRealEndpoint));
+
 	// This function may be called by the PSL from within an ISR -- so we have
 	// to take care what we do here (and also in all functions that get called
 	// from here).
@@ -3068,17 +3053,16 @@
 	__ASSERT_DEBUG((aRealEndpoint < 2), Kern::Fault(KUsbPILPanicCat, __LINE__));
 	if (aError != KErrNone && aError != KErrPrematureEnd)
 		{
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EP0REQUESTCOMPLETE_DUP1, " Error: Ep0 request failed (code %d). "
-                                        "Setting up new Read request.", aError);
-
+		__KTRACE_OPT(KUSB, Kern::Printf(" Error: Ep0 request failed (code %d). "
+										"Setting up new Read request.", aError));
 		if (aRealEndpoint == KEp0_Rx)
 			{
-			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EP0REQUESTCOMPLETE_DUP2, " (RX request failed)");
+			__KTRACE_OPT(KUSB, Kern::Printf(" (RX request failed)"));
 			StallEndpoint(KEp0_Out);
 			}
 		else
 			{
-	        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EP0REQUESTCOMPLETE_DUP3, " (TX request failed)");
+			__KTRACE_OPT(KUSB, Kern::Printf(" (TX request failed)"));
 			iEp0WritePending = EFalse;
 			StallEndpoint(KEp0_In);
 			}
@@ -3106,7 +3090,7 @@
 		{
 		// we're done & no write request has been set up.
 		// so: setup an Ep0 read again
-        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EP0REQUESTCOMPLETE_DUP4, " Setting up new Ep0 read request.");
+		__KTRACE_OPT(KUSB, Kern::Printf(" Setting up new Ep0 read request."));
 		SetupEndpointZeroRead();
 		}
 	return r;
@@ -3119,7 +3103,7 @@
 */
 void DUsbClientController::MoveToAddressState()
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_MOVETOADDRESSSTATE, "DUsbClientController::MoveToAddressState()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::MoveToAddressState()"));
 
 	// This function may be called by the PSL from within an ISR -- so we have
 	// to take care what we do here (and also in all functions that get called
@@ -3140,8 +3124,8 @@
 */
 void DUsbClientController::SetCurrent(TInt aCurrent)
 	{
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_SETCURRENT, "DUsbClientController::SetCurrent(%d)", aCurrent);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetCurrent(%d)", aCurrent));
+
 	// Not much for the moment... (What should we do here?)
 	return;
 	}
@@ -3153,21 +3137,20 @@
 
 TInt DUsbClientController::OpenDmaChannel(TInt aRealEndpoint)
 	{
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_OPENDMACHANNEL, "DUsbClientController::OpenDmaChannel(%d)", aRealEndpoint);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::OpenDmaChannel(%d)", aRealEndpoint));
 	return KErrNone;
 	}
 
 
 void DUsbClientController::CloseDmaChannel(TInt aRealEndpoint)
 	{
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CLOSEDMACHANNEL, "DUsbClientController::CloseDmaChannel(%d)", aRealEndpoint);
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::CloseDmaChannel(%d)", aRealEndpoint));
 	}
 
 
 TBool DUsbClientController::CableDetectWithoutPowerCaps() const
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_CABLEDETECTWITHOUTPOWERCAPS, "DUsbClientController::CableDetectWithoutPowerCaps()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::CableDetectWithoutPowerCaps()"));
 	// Should be overridden in PSL if applicable.
 	return EFalse;
 	}
@@ -3175,7 +3158,7 @@
 
 TBool DUsbClientController::DeviceHighSpeedCaps() const
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DEVICEHIGHSPEEDCAPS, "DUsbClientController::DeviceHighSpeedCaps()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeviceHighSpeedCaps()"));
 	// Should be overridden in PSL if applicable.
 	return EFalse;
 	}
@@ -3183,7 +3166,7 @@
 
 TBool DUsbClientController::DeviceResourceAllocV2Caps() const
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DEVICERESOURCEALLOCV2CAPS, "DUsbClientController::DeviceResourceAllocV2Caps()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeviceResourceAllocV2Caps()"));
 	// Should be overridden in PSL if applicable.
 	return EFalse;
 	}
@@ -3191,7 +3174,7 @@
 
 TBool DUsbClientController::DeviceHnpHandledByHardwareCaps() const
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DEVICEHNPHANDLEDBYHARDWARECAPS, "DUsbClientController::DeviceHnpHandledByHardwareCaps()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeviceHnpHandledByHardwareCaps()"));
 	// Should be overridden in PSL if applicable.
 	return EFalse;
 	}
@@ -3199,8 +3182,7 @@
 
 TInt DUsbClientController::EnterTestMode(TInt aTestSelector)
 	{
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ENTERTESTMODE, "DUsbClientController::EnterTestMode(%d)", aTestSelector);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::EnterTestMode(%d)", aTestSelector));
 	// Should be overridden in PSL if applicable.
 	return KErrNotSupported;
 	}
@@ -3208,35 +3190,35 @@
 
 TBool DUsbClientController::PowerDownWhenActive() const
 	{
- 	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_POWERDOWNWHENACTIVE, "DUsbClientController::PowerDownWhenActive()" );
+ 	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::PowerDownWhenActive()"));
  	return EFalse;
 	}
 
 
 TInt DUsbClientController::PowerDown()
 	{
- 	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_POWERDOWN, "DUsbClientController::PowerDown()" );
+ 	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::PowerDown()"));
  	return KErrNone;
 	}
 
 
 TInt DUsbClientController::PowerUp()
 	{
- 	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_POWERUP, "DUsbClientController::PowerUp()" );
+ 	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::PowerUp()"));
  	return KErrNone;
 	}
 
 
 TInt DUsbClientController::OtgEnableUdc()
 	{
- 	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_OTGENABLEUDC, "DUsbClientController::OtgEnableUdc()" );
+ 	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::OtgEnableUdc()"));
  	return KErrNone;
 	}
 
 
 TInt DUsbClientController::OtgDisableUdc()
    	{
- 	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_OTGDISABLEUDC, "DUsbClientController::OtgDisableUdc()" );
+ 	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::OtgDisableUdc()"));
  	return KErrNone;
 	}
 
@@ -3247,18 +3229,18 @@
 
 TInt DUsbClientController::DeRegisterClientCallback(const DBase* aClientId)
     {
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DEREGISTERCLIENTCALLBACK, "DUsbClientController::DeRegisterClientCallback()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeRegisterClientCallback()"));
 	__ASSERT_DEBUG((aClientId != NULL), Kern::Fault(KUsbPILPanicCat, __LINE__));
 	TSglQueIter<TUsbcClientCallback> iter(iClientCallbacks);
 	TUsbcClientCallback* p;
 	while ((p = iter++) != NULL)
 		if (p->Owner() == aClientId)
 			{
-			 OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEREGISTERCLIENTCALLBACK_DUP1, "  removing ClientCallback @ 0x%x", p);
+			__KTRACE_OPT(KUSB, Kern::Printf("  removing ClientCallback @ 0x%x", p));
 			iClientCallbacks.Remove(*p);
 			return KErrNone;
 			}
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEREGISTERCLIENTCALLBACK_DUP2, "  Client not found");
+	__KTRACE_OPT(KUSB, Kern::Printf("  Client not found"));
 	return KErrNotFound;
     }
 
@@ -3267,28 +3249,28 @@
 												const TUsbcEndpointInfoArray& aEndpointData,
 												TInt aIfcNumber) const
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_CHECKEPAVAILABILITY, "DUsbClientController::CheckEpAvailability()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::CheckEpAvailability()"));
 	if (aEndpointsUsed > KMaxEndpointsPerClient)
 		{
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CHECKEPAVAILABILITY_DUP1, "  Error: too many endpoints claimed (%d)", aEndpointsUsed);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: too many endpoints claimed (%d)", aEndpointsUsed));
 		return EFalse;
 		}
 	TBool reserve[KUsbcEpArraySize]; // iDeviceTotalEndpoints can be equal to 32
 	memset(reserve, EFalse, sizeof(reserve));				// reset the array
 	for (TInt i = 0; i < aEndpointsUsed; ++i)
 		{
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHECKEPAVAILABILITY_DUP2, "  checking for (user) endpoint #%d availability...", i + 1);
+		__KTRACE_OPT(KUSB, Kern::Printf("  checking for (user) endpoint #%d availability...", i + 1));
 		TInt j = 2;
 		while (j < iDeviceTotalEndpoints)
 			{
 			if ((iRealEndpoints[j].EndpointSuitable(&aEndpointData[i], aIfcNumber)) &&
 				(reserve[j] == EFalse))
 				{
-		        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHECKEPAVAILABILITY_DUP3, "  ---> found suitable endpoint: RealEndpoint #%d", j);
+				__KTRACE_OPT(KUSB, Kern::Printf("  ---> found suitable endpoint: RealEndpoint #%d", j));
 				reserve[j] = ETrue;							// found one: mark this ep as reserved
 				break;
 				}
-            OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CHECKEPAVAILABILITY_DUP4, "  -> endpoint not suitable: RealEndpoint #%d", j);
+			__KTRACE_OPT(KUSB, Kern::Printf("  -> endpoint not suitable: RealEndpoint #%d", j));
 			j++;
 			}
 		if (j == iDeviceTotalEndpoints)
@@ -3305,8 +3287,7 @@
 // concurrent interfaces supported by the configuration."  But since we permit the user to
 // change interface numbers, we can neither assume nor enforce anything about them here.
 	{
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CREATEINTERFACE, "DUsbClientController::CreateInterface(x, aIfc=%d)", aIfc);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::CreateInterface(x, aIfc=%d)", aIfc));
 	TUsbcInterfaceSet* ifcset_ptr = NULL;
 	TInt ifcset = ClientId2InterfaceNumber(aClientId);
 	TBool new_ifc;
@@ -3317,7 +3298,7 @@
 		const TInt num_ifcsets = iConfigs[0]->iInterfaceSets.Count();
 		if (num_ifcsets == 255)
 			{
-			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP1, "  Error: Too many interfaces already exist: 255");
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Too many interfaces already exist: 255"));
 			return NULL;
 			}
 		// Find the smallest interface number that has not yet been used.
@@ -3328,7 +3309,7 @@
 				{
 				if ((iConfigs[0]->iInterfaceSets[i]->iInterfaceNumber) == ifcset)
 					{
-			        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP2, "  interface number %d already used", ifcset);
+					__KTRACE_OPT(KUSB, Kern::Printf("  interface number %d already used", ifcset));
 					n_used = ETrue;
 					break;
 					}
@@ -3340,19 +3321,20 @@
 			}
 		if (ifcset == 256)
 			{
-            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP3, "  Error: no available interface number found");
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no available interface number found"));
 			return NULL;
 			}
 		// append the ifcset
-        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP4, "  creating new InterfaceSet %d first", ifcset);
+		__KTRACE_OPT(KUSB, Kern::Printf("  creating new InterfaceSet %d first", ifcset));
 		if (aIfc != 0)
 			{
-	        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP5, "  Error: invalid interface setting number (1): %d", aIfc);
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: invalid interface setting number (1): %d", aIfc));
 			return NULL;
 			}
 		if ((ifcset_ptr = new TUsbcInterfaceSet(aClientId, ifcset)) == NULL)
 			{
-			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP6, "  Error: new TUsbcInterfaceSet(aClientId, ifcset_num) failed");
+			__KTRACE_OPT(KPANIC,
+						 Kern::Printf("  Error: new TUsbcInterfaceSet(aClientId, ifcset_num) failed"));
 			return NULL;
 			}
 		iConfigs[0]->iInterfaceSets.Append(ifcset_ptr);
@@ -3361,20 +3343,20 @@
 		{
 		// use an existent ifcset
 		new_ifc = EFalse;
-        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP7, "  using existing InterfaceSet %d", ifcset);
+		__KTRACE_OPT(KUSB, Kern::Printf("  using existing InterfaceSet %d", ifcset));
 		ifcset_ptr = InterfaceNumber2InterfacePointer(ifcset);
 		if (aIfc != ifcset_ptr->iInterfaces.Count())
 			{
 			// 9.2.3: "Alternate settings range from zero to one less than the number of alternate
 			// settings for a specific interface." (Thus we can here only append a setting.)
-	        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP8, "  Error: invalid interface setting number (2): %d", aIfc);
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: invalid interface setting number (2): %d", aIfc));
 			return NULL;
 			}
 		// Check whether the existing interface belongs indeed to this client
 		if (ifcset_ptr->iClientId != aClientId)
 			{
-	        OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP9, "  Error: iClientId (%p) != aClientId (%p)",
-                                              ifcset_ptr->iClientId, aClientId);
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: iClientId (%p) != aClientId (%p)",
+											  ifcset_ptr->iClientId, aClientId));
 			return NULL;
 			}
 		}
@@ -3382,7 +3364,7 @@
 	TUsbcInterface* const ifc_ptr = new TUsbcInterface(ifcset_ptr, aIfc, no_ep0_requests);
 	if (!ifc_ptr)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEINTERFACE_DUP10, "  Error: new TUsbcInterface(ifcset, aIfc) failed");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: new TUsbcInterface(ifcset, aIfc) failed"));
 		if (new_ifc)
 			{
 			DeleteInterfaceSet(ifcset);
@@ -3405,7 +3387,7 @@
 										   const TUsbcEndpointInfoArray& aEndpointData,
 										   TInt aRealEpNumbers[])
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_CREATEENDPOINTS, "DUsbClientController::CreateEndpoints()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::CreateEndpoints()"));
 	const TInt ifc_num = aIfc->iInterfaceSet->iInterfaceNumber;
 	const TInt start_ep = 2;
 	for (TInt i = 0; i < aEndpointsUsed; ++i)
@@ -3419,7 +3401,7 @@
 																		  aIfc, &iRealEndpoints[j]);
 				if (!ep)
 					{
-					OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP1, "  Error: new TUsbcLogicalEndpoint() failed");
+					__KTRACE_OPT(KPANIC, Kern::Printf("  Error: new TUsbcLogicalEndpoint() failed"));
 					aIfc->iEndpoints.ResetAndDestroy();
 					RESET_SETTINGRESERVE;
 					return KErrNoMemory;
@@ -3431,16 +3413,16 @@
 					// For details see last paragraph of 5.7.3 "Interrupt Transfer Packet Size Constraints".
 					if ((ep->iInfo.iType == KUsbEpTypeInterrupt) && (ep->iEpSize_Hs > 64))
 						{
-		                OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP2, "  Warning: INT ep HS size = %d on default ifc setting",
-                                                          ep->iEpSize_Hs);
-		                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP3, "           (should be <= 64)");
+						__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: INT ep HS size = %d on default ifc setting",
+														  ep->iEpSize_Hs));
+						__KTRACE_OPT(KPANIC, Kern::Printf("           (should be <= 64)"));
 						}
 					// For details see last paragraph of 5.6.3 "Isochronous Transfer Packet Size Constraints".
 					else if ((ep->iInfo.iType == KUsbEpTypeIsochronous) && (ep->iInfo.iSize > 0))
 						{
-						OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP4, " Warning: ISO ep size = %d on default ifc setting",
-                                                          ep->iInfo.iSize);
-						OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP5, "           (should be zero or ep non-existent)");
+						__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: ISO ep size = %d on default ifc setting",
+														  ep->iInfo.iSize));
+						__KTRACE_OPT(KPANIC, Kern::Printf("           (should be zero or ep non-existent)"));
 						}
 					}
 				// If the endpoint doesn't support DMA (now or never) the next operation
@@ -3448,21 +3430,23 @@
 				const TInt r = OpenDmaChannel(j);
 				if (r != KErrNone)
 					{
-                    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP6, "  Error: Opening of DMA channel failed");
+					__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Opening of DMA channel failed"));
 					aIfc->iEndpoints.ResetAndDestroy();
 					RESET_SETTINGRESERVE;
 					return r;
 					}
-				OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP7, "  creating ep: mapping real ep %d -> logical ep %d",
-                                                j, i + 1);
+				__KTRACE_OPT(KUSB, Kern::Printf("  creating ep: mapping real ep %d -> logical ep %d",
+												j, i + 1));
 				iRealEndpoints[j].iIfcNumber = &aIfc->iInterfaceSet->iInterfaceNumber;
 				iRealEndpoints[j].iSettingReserve = ETrue;
-				OstTraceDefExt4(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP8, "  ep->iInfo: iType=0x%x iDir=0x%x iSize=%d iInterval=%d",
-                                          ep->iInfo.iType, ep->iInfo.iDir, ep->iInfo.iSize,
-                                          ep->iInfo.iInterval);
-				OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP9, "  ep->iInfo: iInterval_Hs=%d iTransactions=%d iExtra=%d",
-                                          ep->iInfo.iInterval_Hs, ep->iInfo.iTransactions,
-                                          ep->iInfo.iExtra);
+				__KTRACE_OPT(KUSB,
+							 Kern::Printf("  ep->iInfo: iType=0x%x iDir=0x%x iSize=%d iInterval=%d",
+										  ep->iInfo.iType, ep->iInfo.iDir, ep->iInfo.iSize,
+										  ep->iInfo.iInterval));
+				__KTRACE_OPT(KUSB,
+							 Kern::Printf("  ep->iInfo: iInterval_Hs=%d iTransactions=%d iExtra=%d",
+										  ep->iInfo.iInterval_Hs, ep->iInfo.iTransactions,
+										  ep->iInfo.iExtra));
 				// Store real endpoint numbers:
 				// array[x] holds the number for logical ep x.
 				aRealEpNumbers[i + 1] = j;
@@ -3471,12 +3455,12 @@
 			}
 		}
 	aRealEpNumbers[0] = 0;								// ep0: 0.
-	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP10, "  Endpoint Mapping for Interface %d / Setting %d:", ifc_num, aIfc->iSettingCode); 
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP11, "Logical  | Real");
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP12, "Endpoint | Endpoint");
-    for (TInt ep = 0; ep <= aEndpointsUsed; ++ep)
-        OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CREATEENDPOINTS_DUP13, "   %2d       %3d",ep, aRealEpNumbers[ep]);
-
+	__KTRACE_OPT(KUSB,{
+		Kern::Printf("  Endpoint Mapping for Interface %d / Setting %d:", ifc_num, aIfc->iSettingCode);
+		Kern::Printf("Logical  | Real");
+		Kern::Printf("Endpoint | Endpoint");
+		for (TInt ep = 0; ep <= aEndpointsUsed; ++ep) Kern::Printf("   %2d       %3d",ep, aRealEpNumbers[ep]);
+		});
 	RESET_SETTINGRESERVE;
 	return KErrNone;
 	}
@@ -3485,7 +3469,7 @@
 TInt DUsbClientController::SetupIfcDescriptor(TUsbcInterface* aIfc, TUsbcClassInfo& aClass, DThread* aThread,
 											  TDesC8* aString, const TUsbcEndpointInfoArray& aEndpointData)
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR, "DUsbClientController::SetupIfcDescriptor()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::SetupIfcDescriptor()"));
 
 	// Interface descriptor
 	TUsbcDescriptorBase* d = TUsbcInterfaceDescriptor::New(aIfc->iInterfaceSet->iInterfaceNumber,
@@ -3494,7 +3478,7 @@
 														   aClass);
 	if (!d)
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP1, "  Error: Memory allocation for ifc desc failed." );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Memory allocation for ifc desc failed."));
 		return KErrNoMemory;
 		}
 	iDescriptors.InsertDescriptor(d);
@@ -3506,13 +3490,13 @@
 		TUint strlen = Kern::ThreadGetDesLength(aThread, aString);
 		if (strlen > KUsbStringDescStringMaxSize)
 			{
-		    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP2, "  Warning: $ descriptor too long - string will be truncated" );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Warning: $ descriptor too long - string will be truncated"));
 			strlen = KUsbStringDescStringMaxSize;
 			}
 		HBuf8* const stringbuf = HBuf8::New(strlen);
 		if (!stringbuf)
 			{
-	        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP3, "  Error: Memory allocation for ifc $ desc string failed." );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Memory allocation for ifc $ desc string failed."));
 			iDescriptors.DeleteIfcDescriptor(aIfc->iInterfaceSet->iInterfaceNumber,
 											 aIfc->iSettingCode);
 			return KErrNoMemory;
@@ -3522,7 +3506,7 @@
 		TInt r = Kern::ThreadDesRead(aThread, aString, *stringbuf, 0);
 		if (r != KErrNone)
 			{
-	         OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP4, "  Error: Thread read error" );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Thread read error"));
 			iDescriptors.DeleteIfcDescriptor(aIfc->iInterfaceSet->iInterfaceNumber,
 											 aIfc->iSettingCode);
 			delete stringbuf;
@@ -3531,7 +3515,7 @@
 		TUsbcStringDescriptor* const sd = TUsbcStringDescriptor::New(*stringbuf);
 		if (!sd)
 			{
-	        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP5, "  Error: Memory allocation for ifc $ desc failed." );
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Memory allocation for ifc $ desc failed."));
 			iDescriptors.DeleteIfcDescriptor(aIfc->iInterfaceSet->iInterfaceNumber,
 											 aIfc->iSettingCode);
 			delete stringbuf;
@@ -3555,8 +3539,8 @@
 			if (aEndpointData[i].iExtra != 2)
 				{
 				// ...then it must be a Audio Class endpoint descriptor. Else...
-				OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP6, "  Error: EP desc extension > 2 bytes (%d)",
-                                                  aEndpointData[i].iExtra);
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: EP desc extension > 2 bytes (%d)",
+												  aEndpointData[i].iExtra));
 				iDescriptors.DeleteIfcDescriptor(aIfc->iInterfaceSet->iInterfaceNumber,
 												 aIfc->iSettingCode);
 				return KErrArgument;
@@ -3571,7 +3555,7 @@
 			}
 		if (!d)
 			{
-			OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_SETUPIFCDESCRIPTOR_DUP7, "  Error: Memory allocation for ep desc #%d failed.", i);
+			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Memory allocation for ep desc #%d failed.", i));
 			iDescriptors.DeleteIfcDescriptor(aIfc->iInterfaceSet->iInterfaceNumber,
 											 aIfc->iSettingCode);
 			return KErrNoMemory;
@@ -3637,23 +3621,23 @@
 
 TInt DUsbClientController::ActivateHardwareController()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_ACTIVATEHARDWARECONTROLLER, "DUsbClientController::ActivateHardwareController()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ActivateHardwareController()"));
 	if (iHardwareActivated)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ACTIVATEHARDWARECONTROLLER_DUP1, "  already active -> returning" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  already active -> returning"));
 		return KErrNone;
 		}
 	// Initialise HW
 	TInt r = StartUdc();
 	if (r != KErrNone)
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_ACTIVATEHARDWARECONTROLLER_DUP2, "  Error: StartUdc() failed" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: StartUdc() failed"));
 		return KErrHardwareNotAvailable;
 		}
 	r = OtgEnableUdc();							   // turn on UDC (OTG flavour)
 	if (r != KErrNone)
 		{
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_ACTIVATEHARDWARECONTROLLER_DUP3, "  Error: OtgEnableUdc() failed: %d", r);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: OtgEnableUdc() failed: %d", r));
 		}
 	iHardwareActivated = ETrue;
 
@@ -3674,7 +3658,7 @@
 	ConfigureEndpoint(1, ep0_1->iInfo);
 	iEp0MaxPacketSize = ep0_0->iInfo.iSize;
 
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_ACTIVATEHARDWARECONTROLLER_DUP4, "  Controller activated.");
+	__KTRACE_OPT(KUSB, Kern::Printf("  Controller activated."));
 	if (UsbConnectionStatus())
 		{
 		if (iDeviceState == EUsbcDeviceStateUndefined)
@@ -3689,10 +3673,10 @@
 
 void DUsbClientController::DeActivateHardwareController()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DEACTIVATEHARDWARECONTROLLER, "DUsbClientController::DeActivateHardwareController()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeActivateHardwareController()"));
 	if (!iHardwareActivated)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEACTIVATEHARDWARECONTROLLER_DUP1, "  not active -> returning" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  not active -> returning"));
 		return;
 		}
 	// Deconfigure & disable endpoint zero
@@ -3702,11 +3686,11 @@
 	TInt r = OtgDisableUdc();					  // turn off UDC (OTG flavour)
 	if (r != KErrNone)
 		{
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_DEACTIVATEHARDWARECONTROLLER_DUP2, "  Error: OtgDisableUdc() failed: %d", r);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: OtgDisableUdc() failed: %d", r));
 		}
 	StopUdc();
 	iHardwareActivated = EFalse;
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DEACTIVATEHARDWARECONTROLLER_DUP3, "  Controller deactivated.");
+	__KTRACE_OPT(KUSB, Kern::Printf("  Controller deactivated."));
 	if (UsbConnectionStatus())
 		{
 		NextDeviceState(EUsbcDeviceStateAttached);
@@ -3717,18 +3701,17 @@
 
 void DUsbClientController::DeleteInterfaceSet(TInt aIfcSet)
 	{
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DELETEINTERFACESET, "DUsbClientController::DeleteInterfaceSet(%d)", aIfcSet);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeleteInterfaceSet(%d)", aIfcSet));
 	TUsbcInterfaceSet* const ifcset_ptr = InterfaceNumber2InterfacePointer(aIfcSet);
 	if (!ifcset_ptr)
 		{
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_DELETEINTERFACESET_DUP1, "  Error: invalid interface number: %d", aIfcSet);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: invalid interface number: %d", aIfcSet));
 		return;
 		}
 	const TInt idx = iConfigs[0]->iInterfaceSets.Find(ifcset_ptr);
 	if (idx == KErrNotFound)
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_DELETEINTERFACESET_DUP2, "  Error: interface not found in array");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: interface not found in array"));
 		return;
 		}
 	//Add this mutex to protect the interface set data structure
@@ -3748,17 +3731,16 @@
 
 void DUsbClientController::DeleteInterface(TInt aIfcSet, TInt aIfc)
 	{
-	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DELETEINTERFACE, "DUsbClientController::DeleteInterface(%d, %d)", aIfcSet, aIfc);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeleteInterface(%d, %d)", aIfcSet, aIfc));
 	TUsbcInterfaceSet* const ifcset_ptr = InterfaceNumber2InterfacePointer(aIfcSet);
 	if (!ifcset_ptr)
 		{
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_DELETEINTERFACE_DUP1, " Error: invalid interface number: %d", aIfcSet);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: invalid interface number: %d", aIfcSet));
 		return;
 		}
 	if (ifcset_ptr->iInterfaces.Count() <= aIfc)
 		{
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_DELETEINTERFACE_DUP2, "  Error: invalid interface setting: %d", aIfc);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: invalid interface setting: %d", aIfc));
 		return;
 		}
 	//Add this mutex to protect the interface set data structure
@@ -3772,7 +3754,7 @@
 
 	if (aIfc == ifcset_ptr->iCurrentInterface)
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DELETEINTERFACE_DUP3, " > Warning: deleting current interface setting");
+		__KTRACE_OPT(KUSB, Kern::Printf(" > Warning: deleting current interface setting"));
 		ifcset_ptr->iCurrentInterface = 0;
 		}
 	if (NKern::CurrentContext() == EThread)
@@ -3785,9 +3767,8 @@
 
 void DUsbClientController::CancelTransferRequests(TInt aRealEndpoint)
 	{
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_CANCELTRANSFERREQUESTS, "DUsbClientController::CancelTransferRequests(aRealEndpoint=%d)",
-                                    aRealEndpoint);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::CancelTransferRequests(aRealEndpoint=%d)",
+									aRealEndpoint));
 	const DBase* const clientId = PEndpoint2ClientId(aRealEndpoint);
 	if (EpIdx2Addr(aRealEndpoint) & KUsbEpAddress_In)
 		{
@@ -3803,7 +3784,7 @@
 void DUsbClientController::DeleteRequestCallback(const DBase* aClientId, TInt aEndpointNum,
 												 TTransferDirection aTransferDir)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACK, "DUsbClientController::DeleteRequestCallback()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeleteRequestCallback()"));
 	// Ep0 OUT
 	if (aEndpointNum == 0)
 		{
@@ -3816,7 +3797,7 @@
 				{
 				__ASSERT_DEBUG((p->iRealEpNum == 0), Kern::Fault(KUsbPILPanicCat, __LINE__));
 				__ASSERT_DEBUG((p->iTransferDir == EControllerRead), Kern::Fault(KUsbPILPanicCat, __LINE__));
-			    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACK_DUP1, "  removing RequestCallback @ 0x%x (ep0)", p);
+				__KTRACE_OPT(KUSB, Kern::Printf("  removing RequestCallback @ 0x%x (ep0)", p));
 				iEp0ReadRequestCallbacks.Remove(*p);
 				}
 			}
@@ -3829,7 +3810,7 @@
 		{
  		__ASSERT_DEBUG((p->Owner() == aClientId), Kern::Fault(KUsbPILPanicCat, __LINE__));
 		__ASSERT_DEBUG((p->iTransferDir == aTransferDir), Kern::Fault(KUsbPILPanicCat, __LINE__));
-        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACK_DUP2, "  removing RequestCallback @ 0x%x", p);
+		__KTRACE_OPT(KUSB, Kern::Printf("  removing RequestCallback @ 0x%x", p));
 		iRequestCallbacks[aEndpointNum] = NULL;
 		}
 	}
@@ -3838,7 +3819,7 @@
 void DUsbClientController::DeleteRequestCallbacks(const DBase* aClientId)
 	{
 	// aClientId being NULL means: delete all requests for *all* clients.
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACKS, "DUsbClientController::DeleteRequestCallbacks()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::DeleteRequestCallbacks()"));
 	// Ep0 OUT
     const TInt irq = __SPIN_LOCK_IRQSAVE(iUsbLock);
 	TSglQueIter<TUsbcRequestCallback> iter(iEp0ReadRequestCallbacks);
@@ -3847,7 +3828,7 @@
 		{
 		if (!aClientId || p->Owner() == aClientId)
 			{
-			 OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACKS_DUP1, "  removing RequestCallback @ 0x%x (ep0)", p);
+			__KTRACE_OPT(KUSB, Kern::Printf("  removing RequestCallback @ 0x%x (ep0)", p));
 			iEp0ReadRequestCallbacks.Remove(*p);
 			}
 		}
@@ -3858,7 +3839,7 @@
 		TUsbcRequestCallback* const p = iRequestCallbacks[i];
 		if (p && (!aClientId || p->Owner() == aClientId))
 			{
-	        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_DELETEREQUESTCALLBACKS_DUP2, "  removing RequestCallback @ 0x%x", p);
+			__KTRACE_OPT(KUSB, Kern::Printf("  removing RequestCallback @ 0x%x", p));
 			iRequestCallbacks[i] = NULL;
 			}
 		}
@@ -3867,7 +3848,7 @@
 
 void DUsbClientController::StatusNotify(TUsbcDeviceState aState, const DBase* aClientId)
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_STATUSNOTIFY, "DUsbClientController::StatusNotify()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::StatusNotify()"));
 
 	// This function may be called by the PSL (via chapter9.cpp) from within an
 	// ISR -- so we have to take care what we do here (and also in all
@@ -3879,7 +3860,7 @@
 		{
 		if (!aClientId || aClientId == p->Owner())
 			{
-		    OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_STATUSNOTIFY_DUP1, "  notifying LDD @ 0x%x about %d", (TUint)p->Owner(), (TUint)aState);
+			__KTRACE_OPT(KUSB, Kern::Printf("  notifying LDD @ 0x%x about %d", p->Owner(), aState));
 			p->SetState(aState);
 			p->DoCallback();
 			}
@@ -3889,7 +3870,7 @@
 
 void DUsbClientController::EpStatusNotify(TInt aRealEndpoint)
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY, "DUsbClientController::EpStatusNotify()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::EpStatusNotify()"));
 
 	// This function may be called by the PSL (via chapter9.cpp) from within an
 	// ISR -- so we have to take care what we do here (and also in all
@@ -3898,7 +3879,7 @@
 	const DBase* const client_id = PEndpoint2ClientId(aRealEndpoint);
 	if (!client_id)
 		{
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP1, "  Error: Client not found for real ep %d", aRealEndpoint);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Client not found for real ep %d", aRealEndpoint));
 		return;
 		}
 	// Check if there is a notification request queued for that client (if not, we can return here).
@@ -3913,25 +3894,25 @@
 		}
 	if (!p)
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP2, "  No notification request for that client, returning");
+		__KTRACE_OPT(KUSB, Kern::Printf("  No notification request for that client, returning"));
 		return;
 		}
 	const TInt ifcset = ClientId2InterfaceNumber(client_id);
 	if (ifcset < 0)
 		{
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP3, "  Error: Ifcset not found for clientid %d", client_id);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Ifcset not found for clientid %d", client_id));
 		return;
 		}
 	const TUsbcInterfaceSet* const ifcset_ptr = InterfaceNumber2InterfacePointer(ifcset);
 	if (!ifcset_ptr)
 		{
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP4, "  Error: Ifcset pointer not found for ifcset %d", ifcset);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Ifcset pointer not found for ifcset %d", ifcset));
 		return;
 		}
 	const TUsbcInterface* const ifc_ptr = ifcset_ptr->CurrentInterface();
 	if (!ifc_ptr)
 		{
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP5, "  Error: Current ifc pointer not found for ifcset %d", ifcset);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Current ifc pointer not found for ifcset %d", ifcset));
 		return;
 		}
 	TUint state = 0;
@@ -3939,20 +3920,20 @@
 	for (TInt i = 0; i < eps; i++)
 		{
 		const TUsbcLogicalEndpoint* const ep_ptr = ifc_ptr->iEndpoints[i];
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP6, "  checking logical ep #%d for stall state...",
-                                        ep_ptr->iLEndpointNum);
+		__KTRACE_OPT(KUSB, Kern::Printf("  checking logical ep #%d for stall state...",
+										ep_ptr->iLEndpointNum));
 		if (ep_ptr->iPEndpoint->iHalt)
 			{
-			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP7, "  -- stalled");
+			__KTRACE_OPT(KUSB, Kern::Printf("  -- stalled"));
 			// set the bit n to 1, where n is the logical endpoint number minus one
 			state |= (1 << (ep_ptr->iLEndpointNum - 1));
 			}
 		else
 			{
-	        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP8, "  -- not stalled");
+			__KTRACE_OPT(KUSB, Kern::Printf("  -- not stalled"));
 			}
 		}
-    OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EPSTATUSNOTIFY_DUP9, " passing ep state 0x%x on to LDD @ 0x%x", (TUint)state, (TUint)client_id);
+	__KTRACE_OPT(KUSB, Kern::Printf(" passing ep state 0x%x on to LDD @ 0x%x", state, client_id));
 	p->SetState(state);
 	p->DoCallback();
 	}
@@ -3960,7 +3941,7 @@
 
 void DUsbClientController::OtgFeaturesNotify()
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_OTGFEATURESNOTIFY, "DUsbClientController::OtgFeaturesNotify()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::OtgFeaturesNotify()"));
 
 	// This function may be called from the PSL (via PIL's chapter9.cpp) from
 	// within an ISR -- so we have to take care what we do here (and also in
@@ -3978,12 +3959,12 @@
 
 void DUsbClientController::RunClientCallbacks()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_RUNCLIENTCALLBACKS, "DUsbClientController::RunClientCallbacks()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::RunClientCallbacks()"));
 	TSglQueIter<TUsbcClientCallback> iter(iClientCallbacks);
 	TUsbcClientCallback* p;
 	while ((p = iter++) != NULL)
 		{
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_RUNCLIENTCALLBACKS_DUP1, "Callback 0x%x", p);
+		__KTRACE_OPT(KUSB, Kern::Printf("Callback 0x%x", p));
 		p->DoCallback();
 		}
 	}
@@ -3991,7 +3972,7 @@
 
 void DUsbClientController::ProcessDataTransferDone(TUsbcRequestCallback& aRcb)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSDATATRANSFERDONE, "DUsbClientController::ProcessDataTransferDone()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessDataTransferDone()"));
 	// This piece can only be called in thread context from ProcessEp0DataReceived() /
 	// ProcessEp0SetupReceived() via the call to ProcessEp0ReceiveDone() in
 	// SetupReadBuffer(), which is guarded by an interrupt lock.
@@ -4012,7 +3993,7 @@
 	if (ep > 0)												// not 'else'!
 		{
 		__ASSERT_DEBUG((iRequestCallbacks[ep] == &aRcb), Kern::Fault(KUsbPILPanicCat, __LINE__));
-		OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSDATATRANSFERDONE_DUP1, " > removing RequestCallback[%d] @ 0x%x", ep, (TUint)&aRcb);
+		__KTRACE_OPT(KUSB, Kern::Printf(" > removing RequestCallback[%d] @ 0x%x", ep, &aRcb));
 		iRequestCallbacks[ep] = NULL;
 		}
 	aRcb.DoCallback();
@@ -4021,21 +4002,18 @@
 
 void DUsbClientController::NextDeviceState(TUsbcDeviceState aNextState)
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_NEXTDEVICESTATE, "DUsbClientController::NextDeviceState()" );
-    
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::NextDeviceState()"));
 #ifdef _DEBUG
-#ifdef OST_TRACE_COMPILER_IN_USE
 	const char* const states[] = {"Undefined", "Attached", "Powered", "Default",
 								  "Address", "Configured", "Suspended"};
-#endif
 	if ((aNextState >= EUsbcDeviceStateUndefined) &&
 		(aNextState <= EUsbcDeviceStateSuspended))
 		{
-	    OstTraceDefExt1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_NEXTDEVICESTATE_DUP1, "  next device state: %s", states[aNextState]);
+		__KTRACE_OPT(KUSB, Kern::Printf("  next device state: %s", states[aNextState]));
 		}
 	else
 		{
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_NEXTDEVICESTATE_DUP2, "  Error: Unknown next device state: %d", aNextState);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Unknown next device state: %d", aNextState));
 		}
 	// Print a warning when an invalid state transition is detected
 	// 'Undefined' is not a state that is mentioned in the USB spec, but
@@ -4098,12 +4076,12 @@
 			break;
 		goto OK;
 	default:
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_NEXTDEVICESTATE_DUP3, "  Error: Unknown current device state: %d", iDeviceState);
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Unknown current device state: %d", iDeviceState));
 		goto OK;
 		}
 	// KUSB only (instead of KPANIC) so as not to worry people too much where
 	// a particular h/w regularly enforces invalid (but harmless) transitions
-    OstTraceDefExt1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_NEXTDEVICESTATE_DUP4, "  Warning: Invalid next state from %s", states[iDeviceState]);
+	__KTRACE_OPT(KUSB, Kern::Printf("  Warning: Invalid next state from %s", states[iDeviceState]));
 OK:
 #endif // _DEBUG
 
@@ -4114,7 +4092,7 @@
 
 TInt DUsbClientController::ProcessSuspendEvent()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSSUSPENDEVENT, "DUsbClientController::ProcessSuspendEvent()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessSuspendEvent()"));
 	// A suspend interrupt has been received and needs attention.
 	iDeviceStateB4Suspend = iDeviceState;
 	// We have to move to the Suspend state immediately (in case it's a genuine Suspend)
@@ -4138,11 +4116,11 @@
 //
 TInt DUsbClientController::ProcessSuspendEventProceed()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSSUSPENDEVENTPROCEED, "DUsbClientController::ProcessSuspendEventProceed()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessSuspendEventProceed()"));
 	if (!UsbConnectionStatus())
 		{
 		// If we are no longer connected to the bus, we go into Undefined state (from Suspend).
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSSUSPENDEVENTPROCEED_DUP1, " > USB cable detached" );
+		__KTRACE_OPT(KUSB, Kern::Printf(" > USB cable detached"));
 		NextDeviceState(EUsbcDeviceStateUndefined);
 		}
 	return KErrNone;
@@ -4151,7 +4129,7 @@
 
 TInt DUsbClientController::ProcessResumeEvent()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSRESUMEEVENT, "DUsbClientController::ProcessResumeEvent()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessResumeEvent()"));
 	iCableStatusTimer.Cancel();
 	if (iDeviceState == EUsbcDeviceStateSuspended)
 		{
@@ -4164,7 +4142,7 @@
 
 TInt DUsbClientController::ProcessResetEvent(TBool aPslUpcall)
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSRESETEVENT, "DUsbClientController::ProcessResetEvent()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessResetEvent()"));
 
 	if (aPslUpcall)
 		{
@@ -4172,16 +4150,17 @@
 		// Also, do it always, even when PIL processing will be deferred.
 		Reset();
 		}
+
 #ifdef USB_OTG_CLIENT
 	if (iUsbResetDeferred) // implies (iOtgHnpHandledByHw == ETrue)
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSRESETEVENT_DUP1, "  User-side (still) not ready -> returning" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  User-side (still) not ready -> returning"));
 		return KErrNone;
 		}
 	else if (iOtgHnpHandledByHw && !iClientSupportReady)
 		{
 		// Wait with the PIL Reset processing until user-side is ready
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSRESETEVENT_DUP2, "  User-side not ready -> deferring" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  User-side not ready -> deferring"));
 		iUsbResetDeferred = ETrue;
 		return KErrNone;
 		}
@@ -4216,19 +4195,19 @@
 	iHighSpeed = CurrentlyUsingHighSpeed();
 	if (!was_hs && iHighSpeed)
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSRESETEVENT_DUP3, "  Moving to High-speed" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  Moving to High-speed"));
 		EnterHighSpeed();
 		}
 	else if (was_hs && !iHighSpeed)
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_PROCESSRESETEVENT_DUP4, "  Moving to Full-speed" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  Moving to Full-speed"));
 		EnterFullSpeed();
 		}
 
 	// Setup initial Ep0 read (SetupEndpointZeroRead never called from thread)
 	if (SetupEndpointZeroRead() != KErrNone)
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSRESETEVENT_DUP5, "  Error: while setting up Ep0 read" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: while setting up Ep0 read"));
 		return KErrGeneral;
 		}
 
@@ -4238,10 +4217,9 @@
 
 TInt DUsbClientController::ProcessCableInsertEvent()
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSCABLEINSERTEVENT, "DUsbClientController::ProcessCableInsertEvent()" );
-    
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessCableInsertEvent()"));
 #ifdef USB_OTG_CLIENT
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSCABLEINSERTEVENT_DUP1, "  Error: EUsbEventCableInsert shouldn't be sent by an OTG Client PSL" );
+	__KTRACE_OPT(KPANIC, Kern::Printf("  Error: EUsbEventCableInsert shouldn't be sent by an OTG Client PSL"));
 	return KErrArgument;
 #else
 	NextDeviceState(EUsbcDeviceStateAttached);
@@ -4256,9 +4234,9 @@
 
 TInt DUsbClientController::ProcessCableRemoveEvent()
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_PROCESSCABLEREMOVEEVENT, "DUsbClientController::ProcessCableRemoveEvent()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ProcessCableRemoveEvent()"));
 #ifdef USB_OTG_CLIENT
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_PROCESSCABLEREMOVEEVENT_DUP1, "  Error: EUsbEventCableRemoved shouldn't be sent by an OTG Client PSL" );
+	__KTRACE_OPT(KPANIC, Kern::Printf("  Error: EUsbEventCableRemoved shouldn't be sent by an OTG Client PSL"));
 	return KErrArgument;
 #else
 	// Tear down the current configuration (if any)
@@ -4271,14 +4249,14 @@
 
 void DUsbClientController::EnterFullSpeed()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_ENTERFULLSPEED, "DUsbClientController::EnterFullSpeed()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::EnterFullSpeed()"));
 	iDescriptors.UpdateDescriptorsFs();
 	}
 
 
 void DUsbClientController::EnterHighSpeed()
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_ENTERHIGHSPEED, "DUsbClientController::EnterHighSpeed()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::EnterHighSpeed()"));
 	iDescriptors.UpdateDescriptorsHs();
 	}
 
@@ -4288,7 +4266,7 @@
 //
 TInt DUsbClientController::EvaluateOtgConnectFlags()
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS, "DUsbClientController::EvaluateOtgConnectFlags()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::EvaluateOtgConnectFlags()"));
 
 	TInt r = KErrNone;
 
@@ -4303,7 +4281,7 @@
 	else
 		{
 		// certain h/w: handles HNP connect/disconnect automatically
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP1, "  HNP-handling h/w: only considering user-side readiness" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  HNP-handling h/w: only considering user-side readiness"));
 		enableDPlus = iClientSupportReady;
 		}
 
@@ -4315,7 +4293,7 @@
 	// There has been a changed requirement that must be serviced...
 	if (enableDPlus)
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP2, "  calling (*iEnablePullUpOnDPlus)()" );
+		__KTRACE_OPT(KUSB, Kern::Printf("  calling (*iEnablePullUpOnDPlus)()"));
 		if (iEnablePullUpOnDPlus != NULL)
 			{
 			iDPlusEnabled = enableDPlus;
@@ -4343,12 +4321,12 @@
 			r = (*iEnablePullUpOnDPlus)(iOtgContext);
 			if (r != KErrNone)
 				{
-		        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP3, "  Error: iEnablePullUpOnDPlus() = %d", r);
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: iEnablePullUpOnDPlus() = %d", r));
 				}
 			}
 		else
 			{
-            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP4, "  Warning: iEnablePullUpOnDPlus pointer not ready");
+			__KTRACE_OPT(KUSB, Kern::Printf("  Warning: iEnablePullUpOnDPlus pointer not ready"));
 			// We cannot enforce the presence of the pointer (via an ASSERT)
 			// since it might only be available at a later point.
 			// We shouldn't return an error at this point either, since the
@@ -4357,19 +4335,19 @@
 		}
 	else
 		{
-        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP5, "  calling (*iDisablePullUpOnDPlus)()");
+		__KTRACE_OPT(KUSB, Kern::Printf("  calling (*iDisablePullUpOnDPlus)()"));
 		if (iDisablePullUpOnDPlus != NULL)
 			{
 			iDPlusEnabled = enableDPlus;
 			r = (*iDisablePullUpOnDPlus)(iOtgContext);
 			if (r != KErrNone)
 				{
-		        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP6, "  Error: iDisablePullUpOnDPlus() = %d", r);
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: iDisablePullUpOnDPlus() = %d", r));
 				}
 			}
 		else
 			{
-            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_EVALUATEOTGCONNECTFLAGS_DUP7, "  Warning: iDisablePullUpOnDPlus pointer not ready");
+			__KTRACE_OPT(KUSB, Kern::Printf("  Warning: iDisablePullUpOnDPlus pointer not ready"));
 			// We cannot enforce the presence of the pointer (via an ASSERT)
 			// since it might only be available at a later point.
 			// We shouldn't return an error at this point either, since the
@@ -4385,10 +4363,10 @@
 //
 void DUsbClientController::ReconnectTimerCallback(TAny *aPtr)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_RECONNECTTIMERCALLBACK, "DUsbClientController::ReconnectTimerCallback()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::ReconnectTimerCallback()"));
 	if (!aPtr)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_RECONNECTTIMERCALLBACK_DUP1, "  Error: !aPtr");
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: !aPtr"));
 		return;
 		}
 	DUsbClientController* const ptr = static_cast<DUsbClientController*>(aPtr);
@@ -4401,10 +4379,10 @@
 //
 void DUsbClientController::CableStatusTimerCallback(TAny *aPtr)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_CABLESTATUSTIMERCALLBACK, "DUsbClientController::CableStatusTimerCallback()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::CableStatusTimerCallback()"));
 	if (!aPtr)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_CABLESTATUSTIMERCALLBACK_DUP1, "  Error: !aPtr" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: !aPtr"));
 		return;
 		}
 	DUsbClientController* const ptr = static_cast<DUsbClientController*>(aPtr);
@@ -4417,10 +4395,10 @@
 //
 void DUsbClientController::PowerUpDfc(TAny* aPtr)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_POWERUPDFC, "DUsbClientController::PowerUpDfc" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::PowerUpDfc"));
 	if (!aPtr)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_POWERUPDFC_DUP1, "   Error: !aPtr" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("	 Error: !aPtr"));
 		return;
 		}
 	DUsbClientController* const ptr = static_cast<DUsbClientController*>(aPtr);
@@ -4436,10 +4414,10 @@
 //
 void DUsbClientController::PowerDownDfc(TAny* aPtr)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DUSBCLIENTCONTROLLER_POWERDOWNDFC, "DUsbClientController::PowerDownDfc" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DUsbClientController::PowerDownDfc"));
 	if (!aPtr)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCLIENTCONTROLLER_POWERDOWNDFC_DUP1, "    Error: !aPtr" );
+		__KTRACE_OPT(KPANIC, Kern::Printf("	 Error: !aPtr"));
 		return;
 		}
 	DUsbClientController* const ptr = static_cast<DUsbClientController*>(aPtr);
@@ -4449,13 +4427,13 @@
 	if (!ptr->iHardwareActivated || ptr->PowerDownWhenActive())
 		{
 		(void) ptr->PowerDown();
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_POWERDOWNDFC_DUP2, "Calling PowerHandler->PowerDownDone()" );
+		__KTRACE_OPT(KUSB, Kern::Printf("Calling PowerHandler->PowerDownDone()"));
 		ptr->iPowerHandler->PowerDownDone();
 		}
 	else
 		{
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_POWERDOWNDFC_DUP3, "Not calling PowerHandler->PowerDownDone()" );
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DUSBCLIENTCONTROLLER_POWERDOWNDFC_DUP4, "  because UDC is active." );
+		__KTRACE_OPT(KUSB, Kern::Printf("Not calling PowerHandler->PowerDownDone()"));
+		__KTRACE_OPT(KUSB, Kern::Printf("  because UDC is active."));
 		}
 	}
 
--- a/kernel/eka/drivers/usbcc/queue.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/usbcc/queue.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -23,11 +23,6 @@
 */
 
 #include <drivers/usbc.h>
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "queueTraces.h"
-#endif
-
 
 
 void TSglQueLink::Enque(TSglQueLink* aLink)
@@ -91,8 +86,7 @@
 		pN = pP->iNext;
 		}
 	// This doesn't have to indicate an error (but might):
-	OstTraceDef0( OST_TRACE_CATEGORY_RND, TRACE_FATAL, TSGLQUEBASE_DOREMOVE, 
-	        "TSglQueBase::DoRemove: ESQueLinkNotQueued" );
+	__KTRACE_OPT(KPANIC, Kern::Printf("TSglQueBase::DoRemove: ESQueLinkNotQueued"));
 	}
 
 
--- a/kernel/eka/drivers/usbcsc/d_usbcsc.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/usbcsc/d_usbcsc.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -21,13 +21,9 @@
  @file d_usbcsc.cpp
  @internalTechnology
 */
+
 #include <drivers/usbcsc.h>
 #include "platform.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "d_usbcscTraces.h"
-#endif
-
 
 /*****************************************************************************\
 *   DUsbcScLogDevice                                                          *
@@ -71,8 +67,7 @@
 	// Only proceed if we have the Controller underneath us
 	if (!DUsbClientController::UsbcControllerPointer())
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DUSBCSCLOGDEVICE_INSTALL, "LDD Install: USB Controller Not Present" );
-		
+		__KTRACE_OPT(KPANIC, Kern::Printf("LDD Install: USB Controller Not Present"));
 		return KErrGeneral;
 		}
 	return SetName(&KUsbScLddName);
@@ -103,6 +98,7 @@
 
 TUsbcScChunkInfo::TUsbcScChunkInfo(DLogicalDevice* aLdd)
 	: 	iChunk(NULL),
+		iCleanup((TDfcFn)&DfcChunkCleanup,this,Kern::SvMsgQue(),0),
 		iChunkMem(NULL),
 		iLdd(aLdd)
 	{
@@ -125,7 +121,7 @@
 		chunkInfo.iMaxSize = aTotalSize;
 		chunkInfo.iMapAttr = EMapAttrCachedMax;
 		chunkInfo.iOwnsMemory = EFalse;
-		chunkInfo.iDestroyedDfc = NULL;
+		chunkInfo.iDestroyedDfc = &iCleanup;
 
 		TLinAddr chunkMem;
 		r = Kern::ChunkCreate(chunkInfo, iChunk, chunkMem, iChunkMapAttr);
@@ -142,13 +138,7 @@
 // Note that nothing may happen immediately, as something else may have the chunk open.
 void TUsbcScChunkInfo::Close()
 {
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCCHUNKINFO_CLOSE, "TUsbcScChunkInfo::Close %d", iChunk->AccessCount());
-	if (Kern::ChunkClose(iChunk))
-        {
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCCHUNKINFO_CLOSE_DUP1, "TUsbcScChunkInfo::Close1");
-        ChunkCleanup();    
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCCHUNKINFO_CLOSE_DUP2, "TUsbcScChunkInfo::Close2");
-        }
+	Kern::ChunkClose(iChunk);	
 }
 
 
@@ -160,18 +150,17 @@
 	TInt r;
 	TLinAddr physAddr;
 
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCCHUNKINFO_CHUNKALLOC, "::chunkalloc  AllocPhysicalRam aSize %d", aSize);
+	__KTRACE_OPT(KUSB, Kern::Printf("::chunkalloc  AllocPhysicalRam aSize %d", aSize));
 
 	r = Epoc::AllocPhysicalRam(aSize, physAddr);
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCCHUNKINFO_CHUNKALLOC_DUP1, "::chunkalloc AllocPhysicalRam r=%d  (Error!)", r);
-	
+	__KTRACE_OPT(KUSB, if (r!=KErrNone) Kern::Printf("::chunkalloc AllocPhysicalRam r=%d  (Error!)", r));
 	if (r==KErrNone)
 		{	
-		OstTraceDefExt5(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCCHUNKINFO_CHUNKALLOC_DUP2, "T::chunkalloc ChunkCommitPhysical iChunk 0x%x size(%d), aOffset 0x%x, aSize 0x%x phsAddr 0x%x", (TUint)iChunk, sizeof(DChunk), aOffset, aSize,(TUint)physAddr);
+		__KTRACE_OPT(KUSB, Kern::Printf("::chunkalloc ChunkCommitPhysical iChunk 0x%x size(%d), aOffset 0x%x, aSize 0x%x phsAddr 0x%x",
+																	 				iChunk, sizeof(DChunk), aOffset, aSize,physAddr ));
+
 		r = Kern::ChunkCommitPhysical(iChunk, aOffset, aSize, physAddr);
-		if (r!=KErrNone)
-		    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCCHUNKINFO_CHUNKALLOC_DUP3, "::chunkalloc ChunkCommitPhysical r=%d  (Error!)", r);
-		
+		__KTRACE_OPT(KUSB, if (r!=KErrNone) Kern::Printf("::chunkalloc ChunkCommitPhysical r=%d  (Error!)", r));
 
 		if (r!=KErrNone)
 				Epoc::FreePhysicalRam(physAddr, aSize);
@@ -181,8 +170,8 @@
 			TInt i=0;
 			for (rle=(aSize>>iPageNtz); rle>0; rle--, i++,physAddr+=pageSize) 
 				{
-	            OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCCHUNKINFO_CHUNKALLOC_DUP4, "::phys offset 0x%x = 0x%x",
-                                                (TInt32)((aOffset>>iPageNtz)+i), (TUint32)( (physAddr & pageMask) | ((rle>(TInt)rleMask)?(TInt)rleMask:rle)));
+				__KTRACE_OPT(KUSB, Kern::Printf("::phys offset 0x%x = 0x%x",
+												(aOffset>>iPageNtz)+i,  (physAddr & pageMask) | ((rle>(TInt)rleMask)?(TInt)rleMask:rle)));
 				iPhysicalMap[(aOffset>>iPageNtz)+i] = (physAddr & pageMask) | ((rle>(TInt)rleMask)?(TInt)rleMask:rle);
 				}
 			}
@@ -223,8 +212,7 @@
 
 void TUsbcScChunkInfo::ChunkCleanup()
 {
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSCCHUNKINFO_CHUNKCLEANUP, "TUsbcScChunkInfo::ChunkCleanup()" );
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScChunkInfo::ChunkCleanup()"));
 	TUint physAddr;
 	TInt length;
 	TInt offset = 0;
@@ -255,8 +243,8 @@
 
 TInt TUsbcScChunkInfo::New(TUsbcScChunkInfo*& aChunk, TInt aSize, DLogicalDevice* aLdd)
 {
-    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCCHUNKINFO_NEW, "TUsbcScChunkInfo::New totalSize %d", aSize);
-    
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScChunkInfo::New totalSize %d", aSize));
+
 	aChunk = new TUsbcScChunkInfo(aLdd);
 	if (aChunk==NULL)
 		{
@@ -271,8 +259,7 @@
 		return r;
 		}
 
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCCHUNKINFO_NEW_DUP1, "TUsbcScChunkInfo::New Created at 0x%x", aChunk->iChunkMem);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScChunkInfo::New Created at 0x%x",  aChunk->iChunkMem  ));
 	return KErrNone;
 }
 
@@ -349,24 +336,12 @@
 		iBufferStart->iHead= iHead;
 		iBufferStart->iTail= iHead; // Initially no data!
 		iBufferStart->iBilTail=iHead;
-		OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_CREATECHUNKBUFFERHEADER, "Realize:  iHead 0x%x  bufferHeader 0x%x", iHead,(TUint)iBufferStart);
+		__KTRACE_OPT(KUSB, Kern::Printf("Realize:  iHead 0x%x  bufferHeader 0x%x", iHead,iBufferStart ));
+
 		// Dont need to round here, as we will round it up on endpoint change. (configuration)
 		}
 }
 
-
-TBool TUsbcScBuffer::IsRequestPending()
-	{
-		return iStatusList.IsRequestPending();
-	}
-
-TBool TUsbcScStatusList::IsRequestPending()
-	{
-		return (iLength != 0);
-	}
-
-
-
 /*
 TUsbcScBuffer::StartEndpoint
 
@@ -375,18 +350,16 @@
 */
 void TUsbcScBuffer::StartEndpoint(TUsbcRequestCallback* aRequestInfo, TUint aFlags)
 	{
-	OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTENDPOINT, "TUsbcScBuffer::StartEndpoint (0x%x) : ep %d(%d)", (TUint)this,aRequestInfo->iEndpointNum, aRequestInfo->iRealEpNum);
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::StartEndpoint (0x%x) : ep %d(%d)",this,aRequestInfo->iEndpointNum, aRequestInfo->iRealEpNum));
 	
 	iCallback=aRequestInfo;
 	iMaxPacketSize =  iLdd->iController->EndpointPacketSize(iLdd, aRequestInfo->iRealEpNum);
 	iAlignMask = ~(((iMaxPacketSize+1) & 0xFFFFFFF8)-1);
 	iMode = aFlags;
-	OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTENDPOINT_DUP1, "TUsbcScBuffer::StartEndpoint : max Packets %d, mask 0x%x flags 0x%x", iMaxPacketSize, iAlignMask, (TUint)iMode);
-	
+    __KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::StartEndpoint : max Packets %d, mask 0x%x flags 0x%x", iMaxPacketSize, iAlignMask, iMode));
 	if ((iDirection&1)==KUsbcScOut)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTENDPOINT_DUP2, "TUsbcScBuffer::UsbcScOut\n" );
-		
+		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::UsbcScOut\n"));
 		// Add dummy packet (doesnt have to be aligned, which avoids what if it changes issue)
 		// And Start next read.
 		iNeedsPacket=KEpIsStarting;
@@ -397,8 +370,7 @@
 
 void TUsbcScBuffer::Destroy()
 {
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSCBUFFER_DESTROY, "TUsbcScBuffer::Destroy()" );
-    
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::Destroy()"));
 	Cancel(KErrCancel);
 	if (iLdd->iController && ((iDirection&1)==KUsbcScOut))  
 		{  // Me must cancel reads to LDD to, an there will be no list for the callbacks to look into.
@@ -413,14 +385,12 @@
 {
 	if (!iMaxPacketSize)
 	{
-        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTDATAREAD, "TUsbcScBuffer::StartDataRead() - Not Configured" );
-	
+		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::StartDataRead() - Not Configured"));
 		return KErrNone;
 	}
 	if (iStatusList.iState!=ENotRunning) 
 		{
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTDATAREAD_DUP1, "TUsbcScBuffer::StartDataRead() - Already Stated! (%d)", iStatusList.iState );
-	    
+		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::StartDataRead() - Already Stated! (%d)",iStatusList.iState));
 		return KErrNone;
 		}
 
@@ -432,8 +402,7 @@
 	TUsbcScStatusElement* nextJob = iStatusList.Next();
 	if (nextJob == NULL)
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTDATAREAD_DUP2, "No more jobs");
-		
+		__KTRACE_OPT(KUSB, Kern::Printf("No more jobs"));
 		if (iMode && KUsbScCoupledRead)
 			return KErrEof;
 		iStatusList.iState=EReadingAhead;
@@ -444,20 +413,20 @@
 	TInt tail = iBufferStart->iTail;
 	TInt headerSize =  sizeof(TUsbcScTransferHeader)-4; // TransferHeader includes 4 bytes of data.
 	maxLength = iChunkInfo->GetPhysical(iHead + headerSize, &physAddr); //returns all the bytes available after iHead + headerSize)
+
 	__ASSERT_DEBUG(maxLength>0,Kern::Fault("TUsbcScBuffer::StartDataRead(", __LINE__)); 
 
 
 	if (tail>iHead)  //  # # # H _ _ _ T # # # #
 		{
-        OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTDATAREAD_DUP3, "TUsbcScBuffer::StartDataRead() - tail 0x%x>head 0x%x, maxlength 0x%x", (TUint)tail, iHead, maxLength);
-        
+		__KTRACE_OPT(KUSB,Kern::Printf("TUsbcScBuffer::StartDataRead() - tail 0x%x>head 0x%x, maxlength 0x%x", tail, iHead, maxLength));
+
 		freeSpace = (tail & iAlignMask) - (iHead +headerSize + (~iAlignMask+1) );  // Cant read right up to last buffer, or head/tail will cross.
 
 		if (freeSpace<iMinReadSize)
 			{
 			iStatusList.iState=ENotRunning;
-			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTDATAREAD_DUP4, "TUsbcScBuffer::StartDataRead() - Stall!!");
-			
+			__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::StartDataRead() - Stall!!"));
 			return KErrOverflow; 				// Read STALL !! !! !!
 			}
 
@@ -468,6 +437,7 @@
 		maxLength =  iMaxReadSize;
 	// else  tail<iHead (or empty)      _ _ _ T # # # H _ _ _ _
 	// We would not have set iHead here if too small. So must be ok.
+		
 	__ASSERT_DEBUG(maxLength>=iMinReadSize,Kern::Fault("TUsbcScBuffer::StartDataRead(", __LINE__)); 
 
 	TUint8* data = ((TUsbcScTransferHeader *) (iHead + iChunkAddr))->iData.b;
@@ -479,7 +449,7 @@
 	r = iLdd->iController->SetupReadBuffer(*iCallback);
 	if (r!=KErrNone)
 		{
-	    OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTDATAREAD_DUP5, "SetupReadBuffer Error: %d, RT %d",r, iStatusList.iState);
+		__KTRACE_OPT(KUSB,Kern::Printf("SetupReadBuffer Error: %d, RT %d",r, iStatusList.iState));
 		iStatusList.Complete(r);
 		}
 	// After this, TUsbcScEndpoint::RequestCallback is called in a DFC.
@@ -490,8 +460,8 @@
 
 void TUsbcScBuffer::CompleteRead(TBool aStartNextRead)
 {
-    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_COMPLETEREAD, "TUsbcScBuffer::CompleteRead buff=%x",this);
-    
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::CompleteRead buff=%x",this));
+
     // The first packet always contains the total #of bytes
 	const TInt byteCount = iCallback->iPacketSize[0];
 	const TInt packetCount = iCallback->iRxPackets;
@@ -510,11 +480,12 @@
 void TUsbcScBuffer::UpdateBufferList(TInt aByteCount,TUint aFlags, TBool aStartNextRead)
 	{
 
-    OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_UPDATEBUFFERLIST, "TUsbcScBuffer::UpdateBUfferLIst aByteCount %d, flags 0x%x iHead 0x%x", aByteCount, aFlags, (TUint)iHead);
-    
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::UpdateBUfferLIst aByteCount %d, flags 0x%x iHead 0x%x", aByteCount, aFlags, iHead));
+
 	TInt headerSize =  sizeof(TUsbcScTransferHeader)-4; // TransferHeader includes 4 bytes of data.
 	TLinAddr dummy;
-	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP1, "iHead 0x%x headerSize 0x%x",iHead, headerSize);
+	__KTRACE_OPT(KUSB, Kern::Printf("iHead 0x%x headerSize 0x%x",iHead, headerSize));
+
 	// Find iNext
 
 	TInt next =  iHead +  headerSize + aByteCount; // next unused byte in buffer.
@@ -527,8 +498,7 @@
 		next = (next + headerSize + ~iAlignMask) & iAlignMask;
 		maxLength = iChunkInfo->GetPhysical(next, &dummy);
 
-		OstTraceDefExt4(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP2, "TUsbcScBuffer::UpdateBUfferLIst  next %x  buffer end %x min-read: %x  maxRun %x", next, iBufferEnd, (TUint)iMinReadSize, (TUint)maxLength);
-		    
+		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::UpdateBUfferLIst  next %x  buffer end %x min-read: %x  maxRun %x", next, iBufferEnd, iMinReadSize, maxLength));
 		// At the end of the buffer - wrap it if needbe.
 		if ((TUint)(next + iMinReadSize) > iBufferEnd)
 			{
@@ -539,15 +509,14 @@
 		if (maxLength<iMinReadSize) 
 			{
 			next+=maxLength;
-			OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP3, "TUsbcScBuffer::UpdateBUfferLIst Skip exhausted block. next %x max %d", next, maxLength);
-			        
+			__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::UpdateBUfferLIst Skip exhausted block. next %x max %d", next, maxLength));
 			continue;
 			}
 		}
 	while (EFalse);
 
-	OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP4, "TUsbcScBuffer::UpdateBUfferLIst next (pre deduct): %x, Fill in header at head: 0x%x,  BuffStart: 0x%x.", next, (TUint)iHead, (TUint)iBufferStart);
-	              
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::UpdateBUfferLIst next (pre deduct): %x, Fill in header at head: 0x%x,  BuffStart: 0x%x.", next, iHead, iBufferStart));
+	
 	next -=  headerSize;  // Move next back from the data start position, to the header start.
 
 	TUsbcScTransferHeader* header = (TUsbcScTransferHeader*) (iHead + iChunkAddr);
@@ -563,8 +532,8 @@
 	header->iAltSettingSeq=iLdd->iAsSeq;
 	header->iAltSetting=iLdd->iAlternateSetting;
 	header->iFlags=aFlags;
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP5, "We set next to 0x%x", next);
-	       
+	__KTRACE_OPT(KUSB, Kern::Printf("We set next to 0x%x", next));
+
 	iStatusList.iState=ENotRunning;
 	if (next==iBufferStart->iTail) //or (othwise is as good as full)
 		{
@@ -573,7 +542,7 @@
 	else
 		{
 
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP6, "TUsbcScBuffer::UpdateBUfferLIst StartRead?? ");
+		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::UpdateBUfferLIst StartRead?? "));
 		TInt oldHead=iHead;
 		iHead = next;
 
@@ -595,8 +564,7 @@
 		else
 			{
 			iBufferStart->iHead = next;
-			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP7, "TUsbcScBuffer::UpdateBUfferLIst Compleating\n");
-			        
+			__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::UpdateBUfferLIst Compleating\n"));
 			}
 		// Complete userside
 		iStatusList.Complete();
@@ -620,8 +588,7 @@
 
 	if (StartDataRead() == KErrOverflow)
 	{
-        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_POPSTALL, "TUsbcScBuffer::PopStall Warning: Transfer was freed, but still no space!\n");
-        
+		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::PopStall Warning: Transfer was freed, but still no space!\n"));
 	}
 
 	iBufferStart->iHead = iHead;
@@ -632,8 +599,7 @@
 void TUsbcScBuffer::StartDataWrite()
 	{
 	
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSCBUFFER_STARTDATAWRITE, "TUsbcScBuffer::StartDataWrite()");
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::StartDataWrite()"));
 	TUsbcScStatusElement* nextJob = iStatusList.Next();
 	TBool zlpReqd;
 	TInt length;
@@ -644,16 +610,16 @@
 	TInt r;
 	if (!iMaxPacketSize)
 	{
-        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTDATAWRITE_DUP1, "TUsbcScBuffer::StartDataWrite() - Not Configured");
+		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::StartDataWrite() - Not Configured"));
 		return;
 	}
 
 	if (nextJob == NULL)
 		{
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTDATAWRITE_DUP2, "TUsbcScBuffer::StartDataWrite() - No more jobs d=%d", iDirection);
+		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::StartDataWrite() - No more jobs d=%d", iDirection));
 		if (iDirection==KUsbcScBiIn) // assume this is EP0, if this is true.
 			{
-            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTDATAWRITE_DUP3, "TUsbcScBuffer::StartDataWrite() Queue Read on EP0.");
+			__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::StartDataWrite() Queue Read on EP0."));	
 			// Start other read again.
 			iLdd->iBuffers[iLdd->iEP0OutBuff].StartDataRead();
 			}
@@ -694,8 +660,7 @@
 		r = iLdd->iController->SetupWriteBuffer(*iCallback);
 		if (r!=KErrNone)
 			{
-			OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_STARTDATAWRITE_DUP4, "SetupWriteBUffer Error: %d",r);
-			            
+			__KTRACE_OPT(KUSB, Kern::Printf("SetupWriteBUffer Error: %d",r));
 			iStatusList.Complete(r);
 			}
 		}
@@ -705,7 +670,7 @@
 void TUsbcScBuffer::CompleteWrite()
 	{
 	TInt error = iCallback->iError;
-	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_COMPLETEWRITE, "TUsbcScBuffer::CompleteWrite buff=%x, err=%d",(TUint)this, error);
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::CompleteWrite buff=%x, err=%d",this, error));
 	iSent+= iCallback->iTxBytes;
 
 	// More to send?
@@ -755,8 +720,8 @@
 
 void TUsbcScBuffer::SendEp0StatusPacket(TInt aState)
 {
-    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCBUFFER_SENDEP0STATUSPACKET, " TUsbcScBuffer::SendEp0StatusPacket(%d)", aState);
-    
+	__KTRACE_OPT(KUSB, Kern::Printf(" TUsbcScBuffer::SendEp0StatusPacket(%d)", aState));
+
 	// We need to add a packet to the buffer, so we must stop the pending read, and start
 	// another after we have added out packet.  
 	Ep0CancelLddRead();
@@ -825,8 +790,7 @@
 
 TInt TUsbcScStatusList ::Add(TRequestStatus* aStatus, TInt aLength, TUint aStart, TUint aFlags)
 	{
-    OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCSTATUSLIST_ADD, "Adding request.  iLength %d  iSize %d", iLength, iSize);
-    
+	__KTRACE_OPT(KUSB,Kern::Printf("Adding request.  iLength %d  iSize %d", iLength, iSize));
 	if (iLength<iSize)
 		{
 		TUsbcScStatusElement& e = iElements[((iHead+iLength) & (iSize-1))];
@@ -835,8 +799,8 @@
 		e.iStart = aStart;
 		e.iFlags = aFlags;
 		iLength++;
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCSTATUSLIST_ADD_DUP1, "Adding request.  new iLength %d", iLength);
-		    
+		__KTRACE_OPT(KUSB,Kern::Printf("Adding request.  new iLength %d", iLength));
+
 		return KErrNone;
 		}
 	else
@@ -883,8 +847,7 @@
 	{
 	if (iState==ENotRunning)
 		{
-        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCSTATUSLIST_COMPLETE_TINT, "TUsbcScStatusList::Complete() - iState == ENotRunning!" );
-        
+		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScStatusList::Complete() - iState == ENotRunning!"));
 		}
  	else
 		{
@@ -910,17 +873,13 @@
 	{
 	if (iLength==0)
 		return;
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCSTATUSLIST_COMPLETE, "Completing request.  iLength %d", iLength);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("Completing request.  iLength %d", iLength));
+
 	Kern::RequestComplete(iClient, iElements[iHead].iStatus, KErrNone);
 
 	iLength--;
 	iHead = ((iHead+1) & (iSize-1));
 	}
-void TUsbcScStatusList::SetClient(DThread& aThread)
-	{
-	iClient = &aThread;
-	}
 
 // End TUsbcScStatusList
 
@@ -948,8 +907,7 @@
 	iTotalSize   =0;
 	iTotalBuffers=0;
 	iAltSettings =0;
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_INIT, "Realize: work out max endpoint" );
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("Realize: work out max endpoint"));
 	// Work out max endpoints and number of alternate settings.
 
 	if (iAlternateSettingList)
@@ -966,8 +924,7 @@
 		}
 	
 	// Alloc some temporary working space for temp endpoint metadata 
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_INIT_DUP1, "Realize: Alloc temp.  Maxendpoints %d", iMaxEndpoints);
-	    
+	__KTRACE_OPT(KUSB, Kern::Printf("Realize: Alloc temp.  Maxendpoints %d", iMaxEndpoints));
 	TInt inout;
 	for (inout=KUsbcScIn; inout<KUsbcScDirections; inout++)
 		{
@@ -989,7 +946,7 @@
 
 TInt TRealizeInfo::CopyAndSortEndpoints()
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, TREALIZEINFO_COPYANDSORTENDPOINTS, "Realize: copy And sort");
+	__KTRACE_OPT(KUSB, Kern::Printf("Realize: copy And sort"));
 
 	TInt altSetting = 0;
 	TInt endpointOffs;
@@ -1004,37 +961,37 @@
 		{
 		for (alt = iAlternateSettingList->iHead;alt!=NULL;alt = alt->iNext )
 			{		
-            OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_COPYANDSORTENDPOINTS_DUP1, "Realize:   AlternateSetting %x", alt);
-            
+			__KTRACE_OPT(KUSB, Kern::Printf("Realize:   AlternateSetting %x", alt));
+
 			iBufs[KUsbcScIn].iEps =0;
 			iBufs[KUsbcScOut].iEps =0;
 
 			// For alt setting, iterate eps
 			for (altEp=1; altEp <= alt->iNumberOfEndpoints; altEp++)
 				{
-                OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_COPYANDSORTENDPOINTS_DUP2, "Realize:     Endpoint to add: %d", altEp);
+				__KTRACE_OPT(KUSB, Kern::Printf("Realize:     Endpoint to add: %d",altEp));
+
 				TUsbcScEndpoint* nextEp = alt->iEndpoint[altEp];
 
-				OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_COPYANDSORTENDPOINTS_DUP3, "Realize:      ep Buffer Size: %d",nextEp->EndpointInfo()->iBufferSize);
-				                
+				__KTRACE_OPT(KUSB, Kern::Printf("Realize:      ep Buffer Size: %d",nextEp->EndpointInfo()->iBufferSize));
+				
 				inout = (nextEp->EndpointInfo()->iDir==KUsbEpDirIn)?KUsbcScIn:
 						(nextEp->EndpointInfo()->iDir==KUsbEpDirOut)?KUsbcScOut:KUsbcScUnknown;
 				if (inout==KUsbcScUnknown)
 					{
-                    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_COPYANDSORTENDPOINTS_DUP4, "Realize:     KUsbcScUnknown %x",nextEp->EndpointInfo()->iDir);
-				                 
+					__KTRACE_OPT(KUSB, Kern::Printf("Realize:     KUsbcScUnknown %x",nextEp->EndpointInfo()->iDir));
 					return KErrArgument;
 					}
 
 				bufsd = &(iBufs[inout]);
-				OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_COPYANDSORTENDPOINTS_DUP5, "Realize:      ep direction: %x # endpoints %d", inout, bufsd->iEps);
+				__KTRACE_OPT(KUSB, Kern::Printf("Realize:      ep direction: %x # endpoints %d", inout, bufsd->iEps));
+
 
 				// find and position ep, and insert.
 
 				if (bufsd->iEps==0) // First entry.
 					{
-				    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_COPYANDSORTENDPOINTS_DUP6, "Realize:       Add first endpoint");
-
+					__KTRACE_OPT(KUSB, Kern::Printf("Realize:       Add first endpoint"));
 					endpointOffs = altSetting*iMaxEndpoints;
 					bufsd->iEp[endpointOffs] = nextEp;
 					}
@@ -1047,12 +1004,14 @@
 						endpointOffs = altSetting*iMaxEndpoints + endpoint;
 						if (bufsd->iEp[endpointOffs]->EndpointInfo()->iBufferSize < nextEp->EndpointInfo()->iBufferSize)
 							{
-                            OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_COPYANDSORTENDPOINTS_DUP7, "Realize:       Shift Endpoint %d", endpoint);
+							__KTRACE_OPT(KUSB, Kern::Printf("Realize:       Shift Endpoint %d", endpoint));
+		
 							bufsd->iEp[endpointOffs+1] = bufsd->iEp[endpointOffs];
 							}
 						else
 							{
-                            OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_COPYANDSORTENDPOINTS_DUP8, "Realize:       Insert After Endpoint %d", endpoint);
+							__KTRACE_OPT(KUSB, Kern::Printf("Realize:       Insert After Endpoint %d", endpoint));
+
 							bufsd->iEp[endpointOffs+1] = nextEp;
 							placed = ETrue;
 							break;
@@ -1078,8 +1037,8 @@
 
 void TRealizeInfo::CalcBuffSizes()
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, TREALIZEINFO_CALCBUFFSIZES, "Realize: Calculate Buffers" );
-    
+	__KTRACE_OPT(KUSB, Kern::Printf("Realize: Calculate Buffers"));
+
 	TInt endpoint;
 	TInt inout;
 	TInt altSetting;
@@ -1089,27 +1048,28 @@
 
 	for (inout=KUsbcScIn; inout<KUsbcScDirections; inout++)
 		{
-        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_CALCBUFFSIZES_DUP1, "Realize:   Direction: %d", inout);
+		__KTRACE_OPT(KUSB, Kern::Printf("Realize:   Direction: %d", inout));
+
 
 		bufsd = &(iBufs[inout]);
 		// for each row, ie, buffer, find largest buffer need.
 		for (endpoint=0; endpoint<iMaxEndpoints; endpoint++)
 			{
-            OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_CALCBUFFSIZES_DUP2, "Realize:     endpoint %d", endpoint);
+			__KTRACE_OPT(KUSB, Kern::Printf("Realize:     endpoint %d", endpoint));
 			TInt bufMaxSize=0;
 			for (altSetting=0; altSetting< iAltSettings; altSetting++)
 				{
-                OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_CALCBUFFSIZES_DUP3, "Realize:       altSetting %d", altSetting);
+				__KTRACE_OPT(KUSB, Kern::Printf("Realize:       altSetting %d", altSetting));
 				nextEp= bufsd->iEp[altSetting* iMaxEndpoints + endpoint];
 				if (nextEp!=NULL)
 					{
 					bufferSize = nextEp->EndpointInfo()->iBufferSize;
-					OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_CALCBUFFSIZES_DUP4, "Realize:       comparing size %d", bufferSize);
+					__KTRACE_OPT(KUSB, Kern::Printf("Realize:       comparing size %d", bufferSize));
 					if (bufferSize> bufMaxSize)
 						 bufMaxSize = bufferSize;
 					}
 				} // for altsetting
-			OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_CALCBUFFSIZES_DUP5, "Realize:     bufMaxSize %d", bufMaxSize);
+			__KTRACE_OPT(KUSB, Kern::Printf("Realize:     bufMaxSize %d", bufMaxSize));
 			bufsd->iSizes[endpoint] = bufMaxSize;
 			if (bufMaxSize>0) 
 				{
@@ -1162,8 +1122,10 @@
 
 
 	TInt tableOffset  = (TUint) iAltSettingsTbl->iAltTableOffset - (TUint) aChunkInfo->iChunkMem + iAltSettings*sizeof(TInt);
-	OstTraceDefExt4(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_LAYOUTCHUNKHEADER, "Realize: table offset: 0x%x, altTble %x iChnkMem %x altSettings %x",tableOffset, (TUint)iAltSettingsTbl, (TUint)aChunkInfo->iChunkMem, iAltSettings);
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_LAYOUTCHUNKHEADER_DUP1, "Realize: populate chunk - create alt settings table");
+	__KTRACE_OPT(KUSB, Kern::Printf("Realize: table offset: 0x%x, altTble %x iChnkMem %x altSettings %x",tableOffset, iAltSettingsTbl, aChunkInfo->iChunkMem, iAltSettings ));
+
+	__KTRACE_OPT(KUSB, Kern::Printf("Realize: populate chunk - create alt settings table"));
+
 	// Create alt settings table.  Set each element of altsettings table, to each induivatual alt setting table.
 	// then fill in the number of endpoints for that alt setting, in the table.
 
@@ -1175,7 +1137,8 @@
 		alt = iAlternateSettingList->iHead;
 		for (altSetting=0; altSetting<iAltSettings; altSetting++) 
 			{
-                OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TREALIZEINFO_LAYOUTCHUNKHEADER_DUP2, "Realize:   altSetting %d, tableOffset %d", altSetting, tableOffset);
+				__KTRACE_OPT(KUSB, Kern::Printf("Realize:   altSetting %d, tableOffset %d", altSetting, tableOffset));
+
 				iAltSettingsTbl->iAltTableOffset[altSetting] = tableOffset;
 				noEpForAlt = (TInt*) &aChunkInfo->iChunkMem[tableOffset];
 			 
@@ -1226,8 +1189,7 @@
 	  iBuffers(NULL),
 	  iEp0Endpoint(NULL)
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_CONS, "DLddUsbcScChannel::DLddUsbcScChannel()" );
-    
+	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::DLddUsbcScChannel()"));
 	iClient = &Kern::CurrentThread();
 	iClient->Open();
 	for (TInt i = 1; i < KUsbcMaxRequests; i++)
@@ -1243,7 +1205,7 @@
 
 DLddUsbcScChannel::~DLddUsbcScChannel()
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_DES, "DLddUsbcScChannel::~DLddUsbcScChannel()" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::~DLddUsbcScChannel()"));
 	if (iController)
 		{
 		iController->DeRegisterClient(this);
@@ -1264,7 +1226,7 @@
 			delete iStatusFifo;
 			}
 		}
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_DES_DUP1, "Closing buffers" );
+	__KTRACE_OPT(KUSB, Kern::Printf("Closing buffers"));
 	if (iBuffers)
 		{
 		TInt i;
@@ -1278,14 +1240,12 @@
 	if (iRealizeCalled)
 		{
 		// Close Chunk
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_DES_DUP2, "iChunkInfo->Close()" );
 		iChunkInfo->Close();
 		// ChunkInfo will delete itself with DFC, but the pointer here is no longer needed.		
 		iChunkInfo=NULL;
 		}
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_DES_DUP3, "about to SafeClose" );
+	__KTRACE_OPT(KUSB, Kern::Printf("about to SafeClose"));
 	Kern::SafeClose((DObject*&)iClient, NULL);
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_DES_DUP4, "about to SafeClose1" );
 	}
 
 
@@ -1295,9 +1255,8 @@
 
 TInt DLddUsbcScChannel::DoCreate(TInt /*aUnit*/, const TDesC8* /*aInfo*/, const TVersion& aVer)
 	{
-	OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCREATE, "LDD DoCreateL 1 Ver = %02d %02d %02d",
-                                    aVer.iMajor, aVer.iMinor, aVer.iBuild);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("LDD DoCreateL 1 Ver = %02d %02d %02d",
+									aVer.iMajor, aVer.iMinor, aVer.iBuild));
 	if (!Kern::CurrentThreadHasCapability(ECapabilityCommDD,
 										  __PLATSEC_DIAGNOSTIC_STRING("Checked by USBCSC.LDD (USB Driver)")))
 		{
@@ -1357,8 +1316,8 @@
 	{
 	TThreadMessage& m = *(TThreadMessage*)aMsg;
 	TInt id = m.iValue;
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_HANDLEMSG, "HandleMsg 0x%x", id);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("HandleMsg 0x%x", id));
+
 	if (id == (TInt) ECloseMsg)
 		{
 		iChannelClosing = ETrue;
@@ -1367,11 +1326,6 @@
 		}
 
 	TInt r;
-	if (aMsg->Client() != iClient)
-		{
-		m.Complete(KErrAccessDenied, ETrue);
-		return;
-		}
 	if (id < 0)
 		{
 		// DoRequest
@@ -1395,6 +1349,8 @@
 // end HandleMsg.
 
 
+#define BREAK_IF_NULL_ARG(a,r) if (a==NULL) { r = KErrArgument; __KTRACE_OPT(KUSB,Kern::Printf("NULL Argument")); break; }
+
 //
 // DoRequest - Asynchronous requests
 //
@@ -1406,8 +1362,8 @@
 	TInt r = KErrNone;  // return via request notify
 	TBool needsCompletion =EFalse;
 
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST, "DoRequest 0x%08x", aReqNo);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DoRequest 0x%08x", aReqNo));
+
 	if ((reqNo>RDevUsbcScClient::ERequestReadDataNotify) &&
 		(reqNo<RDevUsbcScClient::ERequestMaxRequests))
 		{
@@ -1424,13 +1380,8 @@
 	case RDevUsbcScClient::ERequestWriteData:
 		{
 		TInt buffer =  (aReqNo>>RDevUsbcScClient::KFieldBuffPos)&RDevUsbcScClient::KFieldBuffMask;
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP1, "ERequestWriteData");
-		if (a2 == NULL)
-                {
-                r = KErrArgument;
-                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP2, "NULL Argument");
-                break;
-                }
+		__KTRACE_OPT(KUSB, Kern::Printf("ERequestWriteData"));
+		BREAK_IF_NULL_ARG(a2,r);
 
 		r = DoWriteData( aStatus, buffer, (TInt) a1 /*Start*/, (TInt) a2 /* Length */,
 						 aReqNo>>RDevUsbcScClient::KFieldFlagsPos ); // Flags
@@ -1438,19 +1389,14 @@
 		}
 	case RDevUsbcScClient::ERequestReadDataNotify:
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP3, "ERequestReadDataNotify");
+		__KTRACE_OPT(KUSB, Kern::Printf("ERequestReadDataNotify"));
 		return DoReadDataNotify(aStatus, (TInt) a1, (TInt) a2); // a1 = aBufferNumber, a2 - aLength;
 		} 
 
 	case RDevUsbcScClient::ERequestAlternateDeviceStatusNotify:
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP4, "ERequestAlternateDeviceStatusNotify");
-		if (a1 == NULL)
-                {
-                r = KErrArgument;
-                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP5, "NULL Argument");
-                break;
-                }
+		__KTRACE_OPT(KUSB, Kern::Printf("ERequestAlternateDeviceStatusNotify"));
+		BREAK_IF_NULL_ARG(a1,r);
 		iDeviceStatusNeeded = ETrue;
 		iStatusChangePtr = a1;
 		needsCompletion = AlternateDeviceStateTestComplete();
@@ -1458,32 +1404,24 @@
 		}
 	case RDevUsbcScClient::ERequestReEnumerate:
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP6, "ERequestReEnumerate");
+		__KTRACE_OPT(KUSB, Kern::Printf("ERequestReEnumerate"));
 		// If successful, this will complete via the status notification.
 		r = iController->ReEnumerate();
 		break;
 		}
 	case RDevUsbcScClient::ERequestEndpointStatusNotify:
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP7, "ERequestEndpointStatusNotify");
-		if (a1 == NULL)
-                {
-                r = KErrArgument;
-                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP8, "NULL Argument");
-                break;
-                }
+		__KTRACE_OPT(KUSB, Kern::Printf("ERequestEndpointStatusNotify"));
+		BREAK_IF_NULL_ARG(a1,r);
+		
 		iEndpointStatusChangePtr = a1;
 		break;
 		}
 	case RDevUsbcScClient::ERequestOtgFeaturesNotify:
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP9, "ERequestOtgFeaturesNotify");
-		if (a1 == NULL)
-                {
-                r = KErrArgument;
-                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP10, "NULL Argument");
-                break;
-                }	
+		__KTRACE_OPT(KUSB, Kern::Printf("ERequestOtgFeaturesNotify"));
+		BREAK_IF_NULL_ARG(a1,r);
+			
 		iOtgFeatureChangePtr = a1;
 		break;
 		}
@@ -1508,16 +1446,14 @@
 //
 TInt DLddUsbcScChannel::DoReadDataNotify(TRequestStatus* aStatus, TInt aBufferNum, TInt aLength)
 	{
-    OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREADDATANOTIFY, " DLddUsbcScChannel::DoReadDataNotify(x, %d, 0x%x)", aBufferNum, aLength);
-    
+	__KTRACE_OPT(KUSB, Kern::Printf(" DLddUsbcScChannel::DoReadDataNotify(x, %d, 0x%x)", aBufferNum, aLength));
 	TInt r = KErrNone;
 	// check range
 	if ((aBufferNum<0) ||  (aBufferNum>=iNumBuffers))  // Indirectly checks that we are set up.
 		{
 		if (aBufferNum!=KUsbcScEndpointZero)
 			{
-            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREADDATANOTIFY_DUP1, " DLddUsbcScChannel::DoReadDataNotify : Bad Buffer Number!");
-		    
+	        __KTRACE_OPT(KUSB, Kern::Printf(" DLddUsbcScChannel::DoReadDataNotify : Bad Buffer Number!"));
 			return KErrArgument;
 			}
 		else
@@ -1530,7 +1466,7 @@
 		// check direction
 		if (iBuffers[aBufferNum].iDirection!=KUsbcScOut)
 			{
-            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREADDATANOTIFY_DUP2, " DLddUsbcScChannel::DoReadDataNotify : Bad Buffer Direction!");
+   		     __KTRACE_OPT(KUSB, Kern::Printf(" DLddUsbcScChannel::DoReadDataNotify : Bad Buffer Direction!"));
 			return KErrNotSupported;
 			}
 		if (!Configured())
@@ -1538,7 +1474,8 @@
 		}
 	SUsbcScBufferHeader* scBuffer = (SUsbcScBufferHeader*) iBuffers[aBufferNum].iBufferStart;
 
-	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREADDATANOTIFY_DUP3, " DLddUsbcScChannel::DoReadDataNotify  head %x tail %x", iBuffers[aBufferNum].iHead , scBuffer->iTail);
+	__KTRACE_OPT(KUSB, Kern::Printf(" DLddUsbcScChannel::DoReadDataNotify  head %x tail %x", iBuffers[aBufferNum].iHead , scBuffer->iTail ));
+
 	if (iBuffers[aBufferNum].iHead != scBuffer->iBilTail)
 		r = KErrCompletion;
 	else
@@ -1556,7 +1493,7 @@
 		}
 	else
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREADDATANOTIFY_DUP4, "Job in Progress!");
+		__KTRACE_OPT(KUSB, Kern::Printf("Job in Progress!"));
 		}
 	return r;
 	}
@@ -1571,8 +1508,7 @@
 //
 TInt DLddUsbcScChannel::DoWriteData(TRequestStatus* aStatus,TInt aBufferNum, TUint aStart, TUint aLength, TUint aFlags)
 	{
-    OstTraceDefExt4(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOWRITEDATA, " DLddUsbcScChannel::DoWriteData(%d, 0x%x, 0x%x, 0x%x)",  aBufferNum, aStart, aLength, aFlags);
-    
+	__KTRACE_OPT(KUSB, Kern::Printf(" DLddUsbcScChannel::DoWriteData(%d, 0x%x, 0x%x, 0x%x)",  aBufferNum, aStart, aLength, aFlags));
 	if (!iUserKnowsAltSetting)
 		return KErrEof;
 	// Check Buffer Number
@@ -1580,7 +1516,7 @@
 		{
 		if ((TUint)aBufferNum!=RDevUsbcScClient::KFieldBuffMask)  // KUsbcScEndpointZero & KFieldBuffMas = KFieldBuffMas;
 			{
-            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOWRITEDATA_DUP1, " DLddUsbcScChannel::DoWriteData : Bad Buffer Number!"); 
+	        __KTRACE_OPT(KUSB, Kern::Printf(" DLddUsbcScChannel::DoWriteData : Bad Buffer Number!"));
 			return KErrArgument;
 			}
 		else
@@ -1593,7 +1529,7 @@
 		// check direction
 		if (iBuffers[aBufferNum].iDirection!=KUsbcScIn)
 			{
-                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOWRITEDATA_DUP2, " DLddUsbcScChannel::DoWriteData Bad endpoint Direction"); 
+	    	    __KTRACE_OPT(KUSB, Kern::Printf(" DLddUsbcScChannel::DoWriteData Bad endpoint Direction"));
 				return KErrArgument;
 			}
 		}
@@ -1602,7 +1538,7 @@
 
 	if ((aStart< (((TLinAddr) buf.iBufferStart)-buf.iChunkAddr)) || ((aStart+aLength)>iBuffers[aBufferNum].iBufferEnd))
 		{
-        OstTraceDefExt4(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOWRITEDATA_DUP3, "DLddUsbcScChannel::DoWriteData Bad Range aStart or aLength 0x%x > 0x%x + 0x%x < 0x%x", (TInt)(((TLinAddr) buf.iBufferStart)-buf.iChunkAddr),aStart, aLength, iBuffers[aBufferNum].iBufferEnd);
+		__KTRACE_OPT(KUSB, Kern::Printf(" DLddUsbcScChannel::DoWriteData Bad Range aStart or aLength 0x%x > 0x%x + 0x%x < 0x%x", (((TLinAddr) buf.iBufferStart)-buf.iChunkAddr),aStart, aLength, iBuffers[aBufferNum].iBufferEnd ));
 		return KErrArgument;
 		}
 
@@ -1611,8 +1547,7 @@
 
 	if (aStart & ~buf.iAlignMask)
 		{
-        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOWRITEDATA_DUP4, "TUsbcScBuffer::DoDataWrite: address 0x%x unaligned.",aStart);
-	        
+		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScBuffer::DoDataWrite: address 0x%x unaligned.",aStart));
 		return KErrArgument;
 		}
 			
@@ -1624,7 +1559,7 @@
 		}
 	else
 		{	
-        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOWRITEDATA_DUP5, "Job in Progress!");
+		__KTRACE_OPT(KUSB, Kern::Printf("Job in Progress!"));
 		}
 
 
@@ -1641,8 +1576,7 @@
 	TInt r = KErrNone;
 	TInt direction=KUsbcScOut;
 
-	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCANCEL, "DoCancel: 0x%x aBuff 0x%x", aReqNo, aBuff);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DoCancel: 0x%x aBuff 0x%x", aReqNo, aBuff));
 	switch (aReqNo)
 		{
 	case RDevUsbcScClient::ERequestCancel:
@@ -1659,10 +1593,11 @@
 	case RDevUsbcScClient::ERequestWriteDataCancel:
 		direction = KUsbcScIn;
 	case RDevUsbcScClient::ERequestReadDataNotifyCancel:
-	    OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCANCEL_DUP1, "DoCancel Direction %d endpoints: 0x%x", direction, aReqNo);
+		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel Direction %d endpoints: 0x%x",direction, aReqNo));
+
 		if (((TInt)aBuff)==KUsbcScEndpointZero) // EP0 is bi-directional, so pick correct buffer for call type
 			{
-            OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCANCEL_DUP2, "DoCancel Cancel Endpoint 0/%d",direction);
+			__KTRACE_OPT(KUSB, Kern::Printf("DoCancel Cancel Endpoint 0/%d",direction));
 			iEp0Endpoint->AbortTransfer();
 			if (direction==KUsbcScIn)
 				aBuff=iEP0InBuff;
@@ -1671,13 +1606,13 @@
 			} 
 		else if ((TInt)aBuff >= iNumBuffers) // check buff no range.
 			{
-            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCANCEL_DUP3, "DoCancel Error: Bad buffer number");
+			__KTRACE_OPT(KUSB, Kern::Printf("DoCancel Error: Bad buffer number"));
 			return KErrArgument;
 			}
 
 		if ((iBuffers[aBuff].iDirection&1)!=direction) // Does direction match call type?
 			{
-            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCANCEL_DUP4, "DoCancel Error: Bad buffer direction");
+			__KTRACE_OPT(KUSB, Kern::Printf("DoCancel Error: Bad buffer direction"));
 			return KErrArgument;
 			}	
 		iBuffers[aBuff].iStatusList.CancelQueued();
@@ -1686,7 +1621,7 @@
 		return KErrNone;
 
 	case RDevUsbcScClient::ERequestAlternateDeviceStatusNotifyCancel:
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCANCEL_DUP5, "DoCancel: ERequestAlternateDeviceStatusNotify 0x%x", aReqNo);
+		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel: ERequestAlternateDeviceStatusNotify 0x%x", aReqNo));
 		iDeviceStatusNeeded = EFalse;
 		iStatusFifo->FlushQueue();
 		if (iStatusChangePtr)
@@ -1700,21 +1635,21 @@
 	break;
 
 	case RDevUsbcScClient::ERequestReEnumerateCancel:
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCANCEL_DUP6, "DoCancel ERequestReEnumerate: 0x%x", aReqNo);
+		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel ERequestReEnumerate: 0x%x", aReqNo));
 	break;
 
 	case RDevUsbcScClient::ERequestEndpointStatusNotifyCancel:
-	    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCANCEL_DUP7, "DoCancel ERequestEndpointStatusNotify: 0x%x", aReqNo);
+		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel ERequestEndpointStatusNotify: 0x%x", aReqNo));
 		CancelNotifyEndpointStatus();
 	break;
 
  	case RDevUsbcScClient::ERequestOtgFeaturesNotifyCancel:
- 	   OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCANCEL_DUP8, "DoCancel ERequestOtgFeaturesNotify: 0x%x", aReqNo);
+		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel ERequestOtgFeaturesNotify: 0x%x", aReqNo));
 		CancelNotifyOtgFeatures();
 	break;
 
 	default:
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCANCEL_DUP9, "DoCancel Unknown! 0x%x", aReqNo);
+		__KTRACE_OPT(KUSB, Kern::Printf("DoCancel Unknown! 0x%x", aReqNo));
 		return KErrArgument;
 		}
 
@@ -1764,8 +1699,8 @@
 
 TInt DLddUsbcScChannel::DoControl(TInt aFunction, TAny* a1, TAny* a2)
 	{
-    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL, "DoControl: %d", aFunction);
-    
+	__KTRACE_OPT(KUSB, Kern::Printf("DoControl: %d", aFunction));
+
 	TInt r = KErrNone;
 	TInt ep, param;
 	TUsbcScEndpoint* pEndpoint;
@@ -1778,7 +1713,7 @@
 	switch (aFunction)
 		{
 	case RDevUsbcScClient::EControlEndpointZeroRequestError:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP1, "EControlEndpointZeroRequestError");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlEndpointZeroRequestError"));
 		r = KErrNone;
 		if (iOwnsDeviceControl || (iValidInterface && iDeviceState == EUsbcDeviceStateConfigured))
 			{
@@ -1794,7 +1729,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlGetAlternateSetting:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP2, "EControlGetAlternateSetting");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetAlternateSetting"));
 		if (iValidInterface && iDeviceState == EUsbcDeviceStateConfigured)
 			{
 			r = iController->GetInterfaceNumber(this, param);
@@ -1815,7 +1750,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlDeviceStatus:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP3, "EControlDeviceStatus");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlDeviceStatus"));
 		param = iController->GetDeviceStatus();
 		r = Kern::ThreadRawWrite(iClient, a1, &param, sizeof(param), iClient);
 		if (r != KErrNone)
@@ -1823,7 +1758,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlEndpointStatus:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP4, "EControlEndpointStatus");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlEndpointStatus"));
 		if (iValidInterface && ValidEndpoint((TInt) a1))
 			{
 			pEndpoint = iEndpoint[(TInt)a1];
@@ -1847,7 +1782,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlEndpointCaps:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP5, "EControlEndpointCaps");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlEndpointCaps"));
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0, 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1855,7 +1790,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlDeviceCaps:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP6, "EControlDeviceCaps");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlDeviceCaps"));
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0, 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1863,12 +1798,12 @@
 		break;
 
 	case RDevUsbcScClient::EControlSendEp0StatusPacket:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP7, "EControlSendEp0StatusPacket");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSendEp0StatusPacket"));
 		iController->SendEp0StatusPacket(this);
 		break;
 
 	case RDevUsbcScClient::EControlHaltEndpoint:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP8, "EControlHaltEndpoint");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlHaltEndpoint"));
 		if (iValidInterface && ValidEndpoint((TInt) a1))
 			{
 			r = iController->HaltEndpoint(this, iEndpoint[(TInt)a1]->RealEpNumber());
@@ -1883,7 +1818,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlClearHaltEndpoint:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP9, "EControlClearHaltEndpoint");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlClearHaltEndpoint"));
 		if (iValidInterface && ValidEndpoint((TInt) a1))
 			{
 			r = iController->ClearHaltEndpoint(this, iEndpoint[(TInt)a1]->RealEpNumber());
@@ -1898,33 +1833,33 @@
 		break;
 
 	case RDevUsbcScClient::EControlDumpRegisters:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP10, "EControlDumpRegisters");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlDumpRegisters"));
 		iController->DumpRegisters();
 		break;
 
 	case RDevUsbcScClient::EControlReleaseDeviceControl:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP11, "EControlReleaseDeviceControl");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlReleaseDeviceControl"));
 		iController->ReleaseDeviceControl(this);
 		iOwnsDeviceControl = EFalse;
 		break;
 
 	case RDevUsbcScClient::EControlEndpointZeroMaxPacketSizes:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP12, "EControlEndpointZeroMaxPacketSizes");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlEndpointZeroMaxPacketSizes"));
 		r = iController->EndpointZeroMaxPacketSizes();
 		break;
 
 	case RDevUsbcScClient::EControlSetEndpointZeroMaxPacketSize:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP13, "EControlSetEndpointZeroMaxPacketSize");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetEndpointZeroMaxPacketSize"));
 		r = iController->SetEndpointZeroMaxPacketSize(reinterpret_cast<TInt>(a1));
 		break;
 
 	case RDevUsbcScClient::EControlGetEndpointZeroMaxPacketSize:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP14, "EControlGetEndpointZeroMaxPacketSize");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetEndpointZeroMaxPacketSize"));
 		r = iController->Ep0PacketSize();
 		break;
 
 	case RDevUsbcScClient::EControlGetDeviceDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP15, "EControlGetDeviceDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetDeviceDescriptor"));
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0, 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1932,29 +1867,19 @@
 		break;
 
 	case RDevUsbcScClient::EControlSetDeviceDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP16, "EControlSetDeviceDescriptor");
-		if (a1 == NULL)
-                {
-                r = KErrArgument;
-                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP17, "NULL Argument");
-                break;
-                }   
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetDeviceDescriptor"));
+		BREAK_IF_NULL_ARG(a1,r);
 		r = iController->SetDeviceDescriptor(iClient, *((TDes8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlGetDeviceDescriptorSize:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP18, "EControlGetDeviceDescriptorSize");
-		if (a1 == NULL)
-                {
-                r = KErrArgument;
-                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP19, "NULL Argument");
-                break;
-                }   
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetDeviceDescriptorSize"));
+		BREAK_IF_NULL_ARG(a1,r);
 		r = iController->GetDeviceDescriptorSize(iClient, *((TDes8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlGetConfigurationDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP20, "EControlGetConfigurationDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetConfigurationDescriptor"));
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0 , 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -1962,7 +1887,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlGetConfigurationDescriptorSize:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP21, "EControlGetConfigurationDescriptorSize");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetConfigurationDescriptorSize"));
 		if (a1 != NULL)
 			{
 			r = iController->GetConfigurationDescriptorSize(iClient, *((TDes8*) a1));
@@ -1972,27 +1897,27 @@
 		break;
 
 	case RDevUsbcScClient::EControlSetConfigurationDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP22, "EControlSetConfigurationDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetConfigurationDescriptor"));
 		r = iController->SetConfigurationDescriptor(iClient, *((TDes8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlGetInterfaceDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP23, "EControlGetInterfaceDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetInterfaceDescriptor"));
 		r = iController->GetInterfaceDescriptor(iClient, this, (TInt) a1, *((TDes8*) a2));
 		break;
 
 	case RDevUsbcScClient::EControlGetInterfaceDescriptorSize:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP24, "EControlGetInterfaceDescriptorSize");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetInterfaceDescriptorSize"));
 		r = iController->GetInterfaceDescriptorSize(iClient, this, (TInt) a1, *(TDes8*) a2);
 		break;
 
 	case RDevUsbcScClient::EControlSetInterfaceDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP25, "EControlSetInterfaceDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetInterfaceDescriptor"));
 		r = iController->SetInterfaceDescriptor(iClient, this, (TInt) a1, *((TDes8*) a2));
 		break;
 
 	case RDevUsbcScClient::EControlGetEndpointDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP26, "EControlGetEndpointDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetEndpointDescriptor"));
 		r = Kern::ThreadRawRead(iClient, a1, &epInfo, sizeof(epInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -2002,7 +1927,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlGetEndpointDescriptorSize:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP27, "EControlGetEndpointDescriptorSize");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetEndpointDescriptorSize"));
 		r = Kern::ThreadRawRead(iClient, a1, &epInfo, sizeof(epInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -2012,7 +1937,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlSetEndpointDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP28, "EControlSetEndpointDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetEndpointDescriptor"));
 		r = Kern::ThreadRawRead(iClient, a1, &epInfo, sizeof(epInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -2022,7 +1947,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlGetDeviceQualifierDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP29, "EControlGetDeviceQualifierDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetDeviceQualifierDescriptor"));
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0, 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -2030,18 +1955,13 @@
 		break;
 
 	case RDevUsbcScClient::EControlSetDeviceQualifierDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP30, "EControlSetDeviceQualifierDescriptor");
-		if (a1 == NULL)
-                {
-                r = KErrArgument;
-                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOREQUEST_DUP31, "NULL Argument");
-                break;
-                }   
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetDeviceQualifierDescriptor"));
+		BREAK_IF_NULL_ARG(a1,r);
 		r = iController->SetDeviceQualifierDescriptor(iClient, *((TDes8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlGetOtherSpeedConfigurationDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP32, "EControlGetOtherSpeedConfigurationDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetOtherSpeedConfigurationDescriptor"));
 		r = Kern::ThreadDesWrite(iClient, a1, pZeroDesc, 0 , 0, iClient);
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -2049,23 +1969,23 @@
 		break;
 
 	case RDevUsbcScClient::EControlSetOtherSpeedConfigurationDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP33, "EControlSetOtherSpeedConfigurationDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetOtherSpeedConfigurationDescriptor"));
 		r = iController->SetOtherSpeedConfigurationDescriptor(iClient, *((TDes8*) a1));
 		break;
 
 
 	case RDevUsbcScClient::EControlGetCSInterfaceDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP34, "EControlGetCSInterfaceDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetCSInterfaceDescriptor"));
 		r = iController->GetCSInterfaceDescriptorBlock(iClient, this, (TInt) a1, *((TDes8*) a2));
 		break;
 
 	case RDevUsbcScClient::EControlGetCSInterfaceDescriptorSize:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP35, "EControlGetCSInterfaceDescriptorSize");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetCSInterfaceDescriptorSize"));
 		r = iController->GetCSInterfaceDescriptorBlockSize(iClient, this, (TInt) a1, *(TDes8*) a2);
 		break;
 
 	case RDevUsbcScClient::EControlGetCSEndpointDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP36, "EControlGetCSEndpointDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetCSEndpointDescriptor"));
 		r = Kern::ThreadRawRead(iClient, a1, &epInfo, sizeof(epInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -2075,7 +1995,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlGetCSEndpointDescriptorSize:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP37, "EControlGetCSEndpointDescriptorSize");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetCSEndpointDescriptorSize"));
 		r = Kern::ThreadRawRead(iClient, a1, &epInfo, sizeof(epInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -2085,38 +2005,38 @@
 		break;
 
 	case RDevUsbcScClient::EControlSignalRemoteWakeup:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP38, "EControlSignalRemoteWakeup");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSignalRemoteWakeup"));
 		r = iController->SignalRemoteWakeup();
 		break;
 
 	case RDevUsbcScClient::EControlDeviceDisconnectFromHost:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP39, "EControlDeviceDisconnectFromHost");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlDeviceDisconnectFromHost"));
 		r = iController->UsbDisconnect();
 		break;
 
 	case RDevUsbcScClient::EControlDeviceConnectToHost:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP40, "EControlDeviceConnectToHost");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlDeviceConnectToHost"));
 		r = iController->UsbConnect();
 		break;
 
 	case RDevUsbcScClient::EControlDevicePowerUpUdc:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP41, "EControlDevicePowerUpUdc");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlDevicePowerUpUdc"));
 		r = iController->PowerUpUdc();
 		break;
 
 	case RDevUsbcScClient::EControlSetDeviceControl:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP42, "EControlSetDeviceControl");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetDeviceControl"));
 		r = iController->SetDeviceControl(this);
 		if (r == KErrNone)
 			{
 			iOwnsDeviceControl = ETrue;
 			if (iEp0Endpoint == NULL)
 				{
-			    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP43, "EControlSetDeviceControl");
+				__KTRACE_OPT(KUSB, Kern::Printf("EControlSetDeviceControl"));
 				r = SetupEp0();
 				if (r != KErrNone)
 					{
-				    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP44, "  Error: SetupEp0() failed");
+					__KTRACE_OPT(KPANIC, Kern::Printf("  Error: SetupEp0() failed"));
 					iController->ReleaseDeviceControl(this);
 					iOwnsDeviceControl=EFalse;
 					DestroyEp0();
@@ -2128,12 +2048,12 @@
 		break;
 
 	case RDevUsbcScClient::EControlCurrentlyUsingHighSpeed:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP45, "EControlCurrentlyUsingHighSpeed");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlCurrentlyUsingHighSpeed"));
 		r = iController->CurrentlyUsingHighSpeed();
 		break;
 
 	case RDevUsbcScClient::EControlSetInterface:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP46, "EControlSetInterface");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetInterface"));
 		r = Kern::ThreadRawRead(iClient, a2, &ifcInfo, sizeof(ifcInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -2141,7 +2061,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlReleaseInterface: 
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP47, "EControlReleaseInterface");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlReleaseInterface"));
 		if (!iRealizeCalled)
 			{
 			r = iController->ReleaseInterface(this, (TInt) a1);
@@ -2151,7 +2071,7 @@
 				}
 			else
 				{
-                OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP48, "  Error in PIL: LDD interface won't be released.");
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error in PIL: LDD interface won't be released."));
 				}
 			}
 		else
@@ -2159,7 +2079,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlSetCSInterfaceDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP49, "EControlSetCSInterfaceDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetCSInterfaceDescriptor"));
 		r = Kern::ThreadRawRead(iClient, a1, &desInfo, sizeof(desInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -2169,7 +2089,7 @@
 		break;
 
 	case RDevUsbcScClient::EControlSetCSEndpointDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP50, "EControlSetCSEndpointDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetCSEndpointDescriptor"));
 		r = Kern::ThreadRawRead(iClient, a1, &desInfo, sizeof(desInfo));
 		if (r != KErrNone)
 			PanicClientThread(r);
@@ -2180,93 +2100,93 @@
 		break;
 
 	case RDevUsbcScClient::EControlGetStringDescriptorLangId:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP51, "EControlGetStringDescriptorLangId");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetStringDescriptorLangId"));
 		r = iController->GetStringDescriptorLangId(iClient, *((TDes8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlSetStringDescriptorLangId:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP52, "EControlSetStringDescriptorLangId");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetStringDescriptorLangId"));
 		r = iController->SetStringDescriptorLangId(reinterpret_cast<TUint>(a1));
 		break;
 
 	case RDevUsbcScClient::EControlGetManufacturerStringDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP53, "EControlGetManufacturerStringDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetManufacturerStringDescriptor"));
 		r = iController->GetManufacturerStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlSetManufacturerStringDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP54, "EControlSetManufacturerStringDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetManufacturerStringDescriptor"));
 		r = iController->SetManufacturerStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlRemoveManufacturerStringDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP55, "EControlRemoveManufacturerStringDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlRemoveManufacturerStringDescriptor"));
 		r = iController->RemoveManufacturerStringDescriptor();
 		break;
 
 	case RDevUsbcScClient::EControlGetProductStringDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP56, "EControlGetProductStringDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetProductStringDescriptor"));
 		r = iController->GetProductStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlSetProductStringDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP57, "EControlSetProductStringDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetProductStringDescriptor"));
 		r = iController->SetProductStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlRemoveProductStringDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP58, "EControlRemoveProductStringDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlRemoveProductStringDescriptor"));
 		r = iController->RemoveProductStringDescriptor();
 		break;
 
 	case RDevUsbcScClient::EControlGetSerialNumberStringDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP59, "EControlGetSerialNumberStringDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetSerialNumberStringDescriptor"));
 		r = iController->GetSerialNumberStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlSetSerialNumberStringDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP60, "EControlSetSerialNumberStringDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetSerialNumberStringDescriptor"));
 		r = iController->SetSerialNumberStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlRemoveSerialNumberStringDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP61, "EControlRemoveSerialNumberStringDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlRemoveSerialNumberStringDescriptor"));
 		r = iController->RemoveSerialNumberStringDescriptor();
 		break;
 
 	case RDevUsbcScClient::EControlGetConfigurationStringDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP62, "EControlGetConfigurationStringDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetConfigurationStringDescriptor"));
 		r = iController->GetConfigurationStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlSetConfigurationStringDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP63, "EControlSetConfigurationStringDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetConfigurationStringDescriptor"));
 		r = iController->SetConfigurationStringDescriptor(iClient, *((TPtr8*) a1));
 		break;
 
 	case RDevUsbcScClient::EControlRemoveConfigurationStringDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP64, "EControlRemoveConfigurationStringDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlRemoveConfigurationStringDescriptor"));
 		r = iController->RemoveConfigurationStringDescriptor();
 		break;
 
 	case RDevUsbcScClient::EControlGetStringDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP65, "EControlGetStringDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetStringDescriptor"));
 		r = iController->GetStringDescriptor(iClient, (TUint8) (TInt) a1, *((TPtr8*) a2));
 		break;
 
 	case RDevUsbcScClient::EControlSetStringDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP66, "EControlSetStringDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetStringDescriptor"));
 		r = iController->SetStringDescriptor(iClient, (TUint8) (TInt) a1, *((TPtr8*) a2));
 		break;
 
 	case RDevUsbcScClient::EControlRemoveStringDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP67, "EControlRemoveStringDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlRemoveStringDescriptor"));
 		r = iController->RemoveStringDescriptor((TUint8) (TInt) a1);
 		break;
 
 	case RDevUsbcScClient::EControlAllocateEndpointResource:
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP68, "EControlAllocateEndpointResource");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlAllocateEndpointResource"));
 		epRes = (TUsbcEndpointResource)((TInt) a2);
 		TInt realEp=-1;
 		r = GetRealEpForEpResource((TInt)a1, realEp);
@@ -2276,7 +2196,7 @@
 		}
 	case RDevUsbcScClient::EControlDeAllocateEndpointResource:
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP69, "EControlDeAllocateEndpointResource");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlDeAllocateEndpointResource"));
 		epRes = (TUsbcEndpointResource)((TInt) a2);
 		TInt realEp=-1;
 		r = GetRealEpForEpResource((TInt)a1, realEp);
@@ -2286,7 +2206,7 @@
 		}
 	case RDevUsbcScClient::EControlQueryEndpointResourceUse:
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP70, "EControlQueryEndpointResourceUse");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlQueryEndpointResourceUse"));
 		epRes = (TUsbcEndpointResource)((TInt) a2);
 		TInt realEp=-1;
 		r = GetRealEpForEpResource((TInt)a1, realEp);
@@ -2295,31 +2215,31 @@
 		break;
 		}
 	case RDevUsbcScClient::EControlSetOtgDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP71, "EControlSetOtgDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlSetOtgDescriptor"));
 		r = iController->SetOtgDescriptor(iClient, *((const TDesC8*)a1));
 		break;
 
 	case RDevUsbcScClient::EControlGetOtgDescriptor:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP72, "EControlGetOtgDescriptor");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetOtgDescriptor"));
 		r = iController->GetOtgDescriptor(iClient, *((TDes8*)a1));
 		break;
 
 	case RDevUsbcScClient::EControlGetOtgFeatures:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP73, "EControlGetOtgFeatures");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlGetOtgFeatures"));
 		r = iController->GetOtgFeatures(iClient, *((TDes8*)a1));
 		break;
 
 	case RDevUsbcScClient::EControlRealizeInterface:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP74, "EControlRealizeInterface");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlRealizeInterface"));
 		r = RealizeInterface();
 		break;
 	case RDevUsbcScClient::EControlStartNextInAlternateSetting:
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP75, "EControlStartNextInAlternateSetting");
+		__KTRACE_OPT(KUSB, Kern::Printf("EControlStartNextInAlternateSetting"));
 		r = StartNextInAlternateSetting();
 		break;
 
     default:
-        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOCONTROL_DUP76, "Function code not supported");
+		__KTRACE_OPT(KUSB, Kern::Printf("Function code not supported"));
 		r = KErrNotSupported;
 		}
 
@@ -2334,8 +2254,7 @@
 //
 TInt DLddUsbcScChannel::RequestUserHandle(DThread* aThread, TOwnerType /*aType*/)
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_REQUESTUSERHANDLE, "DLddUsbcScChannel::RequestUserHandle" );
-    
+	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::RequestUserHandle"));
 	// The USB client LDD is not designed for a channel to be shared between
 	// threads. It saves a pointer to the current thread when it is opened, and
 	// uses this to complete any asynchronous requests.
@@ -2347,39 +2266,7 @@
 		}
 	else
 		{
-		//check if async request has been called
-		for (TInt i = 1; i < KUsbcMaxRequests; i++)
-			{
-			if (iRequestStatus[i] != NULL)
-				{
-				return KErrAccessDenied;
-				}
-			}
-
-		if (iBuffers)
-			{
-			for (TInt i=0; i<(iNumBuffers+2); i++) 
-				{
-				if (iBuffers[i].IsRequestPending())
-					{
-					return KErrAccessDenied;	
-					}
-				}
-			}
-		
-		
-		Kern::SafeClose((DObject*&)iClient, NULL);
-		iClient = aThread;
-		iClient->Open();
-		if (iBuffers)
-			{
-			for (TInt i=0; i<(iNumBuffers+2); i++) 
-				{
-				iBuffers[i].iStatusList.SetClient(*iClient);
-				}
-			}
-		OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REQUESTUSERHANDLE_DUP1, "DLddUsbcScChannel::handle %d", iChunkInfo->iChunk->AccessCount());
-		return KErrNone;
+		return KErrAccessDenied;
 		}
 	}
 
@@ -2448,18 +2335,18 @@
 	TUsbcScInterfaceInfoBuf* const ifc_info_buf_ptr = aInfoBuf->iInterfaceData;
 	const TInt srcLen = Kern::ThreadGetDesLength(iClient, ifc_info_buf_ptr);
 
-	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_SETINTERFACE, "SetInterface srcLen = %d len = %d", srcLen, ifc_info_buf.Length());
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("SetInterface srcLen = %d len = %d", srcLen, ifc_info_buf.Length() ));
+
 	if (srcLen < ifc_info_buf.Length())
 		{
-        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_SETINTERFACE_DUP1, "SetInterface can't copy");
+		__KTRACE_OPT(KUSB, Kern::Printf("SetInterface can't copy"));
 		PanicClientThread(EDesOverflow);
 		}
 
 	TInt r = Kern::ThreadDesRead(iClient, ifc_info_buf_ptr, ifc_info_buf, 0, KChunkShiftBy0);
 	if (r != KErrNone)
 		{
-        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_SETINTERFACE_DUP2, "SetInterface Copy failed reason=%d", r);
+		__KTRACE_OPT(KUSB, Kern::Printf("SetInterface Copy failed reason=%d", r));
 		PanicClientThread(r);
 		}
 
@@ -2467,7 +2354,7 @@
 	TUsbcScEndpointInfo* pEndpointData = ifc_info_buf().iEndpointData;
 
 	const TInt num_endpoints = ifc_info_buf().iTotalEndpointsUsed;
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_SETINTERFACE_DUP3, "SetInterface num_endpoints=%d", num_endpoints);
+	__KTRACE_OPT(KUSB, Kern::Printf("SetInterface num_endpoints=%d", num_endpoints));
 	if (num_endpoints>KMaxEndpointsPerClient)
 		return KErrOverflow;
 
@@ -2480,7 +2367,7 @@
 
 
 	// See if PIL will accept this interface
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_SETINTERFACE_DUP4, "SetInterface Calling controller");
+	__KTRACE_OPT(KUSB, Kern::Printf("SetInterface Calling controller"));
 	TUsbcEndpointInfoArray endpointData = TUsbcEndpointInfoArray(ifc_info_buf().iEndpointData);
 
 	r = iController->SetInterface(this,
@@ -2493,10 +2380,10 @@
 								  &real_ep_numbers[0],
 								  ifc_info_buf().iFeatureWord);
 
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_SETINTERFACE_DUP5, "SetInterface controller returned %d", r);
+	__KTRACE_OPT(KUSB, Kern::Printf("SetInterface controller returned %d", r));
 	if (r != KErrNone)
 		{
-        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCSCCHANNEL_SETINTERFACE_DUP6, "SetInterface failed reason=%d", r);
+		__KTRACE_OPT(KPANIC, Kern::Printf("SetInterface failed reason=%d", r));
 		return r;
 		}
 
@@ -2511,7 +2398,8 @@
 	// other endpoints
 	for (TInt i = 1; i <= num_endpoints; i++, pEndpointData++)
 		{
-        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_SETINTERFACE_DUP7, "SetInterface for ep=%d", i);
+		__KTRACE_OPT(KUSB, Kern::Printf("SetInterface for ep=%d", i));
+
 		if ((pEndpointData->iType==KUsbEpTypeControl)
 			|| (pEndpointData->iDir != KUsbEpDirIn && pEndpointData->iDir != KUsbEpDirOut)
 			|| (pEndpointData->iSize > 1024) || (pEndpointData->iSize<=0))
@@ -2542,8 +2430,9 @@
 			goto CleanUp;
 			}
 
-		OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_SETINTERFACE_DUP8, "SetInterface for ep=%d rec=0x%08x ep==0x%08x",
-                                        i, (TUint)alternateSettingListRec, (TUint)ep);                              
+	
+		__KTRACE_OPT(KUSB, Kern::Printf("SetInterface for ep=%d rec=0x%08x ep==0x%08x",
+										i, alternateSettingListRec, ep));
 		}
 
 	if (iAlternateSettingList->iHead)
@@ -2577,12 +2466,8 @@
 
  ReleaseInterface:
 #if _DEBUG
-#ifdef OST_TRACE_COMPILER_IN_USE
 	TInt r1 = iController->ReleaseInterface(this, aInterfaceNumber);
-#else
-	(void)  iController->ReleaseInterface(this, aInterfaceNumber);
-#endif
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_SETINTERFACE_DUP9, "Release Interface controller returned %d", r1);
+	__KTRACE_OPT(KUSB, Kern::Printf("Release Interface controller returned %d", r1));
 #else
 	(void)	iController->ReleaseInterface(this, aInterfaceNumber);
 #endif
@@ -2600,13 +2485,9 @@
 	if (mem!=NULL)
 		{
 		TInt j;
-		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, _REALIZEINTERFACE_DUMP, "Final chunk header State:" );
-		
-		for (j=0; j<30; j+=8) 
-		    {
-		    OstTrace1(TRACE_NORMAL, _REALIZEINTERFACE_DUMP_DUP1, "%2x", j);
-		    OstTraceExt1(TRACE_NORMAL, _REALIZEINTERFACE_DUMP_DUP2, "%{uint32[]}", TOstArray<TUint>(&mem[j], 8));
-		    }
+ 		Kern::Printf("Final chunk header State:");
+		for (j=0; j<30; j+=8)
+ 			Kern::Printf("%2x: %8x %8x %8x %8x %8x %8x %8x %8x", j, mem[j], mem[j+1], mem[j+2], mem[j+3], mem[j+4], mem[j+5], mem[j+6], mem[j+7] );
 		};
 	};
 #endif
@@ -2697,8 +2578,7 @@
 		iBuffers = (TUsbcScBuffer *) Kern::AllocZ(sizeof(TUsbcScBuffer) * (bufInfo.iTotalBuffers+2)); // +2 is for ep0.
 	if (!iBuffers)
 		{
-        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REALIZEINTERFACE, "Realize: Error: Alloc iBufers failed!" );
-        
+		__KTRACE_OPT(KUSB, Kern::Printf("Realize: Error: Alloc iBufers failed!"));
 		errorOrChunk = KErrNoMemory;
 		goto realize_end;
 		}
@@ -2707,18 +2587,19 @@
 	errorOrChunk = SetupEp0();
 	if (errorOrChunk)
 		{
-        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP1, "Realize: SetupEp0 . ERROR %d",errorOrChunk);
+		__KTRACE_OPT(KUSB, Kern::Printf("Realize: SetupEp0 . ERROR %d",errorOrChunk));
 		goto realize_end;
 		}
 
 	ep0Size = iEp0Endpoint->EndpointInfo()->iSize;
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP2, "Realize: Setup EP0. max packet size %d", ep0Size);
+	__KTRACE_OPT(KUSB, Kern::Printf("Realize: Setup EP0. max packet size %d", ep0Size));
+
 	// Create EP0 buffers
 	iEP0OutBuff=bufInfo.iTotalBuffers;
 	errorOrChunk = iBuffers[iEP0OutBuff].Construct(KUsbcScBiOut,  this,   KUsbScEP0OutBufPos, KUsbScEP0OutBufEnd, ep0Size, ep0Size, ep0Size);
 	if (errorOrChunk)
 		{
-        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP3, "Realize: Setup EP0 Out. ERROR %d",errorOrChunk);
+		__KTRACE_OPT(KUSB, Kern::Printf("Realize: Setup EP0 Out. ERROR %d",errorOrChunk));
 		goto realize_end;
 		}
 
@@ -2733,7 +2614,7 @@
 	errorOrChunk = iBuffers[iEP0InBuff].Construct( KUsbcScBiIn ,  this,   KUsbScEP0InBufPos , KUsbScEP0InBufEnd , ep0Size, ep0Size, ep0Size);	
 	if (errorOrChunk)
 		{
-        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP4, "Realize: Setup EP0 In. ERROR %d",errorOrChunk);
+		__KTRACE_OPT(KUSB, Kern::Printf("Realize: Setup EP0 In. ERROR %d",errorOrChunk));
 		goto realize_end;
 		}
 	
@@ -2747,7 +2628,8 @@
 	} // end ep0Size scope
 
 	// Create resources and tables.  .   .   .   .   .
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP5, "Realize: Create resources tables");
+	__KTRACE_OPT(KUSB, Kern::Printf("Realize: Create resources tables"));
+
 	{ // scope of bufNum
 	// For each EP buffer
 	TInt buffNum=0;
@@ -2769,7 +2651,8 @@
 				{
 				TInt bufStart = offset;
 
-				OstTraceDefExt4(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP6, "Realize:    buf row:%d inout %d, iBufferOffset[%d+2]=%x",endpoint, (TUint)inout, (TUint)buffNum, (TUint)bufStart);
+				__KTRACE_OPT(KUSB, Kern::Printf("Realize:    buf row:%d inout %d, iBufferOffset[%d+2]=%x",endpoint, inout, buffNum, bufStart));
+
 				bufsd =  &(bufInfo.iBufs[inout]);
 				// and then point all endpoints that use it, towards it.
 				TInt altSetting;	
@@ -2799,13 +2682,13 @@
 
 					if (endpointRecord->EndpointInfo()->iReadSize)
 						maxReadSize = (maxReadSize <= endpointRecord->EndpointInfo()->iReadSize) ? maxReadSize : endpointRecord->EndpointInfo()->iReadSize;
-                        OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP7, "Realize:      endpointNum %d in altSetting %d, alt table @ %d",
-                                                     endpointNumber, (TUint)altSetting,bufInfo.iAltSettingsTbl->iAltTableOffset[altSetting]);
-                                                   
+					
+					__KTRACE_OPT(KUSB, Kern::Printf("Realize:      endpointNum %d in altSetting %d, alt table @ %d",
+													 endpointNumber, altSetting,bufInfo.iAltSettingsTbl->iAltTableOffset[altSetting]));
 						}
 					else
 						{
-                        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP8, "Realize:      endpointNum NA in altSetting %d", altSetting);
+						__KTRACE_OPT(KUSB, Kern::Printf("Realize:      endpointNum NA in altSetting %d", altSetting));
 						}
 
 					} // end for
@@ -2877,7 +2760,7 @@
 #endif
 
 realize_end:
-    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP9, "Realize: cleanup.  Err=%d", errorOrChunk);
+	__KTRACE_OPT(KUSB, Kern::Printf("Realize: cleanup.  Err=%d", errorOrChunk));
 	// Here we clean up after either success, or after bailing out early.
 
 	bufInfo.Free();
@@ -2920,7 +2803,7 @@
 	if (openedCS)
 		NKern::ThreadLeaveCS();
 
-	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP10, "Realize: returning %x (%d)", errorOrChunk, errorOrChunk);
+	__KTRACE_OPT(KUSB, Kern::Printf("Realize: returning %x (%d)", errorOrChunk, errorOrChunk));
 	return errorOrChunk;
 } // End RealizeInterface
 
@@ -2931,8 +2814,7 @@
 
 void DLddUsbcScChannel::DestroyAllInterfaces()
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_DESTROYALLINTERFACES, "DLddUsbcScChannel::DestroyAllInterfaces" );
-    
+	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::DestroyAllInterfaces"));
 	// Removes all interfaces
 	if (iAlternateSettingList)
 		{
@@ -2943,7 +2825,7 @@
 				{
 				iAlternateSettingList->iTail = alternateSettingListRec->iPrevious; 
 				// If this contains NULL now that is only possible if the record to be deleted was at the head
-				OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DESTROYALLINTERFACES_DUP1, "Release interface %d \n", alternateSettingListRec->iSetting);
+				__KTRACE_OPT(KUSB, Kern::Printf("Release interface %d \n", alternateSettingListRec->iSetting));
 				iController->ReleaseInterface(this, alternateSettingListRec->iSetting);
 				delete alternateSettingListRec;
 				if (iAlternateSettingList->iTail == NULL) //No more interfaces left 
@@ -2962,7 +2844,7 @@
 	iAlternateSettingList = NULL;
 	iValidInterface = EFalse;
 
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DESTROYALLINTERFACES_DUP2, "DLddUsbcScChannel::DestroyAllInterfaces done");
+	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::DestroyAllInterfaces done"));
 	}
 
 
@@ -2975,7 +2857,7 @@
 
 void DLddUsbcScChannel::DestroyInterface(TUint aInterfaceNumber)
 	{
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_DESTROYINTERFACE, "DLddUsbcScChannel::DestroyInterface \n" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::DestroyInterface \n"));
 	
 	if (iAlternateSetting == aInterfaceNumber)
 		{
@@ -3005,7 +2887,7 @@
 					}
 				else	//Somewhere in the middle (would not expect this in normal operation, but here for completeness)
 					{
-                    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DESTROYINTERFACE_DUP1, "DLddUsbcScChannel::DestroyInterface Middle interface!\n" );
+					__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::DestroyInterface Middle interface!\n"));
 					alternateSettingListRec->iPrevious->iNext = alternateSettingListRec->iNext;
 					alternateSettingListRec->iNext->iPrevious = alternateSettingListRec->iPrevious;
 					}	
@@ -3055,8 +2937,7 @@
 
 void DLddUsbcScChannel::DestroyEp0()
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_DESTROYEP0, "DLddUsbcScChannel::DestroyEp0" );
-    
+	__KTRACE_OPT(KUSB, Kern::Printf(" DLddUsbcScChannel::DestroyEp0"));
 	delete iEp0Endpoint;
 	iEp0Endpoint = NULL;
 	}
@@ -3066,12 +2947,11 @@
     {
 	DLddUsbcScChannel* channel = (DLddUsbcScChannel*) aDLddUsbcScChannel;
 
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_REQUESTCALLBACKEP0, "DLddUsbcScChannel::RequestCallbackEp0" );
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::RequestCallbackEp0"));
 
 	if (channel->ChannelClosing())
 		{
-        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_REQUESTCALLBACKEP0_DUP1, "Channel Closing: Completion not accepted!" );
+		__KTRACE_OPT(KUSB, Kern::Printf("Channel Closing: Completion not accepted!"));
 		return;
 		}
 
@@ -3084,7 +2964,7 @@
 		channel->iBuffers[channel->iEP0OutBuff].CompleteRead();
 		return;
 	default:
-	    OstTrace1(TRACE_NORMAL, DLDDUSBCSCCHANNEL_REQUESTCALLBACKEP0_DUP2, "DLddUsbcScChannel::RequestCallbackEp0 - Unexpected completion direction %d",channel->iEp0Endpoint->iRequestCallbackInfo->iTransferDir);
+		Kern::Printf("DLddUsbcScChannel::RequestCallbackEp0 - Unexpected completion direction %d",channel->iEp0Endpoint->iRequestCallbackInfo->iTransferDir);
 		Kern::Fault("DLddUsbcScChannel::RequestCallbackEp0", __LINE__);
 		} 
 	}
@@ -3100,8 +2980,7 @@
 
 void DLddUsbcScChannel::EndpointStatusChangeCallback(TAny* aDLddUsbcScChannel)
     {
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_ENDPOINTSTATUSCHANGECALLBACK, "DLddUsbcScChannel::EndpointStatusChangeCallback" );
-    
+	__KTRACE_OPT(KUSB, Kern::Printf("EndpointStatusChangeCallback"));
     DLddUsbcScChannel* dUsbc = (DLddUsbcScChannel*) aDLddUsbcScChannel;
 	if (dUsbc->iChannelClosing)
 		return;
@@ -3109,7 +2988,7 @@
 	const TInt reqNo = (TInt) RDevUsbcScClient::ERequestEndpointStatusNotify;
 	if (dUsbc->iRequestStatus[reqNo])
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_ENDPOINTSTATUSCHANGECALLBACK_DUP1, "EndpointStatusChangeCallback Notify status" );
+		__KTRACE_OPT(KUSB, Kern::Printf("EndpointStatusChangeCallback Notify status"));
 		DThread* client = dUsbc->iClient;
 		// set client descriptor length to zero
 		TInt r = Kern::ThreadRawWrite(client, dUsbc->iEndpointStatusChangePtr, &endpointState,
@@ -3138,8 +3017,7 @@
  		 (i < KUsbcDeviceStateRequests) && ((deviceState = dUsbc->iStatusCallbackInfo.State(i)) != EUsbcNoState);
  		 ++i)
 		{
-        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_STATUSCHANGECALLBACK, "StatusChangeCallBack status=%d", deviceState);
-        
+ 		__KTRACE_OPT(KUSB, Kern::Printf("StatusChangeCallBack status=%d", deviceState));
 		if (deviceState & KUsbAlternateSetting)
 			{
 			dUsbc->ProcessAlternateSetting(deviceState);
@@ -3148,7 +3026,13 @@
 			{
 			dUsbc->ProcessDeviceState(deviceState);
 			// Send Status to EP0 buffer.		
-			dUsbc->iBuffers[dUsbc->iEP0OutBuff].SendEp0StatusPacket(deviceState);
+			// Before the client calls RDevUsbcScClient::FinalizeInterface(),
+			// this function might be called.
+			// So we add a guard for dUsbc->iBuffers
+			if( dUsbc->iBuffers )
+				{
+				dUsbc->iBuffers[dUsbc->iEP0OutBuff].SendEp0StatusPacket(deviceState);
+				}
 			}
 
 		// Only queue if userside is interested
@@ -3169,8 +3053,7 @@
 
 void DLddUsbcScChannel::OtgFeatureChangeCallback(TAny* aDLddUsbcScChannel)
     {
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_OTGFEATURECHANGECALLBACK, "DLddUsbcScChannel::OtgFeatureChangeCallback" );
-    
+	__KTRACE_OPT(KUSB, Kern::Printf("OtgFeatureChangeCallback"));
     DLddUsbcScChannel* dUsbc = (DLddUsbcScChannel*) aDLddUsbcScChannel;
 	if (dUsbc->iChannelClosing)
 		return;
@@ -3182,7 +3065,7 @@
     const TInt reqNo = (TInt) RDevUsbcScClient::ERequestOtgFeaturesNotify;
 	if (dUsbc->iRequestStatus[reqNo])
 		{
-        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_OTGFEATURECHANGECALLBACK_DUP1, "OtgFeatureChangeCallback Notify status" );
+		__KTRACE_OPT(KUSB, Kern::Printf("OtgFeatureChangeCallback Notify status"));
 		TInt r = Kern::ThreadRawWrite(dUsbc->iClient, dUsbc->iOtgFeatureChangePtr,
                                       &features, sizeof(TUint8), dUsbc->iClient);
 		if (r != KErrNone)
@@ -3260,15 +3143,14 @@
 				}
 			else
 				{
-                OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCSCCHANNEL_EPFROMALTERNATESETTING, "  Error: aEndpoint %d wrong for aAlternateSetting %d",
-                                                  aEndpoint, aAlternateSetting);
-                
+				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: aEndpoint %d wrong for aAlternateSetting %d",
+												  aEndpoint, aAlternateSetting));
 				return KErrNotFound;
 				}
 			}
 		alternateSettingListRec = alternateSettingListRec->iNext;
 		}
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FATAL, DLDDUSBCSCCHANNEL_EPFROMALTERNATESETTING_DUP1, "  Error: no aAlternateSetting %d found", aAlternateSetting);
+	__KTRACE_OPT(KPANIC, Kern::Printf("  Error: no aAlternateSetting %d found", aAlternateSetting));
 	return KErrNotFound;
 	}
 
@@ -3280,8 +3162,7 @@
 	{
 
 	TUint newSetting = aAlternateSetting&(~KUsbAlternateSetting);
-	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_PROCESSALTERNATESETTING, "ProcessAlternateSetting 0x%08x selecting alternate setting 0x%08x", aAlternateSetting, newSetting);
-	
+	__KTRACE_OPT(KUSB, Kern::Printf("ProcessAlternateSetting 0x%08x selecting alternate setting 0x%08x", aAlternateSetting, newSetting));
 	iUserKnowsAltSetting=EFalse;
 	iAlternateSetting = newSetting;
 	iAsSeq++; 
@@ -3305,20 +3186,19 @@
 
 TInt DLddUsbcScChannel::ProcessDeviceState(TUsbcDeviceState aDeviceState)
 	{
-    OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE, "DLddUsbcScChannel::ProcessDeviceState(%d -> %d)", iDeviceState, aDeviceState);
-    
+	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::ProcessDeviceState(%d -> %d)", iDeviceState, aDeviceState));
 	if (iDeviceState == aDeviceState)
 		{
-        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP1, "  No state change => nothing to be done.");
+		__KTRACE_OPT(KUSB, Kern::Printf("  No state change => nothing to be done."));
 		return KErrNone;
 		}
 	if (iDeviceState == EUsbcDeviceStateSuspended)
 		{
-        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP2, "  Coming out of Suspend: old state = %d", iOldDeviceState);
+		__KTRACE_OPT(KUSB, Kern::Printf("  Coming out of Suspend: old state = %d", iOldDeviceState));
 		iDeviceState = iOldDeviceState;
 		if (iDeviceState == aDeviceState)
 			{
-            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP3, "  New state same as before Suspend => nothing to be done.");
+			__KTRACE_OPT(KUSB, Kern::Printf("  New state same as before Suspend => nothing to be done."));
 			return KErrNone;
 			}
 		}
@@ -3327,7 +3207,7 @@
 	TInt cancellationCode = KErrNone;
 	if (aDeviceState == EUsbcDeviceStateSuspended)
 		{
-        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP4, "  Suspending...");
+		__KTRACE_OPT(KUSB, Kern::Printf("  Suspending..."));
 		iOldDeviceState = iDeviceState;
 		// Put PSL into low power mode here
 		}
@@ -3359,10 +3239,10 @@
 			}
 		else if (renumerateState)
 			{
-            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP5, "TUsbcScChannel:: Reumerated!");
+ 			__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScChannel:: Reumerated!"));
 			// Select main interface & latch in new endpoint set
 			SelectAlternateSetting(0);
-			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP6, "TUsbcScChannel:: StartReads!");
+			__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScChannel:: StartReads!"));
 			StartEpReads();
 			}
 		}
@@ -3390,8 +3270,7 @@
 			{
 			// Device state waiting to be sent userside
 			completeNow = ETrue;
-			OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_ALTERNATEDEVICESTATETESTCOMPLETE, "StatusChangeCallback Notify status" );
-			
+			__KTRACE_OPT(KUSB, Kern::Printf("StatusChangeCallback Notify status"));
 			// set client descriptor length to zero
 			TInt r = Kern::ThreadRawWrite(iClient, iStatusChangePtr, &deviceState,
 										  sizeof(TUint32), iClient);
@@ -3406,8 +3285,7 @@
 
 void DLddUsbcScChannel::DeConfigure(TInt aErrorCode)
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_DECONFIGURE, "DLddUsbcScChannel::DeConfigure()" );
-    
+	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::DeConfigure()"));
 	// Called after deconfiguration. Cancels transfers on all endpoints.
 	ResetInterface(aErrorCode);
 	// Cancel the endpoint status notify request if it is outstanding.
@@ -3427,27 +3305,29 @@
 	{
 	// Queued after enumeration. Starts reads on all endpoints.
 	// The endpoint itself decides if it can do a read
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_STARTEPREADS, "DLddUsbcScChannel::StartEpReads - 1" );
+	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::StartEpReads - 1"));
 	
 	TInt i;
 	TInt8 needsPacket;
 
 	for (i=0; i<iNumBuffers; i++)
 		{
-        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_STARTEPREADS_DUP1, "DLddUsbcScChannel::StartEpReads - 2 %d", i);
+		__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::StartEpReads - 2 %d",i));
+
 		needsPacket = iBuffers[i].iNeedsPacket;
 		if (needsPacket)
 			{
-            OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_STARTEPREADS_DUP2, "DLddUsbcScChannel::StartEpReads - 3");
+			__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::StartEpReads - 3"));
 			iBuffers[i].UpdateBufferList(0,0,(needsPacket==TUsbcScBuffer::KEpIsStarting));
 			}
 		}
 
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_STARTEPREADS_DUP3, "DLddUsbcScChannel::StartEpReads - 4");
+	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::StartEpReads - 4"));
+
 		// now update ep0
 		iBuffers[iEP0OutBuff].Ep0CancelLddRead();
 		iBuffers[iEP0OutBuff].UpdateBufferList(0,0);
-	    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_STARTEPREADS_DUP4, "DLddUsbcScChannel::StartEpReads - 5");
+	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::StartEpReads - 5"));
 
 	}
 
@@ -3469,8 +3349,7 @@
 		{
 		// Firstly, cancel ('garbge collect') any stale reads/writes into PIL.
 
-        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_RESETINTERFACE, "Cancelling transfer ep=%d", i);
-        
+		__KTRACE_OPT(KUSB, Kern::Printf("Cancelling transfer ep=%d", i));
 		iEndpoint[i]->AbortTransfer();
 
 		// All OUT endpoints need a packet sent, to indicate the termination of the current ep 'pipe'.
@@ -3499,8 +3378,7 @@
 
 TInt DLddUsbcScChannel::DoEmergencyComplete()
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, DLDDUSBCSCCHANNEL_DOEMERGENCYCOMPLETE, "DLddUsbcScChannel::DoEmergencyComplete" );
-    
+	__KTRACE_OPT(KUSB, Kern::Printf("DLddUsbcScChannel::DoEmergencyComplete"));
 	// cancel any pending DFCs
 	// complete all client requests
 
@@ -3523,7 +3401,7 @@
 	// Complete other Eps request
 	for (i = 1; i <= iNumberOfEndpoints; i++)
 		{
-        OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOEMERGENCYCOMPLETE_DUP1, "Cancelling transfer ep=%d", i);
+		__KTRACE_OPT(KUSB, Kern::Printf("Cancelling transfer ep=%d", i));
 		buffer=iEndpoint[i]->GetBuffer();
 		buffer->iStatusList.CancelQueued();
 		buffer->iStatusList.Complete(KErrDisconnected);
@@ -3535,7 +3413,7 @@
         {
         if (iRequestStatus[i])
             {
-            OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, DLDDUSBCSCCHANNEL_DOEMERGENCYCOMPLETE_DUP2, "Complete request 0x%x", iRequestStatus[i]);
+            __KTRACE_OPT(KUSB, Kern::Printf("Complete request 0x%x", iRequestStatus[i]));
             Kern::RequestComplete(iClient, iRequestStatus[i], KErrDisconnected);
             }
         }
@@ -3578,15 +3456,14 @@
 	  iBytesTransferred(0),
 	  iBuffer(NULL)
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSCENDPOINT_TUSBCSCENDPOINT_CONS, "TUsbcScEndpoint::TUsbcScEndpoint" );
-    
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScEndpoint::TUsbcScEndpoint"));
 	}
 
 
 TInt TUsbcScEndpoint::Construct()
 	{
-    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCENDPOINT_CONSTRUCT, "TUsbcScEndpoint::TUsbcScEndpoint iEndpointNumber %d\n",iEndpointNumber);
-    
+	__KTRACE_OPT(KUSB,Kern::Printf("TUsbcScEndpoint::TUsbcScEndpoint iEndpointNumber %d\n",iEndpointNumber));
+
 	iRequestCallbackInfo = new TUsbcRequestCallback(iLdd,
 													iEndpointNumber,
 													(iEndpointNumber==0)?DLddUsbcScChannel::RequestCallbackEp0:TUsbcScEndpoint::RequestCallback,
@@ -3600,8 +3477,7 @@
 
 TUsbcScEndpoint::~TUsbcScEndpoint()
 	{
-    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSCENDPOINT_TUSBCSCENDPOINT_DES, "TUsbcScEndpoint::~TUsbcScEndpoint(%d)", iEndpointNumber);
-    
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScEndpoint::~TUsbcScEndpoint(%d)", iEndpointNumber));
 	AbortTransfer();
 	delete iRequestCallbackInfo;
 	}
@@ -3611,11 +3487,11 @@
 
 void TUsbcScEndpoint::RequestCallback(TAny* aTUsbcScEndpoint)
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSCENDPOINT_REQUESTCALLBACK, "TUsbcScEndpoint::RequestCallback" );
-    
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScEndpoint::RequestCallback"));
+
 	if (((TUsbcScEndpoint*)aTUsbcScEndpoint)->iLdd->ChannelClosing())
 		{
-		OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCENDPOINT_REQUESTCALLBACK_DUP1, "Channel Closing: Completion not accepted!" );
+		__KTRACE_OPT(KUSB, Kern::Printf("Channel Closing: Completion not accepted!"));
 		return;
 		}
 
@@ -3628,7 +3504,7 @@
 		((TUsbcScEndpoint*) aTUsbcScEndpoint)->iBuffer->CompleteRead();
 		return;
 	default:
-	    OstTrace1(TRACE_NORMAL, TUSBCSCENDPOINT_REQUESTCALLBACK_DUP2, "TUsbcScEndpoint::RequestCallback - Unexpected compleation direction %d",((TUsbcScEndpoint*) aTUsbcScEndpoint)->iRequestCallbackInfo->iTransferDir);
+		Kern::Printf("TUsbcScEndpoint::RequestCallback - Unexpected compleation direction %d",((TUsbcScEndpoint*) aTUsbcScEndpoint)->iRequestCallbackInfo->iTransferDir);
 		Kern::Fault("TUsbcScEndpoint::RequestCallback", __LINE__);
 	} 
 	}
@@ -3644,13 +3520,12 @@
 	{
 	if (!iLdd->iRealizeCalled)
 		{
-        OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCENDPOINT_ABORTTRANSFER, "TUsbcScEndpoint::AbortTransfer Ep# %d Real Ep # %d - N.R.",iEndpointNumber, iRealEpNumber);
-        
+		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScEndpoint::AbortTransfer Ep# %d Real Ep # %d - N.R.",iEndpointNumber, iRealEpNumber));
 		return;
 		} 
 	else
 		{
-        OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCENDPOINT_ABORTTRANSFER_DUP1, "TUsbcScEndpoint::AbortTransfer Ep# %d Real Ep # %d",iEndpointNumber, iRealEpNumber);
+		__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScEndpoint::AbortTransfer Ep# %d Real Ep # %d",iEndpointNumber, iRealEpNumber));
 		}
 
 	
@@ -3664,18 +3539,17 @@
 			{
 			if (iEndpointNumber!=0) // endpoint zero starts off not sent in any direction, then keeps changing.
 				{
-                OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCENDPOINT_ABORTTRANSFER_DUP2, "\nTUsbcScEndpoint::AbortTransfer WARNING: Invalid Direction %d on (%d,%d)!\n",iRequestCallbackInfo->iTransferDir,iEndpointNumber, iRealEpNumber);
+				__KTRACE_OPT(KUSB,Kern::Printf("\nTUsbcScEndpoint::AbortTransfer WARNING: Invalid Direction %d on (%d,%d)!\n",iRequestCallbackInfo->iTransferDir,iEndpointNumber, iRealEpNumber));
 				}
 			else
 				{
-                OstTraceDefExt3(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCENDPOINT_ABORTTRANSFER_DUP3, "\nTUsbcScEndpoint::AbortTransfer Can't stop direction %d on (%d,%d)!\n",iRequestCallbackInfo->iTransferDir,iEndpointNumber, iRealEpNumber);
+				__KTRACE_OPT(KUSB, Kern::Printf("\nTUsbcScEndpoint::AbortTransfer Can't stop direction %d on (%d,%d)!\n",iRequestCallbackInfo->iTransferDir,iEndpointNumber, iRealEpNumber));
 				}
 			}
 		}
 	else if (!iBuffer)
 		{
-        OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCENDPOINT_ABORTTRANSFER_DUP4, "\nTUsbcScEndpoint::AbortTransfer WARNING: iBuffer is NULL on (%d,%d)\n",iEndpointNumber, iRealEpNumber);
-
+		__KTRACE_OPT(KUSB,Kern::Printf("\nTUsbcScEndpoint::AbortTransfer WARNING: iBuffer is NULL on (%d,%d)\n",iEndpointNumber, iRealEpNumber));
 		return;
 		}
 	
@@ -3683,11 +3557,10 @@
 		iRequestCallbackInfo->iDfc.Cancel();
 	else
 		{
-        OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCENDPOINT_ABORTTRANSFER_DUP5, "\nTUsbcScEndpoint::AbortTransfer WARNING: iRequestCallbackInfo is NULL\n");
-
+		__KTRACE_OPT(KUSB,Kern::Printf("\nTUsbcScEndpoint::AbortTransfer WARNING: iRequestCallbackInfo is NULL\n"));
 		}
 		
-	OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TUSBCSCENDPOINT_ABORTTRANSFER_DUP6, "TUsbcScEndpoint Done.");
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScEndpoint Done."));
 	}
 
 // End TUsbcScEndpoint
@@ -3716,8 +3589,7 @@
 
 TUsbcScAlternateSetting::~TUsbcScAlternateSetting()
 	{
-    OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_FLOW, TUSBCSCALTERNATESETTING_TUSBCSCALTERNATESETTING_DES, "TUsbcScAlternateSetting::~TUsbcScAlternateSetting()" );
-    
+	__KTRACE_OPT(KUSB, Kern::Printf("TUsbcScAlternateSetting::~TUsbcScAlternateSetting()"));
 	for (TInt i = 0; i <= KMaxEndpointsPerClient; i++)
 		{
 		delete iEndpoint[i];
--- a/kernel/eka/drivers/usbcsc/traces/OstTraceDefinitions.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-// 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:
-// 
-//
-
-
-#ifndef __OSTTRACEDEFINITIONS_H__
-#define __OSTTRACEDEFINITIONS_H__
-// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
-// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
-// #define OST_TRACE_COMPILER_IN_USE
-#include <opensystemtrace.h>
-#endif
--- a/kernel/eka/drivers/usbcsc/traces/fixed_id.definitions	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,266 +0,0 @@
-#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
-[GROUP]TRACE_FATAL=0x81
-[GROUP]TRACE_FLOW=0x8a
-[GROUP]TRACE_NORMAL=0x86
-[TRACE]TRACE_FATAL[0x81]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP44=0x2
-[TRACE]TRACE_FATAL[0x81]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP48=0x3
-[TRACE]TRACE_FATAL[0x81]_DLDDUSBCSCCHANNEL_EPFROMALTERNATESETTING=0x6
-[TRACE]TRACE_FATAL[0x81]_DLDDUSBCSCCHANNEL_EPFROMALTERNATESETTING_DUP1=0x7
-[TRACE]TRACE_FATAL[0x81]_DLDDUSBCSCCHANNEL_SETINTERFACE_DUP6=0x5
-[TRACE]TRACE_FATAL[0x81]_DUSBCSCLOGDEVICE_INSTALL=0x1
-[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_DECONFIGURE=0x9
-[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_DESTROYALLINTERFACES=0x12
-[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_DESTROYEP0=0x14
-[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_DESTROYINTERFACE=0x13
-[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_CONS=0x6
-[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_DES=0x10
-[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_DOEMERGENCYCOMPLETE=0xb
-[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_ENDPOINTSTATUSCHANGECALLBACK=0x7
-[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_OTGFEATURECHANGECALLBACK=0x8
-[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_REQUESTCALLBACKEP0=0x15
-[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_REQUESTUSERHANDLE=0x11
-[TRACE]TRACE_FLOW[0x8A]_DLDDUSBCSCCHANNEL_STARTEPREADS=0xa
-[TRACE]TRACE_FLOW[0x8A]_TREALIZEINFO_CALCBUFFSIZES=0x5
-[TRACE]TRACE_FLOW[0x8A]_TREALIZEINFO_COPYANDSORTENDPOINTS=0x4
-[TRACE]TRACE_FLOW[0x8A]_TUSBCSCALTERNATESETTING_TUSBCSCALTERNATESETTING_DES=0xf
-[TRACE]TRACE_FLOW[0x8A]_TUSBCSCBUFFER_DESTROY=0x2
-[TRACE]TRACE_FLOW[0x8A]_TUSBCSCBUFFER_STARTDATAWRITE=0x3
-[TRACE]TRACE_FLOW[0x8A]_TUSBCSCCHUNKINFO_CHUNKCLEANUP=0x1
-[TRACE]TRACE_FLOW[0x8A]_TUSBCSCENDPOINT_REQUESTCALLBACK=0xe
-[TRACE]TRACE_FLOW[0x8A]_TUSBCSCENDPOINT_TUSBCSCENDPOINT_CONS=0xc
-[TRACE]TRACE_FLOW[0x8A]_TUSBCSCENDPOINT_TUSBCSCENDPOINT_DES=0xd
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_ALTERNATEDEVICESTATETESTCOMPLETE=0xd8
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DESTROYALLINTERFACES_DUP1=0xc5
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DESTROYALLINTERFACES_DUP2=0xc6
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DESTROYINTERFACE_DUP1=0xc8
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_DES_DUP1=0x3c
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_DES_DUP2=0x3d
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_DES_DUP3=0x3e
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_DES_DUP4=0xea
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCANCEL=0x57
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCANCEL_DUP1=0x58
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCANCEL_DUP2=0x59
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCANCEL_DUP3=0x5a
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCANCEL_DUP4=0x5b
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCANCEL_DUP5=0x5c
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCANCEL_DUP6=0x5d
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCANCEL_DUP7=0x5e
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCANCEL_DUP8=0x5f
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCANCEL_DUP9=0x60
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL=0x61
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP1=0x62
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP10=0x6b
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP11=0x6c
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP12=0x6d
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP13=0x6e
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP14=0x6f
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP15=0x70
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP16=0x71
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP18=0x73
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP2=0x63
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP20=0x75
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP21=0x76
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP22=0x77
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP23=0x78
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP24=0x79
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP25=0x7a
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP26=0x7b
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP27=0x7c
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP28=0x7d
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP29=0x7e
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP3=0x64
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP30=0x7f
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP32=0x81
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP33=0x82
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP34=0x83
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP35=0x84
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP36=0x85
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP37=0x86
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP38=0x87
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP39=0x88
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP4=0x65
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP40=0x89
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP41=0x8a
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP42=0x8b
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP43=0x8c
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP45=0x8d
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP46=0x8e
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP47=0x8f
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP49=0x90
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP5=0x66
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP50=0x91
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP51=0x92
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP52=0x93
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP53=0x94
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP54=0x95
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP55=0x96
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP56=0x97
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP57=0x98
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP58=0x99
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP59=0x9a
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP6=0x67
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP60=0x9b
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP61=0x9c
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP62=0x9d
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP63=0x9e
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP64=0x9f
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP65=0xa0
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP66=0xa1
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP67=0xa2
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP68=0xa3
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP69=0xa4
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP7=0x68
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP70=0xa5
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP71=0xa6
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP72=0xa7
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP73=0xa8
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP74=0xa9
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP75=0xaa
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP76=0xab
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP8=0x69
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCONTROL_DUP9=0x6a
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOCREATE=0x3f
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOEMERGENCYCOMPLETE_DUP1=0xde
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOEMERGENCYCOMPLETE_DUP2=0xdf
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREADDATANOTIFY=0x4c
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREADDATANOTIFY_DUP1=0x4d
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREADDATANOTIFY_DUP2=0x4e
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREADDATANOTIFY_DUP3=0x4f
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREADDATANOTIFY_DUP4=0x50
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST=0x41
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP1=0x42
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP10=0x4b
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP17=0x72
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP19=0x74
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP2=0x43
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP3=0x44
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP31=0x80
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP4=0x45
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP5=0x46
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP6=0x47
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP7=0x48
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP8=0x49
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOREQUEST_DUP9=0x4a
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOWRITEDATA=0x51
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOWRITEDATA_DUP1=0x52
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOWRITEDATA_DUP2=0x53
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOWRITEDATA_DUP3=0x54
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOWRITEDATA_DUP4=0x55
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DOWRITEDATA_DUP5=0x56
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_ENDPOINTSTATUSCHANGECALLBACK_DUP1=0xcd
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_HANDLEMSG=0x40
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_OTGFEATURECHANGECALLBACK_DUP1=0xcf
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_PROCESSALTERNATESETTING=0xd0
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE=0xd1
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP1=0xd2
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP2=0xd3
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP3=0xd4
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP4=0xd5
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP5=0xd6
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_PROCESSDEVICESTATE_DUP6=0xd7
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REALIZEINTERFACE=0xb9
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP1=0xba
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP10=0xc3
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP2=0xbb
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP3=0xbc
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP4=0xbd
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP5=0xbe
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP6=0xbf
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP7=0xc0
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP8=0xc1
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REALIZEINTERFACE_DUP9=0xc2
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REQUESTCALLBACKEP0_DUP1=0xcb
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REQUESTCALLBACKEP0_DUP2=0xcc
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REQUESTUSERHANDLE_DUP1=0xac
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_RESETINTERFACE=0xdd
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_SETINTERFACE=0xad
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_SETINTERFACE_DUP1=0xae
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_SETINTERFACE_DUP2=0xaf
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_SETINTERFACE_DUP3=0xb0
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_SETINTERFACE_DUP4=0xb1
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_SETINTERFACE_DUP5=0xb2
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_SETINTERFACE_DUP7=0xb3
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_SETINTERFACE_DUP8=0xb4
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_SETINTERFACE_DUP9=0xb5
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_STARTEPREADS_DUP1=0xd9
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_STARTEPREADS_DUP2=0xda
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_STARTEPREADS_DUP3=0xdb
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_STARTEPREADS_DUP4=0xdc
-[TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_STATUSCHANGECALLBACK=0xce
-[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_CALCBUFFSIZES_DUP1=0x33
-[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_CALCBUFFSIZES_DUP2=0x34
-[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_CALCBUFFSIZES_DUP3=0x35
-[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_CALCBUFFSIZES_DUP4=0x36
-[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_CALCBUFFSIZES_DUP5=0x37
-[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_COPYANDSORTENDPOINTS_DUP1=0x2b
-[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_COPYANDSORTENDPOINTS_DUP2=0x2c
-[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_COPYANDSORTENDPOINTS_DUP3=0x2d
-[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_COPYANDSORTENDPOINTS_DUP4=0x2e
-[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_COPYANDSORTENDPOINTS_DUP5=0x2f
-[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_COPYANDSORTENDPOINTS_DUP6=0x30
-[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_COPYANDSORTENDPOINTS_DUP7=0x31
-[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_COPYANDSORTENDPOINTS_DUP8=0x32
-[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_INIT=0x29
-[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_INIT_DUP1=0x2a
-[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_LAYOUTCHUNKHEADER=0x38
-[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_LAYOUTCHUNKHEADER_DUP1=0x39
-[TRACE]TRACE_NORMAL[0x86]_TREALIZEINFO_LAYOUTCHUNKHEADER_DUP2=0x3a
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_COMPLETEREAD=0x15
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_COMPLETEWRITE=0x23
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_CREATECHUNKBUFFERHEADER=0xb
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_POPSTALL=0x1e
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_SENDEP0STATUSPACKET=0x24
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTDATAREAD=0xf
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTDATAREAD_DUP1=0x10
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTDATAREAD_DUP2=0x11
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTDATAREAD_DUP3=0x12
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTDATAREAD_DUP4=0x13
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTDATAREAD_DUP5=0x14
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTDATAWRITE_DUP1=0x1f
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTDATAWRITE_DUP2=0x20
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTDATAWRITE_DUP3=0x21
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTDATAWRITE_DUP4=0x22
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTENDPOINT=0xc
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTENDPOINT_DUP1=0xd
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_STARTENDPOINT_DUP2=0xe
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_UPDATEBUFFERLIST=0x16
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP1=0x17
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP2=0x18
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP3=0x19
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP4=0x1a
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP5=0x1b
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP6=0x1c
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCBUFFER_UPDATEBUFFERLIST_DUP7=0x1d
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCCHUNKINFO_CHUNKALLOC=0x4
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCCHUNKINFO_CHUNKALLOC_DUP1=0x5
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCCHUNKINFO_CHUNKALLOC_DUP2=0x6
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCCHUNKINFO_CHUNKALLOC_DUP3=0x7
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCCHUNKINFO_CHUNKALLOC_DUP4=0x8
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCCHUNKINFO_CLOSE=0x1
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCCHUNKINFO_CLOSE_DUP1=0x2
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCCHUNKINFO_CLOSE_DUP2=0x3
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCCHUNKINFO_NEW=0x9
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCCHUNKINFO_NEW_DUP1=0xa
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCENDPOINT_ABORTTRANSFER=0xe3
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCENDPOINT_ABORTTRANSFER_DUP1=0xe4
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCENDPOINT_ABORTTRANSFER_DUP2=0xe5
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCENDPOINT_ABORTTRANSFER_DUP3=0xe6
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCENDPOINT_ABORTTRANSFER_DUP4=0xe7
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCENDPOINT_ABORTTRANSFER_DUP5=0xe8
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCENDPOINT_ABORTTRANSFER_DUP6=0xe9
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCENDPOINT_CONSTRUCT=0xe0
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCENDPOINT_REQUESTCALLBACK_DUP1=0xe1
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCENDPOINT_REQUESTCALLBACK_DUP2=0xe2
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCSTATUSLIST_ADD=0x25
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCSTATUSLIST_ADD_DUP1=0x26
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCSTATUSLIST_COMPLETE=0x28
-[TRACE]TRACE_NORMAL[0x86]_TUSBCSCSTATUSLIST_COMPLETE_TINT=0x27
-[TRACE]TRACE_NORMAL[0x86]__REALIZEINTERFACE_DUMP=0xb6
-[TRACE]TRACE_NORMAL[0x86]__REALIZEINTERFACE_DUMP_DUP1=0xb7
-[TRACE]TRACE_NORMAL[0x86]__REALIZEINTERFACE_DUMP_DUP2=0xb8
-[[OBSOLETE]][TRACE]TRACE_FATAL[0x81]_DLDDUSBCSCCHANNEL_REQUESTUSERHANDLE=0x4
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DESTROYALLINTERFACES=0xc4
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DESTROYEP0=0xc9
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DESTROYINTERFACE=0xc7
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_DLDDUSBCSCCHANNEL_DES=0x3b
-[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DLDDUSBCSCCHANNEL_REQUESTCALLBACKEP0=0xca
--- a/kernel/eka/drivers/usbcsc/usbcsc.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/usbcsc/usbcsc.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-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"
@@ -17,8 +17,7 @@
 
 #include "../../kernel/kern_ext.mmh"
 
-USERINCLUDE	../../include/drivers 
-USERINCLUDE     traces
+USERINCLUDE	../../include/drivers
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 target			usbcsc.ldd
--- a/kernel/eka/drivers/usbcsc/usbcsc_bil.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/usbcsc/usbcsc_bil.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,10 +19,7 @@
 #include <e32std_private.h>
 #include <d32usbcsc.h>
 #include <e32debug.h>
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "usbcsc_bilTraces.h"
-#endif
+
 /** @file usbcsc_bil.cpp
 
 	Buffer Interface Layer for USB Client Device driver stack, using shared chunks.
@@ -41,31 +38,6 @@
 	return r;
 	}
 
-// empty a endpoint buffer, this is called when device state enter undefined
-TInt RDevUsbcScClient::Empty(TUint aBufferOffset)
-{
-	TUint8* base = iSharedChunk.Base();
-	SUsbcScBufferHeader* endpointHdr = (SUsbcScBufferHeader*) (aBufferOffset + base);
-	TUint localTail = endpointHdr->iBilTail;
-	TUsbcScTransferHeader* currentTransfer;
-	TInt err=KErrNone;
-
-	while (ETrue)
-		{
-		if (localTail == (TUint) endpointHdr->iHead)
-			{
-			err = KErrNone;			
-			break;
-			}
-		currentTransfer = (TUsbcScTransferHeader*) (base + localTail);
-		localTail = currentTransfer->iNext;
-		} // end while
-	endpointHdr->iBilTail = localTail;
-	endpointHdr->iTail = localTail;
-	return err;
-}
-
-
 
 EXPORT_C TInt RDevUsbcScClient::FinalizeInterface(RChunk*& aChunk)
 	{
@@ -77,35 +49,6 @@
 	}
 
 
-EXPORT_C void RDevUsbcScClient::ResetAltSetting()
-	{
-	if (iAlternateSetting == 0)
-		return;
-	TUsbcScChunkHeader chunkHeader(iSharedChunk);
-	
-	TInt ep;
-	TInt noEp;
-	TUint bufOff;
-	TUsbcScHdrEndpointRecord* endpointInf = NULL;
-
-	// check if alternate setting contains all IN endpoints
-	noEp = chunkHeader.GetNumberOfEndpoints(iAlternateSetting);
-
-	// for each used buffer. 
-	for (ep=1;ep<=noEp;ep++)
-		{
-		bufOff = chunkHeader.GetBuffer(iAlternateSetting,ep,endpointInf)->Offset();	
-	
-		if (endpointInf->Direction() & KUsbScHdrEpDirectionOut) 
-			{
-			Empty(bufOff); // we need to remove anythng in the way, and get it ready for reading.
-			}
-		}
-	
-	iAlternateSetting = 0;
-	}
-
-
 EXPORT_C TInt RDevUsbcScClient::OpenEndpoint(TEndpointBuffer& aEpB, TInt aEpI)
 	{
 	TUsbcScHdrEndpointRecord* endpointInf = NULL;
@@ -163,7 +106,7 @@
 
 #ifdef _DEBUG
 	aEpB.Dump();
-	OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, RDEVUSBCSCCLIENT_OPENENDPOINT, "iEndpointStatus: %x \n",iEndpointStatus );
+	RDebug::Printf("iEndpointStatus: %x \n",iEndpointStatus);
 #endif
 	return KErrNone;
 	}
@@ -175,14 +118,12 @@
  
 TInt RDevUsbcScClient::Drain(TUint aBufferOffset)
 {
-
 	TUint8* base = iSharedChunk.Base();
 	SUsbcScBufferHeader* endpointHdr = (SUsbcScBufferHeader*) (aBufferOffset+base);
 	TUint localTail = endpointHdr->iBilTail;
 	TUsbcScTransferHeader* currentTransfer;
 	TUint16 next = (iAltSettingSeq+1)&0xFFFF;
 	TInt err=KErrNone;
-	TBool aZLP;
 
 	while (ETrue)
 		{
@@ -194,13 +135,8 @@
 		currentTransfer = (TUsbcScTransferHeader*) (base + localTail);
 
 		if (currentTransfer->iAltSettingSeq == next)
-			{			
+			{
 			iNewAltSetting=currentTransfer->iAltSetting; // record new alt setting
-			aZLP = (currentTransfer->iFlags & KUsbcScShortPacket)!=EFalse;
-			if ((currentTransfer->iBytes==0) && (!aZLP)) // take empty packet which is for alternate setting change
-				{
-				localTail = currentTransfer->iNext;
-				}
 			break;
 			}
 		else
@@ -228,7 +164,7 @@
 		// if alternate setting has not changed
 		return KErrNotReady;
 	else
-		{		
+		{
 		iNewAltSetting=currentTransfer->iAltSetting;
 		return KErrNone;
 		}
@@ -469,7 +405,6 @@
 
 	TUsbcScTransferHeader* currentTransfer;
 	TInt r;
-	TInt aBilTail;
 	do // until we have a transfer with data.
 		{
 		iEndpointHdr->iTail = iEndpointHdr->iBilTail; 
@@ -480,22 +415,19 @@
 				return r;
 			}
 		currentTransfer = (TUsbcScTransferHeader*) (iBaseAddr + iEndpointHdr->iBilTail);
-		aBilTail = iEndpointHdr->iBilTail;
+
 		iEndpointHdr->iBilTail = currentTransfer->iNext;
 		aZLP = (currentTransfer->iFlags & KUsbcScShortPacket)!=EFalse;
 
 		if(currentTransfer->iAltSettingSeq != (iClient->iAltSettingSeq))  // if alternate setting has changed
 			{
 			if (currentTransfer->iAltSettingSeq == (iClient->iAltSettingSeq+1))	   //Note- KIS ATM, if multiple alternate setting changes happen
-				{
 				iClient->iNewAltSetting = currentTransfer->iAltSetting; //before StartNextOutAlternateSetting is called, 		   
-																	   //this variable will reflect the latest requested AlternateSetting		
-				}													   
+																	   //this variable will reflect the latest requested AlternateSetting
 
 
 			if (iEndpointNumber != KEp0Number)
 				{
-				iEndpointHdr->iBilTail = aBilTail;
 //				iOutState =  EEOF;	
 				return KErrEof;
 				}
@@ -518,10 +450,8 @@
 	if (iOutState)
 		return iOutState;
 
-
 	TUsbcScTransferHeader* currentTransfer;
 	TInt r;
-	TInt aBilTail;
 	do // until we have a transfer with data.
 		{
 		if(iEndpointHdr->iBilTail == iEndpointHdr->iHead)  //If no new data, create request
@@ -534,7 +464,6 @@
 			}
 
 		currentTransfer = (TUsbcScTransferHeader*) (iBaseAddr + iEndpointHdr->iBilTail);
-		aBilTail = iEndpointHdr->iBilTail;
 		iEndpointHdr->iBilTail = currentTransfer->iNext;
 		aZLP = (currentTransfer->iFlags & KUsbcScShortPacket)!=EFalse; // True if short packet else false 
 
@@ -543,19 +472,16 @@
 			if (currentTransfer->iAltSettingSeq == (iClient->iAltSettingSeq+1))	   //Note- KIS ATM, if multiple alternate setting changes happen
 				iClient->iNewAltSetting = currentTransfer->iAltSetting; //before StartNextOutAlternateSetting is called, 		   
 																	   //this variable will reflect the latest requested AlternateSetting
-			
+			Expire(currentTransfer->iData.i);
 			if (iEndpointNumber != KEp0Number)
 				{
-				iEndpointHdr->iBilTail = aBilTail;
 //				iOutState = EEOF;
 				return KErrEof;
 				}
 			else if ((currentTransfer->iBytes==0) && (!aZLP)) 
 				{
-				Expire(currentTransfer->iData.i);
 				return KErrAlternateSettingChanged;
 				}
-			Expire(currentTransfer->iData.i);
 
 			}	
 
@@ -597,12 +523,11 @@
 
 	TInt prevTail = NULL;
 	TBool found = EFalse;
-	
 	while (currentTail != iEndpointHdr->iBilTail)
-		{			
+		{
 		TUsbcScTransferHeader* currentTransfer = (TUsbcScTransferHeader*) (iBaseAddr + currentTail);
 		if (currentTail == offsetToExpire)		// found which to expire
-			{			
+			{
 			found = ETrue;
 			// This offset is to be expired
 			if (prevTail == NULL)
@@ -622,7 +547,7 @@
 			}
 		prevTail = currentTail;
 		currentTail = currentTransfer->iNext;
-		}	
+		}
 	return found ? KErrNone : KErrNotFound;
 	}
 
@@ -702,9 +627,7 @@
 
 EXPORT_C void TEndpointBuffer::Dump()
 	{
-	OstTraceDefExt5(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TENDPOINTBUFFER_DUMP, "TEndpointBuffer::Dump iBufferStart: 0x%x, iSize: 0x%x, iEndpointNumber: 0x%x, iBufferNum: %d, iInState: 0x%x",
-            (TUint)iBufferStartAddr,iSize,iEndpointNumber,iBufferNum, (TUint)iInState);
-
-    OstTraceDef1(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TENDPOINTBUFFER_DUMP_DUP1, " iOutState: 0x%x\n", iOutState);
+	RDebug::Printf("TEndpointBuffer::Dump iBufferStart: 0x%x, iSize: 0x%x, iEndpointNumber: 0x%x, iBufferNum: %d, iInState: 0x%x iOutState: 0x%x\n",
+							iBufferStartAddr,iSize,iEndpointNumber,iBufferNum,iInState,iOutState);
 	}
 
--- a/kernel/eka/drivers/usbcsc/usbcsc_bil.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/usbcsc/usbcsc_bil.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -15,8 +15,7 @@
 // 
 //
 
-USERINCLUDE	../../include 
-USERINCLUDE     traces
+USERINCLUDE	../../include
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 target			usbcsc_bil.dll
@@ -29,5 +28,3 @@
 
 VENDORID 0x70000001
 capability		all
-
-UID 0 0x20031D6E
--- a/kernel/eka/drivers/usbho/usbdescriptors/usbdescparser.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/usbho/usbdescriptors/usbdescparser.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -49,18 +49,16 @@
 
 	// First we must find the top level descriptor (the one we will return to the caller).
 	TRAP(ret, aDesc = FindParserAndParseAndCheckL(des, NULL));
+	if(ret == KErrNone && !aDesc)
+		{
+		ret = KErrNotFound;
+		}
+
 	if(ret == KErrNone)
 		{
-		if(!aDesc)
-			{
-			ret = KErrNotFound;
-			}
-		else
-			{
-			// Now we have a top level descriptor - we now try to build up the descriptor
-			// tree if there are more descriptors available.
-			TRAP(ret, ParseDescriptorTreeL(des, *aDesc));
-			}
+		// Now we have a top level descriptor - we now try to build up the descriptor
+		// tree if there are more descriptors available.
+		TRAP(ret, ParseDescriptorTreeL(des, *aDesc));
 		}
 
 	// Ensure that all the data has been parsed if successful.
@@ -71,13 +69,6 @@
 		ret = KErrUnknown;
 		}
 
-	// release the allocated descriptor if there was an error
-	if(ret != KErrNone && aDesc)
-		{
-		delete aDesc;
-		aDesc = NULL;
-		}
-
 	return ret;
 	}
 
--- a/kernel/eka/drivers/usbho/usbdi_utils/usbtransfers.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/drivers/usbho/usbdi_utils/usbtransfers.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -38,7 +38,7 @@
 /**
 Releases resources allocated to this transfer descriptor.
 */
-EXPORT_C void RUsbTransferDescriptor::Close()
+void RUsbTransferDescriptor::Close()
 	{
 	// Do nothing - the buffer is owned by the {R,D}UsbInterface.
 	// This is provided in case the descriptor owns resources in future.
--- a/kernel/eka/eabi/dma2u.def	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-EXPORTS
-	_Z11DmaTestInfov @ 1 NONAME
-	_Z13DmaTestInfoV2v @ 2 NONAME
-	_ZN11DDmaRequest11FreeDesListEv @ 3 NONAME
-	_ZN11DDmaRequest13ExpandDesListEi @ 4 NONAME
-	_ZN11DDmaRequest13FragmentCountEv @ 5 NONAME
-	_ZN11DDmaRequest14FreeDstDesListEv @ 6 NONAME
-	_ZN11DDmaRequest14FreeSrcDesListEv @ 7 NONAME
-	_ZN11DDmaRequest16DstFragmentCountEv @ 8 NONAME
-	_ZN11DDmaRequest16ExpandDstDesListEi @ 9 NONAME
-	_ZN11DDmaRequest16ExpandSrcDesListEi @ 10 NONAME
-	_ZN11DDmaRequest16SrcFragmentCountEv @ 11 NONAME
-	_ZN11DDmaRequest24EnableDstElementCountingEi @ 12 NONAME
-	_ZN11DDmaRequest24EnableSrcElementCountingEi @ 13 NONAME
-	_ZN11DDmaRequest25DisableDstElementCountingEv @ 14 NONAME
-	_ZN11DDmaRequest25DisableSrcElementCountingEv @ 15 NONAME
-	_ZN11DDmaRequest30TotalNumDstElementsTransferredEv @ 16 NONAME
-	_ZN11DDmaRequest30TotalNumSrcElementsTransferredEv @ 17 NONAME
-	_ZN11DDmaRequest5QueueEv @ 18 NONAME
-	_ZN11DDmaRequest8FragmentERK16TDmaTransferArgs @ 19 NONAME
-	_ZN11DDmaRequest8FragmentEmmijm @ 20 NONAME
-	_ZN11DDmaRequestC1ER11TDmaChannelPFvNS_7TResultEPvES3_i @ 21 NONAME
-	_ZN11DDmaRequestC1ER11TDmaChannelPFvj10TDmaResultPvP10SDmaDesHdrES3_j @ 22 NONAME
-	_ZN11DDmaRequestC2ER11TDmaChannelPFvNS_7TResultEPvES3_i @ 23 NONAME
-	_ZN11DDmaRequestC2ER11TDmaChannelPFvj10TDmaResultPvP10SDmaDesHdrES3_j @ 24 NONAME
-	_ZN11DDmaRequestD0Ev @ 25 NONAME
-	_ZN11DDmaRequestD1Ev @ 26 NONAME
-	_ZN11DDmaRequestD2Ev @ 27 NONAME
-	_ZN11TDmaChannel13LinkToChannelEPS_ @ 28 NONAME
-	_ZN11TDmaChannel14IsrRedoRequestEmmjmi @ 29 NONAME
-	_ZN11TDmaChannel15StaticExtensionEiPv @ 30 NONAME
-	_ZN11TDmaChannel16AddressAlignMaskEjjm @ 31 NONAME
-	_ZN11TDmaChannel17MaxTransferLengthEjjm @ 32 NONAME
-	_ZN11TDmaChannel18MissNextInterruptsEi @ 33 NONAME
-	_ZN11TDmaChannel4OpenERKNS_11SCreateInfoERPS_ @ 34 NONAME
-	_ZN11TDmaChannel5CloseEv @ 35 NONAME
-	_ZN11TDmaChannel5PauseEv @ 36 NONAME
-	_ZN11TDmaChannel6ResumeEv @ 37 NONAME
-	_ZN11TDmaChannel8DmacCapsEv @ 38 NONAME
-	_ZN11TDmaChannel8FailNextEi @ 39 NONAME
-	_ZN11TDmaChannel9CancelAllEv @ 40 NONAME
-	_ZN11TDmaChannel9ExtensionEiPv @ 41 NONAME
-	_ZN16TDmaTransferArgsC1ERK18TDmaTransferConfigS2_mjj15TDmaGraphicsOpsm @ 42 NONAME
-	_ZN16TDmaTransferArgsC1Ejjjjjj12TDmaAddrModejj13TDmaBurstSizej15TDmaGraphicsOpsm @ 43 NONAME
-	_ZN16TDmaTransferArgsC1Ev @ 44 NONAME
-	_ZN16TDmaTransferArgsC2ERK18TDmaTransferConfigS2_mjj15TDmaGraphicsOpsm @ 45 NONAME
-	_ZN16TDmaTransferArgsC2Ejjjjjj12TDmaAddrModejj13TDmaBurstSizej15TDmaGraphicsOpsm @ 46 NONAME
-	_ZN16TDmaTransferArgsC2Ev @ 47 NONAME
-	_ZN18TDmaTransferConfigC1Emj12TDmaAddrModej13TDmaBurstSizejjji @ 48 NONAME
-	_ZN18TDmaTransferConfigC1Emjjjiijj13TDmaBurstSizejji @ 49 NONAME
-	_ZN18TDmaTransferConfigC1Ev @ 50 NONAME
-	_ZN18TDmaTransferConfigC2Emj12TDmaAddrModej13TDmaBurstSizejjji @ 51 NONAME
-	_ZN18TDmaTransferConfigC2Emjjjiijj13TDmaBurstSizejji @ 52 NONAME
-	_ZN18TDmaTransferConfigC2Ev @ 53 NONAME
-	_ZTI11DDmaRequest @ 54 NONAME
-	_ZTI11TDmaChannel @ 55 NONAME
-	_ZTI13TDmaDbChannel @ 56 NONAME
-	_ZTI13TDmaSbChannel @ 57 NONAME
-	_ZTI13TDmaSgChannel @ 58 NONAME
-	_ZTI17TDmaAsymSgChannel @ 59 NONAME
-	_ZTI5TDmac @ 60 NONAME
-	_ZTV11DDmaRequest @ 61 NONAME
-	_ZTV11TDmaChannel @ 62 NONAME
-	_ZTV13TDmaDbChannel @ 63 NONAME
-	_ZTV13TDmaSbChannel @ 64 NONAME
-	_ZTV13TDmaSgChannel @ 65 NONAME
-	_ZTV17TDmaAsymSgChannel @ 66 NONAME
-	_ZTV5TDmac @ 67 NONAME
-
--- a/kernel/eka/eabi/ekernsmp.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/eabi/ekernsmp.def	Wed Sep 01 12:34:56 2010 +0100
@@ -1181,15 +1181,13 @@
 	_ZN4Kern10RandomSaltEPKhjj @ 1180 NONAME
 	_ZN4Kern12SecureRandomER5TDes8 @ 1181 NONAME
 	_ZN13DPagingDevice16NotificationLockEv @ 1182 NONAME
-	_ZN13KernCoreStats5StatsEPv @ 1183 NONAME
-	_ZN13KernCoreStats6EngageEi @ 1184 NONAME
-	_ZN13KernCoreStats6RetireEii @ 1185 NONAME
-	_ZN13KernCoreStats9ConfigureEj @ 1186 NONAME
-	_ZN5NKern21SetNumberOfActiveCpusEi @ 1187 NONAME
-	_ZN3Arm14SetIdleHandlerEPFvPvmPVvES0_ @ 1188 NONAME
-	_ZN4Epoc11FreeRamZoneEj @ 1189 NONAME
+	_ZN13KernCoreStats5StatsEPv @ 1183 NONAME ABSENT
+	_ZN13KernCoreStats6EngageEi @ 1184 NONAME ABSENT
+	_ZN13KernCoreStats6RetireEii @ 1185 NONAME ABSENT
+	_ZN13KernCoreStats9ConfigureEj @ 1186 NONAME ABSENT
+	_ZN5NKern21SetNumberOfActiveCpusEi @ 1187 NONAME ABSENT
+	_ZN3Arm14SetIdleHandlerEPFvPvmPVvES0_ @ 1188 NONAME ABSENT
+	_ZN4Epoc11FreeRamZoneEj @ 1189 NONAME ABSENT
 	_ZN16TBitMapAllocator14SelectiveAllocEii @ 1190 NONAME
 	_ZN10RArrayBase12SetKeyOffsetEi @ 1191 NONAME
-	_ZN5Cache10CpuRetiresEv @ 1192 NONAME
-	_ZN5Cache13KernelRetiresEv @ 1193 NONAME
 
--- a/kernel/eka/eabi/ekernu.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/eabi/ekernu.def	Wed Sep 01 12:34:56 2010 +0100
@@ -1172,16 +1172,14 @@
 	_ZN4Kern10RandomSaltEPKhjj @ 1171 NONAME
 	_ZN4Kern12SecureRandomER5TDes8 @ 1172 NONAME
 	_ZN13DPagingDevice16NotificationLockEv @ 1173 NONAME
-	_ZN13KernCoreStats5StatsEPv @ 1174 NONAME
-	_ZN13KernCoreStats6EngageEi @ 1175 NONAME
-	_ZN13KernCoreStats6RetireEii @ 1176 NONAME
-	_ZN13KernCoreStats9ConfigureEj @ 1177 NONAME
-	_ZN13KernCoreStats9EnterIdleEv @ 1178 NONAME
-	_ZN13KernCoreStats9LeaveIdleEj @ 1179 NONAME
-	_ZN3Arm14SetIdleHandlerEPFvPvmES0_ @ 1180 NONAME
-	_ZN4Epoc11FreeRamZoneEj @ 1181 NONAME
+	_ZN13KernCoreStats5StatsEPv @ 1174 NONAME ABSENT
+	_ZN13KernCoreStats6EngageEi @ 1175 NONAME ABSENT
+	_ZN13KernCoreStats6RetireEii @ 1176 NONAME ABSENT
+	_ZN13KernCoreStats9ConfigureEj @ 1177 NONAME ABSENT
+	_ZN13KernCoreStats9EnterIdleEv @ 1178 NONAME ABSENT
+	_ZN13KernCoreStats9LeaveIdleEj @ 1179 NONAME ABSENT
+	_ZN3Arm14SetIdleHandlerEPFvPvmES0_ @ 1180 NONAME ABSENT
+	_ZN4Epoc11FreeRamZoneEj @ 1181 NONAME ABSENT
 	_ZN16TBitMapAllocator14SelectiveAllocEii @ 1182 NONAME
 	_ZN10RArrayBase12SetKeyOffsetEi @ 1183 NONAME
-	_ZN5Cache10CpuRetiresEv @ 1184 NONAME
-	_ZN5Cache13KernelRetiresEv @ 1185 NONAME
 
--- a/kernel/eka/eabi/euseru.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/eabi/euseru.def	Wed Sep 01 12:34:56 2010 +0100
@@ -697,11 +697,11 @@
 	_ZN5RHeap5ResetEv @ 696 NONAME ; RHeap::Reset()
 	_ZN5RHeap7ReAllocEPvii @ 697 NONAME ; RHeap::ReAlloc(void*, int, int)
 	_ZN5RHeap8CompressEv @ 698 NONAME ; RHeap::Compress()
-	_ZN5RHeapC1Eiii @ 699 NONAME ABSENT ; RHeap::RHeap(int, int, int)
-	_ZN5RHeapC1Eiiiiiii @ 700 NONAME ABSENT ; RHeap::RHeap(int, int, int, int, int, int, int)
-	_ZN5RHeapC2Eiii @ 701 NONAME ABSENT ; RHeap::RHeap(int, int, int)
-	_ZN5RHeapC2Eiiiiiii @ 702 NONAME ABSENT ; RHeap::RHeap(int, int, int, int, int, int, int)
-	_ZN5RHeapnwEjPv @ 703 NONAME ABSENT ; RHeap::operator new(unsigned int, void*)
+	_ZN5RHeapC1Eiii @ 699 NONAME ; RHeap::RHeap(int, int, int)
+	_ZN5RHeapC1Eiiiiiii @ 700 NONAME ; RHeap::RHeap(int, int, int, int, int, int, int)
+	_ZN5RHeapC2Eiii @ 701 NONAME ; RHeap::RHeap(int, int, int)
+	_ZN5RHeapC2Eiiiiiii @ 702 NONAME ; RHeap::RHeap(int, int, int, int, int, int, int)
+	_ZN5RHeapnwEjPv @ 703 NONAME ; RHeap::operator new(unsigned int, void*)
 	_ZN5RTest3EndEv @ 704 NONAME ; RTest::End()
 	_ZN5RTest4NextERK7TDesC16 @ 705 NONAME ; RTest::Next(TDesC16 const&)
 	_ZN5RTest5CloseEv @ 706 NONAME ; RTest::Close()
@@ -1601,7 +1601,7 @@
 	_ZNK4TUid4NameEv @ 1600 NONAME ; TUid::Name() const
 	_ZNK4TUideqERKS_ @ 1601 NONAME ; TUid::operator==(TUid const&) const
 	_ZNK4TUidneERKS_ @ 1602 NONAME ; TUid::operator!=(TUid const&) const
-	_ZNK5RHeap10GetAddressEPKv @ 1603 NONAME ABSENT ; RHeap::GetAddress(void const*) const
+	_ZNK5RHeap10GetAddressEPKv @ 1603 NONAME ; RHeap::GetAddress(void const*) const
 	_ZNK5RHeap8AllocLenEPKv @ 1604 NONAME ; RHeap::AllocLen(void const*) const
 	_ZNK5RHeap9AllocSizeERi @ 1605 NONAME ; RHeap::AllocSize(int&) const
 	_ZNK5RHeap9AvailableERi @ 1606 NONAME ; RHeap::Available(int&) const
@@ -2504,42 +2504,38 @@
 	_ZN4Math7RandomLER5TDes8 @ 2503 NONAME
 	_ZN4Math6RandomER5TDes8 @ 2504 NONAME
 	_ZN4Math7RandomLEv @ 2505 NONAME
-	_ZN6TDes1610LowerCase2Ev @ 2506 NONAME
-	_ZN6TDes1610UpperCase2Ev @ 2507 NONAME
-	_ZN6TDes1611AppendFill2E5TChari @ 2508 NONAME
-	_ZN6TDes1611Capitalize2Ev @ 2509 NONAME
-	_ZN6TDes1614AppendJustify2EPKti6TAlign5TChar @ 2510 NONAME
-	_ZN6TDes1614AppendJustify2EPKtii6TAlign5TChar @ 2511 NONAME
-	_ZN6TDes1614AppendJustify2ERK7TDesC16i6TAlign5TChar @ 2512 NONAME
-	_ZN6TDes1614AppendJustify2ERK7TDesC16ii6TAlign5TChar @ 2513 NONAME
-	_ZN6TDes165Fill2E5TChar @ 2514 NONAME
-	_ZN6TDes165Fill2E5TChari @ 2515 NONAME
-	_ZN6TDes165Fold2Ev @ 2516 NONAME
-	_ZN6TDes166CopyC2ERK7TDesC16 @ 2517 NONAME
-	_ZN6TDes166CopyF2ERK7TDesC16 @ 2518 NONAME
-	_ZN6TDes167Append2E5TChar @ 2519 NONAME
-	_ZN6TDes167CopyCP2ERK7TDesC16 @ 2520 NONAME
-	_ZN6TDes167CopyLC2ERK7TDesC16 @ 2521 NONAME
-	_ZN6TDes167CopyUC2ERK7TDesC16 @ 2522 NONAME
-	_ZN6TDes168Collate2Ev @ 2523 NONAME
-	_ZN6TDes168Justify2ERK7TDesC16i6TAlign5TChar @ 2524 NONAME
-	_ZNK7TDesC1614LocateReverse2E5TChar @ 2525 NONAME
-	_ZNK7TDesC1615LocateReverseF2E5TChar @ 2526 NONAME
-	_ZNK7TDesC1620FindCorruptSurrogateEv @ 2527 NONAME
-	_ZNK7TDesC166Match2ERKS_ @ 2528 NONAME
-	_ZNK7TDesC167Locate2E5TChar @ 2529 NONAME
-	_ZNK7TDesC168LocateF2E5TChar @ 2530 NONAME
-	_ZN6RTimer12AgainHighResER14TRequestStatus27TTimeIntervalMicroSeconds32 @ 2531 NONAME ; RTimer::AgainHighRes(TRequestStatus&, TTimeIntervalMicroSeconds32)
-	_ZNK10RAllocator4BaseEv @ 2532 NONAME
-	_ZNK10RAllocator4SizeEv @ 2533 NONAME
-	_ZNK10RAllocator5AlignEPv @ 2534 NONAME
-	_ZNK10RAllocator5AlignEi @ 2535 NONAME
-	_ZNK10RAllocator9MaxLengthEv @ 2536 NONAME
-	_ZN10RAllocator17__DbgGetAllocFailEv @ 2537 NONAME
-	_ZN4User17__DbgGetAllocFailEi @ 2538 NONAME
+	_ZN6TDes1610LowerCase2Ev @ 2506 NONAME ABSENT
+	_ZN6TDes1610UpperCase2Ev @ 2507 NONAME ABSENT
+	_ZN6TDes1611AppendFill2E5TChari @ 2508 NONAME ABSENT
+	_ZN6TDes1611Capitalize2Ev @ 2509 NONAME ABSENT
+	_ZN6TDes1614AppendJustify2EPKti6TAlign5TChar @ 2510 NONAME ABSENT
+	_ZN6TDes1614AppendJustify2EPKtii6TAlign5TChar @ 2511 NONAME ABSENT
+	_ZN6TDes1614AppendJustify2ERK7TDesC16i6TAlign5TChar @ 2512 NONAME ABSENT
+	_ZN6TDes1614AppendJustify2ERK7TDesC16ii6TAlign5TChar @ 2513 NONAME ABSENT
+	_ZN6TDes165Fill2E5TChar @ 2514 NONAME ABSENT
+	_ZN6TDes165Fill2E5TChari @ 2515 NONAME ABSENT
+	_ZN6TDes165Fold2Ev @ 2516 NONAME ABSENT
+	_ZN6TDes166CopyC2ERK7TDesC16 @ 2517 NONAME ABSENT
+	_ZN6TDes166CopyF2ERK7TDesC16 @ 2518 NONAME ABSENT
+	_ZN6TDes167Append2E5TChar @ 2519 NONAME ABSENT
+	_ZN6TDes167CopyCP2ERK7TDesC16 @ 2520 NONAME ABSENT
+	_ZN6TDes167CopyLC2ERK7TDesC16 @ 2521 NONAME ABSENT
+	_ZN6TDes167CopyUC2ERK7TDesC16 @ 2522 NONAME ABSENT
+	_ZN6TDes168Collate2Ev @ 2523 NONAME ABSENT
+	_ZN6TDes168Justify2ERK7TDesC16i6TAlign5TChar @ 2524 NONAME ABSENT
+	_ZNK7TDesC1614LocateReverse2E5TChar @ 2525 NONAME ABSENT
+	_ZNK7TDesC1615LocateReverseF2E5TChar @ 2526 NONAME ABSENT
+	_ZNK7TDesC1620FindCorruptSurrogateEv @ 2527 NONAME ABSENT
+	_ZNK7TDesC166Match2ERKS_ @ 2528 NONAME ABSENT
+	_ZNK7TDesC167Locate2E5TChar @ 2529 NONAME ABSENT
+	_ZNK7TDesC168LocateF2E5TChar @ 2530 NONAME ABSENT
+	_ZN6RTimer12AgainHighResER14TRequestStatus27TTimeIntervalMicroSeconds32 @ 2531 NONAME ABSENT
+	_ZNK10RAllocator4BaseEv @ 2532 NONAME ABSENT
+	_ZNK10RAllocator4SizeEv @ 2533 NONAME ABSENT
+	_ZNK10RAllocator5AlignEPv @ 2534 NONAME ABSENT
+	_ZNK10RAllocator5AlignEi @ 2535 NONAME ABSENT
+	_ZNK10RAllocator9MaxLengthEv @ 2536 NONAME ABSENT
+	_ZN10RAllocator17__DbgGetAllocFailEv @ 2537 NONAME ABSENT
+	_ZN4User17__DbgGetAllocFailEi @ 2538 NONAME ABSENT
 	_ZN10RArrayBase12SetKeyOffsetEi @ 2539 NONAME
-	_ZN10RSemaphore4PollEv @ 2540 NONAME ; RSemaphore::Poll()
-	_ZN6RMutex4WaitEi @ 2541 NONAME ; RMutex::Wait(int)
-	_ZN6RMutex4PollEv @ 2542 NONAME ; RMutex::Poll()
-	_ZN9RFastLock4PollEv @ 2543 NONAME ; RFastLock::Poll()
-	_ZN9RFastLock4WaitEi @ 2544 NONAME ; RFastLock::Wait(int)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/eabi/rm_debug_extu.def	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,24 @@
+EXPORTS
+	_Z19CreateLogicalDevicev @ 1 NONAME
+	_ZN5Debug13StopModeDebug7GetListEPKNS_9TListItemEi @ 2 NONAME
+	_ZN5Debug13StopModeDebug7TestAPIEPKNS_9TListItemE @ 3 NONAME
+	_ZN5Debug13StopModeDebug9ExitPointEi @ 4 NONAME
+	_ZTI11DDebugAgent @ 5 NONAME
+	_ZTI12DRMDStepping @ 6 NONAME
+	_ZTI14DBufferManager @ 7 NONAME
+	_ZTI14DTargetProcess @ 8 NONAME
+	_ZTI15DProcessTracker @ 9 NONAME
+	_ZTI16DRM_DebugChannel @ 10 NONAME
+	_ZTI17D_RMD_Breakpoints @ 11 NONAME
+	_ZTI21DRM_DebugEventHandler @ 12 NONAME
+	_ZTI22DRM_DebugDriverFactory @ 13 NONAME
+	_ZTV11DDebugAgent @ 14 NONAME
+	_ZTV12DRMDStepping @ 15 NONAME
+	_ZTV14DBufferManager @ 16 NONAME
+	_ZTV14DTargetProcess @ 17 NONAME
+	_ZTV15DProcessTracker @ 18 NONAME
+	_ZTV16DRM_DebugChannel @ 19 NONAME
+	_ZTV17D_RMD_Breakpoints @ 20 NONAME
+	_ZTV21DRM_DebugEventHandler @ 21 NONAME
+	_ZTV22DRM_DebugDriverFactory @ 22 NONAME
+
--- a/kernel/eka/eabi/sm_debugu.def	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-EXPORTS
-	_ZN5Debug13StopModeDebug7GetListEPKNS_9TListItemEi @ 1 NONAME
-	_ZN5Debug13StopModeDebug7TestAPIEPKNS_9TListItemE @ 2 NONAME
-	_ZN5Debug13StopModeDebug9ExitPointEi @ 3 NONAME
-	_ZTI14DBufferManager @ 4 NONAME
-	_ZTV14DBufferManager @ 5 NONAME
-
--- a/kernel/eka/eabi/usbcscu.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/eabi/usbcscu.def	Wed Sep 01 12:34:56 2010 +0100
@@ -20,5 +20,4 @@
 	_ZN15TEndpointBuffer10TakeBufferERPvRjRiR14TRequestStatusj @ 19 NONAME
 	_ZN15TEndpointBuffer6ExpireEv @ 20 NONAME
 	_ZN15TEndpointBuffer6ExpireEPv @ 21 NONAME
-	_ZN16RDevUsbcScClient15ResetAltSettingEv @ 22 NONAME
 
--- a/kernel/eka/eabi/usbdi_utilsu.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/eabi/usbdi_utilsu.def	Wed Sep 01 12:34:56 2010 +0100
@@ -37,5 +37,4 @@
 	_ZN26RUsbIsocTransferDescriptor7ResultsEv @ 36 NONAME
 	_ZNK14TPacketResults2AtEi @ 37 NONAME
 	_ZNK14TPacketResultsixEi @ 38 NONAME
-	_ZN22RUsbTransferDescriptor5CloseEv @ 39 NONAME
 
--- a/kernel/eka/euser/epoc/arm/uc_trp.cia	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/euser/epoc/arm/uc_trp.cia	Wed Sep 01 12:34:56 2010 +0100
@@ -22,8 +22,8 @@
 #include "uc_std.h"
 
 //  With -fvtable-thunks
-//const TInt KVTableTrapOffset=8;
-//const TInt KVTableLeaveOffset=16;
+const TInt KVTableTrapOffset=8;
+const TInt KVTableLeaveOffset=16;
 
 //  Without -fvtable-thunks
 //  const TInt KVTableTrapOffset=12;
--- a/kernel/eka/euser/epoc/arm/uc_utl.cia	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/euser/epoc/arm/uc_utl.cia	Wed Sep 01 12:34:56 2010 +0100
@@ -1321,42 +1321,6 @@
 #endif
 	}
 
-EXPORT_C __NAKED__ TInt RFastLock::Poll()
-	{
-	asm("1: ");
-	asm("add	r0, r0, #4 ");					// point to iCount
-
-#ifdef __CPU_ARM_HAS_LDREX_STREX
-	asm("2:		");
-	LDREX(		2, 0);							// read
-	asm("subs	r1, r2, #1 ");					// decrement
-	asm("bcs	3f ");							// if no borrow, lock cannot be obtained so bail out
-	STREX(		3, 1, 0);						// write
-	asm("teq	r3, #0 ");						// success?
-	asm("bne	2b ");							// no!
-	asm("mov	r0, #0 ");						// lock acquired so return KErrNone
-#ifdef __SMP__
-	__DATA_MEMORY_BARRIER__(r3);				// need acquire barrier
-#endif
-	__JUMP(,	lr);
-
-	asm("3:		");
-	asm("mov	r0, #%a0" : : "i" ((TInt)KErrTimedOut));	// else can't get it immediately so return KErrTimedOut
-	__JUMP(,	lr);
-#else	// no LDREX/STREX - ARM arch 5 CPU
-	asm("mov	r1, #1 ");						// 'looking' value
-	asm("swp	r1, r1, [r0] ");				// write looking value, read original
-	asm("subs	r2, r1, #1 ");					// decrement count
-	asm("strcc	r2, [r0] ");					// if borrow, was originally zero so write back -1 and return KErrNone
-	asm("movcc	r0, #0 ");						// got lock - return KErrNone
- 	__JUMP(cc,	lr);
-
-	asm("strlt	r1, [r0] ");					// else if result<0 (i.e. wasn't looking value) write back original
-	asm("mov	r0, #%a0" : : "i" ((TInt)KErrTimedOut));	// else can't get it immediately so return KErrTimedOut
- 	__JUMP(,	lr);
-#endif
-	}
-
 EXPORT_C __NAKED__ void RFastLock::Signal()
 	{
 	asm("1: ");
@@ -1392,122 +1356,6 @@
 	}
 
 
-/**
-Acquire the lock, if necessary waiting up to a specified maximum amount of time
-for it to become free.
-
-This function checks if the lock is currently held. If not the lock is marked
-as held by the current thread and the call returns immediately. If the lock is
-held by another thread the current thread will suspend until the lock becomes
-free or until the specified timeout period has elapsed.
-
-@param aTimeout The timeout value in microseconds
-
-@return KErrNone if the lock was acquired successfully.
-        KErrTimedOut if the timeout has expired.
-        KErrGeneral if the lock is being reset, i.e the lock
-        is about to  be deleted.
-        KErrArgument if aTimeout is negative;
-        otherwise one of the other system wide error codes.
-*/
-EXPORT_C __NAKED__ TInt RFastLock::Wait(TInt /*aTimeout*/)
-	{
-	asm("stmfd	sp!, {r4-r6,lr} ");
-	asm("add	r4, r0, #4 ");					// r4->iCount
-	asm("subs	r5, r1, #0 ");					// r5=aTimeout
-	asm("mov	r6, #1000 ");
-	asm("movle	r0, #%a0" : : "i" ((TInt)KErrArgument));	
-	__CPOPRET(le, "r4-r6,");					// if aTimeout<=0 return KErrArgument
-	asm("1:		");
-
-#ifdef __CPU_ARM_HAS_LDREX_STREX
-	asm("2:		");
-	LDREX(		2, 4);							// read
-	asm("subs	r12, r2, #1 ");					// decrement
-	STREX(		3, 12, 4);						// write
-	asm("teq	r3, #0 ");						// success?
-	asm("bne	2b ");							// no!
-	asm("bcs	8f ");							// if no borrow from decrement, need to wait
-#ifdef __SMP__
-	__DATA_MEMORY_BARRIER__(r3);				// no need to wait, but still need acquire barrier
-#endif
-#else	// no LDREX/STREX - ARM arch 5 CPU
-	asm("mov	r2, #1 ");						// 'looking' value
-	asm("swp	r2, r2, [r4] ");				// write looking value, read original
-	asm("subs	r12, r2, #1 ");					// decrement count
-	asm("strlt	r12, [r4] ");					// if it becomes negative, no-one was looking
-	asm("bcs	8f ");							// if no borrow, we have to wait
-#endif
-	asm("mov	r0, #0 ");						// return KErrNone
-	__POPRET("r4-r6,");
-
-// We need to wait
-	asm("8:		");
-#ifndef __CPU_ARM_HAS_LDREX_STREX
-// no LDREX/STREX - ARM arch 5 CPU
-	asm("blt	3f ");							// if it wasn't 'looking' value, branch
-
-	// it was the 'looking' value, so wait a little bit
-	asm("cmp	r5, #0 ");
-	asm("ble	9f ");							// waited too long already, return KErrTimedOut
-	asm("sub	r5, r5, r6 ");
-	asm("mov	r6, #2000 ");
-	asm("mov	r0, #1000 ");					// wait 1ms
-	asm("cmp	r5, r0 ");
-	asm("movlt	r5, r0 ");						// remaining time at least 1ms
-	asm("bl "	CSM_ZN4User12AfterHighResE27TTimeIntervalMicroSeconds32);
-	asm("b		1b ");							// try again
-#endif
-	asm("3:		");
-	asm("sub	r0, r4, #4 ");					// r0=this
-	asm("mov	r1, r5 ");						// r1=aTimeout
-	asm("bl "	CSM_ZN10RSemaphore4WaitEi);	// try to acquire semaphore
-	asm("cmp	r0, #%a0" : : "i" ((TInt)KErrTimedOut));
-	__CPOPRET(ne, "r4-r6,");					// if wait didn't time out, return
-	asm("mov	r5, #1 ");						// any further timed waits will be for minimum period
-	
-	// Before we can return KErrTimedOut we must increment iCount (since we
-	// previously decremented it in anticipation of acquiring the lock.
-	// However we must not increment iCount if it would become zero, since
-	// the semaphore will have been signalled (to counterbalance the Wait()
-	// which timed out and thus never happened). This would result in two
-	// threads being able to acquire the lock simultaneously - one by
-	// decrementing iCount from 0 to -1 without looking at the semaphore,
-	// and the other by decrementing iCount from -1 to -2 and then absorbing
-	// the spurious semaphore signal.
-	//	orig = __e32_atomic_tas_ord32(&iCount, -1, 0, 1);	// don't release lock completely
-	//	if (orig < -1)
-	//		return KErrTimedOut;	// count corrected - don't need to touch semaphore
-	// lock is actually free at this point, try again to claim it
-	//	aTimeout = 1;
-#ifdef __CPU_ARM_HAS_LDREX_STREX
-#ifdef __SMP__
-	__DATA_MEMORY_BARRIER_Z__(r3);
-#endif
-	asm("4:		");
-	LDREX(		2, 4);							// read
-	asm("adds	r2, r2, #1 ");					// increment
-	asm("bge	3b ");							// if increment would make result >=0, wait again
-	STREX(		3, 2, 4);						// write
-	asm("teq	r3, #0 ");						// success?
-	asm("bne	4b ");							// no!
-#ifdef __SMP__
-	__DATA_MEMORY_BARRIER__(r3);
-#endif
-#else	// no LDREX/STREX - ARM arch 5 CPU
-	asm("mov	r2, #1 ");						// 'looking' value
-	asm("swp	r2, r2, [r4] ");				// write looking value, read original
-	asm("adds	r12, r2, #1 ");					// increment count
-	asm("strlt	r12, [r4] ");					// if still negative, count now fixed, so return KErrTimedOut
-	asm("streq	r2, [r4] ");					// else if not 'looking' value, write back original
-	asm("bge	3b ");							// if 'looking' value or -1, wait again
-#endif
-	asm("9:		");
-	asm("mov	r0, #%a0" : : "i" ((TInt)KErrTimedOut));	// return KErrTimedOut
-	__POPRET("r4-r6,");
-	}
-
-
 // Entry point stub to allow EKA1 binaries to be executed under EKA2
 // Only called when process is first loaded
 
--- a/kernel/eka/euser/epoc/win32/uc_utl.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/euser/epoc/win32/uc_utl.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -114,21 +114,6 @@
 		RSemaphore::Wait();
 	}
 
-EXPORT_C __NAKED__ TInt RFastLock::Poll()
-	{
-	_asm xor eax, eax
-	_asm xor edx, edx
-	_asm dec edx
-
-	/* if ([ecx+4]==0) { [ecx+4]=-1; ZF=1;} else {eax=[ecx+4]; ZF=0;} */
-	_asm lock cmpxchg [ecx+4], edx
-	_asm jz short fastlock_poll_done
-	_asm mov eax, -33
-
-	fastlock_poll_done:
-	_asm ret
-	}
-
 EXPORT_C void RFastLock::Signal()
 	{
 	if (InterlockedIncrement((LPLONG)&iCount) < 0)
--- a/kernel/eka/euser/epoc/x86/uc_utl.cia	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/euser/epoc/x86/uc_utl.cia	Wed Sep 01 12:34:56 2010 +0100
@@ -42,22 +42,6 @@
 	THISCALL_EPILOG0()
 	}
 
-EXPORT_C __NAKED__ TInt RFastLock::Poll()
-	{
-	THISCALL_PROLOG0()
-	asm("xor eax, eax ");
-	asm("xor edx, edx ");
-	asm("dec edx ");
-
-	/* if ([ecx+4]==0) { [ecx+4]=-1; ZF=1;} else {eax=[ecx+4]; ZF=0;} */
-	asm("lock cmpxchg [ecx+4], edx ");
-	asm("jz short fastlock_poll_done ");
-	asm("mov eax, %0": : "i"(KErrTimedOut));
-
-	asm("fastlock_poll_done: ");
-	THISCALL_EPILOG0()
-	}
-
 EXPORT_C __NAKED__ void RFastLock::Signal()
 	{
 	THISCALL_PROLOG0()
--- a/kernel/eka/euser/euser.mmh	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/euser/euser.mmh	Wed Sep 01 12:34:56 2010 +0100
@@ -47,8 +47,7 @@
 #endif
 
 sourcepath		../common
-source			array.cpp des8.cpp des16.cpp alloc.cpp 
-source			heap_hybrid.cpp debugfunction.cpp
+source			array.cpp des8.cpp des16.cpp alloc.cpp heap.cpp
 source			mem.cpp secure.cpp
 macro			__EXPORT_MEMCPY__
 #ifdef GCC32
@@ -82,7 +81,7 @@
 source			 uc_i64.cia uc_realx.cpp uc_realx.cia uc_huffman.cia
 source			 uc_trp.cpp uc_trp.cia uc_utl.cia uc_exec.cia uc_data.cpp
 sourcepath		../common/arm
-source			carray.cia cdes8.cia cdes16.cia cmem.cia atomics.cia
+source			carray.cia cdes8.cia cdes16.cia cheap.cia cmem.cia atomics.cia
 #if defined(GCC32)
 source			cgcchelp.cpp cgcchelp.cia
 #endif
--- a/kernel/eka/euser/unicode/Compare.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/euser/unicode/Compare.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -813,7 +813,7 @@
         // Because this function is using TUTF32Iterator, which means the
         // original author want to support surrogate. Take it as a defect and
         // fix it, while do not define a new LocateMatchStringFoldedSurrogate().
-        if (TChar::IsSurrogate(*csSection))
+        if (IsSurrogate(*csSection))
         	++csSection;
 		}
 	// this should never happen!
--- a/kernel/eka/euser/unicode/collate.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/euser/unicode/collate.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -26,6 +26,44 @@
 // 16 instead of 8, in case all supplementary characters
 static const TInt KKeyedStringBufferSize = 16;
 
+
+inline TText16 GetHighSurrogate(TUint aChar)
+/**
+Retrieve the high surrogate of a supplementary character.
+
+@param aChar The 32-bit code point value of a Unicode character.
+
+@return High surrogate of aChar, if aChar is a supplementary character; 
+        aChar itself, if aChar is not a supplementary character.
+*/
+	{
+	return STATIC_CAST(TText16, 0xD7C0 + (aChar >> 10));
+	}
+
+inline TText16 GetLowSurrogate(TUint aChar)
+/**
+Retrieve the low surrogate of a supplementary character.
+
+@param aChar The 32-bit code point value of a Unicode character.
+
+@return Low surrogate of aChar, if aChar is a supplementary character; 
+        zero, if aChar is not a supplementary character.
+*/
+	{
+	return STATIC_CAST(TText16, 0xDC00 | (aChar & 0x3FF));
+	}
+
+inline TUint JoinSurrogate(TText16 aHighSurrogate, TText16 aLowSurrogate)
+/**
+Combine a high surrogate and a low surrogate into a supplementary character.
+
+@return The 32-bit code point value of the generated Unicode supplementary
+        character.
+*/
+	{
+	return ((aHighSurrogate - 0xD7F7) << 10) + aLowSurrogate;
+	}
+
 // Creates a one or two collation keys sequence corresponding to the input character.
 // Returns the number of keys output.
 static TInt CreateDefaultCollationKeySequence(TInt aChar, TCollationKey* aBuffer)
@@ -62,22 +100,22 @@
 			break;
 			}
 		TInt c = *p >> 16;
-		if (TChar::IsHighSurrogate( (TText16)c ))
+		if (IsHighSurrogate( (TText16)c ))
 			{
-			if ((p < end) && (TChar::IsLowSurrogate( (TText16)((*(p+1))>>16) )))
+			if ((p < end) && (IsLowSurrogate( (TText16)((*(p+1))>>16) )))
 				{
 				currentCharLength = 2;
-				c = TChar::JoinSurrogate( (TText16)(*p>>16), (TText16)((*(p+1))>>16) );
+				c = JoinSurrogate( (TText16)(*p>>16), (TText16)((*(p+1))>>16) );
 				}
 			}
-		else if (TChar::IsLowSurrogate( (TText16)c ))
+		else if (IsLowSurrogate( (TText16)c ))
 			{
-			if ((p > start) && (TChar::IsHighSurrogate( (TText16)((*(p-1))>>16) )))
+			if ((p > start) && (IsHighSurrogate( (TText16)((*(p-1))>>16) )))
 				{
 				p--;
 				pivot = pivot - 1;
 				currentCharLength = 2;
-				c = TChar::JoinSurrogate( (TText16)(*p>>16), (TText16)((*(p+1))>>16) );
+				c = JoinSurrogate( (TText16)(*p>>16), (TText16)((*(p+1))>>16) );
 				}
 			}
 		else
@@ -620,8 +658,8 @@
 			}
 		else 
 			{
-			text[textLen++] = TChar::GetHighSurrogate(cur_char);
-			text[textLen++] = TChar::GetLowSurrogate(cur_char);
+			text[textLen++] = GetHighSurrogate(cur_char);
+			text[textLen++] = GetLowSurrogate(cur_char);
 			}
 		TBool possible_prefix = ETrue;
 		for(TInt i = 1; (i < KKeyedStringBufferSize) && possible_prefix; i++)
@@ -638,8 +676,8 @@
 				}
 			else
 				{
-				text[textLen++] = TChar::GetHighSurrogate(c);
-				text[textLen++] = TChar::GetLowSurrogate(c);
+				text[textLen++] = GetHighSurrogate(c);
+				text[textLen++] = GetLowSurrogate(c);
 				}
 			TInt cur_index = -1;
             ::GetStringKey(aTable, text, textLen, cur_index, possible_prefix);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/euser/unicode/perl/Unicode, Inc License Agreement - Data Files and Software.txt	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,21 @@
+                          EXHIBIT 1
+UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
+
+Unicode Data Files include all data files under the directories http://www.unicode.org/Public/, http://www.unicode.org/reports/, and http://www.unicode.org/cldr/data/ . Unicode Software includes any source code published in the Unicode Standard or under the directories http://www.unicode.org/Public/, http://www.unicode.org/reports/, and http://www.unicode.org/cldr/data/.
+
+NOTICE TO USER: Carefully read the following legal agreement. BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
+
+COPYRIGHT AND PERMISSION NOTICE
+
+Copyright © 1991-2009 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode data files and any associated documentation (the "Data Files") or Unicode software and any associated documentation (the "Software") to deal in the Data Files or Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom the Data Files or Software are furnished to do so, provided that (a) the above copyright notice(s) and this permission notice appear with all copies of the Data Files or Software, (b) both the above copyright notice(s) and this permission notice appear in associated documentation, and (c) there is clear notice in each modified Data File or in the Software as well as in the documentation associated with the Data File(s) or Software that the data or software has been modified.
+
+THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in these Data Files or Software without prior written authorization of the copyright holder.
+
+
+--------------------------------------------------------------------------------
+
+Unicode and the Unicode logo are trademarks of Unicode, Inc., and may be registered in some jurisdictions. All other trademarks and registered trademarks mentioned herein are the property of their respective owners.
--- a/kernel/eka/euser/us_exec.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/euser/us_exec.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -2887,18 +2887,13 @@
 after calling this function.
 
 @param aLocaleDllName The name of the locale DLL to be loaded
-@return KErrNone if successful, KErrNotSupported if the DLL name matches the pattern
-of a new-style locale library, system wide error otherwise
+@return KErrNone if successful, system wide error if not
 
 @see TExtendedLocale::SaveSystemSettings 
 */
 EXPORT_C TInt TExtendedLocale::LoadLocale(const TDesC& aLocaleDllName)
 	{
 #ifdef SYMBIAN_DISTINCT_LOCALE_MODEL
-	if (aLocaleDllName.Find(KFindLan) != KErrNotFound || aLocaleDllName.Find(KFindReg) != KErrNotFound || aLocaleDllName.Find(KFindCol) != KErrNotFound)
-		{
-		return KErrNotSupported; // Only try to load old-style locale libraries
-		}
 	TLibraryFunction data[KNumLocaleExports];
 	TInt r = DoLoadLocale(aLocaleDllName, &data[0]);
 	if(r == KErrNone)
@@ -2998,9 +2993,6 @@
 the locale information in the DLL, you can call TExtendedLocale::SaveSystemSettings
 after calling this function.
 
-If the function fails then it will call LoadSystemSettings() to return its members
-to a known, good state.
-
 @param aLanguageLocaleDllName The name of the language locale DLL to be loaded
 @param aRegionLocaleDllName The name of the region locale DLL to be loaded
 @param aCollationLocaleDllName The name of the collation locale DLL to be loaded
@@ -3014,16 +3006,18 @@
 		const TDesC& aRegionLocaleDllName, 
 		const TDesC& aCollationLocaleDllName)
 	{
+
 	TInt err = LoadLocaleAspect(aLanguageLocaleDllName);
-
-	if(err == KErrNone)
-		err = LoadLocaleAspect(aRegionLocaleDllName);
-
-	if(err == KErrNone)
-		err = LoadLocaleAspect(aCollationLocaleDllName);
-
+	if(err != KErrNone)
+		return err;
+	
+	err = LoadLocaleAspect(aRegionLocaleDllName);
 	if(err != KErrNone)
-		LoadSystemSettings();	
+		return err;
+	
+	err = LoadLocaleAspect(aCollationLocaleDllName);
+	if(err != KErrNone)
+		return err;	
 
 	return err;	
 	}
@@ -3774,59 +3768,8 @@
 */
 EXPORT_C void RMutex::Wait()
 	{
-	Exec::MutexWait(iHandle, 0);
-	}
-
-
-
-
-/**
-Acquire the mutex if it is currently free, but don't wait for it.
-
-This function checks if the mutex is currently held. If not the mutex is marked
-as held by the current thread and the call returns immediately indicating
-success. If the mutex is held by another thread the call returns immediately
-indicating failure. If the mutex is already held by the current thread a count
-is maintained of how many times the thread has acquired the mutex.
-
-@return	KErrNone if the mutex was acquired
-		KErrTimedOut if the mutex could not be acquired
-        KErrGeneral if the semaphore is being reset, i.e the semaphore
-        is about to  be deleted.
-*/
-EXPORT_C TInt RMutex::Poll()
-	{
-	return Exec::MutexWait(iHandle, -1);
-	}
-
-
-
-
-/**
-Acquire the mutex, if necessary waiting up to a specified maximum amount of time
-for it to become free.
-
-This function checks if the mutex is currently held. If not the mutex is marked
-as held by the current thread and the call returns immediately. If the mutex is
-held by another thread the current thread will suspend until the mutex becomes
-free or until the specified timeout period has elapsed. If the mutex is already
-held by the current thread a count is maintained of how many times the thread
-has acquired the mutex.
-
-@param aTimeout The timeout value in microseconds
-
-@return KErrNone if the mutex was acquired successfully.
-        KErrTimedOut if the timeout has expired.
-        KErrGeneral if the mutex is being reset, i.e the mutex
-        is about to  be deleted.
-        KErrArgument if aTimeout is negative;
-        otherwise one of the other system wide error codes.
-*/
-EXPORT_C TInt RMutex::Wait(TInt aTimeout)
-	{
-	if (aTimeout>=0)
-		return Exec::MutexWait(iHandle, aTimeout);
-	return KErrArgument;
+
+	Exec::MutexWait(iHandle);
 	}
 
 
@@ -4365,6 +4308,7 @@
 
 
 
+EXPORT_C void RSemaphore::Wait()
 /**
 Waits for a signal on the semaphore.
 
@@ -4380,16 +4324,19 @@
 
 If the semaphore is deleted, all threads waiting on that semaphore are released.
 */
-EXPORT_C void RSemaphore::Wait()
-	{
+	{
+
 	Exec::SemaphoreWait(iHandle, 0);
 	}
 
 
+
+
+EXPORT_C TInt RSemaphore::Wait(TInt aTimeout)
 /**
 Waits for a signal on the semaphore, or a timeout.
 
-@param aTimeout The timeout value in microseconds
+@param aTimeout The timeout value in micoseconds
 
 @return KErrNone if the wait has completed normally.
         KErrTimedOut if the timeout has expired.
@@ -4398,26 +4345,12 @@
         KErrArgument if aTimeout is negative;
         otherwise one of the other system wide error codes.
 */
-EXPORT_C TInt RSemaphore::Wait(TInt aTimeout)
-	{
-	if (aTimeout>=0)
-		return Exec::SemaphoreWait(iHandle, aTimeout);
-	return KErrArgument;
-	}
-
-
-/**
-Acquires the semaphore if that is possible without waiting.
-
-@return KErrNone if the semaphore was acquired successfully
-        KErrTimedOut if the semaphore could not be acquired
-        KErrGeneral if the semaphore is being reset, i.e the semaphore
-        is about to  be deleted.
-*/
-EXPORT_C TInt RSemaphore::Poll()
-	{
-	return Exec::SemaphoreWait(iHandle, -1);
-	}
+	{
+
+	return Exec::SemaphoreWait(iHandle, aTimeout);
+	}
+
+
 
 
 EXPORT_C void RSemaphore::Signal()
@@ -4456,54 +4389,6 @@
 
 
 
-#ifndef __CPU_ARM
-/**
-Acquire the lock, if necessary waiting up to a specified maximum amount of time
-for it to become free.
-
-This function checks if the lock is currently held. If not the lock is marked
-as held by the current thread and the call returns immediately. If the lock is
-held by another thread the current thread will suspend until the lock becomes
-free or until the specified timeout period has elapsed.
-
-@param aTimeout The timeout value in microseconds
-
-@return KErrNone if the lock was acquired successfully.
-        KErrTimedOut if the timeout has expired.
-        KErrGeneral if the lock is being reset, i.e the lock
-        is about to  be deleted.
-        KErrArgument if aTimeout is negative;
-        otherwise one of the other system wide error codes.
-*/
-EXPORT_C TInt RFastLock::Wait(TInt aTimeout)
-	{
-	if (aTimeout<=0)
-		return KErrArgument;
-	TInt orig = __e32_atomic_add_acq32(&iCount, TUint32(-1));
-	if (orig == 0)
-		return KErrNone;
-	FOREVER
-		{
-		TInt r = Exec::SemaphoreWait(iHandle, aTimeout);
-		if (r != KErrTimedOut)	// got lock OK or lock deleted
-			return r;
-		// Before we can return KErrTimedOut we must increment iCount (since we
-		// previously decremented it in anticipation of acquiring the lock.
-		// However we must not increment iCount if it would become zero, since
-		// the semaphore will have been signalled (to counterbalance the Wait()
-		// which timed out and thus never happened). This would result in two
-		// threads being able to acquire the lock simultaneously - one by
-		// decrementing iCount from 0 to -1 without looking at the semaphore,
-		// and the other by decrementing iCount from -1 to -2 and then absorbing
-		// the spurious semaphore signal.
-		orig = __e32_atomic_tas_ord32(&iCount, -1, 0, 1);	// don't release lock completely
-		if (orig < -1)
-			return KErrTimedOut;	// count corrected - don't need to touch semaphore
-		// lock is actually free at this point, try again to claim it
-		aTimeout = 1;
-		}
-	}
-#endif
 
 EXPORT_C RCriticalSection::RCriticalSection()
 	: iBlocked(1)
@@ -5447,45 +5332,6 @@
 
 
 
-/**
-Requests an event at a specified time after the last expiry of the this
-timer object, to a resolution of 1ms. If the last usage of this timer object
-was not via either this function or RTimer::HighRes(), this call behaves the
-same as RTimer::HighRes().
-The "HighRes timer" counter stops during power-down (the same as "after timer"). 
-
-@param aStatus    On completion, contains the status of the request.
-                  This is KErrNone if the timer completed normally at the
-                  requested time, otherwise another of the
-                  system-wide error codes. In particular KErrArgument indicates
-				  that the requested expiry time has already passed.
-
-@param aInterval  The time interval, in microseconds, after which an event
-                  is to occur, measured from the last expiry time (or intended
-				  expiry time in the case where the timer was cancelled) of this
-				  timer object.
-				  Note that the interval is allowed to be negative. To see why
-				  this might be useful consider the following sequence of timer
-				  operations:
-					1. Timer expires at time T
-					2. AgainHighRes(1000000) - timer is queued for T + 1 sec
-					3. Cancel() - timer is not queued but last scheduled expiry
-									is still at T + 1 second
-					4. AgainHighRes(-500000)
-					5. Timer expires at time T + 0.5 second
-
-@panic KERN-EXEC 15, if this function is called while a request for a timer
-       event is still outstanding.
-*/
-EXPORT_C void RTimer::AgainHighRes(TRequestStatus &aStatus,TTimeIntervalMicroSeconds32 aInterval)
-	{
-	aStatus=KRequestPending;
-	Exec::TimerAgainHighRes(iHandle,aStatus,aInterval.Int());
-	}
-
-
-
-
 EXPORT_C void RTimer::At(TRequestStatus &aStatus,const TTime &aTime)
 //
 // Request an absolute timer.
--- a/kernel/eka/euser/us_ksvr.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/euser/us_ksvr.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -505,10 +505,10 @@
 */
 void TChunkCreateInfo::SetThreadHeap(TInt aInitialSize, TInt aMaxSize, const TDesC& aName)
 	{
-    iType = TChunkCreate::ENormal | TChunkCreate::EData;
-   	iMaxSize = aMaxSize;
+	iType = TChunkCreate::ENormal | TChunkCreate::EData;
 	iInitialBottom = 0;
 	iInitialTop = aInitialSize;
+	iMaxSize = aMaxSize;
 	iAttributes |= TChunkCreate::ELocalNamed;
 	iName = &aName;
 	iOwnerType = EOwnerThread;
@@ -4772,33 +4772,6 @@
 		GetHeap()->__DbgSetAllocFail(aType,aRate);
 	}
 
-UEXPORT_C RAllocator::TAllocFail User::__DbgGetAllocFail(TBool aKernel)
-//
-// Obtains the current heap failure simulation type.
-//
-/**
-After calling __DbgSetAllocFail(), this function may be called to retrieve the
-value set.  This is useful primarily for test code that doesn't know if a heap
-has been set to fail and needs to check.
-
-@param aKernel   ETrue, if checking is being done for the kernel heap;
-                 EFalse, if checking is being done for the current thread's
-                 default heap.
-
-@return RAllocator::ENone if heap is not in failure simulation mode;
-		Otherwise one of the other RAllocator::TAllocFail enumerations
-*/
-	{
-	if (aKernel)
-		{
-		RAllocator::TAllocFail allocFail;
-		Exec::KernelHeapDebug(EDbgGetAllocFail, 0, &allocFail);
-		return(allocFail);
-		}
-	else
-		return(GetHeap()->__DbgGetAllocFail());
-	}
-
 /**
 Simulates a heap allocation failure for the current thread's default heap,
 or the kernel heap.
--- a/kernel/eka/ewsrv/ky_capt.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/ewsrv/ky_capt.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1996-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1996-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"
@@ -41,10 +41,6 @@
 	iCKarray.Close();
 	}
 
-/**
-@note This function can Leave and does not obey the
-coding standard
-*/
 void CCaptureKeys::CheckCaptureKey(const TCaptureKey& aCaptureKey)
 	{
 
@@ -73,10 +69,6 @@
 	User::LeaveIfError(iCKarray.Insert(captureKey,0));
 	}
 
-/**
-@note This function can Leave and does not obey the
-coding standard
-*/
 EXPORT_C void CCaptureKeys::SetCaptureKey(TUint32 aHandle, const TCaptureKey& aCaptureKey)
 //
 // Finds the first capture-key from the list that matches the handle and sets
@@ -87,10 +79,6 @@
 	SetCaptureKey(aHandle,aCaptureKey,0);
 	}
 
-/**
-@note This function can Leave and does not obey the
-coding standard
-*/
 EXPORT_C void CCaptureKeys::SetCaptureKey(TUint32 aHandle, const TCaptureKey& aCaptureKey, TUint8 aPriority)
 //
 // Finds the first capture-key from the list that matches the handle and sets
@@ -108,6 +96,15 @@
 		iCKarray[r]=captureKey;
 	}
 
+void CCaptureKeys::removeCaptureKey(TUint aIndex)
+//
+// Removes the capture-key at the given aIndex from the list
+//
+	{
+
+	iCKarray.Remove(aIndex);
+	}
+
 EXPORT_C void CCaptureKeys::CancelCaptureKey(TUint32 aHandle)
 //
 // Removes the first capture-key from the list that matches the handle;
--- a/kernel/eka/ewsrv/ky_tran.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/ewsrv/ky_tran.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1996-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1996-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"
@@ -23,21 +23,8 @@
 #include <e32keys.h>
 #include <e32uid.h>
 
-/**
-Ordinals of the functions which keymap dlls export.
-
-@note These values depend on the ordering of the exports.
-If the existing def files were ever re-frozen, it would
-lead to a runtime error.
-*/
-enum
-	{
-	EDummy,
-	EKeyDataConv, ///< Access conversion tables, signature TLibFnDataConv
-	EKeyDataFunc, ///< Access function tables, signature TLibFnDataFunc
-	EKeyDataSettings ///< Access data needed for control code entry @see TCtrlDigits, signature TLibFnDataSetting
-	};
-
+enum	{EDummy,EKeyDataConv,EKeyDataFunc,EKeyDataSettings};
+  
 EXPORT_C CKeyTranslator* CKeyTranslator::New()
 //
 // Return the actual key translator
@@ -495,9 +482,7 @@
 //
 typedef void (*TLibFnDataConv)(SConvTable &aConvTable, TUint &aConvTableFirstScanCode,TUint &aConvTableLastScanCode,
 							   SScanCodeBlockList &aKeypadScanCode,SKeyCodeList &aNonAutorepKeyCodes);
-/**
-Populates the object with conversion table data from aLibrary
-*/
+//
 void TConvTable::Update(RLibrary aLibrary)
 #pragma warning (disable: 4705)
 	{
@@ -541,7 +526,6 @@
 	SConvKeyData returnVal;
 	returnVal.keyCode=EKeyNull;
 	returnVal.modifiers=0;
-	returnVal.filler = 0;
 
 	for (TUint i=0; i<iConvTable.numNodes; i++)
         {
--- a/kernel/eka/include/cpudefs.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/cpudefs.h	Wed Sep 01 12:34:56 2010 +0100
@@ -198,9 +198,8 @@
 
 #if defined(__WINS__)
 #define __NAKED__ __declspec( naked )
-#if !defined(__MINIMUM_MACHINE_CODE__) && defined(__KERNEL_MODE__)
-// Assembly language memmove() and memcpy() are used for WINS but only in the kernel, not euser
-#define __MEMMOVE_MACHINE_CODED__
+#ifndef __MINIMUM_MACHINE_CODE__
+//#define __MEM_MACHINE_CODED__
 #endif
 #define __CPU_X86
 #endif
@@ -369,21 +368,21 @@
 #define __END_ARM
 #endif
 
-#define CC_EQ	0U
-#define	CC_NE	1U
-#define CC_CS	2U
-#define CC_CC	3U
-#define CC_MI	4U
-#define CC_PL	5U
-#define CC_VS	6U
-#define CC_VC	7U
-#define CC_HI	8U
-#define CC_LS	9U
-#define CC_GE	10U
-#define CC_LT	11U
-#define CC_GT	12U
-#define CC_LE	13U
-#define	CC_AL	14U
+#define CC_EQ	0
+#define	CC_NE	1
+#define CC_CS	2
+#define CC_CC	3
+#define CC_MI	4
+#define CC_PL	5
+#define CC_VS	6
+#define CC_VC	7
+#define CC_HI	8
+#define CC_LS	9
+#define CC_GE	10
+#define CC_LT	11
+#define CC_GT	12
+#define CC_LE	13
+#define	CC_AL	14
 
 #ifdef __CPU_ARM_HAS_CLZ
 #if __ARM_ASSEMBLER_ISA__ >= 5
@@ -606,10 +605,8 @@
 
 // Causes undefined instruction exception on both ARM and THUMB
 #define __ASM_CRASH()					asm(".word 0xe7ffdeff ")
-#if defined(__GNUC__)  
+#if defined(__GNUC__)
 #define	__crash()						asm(".word 0xe7ffdeff " : : : "memory")
-#elif defined(__GCCXML__)
-#define __crash()						(*((TInt *) 0x0) = 0xd1e)
 #elif defined(__ARMCC__)
 // RVCT doesn't let us inline an undefined instruction
 // use a CDP to CP15 instead - doesn't work on THUMB but never mind
@@ -641,10 +638,8 @@
 #define	EXC_TRAP_CTX_SZ		10		// ebx, esp, ebp, esi, edi, ds, es, fs, gs, eip
 
 // Causes exception
-#if defined(__VC32__)
-#define	__crash()						do { _asm int 255 } while(0)
-#elif defined(__CW32__)
-#define	__crash()						do { *(volatile TInt*)0 = 0; } while(0)
+#if defined(__VC32__) || defined(__CW32__)
+#define	__crash()						do { _asm int 0ffh } while(0)
 #else
 #define	__crash()						asm("int 0xff " : : : "memory")
 #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/include/d32camerasc.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,711 @@
+// 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:
+// e32\include\d32camerasc.h
+// User side class definition for the shared chunk camera driver.
+// 
+//
+
+/**
+ @file
+ @internalAll
+ @prototype
+*/
+
+#ifndef __D32CAMERASC_H__
+#define __D32CAMERASC_H__
+
+#include <e32cmn.h>
+#include <e32ver.h>
+#include <pixelformats.h>
+
+_LIT(KDevCameraScName,"CameraSc");
+
+/**
+Camera capability constants - bitmasks of possible flash modes. @see TCameraCapsV02.
+*/
+/** Flash will automatically fire when required. */
+const TUint KCamFlashAuto = 0x0001;
+/** Flash will always fire. */
+const TUint KCamFlashForced = 0x0002;
+/** Reduced flash for general lighting */
+const TUint KCamFlashFillIn = 0x0004;
+/** Red-eye reduction mode. */
+const TUint KCamFlashRedEyeReduce = 0x0008;
+/** Flash at the moment when shutter opens. */
+const TUint KCamFlashSlowFrontSync = 0x0010;
+/** Flash at the moment when shutter closes. */
+const TUint KCamFlashSlowRearSync = 0x0020;
+/** User configurable setting */
+const TUint KCamFlashManual = 0x0040;
+
+/**
+Camera capability constants - bitmasks of possible exposure modes. @see TCameraCapsV02.
+*/
+/** Night-time setting for long exposures. */
+const TUint KCamExposureNight = 0x0001;
+/** Backlight setting for bright backgrounds. */
+const TUint KCamExposureBacklight = 0x0002;
+/** Centered mode for ignoring surroundings. */
+const TUint KCamExposureCenter = 0x0004;
+/** Sport setting for very short exposures. */
+const TUint KCamExposureSport = 0x0008;
+/** Generalised setting for very long exposures. */
+const TUint KCamExposureVeryLong = 0x0010;
+/** Snow setting for daylight exposure. */
+const TUint KCamExposureSnow = 0x0020;
+/** Beach setting for daylight exposure with reflective glare. */
+const TUint KCamExposureBeach = 0x0040;
+/** Programmed exposure setting. */
+const TUint KCamExposureProgram = 0x0080;
+/** Aperture setting is given priority. */
+const TUint KCamExposureAperturePriority = 0x0100;
+/** Shutter speed setting is given priority. */
+const TUint KCamExposureShutterPriority = 0x0200;
+/** User selectable exposure value setting. */
+const TUint KCamExposureManual = 0x0400;
+/** Exposure night setting with colour removed to get rid of colour noise. */
+const TUint KCamExposureSuperNight = 0x0800;
+/** Exposure for infra-red sensor on the camera */
+const TUint KCamExposureInfra = 0x1000;
+
+/**
+Camera capability constants - bitmasks of possible white balance modes. @see TCameraCapsV02.
+*/
+/** Normal daylight. */
+const TUint KCamWBDaylight = 0x0001;
+/** Overcast daylight. */
+const TUint KCamWBCloudy = 0x0002;
+/** Tungsten filament lighting. */
+const TUint KCamWBTungsten = 0x0004;
+/** Fluorescent tube lighting */
+const TUint KCamWBFluorescent = 0x0008;
+/** Flash lighting. */
+const TUint KCamWBFlash = 0x0010;
+/** High contrast daylight primarily snowy */
+const TUint KCamWBSnow = 0x0020;
+/** High contrast daylight primarily near the sea */
+const TUint KCamWBBeach = 0x0040;
+/** User configurable mode */
+const TUint KCamWBManual = 0x0080;
+
+/**
+Camera capability constants - bitmasks of other miscellaneous camera capabilities supported. @see TCameraCapsV02.
+*/
+/** The camera has zoom capability. */
+const TUint KCamMiscZoom = 0x0001;
+/** The camera supports contrast adjustment. */
+const TUint KCamMiscContrast = 0x0002;
+/** The camera supports brightness adjustment. */
+const TUint KCamMiscBrightness = 0x0004;
+/** The camera supports color effect adjustment. */
+const TUint KCamMiscColorEffect = 0x0008;
+
+
+/**
+Enumeration of capture modes in which to run the sensor.
+*/
+enum TDevCamCaptureMode
+	{
+	/** Used to specify that still image mode is to be used. */
+	ECamCaptureModeImage,
+	/** Used to specify that streaming video mode is to be used. */
+	ECamCaptureModeVideo,
+	/** Used to specify that streaming viewfinder mode is to be used. */
+	ECamCaptureModeViewFinder,
+	/** The last value here, helps keep track of the number of capture modes. */
+	ECamCaptureModeMax
+	};
+
+/**
+Enumeration of camera flash modes. @see TCameraConfigV02.
+*/
+enum TDevCamFlashMode
+	{
+	/** No flash, always supported. */
+	ECamFlashNone=0x0000,
+	/** Flash will automatically fire when required. */
+	ECamFlashAuto=0x0001,
+	/** Flash will always fire. */
+	ECamFlashForced=0x0002,
+	/** Reduced flash for general lighting */
+	ECamFlashFillIn=0x0004,
+	/** Red-eye reduction mode. */
+	ECamFlashRedEyeReduce=0x0008,
+	/** Flash at the moment when shutter opens. */
+	ECamFlashSlowFrontSync=0x0010,
+	/** Flash at the moment when shutter closes. */
+	ECamFlashSlowRearSync=0x0020,
+	/** User configurable setting */
+	ECamFlashManual=0x0040
+	};
+
+/**
+Enumeration of camera exposure modes. @see TCameraConfigV02.
+*/
+enum TDevCamExposureMode
+	{
+	/** Set exposure automatically. Default, always supported. */
+	ECamExposureAuto=0x0000,
+	/** Night-time setting for long exposures. */
+	ECamExposureNight=0x0001,
+	/** Backlight setting for bright backgrounds. */
+	ECamExposureBacklight=0x0002,
+	/** Centered mode for ignoring surroundings. */
+	ECamExposureCenter=0x0004,
+	/** Sport setting for very short exposures. */
+	ECamExposureSport=0x0008,
+	/** Generalised setting for very long exposures. */
+	ECamExposureVeryLong=0x0010,
+	/** Snow setting for daylight exposure. */
+	ECamExposureSnow=0x0020,
+	/** Beach setting for daylight exposure with reflective glare. */
+	ECamExposureBeach=0x0040,
+	/** Programmed exposure setting. */
+	ECamExposureProgram=0x0080,
+	/** Aperture setting is given priority. */
+	ECamExposureAperturePriority=0x0100,
+	/** Shutter speed setting is given priority. */
+	ECamExposureShutterPriority=0x0200,
+	/** User selectable exposure value setting. */
+	ECamExposureManual=0x0400,
+	/** Exposure night setting with colour removed to get rid of colour noise. */
+	ECamExposureSuperNight=0x0800,
+	/** Exposure for infra-red sensor on the camera */
+	ECamExposureInfra=0x1000
+	};
+
+/**
+Enumeration of camera white balance modes. @see TCameraConfigV02.
+*/
+enum TDevCamWhiteBalanceMode
+	{
+	/** Set white balance automatically. Default, always supported. */
+	ECamWBAuto=0x0000,
+	/** Normal daylight. */
+	ECamWBDaylight=0x0001,
+	/** Overcast daylight. */
+	ECamWBCloudy=0x0002,
+	/** Tungsten filament lighting. */
+	ECamWBTungsten=0x0004,
+	/** Fluorescent tube lighting */
+	ECamWBFluorescent=0x0008,
+	/** Flash lighting. */
+	ECamWBFlash=0x0010,
+	/** High contrast daylight primarily snowy */
+	ECamWBSnow=0x0020,
+	/** High contrast daylight primarily near the sea */
+	ECamWBBeach=0x0040,
+	/** User configurable mode */
+	ECamWBManual=0x0080
+	};
+
+/**
+Enumeration of possible directions in which the camera may point. @see TCameraCapsV02.
+*/
+enum TDevCamOrientation
+	{
+	/** Outward pointing camera for taking pictures. Camera is directed away from the user. */
+	ECamOrientationOutwards,
+	/** Inward pointing camera for conferencing. Camera is directed towards the user. */
+	ECamOrientationInwards,
+	/** Mobile camera capable of multiple orientations. Camera orientation may be changed by the user. */
+	ECamOrientationMobile,
+	/** Camera orientation is not known. */
+	ECamOrientationUnknown
+	};
+
+/**
+Each item in the iPixelFormatSupported array is represented by an instance of this structure.
+*/
+struct SDevCamPixelFormat
+	{
+	/** The UID of the pixel format supported */
+	TUidPixelFormat iPixelFormat;
+	/** The number of frame sizes represented by the pixel format. */
+	TUint iNumFrameSizes;
+	/** The pixel width in number of bytes */
+	TUint iPixelWidthInBytes;
+	};
+
+/**
+Each frame size supported is represented by an instance of this structure.
+*/
+struct SDevCamFrameSize
+	{
+	/** Width of the frame in pixels. */
+	TUint iWidth;
+	/** Height of the frame in pixels. */
+	TUint iHeight;
+	/** Minimum frame rate supported by this frame size. */
+	TUint iMinFrameRate;
+	/** Maximum frame rate supported by this frame size. */
+	TUint iMaxFrameRate;
+	};
+
+/**
+Lets us associate buffers to their mode when working out the buffer offset in a chunk.
+**/
+class TDevCamBufferModeAndId
+	{
+public:
+	TDevCamCaptureMode iCaptureMode;
+	TInt iId;
+	};
+typedef TPckgBuf<TDevCamBufferModeAndId> TDevCamBufferModeAndIdBuf;
+
+/**
+The general driver capabilites class - returned by the LDD factory in response to RDevice::GetCaps().
+*/
+class TCapsDevCameraV01
+	{
+public:
+	TVersion iVersion;
+	};
+
+/**
+Defines a list of settings that are changable often (dynamically) within a single use of the device.
+*/
+enum TDevCamDynamicAttribute
+	{
+	ECamAttributeBrightness,
+	ECamAttributeContrast,
+	ECamAttributeColorEffect,
+	ECamAttributeMax
+	};
+
+/**
+Holds the range and interval (rate of change) values for a dynamic capability.
+An array of these would be indexed by TDevCamDynamicAttribute
+*/
+struct TDynamicRange
+	{
+	TUint iMin;
+	TUint iMax;
+	TUint iDefault;
+	};
+
+/**
+The main camera capabilities class. This is used to get the capabilities of a specific camera
+device once a channel to it has been opened.
+*/
+class TCameraCapsV02
+	{
+public :
+	/** The flash modes supported - a bit field. */
+	TUint iFlashModes;
+	/** The exposure modes supported - a bit field. */
+	TUint iExposureModes;
+	/** The white balance modes supported - a bit field. */
+	TUint iWhiteBalanceModes;
+	/** The orientation of the camera device. */
+	TDevCamOrientation iOrientation;
+	/** The minimum value that may be set for the zoom factor. Must be negative or zero. Negative values
+	represent macro functionality. @see TCameraCapsV02::iCapsMisc. @see TCameraConfigV02::iZoom. */
+	TUint iMinZoom;
+	/** The maximum value that may be set for the zoom factor. Must be positive or zero.
+	@see TCameraCapsV02::iCapsMisc. @see TCameraConfigV02::iZoom. */
+	TUint iMaxZoom;
+	/** Whether other miscellaneous capabilities are supported - a bitfield. These
+	capabilities include whether the device supports simultaneous capture modes, zoom capabilities, contrast
+	adjustment, brightness, and color effect adjustment. */
+	TUint iCapsMisc;
+	/** Number of pixel formats supported in still image capture mode.
+	Will be set to 0 if image capture is not supported. */
+	TUint iNumImagePixelFormats;
+	/** Number of pixel formats supported in video capture mode.
+	Will be set to 0 if image capture is not supported. */
+	TUint iNumVideoPixelFormats;
+	/** Number of pixel formats supported in view finder capture mode.
+	Will be set to 0 if image capture is not supported. */
+	TUint iNumViewFinderPixelFormats;
+	
+	/** An array specifying the range in values for settings as defined by TDevCamDynamicAttribute.
+		Indices for settings are in the order defined in TDevCamDynamicAttribute.
+		If the setting is not supported then the entry is still present for performance reasons,
+		i.e. indexing over searching.
+		@see TDevCamDynamicAttribute
+		@see TDynamicRange
+	*/
+	TDynamicRange iDynamicRange[ECamAttributeMax];
+	
+	/** A variable length array specifying the pixel formats supported by the sensor.
+		The size of the TCameraCapsV02 structure is determined by each sensor's capabilities
+		thus the array of supported pixel formats is of variable length. It is stored in memory
+		exactly after TCameraCapsV02 whenever memory is allocated for it and the array cannot be
+		accessed by a private member.
+	SDevCamPixelFormat iPixelFormatsSupported[];
+	*/
+	};
+
+typedef TPckgBuf<TCameraCapsV02> TCameraCapsV02Buf;
+
+/**
+The camera configuration class. This is used to get and set the current
+configuration of the camera. @see SDevCamFrameSize and @see SDevCamPixelFormat.
+*/
+class TCameraConfigV02
+	{
+public:
+	/** The size of the image to get from the sensor. */
+	SDevCamFrameSize iFrameSize;
+	/** The pixel format (RGB, YUV, RGB Bayer etc). */
+	SDevCamPixelFormat iPixelFormat;
+	/** The frame rate (in frame/s). */
+	TUint iFrameRate;
+	/** The flash mode setting. */
+	TDevCamFlashMode iFlashMode;
+	/** The exposure mode setting. */
+	TDevCamExposureMode iExposureMode;
+	/** The white balance mode setting. */
+	TDevCamWhiteBalanceMode iWhiteBalanceMode;
+	/** The zoom factor. Can be zero, positive or negative, Negative values represent macro functionality.*/
+	TInt iZoom;
+	/** Specifies the number of bytes used to store one pixel's worth of data. */
+	TInt iPixelWidthInBytes;
+	};
+typedef TPckgBuf<TCameraConfigV02> TCameraConfigV02Buf;
+
+/** A structure used to assemble arguments for the function RDevCameraSc::SetBufConfigChunkOpen() and to pass
+these to the driver. */
+struct SSetBufConfigChunkOpenInfo
+	{
+	const TDesC8* iBufferConfigBuf;
+	TInt iChunkHandle;
+	};
+
+/** A structure used to assemble arguments for the function RDevCameraSc::FrameSizeCaps() and to pass
+these to the driver. */
+struct SFrameSizeCapsInfo
+	{
+	TUidPixelFormat iUidPixelFormat;
+	TDevCamCaptureMode iCaptureMode;
+	};
+
+/**
+The camera device driver API supporting shared chunks. This is the principle interface to communicate with
+an attached camera.
+*/
+class RDevCameraSc : public RBusLogicalChannel
+	{
+public:
+	enum TRequest
+	/**
+	 Asynchronous request types
+	*/
+		{
+		EMsgRequestMax=3,				// All requests less than this value are handled in the driver DFC thread.
+		ERequestNotifyNewImage,
+		ENumRequests,
+		EAllRequests = (1<<ENumRequests)-1
+		};
+
+	enum TControl
+	/**
+	 Synchronous request types
+	*/
+		{
+		EControlSetBufConfigChunkCreate,
+		EControlSetBufConfigChunkOpen,
+		EControlStart,
+		EControlStop,
+		EControlSetCamConfig,
+		EControlSetCaptureMode,
+		EControlChunkClose,
+		EMsgControlMax=100,				// All requests less than this value are handled in the driver DFC thread.
+		EControlCaps,
+		EControlGetCamConfig,
+		EControlGetBufferConfig,
+		EControlReleaseBuffer,
+		EControlNotifyNewImageSpecificCancel,
+		EControlBufferIdToOffset,
+		EControlCapsSize,
+		EControlFrameSizeCaps,
+		EControlSetDynamicAttribute,
+		EControlGetDynamicAttribute
+		};
+
+public:
+	/**
+	Get the version number of camera driver interface.
+	@return The camera driver interface version number.
+	*/
+	inline static TVersion VersionRequired();
+
+#ifndef __KERNEL_MODE__
+	
+	/**
+	 Constructor.
+	 Initialises private members.
+	 */
+	inline RDevCameraSc();
+	
+	/**
+	Open a channel on a specified camera device. This driver only allows one channel to be opened on each device.
+	@param aUnit The unit number of the camera device.
+	@return KErrNone, if successful;
+			KErrInUse, if a channel is already opened on the unit concerned;
+			otherwise one of the other system-wide error codes.
+	*/
+	inline TInt Open(TInt aUnit);
+
+	/**
+	Close the Channel and clean up.
+	*/
+	inline void Close();
+
+	/**
+	Get the capabilities of the camera device.
+	@param aCapsBuf A packaged TCameraCapsV02 object which on return will be filled with the capabilities of the device.
+	@return KErrNone, if successful;
+			KErrArgument, if aCapsBuf is too small.
+	@see TCameraCapsV02.
+	*/
+	inline TInt Caps(TDes8& aCapsBuf);
+
+	/**
+	Get the capabilities of the camera device.
+	@return TPtrC8 pointing to a locally held TCameraCapsV02 structure owned by the driver.
+	@see TCameraCapsV02.
+	*/
+	inline TPtrC8 Caps();
+
+	/**
+	Set the camera configuration settings.
+	@param aCaptureMode	The capture mode that camera will be configured for.
+	@param aConfigBuf	A packaged TCameraConfigV02 object which contains the configuration settings.
+	@see TCameraConfigV02.
+	*/
+	inline TInt SetCamConfig(TDevCamCaptureMode aCaptureMode, const TDesC8& aConfigBuf);
+
+	/**
+	Trigger the buffer allocation and configuration setting - creating a shared chunk.
+	From the frame size, pixel format (already supplied) and the number of camera buffers specified,
+	the driver will	calculate the size of the shared chunk this requires. It will create such
+	a shared chunk containing the specified number of buffers within it (each with memory committed to them).
+	This will replace a previous shared chunk created by this driver.
+	A handle to the chunk will then be created for the client thread which will be assigned to the
+	RChunk object supplied by the client.The configuration cannot be changed unless image capture is disabled.
+	@param aCaptureMode	The capture mode that camera will be configured for.
+	@param aNumBuffers	The desired number of buffers that is going to be used.
+	@param aChunk		An RChunk object to which the chunk handle will be assigned.
+	@return KErrNone if successful;
+			KErrInUse if image capturing is already in progress;
+			KErrArgument if any configuration values are invalid;
+			KErrNoMemory if the driver failed allocate memory for the shared chunk specified;
+			otherwise one of the other system-wide error codes.
+	*/
+	inline TInt SetBufConfigChunkCreate(TDevCamCaptureMode aCaptureMode, TInt aNumBuffers, RChunk& aChunk);
+
+	/**
+	Get the current camera configuration settings.
+	@param aCaptureMode	The capture mode that the user requested the configuration settings of.
+	@param aConfigBuf	A packaged TCameraConfigV02 object which will be filled with the configuration settings.
+	@see TCameraConfigV02.
+	*/
+	inline void GetCamConfig(TDevCamCaptureMode aCaptureMode, TDes8& aConfigBuf);
+
+	/**
+	Get the current buffer configuration settings.
+	@param aCaptureMode	The capture mode that the configuration request is for.
+	@param aConfigBuf	A packaged TSharedChunkBufConfigBase derived object which will be filled with the configuration settings.
+	@see TSharedChunkBufConfigBase.
+	*/
+	inline void GetBufferConfig(TDevCamCaptureMode aCaptureMode, TDes8& aConfigBuf);
+
+	/**
+	Set the current buffer configuration settings - using an existing shared chunk.
+	The client supplies an existing shared chunk which is to be used by the driver as the play buffer.
+	Any shared chunk previously created by the driver will be closed by it.
+	The configuration cannot be changed unless image capture is disabled.
+	@param aCaptureMode	The capture mode that the configuration is for.
+	@param aBufferConfigBuf	A packaged TSharedChunkBufConfigBase derived object holding information on the buffer configuration
+							settings of the chunk supplied.
+	@param aChunk			A handle to the shared chunk which is to be used as the buffer. (This must be a
+							valid handle for the calling thread).
+	@return KErrNone if successful;
+			KErrInUse if the playing of data is in progress;
+			KErrBadHandle if the chunk handle was invalid;
+			KErrArgument if any configuration values are invalid;
+			otherwise one of the other system-wide error codes.
+	@see TCameraConfigV02.
+	*/
+	inline TInt SetBufConfigChunkOpen(TDevCamCaptureMode aCaptureMode, const TDesC8& aBufferConfigBuf, RChunk& aChunk);
+
+	/**
+	Closes the chunk associated with a given capture mode, and frees the associated buffers.  The chunk being closed,
+	should have been allocated by the device driver by a call to SetBufConfigChunkCreate().
+	@param aCaptureMode The capture mode for which to close the chunk.
+	@return	KErrNone if successful.
+			KErrInUse if an attempt has been made to free the memory and chunk while they are in use.
+			Otherwise one of the other system-wide error codes.
+	*/
+	inline TInt ChunkClose(TDevCamCaptureMode aCaptureMode);
+
+	/**
+	Start the image capture process in the capture mode supplied.
+	If the driver is in free running mode then it will commence capturing frames - cycling between
+	each buffer available to it until Stop() is called. In one shot mode the driver postpones the capturing
+	of frames until a NotifyNewImage() request is received.
+	@return KErrNone if successful;
+			KErrNotReady if SetConfig() has not been previously called;
+			otherwise one of the other system-wide error codes.
+	@pre The driver must have been previousely initialised by a call to SetConfigNN()
+	*/
+	inline TInt Start();
+
+	/**
+	End the image capturing process.
+	Also performs NotifyNewImageCancel()
+	@return KErrGeneral if Start() has not been previously called;
+			KErrNone otherwise.
+	*/
+	inline TInt Stop();
+
+	/**
+	Get the next available image.
+	More than one request may be pending at any time.
+	If the camera is enabled for image capture and image capture is not already in progress then the issuing
+	of this request will start image capture mode.
+	@param aStatus 	The request status which is signaled when an image is available (or an error occurs).
+					If the request is successful then this result value is the offset within the shared chunk
+					where the capture image resides. Alternatively, if an error occurs it will be set to one of
+					the system wide error values:
+				 	KErrNotReady if Start() hasn't been previousely called;
+				 	KErrInUse if the client already has all the images buffers.
+	@pre Image capturing must have been started with Start().
+	*/
+	inline void NotifyNewImage(TRequestStatus& aStatus);
+
+	/**
+	Cancels all outstanding NotifyNewImage() requests.
+	All outstanding requests complete with KErrCancel.
+	*/
+	inline void NotifyNewImageCancel();
+
+	/**
+	Cancels a specific NotifyNewImage() request.
+	The outstanding request completes with KErrCancel.
+	@param aStatus The request status object associated with the request to be cancelled.
+	*/
+	inline void NotifyNewImageCancel(const TRequestStatus& aStatus);
+
+	/**
+	Release a buffer - making it available again for the driver to capture images into.
+	@param aBufferId	The buffer id of the buffer that the image to be released is stored.
+						This is a value returned by the NotifyNewImage() request when
+						the buffer was claimed by the client.
+	@return KErrNone if successful;
+			KErrNotFound if the buffer id is invalid;
+			otherwise one of the other system-wide error codes.
+	*/
+	inline TInt ReleaseBuffer(TInt aBufferId);
+
+	/**
+	Retrieves the offset to the start of the buffer using its id, in the specified capture mode.
+	@param aCaptureMode	The capture mode that the buffer in the chunk is related to.
+	@param aId			The id of the buffer in the chunk.
+	@param aOffset		The offset, in bytes, of the start of the buffer within the chunk.
+	@return KErrNone if successful;
+			KErrNotFound if the id doesn't exist;
+			otherwise one of the other system-wide error codes.
+	*/
+	inline TInt BufferIdToOffset(TDevCamCaptureMode aCaptureMode, TInt aId, TInt& aOffset);
+
+	/**
+	Sets the current capture mode. Submits the camera configuration	to the PDD.
+	@param aCaptureMode	The capture mode that the camera switches to.	@see TDevCamCaptureMode.
+	@return KErrNone if successful;
+			otherwise one of the other system-wide error codes.
+	*/
+	inline TInt SetCaptureMode(TDevCamCaptureMode aCaptureMode);
+
+	/**
+	Queries the driver for the size of the structure to be passed to Caps().
+	@return The size of the structure required to hold all capability information.
+			otherwise one of the system-wide error codes.
+	*/
+	inline TInt CapsSize();
+
+	/**
+	Gets information regarding the frame sizes and frame rates supported for a given combination of capture mode and pixel format.
+	The capture mode and pixel format chosen will be dependent upon the information returned by RDevCameraSc::Caps().
+	@param	aCaptureMode The capture mode concerned.
+	@param	aUidPixelFormat The UID of the pixel format mode concerned.
+	@param	aFrameSizeCapsBuf	A packaged array of SDevCamFrameSize structures.
+								This is a variable length array and must be large enough to hold all entries.
+								Its size is determined by SDevCamPixelFormat::iNumFrameSizes, returned by RDevCameraSc::Caps(),
+								multiplied by the size of SDevCamFrameSize.
+	@return	KErrNone if successful;
+			KErrArgument if an invalid capture mode or pixel format is specified, or if aFrameSizeCapsBuf is too small.
+			otherwise one of the other system-wide error codes.
+	*/
+	inline TInt FrameSizeCaps(TDevCamCaptureMode aCaptureMode, TUidPixelFormat aUidPixelFormat, TDes8& aFrameSizeCapsBuf);
+	
+
+	/**
+	Allows changing of the dynamic settings as specified in TDevCamDynamicAttribute.
+	Checks locally the validity of the arguments passed so as to increase performance by not
+	forcing a context switch.
+	Check the allowable range of the settings via the TCameraCapsV02::iDynamicRange member.
+
+	@param aAttribute An enum identifying the dynamic attribute to change.
+	@param aValue The attributes value within a valid range.
+	@return KErrNone if successful, KErrNotSupported if not supported, 
+			KErrArgument if aValue is out of range.
+			Otherwise, one of the system wide error codes.
+	@see TDevCamDynamicAttribute
+	@see TCameraCapsV02
+	*/
+	TInt SetDynamicAttribute(TDevCamDynamicAttribute aAttribute, TUint aValue);
+
+	/**
+	Queries the driver for a dynamic setting's value.
+	This function does not force a context switch by reading the values from a cache.
+	
+	@param aAttribute An enum identifying the dynamic attribute to query.
+	@param aValue A reference to a variable that will be set to the queried attribute's value.
+	@return KErrNone if successful, KErrNotFound if aAttribute is not supported by the driver.
+		Otherwise, one of the system-wide error codes.
+
+	@see TDevCamDynamicAttribute
+	@see TCameraCapsV02
+	*/
+	TInt GetDynamicAttribute(TDevCamDynamicAttribute aAttribute, TUint& aValue);
+
+protected:
+	TInt CheckAttributeSupported(TDevCamDynamicAttribute aAttribute);
+
+
+private:
+	/** 
+	Capability of Sensor. 
+	Kept here for performance issues, i.e. to avoid context switches.
+	*/
+	TCameraCapsV02 *iCameraCaps;
+
+	/** 
+	Size of Camera Capabiliy struct. 
+	Kept here for performance issues, i.e. to avoid context switches.
+	*/
+	TInt iCapsSize;
+	
+#endif	// __KERNEL_MODE__
+	};
+
+
+
+
+#include <d32camerasc.inl>
+
+#endif	// __D32CAMERASC_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/include/d32camerasc.inl	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,222 @@
+// 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:
+// e32\include\d32camerasc.inl
+// 
+//
+
+inline TVersion RDevCameraSc::VersionRequired()
+	{
+	const TInt KCameraMajorVersionNumber=1;
+	const TInt KCameraMinorVersionNumber=0;
+	const TInt KCameraBuildVersionNumber=KE32BuildVersionNumber;
+	return TVersion(KCameraMajorVersionNumber,KCameraMinorVersionNumber,KCameraBuildVersionNumber);
+	}
+
+#ifndef __KERNEL_MODE__
+
+
+inline RDevCameraSc::RDevCameraSc()
+: RBusLogicalChannel()
+	{
+	iCameraCaps = NULL;
+	iCapsSize = 0;
+	}
+
+inline TInt RDevCameraSc::Open(TInt aUnit)
+	{
+	TInt r=DoCreate(KDevCameraScName,VersionRequired(),aUnit,NULL,NULL,EOwnerThread);
+	if (KErrNone == r)
+		{
+		// Obtain the Capability structure size then allocate memory for it on client side
+		r=iCapsSize=DoControl(EControlCapsSize);		
+		if (KErrNone > r)
+			{
+			iCapsSize = 0;
+			return r;
+			}
+
+		TAny* capsBufPtr = User::Alloc(iCapsSize);
+		if(NULL == capsBufPtr)
+			{
+			Close();
+			return KErrNoMemory;
+			}
+
+		TPtr8 capsPtr((TUint8*)capsBufPtr, iCapsSize, iCapsSize);
+		// Fill the Capability structure
+		r = DoControl(EControlCaps,(TAny*)&capsPtr);
+		if (KErrNone > r)
+			{
+			iCapsSize = 0;
+			return r;
+			}
+		iCameraCaps = (TCameraCapsV02*) capsPtr.Ptr();
+		}
+
+	return r;
+	}
+
+inline void RDevCameraSc::Close()
+	{
+	if (iCameraCaps != NULL)
+		{
+		User::Free(iCameraCaps);
+		iCameraCaps = NULL;
+		}
+	iCapsSize = 0;
+	RBusLogicalChannel::Close();
+	}
+
+inline TInt RDevCameraSc::Caps(TDes8& aCapsBuf)
+	{
+	if (aCapsBuf.MaxLength() < iCapsSize)
+		{
+		return KErrArgument;
+		}
+
+	TPtrC8 ptr ((TUint8*)iCameraCaps, iCapsSize);
+	aCapsBuf = ptr;
+	return KErrNone;
+	}
+
+inline TPtrC8 RDevCameraSc::Caps()
+	{
+	TPtrC8 ptr((TUint8*)iCameraCaps, iCapsSize);
+	return ptr;
+	}
+
+inline TInt RDevCameraSc::SetBufConfigChunkCreate(TDevCamCaptureMode aCaptureMode, TInt aNumBuffers, RChunk& aChunk)
+	{return(aChunk.SetReturnedHandle(DoControl(EControlSetBufConfigChunkCreate,(TAny*)aCaptureMode,(TAny*)aNumBuffers)));}
+
+inline TInt RDevCameraSc::SetBufConfigChunkOpen(TDevCamCaptureMode aCaptureMode, const TDesC8& aBufferConfigBuf, RChunk& aChunk)
+	{
+	SSetBufConfigChunkOpenInfo info = {&aBufferConfigBuf, aChunk.Handle()};
+	return(DoControl(EControlSetBufConfigChunkOpen,(TAny*)aCaptureMode,&info));
+	}
+
+inline TInt RDevCameraSc::ChunkClose(TDevCamCaptureMode aCaptureMode)
+	{return(DoControl(EControlChunkClose,(TAny*)aCaptureMode));}
+
+inline TInt RDevCameraSc::SetCamConfig(TDevCamCaptureMode aCaptureMode,const TDesC8& aConfigBuf)
+	{return(DoControl(EControlSetCamConfig,(TAny*)aCaptureMode,(TAny*)&aConfigBuf));}
+
+inline void RDevCameraSc::GetCamConfig(TDevCamCaptureMode aCaptureMode, TDes8& aConfigBuf)
+	{DoControl(EControlGetCamConfig,(TAny*)aCaptureMode,(TAny*)&aConfigBuf);}
+
+inline void RDevCameraSc::GetBufferConfig(TDevCamCaptureMode aCaptureMode, TDes8& aConfigBuf)
+	{DoControl(EControlGetBufferConfig,(TAny*)aCaptureMode,(TAny*)&aConfigBuf);}
+
+inline TInt RDevCameraSc::SetCaptureMode(TDevCamCaptureMode aCaptureMode)
+	{return(DoControl(EControlSetCaptureMode,(TAny*)aCaptureMode));}
+
+inline TInt RDevCameraSc::Start()
+	{return(DoControl(EControlStart));}
+
+inline TInt RDevCameraSc::Stop()
+	{return(DoControl(EControlStop));}
+
+inline void RDevCameraSc::NotifyNewImage(TRequestStatus& aStatus)
+	{DoRequest(ERequestNotifyNewImage,aStatus);}
+
+inline void RDevCameraSc::NotifyNewImageCancel()
+	{DoCancel(1<<ERequestNotifyNewImage);}
+
+inline void RDevCameraSc::NotifyNewImageCancel(const TRequestStatus& aStatus)
+	{DoControl(EControlNotifyNewImageSpecificCancel,(TAny*)&aStatus);}
+
+inline TInt RDevCameraSc::ReleaseBuffer(TInt aBufferId)
+	{return(DoControl(EControlReleaseBuffer,(TAny*)aBufferId));}
+
+inline TInt RDevCameraSc::BufferIdToOffset(TDevCamCaptureMode aCaptureMode, TInt aId, TInt& aOffset)
+	{
+	// search criteria
+	TDevCamBufferModeAndIdBuf databuf;
+	TDevCamBufferModeAndId &data = databuf();
+	data.iCaptureMode = aCaptureMode;
+	data.iId = aId;
+
+	return (DoControl(EControlBufferIdToOffset,(TAny*)&databuf,(TAny*)&aOffset));
+	}
+
+inline TInt RDevCameraSc::CapsSize()
+	{return(iCapsSize);}
+
+inline TInt RDevCameraSc::FrameSizeCaps(TDevCamCaptureMode aCaptureMode, TUidPixelFormat aUidPixelFormat, TDes8& aFrameSizeCapsBuf)
+	{
+	SFrameSizeCapsInfo info = {aUidPixelFormat, aCaptureMode};
+	return(DoControl(EControlFrameSizeCaps, (TAny*)&aFrameSizeCapsBuf, &info));
+	}
+
+//
+//
+//
+inline TInt RDevCameraSc::CheckAttributeSupported(TDevCamDynamicAttribute aAttribute)
+	{
+	TUint mask = 0;
+	
+	switch (aAttribute)
+		{
+		case ECamAttributeBrightness:
+			mask = KCamMiscBrightness;
+			break;
+			
+		case ECamAttributeContrast:
+			mask = KCamMiscContrast;
+			break;
+			
+		case ECamAttributeColorEffect:
+			mask = KCamMiscColorEffect;
+			break;
+			
+		default:
+			return KErrNotSupported;
+		}
+	
+	// Check that the attribute is supported by the hardware.
+	return (iCameraCaps->iCapsMisc & mask ? KErrNone : KErrNotSupported);
+	}
+	
+//
+//
+//
+inline TInt RDevCameraSc::SetDynamicAttribute(TDevCamDynamicAttribute aAttribute, TUint aValue)
+	{
+	TInt err = CheckAttributeSupported(aAttribute);
+	if (err == KErrNone)
+		{
+		err = KErrArgument;
+		TDynamicRange &range = iCameraCaps->iDynamicRange[aAttribute];
+		if ((aValue >= range.iMin) && (aValue <= range.iMax))
+			{
+			err = DoControl(EControlSetDynamicAttribute, (TAny*)aAttribute, (TAny*)aValue);
+			}
+		}
+
+	return err;
+	}
+
+//
+//
+//
+inline TInt RDevCameraSc::GetDynamicAttribute(TDevCamDynamicAttribute aAttribute, TUint& aValue)
+	{
+	TInt err = CheckAttributeSupported(aAttribute);
+	if (err == KErrNone)
+		{
+		err = DoControl(EControlGetDynamicAttribute, (TAny*)aAttribute, (TAny*)&aValue);
+		}
+		
+	return err;
+	}
+#endif	// __KERNEL_MODE__
--- a/kernel/eka/include/d32comm.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/d32comm.h	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1995-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1995-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"
@@ -30,6 +30,64 @@
 #include <d32public.h>
 
 /**
+ Enumeration of number of data bits for serial port configuration.
+ Typically, these values are used to initialize the iDataBits of 
+ TCommConfigV01 before calling DComm::Configure() or any other serial
+ comm API to configure the serial port's databits size.
+ */
+enum TDataBits {EData5,EData6,EData7,EData8};
+/**
+ Enumeration of number of stop bits for serial port configuration.
+ Typically, these values are used to initialize the iStopBits of 
+ TCommConfigV01 before calling DComm::Configure() or any other serial
+ comm API to configure the serial port's stopbits.
+ */
+enum TStopBits {EStop1,EStop2};
+/**
+ Enumeration of types of parity for serial port configuration.
+ Typically, these values are used to initialize the iParity of 
+ TCommConfigV01 before calling DComm::Configure() or any other serial
+ comm API to configure the serial port's parity setting.
+ */
+enum TParity {EParityNone,EParityEven,EParityOdd,EParityMark,EParitySpace};
+/**
+ Enumeration of baud rates in bits per second for serial port configuration.
+ * e.g EBps115200 is for 115200Bps data rate  
+ Typically, these values are used to initialize the iRate of TCommConfigV01 
+ before calling DComm::Configure() or any other serial comm API to configure
+ the serial port's baud rate.
+ */
+enum TBps
+	{
+	EBps50,
+	EBps75,
+	EBps110,
+	EBps134,
+	EBps150,
+	EBps300,
+	EBps600,
+	EBps1200,
+	EBps1800,
+	EBps2000,
+	EBps2400,
+	EBps3600,
+	EBps4800,
+	EBps7200,
+	EBps9600,
+	EBps19200,
+	EBps38400,
+	EBps57600,
+	EBps115200,
+	EBps230400,
+	EBps460800,
+	EBps576000,
+	EBps1152000,
+	EBps4000000,
+	EBps921600,
+	EBpsAutobaud=0x40000000,
+	EBpsSpecial=0x80000000,
+	};
+/**
  Enumeration of Fifo status (enable and disable) for serial port configuration.
  Typically, these values are used to initialize the iFifo of TCommConfigV01 
  before calling DComm::Configure() or any other serial comm API to configure
--- a/kernel/eka/include/d32public.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/d32public.h	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1995-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1995-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"
@@ -26,67 +26,6 @@
 #ifndef __D32PUBLIC_H__
 #define __D32PUBLIC_H__
 
-/**
- Enumeration of number of data bits for serial port configuration.
- Typically, these values are used to initialize the iDataBits of 
- TCommConfigV01 before calling DComm::Configure() or any other serial
- comm API to configure the serial port's databits size.
- */
-enum TDataBits {EData5,EData6,EData7,EData8};
-
-/**
- Enumeration of number of stop bits for serial port configuration.
- Typically, these values are used to initialize the iStopBits of 
- TCommConfigV01 before calling DComm::Configure() or any other serial
- comm API to configure the serial port's stopbits.
- */
-enum TStopBits {EStop1,EStop2};
-
-/**
- Enumeration of types of parity for serial port configuration.
- Typically, these values are used to initialize the iParity of 
- TCommConfigV01 before calling DComm::Configure() or any other serial
- comm API to configure the serial port's parity setting.
- */
-enum TParity {EParityNone,EParityEven,EParityOdd,EParityMark,EParitySpace};
-
-/**
- Enumeration of baud rates in bits per second for serial port configuration.
- * e.g EBps115200 is for 115200Bps data rate  
- Typically, these values are used to initialize the iRate of TCommConfigV01 
- before calling DComm::Configure() or any other serial comm API to configure
- the serial port's baud rate.
- */
-enum TBps
-	{
-	EBps50,
-	EBps75,
-	EBps110,
-	EBps134,
-	EBps150,
-	EBps300,
-	EBps600,
-	EBps1200,
-	EBps1800,
-	EBps2000,
-	EBps2400,
-	EBps3600,
-	EBps4800,
-	EBps7200,
-	EBps9600,
-	EBps19200,
-	EBps38400,
-	EBps57600,
-	EBps115200,
-	EBps230400,
-	EBps460800,
-	EBps576000,
-	EBps1152000,
-	EBps4000000,
-	EBps921600,
-	EBpsAutobaud=0x40000000,
-	EBpsSpecial=0x80000000,
-	};
 
 enum TFlowControl
 	{
--- a/kernel/eka/include/d32usbcsc.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/d32usbcsc.h	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -383,7 +383,7 @@
         EControlGetOtgDescriptor,
         EControlGetOtgFeatures, 
 		EControlRealizeInterface,
-		EControlStartNextInAlternateSetting
+		EControlStartNextInAlternateSetting	
 		};
 
 
@@ -399,26 +399,13 @@
 
 #ifndef __KERNEL_MODE__
 
-
 	/** Opens a channel.
 
 		@param aUnit This should be 0 (zero).
-		@param aShare if this channel can be used in another process.
 
 		@return KErrNone if successful.
 	*/
-	inline TInt Open(TInt aUnit, TBool aShare=ETrue);
-
-	/** Opens a channel which has created.
-
-		@param aMsg client-server message contain the handle of this channel.
-		@param aPos index of message slot that contain handle.
-		@param aType ownership type of the handle.
-
-		@return KErrNone if successful.
-	*/
-
-	inline TInt Open(RMessagePtr2 aMsg, TInt aIndex, TOwnerType aType=EOwnerProcess);
+	inline TInt Open(TInt aUnit);
 
 	inline TVersion VersionRequired() const;
 
@@ -1308,17 +1295,8 @@
 	@return KErrNone on success otherwise a system wide error code, if an error has occurred.
 	*/
 	IMPORT_C TInt GetDataTransferChunk(RChunk*& aChunk);
-	/**
-	Call this function to reset alternate setting related data to initial state,
-	this API should be called when device state goes to undefined.
-	*/
-	IMPORT_C void ResetAltSetting();
-
-	
 
 private:
- 	/** @internalTechnology */
-	TInt Empty(TUint aBufferOffset);
 	/** @internalTechnology */
 	TInt Drain(TUint aBuffer);
 	/** @internalTechnology */ 
@@ -1509,8 +1487,6 @@
 	*/
 	inline TInt GetEndpointNumber();
 
-	inline TInt BufferNumber();
-
 private:
 	/** @internalTechnology */
 	void Construct(RDevUsbcScClient* aClient, TUint8* aBaseAddr, const TUsbcScHdrEndpointRecord* aEpType,
--- a/kernel/eka/include/d32usbcsc.inl	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/d32usbcsc.inl	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1995-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1995-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"
@@ -118,19 +118,10 @@
 
 /** @capability CommDD
 */
-inline TInt RDevUsbcScClient::Open(TInt aUnit, TBool aShare)
+inline TInt RDevUsbcScClient::Open(TInt aUnit)
 	{
 	_LIT(KUsbDevName, "usbcsc");
-	return (DoCreate(KUsbDevName, VersionRequired(), aUnit, NULL, NULL, EOwnerThread, aShare));
-	}
-
-inline TInt RDevUsbcScClient::Open(RMessagePtr2 aMessage,TInt aParam,TOwnerType aType)
-	{
-	iEndpointStatus = 0;
-	iAltSettingSeq = 0;
-	iAlternateSetting = 0;
-	iNewAltSetting = 0;
-	return RBusLogicalChannel::Open(aMessage,aParam,aType);
+	return (DoCreate(KUsbDevName, VersionRequired(), aUnit, NULL, NULL, EOwnerThread));
 	}
 
 
@@ -723,8 +714,6 @@
 	return DoControl(EControlStartNextInAlternateSetting);
 	}
 
-
-
 //Buffer Interface Layer (BIL) inline functions
 
 
@@ -741,12 +730,6 @@
 	return iEndpointNumber;
 	}
 
-inline TInt TEndpointBuffer::BufferNumber()
-	{
-	return iBufferNum;
-	}
-
-
 #endif // #ifndef __KERNEL_MODE__
 
 #endif // #ifndef __D32USBCSC_INL__
--- a/kernel/eka/include/d32usbtransfers.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/d32usbtransfers.h	Wed Sep 01 12:34:56 2010 +0100
@@ -54,7 +54,7 @@
 friend class RUsbTransferStrategy;
 
 public:
-	IMPORT_C virtual void Close();
+	virtual void Close();
 
 protected:
 	RUsbTransferDescriptor(TTransferType aType, TInt aMaxSize, TInt aMaxNumPackets);
--- a/kernel/eka/include/dla.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,946 +0,0 @@
-// Copyright (c) 1994-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:
-// kernel\eka\include\dla.h
-// 
-// Uses malloc (aka dlmalloc) written by Doug Lea version 2.8.4
-//
-
-#ifndef __DLA__
-#define __DLA__
-
-#define DEFAULT_TRIM_THRESHOLD ((size_t)4U * (size_t)1024U)
-
-#define MSPACES 0
-#define HAVE_MORECORE 1
-#define	MORECORE_CONTIGUOUS 1
-#define	HAVE_MMAP 0
-#define HAVE_MREMAP 0
-#define DEFAULT_GRANULARITY (4096U)
-#define FOOTERS 0
-#define USE_LOCKS 0
-#define INSECURE 1
-#define NO_MALLINFO 0
-
-#define LACKS_SYS_TYPES_H
-#ifndef LACKS_SYS_TYPES_H
-#include <sys/types.h>  /* For size_t */
-#else
-#ifndef _SIZE_T_DECLARED
-typedef unsigned int size_t;
-#define	_SIZE_T_DECLARED
-#endif
-#endif  /* LACKS_SYS_TYPES_H */
-
-/* The maximum possible size_t value has all bits set */
-#define MAX_SIZE_T           (~(size_t)0)
-
-#ifndef ONLY_MSPACES
-	#define ONLY_MSPACES 0
-#endif  /* ONLY_MSPACES */
-
-#ifndef MSPACES
-	#if ONLY_MSPACES
-		#define MSPACES 1
-	#else   /* ONLY_MSPACES */
-		#define MSPACES 0
-	#endif  /* ONLY_MSPACES */
-#endif  /* MSPACES */
-
-//#ifndef MALLOC_ALIGNMENT
-//	#define MALLOC_ALIGNMENT ((size_t)8U)
-//#endif  /* MALLOC_ALIGNMENT */
-
-#ifndef FOOTERS
-	#define FOOTERS 0
-#endif  /* FOOTERS */
-
-#ifndef ABORT
-//	#define ABORT  abort()
-//	#define ABORT  User::Invariant()// redefined so euser isn't dependant on oe
-  	#define ABORT  HEAP_PANIC(ETHeapBadCellAddress)
-#endif  /* ABORT */
-
-#ifndef PROCEED_ON_ERROR
-	#define PROCEED_ON_ERROR 0
-#endif  /* PROCEED_ON_ERROR */
-
-#ifndef USE_LOCKS
-	#define USE_LOCKS 0
-#endif  /* USE_LOCKS */
-
-#ifndef INSECURE
-	#define INSECURE 0
-#endif  /* INSECURE */
-
-#ifndef HAVE_MMAP
-	#define HAVE_MMAP 1
-#endif  /* HAVE_MMAP */
-
-#ifndef MMAP_CLEARS
-	#define MMAP_CLEARS 1
-#endif  /* MMAP_CLEARS */
-
-#ifndef HAVE_MREMAP
-	#ifdef linux
-		#define HAVE_MREMAP 1
-	#else   /* linux */
-		#define HAVE_MREMAP 0
-	#endif  /* linux */
-#endif  /* HAVE_MREMAP */
-
-#ifndef MALLOC_FAILURE_ACTION
-	//#define MALLOC_FAILURE_ACTION  errno = ENOMEM;
-	#define MALLOC_FAILURE_ACTION ;
-#endif  /* MALLOC_FAILURE_ACTION */
-
-#ifndef HAVE_MORECORE
-	#if ONLY_MSPACES
-		#define HAVE_MORECORE 1 /*AMOD: has changed */
-	#else   /* ONLY_MSPACES */
-		#define HAVE_MORECORE 1
-	#endif  /* ONLY_MSPACES */
-#endif  /* HAVE_MORECORE */
-
-#if !HAVE_MORECORE
-	#define MORECORE_CONTIGUOUS 0
-#else   /* !HAVE_MORECORE */
-	#ifndef MORECORE
-		#define MORECORE DLAdjust
-	#endif  /* MORECORE */
-	#ifndef MORECORE_CONTIGUOUS
-		#define MORECORE_CONTIGUOUS 0
-	#endif  /* MORECORE_CONTIGUOUS */
-#endif  /* !HAVE_MORECORE */
-
-#ifndef DEFAULT_GRANULARITY
-	#if MORECORE_CONTIGUOUS
-		#define DEFAULT_GRANULARITY 4096  /* 0 means to compute in init_mparams */
-	#else   /* MORECORE_CONTIGUOUS */
-		#define DEFAULT_GRANULARITY ((size_t)64U * (size_t)1024U)
-	#endif  /* MORECORE_CONTIGUOUS */
-#endif  /* DEFAULT_GRANULARITY */
-
-#ifndef DEFAULT_TRIM_THRESHOLD
-	#ifndef MORECORE_CANNOT_TRIM
-		#define DEFAULT_TRIM_THRESHOLD ((size_t)2U * (size_t)1024U * (size_t)1024U)
-	#else   /* MORECORE_CANNOT_TRIM */
-		#define DEFAULT_TRIM_THRESHOLD MAX_SIZE_T
-	#endif  /* MORECORE_CANNOT_TRIM */	
-#endif  /* DEFAULT_TRIM_THRESHOLD */
-
-#ifndef DEFAULT_MMAP_THRESHOLD
-	#if HAVE_MMAP
-		#define DEFAULT_MMAP_THRESHOLD ((size_t)256U * (size_t)1024U)
-	#else   /* HAVE_MMAP */
-		#define DEFAULT_MMAP_THRESHOLD MAX_SIZE_T
-	#endif  /* HAVE_MMAP */
-#endif  /* DEFAULT_MMAP_THRESHOLD */
-
-#ifndef USE_BUILTIN_FFS
-	#define USE_BUILTIN_FFS 0
-#endif  /* USE_BUILTIN_FFS */
-
-#ifndef USE_DEV_RANDOM
-	#define USE_DEV_RANDOM 0
-#endif  /* USE_DEV_RANDOM */
-
-#ifndef NO_MALLINFO
-	#define NO_MALLINFO 0
-#endif  /* NO_MALLINFO */
-#ifndef MALLINFO_FIELD_TYPE
-	#define MALLINFO_FIELD_TYPE size_t
-#endif  /* MALLINFO_FIELD_TYPE */
-
-/*
-  mallopt tuning options.  SVID/XPG defines four standard parameter
-  numbers for mallopt, normally defined in malloc.h.  None of these
-  are used in this malloc, so setting them has no effect. But this
-  malloc does support the following options.
-*/
-
-#define M_TRIM_THRESHOLD     (-1)
-#define M_GRANULARITY        (-2)
-#define M_MMAP_THRESHOLD     (-3)
-
-#if !NO_MALLINFO
-/*
-  This version of malloc supports the standard SVID/XPG mallinfo
-  routine that returns a struct containing usage properties and
-  statistics. It should work on any system that has a
-  /usr/include/malloc.h defining struct mallinfo.  The main
-  declaration needed is the mallinfo struct that is returned (by-copy)
-  by mallinfo().  The malloinfo struct contains a bunch of fields that
-  are not even meaningful in this version of malloc.  These fields are
-  are instead filled by mallinfo() with other numbers that might be of
-  interest.
-
-  HAVE_USR_INCLUDE_MALLOC_H should be set if you have a
-  /usr/include/malloc.h file that includes a declaration of struct
-  mallinfo.  If so, it is included; else a compliant version is
-  declared below.  These must be precisely the same for mallinfo() to
-  work.  The original SVID version of this struct, defined on most
-  systems with mallinfo, declares all fields as ints. But some others
-  define as unsigned long. If your system defines the fields using a
-  type of different width than listed here, you MUST #include your
-  system version and #define HAVE_USR_INCLUDE_MALLOC_H.
-*/
-
-/* #define HAVE_USR_INCLUDE_MALLOC_H */
-
-#ifdef HAVE_USR_INCLUDE_MALLOC_H
-#include "/usr/include/malloc.h"
-#else /* HAVE_USR_INCLUDE_MALLOC_H */
-
-struct mallinfo {
-  MALLINFO_FIELD_TYPE iArena;    /* non-mmapped space allocated from system */
-  MALLINFO_FIELD_TYPE iOrdblks;  /* number of free chunks */
-  MALLINFO_FIELD_TYPE iSmblks;   /* always 0 */
-  MALLINFO_FIELD_TYPE iHblks;    /* always 0 */
-  MALLINFO_FIELD_TYPE iHblkhd;   /* space in mmapped regions */
-  MALLINFO_FIELD_TYPE iUsmblks;  /* maximum total allocated space */
-  MALLINFO_FIELD_TYPE iFsmblks;  /* always 0 */
-  MALLINFO_FIELD_TYPE iUordblks; /* total allocated space */
-  MALLINFO_FIELD_TYPE iFordblks; /* total free space */
-  MALLINFO_FIELD_TYPE iKeepcost; /* releasable (via malloc_trim) space */
-  MALLINFO_FIELD_TYPE iCellCount;/* Number of chunks allocated*/
-};
-
-#endif /* HAVE_USR_INCLUDE_MALLOC_H */
-#endif /* NO_MALLINFO */
-
-#if MSPACES
-	typedef void* mspace;
-#endif /* MSPACES */
-
-#if 0
-
-#include <stdio.h>/* for printing in malloc_stats */
-
-#ifndef LACKS_ERRNO_H
-	#include <errno.h>       /* for MALLOC_FAILURE_ACTION */
-#endif /* LACKS_ERRNO_H */
-
-#if FOOTERS
-	#include <time.h>        /* for iMagic initialization */
-#endif /* FOOTERS */
-
-#ifndef LACKS_STDLIB_H
-	#include <stdlib.h>      /* for abort() */
-#endif /* LACKS_STDLIB_H */
-
-#if !defined(ASSERT)
-#define ASSERT(x) __ASSERT_DEBUG(x, HEAP_PANIC(ETHeapBadCellAddress))
-#endif
-	
-#ifndef LACKS_STRING_H
-	#include <string.h>      /* for memset etc */
-#endif  /* LACKS_STRING_H */
-
-#if USE_BUILTIN_FFS
-	#ifndef LACKS_STRINGS_H
-		#include <strings.h>     /* for ffs */
-	#endif /* LACKS_STRINGS_H */
-#endif /* USE_BUILTIN_FFS */
-
-#if HAVE_MMAP
-	#ifndef LACKS_SYS_MMAN_H
-		#include <sys/mman.h>    /* for mmap */
-	#endif /* LACKS_SYS_MMAN_H */
-	#ifndef LACKS_FCNTL_H
-		#include <fcntl.h>
-	#endif /* LACKS_FCNTL_H */
-#endif /* HAVE_MMAP */
-
-#if HAVE_MORECORE
-	#ifndef LACKS_UNISTD_H
-		#include <unistd.h>     /* for sbrk */
-	extern void*     sbrk(size_t);
-	#else /* LACKS_UNISTD_H */
-		#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
-			extern void*     sbrk(ptrdiff_t);			
-			/*Amod sbrk is not defined in WIN32 need to check in symbian*/
-		#endif /* FreeBSD etc */
-	#endif /* LACKS_UNISTD_H */
-#endif /* HAVE_MORECORE */
-
-#endif
-
-/*AMOD: For MALLOC_GETPAGESIZE*/
-#if 0	// replaced with GET_PAGE_SIZE() defined in heap.cpp
-#ifndef WIN32
-	#ifndef MALLOC_GETPAGESIZE
-		#ifdef _SC_PAGESIZE         /* some SVR4 systems omit an underscore */
-			#ifndef _SC_PAGE_SIZE
-				#define _SC_PAGE_SIZE _SC_PAGESIZE
-			#endif
-		#endif
-		#ifdef _SC_PAGE_SIZE
-			#define MALLOC_GETPAGESIZE sysconf(_SC_PAGE_SIZE)
-		#else
-			#if defined(BSD) || defined(DGUX) || defined(HAVE_GETPAGESIZE)
-				extern size_t getpagesize();
-				#define MALLOC_GETPAGESIZE getpagesize()
-			#else
-				#ifdef WIN32 /* use supplied emulation of getpagesize */
-					#define MALLOC_GETPAGESIZE getpagesize()
-				#else
-					#ifndef LACKS_SYS_PARAM_H
-						#include <sys/param.h>
-					#endif
-					#ifdef EXEC_PAGESIZE
-						#define MALLOC_GETPAGESIZE EXEC_PAGESIZE
-					#else
-						#ifdef NBPG
-							#ifndef CLSIZE
-								#define MALLOC_GETPAGESIZE NBPG
-							#else
-								#define MALLOC_GETPAGESIZE (NBPG * CLSIZE)
-							#endif
-						#else
-							#ifdef NBPC
-								#define MALLOC_GETPAGESIZE NBPC
-							#else
-								#ifdef PAGESIZE
-									#define MALLOC_GETPAGESIZE PAGESIZE
-								#else /* just guess */
-									#define MALLOC_GETPAGESIZE ((size_t)4096U)
-								#endif
-							#endif
-						#endif
-					#endif
-				#endif
-			#endif
-		#endif
-	#endif
-#endif
-#endif
-/*AMOD: For MALLOC_GETPAGESIZE*/
-
-/* ------------------- size_t and alignment properties -------------------- */
-
-/* The byte and bit size of a size_t */
-#define SIZE_T_SIZE         (sizeof(size_t))
-#define SIZE_T_BITSIZE      (sizeof(size_t) << 3)
-
-/* Some constants coerced to size_t */
-/* Annoying but necessary to avoid errors on some plaftorms */
-#define SIZE_T_ZERO         ((size_t)0)
-#define SIZE_T_ONE          ((size_t)1)
-#define SIZE_T_TWO          ((size_t)2)
-#define TWO_SIZE_T_SIZES    (SIZE_T_SIZE<<1)
-#define FOUR_SIZE_T_SIZES   (SIZE_T_SIZE<<2)
-#define SIX_SIZE_T_SIZES    (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES)
-#define HALF_MAX_SIZE_T     (MAX_SIZE_T / 2U)
-
-/* The bit mask value corresponding to MALLOC_ALIGNMENT */
-#define CHUNK_ALIGN_MASK    (MALLOC_ALIGNMENT - SIZE_T_ONE)
-
-/* True if address a has acceptable alignment */
-//#define IS_ALIGNED(A)       (((size_t)((A)) & (CHUNK_ALIGN_MASK)) == 0)
-#define IS_ALIGNED(A)       (((unsigned int)((A)) & (CHUNK_ALIGN_MASK)) == 0)
-
-/* the number of bytes to offset an address to align it */
-#define ALIGN_OFFSET(A)\
-	((((size_t)(A) & CHUNK_ALIGN_MASK) == 0)? 0 :\
-	((MALLOC_ALIGNMENT - ((size_t)(A) & CHUNK_ALIGN_MASK)) & CHUNK_ALIGN_MASK))
-				
-/* -------------------------- MMAP preliminaries ------------------------- */
-
-/*
-   If HAVE_MORECORE or HAVE_MMAP are false, we just define calls and
-   checks to fail so compiler optimizer can delete code rather than
-   using so many "#if"s.
-*/
-
-
-/* MORECORE and MMAP must return MFAIL on failure */
-#define MFAIL                ((void*)(MAX_SIZE_T))
-#define CMFAIL               ((TUint8*)(MFAIL)) /* defined for convenience */
-
-#if !HAVE_MMAP
-	#define IS_MMAPPED_BIT       (SIZE_T_ZERO)
-	#define USE_MMAP_BIT         (SIZE_T_ZERO)
-	#define CALL_MMAP(s)         MFAIL
-	#define CALL_MUNMAP(a, s)    (-1)
-	#define DIRECT_MMAP(s)       MFAIL
-#else /* !HAVE_MMAP */
-	#define IS_MMAPPED_BIT       (SIZE_T_ONE)
-	#define USE_MMAP_BIT         (SIZE_T_ONE)
-		#ifndef WIN32
-			#define CALL_MUNMAP(a, s)    DLUMMAP((a),(s)) /*munmap((a), (s))*/
-			#define MMAP_PROT            (PROT_READ|PROT_WRITE)
-			#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
-				#define MAP_ANONYMOUS        MAP_ANON
-			#endif /* MAP_ANON */
-			#ifdef MAP_ANONYMOUS       
-				#define MMAP_FLAGS           (MAP_PRIVATE|MAP_ANONYMOUS)
-				#define CALL_MMAP(s)         mmap(0, (s), MMAP_PROT, (int)MMAP_FLAGS, -1, 0)
-			#else /* MAP_ANONYMOUS */
-				/*
-				   Nearly all versions of mmap support MAP_ANONYMOUS, so the following
-				   is unlikely to be needed, but is supplied just in case.
-				*/
-				#define MMAP_FLAGS           (MAP_PRIVATE)
-				//static int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */
-				#define CALL_MMAP(s) DLMMAP(s)
-				/*#define CALL_MMAP(s) ((dev_zero_fd < 0) ? \
-			           (dev_zero_fd = open("/dev/zero", O_RDWR), \
-			            mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0)) : \
-			            mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0))
-			            */
-				#define CALL_REMAP(a, s, d)    DLREMAP((a),(s),(d))
-			#endif /* MAP_ANONYMOUS */
-			#define DIRECT_MMAP(s)       CALL_MMAP(s)
-		#else /* WIN32 */
-			#define CALL_MMAP(s)         win32mmap(s)
-			#define CALL_MUNMAP(a, s)    win32munmap((a), (s))
-			#define DIRECT_MMAP(s)       win32direct_mmap(s)
-		#endif /* WIN32 */
-#endif /* HAVE_MMAP */
-
-#if HAVE_MMAP && HAVE_MREMAP
-	#define CALL_MREMAP(addr, osz, nsz, mv) mremap((addr), (osz), (nsz), (mv))
-#else  /* HAVE_MMAP && HAVE_MREMAP */
-	#define CALL_MREMAP(addr, osz, nsz, mv) MFAIL
-#endif /* HAVE_MMAP && HAVE_MREMAP */
-
-#if HAVE_MORECORE
-	#define CALL_MORECORE(S)     SetBrk(S)
-#else  /* HAVE_MORECORE */
-	#define CALL_MORECORE(S)     MFAIL
-#endif /* HAVE_MORECORE */
-
-/* mstate bit set if continguous morecore disabled or failed */
-#define USE_NONCONTIGUOUS_BIT (4U)
-
-/* segment bit set in create_mspace_with_base */
-#define EXTERN_BIT            (8U)
-
-
-#if USE_LOCKS
-/*
-  When locks are defined, there are up to two global locks:
-  * If HAVE_MORECORE, iMorecoreMutex protects sequences of calls to
-    MORECORE.  In many cases sys_alloc requires two calls, that should
-    not be interleaved with calls by other threads.  This does not
-    protect against direct calls to MORECORE by other threads not
-    using this lock, so there is still code to cope the best we can on
-    interference.
-  * iMagicInitMutex ensures that mparams.iMagic and other
-    unique mparams values are initialized only once.
-*/
-	#ifndef WIN32
-		/* By default use posix locks */
-		#include <pthread.h>
-		#define MLOCK_T pthread_mutex_t
-		#define INITIAL_LOCK(l)      pthread_mutex_init(l, NULL)
-		#define ACQUIRE_LOCK(l)      pthread_mutex_lock(l)
-		#define RELEASE_LOCK(l)      pthread_mutex_unlock(l)
-		
-		#if HAVE_MORECORE
-			//static MLOCK_T iMorecoreMutex = PTHREAD_MUTEX_INITIALIZER;
-		#endif /* HAVE_MORECORE */
-			//static MLOCK_T iMagicInitMutex = PTHREAD_MUTEX_INITIALIZER;
-	#else /* WIN32 */
-		#define MLOCK_T long
-		#define INITIAL_LOCK(l)      *(l)=0
-		#define ACQUIRE_LOCK(l)      win32_acquire_lock(l)
-		#define RELEASE_LOCK(l)      win32_release_lock(l)
-		#if HAVE_MORECORE
-			static MLOCK_T iMorecoreMutex;
-		#endif /* HAVE_MORECORE */
-		static MLOCK_T iMagicInitMutex;
-	#endif /* WIN32 */
-	#define USE_LOCK_BIT               (2U)
-#else  /* USE_LOCKS */
-	#define USE_LOCK_BIT               (0U)
-	#define INITIAL_LOCK(l)
-#endif /* USE_LOCKS */
-
-#if USE_LOCKS && HAVE_MORECORE
-	#define ACQUIRE_MORECORE_LOCK(M)    ACQUIRE_LOCK((M->iMorecoreMutex)/*&iMorecoreMutex*/);
-	#define RELEASE_MORECORE_LOCK(M)    RELEASE_LOCK((M->iMorecoreMutex)/*&iMorecoreMutex*/);
-#else /* USE_LOCKS && HAVE_MORECORE */
-	#define ACQUIRE_MORECORE_LOCK(M)
-	#define RELEASE_MORECORE_LOCK(M)
-#endif /* USE_LOCKS && HAVE_MORECORE */
-
-#if USE_LOCKS
-		/*Currently not suporting this*/				
-	#define ACQUIRE_MAGIC_INIT_LOCK(M)  ACQUIRE_LOCK(((M)->iMagicInitMutex));
-	//AMOD: changed #define ACQUIRE_MAGIC_INIT_LOCK()
-	//#define RELEASE_MAGIC_INIT_LOCK()
-	#define RELEASE_MAGIC_INIT_LOCK(M)  RELEASE_LOCK(((M)->iMagicInitMutex));
-#else  /* USE_LOCKS */
-	#define ACQUIRE_MAGIC_INIT_LOCK(M)
-	#define RELEASE_MAGIC_INIT_LOCK(M)
-#endif /* USE_LOCKS */
-
-/*CHUNK representation*/
-struct malloc_chunk {
-  size_t               iPrevFoot;  /* Size of previous chunk (if free).  */
-  size_t               iHead;       /* Size and inuse bits. */
-  struct malloc_chunk* iFd;         /* double links -- used only if free. */
-  struct malloc_chunk* iBk;
-};
-
-typedef struct malloc_chunk  mchunk;
-typedef struct malloc_chunk* mchunkptr;
-typedef struct malloc_chunk* sbinptr;  /* The type of bins of chunks */
-typedef unsigned int bindex_t;         /* Described below */
-typedef unsigned int binmap_t;         /* Described below */
-typedef unsigned int flag_t;           /* The type of various bit flag sets */
-
-
-/* ------------------- Chunks sizes and alignments ----------------------- */
-#define MCHUNK_SIZE         (sizeof(mchunk))
-
-//#if FOOTERS
-//	#define CHUNK_OVERHEAD      (TWO_SIZE_T_SIZES)
-//#else /* FOOTERS */
-//	#define CHUNK_OVERHEAD      (SIZE_T_SIZE)
-//#endif /* FOOTERS */
-
-/* MMapped chunks need a second word of overhead ... */
-#define MMAP_CHUNK_OVERHEAD (TWO_SIZE_T_SIZES)
-/* ... and additional padding for fake next-chunk at foot */
-#define MMAP_FOOT_PAD       (FOUR_SIZE_T_SIZES)
-
-/* The smallest size we can malloc is an aligned minimal chunk */
-#define MIN_CHUNK_SIZE ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK)
-
-/* conversion from malloc headers to user pointers, and back */
-#define CHUNK2MEM(p)        ((void*)((TUint8*)(p)       + TWO_SIZE_T_SIZES))
-#define MEM2CHUNK(mem)      ((mchunkptr)((TUint8*)(mem) - TWO_SIZE_T_SIZES))
-/* chunk associated with aligned address A */
-#define ALIGN_AS_CHUNK(A)   (mchunkptr)((A) + ALIGN_OFFSET(CHUNK2MEM(A)))
-
-/* Bounds on request (not chunk) sizes. */
-#define MAX_REQUEST         ((-MIN_CHUNK_SIZE) << 2)
-#define MIN_REQUEST         (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE)
-
-/* pad request bytes into a usable size */
-#define PAD_REQUEST(req) (((req) + CHUNK_OVERHEAD + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK)
-
-/* pad request, checking for minimum (but not maximum) */
-#define REQUEST2SIZE(req) (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : PAD_REQUEST(req))
-
-/* ------------------ Operations on iHead and foot fields ----------------- */
-
-/*
-  The iHead field of a chunk is or'ed with PINUSE_BIT when previous
-  adjacent chunk in use, and or'ed with CINUSE_BIT if this chunk is in
-  use. If the chunk was obtained with mmap, the iPrevFoot field has
-  IS_MMAPPED_BIT set, otherwise holding the offset of the base of the
-  mmapped region to the base of the chunk.
-*/
-#define PINUSE_BIT          (SIZE_T_ONE)
-#define CINUSE_BIT          (SIZE_T_TWO)
-#define INUSE_BITS          (PINUSE_BIT|CINUSE_BIT)
-
-/* Head value for fenceposts */
-#define FENCEPOST_HEAD      (INUSE_BITS|SIZE_T_SIZE)
-
-/* extraction of fields from iHead words */
-#define CINUSE(p)           ((p)->iHead & CINUSE_BIT)
-#define PINUSE(p)           ((p)->iHead & PINUSE_BIT)
-#define CHUNKSIZE(p)        ((p)->iHead & ~(INUSE_BITS))
-
-#define CLEAR_PINUSE(p)     ((p)->iHead &= ~PINUSE_BIT)
-#define CLEAR_CINUSE(p)     ((p)->iHead &= ~CINUSE_BIT)
-
-/* Treat space at ptr +/- offset as a chunk */
-#define CHUNK_PLUS_OFFSET(p, s)  ((mchunkptr)(((TUint8*)(p)) + (s)))
-#define CHUNK_MINUS_OFFSET(p, s) ((mchunkptr)(((TUint8*)(p)) - (s)))
-
-/* Ptr to next or previous physical malloc_chunk. */
-#define NEXT_CHUNK(p) ((mchunkptr)( ((TUint8*)(p)) + ((p)->iHead & ~INUSE_BITS)))
-#define PREV_CHUNK(p) ((mchunkptr)( ((TUint8*)(p)) - ((p)->iPrevFoot) ))
-
-/* extract next chunk's PINUSE bit */
-#define NEXT_PINUSE(p)  ((NEXT_CHUNK(p)->iHead) & PINUSE_BIT)
-
-/* Get/set size at footer */
-#define GET_FOOT(p, s)  (((mchunkptr)((TUint8*)(p) + (s)))->iPrevFoot)
-#define SET_FOOT(p, s)  (((mchunkptr)((TUint8*)(p) + (s)))->iPrevFoot = (s))
-
-/* Set size, PINUSE bit, and foot */
-#define SET_SIZE_AND_PINUSE_OF_FREE_CHUNK(p, s) ((p)->iHead = (s|PINUSE_BIT), SET_FOOT(p, s))
-
-/* Set size, PINUSE bit, foot, and clear next PINUSE */
-#define SET_FREE_WITH_PINUSE(p, s, n) (CLEAR_PINUSE(n), SET_SIZE_AND_PINUSE_OF_FREE_CHUNK(p, s))
-
-#define IS_MMAPPED(p) (!((p)->iHead & PINUSE_BIT) && ((p)->iPrevFoot & IS_MMAPPED_BIT))
-
-/* Get the internal overhead associated with chunk p */
-#define OVERHEAD_FOR(p) (IS_MMAPPED(p)? MMAP_CHUNK_OVERHEAD : CHUNK_OVERHEAD)
-
-/* Return true if malloced space is not necessarily cleared */
-#if MMAP_CLEARS
-	#define CALLOC_MUST_CLEAR(p) (!IS_MMAPPED(p))
-#else /* MMAP_CLEARS */
-	#define CALLOC_MUST_CLEAR(p) (1)
-#endif /* MMAP_CLEARS */
-
-/* ---------------------- Overlaid data structures ----------------------- */
-struct malloc_tree_chunk {
-  /* The first four fields must be compatible with malloc_chunk */
-  size_t                    				iPrevFoot;
-  size_t                    				iHead;
-  struct malloc_tree_chunk*	iFd;
-  struct malloc_tree_chunk*	iBk;
-
-  struct malloc_tree_chunk* iChild[2];
-  struct malloc_tree_chunk* iParent;
-  bindex_t                  iIndex;
-};
-
-typedef struct malloc_tree_chunk  tchunk;
-typedef struct malloc_tree_chunk* tchunkptr;
-typedef struct malloc_tree_chunk* tbinptr; /* The type of bins of trees */
-
-/* A little helper macro for trees */
-#define LEFTMOST_CHILD(t) ((t)->iChild[0] != 0? (t)->iChild[0] : (t)->iChild[1])
-/*Segment structur*/
-//struct malloc_segment {
-//  TUint8*        iBase;             /* base address */
-//  size_t       iSize;             /* allocated size */
-//};
-
-#define IS_MMAPPED_SEGMENT(S)  ((S)->iSflags & IS_MMAPPED_BIT)
-#define IS_EXTERN_SEGMENT(S)   ((S)->iSflags & EXTERN_BIT)
-
-typedef struct malloc_segment  msegment;
-typedef struct malloc_segment* msegmentptr;
-
-/*Malloc State data structur*/
-
-//#define NSMALLBINS        (32U)
-//#define NTREEBINS         (32U)
-#define SMALLBIN_SHIFT    (3U)
-#define SMALLBIN_WIDTH    (SIZE_T_ONE << SMALLBIN_SHIFT)
-#define TREEBIN_SHIFT     (8U)
-#define MIN_LARGE_SIZE    (SIZE_T_ONE << TREEBIN_SHIFT)
-#define MAX_SMALL_SIZE    (MIN_LARGE_SIZE - SIZE_T_ONE)
-#define MAX_SMALL_REQUEST (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD)
-
-/*struct malloc_state {
-	binmap_t	 iSmallMap;
-	binmap_t	 iTreeMap;
-	size_t		 iDvSize;
-	size_t		 iTopSize;
-	mchunkptr	iDv;
-	mchunkptr	iTop;
-	size_t		 iTrimCheck;
-	mchunkptr	iSmallBins[(NSMALLBINS+1)*2];
-	tbinptr		iTreeBins[NTREEBINS];
-	msegment	iSeg;
-	};*/
-/*
-struct malloc_state {
-  binmap_t   iSmallMap;
-  binmap_t   iTreeMap;
-  size_t     iDvSize;
-  size_t     iTopSize;
-  TUint8*      iLeastAddr;
-  mchunkptr  iDv;
-  mchunkptr  iTop;
-  size_t     iTrimCheck;
-  size_t     iMagic;
-  mchunkptr  iSmallBins[(NSMALLBINS+1)*2];
-  tbinptr    iTreeBins[NTREEBINS];
-  size_t     iFootprint;
-  size_t     iMaxFootprint;
-  flag_t     iMflags;
-#if USE_LOCKS
-  MLOCK_T    iMutex;
-  MLOCK_T	iMagicInitMutex;  
-  MLOCK_T	iMorecoreMutex;
-#endif 
-  msegment   iSeg;
-};
-*/
-typedef struct malloc_state*    mstate;
-
-/* ------------- Global malloc_state and malloc_params ------------------- */
-
-/*
-  malloc_params holds global properties, including those that can be
-  dynamically set using mallopt. There is a single instance, mparams,
-  initialized in init_mparams.
-*/
-
-struct malloc_params {
-  size_t iMagic;
-  size_t iPageSize;
-  size_t iGranularity;
-  size_t iMmapThreshold;
-  size_t iTrimThreshold;
-  flag_t iDefaultMflags;
-#if USE_LOCKS
-  MLOCK_T	iMagicInitMutex;  
-#endif /* USE_LOCKS */
-};
-
-/* The global malloc_state used for all non-"mspace" calls */
-/*AMOD: Need to check this as this will be the member of the class*/
-
-//static struct malloc_state _gm_;
-//#define GM                 (&_gm_)
- 
-//#define IS_GLOBAL(M)       ((M) == &_gm_)
-/*AMOD: has changed*/
-#define IS_GLOBAL(M)       ((M) == GM)
-#define IS_INITIALIZED(M)  ((M)->iTop != 0)
-
-/* -------------------------- system alloc setup ------------------------- */
-
-/* Operations on iMflags */
-
-#define USE_LOCK(M)           ((M)->iMflags &   USE_LOCK_BIT)
-#define ENABLE_LOCK(M)        ((M)->iMflags |=  USE_LOCK_BIT)
-#define DISABLE_LOCK(M)       ((M)->iMflags &= ~USE_LOCK_BIT)
-
-#define USE_MMAP(M)           ((M)->iMflags &   USE_MMAP_BIT)
-#define ENABLE_MMAP(M)        ((M)->iMflags |=  USE_MMAP_BIT)
-#define DISABLE_MMAP(M)       ((M)->iMflags &= ~USE_MMAP_BIT)
-
-#define USE_NONCONTIGUOUS(M)  ((M)->iMflags &   USE_NONCONTIGUOUS_BIT)
-#define DISABLE_CONTIGUOUS(M) ((M)->iMflags |=  USE_NONCONTIGUOUS_BIT)
-
-#define SET_LOCK(M,L) ((M)->iMflags = (L)? ((M)->iMflags | USE_LOCK_BIT) :  ((M)->iMflags & ~USE_LOCK_BIT))
-
-/* page-align a size */
-#define PAGE_ALIGN(S) (((S) + (mparams.iPageSize)) & ~(mparams.iPageSize - SIZE_T_ONE))
-
-/* iGranularity-align a size */
-#define GRANULARITY_ALIGN(S)  (((S) + (mparams.iGranularity)) & ~(mparams.iGranularity - SIZE_T_ONE))
-
-#define IS_PAGE_ALIGNED(S)   (((size_t)(S) & (mparams.iPageSize - SIZE_T_ONE)) == 0)
-#define IS_GRANULARITY_ALIGNED(S)   (((size_t)(S) & (mparams.iGranularity - SIZE_T_ONE)) == 0)
-
-/*  True if segment S holds address A */
-#define SEGMENT_HOLDS(S, A)  ((TUint8*)(A) >= S->iBase && (TUint8*)(A) < S->iBase + S->iSize)
-
-#ifndef MORECORE_CANNOT_TRIM
-	#define SHOULD_TRIM(M,s)  ((s) > (M)->iTrimCheck)
-#else  /* MORECORE_CANNOT_TRIM */
-	#define SHOULD_TRIM(M,s)  (0)
-#endif /* MORECORE_CANNOT_TRIM */
-
-/*
-  TOP_FOOT_SIZE is padding at the end of a segment, including space
-  that may be needed to place segment records and fenceposts when new
-  noncontiguous segments are added.
-*/
-#define TOP_FOOT_SIZE  (ALIGN_OFFSET(CHUNK2MEM(0))+PAD_REQUEST(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE)
-
-#define SYS_ALLOC_PADDING (TOP_FOOT_SIZE + MALLOC_ALIGNMENT)
-/* -------------------------------  Hooks -------------------------------- */
-
-/*
-  PREACTION should be defined to return 0 on success, and nonzero on
-  failure. If you are not using locking, you can redefine these to do
-  anything you like.
-*/
-
-#if USE_LOCKS
-	/* Ensure locks are initialized */
-	#define GLOBALLY_INITIALIZE() (mparams.iPageSize == 0 && init_mparams())
-	#define PREACTION(M) (USE_LOCK((M))?(ACQUIRE_LOCK((M)->iMutex),0):0) /*Action to take like lock before alloc*/
-	#define POSTACTION(M) { if (USE_LOCK(M)) RELEASE_LOCK((M)->iMutex); }
-
-#else /* USE_LOCKS */
-	#ifndef PREACTION
-		#define PREACTION(M) (0)
-	#endif  /* PREACTION */
-	#ifndef POSTACTION
-		#define POSTACTION(M)
-	#endif  /* POSTACTION */
-#endif /* USE_LOCKS */
-
-/*
-  CORRUPTION_ERROR_ACTION is triggered upon detected bad addresses.
-  USAGE_ERROR_ACTION is triggered on detected bad frees and
-  reallocs. The argument p is an address that might have triggered the
-  fault. It is ignored by the two predefined actions, but might be
-  useful in custom actions that try to help diagnose errors.
-*/
-
-#if PROCEED_ON_ERROR
-	/* A count of the number of corruption errors causing resets */
-	int malloc_corruption_error_count;
-	/* default corruption action */
-	static void ResetOnError(mstate m);
-	#define CORRUPTION_ERROR_ACTION(m)  ResetOnError(m)
-	#define USAGE_ERROR_ACTION(m, p)
-#else /* PROCEED_ON_ERROR */
-	#ifndef CORRUPTION_ERROR_ACTION
-		#define CORRUPTION_ERROR_ACTION(m) ABORT
-	#endif /* CORRUPTION_ERROR_ACTION */
-	#ifndef USAGE_ERROR_ACTION
-		#define USAGE_ERROR_ACTION(m,p) ABORT
-	#endif /* USAGE_ERROR_ACTION */
-#endif /* PROCEED_ON_ERROR */
-
-
-#ifdef _DEBUG
-	#define CHECK_FREE_CHUNK(M,P)       DoCheckFreeChunk(M,P)
-	#define CHECK_INUSE_CHUNK(M,P)      DoCheckInuseChunk(M,P)
-	#define CHECK_TOP_CHUNK(M,P)        DoCheckTopChunk(M,P)
-	#define CHECK_MALLOCED_CHUNK(M,P,N) DoCheckMallocedChunk(M,P,N)
-	#define CHECK_MMAPPED_CHUNK(M,P)    DoCheckMmappedChunk(M,P)
-	#define CHECK_MALLOC_STATE(M)       DoCheckMallocState(M)
-#else /* DEBUG */
-	#define CHECK_FREE_CHUNK(M,P)
-	#define CHECK_INUSE_CHUNK(M,P)
-	#define CHECK_MALLOCED_CHUNK(M,P,N)
-	#define CHECK_MMAPPED_CHUNK(M,P)
-	#define CHECK_MALLOC_STATE(M)
-	#define CHECK_TOP_CHUNK(M,P)
-#endif /* DEBUG */
-
-/* ---------------------------- Indexing Bins ---------------------------- */
-
-#define IS_SMALL(s)         (((s) >> SMALLBIN_SHIFT) < NSMALLBINS)
-#define SMALL_INDEX(s)      ((s)  >> SMALLBIN_SHIFT)
-#define SMALL_INDEX2SIZE(i) ((i)  << SMALLBIN_SHIFT)
-#define MIN_SMALL_INDEX     (SMALL_INDEX(MIN_CHUNK_SIZE))
-
-/* addressing by index. See above about smallbin repositioning */
-#define SMALLBIN_AT(M, i)   ((sbinptr)((TUint8*)&((M)->iSmallBins[(i)<<1])))
-#define TREEBIN_AT(M,i)     (&((M)->iTreeBins[i]))
-
-
-/* Bit representing maximum resolved size in a treebin at i */
-#define BIT_FOR_TREE_INDEX(i) (i == NTREEBINS-1)? (SIZE_T_BITSIZE-1) : (((i) >> 1) + TREEBIN_SHIFT - 2)
-
-/* Shift placing maximum resolved bit in a treebin at i as sign bit */
-#define LEFTSHIFT_FOR_TREE_INDEX(i) ((i == NTREEBINS-1)? 0 : ((SIZE_T_BITSIZE-SIZE_T_ONE) - (((i) >> 1) + TREEBIN_SHIFT - 2)))
-
-/* The size of the smallest chunk held in bin with index i */
-#define MINSIZE_FOR_TREE_INDEX(i) ((SIZE_T_ONE << (((i) >> 1) + TREEBIN_SHIFT)) |  (((size_t)((i) & SIZE_T_ONE)) << (((i) >> 1) + TREEBIN_SHIFT - 1)))
-
-
-/* ------------------------ Operations on bin maps ----------------------- */
-/* bit corresponding to given index */
-#define IDX2BIT(i)              ((binmap_t)(1) << (i))
-/* Mark/Clear bits with given index */
-#define MARK_SMALLMAP(M,i)      ((M)->iSmallMap |=  IDX2BIT(i))
-#define CLEAR_SMALLMAP(M,i)     ((M)->iSmallMap &= ~IDX2BIT(i))
-#define SMALLMAP_IS_MARKED(M,i) ((M)->iSmallMap &   IDX2BIT(i))
-#define MARK_TREEMAP(M,i)       ((M)->iTreeMap  |=  IDX2BIT(i))
-#define CLEAR_TREEMAP(M,i)      ((M)->iTreeMap  &= ~IDX2BIT(i))
-#define TREEMAP_IS_MARKED(M,i)  ((M)->iTreeMap  &   IDX2BIT(i))
-
-	/* isolate the least set bit of a bitmap */
-#define LEAST_BIT(x)         ((x) & -(x))
-
-/* mask with all bits to left of least bit of x on */
-#define LEFT_BITS(x)         ((x<<1) | -(x<<1))
-
-/* mask with all bits to left of or equal to least bit of x on */
-#define SAME_OR_LEFT_BITS(x) ((x) | -(x))
-
-#if !INSECURE
-	/* Check if address a is at least as high as any from MORECORE or MMAP */
-	#define OK_ADDRESS(M, a) ((TUint8*)(a) >= (M)->iLeastAddr)
-	/* Check if address of next chunk n is higher than base chunk p */
-	#define OK_NEXT(p, n)    ((TUint8*)(p) < (TUint8*)(n))
-	/* Check if p has its CINUSE bit on */
-	#define OK_CINUSE(p)     CINUSE(p)
-	/* Check if p has its PINUSE bit on */
-	#define OK_PINUSE(p)     PINUSE(p)
-#else /* !INSECURE */
-	#define OK_ADDRESS(M, a) (1)
-	#define OK_NEXT(b, n)    (1)
-	#define OK_CINUSE(p)     (1)
-	#define OK_PINUSE(p)     (1)
-#endif /* !INSECURE */
-
-#if (FOOTERS && !INSECURE)
-	/* Check if (alleged) mstate m has expected iMagic field */
-	#define OK_MAGIC(M)      ((M)->iMagic == mparams.iMagic)
-#else  /* (FOOTERS && !INSECURE) */
-	#define OK_MAGIC(M)      (1)
-#endif /* (FOOTERS && !INSECURE) */
-
-/* In gcc, use __builtin_expect to minimize impact of checks */
-#if !INSECURE
-	#if defined(__GNUC__) && __GNUC__ >= 3
-		#define RTCHECK(e)  __builtin_expect(e, 1)
-	#else /* GNUC */
-		#define RTCHECK(e)  (e)
-	#endif /* GNUC */
-
-#else /* !INSECURE */
-	#define RTCHECK(e)  (1)
-#endif /* !INSECURE */
-/* macros to set up inuse chunks with or without footers */
-#if !FOOTERS
-	#define MARK_INUSE_FOOT(M,p,s)
-	/* Set CINUSE bit and PINUSE bit of next chunk */
-	#define SET_INUSE(M,p,s)  ((p)->iHead = (((p)->iHead & PINUSE_BIT)|s|CINUSE_BIT),((mchunkptr)(((TUint8*)(p)) + (s)))->iHead |= PINUSE_BIT)
-	/* Set CINUSE and PINUSE of this chunk and PINUSE of next chunk */
-	#define SET_INUSE_AND_PINUSE(M,p,s) ((p)->iHead = (s|PINUSE_BIT|CINUSE_BIT),((mchunkptr)(((TUint8*)(p)) + (s)))->iHead |= PINUSE_BIT)
-	/* Set size, CINUSE and PINUSE bit of this chunk */
-	#define SET_SIZE_AND_PINUSE_OF_INUSE_CHUNK(M, p, s) ((p)->iHead = (s|PINUSE_BIT|CINUSE_BIT))
-#else /* FOOTERS */
-	/* Set foot of inuse chunk to be xor of mstate and seed */
-	#define MARK_INUSE_FOOT(M,p,s) (((mchunkptr)((TUint8*)(p) + (s)))->iPrevFoot = ((size_t)(M) ^ mparams.iMagic))
-	#define GET_MSTATE_FOR(p) ((mstate)(((mchunkptr)((TUint8*)(p)+(CHUNKSIZE(p))))->iPrevFoot ^ mparams.iMagic))
-	#define SET_INUSE(M,p,s)\
-		((p)->iHead = (((p)->iHead & PINUSE_BIT)|s|CINUSE_BIT),\
-		(((mchunkptr)(((TUint8*)(p)) + (s)))->iHead |= PINUSE_BIT), \
-		MARK_INUSE_FOOT(M,p,s))
-	#define SET_INUSE_AND_PINUSE(M,p,s)\
-	((p)->iHead = (s|PINUSE_BIT|CINUSE_BIT),\
-	(((mchunkptr)(((TUint8*)(p)) + (s)))->iHead |= PINUSE_BIT),\
-	MARK_INUSE_FOOT(M,p,s))
-	#define SET_SIZE_AND_PINUSE_OF_INUSE_CHUNK(M, p, s)\
-	((p)->iHead = (s|PINUSE_BIT|CINUSE_BIT),\
-	MARK_INUSE_FOOT(M, p, s))
-#endif /* !FOOTERS */
-
-
-#if ONLY_MSPACES
-#define INTERNAL_MALLOC(m, b) mspace_malloc(m, b)
-#define INTERNAL_FREE(m, mem) mspace_free(m,mem);
-#else /* ONLY_MSPACES */
-	#if MSPACES
-		#define INTERNAL_MALLOC(m, b) (m == GM)? dlmalloc(b) : mspace_malloc(m, b)
-		#define INTERNAL_FREE(m, mem) if (m == GM) dlfree(mem); else mspace_free(m,mem);
-	#else /* MSPACES */
-		#define INTERNAL_MALLOC(m, b) dlmalloc(b)
-		#define INTERNAL_FREE(m, mem) dlfree(mem)
-	#endif /* MSPACES */
-#endif /* ONLY_MSPACES */
-	
-	#ifndef NDEBUG
-	#define CHECKING 1
-	#endif
-//  #define HYSTERESIS 4
-    #define HYSTERESIS 1	
-	#define HYSTERESIS_BYTES (2*PAGESIZE)
-    #define HYSTERESIS_GROW (HYSTERESIS*PAGESIZE)	
-	
-	#if CHECKING
-	#define CHECK(x) x
-	#else
-	#undef ASSERT
-	#define ASSERT(x) (void)0
-	#define CHECK(x) (void)0
-	#endif
-	
-#endif/*__DLA__*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/include/drivers/camerasc.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,460 @@
+// 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:
+// e32\include\drivers\camerasc.h
+// 
+//
+
+/**
+ @file
+ @internalAll
+ @prototype
+*/
+
+#ifndef __CAMERASC_H__
+#define __CAMERASC_H__
+
+#include <d32camerasc.h>
+#include <platform.h>
+#include <kernel/kpower.h>
+#include <e32ver.h>
+
+/** The default number of buffers available to the client. */
+const TInt KDefaultNumClientBuffers=6;
+
+/** The maximum number of client capture requests which may be outstanding at any time. */
+const TInt KMaxCamScRequestsPending=8;
+
+/**
+@internalAll
+@prototype
+*/
+struct SBufSpecList
+	{
+	/** The first entry of the buffer offset list. This list holds the offset from the start of the chunk
+	for each buffer. This list is only valid if the flag KScFlagBufOffsetListInUse is set in
+	TSharedChunkBufConfigBase::iFlags. */
+	TInt iBufferOffset;
+	TInt iBufferId;
+	};
+
+/**
+@internalAll
+@prototype
+*/
+class TCameraSharedChunkBufConfig : public TSharedChunkBufConfigBase
+	{
+public:
+ 	struct SBufSpecList iSpec;
+	};
+
+// Forward declarations
+class TImageBuffer;
+class DCameraScLdd;
+class DBufferManager;
+
+/**
+The physical device driver (PDD) base class for the camera driver.
+@internalAll
+@prototype
+*/
+class DCameraScPdd : public DBase
+	{
+public:
+	/**
+    Return the DFC queue to be used by this device.
+    @param aUnit The unit number for which to get the DFC queue.
+    @return The DFC queue to use.
+    */
+	virtual TDfcQue* DfcQ(TInt aUnit)=0;
+
+	/**
+	Return the capabilities of this camera device.
+	@param aCapsBuf A packaged TCameraCapsV02 object to be filled with the capabilities of the
+		device. This descriptor is in kernel memory and can be accessed directly.
+	@see TCameraCapsV02.
+	*/
+	virtual void Caps(TDes8& aCapsBuf) const=0;
+
+	/**
+	Return data format information for a custom camera data format setting. Only required where support is
+	required for a data format that isn't supported by the LDD. Platforms which don't require support
+	for custom data settings need not implement this method.
+	@param aConfigBuf A packaged TCameraConfigV02 object containing the current camera driver configuration
+		(including an identifier for the custom setting required). This configuration object should be
+		updated by the PDD with the appropriate settings for the data format concerned. This descriptor
+		is in kernel memory and can be accessed directly.
+	@return KErrNone if successful, otherwise one of the other system wide error codes.
+	*/
+	virtual TInt SpecifyCustomConfig(TDes8& aConfigBuf);
+
+	/**
+	Return the shared chunk create information to be used by this device.
+	@param aChunkCreateInfo A chunk create info. object to be to be filled with the settings
+							required for this device.
+	*/
+	virtual void GetChunkCreateInfo(TChunkCreateInfo& aChunkCreateInfo)=0;
+
+	/**
+	Configure or reconfigure the device using the the configuration supplied.
+	@param aConfigBuf A packaged TCameraConfigV02 object which contains the new configuration settings.
+		This descriptor is in kernel memory and can be accessed directly.
+	@return KErrNone if successful, otherwise one of the other system wide error codes.
+	@see TCameraConfigV02.
+	*/
+	virtual TInt SetConfig(const TDesC8& aConfigBuf)=0;
+
+	/**
+    Start the camera - start pixel sourcing.
+    @param aCaptureMode The capture mode to start. @see TDevCamCaptureMode.
+    @param aLinAddr The linear address of the start of the first buffer to use for image capture.
+	@param aPhysAddr The physical address that corresponds to the linear address: aLinAddr.
+    @return KErrNone if successful;
+    		otherwise one of the other system wide error codes.
+    */
+	virtual TInt Start(TDevCamCaptureMode aCaptureMode,TLinAddr aLinAddr,TPhysAddr aPhysAddr)=0;
+
+	/**
+	Sets the address of the buffer into which the next image will be captured.
+    @param aLinAddr The linear address of the start of the buffer to use to capture the image frame.
+	@param aPhysAddr The physical address that corresponds to the linear address: aLinAddr.
+    @return KErrNone if the capture has been initiated successfully;
+  			KErrNotReady if the device is unable to accept the request for the moment;
+		  	otherwise one of the other system-wide error codes.
+    */
+	virtual TInt CaptureNextImage(TLinAddr aLinAddr,TPhysAddr aPhysAddr)=0;
+
+	/**
+    Stop the camera - stop pixel sourcing.
+    @return KErrNone if successful, otherwise one of the other system wide error codes.
+    */
+	virtual TInt Stop()=0;
+
+	/**
+	Power down the camera.
+	*/
+	virtual void PowerDown()=0;
+
+	/**
+	Queries the driver for the size of the structure to be passed to RDevCameraSc::Caps().
+	*/
+	virtual TInt CapsSize()=0;
+
+	/**
+	Returns the supported frame sizes that correspond to the desired capture mode and pixel format passed in.
+	@param aCaptureMode The capture mode for which to obtain the information.
+	@param aUidPixelFormat The pixel format for which to obtain the information.
+	@param aFrameSizeCapsBuf An appropriately sized buffer to be filled with the supported frame sizes.
+	@return KErrNone, if successful,
+			KErrArgument, if an invalid capture mode or pixel format is specified, or if aFrameSizeCapsBuf is too small;
+			otherwise one of the other system-wide error codes.
+	@see SDevCamFrameSize
+	*/
+	virtual TInt FrameSizeCaps(TDevCamCaptureMode aCaptureMode, TUidPixelFormat aUidPixelFormat, TDes8& aFrameSizeCapsBuf)=0;
+
+	/**
+	Sets the sensor brightness to the desired setting.
+
+	@param aValue A verified brightness setting.
+	@return KErrNone if successful, KErrNotSupported if not supported.
+	*/
+	virtual TInt SetBrightness(TUint aValue) = 0;
+
+	// SYM_BRANCH: Add support for setting of Dynamic Attributes. Contrast.
+	/**
+	Sets the sensor contrast to the desired setting.
+
+	@param aValue A verified contrast setting.
+	@return KErrNone if successful, KErrNotSupported if not supported.
+	*/
+	virtual TInt SetContrast(TUint aValue) = 0;
+
+	// SYM_BRANCH: Add support for setting of Dynamic Attributes. Colour Effect.
+	/**
+	Sets the sensor color effect to the desired setting.
+
+	@param aValue A verified color effect setting.
+	@return KErrNone if successful, KErrNotSupported if not supported.
+	*/
+	virtual TInt SetColorEffect(TUint aValue) = 0;
+
+public:
+	DCameraScLdd* iLdd;
+	};
+
+/**
+The logical device (factory class) for the camera driver.
+*/
+class DCameraScLddFactory : public DLogicalDevice
+	{
+public:
+	DCameraScLddFactory();
+	virtual TInt Install();
+	virtual void GetCaps(TDes8 &aDes) const;
+	virtual TInt Create(DLogicalChannelBase*& aChannel);
+	TBool IsUnitOpen(TInt aUnit);
+	TInt SetUnitOpen(TInt aUnit,TBool aIsOpenSetting);
+private:
+	/** Mask to keep track of which units have a channel open on them. */
+	TUint iUnitsOpenMask;
+	/** A mutex to protect access to the unit info. mask. */
+	NFastMutex iUnitInfoMutex;
+	};
+
+/**
+The class representing a single image buffer.
+*/
+class TImageBuffer : public SDblQueLink
+	{
+public:
+	TImageBuffer();
+	~TImageBuffer();
+	TInt Create(DChunk* aChunk,TInt aOffset,TInt aSize,TInt aId,TBool aIsContiguous);
+	void SyncMemoryBeforeDmaRead();
+	void SyncMemoryAfterDmaRead();
+public:
+	/** The buffer id */
+	TInt iId;
+	/** The chunk used for this buffer */
+	DChunk* iChunk;
+	/** The offset, in bytes, of the start of the buffer within the chunk. */
+	TInt iChunkOffset;
+	/** The size of the buffer in bytes. */
+	TInt iSize;
+	/** The virtual address of buffer. */
+	TLinAddr iLinearAddress;
+	/** The physical address of buffer. KPhysAddrInvalid if the buffer is not physically contiguous. */
+	TPhysAddr iPhysicalAddress;
+	/** A list of physical addresses for buffer pages. 0 if the buffer is physically contiguous. */
+	TPhysAddr* iPhysicalPages;
+	/** This is the result of the transfer into this buffer. */
+	TInt iResult;
+	};
+
+/**
+An object encapsulating an image capture request from the client.
+*/
+class TCameraScRequest : public SDblQueLink
+	{
+public:
+	inline TCameraScRequest()
+		{}
+public:
+	/** The request status associated with the request - used to signal completion of the request and pass back a
+	completion code. */
+	TRequestStatus* iStatus;
+	};
+
+/**
+An object encapsulating a queue of image capture requests from the client.
+*/
+class TCameraScRequestQueue
+	{
+public:
+	TCameraScRequestQueue(NFastMutex* aMutexPtr);
+	~TCameraScRequestQueue();
+	TInt Create(DThread* anOwningThread);
+	TInt Add(TRequestStatus* aStatus);
+	TRequestStatus* Remove();
+	void Cancel(TRequestStatus* aStatus);
+	void CancelAll();
+	inline TBool IsEmpty();
+private:
+	/** The queue of pending capture requests. */
+	SDblQue iPendRequestQ;
+	/** The queue of unused capture requests. */
+	SDblQue iUnusedRequestQ;
+	/** The actual array of request objects. */
+	TCameraScRequest* iRequest[KMaxCamScRequestsPending];
+	NFastMutex* iMutexPtr;
+	DThread* iOwningThread;
+	};
+
+/**
+The buffer manager base class.
+*/
+class DBufferManager : public DBase
+	{
+public:
+	DBufferManager(DCameraScLdd* aLdd);
+	~DBufferManager();
+	TInt Create(TInt aNumBuffers,TInt aBufferSize);
+	TInt Create(TCameraSharedChunkBufConfig& aBufConfig,TInt aChunkHandle,DThread* anOwningThread);
+	void GetBufConfig(TCameraSharedChunkBufConfig& aBufConfig);
+	void Reset();
+	void Purge(TImageBuffer* aBuffer);
+	TImageBuffer* GetImageForClient(TBool aRemoveLast);
+	TImageBuffer* SetImageCaptured(TInt aResult);
+	TInt ReleaseImage(TInt aChunkOffset);
+	TImageBuffer* NextAvailableForCapture();
+	TImageBuffer* FindInUseImage(TInt aChunkOffset);
+protected:
+	TInt CreateBufferLists(TInt aNumBuffers);
+	TInt CommitMemoryForBuffer(TInt aChunkOffset,TInt aSize,TBool& aIsContiguous);
+protected:
+	/** The owning LDD object. */
+	DCameraScLdd* iLdd;
+	/** The chunk which contains the buffers. */
+	DChunk* iChunk;
+	/** The linear address in kernel process for the start of the chunk. */
+	TLinAddr iChunkBase;
+	/**< MMU mapping attributes that the chunk has actually been mapped with. */
+	TUint32 iChunkMapAttr;
+	/** The number of buffers. */
+	TInt iNumBuffers;
+	/** The actual array of buffer objects. */
+	TImageBuffer* iImageBuffer;
+	/** The buffer currently being filled by image capture. (Not in any list). */
+	TImageBuffer* iCurrentBuffer;
+	/** The next buffer to use for image capture. (Not in any list). */
+	TImageBuffer* iNextBuffer;
+	/** A queue of those buffers which are currently free. */
+	SDblQue iFreeBufferQ;
+	/** A queue of those buffers which currently contain captured images (and which aren't being used by the client). */
+	SDblQue iCompletedBufferQ;
+	/** A queue of those buffers which are currently being used by the client. */
+	SDblQue iInUseBufferQ;
+private:
+	friend class DCameraScLdd;
+	};
+
+/**
+The configuration class that is specific for each capture mode. This allows the driver to maintain different configurations,
+one for each capture mode, and make switching between capture modes faster.
+*/
+class TCaptureModeConfig
+	{
+	private:
+		/** The handle to the chunk that is returned to the user side code. */
+		TInt iChunkHandle;
+		/** The current configuration of the capture mode */
+		TCameraConfigV02 iCamConfig;
+		/** The current configuration of the chunk. */
+		TCameraSharedChunkBufConfig* iBufConfig;
+		/** The size in bytes of the chunk configuration info. structure. */
+		TInt iBufConfigSize;
+		/** The current frame height. */
+		TInt iFrameHeight;
+		/** The current frame width. */
+		TInt iFrameWidth;
+		/** The buffer manager. */
+		DBufferManager* iBufManager;
+	private:
+		friend class DCameraScLdd;
+	};
+
+/**
+The camera driver power handler class.
+*/
+class DCameraScPowerHandler : public DPowerHandler
+	{
+public:
+	DCameraScPowerHandler(DCameraScLdd* aChannel);
+	// Inherited from DPowerHandler
+	void PowerUp();
+	void PowerDown(TPowerState aPowerState);
+private:
+	DCameraScLdd* iChannel;
+	};
+
+/**
+The logical channel class for the camera driver.
+*/
+class DCameraScLdd : public DLogicalChannel
+	{
+public:
+	enum TState
+		{
+		/** Channel open - but not configured. */
+		EOpen,
+		/** Channel configured - but inactive. */
+		EConfigured,
+		/** Channel is active - capturing images. */
+		ECapturing
+		};
+public:
+	DCameraScLdd();
+	virtual ~DCameraScLdd();
+	// Inherited from DLogicalChannel
+	virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
+	virtual TInt Request(TInt aReqNo, TAny* a1, TAny* a2);
+	virtual void HandleMsg(TMessageBase* aMsg);
+	virtual TInt RequestUserHandle(DThread* aThread, TOwnerType aType);
+	inline DThread* OwningThread();
+	inline TInt CurrentFrameHeight();
+	inline TInt CurrentFrameWidth();
+	void Shutdown();
+	virtual TInt ImageCaptureCallback(TDevCamCaptureMode aCaptureMode,TInt aResult,TLinAddr* aLinAddr,TPhysAddr* aPhysAddr);
+	virtual void PanicClientThread(TInt aReason);
+private:
+	TInt DoControl(TInt aFunction, TAny* a1, TAny* a2);
+	TInt DoRequest(TInt aFunction, TRequestStatus* aStatus, TAny* a1, TAny* a2);
+	TInt DoCancel(TUint aMask);
+	TInt SetCaptureMode(TInt aCaptureMode);
+	TInt SetCamConfig(TInt aCaptureMode, const TDesC8* aCamConfigBuf);
+	TInt SetBufConfig(TInt aCaptureMode, const TDesC8* aBufferConfigBuf,TInt aChunkHandle);
+	TInt SetBufConfig(TInt aCaptureMode, TInt aNumBuffers);
+	TInt ChunkClose(TInt aCaptureMode);
+	TInt Start();
+	TInt NotifyNewImage(TRequestStatus* aStatus);
+	TInt ReleaseBuffer(TInt aChunkOffset);
+	TInt DoSetConfig(TInt aCaptureMode, const TDesC8* aCamConfigBuf);
+	TInt ValidateConfig(TInt aCaptureMode, TCameraConfigV02 &aConfig);
+	TInt DoValidateConfig(TCameraCapsV02* aCamCaps, TInt &aCaptureMode, TCameraConfigV02 &aConfig);
+	TInt DoStart();
+	TInt ReAllocBufferConfigInfo(TInt aCaptureMode, TInt aNumBuffers);
+	TInt ReAllocBufferConfigInfo(TInt aNumBuffers);
+	TInt GetSensorCaps(TAny* a1);
+	TInt GetFrameSizeCaps(TAny* a1, TAny* a2);
+	TInt GetDynamicAttribute(TInt aAttribute, TUint& aValue);
+	TInt SetDynamicAttribute(TInt aAttribute, TUint aValue);
+	inline DCameraScPdd* Pdd();
+	static void RestartDfc(TAny* aChannel);
+	static void PowerUpDfc(TAny* aPtr);
+	static void PowerDownDfc(TAny* aPtr);
+private:
+	/** An array of configurations for each capture mode. */
+	TCaptureModeConfig* iCaptureModeConfig;
+	/** The unit number of this channel. */
+	TInt iUnit;
+	/** The operating state of the channel. */
+	TState iState;
+	/** A pointer to the owning client thread. */
+	DThread* iOwningThread;
+	/** The current capture mode of the camera. */
+	TDevCamCaptureMode iCaptureMode;
+	/** The pending request queue. */
+	TCameraScRequestQueue iRequestQueue;
+	/** A mutex to protect access to the buffer lists and the pending request list. */
+	NFastMutex iMutex;
+	/** The camera driver power handler. */
+	DCameraScPowerHandler* iPowerHandler;
+	/** DFC used to re-start the PDD following a data capture error. */
+	TDfc iRestartDfc;
+	/** DFC used to handle power down requests from the power manager before a transition into system shutdown/standby. */
+	TDfc iPowerDownDfc;
+	/** DFC used to handle power up requests from the power manager following a transition out of system standby. */
+	TDfc iPowerUpDfc;
+	
+	// Used as a cache for values successfully set by SetDynamicAttribute().
+	TUint iBrightnessValue;
+	TUint iContrastValue;
+	TUint iColorEffectValue;
+	
+	friend class DCameraScPowerHandler;
+	friend class DBufferManager;
+	};
+
+#include <drivers/camerasc.inl>
+
+#endif	// __CAMERASC_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/include/drivers/camerasc.inl	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,34 @@
+// 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:
+// e32\include\drivers\camerasc.inl
+// 
+//
+
+inline DCameraScPdd* DCameraScLdd::Pdd()
+	{return((DCameraScPdd*)iPdd);}
+
+inline DThread* DCameraScLdd::OwningThread()
+	{return(iOwningThread);}
+
+inline TInt DCameraScLdd::CurrentFrameHeight()
+	{return(iCaptureModeConfig[iCaptureMode].iFrameHeight);}
+
+inline TInt DCameraScLdd::CurrentFrameWidth()
+	{return(iCaptureModeConfig[iCaptureMode].iFrameWidth);}
+
+inline TInt DCameraScPdd::SpecifyCustomConfig(TDes8& /*aConfig*/)
+	{return(KErrArgument);}
+
+inline TBool TCameraScRequestQueue::IsEmpty()
+	{return(iPendRequestQ.IsEmpty());}
--- a/kernel/eka/include/drivers/dma.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/drivers/dma.h	Wed Sep 01 12:34:56 2010 +0100
@@ -1,7 +1,7 @@
-// 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"
+// under the terms of "Eclipse Public License v1.0""
 // which accompanies this distribution, and is available
 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
 //
@@ -12,19 +12,882 @@
 //
 // Description:
 // include/drivers/dma.h
-// DMA Framework - Client API definition.
-//
+// DMA Framework API
 //
 
 #ifndef __DMA_H__
 #define __DMA_H__
 
+#include <kernel/kern_priv.h>
 
-#ifndef DMA_APIV2
-# include <drivers/dma_v1.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// Debug Support - KDmaPanicCat is defined in each source file
+
+#define __DMA_ASSERTD(e) __ASSERT_DEBUG(e, Kern::Fault(KDmaPanicCat, __LINE__))
+#define __DMA_ASSERTA(e) __ASSERT_ALWAYS(e, Kern::Fault(KDmaPanicCat, __LINE__))
+#ifdef _DEBUG
+#define __DMA_CANT_HAPPEN() Kern::Fault(KDmaPanicCat, __LINE__)
+#define __DMA_DECLARE_INVARIANT public: void Invariant();
+#define __DMA_INVARIANT() Invariant()
 #else
-# include <drivers/dma_v2.h>
-#endif	// #ifndef DMA_APIV2
+#define __DMA_CANT_HAPPEN()
+#define __DMA_DECLARE_INVARIANT
+#define __DMA_INVARIANT()
+#endif
+
+
+//////////////////////////////////////////////////////////////////////////////
+// INTERFACE EXPOSED TO DEVICE-DRIVERS
+//////////////////////////////////////////////////////////////////////////////
+
+/**
+Bitmasks used for configuring a DMA request.
+
+In general, specify KDmaMemSrc|KDmaIncSrc (resp. KDmaMemDest|KDmaIncDest) if
+the source (resp. destination) is a memory buffer and clear
+KDmaMemSrc|KDmaIncSrc (resp. KDmaMemDest|KDmaIncDest) if the source
+(resp. destination) is a peripheral.
+
+If the location is given as a physical address (rather than a linear one)
+then also specify KDmaPhysAddrSrc and/or KDmaPhysAddrDest.
+
+The EKA1 "Fill Mode" can be implemented by omitting KDmaIncSrc.
+
+Some peripherals may require a post-increment address mode.
+
+@see DDmaRequest::Fragment
+@publishedPartner
+@released
+*/
+
+enum TDmaRequestFlags
+	{
+	/** Source is address of memory buffer */
+	KDmaMemSrc       = 0x01,
+	/** Destination is address of memory buffer */
+	KDmaMemDest      = 0x02,
+	/** Source address must be post-incremented during transfer */
+	KDmaIncSrc       = 0x04,
+	/** Destination address must be post-incremented during transfer */
+	KDmaIncDest      = 0x08,
+	/** Source address is a physical address (as opposed to a linear one) */
+	KDmaPhysAddrSrc  = 0x10,
+	/** Destination address is a physical address (as opposed to a linear one) */
+	KDmaPhysAddrDest = 0x20,
+	/** Request a different max transfer size (for instance for test purposes) */
+	KDmaAltTransferLen = 0x40
+	};
+
+
+//////////////////////////////////////////////////////////////////////////////
+
+class TDmaChannel;
+struct SDmaDesHdr;
+
+/** A DMA request is a list of fragments small enough to be transferred in one go
+	by the DMAC.
+
+	In general, fragmentation is done in the framework by calling Fragment() but
+	clients with special needs can allocate a blank descriptor list with
+	ExpandDesList() and customise it to fit their needs.
+
+	Clients should not set attributes directly, but should use the various functions
+	instead.
+
+	This class has not been designed to be called from several concurrent threads.
+	Multithreaded clients must implement their own locking scheme (via DMutex).
+
+	Fast mutexes are used internally to protect data structures accessed both
+	by the client thread and the DFC thread.  Therefore no fast mutex can be held
+	when calling a request function.
+
+	@publishedPartner
+	@released
+ */
+class DDmaRequest : public DBase
+	{
+	friend class TDmaChannel;
+public:
+	/** The outcome of the transfer */
+	enum TResult {EBadResult=0, EOk, EError};
+	/** The signature of the completion/failure callback function */
+	typedef void (*TCallback)(TResult, TAny*);
+public:
+   
+    /**
+    Create a new transfer request. 
+
+    @param aChannel The channel this request is bound to.
+    @param aCb      Callback function called on transfer completion or failure (in channel
+                    DFC context).  Can be NULL.
+    @param aCbArg   Argument passed to callback function.
+    @param aMaxTransferSize Maximum fragment size.  If not specified, defaults to the maximum size
+           supported by the DMA controller for the type of transfer that is later scheduled.
+    */
+	IMPORT_C DDmaRequest(TDmaChannel& aChannel, TCallback aCb=NULL, TAny* aCbArg=NULL, TInt aMaxTransferSize=0);
+	
+	
+	/**
+    Destructor.
+
+    Assume the request is not being transferred or pending.
+    */
+	IMPORT_C ~DDmaRequest();
+	
+	
+	/**
+    Split request into a list of fragments small enough to be fed to the DMAC.
+
+    The size of each fragment is smaller than or equal to the maximum transfer size
+    supported by the DMAC.  If the source and/or destination is memory, each
+    fragment points to memory which is physically contiguous.
+
+    The kind of transfer to perform is specified via a set of flags used by a PIL
+    and a magic cookie passed to the PSL.  If the source (resp. destination) is a
+    peripheral, aSrc (resp. aDest) is treated as a magic cookie by the PIL and
+    passed straight to the PSL.
+
+    The request can be uninitialised or may have been fragmented previously.  The
+    previous configuration if any is lost whether or not the function succeeds.
+
+    @param aSrc     Source memory buffer linear address or peripheral magic cookie.
+    @param aDest    Destination memory buffer linear address or peripheral magic cookie.
+    @param aCount   Number of bytes to transfer.
+    @param aFlags   Bitmask characterising the transfer.
+    @param aPslInfo Hardware-specific information passed to PSL.
+
+    @return KErrNone if success. KErrArgument if aFlags and/or aPslInfo are invalid when finding
+    the maximum transfer size. May also fail if running out of descriptors.
+
+    @pre The request is not being transferred or pending.
+    @pre The various parameters must be valid.  The PIL or PSL will fault the
+    kernel if not.
+
+    @see TDmaRequestFlags
+    */
+	IMPORT_C TInt Fragment(TUint32 aSrc, TUint32 aDest, TInt aCount, TUint aFlags, TUint32 aPslInfo);
+	
+	
+	/**
+    Transfer asynchronously this request.
+
+    If this request's channel is idle, the request is transferred immediately.
+    Otherwise, it is queued and transferred later.
+
+    The client is responsible for ensuring cache consistency before and/or after the
+    transfer if necessary.
+    */
+	IMPORT_C void Queue();
+	
+
+    /**
+    Append new descriptor(s) to existing list.
+
+    Clients needing to build a custom descriptor list should call this function to
+    allocate the list and access the resulting list through iFirstHdr and iLastHdr.
+
+    Clients should not change the value of iFirstHdr, iLastHdr and the iNext field
+    of the descriptor headers to ensure descriptors can be deallocated. Clients
+    are free to change hardware descriptors, including chaining, in whatever way
+    suit them.
+
+    Assume the request is not being transferred or pending.
+
+    @param aCount Number of descriptors to append.
+
+    @return KErrNone or KErrTooBig if not enough descriptors available.
+    */
+	IMPORT_C TInt ExpandDesList(TInt aCount=1);
+	
+	
+	/**
+    Free resources associated with this request.
+
+    Assume the request is not being transferred or pending.
+    */
+	IMPORT_C void FreeDesList();
+private:
+	inline void OnDeque();
+public:
+	// WARNING: The following attributes are accessed both in client and DFC
+	// context and so accesses must be protected with the channel lock.
+	TDmaChannel& iChannel;		/**< The channel this request is bound to */
+	volatile TCallback iCb;		/**< Called on completion/failure (can be NULL) */
+	TAny* volatile iCbArg;		/**< Callback argument */
+	TInt iDesCount;				/**< The number of fragments in list */
+	SDmaDesHdr* iFirstHdr;		/**< The first fragment in the list (or NULL) */
+	SDmaDesHdr* iLastHdr;		/**< The last fragment in the list (or NULL) */
+	SDblQueLink iLink;			/**< The link on channel queue of pending requests */
+	TBool iQueued;				/**< Indicates whether request is pending or being transferred */
+	TInt iMaxTransferSize;		/**< Defaults to DMA controller max. transfer size */
+	__DMA_DECLARE_INVARIANT
+	};
+
+
+//////////////////////////////////////////////////////////////////////////////
+
+class TDmac;
+class DmaChannelMgr;
+
+/** DMA channel base class.
+
+	This class has not been designed to be called from several concurrent
+	client threads.  Multithreaded clients must implement their own locking
+	scheme (via DMutex).
+
+	Fast mutexes are used internally to protect data structures accessed both
+	by the client thread and the DFC one.  Therefore no fast mutex can be held
+	when calling a channel function.
+
+	Must be allocated in BSS because it relies on being zeroed at
+	creation-time.  If the PSL really needs to allocate channels on the kernel
+	heap, it must manually zero-initialises the instances.  This can be
+	achieved either by allocating raw memory and using placement new, or by
+	wrapping channels into a DBase-derived wrapper.
+
+	@publishedPartner
+	@released
+ */
+class TDmaCancelInfo;
+class TDmaChannel
+	{
+	friend class DDmaRequest;
+	friend class TDmac;
+	friend class DmaChannelMgr;
+public:
+	/**  Information passed by client when opening channel */
+	struct SCreateInfo
+		{
+		/** Identifier used by PSL to select channel to open */
+		TUint32 iCookie;
+		/** Number of descriptors this channel can use */
+		TInt iDesCount;
+		/** DFC queue used to service DMA interrupts.  The DFC thread
+			priority must be higher than any client thread priority to
+			avoid a situation where a transfer completes while being
+			cancelled and another transfer is started before the DFC
+			thread gets a chance to run.  This would lead to a stray
+			DFC.
+		*/
+		TDfcQue* iDfcQ;
+		/** DFC priority */
+		TUint8 iDfcPriority;
+		};
+public:
+    /**
+ 	Opens the DMA channel.
+
+ 	Channel selection is done by the hardware-specific layer using a cookie passed in
+ 	via aInfo.
+
+ 	The client should not delete the returned pointer as the framework owns
+ 	channel objects.  However, the client should explicitly close the channel when
+ 	finished with it.
+
+	@param aInfo    Information passed by caller to select and configure channel.
+ 	@param aChannel Point to open channel on successful return.  NULL otherwise.
+
+ 	@return KErrNone or standard error code.
+ 	*/
+	IMPORT_C static TInt Open(const SCreateInfo& aInfo, TDmaChannel*& aChannel);
+	
+	
+	/**
+ 	Closes a previously opened DMA channel.
+
+ 	Assume the channel is idle and all requests have been deleted.
+ 	*/
+	IMPORT_C void Close();
+	
+	
+	/**
+ 	Cancels the current request and all the pending ones.
+ 	*/
+	IMPORT_C void CancelAll();
+	inline TBool IsOpened() const;
+	inline TBool IsQueueEmpty() const;
+	inline TUint32 PslId() const;
+	inline TInt FailNext(TInt aFragmentCount);
+	inline TInt MissNextInterrupts(TInt aInterruptCount);
+	inline TInt Extension(TInt aCmd, TAny* aArg);
+	
+	/**
+	This is a function that allows the Platform Specific Layer (PSL) to extend the DMA API
+	with new channel-independent operations.
+
+	@param aCmd Command identifier.  Negative values are reserved for Symbian use.
+	@param aArg PSL-specific.
+	
+	@return KErrNotSupported if aCmd is not supported; a  PSL specific value otherwise.
+ 	*/
+	IMPORT_C TInt StaticExtension(TInt aCmd, TAny* aArg);
+	inline const TDmac* Controller() const;
+	inline TInt MaxTransferSize(TUint aFlags, TUint32 aPslInfo);
+	inline TUint MemAlignMask(TUint aFlags, TUint32 aPslInfo);
+protected:
+	// Interface with state machines
+	TDmaChannel();
+	virtual void DoQueue(DDmaRequest& aReq) = 0;
+	virtual void DoCancelAll() = 0;
+	virtual void DoUnlink(SDmaDesHdr& aHdr);
+	virtual void DoDfc(DDmaRequest& aCurReq, SDmaDesHdr*& aCompletedHdr) = 0;
+	/**
+	This function allows the Platform Specific Layer (PSL) to control the
+	power management of the channel or its controller by overriding the
+	PIL's default implementation (which does nothing) and making
+	appropriate use of the Power Resource Manager (PRM).
+
+	The function gets called by the PIL whenever the channel's queued
+	requests count has changed in a significant way, either before the
+	channel's Transfer() method is invoked for a request on a previously
+	empty request queue, or immediately after the request count has become
+	zero because of request cancellation or completion.
+
+	Depending on the current and previous observed values of
+	iQueuedRequests, the PSL may power down or power up the channel.
+
+	Note that iQueuedRequests gets accessed and changed by different
+	threads, so the PSL needs to take the usual precautions when evaluating
+	the variable's value. Also, due to the multithreaded framework
+	architecture, there is no guarantee that the function calls always
+	arrive at the PSL level in the strict chronological order of
+	iQueuedRequests being incremented/decremented in the PIL, i.e. it might
+	happen that the PSL finds iQueuedRequests to have the same value in two
+	or more consecutive calls (that's why the previous observed value needs
+	to be locally available and taken into account). It is however promised
+	that before any actual transfer commences the PSL will find the request
+	count to be greater than zero and that after the last request has
+	finished it will be found to be zero.
+
+	None of the internal DMA framework mutexes is being held by the PIL
+	when calling this function.
+
+	Here is an example implementation for a derived channel class:
+
+	@code
+
+		class TFooDmaChannel : public TDmaSgChannel
+			{
+			DMutex* iDmaMutex;
+			TInt iPrevQueuedRequests;
+			virtual void QueuedRequestCountChanged();
+			};
+
+		void TFooDmaChannel::QueuedRequestCountChanged()
+			{
+			Kern::MutexWait(*iDmaMutex);
+			const TInt queued_now = __e32_atomic_load_acq32(&iQueuedRequests);
+			if ((queued_now > 0) && (iPrevQueuedRequests == 0))
+				{
+				IncreasePowerCount(); // Base port specific
+				}
+			else if ((queued_now == 0) && (iPrevQueuedRequests > 0))
+				{
+				DecreasePowerCount(); // Base port specific
+				}
+			iPrevQueuedRequests = queued_now;
+			Kern::MutexSignal(*iDmaMutex);
+			}
+
+	@endcode
+
+	@see iQueuedRequests
+	*/
+	virtual void QueuedRequestCountChanged();
+#if defined(__CPU_ARM) && !defined(__EABI__)
+	inline virtual ~TDmaChannel() {}	// kill really annoying warning
+#endif
+private:
+	static void Dfc(TAny*);
+	void DoDfc();
+	inline void Wait();
+	inline void Signal();
+	inline TBool Flash();
+	void ResetStateMachine();
+protected:
+	TDmac* iController;										// DMAC this channel belongs to (NULL when closed)
+	TUint32 iPslId;											// unique identifier provided by PSL
+	NFastMutex iLock;										// for data accessed in both client & DFC context
+	SDmaDesHdr* iCurHdr;									// fragment being transferred or NULL
+	SDmaDesHdr** iNullPtr;									// Pointer to NULL pointer following last fragment
+	TDfc iDfc;												// transfer completion/failure DFC
+	TInt iMaxDesCount;										// maximum number of allocable descriptors
+	TInt iAvailDesCount;									// available number of descriptors
+	volatile TUint32 iIsrDfc;								// Interface between ISR and DFC:
+	enum { KErrorFlagMask = 0x80000000 };					// bit 31 - error flag
+	enum { KCancelFlagMask = 0x40000000 };					// bit 30 - cancel flag
+	enum { KDfcCountMask = 0x3FFFFFFF };					// bits 0-29 - number of queued DFCs
+	SDblQue iReqQ;											// being/about to be transferred request queue
+	TInt iReqCount;											// number of requests attached to this channel
+	TInt iQueuedRequests; 									// number of requests currently queued on this channel
+private:
+	TDmaCancelInfo* iCancelInfo;
+	__DMA_DECLARE_INVARIANT
+	};
+
+
+//////////////////////////////////////////////////////////////////////////////
+// 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))
 
 
-#endif	// #ifndef __DMA_H__
+#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.
+@see DDmaRequest::Fragment
+@publishedPartner
+@released
+*/
+
+struct SDmaPseudoDes
+	{
+	/** Source linear address or peripheral cookie */
+	TUint32 iSrc;
+	/** Destination linear address or peripheral cookie */
+	TUint32 iDest;
+	/** Number of bytes to transfer */
+	TInt iCount;
+	/** @see TDmaRequestFlags */
+	TUint iFlags;
+	/** PSL-specific information provided by client */
+	TUint32 iPslInfo;
+	/** The same as TDmaChannel::SCreateInfo.iCookie */
+	TUint32 iCookie;
+	};
+
+
+/**
+Each hardware or pseudo descriptor is associated with a header.  Headers are
+needed because hardware descriptors can not easily be extended to store
+additional information.
+@publishedPartner
+@released
+*/
+
+struct SDmaDesHdr
+	{
+	SDmaDesHdr* iNext;
+	};
+
+
+/**
+Interface used by PIL to open and close DMA channels.
+
+Must be implemented by PSL.
+@publishedPartner
+@released
+*/
+
+class DmaChannelMgr
+	{
+public:
+	/** Opens a channel using a client-provided identifier.
+		This function must be implemented by the PSL.
+		@param	aOpenId Magic cookie passed by client
+				This may identify the channel (if a static channel
+				allocation scheme is used) or may indicate some
+				properties which the channel must possess (if a dynamic
+				channel allocation scheme is used). It may be set to
+				zero always if dynamic allocation is used and all
+				channels are equivalent.
+		@return	Pointer to channel if available, NULL otherwise.
+		@pre	The PIL calls this function with a global fast mutex held to
+				avoid race conditions.
+		@post	If a non-NULL pointer is returned, the object pointed to has its
+				iController and iPslId members set to valid states.
+				iController should point to the controller handling that channel.
+				iPslId should contain a value uniquely identifying the channel -
+				it is used only for debug tracing by PIL. It can be given any
+				convenient value by PSL	(channel index, I/O port address, ...).
+	*/
+	static TDmaChannel* Open(TUint32 aOpenId);
+
+	/** Performs platform-specific operations when a channel is closed.
+		This function must be implemented by the PSL but the implementation can be
+		a no-op.
+		@param aChannel The channel to close
+		@pre The PIL calls this function with a global fast mutex held to
+			avoid race conditions.
+	*/
+	static void Close(TDmaChannel* aChannel);
+
+	/** Function allowing PSL to extend DMA API with new channel-independent operations.
+		This function must be implemented by the PSL.
+		@param aCmd Command identifier.  Negative values are reserved for Symbian use.
+		@param aArg PSL-specific
+		@return KErrNotSupported if aCmd is not supported.  PSL-specific value otherwise.
+	 */
+	static TInt StaticExtension(TInt aCmd, TAny* aArg);
+
+	static inline void Wait();
+	static inline void Signal();
+private:
+	static NFastMutex Lock;
+	};
+
+
+//////////////////////////////////////////////////////////////////////////////
+
+/**
+ Abstract base class representing a DMA controller.
+
+ The class has two purposes.
+
+ First, it is a container for channels, descriptors and descriptor headers.
+
+ Second, it exposes a set of virtual functions implemented by
+ the PSL (platform-specific layer).
+ These functions are the main interfaces between
+ the PIL (platform-independent layer) and PSL.
+
+ Must be allocated in BSS because it relies on being zeroed at creation-time.
+
+ @publishedPartner
+ @released
+ */
+
+class TDmac
+	{
+	friend class DmaChannelMgr;
+// protected: VC++ complains when building PSL if following decl is protected
+public:
+	/** Data required for creating a new instance */
+	struct SCreateInfo
+		{
+		/** Number of channels in controller */
+		TInt iChannelCount;
+        /** Maximum number of descriptors (shared by all channels) */
+		TInt iDesCount;
+		/** Bitmask.  The only supported value is KCapsBitHwDes (hardware
+			descriptors used). */
+		TUint32 iCaps;
+		/** Size of individual descriptors.  Use sizeof(SDmaPseudoDes) for
+		 	single-buffer and double-buffer controllers. */
+		TInt iDesSize;
+		/** Bitmask used when creating the hardware chunk storing the descriptor
+			pool. Used only for hardware descriptors. The access part must be
+			EMapAttrSupRw.  If the chunk is cached and/or buffered, the PSL must
+			flush the data cache and/or drain the write buffer in InitHwDes()
+			and related functions.
+		 	@see TMappingAttributes
+		 */
+		TUint iDesChunkAttribs;
+		};
+public:
+	TInt Create(const SCreateInfo& aInfo);
+	virtual ~TDmac();
+	TInt ReserveSetOfDes(TInt aCount);
+	void ReleaseSetOfDes(TInt aCount);
+	void InitDes(const SDmaDesHdr& aHdr, TUint32 aSrc, TUint32 aDest, TInt aCount,
+				 TUint aFlags, TUint32 aPslInfo, TUint32 aCookie);
+	inline SDmaPseudoDes& HdrToDes(const SDmaDesHdr& aHdr) const;
+	inline TAny* HdrToHwDes(const SDmaDesHdr& aHdr) const;
+	inline TUint32 DesLinToPhys(TAny* aDes) const;
+	inline void Wait();
+	inline void Signal();
+protected:
+	TDmac(const SCreateInfo& aInfo);
+
+public:
+	/**
+	Called by PIL when one fragment (single-buffer and double-buffer DMACs) or
+	list of fragments (scatter/gather DMAC) is to be transferred.
+
+	Called when	initiating a new transfer and also, for double-buffer DMACs, for
+	configuring the next fragment to transfer while the current one is
+	ongoing. Must always be implemented by PSL.
+	@param aChannel The channel to use
+	@param aHdr Header associated with fragment to transfer
+	*/
+	virtual void Transfer(const TDmaChannel& aChannel, const SDmaDesHdr& aHdr) = 0;
+
+	/**
+    Called by PIL to suspend transfer on a given channel.
+
+    The suspension must occur synchronously as the PSL assumes the channel
+    is suspended after calling this function. Must always be implemented by PSL.
+	@param aChannel The channel to suspend
+	*/
+	virtual void StopTransfer(const TDmaChannel& aChannel) = 0;
+
+	/**
+	Called by PIL to check whether a DMA channel is idle.
+	@param aChannel The channel to test
+	@return ETrue if channel idle, EFalse if transferring.
+	 */
+	virtual TBool IsIdle(const TDmaChannel& aChannel) = 0;
+
+	/**
+	Called by PIL to retrieve from the PSL the maximum transfer size based on the
+	parameters passed.
+	@param aChannel Channel to be used for the transfer
+	@param aFlags Bitmask characterising transfer
+	@param aPslInfo Cookie passed by client and used by PSL
+	@return 0 if invalid argument(s), -1 if transfer size not limited, the maximum
+	transfer size otherwise.
+	*/
+	virtual TInt MaxTransferSize(TDmaChannel& aChannel, TUint aFlags, TUint32 aPslInfo) = 0;
+
+	/**
+	Called by PIL to retrieve from the PSL the memory alignment mask based on the
+	parameters passed. Some DMA controllers impose alignment constraints on the base
+	address of memory buffers. This mask is AND'ed against memory addresses computed
+	during fragmentation.
+	@param aChannel Channel to be used for the transfer
+	@param aFlags Bitmask characterising transfer
+	@param aPslInfo Cookie passed by client and used by PSL
+	@return A value representing the alignment mask (e.g. 3 if buffer must be 4-byte aligned)
+	*/
+	virtual TUint MemAlignMask(TDmaChannel& aChannel, TUint aFlags, TUint32 aPslInfo) = 0;
+
+	/**
+    Called by PIL during fragmentation to initialise a hardware descriptor.
+
+    The PSL must assume the descriptor is the last in the chain and so set the
+	interrupt bit and set the next descriptor field to an end of chain marker.
+	Must be implemented by PSL if and only if the DMAC supports hardware
+	descriptors.
+	@param aHdr Header associated with hardware descriptor to initialise
+	@param aSrc Transfer source
+	@param aDest Transfer destination
+	@param aCount Number of bytes to transfer (<= max. size supported by DMAC)
+	@param aFlags Bitmask characterising transfer
+	@param aPslInfo Cookie passed by client and used by PSL
+	@param aCookie the channel selection cookie
+	@see DDmaRequest::Fragment
+	*/
+	virtual void InitHwDes(const SDmaDesHdr& aHdr, TUint32 aSrc, TUint32 aDest, TInt aCount,
+						   TUint aFlags, TUint32 aPslInfo, TUint32 aCookie);
+
+	/**
+	Called by PIL, when fragmenting a request, to append a new hardware
+	descriptor to an existing descriptor chain.
+
+	Must clear the interrupt bit of	the descriptor associated with aHdr.
+	Must be implemented by PSL if and only if the DMAC supports hardware descriptors.
+	@param aHdr Header associated with last fragment in chain
+	@param aNextHdr Header associated with fragment to append
+	*/
+	virtual void ChainHwDes(const SDmaDesHdr& aHdr, const SDmaDesHdr& aNextHdr);
+
+	/**
+	Called by PIL when queuing a new request while the channel is running.
+
+	Must append the first hardware descriptor of the new request to the last
+	descriptor in the existing chain. Must be implemented by PSL if and only if
+	the DMAC supports hardware descriptors.
+	@param aChannel The channel where the transfer takes place
+	@param aLastHdr Header associated with last hardware descriptor in chain
+	@param aNewHdr Header associated with first hardware descriptor in new request
+	*/
+	virtual void AppendHwDes(const TDmaChannel& aChannel, const SDmaDesHdr& aLastHdr,
+							 const SDmaDesHdr& aNewHdr);
+
+	/**
+	Called by PIL when completing or cancelling a request to cause the PSL to unlink
+	the last item in the h/w descriptor chain from a subsequent chain that it was
+	possibly linked to. Must be implemented by the PSL if and only if the DMAC supports
+	hardware descriptors.
+
+	@param aChannel The channel where the request (and thus the descriptor) was queued
+	@param aHdr Header associated with last h/w descriptor in completed/cancelled chain
+	*/
+	virtual void UnlinkHwDes(const TDmaChannel& aChannel, SDmaDesHdr& aHdr);
+
+	/**
+	Called by test harness to force an error when the next fragment is
+	transferred.
+
+	Must be implemented by the PSL only if possible.
+	@param aChannel The channel where the error is to occur.
+	@return KErrNone if implemented.  The default PIL implementation returns
+	KErrNotSupported and the test harness knows how to deal with that.
+	*/
+	virtual TInt FailNext(const TDmaChannel& aChannel);
+
+	/**
+	Called by test harness to force the DMA controller to miss one or
+	more interrupts.
+
+	Must be implemented by the PSL only if possible.
+	@param aChannel The channel where the error is to occur
+	@param aInterruptCount The number of interrupt to miss.
+	@return KErrNone if implemented.  The default PIL implementation returns
+	KErrNotSupported and the test harness knows how to deal with that.
+	*/
+	virtual TInt MissNextInterrupts(const TDmaChannel& aChannel, TInt aInterruptCount);
+
+	/** Function allowing platform-specific layer to extend channel API with
+		new channel-specific operations.
+		@param aChannel Channel to operate on
+		@param aCmd Command identifier.  Negative values are reserved for Symbian use.
+		@param aArg PSL-specific
+		@return KErrNotSupported if aCmd is not supported.  PSL-specific value otherwise.
+		@see TDmaChannel::Extension
+	*/
+	virtual TInt Extension(TDmaChannel& aChannel, TInt aCmd, TAny* aArg);
+
+protected:
+	static void HandleIsr(TDmaChannel& aChannel, TBool aIsComplete);
+private:
+	TInt AllocDesPool(TUint aAttribs);
+	void FreeDesPool();
+private:
+	NFastMutex iLock;			 // protect descriptor reservation and allocation
+	const TInt iMaxDesCount;	 // initial number of descriptors and headers
+	TInt iAvailDesCount;		 // current available number of descriptors and headers
+	SDmaDesHdr* iHdrPool;		 // descriptor header dynamic array
+#ifndef __WINS__
+	DPlatChunkHw* iHwDesChunk;	 // chunk for hardware descriptor pool
+#endif
+	TAny* iDesPool;				 // hardware or pseudo descriptor dynamic array
+	const TInt iDesSize;		 // descriptor size in bytes
+public:
+	const TUint iCaps;  		 /*< what is supported by DMA controller */
+	enum {KCapsBitHwDes = 1};	 /*< hardware descriptors supported */
+	SDmaDesHdr* iFreeHdr;		 /*< head of unallocated descriptors linked list */
+#ifdef _DEBUG
+	TBool IsValidHdr(const SDmaDesHdr* aHdr);
+#endif
+	__DMA_DECLARE_INVARIANT
+	};
+
+
+//////////////////////////////////////////////////////////////////////////////
+
+/**
+Single-buffer DMA channel.
+
+Can be instantiated or further derived by PSL.  Not
+intended to be instantiated by client device drivers.
+@publishedPartner
+@released
+*/
+
+class TDmaSbChannel : public TDmaChannel
+	{
+private:
+	virtual void DoQueue(DDmaRequest& aReq);
+	virtual void DoCancelAll();
+	virtual void DoDfc(DDmaRequest& aCurReq, SDmaDesHdr*& aCompletedHdr);
+private:
+	TBool iTransferring;
+	};
+
+
+/**
+Double-buffer DMA channel.
+
+Can be instantiated or further derived by PSL.  Not
+intended to be instantiated by client device drivers.
+@publishedPartner
+@released
+*/
+
+class TDmaDbChannel : public TDmaChannel
+	{
+private:
+	virtual void DoQueue(DDmaRequest& aReq);
+	virtual void DoCancelAll();
+	virtual void DoDfc(DDmaRequest& aCurReq, SDmaDesHdr*& aCompletedHdr);
+private:
+	enum { EIdle = 0, ETransferring, ETransferringLast } iState;
+	};
+
+
+/**
+Scatter-gather DMA channel.
+
+Can be instantiated or further derived by PSL.
+Not intended to be instantiated by client device drivers.
+@publishedPartner
+@released
+*/
+
+class TDmaSgChannel : public TDmaChannel
+	{
+private:
+	virtual void DoQueue(DDmaRequest& aReq);
+	virtual void DoCancelAll();
+	virtual void DoUnlink(SDmaDesHdr& aHdr);
+	virtual void DoDfc(DDmaRequest& aCurReq, SDmaDesHdr*& aCompletedHdr);
+private:
+	TBool iTransferring;
+	};
+
+
+//////////////////////////////////////////////////////////////////////////////
+// INTERFACE WITH TEST HARNESS
+//////////////////////////////////////////////////////////////////////////////
+
+/**
+Set of information used by test harness.
+@publishedPartner
+@released
+*/
+
+struct TDmaTestInfo
+	{
+	/** Maximum transfer size in bytes for all channels (ie. the minimum of all channels' maximum size)*/
+	TInt iMaxTransferSize;
+	/** 3->Memory buffers must be 4-byte aligned, 7->8-byte aligned, ... */
+	TUint iMemAlignMask;
+	/** Cookie to pass to DDmaRequest::Fragment for memory-memory transfer*/
+	TUint32 iMemMemPslInfo;
+	/** Number of test single-buffer channels */
+	TInt iMaxSbChannels;
+	/** Pointer to array containing single-buffer test channel ids */
+	TUint32* iSbChannels;
+	/** Number of test double-buffer channels */
+	TInt iMaxDbChannels;
+	/** Pointer to array containing double-buffer test channel ids */
+	TUint32* iDbChannels;
+	/** Number of test scatter-gather channels */
+	TInt iMaxSgChannels;
+	/** Pointer to array containing scatter-gather test channel ids */
+	TUint32* iSgChannels;
+	};
+
+
+/**
+Provides access to test information structure stored in the PSL.
+
+Must be implemented by the PSL.
+@publishedPartner
+@released
+*/
+
+IMPORT_C const TDmaTestInfo& DmaTestInfo();
+
+
+//////////////////////////////////////////////////////////////////////////////
+
+#include <drivers/dma.inl>
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/include/drivers/dma.inl	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,148 @@
+// 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""
+// 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/drivers/dma.inl
+// DMA framework public inline functions
+// This file should not be modified when porting the DMA framework to
+// new hardware.
+//
+// WARNING: This file contains some APIs which are internal and are subject
+//          to change without noticed. Such APIs should therefore not be used
+//          outside the Kernel and Hardware Services package.
+//
+
+// TDmaChannel
+
+inline void TDmaChannel::Wait()
+	{
+	NKern::FMWait(&iLock);
+	}
+
+inline void TDmaChannel::Signal()
+	{
+	NKern::FMSignal(&iLock);
+	}
+
+inline TBool TDmaChannel::Flash()
+	{
+	return NKern::FMFlash(&iLock);
+	}
+
+inline TBool TDmaChannel::IsOpened() const
+	{
+	return iController != NULL;
+	}
+
+inline TBool TDmaChannel::IsQueueEmpty() const
+	{
+	return const_cast<TDmaChannel*>(this)->iReqQ.IsEmpty();
+	}
+
+inline TUint32 TDmaChannel::PslId() const
+	{
+	return iPslId;
+	}
+
+inline TInt TDmaChannel::FailNext(TInt /*aFragmentCount*/)
+	{
+	return iController->FailNext(*this);
+	}
+
+inline TInt TDmaChannel::MissNextInterrupts(TInt aInterruptCount)
+	{
+	return iController->MissNextInterrupts(*this, aInterruptCount);
+	}
+
+/** Function allowing platform-specific layer to extend API with new
+	channel-specific operations.
+ 	@param aCmd Command identifier.  Negative values are reserved for Symbian use.
+	@param aArg PSL-specific
+	@return KErrNotSupported if aCmd is not supported.  PSL-specific value otherwise.
+ */
+
+inline TInt TDmaChannel::Extension(TInt aCmd, TAny* aArg)
+	{
+	return iController->Extension(*this, aCmd, aArg);
+	}
+
+inline const TDmac* TDmaChannel::Controller() const
+	{
+	return iController;
+	}
+
+inline TInt TDmaChannel::MaxTransferSize(TUint aFlags, TUint32 aPslInfo)
+	{
+	return iController->MaxTransferSize(*this, aFlags, aPslInfo);
+	}
+
+inline TUint TDmaChannel::MemAlignMask(TUint aFlags, TUint32 aPslInfo)
+	{
+	return iController->MemAlignMask(*this, aFlags, aPslInfo);
+	}
+
+// DDmaRequest
+
+/** Called when request is removed from request queue in channel */
+
+inline void DDmaRequest::OnDeque()
+	{
+	iQueued = EFalse;
+	iLastHdr->iNext = NULL;
+	iChannel.DoUnlink(*iLastHdr);
+	}
+
+// TDmac
+
+inline void TDmac::Wait()
+	{
+	NKern::FMWait(&iLock);
+	}
+
+inline void TDmac::Signal()
+	{
+	NKern::FMSignal(&iLock);
+	}
+
+inline SDmaPseudoDes& TDmac::HdrToDes(const SDmaDesHdr& aHdr) const
+	{
+	return static_cast<SDmaPseudoDes*>(iDesPool)[&aHdr - iHdrPool];
+	}
+
+inline TAny* TDmac::HdrToHwDes(const SDmaDesHdr& aHdr) const
+	{
+	return static_cast<TUint8*>(iDesPool) + iDesSize*(&aHdr - iHdrPool);
+	}
+
+inline TUint32 TDmac::DesLinToPhys(TAny* aDes) const
+	{
+#ifdef __WINS__
+	(void)aDes;
+	return 0xDEADBEEF;
+#else
+	return iHwDesChunk->iPhysAddr + ((TLinAddr)aDes - iHwDesChunk->iLinAddr);
+#endif
+	}
+
+// DmaChannelMgr
+
+inline void DmaChannelMgr::Wait()
+	{
+	NKern::FMWait(&Lock);
+	}
+
+inline void DmaChannelMgr::Signal()
+	{
+	NKern::FMSignal(&Lock);
+	}
+
+//---
--- a/kernel/eka/include/drivers/dma_compat.inl	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-// 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"
-// 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/drivers/dma_compat.inl
-// DMA Framework - Client API definition.
-//
-// Inline implementations of functions which (originally) exposed DMA HAI
-// details that are now, after the header file split into dma_v2.h and
-// dma_hai.h, no longer meant to be visible to DMA clients. This file is only
-// included for DMA_APIV2 clients.
-//
-// This file is not meant to be a permanent one, and may eventually be removed
-// together with the deprecated functions it implements.
-//
-//
-
-
-inline const TDmac* TDmaChannel::Controller() const
-	{
-	return iController;
-	}
-
-static inline TUint32 RequestFlags2SrcConfigFlags(TUint aFlags)
-	{
-	TUint32 flags = (aFlags & KDmaMemSrc) ? KDmaMemAddr : 0;
-	flags |= (aFlags & KDmaPhysAddrSrc) ? KDmaPhysAddr : 0;
-	if ((flags & KDmaMemAddr) && (flags & KDmaPhysAddr))
-		flags |= KDmaMemIsContiguous;
-	return flags;
-	}
-
-static inline TUint32 RequestFlags2DstConfigFlags(TUint aFlags)
-	{
-	TUint32 flags = (aFlags & KDmaMemDest) ? KDmaMemAddr : 0;
-	flags |= (aFlags & KDmaPhysAddrDest) ? KDmaPhysAddr : 0;
-	if ((flags & KDmaMemAddr) && (flags & KDmaPhysAddr))
-		flags |= KDmaMemIsContiguous;
-	return flags;
-	}
-
-inline TInt TDmaChannel::MaxTransferSize(TUint aFlags, TUint32 aPslInfo)
-	{
-	TUint src_flags = RequestFlags2SrcConfigFlags(aFlags);
-	TUint dst_flags = RequestFlags2DstConfigFlags(aFlags);
-	return MaxTransferLength(src_flags, dst_flags, aPslInfo);
-	}
-
-inline TUint TDmaChannel::MemAlignMask(TUint aFlags, TUint32 aPslInfo)
-	{
-	TUint src_flags = RequestFlags2SrcConfigFlags(aFlags);
-	TUint dst_flags = RequestFlags2DstConfigFlags(aFlags);
-	return AddressAlignMask(src_flags, dst_flags, aPslInfo);
-	}
-
-
-// ---
--- a/kernel/eka/include/drivers/dma_hai.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,954 +0,0 @@
-// 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"
-// 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/drivers/dma_hai.h
-// DMA Framework - Symbian Hardware Abstraction Interface (SHAI).
-//
-//
-
-/** @file
-	@publishedPartner
-	@released
-*/
-
-#ifndef __DMA_HAI_H__
-#define __DMA_HAI_H__
-
-
-#include <kernel/kern_priv.h>
-
-
-//////////////////////////////////////////////////////////////////////////////
-
-
-/** Interface used by PIL to open and close DMA channels.
-
-	Must be implemented by the PSL.
-*/
-class DmaChannelMgr
-	{
-
-public:
-	/** Opens a channel using a client-provided identifier.
-
-		This function must be implemented by the PSL.
-
-		@param aOpenId PSL-specific magic cookie passed by client. This could
-		identify the channel exactly (by being just the channel number), or at
-		least sufficiently (for example for use with a certain peripheral), or
-		it may indicate some properties which the channel must possess. It may
-		be set to zero always if all channels are equivalent.
-
-		@param aDynChannel ETrue if the Open call is for a dynamic channel. A
-		dynamic channel is not exclusively reserved for just one client, and
-		further Open calls for more dynamic channels should succeed as long as
-		certain resources (but not including the number of available physical
-		channels) are not exceeded. Different transfer requests on this dynamic
-		channel may be serviced using different actual channels.
-
-		@param aPriority The desired channel priority as requested by the
-		client. This may be an actual hardware priority or a
-		platform-independent value. Not being able to satisfy the requested
-		value is not a reason for the PSL to return NULL. This parameter may be
-		ignored if aDynChannel is passed as ETrue. An overriding per-transfer
-		priority may be requested by a client later via
-		TDmaTransferArgs::iChannelPriority.
-		@see SDmacCaps::iChannelPriorities
-		@see TDmaPriority
-
-		@return Pointer to channel if available, NULL otherwise. It should not
-		be NULL if the Open call was for a dynamic channel unless a processing
-		error occurred.
-
-		@pre The PIL calls this function with a global fast mutex held to avoid
-		race conditions.
-
-		@post If a non-NULL pointer is returned, the object pointed to has its
-		iController, iDmacCaps, iPslId, iDynChannel and iPriority members set
-		to valid states.
-
-		iController should point to the controller handling the
-		channel.
-
-		iDmacCaps should point to a SDmacCaps structure containing values
-		relating to this particular channel.
-
-		iPslId should contain a value uniquely identifying the channel - the
-		PIL assigns this value later during request fragmentation to
-		TDmaTransferArgs::iChannelCookie. It can be given any convenient value
-		by the PSL (channel index, I/O port address, etc.).
-
-		iDynChannel should be set to ETrue by the PSL if a dynamic channel was
-		requested and has been opened.
-
-		If applicable, iPriority should contain the actual hardware priority
-		that has been configured or reserved. Otherwise it may be left at its
-		default value TDmaPriority::KDmaPriorityNone.
-	*/
-	static TDmaChannel* Open(TUint32 aOpenId, TBool aDynChannel, TUint aPriority);
-
-
-	/** Performs platform-specific operations when a channel is closed.
-
-		If aChannel was opened as a dynamic channel then this call is a sign
-		that there is a client which does not intend to queue any further
-		transfer requests via this channel.
-
-		This function must be implemented by the PSL but the implementation can
-		be a no-op.
-
-		@param aChannel The channel to close
-
-		@pre The PIL calls this function with a global fast mutex held to avoid
-		race conditions.
-	*/
-	static void Close(TDmaChannel* aChannel);
-
-
-	/** Function allowing PSL to extend DMA API with new channel-independent
-		operations.
-
-		This function must be implemented by the PSL.
-
-		@param aCmd Command identifier. Negative values are reserved for FW
-		internal use.
-
-		@param aArg PSL-specific
-
-		@return KErrNotSupported if aCmd is not supported. PSL-specific value
-		otherwise.
-	*/
-	static TInt StaticExtension(TInt aCmd, TAny* aArg);
-
-
-	/** Acquires the channel manager lock. Called by the PIL before opening and
-		closing a channel.
-	*/
-	static void Wait();
-
-
-	/** Releases the channel manager lock. Called by the PIL after opening and
-		closing a channel.
-	*/
-	static void Signal();
-
-private:
-	/** Declared, defined, and called by PSL's DECLARE_STANDARD_EXTENSION(). */
-	friend TInt InitExtension();
-
-	/** Must be called in the PSL's DECLARE_STANDARD_EXTENSION(). */
-	static TInt Initialise();
-
-	static NFastMutex Lock;
-	};
-
-
-//////////////////////////////////////////////////////////////////////////////
-
-
-/** Abstract base class representing a DMA controller.
-
-	The class has two purposes.
-
-	First, it is a container for channels, descriptors and descriptor headers.
-
-	Second, it exposes a set of virtual functions implemented by the PSL
-	(platform-specific layer).
-
-	These functions are the main interfaces between the PIL
-	(platform-independent layer) and PSL.
-*/
-class TDmac
-	{
-friend class DmaChannelMgr;
-
-// The following friend declaration will become obsolete once header
-// pool manipulation functionality is owned and provided by the controller
-// class instead of the request class.
-// (TDmac::iFreeHdr could then also be made private.)
-friend class DDmaRequest;
-
-friend class TSkelDmac;
-
-protected:
-	/** Data required for creating a new instance. */
-	struct SCreateInfo
-		{
-		/** True if DMAC uses hardware descriptors (i.e. supports
-			scatter/gather mode).
-		*/
-		TBool iCapsHwDes;
-
-		/** Initial maximum number of descriptors and headers (shared by all
-			channels) to be allocated by the PIL. If at run time more
-			descriptors are needed then they will be dynamically allocated and
-			added to the available pool.
-
-			The PSL may consider a number of factors when providing this
-			initial value, such as the number of channels on this controller,
-			the maximum transfer size per descriptor and also likely usage
-			scenarios for the platform or device (number of drivers using DMA,
-			their traffic patterns, simultaneity of operations, etc.).
-
-			(NB: Dynamic growing of the descriptor pool is not yet implemented
-			in the PIL, so this value is currently also the final maximum
-			number of descriptors.)
-		*/
-		TInt iDesCount;
-
-		/** Size of an individual descriptor.
-
-			Use sizeof(TDmaTransferArgs) for single-buffer and double-buffer
-		 	(i.e. non-s/g) controllers.
-		*/
-		TInt iDesSize;
-
-		/** Bitmask used when creating the memory chunk storing the descriptor
-			pool in the PIL. Used only for hardware descriptors.
-
-			The access part must be EMapAttrSupRw. If the chunk is cached
-			and/or buffered, the PSL must flush the data cache and/or drain the
-			write buffer in InitHwDes() and related functions.
-
-			The physical start address of the chunk will always be MMU page
-		 	size aligned.
-
-		 	@see TMappingAttributes
-		 */
-		TUint iDesChunkAttribs;
-		};
-
-	/** Base class constructor.
-	 */
-	TDmac(const SCreateInfo& aInfo);
-
-	/** Base class 2nd-phase constructor.
-	 */
-	TInt Create(const SCreateInfo& aInfo);
-
-public:
-	/** Base class virtual destructor.
-	 */
-	virtual ~TDmac();
-
-
-	/** Allocates a number of headers (and hence also descriptors) from the
-		header/descriptor pools. Called by the PIL but may also be used by the
-		PSL.
-	*/
-	TInt ReserveSetOfDes(TInt aCount);
-
-
-	/** Returns previously allocated headers (and hence also descriptors) to
-		the header/descriptor pools. Called by the PIL but may also be used by
-		the PSL.
-	*/
-	void ReleaseSetOfDes(TInt aCount);
-
-
-	/** Called by the PIL during request fragmentation to fill a descriptor or
-		pseudo descriptor with transfer arguments.
-	*/
-	TInt InitDes(const SDmaDesHdr& aHdr, const TDmaTransferArgs& aTransferArgs);
-
-
-	/** Called by the PIL in TDmaChannel::IsrRedoRequest() if any of the
-		latter's arguments is non-zero.
-	*/
-	TInt UpdateDes(const SDmaDesHdr& aHdr, TUint32 aSrcAddr, TUint32 aDstAddr,
-				   TUint aTransferCount, TUint32 aPslRequestInfo);
-
-
-	/** Returns a reference to the associated pseudo descriptor for a given
-		descriptor header. For use by PIL and PSL.
-	*/
-	inline TDmaTransferArgs& HdrToDes(const SDmaDesHdr& aHdr) const;
-
-
-	/** Returns a reference to the associated hardware descriptor for a given
-		descriptor header. For use by PIL and PSL.
-	*/
-	inline TAny* HdrToHwDes(const SDmaDesHdr& aHdr) const;
-
-
-	/** Returns the physical address of the hardware descriptor
-		pointed to by aDes. For use by PIL and PSL.
-	*/
-	inline TUint32 HwDesLinToPhys(TAny* aDes) const;
-
-
-	/** Called by PIL when one fragment (single-buffer and double-buffer DMACs)
-		or list of fragments (scatter/gather DMAC) is to be transferred.
-
-		Called when initiating a new transfer and also, for double-buffer
-		DMACs, for configuring the next fragment to transfer while the current
-		one is ongoing.
-
-		The function must be implemented by the PSL if
-		SCreateInfo::iCaps::iAsymHwDescriptors is reported as false.
-
-		@note This function may be called in thread or ISR context by the PIL
-
-		@param aChannel The channel to use.
-		@param aHdr Header associated with fragment to transfer.
-	*/
-	virtual void Transfer(const TDmaChannel& aChannel, const SDmaDesHdr& aHdr);
-
-
-	/** Called by PIL when two lists of fragments (scatter/gather DMAC with
-		asymmetrical linked-list capability) are to be transferred.
-
-		Called when initiating a new transfer.
-
-		The function must be implemented by the PSL if
-		SDmaCaps::iAsymHwDescriptors is reported as true.
-
-		@note This function may be called in thread or ISR context by the PIL
-
-		@param aChannel The channel to use.
-		@param aSrcHdr Header associated with descriptor to transfer on the
-		source side.
-		@param aDstHdr Header associated with descriptor to transfer on the
-		destination side.
-	*/
-	virtual void Transfer(const TDmaChannel& aChannel, const SDmaDesHdr& aSrcHdr,
-						  const SDmaDesHdr& aDstHdr);
-
-
-	/** Called by PIL to stop a transfer on a given channel.
-
-		The stopping must occur synchronously as the PIL assumes the channel
-		is halted after calling this function. A channel stopped via this
-		function is not intended to be resumed. Function must always be
-		implemented by the PSL.
-
-		@param aChannel The channel to stop
-		@post The channel will be idle
-		@post No interrupt will occur from this channel until a new
-		request is queued.
-	*/
-	virtual void StopTransfer(const TDmaChannel& aChannel) = 0;
-
-
-	/** Called by PIL to pause (suspend) a transfer on a given channel.
-
-		A paused channel transfer must be able to be resumed by calling
-		ResumeTransfer().
-
-		The function must be implemented by the PSL if
-		SDmacCaps::iChannelPauseAndResume is reported as true.
-
-		@return KErrNone if the transfer has been paused successfully,
-		KErrCompletion if the transfer was already paused, KErrGeneral
-		if a general error occurred preventing a successful outcome.
-
-		@post No interrupt will occur from this channel until it is
-		resumed.
-	*/
-	virtual TInt PauseTransfer(const TDmaChannel& aChannel);
-
-
-	/** Called by PIL to resume a paused (suspended) transfer on a given
-		channel.
-
-		Resume() can be called when the transfer is paused as a result of a
-		previous call to PauseTransfer() or because the DMAC has encountered a
-		Pause bit in a H/W descriptor.
-
-		The function must be implemented by the PSL if
-		SDmacCaps::iChannelPauseAndResume or
-		SDmacCaps::iLinkedListPausedInterrupt is reported as true.
-
-		@return KErrNone if the transfer has been resumed successfully,
-		KErrCompletion if there was no paused transfer, KErrGeneral
-		if a general error occurred preventing a successful outcome.
-	*/
-	virtual TInt ResumeTransfer(const TDmaChannel& aChannel);
-
-
-	/** Called by PIL to check whether a DMA channel is idle.
-
-		'Idle' here means that the channel is ultimately stopped, for example
-		because the transfer has finished, or an error was encountered, or it
-		was manually stopped, but not because it was manually suspended (aka
-		'paused'), or it is waiting for a request line assertion to start the
-		transfer.
-
-		@param aChannel The channel to test
-
-		@return ETrue if channel idle, EFalse if transferring.
-	*/
-	virtual TBool IsIdle(const TDmaChannel& aChannel) = 0;
-
-
-	/** Called by PIL to retrieve from the PSL the maximum transfer length
-		based on the parameters passed.
-
-		@param aChannel Channel to be used for the transfer
-		@param aSrcFlags Bitmask characterising transfer source
-		@see TDmaTransferArgs::iSrcConfig::iFlags
-		@param aDstFlags Bitmask characterising transfer destination
-		@see TDmaTransferArgs::iDstConfig::iFlags
-		@param aPslInfo Cookie passed by client and used by the PSL
-		@see TDmaTransferArgs::iPslRequestInfo
-
-		@return 0 if transfer length is not limited, the maximum transfer
-		length in bytes otherwise.
-	*/
-	virtual TUint MaxTransferLength(TDmaChannel& aChannel, TUint aSrcFlags,
-									TUint aDstFlags, TUint32 aPslInfo) = 0;
-
-
-	/** Called by PIL to retrieve from the PSL the memory alignment mask based
-		on the parameters passed. Some DMA controllers impose alignment
-		constraints on the base address of memory buffers. This mask is AND'ed
-		against memory addresses computed during fragmentation.
-
-		The PIL will call this function separately for source and destination.
-
-		An assumption is that the PSL doesn't need to know if a call to this
-		function is for the source or the destination side, i.e. both ports
-		are, as far as the alignment is concerned, equivalent. All that matters
-		are the values of the relevant configuration parameters.
-
-		Another assumption is that the alignment requirement for a port on a
-		DMAC with potentially different values for source and destination does
-		not depend on the configuration of the respective other port.
-
-		@param aChannel Channel used for the transfer
-		@param aTargetFlags Bitmask characterising transfer source or
-		destination
-		@see TDmaTransferArgs::iSrcConfig::iFlags
-		@see TDmaTransferArgs::iDstConfig::iFlags
-		@param aElementSize Element size used for the transfer. May be zero if
-		not known or 'don't care'.
-		@param aPslInfo Cookie passed by client and used by the PSL
-		@see TDmaTransferArgs::iPslRequestInfo
-
-		@return A value representing the alignment mask (e.g. 3 if buffer must
-		be 4-byte aligned)
-	*/
-	virtual TUint AddressAlignMask(TDmaChannel& aChannel, TUint aTargetFlags,
-								   TUint aElementSize, TUint32 aPslInfo) = 0;
-
-
-	/** Called by PIL during fragmentation to initialise a hardware descriptor.
-
-		The PSL must assume the descriptor is the last in the chain and so set
-		the interrupt bit and set the next descriptor field to an end of chain
-		marker.
-
-		The function must be implemented by the PSL if and only if the DMAC
-		supports hardware descriptors and SDmaCaps::iAsymHwDescriptors is
-		reported as false.
-
-		@param aHdr Header associated with the hardware descriptor to
-		initialise
-		@param aTransferArgs The transfer parameters for this descriptor
-
-		@return KErrNone if the descriptor was successfully initialized,
-		KErrArgument if any of the transfer arguments were detected to be
-		invalid, KErrGeneral if a general error occurred preventing a
-		successful outcome.
-	*/
-	virtual TInt InitHwDes(const SDmaDesHdr& aHdr, const TDmaTransferArgs& aTransferArgs);
-
-
-	/** Called by PIL during fragmentation to initialise a hardware descriptor
-		on the source side of an asymmetric linked list.
-
-		The function must be implemented by the PSL if
-		SDmaCaps::iAsymHwDescriptors is reported as true.
-
-		@param aHdr Header associated with the hardware descriptor to
-		initialise
-		@param aTransferArgs The transfer parameters for this descriptor. Only
-		the elements relating to the source side should be relevant to the
-		implementation.
-
-		@return KErrNone if the descriptor was successfully initialized,
-		KErrArgument if any of the transfer arguments were detected to be
-		invalid, KErrGeneral if a general error occurred preventing a
-		successful outcome.
-	*/
-	virtual TInt InitSrcHwDes(const SDmaDesHdr& aHdr, const TDmaTransferArgs& aTransferArgs);
-
-
-	/** Called by PIL during fragmentation to initialise a hardware descriptor
-		on the destination side of an asymmetric linked list.
-
-		The function must be implemented by the PSL if
-		SDmaCaps::iAsymHwDescriptors is reported as true.
-
-		@param aHdr Header associated with the hardware descriptor to
-		initialise
-		@param aTransferArgs The transfer parameters for this descriptor. Only
-		the elements relating to the destination side should be relevant to the
-		implementation.
-
-		@return KErrNone if the descriptor was successfully initialized,
-		KErrArgument if any of the transfer arguments were detected to be
-		invalid, KErrGeneral if a general error occurred preventing a
-		successful outcome.
-	*/
-	virtual TInt InitDstHwDes(const SDmaDesHdr& aHdr, const TDmaTransferArgs& aTransferArgs);
-
-
-	/** Called by the PIL in ISR context to change specific fields in a
-		hardware descriptor.
-
-		The function must be implemented by the PSL if and only if the DMAC
-		supports hardware descriptors and SDmaCaps::iAsymHwDescriptors is
-		reported as false.
-
-		@param aHdr Header associated with the hardware descriptor to be
-		updated
-		@param aSrcAddr @see TDmaTransferArgs::iSrcConfig::iAddr
-		@param aDstAddr @see TDmaTransferArgs::iDstConfig::iAddr
-		@param aTransferCount @see TDmaTransferArgs::iTransferCount
-		@param aPslRequestInfo @see TDmaTransferArgs::iPslRequestInfo
-
-		Since Epoc::LinearToPhysical() cannot be called in ISR context the
-		addresses passed into this function are always physical ones, i.e.
-		TDmaTransferFlags::KDmaPhysAddr is implied.
-
-		@return KErrNone if the descriptor was successfully modified,
-		KErrArgument if any of the transfer arguments were detected to be
-		invalid, KErrGeneral if a general error occurred preventing a
-		successful outcome.
-	*/
-	virtual TInt UpdateHwDes(const SDmaDesHdr& aHdr, TUint32 aSrcAddr, TUint32 aDstAddr,
-							 TUint aTransferCount, TUint32 aPslRequestInfo);
-
-
-	/** Called by the PIL in ISR context to change specific fields in a
-		hardware descriptor.
-
-		The function must be implemented by the PSL if
-		SDmaCaps::iAsymHwDescriptors is reported as true.
-
-		@param aHdr Header associated with the hardware descriptor to be
-		updated
-		@param aSrcAddr @see TDmaTransferArgs::iSrcConfig::iAddr
-		@param aTransferCount @see TDmaTransferArgs::iTransferCount
-		@param aPslRequestInfo @see TDmaTransferArgs::iPslRequestInfo
-
-		Since Epoc::LinearToPhysical() cannot be called in ISR context the
-		address passed into this function is always a physical ones, i.e.
-		TDmaTransferFlags::KDmaPhysAddr is implied.
-
-		@return KErrNone if the descriptor was successfully modified,
-		KErrArgument if any of the transfer arguments were detected to be
-		invalid, KErrGeneral if a general error occurred preventing a
-		successful outcome.
-	*/
-	virtual TInt UpdateSrcHwDes(const SDmaDesHdr& aHdr, TUint32 aSrcAddr,
-								TUint aTransferCount, TUint32 aPslRequestInfo);
-
-
-	/** Called by the PIL in ISR context to change specific fields in a
-		hardware descriptor.
-
-		The function must be implemented by the PSL if
-		SDmaCaps::iAsymHwDescriptors is reported as true.
-
-		@param aHdr Header associated with the hardware descriptor to be
-		updated
-		@param aDstAddr @see TDmaTransferArgs::iDstConfig::iAddr
-		@param aTransferCount @see TDmaTransferArgs::iTransferCount
-		@param aPslRequestInfo @see TDmaTransferArgs::iPslRequestInfo
-
-		Since Epoc::LinearToPhysical() cannot be called in ISR context the
-		address passed into this function is always a physical ones, i.e.
-		TDmaTransferFlags::KDmaPhysAddr is implied.
-
-		@return KErrNone if the descriptor was successfully modified,
-		KErrArgument if any of the transfer arguments were detected to be
-		invalid, KErrGeneral if a general error occurred preventing a
-		successful outcome.
-	*/
-	virtual TInt UpdateDstHwDes(const SDmaDesHdr& aHdr, TUint32 aDstAddr,
-								TUint aTransferCount, TUint32 aPslRequestInfo);
-
-
-	/** Called by PIL, when fragmenting a request, to append a new hardware
-		descriptor to an existing descriptor chain. May also be called by
-		clients who wish to create their own descriptor chains.
-
-		Must clear the interrupt bit of the descriptor associated with aHdr.
-
-		The function must be implemented by the PSL if and only if the DMAC
-		supports hardware descriptors.
-
-		@param aHdr Header associated with last fragment in chain
-		@param aNextHdr Header associated with fragment to append
-	*/
-	virtual void ChainHwDes(const SDmaDesHdr& aHdr, const SDmaDesHdr& aNextHdr);
-
-
-	/** Called by PIL when queuing a new request while the channel is running.
-
-		Must append the first hardware descriptor of the new request to the
-		last descriptor in the existing chain.
-
-		The function must be implemented by the PSL if and only if the DMAC
-		supports hardware descriptors.
-
-		@param aChannel The channel where the transfer takes place
-		@param aLastHdr Header associated with last hardware descriptor in
-		chain
-		@param aNewHdr Header associated with first hardware descriptor in new
-		request
-	*/
-	virtual void AppendHwDes(const TDmaChannel& aChannel, const SDmaDesHdr& aLastHdr,
-							 const SDmaDesHdr& aNewHdr);
-
-
-	/** Called by PIL when queuing a new request while the channel is running.
-
-		Must append the first hardware descriptor of the new request to the
-		last descriptor in the existing chain.
-
-		The function must be implemented by the PSL if
-		SDmaCaps::iAsymHwDescriptors is reported as true.
-
-		@param aChannel The channel where the transfer takes place
-		@param aSrcLastHdr Header associated with the last descriptor in the
-		source side chain
-		@param aSrcNewHdr Header associated with the first source side
-		descriptor of the new request
-		@param aDstLastHdr Header associated with the last descriptor in the
-		destination side chain
-		@param aDstNewHdr Header associated with the first destination side
-		descriptor of the new request
-	*/
-	virtual void AppendHwDes(const TDmaChannel& aChannel,
-							 const SDmaDesHdr& aSrcLastHdr, const SDmaDesHdr& aSrcNewHdr,
-							 const SDmaDesHdr& aDstLastHdr, const SDmaDesHdr& aDstNewHdr);
-
-
-	/** Called by PIL when completing or cancelling a request to cause the PSL
-		to unlink the last item in the h/w descriptor chain from a subsequent
-		chain that it was possibly linked to.
-
-		The function must be implemented by the PSL if and only if the DMAC
-		supports hardware descriptors.
-
-		@param aChannel The channel where the request (and thus the descriptor)
-		was queued
-		@param aHdr Header associated with last h/w descriptor in
-		completed / cancelled chain
-	*/
-	virtual void UnlinkHwDes(const TDmaChannel& aChannel, SDmaDesHdr& aHdr);
-
-
-	/** Called by PIL when freeing descriptors back to the shared pool in
-		FreeDesList(). The PSL inside ClearHwDes() can clear the contents of
-		the h/w descriptor.
-
-		This may be necessary if the PSL implementation uses the h/w descriptor
-		as another header which in turn points to the actual DMA h/w descriptor
-		(aka LLI).
-
-		The function may be implemented by the PSL if the DMAC supports
-		hardware descriptors.
-
-		@param aHdr Header associated with the h/w descriptor being freed.
-	*/
-	virtual void ClearHwDes(const SDmaDesHdr& aHdr);
-
-
-	/** Called by PIL to logically link two physical channels.
-
-		The function must be implemented by the PSL if the DMAC supports
-		logical channel linking.
-
-		@see SDmacCaps::iChannelLinking
-
-		@param a1stChannel The channel which is to be linked to another channel
-		@param a2ndChannel The channel the first one is to be linked to
-
-		@return KErrNone if the two channels have been linked successfully,
-		KErrCompletion if a1stChannel was already linked to a2ndChannel,
-		KErrArgument if a1stChannel was already linked to a different channel,
-		KErrGeneral if a general error occurred preventing a successful
-		outcome. The default PIL implementation returns KErrNotSupported.
-	*/
-	virtual TInt LinkChannels(TDmaChannel& a1stChannel, TDmaChannel& a2ndChannel);
-
-
-	/** Called by PIL to logically unlink a physical channel from its linked-to
-		successor.
-
-		The function must be implemented by the PSL if the DMAC supports
-		logical channel linking.
-
-		@see SDmacCaps::iChannelLinking
-
-		@param aChannel The channel which is to be unlinked from its successor
-
-		@return KErrNone if the channel has been unlinked successfully,
-		KErrCompletion if the channel was not linked to another channel,
-		KErrGeneral if a general error occurred preventing a successful
-		outcome. The default PIL implementation returns KErrNotSupported.
-	*/
-	virtual TInt UnlinkChannel(TDmaChannel& aChannel);
-
-
-	/** Called by a test harness to force an error when the next fragment is
-		transferred.
-
-		Must be implemented by the PSL only if possible.
-
-		@param aChannel The channel where the error is to occur.
-
-		@return KErrNone if implemented. The default PIL implementation
-		returns KErrNotSupported.
-	*/
-	virtual TInt FailNext(const TDmaChannel& aChannel);
-
-
-	/** Called by a test harness to force the DMA controller to miss one or
-		more interrupts.
-
-		The function must be implemented by the PSL only if possible.
-
-		@param aChannel The channel where the error is to occur
-		@param aInterruptCount The number of interrupt to miss.
-
-		@return KErrNone if implemented. The default PIL implementation
-		returns KErrNotSupported.
-	*/
-	virtual TInt MissNextInterrupts(const TDmaChannel& aChannel, TInt aInterruptCount);
-
-
-	/** Function allowing platform-specific layer to extend channel API with
-		new channel-specific operations.
-
-		@see TDmaChannel::ChannelExtension
-
-		@param aChannel Channel to operate on
-		@param aCmd Command identifier. Negative values are reserved for use by
-		Nokia.
-		@param aArg PSL-specific argument
-
-		@return KErrNotSupported if aCmd is not supported. PSL-specific value
-		otherwise.
-	*/
-	virtual TInt Extension(TDmaChannel& aChannel, TInt aCmd, TAny* aArg);
-
-
-	/** Called by the PIL to query the number of elements that have so far been
-		transferred by the hardware descriptor associated with aHdr at the
-		source port.
-
-		If SDmacCaps::iAsymHwDescriptors is true then the PIL will call this
-		function only for source-side descriptors, and the PSL should fault the
-		kernel if this is not the case.
-
-		The function must be implemented (i.e. overridden) by the PSL if and
-		only if the DMAC supports hardware descriptors.
-
-		@param aHdr Descriptor header associated with the hardware descriptor
-		to be queried
-
-		@return The number of elements that have been transferred by the
-		hardware descriptor associated with aHdr at the source port
-	*/
-	virtual TUint32 HwDesNumSrcElementsTransferred(const SDmaDesHdr& aHdr);
-
-
-	/** Called by the PIL to query the number of elements that have so far been
-		transferred by the hardware descriptor associated with aHdr at the
-		destination port.
-
-		If SDmacCaps::iAsymHwDescriptors is true then the PIL will call this
-		function only for destination-side descriptors, and the PSL should
-		panic if this is not the case.
-
-		The function must be implemented (i.e. overridden) by the PSL if and
-		only if the DMAC supports hardware descriptors.
-
-		@param aHdr Descriptor header associated with the hardware descriptor
-		to be queried
-
-		@return The number of elements that have been transferred by the
-		hardware descriptor associated with aHdr at the destination port
-	*/
-	virtual TUint32 HwDesNumDstElementsTransferred(const SDmaDesHdr& aHdr);
-
-protected:
-	/** Called by the PSL in interrupt context upon a channel interrupt event.
-
-		@param aChannel The channel the ISR relates to
-		@param aEventMask Bitmask of one or more TDmaCallbackType values
-		@param aIsComplete Set to ETrue if no error was encountered
-	*/
-	static void HandleIsr(TDmaChannel& aChannel, TUint aEventMask, TBool aIsComplete);
-
-private:
-	/** Called in Create() */
-	TInt AllocDesPool(TUint aAttribs);
-
-	/** Called in ~TDmac() */
-	void FreeDesPool();
-
-	/** Called by the PIL to acquire the controller lock which protects the
-		header and descriptor pools.
-	*/
-	inline void Wait();
-
-	/** Called by the PIL to release the controller lock which protects the
-		header and descriptor pools.
-	*/
-	inline void Signal();
-
-private:
-	NFastMutex iLock;			 // protect descriptor reservation and allocation
-	const TInt iMaxDesCount;	 // initial number of descriptors and headers
-	TInt iAvailDesCount;		 // current available number of descriptors and headers
-	SDmaDesHdr* iHdrPool;		 // descriptor header dynamic array
-#ifndef __WINS__
-	DPlatChunkHw* iHwDesChunk;	 // chunk for hardware descriptor pool
-#endif
-	TAny* iDesPool;				 // hardware or pseudo descriptor dynamic array
-	const TInt iDesSize;		 // descriptor size in bytes
-
-public:
-	const TBool iCapsHwDes;		 /*< True if DMAC uses h/w descriptors */
-	SDmaDesHdr* iFreeHdr;		 /*< head of unallocated descriptors linked list */
-
-#ifdef _DEBUG
-	/** Tests whether aHdr points into the descriptor header array. */
-	TBool IsValidHdr(const SDmaDesHdr* aHdr);
-#endif
-	__DMA_DECLARE_INVARIANT
-	};
-
-
-//////////////////////////////////////////////////////////////////////////////
-
-
-/** Single-buffer DMA channel.
-
-	Can be instantiated or further derived by the PSL.
-*/
-class TDmaSbChannel : public TDmaChannel
-	{
-private:
-	virtual void DoQueue(const DDmaRequest& aReq);
-	virtual void DoCancelAll();
-	virtual void DoDfc(const DDmaRequest& aCurReq, SDmaDesHdr*& aCompletedHdr);
-
-protected:
-	enum {EIdle = 0, ETransferring} iState;
-	};
-
-
-/** Double-buffer DMA channel.
-
-	Can be instantiated or further derived by the PSL.
-*/
-class TDmaDbChannel : public TDmaChannel
-	{
-private:
-	virtual void DoQueue(const DDmaRequest& aReq);
-	virtual void DoCancelAll();
-	virtual void DoDfc(const DDmaRequest& aCurReq, SDmaDesHdr*& aCompletedHdr);
-
-protected:
-	enum {EIdle = 0, ETransferring, ETransferringLast} iState;
-	};
-
-
-/** Scatter-gather DMA channel.
-
-	Can be instantiated or further derived by the PSL.
-*/
-class TDmaSgChannel : public TDmaChannel
-	{
-private:
-	virtual void DoQueue(const DDmaRequest& aReq);
-	virtual void DoCancelAll();
-	virtual void DoUnlink(SDmaDesHdr& aHdr);
-	virtual void DoDfc(const DDmaRequest& aCurReq, SDmaDesHdr*& aCompletedHdr);
-
-protected:
-	enum {EIdle = 0, ETransferring} iState;
-	};
-
-
-/** Scatter-gather DMA channel with asymmetric linked-lists.
-
-	Can be instantiated or further derived by the PSL.
-
-	@prototype
-*/
-class TDmaAsymSgChannel : public TDmaChannel
-	{
-public:
-	TDmaAsymSgChannel();
-
-private:
-	virtual void DoQueue(const DDmaRequest& aReq);
-	virtual void DoCancelAll();
-	virtual void DoUnlink(SDmaDesHdr& aHdr);
-	virtual void DoDfc(const DDmaRequest& aCurReq, SDmaDesHdr*& aSrcCompletedHdr,
-					   SDmaDesHdr*& aDstCompletedHdr);
-	virtual void SetNullPtr(const DDmaRequest& aReq);
-	virtual void ResetNullPtr();
-
-protected:
-	SDmaDesHdr* iSrcCurHdr;	  // source fragment being transferred or NULL
-	SDmaDesHdr** iSrcNullPtr; // Pointer to NULL pointer following last source fragment
-	SDmaDesHdr* iDstCurHdr;	  // destination fragment being transferred or NULL
-	SDmaDesHdr** iDstNullPtr; // Pointer to NULL pointer following last destination fragment
-	enum {EIdle = 0, ETransferring} iState;
-
-	__DMA_DECLARE_VIRTUAL_INVARIANT
-	};
-
-
-//////////////////////////////////////////////////////////////////////////////
-
-// 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>
-
-
-#endif	// #ifndef __DMA_HAI_H__
--- a/kernel/eka/include/drivers/dma_hai.inl	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-// 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 "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/drivers/dma_hai.inl
-// DMA Framework - Symbian Hardware Abstraction Interface (SHAI).
-//
-//
-
-
-// TDmac
-
-inline void TDmac::Wait()
-	{
-	NKern::FMWait(&iLock);
-	}
-
-inline void TDmac::Signal()
-	{
-	NKern::FMSignal(&iLock);
-	}
-
-inline TDmaTransferArgs& TDmac::HdrToDes(const SDmaDesHdr& aHdr) const
-	{
-	return static_cast<TDmaTransferArgs*>(iDesPool)[&aHdr - iHdrPool];
-	}
-
-inline TAny* TDmac::HdrToHwDes(const SDmaDesHdr& aHdr) const
-	{
-	return static_cast<TUint8*>(iDesPool) + iDesSize * (&aHdr - iHdrPool);
-	}
-
-inline TUint32 TDmac::HwDesLinToPhys(TAny* aDes) const
-	{
-#ifdef __WINS__
-	(void)aDes;
-	return 0xDEADBEEF;
-#else
-	return iHwDesChunk->iPhysAddr +
-		(reinterpret_cast<TLinAddr>(aDes) - iHwDesChunk->iLinAddr);
-#endif
-	}
-
-
-// ---
--- a/kernel/eka/include/drivers/dma_v1.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,904 +0,0 @@
-// 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""
-// 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/drivers/dma_v1.h
-// DMA Framework API v1
-//
-// NB: DMA clients should never include this file directly, but only ever the
-// generic header file <drivers/dma.h>.
-//
-
-#ifndef __DMA_H__
-#error "dma_v1.h must'n be included directly - use <drivers/dma.h> instead"
-#endif	// #ifndef __DMA_H__
-
-#ifndef __DMA_V1_H__
-#define __DMA_V1_H__
-
-#include <kernel/kern_priv.h>
-
-
-//////////////////////////////////////////////////////////////////////////////
-// Debug Support - KDmaPanicCat is defined in each source file
-
-#define __DMA_ASSERTD(e) __ASSERT_DEBUG(e, Kern::Fault(KDmaPanicCat, __LINE__))
-#define __DMA_ASSERTA(e) __ASSERT_ALWAYS(e, Kern::Fault(KDmaPanicCat, __LINE__))
-#ifdef _DEBUG
-#define __DMA_CANT_HAPPEN() Kern::Fault(KDmaPanicCat, __LINE__)
-#define __DMA_DECLARE_INVARIANT public: void Invariant();
-#define __DMA_INVARIANT() Invariant()
-#else
-#define __DMA_CANT_HAPPEN()
-#define __DMA_DECLARE_INVARIANT
-#define __DMA_INVARIANT()
-#endif
-
-
-//////////////////////////////////////////////////////////////////////////////
-// INTERFACE EXPOSED TO DEVICE-DRIVERS
-//////////////////////////////////////////////////////////////////////////////
-
-/**
-Bitmasks used for configuring a DMA request.
-
-In general, specify KDmaMemSrc|KDmaIncSrc (resp. KDmaMemDest|KDmaIncDest) if
-the source (resp. destination) is a memory buffer and clear
-KDmaMemSrc|KDmaIncSrc (resp. KDmaMemDest|KDmaIncDest) if the source
-(resp. destination) is a peripheral.
-
-If the location is given as a physical address (rather than a linear one)
-then also specify KDmaPhysAddrSrc and/or KDmaPhysAddrDest.
-
-The EKA1 "Fill Mode" can be implemented by omitting KDmaIncSrc.
-
-Some peripherals may require a post-increment address mode.
-
-@see DDmaRequest::Fragment
-@publishedPartner
-@released
-*/
-
-enum TDmaRequestFlags
-	{
-	/** Source is address of memory buffer */
-	KDmaMemSrc       = 0x01,
-	/** Destination is address of memory buffer */
-	KDmaMemDest      = 0x02,
-	/** Source address must be post-incremented during transfer */
-	KDmaIncSrc       = 0x04,
-	/** Destination address must be post-incremented during transfer */
-	KDmaIncDest      = 0x08,
-	/** Source address is a physical address (as opposed to a linear one) */
-	KDmaPhysAddrSrc  = 0x10,
-	/** Destination address is a physical address (as opposed to a linear one) */
-	KDmaPhysAddrDest = 0x20,
-	/** Request a different max transfer size (for instance for test purposes) */
-	KDmaAltTransferLen = 0x40
-	};
-
-
-//////////////////////////////////////////////////////////////////////////////
-
-class TDmaChannel;
-struct SDmaDesHdr;
-
-/** A DMA request is a list of fragments small enough to be transferred in one go
-	by the DMAC.
-
-	In general, fragmentation is done in the framework by calling Fragment() but
-	clients with special needs can allocate a blank descriptor list with
-	ExpandDesList() and customise it to fit their needs.
-
-	Clients should not set attributes directly, but should use the various functions
-	instead.
-
-	This class has not been designed to be called from several concurrent threads.
-	Multithreaded clients must implement their own locking scheme (via DMutex).
-
-	Fast mutexes are used internally to protect data structures accessed both
-	by the client thread and the DFC thread.  Therefore no fast mutex can be held
-	when calling a request function.
-
-	@publishedPartner
-	@released
- */
-class DDmaRequest : public DBase
-	{
-	friend class TDmaChannel;
-public:
-	/** The outcome of the transfer */
-	enum TResult {EBadResult=0, EOk, EError};
-	/** The signature of the completion/failure callback function */
-	typedef void (*TCallback)(TResult, TAny*);
-public:
-   
-    /**
-    Create a new transfer request. 
-
-    @param aChannel The channel this request is bound to.
-    @param aCb      Callback function called on transfer completion or failure (in channel
-                    DFC context).  Can be NULL.
-    @param aCbArg   Argument passed to callback function.
-    @param aMaxTransferSize Maximum fragment size.  If not specified, defaults to the maximum size
-           supported by the DMA controller for the type of transfer that is later scheduled.
-    */
-	IMPORT_C DDmaRequest(TDmaChannel& aChannel, TCallback aCb=NULL, TAny* aCbArg=NULL, TInt aMaxTransferSize=0);
-	
-	
-	/**
-    Destructor.
-
-    Assume the request is not being transferred or pending.
-    */
-	IMPORT_C ~DDmaRequest();
-	
-	
-	/**
-    Split request into a list of fragments small enough to be fed to the DMAC.
-
-    The size of each fragment is smaller than or equal to the maximum transfer size
-    supported by the DMAC.  If the source and/or destination is memory, each
-    fragment points to memory which is physically contiguous.
-
-    The kind of transfer to perform is specified via a set of flags used by a PIL
-    and a magic cookie passed to the PSL.  If the source (resp. destination) is a
-    peripheral, aSrc (resp. aDest) is treated as a magic cookie by the PIL and
-    passed straight to the PSL.
-
-    The request can be uninitialised or may have been fragmented previously.  The
-    previous configuration if any is lost whether or not the function succeeds.
-
-    The client must ensure that any memory buffers involved in the transfer
-    have been suitably prepared for DMA. For memory allocated on the kernel
-    side or in a shared chunk this amounts to ensuring cache consistency
-    before Queue() is called. However for memory that was allocated on the
-    user side the client must also ensure that the memory is protected from
-    both data paging and RAM defragmentation before Fragment() is called
-    @see Kern::MapAndPinMemory(). Note however, that this function is only
-    available if the flexible memory model (FMM) is in use.
-
-    @param aSrc     Source memory buffer linear address or peripheral magic cookie.
-    @param aDest    Destination memory buffer linear address or peripheral magic cookie.
-    @param aCount   Number of bytes to transfer.
-    @param aFlags   Bitmask characterising the transfer.
-    @param aPslInfo Hardware-specific information passed to PSL.
-
-    @return KErrNone if success. KErrArgument if aFlags and/or aPslInfo are invalid when finding
-    the maximum transfer size. May also fail if running out of descriptors.
-
-    @pre The request is not being transferred or pending.
-    @pre The various parameters must be valid.  The PIL or PSL will fault the
-    kernel if not.
-
-    @see TDmaRequestFlags
-    */
-	IMPORT_C TInt Fragment(TUint32 aSrc, TUint32 aDest, TInt aCount, TUint aFlags, TUint32 aPslInfo);
-	
-	
-	/**
-    Transfer asynchronously this request.
-
-    If this request's channel is idle, the request is transferred immediately.
-    Otherwise, it is queued and transferred later.
-
-    The client is responsible for ensuring cache consistency before and/or after the
-    transfer if necessary.
-    */
-	IMPORT_C void Queue();
-	
-
-    /**
-    Append new descriptor(s) to existing list.
-
-    Clients needing to build a custom descriptor list should call this function to
-    allocate the list and access the resulting list through iFirstHdr and iLastHdr.
-
-    Clients should not change the value of iFirstHdr, iLastHdr and the iNext field
-    of the descriptor headers to ensure descriptors can be deallocated. Clients
-    are free to change hardware descriptors, including chaining, in whatever way
-    suit them.
-
-    Assume the request is not being transferred or pending.
-
-    @param aCount Number of descriptors to append.
-
-    @return KErrNone or KErrTooBig if not enough descriptors available.
-    */
-	IMPORT_C TInt ExpandDesList(TInt aCount=1);
-	
-	
-	/**
-    Free resources associated with this request.
-
-    Assume the request is not being transferred or pending.
-    */
-	IMPORT_C void FreeDesList();
-private:
-	inline void OnDeque();
-public:
-	// WARNING: The following attributes are accessed both in client and DFC
-	// context and so accesses must be protected with the channel lock.
-	TDmaChannel& iChannel;		/**< The channel this request is bound to */
-	volatile TCallback iCb;		/**< Called on completion/failure (can be NULL) */
-	TAny* volatile iCbArg;		/**< Callback argument */
-	TInt iDesCount;				/**< The number of fragments in list */
-	SDmaDesHdr* iFirstHdr;		/**< The first fragment in the list (or NULL) */
-	SDmaDesHdr* iLastHdr;		/**< The last fragment in the list (or NULL) */
-	SDblQueLink iLink;			/**< The link on channel queue of pending requests */
-	TBool iQueued;				/**< Indicates whether request is pending or being transferred */
-	TInt iMaxTransferSize;		/**< Defaults to DMA controller max. transfer size */
-	__DMA_DECLARE_INVARIANT
-	};
-
-
-//////////////////////////////////////////////////////////////////////////////
-
-class TDmac;
-class DmaChannelMgr;
-
-/** DMA channel base class.
-
-	This class has not been designed to be called from several concurrent
-	client threads.  Multithreaded clients must implement their own locking
-	scheme (via DMutex).
-
-	Fast mutexes are used internally to protect data structures accessed both
-	by the client thread and the DFC one.  Therefore no fast mutex can be held
-	when calling a channel function.
-
-	Must be allocated in BSS because it relies on being zeroed at
-	creation-time.  If the PSL really needs to allocate channels on the kernel
-	heap, it must manually zero-initialises the instances.  This can be
-	achieved either by allocating raw memory and using placement new, or by
-	wrapping channels into a DBase-derived wrapper.
-
-	@publishedPartner
-	@released
- */
-class TDmaCancelInfo;
-class TDmaChannel
-	{
-	friend class DDmaRequest;
-	friend class TDmac;
-	friend class DmaChannelMgr;
-public:
-	/**  Information passed by client when opening channel */
-	struct SCreateInfo
-		{
-		/** Identifier used by PSL to select channel to open */
-		TUint32 iCookie;
-		/** Number of descriptors this channel can use */
-		TInt iDesCount;
-		/** DFC queue used to service DMA interrupts */
-		TDfcQue* iDfcQ;
-		/** DFC priority */
-		TUint8 iDfcPriority;
-		};
-public:
-    /**
- 	Opens the DMA channel.
-
- 	Channel selection is done by the hardware-specific layer using a cookie passed in
- 	via aInfo.
-
- 	The client should not delete the returned pointer as the framework owns
- 	channel objects.  However, the client should explicitly close the channel when
- 	finished with it.
-
-	@param aInfo    Information passed by caller to select and configure channel.
- 	@param aChannel Point to open channel on successful return.  NULL otherwise.
-
- 	@return KErrNone or standard error code.
- 	*/
-	IMPORT_C static TInt Open(const SCreateInfo& aInfo, TDmaChannel*& aChannel);
-	
-	
-	/**
- 	Closes a previously opened DMA channel.
-
- 	Assume the channel is idle and all requests have been deleted.
- 	*/
-	IMPORT_C void Close();
-	
-	
-	/**
- 	Cancels the current request and all the pending ones.
- 	*/
-	IMPORT_C void CancelAll();
-	inline TBool IsOpened() const;
-	inline TBool IsQueueEmpty() const;
-	inline TUint32 PslId() const;
-	inline TInt FailNext(TInt aFragmentCount);
-	inline TInt MissNextInterrupts(TInt aInterruptCount);
-	inline TInt Extension(TInt aCmd, TAny* aArg);
-	
-	/**
-	This is a function that allows the Platform Specific Layer (PSL) to extend the DMA API
-	with new channel-independent operations.
-
-	@param aCmd Command identifier.  Negative values are reserved for Symbian use.
-	@param aArg PSL-specific.
-	
-	@return KErrNotSupported if aCmd is not supported; a  PSL specific value otherwise.
- 	*/
-	IMPORT_C TInt StaticExtension(TInt aCmd, TAny* aArg);
-	inline const TDmac* Controller() const;
-	inline TInt MaxTransferSize(TUint aFlags, TUint32 aPslInfo);
-	inline TUint MemAlignMask(TUint aFlags, TUint32 aPslInfo);
-protected:
-	// Interface with state machines
-	TDmaChannel();
-	virtual void DoQueue(DDmaRequest& aReq) = 0;
-	virtual void DoCancelAll() = 0;
-	virtual void DoUnlink(SDmaDesHdr& aHdr);
-	virtual void DoDfc(DDmaRequest& aCurReq, SDmaDesHdr*& aCompletedHdr) = 0;
-	/**
-		This function allows the Platform Specific Layer (PSL) to control the
-		power management of the channel or its controller by overriding the
-		PIL's default implementation (which does nothing) and making
-		appropriate use of the Power Resource Manager (PRM).
-
-		The function gets called by the PIL whenever the channel's queued
-		requests count has changed in a significant way, either before the
-		channel's Transfer() method is invoked for a request on a previously
-		empty request queue, or immediately after the request count has become
-		zero because of request cancellation or completion.
-
-		Depending on the current and previous observed values of
-		iQueuedRequests, the PSL may power down or power up the channel.
-
-		Note that iQueuedRequests gets accessed and changed by different
-		threads, so the PSL needs to take the usual precautions when evaluating
-		the variable's value. Also, due to the multithreaded framework
-		architecture, there is no guarantee that the function calls always
-		arrive at the PSL level in the strict chronological order of
-		iQueuedRequests being incremented/decremented in the PIL, i.e. it might
-		happen that the PSL finds iQueuedRequests to have the same value in two
-		or more consecutive calls (that's why the previous observed value needs
-		to be locally available and taken into account). It is however promised
-		that before any actual transfer commences the PSL will find the request
-		count to be greater than zero and that after the last request has
-		finished it will be found to be zero.
-
-		None of the internal DMA framework mutexes is being held by the PIL
-		when calling this function.
-
-		Here is an example implementation for a derived channel class:
-
-		@code
-
-		class TFooDmaChannel : public TDmaSgChannel
-			{
-			DMutex* iDmaMutex;
-			TInt iPrevQueuedRequests;
-			virtual void QueuedRequestCountChanged();
-			};
-
-		void TFooDmaChannel::QueuedRequestCountChanged()
-			{
-			Kern::MutexWait(*iDmaMutex);
-			const TInt queued_now = __e32_atomic_load_acq32(&iQueuedRequests);
-			if ((queued_now > 0) && (iPrevQueuedRequests == 0))
-				{
-				IncreasePowerCount(); // Base port specific
-				}
-			else if ((queued_now == 0) && (iPrevQueuedRequests > 0))
-				{
-				DecreasePowerCount(); // Base port specific
-				}
-			iPrevQueuedRequests = queued_now;
-			Kern::MutexSignal(*iDmaMutex);
-			}
-
-		@endcode
-
-		@see iQueuedRequests
-	*/
-	virtual void QueuedRequestCountChanged();
-#if defined(__CPU_ARM) && !defined(__EABI__)
-	inline virtual ~TDmaChannel() {}	// kill really annoying warning
-#endif
-private:
-	static void Dfc(TAny*);
-	void DoDfc();
-	inline void Wait();
-	inline void Signal();
-	inline TBool Flash();
-	void ResetStateMachine();
-protected:
-	TDmac* iController;										// DMAC this channel belongs to (NULL when closed)
-	TUint32 iPslId;											// unique identifier provided by PSL
-	NFastMutex iLock;										// for data accessed in both client & DFC context
-	SDmaDesHdr* iCurHdr;									// fragment being transferred or NULL
-	SDmaDesHdr** iNullPtr;									// Pointer to NULL pointer following last fragment
-	TDfc iDfc;												// transfer completion/failure DFC
-	TInt iMaxDesCount;										// maximum number of allocable descriptors
-	TInt iAvailDesCount;									// available number of descriptors
-	volatile TUint32 iIsrDfc;								// Interface between ISR and DFC:
-	enum { KErrorFlagMask = 0x80000000 };					// bit 31 - error flag
-	enum { KCancelFlagMask = 0x40000000 };					// bit 30 - cancel flag
-	enum { KDfcCountMask = 0x3FFFFFFF };					// bits 0-29 - number of queued DFCs
-	SDblQue iReqQ;											// being/about to be transferred request queue
-	TInt iReqCount;											// number of requests attached to this channel
-	TInt iQueuedRequests; 									// number of requests currently queued on this channel
-	TBool iCallQueuedRequestFn;								// call QueuedRequestCountChanged? (default: true)
-private:
-	TDmaCancelInfo* iCancelInfo;
-	__DMA_DECLARE_INVARIANT
-	};
-
-
-//////////////////////////////////////////////////////////////////////////////
-// 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.
-@see DDmaRequest::Fragment
-@publishedPartner
-@released
-*/
-
-struct SDmaPseudoDes
-	{
-	/** Source linear address or peripheral cookie */
-	TUint32 iSrc;
-	/** Destination linear address or peripheral cookie */
-	TUint32 iDest;
-	/** Number of bytes to transfer */
-	TInt iCount;
-	/** @see TDmaRequestFlags */
-	TUint iFlags;
-	/** PSL-specific information provided by client */
-	TUint32 iPslInfo;
-	/** The same as TDmaChannel::SCreateInfo.iCookie */
-	TUint32 iCookie;
-	};
-
-
-/**
-Each hardware or pseudo descriptor is associated with a header.  Headers are
-needed because hardware descriptors can not easily be extended to store
-additional information.
-@publishedPartner
-@released
-*/
-
-struct SDmaDesHdr
-	{
-	SDmaDesHdr* iNext;
-	};
-
-
-/**
-Interface used by PIL to open and close DMA channels.
-
-Must be implemented by PSL.
-@publishedPartner
-@released
-*/
-
-class DmaChannelMgr
-	{
-public:
-	/** Opens a channel using a client-provided identifier.
-		This function must be implemented by the PSL.
-		@param	aOpenId Magic cookie passed by client
-				This may identify the channel (if a static channel
-				allocation scheme is used) or may indicate some
-				properties which the channel must possess (if a dynamic
-				channel allocation scheme is used). It may be set to
-				zero always if dynamic allocation is used and all
-				channels are equivalent.
-		@return	Pointer to channel if available, NULL otherwise.
-		@pre	The PIL calls this function with a global fast mutex held to
-				avoid race conditions.
-		@post	If a non-NULL pointer is returned, the object pointed to has its
-				iController and iPslId members set to valid states.
-				iController should point to the controller handling that channel.
-				iPslId should contain a value uniquely identifying the channel -
-				it is used only for debug tracing by PIL. It can be given any
-				convenient value by PSL	(channel index, I/O port address, ...).
-	*/
-	static TDmaChannel* Open(TUint32 aOpenId);
-
-	/** Performs platform-specific operations when a channel is closed.
-		This function must be implemented by the PSL but the implementation can be
-		a no-op.
-		@param aChannel The channel to close
-		@pre The PIL calls this function with a global fast mutex held to
-			avoid race conditions.
-	*/
-	static void Close(TDmaChannel* aChannel);
-
-	/** Function allowing PSL to extend DMA API with new channel-independent operations.
-		This function must be implemented by the PSL.
-		@param aCmd Command identifier.  Negative values are reserved for Symbian use.
-		@param aArg PSL-specific
-		@return KErrNotSupported if aCmd is not supported.  PSL-specific value otherwise.
-	 */
-	static TInt StaticExtension(TInt aCmd, TAny* aArg);
-
-	static inline void Wait();
-	static inline void Signal();
-private:
-	static NFastMutex Lock;
-	};
-
-
-//////////////////////////////////////////////////////////////////////////////
-
-/**
- Abstract base class representing a DMA controller.
-
- The class has two purposes.
-
- First, it is a container for channels, descriptors and descriptor headers.
-
- Second, it exposes a set of virtual functions implemented by
- the PSL (platform-specific layer).
- These functions are the main interfaces between
- the PIL (platform-independent layer) and PSL.
-
- Must be allocated in BSS because it relies on being zeroed at creation-time.
-
- @publishedPartner
- @released
- */
-
-class TDmac
-	{
-	friend class DmaChannelMgr;
-// protected: VC++ complains when building PSL if following decl is protected
-public:
-	/** Data required for creating a new instance */
-	struct SCreateInfo
-		{
-		/** Number of channels in controller */
-		TInt iChannelCount;
-        /** Maximum number of descriptors (shared by all channels) */
-		TInt iDesCount;
-		/** Bitmask.  The only supported value is KCapsBitHwDes (hardware
-			descriptors used). */
-		TUint32 iCaps;
-		/** Size of individual descriptors.  Use sizeof(SDmaPseudoDes) for
-		 	single-buffer and double-buffer controllers. */
-		TInt iDesSize;
-		/** Bitmask used when creating the hardware chunk storing the descriptor
-			pool. Used only for hardware descriptors. The access part must be
-			EMapAttrSupRw.  If the chunk is cached and/or buffered, the PSL must
-			flush the data cache and/or drain the write buffer in InitHwDes()
-			and related functions.
-		 	@see TMappingAttributes
-		 */
-		TUint iDesChunkAttribs;
-		};
-public:
-	TInt Create(const SCreateInfo& aInfo);
-	virtual ~TDmac();
-	TInt ReserveSetOfDes(TInt aCount);
-	void ReleaseSetOfDes(TInt aCount);
-	void InitDes(const SDmaDesHdr& aHdr, TUint32 aSrc, TUint32 aDest, TInt aCount,
-				 TUint aFlags, TUint32 aPslInfo, TUint32 aCookie);
-	inline SDmaPseudoDes& HdrToDes(const SDmaDesHdr& aHdr) const;
-	inline TAny* HdrToHwDes(const SDmaDesHdr& aHdr) const;
-	inline TUint32 DesLinToPhys(TAny* aDes) const;
-	inline void Wait();
-	inline void Signal();
-protected:
-	TDmac(const SCreateInfo& aInfo);
-
-public:
-	/**
-	Called by PIL when one fragment (single-buffer and double-buffer DMACs) or
-	list of fragments (scatter/gather DMAC) is to be transferred.
-
-	Called when	initiating a new transfer and also, for double-buffer DMACs, for
-	configuring the next fragment to transfer while the current one is
-	ongoing. Must always be implemented by PSL.
-	@param aChannel The channel to use
-	@param aHdr Header associated with fragment to transfer
-	*/
-	virtual void Transfer(const TDmaChannel& aChannel, const SDmaDesHdr& aHdr) = 0;
-
-	/**
-    Called by PIL to suspend transfer on a given channel.
-
-    The suspension must occur synchronously as the PSL assumes the channel
-    is suspended after calling this function. Must always be implemented by PSL.
-	@param aChannel The channel to suspend
-	*/
-	virtual void StopTransfer(const TDmaChannel& aChannel) = 0;
-
-	/**
-	Called by PIL to check whether a DMA channel is idle.
-	@param aChannel The channel to test
-	@return ETrue if channel idle, EFalse if transferring.
-	 */
-	virtual TBool IsIdle(const TDmaChannel& aChannel) = 0;
-
-	/**
-	Called by PIL to retrieve from the PSL the maximum transfer size based on the
-	parameters passed.
-	@param aChannel Channel to be used for the transfer
-	@param aFlags Bitmask characterising transfer
-	@param aPslInfo Cookie passed by client and used by PSL
-	@return 0 if invalid argument(s), -1 if transfer size not limited, the maximum
-	transfer size otherwise.
-	*/
-	virtual TInt MaxTransferSize(TDmaChannel& aChannel, TUint aFlags, TUint32 aPslInfo) = 0;
-
-	/**
-	Called by PIL to retrieve from the PSL the memory alignment mask based on the
-	parameters passed. Some DMA controllers impose alignment constraints on the base
-	address of memory buffers. This mask is AND'ed against memory addresses computed
-	during fragmentation.
-	@param aChannel Channel to be used for the transfer
-	@param aFlags Bitmask characterising transfer
-	@param aPslInfo Cookie passed by client and used by PSL
-	@return A value representing the alignment mask (e.g. 3 if buffer must be 4-byte aligned)
-	*/
-	virtual TUint MemAlignMask(TDmaChannel& aChannel, TUint aFlags, TUint32 aPslInfo) = 0;
-
-	/**
-    Called by PIL during fragmentation to initialise a hardware descriptor.
-
-    The PSL must assume the descriptor is the last in the chain and so set the
-	interrupt bit and set the next descriptor field to an end of chain marker.
-	Must be implemented by PSL if and only if the DMAC supports hardware
-	descriptors.
-	@param aHdr Header associated with hardware descriptor to initialise
-	@param aSrc Transfer source
-	@param aDest Transfer destination
-	@param aCount Number of bytes to transfer (<= max. size supported by DMAC)
-	@param aFlags Bitmask characterising transfer
-	@param aPslInfo Cookie passed by client and used by PSL
-	@param aCookie the channel selection cookie
-	@see DDmaRequest::Fragment
-	*/
-	virtual void InitHwDes(const SDmaDesHdr& aHdr, TUint32 aSrc, TUint32 aDest, TInt aCount,
-						   TUint aFlags, TUint32 aPslInfo, TUint32 aCookie);
-
-	/**
-	Called by PIL, when fragmenting a request, to append a new hardware
-	descriptor to an existing descriptor chain.
-
-	Must clear the interrupt bit of	the descriptor associated with aHdr.
-	Must be implemented by PSL if and only if the DMAC supports hardware descriptors.
-	@param aHdr Header associated with last fragment in chain
-	@param aNextHdr Header associated with fragment to append
-	*/
-	virtual void ChainHwDes(const SDmaDesHdr& aHdr, const SDmaDesHdr& aNextHdr);
-
-	/**
-	Called by PIL when queuing a new request while the channel is running.
-
-	Must append the first hardware descriptor of the new request to the last
-	descriptor in the existing chain. Must be implemented by PSL if and only if
-	the DMAC supports hardware descriptors.
-	@param aChannel The channel where the transfer takes place
-	@param aLastHdr Header associated with last hardware descriptor in chain
-	@param aNewHdr Header associated with first hardware descriptor in new request
-	*/
-	virtual void AppendHwDes(const TDmaChannel& aChannel, const SDmaDesHdr& aLastHdr,
-							 const SDmaDesHdr& aNewHdr);
-
-	/**
-	Called by PIL when completing or cancelling a request to cause the PSL to unlink
-	the last item in the h/w descriptor chain from a subsequent chain that it was
-	possibly linked to. Must be implemented by the PSL if and only if the DMAC supports
-	hardware descriptors.
-
-	@param aChannel The channel where the request (and thus the descriptor) was queued
-	@param aHdr Header associated with last h/w descriptor in completed/cancelled chain
-	*/
-	virtual void UnlinkHwDes(const TDmaChannel& aChannel, SDmaDesHdr& aHdr);
-
-	/**
-	Called by test harness to force an error when the next fragment is
-	transferred.
-
-	Must be implemented by the PSL only if possible.
-	@param aChannel The channel where the error is to occur.
-	@return KErrNone if implemented.  The default PIL implementation returns
-	KErrNotSupported and the test harness knows how to deal with that.
-	*/
-	virtual TInt FailNext(const TDmaChannel& aChannel);
-
-	/**
-	Called by test harness to force the DMA controller to miss one or
-	more interrupts.
-
-	Must be implemented by the PSL only if possible.
-	@param aChannel The channel where the error is to occur
-	@param aInterruptCount The number of interrupt to miss.
-	@return KErrNone if implemented.  The default PIL implementation returns
-	KErrNotSupported and the test harness knows how to deal with that.
-	*/
-	virtual TInt MissNextInterrupts(const TDmaChannel& aChannel, TInt aInterruptCount);
-
-	/** Function allowing platform-specific layer to extend channel API with
-		new channel-specific operations.
-		@param aChannel Channel to operate on
-		@param aCmd Command identifier.  Negative values are reserved for Symbian use.
-		@param aArg PSL-specific
-		@return KErrNotSupported if aCmd is not supported.  PSL-specific value otherwise.
-		@see TDmaChannel::Extension
-	*/
-	virtual TInt Extension(TDmaChannel& aChannel, TInt aCmd, TAny* aArg);
-
-protected:
-	static void HandleIsr(TDmaChannel& aChannel, TBool aIsComplete);
-private:
-	TInt AllocDesPool(TUint aAttribs);
-	void FreeDesPool();
-private:
-	NFastMutex iLock;			 // protect descriptor reservation and allocation
-	const TInt iMaxDesCount;	 // initial number of descriptors and headers
-	TInt iAvailDesCount;		 // current available number of descriptors and headers
-	SDmaDesHdr* iHdrPool;		 // descriptor header dynamic array
-#ifndef __WINS__
-	DPlatChunkHw* iHwDesChunk;	 // chunk for hardware descriptor pool
-#endif
-	TAny* iDesPool;				 // hardware or pseudo descriptor dynamic array
-	const TInt iDesSize;		 // descriptor size in bytes
-public:
-	const TUint iCaps;  		 /*< what is supported by DMA controller */
-	enum {KCapsBitHwDes = 1};	 /*< hardware descriptors supported */
-	SDmaDesHdr* iFreeHdr;		 /*< head of unallocated descriptors linked list */
-#ifdef _DEBUG
-	TBool IsValidHdr(const SDmaDesHdr* aHdr);
-#endif
-	__DMA_DECLARE_INVARIANT
-	};
-
-
-//////////////////////////////////////////////////////////////////////////////
-
-/**
-Single-buffer DMA channel.
-
-Can be instantiated or further derived by PSL.  Not
-intended to be instantiated by client device drivers.
-@publishedPartner
-@released
-*/
-
-class TDmaSbChannel : public TDmaChannel
-	{
-private:
-	virtual void DoQueue(DDmaRequest& aReq);
-	virtual void DoCancelAll();
-	virtual void DoDfc(DDmaRequest& aCurReq, SDmaDesHdr*& aCompletedHdr);
-private:
-	TBool iTransferring;
-	};
-
-
-/**
-Double-buffer DMA channel.
-
-Can be instantiated or further derived by PSL.  Not
-intended to be instantiated by client device drivers.
-@publishedPartner
-@released
-*/
-
-class TDmaDbChannel : public TDmaChannel
-	{
-private:
-	virtual void DoQueue(DDmaRequest& aReq);
-	virtual void DoCancelAll();
-	virtual void DoDfc(DDmaRequest& aCurReq, SDmaDesHdr*& aCompletedHdr);
-private:
-	enum { EIdle = 0, ETransferring, ETransferringLast } iState;
-	};
-
-
-/**
-Scatter-gather DMA channel.
-
-Can be instantiated or further derived by PSL.
-Not intended to be instantiated by client device drivers.
-@publishedPartner
-@released
-*/
-
-class TDmaSgChannel : public TDmaChannel
-	{
-private:
-	virtual void DoQueue(DDmaRequest& aReq);
-	virtual void DoCancelAll();
-	virtual void DoUnlink(SDmaDesHdr& aHdr);
-	virtual void DoDfc(DDmaRequest& aCurReq, SDmaDesHdr*& aCompletedHdr);
-private:
-	TBool iTransferring;
-	};
-
-
-//////////////////////////////////////////////////////////////////////////////
-// INTERFACE WITH TEST HARNESS
-//////////////////////////////////////////////////////////////////////////////
-
-/**
-Set of information used by test harness.
-@publishedPartner
-@released
-*/
-
-struct TDmaTestInfo
-	{
-	/** Maximum transfer size in bytes for all channels (ie. the minimum of all channels' maximum size)*/
-	TInt iMaxTransferSize;
-	/** 3->Memory buffers must be 4-byte aligned, 7->8-byte aligned, ... */
-	TUint iMemAlignMask;
-	/** Cookie to pass to DDmaRequest::Fragment for memory-memory transfer*/
-	TUint32 iMemMemPslInfo;
-	/** Number of test single-buffer channels */
-	TInt iMaxSbChannels;
-	/** Pointer to array containing single-buffer test channel ids */
-	TUint32* iSbChannels;
-	/** Number of test double-buffer channels */
-	TInt iMaxDbChannels;
-	/** Pointer to array containing double-buffer test channel ids */
-	TUint32* iDbChannels;
-	/** Number of test scatter-gather channels */
-	TInt iMaxSgChannels;
-	/** Pointer to array containing scatter-gather test channel ids */
-	TUint32* iSgChannels;
-	};
-
-
-/**
-Provides access to test information structure stored in the PSL.
-
-Must be implemented by the PSL.
-@publishedPartner
-@released
-*/
-
-IMPORT_C const TDmaTestInfo& DmaTestInfo();
-
-
-//////////////////////////////////////////////////////////////////////////////
-
-#include <drivers/dma_v1.inl>
-
-#endif
--- a/kernel/eka/include/drivers/dma_v1.inl	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +0,0 @@
-// 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 "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/drivers/dma_v1.inl
-// DMA framework public inline functions
-// This file should not be modified when porting the DMA framework to
-// new hardware.
-// TDmaChannel
-// 
-// WARNING: This file contains some APIs which are internal and are subject
-//          to change without noticed. Such APIs should therefore not be used
-//          outside the Kernel and Hardware Services package.
-//
-
-inline void TDmaChannel::Wait()
-	{
-	NKern::FMWait(&iLock);
-	}
-
-inline void TDmaChannel::Signal()
-	{
-	NKern::FMSignal(&iLock);
-	}
-
-inline TBool TDmaChannel::Flash()
-	{
-	return NKern::FMFlash(&iLock);
-	}
-
-inline TBool TDmaChannel::IsOpened() const
-	{
-	return iController != NULL;
-	}
-
-inline TBool TDmaChannel::IsQueueEmpty() const
-	{
-	return const_cast<TDmaChannel*>(this)->iReqQ.IsEmpty();
-	}
-
-inline TUint32 TDmaChannel::PslId() const
-	{
-	return iPslId;
-	}
-
-inline TInt TDmaChannel::FailNext(TInt /*aFragmentCount*/)
-	{
-	return iController->FailNext(*this);
-	}
-
-inline TInt TDmaChannel::MissNextInterrupts(TInt aInterruptCount)
-	{
-	return iController->MissNextInterrupts(*this, aInterruptCount);
-	}
-
-/** Function allowing platform-specific layer to extend API with new
-	channel-specific operations.
- 	@param aCmd Command identifier.  Negative values are reserved for Symbian use.
-	@param aArg PSL-specific
-	@return KErrNotSupported if aCmd is not supported.  PSL-specific value otherwise.
- */
-
-inline TInt TDmaChannel::Extension(TInt aCmd, TAny* aArg)
-	{
-	return iController->Extension(*this, aCmd, aArg);
-	}
-
-inline const TDmac* TDmaChannel::Controller() const
-	{
-	return iController;
-	}
-
-inline TInt TDmaChannel::MaxTransferSize(TUint aFlags, TUint32 aPslInfo)
-	{
-	return iController->MaxTransferSize(*this, aFlags, aPslInfo);
-	}
-
-inline TUint TDmaChannel::MemAlignMask(TUint aFlags, TUint32 aPslInfo)
-	{
-	return iController->MemAlignMask(*this, aFlags, aPslInfo);
-	}
-
-// DDmaRequest
-
-/** Called when request is removed from request queue in channel */
-
-inline void DDmaRequest::OnDeque()
-	{
-	iQueued = EFalse;
-	iLastHdr->iNext = NULL;
-	iChannel.DoUnlink(*iLastHdr);
-	}
-
-// TDmac
-
-inline void TDmac::Wait()
-	{
-	NKern::FMWait(&iLock);
-	}
-
-inline void TDmac::Signal()
-	{
-	NKern::FMSignal(&iLock);
-	}
-
-inline SDmaPseudoDes& TDmac::HdrToDes(const SDmaDesHdr& aHdr) const
-	{
-	return static_cast<SDmaPseudoDes*>(iDesPool)[&aHdr - iHdrPool];
-	}
-
-inline TAny* TDmac::HdrToHwDes(const SDmaDesHdr& aHdr) const
-	{
-	return static_cast<TUint8*>(iDesPool) + iDesSize*(&aHdr - iHdrPool);
-	}
-
-inline TUint32 TDmac::DesLinToPhys(TAny* aDes) const
-	{
-#ifdef __WINS__
-	(void)aDes;
-	return 0xDEADBEEF;
-#else
-	return iHwDesChunk->iPhysAddr + ((TLinAddr)aDes - iHwDesChunk->iLinAddr);
-#endif
-	}
-
-// DmaChannelMgr
-
-inline void DmaChannelMgr::Wait()
-	{
-	NKern::FMWait(&Lock);
-	}
-
-inline void DmaChannelMgr::Signal()
-	{
-	NKern::FMSignal(&Lock);
-	}
-
-//---
--- a/kernel/eka/include/drivers/dma_v2.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1332 +0,0 @@
-// 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""
-// 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/drivers/dma_v2.h
-// DMA Framework - Client API v2 definition.
-//
-// NB: DMA clients should never include this file directly, but only ever the
-// generic header file <drivers/dma.h>.
-//
-
-/** @file
-	@publishedPartner
-*/
-
-#ifndef __DMA_H__
-#error "dma_v2.h must'n be included directly - use <drivers/dma.h> instead"
-#endif	// #ifndef __DMA_H__
-
-#ifndef __DMA_V2_H__
-#define __DMA_V2_H__
-
-
-#include <kernel/kernel.h>
-#include <drivers/dmadefs.h>
-
-
-//////////////////////////////////////////////////////////////////////////////
-// Debug Support - KDmaPanicCat is defined in each source file
-
-#define __DMA_ASSERTD(e) __ASSERT_DEBUG(e, Kern::Fault(KDmaPanicCat, __LINE__))
-#define __DMA_ASSERTA(e) __ASSERT_ALWAYS(e, Kern::Fault(KDmaPanicCat, __LINE__))
-#ifdef _DEBUG
-#define __DMA_CANT_HAPPEN() Kern::Fault(KDmaPanicCat, __LINE__)
-#define __DMA_DECLARE_INVARIANT public: void Invariant();
-#define __DMA_DECLARE_VIRTUAL_INVARIANT public: virtual void Invariant();
-#define __DMA_INVARIANT() Invariant()
-#else
-#define __DMA_CANT_HAPPEN()
-#define __DMA_DECLARE_INVARIANT
-#define __DMA_DECLARE_VIRTUAL_INVARIANT
-#define __DMA_INVARIANT()
-#endif
-
-#ifdef __DMASIM__
-#ifdef __PRETTY_FUNCTION__
-#define __DMA_UNREACHABLE_DEFAULT() DMA_PSL_TRACE1("Calling default virtual: %s", __PRETTY_FUNCTION__)
-#else
-#define __DMA_UNREACHABLE_DEFAULT() DMA_PSL_TRACE("Calling default virtual function")
-#endif
-#else
-#define __DMA_UNREACHABLE_DEFAULT() __DMA_CANT_HAPPEN()
-#endif
-
-//////////////////////////////////////////////////////////////////////////////
-// INTERFACE EXPOSED TO DEVICE-DRIVERS
-//////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////////////////////////////////////////////////////
-
-/** Bitmasks used for configuring a DMA request.
-
-	In general, specify KDmaMemSrc|KDmaIncSrc (resp. KDmaMemDest|KDmaIncDest)
-	if the source (resp. destination) is a memory buffer and clear
-	KDmaMemSrc|KDmaIncSrc (resp. KDmaMemDest|KDmaIncDest) if the source
-	(resp. destination) is a peripheral.
-
-	If the location is given as a physical address (rather than a linear one)
-	then also specify KDmaPhysAddrSrc and/or KDmaPhysAddrDest.
-
-	The EKA1 "Fill Mode" can be implemented by omitting KDmaIncSrc.
-
-	Some peripherals may require a post-increment address mode.
-
-	@see DDmaRequest::Fragment()
-
-	Note: This enum is only required for backwards compatibility with the old
-	DMA framework, it can be removed once this is no longer needed.
-
-	@deprecated
-*/
-enum TDmaRequestFlags
-	{
-	/** Source is address of memory buffer */
-	KDmaMemSrc       = 0x01,
-	/** Destination is address of memory buffer */
-	KDmaMemDest      = 0x02,
-	/** Source address must be post-incremented during transfer */
-	KDmaIncSrc       = 0x04,
-	/** Destination address must be post-incremented during transfer */
-	KDmaIncDest      = 0x08,
-	/** Source address is a physical address (as opposed to a linear one) */
-	KDmaPhysAddrSrc  = 0x10,
-	/** Destination address is a physical address (as opposed to a linear one) */
-	KDmaPhysAddrDest = 0x20,
-	/** Request a different max transfer size (for instance for test purposes) */
-	KDmaAltTransferLen = 0x40
-	};
-
-
-/** Each hardware or pseudo descriptor is associated with a header.  Headers
-	are needed because hardware descriptors can not easily be extended to store
-	additional information.
-
-	@released
-*/
-struct SDmaDesHdr
-	{
-	SDmaDesHdr* iNext;
-	};
-
-
-/** Pointer to signature of the new extended callback function.
-
-	TUint       - bitmask of one or more TDmaCallbackType values
-	TDmaResult  - just that
-	TAny*       - was provided by client in DDmaRequest constructor
-	SDmaDesHdr* - points to header (and thus descriptor) which caused a
-	'descriptor completed' or 'descriptor paused' event
-
-	@released
- */
-typedef void (*TDmaCallback)(TUint, TDmaResult, TAny*, SDmaDesHdr*);
-
-
-class TDmaChannel;
-
-
-/** A DMA request is a list of fragments small enough to be transferred in one go
-	by the DMAC.
-
-	In general, fragmentation is done in the framework by calling Fragment() but
-	clients with special needs can allocate a blank descriptor list with
-	ExpandDesList() and customise it to fit their needs.
-
-	Clients should not set attributes directly, but should use the various functions
-	instead.
-
-	This class has not been designed to be called from several concurrent threads.
-	Multithreaded clients must implement their own locking scheme (via DMutex).
-
-	Mutexes are used internally to protect data structures accessed both by the
-	client thread and the DFC thread. Therefore no fast mutex can be held when
-	calling a request function.
-*/
-class DDmaRequest : public DBase
-	{
-	friend class TDmaChannel;
-
-public:
-	/** The outcome of the transfer
-
-		@see TDmaResult
-
-		@deprecated
-	*/
-	enum TResult {EBadResult=0, EOk, EError};
-
-	/** The signature of the completion/failure callback function
-
-		@see TDmaCallback
-
-		@deprecated
-	*/
-	typedef void (*TCallback)(TResult, TAny*);
-
-public:
-    /** Constructor.
-
-		Create a new transfer request.
-
-		@param aChannel The channel this request is bound to.
-		@param aCb Callback function called on transfer completion or failure
-		(in channel DFC context).  Can be NULL.
-		@param aCbArg   Argument passed to callback function.
-		@param aMaxTransferSize Maximum fragment size.  If not specified, defaults to the maximum size
-		supported by the DMA controller for the type of transfer that is later scheduled.
-
-		@deprecated
-    */
-	IMPORT_C DDmaRequest(TDmaChannel& aChannel, TCallback aCb=NULL, TAny* aCbArg=NULL,
-						 TInt aMaxTransferSize=0);
-
-
-	/** Constructor.
-
-		Create a new transfer request.
-
-		@param aChannel The channel this request is bound to.
-		@param aDmaCb Callback function called on transfer completion or
-		failure (in channel DFC or ISR context). Can be NULL.
-		@param aCbArg Argument passed to callback function.
-		@param aMaxTransferSize Maximum fragment size. If not specified,
-		defaults to the maximum size supported by the DMA controller for the
-		type of transfer that is later scheduled.
-
-		@released
-	*/
-	IMPORT_C DDmaRequest(TDmaChannel& aChannel, TDmaCallback aDmaCb,
-						 TAny* aCbArg=NULL, TUint aMaxTransferSize=0);
-
-
-	/** Destructor.
-
-		Assume the request is not being transferred or pending.
-
-		@released
-	*/
-	IMPORT_C ~DDmaRequest();
-
-
-	/** Split request into a list of fragments small enough to be fed to the
-		DMAC.
-
-		The size of each fragment is smaller than or equal to the maximum
-		transfer size supported by the DMAC. If the source and/or destination
-		is memory, each fragment points to memory which is physically
-		contiguous.
-
-		The kind of transfer to perform is specified via a set of flags used by
-		a PIL and a magic cookie passed to the PSL. If the source
-		(resp. destination) is a peripheral, aSrc (resp. aDest) is treated as a
-		magic cookie by the PIL and passed straight to the PSL.
-
-		The request can be uninitialised or may have been fragmented
-		previously. The previous configuration if any is lost whether or not
-		the function succeeds.
-
-		The client must ensure that any memory buffers involved in the transfer
-		have been suitably prepared for DMA. For memory allocated on the kernel
-		side or in a shared chunk this amounts to ensuring cache consistency
-		before Queue() is called. However for memory that was allocated on the
-		user side the client must also ensure that the memory is protected from
-		both data paging and RAM defragmentation before Fragment() is called
-		@see Kern::MapAndPinMemory(). Note however, that this function is only
-		available if the flexible memory model (FMM) is in use.
-
-		@param aSrc Source memory buffer linear address or peripheral magic
-		cookie.
-		@param aDest Destination memory buffer linear address or peripheral
-		magic cookie.
-		@param aCount Number of bytes to transfer.
-		@param aFlags Bitmask characterising the transfer.
-		@param aPslInfo Hardware-specific information passed to PSL.
-
-		@return KErrNone if success. KErrArgument if aFlags and/or aPslInfo are
-		invalid when finding the maximum transfer size. May also fail if
-		running out of descriptors.
-
-		@pre The request is not being transferred or pending.
-		@pre The various parameters must be valid. The PIL or PSL will fault the
-		kernel if not.
-
-		@see TDmaRequestFlags
-
-		@deprecated
-    */
-	IMPORT_C TInt Fragment(TUint32 aSrc, TUint32 aDest, TInt aCount, TUint aFlags, TUint32 aPslInfo);
-
-
-	/** New version of the DMA request fragment function, to be used with the
-		TDmaTransferArgs structure.
-
-		Split request into a list of fragments small enough to be fed to the
-		DMAC.
-
-		The size of each fragment is smaller than or equal to the maximum
-		transfer size supported by the DMAC. If the source and/or destination
-		is memory, each fragment points to memory which is physically
-		contiguous.
-
-		The request can be uninitialised or may have been fragmented
-		previously. Any previous configuration is lost whether or not the
-		function succeeds.
-
-		The client must ensure that any memory buffers involved in the transfer
-		have been suitably prepared for DMA. For memory allocated on the kernel
-		side or in a shared chunk this amounts to ensuring cache consistency
-		before Queue() is called. However for memory that was allocated on the
-		user side the client must also ensure that the memory is protected from
-		both data paging and RAM defragmentation before Fragment() is called
-		@see Kern::MapAndPinMemory(). Note however, that this function is only
-		available if the flexible memory model (FMM) is in use.
-
-		@param aTransferArgs Describes the transfer to be performed.
-
-		@return KErrNone if success. KErrArgument if certain arguments are
-		invalid. May also fail if running out of descriptors.
-
-		@pre The request is not being transferred or pending.
-		@pre The various parameters must be valid. The PIL or PSL will fault
-		the kernel if not.
-
-		@released
-	*/
-	IMPORT_C TInt Fragment(const TDmaTransferArgs& aTransferArgs);
-
-
-	/** Transfer asynchronously this request.
-
-		If this request's channel is idle, the request is transferred
-		immediately. Otherwise, it is queued and transferred later.
-
-		The client is responsible for ensuring cache consistency before and/or
-		after the transfer if necessary.
-
-		@return KErrNone if success, KErrGeneral otherwise.
-
-		@released
-	*/
-	IMPORT_C TInt Queue();
-
-
-	/** Append new descriptor(s) to existing list.
-
-		Clients needing to build a custom descriptor list should call this
-		function to allocate the list and access the resulting list through
-		iFirstHdr and iLastHdr.
-
-		Clients should not change the value of iFirstHdr, iLastHdr and the
-		iNext field of the descriptor headers to ensure descriptors can be
-		deallocated. Clients are free to change hardware descriptors, including
-		chaining, in whatever way suit them.
-
-		Assume the request is not being transferred or pending.
-
-		@param aCount Number of descriptors to append.
-
-		@return KErrNone or standard error code.
-
-		@released
-	*/
-	IMPORT_C TInt ExpandDesList(TInt aCount=1);
-
-
-	/** Append new descriptor(s) to existing list. This function variant
-		operates on the source port descriptor chain.
-
-		Works like ExpandDesList except that it uses the iSrcFirstHdr and
-		iSrcLastHdr fields.
-
-		@see ExpandDesList()
-
-		This function should only be used if SDmacCaps::iAsymHwDescriptors is
-		reported as true, as only then the framework will actually use the
-		allocated descriptors.
-
-		@param aCount Number of descriptors to append.
-
-		@return KErrNone or standard error code.
-
-		@prototype
-	*/
-	IMPORT_C TInt ExpandSrcDesList(TInt aCount=1);
-
-
-	/** Append new descriptor(s) to existing list. This function variant
-		operates on the destination port descriptor chain.
-
-		Works like ExpandDesList except that it uses the iDstFirstHdr and
-		iDstLastHdr fields.
-
-		@see ExpandDesList()
-
-		This function should only be used if SDmacCaps::iAsymHwDescriptors is
-		reported as true, as only then the framework will actually use the
-		allocated descriptors.
-
-		@param aCount Number of descriptors to append.
-
-		@return KErrNone or standard error code.
-
-		@prototype
-	*/
-	IMPORT_C TInt ExpandDstDesList(TInt aCount=1);
-
-
-	/** Free resources associated with this request.
-
-		Assumes the request is not being transferred or pending.
-
-		@see ExpandDesList()
-
-		@released
-	*/
-	IMPORT_C void FreeDesList();
-
-
-	/** Free resources associated with this request. This function variant
-		operates on the source port descriptor chain.
-
-		Assumes the request is not being transferred or pending.
-
-		@see ExpandSrcDesList()
-
-		@prototype
-	*/
-	IMPORT_C void FreeSrcDesList();
-
-
-	/** Free resources associated with this request. This function variant
-		operates on the destination port descriptor chain.
-
-		Assumes the request is not being transferred or pending.
-
-		@see ExpandDstDesList()
-
-		@prototype
-	*/
-	IMPORT_C void FreeDstDesList();
-
-
-	/** Enables the functionality for counting the transferred source
-		elements.
-
-		This function can be called at any time, but the enabled/disabled
-		status is checked by the framework only at two points in time.
-
-		The first one is after a request has been queued, and if it is enabled
-		then the counting will commence as soon as the transfer starts.
-
-		The second point is when Resume() is called for a paused transfer, and
-		in this case the following applies. If counting was enabled when the
-		transfer was paused and it is now disabled then the counting is stopped
-		at that point and the count value frozen. If counting was disabled when
-		the transfer was paused and it is now enabled then the counting will
-		commence when the transfer resumes. (The starting value will depend on
-		the argument of the enable function.) Otherwise nothing will change,
-		i.e. counting will either continue normally (enabled/enabled) or
-		neither stop nor continue (disabled/disabled).
-
-		Once a status has been set, it remains valid for the entire duration of
-		the transfer (and beyond, if it is not changed again).
-
-		@param aResetElementCount If ETrue (the default) then the count
-		variable will be reset to zero, otherwise it will retain its current
-		value.
-
-		@see Queue()
-		@see TotalNumSrcElementsTransferred()
-
-		@prototype
-	*/
-	IMPORT_C void EnableSrcElementCounting(TBool aResetElementCount=ETrue);
-
-
-	/** Enables the functionality for counting the transferred destination
-		elements.
-
-		This function can be called at any time, but the enabled/disabled
-		status is checked by the framework only at two points in time.
-
-		The first one is after a request has been queued, and if it is enabled
-		then the counting will commence as soon as the transfer starts.
-
-		The second point is when Resume() is called for a paused transfer, and
-		in this case the following applies. If counting was enabled when the
-		transfer was paused and it is now disabled then the counting is stopped
-		at that point and the count value frozen. If counting was disabled when
-		the transfer was paused and it is now enabled then the counting will
-		commence when the transfer resumes. (The starting value will depend on
-		the argument of the enable function.) Otherwise nothing will change,
-		i.e. counting will either continue normally (enabled/enabled) or
-		neither stop nor continue (disabled/disabled).
-
-		Once a status has been set, it remains valid for the entire duration of
-		the transfer (and beyond, if it is not changed again).
-
-		@param aResetElementCount If ETrue (the default) then the count
-		variable will be reset to zero, otherwise it will retain its current
-		value.
-
-		@see Queue()
-		@see TotalNumDstElementsTransferred()
-
-		@prototype
-	*/
-	IMPORT_C void EnableDstElementCounting(TBool aResetElementCount=ETrue);
-
-
-	/** Disables the functionality for counting the transferred source
-		elements.
-
-		This function can be called at any time, but the enabled/disabled
-		status is checked by the framework only at two points in time.
-
-		The first one is after a request has been queued, and if it is enabled
-		then the counting will commence as soon as the transfer starts.
-
-		The second point is when Resume() is called for a paused transfer, and
-		in this case the following applies. If counting was enabled when the
-		transfer was paused and it is now disabled then the counting is stopped
-		at that point and the count value frozen. If counting was disabled when
-		the transfer was paused and it is now enabled then the counting will
-		commence when the transfer resumes. (The starting value will depend on
-		the argument of the enable function.) Otherwise nothing will change,
-		i.e. counting will either continue normally (enabled/enabled) or
-		neither stop nor continue (disabled/disabled).
-
-		Once a status has been set, it remains valid for the entire duration of
-		the transfer (and beyond, if it is not changed again).
-
-		@see Queue()
-		@see TotalNumSrcElementsTransferred()
-
-		@prototype
-	*/
-	IMPORT_C void DisableSrcElementCounting();
-
-
-	/** Disables the functionality for counting the transferred destination
-		elements.
-
-		This function can be called at any time, but the enabled/disabled
-		status is checked by the framework only at two points in time.
-
-		The first one is after a request has been queued, and if it is enabled
-		then the counting will commence as soon as the transfer starts.
-
-		The second point is when Resume() is called for a paused transfer, and
-		in this case the following applies. If counting was enabled when the
-		transfer was paused and it is now disabled then the counting is stopped
-		at that point and the count value frozen. If counting was disabled when
-		the transfer was paused and it is now enabled then the counting will
-		commence when the transfer resumes. (The starting value will depend on
-		the argument of the enable function.) Otherwise nothing will change,
-		i.e. counting will either continue normally (enabled/enabled) or
-		neither stop nor continue (disabled/disabled).
-
-		Once a status has been set, it remains valid for the entire duration of
-		the transfer (and beyond, if it is not changed again).
-
-		@see Queue()
-		@see TotalNumDstElementsTransferred()
-
-		@prototype
-	*/
-	IMPORT_C void DisableDstElementCounting();
-
-
-	/** Returns the number of elements that have been transferred by this
-		transfer request at the source port.
-
-		To use this method, the counting functionality has to be explicitly
-		enabled, either before the transfer request is queued or while it is
-		paused.
-
-		@see EnableSrcElementCounting()
-		@see DisableSrcElementCounting()
-
-		This function should only be called after the transfer has finished
-		(completed with or without error, or because it was cancelled) or while
-		it is paused. Otherwise it may just return 0.
-
-		@return The number of elements that have been transferred by this
-		transfer request at the source port.
-
-		@prototype
-	*/
-	IMPORT_C TUint32 TotalNumSrcElementsTransferred();
-
-
-	/** Returns the number of elements that have been transferred by this
-		transfer request at the destination port.
-
-		To use this method, the counting functionality has to be explicitly
-		enabled, either before the transfer request is queued or while it is
-		paused.
-
-		@see EnableDstElementCounting()
-		@see DisableDstElementCounting()
-
-		This function should only be called after the transfer has finished
-		(completed with or without error, or because it was cancelled) or while
-		it is paused. Otherwise it may just return 0.
-
-		@return The number of elements that have been transferred by this
-		transfer request at the destination port.
-
-		@prototype
-	*/
-	IMPORT_C TUint32 TotalNumDstElementsTransferred();
-
-
-	/** Returns the number of fragments that this transfer request has been
-		split into.
-
-		This number will only be different from 0 once Fragment() has been
-		called or after descriptors have been manually allocated by the client
-		using ExpandDesList().
-
-		If SDmacCaps::iAsymHwDescriptors is true then this function will always
-		return 0, and SrcFragmentCount() / DstFragmentCount() should be used
-		instead.
-
-		@return The number of fragments (descriptors / pseudo descriptors) that
-		this transfer request has been split into.
-
-		@released
-	*/
-	IMPORT_C TInt FragmentCount();
-
-
-	/** Returns the number of source port fragments that this transfer request
-		has been split into.
-
-		This number will only be different from 0 once Fragment() has been
-		called or after descriptors have been manually allocated by the client
-		using ExpandSrcDesList().
-
-		This function can only be used if SDmacCaps::iAsymHwDescriptors is
-		true, otherwise it will always return 0.
-
-		@return The number of source port fragments (descriptors) that this
-		transfer request has been split into.
-
-		@prototype
-	*/
-	IMPORT_C TInt SrcFragmentCount();
-
-
-	/** Returns the number of destination port fragments that this transfer
-		request has been split into.
-
-		This number will only be different from 0 once Fragment() has been
-		called or after descriptors have been manually allocated by the client
-		using ExpandDstDesList().
-
-		This function can only be used if SDmacCaps::iAsymHwDescriptors is
-		true, otherwise it will always return 0.
-
-		@return The number of destination port fragments (descriptors) that
-		this transfer request has been split into.
-
-		@prototype
-	*/
-	IMPORT_C TInt DstFragmentCount();
-
-private:
-	inline void OnDeque();
-	TInt CheckTransferConfig(const TDmaTransferConfig& aTarget, TUint aCount) const;
-	TInt CheckMemFlags(const TDmaTransferConfig& aTarget) const;
-	TInt AdjustFragmentSize(TUint& aFragSize, TUint aElementSize, TUint aFrameSize);
-	TUint GetTransferCount(const TDmaTransferArgs& aTransferArgs) const;
-	TUint GetMaxTransferlength(const TDmaTransferArgs& aTransferArgs, TUint aCount) const;
-	TInt Frag(TDmaTransferArgs& aTransferArgs);
-	TInt FragSym(TDmaTransferArgs& aTransferArgs, TUint aCount, TUint aMaxTransferLen);
-	TInt FragAsym(TDmaTransferArgs& aTransferArgs, TUint aCount, TUint aMaxTransferLen);
-	TInt FragAsymSrc(TDmaTransferArgs& aTransferArgs, TUint aCount, TUint aMaxTransferLen);
-	TInt FragAsymDst(TDmaTransferArgs& aTransferArgs, TUint aCount, TUint aMaxTransferLen);
-	TInt FragBalancedAsym(TDmaTransferArgs& aTransferArgs, TUint aCount, TUint aMaxTransferLen);
-	TInt ExpandDesList(TInt aCount, TInt& aDesCount, SDmaDesHdr*& aFirstHdr,
-					   SDmaDesHdr*& aLastHdr);
-	void FreeDesList(TInt& aDesCount, SDmaDesHdr*& aFirstHdr, SDmaDesHdr*& aLastHdr);
-	TInt FragmentCount(const SDmaDesHdr* aHdr);
-
-public:
-	// WARNING: The following attributes are accessed both in client and DFC
-	// thread context, so accesses must be protected with the channel lock.
-	TDmaChannel& iChannel;		/**< The channel this request is bound to */
-	TCallback iCb;			 /**< Called on completion/failure (can be NULL) */
-	TAny* iCbArg;			 /**< Callback argument */
-	TDmaCallback iDmaCb;		// the new-style callback function
-	TAny* iDmaCbArg;			// the new-style callback arg
-	TBool iIsrCb;				// client wants callback in ISR context
-	TInt iDesCount;			   /**< The number of fragments in list */
-	SDmaDesHdr* iFirstHdr;	   /**< The first fragment in the list (or NULL) */
-	SDmaDesHdr* iLastHdr;	   /**< The last fragment in the list (or NULL) */
-	TInt iSrcDesCount;		   /**< The number of fragments in list */
-	SDmaDesHdr* iSrcFirstHdr;  /**< The first fragment in the list (or NULL) */
-	SDmaDesHdr* iSrcLastHdr;   /**< The last fragment in the list (or NULL) */
-	TInt iDstDesCount;		   /**< The number of fragments in list */
-	SDmaDesHdr* iDstFirstHdr;  /**< The first fragment in the list (or NULL) */
-	SDmaDesHdr* iDstLastHdr;   /**< The last fragment in the list (or NULL) */
-	SDblQueLink iLink;			/**< The link on channel queue of pending requests */
-	TBool iQueued;				/**< Indicates whether request is pending or being transferred */
-	TUint iMaxTransferSize;		/**< Defaults to DMA controller max. transfer size */
-
-	TUint32 iTotalNumSrcElementsTransferred;
-	TUint32 iTotalNumDstElementsTransferred;
-
-	__DMA_DECLARE_INVARIANT
-	};
-
-
-//////////////////////////////////////////////////////////////////////////////
-
-class TDmac;
-class DmaChannelMgr;
-class TDmaCancelInfo;
-
-/** DMA channel base class.
-
-	Standard derived classes are provided for this channel (see
-	TDmaSbChannel, TDmaDbChannel, TDmaSgChannel, and TDmaAsymSgChannel).
-	The base-port implementor will only need to write their own derived
-	class if one of the standard classes is unsuitable.
-
-	This class has not been designed to be called from several concurrent
-	client threads. Multithreaded clients must implement their own locking
-	scheme (via DMutex).
-
-	Mutexes are used internally to protect data structures accessed both by the
-	client thread and the DFC one. Therefore no fast mutex can be held when
-	calling a channel function.
-*/
-class TDmaChannel
-	{
-	friend class DDmaRequest;
-	friend class TDmac;
-	friend class DmaChannelMgr;
-
-public:
-	/** Information passed by client when opening a channel. */
-	struct SCreateInfo
-		{
-		/** Default constructor. Initializes all fields with meaningful default
-			values.
-
-			Must be inline (for now) because exporting it would break existing
-			custom DMA libs as their clients would need the export which would
-			be missing from the custom .def files.
-
-			@released
-		*/
-		SCreateInfo() : iPriority(KDmaPriorityNone), iDynChannel(EFalse) {};
-
-		/** Identifier used by PSL to select channel to open.
-
-			@released
-		*/
-		TUint32 iCookie;
-		/** Number of descriptors this channel can maximally use.
-
-			This value will not be used in the fully implemented new version of
-			the DMA framework. Until then it is still required.
-
-			@released
-		*/
-		TInt iDesCount;
-		/** DFC queue used to service DMA interrupts.
-
-			@released
-		*/
-		TDfcQue* iDfcQ;
-		/** DFC priority.
-
-			@released
-		*/
-		TUint8 iDfcPriority;
-		/** Used by PSL to configure a channel priority (if possible).
-
-			The default is KDmaPriorityNone (the don't care value).
-
-			@see TDmaPriority
-
-			@prototype
-		*/
-		TUint iPriority;
-		/** Request a dynamic DMA channel.
-
-			If this is set to ETrue then the Open call is for a 'dynamic' as
-			opposed to a static and solely owned DMA channel. A number of
-			properties of the opened TDmaChannel object will be different in
-			that case.
-
-			The default value is EFalse.
-
-			@prototype
-		 */
-		TBool iDynChannel;
-		};
-
-public:
-	/** Opens the DMA channel.
-
-		Channel selection is done by the hardware-specific layer using a cookie
-		passed in via aInfo.
-
-		The client should not delete the returned pointer as the framework owns
-		channel objects. However, the client should explicitly close the
-		channel when finished with it.
-
-		@param aInfo Information passed by caller to select and configure
-		channel.
-
-		@param aChannel Points to open channel on successful return. NULL
-		otherwise.
-
-		@return KErrNone or standard error code.
-
-		@released
-	*/
-	IMPORT_C static TInt Open(const SCreateInfo& aInfo, TDmaChannel*& aChannel);
-
-
-	/** Closes a previously opened DMA channel.
-
-		Assumes the channel is idle and all requests have been deleted.
-
-		The call will cause the resources associated with this channel to be
-		released, and the pointer/reference to it mustn't therefore be accessed
-		any longer after the function has returned. The channel pointer should
-		be set to NULL by the client.
-
-		@released
- 	*/
-	IMPORT_C void Close();
-
-
-	/** Logically links this channel to the one specified as an argument, or,
-		if the argument is NULL, unlinks this channel.
-
-		The effect of channel linking is that once a transfer on this channel
-		has finished, instead of causing the associated client callback to be
-		called, 'aChannel' will be enabled by hardware and a preconfigured
-		transfer on that channel will start.
-
-		Note that conceptually 'linking' here always refers to the end of a
-		channel transfer, not the beginning, i.e. a channel can only be linked
-		once and always to a successor, never twice or to a predecessor. (This
-		does not preclude the possibility that two channels are linked in a
-		circular fashion.)
-
-		This function can only be used if the DMAC supports logical channel
-		linking.
-
-		@see SDmacCaps::iChannelLinking
-
-		@param aChannel Points to the channel this one should be linked to, or
-		NULL if this channel is to be unlinked from any other one.
-
-		@return KErrNone if the channel has been linked or unlinked
-		successfully, KErrCompletion if this channel was already linked to
-		aChannel or already unlinked, KErrNotSupported if the DMAC doesn't
-		support channel linking, KErrArgument if this channel was already
-		linked to a different channel, KErrGeneral if a general error occurred
-		preventing a successful outcome.
-
-		@prototype
-	*/
-	IMPORT_C TInt LinkToChannel(TDmaChannel* aChannel);
-
-
-	/** Pauses an active transfer on this channel.
-
-		A paused channel transfer can be resumed by calling Resume() or it can
-		be stopped altogether by calling CancelAll().
-
-		@see TDmaChannel::Resume()
-
-		Function can only be used if the DMAC supports this functionality.
-
-		@see SDmacCaps::iChannelPauseAndResume
-
-		@return KErrNone if a transfer has been paused successfully,
-		KErrCompletion if a transfer was already paused, KErrNotSupported if
-		the DMAC doesn't support channel transfer pausing/resuming, KErrGeneral
-		if a general error occurred preventing a successful outcome.
-
-		@released
-	*/
-	IMPORT_C TInt Pause();
-
-
-	/** Resumes a transfer on this channel that is paused.
-
-		Resume() can be called to resume channel operation when the transfer is
-		paused as a result of a previous call to Pause() or because the DMAC
-		has encountered a Pause bit in a H/W descriptor.
-
-		@see TDmaChannel::Pause()
-		@see TDmaCallbackType::EDmaCallbackLinkedListPaused
-
-		Function can only be used if the DMAC supports this functionality.
-
-		@see SDmacCaps::iChannelPauseAndResume
-		@see SDmacCaps::iLinkedListPausedInterrupt
-
-		@return KErrNone if a paused transfer has been resumed successfully,
-		KErrCompletion if there was no paused transfer, KErrNotSupported if the
-		DMAC doesn't support channel transfer pausing/resuming, KErrGeneral if
-		a general error occurred preventing a successful outcome.
-
-		@released
-	*/
-	IMPORT_C TInt Resume();
-
-
-	/** Cancels the current request and all the pending ones.
-
-		@released
-	*/
-	IMPORT_C void CancelAll();
-
-
-	/** Returns the channel's maximum transfer length based on the passed
-		arguments.
-
-		@param aSrcFlags Bitmask characterising transfer source
-		@see TDmaTransferArgs::iSrcConfig::iFlags
-
-		@param aDstFlags Bitmask characterising transfer destination
-		@see TDmaTransferArgs::iDstConfig::iFlags
-
-		@param aPslInfo Cookie passed to the PSL
-		@see TDmaTransferArgs::iPslRequestInfo
-
-		@return 0 if transfer length is not limited, the maximum transfer
-		length in bytes otherwise.
-
-		@released
- 	*/
-	IMPORT_C TUint MaxTransferLength(TUint aSrcFlags, TUint aDstFlags, TUint32 aPslInfo);
-
-
-	/** Retrieves from the PSL the address / memory alignment mask based on the
-		parameters passed. Some DMA controllers impose alignment constraints on
-		the base address of memory buffers. This mask is AND'ed against memory
-		addresses computed during fragmentation.
-
-		This function needs to be called separately for source and destination.
-
-		@param aTargetFlags Bitmask characterising transfer source or
-		destination
-		@see TDmaTransferArgs::iSrcConfig::iFlags
-		@see TDmaTransferArgs::iDstConfig::iFlags
-
-		@param aElementSize Element size used for the transfer. Can be zero if
-		not known or 'don't care'.
-
-		@param aPslInfo Cookie passed to the PSL
-		@see TDmaTransferArgs::iPslRequestInfo
-
-		@return A value representing the alignment mask (e.g. 3 if buffer must
-		be 4-byte aligned)
-
-		@released
-	*/
-	IMPORT_C TUint AddressAlignMask(TUint aTargetFlags, TUint aElementSize,
-									TUint32 aPslInfo);
-
-
-	/** Returns a reference to a structure containing the capabilities and
-		features of the DMA controller associated with this channel.
-
-		@return A reference to a structure containing the capabilities and
-		features of the DMA controller associated with this channel.
-
-		@released
-	*/
-	IMPORT_C const SDmacCaps& DmacCaps();
-
-
-	/** Sets up once more the transfer request that has just completed, after
-		optionally having adjusted the transfer parameters as specified.
-
-		This function is meant to be called exclusively from a client-supplied
-		callback that is executed in ISR context, and only in response to a
-		transfer completion notification.
-
-		If this call returns to the caller with KErrNone then the framework's
-		ISR handler will subsequently not queue the channel DFC for this
-		completed request.
-
-		The parameters specify which changes the framework should apply to the
-		descriptors of the transfer request before rescheduling it. Arguments
-		for which no change is required should be passed as their default
-		values. The parameters correspond to those in the TDmaTransferArgs
-		struct as follows.
-
-		@param aSrcAddr @see TDmaTransferArgs::iSrcConfig::iAddr
-		@param aDstAddr @see TDmaTransferArgs::iDstConfig::iAddr
-		@param aTransferCount @see TDmaTransferArgs::iTransferCount
-		@param aPslRequestInfo @see TDmaTransferArgs::iPslRequestInfo
-		@param aIsrCb If set to ETrue (the default) then the callback of the
-		rescheduled request will again be called in ISR context
-
-		Since Epoc::LinearToPhysical() cannot be called in ISR context the
-		addresses passed into this function must be physical ones, i.e.
-		TDmaTransferFlags::KDmaPhysAddr is implied.
-
-		If an address refers to a memory target then
-		TDmaTransferFlags::KDmaMemIsContiguous is implied as well as no
-		fragmentation is possible at this point.
-
-		@pre Must only be called from a 'transfer complete' client callback in
-		ISR context.
-
-		@post Framework won't queue the channel DFC for the completed request
-		in success case.
-
-		@see DDmaRequest::DDmaRequest(TDmaChannel&, TDmaCallback, TAny*, TUint)
-		@see TDmaCallbackType::EDmaCallbackRequestCompletion
-		@see TDmaPILFlags::KDmaRequestCallbackFromIsr
-
-		@return KErrGeneral if there was an error, KErrNone otherwise.
-
-		@released
-	*/
-	IMPORT_C TInt IsrRedoRequest(TUint32 aSrcAddr=KPhysAddrInvalid,
-								 TUint32 aDstAddr=KPhysAddrInvalid,
-								 TUint aTransferCount=0,
-								 TUint32 aPslRequestInfo=0,
-								 TBool aIsrCb=ETrue);
-
-
-	/** Tests whether the channel is currently opened.
-
-		@return ETrue if channel is currently opened, EFalse otherwise.
-
-		NB: This API should not be used any longer.
-
-		After calling TDmaChannel::Open() successfully the channel is
-		guaranteed to be open, hence there seems no good reason for this API to
-		exist.
-
-		@deprecated
-	*/
-	inline TBool IsOpened() const;
-
-
-	/** Tests whether the channel's request queue is currently empty.
-
-		@return ETrue if request queue is currently empty, EFalse otherwise.
-
-		@released
-	*/
-	inline TBool IsQueueEmpty() const;
-
-
-	/** Returns a PSL-specific value which uniquely identifies this channel -
-		it is used for debug tracing by the PIL.
-
-		@return PSL-specific value which uniquely identifies this channel.
-
-		@released
-	*/
-	inline TUint32 PslId() const;
-
-
-	/** Called by a test harness to force an error when the next fragment is
-		transferred.
-
-		@param aFragmentCount The number of consecutive fragments to fail
-
-		@released
-	*/
-	IMPORT_C TInt FailNext(TInt aFragmentCount);
-
-
-	/** Called by a test harness to force the DMA controller to miss one or
-		more interrupts.
-
-		@param aInterruptCount The number of consecutive interrupts to miss
-
-		@released
-	*/
-	IMPORT_C TInt MissNextInterrupts(TInt aInterruptCount);
-
-
-	/** Function allowing platform-specific layer to extend channel API with
-		new channel-specific operations.
-
-		@param aCmd Command identifier.
-		@param aArg PSL-specific argument
-
-		@return KErrNotSupported if aCmd is not supported. PSL-specific value
-		otherwise.
-
-		@released
-	*/
-	IMPORT_C TInt Extension(TInt aCmd, TAny* aArg);
-
-
-	/** This is a function that allows the Platform Specific Layer (PSL) to
-		extend the DMA API with new channel-independent operations.
-
-		@param aCmd Command identifier.
-		@param aArg PSL-specific.
-
-		@return KErrNotSupported if aCmd is not supported; a PSL specific value
-		otherwise.
-
-		@released
- 	*/
-	IMPORT_C TInt StaticExtension(TInt aCmd, TAny* aArg);
-
-
-	/** @see DmacCaps()
-
-		@deprecated
-	*/
-	inline const TDmac* Controller() const;
-
-	/** @see MaxTransferLength()
-
-		@deprecated
-	*/
-	inline TInt MaxTransferSize(TUint aFlags, TUint32 aPslInfo);
-
-	/** @see AddressAlignMask()
-
-		@deprecated
-	*/
-	inline TUint MemAlignMask(TUint aFlags, TUint32 aPslInfo);
-
-protected:
-	// Interface with state machines
-
-	/** Constructor.
-
-		@released
-	*/
-	TDmaChannel();
-
-	/** Called by the PIL when adding a new request to the channel's queue.
-		The implementation should update the channel's state as appropriate
-		and begin transfer of aReq if possible.
-
-		@param aReq The request which has been added to the queue
-
-		@released
-	*/
-	virtual void DoQueue(const DDmaRequest& aReq);
-
-	/** Called by the PIL in response to a CancelAll call. It should update
-		the channel state appropriately.
-
-		@released
-	*/
-	virtual void DoCancelAll() = 0;
-
-	/** This is called by the PIL when a DDmaRequest is removed from the
-		channel's queue. In general the implementation simply needs to unlink
-		the hardware descriptor corresponding to aHdr from the next.
-
-		Since the PIL links the hardware descriptor chains of adjacent queued
-		requests (for speed) it is necessary to break the chain when a request
-		is completed so that the request may be requeued by the client without
-		having called DDmaRequest::Fragment again.
-
-		@param aHdr The header for a descriptor, which must be unlinked
-		from its next descriptor (if there is one)
-
-		@released
-	*/
-	virtual void DoUnlink(SDmaDesHdr& aHdr);
-
-	/** Called by the PIL whenever a transfer associated with aCurReq is
-		done. The implementation must advance the channel's state and
-		may transfer the next header if necessary (the provided
-		scatter-gather channel does not do this). It must also report
-		back which header was associated with the last transfer to
-		complete.
-
-		@param aCurReq The current request.
-		@param aCompletedHdr Must be set by the implementation to the header
-		of the last transfer to complete.
-
-		@released
-	*/
-	virtual void DoDfc(const DDmaRequest& aCurReq, SDmaDesHdr*& aCompletedHdr);
-
-	/** Called by the PIL whenever a transfer associated with aCurReq is
-		done. The implementation must advance the channel's state and
-		may start the transfer for the next headers if necessary (the
-		provided scatter-gather channels do not do this). If one
-		header has a successor but the other is the last in the chain it
-		is an error.
-
-		@note Must be implemented by PSL if channel uses asymmetric hardware
-		descriptors and is not derived from TDmaAsymSgChannel.
-
-		@param aCurReq The current request.
-
-		@param aSrcCompletedHdr Must be set by the implementation to
-		the header of the last source descriptor to complete.
-
-		@param aDstCompletedHdr Must be set by the implementation to
-		the header of the last destination descriptor to complete.
-
-		@prototype
-	*/
-	virtual void DoDfc(const DDmaRequest& aCurReq, SDmaDesHdr*& aSrcCompletedHdr,
-					   SDmaDesHdr*& aDstCompletedHdr);
-
-	/** This function allows the Platform Specific Layer (PSL) to control the
-		power management of the channel or its controller by overriding the
-		PIL's default implementation (which does nothing) and making
-		appropriate use of the Power Resource Manager (PRM).
-
-		The function gets called by the PIL whenever the channel's queued
-		requests count has changed in a significant way, either before the
-		channel's Transfer() method is invoked for a request on a previously
-		empty request queue, or immediately after the request count has become
-		zero because of request cancellation or completion.
-
-		Depending on the current and previous observed values of
-		iQueuedRequests, the PSL may power down or power up the channel.
-
-		Note that iQueuedRequests gets accessed and changed by different
-		threads, so the PSL needs to take the usual precautions when evaluating
-		the variable's value. Also, due to the multithreaded framework
-		architecture, there is no guarantee that the function calls always
-		arrive at the PSL level in the strict chronological order of
-		iQueuedRequests being incremented/decremented in the PIL, i.e. it might
-		happen that the PSL finds iQueuedRequests to have the same value in two
-		or more consecutive calls (that's why the previous observed value needs
-		to be locally available and taken into account). It is however promised
-		that before any actual transfer commences the PSL will find the request
-		count to be greater than zero and that after the last request has
-		finished it will be found to be zero.
-
-		None of the internal DMA framework mutexes is being held by the PIL
-		when calling this function.
-
-		Here is an example implementation for a derived channel class:
-
-		@code
-
-		class TFooDmaChannel : public TDmaSgChannel
-			{
-			DMutex* iDmaMutex;
-			TInt iPrevQueuedRequests;
-			virtual void QueuedRequestCountChanged();
-			};
-
-		void TFooDmaChannel::QueuedRequestCountChanged()
-			{
-			Kern::MutexWait(*iDmaMutex);
-			const TInt queued_now = __e32_atomic_load_acq32(&iQueuedRequests);
-			if ((queued_now > 0) && (iPrevQueuedRequests == 0))
-				{
-				IncreasePowerCount(); // Base port specific
-				}
-			else if ((queued_now == 0) && (iPrevQueuedRequests > 0))
-				{
-				DecreasePowerCount(); // Base port specific
-				}
-			iPrevQueuedRequests = queued_now;
-			Kern::MutexSignal(*iDmaMutex);
-			}
-
-		@endcode
-
-		@see iQueuedRequests
-	*/
-	virtual void QueuedRequestCountChanged();
-
-	virtual void SetNullPtr(const DDmaRequest& aReq);
-	virtual void ResetNullPtr();
-
-	inline virtual ~TDmaChannel() {}
-
-	inline void Wait();
-	inline void Signal();
-	inline TBool Flash();
-
-private:
-	static void Dfc(TAny*);
-	void DoDfc();
-
-protected:
-	TDmac* iController;		 // DMAC this channel belongs to (NULL when closed)
-	const SDmacCaps* iDmacCaps;	// what is supported by DMAC on this channel
-	TUint32 iPslId;			 // unique identifier provided by PSL
-	TBool iDynChannel;		 // this is a dynamically allocated channel
-	TUint iPriority;		 // hardware priority of this channel
-	NFastMutex iLock;		 // for data accessed in both client & DFC context
-	SDmaDesHdr* iCurHdr;	 // fragment being transferred or NULL
-	SDmaDesHdr** iNullPtr;	 // Pointer to NULL pointer following last fragment
-	TDfc iDfc;				 // transfer completion/failure DFC
-	TInt iMaxDesCount;		 // maximum number of allocable descriptors
-	TInt iAvailDesCount;	 // available number of descriptors
-	volatile TUint32 iIsrDfc; // Interface between ISR and DFC:
-	enum {KErrorFlagMask = 0x80000000};	   // bit 31 - error flag
-	enum {KCancelFlagMask = 0x40000000};   // bit 30 - cancel flag
-	enum {KDfcCountMask = 0x3FFFFFFF};	   // bits 0-29 - number of queued DFCs
-	SDblQue iReqQ;			// being/about to be transferred request queue
-	TInt iReqCount;			// number of requests attached to this channel
-	TInt iQueuedRequests; 	// number of requests currently queued on this channel
-	TBool iCallQueuedRequestFn;	// call QueuedRequestCountChanged? (default: true)
-
-private:
-	TDmaCancelInfo* iCancelInfo; // ...
-	TBool iRedoRequest;		// client ISR callback wants a redo of request
-	TBool iIsrCbRequest;	// request on queue using ISR callback
-
-	__DMA_DECLARE_VIRTUAL_INVARIANT
-	};
-
-
-//////////////////////////////////////////////////////////////////////////////
-// INTERFACE WITH TEST HARNESS
-//////////////////////////////////////////////////////////////////////////////
-
-/** Provides access to test information structure stored in the PSL.
-
-	Must be implemented by the PSL (v1).
-
-	@deprecated
-*/
-IMPORT_C const TDmaTestInfo& DmaTestInfo();
-
-
-/** Provides access to test information structure stored in the PSL.
-
-	Must be implemented by the PSL (v2).
-
-	@released
-*/
-IMPORT_C const TDmaV2TestInfo& DmaTestInfoV2();
-
-
-//////////////////////////////////////////////////////////////////////////////
-
-
-#include <drivers/dma_compat.inl>
-#include <drivers/dma_v2.inl>
-
-
-#endif	// #ifndef __DMA_V2_H__
--- a/kernel/eka/include/drivers/dma_v2.inl	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-// 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""
-// 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/drivers/dma_v2.inl
-// DMA Framework - Client API v2 definition.
-//
-//
-// WARNING: This file contains some APIs which are internal and are subject
-//          to change without noticed. Such APIs should therefore not be used
-//          outside the Kernel and Hardware Services package.
-
-
-//
-// TDmaChannel
-//
-
-inline void TDmaChannel::Wait()
-	{
-	NKern::FMWait(&iLock);
-	}
-
-inline void TDmaChannel::Signal()
-	{
-	NKern::FMSignal(&iLock);
-	}
-
-inline TBool TDmaChannel::Flash()
-	{
-	return NKern::FMFlash(&iLock);
-	}
-
-inline TBool TDmaChannel::IsOpened() const
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("Warning: TDmaChannel::IsOpened() is deprecated"));
-	return iController != NULL;
-	}
-
-inline TBool TDmaChannel::IsQueueEmpty() const
-	{
-	return const_cast<TDmaChannel*>(this)->iReqQ.IsEmpty();
-	}
-
-inline TUint32 TDmaChannel::PslId() const
-	{
-	return iPslId;
-	}
-
-
-// ---
--- a/kernel/eka/include/drivers/dmadefs.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,928 +0,0 @@
-// 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"
-// 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/drivers/dmadefs.h
-// DMA Framework - General class, enum, constant and type definitions.
-//
-//
-
-/** @file
-	@publishedPartner
-*/
-
-#ifndef __DMADEFS_H__
-#define __DMADEFS_H__
-
-
-#include <e32def.h>
-
-
-/** The client request callback type.
-
-*/
-enum TDmaCallbackType
-	{
-	/** Transfer request completion callback
-
-		@released
-	*/
-	EDmaCallbackRequestCompletion        = 0x01,
-	/** Transfer request completion callback - source side
-
-		@prototype
-	*/
-	EDmaCallbackRequestCompletion_Src    = 0x02,
-	/** Transfer request completion callback - destination side
-
-		@prototype
-	*/
-	EDmaCallbackRequestCompletion_Dst    = 0x04,
-
-	/** Descriptor completion callback
-
-		@prototype
-	*/
-	EDmaCallbackDescriptorCompletion     = 0x08,
-	/** Descriptor completion callback - source side
-
-		@prototype
-	*/
-	EDmaCallbackDescriptorCompletion_Src = 0x10,
-	/** Descriptor completion callback - destination side
-
-		@prototype
-	*/
-	EDmaCallbackDescriptorCompletion_Dst = 0x20,
-
-	/** Frame completion callback
-
-		@prototype
-	*/
-	EDmaCallbackFrameCompletion          = 0x40,
-	/** Frame completion callback - source side
-
-		@prototype
-	*/
-	EDmaCallbackFrameCompletion_Src      = 0x80,
-	/** Frame completion callback - destination side
-
-		@prototype
-	*/
-	EDmaCallbackFrameCompletion_Dst      = 0x100,
-
-	/** H/W descriptor pause event callback
-
-		@prototype
-	*/
-	EDmaCallbackLinkedListPaused        = 0x200,
-	/** H/W descriptor pause event callback - source side
-
-		@prototype
-	*/
-	EDmaCallbackLinkedListPaused_Src    = 0x400,
-	/** H/W descriptor pause event callback - destination side
-
-		@prototype
-	*/
-	EDmaCallbackLinkedListPaused_Dst    = 0x800
-	};
-
-
-/** The outcome of the transfer request.
-
-	@released
-*/
-enum TDmaResult
-	{
-	/** Completed without error */
-	EDmaResultOK = 0,
-	/** There was an error */
-	EDmaResultError
-	};
-
-
-/** To be used with address mode field of the DMA transfer config struct.
-
-	@see TDmaTransferConfig::iAddrMode
-*/
-enum TDmaAddrMode
-	{
-	/** Constant addressing. The address remains the same for consecutive
-		accesses.
-
-		@released
-	*/
-	KDmaAddrModeConstant,
-	/** Post-increment addressing. The address increases by the element size
-		after each access.
-
-		@released
-	*/
-	KDmaAddrModePostIncrement,
-	/** Post-decrement addressing. The address decreases by the element size
-		after each access.
-
-		@prototype
-	*/
-	KDmaAddrModePostDecrement,
-	/** 1D-index addressing. The address always increases by the element size
-		plus the element skip value after each access.
-
-		@prototype
-	*/
-	KDmaAddrMode1DIndex,
-	/** 2D-index addressing. The address increases by the element size plus the
-		element skip value - but only within a frame. Once a full frame has been
-		transferred, the address increases by the element size plus the element
-		skip value plus the frame skip value.
-
-		@prototype
-	*/
-	KDmaAddrMode2DIndex
-	};
-
-
-/** To be used with the burst size field of the DMA transfer config struct.
-
-	@see SDmacCaps::iBurstTransactions
-	@see TDmaTransferConfig::iBurstSize
-
-	@prototype
-*/
-enum TDmaBurstSize
-	{
-	/** Don't use burst transactions */
-	KDmaNoBursts     = -1,
-	/** Don't care (the default) */
-	KDmaBurstSizeAny = 0x00,
-	/** 4 bytes */
-	KDmaBurstSize4   = 0x04,
-	/** 8 bytes */
-	KDmaBurstSize8   = 0x08,
-	/** 16 bytes */
-	KDmaBurstSize16  = 0x10,
-	/** 32 bytes */
-	KDmaBurstSize32  = 0x20,
-	/** 64 bytes */
-	KDmaBurstSize64  = 0x40,
-	/** 128 bytes */
-	KDmaBurstSize128 = 0x80
-	};
-
-
-/** To be used with the flags field of the DMA transfer config struct.
-
-	@see TDmaTransferConfig::iFlags
-*/
-enum TDmaTransferFlags
-	{
-	/** Location is address of a memory buffer (as opposed to a peripheral or a
-		register).
-
-		@released
-	*/
-	KDmaMemAddr                      = 0x01,
-	/** Address is a physical address (as opposed to a linear one).
-
-		If it is a memory address then KDmaMemIsContiguous will need to be set
-		as well.
-
-		@released
-	 */
-	KDmaPhysAddr                     = 0x02,
-	/** Target memory is known to be physically contiguous, hence there is
-		no need for the framework to check for memory fragmentation.
-
-		@released
-	*/
-	KDmaMemIsContiguous              = 0x04,
-	/** Don't use packed access (if possible)
-
-		@released
-	*/
-	KDmaDontUsePacked                = 0x08,
-	/** Location is big endian (little endian if not set).
-
-		To have any effect, this flag requires the DMAC to support endianness
-		conversion.
-
-		@see SDmacCaps::iEndiannessConversion
-
-		@prototype
-	*/
-	KDmaBigEndian                    = 0x10,
-	/** Don't do endianness conversion even if applicable.
-
-		To have any effect, this flag requires the DMAC to support endianness
-		conversion.
-
-		@see SDmacCaps::iEndiannessConversion
-
-		@prototype
-	*/
-	KDmaLockEndian                   = 0x20,
-	/** Execute client request callback after each subtransfer (streaming /
-		loop case).
-
-		This option is only taken into account if the respective
-		TDmaTransferConfig::iRepeatCount is non-zero.
-
-		The callback will complete with a TDmaCallbackType of
-		EDmaCallbackRequestCompletion (even if the repeat counts for source and
-		destination are different), unless the flag
-		TDmaPILFlags::KDmaAsymCompletionCallback is set too, in which case what
-		is described there applies.
-
-		@prototype
-	*/
-	KDmaCallbackAfterEveryTransfer   = 0x40,
-	/** Execute client request callback after each completed hardware
-		descriptor.
-
-		Requires the DMAC to support this feature. Unless the DMAC supports
-		asymmetric descriptor interrupts as well, this flag should not be set
-		on only one (source or destination) side.
-
-		@see SDmacCaps::iDescriptorInterrupt
-		@see SDmacCaps::iAsymDescriptorInterrupt
-
-		@prototype
-	*/
-	KDmaCallbackAfterEveryDescriptor = 0x80,
-	/** Execute client request callback after each completed frame.
-
-		Requires the DMAC to support this feature. Unless the DMAC supports
-		asymmetric frame interrupts as well, this flag should not be set on
-		only one (source or destination) side.
-
-		@see SDmacCaps::iFrameInterrupt
-		@see SDmacCaps::iAsymFrameInterrupt
-
-		@prototype
-	*/
-	KDmaCallbackAfterEveryFrame      = 0x100
-	};
-
-
-/** To be used with the synchronization flags field of a DMA transfer
-	config struct.
-
-	@see SDmacCaps::iSynchronizationTypes
-	@see TDmaTransferConfig::iSyncFlags
-
-	@released
-*/
-enum TDmaTransferSyncFlags
-	{
-	/** Leave the decision on whether the transfer is hardware synchronized at
-		this end (either source or destination) to the framework. This is the
-		default.
-	*/
-	KDmaSyncAuto        = 0x00,
-	/** Transfer is not hardware synchronized at this end (either source or
-		destination).
-	*/
-	KDmaSyncNone        = 0x01,
-	/** Transfer is hardware synchronized at this end (either source or
-		destination). This option can also be used on its own, without any
-		of the following sync sizes.
-	*/
-	KDmaSyncHere        = 0x02,
-	/** H/W synchronized at this end: transfer one ELEMENT (a number of
-		bytes, depending on the configured element size) per sync event.
-	*/
-	KDmaSyncSizeElement = 0x04,
-	/** H/W synchronized at this end: transfer one FRAME (a number of
-		elements, depending on the configured frame size) per sync event.
-	*/
-	KDmaSyncSizeFrame   = 0x08,
-	/** H/W synchronized at this end: transfer one BLOCK (a number of
-		frames, depending on the configured transfer size) per sync
-		event. This is the most common use case.
-	*/
-	KDmaSyncSizeBlock   = 0x10,
-	/** H/W synchronized at this end: transfer one PACKET (a number of
-		elements, depending on the configured packet size) per sync event.
-		In cases where the transfer block size is not a multiple of the
-		packet size the last packet will consist of the remaining elements.
-	*/
-	KDmaSyncSizePacket  = 0x20
-	};
-
-
-/** To be used with the Graphics operation field of a DMA transfer request.
-
-	@see TDmaTransferArgs::iGraphicsOps
-
-	@prototype
-*/
-enum TDmaGraphicsOps
-	{
-	/** Don't use any graphics acceleration feature (the default) */
-	KDmaGraphicsOpNone            = 0x00,
-	/** Enable graphics acceleration feature 'Constant Fill' */
-	KDmaGraphicsOpConstantFill    = 0x01,
-	/** Enable graphics acceleration feature 'TransparentCopy' */
-	KDmaGraphicsOpTransparentCopy = 0x02
-	};
-
-
-/** To be used with the PIL flags field of a DMA transfer request.
-
-	@see TDmaTransferArgs::iFlags
-*/
-enum TDmaPILFlags
-	{
-	/** Request a different max transfer size (for instance for test
-		purposes).
-
-		@released
-	*/
-	KDmaAltTransferLength         = 0x01,
-	/** Execute client request callback in ISR context instead of from a
-		DFC.
-
-		@released
-	*/
-	KDmaRequestCallbackFromIsr    = 0x02,
-	/** Execute descriptor completion callback in ISR context instead of
-		from a DFC. This option is to be used in conjunction with the
-		TDmaTransferFlags::KDmaCallbackAfterEveryDescriptor flag.
-
-		@prototype
-	*/
-	KDmaDescriptorCallbackFromIsr = 0x04,
-	/** Execute frame completion callback in ISR context instead of
-		from a DFC. This option is to be used in conjunction with the
-		TDmaTransferFlags::KDmaCallbackAfterEveryFrame flag.
-
-		@prototype
-	*/
-	KDmaFrameCallbackFromIsr      = 0x08,
-	/** Execute the client request callback separately for source and
-		destination subtransfers.
-
-		This flag also determines the TDmaCallbackType value returned. If set,
-		the callback will complete with EDmaCallbackRequestCompletion_Src or
-		EDmaCallbackRequestCompletion_Dst, respectively, instead of with
-		EDmaCallbackRequestCompletion.
-
-		Requires the DMAC to support this feature.
-
-		@see SDmacCaps::iAsymCompletionInterrupt
-
-		@prototype
-	*/
-	KDmaAsymCompletionCallback    = 0x10,
-	/** Execute the descriptor completion callback separately for source
-		and destination subtransfers.
-
-		This flag modifies the behaviour of the
-		TDmaTransferFlags::KDmaCallbackAfterEveryDescriptor flag and also
-		determines the TDmaCallbackType value returned. If set, the callback
-		will complete with EDmaCallbackDescriptorCompletion_Src or
-		EDmaCallbackDescriptorCompletion_Dst, respectively, instead of with
-		EDmaCallbackDescriptorCompletion.
-
-		Requires the DMAC to support this feature.
-
-		@see SDmacCaps::iAsymDescriptorInterrupt
-
-		@prototype
-	*/
-	KDmaAsymDescriptorCallback    = 0x20,
-	/** Execute the frame completion callback separately for source and
-		destination subtransfers.
-
-		This flag modifies the behaviour of the
-		TDmaTransferFlags::KDmaCallbackAfterEveryFrame flag. If set, the
-		callback will complete with EDmaCallbackFrameCompletion_Src or
-		EDmaCallbackFrameCompletion_Dst, respectively, instead of with
-		EDmaCallbackFrameCompletion.
-
-		Requires the DMAC to support this feature.
-
-		@see SDmacCaps::iAsymFrameInterrupt
-
-		@prototype
-	*/
-	KDmaAsymFrameCallback         = 0x40,
-	/** This transfer (only) should use the channel priority indicated by
-		TDmaTransferArgs::iChannelPriority.
-
-		@prototype
-	*/
-	KDmaRequestChannelPriority    = 0x80
-	};
-
-
-/** Values which can be used with the priority field when opening a channel
-	and/or when fragmenting a transfer request.
-
-	@see TDmaChannel::SCreateInfo::iPriority
-	@see TDmaTransferArgs::iChannelPriority
-
-	@prototype
-*/
-enum TDmaPriority
-	{
-	/** No transfer priority preference (don't care value) */
-	KDmaPriorityNone = 0x0,
-	/** Platform-independent transfer priority 1 (lowest) */
-	KDmaPriority1 = 0x80000001,
-	/** Platform-independent transfer priority 2 */
-	KDmaPriority2 = 0x80000002,
-	/** Platform-independent transfer priority 3 */
-	KDmaPriority3 = 0x80000003,
-	/** Platform-independent transfer priority 4 */
-	KDmaPriority4 = 0x80000004,
-	/** Platform-independent transfer priority 5 */
-	KDmaPriority5 = 0x80000005,
-	/** Platform-independent transfer priority 6 */
-	KDmaPriority6 = 0x80000006,
-	/** Platform-independent transfer priority 7 */
-	KDmaPriority7 = 0x80000007,
-	/** Platform-independent transfer priority 8 (highest) */
-	KDmaPriority8 = 0x80000008
-	};
-
-
-/** Contains the configuration values for either the source or the
-	destination side of a DMA transfer.
-
-	Note that some fields (notably iElementSize, iElementsPerFrame and
-	iFramesPerTransfer) may only differ between source and destination if
-	the underlying DMAC supports this.
-
-	@see SDmacCaps::iSrcDstAsymmetry
-	@see TDmaTransferArgs::iSrcConfig
-	@see TDmaTransferArgs::iDstConfig
-
-	@released
-*/
-struct TDmaTransferConfig
-	{
-friend struct TDmaTransferArgs;
-
-	/** Default constructor.
-
-		Initializes all fields with meaningful default values.
-	*/
-#ifdef DMA_APIV2
-	KIMPORT_C
-#endif
-	TDmaTransferConfig();
-
-	/**	Alternate constructor.
-
-		Intended for general use ie. not 1D or 2D transfers
-	*/
-#ifdef DMA_APIV2
-	KIMPORT_C
-#endif
-	TDmaTransferConfig (
-		TUint32 aAddr,
-		TUint aTransferFlags,
-		TDmaAddrMode aAddrMode = KDmaAddrModePostIncrement,
-		TUint aSyncFlags = KDmaSyncAuto,
-		TDmaBurstSize aBurstSize = KDmaBurstSizeAny,
-		TUint aElementSize = 0,
-		TUint aElementsPerPacket = 0,
-		TUint aPslTargetInfo = 0,
-		TInt aRepeatCount = 0
-		);
-
-	/**	Alternate constructor.
-
-		Intended for 1D and 2D transfers.
-	*/
-#ifdef DMA_APIV2
-	KIMPORT_C
-#endif
-	TDmaTransferConfig (
-		TUint32 aAddr,
-		TUint aElementSize,
-		TUint aElementsPerFrame,
-		TUint aFramesPerTransfer,
-		TInt aElementSkip,
-		TInt aFrameSkip,
-		TUint aTransferFlags,
-		TUint aSyncFlags = KDmaSyncAuto,
-		TDmaBurstSize aBurstSize = KDmaBurstSizeAny,
-		TUint aElementsPerPacket = 0,
-		TUint aPslTargetInfo = 0,
-		TInt aRepeatCount = 0
-		);
-
-	/** Transfer start address */
-	TUint32 iAddr;
-	/** Address mode */
-	TDmaAddrMode iAddrMode;
-	/** Element size in bytes (1/2/4/8) */
-	TUint iElementSize;
-	/** Number of elements per frame */
-	TUint iElementsPerFrame;
-	/** Number of elements per packet */
-	TUint iElementsPerPacket;
-	/** Number of frames to transfer (result is the transfer block) */
-	TUint iFramesPerTransfer;
-	/** Element skip in bytes (for addr modes E1DIndex or E2DIndex) */
-	TInt iElementSkip;
-	/** Frame skip in bytes (for addr mode E2DIndex) */
-	TInt iFrameSkip;
-	/** Use burst transactions of the specified size (in bytes)
-		@see TDmaBurstSize
-	*/
-	TInt iBurstSize;
-	/** PIL src/dst config flags.
-		@see TDmaTransferFlags
-	*/
-	TUint32 iFlags;
-	/** Transfer synchronization flags.
-		@see TDmaTransferSyncFlags
-	*/
-	TUint32 iSyncFlags;
-	/** Information passed to the PSL */
-	TUint iPslTargetInfo;
-	/** How often to repeat this (sub-)transfer:
-		 0     no repeat (the default)
-		 1..n  once / n times
-		-1     endlessly.
-
-		@prototype
-	*/
-	TInt iRepeatCount;
-	/** Structure contents delta vector.
-
-		(usage tbd)
-
-		@prototype
-	 */
-	TUint32 iDelta;
-	/** Reserved for future use */
-	TUint32 iReserved;
-
-private:
-	/** Private constructor.
-
-		Initializes fields with the values passed in by the legacy version of
-		the DDmaRequest::Fragment() call.
-	*/
-	TDmaTransferConfig(TUint32 aAddr, TUint aFlags, TBool aAddrInc);
-	};
-
-
-/** To be used by the client to pass DMA transfer request details to the
-	framework.
-
-	Also used internally by the framework as a pseudo descriptor if the
-	controller doesn't support hardware descriptors (scatter/gather LLI).
-
-	@see DDmaRequest::Fragment
-
-	@released
-*/
-struct TDmaTransferArgs
-	{
-	friend class DDmaRequest;
-	friend class TDmaChannel;
-	friend class TDmac;
-	friend class DmaChannelMgr;
-
-	/** Default constructor.
-
-		Initializes all fields with meaningful default values.
-	*/
-#ifdef DMA_APIV2
-	KIMPORT_C
-#endif
-	TDmaTransferArgs();
-
-	/**	Alternate constructor.
-
-		Intended for transfers where src and dst TDmaTransferConfig structs
-		share some of the same options, i.e. iDmaTransferFlags, iAddrMode,
-		iSyncFlags, iBurstSize, and iElementSize.
-
-		@param aSrcAddr
-		@param aDstAddr
-		@param aCount Number of bytes to transfer
-		@param aDmaTransferFlags Bitmask of TDmaTransferFlags for src and dst
-		@param aDmaSyncFlags Bitmask of TDmaTransferSyncFlags for src and dst
-		@param aMode Address mode for src and dst
-		@param aDmaPILFlags Bitmask of TDmaPILFlags
-		@param aElementSize In bytes (1/2/4/8) for src and dst
-		@param aChannelPriority
-		@param aBurstSize for src and dst
-		@param aPslRequestInfo Info word passed to the PSL
-		@param aGraphicOp Graphics operation to be executed
-		@param aColour Colour value for graphics operation
-	*/
-#ifdef DMA_APIV2
-	KIMPORT_C
-#endif
-	TDmaTransferArgs (
-		TUint aSrcAddr,
-		TUint aDstAddr,
-		TUint aCount,
-		TUint aDmaTransferFlags,
-		TUint aDmaSyncFlags = KDmaSyncAuto,
-		TUint aDmaPILFlags = 0,
-		TDmaAddrMode aMode = KDmaAddrModePostIncrement,
-		TUint aElementSize = 0,
-		TUint aChannelPriority = KDmaPriorityNone,
-		TDmaBurstSize aBurstSize = KDmaBurstSizeAny,
-		TUint aPslRequestInfo = 0,
-		TDmaGraphicsOps aGraphicOp = KDmaGraphicsOpNone,
-		TUint32 aColour = 0
-		);
-
-	/** Alternate constructor.
-
-		Intended for transfers needing specific options for source and
-		destination TDmaTransferConfig structs.
-
-		@param aSrc Configuration values for the source
-		@param aDst Configuration values for the destination
-		@param aFlags @see TDmaPILFlags
-		@param aChannelPriority Use for this request (only) the indicated
-		channel priority. Requires KDmaRequestChannelPriority to be set in
-		iFlags as well. @see TDmaPriority
-		@param aPslRequestInfo Info word passed to the PSL
-		@param aGraphicOp Graphics operation to be executed
-		@param aColour Colour value for graphics operation
-	*/
-#ifdef DMA_APIV2
-	KIMPORT_C
-#endif
-	TDmaTransferArgs (
-		const TDmaTransferConfig& aSrc,
-		const TDmaTransferConfig& aDst,
-		TUint32 aFlags = 0,
-		TUint aChannelPriority = KDmaPriorityNone,
-		TUint aPslRequestInfo = 0,
-		TDmaGraphicsOps aGraphicOp = KDmaGraphicsOpNone,
-		TUint32 aColour = 0
-		);
-
-	/** Configuration values for the source */
-	TDmaTransferConfig iSrcConfig;
-	/** Configuration values for the destination */
-	TDmaTransferConfig iDstConfig;
-
-	/** Number of bytes to transfer (optional).
-
-		A non-zero value here must be consistent with iElementSize,
-		iElementsPerFrame and iFramesPerTransfer in iSrcConfig and iDstConfig
-		if the latter are specified as well (or instead, they may be left at
-		their default values of zero).
-
-		If zero, the PIL will fill in a value calculated from multiplying
-		iElementSize, iElementsPerFrame and iFramesPerTransfer in iSrcConfig,
-		so that the PSL can rely on it being always non-zero and valid.
-	 */
-	TUint iTransferCount;
-	/** Graphics operation to be executed */
-	TDmaGraphicsOps iGraphicsOps;
-	/** Colour value for graphics operations */
-	TUint32 iColour;
-	/** PIL common flags
-		@see TDmaPILFlags
-	*/
-	TUint32 iFlags;
-	/** Use for this request (only) the indicated channel priority.
-		Requires KDmaRequestChannelPriority to be set in iFlags as well.
-		@see TDmaPriority
-	*/
-	TUint iChannelPriority;
-	/** Info word passed to the PSL */
-	TUint iPslRequestInfo;
-	/** Stores the PSL cookie returned by TDmaChannel::PslId() at request
-		fragmentation time.
-
-		The value PslId() is often (but not necessarily) identical with the
-		client's TDmaChannel::SCreateInfo::iCookie, which gets passed by the
-		PIL into DmaChannelMgr::Open() as 'aOpenId'.
-	*/
-	TUint32 iChannelCookie;
-	/** Structure contents delta vector.
-
-		(usage tbd)
-
-		@prototype
-	 */
-	TUint32 iDelta;
-	/** Reserved for future use */
-	TUint32 iReserved1;
-
-private:
-	/** Private constructor.
-
-		Initializes fields with the values passed in by the legacy version of
-		the DDmaRequest::Fragment() call.
-	*/
-	TDmaTransferArgs(TUint32 aSrcAddr, TUint32 aDstAddr, TInt aCount,
-					 TUint aFlags, TUint32 aPslInfo);
-	/** Reserved for future use */
-	TUint32 iReserved2;
-	};
-
-
-/** DMAC capabilities info structure.
-
-	Instances are to be filled in by the PSL and then linked to via TDmaChannel
-	objects after they have been opened.
-
-	The contents may vary even between channels on the same DMAC (but should
-	remain constant for a given channel for the duration that it is open),
-	depending on static or dynamic factors which only the PSL knows about.
-
-	@see TDmaChannel::Open
-	@see TDmaChannel::DmacCaps
-
-	@released
-*/
-struct SDmacCaps
-	{
-	/** DMAC supports n + 1 different channel priorities.
-	 */
-	TUint iChannelPriorities;
-	/** DMAC supports the pausing and resuming of channels.
-	 */
-	TBool iChannelPauseAndResume;
-	/** DMA addresses must be aligned on an element size boundary.
-	 */
-	TBool iAddrAlignedToElementSize;
-	/** DMAC supports 1D (element) index addressing in hardware.
-	 */
-	TBool i1DIndexAddressing;
-	/** DMAC supports 2D (frame) index addressing in hardware.
-	 */
-	TBool i2DIndexAddressing;
-	/** DMAC supports these transfer synchronization types (bitmap of values).
-
-		@see TDmaTransferSyncFlags
-	*/
-	TUint iSynchronizationTypes;
-	/** DMAC supports burst transactions with these sizes (bitmap of values).
-
-		@see TDmaBurstSize
-	*/
-	TUint iBurstTransactions;
-	/** DMAC supports a 'h/w descriptor complete' interrupt.
-	 */
-	TBool iDescriptorInterrupt;
-	/** DMAC supports a 'frame transfer complete' interrupt.
-	 */
-	TBool iFrameInterrupt;
-	/** DMAC supports a 'linked-list pause event' interrupt.
-	 */
-	TBool iLinkedListPausedInterrupt;
-	/** DMAC supports endianness conversion.
-	 */
-	TBool iEndiannessConversion;
-	/** DMAC supports these graphics operations (bitmap of values).
-
-		@see TDmaGraphicsOps
-	*/
-	TUint iGraphicsOps;
-	/** DMAC supports repeated transfers (loops).
-	 */
-	TBool iRepeatingTransfers;
-	/** DMAC supports logical channel linking (chaining).
-	 */
-	TBool iChannelLinking;
-	/** DMAC supports scatter/gather mode (linked list items).
-	 */
-	TBool iHwDescriptors;
-	/** DMAC supports asymmetric source and destination transfer
-		parameters (such as element size).
-	*/
-	TBool iSrcDstAsymmetry;
-	/** DMAC supports asymmetric h/w descriptor lists.
-
-		ETrue here requires ETrue for iHwDescriptors and iSrcDstAsymmetry as
-		well.
-	*/
-	TBool iAsymHwDescriptors;
-	/** DMAC with asymmetric descriptor support has the limitation that the
-		number of bytes transferred in source and destination must be equal in
-		every link segment (i.e. in each src/dst descriptor pair).
-
-		ETrue here requires ETrue for iAsymHwDescriptors as well.
-	*/
-	TBool iBalancedAsymSegments;
-	/** DMAC supports separate transfer completion notifications for source and
-		destination side subtransfers.
-
-		This capability is required for the asymmetric transfer completion
-		callback API feature.
-
-		@see TDmaPILFlags::KDmaAsymCompletionCallback
-	*/
-	TBool iAsymCompletionInterrupt;
-	/** DMAC supports separate descriptor completion notifications for source and
-		destination side.
-
-		This capability is required for the asymmetric descriptor completion
-		callback API feature.
-
-		ETrue here requires ETrue for both iDescriptorInterrupt and
-		iAsymHwDescriptors as well.
-
-		@see TDmaPILFlags::KDmaAsymDescriptorCallback
-	*/
-	TBool iAsymDescriptorInterrupt;
-	/** DMAC supports separate frame completion notifications for source and
-		destination side.
-
-		This capability is required for the asymmetric frame completion
-		callback API feature.
-
-		ETrue here requires ETrue for iFrameInterrupt as well.
-
-		@see TDmaPILFlags::KDmaAsymFrameCallback
-	*/
-	TBool iAsymFrameInterrupt;
-
-	/** Reserved for future use */
-	TUint32 iReserved[5];
-	};
-
-
-//////////////////////////////////////////////////////////////////////////////
-// INTERFACE WITH TEST HARNESS
-//////////////////////////////////////////////////////////////////////////////
-
-/** Set of information used by test harness.
-
-	@deprecated
-*/
-#ifdef DMA_APIV2
-struct TDmaTestInfo
-	{
-	/** Maximum transfer size in bytes for all channels (ie. the minimum of all
-		channels' maximum size)
-	*/
-	TUint iMaxTransferSize;
-	/** 3->Memory buffers must be 4-byte aligned, 7->8-byte aligned, ... */
-	TUint iMemAlignMask;
-	/** Cookie to pass to DDmaRequest::Fragment for memory-memory transfer */
-	TUint32 iMemMemPslInfo;
-	/** Number of test single-buffer channels */
-	TInt iMaxSbChannels;
-	/** Pointer to array containing single-buffer test channel ids */
-	TUint32* iSbChannels;
-	/** Number of test double-buffer channels */
-	TInt iMaxDbChannels;
-	/** Pointer to array containing double-buffer test channel ids */
-	TUint32* iDbChannels;
-	/** Number of test scatter-gather channels */
-	TInt iMaxSgChannels;
-	/** Pointer to array containing scatter-gather test channel ids */
-	TUint32* iSgChannels;
-	};
-#endif
-
-
-/** Set of information used by test harness.
-
-	@released
-*/
-struct TDmaV2TestInfo
-	{
-	enum {KMaxChannels=32};
-	/** Maximum transfer size in bytes for all channels (ie. the minimum of all
-		channels' maximum size)
-	*/
-	TUint iMaxTransferSize;
-	/** 3->Memory buffers must be 4-byte aligned, 7->8-byte aligned, ... */
-	TUint iMemAlignMask;
-	/** Cookie to pass to DDmaRequest::Fragment for memory-memory transfer */
-	TUint32 iMemMemPslInfo;
-	/** Number of test single-buffer channels */
-	TInt iMaxSbChannels;
-	/** Pointer to array containing single-buffer test channel ids */
-	TUint32 iSbChannels[KMaxChannels];
-	/** Number of test double-buffer channels */
-	TInt iMaxDbChannels;
-	/** Pointer to array containing double-buffer test channel ids */
-	TUint32 iDbChannels[KMaxChannels];
-	/** Number of test scatter-gather channels */
-	TInt iMaxSgChannels;
-	/** Pointer to array containing scatter-gather test channel ids */
-	TUint32 iSgChannels[KMaxChannels];
-	};
-
-
-#endif	// #ifndef __DMADEFS_H__
--- a/kernel/eka/include/drivers/gpio.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/drivers/gpio.h	Wed Sep 01 12:34:56 2010 +0100
@@ -18,14 +18,6 @@
 #ifndef __GPIO_H__
 #define __GPIO_H__
 
-#include <dfcs.h>
-
-#ifdef __USE_GPIO_STATIC_EXTENSION__
-// test standard extension handler number. *DO NOT USE*
-#define KTestStaticExtension 0x80000000
-#include <staticextension.h>
-#endif
-
 class TGpioCallback;	//forward declaration
 
 /**
@@ -116,38 +108,6 @@
 		EEdgeBoth
 		};
 
-	/**
-	 Enumeration TGpioBaseId defines the highest 16 bits of 32 bit GPIO Id 
-	 to identify the GPIO hardware block:
-     - EInternalId    - The SOC GPIO hardware block (and any extender that is 
-                        covered by the vendor supplied implementation) supports
-	                    pin ids from 0-65535
-	 - EExtender0-15  - Up to 16 3rd party extenders (each supporting up
-	                                to 65536 pins) can be used.
-	 */
-	enum TGpioBaseId
-	    {
-	    EInternalId = 0x00000000,
-	    EExtender0  = 0x00010000,        
-	    EExtender1  = 0x00020000,
-	    EExtender2  = 0x00040000,
-	    EExtender3  = 0x00080000,
-	    EExtender4  = 0x00100000,
-	    EExtender5  = 0x00200000,
-	    EExtender6  = 0x00400000,
-	    EExtender7  = 0x00800000,
-	    EExtender8  = 0x01000000,
-	    EExtender9  = 0x02000000,
-	    EExtender10 = 0x04000000,
-	    EExtender11 = 0x08000000,
-	    EExtender12 = 0x10000000,
-	    EExtender13 = 0x20000000,
-	    EExtender14 = 0x40000000,
-	    EExtender15 = 0x80000000
-	    };
-
-
-	
     /**
     Sets the pin mode.
     
@@ -240,6 +200,7 @@
 
     /**
     Reads the pin idle configuration and state.
+    
     @param aId    The pin Id.
     @param aConf  On return contains the idle configuration and state previoulsy
 				  set on the pin.
@@ -281,6 +242,7 @@
             KErrGeneral, if there is no ISR bound to this interrupt.
     */
 	IMPORT_C static TInt UnbindInterrupt(TInt aId);
+
     /**
     Enables the interrupt on specified pin.
     
@@ -292,6 +254,7 @@
             KErrGeneral, if there is no ISR bound to this interrupt.
     */
 	IMPORT_C static TInt EnableInterrupt(TInt aId);
+
     /**
     Disables the interrupt on specified pin.
     
@@ -495,6 +458,7 @@
             KErrArgument, if aId is invalid.
             KErrNotSupported, if reading the state asynchronously is not supported.
 
+	This API should be used with off-chip GPIO modules only;
 	The result of the read operation and the state of the input pin will be passed as an argument to the callback function;
     */
 	IMPORT_C static TInt GetInputState(TInt aId, TGpioCallback* aCb);
@@ -510,7 +474,7 @@
 			KErrArgument, if aId is invalid;
             KErrNotSupported, if setting its state asynchronously is not supported.
 
-
+    This API should be used with off-chip GPIO modules only;
 	The result of the set operation will be passed as an argument to the callback function;
     */
 	IMPORT_C static TInt SetOutputState(TInt aId, TGpioState aState, TGpioCallback* aCb);
--- a/kernel/eka/include/drivers/iic.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/drivers/iic.h	Wed Sep 01 12:34:56 2010 +0100
@@ -335,6 +335,28 @@
 	TInt8 iChanRwFlags;		// Bit 0 for write, bit 1 for read
 	};
 
+#ifdef IIC_SIMULATED_PSL
+_LIT(KPddName,"iic.pdd");
+
+NONSHARABLE_CLASS(DIicPdd) : public DPhysicalDevice
+	{
+// Class to faciliate loading of the IIC classes
+public:
+	class TCaps
+		{
+	public:
+		TVersion iVersion;
+		};
+public:
+	DIicPdd();
+	~DIicPdd();
+	virtual TInt Install();
+	virtual TInt Create(DBase*& aChannel, TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
+	virtual TInt Validate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
+	virtual void GetCaps(TDes8& aDes) const;
+	inline static TVersion VersionRequired();
+	};
+#endif
 
 #include <drivers/iic.inl>
 
--- a/kernel/eka/include/drivers/iic_channel.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/drivers/iic_channel.h	Wed Sep 01 12:34:56 2010 +0100
@@ -40,17 +40,15 @@
 const static TInt KChannelDuplexMask	= 0x01<<KChannelDuplexShift;
 const static TInt16 KTransCountMsBit = (TInt16)((TUint16)0x8000);
 
-const static TInt8 KMaxWaitTime = 0x7E; // Maximum allowable time in milliseconds for a Slave channel to wait for a response
+const static TInt8 KMaxWaitTime = 0x21; // Maximum allowable time in milliseconds for a Slave channel to wait for a response
 										// (from Master or Client). This constant is used to limit run-time selected values
 										// for timeouts. The value stated here is semi-arbitrary.
 
 #ifdef IIC_SIMULATED_PSL
 // In a real system, the following timeout values are likely to be excessive. However, they are available
 // for use in the test framework, to account for the processing overhead.
-// In particular, for the simulated master timeout tests.
-const TInt KSlaveDefMWaitTime = 125;
-const TInt KSlaveDefCWaitTime = 124;
-
+const TInt KSlaveDefMWaitTime = 32;
+const TInt KSlaveDefCWaitTime = 16;
 #else
 const TInt KSlaveDefMWaitTime = 1;	// Default wait time for Master timeout. PSL can use SetMasterWaitTime to override.
 const TInt KSlaveDefCWaitTime = 1;	// Default wait time for Client timeout. PSL can use SetClientWaitTime to override.
@@ -122,6 +120,7 @@
 	inline void DumpChannel();
 #endif
 protected:
+	NTimer iTimeoutTimer;	// timeout timer
 	TInt8 iChannelNumber;	// this is the Key for ordering channels in the array
 	TUint8 iFlags;			// combination of TChannelType, TChannelDuplex and TBusType
 	TInt8 iSpare1;
@@ -290,8 +289,6 @@
 
 	Function to cancel the timer to check the Slave responsiveness.
 
-	Call either in a thread or an IDFC context. Do not call from an ISR.
-
 	*/
 	void CancelTimeOut();
 
@@ -502,8 +499,6 @@
 
 	TDfc* iSlaveTimeoutDfc;
 
-	NTimer iTimeoutTimer;	// timeout timer
-
 	TInt16 iTransCount; // Count of pending transactions
 	TInt8 iChannelReady;
 	TInt8 iSpare1;
@@ -657,13 +652,8 @@
 	virtual TInt Spare1(TInt aVal, TAny* aPtr1, TAny* aPtr2);
 
 	// Interface to TIicBusSlaveCallback
-	//
-	// ProcessData is a channel-specific function to be provided by the PSL. Its purpose is to process
-	// data received/transmitted (called from NotifyClient or DFC queued from it). It Must fill in the
-	// aCb object's iReturn, iRxWords and/or iTxWords using the appropriate functions
-	//
-	// The functions UpdateReqTrig, StartTimerByState and StopTimer are for use by the PIL, only.
-	//
+	// channel-specific function to process data received/transmitted (called from NotifyClient or DFC queued from it)
+	// Must fill in the aCb object's iReturn, iRxWords and/or iTxWords using the appropriate funtions
 	/**
 	@publishedPartner
 	@prototype 9.6
@@ -855,7 +845,6 @@
 	TInt16 iSpare3;
 
 	TSpinLock iSpinLock;
-	NTimer iTimeoutTimer;	// timeout timer
 	TAny* iReserved1;
 	TAny* iReserved2;
 
--- a/kernel/eka/include/drivers/iic_transaction.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/drivers/iic_transaction.h	Wed Sep 01 12:34:56 2010 +0100
@@ -192,7 +192,7 @@
 // 27:23 - Reserved
 // 22:20 - Bus type
 // 19:15 - Channel number
-// 14:10 - Transaction speed	// For use with SET_TRANS_SPEED, GET_TRANS_SPEED - Deprecated
+// 14:10 - Transaction speed
 //  9:0  - Slave address
 #define HS_MASTER_ADDR_SHIFT 29
 #define HS_MASTER_ADDR_MASK 0x7
@@ -202,8 +202,8 @@
 #define BUS_TYPE_MASK 0x7
 #define CHANNEL_NO_SHIFT 15
 #define CHANNEL_NO_MASK 0x1F
-#define TRANS_SPEED_SHIFT 10	// For use with SET_TRANS_SPEED, GET_TRANS_SPEED - Deprecated
-#define TRANS_SPEED_MASK 0x1F	// For use with SET_TRANS_SPEED, GET_TRANS_SPEED - Deprecated
+#define TRANS_SPEED_SHIFT 10
+#define TRANS_SPEED_MASK 0x1F
 #define SLAVE_ADDR_SHIFT 0
 #define SLAVE_ADDR_MASK 0x3FF
 
@@ -262,13 +262,13 @@
 #define SET_CHAN_NUM(aBusId,aChanNum) SET_CONF_FIELD(aBusId,aChanNum,CHANNEL_NO_MASK,CHANNEL_NO_SHIFT)
 /**
 @publishedPartner
-@deprecated
+@prototype 9.6
 Macro to set the Transaction speed of a Bus realisation configuration
 */
 #define SET_TRANS_SPEED(aBusId,aTransSpeed) SET_CONF_FIELD(aBusId,aTransSpeed,TRANS_SPEED_MASK,TRANS_SPEED_SHIFT)
 /**
 @publishedPartner
-@deprecated
+@prototype 9.6
 Macro to get the Transaction speed of a Bus realisation configuration
 */
 #define GET_TRANS_SPEED(aBusId) GET_CONF_FIELD(aBusId,TRANS_SPEED_MASK,TRANS_SPEED_SHIFT)
@@ -421,7 +421,6 @@
         inline TIicBusTransaction();
     
         // the client interface for creating half duplex transactions
-		// The parameter aPriority is required to be at least zero and less than KNumTrancPriorities.
         inline TIicBusTransaction(TDes8* aHeader, TIicBusTransfer* aHdTrans, TInt aPriority=0);
         inline ~TIicBusTransaction();
         inline TInt SetHalfDuplexTrans(TDes8* aHeader, TIicBusTransfer* aHdTrans);
--- a/kernel/eka/include/drivers/iic_transaction.inl	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/drivers/iic_transaction.inl	Wed Sep 01 12:34:56 2010 +0100
@@ -65,8 +65,7 @@
     iHeader(aHeader), iFlags(NULL), iState(EFree), iHalfDuplexTrans(aHdTrans),
     iFullDuplexTrans(NULL), iCallback(NULL)
     {
-    //Check that the requested priority is at least zero and less than KNumTrancPriorities.
-    __ASSERT_ALWAYS(((aPriority<KNumTrancPriorities)&&(aPriority>=0)),Kern::Fault("TIicBusTransaction",__LINE__));
+    __ASSERT_ALWAYS((((TUint)aPriority<(TUint)KNumTrancPriorities)&&((TUint)aPriority>=0)),Kern::Fault("TIicBusTransaction",__LINE__));
     __ASSERT_ALWAYS(aHeader && aHdTrans,Kern::Fault("TIicBusTransaction",__LINE__));
     iKey = aPriority;
     }
--- a/kernel/eka/include/drivers/mmc.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/drivers/mmc.h	Wed Sep 01 12:34:56 2010 +0100
@@ -3014,10 +3014,6 @@
 	inline void EnableDoubleBuffering(TUint32 aNumBlocks);							  /**< @internalTechnology */
 	inline void SetDataTransferCallback(TMMCCallBack& aCallback);					  /**< @internalTechnology */
 	inline void MoreDataAvailable(TUint32 aNumBlocks, TUint8* aMemoryP, TInt aError); /**< @internalTechnology */
-
-	inline void SaveCard();			/**< @internalTechnology */
-	inline void RestoreCard();		/**< @internalTechnology */
-
 public:
 	/**
     The last R1 response.
@@ -3061,9 +3057,7 @@
 	
 	TMMCCallBack iDataTransferCallback;	// A callback function, used to request more data when performing double-buffering
 
-	TUint32 iSpare[21];				// Spare data (stolen from iCommand)
-
-	TMMCard* iSavedCardP;			// Saved copy of iCardP
+	TUint32 iSpare[22];				// Spare data (stolen from iCommand)
 
 	TMMCStateMachine iMachine;		// State Machine context
 #ifdef __EPOC32__
@@ -3097,8 +3091,7 @@
 		KInterfaceSetBusWidth,
 		KInterfaceDemandPagingInfo,
 		KInterfaceCancelSession,
-		KInterfaceDoWakeUpSM,
-		KInterfaceAddressCard,
+		KInterfaceDoWakeUpSM
 		};
 
 	/** generic interface */
@@ -3144,17 +3137,6 @@
 		virtual TMMCErr DoWakeUpSM()=0;
 		};
 
-	/**
-	 * An optional interface implemented by the derived class. Used when the stack supports more than one 
-	 * card and the cards are individually selectable, i.e. iMultiplexedBus is true
-	 * @see KInterfaceAddressCard
-	 */
-	class MAddressCard
-		{
-	public:
-		virtual void AddressCard(TInt aCardNumber)=0;
-		};
-
 
 public:
 	IMPORT_C DMMCStack(TInt aBus, DMMCSocket* aSocket);
@@ -3544,8 +3526,6 @@
 
 	void DetermineBusWidthAndClock(const TMMCard& aCard, TBool aLowVoltage, TUint& aPowerClass, TBusWidthAndClock& aBusWidthAndClock);
 	TUint GetPowerClass(const TMMCard& aCard, TBusWidthAndClock aWidthAndClock, TBool aLowVoltage);
-	
-	void DoAddressCard(TInt aCardNumber);
 
 
     //	----------- Data Members -------------
@@ -3624,8 +3604,6 @@
 protected:
 	/** 
 	Gets an interface from a derived class
-	N.B the derived class should call the base class's default implementation of this function
-	if it does not support the specified interface
 	replaces reserved virtual Dummy4()
 	*/
 	IMPORT_C virtual void GetInterface(TInterfaceId aInterfaceId, MInterface*& aInterfacePtr);
@@ -4129,7 +4107,6 @@
 		EMMCUnblockingInWrongContext	=18,
 		EMMCInvalidCardNumber			=19,
 		EMMCNotInDfcContext				=20,
-		EMMCAddressCardNotSupported		=21,
 		};
     IMPORT_C static void Panic(TMMCPanic aPanic);
 	friend class DMMCStack;
--- a/kernel/eka/include/drivers/mmc.inl	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/drivers/mmc.inl	Wed Sep 01 12:34:56 2010 +0100
@@ -1127,18 +1127,6 @@
 	return(EFalse);
 	}
 
-inline void DMMCSession::SaveCard()
-	{
-	if (iCardP)
-		iSavedCardP = iCardP;
-	}
-
-inline void DMMCSession::RestoreCard()
-	{
-	if (iSavedCardP)
-		iCardP = iSavedCardP;
-	iSavedCardP = NULL;
-	}
 
 //	--------  class DMMCSocket  --------
 
--- a/kernel/eka/include/drivers/resmanus.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/drivers/resmanus.h	Wed Sep 01 12:34:56 2010 +0100
@@ -270,7 +270,7 @@
 	TInt ExtractResourceInfo(const TPowerResourceInfoV01* aPwrResInfo, TResourceInfoBuf& aInfo);
 #ifdef _DUMP_TRACKERS
 	TInt DumpResource(const TPowerResourceInfoV01* aResource);
-	void DumpTracker(TTrackingControl* aTracker);
+	TInt DumpTracker(TTrackingControl* aTracker);
 #endif
 #ifdef RESOURCE_MANAGER_SIMULATED_PSL
 	void CheckForCandidateAsyncResource(TPowerResourceInfoV01* aResource);
--- a/kernel/eka/include/drivers/resmanus_trace.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/drivers/resmanus_trace.h	Wed Sep 01 12:34:56 2010 +0100
@@ -26,6 +26,16 @@
 #define __RESMANUSCONTROL_TRACE_H__
 #ifdef BTRACE_RESMANUS
 
+//Function to format the output.
+static void UsTraceFormatPrint(TDes8& aBuf, const char* aFmt, ...)
+	{
+	if(!(&aBuf))
+		return;
+	VA_LIST list;
+	VA_START(list,aFmt);
+	Kern::AppendFormat(aBuf,aFmt,list);
+	}
+
 //definition of subcategories.
 #define PRM_US_OPEN_CHANNEL_START				BTrace::EOpenChannelUsStart
 #define PRM_US_OPEN_CHANNEL_END					BTrace::EOpenChannelUsEnd
@@ -42,38 +52,31 @@
 #define PRM_US_CANCEL_SET_RESOURCE_STATE_START	BTrace::ECancelSetResourceStateUsStart
 #define PRM_US_CANCEL_SET_RESOURCE_STATE_END	BTrace::ECancelSetResourceStateUsEnd
 
-#define APPEND_VAL(val)                                                                        \
-    {                                                                                               \
-    printBuf.Append((TUint8 *)&(val), sizeof(val));                                                       \
-    }     
-#define APPEND_STRING(des_ptr)                                                                           \
-    {                                                                                               \
-    TUint length = (des_ptr)->Length();                                                              \
-    printBuf.Append((TUint8 *)&length, sizeof(TUint));                                                     \
-    printBuf.Append(*(des_ptr));                                                                       \
-    }
-
 // Macro to output identification information provided in a request to open a channel
 #define PRM_US_OPEN_CHANNEL_START_TRACE						\
 	{														\
-	Kern::Printf("PRM_US_OPEN_CHANNEL_START_TRACE");\
-	BTraceContextN(BTrace::EResourceManagerUs, PRM_US_OPEN_CHANNEL_START, (TInt)(iClient), iUserNameUsed->Length(), iUserNameUsed->Ptr(), iUserNameUsed->Length()); \
+    TBuf8<256> printBuf;									\
+    printBuf.Zero();										\
+    UsTraceFormatPrint(printBuf, "%S", iUserNameUsed);	\
+	BTraceContextN(BTrace::EResourceManagerUs, PRM_US_OPEN_CHANNEL_START, 0, (TInt)(iClient), printBuf.Ptr(), printBuf.Length()); \
 	}
 
 // Macro to output identification information generated during a request to open a channel
 #define PRM_US_OPEN_CHANNEL_END_TRACE						\
 	{														\
-	BTraceContextN(BTrace::EResourceManagerUs, PRM_US_OPEN_CHANNEL_END, (TInt)(ClientHandle()), iUserNameUsed->Length(), iUserNameUsed->Ptr(), iUserNameUsed->Length()); \
+    TBuf8<256> printBuf;									\
+    printBuf.Zero();										\
+    UsTraceFormatPrint(printBuf, "%S", iUserNameUsed);		\
+	BTraceContextN(BTrace::EResourceManagerUs, PRM_US_OPEN_CHANNEL_END, 0, (TInt)(ClientHandle()), printBuf.Ptr(), printBuf.Length()); \
 	}
 
 // Macro to output information provided for a request to register with the Resource Controller
 #define PRM_US_REGISTER_CLIENT_START_TRACE					\
 	{														\
-    TUint32 stateRes32 = ((stateRes[0]&0xFF) << 16) | ((stateRes[1]&0xFF) << 8) | ((stateRes[2]&0xFF));\
-    TBuf8<80> printBuf;									\
+    TBuf8<256> printBuf;									\
     printBuf.Zero();										\
-    APPEND_STRING(iUserNameUsed);                      \
-	BTraceContextN(BTrace::EResourceManagerUs, PRM_US_REGISTER_CLIENT_START, (TInt)ClientHandle(), stateRes32, printBuf.Ptr(), printBuf.Length()); \
+    UsTraceFormatPrint(printBuf, "%S 0x%x %d", iUserNameUsed, (TInt)(ClientHandle()),(TInt)(stateRes[0]));	\
+	BTraceContextN(BTrace::EResourceManagerUs, PRM_US_REGISTER_CLIENT_START, (TInt)(stateRes[1]), (TInt)(stateRes[2]), printBuf.Ptr(), printBuf.Length()); \
 	}
 
 // Macro to output information after issuing a request to register with the Resource Controller
@@ -85,7 +88,10 @@
 // Macro to output information provided for a request to de-register with the Resource Controller
 #define PRM_US_DEREGISTER_CLIENT_START_TRACE				\
 	{														\
-	BTraceContextN(BTrace::EResourceManagerUs, PRM_US_DEREGISTER_CLIENT_START, (TInt)(ClientHandle()), iUserNameUsed->Length(), iUserNameUsed->Ptr(), iUserNameUsed->Length()); \
+    TBuf8<256> printBuf;									\
+    printBuf.Zero();										\
+    UsTraceFormatPrint(printBuf, "%S ", iUserNameUsed);		\
+	BTraceContextN(BTrace::EResourceManagerUs, PRM_US_DEREGISTER_CLIENT_START, 0, (TInt)(ClientHandle()), printBuf.Ptr(), printBuf.Length()); \
 	}
 
 // Macro to output information after issuing a request to de-register with the Resource Controller
@@ -97,76 +103,72 @@
 // Macro to output information provided for a request to get the state of a resource
 #define PRM_US_GET_RESOURCE_STATE_START_TRACE				\
 	{														\
-    TBuf8<80> printBuf;                                    \
-    printBuf.Zero();                                        \
-    APPEND_STRING(iUserNameUsed);                      \
+    TBuf8<256> printBuf;									\
+    printBuf.Zero();										\
+    UsTraceFormatPrint(printBuf, "%S ", iUserNameUsed);		\
 	BTraceContextN(BTrace::EResourceManagerUs, PRM_US_GET_RESOURCE_STATE_START, resourceId, (TInt)(ClientHandle()), printBuf.Ptr(), printBuf.Length()); \
 	}
 
 // Macro to output information on completion of a request to get the state of a resource
 #define PRM_US_GET_RESOURCE_STATE_END_TRACE					\
 	{														\
-    TBuf8<80> printBuf;									\
+    TBuf8<256> printBuf;									\
     printBuf.Zero();										\
-    APPEND_VAL(aClient);                                    \
-    APPEND_VAL(aResult);                                    \
+    UsTraceFormatPrint(printBuf, "%d %d", aClient, aResult);	\
 	BTraceContextN(BTrace::EResourceManagerUs, PRM_US_GET_RESOURCE_STATE_END, aResourceId, aLevel, printBuf.Ptr(), printBuf.Length()); \
 	}
 
 // Macro to output information provided for a request to set the state of a resource
 #define PRM_US_SET_RESOURCE_STATE_START_TRACE				\
 	{														\
-    TBuf8<80> printBuf;									\
+    TBuf8<256> printBuf;									\
     printBuf.Zero();										\
-    TInt ch = ClientHandle();                               \
-    APPEND_VAL(ch);                                         \
-    APPEND_STRING(iUserNameUsed);                      \
+    UsTraceFormatPrint(printBuf, "%S %d", iUserNameUsed, (TInt)(ClientHandle()));	\
 	BTraceContextN(BTrace::EResourceManagerUs, PRM_US_SET_RESOURCE_STATE_START, resourceId, newState, printBuf.Ptr(), printBuf.Length()); \
 	}
 
 // Macro to output information on completion of a request to set the state of a resource
 #define PRM_US_SET_RESOURCE_STATE_END_TRACE					\
 	{														\
-    TBuf8<80> printBuf;									\
+    TBuf8<256> printBuf;									\
     printBuf.Zero();										\
-    APPEND_VAL(aClient);                                    \
-    APPEND_VAL(aResult);                                    \
+    UsTraceFormatPrint(printBuf, "%d %d", aClient, aResult);	\
 	BTraceContextN(BTrace::EResourceManagerUs, PRM_US_SET_RESOURCE_STATE_END, aResourceId, aLevel, printBuf.Ptr(), printBuf.Length()); \
 	}
 
 // Macro to output information provided for a request to cancel the get resource state requests for a resource
 #define PRM_US_CANCEL_GET_RESOURCE_STATE_START_TRACE		\
 	{														\
-    TBuf8<80> printBuf;                                    \
-    printBuf.Zero();                                        \
-    APPEND_STRING(iUserNameUsed);                      \
+    TBuf8<256> printBuf;									\
+    printBuf.Zero();										\
+    UsTraceFormatPrint(printBuf, "%S ", iUserNameUsed);		\
 	BTraceContextN(BTrace::EResourceManagerUs, PRM_US_CANCEL_GET_RESOURCE_STATE_START, aResourceId, (TInt)(ClientHandle()), printBuf.Ptr(), printBuf.Length()); \
 	}
 
 // Macro to output information on completion of a request to cancel the get resource state requests for a resource
 #define PRM_US_CANCEL_GET_RESOURCE_STATE_END_TRACE			\
 	{														\
-    TBuf8<80> printBuf;                                    \
-    printBuf.Zero();                                        \
-    APPEND_STRING(iUserNameUsed);                      \
+    TBuf8<256> printBuf;									\
+    printBuf.Zero();										\
+    UsTraceFormatPrint(printBuf, "%S ", iUserNameUsed);		\
 	BTraceContextN(BTrace::EResourceManagerUs, PRM_US_CANCEL_GET_RESOURCE_STATE_END, aResourceId, (TInt)(ClientHandle()), printBuf.Ptr(), printBuf.Length()); \
 	}
 
 // Macro to output information provided for a request to cancel the set resource state requests for a resource
 #define PRM_US_CANCEL_SET_RESOURCE_STATE_START_TRACE		\
 	{														\
-    TBuf8<80> printBuf;                                    \
-    printBuf.Zero();                                        \
-    APPEND_STRING(iUserNameUsed);                      \
+    TBuf8<256> printBuf;									\
+    printBuf.Zero();										\
+    UsTraceFormatPrint(printBuf, "%S ", iUserNameUsed);		\
 	BTraceContextN(BTrace::EResourceManagerUs, PRM_US_CANCEL_SET_RESOURCE_STATE_START, aResourceId, (TInt)(ClientHandle()), printBuf.Ptr(), printBuf.Length()); \
 	}
 
 // Macro to output information on completion of a request to cancel the get resource state requests for a resource
 #define PRM_US_CANCEL_SET_RESOURCE_STATE_END_TRACE			\
 	{														\
-    TBuf8<80> printBuf;                                    \
-    printBuf.Zero();                                        \
-    APPEND_STRING(iUserNameUsed);                      \
+    TBuf8<256> printBuf;									\
+    printBuf.Zero();										\
+    UsTraceFormatPrint(printBuf, "%S ", iUserNameUsed);		\
 	BTraceContextN(BTrace::EResourceManagerUs, PRM_US_CANCEL_SET_RESOURCE_STATE_END, aResourceId, (TInt)(ClientHandle()), printBuf.Ptr(), printBuf.Length()); \
 	}
 
--- a/kernel/eka/include/drivers/resource.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/drivers/resource.h	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -12,7 +12,7 @@
 //
 // Description:
 // e32\include\drivers\resource.h
-//
+// 
 // WARNING: This file contains some APIs which are internal and are subject
 //          to change without notice. Such APIs should therefore not be used
 //          outside the Kernel and Hardware Services package.
@@ -26,18 +26,18 @@
 #include <drivers/resource_category.h>
 
 //Definition for resource flag setting. Used by PSL.
-const TUint KTypeMask             = 0x3;
-const TUint KUsageOffset          = 0x1F;
-const TUint KLongLatencySetOffset = 0x1E;
-const TUint KLongLatencyGetOffset = 0x1D;
-const TUint KClassOffset          = 0x1C;
-const TUint KSenseOffset          = 0x1A;
-const TUint KShared               = 0x1u << KUsageOffset;
-const TUint KLongLatencySet       = 0x1u << KLongLatencySetOffset;
-const TUint KLongLatencyGet       = 0x1u << KLongLatencyGetOffset;
-const TUint KLogical              = 0x1u << KClassOffset;
-const TUint KSenseNegative        = 0x1u << KSenseOffset;
-const TUint KSenseCustom          = 0x2u << KSenseOffset;
+static const TUint KTypeMask= 0x3;
+static const TUint KUsageOffset=0x1F;
+static const TUint KLongLatencySetOffset=0x1E;
+static const TUint KLongLatencyGetOffset=0x1D;
+static const TUint KClassOffset=0x1C;
+static const TUint KSenseOffset=0x1A;
+static const TUint KShared=0x1<<KUsageOffset;
+static const TUint KLongLatencySet=0x1<<KLongLatencySetOffset;
+static const TUint KLongLatencyGet=0x1<<KLongLatencyGetOffset;
+static const TUint KLogical=0x1<<KClassOffset;
+static const TUint KSenseNegative=0x01<<KSenseOffset;
+static const TUint KSenseCustom=0x2<<KSenseOffset;
 
 struct TPowerRequest;
 struct SIdleResourceInfo;
@@ -149,7 +149,7 @@
 /**
 @publishedPartner
 @prototype 9.5
-An object of this type represents a customized Dfc
+An object of this type prepresents a customised Dfc
 used to signal completion of the resource manager's asynchronous APIs
 and completion of notifications
 @see TPowerResourceManager
@@ -168,48 +168,19 @@
 	    __KTRACE_OPT(KRESMANAGER, Kern::Printf(">TPowerResourceCb::DfcFunc ClientId = 0x%x, ResourceId = %d, Level = %d, \
 			                    LevelOwnerId = %d, Result = %d", pCb->iClientId, pCb->iResourceId, pCb->iLevel, \
 								pCb->iLevelOwnerId, pCb->iResult));
-
-        pCb->Lock();
-        TUint ClientId = pCb->iClientId;
-        TUint ResourceId = pCb->iResourceId;
-        TInt Level = pCb->iLevel;
-        TInt LevelOwnerId = pCb->iLevelOwnerId;
-        TInt Result = pCb->iResult;
-        TAny* Param = pCb->iParam;
-        pCb->UnLock();
-
-        // Call the client specified callback function
-        pCb->iCallback(ClientId, ResourceId, Level, LevelOwnerId, Result, Param);    
-
-        pCb->Lock();
-        pCb->iPendingRequestCount--;
-        if(pCb->iPendingRequestCount == 0)
-            pCb->iResult = KErrCompletion; //Mark the callback object to act properly during cancellation of this request.
-        pCb->UnLock();
+	    // Call the client specified callback function
+        pCb->iCallback(pCb->iClientId, pCb->iResourceId, pCb->iLevel, pCb->iLevelOwnerId, pCb->iResult, pCb->iParam);
+		pCb->iResult = KErrCompletion; //Mark the callback object to act properly during cancellation of this request.
         PRM_CALLBACK_COMPLETION_TRACE
         }
 private:
-    void Lock()
-        {
-		__ASSERT_DEBUG(iMutex, Kern::Fault("TPowerResourceCb::Lock", __LINE__));
-        NKern::ThreadEnterCS();
-        Kern::MutexWait(*iMutex);
-        }
-    void UnLock()
-        {
-		__ASSERT_DEBUG(iMutex, Kern::Fault("TPowerResourceCb::UnLock", __LINE__));
-        Kern::MutexSignal(*iMutex);
-        NKern::ThreadLeaveCS();
-        }
     TAny* iParam; //Stores the aPtr argument passed in the constructor, to be passed as 5th argument to the callback function
-    TInt iResult; //Used to store the result as well as binary usage count for the callback
+    TInt iResult; //Used to store the result aswell as binary usage count for the callback
     TInt iLevel; // Level of the resource
 	TInt iLevelOwnerId; // Stores owner of the resource for asynchronous get operation
     TUint iResourceId; //Stores the ID of the resource whose state is changed/read asynchronously
     TUint iClientId; //Stores the ID of the client that requested the asynchronous operation
     TPowerResourceCbFn iCallback; //Callback function object
-	DMutex* iMutex;   
-    TInt iPendingRequestCount;
 #ifdef PRM_CONTROLLER
     friend class DPowerResourceController;
 #endif
--- a/kernel/eka/include/drivers/resourcecontrol.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/drivers/resourcecontrol.h	Wed Sep 01 12:34:56 2010 +0100
@@ -12,7 +12,7 @@
 //
 // Description:
 // e32\include\drivers\resourcecontrol.h
-//
+// 
 // WARNING: This file contains some APIs which are internal and are subject
 //          to change without notice. Such APIs should therefore not be used
 //          outside the Kernel and Hardware Services package.
@@ -133,22 +133,16 @@
 /* Macro to add dynamic resource to appropriate containers. Used only in extended version */
 #define ADD_TO_RESOURCE_CONTAINER(list, res, resId, resIdCount)				\
 	{																		\
-	TInt growBy = (list).GrowBy();										\
+	TUint16 growBy = (list).GrowBy();										\
 	if(!growBy)																\
-		(list).Initialise(PRM_DYNAMIC_RESOURCE_INITIAL_SIZE);		\
-    TInt r = (list).Add(res, resId);                                        \
-	if(r == KErrNoMemory)								                    \
+		(list).Initialise((TUint16)PRM_DYNAMIC_RESOURCE_INITIAL_SIZE);		\
+	if((list).Add(res, resId) == KErrNoMemory)								\
 		{																	\
-		r = (list).ReSize(growBy);										    \
-        if(r == KErrNone)                                                   \
-            {                                                               \
-            r = (list).Add(res, resId);										\
-            }                                                               \
+		TInt r = (list).ReSize(growBy);										\
+		if(r != KErrNone)													\
+			return r;														\
+		(list).Add(res, resId);												\
 		}																	\
-    if(r != KErrNone)                                                       \
-        {                                                                   \
-        return r;                                                           \
-        }                                                                   \
 	res->iResourceId |= resId;												\
 	resId = res->iResourceId;												\
 	resIdCount++;															\
@@ -160,24 +154,24 @@
 	switch((resId >> RESOURCE_BIT_IN_ID_CHECK) & 0x3)											\
 		{																						\
 		case PRM_STATIC_RESOURCE:																\
-			if((TInt)resId > iStaticResourceArray.Count())										\
+			if(resId > iStaticResourceArrayEntries)												\
 				UNLOCK_RETURN(KErrNotFound);													\
 			res = iStaticResourceArray[resId - 1];												\
 			if(!res)																			\
 				UNLOCK_RETURN(KErrNotFound);													\
 			break;																				\
 		case PRM_STATIC_DEPENDENCY_RESOURCE:													\
-			if((TInt)(resId & ID_INDEX_BIT_MASK) > iStaticResDependencyArray.Count())	\
+			if((TUint16)(resId & ID_INDEX_BIT_MASK) > iStaticResDependencyCount)				\
 				UNLOCK_RETURN(KErrNotFound);													\
-			res = iStaticResDependencyArray[(resId & ID_INDEX_BIT_MASK)  - 1];			\
+			res = iStaticResDependencyArray[(TUint16)(resId & ID_INDEX_BIT_MASK)  - 1];			\
 			break;																				\
 		case PRM_DYNAMIC_RESOURCE:																\
-			res = iDynamicResourceList[(resId & ID_INDEX_BIT_MASK)];					\
+			res = iDynamicResourceList[(TUint16)(resId & ID_INDEX_BIT_MASK)];					\
 			if(!res)																			\
 				UNLOCK_RETURN(KErrNotFound);													\
 			break;																				\
 		case PRM_DYNAMIC_DEPENDENCY_RESOURCE:													\
-			res = iDynamicResDependencyList[(resId & ID_INDEX_BIT_MASK)];				\
+			res = iDynamicResDependencyList[(TUint16)(resId & ID_INDEX_BIT_MASK)];				\
 			if(!res)																			\
 				UNLOCK_RETURN(KErrNotFound);													\
 			break;																				\
@@ -191,9 +185,9 @@
    it is called from the same thread. */
 #define VALIDATE_CLIENT(t)																						\
 	if(aClientId & USER_SIDE_CLIENT_BIT_MASK)																	\
-		pC = iUserSideClientList[(aClientId & ID_INDEX_BIT_MASK)];										\
+		pC = iUserSideClientList[(TUint16)(aClientId & ID_INDEX_BIT_MASK)];										\
 	else																										\
-		pC = iClientList[(aClientId & ID_INDEX_BIT_MASK)];												\
+		pC = iClientList[(TUint16)(aClientId & ID_INDEX_BIT_MASK)];												\
 	if(!pC)																										\
 		{																										\
 		__KTRACE_OPT(KRESMANAGER, Kern::Printf("Client ID not Found"));											\
@@ -216,9 +210,9 @@
 /** Macro to get the target client from appropriate client list based on bit 14 of client ID. */
 #define GET_TARGET_CLIENT()																				\
 	if(aTargetClientId & USER_SIDE_CLIENT_BIT_MASK) 													\
-		pC = iUserSideClientList[(aTargetClientId & ID_INDEX_BIT_MASK)];	    				\
+		pC = iUserSideClientList[(TUint16)(aTargetClientId & ID_INDEX_BIT_MASK)];	    				\
 	else																								\
-		pC = iClientList[(aTargetClientId & ID_INDEX_BIT_MASK)];								\
+		pC = iClientList[(TUint16)(aTargetClientId & ID_INDEX_BIT_MASK)];								\
 	if(!pC)																								\
 		{																								\
 		__KTRACE_OPT(KRESMANAGER, Kern::Printf("Target Client ID not found"));							\
@@ -324,16 +318,16 @@
 class DResourceCon : public DBase
 	{
 public:
-    inline TInt Initialise(TInt aInitialSize);
+    inline TInt Initialise(TUint16 aInitialSize);
     inline void Delete();
-    inline T*  operator[](TInt aIndex);
-    inline TInt Remove(T* aObj, TInt aIndex);
+    inline T*  operator[](TUint16 aIndex);
+    inline TInt Remove(T* aObj, TUint16 aIndex);
     inline TInt Add(T* aObj, TUint &aId);
     inline TInt Find(T*& anEntry, TDesC& aName);
-    inline TInt ReSize(TInt aGrowBy);
-    inline TInt Count() {return iCount;}
-    inline TInt Allocd() {return iAllocated;}
-	inline TInt GrowBy() {return iGrowBy;}
+    inline TInt ReSize(TUint16 aGrowBy);
+    inline TUint16 Count() {return iCount;}
+    inline TUint16 Allocd() {return iAllocated;}
+	inline TUint16 GrowBy() {return iGrowBy;}
 private:
     TUint16 iGrowBy; //Size to grow the size of the array.
     TUint16 iAllocated;  //Size of the array
@@ -460,6 +454,7 @@
     virtual TInt RegisterResourcesForIdle(TInt aPowerControllerId, TUint aNumResources, TPtr* aBuf);
     static void Panic(TUint8 aPanic);
     virtual TInt GetInterface(TUint aClientId, TUint aInterfaceId, TAny* aParam1, TAny* aParam2, TAny* aParam3);
+	virtual ~DPowerResourceController();
 	/**@internalComponent*/
 	void CompleteNotifications(TInt aClientId, DStaticPowerResource* aResource, TInt aState, TInt aReturnCode, TInt aLevelOwnerId, TBool aLock = ETrue);
 #ifdef PRM_ENABLE_EXTENDED_VERSION
@@ -486,12 +481,12 @@
 							  NKern::ThreadLeaveCS();}
 #ifdef PRM_ENABLE_EXTENDED_VERSION
 	//Default implementation, PSL re-implements these if features supported
-	virtual TInt DoRegisterStaticResourcesDependency(RPointerArray <DStaticPowerResourceD> & aStaticResourceDArray);
+	virtual TInt DoRegisterStaticResourcesDependency(DStaticPowerResourceD**& aStaticResourceDArray, TUint16& aStaticResourceDCount);
 #endif
 private:
     // pure virtual implemented by PSL - to be called by PIL
     virtual TInt DoInitController()=0;
-    virtual TInt DoRegisterStaticResources(RPointerArray <DStaticPowerResource> & aStaticResourceArray)=0;
+    virtual TInt DoRegisterStaticResources(DStaticPowerResource**& aStaticResourceArray, TUint16& aStaticResourceCount)=0;
     /**@internalComponent*/
     TInt CheckLevelAndAddClient(SPowerResourceClient* pC, TPowerRequest* Request);
     static void MsgQFunc(TAny* aPtr);
@@ -528,16 +523,18 @@
 	TInt GetDependentsIdForResource(TUint aResourceId, TAny* aInfo, TUint* aNumDepResources);
 	TInt HandleResourceRegistration(TPowerRequest& aReq);
 #endif
-protected:
+public:
 	DMutex* iResourceMutex;
-	TDfcQue* iDfcQ;
+protected:
+    TDfcQue* iDfcQ;
     TMessageQue *iMsgQ;
 #ifdef PRM_ENABLE_EXTENDED_VERSION
 	TDfcQue* iDfcQDependency;
 	TMessageQue* iMsgQDependency;
 	TBool iDfcQDependencyLock;
 #endif
-	RPointerArray <DStaticPowerResource> iStaticResourceArray;
+private:
+    DStaticPowerResource** iStaticResourceArray;
     DResourceCon<SPowerResourceClient> iClientList;
     DResourceCon<SPowerResourceClient> iUserSideClientList;
 #ifdef RESOURCE_MANAGER_SIMULATED_PSL
@@ -555,18 +552,19 @@
     TUint16 iClientLevelPoolGrowBy;
     TUint16 iRequestPoolCount;
     TUint16 iRequestPoolGrowBy;
+    TUint16 iStaticResourceArrayEntries; //Number of entries in the array including holes if any.
 	TUint16 iStaticResourceCount;  //Actual number of static resources registered (valid entries).
 	TUint	iReserved2; //Reserved for future use
 #ifdef PRM_ENABLE_EXTENDED_VERSION
-	DResourceCon<DDynamicPowerResource>   iDynamicResourceList;
-	DResourceCon<DDynamicPowerResourceD>  iDynamicResDependencyList;
-	RPointerArray <DStaticPowerResourceD> iStaticResDependencyArray;
+	DResourceCon<DDynamicPowerResource> iDynamicResourceList;
+	DResourceCon<DDynamicPowerResourceD> iDynamicResDependencyList;
+	DStaticPowerResourceD** iStaticResDependencyArray;
 	SPowerResourceClientLevel* iResourceLevelPool;
 	TUint16 iResourceLevelPoolCount;
+	TUint16 iStaticResDependencyCount;
 	TUint16 iDynamicResourceCount;
-	TUint8  iDynamicResDependencyCount;
-	TUint8  iSpare1;
-	TUint16 iSpare2;
+	TUint8 iDynamicResDependencyCount;
+	TUint8 iSpare2;
 	TUint  iReserved3; //Reserved for future use.
 #endif
 	};
--- a/kernel/eka/include/drivers/resourcecontrol.inl	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/drivers/resourcecontrol.inl	Wed Sep 01 12:34:56 2010 +0100
@@ -30,7 +30,7 @@
 /** Second stage constructor
  Allocates the specified size in kernel heap and creates a virtual link */
 template <class T>
-inline TInt DResourceCon<T>::Initialise(TInt aInitialSize)
+inline TInt DResourceCon<T>::Initialise(TUint16 aInitialSize)
 	{
     __KTRACE_OPT(KRESMANAGER, Kern::Printf(">DResourceCon<T>::Initialise"));
     __KTRACE_OPT(KRESMANAGER, Kern::Printf("aInitialSize %d", aInitialSize));
@@ -47,8 +47,8 @@
 		for(TInt c = 0; c < aInitialSize; c++)
 			iArray[c] = (T*)(c+1);
 		}
-    iAllocated = (TUint16)aInitialSize;
-    iGrowBy = (TUint16) (aInitialSize < 2 ? aInitialSize : aInitialSize/2);
+    iAllocated = aInitialSize;
+    iGrowBy = aInitialSize < 2 ? aInitialSize : TUint16(aInitialSize/2);
     iCount = 0;
     iInstanceCount = 0;
     iFreeLoc = 0;
@@ -65,7 +65,7 @@
 
 /** Resize the array */
 template <class T>
-inline TInt DResourceCon<T>::ReSize(TInt aGrowBy)
+inline TInt DResourceCon<T>::ReSize(TUint16 aGrowBy)
 	{
     __KTRACE_OPT(KRESMANAGER, Kern::Printf(">DResourceCon<T>::ReSize"));
     __KTRACE_OPT(KRESMANAGER, Kern::Printf("aGrowBy %d\n", aGrowBy));
@@ -73,7 +73,7 @@
 	TInt r = Kern::SafeReAlloc((TAny*&)iArray, iAllocated * sizeof(T*), (iAllocated+aGrowBy)*sizeof(T*));
 	if(r != KErrNone)
 		return r;
-    TInt c = iAllocated;
+    TUint16 c = iAllocated;
     //Virtually link the free ones
     while(c<(iAllocated+aGrowBy))
 		{
@@ -94,12 +94,11 @@
 inline void DResourceCon<T>::Delete()
 	{
     delete []iArray;
-    iArray = NULL;
 	}
 
 /** Find the object at the specified location */
 template <class T>
-inline T* DResourceCon<T>::operator[](TInt anIndex)
+inline T* DResourceCon<T>::operator[](TUint16 anIndex)
 	{
     __KTRACE_OPT(KRESMANAGER, Kern::Printf(">DResourceCon<T>::operator[], anIndex = %d", anIndex));
 	// Check if passed index is inside allocated range and is not free.
@@ -110,17 +109,17 @@
 
 /** Remove the specified object from the container */
 template <class T>
-inline TInt DResourceCon<T>::Remove(T* /*aObj */, TInt aIndex)
+inline TInt DResourceCon<T>::Remove(T* /*aObj */, TUint16 aIndex)
 	{
     __KTRACE_OPT(KRESMANAGER, Kern::Printf(">DResourceCon<T>::Remove"));
-    if(aIndex>=(TInt)iAllocated)
+    if(aIndex>=iAllocated)
 		{
 		__KTRACE_OPT(KRESMANAGER, Kern::Printf("Object not found, iAllocated = %d, index = %d", iAllocated, aIndex));
 		DPowerResourceController::Panic(DPowerResourceController::EObjectNotFoundInList);
 		}
 	// Add the entry to the free location
 	iArray[aIndex] = (T*)iFreeLoc;
-	iFreeLoc = (TUint16)aIndex;
+	iFreeLoc = aIndex;
     iCount--; //Decrement valid client count
 	__KTRACE_OPT(KRESMANAGER, Kern::Printf(">DResourceCon<T>::Remove"));
     return KErrNone;
@@ -137,9 +136,9 @@
     //Update in the array in the free location
 	aId = ((++iInstanceCount & INSTANCE_COUNT_BIT_MASK) << INSTANCE_COUNT_POS); //Instance count
 	aId |= (iFreeLoc & ID_INDEX_BIT_MASK); //Array index
-    TUint nextFreeLoc = (TUint)iArray[iFreeLoc];
+    TUint16 nextFreeLoc = (TUint16)(TUint)iArray[iFreeLoc];
     iArray[iFreeLoc] = aObj;
-    iFreeLoc = (TUint16)nextFreeLoc;
+    iFreeLoc = nextFreeLoc;
     __KTRACE_OPT(KRESMANAGER, Kern::Printf("iFreeLoc %d", iFreeLoc));
     iCount++;  //Increment the valid client count
     return KErrNone;
@@ -152,7 +151,7 @@
     __KTRACE_OPT(KRESMANAGER, Kern::Printf(">DResourceCon<T>::Find, aName %S", &aName));
     anEntry = NULL;
     T* pC=anEntry;
-    for(TInt count = 0; count < (TInt)iAllocated; count++)
+    for(TUint count = 0; count<iAllocated; count++)
 		{
         /* Check whether the location is free */
         if(((TUint)iArray[count]) <= iAllocated)
--- a/kernel/eka/include/drivers/resourcecontrol_clientsettings.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-// 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:
-// e32\include\drivers\resourcecontrol_clientsettings.h
-//
-//
-
-#ifndef __RESOURCECONTROL_CLIENTSETTINGS_H__
-#define __RESOURCECONTROL_CLIENTSETTINGS_H__
-
-#include <drivers/hcr.h>
-
-const TUint KBitPerClientSettings = 5; // 0 - 31, Max of 32 elements defined for use per client
-const TUint KClientElementIdBase = 0x10;	// Max of 16 elements defined for use by resman
-const TUint8 KStaticResourceTableSize = 5;
-
-inline TUint ElementId_ClientSettingBase(TUint aClientToken)
-	{
-	return	((aClientToken << KBitPerClientSettings) + KClientElementIdBase);
-	}
-
-inline HCR::TElementId ElementId_ClientName(TUint aClientToken)
-	{
-	return ((HCR::TElementId) ElementId_ClientSettingBase(aClientToken));
-	}
-
-inline HCR::TElementId ElementId_ClientPropertyFlag(TUint aClientToken)
-	{
-	return ((HCR::TElementId) (ElementId_ClientSettingBase(aClientToken) + 1));
-	}
-
-inline HCR::TElementId ElementId_ClientPreallocation(TUint aClientToken)
-	{
-	return ((HCR::TElementId) (ElementId_ClientSettingBase(aClientToken) + 2));
-	}
-
-inline HCR::TElementId ElementId_ClientStaticResource(TUint aClientToken, TUint aResource)
-	{
-	return ((HCR::TElementId) (ElementId_ClientSettingBase(aClientToken) + 3 + aResource));
-	}
-
-inline HCR::TElementId ElementId_ClientDynamicResource(TUint aClientToken, TUint aResource)
-	{
-	return ((HCR::TElementId) (ElementId_ClientSettingBase(aClientToken) + 3 + KStaticResourceTableSize + aResource));
-	}
-
-
-// Dynamic Resource Settings
-
-const TUint KDynamicResourceElementIdBase = 0x20000;
-const TUint KBitPerDynamicResourceSettings = 5; // 0 - 31, Max of 32 elements defined for use per dynamic resource
-
-inline TUint ElementId_DynamicResourceBase(TUint aDynamicResource)
-	{
-	return ((aDynamicResource << KBitPerDynamicResourceSettings) + KDynamicResourceElementIdBase);
-	}
-
-inline HCR::TElementId ElementId_DynamicResourceName(TUint aDynamicResource)
-	{
-	return ((HCR::TElementId) (ElementId_DynamicResourceBase(aDynamicResource)));
-	}
-
-inline HCR::TElementId ElementId_DynamicResourcePropertyFlag(TUint aDynamicResource)
-	{
-	return ((HCR::TElementId) (ElementId_DynamicResourceBase(aDynamicResource) + 1));
-	}
-
-inline HCR::TElementId ElementId_DynamicResourceMaxLevel(TUint aDynamicResource)
-	{
-	return ((HCR::TElementId) (ElementId_DynamicResourceBase(aDynamicResource) + 2));
-	}
-
-inline HCR::TElementId ElementId_DynamicResourceMinLevel(TUint aDynamicResource)
-	{
-	return ((HCR::TElementId) (ElementId_DynamicResourceBase(aDynamicResource) + 3));
-	}
-
-inline HCR::TElementId ElementId_DynamicResourceDefaultLevel(TUint aDynamicResource)
-	{
-	return ((HCR::TElementId) (ElementId_DynamicResourceBase(aDynamicResource) + 4));
-	}
-
-inline HCR::TElementId ElementId_DynamicResourceDependencyMask1(TUint aDynamicResource)
-	{
-	return ((HCR::TElementId) (ElementId_DynamicResourceBase(aDynamicResource) + 5));
-	}
-
-inline HCR::TElementId ElementId_DynamicResourceDependencyMask2(TUint aDynamicResource)
-	{
-	return ((HCR::TElementId) (ElementId_DynamicResourceBase(aDynamicResource) + 6));
-	}
-
-inline HCR::TElementId ElementId_DynamicResourceDependencyMask3(TUint aDynamicResource)
-	{
-	return ((HCR::TElementId) (ElementId_DynamicResourceBase(aDynamicResource) + 7));
-	}
-
-#endif
-
--- a/kernel/eka/include/drivers/resourcecontrol_settings.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-// 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:
-// e32\include\drivers\resourcecontrol_settings.h
-//
-//
-
-#ifndef __RESOURCECONTROL_SETTINGS_H__
-#define __RESOURCECONTROL_SETTINGS_H__
-
-#include <drivers/hcr.h>
-
-const HCR::TElementId KPRMPoolSizeKernelClient = 0;
-const HCR::TElementId KPRMPoolSizeUserClient = 1;
-const HCR::TElementId KPRMPoolSizeClientLevel = 2;
-const HCR::TElementId KPRMPoolSizeClientRequest = 3;
-
-#endif
-
--- a/kernel/eka/include/drivers/resourcecontrol_trace.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/drivers/resourcecontrol_trace.h	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -26,6 +26,16 @@
 #define __RESOURCECONTROL_TRACE_H__
 #ifdef BTRACE_RESOURCE_MANAGER
 
+//Function to format the output.
+static void TraceFormatPrint(TDes8& aBuf, const char* aFmt, ...)
+	{
+	if(aBuf.MaxLength() == 0)
+		return;
+	VA_LIST list;
+	VA_START(list,aFmt);
+	Kern::AppendFormat(aBuf,aFmt,list);
+	}
+
 //definition of subcategories.
 #define PRM_REGISTER_RESOURCE BTrace::ERegisterResource
 #define PRM_REGISTER_CLIENT BTrace::ERegisterClient
@@ -56,27 +66,13 @@
 #define PRM_REGISTER_RESOURCE_DEPENDENCY BTrace::ERegisterResourceDependency
 #define PRM_DEREGISTER_RESOURCE_DEPENDENCY BTrace::EDeRegisterResourceDependency
 #endif
-
-#define APPEND_VAL(val)                                                                        \
-    {                                                                                               \
-    printBuf.Append((TUint8 *)&(val), sizeof(val));                                                       \
-    }                                                                                           
-#define APPEND_STRING(des_ptr)                                                                           \
-    {                                                                                               \
-	TUint length = (des_ptr)->Length();                                                              \
-	printBuf.Append((TUint8 *)&length, sizeof(TUint));                                                     \
-	printBuf.Append(*(des_ptr));                                                                       \
-    }
-
 //Macro to output resource information
 #define PRM_REGISTER_RESOURCE_TRACE																	\
 	{																								\
     TBuf8<80> printBuf;																				\
     printBuf.Zero();													                            \
-    APPEND_VAL(pResInfo->iMinLevel);                                                       \
-    APPEND_VAL(pResInfo->iMaxLevel);                                                       \
-    APPEND_VAL(pResInfo->iDefaultLevel);                                                   \
-    APPEND_STRING(pR->iName);                                                                     \
+    TraceFormatPrint(printBuf, "%S %d %d %d", pR->iName, pResInfo->iMinLevel, pResInfo->iMaxLevel,	\
+																		 pResInfo->iDefaultLevel);	\
 	BTraceContextN(BTrace::EResourceManager, PRM_REGISTER_RESOURCE, resCount+1, pR, printBuf.Ptr(), \
 	                                                                     printBuf.Length());		\
 	}
@@ -84,21 +80,15 @@
 //Macro to output client details. Used during client registration
 #define PRM_CLIENT_REGISTER_TRACE			                                                        \
 	{									                                                            \
-    TBuf8<80> printBuf;                                                                             \
-    printBuf.Zero();                                                                                \
-    APPEND_STRING(pC->iName);                                                                       \
 	BTraceContextN(BTrace::EResourceManager, PRM_REGISTER_CLIENT, aClientId, (TUint)pC,				\
-                                                printBuf.Ptr(), printBuf.Length());             \
+                                                pC->iName->Ptr(), pC->iName->Length());             \
 	}
 
 //Used during client deregistration
 #define PRM_CLIENT_DEREGISTER_TRACE																	\
 	{																								\
-    TBuf8<80> printBuf;                                                                             \
-    printBuf.Zero();                                                                                \
-    APPEND_STRING(pC->iName);                                                                       \
 	BTraceContextN(BTrace::EResourceManager, PRM_DEREGISTER_CLIENT, aClientId,						\
-                          (TUint)pC, printBuf.Ptr(), printBuf.Length());						    \
+                          (TUint)pC, pC->iName->Ptr(), pC->iName->Length());						\
 	}
 
 //Used to resource state change operation.Used at the start of the operation. 
@@ -106,9 +96,7 @@
 	{																								\
     TBuf8<80> printBuf;																				\
 	printBuf.Zero();																				\
-	APPEND_VAL(aNewState);                                                                          \
-	APPEND_STRING(pC->iName);                                                                     \
-	APPEND_STRING(pR->iName);                                                                     \
+    TraceFormatPrint(printBuf, "%S %S %d", pC->iName, pR->iName, aNewState);						\
 	BTraceContextN(BTrace::EResourceManager, PRM_CLIENT_STATE_CHANGE_START, pC->iClientId,			\
 	                                      aResourceId, printBuf.Ptr(), printBuf.Length());			\
 	}
@@ -118,10 +106,7 @@
 	{																								\
 	TBuf8<80> printBuf;																				\
 	printBuf.Zero();																				\
-	APPEND_VAL(r);                                                                                  \
-	APPEND_VAL(aNewState);                                                                          \
-	APPEND_STRING(pC->iName);                                                                  \
-	APPEND_STRING(pR->iName);                                                                  \
+	TraceFormatPrint(printBuf, "%S %S %d %d", pC->iName, pR->iName, r, aNewState);					\
 	BTraceContextN(BTrace::EResourceManager, PRM_CLIENT_STATE_CHANGE_END, pC->iClientId,			\
 						                 aResourceId, printBuf.Ptr(), printBuf.Length());			\
 	}
@@ -157,6 +142,8 @@
 //Calling TraceFormatPrint just to avoid warning
 #define PRM_CALLBACK_COMPLETION_TRACE																\
 	{																								\
+	TPtr8 zeroDes(NULL, 0);																		\
+	TraceFormatPrint(zeroDes, "%d", pCb->iClientId);												\
 	BTraceContext8(BTrace::EResourceManager, PRM_CALLBACK_COMPLETE, pCb->iClientId,					\
                                                                  pCb->iResourceId);					\
 	}
@@ -169,9 +156,9 @@
 
 #define PRM_PSL_RESOURCE_GET_STATE_START_TRACE														\
 	{																								\
-    TBuf8<80> printBuf;                                                                             \
-    printBuf.Zero();                                                                                \
-    APPEND_STRING(iName);                                                                           \
+	TBuf8<80> printBuf;																				\
+	printBuf.Zero();																				\
+	TraceFormatPrint(printBuf, "%S ", iName);														\
 	BTraceContextN(BTrace::EResourceManager, PRM_PSL_RESOURCE_GET_STATE_START, aRequest.ClientId(), \
 										 aRequest.ResourceId(), printBuf.Ptr(), printBuf.Length());	\
 	}
@@ -181,8 +168,7 @@
 	{																								\
 	TBuf8<80> printBuf;																				\
 	printBuf.Zero();																				\
-	APPEND_STRING(pC->iName);                                                                     \
-	APPEND_STRING(pR->iName);                                                                  \
+    TraceFormatPrint(printBuf, "%S %S", pC->iName, pR->iName);										\
 	BTraceContextN(BTrace::EResourceManager, PRM_CLIENT_GET_STATE_START, pC->iClientId, aResourceId,\
 												                 printBuf.Ptr(), printBuf.Length());\
 	}
@@ -191,9 +177,7 @@
 	{																								\
 	TBuf8<80> printBuf;																				\
 	printBuf.Zero();																				\
-	APPEND_VAL(iCurLevel);                                                                          \
-	APPEND_VAL(retVal);                                                                             \
-	APPEND_STRING(iName);                                                                      \
+	TraceFormatPrint(printBuf, "%S %d %d", iName, iCurLevel,retVal);								\
 	BTraceContextN(BTrace::EResourceManager, PRM_PSL_RESOURCE_GET_STATE_END, aRequest.ClientId(),	\
 										aRequest.ResourceId(), printBuf.Ptr(), printBuf.Length());	\
 	}
@@ -203,10 +187,7 @@
 	{																								\
 	TBuf8<80> printBuf;																				\
 	printBuf.Zero();																				\
-	APPEND_VAL(aState);                                                                             \
-	APPEND_VAL(r);                                                                                  \
-	APPEND_STRING(pC->iName);                                                                  \
-	APPEND_STRING(pR->iName);                                                                  \
+	TraceFormatPrint(printBuf, "%S %S %d %d", pC->iName, pR->iName, aState, r);						\
 	BTraceContextN(BTrace::EResourceManager, PRM_CLIENT_GET_STATE_END, pC->iClientId, aResourceId,	\
 																 printBuf.Ptr(), printBuf.Length());\
 	}
@@ -216,9 +197,7 @@
 	{																								\
 	TBuf8<80> printBuf;																				\
 	printBuf.Zero();																				\
-	APPEND_VAL(r);                                                                                  \
-	APPEND_STRING(pC->iName);                                                                  \
-	APPEND_STRING(pR->iName);                                                                  \
+	TraceFormatPrint(printBuf, "%S %S %d", pC->iName, pR->iName, r);								\
 	BTraceContextN(BTrace::EResourceManager, PRM_CANCEL_LONG_LATENCY_OPERATION, pC->iClientId,		\
 										      aResourceId, printBuf.Ptr(), printBuf.Length());		\
 	}
@@ -227,10 +206,7 @@
 	{																									\
 	TBuf8<80> printBuf;																					\
 	printBuf.Zero();																					\
-	APPEND_VAL(iCurLevel);                                                                              \
-	TInt RequestLevel = aRequest.Level();                                                                      \
-	APPEND_VAL(RequestLevel);                                                                                 \
-	APPEND_STRING(iName);                                                                          \
+	TraceFormatPrint(printBuf, "%S %d %d", iName, iCurLevel, aRequest.Level());							\
 	BTraceContextN(BTrace::EResourceManager, PRM_PSL_RESOURCE_CHANGE_STATE_START, aRequest.ClientId(),	\
 											aRequest.ResourceId(), printBuf.Ptr(), printBuf.Length());  \
 	}
@@ -239,11 +215,7 @@
 	{																									\
 	TBuf8<80> printBuf;																					\
 	printBuf.Zero();																					\
-	APPEND_VAL(iCurLevel);                                                                              \
-    TInt RequestLevel = aRequest.Level();                                                                      \
-	APPEND_VAL(RequestLevel);                                                                                  \
-	APPEND_VAL(retVal);                                                                                 \
-	APPEND_STRING(iName);                                                                          \
+	TraceFormatPrint(printBuf, "%S %d %d %d", iName, iCurLevel, aRequest.Level(),retVal);				\
 	BTraceContextN(BTrace::EResourceManager, PRM_PSL_RESOURCE_CHANGE_STATE_END, aRequest.ClientId(),	\
 										  aRequest.ResourceId(), printBuf.Ptr(), printBuf.Length());	\
 	}
@@ -252,9 +224,7 @@
 	{																									\
 	TBuf8<80> printBuf;																					\
 	printBuf.Zero();																					\
-	APPEND_VAL(iDefaultLevel);                                                                          \
-	APPEND_VAL(iFlags);                                                                                 \
-	APPEND_STRING(iName);                                                                          \
+	TraceFormatPrint(printBuf, "%d %d %S", iDefaultLevel, iFlags, iName);								\
 	BTraceContextN(BTrace::EResourceManager, PRM_PSL_RESOURCE_CREATE, iMinLevel, iMaxLevel,				\
 											            printBuf.Ptr(), printBuf.Length());				\
 	}
@@ -263,6 +233,8 @@
 //Calling TraceFormatPrint just to avoid warning
 #define PRM_BOOTING_TRACE																				\
 	{																									\
+	TPtr8 zeroDes(NULL, 0);																			\
+	TraceFormatPrint(zeroDes, "%d", aReason);															\
 	BTraceContext4(BTrace::EResourceManager, PRM_BOOTING, (TUint)aReason);								\
 	}
 
@@ -270,14 +242,12 @@
 //Macro to output static resource with dependency
 #define PRM_REGISTER_STATIC_RESOURCE_WITH_DEPENDENCY_TRACE													\
 	{																										\
-	TBuf8<80> printBuf;																							\
-	printBuf.Zero();																							\
-	APPEND_VAL(pResInfo->iMinLevel);                                                                        \
-	APPEND_VAL(pResInfo->iMaxLevel);                                                                        \
-	APPEND_VAL(pResInfo->iDefaultLevel);                                                                    \
-	APPEND_STRING(pR->iName);                                                                          \
+	TBuf8<80> pBuf;																							\
+	pBuf.Zero();																							\
+	TraceFormatPrint(pBuf, "%S %d %d %d", pR->iName, pResInfo->iMinLevel, pResInfo->iMaxLevel,				\
+										                             pResInfo->iDefaultLevel);				\
 	BTraceContextN(BTrace::EResourceManager, PRM_REGISTER_STATIC_RESOURCE_WITH_DEPENDENCY, pR->iResourceId, \
-	                                                               pR, printBuf.Ptr(), printBuf.Length());	\
+	                                                                        pR, pBuf.Ptr(), pBuf.Length());	\
 	}
 
 //Macro to output dynamic resource registration.
@@ -285,9 +255,7 @@
 	{																										\
 	TBuf8<80> printBuf;																						\
 	printBuf.Zero();																						\
-	APPEND_VAL(aPDRes);                                                                                     \
-	APPEND_STRING(aClientPtr->iName);                                                                         \
-	APPEND_STRING(aPDRes->iName);                                                                      \
+	TraceFormatPrint(printBuf, "%S %S %d", aClientPtr->iName, aPDRes->iName, aPDRes);						\
 	BTraceContextN(BTrace::EResourceManager, PRM_REGISTER_DYNAMIC_RESOURCE, aClientPtr->iClientId,			\
 										   aPDRes->iResourceId, printBuf.Ptr(), printBuf.Length());			\
 	}
@@ -297,10 +265,7 @@
 	{																										\
 	TBuf8<80> printBuf;																						\
 	printBuf.Zero();																						\
-	APPEND_VAL(pDR);                                                                                        \
-	APPEND_VAL(level);                                                                                      \
-	APPEND_STRING(aClientPtr->iName);                                                                  \
-	APPEND_STRING(pDR->iName);                                                                         \
+	TraceFormatPrint(printBuf, "%S %S %d %d", aClientPtr->iName, pDR->iName, pDR, level);					\
 	BTraceContextN(BTrace::EResourceManager, PRM_DEREGISTER_DYNAMIC_RESOURCE, aClientPtr->iClientId,		\
 												pDR->iResourceId, printBuf.Ptr(), printBuf.Length());		\
 	}
@@ -308,14 +273,10 @@
 //Macro to output registration of resource dependency.
 #define PRM_REGISTER_RESOURCE_DEPENDENCY_TRACE																\
 	{																										\
-	TBuf8<80> printBuf;																					\
+	TBuf8<256> printBuf;																					\
 	printBuf.Zero();																						\
-	APPEND_VAL(pR2->iResourceId);                                                                           \
-    APPEND_VAL(pR1);                                                                                        \
-    APPEND_VAL(pR2);                                                                                        \
-    APPEND_STRING(aClientPtr->iName);                                                                  \
-    APPEND_STRING(pR1->iName);                                                                         \
-    APPEND_STRING(pR2->iName);                                                                         \
+	TraceFormatPrint(printBuf, "%S %S %d %S %d %d", aClientPtr->iName, pR1->iName, pR2->iResourceId,		\
+										                                      pR2->iName, pR1, pR2);		\
 	BTraceContextN(BTrace::EResourceManager, PRM_REGISTER_RESOURCE_DEPENDENCY, aClientPtr->iClientId,		\
 	                                            pR1->iResourceId, printBuf.Ptr(), printBuf.Length());		\
 	}
@@ -323,14 +284,10 @@
 //Macro to output deregistration of resource dependency.
 #define PRM_DEREGISTER_RESOURCE_DEPENDENCY_TRACE															\
 	{																										\
-	TBuf8<80> printBuf;																					\
+	TBuf8<256> printBuf;																					\
 	printBuf.Zero();																						\
-	APPEND_VAL(pDR2->iResourceId);                                                                          \
-    APPEND_VAL(pDR1);                                                                                       \
-    APPEND_VAL(pDR2);                                                                                       \
-    APPEND_STRING(aClientPtr->iName);                                                                  \
-    APPEND_STRING(pDR1->iName);                                                                        \
-    APPEND_STRING(pDR2->iName);                                                                        \
+	TraceFormatPrint(printBuf, "%S %S %d %S %d %d", aClientPtr->iName, pDR1->iName, pDR2->iResourceId,		\
+												                             pDR2->iName, pDR1, pDR2);		\
 	BTraceContextN(BTrace::EResourceManager, PRM_DEREGISTER_RESOURCE_DEPENDENCY, aClientPtr->iClientId,		\
 	                                              pDR1->iResourceId, printBuf.Ptr(), printBuf.Length());	\
 	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/include/drivers/rm_debug_driver.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,197 @@
+// 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:
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+
+#ifndef __RM_DEBUG_DRIVER_H__
+#define __RM_DEBUG_DRIVER_H__
+
+#include "d_rmd_stepping.h"
+#include "d_rmd_breakpoints.h"
+#include "d_driver_event_info.h"
+
+// From mmboot.h header
+const TLinAddr	KDataSectionEnd			=0x40000000u;
+const TLinAddr	KRomLinearBase			=0xF8000000u;
+
+
+#define ROM_LINEAR_BASE KRomLinearBase
+
+// Result checking
+#define ReturnIfError(x) { TInt y = x; if (KErrNone != y) return y; }
+
+//
+// class DRM_DebugDriverFactory
+//
+class DRM_DebugDriverFactory : public DLogicalDevice
+{
+public:
+
+	DRM_DebugDriverFactory();
+	virtual TInt Install();
+	virtual void GetCaps(TDes8& aDes) const;
+	virtual TInt Create(DLogicalChannelBase*& aChannel);
+};
+
+class DRM_DebugEventHandler;
+//
+// DRM_DebugChannel
+//
+class DRM_DebugChannel : public DLogicalChannel
+{
+public:
+
+	DRM_DebugChannel(DLogicalDevice* aLogicalDevice);
+	~DRM_DebugChannel();
+
+	virtual TInt DoCreate(TInt aUnit, const TDesC* anInfo, const TVersion& aVer);	
+	virtual void HandleMsg(TMessageBase* aMsg);
+	virtual TInt SendMsg(TMessageBase* aMsg);
+	TInt SendRequest(TMessageBase* aMsg);
+	
+	//called from the event handler
+	TBool RemoveProcess(TAny* a1, TAny* a2);
+	TBool StartThread(TAny* a1, TAny* a2);
+	TBool AddLibrary(TAny* a1, TAny* a2);
+	TBool RemoveLibrary(TAny* a1, TAny* a2);
+	TBool HandleEventKillThread(TAny* a1, TAny* a2);
+	TBool HandleSwException(TAny* a1, TAny* a2);
+	TBool HandleHwException(TAny* a1, TAny* a2);
+	TBool HandleUserTrace(TAny* a1, TAny* a2);
+	TBool HandleUnsupportedEvent(TAny* a1, TAny* a2) { return EFalse; }
+	TBool HandleAddProcessEvent(TAny* a1, TAny* a2);
+	TBool HandleRemoveProcessEvent(TAny* a1, TAny* a2);
+	
+	// Used to be able to signal events to the DSS
+	DThread* ClientThread(void) {return iClientThread; };
+	
+protected:
+	virtual void DoCancel(TInt aReqNo);
+	virtual void DoRequest(TInt aReqNo, TRequestStatus* aStatus, TAny* a1, TAny* a2);
+	virtual TInt DoControl(TInt aFunction, TAny *a1, TAny *a2);
+	
+private:
+	TInt PreAsyncGetValue(Debug::TEventInfo* aValue, TRequestStatus* aStatus);
+	TInt CreateDfcQ();
+	void DestroyDfcQ();
+	TBool HandleInvalidOpCodeException(TDriverEventInfo& aEventInfo, DThread* aCurrentThread);
+
+	TInt SetBreak(TSetBreakInfo* aBreakInfo);
+	TInt StepRange(DThread* aThread, TRM_DebugStepInfo* aStepInfo);
+	TInt ReadMemory(DThread* aThread, TRM_DebugMemoryInfo* aMemoryInfo);
+	TInt WriteMemory(DThread* aThread, TRM_DebugMemoryInfo* aMemoryInfo);
+	TInt ReadRegistersLegacy(DThread* aThread, TRM_DebugRegisterInfo* aRegisterInfo);
+	TInt WriteRegistersLegacy(DThread* aThread, const TRM_DebugRegisterInfo* aRegisterInfo);
+	TInt ReadRegisters(DThread* aThread, TRM_DebugRegisterInformation* aRegisterInfo) const;
+	TInt WriteRegisters(DThread* aThread, TRM_DebugRegisterInformation* aRegisterInfo) const;
+	TInt GetProcessInfo(TInt aIndex, TRM_DebugTaskInfo* aTaskInfo);
+	TInt GetThreadInfo(TInt aIndex, TRM_DebugTaskInfo* aTaskInfo);
+	TInt GetList(TListInformation* aListInformation) const;
+	
+	TInt Step(const TUint32 aThreadId, const TUint32 aNumSteps);
+	TInt KillProcess(const TUint32 aProcessId, const TInt aReason);
+
+	//Crash Flash	
+	TInt ReadCrashLog(TFlashInfo* aBuffer);
+	TInt WriteCrashLog(TFlashInfo* aBuffer) const;
+	TInt EraseCrashLog();
+
+	// Stop/go
+	TInt DoSuspendThread(DThread *aThread);
+	TInt DoResumeThread(DThread *aThread);
+	TInt DoStepRange(DThread *aThread, const TUint32 aStartAddress, const TUint32 aStopAddress, TBool aStepInto, TBool aResumeOnceOutOfRange, const TUint32 aNumSteps, TBool aUserRequest = EFalse);
+	TInt DoReadMemory(const DThread *aThread, const TUint32 aAddress, const TUint32 aLength, TDes8 &aData) const;
+	TInt DoWriteMemory(DThread *aThread, const TUint32 aAddress, const TUint32 aLength, TDes8 &aData);
+	TInt DoReadRegisters(DThread *aThread, const TInt16 aFirstRegister, const TInt16 aLastRegister, TDes8 &aValues);
+	TInt DoReadRegisters(DThread *aThread, const TDesC8 &aRegisterIds, TDes8 &aRegisterValues, TDes8 &aRegisterFlags) const;
+	TInt DoWriteRegisters(DThread *aThread, const TInt16 aFirstRegister, const TInt16 aLastRegister, TDesC8 &aValues);
+	TInt DoWriteRegisters(DThread *aThread, const TDesC8 &aRegisterIds, TDesC8 &aRegisterValues, TDes8 &aRegisterFlags) const;
+	TInt DoGetProcessInfo(const TInt aIndex, TRM_DebugTaskInfo *aInfo);
+	TInt DoGetThreadInfo(const TInt aIndex, TRM_DebugTaskInfo *aInfo);
+	TBool DoSecurityCheck();
+
+	TInt TryToReadMemory(const DThread *aThread, const TAny *aSrc, TAny *aDest, const TUint32 aLength) const;
+	TInt TryToWriteMemory(const DThread *aThread, TAny *aDest, const TAny *aSrc, const TUint32 aLength);
+	TInt32 ReadRegister(DThread *aThread, TInt aNum);
+	TInt32 ReadDebugRegisterValue(DThread *aThread, const Debug::TRegisterInfo aDebugRegisterId, T4ByteRegisterValue &aValue) const;
+	TInt32 ReadKernelRegisterValue(DThread *aThread, const TArmReg aKernelRegisterId, T4ByteRegisterValue &aValue) const;
+	
+	void NotifyEvent(const TDriverEventInfo& aEventInfo);
+
+	TInt GetTRegisterInfo(const TDesC8 &aRegisterIds, const TUint aIndex, Debug::TRegisterInfo &aValue) const;
+	TInt GetDebugRegisterId(const TArmReg aKernelRegister, Debug::TRegisterInfo& aDebugRegister) const;
+	TInt GetKernelRegisterId(const Debug::TRegisterInfo aDebugRegister, TArmReg& aKernelRegister) const;
+	TBool GetFlagAtOffset(const TUint32 aFlags, const TArmReg aIndex) const;
+
+	TInt AllocAndReadDes(DThread *aThread, const TDesC8& aSrcDes, TPtr8& aDestDes, const TBool aReadFromClient=ETrue, const TUint aOffset=0) const;
+
+	TInt AttachProcess(TAny* a1, TAny* a2);
+	TInt DetachProcess(TAny* a1, TAny* a2);
+	TInt DetachAgent(TAny* a1, TAny* a2);
+	TInt SetEventAction(TAny* a1, TAny* a2);
+	TBool CheckSuspended(const DThread *aThread) const;
+
+	// Needed so moved functions can access iBreakpoint list and related functions
+	friend class D_RMD_Breakpoints;
+	// Needed so moved functions can access stepping functionality
+	friend class DRMDStepping;
+
+	// helper function was previously in rm_debug_kerneldriver.cpp
+	inline TInt Bitcount(TUint32 val)
+		{
+			TInt nbits;
+
+			for (nbits = 0; val != 0; nbits++)
+			{
+				val &= val - 1;		// delete rightmost 1-bit in val
+			}
+			
+			return nbits;
+		}
+
+	// Security critical - this returns whether the specified process is debuggable or not
+	TInt IsDebuggable(const TUint32 aProcessId);
+
+private:
+	DThread* iClientThread;
+	DRM_DebugEventHandler* iEventHandler;
+	
+	TUint32 iExcludedROMAddressStart;
+	TUint32 iExcludedROMAddressEnd;
+	
+	TUint32 iPageSize;
+	
+	RArray<Debug::TProcessInfo> iDebugProcessList; //processes that we are debugging
+
+	D_RMD_Breakpoints* iBreakManager;	// new D_RMD_Breakpoints
+
+	DRMDStepping* iStepper;				// new DRMDStepping
+
+	DSemaphore* iStepLock;				// Synchronisation for stepping code.
+
+	TDynamicDfcQue* iDfcQ;
+
+	TBool	iInitialisedCodeModifier;	// Ensures we control its lifetime
+
+	TClientDataRequest<Debug::TEventInfo>* iAsyncGetValueRequest;
+};
+
+#endif //__RM_DEBUG_DRIVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/include/drivers/rm_debug_eventhandler.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,55 @@
+// 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"
+// 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:
+//
+
+/** Event handler and container for all objects being tracked.  */
+#ifndef __RM_DEBUG_EVENTHANDLER_H__
+#define __RM_DEBUG_EVENTHANDLER_H__
+
+
+class DRM_DebugEventHandler : public DKernelEventHandler
+{
+	public:
+		DRM_DebugEventHandler();
+		TInt Create(DLogicalDevice* aDevice, DLogicalChannel* aChannel, DThread* aClient);
+		~DRM_DebugEventHandler();
+		TInt Start();
+		TInt Stop();
+		
+		inline void LockDataAccess();
+		inline void ReleaseDataAccess();
+		
+	private:
+		static TUint EventHandler(TKernelEvent aEvent, TAny* a1, TAny* a2, TAny* aThis);
+		TUint HandleEvent(TKernelEvent aType, TAny* a1, TAny* a2);
+		TBool HandleSpecificEvent(TKernelEvent aType, TAny* a1, TAny* a2);
+		
+	private:
+		/** Used to serialise access data structures */
+		DSemaphore* iProtectionLock;
+
+		TBool iTracking;
+
+		DLogicalDevice* iDevice;	// open reference to LDD for avoiding lifetime issues
+		DThread* iClientThread;
+		DRM_DebugChannel* iChannel;
+
+		// typdef for functions which handle our specific events
+		typedef TBool (DRM_DebugChannel::*eventHandler)(TAny* a1, TAny* a2);
+		eventHandler iEventHandlers[EEventLimit];
+};
+
+#include <rm_debug_eventhandler.inl>
+
+#endif //__RM_DEBUG_EVENTHANDLER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/include/drivers/rm_debug_eventhandler.inl	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,27 @@
+// 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:
+// Event handler and container for all objects being tracked.
+//
+
+	
+inline void DRM_DebugEventHandler::LockDataAccess()
+    {
+    Kern::SemaphoreWait(*iProtectionLock);
+    }
+
+inline void DRM_DebugEventHandler::ReleaseDataAccess()
+    {
+    Kern::SemaphoreSignal(*iProtectionLock);
+    }
+		
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/include/drivers/rm_debug_kerneldriver.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,777 @@
+// 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:
+//
+
+
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+
+#ifndef __RM_DEBUG_KERNELDRIVER_H__
+#define __RM_DEBUG_KERNELDRIVER_H__
+
+#include <rm_debug_api.h>
+
+/**
+Used to store a value read from or written to an ARM register
+*/
+typedef TUint32 T4ByteRegisterValue;
+
+
+/** 
+Provides static methods for accessing the information stored in a TRegisterInfo
+object.
+*/
+class Register
+	{
+public:
+	static TBool IsCoreReg(const Debug::TRegisterInfo aRegister);
+	static TBool IsCoproReg(const Debug::TRegisterInfo aRegister);
+	static TUint32 GetCoreRegId(const Debug::TRegisterInfo aRegister);
+	static TUint32 GetCRm(const Debug::TRegisterInfo aRegister);
+	static TUint32 GetCRn(const Debug::TRegisterInfo aRegister);
+	static TUint32 GetOpcode1(const Debug::TRegisterInfo aRegister);
+	static TUint32 GetOpcode2(const Debug::TRegisterInfo aRegister);
+	static TUint32 GetCoproNum(const Debug::TRegisterInfo aRegister);
+	};
+
+/**
+Identify whether aRegister is a core register
+@param aRegister register ID to analyse
+@return ETrue if core register, EFalse otherwise
+*/
+inline TBool Register::IsCoreReg(const Debug::TRegisterInfo aRegister)
+	{
+	return ((aRegister & 0xff) == 0x0);
+	}
+
+/**
+Identify whether aRegister is a coprocessor register
+@param aRegister register ID to analyse
+@return ETrue if coprocessor register, EFalse otherwise
+*/
+inline TBool Register::IsCoproReg(const Debug::TRegisterInfo aRegister)
+	{
+	return ((aRegister & 0xff) == 0x1);
+	}
+
+/**
+Get the ID of the core register
+@param aRegister register ID to analyse
+@return ID of the core register
+*/
+inline TUint32 Register::GetCoreRegId(const Debug::TRegisterInfo aRegister)
+	{
+	return ((aRegister >> 8) & 0xff);
+	}
+
+/**
+Get the CRm value of a coprocessor register
+@param aRegister register ID to analyse
+@return the CRm value of a coprocessor register
+*/
+inline TUint32 Register::GetCRm(const Debug::TRegisterInfo aRegister)
+	{
+	return ((aRegister >> 16) & 0xf);
+	}
+
+/**
+Get the CRm value of a coprocessor register
+@param aRegister register ID to analyse
+@return the CRm value of a coprocessor register
+*/
+inline TUint32 Register::GetCRn(const Debug::TRegisterInfo aRegister)
+	{
+	return ((aRegister >> 20) & 0xf);
+	}
+
+/**
+Get the Opcode1 value of a coprocessor register
+@param aRegister register ID to analyse
+@return the Opcode1 value of a coprocessor register
+*/
+inline TUint32 Register::GetOpcode1(const Debug::TRegisterInfo aRegister)
+	{
+	return ((aRegister >> 24) & 0x8);
+	}
+	
+/**
+Get the Opcode2 value of a coprocessor register
+@param aRegister register ID to analyse
+@return the Opcode2 value of a coprocessor register
+*/
+inline TUint32 Register::GetOpcode2(const Debug::TRegisterInfo aRegister)
+	{
+	return ((aRegister >> 27) & 0x8);
+	}
+
+/**
+Get the coprocessor number of a coprocessor register
+@param aRegister register ID to analyse
+@return the coprocessor number of a coprocessor register
+*/
+inline TUint32 Register::GetCoproNum(const Debug::TRegisterInfo aRegister)
+	{
+	return ((aRegister >> 8) & 0xff);
+	}
+
+//
+// class TCapsRM_DebugDriver
+//
+class TCapsRM_DebugDriver
+{
+public:
+	TVersion	iVersion;
+};
+
+/**
+Stores listings information for passing between the DSS and the kernel driver
+*/
+class TListInformation
+{
+public:
+	inline TListInformation(const Debug::TListId aType=(Debug::TListId)NULL, const Debug::TListScope aListScope=(Debug::TListScope)NULL, TDes8* aBuffer=NULL, TUint32* aDataSize=NULL, TUint64 aTargetId=0)
+		: iType(aType),
+		  iListScope(aListScope),
+		  iBuffer(aBuffer),
+		  iDataSize(aDataSize),
+		  iTargetId(aTargetId) {};
+public:
+	Debug::TListId iType;
+	Debug::TListScope iListScope;
+	TDes8* iBuffer;
+	TUint32* iDataSize;
+	TUint64 iTargetId;
+};
+
+/**
+Data structure to hold information to the crash flash
+(Possibly: Could be expanded to hold on configuration data too)
+*/
+class TFlashInfo
+{
+public:
+	inline TFlashInfo(TUint32 aPos, TUint32* aSize, TDes8* aData)
+		:iPos(aPos),
+		iSize(aSize),
+		iData(aData){};
+public:
+	TUint32 iPos;
+	TUint32* iSize;	
+	 TDes8* iData;	
+};
+//
+// class TRM_DebugMemoryInfo
+//
+class TRM_DebugMemoryInfo
+{
+public:
+
+	inline TRM_DebugMemoryInfo(const TUint32 aAddress, const TUint32 aLength, TDesC8 *aData)
+				: iAddress(aAddress),
+				  iLength(aLength),
+				  iData(aData) {};
+	
+public:
+
+	TUint32 iAddress;
+	TUint32	iLength;
+	TDesC8*	iData;
+};
+
+
+/**
+@deprecated
+This class is only used by TRK phase 1 functions.
+
+@see TRM_DebugRegisterInformation which offers similar storage suitable for use
+with the TRK pahse 2 API.
+*/
+class TRM_DebugRegisterInfo
+{
+public:
+
+	inline TRM_DebugRegisterInfo(const TInt16 aFirstRegister, const TInt16 aLastRegister, TDesC8 *aValues)
+				: iFirstRegister(aFirstRegister),
+				  iLastRegister(aLastRegister),
+				  iValues(aValues) {};
+	
+public:
+
+	TInt16	iFirstRegister;
+	TInt16	iLastRegister;
+	TDesC8*	iValues;
+};
+
+/**
+Structure used to store information about registers
+*/
+class TRM_DebugRegisterInformation
+{
+public:
+
+	inline TRM_DebugRegisterInformation(const TDes8 *aRegisterIds=NULL, TDes8 *aRegisterValues=NULL, TDes8 *aRegisterFlags=NULL)
+		: iRegisterIds(aRegisterIds),
+		  iRegisterValues(aRegisterValues),
+		  iRegisterFlags(aRegisterFlags) {};
+	
+public:
+
+	const TDes8* iRegisterIds;
+	TDes8* iRegisterValues;
+	TDes8* iRegisterFlags;
+};
+
+//
+// class TRM_DebugTaskInfo
+//
+class TRM_DebugTaskInfo
+{
+public:
+
+	inline TRM_DebugTaskInfo(TUint32 aOtherId)
+				: iId(0),
+				  iOtherId(aOtherId),
+				  iPriority(0) { iName.FillZ(); };
+
+public:
+
+	TUint32 iId;
+	TUint32 iOtherId;
+	TUint32 iPriority;	
+	TBuf8<KMaxName> iName;
+};
+
+//
+// class TRM_DebugStepInfo
+//
+class TRM_DebugStepInfo
+{
+public:
+
+	inline TRM_DebugStepInfo(const TUint32 aStartAddress, const TUint32 aStopAddress, const TBool aStepInto)
+				: iStartAddress(aStartAddress),
+				  iStopAddress(aStopAddress),
+				  iStepInto(aStepInto) {};
+
+public:
+
+	TUint32 iStartAddress;
+	TUint32 iStopAddress;
+	TBool iStepInto;
+};
+
+
+//
+// class TRM_DebugDriverInfo
+//
+class TRM_DebugDriverInfo
+{
+public:
+
+	TUint32 iPanic1Address;
+	TUint32 iPanic2Address;
+	TUint32 iException1Address;
+	TUint32 iException2Address;
+	TUint32 iLibraryLoadedAddress;
+	TUint32 iUserLibraryEnd;
+};
+
+
+//
+// class TRM_DebugProcessInfo
+//
+class TRM_DebugProcessInfo
+{
+public:
+
+	inline TRM_DebugProcessInfo(TUint32 *aCodeAddress, TUint32 *aDataAddress)
+				: iCodeAddress(aCodeAddress),
+				  iDataAddress(aDataAddress) {};
+
+public:
+
+	TUint32* iCodeAddress;
+	TUint32* iDataAddress;
+};
+
+//
+// class TRM_DebugEventActionInfo
+//
+class TRM_DebugEventActionInfo
+{
+public:
+	inline TRM_DebugEventActionInfo(TUint32 aEvent, TUint32 aAction, TUint64 aAgentId)
+		: iEvent(aEvent),
+		iAction(aAction),
+		iAgentId(aAgentId) {};
+public:
+	TUint32 iEvent;
+	TUint32 iAction;
+	TUint64 iAgentId;
+};
+
+//
+// class TRM_DebugEventInfo
+//
+class TRM_DebugEventInfo
+{
+public:
+	inline TRM_DebugEventInfo(TDesC8& aProcessName, TUint32& aBufSize)
+		: iProcessName(aProcessName),
+		iBufSize(aBufSize) {};
+
+public:
+	TDesC8& iProcessName;
+	TUint32& iBufSize;
+};
+
+//
+// class TRMD_DebugAgentId
+//
+class TRM_DebugAgentId
+{
+public:
+	inline TRM_DebugAgentId(TUint64 aAgentId)
+		: iAgentId(aAgentId) {};
+
+public:
+	TUint64 iAgentId;
+};
+
+//
+// Class TRMD_DebugCancelInfo
+//
+class TRMD_DebugCancelInfo
+{
+public:
+	inline TRMD_DebugCancelInfo(TUint32 aCancelRequest,TDesC8& aProcessName, TUint64 aAgentId)
+		: iCancelRequest(aCancelRequest),
+		iProcessName(aProcessName),
+		iAgentId(aAgentId) {};
+
+	inline TRMD_DebugCancelInfo(void)
+		: iCancelRequest(0),
+	iAgentId(0)
+	{
+	};
+
+public:
+	TUint32 iCancelRequest;
+	TBuf8<KMaxName> iProcessName;
+	TUint64 iAgentId;
+};
+
+class TEventMetaData
+	{
+public:
+	TBuf8<KMaxName> iTargetProcessName;
+	TUint64 iDebugAgentProcessId;
+	};
+
+/**
+@internalComponent
+*/
+class TSetBreakInfo
+{
+public:
+
+	inline TSetBreakInfo(Debug::TBreakId* aBreakId,
+		TUint64 aId,\
+		TUint32 aAddress,\
+		Debug::TArchitectureMode aMode,
+		TBool aThreadSpecific)
+				: iBreakId(aBreakId),
+				  iId(aId),
+				  iAddress(aAddress),
+				  iMode(aMode),
+       				  iThreadSpecific(aThreadSpecific) {};
+
+inline TSetBreakInfo(void)
+			: iBreakId((Debug::TBreakId*)0),
+			  iId(0),
+			  iAddress(0),
+			  iMode(Debug::EArmMode),
+       			  iThreadSpecific(ETrue) {};
+
+
+public:
+	Debug::TBreakId* iBreakId;
+	TUint64 iId;
+	TUint32 iAddress;
+	Debug::TArchitectureMode iMode;
+	TBool iThreadSpecific;
+};
+
+/**
+@internalComponent
+*/
+class TModifyBreakInfo
+{
+public:
+
+	inline TModifyBreakInfo(Debug::TBreakId aBreakId,\
+		const TUint64 aThreadId,\
+		const TUint32 aAddress,\
+		const Debug::TArchitectureMode aMode)
+				: iBreakId(aBreakId),
+				  iThreadId(aThreadId),
+				  iAddress(aAddress),
+				  iMode(aMode) {};
+
+public:
+	const Debug::TBreakId iBreakId;
+	const TUint64 iThreadId;
+	const TUint32 iAddress;
+	const Debug::TArchitectureMode iMode;
+};
+
+/**
+@internalComponent
+*/
+class TModifyProcessBreakInfo
+{
+public:
+
+	inline TModifyProcessBreakInfo(Debug::TBreakId aBreakId,\
+		const TUint64 aProcessId,\
+		const TUint32 aAddress,\
+		const Debug::TArchitectureMode aMode)
+				: iBreakId(aBreakId),
+				  iProcessId(aProcessId),
+				  iAddress(aAddress),
+				  iMode(aMode) {};
+
+public:
+	const Debug::TBreakId iBreakId;
+	const TUint64 iProcessId;
+	const TUint32 iAddress;
+	const Debug::TArchitectureMode iMode;
+};
+
+/**
+@internalComponent
+*/
+class TGetBreakInfo
+{
+public:
+
+	inline TGetBreakInfo(Debug::TBreakId aBreakId,\
+		TUint64& aId,\
+		TUint32& aAddress,\
+		Debug::TArchitectureMode& aMode,
+		TBool& aThreadSpecific)
+				: iBreakId(aBreakId),
+				  iId(&aId),
+				  iAddress(&aAddress),
+				  iMode(&aMode),
+       				  iThreadSpecific(&aThreadSpecific) {};
+
+	inline TGetBreakInfo()
+				: iBreakId((Debug::TBreakId)0),
+				  iId((TUint64*)0),
+				  iAddress((TUint32*)0),
+				  iMode((Debug::TArchitectureMode*)0),
+       				  iThreadSpecific((TBool*)0)	{};
+
+public:
+	const Debug::TBreakId iBreakId;
+	TUint64* iId;
+	TUint32* iAddress;
+	Debug::TArchitectureMode* iMode;
+	TBool* iThreadSpecific;
+};
+
+//
+// class RRM_DebugDriver
+//
+class RRM_DebugDriver : public RBusLogicalChannel
+{
+public:
+
+	enum TControl
+	{
+		EControlSetBreak = 0,
+		EControlClearBreak,
+		EControlModifyBreak,
+		EControlBreakInfo,
+		EControlSuspendThread,
+		EControlResumeThread,
+		EControlStepRange,
+		EControlReadMemory,
+		EControlWriteMemory,
+		EControlReadRegisters,
+		EControlWriteRegisters,
+		EControlGetStaticLibraryInfo,
+		EControlGetDebugFunctionalityBufSize,
+		EControlGetDebugFunctionality,
+		EControlReadRegistersLegacy,
+		EControlWriteRegistersLegacy,		
+		EControlGetMemoryOperationMaxBlockSize,		
+		EControlAttachProcess,
+		EControlDetachProcess,
+		EControlDetachAgent,
+		EControlSetEventAction,
+		EControlGetList,
+		EControlStep,
+		EControlIsDebuggable,
+		EControlKillProcess,		
+		EControlModifyProcessBreak,
+	};
+	
+	enum TRequest
+	{
+		ERequestGetEvent=0x0, ERequestGetEventCancel=0x1
+	};	
+		
+public:
+
+	inline TInt Open(const TRM_DebugDriverInfo aDriverInfo);
+
+	inline TInt	SetBreak(Debug::TBreakId &aBreakId,const TUint32 aThreadId, const TUint32 aAddress, const Debug::TArchitectureMode aThumbMode );
+	inline TInt	SetProcessBreak(Debug::TBreakId &aBreakId,const TUint32 aProcessId, const TUint32 aAddress, const Debug::TArchitectureMode aThumbMode );
+	
+	inline TInt	ClearBreak(const TInt32 aBreakId);
+	
+	inline TInt	ModifyBreak(const Debug::TBreakId aBreakId, const TUint32 aThreadId, const TUint32 aAddress, const Debug::TArchitectureMode aArchitectureMode );
+	inline TInt	ModifyProcessBreak(const Debug::TBreakId aBreakId, const TUint32 aProcessId, const TUint32 aAddress, const Debug::TArchitectureMode aArchitectureMode );
+	
+	inline TInt BreakInfo(const Debug::TBreakId aBreakId, TUint64& aId, TUint32& aAddress, Debug::TArchitectureMode& aMode, TBool& aThreadSpecific);
+	
+	inline TInt	SuspendThread(const TUint32 aThreadId);
+	inline TInt	ResumeThread(const TUint32 aThreadId);
+	inline TInt	StepRange(const TUint32 aThreadId, const TUint32 aStartAddress, const TUint32 aStopAddress, TBool aStepInto);
+	inline TInt ReadMemory(const TUint32 aThreadId, const TUint32 aAddress, const TUint32 aLength, TDes8 &aData);
+	inline TInt WriteMemory(const TUint32 aThreadId, const TUint32 aAddress, const TUint32 aLength, const TDesC8 &aData);
+	inline TInt ReadRegisters(const TUint32 aThreadId, const TDes8 &aRegisterIds, TDes8 &aRegisterValues, TDes8 &aRegisterFlags);
+	inline TInt WriteRegisters(const TUint32 aThreadId, const TDes8 &aRegisterIds, const TDes8 &aRegisterValues, TDes8 &aRegisterFlags);
+	inline TInt ReadRegisters(const TUint32 aThreadId, const TInt32 aFirstRegister, const TInt32 aLastRegister, TDes8 &aValues);
+	inline TInt WriteRegisters(const TUint32 aThreadId, const TInt32 aFirstRegister, const TInt32 aLastRegister, TDesC8 &aValues);
+	inline void GetEvent(TDesC8& aProcessName, TUint64 aAgentId, TRequestStatus &aStatus, Debug::TEventInfo &aEventInfo);
+	inline void CancelGetEvent(TDesC8& aProcessName, TUint64 aAgentId);
+//	inline TInt GetProcessInfo(const TInt aIndex, TRM_DebugTaskInfo &aInfo);
+//	inline TInt GetThreadInfo(const TInt aIndex, TRM_DebugTaskInfo &aInfo);
+	inline TInt GetStaticLibraryInfo(const TInt aIndex, Debug::TEventInfo &aInfo);
+	inline TInt GetDebugFunctionalityBufSize(TUint32 &aBufSize);
+	inline TInt GetDebugFunctionality(TDes8& aDebugFunctionality);
+	inline TInt GetMemoryOperationMaxBlockSize(TUint32 &aMaxSize);
+	inline TInt AttachProcess(TDesC8& aProcessName, TUint64 aAgentId);
+	inline TInt DetachProcess(TDesC8& aProcessName, TUint64 aAgentId);
+	inline TInt DetachAgent(TUint64 aAgentId);
+	inline TInt SetEventAction(TDesC8& aProcessName, Debug::TEventType aEvent, Debug::TKernelEventAction aEventAction, TUint64 aAgentId);
+	inline TInt GetList(const Debug::TListId aType, const Debug::TListScope aListScope, const TUint64 aTargetId, const TUint64 aDebugProcessId, TDes8& aBuffer, TUint32& aDataSize);
+	inline TInt Step(const TUint32 aThreadId, const TUint32 aNumSteps);
+	inline TInt IsDebuggable(const TUint32 aProcessId);
+	inline TInt KillProcess(const TUint32 aProcessId, const TInt32 aReason);
+};
+
+_LIT(KRM_DebugDriverName,"RM Debug Driver");
+
+//priority set equal to that of KDfcThread0Priority defined in e32/kernel/sinit.cpp
+const TInt KRmDebugDriverThreadPriority = 27;
+
+// Version information
+const TInt KMajorVersionNumber=2;
+const TInt KMinorVersionNumber=1;
+const TInt KBuildVersionNumber=0;
+
+
+inline TInt RRM_DebugDriver::Open(const TRM_DebugDriverInfo aDriverInfo)
+{
+	TBuf8<32> buf;
+	buf.Append((TUint8*)&aDriverInfo.iPanic1Address, 4);
+	buf.Append((TUint8*)&aDriverInfo.iPanic2Address, 4);
+	buf.Append((TUint8*)&aDriverInfo.iException1Address, 4);
+	buf.Append((TUint8*)&aDriverInfo.iException2Address, 4);
+	buf.Append((TUint8*)&aDriverInfo.iLibraryLoadedAddress, 4);
+	buf.Append((TUint8*)&aDriverInfo.iUserLibraryEnd, 4);
+	
+	#ifdef EKA2
+	return DoCreate(KRM_DebugDriverName, TVersion(KMajorVersionNumber, KMinorVersionNumber, KBuildVersionNumber), KNullUnit, NULL, &buf);
+	#else
+	return DoCreate(KRM_DebugDriverName, TVersion(KMajorVersionNumber, KMinorVersionNumber, KBuildVersionNumber), NULL, KNullUnit, NULL, &buf);
+	#endif
+}
+
+inline TInt RRM_DebugDriver::SetBreak(Debug::TBreakId &aBreakId, const TUint32 aThreadId, const TUint32 aAddress, const Debug::TArchitectureMode aMode )
+{
+	TSetBreakInfo info(&aBreakId, aThreadId, aAddress, aMode, ETrue);
+	return DoSvControl(EControlSetBreak, reinterpret_cast<TAny*>(&info),0);
+}
+inline TInt RRM_DebugDriver::SetProcessBreak(Debug::TBreakId &aBreakId, const TUint32 aProcessId, const TUint32 aAddress, const Debug::TArchitectureMode aMode )
+{
+	TSetBreakInfo info(&aBreakId, aProcessId, aAddress, aMode, EFalse);
+	return DoSvControl(EControlSetBreak, reinterpret_cast<TAny*>(&info),0);
+}
+
+inline TInt RRM_DebugDriver::ClearBreak(const Debug::TBreakId aBreakId)
+{
+	return DoSvControl(EControlClearBreak, reinterpret_cast<TAny*>(aBreakId), 0);
+}
+
+inline TInt RRM_DebugDriver::ModifyBreak(const Debug::TBreakId aBreakId, const TUint32 aThreadId, const TUint32 aAddress, const Debug::TArchitectureMode aMode)
+{
+	TModifyBreakInfo info(aBreakId, aThreadId, aAddress, aMode);
+	return DoControl(EControlModifyBreak, reinterpret_cast<TAny*>(&info), 0);
+}
+
+inline TInt RRM_DebugDriver::ModifyProcessBreak(const Debug::TBreakId aBreakId, const TUint32 aProcessId, const TUint32 aAddress, const Debug::TArchitectureMode aMode)
+{
+	TModifyProcessBreakInfo info(aBreakId, aProcessId, aAddress, aMode);
+	return DoControl(EControlModifyProcessBreak, reinterpret_cast<TAny*>(&info), 0);
+}
+
+inline TInt RRM_DebugDriver::BreakInfo(const Debug::TBreakId aBreakId, TUint64& aId, TUint32& aAddress, Debug::TArchitectureMode& aMode, TBool& aThreadSpecific)
+{
+	TGetBreakInfo info(aBreakId, aId, aAddress, aMode, aThreadSpecific);
+	return DoControl(EControlBreakInfo, reinterpret_cast<TAny*>(&info), 0);
+}
+
+inline TInt RRM_DebugDriver::SuspendThread(const TUint32 aThreadId)
+{
+	return DoControl(EControlSuspendThread, reinterpret_cast<TAny*>(aThreadId));
+}
+
+inline TInt RRM_DebugDriver::ResumeThread(const TUint32 aThreadId)
+{
+	return DoSvControl(EControlResumeThread, reinterpret_cast<TAny*>(aThreadId));
+}
+
+inline TInt RRM_DebugDriver::StepRange(const TUint32 aThreadId, const TUint32 aStartAddress, const TUint32 aStopAddress, TBool aStepInto)
+{
+	TRM_DebugStepInfo info(aStartAddress, aStopAddress, aStepInto);
+	return DoSvControl(EControlStepRange, reinterpret_cast<TAny*>(aThreadId), (TAny*)&info);
+}
+
+inline TInt RRM_DebugDriver::ReadMemory(const TUint32 aThreadId, const TUint32 aAddress, const TUint32 aLength, TDes8 &aData)
+{
+	TRM_DebugMemoryInfo info(aAddress, aLength, &aData);
+	return DoControl(EControlReadMemory, reinterpret_cast<TAny*>(aThreadId), (TAny*)&info);
+}
+
+inline TInt RRM_DebugDriver::WriteMemory(const TUint32 aThreadId, const TUint32 aAddress, const TUint32 aLength, const TDesC8 &aData)
+{
+	TRM_DebugMemoryInfo info(aAddress, aLength, (TDesC8*)&aData);
+	return DoControl(EControlWriteMemory, reinterpret_cast<TAny*>(aThreadId), (TAny*)&info);
+}
+
+inline TInt RRM_DebugDriver::ReadRegisters(const TUint32 aThreadId, const TDes8 &aRegisterIds, TDes8 &aRegisterValues, TDes8 &aRegisterFlags)
+	{
+	TRM_DebugRegisterInformation info(&aRegisterIds, &aRegisterValues, &aRegisterFlags);
+	return DoControl(EControlReadRegisters, reinterpret_cast<TAny*>(aThreadId), (TAny*)&info);	
+	}
+
+inline TInt RRM_DebugDriver::WriteRegisters(const TUint32 aThreadId, const TDes8 &aRegisterIds, const TDes8 &aRegisterValues, TDes8 &aRegisterFlags)
+	{
+	TRM_DebugRegisterInformation info(&aRegisterIds, (TDes8*)&aRegisterValues, &aRegisterFlags);
+	return DoControl(EControlWriteRegisters, reinterpret_cast<TAny*>(aThreadId), (TAny*)&info);
+	}
+
+inline TInt RRM_DebugDriver::ReadRegisters(const TUint32 aThreadId, const TInt32 aFirstRegister, const TInt32 aLastRegister, TDes8 &aValues)
+{
+	TRM_DebugRegisterInfo info(aFirstRegister, aLastRegister, &aValues);
+	return DoControl(EControlReadRegistersLegacy, reinterpret_cast<TAny*>(aThreadId), (TAny*)&info);
+}
+
+inline TInt RRM_DebugDriver::WriteRegisters(const TUint32 aThreadId, const TInt32 aFirstRegister, const TInt32 aLastRegister, TDesC8 &aValues)
+{
+	TRM_DebugRegisterInfo info(aFirstRegister, aLastRegister, &aValues);
+	return DoControl(EControlWriteRegistersLegacy, reinterpret_cast<TAny*>(aThreadId), (TAny*)&info);
+}
+
+inline void RRM_DebugDriver::GetEvent(TDesC8& aProcessName, TUint64 aAgentId, TRequestStatus &aStatus, Debug::TEventInfo &aEventInfo)
+{
+	// temporary object not needed beyond the DoRequest call
+	TEventMetaData eventMetaData;
+	eventMetaData.iTargetProcessName.Copy(aProcessName);
+	eventMetaData.iDebugAgentProcessId = aAgentId;
+	DoRequest(ERequestGetEvent, aStatus, (TAny*)&aEventInfo, (TAny*)&eventMetaData);
+}
+
+inline void RRM_DebugDriver::CancelGetEvent(TDesC8& aProcessName, TUint64 aAgentId)
+{
+	TRMD_DebugCancelInfo info(ERequestGetEventCancel,aProcessName,aAgentId);
+	DoCancel(reinterpret_cast<TInt>(&info));
+}
+
+inline TInt RRM_DebugDriver::GetStaticLibraryInfo(const TInt aIndex, Debug::TEventInfo &aInfo)
+{
+	return DoControl(EControlGetStaticLibraryInfo, reinterpret_cast<TAny*>(aIndex), (TAny*)&aInfo);
+}
+
+inline TInt RRM_DebugDriver::GetDebugFunctionalityBufSize(TUint32 &aBufSize)
+{
+	return DoControl(EControlGetDebugFunctionalityBufSize, reinterpret_cast<TAny*>(&aBufSize));
+}
+
+inline TInt RRM_DebugDriver::GetDebugFunctionality(TDes8& aDebugFunctionality)
+{
+	return DoControl(EControlGetDebugFunctionality,reinterpret_cast<TAny*>(&aDebugFunctionality));
+}
+
+inline TInt RRM_DebugDriver::GetMemoryOperationMaxBlockSize(TUint32 &aMaxSize)
+{
+	return DoControl(EControlGetMemoryOperationMaxBlockSize, reinterpret_cast<TAny*>(&aMaxSize));
+}
+
+inline TInt RRM_DebugDriver::AttachProcess(TDesC8& aProcessName, TUint64 aAgentId)
+{
+	TRM_DebugAgentId info(aAgentId);
+	return DoControl(EControlAttachProcess,reinterpret_cast<TAny*>(&aProcessName),reinterpret_cast<TAny*>(&info));
+}
+
+inline TInt RRM_DebugDriver::DetachProcess(TDesC8& aProcessName, TUint64 aAgentId)
+{
+	TRM_DebugAgentId info(aAgentId);
+	return DoControl(EControlDetachProcess,reinterpret_cast<TAny*>(&aProcessName),reinterpret_cast<TAny*>(&info));
+}
+
+inline TInt RRM_DebugDriver::DetachAgent(TUint64 aAgentId)
+{
+	TRM_DebugAgentId info(aAgentId);
+	return DoControl(EControlDetachAgent,reinterpret_cast<TAny*>(&info),0);
+}
+
+inline TInt RRM_DebugDriver::SetEventAction(TDesC8& aProcessName, Debug::TEventType aEvent, Debug::TKernelEventAction aEventAction, TUint64 aAgentId)
+{
+	TRM_DebugEventActionInfo info (aEvent,aEventAction, aAgentId);
+	return DoControl(EControlSetEventAction,reinterpret_cast<TAny*>(&aProcessName),(TAny*)&info);
+}
+
+inline TInt RRM_DebugDriver::GetList(const Debug::TListId aType, const Debug::TListScope aListScope, const TUint64 aTargetId, const TUint64 aDebugProcessId, TDes8& aBuffer, TUint32& aDataSize)
+{
+	TListInformation info(aType, aListScope, &aBuffer, &aDataSize, aTargetId);
+	return DoControl(EControlGetList, (TAny*)&info);
+}
+
+inline TInt RRM_DebugDriver::Step(const TUint32 aThreadId, const TUint32 aNumSteps)
+{
+	return DoControl(EControlStep,reinterpret_cast<TAny*>(aThreadId),reinterpret_cast<TAny*>(aNumSteps));
+}
+
+inline TInt RRM_DebugDriver::IsDebuggable(const TUint32 aProcessId)
+{
+	return DoControl(EControlIsDebuggable,reinterpret_cast<TAny*>(aProcessId),NULL);
+}
+
+inline TInt RRM_DebugDriver::KillProcess(const TUint32 aProcessId, const TInt32 aReason)
+{
+	return DoControl(EControlKillProcess,reinterpret_cast<TAny*>(aProcessId),reinterpret_cast<TAny*>(aReason));
+}
+
+#endif // __RM_DEBUG_KERNELDRIVER_H__
+
--- a/kernel/eka/include/drivers/sdcard.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/drivers/sdcard.h	Wed Sep 01 12:34:56 2010 +0100
@@ -147,17 +147,6 @@
 
 const TInt KSDMaxMBWRetries = 1;
 const TUint32 KSDACMD22BlockLen = 4;
-
-NONSHARABLE_CLASS(DAddressCard) : public DMMCStack::MAddressCard
-	{
-public:
-	DAddressCard(DSDStack& aStack);
-	virtual void AddressCard(TInt aCardNumber);
-private:
-	DSDStack& iStack;
-	};
-
-
 class DSDStack : public DMMCStack
 	{
 public:
@@ -202,19 +191,15 @@
     // Dummy functions to maintain binary compatibility
     IMPORT_C virtual void Dummy1();
     IMPORT_C virtual void Dummy2();
-
-protected:
-	IMPORT_C virtual void GetInterface(TInterfaceId aInterfaceId, MInterface*& aInterfacePtr);
+    IMPORT_C virtual void Dummy3();
 
 public: 
     IMPORT_C virtual DSDStack::TSDCardType CardType(TInt aSocket, TInt aCardNumber);
 
 private:    
-	DAddressCard* iAddressCard;
     //
     // Reserved members to maintain binary compatibility
-
-    TInt iReserved[67];
+    TInt iReserved[68];
 	};
 
 #include <drivers/sdcard.inl>
--- a/kernel/eka/include/drivers/smppower/idlehelper.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,207 +0,0 @@
-// 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:
-// os\kernelhwsrv\kernel\eka\include\drivers\smppower\idlehelper.h
-// Helper classes required to implement CPU idle
-// functionality in a SMP BSP.
-
-
-/**
- @file
- @prototype
-*/
-
-#ifndef __SMP_IDLE_HELPER_H__
-#define __SMP_IDLE_HELPER_H__
-
-#define __PM_IDLE_ASSERT_ALWAYS(aCond) \
-	__ASSERT_ALWAYS( (aCond), \
-		( \
-			Kern::Printf("Assertion '" #aCond "' failed;\nFile: '" __FILE__ "' Line: %d\n", __LINE__), \
-			Kern::Fault("TIdleSupport", 1) \
-		) )
-
-#define __PM_IDLE_ASSERT_DEBUG(aCond) \
-	__ASSERT_DEBUG( (aCond), \
-		( \
-			Kern::Printf("Assertion '" #aCond "' failed;\nFile: '" __FILE__ "' Line: %d\n", __LINE__), \
-			Kern::Fault("TIdleSupport", 1) \
-		) )
-
-
-
-#ifdef __SMP__
-
-#include <kernel/kpower.h>
-#include <e32btrace.h>
-#include <arm_gic.h>
-#include <kernel.h>
-#include <nk_priv.h>
-#include <nk_plat.h>
-
-
-const TUint32 KNoInterruptsPending = 1023;
-
-
-// Temp place holder for TRACE Categories
-const TInt KIsrPendingCat = 128;
-const TInt KPrintReg = 129;
-const TInt KIdleEntry = 130;
-const TUint8 KIdleEntryNormalCpu = 0x10;
-const TUint8 KIdleEntryLastCpu = 0;
-const TInt KIdleeXit = 131;
-const TUint8 KIdleeXitLastCpu0 = 0x1;
-const TUint8 KIdleeXitLastCpu1 = 0x1;
-const TUint8 KIdleeXitNormalCpu0 = 0x10;
-const TUint8 KIdleeXitNormalCpu1 = 0x11;
-const TInt KSyncPoint = 132;
-const TUint8 KSignalAndWaitFnEntry = 0x10;
-const TUint8 KSignalAndWaitFneXit = 0x11;
-const TUint8 KSignalAndWaitEntry = 0x0;
-const TUint8 KSignalAndWaiteXit = 0x1;
-const TInt KClearIPI = 133;
-const TInt KSendIPI = 134;
-const TInt KMisc=135;
-const TInt KIdleTickSupression=136;
-const TUint8 KCyclesInTickCyclesFullTick = 0x0;
-const TUint8 KNextInterrupt = 0x1;
-const TUint8 KTimeSleptTimeNextInt = 0x2;
-const TUint8 KTIcksSlept = 0x3;
-const TInt  KRetireCore=137;
-const TUint8 KRetireCoreEntry = 0x1;
-const TUint8 KRetireCoreeXit = 0x2;
-const TUint8 KRetireMarkCoreRetired = 0x3;
-const TInt  KEngageCore=138;
-const TUint8 KEngageMarkCoreEngaged = 0x3;
-const TInt KNTICK = 139;
-
-// End of Trace categories
-
-//#define DISABLE_TRACE
-#if defined(_DEBUG) && !defined(DISABLE_TRACE)
-
-#define PMBTRACE0(c,s) BTrace0((c),(s))
-#define PMBTRACE4(c,s,a1) BTrace4((c),(s),(a1))
-#define PMBTRACE8(c,s,a1,a2) BTrace8((c),(s),(a1),(a2))
-
-#else
-
-#define PMBTRACE0(c,s)
-#define PMBTRACE4(c,s,a1) 
-#define PMBTRACE8(c,s,a1,a2) 
-
-#endif
-
-//This will be defined in kernel header file nk_plat.h in the future
-#ifndef IDLE_WAKEUP_IPI_VECTOR
-#define IDLE_WAKEUP_IPI_VECTOR 0x07
-#endif
-
-
-#ifdef _DEBUG
-
-#define SYNCPOINT(obj,stage) (obj).SignalAndWait(stage) 
-
-#else
-
-#define SYNCPOINT(obj,stage) (obj).SignalAndWait()
-
-#endif//_DEBUG
-
-#define PROPER_WFI		//if defined uses ARM_WFI state otherwise a wait in loop
-#define SYNCPOINT_WFE 	//Sync Points use WFE and SEV
-
-//Base class for all sync points
-class TSyncPointBase
-    {
-public:
-    TSyncPointBase();
-#ifdef _DEBUG
-    void SignalAndWait(TUint32 aStage);
-#else
-    void SignalAndWait();
-#endif
-    void Reset();
-protected:
-    virtual void DoSW(TUint32 aCpuMask) = 0;
-public:
-    volatile TUint32 iStageAndCPUWaitingMask;    // upper 16 are the stage and lower 16 are cpus waiting mask
-    volatile TUint32* iAllEnagedCpusMask;
-   };
-
-    
-// Auto reseting sync point. Can not be broken. 
-class TSyncPoint : public TSyncPointBase
-    {
-private:
-    void DoSW(TUint32 aCpuMask);
-    };
-
-// Very similar to normal breakpoint except that:
-// 1. It does not autoreset between calls, therefore a call to Reset is required between
-//    syncs.
-// 2. It can be broken. That is a call to Break will result in any cpu currently waiting on the point
-//    to be freed inmediatelly, and attempt to start to wait on the point to return inmediatelly. This
-//    condition remains until reset is called once more
-class TBreakableSyncPoint : public TSyncPointBase
-    {
-public:
-    void Break();
-private:
-    void DoSW(TUint32 aCpuMask);
-};
-
-//Helper class for idle handler support to be used in smp bsp
-class TIdleSupport
-	{
-public:
-	static void SetupIdleSupport(TUint32 aGlobalIntDistAddress, TUint32 aBaseIntIfAddress, TUint32* aTimerCount=0);//setup GIC gid and cif base addresses
-	static void SetIdleIPIToHighestPriority();//sets idle IPI priority to be the highest
-	static void DoIdleIPI(TUint32);
-	static void ClearIdleIPI();
-	static void DoWFI();//puts current CPU in wait for interrupt state
-	static TBool IsIntPending();
-	static TInt	IntPending();
-	static TUint32 GetTimerCount();//HW timer can be used for tracing
-	//Atomic checks used to synchronise cores going idle
-	static TBool ClearLocalAndCheckGlobalIdle(TUint32);
-	static TBool SetLocalAndCheckSetGlobalIdle(TUint32);
-	static TBool FirstCoreAwake(TUint32);
-    // Retiring Cores
-    static void MarkCoreRetired(TUint32);
-    static void MarkCoreEngaged(TUint32);
-	//Exit methods for sync points
-	static void SetExitRequired(TBreakableSyncPoint* aBreakSyncPoint=0);
-	static TBool GetExitRequired();	
-	static void  ResetLogic();//Reset helper class flags
-	static TUint32 GetCpusIdleMask();//gets bit mask containing idling CPU's
-    static volatile TUint32* EngagedCpusMaskAddr();
-    static TUint32 AllCpusMask();
-private:
-    static TInt DoClearIdleIPI();
-private:
-    static const TUint32 KGlobalIdleFlag = 0x8000000;
-	static volatile TUint32 iAllEngagedCpusMask;
-	static volatile TUint32 iIdlingCpus;//contains CPU's idle handler waiting to go idle
-    static volatile TUint32 iRousingCpus;////contains CPU's waking up
-	static volatile TUint32 iExitRequired;
-	static TUint iGlobalIntDistAddress;//base address of gloabl interrupt dispatcher
-	static TUint iBaseIntIfAddress;//base address of CPu interrupt interface
-	static volatile TUint32* iTimerCount;//timer count register provided by bsp for tracing	
-	};
-
-
-#endif //__SMP__
-
-#endif //__SMP_IDLE_HELPER_H__
-
--- a/kernel/eka/include/drivers/smppower/sample_idlehandler/smpidlehandler.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +0,0 @@
-// 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:
-// eka/drivers/smppower/sample_idlehandler/smpidlehandler.h
-// Example of a generic idle handler layer
-
-
-#ifndef __SMPIDLEHANDLER_H__
-#define __SMPIDLEHANDLER_H__
-
-#include <smppower/idlehelper.h>
-
-#ifdef __SMP__
-
-//Helper class provides a generic idle handler that can derived from. However own idle handler can be used if the version 
-//provided here is not appropriate
-class DSMPIdleHandler
-    {
-public:
-    // points at which a cpu might exit the idle handler
-    enum TIdleExit
-        {
-        EExitOtherCPUsNotIdle,
-        EExitBeforeLPM,
-        EExitAfterLPM
-        };
-    
-
-    DSMPIdleHandler();
-	virtual ~DSMPIdleHandler();
-
-    /*
-      called to init and bind the idle handler. After this call idle will be directed to idle handler
-      @pre thread context, no locks no fast mutexes, interrupt on
-    */
-    void Initialise(TUint32 aGlobalIntDistAddress, TUint32 aBaseIntIfAddress);
-    /**
-       Must be called when cores are enaged or retired
-       @pre calling code must be outside idle handler, or in DoEnterIdle call
-    */
-    void ResetSyncPoints();
-
-protected:
-    /**
-       Called by idle handler inmediatelly after idle entry. Can be used for things 
-       such as checking if a core is going to be retired and retiring
-       @param aCpuMask mask of current cpu
-       @param aStage passed from kernel indicated things such core retiring 
-       or postamble
-       @param aU points to some per-CPU uncached memory used for handshaking in 
-       during power up/power down of a core for support of core retiring. This 
-       memory is provided by baseport to the kernel via the VIB
-
-       @return EFalse if the idle handler needs to be exited, ETrue to progress
-       further into idle
-       @see TIdleSupport::MarkCoreRetired
-    */
-    virtual TBool DoEnterIdle(TInt aCpuMask, TInt aStage, volatile TAny* aU);
-    /**
-       Called by idle handler all cpus to enter idle once all have entered idle but
-       before NTimeQ::IdleTime is called to check time to next timer expiry. Can be used 
-       for things such as idle timer pre-idle processing. In such cases only the last CPU
-       should do the idle timer processing
-       @param aCpuMask mask of current cpu
-       @param aLastCPu indicates if this is last CPU.
-    */
-    virtual void CpusHaveEnteredIdle(TInt aCpuMask, TInt aLastCpu);
-    /**
-       This function gets called by the last CPU to go into idle once the system is locked 
-       with all CPUs going idle.
-       In this function the baseport would fill an opaque integer which determines what low 
-       power mode the platform can go to.
-       This mode is usually determined by the idle time available, entry and wake latencies 
-       of low power modes, and states 
-       additionally the function returns EFalse if a there is no point proceeding with idle
-       (say next tick is very close for example)
-       of other resources in the system
-       @param aIdleTime time until next timer is due as obtained from NTimerQ::IdleTime
-       @param aLowPowerMode low powe mode to go into, up to baseport on meaning of this 
-       @return EFalse to force exit from idle handler if there is no point proceeding with idle
-       @see NTimerQ::IdleTIme
-     */
-    virtual TBool GetLowPowerMode(TInt aIdleTime, TInt &aLowPowerMode) = 0;
-    /**
-       This function actually enters the low power mode. It should do any state saving and perform
-       idle tick suppression. If rousing of other CPUs is required after wake then this function should
-       return true. 
-       
-       @param aMode the low power mode obtained from GetLowPowerMode
-       @param TInt aCpuMask indicates calling CPU
-       @param aLastCpu true if the calling CPU was the last to enter the idle thread
-       @return True if rousing of other cores is required after wakeup
-     */
-    virtual TBool EnterLowPowerMode(TInt aMode, TInt aCpuMask, TBool aLastCpu) = 0;
-    /**
-       Called after wakeup can be used for status restoring
-       a sync point is placed after the call to this function
-       This can be a good place to do idle tick restoration
-       @param TInt aCpuMask indicates calling CPU
-       @param aLastCPu indicates if this is last CPU.
-       @see EnterLowPowerMode
-    */
-    virtual void PostWakeup(TInt aCpuMask, TBool aLastCpu);
-    /**
-       Called at exit of idle handler not synchronised in any way
-       @param aExitPoint point at which you might exit the idle handler
-       @param TInt aCpuMask indicates calling CPU
-       @param aLastCPu indicates if this is last CPU.
-    */
-    virtual void DoExitIdle(TIdleExit aExitPoint, TInt aCpuMask, TBool aLastCpu);
-
-private:
-    static void IdleHandler(TAny* aPtr, TInt aStage, volatile TAny* aU);
-    void DoIdle(TInt aStage, volatile TAny* aU);
-    static void StartAfterExtIntDfcFn(TAny*);
-
-private:
- 	const TUint32 iAllCpusMask; 
-	TSyncPoint iIdleSync;
-	TBreakableSyncPoint iStage2;
-	volatile TUint32 iIdlingCpus;
-	volatile TUint32 iExitRequired;
-	TInt iLowPowerMode;
-    TDfc iStartAfterExtInitDfc;
-    TBool iInitialised;
-    };
-    
-
-
-#endif // __SMP__
-
-
-#endif //__SMPIDLEHANDLER_H__
--- a/kernel/eka/include/drivers/usbcsc.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/drivers/usbcsc.h	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -235,6 +235,7 @@
 	TUint* iPhysicalMap;
 public:
 	DChunk* iChunk;
+	TDfc iCleanup;
 
 	TInt8 iPageNtz; // Number of trailing zeros for a page. (Eg 4k page has 12 t.z.)
 	TInt iAllocatedSize;
@@ -414,8 +415,6 @@
 	void CancelQueued(TInt aErrorCode=KErrCancel);
 	TInt Complete(TInt aError);
 	void Complete();
-	void SetClient(DThread& aThread);
-	TBool IsRequestPending();
 public:
 	TUsbcScStatusState iState;
 
@@ -458,7 +457,6 @@
 	void UpdateBufferList(TInt aByteCount,TUint aFlags, TBool aStartNextRead=ETrue);
 	void Ep0CancelLddRead();
 	void SendEp0StatusPacket(TInt aState);
-	TBool IsRequestPending();
 
 public:
 	
--- a/kernel/eka/include/e32atomics.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/e32atomics.h	Wed Sep 01 12:34:56 2010 +0100
@@ -26,93 +26,6 @@
 /**	@file e32atomics.h
 	@publishedAll
 	@prototype
-
-	General purpose atomic operations and utility functions
-	All functions in this header are available on both user and kernel side.
-
-Atomic operations:
-	__e32_atomic_xxx_yyy8() should be used for 8 bit atomic variables
-	__e32_atomic_xxx_yyy16() should be used for 16 bit atomic variables
-	__e32_atomic_xxx_yyy32() should be used for 32 bit atomic variables
-	__e32_atomic_xxx_yyy64() should be used for 64 bit atomic variables
-	__e32_atomic_xxx_yyy_ptr() should be used for atomic updates to pointers
-
-	xxx specifies the operation performed
-		load	read memory atomically
-		store	write memory atomically
-		swp		write to a memory location and return the original value of the
-				memory location
-		add		add a value to a memory location and return the original value
-				of the memory location
-		and		bitwise AND a value with a memory location and return the
-				original value of the memory location
-		ior		bitwise OR a value with a memory location and return the
-				original value of the memory location
-		xor		bitwise XOR a value with a memory location and return the
-				original value of the memory location
-		axo		atomic { orig_v = *p; *p = (orig_v & u) ^ v; } return orig_v;
-		cas		if the value of a memory location matches a specified expected
-				value, write a specified new value and return TRUE, otherwise
-				update the expected value with the actual value seen and return
-				FALSE.
-		tau		if the value of a memory location is >= a specified threshold,
-				considered as an unsigned integer, add a specified value to it
-				otherwise add a different specified	value to it; return the
-				original value of the memory location
-		tas		if the value of a memory location is >= a specified threshold,
-				considered as a signed integer, add a specified value to it
-				otherwise add a different specified	value to it; return the
-				original value of the memory location
-				
-	yyy specifies the memory ordering:
-		rlx = relaxed memory ordering
-				there is no guarantee on the order in which the atomic operation
-				is observed relative to preceding or following memory accesses
-		acq = acquire semantics
-				the atomic operation is guaranteed to be observed before any
-				following memory accesses
-		rel = release semantics
-				the atomic operation is guaranteed to be observed after any
-				preceding memory accesses
-		ord = fully ordered
-				the atomic operation is guaranteed to be observed after any
-				preceding memory accesses and before any following memory
-				accesses
-
-	Note that these operations should only be used on normal memory regions
-	since they are implemented in terms of LDREX/STREX and so multiple reads
-	can occur before the operation completes. Also __e32_atomic_load_yyy64()
-	can't be used on read-only memory regions since it uses LDREXD/STREXD to
-	guarantee atomicity.
-	Atomic operations may only be used on naturally aligned memory (i.e. *16()
-	operations on an even address, *32() operations on an address which is a
-	multiple of 4 and *64() operations on an address which is a multiple of 8).
-	This applies even if you have (unwisely) decided to turn off alignment
-	checking.
-
-Barrier operations:
-	Two barrier functions are provided:
-	__e32_memory_barrier() - this ensures all preceding explicit memory accesses
-				are observed before any following explicit memory accesses.
-				Equates to the ARM DMB instruction.
-	__e32_io_completion_barrier() - this ensures all preceding explicit memory
-				accesses complete before any following instructions execute.
-				For example, it ensures that writes to I/O devices have actually
-				occurred before execution continues.
-				Equates to the ARM DSB instruction.
-
-Utility functions:
-	__e32_find_ms1_32	Return bit position of most significant 1 in a 32 bit
-						argument, or -1 if the argument is zero.
-	__e32_find_ls1_32	Return bit position of least significant 1 in a 32 bit
-						argument, or -1 if the argument is zero.
-	__e32_bit_count_32	Return the count of bits set to 1 in a 32 bit argument.
-	__e32_find_ms1_64	Return bit position of most significant 1 in a 64 bit
-						argument, or -1 if the argument is zero.
-	__e32_find_ls1_64	Return bit position of least significant 1 in a 64 bit
-						argument, or -1 if the argument is zero.
-	__e32_bit_count_64	Return the count of bits set to 1 in a 64 bit argument.
-
 */
 
 
--- a/kernel/eka/include/e32base.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/e32base.h	Wed Sep 01 12:34:56 2010 +0100
@@ -19,10 +19,6 @@
 #define __E32BASE_H__
 #include <e32std.h>
 
-#ifdef __ARMCC__
-#pragma push
-#pragma diag_suppress 830 
-#endif
 /**
  * Container Base Class
  */
@@ -75,10 +71,8 @@
 	CBase& operator=(const CBase&);
 private:
 	};
-
-#ifdef __ARMCC__	
-#pragma pop 	
-#endif
+	
+	
 	
 	
 class CBufBase : public CBase
--- a/kernel/eka/include/e32btrace.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/e32btrace.h	Wed Sep 01 12:34:56 2010 +0100
@@ -59,11 +59,11 @@
 					typically will contain the same values as would be returned by
 					User::FastCounter() or NKern::FastCounter().
 					This value is only present if the ETimestampPresent flag is set.
--#	Timestamp2. 	Additional timestamp information. E.g. the most significant
+-#	Timestamp2.		Additional timestamp information. E.g. the most significant
 					half of a 64bit timestamp value. Note, it is valid for a Timestamp2 value
 					to be present even if the previous Timestamp is absent.
 					This value is only present if the ETimestamp2Present flag is set.
--#	Context ID. 	This value indicates the context in which the trace was generated.
+-#	Context ID.		This value indicates the context in which the trace was generated.
 					The meaning of the id is dependent on the contents of the two
 					least significant bits:
 					-	00	indicates the value is the address of the NThread object for
@@ -207,7 +207,7 @@
 		/**
 		Header2 is present in the trace record.
 		*/
-		EHeader2Present 	= 1<<0,
+		EHeader2Present		= 1<<0,
 
 		/**
 		A timestamp value is present in the trace record.
@@ -260,7 +260,7 @@
 		/**
 		Masks out the bits for the CPU ID for SMP systems (zero if present on non SMP systems)
 		*/
-		ECpuIdMask			= 0xfffU<<20,
+		ECpuIdMask			= 0xfff<<20,
 		};
 
 	/**
@@ -308,7 +308,7 @@
 		/**
 		Indicates that this trace is the first part of a multipart trace.
 		*/
-		EMultipartFirst 		= 1,
+		EMultipartFirst			= 1,
 
 		/**
 		Indicates that this trace is a middle part of a multipart trace.
@@ -379,27 +379,28 @@
 		*/
 		ECpuUsage = 4,
 
-		/**
-		Category used for profiling device drivers, kernel extensions etc.
-		Used by PERF_LOG macro.
-		@prototype 9.3
-		*/
-		EKernPerfLog = 5,
-
-		/**
+        /**
+        Category used for profiling device drivers, kernel extensions etc.
+        Used by PERF_LOG macro.
+        @prototype 9.3
+        */
+        EKernPerfLog = 5,
+
+        /**
 		Trace generated when client-server activity takes place such as server creation,
 		session management, message handling, etc.
+
 		If #Prime is called with this category, traces will be generated for all
 		servers currently running and their sessions.
-		*/
-		EClientServer = 6,
-
-		/**
+        */
+        EClientServer = 6,
+
+        /**
 		Trace generated on thread request completion.
-		*/
-		ERequests = 7,
-
-		/**
+        */
+        ERequests = 7,
+
+        /**
 		Trace generated when chunks are created and destroyed, and when memory
 		is committed and decommitted to and from chunks.
 
@@ -407,10 +408,10 @@
 		chunks currently extant.
 
 		@see TChunks
-		*/
-		EChunks = 8,
-
-		/**
+        */
+        EChunks = 8,
+
+        /**
 		Trace generated when code segments are created and destroyed, mapped
 		into out of processes, and when memory is committed and decommitted to
 		and from them.
@@ -419,8 +420,8 @@
 		code segments currently extant.
 
 		@see TCodeSegs
-		*/
-		ECodeSegs = 9,
+        */
+        ECodeSegs = 9,
 
 		/**
 		Trace generated by Demand Paging.
@@ -441,7 +442,7 @@
 
 		@see enum TThreadPriority
 		@internalTechnology
-		@prototype 9.3
+        @prototype 9.3
 		*/
 		EThreadPriority = 11,
 
@@ -511,17 +512,17 @@
 		EProfiling = 18,
 
 		/**
-		Trace generated by Power Resource Manager.
-		@prototype 9.5
-		*/
-		EResourceManager = 19,
-
-
-		/**
-		Trace generated by Power Resource Manager User-Side API.
-		@prototype 9.5
-		*/
-		EResourceManagerUs = 20,
+        Trace generated by Power Resource Manager.
+        @prototype 9.5
+        */
+        EResourceManager = 19,
+
+
+        /**
+        Trace generated by Power Resource Manager User-Side API.
+        @prototype 9.5
+        */
+        EResourceManagerUs = 20,
 
 		/**
 		Trace generated by Raw Event subsystem APIs
@@ -535,13 +536,13 @@
 		of standard logging (conditional Kern::Printf() calls) is sufficiently
 		time-consuming that the required device timings mandated by the core
 		USB standards cannot be achieved
-		@prototype 9.5
+        @prototype 9.5
 		*/
 		EUsb = 22,
 
 		/**
 		Trace generated by Symbian OS kernel synchronization objects.
-		@prototype 9.5
+        @prototype 9.5
 		*/
 		ESymbianKernelSync = 23,
 
@@ -551,22 +552,10 @@
 		EFlexibleMemModel = 24,
 
 		/**
-		Trace generated by IIC bus.
-		@prototype 9.6
-		*/
-		EIic = 25,
-
-		/**
-		Trace generated by load balancing or higher-level scheduling
-		@prototype 9.6
-		*/
-		EHSched = 26,
-
-		/**
-		Trace generated by the nanokernel
-		@prototype 9.6
-		*/
-		ENKern = 27,
+        Trace generated by IIC bus.
+        @prototype 9.6
+        */
+        EIic = 25,
 
 		/**
 		First category value in the range reserved for platform specific use;
@@ -779,10 +768,10 @@
 		ENewThreadContext
 		};
 
-	/**
+    /**
 	@internalTechnology
-	@prototype 9.3
-	*/
+    @prototype 9.3
+    */
 	enum TClientServer
 		{
 		/**
@@ -856,7 +845,7 @@
 		Trace data format:
 		- 4 bytes containing the message handle.
 		- 4 bytes containing the completion reason, or object handle, value.
-			(The object handle value is that which is delivered to the sender of the
+		    (The object handle value is that which is delivered to the sender of the
 			message, not that supplied by the server actually completing the request.)
 
 		The context id (NThread*) in this trace is that of the thread which completed the message.
@@ -865,10 +854,10 @@
 		};
 
 
-	/**
+    /**
 	@internalTechnology
-	@prototype 9.3
-	*/
+    @prototype 9.3
+    */
 	enum TRequests
 		{
 		/**
@@ -1438,499 +1427,461 @@
 		};
 
     /**
-    Enumeration of sub-category values for trace category EResourceManager.
-    @see EResourceManager
+	Enumeration of sub-category values for trace category EResourceManager.
+	@see EResourceManager
     @prototype 9.5
-    */
-    enum TResourceManager
-        {
-        /**
-        Trace output for resource registration.
-
-        Trace data format:
-        - 4 bytes containing the Resource Id.
-        - 4 bytes containing the Resource address.
-        - 4 bytes containing the Resource Minimum Level
-        - 4 bytes containing the Resource Maximum Level
-        - 4 bytes containing the Resource Default Level
-        - 4 bytes containing the length of resource name
-        - N bytes containing the Resource name, where 0 < N < 32
-        */
-        ERegisterResource = 0,
-
-        /**
-        Trace output for client registration
-
-        Trace data format:
-        - 4 bytes containing clientId
-        - 4 bytes containing client address
-        - 4 bytes containing the length of client name
-        - N bytes containing client name, where 0 < N < 32
-        */
-        ERegisterClient,
-
-        /**
-        Trace output for client deregistration
-
-        Trace data format:
-        - 4 bytes containing clientId
-        - 4 bytes containing client address
-        - 4 bytes containing the length of client name
-        - N bytes containing client name, where 0 < N < 32
-        */
-        EDeRegisterClient,
-
-        /**
-        Trace output for resource state change start operation
-
-        Trace data format:
-        - 4 bytes containing clientId
-        - 4 bytes containing the Resource Id.
-        - 4 bytes containing the Resource state
-        - 4 bytes containing the length of client name
-        - N bytes containing client name, where 0 < N < 32
-        - 4 bytes containing the length of resource name
-        - N bytes containing the Resource name, where 0 < N < 32
-        */
-        ESetResourceStateStart,
-
-        /**
-        Trace output for resource state change end operation
-
-        Trace data format:
-        - 4 bytes containing clientId
-        - 4 bytes containing the Resource Id.
-        - 4 bytes containing return value.
-        - 4 bytes containing the Resource state.
-        - 4 bytes containing the length of client name
-        - N bytes containing client name, where 0 < N < 32
-        - 4 bytes containing the length of resource name        
-        - N bytes containing the Resource name, where 0 < N < 32
-        */
-        ESetResourceStateEnd,
-
-        /**
-        Trace output for registration for post notification
-
-        Trace data format:
-        - 4 bytes containing clientId
-        - 4 bytes containing the Resource Id.
-        - 4 bytest containing the callback address
-        - 4 bytes containing return value.
-        */
-        EPostNotificationRegister,
-
-        /**
-        Trace output for deregistration for post notification
-
-        Trace data format:
-        - 4 bytes containing clientId
-        - 4 bytes containing the Resource Id.
-        - 4 bytes containing the callback address
-        - 4 bytes containing the return value.
-        */
-        EPostNotificationDeRegister,
-
-        /**
-        Trace output for post notification sent.
-
-        Trace data format:
-        - 4 bytes containing clientId
-        - 4 bytes containing the Resource Id.
-        */
-        EPostNotificationSent,
-
-        /**
-        Trace output for Callback complete
-
-        Trace data format:
-        - 4 bytes containing clientId
-        - 4 bytes containing the Resource Id.
-        */
-        ECallbackComplete,
-
-        /**
-        Trace output for resource manager memory usage
-
-        Trace data format:
-        - 4 bytes containing memory allocated in bytes.
-        */
-        EMemoryUsage,
-
-        /**
-        Trace output for get resource state start operation
-
-        Trace data format:
-        - 4 bytes containing clientId
-        - 4 bytes containing the Resource Id.
-        - 4 bytes containing the length of client name.
-        - N bytes containing client name, where 0 < N < 32
-        - 4 bytes containing the length of resource name.
-        - N bytes containing the Resource name, where 0 < N < 32
-        */
-        EGetResourceStateStart,
-
-        /**
-        Trace output for get resource state end operation
-
-        Trace data format:
-        - 4 bytes containing clientId
-        - 4 bytes containing the Resource Id.
-        - 4 bytes containing the Resource state
-        - 4 bytes containing return value.
-        - 4 bytes containing the length of client name.
-        - N bytes containing client name, where 0 < N < 32
-        - 4 bytes containing the length of resource name.
-        - N bytes containing the Resource name, where 0 < N < 32
-        */
-        EGetResourceStateEnd,
-
-        /**
-        Trace output for cancellation of long latency operation
-
-        Trace data format:
-        - 4 bytes containing clientId
-        - 4 bytes containing the Resource Id.
-        - 4 bytes containing return value
-        - 4 bytes containing the length of client name.
-        - N bytes containing client name, where 0 < N < 32
-        - 4 bytes containing the length of resource name.
-        - N bytes containing the Resource name, where 0 < N < 32
-        */
-        ECancelLongLatencyOperation,
-
-        /**
-        Trace output for booting of resource manager
-
-        Trace data format:
-        - 4 bytes containing entry point
-        */
-        EBooting,
-
-        /**
-        Trace output for PSL resource state change operation
-
-        Trace data format:
-        - 4 bytes containing clientId
-        - 4 bytes containing the Resource Id.
-        - 4 bytes containing the Resource current state
-        - 4 bytes containing the resource requested state
-        - 4 bytes containing the length of resource name.
-        - N bytes containing the Resource name, where 0 < N < 32
-        */
-        EPslChangeResourceStateStart,
-
-        /**
-        Trace output for PSL resource state change operation
-
-        Trace data format:
-        - 4 bytes containing clientId
-        - 4 bytes containing the Resource Id.
-        - 4 bytes containing the Resource current state
-        - 4 bytes containing the resource requested state
-        - 4 bytes containing return value
-        - 4 bytes containing the length of resource name.
-        - N bytes containing the Resource name, where 0 < N < 32
-        */
-        EPslChangeResourceStateEnd,
-
-        /**
-        Trace output for get resource state start operation in PSL
-
-        Trace data format:
-        - 4 bytes containing clientId
-        - 4 bytes containing the Resource Id.
-        - 4 bytes containing the length of resource name.
-        - N bytes containing the Resource name, where 0 < N < 32
-        */
-        EPslGetResourceStateStart,
-
-        /**
-        Trace output for get resource state end operation in PSL
-
-        Trace data format:
-        - 4 bytes containing clientId
-        - 4 bytes containing the Resource Id.
-        - 4 bytes containing the Resource state
-        - 4 bytes containing return value.
-        - 4 bytes containing the length of resource name.
-        - N bytes containing the Resource name, where 0 < N < 32
-        */
-        EPslGetResourceStateEnd,
-
-        /**
-        Trace output for resource creation
-
-        Trace data format:
-        - 4 bytes containing minimum value of resource
-        - 4 bytes containing maximum value of resource
-        - 4 bytes containing the default value of resource
-        - 4 bytes containing the properties of the resource
-        - 4 bytes containing the length of resource name.
-        - N bytes containing the Resource name, where 0 < N < 32
-        */
-        EPslResourceCreate,
-
-        /**
-        Trace output for static resource with dependency registration
-
-        Trace data format:
-        - 4 bytes containing the Resource Id
-        - 4 bytes containing the Resource address
-        - 4 bytes containing the minimum value of resource
-        - 4 bytes containing the maximum value of resource
-        - 4 bytes containing the default value of resource
-        - 4 bytes containing the length of resource name
-        - N bytes containing the Resource name, where 0 < N < 32
-        */
-        ERegisterStaticResourceWithDependency,
-
-        /**
-        Trace output for dynamic resource registration
-
-        Trace data format:
-        - 4 bytes containing clientId
-        - 4 bytes containing the Resource Id
-        - 4 bytes containing the resouce address
-        - 4 bytes containing the length of client name
-        - N bytes containing the client name, where 0 < N < 32
-        - 4 bytes containing the length of resource name
-        - N bytes containing the resource name, where 0 < N < 32
-        */
-        ERegisterDynamicResource,
-
-        /**
-        Trace output for dynamic resource deregistration
-
-        Trace data format:
-        - 4 bytes containing clientId
-        - 4 bytes containing the Resource Id
-        - 4 bytes containing the resource address
-        - 4 bytes containing the resource level.
-        - 4 bytes containing the length of client name
-        - N bytes containing the client name, where 0 < N < 32
-        - 4 bytes containing the length of resource name
-        - N bytes containing the resource name, where 0 < N < 32
-        */
-        EDeRegisterDynamicResource,
-
-        /**
-        Trace output for resource dependency registration
-
-        Trace data format:
-        - 4 bytes containing clientId
-        - 4 bytes containing the Resource Id of first dependent resource
-        - 4 bytes containing the Resource Id of second dependent resource
-        - 4 bytes containing the address of first dependent resource
-        - 4 bytes containing the address of second dependent resource
-        - 4 bytes containing the length of client name
-        - N bytes containing the client name, where 0 < N < 32
-        - 4 bytes containing the length of resource name of first dependent resource
-        - N bytes containing the resource name of first dependent resource, where 0 < N < 32
-        - 4 bytes containing the length of resource name of second dependent resource
-        - N bytes containing the resource name of second dependent resource, where 0 < N < 32
-        */
-        ERegisterResourceDependency,
-
-        /**
-        Trace output for resource dependency deregistration
-
-        Trace data format:
-        - 4 bytes containing clientId
-        - 4 bytes containing the Resource Id of first dependent resource
-        - 4 bytes containing the resource id of second dependent resource
-        - 4 bytes containing the address of first dependent resource
-        - 4 bytes containing the address of second dependent resource
-        - 4 bytes containing the length of client name
-        - N bytes containing the client name, where 0 < N < 32
-        - 4 bytes containing the length of resource name of first dependent resource
-        - N bytes containing the resource name of first dependent resource, where 0 < N < 32
-        - 4 bytes containing the length of resource name of second dependent resource
-        - N bytes containing the resource name of second dependent resource, where 0 < N < 32
-        */
-        EDeRegisterResourceDependency
-        };
+	*/
+	enum TResourceManager
+		{
+		/**
+		Trace output for resource registration.
+
+		Trace data format:
+		- 4 bytes containing the Resource Id.
+		- 4 bytes containing the Resource address.
+		- N bytes containing the Resource name, where 0 < N < 32
+		- 4 bytes containing the Resource Minimum Level
+		- 4 bytes containing the Resource Maximum Level
+		- 4 bytes containing the Resource Default Level
+		*/
+		ERegisterResource = 0,
+
+		/**
+		Trace output for client registration
+
+		Trace data format:
+		- 4 bytes containing clientId
+		- 4 bytes containing client address
+		- N bytes containing client name, where 0 < N < 32
+		*/
+		ERegisterClient,
+
+		/**
+		Trace output for client deregistration
+
+		Trace data format:
+		- 4 bytes containing clientId
+		- 4 bytes containing client address
+		- N bytes containing client name, where 0 < N < 32
+		*/
+		EDeRegisterClient,
+
+		/**
+		Trace output for resource state change start operation
+
+		Trace data format:
+		- 4 bytes containing clientId
+		- 4 bytes containing the Resource Id.
+		- N bytes containing client name, where 0 < N < 32
+		- N bytes containing the Resource name, where 0 < N < 32
+		- 4 bytes containing the Resource state
+		*/
+		ESetResourceStateStart,
+
+		/**
+		Trace output for resource state change end operation
+
+		Trace data format:
+		- 4 bytes containing clientId
+		- 4 bytes containing the Resource Id.
+		- N bytes containing client name, where 0 < N < 32
+		- N bytes containing the Resource name, where 0 < N < 32
+		- 4 bytes containing return value.
+		- 4 bytes containing the Resource state.
+		*/
+		ESetResourceStateEnd,
+
+		/**
+		Trace output for registration for post notification
+
+		Trace data format:
+		- 4 bytes containing clientId
+		- 4 bytes containing the Resource Id.
+		- 4 bytest containing the callback address
+		- 4 bytes containing return value.
+		*/
+		EPostNotificationRegister,
+
+		/**
+		Trace output for deregistration for post notification
+
+		Trace data format:
+		- 4 bytes containing clientId
+		- 4 bytes containing the Resource Id.
+		- 4 bytes containing the callback address
+		- 4 bytes containing the return value.
+		*/
+		EPostNotificationDeRegister,
+
+		/**
+		Trace output for post notification sent.
+
+		Trace data format:
+		- 4 bytes containing clientId
+		- 4 bytes containing the Resource Id.
+		*/
+		EPostNotificationSent,
+
+		/**
+		Trace output for Callback complete
+
+		Trace data format:
+		- 4 bytes containing clientId
+		- 4 bytes containing the Resource Id.
+		*/
+		ECallbackComplete,
+
+		/**
+		Trace output for resource manager memory usage
+
+		Trace data format:
+		- 4 bytes containing memory allocated in bytes.
+		*/
+		EMemoryUsage,
+
+		/**
+		Trace output for get resource state start operation
+
+		Trace data format:
+		- 4 bytes containing clientId
+		- 4 bytes containing the Resource Id.
+		- N bytes containing client name, where 0 < N < 32
+		- N bytes containing the Resource name, where 0 < N < 32
+		*/
+		EGetResourceStateStart,
+
+		/**
+		Trace output for get resource state end operation
+
+		Trace data format:
+		- 4 bytes containing clientId
+		- 4 bytes containing the Resource Id.
+		- N bytes containing client name, where 0 < N < 32
+		- N bytes containing the Resource name, where 0 < N < 32
+		- 4 bytes containing the Resource state
+		- 4 bytes containing return value.
+		*/
+		EGetResourceStateEnd,
+
+		/**
+		Trace output for cancellation of long latency operation
+
+		Trace data format:
+		- 4 bytes containing clientId
+		- 4 bytes containing the Resource Id.
+		- N bytes containing client name, where 0 < N < 32
+		- N bytes containing the Resource name, where 0 < N < 32
+		- 4 bytes containing return value
+		*/
+		ECancelLongLatencyOperation,
+
+		/**
+		Trace output for booting of resource manager
+
+		Trace data format:
+		- 4 bytes containing entry point
+		*/
+		EBooting,
+
+		/**
+		Trace output for PSL resource state change operation
+
+		Trace data format:
+		- 4 bytes containing clientId
+		- 4 bytes containing the Resource Id.
+		- N bytes containing the Resource name, where 0 < N < 32
+		- 4 bytes containing the Resource current state
+		- 4 bytes containing the resource requested state
+		*/
+		EPslChangeResourceStateStart,
+
+		/**
+		Trace output for PSL resource state change operation
+
+		Trace data format:
+		- 4 bytes containing clientId
+		- 4 bytes containing the Resource Id.
+		- N bytes containing the Resource name, where 0 < N < 32
+		- 4 bytes containing the Resource current state
+		- 4 bytes containing the resource requested state
+		- 4 bytes containing return value
+		*/
+		EPslChangeResourceStateEnd,
+
+		/**
+		Trace output for get resource state start operation in PSL
+
+		Trace data format:
+		- 4 bytes containing clientId
+		- 4 bytes containing the Resource Id.
+		- N bytes containing the Resource name, where 0 < N < 32
+		*/
+		EPslGetResourceStateStart,
+
+		/**
+		Trace output for get resource state end operation in PSL
+
+		Trace data format:
+		- 4 bytes containing clientId
+		- 4 bytes containing the Resource Id.
+		- N bytes containing the Resource name, where 0 < N < 32
+		- 4 bytes containing the Resource state
+		- 4 bytes containing return value.
+		*/
+		EPslGetResourceStateEnd,
+
+		/**
+		Trace output for resource creation
+
+		Trace data format:
+		- 4 bytes containing minimum value of resource
+		- 4 bytes containing maximum value of resource
+		- 4 bytes containing the default value of resource
+		- 4 bytes containing the properties of the resource
+		- N bytes containing the Resource name, where 0 < N < 32
+		*/
+		EPslResourceCreate,
+
+		/**
+		Trace output for static resource with dependency registration
+
+		Trace data format:
+		- 4 bytes containing the Resource Id
+		- 4 bytes containing the Resource address
+		- N bytes containing the Resource name, where 0 < N < 32
+		- 4 bytes containing the minimum value of resource
+		- 4 bytes containing the maximum value of resource
+		- 4 bytes containing the default value of resource
+		*/
+		ERegisterStaticResourceWithDependency,
+
+		/**
+		Trace output for dynamic resource registration
+
+		Trace data format:
+		- 4 bytes containing clientId
+		- 4 bytes containing the Resource Id
+		- N bytes containing the client name, where 0 < N < 32
+		- N bytes containing the resource name, where 0 < N < 32
+		- 4 bytes containing the resouce address
+		*/
+		ERegisterDynamicResource,
+
+		/**
+		Trace output for dynamic resource deregistration
+
+		Trace data format:
+		- 4 bytes containing clientId
+		- 4 bytes containing the Resource Id
+		- N bytes containing the client name, where 0 < N < 32
+		- N bytes containing the resource name, where 0 < N < 32
+		- 4 bytes containing the resource address
+		- 4 bytes containing the resource level.
+		*/
+		EDeRegisterDynamicResource,
+
+		/**
+		Trace output for resource dependency registration
+
+		Trace data format:
+		- 4 bytes containing clientId
+		- 4 bytes containing the Resource Id of first dependent resource
+		- N bytes containing the client name, where 0 < N < 32
+		- N bytes containing the resource name of first dependent resource, where 0 < N < 32
+		- 4 bytes containing the Resource Id of second dependent resource
+		- N bytes containing the resource name of second dependent resource, where 0 < N < 32
+		- 4 bytes containing the address of first dependent resource
+		- 4 bytes containing the address of second dependent resource
+		*/
+		ERegisterResourceDependency,
+
+		/**
+		Trace output for resource dependency deregistration
+
+		Trace data format:
+		- 4 bytes containing clientId
+		- 4 bytes containing the Resource Id of first dependent resource
+		- N bytes containing the client name, where 0 < N < 32
+		- N bytes containing the resource name of first dependent resource, where 0 < N < 32
+		- 4 bytes containing the resource id of second dependent resource
+		- N bytes containing the resource name of second dependent resource, where 0 < N < 32
+		- 4 bytes containing the address of first dependent resource
+		- 4 bytes containing the address of second dependent resource
+		*/
+		EDeRegisterResourceDependency
+		};
     /**
-    Enumeration of sub-category values for trace category EResourceManagerUs.
-    @see EResourceManagerUs
+	Enumeration of sub-category values for trace category EResourceManagerUs.
+	@see EResourceManagerUs
     @prototype 9.5
-    */
-    enum TResourceManagerUs
-        {
-        /**
-        Trace output for the start of opening a channel to the Resource Controller.
-
-        Trace data format:
-        - 4 bytes containing the client thread identifier.
-        - 4 bytes containing the length of client name.
-        - N bytes containing the client name, where 0 < N < 32
-        */
-        EOpenChannelUsStart = 0,
-        /**
-        Trace output for the end of opening a channel to the Resource Controller.
-
-        Trace data format:
-        - 4 bytes containing the client identifier provided by the Resource Controller
-        - 4 bytes containing the length of client name.
-        - N bytes containing the client name, where 0 < N < 32
-        */
-        EOpenChannelUsEnd,
-        /**
-        Trace output for the start of registering a client with the Resource Controller.
-
-        Trace data format:
-        - 4 bytes containing the client identifier provided by the Resource Controller
-        - 1 bytes the number of concurrent change resource state operations to be supported
-        - 1 bytes the number of concurrent notification requests to be supported        
-        - 1 bytes the number of concurrent get resource state operations to be supported
-        - 1 bytes unused        
-        - 4 bytes containing the length of client name.
-        - N bytes containing the client name, where 0 < N < 32
-        */
-        ERegisterClientUsStart,
-        /**
-        Trace output for the end of registering a client with the Resource Controller.
-
-        Trace data format:
-        - 4 bytes containing the client identifier provided by the Resource Controller.
-        - 4 bytes specifying the value returned from the call to Resource Controller's AllocReserve method
-        */
-        ERegisterClientUsEnd,
-        /**
-        Trace output for the start of de-registering a client with the Resource Controller.
-
-        Trace data format:
-        - 4 bytes containing the client identifier provided by the Resource Controller.
-        - 4 bytes containing the length of client name.
-        - N bytes containing the client name, where 0 < N < 32
-        */
-        EDeRegisterClientUsStart,
-        /**
-        Trace output for the end of registering a client with the Resource Controller.
-
-        Trace data format:
-        - 4 bytes containing the client identifier provided by the Resource Controller.
-        */
-        EDeRegisterClientUsEnd,
-        /**
-        Trace output for the start of a GetResourceState request to the Resource Controller.
-
-        Trace data format:
-        - 4 bytes specifying the resource ID
-        - 4 bytes containing the client identifier provided by the Resource Controller.
-        - 4 bytes containing the length of client name.
-        - N bytes containing the client name, where 0 < N < 32
-        */
-        EGetResourceStateUsStart,
-        /**
-        Trace output for the end of a GetResourceState request to the Resource Controller.
-
-        Trace data format:
-        - 4 bytes specifying the resource ID
-        - 4 bytes specifying the resource level
-        - 4 bytes containing the client identifier
-        - 4 bytes specifying the success code returned by the Resource Controller.
-        */
-        EGetResourceStateUsEnd,
-        /**
-        Trace output for the start of a ChangeResourceState request to the Resource Controller.
-
-        Trace data format:
-        - 4 bytes specifying the resource ID
-        - 4 bytes specifying the required state
-        - 4 bytes containing the client identifier provided by the Resource Controller.
-        - 4 bytes containing the length of client name.
-        - N bytes containing the client name, where 0 < N < 32
-        */
-        ESetResourceStateUsStart,
-        /**
-        Trace output for the end of a ChangeResourceState request to the Resource Controller.
-
-        Trace data format:
-        - 4 bytes specifying the resource ID
-        - 4 bytes specifying the requested state
-        - 4 bytes containing the client identifier
-        - 4 bytes specifying the success code returned by the Resource Controller.
-        */
-        ESetResourceStateUsEnd,
-        /**
-        Trace output for the start of a cancel GetResourceState request to the Resource Controller.
-
-        Trace data format:
-        - 4 bytes specifying the resource ID
-        - 4 bytes containing the client identifier provided by the Resource Controller.
-        - 4 bytes containing the length of client name.
-        - N bytes containing the client name, where 0 < N < 32
-        */
-        ECancelGetResourceStateUsStart,
-        /**
-        Trace output for the end of a cancel GetResourceState request to the Resource Controller.
-
-        Trace data format:
-        - 4 bytes specifying the resource ID
-        - 4 bytes containing the client identifier provided by the Resource Controller.
-        - 4 bytes containing the length of client name.
-        - N bytes containing the client name, where 0 < N < 32
-        */
-        ECancelGetResourceStateUsEnd,
-        /**
-        Trace output for the start of a cancel ChangeResourceState request to the Resource Controller.
-
-        Trace data format:
-        - 4 bytes specifying the resource ID
-        - 4 bytes containing the client identifier provided by the Resource Controller.
-        - 4 bytes containing the length of client name.
-        - N bytes containing the client name, where 0 < N < 32
-        */
-        ECancelSetResourceStateUsStart,
-        /**
-        Trace output for the end of a cancel ChangeResourceState request to the Resource Controller.
-
-        Trace data format:
-        - 4 bytes specifying the resource ID
-        - 4 bytes containing the client identifier provided by the Resource Controller.
-        - 4 bytes containing the length of client name.
-        - N bytes containing the client name, where 0 < N < 32
-        */
-        ECancelSetResourceStateUsEnd
-        };
-
-    /**
-    Enumeration of sub-category values for trace category EThreadPriority.
-    @see EThreadPriority
-    @internalTechnology
+	*/
+	enum TResourceManagerUs
+		{
+		/**
+		Trace output for the start of opening a channel to the Resource Controller.
+
+		Trace data format:
+		- 4 bytes unused (displays 0)
+		- 4 bytes containing the client thread identifier.
+		- N bytes containing the client name, where 0 < N < 32
+		*/
+		EOpenChannelUsStart = 0,
+		/**
+		Trace output for the end of opening a channel to the Resource Controller.
+
+		Trace data format:
+		- 4 bytes unused (displays 0)
+		- 4 bytes containing the client identifier provided by the Resource Controller
+		- N bytes containing the client name, where 0 < N < 32
+		*/
+		EOpenChannelUsEnd,
+		/**
+		Trace output for the start of registering a client with the Resource Controller.
+
+		Trace data format:
+		- 4 bytes the number of concurrent change resource state operations to be supported
+		- 4 bytes the number of concurrent notification requests to be supported
+		- N bytes containing the client name, where 0 < N < 32
+		- 4 bytes the number of concurrent get resource state operations to be supported
+		*/
+		ERegisterClientUsStart,
+		/**
+		Trace output for the end of registering a client with the Resource Controller.
+
+		Trace data format:
+		- 4 bytes containing the client identifier provided by the Resource Controller.
+		- 4 bytes specifying the value returned from the call to Resource Controller's AllocReserve method
+		*/
+		ERegisterClientUsEnd,
+		/**
+		Trace output for the start of de-registering a client with the Resource Controller.
+
+		Trace data format:
+		- 4 bytes unused (displays 0)
+		- 4 bytes containing the client identifier provided by the Resource Controller.
+		- N bytes containing the client name, where 0 < N < 32
+		*/
+		EDeRegisterClientUsStart,
+		/**
+		Trace output for the end of registering a client with the Resource Controller.
+
+		Trace data format:
+		- 4 bytes containing the client identifier provided by the Resource Controller.
+		*/
+		EDeRegisterClientUsEnd,
+		/**
+		Trace output for the start of a GetResourceState request to the Resource Controller.
+
+		Trace data format:
+		- 4 bytes specifying the resource ID
+		- 4 bytes containing the client identifier provided by the Resource Controller.
+		- N bytes containing the client name, where 0 < N < 32
+		*/
+		EGetResourceStateUsStart,
+		/**
+		Trace output for the end of a GetResourceState request to the Resource Controller.
+
+		Trace data format:
+		- 4 bytes specifying the resource ID
+		- 4 bytes specifying the resource level
+		- 4 bytes containing the client identifier
+		- 4 bytes specifying the success code returned by the Resource Controller.
+		*/
+		EGetResourceStateUsEnd,
+		/**
+		Trace output for the start of a ChangeResourceState request to the Resource Controller.
+
+		Trace data format:
+		- 4 bytes specifying the resource ID
+		- 4 bytes specifying the required state
+		- N bytes containing the client name, where 0 < N < 32
+		- 4 bytes containing the client identifier provided by the Resource Controller.
+		*/
+		ESetResourceStateUsStart,
+		/**
+		Trace output for the end of a ChangeResourceState request to the Resource Controller.
+
+		Trace data format:
+		- 4 bytes specifying the resource ID
+		- 4 bytes specifying the requested state
+		- 4 bytes containing the client identifier
+		- 4 bytes specifying the success code returned by the Resource Controller.
+		*/
+		ESetResourceStateUsEnd,
+		/**
+		Trace output for the start of a cancel GetResourceState request to the Resource Controller.
+
+		Trace data format:
+		- 4 bytes specifying the resource ID
+		- 4 bytes containing the client identifier provided by the Resource Controller.
+		- N bytes containing the client name, where 0 < N < 32
+		*/
+		ECancelGetResourceStateUsStart,
+		/**
+		Trace output for the end of a cancel GetResourceState request to the Resource Controller.
+
+		Trace data format:
+		- 4 bytes specifying the resource ID
+		- 4 bytes containing the client identifier provided by the Resource Controller.
+		- N bytes containing the client name, where 0 < N < 32
+		*/
+		ECancelGetResourceStateUsEnd,
+		/**
+		Trace output for the start of a cancel ChangeResourceState request to the Resource Controller.
+
+		Trace data format:
+		- 4 bytes specifying the resource ID
+		- 4 bytes containing the client identifier provided by the Resource Controller.
+		- N bytes containing the client name, where 0 < N < 32
+		*/
+		ECancelSetResourceStateUsStart,
+		/**
+		Trace output for the end of a cancel ChangeResourceState request to the Resource Controller.
+
+		Trace data format:
+		- 4 bytes specifying the resource ID
+		- 4 bytes containing the client identifier provided by the Resource Controller.
+		- N bytes containing the client name, where 0 < N < 32
+		*/
+		ECancelSetResourceStateUsEnd
+		};
+
+	/**
+	Enumeration of sub-category values for trace category EThreadPriority.
+	@see EThreadPriority
+	@internalTechnology
     @prototype 9.3
-    */
-    enum TThreadPriority
-        {
-        /**
-        Trace output when a nanothread priority is changed.
-
-        Trace data format:
-        - 4 bytes containing the context id (an NThread*) for the thread whose priority is changing.
-        - 4 bytes containing the new absolute priority.
-        */
-        ENThreadPriority=0,
-
-        /**
-        Trace output when a DThread's default priority is set.
-
-        Trace data format:
-        - 4 bytes containing the context id (an NThread*) for the thread whose priority is changing.
-        - 4 bytes containing the iThreadPriority member - a value from enum ::TThrdPriority.
-        - 4 bytes containing the new default absolute priority.
-        */
-        EDThreadPriority=1,
-
-        /**
-        Trace output when a DProcess priority is changed.
-
-        Trace data format:
-        - 4 bytes containing trace id (a DProcess*) for process.
-        - 4 bytes containing the new process priority, a value from enum ::TProcPriority
-        */
-        EProcessPriority=2
-        };
+	*/
+	enum TThreadPriority
+		{
+		/**
+		Trace output when a nanothread priority is changed.
+
+		Trace data format:
+		- 4 bytes containing the context id (an NThread*) for the thread whose priority is changing.
+		- 4 bytes containing the new absolute priority.
+		*/
+		ENThreadPriority=0,
+
+		/**
+		Trace output when a DThread's default priority is set.
+
+		Trace data format:
+		- 4 bytes containing the context id (an NThread*) for the thread whose priority is changing.
+		- 4 bytes containing the iThreadPriority member - a value from enum ::TThrdPriority.
+		- 4 bytes containing the new default absolute priority.
+		*/
+		EDThreadPriority=1,
+
+		/**
+		Trace output when a DProcess priority is changed.
+
+		Trace data format:
+		- 4 bytes containing trace id (a DProcess*) for process.
+		- 4 bytes containing the new process priority, a value from enum ::TProcPriority
+		*/
+		EProcessPriority=2
+		};
 
 	/**
 	Enumeration of sub-category values for trace category EPagingMedia.
@@ -2538,7 +2489,7 @@
 
 		/**
 		Event generated when DRamAllocator::ZoneAllocRamPages has successfully
-		allocated all the requested RAM pages.	If DRamAllocator::ZoneAllocRamPages
+		allocated all the requested RAM pages.  If DRamAllocator::ZoneAllocRamPages
 		couldn't allocate all the requested pages then this event is not generated.
 
 		Trace data format:
@@ -2638,7 +2589,7 @@
 		/**
 		CPU sample from non-Symbian thread.
 
-		Trace data format:
+  		Trace data format:
 		- no extra bytes are sent
 		*/
 		ECpuNonSymbianThreadSample
@@ -2683,7 +2634,7 @@
 		--4 bytes containining the Z co-ordinate
 		--4 bytes containining the PointerNumber
 
-		if there are  7*4 byte data
+  		if there are  7*4 byte data
 		- 4 bytes containing the event type
 		--4 bytes containining the X co-ordinate
 		--4 bytes containining the Y co-ordinate
@@ -2929,7 +2880,7 @@
 		// The following traces associate memory model objects with the kernel objects that use them
 
 		/**
-		A memory object is being used for the contents of a chunk.
+	    A memory object is being used for the contents of a chunk.
 
 		Trace data format:
 		- 4 bytes containing the memory object id (a DMemoryObject*).
@@ -2938,7 +2889,7 @@
 		EMemoryObjectIsChunk,
 
 		/**
-		A memory object is being used for the contents of a code segment.
+	    A memory object is being used for the contents of a code segment.
 
 		Trace data format:
 		- 4 bytes containing the memory object id (a DMemoryObject*).
@@ -2947,7 +2898,7 @@
 		EMemoryObjectIsCodeSeg,
 
 		/**
-		A memory object is being used for process static data.
+	    A memory object is being used for process static data.
 
 		Trace data format:
 		- 4 bytes containing the memory object id (a DMemoryObject*).
@@ -2956,7 +2907,7 @@
 		EMemoryObjectIsProcessStaticData,
 
 		/**
-		A memory object is being used for DLL static data.
+	    A memory object is being used for DLL static data.
 
 		Trace data format:
 		- 4 bytes containing the memory object id (a DMemoryObject*).
@@ -2966,7 +2917,7 @@
 		EMemoryObjectIsDllStaticData,
 
 		/**
-		A memory object is being used for a thread's supervisor stack.
+	    A memory object is being used for a thread's supervisor stack.
 
 		Trace data format:
 		- 4 bytes containing the memory object id (a DMemoryObject*).
@@ -2975,7 +2926,7 @@
 		EMemoryObjectIsSupervisorStack,
 
 		/**
-		A memory object is being used for a thread's user stack.
+	    A memory object is being used for a thread's user stack.
 
 		Trace data format:
 		- 4 bytes containing the memory object id (a DMemoryObject*).
@@ -2994,10 +2945,10 @@
 		EAddressSpaceId
 		};
 
-	/**
+    /**
 	Enumeration of sub-category values for trace category EIic.
 	@see EIic
-	@prototype 9.6
+    @prototype 9.6
 	*/
 	enum TIic
 		{
@@ -3493,22 +3444,6 @@
 		};
 
 	/**
-	Enumeration of sub-category values for trace category EHSched.
-	@see EHSched
-	@prototype 9.6
-	*/
-	enum THSched
-		{
-		/**
-		Trace output when a thread has been processed by the load balancer
-		Trace data format:
-		- 4 bytes containing pointer to thread
-		- 4 bytes containing flags indicating result of balancing
-		*/
-		ELbDone = 0,
-		};
-
-	/**
 	Calculate the address of the next trace record.
 	@param aCurrentRecord A pointer to a trace record.
 	@return The address of the trace record which follows aCurrentRecord.
@@ -3537,9 +3472,9 @@
 	trace as specified in aHeader.
 
 	@param aHeader	The 4 bytes for the trace header.
-	@param aHeader2 The second header word.
+	@param aHeader2	The second header word.
 					(If EHeader2Present is set in the header flags.)
-	@param aContext The context id.
+	@param aContext	The context id.
 					(If EContextIdPresent is set in the header flags.)
 	@param a1		The first four bytes of trace data.
 					(Only if the header size indicates that this is present.)
@@ -3555,7 +3490,7 @@
 	@param aPc		The Program Counter value.
 					(If EPcPresent is set in the header flags.)
 
-	@return 		True, if the trace handler is enabled and outputting trace.
+	@return			True, if the trace handler is enabled and outputting trace.
 					False otherwise.
 
 	Here is an example implementation of a trace handler:
@@ -3671,7 +3606,7 @@
 	/**
 	Set the secondary trace filter to include only the specified UIDs.
 
-	@param aUids	Pointer to array of UIDs.
+	@param aUids    Pointer to array of UIDs.
 	@param aNumUids Number of UID values pointer to by \a aUid.
 
 	@return KErrNone on success.
@@ -3708,7 +3643,7 @@
 	/**
 	Get the contents of the secondary trace filter.
 
-	@param[out] aUids	Pointer to array of UIDs contained in the secondary filter.
+	@param[out] aUids   Pointer to array of UIDs contained in the secondary filter.
 						Ownership of this array is passed to the caller of this
 						function, which is then responsible for deleting it.
 						If filter is empty, \a aUid equals zero.
@@ -3721,7 +3656,7 @@
 
 
 	@pre Call in a thread context.
-	@pre Calling thread must be in a critical section.
+    @pre Calling thread must be in a critical section.
 
 	@publishedPartner
 	@released
@@ -3873,7 +3808,7 @@
 	@param aCategory  A category value from enum BTrace::TCategory.
 					  Only the 8 least significant bits in this value are used;
 					  other bits are ignored.
-	@param aUid 	  A UID to filter on.
+	@param aUid       A UID to filter on.
 
 	@return True if a trace with this specification would be passed by the filters.
 			False if a trace with this specification would be dropped by the filters.
@@ -3951,11 +3886,26 @@
 	/**
 	@internalComponent
 	*/
+	typedef TBool(*TBTrace1)(TUint32);
+
+	/**
+	@internalComponent
+	*/
+	typedef TBool(*TBTrace2)(TUint32,TUint32);
+
+	/**
+	@internalComponent
+	*/
+	typedef TBool(*TBTrace3)(TUint32,TUint32,TUint32);
+
+	/**
+	@internalComponent
+	*/
 	struct SExecExtension
 		{
-		TUint32 iA2;
-		TUint32 iA3;
-		TUint32 iPc;
+		TUint32	iA2;
+		TUint32	iA3;
+		TUint32	iPc;
 		};
 
 	/**
@@ -4024,7 +3974,7 @@
 /**
 @internalComponent
 */
-#define BTRACE_HEADER(aSize,aCategory,aSubCategory) 		\
+#define BTRACE_HEADER(aSize,aCategory,aSubCategory)			\
 	(((aSize)<<BTrace::ESizeIndex*8)							\
 	+((aCategory)<<BTrace::ECategoryIndex*8)					\
 	+((aSubCategory)<<BTrace::ESubCategoryIndex*8))
@@ -4072,8 +4022,8 @@
 @released
 */
 #define BTrace0(aCategory,aSubCategory) \
-	BTrace::Out \
-		(BTRACE_HEADER(4,(aCategory),(aSubCategory)),0,0,0)
+	((BTrace::TBTrace1)BTrace::Out) \
+		(BTRACE_HEADER(4,(aCategory),(aSubCategory)))
 
 /**
 Output a trace record of the specified category.
@@ -4090,8 +4040,8 @@
 @released
 */
 #define BTrace4(aCategory,aSubCategory,a1) \
-	BTrace::Out \
-		(BTRACE_HEADER(8,(aCategory),(aSubCategory)),(TUint32)(a1),0,0)
+	((BTrace::TBTrace2)BTrace::Out) \
+		(BTRACE_HEADER(8,(aCategory),(aSubCategory)),(TUint32)(a1))
 
 /**
 Output a trace record of the specified category.
@@ -4109,8 +4059,8 @@
 @released
 */
 #define BTrace8(aCategory,aSubCategory,a1,a2) \
-	BTrace::Out \
-		(BTRACE_HEADER(12,(aCategory),(aSubCategory)),(TUint32)(a1),(TUint32)(a2),0)
+	((BTrace::TBTrace3)BTrace::Out) \
+		(BTRACE_HEADER(12,(aCategory),(aSubCategory)),(TUint32)(a1),(TUint32)(a2))
 
 /**
 Output a trace record of the specified category.
@@ -4192,8 +4142,8 @@
 @released
 */
 #define BTraceContext0(aCategory,aSubCategory) \
-	BTrace::OutX \
-		(BTRACE_HEADER_C(4,(aCategory),(aSubCategory)),0,0,0)
+	((BTrace::TBTrace1)BTrace::OutX) \
+		(BTRACE_HEADER_C(4,(aCategory),(aSubCategory)))
 
 /**
 Output a trace record of the specified category which also includes a Context ID.
@@ -4210,8 +4160,8 @@
 @released
 */
 #define BTraceContext4(aCategory,aSubCategory,a1) \
-	BTrace::OutX \
-		(BTRACE_HEADER_C(8,(aCategory),(aSubCategory)),(TUint32)(a1),0,0)
+	((BTrace::TBTrace2)BTrace::OutX) \
+		(BTRACE_HEADER_C(8,(aCategory),(aSubCategory)),(TUint32)(a1))
 
 /**
 Output a trace record of the specified category which also includes a Context ID.
@@ -4229,8 +4179,8 @@
 @released
 */
 #define BTraceContext8(aCategory,aSubCategory,a1,a2) \
-	BTrace::OutX \
-		(BTRACE_HEADER_C(12,(aCategory),(aSubCategory)),(TUint32)(a1),(TUint32)(a2),0)
+	((BTrace::TBTrace3)BTrace::OutX) \
+		(BTRACE_HEADER_C(12,(aCategory),(aSubCategory)),(TUint32)(a1),(TUint32)(a2))
 
 /**
 Output a trace record of the specified category which also includes a Context ID.
@@ -4312,8 +4262,8 @@
 @released
 */
 #define BTracePc0(aCategory,aSubCategory) \
-	BTrace::Out \
-		(BTRACE_HEADER_P(4,(aCategory),(aSubCategory)),0,0,0)
+	((BTrace::TBTrace1)BTrace::Out) \
+		(BTRACE_HEADER_P(4,(aCategory),(aSubCategory)))
 
 /**
 Output a trace record of the specified category which also includes a Program Counter value.
@@ -4330,8 +4280,8 @@
 @released
 */
 #define BTracePc4(aCategory,aSubCategory,a1)	\
-	BTrace::Out \
-		(BTRACE_HEADER_P(8,(aCategory),(aSubCategory)),(TUint32)(a1),0,0)
+	((BTrace::TBTrace2)BTrace::Out) \
+		(BTRACE_HEADER_P(8,(aCategory),(aSubCategory)),(TUint32)(a1))
 
 /**
 Output a trace record of the specified category which also includes a Program Counter value.
@@ -4349,8 +4299,8 @@
 @released
 */
 #define BTracePc8(aCategory,aSubCategory,a1,a2) \
-	BTrace::Out \
-		(BTRACE_HEADER_P(12,(aCategory),(aSubCategory)),(TUint32)(a1),(TUint32)(a2),0)
+	((BTrace::TBTrace3)BTrace::Out) \
+		(BTRACE_HEADER_P(12,(aCategory),(aSubCategory)),(TUint32)(a1),(TUint32)(a2))
 
 /**
 Output a trace record of the specified category which also includes a Program Counter value.
@@ -4434,8 +4384,8 @@
 @released
 */
 #define BTraceContextPc0(aCategory,aSubCategory)	\
-	BTrace::OutX \
-		(BTRACE_HEADER_CP(4,(aCategory),(aSubCategory)),0,0,0)
+	((BTrace::TBTrace1)BTrace::OutX) \
+		(BTRACE_HEADER_CP(4,(aCategory),(aSubCategory)))
 
 /**
 Output a trace record of the specified category which also includes
@@ -4452,9 +4402,9 @@
 @publishedPartner
 @released
 */
-#define BTraceContextPc4(aCategory,aSubCategory,a1) \
-	BTrace::OutX \
-		(BTRACE_HEADER_CP(8,(aCategory),(aSubCategory)),(TUint32)(a1),0,0)
+#define BTraceContextPc4(aCategory,aSubCategory,a1)	\
+	((BTrace::TBTrace2)BTrace::OutX) \
+		(BTRACE_HEADER_CP(8,(aCategory),(aSubCategory)),(TUint32)(a1))
 
 /**
 Output a trace record of the specified category which also includes
@@ -4473,8 +4423,8 @@
 @released
 */
 #define BTraceContextPc8(aCategory,aSubCategory,a1,a2) \
-	BTrace::OutX \
-		(BTRACE_HEADER_CP(12,(aCategory),(aSubCategory)),(TUint32)(a1),(TUint32)(a2),0)
+	((BTrace::TBTrace3)BTrace::OutX) \
+		(BTRACE_HEADER_CP(12,(aCategory),(aSubCategory)),(TUint32)(a1),(TUint32)(a2))
 
 /**
 Output a trace record of the specified category which also includes
@@ -4555,15 +4505,15 @@
 @param aCategory	A value from enum BTrace::TCategory,
 @param aSubCategory Sub-category value between 0 and 255.
 					The meaning of this is dependent on the Category.
-@param aUid 		The 32bit quantity which forms the data of this trace record.
+@param aUid			The 32bit quantity which forms the data of this trace record.
 
 @return True if trace is enabled for aCategory and aUid, false otherwise.
 @publishedPartner
 @released
 */
 #define BTraceFiltered4(aCategory,aSubCategory,aUid) \
-	BTrace::OutFiltered \
-		(BTRACE_HEADER(8,(aCategory),(aSubCategory)),(TUint32)(aUid),0,0)
+	((BTrace::TBTrace2)BTrace::OutFiltered) \
+		(BTRACE_HEADER(8,(aCategory),(aSubCategory)),(TUint32)(aUid))
 
 /**
 Output a trace record of the specified category.
@@ -4575,7 +4525,7 @@
 @param aCategory	A value from enum BTrace::TCategory,
 @param aSubCategory Sub-category value between 0 and 255.
 					The meaning of this is dependent on the Category.
-@param aUid 		The first 32bit quantity which forms the data of this trace record.
+@param aUid			The first 32bit quantity which forms the data of this trace record.
 @param a1			The second 32bit quantity which forms the data of this trace record.
 
 @return True if trace is enabled for aCategory and aUid, false otherwise.
@@ -4583,8 +4533,8 @@
 @released
 */
 #define BTraceFiltered8(aCategory,aSubCategory,aUid,a1) \
-	BTrace::OutFiltered \
-		(BTRACE_HEADER(12,(aCategory),(aSubCategory)),(TUint32)(aUid),(TUint32)(a1),0)
+	((BTrace::TBTrace3)BTrace::OutFiltered) \
+		(BTRACE_HEADER(12,(aCategory),(aSubCategory)),(TUint32)(aUid),(TUint32)(a1))
 
 /**
 Output a trace record of the specified category.
@@ -4596,7 +4546,7 @@
 @param aCategory	A value from enum BTrace::TCategory,
 @param aSubCategory Sub-category value between 0 and 255.
 					The meaning of this is dependent on the Category.
-@param aUid 		The first 32bit quantity which forms the data of this trace record.
+@param aUid			The first 32bit quantity which forms the data of this trace record.
 @param a1			The second 32bit quantity which forms the data of this trace record.
 @param a2			The third 32bit quantity which forms the data of this trace record.
 
@@ -4616,7 +4566,7 @@
 @param aCategory	A value from enum BTrace::TCategory,
 @param aSubCategory Sub-category value between 0 and 255.
 					The meaning of this is dependent on the Category.
-@param aUid 		The first 32bit quantity which forms the data of this trace record.
+@param aUid			The first 32bit quantity which forms the data of this trace record.
 @param a1			The second 32bit quantity which forms the data of this trace record.
 @param aData		Address of addition data to add to trace.
 					Must be word aligned, i.e. a multiple of 4.
@@ -4643,7 +4593,7 @@
 @param aCategory	A value from enum BTrace::TCategory,
 @param aSubCategory Sub-category value between 0 and 255.
 					The meaning of this is dependent on the Category.
-@param aUid 		The first 32bit quantity which forms the data of this trace record.
+@param aUid			The first 32bit quantity which forms the data of this trace record.
 @param aData		Address of addition data to add to trace.
 					Must be word aligned, i.e. a multiple of 4.
 @param aDataSize	Number of bytes of additional data.
@@ -4668,15 +4618,15 @@
 @param aCategory	A value from enum BTrace::TCategory,
 @param aSubCategory Sub-category value between 0 and 255.
 					The meaning of this is dependent on the Category.
-@param aUid 		The 32bit quantity which forms the data of this trace record.
+@param aUid			The 32bit quantity which forms the data of this trace record.
 
 @return True if trace is enabled for aCategory and aUid, false otherwise.
 @publishedPartner
 @released
 */
 #define BTraceFilteredContext4(aCategory,aSubCategory,aUid) \
-	BTrace::OutFilteredX \
-		(BTRACE_HEADER_C(8,(aCategory),(aSubCategory)),(TUint32)(aUid),0,0)
+	((BTrace::TBTrace2)BTrace::OutFilteredX) \
+		(BTRACE_HEADER_C(8,(aCategory),(aSubCategory)),(TUint32)(aUid))
 
 /**
 Output a trace record of the specified category which also includes a Context ID.
@@ -4688,7 +4638,7 @@
 @param aCategory	A value from enum BTrace::TCategory,
 @param aSubCategory Sub-category value between 0 and 255.
 					The meaning of this is dependent on the Category.
-@param aUid 		The first 32bit quantity which forms the data of this trace record.
+@param aUid			The first 32bit quantity which forms the data of this trace record.
 @param a1			The second 32bit quantity which forms the data of this trace record.
 
 @return True if trace is enabled for aCategory and aUid, false otherwise.
@@ -4696,8 +4646,8 @@
 @released
 */
 #define BTraceFilteredContext8(aCategory,aSubCategory,aUid,a1) \
-	BTrace::OutFilteredX \
-		(BTRACE_HEADER_C(12,(aCategory),(aSubCategory)),(TUint32)(aUid),(TUint32)(a1),0)
+	((BTrace::TBTrace3)BTrace::OutFilteredX) \
+		(BTRACE_HEADER_C(12,(aCategory),(aSubCategory)),(TUint32)(aUid),(TUint32)(a1))
 
 /**
 Output a trace record of the specified category which also includes a Context ID.
@@ -4709,7 +4659,7 @@
 @param aCategory	A value from enum BTrace::TCategory,
 @param aSubCategory Sub-category value between 0 and 255.
 					The meaning of this is dependent on the Category.
-@param aUid 		The first 32bit quantity which forms the data of this trace record.
+@param aUid			The first 32bit quantity which forms the data of this trace record.
 @param a1			The second 32bit quantity which forms the data of this trace record.
 @param a2			The third 32bit quantity which forms the data of this trace record.
 
@@ -4729,7 +4679,7 @@
 @param aCategory	A value from enum BTrace::TCategory,
 @param aSubCategory Sub-category value between 0 and 255.
 					The meaning of this is dependent on the Category.
-@param aUid 		The first 32bit quantity which forms the data of this trace record.
+@param aUid			The first 32bit quantity which forms the data of this trace record.
 @param a1			The second 32bit quantity which forms the data of this trace record.
 @param aData		Address of addition data to add to trace.
 					Must be word aligned, i.e. a multiple of 4.
@@ -4756,7 +4706,7 @@
 @param aCategory	A value from enum BTrace::TCategory,
 @param aSubCategory Sub-category value between 0 and 255.
 					The meaning of this is dependent on the Category.
-@param aUid 		The first 32bit quantity which forms the data of this trace record.
+@param aUid			The first 32bit quantity which forms the data of this trace record.
 @param aData		Address of addition data to add to trace.
 					Must be word aligned, i.e. a multiple of 4.
 @param aDataSize	Number of bytes of additional data.
@@ -4781,15 +4731,15 @@
 @param aCategory	A value from enum BTrace::TCategory,
 @param aSubCategory Sub-category value between 0 and 255.
 					The meaning of this is dependent on the Category.
-@param aUid 		The 32bit quantity which forms the data of this trace record.
+@param aUid			The 32bit quantity which forms the data of this trace record.
 
 @return True if trace is enabled for aCategory and aUid, false otherwise.
 @publishedPartner
 @released
 */
 #define BTraceFilteredPc4(aCategory,aSubCategory,aUid)	\
-	BTrace::OutFiltered \
-		(BTRACE_HEADER_P(8,(aCategory),(aSubCategory)),(TUint32)(aUid),0,0)
+	((BTrace::TBTrace2)BTrace::OutFiltered) \
+		(BTRACE_HEADER_P(8,(aCategory),(aSubCategory)),(TUint32)(aUid))
 
 /**
 Output a trace record of the specified category which also includes a Program Counter value.
@@ -4801,7 +4751,7 @@
 @param aCategory	A value from enum BTrace::TCategory,
 @param aSubCategory Sub-category value between 0 and 255.
 					The meaning of this is dependent on the Category.
-@param aUid 		The first 32bit quantity which forms the data of this trace record.
+@param aUid			The first 32bit quantity which forms the data of this trace record.
 @param a1			The second 32bit quantity which forms the data of this trace record.
 
 @return True if trace is enabled for aCategory and aUid, false otherwise.
@@ -4809,8 +4759,8 @@
 @released
 */
 #define BTraceFilteredPc8(aCategory,aSubCategory,aUid,a1) \
-	BTrace::OutFiltered \
-		(BTRACE_HEADER_P(12,(aCategory),(aSubCategory)),(TUint32)(aUid),(TUint32)(a1),0)
+	((BTrace::TBTrace3)BTrace::OutFiltered) \
+		(BTRACE_HEADER_P(12,(aCategory),(aSubCategory)),(TUint32)(aUid),(TUint32)(a1))
 
 /**
 Output a trace record of the specified category which also includes a Program Counter value.
@@ -4822,7 +4772,7 @@
 @param aCategory	A value from enum BTrace::TCategory,
 @param aSubCategory Sub-category value between 0 and 255.
 					The meaning of this is dependent on the Category.
-@param aUid 		The first 32bit quantity which forms the data of this trace record.
+@param aUid			The first 32bit quantity which forms the data of this trace record.
 @param a1			The second 32bit quantity which forms the data of this trace record.
 @param a2			The third 32bit quantity which forms the data of this trace record.
 
@@ -4842,7 +4792,7 @@
 @param aCategory	A value from enum BTrace::TCategory,
 @param aSubCategory Sub-category value between 0 and 255.
 					The meaning of this is dependent on the Category.
-@param aUid 		The first 32bit quantity which forms the data of this trace record.
+@param aUid			The first 32bit quantity which forms the data of this trace record.
 @param a1			The second 32bit quantity which forms the data of this trace record.
 @param aData		Address of addition data to add to trace.
 					Must be word aligned, i.e. a multiple of 4.
@@ -4869,7 +4819,7 @@
 @param aCategory	A value from enum BTrace::TCategory,
 @param aSubCategory Sub-category value between 0 and 255.
 					The meaning of this is dependent on the Category.
-@param aUid 		The first 32bit quantity which forms the data of this trace record.
+@param aUid			The first 32bit quantity which forms the data of this trace record.
 @param aData		Address of addition data to add to trace.
 					Must be word aligned, i.e. a multiple of 4.
 @param aDataSize	Number of bytes of additional data.
@@ -4896,15 +4846,15 @@
 @param aCategory	A value from enum BTrace::TCategory,
 @param aSubCategory Sub-category value between 0 and 255.
 					The meaning of this is dependent on the Category.
-@param aUid 		The 32bit quantity which forms the data of this trace record.
+@param aUid			The 32bit quantity which forms the data of this trace record.
 
 @return True if trace is enabled for aCategory and aUid, false otherwise.
 @publishedPartner
 @released
 */
 #define BTraceFilteredContextPc4(aCategory,aSubCategory,aUid)	\
-	BTrace::OutFilteredX \
-		(BTRACE_HEADER_CP(8,(aCategory),(aSubCategory)),(TUint32)(aUid),0,0)
+	((BTrace::TBTrace2)BTrace::OutFilteredX) \
+		(BTRACE_HEADER_CP(8,(aCategory),(aSubCategory)),(TUint32)(aUid))
 
 /**
 Output a trace record of the specified category which also includes
@@ -4917,7 +4867,7 @@
 @param aCategory	A value from enum BTrace::TCategory,
 @param aSubCategory Sub-category value between 0 and 255.
 					The meaning of this is dependent on the Category.
-@param aUid 		The first 32bit quantity which forms the data of this trace record.
+@param aUid			The first 32bit quantity which forms the data of this trace record.
 @param a1			The second 32bit quantity which forms the data of this trace record.
 
 @return True if trace is enabled for aCategory and aUid, false otherwise.
@@ -4925,8 +4875,8 @@
 @released
 */
 #define BTraceFilteredContextPc8(aCategory,aSubCategory,aUid,a1) \
-	BTrace::OutFilteredX \
-		(BTRACE_HEADER_CP(12,(aCategory),(aSubCategory)),(TUint32)(aUid),(TUint32)(a1),0)
+	((BTrace::TBTrace3)BTrace::OutFilteredX) \
+		(BTRACE_HEADER_CP(12,(aCategory),(aSubCategory)),(TUint32)(aUid),(TUint32)(a1))
 
 /**
 Output a trace record of the specified category which also includes
@@ -4939,7 +4889,7 @@
 @param aCategory	A value from enum BTrace::TCategory,
 @param aSubCategory Sub-category value between 0 and 255.
 					The meaning of this is dependent on the Category.
-@param aUid 		The first 32bit quantity which forms the data of this trace record.
+@param aUid			The first 32bit quantity which forms the data of this trace record.
 @param a1			The second 32bit quantity which forms the data of this trace record.
 @param a2			The third 32bit quantity which forms the data of this trace record.
 
@@ -4960,7 +4910,7 @@
 @param aCategory	A value from enum BTrace::TCategory,
 @param aSubCategory Sub-category value between 0 and 255.
 					The meaning of this is dependent on the Category.
-@param aUid 		The first 32bit quantity which forms the data of this trace record.
+@param aUid			The first 32bit quantity which forms the data of this trace record.
 @param a1			The second 32bit quantity which forms the data of this trace record.
 @param aData		Address of addition data to add to trace.
 					Must be word aligned, i.e. a multiple of 4.
@@ -4988,7 +4938,7 @@
 @param aCategory	A value from enum BTrace::TCategory,
 @param aSubCategory Sub-category value between 0 and 255.
 					The meaning of this is dependent on the Category.
-@param aUid 		The first 32bit quantity which forms the data of this trace record.
+@param aUid			The first 32bit quantity which forms the data of this trace record.
 @param aData		Address of addition data to add to trace.
 					Must be word aligned, i.e. a multiple of 4.
 @param aDataSize	Number of bytes of additional data.
--- a/kernel/eka/include/e32cia.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/e32cia.h	Wed Sep 01 12:34:56 2010 +0100
@@ -39,7 +39,6 @@
 #define CSM_Z15PanicStrayEventv " PanicStrayEvent__Fv"
 #define CSM_ZN8CServer210BadMessageERK9RMessage2 " BadMessage__8CServer2RC9RMessage2"
 #define CSM_ZN10RSemaphore4WaitEv " Wait__10RSemaphore"
-#define CSM_ZN10RSemaphore4WaitEi " Wait__10RSemaphorei"
 #define CSM_Z34PanicCObjectConFindIndexOutOfRangev " PanicCObjectConFindIndexOutOfRange__Fv"
 #define CSM_ZN7TRegion5ClearEv " Clear__7TRegion"
 #define CSM_ZN4User5AllocEi " Alloc__4Useri"
@@ -74,7 +73,6 @@
 #define CSM_Z15PanicStrayEventv " __cpp(PanicStrayEvent)"
 #define CSM_ZN8CServer210BadMessageERK9RMessage2 " __cpp(CServer2::BadMessage)"
 #define CSM_ZN10RSemaphore4WaitEv " __cpp(static_cast<void (RSemaphore::*) ()>(&RSemaphore::Wait))"
-#define CSM_ZN10RSemaphore4WaitEi " __cpp(static_cast<TInt (RSemaphore::*) (TInt)>(&RSemaphore::Wait))"
 #define CSM_Z34PanicCObjectConFindIndexOutOfRangev " __cpp(PanicCObjectConFindIndexOutOfRange)"
 #define CSM_ZN7TRegion5ClearEv " __cpp(TRegion::Clear)"
 #define CSM_ZN4User5AllocEi " __cpp(User::Alloc)"
@@ -108,7 +106,6 @@
 #define CSM_Z15PanicStrayEventv " _Z15PanicStrayEventv"
 #define CSM_ZN8CServer210BadMessageERK9RMessage2 " _ZN8CServer210BadMessageERK9RMessage2"
 #define CSM_ZN10RSemaphore4WaitEv " _ZN10RSemaphore4WaitEv"
-#define CSM_ZN10RSemaphore4WaitEi " _ZN10RSemaphore4WaitEi"
 #define CSM_Z34PanicCObjectConFindIndexOutOfRangev " _Z34PanicCObjectConFindIndexOutOfRangev"
 #define CSM_ZN7TRegion5ClearEv " _ZN7TRegion5ClearEv"
 #define CSM_ZN4User5AllocEi " _ZN4User5AllocEi"
--- a/kernel/eka/include/e32cmn.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/e32cmn.h	Wed Sep 01 12:34:56 2010 +0100
@@ -1102,15 +1102,6 @@
 	IMPORT_C TCjkWidth GetCjkWidth() const;
 	IMPORT_C static TBool Compose(TUint& aResult,const TDesC16& aSource);
 	IMPORT_C TBool Decompose(TPtrC16& aResult) const;
-	
-	// surrogate specific ones
-	inline static TBool IsSupplementary(TUint aChar);
-	inline static TBool IsSurrogate(TText16 aInt16);
-	inline static TBool IsHighSurrogate(TText16 aInt16);
-	inline static TBool IsLowSurrogate(TText16 aInt16);
-	inline static TUint JoinSurrogate(TText16 aHighSurrogate, TText16 aLowSurrogate);
-	inline static TText16 GetHighSurrogate(TUint aChar);
-	inline static TText16 GetLowSurrogate(TUint aChar);
 
 protected:
 	inline void SetChar(TUint aChar);
@@ -1971,10 +1962,6 @@
 Structure for compile-time definition of a secure ID
 @internalComponent
 */
-#if defined(__ARMCC__) && __ARMCC_VERSION >= 400000
-#pragma push
-#pragma diag_suppress 430 
-#endif
 class SSecureId
 	{
 public:
@@ -1985,9 +1972,7 @@
 public:
 	TUint32 iId;
 	};
-#if defined(__ARMCC__) && __ARMCC_VERSION >= 400000	
-#pragma pop 	
-#endif
+
 
 	
 	
@@ -1995,10 +1980,6 @@
 Structure for compile-time definition of a vendor ID
 @internalComponent
 */
-#if defined(__ARMCC__) && __ARMCC_VERSION >= 400000
-#pragma push
-#pragma diag_suppress 430 
-#endif
 class SVendorId
 	{
 public:
@@ -2009,9 +1990,7 @@
 public:
 	TUint32 iId;
 	};
-#if defined(__ARMCC__) && __ARMCC_VERSION >= 400000	
-#pragma pop 	
-#endif
+
 
 
 
@@ -2488,7 +2467,6 @@
 	IMPORT_C TInt Open(TInt aArgumentIndex, TOwnerType aType=EOwnerProcess);
 	IMPORT_C void Wait();
 	IMPORT_C TInt Wait(TInt aTimeout);	// timeout in microseconds
-	IMPORT_C TInt Poll();		// acquire the semaphore if possible, but don't block
 	IMPORT_C void Signal();
 	IMPORT_C void Signal(TInt aCount);
 #endif
@@ -2512,8 +2490,6 @@
 	inline RFastLock();
 	IMPORT_C TInt CreateLocal(TOwnerType aType=EOwnerProcess);
 	IMPORT_C void Wait();
-	IMPORT_C TInt Wait(TInt aTimeout);	// timeout in microseconds
-	IMPORT_C TInt Poll();		// acquire the lock if possible, but don't block
 	IMPORT_C void Signal();
 private:
 	TInt iCount;
@@ -2654,130 +2630,135 @@
 class RAllocator : public MAllocator
 	{
 public:
-	/**
-	A set of heap allocation failure flags.
-
-	This enumeration indicates how to simulate heap allocation failure.
-
-	@see RAllocator::__DbgSetAllocFail()
-	*/
-	enum TAllocFail
-		{
-		/**
-		Attempts to allocate from this heap fail at a random rate;
-		however, the interval pattern between failures is the same
-		every time simulation is started.
-		*/
-		ERandom,
-
-		/**
-		Attempts to allocate from this heap fail at a random rate.
-		The interval pattern between failures may be different every
-		time the simulation is started.
-		*/
-		ETrueRandom,
-
-		/**
-		Attempts to allocate from this heap fail at a rate aRate;
-		for example, if aRate is 3, allocation fails at every
-		third attempt.
-		*/
-		EDeterministic,
-
-		/**
-		Cancels simulated heap allocation failure.
-		*/
-		ENone,
-
-		/**
-		An allocation from this heap will fail after the next aRate - 1
-		allocation attempts. For example, if aRate = 1 then the next
-		attempt to allocate from this heap will fail.
-		*/
-		EFailNext,
-
-		/**
-		Cancels simulated heap allocation failure, and sets
-		the nesting level for all allocated cells to zero.
-		*/
-		EReset,
-
-		/**
-		aBurst allocations from this heap fail at a random rate;
-		however, the interval pattern between failures is the same
-		every time the simulation is started.
-		*/
-		EBurstRandom,
-
-		/**
-		aBurst allocations from this heap fail at a random rate.
-		The interval pattern between failures may be different every
-		time the simulation is started.
-		*/
-		EBurstTrueRandom,
-
-		/**
-		aBurst allocations from this heap fail at a rate aRate.
-		For example, if aRate is 10 and aBurst is 2, then 2 allocations
-		will fail at every tenth attempt.
-		*/
-		EBurstDeterministic,
-
-		/**
-		aBurst allocations from this heap will fail after the next aRate - 1
-		allocation attempts have occurred. For example, if aRate = 1 and
-		aBurst = 3 then the next 3 attempts to allocate from this heap will fail.
-		*/
-		EBurstFailNext,
-
-		/**
-		Use this to determine how many times the current debug
-		failure mode has failed so far.
-		@see RAllocator::__DbgCheckFailure()
-		*/
-		ECheckFailure,
-		};
-
-	/**
-	Heap debug checking type flag.
-	*/
-	enum TDbgHeapType
-		{
-		/**
-		The heap is a user heap.
-		*/
-		EUser,
-
-		/**
-		The heap is the Kernel heap.
-		*/
-		EKernel
-		};
-
-	enum TAllocDebugOp
-		{
-		ECount, EMarkStart, EMarkEnd, ECheck, ESetFail, ECopyDebugInfo, ESetBurstFail, EGetFail,
-		EGetSize=48, EGetMaxLength, EGetBase, EAlignInteger, EAlignAddr
-		};
-
+
+
+    /**
+    A set of heap allocation failure flags.
+    
+    This enumeration indicates how to simulate heap allocation failure.
+
+    @see RAllocator::__DbgSetAllocFail()
+    */
+	enum TAllocFail {
+                    /**
+                    Attempts to allocate from this heap fail at a random rate;
+                    however, the interval pattern between failures is the same
+                    every time simulation is started.
+                    */
+	                ERandom,
+	                
+	                
+                  	/**
+                  	Attempts to allocate from this heap fail at a random rate.
+                  	The interval pattern between failures may be different every
+                  	time the simulation is started.
+                  	*/
+	                ETrueRandom,
+	                
+	                
+                    /**
+                    Attempts to allocate from this heap fail at a rate aRate;
+                    for example, if aRate is 3, allocation fails at every
+                    third attempt.
+                    */
+	                EDeterministic,
+
+	                
+	                /**
+	                Cancels simulated heap allocation failure.
+	                */
+	                ENone,
+	                
+	                
+	                /**
+	                An allocation from this heap will fail after the next aRate - 1 
+					allocation attempts. For example, if aRate = 1 then the next 
+					attempt to allocate from this heap will fail.
+	                */
+	                EFailNext,
+	                
+	                /**
+	                Cancels simulated heap allocation failure, and sets
+	                the nesting level for all allocated cells to zero.
+	                */
+	                EReset,
+
+                    /**
+                    aBurst allocations from this heap fail at a random rate;
+                    however, the interval pattern between failures is the same
+                    every time the simulation is started.
+                    */
+	                EBurstRandom,
+	                
+	                
+                  	/**
+                  	aBurst allocations from this heap fail at a random rate.
+                  	The interval pattern between failures may be different every
+                  	time the simulation is started.
+                  	*/
+	                EBurstTrueRandom,
+	                
+	                
+                    /**
+                    aBurst allocations from this heap fail at a rate aRate.
+                    For example, if aRate is 10 and aBurst is 2, then 2 allocations
+					will fail at every tenth attempt.
+                    */
+	                EBurstDeterministic,
+
+	                /**
+	                aBurst allocations from this heap will fail after the next aRate - 1 
+					allocation attempts have occurred. For example, if aRate = 1 and 
+					aBurst = 3 then the next 3 attempts to allocate from this heap will fail.
+	                */
+	                EBurstFailNext,
+
+					/**
+					Use this to determine how many times the current debug 
+					failure mode has failed so far.
+					@see RAllocator::__DbgCheckFailure()
+					*/
+					ECheckFailure,
+	                };
+	                
+	                
+    /**
+    Heap debug checking type flag.
+    */
+	enum TDbgHeapType {
+                      /**
+                      The heap is a user heap.
+                      */
+	                  EUser,
+	                  
+                      /**
+                      The heap is the Kernel heap.
+                      */	                  
+	                  EKernel
+	                  };
+	                  
+	                  
+	enum TAllocDebugOp {ECount, EMarkStart, EMarkEnd, ECheck, ESetFail, ECopyDebugInfo, ESetBurstFail};
+	
+	
 	/**
 	Flags controlling reallocation.
 	*/
-	enum TReAllocMode
-		{
-		/**
-		A reallocation of a cell must not change
-		the start address of the cell.
-		*/
-		ENeverMove=1,
-
-		/**
-		Allows the start address of the cell to change
-		if the cell shrinks in size.
-		*/
-		EAllowMoveOnShrink=2
-		};
-
+	enum TReAllocMode {
+	                  /**
+	                  A reallocation of a cell must not change
+	                  the start address of the cell.
+	                  */
+	                  ENeverMove=1,
+	                  
+	                  /**
+	                  Allows the start address of the cell to change
+	                  if the cell shrinks in size.
+	                  */
+	                  EAllowMoveOnShrink=2
+	                  };
+	                  
+	                  
 	enum TFlags {ESingleThreaded=1, EFixedSize=2, ETraceAllocs=4, EMonitorMemory=8,};
 	struct SCheckInfo {TBool iAll; TInt iCount; const TDesC8* iFileName; TInt iLineNum;};
 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
@@ -2805,37 +2786,26 @@
 	UIMPORT_C TInt __DbgMarkCheck(TBool aCountAll, TInt aCount, const TDesC8& aFileName, TInt aLineNum);
 	inline void __DbgMarkCheck(TBool aCountAll, TInt aCount, const TUint8* aFileName, TInt aLineNum);
 	UIMPORT_C void __DbgSetAllocFail(TAllocFail aType, TInt aRate);
-	UIMPORT_C TAllocFail __DbgGetAllocFail();
 	UIMPORT_C void __DbgSetBurstAllocFail(TAllocFail aType, TUint aRate, TUint aBurst);
 	UIMPORT_C TUint __DbgCheckFailure();
-	UIMPORT_C TInt Size() const;
-	UIMPORT_C TInt MaxLength() const;
-	UIMPORT_C TUint8* Base() const;
-	UIMPORT_C TInt Align(TInt a) const;
-	UIMPORT_C TAny* Align(TAny* a) const;
-
 protected:
 	UIMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
 #ifndef __KERNEL_MODE__
 	IMPORT_C virtual void DoClose();
 #endif
-
 protected:
-	TInt	iAccessCount;		// Value of the allocator's access count (ie. Number of times RAllocator::Open() has been called)
-	TInt	iHandleCount;		// Number of handles in the iHandles array
-	TInt*	iHandles;			// Array of handles to chunks used by the heap implementation
-	TUint32	iFlags;				// Flags describing attributes of the heap; see RAllocator::TFlags
-	TInt	iCellCount;			// Internal debugger use only; use MAllocator::AllocSize() instead
-	TInt	iTotalAllocSize;	// Internal debugger use only; use MAllocator::AllocSize() instead
+	TInt iAccessCount;
+	TInt iHandleCount;
+	TInt* iHandles;
+	TUint32 iFlags;
+	TInt iCellCount;
+	TInt iTotalAllocSize;
 	};
 
+
+
+
 class UserHeap;
-
-// This #define is for tools such as MemSpy that need to work across different versions of
-// Symbian and need to know whether they are working with the new or old heap
-
-#define __SYMBIAN_KERNEL_HYBRID_HEAP__
-
 /**
 @publishedAll
 @released
@@ -2844,20 +2814,127 @@
 
 The default implementation uses an address-ordered first fit type algorithm.
 
-The heap itself is contained in a chunk and may be the only occupant of the
+The heap itself is contained in a chunk and may be the only occupant of the 
 chunk or may share the chunk with the program stack.
 
-The class contains member functions for allocating, adjusting, freeing individual
+The class contains member functions for allocating, adjusting, freeing individual 
 cells and generally managing the heap.
 
-The class is not a handle in the same sense that RChunk is a handle; i.e.
+The class is not a handle in the same sense that RChunk is a handle; i.e. 
 there is no Kernel object which corresponds to the heap.
 */
-
 class RHeap : public RAllocator
 	{
 public:
-
+    /**
+    The structure of a heap cell header for a heap cell on the free list.
+    */
+	struct SCell {
+	             /**
+	             The length of the cell, which includes the length of
+	             this header.
+	             */
+	             TInt len; 
+	             
+	             
+	             /**
+	             A pointer to the next cell in the free list.
+	             */
+	             SCell* next;
+	             };
+
+
+	/**
+    The structure of a heap cell header for an allocated heap cell in a debug build.
+    */             
+	struct SDebugCell {
+	                  /**
+	                  The length of the cell, which includes the length of
+                      this header.
+	                  */
+	                  TInt len;
+	                  
+	                  
+	                  /**
+	                  The nested level.
+	                  */
+	                  TInt nestingLevel;
+	                  
+	                  
+	                  /**
+	                  The cumulative number of allocated cells
+	                  */
+	                  TInt allocCount;
+	                  };
+
+	/**
+    @internalComponent
+    */
+	struct SHeapCellInfo { RHeap* iHeap; TInt iTotalAlloc;	TInt iTotalAllocSize; TInt iTotalFree; TInt iLevelAlloc; SDebugCell* iStranded; };
+
+	/**
+	@internalComponent
+	*/
+	struct _s_align {char c; double d;};
+
+	/** 
+	The default cell alignment.
+	*/
+	enum {ECellAlignment = sizeof(_s_align)-sizeof(double)};
+	
+	/**
+	Size of a free cell header.
+	*/
+	enum {EFreeCellSize = sizeof(SCell)};
+
+
+#ifdef _DEBUG
+    /**
+    Size of an allocated cell header in a debug build.
+    */
+	enum {EAllocCellSize = sizeof(SDebugCell)};
+#else
+    /**
+    Size of an allocated cell header in a release build.
+    */
+	enum {EAllocCellSize = sizeof(SCell*)};
+#endif
+
+
+    /**
+    @internalComponent
+    */
+	enum TDebugOp {EWalk=128};
+	
+	
+    /**
+    @internalComponent
+    */
+	enum TCellType
+		{EGoodAllocatedCell, EGoodFreeCell, EBadAllocatedCellSize, EBadAllocatedCellAddress,
+		EBadFreeCellAddress, EBadFreeCellSize};
+
+		
+    /**
+    @internalComponent
+    */
+	enum TDebugHeapId {EUser=0, EKernel=1};
+    
+    /**
+    @internalComponent
+    */
+    enum TDefaultShrinkRatios {EShrinkRatio1=256, EShrinkRatioDflt=512};
+
+#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
+	/**
+    @internalComponent
+    */
+#else
+private:
+#endif
+    typedef void (*TWalkFunc)(TAny*, TCellType, TAny*, TInt);
+
+public:
 	UIMPORT_C virtual TAny* Alloc(TInt aSize);
 	UIMPORT_C virtual void Free(TAny* aPtr);
 	UIMPORT_C virtual TAny* ReAlloc(TAny* aPtr, TInt aSize, TInt aMode=0);
@@ -2871,120 +2948,72 @@
 	UIMPORT_C virtual TInt DebugFunction(TInt aFunc, TAny* a1=NULL, TAny* a2=NULL);
 protected:
 	UIMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
-	inline RHeap() { }
-
 public:
-
-	/**
-	@internalComponent
-
-	The structure of a heap cell header for an allocated heap cell in a debug build.
-	*/
-	struct SDebugCell
-		{
-		/**
-		The nested level.
-		*/
-		TInt nestingLevel;
-
-		/**
-		The cumulative number of allocated cells
-		*/
-		TInt allocCount;
-		};
-
-	/**
-	@internalComponent
-	*/
-	struct SHeapCellInfo { RHeap* iHeap; TInt iTotalAlloc;	TInt iTotalAllocSize; TInt iTotalFree; TInt iLevelAlloc; SDebugCell* iStranded; };
-
-	/**
-	Size of a free cell header.
-	*/
-	enum { EDebugHdrSize = sizeof(SDebugCell) };
-
-	/**
-	The default cell alignment.
-	*/
-	enum { ECellAlignment = 8 };
-
-	/**
-	Size of a free cell header.
-	*/
-	enum { EFreeCellSize = 4 };
-
-#ifdef _DEBUG
-	/**
-	Size of an allocated cell header in a debug build.
-	*/
-	enum { EAllocCellSize = (4 + EDebugHdrSize) };
-#else
-	/**
-	Size of an allocated cell header in a release build.
-	*/
-	enum { EAllocCellSize = 4 };
-#endif
-
-	/**
-	@internalComponent
-	*/
-	enum TDebugOp { EWalk = 128, EHybridHeap };
-
-	/**
-	@internalComponent
-	*/
-	enum TCellType
-		{
-		EGoodAllocatedCell, EGoodFreeCell, EBadAllocatedCellSize, EBadAllocatedCellAddress,
-		EBadFreeCellAddress, EBadFreeCellSize
-		};
-
-	/**
-	@internalComponent
-	*/
-	enum TDebugHeapId { EUser = 0, EKernel = 1 };
-
-	/**
-	@internalComponent
-	*/
-	enum TDefaultShrinkRatios { EShrinkRatio1 = 256, EShrinkRatioDflt = 512 };
-
-	/**
-	@internalComponent
-	*/
-	typedef void (*TWalkFunc)(TAny*, TCellType, TAny*, TInt);
-
+	UIMPORT_C RHeap(TInt aMaxLength, TInt aAlign=0, TBool aSingleThread=ETrue);
+	UIMPORT_C RHeap(TInt aChunkHandle, TInt aOffset, TInt aMinLength, TInt aMaxLength, TInt aGrowBy, TInt aAlign=0, TBool aSingleThread=EFalse);
+	UIMPORT_C TAny* operator new(TUint aSize, TAny* aBase) __NO_THROW;
+	inline void operator delete(TAny* aPtr, TAny* aBase);
+	inline TUint8* Base() const;
+	inline TInt Size() const;
+	inline TInt MaxLength() const;
+	inline TInt Align(TInt a) const;
+	inline const TAny* Align(const TAny* a) const;
+	inline TBool IsLastCell(const SCell* aCell) const;
+	inline void Lock() const;
+	inline void Unlock() const;
+	inline TInt ChunkHandle() const;
 protected:
-
-	// These variables are present only for downwards binary compatibility.  Most are unused,
-	// but some must be present so that previously inline functions continue to work.  These
-	// old inline functions are now replaced with non inline versions so recompiling existing
-	// code will automatically switch to the new versions and you should no longer access any
-	// of the variables in here.
-	//
-	// These variables should now all be considered private and should NOT be accessed directly!
-	//
-	TInt		iUnused1;		// Present for binary compatibility reasons only
-	TInt		iMaxLength;		// Use RAllocator::MaxLength() to get this information now
-	TInt		iUnused2;		// Present for binary compatibility reasons only
-	TInt		iUnused3;		// Present for binary compatibility reasons only
-	// These next two variables must remain in this order for correct object destruction
-	TInt		iChunkHandle;	// Do not use; consider undocumented
-	RFastLock	iLock;			// Do not use; consider undocumented
-	TUint8*		iBase;			// Use RAllocator::Base() to get this information now
-	TUint8*		iTop;			// Do not use; consider undocumented
-	TInt		iAlign;			// Use RAllocator::Align() to get this information now
-
-	// These variables are temporary to prevent source breaks from req417-52840.  They are deprecated in
-	// favour of non hacky ways of determining this information but are required during the switchover to
-	// this method
-	TAllocFail	iFailType;		// Use RAllocator::__DbgGetAllocFail() to get this information now
-	TInt		iNestingLevel;	// Do not use; consider undocumented
-	TAny*		iTestData;		// Do not use; consider undocumented
+	inline RHeap();
+	void Initialise();
+	SCell* DoAlloc(TInt aSize, SCell*& aLastFree);
+	void DoFree(SCell* pC);
+	TInt TryToGrowHeap(TInt aSize, SCell* aLastFree);
+	inline void FindFollowingFreeCell(SCell* aCell, SCell*& pPrev, SCell*& aNext);
+	TInt TryToGrowCell(SCell* pC, SCell* pP, SCell* pE, TInt aSize);
+	TInt Reduce(SCell* aCell);
+	UIMPORT_C SCell* GetAddress(const TAny* aCell) const;
+	void CheckCell(const SCell* aCell) const;
+	void Walk(TWalkFunc aFunc, TAny* aPtr);
+	static void WalkCheckCell(TAny* aPtr, TCellType aType, TAny* aCell, TInt aLen);
+	TInt DoCountAllocFree(TInt& aFree);
+	TInt DoCheckHeap(SCheckInfo* aInfo);
+	void DoMarkStart();
+	TUint32 DoMarkEnd(TInt aExpected);
+	void DoSetAllocFail(TAllocFail aType, TInt aRate);
+	TBool CheckForSimulatedAllocFail();
+	inline TInt SetBrk(TInt aBrk);
+	inline TAny* ReAllocImpl(TAny* aPtr, TInt aSize, TInt aMode);
+	void DoSetAllocFail(TAllocFail aType, TInt aRate, TUint aBurst);
+protected:
+	TInt iMinLength;
+	TInt iMaxLength;
+	TInt iOffset;
+	TInt iGrowBy;
+	TInt iChunkHandle;
+	RFastLock iLock;
+	TUint8* iBase;
+	TUint8* iTop;
+	TInt iAlign;
+	TInt iMinCell;
+	TInt iPageSize;
+	SCell iFree;
+protected:
+	TInt iNestingLevel;
+	TInt iAllocCount;
+	TAllocFail iFailType;
+	TInt iFailRate;
+	TBool iFailed;
+	TInt iFailAllocCount;
+	TInt iRand;
+	TAny* iTestData;
 
 	friend class UserHeap;
 	};
 
+
+
+
+
 class OnlyCreateWithNull;
 
 /** @internalTechnology */
@@ -3848,12 +3877,12 @@
 @param i4 The fourth TUint8
 @internalComponent
 */
-#define FOUR_TUINT8(i1,i2,i3,i4)		  \
-	(									  \
-		(TUint32)((i1) & 0xFF)			| \
-		(TUint32)((i2) & 0xFF) << 8		| \
-		(TUint32)((i3) & 0xFF) << 16	| \
-		(TUint32)((i4) & 0xFF) << 24	  \
+#define FOUR_TUINT8(i1,i2,i3,i4) \
+	(TUint32)(				\
+		(TUint8)i1 		 | 	\
+		(TUint8)i2 << 8  | 	\
+		(TUint8)i3 << 16 | 	\
+		(TUint8)i4 << 24	\
 	)
 
 
--- a/kernel/eka/include/e32cmn.inl	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/e32cmn.inl	Wed Sep 01 12:34:56 2010 +0100
@@ -51,6 +51,120 @@
 inline void RAllocator::__DbgMarkCheck(TBool aCountAll, TInt aCount, const TUint8* aFileName, TInt aLineNum)
 	{__DbgMarkCheck(aCountAll, aCount, TPtrC8(aFileName), aLineNum);}
 
+// Class RHeap
+inline RHeap::RHeap()
+	{}
+
+/**
+@return The maximum length to which the heap can grow.
+
+@publishedAll
+@released
+*/
+inline TInt RHeap::MaxLength() const
+	{return iMaxLength;}
+
+inline void RHeap::operator delete(TAny*, TAny*) 
+/**
+Called if constructor issued by operator new(TUint aSize, TAny* aBase) throws exception.
+This is dummy as corresponding new operator does not allocate memory.
+*/
+	{}
+
+
+inline TUint8* RHeap::Base() const
+/**
+Gets a pointer to the start of the heap.
+	
+Note that because of the small space overhead incurred by all allocated cells, 
+no cell will have the same address as that returned by this function.
+	
+@return A pointer to the base of the heap.
+*/
+	{return iBase;}
+
+
+
+
+inline TInt RHeap::Size() const
+/**
+Gets the current size of the heap.
+
+This is the total number of bytes committed by the host chunk. 
+It is the requested size rounded up by page size minus the size of RHeap object(116 bytes)
+minus the cell alignment overhead as shown:
+
+Size = (Rounded committed size - Size of RHeap - Cell Alignment Overhead).
+
+The cell alignment overhead varies between release builds and debug builds.
+
+Note that this value is always greater than the total space available across all allocated cells.
+	
+@return The size of the heap.
+
+@see Rheap::Available( )
+*/
+	{return iTop-iBase;}
+
+
+
+
+inline TInt RHeap::Align(TInt a) const
+/**
+@internalComponent
+*/
+	{return _ALIGN_UP(a, iAlign);}
+
+
+
+
+inline const TAny* RHeap::Align(const TAny* a) const
+/**
+@internalComponent
+*/
+	{return (const TAny*)_ALIGN_UP((TLinAddr)a, iAlign);}
+
+
+
+
+inline TBool RHeap::IsLastCell(const SCell* aCell) const
+/**
+@internalComponent
+*/
+	{return (((TUint8*)aCell) + aCell->len) == iTop;}
+
+
+
+
+#ifndef __KERNEL_MODE__
+inline void RHeap::Lock() const
+/**
+@internalComponent
+*/
+	{((RFastLock&)iLock).Wait();}
+
+
+
+
+inline void RHeap::Unlock() const
+/**
+@internalComponent
+*/
+	{((RFastLock&)iLock).Signal();}
+
+
+inline TInt RHeap::ChunkHandle() const
+/**
+@internalComponent
+*/
+	{
+	return iChunkHandle;
+	}
+#endif
+
+
+
+
 // Class TRefByValue
 template <class T>
 inline TRefByValue<T>::TRefByValue(T &aRef)
--- a/kernel/eka/include/e32des16.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/e32des16.h	Wed Sep 01 12:34:56 2010 +0100
@@ -132,15 +132,6 @@
 	IMPORT_C HBufC16 *Alloc() const;
 	IMPORT_C HBufC16 *AllocL() const;
 	IMPORT_C HBufC16 *AllocLC() const;
-
-	// surrogate-aware ones
-	IMPORT_C TInt FindCorruptSurrogate() const;
-	IMPORT_C TInt Locate2(TChar aChar) const;
-	IMPORT_C TInt LocateF2(TChar aChar) const;
-	IMPORT_C TInt LocateReverse2(TChar aChar) const;
-	IMPORT_C TInt LocateReverseF2(TChar aChar) const;
-	IMPORT_C TInt Match2(const TDesC16 &aDes) const;
-
 protected:
 	inline TDesC16() {}
 	inline TDesC16(TInt aType,TInt aLength);
@@ -344,28 +335,6 @@
 	IMPORT_C void AppendFormat(TRefByValue<const TDesC16> aFmt,...);
 	IMPORT_C void AppendFormatList(const TDesC16 &aFmt,VA_LIST aList,TDes16Overflow *aOverflowHandler=NULL);
 	IMPORT_C TPtr8 Collapse();
-	
-	// surrogate-aware ones
-	IMPORT_C void Append2(TChar aChar);
-	IMPORT_C void Fill2(TChar aChar);
-	IMPORT_C void Fill2(TChar aChar, TInt aLength);
-	IMPORT_C void AppendFill2(TChar aChar, TInt aLength);
-	IMPORT_C void Justify2(const TDesC16 &aDes, TInt aWidth, TAlign anAlignment, TChar aFill);
-	IMPORT_C void AppendJustify2(const TDesC16 &aDes, TInt aWidth, TAlign anAlignment, TChar aFill);
-	IMPORT_C void AppendJustify2(const TDesC16 &aDes, TInt aLength, TInt aWidth, TAlign anAlignment, TChar aFill);
-	IMPORT_C void AppendJustify2(const TUint16 *aString, TInt aWidth, TAlign anAlignment, TChar aFill);
-	IMPORT_C void AppendJustify2(const TUint16 *aString, TInt aLength, TInt aWidth, TAlign anAlignment, TChar aFill);
-	IMPORT_C void Fold2();
-	IMPORT_C void Collate2();
-	IMPORT_C void LowerCase2();
-	IMPORT_C void UpperCase2();
-	IMPORT_C void Capitalize2();
-	IMPORT_C void CopyF2(const TDesC16 &aDes);
-	IMPORT_C void CopyC2(const TDesC16 &aDes);
-	IMPORT_C void CopyLC2(const TDesC16 &aDes);
-	IMPORT_C void CopyUC2(const TDesC16 &aDes);
-	IMPORT_C void CopyCP2(const TDesC16 &aDes);
-	
 protected:
 	inline TDes16() {}
 	inline TDes16(TInt aType,TInt aLength,TInt aMaxLength);
--- a/kernel/eka/include/e32keys.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/e32keys.h	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1995-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1995-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"
@@ -101,10 +101,8 @@
 	EModifierPointer3DButton1=0x02000000,/**< 3D pointer device specific modifier (button 1). */
 	EModifierPointer3DButton2=0x04000000,/**< 3D pointer device specific modifier (button 2). */
 	EModifierPointer3DButton3=0x08000000,/**< 3D pointer device specific modifier (button 3). */
-	EModifierAdvancedPointerEvent=0x10000000, /**< TPointerEvent is a TAdvancedPointerEvent.*/	
-	EModifierLongKey = 0x20000000,		/**< Long key press event */
-	EModifierExternalKey = 0x40000000,	/**< Accessory key event.*/
-	EAllModifiers=0xffffffff            /**< A combination of all event modifiers.*/	
+	EModifierAdvancedPointerEvent=0x10000000, /**< TPointerEvent is a TAdvancedPointerEvent.*/
+	EAllModifiers=0x1fffffff            /**< A combination of all event modifiers.*/
 	};
 
 
--- a/kernel/eka/include/e32ktran.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/e32ktran.h	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1995-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1995-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"
@@ -28,68 +28,37 @@
 #include <e32std.h>
 #include <e32keys.h>
 #include <e32base.h>
-
-/**
-Represents a specific combination of modifier
-keys.
-
-The definition will match a given a key combination
-bitfield, if when anded with the mask iMask, it equals
-iValue. Bitfields are made up of bits defined in TEventModifier.
-
-eg. to match Ctrl and Shift and not Fn modifiers
-
-iMask = EModifierShift | EModifierCtrl | EModifierFunc
-iValue = EModifierShift | EModifierCtrl
-*/
+//
 class TMaskedModifiers
 	{
 public:
-	TUint iMask; //!< Mask to be binary anded with some value
-	TUint iValue; //!< Must match the masked bitfield
+	TUint iMask;
+	TUint iValue;
 	};
-
-/**
-Defines different match types to be used
-in TKeyCodePattern
-*/
+//
 enum TPattern
 	{
-	EAnyKey=0x00, ///< match any key
-	EAnyAlphaNumeric, ///< match any alpha or numeric key
-	EAnyAlpha, ///< match any alpha key
-	EAnyAlphaLowerCase, ///< match any lower-case key
-	EAnyAlphaUpperCase, ///< match any upper-case key
-	EAnyDecimalDigit, ///< match any decimal digit
+	EAnyKey=0x00,
+	EAnyAlphaNumeric,
+	EAnyAlpha,
+	EAnyAlphaLowerCase,
+	EAnyAlphaUpperCase,
+	EAnyDecimalDigit,
 	EAnyDigitGivenRadix,
-	EAnyModifierKey, ///< match any modifier key (e.g. alt, fn, ctrl)
-	EMatchKey=0x40, ///< match if equal to keycode value in first field
-	EMatchKeyCaseInsens, ///< like EMatchKey but perform case-insensitive comparison
-	EMatchLeftOrRight ///< match if equal to keycode value or (keycode value + 1)
+	EAnyModifierKey,
+	EMatchKey=0x40,
+	EMatchKeyCaseInsens,
+	EMatchLeftOrRight
 	};
-
-/**
-Defines a keypress using one of the match types defined in TPattern
-and possibly a reference scan code. It is possible to specify generic
-or specific keypresses eg. any decimal digit, or a particular
-key, matched case insensitively.
-
-@see TPattern
-*/
+//
 class TKeyCodePattern
 	{
 public:
-	TUint16 iKeyCode; ///< Reference scancode, used when iPattern is EMatchKey, EMatchKeyCaseInsens, or EMatchLeftOrRight
-	TInt8   iPattern; ///< Comparison, of type TPattern
+	TUint16 iKeyCode;
+	TInt8   iPattern;
 	TInt8   iFiller;
 	};
-
-/**
-A Capture Key is a special key or key combination which should be
-sent to a specific window-group, instead of the currently
-active window. For example a camera application might request that
-camera button events always be sent to it.
-*/
+//
 class TCaptureKey
 	{
 public:
@@ -98,10 +67,7 @@
 	TUint iApp;
 	TUint iHandle;
 	};
-
-/**
-Used by CKeyTranslator to return translation results.
-*/
+//
 class TKeyData
 	{
 public:
@@ -111,12 +77,7 @@
 	TBool iIsCaptureKey;
 	TUint iKeyCode;
 	};
-
-/**
-A set of TCaptureKey objects which is passed to a CKeyTranslator
-when translating key events. This is so it can indicate if a
-translated key event should be treated as a special Capture Key.
-*/
+//
 class CCaptureKeys: public CBase
 	{
 public:
@@ -132,19 +93,11 @@
 	IMPORT_C void ProcessCaptureKeys(TKeyData &aKeyData) const;
 protected:
 	void CheckCaptureKey(const TCaptureKey &aCaptureKey);
+	void removeCaptureKey(TUint index);
 protected:
 	RArray<TCaptureKey> iCKarray;
 	};
-
-/**
-A CKeyTranslator derived object will be created by the window server
-in order to translate key scancode data, contained in a TRawEvent, in to
-generic logical key press, as defined in TKeyCode. Essentially, these
-translations
-
-The translator object will perform the actual lookups using data from
-a platform specific keymap DLL, conventionally named ekdata.dll.
-*/
+//
 class CKeyTranslator: public CBase
 	{
 public:
--- a/kernel/eka/include/e32std.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/e32std.h	Wed Sep 01 12:34:56 2010 +0100
@@ -3143,7 +3143,6 @@
 	IMPORT_C void Lock(TRequestStatus& aStatus,TTimerLockSpec aLock);
 	IMPORT_C void Inactivity(TRequestStatus& aStatus, TTimeIntervalSeconds aSeconds);
 	IMPORT_C void HighRes(TRequestStatus& aStatus,TTimeIntervalMicroSeconds32 anInterval);
-	IMPORT_C void AgainHighRes(TRequestStatus& aStatus,TTimeIntervalMicroSeconds32 anInterval);
 	};
 
 
@@ -3314,8 +3313,6 @@
 	IMPORT_C TInt Open(RMessagePtr2 aMessage,TInt aParam,TOwnerType aType=EOwnerProcess);
 	IMPORT_C TInt Open(TInt aArgumentIndex, TOwnerType aType=EOwnerProcess);
 	IMPORT_C void Wait();
-	IMPORT_C TInt Poll();		// acquire the lock if possible, but don't block
-	IMPORT_C TInt Wait(TInt aTimeout);	// timeout in microseconds
 	IMPORT_C void Signal();
 	IMPORT_C TBool IsHeld();
 	};
@@ -4772,7 +4769,6 @@
     IMPORT_C static void __DbgMarkCheck(TBool aKernel, TBool aCountAll, TInt aCount, const TUint8* aFileName, TInt aLineNum);
     IMPORT_C static TUint32 __DbgMarkEnd(TBool aKernel, TInt aCount);
     IMPORT_C static void __DbgSetAllocFail(TBool aKernel, RAllocator::TAllocFail aFail, TInt aRate);
-    IMPORT_C static RAllocator::TAllocFail __DbgGetAllocFail(TBool aKernel);
     IMPORT_C static void __DbgSetBurstAllocFail(TBool aKernel, RAllocator::TAllocFail aFail, TUint aRate, TUint aBurst);
 	IMPORT_C static TUint __DbgCheckFailure(TBool aKernel);
 	IMPORT_C static void PanicUnexpectedLeave(); /**< @internalComponent */
--- a/kernel/eka/include/e32std.inl	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/e32std.inl	Wed Sep 01 12:34:56 2010 +0100
@@ -155,6 +155,13 @@
 
 
 
+// class RHeap
+inline TInt RHeap::SetBrk(TInt aBrk)
+	{ return ((RChunk*)&iChunkHandle)->Adjust(aBrk); }
+
+
+
+
 // class TChar
 #ifndef __KERNEL_MODE__
 inline void TChar::SetChar(TUint aChar)
@@ -252,102 +259,6 @@
 @return True, if the character is 0; false, otherwise.
 */
 	{return(iChar==0);}
-
-
-
-
-inline TBool TChar::IsSupplementary(TUint aChar)
-/**
-@param aChar The 32-bit code point value of a Unicode character.
-
-@return True, if aChar is supplementary character; false, otherwise.
-*/
-	{
-	return (aChar > 0xFFFF);
-	}
-
-
-
-
-inline TBool TChar::IsSurrogate(TText16 aInt16)
-/**
-@return True, if aText16 is high surrogate or low surrogate; false, otherwise.
-*/
-	{
-	return (aInt16 & 0xF800) == 0xD800;
-	}
-
-
-
-
-inline TBool TChar::IsHighSurrogate(TText16 aInt16)
-/**
-@return True, if aText16 is high surrogate; false, otherwise.
-*/
-	{
-	return (aInt16 & 0xFC00) == 0xD800;
-	}
-
-
-
-
-inline TBool TChar::IsLowSurrogate(TText16 aInt16)
-/**
-@return True, if aText16 is low surrogate; false, otherwise.
-*/
-	{
-	return (aInt16 & 0xFC00) == 0xDC00;
-	}
-
-
-
-
-inline TUint TChar::JoinSurrogate(TText16 aHighSurrogate, TText16 aLowSurrogate)
-/**
-Combine a high surrogate and a low surrogate into a supplementary character.
-
-@return The 32-bit code point value of the generated Unicode supplementary
-        character.
-*/
-	{
-	return ((aHighSurrogate - 0xD7F7) << 10) + aLowSurrogate;
-	}
-
-
-
-
-inline TText16 TChar::GetHighSurrogate(TUint aChar)
-/**
-Retrieve the high surrogate of a supplementary character.
-
-@param aChar The 32-bit code point value of a Unicode character.
-
-@return High surrogate of aChar, if aChar is a supplementary character; 
-        aChar itself, if aChar is not a supplementary character.
-
-@see TChar::GetLowSurrogate
-*/
-	{
-	return STATIC_CAST(TText16, 0xD7C0 + (aChar >> 10));
-	}
-
-
-
-
-inline TText16 TChar::GetLowSurrogate(TUint aChar)
-/**
-Retrieve the low surrogate of a supplementary character.
-
-@param aChar The 32-bit code point value of a Unicode character.
-
-@return Low surrogate of aChar, if aChar is a supplementary character; 
-        zero, if aChar is not a supplementary character.
-
-@see TChar::GetHighSurrogate
-*/
-	{
-	return STATIC_CAST(TText16, 0xDC00 | (aChar & 0x3FF));
-	}
 #endif // _UNICODE
 
 
--- a/kernel/eka/include/e32ver.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/e32ver.h	Wed Sep 01 12:34:56 2010 +0100
@@ -28,7 +28,7 @@
 
 const TInt KE32MajorVersionNumber=2;
 const TInt KE32MinorVersionNumber=0;
-const TInt KE32BuildVersionNumber=3115;
+const TInt KE32BuildVersionNumber=2655;
 
 const TInt KMachineConfigurationMajorVersionNumber=1;
 const TInt KMachineConfigurationMinorVersionNumber=0;
--- a/kernel/eka/include/heap_hybrid.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,365 +0,0 @@
-// Copyright (c) 1994-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:
-// kernel\eka\include\heap_hybrid.h
-// 
-// Uses malloc (aka dlmalloc) written by Doug Lea version 2.8.4
-//
-
-#ifndef __HEAP_HYBRID_H__
-#define __HEAP_HYBRID_H__
-
-#include <e32cmn.h>
-
-#ifdef __WINS__
-#define USE_HYBRID_HEAP 0
-#else
-#define USE_HYBRID_HEAP 1
-#endif
-
-// This stuff is all temporary in order to prevent having to include dla.h from heap_hybrid.h, which causes
-// problems due to its definition of size_t (and possibly other types).  This is unfortunate but we cannot
-// pollute the namespace with these types or it will cause problems with Open C and other POSIX compatibility
-// efforts in Symbian
-
-#define NSMALLBINS        (32U)
-#define NTREEBINS         (32U)
-
-#ifndef MALLOC_ALIGNMENT
-	#define MALLOC_ALIGNMENT ((TUint)8U)
-#endif  /* MALLOC_ALIGNMENT */
-
-#define CHUNK_OVERHEAD      (sizeof(TUint))
-
-typedef unsigned int bindex_t;
-typedef unsigned int binmap_t;
-typedef struct malloc_chunk* mchunkptr;
-typedef struct malloc_segment msegment;
-typedef struct malloc_state* mstate;
-typedef struct malloc_tree_chunk* tbinptr;
-typedef struct malloc_tree_chunk* tchunkptr;
-
-struct malloc_segment {
-  TUint8*        iBase;             /* base address */
-  TUint       iSize;             /* allocated size */
-};
-
-struct malloc_state {
-	binmap_t	 iSmallMap;
-	binmap_t	 iTreeMap;
-	TUint		 iDvSize;
-	TUint		 iTopSize;
-	mchunkptr	iDv;
-	mchunkptr	iTop;
-	TUint		 iTrimCheck;
-	mchunkptr	iSmallBins[(NSMALLBINS+1)*2];
-	tbinptr		iTreeBins[NTREEBINS];
-	msegment	iSeg;
-	};
-
-class RHybridHeap : public RHeap
-	{
-
-public:
-
-	struct HeapInfo
-		{
-	    unsigned iFootprint;
-	    unsigned iMaxSize;
-	    unsigned iAllocBytes;
-	    unsigned iAllocN;
-	    unsigned iFreeBytes;
-	    unsigned iFreeN;
-		};
-
-	struct SHeapCellInfo { RHybridHeap* iHeap; TInt iTotalAlloc;	TInt iTotalAllocSize; TInt iTotalFree; TInt iLevelAlloc; SDebugCell* iStranded; };
-
-
-	/**
-    @internalComponent
-    */
-	enum TAllocatorType
-			{ESlabAllocator, EDougLeaAllocator, EPageAllocator, EFullSlab=0x80, EPartialFullSlab=0x40, EEmptySlab=0x20, ESlabSpare=0x10, ESlabMask=0xf0};
-
-
-	/**
-    @internalComponent
-    */
-	struct SWalkInfo {
-					  /**
-	                  Walk function address shall be called
-	                  */
-		TWalkFunc iFunction;
-
-					  /**
-	                  The first parameter for callback function
-	                  */
-		TAny*        iParam;
-					  /**
-	                  Pointer to RHybridHeap object
-	                  */
-		RHybridHeap* iHeap;
-		};
-
-	/**
-    @internalComponent
-    */
-	struct SConfig {
-					  /**
-	                  Required slab configuration ( bit 0=4, bit 1=8 ..
-	                  bit 13 = 56)
-	                  */
-		TUint32 iSlabBits;
-					  /**
-	                  Delayed slab threshold in bytes (0 = no threshold)
-	                  */
-		TInt   iDelayedSlabThreshold;
-					  /**
-	                  2^n is smallest size allocated in paged allocator (14-31 = 16 Kb --> )
-	                  */
-		TInt   iPagePower;
-
-		};
-
-	/**
-	@internalComponent
-
-	This structure is used by test code for configuring the allocators and obtaining information
-	from them in order to ensure they are behaving as required.  This is internal test specific
-	code and is liable to be changed without warning at any time.  You should under no circumstances
-	be using it!
-	*/
-	struct STestCommand
-		{
-		TInt	iCommand;			// The test related command to be executed
-
-		union
-			{
-			SConfig		iConfig;	// Configuration used by test code only
-			TAny*		iData;		// Extra supporting data for the test command
-			};
-		};
-
-	/**
-	@internalComponent
-
-	Commands used by test code for configuring the allocators and obtaining information them them
-	*/
-	enum TTestCommand { EGetConfig, ESetConfig, EHeapMetaData, ETestData };
-
-	virtual TAny* Alloc(TInt aSize);
-	virtual void Free(TAny* aPtr);
-	virtual TAny* ReAlloc(TAny* aPtr, TInt aSize, TInt aMode=0);
-	virtual TInt AllocLen(const TAny* aCell) const;
-#ifndef __KERNEL_MODE__	
-	virtual TInt Compress();
-	virtual void Reset();
-	virtual TInt AllocSize(TInt& aTotalAllocSize) const;
-	virtual TInt Available(TInt& aBiggestBlock) const;
-#endif	
-	virtual TInt DebugFunction(TInt aFunc, TAny* a1=NULL, TAny* a2=NULL);
-protected:
-	virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
-
-public:
-	TAny* operator new(TUint aSize, TAny* aBase) __NO_THROW;
-	void operator delete(TAny*, TAny*);
-	
-private:
-	TInt DoCountAllocFree(TInt& aFree);
-	TInt DoCheckHeap(SCheckInfo* aInfo);
-	void DoMarkStart();
-	TUint32 DoMarkEnd(TInt aExpected);
-	void DoSetAllocFail(TAllocFail aType, TInt aRate);
-	TBool CheckForSimulatedAllocFail();
-	void DoSetAllocFail(TAllocFail aType, TInt aRate, TUint aBurst);
-	
-	void Lock() const;
-	void Unlock() const;
-	TInt ChunkHandle() const;
-
-	RHybridHeap(TInt aChunkHandle, TInt aOffset, TInt aMinLength, TInt aMaxLength, TInt aGrowBy, TInt aAlign, TBool aSingleThread, TBool aDlOnly, TBool aUseAdjust);	
-	RHybridHeap(TInt aMaxLength, TInt aAlign=0, TBool aSingleThread=ETrue);
-	RHybridHeap();
-	
-	void Init(TInt aBitmapSlab, TInt aPagePower);
-	inline void InitBins(mstate m);
-	inline void InitTop(mstate m, mchunkptr p, TUint psize);
-    void* SysAlloc(mstate m, TUint nb);
-	int SysTrim(mstate m, TUint pad);
-	void* TmallocLarge(mstate m, TUint nb);
-	void* TmallocSmall(mstate m, TUint nb);
-	/*MACROS converted functions*/
-	static inline void UnlinkFirstSmallChunk(mstate M,mchunkptr B,mchunkptr P,bindex_t& I);
-	static inline void InsertSmallChunk(mstate M,mchunkptr P, TUint S);
-	static inline void InsertChunk(mstate M,mchunkptr P,TUint S);
-	static inline void UnlinkLargeChunk(mstate M,tchunkptr X);
-	static inline void UnlinkSmallChunk(mstate M, mchunkptr P,TUint S);
-	static inline void UnlinkChunk(mstate M, mchunkptr P, TUint S);
-	static inline void ComputeTreeIndex(TUint S, bindex_t& I);
-	static inline void InsertLargeChunk(mstate M,tchunkptr X,TUint S);
-	static inline void ReplaceDv(mstate M, mchunkptr P, TUint S);
-	static inline void ComputeBit2idx(binmap_t X,bindex_t& I);
-
-	void DoComputeTreeIndex(TUint S, bindex_t& I);	
-	void DoCheckAnyChunk(mstate m, mchunkptr p);
-	void DoCheckTopChunk(mstate m, mchunkptr p);
-	void DoCheckInuseChunk(mstate m, mchunkptr p);
-	void DoCheckFreeChunk(mstate m, mchunkptr p);
-	void DoCheckMallocedChunk(mstate m, void* mem, TUint s);
-	void DoCheckTree(mstate m, tchunkptr t);
-	void DoCheckTreebin(mstate m, bindex_t i);
-	void DoCheckSmallbin(mstate m, bindex_t i);
-	TInt BinFind(mstate m, mchunkptr x);
-	TUint TraverseAndCheck(mstate m);
-	void DoCheckMallocState(mstate m);	
-	
-	TInt GetInfo(struct HeapInfo* i, SWalkInfo* wi=NULL) const;	
-	void InitDlMalloc(TUint capacity, int locked);
-	void* DlMalloc(TUint);
-	void  DlFree(void*);
-	void* DlRealloc(void*, TUint, TInt);
-	TUint DlInfo(struct HeapInfo* i, SWalkInfo* wi) const;
-	void DoCheckCommittedSize(TInt aNPages, mstate aM);	
-	
-	TAny* ReAllocImpl(TAny* aPtr, TInt aSize, TInt aMode);
-	void Construct(TBool aSingleThread, TBool aDLOnly, TBool aUseAdjust, TInt aAlign);
-#ifndef __KERNEL_MODE__	
-	TInt ConstructLock(TUint32 aMode);
-#endif	
-	static void Walk(SWalkInfo* aInfo, TAny* aBfr, TInt aLth, TCellType aBfrType, TAllocatorType aAlloctorType);
-	static void WalkCheckCell(TAny* aPtr, TCellType aType, TAny* aCell, TInt aLen);
-	void* Map(void* p, TInt sz);
-	void Unmap(void* p,TInt sz);
-
-private:
-	TInt iMinLength;
-	TInt iOffset;				// offset of RHeap object from chunk base
-	TInt iGrowBy;
-	TInt iMinCell;
-	TInt iPageSize;
-
-	// Temporarily commented out and exported from RHeap to prevent source breaks from req417-52840.
-	// This will be moved with another REQ after submission and subsequent fixing of bad code
-	//TInt iNestingLevel;
-	TInt iAllocCount;
-	// Temporarily commented out.  See comment above regarding req417-52840 source breaks
-	//TAllocFail iFailType;
-	TInt iFailRate;
-	TBool iFailed;
-	TInt iFailAllocCount;
-	TInt iRand;
-	// Temporarily commented out.  See comment above regarding req417-52840 source breaks
-	//TAny* iTestData;
-
-	TInt iChunkSize;				
-	TInt iHighWaterMark;
-	TBool iUseAdjust;
-	TBool iDLOnly;
-
-	malloc_state iGlobalMallocState;
-	
-#ifdef __KERNEL_MODE__
-	
-	friend class RHeapK;
-	
-#else
-	
-	friend class UserHeap;
-	friend class HybridHeap;
-	friend class TestHybridHeap;
-	
-private:
-
-	static void TreeRemove(slab* s);
-	static void TreeInsert(slab* s,slab** r);
-
-	enum {EOkBits = (1<<(MAXSLABSIZE>>2))-1};
-	
-	void SlabInit();
-	void SlabConfig(unsigned slabbitmap);
-	void* SlabAllocate(slabset& allocator);
-	void SlabFree(void* p);
-	void* AllocNewSlab(slabset& allocator);
-	void* AllocNewPage(slabset& allocator);
-	void* InitNewSlab(slabset& allocator, slab* s);
-	void FreeSlab(slab* s);
-	void FreePage(page* p);
-	void SlabInfo(struct HeapInfo* i, SWalkInfo* wi) const;
-	static void SlabFullInfo(slab* s, struct HeapInfo* i, SWalkInfo* wi);
-	static void SlabPartialInfo(slab* s, struct HeapInfo* i, SWalkInfo* wi);
-	static void SlabEmptyInfo(slab* s, struct HeapInfo* i, SWalkInfo* wi);
-	static void TreeWalk(slab* const* root, void (*f)(slab*, struct HeapInfo*, SWalkInfo*), struct HeapInfo* i, SWalkInfo* wi);
-
-	static void WalkPartialFullSlab(SWalkInfo* aInfo, slab* aSlab, TCellType aBfrType, TInt aLth);
-	static void WalkFullSlab(SWalkInfo* aInfo, slab* aSlab, TCellType aBfrType, TInt aLth);
-	void DoCheckSlab(slab* aSlab, TAllocatorType aSlabType, TAny* aBfr=NULL);
-	void DoCheckSlabTrees();	
-	void DoCheckSlabTree(slab** aS, TBool aPartialPage);
-	void BuildPartialSlabBitmap(TUint32* aBitmap, slab* aSlab, TAny* aBfr=NULL);
-	
-	static inline unsigned SlabHeaderFree(unsigned h) 
-	{return (h&0x000000ff);}
-	static inline unsigned SlabHeaderPagemap(unsigned h) 
-	{return (h&0x00000f00)>>8;}
-	static inline unsigned SlabHeaderSize(unsigned h) 
-	{return (h&0x0003f000)>>12;}
-	static inline unsigned SlabHeaderUsedm4(unsigned h) 
-	{return (h&0x0ffc0000)>>18;}
-	/***paged allocator code***/
-	void PagedInit(TInt aPagePower);
-	void* PagedAllocate(unsigned size);
-	void PagedFree(void* p);	
-	void* PagedReallocate(void* p, unsigned size, TInt mode);
-	
-	bool PagedEncode(unsigned pos, unsigned npage);
-	unsigned PagedDecode(unsigned pos) const;
-	inline unsigned PagedSize(void* p) const;
-	inline bool PagedSetSize(void* p, unsigned size);
-	inline void PagedZapSize(void* p, unsigned size);
-	inline void* Bitmap2addr(unsigned pos) const;
-	void PagedInfo(struct HeapInfo* i, SWalkInfo* wi) const;
-	void ResetBitmap();
-	TBool CheckBitmap(void* aBfr, TInt aSize, TUint32& aDummy, TInt& aNPages);	
-	
-private:
-	paged_bitmap iPageMap;							// bitmap representing page allocator's pages
-	TUint8*		iMemBase;							// bottom of paged/slab memory (chunk base)
-	TUint8		iBitMapBuffer[MAXSMALLPAGEBITS>>3];	// buffer for initial page bitmap
-	TInt		iSlabThreshold;						// allocations < than this are done by the slab allocator
-	TInt		iPageThreshold;						// 2^n is smallest cell size allocated in paged allocator
-	TInt		iSlabInitThreshold;					// slab allocator will be used after chunk reaches this size
-	TUint32		iSlabConfigBits;					// set of bits that specify which slab sizes to use
-	slab*		iPartialPage;						// partial-use page tree
-	slab*		iFullSlab;							// full slabs list (so we can find them when walking)
-	page*		iSparePage;							// cached, to avoid kernel exec calls for unmapping/remapping
-	TUint8		iSizeMap[(MAXSLABSIZE>>2)+1];		// index of slabset indexes based on size class
-	slabset		iSlabAlloc[MAXSLABSIZE>>2];			// array of pointers to slabsets
-
-#endif // __KERNEL_MODE__	
-};
-
-#define HEAP_ASSERT(x) __ASSERT_DEBUG(x, HEAP_PANIC(ETHeapBadCellAddress))
-
-template <class T> inline T Floor(const T addr, unsigned aln)
-{return T((unsigned(addr))&~(aln-1));}
-template <class T> inline T Ceiling(T addr, unsigned aln)
-{return T((unsigned(addr)+(aln-1))&~(aln-1));}
-template <class T> inline unsigned LowBits(T addr, unsigned aln)
-{return unsigned(addr)&(aln-1);}
-template <class T1, class T2> inline int PtrDiff(const T1* a1, const T2* a2)
-{return reinterpret_cast<const unsigned char*>(a1) - reinterpret_cast<const unsigned char*>(a2);}
-template <class T> inline T Offset(T addr, unsigned ofs)
-{return T(unsigned(addr)+ofs);}
-
-#endif //__HEAP_HYBRID_H__
--- a/kernel/eka/include/k32keys.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/k32keys.h	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1997-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"
@@ -70,12 +70,6 @@
 
 
 /**
-A contiguous range of logical scancodes of type, and ordering, as
-defined in TStdScanCode.
-Once aligned with an array of target keycodes, a pairwise
-association between each scancode and its translation will
-be defined.
-
 @publishedPartner
 @released
 */
@@ -86,9 +80,6 @@
 	};
 
 /**
-An array of SScanCodeBlock scancode ranges. This allows
-a discontiguous set of scancodes to be treated contiguously.
-
 @publishedPartner
 @released
 */
@@ -99,37 +90,27 @@
 	};
 
 /**
-Associates an SScanCodeBlockList with
-a specific set of target keycodes. This defines a concrete
-translation for the scancodes in the scanCodes block list.
-
 @publishedPartner
 @released
 */
 struct SConvSubTable
 	{
-	const TUint16 *pkeyCode; //<! An array of target keycodes
+	const TUint16 *pkeyCode;
 	SScanCodeBlockList scanCodes;
 	};
 
 /**
-Associates a combination of modifier keys with the translation
-table to be used when the combination is active.
-
 @publishedPartner
 @released
 */
 struct SConvTableNode
 	{
-	TMaskedModifiers maskedModifiers;
+   TMaskedModifiers maskedModifiers;
 	TUint numSubTables;
 	const SConvSubTable * const *ppsubTables;
 	};
 
 /**
-The top level collection of all different translation
-tables.
-
 @publishedPartner
 @released
 */
@@ -150,16 +131,6 @@
 	};
 
 /**
-Defines an action to perform when a given key press
-occurs.
-
-@note This struct should not be used in a keymap table.
-It is used within the key translator to represent an
-SFuncAndState for the modifier table (where the state
-member is not meaningful).
-
-@see SFuncAndState
-
 @publishedPartner
 @released
 */
@@ -171,41 +142,28 @@
 	};
 
 /**
-Defines an action to perform and the next state transition
-when a given key press occurs.
-
 @publishedPartner
 @released
 */
 struct SFuncAndState
 	{
-	TUint8 state; ///< The next TState to transition to
-	TUint8 func; ///< A TFuncGeneral action
-	TInt32 funcParam; ///< Parameter for func (key to translate to for EPassSpecialKeyThru)
+	TUint8 state;
+	TUint8 func;
+	TInt32 funcParam;
 	};
 
 /**
-Associates a SFuncAndState, which defines an action, with a
-key press and modifier combination to trigger it.
-
 @publishedPartner
 @released
 */
 struct SFuncTableEntry
 	{
-	TMaskedModifiers maskedModifiers; ///< Required modifier combination
-	TKeyCodePattern keyCodePattern; ///< Required keypress
-	SFuncAndState funcAndNewState; ///< Action or translation
+	TMaskedModifiers maskedModifiers;
+	TKeyCodePattern keyCodePattern;
+	SFuncAndState funcAndNewState;
 	};
 
 /**
-A function table corresponds to a particular keyboard
-mode. When this mode is active this table's entries
-are used to perform actions or translations
-for certain keypresses.
-
-@see SFuncTableEntry
-
 @publishedPartner
 @released
 */
@@ -216,46 +174,18 @@
 	};
 
 /**
-Collection of all keyboard mode function tables
-
 @publishedPartner
 @released
 */
 struct SFuncTables
 	{
-	/**
-	This table is searched for a match if a match has not been
-	found in the current state's table
-	*/
 	SFuncTable defaultTable;
-
-	/**
-	This table controls which keys change which modifiers;
-	the state field in this table is ignored
-	*/
 	SFuncTable modifierTable;
-
-	/**
-	Number of entries in array pgenFuncTables.
-	This must in fact, always be equal to 13.
-	*/
 	TUint numGenFuncTables;
-
-	/**
-	Array of pointers to general state control tables.
-
-	Indicies 1-12 are possible tables, index 0
-	should be unused.
-
-	If a state is not used its SFuncTable array size should be set to
-	zero and the pointer to NULL
-	*/
 	const SFuncTable *pgenFuncTables;
 	};
 
 /**
-Extends TChar with some extra utility functions
-
 @internalComponent
 @released
 */
@@ -272,9 +202,6 @@
 	};
 
 /**
-Responsible for loading and performing lookups
-in a keyboard function table.
-
 @internalComponent
 @released
 */
@@ -303,30 +230,16 @@
 	};
 
 /**
-Used by a keymap to state what method is used to
-enter multi digit control codes for special characters.
-
 @publishedPartner
 @released
 */
 enum TCtrlDigitsTermination
 	{
-	/**
-	Keyboard will stay in code entry mode for a set number
-	of key presses.
-	*/
 	ETerminationByCount,
-
-	/**
-	Keyboard will stay in code entry mode while Ctrl is held
-	down.
-	*/
 	ETerminationByCtrlUp
 	};
 
 /**
-Responsible for loading and walking through a keymap conversion table.
-
 @internalComponent
 @released
 */
@@ -350,9 +263,6 @@
 	};
 
 /**
-Responsible for aggregating a series of digits
-from separate keypresses into a single character.
-
 @internalComponent
 @released
 */
@@ -382,42 +292,15 @@
 	};
 
 /**
-Definitions for keyboard states.
-The first 3 values identify special keyboard states and
-are used as an index to these states' tables. This is
-only a partial list of possible states, states 1-9
-are also valid, and should be used for translating
-isolated characters e.g. to apply diacritics to vowels.
-
-The next 3 do not specify particular states, but give
-information to the key translator so that it can
-decide the next state.
-
 @internalComponent
 @released
 */
 enum TState
 	{
-	/**
-	Normal keyboard state, which defines keys
-	that transition	to the other states.
-	*/
+// values used as an index to a table
 	EStateNormal						=0x0a,
-
-	/**
-	Allow characters to be specified
-	by a decimal code. The state will be transitioned
-	back to EStateNormal after a given count.
-	*/
 	EStateCtrlDigitsUntilCount			=0x0b,
-
-	/**
-	Allow characters to be specified
-	by a decimal code. The state will be transitioned
-	back to EStateNormal once Ctrl is released.
-	*/
 	EStateCtrlDigitsUntilCtrlUp			=0x0c,
-
 // values used as "rules" to be processed in a switch statement
 	EStateUnchanged						=0x40,
 	EStateDerivedFromDigitEntered,
@@ -425,24 +308,19 @@
 	};
 
 /**
-Defines an action to be performed for a keypress.
-@see SFuncAndState::func
-
 @internalComponent
 @released
 */
 enum TFuncGeneral
 	{
 	EDoNothing							=0x00,
-	EPassKeyThru, ///< Pass key through, unchanged
-	EPassSpecialKeyThru, ///< Translate to a new character
-	EPassCtrlDigitsThru, ///< End accumulation of character digits
-	EAddOnCtrlDigit, ///< Allow another control digit to be entered
+	EPassKeyThru,
+	EPassSpecialKeyThru,
+	EPassCtrlDigitsThru,
+	EAddOnCtrlDigit,
 	};
 
 /**
-Concrete implementation of a CKeyTranslator.
-
 @internalComponent
 @released
 */
--- a/kernel/eka/include/k32keys.inl	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/k32keys.inl	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1997-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"
@@ -24,7 +24,7 @@
 */
 inline TBool MatchesMaskedValue(TInt aModifiers,const TMaskedModifiers &aMaskedModifiers)
     {
-    return (aModifiers&aMaskedModifiers.iMask)==aMaskedModifiers.iValue;
+    return (TBool)((aModifiers&aMaskedModifiers.iMask)==aMaskedModifiers.iValue);
     }
 
 /**
--- a/kernel/eka/include/kernel/arm/arm.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/kernel/arm/arm.h	Wed Sep 01 12:34:56 2010 +0100
@@ -228,12 +228,6 @@
 	@publishedPartner
 	@released
 	*/
-	IMPORT_C static void SetIdleHandler(TCpuIdleHandlerFn aHandler, TAny* aPtr);
-
-	/**
-	@publishedPartner
-	@released
-	*/
 	IMPORT_C static TInt DebugOutJTAG(TUint aChar);
 
 	/**
--- a/kernel/eka/include/kernel/cache.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/kernel/cache.h	Wed Sep 01 12:34:56 2010 +0100
@@ -126,40 +126,10 @@
 	On SMP platforms, it only maintains internal cache of the CPU that executes the call.
 	Cache memory common to the all cores (like external cache controllers) are also synchronised.
 	@pre Interrupts must be disabled.
-	@deprecated in TB 10.1 Use Cache::CpuRetires and Cache::KernelRetires
 	*/
 	IMPORT_C static void AtomicSyncMemory();
 
 	/**
-	Synchronises cache(s) of the current CPU with the next memory level (which may also be cache)
-	prior to power off or reboot. Caches in other CPUs and those that are shared among them are not affected.
-
-	Shut down or reboot sequence should ensure that the context of cache memories is copied down to the main
-	memory prior CPU/cache power off. In order to achieve this goal, the following should be obeyed:
-	 - On SMP H/W, any CPU that is about to shut down or reboot should call this method. The very last
-	   running CPU should call both this method and Cache::KernelRetires method.
-	 - On non-SMP H/W. CPU that is about to shut down or reboot should call this method. Call to
-	   Cache::KernelRetires is not required.
-
-	Both Cache::CpuRetires and Cache::KernelRetires assume that Kernel may not be in stable state (as reboot may
-	be caused by crash), so no attampt will be made to acquire spin lock or call any other Kernel interface.
-
-	@see Cache::KernelRetires
-	@pre Interrupts must be disabled.
-	@pre Kernel may not be in stable state.
-	*/
-	IMPORT_C static void CpuRetires();
-
-	/*
-	Synchronises cache(s) that are shared among CPUs with the main memory prior to power off or reboot.
-	@see Cache::CpuRetires
-	@pre Interrupts must be disabled.
-	@pre Kernel may not be in stable state.
-	@pre All CPUs other than the current CPU are powered down or their reboot sequence is completed.
-	*/
-	IMPORT_C static void KernelRetires();
-	
-	/**
 	Synchronises cache(s) prior to a DMA write (memory to HW DMA transfer) operation.
 
 	The purpose of SyncMemoryBeforeDmaWrite is to make sure that the main memory is synchronised 
--- a/kernel/eka/include/kernel/cache_maintenance.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/kernel/cache_maintenance.h	Wed Sep 01 12:34:56 2010 +0100
@@ -301,9 +301,7 @@
 /*
  * Cleans and invalidates the entire content of data and unified cache(s) and drains
  * write buffers (DSB barrier)..
- * On SMP, only the running core is maintained.
- * This methos is called during reboot or power down sequence and therefore is not allowed
- * to do Kernel calls that may hold spin lock - such as Kern::Print or precondition checkings.
+ * On SMP, only the running core is maintained. 
  */
 	static void CleanAndInvalidate_DCache_All();
 
--- a/kernel/eka/include/kernel/cache_maintenance.inl	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/kernel/cache_maintenance.inl	Wed Sep 01 12:34:56 2010 +0100
@@ -71,7 +71,7 @@
 	#endif	// else (__CPU_SUPPORTS_PAGE_TABLE_WALK_TO_L1_CACHE) || !(__CPU_PAGE_TABLES_FULLY_CACHED)
 #if defined (__FLUSH_PT_INTO_RAM__)
 	//See SinglePteUpdated for details.
-	ExternalCache::Clean(aPte, aSize);
+	ExternalCache::Clean(aAddr, aSize);
 #endif // (__FLUSH_PT_INTO_RAM__)
 	}
 
@@ -106,7 +106,7 @@
 	// tables separately (e.g. another processor using the same page tables out
 	// of main memory), and is not necessary on standard platforms.
 	// Either __ARM_L210_CACHE__ or __ARM_L220_CACHE__ must also be defined
-	ExternalCache::Clean(aPte, 4);
+	ExternalCache::Clean(aAddr, 4);
 #endif
 	}
 
--- a/kernel/eka/include/kernel/kern_priv.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/kernel/kern_priv.h	Wed Sep 01 12:34:56 2010 +0100
@@ -35,7 +35,7 @@
 #include <e32const_private.h>
 #include <e32des8_private.h>
 #include <e32event_private.h>
-#include <kernel/heap_hybrid.h>
+
 
 #ifndef __MINIMUM_MACHINE_CODE__
 #ifdef __MARM__
@@ -546,7 +546,6 @@
 	TInt After(TInt aInterval, TTickCallBack aFunction, TRequestStatus& aStatus);
 	TInt At(const TTimeK& aTime, TSecondCallBack aFunction, TRequestStatus& aStatus);
 	TInt AfterHighRes(TInt aInterval, NTimerFn aFunction, TRequestStatus& aStatus);
-	TInt AgainHighRes(TInt aInterval, NTimerFn aFunction, TRequestStatus& aStatus);
 	TInt Inactivity(TInt aSeconds, TInactivityCallBack aFunction, TRequestStatus& aStatus);
 	void Cancel(DThread* aThread);
 	void Abort(DThread* aThread, TInt aTypeMask);
@@ -589,7 +588,6 @@
 	TInt At(TRequestStatus& aStatus, const TTimeK& aTime);
 	TInt Lock(TRequestStatus& aStatus, TTimerLockSpec aLock);
 	void HighRes(TRequestStatus& aStatus, TInt aInterval);
-	void AgainHighRes(TRequestStatus& aStatus, TInt aInterval);
 	TInt Inactivity(TRequestStatus& aStatus, TInt aSeconds);
 	void Abort(TBool aAbortAbsolute);
 	virtual TInt RequestUserHandle(DThread* aThread, TOwnerType aType);
@@ -745,7 +743,7 @@
 	void ChangePendingThreadPriority(DThread* aThread, TInt aNewPriority);
 	void WakeUpNextThread();
 public:
-	TInt Wait(TInt aTimeout=0);	// 0 means wait forever, -1 means poll, n>0 means n nanokernel ticks
+	TInt Wait();
 	void Signal();
 	void Reset();
 public:
@@ -1522,10 +1520,10 @@
 		};
 	enum TMask
 		{
-		EMaskFail = TUint32 (ETypeFail) << KCSPBitsFree, 
-		EMaskCapsOnly = TUint32 (ETypeCapsOnly) << KCSPBitsFree,
-		EMaskSecureId = TUint32 (ETypeSecureId) << KCSPBitsFree,
-		EMaskVendorId = TUint32 (ETypeVendorId) << KCSPBitsFree,
+		EMaskFail = ETypeFail << KCSPBitsFree, 
+		EMaskCapsOnly = ETypeCapsOnly << KCSPBitsFree,
+		EMaskSecureId = ETypeSecureId << KCSPBitsFree,
+		EMaskVendorId = ETypeVendorId << KCSPBitsFree,
 		};
 	TInt Set(const TSecurityPolicy& aPolicy);
 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
@@ -2262,7 +2260,7 @@
 /********************************************
  * Kernel heap
  ********************************************/
-class RHeapK : public RHybridHeap
+class RHeapK : public RHeap
 	{
 public:
 	static RHeapK* FixedHeap(TAny* aBase, TInt aMaxLength);
@@ -2280,18 +2278,37 @@
 	static void CheckThreadState();
 	static void Fault(TInt aFault);
 	inline TBool CheckForSimulatedAllocFail()
-	    { return RHybridHeap::CheckForSimulatedAllocFail(); }	
+		{ return RHeap::CheckForSimulatedAllocFail(); }
 	inline DMutex* Mutex() const; /**< @internalComponent */
 public:
 	friend class Monitor;
 	};
 
+inline void RHeap::Lock() const
+	{
+	DMutex* m = *(DMutex**)&iLock;
+	if (m)
+		Kern::MutexWait(*m);
+	}
+
+inline void RHeap::Unlock() const
+	{
+	DMutex* m = *(DMutex**)&iLock;
+	if (m)
+		Kern::MutexSignal(*m);
+	}
+
 /**
 @internalComponent
 */
 inline DMutex* RHeapK::Mutex() const
 	{ return *(DMutex**)&iLock;	}
 
+inline TInt RHeap::SetBrk(TInt aBrk)
+	{
+	return ((DChunk*)iChunkHandle)->Adjust(aBrk);
+	}
+
 enum TSecureClockStatusFlags 
 	{
 	ESecureClockPresent = 1,		// signals a trusted time source has been found 
--- a/kernel/eka/include/kernel/kerncorestats.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-// Copyright (c) 1994-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:
-// e32\include\kernel\KernCoreStats.h
-// 
-// 
-// WARNING: This file contains some APIs which are internal and are subject
-//          to change without notice. Such APIs should therefore not be used
-//          outside the Kernel and Hardware Services package.
-//
-
-/** @file
-@internalComponent
-@prototype
-*/
-
-#ifndef __KERNCORESTATS_H__
-#define __KERNCORESTATS_H__
-
-#include <kernel/kernel.h>
-
-// Kernel side stats (also used when obtaining stats from Kernel)
-const TInt KStatsCoreNumTimesInIdle		 = 0x0001;
-const TInt KStatsCoreTotalTimeInIdle		 = 0x0002;
-const TInt KStatsTimeCrossIdleAndActive		 = 0x0004;
-const TInt KStatsReadyStateChanges		 = 0x0008;
-const TInt KStatsNumTimeSliceExpire		 = 0x0010;
-const TInt KStatsNumEvents			 = 0x0020;
-
-extern "C" {
-extern  TUint KernCoreStats_EnterIdle(TUint aCore);
-extern  void KernCoreStats_LeaveIdle(TInt aCookie,TUint aCore);
-}
-
-class KernCoreStats
-	{
-
-public:
-
-IMPORT_C static TInt Stats(TAny* aBuffer);
-IMPORT_C static TInt Configure(TUint aStatSelection);
-
-IMPORT_C static TInt Retire(TInt aRetired, TInt aInfoMask=0);
-IMPORT_C static TInt Engage(TInt aEngage);
-
-#ifndef __WINS__
-#ifndef __SMP__
-
-IMPORT_C static TUint EnterIdle();
-IMPORT_C static void LeaveIdle(TUint aCookie);
-
-#endif
-#endif
-
-	static void AddEvent();
-
-	enum {KStatDisabled = 1};  // Thas value is used in place of an structure offset, to indicate the stat is'nt enabled.
-
-private:
-	TInt StatsCopy(TAny* aBuffer);
-	void Construct(TUint aBitField);
-
-	void DoEnterIdle(TUint aCore);
-	void DoLeaveIdle(TUint aCore);
-
-private:
-
-	static KernCoreStats* StatsData;
-	static TSpinLock Lock;	// We use a spinlock here becouse we cant use a FastMutex - as there is
-       				// a good chance a FastMutex will be held when the core goes
-	
-	inline TUint32* Value32(TAny* aBuffer, TUint16 aOffset);
-	inline TUint64* Value64(TAny* aBuffer, TUint16 aOffset);
-private:
-
-
-	// Here stored geometry information about data to be collected internally.
-
-	TUint64* iTotalTimeIdle;	// Pointer to Array of Time spent Idle, per core.
-	TUint64* iLastTimeCore;
-	TUint64* iTimesCIA;		//Pointer to Array of Time spent in permutions of idle.
-	TUint* iNumberIdles;	//Pointer of Array of number of times idle, per core. 
-	TUint iNumEvents;
-	TUint *iLastAddReadyCount;
-	TUint *iLastSubReadyCount;
-	TUint *iLastSlicesCount;
-
-
-	// The stored gemetry of where the colected data will be copied too, in offsets
-	TUint16 iOffsTotalTimeIdle;
-	TUint16 iOffsTimesCIA;
-
-	TUint16 iOffsNumberIdles;
-	TUint16 iOffsNumEvents;
-
-	TUint16 iOffsReadyStateAdd;
-	TUint16 iOffsReadyStateRemove;
-
-	TUint16 iOffsNumTimeSliceExpire;
-	// Idle Tracking Data
-	TUint8 iCoresIdle;
-	TUint8 iPad; // Not used.
-
-	TUint iCoreMask;			// indicates which cores are idle
-	TUint64 iLastTime;			// used for TimesCIA
-friend TUint KernCoreStats_EnterIdle(TUint aCore);
-friend void KernCoreStats_LeaveIdle(TInt aCookie,TUint aCore);
-	};
-
-inline TUint32* KernCoreStats::Value32(TAny* aBuffer, TUint16 aOffset)
-{ return (TUint32*) ((TUint8*) aBuffer + aOffset); };
-
-inline TUint64* KernCoreStats::Value64(TAny* aBuffer, TUint16 aOffset)
-{ return (TUint64*) ((TUint8*) aBuffer + aOffset); };
-
-
-#endif // __KERNCORESTATS_H__
--- a/kernel/eka/include/kernel/kernel.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/kernel/kernel.h	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1994-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1994-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"
@@ -229,6 +229,7 @@
 
 
 const TUint8 KMutexOrdRamDrive			= KMutexOrdGeneral7; /**< @internalComponent */
+const TUint8 KMutexOrdDmaChannel		= 0x70; /**< @internalComponent */
 const TUint8 KMutexOrdShPool			= 0x68; /**< @internalComponent */
 const TUint8 KMutexOrdCodeSegLock		= 0x60; /**< @internalComponent */
 const TUint8 KMutexOrdPubSub2			= 0x5e; /**< @internalComponent */
@@ -2844,12 +2845,6 @@
 	inline virtual TInt DeleteNotify(TThreadMessage* aReq,TUint aOffset,TUint aSize);
 
 	/**
-	Return the lock that should be used to synchronise calculation of the idle/busy state and
-	subsequent calls to #NotifyIdle and #NotifyBusy.
-	*/
-	IMPORT_C NFastMutex* NotificationLock();
-	
-	/**
 	Called by the paging system to read data from the media represented by this device using
 	physical addresses, if the device supports it.
 	
@@ -2899,6 +2894,12 @@
 	inline virtual TInt WritePhysical(TThreadMessage* aReq, TPhysAddr* aPageArray, TUint aPageCount, TUint aOffset, TBool aBackground);
 	
 	/**
+	Return the lock that should be used to synchronise calculation of the idle/busy state and
+	subsequent calls to #NotifyIdle and #NotifyBusy.
+	*/
+	IMPORT_C NFastMutex* NotificationLock();
+	
+	/**
 	Called by the paging device to notify the kernel that the device has just become idle and is not
 	currently processing any requests.
 
--- a/kernel/eka/include/kernel/kpower.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/kernel/kpower.h	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-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"
@@ -15,7 +15,7 @@
 // Public header for power management
 // 
 // WARNING: This file contains some APIs which are internal and are subject
-//          to change without noticed. Such APIs should therefore not be used
+//          to change without notice. Such APIs should therefore not be used
 //          outside the Kernel and Hardware Services package.
 //
 
@@ -27,7 +27,7 @@
 #include <kernel/kernel.h>
 
 /**
-@internalComponent
+@internalTechnology
 */
 #define __PM_ASSERT(aCond) \
 	__ASSERT_DEBUG( (aCond), \
@@ -37,7 +37,7 @@
 		) )
 
 /**
-@internalComponent
+@internalTechnology
 */
 #define __PM_PANIC(aMsg) \
 	(\
@@ -155,21 +155,11 @@
     @see TPowerState
 	*/
 	virtual void PowerDown(TTimeK aWakeupTime) = 0;
-
-	/**
-	Registers resources of interest for Idle with Resource Manager
-
-	Function also provided for power controller to perform other operations if required.
-	*/
-	virtual TInt DoRegisterResourceController()
-		{
-		return KErrNone;
-		}
 	};
 
 #ifndef __X86__
 /**
-@internalComponent
+@internalTechnology
 @prototype 9.5
 */
 class TPowerController
@@ -182,7 +172,7 @@
 #endif
 
 /**
-@internalComponent
+@internalTechnology
 */
 class DBatteryMonitor
 	{
@@ -195,7 +185,7 @@
 	};
 
 /**
-@internalComponent
+@internalTechnology
 */
 class DPowerHal : public DBase
 	{
--- a/kernel/eka/include/memmodel/epoc/flexible/memmodel.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/memmodel/epoc/flexible/memmodel.h	Wed Sep 01 12:34:56 2010 +0100
@@ -30,8 +30,8 @@
 
 #ifdef __SMP__
 // SubScheduler fields for each processor
-#define	i_AliasLinAddr			iSubSchedScratch[0]
-#define	i_AliasPdePtr			iSubSchedScratch[1]
+#define	i_AliasLinAddr			iExtras[0]
+#define	i_AliasPdePtr			iExtras[1]
 #endif
 
 /********************************************
--- a/kernel/eka/include/memmodel/epoc/mmubase/mmubase.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/memmodel/epoc/mmubase/mmubase.h	Wed Sep 01 12:34:56 2010 +0100
@@ -410,7 +410,6 @@
 	TInt ZoneAllocPhysicalRam(TUint* aZoneIdList, TUint aZoneIdCount, TInt aNumPages, TPhysAddr* aPageList);
 	TInt FreePhysicalRam(TPhysAddr aPhysAddr, TInt aSize);
 	TInt FreePhysicalRam(TInt aNumPages, TPhysAddr* aPageList);
-	TInt FreeRamZone(TUint aZoneId, TPhysAddr& aZoneBase, TUint& aZoneBytes);
 	TInt ClaimPhysicalRam(TPhysAddr aPhysAddr, TInt aSize);
 	TInt GetPageTableId(TPhysAddr aPtPhys);
 	void MapRamPage(TLinAddr aAddr, TPhysAddr aPage, TPte aPtePerm);
--- a/kernel/eka/include/memmodel/epoc/multiple/memmodel.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/memmodel/epoc/multiple/memmodel.h	Wed Sep 01 12:34:56 2010 +0100
@@ -24,8 +24,8 @@
 
 #ifdef __SMP__
 // SubScheduler fields for each processor
-#define	i_AliasLinAddr			iSubSchedScratch[0]
-#define	i_AliasPdePtr			iSubSchedScratch[1]
+#define	i_AliasLinAddr			iExtras[0]
+#define	i_AliasPdePtr			iExtras[1]
 #endif
 
 /********************************************
@@ -45,19 +45,6 @@
  * RAM Defrag Page Table Moving Support
  ********************************************/
 
-#ifdef __SMP__
-/**
-@internalComponent
-*/
-#define AliasRemapOld					((TPhysAddr&)TheScheduler.iSchedScratch[1])
-
-/**
-@internalComponent
-*/
-#define AliasRemapNew					((TPhysAddr&)TheScheduler.iSchedScratch[2])
-
-#else
-
 /**
 @internalComponent
 */
@@ -67,7 +54,6 @@
 @internalComponent
 */
 #define AliasRemapNew					((TPhysAddr&)TheScheduler.iExtras[2])
-#endif
 
 /********************************************
  * Thread Control Block
--- a/kernel/eka/include/memmodel/epoc/platform.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/memmodel/epoc/platform.h	Wed Sep 01 12:34:56 2010 +0100
@@ -382,7 +382,6 @@
 	IMPORT_C static TInt ZoneAllocPhysicalRam(TUint* aZoneIdList, TUint aZoneIdCount, TInt aNumPages, TPhysAddr* aPageList);
 	IMPORT_C static TInt FreePhysicalRam(TPhysAddr aPhysAddr, TInt aSize);
 	IMPORT_C static TInt FreePhysicalRam(TInt aNumPages, TPhysAddr* aPageList);
-	IMPORT_C static TInt FreeRamZone(TUint aZoneId);
 	IMPORT_C static TInt ClaimPhysicalRam(TPhysAddr aPhysAddr, TInt aSize);
 	IMPORT_C static TPhysAddr LinearToPhysical(TLinAddr aLinAddr);
 	IMPORT_C static void RomProcessInfo(TProcessCreateInfo& aInfo, const TRomImageHeader& aRomImageHeader);	/**< @internalComponent */
--- a/kernel/eka/include/nkern/nk_cpu.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/nkern/nk_cpu.h	Wed Sep 01 12:34:56 2010 +0100
@@ -669,18 +669,6 @@
 
 #define	__chill()
 
-#ifdef 	__CPU_ARM_HAS_WFE_SEV
-
-extern "C" void __arm_wfe();
-extern "C" void __arm_sev();
-
-#define	__snooze()	__arm_wfe()
-#define	__holler()	__arm_sev()
-#else
-#define	__snooze()
-#define	__holler()
-#endif
-
 #if defined(__SMP__) && !defined(__CPU_ARM_HAS_LDREX_STREX_V6K)
 #error SMP not allowed without v6K
 #endif
@@ -688,8 +676,6 @@
 #error SMP not allowed without thread ID registers
 #endif
 
-#define	__SRATIO_MACHINE_CODED__
-
 #endif	//	end of __CPU_ARM
 
 #if defined(__CPU_X86) && defined(__EPOC32__)
@@ -710,9 +696,6 @@
 #error Unknown x86 compiler
 #endif
 
-#define	__snooze()	__chill()
-#define	__holler()
-
 #if defined(__cplusplus)
 extern "C" {
 #endif
@@ -814,8 +797,8 @@
 
 #define USER_MEMORY_GUARD_SAVE_WORDS			2
 #define USER_MEMORY_DOMAIN						15
-#define	USER_MEMORY_DOMAIN_MASK					(3U << (2*USER_MEMORY_DOMAIN))
-#define	USER_MEMORY_DOMAIN_CLIENT				(1U << (2*USER_MEMORY_DOMAIN))
+#define	USER_MEMORY_DOMAIN_MASK					(3 << (2*USER_MEMORY_DOMAIN))
+#define	USER_MEMORY_DOMAIN_CLIENT				(1 << (2*USER_MEMORY_DOMAIN))
 
 // Save the DACR in the named register
 #define USER_MEMORY_GUARD_SAVE(save)											\
--- a/kernel/eka/include/nkern/nk_priv.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/nkern/nk_priv.h	Wed Sep 01 12:34:56 2010 +0100
@@ -349,10 +349,6 @@
 	// Delayed threads
 	SDblQue iDelayedQ;
 	TDfc iDelayDfc;
-	// KernCoreStats
-	TUint iMadeReadyCounter;	// Number of times threads' where made ready.
-	TUint iMadeUnReadyCounter;	// Number of times threads' where made unready.
-	TUint iTimeSliceExpireCounter;	// Number of times threads' time slice expire, resulting in round robin.
 	};
 
 GLREF_D TScheduler TheScheduler;
@@ -532,21 +528,21 @@
 /**
 @internalComponent
 */
-#define	MASK_NO_FAST_MUTEX			0x1
-#define	MASK_CRITICAL				0x2
-#define	MASK_NO_CRITICAL			0x4
-#define	MASK_KERNEL_LOCKED			0x8
-#define	MASK_KERNEL_UNLOCKED		0x10
-#define	MASK_KERNEL_LOCKED_ONCE		0x20
-#define	MASK_INTERRUPTS_ENABLED		0x40
-#define	MASK_INTERRUPTS_DISABLED	0x80
-#define	MASK_SYSTEM_LOCKED			0x100
-#define	MASK_NOT_ISR				0x400
-#define	MASK_NOT_IDFC				0x800 
-#define	MASK_NOT_THREAD				0x1000
-#define	MASK_NO_CRITICAL_IF_USER	0x2000
-#define	MASK_ALWAYS_FAIL			0x4000
-#define	MASK_NO_RESCHED				0x8000
+#define MASK_NO_FAST_MUTEX 0x1
+#define MASK_CRITICAL 0x2
+#define MASK_NO_CRITICAL 0x4
+#define MASK_KERNEL_LOCKED 0x8
+#define MASK_KERNEL_UNLOCKED 0x10
+#define MASK_KERNEL_LOCKED_ONCE 0x20
+#define MASK_INTERRUPTS_ENABLED 0x40
+#define MASK_INTERRUPTS_DISABLED 0x80
+#define MASK_SYSTEM_LOCKED 0x100
+#define MASK_NOT_ISR 0x400
+#define MASK_NOT_IDFC 0x800 
+#define MASK_NOT_THREAD 0x1000
+#define MASK_NO_CRITICAL_IF_USER 0x2000
+#define MASK_ALWAYS_FAIL 0x4000
+#define	MASK_NO_RESCHED 0x8000
 #define MASK_NO_KILL_OR_SUSPEND	0x10000
 
 #define MASK_THREAD_STANDARD ( MASK_NO_FAST_MUTEX | MASK_KERNEL_UNLOCKED | MASK_INTERRUPTS_ENABLED | MASK_NOT_ISR | MASK_NOT_IDFC )
--- a/kernel/eka/include/nkern/nk_trace.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/nkern/nk_trace.h	Wed Sep 01 12:34:56 2010 +0100
@@ -360,11 +360,6 @@
 */
 #define KPIPE	58 //0x04000000, index 1
 
-/**
-@internalComponent
-*/
-#define KSCHED3	48 //0x00010000, index 1
-
 // RESERVED: Trace bits 192 - 255 are reserved for licensee partners
 
 
@@ -445,15 +440,7 @@
  */
 #define KCRAZYSCHEDDELAY 69 //0x00000020, index 2
 
-/**
-Force page faults on kernel access to paged user-side data in a remote thread.
 
-This is designed to help show up problems with device drivers that are not paging safe.
-
-@internalComponent
-@prototype
-*/
-#define KFORCEKUPAGEFAULTS		70 //0x00000040, index 2
 
 /* Word 3 of debug mask : configures user library behaviour */
 
--- a/kernel/eka/include/nkern/nkern.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/nkern/nkern.h	Wed Sep 01 12:34:56 2010 +0100
@@ -36,7 +36,7 @@
 /** @internalComponent */
 IMPORT_C void NKFault(const char* file, TInt line);
 /** @internalComponent */
-void NKIdle(TUint32 aStage);
+void NKIdle(TInt aStage);
 }
 
 /**
@@ -715,14 +715,13 @@
 	Pointer to a function which is called whenever a CPU goes idle
 
 	@param	aPtr	The iPtr stored in the SCpuIdleHandler structure
-	@param	aStage	Bits 0-7 give a bitmask of CPUs now active, i.e. 0 means all processors now idle
-					Bit 31 set indicates that the current core can now be powered down
-					Bit 30 set indicates that other cores still remain to be retired
-					Bit 29 set indicates that postamble processing is required after waking up
+	@param	aStage	If positive, the number of processors still active
+					If zero, indicates all processors are now idle
+					-1 indicates that postamble processing is required after waking up
 
 	@internalComponent
 */
-typedef void (*TCpuIdleHandlerFn)(TAny* aPtr, TUint32 aStage);
+typedef void (*TCpuIdleHandlerFn)(TAny* aPtr, TInt aStage);
 
 /** Idle handler structure
 
@@ -730,17 +729,6 @@
 */
 struct SCpuIdleHandler
 	{
-	/**
-	Defined flag bits in aStage parameter
-	*/
-	enum
-		{
-		EActiveCpuMask=0xFFu,
-		EPostamble=1u<<29,		// postamble needed
-		EMore=1u<<30,			// more cores still to be retired
-		ERetire=1u<<31,			// this core can now be retired
-		};
-
 	TCpuIdleHandlerFn	iHandler;
 	TAny*				iPtr;
 	volatile TBool		iPostambleRequired;
@@ -826,7 +814,6 @@
 	IMPORT_C static void ThreadRelease(NThread* aThread, TInt aReturnValue, NFastMutex* aMutex);
 	IMPORT_C static void ThreadSetPriority(NThread* aThread, TInt aPriority);
 	IMPORT_C static void ThreadSetPriority(NThread* aThread, TInt aPriority, NFastMutex* aMutex);
-	static void ThreadSetNominalPriority(NThread* aThread, TInt aPriority);
 	IMPORT_C static void ThreadRequestSignal(NThread* aThread);
 	IMPORT_C static void ThreadRequestSignal(NThread* aThread, NFastMutex* aMutex);
 	IMPORT_C static void ThreadRequestSignal(NThread* aThread, TInt aCount);
--- a/kernel/eka/include/nkern/nklib.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/nkern/nklib.h	Wed Sep 01 12:34:56 2010 +0100
@@ -75,47 +75,6 @@
 typedef Int64 TTimeK;
 
 
-/**
-@internalComponent
-*/
-union TUint64HL
-	{
-	TUint64		i64;
-	TUint32		i32[2];
-	};
-
-
-/**
-@internalComponent
-
-Ratio represented = iM*2^iX
-e.g. 1.0 has iM=0x80000000, iX=-31
-*/
-struct SRatio
-	{
-	void Set(TUint32 aInt, TInt aDivisorExp=0);		// set this ratio to aInt/2^aDivisorExp
-	TInt Reciprocal();								// this = 1/this
-	TInt Mult(TUint32& aInt32);						// Multiply aInt32 by this ratio
-//	TInt Mult(TUint64& aInt64);						// Multiply aInt64 by this ratio
-
-	TUint32		iM;		// mantissa, normalised so bit 31=1
-	TInt16		iX;		// -exponent.
-	TUint8		iSpare1;
-	TUint8		iSpare2;
-	};
-
-/**
-@internalComponent
-
-Ratio and inverse ratio
-*/
-struct SRatioInv
-	{
-	void Set(const SRatio* aR);
-
-	SRatio		iR;
-	SRatio		iI;
-	};
 
 
 #if defined(__VC32__) || defined(__CW32__)
@@ -150,12 +109,6 @@
 	{}
 #endif //__PLACEMENT_VEC_NEW_INLINE
 
-/******************************************************************************
- *
- * SIMPLE DOUBLY-LINKED CIRCULAR LIST
- *
- ******************************************************************************/
-
 /**
 	Macro to offset a SDblQueLink pointer back to the base of a class containing it
 	@publishedPartner
@@ -260,7 +213,7 @@
 	
 	@return True, if this is the only link item in the list; false, otherwise.
     */
-	FORCE_INLINE TBool Alone() const
+	inline TBool Alone() const
 		{ return (iNext==iPrev); }
     
     
@@ -410,334 +363,6 @@
 
 
 
-/******************************************************************************
- *
- * ITERABLE DOUBLY-LINKED CIRCULAR LIST
- *
- ******************************************************************************/
-
-/**
-@internalComponent
-
-An object that forms part of an iterable doubly linked list.
-
-SIterDQLink can also be embedded within another object so that that object
-can form part of the doubly linked list.
-
-@see SIterDQ
-*/
-struct SIterDQ;
-struct SIterDQIterator;
-struct SIterDQLink
-	{
-	
-    /**
-    Default constructor; only defined for debug builds.
-    
-    It initialises the link pointers.
-    */
-	FORCE_INLINE SIterDQLink() {iNext=iPrev=0;}
-
-	enum
-		{
-		ENonAddressMask=3u,
-		EIterator=1u,
-		EAnchor=2u,
-		};
-
-	FORCE_INLINE SIterDQLink* Next() const
-		{ return (SIterDQLink*)(iNext & ~ENonAddressMask); }
-
-	FORCE_INLINE SIterDQLink* Prev() const
-		{ return (SIterDQLink*)(iPrev & ~ENonAddressMask); }
-
-	FORCE_INLINE TBool IsObject() const
-		{ return !(iNext & ENonAddressMask); }
-
-	FORCE_INLINE TBool IsIterator() const
-		{ return iNext & EIterator; }
-
-	FORCE_INLINE TBool IsAnchor() const
-		{ return iNext & EAnchor; }
-
-	FORCE_INLINE void SetNext(SIterDQLink* aNext)
-		{ iNext = (iNext & ENonAddressMask) | (TUintPtr(aNext) & ~ENonAddressMask); }
-
-	FORCE_INLINE void SetPrev(SIterDQLink* aPrev)
-		{ iPrev = (iPrev & ENonAddressMask) | (TUintPtr(aPrev) & ~ENonAddressMask); }
-
-    /**
-    Removes this link item from the doubly linked list.
-    
-    @return A pointer to this link item.
-    */
-	FORCE_INLINE SIterDQLink* Deque()
-		{
-		SIterDQLink* next = Next();
-		SIterDQLink* prev = Prev();
-		next->SetPrev(prev);
-		prev->SetNext(next);
-#ifdef _DEBUG
-		SetNext((SIterDQLink*)4);
-		SetPrev((SIterDQLink*)4);
-#endif
-		return this;
-		}
-
-
-    /**
-    Inserts this link item into the list so that it precedes the specified link item.
-    
-    @param aL A pointer to the link item which is to follow this link item.
-    */
-	FORCE_INLINE void InsertBefore(SIterDQLink* aL)
-		{
-		SIterDQLink* prev = aL->Prev();
-		SetNext(aL);
-		SetPrev(prev);
-		prev->SetNext(this);
-		aL->SetPrev(this);
-		}
-	
-		
-	/**
-	Inserts this link item into the list so that it follows the specified link item.
-    
-    @param aL A pointer to the link item which is to precede this link item.
-    */
-	FORCE_INLINE void InsertAfter(SIterDQLink* aL)
-		{
-		SIterDQLink* next = aL->Next();
-		SetPrev(aL);
-		SetNext(next);
-		next->SetPrev(this);
-		aL->SetNext(this);
-		}
-	
-	
-	/**
-	Tests whether this is the only link item in the list.
-	
-	@return True, if this is the only link item in the list; false, otherwise.
-    */
-	FORCE_INLINE TBool Alone() const
-		{ return (iNext==iPrev); }
-    
-private:
-	/**
-	Bits 2-31 = Address of the next link item in the list.
-	Bit 0 = 1 for iterator, 0 for object
-	*/
-	TUintPtr iNext;
-
-	/**
-	Bits 2-31 = Address of the previous link item in the list.
-	Bit 0 = 1 for iterator, 0 for object
-	*/
-	TUintPtr iPrev;
-
-	friend struct SIterDQ;
-	friend struct SIterDQIterator;
-	};
-
-
-
-
-/**
-@internalComponent
-
-Anchor for an iterable circular doubly linked list of SIterDQLink items.
-
-@see SIterDQLink
-*/
-struct SIterDQ
-	{
-	
-	/**
-	Default constructor.
-	*/
-	FORCE_INLINE SIterDQ()
-		{ iA.iNext = iA.iPrev = TUintPtr(&iA)|SIterDQLink::EAnchor; }
-		
-	
-	/**
-	Moves link items from the specified list onto this list, and clears the specified list
-	
-	@param aQ The source linked list. This list must not be empty.
-	*/	
-	inline SIterDQ(SIterDQ* aQ, TInt)		// move entries from aQ onto this queue and clear aQ - aQ must not be empty
-		{ iA.iNext=aQ->iA.iNext; iA.iPrev=aQ->iA.iPrev; First()->SetPrev(&iA); Last()->SetNext(&iA); new (aQ) SIterDQ; }
-		
-		
-	/**
-	Tests whether this doubly linked list is empty.
-	
-	@return True, if the list is empty; false, otherwise.
-	*/
-	FORCE_INLINE TBool IsEmpty() const
-		{ return (iA.iNext &~ SIterDQLink::ENonAddressMask) == TUintPtr(&iA); }
-	
-		
-    /**
-    Gets a pointer to the first item in this doubly linked list.
-    
-    @return A pointer to the first item.
-    */		
-	FORCE_INLINE SIterDQLink* First() const
-		{ return iA.Next(); }
-	
-		
-    /**
-    Gets a pointer to the last item in this doubly linked list.
-    
-    @return A pointer to the last item.
-    */		
-	FORCE_INLINE SIterDQLink* Last() const
-		{ return iA.Prev(); }
-	
-		
-	/**
-	Adds the specified link item onto the end of this doubly linked list.
-	
-	@param aL A pointer to the link item to be added.
-	*/
-	FORCE_INLINE void Add(SIterDQLink* aL)
-		{
-		aL->InsertBefore(&iA);
-		}
-	
-		
-	/**
-	Adds the specified link item onto the front of this doubly linked list.
-	
-	@param aL A pointer to the link item to be added.
-	*/
-	FORCE_INLINE void AddHead(SIterDQLink* aL)
-		{
-		aL->InsertAfter(&iA);
-		}
-	
-		
-	/**
-	Gets the first link item in the linked list.
-	
-	@return The first link item in the list; NULL, if the list is empty.
-	*/
-	inline SIterDQLink* GetFirst()
-		{ if (IsEmpty()) return NULL; else return First()->Deque(); }
-
-
-	/**
-	Gets the last link item in the linked list.
-	
-	@return The last link item in the list; NULL, if the list is empty.
-	*/
-	inline SIterDQLink* GetLast()
-		{ if (IsEmpty()) return NULL; else return Last()->Deque(); }
-
-
-	/**
-	Appends entries from the specified linked list onto this list, and clears
-	the specified link list anchor.
-	
-	@param aQ The source linked list.
-	*/
-	inline void MoveFrom(SIterDQ* aQ)	// append entries from aQ onto this queue and clear aQ
-		{ if (!aQ->IsEmpty())
-			{
-			SIterDQLink* last = Last();		// last current
-			SIterDQLink* fx = aQ->First();	// first extra
-			SIterDQLink* lx = aQ->Last();	// last extra
-			last->SetNext(fx);
-			fx->SetPrev(last);
-			iA.SetPrev(lx);
-			lx->SetNext(&iA);
-			new (aQ) SIterDQ;
-			}
-		}
-
-private:
-    /**
-    The anchor point for the doubly linked list.
-    */
-	SIterDQLink	iA;
-	};
-
-
-#ifdef __VC32__
-#pragma warning( disable : 4127 )	// conditional expression is constant
-#endif
-
-/**
-@internalComponent
-
-Iterator for an iterable circular doubly linked list of SIterDQLink items.
-
-@see SIterDQLink
-@see SIterDQ
-*/
-struct SIterDQIterator : public SIterDQLink
-	{
-
-	/**
-	Default constructor.
-
-	Iterator starts out not attached to any queue
-	*/
-	FORCE_INLINE SIterDQIterator()
-		{ iNext = iPrev = SIterDQLink::EIterator; }
-
-	/**
-	Destructor ensures iterator detached before destruction
-	*/
-	FORCE_INLINE ~SIterDQIterator()
-		{
-#ifdef _DEBUG
-		if (iNext != SIterDQLink::EIterator) { __crash(); }
-#endif
-		}
-
-	/**
-	Detach the iterator if it is currently attached to a queue
-	*/
-	FORCE_INLINE void Detach()
-		{ if (Next()) {Deque(); SetNext(0);} }
-
-	/**
-	Attach the iterator to a queue at the beginning.
-	*/
-	FORCE_INLINE void Attach(SIterDQ* aQ)
-		{
-#ifdef _DEBUG
-		if (iNext != SIterDQLink::EIterator) { __crash(); }
-#endif
-		aQ->AddHead(this);
-		}
-
-	/**
-	Step the iterator over the next object.
-	Return KErrNone if we stepped over an object.
-	Return KErrEof if we reached the end of the list.
-	Return KErrGeneral if we stepped over aMaxSteps other iterators.
-	In first case aObj is set to point to the object stepped over.
-	In other cases aObj is set to NULL.
-	*/
-	TInt Step(SIterDQLink*& aObj, TInt aMaxSteps=0);	// 0 means use default value
-
-	};
-
-#ifdef __VC32__
-#pragma warning( default : 4127 )	// conditional expression is constant
-#endif
-
-
-
-/******************************************************************************
- *
- * ORDERED DOUBLY-LINKED CIRCULAR LIST
- *
- ******************************************************************************/
-
 /**
 @publishedPartner
 @released
@@ -758,6 +383,8 @@
 	};
 
 
+
+
 /**
 @publishedPartner
 @released
@@ -789,11 +416,6 @@
 
 
 
-/******************************************************************************
- *
- * DELTA-ORDERED DOUBLY-LINKED CIRCULAR LIST
- *
- ******************************************************************************/
 
 /**
 @publishedPartner
@@ -917,11 +539,6 @@
 
 
 
-/******************************************************************************
- *
- * O(1) PRIORITY ORDERED LIST
- *
- ******************************************************************************/
 
 /**
 @publishedPartner
--- a/kernel/eka/include/nkernsmp/arm/arm_tmr.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/nkernsmp/arm/arm_tmr.h	Wed Sep 01 12:34:56 2010 +0100
@@ -80,43 +80,5 @@
 	};
 
 
-#ifdef	__CPU_ARM_HAS_GLOBAL_TIMER_BLOCK
-
-// r1p0 and later A9s have an additional Global Timer
-struct ArmGlobalTimer
-	{
-	volatile TUint32	iTimerCountLow;			// 00 Timer counter low word
-	volatile TUint32	iTimerCountHigh;		// 04 Timer counter high word
-	volatile TUint32	iTimerCtrl;				// 08 Timer control register
-	volatile TUint32	iTimerStatus;			// 0C Timer status register
-	volatile TUint32	iComparatorLow;			// 10 Comparator value low word (per-CPU register)
-	volatile TUint32	iComparatorHigh;		// 14 Comparator value high word (per-CPU register)
-	volatile TUint32	iComparatorInc;			// 18 Comparator autoincrement value (per-CPU register)
-	volatile TUint32	i_Spare2[57];			// 1C unused
-	};
-
-__ASSERT_COMPILE(sizeof(ArmGlobalTimer)==0x100);
-
-// Global Timer Control Register Bits
-enum TArmGlobalTimerCtrl
-	{
-	E_ArmGTmrCtrl_TmrEnb		=1u,			// when set, timer counts up
-	E_ArmGTmrCtrl_CmpEnb		=2u,			// when set, comparator matching is enabled (per-CPU)
-	E_ArmGTmrCtrl_IntEn			=4u,			// when set enables comparator match interrupt (per-CPU)
-	E_ArmGTmrCtrl_AutoInc		=8u,			// when set enables comparator auto increment (per-CPU)
-	E_ArmGTmrCtrl_PrescaleShift	=8u,
-	E_ArmGTmrCtrl_PrescaleMask	=0xff00u,		// bits 8-15 = prescale value - divides by (P+1)
-												// input to prescaler is PERIPHCLK (=CPUCLK/2 on NE1, CPUCLK/N in general, N>=2)
-	};
-
-enum TArmGlobalTimerStatus
-	{
-	E_ArmGTmrStatus_Event		=1u				// set when timer count value matches comparator value (per-CPU)
-	};
-
-#endif
-
-
-
 
 #endif	// 	__ARM_TMR_H__
--- a/kernel/eka/include/nkernsmp/arm/entry.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/nkernsmp/arm/entry.h	Wed Sep 01 12:34:56 2010 +0100
@@ -40,7 +40,6 @@
 #endif
 
 extern void handle_crash_ipi();
-extern void handle_indirect_powerdown_ipi();
 
 #ifdef _DEBUG
 extern void __DebugMsgIrq(TUint aIrqNumber);
@@ -125,22 +124,22 @@
 	asm("mov	r5, sp ");
 	asm("str	r1, [sp, #%a0]" : : "i" _FOFF(SThreadExcStack,iExcCode));	// word describing exception type
 	__ASM_STI2_MODE(MODE_SYS);			// mode_sys, IRQs off, FIQs on
-	asm("ldr	sp, [r4, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iIrqStackTop));
+	asm("ldr	sp, [r4, #%a0]" : : "i" _FOFF(TSubScheduler, i_IrqStackTop));
 	USER_MEMORY_GUARD_ON(,r8,r0);		// r8 = original DACR if user memory guards in use
 
 	asm("nested_irq_rejoin: ");
-	asm("ldr	r0, [r4, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iIrqCount));
-	asm("ldr	r7, [r4, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iIrqNestCount));
+	asm("ldr	r0, [r4, #%a0]" : : "i" _FOFF(TSubScheduler, i_IrqCount));
+	asm("ldr	r7, [r4, #%a0]" : : "i" _FOFF(TSubScheduler, i_IrqNestCount));
 	asm("ldr	r12, __ArmInterrupt ");
 	asm("ldr	r10, _ArmVectorIrq ");
 	asm("add	r0, r0, #1 ");
 	asm("add	r7, r7, #1 ");
 	__DATA_MEMORY_BARRIER_Z__(r2);		// ensure memory accesses in interrupted code are observed before
 										// the writes to i_IrqCount, i_IrqNestCount
-	asm("str	r0, [r4, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iIrqCount));		// increment i_IrqCount
-	asm("ldr	r11, [r12,#%a0]" : : "i" _FOFF(SArmInterruptInfo,iIrqHandler));		// address if IRQ handler
-	asm("ldr	r6, [r4, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iGicCpuIfcAddr));
-	asm("str	r7, [r4, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iIrqNestCount));	// increment i_IrqNestCount
+	asm("str	r0, [r4, #%a0]" : : "i" _FOFF(TSubScheduler, i_IrqCount));		// increment i_IrqCount
+	asm("ldr	r11, [r12,#%a0]" : : "i" _FOFF(SArmInterruptInfo,iIrqHandler));	// address of IRQ handler
+	asm("ldr	r6, [r4, #%a0]" : : "i" _FOFF(TSubScheduler, i_GicCpuIfcAddr));
+	asm("str	r7, [r4, #%a0]" : : "i" _FOFF(TSubScheduler, i_IrqNestCount));	// increment i_IrqNestCount
 
 	asm("1: ");
 #ifdef BTRACE_CPU_USAGE
@@ -188,8 +187,6 @@
 	asm("beq	do_generic_ipi ");
 	asm("cmp	r2, #%a0" : : "i" ((TInt)TRANSFERRED_IRQ_VECTOR));
 	asm("beq	do_transferred_ipi ");
-	asm("cmp	r2, #%a0" : : "i" ((TInt)INDIRECT_POWERDOWN_IPI_VECTOR));
-	asm("beq	do_indirect_powerdown_ipi ");
 	asm("cmp	r2, #15 ");
 	__JUMP(hi,	r11);					// if >15 but not TIMESLICE_VECTOR, call dispatcher
 
@@ -201,7 +198,7 @@
 
 	// TIMESLICE, RESCHED or TRANSFERRED
 	asm("do_timeslice_irq: ");
-	asm("ldr	r2, [r4, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iLocalTimerAddr));
+	asm("ldr	r2, [r4, #%a0]" : : "i" _FOFF(TSubScheduler, i_LocalTimerAddr));
 	asm("mov	r1, #1 ");
 	asm("str	r1, [r2, #%a0]" : : "i" _FOFF(ArmLocalTimer, iTimerIntStatus));	// clear timer event flag
 	asm("do_resched_ipi: ");
@@ -214,16 +211,6 @@
 	ARM_SEV;							// kick any CPUs waiting for us to enter the ISR
 	asm("b		1b ");
 
-	asm("do_indirect_powerdown_ipi: ");
-	asm("str	r0, [r6, #%a0]" : : "i" _FOFF(GicCpuIfc, iEoi));		// acknowledge interrupt
-	__DATA_SYNC_BARRIER_Z__(r1);		// ensure writes to i_IrqCount, i_IrqNestCount, iRescheduleNeededFlag complete before SEV
-										// also ensure EOI is written before we return from the interrupt
-	ARM_SEV;							// kick any CPUs waiting for us to enter the ISR
-	asm("stmfd	sp!, {r0-r3,r12,lr} ");
-	asm("bl		call_ipd_handler ");
-	asm("ldmfd	sp!, {r0-r3,r12,lr} ");
-	asm("b		1b ");
-
 	// GENERIC_IPI
 	asm("do_generic_ipi: ");
 	asm("ldr	r2, _GenericIPIIsr ");
@@ -235,9 +222,6 @@
 	asm("__DebugMsg_longjump_Irq: ");
 	asm("ldr	pc, _dmIrq ");
 
-	asm("call_ipd_handler: ");
-	asm("ldr	pc, __handle_ipd_ipi ");
-
 	asm("__reset_vector:");
 	asm(".word	__ArmVectorReset "); 
 	asm("__undef_vector:");
@@ -271,8 +255,6 @@
 #endif
 	asm("_dmIrq: ");
 	asm(".word __DebugMsgIrq ");
-	asm("__handle_ipd_ipi: ");
-	asm(".word handle_indirect_powerdown_ipi ");
 	}
 }
 
--- a/kernel/eka/include/nkernsmp/arm/ncern.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/nkernsmp/arm/ncern.h	Wed Sep 01 12:34:56 2010 +0100
@@ -75,45 +75,20 @@
 	TLinAddr	iInitR13Und;		// initial value for R13_und
 	};
 
-typedef void (*TDetachComplete)(void);
+
+/** Timer frequency specification
 
-struct SPerCpuUncached
-	{
-	volatile TUint32	iDetachCount;		// Number of times core has detached from SMP cluster
-	volatile TUint32	iAttachCount;		// Number of times core has reattached to SMP cluster
-	volatile TBool		iPowerOffReq;		// TRUE if core needs to be powered off
-	volatile TBool		iPowerOnReq;		// TRUE if core needs to be powered on
-	TDetachComplete		iDetachCompleteFn;	// idle handler jumps to this to request power down if necessary
-											// after cleaning and disabling caches, detaching from SMP cluster
-											// and saving state required to bring the core back up again
-	volatile TUint32	iDetachCompleteCpus;
-	};
+Stores a frequency as a fraction of a (separately stored) maximum.
+The frequency must be at least 1/256 of the maximum.
 
-union UPerCpuUncached
-	{
-	SPerCpuUncached		iU;
-	volatile TUint64	i__Dummy[8];
-	};
-
-__ASSERT_COMPILE(sizeof(SPerCpuUncached) <= 8*sizeof(TUint64));
-
-/** Function to power up a CPU
-@publishedPartner
+@internalTechnology
 @prototype
 */
-typedef void (*TCpuPowerUpFn)(TInt aCpu, SPerCpuUncached* aU);
-
-/** Function to power down a CPU
-@publishedPartner
-@prototype
-*/
-typedef void (*TCpuPowerDownFn)(TInt aCpu, SPerCpuUncached* aU);
-
-/** Function to notify changes to system clock frequencies
-@publishedPartner
-@prototype
-*/
-typedef TInt (*TFrequencyChangeFn)();
+struct STimerMult
+	{
+	TUint32		iFreq;						// frequency as a fraction of maximum possible, multiplied by 2^32
+	TUint32		iInverse;					// 2^24/(iFreq/2^32) = 2^56/iFreq
+	};
 
 /** Variant interface block
 @internalTechnology
@@ -129,14 +104,8 @@
 	TLinAddr	iGicDistAddr;				// address of GIC Distributor
 	TLinAddr	iGicCpuIfcAddr;				// address of GIC CPU interface (must be same for all CPUs)
 	TLinAddr	iLocalTimerAddr;			// address of per-CPU timer (must be same for all CPUs)
-	TLinAddr	iGlobalTimerAddr;			// address of global timer if it exists
-	SRatio*		iTimerFreqR[KMaxCpus];		// timer[i] frequency as a fraction of iMaxTimerClock
-	SRatio*		iCpuFreqR[KMaxCpus];		// CPU[i] frequency as a fraction of iMaxCpuClock
-	UPerCpuUncached*		iUncached[KMaxCpus];	// Pointer to uncached memory for each CPU
-	TCpuPowerUpFn			iCpuPowerUpFn;			// function used to power up a retired CPU (NULL if core control not supported)
-	TCpuPowerDownFn			iCpuPowerDownFn;		// function used to power down a CPU (NULL if power down done within idle handler itself)
-	SRatio*		iGTimerFreqR;				// global timer frequency as a fraction of iMaxTimerClock
-	TFrequencyChangeFn		iFrqChgFn;		// function to notify frequency changes
+	volatile STimerMult* iTimerMult[KMaxCpus];	// timer[i] frequency / iMaxTimerClock * 2^32
+	volatile TUint32* iCpuMult[KMaxCpus];	// CPU[i] frequency / iMaxCpuClock * 2^32
 	};
 
 // End of file
--- a/kernel/eka/include/nkernsmp/arm/nk_plat.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/nkernsmp/arm/nk_plat.h	Wed Sep 01 12:34:56 2010 +0100
@@ -37,72 +37,41 @@
 #define __FAST_MUTEX_MACHINE_CODED__
 #define __NTHREAD_WAITSTATE_MACHINE_CODED__
 
-class TSubScheduler;
-class TScheduler;
-struct SFullArmRegSet;
-struct ArmScu;
-struct GicDistributor;
-struct GicCpuIfc;
-struct ArmLocalTimer;
-struct ArmGlobalTimer;
+// TSubScheduler member data
+#define	i_ScuAddr			iExtras[4]		// Address of SCU (also in TScheduler)
+#define	i_GicDistAddr		iExtras[5]		// Address of GIC Distributor (also in TScheduler)
+#define	i_GicCpuIfcAddr		iExtras[6]		// Address of GIC CPU Interface (also in TScheduler)
+#define	i_LocalTimerAddr	iExtras[7]		// Address of local timer registers (also in TScheduler)
+#define	i_IrqCount			iExtras[8]		// count of interrupts handled
+#define	i_IrqNestCount		iExtras[9]		// IRQ nest count for this CPU (starts at -1)
+#define	i_ExcInfo			iExtras[10]		// pointer to exception info for crash debugger
+#define	i_CrashState		iExtras[11]		// 0=normal, 1=this CPU faulted, 2=this CPU has received an NMI and halted
+#define	i_AbtStackTop		iExtras[12]		// Top of ABT stack for this CPU, also used to point to SFullArmRegSet
+#define	i_UndStackTop		iExtras[13]		// Top of UND stack for this CPU
+#define	i_FiqStackTop		iExtras[14]		// Top of FIQ stack for this CPU
+#define	i_IrqStackTop		iExtras[15]		// Top of IRQ stack for this CPU
+#define	i_TimerMultF		iExtras[16]		// Timer frequency / Max Timer frequency * 2^32
+#define	i_TimerMultI		iExtras[17]		// Max Timer frequency / Timer frequency * 2^24
+#define	i_CpuMult			iExtras[18]		// CPU frequency / Max CPU frequency * 2^32
+#define	i_LastTimerSet		iExtras[20]		// Value last written to local timer counter
+#define	i_TimestampError	iExtras[21]		// Current error in the timestamp
+#define	i_MaxCorrection		iExtras[22]		// Maximum correction to timestamp in one go
+#define	i_TimerGap			iExtras[23]		// Timestamp ticks taken to read and write local timer counter
 
-// TSubScheduler member data
-struct TSubSchedulerX
-	{
-	TUint32				iSSXP[3];
-	ArmGlobalTimer*		iGlobalTimerAddr;		// Address of global timer registers (also in TScheduler)
-	ArmScu*				iScuAddr;				// Address of SCU (also in TScheduler)
-	GicDistributor*		iGicDistAddr;			// Address of GIC Distributor (also in TScheduler)
-	GicCpuIfc*			iGicCpuIfcAddr;			// Address of GIC CPU Interface (also in TScheduler)
-	ArmLocalTimer*		iLocalTimerAddr;		// Address of local timer registers (also in TScheduler)
-	volatile TUint32	iIrqCount;				// count of interrupts handled
-	volatile TInt		iIrqNestCount;			// IRQ nest count for this CPU (starts at -1)
-	TAny*				iExcInfo;				// pointer to exception info for crash debugger
-	volatile TInt		iCrashState;			// 0=normal, 1=this CPU faulted, 2=this CPU has received an NMI and halted
-	union {
-		TLinAddr		iAbtStackTop;			// Top of ABT stack for this CPU, also used to point to SFullArmRegSet
-		SFullArmRegSet* iRegs;
-		};
-	TLinAddr			iUndStackTop;			// Top of UND stack for this CPU
-	TLinAddr			iFiqStackTop;			// Top of FIQ stack for this CPU
-	TLinAddr			iIrqStackTop;			// Top of IRQ stack for this CPU
-	SRatioInv* volatile	iNewCpuFreqRI;			// set when CPU frequency has been changed
-	SRatioInv* volatile	iNewTimerFreqRI;		// set when CPU local timer frequency has been changed
-	SRatioInv			iCpuFreqRI;				// Ratio of CPU frequency to maximum possible CPU frequency
-	SRatioInv			iTimerFreqRI;			// Ratio of CPU local timer frequency to maximum possible
-
-	TUint32				iSSXP2[36];
-	TUint64				iSSXP3;					// one 64 bit value to guarantee alignment
-	};
+#define	i_Regs				iExtras[12]		// Alias for i_AbtStackTop
 
 // TScheduler member data
-struct TSchedulerX
-	{
-	TUint64				iTimerMax;				// Maximum per-CPU timer frequency (after prescaling)
-	TUint32				iSXP[1];
-	ArmGlobalTimer*		iGlobalTimerAddr;		// Address of global timer registers (also in TSubScheduler)
-	ArmScu*				iScuAddr;				// Address of SCU (also in TSubScheduler)
-	GicDistributor*		iGicDistAddr;			// Address of GIC Distributor (also in TSubScheduler)
-	GicCpuIfc*			iGicCpuIfcAddr;			// Address of GIC CPU Interface (also in TSubScheduler)
-	ArmLocalTimer*		iLocalTimerAddr;		// Address of local timer registers (also in TSubScheduler)
-
-	SRatioInv			iGTimerFreqRI;			// ratio of global timer frequency to maximum possible
-	TUint64				iCount0;				// global timer count at last frequency change
-	TUint64				iTimestamp0;			// timestamp at last frequency change
-
-	TUint32				iSXP2[16];
-	};
+#define	i_TimerMax			iExtras[16]		// Maximum per-CPU timer frequency (after prescaling)
 
 
-#define	RESCHED_IPI_VECTOR				0x00
-#define	GENERIC_IPI_VECTOR				0x01
-#define	TRANSFERRED_IRQ_VECTOR			0x02
-#define	CRASH_IPI_VECTOR				0x03	// would really like this to be a FIQ
-#define	BOOT_IPI_VECTOR					0x04	// used during boot to handshake with APs
-#define	INDIRECT_POWERDOWN_IPI_VECTOR	0x04	// used to trigger core power down
-#define RESERVED_IPI_VECTOR_1			0x05	// reserved for future kernel functionality
-#define RESERVED_IPI_VECTOR_2			0x06	// reserved for future kernel functionality
-#define IDLE_WAKEUP_IPI_VECTOR			0x07	// for use of Idle handler/Wakeup handler
+#define	RESCHED_IPI_VECTOR			0x00
+#define	GENERIC_IPI_VECTOR			0x01
+#define	TRANSFERRED_IRQ_VECTOR		0x02
+#define	CRASH_IPI_VECTOR			0x03	// would really like this to be a FIQ
+#define	BOOT_IPI_VECTOR				0x04	// used during boot to handshake with APs
+#define RESERVED_IPI_VECTOR_1		0x05	// reserved for future kernel functionality
+#define RESERVED_IPI_VECTOR_2		0x06	// reserved for future kernel functionality
+#define RESERVED_IPI_VECTOR_3		0x07	// reserved for future kernel functionality
 
 #if defined(__CPU_ARM11MP__)
 #define	TIMESLICE_VECTOR			0x1D	// vector 29 is per-CPU timer interrupt
@@ -222,7 +191,8 @@
 	{
 public:
 	TInt Create(SNThreadCreateInfo& aInfo, TBool aInitial);
-	void Stillborn();
+	inline void Stillborn()
+		{}
 
 	/** Value indicating what event caused thread to enter privileged mode.
 		@publishedPartner
@@ -329,15 +299,14 @@
 #define	smp_wmb()	mb()
 
 #ifdef	__IN_KERNEL__
-#define	SCU				(*TheScheduler.iSX.iScuAddr)
-#define	GIC_DIST		(*TheScheduler.iSX.iGicDistAddr)
-#define	GIC_CPU_IFC		(*TheScheduler.iSX.iGicCpuIfcAddr)
-#define	LOCAL_TIMER		(*TheScheduler.iSX.iLocalTimerAddr)
-
-#ifdef	__CPU_ARM_HAS_GLOBAL_TIMER_BLOCK
-#define	GLOBAL_TIMER	(*TheScheduler.iSX.iGlobalTimerAddr)
-#endif
-
+struct ArmScu;
+struct GicDistributor;
+struct GicCpuIfc;
+struct ArmLocalTimer;
+#define	SCU			(*(ArmScu*)TheScheduler.i_ScuAddr)
+#define	GIC_DIST	(*(GicDistributor*)TheScheduler.i_GicDistAddr)
+#define	GIC_CPU_IFC	(*(GicCpuIfc*)TheScheduler.i_GicCpuIfcAddr)
+#define	LOCAL_TIMER	(*(ArmLocalTimer*)TheScheduler.i_LocalTimerAddr)
 #endif
 
 
--- a/kernel/eka/include/nkernsmp/nk_priv.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/nkernsmp/nk_priv.h	Wed Sep 01 12:34:56 2010 +0100
@@ -27,19 +27,6 @@
 
 class Monitor;
 
-const TInt KNumPriClasses = 4;
-extern const TUint8 KClassFromPriority[KNumPriorities];
-
-#ifndef __LOAD_BALANCE_INFO_DEFINED__
-/**
-@internalComponent
-*/
-struct SLbInfo
-	{
-	TUint64		i__Dummy;
-	};
-#endif
-
 /********************************************
  * Schedulable = thread or thread group
  ********************************************/
@@ -54,20 +41,13 @@
 class NSchedulable : public TPriListLink
 	{
 public:
-	/**
-	@internalComponent
-	*/
 	enum
 		{
 		EReadyGroup=1,
-		EReadyCpuMask=0x1f,
-		EReadyCpuSticky=0x40,
+		EReadyCpuMask=0x7f,
 		EReadyOffset=0x80,
 		};
 
-	/**
-	@internalComponent
-	*/
 	enum NReadyFlags
 		{
 		ENewTimeslice=1,
@@ -75,9 +55,6 @@
 		EUnPause=4,
 		};
 
-	/**
-	@internalComponent
-	*/
 	enum NEventState
 		{
 		EEventCountShift=16u,
@@ -90,96 +67,32 @@
 		EDeferredReady=0x4000u,
 		EEventParent=0x8000u,
 		};
-
-	/**
-	@internalComponent
-	*/
-	enum NLbState
-		{
-		ELbState_Inactive	= 0x00u,	// not currently involved in load balancing
-		ELbState_Global		= 0x01u,	// flag indicating this is on global load balance list
-		ELbState_Temp		= 0x02u,	// flag indicating this is on a temporary load balance list
-		ELbState_CpuMask	= 0x1Fu,	// mask of bits indicating CPU if on per-CPU list
-		ELbState_PerCpu		= 0x20u,	// flag indicating this is on per-CPU load balance list
-		ELbState_ExtraRef	= 0x40u,	// flag indicating extra reference has been taken after thread/group died
-		ELbState_Generation	= 0x80u,	// 1 bit generation number
-		};
-
-	/**
-	@internalComponent
-	*/
-	enum NCpuStatsSelect
-		{
-		E_RunTime=0x01u,
-		E_RunTimeDelta=0x02u,
-		E_ActiveTime=0x04u,
-		E_ActiveTimeDelta=0x08u,
-		E_LastRunTime=0x10u,
-		E_LastActiveTime=0x20u,
-
-		E_AllStats = 0x3fu
-		};
-
-	/**
-	@internalComponent
-	*/
-	struct SCpuStats
-		{
-		TUint64		iRunTime;			// total run time
-		TUint64		iRunTimeDelta;		// run time since we last asked
-		TUint64		iActiveTime;		// total active time
-		TUint64		iActiveTimeDelta;	// active time since we last asked
-		TUint64		iLastRunTime;		// how long ago this last ran
-		TUint64		iLastActiveTime;	// how long ago this was last active
-		};
 public:
-	NSchedulable();								/**< @internalComponent */
-	void AcqSLock();							/**< @internalComponent */
-	void RelSLock();							/**< @internalComponent */
-	void LAcqSLock();							/**< @internalComponent */
-	void RelSLockU();							/**< @internalComponent */
-	void ReadyT(TUint aMode);					/**< @internalComponent */ // make ready, assumes lock held
-	TInt BeginTiedEvent();						/**< @internalComponent */
-	void EndTiedEvent();						/**< @internalComponent */
-	TInt AddTiedEvent(NEventHandler* aEvent);	/**< @internalComponent */
-	TBool TiedEventReadyInterlock(TInt aCpu);	/**< @internalComponent */
-	void UnPauseT();							/**< @internalComponent */ // decrement pause count and make ready if necessary
-	static void DeferredReadyIDfcFn(TAny*);		/**< @internalComponent */
-	void DetachTiedEvents();					/**< @internalComponent */
-	TBool TakeRef();							/**< @internalComponent */
-	TBool DropRef();							/**< @internalComponent */
-	void LbUnlink();							/**< @internalComponent */
-	void LbTransfer(SDblQue& aDestQ);			/**< @internalComponent */
-	void RemoveFromEnumerateList();				/**< @internalComponent */
-	void GetCpuStats(TUint aMask, SCpuStats& aOut);		/**< @internalComponent */
-	void GetCpuStatsT(TUint aMask, SCpuStats& aOut);	/**< @internalComponent */
-	void GetLbStats(TUint64 aTime);				/**< @internalComponent */
-	void LbDone(TUint aFlags);					/**< @internalComponent */
-	TUint32 SetCpuAffinityT(TUint32 aAffinity);	/**< @internalComponent */
-	TBool ShouldMigrate(TInt aCpu);				/**< @internalComponent */
-	void InitLbInfo();							/**< @internalComponent */
-	void NominalPriorityChanged();				/**< @internalComponent */
-	void AddToEnumerateList();					/**< @internalComponent */
-	void SetEventCpu();							/**< @internalComponent */
+	NSchedulable();
+	void AcqSLock();
+	void RelSLock();
+	void LAcqSLock();
+	void RelSLockU();
+	void ReadyT(TUint aMode);					// make ready, assumes lock held
+	TInt BeginTiedEvent();
+	void EndTiedEvent();
+	TInt AddTiedEvent(NEventHandler* aEvent);
+	TBool TiedEventReadyInterlock(TInt aCpu);
+	void UnPauseT();							// decrement pause count and make ready if necessary
+	static void DeferredReadyIDfcFn(TAny*);
+	void DetachTiedEvents();
 public:
-	static TUint32 PreprocessCpuAffinity(TUint32 aAffinity);			/**< @internalComponent */
-	inline TBool IsGroup()			{return !iParent;}					/**< @internalComponent */
-	inline TBool IsLoneThread()		{return iParent==this;}				/**< @internalComponent */
-	inline TBool IsGroupThread()	{return iParent && iParent!=this;}	/**< @internalComponent */
+	inline TBool IsGroup()			{return !iParent;}
+	inline TBool IsLoneThread()		{return iParent==this;}
+	inline TBool IsGroupThread()	{return iParent && iParent!=this;}
 public:
 //	TUint8				iReady;					/**< @internalComponent */	// flag indicating thread on ready list = cpu number | EReadyOffset
 //	TUint8				iCurrent;				/**< @internalComponent */	// flag indicating thread is running
 //	TUint8				iLastCpu;				/**< @internalComponent */	// CPU on which this thread last ran
 	TUint8				iPauseCount;			/**< @internalComponent */	// count of externally requested pauses extending a voluntary wait
 	TUint8				iSuspended;				/**< @internalComponent */	// flag indicating active external suspend (Not used for groups)
-	TUint8				iACount;				/**< @internalComponent */	// access count
-	TUint8				iPreferredCpu;			/**< @internalComponent */
-
-	TInt				iActiveState;			/**< @internalComponent */
-	TUint8				i_NSchedulable_Spare2;	/**< @internalComponent */
-	TUint8				iForcedCpu;				/**< @internalComponent */
-	TUint8				iTransientCpu;			/**< @internalComponent */
-	TUint8				iLbState;				/**< @internalComponent */
+	TUint8				iNSchedulableSpare1;	/**< @internalComponent */
+	TUint8				iNSchedulableSpare2;	/**< @internalComponent */
 
 	TUint8				iCpuChange;				/**< @internalComponent */	// flag showing CPU migration outstanding
 	TUint8				iStopping;				/**< @internalComponent */	// thread is exiting, thread group is being destroyed
@@ -196,31 +109,21 @@
 	TUint32				i_IDfcMem[sizeof(TDfc)/sizeof(TUint32)];	/**< @internalComponent */	// IDFC used to make thread ready after last tied event completes
 //	TDfc				iDeferredReadyIDfc;		/**< @internalComponent */	// IDFC used to make thread ready after last tied event completes
 
-	union {
-		TUint64HL		iRunCount;				/**< @internalComponent */	// number of times this thread has run
-		TUint64HL		iLastStartTime;			/**< @internalComponent */	// last start time for groups
+	union
+		{
+		TUint64			iRunCount64;
+		TUint32			iRunCount32[2];
 		};
-	TUint64HL			iLastRunTime;			/**< @internalComponent */	// time when this thread last ran
-	TUint64HL			iTotalCpuTime;			/**< @internalComponent */	// total CPU time used by this thread
-	TUint64HL			iLastActivationTime;	/**< @internalComponent */	// time when this thread last became active
-	TUint64HL			iTotalActiveTime;		/**< @internalComponent */	// total time this thread has been active
-	TUint64HL			iSavedCpuTime;			/**< @internalComponent */	// Total CPU time used at last check
-	TUint64HL			iSavedActiveTime;		/**< @internalComponent */	// Total active time at last check
-	SDblQueLink			iLbLink;				/**< @internalComponent */	// Link into queue of tasks requiring load balancing
-	SIterDQLink			iEnumerateLink;			/**< @internalComponent */
-
-	enum {EMaxLbInfoSize = 48};					/**< @internalComponent */
-	union	{
-		TUint64			i__Dummy[EMaxLbInfoSize/sizeof(TUint64)];	/**< @internalComponent */
-		SLbInfo			iLbInfo;				/**< @internalComponent */
+	union
+		{
+		TUint64			iTotalCpuTime64;		/**< @internalComponent */	// total time spent running, in hi-res timer ticks
+		TUint32			iTotalCpuTime32[2];		/**< @internalComponent */	// total time spent running, in hi-res timer ticks
 		};
 	};
 
 __ASSERT_COMPILE(!(_FOFF(NSchedulable,iSSpinLock)&7));
-__ASSERT_COMPILE(!(_FOFF(NSchedulable,iRunCount)&7));
-__ASSERT_COMPILE(!(_FOFF(NSchedulable,iTotalCpuTime)&7));
-__ASSERT_COMPILE(!(_FOFF(NSchedulable,iLbInfo)&7));
-__ASSERT_COMPILE(sizeof(SLbInfo) <= NSchedulable::EMaxLbInfoSize);
+__ASSERT_COMPILE(!(_FOFF(NSchedulable,iRunCount64)&7));
+__ASSERT_COMPILE(!(_FOFF(NSchedulable,iTotalCpuTime64)&7));
 __ASSERT_COMPILE(!(sizeof(NSchedulable)&7));
 
 
@@ -358,34 +261,34 @@
 		};
 public:
 	NThreadBase();
-	TInt Create(SNThreadCreateInfo& anInfo,	TBool aInitial);	/**< @internalComponent */
-	void UnReadyT();										/**< @internalComponent */
-	TBool SuspendOrKill(TInt aCount);						/**< @internalComponent */
-	TBool DoSuspendOrKillT(TInt aCount, TSubScheduler* aS);	/**< @internalComponent */
-	TBool CancelTimerT();									/**< @internalComponent */
-	void DoReleaseT(TInt aReturnCode, TUint aMode);			/**< @internalComponent */
-	TBool CheckFastMutexDefer();							/**< @internalComponent */
-	void DoCsFunctionT();									/**< @internalComponent */
-	TBool Resume(TBool aForce);								/**< @internalComponent */
-	IMPORT_C TBool Suspend(TInt aCount);					/**< @internalComponent */
-	IMPORT_C TBool Resume();								/**< @internalComponent */
-	IMPORT_C TBool ForceResume();							/**< @internalComponent */
+	TInt Create(SNThreadCreateInfo& anInfo,	TBool aInitial);
+	void UnReadyT();
+	TBool SuspendOrKill(TInt aCount);
+	TBool DoSuspendOrKillT(TInt aCount, TSubScheduler* aS);
+	TBool CancelTimerT();
+	void DoReleaseT(TInt aReturnCode, TUint aMode);
+	TBool CheckFastMutexDefer();
+	void DoCsFunctionT();
+	TBool Resume(TBool aForce);
+	IMPORT_C TBool Suspend(TInt aCount);		/**< @internalComponent */
+	IMPORT_C TBool Resume();					/**< @internalComponent */
+	IMPORT_C TBool ForceResume();				/**< @internalComponent */
 	IMPORT_C void Release(TInt aReturnCode, TUint aMode);	/**< @internalComponent */
-	IMPORT_C void RequestSignal();							/**< @internalComponent */
-	IMPORT_C void SetPriority(TInt aPriority);				/**< @internalComponent */
-	void SetNominalPriority(TInt aPriority);				/**< @internalComponent */
-	void SetMutexPriority(NFastMutex* aMutex);				/**< @internalComponent */
-	void LoseInheritedPriorityT();							/**< @internalComponent */
-	void ChangeReadyThreadPriority();						/**< @internalComponent */
-	TBool TiedEventLeaveInterlock();						/**< @internalComponent */
-	TBool TiedEventJoinInterlock();							/**< @internalComponent */
-	IMPORT_C void Kill();									/**< @internalComponent */
-	void Exit();											/**< @internalComponent */
+	IMPORT_C void RequestSignal();				/**< @internalComponent */
+	IMPORT_C void SetPriority(TInt aPriority);	/**< @internalComponent */
+	void SetMutexPriority(NFastMutex* aMutex);
+	void LoseInheritedPriorityT();
+	void ChangeReadyThreadPriority();
+	TUint32 SetCpuAffinity(TUint32 aAffinity);
+	TBool TiedEventLeaveInterlock();
+	TBool TiedEventJoinInterlock();
+	IMPORT_C void Kill();						/**< @internalComponent */
+	void Exit();
 	// hooks for platform-specific code
-	void OnKill();											/**< @internalComponent */
-	void OnExit();											/**< @internalComponent */
+	void OnKill(); 
+	void OnExit();
 public:
-	static void TimerExpired(TAny* aPtr);					/**< @internalComponent */
+	static void TimerExpired(TAny* aPtr);
 
 	/** @internalComponent */
 	inline void UnknownState(TInt aOp, TInt aParam)
@@ -418,10 +321,10 @@
 	TPriListLink		iWaitLink;				/**< @internalComponent */	// used to link thread into a wait queue
 //	TUint8				iBasePri;				/**< @internalComponent */	// priority with no fast mutex held
 //	TUint8				iMutexPri;				/**< @internalComponent */	// priority from held fast mutex
-//	TUint8				iNominalPri;			/**< @internalComponent */	// nominal priority of thread (excluding effect of higher level inheritance)
+//	TUint8				iInitial;				/**< @internalComponent */	// TRUE if this is an initial thread
 	TUint8				iLinkedObjType;
 	TUint8				i_ThrdAttr;				/**< @internalComponent */
-	TUint8				iInitial;				/**< @internalComponent */	// TRUE if this is an initial thread
+	TUint8				iNThreadBaseSpare10;
 	TUint8				iFastMutexDefer;		/**< @internalComponent */
 
 	NFastSemaphore		iRequestSemaphore;		/**< @internalComponent */
@@ -454,15 +357,14 @@
 	TAny*				iExtraContext;			/**< @internalComponent */	// parent FPSCR value (iExtraContextSize == -1), coprocessor context (iExtraContextSize > 0) or NULL
 	TInt				iExtraContextSize;		/**< @internalComponent */	// +ve=dynamically allocated, 0=none, -1=iExtraContext stores parent FPSCR value
 
-	TUint8				iCoreCycling;			/**< @internalComponent */	// this thread is currently cycling through all active cores
-	TUint8				iRebalanceAttr;			/**< @internalComponent */	// behaviour of load balancing wrt this thread
-	TUint8				iNThreadBaseSpare4c;	/**< @internalComponent */	// spare to allow growth while preserving BC
-	TUint8				iNThreadBaseSpare4d;	/**< @internalComponent */	// spare to allow growth while preserving BC
-	TUint32				iNThreadBaseSpare5;		/**< @internalComponent */	// spare to allow growth while preserving BC
 	TUint32				iNThreadBaseSpare6;		/**< @internalComponent */	// spare to allow growth while preserving BC
 	TUint32				iNThreadBaseSpare7;		/**< @internalComponent */	// spare to allow growth while preserving BC
 	TUint32				iNThreadBaseSpare8;		/**< @internalComponent */	// spare to allow growth while preserving BC
 	TUint32				iNThreadBaseSpare9;		/**< @internalComponent */	// spare to allow growth while preserving BC
+
+	// For EMI support - HOPEFULLY THIS CAN DIE
+	TUint32	iTag;							/**< @internalComponent */	// User defined set of bits which is ANDed with a mask when the thread is scheduled, and indicates if a DFC should be scheduled.
+	TAny* iVemsData;						/**< @internalComponent */	// This pointer can be used by any VEMS to store any data associated with the thread.  This data must be clean up before the Thread Exit Monitor completes.
 	};
 
 __ASSERT_COMPILE(!(_FOFF(NThreadBase,iWaitLink)&7));
@@ -475,14 +377,12 @@
 
 #define iBasePri			iWaitLink.iSpare1	/**< @internalComponent */
 #define	iMutexPri			iWaitLink.iSpare2	/**< @internalComponent */
-#define	iNominalPri			iWaitLink.iSpare3	/**< @internalComponent */
-#define	i_NThread_Initial	iInitial			/**< @internalComponent */
+#define	i_NThread_Initial	iWaitLink.iSpare3	/**< @internalComponent */
 
 #endif
 
 /** @internalComponent */
-#define	i_NThread_BasePri		iWaitLink.iSpare1
-#define	i_NThread_NominalPri	iWaitLink.iSpare3
+#define	i_NThread_BasePri	iWaitLink.iSpare1
 
 /** @internalComponent */
 #define	NTHREADBASE_CPU_AFFINITY_MASK	0x80000000
@@ -507,7 +407,6 @@
 	NThreadGroup();
 public:
 	TInt iThreadCount;										/**< @internalComponent */
-	TDfc* iDestructionDfc;									/**< @internalComponent */
 	TPriList<NThreadBase, KNumPriorities> iNThreadList;		/**< @internalComponent */
 	};
 
@@ -515,49 +414,25 @@
  * Scheduler
  ********************************************/
 
-#include <nk_plat.h>
-
-/**
-@internalComponent
-*/
-enum
-	{
-	EQueueEvent_Kick=1,
-	EQueueEvent_WakeUp=2,
-	};
-
 /**
 @internalComponent
 */
 class TScheduler;
 class NThread;
 class NIrqHandler;
-struct SIdlePullThread;
-class TSubScheduler
+class TSubScheduler : public TPriListBase
 	{
 public:
 	TSubScheduler();
 	void QueueDfcs();
 	void RotateReadyList(TInt aPriority);
 	NThread* SelectNextThread();
-	TInt QueueEvent(NEventHandler* aEvent);
+	TBool QueueEvent(NEventHandler* aEvent);
 	void QueueEventAndKick(NEventHandler* aEvent);
 	void SaveTimesliceTimer(NThreadBase* aThread);
 	void UpdateThreadTimes(NThreadBase* aOld, NThreadBase* aNew);
-	void SSAddEntry(NSchedulable* aEntry);
-	void SSAddEntryHead(NSchedulable* aEntry);
-	void SSRemoveEntry(NSchedulable* aEntry);
-	void SSChgEntryP(NSchedulable* aEntry, TInt aNewPriority);
-	void IdlePullSearch(SIdlePullThread& a, TSubScheduler* aDest);
-	void GetLbThreads(SDblQue& aQ);
-	TBool Detached();	// platform specific
-
-	inline TInt HighestPriority()
-		{ return iSSList.HighestPriority(); }
-	inline NSchedulable* EntryAtPriority(TInt aPri)
-		{ return (NSchedulable*)iSSList.iQueue[aPri]; }
 private:
-	TPriList<NSchedulable, KNumPriorities>	iSSList;
+	SDblQueLink*	iExtraQueues[KNumPriorities-1];
 public:
 	TSpinLock		iExIDfcLock;				// lock to protect exogenous IDFC queue
 
@@ -581,19 +456,25 @@
 
 	TUint8			iInIDFC;					// TRUE if IDFCs are currently being run on this CPU
 	volatile TUint8	iEventHandlersPending;		// TRUE if an event handler is pending on this CPU
-	TUint8			iCCSyncPending;
-	TUint8			iLbCounter;
+	TUint8			iSubSchedulerSpare4;
+	TUint8			iSubSchedulerSpare5;
 	TAny*			iAddressSpace;
 
 	TUint32			iReschedIPIs;
 	TScheduler*		iScheduler;
 
-	TInt			iDeferShutdown;				// counts reasons why this CPU can't shut down
-	TInt			iRdyThreadCount;			// number of ready threads excluding idle thread
-	TUint16			iPriClassThreadCount[KNumPriClasses];
+	union
+		{
+		TUint64		iLastTimestamp64;			// NKern::Timestamp() value at last reschedule or timestamp sync
+		TUint32		iLastTimestamp32[2];
+		};
+	union
+		{
+		TUint64		iReschedCount64;
+		TUint32		iReschedCount32[2];
+		};
 
-	TUint64HL		iLastTimestamp;				// timestamp at which last reschedule occurred
-	TUint64HL		iReschedCount;
+	TAny*			iExtras[24];				// Space for platform-specific extras
 
 	TGenericIPI*	iNextIPI;					// next generic IPI to run on this CPU
 	NThread*		iInitialThread;				// Initial (idle) thread on this CPU
@@ -604,32 +485,15 @@
 
 	TUint64			iSpinLockOrderCheck;		// bitmask showing which spinlock orders currently held
 
-	TSubSchedulerX	iSSX;						// platform specific extras
-
-	volatile TAny*	iUncached;					// points to platform specific uncached data structure
-	TUint 			iMadeReadyCounter;			// Number of times this core made a thread ready.
-
-	TUint 			iMadeUnReadyCounter;		// Number of times this core made a thread unready.
-	TUint 			iTimeSliceExpireCounter;	// Number of times this core hass reschedualed due to time slice exireation.
-
-	TUint32			iSubSchedulerPadding[70];
-	SDblQue			iLbQ;						// threads to be considered by subsequent periodic load balance
-
-	TAny*			iSubSchedScratch[16];		// For use by code outside NKern
+	TUint32			iSubSchedulerPadding[8];
 	};
 
-const TInt KSubSchedulerShift = 10;				// log2(sizeof(TSubScheduler))
-
 __ASSERT_COMPILE(!(_FOFF(TSubScheduler,iExIDfcLock)&7));
 __ASSERT_COMPILE(!(_FOFF(TSubScheduler,iEventHandlerLock)&7));
 __ASSERT_COMPILE(!(_FOFF(TSubScheduler,iReadyListLock)&7));
-__ASSERT_COMPILE(!(_FOFF(TSubScheduler,iLastTimestamp)&7));
-__ASSERT_COMPILE(!(_FOFF(TSubScheduler,iReschedCount)&7));
-__ASSERT_COMPILE(sizeof(TSubSchedulerX)==256);
-__ASSERT_COMPILE(sizeof(TSubScheduler)==(1<<KSubSchedulerShift));	// make it a nice power of 2 size for easy indexing
-
-struct SCoreControlAction;
-struct SVariantInterfaceBlock;
+__ASSERT_COMPILE(!(_FOFF(TSubScheduler,iLastTimestamp64)&7));
+__ASSERT_COMPILE(!(_FOFF(TSubScheduler,iReschedCount64)&7));
+__ASSERT_COMPILE(sizeof(TSubScheduler)==512);	// make it a nice power of 2 size for easy indexing
 
 /**
 @internalComponent
@@ -641,65 +505,22 @@
 	static void Reschedule();
 	IMPORT_C static TScheduler* Ptr();
 	inline void SetProcessHandler(TLinAddr aHandler) {iProcessHandler=aHandler;}
-	void PeriodicBalance();
-	TBool ReBalance(SDblQue& aQ, TBool aCC);
-	void CCReactivate(TUint32 aMore);
-	void CCIpiReactivate();
-	void CCRequest();
-	void GetLbThreads(SDblQue& aQ);
-	void CCUnDefer();
-	void ChangeThreadAcceptCpus(TUint32 aNewMask);
-	TUint32 ReschedInactiveCpus(TUint32 aMask);
-	void InitCCAction(SCoreControlAction& aA);
-	TUint32 ModifyCCState(TUint32 aAnd, TUint32 aXor);
-	TUint32 CpuShuttingDown(TSubScheduler& aSS);
-	void AllCpusIdle();
-	void FirstBackFromIdle();
-
-	void InitLB();
-	void StartRebalanceTimer(TBool aRestart);
-	void StopRebalanceTimer(TBool aTemp);
-	static void BalanceTimerExpired(TAny*);
-	static void StartPeriodicBalancing();
-	static void CCSyncDone(TAny*);
-	static void CCReactivateDfcFn(TAny*);
-	static void CCRequestDfcFn(TAny*);
-	static void CCIpiReactivateFn(TAny*);
-	static TDfcQue* RebalanceDfcQ();
-	static NThread* LBThread();
-	static TBool CoreControlSupported();
-	static void CCInitiatePowerUp(TUint32 aCores);
-	static void CCIndirectPowerDown(TAny*);
-	static void DoFrequencyChanged(TAny*);
 public:
 	TLinAddr		iMonitorExceptionHandler;
 	TLinAddr		iProcessHandler;
 
-	volatile TUint32 iThreadAcceptCpus;			// bit n set if CPU n is accepting unlocked threads
-	volatile TUint32 iIpiAcceptCpus;			// bit n set if CPU n is accepting generic IPIs
-	volatile TUint32 iCpusComingUp;				// bit n set if CPU n is in the process of powering up
-	volatile TUint32 iCpusGoingDown;			// bit n set if CPU n is in the process of powering down and is no longer accepting IPIs
-	volatile TInt	 iCCDeferCount;				// >0 means CPUs on the way down will stop just before the 'point of no return'
-	volatile TUint32 iCCSyncCpus;				// bit n set if CPU n has not yet observed a change to iThreadAcceptCpus
-	volatile TUint32 iCCReactivateCpus;
-	volatile TUint32 iCCState;
+	TLinAddr		iRescheduleHook;
+	TUint32			iActiveCpus1;				// bit n set if CPU n is accepting unlocked threads
 
+	TUint32			iActiveCpus2;				// bit n set if CPU n is accepting generic IPIs
 	TInt			iNumCpus;					// number of CPUs under the kernel's control
-	TLinAddr		iRescheduleHook;
-
-	SDblQue			iGenIPIList;				// list of active generic IPIs
-	TSpinLock		iGenIPILock;				// spin lock protects iGenIPIList, also iIpiAcceptCpus, iCpusComingUp, iCpusGoingDown, iCCDeferCount
 
 	TSubScheduler*	iSub[KMaxCpus];				// one subscheduler per CPU
 
-	TAny*			iSchedScratch[16];			// for use by code outside NKern
-
-	TSchedulerX		iSX;						// platform specific extras
+	TAny*			iExtras[24];				// Space for platform-specific extras
 
 	NFastMutex		iLock;						// the 'system lock' fast mutex
 
-	TSpinLock		iIdleBalanceLock;
-
 	TSpinLock		iIdleSpinLock;				// lock to protect list of DFCs to be run on idle
 
 	SDblQue			iIdleDfcs;					// list of DFCs to run when all CPUs go idle
@@ -707,44 +528,27 @@
 	TUint32			iCpusNotIdle;				// bitmask - Bit n set => CPU n is not idle
 	TUint8			iIdleGeneration;			// Toggles between 0 and 1 each time iIdleDfcs list is spilled to a CPU IDFC queue
 	TUint8			iIdleSpillCpu;				// Which CPU last spilled the iIdleDfcs list to its IDFC queue
-	TUint8			iLbCounter;
-	volatile TUint8	iNeedBal;
+	TUint8			iTSchedulerSpare1;
+	TUint8			iTSchedulerSpare2;
 
 	TUint32			iIdleGenerationCount;		// Incremented each time iIdleDfcs list is spilled to a CPU IDFC queue
-	TDfcQue*		iRebalanceDfcQ;
-
-	TSpinLock		iEnumerateLock;				// lock to protect iAllThreads, iAllGroups
-	SIterDQ			iAllThreads;				// list of all nanokernel threads in order of creation
-	SIterDQ			iAllGroups;					// list of all thread groups in order of creation
-	TSpinLock		iBalanceListLock;			// lock to protect iBalanceList
-	TUint64			iLastBalanceTime;			// time at which last rebalance occurred
-	SDblQue			iBalanceList;				// list of threads/groups for load balancing
-	NTimer			iBalanceTimer;				// triggers periodic rebalancing
-	TDfc			iCCSyncIDFC;				// runs when a change to iThreadAcceptCpus has been observed by all CPUs
-	TDfc			iCCReactivateDfc;			// runs when a reschedule IPI is targeted to an inactive CPU
+	TUint32			i_Scheduler_Padding[3];
 
-	TUint32			iCCRequestLevel;			// Number of active cores last requested
-	volatile TUint32 iCCIpiReactivate;			// Cores to be woken up because of IPIs
-
-	TDfc			iCCRequestDfc;				// runs when a request is made to change the number of active cores
-	TDfc			iCCPowerDownDfc;			// runs when indirect power down of core(s) is required
-	TDfc			iCCIpiReactIDFC;			// runs when an IPI needs to wake up a core
-	TDfc			iFreqChgDfc;				// runs when frequency changes required
-
-	TSubScheduler*	iPoweringOff;				// CPU last to power off
-	TUint32			iDetachCount;				// detach count before power off
-
-	SVariantInterfaceBlock* iVIB;
-	TUint32			i_Scheduler_Padding[29];
+	// For EMI support - HOPEFULLY THIS CAN DIE
+	NThread* iSigma;	
+	TDfc* iEmiDfc;
+	TUint32 iEmiMask;
+	TUint32 iEmiState;
+	TUint32 iEmiDfcTrigger;
+	TBool iLogging;
+	TAny* iBufferStart;
+	TAny* iBufferEnd;
+	TAny* iBufferTail;
+	TAny* iBufferHead;
 	};
 
-__ASSERT_COMPILE(!(_FOFF(TScheduler,iGenIPILock)&7));
 __ASSERT_COMPILE(!(_FOFF(TScheduler,iIdleSpinLock)&7));
-__ASSERT_COMPILE(!(_FOFF(TScheduler,iIdleBalanceLock)&7));
-__ASSERT_COMPILE(!(_FOFF(TScheduler,iEnumerateLock)&7));
-__ASSERT_COMPILE(!(_FOFF(TScheduler,iBalanceListLock)&7));
-__ASSERT_COMPILE(sizeof(TSchedulerX)==32*4);
-__ASSERT_COMPILE(sizeof(TScheduler)==1024);
+__ASSERT_COMPILE(sizeof(TScheduler)==512);
 
 extern TScheduler TheScheduler;
 extern TSubScheduler TheSubSchedulers[KMaxCpus];
@@ -770,6 +574,11 @@
 /**
 @internalComponent
 */
+extern "C" void send_resched_ipis(TUint32 aMask);
+
+/**
+@internalComponent
+*/
 extern "C" void send_resched_ipi(TInt aCpu);
 
 /**
@@ -777,6 +586,9 @@
 */
 extern "C" void send_resched_ipi_and_wait(TInt aCpu);
 
+
+#include <nk_plat.h>
+
 /**
 Call with kernel locked
 
@@ -807,20 +619,6 @@
 	return aAffinity==(TUint32)aCpu;
 	}
 
-/** @internalComponent */
-inline TBool CheckCpuAgainstAffinity(TInt aCpu, TUint32 aAffinity, TUint32 aActive)
-	{
-	if (aAffinity & NTHREADBASE_CPU_AFFINITY_MASK)
-		return aActive & aAffinity & (1<<aCpu);
-	return (aAffinity==(TUint32)aCpu) && (aActive & (1<<aCpu));
-	}
-
-/** @internalComponent */
-inline TUint32 AffinityToMask(TUint32 aAffinity)
-	{
-	return (aAffinity & NTHREADBASE_CPU_AFFINITY_MASK) ? (aAffinity & ~NTHREADBASE_CPU_AFFINITY_MASK) : (1u<<aAffinity);
-	}
-
 /**
 @internalComponent
 */
@@ -896,20 +694,7 @@
 public:
 	STimerQ			iTickQ[ENumTimerQueues];	/**< @internalComponent */	// NOTE: the order of member data is important
 	TUint32			iPresent;					/**< @internalComponent */	// The assembler code relies on it
-
-	/**
-	This member is intended for use by ASSP/variant interrupt code as a convenient
-	location to store the value of a free running counter at the point where the
-	system tick is started.
-	@publishedPartner
-	@prototype
-	*/
-	TUint32			iFRCOffset;
-
-	union {
-		TUint32			iMsCount;				/**< @internalComponent */
-		TUint64			iMsCount64;				/**< @internalComponent */
-		};
+	TUint32			iMsCount;					/**< @internalComponent */
 	SDblQue			iHoldingQ;					/**< @internalComponent */
 	SDblQue			iOrderedQ;					/**< @internalComponent */
 	SDblQue			iCompletedQ;				/**< @internalComponent */
@@ -968,6 +753,17 @@
 /**
 @internalComponent
 */
+class TGenIPIList : public SDblQue
+	{
+public:
+	TGenIPIList();
+public:
+	TSpinLock			iGenIPILock;
+	};
+
+/**
+@internalComponent
+*/
 class TCancelIPI : public TGenericIPI
 	{
 public:
@@ -1001,24 +797,25 @@
 /**
 @internalComponent
 */
-#define	MASK_NO_FAST_MUTEX			0x1
-#define	MASK_CRITICAL				0x2
-#define	MASK_NO_CRITICAL			0x4
-#define	MASK_KERNEL_LOCKED			0x8
-#define	MASK_KERNEL_UNLOCKED		0x10
-#define	MASK_KERNEL_LOCKED_ONCE		0x20
-#define	MASK_INTERRUPTS_ENABLED		0x40
-#define	MASK_INTERRUPTS_DISABLED	0x80
-#define	MASK_SYSTEM_LOCKED			0x100
-#define	MASK_NOT_ISR				0x400
-#define	MASK_NOT_IDFC				0x800 
-#define	MASK_NOT_THREAD				0x1000
-#define	MASK_NO_CRITICAL_IF_USER	0x2000
-#define	MASK_ALWAYS_FAIL			0x4000
-#define	MASK_NO_RESCHED				0x8000
-#define	MASK_NO_KILL_OR_SUSPEND		0x10000
-#define	MASK_THREAD_STANDARD		( MASK_NO_FAST_MUTEX | MASK_KERNEL_UNLOCKED | MASK_INTERRUPTS_ENABLED | MASK_NOT_ISR | MASK_NOT_IDFC )
-#define	MASK_THREAD_CRITICAL		( MASK_THREAD_STANDARD | MASK_CRITICAL )
+#define MASK_NO_FAST_MUTEX 0x1
+#define MASK_CRITICAL 0x2
+#define MASK_NO_CRITICAL 0x4
+#define MASK_KERNEL_LOCKED 0x8
+#define MASK_KERNEL_UNLOCKED 0x10
+#define MASK_KERNEL_LOCKED_ONCE 0x20
+#define MASK_INTERRUPTS_ENABLED 0x40
+#define MASK_INTERRUPTS_DISABLED 0x80
+#define MASK_SYSTEM_LOCKED 0x100
+#define MASK_NOT_ISR 0x400
+#define MASK_NOT_IDFC 0x800 
+#define MASK_NOT_THREAD 0x1000
+#define MASK_NO_CRITICAL_IF_USER 0x2000
+#define MASK_ALWAYS_FAIL 0x4000
+#define	MASK_NO_RESCHED 0x8000
+#define MASK_NO_KILL_OR_SUSPEND	0x10000
+
+#define MASK_THREAD_STANDARD ( MASK_NO_FAST_MUTEX | MASK_KERNEL_UNLOCKED | MASK_INTERRUPTS_ENABLED | MASK_NOT_ISR | MASK_NOT_IDFC )
+#define MASK_THREAD_CRITICAL ( MASK_THREAD_STANDARD | MASK_CRITICAL )
 
 #if defined(__STANDALONE_NANOKERNEL__) || (!defined (__KERNEL_APIS_CONTEXT_CHECKS_WARNING__)&&!defined (__KERNEL_APIS_CONTEXT_CHECKS_FAULT__))
 #define CHECK_PRECONDITIONS(mask,function)
--- a/kernel/eka/include/nkernsmp/nkern.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/nkernsmp/nkern.h	Wed Sep 01 12:34:56 2010 +0100
@@ -37,7 +37,7 @@
 /** @internalComponent */
 IMPORT_C void NKFault(const char* file, TInt line);
 /** @internalComponent */
-void NKIdle(TUint32 aStage);
+void NKIdle(TInt aStage);
 }
 
 /**
@@ -144,7 +144,6 @@
 		EOrderThread			=0x91u,		// Thread locks
 		EOrderFastMutex			=0x98u,		// Fast mutex locks
 		EOrderEventHandlerTied	=0x9Cu,		// Event handler tied lock
-		EOrderEnumerate			=0x9Du,		// Thread/Group enumeration lists
 		EOrderGenericPreHigh0	=0x9Eu,		// Device driver spin locks, high range
 		EOrderGenericPreHigh1	=0x9Fu,		// Device driver spin locks, high range
 
@@ -811,15 +810,13 @@
 	};
 
 // Thread iAttributes Constants
-const TUint8 KThreadAttImplicitSystemLock=1;		/**< @internalComponent */
-const TUint8 KThreadAttAddressSpace=2;				/**< @internalComponent */
-const TUint8 KThreadAttLoggable=4;					/**< @internalComponent */
+const TUint8 KThreadAttImplicitSystemLock=1;	/**< @internalComponent */
+const TUint8 KThreadAttAddressSpace=2;			/**< @internalComponent */
+const TUint8 KThreadAttLoggable=4;				/**< @internalComponent */
 
 
 // Thread CPU
-const TUint32 KCpuAffinityAny=0xffffffffu;			/**< @internalComponent */
-const TUint32 KCpuAffinityPref=0x40000000u;			/**< @internalComponent */
-const TUint32 KCpuAffinityTransient=0x20000000u;	/**< @internalComponent */
+const TUint32 KCpuAffinityAny=0xffffffffu;		/**< @internalComponent */
 
 /** Information needed for creating a nanothread.
 
@@ -852,7 +849,6 @@
 struct SNThreadGroupCreateInfo
 	{
 	TUint32 iCpuAffinity;
-	TDfc* iDestructionDfc;
 	};
 
 /**	Constant for use with NKern:: functions which release a fast mutex as well
@@ -863,37 +859,27 @@
 */
 #define	SYSTEM_LOCK		(NFastMutex*)0
 
+
 /** Idle handler function
 	Pointer to a function which is called whenever a CPU goes idle
 
 	@param	aPtr	The iPtr stored in the SCpuIdleHandler structure
-	@param	aStage	Bits 0-7 give a bitmask of CPUs now active, i.e. 0 means all processors now idle
-					Bit 31 set indicates that the current core can now be powered down
-					Bit 30 set indicates that other cores still remain to be retired
-					Bit 29 set indicates that postamble processing is required after waking up
-	@param	aU		Points to some per-CPU uncached memory used for handshaking during power down/power up
+	@param	aStage	If positive, the number of processors still active
+					If zero, indicates all processors are now idle
+					-1 indicates that postamble processing is required after waking up
 
-	@internalComponent
+	@publishedPartner
+	@prototype
 */
-typedef void (*TCpuIdleHandlerFn)(TAny* aPtr, TUint32 aStage, volatile TAny* aU);
+typedef void (*TCpuIdleHandlerFn)(TAny* aPtr, TInt aStage);
 
 /** Idle handler structure
 
-	@internalComponent
+	@publishedPartner
+	@prototype
 */
 struct SCpuIdleHandler
 	{
-	/**
-	Defined flag bits in aStage parameter
-	*/
-	enum
-		{
-		EActiveCpuMask=0xFFu,
-		EPostamble=1u<<29,		// postamble needed
-		EMore=1u<<30,			// more cores still to be retired
-		ERetire=1u<<31,			// this core can now be retired
-		};
-
 	TCpuIdleHandlerFn	iHandler;
 	TAny*				iPtr;
 	volatile TBool		iPostambleRequired;
@@ -1002,7 +988,6 @@
 	IMPORT_C static void ThreadRelease(NThread* aThread, TInt aReturnValue, NFastMutex* aMutex);
 	IMPORT_C static void ThreadSetPriority(NThread* aThread, TInt aPriority);
 	IMPORT_C static void ThreadSetPriority(NThread* aThread, TInt aPriority, NFastMutex* aMutex);
-	static void ThreadSetNominalPriority(NThread* aThread, TInt aPriority);
 	IMPORT_C static void ThreadRequestSignal(NThread* aThread);
 	IMPORT_C static void ThreadRequestSignal(NThread* aThread, NFastMutex* aMutex);
 	IMPORT_C static void ThreadRequestSignal(NThread* aThread, TInt aCount);
@@ -1028,7 +1013,6 @@
 	static TInt QueueUserModeCallback(NThreadBase* aThread, TUserModeCallback* aCallback);	/**< @internalComponent */
 	static void MoveUserModeCallbacks(NThreadBase* aSrcThread, NThreadBase* aDestThread);	/**< @internalComponent */
 	static void CancelUserModeCallbacks();												/**< @internalComponent */
-	static void JumpTo(TInt aCpu);														/**< @internalComponent */
 
 	// Thread Groups
 	IMPORT_C static TInt GroupCreate(NThreadGroup* aGroup, SNThreadGroupCreateInfo& aInfo);
@@ -1120,7 +1104,6 @@
 	IMPORT_C static NThread* CurrentThread();
 	IMPORT_C static TInt CurrentCpu();										/**< @internalComponent */
 	IMPORT_C static TInt NumberOfCpus();									/**< @internalComponent */
-	IMPORT_C static void SetNumberOfActiveCpus(TInt aNumber);
 	IMPORT_C static void LockSystem();
 	IMPORT_C static void UnlockSystem();
 	IMPORT_C static TBool FlashSystem();
@@ -1147,8 +1130,7 @@
 	static TInt BootAP(volatile SAPBootInfo* aInfo);
 	IMPORT_C static TBool KernelLocked(TInt aCount=0);						/**< @internalTechnology */
 	IMPORT_C static NFastMutex* HeldFastMutex();							/**< @internalTechnology */
-	static void Idle();
-	static void DoIdle();
+	static void Idle();	
 	IMPORT_C static SCpuIdleHandler* CpuIdleHandler();						/**< @internalTechnology */
 	static void NotifyCrash(const TAny* a0, TInt a1);						/**< @internalTechnology */
 	IMPORT_C static TBool Crashed();
@@ -1243,34 +1225,12 @@
 class TStopIPI : public TGenericIPI
 	{
 public:
-	TUint32 StopCPUs();
+	void StopCPUs();
 	void ReleaseCPUs();
 	static void Isr(TGenericIPI*);
 public:
 	volatile TInt iFlag;
 	};
 
-
-/**
-@internalComponent
-*/
-class TCoreCycler
-	{
-public:
-	TCoreCycler();
-	TInt Next();
-private:
-	void Init();
-private:
-	TUint32			iCores;
-	TUint32			iRemain;
-	TInt			iInitialCpu;
-	TInt			iCurrentCpu;
-	NThreadGroup*	iG;
-	TInt			iFrz;
-	};
-
-
-
 #include <ncern.h>
 #endif
--- a/kernel/eka/include/nkernsmp/x86/ncern.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/nkernsmp/x86/ncern.h	Wed Sep 01 12:34:56 2010 +0100
@@ -36,6 +36,20 @@
 	{
 	};
 
+/** Timer frequency specification
+
+Stores a frequency as a fraction of a (separately stored) maximum.
+The frequency must be at least 1/256 of the maximum.
+
+@internalTechnology
+@prototype
+*/
+struct STimerMult
+	{
+	TUint32		iFreq;						// frequency as a fraction of maximum possible, multiplied by 2^32
+	TUint32		iInverse;					// 2^24/(iFreq/2^32) = 2^56/iFreq
+	};
+
 /** Variant interface block
 @internalTechnology
 @prototype
@@ -45,9 +59,8 @@
 	TUint64		iMaxCpuClock;				// maximum possible CPU clock frequency on this system
 	TUint32		iTimestampFreq;				// rate at which timestamp increments
 	TUint32		iMaxTimerClock;				// maximum possible local timer clock frequency
-	SRatio*		iTimerFreqR[KMaxCpus];		// timer[i] frequency as a fraction of iMaxTimerClock
-	SRatio*		iCpuFreqR[KMaxCpus];		// CPU[i] frequency as a fraction of iMaxCpuClock
-	SRatio*		iTimestampFreqR;			// timestamp counter frequency as a fraction of
+	volatile STimerMult* iTimerMult[KMaxCpus];	// timer[i] frequency as a fraction of iMaxTimerClock
+	volatile TUint32* iCpuMult[KMaxCpus];	// CPU[i] frequency / iMaxCpuClock * 2^32
 	};
 
 // End of file
--- a/kernel/eka/include/nkernsmp/x86/nk_plat.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/nkernsmp/x86/nk_plat.h	Wed Sep 01 12:34:56 2010 +0100
@@ -27,37 +27,23 @@
 #define __NK_X86_H__
 #include <nk_cpu.h>
 
-class TSubScheduler;
-class TScheduler;
-struct TX86Tss;
-
 // TSubScheduler member data
-struct TSubSchedulerX
-	{
-	TUint32				iSSXP[9];
-	volatile TUint32	iIrqCount;				// count of interrupts handled
-	TAny*				iExcInfo;				// pointer to exception info for crash debugger
-	volatile TInt		iCrashState;			// 0=normal, 1=this CPU faulted, 2=this CPU has received an NMI and halted
-	TUint32				iAPICID;				// Local APIC ID for this CPU (starts at -1)
-	volatile TInt		iIrqNestCount;			// IRQ nest count for this CPU (starts at -1)
-	TLinAddr			iIrqStackTop;			// Top of IRQ stack for this CPU
-	TX86Tss*			iTss;					// Address of TSS for this CPU
-	SRatioInv			iCpuFreqRI;				// Ratio of CPU frequency to maximum possible CPU frequency
-	SRatioInv			iTimerFreqRI;			// Ratio of CPU local timer frequency to maximum possible
-
-	volatile TUint64HL	iTimestampOffset;		// 64 bit value to add to CPU TSC to give NKern::Timestamp()
-
-	TUint32				iSSXP2[36];
-	TUint64				iSSXP3;					// one 64 bit value to guarantee alignment
-	};
+#define	i_IrqCount			iExtras[9]		// count of interrupts handled
+#define	i_ExcInfo			iExtras[10]		// pointer to exception info for crash debugger
+#define	i_CrashState		iExtras[11]		// 0=normal, 1=this CPU faulted, 2=this CPU has received an NMI and halted
+#define	i_APICID			iExtras[12]		// Local APIC ID for this CPU (starts at -1)
+#define	i_IrqNestCount		iExtras[13]		// IRQ nest count for this CPU (starts at -1)
+#define	i_IrqStackTop		iExtras[14]		// Top of IRQ stack for this CPU
+#define	i_Tss				iExtras[15]		// Address of TSS for this CPU
+#define	i_TimerMultF		iExtras[16]		// Timer frequency / Max Timer frequency * 2^32
+#define	i_TimerMultI		iExtras[17]		// Max Timer frequency / Timer frequency * 2^24
+#define	i_CpuMult			iExtras[18]		// CPU frequency / Max CPU frequency * 2^32
+#define	i_TimestampOffset	iExtras[20]		// 64 bit value to add to CPU TSC to give NKern::Timestamp()
+#define	i_TimestampOffsetL	iExtras[20]		// 
+#define	i_TimestampOffsetH	iExtras[21]		// 
 
 // TScheduler member data
-struct TSchedulerX
-	{
-	TUint64				iTimerMax;				// Maximum per-CPU timer frequency (after prescaling)
-	TUint32				iSXP[30];
-	};
-
+#define	i_TimerMax		iExtras[16]		// Maximum per-CPU timer frequency (after prescaling)
 
 #define CRASH_IPI_VECTOR			0x27
 #define RESCHED_IPI_VECTOR			0x28
@@ -82,7 +68,8 @@
 	{
 public:
 	TInt Create(SNThreadCreateInfo& anInfo, TBool aInitial);
-	void Stillborn();
+	inline void Stillborn()
+		{}
 	void GetUserContext(TX86RegSet& aContext, TUint32& aAvailRegMask);
 	void SetUserContext(const TX86RegSet& aContext, TUint32& aRegMask);
 	void GetSystemContext(TX86RegSet& aContext, TUint32& aAvailRegMask);
@@ -200,11 +187,6 @@
 #define smp_mb()	mb()
 
 
-/**
-@internalComponent
-*/
-extern "C" void send_resched_ipis(TUint32 aMask);
-
 
 // End of file
 #endif
--- a/kernel/eka/include/opensystemtrace.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/opensystemtrace.h	Wed Sep 01 12:34:56 2010 +0100
@@ -19,11 +19,6 @@
 
 #include <opensystemtrace_types.h>
 
-/**
-This macro defines the version of the Open System Trace instrumentation API.
-*/
-#define OST_INSTRUMENTATION_API_VERSION 2.1.0
-
 
 /**
 Methods for tracing from user side.
@@ -122,9 +117,7 @@
 #define OST_TRACE_CATEGORY_NONE 0x00000000
 
 /**
-Preprocessor category for traces that should be compiled
-into all builds including UREL. As a result these traces
-will end up in production images used by consumers.
+Preprocessor category for production traces
 */
 #define OST_TRACE_CATEGORY_PRODUCTION 0x00000001
 
@@ -139,12 +132,6 @@
 #define OST_TRACE_CATEGORY_PERFORMANCE_MEASUREMENT 0x00000004
 
 /**
-Preprocessor category for traces that by default should only 
-be compiled into UDEB builds.
-*/
-#define OST_TRACE_CATEGORY_DEBUG 0x00000008
-
-/**
 Preprocessor level for all traces on.
 This should not be used from traces
 */
@@ -158,24 +145,13 @@
 
 
 /**
-The default preprocessor categories are defined here.
-A component may override this by defining
+The default preprocessor category is RND
+Component may override this by defining
 OST_TRACE_CATEGORY before including this file
-
-The RND category is defined for UREL and UDEB to 
-preserve source compatibility.
 */
-#ifndef OST_TRACE_CATEGORY
-#ifdef _DEBUG
-#define OST_TRACE_CATEGORY (OST_TRACE_CATEGORY_RND | \
-                            OST_TRACE_CATEGORY_PRODUCTION | \
-                            OST_TRACE_CATEGORY_DEBUG)
-#else // _DEBUG
-#define OST_TRACE_CATEGORY (OST_TRACE_CATEGORY_RND | \
-                            OST_TRACE_CATEGORY_PRODUCTION)
-#endif // _DEBUG
-#endif // OST_TRACE_CATEGORY
-
+#if !defined( OST_TRACE_CATEGORY )
+#define OST_TRACE_CATEGORY OST_TRACE_CATEGORY_RND
+#endif
 
 /**
 Trace with no parameters
--- a/kernel/eka/include/page_alloc.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-// Copyright (c) 1994-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:
-// kernel\eka\include\page_alloc.h
-// 
-//
-
-#ifndef __KERNEL_MODE__ 
-
-const int MAXSMALLPAGEBITS = 68<<3;
-#define MINPAGEPOWER	PAGESHIFT+2
-
-struct paged_bitmap
-{
-	public:
-		inline paged_bitmap() : iBase(0), iNbits(0) {}
-		void Init(unsigned char* p, unsigned size, unsigned bit);
-//
-		inline unsigned char* Addr() const;
-		inline unsigned Size() const;
-//
-		inline void Set(unsigned ix, unsigned bit);
-		inline unsigned operator[](unsigned ix) const;
-		bool Is(unsigned ix, unsigned len, unsigned bit) const;
-		void Set(unsigned ix, unsigned len, unsigned val);
-		void Setn(unsigned ix, unsigned len, unsigned bit);
-		unsigned Bits(unsigned ix, unsigned len) const;	// little endian
-		int Find(unsigned start, unsigned bit) const;
-	private:
-		unsigned char* iBase;
-		unsigned iNbits;
-};
-
-#endif  // __KERNEL_MODE__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/include/rm_debug_api.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,2558 @@
+// 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 agent client side sessions.
+// 
+// WARNING: This file contains some APIs which are internal and are subject
+//          to change without notice. Such APIs should therefore not be used
+//          outside the Kernel and Hardware Services package.
+//
+
+#ifndef RM_DEBUG_API_H
+#define RM_DEBUG_API_H
+
+/**
+@file
+@publishedPartner
+@released
+*/
+
+#include <e32cmn.h>
+#include <e32def_private.h>
+
+/**
+  The Debug namespace contains all API definitions used for on-target debugging.
+  */
+namespace Debug {
+
+/** This is the maximum size in bytes a user trace can be */
+const TInt TUserTraceSize = 256;
+
+/**
+  Information in the debug functionality block is represented as a concatenation
+  of pairs of TTagHeader structures and arrays of TTag objects.
+  @see TTagHeader
+  @see RSecuritySvrSession::GetDebugFunctionality
+  */
+struct TTag
+{
+	/** Tag ID, value identifying this tag. */
+	TUint32	iTagId;
+	/**
+	  Values correspond to TTagType enumerators.
+	  @see TTagType
+	  */
+	TUint16	iType;
+	/** Size of external data associated with this tag. */
+	TUint16 iSize;
+	/** Data associated with this tag. */
+	TUint32 iValue;
+};
+
+/**
+  Enumeration defining the supported tag types. These enumerators are used in TTag.iTagId.
+  @see TTag
+  */
+enum TTagType
+{
+	/** Indicates that the iValue field of a TTag structure will contain either ETrue or EFalse. */
+	ETagTypeBoolean = 0,
+	/** Indicates that the iValue field of a TTag structure will contain a value in the TUint32 range. */
+	ETagTypeTUint32 = 1,
+	/** Indicates that the iValue field of a TTag structure will contain values from an enumeration. */
+	ETagTypeEnum = 2,
+	/** Indicates that the iValue field of a TTag structure should be interpreted as a bit field. */
+	ETagTypeBitField = 3,
+	/** Indicates that the type of the iValue field of a TTag structure is unknown. */
+	ETagTypeUnknown = 4,
+	/** Indicates that the iValue field of a TTag structure will contain a pointer. */
+	ETagTypePointer = 5
+};
+
+/**
+  Information in the debug functionality block is represented as a concatenation
+  of pairs of TTagHeader structures and arrays of TTag objects.
+  @see TTag
+  @see RSecuritySvrSession::GetDebugFunctionality
+  */
+struct TTagHeader
+{
+	/** Value identifying the contents of this TTagHeader, should be interpreted as an enumerator from TTagHeaderId.
+	  @see TTagHeaderId
+	  */
+	TUint16	iTagHdrId;
+	/** The number of TTag elements in the array associated with this TTagHeader. */
+	TUint16 iNumTags;
+};
+
+/**
+  Enumeration used to identify TTagHeader structures, TTagHeader::iTagHdrId elements take these enumerators as values.
+  @see TTagHeader
+  */
+enum TTagHeaderId
+{
+	ETagHeaderIdCore = 0,            /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityCore. */
+	ETagHeaderIdMemory = 1,          /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityMemory. */
+	/**
+	  Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityRegister.
+	  These values are defined as in the document Symbian Core Dump File Format Appendix C
+	  (see SGL.TS0028.027 - Symbian Core Dump File Format v1.0.doc).
+	  The TTag objects in the associated array have an iSize value corresponding to the size of the register's data in bytes.
+	  */
+	ETagHeaderIdRegistersCore = 2,
+	/**
+	  Identifies a TTagHeader with associated TTag elements with iTagId values corresponding to coprocessor register identifiers.
+	  Coprocessor registers are defined as in the document Symbian Core Dump File Format Appendix C as follows
+	  (see SGL.TS0028.027 - Symbian Core Dump File Format v1.0.doc):
+
+	  For each 32-bit data word defining a co-pro register, the definition of the meaning of the bits follows
+	  the ARM Architecture Reference manual instruction coding
+
+	  Upper Halfword	Lower Halfword
+	  Opcode 2			CRm
+
+	  For example: The Domain Access Control Register is Register 3 of co-processor 15. The encoding is therefore
+	  CRm = 3
+	  Opcode2 = 0
+
+	  Therefore the functionality tag would be:
+	  TagID:  15			// co-processor number
+	  Type: ETagTypeTUint32
+	  Data: 0x00000003		// Opcode2 = 0, CRm = 3
+	  */
+	ETagHeaderIdCoProRegisters = 3,  /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityRegister. */
+	ETagHeaderIdBreakpoints = 4,     /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityBreakpoint. */
+	ETagHeaderIdStepping = 5,        /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityStep. */
+	ETagHeaderIdExecution = 6,       /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityExec. */
+	ETagHeaderIdEvents = 7,          /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TEventType. */
+	ETagHeaderIdApiConstants = 8,    /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityApiConstants.*/
+	ETagHeaderList = 9,              /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TListId. */
+	ETagHeaderIdKillObjects = 10,    /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityKillObject. */
+	ETagHeaderIdSecurity = 11,		 /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalitySecurity */
+	ETagHeaderIdBuffers = 12,        /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TBufferType. */
+	ETagHeaderIdStopModeFunctions = 13, /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityStopModeFunctions. */	
+};
+
+/**
+  This structure is not used in the run-mode debug API.
+  @deprecated
+  */
+struct TSubBlock
+{
+	/** Header to identify the TSubBlock. */
+	TTagHeader iHeader;
+	/** Pointer to array of TTag values associated with this TSubBlock. */
+	TTag* iTagArray;
+};
+
+/**
+  These tags define what kinds of core functionality are supported by the run-mode debug subsystem.
+  TTag structures associated with the ETagHeaderIdCore sub-block will have iTagId values from this enumeration.
+  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
+  */
+enum TFunctionalityCore
+{
+	ECoreEvents = 0,        /**< Indicates whether events processing is supported. */
+	ECoreStartStop = 1,     /**< Indicates whether suspending and resuming threads is supported. */
+	ECoreMemory = 2,        /**< Indicates whether reading and writing memory is supported. */
+	ECoreRegister = 3,      /**< Indicates whether reading and writing register values is supported. */
+	ECoreBreakpoint = 4,    /**< Indicates whether breakpoints are supported. */
+	ECoreStepping = 5,      /**< Indicates whether stepping is supported. */
+	ECoreLists = 6,         /**< Indicates whether listings are supported. */
+	ECoreLogging = 7,       /**< Indicates whether logging is supported. */
+	ECoreHardware = 8,      /**< Indicates whether hardware support is supported. */
+	ECoreApiConstants = 9,  /**< Indicates whether the information in the ETagHeaderIdApiConstants sub-block is relevant. */
+	ECoreKillObjects = 10,  /**< Indicates whether killing objects (i.e. threads and processes) is supported. */
+	ECoreSecurity = 11,		/**< Indicates whether OEM Debug token support or other security info is supported. */
+	ECoreStopModeFunctions = 12, /**< Indicates whether Stop Mode function calling is supported. */
+	ECoreStopModeBuffers = 13, /**< Indicates whether Stop Mode buffers are supported. */
+	
+	/**
+	  @internalTechnology
+	  A debug agent should find the number of core tags from the DFBlock rather than this enumerator.
+	  */
+	ECoreLast
+};
+
+/**
+  These tags define what kind of memory operations can be performed.
+  TTag structures associated with the ETagHeaderIdMemory sub-block will have iTagId values from this enumeration.
+  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
+ */
+enum TFunctionalityMemory
+{
+	EMemoryRead = 0,          /**< Indicates whether reading memory is supported. */
+	EMemoryWrite = 1,         /**< Indicates whether writing memory is supported. */
+	EMemoryAccess64 = 2,      /**< Indicates whether 64 bit memory access is supported. */
+	EMemoryAccess32 = 3,      /**< Indicates whether 32 bit memory access is supported. */
+	EMemoryAccess16 = 4,      /**< Indicates whether 16 bit memory access is supported. */
+	EMemoryAccess8 = 5,       /**< Indicates whether 8 bit memory access is supported. */
+	EMemoryBE8 = 6,           /**< Indicates whether reading memory as 8 bit big-endian values is supported. */
+	EMemoryBE32 = 7,          /**< Indicates whether reading memory as 32 bit big-endian values is supported. */
+	EMemoryLE8 = 8,           /**< Indicates whether reading memory as 8 bit little-endian values is supported. */
+	EMemoryMaxBlockSize = 9,  /**< Corresponds to the maximum size of a block of memory which can be requested. */
+	/**
+	  @internalTechnology
+	  A debug agent should find the number of memory tags from the DFBlock rather than this enumerator.
+	  */
+	EMemoryLast
+};
+
+/**
+  These tags define which objects can be killed by the device driver.
+  TTag structures associated with the ETagHeaderIdKillObjects sub-block will have iTagId values from this enumeration.
+  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
+ */
+enum TFunctionalityKillObject
+{
+	EFunctionalityKillThread = 0,          /**< Indicates whether killing threads is supported. */
+	EFunctionalityKillProcess = 1,         /**< Indicates whether killing processes is supported. */
+	/**
+	  @internalTechnology
+	  A debug agent should find the number of kill object tags from the DFBlock rather than this enumerator.
+	  */
+	EFunctionalityKillObjectLast
+};
+
+/**
+  A TTag with an id from the TFunctionalityRegister enum will have a value from this enumeration.
+  The values define how a register can be accessed, if at all.
+ */
+enum TFunctionalityAccess
+{
+	EAccessNone = 0,       /**< Indicates that a register cannot be accessed. */
+	EAccessReadOnly = 1,   /**< Indicates that a register can be read, but not written to. */
+	EAccessWriteOnly = 2,  /**< Indicates that a register can be written to, but not read. */
+	EAccessReadWrite = 3,  /**< Indicates that a register can be both read and written to. */
+	EAccessUnknown = 4,    /**< Indicates that it is unspecified whether reading or writing to a register is possible. */
+};
+
+/**
+  These enumerators act as core register identifiers.
+  TTag structures associated with the ETagHeaderIdRegistersCore sub-block will have iTagId values from this enumeration.
+  The numeric value of each enumerator identifies the register according to the definitions in the Symbian Core Dump File Format Appendix B
+  (see SGL.TS0028.027 - Symbian Core Dump File Format v1.0.doc).
+  */
+enum TFunctionalityRegister
+{
+	ERegisterR0 = 0x00000000,      /**< Identifier for user mode register R0. */
+	ERegisterR1 = 0x00000100,      /**< Identifier for user mode register R1. */
+	ERegisterR2 = 0x00000200,      /**< Identifier for user mode register R2. */
+	ERegisterR3 = 0x00000300,      /**< Identifier for user mode register R3. */
+	ERegisterR4 = 0x00000400,      /**< Identifier for user mode register R4. */
+	ERegisterR5 = 0x00000500,      /**< Identifier for user mode register R5. */
+	ERegisterR6 = 0x00000600,      /**< Identifier for user mode register R6. */
+	ERegisterR7 = 0x00000700,      /**< Identifier for user mode register R7. */
+	ERegisterR8 = 0x00000800,      /**< Identifier for user mode register R8. */
+	ERegisterR9 = 0x00000900,      /**< Identifier for user mode register R9. */
+	ERegisterR10 = 0x00000a00,     /**< Identifier for user mode register R10. */
+	ERegisterR11 = 0x00000b00,     /**< Identifier for user mode register R11. */
+	ERegisterR12 = 0x00000c00,     /**< Identifier for user mode register R12. */
+	ERegisterR13 = 0x00000d00,     /**< Identifier for user mode register R13. */
+	ERegisterR14 = 0x00000e00,     /**< Identifier for user mode register R14. */
+	ERegisterR15 = 0x00000f00,     /**< Identifier for user mode register R15. */
+	ERegisterCpsr = 0x00001000,    /**< Identifier for CPSR. */
+	ERegisterR13Svc = 0x00001100,  /**< Identifier for R13 supervisor mode banked register. */
+	ERegisterR14Svc = 0x00001200,  /**< Identifier for R14 supervisor mode banked register. */
+	ERegisterSpsrSvc = 0x00001300, /**< Identifier for SPSR supervisor mode banked register. */
+	ERegisterR13Abt = 0x00001400,  /**< Identifier for R13 Abort mode banked register. */
+	ERegisterR14Abt = 0x00001500,  /**< Identifier for R14 Abort mode banked register. */
+	ERegisterSpsrAbt = 0x00001600, /**< Identifier for SPSR Abort mode banked register. */
+	ERegisterR13Und = 0x00001700,  /**< Identifier for R13 Undefined mode banked register. */
+	ERegisterR14Und = 0x00001800,  /**< Identifier for R14 Undefined mode banked register. */
+	ERegisterSpsrUnd = 0x00001900, /**< Identifier for SPSR Undefined mode banked register. */
+	ERegisterR13Irq = 0x00001a00,  /**< Identifier for R13 Interrupt mode banked register. */
+	ERegisterR14Irq = 0x00001b00,  /**< Identifier for R14 Interrupt mode banked register. */
+	ERegisterSpsrIrq = 0x00001c00, /**< Identifier for SPSR Interrupt mode banked register. */
+	ERegisterR8Fiq = 0x00001d00,   /**< Identifier for R8 Fast Interrupt mode banked register. */
+	ERegisterR9Fiq = 0x00001e00,   /**< Identifier for R9 Fast Interrupt mode banked register. */
+	ERegisterR10Fiq = 0x00001f00,  /**< Identifier for R10 Fast Interrupt mode banked register. */
+	ERegisterR11Fiq = 0x00002000,  /**< Identifier for R11 Fast Interrupt mode banked register. */
+	ERegisterR12Fiq = 0x00002100,  /**< Identifier for R12 Fast Interrupt mode banked register. */
+	ERegisterR13Fiq = 0x00002200,  /**< Identifier for R13 Fast Interrupt mode banked register. */
+	ERegisterR14Fiq = 0x00002300,  /**< Identifier for R14 Fast Interrupt mode banked register. */
+	ERegisterSpsrFiq = 0x00002400, /**< Identifier for SPSR Fast Interrupt mode banked register. */
+	/**
+	  @internalTechnology
+	  A debug agent should find the number of core registers from the DFBlock rather than this enumerator.
+	  */
+	ERegisterLast = 37
+};
+
+
+/**
+  These tags define the kind of breakpoints that are supported.
+  TTag structures associated with the ETagHeaderIdBreakpoints sub-block will have iTagId values from this enumeration.
+  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
+ */
+enum TFunctionalityBreakpoint
+{
+	EBreakpointThread = 0,         /**< Indicates whether thread specific breakpoints are supported. */
+	EBreakpointProcess = 1,        /**< Indicates whether process specific breakpoints are supported. */
+	EBreakpointSystem = 2,         /**< Indicates whether system wide breakpoints are supported. */
+	EBreakpointArm = 3,            /**< Indicates whether ARM mode breakpoints are supported. */
+	EBreakpointThumb = 4,          /**< Indicates whether Thumb mode breakpoints are supported. */
+	EBreakpointT2EE = 5,           /**< Indicates whether Thumb2 mode breakpoints are supported. */
+	EBreakpointArmInst = 6,        /**< Reserved for future use. */
+	EBreakpointThumbInst = 7,      /**< Reserved for future use. */
+	EBreakpointT2EEInst = 8,       /**< Reserved for future use. */
+	EBreakpointSetArmInst = 9,     /**< Reserved for future use. */
+	EBreakpointSetThumbInst = 10,  /**< Reserved for future use. */
+	EBreakpointSetT2EEInst = 11,   /**< Reserved for future use. */
+	/**
+	  @internalTechnology
+	  A debug agent should find the number of breakpoint tags from the DFBlock rather than this enumerator.
+	  */
+	EBreakpointLast
+};
+
+/**
+  These enumerators provide information about the stepping capabilities of the debug sub-system.
+  TTag structures associated with the ETagHeaderIdStepping sub-block will have iTagId values from this enumeration.
+  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
+ */
+enum TFunctionalityStep
+{
+	EStep = 0, /**< Indicates whether instruction stepping is supported. */
+	/**
+	  @internalTechnology
+	  A debug agent should find the number of stepping tags from the DFBlock rather than this enumerator.
+	  */
+	EStepLast
+};
+
+/**
+  These enumerators provide information about the execution control capabilities of the debug sub-system.
+  TTag structures associated with the ETagHeaderIdExecution sub-block will have iTagId values from this enumeration.
+  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
+ */
+enum TFunctionalityExec
+{
+	EExecThreadSuspendResume = 0,  /**< Indicates whether suspending and resuming threads is supported. */
+	EExecProcessSuspendResume = 1, /**< Indicates whether suspending and resuming processes is supported. */
+	EExecSystemSuspendResume = 2,  /**< Indicates whether suspending and resuming the entire system is supported. */
+	/**
+	  @internalTechnology
+	  A debug agent should find the number of execution control tags from the DFBlock rather than this enumerator.
+	  */
+	EExecLast
+};
+
+/**
+  This enumeration defines the event types supported by the debug sub-system.
+  TTag structures associated with the ETagHeaderIdEvents sub-block will have
+  iTagId values from this enumeration, and iValue values from the TKernelEventAction enumeration.
+
+  These enumerators are also used by the RSecuritySvrSession API to identify events.
+  @see RSecuritySvrSession
+  @see TKernelEventAction
+ */
+enum TEventType
+{
+	EEventsBreakPoint = 0,    /**< Identifies a breakpoint event. */
+	EEventsSwExc = 1,         /**< Identifies a software exception event. */
+	EEventsHwExc = 2,         /**< Identifies a hardware exception event. */
+	EEventsKillThread = 3,    /**< Identifies a kill thread event. */
+	EEventsAddLibrary = 4,    /**< Identifies an add library event. */
+	EEventsRemoveLibrary = 5, /**< Identifies a remove library event. */
+	/**
+	 If an event is generated and there is only a single space remaining in the events queue then
+	 an event of type EEventsBufferFull will be stored in the queue and the generated event will
+	 be discarded. If further events occur while the buffer is full the events will be discarded.
+	 As such an event of type EEventsBufferFull being returned signifies that one or more events
+	 were discarded. An event of this type has no valid data associated with it.
+	 */
+	EEventsBufferFull = 6,
+	EEventsUnknown = 7,       /**< Identifies an event of unknown type. */
+	EEventsUserTrace = 8,     /**< Identifies a user trace. */
+	EEventsProcessBreakPoint = 9, /**< Identifies a process breakpoint event. */
+	EEventsStartThread = 10, /**< Identifies a start thread event. */
+	EEventsUserTracesLost = 11, /**< Identifies user traces being lost. */
+	EEventsAddProcess = 12, /**< Identifies an AddProcess event */
+	EEventsRemoveProcess = 13, /**< Identifies a RemoveProcess event */
+	/**
+	  @internalTechnology
+	  A debug agent should find the number of event types from the DFBlock rather than this enumerator.
+	  */
+	EEventsLast
+};
+
+/**
+  These enumerators provide information about constants which are used in the RSecuritySvrSession API.
+  TTag structures associated with the ETagHeaderIdApiConstants sub-block will have iTagId values from this enumeration.
+  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
+ */
+enum TFunctionalityApiConstants
+	{
+	/**
+	  Corresponds to the size of a buffer required to store a TEventInfo.
+	  @see TEventInfo
+	  */
+	EApiConstantsTEventInfoSize = 0,
+	/**
+	  @internalTechnology
+	  A debug agent should find the number of API constants tags from the DFBlock rather than this enumerator.
+	  */
+	EApiConstantsLast,
+	};
+
+/**
+  The set of possible actions which could be taken when a kernel event occurs.
+  Not all actions are possible for all events. The debug functionality sub-block with header id ETagHeaderIdEvents
+  indicates which values are permitted for each event. The value given for that event should be
+  considered as the most intrusive action the debugger may set: with the definition that EActionSuspend is more
+  intrusive than EActionContinue, which is more intrusive than EActionIgnore.
+  @see RSecuritySvrSession
+  */
+enum TKernelEventAction
+{
+	/** If an event action is set to this value then events of that type will be
+	  ignored, and not reported to the debugger. */
+	EActionIgnore = 0,
+	/** If an event action is set to this value then events of that type will be
+	  reported to the debugger and the thread which generated the event will be
+	  allowed to continue executing. */
+	EActionContinue = 1,
+	/** If an event action is set to this value then events of that type will be
+	  reported to the debugger and the thread which generated the event will be
+	  suspended. */
+	EActionSuspend = 2,
+	/**
+	  @internalTechnology
+	  Count of event actions.
+	  */
+	EActionLast
+};
+
+/**
+  These enumerators provide information about the ability of the debug subsystem to support OEM Debug tokens.
+  TTag structures associated with the ETagHeaderIdSecurity sub-block will have iTagId values from this enumeration.
+  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
+ */
+enum TFunctionalitySecurity
+{
+	ESecurityOEMDebugToken = 0,  /**< Indicates whether the DSS supports the use of OEM Debug Tokens. */
+
+	/**
+	  @internalTechnology
+	  A debug agent should find the number of tags from the DFBlock rather than this enumerator.
+	  */
+	ESecurityLast
+};
+
+/**
+  Used for storing the contents of a 32 bit register
+  */
+typedef TUint32 TRegisterValue32;
+
+
+/**
+ * Processor mode
+ */
+enum TArmProcessorModes
+{
+	EUserMode=0x10,    	//!< EUserMode
+    EFiqMode=0x11,  	//!< EFiqMode
+    EIrqMode=0x12,  	//!< EIrqMode
+    ESvcMode=0x13,  	//!< ESvcMode
+    EAbortMode=0x17,	//!< EAbortMode
+    EUndefMode=0x1b,	//!< EUndefMode
+    EMaskMode=0x1f  	//!< EMaskMode
+};
+
+
+
+/**
+  Structure containing information about the state of the registers when a
+  hardware exception occurred
+  */
+class TRmdArmExcInfo
+	{
+public:
+	/** Enumeration detailing the types of exception which may occur. */
+	enum TExceptionType
+		{
+		/** Enumerator signifying that a prefetch abort error has occurred. */
+		EPrefetchAbort = 0,
+		/** Enumerator signifying that a data abort error has occurred. */
+		EDataAbort = 1,
+		/** Enumerator signifying that an undefined instruction error has occurred. */
+		EUndef =2
+		};
+
+	/** Value of CPSR. */
+	TRegisterValue32 iCpsr;
+	/** Type of exception which has occurred. */
+	TExceptionType iExcCode;
+	/** Value of R13 supervisor mode banked register. */
+	TRegisterValue32 iR13Svc;
+	/** Value of user mode register R4. */
+	TRegisterValue32 iR4;
+	/** Value of user mode register R5. */
+	TRegisterValue32 iR5;
+	/** Value of user mode register R6. */
+	TRegisterValue32 iR6;
+	/** Value of user mode register R7. */
+	TRegisterValue32 iR7;
+	/** Value of user mode register R8. */
+	TRegisterValue32 iR8;
+	/** Value of user mode register R9. */
+	TRegisterValue32 iR9;
+	/** Value of user mode register R10. */
+	TRegisterValue32 iR10;
+	/** Value of user mode register R11. */
+	TRegisterValue32 iR11;
+	/** Value of R14 supervisor mode banked register. */
+	TRegisterValue32 iR14Svc;
+	/** Address which caused exception (System Control Coprocessor Fault Address Register) */
+	TRegisterValue32 iFaultAddress;
+	/** Value of System Control Coprocessor Fault Status Register. */
+	TRegisterValue32 iFaultStatus;
+	/** Value of SPSR supervisor mode banked register. */
+	TRegisterValue32 iSpsrSvc;
+	/** Value of user mode register R13. */
+	TRegisterValue32 iR13;
+	/** Value of user mode register R14. */
+	TRegisterValue32 iR14;
+	/** Value of user mode register R0. */
+	TRegisterValue32 iR0;
+	/** Value of user mode register R1. */
+	TRegisterValue32 iR1;
+	/** Value of user mode register R2. */
+	TRegisterValue32 iR2;
+	/** Value of user mode register R3. */
+	TRegisterValue32 iR3;
+	/** Value of user mode register R12. */
+	TRegisterValue32 iR12;
+	/** Value of user mode register R15, points to instruction which caused exception. */
+	TRegisterValue32 iR15;
+	};
+
+/**
+  The maximum size, in bytes, of the panic category string returned as part of a
+  TEventInfo object.
+
+  @see TEventInfo
+  @see TThreadKillInfo
+  */
+const TInt KPanicCategoryMaxName = KMaxName;
+
+/**
+  Event specific information returned as part of a TEventInfo object when
+  an agent set breakpoint is hit.
+  */
+class TThreadBreakPointInfo
+	{
+public:
+	/** Identifies the type of exception. */
+	TExcType iExceptionNumber;
+	/** Structure containing information about the ARM register values. */
+	TRmdArmExcInfo iRmdArmExcInfo;
+	};
+
+/**
+  Event specific information returned as part of a TEventInfo object when
+  a software exception occurs.
+  */
+class TThreadSwExceptionInfo
+	{
+public:
+	/** The value of the program counter. */
+	TUint32 iCurrentPC;
+	/** Identifies the type of exception. */
+	TExcType iExceptionNumber;
+	};
+
+/**
+  Event specific information returned as part of a TEventInfo object when
+  a hardware exception occurs.
+  */
+class TThreadHwExceptionInfo
+	{
+public:
+	/** Identifies the type of exception. */
+	TExcType iExceptionNumber;
+	/** Structure containing information about the ARM register values. */
+	TRmdArmExcInfo iRmdArmExcInfo;
+	};
+
+/**
+  Event specific information returned as part of a TEventInfo object when
+  a thread kill event occurs.
+  */
+class TThreadKillInfo
+	{
+public:
+	/** The value of the program counter. */
+	TUint32 iCurrentPC;
+	/** Specifies the reason for the kill thread event, this value is specific to the killed thread and does not correspond to a standard Symbian enumeration. */
+	TInt iExitReason;
+	/** Specifies the type of the thread kill event, values correspond to elements of TExitType. */
+	TUint8 iExitType;
+	/** The panic category of the killed thread. */
+	TUint8 iPanicCategory[KPanicCategoryMaxName];
+	/** Contains the length in bytes of the initialised data in iPanicCategory. */
+	TInt iPanicCategoryLength;
+	};
+
+/**
+  Event specific information returned as part of a TEventInfo object when
+  a library load event occurs.
+  */
+class TLibraryLoadedInfo
+	{
+public:
+	/** The name of the file that the library was loaded from. */
+	TUint8 iFileName[KMaxName];
+	/** Contains the length in bytes of the initialised data in iFileName. */
+	TInt iFileNameLength;
+	/** The code base address (.text). */
+	TUint32 iCodeAddress;
+	/** The base address of the initialised data section (.data). */
+	TUint32 iDataAddress;
+	};
+
+/**
+  Event specific information returned as part of a TEventInfo object when
+  a thread is started
+  */
+class TStartThreadInfo
+	{
+public:
+	/** The name of the file that the process owning the thread was created from. */
+	TUint8 iFileName[KMaxName];
+	/** Contains the length in bytes of the initialised data in iFileName. */
+	TInt iFileNameLength;
+	};
+
+/**
+  Event specific information returned as part of a TEventInfo object when
+  a process is added. Note that the Process may not be fully constructed,
+  e.g. no threads.
+  */
+class TAddProcessInfo
+	{
+public:
+	/** The name of the file that the process was created from. */
+	TUint8 iFileName[KMaxName];
+	/** Contains the length in bytes of the initialised data in iFileName. */
+	TInt iFileNameLength;
+	/** The UID3 of this process */
+	TUint32 iUid3;  
+	/** Contains the CreatorThread ID if available: May be 0 */
+	TUint64 iCreatorThreadId;  
+	};
+
+/**
+  Event specific information returned as part of a TEventInfo object when
+  a process is removed. Note that the Process may not be fully destroyed,
+  so its resources should only be accessed if you already have a handle to it.
+  */
+class TRemoveProcessInfo
+	{
+public:
+	/** The name of the file that the process was created from. */
+	TUint8 iFileName[KMaxName];
+	/** Contains the length in bytes of the initialised data in iFileName. */
+	TInt iFileNameLength;
+	TUint32 iSpare1;	// Unused
+	};
+
+/**
+  Event specific information returned as part of a TEventInfo object when
+  a library unload event occurs.
+  */
+class TLibraryUnloadedInfo
+	{
+public:
+	/** The name of the file that the library was loaded from. */
+	TUint8 iFileName[KMaxName];
+	/** Contains the length in bytes of the initialised data in iFileName. */
+	TInt iFileNameLength;
+	};
+
+/**
+ * Enum to represent the context of a user trace message
+ */ 
+enum TUserTraceMessageContext 
+{
+	ESingleMessage = 0x1,   /** Indicates this message is the only one corresponding to a given user trace */ 
+	EMultiStart = 0x2, /** Indicates this message is the start of a user trace which consists of multiple messages */
+	EMultiMid = 0x3, /** Indicates this message is one in a series of user trace messages */
+	EMultiEnd = 0x4, /** Indicates this message is the last in a series of user trace messages */
+	/**
+	  @internalTechnology
+	  A debug agent should find the number of core tags from the DFBlock rather than this enumerator.
+	  */
+	ELast = 0x5	
+};
+	
+/**
+ *   Event specific information returned as part of a TEventInfo object 
+ *   when a user trace event occurs.
+ */
+class TUserTraceInfo
+	{
+public:
+	/** The user trace text */
+	TUint8 iUserTraceText[TUserTraceSize];
+	
+	/** User trace text length */
+	TInt iUserTraceLength;
+	
+	/** The context of the message */
+	TUserTraceMessageContext iMessageStatus;
+	};
+	
+	
+/**
+  Structure used to store information about an event. An object of this type
+  is passed as an argument to the RSecuritySvrSession::GetEvent function,
+  and is filled in by the debug driver, and returned to the agent, when a
+  relevant event occurs.
+
+  The debug functionality block contains the size in bytes of the data that
+  the driver will return when a GetEvent call is issued. A debug agent should
+  ensure that this value equals the size of this TEventInfo object to ensure
+  that a compatible debug driver is being used. The value is stored as
+  EApiConstantsTEventInfoSize in the TFunctionalityApiConstants block.
+
+  @see RSecuritySvrSession::GetDebugFunctionality
+  @see RSecuritySvrSession::GetEvent
+  */
+class TEventInfo
+	{
+public:
+
+	/** Constructor sets all elements to default values. */
+	inline TEventInfo() { Reset(); };
+
+	/** Resets all values to default values. */
+	inline void Reset()
+		{
+		iProcessId = 0;
+		iProcessIdValid = EFalse;
+		iThreadId = 0;
+		iThreadIdValid = EFalse;
+		iEventType = (TEventType)NULL;
+		};
+
+public:
+
+	/** The process ID of the process which the event occurred in. */
+	TUint64 				iProcessId;
+	/** The thread ID of the thread which the event occurred in. */
+	TUint64 				iThreadId;
+	/** Has value ETrue if iProcessId is valid, EFalse otherwise. */
+	TUint8					iProcessIdValid;
+	/** Has value ETrue if iThreadId is valid, EFalse otherwise. */
+	TUint8					iThreadIdValid;
+	/** Indicates the type of the event. This type should be used to determine
+	    the type of the information stored in the union which is part of this class. */
+	TEventType				iEventType;
+	union
+		{
+		/** Information which is specific to the break point event. */
+		TThreadBreakPointInfo iThreadBreakPointInfo;
+		/** Information which is specific to the software exception event. */
+		TThreadSwExceptionInfo iThreadSwExceptionInfo;
+		/** Information which is specific to the hardware exception event. */
+		TThreadHwExceptionInfo iThreadHwExceptionInfo;
+		/** Information which is specific to the thread kill event. */
+		TThreadKillInfo iThreadKillInfo;
+		/** Information which is specific to the library loaded event. */
+		TLibraryLoadedInfo iLibraryLoadedInfo;
+		/** Information which is specific to the library unloaded event. */
+		TLibraryUnloadedInfo iLibraryUnloadedInfo;
+		/** Information which is specific to the user trace event. */
+		TUserTraceInfo iUserTraceInfo;
+		/** Information which is specific to the start thread event. */
+		TStartThreadInfo iStartThreadInfo;
+		/** Information which is specific to the Add Process event. */
+		TAddProcessInfo iAddProcessInfo;
+		/** Information which is specific to the Remove Process event. */
+		TRemoveProcessInfo iRemoveProcessInfo;
+		};
+	};
+
+/**
+  @internalComponent
+  */
+class TProcessInfo
+	{
+	public:
+
+		inline TProcessInfo() { Reset(); }
+
+		inline TProcessInfo(TUint32 aId, TUint32 aCodeAddress, TUint32 aCodeSize, TUint32 aDataAddress)
+				: iId(aId),
+				  iCodeAddress(aCodeAddress),
+				  iCodeSize(aCodeSize),
+				  iDataAddress(aDataAddress) { }
+
+		inline void Reset()
+			{
+			iId = 0;
+			iCodeAddress = 0;
+			iCodeSize = 0;
+			iDataAddress = 0;
+			}
+
+	public:
+
+		TUint32 iId;
+		TUint32 iCodeAddress;
+		TUint32 iCodeSize;
+		TUint32 iDataAddress;
+	};
+
+/* Other functionality may be defined here later */
+
+/**
+Represents a register id value, in the terms of the Symbian ELF format:
+ - bits 0-7 define the class
+ - bits 8-15 define the rd_id
+ - bits 16-31 define the rd_sub_id
+
+Both the core registers (TFunctionalityRegister type) and the coprocessor registers
+follow this identifier scheme.
+*/
+typedef TUint32 TRegisterInfo;
+
+/**
+Enum representing the status flags which could be returned from a register
+access call.
+*/
+enum TRegisterFlag
+	{
+	/**
+	Default value, a register access call will never return this value
+	*/
+	ENotSet = 0,
+	/**
+	Would be returned if the register is supported by the debug driver but the kernel cannot access the register
+	*/
+	EInValid = 1,
+	/**
+	Would be returned if the register could be accessed correctly
+	*/
+	EValid = 2,
+	/**
+	Would be returned if the register is not supported by the debug driver
+	*/
+	ENotSupported = 3,
+	/**
+	Would be returned if a non-4 byte register value was requested
+	*/
+	EBadSize = 4
+	};
+
+/**
+Enum representing the different ARM CPU instruction set architectures.
+*/
+enum TArchitectureMode
+	{
+	/** Represents the ARM CPU architecture. */
+	EArmMode = 1,
+	/** Represents the Thumb CPU architecture. */
+	EThumbMode = 2,
+	/**
+	  Represents the Thumb2 CPU architecture.
+	  @prototype
+	  */
+	EThumb2EEMode = 3
+	};
+
+/**
+  Used as an identifier for breakpoints set by the RSecuritySvrSession::SetBreak function.
+  @see RSecuritySvrSession
+  */
+typedef TInt32 TBreakId;
+
+/**
+  Specifies the type of a code segment.
+  @see TCodeSegListEntry
+  */
+enum TCodeSegType
+	{
+	EUnknownCodeSegType = 0, /**< Signifies an unknown code segment type. */
+	EExeCodeSegType = 1,     /**< Signifies a code segment belonging to an executable. */
+	EDllCodeSegType = 2      /**< Signifies a code segment belonging to a library. */
+	};
+
+/**
+Structure used for extracting data from a descriptor returned by a call to
+RSecuritySvrSession::GetList() when GetList() is called with TListId::ECodeSegs
+as the first argument.
+
+@see RSecuritySvrSession::GetList()
+
+@code
+//buffer is a TDesC8 containing 4-byte aligned TCodeSegListEntry objects
+//create a pointer to the start of the data
+TUint8* ptr = (TUint8*)buffer.Ptr();
+//create a pointer to the end of the data
+const TUint8* ptrEnd = ptr + buffer.Length();
+while(ptr < ptrEnd)
+	{
+	//cast the pointer to be a TCodeSegListEntry object
+	TCodeSegListEntry& entry = *(TCodeSegListEntry*)ptr;
+	//use the TCodeSegListEntry pointer, i.e.
+	TUint16 nameLength = entry.iNameLength;
+	TPtr name(&(entry.iName[0]), nameLength, nameLength);
+	// move ptr on to point to the next TCodeSegListEntry object
+	ptr += Align4(entry.GetSize());
+	}
+@endcode
+*/
+class TCodeSegListEntry
+	{
+public:
+	TInt GetSize() const;
+public:
+	/**
+	  Address of the start of the code segment.
+	  */
+	TUint32 iCodeBase;
+	/**
+	  Size of the code segment.
+	  */
+	TUint32 iCodeSize;
+	/**
+	  Size of the const data segment
+	  */
+	TUint32 iConstDataSize;
+	/**
+	  Address of the initialised data
+	  */
+	TUint32 iInitialisedDataBase;
+	/**
+	  Size of the initialised data
+	  */
+	TUint32 iInitialisedDataSize;
+	/**
+	  Size of the uninitialised data
+	  */
+	TUint32 iUninitialisedDataSize;
+	/**
+	  Boolean indicating whether the code segment is execute in place
+	  */
+	TBool iIsXip;
+	/**
+	  Indicates whether the code segment is from an executable or a dll, or neither
+	  */
+	TCodeSegType iCodeSegType;
+	/** Uid3 of this segment. */
+	TUint32 iUid3;
+	/** Currently unused element. May be used in future to aid maintaining compatibility. */
+	TUint32 iSpare2;
+	/**
+	  Length of the code segment's name
+	  */
+	TUint16 iNameLength;
+	/**
+	  First two bytes of the code segment's name, the name should be considered to
+	  extend past the end of the TCodeSegListEntry structure to a length
+	  corresponding to iNameLength
+	  */
+	TUint16 iName[1];
+	};
+
+/**
+Returns the size of the TCodeSegListEntry, including the file name length
+
+@return the size, in bytes, of the TCodeSegListEntry and the code segment's
+file name
+*/
+inline TInt TCodeSegListEntry::GetSize() const
+	{
+	return sizeof(TCodeSegListEntry) - sizeof(iName) + (2 * iNameLength);
+	}
+
+/**
+Structure used for extracting data from a descriptor returned by a call to
+RSecuritySvrSession::GetList() when GetList() is called with TListId::EXipLibraries
+as the first argument.
+
+@see RSecuritySvrSession::GetList()
+
+@code
+//buffer is a TDesC8 containing 4-byte aligned TXipLibraryListEntry objects
+//create a pointer to the start of the data
+TUint8* ptr = (TUint8*)buffer.Ptr();
+//create a pointer to the end of the data
+const TUint8* ptrEnd = ptr + buffer.Length();
+while(ptr < ptrEnd)
+	{
+	//cast the pointer to be a TXipLibraryListEntry object
+	TXipLibraryListEntry& entry = *(TXipLibraryListEntry*)ptr;
+	//use the TXipLibraryListEntry pointer, i.e.
+	TUint16 nameLength = entry.iNameLength;
+	TPtr name(&(entry.iName[0]), nameLength, nameLength);
+	// move ptr on to point to the next TXipLibraryListEntry object
+	ptr += Align4(entry.GetSize());
+	}
+@endcode
+*/
+class TXipLibraryListEntry
+	{
+public:
+	TInt GetSize() const;
+public:
+	/**
+	  Address of the start of the library's code segment.
+	  */
+	TUint32 iCodeBase;
+	/**
+	  Size of the code segment.
+	  */
+	TUint32 iCodeSize;
+	/**
+	  Size of the const data segment
+	  */
+	TUint32 iConstDataSize;
+	/**
+	  Address of the initialised data
+	  */
+	TUint32 iInitialisedDataBase;
+	/**
+	  Size of the initialised data
+	  */
+	TUint32 iInitialisedDataSize;
+	/**
+	  Size of the uninitialised data
+	  */
+	TUint32 iUninitialisedDataSize;
+	/** Currently unused element. May be used in future to aid maintaining compatibility. */
+	TUint32 iSpare1;
+	/** Currently unused element. May be used in future to aid maintaining compatibility. */
+	TUint32 iSpare2;
+	/**
+	  Length of the library's name
+	  */
+	TUint16 iNameLength;
+	/**
+	  First two bytes of the code segment's name, the name should be considered to
+	  extend past the end of the TXipLibraryListEntry structure to a length
+	  corresponding to iNameLength
+	  */
+	TUint16 iName[1];
+	};
+
+/**
+Returns the size of the TXipLibraryListEntry, including the file name length
+
+@return the size, in bytes, of the TXipLibraryListEntry and the library's
+file name
+*/
+inline TInt TXipLibraryListEntry::GetSize() const
+	{
+	return sizeof(TXipLibraryListEntry) - sizeof(iName) + (2 * iNameLength);
+	}
+
+/**
+Structure used for extracting data from a descriptor returned by a call to
+RSecuritySvrSession::GetList() when GetList() is called with TListId::EExecutables
+as the first argument.
+
+@see RSecuritySvrSession::GetList()
+
+@code
+//buffer is a TDesC8 containing 4-byte aligned TExecutablesListEntry objects
+//create a pointer to the start of the data
+TUint8* ptr = (TUint8*)buffer.Ptr();
+//create a pointer to the end of the data
+const TUint8* ptrEnd = ptr + buffer.Length();
+while(ptr < ptrEnd)
+	{
+	//cast the pointer to be a TExecutablesListEntry object
+	TExecutablesListEntry& entry = *(TExecutablesListEntry*)ptr;
+	//use the TExecutablesListEntry pointer, i.e.
+	TUint16 nameLength = entry.iNameLength;
+	TPtr name(&(entry.iName[0]), nameLength, nameLength);
+	// move ptr on to point to the next TExecutablesListEntry object
+	ptr += Align4(entry.GetSize());
+	}
+@endcode
+*/
+class TExecutablesListEntry
+	{
+public:
+	TInt GetSize() const;
+public:
+	/**
+	  Indicates whether an agent has registered to actively debug the executable,
+	  a non-zero value indicates that an agent has attached.
+	  */
+	TUint8 iIsActivelyDebugged;
+	/**
+	  Indicates whether any agents have registered to passively debug the executable,
+	  a non-zero value indicates that at least one agent is attached passively
+	  */
+	TUint8 iIsPassivelyDebugged;
+	/** Currently unused element. May be used in future to aid maintaining compatibility. */
+	TUint32 iSpare1;
+	/** Currently unused element. May be used in future to aid maintaining compatibility. */
+	TUint32 iSpare2;
+	/**
+	  Length of the executable's name
+	  */
+	TUint16 iNameLength;
+	/**
+	  First two bytes of the executable's name, the name should be considered to
+	  extend past the end of the TExecutablesListEntry structure to a length
+	  corresponding to iNameLength
+	  */
+	TUint16 iName[1];
+	};
+
+/**
+Returns the size of the TExecutablesListEntry, including the file name length
+
+@return the size, in bytes, of the TExecutablesListEntry and the executable's
+file name
+*/
+inline TInt TExecutablesListEntry::GetSize() const
+	{
+	return sizeof(TExecutablesListEntry) - sizeof(iName) + (2*iNameLength);
+	}
+
+/**
+Structure used for extracting data from a descriptor returned by a call to
+RSecuritySvrSession::GetList() when GetList() is called with TListId::EProcesses
+as the first argument.
+
+@see RSecuritySvrSession::GetList()
+
+@code
+//buffer is a TDesC8 containing 4-byte aligned TProcessListEntry objects
+//create a pointer to the start of the data
+TUint8* ptr = (TUint8*)buffer.Ptr();
+//create a pointer to the end of the data
+const TUint8* ptrEnd = ptr + buffer.Length();
+while(ptr < ptrEnd)
+	{
+	//cast the pointer to be a TProcessListEntry object
+	TProcessListEntry& entry = *(TProcessListEntry*)ptr;
+	//use the TProcessListEntry pointer, i.e.
+	TUint16 fileNameLength = entry.iFileNameLength;
+	TPtr name(&(entry.iNames[0]), fileNameLength, fileNameLength);
+	// move ptr on to point to the next TProcessListEntry object
+	ptr += Align4(entry.GetSize());
+	}
+@endcode
+*/
+class TProcessListEntry
+	{
+	public:
+		TInt GetSize() const;
+
+	public:
+		/** Process ID */
+		TUint64 iProcessId;
+
+		/** The Uid3 of the process */
+		TUint32 iUid3;
+
+		/** 
+		 * Process Attributes
+		 * @see DProcess::TProcessAttributes
+		 */
+		TInt iAttributes;
+
+		/**
+		 * Length of fully qualified file name of the process in bytes. Note that this
+		 * entry may be 0 if the process is in the process of shutting down.
+		 */
+		TUint16 iFileNameLength;
+
+		/**
+		 * Length of current dynamic name of the process in bytes
+		 */
+		TUint16 iDynamicNameLength;
+
+		/**
+		 * First two bytes of the process' file name, the name should be considered to
+		 * extend past the end of the TProcessListEntry structure to a length
+		 * corresponding to iFileNameLength. Directly after the data corresponding to the
+		 * file name, the dynamic name is stored with a length of iDynamicNameLength characters.
+		 * Note that these names are not null terminated and are concatenated directly after each other.
+		 * 
+		 * @code
+		 * TProcessListEntry& entry; // entry is a reference to a TProcessListEntry
+		 *
+		 * //get the file name..
+		 * TPtr fileName(&(entry.iNames[0]), iFileNameLength, iFileNameLength);
+		 *
+		 * //get the dynamic name length..
+		 * TPtr dynamicName(&(entry.iNames[0]) + iFileNameLength, iDynamicNameLength, iDynamicNameLength);
+		 * @endcode
+		 */
+		TUint16 iNames[1];
+	};
+
+/**
+Returns the size of the TProcessListEntry, including the file name length and the
+dynamic name length
+
+@return the size, in bytes, of the TProcessListEntry and the executable's
+file name file name and dynamic name
+*/
+inline TInt TProcessListEntry::GetSize() const
+	{
+	return sizeof(TProcessListEntry) - sizeof(iNames) + (2 * (iFileNameLength + iDynamicNameLength));
+	}
+
+/**
+Structure used for extracting data from a descriptor returned by a call to
+RSecuritySvrSession::GetList() when GetList() is called with TListId::EThreads
+as the first argument.
+
+@see RSecuritySvrSession::GetList()
+
+@code
+//buffer is a TDesC8 containing 4-byte aligned TThreadListEntry objects
+//create a pointer to the start of the data
+TUint8* ptr = (TUint8*)buffer.Ptr();
+//create a pointer to the end of the data
+const TUint8* ptrEnd = ptr + buffer.Length();
+while(ptr < ptrEnd)
+	{
+	//cast the pointer to be a TThreadListEntry object
+	TThreadListEntry& entry = *(TThreadListEntry*)ptr;
+	//use the TThreadListEntry pointer, i.e.
+	TUint16 nameLength = entry.iNameLength;
+	TPtr name(&(entry.iName[0]), nameLength, nameLength);
+	// move ptr on to point to the next TThreadListEntry object
+	ptr += Align4(entry.GetSize());
+	}
+@endcode
+*/
+class TThreadListEntry
+	{
+public:
+	TInt GetSize() const;
+public:
+	/**
+	  Thread ID
+	  */
+	TUint64 iThreadId;
+	/**
+	  Process ID
+	  */
+	TUint64 iProcessId;
+	/**
+	  Address of the base of the supervisor stack
+	  */
+	TUint32 iSupervisorStackBase;
+	/**
+	  Size of the supervisor stack
+	  */
+	TUint32 iSupervisorStackSize;
+	/**
+	  Non-zero if iSupervisorStackBase has been set correctly
+	  */
+	TUint8 iSupervisorStackBaseValid;
+	/**
+	  Non-zero if iSupervisorStackSize has been set correctly
+	  */
+	TUint8 iSupervisorStackSizeValid;
+	/**
+	  Address of the thread's supervisor stack pointer
+	  */
+	TUint32 iSupervisorStackPtr;
+	/**
+	  Indicator of whether the value returned as iSupervisorStackPtr is valid.
+	  It is necessary, but not necessarily sufficient, that the thread be suspended
+	  for a valid value to be returned. This may be removed from the final API and
+	  the value would be extracted instead via the ReadRegisters type calls.
+	  */
+	TRegisterFlag iSupervisorStackPtrValid;
+	/** Currently unused element. May be used in future to aid maintaining compatibility. */
+	TUint32 iSpare1;
+	/** Currently unused element. May be used in future to aid maintaining compatibility. */
+	TUint32 iSpare2;
+	/**
+	  The length of the thread's name
+	  */
+	TUint16 iNameLength;
+	/**
+	  First two bytes of the thread's name, the name should be considered to
+	  extend past the end of the TThreadListEntry structure to a length
+	  corresponding to iNameLength
+	  */
+	TUint16 iName[1];
+	};
+
+/**
+Returns the size of the TThreadListEntry, including the name length
+
+@return the size, in bytes, of the TExecutablesListEntry and the thread's name
+*/
+inline TInt TThreadListEntry::GetSize() const
+	{
+	return sizeof(TThreadListEntry) - sizeof(iName) + (2 * iNameLength);
+	}
+
+/**
+Denotes which list type to return from a RSecuritySvrSession::GetList() call
+
+@see RSecuritySvrSession::GetList()
+*/
+enum TListId
+	{
+	/**
+	Indicates that the GetList() call should return a list of the processes in
+	the system. The returned buffer will contain an array of 4-byte aligned
+	TProcessListEntry objects.
+
+	@see TProcessListEntry
+	*/
+	EProcesses = 0,
+	/**
+	Indicates that the GetList() call should return a list of the threads in
+	the system. The returned buffer will contain an array of 4-byte aligned
+	TThreadListEntry objects.
+
+	@see TThreadListEntry
+	*/
+	EThreads = 1,
+	/**
+	Indicates that the GetList() call should return a list of the code segments in
+	the system. The returned buffer will contain an array of 4-byte aligned
+	TCodeSegListEntry objects.
+
+	@see TCodeSegListEntry
+	*/
+	ECodeSegs = 2,
+	/**
+	Indicates that the GetList() call should return a list of the XIP libraries in
+	the system. The returned buffer will contain an array of 4-byte aligned
+	EXipLibraries objects.
+
+	@see EXipLibraries
+	*/
+	EXipLibraries = 3,
+	/**
+	Indicates that the GetList() call should return a list of the executables in
+	the system. The returned buffer will contain an array of 4-byte aligned
+	EExecutables objects.
+
+	@see EExecutables
+	*/
+	EExecutables = 4,
+	/**
+	Indicates that the GetList() call should return a list of the logical devices in the system.
+	*/
+	ELogicalDevices = 5,
+	/**
+	Indicates that the GetList() call should return a list of the mutexes in the system.
+	*/
+	EMutexes = 6,
+	/**
+	Indicates that the GetList() call should return a list of the servers in the system.
+	*/
+	EServers = 7,
+	/**
+	Indicates that the GetList() call should return a list of the sessions in the system.
+	*/
+	ESessions = 8,
+	/**
+	Indicates that the GetList() call should return a list of the semaphores in the system.
+	*/
+	ESemaphores = 9,
+	/**
+	Indicates that the GetList() call should return a list of the chunks in the system.
+	*/
+	EChunks = 10,
+
+	/**
+	Provides a complete list of all the breakpoints in the system and their
+	current state.
+
+	@see EBreakpoints
+	*/
+	EBreakpoints = 11,
+
+	/** 
+	The following are for the possible use of kernel-side debug and SMP breakpoint
+	manipulation.
+	*/
+	ESetBreak = 12,
+	ERemoveBreak = 13,
+	EModifyBreak = 14,
+	
+	/**
+	 * Provides static information of the system
+	 */
+	EStaticInfo = 15,
+
+	/** Last listing enum. */
+	EListLast
+	};
+
+/**
+  Bit field values denoting the scope of a listing.
+
+  In the debug functionality block, the TTag::iValue element which is returned for a listing tag
+  should be considered as a union of the supported values from this enumeration for that listing.
+  */
+enum TListScope
+	{
+	EScopeNone = 0x0,             /**< Corresponds to no scope for a listing. equivalent to not supported */
+	EScopeGlobal= 0x1,            /**< Corresponds to a global scope for a listing. */
+	EScopeProcessSpecific = 0x2,  /**< Corresponds to a process specific scope for a listing. */
+	EScopeThreadSpecific = 0x4    /**< Corresponds to a thread specific scope for a listing. */
+	};
+
+/**
+@internalComponent
+
+Interface constructor for passing IPC data for the GetList call.
+*/
+class TListDetails
+	{
+public:
+	TListDetails(const TListId aListId, const TListScope aListScope, TUint64 aTargetId=0)
+		: iListId(aListId),
+		  iListScope(aListScope),
+		  iTargetId(aTargetId) {}
+public:
+	TListId iListId;
+	TListScope iListScope;
+	TUint64 iTargetId;
+	};
+
+/** Debug Security Server Secure ID */
+const TUid KUidDebugSecurityServer = { 0x102834E2 };
+
+} // end of Debug namespace declaration
+
+// the remaining functionality in this file is intended for use on user side only
+#ifndef __KERNEL_MODE__
+
+#include <e32std.h>
+
+// API definition for Debug namespace appears elsewhere in this file.
+namespace Debug {
+
+/** The name of the Debug Security Server. */
+_LIT(KSecurityServerName,"DebugSecurityServer");
+
+// A version must be specified when creating a session with the server
+/** The Debug Security Server's major version number. */
+const TUint KDebugServMajorVersionNumber=2;
+/** The Debug Security Server's minor version number. */
+const TUint KDebugServMinorVersionNumber=4;
+/** The Debug Security Server's patch version number. */
+const TUint KDebugServPatchVersionNumber=0;
+
+/**
+Denotes how memory should be accessed
+*/
+enum TAccess
+	{
+	EAccess8 = 1,	/**< Currently unsupported, signifies 8 bit access. */
+	EAccess16 = 2,	/**< Currently unsupported, signifies 16 bit access. */
+	EAccess32 = 4	/**< Signifies 32 bit access. */
+	};
+
+/**
+Denotes how data should be interpreted
+*/
+enum TEndianess
+	{
+	EEndLE8 = 0,	/**< Signifies 8 bit little-endian. */
+	EEndBE8 = 1,	/**< Currently unsupported, signifies 8 bit big-endian. */
+	EEndBE32 = 2	/**< Currently unsupported, signifies 32 bit big-endian. */
+	};
+
+/**
+Structure used to store information about a memory operation
+
+@internalComponent
+*/
+class TMemoryInfo
+	{
+public:
+
+	TMemoryInfo(TUint32 aAddress=0, TUint32 aLength=0, TAccess aAccess=EAccess32, TEndianess aEndianess=EEndLE8)
+		: iAddress(aAddress),
+		  iSize(aLength),
+		  iAccess(aAccess),
+		  iEndianess(aEndianess)
+		{}
+
+public:
+
+	/**
+	Address to start reading/writing memory
+	*/
+	TUint32 iAddress;
+	/**
+	Number of bytes of memory to read/write
+	*/
+	TUint32	iSize;
+	/**
+	Access size for read/write
+	@see TAccess
+	*/
+	TAccess iAccess;
+	/**
+	Endianess to interpret data as
+	@see TEndianess
+	*/
+	TEndianess iEndianess;
+	};
+
+/**
+@internalComponent
+*/
+class TBreakInfo
+	{
+public:
+	TUint32 iAddress;
+	TArchitectureMode iArchitectureMode;
+	};
+
+/**
+@internalComponent
+
+Function codes (opcodes) used in message passing between client and server
+in this header file and what arguments should be passed with each of these
+*/
+enum TDebugServRqst
+	{
+	EDebugServOpen = 1,
+	EDebugServClose = 2,
+	EDebugServSuspendThread = 3,
+	EDebugServResumeThread = 4,
+	EDebugServReadMemory = 5,
+	EDebugServWriteMemory = 6,
+	EDebugServSetBreak = 7,
+	EDebugServClearBreak = 8,
+	EDebugServModifyBreak = 9,
+	EDebugServGetEvent = 10,
+	EDebugServCancelGetEvent = 11,
+	EDebugServAttachExecutable = 12,
+	EDebugServDetachExecutable = 13,
+	EDebugServGetDebugFunctionalityBufSize = 14,
+	EDebugServGetDebugFunctionality = 15,
+	EDebugServReadRegisters = 16,
+	EDebugServWriteRegisters = 17,
+	EDebugServSetEventAction = 18,
+	EDebugServBreakInfo = 19,
+	EDebugServGetList = 20,
+	EDebugServStep = 21,
+	EDebugServSetProcessBreak = 22,
+	EDebugServProcessBreakInfo = 23,
+	EDebugServKillProcess = 24,
+	EDebugServModifyProcessBreak = 25,
+	EDebugServReadCrashFlash = 26,
+	EDebugServWriteCrashFlash = 27,
+	EDebugServEraseCrashFlash = 28,
+	EDebugServEraseEntireCrashFlash = 29,
+	};
+
+/**
+Client side API to debug security server (DSS). Interaction with the DSS should
+be conducted through this class only.
+*/
+class RSecuritySvrSession : public RSessionBase
+	{
+public:
+	RSecuritySvrSession();
+	TVersion Version() const;
+
+	TInt Close();
+
+	TInt AttachExecutable(const TDesC& aProcessName, TBool aPassive);
+	TInt DetachExecutable(const TDesC& aProcessName);
+
+	TInt GetDebugFunctionalityBufSize(TUint32* aBufSize);
+	TInt GetDebugFunctionality(TDes8& aBuffer);
+
+	TInt SuspendThread(const TThreadId aThreadId);
+	TInt ResumeThread(const TThreadId aThreadId);
+
+	TInt ReadMemory(const TThreadId aThreadId, const TUint32 aAddress, const TUint32 aLength, TDes8 &aData, const TAccess aAccessSize, const TEndianess aEndianess);
+	TInt WriteMemory(const TThreadId aThreadId, const TUint32 aAddress, const TUint32 aLength, const TDesC8 &aData, const TAccess aAccessSize, const TEndianess aEndianess);
+
+	TInt ReadRegisters(const TThreadId aThreadId, const TDesC8& aRegisterIds, TDes8& aRegisterValues, TDes8& aRegisterFlags);
+	TInt WriteRegisters(const TThreadId aThreadId, const TDesC8& aRegisterIds, const TDesC8& aRegisterValues, TDes8& aRegisterFlags);
+
+	void GetEvent(const TDesC& aExecutableName, TRequestStatus &aStatus, TDes8& aEventInfo);
+	TInt CancelGetEvent(const TDesC& aExecutableName);
+
+	TInt SetEventAction(const TDesC& aExecutableName, TEventType aEvent, TKernelEventAction aEventAction);
+
+	TInt SetBreak( TBreakId &aId, const TThreadId aThreadId, const TUint32 aAddress, const TArchitectureMode aArchitectureMode);
+	TInt ClearBreak(const TBreakId aBreakId);
+	TInt ModifyBreak(const TBreakId aBreakId, const TThreadId aThreadId, const TUint32 aAddress, const TArchitectureMode aArchitectureMode);
+	TInt BreakInfo(const TBreakId aBreakId, TThreadId& aThreadId, TUint32& aAddress, TArchitectureMode& aMode);
+	TInt SetProcessBreak( TBreakId &aId, const TProcessId aProcessId, const TUint32 aAddress, const TArchitectureMode aArchitectureMode);
+	TInt ProcessBreakInfo(const TBreakId aBreakId, TProcessId& aProcessId, TUint32& aAddress, TArchitectureMode& aMode);
+	TInt ModifyProcessBreak(const TBreakId aBreakId, const TProcessId aProcessId, const TUint32 aAddress, const TArchitectureMode aArchitectureMode);
+			
+	TInt GetList(const TListId aListId, TDes8& aListData, TUint32& aDataSize);
+	TInt GetList(const TThreadId aThreadId, const TListId aListId, TDes8& aListData, TUint32& aDataSize);
+	TInt GetList(const TProcessId aProcessId, const TListId aListId, TDes8& aListData, TUint32& aDataSize);
+	TInt Step(const TThreadId aThreadId, TUint32 aNumSteps);
+	TInt KillProcess(const TProcessId aProcessId, const TInt aReason);
+	TInt ReadCrashLog(const TUint32 aPos, TDes8& aData, const TUint32 aDataSize);	
+	TInt WriteCrashConfig(const TUint32 aPos, const TDesC8& aBuffer, TUint32& aSize);
+	TInt EraseCrashLog(const TUint32 aPos, const TUint32 aBlockNumber);
+	TInt EraseCrashFlashPartition();
+	
+	TInt Connect(const TVersion aVersion);
+private:
+	TInt StartServer(void);
+	};
+/**
+Server session constructor
+*/
+inline RSecuritySvrSession::RSecuritySvrSession()
+	{
+
+	}
+
+/**
+Called by a client to create a session with the DSS. This method starts the
+DSS if it is not running, or connects to it if it already exists.
+
+@param aVersion version of the DSS to connect to
+
+@return KErrNone if a connection was successfully created, or one of the other
+system wide error codes
+*/
+inline TInt RSecuritySvrSession::Connect(const TVersion aVersion)
+	{
+	// default message slots for the server
+	const TUint KDefaultMessageSlots = 4;
+	TInt retry=2;
+	for (;;)
+		{
+		TInt r=CreateSession(KSecurityServerName, aVersion, KDefaultMessageSlots);
+		if (r!=KErrNotFound && r!=KErrServerTerminated)
+			{
+			return r;
+			}
+		if (--retry==0)
+			{
+			return r;
+			}
+		r=StartServer();
+		if (r!=KErrNone && r!=KErrAlreadyExists)
+			{
+			return r;
+			}
+		}
+	}
+
+/**
+  Start the server
+
+  @return KErrNone on success, or one of the other system wide error codes
+  */
+inline TInt RSecuritySvrSession::StartServer()
+	{
+	// constants for the server
+	_LIT(KSecurityServerProcessName, "rm_debug_svr");
+	const TUidType serverUid(KNullUid, KNullUid, KUidDebugSecurityServer);
+
+	RProcess server;
+	TInt err = server.Create(KSecurityServerProcessName, KNullDesC, serverUid);
+
+	if(KErrNone != err)
+		{
+		return err;
+		}
+
+	// Synchronise with the process to make sure it hasn't died straight away
+	TRequestStatus stat;
+	server.Rendezvous(stat);
+	if (stat != KRequestPending)
+		{
+		// logon failed - server is not yet running, so cannot have terminated
+		server.Kill(0);             // Abort startup
+		}
+	else
+		{
+		// logon OK - start the server
+		server.Resume();
+		}
+
+	// Wait to synchronise with server - if it dies in the meantime, it
+	// also gets completed
+	User::WaitForRequest(stat);
+
+	// We can't use the 'exit reason' if the server panicked as this
+	// is the panic 'reason' and may be '0' which cannot be distinguished
+	// from KErrNone
+	err = (server.ExitType()==EExitPanic) ? KErrGeneral : stat.Int();
+	server.Close();
+	return err;
+	}
+
+/**
+Get version of RSecuritySvrSession
+
+@return a TVersion object specifying the version
+*/
+inline TVersion RSecuritySvrSession::Version(void) const
+	{
+	return (TVersion(KDebugServMajorVersionNumber, KDebugServMinorVersionNumber, KDebugServPatchVersionNumber));
+	}
+
+/**
+Suspends execution of the specified thread.
+
+@param aThreadId thread ID of the thread to suspend
+
+@return KErrNone if there were no problems, KErrPermissionDenied if security 
+        check fails or KErrArgument if the thread does not exist
+*/
+inline TInt RSecuritySvrSession::SuspendThread(const TThreadId aThreadId)
+	{
+	TPckgBuf<TThreadId> threadIdPckg(aThreadId);
+	TIpcArgs args(&threadIdPckg);
+
+	return SendReceive(EDebugServSuspendThread, args);
+	}
+
+/**
+Resumes execution of the specified thread.
+
+@param aThreadId thread ID of the thread to resume
+
+@return KErrNone if there were no problems, KErrPermissionDenied if security 
+        check fails or KErrArgument if the thread does not exist
+*/
+inline TInt RSecuritySvrSession::ResumeThread(const TThreadId aThreadId)
+	{
+	TPckgBuf<TThreadId> threadIdPckg(aThreadId);
+	TIpcArgs args(&threadIdPckg);
+
+	return SendReceive(EDebugServResumeThread, args);
+	}
+
+/**
+Purpose:
+Set a thread-specific breakpoint in an attached process. 
+
+@pre Debug Agent must be connected to the debug security server
+@pre Debug Agent must be attached to a process.
+
+@param aThreadId The thread id to which the breakpoint will apply.
+@param aAddress The virtual memory address at which to place the breakpoint.
+@param aArchitectureMode The kind of breakpoint which is to be set (e.g. ARM/Thumb/Thumb2EE)
+@param aBreakId The address to which the assigned breakpoint ID will be written by this function
+@return Any error which may be returned by RSessionBase::SendReceive()
+*/
+inline TInt RSecuritySvrSession::SetBreak( TBreakId &aBreakId,const TThreadId aThreadId, const TUint32 aAddress, const TArchitectureMode aArchitectureMode)
+	{
+	TPtr8 breakIdPtr((TUint8*)&aBreakId, sizeof(aBreakId));
+
+	TPckgBuf<TThreadId> threadIdPckg(aThreadId);
+
+	TBreakInfo breakInfo;
+	breakInfo.iAddress = aAddress;
+	breakInfo.iArchitectureMode = aArchitectureMode;
+	TPckgBuf<TBreakInfo> breakInfoPckg(breakInfo);
+
+	//call driver to attempt to set break
+	TIpcArgs args(&threadIdPckg, &breakInfoPckg, &breakIdPtr);
+	return SendReceive(EDebugServSetBreak, args);
+	}
+
+/**
+Purpose:
+Clears a previously set thread-specific or process-specific breakpoint.
+
+@pre Debug Agent must be connected to the debug security server
+@pre Debug Agent must be attached to a process.
+
+@param aBreakId The TBreakId returned by a prior SetBreak call. Must have been set by the same Debug Agent.
+@return Any error which may be returned by RSessionBase::SendReceive()
+*/
+inline TInt RSecuritySvrSession::ClearBreak(const TBreakId aBreakId)
+	{
+	TIpcArgs args(aBreakId);
+	return SendReceive(EDebugServClearBreak, args);
+	}
+
+/**
+Purpose:
+Modifies the properties of a previously set breakpoint.
+
+@pre Debug Agent must be connected to the debug security server
+@pre Debug Agent must be attached to a process.
+
+@param aBreakId the TBreakId returned by a prior SetBreak() call. Must have been set by the same Debug Agent.
+@param aThreadId the thread id of the thread to move the breakpoint to
+@param aAddress the virtual memory address at which to place the breakpoint.
+@param aArchitectureMode the kind of breakpoint which is to be set (e.g. ARM/Thumb/Thumb2EE)
+@return Any error which may be returned by RSessionBase::SendReceive()
+*/
+inline TInt RSecuritySvrSession::ModifyBreak(const TBreakId aBreakId, const TThreadId aThreadId, const TUint32 aAddress, const TArchitectureMode aArchitectureMode)
+
+	{
+	TPckgBuf<TThreadId> threadIdPckg(aThreadId);
+	TIpcArgs args(aBreakId,&threadIdPckg,aAddress,aArchitectureMode);
+	return SendReceive(EDebugServModifyBreak, args);
+	}
+
+/**
+Purpose:
+Modifies the properties of a previously set process breakpoint.
+
+@pre Debug Agent must be connected to the debug security server
+@pre Debug Agent must be attached to a process.
+
+@param aBreakId the TBreakId returned by a prior SetBreak() call. Must have been set by the same Debug Agent.
+@param aProcessId the process id of the process to move the breakpoint to
+@param aAddress the virtual memory address at which to place the breakpoint.
+@param aArchitectureMode the kind of breakpoint which is to be set (e.g. ARM/Thumb/Thumb2EE)
+@return Any error which may be returned by RSessionBase::SendReceive()
+*/
+inline TInt RSecuritySvrSession::ModifyProcessBreak(const TBreakId aBreakId, const TProcessId aProcessId, const TUint32 aAddress, const TArchitectureMode aArchitectureMode)
+
+	{
+	TPckgBuf<TProcessId> processIdPckg(aProcessId);
+	TIpcArgs args(aBreakId,&processIdPckg,aAddress,aArchitectureMode);
+	return SendReceive(EDebugServModifyProcessBreak, args);
+	}
+
+/**
+Purpose:
+Returns the properties associated with a given TBreakId. The supplied break id must previously have been allocated
+to the debug agent by a SetBreak() call.
+
+@pre Debug Agent must be connected to the debug security server
+@pre Debug Agent must be attached to a process.
+@pre The aBreakId must have been previously returned by a SetBreak() call and not subsequently cleared by ClearBreak().
+
+@param aBreakId the TBreakId returned by a prior SetBreak() call. Must have been set by the same Debug Agent.
+@param aAddress on return contains the virtual memory address of the breakpoint
+@param aThreadId on return contains the thread id of the thread that the breakpoint is set in
+@param aMode on return contains the type of this breakpoint (e.g. ARM/Thumb/Thumb2EE)
+@return Any error which may be returned by RSessionBase::SendReceive()
+*/
+inline TInt RSecuritySvrSession::BreakInfo(const TBreakId aBreakId, TThreadId& aThreadId, TUint32& aAddress, TArchitectureMode& aMode)
+	{
+	// temporary descriptors
+	TPtr8 threadId((TUint8*)&aThreadId,0,sizeof(TThreadId));
+	TPtr8 address((TUint8*)&aAddress,0,sizeof(TUint32));
+	TPtr8 mode((TUint8*)&aMode,0,sizeof(TArchitectureMode));
+
+	TIpcArgs args(aBreakId,&threadId,&address,&mode);
+	return SendReceive(EDebugServBreakInfo, args);
+	}
+
+/**
+Purpose:
+Set a process-specific breakpoint in an attached process. 
+
+@pre Debug Agent must be connected to the debug security server
+@pre Debug Agent must be attached to a process.
+
+@param aProcessId The process id to which the breakpoint will apply.
+@param aAddress The virtual memory address at which to place the breakpoint.
+@param aArchitectureMode The kind of breakpoint which is to be set (e.g. ARM/Thumb/Thumb2EE)
+@param aBreakId The address to which the assigned breakpoint ID will be written by this function
+@return Any error which may be returned by RSessionBase::SendReceive()
+*/
+inline TInt RSecuritySvrSession::SetProcessBreak( TBreakId &aBreakId, const TProcessId aProcessId, const TUint32 aAddress, const TArchitectureMode aArchitectureMode)
+	{
+	TPtr8 breakIdPtr((TUint8*)&aBreakId, sizeof(aBreakId));
+
+	TPckgBuf<TProcessId> threadIdPckg(aProcessId);
+
+	TBreakInfo breakInfo;
+	breakInfo.iAddress = aAddress;
+	breakInfo.iArchitectureMode = aArchitectureMode;
+	TPckgBuf<TBreakInfo> breakInfoPckg(breakInfo);
+
+	//call driver to attempt to set break
+	TIpcArgs args(&threadIdPckg, &breakInfoPckg, &breakIdPtr);
+	return SendReceive(EDebugServSetProcessBreak, args);
+	}
+
+/**
+Purpose:
+Returns the properties associated with a given TBreakId. The supplied break id must previously have been allocated
+to the debug agent by a SetProcessBreak() call.
+
+@pre Debug Agent must be connected to the debug security server
+@pre Debug Agent must be attached to a process.
+@pre The aBreakId must have been previously returned by a SetProcessBreak() call and not subsequently cleared by ClearBreak().
+
+@param aBreakId the TBreakId returned by a prior SetBreak() call. Must have been set by the same Debug Agent.
+@param aAddress on return contains the virtual memory address of the breakpoint
+@param aThreadId on return contains the thread id of the thread that the breakpoint is set in
+@param aMode on return contains the type of this breakpoint (e.g. ARM/Thumb/Thumb2EE)
+@return Any error which may be returned by RSessionBase::SendReceive()
+*/
+inline TInt RSecuritySvrSession::ProcessBreakInfo(const TBreakId aBreakId, TProcessId& aProcessId, TUint32& aAddress, TArchitectureMode& aMode)
+	{
+	// temporary descriptors
+	TPtr8 processId((TUint8*)&aProcessId,0,sizeof(TProcessId));
+	TPtr8 address((TUint8*)&aAddress,0,sizeof(TUint32));
+	TPtr8 mode((TUint8*)&aMode,0,sizeof(TArchitectureMode));
+
+	TIpcArgs args(aBreakId,&processId,&address,&mode);
+	return SendReceive(EDebugServProcessBreakInfo, args);
+	}
+
+/**
+Purpose:
+Wait for an event to occur to the target executable being debugged. When an event
+occurs, the TRequestStatus is changed from KRequestPending.
+
+@pre Debug Agent must be connected to the debug security server
+@pre Debug Agent must be attached to a process.
+
+Note 1: Events are reported on a per-executable basis, not per-thread.
+
+Note 2: All the parameters must remain in scope until either CancelGetEvent is called, or
+until TRequestStatus is changed from KRequestPending. In practice, this generally
+means these parameters should not be based on the stack, as they may go out of
+scope before the call completes.
+
+Note 3: TIpcArgs args is allocated on the stack within this function, however,
+all the data containing in args is transferred in the SendReceive() so it can safely
+go out of scope after the call has been made.
+
+@param aExecutableName The name of any executable to which the Debug Agent is attached.
+@param aStatus Debug Agent request status variable.
+@param aEventInfo Descriptor containing a buffer sufficient for Event information.
+@return Any error which may be returned by RSessionBase::SendReceive()
+*/
+inline void RSecuritySvrSession::GetEvent(const TDesC& aExecutableName, TRequestStatus &aStatus, TDes8& aEventInfo)
+	{
+	TIpcArgs args(&aExecutableName, &aEventInfo);
+
+	SendReceive(EDebugServGetEvent, args, aStatus );
+
+	}
+ 
+/**
+Purpose:
+Cancel a previously issued asynchronous RSecuritySvrSession::GetEvent call. The previously
+issued call will immediately complete with the TRequestStatus = KErrCancel
+
+@pre Debug Agent must be connected to the debug security server
+@pre Debug Agent must be attached to the process specified by aProcessName
+@pre Debug Agent must have previously issued an RSecuritySvrSession::GetEvent() call.
+
+@param aExecutableName The name of the executable being debugged.
+@return Any error which may be returned by RSessionBase::SendReceive()
+*/
+inline TInt RSecuritySvrSession::CancelGetEvent(const TDesC& aExecutableName)
+{
+	TIpcArgs args(&aExecutableName);
+
+	return SendReceive(EDebugServCancelGetEvent,args);
+}
+
+/**
+Called by a debug agent to request debug privileges for the executable with
+file name aExecutableName.
+
+@param aExecutableName a fully qualified file name of the executable to attach to
+@param aPassive if true then the agent has reduced debug rights.
+
+@return KErrNone if attached successfully, one of the other system wide error
+	codes otherwise
+*/
+inline TInt RSecuritySvrSession::AttachExecutable(const TDesC& aExecutableName, TBool aPassive)
+	{
+	TIpcArgs args((TInt)aPassive, &aExecutableName);
+	return SendReceive(EDebugServAttachExecutable, args);
+	}
+
+/**
+Called by a debug agent to detach from the executable with file
+name aExecutableName.
+
+@param aExecutableName the fully qualified file name of the executable to detach from
+
+@return KErrNone if detached successfully, one of the other system wide error
+	codes otherwise
+*/
+inline TInt RSecuritySvrSession::DetachExecutable(const TDesC& aExecutableName)
+	{
+	TIpcArgs args(&aExecutableName);
+	return SendReceive(EDebugServDetachExecutable, args);
+	}
+
+/**
+Close the session and thread
+
+@return KErrNone if the session is closed successfully, otherwise one of the system wide errors.
+*/
+inline TInt RSecuritySvrSession::Close()
+	{
+	RSessionBase::Close();
+	return KErrNone;
+	}
+
+/**
+Get buffer size required to contain Functionality text block.
+
+@see in-source documentation in rm_debug_api.h
+
+@param aBufSize function will fill this with the required buffer size
+
+@return KErrNone if the call succeeded, or one of the other system wide error
+        codes if the call failed
+*/
+inline TInt RSecuritySvrSession::GetDebugFunctionalityBufSize(TUint32 *aBufSize)
+	{	
+	TInt res = KErrNone;
+
+	TPtr8 stuff((TUint8*)aBufSize,4, 4);
+
+	TIpcArgs args(&stuff);
+
+	res = SendReceive(EDebugServGetDebugFunctionalityBufSize, args);
+	
+	return res;
+	}
+
+/**
+Get debug functionality text block and place it into aBuffer.
+
+The debug functionality block (DFBlock) is used to provide information about the functionality
+(i.e. features) which are supported by the rm_debug.ldd device driver.
+
+Calling this function with a suitably sized buffer aBuffer will result in the debug
+functionality information being stored in aBuffer. The necessary size of aBuffer can
+be determined by calling DebugFunctionalityBufSize().
+
+The format of the DFBlock is:
+
+@code
+Sub-block 0
+Sub-block 1
+...
+Sub-block N-1
+@endcode
+
+The data which will be returned by a call to GetDebugFunctionality() is constant so is
+guaranteed to fit exactly into the aBuffer allocated, assuming that the size of aBuffer
+corresponds to the value returned from GetDebugFunctionalityBufSize().
+
+Each sub-block is composed of a TTagHeader object followed by a C-style array of TTag objects.
+The sub-block contains information about a particular aspect of the debug sub-system, for example
+information about the manner in which memory can be accessed.
+The TTagHeader is comprised of an identifier which determines the type of data
+it contains, together with the number of TTag elements in the array following the TTagHeader.
+Each TTag in a sub-block has a unique ID, stored in the TTag::iTagId member variable.
+
+The only sub-block that is guaranteed to exist has TTagHeader::iTagHdrId = ETagHeaderIdCore, all other
+sub-blocks are optional. The ETagHeaderIdCore sub-block is the first sub-block within the DFBlock.
+Other sub-blocks may appear in any order after the ETagHeaderIdCore sub-block.
+
+The following is a diagrammatic representation of a sub-block the DFBlock:
+
+@code
+The HHHH represents the tag header ID of a sub-block (TTagHeader::iTagHdrId)
+The NNNN represents the number of TTag elements in the sub-block (TTagHeader::iNumTags)
+The IIIIIIII represents the ID of the TTag (TTag::iTagId)
+The TTTT represents the type of the TTag (TTag::iType)
+The SSSS represents the size of the TTag's associated data (TTag::iSize)
+The VVVVVVVV represents the TTag's value (TTag::iValue)
+
+0xNNNNHHHH	TTagHeader element for first sub-block (has N1 TTag elements)
+0xIIIIIIII	\
+0xSSSSTTTT	-- TTag 0
+0xVVVVVVVV	/
+0xIIIIIIII	\
+0xSSSSTTTT	-- TTag 1
+0xVVVVVVVV	/
+...
+0xIIIIIIII	\
+0xSSSSTTTT	-- TTag N1 - 1
+0xVVVVVVVV	/
+0xNNNNHHHH	TTagHeader element for second sub-block (has N2 TTag elements)
+0xIIIIIIII	\
+0xSSSSTTTT	-- TTag 0
+0xVVVVVVVV	/
+...
+0xIIIIIIII	\
+0xSSSSTTTT	-- TTag N2 - 1
+0xVVVVVVVV	/
+...
+0xNNNNHHHH	TTagHeader element for last sub-block (has NX TTag elements)
+0xIIIIIIII	\
+0xSSSSTTTT	-- TTag 0
+0xVVVVVVVV	/
+...
+0xIIIIIIII	\
+0xSSSSTTTT	-- TTag NX - 1
+0xVVVVVVVV	/
+@endcode
+
+The following example DFBlock contains two sub-blocks (values taken from enums below):
+- ETagHeaderIdCore
+- ETagHeaderIdMemory
+
+@code
+Binary		Meaning					Value
+
+0x000A0000	iTagHdrId, iNumTags		ETagHeaderIdCore, ECoreLast
+0x00000000	iTagId					ECoreEvents
+0x00000000	iType, iSize			ETagTypeBoolean, 0
+0x00000001	iValue					ETrue
+0x00000001	iTagId					ECoreStartStop
+0x00000000	iType, iSize			ETagTypeBoolean, 0
+0x00000001	iValue					ETrue
+...
+0x00000008	iTagId					ECoreHardware
+0x00000000	iType, iSize			ETagTypeBoolean, 0
+0x00000000	iValue					EFalse
+0x00000009	iTagId					ECoreApiConstants
+0x00000000	iType, iSize			ETagTypeBoolean, 0
+0x00000001	iValue					ETrue
+
+0x000A0001	iTagHdrId, iNumTags		ETagHeaderIdMemory, EMemoryLast
+0x00000000	iTagId					EMemoryRead
+0x00000000	iType, iSize			ETagTypeBoolean, 0
+0x00000001	iValue					ETrue
+0x00000001	iTagId					EMemoryWrite
+0x00000000	iType, iSize			ETagTypeBoolean, 0
+0x00000001	iValue					ETrue
+...
+0x00000008	iTagId					EMemoryLE8
+0x00000000	iType, iSize			ETagTypeBoolean, 0
+0x00000001	iValue					ETrue
+0x00000009	iTagId					EMemoryMaxBlockSize
+0x00000001	iType, iSize			ETagTypeTUint32, 0
+0x00004000	iValue					0x4000
+@endcode
+
+- Debug Agent DFBlock Processing:
+
+Debug Agents MUST understand and process the ETagHeaderIdCore block. The other
+blocks may be ignored if not recognised. Tags within each block may be ignored if
+not recognised.
+
+@pre aBuffer.MaxLength() >= *aBufSize where aBufSize is set by a call to: 
+     RSecuritySvrSession::GetDebugFunctionalityBufSize(TUint32 *aBufSize)
+
+@param aBuffer buffer to store functionality block in
+
+@return KErrNone if call succeeded, 
+        KErrNoMemory if temporary memory could not be allocated, 
+        KErrGeneral if debug functionality block could not be accessed
+*/
+inline TInt RSecuritySvrSession::GetDebugFunctionality(TDes8& aBuffer)
+	{
+	TIpcArgs args(&aBuffer);
+
+	TInt res = KErrNone;
+
+	res = SendReceive(EDebugServGetDebugFunctionality, args);
+
+	return res;
+	}
+
+/**
+Read a block of memory from the target debug thread defined by aThreadId.
+
+@pre the client should attach to the process containing the target thread
+@pre aData.MaxLength() >= aLength
+
+@param aThreadId thread ID of the thread to read memory from
+@param aAddress address to start reading memory from
+@param aLength number of bytes of memory to read
+@param aData descriptor to read memory into
+@param aAccessSize access size for memory reads, default is TAccess::EAccess32
+@param aEndianess interpretation of endianess of target data, default is
+       TEndianess::EEndLE8
+
+@return KErrNone if memory read successfully, or one of the other system wide error codes
+*/
+inline TInt RSecuritySvrSession::ReadMemory(const TThreadId aThreadId, const TUint32 aAddress, const TUint32 aLength, TDes8 &aData, const TAccess aAccessSize, const TEndianess aEndianess)
+	{
+	TPckgBuf<TThreadId> threadIdPckg(aThreadId);
+	//set up memory info object
+	TMemoryInfo memoryInfo;
+	memoryInfo.iAddress = aAddress;
+	memoryInfo.iSize = aLength;
+	memoryInfo.iAccess = aAccessSize;
+	memoryInfo.iEndianess = aEndianess;
+
+	TPckgBuf<TMemoryInfo> pckg(memoryInfo);
+
+	TIpcArgs args(&threadIdPckg, &pckg, &aData);
+
+	return SendReceive(EDebugServReadMemory, args);
+	}
+
+/**
+Write a block of memory to the target debug thread defined by aThreadId.
+
+@pre the client should attach non-passively to the process containing the
+     target thread
+
+@param aThreadId thread ID of the thread to write memory to
+@param aAddress address to start writing memory at
+@param aLength number of bytes of memory to write
+@param aData descriptor to read memory from
+@param aAccessSize access size for memory writes, default is TAccess::EAccess32
+@param aEndianess interpretation of endianess of target data, default is
+       TEndianess::EEndLE8
+
+@return KErrNone if memory written successfully, or one of the other system wide error codes
+*/
+inline TInt RSecuritySvrSession::WriteMemory(const TThreadId aThreadId, const TUint32 aAddress, const TUint32 aLength, const TDesC8 &aData, const TAccess aAccessSize, const TEndianess aEndianess)
+	{
+	TPckgBuf<TThreadId> threadIdPckg(aThreadId);
+	//create memory info object
+	TMemoryInfo memoryInfo;
+	memoryInfo.iAddress = aAddress;
+	memoryInfo.iSize = aLength;
+	memoryInfo.iAccess = aAccessSize;
+	memoryInfo.iEndianess = aEndianess;
+
+	TPckgBuf<TMemoryInfo> pckg(memoryInfo);
+
+	TIpcArgs args(&threadIdPckg, &pckg, &aData);
+
+	return SendReceive(EDebugServWriteMemory, args);
+	}
+
+/**
+Read register values from the thread with thread ID aThreadId. The IDs of the
+registers to read are stored as an array of TRegisterInfo objects in 
+aRegisterIds. If the nth register requested could be read then the value of the 
+register will be appended to aRegisterValues and EValid stored at 
+offset n in aRegisterFlags. If the register is supported but could not be read 
+then EInValid will be stored at offset n in aRegisterFlags and arbitrary data 
+appended in aRegisterValues. If reading the specified register is not
+supported by the kernel then ENotSupported will be stored at offset n in 
+aRegisterFlags and arbitrary data appended to aRegisterValues. If an unknown
+register is specified then EUnknown will be put in aRegisterFlags and 
+arbitrary data placed in aRegisterValues.
+
+@pre the client should attach to the process containing the target thread
+
+@see the register ID format is defined in: 
+     SGL.TS0028.027 - Symbian Core Dump File Format v1.0.doc
+
+@param aThreadId thread ID of the thread to read register values from
+@param aRegisterIds descriptor containing array of TFunctionalityRegister defined 
+       register IDs
+@param aRegisterValues descriptor to contain register values
+@param aRegisterFlags descriptor containing array of TUint8 flags, with values 
+       taken from TRegisterFlag
+
+@return KErrNone if registers were read successfully, or one of the other system wide error codes
+*/
+inline TInt RSecuritySvrSession::ReadRegisters(const TThreadId aThreadId, const TDesC8& aRegisterIds, TDes8& aRegisterValues, TDes8& aRegisterFlags)
+	{
+	TPckgBuf<TThreadId> threadIdPckg(aThreadId);
+	TIpcArgs args(&threadIdPckg, &aRegisterIds, &aRegisterValues, &aRegisterFlags);
+
+	return SendReceive(EDebugServReadRegisters, args);
+	}
+
+/**
+Write register values to the thread with thread ID aThreadId. The IDs of the 
+registers to write are stored as an array of TRegisterInfo objects in 
+aRegisterIds. The values to put in the registers are stored as an array of 
+objects in aRegisterValues. If the nth register to write could be 
+written then EValid stored at offset n in aRegisterFlags. If the register is 
+supported but could not be written then EInValid will be stored at offset n in 
+aRegisterFlags. If writing to the specified register is not supported by the 
+kernel then ENotSupported will be stored at offset n in aRegisterFlags. If an 
+unknown register is specified then EUnknown will be put in aRegisterFlags.
+
+@pre the client should attach non-passively to the process containing the 
+     target thread
+
+@see the register ID format is defined in: 
+     SGL.TS0028.027 - Symbian Core Dump File Format v1.0.doc
+
+@param aThreadId thread ID of the thread to write register values to
+@param aRegisterIds descriptor containing array of TFunctionalityRegister defined 
+       register IDs
+@param aRegisterValues descriptor containing array of register values
+@param aRegisterFlags descriptor containing array of TUint8 flags, with values 
+       taken from TRegisterFlag
+
+@return KErrNone if registers were written successfully, or one of the other system wide error codes
+*/
+inline TInt RSecuritySvrSession::WriteRegisters(const TThreadId aThreadId, const TDesC8& aRegisterIds, const TDesC8& aRegisterValues, TDes8& aRegisterFlags)
+	{
+	TPckgBuf<TThreadId> threadIdPckg(aThreadId);
+	TIpcArgs args(&threadIdPckg, &aRegisterIds, &aRegisterValues, &aRegisterFlags);
+
+	return SendReceive(EDebugServWriteRegisters, args);
+	}
+
+/**
+Purpose:
+Set the requisite actions to be taken when a particular event occurs.
+The events are defined in Debug::TEventType and the
+actions are defined in Debug::TKernelEventAction.
+
+The default action for all events is EActionIgnore.
+
+@pre Debug Agent must be connected to the debug security server
+@pre Debug Agent must be attached to the executable specified by aExecutableName.
+
+Note: Event actions are on a per-executable basis. This is
+to ensure that events such as EEventStartThread are notified to the Debug
+Agent, even though the debug agent cannot be aware of the existence
+of a new thread at the time the event occurs.
+
+@param aExecutableName The name of the executable to which the Debug Agent is attached.
+@param aEvent A TEventType enum defined in rm_debug_api.h:Debug::TEventType
+@param aEventAction Any TKernelEventAction permitted by the DFBlock.
+@return Any error which may be returned by RSessionBase::SendReceive()
+*/
+inline TInt RSecuritySvrSession::SetEventAction(const TDesC& aExecutableName, TEventType aEvent, TKernelEventAction aEventAction)
+{
+	TInt res = KErrNone;
+
+	TIpcArgs args(&aExecutableName,aEvent,aEventAction);
+
+	res = SendReceive(EDebugServSetEventAction, args);
+	
+	return res;
+}
+
+/**
+Returns a global listing corresponding to the type specified as aListId. The structure
+of the returned data depends on the value of aListId, see TListId for details.
+If aListData is not large enough to contain the listings data then
+the necessary buffer size is stored in aDataSize and the function returns
+KErrTooBig. In this case the contents of aListData will not contain useful data.
+
+Note that if the aListData buffer was too small to hold the data then the value
+returned as aDataSize corresponds to the size of the data at that particular
+instance. The size of the data will vary over time, for example the thread list
+will increase and decrease in size as threads are created and destroyed, so
+re-requesting data with a buffer with max length aDataSize will not necessarily
+succeed if a list has increased in size between the two calls.
+
+@see TListId
+
+@param aListId enum from TListId signifying which type of listing to return
+@param aListData buffer provided by the debug agent in which data can be returned by the debug system
+@param aDataSize if aListData was not large enough to contain the requested
+       data then the necessary buffer size is stored in aDataSize. If aListData
+       was large enough then the value of aDataSize is the length of aListData
+
+@return KErrNone if data was returned successfully,
+        KErrTooBig if aListData is too small to hold the data,
+	one of the other system-wide error codes
+*/
+inline TInt RSecuritySvrSession::GetList(const TListId aListId, TDes8& aListData, TUint32& aDataSize)
+	{
+	//second argument of ETrue implies a global listing
+	TListDetails info(aListId, EScopeGlobal);
+	TPtr8 infoBuf((TUint8*)&info, sizeof(TListDetails), sizeof(TListDetails));
+	TPtr8 dataSizeBuf((TUint8*)&aDataSize, sizeof(TUint32), sizeof(TUint32));
+	TIpcArgs args(&infoBuf, &aListData, &dataSizeBuf);
+	return SendReceive(EDebugServGetList, args);
+	}
+
+/**
+Returns a thread-specific listing corresponding to the type specified as aListId. The structure
+of the returned data depends on the value of aListId, see TListId for details.
+If aListData is not large enough to contain the listings data then
+the necessary buffer size is stored in aDataSize and the function returns
+KErrTooBig. In this case the contents of aListData will not contain useful data.
+
+Note that if the aListData buffer is too small to hold the data then the value
+returned as aDataSize corresponds to the size of the data at that particular
+instant. The size of the data will vary over time, for example the thread list
+will increase and decrease in size as threads are created and destroyed, so
+re-requesting data with a buffer with max length aDataSize will not necessarily
+succeed if a list has increased in size between the two calls.
+
+@see TListId
+
+@param aThreadId thread to return the listing for
+@param aListId member of TListId signifying which type of listing to return
+@param aListData buffer provided by the debug agent in which data can be returned by the debug system.
+@param aDataSize if aListData was not large enough to contain the requested
+       data then the necessary buffer size is stored in aDataSize. If aListData
+       was large enough then the value of aDataSize is the length of aListData
+
+@return KErrNone if data was returned successfully,
+        KErrTooBig if aListData is too small to hold the data,
+	one of the other system-wide error codes
+*/
+inline TInt RSecuritySvrSession::GetList(const TThreadId aThreadId, const TListId aListId, TDes8& aListData, TUint32& aDataSize)
+	{
+	TListDetails info(aListId, EScopeThreadSpecific, aThreadId.Id());
+	TPtr8 infoBuf((TUint8*)&info, sizeof(TListDetails), sizeof(TListDetails));
+	TPtr8 dataSizeBuf((TUint8*)&aDataSize, sizeof(TUint32), sizeof(TUint32));
+	TIpcArgs args(&infoBuf, &aListData, &dataSizeBuf);
+	return SendReceive(EDebugServGetList, args);
+	}
+
+/**
+Returns a process-specific listing corresponding to the type specified as aListId. The structure
+of the returned data depends on the value of aListId, see TListId for details.
+If aListData is not large enough to contain the listings data then
+the necessary buffer size is stored in aDataSize and the function returns
+KErrTooBig. In this case the contents of aListData will not contain useful data.
+
+Note that if the aListData buffer is too small to hold the data then the value
+returned as aDataSize corresponds to the size of the data at that particular
+instant. The size of the data will vary over time, for example the thread list
+will increase and decrease in size as threads are created and destroyed, so
+re-requesting data with a buffer with max length aDataSize will not necessarily
+succeed if a list has increased in size between the two calls.
+
+@see TListId
+
+@param aProcessId process to return the listing for
+@param aListId member of TListId signifying which type of listing to return
+@param aListData buffer provided by the debug agent in which data can be returned by the debug system.
+@param aDataSize if aListData was not large enough to contain the requested
+       data then the necessary buffer size is stored in aDataSize. If aListData
+       was large enough then the value of aDataSize is the length of aListData
+
+@return KErrNone if data was returned successfully,
+        KErrTooBig if aListData is too small to hold the data,
+	one of the other system-wide error codes
+*/
+inline TInt RSecuritySvrSession::GetList(const TProcessId aProcessId, const TListId aListId, TDes8& aListData, TUint32& aDataSize)
+	{
+	TListDetails info(aListId, EScopeProcessSpecific, aProcessId.Id());
+	TPtr8 infoBuf((TUint8*)&info, sizeof(TListDetails), sizeof(TListDetails));
+	TPtr8 dataSizeBuf((TUint8*)&aDataSize, sizeof(TUint32), sizeof(TUint32));
+	TIpcArgs args(&infoBuf, &aListData, &dataSizeBuf);
+	return SendReceive(EDebugServGetList, args);
+	}
+
+/**
+Purpose:
+Step one or more CPU instructions in the specified thread from the current PC.
+
+@pre Debug Agent must be connected to the debug security server
+@pre Debug Agent must be attached to a process.
+@pre The thread being stepped must be suspended by the Debug Agent.
+
+@param aThreadId the id of the thread which is to be stepped
+@param aNumSteps how many machine-level instructions are to be stepped.
+@return Any error which may be returned by RSessionBase::SendReceive()
+*/
+inline TInt RSecuritySvrSession::Step(const TThreadId aThreadId, const TUint32 aNumSteps)
+	{
+	TPckgBuf<TThreadId> threadIdPckg(aThreadId);
+	TInt res = KErrNone;
+
+	TIpcArgs args(&threadIdPckg,aNumSteps);
+
+	res = SendReceive(EDebugServStep,args);
+
+	return res;
+	}
+
+/**
+Purpose:
+Kill the specified process with the supplied reason. Reason codes are equivalent
+to those in RProcess.Kill().
+
+@pre Debug Agent must be connected to the debug security server
+@pre Debug Agent must be attached to a process.
+
+@param aProcessId the id of the process which is to be killed
+@param aReason The reason to be associated with the ending of this process
+@return Any error which may be returned by RSessionBase::SendReceive()
+*/
+inline TInt RSecuritySvrSession::KillProcess(const TProcessId aProcessId, const TInt aReason)
+	{
+	TPckgBuf<TProcessId> processIdPckg(aProcessId);
+	TInt res = KErrNone;
+
+	TIpcArgs args(&processIdPckg,aReason);
+
+	res = SendReceive(EDebugServKillProcess,args);
+
+	return res;
+	}
+
+/**
+Purpose
+Method to read data from the crash flash
+
+@pre aData buffer to retrieve the data from the crash flash
+@pre aDataSize Size of the data
+
+@return Any error which may be returned by RSessionBase::SendReceive()
+*/
+inline TInt RSecuritySvrSession::ReadCrashLog(const TUint32 aPos, TDes8& aData, const TUint32 aDataSize)
+	{		
+		TIpcArgs args(aPos, &aData, aDataSize);		
+		TInt res = SendReceive(EDebugServReadCrashFlash,args);
+		return res;
+	}
+
+/**
+ * @internalTechnology
+ * @prototype
+ * 
+Purpose:
+Method to write the crash flash config
+
+@return Any error which may be returned by RSessionBase::SendReceive()
+*/
+inline TInt RSecuritySvrSession::WriteCrashConfig(const TUint32 aPos, const TDesC8& aBuffer, TUint32& aSize)
+	{
+		TPtr8 sizePtr((TUint8*)&aSize,4, 4);
+		TIpcArgs args(aPos, &aBuffer, &sizePtr);
+		TInt res = SendReceive(EDebugServWriteCrashFlash, args);
+		return res;
+	}
+/**
+Purpose:
+Method to erase a block in the crash flash
+
+@return Any error which may be returned by RSessionBase::SendReceive()
+*/
+inline TInt RSecuritySvrSession::EraseCrashLog(const TUint32 aPos, const TUint32 aBlockNumber)
+	{	
+		TIpcArgs args(aPos, aBlockNumber);
+		TInt res = SendReceive(EDebugServEraseCrashFlash, args);
+		return res;
+	}
+
+/**
+Purpose:
+Method to erase entire flash partition
+
+@return Any error which may be returned by RSessionBase::SendReceive()
+*/
+inline TInt RSecuritySvrSession::EraseCrashFlashPartition()
+	{
+	TInt res = SendReceive(EDebugServEraseEntireCrashFlash);
+	return res;
+	}
+
+} // end of Debug namespace declaration
+
+#endif // #ifndef __KERNEL_MODE__
+
+#endif // RM_DEBUG_API_H
+
+
+
--- a/kernel/eka/include/slab.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-// Copyright (c) 1994-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:
-// kernel\eka\include\slab.h
-// 
-//
-
-#ifndef __KERNEL_MODE__
-
-class slab;
-class slabhdr;
-#define MAXSLABSIZE		56
-#define	PAGESHIFT		12
-#define PAGESIZE		(1<<PAGESHIFT)
-#define	SLABSHIFT		10
-#define	SLABSIZE		(1 << SLABSHIFT)
-#define CELLALIGN		8
-
-
-const unsigned slabfull  = 0;
-const TInt	slabsperpage = (int)(PAGESIZE/SLABSIZE);
-#define HIBIT(bits) (((unsigned)bits & 0xc) ? 2 + ((unsigned)bits>>3) : ((unsigned) bits>>1))
-
-#define LOWBIT(bits)	(((unsigned) bits&3) ? 1 - ((unsigned)bits&1) : 3 - (((unsigned)bits>>2)&1))
-
-#define ZEROBITS(header)	(((unsigned)header & 0x70000000) ? 0 : 1)
-
-class slabhdr
-{
-	public:
-		unsigned iHeader;
-		// made up of
-		// bits   |    31    | 30..28 | 27..18 | 17..12 |  11..8  |   7..0   |
-		//        +----------+--------+--------+--------+---------+----------+
-		// field  | floating |  zero  | used-4 |  size  | pagemap | free pos |
-		//
-		slab** iParent;		// reference to iParent's pointer to this slab in tree
-		slab* iChild1;		// 1st iChild in tree
-		slab* iChild2;		// 2nd iChild in tree
-};
-
-const TInt KMaxSlabPayload = SLABSIZE - sizeof(slabhdr);
-#define MAXUSEDM4BITS   0x0fc00000
-#define FLOATING_BIT    0x80000000
-
-inline unsigned HeaderFloating(unsigned h)
-{return (h&0x80000000);}
-const unsigned maxuse = (SLABSIZE - sizeof(slabhdr))>>2;
-const unsigned firstpos = sizeof(slabhdr)>>2;
-
-#ifdef _DEBUG
-#define CHECKTREE(x) DoCheckSlabTree(x,EFalse)
-#define CHECKSLAB(s,t,p) DoCheckSlab(s,t,p)
-#define CHECKSLABBFR(s,p) {TUint32 b[4]; BuildPartialSlabBitmap(b,s,p);}
-#else
-#define CHECKTREE(x) (void)0
-#define CHECKSLAB(s,t,p) (void)0
-#define CHECKSLABBFR(s,p) (void)0
-#endif
-
-class slabset
-{
-	public:
-		slab* iPartial;
-};
-
-class slab : public slabhdr
-{
-	public:
-		void Init(unsigned clz);
-		//static slab* SlabFor( void* p);
-		static slab* SlabFor(const void* p) ;
-		unsigned char iPayload[SLABSIZE-sizeof(slabhdr)];
-};
-
-class page
-{
-	public:
-		inline static page* PageFor(slab* s);
-		//slab iSlabs;
-		slab iSlabs[slabsperpage];
-};
-
-
-inline page* page::PageFor(slab* s)
-{
-	return reinterpret_cast<page*>((unsigned(s))&~(PAGESIZE-1));
-}
-
-
-#endif   // __KERNEL_MODE__
--- a/kernel/eka/include/sm_debug_api.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/sm_debug_api.h	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -23,1454 +23,11 @@
 #ifndef D_STOP_MODE_API_H
 #define D_STOP_MODE_API_H
 
+#include <rm_debug_api.h>
 #include <plat_priv.h>
-#include <e32cmn.h>
-#include <e32def_private.h>
-
 
 namespace Debug
-    {
-
-
-/** This is the maximum size in bytes a user trace can be */
-const TInt TUserTraceSize = 256;
-
-/**
-  Information in the debug functionality block is represented as a concatenation
-  of pairs of TTagHeader structures and arrays of TTag objects.
-  @see TTagHeader
-  @see RSecuritySvrSession::GetDebugFunctionality
-  */
-struct TTag
-{
-    /** Tag ID, value identifying this tag. */
-    TUint32 iTagId;
-    /**
-      Values correspond to TTagType enumerators.
-      @see TTagType
-      */
-    TUint16 iType;
-    /** Size of external data associated with this tag. */
-    TUint16 iSize;
-    /** Data associated with this tag. */
-    TUint32 iValue;
-};
-
-/**
-  Enumeration defining the supported tag types. These enumerators are used in TTag.iTagId.
-  @see TTag
-  */
-enum TTagType
-{
-    /** Indicates that the iValue field of a TTag structure will contain either ETrue or EFalse. */
-    ETagTypeBoolean = 0,
-    /** Indicates that the iValue field of a TTag structure will contain a value in the TUint32 range. */
-    ETagTypeTUint32 = 1,
-    /** Indicates that the iValue field of a TTag structure will contain values from an enumeration. */
-    ETagTypeEnum = 2,
-    /** Indicates that the iValue field of a TTag structure should be interpreted as a bit field. */
-    ETagTypeBitField = 3,
-    /** Indicates that the type of the iValue field of a TTag structure is unknown. */
-    ETagTypeUnknown = 4,
-    /** Indicates that the iValue field of a TTag structure will contain a pointer. */
-    ETagTypePointer = 5
-};
-
-/**
-  Information in the debug functionality block is represented as a concatenation
-  of pairs of TTagHeader structures and arrays of TTag objects.
-  @see TTag
-  @see RSecuritySvrSession::GetDebugFunctionality
-  */
-struct TTagHeader
-{
-    /** Value identifying the contents of this TTagHeader, should be interpreted as an enumerator from TTagHeaderId.
-      @see TTagHeaderId
-      */
-    TUint16 iTagHdrId;
-    /** The number of TTag elements in the array associated with this TTagHeader. */
-    TUint16 iNumTags;
-};
-
-/**
-  Enumeration used to identify TTagHeader structures, TTagHeader::iTagHdrId elements take these enumerators as values.
-  @see TTagHeader
-  */
-enum TTagHeaderId
-{
-    ETagHeaderIdCore = 0,            /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityCore. */
-    ETagHeaderIdMemory = 1,          /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityMemory. */
-    /**
-      Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityRegister.
-      These values are defined as in the document Symbian Core Dump File Format Appendix C
-      (see SGL.TS0028.027 - Symbian Core Dump File Format v1.0.doc).
-      The TTag objects in the associated array have an iSize value corresponding to the size of the register's data in bytes.
-      */
-    ETagHeaderIdRegistersCore = 2,
-    /**
-      Identifies a TTagHeader with associated TTag elements with iTagId values corresponding to coprocessor register identifiers.
-      Coprocessor registers are defined as in the document Symbian Core Dump File Format Appendix C as follows
-      (see SGL.TS0028.027 - Symbian Core Dump File Format v1.0.doc):
-
-      For each 32-bit data word defining a co-pro register, the definition of the meaning of the bits follows
-      the ARM Architecture Reference manual instruction coding
-
-      Upper Halfword    Lower Halfword
-      Opcode 2          CRm
-
-      For example: The Domain Access Control Register is Register 3 of co-processor 15. The encoding is therefore
-      CRm = 3
-      Opcode2 = 0
-
-      Therefore the functionality tag would be:
-      TagID:  15            // co-processor number
-      Type: ETagTypeTUint32
-      Data: 0x00000003      // Opcode2 = 0, CRm = 3
-      */
-    ETagHeaderIdCoProRegisters = 3,  /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityRegister. */
-    ETagHeaderIdBreakpoints = 4,     /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityBreakpoint. */
-    ETagHeaderIdStepping = 5,        /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityStep. */
-    ETagHeaderIdExecution = 6,       /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityExec. */
-    ETagHeaderIdEvents = 7,          /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TEventType. */
-    ETagHeaderIdApiConstants = 8,    /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityApiConstants.*/
-    ETagHeaderList = 9,              /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TListId. */
-    ETagHeaderIdKillObjects = 10,    /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityKillObject. */
-    ETagHeaderIdSecurity = 11,       /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalitySecurity */
-    ETagHeaderIdBuffers = 12,        /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TBufferType. */
-    ETagHeaderIdStopModeFunctions = 13, /**< Identifies a TTagHeader with associated TTag elements with iTagId values from TFunctionalityStopModeFunctions. */  
-};
-
-/**
-  This structure is not used in the run-mode debug API.
-  @deprecated
-  */
-struct TSubBlock
-{
-    /** Header to identify the TSubBlock. */
-    TTagHeader iHeader;
-    /** Pointer to array of TTag values associated with this TSubBlock. */
-    TTag* iTagArray;
-};
-
-/**
-  These tags define what kinds of core functionality are supported by the run-mode debug subsystem.
-  TTag structures associated with the ETagHeaderIdCore sub-block will have iTagId values from this enumeration.
-  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
-  */
-enum TFunctionalityCore
-{
-    ECoreEvents = 0,        /**< Indicates whether events processing is supported. */
-    ECoreStartStop = 1,     /**< Indicates whether suspending and resuming threads is supported. */
-    ECoreMemory = 2,        /**< Indicates whether reading and writing memory is supported. */
-    ECoreRegister = 3,      /**< Indicates whether reading and writing register values is supported. */
-    ECoreBreakpoint = 4,    /**< Indicates whether breakpoints are supported. */
-    ECoreStepping = 5,      /**< Indicates whether stepping is supported. */
-    ECoreLists = 6,         /**< Indicates whether listings are supported. */
-    ECoreLogging = 7,       /**< Indicates whether logging is supported. */
-    ECoreHardware = 8,      /**< Indicates whether hardware support is supported. */
-    ECoreApiConstants = 9,  /**< Indicates whether the information in the ETagHeaderIdApiConstants sub-block is relevant. */
-    ECoreKillObjects = 10,  /**< Indicates whether killing objects (i.e. threads and processes) is supported. */
-    ECoreSecurity = 11,     /**< Indicates whether OEM Debug token support or other security info is supported. */
-    ECoreStopModeFunctions = 12, /**< Indicates whether Stop Mode function calling is supported. */
-    ECoreStopModeBuffers = 13, /**< Indicates whether Stop Mode buffers are supported. */
-    
-    /**
-      @internalTechnology
-      A debug agent should find the number of core tags from the DFBlock rather than this enumerator.
-      */
-    ECoreLast
-};
-
-/**
-  These tags define what kind of memory operations can be performed.
-  TTag structures associated with the ETagHeaderIdMemory sub-block will have iTagId values from this enumeration.
-  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
- */
-enum TFunctionalityMemory
-{
-    EMemoryRead = 0,          /**< Indicates whether reading memory is supported. */
-    EMemoryWrite = 1,         /**< Indicates whether writing memory is supported. */
-    EMemoryAccess64 = 2,      /**< Indicates whether 64 bit memory access is supported. */
-    EMemoryAccess32 = 3,      /**< Indicates whether 32 bit memory access is supported. */
-    EMemoryAccess16 = 4,      /**< Indicates whether 16 bit memory access is supported. */
-    EMemoryAccess8 = 5,       /**< Indicates whether 8 bit memory access is supported. */
-    EMemoryBE8 = 6,           /**< Indicates whether reading memory as 8 bit big-endian values is supported. */
-    EMemoryBE32 = 7,          /**< Indicates whether reading memory as 32 bit big-endian values is supported. */
-    EMemoryLE8 = 8,           /**< Indicates whether reading memory as 8 bit little-endian values is supported. */
-    EMemoryMaxBlockSize = 9,  /**< Corresponds to the maximum size of a block of memory which can be requested. */
-    /**
-      @internalTechnology
-      A debug agent should find the number of memory tags from the DFBlock rather than this enumerator.
-      */
-    EMemoryLast
-};
-
-/**
-  These tags define which objects can be killed by the device driver.
-  TTag structures associated with the ETagHeaderIdKillObjects sub-block will have iTagId values from this enumeration.
-  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
- */
-enum TFunctionalityKillObject
-{
-    EFunctionalityKillThread = 0,          /**< Indicates whether killing threads is supported. */
-    EFunctionalityKillProcess = 1,         /**< Indicates whether killing processes is supported. */
-    /**
-      @internalTechnology
-      A debug agent should find the number of kill object tags from the DFBlock rather than this enumerator.
-      */
-    EFunctionalityKillObjectLast
-};
-
-/**
-  A TTag with an id from the TFunctionalityRegister enum will have a value from this enumeration.
-  The values define how a register can be accessed, if at all.
- */
-enum TFunctionalityAccess
-{
-    EAccessNone = 0,       /**< Indicates that a register cannot be accessed. */
-    EAccessReadOnly = 1,   /**< Indicates that a register can be read, but not written to. */
-    EAccessWriteOnly = 2,  /**< Indicates that a register can be written to, but not read. */
-    EAccessReadWrite = 3,  /**< Indicates that a register can be both read and written to. */
-    EAccessUnknown = 4,    /**< Indicates that it is unspecified whether reading or writing to a register is possible. */
-};
-
-/**
-  These enumerators act as core register identifiers.
-  TTag structures associated with the ETagHeaderIdRegistersCore sub-block will have iTagId values from this enumeration.
-  The numeric value of each enumerator identifies the register according to the definitions in the Symbian Core Dump File Format Appendix B
-  (see SGL.TS0028.027 - Symbian Core Dump File Format v1.0.doc).
-  */
-enum TFunctionalityRegister
-{
-    ERegisterR0 = 0x00000000,      /**< Identifier for user mode register R0. */
-    ERegisterR1 = 0x00000100,      /**< Identifier for user mode register R1. */
-    ERegisterR2 = 0x00000200,      /**< Identifier for user mode register R2. */
-    ERegisterR3 = 0x00000300,      /**< Identifier for user mode register R3. */
-    ERegisterR4 = 0x00000400,      /**< Identifier for user mode register R4. */
-    ERegisterR5 = 0x00000500,      /**< Identifier for user mode register R5. */
-    ERegisterR6 = 0x00000600,      /**< Identifier for user mode register R6. */
-    ERegisterR7 = 0x00000700,      /**< Identifier for user mode register R7. */
-    ERegisterR8 = 0x00000800,      /**< Identifier for user mode register R8. */
-    ERegisterR9 = 0x00000900,      /**< Identifier for user mode register R9. */
-    ERegisterR10 = 0x00000a00,     /**< Identifier for user mode register R10. */
-    ERegisterR11 = 0x00000b00,     /**< Identifier for user mode register R11. */
-    ERegisterR12 = 0x00000c00,     /**< Identifier for user mode register R12. */
-    ERegisterR13 = 0x00000d00,     /**< Identifier for user mode register R13. */
-    ERegisterR14 = 0x00000e00,     /**< Identifier for user mode register R14. */
-    ERegisterR15 = 0x00000f00,     /**< Identifier for user mode register R15. */
-    ERegisterCpsr = 0x00001000,    /**< Identifier for CPSR. */
-    ERegisterR13Svc = 0x00001100,  /**< Identifier for R13 supervisor mode banked register. */
-    ERegisterR14Svc = 0x00001200,  /**< Identifier for R14 supervisor mode banked register. */
-    ERegisterSpsrSvc = 0x00001300, /**< Identifier for SPSR supervisor mode banked register. */
-    ERegisterR13Abt = 0x00001400,  /**< Identifier for R13 Abort mode banked register. */
-    ERegisterR14Abt = 0x00001500,  /**< Identifier for R14 Abort mode banked register. */
-    ERegisterSpsrAbt = 0x00001600, /**< Identifier for SPSR Abort mode banked register. */
-    ERegisterR13Und = 0x00001700,  /**< Identifier for R13 Undefined mode banked register. */
-    ERegisterR14Und = 0x00001800,  /**< Identifier for R14 Undefined mode banked register. */
-    ERegisterSpsrUnd = 0x00001900, /**< Identifier for SPSR Undefined mode banked register. */
-    ERegisterR13Irq = 0x00001a00,  /**< Identifier for R13 Interrupt mode banked register. */
-    ERegisterR14Irq = 0x00001b00,  /**< Identifier for R14 Interrupt mode banked register. */
-    ERegisterSpsrIrq = 0x00001c00, /**< Identifier for SPSR Interrupt mode banked register. */
-    ERegisterR8Fiq = 0x00001d00,   /**< Identifier for R8 Fast Interrupt mode banked register. */
-    ERegisterR9Fiq = 0x00001e00,   /**< Identifier for R9 Fast Interrupt mode banked register. */
-    ERegisterR10Fiq = 0x00001f00,  /**< Identifier for R10 Fast Interrupt mode banked register. */
-    ERegisterR11Fiq = 0x00002000,  /**< Identifier for R11 Fast Interrupt mode banked register. */
-    ERegisterR12Fiq = 0x00002100,  /**< Identifier for R12 Fast Interrupt mode banked register. */
-    ERegisterR13Fiq = 0x00002200,  /**< Identifier for R13 Fast Interrupt mode banked register. */
-    ERegisterR14Fiq = 0x00002300,  /**< Identifier for R14 Fast Interrupt mode banked register. */
-    ERegisterSpsrFiq = 0x00002400, /**< Identifier for SPSR Fast Interrupt mode banked register. */
-    /**
-      @internalTechnology
-      A debug agent should find the number of core registers from the DFBlock rather than this enumerator.
-      */
-    ERegisterLast = 37
-};
-
-
-/**
-  These tags define the kind of breakpoints that are supported.
-  TTag structures associated with the ETagHeaderIdBreakpoints sub-block will have iTagId values from this enumeration.
-  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
- */
-enum TFunctionalityBreakpoint
-{
-    EBreakpointThread = 0,         /**< Indicates whether thread specific breakpoints are supported. */
-    EBreakpointProcess = 1,        /**< Indicates whether process specific breakpoints are supported. */
-    EBreakpointSystem = 2,         /**< Indicates whether system wide breakpoints are supported. */
-    EBreakpointArm = 3,            /**< Indicates whether ARM mode breakpoints are supported. */
-    EBreakpointThumb = 4,          /**< Indicates whether Thumb mode breakpoints are supported. */
-    EBreakpointT2EE = 5,           /**< Indicates whether Thumb2 mode breakpoints are supported. */
-    EBreakpointArmInst = 6,        /**< Reserved for future use. */
-    EBreakpointThumbInst = 7,      /**< Reserved for future use. */
-    EBreakpointT2EEInst = 8,       /**< Reserved for future use. */
-    EBreakpointSetArmInst = 9,     /**< Reserved for future use. */
-    EBreakpointSetThumbInst = 10,  /**< Reserved for future use. */
-    EBreakpointSetT2EEInst = 11,   /**< Reserved for future use. */
-    /**
-      @internalTechnology
-      A debug agent should find the number of breakpoint tags from the DFBlock rather than this enumerator.
-      */
-    EBreakpointLast
-};
-
-/**
-  These enumerators provide information about the stepping capabilities of the debug sub-system.
-  TTag structures associated with the ETagHeaderIdStepping sub-block will have iTagId values from this enumeration.
-  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
- */
-enum TFunctionalityStep
-{
-    EStep = 0, /**< Indicates whether instruction stepping is supported. */
-    /**
-      @internalTechnology
-      A debug agent should find the number of stepping tags from the DFBlock rather than this enumerator.
-      */
-    EStepLast
-};
-
-/**
-  These enumerators provide information about the execution control capabilities of the debug sub-system.
-  TTag structures associated with the ETagHeaderIdExecution sub-block will have iTagId values from this enumeration.
-  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
- */
-enum TFunctionalityExec
-{
-    EExecThreadSuspendResume = 0,  /**< Indicates whether suspending and resuming threads is supported. */
-    EExecProcessSuspendResume = 1, /**< Indicates whether suspending and resuming processes is supported. */
-    EExecSystemSuspendResume = 2,  /**< Indicates whether suspending and resuming the entire system is supported. */
-    /**
-      @internalTechnology
-      A debug agent should find the number of execution control tags from the DFBlock rather than this enumerator.
-      */
-    EExecLast
-};
-
-/**
-  This enumeration defines the event types supported by the debug sub-system.
-  TTag structures associated with the ETagHeaderIdEvents sub-block will have
-  iTagId values from this enumeration, and iValue values from the TKernelEventAction enumeration.
-
-  These enumerators are also used by the RSecuritySvrSession API to identify events.
-  @see RSecuritySvrSession
-  @see TKernelEventAction
- */
-enum TEventType
-{
-    EEventsBreakPoint = 0,    /**< Identifies a breakpoint event. */
-    EEventsSwExc = 1,         /**< Identifies a software exception event. */
-    EEventsHwExc = 2,         /**< Identifies a hardware exception event. */
-    EEventsKillThread = 3,    /**< Identifies a kill thread event. */
-    EEventsAddLibrary = 4,    /**< Identifies an add library event. */
-    EEventsRemoveLibrary = 5, /**< Identifies a remove library event. */
-    /**
-     If an event is generated and there is only a single space remaining in the events queue then
-     an event of type EEventsBufferFull will be stored in the queue and the generated event will
-     be discarded. If further events occur while the buffer is full the events will be discarded.
-     As such an event of type EEventsBufferFull being returned signifies that one or more events
-     were discarded. An event of this type has no valid data associated with it.
-     */
-    EEventsBufferFull = 6,
-    EEventsUnknown = 7,       /**< Identifies an event of unknown type. */
-    EEventsUserTrace = 8,     /**< Identifies a user trace. */
-    EEventsProcessBreakPoint = 9, /**< Identifies a process breakpoint event. */
-    EEventsStartThread = 10, /**< Identifies a start thread event. */
-    EEventsUserTracesLost = 11, /**< Identifies user traces being lost. */
-    EEventsAddProcess = 12, /**< Identifies an AddProcess event */
-    EEventsRemoveProcess = 13, /**< Identifies a RemoveProcess event */
-    /**
-      @internalTechnology
-      A debug agent should find the number of event types from the DFBlock rather than this enumerator.
-      */
-    EEventsLast
-};
-
-/**
-  These enumerators provide information about constants which are used in the RSecuritySvrSession API.
-  TTag structures associated with the ETagHeaderIdApiConstants sub-block will have iTagId values from this enumeration.
-  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
- */
-enum TFunctionalityApiConstants
-    {
-    /**
-      Corresponds to the size of a buffer required to store a TEventInfo.
-      @see TEventInfo
-      */
-    EApiConstantsTEventInfoSize = 0,
-    /**
-      @internalTechnology
-      A debug agent should find the number of API constants tags from the DFBlock rather than this enumerator.
-      */
-    EApiConstantsLast,
-    };
-
-/**
-  The set of possible actions which could be taken when a kernel event occurs.
-  Not all actions are possible for all events. The debug functionality sub-block with header id ETagHeaderIdEvents
-  indicates which values are permitted for each event. The value given for that event should be
-  considered as the most intrusive action the debugger may set: with the definition that EActionSuspend is more
-  intrusive than EActionContinue, which is more intrusive than EActionIgnore.
-  @see RSecuritySvrSession
-  */
-enum TKernelEventAction
-{
-    /** If an event action is set to this value then events of that type will be
-      ignored, and not reported to the debugger. */
-    EActionIgnore = 0,
-    /** If an event action is set to this value then events of that type will be
-      reported to the debugger and the thread which generated the event will be
-      allowed to continue executing. */
-    EActionContinue = 1,
-    /** If an event action is set to this value then events of that type will be
-      reported to the debugger and the thread which generated the event will be
-      suspended. */
-    EActionSuspend = 2,
-    /**
-      @internalTechnology
-      Count of event actions.
-      */
-    EActionLast
-};
-
-/**
-  These enumerators provide information about the ability of the debug subsystem to support OEM Debug tokens.
-  TTag structures associated with the ETagHeaderIdSecurity sub-block will have iTagId values from this enumeration.
-  See each enumerator for an explanation of how a TTag with that iTagId should be interpreted.
- */
-enum TFunctionalitySecurity
-{
-    ESecurityOEMDebugToken = 0,  /**< Indicates whether the DSS supports the use of OEM Debug Tokens. */
-
-    /**
-      @internalTechnology
-      A debug agent should find the number of tags from the DFBlock rather than this enumerator.
-      */
-    ESecurityLast
-};
-
-/**
-  Used for storing the contents of a 32 bit register
-  */
-typedef TUint32 TRegisterValue32;
-
-
-/**
- * Processor mode
- */
-enum TArmProcessorModes
-{
-    EUserMode=0x10,     //!< EUserMode
-    EFiqMode=0x11,      //!< EFiqMode
-    EIrqMode=0x12,      //!< EIrqMode
-    ESvcMode=0x13,      //!< ESvcMode
-    EAbortMode=0x17,    //!< EAbortMode
-    EUndefMode=0x1b,    //!< EUndefMode
-    EMaskMode=0x1f      //!< EMaskMode
-};
-
-
-
-/**
-  Structure containing information about the state of the registers when a
-  hardware exception occurred
-  */
-class TRmdArmExcInfo
-    {
-public:
-    /** Enumeration detailing the types of exception which may occur. */
-    enum TExceptionType
-        {
-        /** Enumerator signifying that a prefetch abort error has occurred. */
-        EPrefetchAbort = 0,
-        /** Enumerator signifying that a data abort error has occurred. */
-        EDataAbort = 1,
-        /** Enumerator signifying that an undefined instruction error has occurred. */
-        EUndef =2
-        };
-
-    /** Value of CPSR. */
-    TRegisterValue32 iCpsr;
-    /** Type of exception which has occurred. */
-    TExceptionType iExcCode;
-    /** Value of R13 supervisor mode banked register. */
-    TRegisterValue32 iR13Svc;
-    /** Value of user mode register R4. */
-    TRegisterValue32 iR4;
-    /** Value of user mode register R5. */
-    TRegisterValue32 iR5;
-    /** Value of user mode register R6. */
-    TRegisterValue32 iR6;
-    /** Value of user mode register R7. */
-    TRegisterValue32 iR7;
-    /** Value of user mode register R8. */
-    TRegisterValue32 iR8;
-    /** Value of user mode register R9. */
-    TRegisterValue32 iR9;
-    /** Value of user mode register R10. */
-    TRegisterValue32 iR10;
-    /** Value of user mode register R11. */
-    TRegisterValue32 iR11;
-    /** Value of R14 supervisor mode banked register. */
-    TRegisterValue32 iR14Svc;
-    /** Address which caused exception (System Control Coprocessor Fault Address Register) */
-    TRegisterValue32 iFaultAddress;
-    /** Value of System Control Coprocessor Fault Status Register. */
-    TRegisterValue32 iFaultStatus;
-    /** Value of SPSR supervisor mode banked register. */
-    TRegisterValue32 iSpsrSvc;
-    /** Value of user mode register R13. */
-    TRegisterValue32 iR13;
-    /** Value of user mode register R14. */
-    TRegisterValue32 iR14;
-    /** Value of user mode register R0. */
-    TRegisterValue32 iR0;
-    /** Value of user mode register R1. */
-    TRegisterValue32 iR1;
-    /** Value of user mode register R2. */
-    TRegisterValue32 iR2;
-    /** Value of user mode register R3. */
-    TRegisterValue32 iR3;
-    /** Value of user mode register R12. */
-    TRegisterValue32 iR12;
-    /** Value of user mode register R15, points to instruction which caused exception. */
-    TRegisterValue32 iR15;
-    };
-
-/**
-  The maximum size, in bytes, of the panic category string returned as part of a
-  TEventInfo object.
-
-  @see TEventInfo
-  @see TThreadKillInfo
-  */
-const TInt KPanicCategoryMaxName = KMaxName;
-
-/**
-  Event specific information returned as part of a TEventInfo object when
-  an agent set breakpoint is hit.
-  */
-class TThreadBreakPointInfo
-    {
-public:
-    /** Identifies the type of exception. */
-    TExcType iExceptionNumber;
-    /** Structure containing information about the ARM register values. */
-    TRmdArmExcInfo iRmdArmExcInfo;
-    };
-
-/**
-  Event specific information returned as part of a TEventInfo object when
-  a software exception occurs.
-  */
-class TThreadSwExceptionInfo
-    {
-public:
-    /** The value of the program counter. */
-    TUint32 iCurrentPC;
-    /** Identifies the type of exception. */
-    TExcType iExceptionNumber;
-    };
-
-/**
-  Event specific information returned as part of a TEventInfo object when
-  a hardware exception occurs.
-  */
-class TThreadHwExceptionInfo
-    {
-public:
-    /** Identifies the type of exception. */
-    TExcType iExceptionNumber;
-    /** Structure containing information about the ARM register values. */
-    TRmdArmExcInfo iRmdArmExcInfo;
-    };
-
-/**
-  Event specific information returned as part of a TEventInfo object when
-  a thread kill event occurs.
-  */
-class TThreadKillInfo
-    {
-public:
-    /** The value of the program counter. */
-    TUint32 iCurrentPC;
-    /** Specifies the reason for the kill thread event, this value is specific to the killed thread and does not correspond to a standard Symbian enumeration. */
-    TInt iExitReason;
-    /** Specifies the type of the thread kill event, values correspond to elements of TExitType. */
-    TUint8 iExitType;
-    /** The panic category of the killed thread. */
-    TUint8 iPanicCategory[KPanicCategoryMaxName];
-    /** Contains the length in bytes of the initialised data in iPanicCategory. */
-    TInt iPanicCategoryLength;
-    };
-
-/**
-  Event specific information returned as part of a TEventInfo object when
-  a library load event occurs.
-  */
-class TLibraryLoadedInfo
-    {
-public:
-    /** The name of the file that the library was loaded from. */
-    TUint8 iFileName[KMaxName];
-    /** Contains the length in bytes of the initialised data in iFileName. */
-    TInt iFileNameLength;
-    /** The code base address (.text). */
-    TUint32 iCodeAddress;
-    /** The base address of the initialised data section (.data). */
-    TUint32 iDataAddress;
-    };
-
-/**
-  Event specific information returned as part of a TEventInfo object when
-  a thread is started
-  */
-class TStartThreadInfo
-    {
-public:
-    /** The name of the file that the process owning the thread was created from. */
-    TUint8 iFileName[KMaxName];
-    /** Contains the length in bytes of the initialised data in iFileName. */
-    TInt iFileNameLength;
-    };
-
-/**
-  Event specific information returned as part of a TEventInfo object when
-  a process is added. Note that the Process may not be fully constructed,
-  e.g. no threads.
-  */
-class TAddProcessInfo
-    {
-public:
-    /** The name of the file that the process was created from. */
-    TUint8 iFileName[KMaxName];
-    /** Contains the length in bytes of the initialised data in iFileName. */
-    TInt iFileNameLength;
-    /** The UID3 of this process */
-    TUint32 iUid3;  
-    /** Contains the CreatorThread ID if available: May be 0 */
-    TUint64 iCreatorThreadId;  
-    };
-
-/**
-  Event specific information returned as part of a TEventInfo object when
-  a process is removed. Note that the Process may not be fully destroyed,
-  so its resources should only be accessed if you already have a handle to it.
-  */
-class TRemoveProcessInfo
-    {
-public:
-    /** The name of the file that the process was created from. */
-    TUint8 iFileName[KMaxName];
-    /** Contains the length in bytes of the initialised data in iFileName. */
-    TInt iFileNameLength;
-    TUint32 iSpare1;    // Unused
-    };
-
-/**
-  Event specific information returned as part of a TEventInfo object when
-  a library unload event occurs.
-  */
-class TLibraryUnloadedInfo
-    {
-public:
-    /** The name of the file that the library was loaded from. */
-    TUint8 iFileName[KMaxName];
-    /** Contains the length in bytes of the initialised data in iFileName. */
-    TInt iFileNameLength;
-    };
-
-/**
- * Enum to represent the context of a user trace message
- */ 
-enum TUserTraceMessageContext 
-{
-    ESingleMessage = 0x1,   /** Indicates this message is the only one corresponding to a given user trace */ 
-    EMultiStart = 0x2, /** Indicates this message is the start of a user trace which consists of multiple messages */
-    EMultiMid = 0x3, /** Indicates this message is one in a series of user trace messages */
-    EMultiEnd = 0x4, /** Indicates this message is the last in a series of user trace messages */
-    /**
-      @internalTechnology
-      A debug agent should find the number of core tags from the DFBlock rather than this enumerator.
-      */
-    ELast = 0x5 
-};
-    
-/**
- *   Event specific information returned as part of a TEventInfo object 
- *   when a user trace event occurs.
- */
-class TUserTraceInfo
-    {
-public:
-    /** The user trace text */
-    TUint8 iUserTraceText[TUserTraceSize];
-    
-    /** User trace text length */
-    TInt iUserTraceLength;
-    
-    /** The context of the message */
-    TUserTraceMessageContext iMessageStatus;
-    };
-    
-    
-/**
-  Structure used to store information about an event. An object of this type
-  is passed as an argument to the RSecuritySvrSession::GetEvent function,
-  and is filled in by the debug driver, and returned to the agent, when a
-  relevant event occurs.
-
-  The debug functionality block contains the size in bytes of the data that
-  the driver will return when a GetEvent call is issued. A debug agent should
-  ensure that this value equals the size of this TEventInfo object to ensure
-  that a compatible debug driver is being used. The value is stored as
-  EApiConstantsTEventInfoSize in the TFunctionalityApiConstants block.
-
-  @see RSecuritySvrSession::GetDebugFunctionality
-  @see RSecuritySvrSession::GetEvent
-  */
-class TEventInfo
-    {
-public:
-
-    /** Constructor sets all elements to default values. */
-    inline TEventInfo() { Reset(); };
-
-    /** Resets all values to default values. */
-    inline void Reset()
-        {
-        iProcessId = 0;
-        iProcessIdValid = EFalse;
-        iThreadId = 0;
-        iThreadIdValid = EFalse;
-        iEventType = (TEventType)NULL;
-        };
-
-public:
-
-    /** The process ID of the process which the event occurred in. */
-    TUint64                 iProcessId;
-    /** The thread ID of the thread which the event occurred in. */
-    TUint64                 iThreadId;
-    /** Has value ETrue if iProcessId is valid, EFalse otherwise. */
-    TUint8                  iProcessIdValid;
-    /** Has value ETrue if iThreadId is valid, EFalse otherwise. */
-    TUint8                  iThreadIdValid;
-    /** Indicates the type of the event. This type should be used to determine
-        the type of the information stored in the union which is part of this class. */
-    TEventType              iEventType;
-    union
-        {
-        /** Information which is specific to the break point event. */
-        TThreadBreakPointInfo iThreadBreakPointInfo;
-        /** Information which is specific to the software exception event. */
-        TThreadSwExceptionInfo iThreadSwExceptionInfo;
-        /** Information which is specific to the hardware exception event. */
-        TThreadHwExceptionInfo iThreadHwExceptionInfo;
-        /** Information which is specific to the thread kill event. */
-        TThreadKillInfo iThreadKillInfo;
-        /** Information which is specific to the library loaded event. */
-        TLibraryLoadedInfo iLibraryLoadedInfo;
-        /** Information which is specific to the library unloaded event. */
-        TLibraryUnloadedInfo iLibraryUnloadedInfo;
-        /** Information which is specific to the user trace event. */
-        TUserTraceInfo iUserTraceInfo;
-        /** Information which is specific to the start thread event. */
-        TStartThreadInfo iStartThreadInfo;
-        /** Information which is specific to the Add Process event. */
-        TAddProcessInfo iAddProcessInfo;
-        /** Information which is specific to the Remove Process event. */
-        TRemoveProcessInfo iRemoveProcessInfo;
-        };
-    };
-
-/**
-  @internalComponent
-  */
-class TProcessInfo
-    {
-    public:
-
-        inline TProcessInfo() { Reset(); }
-
-        inline TProcessInfo(TUint32 aId, TUint32 aCodeAddress, TUint32 aCodeSize, TUint32 aDataAddress)
-                : iId(aId),
-                  iCodeAddress(aCodeAddress),
-                  iCodeSize(aCodeSize),
-                  iDataAddress(aDataAddress) { }
-
-        inline void Reset()
-            {
-            iId = 0;
-            iCodeAddress = 0;
-            iCodeSize = 0;
-            iDataAddress = 0;
-            }
-
-    public:
-
-        TUint32 iId;
-        TUint32 iCodeAddress;
-        TUint32 iCodeSize;
-        TUint32 iDataAddress;
-    };
-
-/* Other functionality may be defined here later */
-
-/**
-Represents a register id value, in the terms of the Symbian ELF format:
- - bits 0-7 define the class
- - bits 8-15 define the rd_id
- - bits 16-31 define the rd_sub_id
-
-Both the core registers (TFunctionalityRegister type) and the coprocessor registers
-follow this identifier scheme.
-*/
-typedef TUint32 TRegisterInfo;
-
-/**
-Enum representing the status flags which could be returned from a register
-access call.
-*/
-enum TRegisterFlag
-    {
-    /**
-    Default value, a register access call will never return this value
-    */
-    ENotSet = 0,
-    /**
-    Would be returned if the register is supported by the debug driver but the kernel cannot access the register
-    */
-    EInValid = 1,
-    /**
-    Would be returned if the register could be accessed correctly
-    */
-    EValid = 2,
-    /**
-    Would be returned if the register is not supported by the debug driver
-    */
-    ENotSupported = 3,
-    /**
-    Would be returned if a non-4 byte register value was requested
-    */
-    EBadSize = 4
-    };
-
-/**
-Enum representing the different ARM CPU instruction set architectures.
-*/
-enum TArchitectureMode
-    {
-    /** Represents the ARM CPU architecture. */
-    EArmMode = 1,
-    /** Represents the Thumb CPU architecture. */
-    EThumbMode = 2,
-    /**
-      Represents the Thumb2 CPU architecture.
-      @prototype
-      */
-    EThumb2EEMode = 3
-    };
-
-/**
-  Used as an identifier for breakpoints set by the RSecuritySvrSession::SetBreak function.
-  @see RSecuritySvrSession
-  */
-typedef TInt32 TBreakId;
-
-/**
-  Specifies the type of a code segment.
-  @see TCodeSegListEntry
-  */
-enum TCodeSegType
-    {
-    EUnknownCodeSegType = 0, /**< Signifies an unknown code segment type. */
-    EExeCodeSegType = 1,     /**< Signifies a code segment belonging to an executable. */
-    EDllCodeSegType = 2      /**< Signifies a code segment belonging to a library. */
-    };
-
-/**
-Structure used for extracting data from a descriptor returned by a call to
-RSecuritySvrSession::GetList() when GetList() is called with TListId::ECodeSegs
-as the first argument.
-
-@see RSecuritySvrSession::GetList()
-
-@code
-//buffer is a TDesC8 containing 4-byte aligned TCodeSegListEntry objects
-//create a pointer to the start of the data
-TUint8* ptr = (TUint8*)buffer.Ptr();
-//create a pointer to the end of the data
-const TUint8* ptrEnd = ptr + buffer.Length();
-while(ptr < ptrEnd)
-    {
-    //cast the pointer to be a TCodeSegListEntry object
-    TCodeSegListEntry& entry = *(TCodeSegListEntry*)ptr;
-    //use the TCodeSegListEntry pointer, i.e.
-    TUint16 nameLength = entry.iNameLength;
-    TPtr name(&(entry.iName[0]), nameLength, nameLength);
-    // move ptr on to point to the next TCodeSegListEntry object
-    ptr += Align4(entry.GetSize());
-    }
-@endcode
-*/
-class TCodeSegListEntry
-    {
-public:
-    TInt GetSize() const;
-public:
-    /**
-      Address of the start of the code segment.
-      */
-    TUint32 iCodeBase;
-    /**
-      Size of the code segment.
-      */
-    TUint32 iCodeSize;
-    /**
-      Size of the const data segment
-      */
-    TUint32 iConstDataSize;
-    /**
-      Address of the initialised data
-      */
-    TUint32 iInitialisedDataBase;
-    /**
-      Size of the initialised data
-      */
-    TUint32 iInitialisedDataSize;
-    /**
-      Size of the uninitialised data
-      */
-    TUint32 iUninitialisedDataSize;
-    /**
-      Boolean indicating whether the code segment is execute in place
-      */
-    TBool iIsXip;
-    /**
-      Indicates whether the code segment is from an executable or a dll, or neither
-      */
-    TCodeSegType iCodeSegType;
-    /** Uid3 of this segment. */
-    TUint32 iUid3;
-    /** Currently unused element. May be used in future to aid maintaining compatibility. */
-    TUint32 iSpare2;
-    /**
-      Length of the code segment's name
-      */
-    TUint16 iNameLength;
-    /**
-      First two bytes of the code segment's name, the name should be considered to
-      extend past the end of the TCodeSegListEntry structure to a length
-      corresponding to iNameLength
-      */
-    TUint16 iName[1];
-    };
-
-/**
-Returns the size of the TCodeSegListEntry, including the file name length
-
-@return the size, in bytes, of the TCodeSegListEntry and the code segment's
-file name
-*/
-inline TInt TCodeSegListEntry::GetSize() const
-    {
-    return sizeof(TCodeSegListEntry) - sizeof(iName) + (2 * iNameLength);
-    }
-
-/**
-Structure used for extracting data from a descriptor returned by a call to
-RSecuritySvrSession::GetList() when GetList() is called with TListId::EXipLibraries
-as the first argument.
-
-@see RSecuritySvrSession::GetList()
-
-@code
-//buffer is a TDesC8 containing 4-byte aligned TXipLibraryListEntry objects
-//create a pointer to the start of the data
-TUint8* ptr = (TUint8*)buffer.Ptr();
-//create a pointer to the end of the data
-const TUint8* ptrEnd = ptr + buffer.Length();
-while(ptr < ptrEnd)
-    {
-    //cast the pointer to be a TXipLibraryListEntry object
-    TXipLibraryListEntry& entry = *(TXipLibraryListEntry*)ptr;
-    //use the TXipLibraryListEntry pointer, i.e.
-    TUint16 nameLength = entry.iNameLength;
-    TPtr name(&(entry.iName[0]), nameLength, nameLength);
-    // move ptr on to point to the next TXipLibraryListEntry object
-    ptr += Align4(entry.GetSize());
-    }
-@endcode
-*/
-class TXipLibraryListEntry
-    {
-public:
-    TInt GetSize() const;
-public:
-    /**
-      Address of the start of the library's code segment.
-      */
-    TUint32 iCodeBase;
-    /**
-      Size of the code segment.
-      */
-    TUint32 iCodeSize;
-    /**
-      Size of the const data segment
-      */
-    TUint32 iConstDataSize;
-    /**
-      Address of the initialised data
-      */
-    TUint32 iInitialisedDataBase;
-    /**
-      Size of the initialised data
-      */
-    TUint32 iInitialisedDataSize;
-    /**
-      Size of the uninitialised data
-      */
-    TUint32 iUninitialisedDataSize;
-    /** Currently unused element. May be used in future to aid maintaining compatibility. */
-    TUint32 iSpare1;
-    /** Currently unused element. May be used in future to aid maintaining compatibility. */
-    TUint32 iSpare2;
-    /**
-      Length of the library's name
-      */
-    TUint16 iNameLength;
-    /**
-      First two bytes of the code segment's name, the name should be considered to
-      extend past the end of the TXipLibraryListEntry structure to a length
-      corresponding to iNameLength
-      */
-    TUint16 iName[1];
-    };
-
-/**
-Returns the size of the TXipLibraryListEntry, including the file name length
-
-@return the size, in bytes, of the TXipLibraryListEntry and the library's
-file name
-*/
-inline TInt TXipLibraryListEntry::GetSize() const
-    {
-    return sizeof(TXipLibraryListEntry) - sizeof(iName) + (2 * iNameLength);
-    }
-
-/**
-Structure used for extracting data from a descriptor returned by a call to
-RSecuritySvrSession::GetList() when GetList() is called with TListId::EExecutables
-as the first argument.
-
-@see RSecuritySvrSession::GetList()
-
-@code
-//buffer is a TDesC8 containing 4-byte aligned TExecutablesListEntry objects
-//create a pointer to the start of the data
-TUint8* ptr = (TUint8*)buffer.Ptr();
-//create a pointer to the end of the data
-const TUint8* ptrEnd = ptr + buffer.Length();
-while(ptr < ptrEnd)
-    {
-    //cast the pointer to be a TExecutablesListEntry object
-    TExecutablesListEntry& entry = *(TExecutablesListEntry*)ptr;
-    //use the TExecutablesListEntry pointer, i.e.
-    TUint16 nameLength = entry.iNameLength;
-    TPtr name(&(entry.iName[0]), nameLength, nameLength);
-    // move ptr on to point to the next TExecutablesListEntry object
-    ptr += Align4(entry.GetSize());
-    }
-@endcode
-*/
-class TExecutablesListEntry
-    {
-public:
-    TInt GetSize() const;
-public:
-    /**
-      Indicates whether an agent has registered to actively debug the executable,
-      a non-zero value indicates that an agent has attached.
-      */
-    TUint8 iIsActivelyDebugged;
-    /**
-      Indicates whether any agents have registered to passively debug the executable,
-      a non-zero value indicates that at least one agent is attached passively
-      */
-    TUint8 iIsPassivelyDebugged;
-    /** Currently unused element. May be used in future to aid maintaining compatibility. */
-    TUint32 iSpare1;
-    /** Currently unused element. May be used in future to aid maintaining compatibility. */
-    TUint32 iSpare2;
-    /**
-      Length of the executable's name
-      */
-    TUint16 iNameLength;
-    /**
-      First two bytes of the executable's name, the name should be considered to
-      extend past the end of the TExecutablesListEntry structure to a length
-      corresponding to iNameLength
-      */
-    TUint16 iName[1];
-    };
-
-/**
-Returns the size of the TExecutablesListEntry, including the file name length
-
-@return the size, in bytes, of the TExecutablesListEntry and the executable's
-file name
-*/
-inline TInt TExecutablesListEntry::GetSize() const
-    {
-    return sizeof(TExecutablesListEntry) - sizeof(iName) + (2*iNameLength);
-    }
-
-/**
-Structure used for extracting data from a descriptor returned by a call to
-RSecuritySvrSession::GetList() when GetList() is called with TListId::EProcesses
-as the first argument.
-
-@see RSecuritySvrSession::GetList()
-
-@code
-//buffer is a TDesC8 containing 4-byte aligned TProcessListEntry objects
-//create a pointer to the start of the data
-TUint8* ptr = (TUint8*)buffer.Ptr();
-//create a pointer to the end of the data
-const TUint8* ptrEnd = ptr + buffer.Length();
-while(ptr < ptrEnd)
-    {
-    //cast the pointer to be a TProcessListEntry object
-    TProcessListEntry& entry = *(TProcessListEntry*)ptr;
-    //use the TProcessListEntry pointer, i.e.
-    TUint16 fileNameLength = entry.iFileNameLength;
-    TPtr name(&(entry.iNames[0]), fileNameLength, fileNameLength);
-    // move ptr on to point to the next TProcessListEntry object
-    ptr += Align4(entry.GetSize());
-    }
-@endcode
-*/
-class TProcessListEntry
-    {
-    public:
-        TInt GetSize() const;
-
-    public:
-        /** Process ID */
-        TUint64 iProcessId;
-
-        /** The Uid3 of the process */
-        TUint32 iUid3;
-
-        /** 
-         * Process Attributes
-         * @see DProcess::TProcessAttributes
-         */
-        TInt iAttributes;
-
-        /**
-         * Length of fully qualified file name of the process in bytes. Note that this
-         * entry may be 0 if the process is in the process of shutting down.
-         */
-        TUint16 iFileNameLength;
-
-        /**
-         * Length of current dynamic name of the process in bytes
-         */
-        TUint16 iDynamicNameLength;
-
-        /**
-         * First two bytes of the process' file name, the name should be considered to
-         * extend past the end of the TProcessListEntry structure to a length
-         * corresponding to iFileNameLength. Directly after the data corresponding to the
-         * file name, the dynamic name is stored with a length of iDynamicNameLength characters.
-         * Note that these names are not null terminated and are concatenated directly after each other.
-         * 
-         * @code
-         * TProcessListEntry& entry; // entry is a reference to a TProcessListEntry
-         *
-         * //get the file name..
-         * TPtr fileName(&(entry.iNames[0]), iFileNameLength, iFileNameLength);
-         *
-         * //get the dynamic name length..
-         * TPtr dynamicName(&(entry.iNames[0]) + iFileNameLength, iDynamicNameLength, iDynamicNameLength);
-         * @endcode
-         */
-        TUint16 iNames[1];
-    };
-
-/**
-Returns the size of the TProcessListEntry, including the file name length and the
-dynamic name length
-
-@return the size, in bytes, of the TProcessListEntry and the executable's
-file name file name and dynamic name
-*/
-inline TInt TProcessListEntry::GetSize() const
-    {
-    return sizeof(TProcessListEntry) - sizeof(iNames) + (2 * (iFileNameLength + iDynamicNameLength));
-    }
-
-/**
-Structure used for extracting data from a descriptor returned by a call to
-RSecuritySvrSession::GetList() when GetList() is called with TListId::EThreads
-as the first argument.
-
-@see RSecuritySvrSession::GetList()
-
-@code
-//buffer is a TDesC8 containing 4-byte aligned TThreadListEntry objects
-//create a pointer to the start of the data
-TUint8* ptr = (TUint8*)buffer.Ptr();
-//create a pointer to the end of the data
-const TUint8* ptrEnd = ptr + buffer.Length();
-while(ptr < ptrEnd)
-    {
-    //cast the pointer to be a TThreadListEntry object
-    TThreadListEntry& entry = *(TThreadListEntry*)ptr;
-    //use the TThreadListEntry pointer, i.e.
-    TUint16 nameLength = entry.iNameLength;
-    TPtr name(&(entry.iName[0]), nameLength, nameLength);
-    // move ptr on to point to the next TThreadListEntry object
-    ptr += Align4(entry.GetSize());
-    }
-@endcode
-*/
-class TThreadListEntry
-    {
-public:
-    TInt GetSize() const;
-public:
-    /**
-      Thread ID
-      */
-    TUint64 iThreadId;
-    /**
-      Process ID
-      */
-    TUint64 iProcessId;
-    /**
-      Address of the base of the supervisor stack
-      */
-    TUint32 iSupervisorStackBase;
-    /**
-      Size of the supervisor stack
-      */
-    TUint32 iSupervisorStackSize;
-    /**
-      Non-zero if iSupervisorStackBase has been set correctly
-      */
-    TUint8 iSupervisorStackBaseValid;
-    /**
-      Non-zero if iSupervisorStackSize has been set correctly
-      */
-    TUint8 iSupervisorStackSizeValid;
-    /**
-      Address of the thread's supervisor stack pointer
-      */
-    TUint32 iSupervisorStackPtr;
-    /**
-      Indicator of whether the value returned as iSupervisorStackPtr is valid.
-      It is necessary, but not necessarily sufficient, that the thread be suspended
-      for a valid value to be returned. This may be removed from the final API and
-      the value would be extracted instead via the ReadRegisters type calls.
-      */
-    TRegisterFlag iSupervisorStackPtrValid;
-    /** Currently unused element. May be used in future to aid maintaining compatibility. */
-    TUint32 iSpare1;
-    /** Currently unused element. May be used in future to aid maintaining compatibility. */
-    TUint32 iSpare2;
-    /**
-      The length of the thread's name
-      */
-    TUint16 iNameLength;
-    /**
-      First two bytes of the thread's name, the name should be considered to
-      extend past the end of the TThreadListEntry structure to a length
-      corresponding to iNameLength
-      */
-    TUint16 iName[1];
-    };
-
-/**
-Returns the size of the TThreadListEntry, including the name length
-
-@return the size, in bytes, of the TExecutablesListEntry and the thread's name
-*/
-inline TInt TThreadListEntry::GetSize() const
-    {
-    return sizeof(TThreadListEntry) - sizeof(iName) + (2 * iNameLength);
-    }
-
-/**
-Denotes which list type to return from a RSecuritySvrSession::GetList() call
-
-@see RSecuritySvrSession::GetList()
-*/
-enum TListId
-    {
-    /**
-    Indicates that the GetList() call should return a list of the processes in
-    the system. The returned buffer will contain an array of 4-byte aligned
-    TProcessListEntry objects.
-
-    @see TProcessListEntry
-    */
-    EProcesses = 0,
-    /**
-    Indicates that the GetList() call should return a list of the threads in
-    the system. The returned buffer will contain an array of 4-byte aligned
-    TThreadListEntry objects.
-
-    @see TThreadListEntry
-    */
-    EThreads = 1,
-    /**
-    Indicates that the GetList() call should return a list of the code segments in
-    the system. The returned buffer will contain an array of 4-byte aligned
-    TCodeSegListEntry objects.
-
-    @see TCodeSegListEntry
-    */
-    ECodeSegs = 2,
-    /**
-    Indicates that the GetList() call should return a list of the XIP libraries in
-    the system. The returned buffer will contain an array of 4-byte aligned
-    EXipLibraries objects.
-
-    @see EXipLibraries
-    */
-    EXipLibraries = 3,
-    /**
-    Indicates that the GetList() call should return a list of the executables in
-    the system. The returned buffer will contain an array of 4-byte aligned
-    EExecutables objects.
-
-    @see EExecutables
-    */
-    EExecutables = 4,
-    /**
-    Indicates that the GetList() call should return a list of the logical devices in the system.
-    */
-    ELogicalDevices = 5,
-    /**
-    Indicates that the GetList() call should return a list of the mutexes in the system.
-    */
-    EMutexes = 6,
-    /**
-    Indicates that the GetList() call should return a list of the servers in the system.
-    */
-    EServers = 7,
-    /**
-    Indicates that the GetList() call should return a list of the sessions in the system.
-    */
-    ESessions = 8,
-    /**
-    Indicates that the GetList() call should return a list of the semaphores in the system.
-    */
-    ESemaphores = 9,
-    /**
-    Indicates that the GetList() call should return a list of the chunks in the system.
-    */
-    EChunks = 10,
-
-    /**
-    Provides a complete list of all the breakpoints in the system and their
-    current state.
-
-    @see EBreakpoints
-    */
-    EBreakpoints = 11,
-
-    /** 
-    The following are for the possible use of kernel-side debug and SMP breakpoint
-    manipulation.
-    */
-    ESetBreak = 12,
-    ERemoveBreak = 13,
-    EModifyBreak = 14,
-    
-    /**
-     * Provides static information of the system
-     */
-    EStaticInfo = 15,
-
-    /** Last listing enum. */
-    EListLast
-    };
-
-/**
-  Bit field values denoting the scope of a listing.
-
-  In the debug functionality block, the TTag::iValue element which is returned for a listing tag
-  should be considered as a union of the supported values from this enumeration for that listing.
-  */
-enum TListScope
-    {
-    EScopeNone = 0x0,             /**< Corresponds to no scope for a listing. equivalent to not supported */
-    EScopeGlobal= 0x1,            /**< Corresponds to a global scope for a listing. */
-    EScopeProcessSpecific = 0x2,  /**< Corresponds to a process specific scope for a listing. */
-    EScopeThreadSpecific = 0x4    /**< Corresponds to a thread specific scope for a listing. */
-    };
-
-/**
-@internalComponent
-
-Interface constructor for passing IPC data for the GetList call.
-*/
-class TListDetails
-    {
-public:
-    TListDetails(const TListId aListId, const TListScope aListScope, TUint64 aTargetId=0)
-        : iListId(aListId),
-          iListScope(aListScope),
-          iTargetId(aTargetId) {}
-public:
-    TListId iListId;
-    TListScope iListScope;
-    TUint64 iTargetId;
-    };
-
-
-    };
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-namespace Debug
-    {
-
+	{
 	/**
 	 * The stop-mode debug interface is a stateless interface which may be called at any point
 	 * except user mode, provided the rest of the OS is not going to run or pre-empt it.
@@ -1680,7 +237,7 @@
 				IMPORT_C static TInt TestAPI(const TListItem* aItem);
 
 			public:	
-				IMPORT_C static TInt ExitPoint(const TInt aReturnValue);
+				static TInt ExitPoint(const TInt aReturnValue);
 
 			private:
 				/** Code segment list routines */
@@ -1706,105 +263,6 @@
 				static TInt CopyAndExpandDes(const TDesC& aSrc, TDes& aDest);
 				
 			};
-	
-	
-	/** 
-	Provides static methods for accessing the information stored in a TRegisterInfo
-	object.
-	*/
-	class Register
-	    {
-	public:
-	    static TBool IsCoreReg(const Debug::TRegisterInfo aRegister);
-	    static TBool IsCoproReg(const Debug::TRegisterInfo aRegister);
-	    static TUint32 GetCoreRegId(const Debug::TRegisterInfo aRegister);
-	    static TUint32 GetCRm(const Debug::TRegisterInfo aRegister);
-	    static TUint32 GetCRn(const Debug::TRegisterInfo aRegister);
-	    static TUint32 GetOpcode1(const Debug::TRegisterInfo aRegister);
-	    static TUint32 GetOpcode2(const Debug::TRegisterInfo aRegister);
-	    static TUint32 GetCoproNum(const Debug::TRegisterInfo aRegister);
-	    };
-
-	/**
-	Identify whether aRegister is a core register
-	@param aRegister register ID to analyse
-	@return ETrue if core register, EFalse otherwise
-	*/
-	inline TBool Register::IsCoreReg(const Debug::TRegisterInfo aRegister)
-	    {
-	    return ((aRegister & 0xff) == 0x0);
-	    }
-
-	/**
-	Identify whether aRegister is a coprocessor register
-	@param aRegister register ID to analyse
-	@return ETrue if coprocessor register, EFalse otherwise
-	*/
-	inline TBool Register::IsCoproReg(const Debug::TRegisterInfo aRegister)
-	    {
-	    return ((aRegister & 0xff) == 0x1);
-	    }
-
-	/**
-	Get the ID of the core register
-	@param aRegister register ID to analyse
-	@return ID of the core register
-	*/
-	inline TUint32 Register::GetCoreRegId(const Debug::TRegisterInfo aRegister)
-	    {
-	    return ((aRegister >> 8) & 0xff);
-	    }
-
-	/**
-	Get the CRm value of a coprocessor register
-	@param aRegister register ID to analyse
-	@return the CRm value of a coprocessor register
-	*/
-	inline TUint32 Register::GetCRm(const Debug::TRegisterInfo aRegister)
-	    {
-	    return ((aRegister >> 16) & 0xf);
-	    }
-
-	/**
-	Get the CRm value of a coprocessor register
-	@param aRegister register ID to analyse
-	@return the CRm value of a coprocessor register
-	*/
-	inline TUint32 Register::GetCRn(const Debug::TRegisterInfo aRegister)
-	    {
-	    return ((aRegister >> 20) & 0xf);
-	    }
-
-	/**
-	Get the Opcode1 value of a coprocessor register
-	@param aRegister register ID to analyse
-	@return the Opcode1 value of a coprocessor register
-	*/
-	inline TUint32 Register::GetOpcode1(const Debug::TRegisterInfo aRegister)
-	    {
-	    return ((aRegister >> 24) & 0x8);
-	    }
-	    
-	/**
-	Get the Opcode2 value of a coprocessor register
-	@param aRegister register ID to analyse
-	@return the Opcode2 value of a coprocessor register
-	*/
-	inline TUint32 Register::GetOpcode2(const Debug::TRegisterInfo aRegister)
-	    {
-	    return ((aRegister >> 27) & 0x8);
-	    }
-
-	/**
-	Get the coprocessor number of a coprocessor register
-	@param aRegister register ID to analyse
-	@return the coprocessor number of a coprocessor register
-	*/
-	inline TUint32 Register::GetCoproNum(const Debug::TRegisterInfo aRegister)
-	    {
-	    return ((aRegister >> 8) & 0xff);
-	    }
-
 
 	};
 #endif // D_STOP_MODE_API_H
--- a/kernel/eka/include/u32hal.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/u32hal.h	Wed Sep 01 12:34:56 2010 +0100
@@ -368,30 +368,6 @@
 	};
 
 
-/**
-@internalComponent
-*/
-struct SCpuStates
-	{
-	TUint32	iTA;
-	TUint32 iIA;
-	TUint32	iCU;
-	TUint32	iGD;
-	TInt	iDC;
-	TUint32	iSC;
-	TUint32	iRC;
-	TUint32	iCCS;
-	TUint8	iPO;
-	TUint8	iSpare1;
-	TUint8	iSpare2;
-	TUint8	iSpare3;
-	TUint32	iPODC;
-	TInt	iDS[8];
-	TUint32	iUDC[8];
-	TUint32	iUAC[8];
-	TUint32	iOP[8];
-	TUint32	iF[8];
-	};
 
 
 /**
@@ -420,8 +396,6 @@
 	EKernelHalFloatingPointSystemId,
 	EKernelHalLockThreadToCpu,
 	EKernelHalConfigFlags,
-	EKernelHalCpuStates,
-	EKernelHalSetNumberOfCpus,
 	};
 
 
@@ -2843,22 +2817,6 @@
 	enabled.
 	*/
 	EVMHalSetDataWriteSize,
-
-	/**
-	@internalTechnology
-	@test
-
-	Simulates a paging error in a specified context.
-	
-	For testing purposes, this causes the paging system to report an error the next time an
-	operation occurs that could generate an error with the specified context.
-
-	The first argument (a1) contains one of the contexts described by TPagingErrorContext.
-
-	@return KErrArgument if the value is out of range, or KErrNotSupported on memory models that do
-	not support this.
-	*/
-	EVMHalDebugSetFail,
 	};
 
 
@@ -3289,25 +3247,6 @@
 	};
 
 
-/**
-@internalComponent
-@test
-
-Error context information for use by #DPager::EmbedErrorContext and #DPager::ExtractErrorContext.
-*/
-enum TPagingErrorContext
-	{
-	EPagingErrorContextNone = 0,
-	EPagingErrorContextRomRead,
-	EPagingErrorContextRomDecompress,
-	EPagingErrorContextCodeRead,
-	EPagingErrorContextCodeDecompress,
-	EPagingErrorContextDataRead,
-	EPagingErrorContextDataWrite,
-
-	EMaxPagingErrorContext
-	};
-
 
 /**
 @internalComponent
--- a/kernel/eka/include/u32std.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/include/u32std.h	Wed Sep 01 12:34:56 2010 +0100
@@ -401,7 +401,7 @@
 	};
 
 /** @test */
-enum TKernelHeapDebugFunction {EDbgMarkStart,EDbgMarkCheck,EDbgMarkEnd,EDbgSetAllocFail,EDbgSetBurstAllocFail,EDbgCheckFailure,EDbgGetAllocFail};
+enum TKernelHeapDebugFunction {EDbgMarkStart,EDbgMarkCheck,EDbgMarkEnd,EDbgSetAllocFail,EDbgSetBurstAllocFail,EDbgCheckFailure};
 
 /** @test */
 class TKernelHeapMarkCheckInfo
@@ -508,8 +508,6 @@
 	EKernelConfigSMPUnsafeCPU0   = 1<<13,				// Slow compatibility mode: all SMP-unsafe processes run on CPU 0 only
 	EKernelConfigSMPCrazyInterrupts = 1<<14,			// Enables CPU target rotation for HW Interrupts.
 
-	EKernelConfigSMPLockKernelThreadsCore0 = 1<< 15,    // locks all kernel side threads to CPU 0
-
 	EKernelConfigDisableAPs = 1u<<30,
 
 	EKernelConfigTest = 1u<<31,							// Only used by test code for __PLATSEC_UNLOCKED__
--- a/kernel/eka/kernel/arm/cache.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/arm/cache.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -70,10 +70,8 @@
 
 EXPORT_C void Cache::AtomicSyncMemory()
 	{
-	// This methos is called during reboot or power down sequence and therefore is not allowed
-	// to do Kernel calls that may hold spin lock - such as Kern::Print or precondition checkings.
-	// CHECK_PRECONDITIONS(MASK_INTERRUPTS_DISABLED,"Cache::AtomicSyncMemory");				
-	// __KTRACE_OPT(KMMU,Kern::Printf("Cache::AtomicSyncMemory"));
+	CHECK_PRECONDITIONS(MASK_INTERRUPTS_DISABLED,"Cache::AtomicSyncMemory");				
+	__KTRACE_OPT(KMMU,Kern::Printf("Cache::AtomicSyncMemory"));
 
 	InternalCache::CleanAndInvalidate_DCache_All();
 
@@ -82,29 +80,6 @@
 #endif //__HAS_EXTERNAL_CACHE__
 	}
 
-EXPORT_C void Cache::CpuRetires()
-	{
-	// This methos is called during reboot or power down sequence and therefore is not allowed
-	// to do Kernel calls that may hold spin lock - such as Kern::Print or precondition checkings.
-	// CHECK_PRECONDITIONS(MASK_INTERRUPTS_DISABLED,"Cache::CpuRetires");				
-
-	InternalCache::CleanAndInvalidate_DCache_All();
-
-#if  !defined(__SMP__) & defined(__HAS_EXTERNAL_CACHE__)
-	ExternalCache::AtomicSync();
-#endif	
-	}
-
-EXPORT_C void Cache::KernelRetires()
-	{
-	// This methos is called during reboot or power down sequence and therefore is not allowed
-	// to do Kernel calls that may hold spin lock - such as Kern::Print or precondition checkings.
-	// CHECK_PRECONDITIONS(MASK_INTERRUPTS_DISABLED,"Cache::KernelRetires");				
-
-#if  defined(__SMP__) & defined(__HAS_EXTERNAL_CACHE__)
-	ExternalCache::AtomicSync();
-#endif
-	}
 
 EXPORT_C TInt Cache::GetThresholds(TCacheThresholds& aThresholds, TUint aCacheType)
 	{
--- a/kernel/eka/kernel/arm/cache_external.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/arm/cache_external.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -313,24 +313,21 @@
 
 void ExternalCache::AtomicSync()
 	{
-	// This methos is called during reboot or power down sequence and therefore is not allowed
-	// to do Kernel calls that may hold spin lock - such as Kern::Print or precondition checkings.
-	// CHECK_PRECONDITIONS(MASK_INTERRUPTS_DISABLED,"ExternalCache::AtomicSync");
-	// __KTRACE_OPT(KMMU,Kern::Printf("ExternalCache::AtomicSync"));
+	CHECK_PRECONDITIONS(MASK_INTERRUPTS_DISABLED,"ExternalCache::AtomicSync");
+	__KTRACE_OPT(KMMU,Kern::Printf("ExternalCache::AtomicSync"));
+
 #if defined(__ARM_PL310_CACHE__)
-    // Do not use maintain-by-way operations on PL310 (due to erratum 727915 for example)
-    // Also, do not use ARML2C_CleanInvalidateByIndexWay (erratum 588369)
-    // Do not hold spin lock as it is assumed this is the only running CPU.
-    TInt indexNo = Info.iSize>>3; // This is the number of cache lines in each way. Assoc is always 8 in this cache
-    volatile TInt* ctrlReg = (volatile TInt*)(Base+ARML2C_CleanByIndexWay);
-    TInt way,index;
-    for (way = 0 ; way <Info.iAssoc ; way++)
-        {
-        for (index = 0 ; index <indexNo ; index++)
-            {
-            *ctrlReg = (way<<ARML2C_WayShift) | (index<<ARML2C_IndexShift); //This will maintain a single cache line
-            }
-        }
+	// On Pl310, we hold the lock while maintaining cache. Therefore, we cannot
+	// do that on a way basis as it takes too long to complete.
+	// This will also ensure that PL310 erratum 727915 is sorted out.
+
+#if defined(__ARM_PL310_ERRATUM_588369_FIXED)
+	Maintain_All((TInt*)(Base+ARML2C_CleanInvalidateByIndexWay));
+#else //defined(__ARM_PL310_ERRATUM_588369_FIXED)
+	//CleanAndInvalidate is broken. Just clean it.
+	Maintain_All((TInt*)(Base+ARML2C_CleanByIndexWay));
+#endif //else defined(__ARM_PL310_ERRATUM_588369_FIXED)
+	
 #else //defined(__ARM_PL310_CACHE__)
 
 	#if defined (__ARM_L210_CACHE__)
--- a/kernel/eka/kernel/arm/cache_maintenance.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/arm/cache_maintenance.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1116,11 +1116,33 @@
 void TCacheBroadcast::DoThreadOp()
 	{
 	CHECK_PRECONDITIONS(MASK_THREAD_STANDARD,"TCacheBroadcast::DoThreadOp");
-	TCoreCycler cycler;
-	while (cycler.Next()==KErrNone)
-		{
+	NKern::ThreadEnterCS();
+	NThreadGroup* g = NKern::LeaveGroup();
+	TInt frz = NKern::FreezeCpu();
+	if (frz)
+		__crash();	// already frozen so won't be able to migrate :-(
+	TInt orig_cpu = NKern::CurrentCpu();
+	TInt ncpu = NKern::NumberOfCpus();
+	TInt cpu = orig_cpu;
+	TUint32 orig_affinity = 0;
+	do	{
+		TUint32 affinity = NKern::ThreadSetCpuAffinity(NKern::CurrentThread(), (TUint32)cpu);
+		if (cpu == orig_cpu)
+			{
+			orig_affinity = affinity;
+			NKern::EndFreezeCpu(frz);
+			}
+		TInt cpu_now = NKern::CurrentCpu();
+		if (cpu_now != cpu)
+			__crash();
 		Isr(this);
-		}
+		if (++cpu == ncpu)
+			cpu = 0;
+		} while (cpu != orig_cpu);
+	NKern::ThreadSetCpuAffinity(NKern::CurrentThread(), orig_affinity);
+	if (g)
+		NKern::JoinGroup(g);
+	NKern::ThreadLeaveCS();
 	}
 
 void InternalCache::Invalidate(TUint aMask, TLinAddr aBase, TUint aSize)
--- a/kernel/eka/kernel/arm/cinit.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/arm/cinit.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -22,17 +22,11 @@
 #include <arm_scu.h>
 #endif
 
-extern "C" void NKIdle(TUint32 aStage)
+extern "C" void NKIdle(TInt aStage)
 	{
 	SCpuIdleHandler* cih = NKern::CpuIdleHandler();
-#ifdef __SMP__
-	TSubScheduler& ss = SubScheduler();
-	if (cih && cih->iHandler)
-		(*cih->iHandler)(cih->iPtr, aStage, ss.iUncached);
-#else
 	if (cih && cih->iHandler)
 		(*cih->iHandler)(cih->iPtr, aStage);
-#endif
 	else if (K::PowerModel)
 		K::PowerModel->CpuIdle();
 	else
@@ -62,17 +56,6 @@
 				__KTRACE_OPT(KBOOT,Kern::Printf("VariantInitialise returns %08x", p));
 				}
 			}
-#ifdef __SMP__
-		SVariantInterfaceBlock* vib = (SVariantInterfaceBlock*)K::VariantData[0];
-		TSuperPage& spg = TheSuperPage();
-		for (i=0; i<KMaxCpus; ++i)
-			{
-			if (!vib->iUncached[i])
-				{
-				vib->iUncached[i] = (UPerCpuUncached*)(spg.iAPBootPageLin + 0xE00 + (i<<6));
-				}
-			}
-#endif
 		}
 	return KErrNone;
 	}
--- a/kernel/eka/kernel/arm/ckernel.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/arm/ckernel.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -105,10 +105,6 @@
 				{
 				*(TUint32*)(pT->iNThread.iExtraContext) = Arm::FpScr() & VFP_FPSCR_MODE_MASK;
 				}
-			else
-				{
-				*(TUint32*)(pT->iNThread.iExtraContext) = *(TUint32*)(Kern::CurrentThread().iNThread.iExtraContext);
-				}
 			}
 		}
 #endif
@@ -361,8 +357,8 @@
 	TSubScheduler* ss = &SubScheduler();
 	if (!ss)
 		ss = &TheSubSchedulers[0];
-	ss->iSSX.iExcInfo = aExcInfo;
-	SFullArmRegSet* a = ss->iSSX.iRegs;
+	ss->i_ExcInfo = aExcInfo;
+	SFullArmRegSet* a = (SFullArmRegSet*)ss->i_Regs;
 	if (!a)
 		a = &DefaultRegSet;
 #else
--- a/kernel/eka/kernel/arm/cutils.cia	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/arm/cutils.cia	Wed Sep 01 12:34:56 2010 +0100
@@ -143,7 +143,6 @@
 	asm("adr	r2, __UartBase ");
 	asm("ldr	r1, [r1] ");
 	asm("ldr	r1, [r1, #%a0]" : : "i" _FOFF(TSuperPage,iDebugPort));
-	asm("and	r1, r1, #255 ");
 	asm("cmp	r1, #0 ");
 	asm("ldrne	r2, [r2, #4] ");
 	asm("ldreq	r2, [r2, #0] ");
@@ -353,7 +352,7 @@
 	__JUMP(ne,lr);						// if debugger entry point invalid, return
 #ifdef __SMP__
 	GET_RWNO_TID(,r0);
-	asm("ldr r0, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,iSSX.iRegs));	// pass in address of stored registers
+	asm("ldr r0, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,i_Regs));	// pass in address of stored registers
 #else
 	asm("ldr r0, __TheScheduler ");
 	asm("ldr r0, [r0, #%a0]" : : "i" _FOFF(TScheduler,i_Regs));	// pass in address of stored registers
--- a/kernel/eka/kernel/arm/cutils.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/arm/cutils.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -153,12 +153,11 @@
 	{
 	if (aPhase==0)
 		{
-		Cache::CpuRetires();
+		Cache::AtomicSyncMemory();
 		return;
 		}
-	Cache::KernelRetires();
 #ifdef __SMP__
-	SFullArmRegSet* regs = SubScheduler().iSSX.iRegs;
+	SFullArmRegSet* regs = (SFullArmRegSet*)SubScheduler().i_Regs;
 #else
 	SFullArmRegSet* regs = (SFullArmRegSet*)TheScheduler.i_Regs;
 #endif
--- a/kernel/eka/kernel/arm/vfp.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/arm/vfp.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -81,97 +81,3 @@
 	Kern::PanicCurrentThread(_L("CRT_ABORT"), 0);
 	}
 #endif
-
-#if defined(__ARMCC__) && __ARMCC_VERSION >= 400000
-__asm void _hide_unwanted_exports()
-	{
-	IMPORT _vfp_f2h_single;
-	IMPORT _vfp_fpe_d2f;
-	IMPORT _vfp_fpe_d2f_quiet;
-	IMPORT _vfp_fpe_dabs;
-	IMPORT _vfp_fpe_dadd;
-	IMPORT _vfp_fpe_dcmp;
-	IMPORT _vfp_fpe_dcmpe;
-	IMPORT _vfp_fpe_ddiv;
-	IMPORT _vfp_fpe_dfcmp;
-	IMPORT _vfp_fpe_dfcmpe;
-	IMPORT _vfp_fpe_dfix;
-	IMPORT _vfp_fpe_dfix_z;
-	IMPORT _vfp_fpe_dfixll;
-	IMPORT _vfp_fpe_dfixll_z;
-	IMPORT _vfp_fpe_dfixllp;
-	IMPORT _vfp_fpe_dfixu;
-	IMPORT _vfp_fpe_dfixu_z;
-	IMPORT _vfp_fpe_dfixull;
-	IMPORT _vfp_fpe_dfixull_z;
-	IMPORT _vfp_fpe_dflt;
-	IMPORT _vfp_fpe_dfltll;
-	IMPORT _vfp_fpe_dfltll_scaled;
-	IMPORT _vfp_fpe_dfltllp;
-	IMPORT _vfp_fpe_dfltu;
-	IMPORT _vfp_fpe_dfltull;
-	IMPORT _vfp_fpe_dmul;
-	IMPORT _vfp_fpe_dneg;
-	IMPORT _vfp_fpe_drdiv;
-	IMPORT _vfp_fpe_drem;
-	IMPORT _vfp_fpe_drnd;
-	IMPORT _vfp_fpe_drsb;
-	IMPORT _vfp_fpe_dsqrt;
-	IMPORT _vfp_fpe_dsub;
-	IMPORT _vfp_fpe_f2d;
-	IMPORT _vfp_fpe_f2d_quiet;
-	IMPORT _vfp_fpe_f2h;
-	IMPORT _vfp_fpe_fabs;
-	IMPORT _vfp_fpe_fadd;
-	IMPORT _vfp_fpe_fcmp;
-	IMPORT _vfp_fpe_fcmpe;
-	IMPORT _vfp_fpe_fdcmp;
-	IMPORT _vfp_fpe_fdcmpe;
-	IMPORT _vfp_fpe_fdiv;
-	IMPORT _vfp_fpe_ffix;
-	IMPORT _vfp_fpe_ffix_z;
-	IMPORT _vfp_fpe_ffixll;
-	IMPORT _vfp_fpe_ffixll_z;
-	IMPORT _vfp_fpe_ffixllp;
-	IMPORT _vfp_fpe_ffixu;
-	IMPORT _vfp_fpe_ffixu_z;
-	IMPORT _vfp_fpe_ffixull;
-	IMPORT _vfp_fpe_ffixull_z;
-	IMPORT _vfp_fpe_fflt;
-	IMPORT _vfp_fpe_fflt_scaled;
-	IMPORT _vfp_fpe_ffltll;
-	IMPORT _vfp_fpe_ffltll_scaled;
-	IMPORT _vfp_fpe_ffltllp;
-	IMPORT _vfp_fpe_ffltu;
-	IMPORT _vfp_fpe_ffltull;
-	IMPORT _vfp_fpe_fma;
-	IMPORT _vfp_fpe_fmaf;
-	IMPORT _vfp_fpe_fmul;
-	IMPORT _vfp_fpe_fneg;
-	IMPORT _vfp_fpe_frdiv;
-	IMPORT _vfp_fpe_frem;
-	IMPORT _vfp_fpe_frnd;
-	IMPORT _vfp_fpe_frsb;
-	IMPORT _vfp_fpe_fsqrt;
-	IMPORT _vfp_fpe_fsub;
-	IMPORT _vfp_fpe_h2f;
-	IMPORT _vfp_fpe_hcmp;
-	IMPORT _vfp_fpe_IEEE;
-	IMPORT _vfp_fpe_IEEE_rd;
-	IMPORT _vfp_fpe_IEEE_ru;
-	IMPORT _vfp_fpe_IEEE_rz;
-	IMPORT _vfp_fpe_ilogb;
-	IMPORT _vfp_fpe_ilogbf;
-	IMPORT _vfp_fpe_logb;
-	IMPORT _vfp_fpe_logbf;
-	IMPORT _vfp_fpe_nextafter;
-	IMPORT _vfp_fpe_nextafterf;
-	IMPORT _vfp_fpe_nexttowardf;
-	IMPORT _vfp_fpe_RunFast;
-	IMPORT _vfp_fpe_RunFast_oldfz;
-	IMPORT _vfp_fpe_scalbn;
-	IMPORT _vfp_fpe_scalbnf;
-	IMPORT _vfp_h2f_single;
-	}
-#endif
-
--- a/kernel/eka/kernel/device.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/device.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -629,9 +629,9 @@
 			r=pdev.FindByFullName(h,n,fn);
 			if (r!=KErrNone)
 				break;
-			__KTRACE_OPT(KDEVICE,Kern::Printf("Found PDD %S",&fn));
+			__KTRACE_OPT(KDEVICE,Kern::Printf("Found PDD %lS",&fn));
 			pP=(DPhysicalDevice *)pdev.At(h);
-			__KTRACE_OPT(KDEVICE,{TBuf<16> verBuf(iVersion.Name()); Kern::Printf("unit=%d, info=%08x, ver=%S",aInfo.iUnit,aInfo.iInfo,&verBuf);});
+			__KTRACE_OPT(KDEVICE,{TBuf<16> verBuf(iVersion.Name()); Kern::Printf("unit=%d, info=%08x, ver=%lS",aInfo.iUnit,aInfo.iInfo,&verBuf);});
 			r=pP->Validate(aInfo.iUnit,aInfo.iInfo,iVersion);
 			__KTRACE_OPT(KDEVICE,Kern::Printf("DPhysicalDevice::Validate returns %d",r));
 			if (r!=KErrNotSupported)
@@ -692,7 +692,7 @@
 		info.iPhysicalDevice=&pddName;
 		}
 
-	__KTRACE_OPT(KDEVICE,Kern::Printf("Exec::ChannelCreate LDD %S PDD %S Unit %d",&lddName,info.iPhysicalDevice,info.iUnit));
+	__KTRACE_OPT(KDEVICE,Kern::Printf("Exec::ChannelCreate LDD %lS PDD %lS Unit %d",&lddName,info.iPhysicalDevice,info.iUnit));
 
 	TInt r=Kern::ValidateName(lddName);
 	if (r<0)
--- a/kernel/eka/kernel/ekern.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/ekern.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -86,7 +86,7 @@
 sourcepath				../klib/arm
 source					 ckdes8.cia cumem.cia cbma.cia
 sourcepath				../common/arm
-source					carray.cia cdes8.cia cmem.cia
+source					carray.cia cdes8.cia cheap.cia cmem.cia
 #if defined(GCC32)
 source 					cgcchelp.cpp cgcchelp.cia
 #elif defined(ARMCC)
@@ -135,10 +135,6 @@
 source					 ckernel.cpp csched.cpp
 source					 cutils.cpp cache.cpp
 
-sourcepath				../common/win32
-userinclude				../common
-source					cmem.cpp
-
 library					emulator.lib
 #endif
 
@@ -162,15 +158,13 @@
 source					 stest.cpp
 source					 sshbuf.cpp smap.cpp
 source					 srandombuff.cpp
-source					 kerncorestats.cpp
 
 sourcepath				../klib
 source					dbase.cpp kdes8.cpp
 source					kheap.cpp bma.cpp
 
 sourcepath				../common
-source					alloc.cpp array.cpp des8.cpp mem.cpp
-source					heap_hybrid.cpp debugfunction.cpp   
+source					alloc.cpp array.cpp des8.cpp heap.cpp mem.cpp
 source					secure.cpp
 macro					__EXPORT_MEMCPY__
 #ifdef MARM
--- a/kernel/eka/kernel/eventq.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/eventq.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -18,7 +18,6 @@
 #include <kernel/kern_priv.h>
 #include "execs.h"
 #include <e32btrace.h>
-#include <kerncorestats.h>
 /******************************************************
  * Event Queue
  ******************************************************/
@@ -116,7 +115,6 @@
 	BTraceContext4(BTrace::ERawEvent, BTrace::EKernelAddEvent ,(TUint32)aEvent.Type());
 #endif
 	NKern::FMWait(&K::EventQueueMutex);
-	KernCoreStats::AddEvent();
     TInt r=KErrOverflow;
 	TRawEvent *pE=K::EventHeadPtr+1;
 	if (pE>=K::EventBufferEnd)
--- a/kernel/eka/kernel/execs.txt	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/execs.txt	Wed Sep 01 12:34:56 2010 +0100
@@ -680,8 +680,6 @@
 
 slow {
 	name = MutexWait
-	return = TInt
-	arg2 = TInt
 	handle = mutex
 }
 
@@ -1530,8 +1528,9 @@
 slow {
 	name = ThreadGetCpuTime
 	return = TInt
-	arg1 = TInt
 	arg2 = EXEC_INT64&
+	handle = thread
+	norelease
 }
 
 slow {
@@ -2431,19 +2430,13 @@
 	norelease
 }
 
+
 slow {
 	name = MathSecureRandom
 	return = TInt
 	arg1 = TDes8&
 }
 
-slow {
-	name = TimerAgainHighRes
-	arg2 = TRequestStatus&
-	arg3 = TInt
-	handle = timer
-}
-
 
 /******************************************************************************
  * End of normal executive functions
--- a/kernel/eka/kernel/exmoncommon.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/exmoncommon.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -33,13 +33,6 @@
 sourcepath			../kernel
 source				smonitor.cpp
 
-#ifdef SMP
-sourcepath			../nkernsmp
-#else
-sourcepath			../nkern
-#endif
-source				nk_mon.cpp
-
 #if defined(MARM)
 #ifdef SMP
 sourcepath			../nkernsmp/arm
--- a/kernel/eka/kernel/kerncorestats.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,609 +0,0 @@
-// Copyright (c) 1994-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:
-// e32\kernel\kerncorestats.cpp
-// 
-// WARNING: This file contains some APIs which are internal and are subject
-//          to change without notice. Such APIs should therefore not be used
-//          outside the Kernel and Hardware Services package.
-//
-
-/** @file
-@internalComponent
-@prototype
-*/
-
-#include <kerncorestats.h>
-#include <nk_priv.h>
-
-// The following differ between unicore and smp, so use define to unify.
-#ifdef __SMP__
-#define FASTTIMER NKern::Timestamp()
-#define FASTTIMERFREQ NKern::TimestampFrequency()
-#define NUMCPUS TheScheduler.iNumCpus
-#else
-#define FASTTIMER (TUint64) NKern::FastCounter()
-#define FASTTIMERFREQ NKern::FastCounterFrequency()
-#define NUMCPUS 1
-#endif
-
-KernCoreStats* KernCoreStats::StatsData=NULL;
-TSpinLock KernCoreStats::Lock(TSpinLock::EOrderGenericIrqLow0);
-
-/**
-This method is called to initiate the KernCoreStats system.
-It can only be called once, and the is no way to disable the system again afterwards. 
-
-@param aStatSelection
-
-The bitfield defining which statistics to be collected.
-
-@return KErrNone on success. KErrInUse is the system has already been configured.
-*/
-EXPORT_C TInt KernCoreStats::Configure(TUint aStatSelection)
-	{
-	if (StatsData)
-		return KErrInUse;
-
-	TInt cores = NUMCPUS;
-
-// Calculate size needed
-
-	TInt dataSize = 0;
-	dataSize+= (aStatSelection & KStatsCoreTotalTimeInIdle)?	sizeof(TUint64)*cores*2 :0;
-	dataSize+= (aStatSelection & KStatsTimeCrossIdleAndActive)?	sizeof(TUint64)*(cores+1) :0;
-	dataSize+= (aStatSelection & KStatsCoreNumTimesInIdle)?		sizeof(TUint)*cores :0;
-	dataSize+= (aStatSelection & KStatsCoreTotalTimeInIdle)?	sizeof(TUint)*cores :0;
-	dataSize+= (aStatSelection & KStatsReadyStateChanges)?		sizeof(TUint)*2*cores:0;
-	dataSize+= (aStatSelection & KStatsNumTimeSliceExpire)?		sizeof(TUint)*cores:0;
-	
-// Create stats object object
-
-	KernCoreStats* kks = (KernCoreStats*) Kern::Alloc(sizeof(KernCoreStats) + dataSize); //coreTimesSize + offset);
-	if (kks==NULL)
-		return KErrNoMemory;
-
-	kks->Construct(aStatSelection);
-
-	__e32_memory_barrier();
-	StatsData = kks;	
-	return KErrNone;
-	};
-
-
-
-/**
-
-  This is a utility class, for calculating address offsets within kerncorestats, and offsets where the data will be copied
-  to at a later point.  This is made more complicated by every item being optional.
-
-@internal
-*/ 
-
-class DynamicObject
-	{
-public:
-	DynamicObject(TAny* aPointer);
-	void Add(TBool, TUint, TAny**, TUint, TUint16&);
-private:
-	TUint iOffset;
-	TUint* iPointer;
-	};
-
-
-/**
- 
-Contructor which takes the address of the allocated memory object, for which items are to be added into.
-
-@internal
-*/
-
-DynamicObject::DynamicObject(TAny* aPointer)
-	:iOffset(0),
-	iPointer((TUint*) aPointer)
-	{};
-
-/**
-Workes out the address of a data item within the alloceted memory object, placeing it after the previosely added one.
-It also works out the target offset, for which the data will be used too fill, within a later provided data block.
-
-@param aFeatureEnabled
-
-A bool used to indicate if the feature is enabled or not.  If not, the refranced offsets are set to indicate the feature is disabled.
-
-@param aSizeInWordsP
-
-The amount of memory for which the object shall use within the internal data object.
-
-@aPointer
-
-The pointer to hold the location of the data item, within the internal object.
-If the feature is disabled, this is set to NULL.
-
-@param aSizeInWordsO
-
-The amount of memory for which the object shall use within the exteral data object.
-
-@param aOffset
-
-The offset to point to the location of the data item, within the external object.  
-This offset can be added to the provided pointer, to form a pointer to it.
-If the feature is disabled, this is set to KStatDisabled.
-
-
-@internal
-*/
-
-void DynamicObject::Add(TBool aFeatureEnabled, TUint aSizeInWordsP,TAny** aPointer, TUint aSizeInWordsO, TUint16& aOffset)
-	{
-	if (aFeatureEnabled)
-		{	
-		*aPointer = iPointer;
-		aOffset = (TUint16) iOffset;
-		iPointer+= aSizeInWordsP;
-		iOffset+=sizeof(TInt)* aSizeInWordsO;
-		}
-	else
-		{
-		*aPointer=NULL;
-		aOffset=KernCoreStats::KStatDisabled;
-		}
-	}	      
-
-/**
-@internal
-
-This second stage constructor is used initialise the KernCoreStats object.
-It is called by KernCoreStats::Configure.
-
-@param aBF
-
-The bitfield defining which statistics to be collected.
-
-@param aSizeToCopy
-
-The size of the section of the data buffer used for holding the stats, which
-can be directly copied into the destination buffer.  The remaining must be calculated.
-
-@pre If user thread, it must be in a critical section.
-
-*/
-void KernCoreStats::Construct(TUint aBF)
-	{
-	TInt cores = NUMCPUS;
-
-	// Here we calculate the offsets and pointers of the data we are collecting.
-	// We need pointers for internal data collection, and offsets for where we will put the data in the structure at collection.
-
-	DynamicObject o((TUint8*) this + sizeof(KernCoreStats));
-	TUint16 dummy=0;
-
-	//	Flag to turn feature on,		size of/and location of internal data,	size of/and location of target data,
-	o.Add(aBF & KStatsCoreTotalTimeInIdle, 		cores*2, 	(TAny**)& iTotalTimeIdle, 	cores,	iOffsTotalTimeIdle);
-	o.Add(aBF & KStatsCoreTotalTimeInIdle, 		cores*2, 	(TAny**)& iLastTimeCore,	0,	dummy);
-	o.Add(aBF & KStatsTimeCrossIdleAndActive, 	(cores+1)*2,	(TAny**)& iTimesCIA,		cores+1, iOffsTimesCIA);
-	o.Add(aBF & KStatsCoreNumTimesInIdle, 		cores,		(TAny**)& iNumberIdles,		cores,	iOffsNumberIdles);
-	o.Add(aBF & KStatsNumEvents, 			0,		(TAny**)& dummy,		1,	iOffsNumEvents);
-	o.Add(aBF & KStatsReadyStateChanges,		cores,		(TAny**)& iLastAddReadyCount,	1, 	iOffsReadyStateAdd);
-	o.Add(aBF & KStatsReadyStateChanges,		cores,		(TAny**)& iLastSubReadyCount,	1,	iOffsReadyStateRemove);
-	o.Add(aBF & KStatsNumTimeSliceExpire,		cores,		(TAny**)& iLastSlicesCount,	1, 	iOffsNumTimeSliceExpire);
-
-
-	TUint64 timeNow = FASTTIMER;
-	TInt core;
-
-	// set up varables needed for CoreTotalTimeInIdle
-	if (iLastTimeCore)
-		{
-		for (core=0; core<cores; core++) // Start core times time now.
-			iLastTimeCore[core]=timeNow;
-		}
-
-	// Set up variables used for KTimeCrossIdleAndActive (iTimesCIA) calculations.
-	// (Could make conditional, but wouldnt save time)
-
-	iLastTime=timeNow;
-	iCoresIdle= 0;
-	};
-
-
-/**
-This method fills the provided buffer with the kernel statistics that have been collected.
-
-@param aBuffer
-
-The pre-allocated buffer for which the collected data should be copied to.
-
-@return KErrNone on success.
-*/
-
-EXPORT_C TInt KernCoreStats::Stats(TAny* aBuffer)
-	{
-	if (StatsData)
-		return StatsData->StatsCopy(aBuffer);
-	else
-		return KErrNotReady;
-	};
-
-
-
-/**
-@internal
-  
-This method implements the functionality of KernCoreStats::Stats.
-This method fills the provided buffer with the kernel statistics that have been collected.
-
-@param aBuffer
-
-The pre-allocated buffer for which the collected data should be copied to.
-
-@return KErrNone on success.
-*/
-
-TInt KernCoreStats::StatsCopy(TAny* aBuffer)
-	{
-	TUint32 timerFrequency = FASTTIMERFREQ;
-	TUint32 targetFrequency=1000000;
-	TInt cores = NUMCPUS;
-	
-	TInt core;
-	TInt ints = __SPIN_LOCK_IRQSAVE(Lock); // This spinlock is doubley important, as it acts as memory barrier for "if (StatsData)"
-
-	TUint64 timeNow = FASTTIMER;
-
-	// For the core idle times, we must add in the time for any core which is currently idle,
-	// so that the values are properly framed.
-	if (iTotalTimeIdle)
-		{
-		TUint u;
-		TUint64 idletime;
-		for(core=0, u = iCoreMask; core<cores; u>>=1, core++)
-			{
-			if (u & 0x1u)
-				{
-				iTotalTimeIdle[core]+=timeNow-iLastTimeCore[core];
-				iLastTimeCore[core]=timeNow;
-				}
-
-			idletime = (iTotalTimeIdle[core]*targetFrequency)/timerFrequency;
-			Value32(aBuffer, iOffsTotalTimeIdle)[core] = ((idletime>>32)?KMaxTUint32:(TUint32)idletime);
-
-			iTotalTimeIdle[core]=0;
-			}
-
-		__SPIN_FLASH_IRQRESTORE(Lock,ints); 
-		timeNow = FASTTIMER;
-		}
-	
-
-	// For times across idle and active, we must add in the time for the current state of the cores
-	// so that the values are properly framed.
-	if (iTimesCIA)
-		{
-		iTimesCIA[iCoresIdle]+= timeNow-iLastTime;
-		iLastTime=timeNow;
-
-		// Copy to structure
-		TUint64 timecia;
-		for(core=0; core<cores+1; core++) // here we are not actally talking about cores, but CIA.
-			{
-			timecia =  (iTimesCIA[core]*targetFrequency)/timerFrequency;
-
-			Value32(aBuffer, iOffsTimesCIA)[core] = (timecia>>32)?KMaxTUint32:(TUint32)timecia;
-			iTimesCIA[core]=0;
-			}
-		__SPIN_FLASH_IRQRESTORE(Lock,ints);
-		}
-	
-	if (iNumberIdles)
-		{
-		for(core=0; core<cores; core++)
-			{
-			Value32(aBuffer, iOffsNumberIdles)[core] =iNumberIdles[core];
-			iNumberIdles[core]=0;
-			}
-		}
-
-	if (iOffsNumEvents!=KStatDisabled)
-		{
-		*Value32(aBuffer, iOffsNumEvents)= iNumEvents;
-		iNumEvents=0;
-		}
-
-	__SPIN_UNLOCK_IRQRESTORE(Lock, ints);
-
-	// Calculate the MadeReady couter, and the MadeUnready counter.
-
-	if (iOffsReadyStateAdd!=KStatDisabled)
-		{
-		TUint addTot=0;
-		TUint subTot=0;
-
-		TUint addReadyCount;
-		TUint subReadyCount;
-
-#ifndef __X86__
-#ifdef __SMP__
-		// for each core, the previous ready and unready values are subtracted from
-		// the current counter value, and then these values added together.
-
-		for (core=0; core<cores; core++)
-			{
-			addReadyCount= TheSubSchedulers[core].iMadeReadyCounter;
-			subReadyCount= TheSubSchedulers[core].iMadeUnReadyCounter;
-			
-			addTot+= addReadyCount - iLastAddReadyCount[core];
-			iLastAddReadyCount[core]=addReadyCount;
-			
-			subTot+= subReadyCount - iLastSubReadyCount[core];
-			iLastSubReadyCount[core]=subReadyCount;
-			}
-#else
-
-		addReadyCount= TheScheduler.iMadeReadyCounter;
-		subReadyCount= TheScheduler.iMadeUnReadyCounter;
-			
-		addTot= addReadyCount - *iLastAddReadyCount;
-		*iLastAddReadyCount=addReadyCount;
-			
-		subTot= subReadyCount - *iLastSubReadyCount;
-		*iLastSubReadyCount=subReadyCount;
-#endif
-#endif
-		// write the calculated values into the provided data buffer.
-		*Value32(aBuffer, iOffsReadyStateAdd)=addTot; 
-		*Value32(aBuffer, iOffsReadyStateRemove)=subTot; 
-		}
-
-
-	// Calculate the time slice expire value
-	if (iOffsNumTimeSliceExpire != KStatDisabled)
-		{
-		TUint slicesTot=0;
-		TUint slicesCount;
-
-#ifndef __X86__
-#ifdef __SMP__	
-
-		// for each core, the previous time slice values are subtracted from
-		// the current counter values, and then these values added together.
-		for (core=0; core<cores ;core++)
-			{
-			slicesCount= TheSubSchedulers[core].iTimeSliceExpireCounter;
-			slicesTot+= slicesCount - iLastSlicesCount[core];
-			iLastSlicesCount[core]=slicesCount;
-			}
-#else
-		slicesCount= TheScheduler.iTimeSliceExpireCounter;
-		slicesTot= slicesCount - *iLastSlicesCount;
-		*iLastSlicesCount=slicesCount;
-#endif
-#endif	
-		// write the calculated values into the provided data buffer.
-		*Value32(aBuffer, iOffsNumTimeSliceExpire) = slicesTot;
-		}
-
-	return KErrNone;
-	}
-
-
-/**
-@internal
-   
-This is called from idle thread, before it entered its idle state.
-For SMP kernels, this is done by the kernel, and the base ports should not call EnterIdle.
-
-@param aCore
-
-The core for which this code in executing.
-
-@pre Interrupts must be disabled
-*/
-
-extern "C" TUint KernCoreStats_EnterIdle(TUint aCore)
-	{
-	CHECK_PRECONDITIONS(MASK_INTERRUPTS_DISABLED , "KernCoreStats_EnterIdle");
-	if (KernCoreStats::StatsData)
-		{
-			KernCoreStats::StatsData->DoEnterIdle(aCore); 
-		return (TUint) ETrue;
-		}
-	return (TUint) EFalse;	
-	}
-#ifndef __WINS__
-#ifndef __SMP__
-
-/**
-This is called from idle thread, before it enters its idle state.
-For non-SMP kernels, the base port must call this explicitly.
-SMP base ports should not call this, as its called from within the kernel.
-
-@pre Interrupts must be disabled
-
-@return a cookie that should be passed to LeaveIdle(), after the core leaves idle.
-*/
-
-EXPORT_C TUint KernCoreStats::EnterIdle()
-	{
-	CHECK_PRECONDITIONS(MASK_INTERRUPTS_DISABLED , "KernCoreStats::EnterIdle");
-	if (StatsData)
-		{
-		StatsData->DoEnterIdle(0); 
-		return (TUint) ETrue;
-		}
-	return (TUint) EFalse;
-	}
-
-#endif
-#endif
-
-/**
-@internal
-
-The implementation code for KernCoreStats::EnterIdle and KernCoreStats_EnterIdle.
-
-@param aCore
-
-The core for which this code in executing.
-
-@pre Interrupts must be disabled
-
-*/
-
-void KernCoreStats::DoEnterIdle(TUint aCore)
-	{
-	__SPIN_LOCK(Lock); // This spinlock is doubley important, as it acts as memory barrier for "if (StatsData)"
-	TUint64 timeNow = FASTTIMER;
-
-	__ASSERT_DEBUG( ((iCoreMask & (1<<aCore) )==0), FAULT() );
-
-
-	if (iLastTimeCore)
-		{
-		iLastTimeCore[aCore]=timeNow;
-		iCoreMask|=1<<aCore;
-		}
-
-	if (iNumberIdles)
-		iNumberIdles[aCore]++;
-
-	if (iTimesCIA)
-		{
-		iTimesCIA[iCoresIdle]+= timeNow-iLastTime;
-
-#ifdef __SMP__
-		__ASSERT_DEBUG((iCoresIdle<TheScheduler.iNumCpus), FAULT() );
-#else
-		__ASSERT_DEBUG((iCoresIdle==0), FAULT() );
-#endif
-
-		iLastTime=timeNow;
-		iCoresIdle++;
-		}
-
-	__SPIN_UNLOCK(Lock);
-	}
-
-/**
-This is called from idle thread, after it comes out of its idle state.
-For SMP kernels, this is done by the kernel, and the base ports should not call LeaveIdle.
-
-@param aCookie
-
-The value returned from EnterIdle should be passed here.
-
-@param aCore
-
-The core for which this code in executing.
-
-@pre Interrupts must be disabled
-*/
-
-extern "C" void KernCoreStats_LeaveIdle(TInt aCookie,TUint aCore)
-	{
-	CHECK_PRECONDITIONS(MASK_INTERRUPTS_DISABLED , "KernCoreStats_LeaveIdle");
-	if (aCookie)
-		KernCoreStats::StatsData->DoLeaveIdle(aCore);
-	}
-
-#ifndef __WINS__
-#ifndef __SMP__
-
-/**
-This is called from idle thread, after it comes out of its idle state.
-For non-SMP kernels, the base port must call this explicitly.
-SMP base ports should not call this, as its called from within the kernel.
-
-@param aCookie
-
-The value returned from EnterIdle should be passed here.
-
-@pre Interrupts must be disabled
-*/
-
-EXPORT_C void KernCoreStats::LeaveIdle(TUint aCookie)
-	{
-	CHECK_PRECONDITIONS(MASK_INTERRUPTS_DISABLED , "KernCoreStats::LeaveIdle");
-	if (aCookie)
-		StatsData->DoLeaveIdle(0);
-	}
-
-#endif
-#endif
-
-/**
-@internal
-
-The implementation code for KernCoreStats::LeaveIdle and KernCoreStats_LeaveIdle.
-
-@param aCore
-
-The core for which this code in executing.
-
-@pre Interrupts must be disabled
-*/
-
-void KernCoreStats::DoLeaveIdle(TUint aCore)
-	{
-	__SPIN_LOCK(Lock);// This spinlock is doubley important, as it acts as memory barrier for "if (StatsData)"
-
-	TUint64 timeNow = FASTTIMER;
-
-	if (iTotalTimeIdle)
-		{
-		__ASSERT_DEBUG(iCoreMask&(1<<aCore), FAULT() );
-		iCoreMask&= ~(1<<aCore);
-		iTotalTimeIdle[aCore] += timeNow - iLastTimeCore[aCore];
-		}
-	if (iTimesCIA)
-		{
-		__ASSERT_DEBUG((StatsData->iCoresIdle>0), FAULT() );
-		iTimesCIA[iCoresIdle]+= timeNow-iLastTime;
-		iLastTime=timeNow;
-		iCoresIdle--;
-		}
-	__SPIN_UNLOCK(Lock);
-	}
-
-
-/**
-@internal
-
-Called from Kern::AddEvent
-
-This is used to increment the KernCoreStats event counter.
-*/
-void KernCoreStats::AddEvent()
-	{
-	if (StatsData)
-		{
-		TInt ints = __SPIN_LOCK_IRQSAVE(Lock);
-		if (StatsData->iOffsNumEvents!= KStatDisabled)
-			StatsData->iNumEvents++;
-		__SPIN_UNLOCK_IRQRESTORE(Lock, ints);
-		}
-	};
-
-
-EXPORT_C TInt KernCoreStats::Retire(TInt, TInt)
-	{
-	// DUMMY METHOD
-	return KErrNone;
-	};
-
-EXPORT_C TInt KernCoreStats::Engage(TInt)
-	{
-	// DUMMY METHOD
-
-	return KErrNone;
-	}
--- a/kernel/eka/kernel/object.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/object.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -441,7 +441,7 @@
 EXPORT_C TInt DObject::SetName(const TDesC* aName)
 	{
 	CHECK_PRECONDITIONS(MASK_THREAD_CRITICAL,"DObject::SetName");		
-	__KTRACE_OPT(KOBJECT,Kern::Printf("SetName %O (%S)",this,aName));
+	__KTRACE_OPT(KOBJECT,Kern::Printf("SetName %O (%lS)",this,aName));
 	TAny* pN=NULL;
 	if (aName)
 		{
@@ -456,7 +456,7 @@
 	pN = __e32_atomic_swp_ord_ptr(&iName, pN);
 	if (iName)
 		{
-		__KTRACE_OPT(KOBJECT,Kern::Printf("Name is now %S",iName));
+		__KTRACE_OPT(KOBJECT,Kern::Printf("Name is now %lS",iName));
 		}
 	else
 		{
@@ -1164,7 +1164,7 @@
 			__KTRACE_OPT(KOBJECT,Kern::Printf("Container %d created OK",pC->UniqueID()));
 			return pC;
 			}
-		__KTRACE_OPT(KOBJECT,Kern::Printf("Error %d creating mutex %S",r,&n));
+		__KTRACE_OPT(KOBJECT,Kern::Printf("Error %d creating mutex %lS",r,&n));
 		}
 	return NULL;
 	}
--- a/kernel/eka/kernel/power.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/power.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-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"
@@ -194,7 +194,7 @@
 // Called in CS
 void DPowerManager::AppendHandler(DPowerHandler* aPh)
 	{ // called by drivers (power handler)
-	__KTRACE_OPT(KPOWER,Kern::Printf("PowerManger::AppendHandler('%S')", &aPh->iName));
+	__KTRACE_OPT(KPOWER,Kern::Printf("PowerManger::AppendHandler('%lS')", &aPh->iName));
 	__ASSERT_CRITICAL;
 	//Check to ensure that handler is not added multiple times and not part of any other list
 	__PM_ASSERT(!(aPh->iPrev) && !(aPh->iNext));
@@ -220,7 +220,7 @@
 // Called in CS
 void DPowerManager::RemoveHandler(DPowerHandler* aPh)
 	{ // called by drivers (power handler)
-	__KTRACE_OPT(KPOWER,Kern::Printf("PowerManger::RemoveHandler('%S')", &aPh->iName));
+	__KTRACE_OPT(KPOWER,Kern::Printf("PowerManger::RemoveHandler('%lS')", &aPh->iName));
 	__ASSERT_CRITICAL;
 	Lock();
 	__PM_ASSERT(aPh);
@@ -529,7 +529,7 @@
 	iStatus |= EDone;
 #endif
 	NKern::Lock();
-	__KTRACE_OPT(KPOWER,Kern::Printf("DPowerHandler::Done('%S') sem=0x%x", &iName, iSem));
+	__KTRACE_OPT(KPOWER,Kern::Printf("DPowerHandler::Done('%lS') sem=0x%x", &iName, iSem));
 	NFastSemaphore* sem = (NFastSemaphore*)__e32_atomic_swp_ord_ptr(&iSem, 0);
 	if (sem)
 		sem->Signal();
@@ -666,9 +666,7 @@
     iResourceControllerData.iResourceController = aController;
     //Store the client Id generated by Resource controller for Power controller to use.
     iResourceControllerData.iClientId = aClientId;
-	
-	// Perform variant specific operations e.g. trigger registration of resources for idle with Resource Manager
-    return DoRegisterResourceController();
+    return KErrNone;
 	}
 
 /**
--- a/kernel/eka/kernel/sbtrace.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/sbtrace.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -427,13 +427,8 @@
 
 #endif
 
-#ifdef BTRACE_RESMANUS
-    case EResourceManagerUs:
-       return ETrue;
-#endif
-
-    case EIic:
-       return ETrue;
+	   case EIic:
+		   return ETrue;
 
 #ifdef BTRACE_TRAWEVENT
 	case ERawEvent:
@@ -450,11 +445,6 @@
 		return ETrue;
 #endif
 
-#ifdef __SMP__
-	case EHSched:
-		return ETrue;
-#endif
-
 	default:
 		return aCategory>=128; // all categories >=128 are 'supported'
 		}
--- a/kernel/eka/kernel/scodeseg.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/scodeseg.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -671,7 +671,7 @@
 	const TInt KValidAttrMask =
 		ECodeSegAttKernel | ECodeSegAttGlobal | ECodeSegAttFixed | ECodeSegAttABIMask | ECodeSegAttHDll | ECodeSegAttExpVer | ECodeSegAttNmdExpData | ECodeSegAttSMPSafe;
 	
-	__KTRACE_OPT(KDLL,Kern::Printf("DCodeSeg::Create %08x file %S ver %08x process %O",this,&aInfo.iFileName,aInfo.iModuleVersion,aProcess));
+	__KTRACE_OPT(KDLL,Kern::Printf("DCodeSeg::Create %08x file %lS ver %08x process %O",this,&aInfo.iFileName,aInfo.iModuleVersion,aProcess));
 	TInt32 uid1=aInfo.iUids.iUid[0].iUid;
 	if (uid1!=KDynamicLibraryUidValue && uid1!=KExecutableImageUidValue)
 		return KErrNotSupported;
@@ -1420,7 +1420,7 @@
 	{
 	TCodeSegCreateInfo info;
 	kumemget32(&info, &aInfo, sizeof(info));
-	__KTRACE_OPT2(KEXEC,KDLL,Kern::Printf("Exec::CodeSegCreate %S ver %08x", &info.iFileName, info.iModuleVersion));
+	__KTRACE_OPT2(KEXEC,KDLL,Kern::Printf("Exec::CodeSegCreate %lS ver %08x", &info.iFileName, info.iModuleVersion));
 	__KTRACE_OPT(KDLL,DumpCodeSegCreateInfo(info));
 	K::CheckFileServerAccess();			// only F32 can use this exec function
 	info.iHandle=NULL;
@@ -1448,7 +1448,7 @@
 	{
 	TCodeSegCreateInfo info;
 	kumemget32(&info, &aInfo, sizeof(info));
-	__KTRACE_OPT2(KEXEC,KDLL,Kern::Printf("Exec::CodeSegLoaded %S ver %08x", &info.iFileName, info.iModuleVersion));
+	__KTRACE_OPT2(KEXEC,KDLL,Kern::Printf("Exec::CodeSegLoaded %lS ver %08x", &info.iFileName, info.iModuleVersion));
 	__KTRACE_OPT(KDLL,DumpCodeSegCreateInfo(info));
 	DCodeSeg* pS=DCodeSeg::VerifyCallerAndHandle(info.iHandle);
 	Kern::AccessCode();
@@ -1667,7 +1667,7 @@
 	{
 	TProcessCreateInfo info;
 	kumemget32(&info, &aInfo, sizeof(info));
-	__KTRACE_OPT2(KEXEC,KDLL,Kern::Printf("Exec::ProcessCreate %S ver %08x", &info.iFileName, info.iModuleVersion));
+	__KTRACE_OPT2(KEXEC,KDLL,Kern::Printf("Exec::ProcessCreate %lS ver %08x", &info.iFileName, info.iModuleVersion));
 	__KTRACE_OPT(KDLL,DumpProcessCreateInfo(info));
 	K::CheckFileServerAccess();			// only F32 can use this exec function
 	if (info.iHandle)
@@ -1782,7 +1782,7 @@
 				// must remove thread
 				DThread* pT=_LOFF(aProcess->iThreadQ.First()->Deque(),DThread,iProcessLink);
 				pT->iProcessLink.iNext=NULL;
-				pT->Stillborn();
+				pT->Release();
 				}
 			aProcess->Release();
 			}
@@ -1794,7 +1794,7 @@
 	{
 	TProcessCreateInfo info;
 	kumemget32(&info, &aInfo, sizeof(info));
-	__KTRACE_OPT2(KEXEC,KDLL,Kern::Printf("Exec::ProcessLoaded %S ver %08x", &info.iFileName, info.iModuleVersion));
+	__KTRACE_OPT2(KEXEC,KDLL,Kern::Printf("Exec::ProcessLoaded %lS ver %08x", &info.iFileName, info.iModuleVersion));
 	__KTRACE_OPT(KDLL,DumpProcessCreateInfo(info));
 	K::CheckFileServerAccess();			// only F32 can use this exec function
 	NKern::LockSystem();
--- a/kernel/eka/kernel/server.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/server.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -840,7 +840,7 @@
 	TBuf<KMaxExitCategoryName> cat;
 	if (aType==EExitPanic && aCategory)
 		GetCategory(cat,*aCategory);
-	__KTRACE_OPT(KEXEC,Kern::Printf("Exec::ThreadKill %d,%d,%S",aType,aReason,&cat));
+	__KTRACE_OPT(KEXEC,Kern::Printf("Exec::ThreadKill %d,%d,%lS",aType,aReason,&cat));
 	K::CheckKernelUnlocked();
 	NKern::LockSystem();
 	DThread* pT=(DThread*)K::ObjectFromHandle(aHandle,EThread);
@@ -856,7 +856,7 @@
 	TBuf<KMaxExitCategoryName> cat;
 	if (aType==EExitPanic && aCategory)
 		GetCategory(cat,*aCategory);
-	__KTRACE_OPT(KEXEC,Kern::Printf("Exec::ProcessKill %d,%d,%S",aType,aReason,&cat));
+	__KTRACE_OPT(KEXEC,Kern::Printf("Exec::ProcessKill %d,%d,%lS",aType,aReason,&cat));
 	K::CheckKernelUnlocked();
 	NKern::LockSystem();
 	DProcess* pP=(DProcess*)K::ThreadEnterCS(aHandle,EProcess);
@@ -932,7 +932,7 @@
 	{
 	CHECK_PRECONDITIONS(MASK_THREAD_STANDARD,"Kern::PanicCurrentThread");			
 	// enter with system unlocked
-	__KTRACE_OPT(KEXEC,Kern::Printf("Kern::PanicCurrentThread %S %d",&aCategory,aReason));
+	__KTRACE_OPT(KEXEC,Kern::Printf("Kern::PanicCurrentThread %lS %d",&aCategory,aReason));
 	K::CheckKernelUnlocked();
 	NKern::LockSystem();
 	TheCurrentThread->Die(EExitPanic,aReason,aCategory);	// doesn't return
--- a/kernel/eka/kernel/sexec.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/sexec.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -36,7 +36,7 @@
 	TFindHandle h;
 	Kern::KUDesGet(match,aName);
 	kumemget32(&h,&aFindHandle,sizeof(h));
-	__KTRACE_OPT(KEXEC,Kern::Printf("ObjN: %S %08x", &match, h.Handle()));
+	__KTRACE_OPT(KEXEC,Kern::Printf("ObjN: %lS %08x", &match, h.Handle()));
 	NKern::ThreadEnterCS();
 	TInt r=pC->FindByFullName(h, match, fn);
 	NKern::ThreadLeaveCS();
@@ -96,26 +96,14 @@
 	return aChunk->Top();
 	}
 
-TInt ExecHandler::MutexWait(DMutex* aMutex, TInt aTimeout)
+void ExecHandler::MutexWait(DMutex* aMutex)
 //
 // Wait for the mutex.
 //
 	{
-	if (aTimeout)	// 0 means wait forever, -1 means poll
-		{
-		if (aTimeout<-1)
-			{
-			return KErrArgument;
-			}
-		if (aTimeout>0)
-			{
-			// Convert microseconds to NTimer ticks, rounding up
-			TInt ntp = NKern::TickPeriod();
-			aTimeout += ntp-1;
-			aTimeout /= ntp;
-			}
-		}
-	return aMutex->Wait(aTimeout);
+
+//	__KTRACE_OPT(KEXEC,Kern::Printf("Exec::MutexWait"));
+	aMutex->Wait();
 	}
 
 void ExecHandler::MutexSignal(DMutex* aMutex)
@@ -567,21 +555,20 @@
 // Wait for a signal.
 //
 	{
+
 	__KTRACE_OPT(KEXEC,Kern::Printf("Exec::SemaphoreWait"));
-	if (aTimeout)	// 0 means wait forever, -1 means poll
+	if (aTimeout)
 		{
-		if (aTimeout<-1)
+		if (aTimeout<0)
 			{
 			NKern::UnlockSystem();
 			return KErrArgument;
 			}
-		if (aTimeout>0)
-			{
-			// Convert microseconds to NTimer ticks, rounding up
-			TInt ntp = NKern::TickPeriod();
-			aTimeout += ntp-1;
-			aTimeout /= ntp;
-			}
+
+		// Convert microseconds to NTimer ticks, rounding up
+		TInt ntp = NKern::TickPeriod();
+		aTimeout += ntp-1;
+		aTimeout /= ntp;
 		}
 	return aSemaphore->Wait(aTimeout);
 	}
@@ -825,7 +812,7 @@
 	TKName n;
 	if (aName)
 		Kern::KUDesGet(n,*aName);
-	__KTRACE_OPT(KEXEC,Kern::Printf("Exec::ChunkCreate %S",&n));
+	__KTRACE_OPT(KEXEC,Kern::Printf("Exec::ChunkCreate %lS",&n));
 	TChunkCreate uinfo;
 	SChunkCreateInfo info;
 	kumemget32(&uinfo,&anInfo,sizeof(uinfo));
@@ -951,9 +938,9 @@
 
 TInt ExecHandler::OpenObject(TObjectType aObjType, const TDesC8& aName, TOwnerType aType)
 	{
+	__KTRACE_OPT(KTHREAD,Kern::Printf("Exec::OpenObject %lS",&aName));
 	TFullName n;
 	Kern::KUDesGet(n,aName);
-	__KTRACE_OPT(KTHREAD,Kern::Printf("Exec::OpenObject %S",&n));
 	if (Kern::ValidateFullName(n)!=KErrNone)
 		K::PanicKernExec(EBadName);
 	if ((TUint)aObjType>=(TUint)ENumObjectTypes)
@@ -1025,12 +1012,12 @@
 		{
 		Kern::KUDesGet(n,*aName);
 		pN=&n;
-		__KTRACE_OPT(KSEMAPHORE,Kern::Printf("Exec::MutexCreate %S",pN));
 		}
 	else if (aType==EOwnerThread)
 		pO=TheCurrentThread;
 	else
 		pO=TheCurrentThread->iOwningProcess;
+	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("Exec::MutexCreate %lS",aName));
 	NKern::ThreadEnterCS();
 	DMutex* pM;
 	TInt r=K::MutexCreate(pM, *pN, pO, ETrue, KMutexOrdUser);
@@ -1049,6 +1036,7 @@
 
 TInt ExecHandler::SemaphoreCreate(const TDesC8* aName, TInt aCount, TOwnerType aType)
 	{
+	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("Exec::SemaphoreCreate %lS",aName));
 	TKName n;
 	DObject* pO=NULL;
 	const TDesC* pN=NULL;
@@ -1056,7 +1044,6 @@
 		{
 		Kern::KUDesGet(n,*aName);
 		pN=&n;
-		__KTRACE_OPT(KSEMAPHORE,Kern::Printf("Exec::SemaphoreCreate %S",pN));
 		}
 	else if (aType==EOwnerThread)
 		pO=TheCurrentThread;
@@ -1243,7 +1230,7 @@
 	{
 	TKName n;
 	Kern::KUDesGet(n,aName);
-	__KTRACE_OPT(KEXEC,Kern::Printf("Exec::ThreadRename %S",&n));
+	__KTRACE_OPT(KEXEC,Kern::Printf("Exec::ThreadRename %lS",&n));
 	NKern::LockSystem();
 	DThread* pT=(DThread*)K::ThreadEnterCS(aHandle,EThread);
 	if (pT!=TheCurrentThread &&
@@ -1268,7 +1255,7 @@
 	{
 	TKName n;
 	Kern::KUDesGet(n,aName);
-	__KTRACE_OPT(KEXEC,Kern::Printf("Exec::ProcessRename %S",&n));
+	__KTRACE_OPT(KEXEC,Kern::Printf("Exec::ProcessRename %lS",&n));
 	NKern::LockSystem();
 	DProcess* pP=(DProcess*)K::ThreadEnterCS(aHandle,EProcess);
 	if (pP->iSecurityZone!=TheCurrentThread->iOwningProcess->iSecurityZone)
@@ -1628,15 +1615,6 @@
 			break;
 			}
 
-		case EDbgGetAllocFail:
-			{
-			NKern::ThreadEnterCS();
-			TInt allocFail = K::Allocator->__DbgGetAllocFail();
-			NKern::ThreadLeaveCS();
-			kumemput32(a2, (TAny*)&allocFail, sizeof(TInt));
-			break;
-			}
-
 		default:
 			panic=EBadKernelHeapDebugFunction;
 			break;
@@ -1920,7 +1898,7 @@
 	{
 	TKName n;
 	Kern::KUDesGet(n,aName);
-	__KTRACE_OPT(KEXEC,Kern::Printf("Exec::ThreadCreate %S",&n));
+	__KTRACE_OPT(KEXEC,Kern::Printf("Exec::ThreadCreate %lS",&n));
 	TUint32 infoBuf[KMaxThreadCreateInfo/sizeof(TUint32)];
 	SThreadCreateInfo& info = *(SThreadCreateInfo*)infoBuf;
 	kumemget32(&info, &aInfo, sizeof(SThreadCreateInfo));
@@ -1955,7 +1933,7 @@
 
 TInt K::MutexCreate(DMutex*& aMutex, const TDesC& aName, DObject* anOwner, TBool aVisible, TUint aOrder)
 	{
-	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("K::MutexCreate %S owner %O visible=%d order=%02x",&aName,anOwner,aVisible,aOrder));
+	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("K::MutexCreate %lS owner %O visible=%d order=%02x",&aName,anOwner,aVisible,aOrder));
 	DMutex* pM=new DMutex;
 	TInt r=KErrNoMemory;
 	if (pM)
@@ -2022,7 +2000,7 @@
 EXPORT_C TInt Kern::ThreadCreate(SThreadCreateInfo& aInfo)
 	{
 	CHECK_PRECONDITIONS(MASK_THREAD_CRITICAL,"Kern::ThreadCreate");		
-	__KTRACE_OPT(KEXEC,Kern::Printf("Kern::ThreadCreate %S",&aInfo.iName));
+	__KTRACE_OPT(KEXEC,Kern::Printf("Kern::ThreadCreate %lS",&aInfo.iName));
 	aInfo.iHandle=NULL;
 	DThread* pT=NULL;
 	TBool svc = aInfo.iType!=EThreadUser;
@@ -2168,23 +2146,18 @@
 	}
 
 #ifdef MONITOR_THREAD_CPU_TIME
-TInt ExecHandler::ThreadGetCpuTime(TInt aThreadHandle, Int64& aTime)
+TInt ExecHandler::ThreadGetCpuTime(DThread* aThread, Int64& aTime)
 	{
-	TUint64 t = 0;
-	if (aThreadHandle == KCurrentThreadHandle)
-		{
-		t = NKern::ThreadCpuTime(NKern::CurrentThread());
-		}
-	else
-		{
-		NKern::LockSystem();
-		DThread* pT = (DThread*)K::ObjectFromHandle(aThreadHandle, EThread);
-		t = NKern::ThreadCpuTime(&pT->iNThread);
-		NKern::UnlockSystem();
-		}
+#ifndef __SMP__
+	TInt64 time = (1000000 * aThread->iNThread.iTotalCpuTime) / NKern::FastCounterFrequency();
+	NKern::UnlockSystem();
+	kumemput32(&aTime, &time, sizeof(TInt64));
+#else
+	TUint64 t = NKern::ThreadCpuTime(&aThread->iNThread);
+	NKern::UnlockSystem();
 	TUint32 f = NKern::CpuTimeMeasFreq();
 	TUint64 t2 = t>>32;
-	t = (t & KMaxTUint32)*1000000;
+	t = ((t<<32)>>32)*1000000;
 	t2 *= 1000000;
 	t2 += (t>>32);
 	t &= TUint64(KMaxTUint32);
@@ -2194,11 +2167,13 @@
 	TUint64 q = t/f;
 	q += (q2<<32);
 	kumemput32(&aTime, &q, sizeof(TInt64));
+#endif
 	return KErrNone;
 	}
-#else
-TInt ExecHandler::ThreadGetCpuTime(TInt /*aThreadHandle*/, Int64& /*aTime*/)
+#else		
+TInt ExecHandler::ThreadGetCpuTime(DThread* /*aThread*/, Int64& /*aTime*/)
 	{
+	NKern::UnlockSystem();
 	return KErrNotSupported;
 	}
 #endif
@@ -2223,10 +2198,10 @@
 	__KTRACE_OPT(KBOOT,Kern::Printf("File server thread registered"));
 	DThread* pT = TheCurrentThread;
 	DProcess* pP = pT->iOwningProcess;
+	pP->iFlags |= (KThreadFlagProcessCritical | KProcessFlagSystemPermanent);
+	pT->iFlags |= KThreadFlagSystemPermanent;
 	if (K::TheFileServerProcess && K::TheFileServerProcess!=pP)
 		K::PanicCurrentThread(EAccessDenied);
-	pP->iFlags |= (KThreadFlagProcessCritical | KProcessFlagSystemPermanent);
-	pT->iFlags |= KThreadFlagSystemPermanent;
 	K::TheFileServerProcess=pP;
 	K::ThreadEnterCS();
 	pP->SetPriority(EPriorityFileServer);
--- a/kernel/eka/kernel/sinit.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/sinit.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -45,11 +45,6 @@
 const TInt KDfcThread1Priority=48;
 const TInt KMaxEventQueue=40;
 
-#ifdef __SMP__
-_LIT(KRebalanceName, "LB");
-const TInt KRebalancePriority=26;
-#endif
-
 TInt SupervisorThread(TAny*);
 TInt DebuggerInit();
 extern TInt InitialiseEntropyBuffers();
@@ -400,14 +395,7 @@
 		K::Fault(K::EInit3Failed);
 
 	P::StartExtensions();
-
 	M::Init4();
-
-#ifdef __SMP__
-	TheScheduler.InitLB();
-	TheScheduler.StartPeriodicBalancing();
-#endif
-
 	K::StartKernelServer();
 	return 0;
 	}
@@ -448,18 +436,6 @@
 	if (r!=KErrNone)
 		return r;
 
-#ifdef __SMP__
-	// create thread and DFC queue for load balancing
-	TScheduler& s = TheScheduler;
-	r = Kern::DfcQCreate(s.iRebalanceDfcQ, KRebalancePriority, &KRebalanceName);
-	if (r!=KErrNone)
-		return r;
-	NThread* nt = TScheduler::LBThread();
-	NKern::ThreadSetCpuAffinity(nt, KCpuAffinityAny);
-	pT = _LOFF(nt, DThread, iNThread);
-	pT->iFlags |= KThreadFlagSystemPermanent;
-#endif
-
 	// Initialise the RAM drive
 	K::InitNvRam();
 
--- a/kernel/eka/kernel/sipc.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/sipc.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1517,9 +1517,7 @@
 	DSession* session = (DSession*)K::ObjectFromHandle(aHandle, ESession);
 	RMessageK* m = TheCurrentThread->iSyncMsgPtr;
 	__ASSERT_ALWAYS(m->IsFree(), K::PanicCurrentThread(ESyncMsgSentTwice));
-	TInt r = session->Send(m, aFunction, aPtr ? &msgArgs : NULL, aStatus);
-	NKern::YieldTimeslice();
-	return r;
+	return session->Send(m, aFunction, aPtr ? &msgArgs : NULL, aStatus);
 	}
 
 TInt DSession::Send(RMessageK* aMsg, TInt aFunction, const RMessageK::TMsgArgs* aArgs, TRequestStatus* aStatus)
@@ -2044,7 +2042,7 @@
 	TBuf<KMaxExitCategoryName> cat;
 	if (aType==EExitPanic && aCategory)
 		GetCategory(cat,*aCategory);
-	__KTRACE_OPT(KEXEC,Kern::Printf("Exec::MessageKill %d,%d,%S",aType,aReason,&cat));
+	__KTRACE_OPT(KEXEC,Kern::Printf("Exec::MessageKill %d,%d,%lS",aType,aReason,&cat));
 	K::CheckKernelUnlocked();
 	NKern::LockSystem();
 	RMessageK* pM = RMessageK::MessageK(aHandle);
--- a/kernel/eka/kernel/skernel.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/skernel.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -53,7 +53,7 @@
 // Enter and return with system unlocked.
 TInt DSemaphore::Create(DObject* aOwner, const TDesC* aName, TInt aInitialCount, TBool aVisible)
 	{
-	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("DSemaphore::Create owner %O, name %S, init count=%d, visible=%d",aOwner,aName,aInitialCount,aVisible));
+	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("DSemaphore::Create owner %O, name %lS, init count=%d, visible=%d",aOwner,aName,aInitialCount,aVisible));
 	if (aInitialCount<0)
 		return KErrArgument;
 	SetOwner(aOwner);
@@ -74,9 +74,6 @@
 
 // Wait for semaphore with timeout
 // Enter with system locked, return with system unlocked.
-// If aNTicks==0, wait forever
-// If aNTicks==-1, poll (don't block)
-// If aNTicks>0, timeout is aNTicks nanokernel ticks
 TInt DSemaphore::Wait(TInt aNTicks)
 	{
 	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("Semaphore %O Wait %d Timeout %d",this,iCount,aNTicks));
@@ -87,23 +84,14 @@
 		r=KErrGeneral;
 	else if (--iCount<0)
 		{
-		if (aNTicks >= 0)
-			{
-			DThread* pC=TheCurrentThread;
-			pC->iMState=DThread::EWaitSemaphore;
-			pC->iWaitObj=this;
-			iWaitQ.Add(pC);
-			BTRACE_KS(BTrace::ESemaphoreBlock, this);
-			r=NKern::Block(aNTicks,NKern::ERelease,SYSTEM_LOCK);
-			__ASSERT_DEBUG(pC->iMState==DThread::EReady,K::Fault(K::ESemWaitBadState));
-			COND_BTRACE_KS(r==KErrNone, BTrace::ESemaphoreAcquire, this);
-			}
-		else
-			{
-			++iCount;
-			NKern::UnlockSystem();
-			r = KErrTimedOut;	// couldn't acquire semaphore immediately, so fail
-			}
+		DThread* pC=TheCurrentThread;
+		pC->iMState=DThread::EWaitSemaphore;
+		pC->iWaitObj=this;
+		iWaitQ.Add(pC);
+		BTRACE_KS(BTrace::ESemaphoreBlock, this);
+		r=NKern::Block(aNTicks,NKern::ERelease,SYSTEM_LOCK);
+		__ASSERT_DEBUG(pC->iMState==DThread::EReady,K::Fault(K::ESemWaitBadState));
+		COND_BTRACE_KS(r==KErrNone, BTrace::ESemaphoreAcquire, this);
 		return r;
 		}
 #ifdef BTRACE_SYMBIAN_KERNEL_SYNC
@@ -318,7 +306,7 @@
 // Enter and return with system unlocked.
 TInt DMutex::Create(DObject* aOwner, const TDesC* aName, TBool aVisible, TUint aOrder)
 	{
-	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("DMutex::Create owner %O, name %S, visible=%d, order=%02x",aOwner,aName,aVisible,aOrder));
+	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("DMutex::Create owner %O, name %lS, visible=%d, order=%02x",aOwner,aName,aVisible,aOrder));
 	iOrder = (TUint8)aOrder;
 	SetOwner(aOwner);
 	TInt r=KErrNone;
@@ -338,14 +326,10 @@
 extern const SNThreadHandlers EpocThreadHandlers;
 #endif
 
-// Wait for mutex with timeout
-// Enter with system locked, return with system unlocked.
-// If aNTicks==0, wait forever
-// If aNTicks==-1, poll (don't block)
-// If aNTicks>0, timeout is aNTicks nanokernel ticks
-TInt DMutex::Wait(TInt aNTicks)
+// Enter and return with system locked.
+TInt DMutex::Wait()
 	{
-	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("Mutex %O Wait(%d) hold %O hldc=%d wtc=%d",this,aNTicks,iCleanup.iThread,iHoldCount,iWaitCount));
+	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("Mutex %O Wait hold %O hldc=%d wtc=%d",this,iCleanup.iThread,iHoldCount,iWaitCount));
 	__ASSERT_SYSTEM_LOCK;
 	__ASSERT_DEBUG(NCurrentThread()->iHandlers==&EpocThreadHandlers, K::Fault(K::EMutexWaitNotDThread));
 	DThread* pC=TheCurrentThread;
@@ -369,8 +353,6 @@
 			BTRACE_KS(BTrace::EMutexAcquire, this);
 			return KErrNone;
 			}
-		if (aNTicks<0)
-			return KErrTimedOut;	// poll mode - can't get mutex immediately so fail
 		K::PINestLevel=0;
 		pC->iMState=DThread::EWaitMutex;
 		pC->iWaitObj=this;
@@ -393,7 +375,7 @@
 		// return value is set at the point where the thread is released from its wait
 		// condition). However we can still detect this situation since the thread will
 		// have been placed into the EReady state when the mutex was reset.
-		TInt r=NKern::Block(aNTicks, NKern::ERelease|NKern::EClaim|NKern::EObstruct, SYSTEM_LOCK);
+		TInt r=NKern::Block(0,NKern::ERelease|NKern::EClaim,SYSTEM_LOCK);
 		if (r==KErrNone && pC->iMState==DThread::EReady)
 			r = KErrGeneral;	// mutex has been reset
 		if (r!=KErrNone)		// if we get an error here...
@@ -672,7 +654,7 @@
 // Enter and return with system unlocked.
 TInt DCondVar::Create(DObject* aOwner, const TDesC* aName, TBool aVisible)
 	{
-	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("DCondVar::Create owner %O, name %S, visible=%d",aOwner,aName,aVisible));
+	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("DCondVar::Create owner %O, name %lS, visible=%d",aOwner,aName,aVisible));
 	SetOwner(aOwner);
 	TInt r=KErrNone;
 	if (aName && aName->Length())
@@ -843,9 +825,6 @@
 				m.iCleanup.ChangePriority(p);
 			}
 		TInt tmout = pC->iMState==DThread::EWaitCondVar ? aTimeout : 0;
-		TUint mode = NKern::ERelease|NKern::EClaim;
-		if (pC->iMState == DThread::EWaitMutex)
-			mode |= NKern::EObstruct;
 		BTRACE_KS2(BTrace::ECondVarBlock, this, &m);
 
 		// The following possibilities exist here:
@@ -862,7 +841,7 @@
 		//		s=KErrNone, thread state EReady
 		// 6.	Thread killed while waiting for mutex or condition variable
 		//		Function doesn't return since exit handler runs instead.
-		TInt s = NKern::Block(tmout, mode, SYSTEM_LOCK);
+		TInt s = NKern::Block(tmout, NKern::ERelease|NKern::EClaim, SYSTEM_LOCK);
 		if (s==KErrNone && pC->iMState==DThread::EReady)
 			s = KErrGeneral;
 		if (s!=KErrNone && s!=KErrTimedOut)	// if we get an error here...
@@ -1098,12 +1077,12 @@
 		{
 		Kern::KUDesGet(n,*aName);
 		pN=&n;
-		__KTRACE_OPT(KSEMAPHORE,Kern::Printf("Exec::CondVarCreate %S", pN));
 		}
 	else if (aType==EOwnerThread)
 		pO=TheCurrentThread;
 	else
 		pO=TheCurrentThread->iOwningProcess;
+	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("Exec::CondVarCreate %lS", aName));
 	NKern::ThreadEnterCS();
 	TInt r=KErrNoMemory;
 	DCondVar* pV = new DCondVar;
--- a/kernel/eka/kernel/smonitor.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/smonitor.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -322,7 +322,7 @@
 		}
 	PrintLine(buf);
 	Printf("Default priority %d WaitLink Priority %d\r\n",pT->iDefaultPriority,pT->iWaitLink.iPriority);
-	Printf("ExitInfo %d,%d,%S\r\n",pT->iExitType,pT->iExitReason,&pT->iExitCategory);
+	Printf("ExitInfo %d,%d,%lS\r\n",pT->iExitType,pT->iExitReason,&pT->iExitCategory);
 	Printf("Flags %08x, Handles %08x\r\n",pT->iFlags,&pT->iHandles);
 	Printf("Supervisor stack base %08x size %x\r\n", pT->iSupervisorStack, pT->iSupervisorStackSize);
 	Printf("User stack base %08x size %x\r\n", pT->iUserStackRunAddress, pT->iUserStackSize);
@@ -493,7 +493,7 @@
  
 void Monitor::DumpProcessData(DProcess* pP)
 	{
-	Printf("ExitInfo %d,%d,%S\r\n",pP->iExitType,pP->iExitReason,&pP->iExitCategory);
+	Printf("ExitInfo %d,%d,%lS\r\n",pP->iExitType,pP->iExitReason,&pP->iExitCategory);
 	Printf("Flags %08x, Handles %08x, Attributes %08x\r\n",pP->iFlags,&pP->iHandles,pP->iAttributes);
 	Printf("DataBssChunk %08x, CodeSeg %08x\r\n",pP->iDataBssStackChunk,pP->iCodeSeg);
 	Printf("DllLock %08x, Process Lock %08x SID %08x\r\n",pP->iDllLock,pP->iProcessLock,pP->iS.iSecureId);
--- a/kernel/eka/kernel/sprocess.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/sprocess.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -324,7 +324,7 @@
 
 	iGeneration = NextGeneration(aName, iUids.iUid[2]);
 
-	__KTRACE_OPT(KTHREAD,Kern::Printf("DProcess::Rename %O to %S",this,&aName));
+	__KTRACE_OPT(KTHREAD,Kern::Printf("DProcess::Rename %O to %lS",this,&aName));
 	TInt r = SetName(&aName);
 #ifdef BTRACE_THREAD_IDENTIFICATION
 	Name(n);
@@ -342,6 +342,7 @@
 	if (iSMPUnsafeGroup)
 		{
 		NKern::GroupDestroy(iSMPUnsafeGroup);
+		Kern::Free(iSMPUnsafeGroup);
 		}
 #endif
 
@@ -530,7 +531,7 @@
 // Kill a process. Enter and return with system unlocked and calling thread in critical section.
 //
 	{
-	__KTRACE_OPT(KPROC,Kern::Printf("Process %O Die: %d %d %S",this,aType,aReason,&aCategory));
+	__KTRACE_OPT(KPROC,Kern::Printf("Process %O Die: %d %d %lS",this,aType,aReason,&aCategory));
 
 	TInt r=WaitProcessLock();
 	if (r!=KErrNone)
@@ -622,7 +623,7 @@
 TInt DProcess::NewThread(DThread*& aThread, SThreadCreateInfo& anInfo, TInt* aHandle, TOwnerType aType)
 	{
 	__KTRACE_OPT(KTHREAD,Kern::Printf("NewThread proc %O, func %08x ptr %08x",this,anInfo.iFunction,anInfo.iPtr));
-	__KTRACE_OPT(KTHREAD,Kern::Printf("type %d name %S pri %d",anInfo.iType,&anInfo.iName,anInfo.iInitialThreadPriority));
+	__KTRACE_OPT(KTHREAD,Kern::Printf("type %d name %lS pri %d",anInfo.iType,&anInfo.iName,anInfo.iInitialThreadPriority));
 	if (aHandle)
 		*aHandle=0;
 	TInt r=GetNewThread(aThread,anInfo);
@@ -735,11 +736,6 @@
 	}
 
 #ifdef __SMP__
-void SMPUnsafeGroupDestroyFn(TAny* aGroup)
-	{
-	Kern::Free(aGroup);
-	}
-
 TInt DProcess::UpdateSMPSafe()
 	{
 	TUint32 config = TheSuperPage().KernelConfigFlags();
@@ -753,21 +749,10 @@
 		{
 		SNThreadGroupCreateInfo info;
 		info.iCpuAffinity = KCpuAffinityAny;
-		NThreadGroup* g = (NThreadGroup*)Kern::Alloc(sizeof(NThreadGroup));
+		iSMPUnsafeGroup = (NThreadGroup*)Kern::Alloc(sizeof(NThreadGroup));
 		r = KErrNoMemory;
-		if (g)
-			{
-			info.iDestructionDfc = new TDfc(&SMPUnsafeGroupDestroyFn, g, K::SvMsgQ, 2);
-			if (info.iDestructionDfc)
-				r = NKern::GroupCreate(g, info);
-			if (r != KErrNone)
-				{
-				delete info.iDestructionDfc;
-				Kern::Free(g);
-				g = 0;
-				}
-			iSMPUnsafeGroup = g;
-			}
+		if (iSMPUnsafeGroup)
+			r = NKern::GroupCreate(iSMPUnsafeGroup, info);
 		}
 	if (r==KErrNone)
 		{
--- a/kernel/eka/kernel/sthread.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/sthread.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -470,7 +470,6 @@
 		aDefaultPriority = 1;
 #endif
 	iDefaultPriority=aDefaultPriority;
-	NKern::ThreadSetNominalPriority(&iNThread, aDefaultPriority);
 	K::PINestLevel=0;
 	SetRequiredPriority();
 	}
@@ -589,28 +588,29 @@
 	ni.iStackSize=iSupervisorStackSize;
 #ifdef __SMP__
 	TUint32 config = TheSuperPage().KernelConfigFlags();
-	ni.iGroup = 0;
-	ni.iCpuAffinity = KCpuAffinityAny;
 	if (iThreadType==EThreadUser)
 		{
 		// user thread
 		if ((config & EKernelConfigSMPUnsafeCPU0) && iOwningProcess->iSMPUnsafeCount)
 			{
 			ni.iCpuAffinity = 0; // compatibility mode
+			ni.iGroup = 0;
 			}
 		else
 			{
+			ni.iCpuAffinity = KCpuAffinityAny;
 			if ((config & EKernelConfigSMPUnsafeCompat) && iOwningProcess->iSMPUnsafeCount)
 				ni.iGroup = iOwningProcess->iSMPUnsafeGroup;
+			else
+				ni.iGroup = 0;
 			}
+		
 		}
 	else
 		{
-		if (config & EKernelConfigSMPLockKernelThreadsCore0) 
-			{
-			// kernel thread
-			ni.iCpuAffinity = 0;
-			}
+		// kernel thread
+		ni.iCpuAffinity = 0;
+		ni.iGroup = 0;
 		}
 #endif
 	if (iThreadType!=EThreadInitial)
@@ -652,53 +652,16 @@
 	return &pT->iKillDfc;	// NKERN will queue this before terminating this thread
 	}
 
-#if defined(__SMP__) && defined(KTIMING)
-TUint64 tix2us(TUint64 aTicks, TUint32 aFreq)
-	{
-	TUint64 e6(1000000);
-	aTicks *= e6;
-	aTicks += TUint64(aFreq>>1);
-	aTicks /= TUint64(aFreq);
-	TUint64 us = aTicks % e6;
-	TUint64 sec = aTicks / e6;
-	return (sec<<32)|us;
-	}
-#endif
-
 void DThread::Exit()
 //
 // This function runs in the context of the exiting thread
 // Enter and leave with system unlocked
 //
 	{
-#if defined(__SMP__) && defined(KTIMING)
-	if (KDebugNum(KTIMING))
-		{
-		TUint64 rc = iNThread.iRunCount.i64;
-		NSchedulable::SCpuStats stats;
-		NKern::Lock();
-		iNThread.GetCpuStats(NSchedulable::E_RunTime|NSchedulable::E_ActiveTime, stats);
-		NKern::Unlock();
-		TUint64 cputime = stats.iRunTime;
-		TUint64 acttime = stats.iActiveTime;
-		TUint32 f = NKern::CpuTimeMeasFreq();
-		TUint64 avgcpu = rc ? cputime / rc : 0;
-		TUint64 ratio = (acttime*100)/cputime;
-		TUint64 cpud = tix2us(cputime, f);
-		TUint64 actd = tix2us(acttime, f);
-		TUint64 avgd = tix2us(avgcpu, f);
-		Kern::Printf("Thread %O RC=%u CPU=%u.%06us ACT=%u.%06us AVG=%u.%06us RATIO=%d%%",
-						this, TUint32(rc),
-						I64HIGH(cpud), I64LOW(cpud),
-						I64HIGH(actd), I64LOW(actd),
-						I64HIGH(avgd), I64LOW(avgd),
-						TUint32(ratio));
-		}
-#endif
 #ifdef KPANIC
 	if (iExitType==EExitPanic)
 		{
-		__KTRACE_OPT2(KPANIC,KSCHED,Kern::Printf("Thread %O Panic %S %d",this,&iExitCategory,iExitReason));
+		__KTRACE_OPT2(KPANIC,KSCHED,Kern::Printf("Thread %O Panic %lS %d",this,&iExitCategory,iExitReason));
 		}
 	else if (iExitType==EExitTerminate)
 		{
@@ -829,7 +792,7 @@
 void DThread::Die(TExitType aType, TInt aReason, const TDesC& aCategory)
 	{
 	CHECK_PRECONDITIONS(MASK_SYSTEM_LOCKED,"DThread::Die");				
-	__KTRACE_OPT(KTHREAD,Kern::Printf("Thread %O Die: %d,%d,%S",this,aType,aReason,&aCategory));
+	__KTRACE_OPT(KTHREAD,Kern::Printf("Thread %O Die: %d,%d,%lS",this,aType,aReason,&aCategory));
 	SetExitInfo(aType,aReason,aCategory);
 
 	// If necessary, decrement count of running user threads in this process.  We get here if the
@@ -922,7 +885,7 @@
 
 TInt DThread::Create(SThreadCreateInfo& aInfo)
 	{
-	__KTRACE_OPT(KTHREAD,Kern::Printf("DThread::Create %S owner %O size %03x", &aInfo.iName,
+	__KTRACE_OPT(KTHREAD,Kern::Printf("DThread::Create %lS owner %O size %03x", &aInfo.iName,
 																iOwningProcess, aInfo.iTotalSize));
 
 	if (aInfo.iTotalSize < (TInt)sizeof(SThreadCreateInfo))
@@ -1267,7 +1230,7 @@
 	TInt r=K::Containers[EThread]->CheckUniqueFullName(this,aName);
 	if (r==KErrNone)
 		{
-		__KTRACE_OPT(KTHREAD,Kern::Printf("DThread::Rename %O to %S",this,&aName));
+		__KTRACE_OPT(KTHREAD,Kern::Printf("DThread::Rename %O to %lS",this,&aName));
 		r=SetName(&aName);
 #ifdef BTRACE_THREAD_IDENTIFICATION
 		Name(n);
--- a/kernel/eka/kernel/stimer.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/stimer.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1071,31 +1071,18 @@
 	DTimer* pT=FromPtr(aTimer);
 	NKern::LockSystem();
 	pT->iTimer.iState = (TUint8)TTimer::EIdle;
-	Kern::QueueRequestComplete(pT->Owner(), pT->iTimer.iRequest, KErrNone);
+	Kern::QueueRequestComplete(pT->Owner(), pT->iTimer.iRequest,KErrNone);
 	NKern::UnlockSystem();
 	}
 
-void DTimer::HighRes(TRequestStatus& aStatus, TInt aInterval)
+void DTimer::HighRes(TRequestStatus& aStatus, TInt anInterval)
 	{
 	// enter and return with system locked
-	TInt r=iTimer.AfterHighRes(aInterval,MsComplete,aStatus);
+	TInt r=iTimer.AfterHighRes(anInterval,MsComplete,aStatus);
 	if (r!=KErrNone)
 		K::PanicCurrentThread(ETimerAlreadyPending);
 	}
 
-void DTimer::AgainHighRes(TRequestStatus& aStatus, TInt aInterval)
-	{
-	// enter and return with system locked
-	TInt r=iTimer.AgainHighRes(aInterval,MsComplete,aStatus);
-	if (r==KErrInUse)
-		K::PanicCurrentThread(ETimerAlreadyPending);
-	else if (r!=KErrNone)
-		{
-		TRequestStatus* status = &aStatus;
-		Kern::RequestComplete(status, r);
-		}
-	}
-
 void DTimer::Cancel()
 //
 // Cancel an outstanding request.
@@ -1204,7 +1191,7 @@
 	iType=(TUint8)aType;
 	}
 
-TInt TTimer::AfterHighRes(TInt aInterval, NTimerFn aFunction, TRequestStatus& aStatus)
+TInt TTimer::AfterHighRes(TInt anInterval, NTimerFn aFunction, TRequestStatus& aStatus)
 	{
 	// enter and return with system locked
 	if (iState!=EIdle || iRequest->SetStatus(&aStatus) != KErrNone)
@@ -1212,37 +1199,12 @@
 	iState = (TUint8)EWaitHighRes;
 	SetType(EHighRes);
 	TInt msp=NTickPeriod();
-	TInt t=(TInt)(((TUint)aInterval+msp-1)/msp);	// convert microseconds to milliseconds, rounding up
+	TInt t=(TInt)(((TUint)anInterval+msp-1)/msp);	// convert microseconds to milliseconds, rounding up
 	new (&Ms()) NTimer(aFunction,this);
 	Ms().OneShot(t,ETrue);			// start millisecond timer, complete in DFC
 	return KErrNone;
 	}
 
-TInt TTimer::AgainHighRes(TInt aInterval, NTimerFn aFunction, TRequestStatus& aStatus)
-	{
-	// enter and return with system locked
-	if (iState!=EIdle)
-		return KErrInUse;
-	if (iType!=EHighRes)
-		return AfterHighRes(aInterval, aFunction, aStatus);
-	if (iRequest->SetStatus(&aStatus) != KErrNone)
-		return KErrInUse;
-	iState = (TUint8)EWaitHighRes;
-	TInt msp=NTickPeriod();
-	TInt t;
-	if (aInterval>=0)
-		t = (TInt)(((TUint)aInterval+msp-1)/msp);	// convert microseconds to milliseconds, rounding up
-	else
-		t = aInterval/msp;		// convert microseconds to milliseconds, rounding up
-	TInt r = Ms().Again(t);		// start millisecond timer, complete in DFC
-	if (r != KErrNone)
-		{
-		iState=(TUint8)EIdle;
-		iRequest->Reset();
-		}
-	return r;
-	}
-
 void TTimer::Cancel(DThread* aThread)
 //
 // Cancel an outstanding request.
@@ -1431,12 +1393,6 @@
 	aTimer->HighRes(aStatus,aTime);
 	}
 
-void ExecHandler::TimerAgainHighRes(DTimer* aTimer, TRequestStatus& aStatus, TInt aTime)
-	{
-	__KTRACE_OPT(KEXEC,Kern::Printf("Exec::TimerAgainHighRes"));
-	aTimer->AgainHighRes(aStatus,aTime);
-	}
-
 void ExecHandler::TimerAt(DTimer* aTimer, TRequestStatus& aStatus, TUint32 aTimeLo, TUint32 aTimeHi)
 	{
 	__KTRACE_OPT(KEXEC,Kern::Printf("Exec::TimerAt"));
--- a/kernel/eka/kernel/sutils.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/sutils.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1580,7 +1580,7 @@
 
 TInt DThread::OpenObject(TOwnerType aType, const TDesC& aName, TInt& aHandle, DObject*& anObj, TInt aObjType)
 	{
-	__KTRACE_OPT(KEXEC,Kern::Printf("DThread::OpenObject %S",&aName));
+	__KTRACE_OPT(KEXEC,Kern::Printf("DThread::OpenObject %lS",&aName));
 	anObj=NULL;
 	TInt r=Kern::ValidateFullName(aName);
 	if (r!=KErrNone)
@@ -2373,7 +2373,7 @@
 EXPORT_C TInt Kern::SemaphoreCreate(DSemaphore*& aSem, const TDesC& aName, TInt aInitialCount)
 	{
 	CHECK_PRECONDITIONS(MASK_THREAD_CRITICAL,"Kern::SemaphoreCreate");				
-	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("Kern::SemaphoreCreate %S init %d", &aName, aInitialCount));
+	__KTRACE_OPT(KSEMAPHORE,Kern::Printf("Kern::SemaphoreCreate %lS init %d", &aName, aInitialCount));
 	TInt r = KErrNoMemory;
 	DSemaphore* pS = new DSemaphore;
 	if (pS)
@@ -2538,9 +2538,8 @@
 	return KErrNone;
 	}
 
-TInt K::KernelHal(TInt aFunction, TAny* a1, TAny* a2)
+TInt K::KernelHal(TInt aFunction, TAny* a1, TAny* /*a2*/)
 	{
-	(void)a2;
 	TInt r=KErrNone;
 	switch (aFunction)
 		{
@@ -2683,23 +2682,15 @@
 		case EKernelHalLockThreadToCpu:
 			{
 #ifdef __SMP__
-			r = KErrArgument;
 			TUint32 cpuId = (TUint32)a1;
-			TUint32 ncpus = NKern::NumberOfCpus();
-			if (cpuId < ncpus)
+			if (cpuId < (TUint32)NKern::NumberOfCpus())
 				{
 				NKern::ThreadSetCpuAffinity(NKern::CurrentThread(), cpuId);
 				r = KErrNone;
 				}
-			else if (cpuId & NTHREADBASE_CPU_AFFINITY_MASK)
+			else
 				{
-				TUint32 mask = cpuId & ~NTHREADBASE_CPU_AFFINITY_MASK;
-				TUint32 amask = ~((~0u)<<ncpus);
-				if (cpuId==KCpuAffinityAny || ((mask & amask) && (mask &~ amask)==0))
-					{
-					NKern::ThreadSetCpuAffinity(NKern::CurrentThread(), cpuId);
-					r = KErrNone;
-					}
+				r = KErrArgument;
 				}
 #else
 			r = KErrNone;
@@ -2711,57 +2702,7 @@
 			// return bottom 31 bits of config flags so as not to signal an error
 			r=K::KernelConfigFlags() & 0x7fffffff;
 			break;
-
-#ifdef __SMP__
-		case EKernelHalCpuStates:
-			{
-			SCpuStates states;
-			memclr(&states, sizeof(states));
-
-			TScheduler& s = TheScheduler;
-			TInt irq = s.iGenIPILock.LockIrqSave();
-			states.iTA = s.iThreadAcceptCpus;
-			states.iIA = s.iIpiAcceptCpus;
-			states.iCU = s.iCpusComingUp;
-			states.iGD = s.iCpusGoingDown;
-			states.iDC = s.iCCDeferCount;
-			states.iSC = s.iCCSyncCpus;
-			states.iRC = s.iCCReactivateCpus;
-			states.iCCS = s.iCCState;
-			states.iPO = TUint8(s.iPoweringOff ? (s.iPoweringOff->iCpuNum|0x80) : 0);
-			states.iPODC = s.iDetachCount;
-			TInt i;
-			TInt nc = NKern::NumberOfCpus();
-			for (i=0; i<nc; ++i)
-				{
-				TSubScheduler& ss = TheSubSchedulers[i];
-				states.iDS[i] = ss.iDeferShutdown;
-#ifdef __CPU_ARM
-				volatile TUint32* p = (volatile TUint32*)ss.iUncached;
-				states.iUDC[i] = p[0];
-				states.iUAC[i] = p[1];
-#endif
-				}
-			s.iGenIPILock.UnlockIrqRestore(irq);
-
-			kumemput32(a1, &states, sizeof(states));
-			r = KErrNone;
-			break;
-			}
-
-		case EKernelHalSetNumberOfCpus:
-			{
-			TInt n = (TInt)a1;
-			if (n<=0 || n>NKern::NumberOfCpus())
-				r = KErrArgument;
-			else
-				{
-				NKern::SetNumberOfActiveCpus(n);
-				r = KErrNone;
-				}
-			break;
-			}
-#endif
+	
 		default:
 			r=KErrNotSupported;
 			break;
--- a/kernel/eka/kernel/win32/cache.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/win32/cache.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -38,14 +38,6 @@
 	{
 	}
 
-EXPORT_C void Cache::CpuRetires()
-	{
-	}
-
-EXPORT_C void Cache::KernelRetires()
-	{
-	}
-
 EXPORT_C void Cache::SyncMemoryBeforeDmaWrite(TLinAddr, TUint, TUint32)
 	{
 	}
--- a/kernel/eka/kernel/win32/cinit.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/win32/cinit.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -25,7 +25,7 @@
 
 GLREF_D TBool EmulRunExe;
 
-extern "C" void NKIdle(TUint32 aStage)
+extern "C" void NKIdle(TInt aStage)
 	{
 	SCpuIdleHandler* cih = NKern::CpuIdleHandler();
 	if (cih && cih->iHandler)
--- a/kernel/eka/kernel/x86/cache.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/x86/cache.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -48,14 +48,6 @@
 	{
 	}
 
-EXPORT_C void Cache::CpuRetires()
-	{
-	}
-
-EXPORT_C void Cache::KernelRetires()
-	{
-	}
-
 EXPORT_C void Cache::SyncMemoryBeforeDmaWrite(TLinAddr, TUint, TUint32)
 	{
 	}
--- a/kernel/eka/kernel/x86/ckernel.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/x86/ckernel.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -201,7 +201,7 @@
 	TheSuperPage().iKernelExcInfo=e;
 	NKern::DisableAllInterrupts();
 #ifdef __SMP__
-	SubScheduler().iSSX.iExcInfo = aPtr;
+	SubScheduler().i_ExcInfo = aPtr;
 #else
 	TheScheduler.i_ExcInfo = aPtr;
 #endif
--- a/kernel/eka/kernel/x86/cutils.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/kernel/x86/cutils.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -102,12 +102,11 @@
 	{
 	if (aPhase==0)
 		{
-		Cache::CpuRetires();
+		Cache::AtomicSyncMemory();
 		return;
 		}
-	Cache::KernelRetires();
 #ifdef __SMP__
-	SFullX86RegSet* regs = &(((SCpuData*)SubScheduler().iSSX.iTss)->iRegs);
+	SFullX86RegSet* regs = &(((SCpuData*)SubScheduler().i_Tss)->iRegs);
 #else
 	SFullX86RegSet* regs = &X86_Regs;
 #endif
@@ -120,7 +119,7 @@
 void A::StartCrashDebugger(const TAny* a0, TInt a1)
 	{
 #ifdef __SMP__
-	SFullX86RegSet* regs = &(((SCpuData*)SubScheduler().iSSX.iTss)->iRegs);
+	SFullX86RegSet* regs = &(((SCpuData*)SubScheduler().i_Tss)->iRegs);
 #else
 	SFullX86RegSet* regs = &X86_Regs;
 #endif
@@ -151,8 +150,8 @@
 	TInt i;
 	for (i=0; i<KMaxCpus; ++i)
 		{
-		TheSubSchedulers[i].iSSX.iCrashState = f;
-		TheSubSchedulers[i].iSSX.iExcInfo = (TAny*)aMode;
+		TheSubSchedulers[i].i_CrashState = (TAny*)f;
+		TheSubSchedulers[i].i_ExcInfo = (TAny*)aMode;
 		}
 	write_apic_reg(ICRH, 0);
 	write_apic_reg(ICRL, 0xC4400);	// send NMI to all processors other than this one - will call vector
--- a/kernel/eka/klib/kheap.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/klib/kheap.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -20,7 +20,7 @@
 _LIT(KLitKernHeap,"KernHeap");
 
 RHeapK::RHeapK(TInt aInitialSize)
-	: RHybridHeap(aInitialSize, 0, EFalse)			
+	: RHeap(aInitialSize, 0, EFalse)
 	{
 	}
 
@@ -59,7 +59,8 @@
 // Create a kernel fixed heap.
 //
 	{
-	__ASSERT_ALWAYS(aInitialSize>(TInt)sizeof(RHeapK), K::Fault(K::ETHeapMaxLengthNegative));
+
+	__ASSERT_ALWAYS(aInitialSize>KMinHeapSize, K::Fault(K::ETHeapMaxLengthNegative));
 	return new(aBase) RHeapK(aInitialSize);
 	}
 
@@ -75,20 +76,6 @@
 	__ASSERT_CRITICAL;
 	}
 
-void RHybridHeap::Lock() const   
-	{
-	DMutex* m = *(DMutex**)&iLock;
-	if (m)
-		Kern::MutexWait(*m);
-	}
-
-void RHybridHeap::Unlock() const   
-	{
-	DMutex* m = *(DMutex**)&iLock;
-	if (m)
-		Kern::MutexSignal(*m);
-	}
-
 void RHeapK::Fault(TInt aFault)
 	{
 	Kern::Fault("KERN-HEAP", aFault);
--- a/kernel/eka/memmodel/emul/win32/mcodeseg.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/emul/win32/mcodeseg.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -66,8 +66,8 @@
 	Kern::Printf("iAccessCount = %d", a.iAccessCount);
 	Kern::Printf("iEntryPtVeneer = %08x", a.iEntryPtVeneer);
 	Kern::Printf("iFileEntryPoint = %08x", a.iFileEntryPoint);
-	Kern::Printf("iFileName = %S", a.iFileName);
-	Kern::Printf("iRootName = %S", &a.iRootName);
+	Kern::Printf("iFileName = %lS", a.iFileName);
+	Kern::Printf("iRootName = %lS", &a.iRootName);
 	Kern::Printf("iExtOffset = %d", a.iExtOffset);
 	Kern::Printf("iModuleVersion = %08x", a.iModuleVersion);
 	Kern::Printf("iUids = %08x %08x %08x", uid[0], uid[1], uid[2]);
@@ -1111,7 +1111,7 @@
 // in order to make them appear to be in z:\system\libs
 void P::NormalizeExecutableFileName(TDes& a)
 	{
-	__KTRACE_OPT(KDLL, Kern::Printf("NormalizeExecutableFileName %S", &a));
+	__KTRACE_OPT(KDLL, Kern::Printf("NormalizeExecutableFileName %lS", &a));
 	if (a.Length()<3 || a[1]!=':' || a[2]!='\\')
 		{
 		// don't have a drive so assume in 'ROM'
@@ -1120,7 +1120,7 @@
 		if (initial.Length()==0 || initial[0]!='\\')
 			a.Append('\\');
 		a+=initial;
-		__KTRACE_OPT(KDLL, Kern::Printf("NormalizeExecutableFileName -> %S", &a));
+		__KTRACE_OPT(KDLL, Kern::Printf("NormalizeExecutableFileName -> %lS", &a));
 		}
 	}
 
--- a/kernel/eka/memmodel/epoc/direct/arm/xinit.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/direct/arm/xinit.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -77,10 +77,10 @@
 	volatile SArmAPBootInfo& info = *(volatile SArmAPBootInfo*)aInfo;
 	TSubScheduler& ss = SubScheduler();
 	TUint32 delta = aCpu*0x2000;
-	info.iInitR13Fiq = TLinAddr(ss.iSSX.iFiqStackTop) + delta;
-	info.iInitR13Irq = TLinAddr(ss.iSSX.iIrqStackTop) + delta;
-	info.iInitR13Abt = TLinAddr(ss.iSSX.iAbtStackTop) + delta;
-	info.iInitR13Und = TLinAddr(ss.iSSX.iUndStackTop) + delta;
+	info.iInitR13Fiq = TLinAddr(ss.i_FiqStackTop) + delta;
+	info.iInitR13Irq = TLinAddr(ss.i_IrqStackTop) + delta;
+	info.iInitR13Abt = TLinAddr(ss.i_AbtStackTop) + delta;
+	info.iInitR13Und = TLinAddr(ss.i_UndStackTop) + delta;
 	}
 
 void M::Init2AP()
--- a/kernel/eka/memmodel/epoc/direct/minit.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/direct/minit.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -20,6 +20,7 @@
 
 _LIT(KLitRamAlloc,"RamAlloc");
 
+const TInt KMaxSupervisorStackSpace=0x200000;
 
 void M::Init1()
 	{
--- a/kernel/eka/memmodel/epoc/direct/mutils.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/direct/mutils.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -474,32 +474,6 @@
 
 
 /**
-Free a RAM zone which was previously allocated by one of these methods:
-Epoc::AllocPhysicalRam(), Epoc::ZoneAllocPhysicalRam() or 
-TRamDefragRequest::ClaimRamZone().
-
-All of the pages in the RAM zone must be allocated and only via one of the methods 
-listed above, otherwise a system panic will occur.
-
-@param	aZoneId			The ID of the RAM zone to free.
-@return	KErrNone 		If the operation was successful.
-		KErrArgument 	If a RAM zone with ID aZoneId was not found.
-
-@pre Calling thread must be in a critical section.
-@pre Interrupts must be enabled.
-@pre Kernel must be unlocked.
-@pre No fast mutex can be held.
-@pre Call in a thread context.
-@pre Can be used in a device driver.
-*/
-EXPORT_C TInt Epoc::FreeRamZone(TUint aZoneId)
-	{
-	CHECK_PRECONDITIONS(MASK_THREAD_CRITICAL,"Epoc::FreeRamZone");
-	return KErrNotSupported;
-	}
-
-
-/**
 	@pre	Call in a thread context.
 	@pre	Interrupts must be enabled.
 	@pre	Kernel must be unlocked.
--- a/kernel/eka/memmodel/epoc/flexible/arm/xipc.cia	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/arm/xipc.cia	Wed Sep 01 12:34:56 2010 +0100
@@ -33,11 +33,8 @@
 extern "C" void __FaultIpcClientNotNull();  // defined in ckernel.cpp
 #endif
 
-#ifdef _DEBUG
-__NAKED__ TInt DoThreadReadAndParseDesHeader(DThread* aThread, const TAny* aSrc, TDesHeader& aDest)
-#else
+
 __NAKED__ TInt DThread::ReadAndParseDesHeader(const TAny* aSrc, TDesHeader& aDest)
-#endif
 	{
 	ASM_ASSERT_PAGING_SAFE;
 	// save state including 'this', aSrc and sDest. Double word aligns the stack 
@@ -64,8 +61,8 @@
 	// Check a reference could be opened on target process's os asid, failed if r0 < 0.
 	asm("cmp r0, #0");
 	asm("bmi readParseDesHeader_ExitErr");
+
 	asm("mov r10, r0");			// r10 = os asid of current process
-
 	asm("ldmia sp!, {r0-r2}");	// r0 = this, r1 = aSrc, r2 = aDest
 	
 	__ASM_CLI(); // disable all interrupts
--- a/kernel/eka/memmodel/epoc/flexible/arm/xipc.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-// Copyright (c) 1997-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:
-//
-
-#ifdef _DEBUG
-
-#include "arm_mem.h"
-#include "mpager.h"
-
-TInt DoThreadReadAndParseDesHeader(DThread* aThread, const TAny* aSrc, TDesHeader& aDest);
-
-TInt DThread::ReadAndParseDesHeader(const TAny* aSrc, TDesHeader& aDest)
-	{
-	if (KDebugNum(KFORCEKUPAGEFAULTS))
-		{
-		TInt r = ThePager.FlushRegion((DMemModelProcess*)iOwningProcess,
-									  (TLinAddr)aSrc, sizeof(TDesHeader));
-		(void)r; // ignore errors
-		}
-	return DoThreadReadAndParseDesHeader(this, aSrc, aDest);
-	}
-
-#endif
--- a/kernel/eka/memmodel/epoc/flexible/arm/xsched.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/arm/xsched.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -14,7 +14,6 @@
 //
 
 #include "arm_mem.h"
-#include "mpager.h"
 
 #define iMState		iWaitLink.iSpare1
 
@@ -31,18 +30,6 @@
 	DThread* thread = TheCurrentThread;
 	TRequestStatus* status = aStatus;
 	aStatus = NULL;
-
-#ifdef _DEBUG
-	if (KDebugNum(KFORCEKUPAGEFAULTS))
-		{
-		NKern::UnlockSystem();
-		TInt r = ThePager.FlushRegion((DMemModelProcess*)thread->iOwningProcess,
-									  (TLinAddr)status, sizeof(TRequestStatus));
-		(void)r; // ignore errors
-		NKern::LockSystem();
-		}
-#endif
-	
 	TInt pagingFault;
 	do
 		{
--- a/kernel/eka/memmodel/epoc/flexible/mcodeseg.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mcodeseg.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -221,17 +221,12 @@
 	TInt exportDirSize = iRamInfo.iExportDirCount * sizeof(TLinAddr);
 	if(exportDirSize > 0 || (exportDirSize==0 && (iCodeSeg->iAttr&ECodeSegAttNmdExpData)) )
 		{
-		TLinAddr expDirLoad = iRamInfo.iExportDir - iRamInfo.iCodeRunAddr + iRamInfo.iCodeLoadAddr;
-		if (expDirLoad < iRamInfo.iCodeLoadAddr ||
-			expDirLoad + exportDirSize > iRamInfo.iCodeLoadAddr + iRamInfo.iCodeSize)
-			{// Invalid export section but the loader should have checked this.
-			return KErrCorrupt;
-			}
 		exportDirSize += sizeof(TLinAddr);
 		TLinAddr* expDir = (TLinAddr*)Kern::Alloc(exportDirSize);
 		if(!expDir)
 			return KErrNoMemory;
 		iCopyOfExportDir = expDir;
+		TLinAddr expDirLoad = iRamInfo.iExportDir-iRamInfo.iCodeRunAddr+iRamInfo.iCodeLoadAddr;
 		UNLOCK_USER_MEMORY();
 		memcpy(expDir,(TAny*)(expDirLoad-sizeof(TLinAddr)),exportDirSize);
 		LOCK_USER_MEMORY();
--- a/kernel/eka/memmodel/epoc/flexible/mmu/arm/xmmu.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/arm/xmmu.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -298,8 +298,7 @@
 			// we have an L1 data cache...
 			TUint32 csir = InternalCache::SizeIdRegister(0,0);
 			TUint sets = ((csir>>13)&0x7fff)+1;
-			TUint ways = ((csir>>3)&0x3ff);
-			ways+=1;
+			TUint ways = ((csir>>3)&0x3ff)+1;
 			TUint lineSizeShift = (csir&7)+4;
 			// assume L1 data cache is VIPT and alias checks broken and so we need data cache colouring...
 			dColourCount = (sets<<lineSizeShift)>>KPageShift;
@@ -313,8 +312,7 @@
 			// we have a separate L1 instruction cache...
 			TUint32 csir = InternalCache::SizeIdRegister(1,0);
 			TUint sets = ((csir>>13)&0x7fff)+1;
-			TUint ways = ((csir>>3)&0x3ff);
-			ways+=1;
+			TUint ways = ((csir>>3)&0x3ff)+1;
 			TUint lineSizeShift = (csir&7)+4;
 			iColourCount = (sets<<lineSizeShift)>>KPageShift;
 			TRACEB(("L1ICache = 0x%x,0x%x,%d colourCount=%d",sets,ways,lineSizeShift,(sets<<lineSizeShift)>>KPageShift));
@@ -904,15 +902,6 @@
 	if(TUint(aAddr^KIPCAlias)<TUint(KIPCAliasAreaSize))
 		return KErrBadDescriptor; // prevent access to alias region
 
-#ifdef _DEBUG
-	if (KDebugNum(KFORCEKUPAGEFAULTS))
-		{
-		TInt r = ThePager.FlushRegion(aProcess, aAddr, aSize);
-		if (r != KErrNone)
-			return r;
-		}
-#endif
-	
 	// Grab the mmu lock before opening a reference on os asid so that this thread 
 	// is in an implicit critical section and therefore can't leak the reference by
 	// dying before iAliasLinAddr is set.
--- a/kernel/eka/memmodel/epoc/flexible/mmu/maddressspace.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/maddressspace.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -245,14 +245,14 @@
 	{
 	TRACE(("DAddressSpace::FreeVirtualMemory(0x%08x,0x%08x) osAsid=%d",aAddr, aSize, iOsAsid));
 	Lock();
-	TBool global = iOsAsid==(TInt)KKernelOsAsid && UserGlobalVirtualAllocator.InRange(aAddr,aSize);
-	if(global)
+	if(iOsAsid==(TInt)KKernelOsAsid && UserGlobalVirtualAllocator.InRange(aAddr,aSize))
 		UserGlobalVirtualAllocator.Free(aAddr,aSize);
 	else
+		{
 		iVirtualAllocator.Free(aAddr,aSize);
+		AsyncClose();
+		}
 	Unlock();
-	if (!global)
-		AsyncClose();
 	}
 
 
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mcodepaging.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mcodepaging.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -298,17 +298,31 @@
 												(TAny*)info.iCodeLocalDrive,
 												(TAny*)&message);
 
-		r = ThePager.EmbedErrorContext(EPagingErrorContextCodeRead, bufferStart); 
-		if(r<0)
+		if(bufferStart<0)
+			{
+			r = bufferStart; // return error
+			__NK_ASSERT_DEBUG(0);
 			break;
+			}
 
 		TLinAddr data = aRequest->Buffer() + bufferStart;
 		r = Decompress(info.iCompressionType, linAddr, decompressedSize, data, dataSize);
-		if (r >= 0)
-			r = (r == decompressedSize) ? KErrNone : KErrCorrupt;
-		if(r != KErrNone)
-			__KTRACE_OPT(KPANIC, Kern::Printf("DCodePagedMemoryManager::ReadPage: error decompressing page at %08x + %x: %d", dataOffset, dataSize, r));
-		r = ThePager.EmbedErrorContext(EPagingErrorContextCodeDecompress, r); 			
+		if(r>=0)
+			{
+			if(r!=decompressedSize)
+				{
+				__KTRACE_OPT(KPANIC, Kern::Printf("DCodePagedMemoryManager::ReadPage: error decompressing page at %08x + %x: %d", dataOffset, dataSize, r));
+				__NK_ASSERT_DEBUG(0);
+				r = KErrCorrupt;
+				}
+			else
+				r = KErrNone;
+			}
+		else
+			{
+			__NK_ASSERT_DEBUG(0);
+			}
+
 		if(r!=KErrNone)
 			break;
 
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mdatapaging.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mdatapaging.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -67,7 +67,7 @@
 	enum TSwapState
 		{
 		EStateUnreserved = 0,	///< swap space not yet reserved, or page is being decommitted
-		EStateBlank      = 1,	///< swap page has never been written or the last write failed
+		EStateBlank      = 1,	///< swap page has never been written
 		EStateWritten    = 2,	///< swap page has been written out at least once
 		EStateWriting    = 3	///< swap page is in the process of being written out
 		};
@@ -157,26 +157,26 @@
 
 private:
 	/**
-	The paging device used for accessing the backing store.
-	This is set by #InstallPagingDevice.
+	   The paging device used for accessing the backing store.
+	   This is set by #InstallPagingDevice.
 	*/
 	DPagingDevice* iDevice;
 
 	/**
-	The instance of #DSwapManager being used by this manager.
+	   The instance of #DSwapManager being used by this manager.
 	*/
 	DSwapManager* iSwapManager;
 
 	/**
-	Whether to read and write pages by physical address without mapping them first.
+	   Whether to read and write pages by physical address without mapping them first.
 
-	Set if the paging media driver supports it.
+	   Set if the paging media driver supports it.
 	*/
 	TBool iUsePhysicalAccess;
 
 public:
 	/**
-	The single instance of this manager class.
+	   The single instance of this manager class.
 	*/
 	static DDataPagedMemoryManager TheManager;
 	};
@@ -187,9 +187,9 @@
 
 
 /**
-Create a swap manager.
+   Create a swap manager.
 
-@param	aDevice	The demand paging device for access to the swap.
+   @param	aDevice	The demand paging device for access to the swap.
 */
 TInt DSwapManager::Create(DPagingDevice* aDevice)
 	{
@@ -231,7 +231,7 @@
 inline DSwapManager::TSwapState DSwapManager::SwapState(TUint aSwapData)
 	{
 	TSwapState state = (TSwapState)(aSwapData & ESwapStateMask);
-	__NK_ASSERT_DEBUG(state >= EStateBlank || aSwapData == 0);
+	__NK_ASSERT_DEBUG(state >= EStateWritten || (aSwapData & ~ESwapStateMask) == 0);
 	return state;
 	}
 
@@ -244,19 +244,18 @@
 
 inline TUint DSwapManager::SwapData(TSwapState aSwapState, TInt aSwapIndex)
 	{
-	__NK_ASSERT_DEBUG(aSwapIndex < (1 << (32 - ESwapIndexShift)));
 	return (aSwapIndex << ESwapIndexShift) | aSwapState;
 	}
 
 
 /**
-Allocate one or more page's worth of space within the swap area.
+   Allocate one or more page's worth of space within the swap area.
 
-The location is represented by a page-based index into the swap area.
+   The location is represented by a page-based index into the swap area.
 
-@param aCount The number of page's worth of space to allocate.
+   @param aCount The number of page's worth of space to allocate.
 
-@return The swap index of the first location allocated.
+   @return The swap index of the first location allocated.
 */
 TInt DSwapManager::AllocSwapIndex(TUint aCount)
 	{
@@ -314,9 +313,9 @@
 
 
 /**
-Free one page's worth of space within the swap area.
+   Free one page's worth of space within the swap area.
 
-The index must have been previously allocated with AllocSwapIndex().
+   The index must have been previously allocated with AllocSwapIndex().
 */
 void DSwapManager::FreeSwapIndex(TInt aSwapIndex)
 	{
@@ -329,15 +328,15 @@
 
 
 /**
-Reserve some swap pages for the requested region of the memory object
+   Reserve some swap pages for the requested region of the memory object
 
-@param aMemory		The memory object to reserve pages for.
-@param aStartIndex	The page index in the memory object of the start of the region.
-@param aPageCount	The number of pages to reserve.
+   @param aMemory		The memory object to reserve pages for.
+   @param aStartIndex	The page index in the memory object of the start of the region.
+   @param aPageCount	The number of pages to reserve.
 
-@return KErrNone on success, KErrNoMemory if not enough swap space available.
-@pre aMemory's lock is held.
-@post aMemory's lock is held.
+   @return KErrNone on success, KErrNoMemory if not enough swap space available.
+   @pre aMemory's lock is held.
+   @post aMemory's lock is held.
 */
 TInt DSwapManager::ReserveSwap(DMemoryObject* aMemory, TUint aStartIndex, TUint aPageCount)
 	{
@@ -370,15 +369,15 @@
 
 
 /**
-Unreserve swap pages for the requested region of the memory object.
+   Unreserve swap pages for the requested region of the memory object.
 
-@param aMemory		The memory object to unreserve pages for.
-@param aStartIndex	The page index in the memory object of the start of the region.
-@param aPageCount	The number of pages to unreserve.
+   @param aMemory		The memory object to unreserve pages for.
+   @param aStartIndex	The page index in the memory object of the start of the region.
+   @param aPageCount	The number of pages to unreserve.
 
-@return The number of pages freed.
-@pre aMemory's lock is held.
-@post aMemory's lock is held.
+   @return The number of pages freed.
+   @pre aMemory's lock is held.
+   @post aMemory's lock is held.
 */
 TInt DSwapManager::UnreserveSwap(DMemoryObject* aMemory, TUint aStartIndex, TUint aPageCount)
 	{
@@ -425,13 +424,13 @@
 
 
 /**
-Determine whether the specified pages in the memory object have swap reserved for them.
+   Determine whether the specified pages in the memory object have swap reserved for them.
 
-@param aMemory		The memory object that owns the pages.
-@param aStartIndex	The first index of the pages to check.
-@param aPageCount	The number of pages to check.
+   @param aMemory		The memory object that owns the pages.
+   @param aStartIndex	The first index of the pages to check.
+   @param aPageCount	The number of pages to check.
 
-@return ETrue if swap is reserved for all the pages, EFalse otherwise.
+   @return ETrue if swap is reserved for all the pages, EFalse otherwise.
 */
 TBool DSwapManager::IsReserved(DMemoryObject* aMemory, TUint aStartIndex, TUint aPageCount)
 	{// MmuLock required to protect manager data.
@@ -452,19 +451,20 @@
 
 
 /**
-Read from the swap the specified pages associated with the memory object.
+   Read from the swap the specified pages associated with the memory object.
 
-@param aMemory 	The memory object to read the pages for
-@param aIndex	The index of the first page within the memory object.
-@param aCount	The number of pages to read.
-@param aLinAddr	The address to copy the pages to.
-@param aRequest	The request to use for the read.
-@param aPhysAddrs	An array of the physical addresses for each page to read in.
+   @param aMemory 	The memory object to read the pages for
+   @param aIndex	The index of the first page within the memory object.
+   @param aCount	The number of pages to read.
+   @param aLinAddr	The address to copy the pages to.
+   @param aRequest	The request to use for the read.
+   @param aPhysAddrs	An array of the physical addresses for each page to read in.
 */
 TInt DSwapManager::ReadSwapPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TLinAddr aLinAddr, TPhysAddr* aPhysAddrs)
 	{
 	__ASSERT_CRITICAL;
 	
+	TInt r = KErrNone;
 	const TUint readUnitShift = iDevice->iReadUnitShift;
 	TUint readSize = KPageSize >> readUnitShift;
 	TThreadMessage message;
@@ -477,36 +477,24 @@
 		MmuLock::Lock();	// MmuLock required for atomic access to manager data.
 		TUint swapData = aMemory->PagingManagerData(index);
 		TSwapState state = SwapState(swapData);
-		TUint swapPage = SwapIndex(swapData);
 
 		if (state == EStateUnreserved)
-			{
-			// This page is not committed to the memory object
+			{// This page is not committed to the memory object
 			MmuLock::Unlock();
 			return KErrNotFound;			
 			}
 		else if (state == EStateBlank)
-			{
-			if (swapPage != 0)
-				{
-				// An error occured while writing the page out, so report it now
-				MmuLock::Unlock();
-				return -swapPage; 
-				}
-			else
+			{// This page has not been written to yet so don't read from swap 
+			// just wipe it if required.
+			TUint allocFlags = aMemory->RamAllocFlags();
+			MmuLock::Unlock();
+			TBool wipePages = !(allocFlags & Mmu::EAllocNoWipe);
+			if (wipePages)
 				{
-				// This page has not been written to yet so don't read from swap 
-				// just wipe it if required.
-				TUint allocFlags = aMemory->RamAllocFlags();
-				MmuLock::Unlock();
-				TBool wipePages = !(allocFlags & Mmu::EAllocNoWipe);
-				if (wipePages)
-					{
-					TUint8 wipeByte = (allocFlags & Mmu::EAllocUseCustomWipeByte) ?
-						(allocFlags >> Mmu::EAllocWipeByteShift) & 0xff :
-						0x03;
-					memset((TAny*)aLinAddr, wipeByte, KPageSize);
-					}
+				TUint8 wipeByte = (allocFlags & Mmu::EAllocUseCustomWipeByte) ?
+					(allocFlags >> Mmu::EAllocWipeByteShift) & 0xff :
+					0x03;
+				memset((TAny*)aLinAddr, wipeByte, KPageSize);
 				}
 			}
 		else
@@ -518,35 +506,33 @@
 			// OK to release as if the object's data is decommitted the pager 
 			// will check that data is still valid before mapping it.
 			MmuLock::Unlock();
-			TUint readStart = (swapPage << KPageShift) >> readUnitShift;
+			TUint readStart = (SwapIndex(swapData) << KPageShift) >> readUnitShift;
 			START_PAGING_BENCHMARK;
-			TInt r = iDevice->Read(&message, aLinAddr, readStart, readSize, DPagingDevice::EDriveDataPaging);
+			r = iDevice->Read(&message, aLinAddr, readStart, readSize, DPagingDevice::EDriveDataPaging);
+			if (r != KErrNone)
+				__KTRACE_OPT(KPANIC, Kern::Printf("DSwapManager::ReadSwapPages: error reading media at %08x + %x: %d", readStart << readUnitShift, readSize << readUnitShift, r));				
+			__NK_ASSERT_DEBUG(r!=KErrNoMemory); // not allowed to allocate memory, therefore can't fail with KErrNoMemory
 			END_PAGING_BENCHMARK(EPagingBmReadDataMedia);
-			__NK_ASSERT_DEBUG(r!=KErrNoMemory); // not allowed to allocate memory, therefore shouldn't fail with KErrNoMemory
-			if (r != KErrNone)
-				__KTRACE_OPT(KPANIC, Kern::Printf("DSwapManager::ReadSwapPages: error reading media at %08x + %x: %d", readStart << readUnitShift, readSize << readUnitShift, r));
-			r = ThePager.EmbedErrorContext(EPagingErrorContextDataRead, r);
-			if (r != KErrNone)
-				return r;
+			__NK_ASSERT_ALWAYS(r == KErrNone);
 			}
 		END_PAGING_BENCHMARK(EPagingBmReadDataPage);
 		}
-	
-	return KErrNone;
+
+	return r;
 	}
 
 
 /**
-Write the specified memory object's pages from the RAM into the swap.
+   Write the specified memory object's pages from the RAM into the swap.
 
-@param	aMemory		The memory object who owns the pages.
-@param	aIndex		The index within the memory object.
-@param 	aCount		The number of pages to write out.
-@param	aLinAddr	The location of the pages to write out.
-@param  aBackground Whether this is being called in the background by the page cleaning thread
-                    as opposed to on demand when a free page is required.
+   @param	aMemory		The memory object who owns the pages.
+   @param	aIndex		The index within the memory object.
+   @param 	aCount		The number of pages to write out.
+   @param	aLinAddr	The location of the pages to write out.
+   @param  aBackground Whether this is being called in the background by the page cleaning thread
+   as opposed to on demand when a free page is required.
 
-@pre Called with page cleaning lock held
+   @pre Called with page cleaning lock held
 */
 TInt DSwapManager::WriteSwapPages(DMemoryObject** aMemory, TUint* aIndex, TUint aCount, TLinAddr aLinAddr, TPhysAddr* aPhysAddrs, TBool aBackground)
 	{
@@ -640,16 +626,14 @@
 		r = iDevice->WritePhysical(&msg, aPhysAddrs, aCount, writeOffset, aBackground);
 	else
 		r = iDevice->Write(&msg, aLinAddr + (aPageIndex << KPageShift), writeOffset, writeSize, aBackground);
-	END_PAGING_BENCHMARK(EPagingBmWriteDataMedia);
 		
 	if (r != KErrNone)
 		{
 		__KTRACE_OPT(KPANIC, Kern::Printf("DSwapManager::WriteSwapPages: error writing media from %08x to %08x + %x: %d", aLinAddr, writeOffset << readUnitShift, writeSize << readUnitShift, r));
-		if (r > 0)
-			r = KErrGeneral;
 		}
 	__NK_ASSERT_DEBUG(r!=KErrNoMemory); // not allowed to allocate memory, therefore can't fail with KErrNoMemory
-	r = ThePager.EmbedErrorContext(EPagingErrorContextDataWrite, r); 
+	__NK_ASSERT_ALWAYS(r == KErrNone);
+	END_PAGING_BENCHMARK(EPagingBmWriteDataMedia);
 
 	TUint i;
 	TUint swapData[KMaxPagesToClean];
@@ -663,12 +647,8 @@
 		__NK_ASSERT_DEBUG(s == EStateUnreserved || s == EStateWriting);
 		if (s == EStateWriting)
 			{
-			// Store the new swap location and mark the page as saved, or if an error occured then
-			// record the error code instead
-			TUint swapData = (r == KErrNone) 
-				? SwapData(EStateWritten, aSwapIndex + i)
-				: SwapData(EStateBlank, -r);
-			aMemory[i]->SetPagingManagerData(aIndex[i], swapData);
+			// Store the new swap location and mark the page as saved.
+			aMemory[i]->SetPagingManagerData(aIndex[i], SwapData(EStateWritten, aSwapIndex + i));
 			}
 		}
 	MmuLock::Unlock();
@@ -676,17 +656,15 @@
 	for (i = 0 ; i < aCount ; ++i)
 		{
 		TSwapState s = SwapState(swapData[i]);
-		if (s == EStateUnreserved || s == EStateBlank)
+		if (s == EStateUnreserved)
 			{
-			// The page was either decommitted while we were cleaning it, or an error occured while
-			// writing.  Free the swap page and don't modify the state.
+			// The page was decommitted while we were cleaning it, so free the swap page we
+			// allocated and continue, leaving this page in the unreserved state.
 			FreeSwapIndex(aSwapIndex + i);
 			}
 		}
 
-	// write errors are not reported at this point as this will just kill a thread unrelated to the
-	// one whose data has been lost
-	return KErrNone;  
+	return KErrNone;
 	}
 	
 
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mexport.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mexport.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -510,35 +510,6 @@
 
 
 /**
-Free a RAM zone which was previously allocated by one of these methods:
-Epoc::AllocPhysicalRam(), Epoc::ZoneAllocPhysicalRam() or 
-TRamDefragRequest::ClaimRamZone().
-
-All of the pages in the RAM zone must be allocated and only via one of the methods 
-listed above, otherwise a system panic will occur.
-
-@param	aZoneId			The ID of the RAM zone to free.
-@return	KErrNone 		If the operation was successful.
-		KErrArgument 	If a RAM zone with ID aZoneId was not found.
-
-@pre Calling thread must be in a critical section.
-@pre Interrupts must be enabled.
-@pre Kernel must be unlocked.
-@pre No fast mutex can be held.
-@pre Call in a thread context.
-@pre Can be used in a device driver.
-*/
-EXPORT_C TInt Epoc::FreeRamZone(TUint aZoneId)
-	{
-	CHECK_PRECONDITIONS(MASK_THREAD_CRITICAL,"Epoc::FreeRamZone");
-	RamAllocLock::Lock();
-	TInt r = TheMmu.FreeRamZone(aZoneId);
-	RamAllocLock::Unlock();
-	return r;
-	}
-
-
-/**
 Allocate a specific block of physically contiguous RAM, specified by physical
 base address and size.
 If and when the RAM is no longer required it should be freed using
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mm.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mm.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -785,30 +785,6 @@
 	}
 
 
-DMemoryMapping* MM::FindMappingInProcess(DMemModelProcess* aProcess, TLinAddr aAddr, TUint aSize, 
-										 TUint& aOffsetInMapping, TUint& aInstanceCount)
-	{
-	if(aAddr>=KGlobalMemoryBase)
-		{
-		// Address in global region, so look it up in kernel's address space...
-		return MM::FindMappingInAddressSpace(KKernelOsAsid, aAddr, aSize, aOffsetInMapping, aInstanceCount);
-		}
-
-	// Address in thread's process address space so open a reference to its os asid
-	// so that it remains valid for FindMappingInAddressSpace() call.
-	TInt osAsid = aProcess->TryOpenOsAsid();
-	if (osAsid < 0)
-		{// The process no longer owns an address space so can't have any mappings.
-		return NULL;
-		}
-
-	DMemoryMapping* r = MM::FindMappingInAddressSpace(osAsid, aAddr, aSize, aOffsetInMapping, aInstanceCount);
-
-	aProcess->CloseOsAsid();
-	return r;
-	}
-
-
 DMemoryMapping* MM::FindMappingInAddressSpace(	TUint aOsAsid, TLinAddr aAddr, TUint aSize, 
 												TUint& aOffsetInMapping, TUint& aInstanceCount)
 	{
@@ -1141,3 +1117,5 @@
 		attr&EMemoryAttributeUseECC
 		);
 	}
+
+
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mm.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mm.h	Wed Sep 01 12:34:56 2010 +0100
@@ -28,7 +28,6 @@
 class DMemoryObject;
 class DMemoryMapping;
 class DMemModelThread;
-class DMemModelProcess;
 class DPhysicalPinMapping;
 
 /**
@@ -161,7 +160,7 @@
 	/**
 	Memory object contents are to be demand paged. 
 	*/
-	EMemoryCreateDemandPaged			= 1U<<31
+	EMemoryCreateDemandPaged			= 1<<31
 	};
 
 
@@ -312,7 +311,7 @@
 	specified address.
 	@internalTechnology
 	*/
-	EMappingCreateFixedVirtual	= 1U<<31
+	EMappingCreateFixedVirtual	= 1<<31
 	};
 
 
@@ -884,26 +883,6 @@
 	Find and open the mapping that maps a virtual address in the address space of the specified
 	process.
 
-	The caller must close the mapping when it has finished using it.
-
-	@param aProcess The process whose address space is to be searched.
-	@param aAddr The virtual address for which the mapping is to be found.
-	@param aSize The size, in bytes, of the region at aAddr.
-	@param aOffsetInMapping A reference which is set to the offset, in bytes, into the
-							mapping of the start address.
-	@param aInstanceCount	The instance count of the found mapping.
-
-	@return The mapping, or NULL if no mapping was found.
-
-	@pre Calling thread must be in a critical section.
-	*/
-	static DMemoryMapping* FindMappingInProcess(DMemModelProcess* aProcess, TLinAddr aAddr, TUint aSize, 
-												TUint& aOffsetInMapping, TUint& aInstanceCount);
-
-	/**
-	Find and open the mapping that maps a virtual address in the address space of the specified
-	process.
-
 	The caller must close the mapping when it has finished using it.  The caller must ensure that
 	the process can't be destroyed while calling this method.
 
@@ -1068,18 +1047,6 @@
 	static TInt VirtualAlloc(TInt aOsAsid, TLinAddr& aLinAddr, TUint aSize, TBool aDemandPaged);
 	static void VirtualFree(TInt aOsAsid, TLinAddr aLinAddr, TUint aSize);
 
-#ifdef _DEBUG
-	/**
-	Force a region of paged memory to be paged out.
-
-	If the memory is not paged this call has no effect.
-
-	@return KErrNone, or KErrBadDescriptor if a single mapping containing the region could not be
-	        found.
-	*/
-	static TInt FlushRegion(DMemModelProcess*, TLinAddr aStartAddress, TUint aSize);
-#endif
-
 	/**
 	Enumeration of panic values for category "MemModel".
 	*/
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mmu.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mmu.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1096,18 +1096,6 @@
 	}
 
 
-TInt Mmu::FreeRamZone(TUint aZoneId)
-	{
-	TPhysAddr zoneBase;
-	TUint zonePages;
-	TInt r = iRamPageAllocator->GetZoneAddress(aZoneId, zoneBase, zonePages);
-	if (r != KErrNone)
-		return r;
-	FreePhysicalRam(zoneBase, zonePages);
-	return KErrNone;
-	}
-
-
 TInt Mmu::ClaimPhysicalRam(TPhysAddr aPhysAddr, TUint aCount, TRamAllocFlags aFlags)
 	{
 	__KTRACE_OPT(KMMU,Kern::Printf("Mmu::ClaimPhysicalRam(0x%08x,0x%x,0x%08x)",aPhysAddr,aCount,aFlags));
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mmu.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mmu.h	Wed Sep 01 12:34:56 2010 +0100
@@ -1992,7 +1992,6 @@
 	TInt ZoneAllocPhysicalRam(TUint* aZoneIdList, TUint aZoneIdCount, TInt aNumPages, TPhysAddr* aPageList);
 	TInt RamHalFunction(TInt aFunction, TAny* a1, TAny* a2);	
 	void ChangePageType(SPageInfo* aPageInfo, TZonePageType aOldPageType, TZonePageType aNewPageType);
-	TInt FreeRamZone(TUint aZoneId);
 
 	TInt AllocPhysicalRam(TPhysAddr* aPages, TUint aCount, TRamAllocFlags aFlags);
 	void FreePhysicalRam(TPhysAddr* aPages, TUint aCount);
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mpager.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mpager.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1393,10 +1393,6 @@
 	TInt r = Kern::AddHalEntry(EHalGroupVM, VMHalFunction, 0);
 	__NK_ASSERT_ALWAYS(r==KErrNone);
 	PageCleaningLock::Init();
-#ifdef __DEMAND_PAGING_BENCHMARKS__
-	for (TInt i = 0 ; i < EMaxPagingBm ; ++i)
-		ResetBenchmarkData((TPagingBenchmark)i);
-#endif
 	}
 
 
@@ -2044,8 +2040,9 @@
 	}
 
 
-DThread* DPager::ResponsibleThread(DThread* aThread, TAny* aExceptionInfo)
+TInt DPager::CheckRealtimeThreadFault(DThread* aThread, TAny* aExceptionInfo)
 	{
+	// realtime threads shouldn't take paging faults...
 	DThread* client = aThread->iIpcClient;
 
 	// If iIpcClient is set then we are accessing the address space of a remote thread.  If we are
@@ -2054,81 +2051,29 @@
 	TIpcExcTrap* ipcTrap = (TIpcExcTrap*)aThread->iExcTrap;
 	if (ipcTrap && !ipcTrap->IsTIpcExcTrap())
 		ipcTrap = 0;
-	if (client &&
-		(!ipcTrap || ipcTrap->ExcLocation(aThread, aExceptionInfo) == TIpcExcTrap::EExcRemote))
-		return client;
-	else
-		return NULL;
-	}
-
-
-TInt DPager::CheckRealtimeThreadFault(DThread* aThread, TAny* aExceptionInfo)
-	{
-	// realtime threads shouldn't take paging faults...
-	DThread* thread = ResponsibleThread(aThread, aExceptionInfo);
-
-	const char* message = thread ?
-		"Access to Paged Memory (by other thread)" : "Access to Paged Memory";
-
-	// kill respsonsible thread...
-	if(K::IllegalFunctionForRealtimeThread(thread, message))
+	if (client && (!ipcTrap || ipcTrap->ExcLocation(aThread, aExceptionInfo) == TIpcExcTrap::EExcRemote))
 		{
-		// if we are killing the current thread and we are in a critical section, then the above
-		// kill will be deferred and we will continue executing. We will handle this by returning an
-		// error which means that the thread will take an exception (which hopefully is XTRAPed!)
-
-		// treat memory access as bad...
-		return KErrAbort;
+		// kill client thread...
+		if(K::IllegalFunctionForRealtimeThread(client,"Access to Paged Memory (by other thread)"))
+			{
+			// treat memory access as bad...
+			return KErrAbort;
+			}
+		// else thread is in 'warning only' state so allow paging...
 		}
 	else
 		{
-		// thread is in 'warning only' state so allow paging...
-		return KErrNone;
+		// kill current thread...
+		if(K::IllegalFunctionForRealtimeThread(NULL,"Access to Paged Memory"))
+			{
+			// if current thread is in critical section, then the above kill will be deferred
+			// and we will continue executing. We will handle this by returning an error
+			// which means that the thread will take an exception (which hopefully is XTRAPed!)
+			return KErrAbort;
+			}
+		// else thread is in 'warning only' state so allow paging...
 		}
-	}
-
-
-void DPager::KillResponsibleThread(TPagingErrorContext aContext, TInt aErrorCode,
-								   TAny* aExceptionInfo)
-	{
-	const char* message = NULL;
-	switch (aContext)
-		{
-		case EPagingErrorContextRomRead:
-			message = "PAGED-ROM-READ";
-			break;
-		case EPagingErrorContextRomDecompress:
-			message = "PAGED-ROM-COMP";
-			break;
-		case EPagingErrorContextCodeRead:
-			message = "PAGED-CODE-READ";
-			break;
-		case EPagingErrorContextCodeDecompress:
-			message = "PAGED-CODE-COMP";
-			break;
-		case EPagingErrorContextDataRead:
-			message = "PAGED-DATA-READ";
-			break;
-		case EPagingErrorContextDataWrite:
-			message = "PAGED-DATA-WRITE";
-			break;
-		default:
-			message = "PAGED-UNKNOWN";
-			break;
-		}
-
-	TPtrC8 category((const unsigned char*)message);
-	DThread* thread = ResponsibleThread(TheCurrentThread, aExceptionInfo);
-	if (thread)
-		{
-		NKern::LockSystem();
-		thread->Die(EExitPanic, aErrorCode,  category);
-		}
-	else
-		{
-		TheCurrentThread->SetExitInfo(EExitPanic, aErrorCode, category);
-		NKern::DeferredExit();
-		}
+	return KErrNone;
 	}
 
 
@@ -2154,16 +2099,6 @@
 		r = manager->HandleFault(aMemory, aFaultIndex, aMapping, aMapInstanceCount, aAccessPermissions);
 
 		TheThrashMonitor.NotifyEndPaging();
-
-		// If the paging system encountered an error paging in the memory (as opposed to a thread
-		// accessing non-existent memory), then panic the appropriate thread.  Unfortunately this
-		// situation does occur as media such as eMMC wears out towards the end of its life. 
-		if (r != KErrNone)
-			{
-			TPagingErrorContext context = ExtractErrorContext(r);
-			if (context != EPagingErrorContextNone)
-				KillResponsibleThread(context, ExtractErrorCode(r), aExceptionInfo);
-			}
 		}
 	return r;
 	}
@@ -2390,100 +2325,6 @@
 	}
 
 
-TInt DPager::FlushRegion(DMemModelProcess* aProcess, TLinAddr aStartAddress, TUint aSize)
-	{
-	if (aSize == 0)
-		return KErrNone;
-
-	// find mapping
-	NKern::ThreadEnterCS();
-	TUint offsetInMapping;
-	TUint mapInstanceCount;
-	DMemoryMapping* mapping = MM::FindMappingInProcess(aProcess, aStartAddress, aSize,
-													   offsetInMapping, mapInstanceCount);
-	if (!mapping)
-		{
-		NKern::ThreadLeaveCS();
-		return KErrBadDescriptor;
-		}
-
-	// check whether memory is demand paged
-	MmuLock::Lock();
-	DMemoryObject* memory = mapping->Memory();
-	if(mapInstanceCount != mapping->MapInstanceCount() || memory == NULL || !memory->IsDemandPaged())
-		{
-		MmuLock::Unlock();
-		mapping->Close();
-		NKern::ThreadLeaveCS();
-		return KErrNone;
-		}
-
-	TRACE(("DPager::FlushRegion: %O %08x +%d", aProcess, aStartAddress, aSize));
-	if (!K::Initialising)
-		TRACE2(("  context %T %d", NCurrentThread(), NKern::CurrentContext()));
-
-	// why did we not get assertion failures before I added this?
-	__NK_ASSERT_DEBUG(!Kern::CurrentThread().IsRealtime());
-
-	// acquire necessary locks
-	MmuLock::Unlock();
-	RamAllocLock::Lock();
-	PageCleaningLock::Lock();
-	MmuLock::Lock();
-
-	// find region in memory object
-	TUint startPage = (offsetInMapping >> KPageShift) + mapping->iStartIndex;
-	TUint sizeInPages = ((aStartAddress & KPageMask) + aSize - 1) >> KPageShift;
-	TUint endPage = startPage + sizeInPages;
-	TRACE2(("DPager::FlushRegion: page range is %d to %d", startPage, endPage));
-	
-	// attempt to flush each page
-	TUint index = startPage;
-	while (mapping->MapInstanceCount() == mapInstanceCount &&
-		   mapping->Memory() && index <= endPage)
-		{
-		TRACE2(("DPager::FlushRegion: flushing page %d", index));
-		TPhysAddr physAddr = memory->iPages.PhysAddr(index);
-		
-		if (physAddr != KPhysAddrInvalid)
-			{
-			TRACE2(("DPager::FlushRegion: phys addr is %08x", physAddr));
-			SPageInfo* pi = SPageInfo::SafeFromPhysAddr(physAddr);
-			if (pi)
-				{
-				__NK_ASSERT_DEBUG(pi->Type() == SPageInfo::EManaged);
-				SPageInfo::TPagedState state = pi->PagedState();
-				if (state==SPageInfo::EPagedYoung || state==SPageInfo::EPagedOld ||
-					state==SPageInfo::EPagedOldestClean || state==SPageInfo::EPagedOldestDirty)
-					{
-					TRACE2(("DPager::FlushRegion: attempt to steal page"));
-					TInt r = StealPage(pi);
-					if(r==KErrNone)
-						{
-						TRACE2(("DPager::FlushRegion: attempt to page out %08x", physAddr));
-						AddAsFreePage(pi);
-						TRACE2(("DPager::FlushRegion: paged out %08x", physAddr));
-						}
-					else
-						TRACE2(("DPager::FlushRegion: page out %08x failed with %d", physAddr, r));
-					}
-				}
-			}
-		
-		MmuLock::Flash();
-		++index;
-		}
-	
-	MmuLock::Unlock();
-	PageCleaningLock::Unlock();
-	RamAllocLock::Unlock();
-	mapping->Close();
-	NKern::ThreadLeaveCS();
-	TRACE2(("DPager::FlushRegion: done"));
-	return KErrNone;
-	}
-
-
 void DPager::GetLiveListInfo(SVMCacheInfo& aInfo)
 	{
 	MmuLock::Lock(); // ensure consistent set of values are read...
@@ -2705,18 +2546,7 @@
 		if ((K::MemModelAttributes & EMemModelAttrDataPaging) == 0)
 			return KErrNotSupported;
 		return SetDataWriteSize((TUint)a1);
-
-#ifdef _DEBUG
-	case EVMHalDebugSetFail:
-		{
-		TUint context = (TUint)a1;
-		if (context >= EMaxPagingErrorContext)
-			return KErrArgument;
-		__e32_atomic_store_ord32(&(ThePager.iDebugFailContext), context);
-		return KErrNone;
-		}
-#endif
-
+	
 	default:
 		return KErrNotSupported;
 		}
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mpager.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mpager.h	Wed Sep 01 12:34:56 2010 +0100
@@ -152,20 +152,6 @@
 	void FlushAll();
 
 	/**
-	Flush demand paged pages in a specified region.
-
-	The memory must reside in a single memory object.
-	
-	@param aProcess The process containing the pages to flush.
-	@param aStart   The start address of the region.
-	@param aSize    The size of the region in bytes.
-
-	@return KErrBadDescriptor If the memory region is invalid or spans more than one memory object,
-	                          otherwise KErrNone.
-	*/
-	TInt FlushRegion(DMemModelProcess* aProcess, TLinAddr aStartAddress, TUint aSize);
-
-	/**
 	Give pages to paging system for managing.
 	*/
 	void DonatePages(TUint aCount, TPhysAddr* aPages);
@@ -418,23 +404,6 @@
 	*/
 	void SetCleanInSequence(TBool aCleanInSequence);
 
-	/**
-	Generate a new error code that includes both the original error code and some extra context
-	information.  This is used to communicate context information from where it occurs to where it
-	is handled.
-	*/
-	TInt EmbedErrorContext(TPagingErrorContext aContext, TInt aError);
-
-	/**
-	Extract the context information from a error code generated by #EmbedErrorContext.
-	*/
-	static TPagingErrorContext ExtractErrorContext(TInt aContextError);
-
-	/**
-	Extract the original error code from a error code generated by #EmbedErrorContext.
-	*/
-	static TInt ExtractErrorCode(TInt aContextError);
-
 private:
 	/**
 	Add a page to the head of the live page list. I.e. make it the 'youngest' page.
@@ -657,12 +626,6 @@
 	TBool ReservePage();
 
 	/**
-	Determine the thread responsible for this page fault.  This returns either NULL to indicate
-	the current thread, or a remote thread if the fault is caused by an IPC operation.
-	*/
-	DThread* ResponsibleThread(DThread* aThread, TAny* aExceptionInfo);
-
-	/**
 	Called when a realtime thread takes a paging fault.
 	Checks whether it's OK for the thread to take to fault.
 	@return KErrNone if the paging fault should be further processed
@@ -670,20 +633,6 @@
 	TInt CheckRealtimeThreadFault(DThread* aThread, TAny* aExceptionInfo);
 	
 	/**
-	Kills the thread responsible for causing a page fault.
-
-	This is called when a fatal error is encountered when handling a page fault, for example, if a
-	media access fails.
-
-	Originally the paging system reacted by faulting the system in such cases.  However the current
-	approach was thought to be preferable as this kind of error can happen in practice (even though
-	in theory it should not) and it means that the error code is reported and can be captured by
-	MobileCrash.
-	*/
-	void KillResponsibleThread(TPagingErrorContext aErrorCategory, TInt aErrorCode,
-							   TAny* aExceptionInfo);
-	
-	/**
 	Attempt to find the page table entry and page info for a page in the specified mapping.
 
 	@param aOsAsid				The OsAsid of the process that owns the mapping.
@@ -745,53 +694,11 @@
 	TSpinLock iBenchmarkLock;
 	SPagingBenchmarkInfo iBenchmarkInfo[EMaxPagingBm];
 #endif //__DEMAND_PAGING_BENCHMARKS__
-
-#ifdef _DEBUG
-	TPagingErrorContext iDebugFailContext;
-#endif
 	};
 
 extern DPager ThePager;
 
 
-// Functions to embed context information into error codes, using the following scheme:
-//
-// bits 0-16   taken from original error code
-// bits 16-31  bitwise NOT of a TPagingErrorContext value
-//
-// Since the context informtion is a small positive integer, the resulting error code is still a
-// negative integer.  The value EPagingErrorContextNone is zero, yeilding the original error code
-// unchanged if embedded.
-
-inline TInt DPager::EmbedErrorContext(TPagingErrorContext aContext, TInt aError)
-	{
-	__NK_ASSERT_DEBUG(aContext > 0 && aContext <= 0x7fff);
-#ifdef _DEBUG
-	if (aError >= KErrNone)
-		{
-		TUint32 match = aContext;
-		if (__e32_atomic_cas_ord32(&iDebugFailContext, &match, 0))
-			aError = KErrAbort;
-		}
-#endif
-	if (aError >= KErrNone)
-		return aError;
-	if (aError < (TInt)0xffff0000)
-		aError = KErrGeneral;  // lose error code, but doesn't happen in practice
-	return (aError & 0x0000ffff) | ((~aContext) << 16);
-	}
-
-inline TPagingErrorContext DPager::ExtractErrorContext(TInt aContextError)
-	{
-	return (TPagingErrorContext)((~aContextError) >> 16);
-	}
-
-inline TInt DPager::ExtractErrorCode(TInt aContextError)
-	{
-	return aContextError | 0x7fff000;
-	}
-
-
 #ifdef __DEMAND_PAGING_BENCHMARKS__
 
 #define START_PAGING_BENCHMARK TUint32 _bmStart = NKern::FastCounter()
@@ -1092,4 +999,5 @@
 	static void Init();	
 	};
 
+
 #endif
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mrom.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mrom.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -558,11 +558,6 @@
 								KPageSize >> readUnitShift, DPagingDevice::EDriveRomPaging);
 			__NK_ASSERT_DEBUG(r!=KErrNoMemory); // not allowed to allocated memory, therefore can't fail with KErrNoMemory
 			END_PAGING_BENCHMARK(EPagingBmReadMedia);
-			if (r != KErrNone)
-				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("DRomMemoryManager::ReadPage: error reading media at %08x + %x: %d", dataOffset, KPageSize, r));
-				}
-			r = ThePager.EmbedErrorContext(EPagingErrorContextRomRead, r);
 			}
 		else
 			{
@@ -589,9 +584,6 @@
 				r = iDevice->Read(&message, buffer, readStart, readSize, DPagingDevice::EDriveRomPaging);
 				__NK_ASSERT_DEBUG(r!=KErrNoMemory); // not allowed to allocated memory, therefore can't fail with KErrNoMemory
 				END_PAGING_BENCHMARK(EPagingBmReadMedia);
-				if(r!=KErrNone)
-					__KTRACE_OPT(KPANIC, Kern::Printf("DRomMemoryManager::ReadPage: error reading media at %08x + %x: %d", dataOffset, dataSize, r));
-				r = ThePager.EmbedErrorContext(EPagingErrorContextRomRead, r);
 				if(r==KErrNone)
 					{
 					// Decompress data, remembering that the data to decompress may be offset from 
@@ -600,13 +592,16 @@
 					const TLinAddr data = buffer + dataOffset - (readStart << readUnitShift);
 					__ASSERT_COMPILE(SRomPageInfo::ENoCompression==0); // decompress assumes this
 					r = Decompress(romPageInfo->iCompressionType, linAddr, KPageSize, data, dataSize);
-					if (r >= 0)
-						r = (r == KPageSize) ? KErrNone : KErrCorrupt;
-					if (r != KErrNone)
-						__KTRACE_OPT(KPANIC, Kern::Printf("DRomMemoryManager::ReadPage: error decompressing page at %08x + %x: %d", dataOffset, dataSize, r));
-					__NK_ASSERT_DEBUG(r == KErrNone);
-					r = ThePager.EmbedErrorContext(EPagingErrorContextRomDecompress, r);
+					if(r >= 0)
+						{
+						if (r != KPageSize)
+							__KTRACE_OPT(KPANIC, Kern::Printf("DRomMemoryManager::ReadPage: error decompressing page at %08x + %x: %d", dataOffset, dataSize, r));
+						__NK_ASSERT_ALWAYS(r == KPageSize);
+						r = KErrNone;
+						}
 					}
+				else
+					__KTRACE_OPT(KPANIC, Kern::Printf("DRomMemoryManager::ReadPage: error reading media at %08x + %x: %d", dataOffset, dataSize, r));
 				}
 			}
 		END_PAGING_BENCHMARK(EPagingBmReadRomPage);
@@ -616,7 +611,7 @@
 		}
 
 	aRequest->UnmapPages(true);
-	
+
 	return r;
 	}
 
--- a/kernel/eka/memmodel/epoc/flexible/mmu/x86/xmmu.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/x86/xmmu.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -546,15 +546,6 @@
 	if(TUint(aAddr^KIPCAlias)<TUint(KIPCAliasAreaSize))
 		return KErrBadDescriptor; // prevent access to alias region
 
-#ifdef _DEBUG
-	if (KDebugNum(KFORCEKUPAGEFAULTS))
-		{
-		TInt r = ThePager.FlushRegion(aProcess, aAddr, aSize);
-		if (r != KErrNone)
-			return r;
-		}
-#endif
-	
 	// Grab the mmu lock before opening a reference on os asid so that this thread 
 	// is in an implicit critical section and therefore can't leak the reference by
 	// dying before iAliasLinAddr is set.
--- a/kernel/eka/memmodel/epoc/mmubase/mmubase.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/mmubase/mmubase.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -651,17 +651,6 @@
 	}
 
 
-TInt MmuBase::FreeRamZone(TUint aZoneId, TPhysAddr& aZoneBase, TUint& aZoneBytes)
-	{
-	TUint zonePages;
-	TInt r = iRamPageAllocator->GetZoneAddress(aZoneId, aZoneBase, zonePages);
-	if (r != KErrNone)
-		return r;
-	aZoneBytes = zonePages << KPageShift;
-	return MmuBase::FreePhysicalRam(aZoneBase, aZoneBytes);
-	}
-
-
 TInt MmuBase::ClaimPhysicalRam(TPhysAddr aPhysAddr, TInt aSize)
 	{
 	__KTRACE_OPT(KMMU,Kern::Printf("Mmu::ClaimPhysicalRam(%08x,%x)",aPhysAddr,aSize));
@@ -2060,45 +2049,6 @@
 
 
 /**
-Free a RAM zone which was previously allocated by one of these methods:
-Epoc::AllocPhysicalRam(), Epoc::ZoneAllocPhysicalRam() or 
-TRamDefragRequest::ClaimRamZone().
-
-All of the pages in the RAM zone must be allocated and only via one of the methods 
-listed above, otherwise a system panic will occur.
-
-@param	aZoneId			The ID of the RAM zone to free.
-@return	KErrNone 		If the operation was successful.
-		KErrArgument 	If a RAM zone with ID aZoneId was not found.
-
-@pre Calling thread must be in a critical section.
-@pre Interrupts must be enabled.
-@pre Kernel must be unlocked.
-@pre No fast mutex can be held.
-@pre Call in a thread context.
-@pre Can be used in a device driver.
-*/
-EXPORT_C TInt Epoc::FreeRamZone(TUint aZoneId)
-	{
-	CHECK_PRECONDITIONS(MASK_THREAD_CRITICAL,"Epoc::FreeRamZone");
-	MmuBase& m = *MmuBase::TheMmu;
-	MmuBase::Wait();
-	TPhysAddr zoneBase;
-	TUint zoneBytes;
-	TInt r = m.FreeRamZone(aZoneId, zoneBase, zoneBytes);
-#ifdef BTRACE_KERNEL_MEMORY
-	if (r == KErrNone)
-		{
-		BTrace8(BTrace::EKernelMemory, BTrace::EKernelMemoryDrvPhysFree, zoneBytes, zoneBase);
-		Epoc::DriverAllocdPhysRam -= zoneBytes;
-		}
-#endif
-	MmuBase::Signal();
-	return r;
-	}
-
-
-/**
 Translate a virtual address to the corresponding physical address.
 
 @param	aLinAddr	The virtual address to be translated.
--- a/kernel/eka/memmodel/epoc/moving/arm/xmmu.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/moving/arm/xmmu.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1275,16 +1275,23 @@
 	}
 
 const TUint FBLK=(EMapAttrFullyBlocking>>12);
+const TUint BFNC=(EMapAttrBufferedNC>>12);
 const TUint BUFC=(EMapAttrBufferedC>>12);
+const TUint L1UN=(EMapAttrL1Uncached>>12);
 const TUint WTRA=(EMapAttrCachedWTRA>>12);
+const TUint WTWA=(EMapAttrCachedWTWA>>12);
 const TUint WBRA=(EMapAttrCachedWBRA>>12);
+const TUint WBWA=(EMapAttrCachedWBWA>>12);
+const TUint AWTR=(EMapAttrAltCacheWTRA>>12);
+const TUint AWTW=(EMapAttrAltCacheWTWA>>12);
+const TUint AWBR=(EMapAttrAltCacheWBRA>>12);
+const TUint AWBW=(EMapAttrAltCacheWBWA>>12);
+const TUint MAXC=(EMapAttrL1CachedMax>>12);
 
-#if defined(__CPU_XSCALE__) || defined(__CPU_SA1__)
-const TUint AWBR=(EMapAttrAltCacheWBRA>>12);
-#endif
+const TUint L2UN=(EMapAttrL2Uncached>>12);
 
 const TUint16 UNS=0xffffu;	// Unsupported attribute
-
+const TUint16 SPE=0xfffeu;	// Special processing required
 
 #if defined(__CPU_ARM710T__) || defined(__CPU_ARM720T__)
 // Original definition of C B
@@ -1308,17 +1315,9 @@
 	{FBLK,FBLK,BUFC,BUFC,BUFC,BUFC,WBRA,WBRA,FBLK,FBLK,AWBR,AWBR,FBLK,FBLK,FBLK,WBRA};
 
 #elif defined(__CPU_XSCALE__)
-const TUint WBWA=(EMapAttrCachedWBWA>>12);
-const TUint16 SPE=0xfffeu;	// Special processing required
-
 #ifdef __CPU_XSCALE_MANZANO__
-const TUint L1UN=(EMapAttrL1Uncached>>12);
-const TUint BFNC=(EMapAttrBufferedNC>>12);
-
 #ifdef __HAS_EXTERNAL_CACHE__
 // ***MANZANO with L2 cache****** //
-const TUint L2UN=(EMapAttrL2Uncached>>12);
-const TUint MAXC=(EMapAttrL1CachedMax>>12);
 
 //Specifies TEX::CB bits for different L1/L2 cache attributes
 //  ...876543201
--- a/kernel/eka/memmodel/epoc/moving/mprocess.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/moving/mprocess.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -899,7 +899,7 @@
 		goto retry;
 #endif
 	
-	return (r < 0) ? r : K::ParseDesHeader(aSrc, header, aDest);
+	return K::ParseDesHeader(aSrc, header, aDest);
 	}
 
 DMemModelChunk* ChunkFromAddress(DThread* aThread, const TAny* aAddress)
--- a/kernel/eka/memmodel/epoc/multiple/arm/xmmu.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/multiple/arm/xmmu.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -715,8 +715,7 @@
 			// we have an L1 data cache...
 			TUint32 csir = InternalCache::SizeIdRegister(0,0);
 			TUint sets = ((csir>>13)&0x7fff)+1;
-			TUint ways = ((csir>>3)&0x3ff);
-			ways+=1;
+			TUint ways = ((csir>>3)&0x3ff)+1;
 			TUint lineSizeShift = (csir&7)+4;
 			// assume L1 data cache is VIPT and alias checks broken and so we need data cache colouring...
 			dColourCount = (sets<<lineSizeShift)>>KPageShift;
@@ -730,8 +729,7 @@
 			// we have a separate L1 instruction cache...
 			TUint32 csir = InternalCache::SizeIdRegister(1,0);
 			TUint sets = ((csir>>13)&0x7fff)+1;
-			TUint ways = ((csir>>3)&0x3ff);
-			ways+=1;
+			TUint ways = ((csir>>3)&0x3ff)+1;
 			TUint lineSizeShift = (csir&7)+4;
 			iColourCount = (sets<<lineSizeShift)>>KPageShift;
 			__KTRACE_OPT2(KBOOT,KMMU,Kern::Printf("L1ICache = 0x%x,0x%x,%d colourCount=%d",sets,ways,lineSizeShift,(sets<<lineSizeShift)>>KPageShift));
--- a/kernel/eka/memmodel/epoc/multiple/mcodeseg.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/multiple/mcodeseg.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -173,21 +173,15 @@
 
 		// copy export directory (this will now have fixups applied)...
 		TInt exportDirSize = iRamInfo.iExportDirCount * sizeof(TLinAddr);
-		if (exportDirSize > 0 || (exportDirSize == 0 && (iCodeSeg->iAttr & ECodeSegAttNmdExpData)) )
+		if (exportDirSize > 0 || (exportDirSize==0 && (iCodeSeg->iAttr&ECodeSegAttNmdExpData)) )
 			{
 			exportDirSize += sizeof(TLinAddr);
-			TLinAddr expDirRunAddr = iRamInfo.iExportDir - sizeof(TLinAddr);
-			if (expDirRunAddr < iRamInfo.iCodeRunAddr ||
-				expDirRunAddr + exportDirSize > iRamInfo.iCodeRunAddr + iRamInfo.iCodeSize)
-				{// Invalid export section.
-				return KErrCorrupt;
-				}
 			TLinAddr* expDir = (TLinAddr*)Kern::Alloc(exportDirSize);
 			if (!expDir)
 				return KErrNoMemory;
 			iCopyOfExportDir = expDir;
 			UNLOCK_USER_MEMORY();
-			memcpy(expDir, (TAny*)expDirRunAddr, exportDirSize);
+			memcpy(expDir,(TAny*)(iRamInfo.iExportDir-sizeof(TLinAddr)),exportDirSize);
 			LOCK_USER_MEMORY();
 			}
 		}
--- a/kernel/eka/memmodel/memmodel.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/memmodel.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -109,8 +109,8 @@
 #ifdef MARM
 userinclude		../memmodel/epoc/flexible/mmu/arm
 sourcepath		../memmodel/epoc/flexible/arm
-source			xinit.cpp xipc.cpp xipc.cia 
-source			xkernel.cpp xkernel.cia xsched.cpp xsched.cia
+source			xinit.cpp xipc.cia xkernel.cpp xkernel.cia
+source			xsched.cpp xsched.cia
 sourcepath		../memmodel/epoc/flexible/mmu/arm
 source			xmmu.cpp xmmu.cia
 #endif //MARM
--- a/kernel/eka/nkern/arm/ncmonitor.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkern/arm/ncmonitor.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -22,9 +22,31 @@
 #include "nk_priv.h"
 #include <arm.h>
 
-void DisplayNThreadPlatformSpecific(Monitor& m, NThread* pT)
+EXPORT_C void Monitor::DisplayNThreadInfo(NThread* pT)
 	{
-	m.Printf("iUserContextType=%02x ExtraContext=%08x ExtraContextSize=%04x\r\n",pT->iSpare3,pT->iExtraContext,pT->iExtraContextSize);
+	TBuf8<80> buf=_L8("NThread @ ");
+	buf.AppendNumFixedWidth((TUint)pT,EHex,8);
+	buf+=_L8(" Pri ");
+	buf.AppendNum((TUint)pT->iPriority);
+	buf+=_L8(" NState ");
+	switch (pT->iSpare1)
+		{
+		case NThread::EReady: buf+=_L8("READY"); break;
+		case NThread::ESuspended: buf+=_L8("SUSPENDED"); break;
+		case NThread::EWaitFastSemaphore: buf+=_L8("WAITFSEM "); buf.AppendNumFixedWidth((TUint)pT->iWaitObj,EHex,8); break;
+		case NThread::ESleep: buf+=_L8("SLEEP"); break;
+		case NThread::EBlocked: buf+=_L8("BLOCKED"); break;
+		case NThread::EDead: buf+=_L8("DEAD"); break;
+		case NThread::EWaitDfc: buf+=_L8("WAITDFC"); break;
+		default: buf+=_L8("??"); buf.AppendNumFixedWidth((TUint)pT->iSpare1,EHex,8); break;
+		}
+	PrintLine(buf);
+	Printf("Next=%08x Prev=%08x Att=%02x iUserContextType=%02x\r\n",pT->iNext,pT->iPrev,pT->iSpare2,pT->iSpare3);
+	Printf("HeldFM=%08x WaitFM=%08x AddrSp=%08x\r\n",pT->iHeldFastMutex,pT->iWaitFastMutex,pT->iAddressSpace);
+	Printf("Time=%d Timeslice=%d ReqCount=%d\r\n",pT->iTime,pT->iTimeslice,pT->iRequestSemaphore.iCount);
+	Printf("SuspendCount=%d CsCount=%d CsFunction=%08x\r\n",pT->iSuspendCount,pT->iCsCount,pT->iCsFunction);
+	Printf("SavedSP=%08x ExtraContext=%08x ExtraContextSize=%04x\r\n",pT->iSavedSP,pT->iExtraContext,pT->iExtraContextSize);
+	Printf("iUserModeCallbacks=%08x iSpare7=%08x iSpare8=%08x\r\n", pT->iUserModeCallbacks, pT->iSpare7, pT->iSpare8);
 	if (pT != TScheduler::Ptr()->iCurrentThread)
 		{
 		TUint32* pS=(TUint32*)pT->iSavedSP;
@@ -34,26 +56,51 @@
 			{
 			TUint32* pR=reg;
 #ifdef __CPU_SUPPORT_THUMB2EE
-			m.Printf("TEEHBR %08x ",*pR++);
+			Printf("TEEHBR %08x ",*pR++);
 #endif
 #ifdef __CPU_HAS_CP15_THREAD_ID_REG
-			m.Printf("RWRWTID %08x ",*pR++);
+			Printf("RWRWTID %08x ",*pR++);
 #endif
 #ifdef __CPU_HAS_VFP
-			m.Printf("FPEXC %08x ",*pR++);
+			Printf("FPEXC %08x ",*pR++);
 #endif
 #ifdef __CPU_HAS_COPROCESSOR_ACCESS_REG
-			m.Printf("CAR %08x ",*pR++);
+			Printf("CAR %08x ",*pR++);
 #endif
 #ifdef __CPU_ARM_USE_DOMAINS
-			m.Printf("DACR %08x\r\n",*pR++);
+			Printf("DACR %08x\r\n",*pR++);
 #endif
-			m.Printf("R13_USR %08x R14_USR %08x SPSR_SVC %08x\r\n",pR[0],pR[1],pR[2]);
-			m.Printf(" R4 %08x  R5 %08x  R6 %08x  R7 %08x\r\n",pR[3],pR[4],pR[5],pR[6]);
-			m.Printf(" R8 %08x  R9 %08x R10 %08x R11 %08x\r\n",pR[7],pR[8],pR[9],pR[10]);
-			m.Printf(" PC %08x\r\n",pR[11]);
+			Printf("R13_USR %08x R14_USR %08x SPSR_SVC %08x\r\n",pR[0],pR[1],pR[2]);
+			Printf(" R4 %08x  R5 %08x  R6 %08x  R7 %08x\r\n",pR[3],pR[4],pR[5],pR[6]);
+			Printf(" R8 %08x  R9 %08x R10 %08x R11 %08x\r\n",pR[7],pR[8],pR[9],pR[10]);
+			Printf(" PC %08x\r\n",pR[11]);
 			}
 		}
+	NewLine();
+	}
+
+void Monitor::DisplayNFastSemInfo(NFastSemaphore* pS)
+	{
+	Printf("NFastSemaphore @ %08x Count %d OwningThread %08x\r\n",pS,pS->iCount,pS->iOwningThread);
+	}
+
+void Monitor::DisplayNFastMutexInfo(NFastMutex* pM)
+	{
+	Printf("NFastMutex @ %08x HoldingThread %08x iWaiting %08x\r\n",pM,pM->iHoldingThread,pM->iWaiting);
+	}
+
+void Monitor::DisplaySchedulerInfo()
+	{
+	TScheduler* pS=TScheduler::Ptr();
+	Printf("SCHEDULER @%08x: CurrentThread %08x\r\n",pS,pS->iCurrentThread);
+	Printf("RescheduleNeeded=%02x DfcPending=%02x KernCSLocked=%08x\r\n",pS->iRescheduleNeededFlag,pS->iDfcPendingFlag,pS->iKernCSLocked);
+	Printf("DFCS: next %08x prev %08x\r\n",pS->iDfcs.iA.iNext,pS->iDfcs.iA.iPrev);
+	Printf("ProcessHandler=%08x, AddressSpace=%08x\r\n",pS->iProcessHandler,pS->iAddressSpace);
+	Printf("SYSLOCK: HoldingThread %08x iWaiting %08x\r\n",pS->iLock.iHoldingThread,pS->iLock.iWaiting);
+	Printf("Extras 0: %08x 1: %08x 2: %08x 3: %08x\r\n",pS->iExtras[0],pS->iExtras[1],pS->iExtras[2],pS->iExtras[3]);
+	Printf("Extras 4: %08x 5: %08x 6: %08x 7: %08x\r\n",pS->iExtras[4],pS->iExtras[5],pS->iExtras[6],pS->iExtras[7]);
+	Printf("Extras 8: %08x 9: %08x A: %08x B: %08x\r\n",pS->iExtras[8],pS->iExtras[9],pS->iExtras[10],pS->iExtras[11]);
+	Printf("Extras C: %08x D: %08x E: %08x F: %08x\r\n",pS->iExtras[12],pS->iExtras[13],pS->iExtras[14],pS->iExtras[15]);
 	}
 
 void DumpRegisters(Monitor& m, SFullArmRegSet& a)
--- a/kernel/eka/nkern/arm/ncsched.cia	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkern/arm/ncsched.cia	Wed Sep 01 12:34:56 2010 +0100
@@ -448,11 +448,6 @@
 //
 	{
 	asm("unready: ");
-	
-	asm("ldr r2, [r0, #%a0]" : : "i" _FOFF(TScheduler,iMadeUnReadyCounter)); 	// Update Made UnReady count here, 
-	asm("add r2, r2, #1"); 								// ie equiv of 'iMadeUnReadyCounter++;'.
-	asm("str r2, [r0, #%a0]" : : "i" _FOFF(TScheduler,iMadeUnReadyCounter));
-
 #ifdef _DEBUG
 	asm("ldr r2, [r1, #%a0]" : : "i" _FOFF(NThread,iHeldFastMutex));
 	asm("mov r12, #0xd8000003 ");
@@ -614,12 +609,7 @@
 	{
 	asm("ldr r1, __TheScheduler ");
 	asm("ldrb r2, [r0, #%a0]" : : "i" _FOFF(NThread,iPriority));	// r2=priority of aThread
-
 	asm("DoReadyInner: ");
-	asm("ldr r3, [r1, #%a0]" : : "i" _FOFF(TScheduler,iMadeReadyCounter)); 	// Update Made Ready count here, 
-	asm("add r3, r3, #1"); 							// ie equiv of 'iMadeReadyCounter++;'.
-	asm("str r3, [r1, #%a0]" : : "i" _FOFF(TScheduler,iMadeReadyCounter));
-
 	asm("mov r3, #%a0" : : "i" (NThread::EReady));
 	asm("strb r3, [r0, #%a0]" : : "i" _FOFF(NThread,iNState));
 	asm("ldmia r1!, {r3,r12} ");			// r3=present mask low, r12=present mask high, r1=&iQueue[0]
@@ -1659,11 +1649,6 @@
 
 	asm("round_robin: ");					// get here if thread's timeslice has expired and there is another
 											// thread ready at the same priority
-	
-	asm("ldr r6, [r0, #%a0]" : : "i" _FOFF(TScheduler,iTimeSliceExpireCounter)); 	// Update Time Slice Expire count here, 
-	asm("add r6,r6, #1"); 								// ie equiv of 'iTimeSliceExpireCounter++;'.
-	asm("str r6, [r0, #%a0]" : : "i" _FOFF(TScheduler,iTimeSliceExpireCounter));
-
 	asm("cmp r7, #0 ");						// does this thread hold a fast mutex?
 	asm("bne rr_holds_fast_mutex ");
 	asm("ldr lr, [r2, #%a0]" : : "i" _FOFF(NThread,iTimeslice));
--- a/kernel/eka/nkern/arm/ncutils.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkern/arm/ncutils.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -84,21 +84,6 @@
 	ArmInterruptInfo.iFiqHandler=aHandler;
 	}
 
-/** Register the global Idle handler
-	Called by the base port at boot time to register a handler containing a pointer to
-	a function that is called by the Kernel when each core reaches idle.
-	Should not be called at any other time.
-
-	@param	aHandler Pointer to idle handler function
-	@param	aPtr Idle handler function argument
-*/
-EXPORT_C void Arm::SetIdleHandler(TCpuIdleHandlerFn aHandler, TAny* aPtr)
-	{
-	ArmInterruptInfo.iCpuIdleHandler.iHandler = aHandler;
-	ArmInterruptInfo.iCpuIdleHandler.iPtr = aPtr;
-	ArmInterruptInfo.iCpuIdleHandler.iPostambleRequired = EFalse;
-	}
-
 extern void initialiseState();
 void Arm::Init1Interrupts()
 //
--- a/kernel/eka/nkern/arm/nklib.cia	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +0,0 @@
-// Copyright (c) 2010-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:
-// e32\nkern\arm\nklib.cia
-// 
-//
-
-#include <e32atomics.h>
-#include <nklib.h>
-
-#ifdef __SRATIO_MACHINE_CODED__
-__NAKED__ void SRatio::Set(TUint32 /*aInt*/, TInt /*aDivisorExp*/)
-	{
-#ifdef __CPU_ARM_HAS_CLZ
-	CLZ(		3,1);						// r3=31-MSB(r1), 32 if r1=0
-	asm("add	r2, r2, r3 ");				// r2=shift+aDivisorExp
-	asm("movs	r1, r1, lsl r3 ");			// shift r1 left so bit 31=1
-	asm("rsb	r2, r2, #0 ");				// r2 = -shift-aDivisorExp
-	asm("moveq	r2, #0 ");					// if aInt=0, r2=0
-	asm("bicne	r2, r2, #0xff000000 ");		// else clear iSpare fields
-	asm("bicne	r2, r2, #0x00ff0000 ");		//
-#else
-	asm("rsb	r2, r2, #0 ");				// r2 = -aDivisorExp
-	asm("cmp	r1, #0x00010000 ");			// if aInt top 16 bits clear ...
-	asm("movcc	r1, r1, lsl #16 ");			// ... shift 16 bits left ...
-	asm("subcc	r2, r2, #16 ");				// ... and subtract 16 from iX
-	asm("cmp	r1, #0x01000000 ");
-	asm("movcc	r1, r1, lsl #8 ");
-	asm("subcc	r2, r2, #8 ");
-	asm("cmp	r1, #0x10000000 ");
-	asm("movcc	r1, r1, lsl #4 ");
-	asm("subcc	r2, r2, #4 ");
-	asm("cmp	r1, #0x40000000 ");
-	asm("movcc	r1, r1, lsl #2 ");
-	asm("subcc	r2, r2, #2 ");
-	asm("cmp	r1, #0x80000000 ");
-	asm("subcc	r2, r2, #1 ");
-	asm("cmp	r1, #0 ");
-	asm("moveq	r2, #0 ");					// if aInt=0, r2=0
-	asm("bicne	r2, r2, #0xff000000 ");		// else clear iSpare fields
-	asm("bicne	r2, r2, #0x00ff0000 ");		//
-#endif
-	asm("stmia	r0, {r1,r2} ");				// iM in r1, iX in bottom 16 bits of r2
-	__JUMP(,	lr);
-	}
-
-__NAKED__ TInt SRatio::Reciprocal()
-	{
-	asm("ldr	r1, [r0] ");				// r1 = iM
-	asm("ldrsh	r12, [r0, #4] ");			// r12 = iX
-	asm("rsbs	r2, r1, #0 ");
-	asm("beq	0f ");						// divide by zero
-	asm("add	r12, r12, #63 ");
-	asm("rsb	r12, r12, #0 ");			// r12 = -63 - iX
-	asm("addvs	r12, r12, #1 ");			// if iM==0x80000000 r12 = -62 - iX (ratio = 2^(31+iX) so reciprocal = 2^(-31-iX) = 2^(31 + (-62-iX))
-	asm("bvs	1f ");						// iM=0x80000000
-
-	// 2^(32+iX) > r > 2^(31+iX)
-	// 2^(-32-iX) < 1/r < 2^(-31-iX)
-	// 2^(31+(-63-iX)) < 1/r < 2^(31+(-62-iX))
-	asm("mov	r2, #0 ");					// accumulates result
-	asm("mov	r3, #0x80000000 ");			// 33 bit accumulator in C:R3 initialised to 2^32
-	asm("2:		");
-	asm("adds	r3, r3, r3 ");
-	asm("cmpcc	r3, r1 ");
-	asm("subcs	r3, r3, r1 ");				// if C=1 or r3>=r1, r3-=r1
-	asm("adcs	r2, r2, r2 ");				// next result bit
-	asm("bcc	2b ");						// finished when we have 33 bits (when top bit shifted off)
-	asm("movs	r2, r2, lsr #1 ");			// rounding bit into C
-	asm("orr	r2, r2, #0x80000000 ");		// top bit back
-	asm("adcs	r2, r2, #0 ");				// add rounding bit
-	asm("movcs	r2, #0x80000000 ");			// if carry, increment exponent
-	asm("addcs	r12, r12, #1 ");
-
-	asm("1:		");
-	asm("cmp	r12, #-32768 ");
-	asm("blt	9f ");						// underflow
-	asm("cmp	r12, #32768 ");
-	asm("bge	8f ");						// overflow
-	asm("str	r2, [r0] ");				// iM
-	asm("strh	r12, [r0, #4] ");			// iX
-	asm("mov	r0, #0 ");
-	__JUMP(,	lr);
-
-	asm("0:		");
-	asm("mov	r0, #%a0" : : "i" ((TInt)KErrDivideByZero));
-	__JUMP(,	lr);
-
-	asm("8:		");
-	asm("mov	r0, #%a0" : : "i" ((TInt)KErrOverflow));
-	__JUMP(,	lr);
-
-	asm("9:		");
-	asm("mov	r0, #%a0" : : "i" ((TInt)KErrUnderflow));
-	__JUMP(,	lr);
-	}
-
-__NAKED__ TInt SRatio::Mult(TUint32& /*aInt32*/)
-	{
-	asm("ldr	r3, [r0] ");				// r3 = iM
-	asm("mov	r12, r0 ");
-	asm("ldr	r0, [r1] ");				// r0 = aInt32
-	asm("cmp	r3, #0 ");
-	asm("cmpne	r0, #0 ");
-	asm("beq	0f ");						// result zero
-	asm("umull	r2, r3, r0, r3 ");			// r3:r2 = aInt32 * iM (lowest value 0x0000000080000000)
-	asm("ldrsh	r12, [r12, #4] ");			// r12 = iX
-#ifdef __CPU_ARM_HAS_CLZ
-	CLZ(		0, 3);						// r0 = number of leading zeros in r3:r2 (can't be >32)
-#else
-	asm("str	r12, [sp, #-4]! ");
-	asm("movs	r12, r3 ");
-	asm("mov	r0, #0 ");
-	asm("cmp	r12, #0x00010000 ");
-	asm("movcc	r12, r12, lsl #16 ");
-	asm("addcc	r0, r0, #16 ");
-	asm("cmp	r12, #0x01000000 ");
-	asm("movcc	r12, r12, lsl #8 ");
-	asm("addcc	r0, r0, #8 ");
-	asm("cmp	r12, #0x10000000 ");
-	asm("movcc	r12, r12, lsl #4 ");
-	asm("addcc	r0, r0, #4 ");
-	asm("cmp	r12, #0x40000000 ");
-	asm("movcc	r12, r12, lsl #2 ");
-	asm("addcc	r0, r0, #2 ");
-	asm("cmp	r12, #0 ");
-	asm("ldr	r12, [sp], #4 ");			// r12 = iX
-	asm("addgt	r0, r0, #1 ");
-	asm("moveq	r0, #32 ");					// r0 = number of leading zeros in r3:r2 (can't be >32)
-#endif
-	asm("rsb	r0, r0, #63 ");				// bit number of most significant bit
-	asm("add	r0, r0, r12 ");				// bit number of most significant bit after exponent shift
-	asm("cmp	r0, #32 ");
-	asm("bge	8f ");						// overflow
-	asm("cmp	r0, #-1 ");
-	asm("blt	9f ");						// underflow
-	asm("adds	r12, r12, #32 ");			// shift needed to get result into top 32 bits (>0 left, <0 right)
-	asm("beq	1f ");						// no shift
-	asm("blt	2f ");						// right shift
-	asm("rsb	r0, r12, #32 ");
-	asm("mov	r3, r3, lsl r12 ");
-	asm("orr	r3, r3, r2, lsr r0 ");
-	asm("mov	r2, r2, lsl r12 ");			// r3:r2 <<= r12
-	asm("b		1f ");
-	asm("2:		");
-	asm("rsb	r12, r12, #0 ");
-	asm("rsb	r0, r12, #32 ");
-	asm("mov	r2, r2, lsr r12 ");
-	asm("orr	r2, r2, r3, lsl r0 ");
-	asm("mov	r3, r3, lsr r12 ");			// r3:r2 >>= r12
-	asm("1:		");
-	asm("adds	r2, r2, r2 ");				// rounding
-	asm("adcs	r3, r3, #0 ");
-	asm("bcs	8f ");						// overflow
-	asm("beq	9f ");						// underflow
-	asm("mov	r0, #0 ");
-	asm("str	r3, [r1] ");
-	__JUMP(,	lr);
-
-	asm("0:		");
-	asm("mov	r0, #0 ");
-	asm("str	r0, [r1] ");
-	__JUMP(,	lr);
-
-	asm("8:		");
-	asm("mvn	r0, #0 ");
-	asm("str	r0, [r1] ");
-	asm("mov	r0, #%a0" : : "i" ((TInt)KErrOverflow));
-	__JUMP(,	lr);
-
-	asm("9:		");
-	asm("mov	r0, #0 ");
-	asm("str	r0, [r1] ");
-	asm("mov	r0, #%a0" : : "i" ((TInt)KErrUnderflow));
-	__JUMP(,	lr);
-	}
-
-//TInt SRatio::Mult(TUint64& aInt64)
-//	{
-//	}
-
-#endif
-
-
--- a/kernel/eka/nkern/nk_mon.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-// Copyright (c) 2009-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:
-// e32\nkern\nk_mon.cpp
-// Kernel crash debugger - NKERN platform-independent portion
-// 
-//
-
-#include <kernel/monitor.h>
-#include "nk_priv.h"
-
-extern void DisplayNThreadPlatformSpecific(Monitor& m, NThread* pT);
-
-
-EXPORT_C void Monitor::DisplayNThreadInfo(NThread* pT)
-	{
-	TBuf8<80> buf=_L8("NThread @ ");
-	buf.AppendNumFixedWidth((TUint)pT,EHex,8);
-	buf+=_L8(" Pri ");
-	buf.AppendNum((TUint)pT->iPriority);
-	buf+=_L8(" NState ");
-	switch (pT->iSpare1)
-		{
-		case NThread::EReady: buf+=_L8("READY"); break;
-		case NThread::ESuspended: buf+=_L8("SUSPENDED"); break;
-		case NThread::EWaitFastSemaphore: buf+=_L8("WAITFSEM "); buf.AppendNumFixedWidth((TUint)pT->iWaitObj,EHex,8); break;
-		case NThread::ESleep: buf+=_L8("SLEEP"); break;
-		case NThread::EBlocked: buf+=_L8("BLOCKED"); break;
-		case NThread::EDead: buf+=_L8("DEAD"); break;
-		case NThread::EWaitDfc: buf+=_L8("WAITDFC"); break;
-		default: buf+=_L8("??"); buf.AppendNumFixedWidth((TUint)pT->iSpare1,EHex,8); break;
-		}
-	PrintLine(buf);
-	Printf("SavedSP=%08x Next=%08x Prev=%08x Att=%02x\r\n",pT->iSavedSP,pT->iNext,pT->iPrev,pT->iSpare2);
-	Printf("HeldFM=%08x WaitFM=%08x AddrSp=%08x\r\n",pT->iHeldFastMutex,pT->iWaitFastMutex,pT->iAddressSpace);
-	Printf("Time=%d Timeslice=%d ReqCount=%d\r\n",pT->iTime,pT->iTimeslice,pT->iRequestSemaphore.iCount);
-	Printf("SuspendCount=%d CsCount=%d CsFunction=%08x\r\n",pT->iSuspendCount,pT->iCsCount,pT->iCsFunction);
-	Printf("iUserModeCallbacks=%08x iSpare7=%08x iSpare8=%08x\r\n", pT->iUserModeCallbacks, pT->iSpare7, pT->iSpare8);
-	DisplayNThreadPlatformSpecific(*this, pT);
-	NewLine();
-	}
-
-void Monitor::DisplayNFastSemInfo(NFastSemaphore* pS)
-	{
-	Printf("NFastSemaphore @ %08x Count %d OwningThread %08x\r\n",pS,pS->iCount,pS->iOwningThread);
-	}
-
-void Monitor::DisplayNFastMutexInfo(NFastMutex* pM)
-	{
-	Printf("NFastMutex @ %08x HoldingThread %08x iWaiting %08x\r\n",pM,pM->iHoldingThread,pM->iWaiting);
-	}
-
-void Monitor::DisplaySchedulerInfo()
-	{
-	TScheduler* pS=TScheduler::Ptr();
-	Printf("SCHEDULER @%08x: CurrentThread %08x\r\n",pS,pS->iCurrentThread);
-	Printf("RescheduleNeeded=%02x DfcPending=%02x KernCSLocked=%08x\r\n",pS->iRescheduleNeededFlag,pS->iDfcPendingFlag,pS->iKernCSLocked);
-	Printf("DFCS: next %08x prev %08x\r\n",pS->iDfcs.iA.iNext,pS->iDfcs.iA.iPrev);
-	Printf("ProcessHandler=%08x, AddressSpace=%08x\r\n",pS->iProcessHandler,pS->iAddressSpace);
-	Printf("SYSLOCK: HoldingThread %08x iWaiting %08x\r\n",pS->iLock.iHoldingThread,pS->iLock.iWaiting);
-	Printf("Extras 0: %08x 1: %08x 2: %08x 3: %08x\r\n",pS->iExtras[0],pS->iExtras[1],pS->iExtras[2],pS->iExtras[3]);
-	Printf("Extras 4: %08x 5: %08x 6: %08x 7: %08x\r\n",pS->iExtras[4],pS->iExtras[5],pS->iExtras[6],pS->iExtras[7]);
-	Printf("Extras 8: %08x 9: %08x A: %08x B: %08x\r\n",pS->iExtras[8],pS->iExtras[9],pS->iExtras[10],pS->iExtras[11]);
-	Printf("Extras C: %08x D: %08x E: %08x F: %08x\r\n",pS->iExtras[12],pS->iExtras[13],pS->iExtras[14],pS->iExtras[15]);
-	}
-
--- a/kernel/eka/nkern/nk_timer.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkern/nk_timer.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -153,6 +153,7 @@
 // Wait aTime from last trigger time - used for periodic timers
 //
 	{
+	__NK_ASSERT_DEBUG(aTime>0);
 	TInt irq=NKern::DisableAllInterrupts();
 	if (iState!=EIdle)
 		{
--- a/kernel/eka/nkern/nkern.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkern/nkern.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1415,22 +1415,6 @@
 	NKern::Unlock();
 	}
 
-
-/** Changes the nominal priority of a thread.
-
-	This function is intended to be used by the EPOC layer and personality layers.
-	Do not use this function directly on a Symbian OS thread - use Kern::ThreadSetPriority().
-
-    @param aThread Thread to receive the new priority.
-    @param aPriority New inherited priority for aThread.
-    
-	@see Kern::SetThreadPriority()
-*/
-void NKern::ThreadSetNominalPriority(NThread* /*aThread*/, TInt /*aPriority*/)
-	{
-	}
-
-
 #ifndef __SCHEDULER_MACHINE_CODED__
 
 /** Signals the request semaphore of a nanothread.
--- a/kernel/eka/nkern/nkern.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkern/nkern.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -16,13 +16,12 @@
 //
 
 sourcepath				../nkern
-source					nkern.cpp nklib.cpp
+source					nkern.cpp
 #ifdef MARM
 sourcepath				../common/arm
 source					atomics.cia
 sourcepath				../nkern/arm
 source					vectors.cia ncsched.cpp ncsched.cia nctimer.cia ncutilf.cia
-source					nklib.cia
 
 // X86
 #elif defined(X86)
@@ -72,12 +71,8 @@
 ARMLIBS					h_a__un.l 
 #endif
 #else
-#ifdef ARMCC_4
-ARMLIBS					c_5.l     h_5.l     cpprt_5.l
-#else
 ARMLIBS					c_4.l     h_4.l     cpprt_4.l
 #endif
-#endif
 END
 
 
--- a/kernel/eka/nkern/nklib.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-// Copyright (c) 2010-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:
-// e32\nkern\nklib.cpp
-// 
-//
-
-#include <e32atomics.h>
-#include <nklib.h>
-
-#ifndef __SRATIO_MACHINE_CODED__
-void SRatio::Set(TUint32 aInt, TInt aDivisorExp)
-	{
-	iSpare1 = 0;
-	iSpare2 = 0;
-	iM = aInt;
-	if (iM)
-		{
-		TInt ms1 = __e32_find_ms1_32(iM);
-		TInt shift = 31 - ms1;
-		iM <<= shift;
-		iX = (TInt16)(-shift - aDivisorExp);
-		}
-	else
-		iX = 0;
-	}
-
-TInt SRatio::Reciprocal()
-	{
-	if (iM==0)
-		return KErrDivideByZero;
-	// Calculate 2^32/iM
-	TInt exp=0;
-	if (iM == 0x80000000u)
-		{
-		// ratio = 2^(31+iX) so reciprocal = 2^(-31-iX) = 2^(31 + (-62-iX))
-		exp = -62-iX;
-		}
-	else
-		{
-		// 2^32/iM = 1.xxx
-		TUint64 r64 = MAKE_TUINT64(0u-iM,0);
-		TUint32 q32 = (TUint32)(r64/TUint64(iM));	// next 32 bits of result
-		iM = 0x80000000u | (q32>>1);
-		exp = -63-iX;
-		if (q32 & 1)
-			{
-			if (++iM==0)
-				iM=0x80000000u, ++exp;
-			}
-		}
-	if (exp < -32768)
-		{
-		iM = 0;
-		iX = 0;
-		return KErrUnderflow;
-		}
-	if (exp > 32767)
-		{
-		iM = 0xffffffffu;
-		iX = 32767;
-		return KErrOverflow;
-		}
-	iX = (TInt16)exp;
-	return KErrNone;
-	}
-
-TInt SRatio::Mult(TUint32& aInt32)
-	{
-	TUint64 x = aInt32;
-	x *= TUint64(iM);
-	if (x==0)
-		{
-		aInt32 = 0;
-		return KErrNone;
-		}
-	TInt ms1 = __e32_find_ms1_64(x);
-	TInt ms1b = ms1 + iX;
-	if (ms1b>=32)
-		{
-		aInt32 = ~0u;
-		return KErrOverflow;
-		}
-	if (ms1b<-1)
-		{
-		aInt32 = 0;
-		return KErrUnderflow;
-		}
-	TInt shift = ms1b - ms1 + 31;
-	if (shift > 0)
-		x <<= shift;
-	else if (shift < 0)
-		x >>= (-shift);
-	x += MAKE_TUINT64(0,0x40000000u);
-	if (x >> 63)
-		{
-		aInt32 = ~0u;
-		return KErrOverflow;
-		}
-	aInt32 = (TUint32)(x>>31);
-	return aInt32 ? KErrNone : KErrUnderflow;
-	}
-
-//TInt SRatio::Mult(TUint64& aInt64)
-//	{
-//	}
-#endif
-
-void SRatioInv::Set(const SRatio* a)
-	{
-	if (a)
-		{
-		iR = *a;
-		iI = iR;
-		iI.Reciprocal();
-		}
-	else
-		{
-		iR.Set(1);
-		iI.Set(1);
-		}
-	}
-
-
-
--- a/kernel/eka/nkern/sched.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkern/sched.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -69,7 +69,6 @@
 void TScheduler::Remove(NThreadBase* aThread)
 	{
 	__NK_ASSERT_DEBUG(!aThread->iHeldFastMutex);	// can't block while holding fast mutex
-	iMadeUnReadyCounter++;
 	aThread->iTime=aThread->iTimeslice;		// thread has blocked so it gets a fresh timeslice for next time
 	TPriListBase::Remove(aThread);
 	}
--- a/kernel/eka/nkern/x86/ncmonitor.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkern/x86/ncmonitor.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,9 +21,31 @@
 #include <kernel/monitor.h>
 
 
-void DisplayNThreadPlatformSpecific(Monitor& m, NThread* pT)
+EXPORT_C void Monitor::DisplayNThreadInfo(NThread* pT)
 	{
-	m.Printf("ExcInUserMode=%02x\r\n",pT->iSpare3);
+	TBuf8<80> buf=_L8("NThread @ ");
+	buf.AppendNumFixedWidth((TUint)pT,EHex,8);
+	buf+=_L8(" Pri ");
+	buf.AppendNum((TUint)pT->iPriority);
+	buf+=_L8(" NState ");
+	switch (pT->iSpare1)
+		{
+		case NThread::EReady: buf+=_L8("READY"); break;
+		case NThread::ESuspended: buf+=_L8("SUSPENDED"); break;
+		case NThread::EWaitFastSemaphore: buf+=_L8("WAITFSEM "); buf.AppendNumFixedWidth((TUint)pT->iWaitObj,EHex,8); break;
+		case NThread::ESleep: buf+=_L8("SLEEP"); break;
+		case NThread::EBlocked: buf+=_L8("BLOCKED"); break;
+		case NThread::EDead: buf+=_L8("DEAD"); break;
+		case NThread::EWaitDfc: buf+=_L8("WAITDFC"); break;
+		default: buf+=_L8("??"); buf.AppendNumFixedWidth((TUint)pT->iSpare1,EHex,8); break;
+		}
+	PrintLine(buf);
+	Printf("Next=%08x Prev=%08x Att=%02x ExcInUserMode=%02x\r\n",pT->iNext,pT->iPrev,pT->iSpare2,pT->iSpare3);
+	Printf("HeldFM=%08x WaitFM=%08x AddrSp=%08x\r\n",pT->iHeldFastMutex,pT->iWaitFastMutex,pT->iAddressSpace);
+	Printf("Time=%d Timeslice=%d ReqCount=%d\r\n",pT->iTime,pT->iTimeslice,pT->iRequestSemaphore.iCount);
+	Printf("SuspendCount=%d CsCount=%d CsFunction=%08x\r\n",pT->iSuspendCount,pT->iCsCount,pT->iCsFunction);
+	Printf("iUserModeCallbacks=%08x iSpare7=%08x iSpare8=%08x\r\n", pT->iUserModeCallbacks, pT->iSpare7, pT->iSpare8);
+	Printf("SavedSP=%08x\r\n",pT->iSavedSP);
 	if (pT != TScheduler::Ptr()->iCurrentThread)
 		{
 		TUint32* pS=(TUint32*)pT->iSavedSP;
@@ -31,10 +53,35 @@
 		MTRAPD(r,wordmove(&reg,pS,sizeof(SThreadStack)));
 		if (r==KErrNone)
 			{
-			m.Printf("EBX %08x ESI %08x EDI %08x EBP %08x\r\n",reg.iEbx,reg.iEsi,reg.iEdi,reg.iEbp);
-			m.Printf("EIP %08x CR0 %08x  FS %08x  GS %08x\r\n",reg.iEip,reg.iCR0,reg.iFs,reg.iGs);
+			Printf("EBX %08x ESI %08x EDI %08x EBP %08x\r\n",reg.iEbx,reg.iEsi,reg.iEdi,reg.iEbp);
+			Printf("EIP %08x CR0 %08x  FS %08x  GS %08x\r\n",reg.iEip,reg.iCR0,reg.iFs,reg.iGs);
 			}
 		}
+	NewLine();
+	}
+
+void Monitor::DisplayNFastSemInfo(NFastSemaphore* pS)
+	{
+	Printf("NFastSemaphore @ %08x Count %d OwningThread %08x\r\n",pS,pS->iCount,pS->iOwningThread);
+	}
+
+void Monitor::DisplayNFastMutexInfo(NFastMutex* pM)
+	{
+	Printf("NFastMutex @ %08x HoldingThread %08x iWaiting %08x\r\n",pM,pM->iHoldingThread,pM->iWaiting);
+	}
+
+void Monitor::DisplaySchedulerInfo()
+	{
+	TScheduler* pS=TScheduler::Ptr();
+	Printf("SCHEDULER @%08x: CurrentThread %08x\r\n",pS,pS->iCurrentThread);
+	Printf("RescheduleNeeded=%02x DfcPending=%02x KernCSLocked=%08x\r\n",pS->iRescheduleNeededFlag,pS->iDfcPendingFlag,pS->iKernCSLocked);
+	Printf("DFCS: next %08x prev %08x\r\n",pS->iDfcs.iA.iNext,pS->iDfcs.iA.iPrev);
+	Printf("ProcessHandler=%08x, AddressSpace=%08x\r\n",pS->iProcessHandler,pS->iAddressSpace);
+	Printf("SYSLOCK: HoldingThread %08x iWaiting %08x\r\n",pS->iLock.iHoldingThread,pS->iLock.iWaiting);
+	Printf("Extras 0: %08x 1: %08x 2: %08x 3: %08x\r\n",pS->iExtras[0],pS->iExtras[1],pS->iExtras[2],pS->iExtras[3]);
+	Printf("Extras 4: %08x 5: %08x 6: %08x 7: %08x\r\n",pS->iExtras[4],pS->iExtras[5],pS->iExtras[6],pS->iExtras[7]);
+	Printf("Extras 8: %08x 9: %08x A: %08x B: %08x\r\n",pS->iExtras[8],pS->iExtras[9],pS->iExtras[10],pS->iExtras[11]);
+	Printf("Extras C: %08x D: %08x E: %08x F: %08x\r\n",pS->iExtras[12],pS->iExtras[13],pS->iExtras[14],pS->iExtras[15]);
 	}
 
 void Monitor::DumpCpuRegisters()
--- a/kernel/eka/nkern/x86/ncutils.cia	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkern/x86/ncutils.cia	Wed Sep 01 12:34:56 2010 +0100
@@ -23,7 +23,7 @@
 	asm("ret");
 	}
 
-extern "C" __NAKED__ void NKIdle(TUint32)
+extern "C" __NAKED__ void NKIdle(TInt)
 	{
 	asm("hlt");
 	asm("ret");
--- a/kernel/eka/nkern/x86/ncutils.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkern/x86/ncutils.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -259,7 +259,7 @@
 EXPORT_C TUint32 NKern::CpuTimeMeasFreq()
 	{
 #ifdef MONITOR_THREAD_CPU_TIME
-	return NKern::FastCounterFrequency();
+	return 1862000000;	// FIXME!!!!
 #else
 	return 0;
 #endif
--- a/kernel/eka/nkernsmp/arm/nccpu.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/arm/nccpu.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -20,6 +20,9 @@
 #include <arm_scu.h>
 #include <arm_tmr.h>
 
+extern "C" {
+extern SVariantInterfaceBlock* VIB;
+}
 
 struct SAPBootPage : public SFullArmRegSet
 	{
@@ -30,15 +33,8 @@
 	volatile T_UintPtr	iBootFlags4;
 	volatile TUint64	iBPTimestamp;
 	volatile TUint64	iAPTimestamp;
-
-	TUint32				i_SAPBootPage_Spare[624];
-
-	UPerCpuUncached		iPerCpu[KMaxCpus];
 	};
 
-__ASSERT_COMPILE(sizeof(SAPBootPage)==4096);
-
-
 extern "C" void _ApEntry();
 extern "C" void KickCpu(volatile T_UintPtr* aPtr, T_UintPtr aRegsPhys);
 extern void DumpFullRegSet(SFullArmRegSet& a);
@@ -91,7 +87,7 @@
 
 	KickCpu(&bootPage.iAPBootPtr[a.iCpu], bp_phys);
 
-	TUint32 n = TUint32(TheScheduler.iVIB->iMaxCpuClock >> 3);
+	TUint32 n = TUint32(VIB->iMaxCpuClock >> 3);
 	n = -n;
 	TUint32 b = 0;
 	do	{
@@ -104,30 +100,41 @@
 	__KTRACE_OPT(KBOOT,DEBUGPRINT("SCU: iCtrl=%08x iConfig=%08x iCpuStat=%08x", SCU.iCtrl, SCU.iConfig, SCU.iCpuStatus));
 	if (n==0)
 		return KErrTimedOut;
-
-#if defined(__NKERN_TIMESTAMP_USE_LOCAL_TIMER__)
-#error Use of local timer for NKern::Timestamp() no longer supported
-#endif
-
+	NKern::DisableAllInterrupts();
+	arm_dsb();
+	while (bootPage.iBootFlags2==0)
+		{}
+	arm_dsb();
+	bootPage.iBootFlags2 = 2;
+	arm_dsb();
+	bootPage.iBPTimestamp = NKern::Timestamp();
+	arm_dsb();
+	while (bootPage.iBootFlags2==2)
+		{}
+	arm_dsb();
+	NKern::EnableAllInterrupts();
 	return KErrNone;
 	}
 
-void InitTimestamp(TSubScheduler* aSS, SNThreadCreateInfo& aInfo)
+void InitAPTimestamp(SNThreadCreateInfo& aInfo)
 	{
-	NThread* t = (NThread*)aSS->iCurrentThread;
-	t->iActiveState = 1;
-	if (aSS->iCpuNum == 0)
-		{
-		aSS->iLastTimestamp.i64 = 0;
-		t->iLastActivationTime.i64 = 0;
-		return;
-		}
-	TUint64 ts = 0;
-#if defined(__NKERN_TIMESTAMP_USE_LOCAL_TIMER__)
-#error Use of local timer for NKern::Timestamp() no longer supported
-#endif
-	ts = NKern::Timestamp();
-	aSS->iLastTimestamp.i64 = ts;
-	t->iLastActivationTime.i64 = ts;
+	volatile SArmAPBootInfo& a = *(volatile SArmAPBootInfo*)aInfo.iParameterBlock;
+	volatile SAPBootPage& bootPage = *(volatile SAPBootPage*)a.iAPBootLin;
+	NKern::DisableAllInterrupts();
+	bootPage.iBootFlags2 = 1;
+	arm_dsb();
+	while (bootPage.iBootFlags2==1)
+		{}
+	arm_dsb();
+	bootPage.iAPTimestamp = NKern::Timestamp();
+	arm_dsb();
+	TUint64 bpt = bootPage.iBPTimestamp;
+	TUint64 apt = bootPage.iAPTimestamp;
+	TUint64 delta = bpt - apt;
+	SubScheduler().iLastTimestamp64 += delta;
+	__KTRACE_OPT(KBOOT,DEBUGPRINT("APT=0x%lx BPT=0x%lx Delta=0x%lx", apt, bpt, delta));
+	arm_dsb();
+	bootPage.iBootFlags2 = 3;
+	NKern::EnableAllInterrupts();
 	}
 
--- a/kernel/eka/nkernsmp/arm/ncglob.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/arm/ncglob.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -33,6 +33,8 @@
 //TSubScheduler*	SubSchedulerLookupTable[256];
 TUint32 CrashStateOut;
 SFullArmRegSet DefaultRegSet;
+
+SVariantInterfaceBlock* VIB;
 }
 
 #ifdef __USE_BTRACE_LOCK__
--- a/kernel/eka/nkernsmp/arm/ncmonitor.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/arm/ncmonitor.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -26,37 +26,130 @@
 	{
 	TScheduler* pS = TScheduler::Ptr();
 	TSubScheduler& ss = *pS->iSub[aCpu];
-	return *ss.iSSX.iRegs;
+	return *(SFullArmRegSet*)ss.i_AbtStackTop;
 	}
 
-void DisplayNThreadStackedRegs(Monitor& m, SThreadReschedStack& reg)
+void Monitor::DisplaySpinLock(const char* aTitle, TSpinLock* aLock)
 	{
-	m.Printf("TEEHBR %08x UROTID %08x URWTID %08x  FPEXC %08x\r\n", reg.iTEEHBR, reg.iRWROTID, reg.iRWRWTID, reg.iFpExc);
-	m.Printf("   CAR %08x   DACR %08x\r\n", reg.iCar, reg.iDacr);
-	m.Printf(" SPARE %08x   SPSR %08x SPRSCH %08x    R15 %08x\r\n", reg.iSpare, reg.iSpsrSvc, reg.iSPRschdFlg, reg.iR15);
+	volatile TUint32* p = (volatile TUint32*)aLock;
+	Printf("%s %08x %08x\r\n", aTitle, p[0], p[1]);
+	}
+
+EXPORT_C void Monitor::DisplayNThreadInfo(NThread* aT)
+	{
+	DisplayNSchedulableInfo(aT);
 	}
 
-void DisplaySubSchedulerExt(Monitor& m, TSubScheduler& ss)
+void Monitor::DisplayNSchedulableInfo(NSchedulable* aS)
 	{
-	TSubSchedulerX& x = ss.iSSX;
-	m.Printf("Extras[ 0] %08x Extras[ 1] %08x Extras[ 2] %08x i_GblTmrA  %08x\r\n", x.iSSXP[0], x.iSSXP[1], x.iSSXP[2], x.iGlobalTimerAddr);
-	m.Printf("i_ScuAddr  %08x i_GicDist  %08x i_GicCpuIf %08x i_LocTmrA  %08x\r\n", x.iScuAddr, x.iGicDistAddr, x.iGicCpuIfcAddr, x.iLocalTimerAddr);
-	m.Printf("i_IrqCount %08x i_IrqNest  %08x i_ExcInfo  %08x i_CrashSt  %08x\r\n", x.iIrqCount, x.iIrqNestCount, x.iExcInfo, x.iCrashState);
-	m.Printf("i_AbtStkTp %08x i_UndSktTp %08x i_FiqStkTp %08x i_IrqStkTp %08x\r\n", x.iAbtStackTop, x.iUndStackTop, x.iFiqStackTop, x.iIrqStackTop);
-	m.Printf("CpuFreqM   %08x CpuFreqS   %08x CpuPeriodM %08x CpuPeriodS %08x\r\n", x.iCpuFreqRI.iR.iM, x.iCpuFreqRI.iR.iX, x.iCpuFreqRI.iI.iM, x.iCpuFreqRI.iI.iX);
-	m.Printf("TmrFreqM   %08x TmrFreqS   %08x TmrPeriodM %08x TmrPeriodS %08x\r\n", x.iTimerFreqRI.iR.iM, x.iTimerFreqRI.iR.iX, x.iTimerFreqRI.iI.iM, x.iTimerFreqRI.iI.iX);
+	NThread* t = aS->iParent ? (NThread*)aS : 0;
+	NThreadGroup* g = aS->iParent ? 0 : (NThreadGroup*)aS;
+
+	if (t && aS->iParent==aS)
+		Printf("NThread @%08x Pri %d\r\n",aS,aS->iPriority);
+	else if (t)
+		Printf("NThread @%08x (G:%08x) Pri %d\r\n",aS,aS->iParent,aS->iPriority);
+	else
+		Printf("NThreadGroup @%08x Pri %d\r\n",aS,aS->iPriority);
+	Printf("Rdy=%02x Curr=%02x LastCpu=%d CpuChg=%02x FrzCpu=%d\r\n", aS->iReady, aS->iCurrent, aS->iLastCpu, aS->iCpuChange, aS->iFreezeCpu);
+	Printf("Next=%08x Prev=%08x Parent=%08x CPUaff=%08x\r\n", aS->iNext, aS->iPrev, aS->iParent, aS->iCpuAffinity);
+	Printf("PauseCount %02x Susp %1x\r\n", aS->iPauseCount, aS->iSuspended);
+	DisplaySpinLock("SpinLock", &aS->iSSpinLock);
+	Printf("Stopping %02x Events %08x %08x EventState %08x\r\n", aS->iStopping, aS->iEvents.iA.iNext, aS->iEvents.iA.iPrev, aS->iEventState);
+	Printf("TotalCpuTime %08x %08x RunCount %08x %08x\r\n", aS->iTotalCpuTime32[1], aS->iTotalCpuTime32[0], aS->iRunCount32[1], aS->iRunCount32[0]);
+
+	if (g)
+		{
+		// Thread group
+		return;
+		}
+
+	Printf("WaitState %02x %02x [%02x %02x] (%08x)\r\n", t->iWaitState.iWtC.iWtStFlags, t->iWaitState.iWtC.iWtObjType,
+											t->iWaitState.iWtC.iWtStSpare1, t->iWaitState.iWtC.iWtStSpare2, t->iWaitState.iWtC.iWtObj);
+	Printf("BasePri %d MutexPri %d Att=%02x\r\n", t->iBasePri, t->iMutexPri, t->i_ThrdAttr);
+	Printf("HeldFM=%08x FMDef=%02x AddrSp=%08x\r\n", t->iHeldFastMutex, t->iFastMutexDefer, t->iAddressSpace);
+	Printf("Time=%d Timeslice=%d ReqCount=%08x\r\n", t->iTime, t->iTimeslice, t->iRequestSemaphore.iCount);
+	Printf("SuspendCount=%d CsCount=%d CsFunction=%08x\r\n", t->iSuspendCount, t->iCsCount, t->iCsFunction);
+	Printf("LinkedObjType %02x LinkedObj %08x\r\n", t->iLinkedObjType, t->iLinkedObj);
+	Printf("SavedSP=%08x WaitLink:%08x %08x %d\r\n", t->iSavedSP, t->iWaitLink.iNext, t->iWaitLink.iPrev, t->iWaitLink.iPriority);
+	Printf("iNewParent=%08x iExtraContext=%08x, iExtraContextSize=%08x\r\n", t->iNewParent, t->iExtraContext, t->iExtraContextSize);
+	Printf("iUserModeCallbacks=%08x iNThreadBaseSpare6=%08x\r\n", t->iUserModeCallbacks, t->iNThreadBaseSpare6);
+	Printf("iNThreadBaseSpare7=%08x iNThreadBaseSpare8=%08x iNThreadBaseSpare9=%08x\r\n", t->iNThreadBaseSpare7, t->iNThreadBaseSpare8, t->iNThreadBaseSpare9);
+	if (!aS->iCurrent)
+		{
+		TUint32* pS=(TUint32*)t->iSavedSP;
+		SThreadReschedStack reg;
+		MTRAPD(r,wordmove(&reg,pS,sizeof(SThreadReschedStack)));
+		if (r==KErrNone)
+			{
+			Printf("TEEHBR %08x UROTID %08x URWTID %08x  FPEXC %08x\r\n", reg.iTEEHBR, reg.iRWROTID, reg.iRWRWTID, reg.iFpExc);
+			Printf("   CAR %08x   DACR %08x\r\n", reg.iCar, reg.iDacr);
+			Printf(" SPARE %08x   SPSR %08x SPRSCH %08x    R15 %08x\r\n", reg.iSpare, reg.iSpsrSvc, reg.iSPRschdFlg, reg.iR15);
+			}
+		}
+	NewLine();
 	}
 
-void DisplaySchedulerExt(Monitor& m, TScheduler& s)
+void Monitor::DisplayNFastSemInfo(NFastSemaphore* pS)
+	{
+	if (pS->iCount >= 0)
+		Printf("NFastSemaphore @ %08x Count %d OwningThread %08x\r\n",pS,pS->iCount,pS->iOwningThread);
+	else
+		Printf("NFastSemaphore @ %08x Count %08x (%08x) OwningThread %08x\r\n",pS,pS->iCount,pS->iCount<<2,pS->iOwningThread);
+	}
+
+void Monitor::DisplayNFastMutexInfo(NFastMutex* aM)
+	{
+	Printf("NFastMutex @ %08x HoldingThread %08x iWaitQ Pri Mask %08x %08x\r\n", aM, aM->iHoldingThread, aM->iWaitQ.iPresent[1], aM->iWaitQ.iPresent[0]);
+	DisplaySpinLock("SpinLock", &aM->iMutexLock);
+	}
+
+void DisplaySubSchedulerInfo(Monitor& m, TSubScheduler& ss)
 	{
-	TSchedulerX& sx = s.iSX;
-	m.Printf("iTimerMax  %08x %08x\r\n", I64HIGH(sx.iTimerMax), I64LOW(sx.iTimerMax));
-	m.Printf("iGTmrA     %08x  iScuAddr %08x  iGicDistA %08x  iGicCpuIfcA %08x  iLocTmrA %08x\r\n",
-		sx.iGlobalTimerAddr, sx.iScuAddr, sx.iGicDistAddr, sx.iGicCpuIfcAddr, sx.iLocalTimerAddr);
-	m.Printf("iGTFreqM   %08x iGTFreqS   %08x iGTPeriodM %08x iGTPeriodS %08x\r\n",
-		sx.iGTimerFreqRI.iR.iM, sx.iGTimerFreqRI.iR.iX, sx.iGTimerFreqRI.iI.iM, sx.iGTimerFreqRI.iI.iX);
-	m.Printf("iCount0    %08x %08x   iTimestamp0 %08x %08x\r\n",
-		I64HIGH(sx.iCount0), I64LOW(sx.iCount0), I64HIGH(sx.iTimestamp0), I64LOW(sx.iTimestamp0));
+	m.Printf("\r\nSUBSCHEDULER %d @%08x:\r\n", ss.iCpuNum, &ss);
+	m.Printf("CurrentThread=%08x\r\n", ss.iCurrentThread);
+	m.Printf("IDFCs   %08x %08x    CPU# %08x CPUmask %08x\r\n", ss.iDfcs.iA.iNext, ss.iDfcs.iA.iPrev, ss.iCpuNum, ss.iCpuMask);
+	m.Printf("ExIDFCs %08x %08x CurIDFC %08x PendFlg %08x\r\n", ss.iExIDfcs.iA.iNext, ss.iExIDfcs.iA.iPrev, ss.iCurrentIDFC, *(TUint32*)&ss.iRescheduleNeededFlag);
+	m.DisplaySpinLock("ExIDfcLock", &ss.iExIDfcLock);
+	m.Printf("KLCount %d InIDFC %02x EvPend %02x\r\n", ss.iKernLockCount, ss.iInIDFC, ss.iEventHandlersPending);
+	m.Printf("AddrSp  %08x RschdIPIs %08x iNextIPI %08x\r\n", ss.iAddressSpace, ss.iReschedIPIs, ss.iNextIPI);
+	m.DisplaySpinLock("ReadyListLock", &ss.iReadyListLock);
+	m.Printf("EvtHand %08x %08x InitThrd %08x SLOC %08x %08x\r\n", ss.iEventHandlers.iA.iNext, ss.iEventHandlers.iA.iPrev,
+		ss.iInitialThread, I64HIGH(ss.iSpinLockOrderCheck), I64LOW(ss.iSpinLockOrderCheck));
+	m.DisplaySpinLock("EventHandlerLock", &ss.iEventHandlerLock);
+	m.Printf("Extras[ 0] %08x Extras[ 1] %08x Extras[ 2] %08x Extras[ 3] %08x\r\n", ss.iExtras[0], ss.iExtras[1], ss.iExtras[2], ss.iExtras[3]);
+	m.Printf("i_ScuAddr  %08x i_GicDist  %08x i_GicCpuIf %08x i_LocTmrA  %08x\r\n", ss.i_ScuAddr, ss.i_GicDistAddr, ss.i_GicCpuIfcAddr, ss.i_LocalTimerAddr);
+	m.Printf("i_IrqCount %08x i_IrqNest  %08x i_ExcInfo  %08x i_CrashSt  %08x\r\n", ss.i_IrqCount, ss.i_IrqNestCount, ss.i_ExcInfo, ss.i_CrashState);
+	m.Printf("i_AbtStkTp %08x i_UndSktTp %08x i_FiqStkTp %08x i_IrqStkTp %08x\r\n", ss.i_AbtStackTop, ss.i_UndStackTop, ss.i_FiqStackTop, ss.i_IrqStackTop);
+	m.Printf("i_TmrMultF %08x i_TmrMultI %08x i_CpuMult  %08x Extras[13] %08x\r\n", ss.i_TimerMultF, ss.i_TimerMultI, ss.i_CpuMult, ss.iExtras[19]);
+	m.Printf("i_LstTmrSt %08x i_TstmpErr %08x i_MaxCorr  %08x i_TimerGap %08x\r\n", ss.iExtras[20], ss.iExtras[21], ss.iExtras[22], ss.iExtras[23]);
+	m.Printf("iLastTimestamp %08x %08x   iReschedCount %08x %08x\r\n", ss.iLastTimestamp32[1], ss.iLastTimestamp32[0], ss.iReschedCount32[1], ss.iReschedCount32[0]);
+	}
+
+void Monitor::DisplaySchedulerInfo()
+	{
+	TScheduler* pS=TScheduler::Ptr();
+	Printf("SCHEDULER @%08x:\r\n",pS);
+	Printf("ProcessHandler=%08x MonitorExceptionHandler=%08x RescheduleHook=%08x\r\n",pS->iProcessHandler,pS->iMonitorExceptionHandler,pS->iRescheduleHook);
+	Printf("iActiveCpus1=%08x, iActiveCpus2=%08x, iNumCpus=%d\r\n",pS->iActiveCpus1,pS->iActiveCpus2,pS->iNumCpus);
+	Printf("SYSLOCK @ %08x\r\n",&pS->iLock);
+	DisplayNFastMutexInfo(&pS->iLock);
+	DisplaySpinLock("IdleSpinLock", &pS->iIdleSpinLock);
+	Printf("IdleDfcs %08x %08x CpusNotIdle %08x IdleGeneration %02x IdleSpillCpu %02x\r\n",
+		pS->iIdleDfcs.iA.iNext, pS->iIdleDfcs.iA.iPrev, pS->iCpusNotIdle, pS->iIdleGeneration, pS->iIdleSpillCpu);
+	Printf("Extras  0: %08x  1: %08x  2: %08x  3: %08x\r\n",pS->iExtras[0],pS->iExtras[1],pS->iExtras[2],pS->iExtras[3]);
+	Printf("Extras  4: %08x  5: %08x  6: %08x  7: %08x\r\n",pS->iExtras[4],pS->iExtras[5],pS->iExtras[6],pS->iExtras[7]);
+	Printf("Extras  8: %08x  9: %08x  A: %08x  B: %08x\r\n",pS->iExtras[8],pS->iExtras[9],pS->iExtras[10],pS->iExtras[11]);
+	Printf("Extras  C: %08x  D: %08x  E: %08x  F: %08x\r\n",pS->iExtras[12],pS->iExtras[13],pS->iExtras[14],pS->iExtras[15]);
+	Printf("Extras 10: %08x 11: %08x 12: %08x 13: %08x\r\n",pS->iExtras[16],pS->iExtras[17],pS->iExtras[18],pS->iExtras[19]);
+	Printf("Extras 14: %08x 15: %08x 16: %08x 17: %08x\r\n",pS->iExtras[20],pS->iExtras[21],pS->iExtras[22],pS->iExtras[23]);
+
+	TInt i;
+	for (i=0; i<KMaxCpus; ++i)
+		{
+		TSubScheduler& ss = *pS->iSub[i];
+		DisplaySubSchedulerInfo(*this,ss);
+		}
 	}
 
 void DumpRegisters(Monitor& m, SFullArmRegSet& a)
@@ -124,9 +217,9 @@
 		{
 		Printf("CPU %d:\r\n", i);
 		TSubScheduler& ss = *pS->iSub[i];
-		if (!ss.iSSX.iRegs)
+		if (!ss.i_Regs)
 			continue;
-		SFullArmRegSet& r = *ss.iSSX.iRegs;
+		SFullArmRegSet& r = *(SFullArmRegSet*)ss.i_Regs;
 		
 		Printf("Exc %1d Cpsr=%08x FAR=%08x FSR=%08x\r\n",  r.iExcCode, r.iN.iFlags, r.iB[0].iDFAR, r.iB[0].iDFSR);
 		Printf(" R0=%08x  R1=%08x  R2=%08x  R3=%08x\r\n",  r.iN.iR0,  r.iN.iR1,  r.iN.iR2,  r.iN.iR3);
@@ -140,6 +233,7 @@
 
 EXPORT_C void Monitor::GetStackPointers(NThread* aThread, TUint& aSupSP, TUint& aUsrSP)
 	{
+//	TScheduler* pS = TScheduler::Ptr();
 	if (aThread->iCurrent)
 		{
 		TInt i = aThread->iLastCpu;
--- a/kernel/eka/nkernsmp/arm/ncsched.cia	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/arm/ncsched.cia	Wed Sep 01 12:34:56 2010 +0100
@@ -54,7 +54,6 @@
 
 extern "C" void NewThreadTrace(NThread* a);
 extern "C" void send_accumulated_resched_ipis();
-extern "C" void wake_up_for_ipi(TSubScheduler*, TInt);
 
 
 __NAKED__ void TScheduler::Reschedule()
@@ -72,7 +71,7 @@
 	__ASM_CLI();							// interrupts off
 	asm("ldr	r1, [r0, #%a0]" : : "i" (_FOFF(TSubScheduler,iDfcPendingFlag)&~3));	// check iDfcPendingFlag and iExIDfcPendingFlag
 	asm("mov	r11, r0 ");					// r11->TSubScheduler
-	asm("ldr	r10, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,iSSX.iLocalTimerAddr));	// r10->CPU local timer
+	asm("ldr	r10, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,i_LocalTimerAddr));	// r10->CPU local timer
 
 	asm("start_resched: ");
 	asm("movs	r1, r1, lsr #16 ");			// check if IDFCs or ExIDFCs pending
@@ -830,13 +829,11 @@
 	}
 
 
-extern "C" __NAKED__ void send_irq_ipi(TSubScheduler*, TInt)
+extern "C" __NAKED__ void send_irq_ipi(TSubScheduler*)
 	{
-	asm("tst	r1, #%a0" : : "i" ((TInt)EQueueEvent_WakeUp) );
-	asm("bne "	CSM_CFUNC(wake_up_for_ipi));
 	__DATA_SYNC_BARRIER_Z__(r3);			// need DSB before sending any IPI
 	asm("ldr	r3, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, iCpuMask));
-	asm("ldr	r2, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iGicDistAddr));	// we assume i_GicDistAddr is the same for all CPUs
+	asm("ldr	r2, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, i_GicDistAddr));	// we assume i_GicDistAddr is the same for all CPUs
 	asm("mov	r1, #%a0" : : "i" ((TInt)TRANSFERRED_IRQ_VECTOR));
 	asm("orr	r1, r1, r3, lsl #16 ");
 	asm("str	r1, [r2, #%a0]" : : "i" _FOFF(GicDistributor, iSoftIrq));	// trigger IPIs
@@ -848,12 +845,7 @@
 // Return with R0 unaltered.
 extern "C" __NAKED__ void send_accumulated_resched_ipis()
 	{
-	asm("ldr	r3, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, iScheduler));
-	asm("ldr	r2, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iGicDistAddr));
-	asm("ldr	r1, [r3, #%a0]" : : "i" _FOFF(TScheduler, iThreadAcceptCpus));
-	asm("bics	r1, r12, r1 ");
-	asm("bne	2f ");
-	asm("1:		");
+	asm("ldr	r2, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, i_GicDistAddr));
 	asm("mov	r1, #0 ");
 	asm("str	r1, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,iReschedIPIs));
 	__DATA_SYNC_BARRIER__(r1);				// need DSB before sending any IPI
@@ -861,16 +853,6 @@
 //	asm("orr	r1, r1, #%a0" : : "i" ((TInt)RESCHED_IPI_VECTOR));	RESCHED_IPI_VECTOR=0
 	asm("str	r1, [r2, #%a0]" : : "i" _FOFF(GicDistributor, iSoftIrq));	// trigger IPIs
 	__JUMP(,lr);
-
-	asm("2:		");
-	asm("stmfd	sp!, {r0,lr} ");
-	asm("mov	r0, r3 ");
-	asm("mov	r1, r12 ");
-	asm("bl		ReschedInactiveCpus__10TSchedulerUl ");
-	asm("mov	r12, r0 ");
-	asm("ldmfd	sp!, {r0,lr} ");
-	asm("ldr	r2, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iGicDistAddr));
-	asm("b		1b ");
 	}
 
 // Send a reschedule IPI to the specified CPU
@@ -878,7 +860,7 @@
 	{
 	GET_RWNO_TID(,r3);
 	__DATA_SYNC_BARRIER_Z__(r2);			// need DSB before sending any IPI
-	asm("ldr	r2, [r3, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iGicDistAddr));	// we assume i_GicDistAddr is the same for all CPUs
+	asm("ldr	r2, [r3, #%a0]" : : "i" _FOFF(TSubScheduler, i_GicDistAddr));	// we assume i_GicDistAddr is the same for all CPUs
 	ASM_DEBUG1(SendReschedIPI,r0);
 	asm("mov	r1, #0x10000 ");
 	asm("mov	r1, r1, lsl r0 ");	// 0x10000<<aCpu
@@ -893,30 +875,44 @@
 	{
 	GET_RWNO_TID(,r3);
 	__DATA_SYNC_BARRIER_Z__(r2);			// need DSB before sending any IPI
-	asm("ldr	r2, [r3, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iGicDistAddr));	// we assume i_GicDistAddr is the same for all CPUs
+	asm("ldr	r2, [r3, #%a0]" : : "i" _FOFF(TSubScheduler, i_GicDistAddr));	// we assume i_GicDistAddr is the same for all CPUs
 	asm("mov	r1, #0x02000000 ");			// target = requesting CPU only
 //	asm("orr	r1, r1, #%a0" : : "i" ((TInt)RESCHED_IPI_VECTOR));	RESCHED_IPI_VECTOR=0
 	asm("str	r1, [r2, #%a0]" : : "i" _FOFF(GicDistributor, iSoftIrq));	// trigger IPI
 	__JUMP(,lr);
 	}
 
+extern "C" __NAKED__ void send_resched_ipis(TUint32 aMask)
+	{
+	ASM_DEBUG1(SendReschedIPIs,r0);
+	__DATA_SYNC_BARRIER_Z__(r2);			// need DSB before sending any IPI
+	asm("cmp	r0, #0 ");		// any bits set in aMask?
+	GET_RWNO_TID(ne,r3);
+	asm("ldrne	r2, [r3, #%a0]" : : "i" _FOFF(TSubScheduler, i_GicDistAddr));	// we assume i_GicDistAddr is the same for all CPUs
+	asm("movne	r0, r0, lsl #16 ");
+//	asm("orrne	r0, r0, #%a0" : : "i" ((TInt)RESCHED_IPI_VECTOR));	RESCHED_IPI_VECTOR=0
+	asm("strne	r0, [r2, #%a0]" : : "i" _FOFF(GicDistributor, iSoftIrq));	// trigger IPIs if any
+	__JUMP(,lr);
+	}
+
+
 extern "C" __NAKED__ void send_resched_ipi_and_wait(TInt /*aCpu*/)
 	{
 	asm("ldr	r1, __TheSubSchedulers ");
 	asm("mov	r2, #0x10000 ");
 	asm("mov	r2, r2, lsl r0 ");	// 0x10000<<aCpu
 	ASM_DEBUG1(SendReschedIPIAndWait,r0);
-	asm("add	r0, r1, r0, lsl #%a0 " : : "i" ((TInt)KSubSchedulerShift));
-	asm("ldr	r3, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iGicDistAddr));	// we assume i_GicDistAddr is the same for all CPUs
-	asm("ldr	r12, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iIrqCount));
+	asm("add	r0, r1, r0, lsl #9 ");	// sizeof(TSubScheduler)=512
+	asm("ldr	r3, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, i_GicDistAddr));	// we assume i_GicDistAddr is the same for all CPUs
+	asm("ldr	r12, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, i_IrqCount));
 	__DATA_SYNC_BARRIER_Z__(r1);		// make sure i_IrqCount is read before IPI is sent
 //	asm("orr	r2, r2, #%a0" : : "i" ((TInt)RESCHED_IPI_VECTOR));	RESCHED_IPI_VECTOR=0
 	asm("str	r2, [r3, #%a0]" : : "i" _FOFF(GicDistributor, iSoftIrq));	// trigger IPIs
 	__DATA_SYNC_BARRIER__(r1);			// make sure IPI has been sent
 	asm("1: ");
 	asm("ldrb	r1, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, iRescheduleNeededFlag));
-	asm("ldr	r2, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iIrqNestCount));
-	asm("ldr	r3, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iIrqCount));
+	asm("ldr	r2, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, i_IrqNestCount));
+	asm("ldr	r3, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, i_IrqCount));
 	asm("cmp	r1, #0 ");
 	asm("beq	0f ");					// iRescheduleNeededFlag not set -> wait
 	asm("cmp	r2, #0 ");
@@ -934,7 +930,6 @@
 	asm(".word TheSubSchedulers ");
 	}
 
-
 /*	If the current thread is subject to timeslicing, update its remaining time
 	from the current CPU's local timer. Don't stop the timer.
 	If the remaining time is negative, save it as zero.
@@ -943,38 +938,127 @@
 	{
 	asm("ldr	r3, [r1, #%a0]" : : "i" _FOFF(NThreadBase,iTime));
 	asm("ldrb	r12, [r1, #%a0]" : : "i" _FOFF(NThreadBase,i_NThread_Initial));
-	asm("ldr	r2, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,iSSX.iLocalTimerAddr));
+	asm("ldr	r2, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,i_LocalTimerAddr));
 	asm("cmp	r3, #0 ");
 	asm("ble	0f ");					// thread isn't timesliced or timeslice already expired so skip
 	asm("cmp	r12, #0 ");
 	asm("bne	0f ");					// initial (i.e. idle) thread, so skip
 	asm("ldr	r3, [r2, #%a0]" : : "i" _FOFF(ArmLocalTimer,iTimerCount));
-	asm("ldr	r12, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,iSSX.iTimerFreqRI.iI.iM));
-	asm("ldr	r2, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,iSSX.iTimerFreqRI.iI.iX));
+	asm("ldr	r12, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,i_TimerMultI));
 	asm("cmp	r3, #0 ");
 	asm("movmi	r0, #0 ");				// if timer count is negative, save zero
 	asm("bmi	1f ");
-	asm("mov	r2, r2, lsl #16 ");
-	asm("mov	r2, r2, asr #16 ");
-	asm("umull	r0, r3, r12, r3 ");		// scale up to max timer clock (R3:R0) - need to shift right by -iX
-	asm("rsb	r2, r2, #0 ");
-	asm("rsb	r12, r2, #32 ");
-	asm("movs	r0, r0, lsr r2 ");		// r0 >>= iSSX.iTimerFreqRI.iI.iX, C = last bit shifted off (rounding)
-	asm("orr	r0, r0, r3, lsl r12 ");	// bottom bits from r3 into top bits of r0
-	asm("adcs	r0, r0, #0 ");			// round using last bit shifted off
+	asm("umull	r0, r3, r12, r3 ");		// scale up to max timer clock
+	asm("adds	r0, r0, #0x00800000 ");
+	asm("adcs	r3, r3, #0 ");
+	asm("mov	r0, r0, lsr #24 ");
+	asm("orr	r0, r0, r3, lsl #8 ");
 	asm("1:		");
 	asm("str	r0, [r1, #%a0]" : : "i" _FOFF(NThreadBase,iTime));
 	asm("0:		");
 	__JUMP(,lr);
 	}
 
+/*	Update aOld's execution time and set up the timer for aNew
+	Update this CPU's timestamp value
 
-#if defined(__UTT_MACHINE_CODED__)
-#if defined(__NKERN_TIMESTAMP_USE_LOCAL_TIMER__)
-#error Use of local timer for NKern::Timestamp() no longer supported
-#else
+	if (!aOld) aOld=iInitialThread
+	if (!aNew) aNew=iInitialThread
+	newcount = aNew->iTime>0 ? Max(aNew->iTime*i_TimerMultF/2^32, 1) : 2^31-1
+	cli()
+	oldcount = timer count
+	if (oldcount<=0 || aOld!=aNew)
+		{
+		timer count = newcount
+		elapsed = i_LastTimerSet - oldcount
+		i_LastTimerSet = newcount
+		elapsed = elapsed * i_TimerMultI / 2^24
+		aOld->iTotalCpuTime64 += elapsed
+		correction = i_TimestampError;
+		if (correction > i_MaxCorrection)
+			correction = i_MaxCorrection
+		else if (correction < -i_MaxCorrection)
+			correction = -i_MaxCorrection
+		i_TimestampError -= correction
+		i_LastTimestamp += elapsed + i_TimerGap - correction
+		}
+	sti()
+ */
+__NAKED__ void TSubScheduler::UpdateThreadTimes(NThreadBase* /*aOld*/, NThreadBase* /*aNew*/)
+	{
+	asm("cmp	r2, #0 ");
+	asm("ldreq	r2, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,iInitialThread));
+	asm("ldr	r12, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,i_TimerMultF));
+	asm("cmp	r1, #0 ");
+	asm("ldreq	r1, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,iInitialThread));
+	asm("ldr	r3, [r2, #%a0]" : : "i" _FOFF(NThreadBase,iTime));
+	asm("stmfd	sp!, {r4-r7} ");
+	asm("ldr	r6, [r2, #%a0]" : : "i" _FOFF(NThreadBase,iRunCount64));
+	asm("ldr	r7, [r2, #%a0]" : : "i" (_FOFF(NThreadBase,iRunCount64)+4));
+	asm("cmp	r1, r2 ");
+	asm("beq	2f ");
+	asm("adds	r6, r6, #1 ");
+	asm("str	r6, [r2, #%a0]" : : "i" _FOFF(NThreadBase,iRunCount64));
+	asm("ldr	r4, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,iReschedCount64));
+	asm("ldr	r6, [r0, #%a0]" : : "i" (_FOFF(TSubScheduler,iReschedCount64)+4));
+	asm("adcs	r7, r7, #0 ");
+	asm("str	r7, [r2, #%a0]" : : "i" (_FOFF(NThreadBase,iRunCount64)+4));
+	asm("adds	r4, r4, #1 ");
+	asm("adcs	r6, r6, #0 ");
+	asm("str	r4, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,iReschedCount64));
+	asm("str	r6, [r0, #%a0]" : : "i" (_FOFF(TSubScheduler,iReschedCount64)+4));
+	asm("2:		");
+	asm("cmp	r3, #1 ");					// aNew->iTime > 0 ?
+	asm("umullge r4, r3, r12, r3 ");
+	asm("ldr	r5, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,i_LocalTimerAddr));
+	asm("movlt	r3, #0x7fffffff ");
+	asm("addges	r3, r3, r4, lsr #31 ");		// round up top 32 bits if bit 31 set
+	asm("moveq	r3, #1 ");					// if result zero, limit to 1
+	asm("ldr	r12, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,i_LastTimerSet));
+	__ASM_CLI();
+	asm("ldr	r4, [r5, #%a0]" : : "i" _FOFF(ArmLocalTimer,iTimerCount));
+	asm("cmp	r1, r2 ");
+	asm("bne	1f ");
+	asm("cmp	r4, #0 ");
+	asm("bgt	0f ");						// same thread, timeslice not expired -> leave timer alone
+	asm("1:		");
+	asm("str	r3, [r5, #%a0]" : : "i" _FOFF(ArmLocalTimer,iTimerCount));	// set new timeslice value in timer
+	asm("ldr	r5, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,i_TimerMultI));
+	asm("str	r3, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,i_LastTimerSet));
+	asm("sub	r12, r12, r4 ");			// r12 = elapsed (actual timer ticks)
+	asm("umull	r4, r5, r12, r5 ");
+	asm("ldr	r3, [r1, #%a0]!" : : "i" _FOFF(NThreadBase,iTotalCpuTime64));
+	asm("ldr	r12, [r1, #4] ");
+	asm("adds	r4, r4, #0x00800000 ");
+	asm("adcs	r5, r5, #0 ");
+	asm("mov	r4, r4, lsr #24 ");
+	asm("orr	r4, r4, r5, lsl #8 ");		// r4 = elapsed
+	asm("adds	r3, r3, r4 ");
+	asm("adcs	r12, r12, #0 ");
+	asm("stmia	r1, {r3,r12} ");			// aOld->iTotalCpuTime64 += elapsed
+	asm("ldr	r3, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,i_TimestampError));
+	asm("ldr	r5, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,i_MaxCorrection));
+	asm("ldr	r1, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,iLastTimestamp64));
+	asm("ldr	r2, [r0, #%a0]" : : "i" (_FOFF(TSubScheduler,iLastTimestamp64)+4));
+	asm("mov	r12, r3 ");
+	asm("cmp	r3, r5 ");
+	asm("movgt	r3, r5 ");					// if (correction>i_MaxCorrection) correction=i_MaxCorrection
+	asm("cmn	r3, r5 ");
+	asm("rsblt	r3, r5, #0 ");				// if (correction+i_MaxCorrection<0) correction=-i_MaxCorrection
+	asm("ldr	r5, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,i_TimerGap));
+	asm("sub	r12, r12, r3 ");
+	asm("str	r12, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,i_TimestampError));
+	asm("add	r4, r4, r5 ");				// r4 = elapsed + i_TimerGap
+	asm("adds	r1, r1, r4 ");
+	asm("adcs	r2, r2, #0 ");				// iLastTimestamp64 + (elapsed + i_TimerGap)
+	asm("subs	r1, r1, r3 ");
+	asm("sbcs	r1, r1, r3, asr #32 ");		// iLastTimestamp64 + (elapsed + i_TimerGap - correction)
+	asm("str	r1, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,iLastTimestamp64));
+	asm("str	r2, [r0, #%a0]" : : "i" (_FOFF(TSubScheduler,iLastTimestamp64)+4));
+	asm("0:		");
+	__ASM_STI();
+	asm("ldmfd	sp!, {r4-r7} ");
+	__JUMP(,lr);
+	}
 
-#error UpdateThreadTimes assembler out of date!
 
-#endif
-#endif	// __UTT_MACHINE_CODED__
--- a/kernel/eka/nkernsmp/arm/ncsched.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/arm/ncsched.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -19,7 +19,6 @@
 #define __INCLUDE_NTHREADBASE_DEFINES__
 
 #include <arm.h>
-#include <arm_tmr.h>
 
 extern "C" void NewThreadTrace(NThread* a)
 	{
@@ -160,61 +159,3 @@
 
 #endif
 
-#if !defined(__UTT_MACHINE_CODED__)
-void TSubScheduler::UpdateThreadTimes(NThreadBase* aOld, NThreadBase* aNew)
-	{
-	/* If necessary update local timer frequency (DVFS) */
-	SRatioInv* pNCF = iSSX.iNewCpuFreqRI;
-	if (pNCF)
-		{
-		iSSX.iCpuFreqRI = *pNCF;
-		__e32_atomic_store_rel_ptr(&iSSX.iNewCpuFreqRI, 0);
-		}
-	SRatioInv* pNTF = iSSX.iNewTimerFreqRI;
-	if (pNTF)
-		{
-		iSSX.iTimerFreqRI = *pNTF;
-		__e32_atomic_store_rel_ptr(&iSSX.iNewTimerFreqRI, 0);
-		}
-	if (!aOld)
-		aOld = iInitialThread;
-	if (!aNew)
-		aNew = iInitialThread;
-	if (aNew!=aOld || aNew->iTime<=0 || pNTF)
-		{
-		TUint32 tmrval = 0x7fffffffu;
-		if (aNew->iTime > 0)
-			{
-			tmrval = aNew->iTime;	// this will have been computed based on the old timer frequency
-			iSSX.iTimerFreqRI.iR.Mult(tmrval);
-			}
-//		iSSX.iLastTimerSet = tmrval;
-		iSSX.iLocalTimerAddr->iTimerCount = tmrval;
-		}
-	if (aNew!=aOld)
-		{
-		TUint64 now = NKern::Timestamp();
-		TUint64 delta = now - iLastTimestamp.i64;
-		iLastTimestamp.i64 = now;
-		aOld->iLastRunTime.i64 = now;
-		aOld->iTotalCpuTime.i64 += delta;
-		++iReschedCount.i64;
-		++aNew->iRunCount.i64;
-		if (!aOld->iActiveState)
-			aOld->iTotalActiveTime.i64 += (now - aOld->iLastActivationTime.i64);
-		NSchedulable* parent = aOld->iParent;
-		if (parent != aOld)
-			{
-			parent->iLastRunTime.i64 = now;
-			if (!parent->iActiveState)
-				parent->iTotalActiveTime.i64 += (now - parent->iLastActivationTime.i64);
-			if (parent != aNew->iParent)
-				parent->iTotalCpuTime.i64 += (now - parent->iLastStartTime.i64);
-			}
-		NSchedulable* np = aNew->iParent;
-		if (np!=aNew && np!=parent)
-			np->iLastStartTime.i64 = now;
-		}
-	}
-#endif
-
--- a/kernel/eka/nkernsmp/arm/ncthrd.cia	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/arm/ncthrd.cia	Wed Sep 01 12:34:56 2010 +0100
@@ -966,7 +966,6 @@
 	asm("ldr	r1, [r6, #%a0]" : : "i" (_FOFF(NThreadBase,iPauseCount)-_FOFF(NThreadBase,iWaitState)));
 	asm("sub	r0, r6, #%a0" : : "i" _FOFF(NThreadBase,iWaitState));	// r0 = Thread()
 	asm("movs	r1, r1, lsl #16 ");				// check if iPauseCount=iSuspendCount=0
-	asm("andeq	r1, r4, #%a0" : : "i" ((TInt)EWtStObstructed));
 	asm("bleq	ReadyT__12NSchedulableUi ");	// if so, make thread ready
 	asm("0:		");
 	asm("mov	r0, #0 ");
--- a/kernel/eka/nkernsmp/arm/ncthrd.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/arm/ncthrd.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -36,7 +36,7 @@
 extern "C" void ExcFault(TAny*);
 
 extern TUint32 __mpid();
-extern void InitTimestamp(TSubScheduler* aSS, SNThreadCreateInfo& aInfo);
+extern void InitAPTimestamp(SNThreadCreateInfo& aInfo);
 
 TInt NThread::Create(SNThreadCreateInfo& aInfo, TBool aInitial)
 	{
@@ -44,22 +44,19 @@
 	__NK_ASSERT_ALWAYS((aInfo.iParameterBlockSize&0x80000007)==0);
 	__NK_ASSERT_ALWAYS(aInfo.iStackBase && aInfo.iStackSize>=aInfo.iParameterBlockSize+KNThreadMinStackSize);
 	TInt cpu = -1;
-	TSubScheduler* ss = 0;
 	new (this) NThread;
 	if (aInitial)
 		{
 		cpu = __e32_atomic_add_ord32(&TheScheduler.iNumCpus, 1);
 		aInfo.iCpuAffinity = cpu;
 		// OK since we can't migrate yet
-		ss = &TheSubSchedulers[cpu];
-		ss->iCurrentThread = this;
-		ss->iDeferShutdown = 0;
-		iRunCount.i64 = UI64LIT(1);
-		iActiveState = 1;
-		__KTRACE_OPT(KBOOT,DEBUGPRINT("Init: cpu=%d ss=%08x", cpu, ss));
+		TSubScheduler& ss = TheSubSchedulers[cpu];
+		ss.iCurrentThread = this;
+		iRunCount64 = UI64LIT(1);
+		__KTRACE_OPT(KBOOT,DEBUGPRINT("Init: cpu=%d ss=%08x", cpu, &ss));
 		if (cpu)
 			{
-			initialiseState(cpu,ss);
+			initialiseState(cpu,&ss);
 
 			ArmLocalTimer& T = LOCAL_TIMER;
 			T.iWatchdogDisable = E_ArmTmrWDD_1;
@@ -72,10 +69,9 @@
 			NIrq::HwInit2AP();
 			T.iTimerCtrl = E_ArmTmrCtrl_IntEn | E_ArmTmrCtrl_Reload | E_ArmTmrCtrl_Enable;
 
-			__e32_atomic_ior_ord32(&TheScheduler.iThreadAcceptCpus, 1<<cpu);
-			__e32_atomic_ior_ord32(&TheScheduler.iIpiAcceptCpus, 1<<cpu);
+			__e32_atomic_ior_ord32(&TheScheduler.iActiveCpus1, 1<<cpu);
+			__e32_atomic_ior_ord32(&TheScheduler.iActiveCpus2, 1<<cpu);
 			__e32_atomic_ior_ord32(&TheScheduler.iCpusNotIdle, 1<<cpu);
-			__e32_atomic_add_ord32(&TheScheduler.iCCRequestLevel, 1);
 			__KTRACE_OPT(KBOOT,DEBUGPRINT("AP MPID=%08x",__mpid()));
 			}
 		else
@@ -132,37 +128,14 @@
 		{
 		NKern::EnableAllInterrupts();
 
-#if defined(__CPU_ARM_HAS_GLOBAL_TIMER_BLOCK) && defined(__NKERN_TIMESTAMP_USE_SCU_GLOBAL_TIMER__)
-
-		if (cpu == 0) 
-			{
-			// start global timer if necessary
-			ArmGlobalTimer& GT = GLOBAL_TIMER;
-			if (!(GT.iTimerCtrl & E_ArmGTmrCtrl_TmrEnb))
-				{
-				// timer not currently enabled
-				GT.iTimerCtrl = 0;
-				__e32_io_completion_barrier();
-				GT.iTimerStatus = E_ArmGTmrStatus_Event;
-				__e32_io_completion_barrier();
-				GT.iTimerCountLow = 0;
-				GT.iTimerCountHigh = 0;
-				__e32_io_completion_barrier();
-				GT.iTimerCtrl = E_ArmGTmrCtrl_TmrEnb;	// enable timer with prescale factor of 1
-				__e32_io_completion_barrier();
-				}
-			}
-		
-#endif
-
 		// start local timer
 		ArmLocalTimer& T = LOCAL_TIMER;
 		T.iTimerCtrl = E_ArmTmrCtrl_IntEn | E_ArmTmrCtrl_Reload | E_ArmTmrCtrl_Enable;
-		// Initialise timestamp
-		InitTimestamp(ss, aInfo);
+
+		// synchronize AP's timestamp with BP's
+		if (cpu>0)
+			InitAPTimestamp(aInfo);
 		}
-	AddToEnumerateList();
-	InitLbInfo();
 #ifdef BTRACE_THREAD_IDENTIFICATION
 	BTrace4(BTrace::EThreadIdentification,BTrace::ENanoThreadCreate,this);
 #endif
@@ -211,7 +184,7 @@
 	TInt irq = NKern::DisableAllInterrupts();
 	TSubScheduler& ss = SubScheduler();
 	NThreadBase* ct = ss.iCurrentThread;
-	TInt inc = TInt(ss.iSSX.iIrqNestCount);
+	TInt inc = TInt(ss.i_IrqNestCount);
 	TInt cpu = ss.iCpuNum;
 	TInt klc = ss.iKernLockCount;
 	NKern::RestoreInterrupts(irq);
@@ -679,7 +652,7 @@
 	if (pC != this)
 		{
 		AcqSLock();
-		if (iWaitState.ThreadIsDead() || i_NThread_Initial)
+		if (iWaitState.ThreadIsDead())
 			{
 			RelSLock();
 			aAvailRegistersMask = 0;
@@ -867,7 +840,7 @@
 	if (pC != this)
 		{
 		AcqSLock();
-		if (iWaitState.ThreadIsDead() || i_NThread_Initial)
+		if (iWaitState.ThreadIsDead())
 			{
 			RelSLock();
 			aRegMask = 0;
@@ -1084,14 +1057,36 @@
 	return 0;
 	}
 
+/** Return the total CPU time so far used by the specified thread.
+
+	@return The total CPU time in units of 1/NKern::CpuTimeMeasFreq().
+*/
+EXPORT_C TUint64 NKern::ThreadCpuTime(NThread* aThread)
+	{
+	TSubScheduler* ss = 0;
+	NKern::Lock();
+	aThread->AcqSLock();
+	if (aThread->i_NThread_Initial)
+		ss = &TheSubSchedulers[aThread->iLastCpu];
+	else if (aThread->iReady && aThread->iParent->iReady)
+		ss = &TheSubSchedulers[aThread->iParent->iReady & NSchedulable::EReadyCpuMask];
+	if (ss)
+		ss->iReadyListLock.LockOnly();
+	TUint64 t = aThread->iTotalCpuTime64;
+	if (aThread->iCurrent || (aThread->i_NThread_Initial && !ss->iCurrentThread))
+		t += (NKern::Timestamp() - ss->iLastTimestamp64);
+	if (ss)
+		ss->iReadyListLock.UnlockOnly();
+	aThread->RelSLock();
+	NKern::Unlock();
+	return t;
+	}
 
 TInt NKern::QueueUserModeCallback(NThreadBase* aThread, TUserModeCallback* aCallback)
 	{
 	__e32_memory_barrier();
 	if (aCallback->iNext != KUserModeCallbackUnqueued)
 		return KErrInUse;
-	if (aThread->i_NThread_Initial)
-		return KErrArgument;
 	TInt result = KErrDied;
 	NKern::Lock();
 	TUserModeCallback* listHead = aThread->iUserModeCallbacks;
--- a/kernel/eka/nkernsmp/arm/ncutilf.cia	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/arm/ncutilf.cia	Wed Sep 01 12:34:56 2010 +0100
@@ -21,6 +21,7 @@
 #include <arm_tmr.h>
 
 
+
 __NAKED__ void Arm::GetUserSpAndLr(TAny*) 
 	{
 	asm("stmia	r0, {r13, r14}^ ");
@@ -286,125 +287,38 @@
 #endif
 
 
-#if defined(__NKERN_TIMESTAMP_USE_LOCAL_TIMER__)
-#error Use of local timer for NKern::Timestamp() no longer supported
+
+/** Get the current value of the system timestamp
 
-#elif defined(__NKERN_TIMESTAMP_USE_SCU_GLOBAL_TIMER__)
-// Code to access global timer in Cortex A9 r1p0
-
-#ifndef	__CPU_ARM_HAS_GLOBAL_TIMER_BLOCK
-#error NKern::Timestamp() wants global timer, but global timer not present.
-#endif
-
+@publishedPartner
+@prototype
+*/
 EXPORT_C __NAKED__ TUint64 NKern::Timestamp()
 	{
 	asm("ldr	r3, __TheScheduler ");
 	asm("mrs	r12, cpsr ");				// r12 = saved interrupt mask
-	asm("stmfd	sp!, {r4-r7} ");
-	asm("ldr	r4, [r3, #%a0]" : : "i" _FOFF(TScheduler,iSX.iGlobalTimerAddr));		// r4 points to global timer
+	asm("ldr	r2, [r3, #%a0]" : : "i" _FOFF(TScheduler,i_LocalTimerAddr));	// r2 points to local timer
 	__ASM_CLI();							// disable all interrupts
-	asm("ldr	r6, [r3, #%a0]" : : "i" _FOFF(TScheduler,iSX.iCount0));					// r6 = count value of last frequency change (low)
-	asm("ldr	r7, [r3, #%a0]" : : "i" (_FOFF(TScheduler,iSX.iCount0)+4));				// r7 = count value of last frequency change (high)
-	asm("ldr	r2, [r4, #%a0]" : : "i" _FOFF(ArmGlobalTimer,iTimerCountHigh));			// r2 = current timer counter high word
-
-	// To read 64 bit timer value, read high, low, high
-	// If two high values match -> OK, else repeat
-	asm("1:		");
-	asm("mov	r1, r2 ");					// r1 = previous value of timer counter high word
-	asm("ldr	r0, [r4, #%a0]" : : "i" _FOFF(ArmGlobalTimer,iTimerCountLow));			// r0 = current timer counter low word
-	asm("ldr	r2, [r4, #%a0]" : : "i" _FOFF(ArmGlobalTimer,iTimerCountHigh));			// r2 = current timer counter high word
-	asm("mov	r5, r3 ");					// r5 = &TheScheduler
-	asm("cmp	r1, r2 ");					// high word changed?
-	asm("bne	1b ");						// if so, retry
-
-	// Now have R1:R0 = 64 bit global timer count
-	asm("ldr	r3, [r5, #%a0]" : : "i" _FOFF(TScheduler,iSX.iGTimerFreqRI.iI.iM));		// r3 = period multiplier
-	asm("ldrsh	r4, [r5, #%a0]" : : "i" _FOFF(TScheduler,iSX.iGTimerFreqRI.iI.iX));		// r4 = period multiplier shift
-	asm("subs	r6, r0, r6 ");				// r7:r6 = ticks from last frequency change
-	asm("sbcs	r7, r1, r7 ");
-	asm("umull	r0, r1, r6, r3 ");
-	asm("mov	r2, #0 ");
-	asm("umlal	r1, r2, r7, r3 ");			// r2:r1:r0 = delta * period multiplier
-	asm("ldr	r6, [r5, #%a0]!" : : "i" _FOFF(TScheduler,iSX.iTimestamp0));			// r6 = timestamp at last freq change (low)
-	asm("ldr	r7, [r5, #4] ");														// r7 = timestamp at last freq change (high)
+	GET_RWNO_TID(,r3);						// r3 -> TSubScheduler
+	asm("ldr	r1, [r2, #%a0]" : : "i" _FOFF(ArmLocalTimer,iTimerCount));		// r1 = current timer counter
+	asm("ldr	r0, [r3, #%a0]" : : "i" _FOFF(TSubScheduler,i_LastTimerSet));	// r0 = last value written to timer counter
+	asm("ldr	r2, [r3, #%a0]" : : "i" _FOFF(TSubScheduler,i_TimerMultI));		// r2 = scaling factor
+	asm("sub	r0, r0, r1 ");				// elapsed timer ticks since last timestamp sync
+	asm("umull	r1, r2, r0, r2 ");			// r2:r1 = elapsed ticks * scaling factor
+	asm("ldr	r0, [r3, #%a0]!" : : "i" _FOFF(TSubScheduler,iLastTimestamp64));	// r0 = last timestamp sync point, low word
+	asm("ldr	r3, [r3, #4] ");			// r3 = last timestamp sync point, high word
+	asm("adds	r1, r1, #0x00800000 ");		// add 2^23 (rounding)
+	asm("adcs	r2, r2, #0 ");
+	asm("mov	r1, r1, lsr #24 ");			// divide by 2^24
+	asm("orr	r1, r1, r2, lsl #8 ");		// r1 = elapsed time since last timestamp sync
 	asm("msr	cpsr, r12 ");				// restore interrupts
-	asm("rsb	r4, r4, #0 ");
-	asm("rsb	r3, r4, #32 ");
-	asm("movs	r0, r0, lsr r4 ");			// rounding bit into C
-	asm("orr	r0, r0, r1, lsl r3 ");
-	asm("mov	r1, r1, lsr r4 ");
-	asm("orr	r1, r1, r2, lsl r3 ");		// r1:r0 = (delta * period multiplier) >> period multiplier shift
-	asm("adcs	r0, r0, r6 ");				// scaled delta + timestamp at last freq change
-	asm("adcs	r1, r1, r7 ");
-	asm("ldmfd	sp!, {r4-r7} ");
+	asm("adds	r0, r0, r1 ");				// r1:r0 = last timestamp sync point + elapsed time since last timestamp sync
+	asm("adcs	r1, r3, #0 ");
 	__JUMP(,lr);
-
 	asm("__TheScheduler: ");
 	asm(".word	%a0" : : "i" ((TInt)&TheScheduler));
 	}
 
-// Compensate for a change of frequency of the clocking driving the ARM Global Timer
-// Call with interrupts disabled
-__NAKED__ void ArmGlobalTimerFreqChg(const SRatioInv* /*aNewGTimerFreqRI*/)
-	{
-	asm("ldr	r3, __TheScheduler ");
-	asm("stmfd	sp!, {r4-r7} ");
-	asm("ldr	r4, [r3, #%a0]" : : "i" _FOFF(TScheduler,iSX.iGlobalTimerAddr));		// r4 points to global timer
-	asm("ldr	r6, [r3, #%a0]" : : "i" _FOFF(TScheduler,iSX.iCount0));					// r6 = count value of last frequency change (low)
-	asm("ldr	r7, [r3, #%a0]" : : "i" (_FOFF(TScheduler,iSX.iCount0)+4));				// r7 = count value of last frequency change (high)
-	asm("ldr	r12, [r4, #%a0]" : : "i" _FOFF(ArmGlobalTimer,iTimerCountHigh));		// r12 = current timer counter high word
-	asm("mov	r5, r3 ");					// r5 = &TheScheduler
-
-	// To read 64 bit timer value, read high, low, high
-	// If two high values match -> OK, else repeat
-	asm("1:		");
-	asm("mov	r3, r12 ");					// r3 = previous value of timer counter high word
-	asm("ldr	r2, [r4, #%a0]" : : "i" _FOFF(ArmGlobalTimer,iTimerCountLow));			// r0 = current timer counter low word
-	asm("ldr	r12, [r4, #%a0]" : : "i" _FOFF(ArmGlobalTimer,iTimerCountHigh));		// r12 = current timer counter high word
-	asm("cmp	r3, r12 ");					// high word changed?
-	asm("bne	1b ");						// if so, retry
-
-	// Now have R3:R2 = 64 bit global timer count
-	asm("str	r2, [r5, #%a0]" : : "i" _FOFF(TScheduler,iSX.iCount0));					// update count value at last frequency change
-	asm("str	r3, [r5, #%a0]" : : "i" (_FOFF(TScheduler,iSX.iCount0)+4));				// to be equal to current count value
-	asm("subs	r6, r2, r6 ");				// r7:r6 = ticks (at old frequency) from last frequency change
-	asm("sbcs	r7, r3, r7 ");
-	asm("ldr	r3, [r5, #%a0]" : : "i" _FOFF(TScheduler,iSX.iGTimerFreqRI.iI.iM));		// r3 = old period multiplier
-	asm("ldrsh	r4, [r5, #%a0]" : : "i" _FOFF(TScheduler,iSX.iGTimerFreqRI.iI.iX));		// r4 = old period multiplier shift
-	asm("ldmia	r0, {r0,r1,r2,r12} ");		// r1:r0=new frequency multiplier, r12:r2=new period multiplier
-	asm("str	r0, [r5, #%a0]" : : "i" _FOFF(TScheduler,iSX.iGTimerFreqRI.iR.iM));		// update frequency multiplier
-	asm("str	r1, [r5, #%a0]" : : "i" _FOFF(TScheduler,iSX.iGTimerFreqRI.iR.iX));		// update frequency multiplier
-	asm("str	r2, [r5, #%a0]" : : "i" _FOFF(TScheduler,iSX.iGTimerFreqRI.iI.iM));		// update period multiplier
-	asm("str	r12, [r5, #%a0]" : : "i" _FOFF(TScheduler,iSX.iGTimerFreqRI.iI.iX));	// update period multiplier
-	asm("umull	r0, r1, r6, r3 ");
-	asm("mov	r2, #0 ");
-	asm("umlal	r1, r2, r7, r3 ");			// r2:r1:r0 = delta * old period multiplier
-	asm("ldr	r6, [r5, #%a0]!" : : "i" _FOFF(TScheduler,iSX.iTimestamp0));			// r6 = timestamp at last freq change (low)
-	asm("ldr	r7, [r5, #4] ");														// r7 = timestamp at last freq change (high)
-	asm("rsb	r4, r4, #0 ");
-	asm("rsb	r3, r4, #32 ");
-	asm("movs	r0, r0, lsr r4 ");			// rounding bit into C
-	asm("orr	r0, r0, r1, lsl r3 ");
-	asm("mov	r1, r1, lsr r4 ");
-	asm("orr	r1, r1, r2, lsl r3 ");		// r1:r0 = (delta * old period multiplier) >> old period multiplier shift
-	asm("adcs	r0, r0, r6 ");				// scaled delta + timestamp at last freq change
-	asm("adcs	r1, r1, r7 ");
-	asm("stmia	r5, {r0,r1} ");				// timestamp at last freq change = now
-	__DATA_MEMORY_BARRIER_Z__(r12);			/* Ensure all updates visible */
-	asm("ldmfd	sp!, {r4-r7} ");
-	__JUMP(,lr);
-	}
-
-#elif defined(__NKERN_TIMESTAMP_USE_INLINE_BSP_CODE__)
-#define __DEFINE_NKERN_TIMESTAMP_ASM__
-#include <variant_timestamp.h>
-#undef __DEFINE_NKERN_TIMESTAMP_ASM__
-#elif defined(__NKERN_TIMESTAMP_USE_BSP_CALLOUT__)
-// Code to call function defined in variant
-#else
-#error No definition for NKern::Timestamp()
-#endif
-
 
 extern "C" __NAKED__ TLinAddr get_sp_svc()
 	{
@@ -445,7 +359,7 @@
 
 	asm("1:		");
 	GET_RWNO_TID(,r3);
-	asm("ldr	r2, [r3, #%a0]" : : "i" _FOFF(TSubScheduler,iSSX.iFiqStackTop));	// if so, r2->top of FIQ stack
+	asm("ldr	r2, [r3, #%a0]" : : "i" _FOFF(TSubScheduler,i_FiqStackTop));	// if so, r2->top of FIQ stack
 	asm("ldr	r0, [r2, #-4] ");			// get return address
 	asm("msr	cpsr, r1 ");
 	__JUMP(,	lr);
@@ -680,15 +594,9 @@
 	__JUMP(,lr);
 
 	asm("2: ");
-	asm("ldr	r1, __CrashState ");
 	ARM_WFE;
-	asm("ldr	r1, [r1] ");				/* check for system crash while we were waiting */
-	asm("cmp	r1, #0 ");
-	asm("bne	9f ");
-	asm("ldrb	r1, [r0, #0] ");			/* read out count again */
-	asm("b		3b ");
-	asm("9:		");
-	__ASM_CRASH();							/* system crashed while we were waiting */
+	asm("ldrb r1, [r0, #0] ");				/* read out count again */
+	asm("b 3b ");
 	}
 
 __NAKED__ EXPORT_C void TSpinLock::UnlockIrq()
@@ -707,7 +615,7 @@
 __NAKED__ EXPORT_C TBool TSpinLock::FlashIrq()
 	{
 	GET_RWNO_TID(,r12);						/* r12 -> TSubScheduler */
-	asm("ldr r12, [r12, #%a0]" : : "i" _FOFF(TSubScheduler,iSSX.iGicCpuIfcAddr));
+	asm("ldr r12, [r12, #%a0]" : : "i" _FOFF(TSubScheduler,i_GicCpuIfcAddr));
 	asm("ldrh r1, [r0, #0] ");
 	asm("ldr r3, [r12, #%a0]" : : "i" _FOFF(GicCpuIfc,iHighestPending));
 	asm("sub r1, r1, r1, lsr #8 ");			/* r1 low byte = (out - in) mod 256 */
@@ -747,15 +655,9 @@
 	__JUMP(,lr);
 
 	asm("2: ");
-	asm("ldr	r1, __CrashState ");
 	ARM_WFE;
-	asm("ldr	r1, [r1] ");				/* check for system crash while we were waiting */
-	asm("cmp	r1, #0 ");
-	asm("bne	9f ");
-	asm("ldrb	r1, [r0, #0] ");			/* read out count again */
-	asm("b		3b ");
-	asm("9:		");
-	__ASM_CRASH();							/* system crashed while we were waiting */
+	asm("ldrb r1, [r0, #0] ");				/* read out count again */
+	asm("b 3b ");
 	}
 
 __NAKED__ EXPORT_C void TSpinLock::UnlockOnly()
@@ -811,15 +713,9 @@
 	__JUMP(,lr);
 
 	asm("2: ");
-	asm("ldr	r1, __CrashState ");
 	ARM_WFE;
-	asm("ldr	r1, [r1] ");				/* check for system crash while we were waiting */
-	asm("cmp	r1, #0 ");
-	asm("bne	9f ");
-	asm("ldrb	r1, [r0, #0] ");			/* read out count again */
-	asm("b		3b ");
-	asm("9:		");
-	__ASM_CRASH();							/* system crashed while we were waiting */
+	asm("ldrb r1, [r0, #0] ");				/* read out count again */
+	asm("b 3b ");
 	}
 
 __NAKED__ EXPORT_C void TSpinLock::UnlockIrqRestore(TInt)
@@ -841,7 +737,7 @@
 __NAKED__ EXPORT_C TBool TSpinLock::FlashIrqRestore(TInt)
 	{
 	GET_RWNO_TID(,r12);						/* r12 -> TSubScheduler */
-	asm("ldr r12, [r12, #%a0]" : : "i" _FOFF(TSubScheduler,iSSX.iGicCpuIfcAddr));
+	asm("ldr r12, [r12, #%a0]" : : "i" _FOFF(TSubScheduler,i_GicCpuIfcAddr));
 	asm("ldrh r2, [r0, #0] ");
 	asm("ldr r3, [r12, #%a0]" : : "i" _FOFF(GicCpuIfc,iHighestPending));
 	asm("sub r2, r2, r2, lsr #8 ");			/* r2 low byte = (out - in) mod 256 */
@@ -883,9 +779,6 @@
 	asm("bl " CSM_ZN9TSpinLock8LockOnlyEv);
 	asm("mov r0, #1 ");
 	asm("ldr pc, [sp], #4 ");
-
-	asm("__CrashState: ");
-	asm(".word	%a0" : : "i" ((TInt)&CrashState));
 	}
 
 
@@ -1268,15 +1161,9 @@
 	__JUMP(,lr);
 
 	asm("2: ");
-	asm("ldr	r1, __CrashState ");
 	ARM_WFE;
-	asm("ldr	r1, [r1] ");				/* check for system crash while we were waiting */
-	asm("cmp	r1, #0 ");
-	asm("bne	9f ");
-	asm("ldr	r1, [r0, #0] ");			/* read out.w count again */
-	asm("b		3b ");
-	asm("9:		");
-	__ASM_CRASH();							/* system crashed while we were waiting */
+	asm("ldr r1, [r0, #0] ");				/* read out.w count again */
+	asm("b 3b ");
 	}
 
 __NAKED__ EXPORT_C void TRWSpinLock::UnlockIrqR()
@@ -1298,7 +1185,7 @@
 __NAKED__ EXPORT_C TBool TRWSpinLock::FlashIrqR()
 	{
 	GET_RWNO_TID(,r12);						/* r12 -> TSubScheduler */
-	asm("ldr r12, [r12, #%a0]" : : "i" _FOFF(TSubScheduler,iSSX.iGicCpuIfcAddr));
+	asm("ldr r12, [r12, #%a0]" : : "i" _FOFF(TSubScheduler,i_GicCpuIfcAddr));
 	asm("ldr r2, [r0, #0] ");
 	asm("ldr r3, [r12, #%a0]" : : "i" _FOFF(GicCpuIfc,iHighestPending));
 	asm("eor r2, r2, r2, lsr #16 ");		/* r2 low byte = out.w ^ in.w = 0 if no writers waiting */
@@ -1343,15 +1230,9 @@
 	__JUMP(,lr);
 
 	asm("2: ");
-	asm("ldr	r1, __CrashState ");
 	ARM_WFE;
-	asm("ldr	r1, [r1] ");				/* check for system crash while we were waiting */
-	asm("cmp	r1, #0 ");
-	asm("bne	9f ");
-	asm("ldr	r1, [r0, #0] ");			/* read out count again */
-	asm("b		3b ");
-	asm("9:		");
-	__ASM_CRASH();							/* system crashed while we were waiting */
+	asm("ldr r1, [r0, #0] ");				/* read out count again */
+	asm("b 3b ");
 	}
 
 __NAKED__ EXPORT_C void TRWSpinLock::UnlockIrqW()
@@ -1370,7 +1251,7 @@
 __NAKED__ EXPORT_C TBool TRWSpinLock::FlashIrqW()
 	{
 	GET_RWNO_TID(,r12);						/* r12 -> TSubScheduler */
-	asm("ldr r12, [r12, #%a0]" : : "i" _FOFF(TSubScheduler,iSSX.iGicCpuIfcAddr));
+	asm("ldr r12, [r12, #%a0]" : : "i" _FOFF(TSubScheduler,i_GicCpuIfcAddr));
 	asm("ldr r2, [r0, #0] ");
 	asm("ldr r3, [r12, #%a0]" : : "i" _FOFF(GicCpuIfc,iHighestPending));
 	asm("add r2, r2, #0x00010000 ");		/* increment out.w */
@@ -1419,15 +1300,9 @@
 	__JUMP(,lr);
 
 	asm("2: ");
-	asm("ldr	r1, __CrashState ");
 	ARM_WFE;
-	asm("ldr	r1, [r1] ");				/* check for system crash while we were waiting */
-	asm("cmp	r1, #0 ");
-	asm("bne	9f ");
-	asm("ldr	r1, [r0, #0] ");			/* read out.w count again */
-	asm("b		3b ");
-	asm("9:		");
-	__ASM_CRASH();							/* system crashed while we were waiting */
+	asm("ldr r1, [r0, #0] ");				/* read out.w count again */
+	asm("b 3b ");
 	}
 
 __NAKED__ EXPORT_C void TRWSpinLock::UnlockOnlyR()
@@ -1487,15 +1362,9 @@
 	__JUMP(,lr);
 
 	asm("2: ");
-	asm("ldr	r1, __CrashState ");
 	ARM_WFE;
-	asm("ldr	r1, [r1] ");				/* check for system crash while we were waiting */
-	asm("cmp	r1, #0 ");
-	asm("bne	9f ");
-	asm("ldr	r1, [r0, #0] ");			/* read out count again */
-	asm("b		3b ");
-	asm("9:		");
-	__ASM_CRASH();							/* system crashed while we were waiting */
+	asm("ldr r1, [r0, #0] ");				/* read out count again */
+	asm("b 3b ");
 	}
 
 __NAKED__ EXPORT_C void TRWSpinLock::UnlockOnlyW()
@@ -1559,15 +1428,9 @@
 	__JUMP(,lr);
 
 	asm("2: ");
-	asm("ldr	r1, __CrashState ");
 	ARM_WFE;
-	asm("ldr	r1, [r1] ");				/* check for system crash while we were waiting */
-	asm("cmp	r1, #0 ");
-	asm("bne	9f ");
-	asm("ldr	r1, [r0, #0] ");			/* read out.w count again */
-	asm("b		3b ");
-	asm("9:		");
-	__ASM_CRASH();							/* system crashed while we were waiting */
+	asm("ldr r1, [r0, #0] ");				/* read out.w count again */
+	asm("b 3b ");
 	}
 
 __NAKED__ EXPORT_C void TRWSpinLock::UnlockIrqRestoreR(TInt)
@@ -1592,7 +1455,7 @@
 __NAKED__ EXPORT_C TBool TRWSpinLock::FlashIrqRestoreR(TInt)
 	{
 	GET_RWNO_TID(,r12);						/* r12 -> TSubScheduler */
-	asm("ldr r12, [r12, #%a0]" : : "i" _FOFF(TSubScheduler,iSSX.iGicCpuIfcAddr));
+	asm("ldr r12, [r12, #%a0]" : : "i" _FOFF(TSubScheduler,i_GicCpuIfcAddr));
 	asm("ldr r2, [r0, #0] ");
 	asm("ldr r3, [r12, #%a0]" : : "i" _FOFF(GicCpuIfc,iHighestPending));
 	asm("eor r2, r2, r2, lsr #16 ");		/* r2 low byte = out.w ^ in.w = 0 if no writers waiting */
@@ -1639,15 +1502,9 @@
 	__JUMP(,lr);
 
 	asm("2: ");
-	asm("ldr	r1, __CrashState ");
 	ARM_WFE;
-	asm("ldr	r1, [r1] ");				/* check for system crash while we were waiting */
-	asm("cmp	r1, #0 ");
-	asm("bne	9f ");
-	asm("ldr	r1, [r0, #0] ");			/* read out count again */
-	asm("b		3b ");
-	asm("9:		");
-	__ASM_CRASH();							/* system crashed while we were waiting */
+	asm("ldr r1, [r0, #0] ");				/* read out count again */
+	asm("b 3b ");
 	}
 
 __NAKED__ EXPORT_C void TRWSpinLock::UnlockIrqRestoreW(TInt)
@@ -1669,7 +1526,7 @@
 __NAKED__ EXPORT_C TBool TRWSpinLock::FlashIrqRestoreW(TInt)
 	{
 	GET_RWNO_TID(,r12);						/* r12 -> TSubScheduler */
-	asm("ldr r12, [r12, #%a0]" : : "i" _FOFF(TSubScheduler,iSSX.iGicCpuIfcAddr));
+	asm("ldr r12, [r12, #%a0]" : : "i" _FOFF(TSubScheduler,i_GicCpuIfcAddr));
 	asm("ldr r2, [r0, #0] ");
 	asm("ldr r3, [r12, #%a0]" : : "i" _FOFF(GicCpuIfc,iHighestPending));
 	asm("add r2, r2, #0x00010000 ");		/* increment out.w */
--- a/kernel/eka/nkernsmp/arm/ncutils.cia	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/arm/ncutils.cia	Wed Sep 01 12:34:56 2010 +0100
@@ -190,28 +190,26 @@
 	{
 	SET_RWNO_TID(,r1);
 	__ASM_CLI_MODE(MODE_ABT);
-	asm("str	sp, [r1, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iAbtStackTop));
+	asm("str	sp, [r1, #%a0]" : : "i" _FOFF(TSubScheduler, i_AbtStackTop));
 	asm("mvn	r3, #0 ");
 	asm("str	r3, [sp, #%a0]" : : "i" _FOFF(SFullArmRegSet, iExcCode));
-	asm("str	r3, [r1, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iIrqNestCount));
+	asm("str	r3, [r1, #%a0]" : : "i" _FOFF(TSubScheduler, i_IrqNestCount));
 	__ASM_CLI_MODE(MODE_UND);
-	asm("str	sp, [r1, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iUndStackTop));
+	asm("str	sp, [r1, #%a0]" : : "i" _FOFF(TSubScheduler, i_UndStackTop));
 	__ASM_CLI_MODE(MODE_FIQ);
-	asm("str	sp, [r1, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iFiqStackTop));
+	asm("str	sp, [r1, #%a0]" : : "i" _FOFF(TSubScheduler, i_FiqStackTop));
 	__ASM_CLI_MODE(MODE_IRQ);
-	asm("str	sp, [r1, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iIrqStackTop));
+	asm("str	sp, [r1, #%a0]" : : "i" _FOFF(TSubScheduler, i_IrqStackTop));
 	__ASM_CLI_MODE(MODE_SVC);
 	asm("ldr	r2, __TheScheduler ");
-	asm("ldr	r3, [r2, #%a0]" : : "i" _FOFF(TScheduler, iSX.iScuAddr));
-	asm("str	r3, [r1, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iScuAddr));
-	asm("ldr	r3, [r2, #%a0]" : : "i" _FOFF(TScheduler, iSX.iGicDistAddr));
-	asm("str	r3, [r1, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iGicDistAddr));
-	asm("ldr	r3, [r2, #%a0]" : : "i" _FOFF(TScheduler, iSX.iGicCpuIfcAddr));
-	asm("str	r3, [r1, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iGicCpuIfcAddr));
-	asm("ldr	r3, [r2, #%a0]" : : "i" _FOFF(TScheduler, iSX.iLocalTimerAddr));
-	asm("str	r3, [r1, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iLocalTimerAddr));
-	asm("ldr	r3, [r2, #%a0]" : : "i" _FOFF(TScheduler, iSX.iGlobalTimerAddr));
-	asm("str	r3, [r1, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iGlobalTimerAddr));
+	asm("ldr	r3, [r2, #%a0]" : : "i" _FOFF(TScheduler, i_ScuAddr));
+	asm("str	r3, [r1, #%a0]" : : "i" _FOFF(TSubScheduler, i_ScuAddr));
+	asm("ldr	r3, [r2, #%a0]" : : "i" _FOFF(TScheduler, i_GicDistAddr));
+	asm("str	r3, [r1, #%a0]" : : "i" _FOFF(TSubScheduler, i_GicDistAddr));
+	asm("ldr	r3, [r2, #%a0]" : : "i" _FOFF(TScheduler, i_GicCpuIfcAddr));
+	asm("str	r3, [r1, #%a0]" : : "i" _FOFF(TSubScheduler, i_GicCpuIfcAddr));
+	asm("ldr	r3, [r2, #%a0]" : : "i" _FOFF(TScheduler, i_LocalTimerAddr));
+	asm("str	r3, [r1, #%a0]" : : "i" _FOFF(TSubScheduler, i_LocalTimerAddr));
 	asm("mov	r3, #0 ");
 	SET_RWRO_TID(,r3);
 	SET_RWRW_TID(,r3);
@@ -240,7 +238,7 @@
 	GET_RWNO_TID(,r0);
 	asm("cmp	r0, #0 ");
 	asm("ldreq	r0, __SS0 ");
-	asm("ldr	r0, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iRegs));
+	asm("ldr	r0, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,i_Regs));
 	asm("cmp	r0, #0 ");
 	asm("ldreq	r0, __DefaultRegs ");
 	asm("ldr	r1, [r0, #%a0]" : : "i" _FOFF(SFullArmRegSet, iExcCode));
@@ -277,8 +275,8 @@
 	asm("streq	r2, [r1] ");
 	asm("beq	skip_other_cores ");		// If subscheduler not yet set, don't bother with other cores
 	asm("ldr	r2, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, iCpuMask));
-	asm("ldr	r5, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iGicCpuIfcAddr));
-//	asm("ldr	r4, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iRegs));
+	asm("ldr	r5, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, i_GicCpuIfcAddr));
+//	asm("ldr	r4, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,i_Regs));
 	asm("bic	sp, sp, #4 ");				// align stack to multiple of 8
 
 	__DATA_MEMORY_BARRIER_Z__(r6);
@@ -295,7 +293,7 @@
 	// we weren't first to crash, so wait here for a crash IPI
 	// disable all interrupts except for CRASH_IPI
 	GET_RWNO_TID(,r0);
-	asm("ldr	r0, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iGicCpuIfcAddr));
+	asm("ldr	r0, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, i_GicCpuIfcAddr));
 	asm("mov	r1, #0 ");
 	asm("1: ");
 	asm("add	r1, r1, #1 ");
@@ -314,9 +312,9 @@
 	asm("first_to_crash: ");
 	asm("ldr	r2, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, iScheduler));
 	asm("ldr	r7, __CrashStateOut ");
-	asm("ldr	r3, [r2, #%a0]" : : "i" _FOFF(TScheduler, iIpiAcceptCpus));
+	asm("ldr	r3, [r2, #%a0]" : : "i" _FOFF(TScheduler, iActiveCpus1));
 	asm("str	r3, [r7] ");			// mask of CPUs pending
-	asm("ldr	r5, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iGicDistAddr));
+	asm("ldr	r5, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, i_GicDistAddr));
 	asm("ldr	r1, __CrashIPIWord ");
 	__DATA_SYNC_BARRIER_Z__(r6);
 	asm("str	r1, [r5, #%a0]" : : "i" _FOFF(GicDistributor, iSoftIrq));	// send CRASH_IPI to all other CPUs
@@ -1038,52 +1036,7 @@
 	asm("mov	r0, #0"); //Kernel side not implemented yet
 	}
 
-#ifdef 	__CPU_ARM_HAS_WFE_SEV
-
-extern "C" __NAKED__ void __arm_wfe()
-	{
-	ARM_WFE;
-	__JUMP(,	lr);
-	}
-
-extern "C" __NAKED__ void __arm_sev()
-	{
-	ARM_SEV;
-	__JUMP(,	lr);
-	}
-
-#endif
-
-// Called by a CPU which has completed its detach sequence and should now be powered off
-// Doesn't return - just waits for power to be removed
-// CPU will come back up via the reset vector when it next wakes up.
-// NOTE: On entry the CPU caches are disabled and the CPU does not participate in coherency
-// SO BE VERY CAREFUL
-extern "C" __NAKED__ void DetachComplete()
-	{
-	GET_RWNO_TID(,r0);
-	asm("ldr	r1, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, iUncached));
-	asm("ldr	r2, [r1, #%a0]" : : "i" _FOFF(SPerCpuUncached, iDetachCompleteCpus));
-	asm("ldr	r3, [r0, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iGicDistAddr));
-	__DATA_SYNC_BARRIER_Z__(r12);		// need DSB before sending any IPI
-	asm("mov	r2, r2, lsl #16 ");
-	asm("orr	r2, r2, #%a0" : : "i" ((TInt)INDIRECT_POWERDOWN_IPI_VECTOR));
-	asm("str	r2, [r3, #%a0]" : : "i" _FOFF(GicDistributor, iSoftIrq));	// trigger IPIs
-
-	asm("wait_forever: ");
-	__DATA_SYNC_BARRIER__(r12);
-	ARM_WFE;
-	__DATA_SYNC_BARRIER__(r12);
-	asm("ldr	r2, [r1, #%a0]" : : "i" _FOFF(SPerCpuUncached, iPowerOnReq));
-	__DATA_SYNC_BARRIER__(r12);
-	asm("cmp	r2, #0xF000000F ");		// for 'fake' power down
-	asm("bne	wait_forever ");
-
-	asm("0:		");
-	__JUMP(,lr);
-	}
 
 
 
 
-
--- a/kernel/eka/nkernsmp/arm/ncutils.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/arm/ncutils.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -22,16 +22,9 @@
 #include <nk_irq.h>
 
 extern "C" {
-extern TUint KernCoreStats_EnterIdle(TUint aCore);
-extern void KernCoreStats_LeaveIdle(TInt aCookie,TUint aCore);
-
-extern void DetachComplete();
-extern void send_irq_ipi(TSubScheduler*, TInt);
+extern SVariantInterfaceBlock* VIB;
 }
 
-TInt ClockFrequenciesChanged();
-
-
 /******************************************************************************
  * Spin lock
  ******************************************************************************/
@@ -88,48 +81,37 @@
 void NKern::Init0(TAny* a)
 	{
 	__KTRACE_OPT(KBOOT,DEBUGPRINT("VIB=%08x", a));
-	SVariantInterfaceBlock* v = (SVariantInterfaceBlock*)a;
-	TheScheduler.iVIB = v;
-	__NK_ASSERT_ALWAYS(v && v->iVer==0 && v->iSize==sizeof(SVariantInterfaceBlock));
-	__KTRACE_OPT(KBOOT,DEBUGPRINT("iVer=%d iSize=%d", v->iVer, v->iSize));
-	__KTRACE_OPT(KBOOT,DEBUGPRINT("iMaxCpuClock=%08x %08x", I64HIGH(v->iMaxCpuClock), I64LOW(v->iMaxCpuClock)));
-	__KTRACE_OPT(KBOOT,DEBUGPRINT("iMaxTimerClock=%u", v->iMaxTimerClock));
-	__KTRACE_OPT(KBOOT,DEBUGPRINT("iScuAddr=%08x", v->iScuAddr));
-	__KTRACE_OPT(KBOOT,DEBUGPRINT("iGicDistAddr=%08x", v->iGicDistAddr));
-	__KTRACE_OPT(KBOOT,DEBUGPRINT("iGicCpuIfcAddr=%08x", v->iGicCpuIfcAddr));
-	__KTRACE_OPT(KBOOT,DEBUGPRINT("iLocalTimerAddr=%08x", v->iLocalTimerAddr));
-	__KTRACE_OPT(KBOOT,DEBUGPRINT("iGlobalTimerAddr=%08x", v->iGlobalTimerAddr));
+	VIB = (SVariantInterfaceBlock*)a;
+	__NK_ASSERT_ALWAYS(VIB && VIB->iVer==0 && VIB->iSize==sizeof(SVariantInterfaceBlock));
+	__KTRACE_OPT(KBOOT,DEBUGPRINT("iVer=%d iSize=%d", VIB->iVer, VIB->iSize));
+	__KTRACE_OPT(KBOOT,DEBUGPRINT("iMaxCpuClock=%08x %08x", I64HIGH(VIB->iMaxCpuClock), I64LOW(VIB->iMaxCpuClock)));
+	__KTRACE_OPT(KBOOT,DEBUGPRINT("iMaxTimerClock=%u", VIB->iMaxTimerClock));
+	__KTRACE_OPT(KBOOT,DEBUGPRINT("iScuAddr=%08x", VIB->iScuAddr));
+	__KTRACE_OPT(KBOOT,DEBUGPRINT("iGicDistAddr=%08x", VIB->iGicDistAddr));
+	__KTRACE_OPT(KBOOT,DEBUGPRINT("iGicCpuIfcAddr=%08x", VIB->iGicCpuIfcAddr));
+	__KTRACE_OPT(KBOOT,DEBUGPRINT("iLocalTimerAddr=%08x", VIB->iLocalTimerAddr));
 
 	TScheduler& s = TheScheduler;
-	s.iSX.iScuAddr = (ArmScu*)v->iScuAddr;
-	s.iSX.iGicDistAddr = (GicDistributor*)v->iGicDistAddr;
-	s.iSX.iGicCpuIfcAddr = (GicCpuIfc*)v->iGicCpuIfcAddr;
-	s.iSX.iLocalTimerAddr = (ArmLocalTimer*)v->iLocalTimerAddr;
-	s.iSX.iTimerMax = (v->iMaxTimerClock / 1);		// use prescaler value of 1
-#ifdef	__CPU_ARM_HAS_GLOBAL_TIMER_BLOCK
-	s.iSX.iGlobalTimerAddr = (ArmGlobalTimer*)v->iGlobalTimerAddr;
-	s.iSX.iGTimerFreqRI.Set(v->iGTimerFreqR);
-	v->iGTimerFreqR = 0;
-#endif
+	s.i_ScuAddr = (TAny*)VIB->iScuAddr;
+	s.i_GicDistAddr = (TAny*)VIB->iGicDistAddr;
+	s.i_GicCpuIfcAddr = (TAny*)VIB->iGicCpuIfcAddr;
+	s.i_LocalTimerAddr = (TAny*)VIB->iLocalTimerAddr;
+	s.i_TimerMax = (TAny*)(VIB->iMaxTimerClock / 1);		// use prescaler value of 1
 
 	TInt i;
 	for (i=0; i<KMaxCpus; ++i)
 		{
 		TSubScheduler& ss = TheSubSchedulers[i];
-		ss.iSSX.iCpuFreqRI.Set(v->iCpuFreqR[i]);
-		ss.iSSX.iTimerFreqRI.Set(v->iTimerFreqR[i]);
-
-		v->iCpuFreqR[i] = 0;
-		v->iTimerFreqR[i] = 0;
-		UPerCpuUncached* u = v->iUncached[i];
-		ss.iUncached = u;
-		u->iU.iDetachCount = 0;
-		u->iU.iAttachCount = 0;
-		u->iU.iPowerOffReq = FALSE;
-		u->iU.iDetachCompleteFn = &DetachComplete;
+		ss.i_TimerMultF = (TAny*)KMaxTUint32;
+		ss.i_TimerMultI = (TAny*)0x01000000u;
+		ss.i_CpuMult = (TAny*)KMaxTUint32;
+		ss.i_LastTimerSet = (TAny*)KMaxTInt32;
+		ss.i_TimestampError = (TAny*)0;
+		ss.i_TimerGap = (TAny*)16;
+		ss.i_MaxCorrection = (TAny*)64;
+		VIB->iTimerMult[i] = (volatile STimerMult*)&ss.i_TimerMultF;
+		VIB->iCpuMult[i] = (volatile TUint32*)&ss.i_CpuMult;
 		}
-	v->iFrqChgFn = &ClockFrequenciesChanged;
-	__e32_io_completion_barrier();
 	InterruptInit0();
 	}
 
@@ -171,21 +153,6 @@
 	ArmInterruptInfo.iFiqHandler=aHandler;
 	}
 
-/** Register the global Idle handler
-	Called by the base port at boot time to register a handler containing a pointer to
-	a function that is called by the Kernel when each core reaches idle.
-	Should not be called at any other time.
-
-	@param	aHandler Pointer to idle handler function
-	@param	aPtr Idle handler function argument
- */
-EXPORT_C void Arm::SetIdleHandler(TCpuIdleHandlerFn aHandler, TAny* aPtr)
-	{
-	ArmInterruptInfo.iCpuIdleHandler.iHandler = aHandler;
-	ArmInterruptInfo.iCpuIdleHandler.iPtr = aPtr;
-	ArmInterruptInfo.iCpuIdleHandler.iPostambleRequired = EFalse;
-	}
-
 extern void initialiseState(TInt aCpu, TSubScheduler* aSS);
 
 void Arm::Init1Interrupts()
@@ -264,15 +231,11 @@
 	return TheScheduler.iIdleGenerationCount;
 	}
 
-void NKern::DoIdle()
+void NKern::Idle()
 	{
 	TScheduler& s = TheScheduler;
 	TSubScheduler& ss = SubScheduler();	// OK since idle thread locked to CPU
-	SPerCpuUncached* u0 = &((UPerCpuUncached*)ss.iUncached)->iU;
 	TUint32 m = ss.iCpuMask;
-	TUint32 retire = 0;
-	TBool global_defer = FALSE;
-	TBool event_kick = FALSE;
 	s.iIdleSpinLock.LockIrq();
 	TUint32 orig_cpus_not_idle = __e32_atomic_and_acq32(&s.iCpusNotIdle, ~m);
 	if (orig_cpus_not_idle == m)
@@ -292,181 +255,22 @@
 			return;
 			}
 		}
-	TBool shutdown_check = !((s.iThreadAcceptCpus|s.iCCReactivateCpus) & m);
-	if (shutdown_check)
-		{
-		// check whether this CPU is ready to be powered off
-		s.iGenIPILock.LockOnly();
-		ss.iEventHandlerLock.LockOnly();
-		if ( !((s.iThreadAcceptCpus|s.iCCReactivateCpus) & m) && !ss.iDeferShutdown && !ss.iNextIPI && !ss.iEventHandlersPending)
-			{
-			for(;;)
-				{
-				if (s.iCCDeferCount)
-					{
-					global_defer = TRUE;
-					break;
-					}
-				if (s.iPoweringOff)
-					{
-					// another CPU might be in the process of powering off
-					SPerCpuUncached* u = &((UPerCpuUncached*)s.iPoweringOff->iUncached)->iU;
-					if (u->iDetachCount == s.iDetachCount)
-						{
-						// still powering off so we must wait
-						global_defer = TRUE;
-						break;
-						}
-					}
-				TUint32 more = s.CpuShuttingDown(ss);
-				retire = SCpuIdleHandler::ERetire;
-				if (more)
-					retire |= SCpuIdleHandler::EMore;
-				s.iPoweringOff = &ss;
-				s.iDetachCount = u0->iDetachCount;
-				break;
-				}
-			}
-		ss.iEventHandlerLock.UnlockOnly();
-		s.iGenIPILock.UnlockOnly();
-		}
-	if (!retire && ss.iCurrentThread->iSavedSP)
-		{
-		// rescheduled between entry to NKern::Idle() and here
-		// go round again to see if any more threads to pull from other CPUs
-		__e32_atomic_ior_ord32(&s.iCpusNotIdle, m);	// we aren't idle after all
-		s.iIdleSpinLock.UnlockIrq();
-		return;
-		}
-	if (global_defer)
-		{
-		// Don't WFI if we're only waiting for iCCDeferCount to reach zero or for
-		// another CPU to finish powering down since we might not get another IPI.
-		__e32_atomic_ior_ord32(&s.iCpusNotIdle, m);	// we aren't idle after all
-		s.iIdleSpinLock.UnlockIrq();
-		__snooze();
-		return;
-		}
 
 	// postamble happens here - interrupts cannot be reenabled
-	TUint32 arg = orig_cpus_not_idle & ~m;
-	if (arg == 0)
-		s.AllCpusIdle();
 	s.iIdleSpinLock.UnlockOnly();
-
-	TUint cookie = KernCoreStats_EnterIdle((TUint8)ss.iCpuNum);
-
-	arg |= retire;
-	NKIdle(arg);
+	NKIdle(orig_cpus_not_idle & ~m);
 
 	// interrupts have not been reenabled
 	s.iIdleSpinLock.LockOnly();
-
-	if (retire)
-		{
-		// we just came back from power down
-		SPerCpuUncached* u = &((UPerCpuUncached*)ss.iUncached)->iU;
-		u->iPowerOnReq = 0;
-		__e32_io_completion_barrier();
-		s.iGenIPILock.LockOnly();
-		ss.iEventHandlerLock.LockOnly();
-		s.iIpiAcceptCpus |= m;
-		s.iCCReactivateCpus |= m;
-		s.iCpusGoingDown &= ~m;
-		if (s.iPoweringOff == &ss)
-			s.iPoweringOff = 0;
-		if (ss.iEventHandlersPending)
-			event_kick = TRUE;
-		ss.iEventHandlerLock.UnlockOnly();
-		s.iGenIPILock.UnlockOnly();
-		}
-
-	TUint32 ci = __e32_atomic_ior_ord32(&s.iCpusNotIdle, m);
+	__e32_atomic_ior_ord32(&s.iCpusNotIdle, m);
 	if (ArmInterruptInfo.iCpuIdleHandler.iPostambleRequired)
 		{
 		ArmInterruptInfo.iCpuIdleHandler.iPostambleRequired = FALSE;
-		NKIdle(ci|m|SCpuIdleHandler::EPostamble);
-		}
-	if (ci == 0)
-		s.FirstBackFromIdle();
-
-	KernCoreStats_LeaveIdle(cookie, (TUint8)ss.iCpuNum);
-
-	if (retire)
-		{
-		s.iCCReactivateDfc.RawAdd();	// kick load balancer to give us some work
-		if (event_kick)
-			send_irq_ipi(&ss, EQueueEvent_Kick);	// so that we will process pending events
+		NKIdle(-1);
 		}
 	s.iIdleSpinLock.UnlockIrq();	// reenables interrupts
 	}
 
-TBool TSubScheduler::Detached()
-	{
-	SPerCpuUncached* u = &((UPerCpuUncached*)iUncached)->iU;
-	return u->iDetachCount != u->iAttachCount;
-	}
-
-TBool TScheduler::CoreControlSupported()
-	{
-	return TheScheduler.iVIB->iCpuPowerUpFn != 0;
-	}
-
-void TScheduler::CCInitiatePowerUp(TUint32 aCores)
-	{
-	TCpuPowerUpFn pUp = TheScheduler.iVIB->iCpuPowerUpFn;
-	if (pUp && aCores)
-		{
-		TInt i;
-		for (i=0; i<KMaxCpus; ++i)
-			{
-			if (aCores & (1u<<i))
-				{
-				TSubScheduler& ss = TheSubSchedulers[i];
-				SPerCpuUncached& u = ((UPerCpuUncached*)ss.iUncached)->iU;
-				u.iPowerOnReq = TRUE;
-				__e32_io_completion_barrier();
-				pUp(i, &u);
-
-				// wait for core to reattach
-				while (u.iDetachCount != u.iAttachCount)
-					{
-					__snooze();
-					}
-				}
-			}
-		}
-	}
-
-void TScheduler::CCIndirectPowerDown(TAny*)
-	{
-	TCpuPowerDownFn pDown = TheScheduler.iVIB->iCpuPowerDownFn;
-	if (pDown)
-		{
-		TInt i;
-		for (i=0; i<KMaxCpus; ++i)
-			{
-			TSubScheduler& ss = TheSubSchedulers[i];
-			SPerCpuUncached& u = ((UPerCpuUncached*)ss.iUncached)->iU;
-			if (u.iPowerOffReq)
-				{
-				pDown(i, &u);
-				__e32_io_completion_barrier();
-				u.iPowerOffReq = FALSE;
-				__e32_io_completion_barrier();
-				}
-			}
-		}
-	}
-
-// Called on any CPU which receives an indirect power down IPI
-extern "C" void handle_indirect_powerdown_ipi()
-	{
-	TScheduler& s = TheScheduler;
-	TSubScheduler& ss = SubScheduler();
-	if (s.iIpiAcceptCpus & ss.iCpuMask)
-		s.iCCPowerDownDfc.Add();
-	}
 
 EXPORT_C TUint32 NKern::CpuTimeMeasFreq()
 	{
@@ -484,7 +288,7 @@
  */
 EXPORT_C TInt NKern::TimesliceTicks(TUint32 aMicroseconds)
 	{
-	TUint32 mf32 = TheScheduler.iSX.iTimerMax;
+	TUint32 mf32 = (TUint32)TheScheduler.i_TimerMax;
 	TUint64 mf(mf32);
 	TUint64 ticks = mf*TUint64(aMicroseconds) + UI64LIT(999999);
 	ticks /= UI64LIT(1000000);
@@ -495,20 +299,6 @@
 	}
 
 
-#if defined(__NKERN_TIMESTAMP_USE_LOCAL_TIMER__)
-	// Assembler
-#elif defined(__NKERN_TIMESTAMP_USE_SCU_GLOBAL_TIMER__)
-	// Assembler
-#elif defined(__NKERN_TIMESTAMP_USE_INLINE_BSP_CODE__)
-#define __DEFINE_NKERN_TIMESTAMP_CPP__
-#include <variant_timestamp.h>
-#undef __DEFINE_NKERN_TIMESTAMP_CPP__
-#elif defined(__NKERN_TIMESTAMP_USE_BSP_CALLOUT__)
-	// Assembler
-#else
-#error No definition for NKern::Timestamp()
-#endif
-
 /** Get the frequency of counter queried by NKern::Timestamp().
 
 @publishedPartner
@@ -516,183 +306,6 @@
 */
 EXPORT_C TUint32 NKern::TimestampFrequency()
 	{
-#if defined(__NKERN_TIMESTAMP_USE_LOCAL_TIMER__)
-	// Use per-CPU local timer in Cortex A9 or ARM11MP
-	return TheScheduler.iSX.iTimerMax;
-#elif defined(__NKERN_TIMESTAMP_USE_SCU_GLOBAL_TIMER__)
-	// Use global timer in Cortex A9 r1p0
-	return TheScheduler.iSX.iTimerMax;
-#elif defined(__NKERN_TIMESTAMP_USE_INLINE_BSP_CODE__)
-	// Use code in <variant_timestamp.h> supplied by BSP
-	return KTimestampFrequency;
-#elif defined(__NKERN_TIMESTAMP_USE_BSP_CALLOUT__)
-	// Call function defined in variant
-#else
-#error No definition for NKern::TimestampFrequency()
-#endif
-	}
-
-/******************************************************************************
- * Notify frequency changes
- ******************************************************************************/
-
-struct SFrequencies
-	{
-	void Populate();
-	void Apply();
-	TBool AddToQueue();
-
-	SFrequencies*	iNext;
-	TUint32			iWhich;
-	SRatioInv		iNewCpuRI[KMaxCpus];
-	SRatioInv		iNewTimerRI[KMaxCpus];
-	SRatioInv		iNewGTimerRI;
-	NFastSemaphore*	iSem;
-
-	static SFrequencies* volatile Head;
-	};
-
-SFrequencies* volatile SFrequencies::Head;
-
-TBool SFrequencies::AddToQueue()
-	{
-	SFrequencies* h = Head;
-	do	{
-		iNext = h;
-		} while(!__e32_atomic_cas_rel_ptr(&Head, &h, this));
-	return !h;	// TRUE if list was empty
-	}
-
-
-void SFrequencies::Populate()
-	{
-	TScheduler& s = TheScheduler;
-	TInt cpu;
-	iWhich = 0;
-	SRatio* ri = (SRatio*)__e32_atomic_swp_ord_ptr(&s.iVIB->iGTimerFreqR, 0);
-	if (ri)
-		{
-		iNewGTimerRI.Set(ri);
-		iWhich |= 0x80000000u;
-		}
-	for (cpu=0; cpu<s.iNumCpus; ++cpu)
-		{
-		TSubScheduler& ss = *s.iSub[cpu];
-		ri = (SRatio*)__e32_atomic_swp_ord_ptr(&s.iVIB->iCpuFreqR[cpu], 0);
-		if (ri)
-			{
-			iNewCpuRI[cpu].Set(ri);
-			iWhich |= ss.iCpuMask;
-			}
-		ri = (SRatio*)__e32_atomic_swp_ord_ptr(&s.iVIB->iTimerFreqR[cpu], 0);
-		if (ri)
-			{
-			iNewTimerRI[cpu].Set(ri);
-			iWhich |= (ss.iCpuMask<<8);
-			}
-		}
+	return (TUint32)TheScheduler.i_TimerMax;
 	}
 
-#if defined(__NKERN_TIMESTAMP_USE_SCU_GLOBAL_TIMER__)
-extern void ArmGlobalTimerFreqChg(const SRatioInv* /*aNewGTimerFreqRI*/);
-#endif
-
-void SFrequencies::Apply()
-	{
-	if (!iWhich)
-		return;
-	TScheduler& s = TheScheduler;
-	TStopIPI ipi;
-	TUint32 stopped = ipi.StopCPUs();
-	TInt cpu;
-	TUint32 wait = 0;
-	for (cpu=0; cpu<s.iNumCpus; ++cpu)
-		{
-		TSubScheduler& ss = *s.iSub[cpu];
-		TUint32 m = 1u<<cpu;
-		TUint32 m2 = m | (m<<8);
-		if (stopped & m)
-			{
-			// CPU is running so let it update
-			if (iWhich & m2)
-				{
-				if (iWhich & m)
-					ss.iSSX.iNewCpuFreqRI = &iNewCpuRI[cpu];
-				if (iWhich & (m<<8))
-					ss.iSSX.iNewTimerFreqRI = &iNewTimerRI[cpu];
-				ss.iRescheduleNeededFlag = 1;
-				wait |= m;
-				}
-			}
-		else
-			{
-			// CPU is not running so update directly
-			if (iWhich & m)
-				{
-				ss.iSSX.iCpuFreqRI = iNewCpuRI[cpu];
-				}
-			if (iWhich & (m<<8))
-				{
-				ss.iSSX.iTimerFreqRI = iNewTimerRI[cpu];
-				}
-			}
-		}
-#if defined(__NKERN_TIMESTAMP_USE_SCU_GLOBAL_TIMER__)
-	if (iWhich & 0x80000000u)
-		{
-		ArmGlobalTimerFreqChg(&iNewGTimerRI);
-		}
-#endif
-	ipi.ReleaseCPUs();	// this CPU handled here
-	while(wait)
-		{
-		cpu = __e32_find_ls1_32(wait);
-		TSubScheduler& ss = *s.iSub[cpu];
-		if (!ss.iSSX.iNewCpuFreqRI && !ss.iSSX.iNewTimerFreqRI)
-			wait &= ~ss.iCpuMask;
-		__chill();
-		}
-	}
-
-void TScheduler::DoFrequencyChanged(TAny*)
-	{
-	SFrequencies* list = (SFrequencies*)__e32_atomic_swp_ord_ptr(&SFrequencies::Head, 0);
-	if (!list)
-		return;
-	list->Populate();
-	list->Apply();
-	SFrequencies* rev = 0;
-	while (list)
-		{
-		SFrequencies* next = list->iNext;
-		list->iNext = rev;
-		rev = list;
-		list = next;
-		}
-	while (rev)
-		{
-		NFastSemaphore* s = rev->iSem;
-		rev = rev->iNext;
-		NKern::FSSignal(s);
-		}
-	}
-
-TInt ClockFrequenciesChanged()
-	{
-	TScheduler& s = TheScheduler;
-	NFastSemaphore sem(0);
-	SFrequencies f;
-	f.iSem = &sem;
-	NThread* ct = NKern::CurrentThread();
-	NThread* lbt = TScheduler::LBThread();
-	NKern::ThreadEnterCS();
-	TBool first = f.AddToQueue();
-	if (!lbt || lbt == ct)
-		TScheduler::DoFrequencyChanged(&s);
-	else if (first)
-		s.iFreqChgDfc.Enque();
-	NKern::FSWait(&sem);
-	NKern::ThreadLeaveCS();
-	return KErrNone;
-	}
-
--- a/kernel/eka/nkernsmp/arm/vectors.cia	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/arm/vectors.cia	Wed Sep 01 12:34:56 2010 +0100
@@ -149,10 +149,11 @@
 	asm("beq	wait_for_any_request ");	// special case for Exec::WaitForAnyRequest
 	asm("ldr	r2, [r1, #%a0]" : : "i" _FOFF(NThread,iFastExecTable));
 	asm("ldr	r3, [r2], r12, lsr #7 ");	// r3=limit, r2->dispatch table entry
+	asm("ldr	r2, [r2] ");				// r2->kernel function
 	asm("cmp	r3, r12, lsr #9 ");			// r3-SWI number
-	asm("ldrhi	pc, [r2] ");				// if SWI number valid, call kernel function
+	__JUMP(hi,	r2);						// if SWI number valid, call kernel function
 	asm("mvn	r12, #0 ");					// put invalid SWI number into r12
-	asm("b		slow_swi ");				// go through slow SWI routine to call invalid SWI handler
+	asm("b		slow_swi ");					// go through slow SWI routine to call invalid SWI handler
 
 #ifndef __FAST_SEM_MACHINE_CODED__
 	asm("wait_for_any_request: ");
@@ -290,7 +291,7 @@
 #ifdef BTRACE_CPU_USAGE
 	asm("ldr	r10, __BTraceCpuUsageFilter ");
 #endif
-	asm("ldr	r7, [r4, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iIrqNestCount));
+	asm("ldr	r7, [r4, #%a0]" : : "i" _FOFF(TSubScheduler, i_IrqNestCount));
 	asm("ldrb	r0, [r4, #%a0]" : : "i" _FOFF(TSubScheduler, iEventHandlersPending));
 	__DATA_MEMORY_BARRIER_Z__(r2);
 #ifdef BTRACE_CPU_USAGE
@@ -315,7 +316,7 @@
 	asm("cmp	r2, #0x10 ");				// interrupted mode_usr ?
 	asm("cmpne	r2, #0x13 ");				// if not, interrupted mode_svc ?
 	asm("cmpeq	r0, #0 ");					// if mode_usr or mode_svc, is kernel locked?
-	asm("str	r7, [r4, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iIrqNestCount));
+	asm("str	r7, [r4, #%a0]" : : "i" _FOFF(TSubScheduler, i_IrqNestCount));
 	asm("bne	irq_kernel_locked_exit ");	// if neither or if kernel locked, exit immediately
 	asm("cmp	r1, #0 ");					// If not, IDFCs/reschedule pending?
 	asm("beq	irq_kernel_locked_exit ");	// if not, exit
@@ -380,7 +381,7 @@
 
 	asm("nested_irq_exit: ");
 	__ASM_CLI1();
-	asm("str	r7, [r4, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iIrqNestCount));
+	asm("str	r7, [r4, #%a0]" : : "i" _FOFF(TSubScheduler, i_IrqNestCount));
 #ifdef BTRACE_CPU_USAGE
 	asm("cmp	r10, #0 ");
 	asm("blne	btrace_irq_exit ");
@@ -766,7 +767,7 @@
 	asm("mov	r2, r0 ");
 	asm("cmp	r11, #0 ");
 	asm("ldreq	r11, __SS0 ");
-	asm("ldr	r0, [r11, #%a0]" : : "i" _FOFF(TSubScheduler,iSSX.iRegs));	// pass in address of stored registers
+	asm("ldr	r0, [r11, #%a0]" : : "i" _FOFF(TSubScheduler,i_Regs));	// pass in address of stored registers
 	asm("cmp	r0, #0 ");
 	asm("ldreq	r0, __DefaultRegs ");
 	asm("bl "	CSM_ZN3Arm9SaveStateER14SFullArmRegSet );
@@ -833,7 +834,7 @@
 	{
 	asm("movs	r0, r0, lsl #16 ");		// CPU mask into bits 16-23 - any bits set in aMask?
 	GET_RWNO_TID(ne,r3);
-	asm("ldrne	r2, [r3, #%a0]" : : "i" _FOFF(TSubScheduler, iSSX.iGicDistAddr));	// we assume i_GicDistAddr is the same for all CPUs
+	asm("ldrne	r2, [r3, #%a0]" : : "i" _FOFF(TSubScheduler, i_GicDistAddr));	// we assume i_GicDistAddr is the same for all CPUs
 	__DATA_SYNC_BARRIER_Z__(r1);			// need DSB before sending any IPI
 	asm("orrne	r0, r0, #%a0" : : "i" ((TInt)GENERIC_IPI_VECTOR));
 	asm("strne	r0, [r2, #%a0]" : : "i" _FOFF(GicDistributor, iSoftIrq));	// trigger IPIs if any
@@ -852,12 +853,12 @@
 extern "C" __NAKED__ void handle_crash_ipi()
 	{
 	GET_RWNO_TID(,r0);
-	asm("ldr	r0, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,iSSX.iRegs));
+	asm("ldr	r0, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,i_Regs));
 	asm("ldr	r0, [r0, #%a0]" : : "i" _FOFF(SFullArmRegSet, iExcCode));
 	asm("cmp	r0, #0 ");
 	asm("bge	state_already_saved ");		// skip if this CPU has already saved its state (i.e. already crashed)
 	GET_RWNO_TID(,r0);
-	asm("ldr	r0, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,iSSX.iRegs));
+	asm("ldr	r0, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,i_Regs));
 	asm("bl "	CSM_ZN3Arm9SaveStateER14SFullArmRegSet );	// save machine state (NOTE: R0 trashed)
 	asm("ldr	r1, [r0, #%a0]" : : "i" _FOFF(SFullArmRegSet, iN.iFlags));	// mode on entry
 	asm("and	r1, r1, #0x1f ");
--- a/kernel/eka/nkernsmp/dfcs.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/dfcs.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -765,23 +765,6 @@
 						}
 					ss->iExIDfcLock.UnlockOnly();
 					if (kick)
-						{
-						TScheduler& s = TheScheduler;
-						TUint32 cpuMask = 1u<<cpu;
-						if (!(s.iThreadAcceptCpus & cpuMask))	// deal with case where target CPU is shutting down or has already shut down
-							{
-							TInt irq = s.iGenIPILock.LockIrqSave();
-							if (!(s.iIpiAcceptCpus & cpuMask))
-								{
-								s.iCCReactivateCpus |= cpuMask;
-								kick = FALSE;
-								}
-							s.iGenIPILock.UnlockIrqRestore(irq);
-							if (!kick)
-								s.iCCReactivateDfc.DoEnque();	// arrange for target CPU to be powered on
-							}
-						}
-					if (kick)
 						send_resched_ipi(cpu);
 					NKern::EnableAllInterrupts();	// let interrupts in
 					if (orig >= 8)
--- a/kernel/eka/nkernsmp/nk_bal.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1539 +0,0 @@
-// Copyright (c) 2009-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:
-// e32\nkernsmp\nk_bal.cpp
-// 
-//
-
-// NThreadBase member data
-#define __INCLUDE_NTHREADBASE_DEFINES__
-
-// TDfc member data
-#define __INCLUDE_TDFC_DEFINES__
-
-#include "nk_bal.h"
-
-#include "nk_priv.h"
-#include "nk_irq.h"
-
-#include <e32cmn.h>
-
-/******************************************************************************
- * Load balancing
- ******************************************************************************/
-
-enum TCCState
-	{
-	ECCReqPending = 0x80000000u,
-	ECCReqDeferred = 0x40000000u,
-	ECCPowerUpInProgress = 0x20000000u,
-	ECCPowerDownInProgress = 0x10000000u,
-	ECCRebalanceRequired = 0x08000000u,
-	ECCRebalanceTimerQueued = 0x04000000u,
-	ECCPeriodicBalancingActive = 0x02000000u,
-	};
-
-const TUint K_CpuMask	= 0x1fu;
-const TUint K_Keep		= 0x20u;
-const TUint K_SameCpu	= 0x40u;
-const TUint K_NewCpu	= 0x80u;
-const TUint K_CpuSticky	= 0x40u;
-const TUint K_CheckCpu	= 0x100u;
-
-#define	PERCENT(fsd, percent)					(((fsd)*(percent)+50)/100)
-
-const TUint K_LB_HeavyThreshold					= PERCENT(4095, 90);
-const TUint K_LB_GravelThreshold_RunAvg			= PERCENT(4095, 1);
-const TUint K_LB_GravelThreshold_RunActAvg		= PERCENT(4095, 50);
-const TInt	K_LB_HeavyCapacityThreshold			= PERCENT(4095, 1);
-const TInt	K_LB_BalanceInterval				= 107;
-const TInt	K_LB_CpuLoadDiffThreshold			= 128;
-
-//const TUint K_LB_HeavyStateThreshold			= 128;
-const TUint K_LB_HeavyPriorityThreshold			= 25;
-
-inline TBool IsHeavy(NSchedulable* a)
-	{
-	TUint x = 0xffu ^ a->iLbInfo.iLbHeavy;
-	return (x&(x-1))==0;
-	}
-
-inline TBool IsNew(NSchedulable* a)
-	{ return a->iLbState & NSchedulable::ELbState_PerCpu; }
-
-struct SPerPri : public SDblQue
-	{
-	inline SPerPri() : iTotalRun(0), iTotalAct(0), iCount(0), iHeavy(0) {}
-
-	TUint32	iTotalRun;
-	TUint32	iTotalAct;
-	TUint16	iCount;
-	TUint16	iHeavy;
-	};
-
-struct SCpuAvailability
-	{
-	enum
-		{
-		EIdle = 4095,
-		EMaxedOut = -268435456,
-		EUnavailable = KMinTInt
-		};
-
-	void	Init(TUint32 aActive);
-	TInt	FindMax() const;
-	TInt	FindMax(NSchedulable* aS) const;
-	TInt	PickCpu(NSchedulable* aS, TBool aDropped) const;
-	TInt	SetMaxed(TInt aCpu);
-	void	AddLoad(TInt aCpu, TInt aLoad);
-	inline	TInt operator[](TInt aCpu) const
-		{	return iRemain[aCpu]; }
-	inline	TInt TotalRemain() const
-		{	return iTotalRemain; }
-
-	TInt	iRemain[KMaxCpus];
-	TInt	iCount;
-	TInt	iTotalRemain;
-	};
-
-TUint32 HotWarmUnit;
-TUint32 LB_DormantThreshold;
-volatile TUint32 LBDelayed = 0;
-
-void CalcHotWarm(TUint8& aOut, TUint64 aTime)
-	{
-	TUint8 out = 0;
-	if (aTime>0)
-		{
-		aTime /= TUint64(HotWarmUnit);
-		if (I64HIGH(aTime))
-			out = 255;
-		else
-			{
-			aTime *= aTime;
-			out = __e32_find_ms1_64(aTime) + 1;
-			}
-		}
-	aOut = (TUint8)out;
-	}
-
-void TScheduler::InitLB()
-	{
-	TScheduler& s = TheScheduler;
-	TDfcQue* rbQ = s.iRebalanceDfcQ;
-	s.iBalanceTimer.SetDfcQ(rbQ);
-	s.iCCReactivateDfc.SetDfcQ(rbQ);
-	s.iCCRequestDfc.SetDfcQ(rbQ);
-	s.iCCPowerDownDfc.SetDfcQ(rbQ);
-	s.iFreqChgDfc.SetDfcQ(rbQ);
-	NThreadBase* lbt = rbQ->iThread;
-	lbt->iRebalanceAttr = 1;
-	TUint32 f = NKern::CpuTimeMeasFreq();
-	HotWarmUnit = f / 1000000;
-	TUint8 y = 0;
-	CalcHotWarm(y, f/5);
-	LB_DormantThreshold = y;
-	__KTRACE_OPT(KBOOT,DEBUGPRINT("InitLB()"));
-	__KTRACE_OPT(KBOOT,DEBUGPRINT("LB_DormantThreshold=%d", LB_DormantThreshold));
-	}
-
-void TSubScheduler::GetLbThreads(SDblQue& aQ)
-	{
-	NKern::Lock();
-	iReadyListLock.LockOnly();
-	if (!iLbQ.IsEmpty())
-		{
-		aQ.MoveFrom(&iLbQ);
-		iLbCounter ^= NSchedulable::ELbState_Generation;
-		}
-	iReadyListLock.UnlockOnly();
-	NKern::Unlock();
-	}
-
-void TScheduler::GetLbThreads(SDblQue& aQ)
-	{
-	NKern::Lock();
-	iBalanceListLock.LockOnly();
-	if (!iBalanceList.IsEmpty())
-		{
-		aQ.MoveFrom(&iBalanceList);
-		iLbCounter ^= NSchedulable::ELbState_Generation;
-		}
-	iBalanceListLock.UnlockOnly();
-	NKern::Unlock();
-	}
-
-void NSchedulable::InitLbInfo()
-	{
-	}
-
-void NSchedulable::NominalPriorityChanged()
-	{
-	}
-
-void NSchedulable::LbDone(TUint aFlags)
-	{
-	BTrace8(BTrace::EHSched, BTrace::ELbDone, this, aFlags);
-#ifdef KSCHED3
-	if (IsGroup())
-		{
-		__KTRACE_OPT(KSCHED3,DEBUGPRINT("LbDone %G %x", this, aFlags));
-		}
-	else
-		{
-		__KTRACE_OPT(KSCHED3,DEBUGPRINT("LbDone %T %x", this, aFlags));
-		}
-#endif
-	TBool keep = aFlags & K_Keep;
-	TInt cpu = aFlags & K_CpuMask;
-	TBool setcpu = aFlags & K_NewCpu;
-	TBool keepcpu = aFlags & K_SameCpu;
-	TBool checkcpu = aFlags & K_CheckCpu;
-	LAcqSLock();
-	TBool died = iLbState & ELbState_ExtraRef;
-	if (keep && !died)
-		{
-		TScheduler& s = TheScheduler;
-		s.iBalanceListLock.LockOnly();
-		s.iBalanceList.Add(&iLbLink);
-		iLbState = s.iLbCounter;
-		s.iBalanceListLock.UnlockOnly();
-		if (setcpu)
-			SetCpuAffinityT(cpu | KCpuAffinityPref | (aFlags & K_CpuSticky));
-		else
-			{
-			if (!keepcpu)
-				iPreferredCpu = 0;
-			if (checkcpu)
-				SetCpuAffinityT(NTHREADBASE_CPU_AFFINITY_MASK);	// move it if it's on a core which is shutting down
-			}
-		}
-	else
-		{
-		if (!keepcpu)
-			iPreferredCpu = 0;
-		iLbState = ELbState_Inactive;
-		iLbLink.iNext = 0;
-		iLbInfo.iRecentTime.i64 = 0;
-		iLbInfo.iRecentCpuTime.i64 = 0;
-		iLbInfo.iRecentActiveTime.i64 = 0;
-		iLbInfo.iLbRunAvg = 0;
-		iLbInfo.iLbActAvg = 0;
-		iLbInfo.iLbRunActAvg = 0;
-		if (checkcpu && !died)
-			SetCpuAffinityT(NTHREADBASE_CPU_AFFINITY_MASK);	// move it if it's on a core which is shutting down
-		}
-	RelSLockU();
-	if (died)
-		{
-		NKern::Lock();
-		DropRef();
-		NKern::Unlock();
-		}
-	}
-
-void CalcRatio(TUint16& aRatio, TUint64 aN, TUint64 aD)
-	{
-	TInt ms1 = __e32_find_ms1_64(aD);
-	if (ms1 < 0)
-		{
-		aRatio = 4095;
-		return;
-		}
-	if (ms1 >= 20)
-		{
-		TInt shift = ms1 - 19;
-		aD >>= shift;
-		aN >>= shift;
-		}
-	// aD, aN now < 2^20
-	TUint32 d = I64LOW(aD);
-	TUint32 n = I64LOW(aN);
-	if (n>d) n=d;
-	TUint32 r = (n*4095+(d>>1))/d;
-	if (r>4095) r=4095;	// shouldn't really happen
-	aRatio = (TUint16)r;
-	}
-
-void CalcRatios(TUint16& aRT, TUint16& aAT, TUint16& aRA, TUint64 aDT, TUint64 aDR, TUint64 aDA)
-	{
-	TInt ms1 = __e32_find_ms1_64(aDT);
-	if (ms1 >= 20)
-		{
-		TInt shift = ms1 - 19;
-		aDT >>= shift;
-		aDR >>= shift;
-		aDA >>= shift;
-		}
-	// aDT, aDR, aDA now all < 2^20
-	TUint32 t = I64LOW(aDT);
-	TUint32 rtd = I64LOW(aDR);
-	TUint32 atd = I64LOW(aDA);
-	if (rtd>t) rtd=t;
-	if (atd>t) atd=t;
-	TUint32 rtt = (rtd*4095+(t>>1))/t;
-	TUint32 att = (atd*4095+(t>>1))/t;
-	TUint32 rta = atd ? (rtd*4095+(atd>>1))/atd : 0;
-	if (rta>4095) rta=4095;	// shouldn't really happen
-	aRT = (TUint16)rtt;
-	aAT = (TUint16)att;
-	aRA = (TUint16)rta;
-	}
-
-void NSchedulable::GetLbStats(TUint64 aTime)
-	{
-	SCpuStats stats;
-	LAcqSLock();
-	if (IsGroup())
-		{
-		NThreadGroup* g = (NThreadGroup*)this;
-		if (g->iNThreadList.IsEmpty())
-			iLbInfo.iLbNomPri = 1;
-		else
-			{
-			NThreadBase* t = (NThreadBase*)g->iNThreadList.First();
-			iLbInfo.iLbNomPri = t->iNominalPri;
-			}
-		}
-	else
-		iLbInfo.iLbNomPri = ((NThreadBase*)this)->iNominalPri;
-	GetCpuStatsT(E_AllStats, stats);
-	iLbInfo.iRecentTime.i64 += aTime;
-	iLbInfo.iRecentCpuTime.i64 += stats.iRunTimeDelta;
-	iLbInfo.iRecentActiveTime.i64 += stats.iActiveTimeDelta;
-	TUint32 aff = iCpuAffinity;
-	RelSLockU();
-	CalcRatios(iLbInfo.iLbRunTime, iLbInfo.iLbActTime, iLbInfo.iLbRunAct, aTime, stats.iRunTimeDelta, stats.iActiveTimeDelta);
-	iLbInfo.iLbRunAvg = TUint16((iLbInfo.iLbRunAvg + iLbInfo.iLbRunTime) >> 1);
-	iLbInfo.iLbActAvg = TUint16((iLbInfo.iLbActAvg + iLbInfo.iLbActTime) >> 1);
-	CalcRatio(iLbInfo.iLbRunActAvg, iLbInfo.iRecentCpuTime.i64, iLbInfo.iRecentActiveTime.i64);
-
-	if (aff & NTHREADBASE_CPU_AFFINITY_MASK)
-		iLbInfo.iLbAffinity = (TUint8)(aff & 0xff);
-	else
-		iLbInfo.iLbAffinity = 1u << aff;
-	CalcHotWarm(iLbInfo.iLbHot, stats.iLastRunTime);
-	CalcHotWarm(iLbInfo.iLbWarm, stats.iLastActiveTime);
-	if (IsNew(this))
-		{
-		if (iLbInfo.iLbNomPri <= K_LB_HeavyPriorityThreshold)
-			iLbInfo.iLbHeavy = 0xffu;
-		else
-			iLbInfo.iLbHeavy = 0;
-		}
-	iLbInfo.iLbHeavy >>= 1;
-	if (iLbInfo.iLbActTime > K_LB_HeavyThreshold)
-		iLbInfo.iLbHeavy |= 0x80u;
-/*
-	TUint64 blx = NKern::CpuTimeMeasFreq();
-	blx *= 3;
-	if (i_NSchedulable_Spare3 && iLbInfo.iLbRunActAvg<400 && stats.iActiveTime>blx)
-		{
-		__crash();
-		}
-*/	}
-
-void AddToSortedQueue(SPerPri* aQ, NSchedulable* aS)
-	{
-	TInt k = aS->iLbInfo.iLbNomPri;
-	if (k >= KNumPriorities)
-		k = KNumPriorities;
-	SPerPri* q = aQ + k;
-	TBool h = IsHeavy(aS);
-	SDblQueLink* anchor = &q->iA;
-	SDblQueLink* p = q->First();
-	for (; p!=anchor; p=p->iNext)
-		{
-		NSchedulable* s = _LOFF(p, NSchedulable, iLbLink);
-		if (h)
-			{
-			if (!IsHeavy(s))
-				continue;
-			if (aS->iLbInfo.iLbRunActAvg < s->iLbInfo.iLbRunActAvg)
-				break;
-			}
-		else
-			{
-			if (IsHeavy(s))
-				break;
-			if (aS->iLbInfo.iLbRunAvg > s->iLbInfo.iLbRunAvg)
-				break;
-			}
-		}
-	aS->iLbLink.InsertBefore(p);
-	++q->iCount;
-	if (h)
-		{
-		++q->iHeavy;
-		}
-	else
-		{
-		q->iTotalRun += aS->iLbInfo.iLbRunAvg;
-		if (q->iTotalRun>4095)
-			q->iTotalRun=4095;
-		q->iTotalAct += aS->iLbInfo.iLbActAvg;
-		}
-	}
-
-void SCpuAvailability::Init(TUint32 a)
-	{
-	iCount = __e32_find_ms1_32(a) + 1;
-	iTotalRemain = 0;
-	TInt i;
-	for (i=0; i<KMaxCpus; ++i)
-		{
-		if (a & (1<<i))
-			{
-			iRemain[i] = EIdle;
-			iTotalRemain += EIdle;
-			}
-		else
-			iRemain[i] = EUnavailable;
-		}
-	}
-
-TInt SCpuAvailability::SetMaxed(TInt aCpu)
-	{
-	TInt x = iRemain[aCpu];
-	if (x>0)
-		iTotalRemain -= x;
-	iRemain[aCpu] = EMaxedOut;
-	return x;
-	}
-
-void SCpuAvailability::AddLoad(TInt aCpu, TInt aLoad)
-	{
-	if (TUint32(aLoad) > TUint32(EIdle))
-		__crash();
-	TInt& x = iRemain[aCpu];
-	TInt orig = x;
-	x -= aLoad;
-	if (x < EMaxedOut)
-		x = EMaxedOut;
-	if (orig > 0)
-		iTotalRemain -= ((orig > aLoad) ? aLoad : orig);
-	}
-
-TInt SCpuAvailability::FindMax() const
-	{
-	TInt maxv = KMinTInt;
-	TInt maxi = -1;
-	TInt i;
-	for (i=0; i<iCount; ++i)
-		{
-		if (iRemain[i] > maxv)
-			{
-			maxv = iRemain[i];
-			maxi = i;
-			}
-		}
-	return maxi;
-	}
-
-TInt SCpuAvailability::FindMax(NSchedulable* aS) const
-	{
-	TUint32 s = aS->iLbInfo.iLbAffinity;
-	s &= TheScheduler.iThreadAcceptCpus;
-	if ( (s&(s-1)) == 0 )
-		return __e32_find_ms1_32(s);
-	TInt maxv = KMinTInt;
-	TInt maxi = -1;
-	TInt i = 0;
-	for (; s; s>>=1, ++i)
-		{
-		if ((s&1) && iRemain[i] > maxv)
-			{
-			maxv = iRemain[i];
-			maxi = i;
-			}
-		}
-	return maxi;
-	}
-
-TInt SCpuAvailability::PickCpu(NSchedulable* aS, TBool aDropped) const
-	{
-	TUint32 s0 = aS->iLbInfo.iLbAffinity & TheScheduler.iThreadAcceptCpus;
-	TUint32 s = s0;
-//	BTrace12(BTrace::EHSched, 0x90u, aS, s, aPtr);
-	if ( (s&(s-1)) == 0 )
-		return __e32_find_ms1_32(s);
-	TInt maxv = KMinTInt;
-	TInt maxi = -1;
-	TInt i = 0;
-	for (; s; s>>=1, ++i)
-		{
-//		BTrace12(BTrace::EHSched, 0x91u, s, maxv, aPtr[i]);
-		if ((s&1) && iRemain[i] > maxv)
-			{
-			maxv = iRemain[i];
-			maxi = i;
-			}
-		}
-	if (IsNew(aS))
-		{
-		// this thread hasn't run for a while
-		// pick the highest numbered CPU with a near-maximum availability
-		i = __e32_find_ms1_32(s0);
-		for (; i>maxi; --i)
-			{
-			if ( (s0&(1u<<i)) && maxv-iRemain[i]<K_LB_CpuLoadDiffThreshold)
-				return i;
-			}
-		}
-	else
-		{
-		// this thread has run recently - see if we can keep it on the same CPU
-		TInt threshold = aDropped ? 1 : (TInt)K_LB_CpuLoadDiffThreshold;
-		TInt lcpu = aS->iLastCpu;
-		if ( (s0&(1u<<lcpu)) && maxv-iRemain[lcpu]<threshold)
-			return lcpu;
-		}
-	// use highest availability CPU
-	return maxi;
-	}
-
-void TScheduler::BalanceTimerExpired(TAny* aPtr)
-	{
-	((TScheduler*)aPtr)->PeriodicBalance();
-	}
-
-TBool TScheduler::ReBalance(SDblQue& aQ, TBool aCC)
-	{
-	ModifyCCState(~ECCRebalanceRequired, 0);
-
-	SPerPri sbq[KNumPriorities+1];
-	NSchedulable* s = 0;
-	TInt i;
-	TUint64 now = NKern::Timestamp();
-	TUint64 lbt = iLastBalanceTime;
-	iLastBalanceTime = now;
-	TUint64 bpl = now - lbt;		// balance period length
-	TUint cc = aCC ? K_CheckCpu : 0;
-
-	TInt nact = __e32_bit_count_32(iThreadAcceptCpus);	// number of CPUs available
-
-	// aQ holds list of threads/groups to be considered
-	TInt ns = 0;	// number for further consideration
-	TInt nd = 0;	// number dropped this time round
-	SCpuAvailability avail;
-	avail.Init(iThreadAcceptCpus);
-	TUint32 gravel = 0;
-	TInt totalN = 0;
-	TInt checked = 0;
-	while (!aQ.IsEmpty())
-		{
-		NThread* t = 0;
-		++totalN;
-		s = _LOFF(aQ.First()->Deque(), NSchedulable, iLbLink);
-		if (!s->IsGroup())
-			{
-			t = (NThread*)s;
-			if (t->iRebalanceAttr & 1)
-				++checked;
-			}
-		s->GetLbStats(bpl);
-		if (
-			(s->iLbInfo.iLbWarm >= LB_DormantThreshold)	// hasn't run for a while
-		||	(s->iLbInfo.iLbWarm>0 && s->iLbInfo.iLbRunAvg<K_LB_GravelThreshold_RunAvg && s->iLbInfo.iLbRunActAvg>K_LB_GravelThreshold_RunActAvg)	// gravel
-		)
-			{
-			TUint32 a = s->iLbInfo.iLbAffinity;
-			if ( (a&(a-1)) == 0)
-				avail.AddLoad(__e32_find_ms1_32(a), s->iLbInfo.iLbRunAvg);
-			else
-				gravel += s->iLbInfo.iLbRunAvg;
-			if (!IsNew(s))
-				++nd;
-			s->LbDone(cc);		// drop it
-			}
-		else if (nact==1)
-			{
-			s->LbDone(cc|K_Keep);	// keep it but only 1 CPU so don't balance
-			}
-		else if (t && t->iCoreCycling)
-			{
-			s->LbDone(cc|K_Keep);	// keep it but don't balance
-			}
-		else
-			{
-			++ns;
-			AddToSortedQueue(&sbq[0], s);
-			}
-		}
-
-	gravel /= TUint(nact);
-	for (i=0; i<KMaxCpus; ++i)
-		{
-		if (iThreadAcceptCpus & (1<<i))
-			avail.AddLoad(i, gravel);
-		}
-	if (ns>0)
-		{
-		TInt k;
-		for (k=KNumPriorities; k>=0; --k)
-			{
-			SPerPri& q = sbq[k];
-			if (q.iCount==0)
-				{
-				__NK_ASSERT_ALWAYS(q.IsEmpty());
-				continue;
-				}
-			if (nact==0)
-				goto dump_remaining;
-			while (!q.IsEmpty())
-				{
-				s = _LOFF(q.First(), NSchedulable, iLbLink);
-//				BTrace12(BTrace::EHSched, 0x80u, s, s->iLbInfo.iLbRunAvg, s->iLbInfo.iLbRunActAvg);
-				if (IsHeavy(s))
-					break;
-				s->iLbLink.Deque();
-				TInt cpu = avail.PickCpu(s, nd);
-//				BTrace12(BTrace::EHSched, 0x81u, cpu, remain[cpu], totalremain);
-				avail.AddLoad(cpu, s->iLbInfo.iLbRunAvg);
-//				BTrace8(BTrace::EHSched, 0x82u, remain[cpu], totalremain);
-				s->LbDone(cc|K_Keep|K_NewCpu|cpu);
-				}
-			if (q.iHeavy > nact)
-				{
-				TInt hr = avail.TotalRemain() / q.iHeavy;
-				TInt n = q.iHeavy;
-				TInt j;
-				for (j=0; j<nact; ++j)
-					{
-					// don't bother about keeping same CPU since we must rotate
-					// threads between CPUs to even out the run times.
-					TInt cpu = avail.FindMax();
-//					BTrace12(BTrace::EHSched, 0x83u, cpu, remain[cpu], totalremain);
-					TInt capacity = avail.SetMaxed(cpu);
-//					BTrace8(BTrace::EHSched, 0x84u, remain[cpu], totalremain);
-					TInt nh = 0;
-					if (hr > K_LB_HeavyCapacityThreshold)
-						{
-						if (j == nact-1)
-							nh = n;
-						else
-							nh = capacity / hr;
-						}
-					else
-						nh = n / (nact-j);
-					n -= nh;
-					for (; nh>0; --nh)
-						{
-						if (q.IsEmpty())
-							__crash();
-						s = _LOFF(q.First()->Deque(), NSchedulable, iLbLink);
-						s->LbDone(cc|K_Keep|K_NewCpu|cpu);
-						}
-					}
-				nact = 0;
-				}
-			else
-				{
-				while (!q.IsEmpty())
-					{
-					s = _LOFF(q.First()->Deque(), NSchedulable, iLbLink);
-					TInt cpu = avail.PickCpu(s, nd);
-//					BTrace12(BTrace::EHSched, 0x85u, cpu, remain[cpu], totalremain);
-					avail.SetMaxed(cpu);
-//					BTrace8(BTrace::EHSched, 0x86u, remain[cpu], totalremain);
-					s->LbDone(cc|K_Keep|K_NewCpu|cpu);
-					--nact;
-					}
-				}
-			__NK_ASSERT_ALWAYS(q.IsEmpty());
-			if (nact==0)
-				{
-dump_remaining:
-				while (!q.IsEmpty())
-					{
-//					BTrace4(BTrace::EHSched, 0x87u, s);
-					s = _LOFF(q.First()->Deque(), NSchedulable, iLbLink);
-					s->LbDone(cc|K_Keep);	// keep it but lose preferred CPU
-					}
-				continue;
-				}
-			}
-		}
-
-	// return TRUE if the only threads which ran were this one and the NTimer thread
-	return (totalN==2 && checked==2);
-	}
-
-void TScheduler::PeriodicBalance()
-	{
-	iNeedBal = 0;
-	ModifyCCState( ~ECCRebalanceTimerQueued, 0 );
-	SDblQue rbq;	// raw balance queue
-	GetLbThreads(rbq);
-	TInt i;
-	for (i=0; i<iNumCpus; ++i)
-		iSub[i]->GetLbThreads(rbq);
-	TBool bored = ReBalance(rbq, FALSE);
-	if (!bored || iNeedBal)
-		StartRebalanceTimer(FALSE);
-	}
-
-
-void TScheduler::StartPeriodicBalancing()
-	{
-#ifdef KBOOT
-	__KTRACE_OPT(KBOOT,DEBUGPRINT("StartPeriodicBalancing()"));
-	TInt i;
-	for (i=0; i<KMaxCpus; ++i)
-		{
-		TSubScheduler& ss = TheSubSchedulers[i];
-		volatile TUint32* p = (volatile TUint32*)ss.iUncached;
-		__KTRACE_OPT(KBOOT,DEBUGPRINT("CPU %1d: iUncached=%08x -> %08x %08x %08x %08x", i, p, p[0], p[1], p[2], p[3]));
-		}
-#endif
-	TheScheduler.StartRebalanceTimer(TRUE);
-	}
-
-void TScheduler::StartRebalanceTimer(TBool aRestart)
-	{
-	TInt interval = K_LB_BalanceInterval;
-	TUint32 mask = aRestart ? (ECCRebalanceTimerQueued|ECCPeriodicBalancingActive) : (ECCRebalanceTimerQueued);
-	TUint32 orig = ModifyCCState(~mask, mask);
-	TUint32 ns = (orig &~ mask) ^ mask;
-	__KTRACE_OPT(KSCHED3,DEBUGPRINT("StrtRbTmr %08x %08x %08x", mask, orig, ns));
-	if ((ns & ECCPeriodicBalancingActive) && !(orig & ECCRebalanceTimerQueued))
-		{
-		TInt r = KErrArgument;
-		if (orig & ECCPeriodicBalancingActive)
-			{
-			r = iBalanceTimer.Again(interval);
-			if (r == KErrArgument)
-				{
-				++LBDelayed;	// so we can see if this happened
-				}
-			}
-		if (r == KErrArgument)
-			{
-			r = iBalanceTimer.OneShot(interval);
-			}
-		if (r != KErrNone)
-			__crash();
-		}
-	}
-
-void TScheduler::StopRebalanceTimer(TBool aTemp)
-	{
-	TUint32 mask = aTemp ? ECCRebalanceTimerQueued : (ECCRebalanceTimerQueued|ECCPeriodicBalancingActive);
-	TUint32 orig = ModifyCCState(~mask, 0);
-	__KTRACE_OPT(KSCHED3,DEBUGPRINT("StopRbTmr %08x %08x", mask, orig));
-	if (orig & ECCRebalanceTimerQueued)
-		iBalanceTimer.Cancel();
-	}
-
-
-
-/******************************************************************************
- * Core Control
- ******************************************************************************/
-
-/*
-
-TScheduler fields used for core control:
-
-iThreadAcceptCpus
-	Bit n = 1 iff CPU n is available to threads with no specific affinity.
-	Bits corresponding to existing CPUs are set at boot time.
-	Subsequently this word is only modified by load balancer thread.
-	Bit n is cleared when a decision is made to shut down core n.
-
-
-iIpiAcceptCpus
-	Bit n = 1 iff CPU n is accepting generic IPIs
-	Bits corresponding to existing CPUs are set at boot time.
-	Bit n is cleared when CPU n makes the decision to ask the idle handler to power down
-		At the same time, bit n of iCpusGoingDown is set.
-	Bit n is set when CPU n returns from the idle handler after waking up.
-	Protected by iGenIPILock
-
-iCpusComingUp
-	Bit n = 1 iff CPU n is in the process of powering up
-	All bits zero at boot
-	Bit n set when the load balancer decides to initiate power up of CPU n, provided iCCDeferCount==0
-	Bit n cleared when the load balancer sets iThreadAcceptCpus bit n
-	Protected by iGenIPILock
-
-iCpusGoingDown
-	Bit n = 1 iff CPU n is in the process of powering down and is no longer accepting IPIs
-	All bits zero at boot
-	Bit n is set when CPU n makes the decision to ask the idle handler to power down
-	?Bit n is cleared when?
-		- when TCoreCycler observes the CPU has detached
-		- when the load balancer observes the CPU has detached
-		- when the load balancer decides to reactivate the CPU
-	Protected by iGenIPILock
-
-iCCDeferCount
-	If this is positive CPUs being shut down will not proceed to clear iIpiAcceptCpus
-	In this case bits can be set in iIpiAcceptCpus but cannot be cleared.
-	Also (iIpiAcceptCpus|iCpusComingUp) remains constant
-	Protected by iGenIPILock
-
-iCCSyncCpus
-	Bit n = 1 iff a change has been made to iThreadAcceptCpus which CPU n should observe
-	but it has not yet observed it.
-	Bit n set by the load balancer after a change is made to iThreadAcceptCpus, provided bit n
-	is also set in iIpiAcceptCpus.
-	Bit n cleared when CPU n services the core control sync IPI if iKernCSLocked==0 or the
-	next time iKernCSLocked becomes zero otherwise.
-
-iCCReactivateCpus
-	Bit n = 1 if CPU n is being reactivated after being removed from iThreadAcceptCpus
-	Bit n is set if a thread is made ready, cannot be assigned to any active CPU on
-		account of affinity restrictions and is assigned to CPU n.
-	Bit n is also set when CPU n wakes up from being retired.
-	Protected by iGenIPILock
-
-iCCState
-	Bit 31 (ECCReqPending)	Set when an external request to change the number of cores is in progress
-
-iCCRequestLevel
-	The number of CPUs last requested to be active.
-
-iGenIPILock
-
-iCCSyncIDFC
-	Runs when all CPUs have observed a change to iThreadAcceptCpus
-
-iCCReactivateDfc
-	Runs whenever one or more bits have been set in iCCReactivateCpus
-
-iCCRequestDfc
-	Runs whenever a request is received to change the number of active cores
-
-TSubScheduler fields used for core control:
-
-
-*/
-
-void TScheduler::CCUnDefer()
-	{
-	TUint32 powerOn = 0;
-	TBool doDeferredReq = FALSE;
-	TInt irq = iGenIPILock.LockIrqSave();
-	if (--iCCDeferCount == 0)
-		{
-		// Kick cores waiting to power off
-		__holler();
-
-		// See if any cores are waiting to power on
-		powerOn = iCCReactivateCpus &~ iCpusComingUp;
-
-		// See if a core control request has been deferred
-		if (iCCState & ECCReqDeferred)
-			{
-			if (iCpusComingUp==0 && iCCReactivateCpus==0)
-				doDeferredReq = TRUE;
-			}
-		}
-	iGenIPILock.UnlockIrqRestore(irq);
-	if (powerOn)
-		iCCReactivateDfc.Enque();
-	if (doDeferredReq)
-		iCCRequestDfc.Enque();
-	}
-
-void TScheduler::CCSyncDone(TAny* aPtr)
-	{
-	NFastSemaphore* s = (NFastSemaphore*)aPtr;
-	s->Signal();
-	}
-
-void CCSyncIPI(TGenericIPI*)
-	{
-	TScheduler& s = TheScheduler;
-	TSubScheduler& ss = SubScheduler();
-	if (ss.iKernLockCount)
-		{
-		ss.iCCSyncPending = 1;
-		ss.iRescheduleNeededFlag = 1;
-		return;
-		}
-	TUint32 m = ss.iCpuMask;
-	if (__e32_atomic_and_ord32(&s.iCCSyncCpus, ~m)==m)
-		{
-		s.iCCSyncIDFC.Add();
-		}
-	}
-
-void TScheduler::ChangeThreadAcceptCpus(TUint32 aNewMask)
-	{
-	NThread* lbt = LBThread();
-	if (NKern::CurrentThread() != lbt)
-		__crash();
-	TInt irq = iGenIPILock.LockIrqSave();
-	++iCCDeferCount;
-	iThreadAcceptCpus = aNewMask;
-	TUint32 cpus = iIpiAcceptCpus;
-	iCCSyncCpus = cpus;
-	iCpusComingUp &= ~aNewMask;
-	iGenIPILock.UnlockIrqRestore(irq);
-
-	NFastSemaphore sem(0);
-	iCCSyncIDFC.iPtr = &sem;
-	TGenericIPI ipi;
-	ipi.Queue(&CCSyncIPI, cpus);
-
-	NKern::FSWait(&sem);
-	CCUnDefer();
-	}
-
-template<int N> struct Log2 {};
-
-TEMPLATE_SPECIALIZATION struct Log2<1> { enum {Log=0u}; };
-TEMPLATE_SPECIALIZATION struct Log2<2> { enum {Log=1u}; };
-TEMPLATE_SPECIALIZATION struct Log2<4> { enum {Log=2u}; };
-TEMPLATE_SPECIALIZATION struct Log2<8> { enum {Log=3u}; };
-TEMPLATE_SPECIALIZATION struct Log2<16> { enum {Log=4u}; };
-TEMPLATE_SPECIALIZATION struct Log2<32> { enum {Log=5u}; };
-
-
-class TCpuSet
-	{
-public:
-	enum {
-		EBitsPerTUint8Shift=3u,
-		EBitsPerTUint32Shift=EBitsPerTUint8Shift+Log2<sizeof(TUint32)>::Log,
-		EBitsPerTUint8=1u<<EBitsPerTUint8Shift,
-		EBitsPerTUint32=1u<<EBitsPerTUint32Shift,
-		EWords=1u<<(KMaxCpus-EBitsPerTUint32Shift),
-		EBytes=1u<<(KMaxCpus-EBitsPerTUint8Shift),
-		EBits=1u<<KMaxCpus,
-		};
-public:
-	TCpuSet(TUint32 aMask);
-	void Consider(TUint32 aAffinity);
-	TCpuSet& operator&=(const TCpuSet&);
-	TCpuSet& operator|=(const TCpuSet&);
-	TCpuSet& Not();
-	TBool IsEmpty() const;
-	TInt Profile(TInt* aOut) const;
-	TUint32 Select(TInt aDesiredNumber, TUint32 aCurrent, TUint32 aIgnore) const;
-private:
-	/**
-	Bitfield: Bit n	= bit (n%8) of byte INT(n/8)
-					= bit (n%32) of word INT(n/32)
-	Bit n is set if the subset S of CPUs represented by the bits of n in the
-	canonical way (i.e. x \in S <=> bit x of n = 1) is acceptable.
-	*/
-	TUint32	iMask[EWords];
-	};
-
-TCpuSet::TCpuSet(TUint32 aM)
-	{
-	memset(iMask, 0, sizeof(iMask));
-	TInt i;
-	TUint32 m=1;	// empty set only
-	for (i=0; i<EBitsPerTUint32Shift; ++i)
-		{
-		TUint32 ibit = 1u<<i;
-		if (aM & ibit)
-			m |= (m<<ibit);
-		}
-	iMask[0] = m;
-	for (; i<KMaxCpus; ++i)
-		{
-		TUint32 ibit = 1u<<i;
-		if (aM & ibit)
-			{
-			TInt ws = 1<<(i-EBitsPerTUint32Shift);
-			TInt j;
-			for (j=0; j<ws; ++j)
-				iMask[ws+j] = iMask[j];
-			}
-		}
-	}
-
-TCpuSet& TCpuSet::operator&=(const TCpuSet& aS)
-	{
-	TInt i;
-	for (i=0; i<EWords; ++i)
-		iMask[i] &= aS.iMask[i];
-	return *this;
-	}
-
-TCpuSet& TCpuSet::operator|=(const TCpuSet& aS)
-	{
-	TInt i;
-	for (i=0; i<EWords; ++i)
-		iMask[i] |= aS.iMask[i];
-	return *this;
-	}
-
-TCpuSet& TCpuSet::Not()
-	{
-	TInt i;
-	for (i=0; i<EWords; ++i)
-		iMask[i] = ~iMask[i];
-	return *this;
-	}
-
-TBool TCpuSet::IsEmpty() const
-	{
-	TInt i;
-	TUint32 x = 0;
-	for (i=0; i<EWords; ++i)
-		x |= iMask[i];
-	return !x;
-	}
-
-void TCpuSet::Consider(TUint32 aAffinity)
-	{
-	TUint32 am = AffinityToMask(aAffinity);
-	am &= EBits-1;
-	if (am == EBits-1 || am==0)
-		return;	// no restrictions
-
-	TCpuSet bad(am ^ (EBits-1));	// sets incompatible with aAffinity
-	TInt i;
-	for (i=0; i<EWords; ++i)
-		iMask[i] &= ~bad.iMask[i];	// knock out sets incompatible with aAffinity
-	}
-
-const TUint32 Pmask[6] =
-	{
-	0x00000001,			// no bits set
-	0x00010116,			// 1 bit set (10000, 01000, 00100, 00010, 00001 -> 16,8,4,2,1)
-	0x01161668,			// 2 bits set (11000, 10100, 10010, 10001, 01100, 01010, 01001, 00110, 00101, 00011 -> 24,20,18,17,12,10,9,6,5,3)
-	0x16686880,			// 3 bits set (11100, 11010, 11001, 10110, 10101, 10011, 01110, 01101, 01011, 00111 -> 28,26,25,22,21,19,14,13,11,7)
-	0x68808000,			// 4 bits set (11110, 11101, 11011, 10111, 01111 -> 30,29,27,23,15)
-	0x80000000			// 5 bits set
-	};
-
-/**
-	Sets aOut[n] = number of entries with n CPUs present (0<=n<=KMaxCpus)
-	Returns total number of entries
-*/
-TInt TCpuSet::Profile(TInt* aOut) const
-	{
-	TInt i,j;
-	TInt r = 0;
-	memset(aOut, 0, (KMaxCpus+1)*sizeof(TInt));
-	for (i=0; i<EWords; ++i)
-		{
-		TUint32 m = iMask[i];
-		if (!m)
-			continue;
-		TInt n1 = __e32_bit_count_32(i);
-		for (j=0; j<=EBitsPerTUint32Shift; ++j)
-			{
-			TInt dr = __e32_bit_count_32(m & Pmask[j]);
-			r += dr;
-			aOut[n1+j] += dr;
-			}
-		}
-	return r;
-	}
-
-/**
-	Given a desired number of active cores and the mask of currently
-	running cores, returns the new mask of active cores.
-*/
-TUint32 TCpuSet::Select(TInt aDesiredNumber, TUint32 aCurrent, TUint32 aIgnore) const
-	{
-	TInt max = __e32_bit_count_32(aCurrent);
-	if (aDesiredNumber > max)
-		return 0;
-	TInt profile[KMaxCpus+1] = {0};
-	Profile(profile);
-	TInt dn;
-	for (dn=aDesiredNumber; dn<=max && profile[dn]==0; ++dn)
-		{}
-	if (dn > max)
-		return 0;
-	TInt wix;
-	TUint32 bestMask = 0;
-	TInt bestDiff = KMaxTInt;
-	TInt stop = max - dn;
-	for (wix=0; wix<EWords; ++wix)
-		{
-		TUint32 candidate = wix << EBitsPerTUint32Shift;
-		TUint32 m = iMask[wix];
-		if (!m)
-			continue;
-		TInt n1 = __e32_bit_count_32(wix);
-		if (n1 > dn)
-			continue;
-		m &= Pmask[dn-n1];
-		for (; m; m>>=1, ++candidate)
-			{
-			if (!(m&1))
-				continue;
-			TUint32 diff = (candidate&~aIgnore) ^ aCurrent;
-			TInt wt = __e32_bit_count_32(diff);
-			if (wt < bestDiff)
-				{
-				bestDiff = wt;
-				bestMask = candidate;
-				if (bestDiff == stop)
-					{
-					wix = EWords;
-					break;
-					}
-				}
-			}
-		}
-	return bestMask;
-	}
-
-void NSchedulable::LbTransfer(SDblQue& aDestQ)
-	{
-	if (iLbState & ELbState_PerCpu)
-		{
-		TSubScheduler* ss = &TheSubSchedulers[iLbState & ELbState_CpuMask];
-		ss->iReadyListLock.LockOnly();
-		if (iLbState == ss->iLbCounter)
-			{
-			iLbLink.Deque();
-			}
-		ss->iReadyListLock.UnlockOnly();
-		}
-	else if ((iLbState & ELbState_CpuMask) == ELbState_Global)
-		{
-		TScheduler& s = TheScheduler;
-		s.iBalanceListLock.LockOnly();
-		if (iLbState == s.iLbCounter)
-			{
-			iLbLink.Deque();
-			}
-		s.iBalanceListLock.UnlockOnly();
-		}
-	else if (iLbState != ELbState_Inactive)
-		{
-		// shouldn't happen
-		__crash();
-		}
-	iLbState = ELbState_Temp;
-	aDestQ.Add(&iLbLink);
-	}
-
-void GetAll(SDblQue& aOutQ, SIterDQ* aInQ)
-	{
-	TScheduler& s = TheScheduler;
-	SIterDQIterator iter;
-	TInt maxSteps = NKern::NumberOfCpus() + 2;
-	TInt r;
-	NKern::Lock();
-	s.iEnumerateLock.LockOnly();
-	iter.Attach(aInQ);
-	FOREVER
-		{
-		SIterDQLink* link = 0;
-		r = iter.Step(link, maxSteps);
-		if (r == KErrEof)
-			break;
-		if (r == KErrNone)
-			{
-			NSchedulable* sch = _LOFF(link, NSchedulable, iEnumerateLink);
-			sch->AcqSLock();
-			sch->LbTransfer(aOutQ);
-			sch->RelSLock();
-			}
-		s.iEnumerateLock.FlashPreempt();
-		}
-	iter.Detach();
-	s.iEnumerateLock.UnlockOnly();
-	NKern::Unlock();
-	}
-
-void GetAll(SDblQue& aOutQ)
-	{
-	TScheduler& s = TheScheduler;
-	GetAll(aOutQ, &s.iAllGroups);
-	GetAll(aOutQ, &s.iAllThreads);
-/*
-	SDblQueLink* l0 = aOutQ.Last();
-	SDblQueLink* anchor = &aOutQ.iA;
-	GetLbThreads(aOutQ);
-	TInt i;
-	for (i=0; i<s.iNumCpus; ++i)
-		s.iSub[i]->GetLbThreads(aOutQ);
-	SDblQueLink* l = l0->iNext;
-	for (; l!=anchor; l=l->iNext)
-		{
-		NSchedulable* sch = _LOFF(l, NSchedulable, iLbLink);
-		sch->LAcqSLock();
-		sch->iLbState = (sch->iLbState & ELbState_ExtraRef) | ELbState_Temp;
-		sch->RelSLockU();
-		}
-*/
-	}
-
-void GetCpuSet(TCpuSet& aSet, SDblQue& aQ)
-	{
-	SDblQueLink* anchor = &aQ.iA;
-	SDblQueLink* l = aQ.First();
-	for (; l!=anchor; l=l->iNext)
-		{
-		NSchedulable* sch = _LOFF(l, NSchedulable, iLbLink);
-		if (!sch->IsGroup() && ((NThreadBase*)sch)->i_NThread_Initial )
-			continue;	// skip idle threads since they are locked to their respective CPU
-		TUint32 aff = sch->iCpuAffinity;
-		aSet.Consider(aff);
-		}
-	}
-
-
-void TScheduler::CCReactivateDfcFn(TAny* a)
-	{
-	((TScheduler*)a)->CCReactivate(0);
-	}
-
-void TScheduler::CCRequestDfcFn(TAny* a)
-	{
-	((TScheduler*)a)->CCRequest();
-	}
-
-void TScheduler::CCIpiReactivateFn(TAny* a)
-	{
-	((TScheduler*)a)->CCIpiReactivate();
-	}
-
-TUint32 TScheduler::ModifyCCState(TUint32 aAnd, TUint32 aXor)
-	{
-	TInt irq = iGenIPILock.LockIrqSave();
-	TUint32 orig = iCCState;
-	iCCState = (orig & aAnd) ^ aXor;
-	iGenIPILock.UnlockIrqRestore(irq);
-	return orig;
-	}
-
-
-/**
-Runs if a thread is made ready on a CPU marked for shutdown (apart from on
-account of core cycling) or if a core wakes up from shutdown.
-*/
-void TScheduler::CCReactivate(TUint32 aMore)
-	{
-	TUint32 startPowerUp = 0;		// cores which need to be powered up
-	TUint32 finishPowerUp = 0;		// cores which have just powered up
-	TInt irq = iGenIPILock.LockIrqSave();
-	iCCReactivateCpus |= aMore;
-	TUint32 cu = iCpusComingUp | iIpiAcceptCpus;
-	finishPowerUp = iCCReactivateCpus & cu;
-	iCCReactivateCpus &= ~finishPowerUp;
-	if (iCCDeferCount == 0)
-		{
-		startPowerUp = iCCReactivateCpus &~ cu;
-		iCCReactivateCpus = 0;
-		iCpusComingUp |= startPowerUp;
-		}
-	TUint32 ccs = iCCState;
-	iGenIPILock.UnlockIrqRestore(irq);
-	if (startPowerUp)
-		{
-		// Begin powering up cores
-		CCInitiatePowerUp(startPowerUp);
-		}
-	if (finishPowerUp)
-		{
-		// ?Rebalance load to new cores now or wait till next periodic?
-		ChangeThreadAcceptCpus(iThreadAcceptCpus | finishPowerUp);
-		if ((iThreadAcceptCpus & (iThreadAcceptCpus-1)) && !(ccs & ECCPeriodicBalancingActive))
-			{
-			// more than 1 core so restart periodic balancing
-			StartRebalanceTimer(TRUE);
-			}
-		if (startPowerUp == 0)
-			ModifyCCState(~ECCPowerUpInProgress, 0);
-		}
-	if (iNeedBal)
-		{
-		if ( (ccs & (ECCPeriodicBalancingActive|ECCRebalanceTimerQueued)) == ECCPeriodicBalancingActive)
-			{
-			StartRebalanceTimer(FALSE);
-			}
-		}
-	}
-
-extern "C" void wake_up_for_ipi(TSubScheduler* aSS, TInt)
-	{
-	TScheduler& s = *aSS->iScheduler;
-	if (__e32_atomic_ior_ord32(&s.iCCIpiReactivate, aSS->iCpuMask)==0)
-		{
-		s.iCCIpiReactIDFC.RawAdd();
-		}
-	}
-
-/**
-Runs if a core needs to wake up on account of a transferred tied IRQ or IDFC
-*/
-void TScheduler::CCIpiReactivate()
-	{
-	TUint32 cores = __e32_atomic_swp_ord32(&iCCIpiReactivate, 0);
-	TInt irq = iGenIPILock.LockIrqSave();
-	iCCReactivateCpus |= cores;
-	iGenIPILock.UnlockIrqRestore(irq);
-	iCCReactivateDfc.DoEnque();
-	}
-
-TUint32 TScheduler::ReschedInactiveCpus(TUint32 aMask)
-	{
-	TUint32 rm = aMask & 0x7FFFFFFFu;
-	if (aMask & 0x80000000u)
-		{
-		TSubScheduler& ss = SubScheduler();
-		TUint32 me = ss.iCpuMask;
-		if (__e32_atomic_and_ord32(&iCCSyncCpus, ~me) == me)
-			{
-			rm |= me;
-			iCCSyncIDFC.RawAdd();
-			}
-		}
-	return rm;
-	}
-
-TUint32 TScheduler::CpuShuttingDown(TSubScheduler& aSS)
-	{
-	TUint32 m = aSS.iCpuMask;
-	iIpiAcceptCpus &= ~m;		// no more IPIs for us
-	iCpusGoingDown |= m;		// we are now past the 'point of no return'
-	TUint32 more = iIpiAcceptCpus &~ (iThreadAcceptCpus | iCpusComingUp | iCCReactivateCpus);
-	if (more)
-		return more;
-	if (iCCState & ECCPowerDownInProgress)
-		return KMaxTUint32;
-	return 0;
-	}
-
-// Called just before last CPU goes idle
-void TScheduler::AllCpusIdle()
-	{
-	}
-
-// Called just after first CPU wakes up from idle
-void TScheduler::FirstBackFromIdle()
-	{
-	}
-
-
-struct SCoreControlAction
-	{
-	SCoreControlAction();
-
-	TInt	iPowerUpCount;			// number of cores to power on ...
-	TUint32	iPowerUpCandidates;		// ... out of these
-	TUint32 iPowerUpChoice;			// chosen to power on
-	TInt	iPowerDownCount;		// number of cores to power off ...
-	TUint32	iPowerDownCandidates;	// ... out of these
-	TUint32 iPowerDownChoice;		// chosen to power off
-
-	// snapshot of core control state
-	TInt	iCCRequestLevel;
-	TUint32	iThreadAcceptCpus;
-	TUint32	iIpiAcceptCpus;
-	TUint32	iCpusComingUp;
-	TUint32 iCCReactivateCpus;
-
-	TBool	iCCDefer;
-	SDblQue	iBalanceQ;
-	};
-
-SCoreControlAction::SCoreControlAction()
-	:	iPowerUpCount(0),
-		iPowerUpCandidates(0),
-		iPowerUpChoice(0),
-		iPowerDownCount(0),
-		iPowerDownCandidates(0),
-		iPowerDownChoice(0),
-		iCCRequestLevel(0),
-		iThreadAcceptCpus(0),
-		iIpiAcceptCpus(0),
-		iCpusComingUp(0),
-		iCCReactivateCpus(0),
-		iCCDefer(0)
-	{
-	}
-
-void TScheduler::InitCCAction(SCoreControlAction& aA)
-	{
-	aA.iPowerUpCount = 0;
-	aA.iPowerUpCandidates = 0;
-	aA.iPowerUpChoice = 0;
-	aA.iPowerDownCount = 0;
-	aA.iPowerDownCandidates = 0;
-	aA.iPowerDownChoice = 0;
-	aA.iCCDefer = FALSE;
-
-	TUint32 all = (1u<<iNumCpus)-1;
-
-	TInt irq = iGenIPILock.LockIrqSave();
-
-	// cores fully operative and not being powered off
-	TUint32 c1 = iThreadAcceptCpus;
-
-	// cores in the process of being retired
-	TUint32 c0 = iIpiAcceptCpus &~ (iThreadAcceptCpus | iCpusComingUp | iCCReactivateCpus);
-
-	// cores on (including those being retired) or coming up
-	TUint32 c2 = (iIpiAcceptCpus | iCpusComingUp | iCCReactivateCpus);
-	TInt n2 = __e32_bit_count_32(c2);
-
-	// cores on and not being retired, plus cores being reactivated
-	TUint32 c3 = c2 &~ c0;
-	TInt n3 = __e32_bit_count_32(c3);
-
-	TInt req = iCCRequestLevel;
-
-	// take snapshot of state
-	aA.iCCRequestLevel = req;
-	aA.iThreadAcceptCpus = c1;
-	aA.iIpiAcceptCpus = iIpiAcceptCpus;
-	aA.iCpusComingUp = iCpusComingUp;
-	aA.iCCReactivateCpus = iCCReactivateCpus;
-
-	if (req > n2)
-		{
-		// need to activate some more cores
-		aA.iPowerUpCount = req - n2;
-		aA.iPowerUpCandidates = all &~ c2;
-		iCCReactivateCpus |= c0;	// revive cores currently in the process of powering down
-		iCCState &= ~ECCReqPending;
-		iCCState |= ECCPowerUpInProgress;
-		}
-	else if (req > n3)
-		{
-		// need to reactivate some cores which are currently powering down
-		aA.iPowerUpCount = req - n3;
-		aA.iPowerUpCandidates = c0;
-		iCCState &= ~ECCReqPending;
-		iCCState |= ECCPowerUpInProgress;
-		aA.iCCDefer = TRUE;
-		++iCCDeferCount;	// stop cores going down past recovery
-		}
-	else if (req == n3)
-		{
-		// don't need to do anything
-		iCCState &= ~ECCReqPending;
-		}
-	else if (iCpusComingUp | iCCReactivateCpus)
-		{
-		// defer this request until reactivations in progress have happened
-		iCCState |= ECCReqDeferred;
-		}
-	else
-		{
-		// need to retire some more cores
-		aA.iPowerDownCount = n3 - req;
-		aA.iPowerDownCandidates = c3;
-		iCCState &= ~ECCReqPending;
-		iCCState |= ECCPowerDownInProgress;
-		}
-	iGenIPILock.UnlockIrqRestore(irq);
-	}
-
-
-/**
-Runs when a request is made to change the number of active cores
-*/
-void TScheduler::CCRequest()
-	{
-	SCoreControlAction action;
-	InitCCAction(action);
-	if (action.iPowerDownCount > 0)
-		{
-		TCpuSet cpuSet(action.iIpiAcceptCpus);
-		GetAll(action.iBalanceQ);
-		GetCpuSet(cpuSet, action.iBalanceQ);
-
-		TUint32 leaveOn = cpuSet.Select(action.iCCRequestLevel, action.iIpiAcceptCpus, action.iIpiAcceptCpus&~action.iPowerDownCandidates);
-		if (leaveOn)
-			{
-			action.iPowerDownChoice = action.iPowerDownCandidates &~ leaveOn;
-
-			// remove CPUs to be shut down from iThreadAcceptCpus
-			ChangeThreadAcceptCpus(iThreadAcceptCpus &~ action.iPowerDownChoice);
-			}
-
-		// rebalance to remaining cores
-		StopRebalanceTimer(TRUE);
-		ReBalance(action.iBalanceQ, TRUE);
-		if (iThreadAcceptCpus & (iThreadAcceptCpus - 1))
-			{
-			// more than 1 CPU on
-			ModifyCCState(~ECCPowerDownInProgress, 0);
-			StartRebalanceTimer(FALSE);
-			}
-		else
-			ModifyCCState(~(ECCPowerDownInProgress|ECCPeriodicBalancingActive), 0);	// stop periodic balancing
-		}
-	if (action.iPowerUpCount > 0)
-		{
-		TUint32 ch = 0;
-		TUint32 ca = action.iPowerUpCandidates;
-		TInt n = action.iPowerUpCount;
-		while(n)
-			{
-			TInt b = __e32_find_ls1_32(ca);
-			ch |= (1u<<b);
-			ca &= ~(1u<<b);
-			--n;
-			}
-		action.iPowerUpChoice = ch;
-		CCReactivate(action.iPowerUpChoice);
-		if (action.iCCDefer)
-			CCUnDefer();
-		}
-	}
-
-/**
-Initiates a change to the number of active cores
-*/
-EXPORT_C void NKern::SetNumberOfActiveCpus(TInt aNumber)
-	{
-	__NK_ASSERT_ALWAYS(aNumber>0 && aNumber<=NKern::NumberOfCpus());
-	TScheduler& s = TheScheduler;
-	if (!s.CoreControlSupported())
-		return;
-	TBool chrl = FALSE;
-	TBool kick = FALSE;
-	NKern::Lock();
-	TInt irq = s.iGenIPILock.LockIrqSave();
-	if (s.iCCRequestLevel != (TUint32)aNumber)
-		{
-		s.iCCRequestLevel = aNumber;
-		chrl = TRUE;
-		}
-
-	// cores in the process of being retired
-	TUint32 c0 = s.iIpiAcceptCpus &~ (s.iThreadAcceptCpus | s.iCpusComingUp | s.iCCReactivateCpus);
-
-	// cores on (including those being retired) or coming up
-	TUint32 c2 = (s.iIpiAcceptCpus | s.iCpusComingUp | s.iCCReactivateCpus);
-
-	// cores on and not being retired, plus cores being reactivated
-	TUint32 c3 = c2 &~ c0;
-	TUint32 cc_active = __e32_bit_count_32(c3);
-
-	if (s.iCCRequestLevel != cc_active)
-		{
-		if (chrl || !(s.iCCState & (ECCReqPending|ECCPowerDownInProgress|ECCPowerUpInProgress) ))
-			{
-			kick = TRUE;
-			}
-		s.iCCState |= ECCReqPending;
-		}
-	s.iGenIPILock.UnlockIrqRestore(irq);
-	if (kick)
-		s.iCCRequestDfc.Add();
-	NKern::Unlock();
-	}
-
-
-
-
-
--- a/kernel/eka/nkernsmp/nk_bal.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-// Copyright (c) 2009-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:
-// e32\nkernsmp\nk_bal.h
-// 
-//
-
-/**
- @file
- @internalComponent
-*/
-
-#ifndef __NK_BAL_H__
-#define __NK_BAL_H__
-#include <cpudefs.h>
-#include <nkern.h>
-
-#define __LOAD_BALANCE_INFO_DEFINED__
-
-struct SLbInfo
-	{
-	TUint64HL			iRecentTime;
-	TUint64HL			iRecentCpuTime;
-	TUint64HL			iRecentActiveTime;
-	TUint16				iLbRunTime;
-	TUint16				iLbActTime;
-	TUint16				iLbRunAct;
-	TUint16				iLbRunAvg;
-	TUint16				iLbActAvg;
-	TUint16				iLbRunActAvg;
-	TUint8				iLbNomPri;
-	TUint8				iLbHot;
-	TUint8				iLbWarm;
-	TUint8				iLbAffinity;
-	TUint8				iLbHeavy;
-	TUint8				iLbSpare1;
-	TUint8				iLbSpare2;
-	TUint8				iLbSpare3;
-	TUint8				iLbSpare4;
-	TUint8				iLbSpare5;
-	TUint8				iLbSpare6;
-	TUint8				iLbSpare7;
-	};
-
-#define	DUMP_LOAD_BALANCE_INFO(s)	\
-	Printf("RecentTime      %08x %08x\r\n", (s)->iLbInfo.iRecentTime.i32[1], (s)->iLbInfo.iRecentTime.i32[0]),	\
-	Printf("RecentCpuTime   %08x %08x  RecentActivTime %08x %08x\r\n", (s)->iLbInfo.iRecentCpuTime.i32[1], (s)->iLbInfo.iRecentCpuTime.i32[0], (s)->iLbInfo.iRecentActiveTime.i32[1], (s)->iLbInfo.iRecentActiveTime.i32[0]),	\
-	Printf("LbRunTime %03x  LbActTime %03x     LbRunAct %03x\r\n", (s)->iLbInfo.iLbRunTime, (s)->iLbInfo.iLbActTime, (s)->iLbInfo.iLbRunAct),	\
-	Printf("LbRunAvg  %03x   LbActAvg %03x  LbRunActAvg %03x\r\n", (s)->iLbInfo.iLbRunAvg, (s)->iLbInfo.iLbActAvg, (s)->iLbInfo.iLbRunActAvg),	\
-	Printf("LbNomPri  %02x       LbHot %02x        LbWarm %02x   LbAffinity %02x\r\n", (s)->iLbInfo.iLbNomPri, (s)->iLbInfo.iLbHot, (s)->iLbInfo.iLbWarm, (s)->iLbInfo.iLbAffinity),	\
-	Printf("LbHeavy   %02x", (s)->iLbInfo.iLbHeavy)
-
-#endif
--- a/kernel/eka/nkernsmp/nk_irq.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/nk_irq.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -29,7 +29,7 @@
 NIrqHandler	Handlers[NK_MAX_IRQ_HANDLERS];
 NIrqHandler* NIrqHandler::FirstFree;
 
-extern "C" void send_irq_ipi(TSubScheduler*, TInt);
+extern "C" void send_irq_ipi(TSubScheduler*);
 
 void StepCookie(volatile TUint16& p, TInt n)
 	{
@@ -252,8 +252,7 @@
 	TRACE_IRQ12(17, this, orig, aCount);
 	if (orig & (EDisable|EUnbind|EActive))
 		return;	// disabled or already active
-	NSchedulable* tied = iTied;
-	if (tied)
+	if (iTied)
 		{
 		// we need to enforce mutual exclusion between the event handler
 		// and the tied thread or thread group, so the event handler must
@@ -262,7 +261,7 @@
 		// can't be migrated until the event handler completes.
 		// need a pending event count for the tied thread/group
 		// so we know when the thread/group can be migrated
-		TInt tied_cpu = tied->BeginTiedEvent();
+		TInt tied_cpu = iTied->BeginTiedEvent();
 		TInt this_cpu = NKern::CurrentCpu();
 		if (tied_cpu != this_cpu)
 			{
@@ -283,8 +282,8 @@
 		TRACE_IRQ8(19, this, orig);
 		if (!(orig & EActive))
 			{
-			if (tied)
-				tied->EndTiedEvent();
+			if (iTied)
+				iTied->EndTiedEvent();
 			return;	// that was last occurrence or event now disabled
 			}
 		}
@@ -457,27 +456,22 @@
 	pI->Done();
 	}
 
-TInt TSubScheduler::QueueEvent(NEventHandler* aEvent)
+TBool TSubScheduler::QueueEvent(NEventHandler* aEvent)
 	{
-	TInt r = 0;
 	TInt irq = __SPIN_LOCK_IRQSAVE(iEventHandlerLock);
-	if (!(iScheduler->iIpiAcceptCpus & iCpuMask))
-		r = EQueueEvent_WakeUp;
-	else if (!iEventHandlersPending)
-		r = EQueueEvent_Kick;
+	TBool pending = iEventHandlersPending;
 	iEventHandlersPending = TRUE;
 	iEventHandlers.Add(aEvent);
 	__SPIN_UNLOCK_IRQRESTORE(iEventHandlerLock,irq);
-	return r;
+	return !pending;
 	}
 
 void TSubScheduler::QueueEventAndKick(NEventHandler* aEvent)
 	{
-	TInt kick = QueueEvent(aEvent);
-	if (kick)
+	if (QueueEvent(aEvent))
 		{
 		// extra barrier ?
-		send_irq_ipi(this, kick);
+		send_irq_ipi(this);
 		}
 	}
 
--- a/kernel/eka/nkernsmp/nk_mon.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +0,0 @@
-// Copyright (c) 2009-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:
-// e32\nkernsmp\nk_mon.cpp
-// Kernel crash debugger - NKERNSMP platform-independent portion
-// 
-//
-
-#define __INCLUDE_NTHREADBASE_DEFINES__
-
-#include "nk_bal.h"
-#include <kernel/monitor.h>
-#include "nk_priv.h"
-
-void Monitor::DisplaySpinLock(const char* aTitle, TSpinLock* aLock)
-	{
-	volatile TUint32* p = (volatile TUint32*)aLock;
-	Printf("%s %08x %08x\r\n", aTitle, p[0], p[1]);
-	}
-
-EXPORT_C void Monitor::DisplayNThreadInfo(NThread* aT)
-	{
-	DisplayNSchedulableInfo(aT);
-	}
-
-extern void DisplayNThreadStackedRegs(Monitor&, SThreadReschedStack&);
-extern void DisplaySubSchedulerExt(Monitor& m, TSubScheduler& ss);
-extern void DisplaySchedulerExt(Monitor& m, TScheduler& s);
-
-void Monitor::DisplayNSchedulableInfo(NSchedulable* aS)
-	{
-	NThread* t = aS->iParent ? (NThread*)aS : 0;
-	NThreadGroup* g = aS->iParent ? 0 : (NThreadGroup*)aS;
-
-	if (t && aS->iParent==aS)
-		Printf("NThread @%08x Pri %d\r\n",aS,aS->iPriority);
-	else if (t)
-		Printf("NThread @%08x (G:%08x) Pri %d\r\n",aS,aS->iParent,aS->iPriority);
-	else
-		Printf("NThreadGroup @%08x Pri %d\r\n",aS,aS->iPriority);
-	Printf("Rdy=%02x Curr=%02x LastCpu=%d CpuChg=%02x FrzCpu=%d\r\n", aS->iReady, aS->iCurrent, aS->iLastCpu, aS->iCpuChange, aS->iFreezeCpu);
-	Printf("Next=%08x Prev=%08x Parent=%08x\r\n", aS->iNext, aS->iPrev, aS->iParent);
-	Printf("CPUaff=%08x PrefCpu=%02x TCpu=%02x FCpu=%02x\r\n", aS->iCpuAffinity, aS->iPreferredCpu, aS->iTransientCpu, aS->iForcedCpu);
-	Printf("PauseCount %02x Susp %1x ACount %02x ActiveState %d\r\n", aS->iPauseCount, aS->iSuspended, aS->iACount, aS->iActiveState);
-	DisplaySpinLock("SpinLock", &aS->iSSpinLock);
-	Printf("Stopping %02x Events %08x %08x EventState %08x\r\n", aS->iStopping, aS->iEvents.iA.iNext, aS->iEvents.iA.iPrev, aS->iEventState);
-	Printf("TotalCpuTime    %08x %08x  RunCount        %08x %08x\r\n", aS->iTotalCpuTime.i32[1], aS->iTotalCpuTime.i32[0], aS->iRunCount.i32[1], aS->iRunCount.i32[0]);
-	Printf("TotalActiveTime %08x %08x  LastActivation  %08x %08x\r\n", aS->iTotalActiveTime.i32[1], aS->iTotalActiveTime.i32[0], aS->iLastActivationTime.i32[1], aS->iLastActivationTime.i32[0]);
-	Printf("SavedCpuTime    %08x %08x  SavedActiveTime %08x %08x\r\n", aS->iSavedCpuTime.i32[1], aS->iSavedCpuTime.i32[0], aS->iSavedActiveTime.i32[1], aS->iSavedActiveTime.i32[0]);
-	Printf("LastRunTime     %08x %08x  LbLink          %08x %08x    LbState %02x\r\n", aS->iLastRunTime.i32[1], aS->iLastRunTime.i32[0], aS->iLbLink.iNext, aS->iLbLink.iPrev, aS->iLbState);
-
-	DUMP_LOAD_BALANCE_INFO(aS);
-	volatile TUint32* el = (volatile TUint32*)&aS->iEnumerateLink;
-	Printf("EnumLink  %08x %08x\r\n", el[0], el[1]);
-
-	if (g)
-		{
-		// Thread group
-		return;
-		}
-
-	Printf("WaitState %02x %02x [%02x %02x] (%08x)\r\n", t->iWaitState.iWtC.iWtStFlags, t->iWaitState.iWtC.iWtObjType,
-											t->iWaitState.iWtC.iWtStSpare1, t->iWaitState.iWtC.iWtStSpare2, t->iWaitState.iWtC.iWtObj);
-	Printf("BasePri %d MutexPri %d NomPri %d Att=%02x\r\n", t->iBasePri, t->iMutexPri, t->iNominalPri, t->i_ThrdAttr);
-	Printf("HeldFM=%08x FMDef=%02x AddrSp=%08x Initial=%d\r\n", t->iHeldFastMutex, t->iFastMutexDefer, t->iAddressSpace, t->iInitial);
-	Printf("Time=%d Timeslice=%d ReqCount=%08x\r\n", t->iTime, t->iTimeslice, t->iRequestSemaphore.iCount);
-	Printf("SuspendCount=%d CsCount=%d CsFunction=%08x\r\n", t->iSuspendCount, t->iCsCount, t->iCsFunction);
-	Printf("LinkedObjType %02x LinkedObj %08x CoreCyc %02x RebalAttr %02x\r\n", t->iLinkedObjType, t->iLinkedObj, t->iCoreCycling, t->iRebalanceAttr);
-	Printf("SavedSP=%08x WaitLink:%08x %08x %d\r\n", t->iSavedSP, t->iWaitLink.iNext, t->iWaitLink.iPrev, t->iWaitLink.iPriority);
-	Printf("iNewParent=%08x iExtraContext=%08x, iExtraContextSize=%08x\r\n", t->iNewParent, t->iExtraContext, t->iExtraContextSize);
-	Printf("iUserModeCallbacks=%08x iNThreadBaseSpare6=%08x\r\n", t->iUserModeCallbacks, t->iNThreadBaseSpare6);
-	Printf("iNThreadBaseSpare7=%08x iNThreadBaseSpare8=%08x iNThreadBaseSpare9=%08x\r\n", t->iNThreadBaseSpare7, t->iNThreadBaseSpare8, t->iNThreadBaseSpare9);
-	if (!aS->iCurrent)
-		{
-		TUint32* pS=(TUint32*)t->iSavedSP;
-		SThreadReschedStack reg;
-		MTRAPD(r,wordmove(&reg,pS,sizeof(SThreadReschedStack)));
-		if (r==KErrNone)
-			DisplayNThreadStackedRegs(*this, reg);
-		}
-	NewLine();
-	}
-
-void Monitor::DisplayNFastSemInfo(NFastSemaphore* pS)
-	{
-	if (pS->iCount >= 0)
-		Printf("NFastSemaphore @ %08x Count %d OwningThread %08x\r\n",pS,pS->iCount,pS->iOwningThread);
-	else
-		Printf("NFastSemaphore @ %08x Count %08x (%08x) OwningThread %08x\r\n",pS,pS->iCount,pS->iCount<<2,pS->iOwningThread);
-	}
-
-void Monitor::DisplayNFastMutexInfo(NFastMutex* aM)
-	{
-	Printf("NFastMutex @ %08x HoldingThread %08x iWaitQ Pri Mask %08x %08x\r\n", aM, aM->iHoldingThread, aM->iWaitQ.iPresent[1], aM->iWaitQ.iPresent[0]);
-	DisplaySpinLock("SpinLock", &aM->iMutexLock);
-	}
-
-void DisplaySubSchedulerInfo(Monitor& m, TSubScheduler& ss)
-	{
-	m.Printf("\r\nSUBSCHEDULER %d @%08x:\r\n", ss.iCpuNum, &ss);
-	m.Printf("CurrentThread=%08x\r\n", ss.iCurrentThread);
-	m.Printf("IDFCs   %08x %08x    CPU# %08x CPUmask %08x\r\n", ss.iDfcs.iA.iNext, ss.iDfcs.iA.iPrev, ss.iCpuNum, ss.iCpuMask);
-	m.Printf("ExIDFCs %08x %08x CurIDFC %08x PendFlg %08x\r\n", ss.iExIDfcs.iA.iNext, ss.iExIDfcs.iA.iPrev, ss.iCurrentIDFC, *(TUint32*)&ss.iRescheduleNeededFlag);
-	m.DisplaySpinLock("ExIDfcLock", &ss.iExIDfcLock);
-	m.Printf("KLCount %d InIDFC %02x EvPend %02x\r\n", ss.iKernLockCount, ss.iInIDFC, ss.iEventHandlersPending);
-	m.Printf("LbQ     %08x %08x   LbCtr %02x\r\n", ss.iLbQ.iA.iNext, ss.iLbQ.iA.iPrev, ss.iLbCounter);
-	m.Printf("AddrSp  %08x RschdIPIs %08x iNextIPI %08x\r\n", ss.iAddressSpace, ss.iReschedIPIs, ss.iNextIPI);
-	m.DisplaySpinLock("ReadyListLock", &ss.iReadyListLock);
-	m.Printf("EvtHand %08x %08x InitThrd %08x SLOC %08x %08x\r\n", ss.iEventHandlers.iA.iNext, ss.iEventHandlers.iA.iPrev,
-		ss.iInitialThread, I64HIGH(ss.iSpinLockOrderCheck), I64LOW(ss.iSpinLockOrderCheck));
-	m.DisplaySpinLock("EventHandlerLock", &ss.iEventHandlerLock);
-	m.Printf("LastTmstmp %08x %08x            RschdCount %08x %08x\r\n", ss.iLastTimestamp.i32[1], ss.iLastTimestamp.i32[0], ss.iReschedCount.i32[1], ss.iReschedCount.i32[0]);
-
-	m.Printf("DeferShutdown %4d RdyThrdC %d Uncached %08x\r\n", ss.iDeferShutdown, ss.iRdyThreadCount, ss.iUncached);
-	DisplaySubSchedulerExt(m, ss);
-	TPriListBase* b = (TPriListBase*)&ss;
-	m.Printf("PriClassThrdC %4d %4d %4d %4d\r\n", ss.iPriClassThreadCount[0], ss.iPriClassThreadCount[1], ss.iPriClassThreadCount[2], ss.iPriClassThreadCount[3]);
-	m.Printf("Present %08x %08x\r\n", b->iPresent[1], b->iPresent[0]);
-	TInt k;
-	TUint64 p64 = b->iPresent64;
-	for (k=KNumPriorities-1; k>=0; --k, p64+=p64)
-		{
-		if (p64>>63)
-			{
-			m.Printf("Priority %2d -> %08x\r\n", k, ss.EntryAtPriority(k));
-			}
-		}
-	}
-
-void Monitor::DisplaySchedulerInfo()
-	{
-	TScheduler* pS=TScheduler::Ptr();
-	Printf("SCHEDULER @%08x:\r\n",pS);
-	Printf("ProcessHandler    %08x MonitorExcHndlr %08x ReschedHook %08x\r\n",pS->iProcessHandler,pS->iMonitorExceptionHandler,pS->iRescheduleHook);
-	Printf("iThreadAcceptCpus %08x  iIpiAcceptCpus %08x    iNumCpus %d\r\n",pS->iThreadAcceptCpus,pS->iIpiAcceptCpus,pS->iNumCpus);
-	Printf("iCpusComingUp     %08x  iCpusGoingDown %08x  CCDeferCnt %d\r\n",pS->iCpusComingUp,pS->iCpusGoingDown,pS->iCCDeferCount);
-	Printf("iCCSyncCpus       %08x  CCReactiv8Cpus %08x  CCState    %08x\r\n",pS->iCCSyncCpus,pS->iCCReactivateCpus,pS->iCCState);
-	Printf("IdleDfcs %08x %08x     CpusNotIdle %08x     IdleGen %02x IdleSpillCpu %02x\r\n",
-		pS->iIdleDfcs.iA.iNext, pS->iIdleDfcs.iA.iPrev, pS->iCpusNotIdle, pS->iIdleGeneration, pS->iIdleSpillCpu);
-	DisplaySpinLock("IdleSpinLock", &pS->iIdleSpinLock);
-	Printf("SYSLOCK @ %08x\r\n",&pS->iLock);
-	DisplayNFastMutexInfo(&pS->iLock);
-
-	DisplaySpinLock("EnumerateLock", &pS->iEnumerateLock);
-	volatile TUint32* at = (volatile TUint32*)&pS->iAllThreads;
-	volatile TUint32* ag = (volatile TUint32*)&pS->iAllGroups;
-	Printf("AllThrds %08x %08x       AllGroups %08x %08x\r\n", at[0], at[1], ag[0], ag[1]);
-	DisplaySpinLock("IdleBalanceLock", &pS->iIdleBalanceLock);
-	DisplaySpinLock("BalanceListLock", &pS->iBalanceListLock);
-	Printf("BalList  %08x %08x LastBalanceTime %08x %08x\r\n", pS->iBalanceList.iA.iNext, pS->iBalanceList.iA.iPrev,
-									I64HIGH(pS->iLastBalanceTime), I64LOW(pS->iLastBalanceTime));
-	Printf("LbCntr   %02x RebalanceDfcQ %08x NeedBal %02x\r\n", pS->iLbCounter, pS->iRebalanceDfcQ, pS->iNeedBal);
-	Printf("iCCRequestLevel   %08x  iPoweringOff   %08x  DetachCnt  %08x\r\n",pS->iCCRequestLevel,pS->iPoweringOff,pS->iDetachCount);
-
-	DisplaySchedulerExt(*this, *pS);
-	volatile TUint32* sc = (volatile TUint32*)&pS->iSchedScratch[0];
-	Printf("Scratch 0: %08x  1: %08x  2: %08x  3: %08x\r\n",sc[0],sc[1],sc[2],sc[3]);
-	Printf("Scratch 4: %08x  5: %08x  6: %08x  7: %08x\r\n",sc[4],sc[5],sc[6],sc[7]);
-	Printf("Scratch 8: %08x  9: %08x  A: %08x  B: %08x\r\n",sc[8],sc[9],sc[10],sc[11]);
-	Printf("Scratch C: %08x  D: %08x  E: %08x  F: %08x\r\n",sc[12],sc[13],sc[14],sc[15]);
-
-	TInt i;
-	for (i=0; i<KMaxCpus; ++i)
-		{
-		TSubScheduler& ss = *pS->iSub[i];
-		DisplaySubSchedulerInfo(*this, ss);
-		}
-	NewLine();
-	}
-
--- a/kernel/eka/nkernsmp/nk_timer.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/nk_timer.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -26,7 +26,7 @@
 
 GLDEF_D NTimerQ TheTimerQ;
 
-extern "C" void send_irq_ipi(TSubScheduler*, TInt);
+extern "C" void send_irq_ipi(TSubScheduler*);
 
 #ifndef __MSTIM_MACHINE_CODED__
 #ifdef _DEBUG
@@ -345,6 +345,7 @@
 // Wait aTime from last trigger time - used for periodic timers
 //
 	{
+	__NK_ASSERT_DEBUG(aTime>0);
 	TInt irq = TheTimerQ.iTimerSpinLock.LockIrqSave();
 	if (!IsValid())
 		{
@@ -585,8 +586,6 @@
 	{
 	__KTRACE_OPT(KBOOT,DEBUGPRINT("NTimerQ::Init3 DFCQ at %08x",aDfcQ));
 	TheTimerQ.iDfc.SetDfcQ(aDfcQ);
-	NThreadBase* t = aDfcQ->iThread;
-	t->iRebalanceAttr = 1;
 	}
 
 #ifndef __MSTIM_MACHINE_CODED__
@@ -743,7 +742,8 @@
 EXPORT_C void NTimerQ::Tick()
 	{
 	TInt irq = iTimerSpinLock.LockIrqSave();
-	TInt i = TInt(__e32_atomic_add_rlx64(&iMsCount64, 1)) & ETimerQMask;
+	TInt i=iMsCount & ETimerQMask;
+	iMsCount++;
 	STimerQ* pQ=iTickQ+i;
 	iPresent &= ~(1<<i);
 	TBool doDfc=FALSE;
@@ -802,10 +802,10 @@
 					{
 					pC->i_NTimer_iState = TUint8(NTimer::EEventQ + cpu);
 					TSubScheduler* ss = TheSubSchedulers + cpu;
-					TInt kick = ss->QueueEvent(pC);
+					TBool kick = ss->QueueEvent(pC);
 					iTimerSpinLock.UnlockIrqRestore(irq);
 					if (kick)
-						send_irq_ipi(ss, kick);
+						send_irq_ipi(ss);
 					continue;
 					}
 				}
@@ -921,8 +921,8 @@
  */
 EXPORT_C void NTimerQ::Advance(TInt aTicks)
 	{
-	CHECK_PRECONDITIONS(MASK_INTERRUPTS_DISABLED,"NTimerQ::Advance");
-	__e32_atomic_add_rlx64(&TheTimerQ.iMsCount64, TUint64(TUint32(aTicks)));
+	CHECK_PRECONDITIONS(MASK_INTERRUPTS_DISABLED,"NTimerQ::Advance");	
+	TheTimerQ.iMsCount+=(TUint32)aTicks;
 	}
 
 
--- a/kernel/eka/nkernsmp/nkern.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/nkern.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -98,10 +98,7 @@
 			pC->iLinkedObj = this;
 			pC->iWaitState.SetUpWait(NThreadBase::EWaitFastMutex, NThreadWaitState::EWtStObstructed, this);
 			pC->iWaitLink.iPriority = pC->iPriority;
-			if (waited)
-				iWaitQ.AddHead(&pC->iWaitLink);	// we were next at this priority
-			else
-				iWaitQ.Add(&pC->iWaitLink);
+			iWaitQ.Add(&pC->iWaitLink);
 			pC->RelSLock();
 			if (pH)
 				pH->SetMutexPriority(this);
@@ -883,9 +880,6 @@
 		iCsFunction = ECSDivertPending;
 		iSuspendCount = 0;
 		iSuspended = 0;
-
-		// If thread is killed before first resumption, set iACount=1
-		__e32_atomic_tau_ord8(&iACount, 1, 0, 1);
 		if (aS)
 			aS->iReadyListLock.UnlockOnly();
 		DoReleaseT(KErrDied,0);
@@ -900,7 +894,7 @@
 TBool NThreadBase::SuspendOrKill(TInt aCount)
 	{
 	__KTRACE_OPT(KNKERN,DEBUGPRINT("%T nSuspendOrKill %d", this, aCount));
-	if (aCount==0 || i_NThread_Initial)
+	if (aCount==0)
 		return FALSE;
 	TBool result = FALSE;
 	TBool concurrent = FALSE;
@@ -1053,10 +1047,6 @@
 			{
 			result = TRUE;
 			iSuspended = 0;
-
-			// On first resumption set iACount=1
-			// From then on the thread must be killed before being deleted
-			__e32_atomic_tau_ord8(&iACount, 1, 0, 1);
 			if (!iPauseCount && !iReady && !iWaitState.iWtC.iWtStFlags)
 				ReadyT(0);
 			}
@@ -1222,9 +1212,6 @@
 	if (xh)
 		pD = (*xh)((NThread*)this);		// call exit handler
 
-	// if CPU freeze still active, remove it
-	NKern::EndFreezeCpu(0);
-
 	// detach any tied events
 	DetachTiedEvents();
 
@@ -1296,65 +1283,34 @@
 			KCpuAny if it should be able to run on any CPU.
 	@return The previous affinity mask.
 */
-TUint32 NSchedulable::SetCpuAffinityT(TUint32 aAffinity)
+TUint32 NThreadBase::SetCpuAffinity(TUint32 aAffinity)
 	{
 	// check aAffinity is valid
-	NThreadBase* t = 0;
-	NThreadGroup* g = 0;
-	NSchedulable* p = iParent;
-	if (!p)
-		g = (NThreadGroup*)this, p=g;
-	else
-		t = (NThreadBase*)this;
-	if (iParent && iParent!=this)
-		g = (NThreadGroup*)iParent;
-	TUint32 old_aff = p->iCpuAffinity;
+	AcqSLock();
+	TUint32 old_aff = iParent->iCpuAffinity;
+	TBool migrate = FALSE;
 	TBool make_ready = FALSE;
 	TSubScheduler* ss0 = &SubScheduler();
 	TSubScheduler* ss = 0;
-#ifdef KNKERN
-	if (iParent)
-		{
-		__KTRACE_OPT(KNKERN,DEBUGPRINT("%T nSetCpu %08x->%08x, F:%d R:%02x PR:%02x",this,iParent->iCpuAffinity,aAffinity,iParent->iFreezeCpu,iReady,iParent->iReady));
-		}
-	else
-		{
-		__KTRACE_OPT(KNKERN,DEBUGPRINT("%G nSetCpu %08x->%08x, F:%d R:%02x",this,iCpuAffinity,aAffinity,iFreezeCpu,iReady));
-		}
-#endif
-	if (t && t->i_NThread_Initial)
+	__KTRACE_OPT(KNKERN,DEBUGPRINT("%T nSetCpu %08x->%08x, F:%d R:%02x PR:%02x",this,iParent->iCpuAffinity,aAffinity,iParent->iFreezeCpu,iReady,iParent->iReady));
+	if (i_NThread_Initial)
 		goto done;	// can't change affinity of initial thread
-	if (aAffinity == NTHREADBASE_CPU_AFFINITY_MASK)
-		{
-		p->iTransientCpu = 0;
-		}
-	else if ( (aAffinity & (KCpuAffinityPref|NTHREADBASE_CPU_AFFINITY_MASK)) == KCpuAffinityPref)
+	iParent->iCpuAffinity = aAffinity;		// set new affinity, might not take effect yet
+	if (!iParent->iReady)
+		goto done;	// thread/group not currently on a ready list so can just change affinity
+	migrate = !CheckCpuAgainstAffinity(iParent->iReady & EReadyCpuMask, aAffinity);	// TRUE if thread's current CPU is incompatible with the new affinity
+	if (!migrate)
+		goto done;	// don't need to move thread, so just change affinity
+	ss = TheSubSchedulers + (iParent->iReady & EReadyCpuMask);
+	ss->iReadyListLock.LockOnly();
+	if (iParent->iCurrent)
 		{
-		p->iTransientCpu = 0;
-		p->iPreferredCpu = TUint8((aAffinity & (EReadyCpuMask|EReadyCpuSticky)) | EReadyOffset);
-		}
-	else if ( (aAffinity & (KCpuAffinityTransient|KCpuAffinityPref|NTHREADBASE_CPU_AFFINITY_MASK)) == KCpuAffinityTransient)
-		{
-		p->iTransientCpu = TUint8(aAffinity & EReadyCpuMask) | EReadyOffset;
-		}
-	else
-		p->iCpuAffinity = NSchedulable::PreprocessCpuAffinity(aAffinity);		// set new affinity, might not take effect yet
-	if (!p->iReady)
-		goto done;	// thread/group not currently on a ready list so can just change affinity
-
-	// Check if the thread needs to migrate or can stay where it is
-	if (!p->ShouldMigrate(p->iReady & EReadyCpuMask))
-		goto done;	// don't need to move thread, so just change affinity
-	ss = TheSubSchedulers + (p->iReady & EReadyCpuMask);
-	ss->iReadyListLock.LockOnly();
-	if (p->iCurrent)
-		{
-		p->iCpuChange = TRUE;			// mark CPU change pending
+		iParent->iCpuChange = TRUE;			// mark CPU change pending
 		if (ss == ss0)
 			RescheduleNeeded();
 		else
 			// kick other CPU now so migration happens before acquisition of fast mutex
-			send_resched_ipi_and_wait(p->iReady & EReadyCpuMask);
+			send_resched_ipi_and_wait(iParent->iReady & EReadyCpuMask);
 		}
 	else
 		{
@@ -1362,81 +1318,23 @@
 		// This is handled by the scheduler - when a thread belonging to a group is context switched
 		// out while holding a fast mutex its iFastMutexDefer is set to 1 and the group's iFreezeCpu
 		// is incremented.
-		if (p->iFreezeCpu || (iParent==this && t->CheckFastMutexDefer()))
-			p->iCpuChange = TRUE;	// CPU frozen or fast mutex held so just mark deferred CPU migration
+		if (iParent->iFreezeCpu || (iParent==this && CheckFastMutexDefer()))
+			iParent->iCpuChange = TRUE;	// CPU frozen or fast mutex held so just mark deferred CPU migration
 		else
 			{
-			ss->SSRemoveEntry(p);
-			p->iReady = 0;
+			ss->Remove(iParent);
+			iParent->iReady = 0;
 			make_ready = TRUE;
 			}
 		}
 	ss->iReadyListLock.UnlockOnly();
 	if (make_ready)
-		p->ReadyT(0);
+		iParent->ReadyT(0);
 done:
+	RelSLock();
 	return old_aff;
 	}
 
-/** Force the current thread onto a particular CPU
-
-	@pre	Kernel must not be locked.
-	@pre	Call in a thread context.
-	@pre	Current thread must not be in a group
-	@pre	Current thread must not hold a fast mutex
-	@pre	Current thread must have an active CPU freeze
-	@pre	Current thread must not be an initial thread
-
-	@param	The number of the CPU to which this thread should be moved
-*/
-void NKern::JumpTo(TInt aCpu)
-	{
-	// check aAffinity is valid
-	NThreadBase* t = NKern::CurrentThread();
-	__KTRACE_OPT(KNKERN,DEBUGPRINT("%T NJumpTo %d", t, aCpu));
-	if (NKern::HeldFastMutex())
-		__crash();
-	t->LAcqSLock();
-	if (t->iParent!=t)
-		__crash();
-	if (!t->iFreezeCpu)
-		__crash();
-	if (t->i_NThread_Initial)
-		__crash();
-	if (TUint(aCpu) >= (TUint)NKern::NumberOfCpus())
-		__crash();
-	TUint8 fc = (TUint8)(aCpu | NSchedulable::EReadyOffset);
-	if (t->iCurrent != fc)
-		{
-		t->iForcedCpu = fc;
-		t->iCpuChange = TRUE;
-		RescheduleNeeded();
-		}
-	t->RelSLockU();		// reschedules and jumps to new CPU
-	}
-
-TBool NSchedulable::ShouldMigrate(TInt aCpu)
-	{
-	// Check if the thread's current CPU is compatible with the new affinity
-	TUint32 active = TheScheduler.iThreadAcceptCpus;
-
-	// If it can't stay where it is, migrate
-	if (!CheckCpuAgainstAffinity(aCpu, iCpuAffinity, active))
-		return TRUE;
-
-	TInt cpu = iTransientCpu ? iTransientCpu : iPreferredCpu;
-
-	// No preferred or transient CPU, so can stay where it is
-	if (!cpu)
-		return FALSE;
-
-	// If thread isn't on preferred CPU but could be, migrate
-	cpu &= EReadyCpuMask;
-	if (cpu!=aCpu && CheckCpuAgainstAffinity(cpu, iCpuAffinity, active))
-		return TRUE;
-	return FALSE;
-	}
-
 
 /******************************************************************************
  * Thread wait state
@@ -1514,7 +1412,7 @@
 		{
 		NThreadBase* t = Thread();
 		if (!t->iPauseCount && !t->iSuspended)
-			t->ReadyT(oldws64 & EWtStObstructed);
+			t->ReadyT(0);
 		}
 	return KErrNone;
 	}
@@ -1858,24 +1756,6 @@
 	}
 
 
-/** Changes the nominal priority of a thread.
-
-	This function is intended to be used by the EPOC layer and personality layers.
-	Do not use this function directly on a Symbian OS thread - use Kern::ThreadSetPriority().
-
-    @param aThread Thread to receive the new priority.
-    @param aPriority New inherited priority for aThread.
-    
-	@see Kern::SetThreadPriority()
-*/
-void NKern::ThreadSetNominalPriority(NThread* aThread, TInt aPriority)
-	{
-	NKern::Lock();
-	aThread->SetNominalPriority(aPriority);
-	NKern::Unlock();
-	}
-
-
 /** Atomically signals the request semaphore of a nanothread and a fast mutex.
 
 	This function is intended to be used by the EPOC layer and personality
@@ -2067,7 +1947,6 @@
 		return 1;
 		}
 	pC->iFreezeCpu = 1;
-	__e32_atomic_add_rlx32(&ss.iDeferShutdown, 1);
 	if (pC->iParent != pC)
 		{
 		pC->AcqSLock();
@@ -2107,7 +1986,6 @@
 			}
 		else if (pC->iCpuChange)		// deferred CPU change?
 			RescheduleNeeded();
-		__e32_atomic_add_rlx32(&ss.iDeferShutdown, TUint32(-1));
 		}
 	NKern::Unlock();
 	}
@@ -2122,9 +2000,9 @@
  */
 EXPORT_C TUint32 NKern::ThreadSetCpuAffinity(NThread* aThread, TUint32 aAffinity)
 	{
-	aThread->LAcqSLock();
-	TUint32 r = aThread->SetCpuAffinityT(aAffinity);
-	aThread->RelSLockU();
+	NKern::Lock();
+	TUint32 r = aThread->SetCpuAffinity(aAffinity);
+	NKern::Unlock();
 	return r;
 	}
 
@@ -2449,15 +2327,7 @@
 		pC->UnReadyT();
 		pC->iParent = pC;
 		g->iCurrent = 0;	// since current thread is no longer in g
-		TUint64 now = NKern::Timestamp();
-		g->iLastRunTime.i64 = now;
-		g->iTotalCpuTime.i64 += (now - g->iLastStartTime.i64);
-		if (--g->iActiveState == 0)
-			{
-			// group no longer active
-			g->iTotalActiveTime.i64 += (now - g->iLastActivationTime.i64);
-			}
-		ss.SSAddEntryHead(pC);
+		ss.AddHead(pC);
 		pC->iReady = TUint8(ss.iCpuNum | NSchedulable::EReadyOffset);
 		pC->iCpuAffinity = g->iCpuAffinity;	// keep same CPU affinity
 		// if we're frozen, the group's freeze count was incremented
@@ -2481,7 +2351,7 @@
 				g->iCpuChange = FALSE;
 				if (g->iReady)
 					{
-					ss.SSRemoveEntry(g);
+					ss.Remove(g);
 					g->iReady = 0;
 					make_group_ready = TRUE;
 					}
@@ -2523,9 +2393,7 @@
 	__KTRACE_OPT(KNKERN,DEBUGPRINT("NJoinGroup %T->%G",pC,aGroup));
 	pC->AcqSLock();
 	aGroup->AcqSLock();
-
-	// Check if current CPU is compatible with group's affinity
-	TBool migrate = !CheckCpuAgainstAffinity(ss.iCpuNum, aGroup->iCpuAffinity);
+	TBool migrate = !CheckCpuAgainstAffinity(ss.iCpuNum, aGroup->iCpuAffinity);	// TRUE if thread's current CPU is incompatible with the group's affinity
 	if (!aGroup->iReady || aGroup->iReady==pC->iReady)
 		{
 		// group not ready or ready on this CPU
@@ -2538,19 +2406,17 @@
 			if (!aGroup->iReady)
 				{
 				aGroup->iPriority = pC->iPriority;
-				ss.SSAddEntryHead(aGroup);
+				ss.AddHead(aGroup);
 				aGroup->iReady = TUint8(ss.iCpuNum | NSchedulable::EReadyOffset);
 				}
 			else if (pC->iPriority > aGroup->iPriority)
-				ss.SSChgEntryP(aGroup, pC->iPriority);
+				{
+				ss.ChangePriority(aGroup, pC->iPriority);
+				}
 			pC->iReady = NSchedulable::EReadyGroup;
 			aGroup->iCurrent = aGroup->iReady;
 			ss.iReadyListLock.UnlockOnly();
 			++aGroup->iThreadCount;
-			TUint64 now = NKern::Timestamp();
-			aGroup->iLastStartTime.i64 = now;
-			if (++aGroup->iActiveState == 1)
-				aGroup->iLastActivationTime.i64 = now;
 			goto done;
 			}
 		}
@@ -2578,45 +2444,6 @@
 
 
 /******************************************************************************
- * Iterable Doubly Linked List
- ******************************************************************************/
-TInt SIterDQIterator::Step(SIterDQLink*& aObj, TInt aMaxSteps)
-	{
-	if (aMaxSteps <= 0)
-		aMaxSteps = KMaxCpus + 3;
-	SIterDQLink* p = Next();
-	SIterDQLink* q = p;
-	__NK_ASSERT_DEBUG(p!=0);
-	for(; p->IsIterator() && --aMaxSteps>0; p=p->Next())
-		{}
-	if (p->IsObject())
-		{
-		// found object
-		Deque();
-		InsertAfter(p);
-		aObj = p;
-		return KErrNone;
-		}
-	if (p->IsAnchor())
-		{
-		// reached end of list
-		if (p != q)
-			{
-			Deque();
-			InsertBefore(p);	// put at the end
-			}
-		aObj = 0;
-		return KErrEof;
-		}
-	// Maximum allowed number of other iterators skipped
-	Deque();
-	InsertAfter(p);
-	aObj = 0;
-	return KErrGeneral;
-	}
-
-
-/******************************************************************************
  * Priority Lists
  ******************************************************************************/
 
@@ -2627,6 +2454,8 @@
  */
 EXPORT_C TInt TPriListBase::HighestPriority()
 	{
+//	TUint64 present = MAKE_TUINT64(iPresent[1], iPresent[0]);
+//	return __e32_find_ms1_64(present);
 	return __e32_find_ms1_64(iPresent64);
 	}
 
@@ -2735,22 +2564,28 @@
  * Generic IPIs
  ******************************************************************************/
 
+TGenIPIList::TGenIPIList()
+	:	iGenIPILock(TSpinLock::EOrderGenericIPIList)
+	{
+	}
+
+TGenIPIList GenIPIList;
+
 extern "C" {
 extern void send_generic_ipis(TUint32);
 
 void generic_ipi_isr(TSubScheduler* aS)
 	{
-	TScheduler& s = TheScheduler;
 	TGenericIPI* ipi = aS->iNextIPI;
 	if (!ipi)
 		return;
 	TUint32 m = aS->iCpuMask;
-	SDblQueLink* anchor = &s.iGenIPIList.iA;
+	SDblQueLink* anchor = &GenIPIList.iA;
 	while (ipi != anchor)
 		{
 		__e32_atomic_and_acq32(&ipi->iCpusIn, ~m);
 		(*ipi->iFunc)(ipi);
-		TInt irq = s.iGenIPILock.LockIrqSave();
+		TInt irq = GenIPIList.iGenIPILock.LockIrqSave();
 		TGenericIPI* n = (TGenericIPI*)ipi->iNext;
 		ipi->iCpusOut &= ~m;
 		if (ipi->iCpusOut == 0)
@@ -2764,7 +2599,7 @@
 			ipi = (TGenericIPI*)ipi->iNext;
 		if (ipi == anchor)
 			aS->iNextIPI = 0;
-		s.iGenIPILock.UnlockIrqRestore(irq);
+		GenIPIList.iGenIPILock.UnlockIrqRestore(irq);
 		}
 	}
 }
@@ -2776,13 +2611,13 @@
 	TScheduler& s = TheScheduler;
 	TInt i;
 	TUint32 ipis = 0;
-	TInt irq = s.iGenIPILock.LockIrqSave();
+	TInt irq = GenIPIList.iGenIPILock.LockIrqSave();
 	if (aCpuMask & 0x80000000u)
 		{
 		if (aCpuMask==0xffffffffu)
-			aCpuMask = s.iIpiAcceptCpus;
+			aCpuMask = s.iActiveCpus2;
 		else if (aCpuMask==0xfffffffeu)
-			aCpuMask = s.iIpiAcceptCpus &~ SubScheduler().iCpuMask;
+			aCpuMask = s.iActiveCpus2 &~ SubScheduler().iCpuMask;
 		else
 			aCpuMask = 0;
 		}
@@ -2790,11 +2625,11 @@
 	iCpusOut = aCpuMask;
 	if (!aCpuMask)
 		{
-		s.iGenIPILock.UnlockIrqRestore(irq);
+		GenIPIList.iGenIPILock.UnlockIrqRestore(irq);
 		iNext = 0;
 		return;
 		}
-	s.iGenIPIList.Add(this);
+	GenIPIList.Add(this);
 	for (i=0; i<s.iNumCpus; ++i)
 		{
 		if (!(aCpuMask & (1<<i)))
@@ -2807,7 +2642,7 @@
 			}
 		}
 	send_generic_ipis(ipis);
-	s.iGenIPILock.UnlockIrqRestore(irq);
+	GenIPIList.iGenIPILock.UnlockIrqRestore(irq);
 	__KTRACE_OPT(KSCHED2,DEBUGPRINT("GenIPI ipis=%08x", ipis));
 	}
 
@@ -2846,168 +2681,28 @@
 
 /**	Stop all other CPUs
 
-Call with kernel unlocked, returns with kernel locked.
-Returns mask of CPUs halted plus current CPU.
+	Call with kernel locked
 */
-TUint32 TStopIPI::StopCPUs()
+void TStopIPI::StopCPUs()
 	{
-	CHECK_PRECONDITIONS(MASK_THREAD_STANDARD,"TStopIPI::StopCPUs()");
-	TScheduler& s = TheScheduler;
 	iFlag = 0;
-	NKern::ThreadEnterCS();
-
-	// Stop any cores powering up or down for now
-	// A core already on the way down will stop just before the transition to SHUTDOWN_FINAL
-	// A core already on the way up will carry on powering up
-	TInt irq = s.iGenIPILock.LockIrqSave();
-	++s.iCCDeferCount;	// stops bits in iIpiAcceptCpus being cleared, but doesn't stop them being set
-						// but iIpiAcceptCpus | s.iCpusComingUp is constant
-	TUint32 act2 = s.iIpiAcceptCpus;		// CPUs still accepting IPIs
-	TUint32 cu = s.iCpusComingUp;			// CPUs powering up
-	s.iGenIPILock.UnlockIrqRestore(irq);
-	TUint32 cores = act2 | cu;
-	if (cu)
-		{
-		// wait for CPUs coming up to start accepting IPIs
-		while (cores & ~s.iIpiAcceptCpus)
-			{
-			__snooze();	// snooze until cores have come up
-			}
-		}
-	NKern::Lock();
 	QueueAllOther(&Isr);	// send IPIs to all other CPUs
 	WaitEntry();			// wait for other CPUs to reach the ISR
-	return cores;
 	}
 
-
-/**	Release the stopped CPUs
-
-Call with kernel locked, returns with kernel unlocked.
-*/
 void TStopIPI::ReleaseCPUs()
 	{
-	__e32_atomic_store_rel32(&iFlag, 1);	// allow other CPUs to proceed
+	iFlag = 1;				// allow other CPUs to proceed
 	WaitCompletion();		// wait for them to finish with this IPI
-	NKern::Unlock();
-	TheScheduler.CCUnDefer();
-	NKern::ThreadLeaveCS();
 	}
 
 void TStopIPI::Isr(TGenericIPI* a)
 	{
 	TStopIPI* s = (TStopIPI*)a;
-	while (!__e32_atomic_load_acq32(&s->iFlag))
+	while (!s->iFlag)
 		{
 		__chill();
 		}
-	__e32_io_completion_barrier();
 	}
 
 
-/******************************************************************************
- * TCoreCycler - general method to execute something on all active cores
- ******************************************************************************/
-TCoreCycler::TCoreCycler()
-	{
-	iCores = 0;
-	iG = 0;
-	}
-
-void TCoreCycler::Init()
-	{
-	CHECK_PRECONDITIONS(MASK_THREAD_STANDARD,"TCoreCycler::Init()");
-	TScheduler& s = TheScheduler;
-	NKern::ThreadEnterCS();
-	iG = NKern::LeaveGroup();
-	NThread* t = NKern::CurrentThread();
-	if (t->iCoreCycling)
-		{
-		__crash();
-		}
-	t->iCoreCycling = TRUE;
-
-	// Stop any cores powering up or down for now
-	// A core already on the way down will stop just before the transition to SHUTDOWN_FINAL
-	// A core already on the way up will carry on powering up
-	TInt irq = s.iGenIPILock.LockIrqSave();
-	++s.iCCDeferCount;	// stops bits in iIpiAcceptCpus being cleared, but doesn't stop them being set
-						// but iIpiAcceptCpus | s.iCpusComingUp is constant
-	TUint32 act2 = s.iIpiAcceptCpus;		// CPUs still accepting IPIs
-	TUint32 cu = s.iCpusComingUp;			// CPUs powering up
-	TUint32 gd = s.iCpusGoingDown;			// CPUs no longer accepting IPIs on the way down
-	s.iGenIPILock.UnlockIrqRestore(irq);
-	if (gd)
-		{
-		// wait for CPUs going down to reach INACTIVE state
-		TUint32 remain = gd;
-		FOREVER
-			{
-			TInt i;
-			for (i=0; i<KMaxCpus; ++i)
-				{
-				if (remain & (1u<<i))
-					{
-					// platform specific function returns TRUE when core has detached from SMP cluster
-					if (s.iSub[i]->Detached())
-						remain &= ~(1u<<i);	// core is now down
-					}
-				}
-			if (!remain)
-				break;		// all done
-			else
-				{
-				__snooze();	// snooze until cores have gone down
-				}
-			}
-		}
-	iCores = act2 | cu;
-	if (cu)
-		{
-		// wait for CPUs coming up to start accepting IPIs
-		while (iCores & ~s.iIpiAcceptCpus)
-			{
-			__snooze();	// snooze until cores have come up
-			}
-		}
-	iFrz = NKern::FreezeCpu();
-	if (iFrz)
-		__crash();	// already frozen so won't be able to migrate :-(
-	iInitialCpu = NKern::CurrentCpu();
-	iCurrentCpu = iInitialCpu;
-	iRemain = iCores;
-	}
-
-TInt TCoreCycler::Next()
-	{
-	NThread* t = NKern::CurrentThread();
-	if (iCores == 0)
-		{
-		Init();
-		return KErrNone;
-		}
-	if (NKern::CurrentCpu() != iCurrentCpu)
-		__crash();
-	iRemain &= ~(1u<<iCurrentCpu);
-	TInt nextCpu = iRemain ? __e32_find_ms1_32(iRemain) : iInitialCpu;
-	if (nextCpu != iCurrentCpu)
-		{
-		NKern::JumpTo(nextCpu);
-		iCurrentCpu = nextCpu;
-		if (NKern::CurrentCpu() != iCurrentCpu)
-			__crash();
-		}
-	if (iRemain)
-		{
-		return KErrNone;
-		}
-	NKern::EndFreezeCpu(iFrz);
-	iCores = 0;
-	TScheduler& s = TheScheduler;
-	s.CCUnDefer();
-	t->iCoreCycling = FALSE;
-	if (iG)
-		NKern::JoinGroup(iG);
-	NKern::ThreadLeaveCS();
-	return KErrEof;
-	}
--- a/kernel/eka/nkernsmp/nkern.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/nkern.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -16,9 +16,7 @@
 //
 
 sourcepath				../nkernsmp
-source					nkern.cpp nkerns.cpp sched.cpp dfcs.cpp nk_timer.cpp nk_irq.cpp nk_bal.cpp
-sourcepath				../nkern
-source					nklib.cpp
+source					nkern.cpp nkerns.cpp sched.cpp dfcs.cpp nk_timer.cpp nk_irq.cpp
 
 #ifdef MARM
 sourcepath				../common/arm
@@ -26,8 +24,6 @@
 sourcepath				../nkernsmp/arm
 source					vectors.cia ncsched.cpp ncsched.cia nctimer.cia ncutilf.cia ncirq.cpp ncirq.cia ncthrd.cia
 source					ncutils.cia ncutils.cpp ncthrd.cpp ncglob.cpp nccpu.cpp nccpu.cia
-sourcepath				../nkern/arm
-source					nklib.cia
 
 
 #elif defined(X86)
@@ -55,11 +51,7 @@
 ARMLIBS					h_a__un.l 
 #endif
 #else
-#ifdef ARMCC_4
-ARMLIBS					c_5.l     h_5.l     cpprt_5.l
-#else
 ARMLIBS					c_4.l     h_4.l     cpprt_4.l
 #endif
-#endif
 END
 
--- a/kernel/eka/nkernsmp/nkerns.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/nkerns.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -47,15 +47,10 @@
 	iReady = 0;
 	iCurrent = 0;
 	iLastCpu = 0;
+	iNSchedulableSpare1 = 0;
 	iPauseCount = 0;
 	iSuspended = 0;
-	iACount = 0;
-	iPreferredCpu = 0;
-	iActiveState = 0;
-	i_NSchedulable_Spare2 = 0;
-	iTransientCpu = 0;
-	iForcedCpu = 0;
-	iLbState = ELbState_Inactive;
+	iNSchedulableSpare2 = 0;
 	iCpuChange = 0;
 	iStopping = 0;
 	iFreezeCpu = 0;
@@ -63,41 +58,14 @@
 	iCpuAffinity = 0;
 	new (i_IDfcMem) TDfc(&DeferredReadyIDfcFn, this);
 	iEventState = 0;
-	iRunCount.i64 = 0;
-	iLastRunTime.i64 = 0;
-	iTotalCpuTime.i64 = 0;
-	iLastActivationTime.i64 = 0;
-	iTotalActiveTime.i64 = 0;
-	iSavedCpuTime.i64 = 0;
-	iSavedActiveTime.i64 = 0;
-	iLbLink.iNext = 0;
-	memclr(&iLbInfo, EMaxLbInfoSize);
+	iTotalCpuTime64 = 0;
 	}
 
-void NSchedulable::AddToEnumerateList()
-	{
-	TScheduler& s = TheScheduler;
-	SIterDQ& dq = iParent ? s.iAllThreads : s.iAllGroups;
-	NKern::Lock();
-	s.iEnumerateLock.LockOnly();
-	dq.Add(&iEnumerateLink);
-	TUint32 active = s.iThreadAcceptCpus;
-	TUint32 cpus = active & iCpuAffinity;
-	if (!cpus)
-		cpus = active;	// can't run on any currently active CPU, just pick an active one until it becomes ready
-	TInt ecpu = __e32_find_ls1_32(cpus);
-	iEventState = (ecpu<<EEventCpuShift) | (ecpu<<EThreadCpuShift);
-	s.iEnumerateLock.UnlockOnly();
-	NKern::Unlock();
-	}
-
-
 /******************************************************************************
  * NThreadGroup
  ******************************************************************************/
 NThreadGroup::NThreadGroup()
 	{
-	iACount = 1;
 	iParent = 0;
 	iThreadCount = 0;
 	new (&iSSpinLock) TSpinLock(TSpinLock::EOrderThreadGroup);
@@ -111,10 +79,7 @@
 EXPORT_C TInt NKern::GroupCreate(NThreadGroup* aGroup, SNThreadGroupCreateInfo& aInfo)
 	{
 	new (aGroup) NThreadGroup();
-	aGroup->iDestructionDfc = aInfo.iDestructionDfc;
-	aGroup->iCpuAffinity = NSchedulable::PreprocessCpuAffinity(aInfo.iCpuAffinity);
-	aGroup->AddToEnumerateList();
-	aGroup->InitLbInfo();
+	aGroup->iCpuAffinity = aInfo.iCpuAffinity;
 	return KErrNone;
 	}
 
@@ -133,13 +98,6 @@
 	{
 	NKern::ThreadEnterCS();
 	aGroup->DetachTiedEvents();
-	NKern::Lock();
-	aGroup->AcqSLock();
-	if (aGroup->iLbLink.iNext)
-		aGroup->LbUnlink();
-	aGroup->RelSLock();
-	aGroup->DropRef();
-	NKern::Unlock();
 	NKern::ThreadLeaveCS();
 	}
 
@@ -178,10 +136,10 @@
 	iWaitLink.iPriority = 0;
 	iBasePri = 0;
 	iMutexPri = 0;
-	iNominalPri = 0;
+	i_NThread_Initial = 0;
 	iLinkedObjType = EWaitNone;
 	i_ThrdAttr = 0;
-	i_NThread_Initial = 0;
+	iNThreadBaseSpare10 = 0;
 	iFastMutexDefer = 0;
 	iRequestSemaphore.iOwningThread = (NThreadBase*)this;
 	iTime = 0;
@@ -202,15 +160,14 @@
 	iStackSize = 0;
 	iExtraContext = 0;
 	iExtraContextSize = 0;
-	iCoreCycling = 0;
-	iRebalanceAttr = 0;
-	iNThreadBaseSpare4c = 0;
-	iNThreadBaseSpare4d = 0;
-	iNThreadBaseSpare5 = 0;
 	iNThreadBaseSpare6 = 0;
 	iNThreadBaseSpare7 = 0;
 	iNThreadBaseSpare8 = 0;
 	iNThreadBaseSpare9 = 0;
+
+	// KILL
+	iTag = 0;
+	iVemsData = 0;
 	}
 
 TInt NThreadBase::Create(SNThreadCreateInfo& aInfo, TBool aInitial)
@@ -228,8 +185,7 @@
 	iTime=iTimeslice;
 	iPriority=TUint8(aInfo.iPriority);
 	iBasePri=TUint8(aInfo.iPriority);
-	iNominalPri=TUint8(aInfo.iPriority);
-	iCpuAffinity = NSchedulable::PreprocessCpuAffinity(aInfo.iCpuAffinity);
+	iCpuAffinity = aInfo.iCpuAffinity;
 	iHandlers = aInfo.iHandlers ? aInfo.iHandlers : &NThread_Default_Handlers;
 	iFastExecTable=aInfo.iFastExecTable?aInfo.iFastExecTable:&DefaultFastExecTable;
 	iSlowExecTable=(aInfo.iSlowExecTable?aInfo.iSlowExecTable:&DefaultSlowExecTable)->iEntries;
@@ -242,9 +198,8 @@
 		iCurrent = iReady;
 		iCpuAffinity = iLastCpu;
 		iEventState = (iLastCpu<<EEventCpuShift) | (iLastCpu<<EThreadCpuShift);
-		i_NThread_Initial = TRUE;	// must set initial thread flag before adding to subscheduler
-		ss.SSAddEntry(this);		// in order to get correct ready thread count (i.e. not including the idle thread)
-		iACount = 1;
+		ss.Add(this);
+		i_NThread_Initial = TRUE;
 		ss.iInitialThread = (NThread*)this;
 		NKern::Unlock();		// now that current thread is defined
 		}
@@ -252,7 +207,16 @@
 		{
 		iSuspendCount = 1;
 		iSuspended = 1;
-		iEventState = 0;
+		TInt ecpu;
+		if (iCpuAffinity & NTHREADBASE_CPU_AFFINITY_MASK)
+			{
+			ecpu = __e32_find_ls1_32(iCpuAffinity);
+			if (ecpu >= TheScheduler.iNumCpus)
+				ecpu = 0;	// FIXME: Inactive CPU?
+			}
+		else
+			ecpu = iCpuAffinity;
+		iEventState = (ecpu<<EEventCpuShift) | (ecpu<<EThreadCpuShift);
 		if (aInfo.iGroup)
 			{
 			NKern::Lock();
@@ -283,19 +247,6 @@
 	ExcFault(aContext);
 	}
 
-//
-// Destroy a thread before it has ever run
-// Must be called before first resumption of thread
-//
-void NThread::Stillborn()
-	{
-	__NK_ASSERT_ALWAYS(iACount==0);	// ensure thread has never been resumed
-	NKern::Lock();
-	RemoveFromEnumerateList();
-	NKern::Unlock();
-	}
-
-
 
 /** Create a nanothread.
 
@@ -319,10 +270,8 @@
 	return aThread->Create(aInfo,FALSE);
 	}
 
+// User-mode callbacks
 
-/******************************************************************************
- * User-mode callbacks
- ******************************************************************************/
 TUserModeCallback::TUserModeCallback(TUserModeCallbackFunc aFunc)
 	:	iNext(KUserModeCallbackUnqueued),
 		iFunc(aFunc)
@@ -380,7 +329,6 @@
 	NKern::Unlock();
 	}
 
-
 /** Initialise the null thread
 	@internalComponent
 */
@@ -530,15 +478,3 @@
 	return 0;
 #endif
 	}
-
-TDfcQue* TScheduler::RebalanceDfcQ()
-	{
-	return TheScheduler.iRebalanceDfcQ;
-	}
-
-NThread* TScheduler::LBThread()
-	{
-	TDfcQue* rbQ = TheScheduler.iRebalanceDfcQ;
-	return rbQ ? (NThread*)(rbQ->iThread) : 0;
-	}
-
--- a/kernel/eka/nkernsmp/sched.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/sched.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -26,42 +26,16 @@
 
 TSpinLock	NEventHandler::TiedLock(TSpinLock::EOrderEventHandlerTied);
 
-
-const TUint8 KClassFromPriority[KNumPriorities] =
-	{
-	0,	0,	0,	0,	0,	0,	0,	0,				// priorities 0-7
-	0,	0,	0,	0,	1,	1,	1,	1,				// priorities 8-15
-	2,	2,	2,	2,	2,	2,	2,	2,				// priorities 16-23
-	2,	2,	2,	3,	3,	3,	3,	3,				// priorities 24-31
-	3,	3,	3,	3,	3,	3,	3,	3,				// priorities 32-39
-	3,	3,	3,	3,	3,	3,	3,	3,				// priorities 40-47
-	3,	3,	3,	3,	3,	3,	3,	3,				// priorities 48-55
-	3,	3,	3,	3,	3,	3,	3,	3				// priorities 56-63
-	};
-
-
 /******************************************************************************
  * TScheduler
  ******************************************************************************/
 
 // TScheduler resides in .bss so other fields are zero-initialised
 TScheduler::TScheduler()
-	:	iThreadAcceptCpus(1),	// only boot CPU for now
-		iIpiAcceptCpus(1),		// only boot CPU for now
-		iGenIPILock(TSpinLock::EOrderGenericIPIList),
-		iIdleBalanceLock(TSpinLock::EOrderEnumerate),
+	:	iActiveCpus1(1),	// only boot CPU for now
+		iActiveCpus2(1),	// only boot CPU for now
 		iIdleSpinLock(TSpinLock::EOrderIdleDFCList),
-		iCpusNotIdle(1),	// only boot CPU for now
-		iEnumerateLock(TSpinLock::EOrderEnumerate),
-		iBalanceListLock(TSpinLock::EOrderReadyList),
-		iBalanceTimer(&BalanceTimerExpired, this, 1),
-		iCCSyncIDFC(&CCSyncDone, 0),
-		iCCReactivateDfc(&CCReactivateDfcFn, this, 3),
-		iCCRequestLevel(1),		// only boot CPU for now
-		iCCRequestDfc(&CCRequestDfcFn, this, 2),
-		iCCPowerDownDfc(&CCIndirectPowerDown, this, 0),
-		iCCIpiReactIDFC(&CCIpiReactivateFn, this),
-		iFreqChgDfc(&DoFrequencyChanged, this, 6)
+		iCpusNotIdle(1)		// only boot CPU for now
 	{
 	TInt i;
 	for (i=0; i<KMaxCpus; ++i)
@@ -71,10 +45,7 @@
 		s->iScheduler = this;
 		s->iCpuNum = TUint32(i);
 		s->iCpuMask = 1u<<i;
-		s->iLbCounter = TUint8(NSchedulable::ELbState_PerCpu + i);
 		}
-	iLbCounter = (TUint8)NSchedulable::ELbState_Global;
-	iNeedBal = 1;	// stop anyone trying to kick rebalancer before it has been created
 	}
 
 
@@ -96,75 +67,18 @@
 
 // TSubScheduler resides in .bss so other fields are zero-initialised
 TSubScheduler::TSubScheduler()
-	:	iExIDfcLock(TSpinLock::EOrderExIDfcQ),
+	:	TPriListBase(KNumPriorities),
+		iExIDfcLock(TSpinLock::EOrderExIDfcQ),
 		iReadyListLock(TSpinLock::EOrderReadyList),
 		iKernLockCount(1),
 		iEventHandlerLock(TSpinLock::EOrderEventHandlerList)
 	{
 	}
 
-void TSubScheduler::SSAddEntry(NSchedulable* aEntry)
-	{
-	if (aEntry->iParent!=aEntry || !((NThreadBase*)aEntry)->i_NThread_Initial)
-		{
-		TInt c = KClassFromPriority[aEntry->iPriority];
-		++iPriClassThreadCount[c];
-		++iRdyThreadCount;
-		}
-	iSSList.Add(aEntry);
-	}
-
-void TSubScheduler::SSAddEntryHead(NSchedulable* aEntry)
-	{
-	if (aEntry->iParent!=aEntry || !((NThreadBase*)aEntry)->i_NThread_Initial)
-		{
-		TInt c = KClassFromPriority[aEntry->iPriority];
-		++iPriClassThreadCount[c];
-		++iRdyThreadCount;
-		}
-	iSSList.AddHead(aEntry);
-	}
-
-void TSubScheduler::SSRemoveEntry(NSchedulable* aEntry)
-	{
-	if (aEntry->iParent!=aEntry || !((NThreadBase*)aEntry)->i_NThread_Initial)
-		{
-		TInt c = KClassFromPriority[aEntry->iPriority];
-		--iPriClassThreadCount[c];
-		--iRdyThreadCount;
-		}
-	iSSList.Remove(aEntry);
-	}
-
-void TSubScheduler::SSChgEntryP(NSchedulable* aEntry, TInt aNewPriority)
-	{
-	if (aEntry->iParent!=aEntry || !((NThreadBase*)aEntry)->i_NThread_Initial)
-		{
-		TInt c0 = KClassFromPriority[aEntry->iPriority];
-		TInt c1 = KClassFromPriority[aNewPriority];
-		if (c0 != c1)
-			{
-			--iPriClassThreadCount[c0];
-			++iPriClassThreadCount[c1];
-			}
-		}
-	iSSList.ChangePriority(aEntry, aNewPriority);
-	}
-
 
 /******************************************************************************
  * NSchedulable
  ******************************************************************************/
-TUint32 NSchedulable::PreprocessCpuAffinity(TUint32 aAffinity)
-	{
-	if (!(aAffinity & NTHREADBASE_CPU_AFFINITY_MASK))
-		return aAffinity;
-	TUint32 x = aAffinity & ~NTHREADBASE_CPU_AFFINITY_MASK;
-	if (x & (x-1))
-		return aAffinity;
-	return __e32_find_ls1_32(x);
-	}
-
 void NSchedulable::AcqSLock()
 	{
 	iSSpinLock.LockOnly();
@@ -343,87 +257,6 @@
 		}
 	}
 
-
-/** Return the total CPU time so far used by the specified thread.
-
-	@return The total CPU time in units of 1/NKern::CpuTimeMeasFreq().
-*/
-EXPORT_C TUint64 NKern::ThreadCpuTime(NThread* aThread)
-	{
-	NSchedulable::SCpuStats stats;
-	NKern::Lock();
-	aThread->GetCpuStats(NSchedulable::E_RunTime, stats);
-	NKern::Unlock();
-	return stats.iRunTime;
-	}
-
-void NSchedulable::GetCpuStats(TUint aMask, NSchedulable::SCpuStats& aOut)
-	{
-	AcqSLock();
-	GetCpuStatsT(aMask, aOut);
-	RelSLock();
-	}
-
-void NSchedulable::GetCpuStatsT(TUint aMask, NSchedulable::SCpuStats& aOut)
-	{
-	TSubScheduler* ss = 0;
-	NThread* t = 0;
-	TBool initial = FALSE;
-	if (!IsGroup())
-		t = (NThread*)this;
-	if (t && t->i_NThread_Initial)
-		ss = &TheSubSchedulers[iLastCpu], initial = TRUE;
-	else if (iReady)
-		{
-		if (IsGroup())
-			ss = &TheSubSchedulers[iReady & NSchedulable::EReadyCpuMask];
-		else if (iParent->iReady)
-			ss = &TheSubSchedulers[iParent->iReady & NSchedulable::EReadyCpuMask];
-		}
-	if (ss)
-		ss->iReadyListLock.LockOnly();
-	TUint64 now = NKern::Timestamp();
-	if (aMask & (E_RunTime|E_RunTimeDelta))
-		{
-		aOut.iRunTime = iTotalCpuTime.i64;
-		if (iCurrent || (initial && !ss->iCurrentThread))
-			aOut.iRunTime += (now - ss->iLastTimestamp.i64);
-		if (aMask & E_RunTimeDelta)
-			{
-			aOut.iRunTimeDelta = aOut.iRunTime - iSavedCpuTime.i64;
-			iSavedCpuTime.i64 = aOut.iRunTime;
-			}
-		}
-	if (aMask & (E_ActiveTime|E_ActiveTimeDelta))
-		{
-		aOut.iActiveTime = iTotalActiveTime.i64;
-		if (iActiveState)
-			aOut.iActiveTime += (now - iLastActivationTime.i64);
-		if (aMask & E_ActiveTimeDelta)
-			{
-			aOut.iActiveTimeDelta = aOut.iActiveTime - iSavedActiveTime.i64;
-			iSavedActiveTime.i64 = aOut.iActiveTime;
-			}
-		}
-	if (aMask & E_LastRunTime)
-		{
-		if (iCurrent)
-			aOut.iLastRunTime = 0;
-		else
-			aOut.iLastRunTime = now - iLastRunTime.i64;
-		}
-	if (aMask & E_LastActiveTime)
-		{
-		if (iActiveState)
-			aOut.iLastActiveTime = 0;
-		else
-			aOut.iLastActiveTime = now - iLastRunTime.i64;
-		}
-	if (ss)
-		ss->iReadyListLock.UnlockOnly();
-	}
-
-
 /******************************************************************************
  * NThreadGroup
  ******************************************************************************/
@@ -448,22 +281,12 @@
 	CHECK_PRECONDITIONS(MASK_KERNEL_LOCKED|MASK_NOT_ISR,"NSchedulable::ReadyT");
 	__KTRACE_OPT(KNKERN,DEBUGPRINT("%T nReadyT(%x)",this,aMode));
 	NThreadBase* t = (NThreadBase*)this;
-	if (iParent && !iActiveState)
-		{
-		iActiveState=1;
-		iLastActivationTime.i64 = NKern::Timestamp();
-		if (iParent!=this && ++iParent->iActiveState==1)
-			iParent->iLastActivationTime.i64 = iLastActivationTime.i64;
-		}
 #ifdef _DEBUG
 	if (!iParent)
 		t = (NThreadBase*)0xface0fff;
 #endif
-	__NK_ASSERT_DEBUG(!iReady && (!iParent || (!t->iWaitState.iWtC.iWtStFlags && !t->iSuspended)));
+	__NK_ASSERT_DEBUG(!iReady && (!iParent || (!t->iWaitState.iWtC.iWtStFlags && !t->iPauseCount && !t->iSuspended)));
 	TSubScheduler& ss0 = SubScheduler();
-	TScheduler& s = TheScheduler;
-	TBool reactivate = FALSE;
-	TBool no_ipi = FALSE;
 	NSchedulable* g = this;
 	if (iParent != this && iParent)
 		{
@@ -478,9 +301,7 @@
 			ss.iReadyListLock.LockOnly();
 			TInt hp = ss.HighestPriority();
 			if (iPriority>gp)
-				{
-				ss.SSChgEntryP(tg, iPriority);
-				}
+				ss.ChangePriority(tg, iPriority);
 			if (iPriority>hp || (iPriority==hp && ss.iCurrentThread && ss.iCurrentThread->iTime==0))
 				{
 				if (&ss == &ss0)
@@ -488,178 +309,84 @@
 				else
 					ss0.iReschedIPIs |= ss.iCpuMask;	// will kick the other CPU when this CPU reenables preemption
 				}
-			if ((aMode & ENewTimeslice) && t->iTime==0 && (iNext!=this || ss.EntryAtPriority(iPriority)) )
+			if ((aMode & ENewTimeslice) && t->iTime==0 && (iNext!=this || ss.iQueue[iPriority]))
 				t->iTime = t->iTimeslice;
 			ss.iReadyListLock.UnlockOnly();
-
-			ss0.iMadeReadyCounter++;
 			return;
 			}
 		tg->iNThreadList.Add(this);
 		tg->iPriority = iPriority;	// first in group
 		g = tg;						// fall through to add group to subscheduler
 		}
-	TInt priClass = -1;
 	TInt cpu = -1;
-	TUint32 active = TheScheduler.iThreadAcceptCpus;
-	if (g!=t || !t->i_NThread_Initial)
-		priClass = KClassFromPriority[g->iPriority];
-	if (g->iForcedCpu)
-		{
-		cpu = iForcedCpu & EReadyCpuMask;	// handles core cycling case (No.1 below)
-		if (active & (1u<<cpu))
-			goto cpu_ok;
-		else
-			goto single_cpu_reactivate;
-		}
 	if (aMode & EUnPause)
 		{
 		cpu = (g->iEventState & EThreadCpuMask)>>EThreadCpuShift;
 		if (CheckCpuAgainstAffinity(cpu, g->iCpuAffinity))
 			goto cpu_ok;
-		cpu = -1;
 		}
-	if (g->iFreezeCpu)
+	else if (g->iFreezeCpu)
 		{
 		cpu = g->iLastCpu;
-		goto cpu_ok;
+		if (!CheckCpuAgainstAffinity(cpu, g->iCpuAffinity))
+			g->iCpuChange = TRUE;
 		}
-	if (!(g->iCpuAffinity & NTHREADBASE_CPU_AFFINITY_MASK))
-		{
+	else if (!(g->iCpuAffinity & NTHREADBASE_CPU_AFFINITY_MASK))
 		cpu = g->iCpuAffinity;
-		if (!(active & (1u<<cpu)))
-			goto single_cpu_reactivate;
-		goto cpu_ok;
-		}
-	if ((aMode & EPreferSameCpu) && CheckCpuAgainstAffinity(ss0.iCpuNum, g->iCpuAffinity, active))
+	else if ((aMode & EPreferSameCpu) && (g->iCpuAffinity & ss0.iCpuMask))
 		cpu = ss0.iCpuNum;
-	else if (iTransientCpu && CheckCpuAgainstAffinity(iTransientCpu & EReadyCpuMask, g->iCpuAffinity))
-		cpu = iTransientCpu & EReadyCpuMask;
-	else if (iPreferredCpu && CheckCpuAgainstAffinity(iPreferredCpu & EReadyCpuMask, g->iCpuAffinity, active))
-		cpu = iPreferredCpu & EReadyCpuMask;
 	if (cpu < 0)
 		{
 		// pick a cpu
-		TUint32 m = g->iCpuAffinity & active;
-		TInt lastCpu = g->iLastCpu;
-		TInt i = lastCpu;
-		TInt lcp = KMaxTInt;
-		TInt lco = KMaxTInt;
-		TInt cpunp = -1;
-		TInt idle_cpu = -1;
-		do	{
-			if (m & (1u<<i))
+		TScheduler& s = TheScheduler;
+		TUint32 m = g->iCpuAffinity & s.iActiveCpus1;
+		TInt i;
+		TInt lowest_p = KMaxTInt;
+		for (i=0; i<s.iNumCpus; ++i)
+			{
+			TSubScheduler& ss = *s.iSub[i];
+			if (!(m & ss.iCpuMask))
+				continue;
+			TInt hp = ss.HighestPriority();
+			if (hp < lowest_p)
 				{
-				TSubScheduler& ss = *s.iSub[i];
-				TInt nInC = ss.iPriClassThreadCount[priClass];
-				if (nInC < lco)
-					lco=nInC, cpunp=i;
-				TInt hp = ss.HighestPriority();
-				if (idle_cpu<0 && hp<=0)
-					idle_cpu = i;
-				if (hp < iPriority)
-					{
-					if (i == lastCpu)
-						{
-						cpu = i;
-						if (hp <= 0)
-							break;
-						lcp = -1;
-						}
-					if (nInC < lcp)
-						lcp=nInC, cpu=i;
-					}
+				lowest_p = hp;
+				cpu = i;
+				continue;
 				}
-			if (++i == s.iNumCpus)
-				i = 0;
-			} while (i != lastCpu);
-		if (idle_cpu>=0 && cpu!=idle_cpu)
-			cpu = idle_cpu;
-		else if (cpu<0)
-			cpu = cpunp;
-		}
-	if (cpu<0)
-		{
-single_cpu_reactivate:
-		/*	CORE_CONTROL
-			Might have no CPU at this point due to all CPUs specified by
-			iCpuAffinity being off or in the process of shutting down.
-			There are three possibilities:
-			1.	This thread is 'core cycling'. In that case it will be
-				allowed to move to a 'shutting down' CPU. The CPU will
-				not be permitted to shut down entirely until all core cycling
-				has completed. This is already handled above.
-			2.	There are one or more CPUs which this thread could run on which
-				are shutting down. In that case, pick one, abort the shutdown
-				process and put this thread on it.
-			3.	All CPUs which this thread can run on are off. In that case,
-				assign the thread to one of them and initiate power up of that core.
-		*/
-		TUint32 affm = AffinityToMask(g->iCpuAffinity);
-		TInt irq = s.iGenIPILock.LockIrqSave();
-		if (cpu < 0)
-			{
-			if (affm & s.iCCReactivateCpus)
-				cpu = __e32_find_ls1_32(affm & s.iCCReactivateCpus);
-			else if (affm & s.iIpiAcceptCpus)
-				cpu = __e32_find_ls1_32(affm & s.iIpiAcceptCpus);
-			else
-				cpu = __e32_find_ls1_32(affm), no_ipi = TRUE;
+			if (hp > lowest_p)
+				continue;
+			if (cpu>=0 && g->iLastCpu!=i)
+				continue;
+			lowest_p = hp;
+			cpu = i;
 			}
-		TUint32 cm = 1u<<cpu;
-		if (!((s.iCCReactivateCpus|s.iThreadAcceptCpus) & cm))
-			{
-			s.iCCReactivateCpus |= (1u<<cpu);
-			reactivate = TRUE;
-			}
-		s.iGenIPILock.UnlockIrqRestore(irq);
 		}
 cpu_ok:
 	__NK_ASSERT_ALWAYS(cpu>=0);
-	if (g->iFreezeCpu && !CheckCpuAgainstAffinity(cpu, g->iCpuAffinity))
-		g->iCpuChange = TRUE;
 	if (g->TiedEventReadyInterlock(cpu))
 		{
 		__KTRACE_OPT(KSCHED2,DEBUGPRINT("ReadyT->CPU %dD",cpu));
 		++g->iPauseCount;
+//		((TDfc*)g->i_IDfcMem)->Add();
+		return;
 		}
-	else
+	__KTRACE_OPT(KSCHED2,DEBUGPRINT("ReadyT->CPU %d",cpu));
+	TSubScheduler& ss = TheSubSchedulers[cpu];
+	ss.iReadyListLock.LockOnly();
+	TInt hp = ss.HighestPriority();
+	if (g->iPriority>hp || (g->iPriority==hp && ss.iCurrentThread && ss.iCurrentThread->iTime==0))
 		{
-		__KTRACE_OPT(KSCHED2,DEBUGPRINT("ReadyT->CPU %d",cpu));
-		TSubScheduler& ss = TheSubSchedulers[cpu];
-		ss.iReadyListLock.LockOnly();
-		TInt hp = ss.HighestPriority();
-		if (g->iPriority>hp || (g->iPriority==hp && ss.iCurrentThread && ss.iCurrentThread->iTime==0))
-			{
-			if (&ss == &ss0)
-				RescheduleNeeded();					// reschedule on this processor
-			else if (!no_ipi)
-				ss0.iReschedIPIs |= ss.iCpuMask;	// will kick the other CPU when this CPU reenables preemption
-			}
-		ss.SSAddEntry(g);
-		g->iReady = TUint8(cpu | EReadyOffset);
-		if ((aMode & ENewTimeslice) && iParent && t->iTime==0 && g->iNext!=g)
-			t->iTime = t->iTimeslice;
-		if (!g->iLbLink.iNext && !(g->iParent && t->i_NThread_Initial))
-			{
-			ss.iLbQ.Add(&g->iLbLink);
-			g->iLbState = ss.iLbCounter;
-			if (!s.iNeedBal && (!g->iParent || !(t->iRebalanceAttr & 1)))
-				{
-				s.iNeedBal = 1;
-				reactivate = TRUE;
-				}
-			}
-		if (g->iForcedCpu == g->iReady)
-			{
-			g->iLastCpu = (TUint8)cpu;
-			g->iForcedCpu = 0;	// iForcedCpu has done its job - iFreezeCpu will keep the thread on the right CPU
-			}
-		ss.iReadyListLock.UnlockOnly();
-		ss0.iMadeReadyCounter++;
+		if (&ss == &ss0)
+			RescheduleNeeded();					// reschedule on this processor
+		else
+			ss0.iReschedIPIs |= ss.iCpuMask;	// will kick the other CPU when this CPU reenables preemption
 		}
-	if (reactivate)
-		s.iCCReactivateDfc.Add();
+	ss.Add(g);
+	g->iReady = TUint8(cpu | EReadyOffset);
+	if ((aMode & ENewTimeslice) && iParent && t->iTime==0 && g->iNext!=g)
+		t->iTime = t->iTimeslice;
+	ss.iReadyListLock.UnlockOnly();
 	}
 
 
@@ -693,7 +420,6 @@
 		if (ot->iTime==0 || pfmd)
 			{
 			// ot's timeslice has expired
-			ot->iParent->iTransientCpu = 0;
 			fmd_res = ot->CheckFastMutexDefer();
 			fmd_done = TRUE;
 			if (fmd_res)
@@ -722,21 +448,12 @@
 		TInt wtst = ot->iWaitState.DoWait();
 		if (wtst>=0 && wtst!=NThread::EWaitFastMutex)
 			ot->iTime = ot->iTimeslice;
-		if (wtst==KErrDied || ot->iSuspended || (!(ot->iWaitState.iWtC.iWtStFlags & NThreadWaitState::EWtStObstructed) && wtst>=0) )
-			{
-			ot->iActiveState = 0;
-			ot->iParent->iTransientCpu = 0;
-			if (ot->iParent != ot)
-				--ot->iParent->iActiveState;
-			}
 		ot->UnReadyT();
 		if (ot->iNewParent)
 			{
 			ot->iParent = ot->iNewParent, ++((NThreadGroup*)ot->iParent)->iThreadCount;
 			wmb();	// must make sure iParent is updated before iNewParent is cleared
 			ot->iNewParent = 0;
-			if (ot->iActiveState && ++ot->iParent->iActiveState==1)
-				ot->iParent->iLastActivationTime.i64 = NKern::Timestamp();
 			}
 		ot->iCpuChange = FALSE;
 		}
@@ -750,53 +467,41 @@
 		++((NThreadGroup*)ot->iParent)->iThreadCount;
 		wmb();	// must make sure iParent is updated before iNewParent is cleared
 		ot->iNewParent = 0;
-		TUint64 now = NKern::Timestamp();
-		if (!ot->iParent->iCurrent)
-			ot->iParent->iLastStartTime.i64 = now;
-		if (++ot->iParent->iActiveState==1)
-			ot->iParent->iLastActivationTime.i64 = now;
 		}
-	else if (ot->iParent->iCpuChange)
+	else if (ot->iParent->iCpuChange && !ot->iParent->iFreezeCpu)
 		{
-		if (ot->iForcedCpu)
-			migrate = TRUE;
-		else if (!ot->iParent->iFreezeCpu)
+		if (!CheckCpuAgainstAffinity(iCpuNum, ot->iParent->iCpuAffinity))
 			{
-			if (ot->iParent->ShouldMigrate(iCpuNum))
+			if (ot->iParent==ot)
 				{
-				if (ot->iParent==ot)
+				if (!fmd_done)
+					fmd_res = ot->CheckFastMutexDefer(), fmd_done = TRUE;
+				if (!fmd_res)
 					{
-					if (!fmd_done)
-						fmd_res = ot->CheckFastMutexDefer(), fmd_done = TRUE;
-					if (!fmd_res)
-						migrate = TRUE;
+					__KTRACE_OPT(KSCHED2,DEBUGPRINT("Rschd<-%T A:%08x",ot,ot->iParent->iCpuAffinity));
+					ot->UnReadyT();
+					migrate = TRUE;
+					ot->iCpuChange = FALSE;
 					}
-				else
-					gmigrate = TRUE;
 				}
 			else
 				{
+				__KTRACE_OPT(KSCHED2,DEBUGPRINT("Rschd<-%T GA:%08x",ot,ot->iParent->iCpuAffinity));
+				Remove(ot->iParent);
+				ot->iParent->iReady = 0;
+				gmigrate = TRUE;
 				ot->iCpuChange = FALSE;
 				ot->iParent->iCpuChange = FALSE;
 				}
 			}
-		if (migrate)
+		else
 			{
-			__KTRACE_OPT(KSCHED2,DEBUGPRINT("Rschd<-%T A:%08x",ot,ot->iParent->iCpuAffinity));
-			ot->UnReadyT();
-			ot->iCpuChange = FALSE;
-			}
-		else if (gmigrate)
-			{
-			__KTRACE_OPT(KSCHED2,DEBUGPRINT("Rschd<-%T GA:%08x",ot,ot->iParent->iCpuAffinity));
-			SSRemoveEntry(ot->iParent);
-			ot->iParent->iReady = 0;
 			ot->iCpuChange = FALSE;
 			ot->iParent->iCpuChange = FALSE;
 			}
 		}
 no_ot:
-	NSchedulable* g = (NSchedulable*)iSSList.First();
+	NSchedulable* g = (NSchedulable*)First();
 	TBool rrcg = FALSE;
 	if (g && g->IsGroup())
 		{
@@ -810,20 +515,17 @@
 	if (t && t->iTime==0 && (rrcg || rrct))
 		{
 		// candidate thread's timeslice has expired and there is another at the same priority
-
-		iTimeSliceExpireCounter++; // update metric
-		
 		if (t==ot)
 			{
 			if (ot->iParent!=ot)
 				{
 				((NThreadGroup*)ot->iParent)->iNThreadList.iQueue[ot->iPriority] = ot->iNext;
-				iSSList.iQueue[ot->iParent->iPriority] = ot->iParent->iNext;
+				iQueue[ot->iParent->iPriority] = ot->iParent->iNext;
 				}
 			else
-				iSSList.iQueue[ot->iPriority] = ot->iNext;
+				iQueue[ot->iPriority] = ot->iNext;
 			ot->iTime = ot->iTimeslice;
-			NSchedulable* g2 = (NSchedulable*)iSSList.First();
+			NSchedulable* g2 = (NSchedulable*)First();
 			if (g2->IsGroup())
 				t = (NThread*)((NThreadGroup*)g2)->iNThreadList.First();
 			else
@@ -838,6 +540,14 @@
 				{
 				__KTRACE_OPT(KSCHED2,DEBUGPRINT("Rschd<-%T RR",ot));
 				}
+/*			if (ot->iCpuAffinity & NTHREADBASE_CPU_AFFINITY_MASK)
+				{
+				ot->UnReadyT();
+				migrate = TRUE;
+				}
+			else
+				ot->iTime = ot->iTimeslice;
+*/
 			}
 		else	// loop again since we need to lock t before round robining it
 			{
@@ -870,105 +580,17 @@
 		ot->iParent->ReadyT(0);	// new timeslice if it's queued behind another thread at same priority
 	if (ot)
 		{
-		TBool dead = ot->iWaitState.ThreadIsDead();
-		if (dead && ot->iLbLink.iNext)
-			ot->LbUnlink();
 		ot->RelSLock();
 
 		// DFC to signal thread is now dead
-		if (dead && ot->iWaitState.iWtC.iKillDfc && __e32_atomic_tau_ord8(&ot->iACount, 1, 0xff, 0)==1)
-			{
-			ot->RemoveFromEnumerateList();
+		if (ot->iWaitState.ThreadIsDead() && ot->iWaitState.iWtC.iKillDfc)
 			ot->iWaitState.iWtC.iKillDfc->DoEnque();
-			}
-		}
-	if (iCCSyncPending)
-		{
-		iCCSyncPending = 0;
-		iReschedIPIs |= 0x80000000u;		// update iCCSyncCpus when kernel is finally unlocked
 		}
 	__KTRACE_OPT(KSCHED,DEBUGPRINT("Rschd->%T",t));
 	__NK_ASSERT_ALWAYS(!t || t->iParent);	// must be a thread not a group
 	return t;	// could return NULL
 	}
 
-void NSchedulable::LbUnlink()
-	{
-	if (iLbState & ELbState_PerCpu)
-		{
-		TSubScheduler* ss = &TheSubSchedulers[iLbState & ELbState_CpuMask];
-		ss->iReadyListLock.LockOnly();
-		if (iLbState == ss->iLbCounter)
-			{
-			iLbLink.Deque();
-			iLbLink.iNext = 0;
-			iLbState = ELbState_Inactive;
-			}
-		ss->iReadyListLock.UnlockOnly();
-		}
-	else if ((iLbState & ELbState_CpuMask) == ELbState_Global)
-		{
-		TScheduler& s = TheScheduler;
-		s.iBalanceListLock.LockOnly();
-		if (iLbState == s.iLbCounter)
-			{
-			iLbLink.Deque();
-			iLbLink.iNext = 0;
-			iLbState = ELbState_Inactive;
-			}
-		s.iBalanceListLock.UnlockOnly();
-		}
-	if (iLbState != ELbState_Inactive)
-		{
-		// load balancer is running so we can't dequeue the thread
-		iLbState |= ELbState_ExtraRef;				// indicates extra ref has been taken
-		__e32_atomic_tau_ord8(&iACount, 1, 1, 0);	// extra ref will be removed by load balancer
-		}
-	}
-
-TBool NSchedulable::TakeRef()
-	{
-	return __e32_atomic_tau_ord8(&iACount, 1, 1, 0);
-	}
-
-TBool NSchedulable::DropRef()
-	{
-	if (__e32_atomic_tau_ord8(&iACount, 1, 0xff, 0)!=1)
-		return EFalse;
-	TDfc* d = 0;
-	AcqSLock();
-	if (iParent)
-		{
-		// it's a thread
-		NThreadBase* t = (NThreadBase*)this;
-		if (t->iWaitState.ThreadIsDead() && t->iWaitState.iWtC.iKillDfc)
-			d = t->iWaitState.iWtC.iKillDfc;
-		RelSLock();
-		t->RemoveFromEnumerateList();
-		}
-	else
-		{
-		NThreadGroup* g = (NThreadGroup*)this;
-		d = g->iDestructionDfc;
-		RelSLock();
-		g->RemoveFromEnumerateList();
-		}
-	if (d)
-		d->DoEnque();
-	return ETrue;
-	}
-
-void NSchedulable::RemoveFromEnumerateList()
-	{
-	TScheduler& s = TheScheduler;
-	s.iEnumerateLock.LockOnly();
-	if (iEnumerateLink.Next())
-		{
-		iEnumerateLink.Deque();
-		iEnumerateLink.SetNext(0);
-		}
-	s.iEnumerateLock.UnlockOnly();
-	}
 
 void NThreadBase::UnReadyT()
 	{
@@ -982,25 +604,24 @@
 			TSubScheduler& ss = TheSubSchedulers[g.iReady & EReadyCpuMask];
 			if (l.IsEmpty())
 				{
-				ss.SSRemoveEntry(&g);
+//				__KTRACE_OPT(KNKERN,DEBUGPRINT("%T UnReadyT (G=%G-)",this,&g));
+				ss.Remove(&g);
 				g.iReady = 0;
 				g.iPriority = 0;
 				}
 			else
 				{
-				TInt np = l.HighestPriority();
-				ss.SSChgEntryP(&g, np);
+//				__KTRACE_OPT(KNKERN,DEBUGPRINT("%T UnReadyT (G=%G)",this,&g));
+				ss.ChangePriority(&g, l.HighestPriority());
 				}
 			}
 		}
 	else
 		{
-		TSubScheduler& ss = TheSubSchedulers[iReady & EReadyCpuMask];
-		ss.SSRemoveEntry(this);
+//		__KTRACE_OPT(KNKERN,DEBUGPRINT("%T UnReadyT",this));
+		TheSubSchedulers[iReady & EReadyCpuMask].Remove(this);
 		}
 	iReady = 0;
-
-	SubScheduler().iMadeUnReadyCounter++;
 	}
 
 
@@ -1025,11 +646,11 @@
 			{
 			TInt ngp = tg->iNThreadList.HighestPriority();
 			if (ngp!=tg->iPriority)
-				ss->SSChgEntryP(tg, ngp);
+				ss->ChangePriority(tg, ngp);
 			}
 		}
 	else
-		ss->SSChgEntryP(this, newp);
+		ss->ChangePriority(this, newp);
 	if (iCurrent)	// can't be current if parent not ready
 		{
 		TInt nhp = ss->HighestPriority();
@@ -1075,9 +696,9 @@
 	{
 	CHECK_PRECONDITIONS(MASK_KERNEL_LOCKED|MASK_NOT_IDFC|MASK_NOT_ISR,"NThreadBase::SetPriority");
 	AcqSLock();
-	__KTRACE_OPT(KNKERN,DEBUGPRINT("%T nSetPri(%d) PBNM[%d,%d,%d,%d]",this,newp,iPriority,iBasePri,iNominalPri,iMutexPri));
+	__KTRACE_OPT(KNKERN,DEBUGPRINT("%T nSetPri %d(%d)->%d(%d)",this,iPriority,iBasePri,newp,iMutexPri));
 	iBasePri = TUint8(newp);
-	if (iMutexPri > newp)
+	if (iMutexPri > iBasePri)
 		newp = iMutexPri;
 	TInt oldp = iPriority;
 	if (newp == oldp)
@@ -1138,17 +759,6 @@
 		}
 	}
 
-void NThreadBase::SetNominalPriority(TInt newp)
-	{
-	CHECK_PRECONDITIONS(MASK_KERNEL_LOCKED|MASK_NOT_IDFC|MASK_NOT_ISR,"NThreadBase::SetNominalPriority");
-	AcqSLock();
-	__KTRACE_OPT(KNKERN,DEBUGPRINT("%T nSetNPr(%d) PBNM[%d,%d,%d,%d]",this,newp,iPriority,iBasePri,iNominalPri,iMutexPri));
-	iNominalPri = TUint8(newp);
-	NominalPriorityChanged();
-	RelSLock();
-	}
-
-
 
 /** Set the inherited priority of a nanokernel thread.
 
@@ -1205,159 +815,9 @@
 		}
 	if (newp <= ss->HighestPriority())
 		RescheduleNeeded();
-	ss->SSChgEntryP(g, newp);
+	ss->ChangePriority(g, newp);
 out:
 	ss->iReadyListLock.UnlockOnly();
 	}
 
 
-/******************************************************************************
- * Pull threads on idle
- ******************************************************************************/
-
-const TInt KMaxTries = 4;
-
-struct SIdlePullThread
-	{
-	SIdlePullThread();
-	void Finish(TBool aDone);
-
-	NSchedulable*	iS;
-	TInt			iPri;
-	NSchedulable*	iOld[KMaxCpus];
-	};
-
-SIdlePullThread::SIdlePullThread()
-	{
-	iS = 0;
-	iPri = 0;
-	TInt i;
-	for (i=0; i<KMaxCpus; ++i)
-		iOld[i] = 0;
-	}
-
-void SIdlePullThread::Finish(TBool aComplete)
-	{
-	if (aComplete && iS)
-		{
-		iS->AcqSLock();
-		iS->SetCpuAffinityT(NKern::CurrentCpu() | KCpuAffinityTransient);
-		iS->RelSLock();
-		}
-	if (iS)
-		iS->DropRef();
-	TInt i;
-	for (i=0; i<KMaxCpus; ++i)
-		if (iOld[i])
-			iOld[i]->DropRef();
-	}
-
-void TSubScheduler::IdlePullSearch(SIdlePullThread& a, TSubScheduler* aDest)
-	{
-	NSchedulable* orig = a.iS;
-	TInt dcpu = aDest->iCpuNum;
-	volatile TUint32& flags = *(volatile TUint32*)&aDest->iRescheduleNeededFlag;
-	iReadyListLock.LockOnly();
-	if (iRdyThreadCount>1)	// if there's only 1 it'll be running so leave it alone
-		{
-		TUint64 pres = iSSList.iPresent64;
-		TInt tries = iRdyThreadCount;
-		if (tries > KMaxTries)
-			tries = KMaxTries;
-		NSchedulable* q = 0;
-		NSchedulable* p = 0;
-		TInt pri = -1;
-		for (; tries>0 && !flags; --tries)
-			{
-			if (p)
-				{
-				p = (NSchedulable*)(p->iNext);
-				if (p == q)
-					pri = -1;
-				}
-			if (pri<0)
-				{
-				pri = __e32_find_ms1_64(pres);
-				if (pri < 0)
-					break;
-				pres &= ~(TUint64(1)<<pri);
-				q = (NSchedulable*)iSSList.iQueue[pri];
-				p = q;
-				}
-			NThreadBase* t = 0;
-			if (p->iParent)
-				t = (NThreadBase*)p;
-			if (p->iCurrent)
-				continue;	// running on other CPU so leave it alone
-			if (p->iFreezeCpu)
-				continue;	// can't run on this CPU - frozen to current CPU
-			if (t && t->iCoreCycling)
-				continue;	// currently cycling through cores so leave alone
-			if (t && t->iHeldFastMutex && t->iLinkedObjType==NThreadBase::EWaitNone)
-				continue;	// can't run on this CPU - fast mutex held
-			if (p->iCpuChange)
-				continue;	// already being migrated so leave it alone
-			if (!CheckCpuAgainstAffinity(dcpu, p->iCpuAffinity))
-				continue;	// can't run on this CPU - hard affinity
-			if (p->iPreferredCpu & NSchedulable::EReadyCpuSticky)
-				continue;	// don't want to move it on idle, only on periodic balance
-			if (pri > a.iPri)
-				{
-				if (p->TakeRef())
-					{
-					a.iS = p;
-					a.iPri = pri;
-					break;
-					}
-				}
-			}
-		}
-	iReadyListLock.UnlockOnly();
-	if (orig && orig!=a.iS)
-		a.iOld[iCpuNum] = orig;
-	}
-
-void NKern::Idle()
-	{
-	TScheduler& s = TheScheduler;
-	TSubScheduler& ss0 = SubScheduler();	// OK since idle thread locked to CPU
-	ss0.iCurrentThread->iSavedSP = 0;		// will become nonzero if a reschedule occurs
-	TUint32 m0 = ss0.iCpuMask;
-	volatile TUint32& flags = *(volatile TUint32*)&ss0.iRescheduleNeededFlag;
-	if (s.iThreadAcceptCpus & m0)			// if this CPU is shutting down, don't try to pull threads
-		{
-		SIdlePullThread ipt;
-		NKern::Lock();
-		s.iIdleBalanceLock.LockOnly();
-		TUint32 active = s.iThreadAcceptCpus;
-		TUint32 srchm = active &~ m0;
-		if (srchm && srchm!=active)
-			{
-			TUint32 randomizer = *(volatile TUint32*)&s.iIdleBalanceLock;
-			TInt nact = __e32_bit_count_32(srchm);
-			while (srchm)
-				{
-				TUint32 srchm2 = srchm;
-				if (nact > 1)
-					{
-					randomizer = 69069*randomizer+41;
-					TUint32 lose = randomizer % TUint32(nact);
-					for (; lose; --lose)
-						srchm2 = srchm2 & (srchm2-1);
-					}
-				TInt cpu = __e32_find_ls1_32(srchm2);
-				TSubScheduler* ss = &TheSubSchedulers[cpu];
-				ss->IdlePullSearch(ipt, &ss0);
-				if (flags)
-					break;
-				srchm &= ~(1u<<cpu);
-				--nact;
-				}
-			}
-		s.iIdleBalanceLock.UnlockOnly();
-		ipt.Finish(!srchm);
-		NKern::Unlock();
-		}
-	DoIdle();
-	}
-
--- a/kernel/eka/nkernsmp/x86/nccpu.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/x86/nccpu.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -191,9 +191,7 @@
 	__e32_io_completion_barrier();
 	a.iBPTimestamp = X86::Timestamp();
 	__e32_io_completion_barrier();
-	a.iBootFlag2 = 3;
-	__e32_io_completion_barrier();
-	while (a.iBootFlag2==3)
+	while (a.iBootFlag2==2)
 		{}
 	__e32_io_completion_barrier();
 	NKern::EnableAllInterrupts();
@@ -201,16 +199,8 @@
 	return KErrNone;
 	}
 
-void InitTimestamp(TSubScheduler* aSS, SNThreadCreateInfo& aInfo)
+void InitAPTimestamp(SNThreadCreateInfo&)
 	{
-	NThread* t = (NThread*)aSS->iCurrentThread;
-	t->iActiveState = 1;
-	if (aSS->iCpuNum == 0)
-		{
-		aSS->iLastTimestamp.i64 = 0;
-		t->iLastActivationTime.i64 = 0;
-		return;
-		}
 	volatile SApInitInfo& a = *(volatile SApInitInfo*)KApBootPage;
 	NKern::DisableAllInterrupts();
 	a.iBootFlag2 = 1;
@@ -220,20 +210,16 @@
 	__e32_io_completion_barrier();
 	a.iAPTimestamp = X86::Timestamp();
 	__e32_io_completion_barrier();
-	while (a.iBootFlag2!=3)
-		{}
-	__e32_io_completion_barrier();
 	TUint64 bpt = a.iBPTimestamp;
 	TUint64 apt = a.iAPTimestamp;
 	TUint64 delta = bpt - apt;
-	aSS->iSSX.iTimestampOffset.i64 = delta;
-	TUint64 now = NKern::Timestamp();
+	TSubScheduler& ss = SubScheduler();
+	ss.iLastTimestamp64 += delta;
+	*(TUint64*)&ss.i_TimestampOffset = delta;
 	__KTRACE_OPT(KBOOT,DEBUGPRINT("APT=0x%lx BPT=0x%lx Delta=0x%lx", apt, bpt, delta));
 	__e32_io_completion_barrier();
-	a.iBootFlag2 = 4;
+	a.iBootFlag2 = 3;
 	NKern::EnableAllInterrupts();
-	t->iLastActivationTime.i64 = now;
-	aSS->iLastTimestamp.i64 = now;
 	}
 
 
--- a/kernel/eka/nkernsmp/x86/ncglob.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/x86/ncglob.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -32,6 +32,8 @@
 TSubScheduler TheSubSchedulers[KMaxCpus];
 extern "C" {
 TSubScheduler* SubSchedulerLookupTable[256];
+
+SVariantInterfaceBlock* VIB;
 }
 
 #ifdef __USE_BTRACE_LOCK__
--- a/kernel/eka/nkernsmp/x86/ncmonitor.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/x86/ncmonitor.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -12,7 +12,7 @@
 //
 // Description:
 // e32\nkernsmp\x86\ncmonitor.cpp
-// Kernel crash debugger - NKERNSMP X86 specific portion
+// Kernel crash debugger - NKERN X86 specific portion
 // 
 //
 
@@ -23,37 +23,128 @@
 #include <kernel/monitor.h>
 
 
-void DisplayNThreadStackedRegs(Monitor& m, SThreadReschedStack& reg)
+void Monitor::DisplaySpinLock(const char* aTitle, TSpinLock* aLock)
 	{
-	m.Printf("CR0 %08x  RsF %08x  EIP %08x  RSN %08x\r\n", reg.iCR0, reg.iReschedFlag, reg.iEip, reg.iReason);
+	volatile TUint32* p = (volatile TUint32*)aLock;
+	Printf("%s %08x %08x\r\n", aTitle, p[0], p[1]);
+	}
+
+EXPORT_C void Monitor::DisplayNThreadInfo(NThread* aT)
+	{
+	DisplayNSchedulableInfo(aT);
 	}
 
-void DisplaySubSchedulerExt(Monitor& m, TSubScheduler& ss)
+void Monitor::DisplayNSchedulableInfo(NSchedulable* aS)
 	{
-	TSubSchedulerX& x = ss.iSSX;
-	m.Printf("Extras[ 0] %08x Extras[ 1] %08x Extras[ 2] %08x Extras[ 3] %08x\r\n", x.iSSXP[0], x.iSSXP[1], x.iSSXP[2], x.iSSXP[3]);
-	m.Printf("Extras[ 4] %08x Extras[ 5] %08x Extras[ 6] %08x Extras[ 7] %08x\r\n", x.iSSXP[4], x.iSSXP[5], x.iSSXP[6], x.iSSXP[7]);
-	m.Printf("Extras[ 8] %08x i_IrqCount %08x i_ExcInfo  %08x i_CrashSt  %08x\r\n", x.iSSXP[8], x.iIrqCount, x.iExcInfo, x.iCrashState);
-	m.Printf("i_APICID   %08x i_IrqNestC %08x i_IrqStkTp %08x i_Tss      %08x\r\n", x.iAPICID, x.iIrqNestCount, x.iIrqStackTop, x.iTss);
-	m.Printf("CpuFreqM   %08x CpuFreqS   %08x CpuPeriodM %08x CpuPeriodS %08x\r\n", x.iCpuFreqRI.iR.iM, x.iCpuFreqRI.iR.iX, x.iCpuFreqRI.iI.iM, x.iCpuFreqRI.iI.iX);
-	m.Printf("TmrFreqM   %08x TmrFreqS   %08x TmrPeriodM %08x TmrPeriodS %08x\r\n", x.iTimerFreqRI.iR.iM, x.iTimerFreqRI.iR.iX, x.iTimerFreqRI.iI.iM, x.iTimerFreqRI.iI.iX);
-	m.Printf("TmstampOff %08x %08x            iSSXP2[0]  %08x iSSXP2[1]  %08x\r\n", I64HIGH(x.iTimestampOffset.i64), I64LOW(x.iTimestampOffset.i64), x.iSSXP2[0], x.iSSXP2[1]);
+	NThread* t = aS->iParent ? (NThread*)aS : 0;
+	NThreadGroup* g = aS->iParent ? 0 : (NThreadGroup*)aS;
+
+	if (t && aS->iParent==aS)
+		Printf("NThread @%08x Pri %d\r\n",aS,aS->iPriority);
+	else if (t)
+		Printf("NThread @%08x (G:%08x) Pri %d\r\n",aS,aS->iParent,aS->iPriority);
+	else
+		Printf("NThreadGroup @%08x Pri %d\r\n",aS,aS->iPriority);
+	Printf("Rdy=%02x Curr=%02x LastCpu=%d CpuChg=%02x FrzCpu=%d\r\n", aS->iReady, aS->iCurrent, aS->iLastCpu, aS->iCpuChange, aS->iFreezeCpu);
+	Printf("Next=%08x Prev=%08x Parent=%08x CPUaff=%08x\r\n", aS->iNext, aS->iPrev, aS->iParent, aS->iCpuAffinity);
+	Printf("PauseCount %02x Susp %1x\r\n", aS->iPauseCount, aS->iSuspended);
+	DisplaySpinLock("SpinLock", &aS->iSSpinLock);
+	Printf("Stopping %02x Events %08x %08x EventState %08x\r\n", aS->iStopping, aS->iEvents.iA.iNext, aS->iEvents.iA.iPrev, aS->iEventState);
+	Printf("TotalCpuTime %08x %08x RunCount %08x %08x\r\n", aS->iTotalCpuTime32[1], aS->iTotalCpuTime32[0], aS->iRunCount32[1], aS->iRunCount32[0]);
+
+	if (g)
+		{
+		// Thread group
+		return;
+		}
+
+	Printf("WaitState %02x %02x [%02x %02x] (%08x)\r\n", t->iWaitState.iWtC.iWtStFlags, t->iWaitState.iWtC.iWtObjType,
+											t->iWaitState.iWtC.iWtStSpare1, t->iWaitState.iWtC.iWtStSpare2, t->iWaitState.iWtC.iWtObj);
+	Printf("BasePri %d MutexPri %d Att=%02x\r\n", t->iBasePri, t->iMutexPri, t->i_ThrdAttr);
+	Printf("HeldFM=%08x FMDef=%02x AddrSp=%08x\r\n", t->iHeldFastMutex, t->iFastMutexDefer, t->iAddressSpace);
+	Printf("Time=%d Timeslice=%d ReqCount=%08x\r\n", t->iTime, t->iTimeslice, t->iRequestSemaphore.iCount);
+	Printf("SuspendCount=%d CsCount=%d CsFunction=%08x\r\n", t->iSuspendCount, t->iCsCount, t->iCsFunction);
+	Printf("LinkedObjType %02x LinkedObj %08x\r\n", t->iLinkedObjType, t->iLinkedObj);
+	Printf("SavedSP=%08x WaitLink:%08x %08x %d\r\n", t->iSavedSP, t->iWaitLink.iNext, t->iWaitLink.iPrev, t->iWaitLink.iPriority);
+	Printf("iNewParent=%08x iExtraContext=%08x, iExtraContextSize=%08x\r\n", t->iNewParent, t->iExtraContext, t->iExtraContextSize);
+	Printf("iUserModeCallbacks=%08x iNThreadBaseSpare6=%08x\r\n", t->iUserModeCallbacks, t->iNThreadBaseSpare6);
+	Printf("iNThreadBaseSpare7=%08x iNThreadBaseSpare8=%08x iNThreadBaseSpare9=%08x\r\n", t->iNThreadBaseSpare7, t->iNThreadBaseSpare8, t->iNThreadBaseSpare9);
+	if (!aS->iCurrent)
+		{
+		TUint32* pS=(TUint32*)t->iSavedSP;
+		SThreadReschedStack reg;
+		MTRAPD(r,wordmove(&reg,pS,sizeof(SThreadReschedStack)));
+		if (r==KErrNone)
+			{
+			Printf("CR0 %08x  RsF %08x  EIP %08x  RSN %08x\r\n", reg.iCR0, reg.iReschedFlag, reg.iEip, reg.iReason);
+			}
+		}
+	NewLine();
 	}
 
-void DisplaySchedulerExt(Monitor& m, TScheduler& s)
+void Monitor::DisplayNFastSemInfo(NFastSemaphore* pS)
+	{
+	if (pS->iCount >= 0)
+		Printf("NFastSemaphore @ %08x Count %d OwningThread %08x\r\n",pS,pS->iCount,pS->iOwningThread);
+	else
+		Printf("NFastSemaphore @ %08x Count %08x (%08x) OwningThread %08x\r\n",pS,pS->iCount,pS->iCount<<2,pS->iOwningThread);
+	}
+
+void Monitor::DisplayNFastMutexInfo(NFastMutex* aM)
+	{
+	Printf("NFastMutex @ %08x HoldingThread %08x iWaitQ Pri Mask %08x %08x\r\n", aM, aM->iHoldingThread, aM->iWaitQ.iPresent[1], aM->iWaitQ.iPresent[0]);
+	DisplaySpinLock("SpinLock", &aM->iMutexLock);
+	}
+
+void DisplaySubSchedulerInfo(Monitor& m, TSubScheduler& ss)
 	{
-	volatile TUint32* sx = (volatile TUint32*)&s.iSX;
-	m.Printf("Extras  0: %08x  1: %08x  2: %08x  3: %08x\r\n",sx[0],sx[1],sx[2],sx[3]);
-	m.Printf("Extras  4: %08x  5: %08x  6: %08x  7: %08x\r\n",sx[4],sx[5],sx[6],sx[7]);
-	m.Printf("Extras  8: %08x  9: %08x  A: %08x  B: %08x\r\n",sx[8],sx[9],sx[10],sx[11]);
-	m.Printf("Extras  C: %08x  D: %08x  E: %08x  F: %08x\r\n",sx[12],sx[13],sx[14],sx[15]);
+	m.Printf("\r\nSUBSCHEDULER %d @%08x:\r\n",ss.iCpuNum,&ss);
+	m.Printf("CurrentThread=%08x\r\n", ss.iCurrentThread);
+	m.Printf("DFCS %08x %08x CPU# %08x CPUmask %08x\r\n", ss.iDfcs.iA.iNext, ss.iDfcs.iA.iPrev, ss.iCpuNum, ss.iCpuMask);
+	m.Printf("KLCount %d DFCPending %02x ReschedNeeded %02x InIDFC %02x\r\n", ss.iKernLockCount, ss.iDfcPendingFlag, ss.iRescheduleNeededFlag, ss.iInIDFC);
+	m.Printf("AddressSpace=%08x ReschedIPIs=%08x iNextIPI %08x\r\n", ss.iAddressSpace, ss.iReschedIPIs, ss.iNextIPI);
+	volatile TUint32* pL = (volatile TUint32*)&ss.iReadyListLock;
+	m.Printf("SpinLock %08x %08x %08x %08x\r\n", pL[0], pL[1], pL[2], pL[3]);
+	m.Printf("Extras[ 0] %08x Extras[ 1] %08x Extras[ 2] %08x Extras[ 3] %08x\r\n", ss.iExtras[0], ss.iExtras[1], ss.iExtras[2], ss.iExtras[3]);
+	m.Printf("Extras[ 4] %08x Extras[ 5] %08x Extras[ 6] %08x Extras[ 7] %08x\r\n", ss.iExtras[4], ss.iExtras[5], ss.iExtras[6], ss.iExtras[7]);
+	m.Printf("Extras[ 8] %08x i_IrqCount %08x i_ExcInfo  %08x i_CrashSt  %08x\r\n", ss.iExtras[8], ss.i_IrqCount, ss.i_ExcInfo, ss.i_CrashState);
+	m.Printf("i_APICID   %08x i_IrqNestC %08x i_IrqStkTp %08x i_Tss      %08x\r\n", ss.i_APICID, ss.i_IrqNestCount, ss.i_IrqStackTop, ss.i_Tss);
+	m.Printf("i_TmrMultF %08x i_TmrMultI %08x i_CpuMult  %08x Extras[13] %08x\r\n", ss.i_TimerMultF, ss.i_TimerMultI, ss.i_CpuMult, ss.iExtras[19]);
+	m.Printf("i_TmOffL   %08x i_TmOffH   %08x Extras[16] %08x Extras[17] %08x\r\n", ss.iExtras[20], ss.iExtras[21], ss.iExtras[22], ss.iExtras[23]);
+	m.Printf("iLastTimestamp %08x %08x   iReschedCount %08x %08x\r\n", ss.iLastTimestamp32[1], ss.iLastTimestamp32[0], ss.iReschedCount32[1], ss.iReschedCount32[0]);
+	}
+
+void Monitor::DisplaySchedulerInfo()
+	{
+	TScheduler* pS=TScheduler::Ptr();
+	Printf("SCHEDULER @%08x:\r\n",pS);
+	Printf("ProcessHandler=%08x MonitorExceptionHandler=%08x RescheduleHook=%08x\r\n",pS->iProcessHandler,pS->iMonitorExceptionHandler,pS->iRescheduleHook);
+	Printf("iActiveCpus1=%08x, iActiveCpus2=%08x, iNumCpus=%d\r\n",pS->iActiveCpus1,pS->iActiveCpus2,pS->iNumCpus);
+	Printf("SYSLOCK @ %08x\r\n",&pS->iLock);
+	DisplayNFastMutexInfo(&pS->iLock);
+	DisplaySpinLock("IdleSpinLock", &pS->iIdleSpinLock);
+	Printf("IdleDfcs %08x %08x CpusNotIdle %08x IdleGeneration %02x IdleSpillCpu %02x\r\n",
+		pS->iIdleDfcs.iA.iNext, pS->iIdleDfcs.iA.iPrev, pS->iCpusNotIdle, pS->iIdleGeneration, pS->iIdleSpillCpu);
+	Printf("Extras  0: %08x  1: %08x  2: %08x  3: %08x\r\n",pS->iExtras[0],pS->iExtras[1],pS->iExtras[2],pS->iExtras[3]);
+	Printf("Extras  4: %08x  5: %08x  6: %08x  7: %08x\r\n",pS->iExtras[4],pS->iExtras[5],pS->iExtras[6],pS->iExtras[7]);
+	Printf("Extras  8: %08x  9: %08x  A: %08x  B: %08x\r\n",pS->iExtras[8],pS->iExtras[9],pS->iExtras[10],pS->iExtras[11]);
+	Printf("Extras  C: %08x  D: %08x  E: %08x  F: %08x\r\n",pS->iExtras[12],pS->iExtras[13],pS->iExtras[14],pS->iExtras[15]);
+	Printf("Extras 10: %08x 11: %08x 12: %08x 13: %08x\r\n",pS->iExtras[16],pS->iExtras[17],pS->iExtras[18],pS->iExtras[19]);
+	Printf("Extras 14: %08x 15: %08x 16: %08x 17: %08x\r\n",pS->iExtras[20],pS->iExtras[21],pS->iExtras[22],pS->iExtras[23]);
+
+	TInt i;
+	for (i=0; i<KMaxCpus; ++i)
+		{
+		TSubScheduler& ss = *pS->iSub[i];
+		DisplaySubSchedulerInfo(*this,ss);
+		}
 	}
 
 SFullX86RegSet& RegSet(TInt aCpu)
 	{
 	TScheduler* pS=TScheduler::Ptr();
 	TSubScheduler& ss = *pS->iSub[aCpu];
-	SCpuData* cpudata = (SCpuData*)ss.iSSX.iTss;
+	SCpuData* cpudata = (SCpuData*)ss.i_Tss;
 	return cpudata->iRegs;
 	}
 
@@ -61,7 +152,7 @@
 	{
 	TScheduler* pS=TScheduler::Ptr();
 	TSubScheduler& ss = *pS->iSub[aCpu];
-	return *ss.iSSX.iTss;
+	return *(TX86Tss*)ss.i_Tss;
 	}
 
 void Monitor::DumpCpuRegisters()
@@ -88,9 +179,9 @@
 		{
 		Printf("CPU %d:\r\n", i);
 		TSubScheduler& ss = *pS->iSub[i];
-		if (!ss.iSSX.iExcInfo)
+		if (!ss.i_ExcInfo)
 			continue;
-		TX86ExcInfo& a = *(TX86ExcInfo*)ss.iSSX.iExcInfo;
+		TX86ExcInfo& a = *(TX86ExcInfo*)ss.i_ExcInfo;
 		Printf("Exc %02x EFLAGS=%08x FAR=%08x ErrCode=%08x\r\n",a.iExcId,a.iEflags,a.iFaultAddress,a.iExcErrorCode);
 		Printf("EAX=%08x EBX=%08x ECX=%08x EDX=%08x\r\n",a.iEax,a.iEbx,a.iEcx,a.iEdx);
 		Printf("ESP=%08x EBP=%08x ESI=%08x EDI=%08x\r\n",a.iEsp,a.iEbp,a.iEsi,a.iEdi);
--- a/kernel/eka/nkernsmp/x86/ncsched.cia	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/x86/ncsched.cia	Wed Sep 01 12:34:56 2010 +0100
@@ -100,7 +100,7 @@
 	asm("je same_thread ");
 	asm("mov eax, [ebx+%0]" : : "i" _FOFF(NThreadBase, iStackBase));
 	asm("add eax, [ebx+%0]" : : "i" _FOFF(NThreadBase, iStackSize));
-	asm("mov ecx, [esi+%0]" : : "i" _FOFF(TSubScheduler, iSSX.iTss));		// iExtras[15] points to TSS
+	asm("mov ecx, [esi+60+%0]" : : "i" _FOFF(TSubScheduler, iExtras));		// iExtras[15] points to TSS
 	asm("mov [ecx+%0], eax" : : "i" _FOFF(TX86Tss, iEsp0));					// set ESP0 to top of new thread supervisor stack
 
 	asm("test byte ptr [ebx+%0], 2" : : "i" _FOFF(NThreadBase,i_ThrdAttr));	// test for address space switch
@@ -551,7 +551,7 @@
 	asm("jz bad_cc");
 	asm("test dl, 3");
 	asm("jnz bad_cc");
-	asm("cmp eax, [edx+%0]": : "i"_FOFF(TSubScheduler,iSSX.iIrqNestCount)); // i_IrqNestCount
+	asm("cmp eax, [edx+52+%0]": : "i"_FOFF(TSubScheduler,iExtras)); // i_IrqNestCount
 	asm("jle irq");
 	asm("cmp al, [edx+%0]": : "i"_FOFF(TSubScheduler, iInIDFC));
 	asm("jz thread");
@@ -609,22 +609,16 @@
 	asm("ret ");
 	}
 
-extern "C" __NAKED__ void send_irq_ipi(TSubScheduler*, TInt)
+extern "C" __NAKED__ void send_irq_ipi(TSubScheduler*)
 	{
-	/* check that EQueueEvent_WakeUp isn't set since we don't support that on x86 yet */
-	asm("test dword ptr [esp+8], 2 ");
-	asm("jnz wake_up_requested ");
 	asm("mov ecx, [esp+4] ");
 	asm("pushfd ");
-	asm("mov edx, [ecx+%0]" : : "i" _FOFF(TSubScheduler, iSSX.iAPICID));
+	asm("mov edx, [ecx+%0]" : : "i" _FOFF(TSubScheduler, i_APICID));
 	asm("cli ");
 	asm("mov ds:[%0], edx" : : "i" (X86_LOCAL_APIC_BASE + X86_LOCAL_APIC_OFFSET_ICRH));
 	asm("mov eax, %0" : : "i" (TRANSFERRED_IRQ_VECTOR | 0x4000));
 	asm("mov ds:[%0], eax" : : "i" (X86_LOCAL_APIC_BASE + X86_LOCAL_APIC_OFFSET_ICRL));
 	asm("popfd ");
 	asm("ret ");
-
-	asm("wake_up_requested: ");
-	asm("int 0xff ");
 	}
 
--- a/kernel/eka/nkernsmp/x86/ncsched.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/x86/ncsched.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -55,38 +55,35 @@
 	{
 	TSubScheduler& ss = TheSubSchedulers[aCpu];
 	__KTRACE_OPT(KSCHED2,DEBUGPRINT("@%d",aCpu));
-	send_ipi(ss.iSSX.iAPICID);
+	send_ipi((TUint32)ss.i_APICID);
 	}
 
-#ifndef __USE_LOGICAL_DEST_MODE__
-extern "C" void __fastcall do_send_resched_ipis(TUint32 aMask)
-	{
-	TInt i=0;
-	for (; aMask; aMask>>=1, ++i)
-		if (aMask&1)
-			send_resched_ipi(i);
-	}
-#endif
-
 extern "C" void send_resched_ipis(TUint32 aMask)
 	{
 	__KTRACE_OPT(KSCHED2,DEBUGPRINT("@%02x",aMask));
-	TScheduler& s = TheScheduler;
-	if (aMask &~ s.iThreadAcceptCpus)
-		aMask = s.ReschedInactiveCpus(aMask);
-	if (aMask)
-		do_send_resched_ipis(aMask);
+#ifdef __USE_LOGICAL_DEST_MODE__
+	do_send_resched_ipis(aMask);
+#else
+	TInt i=0;
+	while (aMask)
+		{
+		if (aMask&1)
+			send_resched_ipi(i);
+		aMask>>=1;
+		++i;
+		}
+#endif
 	}
 
 extern "C" void send_resched_ipi_and_wait(TInt aCpu)
 	{
 	TSubScheduler& ss = TheSubSchedulers[aCpu];
 	__KTRACE_OPT(KSCHED2,DEBUGPRINT("@@%d",aCpu));
-	volatile TUint32& irqc = ss.iSSX.iIrqCount;
-	volatile TInt& irqn = ss.iSSX.iIrqNestCount;
+	volatile TUint32& irqc = (volatile TUint32&)ss.i_IrqCount;
+	volatile TInt& irqn = (volatile TInt&)ss.i_IrqNestCount;
 	TUint32 irqc0 = irqc;
 	mb();
-	send_ipi(ss.iSSX.iAPICID);
+	send_ipi((TUint32)ss.i_APICID);
 	mb();
 	while (!ss.iRescheduleNeededFlag || (irqn<0 && irqc==irqc0))
 		{
@@ -99,8 +96,11 @@
 	{
 	if (aT->iTime>0 && !aT->i_NThread_Initial)
 		{
-		TUint32 x = read_apic_reg(CURRCNT);
-		iSSX.iTimerFreqRI.iI.Mult(x);
+		TUint32 remain32 = read_apic_reg(CURRCNT);
+		TUint64 x(remain32);
+		x *= TUint32(i_TimerMultI);
+		x += 0x00800000u;
+		x >>= 24;
 		aT->iTime = (TInt)x;
 		}
 	write_apic_reg(INITCNT, 0);
@@ -125,33 +125,21 @@
 		aNew = iInitialThread;
 	if (aNew->iTime>0)
 		{
-		TUint32 x = (TUint32)aNew->iTime;
-		iSSX.iTimerFreqRI.iR.Mult(x);
-		write_apic_reg(INITCNT, x);
+		TUint32 remain32 = (TUint32)aNew->iTime;
+		TUint64 x(remain32);
+		x *= TUint32(i_TimerMultF);
+		x += 0x80000000u;
+		x >>= 32;
+		write_apic_reg(LVTTMR, TIMESLICE_VECTOR);
+		write_apic_reg(INITCNT, (TUint32)x);
 		}
 	if (aNew!=aOld)
 		{
 		TUint64 now = NKern::Timestamp();
-		TUint64 delta = now - iLastTimestamp.i64;
-		iLastTimestamp.i64 = now;
-		aOld->iLastRunTime.i64 = now;
-		aOld->iTotalCpuTime.i64 += delta;
-		++iReschedCount.i64;
-		++aNew->iRunCount.i64;
-		if (!aOld->iActiveState)
-			aOld->iTotalActiveTime.i64 += (now - aOld->iLastActivationTime.i64);
-		NSchedulable* parent = aOld->iParent;
-		if (parent != aOld)
-			{
-			parent->iLastRunTime.i64 = now;
-			if (!parent->iActiveState)
-				parent->iTotalActiveTime.i64 += (now - parent->iLastActivationTime.i64);
-			if (parent != aNew->iParent)
-				parent->iTotalCpuTime.i64 += (now - parent->iLastStartTime.i64);
-			}
-		NSchedulable* np = aNew->iParent;
-		if (np!=aNew && np!=parent)
-			np->iLastStartTime.i64 = now;
+		aOld->iTotalCpuTime64 += (now - iLastTimestamp64);
+		iLastTimestamp64 = now;
+		++iReschedCount64;
+		++aNew->iRunCount64;
 		}
 	}
 
--- a/kernel/eka/nkernsmp/x86/ncthrd.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/x86/ncthrd.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -36,7 +36,7 @@
 extern void __ltr(TInt /*aSelector*/);
 
 extern "C" TUint __tr();
-extern void InitTimestamp(TSubScheduler* aSS, SNThreadCreateInfo& aInfo);
+extern void InitAPTimestamp(SNThreadCreateInfo& aInfo);
 
 TInt NThread::Create(SNThreadCreateInfo& aInfo, TBool aInitial)
 	{
@@ -44,7 +44,6 @@
 		return KErrArgument;
 	new (this) NThread;
 	TInt cpu = -1;
-	TSubScheduler* ss = 0;
 	if (aInitial)
 		{
 		cpu = __e32_atomic_add_ord32(&TheScheduler.iNumCpus, 1);
@@ -53,22 +52,20 @@
 		aInfo.iCpuAffinity = cpu;
 		// OK since we can't migrate yet
 		TUint32 apicid = *(volatile TUint32*)(X86_LOCAL_APIC_BASE + X86_LOCAL_APIC_OFFSET_ID) >> 24;
-		ss = &TheSubSchedulers[cpu];
-		ss->iSSX.iAPICID = apicid << 24;
-		ss->iCurrentThread = this;
-		ss->iDeferShutdown = 0;
-		SubSchedulerLookupTable[apicid] = ss;
-		iRunCount.i64 = UI64LIT(1);
-		iActiveState = 1;
-		__KTRACE_OPT(KBOOT,DEBUGPRINT("Init: cpu=%d APICID=%08x ss=%08x", cpu, apicid, ss));
+		TSubScheduler& ss = TheSubSchedulers[cpu];
+		ss.i_APICID = (TAny*)(apicid<<24);
+		ss.iCurrentThread = this;
+		SubSchedulerLookupTable[apicid] = &ss;
+		ss.iLastTimestamp64 = NKern::Timestamp();
+		iRunCount64 = UI64LIT(1);
+		__KTRACE_OPT(KBOOT,DEBUGPRINT("Init: cpu=%d APICID=%08x ss=%08x", cpu, apicid, &ss));
 		if (cpu)
 			{
 			__ltr(TSS_SELECTOR(cpu));
 			NIrq::HwInit2AP();
-			__e32_atomic_ior_ord32(&TheScheduler.iThreadAcceptCpus, 1<<cpu);
-			__e32_atomic_ior_ord32(&TheScheduler.iIpiAcceptCpus, 1<<cpu);
+			__e32_atomic_ior_ord32(&TheScheduler.iActiveCpus1, 1<<cpu);
+			__e32_atomic_ior_ord32(&TheScheduler.iActiveCpus2, 1<<cpu);
 			__e32_atomic_ior_ord32(&TheScheduler.iCpusNotIdle, 1<<cpu);
-			__e32_atomic_add_ord32(&TheScheduler.iCCRequestLevel, 1);
 			__KTRACE_OPT(KBOOT,DEBUGPRINT("AP TR=%x",__tr()));
 			}
 		}
@@ -127,11 +124,10 @@
 		{
 		NKern::EnableAllInterrupts();
 
-		// Initialise timestamp
-		InitTimestamp(ss, aInfo);
+		// synchronize AP's timestamp with BP's
+		if (cpu>0)
+			InitAPTimestamp(aInfo);
 		}
-	AddToEnumerateList();
-	InitLbInfo();
 #ifdef BTRACE_THREAD_IDENTIFICATION
 	BTrace4(BTrace::EThreadIdentification,BTrace::ENanoThreadCreate,this);
 #endif
@@ -153,7 +149,7 @@
 	TInt irq = NKern::DisableAllInterrupts();
 	TSubScheduler& ss = SubScheduler();
 	NThreadBase* ct = ss.iCurrentThread;
-	TInt inc = TInt(ss.iSSX.iIrqNestCount);
+	TInt inc = TInt(ss.i_IrqNestCount);
 	TInt cpu = ss.iCpuNum;
 	NKern::RestoreInterrupts(irq);
 	DEBUGPRINT("Thread %T, CPU %d, KLCount=%08x, IrqNest=%d",ct,cpu,ss.iKernLockCount,inc);
@@ -232,7 +228,7 @@
 	if (pC != this)
 		{
 		AcqSLock();
-		if (iWaitState.ThreadIsDead() || i_NThread_Initial)
+		if (iWaitState.ThreadIsDead())
 			{
 			RelSLock();
 			aAvailRegistersMask = 0;
@@ -283,7 +279,7 @@
 	TGetContextIPI& ipi = *(TGetContextIPI*)aPtr;
 	TX86RegSet& a = *ipi.iContext;
 	TSubScheduler& ss = SubScheduler();
-	TUint32* irqstack = (TUint32*)ss.iSSX.iIrqStackTop;
+	TUint32* irqstack = (TUint32*)ss.i_IrqStackTop;
 	SThreadExcStack* txs = (SThreadExcStack*)irqstack[-1];	// first word pushed on IRQ stack points to thread supervisor stack
 	GetContextAfterExc(a, txs, *ipi.iAvailRegsMask, TRUE);
 	}
@@ -394,7 +390,7 @@
 	if (pC != this)
 		{
 		AcqSLock();
-		if (iWaitState.ThreadIsDead() || i_NThread_Initial)
+		if (iWaitState.ThreadIsDead())
 			{
 			RelSLock();
 			aRegMask = 0;
@@ -571,6 +567,31 @@
 	}
 
 
+/** Return the total CPU time so far used by the specified thread.
+
+	@return The total CPU time in units of 1/NKern::CpuTimeMeasFreq().
+*/
+EXPORT_C TUint64 NKern::ThreadCpuTime(NThread* aThread)
+	{
+	TSubScheduler* ss = 0;
+	NKern::Lock();
+	aThread->AcqSLock();
+	if (aThread->i_NThread_Initial)
+		ss = &TheSubSchedulers[aThread->iLastCpu];
+	else if (aThread->iReady && aThread->iParent->iReady)
+		ss = &TheSubSchedulers[aThread->iParent->iReady & NSchedulable::EReadyCpuMask];
+	if (ss)
+		ss->iReadyListLock.LockOnly();
+	TUint64 t = aThread->iTotalCpuTime64;
+	if (aThread->iCurrent || (aThread->i_NThread_Initial && !ss->iCurrentThread))
+		t += (NKern::Timestamp() - ss->iLastTimestamp64);
+	if (ss)
+		ss->iReadyListLock.UnlockOnly();
+	aThread->RelSLock();
+	NKern::Unlock();
+	return t;
+	}
+
 extern "C" void __fastcall add_dfc(TDfc* aDfc)
 	{
 	aDfc->Add();
@@ -582,8 +603,6 @@
 	__e32_memory_barrier();
 	if (aCallback->iNext != KUserModeCallbackUnqueued)
 		return KErrInUse;
-	if (aThread->i_NThread_Initial)
-		return KErrArgument;
 	TInt result = KErrDied;
 	NKern::Lock();
 	TUserModeCallback* listHead = aThread->iUserModeCallbacks;
--- a/kernel/eka/nkernsmp/x86/ncutilf.cia	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/x86/ncutilf.cia	Wed Sep 01 12:34:56 2010 +0100
@@ -74,9 +74,8 @@
 	asm("test cl, 3 ");
 	asm("jnz short use_tsc_only ");
 	asm("rdtsc ");
-	asm("lea ecx, [ecx+%0]" : : "i" _FOFF(TSubScheduler, iSSX.iTimestampOffset));
-	asm("add eax, [ecx] ");
-	asm("adc edx, [ecx+4] ");
+	asm("add eax, [ecx+80+%0]" : : "i" _FOFF(TSubScheduler, iExtras));
+	asm("adc edx, [ecx+84+%0]" : : "i" _FOFF(TSubScheduler, iExtras));
 	asm("popfd ");
 	asm("ret ");
 
@@ -134,7 +133,7 @@
 	asm("slec_preemption: ");
 	asm("cmp cl, 0xff ");
 	asm("je short slec_1 ");			/* EOrderNone - don't check interrupts or preemption */
-	asm("cmp dword ptr [edx+%0], 0" : : "i"_FOFF(TSubScheduler, iSSX.iIrqNestCount));
+	asm("cmp dword ptr [edx+52+%0], 0" : : "i"_FOFF(TSubScheduler, iExtras));
 	asm("jge short slec_preemption_die ");	/* If called from ISR, die */
 	asm("cmp dword ptr [edx+%0], 0" : : "i" _FOFF(TSubScheduler, iKernLockCount));
 	asm("jnz short slec_1 ");			/* Preemption disabled - OK */
@@ -485,7 +484,7 @@
 	asm("rwrlec_preemption: ");
 	asm("cmp cl, 0xff ");
 	asm("je short rwrlec_1 ");			/* EOrderNone - don't check interrupts or preemption */
-	asm("cmp dword ptr [edx+%0], 0" : : "i"_FOFF(TSubScheduler, iSSX.iIrqNestCount));
+	asm("cmp dword ptr [edx+52+%0], 0" : : "i"_FOFF(TSubScheduler, iExtras));
 	asm("jge short rwrlec_preemption_die ");	/* If called from ISR, die */
 	asm("cmp dword ptr [edx+%0], 0" : : "i" _FOFF(TSubScheduler, iKernLockCount));
 	asm("jnz short rwrlec_1 ");			/* Preemption disabled - OK */
@@ -642,7 +641,7 @@
 	asm("rwwlec_preemption: ");
 	asm("cmp cl, 0xff ");
 	asm("je short rwwlec_1 ");			/* EOrderNone - don't check interrupts or preemption */
-	asm("cmp dword ptr [edx+%0], 0" : : "i"_FOFF(TSubScheduler, iSSX.iIrqNestCount));
+	asm("cmp dword ptr [edx+52+%0], 0" : : "i"_FOFF(TSubScheduler, iExtras));
 	asm("jge short rwwlec_preemption_die ");	/* If called from ISR, die */
 	asm("cmp dword ptr [edx+%0], 0" : : "i" _FOFF(TSubScheduler, iKernLockCount));
 	asm("jnz short rwwlec_1 ");			/* Preemption disabled - OK */
--- a/kernel/eka/nkernsmp/x86/ncutilf.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/x86/ncutilf.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,8 +15,11 @@
 // 
 //
 
-#include <nk_priv.h>
+#include <nkern.h>
 
+extern "C" {
+extern SVariantInterfaceBlock* VIB;
+}
 
 /******************************************************************************
  * Spin lock
@@ -62,6 +65,6 @@
 */
 EXPORT_C TUint32 NKern::TimestampFrequency()
 	{
-	return TheScheduler.iVIB->iTimestampFreq;
+	return VIB->iTimestampFreq;
 	}
 
--- a/kernel/eka/nkernsmp/x86/ncutils.cia	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/x86/ncutils.cia	Wed Sep 01 12:34:56 2010 +0100
@@ -18,7 +18,7 @@
 #include <x86.h>
 #include <apic.h>
 
-extern "C" __NAKED__ void NKIdle(TUint32)
+extern "C" __NAKED__ void NKIdle(TInt)
 	{
 	asm("sti");
 	asm("hlt");
@@ -68,7 +68,7 @@
 	asm("mov edx, eax ");
 	asm("cmp eax, 0 ");
 	asm("jnz short atomic_set_1 ");
-	asm("mov edx, [%a0]" : : "i" (&TheScheduler.iIpiAcceptCpus));
+	asm("mov edx, [%a0]" : : "i" (&TheScheduler.iActiveCpus1));
 	asm("shl edx, 16 ");
 	asm("atomic_set_1: ");
 	asm("or edx, [esi+%0]" : : "i" _FOFF(TSubScheduler,iCpuMask));
@@ -90,7 +90,7 @@
 	asm("jmp short crash_halt ");
 
 	asm("first_to_crash: ");
-	asm("mov ebp, [esi+%0]" : : "i" _FOFF(TSubScheduler,iSSX.iTss));	// points to SCpuData
+	asm("mov ebp, [esi+60+%0]" : : "i" _FOFF(TSubScheduler,iExtras));	// points to SCpuData
 	asm("lea ebp, [ebp+%0]" : : "i" _FOFF(SCpuData,iRegs));
 	asm("pop dword ptr [ebp+%0]" : : "i" _FOFF(SFullX86RegSet,iEsi));
 	asm("pop dword ptr [ebp+%0]" : : "i" _FOFF(SFullX86RegSet,iEbp));
@@ -111,7 +111,7 @@
 	asm("mov [eax+12], fs ");
 	asm("mov [eax+16], gs ");
 	asm("mov [eax+20], ss ");
-	asm("lea ebx, [esi+%0]" : : "i" _FOFF(TSubScheduler,iSSX.iIrqNestCount));
+	asm("lea ebx, [esi+52+%0]" : : "i" _FOFF(TSubScheduler,iExtras));	// points to i_IrqNestCount
 	asm("mov eax, 0x80000000 ");
 	asm("lock xchg eax, [ebx] ");
 	asm("mov [ebp+%0], eax" : : "i" _FOFF(SFullX86RegSet,iIrqNestCount));
@@ -137,7 +137,7 @@
 	asm("not eax ");
 	asm("mov edx, %0": :"i" (addressof_CrashState)); 
 	asm("lock and [edx+2], ax ");
-	asm("mov dword ptr [esi+%0], 1" : : "i" _FOFF(TSubScheduler, iSSX.iCrashState));	// flag that this CPU is done
+	asm("mov dword ptr [esi+44+%0], 1" : : "i" _FOFF(TSubScheduler, iExtras));	// flag that this CPU is done
 	asm("xor ecx, ecx ");
 	asm("wait_other_cpus: ");
 	asm("mov ax, [edx+2] ");
--- a/kernel/eka/nkernsmp/x86/ncutils.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/x86/ncutils.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -17,6 +17,10 @@
 
 #include <x86.h>
 
+extern "C" {
+extern SVariantInterfaceBlock* VIB;
+}
+
 //#define __DBG_MON_FAULT__
 //#define __RAM_LOADED_CODE__
 //#define __EARLY_DEBUG__
@@ -28,7 +32,7 @@
 	return TheScheduler.iIdleGenerationCount;
 	}
 
-void NKern::DoIdle()
+void NKern::Idle()
 	{
 	TScheduler& s = TheScheduler;
 	TSubScheduler& ss = SubScheduler();	// OK since idle thread is locked to CPU
@@ -53,19 +57,8 @@
 			return;
 			}
 		}
-	if (ss.iCurrentThread->iSavedSP)
-		{
-		// rescheduled between entry to NKern::Idle() and here
-		// go round again to see if any more threads to pull from other CPUs
-		__e32_atomic_ior_ord32(&s.iCpusNotIdle, m);	// we aren't idle after all
-		s.iIdleSpinLock.UnlockIrq();
-		return;
-		}
-
 	s.iIdleSpinLock.UnlockOnly();	// leave interrupts disabled
-
 	NKIdle(0);
-	
 	}
 
 TUint32 ContextId()
@@ -321,25 +314,23 @@
 void NKern::Init0(TAny* a)
 	{
 	__KTRACE_OPT(KBOOT,DEBUGPRINT("VIB=%08x", a));
-	SVariantInterfaceBlock* v = (SVariantInterfaceBlock*)a;
-	TheScheduler.iVIB = v;
-	__NK_ASSERT_ALWAYS(v && v->iVer==0 && v->iSize==sizeof(SVariantInterfaceBlock));
-	__KTRACE_OPT(KBOOT,DEBUGPRINT("iVer=%d iSize=%d", v->iVer, v->iSize));
-	__KTRACE_OPT(KBOOT,DEBUGPRINT("iMaxCpuClock=%08x %08x", I64HIGH(v->iMaxCpuClock), I64LOW(v->iMaxCpuClock)));
-	__KTRACE_OPT(KBOOT,DEBUGPRINT("iTimestampFreq=%u", v->iTimestampFreq));
-	__KTRACE_OPT(KBOOT,DEBUGPRINT("iMaxTimerClock=%u", v->iMaxTimerClock));
+	VIB = (SVariantInterfaceBlock*)a;
+	__NK_ASSERT_ALWAYS(VIB && VIB->iVer==0 && VIB->iSize==sizeof(SVariantInterfaceBlock));
+	__KTRACE_OPT(KBOOT,DEBUGPRINT("iVer=%d iSize=%d", VIB->iVer, VIB->iSize));
+	__KTRACE_OPT(KBOOT,DEBUGPRINT("iMaxCpuClock=%08x %08x", I64HIGH(VIB->iMaxCpuClock), I64LOW(VIB->iMaxCpuClock)));
+	__KTRACE_OPT(KBOOT,DEBUGPRINT("iTimestampFreq=%u", VIB->iTimestampFreq));
+	__KTRACE_OPT(KBOOT,DEBUGPRINT("iMaxTimerClock=%u", VIB->iMaxTimerClock));
 	TInt i;
 	for (i=0; i<KMaxCpus; ++i)
 		{
 		TSubScheduler& ss = TheSubSchedulers[i];
-		ss.iSSX.iCpuFreqRI.Set(v->iCpuFreqR[i]);
-		ss.iSSX.iTimerFreqRI.Set(v->iTimerFreqR[i]);
-
-		ss.iSSX.iTimestampOffset.i64 = 0;
-		v->iCpuFreqR[i] = 0;
-		v->iTimerFreqR[i] = 0;
+		ss.i_TimerMultF = (TAny*)KMaxTUint32;
+		ss.i_TimerMultI = (TAny*)0x01000000u;
+		ss.i_CpuMult = (TAny*)KMaxTUint32;
+		VIB->iTimerMult[i] = (volatile STimerMult*)&ss.i_TimerMultF;
+		VIB->iCpuMult[i] = (volatile TUint32*)&ss.i_CpuMult;
 		}
-	TheScheduler.iSX.iTimerMax = (v->iMaxTimerClock / 128);
+	TheScheduler.i_TimerMax = (TAny*)(VIB->iMaxTimerClock / 128);
 	InitFpu();
 	InterruptInit0();
 	}
@@ -360,7 +351,7 @@
  */
 EXPORT_C TInt NKern::TimesliceTicks(TUint32 aMicroseconds)
 	{
-	TUint32 mf32 = (TUint32)TheScheduler.iSX.iTimerMax;
+	TUint32 mf32 = (TUint32)TheScheduler.i_TimerMax;
 	TUint64 mf(mf32);
 	TUint64 ticks = mf*TUint64(aMicroseconds) + UI64LIT(999999);
 	ticks /= UI64LIT(1000000);
@@ -370,24 +361,3 @@
 		return (TInt)ticks;
 	}
 
-TBool TSubScheduler::Detached()
-	{
-	return FALSE;
-	}
-
-TBool TScheduler::CoreControlSupported()
-	{
-	return FALSE;
-	}
-
-void TScheduler::CCInitiatePowerUp(TUint32 /*aCores*/)
-	{
-	}
-
-void TScheduler::CCIndirectPowerDown(TAny*)
-	{
-	}
-
-void TScheduler::DoFrequencyChanged(TAny*)
-	{
-	}
--- a/kernel/eka/nkernsmp/x86/vectors.cia	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/x86/vectors.cia	Wed Sep 01 12:34:56 2010 +0100
@@ -338,10 +338,10 @@
 	asm("shr eax, 24 ");
 	asm("mov esi, [eax*4+%0]" : : "i" (&SubSchedulerLookupTable));
 	asm("mov edi, esp ");								// edi points to saved stuff
-	asm("inc dword ptr [esi+%0]" : : "i" _FOFF(TSubScheduler, iSSX.iIrqCount));	// increment i_IrqCount
-	asm("inc dword ptr [esi+%0]" : : "i" _FOFF(TSubScheduler, iSSX.iIrqNestCount));	// nest count starts at -1, iExtras[13]
+	asm("inc dword ptr [esi+36+%0]" : : "i" _FOFF(TSubScheduler, iExtras));	// increment i_IrqCount
+	asm("inc dword ptr [esi+52+%0]" : : "i" _FOFF(TSubScheduler, iExtras));	// nest count starts at -1, iExtras[13]
 	asm("jnz short nested_irq_entry ");
-	asm("mov esp, [esi+%0]" : : "i" _FOFF(TSubScheduler, iSSX.iIrqStackTop));			// iExtras[14] = irq stack top
+	asm("mov esp, [esi+56+%0]" : : "i" _FOFF(TSubScheduler, iExtras));			// iExtras[14] = irq stack top
 	asm("push edi ");
 	asm("nested_irq_entry: ");
 	asm("mov edx, [esi+%0]" : : "i" _FOFF(TSubScheduler, iCpuMask));
@@ -393,7 +393,7 @@
 	// Postamble. Interrupts disabled here.
 	asm("postamble: ");
 	asm("cli ");
-	asm("dec dword ptr [esi+%0]" : : "i" _FOFF(TSubScheduler, iSSX.iIrqNestCount));
+	asm("dec dword ptr [esi+52+%0]" : : "i" _FOFF(TSubScheduler, iExtras));
 	asm("jns short nested_irq_exit ");
 
 	// Check for deferred/transferred IRQs
@@ -401,11 +401,11 @@
 	asm("je short no_event_handlers ");
 
 	// increment i_IrqNestCount again since we are going to run more ISRs
-	asm("inc dword ptr [esi+%0]" : : "i" _FOFF(TSubScheduler, iSSX.iIrqNestCount));
+	asm("inc dword ptr [esi+52+%0]" : : "i" _FOFF(TSubScheduler, iExtras));
 	asm("push esi ");
 	asm("call %a0" : : "i" (run_event_handlers));
 	asm("add esp, 4 ");
-	asm("dec dword ptr [esi+%0]" : : "i" _FOFF(TSubScheduler, iSSX.iIrqNestCount));
+	asm("dec dword ptr [esi+52+%0]" : : "i" _FOFF(TSubScheduler, iExtras));
 
 	asm("no_event_handlers: ");
 	asm("pop eax ");
@@ -517,7 +517,7 @@
 	asm("ring0_exception: ");
 	asm("mov [ebp], eax ");
 
-	asm("cmp dword ptr [esi+%0], -1 " : : "i" _FOFF(TSubScheduler, iSSX.iIrqNestCount));
+	asm("cmp dword ptr [esi+52+%0], -1 " : : "i" _FOFF(TSubScheduler, iExtras));
 	asm("jnz short fatal_exception_irq ");
 	asm("cmp dword ptr [esi+%0], 0 " : : "i" _FOFF(TSubScheduler, iKernLockCount));
 	asm("jnz short fatal_exception_locked ");
@@ -602,10 +602,10 @@
 	asm("mov esi, ds:[%0]" : : "i" (X86_LOCAL_APIC_BASE + X86_LOCAL_APIC_OFFSET_ID));
 	asm("shr esi, 24 ");
 	asm("mov esi, [esi*4+%0]" : : "i" (&SubSchedulerLookupTable));			// esi -> subscheduler
-	asm("mov ebp, [esi+%0]" : : "i" _FOFF(TSubScheduler, iSSX.iCrashState));
+	asm("mov ebp, [esi+44+%0]" : : "i" _FOFF(TSubScheduler, iExtras));
 	asm("cmp ebp, 16 ");
 	asm("jae nmihook ");
-	asm("mov ebp, [esi+%0]" : : "i" _FOFF(TSubScheduler, iSSX.iTss));		// points to SCpuData
+	asm("mov ebp, [esi+60+%0]" : : "i" _FOFF(TSubScheduler, iExtras));		// points to SCpuData
 	asm("mov edi, %0" : : "i" (addressof_TheScheduler)); 
 	asm("lea ebp, [ebp+%0]" : : "i" _FOFF(SCpuData, iRegs));
 	asm("mov [ebp+%0], eax" : : "i" _FOFF(SFullX86RegSet, iEax));
@@ -627,7 +627,7 @@
 	asm("mov [ebp+%0], eax" : : "i" _FOFF(SFullX86RegSet, iFs));
 	asm("mov ax, gs ");
 	asm("mov [ebp+%0], eax" : : "i" _FOFF(SFullX86RegSet, iGs));
-	asm("lea ebx, [esi+%0]" : : "i" _FOFF(TSubScheduler, iSSX.iIrqNestCount));		// points to i_IrqNestCount
+	asm("lea ebx, [esi+52+%0]" : : "i" _FOFF(TSubScheduler, iExtras));		// points to i_IrqNestCount
 	asm("mov eax, 0x80000000 ");
 	asm("lock xchg eax, [ebx] ");
 	asm("mov [ebp+%0], eax" : : "i" _FOFF(SFullX86RegSet, iIrqNestCount));
@@ -641,7 +641,7 @@
 	asm("pop dword ptr [ebp+%0]" : : "i" _FOFF(SFullX86RegSet, iEsp));
 	asm("pop dword ptr [ebp+%0]" : : "i" _FOFF(SFullX86RegSet, iSs));
 	asm("got_regs: ");
-	asm("mov dword ptr [esi+%0], 2" : : "i" _FOFF(TSubScheduler, iSSX.iCrashState));	// flag that this CPU is done
+	asm("mov dword ptr [esi+44+%0], 2" : : "i" _FOFF(TSubScheduler, iExtras));	// flag that this CPU is done
 	asm("nmi_halt: ");
 	asm("cli ");
 	asm("xor eax, eax ");
@@ -794,10 +794,10 @@
 	{
 	asm("mov eax, ds:[%0]" : : "i" (X86_LOCAL_APIC_BASE + X86_LOCAL_APIC_OFFSET_ID));
 	asm("shr eax, 24 ");
-	asm("mov eax, [eax*4+%0]" : : "i" (&SubSchedulerLookupTable));				// esi -> subscheduler
-	asm("mov eax, [eax+%0]" : : "i" _FOFF(TSubScheduler, iSSX.iIrqStackTop));	// eax = i_IrqStackTop
-	asm("mov eax, [eax-4] ");													// saved supervisor stack pointer
-	asm("mov eax, [eax+%0]" : : "i" _FOFF(SThreadExcStack, iEip));				// saved return address from original interrupt
+	asm("mov eax, [eax*4+%0]" : : "i" (&SubSchedulerLookupTable));			// esi -> subscheduler
+	asm("mov eax, [eax+56+%0]" : : "i" _FOFF(TSubScheduler, iExtras));		// eax = i_IrqStackTop
+	asm("mov eax, [eax-4] ");												// saved supervisor stack pointer
+	asm("mov eax, [eax+%0]" : : "i" _FOFF(SThreadExcStack, iEip));			// saved return address from original interrupt
 	asm("ret ");
 	}
 
@@ -863,7 +863,7 @@
 	asm("shr eax, 1 ");
 	asm("jnc short sgi1 ");
 	asm("sgi2: ");
-	asm("mov ecx, [esi+%0]" : : "i" _FOFF(TSubScheduler, iSSX.iAPICID));
+	asm("mov ecx, [esi+48+%0]" : : "i" _FOFF(TSubScheduler, iExtras));	// ss.i_APICID
 	asm("mov ds:[%0], ecx" : : "i" (X86_LOCAL_APIC_BASE + X86_LOCAL_APIC_OFFSET_ICRH));
 	asm("mov ds:[%0], edx" : : "i" (X86_LOCAL_APIC_BASE + X86_LOCAL_APIC_OFFSET_ICRL));
 	asm("sgi1: ");
--- a/kernel/eka/nkernsmp/x86/vectors.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/nkernsmp/x86/vectors.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -86,11 +86,11 @@
 	{
 	TLinAddr a = 0;
 	if (aCpu>=0 && aCpu<KMaxCpus)
-		a = TLinAddr(TheSubSchedulers[aCpu].iSSX.iIrqStackTop);
+		a = TLinAddr(TheSubSchedulers[aCpu].i_IrqStackTop);
 	else
 		{
 		TInt irq = NKern::DisableAllInterrupts();
-		a = TLinAddr(SubScheduler().iSSX.iIrqStackTop);
+		a = TLinAddr(SubScheduler().i_IrqStackTop);
 		NKern::RestoreInterrupts(irq);
 		}
 	return a;
@@ -150,9 +150,9 @@
 		SetTssDescriptor(&cp.iGdt[5+i], &cd.iTss);
 
 		TSubScheduler& ss = TheSubSchedulers[i];
-		ss.iSSX.iIrqNestCount = (TLinAddr)(-1);
-		ss.iSSX.iIrqStackTop = (TLinAddr)esp;
-		ss.iSSX.iTss = &cd.iTss;
+		ss.i_IrqNestCount = (TAny*)(-1);
+		ss.i_IrqStackTop = (TAny*)esp;
+		ss.i_Tss = &cd.iTss;
 		}
 
 	X86::DefaultCR0 = get_cr0();
--- a/kernel/eka/release.txt	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/release.txt	Wed Sep 01 12:34:56 2010 +0100
@@ -1,1322 +1,787 @@
-Version 2.00.3115
-=================
-(Made by fadhliM 16/08/2010)
-
-1.	daniezho
-	1.	RP527391
-		REQ		417-56902 Instrumentation of USB
-		SUB/SCO	417-72923 Instrumentation of USB - USB package
-
-
-Version 2.00.3114
-=================
-(Made by fadhliM 06/08/2010)
-
-1.	vfebvre
-	1.	ou1cimx1#502965 ENV : E32Test T_HEAPDL Fails TestRHeap::Test3()
-
-2.	jimhofe
-	1.	MINOR_CHANGE Adding f32test\rofs and f32test\loader to package_definition.xml
-	2.	MINOR_CHANGE Adding rofs_tests.mrp
-	3.	MINOR_CHANGE Removing author names from documentation
-
-3.	lanerobe
-	1.	ou1cimx1#506647 T_SMPSOAK debug output is not standard
-
-4.	cnotton
-	1.	ou1cimx1#500725 Coverity defects - Resource Manager and ResManUS
-
-5.	jukwak
-	1.	ou1cimx1#413512 DEV - GPIO SHAI is missing the inclusion of static extension function handlers
-	2.	ou1cimx1#468979 t_pci has dependency on naviengine
-
-
-Version 2.00.3113
-=================
-(Made by fadhliM 02/08/2010)
-
-
-1.	sakhghos
-	1.	ou1cimx1#504256 MCL removal of Run-Mode Debug Driver components from KHS package
-
-2.	h14jiang
-	1.	ou1cimx1#504400 [MCL] Disk full notification pops up
-
-3.	lanerobe
-	1.	ou1cimx1#499080 TExtended::LoadLocale() failed, but may affect the OS locale setting.
-	2.	ou1cimx1#499031 TExtendedLocale::Locale(const TDesC& aLocaleDllName) fail.
-
-4.	martai
-	1.	ou1cimx1#508646 ENV : E32TEST T_SHADOW Fails during testMultipleReadFile()
-
-
-Version 2.00.3112
+Version 2.00.2655
 =================
 (Made by fadhliM 27/07/2010)
 
 1.	vfebvre
-	1.	ou1cimx1#492020 System-critical thread being reported in MC when another permanent thread in same process faults
-
-2.	josezhou
-	1.	ou1cimx1#482087 If the usb device doesn't support HNP, the call to usbd_set_otg_support returns USBD_STALLED 
-
-3.	gcochran
-	1.	ou1cimx1#498830 [mcl] ENV t_svrpinning, _P,_UP test fails with unexpected thread exit type on Vasco/TB9.2  
-
-4.	stmansfi
-	1.	ou1cimx1#496968 Fix domain manager test structure
-
-5.	jcoppear
-	1.	ou1cimx1#500393 Demand paging loses error information when a fatal error occurs
-
-6.	x120li
-	1.	ou1cimx1#493275 TdesC16::LocateReverseF2() function can't stop running.
-
-7.	erifung
-	1.	ou1cimx1#460764 Improve code coverage for kernel power component
-
-8.	davegord
-	1.	ou1cimx1#497240 [mcl] Problem with ExecHandler::FsRegisterThread()
-
-
-Version 2.00.3111
-=================
-(Made by fadhliM 26/07/2010)
-
-1.	lforynsk
-	1.	ou1cimx1#500491 Resource Manager PIL reallocates an array that it doesn't create or delete (kernelhwsrv)
-	2.	ou1cimx1#500836 Resource manager does not response to an asynchronous request if the resource level owner send a request with the same level
-
-2.	gayarama
-	1.	ou1cimx1#473162 DEV Registration of resources for idle is not complete
-	2.	ou1cimx1#493520 DEV Allow simulated resource controller to register with power controller
-
-3.	cnotton
-	1.	ou1cimx1#493455 Test bld.inf files are exporting headers without proper macro
-	2.	MINOR_CHANGE Moved T_TIMESTAMP up above T_LAT2.
-
-4.	erifung
-	1.	ou1cimx1#493519 t_rescontrolcli.exe crash
-
-5.	vfebvre
-	1.	ou1cimx1#483102 H6 baseport bld.inf changes
-
-6.	jcoppear
-	1.	ou1cimx1#428875 MCL NaviEngine baseport bld.inf changes
-
-
-Version 2.00.3110
-=================
-(Made by fadhliM 22/07/2010)
-
-1.	davegord
-	1.	ou1cimx1#488456 (MCL) Kernel signals MTP server unexpectedly and cause it panic
-
-2.	dogunjom
-	1.	ou1cimx1#413278 MCL:Domain Manager - Correct the usage of RArray::Append()
-
-3.	jcoppear
-	1.	ou1cimx1#479322 ENV E32TEST T_RAMDEFRAG test failure investigation (t_ramdefrag.cpp:549)
-
-4.	vfebvre
-	1.	ou1cimx1#460995 ENV E32TEST T_PAGETABLE_LIMIT test failure investigation (t_pagetable_limit.cpp:276)
-
-5.	seolney
-	1.	ou1cimx1#486893 DEV DMA functions missing test code (pt. 2)
-
-6.	mipetzol
-	1.	ou1cimx1#479623 DMA V2 framework PIL enhancement required for management of AsymmmetricSgChannel class descriptors
-
-
-Version 2.00.3109
+	1.	ou1cimx1#488886 System-critical thread being reported in MC when another permanent thread in same process fault
+
+2.	dogunjum
+	1.	ou1cimx1#479596 92: Domain Manager - Correct the usage of RArray::Append()
+
+
+Version 2.00.2654
 =================
 (Made by fadhliM 19/07/2010)
 
-1.	mipetzol
-	1.	ou1cimx1#467351 DMA PIL doesn't check client thread priorities
-	2.	ou1cimx1#467653 DMA PIL: Unnecessary calls to empty virtual function
-
-2.	mmoate
-	1.	ou1cimx1#422063 MCL Test Code Coverage Improvement Phase 1
-
-3.	garciato
-	1.	MINOR_CHANGE Corrections to document and diagram and corrected file name
-
-4.	jcoppear
-	1.	ou1cimx1#460995 ENV E32TEST T_PAGETABLE_LIMIT test failure investigation (t_pagetable_limit.cpp:276)
-
-5.	fagortz
-	1.	ou1cimx1#479558 t_medch does not find suitable drive for test if pagingMediaCheck is false
-
-6.	ferporta
-	1.	ou1cimx1#480991 10.1 Component build failures with f32file.h platform header removal changes
-
-
-Version 2.00.3108
+1.	gcochran
+	1.	DEF144551 t_svrpinning, _P,_UP test fails with unexpected thread exit type on Vasco/TB9.2
+
+2.	martai
+	1.	ou1cimx1#494023 E32TEST T_SHADOW Fails during testMultipleReadFile()
+
+
+Version 2.00.2653
+=================
+(Made by famustaf 14/07/2010)
+
+1.	davegord
+	1.	ou1cimx1#485331 Kernel signals MTP server unexpectedly and cause it panic
+
+
+Version 2.00.2652
 =================
 (Made by famustaf 12/07/2010)
 
-1.	coliward
-	1.	ou1cimx1#457854 Kernel's memmove() routine needs optimising for Win32 UDEB builds
-
-2.	stmansfi
-	1.	ou1cimx1#468733 ENV Remove unnecessary test exports
-
-3.	jimhofe
-	1.	MINOR_CHANGE Adding pkgdefs file for mounting the filesystem from the synergy package
-
-4.	niccox
-	1.	ou1cimx1#474990 h4usbtest.iby is missing t_usb_transfersrv.dll
-
-
-Version 2.00.3107
+1.	jcoppear
+	1.	ou1cimx1#479552 ENV E32TEST T_ALIAS_REMOVE timeout
+	
+
+Version 2.00.2651
+=================
+(Made by famustaf 12/07/2010)
+
+1.	paconway
+	1.	MINOR_CHANGE Correct EPL header for sdapctest.mmp
+
+
+Version 2.00.2650
 =================
 (Made by famustaf 07/07/2010)
 
-1.	necliffo
-	1.	REQ 428-72 Partition support for eMMC-only platforms
-
-
-Version 2.00.3106
-=================
-(Made by famustaf 01/07/2010)
-
-1.	jessiezh
-	1.	ou1cimx1#470771 Improve code coverage for IIC
-
-2.	niccox
-	1.	ou1cimx1#469034 ENV New usbcsc export not frozen
-
-3.	garciato
-	1.	MINOR_CHANGE Add more SMP documentation
-
-
-Version 2.00.3105
-=================
-(Made by vfebvre 28/06/2010)
-
-1.	seolney
-	1.	ou1cimx1#462430 DMA functions missing test code
-
-
-Version 2.00.3104
-=================
-(Made by vfebvre 25/06/2010)
-
-1.	snagappa
-	1.	ou1cimx1#460964 t_dma2 test failure investigation
-
-2.	indrasin
-	1.	MINOR_CHANGE Excluded H2, Emulator test code, H4 flexible memory build
-
-3.	cnotton
-	1.	ou1cimx1#440685 Multimedia headers in kernelhwsrv are including platform headers
-
-4.	erifung
-	1.	ou1cimx1#435148 Unsafe setting of DPowerResourceNotification data
-
-
-Version 2.00.3103
-=================
-(Made by vfebvre 24/06/2010)
-
-1.	snagappa
-	1.	ou1cimx1#432741 Ektran functions missing test cases
-
-2.	erifung
-	1.	ou1cimx1#436980 EResourceManager and TResourceManagerUs e32btrace.h formats cannot be correctly parsed by SymSEE TraceViewer
-
-
-Version 2.00.3102
-=================
-(Made by vfebvre 24/06/2010)
-
-1.	daniezho
-	1.	ou1cimx1#452612 [kernelhwsrvmcl] Not support NCM function in USB shared chunk LDD
-
-2.	cnotton
-	1.	ou1cimx1#435933 E32TEST T_TIMESTAMP test failure investigation (SMP, t_timestamp.cpp:194)
-
-
-Version 2.00.3101
-=================
-(Made by vfebvre 22/06/2010)
-
-1.	erifung
-	1.	ou1cimx1#436941 Category 20 (TResourceManagerUs) cannot be enabled in btrace
-
-2.	indrasin
-	1.	MINOR_CHANGE Included H2/H4/H6, emulator builds, excluded TraceCore from rapu for sirocco building
-	2.	MINOR_CHANGE Excluded TraceCore from rapu baseport for sirocco building
-
-
-Version 2.00.3100
+1.	paconway
+	1.	REQ 417-56766 MBBMS over CMMB for TD-SCDMA Gen. 2 MobileTv
+
+
+Version 2.00.2144
 =================
 (Made by vfebvre 21/06/2010)
 
 1.	stmansfi
-	1.	ou1cimx1#451185 DEV MCL Warnings in DRM_DebugEventHandler header for coverage builds
-
-2.	mipetzol
-	1.	ou1cimx1#457256 Changes done in DMA PIL DMA V2 framework to adapt to ST PSL
-
-3.	lanerobe
-	1.	ou1cimx1#447463 VFP Mode inheritance fix
-
-4.	kmetherm
-	1.	ou1cimx1#442009 DEV RVCT4.0 Compilation issues in  when building bsp
-
-
-Version 2.00.3099
+	1.	ou1cimx1#451247 DEV 9.2 Warnings in DRM_DebugEventHandler header for coverage builds
+
+
+Version 2.00.2143
 =================
 (Made by vfebvre 18/06/2010)
 
 1.	jimhofe
-	1.	ou1cimx1#443337 Automouter is not referenced by the package_definition.xml file
-
-2.	mipetzol
+	1.	ou1cimx1#443255 Automouter is not referenced by the package_definition.xml file
+
+
+Version 2.00.2142
+=================
+(Made by vfebvre 17/06/2010)
+
+1.	mipetzol
 	1.	MINOR_CHANGE DMA header file in-source documentation update
 
-3.	tocosgro
-	1.	ou1cimx1#403437 RVCT 4.0: Definition of BTraceFiltered8 engenders undefined behaviour
-		RVCT4 with -O3 and -Otime creates incorrect object code when we cast a function
-		call in order to call a function that should have more parameters with fewer than it
-		needs.
-
-		This is done by various of the BTrace macros in e32btrace.h (Btrace0(), BTrace4(), etc, etc),
-		using internal typedefs TBTrace1, TBTrace2 and TBTrace 3.
-
-		The change is to remove the casts (and the typedefs to avoid this being done again
-		immediately) and add explicit 0 arguments to the calls in the macros.
-
-		The impact of this on the generated code is precisely to add the extra register load immediate
-		instructions (e.g. mov r3, #0).
-
-4.	shubmurt
-	1.	ou1cimx1#428765 Case and Slash fix for Linux Build
-
-5.	kmetherm
-	1.	ou1cimx1#419204 DEV-T_CrashMonitor_Lib test fails when built with RVCT4.0 compiler
-	2.	ou1cimx1#390590 DEV-T_KHEAP test fails when built with RVCT4.0 compiler
-	3.	ou1cimx1#423744 DEV-T_XXVer2 test fails/times out when built with RVCT4.0 compiler
-
-
-Version 2.00.3098
-=================
-(Made by vfebvre 18/06/2010)
-
-1.	garciato
-	1.	RP520151
-		REQ:417-52765 - SMP: Product Quality SMP Kernel for Bridge
-
-
-Version 2.00.3097
+
+Version 2.00.2141
 =================
 (Made by vfebvre 16/06/2010)
 
 1.	jcoppear
-	1.	ou1cimx1#444092 MCL ENV E32TEST T_THRASH test timeout on 92
-
-2.	shubmurt
-	1.	ou1cimx1#423695 MCL:Mobile Crash #25334: CodeAbort exception in CompleteQue method, kernel/sproperty.cpp
-
-
-Version 2.00.3095
+	1.	ou1cimx1#443819 ENV E32TEST T_THRASH test timeout on 92
+
+
+Version 2.00.2140
+=================
+(Made by vfebvre 15/06/2010)
+
+1.	martai
+	1.	ou1cimx1#437377 E32TEST T_CHUNK test failure investigation (t_chunk.cpp:885)
+
+
+Version 2.00.2139
 =================
 (Made by vfebvre 14/06/2010)
 
-1.	kingzhan
-	1.	ou1cimx1#425296 MCL Mutex ordering violation in USB driver
-
-2.	jcoppear
-	1.	ou1cimx1#432392 System reset during execution of T_SHBUF_CLIENT
-	2.	ou1cimx1#380623 WDP: Non aligned swap writes increase media wear
-
-3.	martai
-	1.	ou1cimx1#435628 Copy of WDP: Paged data can be corrupted randomly
-	2.	ou1cimx1#424896 E32TEST T_RAMALL occasionally times out
-	3.	ou1cimx1#412959 ENV X86GCC compilation warnings t_ramall.cpp
-	4.	ou1cimx1#384467 Contiguous memory allocations do not use multi-page write support
-
-4.	coliward
-	1.	ou1cimx1#428886 SDK specific: Unable to Install Midlet in the Emulator.
-
-
-Version 2.00.3094
+1.	martai
+	1.	ou1cimx1#435560 WDP: Paged data can be corrupted randomly
+
+
+Version 2.00.2138
 =================
 (Made by vfebvre 10/06/2010)
 
 1.	jimhofe
-	1.	ou1cimx1#419221 Missing exported kernelhwsrv documentation causes build breaks
-
-2.	lanerobe
-	1.	ou1cimx1#427741 Reset timestamp before running test
-
-
-Version 2.00.3093
+	1.	ou1cimx1#419218 Missing exported kernelhwsrv documentation causes build breaks
+
+
+Version 2.00.2137
 =================
 (Made by vfebvre 09/06/2010)
 
-1.	gcochran
-	1.	ou1cimx1#400079 MCL: E32TEST RMessagePtr2::Kill is not exercised by t_message
-
-2.	jimhofe
-	1.	ou1cimx1#411346 MCL wk22 build break in kernelhwsrv
-
-
-Version 2.00.3092
+1.	shubmurt
+	1.	ou1cimx1#387232 CodeAbort exception in CompleteQue method, kernel/sproperty.cpp
+		Changes in Publish & Subscribe
+
+2.	coliward
+	1.	ou1cimx1#424882 SDK specific: Unable to Install Midlet in the Emulator.
+
+
+Version 2.00.2136
+=================
+(Made by vfebvre 07/06/2010)
+
+1.	lanerobe
+	1.	ou1cimx1#393868 Use built-in uint32 sort function
+
+2.	martai
+	1.	ou1cimx1#414410 E32TEST T_RAMALL occasionally times out
+
+
+Version 2.00.2135
 =================
 (Made by vfebvre 04/06/2010)
 
-1.	cnotton
-	1.	ou1cimx1#413372 Attempt to export missing file bootstrap_smrif.h
-
-
-Version 2.00.3091
-=================
-(Made by vfebvre 04/06/2010)
-
-1.	mmoate
-	1.	MINOR_CHANGE Correct insource docs for aSingleThread parameter in UserHeap methods
-
-
-Version 2.00.3090
+1.	kingzhan
+	1.	ou1cimx1#415058 92 Mutex ordering violation in USB driver
+
+2.	cnotton
+	1.	ou1cimx1#414553 Attempt to export missing file bootstrap_smrif.h
+
+
+Version 2.00.2134
+=================
+(Made by vfebvre 03/06/2010)
+
+1.	martai
+	1.	ou1cimx1#414435 WDP: The paging cache can increase beyond its maximum size temporarily
+
+
+Version 2.00.2133
 =================
 (Made by vfebvre 03/06/2010)
 
 1.	jimhofe
 	1.	MINOR_CHANGE Documentation formatting tweaks
 
-
-Version 2.00.3089
-=================
-(Made by vfebvre 01/06/2010)
+2.	gcochran
+	1.	ou1cimx1#400068 E32TEST RMessagePtr2::Kill is not exercised by t_message
+
+
+Version 2.00.2132
+=================
+(Made by vfebvre 02/06/2010)
+
+1.	davegord
+	1.	ou1cimx1#410777 Kernel Message Pool corrupted by delayed DeadClientCleanup
+
+
+Version 2.00.2130
+=================
+(Made by vfebvre 28/05/2010)
 
 1.	lanerobe
-	1.	ou1cimx1#397118 Use build-in uint32 sort function
-
-
-Version 2.00.3088
-=================
-(Made by vfebvre 28/05/2010)
-
-1.	necliffo
-	1.	ou1cimx1#407499 modify medmmc to ensure format
-
-2.	lanerobe
-	1.	ou1cimx1#402843 Fix smppower .mmp files
-
-
-Version 2.00.3086
+	1.	ou1cimx1#399811 BM_SUITE does not run on NaviEngine
+
+
+Version 2.00.2129
 =================
 (Made by vfebvre 27/05/2010)
 
-1.	atvamos
-	1.	ou1cimx1#376123 h2.arm4.udeb.f32test.page ROFSBUILD failed on dev-cedar build
-
-2.	vfebvre
-	1.	ou1cimx1#400806 Warnings reported by the Symbian Foundation license checker
-
-3.	garciato
-	1.	ou1cimx1#379971 Incorrect Copyright Headers in e32test\timestamp
-
-4.	djkovace
-	1.	ou1cimx1#367370 Bridge platform neither reboots nor runs crash debugger when crashed
-
-5.	martai
-	1.	ou1cimx1#399892 E32TEST T_CHUNK test failure investigation (t_chunk.cpp:885)
-
-6.	elzou
-	1.	ou1cimx1#393943 Phone reset if connect/disconnect USB mouse few times fast
-
-7.	lanerobe
-	1.	ou1cimx1#399642 Build HCR test roms in its own folder
-	2.	ou1cimx1#353110 BM_SUITE does not run on NaviEngine
-
-8.	hengrant
-	1.	ou1cimx1#377057 Trace outputs truncated data for length and position
-
-
-Version 2.00.3085
-=================
-(Made by vfebvre 18/05/2010)
-
-1.	gayarama
-	1.	ou1cimx1#382130 DEV HCR settings to be used by PRM and its clients
-
-2.	mipetzol
-	1.	MINOR_CHANGE Updated comments in dma_v2.h
-
-
-Version 2.00.3084
-=================
-(Made by vfebvre 17/05/2010)
-
-1.	indrasin
-	1.	MINOR_CHANGE: TITANIUM (SIROCCO MIGRATION): submitting build.config.xml for sirocco migration to identify components to be build
-
-2.	shubmurt
-	1.	DEF144569 t_datapaging passes when data paging is not enabled
-		t_datapaging should fail if data paging is not reported in a ROM that is meant to be be data paged
-	2.	ou1cimx1#361046 T_WSD* test set fails to compile / run when built with RVCT4.0 compiler
-
-
-Version 2.00.3083
-=================
-(Made by vfebvre 13/05/2010)
+1.	vfebvre
+	1.	ou1cimx1#400807 Warnings reported by the Symbian Foundation license checker
+
+2.	lanerobe
+	1.	ou1cimx1#399627 Build HCR test roms in its own folder
+
+
+Version 2.00.2128
+=================
+(Made by vfebvre 26/05/2010)
+
+1.	elzou
+	1.	ou1cimx1#393925 Phone reset if connect/disconnect USB mouse few times fast
+
+
+Version 2.00.2127
+=================
+(Made by vfebvre 24/05/2010)
+
+1.	jcoppear
+	1.	ou1cimx1#389410 ENV E32TEST T_IPCCPY hangs on H4HRP.ARMV5.UREL.FMM.ONENANDPAGE
+
+
+Version 2.00.2126
+=================
+(Made by vfebvre 20/05/2010)
+
+1.	necliffo
+	1.	ou1cimx1#389444 NAND paging are in bootloop
+
+
+Version 2.00.2125
+=================
+(Made by vfebvre 19/05/2010)
+
+1.	hengrant
+	1.	ou1cimx1#377066 Trace outputs truncated data for length and position
+
+
+Version 2.00.2124
+=================
+(Made by vfebvre 14/05/2010)
 
 1.	famustaf
-	1.	ou1cimx1#380321 Build on Linux - Incorrect slash in #include in sf_sys.cpp
-
-2.	cnotton
-	1.	ou1cimx1#380725 Public headers in bt are including platform headers
-
-
-Version 2.00.3082
+	1.	ou1cimx1#380187 Build on Linux - Incorrect slash in #include in sf_sys.cpp
+		Changed backslash to forward slash.
+
+
+Version 2.00.2123
 =================
 (Made by vfebvre 12/05/2010)
 
-1.	mipetzol
-	1.	MINOR_CHANGE Update to DMAv2 Porting Guide
-
-2.	lanerobe
-	1.	ou1cimx1#378811 Change kernel use of %lS to %S
-	2.	ou1cimx1#378808 MCL Stop ExecHandler accessing user descriptors directly
-
-3.	migubarr
-	1.	ou1cimx1#377322 New T_FILECACHE test failures (t_filecache.cpp:356)
-
-4.	hengrant
-	1.	ou1cimx1#370931 Memory card gets locked by itself MCL
-
-
-Version 2.00.3081
+1.	stmansfi
+	1.	RM 417-69728 KHS Digitiser HAL Changes 92
+		PackageReleaseID=488421
+
+
+Version 2.00.2122
 =================
 (Made by vfebvre 11/05/2010)
 
-1.	jimhofe
-	1.	ou1cimx1#367892 Changing MedSD3c PolicyId from 2 to 1461
-
-2.	martai
-	1.	PDEF145025 Support rapu variant specific e32tests 
-
-3.	kmetherm
-	1.	PR457093 RVCT 4 compatible software codebase (SSS)
-
-
-Version 2.00.3080
+1.	martai
+	1.	ou1cimx1#378868 Contiguous memory allocations do not use multi-page write support
+
+2.	jimhofe
+	1.	ou1cimx1#367891: Changing MedSD3c PolicyId from 2 to 1461
+
+
+Version 2.00.2121
 =================
 (Made by vfebvre 10/05/2010)
 
 1.	necliffo
-	1.	ou1cimx1#378256 eMMC reliable Write can increase wear of eMMC devices
-
-2.	jessiezh
-	1.	MINOR_CHANGE Re-enable T_SOUND2 test
-	2.	ou1cimx1#367177 E32TEST T_DOMAIN test failure investigation
-
-3.	gcochran
-	1.	ou1cimx1#367939 MCL: Undefined Symbol error with the header "e32math.h"
-
-
-Version 2.00.3079
+	1.	ou1cimx1#375835: eMMC reliable Write can increase wear of eMMC devices
+
+
+Version 2.00.2120
 =================
 (Made by vfebvre 07/05/2010)
 
 1.	mipetzol
-	1.	MINOR_CHANGE: Updated comment in dma_v1.h
-	2.	MINOR_CHANGE: Updated comment in dma_v2.h
-
-
-Version 2.00.3078
+	1.	ou1cimx1#374045 DMA V2 should be removed from TB9.2
+
+2.	jcoppear
+	1.	ou1cimx1#37212: WDP: Non aligned swap writes increase media wear
+
+
+Version 2.00.2119
 =================
 (Made by vfebvre 05/05/2010)
 
-1.	cnotton
-	1.	ou1cimx1#345137 idlehelper_lib & Power DLL don't build for ARM4SMP (kernelhwsrv)
-
-2.	jimmzhou
-	1.	ou1cimx1#366912 [kernelmcl][[Internal]t_usbapi test is not ready to run on production phone environment Vasco/hw79
+1.	jimmzhou
+	1.	ou1cimx1#366904 [kernel92][[Internal]t_usbapi test is not ready to run on production phone environment Vasco/hw79
+
+2.	gcochran
+	1.	ou1cimx1#367933 TB9.2 - Undefined Symbol error with the header "e32math.h"
 
 3.	ricoles
-	1.	PDEF144020 SMP known test failures
-
-4.	y153liu
-	1.	ou1cimx1#355904 MCL_Music playback is not correct after resuming the playback from the USB headset AD-83 after long pause
-
-
-Version 2.00.3077
-=================
-(Made by vfebvre 04/05/2010)
-
-1.	martai
-	1.	ou1cimx1#337920 WDP:Potential system impact of flushing the entire page cache is unacceptable
-
-2.	shubmurt
-	1.	PDEF145383 E32TEST T_DATAPAGING occasionally reports KERN-EXEC 17 on SMPDATAPAGE configs
-
-
-Version 2.00.3076
+	1.	DEF139990 SMP known test failures 
+
+
+Version 2.00.2118
 =================
 (Made by vfebvre 30/04/2010)
 
 1.	stmansfi
-	1.	ou1cimx1#352017 (MCL) Advisory notes related to cat x in TB92SF_1116 and MSF00398
-	2.	ou1cimx1#361803 (MCL) Adjust HAL::GetAll() to ignore DisplayMemoryHandle attribute
-
-2.	vfebvre
-	1.	ou1cimx1#357360 Some test binaries are targeted by several bld.inf files
-	2.	ou1cimx1#363918 Non-test binaries targeted by several bld.inf files
-
-
-Version 2.00.3075
-=================
-(Made by vfebvre 29/04/2010)
-
-1.	seolney
-	1.	REQ417-52838 Upgrade DMA API to support advanced addressing modes
-		PackageReleaseID=485812 FeaturePlanID=428985
-
-
-Version 2.00.3074
+	1.	ou1cimx1#361784 HAL GetAll() returns handle based attributes leading to unnecessary resource allocation
+
+2.	jimhofe
+	1.	ou1cimx1#366068 Change unistore II policyId from 2 to 1455
+
+
+Version 2.00.2117
 =================
 (Made by vfebvre 28/04/2010)
 
 1.	necliffo
-	1.	ou1cimx1#357516 eMMC with DDR-mode support is not used in 4-bit mode
-
-
-Version 2.00.3073
+	1.	ou1cimx1#358999 eMMC with DDR-mode support is not used in 4-bit mode
+
+2.	martai
+	1.	ou1cimx1#354860 WDP:Potential system impact of flushing the entire page cache is unacceptable
+
+3.	y153liu
+	1.	ou1cimx1#355901 Music playback is not correct after resuming the playback from the USB headset AD-83 after long pause
+
+
+Version 2.00.2116
+=================
+(Made by vfebvre 28/04/2010)
+
+1.	stmansfi
+	1.	ou1cimx1#361073 [System Build]: Advisory notes related to cat x in TB92SF_1116 and MSF00398
+
+2	shubmurt
+	1.	DEF144601 E32TEST T_DATAPAGING occasionally reports KERN-EXEC 17 on SMPDATAPAGE configs
+
+
+Version 2.00.2115
 =================
 (Made by vfebvre 26/04/2010)
 
 1.	jimmzhou
-	1.	ou1cimx1#352019 [kernelmcl]Can't recieve USB data after Host call SetConfiguraion
-
-
-Version 2.00.3072
-=================
-(Made by vfebvre 22/04/2010)
-
-1.	migubarr
-	1.	ou1cimx1#356834 Execution of the kernelhwsrv test suites on H4HRP.ARMV5.U*.FMM.MMCPAGE does not complete
-
-
-Version 2.00.3071
+	1.	ou1cimx1#351997 [kernel92]Can't recieve USB data after Host call SetConfiguraion
+
+
+Version 2.00.2114
 =================
 (Made by vfebvre 21/04/2010)
 
 1.	davegord
-	1.	ou1cimx1#353902 MCL DownloadServerMgr.exe causes phone crash
-
-
-Version 2.00.3070
-=================
-(Made by vfebvre 20/04/2010)
-
-1.	seolney
-	1.	PDEF145220 Fault possible if client deletes DMA request in callback
-
-2.	lanerobe
-	1.	ou1cimx1#352938 E32TEST T_TIMER test failure investigation
-
-
-Version 2.00.3069
-=================
-(Made by vfebvre 20/04/2010)
-
-1.	vfebvre
-	1.	REQ417-62711 Sirocco: Build and Test Systems Migration
-		PackageReleaseID=487623 FeaturePlanID=457782
-
-
-Version 2.00.3068
+	1.	ou1cimx1#353731 DownloadServerMgr.exe causes phone crash
+
+
+Version 2.00.2113
 =================
 (Made by vfebvre 16/04/2010)
 
 1.	jimmzhou
-	1.	ou1cimx1#342082 Logitech USB desktop microphone is not recogonized
-
-
-Version 2.00.3067
-=================
-(Made by vfebvre 16/04/2010)
-
-1.	vfebvre
-	1.	No change
-
-
-Version 2.00.3066
-=================
-(Made by vfebvre 15/04/2010)
-
-1.	migubarr
-	1.	REQ 415-7212 NFE drive encryption on Demand Paging-enabled device
-		PackageReleaseID=453228 FeatureReleaseID=447937
-
-
-Version 2.00.3065
-=================
-(Made by vfebvre 15/04/2010)
-
-1.	ahiron
-	1.	DEF145202: E32TEST T_IIC test failure investigation (KERN-EXEC 17) 
-
-2.	vfebvre
-	1.	MINOR_CHANGE Temporarily disable crash-prone test T_SOUND2 until it is fixed (DEF144934)
-
-
-Version 2.00.3064
-=================
-(Made by vfebvre 14/04/2010)
-
-1.	jcoppear
-	1.	PDEF144022: T_SHADOW failing test that ROM is section mapped (t_shadow.cpp:360)
-
-
-Version 2.00.3063
-=================
-(Made by vfebvre 13/04/2010)
-
-1.	vfebvre
-	1.	MINOR_CHANGE Re-add changes reverted by DEF145318
-	2.	MINOR_CHANGE Reinstate temporarily commented out code in t_rescontrolcli.cpp to avoid warnings
-
-
-Version 2.00.3062
-=================
-(Made by vfebvre 12/04/2010)
-
-1.	kmetherm
-	1.	REQ 417-57581 RVCT 4 compatible software codebase (SSS)
-		PackageReleaseID=476546 FeaturePlanID=444184
-
-2.	jcoppear
-	1.	DEF145150: WDP: No support for testing whether device drivers are WDP safe
-
-
-Version 2.00.3061
-=================
-(Made by vfebvre 12/04/2010)
-
-1.	jimhofe
-	1.	ou1cimx1#343350 Changed unistore policyId from 2 to 1455
-
-
-Version 2.00.3060
+	1.	ou1cimx1#342085 [kernel92]Logitech USB desktop microphone is not recogonized.
+
+
+Version 2.00.2112
 =================
 (Made by vfebvre 12/04/2010)
 
-1.	vfebvre
-	1.	DEF145318 [System Build]:CBR stage errors in MSF00392 vtb101sf and vfuture builds
-
-
-Version 2.00.3059
+1.	jcoppear
+	1.	PDEF145321: WDP: WDP only writes one page to swap at a time
+	2.	DEF143737: T_SHADOW failing test that ROM is section mapped (t_shadow.cpp:360)
+
+
+Version 2.00.2111
 =================
 (Made by vfebvre 09/04/2010)
 
-1.	seolney
-	1.	ou1cimx1#339838 t_dma times out on SMP datapaged system
-		Reduce number of test iterations and different fragment sizes tested
-
-2.	cnotton
-	1.	ou1cimx1#341002 Wrong copyright header under sf\os\kernelhwsrv\kernel\eka\drivers\power\smppower
-
-
-Version 2.00.3058
-=================
-(Made by vfebvre 09/04/2010)
-
-1.	stmansfi
-	1.	DEF145294 Update HCR API comments and documentation
-
-2.	vfebvre
-	1.	DEF145224 Change distribution policy ID of hcr/documents to 1
-
-3.	marisood
-	1.	PDEF145242 E32TEST T_PRMACCTSTSIM fails on NE1_TB.ARMV5.UDEB.DATAPAGE
-
-
-Version 2.00.3057
+1.	vfebvre
+	1.	PDEF145226 Change distribution policy ID of hcr/documents to 1
+
+
+Version 2.00.2110
 =================
 (Made by vfebvre 08/04/2010)
 
-1.	lforynsk
-	1.	DEF144907: T_CPUTIME fails on several platforms 
-
-2.	stmansfi
-	1.	DEF145153 GPIO template implementation should use VARIANT.MMH to specify its .LIB file to
-
-3.	shenzhou
-	1.	ou1cimx1#335116:change_otg_descriptor_returned_location
-
-4.	jcoppear
-	1.	PDEF144022: T_SHADOW failing test that ROM is section mapped (t_shadow.cpp:360)
-
-5.	shubmurt
-	1.	DEF145149 WDP: paging benchmarks minimum value incorrectly reported
-
-
-Version 2.00.3056
-=================
-(Made by vfebvre 08/04/2010)
-
-1.	mmoate
-	1.	REQ 417-52840 Upgrade memory allocator to a higher performance allocator
-		PackageReleaseID=413335 FeaturePlanID=413327
-		CR503 RHeap hybrid heap reimplementation
-
-
-Version 2.00.3055
-=================
-(Made by vfebvre 08/04/2010)
-
-1.	garciato
-	1.	MINOR CHANGE Moving headers to EPL for kern core stats test code
-
-
-Version 2.00.3054
+1.	shenzhou
+	1.	ou1cimx1#335076 change_otg_descriptor_returned_location
+
+2.	marisood
+	1.	DEF144852 E32TEST T_PRMACCTSTSIM fails on NE1_TB.ARMV5.UDEB.DATAPAGE
+
+3.	martai
+	1.	DEF145234 SALM-83WJYV: WDP: Potential system impact of flushing the entire page cache is
+
+
+Version 2.00.2109
 =================
 (Made by vfebvre 29/03/2010)
 
-1.	vfebvre
-	1.	DEF145148 E32TEST T_SHBUF_OWN test failure investigation (t_shbuf.cpp:2083)
-
-2.	garciato
-	1.	DEF144785 t_timerduration sporadically fails on builds with load balancer and idle code
-
-3.	dogunjum
-	1.	DEF145185 TEventModifier in e32keys.h does not support QT Key Event Handling
-		New key event modifiers added to TEventModifier in e32keys.h. EModifierLongKey = 0x20000000
-		for Long key press and EModiferExternalKey = 0x40000000 for Accessory key event. EAllModifiers
-		a member of TEventModifier  changed to support the addition of the new key event modifiers.
-		i.e. EAllModifiers=0x1fffffff changed to EAllModifiers=0xffffffff.
-
-4.	gcochran
-	1.	PDEF145132 TRLM-83EGSL Paging HAL stats not visible
-
-5.	mmoate
-	1.	PDEF145152 \e32utils\nistsecurerng\* has incorrect distribution.policy.s60 ID
-
-
-Version 2.00.3053
+1.	mmoate
+	1.	DEF145151 \e32utils\nistsecurerng\* has incorrect distribution.policy.s60 ID 
+
+
+Version 2.00.2108
 =================
 (Made by vfebvre 26/03/2010)
 
-1.	jimmzhou
-	1.	ou1cimx1#320634 [kernelmcl]Phone Crash when USB MobileTV device CU-14A is connected
-
-
-Version 2.00.3052
-=================
-(Made by vfebvre 25/03/2010)
-
-1.	gavguo
-	1.	REQ:417-57581:RVCT 4 compatible software codebase
-		PackageReleaseID=462344 FeaturePlanID=444184
-
-
-Version 2.00.3051
-=================
-(Made by vfebvre 25/03/2010)
+1.	seolney
+	1.	DEF144784 Fault possible if client deletes DMA request in callback 
+
+2.	jimmzhou
+	1.	ou1cimx1#320637[kernel92]Phone Crash when USB MobileTV device CU-14A is connected
+
+3.	gcochran
+	1.	DEF145128 TRLM-83EGSL Paging HAL stats not visible in TB92
+
+
+Version 2.00.2107
+=================
+(Made by vfebvre 24/03/2010)
 
 1.	lanerobe
-	1.	PDEF145143 KHS Documentation is not contributed to the Symbian Foundation
-
-
-Version 2.00.3050
+	1.	DEF144929 KHS Documentation is not contributed to the Symbian Foundation
+
+
+Version 2.00.2106
 =================
 (Made by vfebvre 23/03/2010)
 
-1.	josezhou
-	1.	ou1cimx1#312908 : RUsbHubDriver interface can only be called by FDF, but multiple clients might have conflict requests to the interfaces 
-
-2.	lanerobe
-	1.	DEF145040 E32TEST T_THREAD test failure investigation
-
-
-Version 2.00.3049
-=================
-(Made by vfebvre 22/03/2010)
-
-1.	lanerobe
-	1.	DEF145041 E32TEST T_TIMER test failure investigation
-
-
-Version 2.00.3048
-=================
-(Made by vfebvre 22/03/2010)
-
 1.	lanerobe
-	1.	DEF145039 E32TEST T_SDRIVERS test failure investigation
-	2.	PDEF144928 Symbian Foundation build error due to missing usb components
-
-
-Version 2.00.3047
+	1.	DEF144874 Intermittent E32TEST T_MSTIM test failures on the H4 (line 371)
+
+
+Version 2.00.2105
+=================
+(Made by vfebvre 22/03/2010)
+
+1.	josezhou
+	1.	ou1cimx1#312934 : RUsbHubDriver interface can only be called by FDF, but multiple clients might have conflict requests to the interfaces 
+
+2.	ferporta
+	1.	PDEF145131 System Crash Monitor contains memory model dependent #defines
+	2.	DEF144875 E32TEST T_RMDEBUG2_OEM failing on UREL SMP configurations
+
+
+Version 2.00.2104
 =================
 (Made by vfebvre 19/03/2010)
 
-1.	jimmzhou
-	1.	ou1cimx1#310882: BELS-7YXDRY RDevUsbcClient::ReadUntilShort complete unexpected
-
-2.	lanerobe
-	1.	DEF144874 Intermittent E32TEST T_MSTIM test failures on the H4 (line 371)
-
-3.	fagortz
-	1.	DEF144667 WDP: t_medch crashes the system if a page out happens
-
-
-Version 2.00.3046
+1.	lanerobe
+	1.	DEF144712 Symbian Foundation build error due to missing usb components
+
+
+Version 2.00.2103
 =================
 (Made by vfebvre 18/03/2010)
 
-1.	lanerobe
-	1.	DEF145036 T_CONTEXT test failure investigation 
-
-2.	ferporta
-	1.	DEF145026 Remove SCM memory model dependency
-	2.	DEF144875 E32TEST T_RMDEBUG2_OEM failing on UREL SMP configurations
-
-3.	genwei
-	1.	ou1cimx1#301181: The device under test exits the high-speed host electrical test mode without operator action
-
-
-Version 2.00.3045
+1.	genwei
+	1.	ou1cimx1#301151: The device under test exits the high-speed host electrical test mode without operator action
+
+
+Version 2.00.2102
 =================
 (Made by vfebvre 17/03/2010)
 
-1.	lanerobe
-	1.	MINOR_CHANGE Fix copyright notices on power management code
-
-2.	martai
-	1.	PDEF145027 FMM - BTrace messages EKernelMemory are missing from the flexible memory model
-
-
-Version 2.00.3044
-=================
-(Made by vfebvre 15/03/2010)
+1.	sattiyap
+	1.	DEF144982 Support rapu variant specific e32tests
+
+
+Version 2.00.2101
+=================
+(Made by vfebvre 12/03/2010)
 
 1.	jimmzhou
-	1.	CR ou1cimx1#300759: kernel_mcl: A malfunctioning peripheral still cannot be reported to the UI, breaking the "no silent failures" policy of USB OTG
-		TKEA-836MEU
-
-2.	martai
-	1.	PDEF144923 FMM - The virtual address space manager allocates incorrect size heap cells
-	2.	DEF144936 It is not possible to free a RAM zone via its ID
-
-
-Version 2.00.3043
-=================
-(Made by vfebvre 12/03/2010)
-
-1.	seolney
-	1.	DEF144850 E32TEST T_DMASIM fails on x86pc (level 012) 
+	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.	PDEF144977 EMOL-83CGYT: SPB 10.1: Device freeze when corrupted memory card is used.
-
-3.	mmaksymi
-	1.	DEF144804 OST Kernel Code Doesn't Comply with Header Relocation Rules
-
-
-Version 2.00.3042
+	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.	DEF144836: for submission to MCL: TSW defect TSW YXIO-82ZBP
-
-2.	gcochran
-	1.	PDEF144935 MMEG-83F9A8 - Misleading error message in ExecHandler::ThreadRequestSignal
-
-3.	tommarti
-	1.	DEF144920 Wrong license in some FMM source files
-
-
-Version 2.00.3041
-=================
-(Made by vfebvre 10/03/2010)
-
-1.	gayarama
-	1.	PDEF144756 t_tbus_datapaging test fails on Vasco/TB9.2 due to fileserver api issue
+	1.	DEF144628: for submission: TSW defect TSW YXIO-82ZBPL
 
 2.	martai
-	1.	DEF144781: MMEG-8369AQ RThread::Create documentation doesn't mention the minimum stack size 
-
-3.	davegord
-	1.	DEF144743 Kernel Message Pool corrupted by delayed DeadClientCleanup 
-
-
-Version 2.00.3040
+	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.	lforynsk
-	1.	DEF144742: T_Cputime failing on winscw and HREF
-
-2.	lanerobe
+1.	lanerobe
 	1.	DEF144710 bootloader component not built in KHS package
 
-
-Version 2.00.3039
+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.	jimmzhou
-	1.	PDEF144619: ARAN-82PGM3: Connecting empty cable causes error, after connecting/disconnecting
-
-2.	y153liu
-	1.	PDEF144726: Extra KErrUsbOtgPeriphNotSupported Event for Peripheral Requires More power
-
-3.	davegord
-	1.	DEF144818 Moving Model version of ReadAndParseDesHeader() can reference uninitialised data 
-
-
-Version 2.00.3038
+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.	ahiron
-	1.	DEF144450 DIicBusChannel timeouts are handled incorrectly
-		Relates to Break Request in Polonium:
-		#455 - IIC: access to iTimeoutTimer and macros GET_TRANS_SPEED, SET_TRANS_SPEED
-	2.	DEF144748 iic_transaction.h, .inl should be exported with the appropriate macros
-	3.	DEF144488 IIC interface for setting up transaction speed is confusing
-		Relates to Break Request in Polonium:
-		#455 - IIC: access to iTimeoutTimer and macros GET_TRANS_SPEED, SET_TRANS_SPEED
-
-2.	martai
-	1.	PDEF144757 ArmMmu::ReleasePagesFromDMA() may hold system lock for unbounded time periods
-	2.	PDEF144572: DBase Reference counting contains incorrect debug assertions 
-
-3.	jessiezh
-	1.	DEF144709:T_IIC should not be limited to execution on the Emulator
-		iic build warnings and errors fix
-
-4.	genwei
-	1.	PDEF144770 USB PIL Crash after MTP server panic
-
-
-Version 2.00.3037
+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.	cnotton
-	1.	REQ 417-52765 SMP: Product Quality SMP Kernel for Bridge
-		PackageReleaseID=451110 FeatureReleaseID=440027
-
-
-Version 2.00.3036
-=================
-(Made by vfebvre 03/03/2010)
-
-1.	mipetzol
-	1.	DEF144291 DMA: Apply fix for DEF143310 (PRM) also to DMAv2
-
-2.	marisood
-	1.	DEF144635 Coverity defect in eka/ewsrv/ky_tran.cpp (UNINIT)
-
-3.	ferporta
-	1.	DEF143491 Breakpoints in looping code can be missed when inserting/deleting and stepping
-	2.	DEF142018 Debug Sec Srv crashes if asked for an incompat srv version
-	3.	DEF143991 E32TEST T_RMDEBUG2_OEM fails on Navi-Engine with WDP enabled
-
-4.	paconway
-	1.	DEF144633 Coverity defect in onbl2.cpp (UNINIT) 
-
-
-Version 2.00.3035
+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.	seolney
-	1.	PDEF144695 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.	jimhofe
-	1.	MINOR_CHANGE: Changing policy Id to 7 for os\kernelhwsrv\kernel\eka\drivers\pbus\mmc\sdcard\XXXX\sdcard3c
-
-
-Version 2.00.3034
+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.	DEF144564 E32TEST T_PIN test failures on x86gcc.fmm (t_pin.cpp:688)
-	2.	DEF144687 OSTv2 doesn't provide a standarised way for instrumentors to add UDEB only trace
-
-2.	jimmzhou
-	1.	PDEF144575 for submission: TSW defect TSW TRLM-82BCNG: t_usb_device test fails
-	2.	PDEF144581 - for base submission: fix defect YXIO-824BQL RUsb::DeviceStateNotification doesn'
-
-
-Version 2.00.3033
+	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.	frhofman
-	1.	DEF142944: T_IDRV - fails with test drive count is more than the supportedsrives on gekko77
-
-2.	marisood
-	1.	DEF144627:Coverity defects in btrace_analyse.cpp 
-
-
-Version 2.00.3032
-=================
-(Made by vfebvre 25/02/2010)
-
-1.	davegord
-	1.	REQ417-62614 Data exports across DLL boundaries
-		PackageReleaseID=450554 FeatureReleaseID=450540
-		PNUN-7T4E35 efile/loader: Writable DLL data across DLL boundary does not work
-
-
-Version 2.00.3031
+1.	lforynsk
+	1.	PDEF144647:Occasional T_CHNOT failures on SMP configurations 
+
+
+Version 2.00.2091
 =================
 (Made by vfebvre 25/02/2010)
 
-1.	mipetzol
-	1.	PDEF144567: Rapu Base Port DMA tests failing
-
-2.	jcoppear
-	1.	DEF144597 WDP: WDP only writes one page to swap at a time
-
-3.	gcochran
-	1.	DEF144355 - t_context locks up on Vasco/HW79 
-
-4.	hengrant
-	1.	PDEF144605 Incorrect trace metadata included in medsd.mmp
-
-
-Version 2.00.3030
-=================
-(Made by vfebvre 25/02/2010)
-
-1.	martai
-	1.	REQ 417-68452 Provide a WDP configuration for Atlantis
-		PackageReleaseID=463461 FeatureReleaseID=463452
-
-
-Version 2.00.3029
+1.	gcochran
+	1.	DEF144355  t_context locks up on Vasco/HW79
+
+2.	davegord
+	1.	DEF144641 Data import/export across DLL boundaries doesn't work in all cases
+		Implements REQ417-62614 "Data exports across DLL boundaries"
+
+
+Version 2.00.2090
+=================
+(Made by vfebvre 24/02/2010)
+
+1.	jcoppear
+	1.	PDEF144517: Emulator crashes when run under Carbide debugger on Windows 7
+
+2.	hengrant
+	1.	DEF144604 Incorrect trace metadata included in medsd.mmp
+
+
+Version 2.00.2089
 =================
 (Made by vfebvre 23/02/2010)
 
-1.	lforynsk
-	1.	DEF144416: Occasional T_CHNOT failures on SMP configurations
-		There is a potential race condition, if the calling thread runs on a different
-		CPU than the Supervisor thread, which can result this thread being signalled
-		before the RHandleBase is fully closed.
-
-		Used EKernelHalSupervisorBarrier to wait until the Supervisor thread gets to
-		idle which is the indication that the DChangeNotifier::Complete() function has
-		returned and the Kernel memory was released (DThread object was closed)
-
-2.	vfebvre
-	1.	PDEF144553 T_SHBUF failures on X86GCC/FMM (t_shbuf:2835)
-
-3.	jcoppear
-	1.	PDEF144518 Emulator crashes when run under Carbide debugger on Windows 7
-
-
-Version 2.00.3028
-=================
-(Made by vfebvre 19/02/2010)
+1.	vfebvre
+	1.	DEF142659 T_SHBUF failures on X86GCC/FMM (t_shbuf:2835)
+
+
+Version 2.00.2088
+=================
+(Made by vfebvre 22/02/2010)
+
+1.	kingzhan
+	1.	DEF144531 for submission: TSW defect TSW TRLM-82BCNG
+		TSW TRLM-82BCNG: t_usb_device test fails
+
+
+2.	mipetzol
+	1.	DEF144549: Rapu Base Port DMA tests failing
+		The DMA channel DFC now takes into account that the channel might get
+		closed by the client in the transfer completion callback.
+
+3.	martai
+	1.	DEF144546: DBase Reference counting contains incorrect debug assertions
+
+
+Version 2.00.2087
+=================
+(Made by vfebvre 22/02/2010)
+
+1.	vfebvre
+	1.	DEF144532 [System Build]: Build failed for TB92SF_1052 due to missing .mrp change  
+
+
+Version 2.00.2086
+=================
+(Made by vfebvre 18/02/2010)
 
 1.	jimhofe
-	1.	MINOR_CHANGE: Removing obsolete files
-
-2.	cnotton
-	1.	DEF144396 h2.arm4.udeb.f32test.page ROMs are not built on devcedar builds
-
-
-Version 2.00.3027
-=================
-(Made by vfebvre 18/02/2010)
-
-1.	shamaden
-	1.	MINOR_CHANGE: SFL to EPL copyrights
-
-2.	vfebvre
-	1.	DEF144065 boostrap.flm is broken
-
-3.	amironen
-	1.	MINOR_CHANGE Adding GPIO Extenders support has been added
-		This project target is introducing support for GPIO Extender by introducing
-		new 32-bit pin id which consists of two parts highest 16-bit defines the GPIO
-		device(SOC or 0-15 GPIO extenders) and the lowest 16-bit defines the 65K of
-		SOC or GPIO extender pins. 
-
-4.	paconway
-	1.	PDEF144501 SD mounting issue due to postponed door-open media change
-
-
-Version 2.00.3026
-=================
-(Made by vfebvre 17/02/2010)
-
-1.	sakhghos
-	1.	PDEF144158 IMPORT_C missing from declaration of StopModeDebug::ExitPoint() RVCT4.0
-
-
-Version 2.00.3025
+	1.	MINOR_CHANGE: Removing obsolete txt file
+
+
+Version 2.00.2085
 =================
 (Made by vfebvre 15/02/2010)
 
-1.	tommarti
-	1.	MINOR_CHANGE Remove outdated comments from mpager.cpp
-
-
-Version 2.00.3024
+1.	ferporta
+	1.	DEF142026 Core Dump Server not getting events after attaching to more than one executable
+	2.	PDEF143992 E32TEST T_RMDEBUG2_OEM fails on Navi-Engine with WDP enabled 
+	3.	DEF143480 t_rmdebug2_oem, t_rmdebug2 test fails on production hw79/vasco with debug server
+
+2.	paconway
+	1.	DEF144234 SD mounting issue due to postponed door-open media change
+
+
+Version 2.00.2084
 =================
 (Made by vfebvre 11/02/2010)
 
-1.	tommarti
-	1.	DEF144393 SMP: Minimum page cache size not set correctly on SMP systems
-
-
-Version 2.00.3023
+1.	kingzhan
+	1.	DEF144402 - for base submission: fix defect YXIO-824BQL RUsb::DeviceStateNotification doesn'
+		TSW YXIO-824BQL:RUsb::DeviceStateNotification doesn't notify any device status
+		change after failing to TryStart USB stack
+
+2.	coliward
+	1.	DEF144164: WSD data is allocated incorrectly on the kernel heap
+		WSD was being allocated on the kernel heap, which was causing large Qt
+		programs to fail to start up, given that the kernel heap is limited to 16 MB.
+
+
+Version 2.00.2083
 =================
 (Made by vfebvre 10/02/2010)
 
-1.	mmoate
-	1.	PackageReleaseID=446093 FeatureReleaseID=445992
-		Cryptographically-Strong Random Number Generator
-
-
-Version 2.00.3022
-=================
-(Made by vfebvre 09/02/2010)
-
-1.	cnotton
-	1.	PDEF144259: HAL header files can now been returned to platform...
-	2.	MINOR_CHANGE Fixed T_RMDEBUG_MULTI_AGENT compile issue with SYMBIAN_ENABLE_PUBLIC_PLATFORM_HEADER_SPLIT.
-
-
-Version 2.00.3021
+1.	martai
+	1.	PackageReleaseID=457064 FeatureReleaseID=457058
+		REQ 417-65372 Enabling and validation of WDP in TB9.2
+
+
+Version 2.00.2082
 =================
 (Made by vfebvre 08/02/2010)
 
-1.	cnotton
-	1.	MINOR_CHANGE Fixed RM_DEBUG test code issue for SYMBIAN_ENABLE_PUBLIC_PLATFORM_HEADER_SPLIT.
-	2.	PDEF144300 eslm-82cags locmedia_ost.h is missing in wk05 NCP79 build
+1.	jimmzhou
+	1.	DEF144308 XLII-7ZNH37: Phone crashes when running usbmsapp test with usbcsc.ldd
 
 2.	martai
-	1.	PDEF144330: FMM handles IPC aliasing inefficiently
-
-
-Version 2.00.3020
+	1.	DEF144290: FMM handles IPC aliasing inefficiently 
+
+
+Version 2.00.2081
 =================
 (Made by vfebvre 05/02/2010)
 
 1.	cnotton
-	1.	MINOR_CHANGE Fixed RM_DEBUG test code issue for SYMBIAN_ENABLE_PUBLIC_PLATFORM_HEADER_SPLIT.
-
-2.	tocosgro
-	1.	DEFECT FIX: DEF144243 JHWG-822NAG FOUR_TUINT8 macro in e32cmn.h caused compiling warning in RVCT4
-		Cast to TUint32 before shift to avoid RVCT4 compiler warning.
-
-3.	coliward
-	1.	PDEF144269 WSD data is allocated incorrectly on the kernel heap
-		WSD was being allocated on the kernel heap, which was causing large Qt programs
-		to fail to start up, given that the kernel heap is limited to 16 MB.
-
-
-Version 2.00.3019
-=================
-(Made by vfebvre 05/02/2010)
-
-1.	lforynsk
-	1.	DEF144007 New Platform Independent Coverity Defect
-
-2.	djkovace
-	1.	PDEF144260:  [SymTB10.1] PL310 maintenance by IndexWay misses some ways
-
-3.	mipetzol
-	1.	PDEF144193 DMA: PIL detection of missed interrupts can fail
-		The method whereby the DMA PIL tried to detect missed PSL DMA interrupts could
-		yield false positives resulting in spurious missed interrupts which ultimately
-		led to the DMA driver crashing. The detection condition has been reworked to
-		rule out those false positives.
-
-4.	tocosgro
-	1.	MINOR_CHANGE: Use blhi rather than bhi to a panic, for call stack
-		Change bhi to blhi and blo to bllo so that LR is set for stack trace
-
-5.	gcochran
-	1.	DEF144239: t_perflogger tests fails at kern perf logger tests on production hw79/vasco
-
-
-Version 2.00.3018
+	1.	DEF144265: eslm-82cags locmedia_ost.h is missing in wk05 NCP79 build
+
+
+Version 2.00.2080
+=================
+(Made by vfebvre 04/02/2010)
+
+1.	djkovace
+	1.	DEF144258: [SymTB9.2]  PL310 maintenance by IndexWay misses some ways
+
+
+Version 2.00.2079
 =================
 (Made by vfebvre 03/02/2010)
 
 1.	migubarr
-	1.	PDEF143960: MMC stack initialisation enables DMA when ESupportsDoubleBuffering specified 
-
-
-Version 2.00.3017
+	1.	DEF143959: MMC stack initialisation enables DMA when ESupportsDoubleBuffering specified 
+
+2.	gcochran
+	1.	DEF143479: t_perflogger tests fails at kern perf logger tests on production hw79/vasco
+
+
+Version 2.00.2078
 =================
 (Made by vfebvre 02/02/2010)
 
-1.	martai
-	1.	DEF144198 FMM: The RAM zone callback function ERamZoneOp_Init isn't invoked in the FMM 
-
-
-Version 2.00.3016
+1.	virodion
+	1.	DEF144163 E32 T_VIDEOMEMORY test failed at line 124
+		Defect fix for TSW: EYGL-7SPCS3
+
+2.	cnotton
+	1.	DEF144062 HAL header files can now been returned to platform...
+
+3.	martai
+	1.	PDEF144201 FMM: The RAM zone callback function ERamZoneOp_Init isn't invoked in the FMM
+
+
+Version 2.00.2077
+=================
+(Made by vfebvre 01/02/2010)
+
+1.	mipetzol
+	1.	DEF144066 DMA: PIL detection of missed interrupts can fail
+		The method whereby the DMA PIL tried to detect missed PSL DMA interrupts
+		could yield false positives resulting in spurious missed interrupts which
+		ultimately led to the DMA driver crashing. The detection condition has been
+		corrected to rule out the false positives.
+
+
+Version 2.00.2076
 =================
 (Made by vfebvre 29/01/2010)
 
-1.	vfebvre
-	1.	PDEF144097 BTracex_ldd causing missing file warning in CTS77 image creation - TSW Defect
-
-
-Version 2.00.3015
-=================
-(Made by vfebvre 28/01/2010)
-
 1.	necliffo
-	1.	DEF144094: BGAHSMMCPTN does not check for partition table version
-		Modified BGAHSMMCPTN to check version of table is supported.
-
-
-Version 2.00.3014
-=================
-(Made by vfebvre 27/01/2010)
-
-1.	famustaf
-	1.	MINOR_CHANGE Add documentation to 'Copy' in Text Shell
-		Added documentation to state that ShellFunction::Copy will overwrite existing file(s)
-
-2.	stmansfi
-	1.	MINOR_CHANGE Improved HCR HAI in-source documentation
-
-3.	amironen
-	1.	DEF144028 HCR Get large settings API does not check for invalid arguments
-	2.	MINOR_CHANGE HCR: Add test scenarios from User Guide and improve robustness
-
-
-Version 2.00.3013
-=================
-(Made by vfebvre 27/01/2010)
-
-1.	cnotton
+	1.	PDEF144095: BGAHSMMCPTN does not check for partition table version
+
+2.	mmoate
+	1.	DEF144102 Missing distribution.policy.s60 file in TB92SF_1021
+
+
+Version 2.00.2075
+=================
+(Made by vfebvre 26/01/2010)
+
+1.	josezhou
+	1.	DEF143803 COPY of DEF143562:No error note about connected USB HUB shown
+	2.	DEF143802 copied open for submission:EDHO-7Y3AAD, USB connection: 
+	3.	DEF143804 COPY of DEF143568:USB using an obsoleted API to allocate endpoint resource
+	4.	DEF143799 COPY of DEF142812: SMP-Panic in the TDfcQue::ThreadFunction when USB channel is
+	5.	DEF143800 COPY of DEF142888: SMP-t_usbdi test case 1231 failed
+
+2.	ange
+	1.	PDEF143797 Precondition is not met when USB OTG driver use Kernel API 
+
+3.	vfebvre
 	1.	MINOR_CHANGE Fixed test code for File Header Relocation
 
 
-Version 2.00.3012
+Version 2.00.2074
 =================
 (Made by vfebvre 25/01/2010)
 
 1.	djkovace
-	1.	PDEF144004 Fix PL310 erratum 727915
-
-2.	x120li
-	1.	DEF143955 Submit UTF-16 descriptor APIs to TB101
-		Submit remaining part of PREQ2471
-
-
-Version 2.00.3011
+	1.	DEF143683 Fix PL310 erratum 727915
+
+2.	dogunjum
+	1.	DEF137221 NE1 PCI driver not confirmed SMPSAFE automatic test case missing
+
+3.	vfebvre
+	1.	DEF143067 BTracex_ldd causing missing file warning in CTS77 image creation - TSW Defect
+
+
+Version 2.00.2073
+=================
+(Made by vfebvre 25/01/2010)
+
+1.	mmoate
+	1.	MILESTONE: SymTB9.2, GT0660, MS3.8, DS.1456
+		REQ427:125 Cryptographically-Strong Random Number Generator [PREQ211]
+
+
+Version 2.00.2072
 =================
 (Made by vfebvre 25/01/2010)
 
@@ -1324,157 +789,83 @@
 	1.	MINOR_CHANGE Update required to base_e32.mrp for Header Relocation
 
 
-Version 2.00.3010
-=================
-(Made by vfebvre 19/01/2010)
-
-1.	gcochran
-	1.	DEF143458 E32 T_CODEPAGING test is not support large page cache TSW: EYGL-7T38TL
-
-2.	vfebvre
-	1.	MINOR_CHANGE Fix copyright notices in newly submitted files
-
-
-Version 2.00.3009
+Version 2.00.2071
+=================
+(Made by vfebvre 21/01/2010)
+
+1.	ryharkin
+	1.	PDEF143852 - TConsoleKey missing iPointerNumber
+		The text window server class TConsoleKey is missing the iPointerNumber member value
+
+
+Version 2.00.2070
 =================
 (Made by vfebvre 18/01/2010)
 
 1.	shamaden
-	1.	DEF143830:  Memory model information missing from overnight test logs
+	1.	DEF143440  t_heap fails when KHeapMinCellSize = 16
 
 2.	necliffo
-	1.	PDEF143883: SALM-7ZQN53 WDP: EMMC drive not mountable as Mass Storage 
-
-
-Version 2.00.3008
+	1.	DEF143882: SALM-7ZQN53 WDP: EMMC drive not mountable as Mass Storage
+
+3.	gcochran
+	1.	DEF143458: E32 T_CODEPAGING test is not support large page cache (TB9.2) TSW: EYGL-7T38TL
+
+4.	vfebvre
+	1.	DEF142990 Change to Make Files - Causing OS Base Build Failure
+
+
+Version 2.00.2069
 =================
 (Made by vfebvre 15/01/2010)
 
 1.	martai
-	1.	PDEF143818:  t_fuzzldr crashes/hangs on FMM and Datapaged ROMs
+	1.	DEF143580: t_fuzzldr crashes/hangs on FMM and Datapaged ROMs
+	2.	DEF143441: FMM: Minimise size of live list when demand paging disabled 
 
 2.	tommarti
-	1.	DEF140936: T_WDPSTRESS fails on NaviEngine SMPPAGE/SMPKERNEL
-
-
-Version 2.00.3007
+	1.	Fix for DEF140936: T_WDPSTRESS fails on NaviEngine SMPPAGE/SMPKERNEL
+
+
+Version 2.00.2068
 =================
 (Made by vfebvre 15/01/2010)
 
-1.	shamaden
-	1.	PDEF143831 t_heap fails when KHeapMinCellSize = 16 for IVAL (WDP)
-
-2.	djkovace
-	1.	DEF143786 Support platform specific mappings on 1136
-
-
-Version 2.00.3006
-=================
-(Made by vfebvre 13/01/2010)
-
-1.	vfebvre
-	1.	DEF142854 Bootstrap.flm and related bld.inf changes not submitted to the MCL
-		Update the Base Port Template so the bootstrap is built using the new
-		bootstrap FLM with Raptor.
-
-
-Version 2.00.3005
+1.	djkovace
+	1.	PDEF143736 OOM defect in DVirtualPinMapping::New
+	2.	PDEF143812 Support platform specific mappings on 1136
+
+2.	necliffo
+	1.	DEF143340 JPLS-7XXEAC: eMMC initialisation fails with Samsung 32GB
+	2.	DEF143593 WDP: Phone does not boot if SWAP drive is corrupted
+
+3.	martai
+	1.	DEF142714: Frequent T_RAMDEFRAG failures observed on the H4 
+
+4.	vfebvre
+	1.	PDEF143659 Bootstrap.flm and related bld.inf changes not submitted to the MCL
+
+5.	marisood
+	1.	DEF143212: Missing M&FS files from Symbian Foundation due to IP classifications 
+
+
+Version 2.00.2067
 =================
 (Made by vfebvre 12/01/2010)
 
-1.	ryharkin
-	1.	DEF143738 TConsoleKey missing iPointerNumber
-		Integrating changes from Kernel Extentions team to add iPointerNumber to TConsoleKey
-
-2.	ange
-	1.	DEF143703 Precondition is not met when USB OTG driver use Kernel API
-
-
-Version 2.00.3004
+1.	cnotton
+	1.	MINOR_CHANGE Fixed some smaller compile issues with split and relocation header changes.
+
+
+Version 2.00.2066
 =================
 (Made by vfebvre 11/01/2010)
 
-1.	prbetage
-	1.	DEF142990 Change to Make Files - Causing OS Base Build Failure
-
-2.	djkovace
-	1.	DEF143620 OOM defect in DVirtualPinMapping::New
-
-3.	jimmzhou
-	1.	DEF142812 SMP-Panic in the TDfcQue::ThreadFunction when USB channel is closing
-	2.	DEF142888 SMP-t_usbdi test case 1231 failed
-
-4.	cnotton
-	1.	MINOR_CHANGE Fixed test export locations for Header Relocation
-
-
-Version 2.00.3003
-=================
-(Made by vfebvre 07/01/2010)
-
-1.	necliffo
-	1.	DEF143593 WDP: Phone does not boot if SWAP drive is corrupted
-
-
-Version 2.00.3002
-=================
-(Made by vfebvre 06/01/2010)
-
-1.	kingzhan
-	1.	DEF143562 ForBaseSubmission(TSW JHAA-7YAEKV): No error note about connected USB HUB shown
-		TSW defect: JHAA-7YAEKV No error note about connected USB HUB shown.
-
-2.	wuda
-	1.	DEF143561 open for submission:EDHO-7Y3AAD, USB connection:
-		TSW Defect EDHO-7Y3AAD: USB connection: USB connection state changes after connecting the USB charger.
-
-3.	dogunjum
-	1.	DEF137221 NE1 PCI driver not confirmed SMPSAFE automatic test case missing
-
-4.	marisood
-	1.	DEF143212 Missing M&FS files from Symbian Foundation due to IP classifications
-
-5.	martai
-	1.	DEF143441 FMM: Minimise size of live list when demand paging disabled
-
-6.	shenzhou
-	1.	DEF143568 open for submission - USB using an obsoleted API to allocate endpoint resource
-
-
-Version 2.00.3001
-=================
-(Made by vfebvre 05/01/2010)
-
 1.	necliffo
 	1.	PackageReleaseID=439017 FeatureReleaseID=439013
 		eMMC Partition Plugin compatibility with Nokia flashing tools
 
 
-Version 2.00.3000
-=================
-(Made by vfebvre 29/12/2009)
-
-1.	vfebvre
-	1.	DEF142026 Core Dump Server not getting events after attaching to more than one executable
-	2.	MINOR_CHANGE Copyright header correction
-
-2.	djkovace
-	1.	MINOR_CHANGE Fix Kernel builds with  __FLUSH_PT_INTO_RAM__
-		Kerrnel doesn't build if __FLUSH_PT_INTO_RAM__ is defined in variant.mmh. The fix is quite trivial.
-
-3.	cnotton
-	1.	MINOR_CHANGE Fixed some smaller compile issues with split and relocation header changes.		
-
-4.	necliffo
-	1.	DEF143340 JPLS-7XXEAC: eMMC initialisation fails with Samsung 32GB
-
-5.	marisood
-	1.	DEF142934 Bridge: t_rescontrolcli and t_extendedrescontrolcli fail on 8500 board.
-
-6.	martai
-	1.	DEF142714 Frequent T_RAMDEFRAG failures observed on the H4
-
-
 Version 2.00.2065
 =================
 (Made by vfebvre 17/12/2009)
--- a/kernel/eka/rombuild/alltests.oby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/alltests.oby	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,7 @@
 files=
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestpaged.txt					Test\test_paged.cpp
+data=gentestpaged.txt			Test\test_paged.cpp
 #endif
 
 #include <rom\##VARIANT##\kernel.iby>
@@ -53,18 +53,18 @@
 // !!! Disable platform security tests until we get the new APIs
 // #include "##BASEPATH##f32test\loader\security\ldrtest.iby"
 
-data=EPOCROOT##epoc32\release\##MAIN##\##BUILD##\t_ldrtst.exe						\sys\bin\t_ldrtst.exe
-data=EPOCROOT##epoc32\Release\##MAIN##\##BUILD##\d_exc.exe							\sys\bin\d_exc.exe
-data=EPOCROOT##epoc32\Release\##KMAIN##\##BUILD##\minkda.ldd						\sys\bin\minkda.ldd
+data=EPOCROOT##epoc32\release\##MAIN##\##BUILD##\t_ldrtst.exe		\sys\bin\t_ldrtst.exe
+data=EPOCROOT##epoc32\Release\##MAIN##\##BUILD##\d_exc.exe			\sys\bin\d_exc.exe
+data=EPOCROOT##epoc32\Release\##KMAIN##\##BUILD##\minkda.ldd			\sys\bin\minkda.ldd
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestnonpaged.txt				Test\test_unpaged.cpp	unpaged
+data=gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged
 #endif
 
 #if defined(SMPSOAK)
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\autoexec_smpsoak.bat				\autoexec.bat
+data=autoexec_smpsoak.bat			\autoexec.bat
 #else
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\autoexec_smpsoak.bat				Test\smpsoak.bat
+data=autoexec_smpsoak.bat			Test\smpsoak.bat
 #endif
 
 data=##BASEPATH##kernelhwsrv\kerneltest\e32test\smp_demo\war_and_peace_ch1.txt		test\war_and_peace_ch1.txt
--- a/kernel/eka/rombuild/autotest.oby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/autotest.oby	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,7 @@
 files=
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestpaged.txt			Test\test_paged.cpp
+data=gentestpaged.txt			Test\test_paged.cpp
 #endif
 
 #include <rom\##VARIANT##\kernel.iby>
@@ -59,5 +59,5 @@
 data=EPOCROOT##Epoc32\Release\##KMAIN##\##BUILD##\minkda.ldd			\sys\bin\minkda.ldd
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged
+data=gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged
 #endif
--- a/kernel/eka/rombuild/autotest_e32tests.oby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/autotest_e32tests.oby	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,7 @@
 files=
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestpaged.txt			Test\test_paged.cpp
+data=gentestpaged.txt			Test\test_paged.cpp
 #endif
 
 #include <rom\##VARIANT##\kernel.iby>
@@ -43,5 +43,5 @@
 data=EPOCROOT##epoc32\rom\##VARIANT##\autoexec_e32test.bat				\autoexec.bat
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged
+data=gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged
 #endif
--- a/kernel/eka/rombuild/autotest_f32tests.oby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/autotest_f32tests.oby	Wed Sep 01 12:34:56 2010 +0100
@@ -20,7 +20,7 @@
 files=
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestpaged.txt			Test\test_paged.cpp
+data=gentestpaged.txt			Test\test_paged.cpp
 #endif
 
 #include <rom\##VARIANT##\kernel.iby>
@@ -56,5 +56,5 @@
 data=EPOCROOT##epoc32\rom\##VARIANT##\autoexec_f32test.bat				\autoexec.bat
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged
+data=gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged
 #endif
--- a/kernel/eka/rombuild/base.iby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/base.iby	Wed Sep 01 12:34:56 2010 +0100
@@ -62,8 +62,8 @@
 file=ABI_DIR\DEBUG_DIR\eka1_entry_stub.dll              \sys\bin\Eka1_Entry_Stub.dll
 #endif
 
-// Stop-mode debug sub-system
-#include <sm_debug.iby>
+// Run-mode debug sub-system
+#include <rm_debug_svr.iby>
 
 #if !defined(EUSER_DLL)
 #error EUSER_DLL not defined
@@ -92,6 +92,7 @@
 
 secondary=ABI_DIR\DEBUG_DIR\efile.exe                       \sys\bin\efile.exe  FIXED HEAPMAX(0x40000)
 file=ABI_DIR\DEBUG_DIR\efsrv.dll                            \sys\bin\EFSrv.dll
+device[VARID]=KERNEL_DIR\DEBUG_DIR\d_ftrace.ldd             \sys\bin\d_ftrace.ldd
 
 #ifdef WITH_EXFAT
 file=ABI_DIR\DEBUG_DIR\exfat.fsy                            sys\bin\exfat.fsy
@@ -160,7 +161,7 @@
 file=ABI_DIR\DEBUG_DIR\usbhostmsclient.dll  sys\bin\usbhostmsclient.dll
 file=ABI_DIR\DEBUG_DIR\usbhostmssrv.exe     sys\bin\usbhostmssrv.exe
 #endif
-#endif //#if defined(SYMBIAN_ENABLE_USB_OTG_HOST) && defined(SYMBIAN_INCLUDE_USB_OTG_HOST) && defined(__USB)
+#endif //#if defined(SYMBIAN_ENABLE_USB_OTG_HOST) && defined(SYMBIAN_INCLUDE_USB_OTG_HOST) && !defined(SYMBIAN_EXCLUDE_USB)
 
 #if defined(_NAND) || defined(_NAND2) || defined(_ONENAND) || defined (WITH_INTERNAL_MMC)
 #if !defined PAGED_ROM || defined EFFICIENT_ROM_PAGING || defined CODE_PAGING_FROM_ROFS
--- a/kernel/eka/rombuild/f32_perf_tests.oby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/f32_perf_tests.oby	Wed Sep 01 12:34:56 2010 +0100
@@ -34,7 +34,7 @@
 files=
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestpaged.txt           Test\test_paged.cpp
+data=gentestpaged.txt           Test\test_paged.cpp
 #endif
 
 #include <rom\##VARIANT##\kernel.iby>
@@ -60,7 +60,7 @@
 #endif
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestnonpaged.txt            Test\test_unpaged.cpp   unpaged
+data=gentestnonpaged.txt            Test\test_unpaged.cpp   unpaged
 #endif
 
 //-------------------------------------------------------------------------------------------------
--- a/kernel/eka/rombuild/f32_perf_tests_fat_exfat.oby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/f32_perf_tests_fat_exfat.oby	Wed Sep 01 12:34:56 2010 +0100
@@ -36,7 +36,7 @@
 files=
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestpaged.txt           Test\test_paged.cpp
+data=gentestpaged.txt           Test\test_paged.cpp
 #endif
 
 #include <rom\##VARIANT##\kernel.iby>
@@ -58,7 +58,7 @@
 #include <rom##E32PATH##\kernelhwsrv\kerneltest\f32test\rofs\##MAIN##test.iby>
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestnonpaged.txt            Test\test_unpaged.cpp   unpaged
+data=gentestnonpaged.txt            Test\test_unpaged.cpp   unpaged
 #endif
 
 //-------------------------------------------------------------------------------------------------
--- a/kernel/eka/rombuild/f32tests.oby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/f32tests.oby	Wed Sep 01 12:34:56 2010 +0100
@@ -22,7 +22,7 @@
 files=
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestpaged.txt			Test\test_paged.cpp
+data=gentestpaged.txt			Test\test_paged.cpp
 #endif
 
 #include <rom\##VARIANT##\kernel.iby>
@@ -48,7 +48,7 @@
 data=EPOCROOT##Epoc32\Release\##KMAIN##\##BUILD##\minkda.ldd			\sys\bin\minkda.ldd
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged
+data=gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged
 #endif
 
 #if defined(SYMBIAN_INCLUDE_USB_OTG_HOST) && defined(WITH_MASS_STORAGE)
--- a/kernel/eka/rombuild/h4usbmmctest_load.oby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/h4usbmmctest_load.oby	Wed Sep 01 12:34:56 2010 +0100
@@ -57,13 +57,13 @@
 
 #if defined(MULTIPLEROFS)
 // Built by rom.pl with type=nandtest_test
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\tests.rofs								\rofs1.img
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\dir.rofs								\rofs2.img
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\extension.rofs							\rofsextension3.img
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\dir1.rofs								\rofs4.img
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\dir2.rofs								\rofs5.img
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\dir3.rofs								\rofs6.img
+data=tests.rofs								\rofs1.img
+data=dir.rofs								\rofs2.img
+data=extension.rofs							\rofsextension3.img
+data=dir1.rofs								\rofs4.img
+data=dir2.rofs								\rofs5.img
+data=dir3.rofs								\rofs6.img
 data=\epoc32\rom\rofstest\fatimage.bin					\user3.img
 #else
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\dir.rofs								\rofs1.img
+data=dir.rofs								\rofs1.img
 #endif
--- a/kernel/eka/rombuild/h4usbmmctest_test.oby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/h4usbmmctest_test.oby	Wed Sep 01 12:34:56 2010 +0100
@@ -29,7 +29,7 @@
 files=
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestpaged.txt			Test\test_paged.cpp paging_unmovable
+data=gentestpaged.txt			Test\test_paged.cpp paging_unmovable
 #endif
 
 #include <rom\##VARIANT##\kernel.iby>
@@ -37,7 +37,7 @@
 #include <rom\hal\hal.iby>
 #include <rom\f32\f32.iby>
 
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestpaged.txt			Test\test_paged1.cpp paging_unmovable
+data=gentestpaged.txt			Test\test_paged1.cpp paging_unmovable
 
 // scripts
 #if !defined(MANUALROM)
@@ -46,7 +46,7 @@
 
 #ifdef WITH_COMP
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
+data=gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
 #endif
 
 #ifdef MULTIPLEROFS
@@ -71,7 +71,7 @@
 
 #ifndef WITH_COMP
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
+data=gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
 #endif
 #endif
 
--- a/kernel/eka/rombuild/h4usbstress.oby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/h4usbstress.oby	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,7 @@
 files=
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestpaged.txt			Test\test_paged.cpp
+data=gentestpaged.txt			Test\test_paged.cpp
 #endif
 
 #include <rom\##VARIANT##\kernel.iby>
@@ -46,9 +46,9 @@
 // USB Config file
 data=##BASEPATH##e32test\usb\t_usb_device\configs\h4if0a3.xml       test\h4if0a3.xml
 
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\usbstress_autoexec.bat                                 \autoexec.bat
+data=usbstress_autoexec.bat                                 \autoexec.bat
 data=EPOCROOT##epoc32\rom\##VARIANT##\autoexec.bat				\alltests.bat
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged
+data=gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged
 #endif
--- a/kernel/eka/rombuild/h4usbtest.iby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/h4usbtest.iby	Wed Sep 01 12:34:56 2010 +0100
@@ -30,7 +30,6 @@
 file=EPOCROOT##epoc32\release\##MAIN##\##BUILD##\t_usb_device.exe			sys\bin\t_usb_device.exe
 file=EPOCROOT##epoc32\release\##MAIN##\##BUILD##\t_usb_scdevice.exe			sys\bin\t_usb_scdevice.exe
 file=EPOCROOT##epoc32\release\##MAIN##\##BUILD##\t_usbcsc.exe				sys\bin\t_usbcsc.exe
-file=EPOCROOT##epoc32\release\##MAIN##\##BUILD##\t_usb_transfersrv.dll		sys\bin\t_usb_transfersrv.dll
 
 REM t_usb_device xml configuration files
 
--- a/kernel/eka/rombuild/kernel.hby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/kernel.hby	Wed Sep 01 12:34:56 2010 +0100
@@ -17,12 +17,10 @@
 #define EKernelConfigSMPUnsafeCompat	12
 #define EKernelConfigSMPUnsafeCPU0		13
 #define EKernelConfigSMPCrazyInterrupts	14
-#define EKernelConfigSMPLockKernelThreadsCore0 15
 #define EKernelConfigDisableAPs			30
 
 #define CRAZYSCHEDULING(state)	kernelconfig EKernelConfigCrazyScheduling state
 #define SMPUNSAFECOMPAT(state)	kernelconfig EKernelConfigSMPUnsafeCompat state
 #define SMPUNSAFECPU0(state)	kernelconfig EKernelConfigSMPUnsafeCPU0 state
 #define CRAZYINTERRUPTS(state)	kernelconfig EKernelConfigSMPCrazyInterrupts state
-#define SMPLOCKKERNELTHREADSCPU0(state)	kernelconfig EKernelConfigSMPLockKernelThreadsCore0 state
 #define	SMP_USE_BP_ONLY(state)	kernelconfig EKernelConfigDisableAPs state
--- a/kernel/eka/rombuild/mmctest_load.oby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/mmctest_load.oby	Wed Sep 01 12:34:56 2010 +0100
@@ -18,8 +18,8 @@
 // depends on the mmctest_test being built first (it includes it)
 
 #define BASE_ROM
+#define MMCLOADER_ROM
 #define REBOOT_DRIVER
-#define MMCLOADER_ROM
 
 #include <rom\##VARIANT##\header.iby>
 
@@ -58,13 +58,13 @@
 
 #if defined(MULTIPLEROFS)
 // Built by rom.pl with type=nandtest_test
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\tests.rofs								\rofs1.img
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\dir.rofs								\rofs2.img
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\extension.rofs							\rofsextension3.img
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\dir1.rofs								\rofs4.img
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\dir2.rofs								\rofs5.img
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\dir3.rofs								\rofs6.img
+data=tests.rofs								\rofs1.img
+data=dir.rofs								\rofs2.img
+data=extension.rofs							\rofsextension3.img
+data=dir1.rofs								\rofs4.img
+data=dir2.rofs								\rofs5.img
+data=dir3.rofs								\rofs6.img
 data=\epoc32\rom\rofstest\fatimage.bin					\user3.img
 #else
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\dir.rofs								\rofs1.img
+data=dir.rofs								\rofs1.img
 #endif
--- a/kernel/eka/rombuild/mmctest_load_rel.oby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/mmctest_load_rel.oby	Wed Sep 01 12:34:56 2010 +0100
@@ -19,7 +19,6 @@
 
 #define BASE_ROM
 #define REBOOT_DRIVER
-#define MMCLOADER_ROM
 
 #include <rom\##VARIANT##\header.iby>
 
--- a/kernel/eka/rombuild/mmctest_test.oby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/mmctest_test.oby	Wed Sep 01 12:34:56 2010 +0100
@@ -31,7 +31,7 @@
 files=
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestpaged.txt			Test\test_paged.cpp paging_unmovable
+data=gentestpaged.txt			Test\test_paged.cpp paging_unmovable
 #endif
 
 #include <rom\##VARIANT##\kernel.iby>
@@ -62,13 +62,13 @@
 
 #endif // #ifndef EXCLUDE_TESTS
 
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestpaged.txt			Test\test_paged1.cpp paging_unmovable
+data=gentestpaged.txt			Test\test_paged1.cpp paging_unmovable
 
 // scripts
 #if !defined(MANUALROM)
 
 #if defined(RAMSTRESS)
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\ramstress_autoexec.bat	\autoexec.bat
+data=ramstress_autoexec.bat	\autoexec.bat
 #define RAMSTRESS_SUFFFIX	_ramstress
 #else
 #define RAMSTRESS_SUFFFIX	
@@ -95,7 +95,7 @@
 
 #ifdef WITH_COMP
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
+data=gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
 #endif
 
 #ifdef MULTIPLEROFS
@@ -126,7 +126,7 @@
 
 #ifndef WITH_COMP
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
+data=gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
 #endif
 #endif
 
--- a/kernel/eka/rombuild/mmctest_test_e32tests.oby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/mmctest_test_e32tests.oby	Wed Sep 01 12:34:56 2010 +0100
@@ -36,7 +36,7 @@
 files=
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestpaged.txt			Test\test_paged.cpp paging_unmovable
+data=gentestpaged.txt			Test\test_paged.cpp paging_unmovable
 #endif
 
 #include <rom\##VARIANT##\kernel.iby>
@@ -56,7 +56,7 @@
 data=EPOCROOT##epoc32\release\##MAIN##\##BUILD##\t_ldrtst.exe			sys\bin\t_ldrtst.exe
 
 
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestpaged.txt			Test\test_paged1.cpp paging_unmovable
+data=gentestpaged.txt			Test\test_paged1.cpp paging_unmovable
 
 // scripts
 #if !defined(MANUALROM)
@@ -73,7 +73,7 @@
 
 #ifdef WITH_COMP
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
+data=gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
 #endif
 
 rofsname = dir.rofs
@@ -100,7 +100,7 @@
 
 #ifndef WITH_COMP
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
+data=gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
 #endif
 #endif
 
--- a/kernel/eka/rombuild/mmctest_test_f32tests.oby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/mmctest_test_f32tests.oby	Wed Sep 01 12:34:56 2010 +0100
@@ -36,7 +36,7 @@
 files=
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestpaged.txt			Test\test_paged.cpp paging_unmovable
+data=gentestpaged.txt			Test\test_paged.cpp paging_unmovable
 #endif
 
 #include <rom\##VARIANT##\kernel.iby>
@@ -59,7 +59,7 @@
 #include <rom##E32PATH##\kernelhwsrv\kerneltest\f32test\shostmassstorage\##MAIN##test.iby>
 #endif
 
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestpaged.txt			Test\test_paged1.cpp paging_unmovable
+data=gentestpaged.txt			Test\test_paged1.cpp paging_unmovable
 
 // scripts
 #if !defined(MANUALROM)
@@ -76,7 +76,7 @@
 
 #ifdef WITH_COMP
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
+data=gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
 #endif
 
 rofsname = dir.rofs
@@ -106,7 +106,7 @@
 
 #ifndef WITH_COMP
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
+data=gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
 #endif
 #endif
 
--- a/kernel/eka/rombuild/nandtest_erase.oby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/nandtest_erase.oby	Wed Sep 01 12:34:56 2010 +0100
@@ -39,7 +39,7 @@
 #include <rom\hal\hal.iby>
 #include <rom\f32\f32.iby>
 
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\nand_test_erase_autoexec.bat				\autoexec.bat
+data=nand_test_erase_autoexec.bat				\autoexec.bat
 
 #if defined(LMNAND2)
 data=\epoc32\rom\LMNAND2\nandtest_erase_autoexec.bat			\test\nandtest_erase_autoexec.bat
--- a/kernel/eka/rombuild/nandtest_load.oby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/nandtest_load.oby	Wed Sep 01 12:34:56 2010 +0100
@@ -70,18 +70,18 @@
 
 #if defined(MULTIPLEROFS)
 // Built by rom.pl with type=nandtest_test
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\tests.rofs								\rofs1.img
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\dir.rofs								\rofs2.img
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\extension.rofs							\rofsextension3.img
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\dir1.rofs								\rofs4.img
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\dir2.rofs								\rofs5.img
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\dir3.rofs								\rofs6.img
+data=tests.rofs								\rofs1.img
+data=dir.rofs								\rofs2.img
+data=extension.rofs							\rofsextension3.img
+data=dir1.rofs								\rofs4.img
+data=dir2.rofs								\rofs5.img
+data=dir3.rofs								\rofs6.img
 data=\epoc32\rom\rofstest\fatimage.bin		\user3.img
 #else
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\dir.rofs								\rofs1.img
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\extension.rofs							\rofsextension2.img
+data=dir.rofs								\rofs1.img
+data=extension.rofs							\rofsextension2.img
 #endif
 
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\smr1.img								\smr1.img
+data=smr1.img								\smr1.img
 data=\epoc32\data\smr_part_102400.img		\smr2.img
 
--- a/kernel/eka/rombuild/nandtest_test.oby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/nandtest_test.oby	Wed Sep 01 12:34:56 2010 +0100
@@ -40,7 +40,7 @@
 files=
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestpaged.txt			Test\test_paged.cpp paging_unmovable
+data=gentestpaged.txt			Test\test_paged.cpp paging_unmovable
 #endif
 
 #include <rom\##VARIANT##\kernel.iby>
@@ -70,7 +70,7 @@
 data=EPOCROOT##epoc32\release\##MAIN##\##BUILD##\t_ldrtst.exe			sys\bin\t_ldrtst.exe
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestpaged.txt			Test\test_paged1.cpp paging_unmovable
+data=gentestpaged.txt			Test\test_paged1.cpp paging_unmovable
 #endif
 
 #endif // #ifndef EXCLUDE_TESTS
@@ -78,7 +78,7 @@
 // scripts
 #if !defined(MANUALROM)
 #if defined(RAMSTRESS)
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\ramstress_autoexec.bat			\autoexec.bat
+data=ramstress_autoexec.bat			\autoexec.bat
 #define RAMSTRESS_SUFFFIX	_ramstress
 #else
 #define RAMSTRESS_SUFFFIX	
@@ -109,7 +109,7 @@
 
 #ifdef WITH_COMP
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
+data=gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
 #endif
 
 #ifdef MULTIPLEROFS
@@ -149,7 +149,7 @@
 
 #ifndef WITH_COMP
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
+data=gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
 #endif
 #endif
 
--- a/kernel/eka/rombuild/nandtest_test_e32tests.oby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/nandtest_test_e32tests.oby	Wed Sep 01 12:34:56 2010 +0100
@@ -35,7 +35,7 @@
 files=
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestpaged.txt			Test\test_paged.cpp paging_unmovable
+data=gentestpaged.txt			Test\test_paged.cpp paging_unmovable
 #endif
 
 #include <rom\##VARIANT##\kernel.iby>
@@ -63,13 +63,13 @@
 data=EPOCROOT##epoc32\release\##MAIN##\##BUILD##\t_ldrtst.exe			sys\bin\t_ldrtst.exe
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestpaged.txt			Test\test_paged1.cpp paging_unmovable
+data=gentestpaged.txt			Test\test_paged1.cpp paging_unmovable
 #endif
 
 // scripts
 #if !defined(MANUALROM)
 #if defined(RAMSTRESS)
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\ramstress_autoexec.bat			\autoexec.bat
+data=ramstress_autoexec.bat			\autoexec.bat
 #define RAMSTRESS_SUFFFIX	_ramstress
 #else
 #define RAMSTRESS_SUFFFIX	
@@ -87,7 +87,7 @@
 
 #ifdef WITH_COMP
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
+data=gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
 #endif
 
 #ifdef MULTIPLEROFS
@@ -123,7 +123,7 @@
 
 #ifndef WITH_COMP
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
+data=gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
 #endif
 #endif
 
--- a/kernel/eka/rombuild/nandtest_test_f32tests.oby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/nandtest_test_f32tests.oby	Wed Sep 01 12:34:56 2010 +0100
@@ -34,7 +34,7 @@
 files=
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestpaged.txt			Test\test_paged.cpp paging_unmovable
+data=gentestpaged.txt			Test\test_paged.cpp paging_unmovable
 #endif
 
 #include <rom\##VARIANT##\kernel.iby>
@@ -68,13 +68,13 @@
 #endif
 
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestpaged.txt			Test\test_paged1.cpp paging_unmovable
+data=gentestpaged.txt			Test\test_paged1.cpp paging_unmovable
 #endif
 
 // scripts
 #if !defined(MANUALROM)
 #if defined(RAMSTRESS)
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\ramstress_autoexec.bat			\autoexec.bat
+data=ramstress_autoexec.bat			\autoexec.bat
 #define RAMSTRESS_SUFFFIX	_ramstress
 #else
 #define RAMSTRESS_SUFFFIX	
@@ -92,7 +92,7 @@
 
 #ifdef WITH_COMP
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
+data=gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
 #endif
 
 #ifdef MULTIPLEROFS
@@ -100,7 +100,7 @@
 #else
 rofsname = dir.rofs
 #endif	//MULTIPLEROFS
-rofssize = 0x5E0000
+rofssize = 0x500000
 
 #ifdef PAGED_ROM
 PAGINGOVERRIDE DEFAULTPAGED
@@ -129,7 +129,7 @@
 
 #ifndef WITH_COMP
 #ifdef PAGED_ROM
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
+data=gentestnonpaged.txt			Test\test_unpaged.cpp	unpaged paging_unmovable
 #endif
 #endif
 
--- a/kernel/eka/rombuild/not_data_paged.txt	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-#Check if the rom is meant to be datapaged
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/rombuild/rm_debug_svr.iby	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,53 @@
+/*
+* 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:
+*
+*/
+#ifndef __RM_DEBUG_SVR_IBY__
+#define __RM_DEBUG_SVR_IBY__
+
+#ifndef NO_RUN_MODE_DEBUGGING
+#ifndef INST_ARM4
+
+
+
+#ifdef KMAIN
+
+// Debug Device Driver
+extension[VARID]=  \Epoc32\Release\##KMAIN##\##BUILD##\rm_debug.ldd		\sys\bin\rm_debug.ldd
+
+// Debug Security Server
+file=			\Epoc32\Release\##MAIN##\##BUILD##\rm_debug_svr.exe		\sys\bin\rm_debug_svr.exe
+
+#endif
+
+#ifndef KMAIN
+
+// Debug Device Driver
+#ifdef STOP_MODE_DEBUGGING_V2
+extension[VARID]=KERNEL_DIR\DEBUG_DIR\rm_debug_ext.ldd		\sys\bin\rm_debug.ldd
+#else
+extension[VARID]=KERNEL_DIR\DEBUG_DIR\rm_debug.ldd		\sys\bin\rm_debug.ldd
+#endif
+
+// Debug Security Server
+file=KERNEL_DIR\DEBUG_DIR\rm_debug_svr.exe		\sys\bin\rm_debug_svr.exe
+
+#endif
+
+
+#endif	// INST_ARM4
+#endif	// NO_RUN_MODE_DEBUGGING
+
+#endif	// __RM_DEBUG_SVR_IBY__
--- a/kernel/eka/rombuild/sm_debug.iby	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
-* 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:
-*
-*/
-#ifndef __SM_DEBUG_IBY__
-#define __SM_DEBUG_IBY__
-
-
-#ifndef KMAIN
-
-// Stop Mode Debugger
-#ifdef STOP_MODE_DEBUGGING_V2
-extension[VARID]=KERNEL_DIR\DEBUG_DIR\sm_debug.dll		\sys\bin\sm_debug.dll
-#endif
-
-
-#endif
-
-
-#endif	// __SM_DEBUG_IBY__
--- a/kernel/eka/rombuild/t_soak.oby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/t_soak.oby	Wed Sep 01 12:34:56 2010 +0100
@@ -26,7 +26,7 @@
 
 file=\EPOC32\RELEASE\##MAIN##\##BUILD##\T_SOAK.EXE          sys\bin\T_SOAK.EXE
 
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\t_soak_autoexec.bat \autoexec.bat
+data=t_soak_autoexec.bat \autoexec.bat
 
 
 
--- a/kernel/eka/rombuild/ubootldr.oby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/ubootldr.oby	Wed Sep 01 12:34:56 2010 +0100
@@ -29,4 +29,4 @@
 
 file=\Epoc32\Release\##MAIN##\##BUILD##\_##VARIANT##_bootldr.exe			Sys\Bin\bootldr.exe
 device[VARID]=\epoc32\release\##KMAIN##\##BUILD##\_##VARIANT##_ubootldr.ldd	Sys\Bin\ubootldr.ldd
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\ubootldr.autoexec.bat												autoexec.bat
+data=ubootldr.autoexec.bat												autoexec.bat
--- a/kernel/eka/rombuild/user.iby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/rombuild/user.iby	Wed Sep 01 12:34:56 2010 +0100
@@ -67,12 +67,12 @@
 #endif
 
 
-#if !(defined(INST_X86) || defined(INST_X86GCC)) && !defined(USE_CUSTOM_MMC_PARTITION)
+#ifndef USE_CUSTOM_MMC_PARTITION
 extension[VARID]=\Epoc32\Release\##KMAIN##\##BUILD##\EMMCPTN.DLL                   \Sys\Bin\EMMCPTN.DLL
 #endif
 
-// Stop-mode debug subsystem
-#include "sm_debug.iby"
+// Run-mode debug subsystem
+#include "rm_debug_svr.iby"
 
 // Load Platform Security settings
 #ifndef __DONT_LOAD_PLATSEC_SETTINGS__
@@ -174,10 +174,6 @@
 #endif
 #endif // PAGED_DATA
 
-#if !defined(PAGED_DATA)
-data=##BASEPATH##kernelhwsrv\kernel\eka\rombuild\not_data_paged.txt  Test\not_data_paged.txt unpaged paging_unmovable
-#endif //#if !defined(PAGED_DATA)
-
 // Test constant patching works by setting KHeapMinCellSize to zero, which is the default anyway
 patchdata ekern.exe @ KHeapMinCellSize 0
 patchdata euser.dll @ KHeapMinCellSize 0
Binary file kernelhwsrv_info/doc_pub/Base_SMP_Power_Management_Impacts_on_Kernel_Use_of_Hardware_Timers.docx has changed
Binary file kernelhwsrv_info/doc_pub/Base_SMP_a_Brief_Description_of_the_Load_Balancer.docx has changed
Binary file kernelhwsrv_info/doc_pub/base_how_to_armv7_cache_and_access_remapping_-_design.doc has changed
Binary file kernelhwsrv_info/doc_pub/base_how_to_crash_logging.doc has changed
Binary file kernelhwsrv_info/doc_pub/base_how_to_publish_and_subscribe.doc has changed
Binary file kernelhwsrv_info/doc_pub/base_how_to_use_t_fatcharsetconv_framework.doc has changed
Binary file kernelhwsrv_info/doc_pub/base_migrating_device_drivers_dfc_q.doc has changed
Binary file kernelhwsrv_info/doc_pub/base_migrating_kernel api preconditions checking.doc has changed
--- a/kerneltest/e32test/active/t_ctimer.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/active/t_ctimer.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -28,7 +28,6 @@
 // and check for panic.
 // - Call absolute timer's At function without adding it to the active scheduler and 
 // check for panic.
-// - Call 1s inactivity timer
 // - Check if heap has been corrupted by the tests.
 // Platforms/Drives/Compatibility:
 // All.
@@ -78,15 +77,6 @@
 	static TInt iTotalCount;
 	};
 
-// for inactivity test
-class myInactTimer : public CTimer
-	{
-public:
-	myInactTimer(const TInt aPriority):CTimer(aPriority){;}
-	void RunL(void);	
-	void Start(void);
-	};
-
 TInt myTimer::iTotalCount;
 TInt myTimer::iNum;
 
@@ -118,23 +108,6 @@
 	CActiveScheduler::Add(this);
 	}
 
-void myInactTimer::RunL(void)
-//
-// Timer has completed
-//
-	{
-	CActiveScheduler::Stop();
-	}
-
-void myInactTimer::Start(void)
-//
-// Start a timer going.
-//
-	{
-	ConstructL();
-	CActiveScheduler::Add(this);
-	}
-
 LOCAL_D TInt ThreadEntry(TAny* aDirective)
 //
 // Test thread
@@ -224,22 +197,12 @@
 	CActiveScheduler::Start();
 	test(A[0]==ID1 && pTimer1->iStatus==KErrNone);
 //
-	test.Next(_L("Inactivity 1s"));
-	User::ResetInactivityTime();
-	myInactTimer* pInactTimer=new myInactTimer(0);
-	pInactTimer->Start();
-	test.Printf(_L("inactivity..."));
-	pInactTimer->Inactivity(1);
-	CActiveScheduler::Start();
-	test.Printf(_L("...back"));
-	test(pInactTimer->iStatus==KErrNone);
-//
+
 	test.Next(_L("Destroy objects"));
 	delete pTimer1;
 	delete pTimer2;
 	delete pTimer3;
 	delete pRepeater;
-	delete pInactTimer;
 //
 	test.End();
 	}
--- a/kerneltest/e32test/active/t_messge.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/active/t_messge.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -126,14 +126,14 @@
 
 // CTestServer functions
 
-EXPORT_C CTestServer::CTestServer(TInt aPriority) 
+CTestServer::CTestServer(TInt aPriority) 
 //
 // Constructor - sets name
 //
 	: CServer2(aPriority)
 	{}
 
-EXPORT_C CSession2* CTestServer::NewSessionL(const TVersion& aVersion,const RMessage2& /*aMessage*/) const
+CSession2* CTestServer::NewSessionL(const TVersion& aVersion,const RMessage2& /*aMessage*/) const
 //
 // Virtual fn - checks version supported and creates a CTestSession
 //
@@ -284,7 +284,7 @@
 	return KErrNone;
 	}
 
-EXPORT_C void CTestSession::ServiceL(const RMessage2& aMessage)
+void CTestSession::ServiceL(const RMessage2& aMessage)
 //
 // Virtual message-handler
 //
--- a/kerneltest/e32test/active/t_timerduration.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/active/t_timerduration.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -52,48 +52,6 @@
 TInt* TimeValue;
 TInt TimeMin[KMaxTimeValues];
 TInt TimeMax[KMaxTimeValues];
-
-RTimer TheTimer;
-
-void After(TInt aTime)
-	{
-	TRequestStatus s;
-	TheTimer.HighRes(s, aTime);
-	User::WaitForRequest(s);
-	}
-
-TInt Again(TInt aTime)
-	{
-	TRequestStatus s;
-	TheTimer.AgainHighRes(s, aTime);
-	User::WaitForRequest(s);
-	return s.Int();
-	}
-
-void WaitInSteps(TUint aWait, TUint aPeriod, TUint aSteps)
-	{
-	TUint total_ticks = aWait / aPeriod;
-	TUint remain = total_ticks;
-	TUint steps = aSteps > remain ? remain : aSteps;
-	TUint carry = 0;
-	TUint step = 0;
-	while (remain)
-		{
-		TUint stepLength = remain / steps;
-		carry += stepLength;
-		TUint us = carry * aPeriod;
-		TInt r = KErrNone;
-		if (step==0)
-			After(us);
-		else
-			r = Again(us);
-		if (r==KErrNone)
-			carry = 0;
-		++step;
-		--steps;
-		remain -= stepLength;
-		}
-	}
 	
 void calcStats(TInt i)
 	{
@@ -108,20 +66,20 @@
 
 void printStats()
 	{
-	test.Printf(_L("  Value     Min      Max\n"));
+	test.Printf(_L("Value\tMin\tMax"));
 	for (TInt i=0;i<KMaxTimeValues;++i)
 		{
 		if (TimeValue[i]<0) break;
-		test.Printf(_L("%8d %8d %8d\n"),TimeValue[i],TimeMin[i],TimeMax[i]);
+		test.Printf(_L("%d\t%d\t%d"),TimeValue[i],TimeMin[i],TimeMax[i]);
 		}
 	}
 
 #define __BEFORE_WAIT__ \
-	test.Printf(_L("Measuring value(%d measurements at each value):\n"), MaxTimeMeasurements);\
+	test.Printf(_L("Measuring value(%d measurements at each value):"), MaxTimeMeasurements);\
 	for (i=0;i<KMaxTimeValues;++i)\
 		{\
 		if (TimeValue[i]<0) break;\
-		test.Printf(_L("%8d microseconds ...\n"),TimeValue[i]);\
+		test.Printf(_L("%d microseconds ..."),TimeValue[i]);\
 		value = TimeValue[i];\
 		for (j=0; j<MaxTimeMeasurements; ++j)\
 			{\
@@ -144,13 +102,12 @@
 	test.Title();
 	test.Start(_L("Timer resolution test"));
 	test.SetLogged(ETrue);
-	test(TheTimer.CreateLocal()==KErrNone);
 	RThread This;
 	This.SetPriority(EPriorityRealTime);
 	TUint tick1,tick2;
 	TInt value, tickPeriod;
 	HAL::Get(HAL::ENanoTickPeriod, tickPeriod);
-	test.Printf(_L("tickPeriod=%d\n"),tickPeriod);
+	test.Printf(_L("tickPeriod=%d"),tickPeriod);
 ///////////////////////////////////////////
 	test.Next(_L("Calibrate"));
 	MaxTimeMeasurements = KMaxTimeMeasurements;
@@ -215,45 +172,6 @@
 		}
 #endif
 ///////////////////////////////////////////
-	test.Next(_L("RTimer::AgainHighRes (2 steps)"));
-	MaxTimeMeasurements = KMaxTimeMeasurements;
-	TInt TimeValues5[KMaxTimeValues]={2000,4000,8000,16000,32000,64000,128000,-1};
-	TimeValue = &TimeValues5[0];
-	__BEFORE_WAIT__
-	__MEASURE1__
-			WaitInSteps(value, tickPeriod, 2);
-	__MEASURE2__
-	__AFTER_WAIT__
-#if defined(__EPOC32__)
-	//Check that RTimer::AgainHighRes() calls completed within boundaries
-	for (k = 0; k<KMaxTimeValues; k++)
-		{
-		if (TimeValue[k] == -1) break;
-		test(TimeValue[k] <= TimeMin[k]);
-		test((TimeValue[k] + 2*tickPeriod) >= TimeMax[k]);
-		}
-#endif
-///////////////////////////////////////////
-	test.Next(_L("RTimer::AgainHighRes (5 steps)"));
-	MaxTimeMeasurements = KMaxTimeMeasurements;
-	TInt TimeValues6[KMaxTimeValues]={4000,8000,16000,32000,64000,128000,-1};
-	TimeValue = &TimeValues6[0];
-	__BEFORE_WAIT__
-	__MEASURE1__
-			WaitInSteps(value, tickPeriod, 5);
-	__MEASURE2__
-	__AFTER_WAIT__
-#if defined(__EPOC32__)
-	//Check that RTimer::AgainHighRes() calls completed within boundaries
-	for (k = 0; k<KMaxTimeValues; k++)
-		{
-		if (TimeValue[k] == -1) break;
-		test(TimeValue[k] <= TimeMin[k]);
-		test((TimeValue[k] + 2*tickPeriod) >= TimeMax[k]);
-		}
-#endif
-///////////////////////////////////////////
-	TheTimer.Close();
 	test.End();
 	return(KErrNone);
 	}
--- a/kerneltest/e32test/bench/d_kernasmfnc.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/bench/d_kernasmfnc.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -262,7 +262,7 @@
 
 DEFINE_BENCHMARK(TPriList_HighestPri,
 				 TPriListLink link(15); PriList.Add(&link),
-				 PriList.HighestPriority(),
+				 PriList.First(),
 				 PriList.Remove(&link));
 
 DEFINE_BENCHMARK(TPriList_ChangePri,
--- a/kerneltest/e32test/bench/t_dhry.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/bench/t_dhry.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -383,8 +383,9 @@
 	TRequestStatus timerStat;
 	timer.After(timerStat,20*1000000);
 	User::WaitForRequest(timerStat,keyStat);
+	TInt key = 0;
 	if(keyStat!=KRequestPending)
-		(void)test.Console()->KeyCode();
+		key = test.Console()->KeyCode();
 	timer.Cancel();
 	test.Console()->ReadCancel();
 	User::WaitForAnyRequest();
--- a/kerneltest/e32test/bench/t_exec.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/bench/t_exec.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -18,7 +18,9 @@
 #include <e32test.h>
 
 const TInt KHeapSize=0x2000;
-
+const TInt KMajorVersionNumber=1;
+const TInt KMinorVersionNumber=0;
+const TInt KBuildVersionNumber=1;
 
 LOCAL_D RTest test(_L("T_EXEC"));
 LOCAL_D RTest testSvr(_L("Server"));
@@ -34,9 +36,10 @@
 	speedCount=0;
 	semmy.Signal();
 	TUint myChar='a';
+	TUint r;
 	for (TUint i=0;i<0xffffffff;i++)
 		{
-		User::UpperCase(myChar);
+		r=User::UpperCase(myChar);
 		speedCount++;
 		}
 	return(KErrNone);
--- a/kerneltest/e32test/bench/t_r64bm.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/bench/t_r64bm.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -26,7 +26,7 @@
 const TInt KAverageOverInSeconds=10;
 const TInt KNumberOfCalculationsPerLoop=10;
 
-volatile TUint Count;
+volatile TUint count;
 #ifdef T_R64BM_WITH_VFP
 RTest test(_L("T_VFPBM"));
 #else
@@ -58,10 +58,9 @@
 		}
     thread.Resume();
     User::After(1000000);
-    TUint initial = Count;
+    count=0;
     User::After(KAverageOverInSeconds*1000000);
-	TUint final = Count;
-    TUint64 result = TUint64(final - initial);
+    TUint64 result = count;
 	result *= TUint64(KNumberOfCalculationsPerLoop);
 	result /= TUint64(KAverageOverInSeconds);
 	TUint r32 = (TUint)result;
--- a/kerneltest/e32test/bench/t_r64fnc.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/bench/t_r64fnc.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -33,24 +33,15 @@
 								76.1,	9,	56.1,	1/9,
 								1/3,	22,	99.7,	42};
 
-GLREF_D volatile TUint Count;
-
-#include <e32btrace.h>
-
-void Step()
-	{
-	if (++Count & 0xffff)
-		return;
-	BTrace4(BTrace::ETest1, 0, Count);
-	}
+GLREF_D volatile TUint count;
 
 TInt TReal64Addition(TAny*)
     {
-	Count=0;
+	count=0;
 
     FOREVER
         {
-		r=AntiOptimization[Count & 0xf];
+		r=AntiOptimization[count & 0xf];
 		r+=One;
 		r+=One;
 		r+=One;
@@ -61,17 +52,17 @@
 		r+=One;
 		r+=One;
 		r+=One;
-        Step();
+        count++;
         }
     }
 
 TInt TReal64Subtraction(TAny*)
     {
-	Count=0;
+	count=0;
 
     FOREVER
         {
-		r=AntiOptimization[Count & 0xf];
+		r=AntiOptimization[count & 0xf];
 		r-=Ten;
 		r-=Ten;
 		r-=Ten;
@@ -82,16 +73,16 @@
 		r-=Ten;
 		r-=Ten;
 		r-=Ten;
-        Step();
+        count++;
         }
     }
 
 TInt TReal64Multiplication(TAny*)
     {
-	Count=0;
+	count=0;
     FOREVER
         {
-		r=AntiOptimization[Count & 0xf];
+		r=AntiOptimization[count & 0xf];
 		r*=Pi;
 		r*=Pi;
 		r*=Pi;
@@ -102,17 +93,17 @@
 		r*=Pi;
 		r*=Pi;
 		r*=Pi;
-        Step();
+        count++;
         }
     }
 
 TInt TReal64Division(TAny*)
     {
-	Count=0;
+	count=0;
 	
     FOREVER
         {
-		r=AntiOptimization[Count & 0xf];
+		r=AntiOptimization[count & 0xf];
 		r/=Ten;
 		r/=Ten;
 		r/=Ten;
@@ -123,13 +114,12 @@
 		r/=Ten;
 		r/=Ten;
 		r/=Ten;
-        Step();
+        count++;
         }
     }
 
 TInt TRealSqrt(TAny*)
     {
-	Count=0;
 
 	TReal r;
 
@@ -145,13 +135,12 @@
 		Math::Sqrt(r,1.414213562373);
 		Math::Sqrt(r,1.7320508078);
 		Math::Sqrt(r,299792458.0);
-        Step();
+        count++;
         }
     }
 
 TInt TRealSin(TAny*)
     {
-	Count=0;
 
 	TReal r=7;
 
@@ -167,13 +156,12 @@
 		Math::Sin(r,8.0);
 		Math::Sin(r,9.0);
 		Math::Sin(r,-1.0);
-        Step();
+        count++;
         }
     }
 
 TInt TRealLn(TAny*)
     {
-	Count=0;
 
 	TReal r=7;
 
@@ -189,13 +177,12 @@
 		Math::Ln(r,11.0);
 		Math::Ln(r,13.0);
 		Math::Ln(r,17.0);
-        Step();
+        count++;
         }
     }
 
 TInt TRealExp(TAny*)
     {
-	Count=0;
 
 	TReal r=7;
 
@@ -211,13 +198,12 @@
 		Math::Exp(r,-2.0);
 		Math::Exp(r,11.0);
 		Math::Exp(r,-11.0);
-        Step();
+        count++;
         }
     }
 
 TInt TRealAsin(TAny*)
     {
-	Count=0;
 
 	TReal r=7;
 
@@ -233,13 +219,12 @@
 		Math::ASin(r,0.8);
 		Math::ASin(r,0.9);
 		Math::ASin(r,-0.9);
-        Step();
+        count++;
         }
     }
 
 TInt TRealAtan(TAny*)
     {
-	Count=0;
 
 	TReal r=7;
 
@@ -255,13 +240,12 @@
 		Math::ATan(r,1.5);
 		Math::ATan(r,1.7);
 		Math::ATan(r,2.9);
-        Step();
+        count++;
         }
     }
 
 TInt TRealTan(TAny*)
     {
-	Count=0;
 
 	TReal r=7;
 
@@ -277,13 +261,12 @@
 		Math::Tan(r,8.0);
 		Math::Tan(r,9.0);
 		Math::Tan(r,-1.0);
-        Step();
+        count++;
         }
     }
 
 TInt TRealPower(TAny*)
     {
-	Count=0;
 
 	TReal r=7;
 
@@ -299,7 +282,7 @@
 		Math::Pow(r,95.4,1.57079);
 		Math::Pow(r,317.9,0.3333333333333333);
 		Math::Pow(r,299792458,-2.718281828459045235);
-        Step();
+        count++;
         }
     }
 
--- a/kerneltest/e32test/bmarm/d_dma2_simu.def	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-EXPORTS
-	CreateLogicalDevice__Fv @ 1 NONAME R3UNUSED ; CreateLogicalDevice(void)
-	__18TDmaTransferConfigUlUiUiUiiiUiUi13TDmaBurstSizeUiUii @ 2 NONAME ; TDmaTransferConfig::TDmaTransferConfig(unsigned long, unsigned int, unsigned int, unsigned int, int, int, unsigned int, unsigned int, TDmaBurstSize, unsigned int, unsigned int, int)
-	CancelAll__11TDmaChannel @ 3 NONAME R3UNUSED ; TDmaChannel::CancelAll(void)
-	Close__11TDmaChannel @ 4 NONAME R3UNUSED ; TDmaChannel::Close(void)
-	DisableDstElementCounting__11DDmaRequest @ 5 NONAME R3UNUSED ; DDmaRequest::DisableDstElementCounting(void)
-	DisableSrcElementCounting__11DDmaRequest @ 6 NONAME R3UNUSED ; DDmaRequest::DisableSrcElementCounting(void)
-	DmaTestInfoV2__Fv @ 7 NONAME R3UNUSED ; DmaTestInfoV2(void)
-	DmaTestInfo__Fv @ 8 NONAME R3UNUSED ; DmaTestInfo(void)
-	DmacCaps__11TDmaChannel @ 9 NONAME R3UNUSED ; TDmaChannel::DmacCaps(void)
-	DstFragmentCount__11DDmaRequest @ 10 NONAME R3UNUSED ; DDmaRequest::DstFragmentCount(void)
-	EnableDstElementCounting__11DDmaRequesti @ 11 NONAME R3UNUSED ; DDmaRequest::EnableDstElementCounting(int)
-	EnableSrcElementCounting__11DDmaRequesti @ 12 NONAME R3UNUSED ; DDmaRequest::EnableSrcElementCounting(int)
-	ExpandDesList__11DDmaRequesti @ 13 NONAME R3UNUSED ; DDmaRequest::ExpandDesList(int)
-	ExpandDstDesList__11DDmaRequesti @ 14 NONAME R3UNUSED ; DDmaRequest::ExpandDstDesList(int)
-	ExpandSrcDesList__11DDmaRequesti @ 15 NONAME R3UNUSED ; DDmaRequest::ExpandSrcDesList(int)
-	Extension__11TDmaChanneliPv @ 16 NONAME R3UNUSED ; TDmaChannel::Extension(int, void *)
-	FailNext__11TDmaChanneli @ 17 NONAME R3UNUSED ; TDmaChannel::FailNext(int)
-	FragmentCount__11DDmaRequest @ 18 NONAME R3UNUSED ; DDmaRequest::FragmentCount(void)
-	Fragment__11DDmaRequestRC16TDmaTransferArgs @ 19 NONAME R3UNUSED ; DDmaRequest::Fragment(TDmaTransferArgs const &)
-	Fragment__11DDmaRequestUlUliUiUl @ 20 NONAME ; DDmaRequest::Fragment(unsigned long, unsigned long, int, unsigned int, unsigned long)
-	FreeDesList__11DDmaRequest @ 21 NONAME R3UNUSED ; DDmaRequest::FreeDesList(void)
-	FreeDstDesList__11DDmaRequest @ 22 NONAME R3UNUSED ; DDmaRequest::FreeDstDesList(void)
-	FreeSrcDesList__11DDmaRequest @ 23 NONAME R3UNUSED ; DDmaRequest::FreeSrcDesList(void)
-	IsrRedoRequest__11TDmaChannelUlUlUiUli @ 24 NONAME ; TDmaChannel::IsrRedoRequest(unsigned long, unsigned long, unsigned int, unsigned long, int)
-	LinkToChannel__11TDmaChannelP11TDmaChannel @ 25 NONAME R3UNUSED ; TDmaChannel::LinkToChannel(TDmaChannel *)
-	MaxTransferLength__11TDmaChannelUiUiUl @ 26 NONAME ; TDmaChannel::MaxTransferLength(unsigned int, unsigned int, unsigned long)
-	MissNextInterrupts__11TDmaChanneli @ 27 NONAME R3UNUSED ; TDmaChannel::MissNextInterrupts(int)
-	Open__11TDmaChannelRCQ211TDmaChannel11SCreateInfoRP11TDmaChannel @ 28 NONAME R3UNUSED ; TDmaChannel::Open(TDmaChannel::SCreateInfo const &, TDmaChannel *&)
-	Pause__11TDmaChannel @ 29 NONAME R3UNUSED ; TDmaChannel::Pause(void)
-	Queue__11DDmaRequest @ 30 NONAME R3UNUSED ; DDmaRequest::Queue(void)
-	Resume__11TDmaChannel @ 31 NONAME R3UNUSED ; TDmaChannel::Resume(void)
-	SrcFragmentCount__11DDmaRequest @ 32 NONAME R3UNUSED ; DDmaRequest::SrcFragmentCount(void)
-	StaticExtension__11TDmaChanneliPv @ 33 NONAME R3UNUSED ; TDmaChannel::StaticExtension(int, void *)
-	TotalNumDstElementsTransferred__11DDmaRequest @ 34 NONAME R3UNUSED ; DDmaRequest::TotalNumDstElementsTransferred(void)
-	TotalNumSrcElementsTransferred__11DDmaRequest @ 35 NONAME R3UNUSED ; DDmaRequest::TotalNumSrcElementsTransferred(void)
-	"_._11DDmaRequest" @ 36 NONAME R3UNUSED ; DDmaRequest::~DDmaRequest(void)
-	__11DDmaRequestR11TDmaChannelPFQ211DDmaRequest7TResultPv_vPvi @ 37 NONAME ; DDmaRequest::DDmaRequest(TDmaChannel &, void (*)(DDmaRequest::TResult, void *), void *, int)
-	__11DDmaRequestR11TDmaChannelPFUi10TDmaResultPvP10SDmaDesHdr_vPvUi @ 38 NONAME ; DDmaRequest::DDmaRequest(TDmaChannel &, void (*)(unsigned int, TDmaResult, void *, SDmaDesHdr *), void *, unsigned int)
-	__16TDmaTransferArgs @ 39 NONAME R3UNUSED ; TDmaTransferArgs::TDmaTransferArgs(void)
-	__16TDmaTransferArgsRC18TDmaTransferConfigT1UlUiUi15TDmaGraphicsOpsUl @ 40 NONAME ; TDmaTransferArgs::TDmaTransferArgs(TDmaTransferConfig const &, TDmaTransferConfig const &, unsigned long, unsigned int, unsigned int, TDmaGraphicsOps, unsigned long)
-	__16TDmaTransferArgsUiUiUiUiUiUi12TDmaAddrModeUiUi13TDmaBurstSizeUi15TDmaGraphicsOpsUl @ 41 NONAME ; TDmaTransferArgs::TDmaTransferArgs(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, TDmaAddrMode, unsigned int, unsigned int, TDmaBurstSize, unsigned int, TDmaGraphicsOps, unsigned long)
-	__18TDmaTransferConfig @ 42 NONAME R3UNUSED ; TDmaTransferConfig::TDmaTransferConfig(void)
-	__18TDmaTransferConfigUlUi12TDmaAddrModeUi13TDmaBurstSizeUiUiUii @ 43 NONAME ; TDmaTransferConfig::TDmaTransferConfig(unsigned long, unsigned int, TDmaAddrMode, unsigned int, TDmaBurstSize, unsigned int, unsigned int, unsigned int, int)
-	AddressAlignMask__11TDmaChannelUiUiUl @ 44 NONAME ; TDmaChannel::AddressAlignMask(unsigned int, unsigned int, unsigned long)
-
--- a/kerneltest/e32test/bmarm/i2c_ctrlessu.def	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-EXPORTS
-	CreatePhysicalDevice__Fv @ 1 NONAME R3UNUSED ; CreatePhysicalDevice(void)
-	DfcFunc__20TIicBusSlaveCallbackPv @ 2 NONAME R3UNUSED ; TIicBusSlaveCallback::DfcFunc(void *)
-	__25DIicBusChannelMasterSlaveQ214DIicBusChannel8TBusTypeQ214DIicBusChannel14TChannelDuplexP20DIicBusChannelMasterP19DIicBusChannelSlave @ 3 NONAME ; DIicBusChannelMasterSlave::DIicBusChannelMasterSlave(DIicBusChannel::TBusType, DIicBusChannel::TChannelDuplex, DIicBusChannelMaster *, DIicBusChannelSlave *)
-	__31DSimulatedIicBusChannelSlaveI2cQ214DIicBusChannel8TBusTypeQ214DIicBusChannel14TChannelDuplex @ 4 NONAME R3UNUSED ; DSimulatedIicBusChannelSlaveI2c::DSimulatedIicBusChannelSlaveI2c(DIicBusChannel::TBusType, DIicBusChannel::TChannelDuplex)
-	__32DSimulatedIicBusChannelMasterI2cQ214DIicBusChannel8TBusTypeQ214DIicBusChannel14TChannelDuplex @ 5 NONAME R3UNUSED ; DSimulatedIicBusChannelMasterI2c::DSimulatedIicBusChannelMasterI2c(DIicBusChannel::TBusType, DIicBusChannel::TChannelDuplex)
-	__37DSimulatedIicBusChannelMasterSlaveI2cQ214DIicBusChannel8TBusTypeQ214DIicBusChannel14TChannelDuplexP32DSimulatedIicBusChannelMasterI2cP31DSimulatedIicBusChannelSlaveI2c @ 6 NONAME ; DSimulatedIicBusChannelMasterSlaveI2c::DSimulatedIicBusChannelMasterSlaveI2c(DIicBusChannel::TBusType, DIicBusChannel::TChannelDuplex, DSimulatedIicBusChannelMasterI2c *, DSimulatedIicBusChannelSlaveI2c *)
-
--- a/kerneltest/e32test/bmarm/i2c_masterstubs_ctrlessu.def	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-EXPORTS
-	CreatePhysicalDevice__Fv @ 1 NONAME R3UNUSED ; CreatePhysicalDevice(void)
-	DfcFunc__20TIicBusSlaveCallbackPv @ 2 NONAME R3UNUSED ; TIicBusSlaveCallback::DfcFunc(void *)
-	__25DIicBusChannelMasterSlaveQ214DIicBusChannel8TBusTypeQ214DIicBusChannel14TChannelDuplexP20DIicBusChannelMasterP19DIicBusChannelSlave @ 3 NONAME ; DIicBusChannelMasterSlave::DIicBusChannelMasterSlave(DIicBusChannel::TBusType, DIicBusChannel::TChannelDuplex, DIicBusChannelMaster *, DIicBusChannelSlave *)
-	__31DSimulatedIicBusChannelSlaveI2cQ214DIicBusChannel8TBusTypeQ214DIicBusChannel14TChannelDuplex @ 4 NONAME R3UNUSED ; DSimulatedIicBusChannelSlaveI2c::DSimulatedIicBusChannelSlaveI2c(DIicBusChannel::TBusType, DIicBusChannel::TChannelDuplex)
-	__32DSimulatedIicBusChannelMasterI2cQ214DIicBusChannel8TBusTypeQ214DIicBusChannel14TChannelDuplex @ 5 NONAME R3UNUSED ; DSimulatedIicBusChannelMasterI2c::DSimulatedIicBusChannelMasterI2c(DIicBusChannel::TBusType, DIicBusChannel::TChannelDuplex)
-	__37DSimulatedIicBusChannelMasterSlaveI2cQ214DIicBusChannel8TBusTypeQ214DIicBusChannel14TChannelDuplexP32DSimulatedIicBusChannelMasterI2cP31DSimulatedIicBusChannelSlaveI2c @ 6 NONAME ; DSimulatedIicBusChannelMasterSlaveI2c::DSimulatedIicBusChannelMasterSlaveI2c(DIicBusChannel::TBusType, DIicBusChannel::TChannelDuplex, DSimulatedIicBusChannelMasterI2c *, DSimulatedIicBusChannelSlaveI2c *)
-
--- a/kerneltest/e32test/bmarm/i2c_slavestubs_ctrlessu.def	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-EXPORTS
-	CreatePhysicalDevice__Fv @ 1 NONAME R3UNUSED ; CreatePhysicalDevice(void)
-	DfcFunc__20TIicBusSlaveCallbackPv @ 2 NONAME R3UNUSED ; TIicBusSlaveCallback::DfcFunc(void *)
-	__25DIicBusChannelMasterSlaveQ214DIicBusChannel8TBusTypeQ214DIicBusChannel14TChannelDuplexP20DIicBusChannelMasterP19DIicBusChannelSlave @ 3 NONAME ; DIicBusChannelMasterSlave::DIicBusChannelMasterSlave(DIicBusChannel::TBusType, DIicBusChannel::TChannelDuplex, DIicBusChannelMaster *, DIicBusChannelSlave *)
-	__31DSimulatedIicBusChannelSlaveI2cQ214DIicBusChannel8TBusTypeQ214DIicBusChannel14TChannelDuplex @ 4 NONAME R3UNUSED ; DSimulatedIicBusChannelSlaveI2c::DSimulatedIicBusChannelSlaveI2c(DIicBusChannel::TBusType, DIicBusChannel::TChannelDuplex)
-	__32DSimulatedIicBusChannelMasterI2cQ214DIicBusChannel8TBusTypeQ214DIicBusChannel14TChannelDuplex @ 5 NONAME R3UNUSED ; DSimulatedIicBusChannelMasterI2c::DSimulatedIicBusChannelMasterI2c(DIicBusChannel::TBusType, DIicBusChannel::TChannelDuplex)
-	__37DSimulatedIicBusChannelMasterSlaveI2cQ214DIicBusChannel8TBusTypeQ214DIicBusChannel14TChannelDuplexP32DSimulatedIicBusChannelMasterI2cP31DSimulatedIicBusChannelSlaveI2c @ 6 NONAME ; DSimulatedIicBusChannelMasterSlaveI2c::DSimulatedIicBusChannelMasterSlaveI2c(DIicBusChannel::TBusType, DIicBusChannel::TChannelDuplex, DSimulatedIicBusChannelMasterI2c *, DSimulatedIicBusChannelSlaveI2c *)
-
--- a/kerneltest/e32test/bmarm/spi_ctrlessu.def	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-EXPORTS
-	CreatePhysicalDevice__Fv @ 1 NONAME R3UNUSED ; CreatePhysicalDevice(void)
-	DfcFunc__20TIicBusSlaveCallbackPv @ 2 NONAME R3UNUSED ; TIicBusSlaveCallback::DfcFunc(void *)
-	__25DIicBusChannelMasterSlaveQ214DIicBusChannel8TBusTypeQ214DIicBusChannel14TChannelDuplexP20DIicBusChannelMasterP19DIicBusChannelSlave @ 3 NONAME ; DIicBusChannelMasterSlave::DIicBusChannelMasterSlave(DIicBusChannel::TBusType, DIicBusChannel::TChannelDuplex, DIicBusChannelMaster *, DIicBusChannelSlave *)
-	__31DSimulatedIicBusChannelSlaveSpiQ214DIicBusChannel8TBusTypeQ214DIicBusChannel14TChannelDuplex @ 4 NONAME R3UNUSED ; DSimulatedIicBusChannelSlaveSpi::DSimulatedIicBusChannelSlaveSpi(DIicBusChannel::TBusType, DIicBusChannel::TChannelDuplex)
-	__32DSimulatedIicBusChannelMasterSpiQ214DIicBusChannel8TBusTypeQ214DIicBusChannel14TChannelDuplex @ 5 NONAME R3UNUSED ; DSimulatedIicBusChannelMasterSpi::DSimulatedIicBusChannelMasterSpi(DIicBusChannel::TBusType, DIicBusChannel::TChannelDuplex)
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/buffer/Unicode, Inc License Agreement - Data Files and Software.txt	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,21 @@
+                          EXHIBIT 1
+UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
+
+Unicode Data Files include all data files under the directories http://www.unicode.org/Public/, http://www.unicode.org/reports/, and http://www.unicode.org/cldr/data/ . Unicode Software includes any source code published in the Unicode Standard or under the directories http://www.unicode.org/Public/, http://www.unicode.org/reports/, and http://www.unicode.org/cldr/data/.
+
+NOTICE TO USER: Carefully read the following legal agreement. BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
+
+COPYRIGHT AND PERMISSION NOTICE
+
+Copyright © 1991-2009 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode data files and any associated documentation (the "Data Files") or Unicode software and any associated documentation (the "Software") to deal in the Data Files or Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom the Data Files or Software are furnished to do so, provided that (a) the above copyright notice(s) and this permission notice appear with all copies of the Data Files or Software, (b) both the above copyright notice(s) and this permission notice appear in associated documentation, and (c) there is clear notice in each modified Data File or in the Software as well as in the documentation associated with the Data File(s) or Software that the data or software has been modified.
+
+THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in these Data Files or Software without prior written authorization of the copyright holder.
+
+
+--------------------------------------------------------------------------------
+
+Unicode and the Unicode logo are trademarks of Unicode, Inc., and may be registered in some jurisdictions. All other trademarks and registered trademarks mentioned herein are the property of their respective owners.
--- a/kerneltest/e32test/buffer/t_bflat.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/buffer/t_bflat.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -18,7 +18,7 @@
 // CBufFlat.
 // Details:
 // - Test all the operations of the class and see if methods are implemented -- 
-// including NewL, Reset, Size, Set Reserve, InsertL, Delete, Ptr, Read, ResizeL, Write and Compress.
+// including NewL, Reset, Size, Set Reserve, InsertL, Delete, Ptr, Read, Write and Compress.
 // - Test CBufFlat constructor is as expected.
 // - Insert data into the flat storage dynamic buffer and verify that InsertL method
 // is as expected.
@@ -106,13 +106,11 @@
 	bf1->InsertL(5,tb1);
 	bf1->Delete(16,bf1->Size()-16);
 	test(bf1->Ptr(0)==TPtrC8((TText8*)"HelloHello World"));
-	bf1->InsertL(10,tb1,5);
-	test(bf1->Ptr(0)==TPtrC8((TText8*)"HelloHelloHello World"));
 //
 	test.Next(_L("SetReserve"));
 	bf1->SetReserveL(50); // SetReserve > 0
-	test(bf1->Size()==21);
-	test(bf1->Ptr(0).Length()==21);
+	test(bf1->Size()==16);
+	test(bf1->Ptr(0).Length()==16);
 	bf1->Reset();
 	bf1->SetReserveL(0); // SetReserve = 0
 	test(bf1->Size()==0);
@@ -138,23 +136,10 @@
 	bf1->Compress(); // Compress
 	test(bf1->Size()==7);
 
-	test.Next(_L("Read, Resize"));
+	test.Next(_L("Read"));
 	bf1->Read(4,tb1,bf1->Size()-4);
 	test(tb1.Size()==3);
 	test(tb1==TPtrC8((TText8*)"lol"));
-	TBuf8<0x10> tb4=(TText8*)"Hello Hello Sun ";;
-	TBuf8<0x10> tb5;
-	test(bf1->Size()==7);
-	bf1->ResizeL(64); // ResizeL
-	test(bf1->Size()==64);
-	bf1->Write(0,tb4,16);
-	bf1->Write(16,tb4,16);
-	bf1->Write(32,tb4,16);
-	bf1->Write(48,tb4,16);
-	bf1->Read(0,tb5); //Reads maxlength of tb5 that is 16
-	bf1->Read(0,tb3); //Reads maxlength of tb3 that is 64
-	test(tb5==TPtrC8((TText8*)"Hello Hello Sun "));
-	test(tb3==TPtrC8((TText8*)"Hello Hello Sun Hello Hello Sun Hello Hello Sun Hello Hello Sun "));
 //
 	test.End();
 	}
--- a/kerneltest/e32test/buffer/t_bma.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/buffer/t_bma.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -157,31 +157,14 @@
 		pBitMapAllocator->Free(i);
 	test(pBitMapAllocator->Avail()==pBitMapAllocator->Size());
 //
-	test.Next(_L("AllocFrom"));
-	i=0;
-	for (;i<available;i++)
-		{
-		TInt j=pBitMapAllocator->AllocFrom(i);
-		test(j==i);
-		}
-	test(pBitMapAllocator->Avail()==0);
-
-	test.Next(_L("Try AllocFrom for already allocated pos")); //should return KErrNoMemory
-	TInt j=pBitMapAllocator->AllocFrom(i-1);
-	test(j==KErrNoMemory);
-
-	test.Next(_L("Free (again)"));
-	for (i=0;i<available;i++)
-		{
-		pBitMapAllocator->Free(i);
-		}
-	test(pBitMapAllocator->Avail()==pBitMapAllocator->Size());
-//
-
 	test.Next(_L("AllocAt"));
 	pBitMapAllocator->AllocAt(aSize-1);
 	test(pBitMapAllocator->Avail()==pBitMapAllocator->Size()-1);
-
+//
+//	test.Next(_L("AllocAt an already allocated cell"));	// this test should cause a Panic.
+//	pBitMapAllocator->AllocAt(aSize-1);
+//	test(pBitMapAllocator->Avail()==pBitMapAllocator->Size()-1);
+//
 	test.Next(_L("Free (again)"));
 	pBitMapAllocator->Free(aSize-1);
 	test(pBitMapAllocator->Avail()==pBitMapAllocator->Size());
--- a/kerneltest/e32test/buffer/t_buf.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/buffer/t_buf.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -74,7 +74,6 @@
 #include <hal_data.h>
 #include <hal_data.h>
 #include <e32svr.h>
-#include <collate.h> 
 
 #ifdef __VC32__
     // Solve compilation problem caused by non-English locale
@@ -300,9 +299,6 @@
 	a.Zero();
 	a.AppendJustify(_TL("AB"),10,ELeft,' ');
 	a.AppendJustify(b,10,ELeft,' ');
-	a.AppendJustify(b,10,KDefaultJustifyWidth,ELeft,' ');
-	a.AppendJustify(b.Ptr(),10,ELeft,' ');
-	
 	TInt v1=10;
 	a.Num(v1);
 	a.AppendNum(v1);
@@ -311,25 +307,6 @@
 	a.AppendNum((TUint)v2,EHex);
 	a.NumUC((TUint)v2,EHex);
 	a.AppendNumUC((TUint)v2,EHex);
-	
-	//Converts the specified unsigned integer into a fixed width character representation
-	//based on the specified number system and copies the conversion into this descriptor,
-	//replacing any existing data. The length of this descriptor is set to reflect the new data.
-	a.NumFixedWidth(v1,EBinary,4); 
-	a.NumFixedWidth(v1,EOctal,3);
-	a.NumFixedWidth(v1,EDecimal,2);
-	a.NumFixedWidth(v1,EHex,1);
-	//When a hexadecimal conversion is specified, hexadecimal characters are in upper case.
-	a.NumFixedWidthUC(v1,EBinary,4);
-	a.NumFixedWidthUC(v1,EOctal,3);
-	a.NumFixedWidthUC(v1,EDecimal,2);
-	a.NumFixedWidthUC(v1,EHex,1);
-	//Appends the conversion onto the end of this descriptor's data.
-	a.AppendNumFixedWidthUC(v1,EBinary,4);
-	a.AppendNumFixedWidthUC(v1,EOctal,3);
-	a.AppendNumFixedWidthUC(v1,EDecimal,2);
-	a.AppendNumFixedWidthUC(v1,EHex,1); 
-	
 	TReal v3=10.0;
 	TRealFormat ff;
 	ff.iType=KRealFormatFixed;
@@ -1382,14 +1359,7 @@
 #if !(defined(__GCC32__) && defined(__X86__))
 	const TAny* const zeroTerminatedString=(sizeof(S)==2)? (const TAny*)_S16(":-)E"): (const TAny*)_S8(":-)E");
 	const TInt dummyParameter=0;
-#ifdef __ARMCC__
-#pragma push
-#pragma diag_suppress 1446 
-#endif
 	Test14_ReorderedParameterFormatting(dummyParameter, 0x20ac, 11, 3, 13.89543, zeroTerminatedString, '!', TInt64(199), 2, &b, 6, 30005, TRealX(0.125), 0x8bdd);
-#ifdef __ARMCC__
-#pragma pop
-#endif
 #endif
 
 	test.Next(_L("Print some numbers"));
@@ -1598,10 +1568,6 @@
 
 // Cannot do these on GCC (X86) because of "Cannot pass objects of non-POD type through '...'. Call will abort at runtime".
 #if !(defined(__GCC32__) && defined(__X86__))
-#ifdef __ARMCC__
-#pragma push
-#pragma diag_suppress 1446 
-#endif
 	aa.Format(_L("x%- 5Fx"), TRealX(6.2345678));
 	test(aa==_L("x6.234568x"));
 	aa.Format(_L("x%+ 5Fx"), TRealX(6.2345678));
@@ -1632,9 +1598,6 @@
 	test(aa==_L("x         1.012345679x"));
 	aa.Format(_L("x%5.1Fx"), TRealX(1.99));
 	test(aa==_L("x  2.0x"));
-#ifdef __ARMCC__	
-#pragma pop
-#endif
 #endif
 
 	aa.Format(_L("x%- 5ex"), 6.2345678);
@@ -1918,134 +1881,6 @@
 	lang = User::Language();
 	test(lang == defaultLang);
 	}
-
-// Test the surrogate aware version functions of the class. 
-GLDEF_C void SurrogateAware1()
-    {
-    test.Start(_L("Constructors"));
-    TBuf16<0x50> a;
-    TBuf16<0x50> b;
-    TBuf16<0x50> c;
-    TBuf16<0x50> d;
-    
-    a=_L("ABCD");
-    b=_L("abcd");
-    // Cannot define these on GCC (X86).
-	#if !(defined(__GCC32__) && defined(__X86__))
-    c=_L("àáâãäåçèéêëìíîïñòóôõöùúûüý");
-    d=_L("ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ");
-    #else
-    c=_L("aaaaaaceeeeiiiinooooouuuuy");
-    d=_L("AAAAAACEEEEIIIINOOOOOUUUUY");
-    #endif
- 
-    test.Next(_L("Fill2"));
-    TInt maxBufLength=a.MaxLength();
-    a.Fill2(' ');
-    a.Fill2(' ',maxBufLength);
-    a.Fill2('z');
-    a.Fill2('*',maxBufLength);
-    a=c;
-    b=d;
-    a.Swap(b);
-    test(a==d);
-
-    test.Next(_L("Conversion 2"));
-    a.Fold2();
-    b.Collate2();
-    a.UpperCase2();
-    a.LowerCase2();
-    a.Capitalize2();
-    b.Capitalize2();
-    
-    test.Next(_L("Locating"));
-    a=_L("ABCDabcd");
-    test(a.Locate('A')==0);
-    test(a.LocateF('b')==1);
-    test(a.LocateReverse('A')==0);
-    test(a.LocateReverse('a')==4);
-    test(a.LocateReverse('b')==5);
-
-    test.Next(_L("Copying"));
-    a.Copy(b); // Copies a 16 bit descriptor
-    a.Copy(_L("AB")); 
-    a.Copy(b.Ptr(),3); // Copies aLength characters from the aBuf pointer
-    a.CopyF2(c); // Copies and folds
-    a.CopyF2(_L("AB"));
-    a.CopyC2(d); // Copies and collates
-    a.CopyC2(_L("AB"));
-    a.CopyLC(d); // Copies and converts the text to lower case
-    a.CopyLC(_L("AB"));
-    a.CopyUC2(c); // Copies and converts the text to upper case
-    a.CopyUC2(_L("AB"));
-    a.CopyCP2(b); // Copies and capitalizes the text
-    a.CopyCP2(_L("AB"));
-    
-    test.Next(_L("Finding"));
-    a=_L("ABCDabcd");
-    b=_L("bc");
-    test(a.Find(b)==5);
-    test(a.Find(_L("ab"))==4);
-    test(a.FindF(b)==1);
-    test(a.FindF(_L("ab"))==0);
-    test(a.FindC(b)==1);
-    test(a.FindC(_L("AB"))==0);
-    test(a.FindC(b.Ptr(), b.Length(), 3)==1);
-    test(a.FindC(b.Ptr(), b.Length(), 2)==1);
-    test(a.FindC(b.Ptr(), b.Length(), 1)==1);
-    test(a.FindC(b.Ptr(), b.Length(), 0)==1); 
-    test(a.FindF(b.Ptr(), b.Length())==1);
-    
-    test.Next(_L("Formating"));
-    TInt width = 10;
-    a.Justify2(_L("AB"),width,ELeft,' ');
-    a.Justify2(b,10,ELeft,' ');
-    b.Fill2('A',2);
-    a.Zero();
-    a.AppendJustify2(_L("AB"),width,ELeft,' ');
-    a.AppendJustify2(b,width,ELeft,' ');
-    a=_L("ABCDE");
-    b=_L("abcde");
-    a.AppendJustify2(b,width,ELeft,'*');
-    a.AppendJustify2(b.Ptr(),width,ELeft,'*');
-    // Append and justify with explicit length
-    TInt length = 5;
-    a.AppendJustify2(b,length,KDefaultJustifyWidth,ELeft,'*');
-    a.AppendJustify2(b.Ptr(),length,KDefaultJustifyWidth,ELeft,'*');
-    
-    TCollationMethod cm = *Mem::CollationMethodByIndex( 0 ); // default collation method
-    cm.iFlags |= TCollationMethod::EIgnoreNone;
-    TDesC::TPrefix prefix = a.HasPrefixC(a, 0, &cm);
-    test(prefix==TDesC16::EIsPrefix);
-    test.End();
-    }
-
-// Test the surrogate aware versions of conversion operators (test7) 
-// 
-void SurrogateAware7()
-    {
-    test.Start(_L("Fold2, Collate2 ..."));
-    TBuf16<0x50> a;
-    TBuf16<0x50> b;
-    a=_L("abc AbC");
-    b=_L("ABC ABC");
-    a.Fold2();
-    b.Fold2();
-    test(a==b);
-    a=_L("abc AbC");
-    b=_L("ABC ABC");
-    a.Collate2();
-    b.Collate2();
-    test(a==b);
-    a.UpperCase2();
-    test(a==_L("ABC ABC"));
-    a.LowerCase2();
-    test(a==_L("abc abc"));
-    a.Capitalize2();
-    test(a==_L("Abc abc"));
-    test.End();
-    }
-
 #ifndef _DEBUG
 #pragma warning( disable : 4702) //Unreachable code
 #pragma warning( disable : 4710) //Function not expanded
@@ -2081,12 +1916,6 @@
 
 	test.Next(_L("INC061330"));
 	INC061330();
-	
-	test.Next(_L("Surrogate aware version"));
-	SurrogateAware1();
-	    
-	test.Next(_L("Surrogate aware version"));
-	SurrogateAware7();
 
 	test.End();
 
--- a/kerneltest/e32test/buffer/t_circ.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/buffer/t_circ.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -232,34 +232,6 @@
 			test(Mem::Compare(buf,arraySize,theCharArray,arraySize)==KErrNone);
 			}
 		}
-	
-	// Test Reset, Put and Get
-	TInt count = cbInt->Count();
-	test(count>0);
-	cbInt->Reset();
-	count = cbInt->Count();
-	test(count==0);
-	TUint index = 0;
-	
-	// Put 100 integers to the circular buffer.
-	TUint numberOfObjects= 100;
-	for(index=1;index<=numberOfObjects; index++)
-	    {
-	    TInt result= cbInt->Put(index);
-	    User::LeaveIfError(result);
-	    }
-	count = cbInt->Count();
-	test(count==100);
-	
-	// Get 50 integers from the circular buffer.
-	for(index=1;index<=(numberOfObjects/2); index++)
-	    {
-	    TUint cb = cbInt->Get();
-	    test(cb==index);
-	    }
-	count = cbInt->Count();
-	test(count==50);
-		
 	delete [] buf;
 	delete cbInt;
 	}
--- a/kerneltest/e32test/buffer/t_collate.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/buffer/t_collate.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -100,8 +100,6 @@
 	test(order == desired_order);
 	}
 
-#undef USE_SWEDISH_TABLE
-#ifdef USE_SWEDISH_TABLE
 static const TUint32 TheSwedishKey[] = 
 	{
 	0x8f60109,0x8f70109,0x8f80109,0x8f60121,0x8f70121,0x8f80121,0x8dd0109,0x8dd0121,
@@ -130,7 +128,6 @@
 
 static const TCollationMethod TheSwedishMethod =
 	{ 0, NULL, &TheSwedishTable, 0 };
-#endif
 
 static const TCollationMethod TheSwapCaseMethod =
 	{ 0, NULL, NULL, TCollationMethod::ESwapCase };
@@ -33140,10 +33137,7 @@
 	test_unicode_collation(_L("Liege"),_L("li\xe8ge"),-1);		// accentuation outweighs case
 	test_unicode_collation(_L("Liege"),_L("li\xe8ge"),0,0);		// ignore accents and case at level 0
 	test_unicode_collation(_L("\xe5ngstr\xf6m"),_L("zoo"),-1);	// a-ring before z by default
-#undef USE_SWEDISH_TABLE
-#ifdef USE_SWEDISH_TABLE
-	test_unicode_collation(_L("\xe5ngstr\xf6m"),_L("zoo"),1,3,&TheSwedishMethod);	// a-ring after z in Sweden
-#endif
+	// test_unicode_collation(_L("\xe5ngstr\xf6m"),_L("zoo"),1,3,&TheSwedishMethod);	// a-ring after z in Sweden
 	test_unicode_collation(_L("Antidisestablishmentarian"),_L("antidisestablishmentariac"),1); 	// long strings that don't have identical prefixes
 	
 	test_unicode_collation(_L("\xFF86"),_L(""),1);
--- a/kerneltest/e32test/buffer/t_des.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/buffer/t_des.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1353,76 +1353,6 @@
 LOCAL_C void testSurrogateAwareInterfaces()
 	{
 	test.Next(_L("new TDesC interfaces"));
-	TInt count;
-	
-	// string 1: all BMP characters
-	_LIT(KBmpString1,			"abcdcf");
-	TBuf16<128> s01(KBmpString1);
-	test(s01.FindCorruptSurrogate() == KErrNotFound);
-	test(s01.Locate2('f') == 5);
-	test(s01.LocateReverse2('c') == 4);
-	test(s01.Match(_L("*cdc*")) == 2);
-	test(s01.Match2(_L("*bcdc*")) == 1);
-	test(s01.Match2(_L("*c?c*")) == 2);
-	
-	// string 2: all non-BMP characters
-	_LIT(KSurrogateString1,		"\xD840\xDDAA\xD840\xDDAB\xD840\xDDAC\xD840\xDDAD\xD840\xDDAE\xD840\xDDAF");
-	TBuf16<128> s02(KSurrogateString1);
-	for (count=0; count<=11; count++)
-	test(s02.FindCorruptSurrogate() == KErrNotFound);
-	test(s02.Locate2(0x201AE) == 8);
-	test(s02.LocateReverse2(0x201AC) == 4);
-	test(s02.Match2(_L("*\xD840\xDDAB\xD840\xDDAC*")) == 2);
-	test(s02.Match2(_L("*\xD840\xDDBB*")) == KErrNotFound);
-	test(s02.Match2(_L("*\xD840\xDDAD*")) == 6);
-
-	// string 3: mixed
-	_LIT(KMixedString1,			"ab\xD840\xDDAD e\xD801\xDC27");
-	TBuf16<128> s03(KMixedString1);
-	test(s03.FindCorruptSurrogate() == KErrNotFound);
-	test(s03.Locate2(0x10427) == 6);
-	test(s03.Locate2('e') == 5);
-	test(s03.LocateF2(0x1044F) == 6);	// lower case=U+1044F(D801, DC4F), upper case=U+10427(D801, DC27), title case=U+10427
-	TBuf16<128> s03a;
-	s03a.CopyLC2(s03);
-	s03a.Append2(0x21000);
-	TBuf16<128> s03b;
-	s03b.Copy(s03);
-	
-	s03b.AppendFill2(0x21000, 2);
-	test(s03a != s03b);
-	test(s03.Match2(_L("*b\xD840\xDDAD*")) == 1);
-	test(s03.Match2(_L("* e*")) == 4);
-	test(s03.Match2(_L("*\xD840\xDDAD?*")) == 2);
-	
-	// string 4: mixed, with corrupt surrogate
-	_LIT(KCorruptString1,		"ab\xD840\xDDAD e\xDDAD\xD840");
-	TBuf16<128> s04(KCorruptString1);
-	test(s04.FindCorruptSurrogate() == 6);
-	
-	// string 5: fill
-	_LIT(KOddString5,           "0123456");
-	TBuf16<128> s05(KOddString5);
-	s05.Fill2(0x21000);
-    test(s05 == _L("\xD844\xDC00\xD844\xDC00\xD844\xDC00\xD844"));
-    s05.Fill2(' ');
-    test(s05 == _L("       "));
-	s05.AppendFill2(0x22222, 2);
-	s05.AppendFill2(0x22222, 3);
-	test(s05 == _L("       \xD848\xDE22\xD848\xDE22\xD848"));
-	
-	// string 6: locate
-	// from Unicode 5.0, CaseFolding.txt
-	// 10400; C; 10428; # DESERET CAPITAL LETTER LONG I
-	// 0x10400's fold is 0x10428
-	TCharF f06(0x10400);
-	test(f06 == 0x10428);  // just to ensure the property is correct
-	// 0x10400: D801, DC00
-	// 0x10428: D801, DC28
-	_LIT(KMixedString6,         "ab\xD801\xDC00 e\xD801\xDC27");
-	TBuf16<128> s06(KMixedString6);
-	TInt pos6 = s06.LocateReverseF2(0x10428);
-	test(pos6 == 2);
 	}
 
 
--- a/kerneltest/e32test/buffer/t_farray.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/buffer/t_farray.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -157,30 +157,6 @@
 			}
 		test(&aFix[index3-1]==--ptr);
 		}
-	
-	//Test ExpandL
-	//Expand array in slot 1
-	TBuf16<0x10> exp;
-	exp=_L("abc AbC");
-	aFix.InsertL(0,exp);
-	aFix.InsertL(1,exp);
-	aFix.InsertL(2,exp);
-	exp=aFix.ExpandL(1);
-	test(aFix[0]==_L("abc AbC"));
-	test(aFix[1]==_L(""));
-	test(aFix[2]==_L("abc AbC"));
-	test(aFix[3]==_L("abc AbC"));
-	
-	//Test ResizeL and InsertReplL
-	//Resize the array to containing 20 records,
-	//copying a record into any new slots.
-	TBuf<0x10> res(_L("bbbbb"));
-	aFix.Reset();
-	aFix.ResizeL(20,res);
-	for(TInt i=0;i<20;i++)
-	    {
-        test(aFix[1]==_L("bbbbb"));
-	    }
 	}
 
 LOCAL_C void test1(CArrayFix<TText>& aFix)
@@ -366,13 +342,6 @@
 	CArrayFixFlat<TInt>* pFixFlatInt=new CArrayFixFlat<TInt>(KTestGranularity);
 	test3(*pFixFlatInt);
 	delete pFixFlatInt;
-	
-	CArrayFixFlat<TUid>* pFixFlatTUid=new CArrayFixFlat<TUid>(KTestGranularity);
-	if (pFixFlatTUid==NULL)
-		{
-	    test.Panic(_L("Allocating array of TUid"));
-		}
-	delete pFixFlatTUid; 
 
 	test.Next(_L("class CArrayPtrFlat of CBase"));
 	
--- a/kerneltest/e32test/buffer/t_match.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/buffer/t_match.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -76,6 +76,47 @@
 #include "CompareImp.h"
 #include "u32std.h"
 
+static inline TBool IsSupplementary(TUint aChar)
+/**
+@param aChar The 32-bit code point value of a Unicode character.
+
+@return True, if aChar is supplementary character; false, otherwise.
+*/
+        {
+        return (aChar > 0xFFFF);
+        }
+
+static inline TText16 GetHighSurrogate(TUint aChar)
+/**
+Retrieve the high surrogate of a supplementary character.
+
+@param aChar The 32-bit code point value of a Unicode character.
+
+@return High surrogate of aChar, if aChar is a supplementary character;
+        aChar itself, if aChar is not a supplementary character.
+
+@see TChar::GetLowSurrogate
+*/
+        {
+        return STATIC_CAST(TText16, 0xD7C0 + (aChar >> 10));
+        }
+
+static inline TText16 GetLowSurrogate(TUint aChar)
+/**
+Retrieve the low surrogate of a supplementary character.
+
+@param aChar The 32-bit code point value of a Unicode character.
+
+@return Low surrogate of aChar, if aChar is a supplementary character;
+        zero, if aChar is not a supplementary character.
+
+@see TChar::GetHighSurrogate
+*/
+        {
+        return STATIC_CAST(TText16, 0xDC00 | (aChar & 0x3FF));
+        }
+
+
 ///***************** copied from locale euser source code ***********************
 static const TCollationMethod TheCollationMethod[] =
 	{
@@ -1596,15 +1637,15 @@
         TUint32 code;
         User::LeaveIfError(lex.Val(code, EHex));
         lex.Assign(lex.NextToken());
-        if (!TChar::IsSupplementary(code))
+        if (!IsSupplementary(code))
         	{
         	aStr[1+len] = (TUint16)code;
         	}
         else
         	{
-        	aStr[1+len] = TChar::GetHighSurrogate(code);
+        	aStr[1+len] = GetHighSurrogate(code);
         	++len;
-        	aStr[1+len] = TChar::GetLowSurrogate(code);
+        	aStr[1+len] = GetLowSurrogate(code);
         	}
         }
     __ASSERT_ALWAYS(len > 0, User::Invariant());
@@ -1667,14 +1708,14 @@
             {
             continue;
             }
-        if (!TChar::IsSupplementary(chCode))
+        if (!IsSupplementary(chCode))
         	{
         	candidate[KChPos] = (TUint16)chCode;
         	}
         else
         	{
-            candidate[KChPos] = TChar::GetHighSurrogate(chCode);
-            candidate[KChPos+1] = TChar::GetLowSurrogate(chCode);
+            candidate[KChPos] = GetHighSurrogate(chCode);
+            candidate[KChPos+1] = GetLowSurrogate(chCode);
         	}
         //"Character decomposition mapping" is the 5th field, starting from 0.
         TPtrC8 decomp(GetUnicodeDataField(stmt, 5));
@@ -1721,16 +1762,16 @@
             {
             continue;
             }
-        if (!TChar::IsSupplementary(chCode))
+        if (!IsSupplementary(chCode))
         	{
         	candidate[KChPos] = (TUint16)chCode;
         	candidate.SetLength(2);
         	}
         else
         	{
-            candidate[KChPos] = TChar::GetHighSurrogate(chCode);
+            candidate[KChPos] = GetHighSurrogate(chCode);
             candidate.SetLength(3);
-            candidate[KChPos+1] = TChar::GetLowSurrogate(chCode);
+            candidate[KChPos+1] = GetLowSurrogate(chCode);
         	}
         //"Character decomposition mapping" is the 5th field, starting from 0.
         TPtrC8 decomp(GetUnicodeDataField(stmt, 5));
@@ -2513,10 +2554,7 @@
 	test.Next(_L("MatchSurrogate"));
 	for (ii=0;ii<KTestsSurrogate;++ii)
 		{
-		TInt r=TPtrC16(TestsSurrogate[ii].iLeft).Match2(TPtrC16(TestsSurrogate[ii].iRight));
-		RDebug::Printf("    ii=%d, expect=%d, result=%d", ii, TestsSurrogate[ii].iResult, r);
-		test (r==TestsSurrogate[ii].iResult);
-		r=TPtrC16(TestsSurrogate[ii].iLeft).MatchF(TPtrC16(TestsSurrogate[ii].iRight));
+		TInt r=TPtrC16(TestsSurrogate[ii].iLeft).MatchF(TPtrC16(TestsSurrogate[ii].iRight));
 		test (r==TestsSurrogate[ii].iResult);
 		}
 	
@@ -2524,10 +2562,6 @@
 	_LIT( KQuestion, "?" );
 	_LIT( KDC00, "\xdc00" );
 	_LIT( KDFFF, "\xdfff" );
-	test( KErrCorruptSurrogateFound == TPtrC16( KD800() ).Match2( TPtrC16( KQuestion() ) ) );
-	test( KErrCorruptSurrogateFound == TPtrC16( KD800() ).Match2( TPtrC16( KD800() ) ) );
-	test( KErrCorruptSurrogateFound == TPtrC16( KDC00() ).Match2( TPtrC16( KQuestion() ) ) );
-	test( KErrCorruptSurrogateFound == TPtrC16( KDFFF() ).Match2( TPtrC16( KQuestion() ) ) );
 
     test( KErrNotFound == TPtrC16( KD800() ).MatchF( TPtrC16( KQuestion() ) ) );
     test( 0 == TPtrC16( KD800() ).MatchF( TPtrC16( KD800() ) ) );
--- a/kerneltest/e32test/buffer/t_parray.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/buffer/t_parray.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -80,12 +80,9 @@
 	test(TRUE);
 	TKeyArrayPak kk(sizeof(TText),ECmpNormal,0);
 	TKeyArrayVar vv(sizeof(TText),ECmpNormal,0);
-	TKeyArrayPak hh(sizeof(TText),ECmpNormal);
 	test(TRUE);
 	TRAPD(res,aPakVar.SortL(vv));
 	test(res==KErrNone);
-	TRAPD(err,aPakVar.SortL(hh));
-	test(err==KErrNone);
 	const TText* aa=_S("a");
 	aPakVar.InsertL(0,*aa,sizeof(TText));
 	TBuf<0x10> des1(1);
--- a/kerneltest/e32test/buffer/t_que.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/buffer/t_que.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1762,12 +1762,14 @@
 	Item item1,item2;
 	TDblQue<Item> que;
 	T* iter;
+	Item* a;
 
 	que.AddFirst(item2);
 	que.AddFirst(item1);
 	test.Start(_L("Constructor"));
 	iter=new T(que);
 	test.Next(_L("Iterators"));
+	a=*iter;
 	test(((*iter)++)==&item1);
 	test(((*iter)--)==&item2);
 	test(((*iter)++)==&item1);
--- a/kerneltest/e32test/buffer/t_regn.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/buffer/t_regn.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -641,6 +641,7 @@
 	RRegion rgnErr,rgnErr2;
 	RRegion rgn;
 	TRect rect(1,2,3,4),rect2;
+	const TRect* rList;
 	TPoint pnt;
 
 	rgnErr.ForceError();
@@ -710,6 +711,7 @@
 	test(rect2.iTl.iX==0 && rect2.iBr.iY==0);
 
 	test(rgnErr.Count()==0);
+	rList=rgnErr.RectangleList();
 	rgn.Close();
 	rgnErr.Close();
 	rgnErr2.Close();
--- a/kerneltest/e32test/buffer/t_sque.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/buffer/t_sque.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -940,12 +940,14 @@
 	T item1,item2;
 	TSglQue<T> que(_FOFF(T,iLink));
 	Iter* iter;
+	T* a;
 
 	que.AddFirst(item2);
 	que.AddFirst(item1);
 	test.Start(_L("Constructor"));
 	iter=new Iter(que);
 	test.Next(_L("Iterators"));
+	a=*iter;
 	(*iter)++;
 	delete iter;
 	test.Next(_L("Finished"));
--- a/kerneltest/e32test/bwins/d_dma2_simu.def	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-EXPORTS
-	?CreateLogicalDevice@@YAPAVDLogicalDevice@@XZ @ 1 NONAME ; class DLogicalDevice * CreateLogicalDevice(void)
-	?FailNext@TDmaChannel@@QAEHH@Z @ 2 NONAME ; int TDmaChannel::FailNext(int)
-	?LinkToChannel@TDmaChannel@@QAEHPAV1@@Z @ 3 NONAME ; int TDmaChannel::LinkToChannel(class TDmaChannel *)
-	?FragmentCount@DDmaRequest@@QAEHXZ @ 4 NONAME ; int DDmaRequest::FragmentCount(void)
-	?Fragment@DDmaRequest@@QAEHABUTDmaTransferArgs@@@Z @ 5 NONAME ; int DDmaRequest::Fragment(struct TDmaTransferArgs const &)
-	?DmacCaps@TDmaChannel@@QAEABUSDmacCaps@@XZ @ 6 NONAME ; struct SDmacCaps const & TDmaChannel::DmacCaps(void)
-	?Open@TDmaChannel@@SAHABUSCreateInfo@1@AAPAV1@@Z @ 7 NONAME ; int TDmaChannel::Open(struct TDmaChannel::SCreateInfo const &, class TDmaChannel * &)
-	?TotalNumDstElementsTransferred@DDmaRequest@@QAEKXZ @ 8 NONAME ; unsigned long DDmaRequest::TotalNumDstElementsTransferred(void)
-	?Close@TDmaChannel@@QAEXXZ @ 9 NONAME ; void TDmaChannel::Close(void)
-	?TotalNumSrcElementsTransferred@DDmaRequest@@QAEKXZ @ 10 NONAME ; unsigned long DDmaRequest::TotalNumSrcElementsTransferred(void)
-	??0TDmaTransferArgs@@QAE@ABUTDmaTransferConfig@@0KIIW4TDmaGraphicsOps@@K@Z @ 11 NONAME ; TDmaTransferArgs::TDmaTransferArgs(struct TDmaTransferConfig const &, struct TDmaTransferConfig const &, unsigned long, unsigned int, unsigned int, enum TDmaGraphicsOps, unsigned long)
-	??0TDmaTransferArgs@@QAE@IIIIIIW4TDmaAddrMode@@IIW4TDmaBurstSize@@IW4TDmaGraphicsOps@@K@Z @ 12 NONAME ; TDmaTransferArgs::TDmaTransferArgs(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, enum TDmaAddrMode, unsigned int, unsigned int, enum TDmaBurstSize, unsigned int, enum TDmaGraphicsOps, unsigned long)
-	?Queue@DDmaRequest@@QAEHXZ @ 13 NONAME ; int DDmaRequest::Queue(void)
-	?IsrRedoRequest@TDmaChannel@@QAEHKKIKH@Z @ 14 NONAME ; int TDmaChannel::IsrRedoRequest(unsigned long, unsigned long, unsigned int, unsigned long, int)
-	?EnableSrcElementCounting@DDmaRequest@@QAEXH@Z @ 15 NONAME ; void DDmaRequest::EnableSrcElementCounting(int)
-	?CancelAll@TDmaChannel@@QAEXXZ @ 16 NONAME ; void TDmaChannel::CancelAll(void)
-	?FreeSrcDesList@DDmaRequest@@QAEXXZ @ 17 NONAME ; void DDmaRequest::FreeSrcDesList(void)
-	?AddressAlignMask@TDmaChannel@@QAEIIIK@Z @ 18 NONAME ; unsigned int TDmaChannel::AddressAlignMask(unsigned int, unsigned int, unsigned long)
-	??0TDmaTransferConfig@@QAE@KIIIHHIIW4TDmaBurstSize@@IIH@Z @ 19 NONAME ; TDmaTransferConfig::TDmaTransferConfig(unsigned long, unsigned int, unsigned int, unsigned int, int, int, unsigned int, unsigned int, enum TDmaBurstSize, unsigned int, unsigned int, int)
-	??0DDmaRequest@@QAE@AAVTDmaChannel@@P6AXIW4TDmaResult@@PAXPAUSDmaDesHdr@@@Z2I@Z @ 20 NONAME ; DDmaRequest::DDmaRequest(class TDmaChannel &, void (*)(unsigned int, enum TDmaResult, void *, struct SDmaDesHdr *), void *, unsigned int)
-	?Pause@TDmaChannel@@QAEHXZ @ 21 NONAME ; int TDmaChannel::Pause(void)
-	??0TDmaTransferArgs@@QAE@XZ @ 22 NONAME ; TDmaTransferArgs::TDmaTransferArgs(void)
-	?DmaTestInfo@@YAABUTDmaTestInfo@@XZ @ 23 NONAME ; struct TDmaTestInfo const & DmaTestInfo(void)
-	?EnableDstElementCounting@DDmaRequest@@QAEXH@Z @ 24 NONAME ; void DDmaRequest::EnableDstElementCounting(int)
-	??0TDmaTransferConfig@@QAE@XZ @ 25 NONAME ; TDmaTransferConfig::TDmaTransferConfig(void)
-	?DisableDstElementCounting@DDmaRequest@@QAEXXZ @ 26 NONAME ; void DDmaRequest::DisableDstElementCounting(void)
-	??0DDmaRequest@@QAE@AAVTDmaChannel@@P6AXW4TResult@0@PAX@Z2H@Z @ 27 NONAME ; DDmaRequest::DDmaRequest(class TDmaChannel &, void (*)(enum DDmaRequest::TResult, void *), void *, int)
-	?MaxTransferLength@TDmaChannel@@QAEIIIK@Z @ 28 NONAME ; unsigned int TDmaChannel::MaxTransferLength(unsigned int, unsigned int, unsigned long)
-	?ExpandDesList@DDmaRequest@@QAEHH@Z @ 29 NONAME ; int DDmaRequest::ExpandDesList(int)
-	?ExpandDstDesList@DDmaRequest@@QAEHH@Z @ 30 NONAME ; int DDmaRequest::ExpandDstDesList(int)
-	?Resume@TDmaChannel@@QAEHXZ @ 31 NONAME ; int TDmaChannel::Resume(void)
-	?FreeDstDesList@DDmaRequest@@QAEXXZ @ 32 NONAME ; void DDmaRequest::FreeDstDesList(void)
-	?SrcFragmentCount@DDmaRequest@@QAEHXZ @ 33 NONAME ; int DDmaRequest::SrcFragmentCount(void)
-	?DmaTestInfoV2@@YAABUTDmaV2TestInfo@@XZ @ 34 NONAME ; struct TDmaV2TestInfo const & DmaTestInfoV2(void)
-	?ExpandSrcDesList@DDmaRequest@@QAEHH@Z @ 35 NONAME ; int DDmaRequest::ExpandSrcDesList(int)
-	?Fragment@DDmaRequest@@QAEHKKHIK@Z @ 36 NONAME ; int DDmaRequest::Fragment(unsigned long, unsigned long, int, unsigned int, unsigned long)
-	?FreeDesList@DDmaRequest@@QAEXXZ @ 37 NONAME ; void DDmaRequest::FreeDesList(void)
-	?StaticExtension@TDmaChannel@@QAEHHPAX@Z @ 38 NONAME ; int TDmaChannel::StaticExtension(int, void *)
-	?Extension@TDmaChannel@@QAEHHPAX@Z @ 39 NONAME ; int TDmaChannel::Extension(int, void *)
-	?MissNextInterrupts@TDmaChannel@@QAEHH@Z @ 40 NONAME ; int TDmaChannel::MissNextInterrupts(int)
-	?DisableSrcElementCounting@DDmaRequest@@QAEXXZ @ 41 NONAME ; void DDmaRequest::DisableSrcElementCounting(void)
-	??1DDmaRequest@@UAE@XZ @ 42 NONAME ; DDmaRequest::~DDmaRequest(void)
-	?DstFragmentCount@DDmaRequest@@QAEHXZ @ 43 NONAME ; int DDmaRequest::DstFragmentCount(void)
-	??0TDmaTransferConfig@@QAE@KIW4TDmaAddrMode@@IW4TDmaBurstSize@@IIIH@Z @ 44 NONAME ; TDmaTransferConfig::TDmaTransferConfig(unsigned long, unsigned int, enum TDmaAddrMode, unsigned int, enum TDmaBurstSize, unsigned int, unsigned int, unsigned int, int)
-
--- a/kerneltest/e32test/bwins/i2c_masterstubs_ctrlessu.def	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-EXPORTS
-	?CreatePhysicalDevice@@YAPAVDPhysicalDevice@@XZ @ 1 NONAME ; class DPhysicalDevice * CreatePhysicalDevice(void)
-	??0DIicBusChannelMasterSlave@@QAE@W4TBusType@DIicBusChannel@@W4TChannelDuplex@2@PAVDIicBusChannelMaster@@PAVDIicBusChannelSlave@@@Z @ 2 NONAME ; DIicBusChannelMasterSlave::DIicBusChannelMasterSlave(enum DIicBusChannel::TBusType, enum DIicBusChannel::TChannelDuplex, class DIicBusChannelMaster *, class DIicBusChannelSlave *)
-	?DfcFunc@TIicBusSlaveCallback@@CAXPAX@Z @ 3 NONAME ; void TIicBusSlaveCallback::DfcFunc(void *)
-	??0DSimulatedIicBusChannelSlaveI2c@@QAE@W4TBusType@DIicBusChannel@@W4TChannelDuplex@2@@Z @ 4 NONAME ; DSimulatedIicBusChannelSlaveI2c::DSimulatedIicBusChannelSlaveI2c(enum DIicBusChannel::TBusType, enum DIicBusChannel::TChannelDuplex)
-	??0DSimulatedIicBusChannelMasterI2c@@QAE@W4TBusType@DIicBusChannel@@W4TChannelDuplex@2@@Z @ 5 NONAME ; DSimulatedIicBusChannelMasterI2c::DSimulatedIicBusChannelMasterI2c(enum DIicBusChannel::TBusType, enum DIicBusChannel::TChannelDuplex)
-	??0DSimulatedIicBusChannelMasterSlaveI2c@@QAE@W4TBusType@DIicBusChannel@@W4TChannelDuplex@2@PAVDSimulatedIicBusChannelMasterI2c@@PAVDSimulatedIicBusChannelSlaveI2c@@@Z @ 6 NONAME ; DSimulatedIicBusChannelMasterSlaveI2c::DSimulatedIicBusChannelMasterSlaveI2c(enum DIicBusChannel::TBusType, enum DIicBusChannel::TChannelDuplex, class DSimulatedIicBusChannelMasterI2c *, class DSimulatedIicBusChannelSlaveI2c *)
-
--- a/kerneltest/e32test/bwins/i2c_slavestubs_ctrlessu.def	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-EXPORTS
-	?CreatePhysicalDevice@@YAPAVDPhysicalDevice@@XZ @ 1 NONAME ; class DPhysicalDevice * CreatePhysicalDevice(void)
-	??0DIicBusChannelMasterSlave@@QAE@W4TBusType@DIicBusChannel@@W4TChannelDuplex@2@PAVDIicBusChannelMaster@@PAVDIicBusChannelSlave@@@Z @ 2 NONAME ; DIicBusChannelMasterSlave::DIicBusChannelMasterSlave(enum DIicBusChannel::TBusType, enum DIicBusChannel::TChannelDuplex, class DIicBusChannelMaster *, class DIicBusChannelSlave *)
-	?DfcFunc@TIicBusSlaveCallback@@CAXPAX@Z @ 3 NONAME ; void TIicBusSlaveCallback::DfcFunc(void *)
-	??0DSimulatedIicBusChannelMasterI2c@@QAE@W4TBusType@DIicBusChannel@@W4TChannelDuplex@2@@Z @ 4 NONAME ; DSimulatedIicBusChannelMasterI2c::DSimulatedIicBusChannelMasterI2c(enum DIicBusChannel::TBusType, enum DIicBusChannel::TChannelDuplex)
-	??0DSimulatedIicBusChannelSlaveI2c@@QAE@W4TBusType@DIicBusChannel@@W4TChannelDuplex@2@@Z @ 5 NONAME ; DSimulatedIicBusChannelSlaveI2c::DSimulatedIicBusChannelSlaveI2c(enum DIicBusChannel::TBusType, enum DIicBusChannel::TChannelDuplex)
-	??0DSimulatedIicBusChannelMasterSlaveI2c@@QAE@W4TBusType@DIicBusChannel@@W4TChannelDuplex@2@PAVDSimulatedIicBusChannelMasterI2c@@PAVDSimulatedIicBusChannelSlaveI2c@@@Z @ 6 NONAME ; DSimulatedIicBusChannelMasterSlaveI2c::DSimulatedIicBusChannelMasterSlaveI2c(enum DIicBusChannel::TBusType, enum DIicBusChannel::TChannelDuplex, class DSimulatedIicBusChannelMasterI2c *, class DSimulatedIicBusChannelSlaveI2c *)
-
--- a/kerneltest/e32test/bx86/d_dma2_simu.def	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-EXPORTS
-	?CreateLogicalDevice@@YAPAVDLogicalDevice@@XZ @ 1 NONAME ; class DLogicalDevice * __cdecl CreateLogicalDevice(void)
-	??0DDmaRequest@@QAE@AAVTDmaChannel@@P6AXIW4TDmaResult@@PAXPAUSDmaDesHdr@@@Z2I@Z @ 2 NONAME ; public: __thiscall DDmaRequest::DDmaRequest(class TDmaChannel &,void (__cdecl*)(unsigned int,enum TDmaResult,void *,struct SDmaDesHdr *),void *,unsigned int)
-	??0DDmaRequest@@QAE@AAVTDmaChannel@@P6AXW4TResult@0@PAX@Z2H@Z @ 3 NONAME ; public: __thiscall DDmaRequest::DDmaRequest(class TDmaChannel &,void (__cdecl*)(enum DDmaRequest::TResult,void *),void *,int)
-	??0TDmaTransferArgs@@QAE@ABUTDmaTransferConfig@@0KIIW4TDmaGraphicsOps@@K@Z @ 4 NONAME ; public: __thiscall TDmaTransferArgs::TDmaTransferArgs(struct TDmaTransferConfig const &,struct TDmaTransferConfig const &,unsigned long,unsigned int,unsigned int,enum TDmaGraphicsOps,unsigned long)
-	??0TDmaTransferArgs@@QAE@IIIIIIW4TDmaAddrMode@@IIW4TDmaBurstSize@@IW4TDmaGraphicsOps@@K@Z @ 5 NONAME ; public: __thiscall TDmaTransferArgs::TDmaTransferArgs(unsigned int,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int,enum TDmaAddrMode,unsigned int,unsigned int,enum TDmaBurstSize,unsigned int,enum TDmaGraphicsOps,unsigned long)
-	??0TDmaTransferArgs@@QAE@XZ @ 6 NONAME ; public: __thiscall TDmaTransferArgs::TDmaTransferArgs(void)
-	??0TDmaTransferConfig@@QAE@KIIIHHIIW4TDmaBurstSize@@IIH@Z @ 7 NONAME ; public: __thiscall TDmaTransferConfig::TDmaTransferConfig(unsigned long,unsigned int,unsigned int,unsigned int,int,int,unsigned int,unsigned int,enum TDmaBurstSize,unsigned int,unsigned int,int)
-	??0TDmaTransferConfig@@QAE@KIW4TDmaAddrMode@@IW4TDmaBurstSize@@IIIH@Z @ 8 NONAME ; public: __thiscall TDmaTransferConfig::TDmaTransferConfig(unsigned long,unsigned int,enum TDmaAddrMode,unsigned int,enum TDmaBurstSize,unsigned int,unsigned int,unsigned int,int)
-	??0TDmaTransferConfig@@QAE@XZ @ 9 NONAME ; public: __thiscall TDmaTransferConfig::TDmaTransferConfig(void)
-	??1DDmaRequest@@UAE@XZ @ 10 NONAME ; public: virtual __thiscall DDmaRequest::~DDmaRequest(void)
-	?AddressAlignMask@TDmaChannel@@QAEIIIK@Z @ 11 NONAME ; public: unsigned int __thiscall TDmaChannel::AddressAlignMask(unsigned int,unsigned int,unsigned long)
-	?CancelAll@TDmaChannel@@QAEXXZ @ 12 NONAME ; public: void __thiscall TDmaChannel::CancelAll(void)
-	?Close@TDmaChannel@@QAEXXZ @ 13 NONAME ; public: void __thiscall TDmaChannel::Close(void)
-	?DisableDstElementCounting@DDmaRequest@@QAEXXZ @ 14 NONAME ; public: void __thiscall DDmaRequest::DisableDstElementCounting(void)
-	?DisableSrcElementCounting@DDmaRequest@@QAEXXZ @ 15 NONAME ; public: void __thiscall DDmaRequest::DisableSrcElementCounting(void)
-	?DmaTestInfo@@YAABUTDmaTestInfo@@XZ @ 16 NONAME ; struct TDmaTestInfo const & __cdecl DmaTestInfo(void)
-	?DmaTestInfoV2@@YAABUTDmaV2TestInfo@@XZ @ 17 NONAME ; struct TDmaV2TestInfo const & __cdecl DmaTestInfoV2(void)
-	?DmacCaps@TDmaChannel@@QAEABUSDmacCaps@@XZ @ 18 NONAME ; public: struct SDmacCaps const & __thiscall TDmaChannel::DmacCaps(void)
-	?DstFragmentCount@DDmaRequest@@QAEHXZ @ 19 NONAME ; public: int __thiscall DDmaRequest::DstFragmentCount(void)
-	?EnableDstElementCounting@DDmaRequest@@QAEXH@Z @ 20 NONAME ; public: void __thiscall DDmaRequest::EnableDstElementCounting(int)
-	?EnableSrcElementCounting@DDmaRequest@@QAEXH@Z @ 21 NONAME ; public: void __thiscall DDmaRequest::EnableSrcElementCounting(int)
-	?ExpandDesList@DDmaRequest@@QAEHH@Z @ 22 NONAME ; public: int __thiscall DDmaRequest::ExpandDesList(int)
-	?ExpandDstDesList@DDmaRequest@@QAEHH@Z @ 23 NONAME ; public: int __thiscall DDmaRequest::ExpandDstDesList(int)
-	?ExpandSrcDesList@DDmaRequest@@QAEHH@Z @ 24 NONAME ; public: int __thiscall DDmaRequest::ExpandSrcDesList(int)
-	?Extension@TDmaChannel@@QAEHHPAX@Z @ 25 NONAME ; public: int __thiscall TDmaChannel::Extension(int,void *)
-	?FailNext@TDmaChannel@@QAEHH@Z @ 26 NONAME ; public: int __thiscall TDmaChannel::FailNext(int)
-	?Fragment@DDmaRequest@@QAEHABUTDmaTransferArgs@@@Z @ 27 NONAME ; public: int __thiscall DDmaRequest::Fragment(struct TDmaTransferArgs const &)
-	?Fragment@DDmaRequest@@QAEHKKHIK@Z @ 28 NONAME ; public: int __thiscall DDmaRequest::Fragment(unsigned long,unsigned long,int,unsigned int,unsigned long)
-	?FragmentCount@DDmaRequest@@QAEHXZ @ 29 NONAME ; public: int __thiscall DDmaRequest::FragmentCount(void)
-	?FreeDesList@DDmaRequest@@QAEXXZ @ 30 NONAME ; public: void __thiscall DDmaRequest::FreeDesList(void)
-	?FreeDstDesList@DDmaRequest@@QAEXXZ @ 31 NONAME ; public: void __thiscall DDmaRequest::FreeDstDesList(void)
-	?FreeSrcDesList@DDmaRequest@@QAEXXZ @ 32 NONAME ; public: void __thiscall DDmaRequest::FreeSrcDesList(void)
-	?IsrRedoRequest@TDmaChannel@@QAEHKKIKH@Z @ 33 NONAME ; public: int __thiscall TDmaChannel::IsrRedoRequest(unsigned long,unsigned long,unsigned int,unsigned long,int)
-	?LinkToChannel@TDmaChannel@@QAEHPAV1@@Z @ 34 NONAME ; public: int __thiscall TDmaChannel::LinkToChannel(class TDmaChannel *)
-	?MaxTransferLength@TDmaChannel@@QAEIIIK@Z @ 35 NONAME ; public: unsigned int __thiscall TDmaChannel::MaxTransferLength(unsigned int,unsigned int,unsigned long)
-	?MissNextInterrupts@TDmaChannel@@QAEHH@Z @ 36 NONAME ; public: int __thiscall TDmaChannel::MissNextInterrupts(int)
-	?Open@TDmaChannel@@SAHABUSCreateInfo@1@AAPAV1@@Z @ 37 NONAME ; public: static int __cdecl TDmaChannel::Open(struct TDmaChannel::SCreateInfo const &,class TDmaChannel * &)
-	?Pause@TDmaChannel@@QAEHXZ @ 38 NONAME ; public: int __thiscall TDmaChannel::Pause(void)
-	?Queue@DDmaRequest@@QAEHXZ @ 39 NONAME ; public: int __thiscall DDmaRequest::Queue(void)
-	?Resume@TDmaChannel@@QAEHXZ @ 40 NONAME ; public: int __thiscall TDmaChannel::Resume(void)
-	?SrcFragmentCount@DDmaRequest@@QAEHXZ @ 41 NONAME ; public: int __thiscall DDmaRequest::SrcFragmentCount(void)
-	?StaticExtension@TDmaChannel@@QAEHHPAX@Z @ 42 NONAME ; public: int __thiscall TDmaChannel::StaticExtension(int,void *)
-	?TotalNumDstElementsTransferred@DDmaRequest@@QAEKXZ @ 43 NONAME ; public: unsigned long __thiscall DDmaRequest::TotalNumDstElementsTransferred(void)
-	?TotalNumSrcElementsTransferred@DDmaRequest@@QAEKXZ @ 44 NONAME ; public: unsigned long __thiscall DDmaRequest::TotalNumSrcElementsTransferred(void)
-
--- a/kerneltest/e32test/cppexceptions/second_excp.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/cppexceptions/second_excp.h	Wed Sep 01 12:34:56 2010 +0100
@@ -41,11 +41,7 @@
 
 class MyFourthException : public VB1 , public VB2 {
 public:
-#if defined(__ARMCC__) && __ARMCC_VERSION >= 400000
-  EXPORT_C MyFourthException(int x) { iVal = x; iVal2=x+2;};
-#else
   MyFourthException(int x) { iVal = x; iVal2=x+2;};
-#endif
   int iVal2;
 };
 
--- a/kerneltest/e32test/debug/t_btrace.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/debug/t_btrace.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -2535,8 +2535,8 @@
 				if(Body(data)[1]==(TUint)threadtest.alloc_addr)
 					{
 					found_heap_alloc=1;
-					test_Compare(Body(data)[2], >= ,4);
-					test_Equal(4, Body(data)[3]);
+					test_Equal(4, Body(data)[2]);
+					test_Compare(Body(data)[3], >= ,4);
 					}
 				}
 			if(data[BTrace::ESubCategoryIndex]==BTrace::EHeapFree)
--- a/kerneltest/e32test/debug/t_context.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/debug/t_context.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -408,7 +408,6 @@
 	// run again only after it is blocked on its request semaphore.
 	t.SetPriority(EPriorityMore);
 	t.Resume();
-	User::After(500000);
 
 	if (aCallback != ENoCallback)
 		{
--- a/kerneltest/e32test/debug/t_heapcorruption.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/debug/t_heapcorruption.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -23,150 +23,116 @@
 #include <e32base_private.h>
 #include <e32cmn.h>
 #include <e32cmn_private.h>
-#include "dla.h"
-#include "slab.h"
-#include "page_alloc.h"
-#include "heap_hybrid.h"
+
+
+#define __NEXT_CELL(p)				((SCell*)(((TUint8*)p)+p->len))
 
 TBool gEnableMemoryMonitor = EFalse;
 
-#ifdef _DEBUG
-const TInt KDbgHeaderSize = (TInt)RHeap::EDebugHdrSize;
-#else
-const TInt KDbgHeaderSize = 0;
-#endif
 
 /**
-Friend class of RHeapHybrid to access to hybrid heap metadata
+Test heap that will corrupt some cells to generate BTrace events.
 */
-class TestHybridHeap
+class RMyDummyHeap : public RHeap
 {
-	public:
-		TBool Init();
-		TBool Check();
-		TInt  AllocLen(TAny* aBfr);
-		void  EnableHeavyMemoryMonitoring();
-		void  CorruptFreeDLBfr(TAny* aBfr);
-		void  CorruptFreeDLBfrLth(TAny* aBfr);
-		void  CorruptAllocatedDLBfrSize(TAny* aBfr);
-		TAny* CorruptAllocatedDLMemoryAddress(TAny* aBfr);		
-
-	private:
-		RHybridHeap* iHybridHeap;
+public:
+	//EBadFreeCellAddress
+	void CorruptFreeMemory1()
+		{
+		SCell* f = (SCell*)&iFree;
+		f->next = (SCell*)iTop;
+		f->next += sizeof(TUint8);
+		}
+	
+	//EBadFreeCellSize
+	void CorruptFreeMemory2()
+		{
+		SCell* p = (SCell*)&iFree;
+		SCell* n = p->next; 
+		n->len = iMinCell-1;
+		}
+	
+	//EBadAllocatedCellAddress
+	void CorruptAllocatedMemory1()
+		{
+		SCell* c = (SCell*)iBase;
+		SCell* f = (SCell*)&iFree;
+		
+		f = f->next;
+		f = f->next;
+		c->len = (TInt)f->next - (TInt)c;
+		}
+	
+	//additional utilities
+	void CorruptAllocatedMemorySize(void* aAddress)
+		{
+		SCell* addres = GetAddress(aAddress);
+		SCell* c = (SCell*)iBase;
+		for(;;)
+			{
+			if(c == addres)
+				{
+				c->len = iMinCell-1;
+				break;
+				}
+			c = __NEXT_CELL(c);
+			}
+		}
+		
+	void CorruptAllocatedMemoryAddress(void* aAddress)
+		{
+		SCell* pF = &iFree;				// free cells
+		pF = pF->next;				// next free cell
+		if (!pF)
+			pF = (SCell*)iTop;	
+		SCell* addres = GetAddress(aAddress);
+		SCell* c = (SCell*)iBase;
+		for(;;)
+			{
+			if(c == addres)
+				{
+				c->len = (TInt)pF->next - (TInt)c;
+				break;
+				}
+			c = __NEXT_CELL(c);
+			}
+		}
+	
+	void EnableHeavyMemoryMonitoring()
+		{
+		iFlags |= EMonitorMemory;
+		}
 };
 
 
-
-TBool TestHybridHeap::Init()
-{
-	RHybridHeap::STestCommand cmd;
-	cmd.iCommand = RHybridHeap::EHeapMetaData;
-	RAllocator& heap = User::Allocator();
-	TInt ret = heap.DebugFunction(RHeap::EHybridHeap, &cmd, 0);
-	if (ret != KErrNone)
-		return EFalse;
-	iHybridHeap = (RHybridHeap*) cmd.iData;
-
-	return ETrue;
-}
-
-TBool TestHybridHeap::Check()
-{
-	if ( iHybridHeap )
-		{
-		iHybridHeap->Check();  
-		}
-
-	return EFalse;
-}
-
-TInt TestHybridHeap::AllocLen(TAny* aBfr)
-{
-	if ( iHybridHeap )
-		{
-		return iHybridHeap->AllocLen(aBfr);  
-		}
-	return 0;
-}
-
-void TestHybridHeap::EnableHeavyMemoryMonitoring()
-{
-	if ( iHybridHeap )
-		{
-		iHybridHeap->iFlags |= RAllocator::EMonitorMemory;
-		}
-
-}
-
-
-void TestHybridHeap::CorruptFreeDLBfr(TAny* aBfr)
-{
-
-	if ( aBfr )
-		{
-		mchunkptr p	= MEM2CHUNK((TUint8*)aBfr-KDbgHeaderSize);
-		p->iHead |= CINUSE_BIT;
-		}
-}
-
-void TestHybridHeap::CorruptFreeDLBfrLth(TAny* aBfr)
-{
-
-	if ( aBfr )
-		{
-		mchunkptr p	= MEM2CHUNK((TUint8*)aBfr-KDbgHeaderSize);
-		p->iHead &= INUSE_BITS; // Set zero length
-		}
-}
-
-void TestHybridHeap::CorruptAllocatedDLBfrSize(TAny* aBfr)
-{
-
-	if ( aBfr )
-		{
-		mchunkptr p	= MEM2CHUNK((TUint8*)aBfr-KDbgHeaderSize);
-		TInt size = CHUNKSIZE(p);
-		size  >>= 1;  // Set double length
-		p->iHead = size | INUSE_BITS; 
-		}
-}
-
-TAny* TestHybridHeap::CorruptAllocatedDLMemoryAddress(TAny* aBfr)
-{
-
-	if ( aBfr )
-		{
-		TUint8* p = (TUint8*)aBfr;
-		p += 3;
-		aBfr = (TAny*)p;
-		}
-	return aBfr;
-}
-
-
 /**
-Heap corruption 0:
-- Allocate (DL) buffer, corrupt it and free
+Heap corruption 2:
+- Overrunning an array using memset 
+(EHeapCorruption - EBadAllocatedCellSize)
 */
-void Memory_Corruption0(TestHybridHeap& aHeap)
+void Memory_Corruption2()
 	{
 	if(gEnableMemoryMonitor)
-		aHeap.EnableHeavyMemoryMonitoring();	
+		{
+		RMyDummyHeap* h = (RMyDummyHeap*)&User::Heap();
+		h->EnableHeavyMemoryMonitoring();	
+		}
 	
 	char* buf = new char[10];  //will be aligned to 12
 	char* buf2 = new char[10]; //will be aligned to 12
-	TInt a = aHeap.AllocLen(buf);
-	memset(buf, 0xfc, a+a); //memory corruption
+	TInt a = User::Heap().AllocLen(buf);
+	memset(buf, 255, a+1); //memory corruption
 	
 	if(!gEnableMemoryMonitor)
-		aHeap.Check(); //force 'heap walker' to check the heap
+			User::Heap().Check(); //force 'heap walker' to check the heap
 	
 	delete buf2;
-	delete buf; //when heavy monitoring is ON should send trace and panic
+	delete buf; //when heavy monitoring is ON should send trace
 	}
 
-//Corrupt free DL memory and Check()
-void Memory_Corruption1(TestHybridHeap& aHeap)
+
+//causes EBadFreeCellAddress corruption type
+void Memory_Corruption3()
 	{
 	TInt* p1 = new TInt();
 	TInt* p2 = new TInt();
@@ -178,8 +144,9 @@
 	delete p4;
 	delete p6;
 	
-	aHeap.CorruptFreeDLBfr(p4);
-	aHeap.Check();  // Should panic here
+	RMyDummyHeap* h = (RMyDummyHeap*)&User::Heap();
+	h->CorruptFreeMemory1();
+	User::Heap().Check();
 	
 	delete p5;
 	delete p3;
@@ -187,16 +154,17 @@
 	}
 
 
-//corrupt free DL buffer length 
-void Memory_Corruption2(TestHybridHeap& aHeap)
+//causes EBadFreeCellSize RHeap corruption type
+void Memory_Corruption4()
 	{
 	TInt* p1 = new TInt();
 	TInt* p2 = new TInt();
 	TInt* p3 = new TInt();
 	delete p2;
 	
-	aHeap.CorruptFreeDLBfrLth(p2);
-	aHeap.Check(); // Should panic here
+	RMyDummyHeap* h = (RMyDummyHeap*)&User::Heap();
+	h->CorruptFreeMemory2();
+	User::Heap().Check();
 	
 	delete p3;
 	
@@ -204,8 +172,8 @@
 	}
 
 
-//Corrupt allocated DL buffer size
-void Memory_Corruption3(TestHybridHeap& aHeap)
+//causes EBadAllocatedCellAddress corruption type
+void Memory_Corruption5()
 	{
 	TInt* p1 = new TInt;
 	TInt* p2 = new TInt;
@@ -218,8 +186,10 @@
 	delete p4;
 	delete p6;
 	
-	aHeap.CorruptAllocatedDLBfrSize(p7);
-	aHeap.Check();
+	RMyDummyHeap* h = (RMyDummyHeap*)&User::Heap();
+	//h->CorruptAllocatedMemory1();
+	h->CorruptAllocatedMemoryAddress((void*)p7);
+	User::Heap().Check();
 	
 	delete p7;
 	delete p5;
@@ -228,11 +198,12 @@
 	}
 
 
-void Memory_Corruption4(TestHybridHeap& aHeap)
+void Memory_Corruption_Special1()
 	{
 	char* buf = new char;
-	aHeap.EnableHeavyMemoryMonitoring();
-	buf = (char*)aHeap.CorruptAllocatedDLMemoryAddress((TAny*)buf);
+	RMyDummyHeap* h = (RMyDummyHeap*)&User::Heap();
+	h->EnableHeavyMemoryMonitoring();
+	h->CorruptAllocatedMemoryAddress((void*)buf);
 	delete buf;// should output EHeapCorruption trace
 	}
 
@@ -241,26 +212,23 @@
 //  Local Functions
 LOCAL_D TInt threadTraceHeapCorruptionTestThread(TAny* param)
 	{
-	TestHybridHeap heap;
-	heap.Init();
-	
 	TInt t = *((TInt*)param);
 	switch(t)
 		{
-		case 0:  // Corrupt allocated buffer and free it
-			Memory_Corruption0(heap);
+		case RHeap::EBadAllocatedCellSize:
+			Memory_Corruption2();
 			break;
-		case 1:
-			Memory_Corruption1(heap);
+		case RHeap::EBadFreeCellAddress:
+			Memory_Corruption3();
 			break;
-		case 2:
-			Memory_Corruption2(heap);
+		case RHeap::EBadFreeCellSize:
+			Memory_Corruption4();
 			break;
-		case 3:
-			Memory_Corruption3(heap);
+		case RHeap::EBadAllocatedCellAddress:
+			Memory_Corruption5();
 			break;
 		case 1000:
-			Memory_Corruption4(heap);
+			Memory_Corruption_Special1();
 			break;
 		default:
 			User::Invariant();
@@ -281,8 +249,8 @@
 	
 	switch(aTestType)
 		{
-		case 0: ////Corrupt allocated DL buffer and free it with heavy monitoring enabled
-			type = 0;
+		case 0: ////RHeap::EBadAllocatedCellSize with heavy monitoring enabled
+			type = RHeap::EBadAllocatedCellSize;
 			gEnableMemoryMonitor = ETrue;
 			r = thread.Create(_L("t_tbrace_heapcorruption"), threadTraceHeapCorruptionTestThread, 
 					               KDefaultStackSize, 0x2000, 0x2000, &type);
@@ -293,7 +261,7 @@
 			break;
 			
 		case 1: //RHeap::EBadFreeCellAddress:
-			type = 1;
+			type = RHeap::EBadFreeCellAddress;
 			r = thread.Create(_L("t_tbrace_heapcorruption"), threadTraceHeapCorruptionTestThread, 
 					               KDefaultStackSize, 0x2000, 0x2000, &type);
 			thread.Logon(stat);
@@ -303,7 +271,7 @@
 		break;
 		
 		case 2: //RHeap::EBadFreeCellSize:
-			type = 2;
+			type = RHeap::EBadFreeCellSize;
 			r = thread.Create(_L("t_tbrace_heapcorruption"), threadTraceHeapCorruptionTestThread, 
 			                KDefaultStackSize, 0x2000, 0x2000, &type);
 			thread.Logon(stat);
@@ -313,7 +281,7 @@
 		break;
 		
 		case 3: //RHeap::EBadAllocatedCellSize:
-			type = 0;    // Without memory monitorin this time
+			type = RHeap::EBadAllocatedCellSize;
 			r = thread.Create(_L("t_tbrace_heapcorruption"), threadTraceHeapCorruptionTestThread, 
 						               KDefaultStackSize, 0x2000, 0x2000, &type);
 			thread.Logon(stat);
@@ -323,7 +291,7 @@
 		break;
 		
 		case 4: //RHeap::EBadAllocatedCellAddress:
-			type = 3;
+			type = RHeap::EBadAllocatedCellAddress;
 			r = thread.Create(_L("t_tbrace_heapcorruption"), threadTraceHeapCorruptionTestThread, 
 						               KDefaultStackSize, 0x2000, 0x2000, &type);
 			thread.Logon(stat);
--- a/kerneltest/e32test/defrag/d_ramdefrag.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/defrag/d_ramdefrag.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -72,7 +72,6 @@
 	TInt ZoneAllocToMany2(TInt aZoneIndex, TInt aNumPages);
 	TInt AllocContiguous(TUint aNumBytes);
 	TInt FreeZone(TInt aNumPages);
-	TInt FreeZoneId(TUint aZoneId);
 	TInt FreeFromAllZones();
 	TInt FreeFromAddr(TInt aNumPages, TUint32 aAddr);
 	TInt PageCount(TUint aId, STestUserSidePageCount* aPageData);
@@ -390,10 +389,6 @@
 			retVal = DRamDefragFuncTestChannel::FreeZone((TInt)a1);
 			break;
 
-		case RRamDefragFuncTestLdd::EFreeZoneId:
-			retVal = DRamDefragFuncTestChannel::FreeZoneId((TUint)a1);
-			break;
-
 		case RRamDefragFuncTestLdd::EFreeFromAllZones:
 			retVal = DRamDefragFuncTestChannel::FreeFromAllZones();	
 			break;
@@ -1517,30 +1512,6 @@
 	}
 
 //
-// FreeZoneId
-//
-// Call Epoc::FreeRamZone()
-//
-TInt DRamDefragFuncTestChannel::FreeZoneId(TUint aZoneId)
-	{
-	NKern::ThreadEnterCS();
-	
-	TInt r = Epoc::FreeRamZone(aZoneId);
-	if (r == KErrNone)
-		{
-		if (iContigAddr == KPhysAddrInvalid)
-			{
-			Kern::Printf("Error some how freed a RAM zone that wasn't previously claimed");
-			NKern::ThreadLeaveCS();
-			return KErrGeneral;
-			}
-		iContigAddr = KPhysAddrInvalid;
-		}
-	NKern::ThreadLeaveCS();
-	return r;
-	}
-
-//
 // FreeFromAllZones
 //
 // Call the overloaded Epoc::FreePhysicalRam function
--- a/kerneltest/e32test/defrag/t_ramdefrag.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/defrag/t_ramdefrag.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -543,20 +543,7 @@
 	Ldd.ResetDriver();
 	
 	Ldd.CallDefrag(DEFRAG_TYPE_GEN, DEFRAG_VER_SYNC);
-	TInt r;
-	r = VerifyMovDisAlloc();
-	if (r == KErrGeneral)
-		{
-		// A rare set of circumstances may cause some of the movable pages to be in
-		// use during the defrag and thus not be moved to the correct RAM zone. Run
-		// the defrag once more to give it a chance to move these pages. We ensure
-		// that there is no pending asynchronous clean up operation before doing so.
-		UserSvr::HalFunction(EHalGroupKernel, EKernelHalSupervisorBarrier, 0, 0);
-		Ldd.CallDefrag(DEFRAG_TYPE_GEN, DEFRAG_VER_SYNC);
-		r = VerifyMovDisAlloc();
-		}
-
-	if (r != KErrNone)
+	if (VerifyMovDisAlloc() != KErrNone)
 		{
 		CLEANUP(;);
 		TEST_FAIL;
@@ -7091,20 +7078,16 @@
 //! @SYMPREQ					PREQ308
 //! @SYMTestPriority			High
 //! @SYMTestActions				
-//! 	1.	Allocate fixed pages and call function to free all fixed pages allocated.
-//!		2.	Claim a RAM zone and then free it via Epoc::FreeRamZone().
-//!		3.	Invoke Epoc::FreeRamZone() with an invalid RAM zone ID.
+//! 	1.	Allocate fixed pages and call function to free all fixed pages allocated.  
 //! 
 //! @SYMTestExpectedResults
 //! 	1.	KErrNone
-//!		2.	KErrNone
-//!		3.	KErrArgument
 //---------------------------------------------------------------------------------------------------------------------
 TInt TestFreeZone()
 	{
 	TInt r = 0;
 	TUint zoneID = 0;
-	test.Start(_L("Test1: Freeing allocated pages"));	
+	test.Start(_L("Test1: Free allocated pages"));	
 	TestStart();	
 	
 	TInt pages = 50;
@@ -7150,58 +7133,7 @@
 			}
 		}
 	TestEnd();
-	test.End();
-
-	test.Start(_L("Test2: Epoc::FreeRamZone() on a claimed RAM zone"));
-	TestStart();
-	GetAllPageInfo();
-	TUint zoneIndex = 0;
-	while (zoneIndex < gZoneCount)
-		{
-		if (gZoneUtilArray[zoneIndex].iFreePages == gZoneUtilArray[zoneIndex].iPhysPages)
-			break;
-		zoneIndex++;
-		}
-	if (zoneIndex >= gZoneCount)
-		{
-		test.Printf(_L("Cannot find zone to perform test, Skipping test step...\n"));
-		goto Test2End;
-		}
-	zoneID = gZoneConfigArray[zoneIndex].iZoneId;
-	r = Ldd.CallDefrag(DEFRAG_TYPE_CLAIM, DEFRAG_VER_SYNC, zoneID);
-	if (r != KErrNone)
-		{
-		test.Printf(_L("Fail: r = %d, expected = %d\n"), r, KErrNone);
-		TEST_FAIL;
-		}
-	GetAllPageInfo();
-	if (gZoneUtilArray[zoneIndex].iPhysPages != gZoneUtilArray[zoneIndex].iAllocFixed)
-		{
-		test.Printf(_L("Fail: RAM zone ID %d not claimed successfully"), zoneID);
-		TEST_FAIL;
-		}
-	r = Ldd.FreeZoneId(zoneID);
-	GetAllPageInfo();
-	if (r != KErrNone ||
-		gZoneUtilArray[zoneIndex].iPhysPages != gZoneUtilArray[zoneIndex].iFreePages)
-		{
-		test.Printf(_L("Fail: RAM zone ID %d not freed successfully r=%d"), zoneID, r);
-		TEST_FAIL;
-		}
-Test2End:
-	TestEnd();
-	test.End();
-
-	test.Start(_L("Test2: Epoc::FreeRamZone() on an invalid RAM zone"));
-	TestStart();
-	r = Ldd.FreeZoneId(KInvalidZoneID);
-	if (r != KErrArgument)
-		{
-		test.Printf(_L("Fail: Error RAM zone ID %d r=%d"), KInvalidZoneID, r);
-		TEST_FAIL;
-		}
-	
-	TestEnd();
+
 	test.End();
 	return KErrNone;
 	}
--- a/kerneltest/e32test/defrag/t_ramdefrag.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/defrag/t_ramdefrag.h	Wed Sep 01 12:34:56 2010 +0100
@@ -139,7 +139,6 @@
 		EZoneAllocToMany2,
 		EAllocContiguous,
 		EFreeZone,
-		EFreeZoneId,
 		EFreeFromAllZones,
 		EFreeFromAddr, 
 		ECheckCancel,
@@ -225,8 +224,6 @@
 	inline TInt FreeFromAllZones()
 		{ return DoControl(EFreeFromAllZones,(TAny*)NULL, (TAny*)NULL); }
 
-	inline TInt FreeZoneId(TUint aZoneId)
-		{ return DoControl(EFreeZoneId, (TAny*)aZoneId); }
 
 	inline TInt CheckCancel(TInt aDefragType, TUint aID = 0)
 		{ 
--- a/kerneltest/e32test/demandpaging/t_chunkheapcreate.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/demandpaging/t_chunkheapcreate.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -64,9 +64,10 @@
 	UpdatePaged(aPaged);
 	
 	RHeap* heap = UserHeap::ChunkHeap(aCreateInfo);
+
 	test_NotNull(heap);
 	RChunk chunk;
-	chunk.SetHandle(((TestHybridHeap*) heap)->ChunkHandle());
+	chunk.SetHandle(heap->ChunkHandle());
 	TBool paged = chunk.IsPaged();
 	chunk.Close();
 	return (aPaged == paged);
@@ -214,8 +215,8 @@
 			{
 			test.Printf(_L("RHeap not created\n"));
 			}
-		test.Printf(_L("chunkHandle = %d heapHandle = %d\n"),chunky.Handle(), ((TestHybridHeap*) heap)->ChunkHandle());
-		test_Equal(chunky.Handle(), ((TestHybridHeap*) heap)->ChunkHandle());
+		test.Printf(_L("chunkHandle = %d heapHandle = %d\n"),chunky.Handle(), heap->ChunkHandle());
+		test_Equal(chunky.Handle(), heap->ChunkHandle());
 		heap->Close();
 		}
 
@@ -237,9 +238,9 @@
 			{
 			test.Printf(_L("RHeap not created\n"));
 			}
-		test.Printf(_L("chunkHandle = %d heapHandle = %d\n"),chunky.Handle(), ((TestHybridHeap*) heap)->ChunkHandle());
+		test.Printf(_L("chunkHandle = %d heapHandle = %d\n"),chunky.Handle(), heap->ChunkHandle());
 		TBool isSame = EFalse;
-		if (chunky.Handle() == ((TestHybridHeap*) heap)->ChunkHandle())
+		if (chunky.Handle() == heap->ChunkHandle())
 			isSame = ETrue;
 		test_Equal(EFalse, isSame);
 		heap->Close();
@@ -303,7 +304,7 @@
 		heap = (RHeap*)UserHeap::ChunkHeap(createInfo);
 		test_NotNull(heap);
 		RChunk chunk;
-		chunk.SetHandle(((TestHybridHeap*) heap)->ChunkHandle());
+		chunk.SetHandle(heap->ChunkHandle());
 		TInt* numBuf = new TInt[gPageSize];
 		test_NotNull(numBuf);
 		test.Printf(_L("chunkSize = %d\n"), chunk.Size());
@@ -322,7 +323,7 @@
 		heap = (RHeap*)UserHeap::ChunkHeap(createInfo);
 		test_NotNull(heap);
 		RChunk chunk;
-		chunk.SetHandle(((TestHybridHeap*) heap)->ChunkHandle());
+		chunk.SetHandle(heap->ChunkHandle());
 		TInt* numBuf = new TInt[gPageSize];
 		test_Equal(NULL, numBuf);
 
@@ -341,7 +342,7 @@
 		heap = (RHeap*)UserHeap::ChunkHeap(createInfo);
 		TInt heapAddr = (TInt)heap;
 		RChunk chunk;
-		chunk.SetHandle(((TestHybridHeap*) heap)->ChunkHandle());
+		chunk.SetHandle(heap->ChunkHandle());
 		test_Equal((TInt)chunk.Base() + 8, heapAddr);
 		test_NotNull(heap);
 		heap->Close();
--- a/kerneltest/e32test/demandpaging/t_datapaging.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/demandpaging/t_datapaging.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -38,7 +38,7 @@
 #include <e32msgqueue.h>
 #include <e32atomics.h>
 #include <e32math.h>
-#include <f32file.h>
+
 #include "t_dpcmn.h"
 #include "../mmu/mmudetect.h"
 #include "../mmu/d_memorytest.h"
@@ -1202,17 +1202,6 @@
 	test.Title();
 	test_KErrNone(GetGlobalPolicies());
 
-	_LIT(KFileName,"Z:\\Test\\not_data_paged.txt");
-	RFs fs;
-	RFile file;
-	TInt error;
-	test(KErrNone == fs.Connect());
-	error = file.Open(fs, KFileName, EFileRead);
-	TBool isFilePresent = (error == KErrNone);
-	file.Close();
-	fs.Close();
-	test(gDataPagingSupported == !isFilePresent);
-
 	test.Start(_L("Test HAL APIs"));
 	TestHal();
 
--- a/kerneltest/e32test/demandpaging/t_dpcmn.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/demandpaging/t_dpcmn.h	Wed Sep 01 12:34:56 2010 +0100
@@ -41,7 +41,3 @@
 void UpdatePaged(TBool& aPaged);
 TInt TestThreadExit(RThread& aThread, TExitType aExitType, TInt aExitReason);
 
-class TestHybridHeap : public RHeap
-	{
-public: TInt ChunkHandle() { return iChunkHandle; };
-	};
--- a/kerneltest/e32test/demandpaging/t_pagetable_limit.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/demandpaging/t_pagetable_limit.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -33,24 +33,9 @@
 #include <hal.h>
 
 #include "t_dpcmn.h"
-#include "../mmu/freeram.h"
 
 RTest test(_L("T_PAGETABLE_LIMIT"));
 
-// The flexible memory model reserves 0xF800000-0xFFF00000 for page tables, which allows 130,048
-// pages tables.
-//
-// We attempt to map 40 * 40 * 100 == 160,000 page tables.
-// 
-// So that the limit is reached in the middle, half the chunks are mapped as paged and half as
-// unpaged.
-
-const TUint KPageTablesPerChunk = 40;
-const TUint KChunksPerProcess = 40;
-const TUint KNumProcesses = 100;
-
-const TUint KSizeMappedByPageTable = 1024 * 1024;  // the amount of RAM mapped by one page table
-
 
 _LIT(KClientPtServerName, "CClientPtServer");
 _LIT(KClientProcessName, "T_PAGETABLE_LIMIT");
@@ -61,7 +46,6 @@
 	EClientDisconnect = -2,
 	EClientGetChunk = 0,
 	EClientReadChunks = 1,
-	EClientGetParentProcess = 2,
 	};
 
 class RDataPagingSession : public RSessionBase
@@ -73,244 +57,176 @@
 		}
 	TInt PublicSendReceive(TInt aFunction, const TIpcArgs &aPtr)
 		{
-		return SendReceive(aFunction, aPtr);
+		return (SendReceive(aFunction, aPtr));
+		}
+	TInt PublicSend(TInt aFunction, const TIpcArgs &aPtr)
+		{
+		return (Send(aFunction, aPtr));
 		}
 	};
 
-#define CLIENT_TEST_IMPL(condition, code, line)			\
-	if (!(condition))									\
-		{												\
-		RDebug::Printf("Test %s failed at line %d");	\
-		r = (code);										\
-		goto exit;										\
-		}
-
-#define CLIENT_TEST(condition, code) CLIENT_TEST_IMPL(condition, code, __LINE__)
 
 TInt ClientProcess(TInt aLen)
 	{
-	// Read the command line to get the number of chunk to map and whether or not to access their
-	// data.
+	// Read the command line to get the number of chunk to map and whether or 
+	// not to access their data.
 	HBufC* buf = HBufC::New(aLen);
 	test(buf != NULL);
 	TPtr ptr = buf->Des();
 	User::CommandLine(ptr);
+
 	TLex lex(ptr);
-
-	RChunk* chunks = NULL;
-	RDataPagingSession session;
-	RProcess parent;
-	TRequestStatus parentStatus;
-	TInt offset = 0;
-	TInt i;
-	
 	TInt chunkCount;
 	TInt r = lex.Val(chunkCount);
-	CLIENT_TEST(r == KErrNone, r);	
+	test_KErrNone(r);
 	lex.SkipSpace();
-	chunks = new RChunk[chunkCount];
-	CLIENT_TEST(chunks, KErrNoMemory);
 
 	TBool accessData;
 	r = lex.Val(accessData);
-	CLIENT_TEST(r == KErrNone, r);
+	test_KErrNone(r);
 
-	r = session.CreateSession(KClientPtServerName, 1);
-	CLIENT_TEST(r == KErrNone, r);
 
-	r = parent.SetReturnedHandle(session.PublicSendReceive(EClientGetParentProcess, TIpcArgs()));
-	CLIENT_TEST(r == KErrNone, r);
-	
-	for (i = 0; i < chunkCount; i++)
+	RDataPagingSession session;
+	test_KErrNone(session.CreateSession(KClientPtServerName, 1));
+
+	RChunk* chunks = new RChunk[chunkCount];
+	for (TInt i = 0; i < chunkCount; i++)
 		{
-		r = chunks[i].SetReturnedHandle(session.PublicSendReceive(EClientGetChunk, TIpcArgs(i)));
+		TInt r = chunks[i].SetReturnedHandle(session.PublicSendReceive(EClientGetChunk, TIpcArgs(i)));
 		if (r != KErrNone)
 			{
-			RDebug::Printf("Failed to create a handle to chunk %d r=%d", i, r);
-			goto exit;
+			test.Printf(_L("Failed to create a handle to the server's chunk r=%d\n"), r);
+			for (TInt j = 0; j < i; j++)
+				chunks[j].Close();
+			session.Close();
+			return r;
 			}
-		CLIENT_TEST(chunks[i].Size() >= gPageSize, KErrGeneral);
+		test_Value(chunks[i].Size(), chunks[i].Size() >= gPageSize);
 		}
-
-	// Logon to parent process
-	parent.Logon(parentStatus);
-
-	// Touch each mapped page of all of the chunks.
-	do
+	if (!accessData)
 		{
+		// Touch the 1st page of each of the chunks.
 		for (TInt i = 0; i < chunkCount; i++)
 			{
-			for (TUint j = 0 ; j < KPageTablesPerChunk ; j++)
+			// Write the chunk data from top to bottom of the chunk's first page.
+			TUint8* base = chunks[i].Base();
+			TUint8* end = base + gPageSize - 1;
+			*base = *end;
+			}
+		// Tell parent we've touched each chunk.
+		TInt r =  (TThreadId)session.PublicSendReceive(EClientReadChunks,TIpcArgs());	// Assumes id is only 32-bit.
+		test_KErrNone(r);
+		for(;;)
+			{// Wake up every 100ms to be killed by the main process.
+			User::After(100000);
+			}
+		}
+	else
+		{
+		for (;;)
+			{
+			TInt offset = 0;
+			for (TInt i = 0; i < chunkCount; i++)
 				{
 				// Write the chunk data from top to bottom of the chunk's first page.
-				TUint8* base = chunks[i].Base() + j * KSizeMappedByPageTable;
+				TUint8* base = chunks[i].Base();
 				TUint8* end = base + gPageSize - 1;
 				*(base + offset) = *(end - offset);
-
-				User::After(0);
-
-				// Check whether main process is still running
-				if (parentStatus != KRequestPending)
-					{
-					// if we get here the test failed and the main process exited without killing
-					// us, so just exit quietly
-					User::WaitForRequest(parentStatus);
-					r = KErrGeneral;
-					goto exit;
-					}
 				}
+			if (++offset >= (gPageSize >> 1))
+				offset = 0;
 			}
-		offset = (offset + 1) % (gPageSize / 2);
 		}
-	while (accessData);
-
-	// Tell parent we've touched each page.
-	r = (TThreadId)session.PublicSendReceive(EClientReadChunks,TIpcArgs());	
-	CLIENT_TEST(r == KErrNone, r);
-		
-	// Wait till we get killed by the main process or the main process dies
-	User::WaitForRequest(parentStatus);
-	// if we get here the test failed and the main process exited without killing us, so just exit
-	r = KErrGeneral;
-
-exit:
-	if (chunks)
-		{
-		for (TInt i = 0 ; i < chunkCount; ++i)
-			chunks[i].Close();
-		}
-	session.Close();
-	parent.Close();
-			
-	return r;
 	}
 
-TInt FreeSwap()
-	{
-	SVMSwapInfo swapInfo;
-	test_KErrNone(UserSvr::HalFunction(EHalGroupVM, EVMHalGetSwapInfo, &swapInfo, 0));
-	return swapInfo.iSwapFree;
-	}
-
-void PrintFreeRam()
-	{
-	test.Printf(_L("%d KB RAM / %d KB swap free\n"), FreeRam() / 1024, FreeSwap() / 1024);
-	}
-
-void CreateChunk(RChunk& aChunk, TInt aChunkIndex, TInt aPageTables, TBool aPaged)
-	{
-	// Creates a global chunk.
-	//
-	// The chunk uses KPageTablesPerChunk page tables by committing that number of pages at 1MB
-	// intervals.  Its max size is set so that it is not a multiple of 1MB and hence the FMM will
-	// use a fine mapping objects whose page tables are not shared between processes.
-	
-	test.Printf(_L("  creating chunk %d: "), aChunkIndex);
-	PrintFreeRam();
-	
-	TChunkCreateInfo createInfo;
-	createInfo.SetDisconnected(0, 0, aPageTables * KSizeMappedByPageTable + gPageSize);
-	createInfo.SetPaging(aPaged ? TChunkCreateInfo::EPaged : TChunkCreateInfo::EUnpaged);
-	TBuf<32> name;
-	name.AppendFormat(_L("t_pagetable_limit chunk %d"), aChunkIndex);
-	createInfo.SetGlobal(name);
-	test_KErrNone(aChunk.Create(createInfo));
-	for (TInt i = 0 ; i < aPageTables ; ++i)
-		test_KErrNone(aChunk.Commit(i * KSizeMappedByPageTable, gPageSize));
-	}
-
-void CreateProcess(RProcess& aProcess, TInt aProcessIndex, TInt aNumChunks, TBool aAccessData)
-	{
-	test.Printf(_L("  creating process %d: "), aProcessIndex);
-	PrintFreeRam();
-	
-	TBuf<80> args;
-	args.AppendFormat(_L("%d %d"), aNumChunks, aAccessData);
-	test_KErrNone(aProcess.Create(KClientProcessName, args));
-	aProcess.SetPriority(EPriorityLow);
-	}
 
 void TestMaxPt()
 	{
-	test.Printf(_L("Waiting for system idle and kernel cleanup\n"));
-	// If this test was run previously, there may be lots of dead processes waiting to be cleaned up
-	TInt r;
-	while((r = FreeRam(10 * 1000)), r == KErrTimedOut)
-		{
-		test.Printf(_L("  waiting: "));
-		PrintFreeRam();
-		}
-
-	// Remove the maximum limit on the cache size as the test requires that it can
-	// allocate as many page tables as possible but without stealing any pages as
-	// stealing pages may indirectly steal paged page table pages.
-	test.Printf(_L("Set paging cache max size unlimited\n"));
-	TUint minCacheSize, maxCacheSize, currentCacheSize;
-	test_KErrNone(DPTest::CacheSize(minCacheSize,maxCacheSize,currentCacheSize));
-	test_KErrNone(DPTest::SetCacheSize(minCacheSize, KMaxTUint));
-
+	// Flexible memory model reserves 0xF800000-0xFFF00000 for page tables
+	// this allows 130,048 pages tables.  Therefore mapping 1000 one 
+	// page chunks into 256 processes would require 256,000 page tables, i.e.
+	// more than enough to hit the limit.  So that the limit is reached in the middle,
+	// map 500 unpaged and 500 paged chunks in each process.
+	const TUint KNumChunks = 1000;
+	const TUint KPagedChunksStart = (KNumChunks >> 1);
+	const TUint KNumProcesses = 256;
 	const TInt KMinFreeRam = (1000 * gPageSize) + (130048 * (gPageSize>>2));
-
-	// Ensure enough RAM available
-	PrintFreeRam();
-	TInt freeRam = FreeRam();
+	TInt freeRam;
+	HAL::Get(HALData::EMemoryRAMFree, freeRam);
 	if (freeRam < KMinFreeRam)
 		{
 		test.Printf(_L("Only 0x%x bytes of free RAM not enough to perform the test.  Skipping test.\n"), freeRam);
 		return;
 		}
 
-	test.Printf(_L("Start server\n"));
+	// Remove the maximum limit on the cache size as the test requires that it can
+	// allocate as many page tables as possible but without stealing any pages as
+	// stealing pages may indirectly steal paged page table pages.
+	TUint minCacheSize, maxCacheSize, currentCacheSize;
+	DPTest::CacheSize(minCacheSize,maxCacheSize,currentCacheSize);
+	test_KErrNone(DPTest::SetCacheSize(minCacheSize, KMaxTUint));
+
 	RServer2 ptServer;
-	r = ptServer.CreateGlobal(KClientPtServerName);
+	TInt r = ptServer.CreateGlobal(KClientPtServerName);
 	test_KErrNone(r);
 
-	test.Printf(_L("Create chunks\n"));
-	const TUint KPagedChunksStart = (KChunksPerProcess >> 1);
-	RChunk* chunks = new RChunk[KChunksPerProcess];
-	test_NotNull(chunks);
+	// Create the global unpaged chunks.  They have one page committed
+	// but have a maximum size large enough to prevent their page tables being
+	// shared between the chunks.  On arm with 4KB pages each page table maps 1MB
+	// so make chunk 1MB+4KB so chunk requires 2 page tables and is not aligned on
+	// a 1MB boundary so it is a fine memory object.
+	const TUint KChunkSize = (1024 * 1024) + gPageSize;
+	RChunk* chunks = new RChunk[KNumChunks];
+	TChunkCreateInfo createInfo;
+	createInfo.SetNormal(gPageSize, KChunkSize);
+	createInfo.SetGlobal(KNullDesC);
+	createInfo.SetPaging(TChunkCreateInfo::EUnpaged);
 	TUint i = 0;
-	for (i = 0 ; i< KChunksPerProcess; i++)
-		CreateChunk(chunks[i], i, KPageTablesPerChunk, i >= KPagedChunksStart);
+	for (; i < KPagedChunksStart; i++)
+		{
+		r = chunks[i].Create(createInfo);
+		test_KErrNone(r);
+		}
+	// Create paged chunks.
+	createInfo.SetPaging(TChunkCreateInfo::EPaged);
+	for (; i< KNumChunks; i++)
+		{
+		r = chunks[i].Create(createInfo);
+		test_KErrNone(r);
+		}
 
 	// Start remote processes, giving each process handles to each chunk.
-	test.Printf(_L("Start remote processes\n"));
 	RProcess* processes = new RProcess[KNumProcesses];
-	test_NotNull(processes);
-	TRequestStatus* statuses = new TRequestStatus[KNumProcesses];
-	test_NotNull(statuses);
-	TUint processIndex = 0;	
+	RMessage2 ptMessage;
+	TUint processIndex = 0;
+	TUint processLimit = 0;
 	for (; processIndex < KNumProcesses; processIndex++)
 		{
 		// Start the process.
-		CreateProcess(processes[processIndex], processIndex, KChunksPerProcess, EFalse);
-		
-		// logon to process
-		processes[processIndex].Logon(statuses[processIndex]);
-		test_Equal(KRequestPending, statuses[processIndex].Int());
+		test.Printf(_L("Creating process %d\n"), processIndex);
+		TBuf<80> args;
+		args.AppendFormat(_L("%d %d"), KNumChunks, EFalse);
+		r = processes[processIndex].Create(KClientProcessName, args);
+		test_KErrNone(r);
+		TRequestStatus s;
+		processes[processIndex].Logon(s);
+		test_Equal(KRequestPending, s.Int());
 		processes[processIndex].Resume();
 
-		// wait for connect message
-		RMessage2 ptMessage;
 		ptServer.Receive(ptMessage);
 		test_Equal(EClientConnect, ptMessage.Function());
 		ptMessage.Complete(KErrNone);
-
-		// pass client a handle to this process
-		ptServer.Receive(ptMessage);
-		test_Equal(EClientGetParentProcess, ptMessage.Function());
-		ptMessage.Complete(RProcess());
-
-		// pass client chunk handles
-		TInt func;
+		TInt func = EClientGetChunk;
 		TUint chunkIndex = 0;
-		for (; chunkIndex < KChunksPerProcess ; chunkIndex++)
+		for (; chunkIndex < KNumChunks && func == EClientGetChunk; chunkIndex++)
 			{// Pass handles to all the unpaged chunks to the new process.
 			ptServer.Receive(ptMessage);
 			func = ptMessage.Function();
-			if (func != EClientGetChunk)
-				break;
-			ptMessage.Complete(chunks[ptMessage.Int0()]);
+			if (func == EClientGetChunk)
+				{
+				TUint index = ptMessage.Int0();
+				ptMessage.Complete(chunks[index]);
+				}
 			}
 		if (func != EClientGetChunk)
 			{
@@ -318,10 +234,9 @@
 			// sending a disconnect message in the process.
 			test_Equal(EClientDisconnect, func);
 			// Should only fail when mapping unpaged chunks.
-			test_Value(chunkIndex, chunkIndex < (KChunksPerProcess >> 1));
+			test_Value(chunkIndex, chunkIndex < (KNumChunks >> 1));
 			break;
 			}
-		
 		// Wait for the process to access all the chunks and therefore 
 		// allocate the paged page tables before moving onto the next process.
 		ptServer.Receive(ptMessage);
@@ -330,44 +245,45 @@
 		ptMessage.Complete(KErrNone);
 
 		// Should have mapped all the required chunks.
-		test_Equal(KChunksPerProcess, chunkIndex);
+		test_Equal(KNumChunks, chunkIndex);
 		}
-	
 	// Should hit page table limit before KNumProcesses have been created.
 	test_Value(processIndex, processIndex < KNumProcesses - 1);
-	TUint processLimit = processIndex;
+	processLimit = processIndex;
 
-	// Now create more processes to access paged data even though the page table address space has
-	// been exhausted.  Limit to 10 more processes as test takes long enough already.
-	test.Printf(_L("Start accessor processes\n"));
+	// Now create more processes to access paged data even though the page table 
+	// address space has been exhausted.  Limit to 10 more processes as test takes 
+	// long enough already.
 	processIndex++;
 	TUint excessProcesses = KNumProcesses - processIndex;
 	TUint pagedIndexEnd = (excessProcesses > 10)? processIndex + 10 : processIndex + excessProcesses;
 	for (; processIndex < pagedIndexEnd; processIndex++)
 		{
-		// start the process.
-		CreateProcess(processes[processIndex], processIndex, KChunksPerProcess-KPagedChunksStart, ETrue);
-
-		// logon to process
-		processes[processIndex].Logon(statuses[processIndex]);
-		test_Equal(KRequestPending, statuses[processIndex].Int());
+		// Start the process.
+		test.Printf(_L("Creating process %d\n"), processIndex);
+		TBuf<80> args;
+		args.AppendFormat(_L("%d %d"), KNumChunks-KPagedChunksStart, ETrue);
+		r = processes[processIndex].Create(KClientProcessName, args);
+		if (r != KErrNone)
+			{// Have hit the limit of processes.
+			processIndex--;
+			// Should have created at least one more process.
+			test_Value(processIndex, processIndex > processLimit);
+			break;
+			}
+		TRequestStatus s;
+		processes[processIndex].Logon(s);
+		test_Equal(KRequestPending, s.Int());
 		processes[processIndex].Resume();
 
-		// wait for connect message
-		RMessage2 ptMessage;
 		ptServer.Receive(ptMessage);
 		test_Equal(EClientConnect, ptMessage.Function());
 		ptMessage.Complete(KErrNone);
 
-		// pass client a handle to this process
-		ptServer.Receive(ptMessage);
-		test_Equal(EClientGetParentProcess, ptMessage.Function());
-		ptMessage.Complete(RProcess());
-		
 		TInt func = EClientGetChunk;
 		TUint chunkIndex = KPagedChunksStart;
-		for (; chunkIndex < KChunksPerProcess && func == EClientGetChunk; chunkIndex++)
-			{// Pass handles to all the paged chunks to the new process.
+		for (; chunkIndex < KNumChunks && func == EClientGetChunk; chunkIndex++)
+			{// Pass handles to all the unpaged chunks to the new process.
 			ptServer.Receive(ptMessage);
 			func = ptMessage.Function();
 			if (func == EClientGetChunk)
@@ -385,36 +301,30 @@
 			}
 
 		// Should have mapped all the required chunks.
-		test_Equal(KChunksPerProcess, chunkIndex);
+		test_Equal(KNumChunks, chunkIndex);
 		}
-	
 	// If we reached the end of then ensure that we kill only the running processes.
 	if (processIndex == pagedIndexEnd)
 		processIndex--;
-
-	// Let the accessor processes run awhile
-	test.Printf(_L("Waiting...\n"));
-	User::After(10 * 1000000);
-	
 	// Kill all the remote processes
-	test.Printf(_L("Killing processes...\n"));
 	for(TInt j = processIndex; j >= 0; j--)
 		{
-		test.Printf(_L("  killing process %d\n"), j);
-		if (statuses[j] == KRequestPending)
+		test.Printf(_L("killing process %d\n"), j);
+		TRequestStatus req;
+		processes[j].Logon(req);
+		if (req == KRequestPending)
+			{
 			processes[j].Kill(KErrNone);
+			User::WaitForRequest(req);
+			}
 		processes[j].Close();
-		User::WaitForRequest(statuses[j]);
 		}
-	delete [] processes;
-	delete [] statuses;
-	
+	delete[] processes;
 	// Close the chunks.
-	for (TUint k = 0; k < KChunksPerProcess; k++)
+	for (TUint k = 0; k < KNumChunks; k++)
 		chunks[k].Close();
 	delete[] chunks;
-
-	// Reset live list size
+	
 	test_KErrNone(DPTest::SetCacheSize(minCacheSize, maxCacheSize));
 	}
 
--- a/kerneltest/e32test/demandpaging/t_printsysinfo.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-// 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:
-// e32test\demandpaging\t_printsysinfo.cpp
-// 
-//
-
-
-#include <e32std.h>
-#include <e32test.h>
-#include <e32cmn.h>
-#include <dptest.h>
-#include "..\mmu\mmudetect.h"
-
-
-RTest test(_L("T_PRINTSYSINFO"));
-
-
-void PrintOutTheKernelVersion()
-{
-	TVersion version = User::Version();	
-	TInt8 major = version.iMajor;
-	TInt8 minor = version.iMinor;
-	TInt16 build = version.iBuild;
-
-	test.Printf(_L("e32 version : %d.%d.%d\n"), major, minor, build);
-}
-
-
-
-void PrintOutTheMemoryModelInUse()
-{	
-	TUint32 memmodtype = MemModelType();
-
-	switch (memmodtype)
-	{
-	case EMemModelTypeDirect:
-		test.Printf(_L("Memory model enabled is :  Direct Memory Model\n"));
-		break;
-	case EMemModelTypeMoving:
-		test.Printf(_L("Memory model enabled is :  Moving Memory Model\n"));
-		break;
-	case EMemModelTypeMultiple:
-		test.Printf(_L("Memory model enabled is :  Multiple Memory Model\n"));
-		break;
-	case EMemModelTypeEmul:
-		test.Printf(_L("Memory model enabled is :  Emulator Memory Model\n"));
-		break;
-	case EMemModelTypeFlexible:
-		test.Printf(_L("Memory model enabled is :  Flexible Memory Model\n"));
-		break;
-	default:
-		test(EFalse);		
-	}
-}
-
-void PrintOutTheEnabledPagingTypes()
-{
-	if (DPTest::Attributes() & DPTest::ERomPaging)
-		test.Printf(_L("Rom paging enabled\n"));
-	if (DPTest::Attributes() & DPTest::ECodePaging)
-		test.Printf(_L("Code paging enabled\n"));
-	if (DPTest::Attributes() & DPTest::EDataPaging)
-		test.Printf(_L("Data paging enabled\n"));
-}
-
-
-//
-// E32Main
-//
-// Main entry point.
-//
-
-TInt E32Main()
-	{
-	test.Title();
-	PrintOutTheKernelVersion();
-	PrintOutTheMemoryModelInUse();
-	PrintOutTheEnabledPagingTypes();
-	return 0;
-	}
-
-
--- a/kerneltest/e32test/demandpaging/t_tbus_datapaging.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/demandpaging/t_tbus_datapaging.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -701,7 +701,6 @@
 		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));
 
--- a/kerneltest/e32test/demandpaging/t_threadcreate.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/demandpaging/t_threadcreate.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -126,7 +126,7 @@
 	SThreadPagedInfo& info = *(SThreadPagedInfo*)aThreadInfo;
 	RHeap& heap = User::Heap();
 	RChunk chunk;
-	chunk.SetHandle(((TestHybridHeap&) heap).ChunkHandle());
+	chunk.SetHandle(heap.ChunkHandle());
 	info.iHeapPaged = chunk.IsPaged();
 	gStackPtr = (TUint8*)&chunk;
 	RDebug::Printf("&chunk %x",&chunk);
--- a/kerneltest/e32test/device/t_commsk.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/device/t_commsk.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -48,6 +48,9 @@
 TCommCapsV01& theCaps1=theCaps1Buf();
 TBool MediaChangeTestingEnabled;
 
+const TInt KWriteSize=250;
+const TInt KXonNumReads=0x10;
+const TInt KXonReadSize=0x400;	// Must be bigger than comm buffer high water==0x300
 
 class TResult
 	{
@@ -72,7 +75,6 @@
 	const TText* iName;
 	};
 
-/*
 const TSpeedAndName KSpeeds[]=
 	{
 	{KCapsBps50,EBps50,_S("50")}, 
@@ -81,7 +83,8 @@
 	{KCapsBps19200,EBps19200,_S("19200")},
 	{KCapsBps57600,EBps57600,_S("57600")},
 	{KCapsBps115200,EBps115200,_S("115200")},
-	};*/
+	};
+
 class TFrameAndName
 	{
 public:
@@ -90,7 +93,7 @@
 	TParity iParity;
 	const TText* iName;
 	};
-/*
+
 const TFrameAndName KFrameTypes[]=
 	{
 	{EData8,EStop1,EParityNone,_S("8,N,1")},
@@ -108,7 +111,7 @@
 	{EData7,EStop1,EParityNone,_S("7,N,1")},
 	{EData7,EStop1,EParityEven,_S("7,E,1")},
 	{EData7,EStop1,EParityOdd,_S("7,O,1")},
-	};*/
+	};
 
 class THandShakeAndName
 	{
--- a/kerneltest/e32test/device/t_dtenot.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/device/t_dtenot.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -25,6 +25,11 @@
 #include <e32uid.h>
 #include <hal.h>
 
+const TInt KUnit0=0;
+const TInt KUnit1=1;
+const TInt KUnit2=2;
+const TInt KUnit3=3;
+
 #if defined (__WINS__)
 #define PDD_NAME _L("ECDRV.PDD")
 #define LDD_NAME _L("ECOMM.LDD")
--- a/kerneltest/e32test/device/t_sirco2.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/device/t_sirco2.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -44,6 +44,7 @@
 
 #define FIND_NAME _L("Comm.*")
 
+const TInt KUnit0=0;
 const TInt KUnit1=1;
 const TInt KUnit2=2;
 
--- a/kerneltest/e32test/device/t_usb.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/device/t_usb.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,15 +18,11 @@
 //
 
 #include "t_usb.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "t_usbTraces.h"
-#endif
 
 
 void RunAppL(TBool aVerboseOutput)
 	{
-	OstTrace0(TRACE_NORMAL, RUNAPPL_RUNAPPL, "RunAppL()");
+	RDebug::Print(_L("RunAppL()"));
 	// Construct the active scheduler
 	CActiveScheduler* myScheduler = new (ELeave) CActiveScheduler();
 
@@ -60,7 +56,7 @@
 
 TInt E32Main()
 	{
-	OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN, "E32Main()");
+	RDebug::Print(_L("E32Main()"));
 
 	CTrapCleanup* cleanup = CTrapCleanup::New();			// get clean-up stack
 
@@ -72,7 +68,7 @@
 	TBool verbose = EFalse;
 	if (c.CompareF(KArg) == 0)
 		{
-		OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP01, "(Verbose output enabled.)\n");
+		RDebug::Print(_L("(Verbose output enabled.)\n"));
 		verbose = ETrue;
 		}
 
@@ -84,7 +80,7 @@
 
 	delete cleanup;											// destroy clean-up stack
 
-	OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP02, "Program exit: done.\n");
+	RDebug::Print(_L("Program exit: done.\n"));
 
 	return 0;												// and return
 	}
--- a/kerneltest/e32test/device/t_usb.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/device/t_usb.h	Wed Sep 01 12:34:56 2010 +0100
@@ -230,36 +230,42 @@
 		do { \
 		iConsole->Printf(_L(string)); \
 		iConsole->Printf(_L("\n")); \
+		RDebug::Print(_L(string)); \
 		} while (0)
 
 #define TUSB_PRINT1(string, a) \
 		do { \
 		iConsole->Printf(_L(string), (a)); \
 		iConsole->Printf(_L("\n")); \
+		RDebug::Print(_L(string), (a)); \
 		} while (0)
 
 #define TUSB_PRINT2(string, a, b) \
 		do { \
 		iConsole->Printf(_L(string), (a), (b)); \
 		iConsole->Printf(_L("\n")); \
+		RDebug::Print(_L(string), (a), (b)); \
 		} while (0)
 
 #define TUSB_PRINT3(string, a, b, c) \
 		do { \
 		iConsole->Printf(_L(string), (a), (b), (c)); \
 		iConsole->Printf(_L("\n")); \
+		RDebug::Print(_L(string), (a), (b), (c)); \
 		} while (0)
 
 #define TUSB_PRINT5(string, a, b, c, d, e) \
 		do { \
 		iConsole->Printf(_L(string), (a), (b), (c), (d), (e)); \
 		iConsole->Printf(_L("\n")); \
+		RDebug::Print(_L(string), (a), (b), (c), (d), (e)); \
 		} while (0)
 
 #define TUSB_PRINT6(string, a, b, c, d, e, f) \
 		do { \
 		iConsole->Printf(_L(string), (a), (b), (c), (d), (e), (f)); \
 		iConsole->Printf(_L("\n")); \
+		RDebug::Print(_L(string), (a), (b), (c), (d), (e), (f)); \
 		} while (0)
 
 #define TUSB_VERBOSE_PRINT(string) \
--- a/kerneltest/e32test/device/t_usbapi.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/device/t_usbapi.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2003-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"
@@ -51,10 +51,6 @@
 #include <d32otgdi.h>
 
 #include "t_usblib.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "t_usbapiTraces.h"
-#endif
 
 
 // --- Local Top Level Variables
@@ -114,10 +110,6 @@
 				(ep_state == EEndpointStateNotStalled) ? _S("Not stalled") :
 				((ep_state == EEndpointStateStalled) ? _S("Stalled") :
 				 _S("Unknown...")));
-	OstTraceExt2(TRACE_NORMAL, QUERYENDPOINTSTATE_QUERYENDPOINTSTATE, "Endpoint %d state: %s\n", aEndpoint,
-				(ep_state == EEndpointStateNotStalled) ? _L("Not stalled") :
-				((ep_state == EEndpointStateStalled) ? _L("Stalled") :
-				 _L("Unknown...")));
 	return ep_state;
 	}
 
@@ -250,7 +242,6 @@
 	if (gSupportsOtg)
 		{
 		test.Printf(_L("Running on OTG device: loading OTG driver\n"));
-		OstTrace0(TRACE_NORMAL, OPENCHANNEL_OPENCHANNEL, "Running on OTG device: loading OTG driver\n");
 		test.Next(_L("Load OTG LDD"));
 		r = User::LoadLogicalDevice(KOtgdiLddFilename);
 		test((r == KErrNone) || (r == KErrAlreadyExists));
@@ -301,8 +292,6 @@
 	TBool res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDMA);
 	test.Printf(_L("DMA on endpoint 1 %s\n"),
 				res ? _S("now allocated") : _S("not allocated"));
-	OstTraceExt1(TRACE_NORMAL, TESTRESOURCEALLOCATIONV1_TESTRESOURCEALLOCATIONV1, "DMA on endpoint 1 %s\n",
-				res ? _L("now allocated") : _L("not allocated"));
 	if (dma == KErrNone)
 		// Only if DMA resource was successfully allocated should we expect truth here:
 		test(res);
@@ -314,8 +303,6 @@
 	res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDoubleBuffering);
 	test.Printf(_L("Double Buffering on endpoint 1 %s\n"),
 				res ? _S("now allocated") : _S("not allocated"));
-	OstTraceExt1(TRACE_NORMAL, TESTRESOURCEALLOCATIONV1_TESTRESOURCEALLOCATIONV1_DUP01, "Double Buffering on endpoint 1 %s\n",
-				res ? _L("now allocated") : _L("not allocated"));
 	if (db == KErrNone)
 		// Only if DB resource was successfully allocated should we expect truth here:
 		test(res);
@@ -332,8 +319,6 @@
 	res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDoubleBuffering);
 	test.Printf(_L("Double Buffering on endpoint 1 %s\n"),
 				res ? _S("still allocated") : _S("not (longer) allocated"));
-	OstTraceExt1(TRACE_NORMAL, TESTRESOURCEALLOCATIONV1_TESTRESOURCEALLOCATIONV1_DUP02, "Double Buffering on endpoint 1 %s\n",
-				res ? _L("still allocated") : _L("not (longer) allocated"));
 
 	test.Next(_L("Deallocate DMA resource"));
 	r = gPort.DeAllocateEndpointResource(EEndpoint1, EUsbcEndpointResourceDMA);
@@ -345,8 +330,6 @@
 	res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDMA);
 	test.Printf(_L("DMA on endpoint 1 %s\n"),
 				res ? _S("still allocated") : _S("not (longer) allocated"));
-	OstTraceExt1(TRACE_NORMAL, TESTRESOURCEALLOCATIONV1_TESTRESOURCEALLOCATIONV1_DUP03, "DMA on endpoint 1 %s\n",
-				res ? _L("still allocated") : _L("not (longer) allocated"));
 
 	test.End();
 	}
@@ -368,43 +351,25 @@
 	gSupportResouceAllocationV2 = (d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2);
 	
 	test.Printf(_L("### USB device capabilities:\n"));
-	OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE, "### USB device capabilities:\n");
 	test.Printf(_L("Number of endpoints:                        %d\n"), n);
-	OstTrace1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP01, "Number of endpoints:                        %d\n", n);
 	test.Printf(_L("Supports Software-Connect:                  %s\n"),
 				d_caps().iConnect ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP02, "Supports Software-Connect:                  %s\n",
-				d_caps().iConnect ? _L("yes") : _L("no"));
 	test.Printf(_L("Device is Self-Powered:                     %s\n"),
 				d_caps().iSelfPowered ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP03, "Device is Self-Powered:                     %s\n",
-				d_caps().iSelfPowered ? _L("yes") : _L("no"));
 	test.Printf(_L("Supports Remote-Wakeup:                     %s\n"),
 				d_caps().iRemoteWakeup ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP04, "Supports Remote-Wakeup:                     %s\n",
-				d_caps().iRemoteWakeup ? _L("yes") : _L("no"));
 	test.Printf(_L("Supports High-speed:                        %s\n"),
 				gSupportsHighSpeed ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP05, "Supports High-speed:                        %s\n",
-				gSupportsHighSpeed ? _L("yes") : _L("no"));
 	test.Printf(_L("Supports OTG:                               %s\n"),
 				gSupportsOtg ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP06, "Supports OTG:                               %s\n",
-				gSupportsOtg ? _L("yes") : _L("no"));
 	test.Printf(_L("Supports unpowered cable detection:         %s\n"),
 				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ?
 				_S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP07, "Supports unpowered cable detection:         %s\n",
-				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ?
-				_L("yes") : _L("no"));
 	test.Printf(_L("Supports endpoint resource alloc scheme V2: %s\n"),
 				gSupportResouceAllocationV2 ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP08, "Supports endpoint resource alloc scheme V2: %s\n",
-				gSupportResouceAllocationV2 ? _L("yes") : _L("no"));
 
 	test(n >= 2);
 	test.Printf(_L("(Device has sufficient endpoints.)\n"));
-	OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP09, "(Device has sufficient endpoints.)\n");
 
 	// Endpoint caps
 	test.Next(_L("Query USB endpoint caps"));
@@ -414,18 +379,14 @@
 	test(r == KErrNone);
 
 	test.Printf(_L("### USB device endpoint capabilities:\n"));
-	OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP10, "### USB device endpoint capabilities:\n");
 	for (TInt i = 0; i < n; i++)
 		{
 		const TUsbcEndpointCaps* caps = &data[i].iCaps;
 		test.Printf(_L("Endpoint: SizeMask = 0x%08x TypeDirMask = 0x%08x\n"),
 					caps->iSizes, caps->iTypesAndDir);
-		OstTraceExt2(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP11, "Endpoint: SizeMask = 0x%08x TypeDirMask = 0x%08x\n",
-					caps->iSizes, caps->iTypesAndDir);
 		if (caps->iHighBandwidth)
 			{
 			test.Printf(_L("  (high-speed, high bandwidth endpoint)\n"));
-			OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP12, "  (high-speed, high bandwidth endpoint)\n");
 			// Must be HS Int or Iso ep
 			test(gSupportsHighSpeed);
 			test(caps->iTypesAndDir & (KUsbEpTypeIsochronous | KUsbEpTypeInterrupt));
@@ -509,7 +470,6 @@
 	if (gSupportsOtg && (r == KErrNotReady))
 		{
 		test.Printf(_L("OTG device but not connected to Host, stopping subtest here.\n"));
-		OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP13, "OTG device but not connected to Host, stopping subtest here.\n");
 		test.End();
 		return;
 		}
@@ -522,10 +482,8 @@
 	test(r == KErrNone);
  	// Suspend thread to let things get stable on the bus.
 	test.Printf(_L("Waiting a short moment..."));
-	OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP14, "Waiting a short moment...");
 	User::After(2000000);
 	test.Printf(_L(" done.\n"));
-	OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP15, " done.\n");
 
 	// Check the speed of the physical connection (if any).
 	gUsingHighSpeed = gPort.CurrentlyUsingHighSpeed();
@@ -533,12 +491,10 @@
 		{
 		test(gSupportsHighSpeed);							// sane?
 		test.Printf(_L("---> USB High-speed Testing\n"));
-		OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP16, "---> USB High-speed Testing\n");
 		}
 	else
 		{
 		test.Printf(_L("---> USB Full-speed Testing\n"));
-		OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP17, "---> USB Full-speed Testing\n");
 		}
 
 	// By pulling down the interface/connection and bringing them up again we
@@ -565,10 +521,8 @@
 
  	// Suspend thread before connecting again.
 	test.Printf(_L("Waiting a short moment..."));
-	OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP18, "Waiting a short moment...");
 	User::After(1000000);
 	test.Printf(_L(" done.\n"));
-	OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP19, " done.\n");
 
 	test.Next(_L("Powering up UDC (2)"));
 	r = gPort.PowerUpUdc();
@@ -583,7 +537,6 @@
 	if (gSupportsOtg && (r == KErrNotReady))
 		{
 		test.Printf(_L("OTG device but not connected to Host, stopping subtest here.\n"));
-		OstTrace0(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP20, "OTG device but not connected to Host, stopping subtest here.\n");
 		test.End();
 		return;
 		}
@@ -600,14 +553,10 @@
 			TBool res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDoubleBuffering);
 			test.Printf(_L("Double Buffering on endpoint 1 %s\n"),
 						res ? _S("now allocated") : _S("not allocated"));
-			OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP21, "Double Buffering on endpoint 1 %s\n",
-						res ? _L("now allocated") : _L("not allocated"));
 
 			res = gPort.QueryEndpointResourceUse(EEndpoint1, EUsbcEndpointResourceDMA);
 			test.Printf(_L("DMA on endpoint 1 %s\n"),
 						res ? _S("still allocated") : _S("not allocated"));										
-			OstTraceExt1(TRACE_NORMAL, SETUPINTERFACE_SETUPINTERFACE_DUP22, "DMA on endpoint 1 %s\n",
-						res ? _L("still allocated") : _L("not allocated"));										
 		}
 		
 	test.End();
@@ -670,7 +619,6 @@
 	if (!gSupportsHighSpeed)
 		{
 		test.Printf(_L("*** Not supported - skipping Device_Qualifier descriptor tests\n"));
-		OstTrace0(TRACE_NORMAL, TESTDEVICEQUALIFIERDESCRIPTOR_TESTDEVICEQUALIFIERDESCRIPTOR, "*** Not supported - skipping Device_Qualifier descriptor tests\n");
 		test.End();
 		return;
 		}
@@ -752,7 +700,6 @@
 	if (!gSupportsHighSpeed)
 		{
 		test.Printf(_L("*** Not supported - skipping Other_Speed_Configuration desc tests\n"));
-		OstTrace0(TRACE_NORMAL, TESTOTHERSPEEDCONFIGURATIONDESCRIPTOR_TESTOTHERSPEEDCONFIGURATIONDESCRIPTOR, "*** Not supported - skipping Other_Speed_Configuration desc tests\n");
 		test.End();
 		return;
 		}
@@ -890,7 +837,6 @@
 	if (!SupportsAlternateInterfaces())
 		{
 		test.Printf(_L("*** Not supported - skipping alternate interface settings tests\n"));
-		OstTrace0(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION, "*** Not supported - skipping alternate interface settings tests\n");
 		test.End();
 		return;
 		}
@@ -936,7 +882,6 @@
 			ifc().iEndpointData[ep_found].iInterval = 0x01;	// 2^(bInterval-1)ms, bInterval must be [1..16]
 			ifc().iEndpointData[ep_found].iInterval_Hs = 0x01; // same as for FS
 			test.Printf(_L("ISO  IN  size = %4d (ep %d)\n"), mps, ep_found + 1);
-			OstTraceExt2(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP01, "ISO  IN  size = %4d (ep %d)\n", mps, ep_found + 1);
 			foundIsoIN = ETrue;
 			if (++ep_found == 3)
 				break;
@@ -951,7 +896,6 @@
 			ifc().iEndpointData[ep_found].iSize = mps;
 			ifc().iEndpointData[ep_found].iInterval = 0x01;	// 2^(bInterval-1)ms, bInterval must be [1..16]
 			test.Printf(_L("ISO  OUT size = %4d (ep %d)\n"), mps, ep_found + 1);
-			OstTraceExt2(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP02, "ISO  OUT size = %4d (ep %d)\n", mps, ep_found + 1);
 			foundIsoOUT = ETrue;
 			if (++ep_found == 3)
 				break;
@@ -968,7 +912,6 @@
 			ifc().iEndpointData[ep_found].iInterval_Hs = 4;	// interval = 2^(bInterval-1)ms = 8ms
 			ifc().iEndpointData[ep_found].iExtra    = 2;	// 2 extra bytes for Audio Class EP descriptor
 			test.Printf(_L("INT  IN  size = %4d (ep %d)\n"), mps, ep_found + 1);
-			OstTraceExt2(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP03, "INT  IN  size = %4d (ep %d)\n", mps, ep_found + 1);
 			foundIntIN = ETrue;
 			INT_IN_ep = ep_found + 1;
 			if (++ep_found == 3)
@@ -989,7 +932,6 @@
 			if (gUsingHighSpeed)
 				{
 				test.Printf(_L("Checking if correct Bulk packet size is reported in HS case\n"));
-				OstTrace0(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP04, "Checking if correct Bulk packet size is reported in HS case\n");
 				test(mps == KUsbEpSize512);					// sane?
 				}
 			// The PSL should in any case also offer the 'legacy' FS size:
@@ -997,19 +939,15 @@
 			ifc().iEndpointData[ep_found].iSize = mps;
 			test.Printf(_L("BULK %s size = %4d (ep %d)\n"),
 						dir == KUsbEpDirIn ? _S("IN ") : _S("OUT"), mps, ep_found + 1);
-			OstTraceExt3(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP05, "BULK %S size = %4d (ep %d)\n",
-						dir == KUsbEpDirIn ? _L("IN ") : _L("OUT"), mps, ep_found + 1);
 			if (++ep_found == 5)
 				break;
 			}
 		}
 
 	test.Printf(_L("Total: %d endpoints found for the alt. ifc setting\n"), ep_found);
-	OstTrace1(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP06, "Total: %d endpoints found for the alt. ifc setting\n", ep_found);
 	if (ep_found < 3)
 		{
 		test.Printf(_L("(3 endpoints are at least required. Skipping test...)\n"));
-		OstTrace0(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP07, "(3 endpoints are at least required. Skipping test...)\n");
 		test.End();
 		return;
 		}
@@ -1017,15 +955,12 @@
 	if (!foundIsoIN && !foundIsoOUT)
 		{
 		test.Printf(_L("(No Isochronous endpoints found)\n"));
-		OstTrace0(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP08, "(No Isochronous endpoints found)\n");
 		}
 
 	if (!foundIntIN)
 		{
 		test.Printf(_L("(No Interrupt endpoint found)\n"));
-		OstTrace0(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP09, "(No Interrupt endpoint found)\n");
 		test.Printf(_L("Adjusting endpoint size for later test\n"));
-		OstTrace0(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP10, "Adjusting endpoint size for later test\n");
 		// We want to make sure that at least one descriptor has the 2 extra bytes.
 		// It doesn't matter that this ep could be a Bulk one, or that the 2 Iso ep's might be missing -
 		// we just want to test some functionality and we're not going to use this interface in earnest.
@@ -1129,7 +1064,6 @@
 	const TUint16 ep_size = EpSize(descriptor[KEpDesc_PacketSizeOffset],
 								   descriptor[KEpDesc_PacketSizeOffset+1]);
 	test.Printf(_L(" Size: %d\n"), ep_size);
-	OstTrace1(TRACE_NORMAL, TESTENDPOINTDESCRIPTOR_TESTENDPOINTDESCRIPTOR, " Size: %d\n", ep_size);
 	if (gUsingHighSpeed)
 		{
 		// HS Bulk ep can only have one possible packet size.
@@ -1152,7 +1086,6 @@
 	if (!SupportsAlternateInterfaces())
 		{
 		test.Printf(_L("*** Not supported - skipping Extended Endpoint descriptor tests\n"));
-		OstTrace0(TRACE_NORMAL, TESTEXTENDEDENDPOINTDESCRIPTOR_TESTEXTENDEDENDPOINTDESCRIPTOR, "*** Not supported - skipping Extended Endpoint descriptor tests\n");
 		test.End();
 		return;
 		}
@@ -1220,7 +1153,6 @@
 	TInt r = gPort.GetStringDescriptorLangId(rd_langid_orig);
 	test(r == KErrNone);
 	test.Printf(_L("Original LANGID code: 0x%04X\n"), rd_langid_orig);
-	OstTrace1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS, "Original LANGID code: 0x%04X\n", rd_langid_orig);
 
 	test.Next(_L("SetStringDescriptorLangId()"));
 	TUint16 wr_langid = 0x0809;								// English (UK) Language ID
@@ -1234,7 +1166,6 @@
 	r = gPort.GetStringDescriptorLangId(rd_langid);
 	test(r == KErrNone);
 	test.Printf(_L("New LANGID code: 0x%04X\n"), rd_langid);
-	OstTrace1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP01, "New LANGID code: 0x%04X\n", rd_langid);
 
 	test.Next(_L("Compare LANGID codes"));
 	test(rd_langid == wr_langid);
@@ -1258,13 +1189,11 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Original Manufacturer string: \"%lS\"\n"), &rd_str_orig);
-		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP02, "Original Manufacturer string: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
 		{
 		test.Printf(_L("No Manufacturer string set\n"));
-		OstTrace0(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP03, "No Manufacturer string set\n");
 		restore_string = EFalse;
 		}
 
@@ -1279,7 +1208,6 @@
 	r = gPort.GetManufacturerStringDescriptor(rd_str);
 	test(r == KErrNone);
 	test.Printf(_L("New Manufacturer string: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP04, "New Manufacturer string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Manufacturer strings"));
 	r = rd_str.Compare(wr_str);
@@ -1297,7 +1225,6 @@
 	r = gPort.GetManufacturerStringDescriptor(rd_str);
 	test(r == KErrNone);
 	test.Printf(_L("New Manufacturer string: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP05, "New Manufacturer string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Manufacturer strings"));
 	r = rd_str.Compare(wr_str);
@@ -1331,7 +1258,6 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Old Product string: \"%lS\"\n"), &rd_str_orig);
-		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP06, "Old Product string: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
@@ -1349,7 +1275,6 @@
 	r = gPort.GetProductStringDescriptor(rd_str);
 	test(r == KErrNone);
 	test.Printf(_L("New Product string: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP07, "New Product string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Product strings"));
 	r = rd_str.Compare(wr_str);
@@ -1367,7 +1292,6 @@
 	r = gPort.GetProductStringDescriptor(rd_str);
 	test(r == KErrNone);
 	test.Printf(_L("New Product string: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP08, "New Product string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Product strings"));
 	r = rd_str.Compare(wr_str);
@@ -1401,7 +1325,6 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Old Serial Number: \"%lS\"\n"), &rd_str_orig);
-		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP09, "Old Serial Number: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
@@ -1419,7 +1342,6 @@
 	r = gPort.GetSerialNumberStringDescriptor(rd_str);
 	test(r == KErrNone);
 	test.Printf(_L("New Serial Number: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP10, "New Serial Number: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Serial Number strings"));
 	r = rd_str.Compare(wr_str);
@@ -1437,7 +1359,6 @@
 	r = gPort.GetSerialNumberStringDescriptor(rd_str);
 	test(r == KErrNone);
 	test.Printf(_L("New Serial Number: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP11, "New Serial Number: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Serial Number strings"));
 	r = rd_str.Compare(wr_str);
@@ -1471,7 +1392,6 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Old Configuration string: \"%lS\"\n"), &rd_str_orig);
-		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP12, "Old Configuration string: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
@@ -1489,7 +1409,6 @@
 	r = gPort.GetConfigurationStringDescriptor(rd_str);
 	test(r == KErrNone);
 	test.Printf(_L("New Configuration string: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP13, "New Configuration string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Configuration strings"));
 	r = rd_str.Compare(wr_str);
@@ -1507,7 +1426,6 @@
 	r = gPort.GetConfigurationStringDescriptor(rd_str);
 	test(r == KErrNone);
 	test.Printf(_L("New Configuration string: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP14, "New Configuration string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Configuration strings"));
 	r = rd_str.Compare(wr_str);
@@ -1571,7 +1489,6 @@
 	r = gPort.GetStringDescriptor(stridx1, rd_str);
 	test(r == KErrNone);
 	test.Printf(_L("New test string @ idx %d: \"%lS\"\n"), stridx1, &rd_str);
-	OstTraceExt2(TRACE_NORMAL, TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS, "New test string @ idx %d: \"%lS\"\n", stridx1, rd_str);
 
 	test.Next(_L("Compare test strings 1"));
 	r = rd_str.Compare(wr_str);
@@ -1610,7 +1527,6 @@
 	r = gPort.GetStringDescriptor(stridx2, rd_str);
 	test(r == KErrNone);
 	test.Printf(_L("New test string @ idx %d: \"%lS\"\n"), stridx2, &rd_str);
-	OstTraceExt2(TRACE_NORMAL, TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS_DUP01, "New test string @ idx %d: \"%lS\"\n", stridx2, rd_str);
 
 	test.Next(_L("Compare test strings 2"));
 	r = rd_str.Compare(wr_str);
@@ -1634,7 +1550,6 @@
 	r = gPort.GetStringDescriptor(stridx3, rd_str);
 	test(r == KErrNone);
 	test.Printf(_L("New test string @ idx %d: \"%lS\"\n"), stridx3, &rd_str);
-	OstTraceExt2(TRACE_NORMAL, TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS_DUP02, "New test string @ idx %d: \"%lS\"\n", stridx3, rd_str);
 
 	test.Next(_L("Compare test strings 3"));
 	r = rd_str.Compare(wr_str);
@@ -1753,14 +1668,11 @@
 		TBool a_AltHnpSupport = (features & KUsbOtgAttr_A_AltHnpSupport) ? ETrue : EFalse;
 		test.Printf(_L("### OTG Features:\nB_HnpEnable(%d)\nA_HnpSupport(%d)\nA_Alt_HnpSupport(%d)\n"),
 					b_HnpEnable, a_HnpSupport, a_AltHnpSupport);
-		OstTraceExt3(TRACE_NORMAL, TESTOTGEXTENSIONS_TESTOTGEXTENSIONS, "### OTG Features:\nB_HnpEnable(%d)\nA_HnpSupport(%d)\nA_Alt_HnpSupport(%d)\n",
-					b_HnpEnable, a_HnpSupport, a_AltHnpSupport);
 		}
 	else
 		{
 		test(r == KErrNotSupported);
 		test.Printf(_L("GetOtgFeatures() not supported\n"));
-		OstTrace0(TRACE_NORMAL, TESTOTGEXTENSIONS_TESTOTGEXTENSIONS_DUP01, "GetOtgFeatures() not supported\n");
 		}
 
 	test.End();
@@ -1812,12 +1724,10 @@
 			if (good)
 				{
 				test.Printf(_L("Ep0 supports %d bytes MaxPacketSize\n"), mpsize);
-				OstTrace1(TRACE_NORMAL, TESTENDPOINT0MAXPACKETSIZES_TESTENDPOINT0MAXPACKETSIZES, "Ep0 supports %d bytes MaxPacketSize\n", mpsize);
 				}
 			else
 				{
 				test.Printf(_L("Bad Ep0 size: 0x%08x, failure will occur\n"), bit);
-				OstTrace1(TRACE_NORMAL, TESTENDPOINT0MAXPACKETSIZES_TESTENDPOINT0MAXPACKETSIZES_DUP01, "Bad Ep0 size: 0x%08x, failure will occur\n", bit);
 				r = KErrGeneral;
 				}
 			}
@@ -1861,7 +1771,6 @@
 		{
 		TUint setting = (deviceState & ~KUsbAlternateSetting);
 		test.Printf(_L("Alternate setting change to setting %d - unexpected"), setting);
-		OstTrace1(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY, "Alternate setting change to setting %d - unexpected", setting);
 		test(EFalse);
 		}
 	else
@@ -1870,40 +1779,31 @@
 			{
 		case EUsbcDeviceStateUndefined:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Undefined state\n"));
-			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP01, "TestAlternateDeviceStatusNotify: Undefined state\n");
 			break;
 		case EUsbcDeviceStateAttached:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Attached state\n"));
-			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP02, "TestAlternateDeviceStatusNotify: Attached state\n");
 			break;
 		case EUsbcDeviceStatePowered:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Powered state\n"));
-			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP03, "TestAlternateDeviceStatusNotify: Powered state\n");
 			break;
 		case EUsbcDeviceStateDefault:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Default state\n"));
-			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP04, "TestAlternateDeviceStatusNotify: Default state\n");
 			break;
 		case EUsbcDeviceStateAddress:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Address state\n"));
-			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP05, "TestAlternateDeviceStatusNotify: Address state\n");
 			break;
 		case EUsbcDeviceStateConfigured:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Configured state\n"));
-			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP06, "TestAlternateDeviceStatusNotify: Configured state\n");
 			break;
 		case EUsbcDeviceStateSuspended:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Suspended state\n"));
-			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP07, "TestAlternateDeviceStatusNotify: Suspended state\n");
 			break;
 		case EUsbcNoState:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: State buffering error\n"));
-			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP08, "TestAlternateDeviceStatusNotify: State buffering error\n");
 			test(EFalse);
 			break;
 		default:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Unknown state\n"));
-			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP09, "TestAlternateDeviceStatusNotify: Unknown state\n");
 			test(EFalse);
 			}
 		}
@@ -1934,12 +1834,10 @@
 		if ((epStateBitmap & (1 << i)) == EEndpointStateNotStalled)
 			{
 			test.Printf(_L("EndpointStatusNotify: Ep %d NOT STALLED\n"), i);
-			OstTrace1(TRACE_NORMAL, TESTENDPOINTSTATUSNOTIFY_TESTENDPOINTSTATUSNOTIFY, "EndpointStatusNotify: Ep %d NOT STALLED\n", i);
 			}
 		else
 			{
 			test.Printf(_L("EndpointStatusNotify: Ep %d STALLED\n"), i);
-			OstTrace1(TRACE_NORMAL, TESTENDPOINTSTATUSNOTIFY_TESTENDPOINTSTATUSNOTIFY_DUP01, "EndpointStatusNotify: Ep %d STALLED\n", i);
 			}
 		}
 
@@ -1968,9 +1866,7 @@
 	if( EUsbcDeviceStateUndefined==devstate )
 		{
 		test.Printf( _L("Device not connected, state EUsbcDeviceStateUndefined.\n")  );
-		OstTrace0(TRACE_NORMAL, TESTENDPOINTSTALLSTATUS_TESTENDPOINTSTALLSTATUS, "Device not connected, state EUsbcDeviceStateUndefined.\n");
 		test.Printf( _L("Skipping endpoint stall status tests.\n") );
-		OstTrace0(TRACE_NORMAL, TESTENDPOINTSTALLSTATUS_TESTENDPOINTSTALLSTATUS_DUP01, "Skipping endpoint stall status tests.\n");
 		test.End();
 		return;
 		}
@@ -1979,7 +1875,6 @@
 	if (!SupportsEndpointStall())
 		{
 		test.Printf(_L("*** Not supported - skipping endpoint stall status tests\n"));
-		OstTrace0(TRACE_NORMAL, TESTENDPOINTSTALLSTATUS_TESTENDPOINTSTALLSTATUS_DUP02, "*** Not supported - skipping endpoint stall status tests\n");
 		test.End();
 		return;
 		}
@@ -2065,7 +1960,6 @@
 			{
 			step = KEpilogue;
 			test.Printf(_L("*** Test platform does not support USB - skipping all tests\n"));
-			OstTrace0(TRACE_NORMAL, RUNTESTS_RUNTESTS, "*** Test platform does not support USB - skipping all tests\n");
 			}
 		return ETrue;
 	case KMain:
@@ -2091,7 +1985,6 @@
 		return ETrue;
 	case KEpilogue:
 		test.Printf(_L("USBAPI tests were run %.0f time(s)\n"), loops);
-		OstTraceExt1(TRACE_NORMAL, RUNTESTS_RUNTESTS_DUP01, "USBAPI tests were run %.0f time(s)\n", loops);
 		// outermost test end
 		test.End();
 		CActiveScheduler::Stop();
--- a/kerneltest/e32test/device/t_usbco2.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/device/t_usbco2.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -23,10 +23,6 @@
 
 #include "t_usb.h"											// CActiveConsole, CActiveRW
 #include "t_usblib.h"										// Helpers
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "t_usbco2Traces.h"
-#endif
 
 
 _LIT(KUsbLddFilename, "eusbc");								// .ldd assumed - it's a filename
@@ -95,36 +91,30 @@
 	if (r != KErrNone && r != KErrAlreadyExists)
 		{
 		TUSB_PRINT1("Error %d on loading USB LDD", r);
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL, "Error %d on loading USB LDD", r);
 		User::Leave(-1);
 		return;
 		}
 	TUSB_PRINT("Successfully loaded USB LDD");
-	OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL_DUP01, "Successfully loaded USB LDD");
 
 	// Open USB channel
 	r = iPort.Open(0);
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Error %d on opening USB port", r);
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL_DUP02, "Error %d on opening USB port", r);
 		User::Leave(-1);
 		return;
 		}
 	TUSB_PRINT("Successfully opened USB port");
-	OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL_DUP03, "Successfully opened USB port");
 
 	// Create Reader/Writer active object
 	iRW = CActiveRW::NewL(iConsole, &iPort, iVerbose);
 	if (!iRW)
 		{
 		TUSB_PRINT("Failed to create reader/writer");
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL_DUP04, "Failed to create reader/writer");
 		User::Leave(-1);
 		return;
 		}
 	TUSB_PRINT("Created reader/writer");
-	OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL_DUP05, "Created reader/writer");
 	
 	// check for endpoint resource allocation v2 support
 	TUsbDeviceCaps d_caps;
@@ -132,7 +122,6 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Error %d on querying device capabilities", r);
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL_DUP06, "Error %d on querying device capabilities", r);
 		User::Leave(-1);
 		return;
 		}
@@ -144,7 +133,6 @@
 	if (!(r == KErrNotSupported || r == KErrNone))
 		{
 		TUSB_PRINT1("Error %d while fetching OTG descriptor", r);
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL_DUP07, "Error %d while fetching OTG descriptor", r);
 		User::Leave(-1);
 		return;
 		}
@@ -155,12 +143,10 @@
 	if (iOtg)
 		{
 		TUSB_PRINT("Running on OTG device: loading OTG driver");
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL_DUP08, "Running on OTG device: loading OTG driver");
 		r = User::LoadLogicalDevice(KOtgdiLddFilename);
 		if (r != KErrNone)
 			{
 			TUSB_PRINT1("Error %d on loading OTG LDD", r);
-			OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL_DUP09, "Error %d on loading OTG LDD", r);
 			User::Leave(-1);
 			return;
 			}
@@ -168,7 +154,6 @@
 		if (r != KErrNone)
 			{
 			TUSB_PRINT1("Error %d on opening OTG port", r);
-			OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL_DUP10, "Error %d on opening OTG port", r);
 			User::Leave(-1);
 			return;
 			}
@@ -176,7 +161,6 @@
 		if (r != KErrNone)
 			{
 			TUSB_PRINT1("Error %d on starting USB stack", r);
-			OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_CONSTRUCTL_DUP11, "Error %d on starting USB stack", r);
 			User::Leave(-1);
 			return;
 			}
@@ -191,18 +175,15 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Interface setup failed", r);
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_SETUPINTERFACE, "Interface setup failed:%d", r);
 		return r;
 		}
 	TUSB_PRINT("Interface successfully set up");
-	OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_SETUPINTERFACE_DUP01, "Interface successfully set up");
 
 	// Change some descriptors to contain suitable values
 	r = SetupDescriptors();
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Descriptor setup failed", r);
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_SETUPINTERFACE_DUP02, "Descriptor setup failed:%d ", r);
 		return r;
 		}
 
@@ -211,7 +192,6 @@
 	if (!iDeviceStateNotifier)
 		{
 		TUSB_PRINT("Failed to create device state notifier");
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_SETUPINTERFACE_DUP03, "Failed to create device state notifier");
 		return r;
 		}
 	iDeviceStateNotifier->Activate();
@@ -221,7 +201,6 @@
 	if (!iStallNotifier)
 		{
 		TUSB_PRINT("Failed to create stall notifier");
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_SETUPINTERFACE_DUP04, "Failed to create stall notifier");
 		return r;
 		}
 	iStallNotifier->Activate();
@@ -233,10 +212,6 @@
 CActiveConsole::~CActiveConsole()
 	{
 	TUSB_VERBOSE_PRINT("CActiveConsole::~CActiveConsole()");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVECONSOLE_DCACTIVECONSOLE, "CActiveConsole::~CActiveConsole()");
-	    }
 	Cancel();												// base class cancel -> calls our DoCancel
 	delete iRW;												// destroy the reader/writer
 	delete iDeviceStateNotifier;
@@ -245,25 +220,21 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Error %d on string removal", r);
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_DCACTIVECONSOLE_DUP01, "Error %d on string removal", r);
 		}
 	r = iPort.RemoveStringDescriptor(stridx2);
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Error %d on string removal", r);
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_DCACTIVECONSOLE_DUP02, "Error %d on string removal", r);
 		}
 	if (iOtg)
 		{
 		TUSB_PRINT("Running on OTG device: unloading OTG driver");
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_DCACTIVECONSOLE_DUP03, "Running on OTG device: unloading OTG driver");
 		iOtgPort.StopStacks();
 		iOtgPort.Close();
 		r = User::FreeLogicalDevice(RUsbOtgDriver::Name());
 		if (r != KErrNone)
 			{
 			TUSB_PRINT1("Error %d on freeing OTG LDD", r);
-			OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_DCACTIVECONSOLE_DUP04, "Error %d on freeing OTG LDD", r);
 			}
 		}
 	iPort.Close();											// close USB channel
@@ -271,22 +242,16 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Error %d during unloading USB LDD", r);
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_DCACTIVECONSOLE_DUP05, "Error %d during unloading USB LDD", r);
 		User::Leave(-1);
 		return;
 		}
 	TUSB_PRINT("Successfully unloaded USB LDD");	
-	OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_DCACTIVECONSOLE_DUP06, "Successfully unloaded USB LDD");	
 	}
 
 
 void CActiveConsole::DoCancel()
 	{
 	TUSB_VERBOSE_PRINT("CActiveConsole::DoCancel()");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVECONSOLE_DOCANCEL, "CActiveConsole::DoCancel()");
-	    }
 	iConsole->ReadCancel();
 	}
 
@@ -294,10 +259,6 @@
 void CActiveConsole::RunL()
 	{
 	TUSB_VERBOSE_PRINT("CActiveConsole::RunL()");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVECONSOLE_RUNL, "CActiveConsole::RunL()");
-	    }
 	ProcessKeyPressL(static_cast<TChar>(iConsole->KeyCode()));
 	}
 
@@ -309,87 +270,53 @@
 	if (!iBufferSizeChosen)
 		{
 		iConsole->Printf(_L("\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER, "\n");
 		iConsole->Printf(_L("++++ Choose max. Transfer Size ++++\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP01, "++++ Choose max. Transfer Size ++++\n");
 		iConsole->Printf(_L("  '0' - Set up USB device for USBCV\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP02, "  '0' - Set up USB device for USBCV\n");
 		iConsole->Printf(_L("  '1' -   32 bytes\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP03, "  '1' -   32 bytes\n");
 		iConsole->Printf(_L("  '2' - 1024 bytes\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP04, "  '2' - 1024 bytes\n");
 		iConsole->Printf(_L("  '3' -   64 kbytes\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP05, "  '3' -   64 kbytes\n");
 		iConsole->Printf(_L("  '4' -    1 Mbyte\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP06, "  '4' -    1 Mbyte\n");
 		}
 	else if (!iBandwidthPriorityChosen)
 		{
 		iConsole->Printf(_L("\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP07, "\n");
 		iConsole->Printf(_L("++++ Choose Bandwidth Priority ++++\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP08, "++++ Choose Bandwidth Priority ++++\n");
 		iConsole->Printf(_L("  '1' - Economical buffering - default\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP09, "  '1' - Economical buffering - default\n");
 		iConsole->Printf(_L("  '2' - More memory than default buffering - Plus1\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP10, "  '2' - More memory than default buffering - Plus1\n");
 		iConsole->Printf(_L("  '3' - More memory than Plus1 buffering - Plus2\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP11, "  '3' - More memory than Plus1 buffering - Plus2\n");
 		iConsole->Printf(_L("  '4' - Maximum buffering\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP12, "  '4' - Maximum buffering\n");
 		}
 	else if (!iDMAChosen)
 		{
 		iConsole->Printf(_L("\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP13, "\n");
 		iConsole->Printf(_L("++++ Choose Endpoint I/O Transfer Mode ++++\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP14, "++++ Choose Endpoint I/O Transfer Mode ++++\n");
 		iConsole->Printf(_L("  '1' - Interrupt Mode\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP15, "  '1' - Interrupt Mode\n");
 		iConsole->Printf(_L("  '2' - DMA Mode (recommended)\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP16, "  '2' - DMA Mode (recommended\n");
 		}
 	else if (!iDoubleBufferingChosen)
 		{
 		iConsole->Printf(_L("\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP17, "\n");
 		iConsole->Printf(_L("++++ Choose Endpoint FIFO Mode ++++\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP18, "++++ Choose Endpoint FIFO Mode ++++\n");
 		iConsole->Printf(_L("  '1' - Normal Buffering Mode\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP19, "  '1' - Normal Buffering Mode\n");
 		iConsole->Printf(_L("  '2' - Double Buffering Mode (recommended)\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP20, "  '2' - Double Buffering Mode (recommended\n");
 		}
 	else
 		{
 		iConsole->Printf(_L("\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP21, "\n");
 		iConsole->Printf(_L("++++ Select Program Option ++++\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP22, "++++ Select Program Option ++++\n");
 		iConsole->Printf(_L("  'L'oop test\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP23, "  'L'oop test\n");
 		iConsole->Printf(_L("   Loop test with data 'C'ompare\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP24, "   Loop test with data 'C'ompare\n");
 		iConsole->Printf(_L("  'R'eceive-only test (we receive, host transmits)\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP25, "  'R'eceive-only test (we receive, host transmits\n");
 		iConsole->Printf(_L("  'T'ransmit-only test\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP26, "  'T'ransmit-only test\n");
 		iConsole->Printf(_L("   Receive and 'P'ut (write) to File\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP27, "   Receive and 'P'ut (writeto File\n");
 		iConsole->Printf(_L("   Transmit and 'G'et (read) from File\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP28, "   Transmit and 'G'et (readfrom File\n");
 		iConsole->Printf(_L("   Signal Remote-'W'akeup to the host\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP29, "   Signal Remote-'W'akeup to the host\n");
 		iConsole->Printf(_L("  'S'top current transfer\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP30, "  'S'top current transfer\n");
 #ifdef WITH_DUMP_OPTION
 		iConsole->Printf(_L("  'D'ump USB regs to debugout\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP31, "  'D'ump USB regs to debugout\n");
 #endif
 		iConsole->Printf(_L("   Re'E'numerate device\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP32, "   Re'E'numerate device\n");
 		iConsole->Printf(_L("  'Q'uit this app\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REQUESTCHARACTER_DUP33, "  'Q'uit this app\n");
 		}
 	iConsole->Read(iStatus);
 	SetActive();
@@ -400,7 +327,7 @@
 	{
 	if (aChar == EKeyEscape)
 		{
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL, "CActiveConsole: ESC key pressed -> stopping active scheduler...");
+		RDebug::Print(_L("CActiveConsole: ESC key pressed -> stopping active scheduler..."));
 		CActiveScheduler::Stop();
 		return;
 		}
@@ -428,11 +355,9 @@
 			break;
 		default:
 			TUSB_PRINT1("Not a valid input character: %c", aChar.operator TUint());
-			OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP01, "Not a valid input character: %c", aChar.operator TUint());
 			goto request_char;
 			}
 		TUSB_PRINT1("Maximum buffer size set to %d bytes", iRW->MaxBufSize());
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP02, "Maximum buffer size set to %d bytes", iRW->MaxBufSize());
 		iBufferSizeChosen = ETrue;
 		}
 	else if (!iBandwidthPriorityChosen)
@@ -443,41 +368,33 @@
 		case '1':
 			iBandwidthPriority = EUsbcBandwidthOUTDefault | EUsbcBandwidthINDefault;
 			TUSB_PRINT("Bandwith priority set to default");
-			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP03, "Bandwith priority set to default");
 			break;
 		case '2':
 			iBandwidthPriority = EUsbcBandwidthOUTPlus1 | EUsbcBandwidthINPlus1;
 			TUSB_PRINT("Bandwith priority set to Plus1");
-			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP04, "Bandwith priority set to Plus1");
 			break;
 		case '3':
 			iBandwidthPriority = EUsbcBandwidthOUTPlus2 | EUsbcBandwidthINPlus2;
 			TUSB_PRINT("Bandwith priority set to Plus2");
-			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP05, "Bandwith priority set to Plus2");
 			break;
 		case '4':
 			iBandwidthPriority = EUsbcBandwidthINMaximum | EUsbcBandwidthOUTMaximum;
 			TUSB_PRINT("Bandwith priority set to maximum");
-			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP06, "Bandwith priority set to maximum");
 			break;
 		default:
 			TUSB_PRINT1("Not a valid input character: %c", aChar.operator TUint());
-			OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP07, "Not a valid input character: %c", aChar.operator TUint());
 			goto request_char;
 			}
 		TUSB_PRINT1("(Set to 0x%08X)", iBandwidthPriority);
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP08, "(Set to 0x%08X)", iBandwidthPriority);
 		iBandwidthPriorityChosen = ETrue;
 		
 		if (!iResourceAllocationV2)
 			{
 			TUSB_PRINT("Configuring interface...");
-			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP09, "Configuring interface...");
 			TInt r = SetupInterface();
 			if (r != KErrNone)
 				{
 				TUSB_PRINT1("Error: %d. Stopping active scheduler...", r);
-				OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP10, "Error: %d. Stopping active scheduler...", r);
 				CActiveScheduler::Stop();
 				return;
 				}
@@ -491,7 +408,6 @@
 		case '1':
 			{
 			TUSB_PRINT("- Trying to deallocate endpoint DMA:\n");
-			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP11, "- Trying to deallocate endpoint DMA:\n");
 			if (!iResourceAllocationV2)
 				{
 				DeAllocateEndpointDMA(EEndpoint1);
@@ -503,7 +419,6 @@
 		case '2':
 			{
 			TUSB_PRINT("- Trying to allocate endpoint DMA:\n");
-			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP12, "- Trying to allocate endpoint DMA:\n");
 			if (!iResourceAllocationV2)
 				{
 				AllocateEndpointDMA(EEndpoint1);
@@ -514,7 +429,6 @@
 			}
 		default:
 			TUSB_PRINT1("Not a valid input character: %c", aChar.operator TUint());
-			OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP13, "Not a valid input character: %c", aChar.operator TUint());
 			goto request_char;
 			}
 		iDMAChosen = ETrue;
@@ -527,7 +441,6 @@
 		case '1':
 			{
 			TUSB_PRINT("- Trying to deallocate Double Buffering:\n");
-			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP14, "- Trying to deallocate Double Buffering:\n");
 			if (!iResourceAllocationV2)
 				{
 				DeAllocateDoubleBuffering(EEndpoint1);
@@ -539,7 +452,6 @@
 		case '2':
 			{
 			TUSB_PRINT("- Trying to allocate Double Buffering:\n");
-			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP15, "- Trying to allocate Double Buffering:\n");
 			if (!iResourceAllocationV2)
 				{
 				AllocateDoubleBuffering(EEndpoint1);
@@ -550,7 +462,6 @@
 			}
 		default:
 			TUSB_PRINT1("Not a valid input character: %c", aChar.operator TUint());
-			OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP16, "Not a valid input character: %c", aChar.operator TUint());
 			goto request_char;
 			}
 		iDoubleBufferingChosen = ETrue;
@@ -558,12 +469,10 @@
 		if (iResourceAllocationV2)
 		{
 		TUSB_PRINT("Configuring interface...");
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP17, "Configuring interface...");
 		TInt r = SetupInterface();
 		if (r != KErrNone)
 			{
 			TUSB_PRINT1("Error: %d. Stopping active scheduler...", r);
-			OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP18, "Error: %d. Stopping active scheduler...", r);
 			CActiveScheduler::Stop();
 			return;
 			}
@@ -571,17 +480,14 @@
 
 		// Everything chosen, so let's re-enumerate...
 		TUSB_PRINT("Enumeration...");
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP19, "Enumeration...");
 		TInt r = ReEnumerate();
 		if (r != KErrNone)
 			{
 			TUSB_PRINT1("Error: %d. Stopping active scheduler...", r);
-			OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP20, "Error: %d. Stopping active scheduler...", r);
 			CActiveScheduler::Stop();
 			return;
 			}
 		TUSB_PRINT("Device successfully re-enumerated\n");
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP21, "Device successfully re-enumerated\n");
 
 		// Make sure program versions match if testing against USBRFLCT
 		if (iRW->MaxBufSize() != 0)
@@ -590,7 +496,6 @@
 			if (r != KErrNone)
 				{
 				TUSB_PRINT1("Error: %d. Stopping active scheduler...", r);
-				OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP22, "Error: %d. Stopping active scheduler...", r);
 				CActiveScheduler::Stop();
 				return;
 				}
@@ -604,35 +509,30 @@
 		case 'l':					// start loop test
 		case 'L':
 			TUSB_PRINT("-> Loop test selected\n");
-			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP23, "-> Loop test selected\n");
 			iRW->SetTransferMode(ELoop);
 			iRW->SendPreamble();
 			break;
 		case 'c':					// start loop/compare test
 		case 'C':
 			TUSB_PRINT("-> Loop test with compare selected\n");
-			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP24, "-> Loop test with compare selected\n");
 			iRW->SetTransferMode(ELoopComp);
 			iRW->SendPreamble();
 			break;
 		case 'r':					// start receive-only test
 		case 'R':
 			TUSB_PRINT("-> Receive-only test selected\n");
-			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP25, "-> Receive-only test selected\n");
 			iRW->SetTransferMode(EReceiveOnly);
 			iRW->SendPreamble();
 			break;
 		case 't':					// start transmit-only test
 		case 'T':
 			TUSB_PRINT("-> Transmit-only test selected\n");
-			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP26, "-> Transmit-only test selected\n");
 			iRW->SetTransferMode(ETransmitOnly);
 			iRW->SendPreamble();
 			break;
 		case 'g':					// start transmit & get-from-file test
 		case 'G':
 			TUSB_PRINT("-> Transmit from file test selected\n");
-			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP27, "-> Transmit from file test selected\n");
 			iRW->SetTransferMode(ETransmitOnly);
 			iRW->ReadFromDisk(ETrue);
 			iRW->SendPreamble();
@@ -640,7 +540,6 @@
 		case 'p':					// start receive & put-to-file test
 		case 'P':
 			TUSB_PRINT("-> Receive to file test selected\n");
-			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP28, "-> Receive to file test selected\n");
 			iRW->SetTransferMode(EReceiveOnly);
 			iRW->WriteToDisk(ETrue);
 			iRW->SendPreamble();
@@ -648,20 +547,17 @@
 		case 'w':					// remote-wakeup
 		case 'W':
 			TUSB_PRINT("-> Signal Remote-wakeup selected\n");
-			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP29, "-> Signal Remote-wakeup selected\n");
 			iPort.SignalRemoteWakeup();
 			break;
 		case 's':					// stop either
 		case 'S':
 			TUSB_PRINT("-> Stop transfer selected\n");
-			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP30, "-> Stop transfer selected\n");
 			iRW->Stop();
 			break;
 #ifdef WITH_DUMP_OPTION
 		case 'd':					// dump controller registers
 		case 'D':
 			TUSB_PRINT("-> Dump option selected\n");
-			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP31, "-> Dump option selected\n");
 			iPort.DumpRegisters();
 			QueryRxBuffer();
 			break;
@@ -669,23 +565,16 @@
 		case 'e':					// ReEnumerate()
 		case 'E':
 			TUSB_PRINT("-> Re-enumerate device selected\n");
-			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP32, "-> Re-enumerate device selected\n");
 			ReEnumerate();
 			break;
 		case 'q':					// quit
 		case 'Q':
 			TUSB_PRINT("-> Quit program selected\n");
-			OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP33, "-> Quit program selected\n");
 			TUSB_VERBOSE_PRINT("CActiveConsole: stopping active scheduler...");
-			if(iVerbose)
-			    {
-			    OstTrace0(TRACE_VERBOSE, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP34, "CActiveConsole: stopping active scheduler...");
-			    }
 			CActiveScheduler::Stop();
 			return;
 		default:
 			TUSB_PRINT1("-> Not a valid input character: %c", aChar.operator TUint());
-			OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_PROCESSKEYPRESSL_DUP35, "-> Not a valid input character: %c", aChar.operator TUint());
 			goto request_char;
 			}
 		}
@@ -703,11 +592,11 @@
 	TInt r = iPort.QueryReceiveBuffer(EEndpoint2, bytes);
 	if (r != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_QUERYRXBUFFER, " Error %d on querying read buffer\n", r);
+		RDebug::Print(_L(" Error %d on querying read buffer\n"), r);
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_QUERYRXBUFFER_DUP01, " %d bytes in RX buffer\n", bytes);
+		RDebug::Print(_L(" %d bytes in RX buffer\n"), bytes);
 		}
 	}
 #endif
@@ -748,56 +637,35 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Error %d on querying device capabilities", r);
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL, "Error %d on querying device capabilities", r);
 		return KErrGeneral;
 		}
 	const TInt n = d_caps().iTotalEndpoints;
 
 	TUSB_PRINT("###  USB device capabilities:");
-	OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP01, "###  USB device capabilities:");
 	TUSB_PRINT1("Number of endpoints:                        %d", n);
-	OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP02, "Number of endpoints:                        %d", n);
 	TUSB_PRINT1("Supports Software-Connect:                  %s",
 				d_caps().iConnect ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP03, "Supports Software-Connect:                  %s",
-				d_caps().iConnect ? _L("yes") : _L("no"));
 	TUSB_PRINT1("Device is Self-Powered:                     %s",
 				d_caps().iSelfPowered ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP04, "Device is Self-Powered:                     %s",
-				d_caps().iSelfPowered ? _L("yes") : _L("no"));
 	TUSB_PRINT1("Supports Remote-Wakeup:                     %s",
 				d_caps().iRemoteWakeup ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP05, "Supports Remote-Wakeup:                     %s",
-				d_caps().iRemoteWakeup ? _L("yes") : _L("no"));
 	TUSB_PRINT1("Supports High-speed:                        %s",
 				d_caps().iHighSpeed ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP06, "Supports High-speed:                        %s",
-				d_caps().iHighSpeed ? _L("yes") : _L("no"));
 	TUSB_PRINT1("Supports OTG:                               %s",
 				iOtg ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP07, "Supports OTG:                               %s",
-				iOtg ? _L("yes") : _L("no"));
 	TUSB_PRINT1("Supports unpowered cable detection:         %s",
 				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ?
 				_S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP08, "Supports unpowered cable detection:         %s",
-				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ?
-				_L("yes") : _L("no"));
 	TUSB_PRINT1("Supports endpoint resource alloc scheme V2: %s\n",
 				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) ?
 				_S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP09, "Supports endpoint resource alloc scheme V2: %s\n",
-				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) ?
-				_L("yes") : _L("no"));
 	TUSB_PRINT("");
-	OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP10, "");
 
 	iSoftwareConnect = d_caps().iConnect;					// we need to remember this
 
 	if (n < 2)
 		{
 		TUSB_PRINT1("Error: only %d endpoints available on device", n);
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP11, "Error: only %d endpoints available on device", n);
 		return KErrGeneral;
 		}
 
@@ -808,21 +676,16 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Error %d on querying endpoint capabilities", r);
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP12, "Error %d on querying endpoint capabilities", r);
 		return KErrGeneral;
 		}
 	TUSB_PRINT("### USB device endpoint capabilities:");
-	OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP13, "### USB device endpoint capabilities:");
 	for (TInt i = 0; i < n; i++)
 		{
 		const TUsbcEndpointCaps* caps = &data[i].iCaps;
 		TUSB_PRINT2("Endpoint: SizeMask = 0x%08x TypeDirMask = 0x%08x",
 					caps->iSizes, caps->iTypesAndDir);
-		OstTraceExt2(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP14, "Endpoint: SizeMask = 0x%08x TypeDirMask = 0x%08x",
-					caps->iSizes, caps->iTypesAndDir);
 		}
 	TUSB_PRINT("");
-	OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP15, "");
 
 	// Set up the active interface
 	TUsbcInterfaceInfoBuf ifc;
@@ -840,7 +703,6 @@
 			if (!(mps == 64 || mps == 512))
 				{
 				TUSB_PRINT1("Funny Bulk IN MaxPacketSize: %d - T_USB will probably fail...", mps);
-				OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP16, "Funny Bulk IN MaxPacketSize: %d - T_USB will probably fail...", mps);
 				}
 			// EEndpoint1 is going to be our Tx (IN) endpoint
 			ifc().iEndpointData[0].iType = KUsbEpTypeBulk;
@@ -857,7 +719,6 @@
 			if (!(mps == 64 || mps == 512))
 				{
 				TUSB_PRINT1("Funny Bulk OUT MaxPacketSize: %d - T_USB will probably fail...", mps);
-				OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP17, "Funny Bulk OUT MaxPacketSize: %d - T_USB will probably fail...", mps);
 				}
 			// EEndpoint2 is going to be our Rx (OUT) endpoint
 			ifc().iEndpointData[1].iType = KUsbEpTypeBulk;
@@ -871,7 +732,6 @@
 	if (ep_found != 2)
 		{
 		TUSB_PRINT1("No suitable endpoints found", r);
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP18, "No suitable endpoints found:%d", r);
 		return KErrGeneral;
 		}
 
@@ -899,7 +759,6 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Error %d on setting active interface", r);
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP19, "Error %d on setting active interface", r);
 		}
 
 	// Find ep's for an alternate ifc setting.
@@ -907,7 +766,6 @@
 	if (!SupportsAlternateInterfaces())
 		{
 		TUSB_PRINT("Alternate Interfaces not supported - skipping alternate setting setup\n");
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP20, "Alternate Interfaces not supported - skipping alternate setting setup\n");
 		return KErrNone;
 		}
 	ep_found = 0;
@@ -976,7 +834,6 @@
 	if (ep_found == 0)
 		{
 		TUSB_PRINT("Not enough suitable endpoints found for alt ifc");
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP21, "Not enough suitable endpoints found for alt ifc");
 		// not a disaster though
 		return KErrNone;
 		}
@@ -993,7 +850,6 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Error %d on setting alternate interface", r);
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_QUERYUSBCLIENTL_DUP22, "Error %d on setting alternate interface", r);
 		}
 
 	return r;
@@ -1004,24 +860,22 @@
 	{
 	TInt r = iPort.AllocateEndpointResource(aEndpoint, EUsbcEndpointResourceDMA);
 	if (r == KErrNone)
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEENDPOINTDMA, "DMA allocation on endpoint %d: KErrNone", aEndpoint);
+		RDebug::Print(_L("DMA allocation on endpoint %d: KErrNone"), aEndpoint);
 	else if (r == KErrInUse)
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP01, "DMA allocation on endpoint %d: KErrInUse", aEndpoint);
+		RDebug::Print(_L("DMA allocation on endpoint %d: KErrInUse"), aEndpoint);
 	else if (r == KErrNotSupported)
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP02, "DMA allocation on endpoint %d: KErrNotSupported", aEndpoint);
+		RDebug::Print(_L("DMA allocation on endpoint %d: KErrNotSupported"), aEndpoint);
 	else
-		OstTraceExt2(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP03, "DMA allocation on endpoint %d: unexpected return value %d",
+		RDebug::Print(_L("DMA allocation on endpoint %d: unexpected return value %d"),
 					  aEndpoint, r);
 	TBool res = iPort.QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDMA);
 	TUSB_PRINT2("DMA on endpoint %d %s\n",
 				aEndpoint, res ? _S("allocated") : _S("not allocated"));
-	OstTraceExt2(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP04, "DMA on endpoint %d %s\n",
-				aEndpoint, res ? _L("allocated") : _L("not allocated"));
 
 	if ((r == KErrNone) && !res)
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP05, "(Allocation success but negative query result: contradiction!)\n");
+		RDebug::Print(_L("(Allocation success but negative query result: contradiction!)\n"));
 	else if ((r != KErrNone) && res)
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP06, "(Allocation failure but positive query result: contradiction!)\n");
+		RDebug::Print(_L("(Allocation failure but positive query result: contradiction!)\n"));
 	}
 
 
@@ -1029,17 +883,15 @@
 	{
 	TInt r = iPort.DeAllocateEndpointResource(aEndpoint, EUsbcEndpointResourceDMA);
 	if (r == KErrNone)
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_DEALLOCATEENDPOINTDMA, "DMA deallocation on endpoint %d: KErrNone", aEndpoint);
+		RDebug::Print(_L("DMA deallocation on endpoint %d: KErrNone"), aEndpoint);
 	else if (r == KErrNotSupported)
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_DEALLOCATEENDPOINTDMA_DUP01, "DMA deallocation on endpoint %d: KErrNotSupported", aEndpoint);
+		RDebug::Print(_L("DMA deallocation on endpoint %d: KErrNotSupported"), aEndpoint);
 	else
-		OstTraceExt2(TRACE_NORMAL, CACTIVECONSOLE_DEALLOCATEENDPOINTDMA_DUP02, "DMA deallocation on endpoint %d: unexpected return value %d",
+		RDebug::Print(_L("DMA deallocation on endpoint %d: unexpected return value %d"),
 					  aEndpoint, r);
 	TBool res = iPort.QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDMA);
 	TUSB_PRINT2("DMA on endpoint %d %s\n",
 				aEndpoint, res ? _S("allocated") : _S("not allocated"));
-	OstTraceExt2(TRACE_NORMAL, CACTIVECONSOLE_DEALLOCATEENDPOINTDMA_DUP03, "DMA on endpoint %d %s\n",
-				aEndpoint, res ? _L("allocated") : _L("not allocated"));
 	}
 
 
@@ -1047,24 +899,22 @@
 	{
 	TInt r = iPort.AllocateEndpointResource(aEndpoint, EUsbcEndpointResourceDoubleBuffering);
 	if (r == KErrNone)
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING, "Double Buffering allocation on endpoint %d: KErrNone", aEndpoint);
+		RDebug::Print(_L("Double Buffering allocation on endpoint %d: KErrNone"), aEndpoint);
 	else if (r == KErrInUse)
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP01, "Double Buffering allocation on endpoint %d: KErrInUse", aEndpoint);
+		RDebug::Print(_L("Double Buffering allocation on endpoint %d: KErrInUse"), aEndpoint);
 	else if (r == KErrNotSupported)
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP02, "Double Buffering allocation on endpoint %d: KErrNotSupported", aEndpoint);
+		RDebug::Print(_L("Double Buffering allocation on endpoint %d: KErrNotSupported"), aEndpoint);
 	else
-		OstTraceExt2(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP03, "Double Buffering allocation on endpoint %d: unexpected return value %d",
+		RDebug::Print(_L("Double Buffering allocation on endpoint %d: unexpected return value %d"),
 					  aEndpoint, r);
 	TBool res = iPort.QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDoubleBuffering);
 	TUSB_PRINT2("Double Buffering on endpoint %d %s\n",
 				aEndpoint, res ? _S("allocated") : _S("not allocated"));
-	OstTraceExt2(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP04, "Double Buffering on endpoint %d %s\n",
-				aEndpoint, res ? _L("allocated") : _L("not allocated"));
 
 	if ((r == KErrNone) && !res)
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP05, "(Allocation success but negative query result: contradiction!)\n");
+		RDebug::Print(_L("(Allocation success but negative query result: contradiction!)\n"));
 	else if ((r != KErrNone) && res)
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP06, "(Allocation failure but positive query result: contradiction!)\n");
+		RDebug::Print(_L("(Allocation failure but positive query result: contradiction!)\n"));
 	}
 
 
@@ -1072,17 +922,15 @@
 	{
 	TInt r = iPort.DeAllocateEndpointResource(aEndpoint, EUsbcEndpointResourceDoubleBuffering);
 	if (r == KErrNone)
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_DEALLOCATEDOUBLEBUFFERING, "Double Buffering deallocation on endpoint %d: KErrNone", aEndpoint);
+		RDebug::Print(_L("Double Buffering deallocation on endpoint %d: KErrNone"), aEndpoint);
 	else if (r == KErrNotSupported)
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_DEALLOCATEDOUBLEBUFFERING_DUP01, "Double Buffering deallocation on endpoint %d: KErrNotSupported", aEndpoint);
+		RDebug::Print(_L("Double Buffering deallocation on endpoint %d: KErrNotSupported"), aEndpoint);
 	else
-		OstTraceExt2(TRACE_NORMAL, CACTIVECONSOLE_DEALLOCATEDOUBLEBUFFERING_DUP02, "Double Buffering deallocation on endpoint %d: unexpected return value %d",
+		RDebug::Print(_L("Double Buffering deallocation on endpoint %d: unexpected return value %d"),
 					  aEndpoint, r);
 	TBool res = iPort.QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDoubleBuffering);
 	TUSB_PRINT2("Double Buffering on endpoint %d %s\n",
 				aEndpoint, res ? _S("allocated") : _S("not allocated"));
-	OstTraceExt2(TRACE_NORMAL, CACTIVECONSOLE_DEALLOCATEDOUBLEBUFFERING_DUP03, "Double Buffering on endpoint %d %s\n",
-				aEndpoint, res ? _L("allocated") : _L("not allocated"));
 	}
 
 
@@ -1093,21 +941,15 @@
 	if (!iSoftwareConnect)
 		{
 		iConsole->Printf(_L("This device does not support software\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REENUMERATE, "This device does not support software\n");
 		iConsole->Printf(_L("disconnect/reconnect\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REENUMERATE_DUP01, "disconnect/reconnect\n");
 		iConsole->Printf(_L("Please physically unplug and replug\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REENUMERATE_DUP02, "Please physically unplug and replug\n");
 		iConsole->Printf(_L("the USB cable NOW... "));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REENUMERATE_DUP03, "the USB cable NOW... ");
 		}
 	iConsole->Printf(_L("\n>>> START THE USBRFLCT PROGRAM ON THE HOST SIDE NOW <<<\n"));
-	OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REENUMERATE_DUP04, "\n>>> START THE USBRFLCT PROGRAM ON THE HOST SIDE NOW <<<\n");
 	User::WaitForRequest(enum_status);
 	if (enum_status != KErrNone)
 		{
 		TUSB_PRINT1("Error: Re-enumeration status = %d", enum_status.Int());
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_REENUMERATE_DUP05, "Error: Re-enumeration status = %d", enum_status.Int());
 		return KErrGeneral;
 		}
 	TUsbcDeviceState device_state =	EUsbcDeviceStateUndefined;
@@ -1115,7 +957,6 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Error %d on querying device state", r);
-		OstTrace1(TRACE_NORMAL, CACTIVECONSOLE_REENUMERATE_DUP06, "Error %d on querying device state", r);
 		}
 	else
 		{
@@ -1128,15 +969,6 @@
 						((device_state == EUsbcDeviceStateConfigured) ? _S("Configured") :
 						 ((device_state == EUsbcDeviceStateSuspended) ? _S("Suspended") :
 						  _S("Unknown"))))))));
-		OstTraceExt1(TRACE_NORMAL, CACTIVECONSOLE_REENUMERATE_DUP07, "Current device state: %s",
-					(device_state == EUsbcDeviceStateUndefined) ? _L("Undefined") :
-					((device_state == EUsbcDeviceStateAttached) ? _L("Attached") :
-					 ((device_state == EUsbcDeviceStatePowered) ? _L("Powered") :
-					  ((device_state == EUsbcDeviceStateDefault) ? _L("Default") :
-					   ((device_state == EUsbcDeviceStateAddress) ? _L("Address") :
-						((device_state == EUsbcDeviceStateConfigured) ? _L("Configured") :
-						 ((device_state == EUsbcDeviceStateSuspended) ? _L("Suspended") :
-						  _L("Unknown"))))))));
 		}
 
 	// Check the speed of the established physical USB connection
@@ -1144,14 +976,12 @@
 	if (iHighSpeed)
 		{
 		TUSB_PRINT("---> USB High-speed Testing\n");
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REENUMERATE_DUP08, "---> USB High-speed Testing\n");
 		// It can only be 512 bytes when using high-speed.
 		iRW->SetMaxPacketSize(512);							// iRW already exists at this point
 		}
 	else
 		{
 		TUSB_PRINT("---> USB Full-speed Testing\n");
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_REENUMERATE_DUP09, "---> USB Full-speed Testing\n");
 		// We only support 64 bytes when using full-speed.
 		iRW->SetMaxPacketSize(64);							// iRW already exists at this point
 		}
@@ -1214,12 +1044,6 @@
 				(deviceDescriptor[KUsbDevReleaseOffset + 1] & 0x0f),
 				((deviceDescriptor[KUsbDevReleaseOffset] >> 4) & 0x0f),
 				(deviceDescriptor[KUsbDevReleaseOffset] & 0x0f));
-	OstTraceExt2(TRACE_NORMAL, CACTIVECONSOLE_SETUPDESCRIPTORS, "\nVID = 0x%04X / PID = 0x%04X / ", Vid, Pid);
-	OstTraceExt4(TRACE_NORMAL, CACTIVECONSOLE_SETUPDESCRIPTORS_DUP01, "DevRel = %d%d.%d%d\n", 
-				((deviceDescriptor[KUsbDevReleaseOffset + 1] >> 4) & 0x0f),
-				(deviceDescriptor[KUsbDevReleaseOffset + 1] & 0x0f),
-				((deviceDescriptor[KUsbDevReleaseOffset] >> 4) & 0x0f),
-				(deviceDescriptor[KUsbDevReleaseOffset] & 0x0f));
 
 	// === Configuration Descriptor
 
@@ -1277,10 +1101,6 @@
 	  iVerbose(aVerboseOutput)
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::CActiveRW()");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVERW_CACTIVERW, "CActiveRW::CActiveRW()");
-	    }
 	}
 
 
@@ -1298,10 +1118,6 @@
 void CActiveRW::ConstructL()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::ConstructL()");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVERW_CONSTRUCTL, "CActiveRW::ConstructL()");
-	    }
 
 	User::LeaveIfError(iFs.Connect());
 
@@ -1324,7 +1140,6 @@
 	if (!iTimeoutTimer)
 		{
 		TUSB_PRINT("Failed to create timeout timer");
-		OstTrace0(TRACE_NORMAL, CACTIVERW_CONSTRUCTL_DUP01, "Failed to create timeout timer");
 		}
 	}
 
@@ -1332,10 +1147,6 @@
 CActiveRW::~CActiveRW()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::~CActiveRW()");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVERW_DCACTIVERW, "CActiveRW::~CActiveRW()");
-	    }
 	Cancel();												// base class
 	delete iTimeoutTimer;
 	iFile.Close();
@@ -1348,7 +1159,6 @@
 	if (aBufSz > KMaxBufSize)
 		{
 		TUSB_PRINT2("SetMaxBufSize(): too large: %d! (using %d)", aBufSz, KMaxBufSize);
-		OstTraceExt2(TRACE_NORMAL, CACTIVERW_SETMAXBUFSIZE, "SetMaxBufSize(): too large: %d! (using %d)", aBufSz, KMaxBufSize);
 		aBufSz = KMaxBufSize;
 		}
 	iMaxBufSz = aBufSz;
@@ -1381,19 +1191,13 @@
 void CActiveRW::RunL()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::RunL()");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVERW_RUNL, "CActiveRW::RunL()");
-	    }
 	if (iStatus != KErrNone)
 		{
 		TUSB_PRINT1("Error %d in RunL", iStatus.Int());
-		OstTrace1(TRACE_NORMAL, CACTIVERW_RUNL_DUP01, "Error %d in RunL", iStatus.Int());
 		}
 	if (iDoStop)
 		{
 		TUSB_PRINT("Stopped");
-		OstTrace0(TRACE_NORMAL, CACTIVERW_RUNL_DUP02, "Stopped");
 		iDoStop = EFalse;
 		return;
 		}
@@ -1418,7 +1222,6 @@
 			if (num != ++iPktNum)
 				{
 				TUSB_PRINT2("*** rcv'd wrong pkt number: 0x%x (expected: 0x%x)", num, iPktNum);
-				OstTraceExt2(TRACE_NORMAL, CACTIVERW_RUNL_DUP03, "*** rcv'd wrong pkt number: 0x%x (expected: 0x%x)", num, iPktNum);
 				// Update the packet number with the received number, so that
 				// if a single packet is duplicated or lost then a single error occurs
 				iPktNum = num;
@@ -1428,11 +1231,6 @@
 				// Write out to disk previous completed Read
 				TUSB_VERBOSE_PRINT2("iMaxBufSz = %d (iReadBuf.Size(): %d)",
 									iMaxBufSz, iReadBuf.Size());
-				if(iVerbose)
-				    {
-				    OstTraceExt2(TRACE_VERBOSE, CACTIVERW_RUNL_DUP04, "iMaxBufSz = %d (iReadBuf.Size(): %d)",
-									iMaxBufSz, iReadBuf.Size());
-				    }
 				WriteBufferToDisk(iReadBuf, iMaxBufSz);
 				}
 			ReadData();										// next we read data
@@ -1443,7 +1241,6 @@
 			if (!CompareBuffers(iBufSz))
 				{
 				TUSB_PRINT1("Error while comparing tx & rx buffers for packet 0x%x", iPktNum);
-				OstTrace1(TRACE_NORMAL, CACTIVERW_RUNL_DUP05, "Error while comparing tx & rx buffers for packet 0x%x", iPktNum);
 				}
 			}
 		else if (iBufSz > 3)
@@ -1452,7 +1249,6 @@
 			if (num != iPktNum)
 				{
 				TUSB_PRINT2("*** rcv'd wrong pkt number: 0x%x (expected: 0x%x)", num, iPktNum);
-				OstTraceExt2(TRACE_NORMAL, CACTIVERW_RUNL_DUP06, "*** rcv'd wrong pkt number: 0x%x (expected: 0x%x)", num, iPktNum);
 				}
 			}
 		if (iBufSz == iMaxBufSz)
@@ -1467,7 +1263,6 @@
 		break;
 	default:
 		TUSB_PRINT("Oops. (Shouldn't end up here...)");
-		OstTrace0(TRACE_NORMAL, CACTIVERW_RUNL_DUP07, "Oops. (Shouldn't end up here...)");
 		break;
 		}
 	return;
@@ -1477,21 +1272,15 @@
 TInt CActiveRW::SendVersion()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::SendVersion()");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVERW_SENDVERSION, "CActiveRW::SendVersion()");
-	    }
 	if (iXferMode != ::ENone)
 		{
 		TUSB_PRINT1("Error : wrong state: %d", iXferMode);
-		OstTrace1(TRACE_NORMAL, CACTIVERW_SENDVERSION_DUP01, "Error : wrong state: %d", iXferMode);
 		return KErrGeneral;
 		}
 	// Here we send our version packet to the host.
 	// (We can use the preamble buffer because we only need it
 	//  once and that's also before the preamble uses.)
 	TUSB_PRINT1("Sending T_USB version: %d\n", KTusbVersion);
-	OstTrace1(TRACE_NORMAL, CACTIVERW_SENDVERSION_DUP02, "Sending T_USB version: %d\n", KTusbVersion);
 	iPreambleBuf.FillZ();
 	*reinterpret_cast<TUint32*>(&iPreambleBuf[0]) = SWAP_BYTES_32(KTusbVersion);
 	// A 'magic' string so that USBRFLCT doesn't interpret the first 4 bytes
@@ -1503,16 +1292,8 @@
 	TRequestStatus send_status;
 	iPort->Write(send_status, EEndpoint1, iPreambleBuf, KPreambleLength);
 	TUSB_VERBOSE_PRINT("Waiting for write request to complete...");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVERW_SENDVERSION_DUP03, "Waiting for write request to complete...");
-	    }
 	User::WaitForRequest(send_status);
 	TUSB_VERBOSE_PRINT("...done.\n");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVERW_SENDVERSION_DUP04, "...done.\n");
-	    }
 	return send_status.Int();
 	}
 
@@ -1520,87 +1301,50 @@
 TInt CActiveRW::ReceiveVersion()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::ReceiveVersion()");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVERW_RECEIVEVERSION, "CActiveRW::ReceiveVersion()");
-	    }
 	if (iXferMode != ::ENone)
 		{
 		TUSB_PRINT1("Error : wrong state: %d", iXferMode);
-		OstTrace1(TRACE_NORMAL, CACTIVERW_RECEIVEVERSION_DUP01, "Error : wrong state: %d", iXferMode);
 		return KErrGeneral;
 		}
 	// Here we try to receive a version packet from the host.
 	// (We can use the preamble buffer because we only need it
 	//  once and that's also before the preamble uses.)
 	TUSB_PRINT("Getting host program versions...");
-	OstTrace0(TRACE_NORMAL, CACTIVERW_RECEIVEVERSION_DUP02, "Getting host program versions...");
 	iPreambleBuf.FillZ();
 	TRequestStatus receive_status;
 	iPort->Read(receive_status, EEndpoint2, iPreambleBuf, KPreambleLength);
 	TUSB_VERBOSE_PRINT("Waiting for read request to complete...");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVERW_RECEIVEVERSION_DUP03, "Waiting for read request to complete...");
-	    }
 	iTimeoutTimer->Activate(5000000);						// Host gets 5s
 	User::WaitForRequest(receive_status, iTimeoutTimer->iStatus);
 	if (receive_status == KRequestPending)
 		{
 		// Read() still pending...
 		TUSB_PRINT("Cancelling USB Read(): no response from host.\n");
-		OstTrace0(TRACE_NORMAL, CACTIVERW_RECEIVEVERSION_DUP04, "Cancelling USB Read(): no response from host.\n");
 		iPort->ReadCancel(EEndpoint2);
 		TUSB_PRINT("THIS COULD BE DUE TO AN OLD VERSION OF USBRFLCT ON THE PC:");
-		OstTrace0(TRACE_NORMAL, CACTIVERW_RECEIVEVERSION_DUP05, "THIS COULD BE DUE TO AN OLD VERSION OF USBRFLCT ON THE PC:");
 		TUSB_PRINT3("PLEASE CHECK THE VERSION THERE - WE NEED AT LEAST V%d.%d.%d!\n",
 					KUsbrflctVersionMajor, KUsbrflctVersionMinor, KUsbrflctVersionMicro);
-		OstTraceExt3(TRACE_NORMAL, CACTIVERW_RECEIVEVERSION_DUP06, "PLEASE CHECK THE VERSION THERE - WE NEED AT LEAST V%d.%d.%d!\n",
-					KUsbrflctVersionMajor, KUsbrflctVersionMinor, KUsbrflctVersionMicro);
 		TUSB_PRINT("When updating an existing USBRFLCT installation <= v1.3.1,\n" \
 				   L"the following three things will need to be done:\n");
-		OstTrace0(TRACE_NORMAL, CACTIVERW_RECEIVEVERSION_DUP07, "When updating an existing USBRFLCT installation <= v1.3.1,\n" \
-				   L"the following three things will need to be done:\n");
 		TUSB_PRINT("1. Connect the device to the PC & start T_USB (just as now),\n" \
 				   L"then find the USB device in the Windows Device Manager\n" \
 				   L"('Control Panel'->'System'->'Hardware'->'Device Manager').\n" \
 				   L"Right click on the device name and choose 'Uninstall...'.\n");
-		OstTrace0(TRACE_NORMAL, CACTIVERW_RECEIVEVERSION_DUP08, "1. Connect the device to the PC & start T_USB (just as now),\n" \
-				   L"then find the USB device in the Windows Device Manager\n" \
-				   L"('Control Panel'->'System'->'Hardware'->'Device Manager').\n" \
-				   L"Right click on the device name and choose 'Uninstall...'.\n");
 		TUSB_PRINT("2. In c:\\winnt\\inf\\, find (by searching for \"Symbian\") and\n" \
 				   L"delete the *.INF file that was used to install the existing\n" \
 				   L"version of USBRFLCT.SYS. Make sure to also delete the\n" \
 				   L"precompiled version of that file (<samename>.PNF).\n");
-		OstTrace0(TRACE_NORMAL, CACTIVERW_RECEIVEVERSION_DUP09, "2. In c:\\winnt\\inf\\, find (by searching for \"Symbian\") and\n" \
-				   L"delete the *.INF file that was used to install the existing\n" \
-				   L"version of USBRFLCT.SYS. Make sure to also delete the\n" \
-				   L"precompiled version of that file (<samename>.PNF).\n");
 		TUSB_PRINT("3. In c:\\winnt\\system32\\drivers\\, delete the file USBRFLCT.SYS.\n");
-		OstTrace0(TRACE_NORMAL, CACTIVERW_RECEIVEVERSION_DUP10, "3. In c:\\winnt\\system32\\drivers\\, delete the file USBRFLCT.SYS.\n");
 		TUSB_PRINT("Then unplug & reconnect the USB device and, when prompted, install\n" \
 				   L"the new USBRFLCT.SYS driver using the .INF file from this distribution.\n" \
 				   L"(All files can be found under e32test\\win32\\usbrflct_distribution\\.)\n");
-		OstTrace0(TRACE_NORMAL, CACTIVERW_RECEIVEVERSION_DUP11, "Then unplug & reconnect the USB device and, when prompted, install\n" \
-				   L"the new USBRFLCT.SYS driver using the .INF file from this distribution.\n" \
-				   L"(All files can be found under e32test\\win32\\usbrflct_distribution\\.)\n");
 		TUSB_PRINT("Use the new USBRFLCT.EXE from this distribution.\n");
-		OstTrace0(TRACE_NORMAL, CACTIVERW_RECEIVEVERSION_DUP12, "Use the new USBRFLCT.EXE from this distribution.\n");
 		}
 	else
 		{
 		TUSB_VERBOSE_PRINT("...done.");
-		if(iVerbose)
-		    {
-		    OstTrace0(TRACE_VERBOSE, CACTIVERW_RECEIVEVERSION_DUP13, "...done.");
-		    }
 		// Timeout not needed any longer
 		TUSB_VERBOSE_PRINT("Cancelling timeout timer: USB Read() completed.\n");
-		if(iVerbose)
-		    {
-		    OstTrace0(TRACE_VERBOSE, CACTIVERW_RECEIVEVERSION_DUP14, "Cancelling timeout timer: USB Read() completed.\n");
-		    }
 		iTimeoutTimer->Cancel();
 		}
 	return receive_status.Int();
@@ -1610,10 +1354,6 @@
 TInt CActiveRW::ExchangeVersions()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::ExchangeVersions()");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVERW_EXCHANGEVERSIONS, "CActiveRW::ExchangeVersions()");
-	    }
 	// First check the version of USBRFLCT that's running on the host
 	TInt r = ReceiveVersion();
 	if (r != KErrNone)
@@ -1628,15 +1368,10 @@
 	TUSB_PRINT5("Host-side: USBRFLCT v%d.%d.%d  USBIO v%d.%d\n",
 				usbrflct_ver_major, usbrflct_ver_minor, usbrflct_ver_micro,
 				usbio_ver_major, usbio_ver_minor);
-	OstTraceExt5(TRACE_NORMAL, CACTIVERW_EXCHANGEVERSIONS_DUP01, "Host-side: USBRFLCT v%d.%d.%d  USBIO v%d.%d\n",
-				usbrflct_ver_major, usbrflct_ver_minor, usbrflct_ver_micro,
-				usbio_ver_major, usbio_ver_minor);
 	if (usbrflct_ver_major < KUsbrflctVersionMajor)
 		{
 		TUSB_PRINT1("USBRFLCT version not sufficient (need at least v%d.x.x)\n",
 					KUsbrflctVersionMajor);
-		OstTrace1(TRACE_NORMAL, CACTIVERW_EXCHANGEVERSIONS_DUP02, "USBRFLCT version not sufficient (need at least v%d.x.x)\n",
-					KUsbrflctVersionMajor);
 		return KErrGeneral;
 		}
 	// Just using '<' instead of the seemingly absurd '<= && !==' doesn't work without
@@ -1646,8 +1381,6 @@
 		{
 		TUSB_PRINT2("USBRFLCT version not sufficient (need at least v%d.%d.x)\n",
 					KUsbrflctVersionMajor, KUsbrflctVersionMinor);
-		OstTraceExt2(TRACE_NORMAL, CACTIVERW_EXCHANGEVERSIONS_DUP03, "USBRFLCT version not sufficient (need at least v%d.%d.x)\n",
-					KUsbrflctVersionMajor, KUsbrflctVersionMinor);
 		return KErrGeneral;
 		}
 	// Just using '<' instead of the seemingly absurd '<= && !==' doesn't work without
@@ -1657,8 +1390,6 @@
 		{
 		TUSB_PRINT3("USBRFLCT version not sufficient (need at least v%d.%d.%d)\n",
 					KUsbrflctVersionMajor, KUsbrflctVersionMinor, KUsbrflctVersionMicro);
-		OstTraceExt3(TRACE_NORMAL, CACTIVERW_EXCHANGEVERSIONS_DUP04, "USBRFLCT version not sufficient (need at least v%d.%d.%d)\n",
-					KUsbrflctVersionMajor, KUsbrflctVersionMinor, KUsbrflctVersionMicro);
 		return KErrGeneral;
 		}
 	// Now we send T_USB's version to the host
@@ -1674,16 +1405,8 @@
 void CActiveRW::SendPreamble()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::SendPreamble()");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVERW_SENDPREAMBLE, "CActiveRW::SendPreamble()");
-	    }
 	__ASSERT_ALWAYS(!IsActive(), User::Panic(KActivePanic, 666));
 	TUSB_VERBOSE_PRINT1("Sending data length: %d bytes", iBufSz);
-	if(iVerbose)
-	    {
-	    OstTrace1(TRACE_VERBOSE, CACTIVERW_SENDPREAMBLE_DUP01, "Sending data length: %d bytes", iBufSz);
-	    }
 	*reinterpret_cast<TUint32*>(&iPreambleBuf[0]) = SWAP_BYTES_32(iBufSz);
 	iPort->Write(iStatus, EEndpoint1, iPreambleBuf, KPreambleLength);
 	iCurrentXfer = EPreamble;
@@ -1694,10 +1417,6 @@
 void CActiveRW::SendData()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::SendData()");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVERW_SENDDATA, "CActiveRW::SendData()");
-	    }
 	__ASSERT_ALWAYS(!IsActive(), User::Panic(KActivePanic, 666));
 	if (iDiskAccessEnabled)
 		{
@@ -1716,10 +1435,6 @@
 			}
 		}
 	TUSB_VERBOSE_PRINT1("Sending data: %d bytes", iBufSz);
-	if(iVerbose)
-	    {
-	    OstTrace1(TRACE_VERBOSE, CACTIVERW_SENDDATA_DUP01, "Sending data: %d bytes", iBufSz);
-	    }
 	iPort->Write(iStatus, EEndpoint1, iWriteBuf, iBufSz);
 	iCurrentXfer = EWriteXfer;
 	SetActive();
@@ -1733,11 +1448,9 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("RFs::DriveList() returned %d", r);
-		OstTrace1(TRACE_NORMAL, CACTIVERW_SELECTDRIVE, "RFs::DriveList() returned %d", r);
 		return r;
 		}
 	TUSB_PRINT("Available drives:");
-	OstTrace0(TRACE_NORMAL, CACTIVERW_SELECTDRIVE_DUP01, "Available drives:");
 	for (TInt n = 0; n < KMaxDrives; n++)
 		{
 		if (driveList[n] != 0)
@@ -1748,17 +1461,13 @@
 				{
 				TPtr name(volumeInfo.iName.Des());
 				TUSB_PRINT2("Drive %c: %- 16S", 'A' + n, &name);
-				OstTraceExt2(TRACE_NORMAL, CACTIVERW_SELECTDRIVE_DUP02, "Drive %c: %S", 'A' + n, name);
 				if (volumeInfo.iDrive.iMediaAtt & KMediaAttWriteProtected)
 					TUSB_PRINT("  (read-only)");
-					OstTrace0(TRACE_NORMAL, CACTIVERW_SELECTDRIVE_DUP03, "  (read-only)");
 				TUSB_PRINT("");
-				OstTrace0(TRACE_NORMAL, CACTIVERW_SELECTDRIVE_DUP04, "");
 				}
 			}
 		}
 	iConsole->Printf(_L("Please select a drive letter (or 'Q' to quit)..."));
-	OstTrace0(TRACE_NORMAL, CACTIVERW_SELECTDRIVE_DUP05, "Please select a drive letter (or 'Q' to quit...");
 	TChar driveLetter;
 	TInt driveNumber;
 	TVolumeInfo volumeInfo;
@@ -1782,9 +1491,7 @@
 	iFileName.Format(_L("%c:"), driveLetter.operator TUint());
 	iFileName.Append(KFileName);
 	TUSB_PRINT1("\nFilename = %S", &iFileName);
-	OstTraceExt1(TRACE_NORMAL, CACTIVERW_SELECTDRIVE_DUP06, "\nFilename = %S", iFileName);
 	TUSB_PRINT1("File size: %d", KMaxFileSize);
-	OstTrace1(TRACE_NORMAL, CACTIVERW_SELECTDRIVE_DUP07, "File size: %d", KMaxFileSize);
 	return r;
 	}
 
@@ -1828,7 +1535,6 @@
 		if (r != KErrNone)
 			{
 			TUSB_PRINT1("RFile::Replace() returned %d", r);
-			OstTrace1(TRACE_NORMAL, CACTIVERW_READFROMDISK, "RFile::Replace() returned %d", r);
 			iDiskAccessEnabled = EFalse;
 			return r;
 			}
@@ -1840,28 +1546,24 @@
 			buffer[n] = static_cast<TUint8>(n & 0x000000ff);
 			}
 		TUSB_PRINT("Writing data to file (this may take some minutes...)");
-		OstTrace0(TRACE_NORMAL, CACTIVERW_READFROMDISK_DUP01, "Writing data to file (this may take some minutes...)");
 		for (TInt n = 0; n < KMaxFileSize; n += KBufferSize)
 			{
 			r = iFile.Write(buffer, KBufferSize);
 			if (r != KErrNone)
 				{
 				TUSB_PRINT1("RFile::Write() returned %d (disk full?)", r);
-				OstTrace1(TRACE_NORMAL, CACTIVERW_READFROMDISK_DUP02, "RFile::Write() returned %d (disk full?)", r);
 				iFile.Close();
 				iDiskAccessEnabled = EFalse;
 				return r;
 				}
 			}
 		TUSB_PRINT("Done.");
-		OstTrace0(TRACE_NORMAL, CACTIVERW_READFROMDISK_DUP03, "Done.");
 		iFile.Close();
 		// Now open the file for reading
 		r = iFile.Open(iFs, iFileName, EFileRead);
 		if (r != KErrNone)
 			{
 			TUSB_PRINT1("RFile::Open() returned %d", r);
-			OstTrace1(TRACE_NORMAL, CACTIVERW_READFROMDISK_DUP04, "RFile::Open() returned %d", r);
 			iDiskAccessEnabled = EFalse;
 			return r;
 			}
@@ -1874,15 +1576,10 @@
 void CActiveRW::WriteBufferToDisk(TDes8& aBuffer, TInt aLen)
 	{
 	TUSB_VERBOSE_PRINT1("CActiveRW::WriteBufferToDisk(), len = %d", aLen);
-	if(iVerbose)
-	    {
-	    OstTrace1(TRACE_VERBOSE, CACTIVERW_WRITEBUFFERTODISK, "CActiveRW::WriteBufferToDisk(), len = %d", aLen);
-	    }
 	TInt r = iFile.Write(aBuffer, aLen);
 	if (r != KErrNone)
 		{
 		TUSB_PRINT2("Error writing to %S (%d)", &iFileName, r);
-		OstTraceExt2(TRACE_NORMAL, CACTIVERW_WRITEBUFFERTODISK_DUP01, "Error writing to %S (%d)", iFileName, r);
 		iDiskAccessEnabled = EFalse;
 		return;
 		}
@@ -1906,22 +1603,15 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT2("Error reading from %S (%d)", &iFileName, r);
-		OstTraceExt2(TRACE_NORMAL, CACTIVERW_READBUFFERFROMDISK, "Error reading from %S (%d)", iFileName, r);
 		iDiskAccessEnabled = EFalse;
 		return;
 		}
 	TInt readLen = aBuffer.Length();
 	TUSB_VERBOSE_PRINT1("CActiveRW::ReadBufferFromDisk(), len = %d\n", readLen);
-	if(iVerbose)
-	    {
-	    OstTrace1(TRACE_VERBOSE, CACTIVERW_READBUFFERFROMDISK_DUP01, "CActiveRW::ReadBufferFromDisk(), len = %d\n", readLen);
-	    }
 	if (readLen < aLen)
 		{
 		TUSB_PRINT3("Only %d bytes of %d read from file %S)",
 					readLen, aLen, &iFileName);
-		OstTraceExt3(TRACE_NORMAL, CACTIVERW_READBUFFERFROMDISK_DUP02, "Only %d bytes of %d read from file %S)",
-					readLen, aLen, iFileName);
 		iDiskAccessEnabled = EFalse;
 		return;
 		}
@@ -1932,53 +1622,29 @@
 void CActiveRW::ReadData()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::ReadData()");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVERW_READDATA, "CActiveRW::ReadData()");
-	    }
 	__ASSERT_ALWAYS(!IsActive(), User::Panic(KActivePanic, 666));
 	TUSB_VERBOSE_PRINT1("Reading data: %d bytes", iBufSz);
-	if(iVerbose)
-	    {
-	    OstTrace1(TRACE_VERBOSE, CACTIVERW_READDATA_DUP01, "Reading data: %d bytes", iBufSz);
-	    }
 	if (iXferMode == EReceiveOnly)
 		{
 		TUSB_VERBOSE_PRINT("  (rx only)");
-		if(iVerbose)
-		    {
-		    OstTrace0(TRACE_VERBOSE, CACTIVERW_READDATA_DUP02, "  (rx only)");
-		    }
 		iPort->Read(iStatus, EEndpoint2, iReadBuf, iBufSz);
 		}
 	else if (iBufSz == iMaxPktSz)
 		{
 		// we also want to test the packet version of Read()
 		TUSB_VERBOSE_PRINT("  (a single packet)");
-		if(iVerbose)
-		    {
-		    OstTrace0(TRACE_VERBOSE, CACTIVERW_READDATA_DUP03, "  (a single packet)");
-		    }
 		iPort->ReadPacket(iStatus, EEndpoint2, iReadBuf, iBufSz);
 		}
 	else if (iBufSz == iReadBuf.MaxSize())
 		{
 		// or we could perhaps test the three-parameter version
 		TUSB_VERBOSE_PRINT("  (w/o length)");
-		if(iVerbose)
-		    {
-		    OstTrace0(TRACE_VERBOSE, CACTIVERW_READDATA_DUP04, "  (w/o length)");
-		    }
 		iPort->Read(iStatus, EEndpoint2, iReadBuf);
 		}
 	else
 		{
 		// otherwise, we use the universal default version
 		TUSB_VERBOSE_PRINT("  (normal)");
-		if(iVerbose)
-		    {
-		    OstTrace0(TRACE_VERBOSE, CACTIVERW_READDATA_DUP05, "  (normal)");
-		    }
 		iPort->Read(iStatus, EEndpoint2, iReadBuf, iBufSz);
 		}
 	iCurrentXfer = EReadXfer;
@@ -1991,11 +1657,9 @@
 	if (!IsActive())
 		{
 		TUSB_PRINT("CActiveRW::Stop(): Not active");
-		OstTrace0(TRACE_NORMAL, CACTIVERW_STOP, "CActiveRW::Stop(): Not active");
 		return;
 		}
 	TUSB_PRINT("Cancelling outstanding transfer requests\n");
-	OstTrace0(TRACE_NORMAL, CACTIVERW_STOP_DUP01, "Cancelling outstanding transfer requests\n");
 	iBufSz = KInitialBufSz;
 	iPktNum = ~0;
 	iDoStop = ETrue;
@@ -2007,10 +1671,6 @@
 void CActiveRW::DoCancel()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::DoCancel()");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVERW_DOCANCEL, "CActiveRW::DoCancel()");
-	    }
 	// Canceling the transfer requests can be done explicitly
 	// for every transfer...
 	iPort->WriteCancel(EEndpoint1);
@@ -2023,26 +1683,13 @@
 TBool CActiveRW::CompareBuffers(TInt aLen)
 	{
 	TUSB_VERBOSE_PRINT1("CActiveRW::CompareBuffers(%d)", aLen);
-	if(iVerbose)
-	    {
-	    OstTrace1(TRACE_VERBOSE, CACTIVERW_COMPAREBUFFERS, "CActiveRW::CompareBuffers(%d)", aLen);
-	    }
 	for (TInt i = 0; i < aLen; i++)
 		{
 		if (iReadBuf[i] != iWriteBuf[i])
 			{
 			TUSB_VERBOSE_PRINT1("Error: for i = %d:", i);
-			if(iVerbose)
-			    {
-			    OstTrace1(TRACE_VERBOSE, CACTIVERW_COMPAREBUFFERS_DUP01, "Error: for i = %d:", i);
-			    }
 			TUSB_VERBOSE_PRINT2("iReadBuf: %d != iWriteBuf: %d",
 								iReadBuf[i], iWriteBuf[i]);
-			if(iVerbose)
-			    {
-			    OstTraceExt2(TRACE_VERBOSE, CACTIVERW_COMPAREBUFFERS_DUP02, "iReadBuf: %d != iWriteBuf: %d",
-								iReadBuf[i], iWriteBuf[i]);
-			    }
 			return EFalse;
 			}
 		}
@@ -2083,10 +1730,6 @@
 CActiveStallNotifier::~CActiveStallNotifier()
 	{
 	TUSB_VERBOSE_PRINT("CActiveStallNotifier::~CActiveStallNotifier()");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVESTALLNOTIFIER_DCACTIVESTALLNOTIFIER, "CActiveStallNotifier::~CActiveStallNotifier()");
-	    }
 	Cancel();												// base class
 	}
 
@@ -2094,10 +1737,6 @@
 void CActiveStallNotifier::DoCancel()
 	{
 	TUSB_VERBOSE_PRINT("CActiveStallNotifier::DoCancel()");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVESTALLNOTIFIER_DOCANCEL, "CActiveStallNotifier::DoCancel()");
-	    }
 	iPort->EndpointStatusNotifyCancel();
 	}
 
@@ -2108,10 +1747,6 @@
 	// In a real world program, the user could take here appropriate action (cancel a
 	// transfer request or whatever).
 	TUSB_VERBOSE_PRINT1("StallNotifier: Endpointstate 0x%x\n", iEndpointState);
-	if(iVerbose)
-	    {
-	    OstTrace1(TRACE_VERBOSE, CACTIVESTALLNOTIFIER_RUNL, "StallNotifier: Endpointstate 0x%x\n", iEndpointState);
-	    }
 	Activate();
 	}
 
@@ -2157,10 +1792,6 @@
 CActiveDeviceStateNotifier::~CActiveDeviceStateNotifier()
 	{
 	TUSB_VERBOSE_PRINT("CActiveDeviceStateNotifier::~CActiveDeviceStateNotifier()");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVEDEVICESTATENOTIFIER_DCACTIVEDEVICESTATENOTIFIER, "CActiveDeviceStateNotifier::~CActiveDeviceStateNotifier()");
-	    }
 	Cancel();												// base class
 	}
 
@@ -2168,10 +1799,6 @@
 void CActiveDeviceStateNotifier::DoCancel()
 	{
 	TUSB_VERBOSE_PRINT("CActiveDeviceStateNotifier::DoCancel()");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVEDEVICESTATENOTIFIER_DOCANCEL, "CActiveDeviceStateNotifier::DoCancel()");
-	    }
 	iPort->AlternateDeviceStatusNotifyCancel();
 	}
 
@@ -2187,43 +1814,33 @@
 			{
 		case EUsbcDeviceStateUndefined:
 			TUSB_PRINT("Device State notifier: Undefined");
-			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL, "Device State notifier: Undefined");
 			break;
 		case EUsbcDeviceStateAttached:
 			TUSB_PRINT("Device State notifier: Attached");
-			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP01, "Device State notifier: Attached");
 			break;
 		case EUsbcDeviceStatePowered:
 			TUSB_PRINT("Device State notifier: Powered");
-			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP02, "Device State notifier: Powered");
 			break;
 		case EUsbcDeviceStateDefault:
 			TUSB_PRINT("Device State notifier: Default");
-			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP03, "Device State notifier: Default");
 			break;
 		case EUsbcDeviceStateAddress:
 			TUSB_PRINT("Device State notifier: Address");
-			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP04, "Device State notifier: Address");
 			break;
 		case EUsbcDeviceStateConfigured:
 			TUSB_PRINT("Device State notifier: Configured");
-			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP05, "Device State notifier: Configured");
 			break;
 		case EUsbcDeviceStateSuspended:
 			TUSB_PRINT("Device State notifier: Suspended");
-			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP06, "Device State notifier: Suspended");
 			break;
 		default:
 			TUSB_PRINT("Device State notifier: ***BAD***");
-			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP07, "Device State notifier: ***BAD***");
 			}
 		}
 	else if (iDeviceState & KUsbAlternateSetting)
 		{
 		TUSB_PRINT1("Device State notifier: Alternate interface setting has changed: now %d",
 					iDeviceState & ~KUsbAlternateSetting);
-		OstTrace1(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP08, "Device State notifier: Alternate interface setting has changed: now %d",
-					iDeviceState & ~KUsbAlternateSetting);
 		}
 
 	Activate();
@@ -2273,10 +1890,6 @@
 CActiveTimer::~CActiveTimer()
 	{
 	TUSB_VERBOSE_PRINT("CActiveTimer::~CActiveTimer()");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVETIMER_DCACTIVETIMER, "CActiveTimer::~CActiveTimer()");
-	    }
 	Cancel();												// base class
 	iTimer.Close();
 	}
@@ -2285,10 +1898,6 @@
 void CActiveTimer::DoCancel()
 	{
 	TUSB_VERBOSE_PRINT("CActiveTimer::DoCancel()");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVETIMER_DOCANCEL, "CActiveTimer::DoCancel()");
-	    }
 	iTimer.Cancel();
 	}
 
@@ -2296,10 +1905,6 @@
 void CActiveTimer::RunL()
 	{
 	TUSB_VERBOSE_PRINT("CActiveTimer::RunL()");
-	if(iVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVETIMER_RUNL, "CActiveTimer::RunL()");
-	    }
 	// Nothing to do here, as we call ReadCancel() after a manual WaitForRequest()
 	// (in CActiveRW::ReceiveVersion()).
 	}
--- a/kerneltest/e32test/device/t_usbcsc.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/device/t_usbcsc.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,10 +24,6 @@
 #include "t_usblib.h"
 #include <e32svr.h>
 #include "u32std.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "t_usbcscTraces.h"
-#endif
 
 //#define DEBUGVERSION
 
@@ -313,19 +309,14 @@
 	TUsbcScChunkHeader chunkHeader(gChunk);
 
 	DEBUGPRINT(test.Printf(_L("iBuffers at 0x%x, iAltSettings at 0x%x\n"),chunkHeader.iBuffers, chunkHeader.iAltSettings));
-	DEBUGPRINT(OstTraceExt2(TRACE_NORMAL, TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION, "iBuffers at 0x%x, iAltSettings at 0x%x\n",chunkHeader.iBuffers, chunkHeader.iAltSettings));
 
 	test_Equal(gChunk.Base()+ sizeof(TUint)*2, chunkHeader.iBuffers);
 
 	DEBUGPRINT(test.Printf(_L("iBuffers: EP0Out: 0x%x EP0In: 0x%x\n"), chunkHeader.iBuffers->Ep0Out()->Offset(),  
 																	chunkHeader.iBuffers->Ep0In()->Offset()));
-	DEBUGPRINT(OstTraceExt2(TRACE_NORMAL, TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION_DUP01, "iBuffers: EP0Out: 0x%x EP0In: 0x%x\n", chunkHeader.iBuffers->Ep0Out()->Offset(),  
-																	chunkHeader.iBuffers->Ep0In()->Offset()));
  													
 	DEBUGPRINT(test.Printf(_L("iAltSettings: Number of: %d First offset: 0x%x \n"), chunkHeader.iAltSettings->iNumOfAltSettings,  
 																	chunkHeader.iAltSettings->iAltTableOffset[0]));
-	DEBUGPRINT(OstTraceExt2(TRACE_NORMAL, TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION_DUP02, "iAltSettings: Number of: %d First offset: 0x%x \n", chunkHeader.iAltSettings->iNumOfAltSettings,  
-																	chunkHeader.iAltSettings->iAltTableOffset[0]));
 	
 	test_Compare(aAltSetConfig->iNumOfAltSet, ==, chunkHeader.iAltSettings->iNumOfAltSettings);
 
@@ -334,7 +325,6 @@
 		{
 		TInt inEps = 0, outEps = 0;
 		DEBUGPRINT(test.Printf(_L("Alternate Setting %d offset: 0x%x \n"), i, chunkHeader.iAltSettings->iAltTableOffset[i]));
-		DEBUGPRINT(OstTraceExt2(TRACE_NORMAL, TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION_DUP03, "Alternate Setting %d offset: 0x%x \n", i, chunkHeader.iAltSettings->iAltTableOffset[i]));
 
 		TInt8* endpoint = (TInt8*) (chunkHeader.iAltSettings->iAltTableOffset[i] + (TInt) gChunk.Base());
 		for (int j = 1; j <= chunkHeader.GetNumberOfEndpoints(i); j++)
@@ -342,8 +332,6 @@
 			TUsbcScHdrEndpointRecord* endpointInf = (TUsbcScHdrEndpointRecord*) &(endpoint[j * chunkHeader.iAltSettings->iEpRecordSize]);
 			DEBUGPRINT(test.Printf(_L("Endpoint %d owns buffer %d BufferOffset 0x%x Dir %d Type %d\n"), j, endpointInf->iBufferNo, chunkHeader.iBuffers->Buffers(endpointInf->iBufferNo)->Offset(), 
 						endpointInf->Direction(), endpointInf->Type()));
-			DEBUGPRINT(OstTraceExt5(TRACE_NORMAL, TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION_DUP04, "Endpoint %d owns buffer %d BufferOffset 0x%x Dir %d Type %d\n", j, endpointInf->iBufferNo, chunkHeader.iBuffers->Buffers(endpointInf->iBufferNo)->Offset(), 
-						endpointInf->Direction(), endpointInf->Type()));
 			if (endpointInf->Direction() == KUsbScHdrEpDirectionOut)
 				{
 				outEps++;
@@ -356,8 +344,6 @@
 
 		DEBUGPRINT(test.Printf(_L("Test if Alternate Setting %d  has %d endpoints (%d Out Endpoint(s) and %d In Endpoint(s)) \n"), i, aAltSetConfig->iEpsDesc[i].iNumOfEp,
 				aAltSetConfig->iEpsDesc[i].iNumOfOutEp, aAltSetConfig->iEpsDesc[i].iNumOfInEp));
-		DEBUGPRINT(OstTraceExt4(TRACE_NORMAL, TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION_DUP05, "Test if Alternate Setting %d  has %d endpoints (%d Out Endpoint(s) and %d In Endpoint(s)) \n", i, aAltSetConfig->iEpsDesc[i].iNumOfEp,
-				aAltSetConfig->iEpsDesc[i].iNumOfOutEp, aAltSetConfig->iEpsDesc[i].iNumOfInEp));
 
 		test_Compare(chunkHeader.GetNumberOfEndpoints(i), ==, aAltSetConfig->iEpsDesc[i].iNumOfEp);
 		test_Compare(outEps, ==, aAltSetConfig->iEpsDesc[i].iNumOfOutEp);
@@ -398,7 +384,6 @@
 void CActiveConsole::GetCharacter()
 	{
 	test.Printf(_L("\n \n ***** Press Escape to exit ***** \n \n"));
-	OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_GETCHARACTER, "\n \n ***** Press Escape to exit ***** \n \n");
 
 	test.Console()->Read(iStatus);
 	SetActive();
@@ -407,18 +392,15 @@
 void CActiveConsole::DoCancel()
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveConsole::DoCancel\n")));
-	DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_DOCANCEL, "CActiveConsole::DoCancel\n"));
 	test.Console()->ReadCancel();
 	}
 
 void CActiveConsole::RunL()
 	{
 	DEBUGPRINT(test.Printf(_L("\n CActiveConsole::RunL\n")));
-	DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_RUNL, "\n CActiveConsole::RunL\n"));
 	if (test.Console()->KeyCode() == EKeyEscape)
 		{
 		test.Printf(_L("CActiveConsole: ESC key pressed -> stopping active scheduler...\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONSOLE_RUNL_DUP01, "CActiveConsole: ESC key pressed -> stopping active scheduler...\n");
 		CActiveScheduler::Stop();
 		return;
 		}
@@ -430,21 +412,18 @@
 	: CActive(EPriorityHigh)
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveDeviceStateNotifier::CActiveDeviceStateNotifier() \n")));
-	DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_CACTIVEDEVICESTATENOTIFIER, "CActiveDeviceStateNotifier::CActiveDeviceStateNotifier() \n"));
 	CActiveScheduler::Add(this);
 	}
 
 CActiveDeviceStateNotifier::~CActiveDeviceStateNotifier()
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveDeviceStateNotifier::~CActiveDeviceStateNotifier() \n")));
-	DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_DCACTIVEDEVICESTATENOTIFIER, "CActiveDeviceStateNotifier::~CActiveDeviceStateNotifier() \n"));
 	Cancel();
 	}
 
 void CActiveDeviceStateNotifier::DoCancel()
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveDeviceStateNotifier::DoCancel\n")));
-	DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_DOCANCEL, "CActiveDeviceStateNotifier::DoCancel\n"));
 	gPort.AlternateDeviceStatusNotifyCancel();
 	}
 
@@ -457,50 +436,39 @@
 void CActiveDeviceStateNotifier::RunL()
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveDeviceStateNotifier::RunL() \n")));
-	DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL, "CActiveDeviceStateNotifier::RunL() \n"));
 	if (!(iDeviceState & KUsbAlternateSetting))
 		{
 		switch (iDeviceState)
 			{
 		case EUsbcDeviceStateUndefined:
 			DEBUGPRINT(test.Printf(_L("Device State notifier: Undefined \n")));
-			DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP01, "Device State notifier: Undefined \n"));
 			break;
 		case EUsbcDeviceStateAttached:
 			DEBUGPRINT(test.Printf(_L("Device State notifier: Attached \n")));
-			DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP02, "Device State notifier: Attached \n"));
 			break;
 		case EUsbcDeviceStatePowered:
 			DEBUGPRINT(test.Printf(_L("Device State notifier: Powered \n")));
-			DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP03, "Device State notifier: Powered \n"));
 			break;
 		case EUsbcDeviceStateDefault:
 			DEBUGPRINT(test.Printf(_L("Device State notifier: Default \n")));
-			DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP04, "Device State notifier: Default \n"));
 			break;
 		case EUsbcDeviceStateAddress:
 			DEBUGPRINT(test.Printf(_L("Device State notifier: Address \n")));
-			DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP05, "Device State notifier: Address \n"));
 			break;
 		case EUsbcDeviceStateConfigured:
 			DEBUGPRINT(test.Printf(_L("Device State notifier: Configured \n")));
-			DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP06, "Device State notifier: Configured \n"));
 			break;
 		case EUsbcDeviceStateSuspended:
 			DEBUGPRINT(test.Printf(_L("Device State notifier: Suspended \n")));
-			DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP07, "Device State notifier: Suspended \n"));
 			break;
 		default:
 			DEBUGPRINT(test.Printf(_L("Device State notifier: !!!! NOT RECOGNISED !!!! \n")));
-			DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP08, "Device State notifier: !!!! NOT RECOGNISED !!!! \n"));
 			}
 		}
 	else if (iDeviceState & KUsbAlternateSetting)
 		{
 		test.Printf(_L("Device State notifier: Alternate interface setting has changed: now %d \n"),
 					iDeviceState & ~KUsbAlternateSetting);
-		OstTrace1(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP09, "Device State notifier: Alternate interface setting has changed: now %d \n",
-					iDeviceState & ~KUsbAlternateSetting);
 		}
 	Activate();
 	}
@@ -512,30 +480,25 @@
 	  iEndpointState(0)
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveStallNotifier::CActiveStallNotifier() \n")));
-	DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVESTALLNOTIFIER_CACTIVESTALLNOTIFIER, "CActiveStallNotifier::CActiveStallNotifier() \n"));
 	CActiveScheduler::Add(this);
 	}
 
 CActiveStallNotifier::~CActiveStallNotifier()
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveStallNotifier::~CActiveStallNotifier() \n")));
-	DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVESTALLNOTIFIER_DCACTIVESTALLNOTIFIER, "CActiveStallNotifier::~CActiveStallNotifier() \n"));
 	Cancel();
 	}
 
 void CActiveStallNotifier::DoCancel()
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveStallNotifier::DoCancel() \n")));
-	DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVESTALLNOTIFIER_DOCANCEL, "CActiveStallNotifier::DoCancel() \n"));
 	gPort.EndpointStatusNotifyCancel();
 	}
 
 void CActiveStallNotifier::RunL()
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveStallNotifier::RunL() \n")));
-	DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVESTALLNOTIFIER_RUNL, "CActiveStallNotifier::RunL() \n"));
 	test.Printf(_L("StallNotifier Endpointstate 0x%x\n"), iEndpointState);
-	OstTrace1(TRACE_NORMAL, CACTIVESTALLNOTIFIER_RUNL_DUP01, "StallNotifier Endpointstate 0x%x\n", iEndpointState);
 	Activate();
 	}
 
@@ -560,7 +523,6 @@
 TInterface::~TInterface()
 	{
 	DEBUGPRINT(test.Printf(_L("TInterface::~TInterface()\n")));
-	DEBUGPRINT(OstTrace0(TRACE_NORMAL, TINTERFACE_DTINTERFACE, "TInterface::~TInterface()\n"));
 	iAlternateSetting.Reset();
 	}
 
@@ -576,7 +538,6 @@
 		{
 		IncrementAltSettingChangeSequenceNum();
 		test.Printf(_L("ALTERNATE SETTING CHANGE! Calling StartNextInAlternateSetting() \n"));
-		OstTrace0(TRACE_NORMAL, TINTERFACE_SETACTIVEALTERNATESETTING, "ALTERNATE SETTING CHANGE! Calling StartNextInAlternateSetting() \n");
 		TInt r = gPort.StartNextInAlternateSetting();
 		test_Compare((r&0xFFFF), ==, aSettingNum);
 		}
@@ -602,7 +563,6 @@
 TAlternateSetting::~TAlternateSetting()
 	{
 	DEBUGPRINT(test.Printf(_L("TAlternateSetting::~TAlternateSetting() \n")));
-	DEBUGPRINT(OstTrace0(TRACE_NORMAL, TALTERNATESETTING_DTALTERNATESETTING, "TAlternateSetting::~TAlternateSetting() \n"));
 	iEndpoints.Reset();
 	}
 
@@ -649,10 +609,8 @@
 		}
 
 	if (gSpecTest == EAltSet)
-	    {
 		test.Printf(_L("On host side, on the Interface Tab, Change to a differnt Alternate Setting and read or write from an endpoint in the new alternate setting \n\n"));
-		OstTrace0(TRACE_NORMAL, TALTERNATESETTING_ACTIVATE, "On host side, on the Interface Tab, Change to a differnt Alternate Setting and read or write from an endpoint in the new alternate setting \n\n");
-        }
+
 	if (aStartNextInAltSet)
 		{
 		iEndpoints[0].iSettingChangeReceived = EFalse;
@@ -693,8 +651,6 @@
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveRW::QueueRequests() for Buffer number iBufNum %d AlternateSetting %d iDirection %d\n"),
 												iBuffer->iBufNum, iAltSetting->GetAlternateSetting(), iDirection));
-	DEBUGPRINT(OstTraceExt3(TRACE_NORMAL, CACTIVERW_QUEUEREQUESTS, "CActiveRW::QueueRequests() for Buffer number iBufNum %d AlternateSetting %d iDirection %d\n",
-												iBuffer->iBufNum, iAltSetting->GetAlternateSetting(), iDirection));
 	if (!IsActive())
 		{
 		if (iDirection != KUsbScHdrEpDirectionIn)
@@ -713,7 +669,6 @@
 void TAlternateSetting::SetChangeRequestFlag(CActiveRW *aEp)
 	{
 	DEBUGPRINT(test.Printf(_L("Set ChangeRequestFlag to True for Buffer Number = %d \n"), aEp->iBuffer->iBufNum));
-	DEBUGPRINT(OstTrace1(TRACE_NORMAL, TALTERNATESETTING_SETCHANGEREQUESTFLAG, "Set ChangeRequestFlag to True for Buffer Number = %d \n", aEp->iBuffer->iBufNum));
 
 	TInt countOfEndpoints = iEndpoints.Count();
 
@@ -762,7 +717,6 @@
 CActiveRW::~CActiveRW()
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveRW::~CActiveRW\n")));
-	DEBUGPRINT(OstTrace0(TRACE_NORMAL, CACTIVERW_DCACTIVERW, "CActiveRW::~CActiveRW\n"));
 	Cancel();
 	}
 
@@ -770,8 +724,6 @@
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveRW::DoCancel for Buffer number iBufNum %d AlternateSetting %d\n"),
 												iBuffer->iBufNum, iAltSetting->GetAlternateSetting()));
-	DEBUGPRINT(OstTraceExt2(TRACE_NORMAL, CACTIVERW_DOCANCEL, "CActiveRW::DoCancel for Buffer number iBufNum %d AlternateSetting %d\n",
-												iBuffer->iBufNum, iAltSetting->GetAlternateSetting()));
 	if (IsActive())
 		{
 		if (iDirection == KUsbScHdrEpDirectionOut)
@@ -877,7 +829,6 @@
 		TUsbcScChunkHeader chunkHeader(gChunk);
 		
 		test.Printf(_L("\n \n Trying hardware\nPlease start the Host side application...\n"));
-		OstTrace0(TRACE_NORMAL, TESTBUFFERHANDLING_TESTBUFFERHANDLING, "\n \n Trying hardware\nPlease start the Host side application...\n");
 
 		TRequestStatus status;
 		gPort.ReEnumerate(status);
@@ -888,7 +839,6 @@
 		if (r != KErrNone)
 			{
 			test.Printf(_L("Error %d on querying device state"), r);
-			OstTrace1(TRACE_NORMAL, TESTBUFFERHANDLING_TESTBUFFERHANDLING_DUP01, "Error %d on querying device state", r);
 			}
 		else
 			{
@@ -901,15 +851,6 @@
 							((device_state == EUsbcDeviceStateConfigured) ? _S("Configured") :
 							 ((device_state == EUsbcDeviceStateSuspended) ? _S("Suspended") :
 							  _S("Unknown")))))))));
-			DEBUGPRINT(OstTraceExt1(TRACE_NORMAL, TESTBUFFERHANDLING_TESTBUFFERHANDLING_DUP02, "Current device state: %s \n",
-						(device_state == EUsbcDeviceStateUndefined) ? _L("Undefined") :
-						((device_state == EUsbcDeviceStateAttached) ? _L("Attached") :
-						 ((device_state == EUsbcDeviceStatePowered) ? _L("Powered") :
-						  ((device_state == EUsbcDeviceStateDefault) ? _L("Default") :
-						   ((device_state == EUsbcDeviceStateAddress) ? _L("Address") :
-							((device_state == EUsbcDeviceStateConfigured) ? _L("Configured") :
-							 ((device_state == EUsbcDeviceStateSuspended) ? _L("Suspended") :
-							  _L("Unknown")))))))));
 			}
 
 		CActiveScheduler* myScheduler = new (ELeave) CActiveScheduler();
@@ -965,8 +906,6 @@
 				TUsbcScHdrEndpointRecord* endpointInf = (TUsbcScHdrEndpointRecord*) &(iEp[epNum * chunkHeader.iAltSettings->iEpRecordSize]);
 				DEBUGPRINT(test.Printf(_L("Endpoint %d owns buffer %d BufferOffset 0x%x Dir %d Type %d\n"), epNum, endpointInf->iBufferNo, chunkHeader.iBuffers->Buffers(endpointInf->iBufferNo)->Offset(), 
 							endpointInf->Direction(), endpointInf->Type()));
-				DEBUGPRINT(OstTraceExt5(TRACE_NORMAL, TESTBUFFERHANDLING_TESTBUFFERHANDLING_DUP03, "Endpoint %d owns buffer %d BufferOffset 0x%x Dir %d Type %d\n", epNum, endpointInf->iBufferNo, chunkHeader.iBuffers->Buffers(endpointInf->iBufferNo)->Offset(), 
-							endpointInf->Direction(), endpointInf->Type()));
 				CActiveRW *EndpointRW = new CActiveRW(epNum, endpointInf->Direction(), bufferArray[endpointInf->iBufferNo]);
 				alternateSetting->AddEndpoint(*EndpointRW);
 				array[count++] = EndpointRW;
@@ -980,10 +919,8 @@
 //		User::After(2000000);
 		
 		test.Printf(_L("Cleaning Up \n"));
-		OstTrace0(TRACE_NORMAL, USER_AFTER, "Cleaning Up \n");
 	
 		test.Printf(_L("Delete endpoint array \n"));
-		OstTrace0(TRACE_NORMAL, USER_AFTER_DUP01, "Delete endpoint array \n");
 		for(TInt i = 0;  i < count; i++)
 			{
 			delete array[i];
@@ -991,7 +928,6 @@
 		delete [] array;
 
 		test.Printf(_L("Delete altset array \n"));
-		OstTrace0(TRACE_NORMAL, USER_AFTER_DUP02, "Delete altset array \n");
 		for (TInt i = 0; i < number; i++)
 			{
 			delete altSetArray[i];
@@ -1001,13 +937,11 @@
 		delete interface1;
 	
 		test.Printf(_L("Delete buffer array \n"));
-		OstTrace0(TRACE_NORMAL, USER_AFTER_DUP03, "Delete buffer array \n");
 		for(TInt i = 0; i < chunkHeader.iBuffers->NumberOfBuffers(); i++)
 			{
 			delete bufferArray[i];
 			}
 		test.Printf(_L("Delete buffer ep0 \n"));
-		OstTrace0(TRACE_NORMAL, USER_AFTER_DUP04, "Delete buffer ep0 \n");
 		delete bufferEp0;
 	
 		delete myEndpointStateNotifier;
@@ -1017,7 +951,6 @@
 	__UHEAP_MARKEND;
 
 		test.Printf(_L("Uninstalling scheduler \n"));
-		OstTrace0(TRACE_NORMAL, USER_AFTER_DUP05, "Uninstalling scheduler \n");
 
 		CActiveScheduler::Install(NULL); // Uninstalling the scheduler
 		delete myScheduler;			
@@ -1074,13 +1007,11 @@
 		data[i]=testString[strPos];
 		}
 	test.Printf(_L("Sending data....."));
-	OstTrace0(TRACE_NORMAL, TBUFFER_SENDEP0PACKET, "Sending data.....");
 	// copy data into buffer TO DO
 	gPort.WriteData(KUsbcScEndpointZero,  iBufferOffset, aLength, 0, iEndpoint->iStatus);
 	User::WaitForRequest(iEndpoint->iStatus);
 	test_KErrNone(iEndpoint->iStatus.Int());
 	test.Printf(_L("Sent!\n"));
-	OstTrace0(TRACE_NORMAL, TBUFFER_SENDEP0PACKET_DUP01, "Sent!\n");
 	}
 
 _LIT(KUndefined,"Undefined"); _LIT(KAttached,"KAttached"); _LIT(KPowered,"KPowered"); _LIT(KDefault,"Default");
@@ -1091,8 +1022,6 @@
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveRW::SetUpHeader() for Buffer %d belonging to Endpoint %d in Alternate Setting %d \n"), 
 								iBufNum, iEndpoint->GetEndpointNumber(), iEndpoint->GetAlternateSettingOfEndpoint()));
-	DEBUGPRINT(OstTraceExt3(TRACE_NORMAL, TBUFFER_SETUPHEADER, "CActiveRW::SetUpHeader() for Buffer %d belonging to Endpoint %d in Alternate Setting %d \n", 
-								iBufNum, iEndpoint->GetEndpointNumber(), iEndpoint->GetAlternateSettingOfEndpoint()));
 	TUsbcScChunkHeader chunkHeader(gChunk);
 	TUsbcScHdrEndpointRecord* epInfo;
 
@@ -1113,11 +1042,9 @@
 
 			iMaxBufferSize = chunkHeader.iBuffers->Ep0Out()->Size();
 			DEBUGPRINT(test.Printf(_L("MaxBufferSize %d \n"), iMaxBufferSize));
-			DEBUGPRINT(OstTrace1(TRACE_NORMAL, TBUFFER_SETUPHEADER_DUP01, "MaxBufferSize %d \n", iMaxBufferSize));
 
 			TUint ep0MaxPacketSize = gPort.EndpointZeroMaxPacketSizes();
 			DEBUGPRINT(test.Printf(_L("ep0 Max Packet Size = %d\n"), ep0MaxPacketSize));
-			DEBUGPRINT(OstTrace1(TRACE_NORMAL, TBUFFER_SETUPHEADER_DUP02, "ep0 Max Packet Size = %d\n", ep0MaxPacketSize));
 
 			iMaxPacketSize = (ep0MaxPacketSize == KUsbEpSize64) ? 64 :
 				((ep0MaxPacketSize == KUsbEpSize32) ? 32 :
@@ -1126,10 +1053,7 @@
 				
 			test_Compare(iMaxPacketSize,>,0);
 			if (gSpecTest == EEp0)
-				{
 				test.Printf(_L("Writing from buffer %d \n On host side, on the Class or Vendor Request Tab, send a Vendor request from an Interface on Device-to-Host or Host-to-Device(to an Interface) \n\n"), iBufNum);
-				OstTrace1(TRACE_NORMAL, TBUFFER_SETUPHEADER_DUP03, "Writing from buffer %d \n On host side, on the Class or Vendor Request Tab, send a Vendor request from an Interface on Device-to-Host or Host-to-Device(to an Interface) \n\n", iBufNum);
-				}
 			iEndpoint->QueueRequests();
 			}
 		}
@@ -1143,7 +1067,6 @@
 		iMaxPacketSize = EpSize(endpointSizeDescriptor[KEpDesc_PacketSizeOffset], endpointSizeDescriptor[KEpDesc_PacketSizeOffset+1]);
 		test_Compare(iMaxPacketSize,>,0);
 		DEBUGPRINT(test.Printf(_L("Endpoint %d Max Packet Size = %d\n"), iEndpoint->GetEndpointNumber(), iMaxPacketSize));
-		DEBUGPRINT(OstTraceExt2(TRACE_NORMAL, TBUFFER_SETUPHEADER_DUP04, "Endpoint %d Max Packet Size = %d\n", iEndpoint->GetEndpointNumber(), iMaxPacketSize));
 	
 		if (iEndpoint->GetDirection() == KUsbScHdrEpDirectionOut)
 			{
@@ -1157,10 +1080,7 @@
  				iMaxBufferSize = buff->Size();
 
 				if (gSpecTest == EBufRead)
-					{
 					test.Printf(_L("Reading from buffer %d \n On host side, on the Pipes Tab, please select endpoint %d and read from a file and send to pipe\n"), iBufNum, iEndpoint->GetEndpointNumber());
-					OstTraceExt2(TRACE_NORMAL, TBUFFER_SETUPHEADER_DUP05, "Reading from buffer %d \n On host side, on the Pipes Tab, please select endpoint %d and read from a file and send to pipe\n", iBufNum, iEndpoint->GetEndpointNumber());
-					}
 				iEndpoint->QueueRequests();
 				}
 			}
@@ -1187,10 +1107,7 @@
 					}
 				buffer[iLength-1] = '$'; 
 				if (gSpecTest == EBufWrite)
-					{
 					test.Printf(_L("Writing from buffer %d \n On host side, on the Pipes Tab, please select endpoint %d and read from pipe and write to file \n"), iBufNum, iEndpoint->GetEndpointNumber());
-					OstTraceExt2(TRACE_NORMAL, TBUFFER_SETUPHEADER_DUP06, "Writing from buffer %d \n On host side, on the Pipes Tab, please select endpoint %d and read from pipe and write to file \n", iBufNum, iEndpoint->GetEndpointNumber());
-					}
 				iEndpoint->QueueRequests();
 				}
 			}
@@ -1216,8 +1133,6 @@
 	{
 	DEBUGPRINT(test.Printf(_L("CActiveRW::RunL for Buffer number iBufNum %d AlternateSetting %d iDirection %d\n"),
 												iBuffer->iBufNum, iAltSetting->GetAlternateSetting(), iDirection));
-	DEBUGPRINT(OstTraceExt3(TRACE_NORMAL, CACTIVERW_RUNL, "CActiveRW::RunL for Buffer number iBufNum %d AlternateSetting %d iDirection %d\n",
-												iBuffer->iBufNum, iAltSetting->GetAlternateSetting(), iDirection));
 	test_Compare(IsActive(), ==, EFalse);
 	if ((iLogicalEndpointNum == 0) || (iDirection == KUsbScHdrEpDirectionOut))	//RunL for ReadData
 		{
@@ -1253,7 +1168,6 @@
 		if (iStatus.Int() != KErrCancel)
 			{
 			test.Printf(_L("%c"), sym[iBuffer->iBufNum]);
-			OstTraceExt1(TRACE_NORMAL, CACTIVERW_RUNL_DUP01, "%c", sym[iBuffer->iBufNum]);
 			StartWrite();
 			}
 		}
@@ -1265,11 +1179,9 @@
 	iOldTail = iHeader->iTail;
 
 	DEBUGPRINT(test.Printf(_L("iHeader->iTail 0x%x, iHeader->iHead 0x%x \n"), iHeader->iTail, iHeader->iHead));
-	DEBUGPRINT(OstTraceExt2(TRACE_NORMAL, TBUFFER_PROCESSDATA, "iHeader->iTail 0x%x, iHeader->iHead 0x%x \n", iHeader->iTail, iHeader->iHead));
 	if (iHeader->iTail == iHeader->iHead)
 		{
 			test.Printf(_L("No data after available, but returned.  iHead 0x%x \n"),iHeader->iHead);
-			OstTrace1(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP01, "No data after available, but returned.  iHead 0x%x \n",iHeader->iHead);
 			test(0);
 		}
 	
@@ -1285,14 +1197,9 @@
 				iEp0Phase=EReady;
 				gPort.SendEp0StatusPacket();
 				if (iTransfer->iBytes) {test.Printf(_L("EP0 Data: "));}
-				if (iTransfer->iBytes) {OstTrace0(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP02, "EP0 Data: ");}
 				for (TUint ii=0; ii<iTransfer->iBytes; ii++)
-					{
 					test.Printf(_L(" 0x%2x "),iTransfer->iData.b[ii]);
-					OstTrace1(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP03, " 0x%2x ",iTransfer->iData.b[ii]);
-					}
 				test.Printf(_L("\n\n"));
-				OstTrace0(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP04, "\n\n");
 				}
 			else
 				{
@@ -1300,23 +1207,19 @@
 					{
 					TInt s = *iTransfer->iData.i;
 					test.Printf(_L("STATE CHANGE! %d : %S \n"),s,((s<0) || (s>7))?KStates[8]:KStates[s]);
-					OstTraceExt2(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP05, "STATE CHANGE! %d : %S \n",s,((s<0) || (s>7))?(*KStates[8]):(*KStates[s]));
 					}
 				else
 					{
 					iSetup = (Sep0SetupPacket* ) iTransfer->iData.b;
 					test.Printf(_L("EP0 Command: t %x r %x v %x i %x l %x :"), iSetup->iRequestType, iSetup->iRequest, iSetup->iwValue, iSetup->iwIndex, iSetup->iWlength);
-					OstTraceExt5(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP06, "EP0 Command: t %x r %x v %x i %x l %x :", iSetup->iRequestType, iSetup->iRequest, iSetup->iwValue, iSetup->iwIndex, iSetup->iWlength);
 					if ((iSetup->iRequestType&KDeviceToHost))// && (iSetup->iWlength>0)) //Temp To do remove
 						{
 						test.Printf(_L("EP0 Command: Device to Host\n"));
-						OstTrace0(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP07, "EP0 Command: Device to Host\n");
 						SendEP0Packet(iSetup->iWlength);
 						}
 					else
 						{
 						test.Printf(_L("EP0 Command: Host to Device.  0x%x bytes\n"), iSetup->iWlength);
-						OstTrace1(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP08, "EP0 Command: Host to Device.  0x%x bytes\n", iSetup->iWlength);
 						iEp0Phase=EDataIn;
 						}
 					}
@@ -1327,7 +1230,6 @@
 			if ((++iTickCount)>100)
 				{
 				test.Printf(_L("%c"), sym[iBufNum]);
-				OstTraceExt1(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP09, "%c", sym[iBufNum]);
 				iTickCount=0;
 				}
 			}
@@ -1335,11 +1237,9 @@
 	else
 		{
 		test.Printf(_L("Empty Transfer received for buffer Num = %d  as = %d\n"), iBufNum, iTransfer->iAltSetting);
-		OstTraceExt2(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP10, "Empty Transfer received for buffer Num = %d  as = %d\n", iBufNum, iTransfer->iAltSetting);
 		if (iPrevAltSeq  >= iTransfer->iAltSettingSeq)
 			{
 			test.Printf(_L("Empty Transfer *WAS NOT* an alt setting change!\n"));
-			OstTrace0(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP11, "Empty Transfer *WAS NOT* an alt setting change!\n");
 			iPrevAltSeq = iTransfer->iAltSettingSeq;
 			}
 		}
@@ -1350,10 +1250,7 @@
 			{
 			DEBUGPRINT(test.Printf(_L("Current Alternate Setting of Endpoint = %d iTransfer->iAltSetting = %d iTransfer->iAltSettingSeq = %d \n"), 
 								iEndpoint->GetAlternateSettingOfEndpoint(), iTransfer->iAltSetting, iTransfer->iAltSettingSeq));
-			DEBUGPRINT(OstTraceExt3(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP12, "Current Alternate Setting of Endpoint = %d iTransfer->iAltSetting = %d iTransfer->iAltSettingSeq = %d \n", 
-								iEndpoint->GetAlternateSettingOfEndpoint(), iTransfer->iAltSetting, iTransfer->iAltSettingSeq));
 			test.Printf(_L("Empty Transfer received for buffer Num = %d \n"), iBufNum);
-			OstTrace1(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP13, "Empty Transfer received for buffer Num = %d \n", iBufNum);
 			test_Compare(iEndpoint->GetInterfaceAltSettingChangeSequenceNum(), +1== , iTransfer->iAltSettingSeq);
 
 
@@ -1379,12 +1276,10 @@
 			//Function checks if alternate setting change request flag for all endpoints of this Alternate Setting is set to true
 			TBool settingRequestReceivedForAllEps = iEndpoint->CheckFlagForAllOutEndpoints();
 			DEBUGPRINT(test.Printf(_L("SettingRequestReceivedForAllEps = %d \n"),settingRequestReceivedForAllEps));
-			DEBUGPRINT(OstTrace1(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP14, "SettingRequestReceivedForAllEps = %d \n",settingRequestReceivedForAllEps));
 			if(settingRequestReceivedForAllEps)
 				{
 				// change alternative setting
 				test.Printf(_L("AS!\n"));
-				OstTrace0(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP15, "AS!\n");
 				iEndpoint->CallChangeAlternateSetting(iTransfer->iAltSetting);
 				}
 			}
@@ -1401,7 +1296,6 @@
 				{
 				test_Compare((TInt) (iTransfer->iNext), >=,   startOfBuf );
 				DEBUGPRINT(test.Printf(_L("Endpoint Buffer of size %d is filled. Next transfer from Start of Buffer \n"), iMaxBufferSize));
-				DEBUGPRINT(OstTrace1(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP16, "Endpoint Buffer of size %d is filled. Next transfer from Start of Buffer \n", iMaxBufferSize));
 				}	
 
 			//Checking that no data or information goes beyond the end address of the buffer
@@ -1423,7 +1317,6 @@
 				test_Compare(iHeader->iTail, >=,  startOfBuf);
 				}
 			DEBUGPRINT(test.Printf(_L("Previous Sequence Number 0x%x Current Sequence Number 0x%x \n"), iPrevSequence, iTransfer->iSequence));
-			DEBUGPRINT(OstTraceExt2(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP17, "Previous Sequence Number 0x%x Current Sequence Number 0x%x \n", iPrevSequence, iTransfer->iSequence));
 			test_Compare((iTransfer->iSequence - iPrevSequence), ==, 1);
 			iPrevSequence = iTransfer->iSequence;
 #endif
@@ -1435,27 +1328,18 @@
 				test.Printf(_L("Recieved packet Hash ID 0x%x Sequence Number 0x%x Bytes 0x%x Flags 0x%x Next 0x%x Alternate Setting Seq 0x%x  Current Alternate Setting 0x%x \n"), 
 				iTransfer->iHashId,iTransfer->iSequence, iTransfer->iBytes, iTransfer->iFlags, iTransfer->iNext, 
 				iTransfer->iAltSettingSeq, iTransfer->iAltSetting);
-				OstTraceExt5(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP18, "Recieved packet Hash ID 0x%x Sequence Number 0x%x Bytes 0x%x Flags 0x%x Next 0x%x ", 
-				iTransfer->iHashId,iTransfer->iSequence, iTransfer->iBytes, iTransfer->iFlags, iTransfer->iNext);
-				OstTraceExt2(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP22, "Alternate Setting Seq 0x%x  Current Alternate Setting 0x%x \n", 
-				iTransfer->iAltSettingSeq, iTransfer->iAltSetting);
 #else
 				test.Printf(_L("Recieved packet Bytes 0x%x Flags 0x%x Next 0x%x Alternate Setting Seq 0x%x  Current Alternate Setting 0x%x \n"), 
 				iTransfer->iBytes, iTransfer->iFlags,
 				iTransfer->iNext, iTransfer->iAltSettingSeq, iTransfer->iAltSetting );
-				OstTraceExt5(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP19, "Recieved packet Bytes 0x%x Flags 0x%x Next 0x%x Alternate Setting Seq 0x%x  Current Alternate Setting 0x%x \n", 
-				iTransfer->iBytes, iTransfer->iFlags,
-				iTransfer->iNext, (TUint)iTransfer->iAltSettingSeq, (TUint)iTransfer->iAltSetting );
 #endif
 				if (gVerbose>1)
 					{
 					for (TUint ii=0; ii<iTransfer->iBytes; ii++)
 						{
 						test.Printf(_L(" %c "),iTransfer->iData.b[ii]);
-						OstTraceExt1(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP20, " %c ",iTransfer->iData.b[ii]);
 						}
 					test.Printf(_L("\n"));
-					OstTrace0(TRACE_NORMAL, TBUFFER_PROCESSDATA_DUP21, "\n");
 					}
 				} // if verbose
 
@@ -1508,20 +1392,17 @@
 	if (gRealHardware)
 		{		
 		test.Printf(_L("\n\n Trying hardware\nPlease start the Host side application...\n"));
-		OstTrace0(TRACE_NORMAL, TESTCANCEL_TESTCANCEL, "\n\n Trying hardware\nPlease start the Host side application...\n");
 
 
 		gPort.ReEnumerate(status);
 		User::WaitForRequest(status);
 		test.Printf(_L("Enumerated status = %d\n"), status.Int());
-		OstTrace1(TRACE_NORMAL, TESTCANCEL_TESTCANCEL_DUP01, "Enumerated status = %d\n", status.Int());
 	
 		test.Next(_L("ReadCancel Test after enumeration\n"));
 		do  // Drain out all data in buffer first, then queue cancel
 			{
 			r = gPort.ReadDataNotify(outBuffNum,status);
 			DEBUGPRINT(test.Printf(_L("header->iTail 0x%x header->iHead 0x%x\n"), header->iTail, header->iHead));
-			DEBUGPRINT(OstTraceExt2(TRACE_NORMAL, TESTCANCEL_TESTCANCEL_DUP02, "header->iTail 0x%x header->iHead 0x%x\n", header->iTail, header->iHead));
 			transfer = (TUsbcScTransferHeader*) (header->iTail + base);
 			header->iTail = transfer->iNext;
 			}
@@ -1535,7 +1416,6 @@
 		test.Next(_L("WriteCancel Test after enumeration\n"));
 
 		test.Printf(_L("Generating test data %x %d\n"), buffer, inBuffNum);
-		OstTraceExt2(TRACE_NORMAL, TESTCANCEL_TESTCANCEL_DUP03, "Generating test data %x %d\n", (TUint)buffer, inBuffNum);
 		for (TUint i=0; i<length; i++)
 			{
 			buffer[i]=i;
@@ -1614,7 +1494,6 @@
 
 	// Testing with invalid buffer values
 	test.Printf(_L("Test Buffer Writing with invalid buffer values\n"));
-	OstTrace0(TRACE_NORMAL, TESTINVALIDAPI_TESTINVALIDAPI, "Test Buffer Writing with invalid buffer values\n");
 	gPort.WriteData(out_buf,  bufferOffset, length, 0, status);
 	User::WaitForRequest(status);
 	test_Compare(status.Int(), ==, KErrArgument);
@@ -1629,7 +1508,6 @@
 /*
 	// Unaligned argument 
 	test.Printf(_L("Test Buffer Writing with invalid buffer offsets\n"));
-	OstTrace0(TRACE_NORMAL, TESTINVALIDAPI_TESTINVALIDAPI_DUP01, "Test Buffer Writing with invalid buffer offsets\n");
 	gPort.WriteData(in_buf,  bufferOffset + sizeof(TUint), length, 0,status);
 	User::WaitForRequest(status);
 	test_Compare(status.Int(), ==, KErrArgument);
@@ -1670,12 +1548,10 @@
 	test_KErrNone(r);		
 	
 	test.Printf(_L("Release Interface %d\n"), --altSetNo);
-	OstTrace1(TRACE_NORMAL, TESTSETINTERFACE_TESTSETINTERFACE, "Release Interface %d\n", --altSetNo);
 	r = gPort.ReleaseInterface(altSetNo);
 	test_Compare(r, !=, KErrNone);				
 
 	test.Printf(_L("Release Interface %d\n"), ++altSetNo);
-	OstTrace1(TRACE_NORMAL, TESTSETINTERFACE_TESTSETINTERFACE_DUP01, "Release Interface %d\n", ++altSetNo);
 	r = gPort.ReleaseInterface(altSetNo);					
 	test_KErrNone(r);
 	
@@ -1691,7 +1567,6 @@
 
 	// Should not be allowed to release Interface once Chunk Realized
 	test.Printf(_L("Release Interface %d \n"), altSetNo);
-	OstTrace1(TRACE_NORMAL, TESTSETINTERFACE_TESTSETINTERFACE_DUP02, "Release Interface %d \n", altSetNo);
 	r = gPort.ReleaseInterface(altSetNo);
 	test_Compare(r, ==, KErrUsbAlreadyRealized);	
 	CloseChannel();
@@ -1763,7 +1638,6 @@
 	altSetConfig->iEpsDesc[0] = temp; //{2,1,1};
 
 	test.Printf(_L("Check chunk still populated with one interface\n")); 
-	OstTrace0(TRACE_NORMAL, TESTSETINTERFACE_TESTSETINTERFACE_DUP03, "Check chunk still populated with one interface\n"); 
 	TestBufferConstruction(altSetConfig);
 
 	CloseChannel();
@@ -1782,7 +1656,6 @@
 	test_Compare(r, !=, KErrNone);		
 
 	test.Printf(_L("Check chunk still populated with one interface \n")); 
-	OstTrace0(TRACE_NORMAL, TESTSETINTERFACE_TESTSETINTERFACE_DUP04, "Check chunk still populated with one interface \n"); 
 	TestBufferConstruction(altSetConfig);
 
 	CloseChannel();
@@ -1800,7 +1673,6 @@
 	altSetConfig->iEpsDesc[0] = temp2; //{0,0,0};
 	
 	test.Printf(_L("Check chunk not populated with any valid data as all interfaces would be destroyed \n")); 
-	OstTrace0(TRACE_NORMAL, TESTSETINTERFACE_TESTSETINTERFACE_DUP05, "Check chunk not populated with any valid data as all interfaces would be destroyed \n"); 
 	TestBufferConstruction(altSetConfig);
 
 	CloseChannel();
@@ -1859,35 +1731,21 @@
 	gSupportsHighSpeed = d_caps().iHighSpeed;
 
 	test.Printf(_L("USB device capabilities:\n"));
-	OstTrace0(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES, "USB device capabilities:\n");
 	test.Printf(_L("Number of endpoints:                %d\n"), numOfEndPoints);
-	OstTrace1(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP01, "Number of endpoints:                %d\n", numOfEndPoints);
 	test.Printf(_L("Supports Software-Connect:          %s\n"),
 				d_caps().iConnect ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP02, "Supports Software-Connect:          %s\n",
-				d_caps().iConnect ? _L("yes") : _L("no"));
 	test.Printf(_L("Device is Self-Powered:             %s\n"),
 				d_caps().iSelfPowered ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP03, "Device is Self-Powered:             %s\n",
-				d_caps().iSelfPowered ? _L("yes") : _L("no"));
 	test.Printf(_L("Supports Remote-Wakeup:             %s\n"),
 				d_caps().iRemoteWakeup ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP04, "Supports Remote-Wakeup:             %s\n",
-				d_caps().iRemoteWakeup ? _L("yes") : _L("no"));
 	test.Printf(_L("Supports High-speed:                %s\n"),
 				gSupportsHighSpeed ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP05, "Supports High-speed:                %s\n",
-				gSupportsHighSpeed ? _L("yes") : _L("no"));
 	test.Printf(_L("Supports unpowered cable detection: %s\n"),
 				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ?
 				_S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP06, "Supports unpowered cable detection: %s\n",
-				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ?
-				_L("yes") : _L("no"));
 
 	test_Compare(numOfEndPoints, >=, 2);
 	test.Printf(_L("(Device has sufficient endpoints.)\n"));
-	OstTrace0(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP07, "(Device has sufficient endpoints.)\n");
 		
 	// Endpoint caps
 	test.Next(_L("Query USB endpoint caps"));
@@ -1897,7 +1755,6 @@
 	test_KErrNone(r);
 
 	test.Printf(_L("USB device endpoint capabilities:\n"));
-	OstTrace0(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP08, "USB device endpoint capabilities:\n");
 
 	TInt dir;
 	for (TInt i = 0; i < numOfEndPoints; i++)
@@ -1906,48 +1763,32 @@
 		dir = caps->iTypesAndDir;
 		test.Printf(_L("Endpoint: SizeBf= 0x%08x Type/Dir= 0x%08x"),
 					caps->iSizes, dir);
-		OstTraceExt2(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP09, "Endpoint: SizeBf= 0x%08x Type/Dir= 0x%08x",
-					caps->iSizes, dir);
 		
 		if (dir&KUsbEpDirIn)
-		    {
 			test.Printf(_L(" In "));
-			OstTrace0(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP10, " In ");
-			}
 		if (dir&KUsbEpDirOut)
-		    {
 			test.Printf(_L(" Out"));
-			OstTrace0(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP11, " Out");
-			}
 		if (dir&KUsbEpDirBidirect)
-			{
 			test.Printf(_L(" Bi "));
-			OstTrace0(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP12, " Bi ");
-			}
 
 		if (dir&KUsbEpTypeControl)
 			{
 			test.Printf(_L(" Control"));
-			OstTrace0(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP13, " Control");
 			}
 		if (dir&KUsbEpTypeIsochronous)
 			{
 			test.Printf(_L(" Isochronus"));
-			OstTrace0(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP14, " Isochronus");
 			}
 		if (dir&KUsbEpTypeBulk)
 			{
 			test.Printf(_L(" Bulk"));		
-			OstTrace0(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP15, " Bulk");		
 			}
 		if (dir&KUsbEpTypeInterrupt)
 			{
 			test.Printf(_L(" Interrupt"));
-			OstTrace0(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP16, " Interrupt");
 			}
 
 		test.Printf(_L("\n"));
-		OstTrace0(TRACE_NORMAL, CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP17, "\n");
 
 		if (caps->iHighBandwidth)
 			{
@@ -1965,7 +1806,6 @@
 TInt SettingOne(TInt aAltSetNo)
 	{
 	test.Printf(_L("RTEST: Interigate Endpoint Capabilities (S1)\n"));
-	OstTrace0(TRACE_NORMAL, SETTINGONE_SETTINGONE, "RTEST: Interigate Endpoint Capabilities (S1)\n");
 	TInt r;
 	TUsbcScInterfaceInfoBuf ifc;
 	// Endpoint 0
@@ -1978,7 +1818,6 @@
 	ifc().iEndpointData[1].iSize = KUsbEpSize64;
 	
 	test.Printf(_L("RTEST: Setting up interface %d with two endpoints (s1)\n"), aAltSetNo);
-	OstTrace1(TRACE_NORMAL, SETTINGONE_SETTINGONE_DUP01, "RTEST: Setting up interface %d with two endpoints (s1)\n", aAltSetNo);
 	_LIT16(string, "T_USBCSC Test Interface");
 	ifc().iString = const_cast<TDesC16*>(&string);
 	ifc().iTotalEndpointsUsed = 2;
@@ -1996,7 +1835,6 @@
 TInt SettingTwo(TInt aAltSetNo)
 	{
 	test.Printf(_L("RTEST: Interigate Endpoint Capabilities (S2)\n"));
-	OstTrace0(TRACE_NORMAL, SETTINGTWO_SETTINGTWO, "RTEST: Interigate Endpoint Capabilities (S2)\n");
 	TUsbcScInterfaceInfoBuf ifc;
 	TInt ep_found = 0; 
 	if (gInterruptInEpFound)
@@ -2026,7 +1864,6 @@
 		} while (++ep_found < 5);
 	
 	test.Printf(_L("Setting up interface %d with Five Endpoints (s2)\n"), aAltSetNo);
-	OstTrace1(TRACE_NORMAL, SETTINGTWO_SETTINGTWO_DUP01, "Setting up interface %d with Five Endpoints (s2)\n", aAltSetNo);
 	_LIT16(string, "T_USBSC API Test Interface");
 	ifc().iString = const_cast<TDesC16*>(&string);
 	ifc().iTotalEndpointsUsed = ep_found;
@@ -2041,7 +1878,6 @@
 TInt SettingThreeIn(TInt aAltSetNo)
 	{
 	test.Printf(_L("RTEST: Interigate Endpoint Capabilities (S3)\n"));
-	OstTrace0(TRACE_NORMAL, SETTINGTHREEIN_SETTINGTHREEIN, "RTEST: Interigate Endpoint Capabilities (S3)\n");
 	TInt r;
 	TUsbcScInterfaceInfoBuf ifc;
 	TInt ep_found = 0; 
@@ -2053,7 +1889,6 @@
 		} while (++ep_found < 3);
 	
 	test.Printf(_L("Setting up interface %d with three Bulk In endpoints(s3)\n"), aAltSetNo);
-	OstTrace1(TRACE_NORMAL, SETTINGTHREEIN_SETTINGTHREEIN_DUP01, "Setting up interface %d with three Bulk In endpoints(s3)\n", aAltSetNo);
 	_LIT16(string, "T_USBCSC Test Interface");
 	ifc().iString = const_cast<TDesC16*>(&string);
 	ifc().iTotalEndpointsUsed = ep_found;
@@ -2069,7 +1904,6 @@
 TInt SettingFourOut(TInt aAltSetNo)
 	{
 	test.Printf(_L("RTEST: Interigate Endpoint Capabilities (S4)\n"));
-	OstTrace0(TRACE_NORMAL, SETTINGFOUROUT_SETTINGFOUROUT, "RTEST: Interigate Endpoint Capabilities (S4)\n");
 	TInt r;
 	TUsbcScInterfaceInfoBuf ifc;
 	TInt ep_found = 0; 
@@ -2081,7 +1915,6 @@
 		} while (++ep_found < 3);
 	
 	test.Printf(_L("Setting up interface %d with three Bulk Out endpoints(s4)\n"), aAltSetNo);
-	OstTrace1(TRACE_NORMAL, SETTINGFOUROUT_SETTINGFOUROUT_DUP01, "Setting up interface %d with three Bulk Out endpoints(s4)\n", aAltSetNo);
 	_LIT16(string, "T_USBCSC Test Interface");
 	ifc().iString = const_cast<TDesC16*>(&string);
 	ifc().iTotalEndpointsUsed = ep_found;
@@ -2097,7 +1930,6 @@
 TInt SettingFive(TInt aAltSetNo)
 	{
 	test.Printf(_L("RTEST: Interigate Endpoint Capabilities (S5)\n"));
-	OstTrace0(TRACE_NORMAL, SETTINGFIVE_SETTINGFIVE, "RTEST: Interigate Endpoint Capabilities (S5)\n");
 	TUsbcScInterfaceInfoBuf ifc;
 	TInt ep_found = 0; 
 	if (gInterruptInEpFound)
@@ -2133,7 +1965,6 @@
 	ifc().iEndpointData[ep_found].iSize  = KUsbEpSize64;
 	
 	test.Printf(_L("Setting up interface %d with Five Endpoints(s5)\n"), aAltSetNo);
-	OstTrace1(TRACE_NORMAL, SETTINGFIVE_SETTINGFIVE_DUP01, "Setting up interface %d with Five Endpoints(s5)\n", aAltSetNo);
 	_LIT16(string, "T_USBSC API Test Interface");
 	ifc().iString = const_cast<TDesC16*>(&string);
 	ifc().iTotalEndpointsUsed = ep_found;
@@ -2150,7 +1981,6 @@
 									   // and will however return with an error, not because we are requesting one more than what is available of an interrupt endpoint
 	{
 	test.Printf(_L("RTEST: Interigate Endpoint Capabilities (I1)\n"));
-	OstTrace0(TRACE_NORMAL, INVALIDSETTINGONE_INVALIDSETTINGONE, "RTEST: Interigate Endpoint Capabilities (I1)\n");
 	TUsbcScInterfaceInfoBuf ifc;
 	TInt interruptInEpFound = gInterruptInEpFound + 1;
 
@@ -2182,7 +2012,6 @@
 									   //Only control endpoints are bi-directional. Request any other type which has bidirectional capability.
 	{
 	test.Printf(_L("RTEST: Interigate Endpoint Capabilities (I2)\n"));
-	OstTrace0(TRACE_NORMAL, INVALIDSETTINGTWO_INVALIDSETTINGTWO, "RTEST: Interigate Endpoint Capabilities (I2)\n");
 
 	TUsbcScInterfaceInfoBuf ifc;
 	// Endpoint 0
@@ -2210,7 +2039,6 @@
 TInt InvalidSettingThree(TInt aAltSetNo)
 	{
 	test.Printf(_L("RTEST: Interigate Endpoint Capabilities (I3)\n"));
-	OstTrace0(TRACE_NORMAL, INVALIDSETTINGTHREE_INVALIDSETTINGTHREE, "RTEST: Interigate Endpoint Capabilities (I3)\n");
 	TInt r;
 	TUsbcScInterfaceInfoBuf ifc;
 	TInt ep_found = 0; 
@@ -2228,7 +2056,6 @@
 		} while (++ep_found < 5);
 	
 	test.Printf(_L("RTEST: Setting up interface %d, with invalid setting three (I3).\n"), aAltSetNo);
-	OstTrace1(TRACE_NORMAL, INVALIDSETTINGTHREE_INVALIDSETTINGTHREE_DUP01, "RTEST: Setting up interface %d, with invalid setting three (I3).\n", aAltSetNo);
 	_LIT16(string, "T_USBCSC Test Interface");
 	ifc().iString = const_cast<TDesC16*>(&string);
 	ifc().iTotalEndpointsUsed = ep_found+1;
@@ -2297,7 +2124,6 @@
 	if (!gSupportsHighSpeed)
 		{
 		test.Printf(_L("*** Not supported - skipping Device_Qualifier descriptor tests\n"));
-		OstTrace0(TRACE_NORMAL, TESTDEVICEQUALIFIERDESCRIPTOR_TESTDEVICEQUALIFIERDESCRIPTOR, "*** Not supported - skipping Device_Qualifier descriptor tests\n");
 		test.End();
 		return;
 		}
@@ -2373,7 +2199,6 @@
 	if (!gSupportsHighSpeed)
 		{
 		test.Printf(_L("*** Not supported - skipping Other_Speed_Configuration desc tests\n"));
-		OstTrace0(TRACE_NORMAL, TESTOTHERSPEEDCONFIGURATIONDESCRIPTOR_TESTOTHERSPEEDCONFIGURATIONDESCRIPTOR, "*** Not supported - skipping Other_Speed_Configuration desc tests\n");
 		test.End();
 		return;
 		}
@@ -2506,7 +2331,6 @@
 	if (!SupportsAlternateInterfaces())
 		{
 		test.Printf(_L("*** Not supported - skipping alternate interface settings tests\n"));
-		OstTrace0(TRACE_NORMAL, TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION, "*** Not supported - skipping alternate interface settings tests\n");
 		test.End();
 		return;
 		}
@@ -2604,7 +2428,6 @@
 	if (!SupportsAlternateInterfaces())
 		{
 		test.Printf(_L("*** Not supported - skipping Extended Endpoint descriptor tests\n"));
-		OstTrace0(TRACE_NORMAL, TESTEXTENDEDENDPOINTDESCRIPTOR_TESTEXTENDEDENDPOINTDESCRIPTOR, "*** Not supported - skipping Extended Endpoint descriptor tests\n");
 		test.End();
 		return;
 		}
@@ -2654,7 +2477,6 @@
 	TInt r = gPort.GetStringDescriptorLangId(rd_langid_orig);
 	test_KErrNone(r);
 	test.Printf(_L("Original LANGID code: 0x%04X\n"), rd_langid_orig);
-	OstTrace1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS, "Original LANGID code: 0x%04X\n", rd_langid_orig);
 
 	test.Next(_L("SetStringDescriptorLangId()"));
 	TUint16 wr_langid = 0x0809;								// English (UK) Language ID
@@ -2668,7 +2490,6 @@
 	r = gPort.GetStringDescriptorLangId(rd_langid);
 	test_KErrNone(r);
 	test.Printf(_L("New LANGID code: 0x%04X\n"), rd_langid);
-	OstTrace1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP01, "New LANGID code: 0x%04X\n", rd_langid);
 
 	test.Next(_L("Compare LANGID codes"));
 	test(rd_langid == wr_langid);
@@ -2689,13 +2510,11 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Original Manufacturer string: \"%lS\"\n"), &rd_str_orig);
-		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP02, "Original Manufacturer string: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
 		{
 		test.Printf(_L("No Manufacturer string set\n"));
-		OstTrace0(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP03, "No Manufacturer string set\n");
 		restore_string = EFalse;
 		}
 
@@ -2710,7 +2529,6 @@
 	r = gPort.GetManufacturerStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Manufacturer string: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP04, "New Manufacturer string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Manufacturer strings"));
 	r = rd_str.Compare(wr_str);
@@ -2728,7 +2546,6 @@
 	r = gPort.GetManufacturerStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Manufacturer string: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP05, "New Manufacturer string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Manufacturer strings"));
 	r = rd_str.Compare(wr_str);
@@ -2759,7 +2576,6 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Old Product string: \"%lS\"\n"), &rd_str_orig);
-		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP06, "Old Product string: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
@@ -2777,7 +2593,6 @@
 	r = gPort.GetProductStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Product string: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP07, "New Product string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Product strings"));
 	r = rd_str.Compare(wr_str);
@@ -2795,7 +2610,6 @@
 	r = gPort.GetProductStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Product string: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP08, "New Product string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Product strings"));
 	r = rd_str.Compare(wr_str);
@@ -2826,7 +2640,6 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Old Serial Number: \"%lS\"\n"), &rd_str_orig);
-		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP09, "Old Serial Number: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
@@ -2844,7 +2657,6 @@
 	r = gPort.GetSerialNumberStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Serial Number: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP10, "New Serial Number: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Serial Number strings"));
 	r = rd_str.Compare(wr_str);
@@ -2862,7 +2674,6 @@
 	r = gPort.GetSerialNumberStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Serial Number: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP11, "New Serial Number: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Serial Number strings"));
 	r = rd_str.Compare(wr_str);
@@ -2893,7 +2704,6 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Old Configuration string: \"%lS\"\n"), &rd_str_orig);
-		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP12, "Old Configuration string: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
@@ -2911,7 +2721,6 @@
 	r = gPort.GetConfigurationStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Configuration string: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP13, "New Configuration string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Configuration strings"));
 	r = rd_str.Compare(wr_str);
@@ -2929,7 +2738,6 @@
 	r = gPort.GetConfigurationStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Configuration string: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP14, "New Configuration string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Configuration strings"));
 	r = rd_str.Compare(wr_str);
@@ -2980,7 +2788,6 @@
 	r = gPort.GetStringDescriptor(stridx1, rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New test string @ idx %d: \"%lS\"\n"), stridx1, &rd_str);
-	OstTraceExt2(TRACE_NORMAL, TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS, "New test string @ idx %d: \"%lS\"\n", stridx1, rd_str);
 
 	test.Next(_L("Compare test strings 1"));
 	r = rd_str.Compare(wr_str);
@@ -3018,7 +2825,6 @@
 	r = gPort.GetStringDescriptor(stridx2, rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New test string @ idx %d: \"%lS\"\n"), stridx2, &rd_str);
-	OstTraceExt2(TRACE_NORMAL, TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS_DUP01, "New test string @ idx %d: \"%lS\"\n", stridx2, rd_str);
 
 	test.Next(_L("Compare test strings 2"));
 	r = rd_str.Compare(wr_str);
@@ -3041,7 +2847,6 @@
 	r = gPort.GetStringDescriptor(stridx3, rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New test string @ idx %d: \"%lS\"\n"), stridx3, &rd_str);
-	OstTraceExt2(TRACE_NORMAL, TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS_DUP02, "New test string @ idx %d: \"%lS\"\n", stridx3, rd_str);
 
 	test.Next(_L("Compare test strings 3"));
 	r = rd_str.Compare(wr_str);
@@ -3082,10 +2887,6 @@
 				(ep_state == EEndpointStateNotStalled) ? _S("Not stalled") :
 				((ep_state == EEndpointStateStalled) ? _S("Stalled") :
 				 _S("Unknown...")));
-	OstTraceExt2(TRACE_NORMAL, QUERYENDPOINTSTATE_QUERYENDPOINTSTATE, "Endpoint %d state: %s\n", aEndpoint,
-				(ep_state == EEndpointStateNotStalled) ? _L("Not stalled") :
-				((ep_state == EEndpointStateStalled) ? _L("Stalled") :
-				 _L("Unknown...")));
 	return ep_state;
 	}
 
@@ -3096,7 +2897,6 @@
 	if (!SupportsEndpointStall())
 		{
 		test.Printf(_L("*** Not supported - skipping endpoint stall status tests\n"));
-		OstTrace0(TRACE_NORMAL, TESTENDPOINTSTALLSTATUS_TESTENDPOINTSTALLSTATUS, "*** Not supported - skipping endpoint stall status tests\n");
 		test.End();
 		return;
 		}
@@ -3151,12 +2951,10 @@
 		if ((epStateBitmap & (1 << i)) == EEndpointStateNotStalled)
 			{
 			test.Printf(_L("EndpointStatusNotify: Ep %d NOT STALLED\n"), i);
-			OstTrace1(TRACE_NORMAL, TESTENDPOINTSTATUSNOTIFY_TESTENDPOINTSTATUSNOTIFY, "EndpointStatusNotify: Ep %d NOT STALLED\n", i);
 			}
 		else
 			{
 			test.Printf(_L("EndpointStatusNotify: Ep %d STALLED\n"), i);
-			OstTrace1(TRACE_NORMAL, TESTENDPOINTSTATUSNOTIFY_TESTENDPOINTSTATUSNOTIFY_DUP01, "EndpointStatusNotify: Ep %d STALLED\n", i);
 			}
 		}
 
@@ -3179,7 +2977,6 @@
 		{
 		TUint setting = (deviceState & ~KUsbAlternateSetting);
 		test.Printf(_L("Alternate setting change to setting %d - unexpected"), setting);
-		OstTrace1(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY, "Alternate setting change to setting %d - unexpected", setting);
 		test(EFalse);
 		}
 	else
@@ -3188,40 +2985,31 @@
 			{
 		case EUsbcDeviceStateUndefined:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Undefined state\n"));
-			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP01, "TestAlternateDeviceStatusNotify: Undefined state\n");
 			break;
 		case EUsbcDeviceStateAttached:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Attached state\n"));
-			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP02, "TestAlternateDeviceStatusNotify: Attached state\n");
 			break;
 		case EUsbcDeviceStatePowered:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Powered state\n"));
-			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP03, "TestAlternateDeviceStatusNotify: Powered state\n");
 			break;
 		case EUsbcDeviceStateDefault:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Default state\n"));
-			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP04, "TestAlternateDeviceStatusNotify: Default state\n");
 			break;
 		case EUsbcDeviceStateAddress:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Address state\n"));
-			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP05, "TestAlternateDeviceStatusNotify: Address state\n");
 			break;
 		case EUsbcDeviceStateConfigured:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Configured state\n"));
-			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP06, "TestAlternateDeviceStatusNotify: Configured state\n");
 			break;
 		case EUsbcDeviceStateSuspended:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Suspended state\n"));
-			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP07, "TestAlternateDeviceStatusNotify: Suspended state\n");
 			break;
 		case EUsbcNoState:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: State buffering error\n"));
-			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP08, "TestAlternateDeviceStatusNotify: State buffering error\n");
 			test(EFalse);
 			break;
 		default:
 			test.Printf(_L("TestAlternateDeviceStatusNotify: Unknown state\n"));
-			OstTrace0(TRACE_NORMAL, TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP09, "TestAlternateDeviceStatusNotify: Unknown state\n");
 			test(EFalse);
 			}
 		}
@@ -3353,7 +3141,6 @@
 void SetupBulkInterfaces(TUint aInterfaceNo,TUint nReadEps, TUint nWriteEps)
 	{
 	test.Printf(_L("SetupBulkInterfaces: %d, %d, %d\n"),aInterfaceNo,nReadEps,nWriteEps);
-	OstTraceExt3(TRACE_NORMAL, SETUPBULKINTERFACES_SETUPBULKINTERFACES, "SetupBulkInterfaces: %u, %u, %u\n",aInterfaceNo,nReadEps,nWriteEps);
 	TUsbcScInterfaceInfoBuf ifc;
 	TUint i;
 	for(i=0; i<nWriteEps;i++)
@@ -3384,31 +3171,20 @@
 void PrintBILTestOptions()
 	{
 	test.Printf(_L("Select an option\n"));
-	OstTrace0(TRACE_NORMAL, PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS, "Select an option\n");
 	test.Printf(_L("1.Test BIL API\n"));	//unimplemented
-	OstTrace0(TRACE_NORMAL, PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP01, "1.Test BIL API\n");	//unimplemented
 	test.Printf(_L("2.Test BIL Read Write\n"));
-	OstTrace0(TRACE_NORMAL, PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP02, "2.Test BIL Read Write\n");
 	test.Printf(_L("3.Test EP0 using BIL API's\n"));
-	OstTrace0(TRACE_NORMAL, PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP03, "3.Test EP0 using BIL API's\n");
 	test.Printf(_L("4.Test AlternateSetting Change BIL API's\n"));	//unimplemented	
-	OstTrace0(TRACE_NORMAL, PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP04, "4.Test AlternateSetting Change BIL API's\n");	//unimplemented	
 	test.Printf(_L("5.Run All\n"));
-	OstTrace0(TRACE_NORMAL, PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP05, "5.Run All\n");
 	test.Printf(_L("6.Quit\n"));
-	OstTrace0(TRACE_NORMAL, PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP06, "6.Quit\n");
 	}
 
 void PrintWriteOptions()
 	{
 	test.Printf(_L("Select an option\n"));
-	OstTrace0(TRACE_NORMAL, PRINTWRITEOPTIONS_PRINTWRITEOPTIONS, "Select an option\n");
 	test.Printf(_L("1.Test single buffer write\n"));
-	OstTrace0(TRACE_NORMAL, PRINTWRITEOPTIONS_PRINTWRITEOPTIONS_DUP01, "1.Test single buffer write\n");
 	test.Printf(_L("2.Test double buffer write\n"));
-	OstTrace0(TRACE_NORMAL, PRINTWRITEOPTIONS_PRINTWRITEOPTIONS_DUP02, "2.Test double buffer write\n");
 	test.Printf(_L("3.Test multiple queing write\n"));
-	OstTrace0(TRACE_NORMAL, PRINTWRITEOPTIONS_PRINTWRITEOPTIONS_DUP03, "3.Test multiple queing write\n");
 	}
 
 
@@ -3435,31 +3211,18 @@
 	if(setup != NULL)
 		{
 		test.Printf(_L("EP0 command:\n"));
-		OstTrace0(TRACE_NORMAL, PRINTSETUPPKT_PRINTSETUPPKT, "EP0 command:\n");
 		test.Printf(_L("Direction: %S, "),KLitDirections[(setup->iRequestType>>KDirBit) & 0x1]);
-		OstTraceExt1(TRACE_NORMAL, PRINTSETUPPKT_PRINTSETUPPKT_DUP01, "Direction: %S, ",*KLitDirections[(setup->iRequestType>>KDirBit) & 0x1]);
 		test.Printf(_L("Request type: %S, "), KLitType[((setup->iRequestType>>KReqTypeBit) & 0x3)]);
-		OstTraceExt1(TRACE_NORMAL, PRINTSETUPPKT_PRINTSETUPPKT_DUP02, "Request type: %S, ", *KLitType[((setup->iRequestType>>KReqTypeBit) & 0x3)]);
 
 		if (setup->iRequestType & KRecepientReservedMask)
-			{
 			test.Printf(_L("Recepient: Unknown (0x%x), "), setup->iRequestType & KRecepientMask);
-			OstTrace1(TRACE_NORMAL, PRINTSETUPPKT_PRINTSETUPPKT_DUP03, "Recepient: Unknown (0x%x), ", setup->iRequestType & KRecepientMask);
-			}
 		else
-			{
 			test.Printf(_L("Recepient: %S\n"), KLitDest[(setup->iRequestType & KRecepientMask)]);
-			OstTraceExt1(TRACE_NORMAL, PRINTSETUPPKT_PRINTSETUPPKT_DUP04, "Recepient: %S\n", *KLitDest[(setup->iRequestType & KRecepientMask)]);
-			}
 
 		test.Printf(_L("bRequest:0x%x, "),setup->iRequest);
-		OstTrace1(TRACE_NORMAL, PRINTSETUPPKT_PRINTSETUPPKT_DUP05, "bRequest:0x%x, ",setup->iRequest);
 		test.Printf(_L("wValue:0x%x, "),setup->iwValue);
-		OstTrace1(TRACE_NORMAL, PRINTSETUPPKT_PRINTSETUPPKT_DUP06, "wValue:0x%x, ",setup->iwValue);
 		test.Printf(_L("wIndex:0x%x, "),setup->iwIndex);
-		OstTrace1(TRACE_NORMAL, PRINTSETUPPKT_PRINTSETUPPKT_DUP07, "wIndex:0x%x, ",setup->iwIndex);
 		test.Printf(_L("wLength:0x%x\n"),setup->iWlength);
-		OstTrace1(TRACE_NORMAL, PRINTSETUPPKT_PRINTSETUPPKT_DUP08, "wLength:0x%x\n",setup->iWlength);
 		}
 	}
 
@@ -3473,7 +3236,6 @@
 		aWriteBuf.Append(i);			//data is duplicated here in writebuffer and sc location, cant think of anyth better at the moment;
 		*(scBufferAddr) = i;
 		//test.Printf(_L("Addr:0x%x, data[i]:%d "),scBufferAddr,*(scBufferAddr));
-		//OstTraceExt2(TRACE_NORMAL, WRITEDATATOBUFFER_WRITEDATATOBUFFER, "Addr:0x%x, data[i]:%d ",scBufferAddr,*(scBufferAddr));
 		scBufferAddr += 1;
 		}	
 	}
@@ -3481,7 +3243,6 @@
 	{
 	TInt ret = KErrNone;
 	test.Printf(_L("TestBILWrite\n"));
-	OstTrace0(TRACE_NORMAL, BILWRITE_BILWRITE, "TestBILWrite\n");
 	TEndpointBuffer epBuf;
 	const TUint KWriteEp = 1;
 	TRequestStatus status;
@@ -3502,23 +3263,18 @@
 			case '1':
 				//case 1: Write a buffer fulll of data to USBIO demo app: Total data written- 1xBuffersize
 				test.Printf(_L("Length to be written: %d\n"),length);
-				OstTrace1(TRACE_NORMAL, BILWRITE_BILWRITE_DUP01, "Length to be written: %d\n",length);
 				WriteDataToBuffer(buffer,length,aWriteBuf);
 				//need to check allignment
 				test.Printf(_L("Data ready to be written out, Start 'read to file' on an IN endpoint onthe  USBIO demo application then press a key when ready to proceed\n"));
-				OstTrace0(TRACE_NORMAL, BILWRITE_BILWRITE_DUP02, "Data ready to be written out, Start 'read to file' on an IN endpoint onthe  USBIO demo application then press a key when ready to proceed\n");
 				test.Getch();
 				test_KErrNone(epBuf.WriteBuffer(buffer,length,ETrue,status));
 				//Note-Till here is common for all options and can be put in a common place. Repeating the code for the sake of better understanding
 				User::WaitForRequest(status);
 				if(gVerbose)
 					test.Printf(_L("Write status %d\n"),status.Int());
-					OstTrace1(TRACE_NORMAL, BILWRITE_BILWRITE_DUP03, "Write status %d\n",status.Int());
 				test_KErrNone(status.Int());
 				test.Printf(_L("Total bytes written:%d\n"),aWriteBuf.Length());
-				OstTrace1(TRACE_NORMAL, BILWRITE_BILWRITE_DUP04, "Total bytes written:%d\n",aWriteBuf.Length());
 				test.Printf(_L("Stop writing at the USBIO demo dialog window, Press a key to continue##\n"));
-				OstTrace0(TRACE_NORMAL, BILWRITE_BILWRITE_DUP05, "Stop writing at the USBIO demo dialog window, Press a key to continue##\n");
 				test.Getch();
 				break;
 
@@ -3526,7 +3282,6 @@
 				//case 2: Write a buffer fulll of data to USBIO demo app wait until it is written out, write a second buffer full of data: Total data written- 2xBuffersize
 				WriteDataToBuffer(buffer,length,aWriteBuf);
 				test.Printf(_L("Data ready to be written out, Start the write mode on USBIO demo application and press a key when ready to proceed\n"));
-				OstTrace0(TRACE_NORMAL, BILWRITE_BILWRITE_DUP06, "Data ready to be written out, Start the write mode on USBIO demo application and press a key when ready to proceed\n");
 				test.Getch();
 				ret = epBuf.WriteBuffer(buffer,length,EFalse,status);
 				test_KErrNone(ret);
@@ -3540,9 +3295,7 @@
 				test_KErrNone(status.Int());
 
 				test.Printf(_L("Total bytes written:%d\n"),aWriteBuf.Length());
-				OstTrace1(TRACE_NORMAL, BILWRITE_BILWRITE_DUP07, "Total bytes written:%d\n",aWriteBuf.Length());
 				test.Printf(_L("Stop writing at the USBIO demo dialog window,Press a key to continue\n"));
-				OstTrace0(TRACE_NORMAL, BILWRITE_BILWRITE_DUP08, "Stop writing at the USBIO demo dialog window,Press a key to continue\n");
 				test.Getch();
 				break;
 
@@ -3550,7 +3303,6 @@
 				//case 3: Write maxpacketsize (64 bytes) of data to USBIO demo app, queue remianing data in buffer (full buffer length-maxpacket size), wait for results: Total data written- 1xBuffersize
 				WriteDataToBuffer(buffer,64,aWriteBuf);
 				test.Printf(_L("Data ready to be written out, Start the write mode on USBIO demo application and press a key when ready to proceed\n"));
-				OstTrace0(TRACE_NORMAL, BILWRITE_BILWRITE_DUP09, "Data ready to be written out, Start the write mode on USBIO demo application and press a key when ready to proceed\n");
 				test.Getch();
 
 				ret = epBuf.WriteBuffer(buffer,64,EFalse,status1);
@@ -3566,9 +3318,7 @@
 				test_KErrNone(status2.Int());
 				
 				test.Printf(_L("Total bytes written: %d\n"),aWriteBuf.Length());
-				OstTrace1(TRACE_NORMAL, BILWRITE_BILWRITE_DUP10, "Total bytes written: %d\n",aWriteBuf.Length());
 				test.Printf(_L("Stop writing at the USBIO demo dialog window,Press a key to continue\n"));
-				OstTrace0(TRACE_NORMAL, BILWRITE_BILWRITE_DUP11, "Stop writing at the USBIO demo dialog window,Press a key to continue\n");
 				test.Getch();
 				break;
 				
@@ -3586,7 +3336,6 @@
 void BILRead(TDes8& aReadBuf)
 	{
 	test.Printf(_L("TestBILRead\n"));
-	OstTrace0(TRACE_NORMAL, BILREAD_BILREAD, "TestBILRead\n");
 	TEndpointBuffer epBuf;
 	const TUint KReadEp = 2;
 	TRequestStatus status;
@@ -3594,7 +3343,6 @@
 	//Open endpoint
 	gPort.OpenEndpoint(epBuf,KReadEp);
 	test.Printf(_L("Open endpoint results for read endpoint\n"));
-	OstTrace0(TRACE_NORMAL, BILREAD_BILREAD_DUP01, "Open endpoint results for read endpoint\n");
 
 	//call GetBuffer, loop as long as EoF is not received
 	TAny *readBuf;
@@ -3608,10 +3356,7 @@
 		TInt ret = KErrGeneral;
 		ret = epBuf.GetBuffer(readBuf,aSize,aZlp,status);
 		if(gVerbose)
-			{
 			test.Printf(_L("Getbuffer call returned %d, aSize: %d, aZlp: %d\n"),ret, aSize,aZlp);
-			OstTraceExt3(TRACE_NORMAL, BILREAD_BILREAD_DUP02, "Getbuffer call returned %d, aSize: %u, aZlp: %d\n",ret, aSize,aZlp);
-			}
 		
 		if(ret == KErrCompletion)
 			{
@@ -3623,7 +3368,6 @@
 			{
 			test_KErrNone(ret);
 			test.Printf(_L("Waiting for Data, Data read so far: %d\n"),aReadBuf.Length());
-			OstTrace1(TRACE_NORMAL, BILREAD_BILREAD_DUP03, "Waiting for Data, Data read so far: %d\n",aReadBuf.Length());
 			User::WaitForRequest(status);
 			}
 		}
@@ -3639,7 +3383,6 @@
 	if(wrLength != rdLength)
 		{
 		test.Printf(_L("Error: Disparity between length of data written and read back!"));
-		OstTrace0(TRACE_NORMAL, BILREAD_BILREAD_DUP04, "Error: Disparity between length of data written and read back!");
 		return EFalse;
 		}
 	for(TInt i=0; i < wrLength; i++)
@@ -3647,11 +3390,8 @@
 		if (aReadBuf[i] != aWriteBuf[i])
 			{
 			test.Printf(_L("Error: for i = %d:"), i);
-			OstTrace1(TRACE_NORMAL, BILREAD_BILREAD_DUP05, "Error: for i = %d:", i);
 			test.Printf(_L("aReadBuf: %d != aWriteBuf: %d"),
 								aReadBuf[i], aWriteBuf[i]);
-			OstTraceExt2(TRACE_NORMAL, BILREAD_BILREAD_DUP06, "aReadBuf: %d != aWriteBuf: %d",
-								aReadBuf[i], aWriteBuf[i]);
 			return EFalse;
 			}
 		}
@@ -3673,52 +3413,39 @@
 
 	test.Next(_L("TestBILReadWrite"));
 	test.Printf(_L("Open global USB channel"));
-	OstTrace0(TRACE_NORMAL, TESTBILREADWRITE_TESTBILREADWRITE, "Open global USB channel");
 	TInt r = gPort.Open(0);
 	test_KErrNone(r);
 	//Test for a simple interface with 2 endpoints
 	test.Printf(_L("Set up interface\n"));
-	OstTrace0(TRACE_NORMAL, TESTBILREADWRITE_TESTBILREADWRITE_DUP01, "Set up interface\n");
 	SetupBulkInterfaces(0,1,1);
 	RChunk *tChunk = &gChunk;
 	test.Printf(_L("Finalize Interface\n"));
-	OstTrace0(TRACE_NORMAL, TESTBILREADWRITE_TESTBILREADWRITE_DUP02, "Finalize Interface\n");
 	gPort.FinalizeInterface(tChunk);
 
 	if(gRealHardware)
 		{
 		test.Printf(_L("Please Start the USBIO demo application on the host side \n"));
-		OstTrace0(TRACE_NORMAL, TESTBILREADWRITE_TESTBILREADWRITE_DUP03, "Please Start the USBIO demo application on the host side \n");
 		gPort.ReEnumerate(status);
 		User::WaitForRequest(status);
 		test.Printf(_L("Enumerated. status = %d\n"), status.Int());
-		OstTrace1(TRACE_NORMAL, TESTBILREADWRITE_TESTBILREADWRITE_DUP04, "Enumerated. status = %d\n", status.Int());
 		test.Printf(_L("The following test attempts to write data to the host application. USBIO demo application is used on the PC side.\
 						Using USBIO demo app, user should capture data to a file. When prompted, use USBIO application to send the recorded file back to device.\
 						The device side application will compare the data and show the result\n"));
-		OstTrace0(TRACE_NORMAL, TESTBILREADWRITE_TESTBILREADWRITE_DUP05, "The following test attempts to write data to the host application. USBIO demo application is used on the PC side."\
-						L"Using USBIO demo app, user should capture data to a file. When prompted, use USBIO application to send the recorded file back to device."\
-						L"The device side application will compare the data and show the result\n");
 		test.Printf(_L("Test Write using BIL apis\n"));
-		OstTrace0(TRACE_NORMAL, TESTBILREADWRITE_TESTBILREADWRITE_DUP06, "Test Write using BIL apis\n");
 		BILWrite(iWriteBuf);
 	
 		test.Printf(_L("Test Read using BIL api's\n"));
-		OstTrace0(TRACE_NORMAL, TESTBILREADWRITE_TESTBILREADWRITE_DUP07, "Test Read using BIL api's\n");
 		BILRead(iReadBuf);
 
 		test.Printf(_L("Compare Read and Write buffers\n"));
-		OstTrace0(TRACE_NORMAL, TESTBILREADWRITE_TESTBILREADWRITE_DUP08, "Compare Read and Write buffers\n");
 		TBool ret = CompareBuffs(iReadBuf, iWriteBuf);
 		if(!ret)
 			{
 			test.Printf(_L("!!warning- compare buffers found discrepancies!\n"));
-			OstTrace0(TRACE_NORMAL, TESTBILREADWRITE_TESTBILREADWRITE_DUP09, "!!warning- compare buffers found discrepancies!\n");
 			}
 		}
 	gChunk.Close();
 	test.Printf(_L("Close global USB channel\n"));
-	OstTrace0(TRACE_NORMAL, TESTBILREADWRITE_TESTBILREADWRITE_DUP10, "Close global USB channel\n");
 	gPort.Close();
 	}
 
@@ -3729,19 +3456,15 @@
 
 	test.Next(_L("BIL Alternate Setting Change"));
 	test.Printf(_L("Open global USB channel"));
-	OstTrace0(TRACE_NORMAL, TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE, "Open global USB channel");
 	TInt r = gPort.Open(0);
 	test_KErrNone(r);
 	//Test for a simple interface with 2 endpoints
 	test.Printf(_L("Set up interface 0\n"));
-	OstTrace0(TRACE_NORMAL, TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE_DUP01, "Set up interface 0\n");
 	SetupBulkInterfaces(0,1,1);
 	test.Printf(_L("Set up interface 1\n"));
-	OstTrace0(TRACE_NORMAL, TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE_DUP02, "Set up interface 1\n");
 	SetupBulkInterfaces(1,1,1);
 	RChunk *tChunk = &gChunk;
 	test.Printf(_L("Finalize Interface\n"));
-	OstTrace0(TRACE_NORMAL, TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE_DUP03, "Finalize Interface\n");
 	gPort.FinalizeInterface(tChunk);
 
 	if(gRealHardware)
@@ -3749,11 +3472,9 @@
 		gPort.ReEnumerate(status);
 		User::WaitForRequest(status);
 		test.Printf(_L("Enumerated. status = %d\n"), status.Int());
-		OstTrace1(TRACE_NORMAL, TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE_DUP04, "Enumerated. status = %d\n", status.Int());
 		}
 	gChunk.Close();
 	test.Printf(_L("Close global USB channel\n"));
-	OstTrace0(TRACE_NORMAL, TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE_DUP05, "Close global USB channel\n");
 	gPort.Close();
 	}
 
@@ -3780,7 +3501,6 @@
 	if(gRealHardware)
 		{
 		test.Printf(_L("With USBIO, open and configure the device, then send then and then recieve at lest 4 class/vendor requests to interface 0\n"));
-		OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0, "With USBIO, open and configure the device, then send then and then recieve at lest 4 class/vendor requests to interface 0\n");
 
 		TBool passed=EFalse;
 		TBool error=EFalse;
@@ -3819,10 +3539,8 @@
 				if (test.Console()->KeyCode() == EKeyEscape)
 					break;
 				else
-					{
 					test.Printf(_L("Press escape to end EP0 testing\n"));	
-					OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP01, "Press escape to end EP0 testing\n");	
-					}
+
 				test.Console()->Read(keyStatus);
 				}
 
@@ -3830,10 +3548,7 @@
 				{
 				ret = epBuf.GetBuffer((TAny*&)readBuf,aSize,aZlp,status);
 				if(gVerbose)
-				    {
 					test.Printf(_L("Getbuffer returned %d, aSize: %d, aZlp: %d\n"),ret, aSize,aZlp);
-					OstTraceExt3(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP02, "Getbuffer returned %d, aSize: %d, aZlp: %d\n",ret, aSize,aZlp);
-					}
 				}
 
 			if (ret==KErrNone)
@@ -3848,7 +3563,6 @@
 				{
 				TInt state = *((TInt*) readBuf);
 				test.Printf(_L("Status Change:! %d : %S \n"),state,((state<0) || (state>7))?KStates[8]:KStates[state]);
-				OstTraceExt2(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP03, "Status Change:! %d : %S \n",state,((state<0) || (state>7))?*KStates[8]:*KStates[state]);
 				test_Equal(aSize, 4);
 				goodStateChange++;
 				}
@@ -3861,7 +3575,6 @@
 					if (aSize!=8)
 						{
 						test.Printf(_L("Error: Malformed control packet of size %d.\n"),aSize);
-						OstTrace1(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP04, "Error: Malformed control packet of size %d.\n",aSize);
 						error = ETrue;
 						}
 					else
@@ -3873,7 +3586,6 @@
 							{
 							// Send data
 							test.Printf(_L("Sending %d bytes of data value increasing from 0x0 in 1 step. Verify data is received at the host\n"),setup->iWlength);
-							OstTrace1(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP05, "Sending %d bytes of data value increasing from 0x0 in 1 step. Verify data is received at the host\n",setup->iWlength);
 							TUint8 *ep0Buffer; // = (TUint8 *)epBuf.Ep0In()BufferStart;
 							TUint ep0Length;
 							epBuf.GetInBufferRange(((TAny*&)ep0Buffer),ep0Length);
@@ -3899,7 +3611,6 @@
 								{
 								gPort.SendEp0StatusPacket();
 								test.Printf(_L("No Data.\n"));
-								OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP06, "No Data.\n");
 								}
 							} // end HostToDevice type
 						} //packet Correct length
@@ -3914,7 +3625,6 @@
 					if (aZlp && dataLength)
 						{
 						test.Printf(_L("\nError: ZLP received before enough data is read out!\nFailing Test!\n"));
-						OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP07, "\nError: ZLP received before enough data is read out!\nFailing Test!\n");
 						error=ETrue;
 						phase=0;
 						}
@@ -3924,14 +3634,11 @@
 						gPort.SendEp0StatusPacket();
 						//Print read out values
 						test.Printf(_L("Data Read:"));
-						OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP08, "Data Read:");
 						for(TInt i=0; i < iReadBuf.Length(); i++)
 							{
 							test.Printf(_L("0x%x "),iReadBuf[i]);
-							OstTrace1(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP09, "0x%x ",iReadBuf[i]);
 							}
 						test.Printf(_L("\n"));
-						OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP10, "\n");
 						goodReads++;
 						}
 
@@ -3948,19 +3655,14 @@
 			{
 			if (!error)
 				test.Printf(_L("\nInsifishant reads/writes where seen to work, to pass test.\n"));
-				OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP11, "\nInsifishant reads/writes where seen to work, to pass test.\n");
 								
 			test.Printf(_L("\n ***************\n"));
-			OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP12, "\n ***************\n");
 			test.Printf(_L(" * FAILED TEST *\n"));
-			OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP13, " * FAILED TEST *\n");
 			test.Printf(_L(" ***************\n\nKey to Continue."));
-			OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP14, " ***************\n\nKey to Continue.");
 			}
 		else
 			{
 			test.Printf(_L("\nIf the USBIO demo application responded as expected, then this can be called a passed test.\n\nKey to Continue.\n"));		
-			OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP15, "\nIf the USBIO demo application responded as expected, then this can be called a passed test.\n\nKey to Continue.\n");		
 			}
 
 		//Note- A disturbing fact! If host aborts data transmission and send a new setup packet, the userside is clueless as to what it's reading is
@@ -3969,7 +3671,6 @@
 		} // end if-real-hardware
 	gChunk.Close();
 	test.Printf(_L("Close global USB channel\n"));
-	OstTrace0(TRACE_NORMAL, TESTBILEP0_TESTBILEP0_DUP16, "Close global USB channel\n");
 	gPort.Close();
 	} // end funcion
 
@@ -4227,10 +3928,7 @@
 		if (gSpecTest>=EBilRw)
 			TestBIL();
 		else
-			{
 			test.Printf(_L("No such option \n"));
-			OstTrace0(TRACE_NORMAL, STARTTESTS_STARTTESTS, "No such option \n");
-			}
 	}
 
 
@@ -4317,11 +4015,8 @@
 			if ((token==_L("help")) || (token==_L("-h")) || (token==_L("/h")) || (token==_L("-?")) || (token==_L("/?")))
 				{
 				test.Printf(_L("\nThis tests the Shared chunk version of the USBC driver.  It focuses on the elements specific to this driver and should be used in conjuntion with other USBC tests in order to validate the driver.\n\n"));
-				OstTrace0(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE, "\nThis tests the Shared chunk version of the USBC driver.  It focuses on the elements specific to this driver and should be used in conjuntion with other USBC tests in order to validate the driver.\n\n");
 				test.Printf(_L("\n -h : Help.\n -r : test on Real hardware\n -v : Verbose\n -V : Very verbose\n-t <test> : Run a specific test.\n"));   
-				OstTrace0(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE_DUP01, "\n -h : Help.\n -r : test on Real hardware\n -v : Verbose\n -V : Very verbose\n-t <test> : Run a specific test.\n");   
 				test.Printf(_L("\nAvailable tests:  buf_read, buf_write, ep0, altset, interface, cancel, api, descriptor, bil_rw, bil_ep0, bil_alt\n"));
-				OstTrace0(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE_DUP02, "\nAvailable tests:  buf_read, buf_write, ep0, altset, interface, cancel, api, descriptor, bil_rw, bil_ep0, bil_alt\n");
 				err=KErrCancel;
 				}
 			else
@@ -4406,12 +4101,8 @@
 		if (err!=KErrNone)
 			{
 			if (err==KErrArgument)
-				{
 				test.Printf(_L("\nUnknown argument '%S%s%S'\n"), &token, (subtoken.Length()==0)?"":" ", &subtoken);
-				OstTraceExt3(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE_DUP03, "\nUnknown argument '%S%S%S'\n", token, (subtoken.Length()==0)?_L(""):_L(" "), subtoken);
-				}
 			test.Printf(_L("\nUsage:  t_usbcsc [-hrvVt]\n\n"));
-			OstTrace0(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE_DUP04, "\nUsage:  t_usbcsc [-hrvVt]\n\n");
 			test.Getch();
 			return err;
 			}
@@ -4433,7 +4124,6 @@
 	if (r != KErrNone)
 		{
 		test.Printf(_L("Unable to get Platform ID. Skipping tests\n"));
-		OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN, "Unable to get Platform ID. Skipping tests\n");
 		return KErrNone;
 		}
 	if (SupportsUsb() && (muid != HAL::EMachineUid_Lubbock))
@@ -4443,7 +4133,6 @@
 	else
 		{
 		test.Printf(_L("USB is not supported on this platform.  Skipping test\n"));
-		OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP01, "USB is not supported on this platform.  Skipping test\n");
 		}
 	
    	test.End();
--- a/kerneltest/e32test/dll/t_dll1.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/dll/t_dll1.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -17,6 +17,7 @@
 
 #include "t_dll.h"
 
+const TInt KHeapSize=0x2000;
 
 class TlsData
 	{
--- a/kerneltest/e32test/dll/t_dll2.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/dll/t_dll2.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -18,6 +18,8 @@
 
 #include "t_dll.h"
 
+const TInt KHeapSize=0x2000;
+
 class TlsData
 	{
 public:
--- a/kerneltest/e32test/dll/t_xxver2.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/dll/t_xxver2.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -578,13 +578,8 @@
 		test(((SSecurityInfo&)info.iSecurityInfo).iCaps[0]==0x0002aaab);
 		test(((SSecurityInfo&)info.iSecurityInfo).iCaps[1]==0);
 		if(formHeader)
-		{
-		#if defined(__ARMCC__) && __ARMCC_VERSION >= 400000
-			test(info.iHardwareFloatingPoint == EFpTypeVFPv2);
-		#else
 			test(info.iHardwareFloatingPoint == EFpTypeNone);
-		#endif
-		}
+
 		if(formHeader)
 			break;
 		formHeader = ETrue;
--- a/kerneltest/e32test/dma/d_dma.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/dma/d_dma.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -159,7 +159,6 @@
 #endif
 
 
-#ifndef DMA_APIV2
 static TInt FragmentCount(DDmaRequest* aRequest)
 	{
 	TInt count = 0;
@@ -167,7 +166,6 @@
 		count++;
 	return count;
 	}
-#endif
 
 
 //////////////////////////////////////////////////////////////////////////////
@@ -260,19 +258,6 @@
 		r = TDmaChannel::Open(info, iChannel);
 		if (r!= KErrNone)
 			return r;
-
-		// ---> Code coverage of rarely called functions
-		const TDmac* const c = iChannel->Controller();
-		if (!c)
-			return KErrGeneral;
-		const TInt mts = iChannel->MaxTransferSize(0, iCookie);
-		if (mts == 0)
-			return KErrGeneral;
-		const TUint mam = iChannel->MemAlignMask(0, iCookie);
-		if (~mam == 0)
-			return KErrGeneral;
-		// <--- Code coverage of rarely called functions
-
 		iClient = &Kern::CurrentThread();
 		for (TInt i=0; i<KMaxRequests; ++i)
 			{
@@ -403,11 +388,7 @@
 		{
 		TInt reqIdx = (TInt)a1;
 		__ASSERT_DEBUG(0 <= reqIdx && reqIdx < KMaxRequests, Kern::PanicCurrentThread(KClientPanicCat, __LINE__));
-#ifdef DMA_APIV2
-		return iRequests[reqIdx]->FragmentCount();
-#else
 		return FragmentCount(iRequests[reqIdx]);
-#endif
 		}
 	case RTestDma::EMissInterrupts:
 		return iChannel->MissNextInterrupts((TInt)a1);
--- a/kerneltest/e32test/dma/dmasim.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/dma/dmasim.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -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"
@@ -355,69 +355,37 @@
 public:
 	static void StartEmulation();
 	static void StopEmulation();
-	static TBool InISR();
-	static void Synchronize();
 private:
 	enum { KPeriod = 1 }; // in ms
-	enum { EDmaSimIdle=0u, EDmaSimStarted=1u, EDmaSimInISR=2u, EDmaSimStopping=0x80000000u };
 	static void TickCB(TAny* aThis);
 	static NTimer Timer;
-	static volatile TInt StartStop;
 	};
 
 NTimer DmacSim::Timer;
-volatile TInt DmacSim::StartStop;
 
 void DmacSim::StartEmulation()
 	{
-	__DMA_ASSERTA(StartStop==EDmaSimIdle);
 	new (&Timer) NTimer(&TickCB, 0);
-	__e32_atomic_store_ord32(&StartStop, EDmaSimStarted);
 	__DMA_ASSERTA(Timer.OneShot(KPeriod, EFalse) == KErrNone);
 	}
 
 void DmacSim::StopEmulation()
 	{
-	TInt orig = __e32_atomic_tas_ord32(&StartStop, (TInt)EDmaSimStarted, (TInt)EDmaSimStopping, 0);
-	if (orig == EDmaSimIdle)
-		return;		// wasn't running
-	// loop until we succeed in cancelling the timer or the timer callback
-	// notices that we are shutting down
-	while (!Timer.Cancel() && __e32_atomic_load_acq32(&StartStop)!=EDmaSimIdle)
-		{}
-	__e32_atomic_store_ord32(&StartStop, EDmaSimIdle);
+	// Ensure that timer really is cancelled.
+	TBool cancelled = EFalse;
+	do
+		{
+		cancelled = Timer.Cancel();
+		}
+	while(!cancelled);
 	}
 
 void DmacSim::TickCB(TAny*)
 	{
-	TInt orig = (TInt)__e32_atomic_ior_acq32(&StartStop, EDmaSimInISR);
-	if (orig >= 0)
-		{
-		DmacSb::DoTransfer();
-		DmacDb::DoTransfer();
-		DmacSg::DoTransfer();
-		}
-	orig = (TInt)__e32_atomic_and_rel32(&StartStop, (TUint32)~EDmaSimInISR);
-	if (orig < 0)
-		{
-		__e32_atomic_store_rel32(&StartStop, EDmaSimIdle);
-		return;
-		}
-	TInt r = Timer.Again(KPeriod);
-	if (r == KErrArgument)
-		r = Timer.OneShot(KPeriod);
-	__DMA_ASSERTA(r == KErrNone);
-	}
-
-TBool DmacSim::InISR()
-	{
-	return __e32_atomic_load_acq32(&StartStop) & EDmaSimInISR;
-	}
-
-void DmacSim::Synchronize()
-	{
-	while (InISR())
-		{}
+	DmacSb::DoTransfer();
+	DmacDb::DoTransfer();
+	DmacSg::DoTransfer();
+	__DMA_ASSERTA(Timer.Again(KPeriod) == KErrNone);
 	}
 
 //////////////////////////////////////////////////////////////////////////////
@@ -474,7 +442,6 @@
 void DSimSbController::StopTransfer(const TDmaChannel& aChannel)
 	{
 	__e32_atomic_and_ord32(&DmacSb::ControlStatus[aChannel.PslId()], (TUint32)~DmacSb::ECsRun);
-	DmacSim::Synchronize();
 	}
 
 
@@ -575,7 +542,6 @@
 void DSimDbController::StopTransfer(const TDmaChannel& aChannel)
 	{
 	__e32_atomic_and_ord32(&DmacDb::ControlStatus[aChannel.PslId()], (TUint32)~(DmacDb::ECsRun|DmacDb::ECsPrg));
-	DmacSim::Synchronize();
 	}
 
 
@@ -706,7 +672,6 @@
 void DSimSgController::StopTransfer(const TDmaChannel& aChannel)
 	{
 	__e32_atomic_and_ord32(&DmacSg::ChannelControl[aChannel.PslId()], (TUint32)~DmacSg::EChannelBitRun);
-	DmacSim::Synchronize();
 	}
 
 
--- a/kerneltest/e32test/dma/t_dma.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/dma/t_dma.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -348,7 +348,7 @@
 	TBuf<16> name;
 	name = _L("TESTER-");
 	name.AppendNum(aIdx);
-	test(iThread.Create(name, ThreadFunction, 0x2000, NULL, this) == KErrNone);
+	test(iThread.Create(name, ThreadFunction, 0x1000, NULL, this) == KErrNone);
 	iThread.SetPriority(EPriorityLess);
 	iThread.Logon(iStatus);
 	SetActive();
@@ -466,27 +466,28 @@
 	do
 		{
 		fragSize -= step;
-
-		// Make sure size is aligned
+		// make sure size is aligned
 		fragSize = fragSize & ~Info.iMemAlignMask;
-		if(fragSize == 0)
-			break;
 
 		r = OpenChannel(iMaxFragCount, fragSize);
 		test_KErrNone(r);
 
 		for(iFragCount=1; iFragCount <= iMaxFragCount; iFragCount++)
 			{
-			test.Printf(_L("Chan %d Fragment size %d bytes, %d fragments, %d iters\n"), iChannelId, fragSize, iFragCount, iInnerIterations);
+			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 a quarter each iteration
-		step = (fragSize/4);
+		// Reduce frag size by an eigth each iteration
+		step = (fragSize/8);
 		} while (step > 0);
 
 	iTimer.Close();
@@ -526,7 +527,7 @@
 	User::WaitForRequest(rs, timerStatus);
 	if(rs.Int() == KRequestPending)
 		{
-		RDebug::Printf("Chan %d: Transfer timed out!", iChannelId);
+		RDebug::Print(_L("Transfer timed out!"));
 		// timed out
 		test(EFalse);
 		}
@@ -1187,9 +1188,9 @@
 	// intended to find errors in PSL implmentations
 	const TInt iterPerFragSize = 1;
 #else
-	const TInt iterPerFragSize = 10;
+	const TInt iterPerFragSize = 30;
 #endif
-	const TInt rangeMaxFragCount = 5;
+	const TInt rangeMaxFragCount = 8;
 
 	test.Next(_L("sb"));
 	RunSbTest(maxchannel, new CFragSizeRange(1, rangeMaxFragCount, rangeFragSize, iterPerFragSize));
--- a/kerneltest/e32test/dmav2/cap_reqs.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +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 "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: Contains TDmaCapability and associated definitions.
-* These are used by the DMA tests in test_cases.cpp to express dependancies
-* on various DMA controller/channel capabilities
-*
-*/
-#ifndef __CAP_REQS_H__
-#define __CAP_REQS_H__
-
-#include <e32std.h>
-
-/**
-The various types of requirement on a
-value that can be specified by a TDmaCapability
-*/
-enum TCapsReqType
-		{
-		EEqual, EGTE /* >= */, ELTE /* <= */, EBitsSet, EBitsClear
-		};
-
-/**
-Enumerates all the various DMA channel capabilities
-*/
-enum TCapsReq
-		{
-		ENone,
-		EChannelPriorities,
-		EChannelPauseAndResume,
-		EAddrAlignedToElementSize,
-		E1DAddressing,
-		E2DAddressing,
-		ESynchronizationTypes,
-		EBurstTransactions,
-		EDescriptorInterrupt,
-		EFrameInterrupt,
-		ELinkedListPausedInterrupt,
-		EEndiannessConversion,
-		EGraphicsOps,
-		ERepeatingTransfers,
-		EChannelLinking,
-		EHwDescriptors,
-		ESrcDstAsymmetry,
-		EAsymHwDescriptors,
-		EBalancedAsymSegments,
-		EAsymCompletionInterrupt,
-		EAsymDescriptorInterrupt,
-		EAsymFrameInterrupt,
-		EPilVersion,
-		};
-
-enum TResult {ERun=0, ESkip=1, EFail=2}; //The ordering of these should not be changed
-
-struct SDmacCaps;
-struct TDmacTestCaps;
-
-/**
-Represents a requirement for some DMA capability
-to be either present or not present, less than, equal to, or
-greater than some value, or to have certain bits in a mask
-set or unset.
-*/
-struct TDmaCapability
-	{
-	TDmaCapability()
-		:iCapsReq(ENone), iCapsReqType(EEqual), iValue(ETrue), iFail(EFalse)
-		{}
-
-	TDmaCapability(TCapsReq aReq, TCapsReqType aReqType, TUint aValue, TBool aFail)
-		:iCapsReq(aReq), iCapsReqType(aReqType), iValue(aValue), iFail(aFail)
-		{}
-
-	static void SelfTest();
-
-	/**
-	Compares the requirements held in the struct
-	against those described in aChannelCaps and makes a decision
-	as to whether this test case should be run, skipped, or failed.
-	*/
-	TResult CompareToDmaCaps(const SDmacCaps& aChannelCaps) const;
-	TResult CompareToDmaCaps(const TDmacTestCaps& aChannelCaps) const;
-
-private:
-	TBool RequirementSatisfied(const SDmacCaps& aChannelCaps) const;
-	TBool RequirementSatisfied(const TDmacTestCaps& aChannelCaps) const;
-
-	TBool TestValue(TUint aValue) const;
-
-public:
-	TCapsReq		iCapsReq;
-	TCapsReqType	iCapsReqType;
-	TUint			iValue;
-	// if HW capability is not available:-
-	// 	ETrue - Fail the test
-	//	EFalse - Skip the test
-	TBool			iFail;
-	};
-
-//A set of DMA capability requirements
-const TDmaCapability none(ENone, EEqual, 0, ETrue);
-
-const TDmaCapability pauseRequired(EChannelPauseAndResume, EEqual, ETrue, ETrue);
-const TDmaCapability pauseRequired_skip(EChannelPauseAndResume, EEqual, ETrue, EFalse);
-const TDmaCapability pauseNotWanted(EChannelPauseAndResume, EEqual, EFalse, ETrue);
-
-const TDmaCapability hwDesNotWanted(EHwDescriptors, EEqual, EFalse, ETrue);
-const TDmaCapability hwDesNotWanted_skip(EHwDescriptors, EEqual, EFalse, EFalse);
-const TDmaCapability hwDesWanted(EHwDescriptors, EEqual, ETrue, ETrue);
-const TDmaCapability hwDesWanted_skip(EHwDescriptors, EEqual, ETrue, EFalse);
-
-const TDmaCapability cap_2DRequired(E2DAddressing, EEqual, ETrue, EFalse);
-
-const TDmaCapability capEqualV1(EPilVersion, EEqual, 1, EFalse);
-const TDmaCapability capEqualV2(EPilVersion, EEqual, 2, EFalse);
-const TDmaCapability capEqualV2Fatal(EPilVersion, EEqual, 2, ETrue);
-
-const TDmaCapability capAboveV1(EPilVersion, EGTE, 2, EFalse);
-const TDmaCapability capBelowV2(EPilVersion, ELTE, 1, EFalse);
-const TDmaCapability LinkingNotWanted(EChannelLinking, EEqual, EFalse, ETrue);
-#endif // #ifdef __CAP_REQS_H__
--- a/kerneltest/e32test/dmav2/d_dma2.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1665 +0,0 @@
-// 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"
-// 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:
-// Test driver for DMA V2 framework
-//
-//
-
-#include <kernel/kern_priv.h>
-#include <drivers/dma.h>
-#include "d_dma2.h"
-
-_LIT(KClientPanicCat, "D_DMA2");
-_LIT(KDFCThreadName,"D_DMA_DFC_THREAD");
-_LIT(KIsrCbDfcThreadName,"D_DMA_IsrCb_thread");
-const TInt KDFCThreadPriority=26;
-
-class TStopwatch
-	{
-public:
-	TStopwatch()
-		:iStart(0), iStop(0)
-		{}
-
-	void Start()
-		{iStart = NKern::FastCounter();}
-
-	void Stop()
-		{
-		iStop = NKern::FastCounter();
-
-		__KTRACE_OPT(KDMA, Kern::Printf(">TStopwatch::Stop FastCounter ticks: iStart=0x%lx iStop=0x%lx", iStart, iStop));
-		}
-
-	TUint64 ReadMicroSecs() const
-		{
-#ifndef __SMP__
-		TUint64 diff = 0;
-		if(iStart > iStop)
-			{
-			diff = (KMaxTUint64 - iStart) + iStop;
-			}
-		else
-			{
-			diff = iStop - iStart;
-			}
-		return FastCountToMicroSecs(diff);
-#else
-		//On SMP it is possible for the value returned from
-		//NKern::FastCounter to depend on the current CPU (ie.
-		//NaviEngine)
-		//
-		//One solution would be to tie DFC's and ISR's to the same
-		//core as the client, but this would reduce the usefulness of
-		//SMP testing.
-		return 0;
-#endif
-		}
-private:
-
-	TUint64 FastCountToMicroSecs(TUint64 aCount) const
-		{
-		const TUint64 countsPerS = NKern::FastCounterFrequency();
-
-		TUint64 timeuS = (aCount*1000000)/countsPerS;
-		__KTRACE_OPT(KDMA, Kern::Printf(">TStopwatch::FastCountToMicroSecs FastCounter ticks: aCount=0x%lx countsPerS=0x%lx time=0x%lx", aCount, countsPerS, timeuS));
-		return timeuS;
-		}
-
-	TUint64 iStart;
-	TUint64 iStop;
-	};
-
-//////////////////////////////////////////////////////////////////////////////
-
-class DClientDmaRequest;
-/**
-Driver channel. Only accessible by a single client thread
-*/
-class DDmaTestSession : public DLogicalChannelBase
-	{
-public:
-	DDmaTestSession();
-	virtual ~DDmaTestSession();
-protected:
-	// from DLogicalChannelBase
-	virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
-	virtual TInt Request(TInt aFunction, TAny* a1, TAny* a2);
-	virtual TInt RequestUserHandle(DThread* aThread, TOwnerType aType);
-private:
-	TInt DoGetInfo(TAny* aInfo);
-
-	TInt OpenDmaChannel(TUint aPslCookie, TUint& aDriverCookie);
-	TInt OpenDmaChannel(TUint& aDriverCookie, TDmaChannel::SCreateInfo& aInfo);
-	TInt LinkDmaChannelByCookie(TUint aDriverCookie);	
-	TInt UnlinkDmaChannelByCookie(TUint aDriverCookie);
-	TInt CloseDmaChannelByCookie(TUint aDriverCookie);
-	TInt PauseDmaChannelByCookie(TUint aDriverCookie);
-	TInt ResumeDmaChannelByCookie(TUint aDriverCookie);
-	TInt GetChannelCapsByCookie(TUint aDriverCookie, SDmacCaps& aChannelCaps);
-	TInt GetChannelCapsByCookie(TUint aDriverCookie, TDmacTestCaps& aChannelCaps);
-	TInt CancelAllByCookie(TUint aDriverCookie);
-	TInt IsrRedoRequestByCookie(TUint aDriverCookie,TUint32 aSrcAddr,TUint32 aDstAddr,TInt aTransferCount,TUint32 aPslRequestInfo,TBool aIsrCb);
-	TInt IsQueueEmptyByCookie(TUint aDriverCookie, TBool& aQueueEmpty);		
-	TInt ChannelIsOpenedByCookie(TUint aDriverCookie, TBool& aChannelOpen);	
-	TInt EnableDstElementCountingByCookie(TUint aDriverCookie);
-	TInt EnableSrcElementCountingByCookie(TUint aDriverCookie);
-	TInt DisableDstElementCountingByCookie(TUint aDriverCookie);
-	TInt DisableSrcElementCountingByCookie(TUint aDriverCookie);
-	TInt TotalNumDstElementsTransferredByCookie(TUint aDriverCookie);
-	TInt TotalNumSrcElementsTransferredByCookie(TUint aDriverCookie);
-	void CloseDmaChannelByIndex(TInt aIndex);
-	void CancelAllByIndex(TInt aIndex);
-	TInt LinkDmaChannelByIndex(TInt aIndex);
-	TInt UnlinkDmaChannelByIndex(TInt aIndex);
-	TInt PauseDmaChannelByIndex(TInt aIndex);
-	TInt ResumeDmaChannelByIndex(TInt aIndex);		
-	TInt IsrRedoRequestByIndex(TInt aIndex,TUint32 aSrcAddr,TUint32 aDstAddr,TInt aTransferCount,TUint32 aPslRequestInfo,TBool aIsrCb);
-	void EnableDstElementCountingByIndex(TInt aIndex);
-	void EnableSrcElementCountingByIndex(TInt aIndex);
-	void DisableDstElementCountingByIndex(TInt aIndex);
-	void DisableSrcElementCountingByIndex(TInt aIndex);
-	TInt TotalNumDstElementsTransferredByIndex(TInt aIndex);
-	TInt TotalNumSrcElementsTransferredByIndex(TInt aIndex);
-	TInt CreateSharedChunk();
-	TUint OpenSharedChunkHandle();
-
-	/**
-	Creates a new kernel-side DMA request object, associated with a previously
-	opened channel
-
-	@param aChannelCookie - A channel cookie as returned by OpenDmaChannel
-	@param aRequestCookie - On success will be a cookie by which the dma request can be referred to
-	@param aNewCallback - If true, then a new style DMA callback will be used
-	*/
-	TInt CreateDmaRequest(TUint aChannelCookie, TUint& aRequestCookie, TBool aNewCallback = EFalse, TInt aMaxFragmentSizeBytes=0);
-
-	/**
-	Destroys a previously created dma request object
-	*/
-	TInt DestroyDmaRequestByCookie(TUint aRequestCookie);
-
-	void DestroyDmaRequestByIndex(TInt aIndex);
-
-
-	TInt CookieToChannelIndex(TUint aDriverCookie) const;
-	TInt CookieToRequestIndex(TUint aRequestCookie) const;
-
-	void MakeAddressesAbsoulute(TDmaTransferArgs& aTransferArgs) const;
-	TInt FragmentRequest(TUint aRequestCookie, const TDmaTransferArgs& aTransferArgs, TBool aLegacy=ETrue);
-
-	TInt QueueRequest(TUint aRequestCookie, TRequestStatus* aStatus, TCallbackRecord* aRecord, TUint64* aDurationMicroSecs);
-	DClientDmaRequest* RequestFromCookie(TUint aRequestCookie) const;
-	TInt RequestFragmentCount(TUint aRequestCookie);
-	TDmaV2TestInfo ConvertTestInfo(const TDmaTestInfo& aOldInfo) const;
-private:
-	DThread* iClient;
-	TDynamicDfcQue* iDfcQ;
-	TDynamicDfcQue* iIsrCallbackDfcQ; // Will be used by requests which complete with an ISR callback
-	static const TInt KMaxChunkSize;
-	TLinAddr iChunkBase;
-	DChunk* iChunk;
-
-	RPointerArray<TDmaChannel> iChannels;
-	RPointerArray<DClientDmaRequest> iClientDmaReqs;
-	};
-
-
-/**
-Allows a TClientRequest to be associated with a DDmaRequest
-*/
-class DClientDmaRequest : public DDmaRequest
-	{
-public:
-	static DClientDmaRequest* Construct(DThread* aClient, TDfcQue* const aDfcQ, TDmaChannel& aChannel, TBool aNewStyle=EFalse, TInt aMaxTransferSize=0);
-	~DClientDmaRequest();
-
-	TInt Queue(TRequestStatus* aRequestStatus, TCallbackRecord* aRecord, TUint64* aDurationMicroSecs);
-	void AddRequeArgs(const TIsrRequeArgsSet& aRequeArgSet);
-
-	TUint64 GetDuration()
-		{return iStopwatch.ReadMicroSecs();}
-
-	/**
-	Store a copy of the TDmaTransferArgs which was used for fragmentation
-	for argument checking
-	*/
-	void SetAddressParms(const TDmaTransferArgs& aAddressParms)
-		{iFragmentedTransfer = aAddressParms;}
-
-	/**
-	Retrieve stored TDmaTransferArgs
-	*/
-	const TDmaTransferArgs& GetAddressParms() const
-		{return iFragmentedTransfer;}
-
-protected:
-	TInt Create();
-	/** Construct with old style callback */
-	DClientDmaRequest(DThread* aClient, TDfcQue* const aDfcQ, TDmaChannel& aChannel, TInt aMaxTransferSize);
-
-	/** Construct with new style callback */
-	DClientDmaRequest(DThread* aClient, TDfcQue* const aDfcQ, TDmaChannel& aChannel, TBool aNewStyle, TInt aMaxTransferSize);
-
-private:
-	static void CallbackOldStyle(TResult aResult, TAny* aRequest);
-	static void Callback(TUint, TDmaResult, TAny*, SDmaDesHdr*);
-	static void CompleteCallback(TAny* aRequest);
-
-	void DoCallback(TUint, TDmaResult);
-	TBool RedoRequest();
-
-	//!< Used to return a TCallbackRecord and transfer time
-	TClientDataRequest2<TCallbackRecord, TUint64>* iClientDataRequest;
-
-	DThread* const iClient;
-	TDfcQue* const iDfcQ; //!< Use the DDmaTestSession's dfc queue
-	TDfc iDfc;
-
-	TStopwatch iStopwatch;
-	TIsrRequeArgsSet iIsrRequeArgSet;
-
-	/**
-	This will be updated each time fragment is called.
-	It is required so that, at queue time, if ISR re-queue
-	arguments are added, they can be checked for sanity
-	*/
-	TDmaTransferArgs iFragmentedTransfer;
-	};
-
-DClientDmaRequest* DClientDmaRequest::Construct(DThread* aClient, TDfcQue* const aDfcQ, TDmaChannel& aChannel, TBool aNewStyle, TInt aMaxTransferSize)
-	{
-	DClientDmaRequest* dmaRequest = NULL;
-	if(aNewStyle)
-		{
-#ifdef DMA_APIV2
-		dmaRequest = new DClientDmaRequest(aClient, aDfcQ, aChannel, aNewStyle, aMaxTransferSize);
-#else
-		TEST_FAULT; // if a new style dma request was requested it should have been caught earlier
-#endif
-		}
-	else
-		{
-		dmaRequest = new DClientDmaRequest(aClient, aDfcQ, aChannel, aMaxTransferSize);
-		}
-
-	if(dmaRequest == NULL)
-		{
-		return dmaRequest;
-		}
-
-	const TInt r = dmaRequest->Create();
-	if(r != KErrNone)
-		{
-		delete dmaRequest;
-		dmaRequest = NULL;
-		}
-	return dmaRequest;
-	}
-
-DClientDmaRequest::DClientDmaRequest(DThread* aClient, TDfcQue* const aDfcQ, TDmaChannel& aChannel, TInt aMaxFragmentSize)
-	:DDmaRequest(aChannel, &CallbackOldStyle, this, aMaxFragmentSize),
-	iClientDataRequest(NULL),
-	iClient(aClient),
-	iDfcQ(aDfcQ),
-	iDfc(CompleteCallback,NULL, iDfcQ, KMaxDfcPriority)
-	{
-	}
-#ifdef DMA_APIV2
-DClientDmaRequest::DClientDmaRequest(DThread* aClient, TDfcQue* const aDfcQ, TDmaChannel& aChannel, TBool /*aNewStyle*/, TInt aMaxFragmentSize)
-	:DDmaRequest(aChannel, &Callback, this, aMaxFragmentSize),
-	iClientDataRequest(NULL),
-	iClient(aClient),
-	iDfcQ(aDfcQ),
-	iDfc(CompleteCallback,NULL, iDfcQ, KMaxDfcPriority)
-	{
-	}
-#endif
-
-TInt DClientDmaRequest::Create()
-	{
-	return Kern::CreateClientDataRequest2(iClientDataRequest);
-	}
-
-DClientDmaRequest::~DClientDmaRequest()
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf(">DClientDmaRequest::~DClientDmaRequest")); 
-	if(iClientDataRequest)
-		{
-		Kern::DestroyClientRequest(iClientDataRequest);
-		}
-	}
-
-/**
-Queue the DClientDmaRequest.
-
-@param aRequestStatus Pointer to the client's request status
-@param aRecord Pointer to the user's TCallbackRecord, may be null
-@return
-   -KErrInUse The client request is in use
-   -KErrNone success
-*/
-TInt DClientDmaRequest::Queue(TRequestStatus* aRequestStatus, TCallbackRecord* aRecord, TUint64* aDurationMicroSecs)
-	{
-	__NK_ASSERT_ALWAYS(aRecord);
-	__NK_ASSERT_ALWAYS(aDurationMicroSecs);
-
-	//erase results from last transfer
-	iClientDataRequest->Data1().Reset();
-	iClientDataRequest->SetDestPtr1(aRecord);
-
-	iClientDataRequest->SetDestPtr2(aDurationMicroSecs);
-
-
-	TInt r = iClientDataRequest->SetStatus(aRequestStatus);
-	if(r != KErrNone)
-		{
-		return r;
-		}
-
-	iStopwatch.Start();
-#ifdef DMA_APIV2
-	r = DDmaRequest::Queue();
-#else
-	// old version of queue did not return an error code
-	DDmaRequest::Queue();
-	r = KErrNone;
-#endif
-
-	return r;
-	}
-
-void DClientDmaRequest::AddRequeArgs(const TIsrRequeArgsSet& aRequeArgSet)
-	{
-	iIsrRequeArgSet = aRequeArgSet;
-	}
-
-/**
-If a transfer complete callback in ISR context s received this will be
-called to redo the request with the first entry in the array
-
-@return ETrue If the redo was successful - indicates that another callback is comming
-*/
-TBool DClientDmaRequest::RedoRequest()
-	{
-	TIsrRequeArgs args = iIsrRequeArgSet.GetArgs();
-	const TInt r = args.Call(iChannel);
-	TCallbackRecord& record = iClientDataRequest->Data1();
-	record.IsrRedoResult(r);
-	return (r == KErrNone);
-	}
-
-
-/**
-Calls TDmaChannel::IsrRedoRequest on aChannel
-with this object's parameters
-*/
-TInt TIsrRequeArgs::Call(TDmaChannel& aChannel)
-	{
-#ifdef DMA_APIV2
-	return aChannel.IsrRedoRequest(iSrcAddr, iDstAddr, iTransferCount, iPslRequestInfo, iIsrCb);
-#else
-	TEST_FAULT;
-	return KErrNotSupported;
-#endif
-	}
-
-/** Translate an old style dma callback to a new-style one
-*/
-void DClientDmaRequest::CallbackOldStyle(TResult aResult, TAny* aArg)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf(">DClientDmaRequest::CallBackOldStyle: TResult result=%d", aResult));
-	TEST_ASSERT(aResult != EBadResult);
-	//translate result code
-	const TDmaResult result = (aResult == EOk) ? EDmaResultOK : EDmaResultError;
-
-	//call the new-style callback
-	Callback(EDmaCallbackRequestCompletion, result, aArg, NULL);
-	}
-
-
-/**
-The new style callback called by the DMA framework
-may be called in either thread or ISR context
-*/
-void DClientDmaRequest::Callback(TUint aCallbackType, TDmaResult aResult, TAny* aArg, SDmaDesHdr* /*aHdr*/)
-	{
-	const TInt context = NKern::CurrentContext();
-	__KTRACE_OPT(KDMA, Kern::Printf(">DClientDmaRequest::CallBack: TDmaResult result = %d, NKern::TContext context = %d", aResult, context));
-	
-	DClientDmaRequest& self = *reinterpret_cast<DClientDmaRequest*>(aArg);
-	self.DoCallback(aCallbackType, aResult);
-
-	// decide if callback is complete
-	const TBool transferComplete = aCallbackType & EDmaCallbackRequestCompletion;
-	if(!transferComplete)
-		{
-		return;
-		}
-
-	// If there are reque args then redo this request
-	// another callback would then be expected.
-	// Requests can only be re-queued in ISR context, but we
-	// do not check that here as it is up to the client to get
-	// it right - also, we want to test that the PIL catches this
-	// error
-	if(!self.iIsrRequeArgSet.IsEmpty())
-		{
-		// If redo call was succesful, return and wait for next call back
-		if(self.RedoRequest())
-			return;
-		}
-
-	switch(context)
-		{
-	case NKern::EThread:
-		{
-		CompleteCallback(aArg);
-		break;
-		}
-	case NKern::EInterrupt:
-		{
-		self.iDfc.iPtr = aArg;
-		self.iDfc.Add();
-		break;
-		}
-	//Fall-through: If context is IDFC or the EEscaped marker occur
-	//it is an error
-	case NKern::EIDFC:
-	case NKern::EEscaped:
-	default:
-		TEST_FAULT;
-		}
-	}
-
-/**
-Log results of callback. May be called in either thread or ISR context
-*/
-void DClientDmaRequest::DoCallback(TUint aCallbackType, TDmaResult aResult)
-	{
-	iStopwatch.Stop(); //sucessive calls will simply over write the stop time
-
-	// This will always be done whether the client requested a
-	// callback record or not
-	TCallbackRecord& record = iClientDataRequest->Data1();
-	record.ProcessCallback(aCallbackType, aResult);
-	}
-
-/**
-This function may either be called directly or queued as a DFC
-*/
-void DClientDmaRequest::CompleteCallback(TAny* aArg)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf(">DClientDmaRequest::CompleteCallBack thread %O", &Kern::CurrentThread()));
-	__ASSERT_NOT_ISR;
-
-	DClientDmaRequest& self = *reinterpret_cast<DClientDmaRequest*>(aArg);
-
-	self.iClientDataRequest->Data2() = self.iStopwatch.ReadMicroSecs();
-
-	//Assert that we called SetRequestStatus on this object before
-	//queueing
-	__NK_ASSERT_DEBUG(self.iClientDataRequest->IsReady());
-
-	// This is an inelegant, temporary, solution to the following problem:
-	//
-	// If a dma request completes with an ISR callback the test
-	// framework will queue this function as a DFC which
-	// will then signal the user-side client. As a consequence of
-	// this the user side client may then decide to destroy this
-	// request. However, untill the DMA framework's DFC has run
-	// and called OnDeque() on this request, it is still considered as
-	// queued. Since it is possible that this DFC could run
-	// before the DMA fw's DFC, this request could get destroyed while
-	// it is stil queued, triggering a PIL assertion.
-	//
-	// The real fix is likely be for the PIL to call the callback
-	// twice, but with different arguments, once to annonunce the
-	// ISR and again to announce the dequeue.
-	//
-	// Here we poll and wait for this request to be dequeued. Note,
-	// this DFC is currently run on a separate DFC queue, otherwise
-	// it could get deadlocked. An alternative to polling would be
-	// to use DCondVar, but that would require PIL modification
-
-	if(NKern::CurrentThread() == self.iDfcQ->iThread)
-		{
-		// Only need to poll if we aren't on the channel's DFC queue
-		for(;;)
-			{
-			// once the request has been unqueued it
-			// can only be queued again by the client
-			const TBool queued = __e32_atomic_load_acq32(&self.iQueued);
-			if(!queued)
-				break;
-			__KTRACE_OPT(KDMA, Kern::Printf("Waiting for requeuest to be dequeued"));
-			NKern::Sleep(10);
-			}
-		}
-	else
-		{
-		// If we are on the channel's DFCQ we should be dequeued
-		// already
-		__NK_ASSERT_DEBUG(!__e32_atomic_load_acq32(&self.iQueued));
-		}
-
-	// We can always complete with KErrNone, the actual DMA result is
-	// logged in the TCallbackRecord
-	Kern::QueueRequestComplete(self.iClient, self.iClientDataRequest, KErrNone);
-	}
-
-const TInt DDmaTestSession::KMaxChunkSize = 8 * KMega;
-
-TInt DDmaTestSession::RequestUserHandle(DThread* aThread, TOwnerType aType)
-	{
-	if (aType!=EOwnerThread || aThread!=iClient)
-		return KErrAccessDenied;
-	return KErrNone;
-	}
-
-DDmaTestSession::DDmaTestSession()
-	: iClient(NULL), iDfcQ(NULL), iIsrCallbackDfcQ(NULL), iChunkBase(0), iChunk(NULL)
-	{}
-
-// called in thread critical section
-TInt DDmaTestSession::DoCreate(TInt /*aUnit*/, const TDesC8* /*aInfo*/, const TVersion& /*aVer*/)
-	{
-	__NK_ASSERT_ALWAYS(iDfcQ == NULL);
-	__NK_ASSERT_ALWAYS(iIsrCallbackDfcQ == NULL);
-
-	TInt r = Kern::DynamicDfcQCreate(iDfcQ, KDFCThreadPriority, KDFCThreadName);
-	if (r != KErrNone)
-		{
-		Kern::Printf("DDmaTestSession::DoCreate D_DMA_DFC_THREAD returned (%d)\n", r);
-		return r;
-		}
-	NKern::ThreadSetCpuAffinity((NThread*)(iDfcQ->iThread), KCpuAffinityAny);
-
-	r = Kern::DynamicDfcQCreate(iIsrCallbackDfcQ, KDFCThreadPriority, KIsrCbDfcThreadName);
-	if (r != KErrNone)
-		{
-		Kern::Printf("DDmaTestSession::DoCreate D_DMA_IsrCb_thread returned (%d)\n", r);
-		return r;
-		}
-	NKern::ThreadSetCpuAffinity((NThread*)(iIsrCallbackDfcQ->iThread), KCpuAffinityAny);
-
-	iClient = &Kern::CurrentThread();
-
-	r = CreateSharedChunk();
-	Kern::Printf("DDmaTestSession::DoCreate CreateSharedChunk returned (%d)\n", r);
-	return r;
-	}
-
-DDmaTestSession::~DDmaTestSession()
-	{
-	//Destroy requests before channels
-	//or we will trigger an assertion
-	while(iClientDmaReqs.Count())
-		{
-		DestroyDmaRequestByIndex(0);
-		}
-	iClientDmaReqs.Close();
-
-	while(iChannels.Count())
-		{
-		CloseDmaChannelByIndex(0);
-		}
-	iChannels.Close();
-
-
-	if (iDfcQ)
-		{
-		iDfcQ->Destroy();
-		}
-
-	if (iIsrCallbackDfcQ)
-		{
-		iIsrCallbackDfcQ->Destroy();
-		}
-
-	if(iChunk)
-		{
-		Kern::ChunkClose(iChunk);
-		iChunk = NULL;
-		}
-	}
-
-TInt DDmaTestSession::Request(TInt aFunction, TAny* a1, TAny* a2)
-	{
-	__NK_ASSERT_DEBUG(&Kern::CurrentThread() == iClient);
-
-	switch (aFunction)
-		{
-	case RDmaSession::EOpenChannel:
-			{
-			TUint pslCookie = (TUint)a1;
-			TUint driverCookie = 0;
-			TInt r = OpenDmaChannel(pslCookie, driverCookie);
-			umemput32(a2, &driverCookie, sizeof(TAny*));
-			return r;
-			}
-	case RDmaSession::EOpenChannelExposed:
-			{
-			TDmaChannel::SCreateInfo openInfo;
-			TUint driverCookie = 0;
-
-			TPckgBuf<SCreateInfoTest> openArgsBuf;
-			Kern::KUDesGet(openArgsBuf, *reinterpret_cast<TDes8*>(a2));
-
-			SCreateInfoTest& openTestInfo = openArgsBuf();
-			openInfo.iCookie = openTestInfo.iCookie;
-			openInfo.iDesCount = openTestInfo.iDesCount;
-			openInfo.iDfcQ = iDfcQ;
-			openInfo.iDfcPriority = openTestInfo.iDfcPriority;
-
-			#ifdef DMA_APIV2
-				openInfo.iPriority = openTestInfo.iPriority;
-				openInfo.iDynChannel = openTestInfo.iDynChannel;
-			#endif
-
-			TInt r = OpenDmaChannel(driverCookie, openInfo);
-			umemput32(a1, &driverCookie, sizeof(TAny*));
-			Kern::KUDesPut(*reinterpret_cast<TDes8*>(a2), openArgsBuf);
-			return r;
-			}
-	case RDmaSession::ECloseChannel:
-			{
-			TUint driverCookie = reinterpret_cast<TUint>(a1);
-			TInt r = CloseDmaChannelByCookie(driverCookie);
-			return r;
-			}
-	case RDmaSession::EChannelCaps:
-			{
-			TUint driverCookie = reinterpret_cast<TUint>(a1);
-			TPckgBuf<TDmacTestCaps> capsBuf;
-			TInt r = GetChannelCapsByCookie(driverCookie, capsBuf());
-			Kern::KUDesPut(*reinterpret_cast<TDes8*>(a2), capsBuf);
-			return r;
-			}
-	case RDmaSession::EPauseChannel:
-			{
-			TUint driverCookie = reinterpret_cast<TUint>(a1);
-			TInt r = PauseDmaChannelByCookie(driverCookie);
-			return r;
-			}
-	case RDmaSession::EResumeChannel:
-			{
-			TUint driverCookie = reinterpret_cast<TUint>(a1);
-			TInt r = ResumeDmaChannelByCookie(driverCookie);
-			return r;
-			}
-	case RDmaSession::ELinkChannel:
-			{
-			TUint driverCookie = reinterpret_cast<TUint>(a1);
-			TInt r = LinkDmaChannelByCookie(driverCookie);
-			return r;
-			}
-	case RDmaSession::EUnlinkChannel:
-			{
-			TUint driverCookie = reinterpret_cast<TUint>(a1);
-			TInt r = UnlinkDmaChannelByCookie(driverCookie);
-			return r;
-			}
-	case RDmaSession::EFragmentCount:
-			{
-			TUint requestCookie = reinterpret_cast<TUint>(a1);
-			TInt r = RequestFragmentCount(requestCookie);
-			return r;
-			}
-	case RDmaSession::EEnableDstElementCounting:
-			{		
-			TUint requestCookie = reinterpret_cast<TUint>(a1);
-			TInt r = EnableDstElementCountingByCookie(requestCookie);
-			return r;
-			}
-	case RDmaSession::EEnableSrcElementCounting:
-			{
-			TUint requestCookie = reinterpret_cast<TUint>(a1);		
-			TInt r = EnableSrcElementCountingByCookie(requestCookie);
-			return r;
-			}
-	case RDmaSession::EDisableDstElementCounting:
-			{
-			TUint requestCookie = reinterpret_cast<TUint>(a1);
-			TInt r = DisableDstElementCountingByCookie(requestCookie);
-			return r;
-			}
-	case RDmaSession::EDisableSrcElementCounting:
-			{
-			TUint requestCookie = reinterpret_cast<TUint>(a1);
-			TInt r = DisableSrcElementCountingByCookie(requestCookie);
-			return r;
-			}
-	case RDmaSession::ETotalNumDstElementsTransferred:
-			{
-			TUint requestCookie = reinterpret_cast<TUint>(a1);
-			TInt r = TotalNumDstElementsTransferredByCookie(requestCookie);
-			return r;
-			}
-	case RDmaSession::ETotalNumSrcElementsTransferred:
-			{
-			TUint requestCookie = reinterpret_cast<TUint>(a1);
-			TInt r = TotalNumSrcElementsTransferredByCookie(requestCookie);
-			return r;
-			}
-	case RDmaSession::ERequestOpen:
-			{
-			RDmaSession::TRequestCreateArgs createArgs(0, EFalse, 0);
-			TPckg<RDmaSession::TRequestCreateArgs> package(createArgs);
-			Kern::KUDesGet(package, *reinterpret_cast<TDes8*>(a1));
-
-			const TUint channelCookie = createArgs.iChannelCookie;
-			TUint requestCookie = 0;
-
-			TInt r = CreateDmaRequest(channelCookie, requestCookie, createArgs.iNewStyle, createArgs.iMaxFragmentSize);
-
-			umemput32(a2, &requestCookie, sizeof(TAny*));
-			return r;
-			}
-	case RDmaSession::ERequestClose:
-			{
-			const TUint requestCookie = reinterpret_cast<TUint>(a1);
-			return DestroyDmaRequestByCookie(requestCookie);
-			}
-	case RDmaSession::EFragmentLegacy:
-	case RDmaSession::EFragment:
-			{
-			TPckgBuf<RDmaSession::TFragmentArgs> argsBuff;
-			Kern::KUDesGet(argsBuff, *reinterpret_cast<TDes8*>(a1));
-			const TUint requestCookie = argsBuff().iRequestCookie;
-
-			//must remove constness as we actually need to
-			//convert the src and dst offsets to addresses
-			TDmaTransferArgs& transferArgs = const_cast<TDmaTransferArgs&>(argsBuff().iTransferArgs);
-
-			//convert address offsets in to kernel virtual addresses
-			MakeAddressesAbsoulute(transferArgs);
-
-			TInt r = KErrGeneral;
-			if (!TAddressParms(transferArgs).CheckRange(iChunkBase, iChunk->Size()))
-			{
-				// Return error code for invalid src and destination arguments used in tranferArgs
-				r=KErrArgument;
-				return r;
-			}
-
-			TStopwatch clock;
-			clock.Start();
-			switch (aFunction)
-				{
-			case RDmaSession::EFragmentLegacy:
-				r = FragmentRequest(requestCookie, transferArgs, ETrue); break;
-			case RDmaSession::EFragment:
-				r = FragmentRequest(requestCookie, transferArgs, EFalse); break;
-			default:
-				TEST_FAULT;
-				}
-			clock.Stop();
-
-			const TUint64 time = clock.ReadMicroSecs();
-
-			TUint64* const timePtr = argsBuff().iDurationMicroSecs;
-			if(timePtr)
-				{
-				umemput(timePtr, &time, sizeof(time));
-				}
-			return r;
-			}
-	case RDmaSession::EQueueRequest:
-			{
-			TPckgBuf<RDmaSession::TQueueArgs> argsBuff;
-			Kern::KUDesGet(argsBuff, *reinterpret_cast<TDes8*>(a1));
-
-			//this is an Asynchronous request
-			const TUint requestCookie = argsBuff().iRequestCookie;
-			TRequestStatus* requestStatus = argsBuff().iStatus;
-			TCallbackRecord* callbackRec = argsBuff().iCallbackRecord;
-			TUint64* duration = argsBuff().iDurationMicroSecs;
-
-			TInt r = QueueRequest(requestCookie, requestStatus, callbackRec, duration);
-			if(r != KErrNone)
-				{
-				Kern::RequestComplete(requestStatus, r);
-				}
-			return r;
-			}	
-	case RDmaSession::EQueueRequestWithReque:
-			{
-			TPckgBuf<RDmaSession::TQueueArgsWithReque> argsBuff;
-			Kern::KUDesGet(argsBuff, *reinterpret_cast<TDes8*>(a1));
-
-			//this is an Asynchronous request
-			const TUint requestCookie = argsBuff().iRequestCookie;
-			TRequestStatus* requestStatus = argsBuff().iStatus;
-			TCallbackRecord* callbackRec = argsBuff().iCallbackRecord;
-			TUint64* duration = argsBuff().iDurationMicroSecs;
-
-			TInt r = KErrNotFound;
-
-			DClientDmaRequest* const request = RequestFromCookie(requestCookie);
-			if(request != NULL)
-				{
-				TIsrRequeArgsSet& requeArgs = argsBuff().iRequeSet;
-				requeArgs.Fixup(iChunkBase);
-
-				TEST_ASSERT(requeArgs.CheckRange(iChunkBase, iChunk->Size(), request->GetAddressParms() ));
-				request->AddRequeArgs(requeArgs);
-
-				r = QueueRequest(requestCookie, requestStatus, callbackRec, duration);
-				}
-
-			if(r != KErrNone)
-				{
-				Kern::RequestComplete(requestStatus, r);
-				}
-			return r;
-			}
-	case RDmaSession::EIsOpened:
-			{
-			TUint driverCookie = (TUint)a1;
-			TBool channelOpen = EFalse;;
-			TInt r = ChannelIsOpenedByCookie(driverCookie,channelOpen);	
-			umemput32(a2, &channelOpen, sizeof(TAny*));
-			return r;		
-			}
-	case RDmaSession::EIsQueueEmpty:
-			{
-			TUint driverCookie = (TUint)a1;
-			TBool queueEmpty = EFalse;;
-			TInt r = IsQueueEmptyByCookie(driverCookie,queueEmpty);	
-			umemput32(a2, &queueEmpty, sizeof(TAny*));
-			return r;
-			}
-	case RDmaSession::ECancelAllChannel:
-			{
-			TUint driverCookie = reinterpret_cast<TUint>(a1);
-			TInt r = CancelAllByCookie(driverCookie);
-			return r;
-			}
-	case RDmaSession::EOpenSharedChunk:
-			{
-			return OpenSharedChunkHandle();
-			}
-	case RDmaSession::EGetTestInfo:
-			{
-#ifdef DMA_APIV2
-			TPckgC<TDmaV2TestInfo> package(DmaTestInfoV2());
-#else
-			TPckgC<TDmaV2TestInfo> package(ConvertTestInfo(DmaTestInfo()));
-#endif
-			Kern::KUDesPut(*reinterpret_cast<TDes8*>(a1), package);
-			return KErrNone;
-			}
-	default:
-		Kern::PanicCurrentThread(KClientPanicCat, __LINE__);
-		return KErrGeneral;
-		}
-	}
-
-TInt DDmaTestSession::OpenDmaChannel(TUint& aDriverCookie, TDmaChannel::SCreateInfo& aInfo)
-	{
-	//cs so thread can't be killed between
-	//opening channel and adding to array
-	NKern::ThreadEnterCS();
-	TDmaChannel* channel = NULL;
-	TInt r = TDmaChannel::Open(aInfo, channel);
-	if(KErrNone == r)
-		{
-		__NK_ASSERT_ALWAYS(channel);
-
-		__KTRACE_OPT(KDMA, Kern::Printf("OpenDmaChannel: channel@ 0x%08x", channel));
-
-		r = iChannels.Append(channel);
-		if(KErrNone == r)
-			{
-			aDriverCookie = reinterpret_cast<TUint>(channel);
-			}
-		else
-			{
-			channel->Close();
-			r = KErrNoMemory;
-			}
-		}
-	NKern::ThreadLeaveCS();
-
-	return r;
-	}
-
-/**
-Open a DMA channel with arbitrary default parameters
-*/
-TInt DDmaTestSession::OpenDmaChannel(TUint aPslCookie, TUint& aDriverCookie )
-	{
-	TDmaChannel::SCreateInfo info;
-	info.iCookie = aPslCookie;
-	info.iDfcQ = iDfcQ;
-	info.iDfcPriority = 3;
-	info.iDesCount = 128;
-
-	return OpenDmaChannel(aDriverCookie, info);
-	}
-
-TInt DDmaTestSession::CookieToChannelIndex(TUint aDriverCookie) const
-	{
-	const TInt r = iChannels.Find(reinterpret_cast<TDmaChannel*>(aDriverCookie));
-
-	if(r < 0)
-		{
-		__KTRACE_OPT(KDMA, Kern::Printf("CookieToChannelIndex: cookie 0x%08x not found!", aDriverCookie)); 
-		}
-	return r;
-	}
-
-TInt DDmaTestSession::CookieToRequestIndex(TUint aRequestCookie) const
-	{
-	const TInt r = iClientDmaReqs.Find(reinterpret_cast<DClientDmaRequest*>(aRequestCookie));
-
-	if(r < 0)
-		{
-		__KTRACE_OPT(KDMA, Kern::Printf("CookieToRequestIndex: cookie 0x%08x not found!", aRequestCookie)); 
-		}
-	return r;
-	}
-
-void DDmaTestSession::CloseDmaChannelByIndex(TInt aIndex)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("CloseDmaChannelByIndex: %d", aIndex)); 
-	__NK_ASSERT_DEBUG(aIndex < iChannels.Count()); 
-	// cs so client thread can't be killed between removing channel from
-	// array and closing it.
-	NKern::ThreadEnterCS();
-	TDmaChannel* channel = iChannels[aIndex];
-	iChannels.Remove(aIndex);
-	channel->Close();
-	NKern::ThreadLeaveCS();
-	}
-
-TInt DDmaTestSession::CloseDmaChannelByCookie(TUint aDriverCookie)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("CloseDmaChannelByCookie: 0x%08x", aDriverCookie)); 
-	const TInt index = CookieToChannelIndex(aDriverCookie);
-	
-	if(index >= 0)
-		{
-		CloseDmaChannelByIndex(index);
-		return KErrNone;
-		}
-	else
-		{
-		return KErrNotFound;
-		}
-	}
-
-TInt DDmaTestSession::CancelAllByCookie(TUint aDriverCookie)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("CancelAllByCookie: 0x%08x", aDriverCookie)); 
-	const TInt index = CookieToChannelIndex(aDriverCookie);
-	
-	if(index >= 0)
-		{
-		CancelAllByIndex(index);
-		return KErrNone;
-		}
-	else
-		{
-		return KErrNotFound;
-		}
-	}
-
-void DDmaTestSession::CancelAllByIndex(TInt aIndex)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("CancelAllByIndex: %d", aIndex)); 
-	__NK_ASSERT_DEBUG(aIndex < iChannels.Count()); 
-	
-	TDmaChannel* channel = iChannels[aIndex];	
-	channel->CancelAll();
-	}
-
-TInt DDmaTestSession::LinkDmaChannelByIndex(TInt aIndex)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("LinkDmaChannelByIndex: %d", aIndex)); 
-	__NK_ASSERT_DEBUG(aIndex < iChannels.Count()); 
-
-#ifdef DMA_APIV2
-	TDmaChannel* channel = iChannels[aIndex];
-	return channel->LinkToChannel(channel);
-#else
-	return KErrNotSupported;
-#endif	
-	}
-
-TInt DDmaTestSession::LinkDmaChannelByCookie(TUint aDriverCookie)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("LinkDmaChannelByCookie: 0x%08x", aDriverCookie)); 
-	const TInt index = CookieToChannelIndex(aDriverCookie);
-	
-	if(index >= 0)
-		{
-		TInt r = LinkDmaChannelByIndex(index);
-		return r;
-		}
-	else
-		{
-		return KErrNotFound;
-		}
-	}
-
-TInt DDmaTestSession::UnlinkDmaChannelByIndex(TInt aIndex)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("UnlinkDmaChannelByIndex: %d", aIndex)); 
-	__NK_ASSERT_DEBUG(aIndex < iChannels.Count()); 
-
-#ifdef DMA_APIV2
-	TDmaChannel* channel = iChannels[aIndex];
-	return channel->LinkToChannel(NULL);
-#else
-	return KErrNotSupported;
-#endif	
-	}
-
-TInt DDmaTestSession::UnlinkDmaChannelByCookie(TUint aDriverCookie)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("UnlinkDmaChannelByCookie: 0x%08x", aDriverCookie)); 
-	const TInt index = CookieToChannelIndex(aDriverCookie);
-	
-	if(index >= 0)
-		{
-		TInt r = UnlinkDmaChannelByIndex(index);
-		return r;
-		}
-	else
-		{
-		return KErrNotFound;
-		}
-	}
-
-TInt DDmaTestSession::PauseDmaChannelByIndex(TInt aIndex)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("PauseDmaChannelByIndex: %d", aIndex)); 
-	__NK_ASSERT_DEBUG(aIndex < iChannels.Count()); 
-
-#ifdef DMA_APIV2
-	TDmaChannel* channel = iChannels[aIndex];
-	return channel->Pause();
-#else
-	return KErrNotSupported;
-#endif	
-	}
-
-TInt DDmaTestSession::PauseDmaChannelByCookie(TUint aDriverCookie)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("PauseDmaChannelByCookie: 0x%08x", aDriverCookie)); 
-	const TInt index = CookieToChannelIndex(aDriverCookie);
-	
-	if(index >= 0)
-		{
-		TInt r = PauseDmaChannelByIndex(index);
-		return r;
-		}
-	else
-		{
-		return KErrNotFound;
-		}
-	}
-
-TInt DDmaTestSession::ResumeDmaChannelByIndex(TInt aIndex)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("ResumeDmaChannelByIndex: %d", aIndex)); 
-	__NK_ASSERT_DEBUG(aIndex < iChannels.Count()); 
-
-#ifdef DMA_APIV2
-	TDmaChannel* channel = iChannels[aIndex];
-	return channel->Resume();
-#else
-	return KErrNotSupported;
-#endif
-	}
-
-TInt DDmaTestSession::ResumeDmaChannelByCookie(TUint aDriverCookie)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("ResumeDmaChannelByCookie: 0x%08x", aDriverCookie)); 
-	const TInt index = CookieToChannelIndex(aDriverCookie);
-	
-	if(index >= 0)
-		{
-		TInt r = ResumeDmaChannelByIndex(index);
-		return r;
-		}
-	else
-		{
-		return KErrNotFound;
-		}
-	}
-
-TInt DDmaTestSession::EnableDstElementCountingByCookie(TUint aDriverCookie)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("EnableDstElementCountingByCookie: 0x%08x", aDriverCookie)); 
-	const TInt index = CookieToRequestIndex(aDriverCookie);
-	
-	if(index >= 0)
-		{
-		EnableDstElementCountingByIndex(index);
-		return KErrNone;
-		}
-	else
-		{
-		return KErrNotFound;
-		}
-	}
-
-void DDmaTestSession::EnableDstElementCountingByIndex(TInt aIndex)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("EnableDstElementCountingByIndex: %d", aIndex)); 		
-	__NK_ASSERT_DEBUG(aIndex < iClientDmaReqs.Count()); 
-#ifdef DMA_APIV2	
-	iClientDmaReqs[aIndex]->EnableDstElementCounting();
-#endif
-	}
-
-TInt DDmaTestSession::EnableSrcElementCountingByCookie(TUint aDriverCookie)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("EnableSrcElementCountingByCookie: 0x%08x", aDriverCookie)); 
-	const TInt index = CookieToRequestIndex(aDriverCookie);
-	
-	if(index >= 0)
-		{
-		EnableSrcElementCountingByIndex(index);
-		return KErrNone;
-		}
-	else
-		{
-		return KErrNotFound;
-		}
-	}
-
-void DDmaTestSession::EnableSrcElementCountingByIndex(TInt aIndex)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("EnableSrcElementCountingByIndex: %d", aIndex)); 		
-	__NK_ASSERT_DEBUG(aIndex < iClientDmaReqs.Count()); 
-	
-#ifdef DMA_APIV2
-	iClientDmaReqs[aIndex]->EnableSrcElementCounting();
-#endif
-	}
-
-TInt DDmaTestSession::DisableDstElementCountingByCookie(TUint aDriverCookie)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DisableDstElementCountingByCookie: 0x%08x", aDriverCookie)); 
-	const TInt index = CookieToRequestIndex(aDriverCookie);
-	
-	if(index >= 0)
-		{
-		DisableDstElementCountingByIndex(index);
-		return KErrNone;
-		}
-	else
-		{
-		return KErrNotFound;
-		}
-	}
-
-void DDmaTestSession::DisableDstElementCountingByIndex(TInt aIndex)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DisableDstElementCountingByIndex: %d", aIndex)); 		
-	__NK_ASSERT_DEBUG(aIndex < iClientDmaReqs.Count()); 
-#ifdef DMA_APIV2
-	iClientDmaReqs[aIndex]->DisableDstElementCounting();
-#endif
-	}
-
-TInt DDmaTestSession::DisableSrcElementCountingByCookie(TUint aDriverCookie)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DisableSrcElementCountingByCookie: 0x%08x", aDriverCookie)); 
-	const TInt index = CookieToRequestIndex(aDriverCookie);
-	
-	if(index >= 0)
-		{
-		DisableSrcElementCountingByIndex(index);
-		return KErrNone;
-		}
-	else
-		{
-		return KErrNotFound;
-		}
-	}
-
-void DDmaTestSession::DisableSrcElementCountingByIndex(TInt aIndex)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DisableSrcElementCountingByIndex: %d", aIndex)); 		
-	__NK_ASSERT_DEBUG(aIndex < iClientDmaReqs.Count()); 
-#ifdef DMA_APIV2
-	iClientDmaReqs[aIndex]->DisableSrcElementCounting();
-#endif
-	}
-
-TInt DDmaTestSession::TotalNumDstElementsTransferredByCookie(TUint aDriverCookie)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TotalNumDstElementsTransferredByCookie: 0x%08x", aDriverCookie)); 
-	const TInt index = CookieToRequestIndex(aDriverCookie);
-	
-	if(index >= 0)
-		{
-		TInt r = TotalNumDstElementsTransferredByIndex(index);
-		return r;
-		}
-	else
-		{
-		return KErrNotFound;
-		}
-	}
-
-TInt DDmaTestSession::TotalNumDstElementsTransferredByIndex(TInt aIndex)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TotalNumDstElementsTransferredByIndex: %d", aIndex)); 		
-	__NK_ASSERT_DEBUG(aIndex < iClientDmaReqs.Count()); 
-	
-#ifdef DMA_APIV2
-	TInt r = iClientDmaReqs[aIndex]->TotalNumDstElementsTransferred();
-	return r;
-#else
-	return KErrNotSupported;
-#endif
-	}
-
-TInt DDmaTestSession::TotalNumSrcElementsTransferredByCookie(TUint aDriverCookie)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TotalNumSrcElementsTransferredByCookie: 0x%08x", aDriverCookie)); 
-	const TInt index = CookieToRequestIndex(aDriverCookie);
-	
-	if(index >= 0)
-		{
-		TInt r = TotalNumSrcElementsTransferredByIndex(index);
-		return r;
-		}
-	else
-		{
-		return KErrNotFound;
-		}
-	}
-
-TInt DDmaTestSession::TotalNumSrcElementsTransferredByIndex(TInt aIndex)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("TotalNumSrcElementsTransferredByIndex: %d", aIndex)); 		
-	__NK_ASSERT_DEBUG(aIndex < iClientDmaReqs.Count()); 
-	
-#ifdef DMA_APIV2
-	TInt r = iClientDmaReqs[aIndex]->TotalNumSrcElementsTransferred();
-	return r;
-#else
-	return KErrNotSupported;
-#endif
-	}
-TInt DDmaTestSession::IsrRedoRequestByCookie(TUint aDriverCookie,TUint32 aSrcAddr,TUint32 aDstAddr,TInt aTransferCount,TUint32 aPslRequestInfo,TBool aIsrCb)
-{
-	__KTRACE_OPT(KDMA, Kern::Printf("IsrRedoRequestByCookie: 0x%08x", aDriverCookie)); 
-	const TInt index = CookieToChannelIndex(aDriverCookie);
-	
-	if(index >= 0)
-		{
-		TInt r = IsrRedoRequestByIndex(index,aSrcAddr,aDstAddr,aTransferCount,aPslRequestInfo,aIsrCb);
-		return r;
-		}
-	else
-		{
-		return KErrNotFound;
-		}
-}
-
-TInt DDmaTestSession::IsrRedoRequestByIndex(TInt aIndex,TUint32 aSrcAddr,TUint32 aDstAddr,TInt aTransferCount,TUint32 aPslRequestInfo,TBool aIsrCb)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("IsrRedoRequestByIndex: %d", aIndex)); 
-	__NK_ASSERT_DEBUG(aIndex < iChannels.Count()); 
-
-#ifdef DMA_APIV2
-	TDmaChannel* channel = iChannels[aIndex];
-	return channel->IsrRedoRequest(aSrcAddr,aDstAddr,aTransferCount,aPslRequestInfo,aIsrCb);
-#else
-	return KErrNotSupported;
-#endif
-	}
-
-/**
-aChannelCaps will be set to "NULL" values
-*/
-TInt DDmaTestSession::GetChannelCapsByCookie(TUint aDriverCookie, TDmacTestCaps& aChannelCaps)
-	{
-	SDmacCaps caps = {0,}; //initialise with NULL values
-	TInt r = GetChannelCapsByCookie(aDriverCookie, caps);
-
-	if(r == KErrNotSupported)
-		{
-		//If we can not query caps it means
-		//that we are using the v1 driver
-		//we construct a empty TDmacTestCaps
-		//but with an iPILVersion of 1
-		const TDmacTestCaps nullCapsV1(caps, 1);
-		aChannelCaps = nullCapsV1;
-		r = KErrNone;
-		}
-	else if(r == KErrNone)
-		{
-		const TDmacTestCaps capsV2(caps, 2);
-		aChannelCaps = capsV2;
-		}
-
-	return r;
-	}
-
-/**
-Will return the capabilities of the DMA channel.
-Querying SDmacCaps is not possible on V1 of the DMA framework.
-In that case an error of KErrNotSupported will be returned
-*/
-TInt DDmaTestSession::GetChannelCapsByCookie(TUint aDriverCookie, SDmacCaps& aChannelCaps)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("GetChannelCapsByCookie: 0x%08x", aDriverCookie)); 
-	const TInt index = CookieToChannelIndex(aDriverCookie);
-	if(index >= 0)
-		{
-#ifdef DMA_APIV2
-		aChannelCaps = iChannels[index]->DmacCaps();
-		return KErrNone;
-#else
-		return KErrNotSupported;
-#endif
-		}
-	else
-		{
-		return KErrNotFound;
-		}
-	}
-
-TInt DDmaTestSession::IsQueueEmptyByCookie(TUint aDriverCookie, TBool& aQueueEmpty)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("IsQueueEmptyByCookie: 0x%08x", aDriverCookie)); 
-	const TInt index = CookieToChannelIndex(aDriverCookie);
-	
-	if(index >= 0)
-		{
-		aQueueEmpty=iChannels[index]->IsQueueEmpty();
-		return KErrNone;
-		}
-	else
-		{
-		return KErrNotFound;
-		}
-	}
-
-TInt DDmaTestSession::ChannelIsOpenedByCookie(TUint aDriverCookie, TBool& aChannelOpen)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("ChannelIsOpenedByCookie: 0x%08x", aDriverCookie)); 
-	const TInt index = CookieToChannelIndex(aDriverCookie);
-	
-	if(index >= 0)
-		{
-		aChannelOpen=iChannels[index]->IsOpened();
-		return KErrNone;
-		}
-	else
-		{
-		return KErrNotFound;
-		}
-	}
-
-TInt DDmaTestSession::CreateDmaRequest(TUint aChannelCookie, TUint& aRequestCookie, TBool aNewCallback, TInt aMaxFragmentSizeBytes)
-	{
-#ifndef DMA_APIV2
-	if(aNewCallback)
-		return KErrNotSupported;
-#endif
-
-	TInt channelIndex = CookieToChannelIndex(aChannelCookie);
-	if(channelIndex < 0)
-		return channelIndex;
-
-	NKern::ThreadEnterCS();
-	DClientDmaRequest* request = DClientDmaRequest::Construct(iClient, iIsrCallbackDfcQ, *iChannels[channelIndex], aNewCallback, aMaxFragmentSizeBytes);
-	if(request == NULL)
-		{
-		NKern::ThreadLeaveCS();
-		return KErrNoMemory;
-		}
-
-	TInt r = iClientDmaReqs.Append(request);
-	if(r == KErrNone)
-		{
-		aRequestCookie = reinterpret_cast<TUint>(request);
-		}
-	else
-		{
-		delete request;
-		}
-	NKern::ThreadLeaveCS();
-	
-	return r;
-	}
-
-TInt DDmaTestSession::DestroyDmaRequestByCookie(TUint aRequestCookie)
-	{
-	TInt requestIndex = CookieToRequestIndex(aRequestCookie);
-	if(requestIndex < 0)
-		return requestIndex;
-
-	DestroyDmaRequestByIndex(requestIndex);
-
-	return KErrNone;
-	}
-
-void DDmaTestSession::DestroyDmaRequestByIndex(TInt aIndex)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf("DestroyDmaRequestByIndex: %d", aIndex)); 
-	__NK_ASSERT_DEBUG(aIndex < iClientDmaReqs.Count()); 
-	NKern::ThreadEnterCS();
-
-	DClientDmaRequest* request = iClientDmaReqs[aIndex];
-	iClientDmaReqs.Remove(aIndex);
-	delete request;
-
-	NKern::ThreadLeaveCS();
-	}
-
-TInt DDmaTestSession::CreateSharedChunk()
-	{
-    // Enter critical section so we can't die and leak the objects we are creating
-    // I.e. the TChunkCleanup and DChunk (Shared Chunk)
-    NKern::ThreadEnterCS();
-
-    // Create the chunk
-    TChunkCreateInfo info;
-    info.iType         = TChunkCreateInfo::ESharedKernelSingle;
-    info.iMaxSize      = KMaxChunkSize;
-#ifndef __WINS__
-    info.iMapAttr      = EMapAttrFullyBlocking | EMapAttrUserRw;
-#endif
-
-    info.iOwnsMemory   = ETrue;
-    info.iDestroyedDfc = NULL;
-
-    DChunk* chunk;
-	TUint32 mapAttr;
-    TInt r = Kern::ChunkCreate(info, chunk, iChunkBase, mapAttr);
-    if(r!=KErrNone)
-        {
-        NKern::ThreadLeaveCS();
-        return r;
-        }
-
-    // Map our device's memory into the chunk (at offset 0)
-	TUint32 physicalAddr;
-	r = Kern::ChunkCommitContiguous(chunk,0,KMaxChunkSize, physicalAddr);
-    if(r!=KErrNone)
-        {
-        // Commit failed so tidy-up...
-        Kern::ChunkClose(chunk);
-        }
-    else
-        {
-        iChunk = chunk;
-        }
-
-    // Can leave critical section now that we have saved pointers to created objects
-    NKern::ThreadLeaveCS();
-
-    return r;
-	}
-
-TUint DDmaTestSession::OpenSharedChunkHandle()
-	{
-	NKern::ThreadEnterCS();
-	const TInt r = Kern::MakeHandleAndOpen(NULL, iChunk);
-	NKern::ThreadLeaveCS();
-	return r;
-	}
-
-/**
-Replace addresses specified as an offset from the chunk base with absolute
-virtual addresses.
-*/
-void DDmaTestSession::MakeAddressesAbsoulute(TDmaTransferArgs& aTransferArgs) const
-	{
-	aTransferArgs.iSrcConfig.iAddr += iChunkBase;
-	aTransferArgs.iDstConfig.iAddr += iChunkBase;
-	}
-
-#ifndef DMA_APIV2
-static TInt FragmentCount(DDmaRequest* aRequest)
-	{
-	TInt count = 0;
-	for (SDmaDesHdr* pH = aRequest->iFirstHdr; pH != NULL; pH = pH->iNext)
-		count++;
-	return count;
-	}
-#endif
-
-TInt DDmaTestSession::RequestFragmentCount(TUint aRequestCookie)
-	{
-	TInt requestIndex = CookieToRequestIndex(aRequestCookie);
-	if(requestIndex < 0)
-		return requestIndex;
-#ifdef DMA_APIV2
-	TInt r = iClientDmaReqs[requestIndex]->FragmentCount();
-#else
-	TInt r = FragmentCount(iClientDmaReqs[requestIndex]);
-#endif
-
-	return r;
-	}
-
-TInt DDmaTestSession::FragmentRequest(TUint aRequestCookie, const TDmaTransferArgs& aTransferArgs, TBool aLegacy)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf(">FragmentRequest: cookie=0x%08x, legacy=%d", aRequestCookie, aLegacy)); 
-	TInt requestIndex = CookieToRequestIndex(aRequestCookie);
-	if(requestIndex < 0)
-		return requestIndex;
-
-	DClientDmaRequest& request = *iClientDmaReqs[requestIndex];
-	request.SetAddressParms(aTransferArgs);
-
-	TInt r = KErrNotSupported;
-
-	if (aTransferArgs.iTransferCount < 1)
-		{
-		// Return error code for invalid transfer size used in tranferArgs
-		r=KErrArgument;
-		return r;
-		}
-
-	if(aLegacy)
-		{
-		TUint flags = KDmaMemSrc | KDmaIncSrc | KDmaMemDest | KDmaIncDest;
-		const TUint src = aTransferArgs.iSrcConfig.iAddr;
-		const TUint dst = aTransferArgs.iDstConfig.iAddr;
-		r = request.Fragment(src, dst, aTransferArgs.iTransferCount, flags, NULL);
-		}
-	else
-		{
-#ifdef DMA_APIV2
-		r = request.Fragment(aTransferArgs);
-#endif
-		}
-	return r;
-	}
-
-/**
-Queue the request refered to by aRequestCookie
-
-@param aRequestCookie Client identifier for the DDmaRequest
-@param aStatus Pointer to the client's TRequestStatus
-@param aRecord Pointer to the client's TCallbackRecord
-@return
-   - KErrNotFound - aRequestCookie was invalid
-   - KErrNone - Success
-*/
-TInt DDmaTestSession::QueueRequest(TUint aRequestCookie, TRequestStatus* aStatus, TCallbackRecord* aRecord, TUint64* aDurationMicroSecs)
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf(">QueueRequest: 0x%08x", aRequestCookie)); 
-
-	DClientDmaRequest* request = RequestFromCookie(aRequestCookie);
-	if(request == NULL)
-		return KErrNotFound;
-
-	return request->Queue(aStatus, aRecord, aDurationMicroSecs);
-	}
-
-DClientDmaRequest* DDmaTestSession::RequestFromCookie(TUint aRequestCookie) const
-	{
-	TInt requestIndex = CookieToRequestIndex(aRequestCookie);
-	if(requestIndex < 0)
-		return NULL;
-
-	return (iClientDmaReqs[requestIndex]);
-	}
-
-TDmaV2TestInfo DDmaTestSession::ConvertTestInfo(const TDmaTestInfo& aOldInfo) const
-	{
-	TDmaV2TestInfo newInfo;
-	newInfo.iMaxTransferSize = aOldInfo.iMaxTransferSize;
-	newInfo.iMemAlignMask = aOldInfo.iMemAlignMask;
-	newInfo.iMemMemPslInfo = aOldInfo.iMemMemPslInfo;
-
-	newInfo.iMaxSbChannels = aOldInfo.iMaxSbChannels;
-		{
-		for(TInt i=0; i<aOldInfo.iMaxSbChannels; i++)
-			{
-			newInfo.iSbChannels[i] = aOldInfo.iSbChannels[i];
-			}
-		}
-
-	newInfo.iMaxDbChannels = aOldInfo.iMaxDbChannels;
-		{
-		for(TInt i=0; i<aOldInfo.iMaxDbChannels; i++)
-			{
-			newInfo.iDbChannels[i] = aOldInfo.iDbChannels[i];
-			}
-		}
-
-	newInfo.iMaxSgChannels = aOldInfo.iMaxSgChannels;
-		{
-		for(TInt i=0; i<aOldInfo.iMaxSgChannels; i++)
-			{
-			newInfo.iSgChannels[i] = aOldInfo.iSgChannels[i];
-			}
-		}
-
-	return newInfo;
-	}
-//////////////////////////////////////////////////////////////////////////////
-
-class DDmaTestFactory : public DLogicalDevice
-	{
-public:
-	DDmaTestFactory();
-	// from DLogicalDevice
-	virtual ~DDmaTestFactory()
-		{
-		__KTRACE_OPT(KDMA, Kern::Printf(">DDmaTestFactory::~DDmaTestFactory"));
-		}
-	virtual TInt Install();
-	virtual void GetCaps(TDes8& aDes) const;
-	virtual TInt Create(DLogicalChannelBase*& aChannel);
-	};
-
-
-DDmaTestFactory::DDmaTestFactory()
-    {
-    iVersion = TestDmaLddVersion();
-    iParseMask = KDeviceAllowUnit;							// no info, no PDD    
-    }
-
-
-TInt DDmaTestFactory::Create(DLogicalChannelBase*& aChannel)
-    {
-	aChannel=new DDmaTestSession;
-	Kern::Printf("DDmaTestFactory::Create %d\n", aChannel?KErrNone : KErrNoMemory);
-	return aChannel ? KErrNone : KErrNoMemory;
-    }
-
-
-TInt DDmaTestFactory::Install()
-    {
-    TInt r = SetName(&KTestDmaLddName);
-	Kern::Printf("DDmaTestFactory::Install %d\n",r);
-	return r;
-    }
-
-
-void DDmaTestFactory::GetCaps(TDes8& /*aDes*/) const
-    {
-    }
-
-//////////////////////////////////////////////////////////////////////////////
-
-DECLARE_STANDARD_LDD()
-	{
-    return new DDmaTestFactory;
-	}
--- a/kerneltest/e32test/dmav2/d_dma2.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,730 +0,0 @@
-// 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"
-// 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\dmav2\d_dma2.h
-// User-side API for LDD used to test DMAv2 framework.
-// 
-//
-
-#ifndef __D_DMA2_H__
-#define __D_DMA2_H__
-
-#include <e32cmn.h>
-#include <drivers/dmadefs.h>
-
-
-#define ARRAY_LENGTH(ARRAY) sizeof(ARRAY)/sizeof(ARRAY[0])
-
-#ifdef __KERNEL_MODE__
-	#include <nkern.h>
-	#include <kernel.h>
-	#define TEST_FAULT FAULT();
-	#define PRINT(N) Kern::Printf("%s = 0x%08x (%d)", #N, (N), (N))
-	#define PRINTF(X) Kern::Printf X ;
-#else
-	#include <e32std.h>
-	#include <e32debug.h>
-	#define TEST_FAULT {RDebug::Printf("Assertion failure in %s, %d", __FILE__, __LINE__); User::Invariant();}
-	#define PRINT(N) RDebug::Printf("%s = 0x%08x (%d)", #N, (N), (N))
-	#define PRINTF(X) RDebug::Printf X ;
-#endif
-
-#define TEST_ASSERT(C) if(!(C)) {TEST_FAULT;}
-
-const TUint KPhysAddrInvalidUser=0xFFFFFFFFu; // KPhysAddrInvalid is not defined on the user side
-#ifdef __KERNEL_MODE__
-//if this fails then KPhysAddrInvalidUser must be updated to match
-//KPhysAddrInvalid
-__ASSERT_COMPILE(KPhysAddrInvalidUser == KPhysAddrInvalid);
-#else
-const TUint KPhysAddrInvalid = KPhysAddrInvalidUser;
-#endif
-
-#ifdef __KERNEL_MODE__
-//Function to format the output.
-inline void DmaAppendFormat(TDes8& aBuf, const char* aFmt, ...)
-	{
-	if(!(&aBuf))
-		return;
-	VA_LIST list;
-	VA_START(list,aFmt);
-	Kern::AppendFormat(aBuf,aFmt,list);
-	}
-#endif
-
-_LIT(KTestDmaLddNameSim, "TestDmaV2Sim");
-_LIT(KTestDmaLddNameHw, "TestDmaV2");
-#ifdef __DMASIM__
-const TPtrC KTestDmaLddName = KTestDmaLddNameSim();
-#else
-const TPtrC KTestDmaLddName = KTestDmaLddNameHw();
-#endif
-
-inline TVersion TestDmaLddVersion() { return TVersion(1, 0, 1); }
-
-TInt Log2(TInt aNum);
-
-/**
-Indicates the number of each type of call back received
-and their context
-
-@note It does not indicate the context of each callback, only
-the final one
-*/
-const TInt KNumberOfCallbacks = 12;
-
-class TCallbackRecord
-	{
-public:
-	enum TCbContext
-		{ EInvalid, EThread, EIsr };
-
-	TCallbackRecord(
-			TCbContext aContext = EThread,
-			TInt aReq = 0,
-			TInt aReqSrc = 0,
-			TInt aReqDst = 0,
-
-			TInt aDes = 0,
-			TInt aDesSrc = 0,
-			TInt aDesDst = 0,
-
-			TInt aFrame = 0,
-			TInt aFrameSrc = 0,
-			TInt aFrameDst = 0,
-
-			TInt aPause = 0,
-			TInt aPauseSrc = 0,
-			TInt aPauseDst = 0,
-			TDmaResult aResult = EDmaResultOK
-		);
-
-	static TCallbackRecord Empty();
-
-	void Reset();
-
-	/**
-	Allows 2 callback records to be compared
-	*/
-	TBool operator == (const TCallbackRecord aOther) const;
-	void Print() const;
-
-	/**
-	Get the number of callbacks for callback aCbType
-	*/
-	TInt GetCount(TDmaCallbackType aCbType) const;
-
-	void SetCount(TDmaCallbackType aCbType, TInt aCount);
-
-	/**
-	Set the result (expected or actual) from
-	TDmaChannel::IsrRedoRequest
-	 */
-	inline TCallbackRecord& IsrRedoResult(TInt aResult) {iIsrRedoRequestResult = aResult; return *this;}
-
-	/**
-	Reports the context in which the callback occurred.
-	*/
-	inline TCbContext GetContext()
-		{return iContext;}
-
-	/**
-	Updates data based on callback mask aCallbackMask
-	@param aCallbackMask Bitmask of callback events @see TDmaCallbackType
-	@oaram aResult The result reported by the current callback
-	*/
-	void ProcessCallback(TUint aCallbackMask, TDmaResult aResultaContext);
-
-	static void SelfTest();
-
-	// The below methods are setters, which may be chained together
-	// ie. The Named Parameter Idiom
-	// @see http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.18
-	TCallbackRecord& Context(TCbContext aContext) {iContext = aContext; return *this;}
-
-private:
-	TInt BitToIndex(TDmaCallbackType aCbType) const;
-
-	TCbContext CurrentContext() const;
-
-	TInt iCallbackLog[KNumberOfCallbacks];
-
-	TDmaResult iResult;
-	TCbContext iContext;
-	/** Result of the most recent redo request call */
-	TInt iIsrRedoRequestResult;
-	};
-
-/**
-Extends SDmacCaps to contain the DMA PIL
-version being used
-*/
-struct TDmacTestCaps : public SDmacCaps
-	{
-	TDmacTestCaps();
-	TDmacTestCaps(const SDmacCaps& aDmacCaps, TInt aVersion = 2);
-
-	TInt iPILVersion;
-	};
-
-
-/** SCreateInfo for opening DMA - Reused for testing */
-struct SCreateInfoTest
-		{
-		/** Default constructor. Initializes all fields with meaningful default
-			values.
-
-			Must be inline (for now) because exporting it would break existing
-			custom DMA libs as their clients would need the export which would
-			be missing from the custom .def files.
-		*/
-		SCreateInfoTest() : iPriority(KDmaPriorityNone), iDynChannel(EFalse) {};
-
-		/** Identifier used by PSL to select channel to open */
-		TUint32 iCookie;
-		/** Number of descriptors this channel can use.
-
-			This number is not used in the upgraded version of the DMA
-			framework and is kept there only for source compatibility. If the
-			client is certain that it will only ever use that version, then the
-			value passed here doesn't matter - the framework will ignore it.
-
-			@deprecated
-		 */
-		TInt iDesCount;
-		/** DFC queue used to service DMA interrupts.
-
-			The DFC thread priority must be higher than any client thread
-			priority to avoid a situation where a transfer completes while
-			being cancelled and another transfer is started before the DFC
-			thread gets a chance to run. This would lead to a stray DFC.
-		*/
-		//TDfcQue* iDfcQ;
-
-		TAny* iDfcQ;
-
-		/** DFC priority */
-		TUint8 iDfcPriority;
-		/** Used by PSL to configure a channel priority (if possible).
-
-			The default is KDmaPriorityNone (the don't care value).
-
-		    @see TDmaPriority
-		*/
-		TUint iPriority;
-		/** Request a dynamic DMA channel.
-
-			If this is set to ETrue then the Open call is for a 'dynamic' as
-			opposed to a static and solely owned DMA channel. A number of
-			properties of the opened TDmaChannel object will be different in
-			that case.
-
-			The default value is EFalse.
-		 */
-		TBool iDynChannel;
-		};
-
-
-class TDmaChannel;
-
-struct TAddrRange
-	{
-	TAddrRange(TUint aStart, TUint aLength);
-	inline TUint End() const {return (iStart + iLength -1);}
-	inline TUint Start() const {return iStart;}
-
-	inline TBool Contains(TUint aValue) const {return Rng(iStart, aValue, End());}
-	TBool Contains(TAddrRange aRange) const;
-
-	TBool Overlaps(const TAddrRange& aRange) const;
-	TBool IsFilled(TUint8 aValue) const;
-
-	static void SelfTest();
-
-private:
-	TUint iStart;
-	TUint iLength;
-	};
-
-
-struct TAddressParms
-	{
-	TAddressParms(TUint32 aSrcAddr=0, TUint32 aDstAddr=0, TUint aTransferCount=0)
-		:iSrcAddr(aSrcAddr), iDstAddr(aDstAddr), iTransferCount(aTransferCount)
-		{}
-
-	TAddressParms(const TDmaTransferArgs& aArgs)
-		:iSrcAddr(aArgs.iSrcConfig.iAddr),
-		iDstAddr(aArgs.iDstConfig.iAddr),
-		iTransferCount(aArgs.iTransferCount)
-		{}
-
-	/**
-	If addresses have been left as KPhysAddrInvalid or the count as 0 (ie.
-	the default values used for IsrRedoRequest) then substitute the values from
-	aTransferArgs.
-	*/
-	void Substitute(const TDmaTransferArgs& aTransferArgs);
-
-	/**
-	If addresses have been left as KPhysAddrInvalid or the count as 0 (ie.
-	the default values used for IsrRedoRequest) then substitute the values from
-	aTransferArgs.
-	*/
-	void Substitute(const TAddressParms& aTransferArgs);
-
-	/**
-	When received by the test driver, src and dst
-	addresses will be offsets from the dma test session's
-	chunk base. They must be converted to absolute, *physical* addresses
-	*/
-	void Fixup(TLinAddr aChunkBase);
-
-	/**
-	Check that both the src and destination lie within the area
-	defined by aStart and aSize
-	*/
-	TBool CheckRange(TLinAddr aStart, TUint aSize);
-
-	TAddrRange SourceRange() const;
-	TAddrRange DestRange() const;
-
-	TBool Overlaps(const TAddrRange aRange) const;
-	TBool Overlaps(const TAddressParms aParm) const;
-
-	TBool operator==(const TAddressParms& aOther) const;
-
-
-	/**
-	Produce a printable representation
-	*/
-	void AppendString(TDes& aBuf) const
-		{
-		_LIT(KOutput, "TAddressParms: src=0x%08x (%d) dst=0x%08x (%d) count=0x%08x (%d)\0");
-#ifdef __KERNEL_MODE__
-		DmaAppendFormat(aBuf, (const char*)KOutput().Ptr(), iSrcAddr, iSrcAddr, iDstAddr, iDstAddr, iTransferCount, iTransferCount);
-#else
-		aBuf.AppendFormat(KOutput, iSrcAddr, iSrcAddr, iDstAddr, iDstAddr, iTransferCount, iTransferCount);
-#endif
-		}
-
-	void MakePhysical();
-
-	static void SelfTest();
-
-	TUint32 iSrcAddr;
-	TUint32 iDstAddr;
-	TUint iTransferCount;
-	};
-
-// These functions can be used for accessing TDmaTransferArgs in
-// terms of TAddressParms. (TAddressParms would be a natural base
-// class for TDmaTransferArgs but changing the production code
-// is undesirable)
-TAddressParms GetAddrParms(const TDmaTransferArgs&);
-void SetAddrParms(TDmaTransferArgs&, const TAddressParms&);
-
-/**
-This struct holds the arguments which can be used with TDmaChannel::IsrRedoRequest
-*/
-struct TIsrRequeArgs : public TAddressParms
-	{
-	TIsrRequeArgs(TUint32 aSrcAddr=KPhysAddrInvalidUser, TUint32 aDstAddr=KPhysAddrInvalidUser,
-			TUint aTransferCount=0, TUint32 aPslRequestInfo=0,
-			TBool aIsrCb=ETrue)
-		: TAddressParms(aSrcAddr, aDstAddr, aTransferCount), iPslRequestInfo(aPslRequestInfo), iIsrCb(aIsrCb)
-		{}
-
-
-	TInt Call(TDmaChannel& aChannel);
-
-	TBool CheckRange(TLinAddr aStart, TUint aSize) const;
-
-	TUint32 iPslRequestInfo;
-	TBool iIsrCb;
-	};
-class CISrRequeTest;
-/**
-A collection of TIsrRequeArgs
-*/
-struct TIsrRequeArgsSet
-	{
-	friend class CIsrRequeTest;
-	TIsrRequeArgsSet(TIsrRequeArgs* aRequeueArgs=NULL, TInt aCount =0)
-		:iCount(aCount), iIndex(0)
-		{
-		TEST_ASSERT(iCount <= MaxCount);
-		for(TInt i=0; i<iCount; i++)
-			{
-			iRequeArgs[i] = aRequeueArgs[i];
-			}
-
-		}
-
-	TBool IsEmpty() const
-		{return iCount == 0;}
-
-	TIsrRequeArgs GetArgs();
-
-	/**
-	If addresses have been left as KPhysAddrInvalid or the count as 0 (ie.
-	the default values used for IsrRedoRequest) then substitute the appropriate
-	value from the previous argument struct. aTransferArgs is used to
-	substitute values for the initial argument struct.
-	*/
-	void Substitute(const TDmaTransferArgs& aTransferArgs);
-	void Fixup(TLinAddr aChunkBase);
-	TBool CheckRange(TLinAddr aAddr, TUint aSize) const;
-
-	/**
-	Check that all re-queue parameters will remain within the region defined
-	by aAddr and aSize. This overload assumes that the requeue parameters have
-	not been substituted hence the data in aInitialParms is required.
-
-	@param aInitialParms The original transfer that the re-queues in this set are based on
-	*/
-	TBool CheckRange(TLinAddr aAddr, TUint aSize, const TDmaTransferArgs& aInitialParms) const;
-
-	static void SelfTest();
-private:
-	enum {MaxCount=6};
-	TInt iCount;
-	TInt iIndex;
-	TIsrRequeArgs iRequeArgs[MaxCount];
-	};
-
-class DDmaTestSession;
-class RDmaSession : public RBusLogicalChannel
-	{
-	friend class DDmaTestSession;
-public:
-#ifndef __KERNEL_MODE__
-	TInt ChannelIsQueueEmpty(TUint aDriverCookie,TBool& aQueueEmpty)
-		{
-		return DoControl(EIsQueueEmpty, reinterpret_cast<TAny*>(aDriverCookie),	&aQueueEmpty);		
-		}
-
-	TInt ChannelIsOpened(TUint aDriverCookie,TBool &aChannelOpen)
-		{
-		return DoControl(EIsOpened, reinterpret_cast<TAny*>(aDriverCookie), &aChannelOpen);		
-		}
-
-	TInt ChannelCancelAll(TUint aDriverCookie)
-		{	
-		return DoControl(ECancelAllChannel, reinterpret_cast<TAny*>(aDriverCookie));
-		}
-
-	TInt ChannelOpen(TUint aPslCookie,  TUint& aDriverCookie)
-		{
-		return DoControl(EOpenChannel, reinterpret_cast<TAny*>(aPslCookie), &aDriverCookie);
-		}
-
-	TInt ChannelOpen(TUint& aDriverCookie, SCreateInfoTest& aInfo)
-		{
-		TPckg<SCreateInfoTest> package(aInfo);
-		return DoControl(EOpenChannelExposed,&aDriverCookie, &package);
-		}
-
-	TInt ChannelClose(TUint aDriverCookie)
-		{	
-		return DoControl(ECloseChannel, reinterpret_cast<TAny*>(aDriverCookie));
-		}
-
-	TInt ChannelPause(TUint aDriverCookie)
-		{	
-		return DoControl(EPauseChannel, reinterpret_cast<TAny*>(aDriverCookie));
-		}
-	
-	TInt ChannelResume(TUint aDriverCookie)
-		{	
-		return DoControl(EResumeChannel, reinterpret_cast<TAny*>(aDriverCookie));
-		}
-
-	TInt ChannelLinking(TUint aDriverCookie)
-		{	
-		return DoControl(ELinkChannel, reinterpret_cast<TAny*>(aDriverCookie));
-		}
-
-	TInt ChannelUnLinking(TUint aDriverCookie)
-		{	
-		return DoControl(EUnlinkChannel, reinterpret_cast<TAny*>(aDriverCookie));
-		}
-
-	TInt ChannelCaps(TUint aDriverCookie, SDmacCaps& aChannelCaps)
-		{
-		TDmacTestCaps caps;
-		TInt r = ChannelCaps(aDriverCookie, caps);
-		aChannelCaps = caps;
-		return r;
-		}
-
-	TInt ChannelCaps(TUint aDriverCookie, TDmacTestCaps& aChannelCaps)
-		{
-		TPckg<TDmacTestCaps> package(aChannelCaps);
-		return DoControl(EChannelCaps, reinterpret_cast<TAny*>(aDriverCookie), &package);
-		}
-	
-	TInt Open()
-		{
-		TInt r = KErrNone;
-		r = DoCreate(KTestDmaLddNameHw,TestDmaLddVersion(), 0, NULL, NULL, EOwnerThread);
-		RDebug::Printf("RDmaSession::Open returned %d", r);
-		return r;
-		}
-
-	TInt OpenSim()
-		{
-		return DoCreate(KTestDmaLddNameSim,TestDmaLddVersion(), 0, NULL, NULL, EOwnerThread);
-		}
-
-	TInt RequestCreateOld(TUint aChannelCookie, TUint& aRequestCookie, TUint aMaxTransferSize=0)
-		{	
-		return DoRequestCreate(aChannelCookie, EFalse, aMaxTransferSize, aRequestCookie);
-		}
-
-
-	TInt RequestCreate(TUint aChannelCookie, TUint& aRequestCookie, TUint aMaxTransferSize=0)
-		{
-		return DoRequestCreate(aChannelCookie, ETrue, aMaxTransferSize, aRequestCookie);
-		}
-
-	TInt RequestDestroy(TUint aRequestCookie)
-		{	
-		return DoControl(ERequestClose, reinterpret_cast<TAny*>(aRequestCookie));
-		}
-
-	TInt RequestFragmentCount(TUint aRequestCookie)
-		{	
-		return DoControl(EFragmentCount, reinterpret_cast<TAny*>(aRequestCookie));
-		}
-
-	TInt RequestEnableDstElementCounting(TUint aRequestCookie)
-		{					
-		return DoControl(EEnableDstElementCounting, reinterpret_cast<TAny*>(aRequestCookie));		
-		}
-
-	TInt RequestEnableSrcElementCounting(TUint aRequestCookie)
-		{		
-		return DoControl(EEnableSrcElementCounting, reinterpret_cast<TAny*>(aRequestCookie));
-		}
-
-	TInt RequestDisableDstElementCounting(TUint aRequestCookie)
-		{	
-		return DoControl(EDisableDstElementCounting, reinterpret_cast<TAny*>(aRequestCookie));
-		}
-
-	TInt RequestDisableSrcElementCounting(TUint aRequestCookie)
-		{	
-		return DoControl(EDisableSrcElementCounting, reinterpret_cast<TAny*>(aRequestCookie));
-		}
-
-	TInt RequestTotalNumDstElementsTransferred(TUint aRequestCookie)
-		{	
-		return DoControl(ETotalNumDstElementsTransferred, reinterpret_cast<TAny*>(aRequestCookie));
-		}
-
-	TInt RequestTotalNumSrcElementsTransferred(TUint aRequestCookie)
-		{	
-		return DoControl(ETotalNumSrcElementsTransferred, reinterpret_cast<TAny*>(aRequestCookie));
-		}
-
-	/**
-	Will fragment a DMA request using the legacy API
-	*/
-	TInt FragmentRequestOld(TUint aRequestCookie, const TDmaTransferArgs& aTransferArgs, TUint64* aDurationMicroSecs=NULL)
-		{
-		const TFragmentArgs args(aRequestCookie, aTransferArgs, aDurationMicroSecs);
-		TPckgC<TFragmentArgs> package(args);
-		return DoControl(EFragmentLegacy, &package);
-		}
-
-	/**
-	Will fragment a DMA request using the new API
-	*/
-	TInt FragmentRequest(TUint aRequestCookie, const TDmaTransferArgs& aTransferArgs, TUint64* aDurationMicroSecs=NULL)
-		{
-		const TFragmentArgs args(aRequestCookie, aTransferArgs, aDurationMicroSecs);
-		TPckgC<TFragmentArgs> package(args);
-		return DoControl(EFragment, &package);
-		}
-
-	TInt QueueRequest(TUint aRequestCookie, TRequestStatus& aStatus, TCallbackRecord* aRecord = NULL, TUint64* aDurationMicroSecs=NULL)
-		{
-		//These dummy values can accept the writeback from the driver
-		//if the client does not want them.
-		//(TClientDataRequest can not be programmed with a NULL to
-		//indicate that an argument is unwanted)
-		TCallbackRecord dummyRec;
-		TUint64 dummyTime=0;
-
-		aStatus = KRequestPending;
-
-		TQueueArgs args(aRequestCookie, &aStatus, aRecord ? aRecord : &dummyRec, aDurationMicroSecs ? aDurationMicroSecs : &dummyTime);
-		TPckgC<TQueueArgs> package(args);
-		return DoControl(EQueueRequest, &package);
-		}
-
-	/**
-	Synchronous version of QueueRequest
-	*/
-	TInt QueueRequest(TUint aRequestCookie, TCallbackRecord* aRecord = NULL, TUint64* aDurationMicroSecs=NULL)
-		{
-		TRequestStatus status;
-		TInt r = QueueRequest(aRequestCookie, status, aRecord, aDurationMicroSecs);
-		User::WaitForRequest(status);
-		return r;
-		}
-
-	/**
-	Queue a previously fragmented request.
-	Additional request parameters are included in iRequeueArgs, these will be
-	transferred from ISR context callback using the TDmaChannel::IsrRedoRequest function
-
-	@pre Isr callback for completion must have been requested at request fragmentation time
-	*/
-	TInt QueueRequestWithRequeue(TUint aRequestCookie, TIsrRequeArgs* aRequeueArgs, TInt aCount, TRequestStatus& aStatus, TCallbackRecord* aRecord = NULL, TUint64* aDurationMicroSecs=NULL)
-		{
-		//These dummy values can accept the writeback from the driver
-		//if the client does not want them.
-		//(TClientDataRequest can not be programmed with a NULL to
-		//indicate that an argument is unwanted)
-		TCallbackRecord dummyRec;
-		TUint64 dummyTime=0;
-
-		aStatus = KRequestPending;
-
-		TQueueArgsWithReque args(aRequeueArgs, aCount, aRequestCookie, &aStatus, aRecord ? aRecord : &dummyRec, aDurationMicroSecs ? aDurationMicroSecs : &dummyTime);
-		TPckgC<TQueueArgsWithReque> package(args);
-		return DoControl(EQueueRequestWithReque, &package);
-		}
-
-	/**
-	Synchronous version of QueueRequestWithRequeue
-	*/
-	TInt QueueRequestWithRequeue(TUint aRequestCookie, TIsrRequeArgs* aRequeueArgs, TInt aCount, TCallbackRecord* aRecord = NULL, TUint64* aDurationMicroSecs=NULL)
-		{
-		TRequestStatus status;
-		TInt r = QueueRequestWithRequeue(aRequestCookie, aRequeueArgs, aCount, status, aRecord, aDurationMicroSecs);
-		User::WaitForRequest(status);
-		return r;
-		}
-
-	TInt OpenSharedChunk(RChunk& aChunk)
-		{
-		TUint chunkHandle = DoControl(EOpenSharedChunk);
-		return aChunk.SetReturnedHandle(chunkHandle);
-		}
-
-	TInt GetTestInfo(TDmaV2TestInfo& aInfo)
-		{
-		TPckg<TDmaV2TestInfo> package(aInfo);
-		return DoControl(EGetTestInfo, &package);
-		}
-
-	static void SelfTest(TBool aSimulatedDmac);
-
-	static void ApiTest();
-#endif // __KERNEL_MODE__
-
-private:
-
-	TInt DoRequestCreate(TUint aChannelCookie, TBool aNewStyle, TUint aMaxTransferSize, TUint& aRequestCookie)
-		{
-		TRequestCreateArgs args(aChannelCookie, aNewStyle, aMaxTransferSize);
-		TPckgC<TRequestCreateArgs> package(args);
-		return DoControl(ERequestOpen, &package, &aRequestCookie);
-		}
-	
-	struct TRequestCreateArgs
-		{
-		TRequestCreateArgs(TUint aChannelCookie, TBool aNewStyle, TUint aMaxFragmentSize)
-			:iChannelCookie(aChannelCookie), iNewStyle(aNewStyle), iMaxFragmentSize(aMaxFragmentSize)
-			{}
-
-		TUint iChannelCookie;
-		TBool iNewStyle;
-		TUint iMaxFragmentSize;
-		};
-
-	struct TFragmentArgs
-		{
-		TFragmentArgs()
-			:iRequestCookie(0), iTransferArgs(), iDurationMicroSecs(NULL)
-			{}
-		TFragmentArgs(TUint aRequestCookie, const TDmaTransferArgs& aTransferArgs, TUint64* aDurationMicroSecs = NULL)
-			:iRequestCookie(aRequestCookie), iTransferArgs(aTransferArgs), iDurationMicroSecs(aDurationMicroSecs)
-			{}
-
-		const TUint iRequestCookie;
-		const TDmaTransferArgs iTransferArgs;
-		TUint64* const iDurationMicroSecs;
-		};
-
-	struct TQueueArgs
-		{
-		TQueueArgs(TUint aRequestCookie=0, TRequestStatus* aStatus=NULL, TCallbackRecord* aCallbackRecord=NULL, TUint64* aDurationMicroSecs=NULL)
-			:iRequestCookie(aRequestCookie), iStatus(aStatus), iCallbackRecord(aCallbackRecord), iDurationMicroSecs(aDurationMicroSecs)
-			{}
-		TUint iRequestCookie;
-		TRequestStatus* iStatus;
-		TCallbackRecord* iCallbackRecord;
-		TUint64* iDurationMicroSecs;
-		};
-
-	/**
-	This struct is used for queing and including a set of transfers
-	to be setup from ISR context callback
-	*/
-	struct TQueueArgsWithReque : public TQueueArgs
-		{
-		TQueueArgsWithReque(TIsrRequeArgs* aRequeueArgs=NULL, TInt aCount=0,
-				TUint aRequestCookie=0, TRequestStatus* aStatus=NULL, TCallbackRecord* aCallbackRecord=NULL, TUint64* aDurationMicroSecs=NULL)
-			:TQueueArgs(aRequestCookie, aStatus, aCallbackRecord, aDurationMicroSecs), iRequeSet(aRequeueArgs, aCount)
-			{
-			}
-
-		TIsrRequeArgsSet iRequeSet;
-		};
-
-	enum TControl
-		{
-		EOpenChannel,
-		EOpenChannelExposed,
-		ECloseChannel,
-		EPauseChannel,
-		EResumeChannel,
-		EChannelCaps,
-		ERequestOpen,
-		ERequestClose,
-		EOpenSharedChunk,
-		EFragmentLegacy,
-		EFragment,
-		EFragmentCount,
-		EQueueRequest,
-		EGetTestInfo,
-		EIsQueueEmpty,
-		EIsOpened,
-		EIsrRedoRequest,
-		ECancelAllChannel,
-		EQueueRequestWithReque,
-		ELinkChannel,
-		EUnlinkChannel,
-		EEnableDstElementCounting,
-		EEnableSrcElementCounting,
-		EDisableDstElementCounting,
-		EDisableSrcElementCounting,
-		ETotalNumDstElementsTransferred,
-		ETotalNumSrcElementsTransferred,
-		};
-	};
-#endif // __D_DMA2_H__
--- a/kerneltest/e32test/dmav2/d_dma2_cmn.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,441 +0,0 @@
-/*
-* Copyright (c) 2009-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"
-* 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: Implmentation of DMAv2 test code, common
-* to both user and kernel side
-*
-*/
-#ifdef __KERNEL_MODE__
-#include <platform.h>
-
-#ifdef __DMASIM__
-#ifdef __WINS__
-typedef TLinAddr TPhysAddr;
-#endif
-static inline TPhysAddr LinToPhys(TLinAddr aLin) {return aLin;}
-#else
-static inline TPhysAddr LinToPhys(TLinAddr aLin) {return Epoc::LinearToPhysical(aLin);}
-#endif
-#endif
-
-#include "d_dma2.h"
-
-
-TInt Log2(TInt aNum)
-	{
-	TInt res = -1;
-	while(aNum)
-		{
-		res++;
-		aNum >>= 1;
-		}
-	return res;
-	}
-
-TCallbackRecord::TCallbackRecord(
-		TCbContext aContext,
-		TInt aReq,
-		TInt aReqSrc,
-		TInt aReqDst,
-		TInt aDes,
-		TInt aDesSrc,
-		TInt aDesDst,
-		TInt aFrame,
-		TInt aFrameSrc,
-		TInt aFrameDst,
-		TInt aPause,
-		TInt aPauseSrc,
-		TInt aPauseDst,
-		TDmaResult aResult
-	)
-	//Default iIsrRedoRequestResult is 1 as this is an invalid error code
-	:iResult(aResult), iContext(aContext), iIsrRedoRequestResult(1)
-	{
-	SetCount(EDmaCallbackRequestCompletion, aReq);
-	SetCount(EDmaCallbackRequestCompletion_Src, aReqSrc);
-	SetCount(EDmaCallbackRequestCompletion_Dst, aReqDst);
-	SetCount(EDmaCallbackDescriptorCompletion, aDes);
-	SetCount(EDmaCallbackDescriptorCompletion_Src, aDesSrc);
-	SetCount(EDmaCallbackDescriptorCompletion_Dst, aDesDst);
-	SetCount(EDmaCallbackFrameCompletion, aFrame);
-	SetCount(EDmaCallbackFrameCompletion_Src, aFrameSrc);
-	SetCount(EDmaCallbackFrameCompletion_Dst, aFrameDst);
-	SetCount(EDmaCallbackLinkedListPaused, aPause);
-	SetCount(EDmaCallbackLinkedListPaused_Src, aPauseSrc);
-	SetCount(EDmaCallbackLinkedListPaused_Dst, aPauseDst);
-	}
-
-TCallbackRecord TCallbackRecord::Empty()
-	{
-	return TCallbackRecord(EInvalid,0,0,0,0,0,0,0,0,0,0,0,0,EDmaResultError);
-	}
-
-void TCallbackRecord::Reset()
-	{
-	new (this) TCallbackRecord();
-	}
-
-TBool TCallbackRecord::operator == (const TCallbackRecord aOther) const
-	{
-	return (memcompare((TUint8*)this, sizeof(*this), (TUint8*)&aOther, sizeof(aOther)) == 0);
-	}
-
-TInt TCallbackRecord::GetCount(TDmaCallbackType aCbType) const
-	{
-	const TInt index = BitToIndex(aCbType);
-	return iCallbackLog[index];
-	}
-
-void TCallbackRecord::SetCount(TDmaCallbackType aCbType, TInt aCount)
-	{
-	const TInt index = BitToIndex(aCbType);
-	iCallbackLog[index] = aCount;
-	}
-
-TInt TCallbackRecord::BitToIndex(TDmaCallbackType aCbType) const
-	{
-	const TInt index = Log2(aCbType);
-	TEST_ASSERT(index >=0 && index < KNumberOfCallbacks);
-
-	return index;
-	}
-
-void TCallbackRecord::ProcessCallback(TUint aCallbackMask, TDmaResult aResult)
-	{
-	// This function may be called several
-	// times and will accumulate the number of each callback
-	// received. However, it will only ever remember the last
-	// result and context value,
-	iResult = aResult;
-	iContext = CurrentContext();
-	TEST_ASSERT(iContext != EInvalid);
-
-	for(TInt i=0; i < KNumberOfCallbacks; i++)
-		{
-		if(aCallbackMask & 1)
-			{
-			iCallbackLog[i]++;
-			}
-		aCallbackMask >>= 1;
-		}
-	// Assert that we have handled all bits
-	// if not then maybe KNumberOfCallbacks is too small
-	// or there is a spurious bit in aCallbackMask
-	TEST_ASSERT(aCallbackMask == 0);
-	}
-
-TCallbackRecord::TCbContext TCallbackRecord::CurrentContext() const
-	{
-#ifdef __KERNEL_MODE__
-	switch(NKern::CurrentContext())
-		{
-	case NKern::EThread:
-		return EThread;
-	case NKern::EInterrupt:
-		return EIsr;
-	//Fall-through: If context is IDFC or the EEscaped marker occur
-	//it is an error
-	case NKern::EIDFC:
-	case NKern::EEscaped:
-	default:
-		return EInvalid;
-		}
-#else
-	//for the benefit of user-mode testing
-	return EThread;
-#endif
-	}
-
-void TCallbackRecord::Print() const
-	{
-	PRINT(GetCount(EDmaCallbackRequestCompletion));
-	PRINT(GetCount(EDmaCallbackRequestCompletion_Src));
-	PRINT(GetCount(EDmaCallbackRequestCompletion_Dst));
-	PRINT(GetCount(EDmaCallbackDescriptorCompletion));
-	PRINT(GetCount(EDmaCallbackDescriptorCompletion_Src));
-	PRINT(GetCount(EDmaCallbackDescriptorCompletion_Dst));
-	PRINT(GetCount(EDmaCallbackFrameCompletion));
-	PRINT(GetCount(EDmaCallbackFrameCompletion_Src));
-	PRINT(GetCount(EDmaCallbackFrameCompletion_Dst));
-	PRINT(GetCount(EDmaCallbackLinkedListPaused));
-	PRINT(GetCount(EDmaCallbackLinkedListPaused_Src));
-	PRINT(GetCount(EDmaCallbackLinkedListPaused_Dst));
-	PRINT(iResult);
-	PRINT(iContext);
-	PRINT(iIsrRedoRequestResult);
-	}
-
-TDmacTestCaps::TDmacTestCaps()
-	:iPILVersion(1)
-	{
-	}
-
-TDmacTestCaps::TDmacTestCaps(const SDmacCaps& aDmacCaps, TInt aVersion)
-	:SDmacCaps(aDmacCaps), iPILVersion(aVersion)
-	{}
-
-TAddrRange::TAddrRange(TUint aStart, TUint aLength)
-	:iStart(aStart), iLength(aLength)
-	{
-	}
-
-TBool TAddrRange::Contains(TAddrRange aRange) const
-	{
-	return Contains(aRange.Start()) && Contains(aRange.End());
-	}
-
-TBool TAddrRange::Overlaps(const TAddrRange& aRange) const
-	{
-	return (aRange.Contains(iStart) || aRange.Contains(End()) ||
-			Contains(aRange.Start()) || Contains(aRange.End()));
-	}
-
-TBool TAddrRange::IsFilled(TUint8 aValue) const
-	{
-	TUint8* buffer = reinterpret_cast<TUint8*>(iStart);
-	for(TUint i = 0; i < iLength; i++)
-		{
-		if(buffer[i] != aValue)
-			return EFalse;
-		}
-	return ETrue;
-	}
-
-/**
-If addresses have been left as KPhysAddrInvalid or the count as 0 (ie. the
-default values used for IsrRedoRequest) then substitute the values from
-aTransferArgs.
-*/
-void TAddressParms::Substitute(const TDmaTransferArgs& aTransferArgs)
-	{
-	Substitute(GetAddrParms(aTransferArgs));
-	}
-
-/**
-If addresses have been left as KPhysAddrInvalid or the count as 0 (ie. the
-default values used for IsrRedoRequest) then substitute the values from
-aTransferArgs.
-*/
-void TAddressParms::Substitute(const TAddressParms& aAddrParams)
-	{
-	if(iSrcAddr == KPhysAddrInvalidUser)
-		iSrcAddr = aAddrParams.iSrcAddr;
-
-	if(iDstAddr == KPhysAddrInvalidUser)
-		iDstAddr = aAddrParams.iDstAddr;
-
-	if(iTransferCount == 0)
-		iTransferCount = aAddrParams.iTransferCount;
-	}
-
-/**
-Addresses are converted into absolute,
-addresses (virtual in user mode, physical in kernel)
-unless they are KPhysAddrInvalid
-*/
-void TAddressParms::Fixup(TLinAddr aChunkBase)
-	{
-	if(iSrcAddr != KPhysAddrInvalidUser)
-		{
-		iSrcAddr += aChunkBase;
-
-#ifdef __KERNEL_MODE__
-		iSrcAddr = LinToPhys(iSrcAddr);
-		TEST_ASSERT(iSrcAddr != KPhysAddrInvalid);
-#endif
-		}
-#ifndef __KERNEL_MODE__
-	else
-		{
-		// Substitute must be called before
-		// Fixup on user side
-		TEST_FAULT;
-		}
-#endif
-
-	if(iDstAddr != KPhysAddrInvalidUser)
-		{
-		iDstAddr += aChunkBase;
-
-#ifdef __KERNEL_MODE__
-		iDstAddr = LinToPhys(iDstAddr);
-		TEST_ASSERT(iDstAddr != KPhysAddrInvalid);
-#endif
-		}
-#ifndef __KERNEL_MODE__
-	else
-		{
-		// Substitute must be called before
-		// Fixup on user side
-		TEST_FAULT;
-		}
-#endif
-	}
-
-TBool TAddressParms::CheckRange(TLinAddr aStart, TUint aSize)
-	{
-	TAddrRange chunk(aStart, aSize);
-	return chunk.Contains(SourceRange()) && chunk.Contains(DestRange());
-	}
-
-/**
-@return ETrue if the source or destination range of this object
-overlaps with aRange
-*/
-TBool TAddressParms::Overlaps(const TAddrRange aRange) const
-	{
-	return SourceRange().Overlaps(aRange) || DestRange().Overlaps(aRange);
-	}
-
-/**
-@return ETrue if either the source or dest range of this
-overlap with either of those of aParm
-*/
-TBool TAddressParms::Overlaps(const TAddressParms aParm) const
-	{
-	return Overlaps(aParm.SourceRange()) || Overlaps(aParm.DestRange());
-	}
-
-TBool TAddressParms::operator==(const TAddressParms& aOther) const
-	{
-	return iSrcAddr == aOther.iSrcAddr &&
-		iDstAddr == aOther.iDstAddr &&
-		iTransferCount == aOther.iTransferCount;
-	}
-
-TAddressParms GetAddrParms(const TDmaTransferArgs& aArgs)
-	{
-	return TAddressParms(aArgs);
-	}
-
-TAddrRange TAddressParms::SourceRange() const
-	{
-	return TAddrRange(iSrcAddr, iTransferCount);
-	}
-
-TAddrRange TAddressParms::DestRange() const
-	{
-	return TAddrRange(iDstAddr, iTransferCount);
-	}
-
-void TAddressParms::MakePhysical()
-	{
-#ifdef __KERNEL_MODE__
-	iSrcAddr = LinToPhys(iSrcAddr);
-	TEST_ASSERT(iSrcAddr != KPhysAddrInvalid);
-	iDstAddr = LinToPhys(iDstAddr);
-	TEST_ASSERT(iDstAddr != KPhysAddrInvalid);
-#else
-	TEST_FAULT;
-#endif
-	}
-
-void SetAddrParms(TDmaTransferArgs& aTransferArgs, const TAddressParms& aAddrParams)
-	{
-	aTransferArgs.iSrcConfig.iAddr = aAddrParams.iSrcAddr;
-	aTransferArgs.iDstConfig.iAddr = aAddrParams.iDstAddr;
-	aTransferArgs.iTransferCount = aAddrParams.iTransferCount;
-	}
-
-TIsrRequeArgs TIsrRequeArgsSet::GetArgs()
-	{
-	TEST_ASSERT(!IsEmpty());
-	const TIsrRequeArgs args(iRequeArgs[iIndex]);
-	iIndex++;
-	iCount--;
-	return args;
-	}
-
-void TIsrRequeArgsSet::Substitute(const TDmaTransferArgs& aTransferArgs)
-	{
-	TAddressParms initial(aTransferArgs);
-
-	//if on user side it is assumed that aTransferArgs addresses will be offset
-	//based (from a virtual address). In kernel mode it is expected that address
-	//will be absolute virtual addresses, and must therefore be made physical
-#ifdef __KERNEL_MODE__
-	initial.MakePhysical();
-#endif
-
-	const TAddressParms* previous = &initial;
-
-	for(TInt i=0; i<iCount; i++)
-		{
-		TAddressParms& current = iRequeArgs[i];
-		current.Substitute(*previous);
-		previous = &current;
-		}
-	}
-
-void TIsrRequeArgsSet::Fixup(TLinAddr aChunkBase)
-	{
-	for(TInt i=0; i<iCount; i++)
-		{
-		iRequeArgs[i].Fixup(aChunkBase);
-		}
-	}
-
-/** Check that both source and destination of ISR reque args will lie within the
-range specified by aStart and aSize.
-
-@param aStart The linear base address of the region
-@param aSize The size of the region
-*/
-TBool TIsrRequeArgs::CheckRange(TLinAddr aStart, TUint aSize) const
-	{
-	TUint chunkStart = 0;
-#ifdef __KERNEL_MODE__
-	chunkStart = LinToPhys(aStart);
-	TEST_ASSERT(chunkStart != KPhysAddrInvalid);
-#else
-	chunkStart = aStart;
-#endif
-
-	// If an address is still KPhysAddrInvalid it means the arguments haven't
-	// yet been substituted
-	TAddrRange chunk(chunkStart, aSize);
-	TBool sourceOk = (iSrcAddr != KPhysAddrInvalid) && chunk.Contains(SourceRange());
-
-	TBool destOk = (iDstAddr != KPhysAddrInvalid) && chunk.Contains(DestRange());
-
-	TBool ok = sourceOk && destOk;
-	if(!ok)
-		{
-		PRINTF(("Error, re-queue args: "));
-		TBuf<128> buf;
-		AppendString(buf);
-		PRINTF(("%S", &buf));
-		PRINTF(("overflow buffer base=0x%08x, size=0x%08x", chunkStart, aSize));
-		}
-	return ok;
-	}
-
-TBool TIsrRequeArgsSet::CheckRange(TLinAddr aAddr, TUint aSize) const
-	{
-	for(TInt i=0; i<iCount; i++)
-		{
-		if(!iRequeArgs[i].CheckRange(aAddr, aSize))
-			return EFalse;
-		}
-	return ETrue;
-	}
-
-TBool TIsrRequeArgsSet::CheckRange(TLinAddr aAddr, TUint aSize, const TDmaTransferArgs& aInitialParms) const
-	{
-	// apply substitution, without modifying the original
-	TIsrRequeArgsSet copy(*this);
-	copy.Substitute(aInitialParms);
-
-	return copy.CheckRange(aAddr, aSize);
-	}
-
--- a/kerneltest/e32test/dmav2/dma2_sim.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,760 +0,0 @@
-// 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:
-// os/kernelhwsrv/kerneltest/e32test/dmav2/dma2_sim.cpp
-// Partial simulation of DMA2 PSL
-//
-//
-
-
-#include <kernel/kern_priv.h>
-
-#include <drivers/dma.h>
-#include <drivers/dma_hai.h>
-
-#include "d_dma2.h"
-
-// Debug support
-static const char KDmaPanicCat[] = "DMA PSL - " __FILE__;
-
-static const TInt KMaxTransferLen = 0x1000;	// max transfer length for this DMAC
-static const TInt KMemAlignMask = 0; // memory addresses passed to DMAC must be multiple of 8
-static const TInt KDesCount = 160;				// Initial DMA descriptor count
-
-#define TEST_RETURN(X) if (!(X))\
-	{\
-	__KTRACE_OPT(KPANIC, Kern::Printf("Simulated Dma test failure: " __FILE__ " line %d", __LINE__));\
-	return KErrAbort;\
-	}
-
-class TDmaDesc
-//
-// Hardware DMA descriptor
-//
-	{
-public:
-	enum {KStopBitMask = 1};
-public:
-	TPhysAddr iDescAddr;
-	TPhysAddr iSrcAddr;
-	TPhysAddr iDestAddr;
-	TUint32 iCmd;
-	};
-
-
-//////////////////////////////////////////////////////////////////////////////
-// Test Support
-//////////////////////////////////////////////////////////////////////////////
-
-/**
-TO DO: Fill in to provide information to the V1 test harness (t_dma.exe)
-*/
-TDmaTestInfo TestInfo =
-	{
-	0,
-	0,
-	0,
-	0,
-	NULL,
-	0,
-	NULL,
-	0,
-	NULL
-	};
-
-
-EXPORT_C const TDmaTestInfo& DmaTestInfo()
-//
-//
-//
-	{
-	return TestInfo;
-	}
-
-/**
-TO DO: Fill in to provide information to the V2 test harness (t_dma2.exe)
-*/
-TDmaV2TestInfo TestInfov2 =
-	{
-	0,
-	0,
-	0,
-	0,
-	{0},
-	0,
-	{0},
-	1,
-	{0}
-	};
-
-EXPORT_C const TDmaV2TestInfo& DmaTestInfoV2()
-	{
-	return TestInfov2;
-	}
-
-
-//////////////////////////////////////////////////////////////////////////////
-// Simulated channel
-//////////////////////////////////////////////////////////////////////////////
-
-/**
-An interface class to add simulation specific functionallity to any DMA channel
-*/
-class MSimChannel
-	{
-public:
-	virtual TInt PreOpen() =0;
-	virtual TDmaChannel& Channel() =0;
-	};
-
-//////////////////////////////////////////////////////////////////////////////
-// Derived Channel (Scatter/Gather)
-//////////////////////////////////////////////////////////////////////////////
-
-const SDmacCaps KSimSgChanCaps =
-	{0,										// TInt iChannelPriorities;
-	 EFalse,								// TBool iChannelPauseAndResume;
-	 EFalse,								// TBool iAddrAlignedToElementSize;
-	 EFalse,								// TBool i1DIndexAddressing;
-	 EFalse,								// TBool i2DIndexAddressing;
-	 KDmaSyncAuto,						   // TUint iSynchronizationTypes;
-	 KDmaBurstSizeAny,					   // TUint iBurstTransactions;
-	 EFalse,							   // TBool iDescriptorInterrupt;
-	 EFalse,							   // TBool iFrameInterrupt;
-	 EFalse,							   // TBool iLinkedListPausedInterrupt;
-	 EFalse,							   // TBool iEndiannessConversion;
-	 KDmaGraphicsOpNone,				   // TUint iGraphicsOps;
-	 EFalse,							   // TBool iRepeatingTransfers;
-	 EFalse,							   // TBool iChannelLinking;
-	 ETrue,								   // TBool iHwDescriptors;
-	 EFalse,							   // TBool iSrcDstAsymmetry;
-	 EFalse,							   // TBool iAsymHwDescriptors;
-	 EFalse,							   // TBool iBalancedAsymSegments;
-	 EFalse,							   // TBool iAsymCompletionInterrupt;
-	 EFalse,							   // TBool iAsymDescriptorInterrupt;
-	 EFalse,							   // TBool iAsymFrameInterrupt;
-	 {0, 0, 0, 0, 0}					   // TUint32 iReserved[5];
-	};
-
-const SDmacCaps KSimSwChanCaps =
-	{0,										// TInt iChannelPriorities;
-	 EFalse,								// TBool iChannelPauseAndResume;
-	 EFalse,								// TBool iAddrAlignedToElementSize;
-	 EFalse,								// TBool i1DIndexAddressing;
-	 EFalse,								// TBool i2DIndexAddressing;
-	 KDmaSyncAuto,						   // TUint iSynchronizationTypes;
-	 KDmaBurstSizeAny,					   // TUint iBurstTransactions;
-	 EFalse,							   // TBool iDescriptorInterrupt;
-	 EFalse,							   // TBool iFrameInterrupt;
-	 EFalse,							   // TBool iLinkedListPausedInterrupt;
-	 EFalse,							   // TBool iEndiannessConversion;
-	 KDmaGraphicsOpNone,				   // TUint iGraphicsOps;
-	 EFalse,							   // TBool iRepeatingTransfers;
-	 EFalse,							   // TBool iChannelLinking;
-	 EFalse,							   // TBool iHwDescriptors;
-	 EFalse,							   // TBool iSrcDstAsymmetry;
-	 EFalse,							   // TBool iAsymHwDescriptors;
-	 EFalse,							   // TBool iBalancedAsymSegments;
-	 EFalse,							   // TBool iAsymCompletionInterrupt;
-	 EFalse,							   // TBool iAsymDescriptorInterrupt;
-	 EFalse,							   // TBool iAsymFrameInterrupt;
-	 {0, 0, 0, 0, 0}					   // TUint32 iReserved[5];
-	};
-
-class TEmptyChannel : public TDmaChannel, public MSimChannel
-	{
-public:
-	// Virtual from TDmaChannel
-	void DoCancelAll();
-
-	void CallDefaultVirtuals();
-	TInt CheckExtensionStubs();
-
-	// From MSimChannel
-	TInt PreOpen();
-	TDmaChannel& Channel() {return *this;}
-	};
-
-void TEmptyChannel::DoCancelAll()
-	{
-	__DMA_CANT_HAPPEN();
-	}
-
-void TEmptyChannel::CallDefaultVirtuals()
-	{
-	DMA_PSL_TRACE("Calling default virtual TDmaChannel functions");
-
-	const DDmaRequest* req = NULL;
-	SDmaDesHdr* hdr = NULL;
-
-	DoQueue(*req);
-	DoDfc(*req, hdr);
-	DoDfc(*req, hdr, hdr);
-
-	QueuedRequestCountChanged();
-	}
-
-TInt TEmptyChannel::CheckExtensionStubs()
-	{
-	DMA_PSL_TRACE("Calling extension stubs");
-
-	TInt r = Extension(0, NULL);
-	TEST_RETURN(r == KErrNotSupported)
-
-	r = StaticExtension(0, NULL);
-	TEST_RETURN(r == KErrNotSupported)
-
-	return KErrNone;
-	}
-
-TInt TEmptyChannel::PreOpen()
-	{
-	CallDefaultVirtuals();
-	return CheckExtensionStubs();
-	}
-
-//////////////////////////////////////////////////////////////////////////////
-// Derived SkelControllerSw Class
-//////////////////////////////////////////////////////////////////////////////
-
-class TSkelDmac : public TDmac
-	{
-public:
-	TSkelDmac(const SCreateInfo& aInfo);
-	TInt Create(const SCreateInfo& aInfo);
-private:
-	// from TDmac (PIL pure virtual)
-	virtual void StopTransfer(const TDmaChannel& aChannel);
-	virtual TBool IsIdle(const TDmaChannel& aChannel);
-	virtual TUint MaxTransferLength(TDmaChannel& aChannel, TUint aSrcFlags,
-									TUint aDstFlags, TUint32 aPslInfo);
-	virtual TUint AddressAlignMask(TDmaChannel& aChannel, TUint aSrcFlags,
-								   TUint aDstFlags, TUint32 aPslInfo);
-
-	inline TDmaDesc* HdrToHwDes(const SDmaDesHdr& aHdr);
-
-	void CallDefaultVirtuals();
-	TInt TestPool();
-
-public:
-	static const SCreateInfo KDmacInfoHw;
-	static const SCreateInfo KDmacInfoSw;
-
-	TEmptyChannel iChannel;
-	};
-
-
-const TDmac::SCreateInfo TSkelDmac::KDmacInfoHw =
-	{
-	ETrue,													// iCapsHwDes
-	KDesCount,												// iDesCount
-	sizeof(TDmaDesc),										// iDesSize
-#ifndef __WINS__
-	EMapAttrSupRw | EMapAttrFullyBlocking					// iDesChunkAttribs
-#endif
-	};
-
-const TDmac::SCreateInfo TSkelDmac::KDmacInfoSw =
-	{
-	EFalse,													// iCapsHwDes
-	KDesCount,												// iDesCount
-	sizeof(TDmaTransferArgs),										// iDesSize
-#ifndef __WINS__
-	EMapAttrSupRw | EMapAttrFullyBlocking					// iDesChunkAttribs
-#endif
-	};
-
-static TSkelDmac SkelControllerSw(TSkelDmac::KDmacInfoSw);
-static TSkelDmac SkelControllerHw(TSkelDmac::KDmacInfoHw);
-
-
-TSkelDmac::TSkelDmac(const SCreateInfo& aInfo)
-//
-// Constructor.
-//
-	: TDmac(aInfo)
-	{
-	TInt r = Create(aInfo);
-	__NK_ASSERT_ALWAYS(r == KErrNone);
-
-	CallDefaultVirtuals();
-	r = TestPool();
-	__NK_ASSERT_ALWAYS(r == KErrNone);
-	}
-
-
-TInt TSkelDmac::Create(const SCreateInfo& aInfo)
-//
-// Second phase construction.
-//
-	{
-	TInt r = TDmac::Create(aInfo);							// Base class Create()
-	if (r == KErrNone)
-		{
-		__DMA_ASSERTA(ReserveSetOfDes(1) == KErrNone);
-		}
-	return r;
-	}
-
-
-void TSkelDmac::StopTransfer(const TDmaChannel& aChannel)
-//
-// Stops a running channel.
-//
-	{
-	const TUint8 i = static_cast<TUint8>(aChannel.PslId());
-
-	__KTRACE_OPT(KDMA, Kern::Printf(">TSkelDmac::StopTransfer channel=%d (unsupported)", i));
-
-	(void) i;
-
-	}
-
-
-TBool TSkelDmac::IsIdle(const TDmaChannel& aChannel)
-//
-// Returns the state of a given channel.
-//
-	{
-	const TUint8 i = static_cast<TUint8>(aChannel.PslId());
-
-	__KTRACE_OPT(KDMA, Kern::Printf(">TSkelDmac::IsIdle channel=%d (unsupported)", i));
-
-	// TO DO (for instance): Return the state of the RUN bit of the channel.
-	// The return value should reflect the actual state.
-	(void) i;
-
-	return ETrue;
-	}
-
-
-TUint TSkelDmac::MaxTransferLength(TDmaChannel& /*aChannel*/, TUint /*aSrcFlags*/,
-									   TUint /*aDstFlags*/, TUint32 /*aPslInfo*/)
-//
-// Returns the maximum transfer length in bytes for a given transfer.
-//
-	{
-	// TO DO: Determine the proper return value, based on the arguments.
-
-	// For instance:
-	return KMaxTransferLen;
-	}
-
-
-TUint TSkelDmac::AddressAlignMask(TDmaChannel& /*aChannel*/, TUint /*aSrcFlags*/,
-									  TUint /*aDstFlags*/, TUint32 /*aPslInfo*/)
-//
-// Returns the memory buffer alignment restrictions mask for a given transfer.
-//
-	{
-	// TO DO: Determine the proper return value, based on the arguments.
-
-	// For instance:
-	return KMemAlignMask;
-	}
-
-
-inline TDmaDesc* TSkelDmac::HdrToHwDes(const SDmaDesHdr& aHdr)
-//
-// Changes return type of base class call.
-//
-	{
-	return static_cast<TDmaDesc*>(TDmac::HdrToHwDes(aHdr));
-	}
-
-/**
-Call the default virtual functions on the TDmac,
-that would never otherwise be called
-
-*/
-void TSkelDmac::CallDefaultVirtuals()
-	{
-	DMA_PSL_TRACE("Calling default virtual TDmac functions");
-
-	TDmaChannel* channel = NULL;
-	SDmaDesHdr* hdr = NULL;
-
-	Transfer(*channel, *hdr);
-	Transfer(*channel, *hdr, *hdr);
-
-	const TDmaTransferArgs args;
-	TInt r = KErrNone;
-
-	r = InitHwDes(*hdr, args);
-	__NK_ASSERT_ALWAYS(r == KErrGeneral);
-
-	r = InitSrcHwDes(*hdr, args);
-	__NK_ASSERT_ALWAYS(r == KErrGeneral);
-
-	r = InitDstHwDes(*hdr, args);
-	__NK_ASSERT_ALWAYS(r == KErrGeneral);
-
-	r = UpdateHwDes(*hdr, KPhysAddrInvalid, KPhysAddrInvalid, 0, 0);
-	__NK_ASSERT_ALWAYS(r == KErrGeneral);
-
-	r = UpdateSrcHwDes(*hdr, KPhysAddrInvalid, 0, 0);
-	__NK_ASSERT_ALWAYS(r == KErrGeneral);
-
-	r = UpdateDstHwDes(*hdr, KPhysAddrInvalid, 0, 0);
-	__NK_ASSERT_ALWAYS(r == KErrGeneral);
-
-	ChainHwDes(*hdr, *hdr);
-	AppendHwDes(*channel, *hdr, *hdr);
-	AppendHwDes(*channel, *hdr, *hdr, *hdr, *hdr);
-	UnlinkHwDes(*channel, *hdr);
-
-	TUint32 count = 0;
-
-	count = HwDesNumDstElementsTransferred(*hdr);
-	__NK_ASSERT_ALWAYS(count == 0);
-
-	count = HwDesNumSrcElementsTransferred(*hdr);
-	__NK_ASSERT_ALWAYS(count == 0);
-	}
-
-TInt TSkelDmac::TestPool()
-	{
-	DMA_PSL_TRACE("TSkelDmac::TestPool()");
-	TInt count = 0;
-	SDmaDesHdr* hdr = iFreeHdr;
-	TAny* des = iDesPool;
-
-	TInt r = KErrNone;
-	while(hdr->iNext)
-		{
-		TAny* receivedDes = NULL;
-		if(iCapsHwDes)
-			{
-			receivedDes = HdrToHwDes(*hdr);
-			}
-		else
-			{
-			TDmaTransferArgs& args = HdrToDes(*hdr);
-			receivedDes = &args;
-			}
-
-		if(receivedDes != des)
-			{
-			DMA_PSL_TRACE1("TSkelDmac::TestPool() failure: count=%d", count);
-			r = KErrGeneral;
-			break;
-			}
-
-		hdr = hdr->iNext;
-		des = (TAny*)((TUint)des + iDesSize);
-		count++;
-		}
-
-	if(count != (KDesCount - 1))
-		{
-		DMA_PSL_TRACE2("TSkelDmac::TestPool() failure: count = %d != (iMaxDesCount -1) = %d", count, KDesCount-1);
-		r = KErrUnknown;
-		}
-	return r;
-	}
-
-//////////////////////////////////////////////////////////////////////////////
-// Simulated Fragmentation Dmac
-//////////////////////////////////////////////////////////////////////////////
-
-
-const SDmacCaps KSimAsymmChanCaps =
-	{0,										// TInt iChannelPriorities;
-	 EFalse,								// TBool iChannelPauseAndResume;
-	 EFalse,								// TBool iAddrAlignedToElementSize;
-	 EFalse,								// TBool i1DIndexAddressing;
-	 EFalse,								// TBool i2DIndexAddressing;
-	 KDmaSyncAuto,						   // TUint iSynchronizationTypes;
-	 KDmaBurstSizeAny,					   // TUint iBurstTransactions;
-	 EFalse,							   // TBool iDescriptorInterrupt;
-	 EFalse,							   // TBool iFrameInterrupt;
-	 EFalse,							   // TBool iLinkedListPausedInterrupt;
-	 EFalse,							   // TBool iEndiannessConversion;
-	 KDmaGraphicsOpNone,				   // TUint iGraphicsOps;
-	 EFalse,							   // TBool iRepeatingTransfers;
-	 EFalse,							   // TBool iChannelLinking;
-	 ETrue,								   // TBool iHwDescriptors;
-	 EFalse,							   // TBool iSrcDstAsymmetry;
-	 ETrue,								   // TBool iAsymHwDescriptors;
-	 EFalse,							   // TBool iBalancedAsymSegments;
-	 EFalse,							   // TBool iAsymCompletionInterrupt;
-	 EFalse,							   // TBool iAsymDescriptorInterrupt;
-	 EFalse,							   // TBool iAsymFrameInterrupt;
-	 {0, 0, 0, 0, 0}					   // TUint32 iReserved[5];
-	};
-
-const SDmacCaps KSimAsymmBalancedChanCaps =
-	{0,										// TInt iChannelPriorities;
-	 EFalse,								// TBool iChannelPauseAndResume;
-	 EFalse,								// TBool iAddrAlignedToElementSize;
-	 EFalse,								// TBool i1DIndexAddressing;
-	 EFalse,								// TBool i2DIndexAddressing;
-	 KDmaSyncAuto,						   // TUint iSynchronizationTypes;
-	 KDmaBurstSizeAny,					   // TUint iBurstTransactions;
-	 EFalse,							   // TBool iDescriptorInterrupt;
-	 EFalse,							   // TBool iFrameInterrupt;
-	 EFalse,							   // TBool iLinkedListPausedInterrupt;
-	 EFalse,							   // TBool iEndiannessConversion;
-	 KDmaGraphicsOpNone,				   // TUint iGraphicsOps;
-	 EFalse,							   // TBool iRepeatingTransfers;
-	 EFalse,							   // TBool iChannelLinking;
-	 ETrue,								   // TBool iHwDescriptors;
-	 EFalse,							   // TBool iSrcDstAsymmetry;
-	 ETrue,								   // TBool iAsymHwDescriptors;
-	 ETrue,								   // TBool iBalancedAsymSegments;
-	 EFalse,							   // TBool iAsymCompletionInterrupt;
-	 EFalse,							   // TBool iAsymDescriptorInterrupt;
-	 EFalse,							   // TBool iAsymFrameInterrupt;
-	 {0, 0, 0, 0, 0}					   // TUint32 iReserved[5];
-	};
-
-
-class TAsymmDmac : public TDmac
-	{
-	struct THwDes
-		{
-		TUint iAddr;
-		TUint iLength;
-		TUint iCookie;
-		};
-public:
-	TAsymmDmac();
-	TInt Create();
-private:
-	// Work around for compiler which forbids this
-	// class from accessing the protected, nested TDmac::SCreateInfo
-	using TDmac::SCreateInfo;
-
-	// from TDmac (PIL pure virtual)
-	virtual void StopTransfer(const TDmaChannel& aChannel);
-	virtual TBool IsIdle(const TDmaChannel& aChannel);
-	virtual TUint MaxTransferLength(TDmaChannel& aChannel, TUint aSrcFlags,
-									TUint aDstFlags, TUint32 aPslInfo);
-	virtual TUint AddressAlignMask(TDmaChannel& aChannel, TUint aSrcFlags,
-								   TUint aDstFlags, TUint32 aPslInfo);
-	// from TDmac (PIL virtual)
-	TInt InitSrcHwDes(const SDmaDesHdr& /*aHdr*/, const TDmaTransferArgs& /*aTransferArgs*/);
-	TInt InitDstHwDes(const SDmaDesHdr& /*aHdr*/, const TDmaTransferArgs& /*aTransferArgs*/);
-
-	void ChainHwDes(const SDmaDesHdr& aHdr, const SDmaDesHdr& aNextHdr);
-	void UnlinkHwDes(const TDmaChannel& aChannel, SDmaDesHdr& aHdr);
-
-	inline THwDes* HdrToHwDes(const SDmaDesHdr& aHdr);
-
-private:
-	static const SCreateInfo KInfo;
-public:
-	static const TInt iChannelCount;
-	TEmptyChannel iChannel;
-	};
-
-const TAsymmDmac::SCreateInfo TAsymmDmac::KInfo =
-	{
-	ETrue,													// iCapsHwDes
-	KDesCount,												// iDesCount
-	sizeof(THwDes),											// iDesSize
-#ifndef __WINS__
-	EMapAttrSupRw | EMapAttrFullyBlocking					// iDesChunkAttribs
-#endif
-	};
-
-const TInt TAsymmDmac::iChannelCount = 1;
-
-static TAsymmDmac AsymController;
-
-TAsymmDmac::TAsymmDmac()
-//
-// Constructor.
-//
-	: TDmac(KInfo)
-	{
-	TInt r = Create();
-	__NK_ASSERT_ALWAYS(r == KErrNone);
-	}
-
-
-TInt TAsymmDmac::Create()
-//
-// Second phase construction.
-//
-	{
-	TInt r = TDmac::Create(KInfo);							// Base class Create()
-	if (r == KErrNone)
-		{
-		__DMA_ASSERTA(ReserveSetOfDes(iChannelCount) == KErrNone);
-		}
-	return r;
-	}
-
-
-void TAsymmDmac::StopTransfer(const TDmaChannel& /*aChannel*/)
-//
-// Stops a running channel.
-//
-	{
-	__DMA_CANT_HAPPEN();
-	}
-
-
-TBool TAsymmDmac::IsIdle(const TDmaChannel& /*aChannel*/)
-//
-// Returns the state of a given channel.
-//
-	{
-	__DMA_CANT_HAPPEN();
-	return ETrue;
-	}
-
-
-TUint TAsymmDmac::MaxTransferLength(TDmaChannel& /*aChannel*/, TUint /*aSrcFlags*/,
-									   TUint /*aDstFlags*/, TUint32 /*aPslInfo*/)
-//
-// Returns the maximum transfer length in bytes for a given transfer.
-//
-	{
-	// TO DO: Determine the proper return value, based on the arguments.
-
-	// For instance:
-	return KMaxTransferLen;
-	}
-
-
-TUint TAsymmDmac::AddressAlignMask(TDmaChannel& /*aChannel*/, TUint /*aSrcFlags*/,
-									  TUint /*aDstFlags*/, TUint32 /*aPslInfo*/)
-//
-// Returns the memory buffer alignment restrictions mask for a given transfer.
-//
-	{
-	// TO DO: Determine the proper return value, based on the arguments.
-
-	// For instance:
-	return KMemAlignMask;
-	}
-
-
-inline TAsymmDmac::THwDes* TAsymmDmac::HdrToHwDes(const SDmaDesHdr& aHdr)
-//
-// Changes return type of base class call.
-//
-	{
-	return static_cast<THwDes*>(TDmac::HdrToHwDes(aHdr));
-	}
-
-TInt TAsymmDmac::InitSrcHwDes(const SDmaDesHdr& /*aHdr*/, const TDmaTransferArgs& /*aTransferArgs*/)
-	{
-	return KErrNone;
-	}
-
-TInt TAsymmDmac::InitDstHwDes(const SDmaDesHdr& /*aHdr*/, const TDmaTransferArgs& /*aTransferArgs*/)
-	{
-	return KErrNone;
-	}
-
-void TAsymmDmac::ChainHwDes(const SDmaDesHdr& /*aHdr*/, const SDmaDesHdr& /*aNextHdr*/)
-	{
-	}
-
-void TAsymmDmac::UnlinkHwDes(const TDmaChannel& /*aChannel*/, SDmaDesHdr& /*aHdr*/)
-	{
-	}
-
-
-
-//////////////////////////////////////////////////////////////////////////////
-// Channel Opening/Closing (Channel Allocator)
-//////////////////////////////////////////////////////////////////////////////
-
-struct TChanEntry
-	{
-	TChanEntry(TDmac& aController, MSimChannel& aChannel, const SDmacCaps& aCaps)
-		:
-			iController(aController),
-			iSimChannel(aChannel),
-			iCaps(aCaps)
-	{}
-
-	TDmac& iController;
-	MSimChannel& iSimChannel;
-	const SDmacCaps& iCaps;
-	};
-
-const TChanEntry ChannelTable[] =
-	{
-		TChanEntry(SkelControllerSw, SkelControllerSw.iChannel, KSimSwChanCaps),
-		TChanEntry(SkelControllerHw, SkelControllerHw.iChannel, KSimSgChanCaps),
-		TChanEntry(AsymController, AsymController.iChannel, KSimAsymmChanCaps),
-		TChanEntry(AsymController, AsymController.iChannel, KSimAsymmBalancedChanCaps)
-	};
-
-static const TInt KChannelCount = ARRAY_LENGTH(ChannelTable);
-
-TDmaChannel* DmaChannelMgr::Open(TUint32 aOpenId, TBool /*aDynChannel*/, TUint /*aPriority*/)
-//
-//
-//
-	{
-	__KTRACE_OPT(KDMA, Kern::Printf(">DmaChannelMgr::Open aOpenId=%d", aOpenId));
-
-	__DMA_ASSERTA(aOpenId < static_cast<TUint32>(KChannelCount));
-
-	const TChanEntry& entry = ChannelTable[aOpenId];
-	TDmaChannel* pC = &entry.iSimChannel.Channel();
-	if (pC->IsOpened())
-		{
-		pC = NULL;
-		}
-	else
-		{
-		pC->iController = &entry.iController;
-		pC->iPslId = aOpenId;
-		pC->iDmacCaps = &entry.iCaps;
-
-		// It is safe to signal here,
-		// setting iController marks the channel
-		// as taken
-		Signal();
-
-		TInt r = entry.iSimChannel.PreOpen();
-
-		Wait();
-
-		// If there was an error
-		// Close channel after retaking mutex
-		if(r != KErrNone)
-			{
-			pC->iController = NULL;
-			pC = NULL;
-			}
-
-
-		}
-	return pC;
-	}
-
-
-void DmaChannelMgr::Close(TDmaChannel* /*aChannel*/)
-//
-//
-//
-	{
-	// NOP
-	}
-
-
-TInt DmaChannelMgr::StaticExtension(TInt /*aCmd*/, TAny* /*aArg*/)
-//
-//
-//
-	{
-	return KErrNotSupported;
-	}
--- a/kerneltest/e32test/dmav2/self_test.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,853 +0,0 @@
-/*
-* Copyright (c) 2009-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"
-* 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:
-* This file contains unit tests for the test framework itself.
-* They should be run if changes have been made to
-* to the user side test framework code ie. anything in the dmav2
-* directory other than the d_* driver code, or test_cases.cpp
-*
-*/
-
-#include "d_dma2.h"
-#include "u32std.h"
-#include "t_dma2.h"
-#include "cap_reqs.h"
-
-#define __E32TEST_EXTENSION__
-#include <e32test.h>
-#include <e32debug.h>
-#include <e32svr.h>
-
-static RTest test(_L("t_dma2 test framework tests"));
-
-void RDmaSession::SelfTest(TBool aSimulatedDmac)
-	{
-	test.Start(_L("Simple transfer test"));
-
-	RDmaSession session;
-	TInt r = KErrUnknown;
-	if (aSimulatedDmac)
-		{
-		test.Next(_L("Open session (simulated DMA)"));
-		r = session.OpenSim();
-		}
-	else
-		{
-		test.Next(_L("Open session"));
-		r = session.Open();
-		}
-
-	test_KErrNone(r);
-
-	test.Next(_L("Get test info"));
-	TDmaV2TestInfo testInfo;
-	r = session.GetTestInfo(testInfo);
-	test_KErrNone(r);
-
-	if(gVerboseOutput)
-	{
-	Print(testInfo);
-	}
-
-	// Self test just needs 1 channel
-	// The real test will test all available ones
-	test.Next(_L("Select test channel"));
-	TUint testChannel = 0;
-	if(testInfo.iMaxSbChannels > 0)
-		{
-		testChannel = testInfo.iSbChannels[0];
-		}
-	else if(testInfo.iMaxDbChannels > 0)
-		{
-		testChannel = testInfo.iDbChannels[0];
-		}
-	else if(testInfo.iMaxSgChannels > 0)
-		{
-		testChannel = testInfo.iSgChannels[0];
-		}
-	else
-		{
-		test.Printf(_L("Driver exposes no channels to test"));
-		test(EFalse);
-		}
-
-	test.Printf(_L("using PSL cookie %d (0x%08x)\n"), testChannel, testChannel);
-	test.Next(_L("Open channel"));
-	TUint channelCookie=0;
-	r = session.ChannelOpen(testChannel, channelCookie);
-	test.Printf(_L("cookie recived = 0x%08x\n"), channelCookie);
-	test_KErrNone(r);
-
-	test.Next(_L("Get Channel caps"));
-	SDmacCaps channelCaps;
-	r = session.ChannelCaps(channelCookie, channelCaps);
-	test_KErrNone(r);
-	if(gVerboseOutput)
-	{
-	PRINT(channelCaps.iChannelPriorities);
-	PRINT(channelCaps.iChannelPauseAndResume);
-	PRINT(channelCaps.iAddrAlignedToElementSize);
-	PRINT(channelCaps.i1DIndexAddressing);
-	PRINT(channelCaps.i2DIndexAddressing);
-	PRINT(channelCaps.iSynchronizationTypes);
-	PRINT(channelCaps.iBurstTransactions);
-	PRINT(channelCaps.iDescriptorInterrupt);
-	PRINT(channelCaps.iFrameInterrupt);
-	PRINT(channelCaps.iLinkedListPausedInterrupt);
-	PRINT(channelCaps.iEndiannessConversion);
-	PRINT(channelCaps.iGraphicsOps);
-	PRINT(channelCaps.iRepeatingTransfers);
-	PRINT(channelCaps.iChannelLinking);
-	PRINT(channelCaps.iHwDescriptors);
-	PRINT(channelCaps.iSrcDstAsymmetry);
-	PRINT(channelCaps.iAsymHwDescriptors);
-	PRINT(channelCaps.iBalancedAsymSegments);
-	PRINT(channelCaps.iAsymCompletionInterrupt);
-	PRINT(channelCaps.iAsymDescriptorInterrupt);
-	PRINT(channelCaps.iAsymFrameInterrupt);
-	PRINT(channelCaps.iReserved[0]);
-	PRINT(channelCaps.iReserved[1]);
-	PRINT(channelCaps.iReserved[2]);
-	PRINT(channelCaps.iReserved[3]);
-	PRINT(channelCaps.iReserved[4]);	
-	}
-
-	test.Next(_L("Get extended Channel caps (TDmacTestCaps)"));
-	TDmacTestCaps extChannelCaps;
-	r = session.ChannelCaps(channelCookie, extChannelCaps);
-	test_KErrNone(r);
-	test.Printf(_L("PIL version = %d\n"), extChannelCaps.iPILVersion);
-
-	const TBool newPil = (extChannelCaps.iPILVersion > 1);
-
-	test.Next(_L("Create Dma request - max fragment size 32K"));
-	TUint reqCookie=0;
-	r = session.RequestCreateOld(channelCookie, reqCookie, 32 * KKilo);
-	test.Printf(_L("cookie recived = 0x%08x\n"), reqCookie);
-	test_KErrNone(r);
-
-	if(newPil)
-		{
-		test.Next(_L("Create Dma request (with new-style callback)"));
-		TUint reqCookieNewStyle=0;
-		r = session.RequestCreate(channelCookie, reqCookieNewStyle);
-		test.Printf(_L("cookie recived = 0x%08x\n"), reqCookieNewStyle );
-		test_KErrNone(r);
-
-		if(!aSimulatedDmac)
-			{
-			test.Next(_L("Fragment for ISR callback"));
-			const TInt size = 128 * KKilo;
-			TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr, KDmaSyncAuto, KDmaRequestCallbackFromIsr);
-			r = session.FragmentRequest(reqCookieNewStyle, transferArgs);
-			test_KErrNone(r);
-
-			TIsrRequeArgs reque;
-			test.Next(_L("Queue ISR callback - with default re-queue"));
-			r = session.QueueRequestWithRequeue(reqCookieNewStyle, &reque, 1);
-			test_KErrNone(r);
-			}
-
-		test.Next(_L("Destroy new-style Dma request"));
-		r = session.RequestDestroy(reqCookieNewStyle);
-		test_KErrNone(r);
-
-		test.Next(_L("Attempt to destroy request again "));
-		r = session.RequestDestroy(reqCookieNewStyle);
-		test_Equal(KErrNotFound, r);
-		}
-
-	test.Next(_L("Open chunk handle"));
-	RChunk chunk;
-	r = session.OpenSharedChunk(chunk);
-	test_KErrNone(r);
-	if(gVerboseOutput)
-	{
-	test.Printf(_L("chunk base = 0x%08x\n"), chunk.Base());
-	test.Printf(_L("chunk size = %d\n"), chunk.Size());
-	}
-	test(chunk.IsWritable());
-	test(chunk.IsReadable());
-
-	if(!aSimulatedDmac)
-		{
-		test.Next(_L("Fragment(old style)"));
-		const TInt size = 128 * KKilo;
-		TInt i;
-		for(i = 0; i<10; i++)
-			{
-			TUint64 time = 0;
-			TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr);
-			r = session.FragmentRequestOld(reqCookie, transferArgs, &time);
-			test_KErrNone(r);
-			if(gVerboseOutput)
-				{
-				test.Printf(_L("%lu us\n"), time);
-				}
-			}
-
-		test.Next(_L("Queue"));
-		TRequestStatus status;
-
-		for(i = 0; i<10; i++)
-			{
-			TUint64 time = 0;
-			r = session.QueueRequest(reqCookie, status, 0, &time);
-			User::WaitForRequest(status);
-			test_KErrNone(r);
-			if(gVerboseOutput)
-				{
-				test.Printf(_L("%lu us\n"), time);
-				}
-			}
-
-		if(newPil)
-			{
-			test.Next(_L("Fragment(new style)"));
-			TDmaTransferArgs transferArgs;
-			transferArgs.iSrcConfig.iAddr = 0;
-			transferArgs.iDstConfig.iAddr = size;
-			transferArgs.iSrcConfig.iFlags = KDmaMemAddr;
-			transferArgs.iDstConfig.iFlags = KDmaMemAddr;
-			transferArgs.iTransferCount = size;
-
-			for(i = 0; i<10; i++)
-				{
-				TUint64 time = 0;
-				r = session.FragmentRequest(reqCookie, transferArgs, &time);
-				test_KErrNone(r);
-				if(gVerboseOutput)
-					{
-					test.Printf(_L("%lu us\n"), time);
-					}
-				}
-			}
-
-		test.Next(_L("Queue"));
-		TCallbackRecord record;
-		r = session.QueueRequest(reqCookie, &record);
-		test_KErrNone(r);
-
-		test.Next(_L("check TCallbackRecord record"));
-		if(gVerboseOutput)
-		{
-		record.Print();
-		}
-		const TCallbackRecord expected(TCallbackRecord::EThread, 1);
-		if(!(record == expected))
-			{
-			test.Printf(_L("TCallbackRecords did not match"));
-			if(gVerboseOutput)
-				{
-				test.Printf(_L("expected:"));
-				expected.Print();
-				}
-			TEST_FAULT;
-			}
-		}
-
-	test.Next(_L("Destroy Dma request"));
-	r = session.RequestDestroy(reqCookie);
-	test_KErrNone(r);
-
-	test.Next(_L("Close chunk handle"));
-	chunk.Close();
-
-	test.Next(_L("Channel close"));
-	r = session.ChannelClose(channelCookie);
-	test_KErrNone(r);
-
-	test.Next(_L("Channel close (same again)"));
-	r = session.ChannelClose(channelCookie);
-	test_Equal(KErrNotFound, r);
-
-	test.Next(_L("Close session"));
-	RTest::CloseHandleAndWaitForDestruction(session);
-
-	test.End();
-	}
-
-const SDmacCaps KTestCapSet =
-	{6,										// TInt iChannelPriorities;
-	 EFalse,								// TBool iChannelPauseAndResume;
-	 ETrue,									// TBool iAddrAlignedToElementSize;
-	 EFalse,								// TBool i1DIndexAddressing;
-	 EFalse,								// TBool i2DIndexAddressing;
-	 KDmaSyncSizeElement | KDmaSyncSizeFrame |
-	 KDmaSyncSizeBlock,					   // TUint iSynchronizationTypes;
-	 KDmaBurstSize4 | KDmaBurstSize8,	   // TUint iBurstTransactions;
-	 EFalse,							   // TBool iDescriptorInterrupt;
-	 EFalse,							   // TBool iFrameInterrupt;
-	 EFalse,							   // TBool iLinkedListPausedInterrupt;
-	 EFalse,							   // TBool iEndiannessConversion;
-	 0,									   // TUint iGraphicsOps;
-	 ETrue,								   // TBool iRepeatingTransfers;
-	 EFalse,							   // TBool iChannelLinking;
-	 ETrue,								   // TBool iHwDescriptors;
-	 EFalse,							   // TBool iSrcDstAsymmetry;
-	 EFalse,							   // TBool iAsymHwDescriptors;
-	 EFalse,							   // TBool iBalancedAsymSegments;
-	 EFalse,							   // TBool iAsymCompletionInterrupt;
-	 EFalse,							   // TBool iAsymDescriptorInterrupt;
-	 EFalse,							   // TBool iAsymFrameInterrupt;
-	 {0, 0, 0, 0, 0}					   // TUint32 iReserved[5];
-	};
-
-const TDmacTestCaps KDmacTestCapsV1(KTestCapSet, 1);
-const TDmacTestCaps KDmacTestCapsV2(KTestCapSet, 2);
-
-void TDmaCapability::SelfTest()
-	{
-	test.Start(_L("Unit test_Value of TDmaCapability::CompareToDmaCaps\n"));
-// Note: The construction of the test description message
-// is horribly confusing. The _L macro will make the
-// *first* string token wide, but not the next two.
-// Therefore these must be made wide or compilier
-// will complain about concatination of narrow and wide string
-// literals
-#define CAP_TEST(CAP, CAPSET, EXPCT)\
-	{\
-	test.Next(_L(#CAP L" against " L ## #CAPSET));\
-	TResult t = (CAP).CompareToDmaCaps(CAPSET);\
-	test_Equal(EXPCT, t);\
-	}
-
-	CAP_TEST(none, KTestCapSet, ERun);
-	CAP_TEST(pauseRequired, KTestCapSet, EFail);
-	CAP_TEST(pauseRequired_skip, KTestCapSet, ESkip);
-	CAP_TEST(pauseNotWanted, KTestCapSet, ERun);
-	CAP_TEST(hwDesNotWanted, KTestCapSet, EFail);	
-	CAP_TEST(hwDesNotWanted_skip, KTestCapSet, ESkip);
-	CAP_TEST(hwDesWanted, KTestCapSet, ERun);
-
-	CAP_TEST(capEqualV1, KDmacTestCapsV1, ERun);
-	CAP_TEST(capEqualV2, KDmacTestCapsV2, ERun);
-	CAP_TEST(capEqualV1, KDmacTestCapsV2, ESkip);
-	CAP_TEST(capEqualV2, KDmacTestCapsV1, ESkip);
-	CAP_TEST(capEqualV2Fatal, KDmacTestCapsV1, EFail);
-
-	CAP_TEST(capAboveV1, KDmacTestCapsV2, ERun);
-	CAP_TEST(capBelowV2, KDmacTestCapsV1, ERun);
-	CAP_TEST(capAboveV1, KDmacTestCapsV1, ESkip);
-	CAP_TEST(capBelowV2, KDmacTestCapsV2, ESkip);
-
-	test.End();
-	}
-
-void TTestCase::SelfTest()
-	{
-	test.Start(_L("Unit test of TTestCase::TestCaseValid\n"));
-
-// Create a TTestCase with paramaters CAP1 and CAP2
-// call TTestCase::TestCaseValid against CAPSET
-// Expected result is EXPCT
-#define TEST_TEST_CASE(CAP1, CAP2, CAPSET, EXPCT)\
-	{\
-	test.Next(_L(#CAP1 L", " L ## #CAP2 L" -- Against: " L ## #CAPSET L", Expect: " L ## #EXPCT));\
-	TTestCase testCase(NULL, EFalse, CAP1, CAP2);\
-	testCase.iChannelCaps[0] = (CAP1);\
-	TResult t = testCase.TestCaseValid(CAPSET);\
-	test_Equal(EXPCT, t);\
-	}
-
-	TEST_TEST_CASE(pauseRequired, hwDesNotWanted, KTestCapSet, EFail);
-	TEST_TEST_CASE(pauseRequired_skip, hwDesNotWanted, KTestCapSet, EFail);
-	TEST_TEST_CASE(pauseRequired_skip, hwDesNotWanted_skip, KTestCapSet, ESkip);
-	TEST_TEST_CASE(pauseNotWanted, hwDesNotWanted_skip, KTestCapSet, ESkip);
-	TEST_TEST_CASE(pauseNotWanted, hwDesWanted, KTestCapSet, ERun);
-    TEST_TEST_CASE(pauseNotWanted, none, KTestCapSet, ERun);
-
-	TEST_TEST_CASE(pauseNotWanted, capAboveV1, KDmacTestCapsV1, ESkip);
-	TEST_TEST_CASE(pauseNotWanted, capAboveV1, KDmacTestCapsV2, ERun);
-
-	TEST_TEST_CASE(pauseNotWanted, capBelowV2, KDmacTestCapsV1, ERun);
-	TEST_TEST_CASE(pauseNotWanted, capBelowV2, KDmacTestCapsV2, ESkip);
-
-	// contradictory requirements
-	TEST_TEST_CASE(capAboveV1, capBelowV2, KDmacTestCapsV2, ESkip);
-	TEST_TEST_CASE(capBelowV2, capAboveV1, KDmacTestCapsV2, ESkip);
-
-	TEST_TEST_CASE(capAboveV1, capBelowV2, KDmacTestCapsV1, ESkip);
-	TEST_TEST_CASE(capBelowV2, capAboveV1, KDmacTestCapsV1, ESkip);
-
-	test.End();
-	test.Close();
-	}
-
-
-void TTransferIter::SelfTest()
-	{
-	test.Start(_L("No skip"));
-
-	const TUint8 src[9] = {
-			1 ,2, 3,
-			4, 5, 6,
-			7, 8, 9
-	};
-
-	const TUint32 addr = (TUint32)src;
-	const TUint elementSize = 1;
-	const TUint elementSkip = 0;
-	const TUint elementsPerFrame = 3;
-	const TUint frameSkip = 0;
-	const TUint framesPerTransfer = 3;
-	TDmaTransferConfig cfg(addr, elementSize, elementsPerFrame, framesPerTransfer,
-			elementSkip, frameSkip, KDmaMemAddr
-			);
-
-	TTransferIter iter(cfg, 0);
-	TTransferIter end;
-	TInt i;
-	for(i = 0; i<9; i++, ++iter)
-		{
-		test_Equal(src[i],*iter);
-		};
-
-
-	test.Next(_L("90 degree rotation"));
-	// Now imagine that we wanted to perform a rotation
-	// as we write, so that we wrote out the following
-
-	const TUint8 expected[9] = {
-		7, 4, 1,
-		8, 5, 2,
-		9, 6, 3
-	};
-
-	TUint8 dst[9] = {0};
-	TDmaTransferConfig dst_cfg(cfg);
-	dst_cfg.iAddr = (TUint32)&dst[2];
-	dst_cfg.iElementSkip = 2;
-	dst_cfg.iFrameSkip = -8;
-
-	TTransferIter dst_iter(dst_cfg, 0);
-	for(i=0; dst_iter != end; i++, ++dst_iter)
-		{
-		TEST_ASSERT(i<9);
-		*dst_iter=src[i];
-		};
-
-	for(i=0; i<9; i++)
-		{
-		test_Equal(expected[i],dst[i]);
-		}
-	}
-
-void TCallbackRecord::SelfTest()
-	{
-	test.Start(_L("SelfTest of TCallbackRecord"));
-
-	test.Next(_L("create default TCallbackRecord record, record2"));
-	TCallbackRecord record;
-	const TCallbackRecord record2;
-	if(gVerboseOutput)
-	{
-	test.Next(_L("Print record"));
-	record.Print();
-	}
-
-	test.Next(_L("test (record == record2)"));
-	if(!(record == record2))
-		{
-		if(gVerboseOutput)
-			{
-			record2.Print();
-			}
-		TEST_FAULT;
-		}
-
-	//A series of callback masks
-	//Note these combinations do not necessarily represent
-	//possible callback combinations
-	TUint callbacks[]  =
-		{
-		EDmaCallbackDescriptorCompletion,
-		EDmaCallbackDescriptorCompletion,
-		EDmaCallbackDescriptorCompletion,
-		EDmaCallbackDescriptorCompletion,
-		EDmaCallbackFrameCompletion_Src,
-		EDmaCallbackFrameCompletion_Dst,
-		EDmaCallbackDescriptorCompletion_Src | EDmaCallbackDescriptorCompletion_Dst,
-		EDmaCallbackDescriptorCompletion_Src | EDmaCallbackFrameCompletion_Src | EDmaCallbackLinkedListPaused_Dst,
-		EDmaCallbackRequestCompletion | EDmaCallbackRequestCompletion_Src,
-		EDmaCallbackDescriptorCompletion_Dst
-		};
-	test.Next(_L("Feed a series of callback masks in to record"));
-	const TInt length = ARRAY_LENGTH(callbacks);
-	for(TInt i = 0; i < length; i++)
-		{
-		record.ProcessCallback(callbacks[i], EDmaResultOK);
-		}
-	
-	if(gVerboseOutput)
-	{
-	test.Next(_L("Print record"));
-	record.Print();
-	}
-
-	test.Next(_L("test GetCount"));
-	test_Equal(1, record.GetCount(EDmaCallbackRequestCompletion));
-	test_Equal(1, record.GetCount(EDmaCallbackRequestCompletion_Src));
-	test_Equal(0, record.GetCount(EDmaCallbackRequestCompletion_Dst));
-	test_Equal(4, record.GetCount(EDmaCallbackDescriptorCompletion));
-	test_Equal(2, record.GetCount(EDmaCallbackDescriptorCompletion_Src));
-	test_Equal(2, record.GetCount(EDmaCallbackDescriptorCompletion_Dst));
-	test_Equal(0, record.GetCount(EDmaCallbackFrameCompletion));
-	test_Equal(2, record.GetCount(EDmaCallbackFrameCompletion_Src));
-	test_Equal(1, record.GetCount(EDmaCallbackFrameCompletion_Dst));
-	test_Equal(0, record.GetCount(EDmaCallbackLinkedListPaused));
-	test_Equal(0, record.GetCount(EDmaCallbackLinkedListPaused_Src));
-	test_Equal(1, record.GetCount(EDmaCallbackLinkedListPaused_Dst));
-
-	test.Next(_L("test expected == record"));
-	const TCallbackRecord expected(TCallbackRecord::EThread, 1, 1, 0, 4, 2, 2, 0, 2, 1, 0, 0, 1);
-	if(!(expected == record))
-		{
-		if(gVerboseOutput)
-			{
-			expected.Print();
-			}
-		TEST_FAULT;
-		}
-
-	test.Next(_L("modify record: test expected != record"));
-	record.SetCount(EDmaCallbackFrameCompletion, 10);
-	if(expected == record)
-		{
-		if(gVerboseOutput)
-			{
-			expected.Print();
-			}
-		TEST_FAULT;
-		}
-
-	test.Next(_L("test Reset()"));
-	record.Reset();
-	test(record == record2);
-
-	test.End();
-	}
-
-void CDmaBenchmark::SelfTest()
-	{
-	test.Start(_L("SelfTest of CDmaBenchmark"));
-	test.Next(_L("MeanResult()"));
-
-	// The mean of these numbers is 10
-	TUint64 results[] = {8, 12, 1, 19, 3, 17, 10};
-	const TInt count = ARRAY_LENGTH(results);
-
-	CDmaBmFragmentation fragTest(_L("SelfTest"), count, TDmaTransferArgs(), 0);
-
-	for(TInt i = 0; i < count; i++)
-		{
-		fragTest.iResultArray.Append(results[i]);
-		}
-	test_Equal(10, fragTest.MeanResult());
-
-	test.End();
-	}
-
-void TAddrRange::SelfTest()
-	{
-	test.Start(_L("SelfTest of TAddrRange"));
-	TAddrRange a(0, 8);
-	TAddrRange b(8, 8);
-
-	test_Equal(7, a.End());
-	test_Equal(15, b.End());
-
-	test(!a.Overlaps(b));
-	test(!b.Overlaps(a));
-	test(a.Overlaps(a));
-	test(b.Overlaps(b));
-
-	TAddrRange c(7, 2);
-	test_Equal(8, c.End());
-
-	test(a.Overlaps(c));
-	test(c.Overlaps(a));
-	test(b.Overlaps(c));
-	test(c.Overlaps(b));
-
-	TAddrRange d(0, 24);
-	test(a.Overlaps(d));
-	test(d.Overlaps(a));
-
-	test(b.Overlaps(d));
-	test(d.Overlaps(b));
-
-	test(d.Contains(d));
-
-	test(d.Contains(a));
-	test(!a.Contains(d));
-
-	test(d.Contains(b));
-	test(!b.Contains(d));
-
-	test(!a.Contains(b));
-	test(!b.Contains(a));
-
-	test.Next(_L("Test IsFilled()"));
-	TUint8 buffer[] = {0,0,0,0};
-	TAddrRange range((TUint)buffer, 4);
-	test(range.IsFilled(0));
-	buffer[3] = 1;
-	test(!range.IsFilled(0));
-	buffer[2] = 1;
-	buffer[1] = 1;
-	buffer[0] = 1;
-	test(range.IsFilled(1));
-
-	test.End();
-	}
-
-void TAddressParms::SelfTest()
-	{
-	test.Start(_L("SelfTest of TAddressParms"));
-	const TAddressParms pA(0, 32, 8);
-	test(pA == pA);
-	test(pA.Overlaps(pA));
-
-	const TAddrRange rA(4, 8);
-	const TAddrRange rB(16, 8);
-	const TAddrRange rC(28, 8);
-	const TAddrRange rD(4, 32);
-
-	test(pA.Overlaps(rA));
-	test(!pA.Overlaps(rB));
-	test(pA.Overlaps(rC));
-	test(pA.Overlaps(rD));
-
-	const TAddressParms pB(8, 16, 8);
-	test(!(pA == pB));
-	test(!(pB == pA));
-	test(!pA.Overlaps(pB));
-	test(!pB.Overlaps(pA));
-
-	const TAddressParms pC(8, 28, 8);
-	test(pC.Overlaps(pA));
-	test(pC.Overlaps(pB));
-
-	const TAddressParms pD(0, 128, 64);
-	test(pD.Overlaps(pA));
-	test(pD.Overlaps(pB));
-	test(pD.Overlaps(pC));
-	test.End();
-	}
-
-void TIsrRequeArgsSet::SelfTest()
-	{
-	test.Start(_L("Selftest of TIsrRequeArgsSet"));
-
-	TUint size = 0x1000;
-	TDmaTransferArgs tferArgs(0, 1*size, size, KDmaMemAddr, KDmaSyncAuto, KDmaRequestCallbackFromIsr);
-
-	TIsrRequeArgs requeArgArray[] = {
-		TIsrRequeArgs(),									// Repeat
-		TIsrRequeArgs(KPhysAddrInvalidUser, 2*size, 0),		// Change destination
-		TIsrRequeArgs(),									// Repeat
-		TIsrRequeArgs(3*size, KPhysAddrInvalidUser, 0),		// Change source
-		TIsrRequeArgs(),									// Repeat
-	};
-	TIsrRequeArgsSet argSet(requeArgArray, ARRAY_LENGTH(requeArgArray));
-
-	test.Next(_L("Test that Substitute updates transfer args in order"));
-	argSet.Substitute(tferArgs);
-
-	TAddressParms expectedFinal(3*size, 2*size, size);
-	if(!(expectedFinal == argSet.iRequeArgs[4]))
-		{
-		TBuf<0x100> out;
-
-		out += _L("substitue: ");
-		GetAddrParms(tferArgs).AppendString(out);
-		test.Printf(out);
-
-		out.Zero();
-		out += _L("\nexpected final: ");
-		expectedFinal.AppendString(out);
-		test.Printf(out);
-
-		out.Zero();
-		out += _L("\nactual: ");
-		argSet.iRequeArgs[4].AppendString(out);
-		test.Printf(out);
-
-		test(EFalse);
-		}
-
-	TIsrRequeArgs requeArgArray2[] = {
-		TIsrRequeArgs(),									// Repeat
-		TIsrRequeArgs(KPhysAddrInvalidUser, 2*size, 0),		// Change destination
-		TIsrRequeArgs(KPhysAddrInvalidUser, 1*size, 0),		// Change destination back
-	};
-	argSet = TIsrRequeArgsSet(requeArgArray2, ARRAY_LENGTH(requeArgArray2));
-
-	test.Next(_L("CheckRange(), negative"));
-
-	test(!argSet.CheckRange(0, (2 * size) - 1, tferArgs));
-	test(!argSet.CheckRange(0, (2 * size) + 1, tferArgs));
-	test(!argSet.CheckRange(0, (2 * size), tferArgs));
-
-	test(!argSet.CheckRange(1 ,(3 * size), tferArgs));
-	test(!argSet.CheckRange(1 ,(3 * size) + 1, tferArgs));
-
-	test(!argSet.CheckRange(1 * size , 2 * size, tferArgs));
-
-	test.Next(_L("CheckRange(), positive"));
-	test(argSet.CheckRange(0, 3 * size, tferArgs));
-	test(argSet.CheckRange(0, 3 * size+1, tferArgs));
-	test(argSet.CheckRange(0, 4 * size, tferArgs));
-
-
-	test.End();
-	}
-
-void RArrayCopyTestL()
-	{
-	test.Start(_L("Selftest of RArray CopyL"));
-
-	RArray<TInt> orig;
-	TInt i;													// VC++
-	for(i=0; i<10; i++)
-		{
-		orig.AppendL(i);
-		}
-
-	RArray<TInt> newArray;
-	CopyL(orig, newArray);
-
-	test_Equal(10, newArray.Count());
-
-	for(i=0; i<10; i++)
-		{
-		test_Equal(orig[i], newArray[i])
-		}
-
-	orig.Close();
-	newArray.Close();
-	test.End();
-	}
-
-void RArrayInsertLTest()
-	{
-	test.Start(_L("Selftest of RArray InsertL"));
-
-	RArray<TInt> array;
-	TInt numbers[10] = {0,1,2,3,4,5,6,7,8,9};
-	ArrayAppendL(array, &numbers[0], numbers + ARRAY_LENGTH(numbers));
-
-	test_Equal(10, array.Count());
-	for(TInt i=0; i<10; i++)
-		{
-		test_Equal(numbers[i], array[i])
-		}
-
-	array.Close();
-	test.End();
-	}
-
-/**
-Run check buffers on the supplied TAddressParms array
-*/
-TBool DoTferParmTestL(const TAddressParms* aParms, TInt aCount, TBool aAllowRepeat, TBool aPositive)
-	{
-	_LIT(KPositive, "positive");
-	_LIT(KNegative, "negative");
-	test.Printf(_L("CheckBuffers %S test: %d args, repeats allowed %d\n"),
-			(aPositive ? &KPositive : &KNegative), aCount, aAllowRepeat);
-	RArray<const TAddressParms> array;
-	ArrayAppendL(array, aParms, aParms + aCount);
-	TPreTransferIncrBytes preTran;
-	TBool r = preTran.CheckBuffers(array, aAllowRepeat);
-	array.Close();
-	return r;
-	}
-
-void TPreTransferIncrBytes::SelfTest()
-	{
-	// Test that TPreTransferIncrBytes::CheckBuffers can identify
-	// overlapping buffers
-	test.Start(_L("Selftest of TPreTransferIncrBytes"));
-
-// Macro generates test for 2 element array
-#define TPARM_TEST2(EXPECT, ALLOW_REPEAT, EL0, EL1)\
-		{\
-		TAddressParms set[2] = {EL0, EL1}; \
-		const TBool r = DoTferParmTestL(set, 2, ALLOW_REPEAT, EXPECT);\
-		test_Equal(EXPECT, r);\
-		}
-
-// Generate positive 2 element test
-#define TPARM_TEST2_POSITIVE(ALLOW_REPEAT, EL0, EL1) TPARM_TEST2(ETrue, ALLOW_REPEAT, EL0, EL1)
-// Generate negative 2 element test
-#define TPARM_TEST2_NEG(ALLOW_REPEAT, EL0, EL1) TPARM_TEST2(EFalse, ALLOW_REPEAT, EL0, EL1)
-
-// Macro generates test for 3 element array
-#define TPARM_TEST3(EXPECT, ALLOW_REPEAT, EL0, EL1, EL2)\
-		{\
-		TAddressParms set[3] = {EL0, EL1, EL2}; \
-		const TBool r = DoTferParmTestL(set, 3, ALLOW_REPEAT, EXPECT);\
-		test_Equal(EXPECT, r);\
-		}
-
-// Generate positive 3 element test
-#define TPARM_TEST3_POSITIVE(ALLOW_REPEAT, EL0, EL1, EL2) TPARM_TEST3(ETrue, ALLOW_REPEAT, EL0, EL1, EL2)
-// Generate negative 3 element test
-#define TPARM_TEST3_NEG(ALLOW_REPEAT, EL0, EL1, EL2) TPARM_TEST3(EFalse, ALLOW_REPEAT, EL0, EL1, EL2)
-
-	TPARM_TEST2_POSITIVE(EFalse, TAddressParms(0,16,16), TAddressParms(32, 48, 16));
-	TPARM_TEST2_POSITIVE(ETrue, TAddressParms(0, 16, 16), TAddressParms(0, 16, 16)); // both overlap (repeat allowed)
-
-	TPARM_TEST2_NEG(EFalse, TAddressParms(0,16,16), TAddressParms(24, 40, 16)); // second source depends on first destination
-	TPARM_TEST2_NEG(EFalse, TAddressParms(0,16,16), TAddressParms(16, 0, 16)); // second dest overwrites first source
-	TPARM_TEST2_NEG(EFalse, TAddressParms(0, 16, 16), TAddressParms(0, 16, 16)); // both overlap (repeat not allowed)
-	TPARM_TEST2_NEG(ETrue, TAddressParms(0, 16, 16), TAddressParms(0, 20, 16)); // exact repeat allowed, but overlap is only partial
-	TPARM_TEST2_NEG(ETrue, TAddressParms(0, 16, 16), TAddressParms(32, 16, 16)); // exact repeat allowed, but 2nd overwrites first dest
-
-
-	TPARM_TEST3_POSITIVE(EFalse, TAddressParms(0,16,16), TAddressParms(32, 48, 16), TAddressParms(64, 128, 64)); // no overlaps
-	TPARM_TEST3_POSITIVE(ETrue, TAddressParms(0, 16, 16), TAddressParms(0, 16, 16), TAddressParms(0, 16, 16)); // all overlap (repeat allowed)
-	TPARM_TEST3_POSITIVE(EFalse, TAddressParms(0,16,16), TAddressParms(0, 32, 16), TAddressParms(0, 48, 16)); // no overlaps (1 src to 3 dsts)
-
-	TPARM_TEST3_NEG(EFalse, TAddressParms(0,16,16), TAddressParms(128, 256, 128), TAddressParms(24, 40, 16)); // 3rd source depends on first destination
-	TPARM_TEST3_NEG(EFalse, TAddressParms(0,16,16), TAddressParms(128, 256, 128), TAddressParms(16, 0, 16)); // 3rd dest overwrites first source
-	TPARM_TEST3_NEG(EFalse, TAddressParms(0, 16, 16), TAddressParms(0, 16, 16), TAddressParms(0, 16, 16)); // all overlap (repeat not allowed)
-	test.Next(_L("CheckBuffers(RArray<TAddressParms>)"));
-	}
-
-void SelfTests()
-	{
-	test.Next(_L("Running framework unit tests"));
-#ifndef __WINS__
-	// Cannot connect real driver on Emulator - only
-	// simulator
-	RDmaSession::SelfTest(EFalse);
-#endif
-	RDmaSession::SelfTest(ETrue);
-	TDmaCapability::SelfTest();
-	TTestCase::SelfTest();
-	TTransferIter::SelfTest();
-	TCallbackRecord::SelfTest();
-	CDmaBmFragmentation::SelfTest();
-	TAddrRange::SelfTest();
-	TAddressParms::SelfTest();
-	TIsrRequeArgsSet::SelfTest();
-	RArrayCopyTestL();
-	RArrayInsertLTest();
-	TPreTransferIncrBytes::SelfTest();
-	test.End();
-	test.Close();
-	}
--- a/kerneltest/e32test/dmav2/t_dma2.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2851 +0,0 @@
-// 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"
-// 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\dmav2\t_dma2.cpp
-
-#include "d_dma2.h"
-#include "u32std.h"
-#include "t_dma2.h"
-#include "cap_reqs.h"
-
-#define __E32TEST_EXTENSION__
-#include <e32test.h>
-#include <e32debug.h>
-#include <e32svr.h>
-#include <e32def_private.h>
-
-// DMA test framework command  parameter options
-
-// SelfTest option
-_LIT(KArgSelfTest, "/SELFTEST");  
-_LIT(KArgSelfTest2, "/S");		  
-
-//Verbose option
-_LIT(KArgVerboseOutput, "/VERBOSE"); 
-_LIT(KArgVerboseOutput2, "/V");	     
-  
-//Simple transfer test option
-_LIT(KArgSimpleTest, "/simple"); 
-
-//Callback test option
-_LIT(KArgCallBackTest, "/callback");
-
-//Suspend test option
-_LIT(KArgSuspendTest, "/suspend");
-
-//Multipart transfer tests
-_LIT(KArgMultiPartTest, "/multi");
-
-//Isr and dfc test option
-_LIT(KArgIsrDfcTest, "/isrdfc");
-
-//Isr reque  test option
-_LIT(KArgIsrequeTest, "/isreque");
-
-//Benchmark test option
-_LIT(KArgBenchmarkTest, "/bench");
-
-//Graphics test option
-_LIT(KArgGraphicTest, "/graphic");
-
-//DMA channel (opening and closing)  test option
-_LIT(KArgChannelTest, "/channel");
-
-//Queue test option
-_LIT(KArgQueueTest, "/queue");
-
-//Fragment test option
-_LIT(KArgFragmentTest, "/fragment");
-
-//Request test option
-_LIT(KArgRequestTest, "/request");
-
-
-
-TBool gHelpRequested;   // print usage 
-TBool gVerboseOutput;   // enable verbose output 
-TBool gSelfTest;        // run SelfTest 
-TBool gSimpleTest;		// run only Simple transfer test
-TBool gCallBack;		// run only Callback test
-TBool gSuspend;			// run only Pause and resume tests
-TBool gIsrReque;		// run only IsrReque tests
-TBool gMultiPart;		// run only Multipart tests
-TBool gIsrAndDfc;		// run only IsrAndDfc tests
-TBool gBenchmark;		// run only Benchmark tests
-TBool gGraphic;			// run only Graphic tests
-TBool gFragment;		// run only Fragment related tests
-TBool gChannel;			// run only Channel(open/close)tests
-TBool gQueue;			// run only Queue related tests
-TBool gRequest;			// run only Request related tests
-
-/**
-This function prints out the PSL test Information
-*/
-void Print(const TDmaV2TestInfo& aInfo)
-	{
-	PRINT(aInfo.iMaxTransferSize);
-	PRINT(aInfo.iMemAlignMask);
-	PRINT(aInfo.iMemMemPslInfo);
-	PRINT(aInfo.iMaxSbChannels);
-	for(TInt i=0; i<aInfo.iMaxSbChannels; i++)
-		{
-		PRINT(aInfo.iSbChannels[i]);
-		}
-	PRINT(aInfo.iMaxDbChannels);
-	for(TInt j=0; j<aInfo.iMaxDbChannels; j++)
-		{
-		PRINT(aInfo.iDbChannels[j]);
-		}
-	PRINT(aInfo.iMaxSgChannels);
-	for(TInt k=0; k<aInfo.iMaxSgChannels; k++)
-		{
-		PRINT(aInfo.iSgChannels[k]);
-		}
-	}
-
-void CDmaTest::PrintTestInfo() const
-	{
-	TBuf<32> buf;
-	buf.AppendFormat(_L("DMA channel %d"), iChannelCookie);
-	RDebug::RawPrint(buf);
-	}
-
-//////////////////////////////////////////////////////////////////////
-// CDmaTest
-//////////////////////////////////////////////////////////////////////
-
-void CDmaTest::OpenDmaSession()
-	{
-	// Only open a new session if one
-	// was not already supplied
-	if(iDmaSession.Handle() == KNullHandle)
-		{
-		TInt r = iDmaSession.Open();
-		if(KErrNone != r)
-			{
-			RDebug::Printf("CDmaTest::OpenDmaSession = %d\n", r);
-			}
-		TEST_ASSERT(r == KErrNone);
-		r = iDmaSession.OpenSharedChunk(iChunk);
-		TEST_ASSERT(r == KErrNone);
-		}
-	}
-
-// Open another handle to the test driver
-void CDmaTest::OpenDmaSession(const RDmaSession& aSession)
-	{
-	iDmaSession = aSession;
-	TInt r = iDmaSession.Duplicate(RThread(), EOwnerThread);
-	TEST_ASSERT(r == KErrNone);
-
-	// open another handle to the test driver chunk
-	r = iDmaSession.OpenSharedChunk(iChunk);
-	TEST_ASSERT(r == KErrNone);
-	}
-
-void CDmaTest::CloseDmaSession()
-	{
-	iChunk.Close();
-	iDmaSession.Close();
-	}
-
-void CDmaTest::PreTransferSetup()
-	{
-	}
-
-TInt CDmaTest::DoPostTransferCheck()
-	{
-	return KErrNotSupported;
-	}
-
-void CDmaTest::ChannelPause(TUint aChannelSessionCookie)
-{
-	TInt r = iDmaSession.ChannelPause(aChannelSessionCookie);
-	TEST_ASSERT(r == KErrNone);
-}
-
-void CDmaTest::ChannelResume(TUint aChannelSessionCookie)
-{
-	TInt r = iDmaSession.ChannelResume(aChannelSessionCookie);
-	TEST_ASSERT(r == KErrNone);
-}
-//////////////////////////////////////////////////////////////////////
-// CSingleTransferTest
-//////////////////////////////////////////////////////////////////////
-void CSingleTransferTest::RunTest()
-	{
-	OpenDmaSession();
-	PreTransferSetup();
-
-	OpenChannel();
-	CreateDmaRequest();
-	Fragment();
-	Queue();
-	FreeRequest();
-	CloseChannel();
-	PostTransferCheck();
-
-	CloseDmaSession();
-	}
-
-void CSingleTransferTest::OpenChannel()
-	{
-	iActual.iChannelOpenResult =
-		iDmaSession.ChannelOpen(iChannelCookie, iChannelSessionCookie);
-	}
-
-void CSingleTransferTest::CreateDmaRequest()
-	{
-	if(iUseNewRequest)
-	{
-		if(gVerboseOutput)
-			{
-			RDebug::Printf("Calling New Request API\n");
-			}
-		iActual.iRequestResult.iCreate =
-			iDmaSession.RequestCreate(iChannelSessionCookie, iRequestSessionCookie, iMaxFragmentSize);
-		}
-	else
-		{
-		if(gVerboseOutput)
-			{
-			RDebug::Printf("Calling Old Request API\n");
-			}
-		iActual.iRequestResult.iCreate =
-			iDmaSession.RequestCreateOld(iChannelSessionCookie, iRequestSessionCookie, iMaxFragmentSize);
-		}
-	}
-
-void CSingleTransferTest::Fragment()
-	{
-	if(iActual.iRequestResult.iCreate != KErrNone)
-		return;
-
-	if(iUseNewFragment)
-		{
-		if(gVerboseOutput)
-			{
-			RDebug::Printf("Calling New Fragment API\n");
-			}
-		iActual.iRequestResult.iFragmentationResult =
-			iDmaSession.FragmentRequest(iRequestSessionCookie, iTransferArgs);
-		}
-	else
-		{
-		if(gVerboseOutput)
-			{
-			RDebug::Printf("Calling Old Fragment API\n");
-			}
-		iActual.iRequestResult.iFragmentationResult =
-			iDmaSession.FragmentRequestOld(iRequestSessionCookie, iTransferArgs);
-		}
-
-	const TInt fragmentCount = iDmaSession.RequestFragmentCount(iRequestSessionCookie);
-
-	// Record the fragment count if a non-zero value was expected,
-	// or if it was an error value
-	if(iExpected.iRequestResult.iFragmentCount != 0 || fragmentCount < 0)
-		iActual.iRequestResult.iFragmentCount = fragmentCount;
-	}
-
-void CSingleTransferTest::Queue()
-	{
-	if(iActual.iRequestResult.iFragmentationResult == KErrNone)
-		{
-		iActual.iRequestResult.iQueueResult = iDmaSession.QueueRequest(iRequestSessionCookie, &iActual.iCallbackRecord);
-		}
-	}
-
-void CSingleTransferTest::PostTransferCheck()
-	{
-	if(iPostTransferCheck)
-		iActual.iPostTransferCheck = DoPostTransferCheck();
-	}
-
-TInt CSingleTransferTest::DoPostTransferCheck()
-	{
-	return iPostTransferCheck->Check(*this);
-	}
-
-void CSingleTransferTest::FreeRequest()
-	{
-	if(iActual.iRequestResult.iCreate == KErrNone)
-		{
-		TInt r = iDmaSession.RequestDestroy(iRequestSessionCookie);
-		TEST_ASSERT(r == KErrNone);
-		}
-	}
-
-void CSingleTransferTest::CloseChannel()
-	{
-	if(iActual.iChannelOpenResult == KErrNone)
-		{
-		TInt r = iDmaSession.ChannelClose(iChannelSessionCookie);
-		TEST_ASSERT(r == KErrNone);
-		}
-	}
-
-void CSingleTransferTest::PrintTestType() const
-	{
-	RDebug::RawPrint(_L("Single transfer"));
-	}
-
-void CSingleTransferTest::PrintTestInfo() const
-	{
-	CDmaTest::PrintTestInfo();
-
-	// State which API versions are being used
-	if(iUseNewFragment)
-		RDebug::RawPrint(_L(", Fragment v2,"));
-	else
-		RDebug::RawPrint(_L(", Fragment v1,"));
-
-	if(iUseNewRequest)
-		RDebug::RawPrint(_L(" DDmaRequest v2"));
-	else
-		RDebug::RawPrint(_L(" DDmaRequest v1"));
-	}
-
-void CSingleTransferTest::PreTransferSetup()
-	{
-	if(iPreTransfer)
-		iPreTransfer->Setup(*this); //initialize test
-	}
-
-TBool CSingleTransferTest::Result()
-	{
-	const TBool result = iExpected == iActual;
-	if(!result)
-		{
-		RDebug::Printf("TResultSets do not match");
-		}
-	if(!result || gVerboseOutput)
-		{
-		RDebug::Printf("\nExpected error codes:");
-		iExpected.Print();
-		RDebug::Printf("Expected callback record:");
-		iExpected.iCallbackRecord.Print();
-
-		RDebug::Printf("\nActual error codes:");
-		iActual.Print();
-		RDebug::Printf("Actual callback record:");
-		iActual.iCallbackRecord.Print();
-		}
-	return result;
-	}
-
-//////////////////////////////////////////////////////////////////////
-// CDmaTestDecorator
-//////////////////////////////////////////////////////////////////////
-
-CDmaTestDecorator::CDmaTestDecorator(CDmaTest* aDecoratedTest)
-	: CDmaTest(_L("Decorated Test"), 1, NULL, NULL), iDecoratedTest(aDecoratedTest)
-	{}
-
-CDmaTestDecorator::CDmaTestDecorator(const CDmaTestDecorator& aOther)
-	: CDmaTest(aOther), iDecoratedTest( static_cast<CDmaTest*>( aOther.iDecoratedTest->Clone() ) )
-	// Need cast because Clone does not have a covariant return type,
-	// as not all compillers allow it
-	{}
-
-//////////////////////////////////////////////////////////////////////
-// CMultiVersionTest
-//////////////////////////////////////////////////////////////////////
-
-CMultiVersionTest::CMultiVersionTest(CSingleTransferTest* aDmaTest)
-	: CDmaTestDecorator(aDmaTest), iNewVersionTest(NULL)
-	{
-	}
-
-CMultiVersionTest::CMultiVersionTest(const CMultiVersionTest& aOther)
-	: CDmaTestDecorator(aOther), iNewVersionTest( aOther.iNewVersionTest ? static_cast<CSingleTransferTest*>(aOther.iNewVersionTest->Clone()) : NULL)
-	{
-	}
-
-CMultiVersionTest::~CMultiVersionTest()
-	{
-	delete iDecoratedTest;
-	delete iNewVersionTest;
-	}
-
-void CMultiVersionTest::SetupL()
-	{
-	// Open a tempory dma session to find out the
-	// capabilities of the dma channel.
-	OpenDmaSession();
-	Configure();
-	CloseDmaSession();
-	}
-
-void CMultiVersionTest::Announce() const
-	{
-	CTest::Announce();
-
-	iDecoratedTest->Announce();
-
-	if(iNewVersionTest)
-		iNewVersionTest->Announce();
-	}
-
-void CMultiVersionTest::PrintTestType() const
-	{
-	RDebug::RawPrint(_L("Multi version test wrapper"));
-	}
-
-void CMultiVersionTest::PrintTestInfo() const
-	{
-		if(iNewVersionTest)
-			{ 		
-			RDebug::RawPrint(_L("Running tests using Version 2 PIL"));
-			}
-		else
-			{
-			RDebug::RawPrint(_L("Running tests using Version 1 PIL"));		
-			}
-	}
-
-void CMultiVersionTest::RunTest()
-	{
-	OpenDmaSession();
-
-	// iDecoratedTest is the test, in the old configuration
-	// iNewVersionTest is the same test, configured
-	// to use the new APIs
-	//
-	// 2 objects are needed since they can each store
-	// their own results
-
-	iDecoratedTest->OpenDmaSession(iDmaSession);
-	(*iDecoratedTest)();
-
-	if(iNewVersionTest)
-		{
-		iNewVersionTest->OpenDmaSession(iDmaSession);
-		(*iNewVersionTest)();
-		}
-
-	CloseDmaSession();
-	}
-
-/**
-Maybe create another test object to run with new API
-
-Pass on the cookie for the channel they must test
-*/
-void CMultiVersionTest::Configure()
-	{
-	static_cast<CSingleTransferTest*>(iDecoratedTest)->UseNewDmaApi(EFalse);
-	iDecoratedTest->SetChannelCookie(iChannelCookie);
-
-	if(Version2PILAvailable())
-		{
-		iNewVersionTest = static_cast<CSingleTransferTest*>(iDecoratedTest->Clone());
-		TEST_ASSERT(iNewVersionTest != NULL);
-
-		iNewVersionTest->UseNewDmaApi(ETrue);
-		iNewVersionTest->SetChannelCookie(iChannelCookie);
-		}
-	}
-
-/**
-Discover from DMA channel what PIL versions are available.
-In practice V1 APIs will always be available, V2 may be.
-*/
-TBool CMultiVersionTest::Version2PILAvailable()
-	{
-	TUint channelSessionCookie;
-	TInt r = iDmaSession.ChannelOpen(iChannelCookie, channelSessionCookie);
-	TEST_ASSERT(r == KErrNone);
-
-	TDmacTestCaps channelCaps;
-	r = iDmaSession.ChannelCaps(channelSessionCookie, channelCaps);
-	TEST_ASSERT(r == KErrNone);
-
-	r = iDmaSession.ChannelClose(channelSessionCookie);
-	TEST_ASSERT(r == KErrNone);
-
-	return channelCaps.iPILVersion >= 2;
-	}
-
-TBool CMultiVersionTest::Result()
-	{
-	TBool v1Result = iDecoratedTest->Result();
-	if(gVerboseOutput || !v1Result)
-		RDebug::Printf("V1 API result: %s", v1Result ? "success" : "failure");
-
-	TBool v2Result = iNewVersionTest ? iNewVersionTest->Result() : ETrue;
-	if(gVerboseOutput || !v1Result)
-		RDebug::Printf("V2 API result: %s", v2Result ? "success" : "failure");
-	return v1Result && v2Result;
-	}
-
-//////////////////////////////////////////////////////////////////////
-// CDmaBenchmark
-//////////////////////////////////////////////////////////////////////
-CDmaBenchmark::CDmaBenchmark(const TDesC& aName, TInt aIterations, const TResultSet& aExpectedResults, const TDmaTransferArgs& aTransferArgs, TUint aMaxFragmentSize)
-	:CSingleTransferTest(aName, aIterations, aTransferArgs, aExpectedResults, aMaxFragmentSize, NULL, NULL)
-	{
-	UseNewDmaApi(EFalse);
-	}
-
-CDmaBenchmark::CDmaBenchmark(const CDmaBenchmark& aOriginal)
-	:CSingleTransferTest(aOriginal)
-	{
-	CopyL(aOriginal.iResultArray, iResultArray);
-	}
-
-CDmaBenchmark::~CDmaBenchmark()
-	{
-	iResultArray.Close();
-	}
-
-TUint64 CDmaBenchmark::MeanResult()
-	{
-	if(gVerboseOutput)
-		RDebug::Printf("CDmaBenchmark::MeanResult\n");
-
-	const TInt count = iResultArray.Count();
-
-	TEST_ASSERT(count > 0);
-	TEST_ASSERT(count == iIterations);
-
-	TUint64 sum = 0;
-
-	for(TInt i = 0; i < count; i++)
-		{
-		const TUint64 value = iResultArray[i];
-		if(gVerboseOutput)
-			RDebug::Printf("iResultArray[%d]: %lu", i, value);
-
-		sum += value;
-		}
-
-	return sum / count;
-	}
-
-TBool CDmaBenchmark::Result()
-	{
-	const TBool result = CSingleTransferTest::Result();
-	if(result)
-		{
-		RDebug::Printf("  Mean time: %lu us", MeanResult());
-		}
-
-	return result;
-	}
-
-//////////////////////////////////////////////////////////////////////
-// CDmaBmFragmentation
-//////////////////////////////////////////////////////////////////////
-CDmaBmFragmentation::CDmaBmFragmentation(const TDesC& aName, TInt aIterations, const TDmaTransferArgs& aTransferArgs, TUint aMaxFragmentSize)
-	:CDmaBenchmark(aName, aIterations, ExpectedResults, aTransferArgs, aMaxFragmentSize)
-	{}
-
-const TResultSet CDmaBmFragmentation::ExpectedResults(KErrNone,
-		TRequestResults(KErrNone, 0, KErrNone, KErrUnknown),
-		KErrUnknown,
-		TCallbackRecord::Empty()
-		);
-
-void CDmaBmFragmentation::Fragment()
-	{
-	TUint64 time;
-	iActual.iRequestResult.iFragmentationResult =
-		iDmaSession.FragmentRequestOld(iRequestSessionCookie, iTransferArgs, &time);
-	iResultArray.Append(time);
-	}
-
-void CDmaBmFragmentation::PrintTestType() const
-	{
-	RDebug::RawPrint(_L("Fragmentation Benchmark"));
-	}
-
-void CDmaBmFragmentation::RunTest()
-	{
-	OpenDmaSession();
-
-	OpenChannel();
-	CreateDmaRequest();
-	Fragment();
-	FreeRequest();
-	CloseChannel();
-	CloseDmaSession();
-	}
-
-//////////////////////////////////////////////////////////////////////
-//	CPauseResumeTest
-//
-//	-Time how long a given transfer takes
-//	-Pause the channel
-//	-repeat the transfer (queued asynchronously)
-//	-wait for some time (say, 3 times the time measured)
-//	-read the value of the TRequestStatus object, to check it is still pending
-//	-resume the channel
-//	-Wait on the request
-//	-Confirm that the request completed
-//////////////////////////////////////////////////////////////////////
-CPauseResumeTest::~CPauseResumeTest()
-	{
-	}
-
-void CPauseResumeTest::RunTest()
-	{
-	OpenDmaSession();
-
-	//Open a single DMA channel for a transfer
-	OpenChannel();
-
-	RDebug::Printf("Resume unpaused idle channel");
-	TInt r = iDmaSession.ChannelResume(iChannelSessionCookie);
-	TEST_ASSERT(KErrCompletion == r);
-
-	RDebug::Printf("Pause idle channel");
-	r = iDmaSession.ChannelPause(iChannelSessionCookie);
-	TEST_ASSERT(KErrNone == r);
-
-	RDebug::Printf("Pause paused idle Channel");
-	r = iDmaSession.ChannelPause(iChannelSessionCookie);
-	TEST_ASSERT(KErrCompletion == r);
-
-	RDebug::Printf("Resume paused idle channel");
-	r = iDmaSession.ChannelResume(iChannelSessionCookie);
-	TEST_ASSERT(KErrNone == r);
-
-	//Setup a DMA request and Fragment the request.
-	CreateDmaRequest();
-	Fragment();
-
-	//Queue the DMA request and time how long a transfer takes
-	TUint64 queueTime;
-	DoCalibrationTransfer(queueTime);
-
-	RDebug::Printf("Calibration transfer completed in %Lu us",queueTime);
-	TUint32 waitQueueReqTime = I64LOW(queueTime*3); //3 times the time measured in DoCalibrationTransfer
-	TEST_ASSERT(I64HIGH(queueTime*3) == 0); // If transfer takes over an hour, something has gone wrong anyway
-
-	// Initialise buffers, after calibration transfer
-	PreTransferSetup();
-
-	RDebug::Printf("Resume unpaused channel");
-	r = iDmaSession.ChannelResume(iChannelSessionCookie);
-	TEST_ASSERT(KErrCompletion == r);
-
-	//Pause DMA Transfer
-	RDebug::Printf("Pausing DMA Channel");
-	r = iDmaSession.ChannelPause(iChannelSessionCookie);
-	TEST_ASSERT(KErrNone == r);
-
-	RDebug::Printf("Pause paused Channel");
-	r = iDmaSession.ChannelPause(iChannelSessionCookie);
-	TEST_ASSERT(KErrCompletion == r);
-
-	//Repeat the transfer (queued asynchronously)
-	TRequestStatus queueRequestStatus;
-	iActual.iRequestResult.iQueueResult = QueueAsyncRequest(queueRequestStatus,queueTime);
-	RDebug::Printf("Queue a DMA Request and wait for %u us ", waitQueueReqTime);
-
-	User::After(waitQueueReqTime);
-	RDebug::Printf("Finished waiting");
-	TEST_ASSERT(queueRequestStatus.Int() == KRequestPending);
-
-	TBool queueEmpty = ETrue;
-	r = iDmaSession.ChannelIsQueueEmpty(iChannelSessionCookie,queueEmpty);
-	TEST_ASSERT(r == KErrNone);
-	TEST_ASSERT(!queueEmpty);
-
-	//Resume DMA channel
-	RDebug::Printf("Resuming paused DMA Channel");
-	r = iDmaSession.ChannelResume(iChannelSessionCookie);
-	TEST_ASSERT(KErrNone == r);
-
-	//Wait for transfer to complete
-	User::WaitForRequest(queueRequestStatus);
-	if (queueRequestStatus.Int() == KErrNone)
-		{
-		RDebug::Printf("DMA QueueAsyncRequest completed");
-		}
-
-	FreeRequest();
-	CloseChannel();
-
-	PostTransferCheck();
-	CloseDmaSession();
-	}
-
-/**
-Time how long transfer takes, with no pausing
-*/
-void CPauseResumeTest::DoCalibrationTransfer(TUint64 &atime)
-	{
-	//Queue the DMA request.
-	TCallbackRecord pCallbackRecord;
-	TInt r = iDmaSession.QueueRequest(iRequestSessionCookie,&pCallbackRecord,&atime);
-	TEST_ASSERT(r == KErrNone);
-	}
-
-TInt CPauseResumeTest::QueueAsyncRequest(TRequestStatus &aRequestState, TUint64 &atime)
-	{
-	return iDmaSession.QueueRequest(iRequestSessionCookie,aRequestState, &iActual.iCallbackRecord, &atime);
-	}
-
-void CPauseResumeTest::PrintTestType() const
-	{
-	RDebug::RawPrint(_L("Pause and Resume API Test"));
-	}
-
-//////////////////////////////////////////////////////////////////////
-//	CPauseResumeNegTest
-//
-//	-Open DMA Channel
-//	-Pause and Resume DMA channel
-//	-Check that KErrNotSupported is returned
-//	-Close DMA Channel
-//////////////////////////////////////////////////////////////////////
-CPauseResumeNegTest::~CPauseResumeNegTest()
-	{
-	}
-
-void CPauseResumeNegTest::RunTest()
-	{
-	OpenDmaSession();
-
-	//Open a single DMA channel for a transfer
-	OpenChannel();
-
-	RDebug::Printf("Resume unpaused idle channel");
-	TInt r = iDmaSession.ChannelResume(iChannelSessionCookie);
-	TEST_ASSERT(KErrNotSupported == r);
-
-	RDebug::Printf("Pause idle channel");
-	r = iDmaSession.ChannelPause(iChannelSessionCookie);
-	TEST_ASSERT(KErrNotSupported == r);
-
-	RDebug::Printf("Pause paused idle Channel");
-	r = iDmaSession.ChannelPause(iChannelSessionCookie);
-	TEST_ASSERT(KErrNotSupported == r);
-
-	RDebug::Printf("Resume paused idle channel");
-	r = iDmaSession.ChannelResume(iChannelSessionCookie);
-	TEST_ASSERT(KErrNotSupported == r);
-
-	CloseChannel();
-	CloseDmaSession();
-	}
-
-void CPauseResumeNegTest::PrintTestType() const
-	{
-	RDebug::RawPrint(_L("Pause and Resume API Test - Negative Test"));
-	}
-
-//////////////////////////////////////////////////////////////////////
-//	CLinkChannelTest
-//
-//	-Open DMA Channel
-//	-Link and Unlink DMA channel
-//	-Check that KErrNotSupported is returned
-//	-Close DMA Channel
-//
-//////////////////////////////////////////////////////////////////////
-CLinkChannelTest::~CLinkChannelTest()
-	{
-	}
-
-void CLinkChannelTest::RunTest()
-	{
-	OpenDmaSession();
-
-	//Open a single DMA channel for a transfer
-	OpenChannel();
-
-	RDebug::Printf("Linking DMA channels");
-	TInt r = iDmaSession.ChannelLinking(iChannelSessionCookie);
-	TEST_ASSERT(KErrNotSupported == r);
-
-	RDebug::Printf("Unlinking DMA channels");
-	r = iDmaSession.ChannelUnLinking(iChannelSessionCookie);
-	TEST_ASSERT(KErrNotSupported == r);
-
-	CloseChannel();
-	CloseDmaSession();
-	}
-
-void CLinkChannelTest::PrintTestType() const
-	{
-	RDebug::RawPrint(_L("Channel Linking API Test - Negative Test"));
-	}
-
-//////////////////////////////////////////////////////////////////////
-//	CElementCountingTest
-//
-//	-Open DMA Channel
-//	-Create Request
-//	-Fragment and Make calls to Element Counting APIs
-//  -Check that TotalNumDstElementsTransferred() and TotalNumSrcElementsTransferred()
-//	 return non zero values
-//  -Check that KErrNone(from test driver) returned for other API calls
-//	-Queue Request 
-//	-Close DMA Channel
-//////////////////////////////////////////////////////////////////////
-CElementCountingTest::~CElementCountingTest()
-	{
-	}
-
-void CElementCountingTest::RunTest()
-	{
-	OpenDmaSession();
-	PreTransferSetup();
-
-	//Open a single DMA channel for a transfer
-	OpenChannel();
-	
-	//Setup a DMA request and Fragment the request.
-	RDebug::Printf("Create and Fragment DMA Request");
-	CreateDmaRequest();
-	Fragment();
-
-	//Enable src/dst counting
-	RDebug::Printf("Enable DstElementCounting");
-	TInt r = iDmaSession.RequestEnableDstElementCounting(iRequestSessionCookie);
-	TEST_ASSERT(KErrNone == r);
-
-	RDebug::Printf("Enable SrcElementCounting");
-	r = iDmaSession.RequestEnableSrcElementCounting(iRequestSessionCookie);
-	TEST_ASSERT(KErrNone == r);
-
-	//Queue request
-	RDebug::Printf("Queue DMA Request");
-	Queue();
-
-	//Disable src/dst counting
-	RDebug::Printf("Disable DstElementCounting");
-	r = iDmaSession.RequestDisableDstElementCounting(iRequestSessionCookie);
-	TEST_ASSERT(KErrNone == r);
-
-	RDebug::Printf("Disable SrcElementCounting");
-	r = iDmaSession.RequestDisableSrcElementCounting(iRequestSessionCookie);
-	TEST_ASSERT(KErrNone == r);
-
-	//check total src/dst elements transferred
-	RDebug::Printf("Get Total Number of DstElementsTransferred");
-	r = iDmaSession.RequestTotalNumDstElementsTransferred(iRequestSessionCookie);
-	TEST_ASSERT(r >= 0);
-
-	RDebug::Printf("Get Total Number of SrcElementsTransferred");
-	r = iDmaSession.RequestTotalNumSrcElementsTransferred(iRequestSessionCookie);
-	TEST_ASSERT(r >= 0);
-
-	FreeRequest();
-	CloseChannel();
-
-	PostTransferCheck();
-	CloseDmaSession();
-	}
-
-void CElementCountingTest::PrintTestType() const
-	{
-	RDebug::RawPrint(_L("Element Counting Tests"));
-	}
-
-//////////////////////////////////////////////////////////////////////
-// COpenCloseTest
-//////////////////////////////////////////////////////////////////////
-COpenCloseTest::~COpenCloseTest()
-	{
-	}
-
-TBool COpenCloseTest::DoRunClose()
-	{
-	// For storing cookie during neagtive test i,e open channel twice
-	TUint testChannelSessionCookie = 0; 
-
-	// Open a single DMA channel
-	TInt r = iDmaSession.ChannelOpen(iChannelCookie, iChannelSessionCookie);
-	if (r == KErrNone)//Check that DMA channel opened with no errors
-		{
-		RDebug::Printf("DMA channel opened");					
-		}
-	else
-		{
-		RDebug::Printf("Open DMA channel failed");			
-		return EFalse;
-		}
-
-	// Open DMA channel again and check that opening DMA channel again fails		
-	r = iDmaSession.ChannelOpen(iChannelCookie, testChannelSessionCookie);
-	if (r == KErrInUse)
-		{
-		RDebug::Printf("Opening DMA channel again fails as expected");	
-		}
-	else
-		{
-		RDebug::Printf("Open DMA channel again failed");
-		return EFalse;
-		}
-
-	// Close the DMA channel and check that DMA channel closes with no errors
-	r =iDmaSession.ChannelClose(iChannelSessionCookie);	 
-	if (r == KErrNone) 
-		{
-		RDebug::Printf("DMA channel closes with no errors");				
-		}
-	else
-		{
-		RDebug::Printf("Close the DMA channel failed");
-		return EFalse;
-		}
-	
-	// Verify that the DMA channel was actually closed by opening DMA channel
-	r = iDmaSession.ChannelOpen(iChannelCookie, iChannelSessionCookie);
-	if (r == KErrNone)
-		{
-		RDebug::Printf("DMA channel opened after a previous close operation");
-		return ETrue;
-		}
-	else
-		{
-		RDebug::Printf("Open DMA channel to verify that the DMA channel closed failed");
-		return EFalse;
-		}	
-	}
-
-TBool COpenCloseTest::DoRunOpen()
-	{
-	// Open a single DMA channel
-	TInt r = iDmaSession.ChannelOpen(iChannelCookie, iChannelSessionCookie);
-	if (r == KErrNone)//Check that DMA channel opened with no errors
-		{			
-		RDebug::Printf("DoRunOpen:DMA channel opened");			
-		}
-	else
-		{
-		RDebug::Printf("DoRunOpenDMA channel failed to open");				
-		return EFalse;
-		}	
-
-	// Verify that channel is really open by closing DMA channel
-	// and checking that DMA channel closes with no errors
-	r = iDmaSession.ChannelClose(iChannelSessionCookie);
-	if (r == KErrNone)
-		{
-		RDebug::Printf("DoRunOpen:DMA channel closes with no errors");			
-		return ETrue;
-		}
-	else
-		{
-		RDebug::Printf("DoRunOpen:DMA channel failed to close");		
-		return EFalse;
-		}
-	}
-
-TBool COpenCloseTest::DoRunOpenExposed()
-	{
-	SCreateInfoTest TOpenInfo;
-	TOpenInfo.iCookie =iChannelCookie;
-	TOpenInfo.iDfcPriority = 3;
-	
-	const TInt desCount[3] = {0,1,128}; 
-	const TBool dynChannel[3] =	{EFalse,EFalse,ETrue};  
-	const TInt expectedResults[3] = {KErrArgument,KErrNone,KErrInUse};  
-	TInt actualResults[3] = {1, 1, 1};
-
-	for (TInt i =0; i<3; i++)
-		{	
-		TOpenInfo.iDesCount = desCount[i];
-		TOpenInfo.iDynChannel = dynChannel[i];		
-
-		// Open a single DMA channel
-		RDebug::Printf("DoRunOpenExposed:Trying to open DMA channel using iDesCount(%d) and iDynChannel(%d)  ", TOpenInfo.iDesCount,TOpenInfo.iDynChannel);
-		actualResults[i] = iDmaSession.ChannelOpen(iChannelSessionCookie, TOpenInfo);
-		if (actualResults[i] == KErrNone)// Verify that channel is really open by closing DMA channel	
-			{
-			TInt err = iDmaSession.ChannelClose(iChannelSessionCookie);
-			TEST_ASSERT(err == KErrNone)//Check that DMA channel closed with no errors
-			}
-		}
-
-	// This case should fail if idesCount  =  0.
-	// PIL has been changed to return KErrArgument instead of using an assertion check
-	if (expectedResults[0] == actualResults[0])
-		{
-		RDebug::Printf("DoRunOpenExposed:DMA channel failed to open as expected as for iDesCount = 0 ");			
-		}
-	else
-		{
-		RDebug::Printf("DoRunOpenExposed:Error code returned (%d), expected KErrArgument as iDesCount= 0) ", actualResults[0]);	
-		return EFalse;
-		}
-
-	// For this case( idesCount  =  1), DMA channel should open with no issues	
-	if (expectedResults[1] == actualResults[1])
-		{		
-		RDebug::Printf("DoRunOpenExposed:DMA channel closes with no errors as expected for iDesCount = 1 ");
-		}
-	else
-		{
-		RDebug::Printf("DoRunOpenExposed:Failed to open DMA channel with error code (%d)", actualResults[1]);	
-		return EFalse;
-		}
-
-	// For this case(dynaChannel=ETrue), DMA channel now returns KErrInUse. dynaChannel is not supported in the PSL.
-	// PSL now returns a NULL pointer when dynaChannel is requested. The PIL interprets a NULL 
-	// pointer being returned from opening a DMA channel as a channel in use. Hence, KErrInUse is returned.
-	if (expectedResults[2] == actualResults[2])
-		{
-		RDebug::Printf("DoRunOpenExposed:DMA channel failed to open as expected as dynamic channel is not supported");		
-		}
-	else
-		{
-		RDebug::Printf("DoRunOpenExposed:Error code returned (%d), expected KErrInUse as as dynamic channel is not supported", actualResults[2]);			
-		return EFalse;
-		}
-
-	return ETrue;
-	}
-
-void COpenCloseTest::RunTest()
-	{
-	OpenDmaSession(); 
-
-	if (iRunOpen) 
-	{	// Run Open() API test
-		iOpenCloseResult = DoRunOpenExposed();
-		if(iOpenCloseResult)
-			iOpenCloseResult = DoRunOpen();
-	}
-	else
-	{
-		// Run Close() API test	
-		iOpenCloseResult = DoRunClose();
-	}
-
-	CloseDmaSession();
-	}
-
-void COpenCloseTest::PrintTestType() const
-	{
-	RDebug::RawPrint(_L("Close/Open API Test"));
-
-	}
-
-TBool COpenCloseTest::Result()
-	{
-	if(gVerboseOutput)
-		{
-		RDebug::Printf("Results for Close/Open API Test");
-		}
-
-	if(!iOpenCloseResult)
-		{
-		RDebug::Printf("Open/Close test sequence failed"); 
-		}
-			
-	return iOpenCloseResult;
-	}
-//////////////////////////////////////////////////////////////////////
-// CDmaBmTransfer
-//////////////////////////////////////////////////////////////////////
-CDmaBmTransfer::CDmaBmTransfer(const TDesC& aName, TInt aIterations, const TDmaTransferArgs& aTransferArgs, TUint aMaxFragmentSize)
-	:CDmaBenchmark(aName, aIterations,
-		TResultSet(KErrNone, TRequestResults(),	KErrUnknown, TCallbackRecord(TCallbackRecord::EThread,1)),
-		aTransferArgs, aMaxFragmentSize)
-	{}
-
-void CDmaBmTransfer::PrintTestType() const
-	{
-	RDebug::RawPrint(_L("Transfer Benchmark"));
-	}
-
-void CDmaBmTransfer::RunTest()
-	{
-	OpenDmaSession();
-
-	OpenChannel();
-	CreateDmaRequest();
-	Fragment();
-	Queue();
-	FreeRequest();
-	CloseChannel();
-
-	CloseDmaSession();
-	}
-
-void CDmaBmTransfer::Queue()
-	{
-	if(iActual.iRequestResult.iFragmentationResult == KErrNone)
-		{
-		TUint64 time;
-		iActual.iRequestResult.iQueueResult = iDmaSession.QueueRequest(iRequestSessionCookie, &iActual.iCallbackRecord, &time);
-		iResultArray.Append(time);
-		}
-	}
-
-/*
-1.	Open a DMA channel for a transfer.
-2.	Queue multiple request on the DMA channel.
-3.	Call CancelAll () on the DMA channel.
-4.	Verify that all transfers have been cancelled.
-5.	Open a DMA channel for a transfer. This channel should support pause and resume.
-6.	Call Pause () on the channel.
-7.	Queue multiple request on the DMA channel.
-8.	Call CancelAll () on the channel.
-9.	Verify that all transfers have been cancelled.
-
-   Note: This check does not add results to TResultSet like some
-   other tests as its operation is different. The test checks for 
-   the the cancelllation of all transfers queued on a channel by
-   calling iDmaSession.ChannelIsQueueEmpty(); 
-*/
-
-//////////////////////////////////////////////////////////////////////
-// CCancelAllTest
-//////////////////////////////////////////////////////////////////////
-
-
-CCancelAllTest::CCancelAllTest(const TDesC& aName, TInt aIterations,
-		const TDmaTransferArgs* aTransferArgs, const TResultSet* aResultSets,
-		TInt aCount)
-	:CMultiTransferTest(aName, aIterations, aTransferArgs, aResultSets, aCount)
-	{}
-
-void CCancelAllTest::RunTest()
-	{
-	OpenDmaSession();
-	PreTransferSetup();
-
-	// Open a DMA channel for a transfer.This channel should support pause and resume.
-	OpenChannel();
-
-	//Call Pause () on the channel
-	RDebug::Printf("Pausing DMA Channel");
-	ChannelPause(iChannelSessionCookie);
-	
-	// Queue multiple request on the DMA channel.
-	CreateDmaRequests();
-	Fragment();
-
-	QueueRequestsAsync();
-
-	// Call CancelAll () on the DMA channel and Verify that all transfers have been cancelled.
-	TInt r = CancelAllRequests();
-	TEST_ASSERT(r == KErrNone);
-
-	//Call Resume () on the channel.
-	RDebug::Printf("Cancel should clear Pause state: resuming channel should fail");
-	ChannelResume(iChannelSessionCookie);		
-	//TEST_ASSERT(r == KErrCompletion);
-
-	r = DoPostTransferCheck();
-	TEST_ASSERT(r == KErrNone);
-	//Destroy request
-    for(TInt i=0; i<2; i++)
-		{
-		r = iDmaSession.RequestDestroy(iRequestCookies[i]);
-		TEST_ASSERT(r == KErrNone);
-		}
-
-	//Close DMA channel
-	CloseChannel();
-
-	CloseDmaSession();
-	}
-
-TInt CCancelAllTest::CancelAllRequests()
-	{
-	if(gVerboseOutput)
-		{
-		RDebug::Printf("CCancelAllTest::CancelAllRequests()");
-		}
-	TInt r = KErrGeneral;
-	r  = iDmaSession.ChannelCancelAll(iChannelSessionCookie);
-	if (r != KErrNone)
-		return r;
-
-	TBool queueEmpty;
-	r = iDmaSession.ChannelIsQueueEmpty(iChannelSessionCookie,queueEmpty);
-	if (r != KErrNone)
-		return r;
-
-	if(!queueEmpty)
-		return KErrGeneral;
-
-	if(gVerboseOutput)
-		{
-		RDebug::Printf("Both current and pending requests cancelled");
-		}
-	return KErrNone;
-	}
-
-void CCancelAllTest::PrintTestType() const
-	{
-	RDebug::RawPrint(_L("CCancelAllTest"));
-	}
-
-void CCancelAllTest::QueueRequestsAsync()
-	{
-	if(iPauseWhileQueuing)
-		{
-		TInt r = iDmaSession.ChannelPause(iChannelSessionCookie);
-		TEST_ASSERT(r == KErrNone);
-		}
-
-	// Queue all the DMA requests asynchronously
-	TEST_ASSERT(iActualResults.Count() == iTransferArgsCount);
-	for(TInt i=0; i<iTransferArgsCount; i++)
-		{
-		TResultSet& resultSet = iActualResults[i];
-		if(resultSet.iRequestResult.iFragmentationResult != KErrNone)
-			continue;
-
-		TInt r = iDmaSession.QueueRequest(iRequestCookies[i], iDummyRequestStatus, &resultSet.iCallbackRecord, NULL);
-		resultSet.iRequestResult.iQueueResult = r;
-		}
-
-	if(iPauseWhileQueuing)
-		{
-		TInt r = iDmaSession.ChannelResume(iChannelSessionCookie);
-		TEST_ASSERT(r == KErrNone);
-		}
-	}
-
-//////////////////////////////////////////////////////////////////////
-// CIsQueueEmptyTest
-//////////////////////////////////////////////////////////////////////
-CIsQueueEmptyTest::CIsQueueEmptyTest(const TDesC& aName, TInt aIterations, const TDmaTransferArgs* aTransferArgs,
-		const TResultSet* aResultSets, TInt aCount)
-	:CMultiTransferTest(aName, aIterations, aTransferArgs, aResultSets, aCount)
-	{}
-
-CIsQueueEmptyTest::CIsQueueEmptyTest(const CIsQueueEmptyTest& aOther)
-	:CMultiTransferTest(aOther)
-	{}
-
-CIsQueueEmptyTest::~CIsQueueEmptyTest()
-	{
-	}
-
-void CIsQueueEmptyTest::RunTest()
-	{
-	OpenDmaSession();
-	PreTransferSetup();
-	
-	OpenChannel();
-
-	CreateDmaRequests();
-	Fragment();
-	QueueRequests();
-
-	TInt r = DoPostTransferCheck();
-	TEST_ASSERT(r == KErrNone);
-
-	CloseDmaSession();
-	}
-
-void CIsQueueEmptyTest::DoIsQueueEmpty()
-	{
-	TBool queueEmpty;
-	TInt r = iDmaSession.ChannelIsQueueEmpty(iChannelSessionCookie,queueEmpty);
-	TEST_ASSERT(r == KErrNone);
-
-	if(queueEmpty)
-		{
-		RDebug::Printf("Verified that calling IsQueueEmpty() returns ETrue before calling Queue()");
-		}
-	else
-		{
-		RDebug::Printf("IsQueueEmpty() fails to return ETrue before calling Queue()");
-		TEST_ASSERT(queueEmpty);	
-		}
-	}
-
-void CIsQueueEmptyTest::DoQueueNotEmpty()
-	{
-	TBool queueEmpty;
-	TInt r = iDmaSession.ChannelIsQueueEmpty(iChannelSessionCookie,queueEmpty);
-	TEST_ASSERT(r == KErrNone);
-
-	if (!queueEmpty)
-		{
-		RDebug::Printf("Verified that calling IsQueueEmpty() returns EFalse after calling Queue()");
-		}
-	else
-		{
-		RDebug::Printf("IsQueueEmpty() fails to return EFalse after calling Queue()");
-		TEST_ASSERT(!queueEmpty);
-		}
-	}
-
-void CIsQueueEmptyTest::PrintTestType() const
-	{
-	RDebug::RawPrint(_L("IsQueue Empty Test using Multi Transfer"));
-	}
-
-void CIsQueueEmptyTest::QueueRequests()
-	{
-	// Queue all the DMA requests asynchronously
-	TInt i;
-	RArray<TRequestStatus> requestStates;
-	
-	ChannelPause(iChannelSessionCookie);
-	DoIsQueueEmpty();
-
-	TEST_ASSERT(iActualResults.Count() == iTransferArgsCount);
-	for(i=0; i<iTransferArgsCount; i++)
-		{
-		TResultSet& resultSet = iActualResults[i];
-		if(resultSet.iRequestResult.iFragmentationResult != KErrNone)
-			continue;
-
-		TInt r = requestStates.Append(TRequestStatus());
-		TEST_ASSERT(r == KErrNone);
-
-		r = iDmaSession.QueueRequest(iRequestCookies[i], requestStates[i], &resultSet.iCallbackRecord, NULL);
-		resultSet.iRequestResult.iQueueResult = r;
-
-		DoQueueNotEmpty();
-		}
-	
-	ChannelResume(iChannelSessionCookie);
-
-	// wait for all transfers to complete
-	const TInt count = requestStates.Count();
-
-	for(i=0; i<count; i++)
-		{
-		User::WaitForRequest(requestStates[i]);
-		}
-
-	requestStates.Close();
-	}
-
-//////////////////////////////////////////////////////////////////////
-// CMultiTransferTest
-//////////////////////////////////////////////////////////////////////
-CMultiTransferTest::CMultiTransferTest(const TDesC& aName, TInt aIterations, const TDmaTransferArgs* aTransferArgs,
-		const TResultSet* aResultSets, TInt aCount)
-	: CDmaTest(aName, aIterations, NULL, NULL), iTransferArgs(aTransferArgs), iTransferArgsCount(aCount), iNewDmaApi(ETrue),
-	iChannelSessionCookie(0), iExpectedArray(aResultSets), iPauseWhileQueuing(EFalse)
-	{}
-
-CMultiTransferTest::CMultiTransferTest(const CMultiTransferTest& aOther)
-	: CDmaTest(aOther), iTransferArgs(aOther.iTransferArgs), iTransferArgsCount(aOther.iTransferArgsCount),
-	iNewDmaApi(aOther.iNewDmaApi),
-	iExpectedArray(aOther.iExpectedArray), iPauseWhileQueuing(aOther.iPauseWhileQueuing)
-	{
-	CopyL(aOther.iRequestCookies, iRequestCookies);
-	}
-
-CMultiTransferTest::~CMultiTransferTest()
-	{
-	iRequestCookies.Close();
-	iActualResults.Close();
-	}
-
-TBool CMultiTransferTest::Result()
-	{
-	if(gVerboseOutput)
-		{
-		RDebug::Printf("Results for %d transfers:", iTransferArgsCount);
-		}
-
-	TBool result = EFalse;
-	for(TInt i=0; i<iTransferArgsCount; i++)
-		{
-		result = Result(i);
-		if(!result)
-			break;
-		}
-	return result;
-	}
-
-TBool CMultiTransferTest::Result(TInt aTransfer)
-	{
-	const TResultSet& expected = iExpectedArray[aTransfer];
-	const TResultSet& actual = iActualResults[aTransfer];
-	const TBool result = expected == actual;
-	if(!result || gVerboseOutput)
-		{
-		RDebug::Printf("Compairing results for transfer %d", aTransfer);
-		}
-
-	if(!result)
-		{
-		RDebug::Printf("TResultSets do not match");
-		}
-	if(!result || gVerboseOutput)
-		{
-		RDebug::Printf("\nExpected error codes:");
-		expected.Print();
-		RDebug::Printf("Expected callback record:");
-		expected.iCallbackRecord.Print();
-
-		RDebug::Printf("\nActual error codes:");
-		actual.Print();
-		RDebug::Printf("Actual callback record:");
-		actual.iCallbackRecord.Print();
-		}
-	return result;
-	}
-void CMultiTransferTest::RunTest()
-	{
-	OpenDmaSession();
-
-	PreTransferSetup();
-	OpenChannel();
-
-	CreateDmaRequests();
-	Fragment();
-
-	QueueRequests();
-
-	TInt r = DoPostTransferCheck();
-	TEST_ASSERT(r == KErrNone);
-
-	CloseDmaSession();
-	}
-
-void CMultiTransferTest::PrintTestType() const
-	{
-	RDebug::RawPrint(_L("Multi Transfer"));
-	}
-
-const TDmaTransferArgs& CMultiTransferTest::TransferArgs(TInt aIndex) const
-	{
-	TEST_ASSERT(Rng(0, aIndex, iTransferArgsCount-1));
-
-	return iTransferArgs[aIndex];
-	}
-
-void CMultiTransferTest::SetPostTransferResult(TInt aIndex, TInt aErrorCode)
-	{
-	TEST_ASSERT(Rng(0, aIndex, iTransferArgsCount-1));
-
-	iActualResults[aIndex].iPostTransferCheck = aErrorCode;
-	}
-
-void CMultiTransferTest::OpenChannel()
-	{
-	if(gVerboseOutput)
-		{
-		RDebug::Printf("CMultiTransferTest::OpenChannel()");
-		}
-	TInt r = iDmaSession.ChannelOpen(iChannelCookie, iChannelSessionCookie);
-
-	TEST_ASSERT(iActualResults.Count() == iTransferArgsCount);
-	for(TInt i=0; i<iTransferArgsCount; i++)
-		{
-		// In a multi transfer test a series of requests are created and queued.
-		// They all use the same channel, is opened here at the beginning of the test
-		//
-		// Each transfer has a TResultSet which holds a result for the channel opening,
-		// which we store here. Although in this case it is redundant,
-		// in future it might be that different transfers open
-		// different channels.
-		iActualResults[i].iChannelOpenResult = r;
-		}
-	}
-
-TInt CMultiTransferTest::CloseChannel()
-	{
-	return iDmaSession.ChannelClose(iChannelSessionCookie);
-	}
-
-void CMultiTransferTest::CreateDmaRequests()
-	{
-	if(gVerboseOutput)
-		{
-		RDebug::Printf("CMultiTransferTest::CreateDmaRequests() %d", iTransferArgsCount);
-		}
-	TEST_ASSERT(iActualResults.Count() == iTransferArgsCount);
-	//create a DMA request for each transfer arg struct
-	for(TInt i=0; i<iTransferArgsCount; i++)
-		{
-		if(iActualResults[i].iChannelOpenResult != KErrNone)
-			continue;
-
-		TUint cookie = 0;
-		TInt r = KErrGeneral;
-
-		if(iNewDmaApi)
-			{
-			r = iDmaSession.RequestCreate(iChannelSessionCookie, cookie);
-			}
-		else
-			{
-			r = iDmaSession.RequestCreateOld(iChannelSessionCookie, cookie);
-			}
-		iActualResults[i].iRequestResult.iCreate = r;
-
-		if(r == KErrNone)
-			{
-			r = iRequestCookies.Append(cookie);
-			TEST_ASSERT(r == KErrNone);
-			}
-		}
-	}
-
-void CMultiTransferTest::Fragment()
-	{
-	if(gVerboseOutput)
-		{
-		RDebug::Printf("CMultiTransferTest::Fragment() %d", iTransferArgsCount);
-		}
-	TEST_ASSERT(iActualResults.Count() == iTransferArgsCount);
-	// Fragment each dma request
-	for(TInt i=0; i<iTransferArgsCount; i++)
-		{
-		TRequestResults& result = iActualResults[i].iRequestResult;
-		if(result.iCreate != KErrNone)
-			continue;
-
-		TInt r = KErrGeneral;
-		if(iNewDmaApi)
-			r = iDmaSession.FragmentRequest(iRequestCookies[i], iTransferArgs[i]);
-		else
-			r = iDmaSession.FragmentRequestOld(iRequestCookies[i], iTransferArgs[i]);
-
-		result.iFragmentationResult = r;
-		}
-	}
-
-void CMultiTransferTest::QueueRequests()
-	{
-	if(iPauseWhileQueuing)
-		{
-		TInt r = iDmaSession.ChannelPause(iChannelSessionCookie);
-		TEST_ASSERT(r == KErrNone);
-		}
-
-	// Queue all the DMA requests asynchronously
-	TInt i;
-	RArray<TRequestStatus> requestStates;
-
-	TEST_ASSERT(iActualResults.Count() == iTransferArgsCount);
-	for(i=0; i<iTransferArgsCount; i++)
-		{
-		TResultSet& resultSet = iActualResults[i];
-		if(resultSet.iRequestResult.iFragmentationResult != KErrNone)
-			continue;
-
-		TInt r = requestStates.Append(TRequestStatus());
-		TEST_ASSERT(r == KErrNone);
-
-		r = iDmaSession.QueueRequest(iRequestCookies[i], requestStates[i], &resultSet.iCallbackRecord, NULL);
-		resultSet.iRequestResult.iQueueResult = r;
-		}
-
-	if(iPauseWhileQueuing)
-		{
-		TInt r = iDmaSession.ChannelResume(iChannelSessionCookie);
-		TEST_ASSERT(r == KErrNone);
-		}
-
-	// wait for all transfers to complete
-	const TInt count = requestStates.Count();
-
-	for(i=0; i<count; i++)
-		{
-		User::WaitForRequest(requestStates[i]);
-		}
-
-	requestStates.Close();
-	}
-
-void CMultiTransferTest::PreTransferSetup()
-	{
-	// TODO this is the wrong place to do this!
-	for(TInt i=0; i<iTransferArgsCount; i++)
-		{
-		//pre-fill actual results with error values
-		TInt r = iActualResults.Append(TResultSet(EFalse));
-		TEST_ASSERT(r == KErrNone);
-		}
-	if(iPreTransfer)
-		iPreTransfer->Setup(*this); //initialize test
-	}
-
-TInt CMultiTransferTest::DoPostTransferCheck()
-	{
-	if(iPostTransferCheck)
-		return iPostTransferCheck->Check(*this);
-	else
-		return KErrNone;
-	}
-//////////////////////////////////////////////////////////////////////
-// CIsrRequeTest
-//////////////////////////////////////////////////////////////////////
-CIsrRequeTest::CIsrRequeTest(const TDesC& aName, TInt aIterations, const TDmaTransferArgs& aArgs,
-			TIsrRequeArgs* aRequeueArgs, TInt aCount,
-			const TResultSet& aExpected,const MPreTransfer* aPreTfer,const MPostTransferCheck* aPostTferChk, TUint aMaxFragmentSize)
-	:CSingleTransferTest(aName, aIterations, aArgs, aExpected, aMaxFragmentSize, aPostTferChk, aPreTfer), iRequeArgSet(aRequeueArgs, aCount)
-	{}
-
-void CIsrRequeTest::Queue()
-	{
-	if(iActual.iRequestResult.iFragmentationResult == KErrNone)
-		{
-		iActual.iRequestResult.iQueueResult = iDmaSession.QueueRequestWithRequeue(iRequestSessionCookie, iRequeArgSet.iRequeArgs, iRequeArgSet.iCount, &iActual.iCallbackRecord);
-		}
-	}
-
-void CIsrRequeTest::PrintTestType() const
-	{
-	RDebug::RawPrint(_L("ISR Requeue"));
-	}
-
-void CIsrRequeTest::PreTransferSetup()
-	{
-	if(iPreTransfer)
-		iPreTransfer->Setup(*this); //initialize test
-	}
-
-TInt CIsrRequeTest::DoPostTransferCheck()
-	{
-	return iPostTransferCheck->Check(*this);
-	}
-
-//////////////////////////////////////////////////////////////////////
-// TResultSet
-//////////////////////////////////////////////////////////////////////
-void TResultSet::Print() const
-	{
-	PRINT(iChannelOpenResult);
-	PRINT(iRequestResult.iCreate);
-	PRINT(iRequestResult.iFragmentCount);
-	PRINT(iRequestResult.iFragmentationResult);
-	PRINT(iRequestResult.iQueueResult);
-	PRINT(iPostTransferCheck);
-	}
-
-TBool TResultSet::operator == (const TResultSet& aOther) const
-	{
-	return (memcompare((TUint8*)this, sizeof(*this), (TUint8*)&aOther, sizeof(aOther)) == 0);
-	}
-
-//////////////////////////////////////////////////////////////////////
-// MPostTransferCheck classes
-//////////////////////////////////////////////////////////////////////
-TInt TCompareSrcDst::Check(const CSingleTransferTest& aTest) const
-	{
-	if(gVerboseOutput)
-		{
-		RDebug::Printf("Comparing CSingleTransferTest buffers");
-		}
-	return Check(aTest.TransferArgs(), aTest.Chunk().Base());
-	}
-
-// Note: this check will not deal correctly with transfers were subsequent
-// requeues overlap previous sources or destinations
-// or where the source of transfer depends on a previous transfer.
-// This is because it simply compares the source and destination
-// pairwise for each transfer
-//
-// If TPreTransferIncrBytes is used for the pre-test then the transfers
-// will be checked however.
-TInt TCompareSrcDst::Check(const CIsrRequeTest& aTest) const
-	{
-	if(gVerboseOutput)
-		{
-		RDebug::Printf("Comparing CIsrRequeTest buffers");
-		}
-	TUint8* chunkBase = aTest.Chunk().Base();
-	const TDmaTransferArgs& transferArgs = aTest.TransferArgs();
-	// check first transfer
-	TInt r = Check(transferArgs, chunkBase);
-
-	if(r != KErrNone)
-		return r;
-
-	// check re-queued transfers
-	const TIsrRequeArgsSet& requeueArgs = aTest.GetRequeueArgs();
-	return Check(requeueArgs, chunkBase, transferArgs);
-	}
-
-TInt TCompareSrcDst::Check(const TDmaTransferArgs& aTransferArgs, TUint8* aChunkBase) const
-	{	
-	const TUint32 srcOffset = aTransferArgs.iSrcConfig.iAddr;
-	const TUint32 dstOffset = aTransferArgs.iDstConfig.iAddr;
-	const TInt size = aTransferArgs.iTransferCount;
-
-	const TUint8* src = srcOffset + aChunkBase;
-	const TUint8* dst = dstOffset + aChunkBase;
-
-	if(gVerboseOutput)
-		{
-		RDebug::Printf("Comparing TDmaTransferArgs buffers src=0x%08x dst=0x%08x size=0x%08x",
-				src, dst, size);
-		}
-
-	return memcompare(src, size, dst, size);
-	}
-
-TInt TCompareSrcDst::Check(const TIsrRequeArgsSet& aRequeueArgSet, TUint8* aChunkBase, const TDmaTransferArgs& aTferArgs) const
-	{
-	TIsrRequeArgsSet argSet(aRequeueArgSet); //copy since Fixup will mutate object
-
-	argSet.Substitute(aTferArgs); // replace any default (0) values with the values in aTferArgs
-
-	argSet.Fixup((TLinAddr)aChunkBase); //convert address offsets to virtual user mode addresses
-
-	TInt r = KErrCorrupt;
-	while(!argSet.IsEmpty())
-		{
-		r = Check(argSet.GetArgs());
-		if(r != KErrNone)
-			break;
-		}
-	return r;
-	}
-
-TInt TCompareSrcDst::Check(const TIsrRequeArgs& aRequeueArgs) const
-	{
-	const TUint8* src = (TUint8*)aRequeueArgs.iSrcAddr;
-	const TUint8* dst = (TUint8*)aRequeueArgs.iDstAddr;
-	const TInt size = aRequeueArgs.iTransferCount;
-
-	if(gVerboseOutput)
-		{
-		RDebug::Printf("Comparing TIsrRequeArgs: src=0x%08x dst=0x%08x size=0x%08x",
-				src, dst, size);
-		}
-
-	return memcompare(src, size, dst, size);
-	}
-
-// Note: this check will not deal correctly with transfers were subsequent
-// requeues overlap previous sources or destinations
-// or where the source of trasnfer depends on a previous trasnfer.
-// This is because it simply compares the source and destination
-// pairwise for each transfer
-//
-// If TCompareSrcDst is used for the pre-test then the transfers
-// will be checked however.
-TInt TCompareSrcDst::Check(CMultiTransferTest& aTest) const
-	{
-	if(gVerboseOutput)
-		{
-		RDebug::Printf("Comparing CMultiTransferTest buffers");
-		}
-
-	const TInt transferCount = aTest.TransferCount();
-	TUint8* const chunkBase = aTest.Chunk().Base();
-
-	// check buffers for each transfer
-	for(TInt i=0; i<transferCount; i++)
-		{
-		TInt r = Check(aTest.TransferArgs(i), chunkBase);
-		aTest.SetPostTransferResult(i, r);
-		}
-	// CMultiTransferTest is handled differently to the others.
-	// Whereas CSingleTransferTest logs just the return value
-	// of the check, here, we write back a result for each transfer
-	// so the return value from this function is not important
-	return KErrNone;
-	}
-
-TInt TCompare2D::Check(const CSingleTransferTest& aTest) const
-	{
-	const TDmaTransferArgs& args = aTest.TransferArgs();
-	TUint8* const chunkBase = aTest.Chunk().Base();
-
-	TInt ret = KErrNone;
-
-	TTransferIter src_iter(args.iSrcConfig, chunkBase);
-	TTransferIter dst_iter(args.iDstConfig, chunkBase);
-	TTransferIter end;
-	for (; (src_iter != end) && (dst_iter !=end); ++src_iter, ++dst_iter)
-		{
-		if(*src_iter != *dst_iter)
-			{
-			ret = KErrCorrupt;
-			break;
-			}
-		}
-	return ret;
-	}
-
-TInt TCompare2D::Check(const CIsrRequeTest&) const
-	{
-	return KErrNotSupported;
-	}
-
-TInt TCompare2D::Check(CMultiTransferTest&) const
-	{
-	return KErrNotSupported;
-	}
-
-
-TInt TCheckNoTransfer::Check(const CSingleTransferTest&) const
-	{
-	return KErrNotSupported;
-	}
-
-TInt TCheckNoTransfer::Check(const CIsrRequeTest&) const
-	{
-	return KErrNotSupported;
-	}
-
-TInt TCheckNoTransfer::Check(CMultiTransferTest& aTest) const
-	{
-	if(gVerboseOutput)
-		{
-		RDebug::Printf("TCheckNoTransfer Comparing CMultiTransferTest buffers");
-		}
-
-	const TInt transferCount = aTest.TransferCount();
-	TUint8* const chunkBase = aTest.Chunk().Base();
-
-	// check buffers for each transfer
-	for(TInt i=0; i<transferCount; i++)
-		{
-		TInt r = KErrCorrupt;
-		if(IsZeroed(aTest.TransferArgs(i), chunkBase))
-			{
-			r = KErrNone;
-			}
-
-		aTest.SetPostTransferResult(i, r);
-		}
-	// CMultiTransferTest is handled differently to the others.
-	// Whereas CSingleTransferTest logs just the return value
-	// of the check, here, we write back a result for each transfer
-	// so the return value from this function is not important
-	return KErrNone;
-	}
-
-TBool TCheckNoTransfer::IsZeroed(const TDmaTransferArgs& aTransferArgs, TUint8* aChunkBase) const
-	{
-	TAddressParms parms = GetAddrParms(aTransferArgs);
-	parms.Fixup(reinterpret_cast<TLinAddr>(aChunkBase));
-	const TAddrRange destination = parms.DestRange();
-
-	return destination.IsFilled(0);
-	}
-//////////////////////////////////////////////////////////////////////
-// MPreTransfer classes
-//////////////////////////////////////////////////////////////////////
-void TPreTransferIncrBytes::Setup(const CSingleTransferTest& aTest) const
-	{
-	if(gVerboseOutput)
-		{
-		RDebug::Printf("TPreTransferIncrBytes(CSingleTransferTest)");
-		}
-	TAddressParms params = GetAddrParms(aTest.TransferArgs());
-
-	TUint8* const chunkBase = aTest.Chunk().Base();
-	params.Fixup((TLinAddr)chunkBase);
-
-
-	Setup(params);
-	}
-
-void TPreTransferIncrBytes::Setup(const TAddressParms& aParams) const
-	{
-	if(gVerboseOutput)
-		{
-		RDebug::Printf("TPreTransferIncrBytes: setup memory buffers: src=0x%08x dst=0x%08x size=0x%08x",
-				aParams.iSrcAddr, aParams.iDstAddr, aParams.iTransferCount);
-		}
-	TUint8* const src = (TUint8*) aParams.iSrcAddr;
-	const TInt size = aParams.iTransferCount;
-
-	for(TInt i=0; i<size; i++)
-		{src[i] = (TUint8)i;} //each src byte holds its own offset (mod 256)
-
-	TUint8* const dst = (TUint8*) aParams.iDstAddr;
-	memclr(dst, size); //clear destination
-	}
-
-void TPreTransferIncrBytes::Setup(const CIsrRequeTest& aTest) const
-	{
-	if(gVerboseOutput)
-		{
-		RDebug::Printf("TPreTransferIncrBytes(CIsrRequeTest)");
-		}
-	if(!CheckBuffers(aTest))
-		{
-		RDebug::Printf("Successive transfer destinations may not overlap previous src or dst buffers");
-		RDebug::Printf("unless the whole transfer is an exact repeat of a previous one");
-		TEST_FAULT;
-		}
-
-	Setup(static_cast<CSingleTransferTest>(aTest)); // prepare the CSingleTransferTest parts
-
-	TIsrRequeArgsSet requeSet(aTest.GetRequeueArgs());
-
-	requeSet.Substitute(aTest.TransferArgs());
-
-	const TLinAddr chunkBase = (TLinAddr) aTest.Chunk().Base();
-	requeSet.Fixup(chunkBase);
-
-	while(!requeSet.IsEmpty())
-		{
-		TIsrRequeArgs args = requeSet.GetArgs();
-		Setup(args); // perform the setup operation for each TIsrRequeArgs
-		}
-	}
-
-void TPreTransferIncrBytes::Setup(const CMultiTransferTest& aTest) const
-	{
-	if(gVerboseOutput)
-		{
-		RDebug::Printf("TPreTransferIncrBytes(CMultiTransferTest)");
-		}
-
-	if(!CheckBuffers(aTest))
-		{
-		RDebug::Printf("Successive transfer destinations may not overlap previous src or dst buffers");
-		TEST_FAULT;
-		}
-
-	TUint8* const chunkBase = aTest.Chunk().Base();
-	const TInt transferCount = aTest.TransferCount();
-
-	// initialise buffers for each transfer
-	for(TInt i=0; i<transferCount; i++)
-		{
-		TAddressParms params = GetAddrParms(aTest.TransferArgs(i));
-
-		params.Fixup((TLinAddr)chunkBase);
-
-		Setup(params);
-		}
-	}
-
-TBool TPreTransferIncrBytes::CheckBuffers(const CIsrRequeTest& aTest) const
-	{
-	RArray<const TAddressParms> array;
-	array.AppendL(TAddressParms(aTest.TransferArgs()));
-
-	TIsrRequeArgsSet requeSet(aTest.GetRequeueArgs());
-	requeSet.Substitute(aTest.TransferArgs());
-
-	const TLinAddr chunkBase = (TLinAddr) aTest.Chunk().Base();
-	requeSet.Fixup(chunkBase);
-	while(!requeSet.IsEmpty())
-		{
-		const TIsrRequeArgs requeArgs = requeSet.GetArgs();
-		array.AppendL(requeArgs);
-		}
-
-	const TBool result = CheckBuffers(array);
-
-	array.Close();
-	return result;
-	}
-
-/**
-A CMultiTransferTest will wait for all transfers to complete
-before comapairing source and destination buffers. For this to be successful
-each transfer must be independent ie. no destination or source may be
-overwritten by another transfer and source buffers may not depend on an
-earlier transfer
-*/
-TBool TPreTransferIncrBytes::CheckBuffers(const CMultiTransferTest& aTest) const
-	{
-	TUint8* const chunkBase = aTest.Chunk().Base();
-	const TInt transferCount = aTest.TransferCount();
-
-	// assemble an array of TAddressParams from aTest, that
-	// can then be passed to CheckBuffers(RArray<TAddressParms>)
-	RArray<const TAddressParms> array;
-
-	for(TInt i=0; i<transferCount; i++)
-		{
-		TAddressParms params = GetAddrParms(aTest.TransferArgs(i));
-		params.Fixup((TLinAddr)chunkBase);
-
-		array.AppendL(params);
-		}
-
-	 // 2nd arg EFalse as there is no need to permit exact repeats
-	const TBool r = CheckBuffers(array, EFalse);
-
-	array.Close();
-	return r;
-	}
-
-/**
-Check that the destination of each TAddressParms does not overlap with
-any previous source or destination or that if it does the whole transfer
-matches.
-This is so that successive transfers do not overwrite the destinations or
-sources of preceeding ones.
-
-If aAllowExactRepeat is true then exactly matching transfers are allowed
-to test the case where a repeat transfer is required - though it can't
-then be determined just from looking at the buffers that the repeat was
-successful
-*/
-TBool TPreTransferIncrBytes::CheckBuffers(const RArray<const TAddressParms>& aTransferParams, TBool aAllowExactRepeat) const
-	{
-
-	const TInt count = aTransferParams.Count();
-
-	if(gVerboseOutput)
-		{
-		RDebug::Printf("CheckBuffers, %d transfers", count);
-		}
-
-	TBuf<128> buf;
-	for(TInt i=1; i<count; i++)
-		{
-		const TAddressParms& current = aTransferParams[i];
-
-		if(gVerboseOutput)
-			{
-			buf.Zero();
-			current.AppendString(buf);
-			RDebug::Print(_L("Check current: %S, against:"), &buf);
-			}
-
-		for(TInt j=0; j<i; j++)
-			{
-			const TAddressParms& previous = aTransferParams[j];
-			if(gVerboseOutput)
-				{
-				buf.Zero();
-				previous.AppendString(buf);
-				RDebug::Print(_L("Previous: %S"), &buf);
-				}
-
-			const TBool curDstOverlapsPrevTfer = previous.Overlaps(current.DestRange());
-			const TBool curSrcDependsOnPrevDest = current.SourceRange().Overlaps(previous.DestRange());
-			const TBool permitExactRepeat = aAllowExactRepeat && (current == previous);
-
-			const TBool ok = !(curDstOverlapsPrevTfer || curSrcDependsOnPrevDest) || permitExactRepeat;
-			if(!ok)
-				return EFalse;
-			}
-		}
-	return ETrue;
-	}
-//////////////////////////////////////////////////////////////////////
-// TTransferIter class
-//////////////////////////////////////////////////////////////////////
-void TTransferIter::operator++ ()
-	{
-	iPtr++; //the standard post increment
-	if(iElem < (iCfg->iElementsPerFrame-1))
-		{
-		iPtr += iCfg->iElementSkip;
-		iElem++;
-		iBytes++;
-		}
-	else
-		{
-		TEST_ASSERT(iElem == iCfg->iElementsPerFrame-1);
-		if(iFrame < iCfg->iFramesPerTransfer-1)
-			{
-			iPtr += iCfg->iFrameSkip;
-			iFrame++;
-			iBytes++;
-			iElem = 0;
-			}
-		else
-			{
-			//we have reached the end
-			TEST_ASSERT(iFrame == iCfg->iFramesPerTransfer-1);
-			iPtr = NULL;
-			}
-		}
-
-	Invariant();
-	}
-
-void TTransferIter::Invariant() const
-	{
-	const TInt elemSize = iCfg->iElementSize;
-	RTest test(_L("TTransferIter invariant"));
-	const TUint bytesTransfered = (
-			elemSize * (iFrame * iCfg->iElementsPerFrame + iElem)
-			+ ((TUint)iPtr % (elemSize))
-			);
-	test_Equal(iBytes, bytesTransfered);
-	test.Close();
-	}
-
-///////////////////////////////////////////////////////////
-// TTestCase
-///////////////////////////////////////////////////////////
-TTestCase::TTestCase(CDmaTest* aTest,
-   TBool aConcurrent,
-   const TDmaCapability aCap1,
-   const TDmaCapability aCap2,
-   const TDmaCapability aCap3,
-   const TDmaCapability aCap4,
-   const TDmaCapability aCap5
-   )
-:
-	iTest(aTest), iConcurrentTest(aConcurrent)
-	{
-	iChannelCaps[0] = aCap1;
-	iChannelCaps[1] = aCap2;
-	iChannelCaps[2] = aCap3;
-	iChannelCaps[3] = aCap4;
-	iChannelCaps[4] = aCap5;
-	}
-
-TResult TTestCase::TestCaseValid(const SDmacCaps& aChannelCaps) const
-	{
-	const TDmaCapability* cap = &iChannelCaps[0];
-
-	TResult ret = ERun;
-	//We assume that the array is empty at the first ENone found
-	//any caps after this wil be ignored
-	while(cap->iCapsReq != ENone)
-		{
-		TResult t = cap->CompareToDmaCaps(aChannelCaps);
-		if(t > ret) //this relies on the enum ordering
-			ret = t;
-		cap++;
-		}
-	return ret;
-	}
-
-TResult TTestCase::TestCaseValid(const TDmacTestCaps& aChannelCaps) const
-	{
-	const TDmaCapability* cap = &iChannelCaps[0];
-
-	TResult ret = ERun;
-	//We assume that the array is empty at the first ENone found
-	//any caps after this wil be ignored
-	while(cap->iCapsReq != ENone)
-		{
-		TResult t = cap->CompareToDmaCaps(aChannelCaps);
-		if(t > ret) //this relies on the enum ordering
-			ret = t;
-		cap++;
-		}
-	return ret;
-	}
-/**
-Will report whether a value held in aChannelCaps satisfies a
-requirement specfied by this object
-*/
-TBool TDmaCapability::RequirementSatisfied(const SDmacCaps& aChannelCaps) const
-	{
-	switch(iCapsReq)
-		{
-	case ENone:
-		return ETrue;
-	case EChannelPriorities:
-		TEST_FAULT;
-	case EChannelPauseAndResume:
-		return aChannelCaps.iChannelPauseAndResume == (TBool)iValue;
-	case EAddrAlignedToElementSize:
-		TEST_FAULT;
-	case E1DAddressing:
-		return aChannelCaps.i1DIndexAddressing == (TBool)iValue;
-	case E2DAddressing:
-		return aChannelCaps.i2DIndexAddressing == (TBool)iValue;
-	case ESynchronizationTypes:
-	case EBurstTransactions:
-	case EDescriptorInterrupt:
-	case EFrameInterrupt:
-	case ELinkedListPausedInterrupt:
-	case EEndiannessConversion:
-	case EGraphicsOps:
-	case ERepeatingTransfers:
-	case EChannelLinking:	
-		return aChannelCaps.iChannelLinking == (TBool)iValue;
-	case EHwDescriptors:
-		return aChannelCaps.iHwDescriptors == (TBool)iValue;
-	case ESrcDstAsymmetry:
-	case EAsymHwDescriptors:
-		TEST_FAULT;
-	case EBalancedAsymSegments:
-		return aChannelCaps.iBalancedAsymSegments == (TBool)iValue;
-	case EAsymCompletionInterrupt:
-		return aChannelCaps.iAsymCompletionInterrupt == (TBool)iValue;
-	case EAsymDescriptorInterrupt:
-		return aChannelCaps.iAsymDescriptorInterrupt == (TBool)iValue;
-	case EAsymFrameInterrupt:
-		return aChannelCaps.iAsymFrameInterrupt == (TBool)iValue;
-	default:
-		TEST_FAULT;
-		}
-
-	return EFalse;
-	}
-
-/**
-Will report whether a value held in aChannelCaps satisfies a
-requirement specfied by this object
-*/
-TBool TDmaCapability::RequirementSatisfied(const TDmacTestCaps& aChannelCaps) const
-	{
-	switch(iCapsReq)
-		{
-	case EPilVersion:
-		return TestValue(aChannelCaps.iPILVersion);
-	default:
-		return RequirementSatisfied(static_cast<SDmacCaps>(aChannelCaps));
-		}
-	}
-
-TResult TDmaCapability::CompareToDmaCaps(const SDmacCaps& aChannelCaps) const
-	{
-	const TBool reqSatisfied = RequirementSatisfied(aChannelCaps);
-	if(reqSatisfied)
-		{
-		return ERun;
-		}
-	else
-		{
-		return iFail ? EFail : ESkip;
-		}
-	}
-
-TResult TDmaCapability::CompareToDmaCaps(const TDmacTestCaps& aChannelCaps) const
-	{
-	const TBool reqSatisfied = RequirementSatisfied(aChannelCaps);
-	if(reqSatisfied)
-		{
-		return ERun;
-		}
-	else
-		{
-		return iFail ? EFail : ESkip;
-		}
-	}
-/**
-Test that aValue satisfies the comparrison (iCapsReqType) with the
-reference value held in iValue
-*/
-TBool TDmaCapability::TestValue(TUint aValue) const
-	{
-	switch(iCapsReqType)
-		{
-	case EEqual:
-		return aValue == iValue;
-	case EGTE:
-		return aValue >= iValue;
-	case ELTE:
-		return aValue <= iValue;
-	case EBitsSet:
-	case EBitsClear:
-	default:
-		TEST_FAULT;
-		}
-	return EFalse;
-	}
-
-static RTest test(_L("DMAv2 test"));
-
-//////////////////////////////////////////////////////////////////////
-// TTestRunner
-//////////////////////////////////////////////////////////////////////
-TTestRunner::TTestRunner()
-	{
-	// Open RDmaSession handle
-	TInt r = iDmaSession.Open();
-	TEST_ASSERT(r == KErrNone);
-
-	// Get PSI Test info
-	r = iDmaSession.GetTestInfo(iPslTestInfo);
-	TEST_ASSERT(r == KErrNone);
-
-	//Retrieve PSL cookies
-	GetPslCookie();
-
-	//Generate the DMA channel records
-	GenerateChannelRecord();
-	}
-
-TTestRunner::~TTestRunner()
-	{
-	RTest::CloseHandleAndWaitForDestruction(iDmaSession);
-	iTestCases.Close(); //TestRunner does not own test cases
-	iChannelRecords.Close();
-	iPslCookies.Close();
-	}
-
-void TTestRunner::AddTestCases(RPointerArray<TTestCase>& aTTestCases)
-	{
-	const TInt count = aTTestCases.Count();
-	for(TInt i=0; i < count; i++)
-		{
-		iTestCases.AppendL(aTTestCases[i]);
-		}
-	}
-
-void TTestRunner::RunTests()
-	{
-	//Print PslTestInfo
-	if(gVerboseOutput)
-		{
-		Print(iPslTestInfo);
-		}
-
-	//iterate through the test case array
-	const TInt testCaseCount = iTestCases.Count();
-	for(TInt i=0; i < testCaseCount; i++)
-		{
-		const TTestCase& testCase = *iTestCases[i];
-
-		//Here, we must create a test thread for each channel
-		RPointerArray<CTest> concurrentTests;
-
-		const TInt chanRecCount = iChannelRecords.Count();
-		for(TInt j=0; j < chanRecCount; j++)
-			{
-			const TChannelRecord& record = iChannelRecords[j];
-			const TDmacTestCaps& caps = record.iChannelCaps;
-
-			const TResult t = testCase.TestCaseValid(caps);
-
-			switch(t)
-				{
-			case ERun:
-				{
-				CDmaTest* dmaTest = static_cast<CDmaTest*>(testCase.iTest->Clone());
-				TEST_ASSERT(dmaTest != NULL);
-
-				dmaTest->SetChannelCookie(record.iCookie);
-				dmaTest->SetupL();
-				if(testCase.iConcurrentTest)
-					{
-					//Add test to array to be run concurrently
-					TInt r = concurrentTests.Append(dmaTest);
-					TEST_ASSERT(r == KErrNone);
-					}
-				else
-					{
-					dmaTest->Announce();
-					//Run test in this thread
-					(*dmaTest)();
-					TBool result = dmaTest->Result();
-					TEST_ASSERT(result);
-
-					delete dmaTest;
-					}
-
-				break;
-				}
-			case ESkip:
-				if(gVerboseOutput)
-				{
-				RDebug::Printf("Skipping test-case %S, PSL channel %d", &testCase.iTest->Name(), record.iCookie);
-				}
-				break;
-			case EFail:
-				if(gVerboseOutput)
-				{
-				RDebug::Printf("Failling test-case %S, PSL channel %d", &testCase.iTest->Name(), record.iCookie);
-				}
-				TEST_FAULT;
-			default:
-				TEST_FAULT;
-				}
-			//Depending on the value of iConcurrentTest the test runner will either block until the thread has completed or
-			//alternatively run the current test case on the next channel:
-
-			//if the test case has been run on all channels it will then  wait for all threads to complete.
-			}
-
-		// Run the tests which should happen concurrently
-		const TInt count = concurrentTests.Count();
-		if(count>0)
-			{
-			RDebug::Printf("== Begin concurrent test run ==");
-
-			TInt i;											// VC++
-			for(i=0; i<count; i++)
-				{
-				concurrentTests[i]->Announce();
-				}
-
-			MultipleTestRun(concurrentTests);
-			for(i=0; i<count; i++)
-				{
-				TBool result = static_cast<CDmaTest*>(concurrentTests[i])->Result();
-				TEST_ASSERT(result);
-				}
-			RDebug::Printf("== End concurrent test run ==");
-			}
-
-		concurrentTests.ResetAndDestroy();
-		}
-	}
-
-void TTestRunner::GetPslCookie()
-	{
-	//Get Sb Channel cookies
-	for(TInt sb_channelcount=0; sb_channelcount<iPslTestInfo.iMaxSbChannels; sb_channelcount++)
-		{
-		iPslCookies.AppendL(iPslTestInfo.iSbChannels[sb_channelcount]);
-		}
-
-	//Get Db Channel cookies
-	for(TInt db_channelcount=0; db_channelcount<iPslTestInfo.iMaxDbChannels; db_channelcount++)
-		{
-		iPslCookies.AppendL(iPslTestInfo.iDbChannels[db_channelcount]);
-		}
-
-	//Get Sg Channel cookies
-	for(TInt sg_channelcount=0; sg_channelcount<iPslTestInfo.iMaxSgChannels; sg_channelcount++)
-		{
-		iPslCookies.AppendL(iPslTestInfo.iSgChannels[sg_channelcount]);
-		}
-	}
-
-void TTestRunner::GenerateChannelRecord()
-	{
-	//for each PSL cookie
-	for(TInt count=0; count<iPslCookies.Count(); count++)
-		{
-		//Get channel cookie
-		const TUint pslCookie = iPslCookies[count];
-		TUint sessionCookie;
-		TInt r = iDmaSession.ChannelOpen(pslCookie, sessionCookie);
-		TEST_ASSERT(r == KErrNone);
-		if(gVerboseOutput)
-		{
-		RDebug::Printf("Channel PSL Cookie[%d]  :0x%08x",count,pslCookie);
-		}
-
-		TChannelRecord dmaChannelRecord;
-		dmaChannelRecord.iCookie = pslCookie;
-
-		//Get Channel Caps
-		r = iDmaSession.ChannelCaps(sessionCookie, dmaChannelRecord.iChannelCaps);
-		TEST_ASSERT(r == KErrNone);
-
-		r = iDmaSession.ChannelClose(sessionCookie);
-		TEST_ASSERT(r == KErrNone);
-
-		//Append array
-		iChannelRecords.AppendL(dmaChannelRecord);
-		}
-	}
-//////////////////////////////////////////////////////////////////////
-// Global test functions and E32Main
-//////////////////////////////////////////////////////////////////////
-
-/**
-Displayed if used supplied no parameters, garbage, or a ? in the parameters
-*/
-void PrintUsage()
-	{
-	test.Printf(_L("*** DMA TEST FRAMEWORK ***\n"));
-	test.Printf(_L("Usage : t_dma2.exe [/option]\n"));
-	test.Printf(_L("  /V or /VERBOSE  = Control test output\n"));
-	test.Printf(_L("  /S or /SELFTEST = Run DMA self tests\n"));
-	test.Printf(_L("  /simple = Run only simple transfer tests\n"));
-	test.Printf(_L("  /callback = Run only callback tests\n"));
-	test.Printf(_L("  /multi = Run only multipart transfer tests\n"));
-	test.Printf(_L("  /isrdfc = Run only isr and dfc tests\n"));
-	test.Printf(_L("  /isreque = Run only isr reque tests\n"));
-	test.Printf(_L("  /bench = Run only benchmark tests\n"));
-	test.Printf(_L("  /suspend = Run only pause and resume tests\n"));
-	test.Printf(_L("  /graphic = Run only graphic tests\n"));
-	test.Printf(_L("  /channel = Run only DMA channel (opening and closing) tests\n"));
-	test.Printf(_L("  /queue = Run only queue tests\n"));
-	test.Printf(_L("  /fragment = Run only fragmentation related tests\n"));
-	test.Printf(_L("  /request = Run only requests tests related tests\n"));
-	test.Printf(_L("\n"));
-	}
-
-void ProcessCommandLineL()
-{
-	test.Printf(_L("Process command line arguments\n"));
-
-	TInt cmdLineLength(User::CommandLineLength());
-	HBufC* cmdLine = HBufC::NewMaxLC(cmdLineLength);
-	TPtr cmdLinePtr = cmdLine->Des();
-	User::CommandLine(cmdLinePtr);
-	TBool  tokenParsed(EFalse);
-
-	TLex args(*cmdLine);
-	args.SkipSpace(); // args are separated by spaces
-	
-	// first arg is the exe name, skip it
-	TPtrC cmdToken = args.NextToken();
-	HBufC* tc = HBufC::NewLC(KParameterTextLenMax);
-	*tc = cmdToken;
-	while (tc->Length())
-		{
-		tokenParsed = EFalse;
-		
-		// '/?' help wanted flag '?' or /? parameter
-		if ((0== tc->FindF(_L("?"))) || (0==tc->FindF(_L("/?")))) 
-			{
-			gHelpRequested = ETrue;
-			tokenParsed = ETrue;
-			}	
-		
-		// '/SELFTEST'			
-		if ((0== tc->FindF(KArgSelfTest)) || (0==tc->FindF(KArgSelfTest2))) 
-			{
-			// Run self test
-			test.Printf(_L("Command Line Options:Selftest option specified.\n"));
-			gSelfTest = ETrue;
-			tokenParsed = ETrue;
-			}
-
-		// '/VERBOSE' option	
-		if ((0== tc->FindF(KArgVerboseOutput)) || (0==tc->FindF(KArgVerboseOutput2)))
-			{ 
-			test.Printf(_L("Command Line Options:Verbose option specified.\n"));
-			gVerboseOutput = ETrue;
-			tokenParsed = ETrue;			
-			}
-
-		// '/suspend' option
-		if ((0== tc->FindF(KArgSuspendTest)))
-			{
-			gSuspend = ETrue;
-			tokenParsed = ETrue;
-			}	
-		
-		// '/simple' option
-		if ((0== tc->FindF(KArgSimpleTest)))
-			{
-			gSimpleTest = ETrue;
-			tokenParsed = ETrue;
-			}	
-		
-		// '/multi' option
-		if ((0== tc->FindF(KArgMultiPartTest)))
-			{
-			gMultiPart = ETrue;
-			tokenParsed = ETrue;
-			}	
-	
-		// '/callback' option
-		if ((0== tc->FindF(KArgCallBackTest)))
-			{
-			gCallBack = ETrue;
-			tokenParsed = ETrue;
-			}	
-		
-		// '/IsrAndDfc' option
-		if ((0== tc->FindF(KArgIsrDfcTest)))
-			{
-			gIsrAndDfc  = ETrue;
-			tokenParsed = ETrue;
-			}	
-		
-		// '/IsrReque' option
-		if ((0== tc->FindF(KArgIsrequeTest)))
-			{
-			gIsrReque = ETrue;
-			tokenParsed = ETrue;
-			}	
-
-		// '/Benchmark' option
-		if ((0== tc->FindF(KArgBenchmarkTest)))
-			{
-			gBenchmark = ETrue;
-			tokenParsed = ETrue;
-			}	
-
-		// '/Queue' option
-		if ((0== tc->FindF(KArgQueueTest)))
-			{
-			gQueue = ETrue;
-			tokenParsed = ETrue;
-			}	
-
-		// '/Fragment' option
-		if ((0== tc->FindF(KArgFragmentTest)))
-			{
-			gFragment = ETrue;
-			tokenParsed = ETrue;
-			}	
-		
-		// '/Channel' option
-		if ((0== tc->FindF(KArgChannelTest)))
-			{
-			gChannel = ETrue;
-			tokenParsed = ETrue;
-			}	
-		
-		// '/Graphic' option
-		if ((0== tc->FindF(KArgGraphicTest)))
-			{
-			gGraphic = ETrue;
-			tokenParsed = ETrue;
-			}	
-
-		// '/Request' option
-		if ((0== tc->FindF(KArgRequestTest)))
-			{
-			gRequest = ETrue;
-			tokenParsed = ETrue;
-			}	
-	
-		if (!tokenParsed)
-			{
-			// warn about unparsed parameter
-			test.Printf(_L("Warning: '%lS'??? not parsed\n"), tc);
-			gHelpRequested = ETrue;
-			}
-			
-		// next parameter
-		*tc = args.NextToken();
-		}
-	CleanupStack::PopAndDestroy(tc);
-	CleanupStack::PopAndDestroy(cmdLine);
-}
-
-void RunDMATests()
-	{
-	test.Start(_L("Creating test runner\n"));
-	TTestRunner testRunner;
-
-	test.Next(_L("Add global test cases to test runner\n"));
-
-	if (gSimpleTest) //Add only simple tranfer test cases
-	{
-		testRunner.AddTestCases(TestArraySimple);
-	}
-	else if (gCallBack)  //Add only callback test cases
-	{
-		testRunner.AddTestCases(TestArrayCallback);
-	}
-	else if (gIsrReque)  //Add only ISR Reque test cases
-	{
-		testRunner.AddTestCases(TestArrayIsrReque);
-	}
-	else if (gMultiPart)  //Add only Multipart test cases
-	{
-		testRunner.AddTestCases(TestArrayMultiPart);
-	}
-	else if (gIsrAndDfc)  //Add only IsrAndDfc test cases
-	{
-		testRunner.AddTestCases(TestArrayIsrAndDfc);
-	}
-	else if (gBenchmark)  //Add only Benchmark test cases
-	{
-		testRunner.AddTestCases(TestArrayBenchmark);
-	}
-	else if (gGraphic)  //Add only 2D test cases
-	{
-		testRunner.AddTestCases(TestArray2DTest);
-	}
-	else if (gFragment)  //Add only Fragment test cases
-	{
-		testRunner.AddTestCases(TestArrayFragment);
-	}
-	else if (gChannel)  //Add only Channel test cases
-	{
-		testRunner.AddTestCases(TestArrayChannel);
-	}
-	else if (gSuspend)  //Add only Suspend test cases
-	{
-		testRunner.AddTestCases(TestArraySuspend);
-	}
-	else if (gQueue)  //Add only queue test cases
-	{
-		testRunner.AddTestCases(TestArrayQueue);
-	}
-	else if (gRequest)  //Add only request test cases
-	{
-		testRunner.AddTestCases(TestArrayRequest);
-	}
-	else
-	{
-		testRunner.AddTestCases(TestArray);//Add all test cases
-	}
-
-	test.Next(_L("call TTestRunner::RunTests()\n"));
-	testRunner.RunTests();
-
-	test.End();
-	}
-
-
-struct TSimTest
-	{
-	TUint iPslId;
-	TBool iFragment;
-	};
-
-const TSimTest KSimTests[] =
-	{
-		{0, EFalse},
-		{1, EFalse},
-		{2, ETrue},
-		{3, ETrue},
-	};
-
-const TInt KSimTestsCount = ARRAY_LENGTH(KSimTests);
-
-void RunSimDMATests()
-	{
-	test.Start(_L("Run simulated DMAC tests\n"));
-
-	test.Next(_L("Open session"));
-	RDmaSession session;
-	TInt r = session.OpenSim();
-	test_KErrNone(r);
-
-	for(TInt i=0; i<KSimTestsCount; i++)
-		{
-		TUint pslId = KSimTests[i].iPslId;
-		TBool doFrag = KSimTests[i].iFragment;
-
-		test.Start(_L("Open channel"));
-		TUint channelCookie=0;
-		r = session.ChannelOpen(pslId, channelCookie);
-		test.Printf(_L("Open channel %d, cookie recived = 0x%08x\n"), pslId, channelCookie);
-		test_KErrNone(r);
-
-		test.Next(_L("Create Dma request"));
-
-		TUint reqCookie=0;
-		r = session.RequestCreate(channelCookie, reqCookie);
-		test.Printf(_L("cookie recived = 0x%08x\n"), reqCookie );
-		test_KErrNone(r);
-
-		if(doFrag)
-			{
-			test.Next(_L("Fragment request"));
-			const TInt size = 128 * KKilo;
-			TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr);
-			r = session.FragmentRequest(reqCookie, transferArgs);
-			test_KErrNone(r);
-			}
-
-		test.Next(_L("Destroy Dma request"));
-		r = session.RequestDestroy(reqCookie);
-		test_KErrNone(r);
-
-		test.Next(_L("Channel close"));
-		r = session.ChannelClose(channelCookie);
-		test_KErrNone(r);
-		test.End();
-		}
-
-	test.Next(_L("Close session"));
-	RTest::CloseHandleAndWaitForDestruction(session);
-
-	test.End();
-	}
-
-TInt E32Main()
-	{
-	__UHEAP_MARK;
-	test.Title();
-
-	gHelpRequested = EFalse;
-	TInt r;
-
-	// Create the new trap-cleanup mechanism
-	CTrapCleanup* cleanup = CTrapCleanup::New();
-
-	if (cleanup == NULL)
-		{
-		return KErrNoMemory;
-		}
-
-	// Process the command line parameters for batch/etc
-	TRAPD(err, ProcessCommandLineL());
-	if (err != KErrNone)
-		{
-		User::Panic(_L("DMA test run memory failure"), KErrNoMemory);
-		}
-
-	if (gHelpRequested)
-		{
-		PrintUsage();
-		User::Leave(-2);	// nothing to do!
-		}
-	test.Start(_L("Loading test LDD"));
-	//load either the new test ldd, d_dma2.ldd,
-	//or d_dma2_compat.ldd - an ldd linked against
-	//the old DMA framework
-	_LIT(KDma, "D_DMA2.LDD");
-	r = User::LoadLogicalDevice(KDma);
-	const TBool dma2Loaded = ((r == KErrNone) || (r == KErrAlreadyExists));
-
-	_LIT(KDma2Compat, "D_DMA2_COMPAT.LDD");
-	r = User::LoadLogicalDevice(KDma2Compat);
-	const TBool dma2CompatLoaded = ((r == KErrNone) || (r == KErrAlreadyExists));
-
-	if (!(dma2Loaded || dma2CompatLoaded))
-		{
-		test.Printf(_L("Hardware DMA test driver not found - will run tests on simulated DMAC only\n"));
-		}
-	else if (dma2Loaded && !dma2CompatLoaded)
-		{
-		test.Printf(_L("Loaded %S\n"), &KDma);
-		}
-	else if (!dma2Loaded && dma2CompatLoaded)
-		{
-		test.Printf(_L("Loaded %S\n"), &KDma2Compat);
-		}
-	else
-		{
-		test.Printf(_L("The ROM contains %S and %S - only one should be present\n"), &KDma, &KDma2Compat);
-		TEST_FAULT;
-		}
-
-	const TBool dmaHwPresent = (dma2Loaded || dma2CompatLoaded);
-
-	_LIT(KDma2Sim, "D_DMA2_SIM.LDD");
-
-	r = User::LoadLogicalDevice(KDma2Sim);
-	const TBool dma2SimLoaded = ((r == KErrNone) || (r == KErrAlreadyExists));
-	if (dma2SimLoaded)
-		{
-		test.Printf(_L("Loaded %S\n"), &KDma2Sim);
-		}
-	else
-		{
-		test.Printf(_L("Failed to load %S, r=%d\n"), &KDma2Sim, r);
-		test(EFalse);
-		}
-
-	// Turn off evil lazy dll unloading
-	RLoader l;
-	test(l.Connect()==KErrNone);
-	test(l.CancelLazyDllUnload()==KErrNone);
-	RTest::CloseHandleAndWaitForDestruction(l);
-
-	__KHEAP_MARK;
-
-	if (gSelfTest) //Run self tests if specified on command line
-		{
-		SelfTests();
-		}
-
-	RunSimDMATests();
-	if (dmaHwPresent)
-		{
-		RunDMATests();
-		}
-
-	// Wait for the supervisor thread to run and perform asynchronous
-	// cleanup, so that kernel heap space will be freed
-	r = UserSvr::HalFunction(EHalGroupKernel, EKernelHalSupervisorBarrier, (TAny*)5000, 0);
-	test_KErrNone(r);
-	__KHEAP_MARKEND;
-
-	if(dmaHwPresent)
-		{
-		r = User::FreeLogicalDevice(KTestDmaLddNameHw);
-		test_KErrNone(r);
-		}
-	r = User::FreeLogicalDevice(KTestDmaLddNameSim);
-	test_KErrNone(r);
-
-	test.End();
-	test.Close();
-
-	delete cleanup;
-
-	__UHEAP_MARKEND;
-	return 0;
-	}
--- a/kerneltest/e32test/dmav2/t_dma2.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1039 +0,0 @@
-/*
-* Copyright (c) 2009-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"
-* 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_DMA2_H__
-#define __T_DMA2_H__
-
-#include "cap_reqs.h"
-#include "test_thread.h"
-#include "d_dma2.h"
-#include <e32std.h>
-
-class TTestCase;
-// Global array of test cases
-extern RPointerArray<TTestCase> TestArray;
-extern RPointerArray<TTestCase> TestArrayCallback;
-extern RPointerArray<TTestCase> TestArrayIsrReque;
-extern RPointerArray<TTestCase> TestArrayMultiPart;
-extern RPointerArray<TTestCase> TestArrayIsrAndDfc;
-extern RPointerArray<TTestCase> TestArrayBenchmark;
-extern RPointerArray<TTestCase> TestArray2DTest;
-extern RPointerArray<TTestCase> TestArrayIsrAndDfc;
-extern RPointerArray<TTestCase> TestArrayChannel;
-extern RPointerArray<TTestCase> TestArraySuspend;
-extern RPointerArray<TTestCase> TestArrayQueue;
-extern RPointerArray<TTestCase>	TestArraySimple;
-extern RPointerArray<TTestCase>	TestArrayRequest;
-extern RPointerArray<TTestCase>	TestArrayFragment;
-
-extern TBool gVerboseOutput;   // Verbose output control
-
-const TInt KParameterTextLenMax = 80;	// command-line param length
-
-/**
-This function prints out the PSL test Information
-*/
-void Print(const TDmaV2TestInfo& aInfo);
-
-/**
-Runs all framework self tests
-*/
-void SelfTests();
-
-class CSingleTransferTest;
-class CIsrRequeTest;
-class CMultiTransferTest;
-
-/**
-An interface to a classs that sets up the buffers before a test
-*/
-class MPreTransfer
-	{
-public:
-	virtual ~MPreTransfer()
-		{}
-	virtual void Setup(const CSingleTransferTest& aTest) const = 0;
-	virtual void Setup(const CIsrRequeTest& aTest) const = 0;
-	virtual void Setup(const CMultiTransferTest& aTest) const = 0;
-	};
-
-/**
-An interface for a check which takes place at the end of a DMA
-transfer test to verify the transfer was as expected.
-*/
-class MPostTransferCheck
-	{
-public:
-	virtual ~MPostTransferCheck()
-		{}
-	virtual TInt Check(const CSingleTransferTest& aTest) const = 0;
-	virtual TInt Check(const CIsrRequeTest& aTest) const = 0;
-	virtual TInt Check(CMultiTransferTest& aTest) const = 0;
-	};
-
-class TCompare2D : public MPostTransferCheck
-	{
-public:
-	TCompare2D()
-		{}
-
-	virtual TInt Check(const CSingleTransferTest& aTest) const;
-	virtual TInt Check(const CIsrRequeTest& aTest) const;
-	virtual TInt Check(CMultiTransferTest& aTest) const;
-
-	};
-
-class TAlwaysFail : public MPostTransferCheck
-	{
-public:
-	virtual TInt Check(const CSingleTransferTest& /*aTest*/) const
-		{return KErrUnknown;}
-	virtual TInt Check(const CIsrRequeTest&) const
-		{return KErrUnknown;}
-	virtual TInt Check(CMultiTransferTest&) const
-		{return KErrUnknown;}
-	};
-
-class TAlwaysPass : public MPostTransferCheck
-	{
-public:
-	virtual TInt Check(const CSingleTransferTest& /*aTest*/) const
-		{return KErrNone;}
-	virtual TInt Check(const CIsrRequeTest&) const
-		{return KErrNone;}
-	virtual TInt Check(CMultiTransferTest&) const
-		{return KErrNone;}
-	};
-
-/**
-Compare that all the various source buffers of a test match
-its destination buffers
-*/
-class TCompareSrcDst : public MPostTransferCheck
-	{
-public:
-	TCompareSrcDst()
-		{}
-
-	virtual TInt Check(const CSingleTransferTest& aTest) const;
-	virtual TInt Check(const CIsrRequeTest& aTest) const;
-	virtual TInt Check(CMultiTransferTest& aTest) const;
-
-protected:
-	TInt Check(const TIsrRequeArgsSet& aRequeueArgSet, TUint8* aChunkBase, const TDmaTransferArgs& aTferArgs) const;
-	TInt Check(const TIsrRequeArgs& aRequeueArgs) const;
-	TInt Check(const TDmaTransferArgs& aTransferArgs, TUint8* aChunkBase) const;
-	};
-
-/**
-Check whether destination buffers are zero filled
-
-Used to check that a transfer hasn't taken place.
-*/
-class TCheckNoTransfer : public MPostTransferCheck
-	{
-public:
-	TCheckNoTransfer()
-		{}
-
-	virtual TInt Check(const CSingleTransferTest& aTest) const;
-	virtual TInt Check(const CIsrRequeTest& aTest) const;
-	virtual TInt Check(CMultiTransferTest& aTest) const;
-
-protected:
-	TBool IsZeroed(const TDmaTransferArgs& aTransferArgs, TUint8* aChunkBase) const;
-	};
-
-/**
-Base class for all DMA tests
-*/
-class CDmaTest : public CTest
-	{
-public:
-	CDmaTest(const TDesC& aName, TInt aIterations, const MPreTransfer* aPreTransfer, const MPostTransferCheck* aPostTransfer)
-		: CTest(aName, aIterations), iPreTransfer(aPreTransfer), iPostTransferCheck(aPostTransfer)
-		{}
-
-	void OpenDmaSession();
-	/* Duplicate aSession */
-	void OpenDmaSession(const RDmaSession& aSession);
-	void CloseDmaSession();
-	void ChannelPause(const TUint aChannelSessionCookie);
-	void ChannelResume(const TUint aChannelSessionCookie);
-	virtual void PrintTestInfo() const;
-	virtual TBool Result() = 0;
-
-	const RChunk& Chunk() const
-		{return iChunk;}
-
-	/**
-	Tells the test which DMA channel it should run on
-	*/
-	void SetChannelCookie(TUint32 aCookie)
-		{iChannelCookie = aCookie;}
-
-	virtual void PreTransferSetup();
-	virtual TInt DoPostTransferCheck();
-protected:
-	RDmaSession iDmaSession;
-	RChunk iChunk;
-
-	/**
-	Identifies the channel to open (as understood by a DMA PSL)
-	*/
-	TUint iChannelCookie;
-	const MPreTransfer* iPreTransfer;
-
-	const MPostTransferCheck* iPostTransferCheck; //!< Some check to be run after the transfer
-	};
-
-/**
-The Decorator Pattern is used allowing test classes to be optionally extended
-using wrapper/decorator classes.
-This is the base class for test decorators
-*/
-class CDmaTestDecorator : public CDmaTest
-	{
-public:
-
-protected:
-	CDmaTestDecorator(CDmaTest* aDecoratedTest);
-	CDmaTestDecorator(const CDmaTestDecorator& aOther);
-
-	CDmaTest* iDecoratedTest;
-	};
-
-/**
-Will run the wrapped test against both versions of the DMA
-API if available, otherwise just the old version.
-*/
-class CMultiVersionTest : public CDmaTestDecorator
-	{
-public:
-	CMultiVersionTest(CSingleTransferTest* aDmaTest); 
-	CMultiVersionTest(const CMultiVersionTest& aOther);
-	~CMultiVersionTest();
-
-	virtual void Announce() const;
-	virtual void PrintTestType() const;
-	virtual void PrintTestInfo() const; 
-
-	virtual CTest* Clone() const {return new CMultiVersionTest(*this);}
-	virtual void SetupL();
-
-	virtual void RunTest();
-	virtual TBool Result();
-
-protected:
-	void Configure();
-	TBool Version2PILAvailable();
-	CSingleTransferTest* iNewVersionTest;
-	};
-
-/**
-Holds return codes for the various functions which must be called
-to create, fragment, and queue a DMA request
-*/
-struct TRequestResults
-	{
-	TRequestResults
-		(
-		TInt aCreate = KErrNone,
-		TInt aFragmentCount = 0,
-		TInt aFragmentationResult = KErrNone,
-		TInt aQueueResult = KErrNone
-		)
-		:iCreate(aCreate), 
-		 iFragmentCount(aFragmentCount), 
-		 iFragmentationResult(aFragmentationResult), 
-		 iQueueResult(aQueueResult)
-		{}
-
-	/**
-	Constructs with error results
-	*/
-	TRequestResults(TFalse)
-		:iCreate(KErrUnknown), 
-		 iFragmentCount(0), 
-		 iFragmentationResult(KErrUnknown), 
-		 iQueueResult(KErrUnknown)
-		{}
-
-	inline TRequestResults& CreationResult(TInt aErrorCode) {iCreate = aErrorCode; return *this;}
-	inline TRequestResults& FragmentCount(TInt aCount) {iFragmentCount = aCount; return *this;}
-	inline TRequestResults& FragmentationResult(TInt aErrorCode) {iFragmentationResult = aErrorCode; return *this;}
-	inline TRequestResults& QueueResult(TInt aErrorCode) {iQueueResult = aErrorCode; return *this;}
-
-	TInt iCreate;
-	TInt iFragmentCount; //!< 0 means any result permitted
-	TInt iFragmentationResult;
-	TInt iQueueResult;
-	};
-
-/**
-Holds all the results for a DMA CSingleTransferTest
-*/
-struct TResultSet
-	{
-	/**
-	No errors expected
-	*/
-	TResultSet(TInt aChannelOpenResult = KErrNone,
-			const TRequestResults aRequestResults = TRequestResults(),
-			TInt aPostTransferCheck = KErrNone,
-			const TCallbackRecord aCallbackRecord = TCallbackRecord(TCallbackRecord::EThread,1)
-			)
-		:
-		iChannelOpenResult(aChannelOpenResult),
-		iRequestResult(aRequestResults),
-		iPostTransferCheck(aPostTransferCheck),
-		iCallbackRecord(aCallbackRecord)
-		{}
-	
-	explicit TResultSet(const TCallbackRecord& aRecord)
-		:iChannelOpenResult(KErrNone),
-		 iRequestResult(),
-		 iPostTransferCheck(KErrNone),
-		 iCallbackRecord(aRecord)
-		{}
-
-	/**
-	Errors expected
-	*/
-	TResultSet(TFalse)
-		:iChannelOpenResult(KErrUnknown), 
-		iRequestResult(EFalse),
-		iPostTransferCheck(KErrUnknown),
-		iCallbackRecord(TCallbackRecord::Empty())
-		{}		
-	
-	void Print() const;
-	TBool operator == (const TResultSet& aOther) const;
-
-	/** Set channel opening result */
-	TResultSet& ChannelOpenResult(TInt aResult) {iChannelOpenResult = aResult; return *this;}
-	TResultSet& PostTransferResult(TInt aResult) {iPostTransferCheck = aResult; return *this;}
-	/** Set request results */
-	TResultSet& RequestResult(const TRequestResults& aResults) {iRequestResult = aResults; return *this;}
-	/** Set Callback record */
-	TResultSet& CallbackRecord(const TCallbackRecord& aCallbackRecord) {iCallbackRecord = aCallbackRecord; return *this;}
-
-	TInt iChannelOpenResult;
-	TRequestResults iRequestResult;
-	TInt iPostTransferCheck;
-	TCallbackRecord iCallbackRecord;
-	};
-
-/**
-Fills each source buffer with an increasing value and clears each destination
-*/
-class TPreTransferIncrBytes : public MPreTransfer
-	{
-public:
-	TPreTransferIncrBytes()
-		{}
-
-	virtual void Setup(const CSingleTransferTest& aTest) const;
-	virtual void Setup(const CIsrRequeTest& aTest) const;
-	virtual void Setup(const CMultiTransferTest& aTest) const;
-
-	static void SelfTest();
-protected:
-	virtual void Setup(const TAddressParms& aParams) const;
-
-	TBool CheckBuffers(const CIsrRequeTest& aTest) const;
-	TBool CheckBuffers(const CMultiTransferTest& aTest) const;
-
-	TBool CheckBuffers(const RArray<const TAddressParms>& aTransferParams, TBool aAllowExactRepeat=ETrue) const;
-
-	// This function is part of the unit test
-	friend TBool DoTferParmTestL(const TAddressParms* aParms, TInt aCount, TBool aAllowRepeat, TBool aPositive);
-	};
-
-const TPreTransferIncrBytes KPreTransferIncrBytes;
-const TCompareSrcDst KCompareSrcDst;
-const TCompare2D KCompare2D;
-const TCheckNoTransfer KCheckNoTransfer;
-
-
-/**
-Iterates over the bytes in buffer, in the order
-the supllied DMA config would access them
-*/
-class TTransferIter
-	{
-public:
-	TTransferIter()
-		:iCfg(NULL), iPtr(NULL)
-		{}
-
-	TTransferIter(const TDmaTransferConfig& aCfg, TUint8* aChunkBase=NULL)
-		:iElem(0), iFrame(0), iCfg(&aCfg), iChunkBase(aChunkBase), iPtr(Start()), iBytes(0)
-		{}
-
-	void operator++ ();
-	TUint8& operator* ()
-		{
-		Invariant();
-		return *iPtr;
-		}
-
-	TBool operator!= (const TTransferIter& aOther)
-		{
-		return (iPtr != aOther.iPtr);
-		}
-
-	static void SelfTest();
-private:
-	TUint8* Start() const
-		{
-		return iChunkBase + iCfg->iAddr;
-		}
-
-	void Invariant() const;
-
-	TUint iElem; //!< The current element
-	TUint iFrame; //!< The current frame
-
-	const TDmaTransferConfig* const iCfg;
-	TUint8* iChunkBase;
-
-	TUint8* iPtr; //<! Pointer to the current byte
-
-	TUint iBytes; //!< The number of bytes traversed
-	};
-
-/**
-Performs a single DMA transfer using the member TDmaTransferArgs on
-one channel. At each stage of the transfer results are recorded in a
-TResultSet struct: at the end these are compared with a set of expected
-results.
-*/
-class CSingleTransferTest : public CDmaTest
-	{
-public:
-	CSingleTransferTest(
-			const TDesC& aName, TInt aIterations,
-			const TDmaTransferArgs& aArgs,
-			const TResultSet& aExpected,
-			TUint aMaxFragmentSize = 0,
-			const MPostTransferCheck* aPostTferChk = &KCompareSrcDst,
-			const MPreTransfer* aPreTfer = &KPreTransferIncrBytes
-			)
-		: CDmaTest(aName, aIterations, aPreTfer, aPostTferChk),
-		iTransferArgs(aArgs),iExpected(aExpected),iActual(EFalse),
-		iUseNewRequest(ETrue),
-		iUseNewFragment(ETrue),
-		iMaxFragmentSize(aMaxFragmentSize)
-		{}
-
-	/**
-	Perform each stage of trasnfer
-	*/
-	virtual void RunTest();
-	virtual void PrintTestType() const;
-	virtual void PrintTestInfo() const;
-
-	virtual CTest* Clone() const {return new CSingleTransferTest(*this);}
-
-	/**
-	Compares the actual vs the exepected results and reports
-	of the test passed
-	@return ETrue for a pass, EFalse for a fail
-	 */
-	virtual TBool Result();
-
-	/**
-	An accessor function for the object's TDmaTransferArgs
-	*/
-	const TDmaTransferArgs& TransferArgs() const
-		{return iTransferArgs;}
-
-	// The below methods are setters, which may be chained together
-	// ie. The Named Parameter Idiom
-	// @see http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.18
-	inline CSingleTransferTest& UseNewRequest(TBool aFlag) {iUseNewRequest=aFlag; return *this;}
-	inline CSingleTransferTest& UseNewFragment(TBool aFlag) {iUseNewFragment=aFlag; return *this;}
-	inline CSingleTransferTest& UseNewDmaApi(TBool aFlag) {UseNewRequest(aFlag); UseNewFragment(aFlag); return *this;}
-
-protected:
-	virtual void OpenChannel();
-	virtual void PreTransferSetup();
-	virtual void CreateDmaRequest();
-	virtual void Fragment();
-	virtual void Queue();
-	virtual void PostTransferCheck();
-	virtual TInt DoPostTransferCheck();
-	virtual void FreeRequest();
-	virtual void CloseChannel();
-
-protected:
-	/**
-	A handle to kernel side TDmaChannel object received after a channel is opened.
-	*/
-	TUint iChannelSessionCookie;
-	/**
-	A handle to kernel side DDmaRequest object.
-	*/
-	TUint iRequestSessionCookie;
-
-	const TDmaTransferArgs& iTransferArgs;
-
-	/**
-	Expected transfer results
-	*/
-	TResultSet iExpected;
-
-	/**
-	Filled with actual transfer results
-	*/
-	TResultSet iActual;
-
-	TBool iUseNewRequest; //!< If true then CSingleTransferTest will create a DDmaRequest with the v2 ctor
-	TBool iUseNewFragment; //!< If true then CSingleTransferTest will use v2 Fragment API
-	const TUint iMaxFragmentSize;
-	};
-
-/**
-This class will be used for testing DMA Close() and Open() API
-
-Extends CDmaTest by implemeting a RunTest() with a sequence of operations 
-to test Close() and Open() API 
-*/
-class COpenCloseTest : public CDmaTest 
-	{
-public:
-	COpenCloseTest(
-			const TDesC& aName, TInt aIterations,	
-			const MPostTransferCheck* aPostTferChk = NULL,
-			const MPreTransfer* aPreTfer = NULL
-			)
-		: CDmaTest(aName, aIterations, aPreTfer, aPostTferChk), iOpenCloseResult(EFalse) , iRunOpen(EFalse)
-		{}
-
-	~COpenCloseTest();
-
-	virtual void RunTest();
-	virtual void PrintTestType() const;
-
-	virtual CTest* Clone() const {return new COpenCloseTest(*this);}
-	
-	/**
-	Checks the results of the sequeunce of  sequence of operations 
-	to test Close() and Open() API, return ETrue for a pass, EFalse for a fail
-	 */
-	virtual TBool Result();
-
-	// The methods below is a setters ie. The Named Parameter Idiom
-	// @see http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.18
-	inline COpenCloseTest& RunOpenApiTest(TBool aFlag) {iRunOpen=aFlag; return *this;}
-
-protected:	
-	TBool DoRunClose();
-	TBool DoRunOpen();
-	TBool DoRunOpenExposed();
-
-protected:
-	/**
-	A handle to kernel side TDmaChannel object received after a channel is opened.
-	*/
-	TUint iChannelSessionCookie;
-	/**
-	A handle to kernel side DDmaRequest object.
-	*/
-	TUint iRequestSessionCookie;
-
-	/**
-	If true then Close/Open  API test passed
-	*/
-	TBool iOpenCloseResult;
-	
-	/**
-	 If true then run Open API test otherwise run Close API test
-	*/
-	TBool iRunOpen;
-	};
-
-/**
-Used for testing Pause and Resume
-
-Extends CSingle transfer by adding the capability to test
-Pause  & Resume() API.
-*/
-class CPauseResumeTest : public CSingleTransferTest
-	{
-public:
-	 CPauseResumeTest(const TDesC& aName, TInt aIterations, const TDmaTransferArgs& aArgs, const TResultSet& aExpected)
-		:CSingleTransferTest(aName, aIterations, aArgs, aExpected)
-	 {}
-
-	~CPauseResumeTest();
-
-	virtual void RunTest();
-	virtual void PrintTestType() const;
-
-	virtual CTest* Clone() const {return new  CPauseResumeTest(*this);}
-
-	// The methods below is a setters ie. The Named Parameter Idiom
-	// @see http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.18
-	inline CPauseResumeTest& UseNewDmaApi(TBool aFlag) {CSingleTransferTest::UseNewDmaApi(aFlag); return *this;}
-
-protected:
-	void DoCalibrationTransfer(TUint64 &atime);
-	TInt QueueAsyncRequest(TRequestStatus &aRequestState,TUint64 &atime);
-	};
-
-/**
-Used for testing Pause and Resume ( Negative Testing)
-
-Extends CSingle transfer by adding the capability to test
-Pause  & Resume() API. Expects that Pause and Resume is not supported
-*/
-class CPauseResumeNegTest : public CSingleTransferTest
-	{
-public:
-	 CPauseResumeNegTest(const TDesC& aName, TInt aIterations, const TDmaTransferArgs& aArgs, const TResultSet& aExpected)
-		:CSingleTransferTest(aName, aIterations, aArgs, aExpected)
-	 {}
-
-	~CPauseResumeNegTest();
-
-	virtual void RunTest();
-	virtual void PrintTestType() const;
-
-	virtual CTest* Clone() const {return new  CPauseResumeNegTest(*this);}
-
-	// The methods below is a setters ie. The Named Parameter Idiom
-	// @see http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.18
-	inline CPauseResumeNegTest& UseNewDmaApi(TBool aFlag) {CSingleTransferTest::UseNewDmaApi(aFlag); return *this;}
-	};
-
-
-/**
-Used for testing element counting 
-
-Extends CSingle transfer by adding the capability to test
-Element Counting APIs
-*/
-class CElementCountingTest : public CSingleTransferTest
-	{
-public:
-	 CElementCountingTest(const TDesC& aName, TInt aIterations, const TDmaTransferArgs& aArgs, const TResultSet& aExpected)
-		:CSingleTransferTest(aName, aIterations, aArgs, aExpected)
-	 {}
-
-	~CElementCountingTest();
-
-	virtual void RunTest();
-	virtual void PrintTestType() const;
-
-	virtual CTest* Clone() const {return new CElementCountingTest(*this);}
-
-	// The methods below is a setters ie. The Named Parameter Idiom
-	// @see http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.18
-	inline CElementCountingTest& UseNewDmaApi(TBool aFlag) {CSingleTransferTest::UseNewDmaApi(aFlag); return *this;}
-	};
-
-
-/**
-Used for testing Linking of DMA Channels ( Negative Testing)
-
-Extends CSingle transfer by adding the capability to test DMA channel linking
-Expects that channel linking is not supported
-*/
-class CLinkChannelTest : public CSingleTransferTest
-	{
-public:
-	 CLinkChannelTest(const TDesC& aName, TInt aIterations, const TDmaTransferArgs& aArgs, const TResultSet& aExpected)
-		:CSingleTransferTest(aName, aIterations, aArgs, aExpected)
-	 {}
-
-	~CLinkChannelTest();
-
-	virtual void RunTest();
-	virtual void PrintTestType() const;
-
-	virtual CTest* Clone() const {return new  CLinkChannelTest(*this);}
-
-	// The methods below is a setters ie. The Named Parameter Idiom
-	// @see http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.18
-	inline CLinkChannelTest& UseNewDmaApi(TBool aFlag) {CSingleTransferTest::UseNewDmaApi(aFlag); return *this;}
-	};
-
-
-/**
-This class will be used for tests which benchmark certain DMA operations
-*/
-class CDmaBenchmark : public CSingleTransferTest
-	{
-public:
-	CDmaBenchmark(const TDesC& aName, TInt aIterations, const TResultSet& aExpectedResults, const TDmaTransferArgs& aTransferArgs, TUint aMaxFragmentSize);
-	CDmaBenchmark(const CDmaBenchmark& aOriginal);
-	~CDmaBenchmark();
-
-	virtual TBool Result();
-
-	static void SelfTest();
-
-protected:
-	/**
-	@return The mean average of the result array
-	*/
-	TUint64 MeanResult();
-
-	RArray<TUint64> iResultArray;
-	};
-
-/**
-Fragments requests (only) and records duration
-*/
-class CDmaBmFragmentation : public CDmaBenchmark
-	{
-public:
-	CDmaBmFragmentation(const TDesC& aName, TInt aIterations, const TDmaTransferArgs& aTransferArgs, TUint aMaxFragmentSize);
-	virtual CTest* Clone() const {return new CDmaBmFragmentation(*this);}
-	virtual TInt DoPostTransferCheck()
-		{TEST_FAULT; return KErrNotSupported;}
-
-	virtual void RunTest();
-	virtual void PrintTestType() const;
-
-protected:
-	void Fragment();
-	static const TResultSet ExpectedResults;
-	};
-
-/**
-Performs a transfer using an old style DDmaRequest and
-records the duration
-*/
-class CDmaBmTransfer : public CDmaBenchmark
-	{
-public:
-	CDmaBmTransfer(const TDesC& aName, TInt aIterations, const TDmaTransferArgs& aTransferArgs, TUint aMaxFragmentSize);
-	virtual CTest* Clone() const {return new CDmaBmTransfer(*this);}
-	virtual TInt DoPostTransferCheck()
-		{TEST_FAULT; return KErrNotSupported;}
-
-	virtual void RunTest();
-	virtual void PrintTestType() const;
-
-	inline CDmaBmTransfer& UseNewDmaApi(TBool aFlag) {CSingleTransferTest::UseNewDmaApi(aFlag); return *this;}
-	inline CDmaBmTransfer& ExpectedResults(const TResultSet& aArgs) {iExpected=aArgs; return *this;}
-protected:
-	void Queue();
-	};
-
-
-
-/**
-Will create and queue multiple requests
-
-Unlike CSingleTransferTest the class does not permit the use of TResultSet to
-define expected results (for neagative testing)
-*/
-class CMultiTransferTest : public CDmaTest
-	{
-public:
-	CMultiTransferTest(const TDesC& aName, TInt aIterations, const TDmaTransferArgs* aTransferArgs, const TResultSet* aResultSets, TInt aCount);
-	CMultiTransferTest(const CMultiTransferTest& aOther);
-	virtual ~CMultiTransferTest();
-	virtual CTest* Clone() const {return new CMultiTransferTest(*this);}
-
-	virtual TBool Result();
-	virtual void RunTest();
-	virtual void PrintTestType() const;
-
-	inline CMultiTransferTest& PauseWhileQueuing() {iPauseWhileQueuing = ETrue; return *this;}
-	inline CMultiTransferTest& SetPreTransferTest(const MPreTransfer* aPreTfer) {iPreTransfer = aPreTfer; return *this;}
-	inline CMultiTransferTest& SetPostTransferTest(const MPostTransferCheck* aPostTfer) {iPostTransferCheck = aPostTfer; return *this;}
-
-	const TDmaTransferArgs& TransferArgs(TInt aIndex) const;
-	inline TInt TransferCount() const {return iTransferArgsCount;}
-
-	void SetPostTransferResult(TInt aIndex, TInt aErrorCode);
-protected:
-	void OpenChannel();
-	TInt CloseChannel();
-	void CreateDmaRequests();
-	void Fragment();
-	void QueueRequests();
-
-	virtual void PreTransferSetup();
-	virtual TInt DoPostTransferCheck();
-
-	TBool Result(TInt aTransfer);
-
-	const TDmaTransferArgs* const iTransferArgs; //pointer to an array of transfer args
-	const TInt iTransferArgsCount;
-
-
-	TBool iNewDmaApi; //!< If true then CMultiTransferTest will use new style API
-
-	/**
-	A handle to kernel side TDmaChannel object received after a channel is opened.
-	*/
-	TUint iChannelSessionCookie;
-	RArray<TUint> iRequestCookies;
-
-	const TResultSet* const iExpectedArray; // array will be of length iTransferArgsCount
-	RArray<TResultSet> iActualResults;
-
-	/**
-	If set, the test will pause the channel before queuing requests, and
-	resume once they are all queued
-	*/
-	TBool iPauseWhileQueuing;
-	};
-
-/**
-Used for testing TDmaChannel::IsQueueEmpty
-Extends CMultiTransferTest by adding the capability to test IsQueueEmpty() API. 
-*/
-class CIsQueueEmptyTest : public  CMultiTransferTest 
-	{
-public:
-	CIsQueueEmptyTest(const TDesC& aName, TInt aIterations, const TDmaTransferArgs* aTransferArgs, const TResultSet* aResultSets, TInt aCount);
-	CIsQueueEmptyTest(const CIsQueueEmptyTest& aOther);
-	~CIsQueueEmptyTest();
-
-	inline CIsQueueEmptyTest& SetPreTransferTest(const MPreTransfer* aPreTfer) {iPreTransfer = aPreTfer; return *this;}
-	inline CIsQueueEmptyTest& SetPostTransferTest(const MPostTransferCheck* aPostTfer) {iPostTransferCheck = aPostTfer; return *this;}
-
-	virtual CTest* Clone() const {return new CIsQueueEmptyTest(*this);}
-	virtual void RunTest();
-	virtual void PrintTestType() const;
-
-protected:
-	void DoQueueNotEmpty();	
-	void DoIsQueueEmpty();
-	void QueueRequests();
-	};
-
-/**
-Used for testing CancelAll, Will create and queue multiple requests
-Extends CSingle transfer by adding the capability to test CancelAll API
-*/
-class CCancelAllTest : public CMultiTransferTest
-	{
-public:
-	CCancelAllTest(const TDesC& aName, TInt aIterations,
-		const TDmaTransferArgs* aTransferArgs, const TResultSet* aResultSets,
-		TInt aCount
-		);
-	//CCancelAllTest(const CCacheNotifyDirCh
-
-	virtual void RunTest();
-	virtual void PrintTestType() const;
-	virtual CTest* Clone() const {return new CCancelAllTest(*this);}
-
-	inline CCancelAllTest& PauseWhileQueuing()
-		{iPauseWhileQueuing = ETrue; return *this;}
-	inline CCancelAllTest& SetPreTransferTest(const MPreTransfer* aPreTfer)
-		{iPreTransfer = aPreTfer; return *this;}
-	inline CCancelAllTest& SetPostTransferTest(const MPostTransferCheck* aPostTfer)
-		{iPostTransferCheck = aPostTfer; return *this;}
-
-protected:
-	void QueueRequestsAsync();
-	TInt CancelAllRequests();
-	void PauseChannel();
-	void ResumeChannel();
-
-	/**
-	A single request status that we use for all
-	asynchronously queued requests (we do not intend
-	to wait for them)
-	*/
-	TRequestStatus iDummyRequestStatus;
-	};
-
-/**
-Used for testing TDmaChannel::IsrRedoRequest
-
-Extends CSingle transfer by adding the capability to queue with
-additonal transfer parameters (TIsrRequeArgs) which are passed
-to IsrRedoRequest in ISR callback
-*/
-class CIsrRequeTest : public CSingleTransferTest
-	{
-public:
-	CIsrRequeTest(const TDesC& aName, TInt aIterations, const TDmaTransferArgs& aArgs,
-			TIsrRequeArgs* aRequeueArgs, TInt aCount,
-			const TResultSet& aExpected, const MPreTransfer* aPreTfer,
-			const MPostTransferCheck* aPostTferChk, TUint aMaxFragmentSize=0);
-
-	virtual void PrintTestType() const;
-
-	virtual void Queue();
-	virtual CTest* Clone() const {return new CIsrRequeTest(*this);}
-
-	const TIsrRequeArgsSet& GetRequeueArgs() const
-		{return iRequeArgSet;}
-
-
-protected:
-	virtual TInt DoPostTransferCheck();
-	virtual void PreTransferSetup();
-
-	TIsrRequeArgsSet iRequeArgSet;
-	};
-
-/**
-A channel record collects DMA channel capabilities and other PSL information
-before running tests.
-*/
-class TChannelRecord
-	{
-public:
-	TChannelRecord(){}
-	~TChannelRecord(){}
-
-	/**
-	DMA Channel Cookie
-	*/
-	TUint   iCookie;
-
-	/**
-	DMA Channel Capabilities
-	*/
-	TDmacTestCaps iChannelCaps;
-	};
-
-/**
-A test case collects together a DMA test (CDmaTest), its hardware prerequisites,
-and other information about how the test should be run.
-*/
-class TTestCase
-	{
-public:
-	TTestCase(CDmaTest* aTest,
-           TBool aConcurrent = EFalse,
-		   const TDmaCapability = TDmaCapability(),
-		   const TDmaCapability = TDmaCapability(),
-		   const TDmaCapability = TDmaCapability(),
-		   const TDmaCapability = TDmaCapability(),
-		   const TDmaCapability = TDmaCapability()
-		   );
-
-	static void SelfTest();
-
-	/**
-	Compares the requirements held in the class
-	against those described in aChannelCaps and makes a decision
-	as to whether this test case should be run, skipped, or failed.
-	*/
-	TResult TestCaseValid(const SDmacCaps& aChannelCaps) const;
-	TResult TestCaseValid(const TDmacTestCaps& aChannelCaps) const;
-
-	enum {KMaxChannelCaps=5};
-	TDmaCapability	iChannelCaps[KMaxChannelCaps];
-	TUint iChannelType;
-	TInt iTimeout;
-	CDmaTest* iTest;
-	TBool iConcurrentTest;
-	TBool iDmaV2Only; //!< If true then this test cannot be run on DMA v1 framework
-	};
-
-/**
-A TestRunner manages the whole testing process.Before running any test cases it will open its own RDmaSession 
-handle, not associated with a DMA channel, so that it can recover the TDmaTestInfo object (as used by the 
-existing DMA framework) which says what channels are available to be tested.It will use TTestThread objects 
-to run tests in new threads.TTestThread contains a number of useful features such as waiting for thread exit 
-and accepting a TFunctor object to be run in a new thread. 
-*/
-class TTestRunner
-{
-public:
-	TTestRunner();
-	~TTestRunner();
-
-	/**
-	This function will populate TTestRunner with an array of test cases
-	to be run
-
-	@param aTTestCases Array of test cases
-	*/
-	void AddTestCases(RPointerArray<TTestCase>& aTTestCases);
-
-	/**
-	This will iterate over all test cases held by the test runner and
-	for each one will judge which DMA channels it can be run on, running
-	the test if possible.
-	*/
-	void RunTests();
-
-private:
-	/**
-	This functions retrieves the PSL cookies from all the DMA channels
-	and stores them in a single array.	It will use information from 
-	the PslTestInfo.
-	*/
-	void GetPslCookie();
-
-	/**
-	This function will generate the DMA channel records.i.e channel cookies,Caps.
-	*/
-	void GenerateChannelRecord();
-
-	/**
-	Holds the PslTestInfo
-	*/	
-	TDmaV2TestInfo iPslTestInfo;
-
-	/**
-	A handle to RDmaSession
-	*/
-	RDmaSession iDmaSession;
-	
-	/**
-	Array of DMA test cases 
-	*/
-	RPointerArray<TTestCase> iTestCases; 
-	
-	/**
-	Array of DMA channel records,channel capabilities and other PSL information
-	*/
-	RArray<TChannelRecord> iChannelRecords; 	
-
-	/**
-	Array of DMA channel cookies
-	*/
-	RArray<TUint> iPslCookies;
-};
-
-/**
-Copy an RArray
-*/
-template <typename T>
-void CopyL(const RArray<T>& aOriginal, RArray<T>& aNew)
-	{
-	const TInt count = aOriginal.Count();
-	for(TInt i=0; i<count; ++i)
-		{
-		aNew.AppendL(aOriginal[i]);
-		}
-	}
-
-template <typename T, typename Iterator>
-void ArrayAppendL(RArray<T>& aArray, Iterator aBegin, Iterator aEnd)
-	{
-	for(Iterator begin = aBegin; begin != aEnd; ++begin)
-		aArray.AppendL(*begin);
-	}
-
-
-#endif // #ifndef __T_DMA2_H__
--- a/kerneltest/e32test/dmav2/test_cases.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1393 +0,0 @@
-/*
-* 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"
-* 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:
-* This file contains statically defined test cases, a pointer to each
-* new test case should be entered in StaticTestArray
-*
-*/
-
-#include "t_dma2.h"
-#include "cap_reqs.h"
-
-const TCallbackRecord threadCallback(TCallbackRecord::EThread,1);
-const TCallbackRecord isrCallback(TCallbackRecord::EIsr,1);
-
-const TInt size = 128 * KKilo;
-const TInt trans64K_1 = ((64 * KKilo) -1); // 65535
-
-//----------------------------------------------------------------------------------------------
-//! TestCaseID      KBASE-DMA-2571
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    This test verifies the correct behavior of CancelAll API in the new DMA 
-//!					framework 
-//!
-//! TestActions     
-//!						1.	Open a DMA channel for a transfer.
-//!						2.  Queue multiple request on the DMA channel.
-//!						3.	Call CancelAll () on the DMA channel.
-//!						4.  Verify that all transfers have been cancelled.
-//!						5   Open a DMA channel for a transfer. This channel should support pause and resume.
-//!						6.  Call Pause () on the channel.
-//!						7.	Queue multiple request on the DMA channel.
-//!						8.	Call CancelAll () on the channel.
-//!						9.	Verify that all transfers have been cancelled.
-//!
-//!
-//! TestExpectedResults 1.  DMA channel opens and KErrNone returned.
-//!						2.  DMA queue request created and KErrNone returned.
-//!						3.  CancelAll () cancels all queued request.
-//!						4.  All queued request are cancelled
-//!						5.	DMA Request completes
-//!
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-namespace CancelAllTest
-	{
-	const TInt size = 2 * KMega;
-	const TDmaTransferArgs transferArgArray[] = {
-		TDmaTransferArgs(0, size, size, KDmaMemAddr),
-		TDmaTransferArgs(2 * size, 3 * size, size, KDmaMemAddr)
-	};
-
-	TResultSet noTransferExpected = TResultSet()
-		.PostTransferResult(KErrNone)
-		.CallbackRecord(TCallbackRecord::Empty());
-
-	const TResultSet expected[] =
-		{
-		TResultSet(noTransferExpected),
-		TResultSet(noTransferExpected)
-		};
-
-	// Test that 2 requests can be queued on a paused channel
-	// then cleared using CancelAll.
-	// It is expected that no data will have been transferred to the
-	// destination buffer.
-	CCancelAllTest testcancelall =
-		CCancelAllTest(_L("CancelAllTest : Cancel and verify cancellation of requests"), 1, transferArgArray, expected, ARRAY_LENGTH(transferArgArray))
-			.SetPreTransferTest(&KPreTransferIncrBytes)
-			.SetPostTransferTest(&KCheckNoTransfer);
-
-	TTestCase testCase(&testcancelall,EFalse,capAboveV1,pauseRequired_skip);
-	}
-
-//--------------------------------------------------------------------------------------------
-//! TestCaseID      KBASE-DMA-2569
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    This test verifies the correct behavior of Pause and Resume API in the new DMA 
-//!					framework 
-//!
-//! TestActions     
-//!						1.	Open a DMA channel for a transfer.
-//!						2.  Setup a DMA request and time how long the transfer takes
-//!						3.	Pause the DMA channel
-//!						4.  Repeat DMA transfer (queued asynchronously)
-//!						5.  Resume DMA Channel
-//! 
-//!	TestExpectedResults 1.  DMA channel opens and KErrNone returned.
-//!						2.  DMA request created and KErrNone returned.
-//!						3.  DMA channel Paused.
-//!						4.  Request queued and waits until Resume is called
-//!						5.	DMA Request completes
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-namespace PauseResumeApiTest
-	{
-	const TInt srcAddr		= 0;
-	const TInt desAddr		= 2 * KMega;	
-	const TInt transferSize = 1 * KMega;	
-
-	TDmaTransferArgs transferArgs(srcAddr, desAddr, transferSize, KDmaMemAddr);
-	const TResultSet expectedResults(threadCallback);
-	CPauseResumeTest testPauseResume = CPauseResumeTest(_L("Pause and Resume Test"), 1, transferArgs, expectedResults); 
-	TTestCase testCasePauseResume(&testPauseResume, EFalse, capAboveV1,pauseRequired_skip);	
-	}
-//--------------------------------------------------------------------------------------------
-//! TestCaseID      KBASE-DMA-2572
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    This test verifies the correct behavior of Pause and Resume API in the new DMA 
-//!					framework 
-//!
-//! TestActions     
-//!						1.	Open a DMA channel for a transfer.
-//!						2.  Pause and Resume DMA channel.
-//!						3.  Close DMA channel.
-//!					
-//! 
-//!	TestExpectedResults 1.  DMA channel opens and KErrNone returned.
-//!						2.  KErrNotSupported returned when Pause and Resume API are called.
-//!						3.	DMA channel closes and KErrNone returned.
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-namespace PauseResumeApiNegTest
-	{
-	const TInt srcAddr		= 0;
-	const TInt desAddr		= 2 * KMega;	
-	const TInt transferSize = 1 * KMega;	
-
-	TDmaTransferArgs transferArgs(srcAddr, desAddr, transferSize, KDmaMemAddr);	
-
-	TResultSet noTransferExpected = TResultSet().
-		RequestResult(TRequestResults().CreationResult(KErrUnknown).FragmentationResult(KErrUnknown).QueueResult(KErrUnknown)).
-		CallbackRecord(TCallbackRecord::Empty()).
-		PostTransferResult(KErrUnknown);
-
-	CPauseResumeNegTest testPauseResumeNeg = CPauseResumeNegTest(_L("Pause and Resume Negative Test"), 1, transferArgs, noTransferExpected); 
-	TTestCase testCasePauseResumeNeg(&testPauseResumeNeg , EFalse, capAboveV1,pauseNotWanted);	
-	}
-//--------------------------------------------------------------------------------------------
-//! TestCaseID      KBASE-DMA-2560
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    Simple DMA transfer test using CSingleTransferTest and New DMA APIs
-//!
-//! TestActions     
-//!						1.	Open a DMA channel for a transfer.
-//!						2.	Create single transfer test and run test
-//!				
-//!
-//!
-//! TestExpectedResults 
-//!						1.  DMA channel opens and KErrNone returned.
-//!						2.	DMA transfer completes with no errors.
-//!							
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-namespace Simple_1
-	{
-	TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr);
-
-	const TResultSet expectedResults(threadCallback);
-
-	CSingleTransferTest simpleTest(_L("Simple Test - New DMA APIs"), 1, transferArgs, expectedResults);
-
-	TTestCase testCase(new (ELeave) CMultiVersionTest(&simpleTest), EFalse);
-	TTestCase testCaseConcurrent(new (ELeave) CMultiVersionTest(&simpleTest), ETrue);
-	}
-
-//----------------------------------------------------------------------------------------------
-//! TestCaseID      KBASE-DMA-2573
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    DMA ISR Callback test (Isr Callback - use old request Ctor)
-//!
-//! TestActions     
-//!						1.	Setup DMA transfer to request a callback from ISR using old style DDmaRequest.
-//!						2.	Create single transfer test and run test
-//!						3.	Verify that DDmaRequest request fails
-//!
-//! TestExpectedResults 
-//!						1.  DMA channel opens and KErrNone returned.
-//!						2.	DMA transfer created with no errors.
-//!						3.	DDmaRequest request fails. 
-//!						
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-namespace Callback
-	{
-	TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr, KDmaSyncAuto, KDmaRequestCallbackFromIsr);
-
-	const TResultSet expectedResults(isrCallback);
-
-	CSingleTransferTest isrTest(_L("Isr Callback"), 1, transferArgs, expectedResults);
-	TTestCase testCase(&isrTest, EFalse, capAboveV1);
-
-
-	const TRequestResults fragmentFails = TRequestResults().
-		FragmentationResult(KErrArgument).
-		QueueResult(KErrUnknown);
-
-	const TResultSet expectedResultsFail = TResultSet(EFalse).
-		ChannelOpenResult(KErrNone).
-		RequestResult(fragmentFails).
-		PostTransferResult(1); // PostTransferResult of 1 means buffers don't match
-
-	CSingleTransferTest isrTestOldRequest = CSingleTransferTest(_L("Isr Callback - use old request Ctor"), 1, transferArgs, expectedResultsFail)
-		.UseNewRequest(EFalse);
-	TTestCase testCaseOldRequest(&isrTestOldRequest, EFalse, capAboveV1);
-	}
-
-//----------------------------------------------------------------------------------------------
-//! TestCaseID      KBASE-DMA-2574,KBASE-DMA-2575
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    DMA ISR Reque test
-//!
-//! TestActions     
-//!					1.	Setup DMA transfer to request a callback from ISR.
-//!					2.	Set up ISR to requeue the DMA request on the same channel and adjust its transfer parameters.
-//!					3.	Create single transfer test and run test
-//!					4.	Verify a client can queue the just completed DMA request from within an ISR callback.
-//!
-//! TestExpectedResults 
-//!					
-//!					DMA transfer completes and just completed request can be requeued from within an ISR 
-//!					callback on the same channel. Requeued DMA request completes successfully
-//!							
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-namespace ISR_Reque
-	{
-	const TInt size = 4 * KKilo;
-	TDmaTransferArgs tferArgs(0, 2*size, size, KDmaMemAddr, KDmaSyncAuto, KDmaRequestCallbackFromIsr);
-
-	const TRequestResults requestResult(KErrNone, 1); // request must be in a single fragment
-
-	//-------------------------------------------------------------
-	//This case requeues 4 transfers at the end of an ISR callback
-	//-------------------------------------------------------------
-	namespace endOnIsrCb
-		{
-		TIsrRequeArgs requeArgs[] = {
-			TIsrRequeArgs(),
-			TIsrRequeArgs(size,3*size,size,0, ETrue),
-			TIsrRequeArgs(size,4*size,size,0, ETrue),
-			TIsrRequeArgs(0,5*size,size,0, ETrue),
-		};
-		const TInt count = ARRAY_LENGTH(requeArgs);
-
-		// we expect a cb for each requeue + 1 for the original
-		// transfer
-		const TCallbackRecord callbackRecord = TCallbackRecord(TCallbackRecord::EIsr, count + 1).IsrRedoResult(KErrNone);
-		const TResultSet expected(KErrNone, requestResult, KErrNone, callbackRecord);
-
-		TTestCase testCase(new (ELeave) CIsrRequeTest(_L("4 Requeues - end on isr cb"), 1, tferArgs, requeArgs, count, expected, &KPreTransferIncrBytes, &KCompareSrcDst), ETrue, capAboveV1);
-		}
-
-	//---------------------------------------------------------------
-	///This case requeues 4 transfers at the end of a thread callback
-	//---------------------------------------------------------------
-	namespace endOnThreadCb
-		{
-		TIsrRequeArgs requeArgs[] = {
-			TIsrRequeArgs(),
-			TIsrRequeArgs(size,3*size,size,0, ETrue),
-			TIsrRequeArgs(size,4*size,size,0, ETrue),
-			TIsrRequeArgs(0,5*size,size,0, EFalse),
-		};
-		const TInt count = ARRAY_LENGTH(requeArgs);
-
-		const TCallbackRecord callbackRecord = TCallbackRecord(TCallbackRecord::EThread, count + 1).IsrRedoResult(KErrNone);
-		const TResultSet expected(KErrNone, requestResult, KErrNone, callbackRecord);
-
-		TTestCase testCase(new (ELeave) CIsrRequeTest(_L("4 Requeues - end on thread cb"), 1, tferArgs, requeArgs, count, expected, &KPreTransferIncrBytes, &KCompareSrcDst), ETrue, capAboveV1);
-		}
-	
-	//----------------------------------------------------------------------------------------------
-	// This case requeues a transfer from within an thread callback after changing the transfer size
-	//----------------------------------------------------------------------------------------------
-	namespace changeSize
-		{
-		TIsrRequeArgs requeArgs[] = {
-			TIsrRequeArgs(3*size,5*size,2*size,0, EFalse),
-		};
-		const TInt count = ARRAY_LENGTH(requeArgs);
-
-		const TCallbackRecord callbackRecord = TCallbackRecord(TCallbackRecord::EThread, count + 1).IsrRedoResult(KErrNone);
-		const TResultSet expected(KErrNone, requestResult, KErrNone, callbackRecord);
-
-		TTestCase testCase(new (ELeave) CIsrRequeTest(_L("1 Requeues - change transfer size"), 1, tferArgs, requeArgs, count, expected, &KPreTransferIncrBytes, &KCompareSrcDst), ETrue, capAboveV1);
-		}
-
-	//--------------------------------------------------------------------------------------------
-	// This case requeues a just completed request from within an ISR callback 
-	//--------------------------------------------------------------------------------------------
-	namespace endOnRedo
-		{
-		// The transfer size has been made bigger than 4K so that we do not miss the second interrupt when tracing 
-		// enabled is. This indicates the PSL's interrupt handler misses an interrupt if it occurs during the interrupt.
-		const TInt size = 0x10000;
-		TDmaTransferArgs tferArgs(0, 2*size, size, KDmaMemAddr, KDmaSyncAuto, KDmaRequestCallbackFromIsr);
-
-		TIsrRequeArgs requeArgs[] = {
-			TIsrRequeArgs(3*size,5*size,2*size,0, ETrue),
-			TIsrRequeArgs() //repeat the previous transfer
-		};
-		const TInt count = ARRAY_LENGTH(requeArgs);
-
-		const TCallbackRecord callbackRecord = TCallbackRecord(TCallbackRecord::EIsr, count + 1).IsrRedoResult(KErrNone);
-		const TResultSet expected(KErrNone, requestResult, KErrNone, callbackRecord);
-
-		TTestCase testCase(new (ELeave) CIsrRequeTest(_L("2 Requeues - Isr redo request repeated"), 1, tferArgs, requeArgs, count, expected, &KPreTransferIncrBytes, &KCompareSrcDst), EFalse, capAboveV1);
-		}
-
-	//--------------------------------------------------------------------------------------------
-	// This case requeues a request from within an ISR callback using invalid requeue parameters
-	//--------------------------------------------------------------------------------------------
-	namespace invalidAddresses
-		{
-		TIsrRequeArgs requeArgs[] = {
-			TIsrRequeArgs(size, size)
-		};
-		const TInt count = ARRAY_LENGTH(requeArgs);
-
-		const TCallbackRecord callbackRecord = TCallbackRecord(TCallbackRecord::EIsr, 1).IsrRedoResult(KErrArgument);
-		const TResultSet expected(KErrNone, requestResult, KErrUnknown, callbackRecord);
-
-		// pre and post test would fail because of bad requeue parameters
-		TTestCase testCase(new (ELeave) CIsrRequeTest(_L("Requeue with matching addresses"), 1, tferArgs, requeArgs, count, expected, NULL, NULL), ETrue, capAboveV1);
-		}
-	//--------------------------------------------------------------------------------------------
-	// This case requeues a request containing more than 1 fragment from within an ISR callback
-	// 
-	//		
-	// This test case is currently caught by a FAULT instead of a return code
-	// as expected. Currently, the facility to return an error code to the test
-	// framework is not yet supported.
-	//
-	// It has been implemented to expect an error code of KErrGeneral as requeues for request that
-	// contains more than one fragments are not allowed. 
-	//--------------------------------------------------------------------------------------------
-	namespace multipleFragments
-		{
-		TIsrRequeArgs requeArgs[] = {
-			TIsrRequeArgs()
-		};
-		const TInt count = ARRAY_LENGTH(requeArgs);
-		const TRequestResults isrequestResult(KErrNone, 2); // request contains 2 fragments
-
-		const TCallbackRecord callbackRecord = TCallbackRecord(TCallbackRecord::EIsr, 1).IsrRedoResult(KErrGeneral);
-		TRequestResults results2Fragments = TRequestResults(isrequestResult).FragmentCount(2); 
-		const TResultSet expected(KErrNone, results2Fragments, KErrNone, callbackRecord);
-
-		TTestCase testCase(new (ELeave) CIsrRequeTest(_L("Attempt to Requeue 2 fragment request"), 1, tferArgs, requeArgs, count, expected, &KPreTransferIncrBytes, &KCompareSrcDst, size/2), ETrue, capAboveV1);
-
-		}
-	}	
-
-//----------------------------------------------------------------------------------------------
-//! TestCaseID      PBASE-DMA-FUNC-2586
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    DMA Multiple transfer test
-//! TestActions     
-//!						1.Setup DMA transfer to using muliple transfers.
-//!						2.Create multipart transfer test and run test.	
-//!
-//!
-//! TestExpectedResults 
-//!						1.  DMA tranfer set up with no errors. 
-//!						2.	Multipart transfer tests completes with no issues.		
-//!							
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-namespace Multipart
-	{
-	// need long transfer, to try and force adjacent
-	// requests to be concatinated
-	const TInt size = 2 * KMega;
-	const TDmaTransferArgs transferArgArray[] = {
-		TDmaTransferArgs(0, size, size, KDmaMemAddr),
-		TDmaTransferArgs(2 * size, 3 * size, size, KDmaMemAddr)
-	};
-
-	const TResultSet expected[] =
-		{
-		TResultSet(),
-		TResultSet()
-		};
-
-	CMultiTransferTest multipart =
-		CMultiTransferTest(_L("Sg request concatination"), 1, transferArgArray, expected, ARRAY_LENGTH(transferArgArray))
-			.SetPreTransferTest(&KPreTransferIncrBytes)
-			.SetPostTransferTest(&KCompareSrcDst);
-
-	TTestCase testCase(&multipart, EFalse, hwDesWanted_skip);
-	}
-
-//----------------------------------------------------------------------------------------------
-//! TestCaseID      KBASE-DMA-2580
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    These tests attempt to queue ISR cb requests while the queue is not 
-//!					empty and queing normal requests when an ISR cb is pending
-//! TestActions     
-//!				
-//!					1.	Setup DMA transfer to request a callback from ISR.
-//!					2.	Create single transfer test and run test
-//!					3.	Queue another request using Queue()before ISR Callback completion
-//!					4.	Verify a DMA framework flags an error.
-//!
-//!
-//! TestExpectedResults 
-//!					DMA framework flags an error  if ISR callback has not been executed 
-//!					for the last time without re-queueing the initial transfer request		
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-namespace IsrAndDfc
-	{
-	// This test case needs a long transfer so that 1st request is still queued when the second 
-	// one is queued. The use of Pause is recommended in order to guarantee this. For this case, 
-	// the size has been selected to ensure that the first isr callback request in IsrBeforeDfc
-	// will only have one fragment
-	const TInt size = 0x40000;
-	TDmaTransferArgs dfcTransfer(0, size, size, KDmaMemAddr);
-	TDmaTransferArgs isrTransfer(2*size, 3*size, size, KDmaMemAddr, KDmaSyncAuto, KDmaRequestCallbackFromIsr);
-
-	const TResultSet success = TResultSet();
-	TResultSet queueFailure = TResultSet().
-			RequestResult(TRequestResults().QueueResult(KErrGeneral)).
-			CallbackRecord(TCallbackRecord::Empty()).
-			PostTransferResult(1);
-
-	namespace DfcBeforeIsr
-		{
-		const TDmaTransferArgs transferArgArray[] = {
-			dfcTransfer,
-			isrTransfer
-		};
-
-		const TResultSet expected[] =
-			{
-			success,
-			queueFailure
-			};
-		CMultiTransferTest dfcBeforeIsr =
-			CMultiTransferTest(_L("DFC cb req before ISR cb req "), 1, transferArgArray, expected, ARRAY_LENGTH(transferArgArray))
-				.SetPreTransferTest(&KPreTransferIncrBytes)
-				.SetPostTransferTest(&KCompareSrcDst)
-				.PauseWhileQueuing();
-		TTestCase testCase(&dfcBeforeIsr, EFalse, pauseRequired_skip, capAboveV1);
-		}
-
-	namespace IsrBeforeDfc
-		{
-		const TDmaTransferArgs transferArgArray[] = {
-			isrTransfer,
-			dfcTransfer
-		};
-
-		TResultSet isrSuccess = TResultSet(success).CallbackRecord(isrCallback);
-		const TResultSet expected[] =
-			{
-			isrSuccess,
-			queueFailure
-			};
-		CMultiTransferTest dfcBeforeIsr =
-			CMultiTransferTest(_L("ISR cb req before DFC cb req "), 1, transferArgArray, expected, ARRAY_LENGTH(transferArgArray))
-				.SetPreTransferTest(&KPreTransferIncrBytes)
-				.SetPostTransferTest(&KCompareSrcDst)
-				.PauseWhileQueuing();
-		TTestCase testCase(&dfcBeforeIsr, EFalse, pauseRequired_skip, capAboveV1);
-		}
-
-	}
-
-//----------------------------------------------------------------------------------------------
-//! TestCaseID      PBASE-DMA-FUNC-2587
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    DMA 2D transfer test
-//!
-//! TestActions     
-//!						1. Set up DMA transfer using TDmaTransArgs parameters specified in order to
-//!						   rotate an image by 90 degrees clockwise.
-//!						2. Verify that destination buffer gets transformed according to the DMA
-//!						   transfer arguments after transfer.
-//!
-//! TestExpectedResults 
-//!						1. DMA tranfer set up with no errors. 
-//!						2. Destination buffer gets transformed accordingly.
-//!							
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-namespace _2D_Test
-	{
-	// Image @ 0x0 with 640x480 pixels and 24 bits/pixel.
-
-	TDmaTransferConfig src(
-		0, /*iAddr*/
-		3, /*iElementSize*/
-		6, /*iElementsPerFrame*/
-		4, /*iFramesPerTransfer*/
-		0, /*iElementSkip*/
-		0, /*iFrameSkip*/
-		KDmaMemAddr /*iFlags*/
-		);
-
-	TDmaTransferConfig dst(
-		0x708000, /*iAddr*/
-		3, /*iElementSize*/
-		640, /*iElementsPerFrame*/
-		480, /*iFramesPerTransfer*/
-		1437, /*iElementSkip*/
-		-920166, /*iFrameSkip*/
-		KDmaMemAddr /*iFlags*/
-		);
-
-	TDmaTransferArgs transferArgs2D(src, dst);
-
-	TResultSet expectedResults; //all KErrNone
-
-	//source buffer is currently filled with increasing values
-	//instead of an image, but the test is still valid
-	CSingleTransferTest transfer2d(_L("2D Transfer"), 1, transferArgs2D, expectedResults, 0, &KCompare2D);
-
-	TTestCase testCase2d(&transfer2d, EFalse, cap_2DRequired, capAboveV1);
-	}
-
-//----------------------------------------------------------------------------------------------
-//! TestCaseID      KBASE-DMA-2565
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    DMA Fragmentation count test
-//!
-//! TestActions     
-//!					1.	Set up the arguments for Fragment using the setting in the test scenario table below.
-//!					2.	Create single transfer test and run test
-//!					3.	Verify that FragmentCount API returns the expected value and framework responds correctly
-//!					4.	Repeat steps 1 to 3 above until all the settings in the scenario table below have been used.
-//!
-//! TestExpectedResults 
-//!					On calling FragmentCount (), the number of fragments (descriptors / pseudo descriptors) that
-//!					the transfer request has been split into is returned. 
-//!					
-//!							
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-namespace FragmentationCount
-	{
-	TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr);
-
-	const TRequestResults requestResult(KErrNone, 128);
-	const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback);
-	CSingleTransferTest test1(_L("Fragmentation Count - 128 fragments"), 1, transferArgs, expectedResults, KKilo);
-	TTestCase testCase(new (ELeave) CMultiVersionTest(&test1), EFalse);
-
-	const TRequestResults requestResult2(KErrNone, 4);
-	const TResultSet expectedResults2(KErrNone, requestResult2, KErrNone, threadCallback);
-	CSingleTransferTest test2(_L("Fragmentation Count - 4 fragments"), 1, transferArgs, expectedResults2, 32*KKilo);
-	TTestCase testCase2(new (ELeave) CMultiVersionTest(&test2), EFalse);
-
-	// Also specifying an element size to get the PIL to further adjust the
-	// fragment size(s): element size = 32, transfer length = 128KB, max
-	// transfer length = 6500 bytes, # of fragments expected = 21 (20 with 6496
-	// bytes each + 1 with 1152 bytes).
-	TDmaTransferArgs transferArgs3(0, size, size, KDmaMemAddr, KDmaSyncAuto, 0, KDmaAddrModePostIncrement, 32);
-	const TRequestResults requestResult3(KErrNone, 21);
-	const TResultSet expectedResults3(KErrNone, requestResult3, KErrNone, threadCallback);
-	CSingleTransferTest test3(_L("Fragmentation Count - 21 fragments"),
-							  1, transferArgs3, expectedResults3, 6500);
-	TTestCase testCase3(new (ELeave) CMultiVersionTest(&test3), EFalse);
-	}
-
-//----------------------------------------------------------------------------------------------
-//! TestCaseID      KBASE-DMA-2584,KBASE-DMA-2585
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    DMA Benchmark tests
-//!					To compare the speed of request fragmentation for a given transfer
-//!					between the new and old frameworks on the NaviEngine platform.
-//! TestActions     
-//!				1.	Fragment a memory to memory dma transfer of 4Mb, where both source and destination are physically contiguous. 
-//!				2.	Fragment using the default element size, and also with a 4K limit.
-//!				3.	Carry out for a channel using pseudo descriptors and for a scatter gather channel.
-//!
-//! TestExpectedResults 
-//!				 The results obtained for both framework versions should  be comparable.							
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//-----------------------------------------------------------------------------------------------
-namespace Benchmark
-	{
-	const TInt bmIters = 10;
-	namespace Frag
-		{
-		const TInt size = 1 * KMega;
-		TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr);
-
-		TTestCase testCase_256K(new (ELeave) CDmaBmFragmentation(_L("1 MB transfer - 256K frag size"), bmIters, transferArgs, 256 * KKilo), EFalse);
-		TTestCase testCase_8K(new (ELeave) CDmaBmFragmentation(_L("1 MB transfer - 8K frag size"), bmIters, transferArgs, 8 * KKilo), EFalse);
-		}
-
-	namespace Transfer
-		{
-		namespace _4Bytes
-			{
-			const TInt size = 4;
-			TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr);
-
-			CDmaBmTransfer bmTest(_L("4 bytes"), bmIters, transferArgs, 0);
-			TTestCase testCase(&bmTest, EFalse);
-			}
-		namespace _128K
-			{
-			const TInt size = 128 * KKilo;
-			TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr);
-
-			TTestCase testCase_128(new (ELeave) CDmaBmTransfer(_L("128 K - 128K frag size"), bmIters, transferArgs, 128 * KKilo), EFalse);
-			TTestCase testCase_16(new (ELeave) CDmaBmTransfer(_L("128 K - 16K frag size"), bmIters, transferArgs, 16 * KKilo), EFalse);
-			TTestCase testCase_4(new (ELeave) CDmaBmTransfer(_L("128 K - 4K frag size"), bmIters, transferArgs, 4 * KKilo), EFalse);
-			TTestCase testCase_1(new (ELeave) CDmaBmTransfer(_L("128 K - 1K frag size"), bmIters, transferArgs, 1 * KKilo), EFalse);
-			}
-		namespace _4MB
-			{
-			const TInt size = 4 * KMega;
-			TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr);
-
-			CDmaBmTransfer bmTest(_L("4 MB"), bmIters, transferArgs, 0);
-			TTestCase testCase(&bmTest, EFalse);
-			}
-		}
-
-	/**
-	Compare time taken between queing and callback of 4 byte
-	request with both DFC and ISR callback
-	The new API calls are used
-	*/
-	namespace CompareIsrDfcCb
-		{
-		const TInt iterations = 50;
-
-		namespace Dfc
-			{
-			TResultSet expected = TResultSet(threadCallback).
-				PostTransferResult(KErrUnknown);
-
-			namespace _4Bytes
-				{
-				const TInt size = 4;
-				TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr);
-				CDmaBmTransfer bmTest = CDmaBmTransfer(_L("4 bytes DFC cb"), iterations, transferArgs, 0).
-					UseNewDmaApi(ETrue).
-					ExpectedResults(expected);
-				TTestCase testCase(&bmTest, EFalse, capAboveV1);
-				}
-			namespace _4K
-				{
-				const TInt size = 4 * KKilo;
-				TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr);
-				CDmaBmTransfer bmTest = CDmaBmTransfer(_L("4K DFC cb"), iterations, transferArgs, 0).
-					UseNewDmaApi(ETrue).
-					ExpectedResults(expected);
-				TTestCase testCase(&bmTest, EFalse, capAboveV1);
-				}
-			}
-
-		namespace Isr
-			{
-			TResultSet expected = TResultSet(isrCallback).
-				PostTransferResult(KErrUnknown);
-
-			namespace _4Bytes
-				{
-				const TInt size = 4;
-				TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr, KDmaSyncAuto, KDmaRequestCallbackFromIsr);
-				CDmaBmTransfer bmTest = CDmaBmTransfer(_L("4 bytes Isr cb"), iterations, transferArgs, 0).
-					UseNewDmaApi(ETrue).
-					ExpectedResults(expected);
-				TTestCase testCase(&bmTest, EFalse, capAboveV1);
-				}
-			namespace _4K
-				{
-				const TInt size = 4 * KKilo;
-				TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr, KDmaSyncAuto, KDmaRequestCallbackFromIsr);
-				CDmaBmTransfer bmTest = CDmaBmTransfer(_L("4K Isr cb"), iterations, transferArgs, 0).
-					UseNewDmaApi(ETrue).
-					ExpectedResults(expected);
-				TTestCase testCase(&bmTest, EFalse, capAboveV1);
-				}
-			}
-		}
-	}
-
-//----------------------------------------------------------------------------------------------
-//! TestCaseID      KBASE-DMA-2560
-//! TestCaseID      KBASE-DMA-2561
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    Test new & old style fragment using CSingleTransferTest
-//!						Test Scenario 1 - DstAddr > SrcAddr & TransferSize=32K & Location is 
-//!						address of a memory buffer
-//! TestActions     
-//!						1.	Set up the arguments for aTransfeArgs using the settings below.
-//!							
-//!							SrcAddr		 = 4 * KKilo;
-//!							desAddr		 = 64 * KKilo;
-//!							transferSize = 32 * KKilo;	
-//!							iFlags		 = KDmaMemAddr;
-//!
-//!						2.	Setup expected result.
-//!						3.	Create single transfer test and run test
-//!
-//! TestExpectedResults 
-//!						1.  TransfeArgs set up in DMA framework
-//!						2.	Expected results set up in DMA framework					
-//!						3.	Fragment request completes and KErrNone returned
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-namespace Fragment_1
-	{	
-	const TInt srcAddr = 4 * KKilo;
-	const TInt desAddr = 64 * KKilo;
-
-	const TInt transferSize =  32 * KKilo;
-	
-	TDmaTransferArgs transferArgs( srcAddr, desAddr, transferSize, KDmaMemAddr);
-
-	const TRequestResults requestResult(KErrNone, 32); 
-	const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback);
-
-	CMultiVersionTest multiVersion(new (ELeave) CSingleTransferTest(_L("Fragment - Scenario 1"), 1, transferArgs, expectedResults,KKilo));
-
-	TTestCase testCase(&multiVersion, EFalse);
-	TTestCase testCaseConcurrent(&multiVersion, ETrue);
-	}
-
-//----------------------------------------------------------------------------------------------
-//! TestCaseID      KBASE-DMA-2560
-//! TestCaseID      KBASE-DMA-2561
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    Test new & old style fragment using CSingleTransferTest
-//!						Test Scenario 3 -  TransferSize=0   
-//!
-//!						1.	Set up the arguments for aTransfeArgs using the settings below.
-//!							
-//!							SrcAddr		 = 32 * KKilo;
-//!							desAddr		 = 64 * KKilo;
-//!							transferSize = 0	
-//!							iFlags		 = KDmaMemAddr;
-//!
-//!						2.	Setup expected result.
-//!						3.	Create single transfer test and run test
-//!
-//!
-//! TestExpectedResults 
-//!
-//!						1.  TransfeArgs set up in DMA framework
-//!						2.	Expected results set up in DMA framework			
-//!						3.	Fragment request fails and KErrArgument returned
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-namespace Fragment_2
-	{
-	const TInt srcAddr = 32 * KKilo;
-	const TInt desAddr = 64 * KKilo;
-	const TInt transferSize = 0;
-	
-	TDmaTransferArgs transferArgs( srcAddr, desAddr, transferSize,KDmaMemAddr);
-	const TRequestResults requestResult(KErrNone, 0, KErrArgument, KErrUnknown); 
-	const TResultSet expectedResults(KErrNone, requestResult, KErrNone, TCallbackRecord::Empty());
-
-
-	CMultiVersionTest multiVersion(new (ELeave) CSingleTransferTest(_L("Fragment - Scenario 3"), 1, transferArgs, expectedResults));
-
-	TTestCase testCase(&multiVersion, EFalse);
-	TTestCase testCaseConcurrent(&multiVersion, ETrue);
-	}
-
-//----------------------------------------------------------------------------------------------
-//! TestCaseID      KBASE-DMA-2560
-//! TestCaseID      KBASE-DMA-2561
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    Test new & old style fragment using CSingleTransferTest
-//!						Test Scenario 4 -  TransferSize=1Byte   
-//!
-//!						1.	Set up the arguments for aTransfeArgs using the settings below.
-//!							
-//!							SrcAddr		 = 32K;
-//!							desAddr		 = 64K;
-//!							transferSize = 1 byte	
-//!							iFlags		 = KDmaMemAddr;
-//!
-//!						2.	Setup expected result.
-//!						3.	Create single transfer test and run test
-//!
-//! TestExpectedResults 
-//!
-//!						1.  TransfeArgs set up in DMA framework
-//!						2.	Expected results set up in DMA framework			
-//!						3.	Fragment request completes and KErrNone returned
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-namespace Fragment_3
-	{	
-	const TInt srcAddr = 32 * KKilo;
-	const TInt desAddr = 64 * KKilo;
-	const TInt transferSize = 1;
-	
-	TDmaTransferArgs transferArgs(srcAddr, desAddr, transferSize, KDmaMemAddr);
-	const TRequestResults requestResult(KErrNone, 1);
-	const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback);
-
-	CMultiVersionTest multiVersion(new (ELeave) CSingleTransferTest(_L("Fragment - Scenario 4"), 1, transferArgs, expectedResults));
-
-	TTestCase testCase(&multiVersion, EFalse);
-	TTestCase testCaseConcurrent(&multiVersion, ETrue);
-	}
-
-//----------------------------------------------------------------------------------------------
-//! TestCaseID      KBASE-DMA-2560
-//! TestCaseID      KBASE-DMA-2561
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    Test new & old style fragment using CSingleTransferTest
-//!						Test Scenario 5 -  TransferSize=128KB    
-//!
-//!						1.	Set up the arguments for aTransfeArgs using the settings below.
-//!							
-//!							SrcAddr		 = 16K;
-//!							desAddr		 = 2MB;
-//!							transferSize = 1MB;
-//!							iFlags		 = KDmaMemAddr;
-//!
-//!						2.	Setup expected result.
-//!						3.	Create single transfer test and run test
-//!
-//! TestExpectedResults 
-//!
-//!						1.  TransfeArgs set up in DMA framework
-//!						2.	Expected results set up in DMA framework			
-//!						3.	Fragment request completes and KErrNone returned
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-namespace Fragment_4
-	{
-	const TInt srcAddr		= 16 * KKilo;
-	const TInt desAddr		= 2 * KMega;	
-	const TInt transferSize = 1 * KMega;
-
-	TDmaTransferArgs transferArgs(srcAddr, desAddr, transferSize, KDmaMemAddr);
-	const TRequestResults requestResult(KErrNone); 
-	const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback);
-
-	CMultiVersionTest multiVersion(new (ELeave) CSingleTransferTest(_L("Fragment - Scenario 5"), 1, transferArgs, expectedResults));
-
-	TTestCase testCase(&multiVersion, EFalse);
-	TTestCase testCaseConcurrent(&multiVersion, ETrue);
-	}
-
-//----------------------------------------------------------------------------------------------
-//! TestCaseID      KBASE-DMA-2560
-//! TestCaseID      KBASE-DMA-2561
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    Test new & old style fragment using CSingleTransferTest
-//!						Test Scenario 6 -  TransferSize=3MB   
-//!
-//!						1.	Set up the arguments for aTransfeArgs using the settings below.
-//!							
-//!							SrcAddr		 = 16K;
-//!							desAddr		 = 4MB;
-//!							transferSize = 3MB 	
-//!							iFlags		 = KDmaMemAddr;
-//!
-//!						2.	Setup expected result.
-//!						3.	Create single transfer test and run test
-//!
-//! TestExpectedResults 
-//!
-//!						1.  TransfeArgs set up in DMA framework
-//!						2.	Expected results set up in DMA framework			
-//!						3.	Fragment request completes and KErrNone returned
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-namespace Fragment_5
-	{
-	const TInt srcAddr = 16 * KKilo;
-	const TInt desAddr = 4 * KMega;
-	const TInt transferSize = 3 * KMega;
-
-	TDmaTransferArgs transferArgs(srcAddr, desAddr, transferSize, KDmaMemAddr);
-	const TRequestResults requestResult(KErrNone);
-	const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback);
-
-	CMultiVersionTest multiVersion(new (ELeave) CSingleTransferTest(_L("Fragment - Scenario 6"), 1, transferArgs, expectedResults));
-
-	TTestCase testCase(&multiVersion, EFalse);
-	TTestCase testCaseConcurrent(&multiVersion, ETrue);
-	}
-
-
-//----------------------------------------------------------------------------------------------
-//! TestCaseID      KBASE-DMA-2562
-//! TestCaseID      KBASE-DMA-2563
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    Test new and old style DDmaRequest using CSingleTransferTest
-//!						Test Scenario 1 -  aMaxTransferSize=0
-//!
-//!						1.	Set up the DDmaRequest using  aMaxTransferSize set to 0.
-//!						2.	Setup expected result.
-//!						3.	Create single transfer test and run test
-//!
-//! TestExpectedResults
-//!
-//!						1.  TransfeArgs set up in DMA framework
-//!						2.	Expected results set up in DMA framework
-//!						3.	DDmaRequest constructor behaves as expected and KErrArgument returned
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//------------------------------------------------------------------------------------------------
-namespace DDmaRequest_1
-	{
-	const TInt desAddr = 4 * KKilo;
-	const TInt transferSize = 4 * KKilo;
-	TDmaTransferArgs transferArgs(0, desAddr, transferSize, KDmaMemAddr);
-
-	const TRequestResults requestResult(KErrNone, 0);
-	const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback);
-
-	CMultiVersionTest multiVersion(new (ELeave) CSingleTransferTest(_L("DDmaRequest - Scenario 1"), 1, transferArgs, expectedResults,0));
-
-	TTestCase testCase(&multiVersion, EFalse);
-	TTestCase testCaseConcurrent(&multiVersion, ETrue);
-	}
-
-//!-------------------------------------------------------------------------------------------------
-//! TestCaseID      KBASE-DMA-2562
-//! TestCaseID      KBASE-DMA-2563
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    Test new and old style DDmaRequest using CSingleTransferTest
-//!						Test Scenario 2 -  aMaxTransferSize= (64K - 1)   // 65535
-//!
-//!						1.	Set up the arguments for DDmaRequest using aMaxTransferSize set to (64K - 1).
-//!						2.	Setup expected result.
-//!						3.	Create single transfer test and run test
-//!
-//! TestExpectedResults
-//!
-//!						1.  TransfeArgs set up in DMA framework
-//!						2.	Expected results set up in DMA framework
-//!						3.	DDmaRequest constructor behaves as expected and KErrArgument returned
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//---------------------------------------------------------------------------------------------------
-namespace DDmaRequest_2
-	{
-	const TInt desAddr = 4 * KKilo;
-	const TInt transferSize = 4 * KKilo;
-	TDmaTransferArgs transferArgs(0, desAddr, transferSize, KDmaMemAddr);
-
-	const TRequestResults requestResult(KErrNone, 1);
-	const TResultSet expectedResults(KErrNone, requestResult, KErrNone, threadCallback);
-
-	CMultiVersionTest multiVersion(new (ELeave) CSingleTransferTest(_L("DDmaRequest - Scenario 2"), 1, transferArgs, expectedResults, trans64K_1));
-
-	TTestCase testCase(&multiVersion, EFalse);
-	TTestCase testCaseConcurrent(&multiVersion, ETrue);
-	}
-
-//----------------------------------------------------------------------------------------------
-//! TestCaseID      KBASE-DMA-2585
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    SmallFrags: This test provokes the failure seen in DEF140598
-//!						The test checks that requests with small fragments
-//!						do not trigger a spurious missed interrupt clean up
-//!
-//! TestActions     
-//!						1.	Open a DMA channel for a transfer.
-//!						2.	Create single transfer test using small frags and run test
-//!
-//! TestExpectedResults 
-//!						1.  DMA channel opens and KErrNone returned.
-//!						2.	DMA transfer completes with no errors.
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-namespace SmallFrags
-	{
-	const TInt size = 32;
-	TDmaTransferArgs transferArgs(0, size, size, KDmaMemAddr);
-
-	const TResultSet expectedResults(threadCallback);
-
-	TTestCase testCase(
-			new (ELeave) CMultiVersionTest(new (ELeave) CSingleTransferTest(_L("8 * 4byte frags"), 10, transferArgs, expectedResults, 4)),
-			EFalse);
-	}
-
-//----------------------------------------------------------------------------------------------
-//! TestCaseID      KBASE-DMA-2568
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    This test checks the correct behaviour of Close API in the new DMA framework
-//!
-//! TestActions     
-//!						1.  Open a DMA channel
-//!						2.	Open DMA Channel again
-//!						3	Close the DMA channel.
-//!						4	Open DMA channel to verify that the DMA channel closed.						
-//!
-//! TestExpectedResults 
-//!						1.  DMA channel opens and KErrNone returned.
-//!						2.	DMA Framework returns KErrInUse as channel is already open.					
-//!						3.	DMA channel closes and KErrNone returned.
-//!						4.	DMA channel opens and KErrNone returned.						
-//!							
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-namespace CloseApiTest
-	{
-	COpenCloseTest testCloseApi = COpenCloseTest(_L("Close API Test"), 1).RunOpenApiTest(EFalse); 
-	TTestCase testCaseCloseApi(&testCloseApi, EFalse, capAboveV1);
-	}
-
-//----------------------------------------------------------------------------------------------
-//! TestCaseID      KBASE-DMA-2564
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    This test checks the correct behaviour of Open API in the new DMA framework
-//!
-//! TestActions     
-//!						1.  Open a DMA channel
-//!						2.	Verify that channel is really open by closing DMA channel
-//!
-//! TestExpectedResults 
-//!						1.  DMA channel opens and KErrNone returned
-//!						2.  DMA channel closes again returns KErrNone.
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-namespace OpenApiTest
-	{
-	COpenCloseTest testOpenApi = COpenCloseTest(_L("Open API Test"), 1).RunOpenApiTest(ETrue); 
-	TTestCase testCaseOpenApi(&testOpenApi, EFalse, capAboveV1);
-	}
-
-//----------------------------------------------------------------------------------------------
-//! TestCaseID      KBASE-DMA-2567
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    This test verifies the correct behavior of TBool IsQueueEmpty() in the new DMA 
-//!					framework and check its return value 
-//!
-//! TestActions     
-//!						1.	Open a single DMA channel for a transfer.
-//!						2.	Setup a DMA request and Fragment the request.
-//!						3.	Call IsQueueEmpty().
-//!						4.	Queue the DMA request.
-//!						5.	Call IsQueueEmpty().
-//! TestExpectedResults 
-//!						1.  DMA channel opens and KErrNone returned.
-//!						2.  DMA request created and fragmented and KErrNone returned.
-//!						3.  IsQueueEmpty() returns ETrue.
-//!						4.  Request queued and KErrNone returned
-//!						5.	IsQueueEmpty() returns EFalse.
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-namespace IsQueueEmptyTest
-	{
-	const TInt size = 2 * KMega;
-	const TDmaTransferArgs transferArgArray[] = {
-		TDmaTransferArgs(0, size, size, KDmaMemAddr),
-		TDmaTransferArgs(2 * size, 3 * size, size, KDmaMemAddr)
-	};
-
-	const TResultSet expected[] =
-		{
-		TResultSet(),
-		TResultSet()
-		};
-	const TResultSet expectedResults(isrCallback);
-
-	CIsQueueEmptyTest isQueueEmpty =
-		CIsQueueEmptyTest(_L("IsQueueEmptyTest using muliple frags"), 1, transferArgArray, expected, ARRAY_LENGTH(transferArgArray))
-			.SetPreTransferTest(&KPreTransferIncrBytes)
-			.SetPostTransferTest(&KCompareSrcDst);
-
-	TTestCase testCase(&isQueueEmpty,EFalse,capAboveV1,pauseRequired_skip);
-	}
-
-//--------------------------------------------------------------------------------------------
-//! TestCaseID      KBASE-DMA-2573
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    This test verifies the correct behavior of the DMA Channel Linking API 
-//!					in the new DMA framework 
-//!
-//! TestActions     
-//!						1.	Open a DMA channel for a transfer.
-//!						2.  Link and Unlink DMA channel.
-//!						3.  Close DMA channel.
-//!					
-//! 
-//!	TestExpectedResults 1.  DMA channel opens and KErrNone returned.
-//!						2.  KErrNotSupported returned when DMA Linking and Unlinking API are called.
-//!						3.	DMA channel closes and KErrNone returned.
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-namespace ChannelLinkingTest
-	{
-	const TInt srcAddr		= 0;
-	const TInt desAddr		= 2 * KMega;	
-	const TInt transferSize = 1 * KMega;	
-
-	TDmaTransferArgs transferArgs(srcAddr, desAddr, transferSize, KDmaMemAddr);	
-
-	TResultSet noTransferExpected = TResultSet().
-		RequestResult(TRequestResults().CreationResult(KErrUnknown).FragmentationResult(KErrUnknown).QueueResult(KErrUnknown)).
-		CallbackRecord(TCallbackRecord::Empty()).
-		PostTransferResult(KErrUnknown);
-
-	CLinkChannelTest testChannelLinking = CLinkChannelTest(_L("DMA Channel Linking and Unlinking Negative Test"), 1, transferArgs, noTransferExpected); 
-	TTestCase testCaseChannelLinking(&testChannelLinking , EFalse, capAboveV1,LinkingNotWanted);	
-	}
-
-//--------------------------------------------------------------------------------------------
-//! TestCaseID      KBASE-DMA-2574
-//! TestType        CIT
-//! PREQ            REQ
-//! TestCaseDesc    This test verifies that the DMA Element Counting APIs can be called. The calls 
-//!					to these functions are meant to be used to meet a code coverage requirement.These APIs
-//!					are not yet supported so the functionality of the APIs are not currently tested.
-//!
-//! TestActions     
-//!						1.	Open a DMA channel for a transfer.
-//!						2.  Make calls to Element Counting APIs
-//!						3.  Close DMA channel.
-//!					
-//! 
-//!	TestExpectedResults 1.  DMA channel opens and KErrNone returned.
-//!						2.  Element Counting APIs are called without crashing the framework
-//!						3.	DMA channel closes and KErrNone returned.
-//!
-//! TestPriority        High
-//! TestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-namespace ElementCountingTest
-	{
-	const TInt srcAddr		= 0;
-	const TInt desAddr		= 2 * KMega;	
-	const TInt transferSize = 1 * KMega;	
-
-	TDmaTransferArgs transferArgs(srcAddr, desAddr, transferSize, KDmaMemAddr);	
-
-	const TResultSet expectedResults(threadCallback);
-	CElementCountingTest testElementCounting(_L("DMA Element Counting Test"), 1, transferArgs, expectedResults);
-	TTestCase testCaseElementCounting(&testElementCounting, EFalse, capAboveV1);
-	}
-
-static TTestCase* StaticSimpleTestArray[] = {
-	&Simple_1::testCase,
-	&Simple_1::testCaseConcurrent,
-};
-
-static TTestCase* StaticCallbackTestArray[] = {
-	&Callback::testCase,
-	&Callback::testCaseOldRequest,	
-};
-
-static TTestCase* StaticIsrRequeTestArray[] = {
-	&ISR_Reque::endOnRedo::testCase,
-	&ISR_Reque::endOnIsrCb::testCase,
-	&ISR_Reque::endOnThreadCb::testCase,
-	&ISR_Reque::changeSize::testCase,
-#ifdef _DEBUG
-	&ISR_Reque::invalidAddresses::testCase, // addresses only checked in UDEB
-#endif
-#ifdef _REMOVEDTEST
-	// This test case is currently caught by a FAULT instead of a return code
-	// as expected. Currently, the facility to return an error code to the test
-	// framework is not yet supported.
-	&ISR_Reque::multipleFragments::testCase, 
-#endif
-};
-
-static TTestCase* StaticMultipartTestArray[] = {
-	&Multipart::testCase,
-};
-
-static TTestCase* StaticIsrAndDfcTestArray[] = {
-	&IsrAndDfc::DfcBeforeIsr::testCase,
-	&IsrAndDfc::IsrBeforeDfc::testCase,
-};
-
-static TTestCase* Static2DTestArray[] = {
-	&_2D_Test::testCase2d
-};
-
-static TTestCase* StaticFragmentTestArray[] = {
-	&FragmentationCount::testCase,
-	&FragmentationCount::testCase2,
-	&SmallFrags::testCase,
-	&Fragment_1::testCase,
-	&Fragment_1::testCaseConcurrent,
-	&Fragment_2::testCase,
-	&Fragment_2::testCaseConcurrent,
-	&Fragment_3::testCase,
-	&Fragment_3::testCaseConcurrent,
-	&Fragment_4::testCase,
-	&Fragment_4::testCaseConcurrent,
-	&Fragment_5::testCase,
-	&Fragment_5::testCaseConcurrent,
-};
-
-static TTestCase* StaticBenchmarkTestArray[] = {
-	// Benchmarks are only really meaningful
-	// on UREL builds
-	&Benchmark::Frag::testCase_256K,
-	&Benchmark::Frag::testCase_8K,
-	&Benchmark::Transfer::_128K::testCase_128,
-	&Benchmark::Transfer::_128K::testCase_16,
-	&Benchmark::Transfer::_128K::testCase_4,
-	&Benchmark::Transfer::_128K::testCase_1,
-	&Benchmark::Transfer::_4Bytes::testCase,
-	&Benchmark::Transfer::_4MB::testCase,
-	&Benchmark::CompareIsrDfcCb::Dfc::_4Bytes::testCase,
-	&Benchmark::CompareIsrDfcCb::Isr::_4Bytes::testCase,
-	&Benchmark::CompareIsrDfcCb::Dfc::_4K::testCase,
-	&Benchmark::CompareIsrDfcCb::Isr::_4K::testCase,
-};
-
-static TTestCase* StaticRequestTestArray[] = {
-	&DDmaRequest_1::testCase,
-	&DDmaRequest_1::testCaseConcurrent,
-	&DDmaRequest_2::testCase,
-	&DDmaRequest_2::testCaseConcurrent,
-};
-
-static TTestCase* StaticChannelTestArray[] = {
-	&CloseApiTest::testCaseCloseApi,
-	&OpenApiTest::testCaseOpenApi,
-};
-
-static TTestCase* StaticSuspendTestArray[] = {
-	&PauseResumeApiTest::testCasePauseResume,  
-	&PauseResumeApiNegTest::testCasePauseResumeNeg,
-};
-
-static TTestCase* StaticQueueTestArray[] = {
-	&CancelAllTest::testCase, 
-	&IsQueueEmptyTest::testCase,	
-};
-
-//Append new test cases here
-static TTestCase* StaticTestArray[] = {
-	&Simple_1::testCase,
-	&Simple_1::testCaseConcurrent,	
-	&Callback::testCase,
-	&Callback::testCaseOldRequest,
-	&ISR_Reque::endOnRedo::testCase,
-	&ISR_Reque::endOnIsrCb::testCase,
-	&ISR_Reque::endOnThreadCb::testCase,
-	&ISR_Reque::changeSize::testCase,
-#ifdef _DEBUG
-	&ISR_Reque::invalidAddresses::testCase, // addresses only checked in UDEB
-#endif
-#ifdef _REMOVEDTEST
-	// This test case is currently caught by a FAULT instead of a return code
-	// as expected. Currently, the facility to return an error code to the test
-	// framework is not yet supported.
-	&ISR_Reque::multipleFragments::testCase, 
-#endif
-	&Multipart::testCase,
-	&IsrAndDfc::DfcBeforeIsr::testCase,
-	&IsrAndDfc::IsrBeforeDfc::testCase,
-	&_2D_Test::testCase2d,
-	&FragmentationCount::testCase,
-	&FragmentationCount::testCase2,
-	&FragmentationCount::testCase3,
-	&SmallFrags::testCase,
-#ifndef _DEBUG
-	// Benchmarks are only really meaningful
-	// on UREL builds
-	&Benchmark::Frag::testCase_256K,
-	&Benchmark::Frag::testCase_8K,
-	&Benchmark::Transfer::_128K::testCase_128,
-	&Benchmark::Transfer::_128K::testCase_16,
-	&Benchmark::Transfer::_128K::testCase_4,
-	&Benchmark::Transfer::_128K::testCase_1,
-	&Benchmark::Transfer::_4Bytes::testCase,
-	&Benchmark::Transfer::_4MB::testCase,
-	&Benchmark::CompareIsrDfcCb::Dfc::_4Bytes::testCase,
-	&Benchmark::CompareIsrDfcCb::Isr::_4Bytes::testCase,
-	&Benchmark::CompareIsrDfcCb::Dfc::_4K::testCase,
-	&Benchmark::CompareIsrDfcCb::Isr::_4K::testCase,
-#endif
-	&Fragment_1::testCase,
-	&Fragment_1::testCaseConcurrent,
-	&Fragment_2::testCase,
-	&Fragment_2::testCaseConcurrent,
-	&Fragment_3::testCase,
-	&Fragment_3::testCaseConcurrent,
-	&Fragment_4::testCase,
-	&Fragment_4::testCaseConcurrent,
-	&Fragment_5::testCase,
-	&Fragment_5::testCaseConcurrent,	
-	&DDmaRequest_1::testCase,
-	&DDmaRequest_1::testCaseConcurrent,
-	&DDmaRequest_2::testCase,
-	&DDmaRequest_2::testCaseConcurrent,
-	&CloseApiTest::testCaseCloseApi,
-	&OpenApiTest::testCaseOpenApi,
-	&PauseResumeApiTest::testCasePauseResume,  
-	&PauseResumeApiNegTest::testCasePauseResumeNeg,	
-	&CancelAllTest::testCase,
-	&IsQueueEmptyTest::testCase,
-	&ChannelLinkingTest::testCaseChannelLinking,
-	&ElementCountingTest::testCaseElementCounting,
-};
-
-RPointerArray<TTestCase> TestArray(StaticTestArray, ARRAY_LENGTH(StaticTestArray));
-RPointerArray<TTestCase> TestArrayIsrAndDfc(StaticIsrAndDfcTestArray, ARRAY_LENGTH(StaticIsrAndDfcTestArray));
-RPointerArray<TTestCase> TestArraySimple(StaticSimpleTestArray, ARRAY_LENGTH(StaticSimpleTestArray));
-RPointerArray<TTestCase> TestArrayQueue(StaticQueueTestArray, ARRAY_LENGTH(StaticQueueTestArray));
-RPointerArray<TTestCase> TestArrayChannel(StaticChannelTestArray, ARRAY_LENGTH(StaticChannelTestArray));
-RPointerArray<TTestCase> TestArraySuspend(StaticSuspendTestArray, ARRAY_LENGTH(StaticSuspendTestArray));
-RPointerArray<TTestCase> TestArrayFragment(StaticFragmentTestArray, ARRAY_LENGTH(StaticFragmentTestArray));
-RPointerArray<TTestCase> TestArrayBenchmark(StaticBenchmarkTestArray, ARRAY_LENGTH(StaticBenchmarkTestArray));
-RPointerArray<TTestCase> TestArray2DTest(Static2DTestArray, ARRAY_LENGTH(Static2DTestArray));
-RPointerArray<TTestCase> TestArrayMultiPart(StaticMultipartTestArray, ARRAY_LENGTH(StaticMultipartTestArray));
-RPointerArray<TTestCase> TestArrayIsrReque(StaticIsrRequeTestArray, ARRAY_LENGTH(StaticIsrRequeTestArray));
-RPointerArray<TTestCase> TestArrayCallback(StaticCallbackTestArray, ARRAY_LENGTH(StaticCallbackTestArray));
-RPointerArray<TTestCase> TestArrayRequest(StaticRequestTestArray, ARRAY_LENGTH(StaticRequestTestArray));
--- a/kerneltest/e32test/dmav2/test_thread.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,219 +0,0 @@
-/*
-* Copyright (c) 2009-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"
-* 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 test_thread.h
-*
-*/
-#include "test_thread.h"
-
-TInt TTestRemote::iCount=0;
-
-TInt TTestRemote::RunFunctor(TAny* aFunctor)
-	{
-	TFunctor& functor = *(TFunctor*)aFunctor;
-	functor();
-	return KErrNone;
-	}
-
-TTestThread::TTestThread(const TDesC& aName, TThreadFunction aFn, TAny* aData, TBool aAutoResume)
-	{
-	Init(aName, aFn, aData, aAutoResume);
-	}
-
-TTestThread::TTestThread(const TDesC& aName, TFunctor& aFunctor, TBool aAutoResume)
-	{
-	Init(aName, RunFunctor, &aFunctor, aAutoResume);
-	}
-
-TTestThread::~TTestThread()
-	{
-	iThread.Close();
-	}
-
-void TTestThread::Resume()
-	{
-	iThread.Resume();
-	}
-
-TInt TTestThread::WaitForExitL()
-	{
-	User::WaitForRequest(iLogonStatus);
-	const TInt exitType = iThread.ExitType();
-	const TInt exitReason = iThread.ExitReason();
-
-	__ASSERT_ALWAYS(exitType != EExitPending, User::Panic(_L("TTestThread"),0));
-
-	if(exitType != EExitKill)
-		User::Leave(exitReason);
-
-	return exitReason;
-	}
-
-void TTestThread::Rendezvous(TRequestStatus& aStatus)
-	{
-	iThread.Rendezvous(aStatus);
-	}
-
-void TTestThread::Init(const TDesC& aName, TThreadFunction aFn, TAny* aData, TBool aAutoResume)
-	{
-	TKName name(aName);
-	name.AppendFormat(_L("-%d"), iCount++);
-	TInt r=iThread.Create(name, aFn, KDefaultStackSize, KHeapSize, KHeapSize, aData);
-	if(r!=KErrNone)
-		{
-		RDebug::Printf("RThread::Create failed, code=%d", r);
-		User::Panic(KPanicCat, EThreadCreateFailed);
-		}
-
-	iThread.Logon(iLogonStatus);
-	__ASSERT_ALWAYS(iLogonStatus == KRequestPending, User::Panic(_L("TTestThread"),0));
-
-	if(aAutoResume)
-		iThread.Resume();
-	}
-
-
-CTest::~CTest()
-	{
-	iName.Close();
-	}
-
-void CTest::SetupL()
-	{
-	}
-
-void CTest::operator()()
-	{
-	for(TInt i=0; i<iIterations; i++)
-		{
-		RunTest();
-		}
-	}
-
-
-void CTest::Announce() const
-{
-	RDebug::RawPrint(_L("Test: "));
-	PrintTestInfo();
-	RDebug::RawPrint(_L(": "));
-	PrintTestType();
-	RDebug::RawPrint(_L(": "));
-	RDebug::RawPrint(iName);
-	RDebug::RawPrint(_L(": "));
-	RDebug::Printf("(%d iterations)", iIterations);
-}
-
-
-void CTest::PrintTestInfo() const
-	{
-	}
-const TDesC& CTest::Name() const
-	{
-	return iName;
-	}
-
-CTest::CTest(const TDesC& aName, TInt aIterations)
-	:iIterations(aIterations)
-	{
-	iName.CreateL(aName);
-	}
-
-CTest::CTest(const CTest& aOther)
-	:iIterations(aOther.iIterations)
-	{
-	iName.CreateL(aOther.iName);
-	}
-
-void MultipleTestRun(RTest& test, const CTest& aTest, TInt aNumberOfThreads)
-	{
-	RPointerArray<CTest> testArray;
-	RPointerArray<TTestThread> threadArray;
-
-	for(TInt i=0; i<aNumberOfThreads; i++)
-		{
-		test.Next(_L("Create test thread"));
-		CTest* newTest = aTest.Clone();
-		test_NotNull(newTest);
-
-		TTestThread* thread = new TTestThread(aTest.Name(), *newTest);
-		test_NotNull(thread);
-
-		threadArray.AppendL(thread);
-		testArray.AppendL(newTest);
-		}
-
-	const TInt count = threadArray.Count();
-	for(TInt j=0; j<count; j++)
-		{
-		TTestThread* thread = threadArray[0];
-		
-		TInt r = KErrNone;
-		TRAPD(leaveCode, r = thread->WaitForExitL());
-		if(leaveCode != KErrNone)
-			{
-			test.Printf(_L("Thread %d: Panic code:%d\n"), j, leaveCode);
-			test_KErrNone(leaveCode);
-			}
-
-		if(r!=KErrNone)
-			{
-			test.Printf(_L("Thread Number %d\n"), j);
-			test_KErrNone(r);
-			}
-
-		threadArray.Remove(0);
-		delete thread;
-		}
-	threadArray.Close();
-
-	testArray.ResetAndDestroy();
-	testArray.Close();
-	}
-
-/**
-Runs each CTest in aTests in its own thread
-Returns once all threads have terminated
-*/
-void MultipleTestRun(const RPointerArray<CTest>& aTests)
-	{
-	RTest test(_L("CTest::MultipleTestRun"));
-	RPointerArray<TTestThread> threads;
-
-	const TInt count = aTests.Count();
-
-	TInt i;
-	for(i=0; i<count; i++)
-		{
-		_LIT(KDmaTestThread, "DMA-test-thread");
-		TTestThread* thread = new TTestThread(KDmaTestThread, *aTests[i], EFalse);
-		test_NotNull(thread);
-		TInt r = threads.Append(thread);
-		test_KErrNone(r);
-		}
-
-	for(i=0; i<count; i++)
-		{
-		threads[i]->Resume();
-		}
-
-
-	for(i=0; i<count; i++)
-		{
-		TInt r = threads[i]->WaitForExitL();
-		test_KErrNone(r);
-		}
-
-	threads.ResetAndDestroy();
-	test.Close();
-	}
--- a/kerneltest/e32test/dmav2/test_thread.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-/*
-* 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 "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: Some helper classes to assist with writing multi-threaded tests
-*
-*/
-
-
-#ifndef __TEST_THREAD_H__
-#define __TEST_THREAD_H__
-
-#include <e32base.h>
-#include <e32debug.h>
-#define __E32TEST_EXTENSION__
-#include <e32test.h>
-#include <e32cmn_private.h>
-
-_LIT(KPanicCat, "test_thread.h");
-
-
-static const TInt KHeapSize=0x2000;
-
-enum TPanicCode
-	{
-	EThreadCreateFailed
-	};
-
-/**
-A utility class for running functions in other threads/processes
-*/
-class TTestRemote
-	{
-public:
-	virtual TInt WaitForExitL() = 0;
-	virtual ~TTestRemote()
-		{}
-
-	virtual void Rendezvous(TRequestStatus& aStatus) = 0;
-
-protected:
-	TTestRemote()
-		{}
-
-	static TInt RunFunctor(TAny* aFunctor);
-
-	TRequestStatus iLogonStatus;
-	static TInt iCount;
-	};
-
-class TTestThread : public TTestRemote
-	{
-public:
-	TTestThread(const TDesC& aName, TThreadFunction aFn, TAny* aData, TBool aAutoResume=ETrue);
-
-	/**
-	Run aFunctor in another thread
-	*/
-	TTestThread(const TDesC& aName, TFunctor& aFunctor, TBool aAutoResume=ETrue);
-
-	~TTestThread();
-
-	void Resume();
-
-	/**
-	If thread exited normally, return its return code
-	Otherwise, leave with exit reason
-	*/
-	virtual TInt WaitForExitL();
-
-	virtual void Rendezvous(TRequestStatus& aStatus);
-
-private:
-	void Init(const TDesC& aName, TThreadFunction aFn, TAny* aData, TBool aAutoResume);
-
-	RThread iThread;
-	};
-
-class CTest : public CBase, public TFunctor
-	{
-public:
-	virtual ~CTest();
-
-	virtual void operator()();
-	virtual void RunTest() = 0;
-	virtual CTest* Clone() const = 0;
-
-	virtual void SetupL();
-
-	/**
-	Prints a formatted description of the test
-	*/
-	virtual void Announce() const;
-
-	const TDesC& Name() const;
-
-	/**
-	Should print the type of test, with no newlines.
-	eg. "Transfer", "Fragmentation"
-	*/
-	virtual void PrintTestType() const = 0;
-
-	/**
-	Display any information about test environment, with no newlines
-	eg. "DMA channel 16"
-	The base class version prints nothing.
-	*/
-	virtual void PrintTestInfo() const;
-
-protected:
-	CTest(const TDesC& aName, TInt aIterations);
-	CTest(const CTest& aOther);
-
-	//It would be useful to have an RTest member, but this can't be
-	//initialised untill the new thread is running as it will refer to
-	//the creating thread
-	RBuf iName;
-	const TInt iIterations;
-	};
-
-/**
-Make aNumberOfThreads copies of aTest and run
-each in its own thread
-
-@param test Reference to test object
-@param aTest Referance
-*/
-void MultipleTestRun(RTest& test, const CTest& aTest, TInt aNumberOfThreads);
-
-void MultipleTestRun(const RPointerArray<CTest>& aTests);
-#endif // #ifndef __TEST_THREAD_H__
-
--- a/kerneltest/e32test/domainmgr/dm_autoexec.bat	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-@rem
-@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-@rem All rights reserved.
-@rem This component and the accompanying materials are made available
-@rem under the terms of the License "Eclipse Public License v1.0"
-@rem which accompanies this distribution, and is available
-@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
-@rem
-@rem Initial Contributors:
-@rem Nokia Corporation - initial contribution.
-@rem
-@rem Contributors:
-@rem
-@rem Description:
-@rem
-
-trace 2 2
-z:
-cd \test
-runtests dmtest.auto.bat -t 60 -p -st -c
--- a/kerneltest/e32test/domainmgr/dm_tests.iby	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-// 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:
-// Domain Manager Tests
-//
-
-#ifndef __DM_TEST_IBY__
-#define __DM_TEST_IBY__
-
-
-file=\Epoc32\Release\##MAIN##\##BUILD##\t_domain.exe				\sys\bin\t_domain.exe
-file=\Epoc32\Release\##MAIN##\##BUILD##\t_domain_slave.exe			\sys\bin\t_domain_slave.exe
-file=\Epoc32\Release\##MAIN##\##BUILD##\domainpolicy99.dll			\sys\bin\domainpolicy99.dll
-
-
-data=\epoc32\rom\include\dmtest.auto.bat				\test\dm.auto.bat
-
-#if defined(DM_AUTO_ROM)
-data=\epoc32\rom\include\dm_autoexec.bat				\autoexec.bat
-#endif
-
-
-
-#endif // __DM_TEST_IBY__
--- a/kerneltest/e32test/domainmgr/dmtest.auto.bat	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-@rem
-@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-@rem All rights reserved.
-@rem This component and the accompanying materials are made available
-@rem under the terms of the License "Eclipse Public License v1.0"
-@rem which accompanies this distribution, and is available
-@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
-@rem
-@rem Initial Contributors:
-@rem Nokia Corporation - initial contribution.
-@rem
-@rem Contributors:
-@rem
-@rem Description:
-@rem
-
-t_domain
--- a/kerneltest/e32test/domainmgr/domainpolicy99.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-// 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:
-// e32test/domainmgr/domainpolicy99.mmp
-// domainpolicy99.dll Test Domain manager policy module
-// 
-//
-
-/**
- @file
-*/
-
-
-TARGET          domainpolicy99.dll
-CAPABILITY PowerMgmt ProtServ DiskAdmin
-TARGETTYPE      dll
-
-userinclude		.
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-sourcepath	.
-source		domainpolicytest.cpp
-
-library		euser.lib
-
-
-START WINS
-END
-
-START MARM
-END
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/kerneltest/e32test/domainmgr/domainpolicytest.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +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:
-//
-
-#include <domainpolicy.h>
-#include "domainpolicytest.h"
-
-const TInt KDomainTimeout = 2000000; /* 2000ms */
-
-static const TDmDomainSpec DomainHierarchy[] = 
-	{
-		{ KDmIdRoot,	KDmIdNone,	_INIT_SECURITY_POLICY_C1(ECapabilityWriteDeviceData),		EStartupCriticalStatic,	KDomainTimeout	},
-
-		// row 1		
-		{ KDmIdTestA,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		{ KDmIdTestB,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		{ KDmIdTestC,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-
-		// row 2
-		{ KDmIdTestAA,	KDmIdTestA,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		{ KDmIdTestAB,	KDmIdTestA,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		{ KDmIdTestBA,	KDmIdTestB,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		{ KDmIdTestCA,	KDmIdTestC,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		
-		// row 3
-		{ KDmIdTestABA,	KDmIdTestAB,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		{ KDmIdTestABB,	KDmIdTestAB,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		{ KDmIdTestCAA,	KDmIdTestCA,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-
-		// end of array marker
-		{ KDmIdNone,	KDmIdNone,	_INIT_SECURITY_POLICY_PASS,	0,	0	}
-	};
-static const TDmHierarchyPolicy HierarchyPolicy	= 
-	{ETraverseParentsFirst, ETraverseChildrenFirst, ETransitionFailureStop};
-	
-
-
-/**
-Gets access to the test hierarchy specification.
-
-The domain hierarchy specification is a simple array of TDmDomainSpec items.
-
-The default implementation provided by Symbian OS just returns a pointer to
-the domain hierarchy specification array.
-
-@return A pointer to the domain hierarchy specification array.
-*/
-EXPORT_C const TDmDomainSpec* DmPolicy::GetDomainSpecs()
-	{
-	return (TDmDomainSpec*) DomainHierarchy;
-	}
-
-
-
-
-/**
-Releases access to the specified domain hierarchy specification.
-
-The domain hierarchy specification is a simple array of TDmDomainSpec items.
-
-As the default Symbian OS implementation of GetDomainSpecs() just returns
-a pointer to the domain hierarchy specification array, then the default
-implementation of Release() is empty. The API is provided to permit
-more complex implementations, if required.
-
-@param aDomainSpec A pointer to the domain hierarchy specification array.
-*/
-EXPORT_C void DmPolicy::Release(const TDmDomainSpec* /*aDomainSpec*/)
-	{
-	}
-
-
-/**
-Retrieves the domain hierarchy policy 
-
-@param	aPolicy a client-supplied policy which on exit
-		will contain a copy of the policy for the requested domain hierarchy id.
-
-  
-@return	KErrNone
-*/
-EXPORT_C TInt DmPolicy::GetPolicy(TDmHierarchyPolicy& aPolicy)
-	{
-	aPolicy = HierarchyPolicy;
-	return KErrNone;
-	}
-
--- a/kerneltest/e32test/domainmgr/domainpolicytest.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +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:
-//
-
-#ifndef __DOMAIN_POLICY_TEST_H__
-#define __DOMAIN_POLICY_TEST_H__
-
-// The test domain hierarchy id 
-
-static const TDmHierarchyId	KDmHierarchyIdTest = 99;
-
-/*
-Domains defined in this hiearchy
-The hierarchy desribed here looks like this:
-		Root
-		A				B				C
-		AA	AB			BA				CA
-			ABA	ABB						CAA
-
-*/
-static const TDmDomainId	KDmIdTestA		= 0x02;
-static const TDmDomainId	KDmIdTestB		= 0x03;
-static const TDmDomainId	KDmIdTestC		= 0x04;
-
-static const TDmDomainId	KDmIdTestAA		= 0x05;
-static const TDmDomainId	KDmIdTestAB		= 0x06;
-static const TDmDomainId	KDmIdTestBA		= 0x07;
-static const TDmDomainId	KDmIdTestCA		= 0x08;
-
-static const TDmDomainId	KDmIdTestABA	= 0x09;
-static const TDmDomainId	KDmIdTestABB	= 0x0A;
-static const TDmDomainId	KDmIdTestCAA	= 0x0B;
-static const TInt KTestDomains = 0x0B;	// number of domains including root
-
-
-/*
-System-wide start-up states
-
-Some of these states may be ommitted depending on the start-up mode.
-E.g. The system-starter might choose to omit EStartupNonCritical in "safe" mode
-*/
-enum TStartupState
-	{
-	/** In this state, all ROM based (static) components or resources that 
-	are critical to the operation of the phone are started */
-	EStartupCriticalStatic,
-
-	/** In this state, all non-ROM based (dynamic) components or resources that 
-	are critical to the operation of the phone are started */
-	EStartupCriticalDynamic,
-
-	/** In this state, all ROM based (static) or non-ROM based (dynamic) 
-	components or resources that are not critical to the operation of the phone 
-	are started */
-	EStartupNonCritical,
-
-	/** An integer that is strictly greater thean any legal start-up state value */
-	EStartupLimit
-	};
-
-#endif
-
--- a/kerneltest/e32test/domainmgr/t_domain.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2266 +0,0 @@
-// 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:
-// e32test\power\t_domain.cpp
-// Overview:
-// Domain manager tests
-// API Information:
-// RDmDomain, RDmDomainManager CDmDomain, CDmDomainManager
-// Details:
-// - Test a variety of domain transitions, check the expected number of
-// notifications and the first expected ordinal. Verify results are
-// as expected.
-// - Test system standby, check the expected number of notifications and 
-// the first expected ordinal. Use a timer to request a wakeup event.
-// Verify results are as expected.
-// - Test domain related simple error situations, verify results are
-// as expected.
-// - Perform platform security tests: launch a separate process with no 
-// capabilities, verify that results are as expected.
-// - Test domain transitions by connecting to two domain hierarchies 
-// simultaneously, add some test and power hierarchy members, verify
-// the expected target state, notifications and leaf nodes. Verify results.
-// - Verify that the same hierarchy can not be connected to more than once.
-// - Request a positive transition and request that the test domain use 
-// ETraverseParentsFirst. Verify results are as expected and verify 
-// domains are in the correct state.
-// - Request a negative transition and request that the test domain use 
-// ETraverseChildrenFirst. Verify results are as expected.
-// - Request a positive transition with zero acknowledgements. Verify 
-// results are as expected.
-// - Request a positive transition with error acknowledgements. Verify 
-// results are as expected.
-// - Perform a variety of negative tests and verify results are as expected.
-// - Perform various tests on domain transitions with activated observer.
-// Verify results are as expected.
-// Platforms/Drives/Compatibility:
-// All.
-// Assumptions/Requirement/Pre-requisites:
-// Failures and causes:
-// Base Port information:
-// 
-//
-
-#include <e32test.h>
-#include <domainmember.h>
-#include <domainmanager.h>
-#include <domainobserver.h>
-#include "domainpolicytest.h"
-#include <e32debug.h>
-#include <f32file.h>
-#include <e32ldr.h>
-#include <e32ldr_private.h>
-
-LOCAL_D RTest test(_L(" T_DOMAIN "));
-_LIT(KThreadName, "t_domain_panic_thread");
-
-#ifdef _DEBUG
-#define __PRINT(x) {RDebug::Print x;}
-#else
-#define __PRINT(x) 
-#endif
-
-class CDmTestMember;
-
-// interface for test domain memebers.
-// Any test memeber should derive from this interface 
-class MDmDomainMember
-	{
-public:
-	virtual TDmHierarchyId HierarchyId() = 0;
-	virtual TDmDomainId	DomainId() = 0;
-	virtual TDmDomainState State() = 0;
-	virtual TInt Status() = 0;
-	virtual TUint32 Ordinal() = 0;
-	virtual TInt Notifications() = 0;
-	};
-
-class MDmTest
-	{
-public:
-	virtual void Perform() = 0;
-	virtual void Release() = 0;
-	virtual TInt TransitionNotification(MDmDomainMember& aDomainMember) = 0;
-	virtual void TransitionRequestComplete() = 0;
-	};
-
-// for the test hierarchy, we generate an ordinal for each domain
-// each byte of which describes the exact location of the domain in the hierarchy
-#define ORDINAL_FROM_DOMAINID0(id) (id)
-#define ORDINAL_FROM_DOMAINID1(parent, id) ((parent << 8) | (id))
-#define ORDINAL_FROM_DOMAINID2(grandparent, parent, id) ((grandparent << 16) | (parent << 8) | id)
-#define ORDINAL_FROM_DOMAINID3(greatgrandparent, grandparent, parent, id) ((greatgrandparent << 24) | (grandparent << 16) | (parent << 8) | id)
-#define PARENT_ORDINAL(id) (id >> 8)
-
-#define ORDINAL_LEVEL(ordinal)			\
-	((ordinal & 0xFF00) == 0) ? 1 :			\
-	((ordinal & 0xFF0000) == 0) ? 2 :		\
-	((ordinal & 0xFF000000) == 0) ? 3 : 4;
-
-
-// get the least significant domain id character (for debugging purposes)
-TBool GetDomainChar(TDmDomainId aDomainId, TChar& aChar)
-	{
-	TBool found = ETrue;
-	switch(aDomainId)
-		{
-		
-		case KDmIdTestA:	aChar = 'A'; break;
-		case KDmIdTestB:	aChar = 'B'; break;
-		case KDmIdTestC:	aChar = 'C'; break;
-		case KDmIdTestAA:	aChar = 'A'; break;
-		case KDmIdTestAB:	aChar = 'B'; break;
-		case KDmIdTestBA:	aChar = 'A'; break;
-		case KDmIdTestCA:	aChar = 'A'; break;
-		case KDmIdTestABA:	aChar = 'A'; break;
-		case KDmIdTestABB:	aChar = 'B'; break;
-		case KDmIdTestCAA:	aChar = 'A'; break;
-		// domain char not found 
-		case KDmIdNone:
-		case KDmIdRoot:		
-		default:			
-			found = EFalse;
-		}
-	return found;
-	}
-
-// prints the 4-character domain string into the passed descriptor (for debugging purposes)
-// e.g. "CAA" for KDmIdTestCAA
-void GetDomainDesc(TUint32 aOrdinal, TDes& aDes)
-	{
-	if (aOrdinal == KDmIdRoot)
-		{
-		aDes.Append(_L("root"));
-		return;
-		}
-
-	TUint32 val =  aOrdinal;
-
-	for (TInt n=0; n<4; n++)
-		{
-		TDmDomainId domainId = (TDmDomainId) (val >> 24);
-		TChar ch;
-		TBool found = GetDomainChar(domainId, ch);
-		if (found)
-			aDes.Append(ch);
-		val = val << 8;
-		}
-
-	}
-
-
-class CDmTestMember : public CActive, public MDmDomainMember
-	{
-public:	
-	// from CActive
-	void RunL();
-	// from MDmDomainMember
-	inline TDmHierarchyId HierarchyId() {return iHierarchy;};
-	inline TDmDomainId	DomainId() {return iId;};
-	inline TDmDomainState State() {return iState;};
-	inline TInt Status() {return iStatus.Int();};
-	inline TUint32 Ordinal() {return iOrdinal;};
-	inline TInt Notifications() {return iNotifications;};
-
-	CDmTestMember(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest*);
-	~CDmTestMember();
-	void Acknowledge();
-
-protected:
-	// from CActive
-	virtual void DoCancel();
-
-
-public:
-	TDmHierarchyId iHierarchy;
-	TDmDomainId	iId;
-	TDmDomainState iState;
-	TUint32		iOrdinal;
-	MDmTest*	iTest;	
-	TInt		iNotifications;
-	RDmDomain	iDomain;
-	};
-
-
-
-CDmTestMember::CDmTestMember(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest* aTest) : CActive(CActive::EPriorityStandard), 
-	iHierarchy(aHierarchy), iId(aId), iOrdinal(aOrdinal), iTest(aTest)
-	{
-	TInt r;
-
-	if (iHierarchy == KDmHierarchyIdPower)
-		 r = iDomain.Connect(iId);
-	else
-		 r = iDomain.Connect(iHierarchy, iId);
-
-	test(r == KErrNone);
-
-	CActiveScheduler::Add(this);
-
-	iDomain.RequestTransitionNotification(CActive::iStatus);
-	CActive::SetActive();
-	}
-
-CDmTestMember::~CDmTestMember()
-	{
-	CActive::Cancel();
-	iDomain.Close();
-	}
-
-void CDmTestMember::Acknowledge()
-	{
-	iDomain.AcknowledgeLastState();
-	}
-
-void CDmTestMember::RunL()
-	{
-
-	iNotifications++;
-
-	iState = iDomain.GetState();
-
-	TInt ackError = iTest->TransitionNotification(*this);
-	if (ackError == KErrNone)
-		iDomain.AcknowledgeLastState();
-	else if (ackError == KErrAbort)	// don't acknowledge
-		;
-	else
-		iDomain.AcknowledgeLastState(ackError);
-
-	
-	// request another notification (even if we didn't acknowledge the last one)
-	iDomain.RequestTransitionNotification(CActive::iStatus);
-	CActive::SetActive();
-	}
-
-void CDmTestMember::DoCancel()
-	{
-	iDomain.CancelTransitionNotification();
-	}
-
-
-// CDomainMemberAo
-class CDomainMemberAo : public CDmDomain, public MDmDomainMember
-	{
-public:	
-	static CDomainMemberAo* NewL(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest*);
-	~CDomainMemberAo();
-
-	// from CActive
-	void RunL();
-
-	// from MDmDomainMember
-	inline TDmHierarchyId HierarchyId() {return iHierarchy;};
-	inline TDmDomainId	DomainId() {return iId;};
-	inline TDmDomainState State() {return iState;};
-	inline TInt Status() {return iStatus.Int();};
-	inline TUint32 Ordinal() {return iOrdinal;};
-	inline TInt Notifications() {return iNotifications;};
-
-private:
-	CDomainMemberAo(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest*);
-
-public:
-	TDmHierarchyId iHierarchy;
-	TDmDomainId	iId;
-	TDmDomainState iState;
-	TUint32		iOrdinal;
-	MDmTest*	iTest;	
-	TInt		iNotifications;
-	};
-
-CDomainMemberAo* CDomainMemberAo::NewL(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest* aTest)
-	{
-	CDomainMemberAo* self=new (ELeave) CDomainMemberAo(aHierarchy, aId, aOrdinal, aTest);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-
-	self->RequestTransitionNotification();
-
-	CleanupStack::Pop();
-	return self;
-	}
-
-CDomainMemberAo::CDomainMemberAo(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest* aTest) : 
-	CDmDomain(aHierarchy, aId), 
-	iHierarchy(aHierarchy), iId(aId), iOrdinal(aOrdinal), iTest(aTest)
-	{
-	}
-
-CDomainMemberAo::~CDomainMemberAo()
-	{
-	Cancel();
-	}
-
-void CDomainMemberAo::RunL()
-	{
-	iNotifications++;
-
-	iState = GetState();
-
-	TInt ackError = iTest->TransitionNotification(*this);
-	if (ackError == KErrNone)
-		AcknowledgeLastState(ackError);
-	else if (ackError == KErrAbort)	// don't acknowledge
-		;
-	else
-		AcknowledgeLastState(ackError); 
-	if (ackError != KErrAbort)	
-		AcknowledgeLastState(ackError);
-
-	
-	// request another notification (even if we didn't acknowledge the last one)
-	RequestTransitionNotification();
-	}
-
-
-// CDomainManagerAo
-class CDomainManagerAo : public CDmDomainManager
-	{
-public:	
-	~CDomainManagerAo();
-	static CDomainManagerAo* NewL(TDmHierarchyId aHierarchy, MDmTest& aTest);
-
-	// from CActive
-	void RunL();
-
-private:
-	CDomainManagerAo(TDmHierarchyId aHierarchy, MDmTest& aTest);
-
-private:
-	MDmTest& iTest;
-	};
-
-
-CDomainManagerAo* CDomainManagerAo::NewL(TDmHierarchyId aHierarchy, MDmTest& aTest)
-	{
-	CDomainManagerAo* self=new (ELeave) CDomainManagerAo(aHierarchy, aTest);
-	CleanupStack::PushL(self);
-
-	self->ConstructL();
-	CleanupStack::Pop();
-	return self;
-	}
-
-CDomainManagerAo::CDomainManagerAo(TDmHierarchyId aHierarchy, MDmTest& aTest) : 
-	CDmDomainManager(aHierarchy), iTest(aTest)
-	{
-	}
-
-CDomainManagerAo::~CDomainManagerAo()
-	{
-	}
-
-void CDomainManagerAo::RunL()
-	{
-	iTest.TransitionRequestComplete();
-	}
-
-
-class CDmTest1 : public CActive, public MDmTest
-	{
-public: // from CActive
-	void RunL();
-
-	// from MDmTest
-	void Perform();
-	void Release();
-	TInt TransitionNotification(MDmDomainMember& aDomainMember);
-	void TransitionRequestComplete() {};
-
-	CDmTest1 (TDmDomainId aId, TDmDomainState aState) : CActive(CActive::EPriorityStandard), iDomainId(aId), iState((TPowerState) aState) {}
-
-protected:
-	// from CActive
-	virtual void DoCancel();
-
-private:
-	enum { KMembersMax = 16 };
-	CDmTestMember*		iMembers[KMembersMax]; 
-	RDmDomainManager	iManager;
-	TDmDomainId			iDomainId;
-	TPowerState			iState;
-	TBool				iAcknowledge;
-	TInt				iMembersCount;
-	TInt				iCount;
-	TUint32				iOrdinal;
-	};
-
-void CDmTest1::Perform()
-	{
-	//
-	// Test domain transitions
-	//
-
-	test.Next(_L("Test 1"));
-	test.Printf(_L("Domain id = 0x%x Target State = 0x%x\n"), iDomainId, iState);
-	iMembers[0] = new CDmTestMember(KDmHierarchyIdPower, KDmIdRoot, 0, this);
-	test(iMembers[0] != NULL);
-	iMembers[1] = new CDmTestMember(KDmHierarchyIdPower, KDmIdRoot, 0, this);
-	test(iMembers[1] != NULL);
-	iMembers[2] = new CDmTestMember(KDmHierarchyIdPower, KDmIdApps, 1, this);
-	test(iMembers[2] != NULL);
-	iMembers[3] = new CDmTestMember(KDmHierarchyIdPower, KDmIdApps, 1, this);
-	test(iMembers[3] != NULL);
-	iMembers[4] = new CDmTestMember(KDmHierarchyIdPower, KDmIdUiApps, 1, this);
-	test(iMembers[4] != NULL);
-	iMembers[5] = new CDmTestMember(KDmHierarchyIdPower, KDmIdUiApps, 1, this);
-	test(iMembers[5] != NULL);
-	
-	// expected number of notifications
-	iMembersCount = (iDomainId == KDmIdRoot) ? 6 : 2;
-	// first expected ordinal
-	iOrdinal = (iState == EPwActive) ? 0 : 1;
-
-	TInt r = iManager.Connect();
-	test(r == KErrNone);
-
-	CActiveScheduler::Add(this);
-
-	iManager.RequestDomainTransition(iDomainId, iState, CActive::iStatus);
-	CActive::SetActive();
-
-	CActiveScheduler::Start();
-	}
-
-TInt CDmTest1::TransitionNotification(MDmDomainMember& aDomainMember)
-	{
-	++iCount;
-	if (aDomainMember.State() == EPwActive)
-		{
-		if(aDomainMember.Ordinal() < iOrdinal)
-			{
-			// Making the test to fail in RunL function inorder to complete the cleanup from domain manager.
-			test.Printf(_L("Making test to fail as Ordinal Mismatch Expected : %d, Returned : %d"), aDomainMember.Ordinal(), iOrdinal);
-			iCount--;
-			}
-		}
-	else
-		{
-		if(aDomainMember.Ordinal() > iOrdinal)
-			{
-			//Making the test to fail in RunL function inorder to complete the cleanup from domain manager.
-			test.Printf(_L("Making test to fail as Ordinal Mismatch Expected : %d, Returned : %d"), aDomainMember.Ordinal(), iOrdinal);
-			iCount--;
-			}
-		}
-	iOrdinal = aDomainMember.Ordinal();
-
-	// acknowledge one from two
-	iAcknowledge = !iAcknowledge;
-	return iAcknowledge?KErrNone:KErrGeneral;
-	}
-
-void CDmTest1::RunL()
-	{
-	CActiveScheduler::Stop();
-
-	iManager.Close();
-
-	CDmTestMember** mp;
-	for (mp = iMembers; *mp; ++mp)
-		delete *mp;
-	test(iCount == iMembersCount);
-	}
-
-void CDmTest1::DoCancel()
-	{
-	test(0);
-	}
-
-void CDmTest1::Release()
-	{
-	delete this;
-	}
-
-class CDmTest2Timer : public CTimer
-	{
-public: // fomr CTimer
-   void RunL();
-public:
-	CDmTest2Timer() : CTimer(0) 
-		{
-		TRAPD(r,
-			ConstructL());
-		test(r == KErrNone);
-		CActiveScheduler::Add(this);
-		}
-	};
-
-void CDmTest2Timer::RunL()
-	{
-	test.Printf(_L("Tick count after CDmTest2Timer::RunL() = %d\n"), User::NTickCount());
-
-	// kick the timer again in case power down hasn't happened yet
-	TTime wakeup;
-	wakeup.HomeTime();
-	wakeup += TTimeIntervalSeconds(3);
-	At(wakeup);
-	}
-
-class CDmTest2 : public CActive, public MDmTest
-	{
-public: // from CActive
-	void RunL();
-
-	// from MDmTest
-	void Perform();
-	void Release();
-	TInt TransitionNotification(MDmDomainMember& aDomainMember);
-	void TransitionRequestComplete() {};
-	CDmTest2 (TDmDomainState aState) : CActive(CActive::EPriorityStandard), iState((TPowerState) aState) {}
-
-protected:
-	// from CActive
-	virtual void DoCancel();
-
-private:
-	enum { KMembersMax = 16 };
-	CDmTestMember*		iMembers[KMembersMax]; 
-	RDmDomainManager	iManager;
-	TPowerState			iState;
-	TBool				iAcknowledge;
-	TInt				iMembersCount;
-	TInt				iCount;
-	TUint32				iOrdinal;
-	CDmTest2Timer*		iTimer;
-	};
-
-
-void CDmTest2::Perform()
-	{
-	//
-	// Test system standby
-	//
-
-	test.Next(_L("Test 2"));
-	test.Printf(_L("Target State = 0x%x\n"), iState);
-	iMembers[0] = new CDmTestMember(KDmHierarchyIdPower, KDmIdRoot, 0, this);
-	test(iMembers[0] != NULL);
-	iMembers[1] = new CDmTestMember(KDmHierarchyIdPower, KDmIdRoot, 0, this);
-	test(iMembers[1] != NULL);
-	iMembers[2] = new CDmTestMember(KDmHierarchyIdPower, KDmIdApps, 1, this);
-	test(iMembers[2] != NULL);
-	iMembers[3] = new CDmTestMember(KDmHierarchyIdPower, KDmIdApps, 1, this);
-	test(iMembers[3] != NULL);
-	iMembers[4] = new CDmTestMember(KDmHierarchyIdPower, KDmIdUiApps, 1, this);
-	test(iMembers[4] != NULL);
-	iMembers[5] = new CDmTestMember(KDmHierarchyIdPower, KDmIdUiApps, 1, this);
-	test(iMembers[5] != NULL);
-	
-	// expected number of notifications
-	iMembersCount = 12;
-	// first expected ordinal
-	iOrdinal = (iState == EPwActive) ? 0 : 1;
-
-	TInt r = iManager.Connect();
-	test(r == KErrNone);
-
-	CActiveScheduler::Add(this);
-
-	// Use an absolute timer to request a wakeup event
-	iTimer = new CDmTest2Timer();
-	TTime wakeup;
-	wakeup.HomeTime();
-	wakeup += TTimeIntervalSeconds(5);
-	test.Printf(_L("Tick count before timer = %d\n"), User::NTickCount());
-	iTimer->At(wakeup);
-	
-	iManager.RequestSystemTransition(iState, CActive::iStatus);
-	CActive::SetActive();
-
-	CActiveScheduler::Start();
-	}
-
-TInt CDmTest2::TransitionNotification(MDmDomainMember& aDomainMember)
-	{
-	++iCount;
-	if (aDomainMember.State() == EPwActive)
-		{
-		if(aDomainMember.Ordinal() < iOrdinal)
-			{
-			// Making the test to fail in RunL function inorder to complete the cleanup from domain manager.
-			test.Printf(_L("Making test to fail as Ordinal Mismatch Expected : %d, Returned : %d, State : %d"), 
-																		aDomainMember.Ordinal(), iOrdinal, aDomainMember.State());
-			iCount--;
-			}
-		}
-	else
-		{
-		if(aDomainMember.Ordinal() > iOrdinal)
-			{
-			// Making the test to fail in RunL function inorder to complete the cleanup from domain manager.
-			test.Printf(_L("Making test to fail as Ordinal Mismatch Expected : %d, Returned : %d, State: %d"), 
-																		aDomainMember.Ordinal(), iOrdinal, aDomainMember.State());
-			iCount--;
-			}
-		}
-	iOrdinal = aDomainMember.Ordinal();
-
-	// acknowledge one from two
-	iAcknowledge = !iAcknowledge;
-	return iAcknowledge?KErrNone:KErrAbort;
-	}
-
-void CDmTest2::RunL()
-	{
-	test.Printf(_L("Tick count after CDmTest2::RunL() = %d\n"), User::NTickCount());
-
-	iTimer->Cancel();	
-	CActiveScheduler::Stop();
-
-	iManager.Close();
-
-	CDmTestMember** mp;
-	for (mp = iMembers; *mp; ++mp)
-		delete *mp;
-	test(CActive::iStatus == KErrTimedOut);
-	test(iCount == iMembersCount);
-	}
-
-void CDmTest2::DoCancel()
-	{
-	test(0);
-	}
-
-void CDmTest2::Release()
-	{
-	if (iTimer)
-		{
-		iTimer->Cancel();
-		delete iTimer;
-		}
-	delete this;
-	}
-
-class CDmTest3 : public MDmTest
-	{
-public: 
-	// from MDmTest
-	void Perform();
-	void Release();
-	TInt TransitionNotification(MDmDomainMember& aDomainMember);
-	void TransitionRequestComplete() {};
-	};
-
-void CDmTest3::Perform()
-	{
-	//
-	// Test simple error situation
-	//
-	RDmDomainManager manager;
-	TInt r = manager.Connect();
-	test(r == KErrNone);
-
-	RDmDomainManager manager1;
-	r = manager1.Connect();
-	test(r == KErrInUse);
-
-	RDmDomain domain;
-	r = domain.Connect(KDmIdNone);
-	test(r == KDmErrBadDomainId);
-	CDmTestMember*		testMember;
-	testMember = new CDmTestMember(KDmHierarchyIdPower, KDmIdApps, 1, this);
-	test (testMember != NULL);
-
-	TRequestStatus status;
-	manager.RequestDomainTransition(KDmIdApps, EPwStandby, status);
-	test(status.Int() == KRequestPending);
-
-	TRequestStatus status1;
-	manager.RequestDomainTransition(KDmIdApps, EPwActive, status1);
-	User::WaitForRequest(status1);
-	test(status1.Int() == KDmErrBadSequence);
-	User::WaitForRequest(status);
-	test(status.Int() == KErrTimedOut);
-
-	// Since this test doesn't start the active scheduler, a domain member's RunL() will 
-	// not get called so we need to re-request a domain transition notification manually
-	User::WaitForRequest(testMember->iStatus);
-	test(testMember->iStatus.Int() == KErrNone);
-	testMember->iDomain.RequestTransitionNotification(testMember->iStatus);
-
-	manager.RequestDomainTransition(KDmIdApps, EPwActive, status);
-	test(status.Int() == KRequestPending);
-	manager.CancelTransition();
-	test(status.Int() == KErrCancel);
-	manager.CancelTransition();
-	User::WaitForRequest(status);
-	test(status.Int() == KErrCancel);
-
-	testMember->iDomain.CancelTransitionNotification();
-
-	delete testMember;
-	
-	domain.Close();
-	manager.Close();
-	}
-
-TInt CDmTest3::TransitionNotification(MDmDomainMember& /*aDomainMember*/)
-	{
-	test(0);
-	return KErrAbort;	// don't acknowledge
-	}
-
-void CDmTest3::Release()
-	{
-	delete this;
-	}
-
-class CDmTest4 : public MDmTest
-	{
-public: 
-	// from MDmTest
-	void Perform();
-	void Release();
-	TInt TransitionNotification(MDmDomainMember& aDomainMember);
-	void TransitionRequestComplete() {};
-private:
-	void ExecSlave(TUint arg);
-	};
-
-_LIT(KSecuritySlavePath, "t_domain_slave.exe");
-
-void CDmTest4::ExecSlave(TUint aArg)
-	{
-	RProcess proc;
-	TInt r = proc.Create(KSecuritySlavePath, TPtrC((TUint16*) &aArg, sizeof(aArg)/sizeof(TUint16)));
-	test(r == KErrNone);
-	TRequestStatus status;
-	proc.Logon(status);
-	proc.Resume();
-	User::WaitForRequest(status);
-
-    RDebug::Printf("CDmTest4::ExecSlave(%d) ExitType %d", aArg, proc.ExitType() );
-    RDebug::Printf("CDmTest4::ExecSlave(%d) ExitReason %d", aArg, proc.ExitReason() );
-	test(proc.ExitType() == EExitKill);
-//	test(proc.ExitReason() == KErrPermissionDenied);
-
-	CLOSE_AND_WAIT(proc);
-	}
-
-//! @SYMTestCaseID PBASE-T_DOMAIN-4
-//! @SYMTestType CT
-//! @SYMTestCaseDesc Dmain manager security tests
-//! @SYMREQ 3722
-//! @SYMTestActions Launches a separate process with no capabilities
-//! @SYMTestExpectedResults  DM APIs should fail with KErrPermissionDenied
-//! @SYMTestPriority High
-//! @SYMTestStatus Defined
-void CDmTest4::Perform()
-	{
-	//
-	// Security tests
-	//
-
-	ExecSlave(0);
-
-    ExecSlave(1);
-
-	}
-
-TInt CDmTest4::TransitionNotification(MDmDomainMember& /*aDomainMember*/)
-	{
-	test(0);
-	return KErrNone;
-	}
-
-void CDmTest4::Release()
-	{
-	delete this;
-	}
-
-// Test hierarchy tests
-class CDmTestStartupMember : public CDmTestMember
-	{
-public:
-	CDmTestStartupMember(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest*);
-
-public:
-private:
-	};
-
-CDmTestStartupMember::CDmTestStartupMember(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest* aTest) 
-	: CDmTestMember(aHierarchy, aId, aOrdinal, aTest)
-	{
-	}
-
-// Simultaneously testing of test domain defined in DomainPolicy99.dll
-// and the power domain defined in DomainPolicy.dll
-class CDmTest5 : public CActive, public MDmTest
-	{
-public: 
-	// from CActive
-	void RunL();
-	// from MDmTest
-	void Perform();
-	void Release();
-	TInt TransitionNotification(MDmDomainMember& aDomainMember);
-	void TransitionRequestComplete();
-	CDmTest5(TDmDomainId aPowerId, TDmDomainId aTestId, TDmDomainState aPowerState, TDmDomainState aTestState) : 
-		CActive(CActive::EPriorityStandard), 
-		iPowerDomainId(aPowerId), iTestDomainId(aTestId), iPowerState(aPowerState), iTestState(aTestState) {}
-protected:
-	// from CActive
-	virtual void DoCancel();
-
-private:
-	enum { KMembersMax = 16 };
-	enum TAckMode{ KAckAlways, KAckNever, KAckError, KAckOddDomainsOnly };
-
-	CDmTestMember*		iTestMembers[KMembersMax]; 
-	CDomainMemberAo*	iPowerMembers[KMembersMax]; 
-
-	RDmDomainManager	iTestDomainManager;
-	
-	TDmDomainId			iPowerDomainId;
-	TDmDomainId			iTestDomainId;
-
-	TDmDomainState		iPowerState;
-	TDmDomainState		iTestState;
-
-	// level number for iTestDomainId. E.g 1 for KDmIdRoot, 2 for KDmIdTestA, etc.
-	TInt				iTestDomainLevel;	
-
-	TDmTraverseDirection iTraverseDirection;
-
-	TAckMode			iAckMode;
-
-public:
-	TInt				iTestNotifications;
-	TInt				iPowerNotifications;
-	TInt				iTestNotificationsExpected;
-	TInt				iPowerNotificationsExpected;
-
-	TInt				iTransitionsCompleted;
-	TInt				iTransitionsExpected;
-	};
-
-
-
-//! @SYMTestCaseID PBASE-T_DOMAIN-5
-//! @SYMTestType CT
-//! @SYMTestCaseDesc Connects to two domain hierarchies simulteneously and perform various tests
-//! @SYMREQ 3704,3705,3706,3707,3708,3709,3710,3711,3720,3721,3724,3725,3726,3727
-//! @SYMTestActions Open two hiearchies simultaneously and perform various actions.
-//! @SYMTestExpectedResults  All tests should pass
-//! @SYMTestPriority High
-//! @SYMTestStatus Defined
-void CDmTest5::Perform()
-	{
-
- 	__UHEAP_MARK;
-
-	//
-	// Test domain transitions
-	//
-	CActiveScheduler::Add(this);
-
-	TInt r = RDmDomainManager::AddDomainHierarchy(KDmHierarchyIdTest);
-
-    RDebug::Printf("RDmDomainManager::AddDomainHierarchy returns %d", r );
-
-	test(r == KErrNone);
-
-	CDomainManagerAo* powerDomainManager = NULL;
-	TRAP(r, powerDomainManager = CDomainManagerAo::NewL(KDmHierarchyIdPower, *this));
-	test (powerDomainManager != NULL);
-
-	r = CDomainManagerAo::AddDomainHierarchy(KDmHierarchyIdPower);
-	test(r == KErrNone);
-
-	//*************************************************
-	//	Test 5a - connect to two domain hierarchies simultaneously
-	//*************************************************
-	test.Next(_L("Test 5a - connect to two domain hierarchies simultaneously"));
-
-	test.Printf(_L("Domain id = 0x%x, Target State = 0x%x\n"), iTestDomainId, iTestState);
-
-	TInt testMemberCount = 0;
-
-	// Add some test hierarchy members - these use the RDmDomain API
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-	
-	// row 1
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestA, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestA), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestB, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestB), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestC, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestC), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-	
-	// row2
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestAA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAA), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestAB, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAB), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestBA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestB, KDmIdTestBA), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestCA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestC, KDmIdTestCA), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-	
-	// row 3
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestABA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABA), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestABB, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABB), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestCAA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestC, KDmIdTestCA, KDmIdTestCAA), this);
-	test(iTestMembers[testMemberCount++] != NULL);
-
-	// add some power hierarchy members - these use the CDmDomain AO API
-	TInt powerMemberCount = 0;
-	TRAP(r, iPowerMembers[powerMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdPower, KDmIdRoot, KDmIdRoot, this));
-	test(iTestMembers[powerMemberCount++] != NULL);
-	TRAP(r, iPowerMembers[powerMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdPower, KDmIdApps, KDmIdApps, this));
-	test(iTestMembers[powerMemberCount++] != NULL);
-	TRAP(r, iPowerMembers[powerMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdPower, KDmIdUiApps, KDmIdUiApps, this));
-	test(iTestMembers[powerMemberCount++] != NULL);
-
-
-	RArray<const TTransitionFailure> testFailures;
-	TInt testFailureCount;
-	RArray<const TTransitionFailure> powerFailures;
-	TInt powerFailureCount;
-
-
-
-	// calculate the expected number of notifications
-	TInt expectedTestNotifications = 0;
-	TInt leafNodes = 0;
-	
-
-	// work out the domain level, the number of leaf nodes and the expected number of 
-	// notifications for the domain that is being transitioned
-	switch(iTestDomainId)
-		{
-		case KDmIdRoot		:	iTestDomainLevel = 1; leafNodes = 5; expectedTestNotifications = testMemberCount; break;
-		case KDmIdTestA		:	iTestDomainLevel = 2; leafNodes = 3; expectedTestNotifications = 5; break;
-		case KDmIdTestB		:	iTestDomainLevel = 2; leafNodes = 1; expectedTestNotifications = 2; break;
-		case KDmIdTestC		:	iTestDomainLevel = 2; leafNodes = 1; expectedTestNotifications = 3; break;
-
-		case KDmIdTestAA	:	iTestDomainLevel = 3; leafNodes = 1; expectedTestNotifications = 1; break;
-		case KDmIdTestAB	:	iTestDomainLevel = 3; leafNodes = 2; expectedTestNotifications = 3; break;
-		case KDmIdTestBA	:	iTestDomainLevel = 3; leafNodes = 1; expectedTestNotifications = 1; break;
-		case KDmIdTestCA	:	iTestDomainLevel = 3; leafNodes = 1; expectedTestNotifications = 2; break;
-
-		case KDmIdTestABA	:	iTestDomainLevel = 4; leafNodes = 1; expectedTestNotifications = 1; break;
-		case KDmIdTestABB	:	iTestDomainLevel = 4; leafNodes = 1; expectedTestNotifications = 1; break;
-		case KDmIdTestCAA	:	iTestDomainLevel = 4; leafNodes = 1; expectedTestNotifications = 1; break;
-		default:
-			test(0);
-		}
-	test.Printf(_L("Test Domain id = 0x%x, Level = %d, Target State = 0x%x, expected notifications = %d, leafNodes = %d\n"), 
-		iTestDomainId, iTestDomainLevel, iTestState, expectedTestNotifications, leafNodes);
-
-	TInt expectedPowerNotifications = 0;
-	switch(iPowerDomainId)
-		{
-		case KDmIdRoot		:	expectedPowerNotifications = powerMemberCount; break;
-		case KDmIdApps		:	expectedPowerNotifications = 1; break;
-		case KDmIdUiApps	:	expectedPowerNotifications = 1; break;
-		default:
-			test(0);
-		}
-
-
-
-	// connect to the test hierarchy
-	r = iTestDomainManager.Connect(KDmHierarchyIdTest);
-	test(r == KErrNone);
-
-	// verify that we can't connect to the same hierarchy more than once
-	RDmDomainManager	domainManager;
-	r = domainManager.Connect(KDmHierarchyIdTest);
-	test(r == KErrInUse);
-
-
-
-	//*************************************************
-	// Test 5b - request a positive transition
-	// issue a positive  transition (i.e. transition state increases)
-	// and request that the test domain use ETraverseParentsFirst
-	//*************************************************
-	test.Next(_L("Test 5b - request a positive transition"));
-	iAckMode = KAckAlways;
-
-	iTransitionsCompleted = iTestNotifications = iPowerNotifications = 0;
-	iPowerNotificationsExpected = 0;
-	iTestNotificationsExpected = expectedTestNotifications;
-	iTransitionsExpected = 1;
-
-	// DON'T request any domain transition on the power hierarchy
-	// powerDomainManager->RequestDomainTransition(iPowerDomainId, EPwActive);
-	// request a domain transition on the test hierarchy
-	iTraverseDirection = ETraverseParentsFirst;
-	if (iTestDomainId == KDmIdRoot)
-		iTestDomainManager.RequestSystemTransition(iTestState, ETraverseDefault, CActive::iStatus);
-	else
-		iTestDomainManager.RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault, CActive::iStatus);
-	CActive::SetActive();
-
-	CActiveScheduler::Start();
-	test(powerDomainManager->iStatus == KErrNone);
-	test(iStatus == KErrNone);
-	test(iTestNotifications == iTestNotificationsExpected);
-	test(iPowerNotifications == iPowerNotificationsExpected);
-
-	//*************************************************
-	// Test 5c- verify domains are in correct state
-	//*************************************************
-	test.Next(_L("Test 5c- verify domains are in correct state"));
-	RDmDomain domainMember;
-	r = domainMember.Connect(KDmHierarchyIdTest, iTestDomainId);
-	test (r == KErrNone);
-	TDmDomainState state = domainMember.GetState();
-	domainMember.Close();
-	test (state == iTestState);
-
-	// if the transition request is not on the root, verify that that 
-	// the root domain and the transition domain are in different states
-	if (iTestDomainId != KDmIdRoot && iTestState != EStartupCriticalStatic)
-		{
-		r = domainMember.Connect(KDmHierarchyIdTest, KDmIdRoot);
-		test (r == KErrNone);
-		TDmDomainState state = domainMember.GetState();
-		domainMember.Close();
-		test (state != iTestState);
-		}
-
-
-	//*************************************************
-	// Test 5d- request a negative transition
-	// issue a negative transition (i.e. transition state decreases)
-	// and request that the test domain use ETraverseChildrenFirst
-	//*************************************************
-	test.Next(_L("Test 5d- request a negative transition"));
-	iAckMode = KAckAlways;
-	iTestState--;	// EStartupCriticalStatic;
-	iPowerState--;	// EPwStandby
-
-	iTransitionsCompleted = iTestNotifications = iPowerNotifications = 0;
-	iPowerNotificationsExpected = expectedPowerNotifications;
-	iTestNotificationsExpected = expectedTestNotifications;
-	iTransitionsExpected = 2;
-
-	// DO request a domain transition on the power hierarchy
-	powerDomainManager->RequestDomainTransition(iPowerDomainId, iPowerState, ETraverseDefault);
-
-	// request a domain transition on the test hierarchy
-	iTraverseDirection = ETraverseChildrenFirst;
-	iTestDomainManager.RequestDomainTransition(iTestDomainId, iTestState, iTraverseDirection, CActive::iStatus);
-	CActive::SetActive();
-
-	// wait for all test & power transitions to complete
-	CActiveScheduler::Start();
-	test(powerDomainManager->iStatus == KErrNone);
-	test(iStatus == KErrNone);
-	test(iTestNotifications == iTestNotificationsExpected);
-	test(iPowerNotifications == iPowerNotificationsExpected);
-	
-
-	//*************************************************
-	// Test 5e- request a positive transition, with zero acknowledgements
-	// issue a positive transition with no members acknowledging the transition
-	//*************************************************
-	test.Next(_L("Test 5e- request a positive transition, with zero acknowledgements"));
-	iAckMode = KAckNever;
-	iTestState++;		// EStartupCriticalDynamic;
-	iPowerState++;		// EPwActive
-
-	// power hierarchy should continue on failure, so we all power domains should transition
-	// test hierarchy should stop on failure, so should get notifications from all leaf nodes
-	iTransitionsCompleted = iTestNotifications = iPowerNotifications = 0;
-	iPowerNotificationsExpected = expectedPowerNotifications;
-	iTestNotificationsExpected = leafNodes;	// 5 leaf nodes for root domain
-	iTransitionsExpected = 2;
-
-	// DO request a domain transition on the power hierarchy
-	powerDomainManager->RequestDomainTransition(iPowerDomainId, iPowerState, ETraverseDefault);
-
-	// request a domain transition on the test hierarchy
-	iTraverseDirection = ETraverseChildrenFirst;
-	iTestDomainManager.RequestDomainTransition(iTestDomainId, iTestState, iTraverseDirection, CActive::iStatus);
-	CActive::SetActive();
-
-	// wait for all test & power transitions to complete
-	CActiveScheduler::Start();
-	test(powerDomainManager->iStatus == KErrTimedOut);
-	test(iStatus == KErrTimedOut);
-	test(iTestNotifications == iTestNotificationsExpected);
-	test(iPowerNotifications == iPowerNotificationsExpected);
-	
-	// get the failures on the test hierarchy
-	testFailureCount = iTestDomainManager.GetTransitionFailureCount();
-	test (testFailureCount == 1);
-
-	r = iTestDomainManager.GetTransitionFailures(testFailures);
-	test(r == KErrNone);
-	test(testFailureCount == testFailures.Count());
-
-	test.Printf(_L("Test failures = %d\n"), testFailureCount);
-	TInt i;
-	for (i=0; i<testFailureCount; i++)
-		{
-		test.Printf(_L("%d: iDomainId %d, iError %d\n"), 
-			i, testFailures[i].iDomainId, testFailures[i].iError);
-		test(testFailures[i].iError == KErrTimedOut);
-		}
-
-	// get the failures on the power hierarchy
-	powerFailureCount = powerDomainManager->GetTransitionFailureCount();
-	test (powerFailureCount == expectedPowerNotifications);
-
-	r = powerDomainManager->GetTransitionFailures(powerFailures);
-	test(r == KErrNone);
-	test(powerFailureCount == powerFailures.Count());
-
-	test.Printf(_L("Power failures = %d\n"), powerFailureCount);
-	for (i=0; i<powerFailureCount; i++)
-		{
-		test.Printf(_L("%d: iDomainId %d, iError %d\n"), 
-			i, powerFailures[i].iDomainId, powerFailures[i].iError);
-		test(powerFailures[i].iError == KErrTimedOut);
-		}
-
-	
-	//*************************************************
-	// Test 5f- request a positive transition, with error acknowledgements
-	// issue a positive transition with all members nack'ing the transition
-	//*************************************************
-	test.Next(_L("Test 5f- request a positive transition, with error acknowledgements"));
-	iAckMode = KAckError;
-	iTestState++;		
-	iPowerState++;		
-
-	// power hierarchy should continue on failure, so all power domains should transition
-	// test hierarchy should stop on failure, so should get notifications from 
-	// anything from 1 to all the leaf nodes
-	iTransitionsCompleted = iTestNotifications = iPowerNotifications = 0;
-	iPowerNotificationsExpected = expectedPowerNotifications;
-	iTestNotificationsExpected = leafNodes;	// 5 leaf nodes for root domain
-	iTransitionsExpected = 2;
-
-	// DO request a domain transition on the power hierarchy
-	powerDomainManager->RequestDomainTransition(iPowerDomainId, iPowerState, ETraverseDefault);
-
-	// request a domain transition on the test hierarchy
-	iTraverseDirection = ETraverseChildrenFirst;
-	iTestDomainManager.RequestDomainTransition(iTestDomainId, iTestState, iTraverseDirection, CActive::iStatus);
-	CActive::SetActive();
-
-	// wait for all test & power transitions to complete
-	CActiveScheduler::Start();
-	test(powerDomainManager->iStatus == KErrGeneral);
-	test(iStatus == KErrGeneral);
-	test(iTestNotifications <= iTestNotificationsExpected);
-	test(iPowerNotifications == iPowerNotificationsExpected);
-	
-	// get the failures on the test hierarchy
-	testFailureCount = iTestDomainManager.GetTransitionFailureCount();
-	test (testFailureCount == 1);
-
-	r = iTestDomainManager.GetTransitionFailures(testFailures);
-	test(r == KErrNone);
-	test(testFailureCount == testFailures.Count());
-
-	test.Printf(_L("Test failures = %d\n"), testFailureCount);
-	for (i=0; i<testFailureCount; i++)
-		{
-		test.Printf(_L("%d: iDomainId %d, iError %d\n"), 
-			i, testFailures[i].iDomainId, testFailures[i].iError);
-		test(testFailures[i].iError == KErrGeneral);
-		}
-
-	// get the failures on the power hierarchy
-	powerFailureCount = powerDomainManager->GetTransitionFailureCount();
-	test (powerFailureCount == expectedPowerNotifications);
-
-	r = powerDomainManager->GetTransitionFailures(powerFailures);
-	test(r == KErrNone);
-	test(powerFailureCount == powerFailures.Count());
-
-	test.Printf(_L("Power failures = %d\n"), powerFailureCount);
-	for (i=0; i<powerFailureCount; i++)
-		{
-		test.Printf(_L("%d: iDomainId %d, iError %d\n"), 
-			i, powerFailures[i].iDomainId, powerFailures[i].iError);
-		test(powerFailures[i].iError == KErrGeneral);
-		}
-
-	
-	// cleanup
-
-	testFailures.Reset();
-	powerFailures.Reset();
-
-	iTestDomainManager.Close();
-	delete powerDomainManager;
-	powerDomainManager = NULL;
-
-	CDmTestMember** mt;
-	for (mt = iTestMembers; *mt; ++mt)
-		delete *mt;
-
-	CDomainMemberAo** mp;
-	for (mp = iPowerMembers; *mp; ++mp)
-		delete *mp;
-
-
-	// restore the domain hierarchies to their initial state so as not to 
-	// upset any subsequent tests which rely on this
-	{
-	RDmDomainManager manager;
-	TInt r = manager.Connect();
-	test (r == KErrNone);
-	TRequestStatus status;
-	manager.RequestDomainTransition(KDmIdRoot, EPwActive, status);
-	test(status.Int() == KRequestPending);
-	User::WaitForRequest(status);
-	test(status.Int() == KErrNone);
-	manager.Close();
-	
-	r = manager.Connect(KDmHierarchyIdTest);
-	test (r == KErrNone);
-	manager.RequestDomainTransition(KDmIdRoot, EStartupCriticalStatic, ETraverseDefault, status);
-	test(status.Int() == KRequestPending);
-	User::WaitForRequest(status);
-	test(status.Int() == KErrNone);
-	manager.Close();
-	}
-
- 	__UHEAP_MARKEND;
-	}
-
-// This handles a transition notification from either a power domain member or 
-// a test domain member.
-// Verifies that the domain state is as expected.
-// Updates the number of notifications for each hierarchy and verifies that all parent 
-// domains have transitioned already (for parent-to-child transitions) or that all child 
-// domains have been transitioned already (for child-to-parent transitions).
-
-TInt CDmTest5::TransitionNotification(MDmDomainMember& aDomainMember)
-	{
-	if (aDomainMember.HierarchyId() == KDmHierarchyIdPower)
-		iPowerNotifications++;
-	else
-		iTestNotifications++;
-
-	if (aDomainMember.HierarchyId() == KDmHierarchyIdPower)
-		{
-		__PRINT((_L("CDmTest5::TransitionNotification(), Hierarchy = %d, iOrdinal = 0x%08X, state = 0x%x, status = %d\n"), 
-			aDomainMember.HierarchyId(), aDomainMember.Ordinal(), aDomainMember.State(), aDomainMember.Status()));
-		test(aDomainMember.State() == iPowerState);
-		}
-	else if (aDomainMember.HierarchyId() == KDmHierarchyIdTest)
-		{
-		TBuf16<4> buf;
-		GetDomainDesc(aDomainMember.Ordinal(), buf);
-
-		__PRINT((_L("CDmTest5::TransitionNotification(), Hierarchy = %d, domain = %S, iOrdinal = 0x%08X, state = 0x%x, status = %d\n"), 
-			aDomainMember.HierarchyId(), &buf, aDomainMember.Ordinal(), aDomainMember.State(), aDomainMember.Status()));
-		test(aDomainMember.State() == iTestState);
-		}
-	else
-		{
-		test(0);
-		}
-
-	// if we're going from parent to child, 
-	// check that each parent domain has received a notification already
-	// if not, check that each child domain has received a notification already
-
-	CDmTestMember** mp;
-
-	if (aDomainMember.HierarchyId() == KDmHierarchyIdTest && iAckMode == KAckAlways)
-		{
-
-		if (iTraverseDirection == ETraverseParentsFirst)
-			{
-			TUint ordThis = aDomainMember.Ordinal();
-			TUint ordParent = PARENT_ORDINAL(ordThis);
-
-			TInt levelParent = ORDINAL_LEVEL(ordParent);
-
-			TBuf16<4> buf;
-			GetDomainDesc(ordParent, buf);
-			if (levelParent >= iTestDomainLevel)
-				{
-				__PRINT((_L("Searching for parent domain = %S, ordinal = %08X \n"), &buf, ordParent));
-				for (mp = iTestMembers; *mp; ++mp)
-					{
-					if ((*mp)->Ordinal() == ordParent)
-						{
-						TBuf16<4> buf;
-						GetDomainDesc((*mp)->Ordinal(), buf);
-						__PRINT((_L("Found parent (%S). notification = %d\n"), &buf, (*mp)->Notifications()));
-						test ((*mp)->Notifications() == aDomainMember.Notifications());
-						break;
-						}
-					}
-				}
-			}
-		else
-			{
-			__PRINT((_L("Searching for children\n")));
-			for (mp = iTestMembers; *mp; ++mp)
-				{
-
-				TUint ordParent = PARENT_ORDINAL((*mp)->Ordinal());
-				if (ordParent == aDomainMember.Ordinal())
-					{
-					TBuf16<4> buf;
-					GetDomainDesc((*mp)->Ordinal(), buf);
-					__PRINT((_L("Found child (%S). notification = %d\n"), &buf, (*mp)->Notifications()));
-					test ((*mp)->Notifications() == aDomainMember.Notifications());
-					}
-				}
-			}
-		}
-
-	TInt ackError;
-	switch (iAckMode)
-		{
-		case KAckNever:
-			ackError = KErrAbort;
-			break;
-		case KAckError:		// return an error to the DM
-			ackError = KErrGeneral;
-			break;
-		case KAckOddDomainsOnly:
-			ackError = (aDomainMember.DomainId() & 1)?KErrNone:KErrAbort;
-			break;
-		case KAckAlways:
-		default:
-			ackError = KErrNone;
-			break;
-		}
-	return ackError;
-	}
-
-void CDmTest5::RunL()
-	{
-	iTransitionsCompleted++;
-
-	__PRINT((_L("CDmTest5::RunL(), error = %d, iTestNotifications %d, iPowerNotifications %d\n"), 
-		iStatus.Int(), iTestNotifications , iPowerNotifications));
-
-	if (iTransitionsCompleted == iTransitionsExpected)
-		CActiveScheduler::Stop();
-	}
-
-void CDmTest5::TransitionRequestComplete()
-	{
-	iTransitionsCompleted++;
-
-	__PRINT((_L("CDmTest5::TransitionRequestComplete(), error = %d, iTestNotifications %d, iPowerNotifications %d\n"), 
-		iStatus.Int(), iTestNotifications , iPowerNotifications));
-	
-	if (iTransitionsCompleted == iTransitionsExpected)
-		CActiveScheduler::Stop();
-	}
-
-void CDmTest5::DoCancel()
-	{
-	test(0);
-	}
-
-void CDmTest5::Release()
-	{
-	delete this;
-	}
-
-const TInt KMembersMax = 16;
-
-// Negative testing 
-class CDmTest6 : public CActive, public MDmTest
-	{
-public:
-	enum 
-	{
-	ENegTestTransitionNoConnect,
-	ENegTestGetStateNoConnect,
-	ENegTestTransitionInvalidMode
-	};
-
-	class TData 
-		{
-	public:
-		inline TData(TInt aTest) : iTest(aTest){};
-		TInt iTest;
-		};
-
-public: 
-	// from CActive
-	void RunL();
- 
-	// from MDmTest
-	void Perform();
-	void Release();
-	TInt TransitionNotification(MDmDomainMember& aDomainMember);
-	void TransitionRequestComplete();
-
-
-	CDmTest6() : CActive(CActive::EPriorityStandard) {}
-
-protected:
-	// from CActive
-	virtual void DoCancel();
-
-private:
-	static TInt PanicThreadFunc(TAny* aData);
-	void PanicTest(TInt aTestNumber);
-
-
-	CDomainMemberAo*	iTestMembers[KMembersMax]; 
-	CDomainManagerAo*	iTestDomainManager;
-	
-	TDmDomainId			iTestDomainId;
-	TDmDomainState		iTestState;
-
-public:
-	TInt				iTestNotifications;
-	TInt				iTestNotificationsExpected;
-
-	TInt				iTransitionsCompleted;
-	TInt				iTransitionsExpected;
-	};
-
-TInt CDmTest6::PanicThreadFunc(TAny* aData)
-	{
-	const TData* data = (const TData*)aData;
-	switch (data->iTest)
-		{
-		case ENegTestTransitionNoConnect:
-			{
-			// request a transition notification without connecting first (should panic)
-			RDmDomain domainMember;
-			TRequestStatus status;
-			User::SetJustInTime(EFalse);
-			domainMember.RequestTransitionNotification(status);
-			}
-			break;
-		case ENegTestGetStateNoConnect:
-			{
-			// Get the domain state without connecting (should panic)
-			RDmDomain domainMember;
-			User::SetJustInTime(EFalse);
-			domainMember.GetState();
-			}
-			break;
-		case ENegTestTransitionInvalidMode:
-			{
-			RDmDomainManager manager;
-			TRequestStatus status;
-			TInt r = manager.Connect(KDmHierarchyIdTest);
-			test(r == KErrNone);
-
-			User::SetJustInTime(EFalse);
-			manager.RequestDomainTransition(KDmIdRoot, 0, TDmTraverseDirection(-1), status);
-			}
-			break;
-		default:
-			break;
-		}
-	return KErrNone;
-	}
-
-void CDmTest6::PanicTest(TInt aTestNumber)
-	{
-	test.Printf(_L("panic test number %d\n"), aTestNumber);
-
-	TBool jit = User::JustInTime();
-
-	TData data(aTestNumber);
-
-	TInt KHeapSize=0x2000;
-
-	RThread thread;
-	TInt ret = thread.Create(KThreadName, PanicThreadFunc, KDefaultStackSize, KHeapSize, KHeapSize, &data);
-	test(KErrNone == ret);
-	TRequestStatus stat;
-	thread.Logon(stat);
-	thread.Resume();
-	User::WaitForRequest(stat);
-
-	User::SetJustInTime(jit);
-
-	// The thread must panic
-	test(thread.ExitType() == EExitPanic);
-	TInt exitReason = thread.ExitReason();
-	test.Printf(_L("panic test exit reason = %d\n"), exitReason);
-
-	switch(aTestNumber)
-		{
-		case ENegTestTransitionNoConnect:
-			test (exitReason == EBadHandle);
-			break;
-		case ENegTestGetStateNoConnect:
-			test (exitReason == EBadHandle);
-			break;
-		case ENegTestTransitionInvalidMode:
-			break;
-		default:
-			break;
-		}
-
-	CLOSE_AND_WAIT(thread);
-	}
-
-
-//! @SYMTestCaseID PBASE-T_DOMAIN-6
-//! @SYMTestType CT
-//! @SYMTestCaseDesc Negative testing
-//! @SYMPREQ 810
-//! @SYMTestActions Various negative tests
-//! @SYMTestExpectedResults  All tests should pass
-//! @SYMTestPriority High
-//! @SYMTestStatus Defined
-void CDmTest6::Perform()
-	{
-
- 	__UHEAP_MARK;
-
-	CActiveScheduler::Add(this);
-
-	CDomainManagerAo* iTestDomainManager = NULL;
-	TRAP_IGNORE(iTestDomainManager = CDomainManagerAo::NewL(KDmHierarchyIdTest, *this));
-	test (iTestDomainManager != NULL);
-
-	TInt r = CDomainManagerAo::AddDomainHierarchy(KDmHierarchyIdTest);
-	test(r == KErrNone);
-
-	//*************************************************
-	// Test 6a - Connect to the same hierarchy twice
-	//*************************************************
-	test.Next(_L("Test 6a - Connect to the same hierarchy twice"));
-
-	// verify that we can't connect to the same hierarchy more than once
-	CDomainManagerAo* testDomainManager = NULL;
-	TRAP(r, testDomainManager = CDomainManagerAo::NewL(KDmHierarchyIdTest, *this));
-	test(r == KErrInUse);
-	test (testDomainManager == NULL);
-
-
-	TInt testMemberCount = 0;
-
-	// Add some test hierarchy members
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	
-	// row 1
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestA, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestB, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestB), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestC, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestC), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	
-	// row2
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestAA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestAB, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAB), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestBA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestB, KDmIdTestBA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestCA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestC, KDmIdTestCA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	
-	// row 3
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestABA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestABB, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABB), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestCAA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestC, KDmIdTestCA, KDmIdTestCAA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-
-
-	//*************************************************
-	// Test 6b change to current state
-	//*************************************************
-	test.Next(_L("Test 6b change to current state"));
-	iTestState =  EStartupCriticalStatic;
-	iTestDomainId = KDmIdRoot;
-
-	iTransitionsCompleted = iTestNotifications = 0;
-	iTestNotificationsExpected = testMemberCount;
-	iTransitionsExpected = 1;
-
-	// request a domain transition
-	iTestDomainManager->RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault);
-
-	// wait for test transitions to complete
-	CActiveScheduler::Start();
-	test(iStatus == KErrNone);
-	test(iTestNotifications == iTestNotificationsExpected);
-	
-
-	// cancel a member notification request 
-	//*************************************************
-	// Test 6c cancel a member notification request
-	//*************************************************
-	test.Next(_L("Test 6c cancel a member notification request"));
-	RDmDomain domainMember;
-	TRequestStatus status;
-	domainMember.Connect(KDmHierarchyIdTest, iTestDomainId);
-	domainMember.RequestTransitionNotification(status);
-	domainMember.CancelTransitionNotification();
-	User::WaitForRequest(status);
-	domainMember.Close();
-
-	//*************************************************
-	// Test 6d cancel a member notification request without having first requested a notification
-	//*************************************************
-	test.Next(_L("Test 6d cancel a member notification request without having first requested a notification"));
-	domainMember.Connect(KDmHierarchyIdTest, iTestDomainId);
-	domainMember.CancelTransitionNotification();
-	domainMember.Close();
-
-	//*************************************************
-	// Test 6e domain controller adds invalid hierarchy
-	//*************************************************
-	test.Next(_L("Test 6e domain controller connects to invalid hierarchy"));
-	r = RDmDomainManager::AddDomainHierarchy(TDmHierarchyId(-1));
-	test(r == KErrBadHierarchyId);
-
-	//*************************************************
-	// Test 6f domain member connects to invalid hierarchy
-	//*************************************************
-	test.Next(_L("Test 6f domain member connects to invalid hierarchy"));
-	r = domainMember.Connect(TDmHierarchyId(-1), TDmDomainId(KDmIdRoot));
-	test (r == KErrBadHierarchyId);
-
-	//*************************************************
-	// Test 6g domain member connects to valid hierarchy but invalid domain
-	//*************************************************
-	test.Next(_L("Test 6g domain member connects to valid hierarchy but invalid domain"));
-	r = domainMember.Connect(KDmHierarchyIdTest, TDmDomainId(-1));
-	test (r == KDmErrBadDomainId);
-
-	delete iTestDomainManager;
-	iTestDomainManager = NULL;
-
-	// Panic tests
-
-	//*************************************************
-	// Test 6h request a transition notification without connecting first
-	//*************************************************
-	test.Next(_L("Test 6h request a transition notification without connecting first"));
-	PanicTest(ENegTestTransitionNoConnect);
-
-	//*************************************************
-	// Test 6i Get the domain state without connecting
-	//*************************************************
-	test.Next(_L("Test 6i Get the domain state without connecting"));
-	PanicTest(ENegTestGetStateNoConnect);
-
-	//*************************************************
-	// Test 6j request a transition notification with an invalid transition mode
-	//*************************************************
-	test.Next(_L("Test 6j request a transition notification with an invalid transition mode"));
-	PanicTest(ENegTestTransitionInvalidMode);
-
-
-	// cleanup
-
-	CDomainMemberAo** mt;
-	for (mt = iTestMembers; *mt; ++mt)
-		delete *mt;
-
- 	__UHEAP_MARKEND;
-	}
-
-// This handles a transition notification from a test domain member.
-TInt CDmTest6::TransitionNotification(MDmDomainMember& aDomainMember)
-	{
-	TInt status = aDomainMember.Status();
-		
-	iTestNotifications++;
-
-	test (aDomainMember.HierarchyId() == KDmHierarchyIdTest);
-
-	TBuf16<4> buf;
-	GetDomainDesc(aDomainMember.Ordinal(), buf);
-
-	test.Printf(_L("CDmTest6::TransitionNotification(), Hierarchy = %d, domain = %S, iOrdinal = 0x%08X, state = 0x%x, status = %d\n"), 
-		aDomainMember.HierarchyId(), &buf, aDomainMember.Ordinal(), aDomainMember.State(), status);
-
-
-	return KErrNone;
-	}
-
-void CDmTest6::RunL()
-	{
-	iTransitionsCompleted++;
-
-	TInt error = iStatus.Int();
-
-	test.Printf(_L("CDmTest6::RunL(), error = %d, iTestNotifications %d\n"), 
-		error, iTestNotifications);
-
-	if (iTransitionsCompleted == iTransitionsExpected)
-		CActiveScheduler::Stop();
-	}
-
-void CDmTest6::TransitionRequestComplete()
-	{
-	iTransitionsCompleted++;
-
-	TInt error = iStatus.Int();
-	
-	test.Printf(_L("CDmTest6::TransitionRequestComplete(), error = %d, iTestNotifications %d\n"), 
-		error, iTestNotifications);
-	
-	if (iTransitionsCompleted == iTransitionsExpected)
-		CActiveScheduler::Stop();
-	}
-
-void CDmTest6::DoCancel()
-	{
-	test(0);
-	}
-
-void CDmTest6::Release()
-	{
-	delete this;
-	}
-
-// Transition progress Observer testing
-class CDmTest7 : public CActive, public MDmTest, public MHierarchyObserver
-	{
-public: 
-	// from CActive
-	void RunL();
- 
-	// from MDmTest
-	void Perform();
-	void Release();
-	TInt TransitionNotification(MDmDomainMember& aDomainMember);
-	void TransitionRequestComplete();
-
-	// from MHierarchyObserver
-	virtual void TransProgEvent(TDmDomainId aDomainId, TDmDomainState aState);
-	virtual void TransFailEvent(TDmDomainId aDomainId, TDmDomainState aState, TInt aError);
-	virtual void TransReqEvent(TDmDomainId aDomainId, TDmDomainState aState);
-
-
-
-	CDmTest7(TDmDomainId aDomainId) : CActive(CActive::EPriorityStandard), iObservedDomainId(aDomainId) {}
-
-protected:
-	// from CActive
-	virtual void DoCancel();
-
-private:
-	void TestForCompletion();
-
-
-private:
-
-	enum { KMembersMax = 16 };
-
-	CDomainMemberAo*	iTestMembers[KMembersMax]; 
-	CDomainManagerAo*	iTestDomainManager;
-	
-	TDmDomainId			iTestDomainId;
-	TDmDomainState		iTestState;
-	TDmDomainId			iObservedDomainId;
-
-public:
-	TInt				iTestNotifications;
-	TInt				iTestNotificationsExpected;
-
-	TInt				iTransitionsCompleted;
-	TInt				iTransitionsExpected;
-
-	TInt				iTransProgEvents;
-	TInt				iTransFailEvents;
-	TInt				iTransReqEvents;
-
-	TInt				iTransProgEventsExpected;
-	TInt				iTransFailEventsExpected;
-	TInt				iTransReqEventsExpected;
-	};
-
-//! @SYMTestCaseID PBASE-T_DOMAIN-7
-//! @SYMTestType CT
-//! @SYMTestCaseDesc Transition progress Observer testing
-//! @SYMREQ REQ3723
-//! @SYMTestActions Various negative tests
-//! @SYMTestExpectedResults  All tests should pass
-//! @SYMTestPriority High
-//! @SYMTestStatus Defined
-void CDmTest7::Perform()
-	{
-
- 	__UHEAP_MARK;
-
-	//
-	// Test domain transitions with activated observer
-	//
-	CActiveScheduler::Add(this);
-
-	TInt r = RDmDomainManager::AddDomainHierarchy(KDmHierarchyIdTest);
-	test(r == KErrNone);
-
-	CDomainManagerAo* iTestDomainManager = NULL;
-	TRAP_IGNORE(iTestDomainManager = CDomainManagerAo::NewL(KDmHierarchyIdTest, *this));
-	test (iTestDomainManager != NULL);
-
-	r = CDomainManagerAo::AddDomainHierarchy(KDmHierarchyIdTest);
-	test(r == KErrNone);
-
-	//*************************************************
-	// Test 7a - Testing observer notifications
-	//*************************************************
-	
-	test.Next(_L("Test 7a - Testing observer notifications"));
-
-	TInt testMemberCount = 0;
-
-	// Add some test hierarchy members
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	
-	// row 1
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestA, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestB, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestB), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestC, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestC), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	
-	// row2
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestAA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestAB, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAB), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestBA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestB, KDmIdTestBA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestCA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestC, KDmIdTestCA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	
-	// row 3
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestABA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestABB, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABB), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestCAA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestC, KDmIdTestCA, KDmIdTestCAA), this));
-	test(iTestMembers[testMemberCount++] != NULL);
-
-	// create an observer
-	CHierarchyObserver* observer = NULL;
-	TRAP(r, observer = CHierarchyObserver::NewL(*this, KDmHierarchyIdTest));
-	test (r == KErrNone);
-	test(observer != NULL);
-	observer->StartObserver(iObservedDomainId, EDmNotifyAll);
-	
-	// request a state change
-	iTestState =  EStartupCriticalDynamic;
-	iTestDomainId = KDmIdRoot;
-	iTransitionsCompleted = iTestNotifications = 0;
-	iTestNotificationsExpected = testMemberCount;
-	iTransitionsExpected = 1;
-
-	iTransProgEvents = iTransFailEvents = iTransReqEvents = 0;
-	
-	iTransReqEventsExpected = iTransProgEventsExpected = observer->ObserverDomainCount();
-	iTransFailEventsExpected = 0;
-
-
-	iTestDomainManager->RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault);
-
-	// wait for test transitions to complete
-	CActiveScheduler::Start();
-	test(iStatus == KErrNone);
-	test(iTestNotifications == iTestNotificationsExpected);
-	test (iTransProgEvents == iTransProgEventsExpected);
-	test (iTransFailEvents == iTransFailEventsExpected);
-	test (iTransReqEvents == iTransReqEventsExpected);
-
-
-	// cleanup
-	delete observer; 
-	observer = NULL;
-
-	//*************************************************
-	// Test 7b - start & stop the observer
-	//*************************************************
-	test.Next(_L("Test 7b - start & stop the observer"));
-
-	// create an observer, start it stop and then start it again
-	TRAP(r, observer = CHierarchyObserver::NewL(*this, KDmHierarchyIdTest));
-	test (r == KErrNone);
-	test(observer != NULL);
-	observer->StartObserver(iObservedDomainId, EDmNotifyAll);
-	observer->StopObserver();
-	observer->StartObserver(iObservedDomainId, EDmNotifyAll);
-
-	// request a state change
-	iTestState++;
-	iTestDomainId = KDmIdRoot;
-	iTransitionsCompleted = iTestNotifications = 0;
-	iTestNotificationsExpected = testMemberCount;
-	iTransitionsExpected = 1;
-
-	iTransProgEvents = iTransFailEvents = iTransReqEvents = 0;
-	
-	iTransProgEventsExpected = iTransReqEventsExpected = observer->ObserverDomainCount();
-	iTransFailEventsExpected = 0;
-
-	iTestDomainManager->RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault);
-
-	// wait for test transitions to complete
-	CActiveScheduler::Start();
-	test(iStatus == KErrNone);
-	test(iTestNotifications == iTestNotificationsExpected);
-	test (iTransProgEvents == iTransProgEventsExpected);
-	test (iTransFailEvents == iTransFailEventsExpected);
-	test (iTransReqEvents == iTransReqEventsExpected);
-
-	// stop the observer & request another state change
-	observer->StopObserver();
-	iTestState++;
-	iTestDomainId = KDmIdRoot;
-	iTransitionsCompleted = iTestNotifications = 0;
-	iTestNotificationsExpected = testMemberCount;
-	iTransitionsExpected = 1;
-
-	iTransProgEvents = iTransFailEvents = iTransReqEvents = 0;
-	
-	iTransProgEventsExpected = 0;
-	iTransFailEventsExpected = 0;
-	iTransReqEventsExpected = 0;
-
-	iTestDomainManager->RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault);
-	// wait for test transitions to complete
-	CActiveScheduler::Start();
-	test(iStatus == KErrNone);
-	test(iTestNotifications == iTestNotificationsExpected);
-	test (iTransProgEvents == iTransProgEventsExpected);
-	test (iTransFailEvents == iTransFailEventsExpected);
-	test (iTransReqEvents == iTransReqEventsExpected);
-
-	// Start the observer again on a different domain and only ask for transition requests
-	// Then request another state change
-	observer->StartObserver((iObservedDomainId == KDmIdRoot)?KDmIdTestCA:KDmIdRoot, EDmNotifyTransRequest);
-	iTestState++;
-	iTestDomainId = KDmIdRoot;
-	iTransitionsCompleted = iTestNotifications = 0;
-	iTestNotificationsExpected = testMemberCount;
-	iTransitionsExpected = 1;
-
-	iTransProgEvents = iTransFailEvents = iTransReqEvents = 0;
-	
-	iTransReqEventsExpected = observer->ObserverDomainCount();
-	iTransProgEventsExpected = 0;
-	iTransFailEventsExpected = 0;
-
-
-	iTestDomainManager->RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault);
-	// wait for test transitions to complete
-	CActiveScheduler::Start();
-	test(iStatus == KErrNone);
-	test(iTestNotifications == iTestNotificationsExpected);
-	test (iTransProgEvents == iTransProgEventsExpected);
-	test (iTransFailEvents == iTransFailEventsExpected);
-	test (iTransReqEvents == iTransReqEventsExpected);
-
-	delete observer; 
-	observer = NULL;
-
-	//*************************************************
-	// Test 7c - invalid arguments testing for observer
-	//*************************************************
-	test.Next(_L("Test 7c - Invalid arguments testing for observer"));
-	
-	const TDmHierarchyId	KDmHierarchyIdInvalid = 110;
-	
-	test.Printf(_L("Test 7c.1 - create observer with invalid hierarchy Id\n"));
-	
-	// create an observer
-	TRAP(r, observer = CHierarchyObserver::NewL(*this, KDmHierarchyIdInvalid));
-	test (r == KErrBadHierarchyId);
-	
-	
-	test.Printf(_L("Test 7c.2 - Starting the observer with wrong domain Id\n"));
-	TRAP(r, observer = CHierarchyObserver::NewL(*this, KDmHierarchyIdTest));
-	test (r == KErrNone);
-	test(observer != NULL);
-
-	//Wrong domain Id
-	const TDmDomainId	KDmIdInvalid	= 0x0f;
-	r= observer->StartObserver(KDmIdInvalid, EDmNotifyAll);
-	test(r==KDmErrBadDomainId);
-
-	test.Printf(_L("Test 7c.3 - Trying to create second observer on the same hierarchy\n"));
-	TRAP(r, CHierarchyObserver::NewL(*this, KDmHierarchyIdTest));
-	test (r == KDmErrBadSequence);
-
-	
-	
-	//*************************************************
-	// Test 7d - Wrong sequence of API calls for observer
-	//*************************************************
-	test.Next(_L("Test 7d - Observer wrong sequence of calls"));
-	
-	test.Printf(_L("Test 7d.1 - Stopping Observer before starting it\n"));
-	r = observer->StopObserver();
-	test(r==KDmErrBadSequence);
-	
-	test.Printf(_L("Test 7d.2 - Starting Observer twice\n"));
-	r= observer->StartObserver(KDmIdRoot, EDmNotifyAll);
-	test(r==KErrNone);
-
-	r= observer->StartObserver(KDmIdRoot, EDmNotifyAll);
-	test(r==KDmErrBadSequence);
-
-	
-	delete observer;
-
-	/***************************************/
-
-	delete iTestDomainManager;
-	iTestDomainManager = NULL;
-
-	CDomainMemberAo** mt;
-	for (mt = iTestMembers; *mt; ++mt)
-		delete *mt;
-
-
-	// restore the domain hierarchies to their initial state so as not to 
-	// upset any subsequent tests which rely on this
-	{
-	RDmDomainManager manager;
-	TRequestStatus status;
-	TInt r = manager.Connect(KDmHierarchyIdTest);
-	test (r == KErrNone);
-	manager.RequestDomainTransition(KDmIdRoot, EStartupCriticalStatic, ETraverseDefault, status);
-	User::WaitForRequest(status);
-	test(status.Int() == KErrNone);
-	manager.Close();
-	}
-
- 	__UHEAP_MARKEND;
-	}
-
-// This handles a transition notification from a test domain member.
-TInt CDmTest7::TransitionNotification(MDmDomainMember& aDomainMember)
-	{
-		
-	iTestNotifications++;
-
-	test (aDomainMember.HierarchyId() == KDmHierarchyIdTest);
-
-	TBuf16<4> buf;
-	GetDomainDesc(aDomainMember.Ordinal(), buf);
-
-	__PRINT((_L("CDmTest7::TransitionNotification(), Hierarchy = %d, domain = %S, iOrdinal = 0x%08X, state = 0x%x, status = %d\n"), 
-		aDomainMember.HierarchyId(), &buf, aDomainMember.Ordinal(), aDomainMember.State(), aDomainMember.Status()));
-
-	return KErrNone;
-	}
-
-void CDmTest7::RunL()
-	{
-	iTransitionsCompleted++;
-
-	__PRINT((_L("CDmTest7::RunL(), error = %d, iTestNotifications %d\n"), 
-		iStatus.Int(), iTestNotifications));
-
-	TestForCompletion();
-	}
-
-void CDmTest7::TransitionRequestComplete()
-	{
-	iTransitionsCompleted++;
-
-	__PRINT((_L("CDmTest7::TransitionRequestComplete(), error = %d, iTestNotifications %d\n"), 
-		iStatus.Int(), iTestNotifications));
-	
-	TestForCompletion();
-	}
-
-void CDmTest7::DoCancel()
-	{
-	test(0);
-	}
-
-void CDmTest7::Release()
-	{
-	delete this;
-	}
-
-void CDmTest7::TestForCompletion()
-	{
-
-	if (iTransitionsCompleted == iTransitionsExpected &&
-		iTransProgEvents == iTransProgEventsExpected && 
-		iTransFailEvents == iTransFailEventsExpected &&
-		iTransReqEvents == iTransReqEventsExpected)
-		{
-		CActiveScheduler::Stop();
-		}
-	}
-
-#ifdef _DEBUG
-void CDmTest7::TransProgEvent(TDmDomainId aDomainId, TDmDomainState aState)
-#else
-void CDmTest7::TransProgEvent(TDmDomainId /*aDomainId*/, TDmDomainState /*aState*/)
-#endif
-	{
-	iTransProgEvents++;
-	__PRINT((_L("CDmTest7::TransProgEvent(), aDomainId = %d, aState %d, iTransProgEvents %d\n"), 
-		aDomainId, aState, iTransProgEvents));
-	TestForCompletion();
-	}
-
-#ifdef _DEBUG
-void CDmTest7::TransFailEvent(TDmDomainId aDomainId, TDmDomainState aState, TInt aError)
-#else
-void CDmTest7::TransFailEvent(TDmDomainId /*aDomainId*/, TDmDomainState /*aState*/, TInt /*aError*/)
-#endif
-
-	{
-	iTransFailEvents++;
-	__PRINT((_L("CDmTest7::TransFailEvent(), aDomainId = %d, aState %d aError %d, iTransFailEvents %d\n"), 
-		aDomainId, aState, iTransFailEvents, aError));
-	TestForCompletion();
-	}
-
-#ifdef _DEBUG
-void CDmTest7::TransReqEvent(TDmDomainId aDomainId, TDmDomainState aState)
-#else
-void CDmTest7::TransReqEvent(TDmDomainId /*aDomainId*/, TDmDomainState /*aState*/)
-#endif
-	{
-	iTransReqEvents++;
-	__PRINT((_L("CDmTest7::TransReqEvent(), aDomainId = %d, aState %d, iTransReqEvents %d\n"), 
-		aDomainId, aState, iTransReqEvents));
-	TestForCompletion();
-	}
-
-GLDEF_C TInt E32Main()
-	{
-	CTrapCleanup* trapHandler=CTrapCleanup::New();
-	test(trapHandler!=NULL);
-
-	CActiveScheduler* scheduler = new CActiveScheduler();
-	test(scheduler != NULL);
-	CActiveScheduler::Install(scheduler);
-
-	// Turn off evil lazy dll unloading
-	RLoader l;
-	test(l.Connect()==KErrNone);
-	test(l.CancelLazyDllUnload()==KErrNone);
-	l.Close();
-
-	//
-	// Perform the number of iterations specifed by the command line argument.
-	//
-	// If no arguments - perform two iterations
-	//
-//  TInt iter = 2;
-    TInt iter = 1;
-
-	TInt len = User::CommandLineLength();
-	if (len)
-		{
-		// Copy the command line in a buffer
-		HBufC* hb = HBufC::NewMax(len);
-		test(hb != NULL);
-		TPtr cmd((TUint16*) hb->Ptr(), len);
-		User::CommandLine(cmd);
-		// Extract the number of iterations
-		TLex l(cmd);
-		TInt i;
-		TInt r = l.Val(i);
-		if (r == KErrNone)
-			iter = i;
-		else
-			// strange command - silently ignore
-			{} 
-		delete hb;
-		}
-
-	test.Title();
-	test.Start(_L("Testing"));
-
-	test.Printf(_L("Go for %d iterations\n"), iter);
-
-	// Remember the number of open handles. Just for a sanity check ....
-	TInt start_thc, start_phc;
-	RThread().HandleCount(start_phc, start_thc);
-
-	while (iter--)
-		{
-		MDmTest* tests[] = 
-			{
-
-			new CDmTest1(KDmIdRoot, EPwStandby),
-			new CDmTest1(KDmIdRoot, EPwOff),
-			new CDmTest1(KDmIdRoot, EPwActive),
-			new CDmTest1(KDmIdApps, EPwStandby),
-			new CDmTest1(KDmIdApps, EPwOff),
-			new CDmTest1(KDmIdApps, EPwActive),
-			new CDmTest1(KDmIdUiApps, EPwStandby),
-			new CDmTest1(KDmIdUiApps, EPwOff),
-			new CDmTest1(KDmIdUiApps, EPwActive),
-			new CDmTest2(EPwStandby),
-			new CDmTest3(),
-	
-			// platform security tests
-			new CDmTest4(),
-
-			// PREQ810 tests :
-			// note that we use a fictitious power state to prevent any 
-			new CDmTest5(KDmIdRoot, KDmIdRoot, EPwActive+10, EStartupCriticalDynamic),
-			new CDmTest5(KDmIdUiApps, KDmIdTestAB, EPwActive+10, EStartupCriticalDynamic),
-
-        // negative tests
-			new CDmTest6(),
-
-
-			// observer tests
-     		new CDmTest7(KDmIdTestA),
-			new CDmTest7(KDmIdRoot),
-			
-			};
-
-		for (unsigned int i = 0; i < sizeof(tests)/sizeof(*tests); ++i)
-			{
-			test(tests[i] != NULL);
-			tests[i]->Perform();
-			tests[i]->Release();
-			}
-
-		}
-
-	test.End();
-
-	// Sanity check for open handles and for pending requests ...
-	TInt end_thc, end_phc;
-	RThread().HandleCount(end_phc, end_thc);
-	test(start_thc == end_thc);
-	test(start_phc == end_phc);
-	test(RThread().RequestCount() >= 0);
-
-	delete scheduler;
-	delete trapHandler;
-
-	return KErrNone;
-	}
--- a/kerneltest/e32test/domainmgr/t_domain.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-// 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"
-// 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/domainmgr/t_domain.mmp
-// 
-//
-
-TARGET			t_domain.exe        
-TARGETTYPE		EXE
-SOURCEPATH		.
-SOURCE			t_domain.cpp
-LIBRARY			euser.lib domaincli.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-CAPABILITY		WriteDeviceData PowerMgmt
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/kerneltest/e32test/domainmgr/t_domain_slave.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-// 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:
-// e32test\power\t_domain_slave.cpp
-// 
-//
-
-#include <e32power.h>
-#include <e32test.h>
-#include <domainmember.h>
-#include <domainmanager.h>
-#include <e32panic.h>
-#include <e32debug.h>
-
-LOCAL_D RTest test(_L(" T_DOMAIN_SLAVE "));
-
-// This will be run in its own thread as part of test #1. It should get killed when trying to connect 
-// to the manager without appropriate caps set
-TInt IncorrectClient(TAny*)
-{
-    	RDmDomain domain;
-		TInt r = domain.Connect(KDmIdRoot);
-
-		RDmDomainManager manager;
-		r = manager.Connect();
-
-        return(r);
-}
-
-GLDEF_C TInt E32Main()
-	{
-	test.Title();
-	test.Start(_L("Testing"));
-
-//	test.Next(_L("test security"));
-
-	// Get arguments from the command line
-	TInt len = User::CommandLineLength();
-	test (len);
-	TInt size = len * sizeof(TUint16);
-	test (size == sizeof(TInt));
-	TInt arg;
-	TPtr cmd((TUint16*) &arg, len);
-	User::CommandLine(cmd);
-
-	TInt expected_result = PlatSec::IsCapabilityEnforced(ECapabilityPowerMgmt) ? KErrPermissionDenied : KErrNone;
-
-	switch(arg)
-		{
-	case 0:
-		{
-        // This is the original t_domain_slave test, minus the panicking parts which now get
-        // tested as case 1.
-
-        test.Next(_L("test security -- 0"));       
-
-		RDmDomain domain;
-		TInt r = domain.Connect(KDmIdRoot);
-		test (r == expected_result);
-
-		break;
-		}
-    case 1:
-        {
-
-        test.Next(_L("test security -- 1")); 
-        
-        TBool jit = User::JustInTime();
-
-        User::SetJustInTime(EFalse);
-
-        _LIT(KPanicThread, "PanicThread");
-
-        RThread testThread;
-
-        TInt tt=testThread.Create(KPanicThread, IncorrectClient, KDefaultStackSize, 
-            NULL, NULL);
-
-        test (KErrNone == tt);
-
-        TRequestStatus tStatus;
-  //      testThread.Logon(tStatus);
-
-        RUndertaker deathChecker;
-        TInt dcOK = deathChecker.Create();
-
-        test (KErrNone == dcOK);
-
-        TInt nextDeadThread;
-
-        deathChecker.Logon(tStatus, nextDeadThread);
-
-        // threads are created in a suspended state. calling resume here starts the thread.
-        testThread.Resume();
-        User::WaitForRequest(tStatus);
-
-        // If thread suicided for the correct reason --> successful test
-        // NB. KErrPermissionDenied means that the server refused the 
-        // connection because of incorrect capabilities
-
-        RThread corpse;
-        corpse.SetHandle(nextDeadThread);
-
-        RDebug::Printf("Subthread exit type: %d", corpse.ExitType() );
-
-        RDebug::Printf("Subthread exit reason: %d",corpse.ExitReason() );
-
-        test (corpse.ExitType() == EExitKill);
-
-        test (corpse.ExitReason() == KErrPermissionDenied);
-
-        corpse.Close();
-  
-        // close the RUndertaker and test thread
-        deathChecker.Close();
-		CLOSE_AND_WAIT(testThread);
-
-        User::SetJustInTime(jit);
-
-		break;
-        }
-	default:
-		User::Panic(_L("USER"), EInvariantFalse);
-		break;
-		}
-
-	test.End();
-
-	return KErrNone;
-	}
--- a/kerneltest/e32test/domainmgr/t_domain_slave.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-// 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"
-// 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/domainmgr/t_domain_slave.mmp
-// 
-//
-
-TARGET			t_domain_slave.exe        
-TARGETTYPE		EXE
-SOURCEPATH		.
-SOURCE			t_domain_slave.cpp
-LIBRARY			euser.lib domaincli.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-CAPABILITY		None
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/kerneltest/e32test/domainmgr/test.inf	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-// 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:
-// Domain Manager Test Suite
-// Convienence INF file to build just these tests: bldmake -f test.inf bldfiles
-// Test project part of the offical ../group/bld.inf e32test component.
-//
-
-
-PRJ_PLATFORMS
-
-BASEDEFAULT
-
-
-
-PRJ_TESTEXPORTS
-
-dm_tests.iby	/epoc32/rom/include/dm_tests.iby
-
-dmtest.auto.bat	/epoc32/rom/include/dmtest.auto.bat
-dm_autoexec.bat	/epoc32/rom/include/dm_autoexec.bat
-
-
-
-PRJ_TESTMMPFILES
-
-#ifndef SMP
-t_domain
-t_domain_slave		support
-domainpolicy99		support
-#endif
-
--- a/kerneltest/e32test/domainmgr/tshell_dmtest.oby	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* 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:
-*
-*/
-
-#define BASE_ROM
-#include <rom\##VARIANT##\header.iby>
-
-
-files=
-
-#include <rom\##VARIANT##\kernel.iby>
-#include "user.iby"
-#include <rom\hal\hal.iby>
-#include <rom\f32\f32.iby>
-
-#include <rom\include\dm_tests.iby>
--- a/kerneltest/e32test/eabi/d_dma2_simu.def	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-EXPORTS
-	_Z19CreateLogicalDevicev @ 1 NONAME
-	_Z11DmaTestInfov @ 2 NONAME
-	_Z13DmaTestInfoV2v @ 3 NONAME
-	_ZN11DDmaRequest11FreeDesListEv @ 4 NONAME
-	_ZN11DDmaRequest13ExpandDesListEi @ 5 NONAME
-	_ZN11DDmaRequest13FragmentCountEv @ 6 NONAME
-	_ZN11DDmaRequest14FreeDstDesListEv @ 7 NONAME
-	_ZN11DDmaRequest14FreeSrcDesListEv @ 8 NONAME
-	_ZN11DDmaRequest16DstFragmentCountEv @ 9 NONAME
-	_ZN11DDmaRequest16ExpandDstDesListEi @ 10 NONAME
-	_ZN11DDmaRequest16ExpandSrcDesListEi @ 11 NONAME
-	_ZN11DDmaRequest16SrcFragmentCountEv @ 12 NONAME
-	_ZN11DDmaRequest24EnableDstElementCountingEi @ 13 NONAME
-	_ZN11DDmaRequest24EnableSrcElementCountingEi @ 14 NONAME
-	_ZN11DDmaRequest25DisableDstElementCountingEv @ 15 NONAME
-	_ZN11DDmaRequest25DisableSrcElementCountingEv @ 16 NONAME
-	_ZN11DDmaRequest30TotalNumDstElementsTransferredEv @ 17 NONAME
-	_ZN11DDmaRequest30TotalNumSrcElementsTransferredEv @ 18 NONAME
-	_ZN11DDmaRequest5QueueEv @ 19 NONAME
-	_ZN11DDmaRequest8FragmentERK16TDmaTransferArgs @ 20 NONAME
-	_ZN11DDmaRequest8FragmentEmmijm @ 21 NONAME
-	_ZN11DDmaRequestC1ER11TDmaChannelPFvNS_7TResultEPvES3_i @ 22 NONAME
-	_ZN11DDmaRequestC1ER11TDmaChannelPFvj10TDmaResultPvP10SDmaDesHdrES3_j @ 23 NONAME
-	_ZN11DDmaRequestC2ER11TDmaChannelPFvNS_7TResultEPvES3_i @ 24 NONAME
-	_ZN11DDmaRequestC2ER11TDmaChannelPFvj10TDmaResultPvP10SDmaDesHdrES3_j @ 25 NONAME
-	_ZN11DDmaRequestD0Ev @ 26 NONAME
-	_ZN11DDmaRequestD1Ev @ 27 NONAME
-	_ZN11DDmaRequestD2Ev @ 28 NONAME
-	_ZN11TDmaChannel13LinkToChannelEPS_ @ 29 NONAME
-	_ZN11TDmaChannel14IsrRedoRequestEmmjmi @ 30 NONAME
-	_ZN11TDmaChannel15StaticExtensionEiPv @ 31 NONAME
-	_ZN11TDmaChannel16AddressAlignMaskEjjm @ 32 NONAME
-	_ZN11TDmaChannel17MaxTransferLengthEjjm @ 33 NONAME
-	_ZN11TDmaChannel18MissNextInterruptsEi @ 34 NONAME
-	_ZN11TDmaChannel4OpenERKNS_11SCreateInfoERPS_ @ 35 NONAME
-	_ZN11TDmaChannel5CloseEv @ 36 NONAME
-	_ZN11TDmaChannel5PauseEv @ 37 NONAME
-	_ZN11TDmaChannel6ResumeEv @ 38 NONAME
-	_ZN11TDmaChannel8DmacCapsEv @ 39 NONAME
-	_ZN11TDmaChannel8FailNextEi @ 40 NONAME
-	_ZN11TDmaChannel9CancelAllEv @ 41 NONAME
-	_ZN11TDmaChannel9ExtensionEiPv @ 42 NONAME
-	_ZN16TDmaTransferArgsC1ERK18TDmaTransferConfigS2_mjj15TDmaGraphicsOpsm @ 43 NONAME
-	_ZN16TDmaTransferArgsC1Ejjjjjj12TDmaAddrModejj13TDmaBurstSizej15TDmaGraphicsOpsm @ 44 NONAME
-	_ZN16TDmaTransferArgsC1Ev @ 45 NONAME
-	_ZN16TDmaTransferArgsC2ERK18TDmaTransferConfigS2_mjj15TDmaGraphicsOpsm @ 46 NONAME
-	_ZN16TDmaTransferArgsC2Ejjjjjj12TDmaAddrModejj13TDmaBurstSizej15TDmaGraphicsOpsm @ 47 NONAME
-	_ZN16TDmaTransferArgsC2Ev @ 48 NONAME
-	_ZN18TDmaTransferConfigC1Emj12TDmaAddrModej13TDmaBurstSizejjji @ 49 NONAME
-	_ZN18TDmaTransferConfigC1Emjjjiijj13TDmaBurstSizejji @ 50 NONAME
-	_ZN18TDmaTransferConfigC1Ev @ 51 NONAME
-	_ZN18TDmaTransferConfigC2Emj12TDmaAddrModej13TDmaBurstSizejjji @ 52 NONAME
-	_ZN18TDmaTransferConfigC2Emjjjiijj13TDmaBurstSizejji @ 53 NONAME
-	_ZN18TDmaTransferConfigC2Ev @ 54 NONAME
-
--- a/kerneltest/e32test/eabi/d_second_excp2_40u.def	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-EXPORTS
-	_Z8thrower2i @ 1 NONAME
-	_Z8thrower3i @ 2 NONAME
-	_Z8thrower4i @ 3 NONAME
-	_Z8thrower5i @ 4 NONAME
-	_ZN14UncaughtTesterC1ERi @ 5 NONAME
-	_ZN14UncaughtTesterC2ERi @ 6 NONAME
-	_ZN14UncaughtTesterD1Ev @ 7 NONAME
-	_ZN14UncaughtTesterD2Ev @ 8 NONAME
-	_ZN17MyFourthExceptionC1Ei @ 9 NONAME
-	_ZN17MyFourthExceptionC2Ei @ 10 NONAME
-
--- a/kerneltest/e32test/eabi/d_second_excp_40u.def	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-EXPORTS
-	_Z8thrower2i @ 1 NONAME
-	_Z8thrower3i @ 2 NONAME
-	_Z8thrower4i @ 3 NONAME
-	_Z8thrower5i @ 4 NONAME
-	_ZN14UncaughtTesterC1ERi @ 5 NONAME
-	_ZN14UncaughtTesterC2ERi @ 6 NONAME
-	_ZN14UncaughtTesterD1Ev @ 7 NONAME
-	_ZN14UncaughtTesterD2Ev @ 8 NONAME
-	_ZN17MyFourthExceptionC1Ei @ 9 NONAME
-	_ZN17MyFourthExceptionC2Ei @ 10 NONAME
-
--- a/kerneltest/e32test/eabi/i2c_ctrlessu.def	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-EXPORTS
-	_Z20CreatePhysicalDevicev @ 1 NONAME
-	_ZN20TIicBusSlaveCallback7DfcFuncEPv @ 2 NONAME
-	_ZN25DIicBusChannelMasterSlaveC1EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexEP20DIicBusChannelMasterP19DIicBusChannelSlave @ 3 NONAME
-	_ZN25DIicBusChannelMasterSlaveC2EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexEP20DIicBusChannelMasterP19DIicBusChannelSlave @ 4 NONAME
-	_ZN31DSimulatedIicBusChannelSlaveI2cC1EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexE @ 5 NONAME
-	_ZN31DSimulatedIicBusChannelSlaveI2cC2EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexE @ 6 NONAME
-	_ZN32DSimulatedIicBusChannelMasterI2cC1EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexE @ 7 NONAME
-	_ZN32DSimulatedIicBusChannelMasterI2cC2EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexE @ 8 NONAME
-	_ZN37DSimulatedIicBusChannelMasterSlaveI2cC1EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexEP32DSimulatedIicBusChannelMasterI2cP31DSimulatedIicBusChannelSlaveI2c @ 9 NONAME
-	_ZN37DSimulatedIicBusChannelMasterSlaveI2cC2EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexEP32DSimulatedIicBusChannelMasterI2cP31DSimulatedIicBusChannelSlaveI2c @ 10 NONAME
-	_ZTI19DIicBusChannelSlave @ 11 NONAME
-	_ZTI20DIicBusChannelMaster @ 12 NONAME
-	_ZTI25DIicBusChannelMasterSlave @ 13 NONAME
-	_ZTI31DSimulatedIicBusChannelSlaveI2c @ 14 NONAME
-	_ZTI32DSimulatedIicBusChannelMasterI2c @ 15 NONAME
-	_ZTI37DSimulatedIicBusChannelMasterSlaveI2c @ 16 NONAME
-	_ZTV19DIicBusChannelSlave @ 17 NONAME
-	_ZTV20DIicBusChannelMaster @ 18 NONAME
-	_ZTV25DIicBusChannelMasterSlave @ 19 NONAME
-	_ZTV31DSimulatedIicBusChannelSlaveI2c @ 20 NONAME
-	_ZTV32DSimulatedIicBusChannelMasterI2c @ 21 NONAME
-	_ZTV37DSimulatedIicBusChannelMasterSlaveI2c @ 22 NONAME
-
--- a/kerneltest/e32test/eabi/i2c_masterstubs_ctrlessu.def	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-EXPORTS
-	_Z20CreatePhysicalDevicev @ 1 NONAME
-	_ZN20TIicBusSlaveCallback7DfcFuncEPv @ 2 NONAME
-	_ZN25DIicBusChannelMasterSlaveC1EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexEP20DIicBusChannelMasterP19DIicBusChannelSlave @ 3 NONAME
-	_ZN25DIicBusChannelMasterSlaveC2EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexEP20DIicBusChannelMasterP19DIicBusChannelSlave @ 4 NONAME
-	_ZN31DSimulatedIicBusChannelSlaveI2cC1EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexE @ 5 NONAME
-	_ZN31DSimulatedIicBusChannelSlaveI2cC2EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexE @ 6 NONAME
-	_ZN32DSimulatedIicBusChannelMasterI2cC1EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexE @ 7 NONAME
-	_ZN32DSimulatedIicBusChannelMasterI2cC2EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexE @ 8 NONAME
-	_ZN37DSimulatedIicBusChannelMasterSlaveI2cC1EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexEP32DSimulatedIicBusChannelMasterI2cP31DSimulatedIicBusChannelSlaveI2c @ 9 NONAME
-	_ZN37DSimulatedIicBusChannelMasterSlaveI2cC2EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexEP32DSimulatedIicBusChannelMasterI2cP31DSimulatedIicBusChannelSlaveI2c @ 10 NONAME
-	_ZTI19DIicBusChannelSlave @ 11 NONAME
-	_ZTI20DIicBusChannelMaster @ 12 NONAME
-	_ZTI25DIicBusChannelMasterSlave @ 13 NONAME
-	_ZTI31DSimulatedIicBusChannelSlaveI2c @ 14 NONAME
-	_ZTI32DSimulatedIicBusChannelMasterI2c @ 15 NONAME
-	_ZTI37DSimulatedIicBusChannelMasterSlaveI2c @ 16 NONAME
-	_ZTV19DIicBusChannelSlave @ 17 NONAME
-	_ZTV20DIicBusChannelMaster @ 18 NONAME
-	_ZTV25DIicBusChannelMasterSlave @ 19 NONAME
-	_ZTV31DSimulatedIicBusChannelSlaveI2c @ 20 NONAME
-	_ZTV32DSimulatedIicBusChannelMasterI2c @ 21 NONAME
-	_ZTV37DSimulatedIicBusChannelMasterSlaveI2c @ 22 NONAME
-
--- a/kerneltest/e32test/eabi/i2c_slavestubs_ctrlessu.def	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-EXPORTS
-	_Z20CreatePhysicalDevicev @ 1 NONAME
-	_ZN20TIicBusSlaveCallback7DfcFuncEPv @ 2 NONAME
-	_ZN25DIicBusChannelMasterSlaveC1EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexEP20DIicBusChannelMasterP19DIicBusChannelSlave @ 3 NONAME
-	_ZN25DIicBusChannelMasterSlaveC2EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexEP20DIicBusChannelMasterP19DIicBusChannelSlave @ 4 NONAME
-	_ZN31DSimulatedIicBusChannelSlaveI2cC1EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexE @ 5 NONAME
-	_ZN31DSimulatedIicBusChannelSlaveI2cC2EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexE @ 6 NONAME
-	_ZN32DSimulatedIicBusChannelMasterI2cC1EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexE @ 7 NONAME
-	_ZN32DSimulatedIicBusChannelMasterI2cC2EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexE @ 8 NONAME
-	_ZN37DSimulatedIicBusChannelMasterSlaveI2cC1EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexEP32DSimulatedIicBusChannelMasterI2cP31DSimulatedIicBusChannelSlaveI2c @ 9 NONAME
-	_ZN37DSimulatedIicBusChannelMasterSlaveI2cC2EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexEP32DSimulatedIicBusChannelMasterI2cP31DSimulatedIicBusChannelSlaveI2c @ 10 NONAME
-	_ZTI19DIicBusChannelSlave @ 11 NONAME
-	_ZTI20DIicBusChannelMaster @ 12 NONAME
-	_ZTI25DIicBusChannelMasterSlave @ 13 NONAME
-	_ZTI31DSimulatedIicBusChannelSlaveI2c @ 14 NONAME
-	_ZTI32DSimulatedIicBusChannelMasterI2c @ 15 NONAME
-	_ZTI37DSimulatedIicBusChannelMasterSlaveI2c @ 16 NONAME
-	_ZTV19DIicBusChannelSlave @ 17 NONAME
-	_ZTV20DIicBusChannelMaster @ 18 NONAME
-	_ZTV25DIicBusChannelMasterSlave @ 19 NONAME
-	_ZTV31DSimulatedIicBusChannelSlaveI2c @ 20 NONAME
-	_ZTV32DSimulatedIicBusChannelMasterI2c @ 21 NONAME
-	_ZTV37DSimulatedIicBusChannelMasterSlaveI2c @ 22 NONAME
-
--- a/kerneltest/e32test/eabi/spi_ctrlessu.def	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-EXPORTS
-	_Z20CreatePhysicalDevicev @ 1 NONAME
-	_ZN20TIicBusSlaveCallback7DfcFuncEPv @ 2 NONAME
-	_ZN25DIicBusChannelMasterSlaveC1EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexEP20DIicBusChannelMasterP19DIicBusChannelSlave @ 3 NONAME
-	_ZN25DIicBusChannelMasterSlaveC2EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexEP20DIicBusChannelMasterP19DIicBusChannelSlave @ 4 NONAME
-	_ZN31DSimulatedIicBusChannelSlaveSpiC1EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexE @ 5 NONAME
-	_ZN31DSimulatedIicBusChannelSlaveSpiC2EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexE @ 6 NONAME
-	_ZN32DSimulatedIicBusChannelMasterSpiC1EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexE @ 7 NONAME
-	_ZN32DSimulatedIicBusChannelMasterSpiC2EN14DIicBusChannel8TBusTypeENS0_14TChannelDuplexE @ 8 NONAME
-	_ZTI19DIicBusChannelSlave @ 9 NONAME
-	_ZTI20DIicBusChannelMaster @ 10 NONAME
-	_ZTI25DIicBusChannelMasterSlave @ 11 NONAME
-	_ZTI31DSimulatedIicBusChannelSlaveSpi @ 12 NONAME
-	_ZTI32DSimulatedIicBusChannelMasterSpi @ 13 NONAME
-	_ZTV19DIicBusChannelSlave @ 14 NONAME
-	_ZTV20DIicBusChannelMaster @ 15 NONAME
-	_ZTV25DIicBusChannelMasterSlave @ 16 NONAME
-	_ZTV31DSimulatedIicBusChannelSlaveSpi @ 17 NONAME
-	_ZTV32DSimulatedIicBusChannelMasterSpi @ 18 NONAME
-
--- a/kerneltest/e32test/eabi/t_usb_tranhandlesrvu.def	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-EXPORTS
-	_ZN14RTranHandleSrv14TransferHandleER11RHandleBaseS1_ @ 1 NONAME
-	_ZN14RTranHandleSrv7ConnectEv @ 2 NONAME
-	_ZN14RTranHandleSrvC1Ev @ 3 NONAME
-	_ZN14RTranHandleSrvC2Ev @ 4 NONAME
-	_ZN14RTranHandleSrvD1Ev @ 5 NONAME
-	_ZN14RTranHandleSrvD2Ev @ 6 NONAME
-	_ZNK14RTranHandleSrv7VersionEv @ 7 NONAME
-
--- a/kerneltest/e32test/eabi/t_usb_transfersrvu.def	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-EXPORTS
-	_ZN12RTransferSrv17SetConfigFileNameER6TDes16 @ 1 NONAME
-	_ZN12RTransferSrv7ConnectEv @ 2 NONAME
-	_ZN12RTransferSrvC1Ev @ 3 NONAME
-	_ZN12RTransferSrvC2Ev @ 4 NONAME
-	_ZN12RTransferSrvD1Ev @ 5 NONAME
-	_ZN12RTransferSrvD2Ev @ 6 NONAME
-	_ZNK12RTransferSrv7VersionEv @ 7 NONAME
-
--- a/kerneltest/e32test/group/bld.inf	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/group/bld.inf	Wed Sep 01 12:34:56 2010 +0100
@@ -31,21 +31,21 @@
 
 PRJ_TESTEXPORTS
 
-../../../kernel/eka/include/kernel/dobject.h						OS_LAYER_PLATFORM_EXPORT_PATH(kernel/dobject.h)			
+../../../kernel/eka/include/kernel/dobject.h						/epoc32/include/kernel/			
 
-../../../userlibandfileserver/domainmgr/inc/domainobserver.h				OS_LAYER_PLATFORM_EXPORT_PATH(domainobserver.h)
+../../../userlibandfileserver/domainmgr/inc/domainobserver.h				/epoc32/include/
 
-../dll/d_ldrtst.h					OS_LAYER_PLATFORM_EXPORT_PATH(d_ldrtst.h)
+../dll/d_ldrtst.h					/epoc32/include/
 
-../nkernsa/interrupts.h				OS_LAYER_PLATFORM_EXPORT_PATH(nktest/interrupts.h)	//
-../nkernsa/nkutils.h				OS_LAYER_PLATFORM_EXPORT_PATH(nktest/nkutils.h)	//
-../nkernsa/utils.h					OS_LAYER_PLATFORM_EXPORT_PATH(nktest/utils.h)	//
-../nkernsa/diag.h					OS_LAYER_PLATFORM_EXPORT_PATH(nktest/diag.h)	//
+../nkernsa/interrupts.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(nktest/interrupts.h)	//
+../nkernsa/nkutils.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(nktest/nkutils.h)	//
+../nkernsa/utils.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(nktest/utils.h)	//
+../nkernsa/diag.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(nktest/diag.h)	//
 
-../../../kernel/eka/include/e32huffman.h				OS_LAYER_PLATFORM_EXPORT_PATH(e32huffman.h)
+../../../kernel/eka/include/e32huffman.h				/epoc32/include/
 
 platsec.settings        /epoc32/data/defaulttest.ini
-../mmu/d_memorytest.h   OS_LAYER_PLATFORM_EXPORT_PATH(e32test/d_memorytest.h)
+../mmu/d_memorytest.h   /epoc32/include/e32test/d_memorytest.h
 
 ../buffer/UnicodeData.txt    /epoc32/data/z/test/unicodedata.txt
 ../buffer/UnicodeData.txt    /epoc32/release/wins/udeb/z/test/unicodedata.txt
@@ -68,10 +68,11 @@
 ../dll/oe/eabi/urel/t_oeexport.exe      /epoc32/release/armv5/urel/t_oeexport.exe
 ../dll/oe/eabi/urel/t_oeexport1.exe     /epoc32/release/armv5/urel/t_oeexport1.exe
 
-../demandpaging/d_pagestress.h		OS_LAYER_PLATFORM_EXPORT_PATH(d_pagestress.h)
+../demandpaging/d_pagestress.h		/epoc32/include/
+../pci/t_pci.h						/epoc32/include/e32test/t_pci.h
 
-../iic/iic_psl/i2c.h			OS_LAYER_PLATFORM_EXPORT_PATH(e32test/i2c.h)
-../iic/iic_psl/spi.h			OS_LAYER_PLATFORM_EXPORT_PATH(e32test/spi.h)
+../iic/iic_psl/i2c.h			/epoc32/include/e32test/
+../iic/iic_psl/spi.h			/epoc32/include/e32test/
 
 PRJ_TESTMMPFILES
 
@@ -82,8 +83,6 @@
  positive check ( #ifdef SMP ), however these binaries will not be included in BTB 
  autotest images for SMP platforms. Refer to DTW-KHS BTB00055 for more details.
  ******************************************************************************/
-d_timestamp					support
-d_kerncorestats				support
 d_implicit					support
 d_emitest					support
 d_ldd						support
@@ -92,9 +91,6 @@
 d_ldd2_ram					support
 d_lddns						support
 d_lddpowerseqtest			support
-#if !defined(X86) && !defined(WINS)
-../power/d_powermisctest					support
-#endif
 d_ldddigitisertest			support
 d_lddturnaroundtimertest	support
 d_newldd					support
@@ -123,7 +119,6 @@
 d_shbuf_own					support
 d_asid						support
 d_entropysources			support
-d_khal						support
 
 #ifdef GENERIC_MARM
 d_schedhook					support
@@ -139,19 +134,16 @@
 rescontrol_psl				support
 rescontrol_extended_psl		support
 d_rescontrolcli				support
-d_rescontrolclisync			support
 d_extendedrescontrolcli		support
 d_prmacctstsim				support
 ../resmanus/resourcecontrol	support
 ../resmanus/resourcecontrollerextended	support
-../resmanus/d_resmanusbtrace		support
 #endif
 
 // DMA kernel-side test harness for software-simulated DMA framework
 // software-simulated DMA framework
 d_dmasim					support
 dmasim						support
-d_dma2_sim					support
 
 // Examples for demand paging device driver migration
 d_pagingexample_1_pre  support
@@ -162,9 +154,6 @@
 #if defined(EPOC32) && !defined(X86)
 // Test LDD for real hardware DMA
 d_dma						support
-d_dma2						support
-d_dma_compat				support
-d_dma2_compat				support
 #endif
 
 #ifdef EPOC32
@@ -196,21 +185,18 @@
 #endif
 
 #if !defined(X86)
+#if defined(WINS)
 ../iic/iic_psl/iic_testpsl			support
-../iic/iic_psl/spi				support
-../iic/iic_psl/i2c				support
+../iic/iic_psl/spi					support
+../iic/iic_psl/i2c					support
 ../iic/iic_psl/d_iic_client			support
-../iic/iic_psl/d_iic_slaveclient		support
+../iic/iic_psl/d_iic_slaveclient	support
 
 ../iic/iic_psl/spi_ctrless			support
 ../iic/iic_psl/i2c_ctrless			support
 ../iic/iic_psl/d_iic_client_ctrless		support
 ../iic/iic_psl/d_iic_slaveclient_ctrless	support
-
-../iic/iic_psl/i2c_masterstubs_ctrless		support
-../iic/iic_psl/i2c_slavestubs_ctrless		support
-../iic/iic_psl/d_iic_client_stubs		support
-../iic/iic_psl/d_iic_slaveclient_stubs		support
+#endif
 #endif
 
 #if !defined(WINS) && !defined(X86)
@@ -232,8 +218,6 @@
 //T_ROMCHK      // check the ROM is OK before starting tests
 #endif
 
-t_printsysinfo		/* t_printsysinfo is the first test to run because it logs the system information */
-
 // todo: t_shadow tests currently need to run before any ROM pages get shadowed so do this first
 // for now
 #ifdef EPOC32
@@ -259,9 +243,6 @@
 t_ramdefrag
 #endif
 
-// /E32TEST/TIMESTAMP test must also come before t_lat2 as it goes into Low Power Mode.
-t_timestamp
-
 #ifdef EPOC32
 // Start the latency measurement
 t_lat2
@@ -395,18 +376,12 @@
 #endif
 #ifdef MARM_ARMV5
 t_usb_device	manual
-t_usb_tranhandleclient	support
-t_usb_transfersrvclient	support
-t_usb_transfersrv	manual
 t_usb_scdevice	manual
 #endif
 
 t_tldd
 t_newldd
 t_lddpowerseqtest
-#if !defined(X86) && !defined(WINS)
-../power/t_powermisctest 
-#endif
 t_ldddigitisertest
 t_userdigitisertest
 t_userdigitisernocaps
@@ -518,19 +493,16 @@
 ../ethernet/pump/etherpump  manual
 ../ethernet/macset/macset   manual
 
-// /e32test/heap tests
+// /E32TEST/HEAP tests
+t_fail
+
 #ifdef EPOC32
-t_hcomp			support
+t_hcomp     support
 #endif
-t_fail
+
 t_heap
 t_heap2
 t_heapdb
-t_heapdl
-t_heapslab
-t_heapstress		manual
-t_heapcheck
-t_heappagealloc
 t_kheap
 
 // Secure RNG tests
@@ -592,9 +564,6 @@
 
 t_duid      support
 t_uid
-#ifdef EPOC32
-ccthrash	support
-#endif
 cpumeter    support
 crash       support
 reboot		support
@@ -620,7 +589,6 @@
 t_mem       support
 t_unzip     support
 t_ymodem    support
-ymodemtx	support
 t_ymodemz   support
 t_lbk       support
 t_forever   support
@@ -636,10 +604,8 @@
 eject       support
 t_pcreat    support
 
-t_loadsim	support
-
 #if !defined(WINS)
-t_zip       
+t_zip       manual
 #endif
 
 #ifdef EPOC32
@@ -726,8 +692,10 @@
 // /E32TEST/POWER tests
 t_power
 t_power_slave   support
+t_domain
+t_domain_slave  support
+domainPolicyTest support
 t_switchoff
-t_frqchg
 
 // /E32TEST/PRIME tests
 t_kern      support
@@ -757,18 +725,16 @@
 
 // /E32TEST/SYSTEM tests
 t_atomic
-t_atomicu
 t_chnot     
 t_cobj      
 t_ctrap     
 t_exc       
-t_inf
+t_inf       manual
 t_multin    
 t_prot
 t_prot2     support
 t_prot2a    support
 t_reason    support 
-t_reason2
 t_ref       
 t_reg       
 t_trap
@@ -794,7 +760,6 @@
 //  T_REGRAM    support
 t_panic     support
 #endif
-t_khal
 
 // /E32TEST/THREAD tests
 t_killer    support // because it takes several minutes to run
@@ -842,8 +807,7 @@
 t_wwins     manual
 t_mmcpw     manual
 
-refkeymap   support //Reference template keyboard look-up tables for T_KEYS test 
-t_keys
+t_keys      support
 
 // /E32TEST/Y2K tests
 t_y2k
@@ -894,7 +858,7 @@
 t_logtofile         manual
 t_eventtracker      manual
 t_traceredirect     support
-t_heapcorruption    support
+t_heapcorruption	support
 t_btrace
 t_perflogger
 
@@ -905,7 +869,6 @@
 
 // /E32TEST/DMA tests
 t_dma       // user-side test harness for real DMA framework
-t_dma2       // user-side test harness for DMAv2 framework
 
 // Example RTOS personality
 ../personality/example/t_expers support
@@ -999,21 +962,21 @@
 ../resmanus/t_resmanus
 ../resmanus/t_resmanuskern
 ../resmanus/t_resmanusextended
-../resmanus/t_resmanusbtrace
 #endif
 
 // /E32TEST/RESOURCEMAN tests
 #if !defined X86 
 t_rescontrolcli
-t_rescontrolclisync
 t_extendedrescontrolcli
 t_prmacctstsim
 #endif
 
 // /E32TEST/IIC tests
 #if !defined(X86)
+#if defined(WINS)
 ../iic/t_iic
 #endif
+#endif
 
 #if defined(MARM_ARMV5)
 t_oeexport2
@@ -1024,13 +987,43 @@
 #endif
 
 #if defined(MARM_ARMV5)
+../rm_debug/group/t_rmdebug_dll support
+../rm_debug/group/t_rmdebug_security0 support
+../rm_debug/group/t_rmdebug_security1 support
+../rm_debug/group/t_rmdebug_security2 support
+../rm_debug/group/t_rmdebug_security3 support
+../rm_debug/group/t_rmdebug_app support
+../rm_debug/group/t_rmdebug2
+../rm_debug/group/t_rmdebug2_oem
+../rm_debug/group/t_rmdebug2_oemtoken support
+../rm_debug/group/t_rmdebug2_oem2
+../rm_debug/group/t_rmdebug2_oemtoken2 support
 ../rm_debug/group/t_crashmonitor_lib
+
+../rm_debug/group/t_rmdebug_app1 support
+../rm_debug/group/t_rmdebug_app2 support
+../rm_debug/group/t_rmdebug_app3 support
+../rm_debug/group/t_rmdebug_app4 support
+../rm_debug/group/t_rmdebug_app5 support
+../rm_debug/group/t_rmdebug_app6 support
+../rm_debug/group/t_rmdebug_app7 support
+../rm_debug/group/t_rmdebug_app8 support
+../rm_debug/group/t_rmdebug_app9 support
+../rm_debug/group/t_rmdebug_app10 support
+
+../rm_debug/group/t_rmdebug_target_launcher support
+../rm_debug/group/t_rmdebug_multi_target
+
+../rm_debug/group/t_rmdebug_multi_agent support
+../rm_debug/group/t_multi_agent_launcher
+
+
 #endif
 
 t_stacksize
 
 #if !defined(WINS) && !defined(X86)
-t_crazyints
+t_crazyints	
 #endif
 
 #endif	// SMP
@@ -1046,11 +1039,14 @@
 t_destruct_dll3		support
 
 #include "../examples/examples.inf"
+// Shared chunk camera driver tests.
+t_camera_api		manual
+t_camera_gen		manual
 d_mmcsc			support
 
-t_kerncorestats		support
-
 #include "../hcr/hcr.inf"
 
-#include "../domainmgr/test.inf"
+//pci tests
+t_pci
 
+sdapctest
--- a/kerneltest/e32test/group/ccthrash.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-// Copyright (c) 2009-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/ccthrash.mmp
-// 
-//
-
-target				ccthrash.exe
-targettype			exe
-
-sourcepath			../misc
-source				ccthrash.cpp
-library				euser.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-capability			all
-vendorid			0x70000001
-smpsafe
--- a/kerneltest/e32test/group/d_dma2.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-// 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 "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 "kernel/kern_ext.mmh"
-
-#ifdef	VariantDmaImportLib
-target		VariantTarget(d_dma2,ldd)
-#else
-target		d_dma2.ldd
-#endif
-
-targettype	ldd
-
-sourcepath	../dmav2
-source		d_dma2.cpp d_dma2_cmn.cpp
-
-#ifdef	VariantDmaImportLib
-library		VariantDmaImportLib
-#else
-library		dma2.lib
-#endif
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-epocallowdlldata
-
-capability	all
-VENDORID 0x70000001
-
-// Don't put this in ROM here since it would stop ROMs building on platforms
-// without DMA support.
-romtarget
-
-#ifdef SMP
-MACRO CPU_AFFINITY_ANY
-#endif
-
-SMPSAFE
-
-MACRO DMA_APIV2
--- a/kerneltest/e32test/group/d_dma2_compat.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-// 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 "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 "kernel/kern_ext.mmh"
-
-#ifdef	VariantDmaImportLib
-target		VariantTarget(d_dma2_compat,ldd)
-#else
-target		d_dma2_compat.ldd
-#endif
-
-targettype	ldd
-
-sourcepath	../dmav2
-source		d_dma2.cpp d_dma2_cmn.cpp
-
-sourcepath	../../../../kernelhwsrv/kernel/eka/drivers/dma
-source		dma2_shared.cpp
-
-#ifdef	VariantDmaImportLib
-library		VariantDmaImportLib
-#else
-library		dma.lib
-#endif
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-epocallowdlldata
-
-capability	all
-VENDORID 0x70000001
-
-// Don't put this in ROM here since it would stop ROMs building on platforms
-// without DMA support.
-romtarget
-
-#ifdef SMP
-MACRO CPU_AFFINITY_ANY
-#endif
-
-SMPSAFE
--- a/kerneltest/e32test/group/d_dma2_sim.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-// 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"
-// 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 "kernel/kern_ext.mmh"
-
-target		d_dma2_sim.ldd
-targettype	ldd
-
-// It is not actually necessary to export DMA API functions
-// from this simulated binary
-noexportlibrary
-
-deffile		../~/d_dma2_sim.def
-
-sourcepath	../../../../kernelhwsrv/kernel/eka/drivers/dma
-source		dma2_pil.cpp dma2_shared.cpp
-
-sourcepath	../dmav2
-source		d_dma2.cpp d_dma2_cmn.cpp dma2_sim.cpp
-
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-epocallowdlldata
-
-start wins
-win32_headers
-end
-
-capability	all
-VENDORID 0x70000001
-
-#ifdef SMP
-MACRO CPU_AFFINITY_ANY
-#endif
-
-SMPSAFE
-
-MACRO DMA_APIV2
-MACRO __DMASIM__
--- a/kerneltest/e32test/group/d_dma_compat.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-// 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 "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 "kernel/kern_ext.mmh"
-
-#ifdef	VariantDmaImportLib
-target		VariantTarget(d_dma_compat,ldd)
-#else
-target		d_dma_compat.ldd
-#endif
-
-targettype	ldd
-
-sourcepath	../dma
-source		d_dma.cpp
-
-#ifdef	VariantDmaImportLib
-library		VariantDmaImportLib
-#else
-library		dma2.lib
-#endif
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-epocallowdlldata
-
-capability	all
-VENDORID 0x70000001
-
-// Don't put this in ROM here since it would stop ROMs building on platforms
-// without DMA support.
-romtarget
-
-#ifdef SMP
-MACRO CPU_AFFINITY_ANY
-#endif
-
-SMPSAFE
-
-MACRO DMA_APIV2
--- a/kerneltest/e32test/group/d_frqchg.mmh	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-// Copyright (c) 2010-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:
-// e32test/group/d_frqchg.mmh
-// 
-//
-
-// NOTE : include your variant.mmh before this file
-
-#ifdef EPOC32
-target			VariantTarget(d_frqchg,ldd)
-#else
-target			d_frqchg.ldd
-#endif
-#include		"kernel/kern_ext.mmh"
-
-targettype		ldd
-romtarget		d_frqchg.ldd
-
-sourcepath		../power
-source			d_frqchg.cpp
-
-sourcepath		../../../kernel/eka/nkern
-source			nklib.cpp
-
-#ifdef MARM
-sourcepath		../../../kernel/eka/nkern/arm
-source			nklib.cia
-#endif
-
-
-epocallowdlldata
-
-vendorid		0x70000001
-capability		all
-
-macro CPU_AFFINITY_ANY
-smpsafe
--- a/kerneltest/e32test/group/d_kerncorestats.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-// 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".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// e32test\group\d_kerncorestats.mmp
-// 
-//
-#include "kernel/kern_ext.mmh"
-
-target			d_TestKernCoreStats.ldd
-targettype		ldd
-sourcepath		../misc
-source			d_TestKernCoreStats.cpp
-epocallowdlldata
-
-start wins
-win32_headers
-end
-
-capability		all
-vendorid		0x70000001
-SMPSAFE
--- a/kerneltest/e32test/group/d_khal.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-// 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:
-// e32test/group/d_khal.mmp
-// 
-//
-
-#include "kernel/kern_ext.mmh"
-
-target			  d_khal.ldd
-targettype		ldd
-sourcepath		../system
-source			  d_khal.cpp
-userinclude   ../system
-epocallowdlldata
-
-start wins
-win32_library	kernel32.lib
-end
-
-capability		all
-
-VENDORID 0x70000001
-SMPSAFE
--- a/kerneltest/e32test/group/d_rescontrolclisync.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-// 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:
-// e32test/group/d_rescontrolcli.mmp
-// 
-//
-
-#include "kernel/kern_ext.mmh"
-
-target         d_rescontrolclisync.ldd
-targettype     ldd
-sourcepath     ../resourceman/
-source         d_rescontrolclisync.cpp
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-library        resourcecontroller.lib
-
-uid		0x100000af
-vendorid 0x70000001
-
-capability		all
-epocallowdlldata
-
-start wins
-win32_headers
-end
-
-macro CPU_AFFINITY_ANY
-SMPSAFE
-
-
--- a/kerneltest/e32test/group/d_second_excp.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/group/d_second_excp.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -40,10 +40,5 @@
 capability		all
 vendorid		0x70000001
 
-#if defined ARMCC_4_0
-deffile		d_second_excp_40.def
-#else
-deffile		d_second_excp.def
-#endif
 
 SMPSAFE
--- a/kerneltest/e32test/group/d_second_excp2.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/group/d_second_excp2.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -28,10 +28,6 @@
 capability		all
 vendorid		0x70000001
 
-#if defined ARMCC_4_0
-deffile		d_second_excp2_40.def
-#else
-deffile		d_second_excp2.def
-#endif
+
 
 SMPSAFE
--- a/kerneltest/e32test/group/d_timestamp.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-// 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:
-// d_timestamp.mmp
-// 
-//
-
-
-
-#include "kernel\kern_ext.mmh"
-
-TARGET		        D_TIMESTAMP.LDD
-TARGETTYPE		LDD
-
-SOURCEPATH		../timestamp
-SOURCE			D_TIMESTAMP.CPP
-
-LIBRARY			EKERN.LIB
-
-epocallowdlldata
-
-UID		0x100000af
-VENDORID 0x70000001
-
-start wins
-win32_headers
-end
-
-capability		all
-
-SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/domainPolicyTest.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,45 @@
+// 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:
+// e32test/group/domainpolicytest.mmp
+// domainpolicy99.dll Test Domain manager policy module
+// 
+//
+
+/**
+ @file
+*/
+
+
+TARGET          domainpolicy99.dll
+CAPABILITY PowerMgmt ProtServ DiskAdmin
+TARGETTYPE      dll
+
+userinclude		../power
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+sourcepath	../power
+source		domainpolicytest.cpp
+
+library		euser.lib
+
+
+START WINS
+END
+
+START MARM
+END
+
+VENDORID 0x70000001
+
+SMPSAFE
--- a/kerneltest/e32test/group/refkeymap.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-// 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:
-// e32test/group/refkeymap.mmp
-// refekdata.dll Reference template keyboard look-up tables for T_KEYS test 
-// 
-//
-
-/**
- @file
-*/
-#define __USING_ASSP_REGISTER_API__
-#define __USING_ASSP_INTERRUPT_API__
-
-target				refkdata.dll
-targettype		dll
-
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-sourcepath		../../../bsptemplate/asspandvariant/template_variant/specific
-source				keymap.cpp
-
-library				euser.lib
-
-deffile				../../../kernel/eka/~/ekdata.def
-
-nostrictdef
-
-capability			all
-
-uid					0x1000008d 0x100039e0
-vendorid			 0x70000001
-
-SMPSAFE
-unpagedcode
--- a/kerneltest/e32test/group/rescontrol_extended_psl.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/group/rescontrol_extended_psl.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -24,7 +24,6 @@
 
 macro		BTRACE_RESOURCE_MANAGER
 macro		RESOURCE_MANAGER_SIMULATED_PSL
-macro		_DUMP_TRACKERS
 macro		PRM_INSTRUMENTATION_MACRO
 macro		PRM_ENABLE_EXTENDED_VERSION
 //macro		DEBUG_VERSION //Enable if wanted to check for Lock and critical section count checker
--- a/kerneltest/e32test/group/rescontrol_psl.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/group/rescontrol_psl.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -24,7 +24,6 @@
 
 macro		BTRACE_RESOURCE_MANAGER
 macro		RESOURCE_MANAGER_SIMULATED_PSL
-macro		_DUMP_TRACKERS
 macro		PRM_INSTRUMENTATION_MACRO
 //macro		DEBUG_VERSION //Enable if wanted to check for Lock and critical section count checker
 
--- a/kerneltest/e32test/group/romstuff.mke	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/group/romstuff.mke	Wed Sep 01 12:34:56 2010 +0100
@@ -36,6 +36,5 @@
 	@echo data=##BASEPATH##kernelhwsrv\kerneltest\e32test\hcr\megalarge2.dat    sys\data\megalarge2.dat		unpaged paging_unmovable
 	@echo data=##BASEPATH##kernelhwsrv\kerneltest\e32test\hcr\filerepos_bc0.dat sys\data\filerepos_bc0.dat	unpaged paging_unmovable
 	@echo data=##BASEPATH##kernelhwsrv\kerneltest\e32test\hcr\filerepos_bc1.dat sys\data\filerepos_bc1.dat	unpaged paging_unmovable
-	@echo data=##BASEPATH##kernelhwsrv\kerneltest\e32test\hcr\filerepos_cds.dat sys\data\filerepos_cds.dat  unpaged paging_unmovable
 	@echo hcrdata=##BASEPATH##kernelhwsrv\kerneltest\e32test\hcr\filerepos.dat  sys\data\hcr.dat
 #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/sdapctest.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -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:
+// e32test/group/sdapctest.mmp
+// 
+//
+
+OPTION CW   -w off
+TARGET         sdapctest.exe
+TARGETTYPE     EXE
+SOURCEPATH     ../pccd	
+SOURCE         sdapctest.cpp
+LIBRARY        euser.lib hal.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+capability	all
+
+SMPSAFE
+
--- a/kerneltest/e32test/group/t_atomicu.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-// 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:
-// e32test/group/t_atomicu.mmp
-// 
-//
-
-TARGET         t_atomicu.exe        
-TARGETTYPE     EXE
-SOURCEPATH	../system
-SOURCE         t_atomicu.cpp
-LIBRARY        euser.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-
-capability		all
-
-VENDORID 0x70000001
-
-SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/t_camera_api.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,31 @@
+// 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:
+// e32test/group/t_camera_api.mmp
+// 
+//
+
+target			t_camera_api.exe
+targettype		exe
+sourcepath		../multimedia
+source			t_camera_api.cpp
+source			t_camera_display.cpp
+source			t_camera_bitmap.cpp
+library			euser.lib hal.lib efsrv.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+capability		ALL -TCB
+vendorid		0x70000001
+epocheapsize		1048576 16777216
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/t_camera_gen.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,30 @@
+// 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:
+// e32test/group/t_camera_gen.mmp
+// 
+//
+
+target			t_camera_gen.exe        
+targettype		exe
+sourcepath		../multimedia
+source			t_camera_gen.cpp
+source			t_camera_display.cpp
+library			euser.lib hal.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+capability		ALL -TCB
+vendorid		0x70000001
+
+
+SMPSAFE
--- a/kerneltest/e32test/group/t_datapaging.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/group/t_datapaging.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -20,7 +20,7 @@
 sourcepath		../demandpaging
 source			t_datapaging.cpp ../mmu/paging_info.cpp
 source			t_dpcmn.cpp
-library			euser.lib hal.lib dptest.lib efsrv.lib 
+library			euser.lib hal.lib dptest.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 capability		all
 vendorid		0x70000001
--- a/kerneltest/e32test/group/t_dma2.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-// 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"
-// 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         t_dma2.exe
-TARGETTYPE     EXE
-SOURCEPATH	../dmav2
-SOURCE         t_dma2.cpp test_cases.cpp self_test.cpp  d_dma2_cmn.cpp
-SOURCE		   test_thread.cpp
-SOURCEPATH	../../../kernel/eka/drivers/dma
-SOURCE		dma2_shared.cpp
-LIBRARY        euser.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-CAPABILITY	NONE
-
-VENDORID 0x70000001
-
-SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/t_domain.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,29 @@
+// 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:
+// e32test/group/t_domain.mmp
+// 
+//
+
+TARGET			t_domain.exe        
+TARGETTYPE		EXE
+SOURCEPATH		../power
+SOURCE			t_domain.cpp
+LIBRARY			euser.lib domaincli.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+CAPABILITY		WriteDeviceData PowerMgmt
+
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/t_domain_slave.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,29 @@
+// 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:
+// e32test/group/t_domain_slave.mmp
+// 
+//
+
+TARGET			t_domain_slave.exe        
+TARGETTYPE		EXE
+SOURCEPATH		../power
+SOURCE			t_domain_slave.cpp
+LIBRARY			euser.lib domaincli.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+CAPABILITY		None
+
+VENDORID 0x70000001
+
+SMPSAFE
--- a/kerneltest/e32test/group/t_drtaeabi.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/group/t_drtaeabi.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -16,7 +16,7 @@
 TARGET 			t_drtaeabi.dll
 
 TARGETTYPE		dll
-armfpu softvfp
+
 SOURCEPATH		../../../kernel/eka/compsupp/rvct
 
 SOURCE			aeabidiv0.cpp
@@ -44,15 +44,13 @@
 LIBRARY 		euser.lib dfpaeabi.lib dfprvct2_2.lib drtrvct2_2.lib
 #elif defined ARMCC_3_1
 LIBRARY 		euser.lib dfpaeabi.lib dfprvct3_1.lib drtrvct3_1.lib scppnwdl.lib
-#elif defined ARMCC_4_0
-LIBRARY 		euser.lib dfpaeabi.lib scppnwdl.lib
 #endif
 
 START ARMCC
 ARMRT // we're building a runtime support lib so suppress all the default libraries
 ARMINC
 // we want the 'pure' versions to go with softvfp
-#if defined ARMCC_3_1 || defined ARMCC_4_0
+#if defined ARMCC_3_1
     #ifdef MARM_ARMV5
     ARMLIBS     c_5.l h_5.l cpprt_5.l
     #else
--- a/kerneltest/e32test/group/t_extendedrescontrolcli.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/group/t_extendedrescontrolcli.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -25,7 +25,7 @@
 
 
 capability		all
-epocstacksize	0x8000
+
 vendorid 0x70000001
 
 start wins
--- a/kerneltest/e32test/group/t_frqchg.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-// Copyright (c) 2010-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:
-// e32test\group\t_frqchg.mmp
-// 
-//
-
-target			t_frqchg.exe
-targettype		exe
-sourcepath		../power
-source			t_frqchg.cpp
-library			euser.lib hal.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-capability		all
-vendorid		0x70000001
-epocheapsize	0x00001000 0x00100000
-smpsafe
--- a/kerneltest/e32test/group/t_heap.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/group/t_heap.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,7 @@
 SOURCE         t_heap.cpp
 LIBRARY        euser.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-userinclude    ..\..\..\kernel\eka\include
+
 
 capability		all
 
--- a/kerneltest/e32test/group/t_heap2.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/group/t_heap2.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,8 @@
 source			t_heap2.cpp
 library			euser.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-userinclude		..\..\..\kernel\eka\include
+
+
 
 capability		all
 
--- a/kerneltest/e32test/group/t_heapcheck.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-// Copyright (c) 1995-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_heapcheck.mmp
-// 
-//
-
-userinclude    ..\..\..\kernel\eka\include
-systeminclude    ..\..\..\kernel\eka\include
-TARGET         t_heapcheck.exe
-TARGETTYPE     EXE
-SOURCEPATH  ../heap
-SOURCE         t_heapcheck.cpp
-LIBRARY        euser.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-
-capability      all -TCB
-
-VENDORID 0x70000001
-
-SMPSAFE
-
-//EPOCSTACKSIZE 70000
--- a/kerneltest/e32test/group/t_heapcorruption.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/group/t_heapcorruption.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 
 userinclude	 	../debug
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-userinclude		..\..\..\kernel\eka\include
 
 sourcepath	  	../debug
 source		  	t_heapcorruption.cpp
--- a/kerneltest/e32test/group/t_heapdb.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/group/t_heapdb.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,7 @@
 SOURCE         t_heapdb.cpp
 LIBRARY        euser.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-userinclude    ..\..\..\kernel\eka\include
+
 
 capability		all
 
--- a/kerneltest/e32test/group/t_heapdl.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-// Copyright (c) 1995-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_heapdl.mmp
-// 
-//
-
-userinclude    ..\..\..\kernel\eka\include
-systeminclude    ..\..\..\kernel\eka\include
-TARGET         t_heapdl.exe
-TARGETTYPE     EXE
-SOURCEPATH	../heap
-SOURCE         t_heapdl.cpp
-LIBRARY        euser.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-
-capability		all -TCB
-
-VENDORID 0x70000001
-
-SMPSAFE
-
--- a/kerneltest/e32test/group/t_heappagealloc.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-// Copyright (c) 1995-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_heappagealloc.mmp
-// 
-//
-
-userinclude    ..\..\..\kernel\eka\include
-systeminclude    ..\..\..\kernel\eka\include
-TARGET         t_heappagealloc.exe
-TARGETTYPE     EXE
-SOURCEPATH	../heap
-SOURCE         t_heappagealloc.cpp
-LIBRARY        euser.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-
-capability		all -TCB
-
-VENDORID 0x70000001
-
-SMPSAFE
-
--- a/kerneltest/e32test/group/t_heapslab.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-// Copyright (c) 1995-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_heapslab.mmp
-// 
-//
-
-userinclude    ..\..\..\kernel\eka\include
-systeminclude    ..\..\..\kernel\eka\include
-TARGET         t_heapslab.exe
-TARGETTYPE     EXE
-SOURCEPATH  ../heap
-SOURCE         t_heapslab.cpp
-LIBRARY        euser.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-
-capability      all -TCB
-
-VENDORID 0x70000001
-
-SMPSAFE
-
-//EPOCSTACKSIZE 70000
--- a/kerneltest/e32test/group/t_heapstress.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-
-// Copyright (c) 1995-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_heapstress.mmp
-// 
-//
-
-userinclude    ..\..\..\kernel\eka\include
-systeminclude    ..\..\..\kernel\eka\include
-target          t_heapstress.exe
-targettype      exe
-sourcepath      ../heap
-source          t_heapstress.cpp
-library         euser.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-capability      all -TCB
-
-VENDORID 0x70000001
-
-SMPSAFE
-
--- a/kerneltest/e32test/group/t_kerncorestats.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-// 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".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// e32test\group\t_kerncorestats.mmp
-// 
-//
-
-TARGET         t_kerncorestats.exe
-TARGETTYPE     EXE
-SOURCEPATH     ../misc
-SOURCE         t_kerncorestats.cpp
-LIBRARY        euser.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-capability     all
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/kerneltest/e32test/group/t_khal.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-// 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:
-// e32test/group/t_khal.mmp
-// 
-//
-
-TARGET         t_khal.exe        
-TARGETTYPE     EXE
-SOURCEPATH	   ../system
-SOURCE         t_khal.cpp
-USERINCLUDE		 ../system
-LIBRARY        euser.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-capability		all
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/kerneltest/e32test/group/t_loadsim.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-// Copyright (c) 2009-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_loadsim.mmp
-// 
-//
-
-target			t_loadsim.exe
-targettype		exe
-sourcepath		../misc
-source			t_loadsim.cpp
-library			euser.lib hal.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-capability		all
-vendorid		0x70000001
-epocheapsize	0x00001000 0x01000000
-smpsafe
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/t_pci.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,27 @@
+// 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: 
+// e32test/group/t_pci.mmp
+
+TARGET         t_pci.exe
+TARGETTYPE     EXE
+SOURCEPATH	../pci
+SOURCE         t_pci.cpp
+LIBRARY        euser.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+CAPABILITY	ReadDeviceData WriteDeviceData
+
+VENDORID 0x70000001
+
+SMPSAFE
--- a/kerneltest/e32test/group/t_printsysinfo.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-// 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:
-// e32test\group\t_printsysinfo.mmp
-//
-//
-
-target			t_printsysinfo.exe        
-targettype		exe
-sourcepath		../demandpaging
-source			t_printsysinfo.cpp
-library			euser.lib hal.lib dptest.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-capability		all
-vendorid		0x70000001
-
-smpsafe
--- a/kerneltest/e32test/group/t_reason2.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-// 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:
-// e32test/group/t_reason2.mmp
-// 
-//
-
-TARGET         t_reason2.exe        
-TARGETTYPE     EXE
-SOURCEPATH	../system
-SOURCE         t_reason2.cpp
-LIBRARY        euser.lib
-LIBRARY        hal.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-
-capability		all
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/kerneltest/e32test/group/t_rescontrolclisync.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// 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:
-// e32test/group/t_rescontrolcli.mmp
-// 
-//
-
-target         t_rescontrolclisync.exe
-targettype     exe
-sourcepath	   ../resourceman/
-source         t_rescontrolclisync.cpp
-library        euser.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-
-capability		all
-
-vendorid 0x70000001
-
-start wins
-win32_headers
-end
-
-
-SMPSAFE
--- a/kerneltest/e32test/group/t_schedhook.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/group/t_schedhook.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -18,7 +18,9 @@
 target			t_schedhook.exe
 targettype		exe
 
+#if defined(GCC32)
 ALWAYS_BUILD_AS_ARM
+#endif
 
 sourcepath		../debug
 source			t_schedhook.cpp context.cia
--- a/kerneltest/e32test/group/t_semutx.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/group/t_semutx.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -19,7 +19,7 @@
 TARGETTYPE     EXE
 SOURCEPATH	../prime
 SOURCE         t_semutx.cpp
-LIBRARY        euser.lib hal.lib
+LIBRARY        euser.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 
--- a/kerneltest/e32test/group/t_timestamp.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-// 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:
-// t_timestamp.mmp
-// 
-//
-
-
-target			t_timestamp.exe        
-targettype		exe
-SOURCEPATH		../timestamp
-source			t_timestamp.cpp
-library			euser.lib hal.lib
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-capability		none
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/kerneltest/e32test/group/t_usb.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/group/t_usb.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1997-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"
@@ -18,8 +18,6 @@
 TARGET        t_usb.exe
 TARGETTYPE    EXE
 
-USERINCLUDE   ../traces_t_usb
-
 SOURCEPATH	  ../device
 SOURCE        t_usb.cpp
 SOURCE        t_usbco2.cpp
--- a/kerneltest/e32test/group/t_usb_device.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/group/t_usb_device.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,17 +18,15 @@
 TARGET        T_USB_DEVICE.EXE
 TARGETTYPE    EXE
 
-uid   0x0   0x20031630
 // Header file paths
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
-USERINCLUDE	  ../usb/t_usb_device/include
-USERINCLUDE   ../traces_t_usb_device
+USERINCLUDE	  ../USB/T_USB_DEVICE/INCLUDE
 
 // Source file paths
 
-SOURCEPATH	  ../usb/t_usb_device/src
+SOURCEPATH	  ../USB/T_USB_DEVICE/SRC
 
 
 SOURCE     	main.cpp
--- a/kerneltest/e32test/group/t_usb_scdevice.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/group/t_usb_scdevice.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,9 +18,6 @@
 TARGET        t_usb_scdevice.exe
 TARGETTYPE    EXE
 
-UID         0x0 0x20031631
-VENDORID    0x70000001
-
 MACRO		USB_SC
 
 // Header file paths
@@ -28,7 +25,6 @@
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 USERINCLUDE	  ../usb/t_usb_device/include
-USERINCLUDE     ../traces_t_usb_scdevice
 
 // Source file paths
 
@@ -44,16 +40,15 @@
 SOURCE    	config.cpp
 SOURCE		apitests.cpp
 SOURCE		usbms.cpp
-SOURCE		tranhandleserver.cpp
-SOURCE		tranhandlesession.cpp
 
 
 LIBRARY     EUSER.LIB HAL.LIB
 LIBRARY		usbcsc_bil.lib
-LIBRARY     EFSRV.LIB t_usb_transfersrv.lib
+LIBRARY     EFSRV.LIB
 
 CAPABILITY    ALL
 
+VENDORID      0x70000001
 
 // Larger user heap than default: maximum = 16MB
 EPOCHEAPSIZE  0x1000 0x01000000
--- a/kerneltest/e32test/group/t_usb_tranhandleclient.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* 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"
-* 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      t_usb_tranhandlesrv.dll
-TARGETTYPE  DLL
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-USERINCLUDE	  ../usb/t_usb_device/include
-
-// Source file paths
-
-SOURCEPATH	  ../usb/t_usb_device/src
-
-
-deffile			../~/t_usb_tranhandlesrv.def 
-
-CAPABILITY    ALL
-
-VENDORID      0x70000001
-
-// Larger user heap than default: maximum = 16MB
-EPOCHEAPSIZE  0x1000 0x01000000
-
-SMPSAFE
-
-
-SOURCE        tranhandlesrv.cpp
-
-LIBRARY       euser.lib
--- a/kerneltest/e32test/group/t_usb_transfersrv.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-// 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".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// e32test/group/t_usb_transfersrv.mmp
-// 
-//
-
-TARGET        t_usb_transfersrv.exe
-TARGETTYPE    EXE
-
-uid 0x0    0x20031632
-
-MACRO		USB_SC
-
-// Header file paths
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-USERINCLUDE	  ../usb/t_usb_device/include
-USERINCLUDE     ../traces_t_usb_transfersrv
-
-// Source file paths
-
-SOURCEPATH	  ../usb/t_usb_device/src
-
-
-SOURCE     	transfersrvmain.cpp
-SOURCE		transfersession.cpp
-SOURCE		transferserver.cpp
-SOURCE		config.cpp
-SOURCE		transferhandle.cpp
-
-LIBRARY     EUSER.LIB HAL.LIB
-LIBRARY		usbcsc_bil.lib
-LIBRARY     EFSRV.LIB t_usb_tranhandlesrv.lib
-
-CAPABILITY    ALL
-
-VENDORID      0x70000001
-
-// Larger user heap than default: maximum = 16MB
-EPOCHEAPSIZE  0x1000 0x01000000
-
-SMPSAFE
--- a/kerneltest/e32test/group/t_usb_transfersrvclient.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-// 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".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// e32test/group/t_usb_transfersrv.mmp
-// 
-//
-
-TARGET        t_usb_transfersrv.dll
-TARGETTYPE    DLL
-
-UID         0x0 0x20031633
-VENDORID    0x70000001
-
-MACRO		USB_SC
-
-// Header file paths
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-USERINCLUDE	  ../usb/t_usb_device/include
-USERINCLUDE   ../traces_t_usb_transfersrvclient
-
-// Source file paths
-
-SOURCEPATH	  ../usb/t_usb_device/src
-
-
-SOURCE		transfersrv.cpp
-
-deffile			../~/t_usb_transfersrv.def 
-
-LIBRARY     EUSER.LIB HAL.LIB
-LIBRARY		usbcsc_bil.lib
-LIBRARY     EFSRV.LIB
-
-CAPABILITY    ALL
-
-
-// Larger user heap than default: maximum = 16MB
-EPOCHEAPSIZE  0x1000 0x01000000
-
-SMPSAFE
--- a/kerneltest/e32test/group/t_usbapi.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/group/t_usbapi.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2003-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"
@@ -18,8 +18,6 @@
 TARGET        t_usbapi.exe
 TARGETTYPE    exe
 
-USERINCLUDE   ../traces_t_usbapi
-
 SOURCEPATH    ../device
 SOURCE        t_usbapi.cpp
 
--- a/kerneltest/e32test/group/t_usbcsc.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/group/t_usbcsc.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,8 +18,6 @@
 TARGET        t_usbcsc.exe
 TARGETTYPE    exe
 
-USERINCLUDE   ../traces_t_usbcsc
-
 SOURCEPATH    ../device             
 SOURCE        t_usbcsc.cpp
 
@@ -28,7 +26,6 @@
 
 CAPABILITY    all
 
-UID      0x0 0x20031634
 VENDORID 0x70000001
 
 unpaged
--- a/kerneltest/e32test/group/ymodemtx.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-// Copyright (c) 2009-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\ymodemtx.mmp
-// 
-//
-
-target			ymodemtx.exe
-targettype		exe
-sourcepath		../misc
-source			ymodemtx.cpp
-library			euser.lib efsrv.lib
-userinclude		../misc
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-epocheapsize	0x1000 0x01000000
-
-capability		all
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/kerneltest/e32test/hcr/d_hcrsim.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/hcr/d_hcrsim.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -742,62 +742,38 @@
 			}
 		case RHcrSimTestChannel::EHcrGetDataArray:
 			{
-			//args[0] - &aId
-			//args[1] - aMaxLen
-			//args[2] - aValue
-			//args[3] - &aLen
-			
 			// Get list of pointers
 			TAny* args[4];
 			TEST_MEMGET(a1, args, sizeof(args));
 			TUint maxlen = (TUint) args[1];
-			
 			// Retrieve structures from client
 			TSettingId id;
 			TEST_MEMGET(args[0], &id, sizeof(TSettingId));
 			// Allocate temporary memory
 			TUint16 len;
 			TUint8* value;
-			
 			TEST_ENTERCS();
-			//Analyse user input. Some test cases can pass either aMaxLen == 0,
-			//aValue == NULL or both
-			if(args[2] != 0 && args[1] != 0)
-			    {
-			    value = (TUint8*) Kern::Alloc(maxlen);
-			    if(!value) return KErrNoMemory;
-			    }
-			//aValue == NULL, just pass NULL to HCR PIL
-			else if(args[2] == 0)
-			    value = NULL;
-			//aMaxLen = 0, allocate 4 bytes memory 
-			else if(args[1] == 0)
-			    {
-			    value = (TUint8*) Kern::Alloc(4);
-			    if(!value) return KErrNoMemory;
-			    }
-			//aVallue == NULL && aMaxLen == 0
+			value = (TUint8*) Kern::Alloc(maxlen * sizeof(TUint8));
+			TEST_LEAVECS();
+			if (value == NULL)
+				{
+				r = KErrNoMemory;
+				}
 			else
-			    value = NULL;
-			TEST_LEAVECS();
-			
-			
-			// Actual API call
-			r = GetData(id, (TUint16) maxlen,
-			        value, len);
-			// Send value back to client
-			if(value && maxlen)
-			    {
-			    TEST_MEMPUT(args[2], value, maxlen * sizeof(TUint8));
-			    TEST_MEMPUT(args[3], &len, sizeof(TUint16));
-			    }
-			
-			if(value)
-			    {
-			    TEST_ENTERCS();
-			    Kern::Free(value);
-			    TEST_LEAVECS();
-			    }
+				{
+				// Actual API call
+				r = GetData(id, (TUint16) maxlen,
+							value, len);
+				// Send value back to client
+				if (!r)
+					{
+					TEST_MEMPUT(args[2], value, maxlen * sizeof(TUint8));
+					TEST_MEMPUT(args[3], &len, sizeof(TUint16));
+					}
+				TEST_ENTERCS();
+				Kern::Free(value);
+				TEST_LEAVECS();
+				}
 			break;
 			}
 		case RHcrSimTestChannel::EHcrGetDataDes:
@@ -861,74 +837,43 @@
 			break;
 			}
 		case RHcrSimTestChannel::EHcrGetArrayInt:
-		    {
-		    //args[0] - &aId
-		    //args[1] - aMaxLen
-		    //args[2] - aValue
-		    //args[3] - &aLen
-
-		    // Get list of pointers
-		    TAny* args[4];
-		    TEST_MEMGET(a1, args, sizeof(args));
-		    TUint maxlen = (TUint) args[1];
-		    // Retrieve structures from client
-		    TSettingId id;
-		    TEST_MEMGET(args[0], &id, sizeof(TSettingId));
-		    // Allocate temporary memory
-		    TUint16 len;
-		    TInt32* value;
-
-		    TEST_ENTERCS();
-		    //Analyse user input. Some test cases can pass either aMaxLen == 0,
-		    //aValue == NULL or both
-		    if(args[2] != 0 && args[1] != 0)
-		        {
-                value = (TInt32*) Kern::Alloc(maxlen*sizeof(TInt32));
-                if(!value) return KErrNoMemory;
-		        }
-		    //aValue == NULL, just pass NULL to HCR PIL
-		    else if(args[2] == 0)
-		        value = NULL;
-		    //aMaxLen = 0, allocate 4 bytes memory 
-		    else if(args[1] == 0)
-		        {
-                value = (TInt32*) Kern::Alloc(maxlen*sizeof(TInt32));
-                if(!value) return KErrNoMemory;
-		        }
-		    //aVallue == NULL && aMaxLen == 0
-		    else
-		        value = NULL;
-		    TEST_LEAVECS();
-
-
-		    // Actual API call
-		    r = GetArray(id, (TUint16) maxlen,
-		            value, len);
-
-		    // Send value back to client
-		    //aMaxLen > 0 && aValue != NULL
-		    if (args[1] && args[2])
-		        {
-		    TEST_MEMPUT(args[2], value, maxlen);
-		    TEST_MEMPUT(args[3], &len, sizeof(TUint16));
-		        }
-
-		    if(value)
-		        {
-		    TEST_ENTERCS();
-		    Kern::Free(value);
-		    TEST_LEAVECS();
-		        }
-
-		        break;
+			{
+			// Get list of pointers
+			TAny* args[4];
+			TEST_MEMGET(a1, args, sizeof(args));
+			TUint maxlen = (TUint) args[1];
+			// Retrieve structures from client
+			TSettingId id;
+			TEST_MEMGET(args[0], &id, sizeof(TSettingId));
+			// Allocate temporary memory
+			TUint16 len;
+			TInt32* value;
+			TEST_ENTERCS();
+			value = (TInt32*) Kern::Alloc(maxlen);
+			TEST_LEAVECS();
+			if (value == NULL)
+				{
+				r = KErrNoMemory;
+				}
+			else
+				{
+				// Actual API call
+				r = GetArray(id, (TUint16) maxlen,
+							value, len);
+				// Send value back to client
+				if (!r)
+					{
+					TEST_MEMPUT(args[2], value, maxlen);
+					TEST_MEMPUT(args[3], &len, sizeof(TUint16));
+					}
+				TEST_ENTERCS();
+				Kern::Free(value);
+				TEST_LEAVECS();
+				}
+			break;
 			}
 		case RHcrSimTestChannel::EHcrGetArrayUInt:
-		    {
-		    //args[0] - &aId
-		    //args[1] - aMaxLen
-		    //args[2] - aValue
-		    //args[3] - &aLen
-		    
+			{
 			// Get list of pointers
 			TAny* args[4];
 			TEST_MEMGET(a1, args, sizeof(args));
@@ -939,63 +884,35 @@
 			// Allocate temporary memory
 			TUint16 len;
 			TUint32* value;
-			
 			TEST_ENTERCS();
-			//Analyse user input. Some test cases can pass either aMaxLen == 0,
-			//aValue == NULL or both
-			if(args[2] != 0 && args[1] != 0)
-			    {
-			    value = (TUint32*) Kern::Alloc(maxlen*sizeof(TUint32));
-			    if(!value) return KErrNoMemory;
-			    }
-			//aValue == NULL, just pass NULL to HCR PIL
-			else if(args[2] == 0)
-			    value = NULL;
-			//aMaxLen = 0, allocate 4 bytes memory 
-			else if(args[1] == 0)
-			    {
-			    value = (TUint32*) Kern::Alloc(maxlen*sizeof(TUint32));
-			    if(!value) return KErrNoMemory;
-			    }
-			//aVallue == NULL && aMaxLen == 0
-			else
-			    value = NULL;
+			value = (TUint32*) Kern::Alloc(maxlen);
 			TEST_LEAVECS();
-			
-
-			// Actual API call
-			r = GetArray(id, (TUint16) maxlen,
-			        value, len);
-			// Send value back to client
-			
-			//aMaxLine != 0 && aValue != NULL
-			if (args[1] && args[2])
-			    {
-			    TEST_MEMPUT(args[2], value, maxlen);
-			    TEST_MEMPUT(args[3], &len, sizeof(TUint16));
-			    }
-			
-			if(value)
-			    {
-			    TEST_ENTERCS();
-			    Kern::Free(value);
-			    TEST_LEAVECS();
-			    }
-
+			if (value == NULL)
+				{
+				r = KErrNoMemory;
+				}
+			else
+				{
+				// Actual API call
+				r = GetArray(id, (TUint16) maxlen,
+							value, len);
+				// Send value back to client
+				if (!r)
+					{
+					TEST_MEMPUT(args[2], value, maxlen);
+					TEST_MEMPUT(args[3], &len, sizeof(TUint16));
+					}
+				TEST_ENTERCS();
+				Kern::Free(value);
+				TEST_LEAVECS();
+				}
 			break;
 			}
-		    
 		case RHcrSimTestChannel::EHcrGetStringArray:
 			{
 			// Get list of pointers
 			TAny* args[4];
 			TEST_MEMGET(a1, args, sizeof(args));
-			
-			//args[0] - &aId
-			//args[1] - aMaxLen
-			//args[2] - aValue
-			//args[3] - &aLen
-			
 			TUint maxlen = (TUint) args[1];
 			// Retrieve structures from client
 			TSettingId id;
@@ -1003,49 +920,28 @@
 			// Allocate temporary memory
 			TUint16 len;
 			TText8* value;
-
 			TEST_ENTERCS();
-			
-			//Analyse user input. Some test cases can pass either aMaxLen == 0,
-			//aValue == NULL or both
-			if(args[2] != 0 && args[1] != 0)
-			    {
-			    value = (TText8*) Kern::Alloc(maxlen*sizeof(TText8));
-			    if(!value) return KErrNoMemory;
-			    }
-			//aValue == NULL, just pass NULL to HCR PIL
-			else if(args[2] == 0)
-			    value = NULL;
-			//aMaxLen = 0, allocate 4 bytes memory 
-			else if(args[1] == 0)
-			    {
-			    value = (TText8*) Kern::Alloc(maxlen*sizeof(TText8));
-			    if(!value) return KErrNoMemory;
-			    }
-			//aVallue == NULL && aMaxLen == 0
+			value = (TText8*) Kern::Alloc(maxlen * sizeof(TText8));
+			TEST_LEAVECS();
+			if (value == NULL)
+				{
+				r = KErrNoMemory;
+				}
 			else
-			    value = NULL;
-			TEST_LEAVECS();
-
-
-			// Actual API call
-			r = GetString(id, (TUint16) maxlen,
-			        value, len);
-			// Send value back to client
-			//aMaxLen != 0 && aValue != NULL
-			if (args[1] && args[2])
-			    {
-			    TEST_MEMPUT(args[2], value, maxlen * sizeof(TText8));
-			    TEST_MEMPUT(args[3], &len, sizeof(TUint16));
-			    }
-
-			if(value)
-			    {
-			    TEST_ENTERCS();
-			    Kern::Free(value);
-			    TEST_LEAVECS();
-			    }
-			
+				{
+				// Actual API call
+				r = GetString(id, (TUint16) maxlen,
+							value, len);
+				// Send value back to client
+				if (!r)
+					{
+					TEST_MEMPUT(args[2], value, maxlen * sizeof(TText8));
+					TEST_MEMPUT(args[3], &len, sizeof(TUint16));
+					}
+				TEST_ENTERCS();
+				Kern::Free(value);
+				TEST_LEAVECS();
+				}
 			break;
 			}
 		case RHcrSimTestChannel::EHcrGetStringDes:
--- a/kerneltest/e32test/hcr/d_hcrsim_testdata.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/hcr/d_hcrsim_testdata.h	Wed Sep 01 12:34:56 2010 +0100
@@ -259,7 +259,7 @@
 	{{{ KTestCategories[0], 2}, ETypeInt32, 0x0000, 0 }, {{ 0 }}},
 	};
 #if !defined(__KERNEL_MODE__) || defined(HCRTEST_USERSIDE_INTERFACE)
-const TUint32 KTestInvalidCategory = 0;
+const TUint32 KTestInvalidCategory = 1234;
 const TUint32 KTestInvalidSettingId = 5678;
 
 // The following repositories are only used for reference by the test application
Binary file kerneltest/e32test/hcr/filerepos_cds.dat has changed
--- a/kerneltest/e32test/hcr/filerepos_cds.txt	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,580 +0,0 @@
-#Accelerometer device capabilities
-#-------------------------------------------------------------------------------
-#ColumnId   0x0001      0x0002      0x0003      0x0004      0x0005      0x0006
-#-------------------------------------------------------------------------------
-#Name       ManufId     DeviceId    DevName     DataRate    Resol.      Scale
-#-------------------------------------------------------------------------------
-#RowId
-#0x0001     0x12003335  0x2001    "KISemiInc8g" 20          8           8
-#0x0002     0x72103301  0x0012    "SPE Co 4g"   50          16          4
-   
-############################### 
-# KI SemiInc 8g Accelerometer #
-###############################
-# Manafacturer Id
-@
-cuid: 0x00000001
-eid: 65537 
-type: UInt32
-flags: 0x0000
-hexval: 0x12003335 
-.
-
-# Device Id
-@
-cuid: 0x00000001
-eid: 65538 
-type: UInt16
-flags: 0x0000
-hexval: 0x2001 
-.
-
-#Friendly Name
-@
-cuid: 0x00000001
-eid: 65539 
-type: Text8
-flags: 0x0000
-strval: "KI Semi Inc 8g Accelerometer"
-.
-
-# Data Rate(Hz)
-@
-cuid: 0x00000001
-eid: 65540 
-type: UInt16
-flags: 0x0000
-intval: 20 
-.
-
-# Resolution(bits)
-@
-cuid: 0x00000001
-eid: 65541 
-type: UInt16
-flags: 0x0000
-intval: 8 
-.
-
-# Scale g
-@
-cuid: 0x00000001
-eid: 65542 
-type: UInt16
-flags: 0x0000
-intval: 8 
-.
-
-############################### 
-# SPE Co 4g Accelerometer     #
-###############################
-# Manafacturer Id
-@
-cuid: 0x00000001
-eid: 131073 
-type: UInt32
-flags: 0x0000
-hexval: 0x72103301 
-.
-
-# Device Id
-@
-cuid: 0x00000001
-eid: 131074 
-type: UInt16
-flags: 0x0000
-hexval: 0x0012
-.
-
-#Friendly Name
-@
-cuid: 0x00000001
-eid: 131075 
-type: Text8
-flags: 0x0000
-strval: "SPE Co 4g Accelerometer"
-.
-
-# Data Rate(Hz)
-@
-cuid: 0x00000001
-eid: 131076 
-type: UInt16
-flags: 0x0000
-intval: 50 
-.
-
-# Resolution(bits)
-@
-cuid: 0x00000001
-eid: 131077 
-type: UInt16
-flags: 0x0000
-intval: 16 
-.
-
-# Scale g
-@
-cuid: 0x00000001
-eid: 131078 
-type: UInt16
-flags: 0x0000
-intval: 4 
-.
-#############################################
-
-@
-cuid: 0x00000002
-eid: 2
-type: UInt32
-flags: 0x0000
-intval: 555555
-.
-
-@
-cuid: 0x00000002
-eid: 5
-type: UInt16
-flags: 0x0000
-intval: 60000
-.
-
-@
-cuid: 0x00000002
-eid: 8
-type: UInt8
-flags: 0x0000
-intval: 11
-.
-
-@
-cuid: 0x00000002
-eid: 12
-type: LinAddr
-flags: 0x0000
-hexval: 0x0faece50
-.
-
-@
-cuid: 0x000003e8
-eid: 4096
-type: BinData
-flags: 0x0000
-binval: 18 a1 0b bc 61 41 de c9 cd d2 f9 3b ba 99 e5 e2
-binval: fa e0 13 fe 8f d4 e3 50 1a 5e a3 32 39 34 1f 16
-binval: 9a a8 b3 61 1d 7d 7f fd b1 58 af 91 53 f7 76 c4
-binval: da dd
-
-.
-
-@
-cuid: 0x000003e8
-eid: 28672
-type: Text8
-flags: 0x0000
-strval: "These two strings walk up to a bar. The first string walks in and orders and the bartender throws him out and yells 'I don't serve strings in this bar'. The other string ruffs himself up on the street and curls up and orders. The bartender shouts, 'Hey, didn't you hear what I told your buddy?'. The string says 'Yeah.' The bartender says, 'aren't you a string?' The string says, 'No, I'm a frayed knot...'*********************************************************************************************************?"
-.
-
-@
-cuid: 0x000003e8
-eid: 32768
-type: ArrayInt32
-flags: 0x0000
-arrval: 2034128484
-arrval: 358489471
-arrval: -1196607986
-arrval: -1223123619
-arrval: -643073403
-arrval: -1330549099
-.
-
-@
-cuid: 0x10000001
-eid: 4096
-type: Int32
-flags: 0x0000
-intval: 333
-.
-
-@
-cuid: 0x10000001
-eid: 4112
-type: Int16
-flags: 0x0000
-intval: 17632
-.
-
-@
-cuid: 0x10000001
-eid: 4128
-type: Int8
-flags: 0x0000
-intval: 44
-.
-
-@
-cuid: 0x10000001
-eid: 4144
-type: Bool
-flags: 0x0000
-intval: 1
-.
-
-@
-cuid: 0x10000001
-eid: 4160
-type: UInt32
-flags: 0x0000
-intval: 3123123123
-.
-
-@
-cuid: 0x10000001
-eid: 4176
-type: UInt16
-flags: 0x0000
-intval: 18
-.
-
-@
-cuid: 0x10000001
-eid: 4192
-type: UInt8
-flags: 0x0000
-intval: 80
-.
-
-@
-cuid: 0x10000001
-eid: 4208
-type: LinAddr
-flags: 0x0000
-hexval: 0xdeadbeef
-.
-
-@
-cuid: 0x10000002
-eid: 128
-type: BinData
-flags: 0x0000
-binval: 18 a1 0b bc 61 41 de c9 cd d2 f9 3b ba 99 e5 e2
-binval: fa e0 13 fe 8f d4 e3 50 1a 5e a3 32 39 34 1f 16
-binval: 9a a8 b3 61 1d 7d 7f fd b1 58 af 91 53 f7 76 c4
-binval: da dd
-
-.
-
-@
-cuid: 0x10000002
-eid: 147
-type: Text8
-flags: 0x0000
-strval: "A termite walks into a bar and says, 'Is the bar tender here?' #"
-.
-
-@
-cuid: 0x10000002
-eid: 160
-type: ArrayInt32
-flags: 0x0000
-arrval: 2034128484
-arrval: 358489471
-arrval: -1196607986
-arrval: -1223123619
-arrval: -643073403
-arrval: -1330549099
-.
-
-@
-cuid: 0x10000002
-eid: 177
-type: ArrayUInt32
-flags: 0x0000
-arrval: 2034128484
-arrval: 358489471
-arrval: 3098359310
-arrval: 3071843677
-arrval: 3651893893
-arrval: 2964418197
-arrval: 2696294136
-arrval: 1696227301
-arrval: 1516067404
-arrval: 1171111215
-arrval: 45904065
-arrval: 3152352058
-arrval: 204038089
-arrval: 3427962251
-arrval: 3455401965
-arrval: 1362098275
-arrval: 2253564637
-arrval: 3426182366
-arrval: 173516448
-arrval: 3814089518
-arrval: 136723162
-arrval: 2036722935
-arrval: 4113668927
-arrval: 1744493008
-arrval: 2493449248
-arrval: 3579645660
-arrval: 567353362
-arrval: 882914186
-arrval: 386211010
-arrval: 3553761645
-arrval: 2569035486
-arrval: 508738370
-arrval: 2156711458
-arrval: 1917508866
-arrval: 4265921673
-arrval: 2570997289
-arrval: 3925131413
-arrval: 3804548107
-arrval: 2789297085
-arrval: 3612835159
-arrval: 2938836477
-arrval: 2656050096
-arrval: 3214230399
-arrval: 3908414061
-arrval: 2565375854
-arrval: 2461262451
-arrval: 1843121370
-arrval: 3664914997
-arrval: 3998453453
-arrval: 956775374
-arrval: 3966551413
-arrval: 3687801665
-arrval: 2761783920
-arrval: 3143394259
-arrval: 2885547835
-arrval: 1464987787
-arrval: 1940297660
-arrval: 257153229
-arrval: 1950234869
-arrval: 404798999
-arrval: 4170795976
-arrval: 449084638
-arrval: 2206107629
-arrval: 1726753423
-arrval: 3649910521
-arrval: 3495736484
-arrval: 2906992014
-arrval: 696657641
-arrval: 3811005607
-arrval: 1429964498
-arrval: 2130501125
-arrval: 126113280
-arrval: 657988026
-arrval: 412465877
-arrval: 1468324572
-arrval: 2212639033
-arrval: 526226762
-arrval: 4199939442
-arrval: 2447247776
-arrval: 580919075
-arrval: 3399586879
-arrval: 1773665383
-arrval: 2596675710
-arrval: 2204277779
-arrval: 3440949747
-arrval: 2163247371
-arrval: 374652132
-arrval: 2265994439
-arrval: 2525472208
-arrval: 751154667
-arrval: 60655135
-arrval: 1819822599
-arrval: 1996296943
-arrval: 1160968304
-arrval: 3511898622
-arrval: 4008505154
-arrval: 3363107771
-arrval: 3003598970
-arrval: 2321824624
-arrval: 1793148977
-arrval: 192387216
-arrval: 2391359999
-arrval: 3986410788
-arrval: 4170387316
-arrval: 112839256
-arrval: 957431730
-arrval: 2403276842
-arrval: 2443299891
-arrval: 3871206705
-arrval: 2309718684
-arrval: 4239645330
-arrval: 749665729
-arrval: 1567563783
-arrval: 3770371262
-arrval: 3625425678
-arrval: 3724751159
-arrval: 3335150391
-arrval: 1301676466
-arrval: 4209560974
-arrval: 4214040856
-arrval: 1115066926
-arrval: 2972142156
-arrval: 2476797414
-arrval: 882703343
-arrval: 3596997643
-arrval: 3633196855
-arrval: 1247060582
-arrval: 3141938928
-.
-
-@
-cuid: 0x10000002
-eid: 194
-type: Int64
-flags: 0x0000
-binval: ff ff ff ff ff ff ff ff
-.
-
-@
-cuid: 0x10000002
-eid: 208
-type: UInt64
-flags: 0x0000
-binval: 00 00 00 00 00 00 00 00
-.
-
-@
-cuid: 0x10000002
-eid: 4294967295
-type: Int8
-flags: 0x0000
-intval: 1
-.
-
-@
-cuid: 0xffffffff
-eid: 32
-type: ArrayUInt32
-flags: 0x0000
-arrval: 2034128484
-arrval: 358489471
-arrval: 3098359310
-arrval: 3071843677
-arrval: 3651893893
-arrval: 2964418197
-arrval: 2696294136
-arrval: 1696227301
-arrval: 1516067404
-arrval: 1171111215
-arrval: 45904065
-arrval: 3152352058
-arrval: 204038089
-arrval: 3427962251
-arrval: 3455401965
-arrval: 1362098275
-arrval: 2253564637
-arrval: 3426182366
-arrval: 173516448
-arrval: 3814089518
-arrval: 136723162
-arrval: 2036722935
-arrval: 4113668927
-arrval: 1744493008
-arrval: 2493449248
-arrval: 3579645660
-arrval: 567353362
-arrval: 882914186
-arrval: 386211010
-arrval: 3553761645
-arrval: 2569035486
-arrval: 508738370
-arrval: 2156711458
-arrval: 1917508866
-arrval: 4265921673
-arrval: 2570997289
-arrval: 3925131413
-arrval: 3804548107
-arrval: 2789297085
-arrval: 3612835159
-arrval: 2938836477
-arrval: 2656050096
-arrval: 3214230399
-arrval: 3908414061
-arrval: 2565375854
-arrval: 2461262451
-arrval: 1843121370
-arrval: 3664914997
-arrval: 3998453453
-arrval: 956775374
-arrval: 3966551413
-arrval: 3687801665
-arrval: 2761783920
-arrval: 3143394259
-arrval: 2885547835
-arrval: 1464987787
-arrval: 1940297660
-arrval: 257153229
-arrval: 1950234869
-arrval: 404798999
-arrval: 4170795976
-arrval: 449084638
-arrval: 2206107629
-arrval: 1726753423
-arrval: 3649910521
-arrval: 3495736484
-arrval: 2906992014
-arrval: 696657641
-arrval: 3811005607
-arrval: 1429964498
-arrval: 2130501125
-arrval: 126113280
-arrval: 657988026
-arrval: 412465877
-arrval: 1468324572
-arrval: 2212639033
-arrval: 526226762
-arrval: 4199939442
-arrval: 2447247776
-arrval: 580919075
-arrval: 3399586879
-arrval: 1773665383
-arrval: 2596675710
-arrval: 2204277779
-arrval: 3440949747
-arrval: 2163247371
-arrval: 374652132
-arrval: 2265994439
-arrval: 2525472208
-arrval: 751154667
-arrval: 60655135
-arrval: 1819822599
-arrval: 1996296943
-arrval: 1160968304
-arrval: 3511898622
-arrval: 4008505154
-arrval: 3363107771
-arrval: 3003598970
-arrval: 2321824624
-arrval: 1793148977
-arrval: 192387216
-arrval: 2391359999
-arrval: 3986410788
-arrval: 4170387316
-arrval: 112839256
-arrval: 957431730
-arrval: 2403276842
-arrval: 2443299891
-arrval: 3871206705
-arrval: 2309718684
-arrval: 4239645330
-arrval: 749665729
-arrval: 1567563783
-arrval: 3770371262
-arrval: 3625425678
-arrval: 3724751159
-arrval: 3335150391
-arrval: 1301676466
-arrval: 4209560974
-arrval: 4214040856
-arrval: 1115066926
-arrval: 2972142156
-arrval: 2476797414
-arrval: 882703343
-arrval: 3596997643
-arrval: 3633196855
-arrval: 1247060582
-arrval: 3141938928
-.
--- a/kerneltest/e32test/hcr/hcr.inf	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/hcr/hcr.inf	Wed Sep 01 12:34:56 2010 +0100
@@ -46,7 +46,6 @@
 // The emulator test data exported next must match that included into a
 // ROM for the HCR Test suite. See hcr_tests.iby
 
-filerepos_cds.dat     /epoc32/release/wins/udeb/z/sys/data/filerepos_cds.dat
 filerepos_bc0.dat     /epoc32/release/wins/udeb/z/sys/data/filerepos_bc0.dat
 filerepos_bc1.dat     /epoc32/release/wins/udeb/z/sys/data/filerepos_bc1.dat
 filerepos.dat         /epoc32/release/wins/udeb/z/sys/data/filerepos.dat
@@ -58,8 +57,6 @@
 megalarge2.dat        /epoc32/release/wins/udeb/z/sys/data/megalarge2.dat
 filerepos.dat         /epoc32/release/wins/udeb/z/sys/data/hcr.dat
 
-
-filerepos_cds.dat     /epoc32/release/wins/urel/z/sys/data/filerepos_cds.dat
 filerepos_bc0.dat     /epoc32/release/wins/urel/z/sys/data/filerepos_bc0.dat
 filerepos_bc1.dat     /epoc32/release/wins/urel/z/sys/data/filerepos_bc1.dat
 filerepos.dat         /epoc32/release/wins/urel/z/sys/data/filerepos.dat
@@ -71,8 +68,6 @@
 megalarge2.dat        /epoc32/release/wins/urel/z/sys/data/megalarge2.dat
 filerepos.dat         /epoc32/release/wins/urel/z/sys/data/hcr.dat
 
-
-filerepos_cds.dat     /epoc32/release/winscw/udeb/z/sys/data/filerepos_cds.dat
 filerepos_bc0.dat     /epoc32/release/winscw/udeb/z/sys/data/filerepos_bc0.dat
 filerepos_bc1.dat     /epoc32/release/winscw/udeb/z/sys/data/filerepos_bc1.dat
 filerepos.dat         /epoc32/release/winscw/udeb/z/sys/data/filerepos.dat
@@ -84,8 +79,6 @@
 megalarge2.dat        /epoc32/release/winscw/udeb/z/sys/data/megalarge2.dat
 filerepos.dat         /epoc32/release/winscw/udeb/z/sys/data/hcr.dat
 
-
-filerepos_cds.dat     /epoc32/release/winscw/urel/z/sys/data/filerepos_cds.dat
 filerepos_bc0.dat     /epoc32/release/winscw/urel/z/sys/data/filerepos_bc0.dat
 filerepos_bc1.dat     /epoc32/release/winscw/urel/z/sys/data/filerepos_bc1.dat
 filerepos.dat         /epoc32/release/winscw/urel/z/sys/data/filerepos.dat
--- a/kerneltest/e32test/hcr/hcr_tests.iby	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/hcr/hcr_tests.iby	Wed Sep 01 12:34:56 2010 +0100
@@ -44,6 +44,5 @@
 data=##BASEPATH##kernelhwsrv\kerneltest\e32test\hcr\megalarge2.dat    \sys\data\megalarge2.dat	unpaged paging_unmovable
 data=##BASEPATH##kernelhwsrv\kerneltest\e32test\hcr\filerepos_bc0.dat     \sys\data\filerepos_bc0.dat   unpaged paging_unmovable
 data=##BASEPATH##kernelhwsrv\kerneltest\e32test\hcr\filerepos_bc1.dat     \sys\data\filerepos_bc1.dat   unpaged paging_unmovable
-data=##BASEPATH##kernelhwsrv\kerneltest\e32test\hcr\filerepos_cds.dat     \sys\data\filerepos_cds.dat   unpaged paging_unmovable
 hcrdata=##BASEPATH##kernelhwsrv\kerneltest\e32test\hcr\filerepos.dat  \sys\data\hcr.dat
 #endif // __HCR_TEST_IBY__
--- a/kerneltest/e32test/hcr/t_hcr.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/hcr/t_hcr.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -147,27 +147,22 @@
 				{
 				TBuf8<KMaxSettingLength> dval;
 				TUint8* pval;
-				TUint16 maxLen = setting->iName.iLen == 0 ? (TUint16)4: setting->iName.iLen; 
-				
-				pval = (TUint8*) User::Alloc(maxLen);
+				pval = (TUint8*) User::Alloc(setting->iName.iLen);
 				test_NotNull(pval);
 				//
 				r = HcrSimTest.GetData(id, dval);
 				test_KErrNone(r);
 				//
 				TUint16 actuallength;
-				r = HcrSimTest.GetData(id, maxLen, pval, actuallength);
+				r = HcrSimTest.GetData(id, setting->iName.iLen, pval, actuallength);
 				test_KErrNone(r);
 				//
-				if(setting->iName.iLen > 0)
-				    {
-                    test_Equal(0, Mem::Compare(
-				        setting->iValue.iPtr.iData, setting->iName.iLen,
-				        pval, actuallength));
-                    test_Equal(0, Mem::Compare(
-				        setting->iValue.iPtr.iData, setting->iName.iLen,
-				        dval.Ptr(), dval.Length()));
-				    }
+				test_Equal(0, Mem::Compare(
+						setting->iValue.iPtr.iData, setting->iName.iLen,
+						pval, actuallength));
+				test_Equal(0, Mem::Compare(
+						setting->iValue.iPtr.iData, setting->iName.iLen,
+						dval.Ptr(), dval.Length()));
 				User::Free(pval);
 				break;
 				}
@@ -175,41 +170,35 @@
 				{
 				TBuf8<KMaxSettingLength> dval;
 				TText8* pval;
-				TUint16 maxLen = setting->iName.iLen == 0 ? (TUint16)4: setting->iName.iLen;
-				
-				pval = (TText8*) User::Alloc(maxLen);
+				pval = (TText8*) User::Alloc(setting->iName.iLen);
 				test_NotNull(pval);
 				//
 				r = HcrSimTest.GetString(id, dval);
 				test_KErrNone(r);
 				//
 				TUint16 actuallength;
-				r = HcrSimTest.GetString(id, maxLen, pval, actuallength);
+				r = HcrSimTest.GetString(id, setting->iName.iLen, pval, actuallength);
 				test_KErrNone(r);
-
-				if(setting->iName.iLen > 0)
-				    {
-                    test_Equal(0, Mem::Compare(
-				        setting->iValue.iPtr.iString8, setting->iName.iLen,
-				        pval, actuallength));
-                    test_Equal(0, Mem::Compare(
-				        setting->iValue.iPtr.iString8, setting->iName.iLen,
-				        dval.Ptr(), dval.Length()));
-				    }
+				//
+				test_Equal(0, Mem::Compare(
+						setting->iValue.iPtr.iString8, setting->iName.iLen,
+						pval, actuallength));
+				test_Equal(0, Mem::Compare(
+						setting->iValue.iPtr.iString8, setting->iName.iLen,
+						dval.Ptr(), dval.Length()));
 				User::Free(pval);
 				break;
 				}
 			case ETypeArrayInt32:
 				{
 				TInt32* pval;
-				TUint16 maxLen = setting->iName.iLen == 0 ? (TUint16)4: setting->iName.iLen;
-				pval = (TInt32*) User::Alloc(maxLen);
+				pval = (TInt32*) User::Alloc(setting->iName.iLen);
 				test_NotNull(pval);
 				//
 				TUint16 actuallength;
-				r = HcrSimTest.GetArray(id, maxLen, pval, actuallength);
+				r = HcrSimTest.GetArray(id, setting->iName.iLen, pval, actuallength);
 				test_KErrNone(r);
-
+				//
 				test_Equal(setting->iName.iLen, actuallength);
 				TInt32* pexpected = setting->iValue.iPtr.iArrayInt32;
 				TUint i;
@@ -223,14 +212,12 @@
 			case ETypeArrayUInt32:
 				{
 				TUint32* pval;
-				TUint16 maxLen = setting->iName.iLen == 0 ? (TUint16)4: setting->iName.iLen;
-				pval = (TUint32*) User::Alloc(maxLen);
+				pval = (TUint32*) User::Alloc(setting->iName.iLen);
 				test_NotNull(pval);
 				//
 				TUint16 actuallength;
-				r = HcrSimTest.GetArray(id, maxLen, pval, actuallength);
+				r = HcrSimTest.GetArray(id, setting->iName.iLen, pval, actuallength);
 				test_KErrNone(r);
-				
 				//
 				test_Equal(setting->iName.iLen, actuallength);
 				TUint32* pexpected = setting->iValue.iPtr.iArrayUInt32;
@@ -439,135 +426,7 @@
 			r = HcrSimTest.GetUInt(id, val);
 			test_Equal(KErrArgument, r);
 			}
-
-		
-		
-		if(setting->iName.iType == ETypeBinData)
-		    {
-		    TUint8* valBuf;
-		    TUint8* nullBuf = NULL;
-
-		    
-		    //
-		    TUint16 actuallength;
-
-		    TSettingId id(setting->iName.iId.iCat, setting->iName.iId.iKey);
-		    valBuf = (TUint8*) User::Alloc(KMaxSettingLength);
-		    test_NotNull(valBuf);
-
-		    //MaxLength = 0
-		    r = HcrSimTest.GetData(id, 0, valBuf, actuallength);
-		    test_Equal(KErrArgument, r);
-
-		    //buffer is not provided
-		    r = HcrSimTest.GetData(id, KMaxSettingLength, nullBuf, actuallength);
-		    test_Equal(KErrArgument, r);
-		    
-		    //neither buffer is provided nor MaxLength is not zero 
-		    r = HcrSimTest.GetData(id, 0, nullBuf, actuallength);
-		    test_Equal(KErrArgument, r);
-
-
-		    //descriptor MaxLength is zero
-		    //Default constructor sets the MaxLength to zero, so we don't need to call Create(0)
-		    //We also don't need to call Close() for this buffer as well.
-		    RBuf8 nullDes;
-		    r = HcrSimTest.GetData(id, nullDes);
-		    test_Equal(KErrArgument, r);
-
-		    //
-		    User::Free(valBuf);
-		    }
-
-		
-		if(setting->iName.iType == ETypeText8)
-		    {
-		    TUint8* valBuf;
-		    TUint8* nullBuf = NULL;
-		    //
-		    TUint16 actuallength;
-
-		    TSettingId id(setting->iName.iId.iCat, setting->iName.iId.iKey);
-		    valBuf = (TUint8*) User::Alloc(KMaxSettingLength);
-		    test_NotNull(valBuf);
-
-		    //MaxLength = 0
-		    r = HcrSimTest.GetString(id, 0, valBuf, actuallength);
-		    test_Equal(KErrArgument, r);
-
-		    //buffer is not provided
-		    r = HcrSimTest.GetString(id, KMaxSettingLength, nullBuf, actuallength);
-		    test_Equal(KErrArgument, r);
-		    
-		    //neither buffer is not provided nor the aMaxLen is not non-zero
-		    r = HcrSimTest.GetString(id, 0, nullBuf, actuallength);
-		    test_Equal(KErrArgument, r);
-
-
-		    //descriptor MaxLength is zero
-		    //Default constructor sets the MaxLength to zero, so we don't need to call Create(0)
-		    //We also don't need to call Close() for this buffer as well.
-		    RBuf8 nullDesc;
-		    r = HcrSimTest.GetString(id, nullDesc);
-		    test_Equal(KErrArgument, r);
-		    //
-		    User::Free(valBuf);
-		    }
-
-		if(setting->iName.iType == ETypeArrayInt32)
-		    {
-		    TInt32* valBuf;
-		    TInt32* nullBuf = NULL;
-		    valBuf = (TInt32*)User::Alloc(4*KMaxSettingLength);
-		    test_NotNull(valBuf);
-
-		    TUint16 actuallength;
-		    TSettingId id(setting->iName.iId.iCat, setting->iName.iId.iKey);
-
-		    //MaxLength = 0
-		    r = HcrSimTest.GetArray(id, 0, valBuf, actuallength);
-		    test_Equal(KErrArgument, r);
-
-		    //buffer is not provided
-		    r = HcrSimTest.GetArray(id, KMaxSettingLength, nullBuf, actuallength);
-		    test_Equal(KErrArgument, r);
-		    
-		    //neither buffer is not provided nor aMaxLen is not non-zero
-		    r = HcrSimTest.GetArray(id, 0, nullBuf, actuallength);
-		    test_Equal(KErrArgument, r);
-
-
-		    User::Free(valBuf);
-		    }
-
-		if(setting->iName.iType == ETypeArrayUInt32)
-		    {
-		    TUint32* valBuf;
-		    TUint32* nullBuf = NULL;
-		    valBuf = (TUint32*)User::Alloc(4*KMaxSettingLength);
-		    test_NotNull(valBuf);
-
-		    TUint16 actuallength;
-		    TSettingId id(setting->iName.iId.iCat, setting->iName.iId.iKey);
-
-		    //MaxLength = 0
-		    r = HcrSimTest.GetArray(id, 0, valBuf, actuallength);
-		    test_Equal(KErrArgument, r);
-
-		    //buffer is not provided
-		    r = HcrSimTest.GetArray(id, KMaxSettingLength,nullBuf, actuallength);
-		    test_Equal(KErrArgument, r);
-		    
-		    //neither buffer is not provided nor aMaxLen is not non-zero
-		    r = HcrSimTest.GetArray(id, 0, nullBuf, actuallength);
-		    test_Equal(KErrArgument, r);
-
-
-		    User::Free(valBuf);
-		    }
-
 		}
-
 	}
 
 void HcrSimSettingProperties(SSettingC* aRepository, TUint aNumberOfSettings)
@@ -956,68 +815,6 @@
 	User::Free(types);
 	User::Free(errs);
 
-	
-#ifdef _DEBUG
-	test.Next(_L("Multiple Get on all settings, aIds[] is not ordered"));
-	    nosettings = 0;
-	    for (setting = aRepository; setting < aRepository + aNumberOfSettings; setting++)
-	        {
-	        if (setting->iName.iType < 0x00010000)
-	            {
-	            nosettings++;
-	            }
-	        }
-	    test_Compare(2, <, nosettings);
-	    
-	    ids = (SSettingId*) User::Alloc(sizeof(SSettingId) * nosettings);
-	    test_NotNull(ids);
-	    vals = (TInt32*) User::Alloc(sizeof(TInt32) * nosettings);
-	    test_NotNull(vals);
-	    types = (TSettingType*) User::Alloc(sizeof(TSettingType) * nosettings);
-	    test_NotNull(types);
-	    errs = (TInt*) User::Alloc(sizeof(TInt) * nosettings);
-	    test_NotNull(errs);
-	    
-	    n = 0;
-
-	    for (setting = aRepository; setting < aRepository + aNumberOfSettings; setting++)
-	        {
-	        if (setting->iName.iType < 0x00010000)
-	            {
-	            ids[n].iCat = setting->iName.iId.iCat;
-	            ids[n].iKey = setting->iName.iId.iKey;
-	            n++;
-	            }
-	        }
-	    test_Equal(nosettings, n);
-	    
-	    //Swap two neigbours elements in the middle of the user array
-	    HCR::SSettingId tmpSet;
-	    TUint swappedIndex = (n >> 1) - 1;
-	    //Make a copy of one of the swaped element
-	    tmpSet.iCat = ids[swappedIndex].iCat;
-	    tmpSet.iKey = ids[swappedIndex].iKey;
-	    
-	    //Initialized that element with the values of the next one
-	    ids[swappedIndex].iCat = ids[swappedIndex + 1].iCat;
-	    ids[swappedIndex].iKey = ids[swappedIndex + 1].iKey;
-	    
-	    //Write back data from the temproary element
-	    ids[swappedIndex + 1].iCat = tmpSet.iCat;
-	    ids[swappedIndex + 1].iKey = tmpSet.iKey;
-
-	    r = HcrSimTest.GetWordSettings(nosettings, ids, vals, types, errs);
-
-	    //HCR returns KErrArgument because ids array was not properly ordered
-	    test_Equal(KErrArgument, r);
-
-	    User::Free(ids);
-	    User::Free(vals);
-	    User::Free(types);
-	    User::Free(errs);
-#endif
-	
-
 	test.Next(_L("Multiple Get on a large setting"));
 	if (largesetting.iKey)
 		{
@@ -2633,500 +2430,6 @@
 	test.End();
 	}
 
-void HcrCatRecodsExampleTest(const TDesC& aDriver)
-    {
-    using namespace HCR;
-
-   
-    test.Start(_L("HCR Record Structured Category Test"));
-    test.Next(_L("Load HCR Test driver"));
-    
-    test.Printf(_L("%S\n"), &aDriver);
-    TInt r;
-    
-    _LIT8(KTestCatRecordsRepos, "filerepos_cds.dat");
-
-    r = User::LoadLogicalDevice(aDriver);
-    if (r == KErrAlreadyExists)
-        {
-        test.Printf(_L("Unload Device Driver and load it again\n"));
-        r = User::FreeLogicalDevice(aDriver);
-        test_KErrNone(r);
-        r = User::LoadLogicalDevice(aDriver);
-        test_KErrNone(r);
-        }
-    else
-        {
-        test_KErrNone(r);
-        }
-
-    test.Next(_L("Open test channel"));
-    r = HcrSimTest.Open(aDriver);
-    test_KErrNone(r);
-
-    test.Next(_L("Initialise HCR"));
-    //r = HcrSimTest.InitExtension();
-    // *** The NULL Repository ***
-    r = HcrSimTest.InitExtension(ETestNullRepository);
-    test_KErrNone(r);
-
-    test.Next(_L("Load Test File repository"));
-    r = HcrSimTest.SwitchRepository(KTestCatRecordsRepos, HCRInternal::ECoreRepos);
-    test_KErrNone(r);
-    r = HcrSimTest.CheckIntegrity();
-    test_KErrNone(r);
-
-
-
-    struct TAccelCaps
-        {
-        TUint32 iManufactureId;
-        TUint16 iDeviceId;
-        char* iDevName;
-        TUint16 iDataRate;
-        TUint16 iResolution;
-        TUint16 iScale;
-        };
-
-    const TInt KCapsField_Manufacturer = 1;
-    const TInt KCapsField_Device = 2;
-    const TInt KCapsField_Name = 3;
-    const TInt KCapsField_DataRate = 4;
-    const TInt KCapsField_Resolution = 5;
-    const TInt KCapsField_Scale = 6;
-
-    const TInt KMaxNumAccelerateDevices = 2;
-    const TInt KNumElementsInRow = 6;
-
-    const TInt KKiSemiIndex = 0;
-    const TInt KSpecCo4gIndex = 1;
-    char KKiSemiIncDevName[] = "KI Semi Inc 8g Accelerometer";
-    const TUint16 KKiSemiIncDevNameLength = sizeof(KKiSemiIncDevName) - 1;
-    char KSpecCo4gDevName[] = "SPE Co 4g Accelerometer";
-    const TUint16 KSpecCo4gDevNameLength = sizeof(KSpecCo4gDevName) - 1;
-
-    TAccelCaps* capsStructs = new TAccelCaps[KMaxNumAccelerateDevices];
-
-    test_NotNull(capsStructs);
-
-    //Initialisation with the sample data
-    //KI SemiInc 8g
-    capsStructs[KKiSemiIndex].iManufactureId = 0x12003335;
-    capsStructs[KKiSemiIndex].iDeviceId = 0x2001;
-    capsStructs[KKiSemiIndex].iDevName = KKiSemiIncDevName; 
-    capsStructs[KKiSemiIndex].iDataRate = 20;
-    capsStructs[KKiSemiIndex].iResolution = 8;
-    capsStructs[KKiSemiIndex].iScale = 8;
-    //SPE Co 4g
-    capsStructs[KSpecCo4gIndex].iManufactureId = 0x72103301;
-    capsStructs[KSpecCo4gIndex].iDeviceId = 0x0012;
-    capsStructs[KSpecCo4gIndex].iDevName = KSpecCo4gDevName; 
-    capsStructs[KSpecCo4gIndex].iDataRate = 50;
-    capsStructs[KSpecCo4gIndex].iResolution = 16;
-    capsStructs[KSpecCo4gIndex].iScale = 4;
-
-    
-    //Setting the value
-    TUint32 mask = 0x0000ffff;
-    const TUint32 KKiSemiPattern = 0x00010000u;
-    const TUint32 KSpecCo4gPattern = 0x00020000u;
-    const HCR::TCategoryUid category = 0x00000001u;
-
-    //SettingId container, it's used further down in the retrieve operations
-    HCR::TSettingId setId(category,0);
-    
-    //Test Repository elements Ids data
-    HCR::SSettingId repIds[KMaxNumAccelerateDevices][KNumElementsInRow] =
-            {
-                    {
-                            {0x01, 65537}, {0x01, 65538}, {0x01, 65539},
-                            {0x01, 65540}, {0x01, 65541}, {0x01, 65542}
-                    },
-                    {
-                            {0x01, 131073}, {0x01, 131074}, {0x01, 131075},
-                            {0x01, 131076}, {0x01, 131077}, {0x01, 131078}
-                    }
-            };
-    
-
-
-    HCR::TElementId* ids = new TElementId[KNumElementsInRow];
-    test_NotNull(ids);
-    HCR::TSettingType* types = new TSettingType[KNumElementsInRow];
-    test_NotNull(types);
-    TUint16* lengths = new TUint16[KNumElementsInRow];
-    test_NotNull(lengths);
-
-    //------------------------------------------------------------------
-    //Retrieve "ManufactureId" (column request) values for all devices
-    //------------------------------------------------------------------
-    r = HcrSimTest.FindSettings(category, KMaxNumAccelerateDevices, mask, 
-            KCapsField_Manufacturer, ids, types, lengths);
-    //Assert against the error
-    test_Compare(r,>=,0);
-
-    //Check the number of elements
-    test_Equal(KMaxNumAccelerateDevices, r);
-
-    // Check the ids, lengths and types
-    test_Equal(repIds[KKiSemiIndex][KCapsField_Manufacturer - 1].iKey, ids[KKiSemiIndex]);
-    test_Equal(HCR::ETypeUInt32, types[KKiSemiIndex]);
-    test_Equal(0,lengths[KKiSemiIndex]);
-    
-
-    // Check the ids, lengths and types
-    test_Equal(repIds[KSpecCo4gIndex][KCapsField_Manufacturer - 1].iKey, ids[KSpecCo4gIndex]);
-    test_Equal(HCR::ETypeUInt32, types[KSpecCo4gIndex]);
-    test_Equal(0,lengths[KSpecCo4gIndex]);
-
-    
-    //----------------------------
-    //Get all ManufactureId values
-    //----------------------------
-    TUint32 manufId;
-    //KiSemi
-    setId.iKey = ids[KKiSemiIndex];
-    r = HcrSimTest.GetUInt(setId,  manufId);
-    test_KErrNone(r);
-    test_Equal(capsStructs[KKiSemiIndex].iManufactureId,  manufId);
-  
-    //SpecCo 
-    setId.iKey = ids[KSpecCo4gIndex];
-    r = HcrSimTest.GetUInt(setId,  manufId);
-    test_KErrNone(r);
-    test_Equal(capsStructs[KSpecCo4gIndex].iManufactureId,  manufId);
-    
-    
-    
-    //------------------------------------------------------------------
-    //Retrieve "DeviceId" (column request) values for all devices
-    //------------------------------------------------------------------
-    r = HcrSimTest.FindSettings(category, KMaxNumAccelerateDevices, mask, 
-            KCapsField_Device, ids, types, lengths);
-    //Assert against the error
-    test_Compare(r,>=,0);
-
-    //Check the number of elements
-    test_Equal(KMaxNumAccelerateDevices, r);
-
-    // Check the ids, lengths and types
-    test_Equal(repIds[KKiSemiIndex][KCapsField_Device - 1].iKey, ids[KKiSemiIndex]);
-    test_Equal(HCR::ETypeUInt16, types[KKiSemiIndex]);
-    test_Equal(0,lengths[KKiSemiIndex]);
-
-    // Check the ids, lengths and types
-    test_Equal(repIds[KSpecCo4gIndex][KCapsField_Device - 1].iKey, ids[KSpecCo4gIndex]);
-    test_Equal(HCR::ETypeUInt16, types[KSpecCo4gIndex]);
-    test_Equal(0,lengths[KSpecCo4gIndex]);
-
-    
-    //----------------------------
-    //Get all DeviceId values
-    //----------------------------
-    TUint16 devId;
-
-    //KiSemi
-    setId.iKey = ids[KKiSemiIndex];
-    r = HcrSimTest.GetUInt(setId,  devId);
-    test_KErrNone(r);
-    test_Equal(capsStructs[KKiSemiIndex].iDeviceId,  devId);
-  
-    //SpecCo 
-    setId.iKey = ids[KSpecCo4gIndex];
-    r = HcrSimTest.GetUInt(setId, devId);
-    test_KErrNone(r);
-    test_Equal(capsStructs[KSpecCo4gIndex].iDeviceId,  devId);
-
-
-    
-    //------------------------------------------------------------------
-    //Retrieve "DeviceName" (column request) values for all devices
-    //------------------------------------------------------------------
-    r = HcrSimTest.FindSettings(category, KMaxNumAccelerateDevices, mask, 
-            KCapsField_Name, ids, types, lengths);
-    
-    //Assert against the error
-    test_Compare(r,>=,0);
-
-    //Check the number of elements
-    test_Equal(KMaxNumAccelerateDevices, r);
-
-    // Check the ids, lengths and types
-    test_Equal(repIds[KKiSemiIndex][KCapsField_Name - 1].iKey, ids[KKiSemiIndex]);
-    test_Equal(HCR::ETypeText8, types[KKiSemiIndex]);
-    test_Equal(KKiSemiIncDevNameLength,lengths[KKiSemiIndex]);
-
-    // Check the ids, lengths and types
-    test_Equal(repIds[KSpecCo4gIndex][KCapsField_Name - 1].iKey, ids[KSpecCo4gIndex]);
-    test_Equal(HCR::ETypeText8, types[KSpecCo4gIndex]);
-    test_Equal(KSpecCo4gDevNameLength,lengths[KSpecCo4gIndex]);
-
-
-    //----------------------------
-    //Get all DeviceName values
-    //----------------------------
-    TUint16 len;
-    
-    //KiSemi
-    TText8* nameKiSemi = new TText8[KKiSemiIncDevNameLength];
-    test_NotNull(nameKiSemi);
-    
-    setId.iKey = ids[KKiSemiIndex];
-    r = HcrSimTest.GetString(setId, KKiSemiIncDevNameLength, 
-            nameKiSemi, len);
-    test_KErrNone(r);
-    r = memcompare((unsigned char*)capsStructs[KKiSemiIndex].iDevName, (int)KKiSemiIncDevNameLength,
-            nameKiSemi, (int)KKiSemiIncDevNameLength);
-    test_KErrNone(r);
-
-    //SpecCo 
-    TText8* nameSpecCo = new TText8[KSpecCo4gDevNameLength];
-    test_NotNull(nameSpecCo);
-    
-    setId.iKey = ids[KSpecCo4gIndex];
-    r = HcrSimTest.GetString(setId, KSpecCo4gDevNameLength, 
-            nameSpecCo, len);
-    test_KErrNone(r);
-    r = memcompare((unsigned char*)capsStructs[KSpecCo4gIndex].iDevName, 
-            (int)KSpecCo4gDevNameLength, nameSpecCo, (int)KSpecCo4gDevNameLength);
-    test_KErrNone(r);
-
-    
-    
-    //------------------------------------------------------------------
-    //Retrieve "DataRate" (column request) values for all devices
-    //------------------------------------------------------------------
-    r = HcrSimTest.FindSettings(category, KMaxNumAccelerateDevices, mask, 
-            KCapsField_DataRate, ids, types, lengths);
-    //Assert against the error
-    test_Compare(r,>=,0);
-
-    //Check the number of elements
-    test_Equal(KMaxNumAccelerateDevices, r);
-
-    // Check the ids, lengths and types
-    test_Equal(repIds[KKiSemiIndex][KCapsField_DataRate - 1].iKey, ids[KKiSemiIndex]);
-    test_Equal(HCR::ETypeUInt16, types[KKiSemiIndex]);
-    test_Equal(0,lengths[KKiSemiIndex]);
-
-    // Check the ids, lengths and types
-    test_Equal(repIds[KSpecCo4gIndex][KCapsField_DataRate - 1].iKey, ids[KSpecCo4gIndex]);
-    test_Equal(HCR::ETypeUInt16, types[KSpecCo4gIndex]);
-    test_Equal(0,lengths[KSpecCo4gIndex]);
-
-
-    //----------------------------
-    //Get all DataRate values
-    //----------------------------
-    TUint16 dataRate;
-
-    //KiSemi
-    setId.iKey = ids[KKiSemiIndex];
-    r = HcrSimTest.GetUInt(setId,  dataRate);
-    test_KErrNone(r);
-    test_Equal(capsStructs[KKiSemiIndex].iDataRate, dataRate);
-
-    //SpecCo 
-    setId.iKey = ids[KSpecCo4gIndex];
-    r = HcrSimTest.GetUInt(setId, dataRate);
-    test_KErrNone(r);
-    test_Equal(capsStructs[KSpecCo4gIndex].iDataRate,  dataRate);
-
-    
-    //------------------------------------------------------------------
-    //Retrieve "Resolution" (column request) values for all devices
-    //------------------------------------------------------------------
-    r = HcrSimTest.FindSettings(category, KMaxNumAccelerateDevices, mask, 
-            KCapsField_Resolution, ids, types, lengths);
-    //Assert against the error
-    test_Compare(r,>=,0);
-
-    //Check the number of elements
-    test_Equal(KMaxNumAccelerateDevices, r);
-
-    // Check the ids, lengths and types
-    test_Equal(repIds[KKiSemiIndex][KCapsField_Resolution - 1].iKey, ids[KKiSemiIndex]);
-    test_Equal(HCR::ETypeUInt16, types[KKiSemiIndex]);
-    test_Equal(0,lengths[KKiSemiIndex]);
-
-    // Check the ids, lengths and types
-    test_Equal(repIds[KSpecCo4gIndex][KCapsField_Resolution - 1].iKey, ids[KSpecCo4gIndex]);
-    test_Equal(HCR::ETypeUInt16, types[KSpecCo4gIndex]);
-    test_Equal(0,lengths[KSpecCo4gIndex]);
-
-
-    //----------------------------
-    //Get all "Resolution" values
-    //----------------------------
-    TUint16 resolution;
-
-    //KiSemi
-    setId.iKey = ids[KKiSemiIndex];
-    r = HcrSimTest.GetUInt(setId,  resolution);
-    test_KErrNone(r);
-    test_Equal(capsStructs[KKiSemiIndex].iResolution, resolution);
-
-    //SpecCo 
-    setId.iKey = ids[KSpecCo4gIndex];
-    r = HcrSimTest.GetUInt(setId, resolution);
-    test_KErrNone(r);
-    test_Equal(capsStructs[KSpecCo4gIndex].iResolution, resolution);
-
-
-    //------------------------------------------------------------------
-    //Retrieve "Scale" (column request) values for all devices
-    //------------------------------------------------------------------
-    r = HcrSimTest.FindSettings(category, KMaxNumAccelerateDevices, mask, 
-            KCapsField_Scale, ids, types, lengths);
-    //Assert against the error
-    test_Compare(r,>=,0);
-
-    //Check the number of elements
-    test_Equal(KMaxNumAccelerateDevices, r);
-
-    // Check the ids, lengths and types
-    test_Equal(repIds[KKiSemiIndex][KCapsField_Scale - 1].iKey, ids[KKiSemiIndex]);
-    test_Equal(HCR::ETypeUInt16, types[KKiSemiIndex]);
-    test_Equal(0,lengths[KKiSemiIndex]);
-
-    // Check the ids, lengths and types
-    test_Equal(repIds[KSpecCo4gIndex][KCapsField_Scale - 1].iKey, ids[KSpecCo4gIndex]);
-    test_Equal(HCR::ETypeUInt16, types[KSpecCo4gIndex]);
-    test_Equal(0,lengths[KSpecCo4gIndex]);
-
-
-    //----------------------------
-    //Get all "Scale" values
-    //----------------------------
-    TUint16 scale;
-
-    //KiSemi
-    setId.iKey = ids[KKiSemiIndex];
-    r = HcrSimTest.GetUInt(setId,  scale);
-    test_KErrNone(r);
-    test_Equal(capsStructs[KKiSemiIndex].iScale, scale);
-
-    //SpecCo 
-    setId.iKey = ids[KSpecCo4gIndex];
-    r = HcrSimTest.GetUInt(setId, scale);
-    test_KErrNone(r);
-    test_Equal(capsStructs[KSpecCo4gIndex].iScale, scale);
-    
-    
-    
-    //-----------------------------------------------------------------------
-    //Read a complete row data for the single device
-    //-----------------------------------------------------------------------
-    mask = 0xffff0000; //retrive a row
-    
-    //------------------------
-    //KiSemi
-    //------------------------
-    r = HcrSimTest.FindSettings(category, KNumElementsInRow, mask, 
-            KKiSemiPattern, ids, types, lengths);
-    //Assert against the error
-    test_Compare(r,>=,0);
-    
-    //Assert the number of found elements
-    test_Equal(KNumElementsInRow, r);
-    
-    //Check the ManufactureId
-    setId.iKey = ids[KCapsField_Manufacturer-1];
-    r = HcrSimTest.GetUInt(setId,  manufId);
-    test_KErrNone(r);
-    test_Equal(capsStructs[KKiSemiIndex].iManufactureId,  manufId);
-    
-    //Check the DeviceId
-    setId.iKey = ids[KCapsField_Device-1];
-    r = HcrSimTest.GetUInt(setId,  devId);
-    test_KErrNone(r);
-    test_Equal(capsStructs[KKiSemiIndex].iDeviceId,  devId);
-    
-    //Check the DeviceName
-    setId.iKey = ids[KCapsField_Name-1];
-    r = HcrSimTest.GetString(setId, KKiSemiIncDevNameLength, 
-            nameKiSemi, len);
-    test_KErrNone(r);
-    r = memcompare((unsigned char*)capsStructs[KKiSemiIndex].iDevName,
-        (int)KKiSemiIncDevNameLength, nameKiSemi, (int)KKiSemiIncDevNameLength);
-    test_KErrNone(r);
-    
-    //Check the DataRate
-    setId.iKey = ids[KCapsField_DataRate-1];
-    r = HcrSimTest.GetUInt(setId,  dataRate);
-    test_KErrNone(r);
-    test_Equal(capsStructs[KKiSemiIndex].iDataRate, dataRate);
-
-    
-    //Check the Resolution
-    setId.iKey = ids[KCapsField_Resolution-1];
-    r = HcrSimTest.GetUInt(setId,  resolution);
-    test_KErrNone(r);
-    test_Equal(capsStructs[KKiSemiIndex].iResolution, resolution);
-
-    //------------------------
-    //SpecCo
-    //------------------------
-    r = HcrSimTest.FindSettings(category, KNumElementsInRow, mask, 
-            KSpecCo4gPattern, ids, types, lengths);
-    //Assert against the error
-    test_Compare(r,>=,0);
-
-    //Assert the number of found elements
-    test_Equal(KNumElementsInRow, r);
-
-    //Check the ManufactureId
-    setId.iKey = ids[KCapsField_Manufacturer-1];
-    r = HcrSimTest.GetUInt(setId,  manufId);
-    test_KErrNone(r);
-    test_Equal(capsStructs[KSpecCo4gIndex].iManufactureId,  manufId);
-
-    //Check the DeviceId
-    setId.iKey = ids[KCapsField_Device-1];
-    r = HcrSimTest.GetUInt(setId,  devId);
-    test_KErrNone(r);
-    test_Equal(capsStructs[KSpecCo4gIndex].iDeviceId,  devId);
-
-    //Check the DeviceName
-    setId.iKey = ids[KCapsField_Name-1];
-    r = HcrSimTest.GetString(setId, KSpecCo4gDevNameLength, 
-            nameSpecCo, len);
-    test_KErrNone(r);
-    r = memcompare((unsigned char*)capsStructs[KSpecCo4gIndex].iDevName,
-          (int)KSpecCo4gDevNameLength, nameSpecCo, (int)KSpecCo4gDevNameLength);
-    test_KErrNone(r);
-
-    //Check the DataRate
-    setId.iKey = ids[KCapsField_DataRate-1];
-    r = HcrSimTest.GetUInt(setId,  dataRate);
-    test_KErrNone(r);
-    test_Equal(capsStructs[KSpecCo4gIndex].iDataRate, dataRate);
-
-    //Check the Resolution
-    setId.iKey = ids[KCapsField_Resolution-1];
-    r = HcrSimTest.GetUInt(setId,  resolution);
-    test_KErrNone(r);
-    test_Equal(capsStructs[KSpecCo4gIndex].iResolution, resolution);
-
-
-    //Deallocate allocated resources
-    delete[] ids;
-    delete[] types;
-    delete[] lengths;
-    
-    delete[] nameKiSemi;
-    delete[] nameSpecCo;
-    
-    delete[] capsStructs;
-    
-
-    HcrSimTest.Close();
-    r = User::FreeLogicalDevice(aDriver);
-    test_KErrNone(r);
-    test.End();
-    }
-    
-
 void HcrSimBenchmarkTests(const TDesC& aDriver)
 	{
 	test.Next(_L("Simulated HCR Benchmark"));
@@ -3336,9 +2639,7 @@
 	HcrPslTests(KTestHcrSimClient);
 	HcrSimTests(KTestHcrSimOwn);
 	HcrSimTests(KTestHcrSimClient);
-	
-	HcrCatRecodsExampleTest(KTestHcrSimOwn);
-	HcrCatRecodsExampleTest(KTestHcrSimClient);
+
 
 	//Benchmark tests
 	HcrSimBenchmarkTests(KTestHcrSimOwn);
--- a/kerneltest/e32test/heap/t_fail.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/heap/t_fail.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -227,18 +227,6 @@
 	__UHEAP_RESET;
 	__UHEAP_MARK;
 
-	// Make sure that we can retrieve the failure type set with __UHEAP_SETFAIL
-	test.Next(_L("Set and get user heap failure simulation mode"));
-	__UHEAP_SETFAIL(RHeap::EFailNext, 1);
-	test(User::__DbgGetAllocFail(EFalse) == RHeap::EFailNext);
-	__UHEAP_SETFAIL(RHeap::ENone, 0);
-
-	// Make sure that we can retrieve the failure type set with __KHEAP_SETFAIL
-	test.Next(_L("Set and get kernel heap failure simulation mode"));
-	__KHEAP_SETFAIL(RHeap::EFailNext, 1);
-	test(User::__DbgGetAllocFail(ETrue) == RHeap::EFailNext);
-	__KHEAP_SETFAIL(RHeap::ENone, 0);
-
 	// Prepare for __RHEAP tests
 	TInt pageSize;
 	test_KErrNone(HAL::Get(HAL::EMemoryPageSize, pageSize));
--- a/kerneltest/e32test/heap/t_hcomp.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/heap/t_hcomp.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -39,12 +39,7 @@
 	if (heap1==NULL)
 		return KErrNoMemory;
 
-	// Need this horrible construct because RVCT4 complains that the return is
-	// unreachable code.  Without it, though, other code analysers will complain
-	// that there is a missing return value!	
-	volatile TInt forever = 1;
-	
-	while(forever)
+	FOREVER
 		{
 		TUint8* ptr=(TUint8*)heap1->Alloc(heapsize);	// fail, compress, fail
 		User::After(1000);	// quite soon
--- a/kerneltest/e32test/heap/t_heap.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/heap/t_heap.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -66,10 +66,6 @@
 #include <e32hal.h>
 #include <e32def.h>
 #include <e32def_private.h>
-#include "dla.h"
-#include "slab.h"
-#include "page_alloc.h"
-#include "heap_hybrid.h"
 
 // Sets data for Test6
 #define SetData(size)	pHeap->Reset();\
@@ -94,8 +90,7 @@
 #endif
 
 const TInt KHeadSize = (TInt)RHeap::EAllocCellSize;
-
-const TInt KAlign = RHeap::ECellAlignment;
+const TInt KAlign = _FOFF(RHeap::_s_align, d);
 const TInt KMinCellLength = _ALIGN_UP((KHeapMinCellSize + Max(TInt(RHeap::EFreeCellSize),TInt(RHeap::EAllocCellSize))),KAlign) - RHeap::EAllocCellSize;
 const TInt KMinFreeSize = _ALIGN_UP((KHeapMinCellSize + Max(TInt(RHeap::EFreeCellSize),TInt(RHeap::EAllocCellSize))),KAlign);
 
@@ -113,7 +108,7 @@
 	RChunk				iChunk;
 	TUint8				*iBase;
 	TUint8				*iTop;
-	//RHeap::SCell		iFree;
+	RHeap::SCell		iFree;
 	};
 
 #pragma warning ( disable :4705 ) // statement has no effect
@@ -123,15 +118,12 @@
 #if defined(_DEBUG)
 void RTestHeap::__DbgTest(void* aPtr) const
 	{
-	(void) aPtr;
-/*	
 	RHeapDump& d = *(RHeapDump*)aPtr;
 	d.iMinLength=iMinLength;
 	d.iChunk.SetHandle(iChunkHandle);
 	d.iBase=iBase;
 	d.iTop=iTop;
 	d.iFree=iFree;
-*/	
 	}
 #endif
 
@@ -139,8 +131,6 @@
 #if defined(_DEBUG)
 TBool Invariant(RHeap* aHeap)
 	{
-	(void) aHeap;
-/*	
 	RHeapDump dump;
 	((RTestHeap*)aHeap)->__DbgTest(&dump);
 	if(dump.iMinLength!=OrigDump.iMinLength) 		return(EFalse);
@@ -151,7 +141,6 @@
 	if(dump.iTop[-1]!=OrigDump.iTop[-1])	return(EFalse);	
 	if(dump.iFree.len!=OrigDump.iFree.len)	return(EFalse);
 	// iFree.Next changes during allocation/freeing etc.
-*/
 	return(ETrue);
 	}
 #define INV(x) x;
@@ -164,23 +153,6 @@
 LOCAL_D RHeap *gHeapPtr;
 LOCAL_D RHeap *gHeapPtr2;
 
-/*
-Friend class of RHeapHybrid to access to hybrid heap metadata
-*/
-class TestHybridHeap
-{
-public:
-    static TBool IsHybrid(const RHybridHeap * aHybridHeap);
-};
-
-TBool TestHybridHeap::IsHybrid(const RHybridHeap * aHybridHeap)
-  {
-  if (aHybridHeap->iDLOnly)
-      return EFalse;
-  else
-      return ETrue;
-  }
-
 class TestRHeap
 	{
 public:
@@ -244,9 +216,8 @@
 
 	((RTestHeap*)pHeap)->__DbgTest(&OrigDump);
 	((RTestHeap*)pHeap)->__DbgTest(&dump);
-	
-//	test(dump.iBase==pHeap->Base());
-//	test((dump.iTop-dump.iBase)==pHeap->Size());
+	test(dump.iBase==pHeap->Base());
+	test((dump.iTop-dump.iBase)==pHeap->Size());
 	pHeap->Check();
 	test(Invariant(pHeap));
 	pHeap->Close();
@@ -539,12 +510,33 @@
 	// Resize positively
 	for(TInt aSize=0; aSize<=BiggestBlock; aSize++, pHeap->Available(BiggestBlock))
 		{
-		aCell = pHeap->ReAlloc(aCell, aSize); 
-		test(aCell!=NULL); 
+		test(pHeap->ReAlloc(aCell, aSize)!=NULL); 
 		CellSize=pHeap->AllocLen(aCell);
 		test(CellSize>=aSize);
+		if (aSize<KMinCellLength)
+			test(CellSize==KMinCellLength);
+		else
+			test(CellSize<aSize+KAlign);
 		}
 
+	// Note: when increasing a cell size the size is rounded up to the nearest 4 but when 
+	// decreasing a cell the size is rounded down to the nearest 8 - this is due to the fact
+	// that when memory is released its size must be big enough to hold a free cell header which
+	// is greater(8) than an allocated header(4)
+	// i.e. size = 16, resize to 17 => result  is 20. But resize to 15 stays as 16, resize to 9
+	// stays as 16 but resize as 8 will resize to 8
+
+	for(TInt aSize2=(TInt)pHeap->AllocLen(aCell); aSize2>=0; aSize2--)
+		{
+		test(pHeap->ReAlloc(aCell, aSize2)!=NULL);
+
+		test((TInt)pHeap->AllocLen(aCell)>=aSize2);		
+
+		TInt aTmpSize2 = Max(_ALIGN_UP(aSize2 + RHeap::EAllocCellSize, KAlign), KMinFreeSize);
+
+		test((TInt)pHeap->AllocLen(aCell)<=aTmpSize2+KMinFreeSize);		
+		}
+  
 	pHeap->Check();
 	pHeap->Reset();
 	// Allocate a block, fill with data, allocate another block or two then resize the original
@@ -746,18 +738,6 @@
 	RMyHeap* myHeap=(RMyHeap*)User::ChunkHeap(&myHeapName,0x100,0x2000);
 const TInt KnormHeapGrowBy = 0x2000;
 	RHeap* normHeap=User::ChunkHeap(NULL,0x100,0x20000,KnormHeapGrowBy);
-	//
-	// Configure paged heap threshold 128 Kb (pagepower 17)
-	//
-	RHybridHeap::STestCommand conf;
-	conf.iCommand = RHybridHeap::EGetConfig;
-	if ( normHeap->DebugFunction(RHeap::EHybridHeap, (TAny*)&conf ) == KErrNone )
-		{
-		test.Printf(_L("New allocator detected, configuring paged threshold to 128 kb\r\n"));
-		conf.iCommand = RHybridHeap::ESetConfig;
-		conf.iConfig.iPagePower = 17;
-		test( normHeap->DebugFunction(RHeap::EHybridHeap, (TAny*)&conf ) == KErrNone);
-		}
 
 	TAny* ptrMy1=myHeap->Alloc(0x102);
 	test(ptrMy1!=NULL);
@@ -804,8 +784,8 @@
 	// Calc the amount, if any, the overall size of normHeap will have been shrunk by
 	// will depend on value of KHeapShrinkHysRatio.
 	// 1st calc current total size of the allocated cells
-	TInt normAllocdSize = 	normHeap->AllocLen(ptrNorm1)+KHeadSize +
-							normHeap->AllocLen(ptrNorm2)+KHeadSize;
+	TInt normAllocdSize = 	normHeap->AllocLen(ptrNorm1)+RHeap::EAllocCellSize +
+							normHeap->AllocLen(ptrNorm2)+RHeap::EAllocCellSize;
 	TInt normReduce = RHeapCalcReduce(oldNormHeapSize-normAllocdSize,KnormHeapGrowBy);
 	oldNormHeapSize -= normReduce;
 	test(r==oldNormHeapSize);
@@ -817,7 +797,7 @@
 	r=myHeap->Size();
 
 	// Calc the current total size of the allocated cells
-	TInt myAllocdSize = myHeap->AllocLen(ptrMy1)+KHeadSize;
+	TInt myAllocdSize = myHeap->AllocLen(ptrMy1)+RHeap::EAllocCellSize;
 	TInt myReduce=RHeapCalcReduce(oldMyHeapSize-myAllocdSize,1);
 	oldMyHeapSize -= myReduce;
 	test(r==oldMyHeapSize);
@@ -884,6 +864,7 @@
 		test(last+space <= chunk.Base()+size);
 		// but that it is within the alignment requirement, as less than this
 		// would be short of the end
+		test(last+space > chunk.Base()+size-RHeap::ECellAlignment);
 		}
 	else
 		{
@@ -1145,7 +1126,6 @@
 	test.Start(_L("Create chunk to"));
 	TPtrC autoHeap=_L("AutoHeap");
 	gHeapPtr=User::ChunkHeap(&autoHeap,0x1800,0x6000);
-	
 	test(gHeapPtr!=NULL);
 	TInt biggest;
 	TInt avail=gHeapPtr->Available(biggest);
@@ -1180,133 +1160,13 @@
 	test(comp==0);
 	TInt biggest1;
 	TInt avail1=gHeapPtr->Available(biggest1);
-	test(avail==avail1);
+	test(avail1==avail1);
 	test(biggest==biggest1);
 	test(gHeapPtr->Count()==0);
 	gHeapPtr->Close();
 	test.End();
 	}
 
-LOCAL_C TInt NormalChunk(RChunk& aChunk, TInt aInitialSize, TInt aMaxSize)
-    {
-    TChunkCreateInfo createInfo;
-    createInfo.SetNormal(aInitialSize, aMaxSize);
-    TInt r=aChunk.Create(createInfo);
-    return r;
-    }    
-
-LOCAL_C TInt DisconnectedChunk(RChunk& aChunk, TInt aInitialBottom, TInt aInitialTop, TInt aMaxSize)
-    {
-    TChunkCreateInfo createInfo;
-    createInfo.SetDisconnected(aInitialBottom, aInitialTop, aMaxSize);
-    TInt r=aChunk.Create(createInfo);
-    return r;  
-    }
-
-LOCAL_C TBool TestIsHybridHeap(RHeap* aHeap)
-    {
-    RHybridHeap::STestCommand cmd;
-    cmd.iCommand = RHybridHeap::EHeapMetaData;
-    aHeap->DebugFunction(RHeap::EHybridHeap, (TAny*)&cmd, 0);
-               
-    RHybridHeap* hybridHeap = (RHybridHeap*) cmd.iData;
-    return (TestHybridHeap::IsHybrid(hybridHeap));  
-    }
-
-LOCAL_C void TestHeapType()
-    {
-    TBool onlyDL = EFalse;
-    _LIT(KHeap, "NamedHeap");
-    // 1: Create a heap in a local chunk
-    RHeap* heap;
-    heap = UserHeap::ChunkHeap(NULL,0x100,0x2000);
-    TBool hybrid = TestIsHybridHeap(heap);
-    if (hybrid==0)
-        {
-        test.Printf(_L("Only DL allocator is in use \n"));
-        onlyDL = ETrue;;
-        }
-    else
-        test(hybrid==1); 
-    heap->Close();
-    
-    // 2: Create a heap in a global chunk
-    heap = UserHeap::ChunkHeap(&KHeap,0,0x1800,0x6000);
-    hybrid = TestIsHybridHeap(heap);
-    if(!onlyDL)
-        test(hybrid==1); 
-    heap->Close();
-    
-    // 3: Create a heap in an existing normal chunk
-    RChunk chunk;
-    TInt r = NormalChunk(chunk,0,0x1000);
-    heap = UserHeap::ChunkHeap(chunk,0);
-    hybrid = TestIsHybridHeap(heap);
-    test(hybrid==0);
-    heap->Close();
-                   
-    // 4: Create a heap in an existing disconnected chunk
-    // when offset = 0.  Minimum heap size for a hybrid heap is 12KB
-    r = DisconnectedChunk(chunk,0,0,0x3000);
-    heap = UserHeap::ChunkHeap(chunk,0);
-    hybrid = TestIsHybridHeap(heap);
-    if(!onlyDL)
-        test(hybrid==1);
-    heap->Close();
-        
-    // 5: Create a heap in an existing disconnected chunk
-    // when offset > 0
-    r = DisconnectedChunk(chunk,0,0x1800,0x6000); 
-    heap = UserHeap::OffsetChunkHeap(chunk,0,0x2800);
-    hybrid = TestIsHybridHeap(heap);
-    test(hybrid==0);
-    heap->Close();
-    
-    // 6: Create a fixed length heap at a normal chunk's base address 
-    r = NormalChunk(chunk,0x1000,0x1000);
-    heap = UserHeap::FixedHeap(chunk.Base(), 0x1000);
-    hybrid = TestIsHybridHeap(heap);
-    test(hybrid==0);
-    heap->Close();
-    chunk.Close();
-    
-    // 7: Create a fixed length heap at a disconnected chunk's base address
-    // when bottom = 0
-    r = DisconnectedChunk(chunk,0,0x2000,0x2000); 
-    heap = UserHeap::FixedHeap(chunk.Base(), 0x2000);
-    hybrid = TestIsHybridHeap(heap);
-    test(hybrid==0);
-    heap->Close();
-    chunk.Close();
-        
-    // 8: Create a fixed length heap at a disconnected chunk's base address
-    // when bottom > 0
-    r = DisconnectedChunk(chunk,0x6000,0x7000,0x13000); 
-    heap = UserHeap::FixedHeap(chunk.Base()+ 0x6000, 0x1000); 
-    hybrid = TestIsHybridHeap(heap);
-    test(hybrid==0);
-    heap->Close();
-    chunk.Close();
-    
-    // 9: Create a fixed length heap for allocated buffer
-    heap = UserHeap::ChunkHeap(&KNullDesC(), 4096, (4096 * 1024));
-    test(heap != NULL);
-    TAny* buffer = heap->Alloc(1024 * 1024);    
-    test(buffer != NULL);
-    TInt lth = heap->AllocLen(buffer);
-    test.Printf(_L("Fixed heap buffer: %x, length: %x \n"), buffer, lth);  
-
-    RHeap* heapf = UserHeap::FixedHeap(buffer, (1024 * 1024));
-    test(heapf != NULL);
-    test.Printf(_L("Fixed heap: %x \n"), heapf);
-    hybrid = TestIsHybridHeap(heapf);
-    test(hybrid==0);
-
-    heapf->Close();
-    heap->Free(buffer);
-
-    heap->Close();
-    }
 
 GLDEF_C TInt E32Main(void)
 	{
@@ -1318,7 +1178,6 @@
 	test.Start(_L("Test 1"));
 	UserHal::PageSizeInBytes(PageSize);
         TestRHeap T;
-
 	T.Test1();
 	test.Next(_L("Test auto expand and compress"));
 	TestAuto();
@@ -1345,12 +1204,10 @@
 	test.Next(_L("Shared heap test 3"));
 	SharedHeapTest3();
 	sem.Close();
-	test.Next(_L("Test HeapType()"));    
-	TestHeapType();
 
 	__KHEAP_CHECK(0);
 	__KHEAP_MARKEND;
-
+//
 	test.End();
 	return(0);
     }
--- a/kerneltest/e32test/heap/t_heap2.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/heap/t_heap2.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -44,10 +44,6 @@
 #include <e32hal.h>
 #include <e32def.h>
 #include <e32def_private.h>
-#include "dla.h"
-#include "slab.h"
-#include "page_alloc.h"
-#include "heap_hybrid.h"
 
 // Needed for KHeapShrinkHysRatio which is now ROM 'patchdata'
 #include "TestRHeapShrink.h"
@@ -62,10 +58,6 @@
        const TInt KHeapMinCellSize = 0;
 #endif
 
-	   const TInt KAllocCellSize = (TInt)RHeap::EAllocCellSize;
-	   const TInt KSizeOfHeap = (TInt)sizeof(RHybridHeap);	   
-	   
-	   
 RTest test(_L("T_HEAP2"));
 
 #define	TEST_ALIGN(p,a)		test((TLinAddr(p)&((a)-1))==0)
@@ -86,6 +78,7 @@
 	{
 	TInt i;
 	TUint32 x = (TUint32)this ^ (TUint32)aLength ^ (TUint32)EMagic;
+	aLength -= RHeap::EAllocCellSize;
 	if (aLength==0)
 		return;
 	iLength = x;
@@ -107,7 +100,8 @@
 	{
 	TInt i;
 	TUint32 x = (TUint32)aInitPtr ^ (TUint32)aInitLength ^ (TUint32)EMagic;
-	if ( aLength < (TInt) sizeof(*this) )
+	aLength -= RHeap::EAllocCellSize;
+	if (aLength==0)
 		return;
 	test(iLength == x);
 	aLength /= sizeof(TUint32);
@@ -119,11 +113,26 @@
 		}
 	}
 
-
-	
 class RTestHeap : public RHeap
 	{
 public:
+	DECL_GET(TInt,AccessCount)
+	DECL_GET(TInt,HandleCount)
+	DECL_GET(TInt*,Handles)
+	DECL_GET(TUint32,Flags)
+	DECL_GET(TInt,CellCount)
+	DECL_GET(TInt,TotalAllocSize)
+	DECL_GET(TInt,MinLength)
+	DECL_GET(TInt,Offset)
+	DECL_GET(TInt,GrowBy)
+	DECL_GET(TInt,ChunkHandle)
+	DECL_GET2(const RFastLock&,Lock,LockRef)
+	DECL_GET(TUint8*,Top)
+	DECL_GET(TInt,Align)
+	DECL_GET(TInt,MinCell)
+	DECL_GET(TInt,PageSize)
+	DECL_GET2(const SCell&,Free,FreeRef)
+public:
 	TInt CheckAllocatedCell(const TAny* aCell) const;
 	void FullCheckAllocatedCell(const TAny* aCell) const;
 	TAny* TestAlloc(TInt aSize);
@@ -131,11 +140,23 @@
 	TAny* TestReAlloc(TAny* aPtr, TInt aSize, TInt aMode=0);
 	void FullCheck();
 	static void WalkFullCheckCell(TAny* aPtr, TCellType aType, TAny* aCell, TInt aLen);
+	TInt FreeCellLen(const TAny* aPtr) const;
+	static RTestHeap* FixedHeap(TInt aMaxLength, TInt aAlign=0, TBool aSingleThread=ETrue);
+	void TakeChunkOwnership(RChunk aChunk);
+	TInt LastFreeCellLen(void) const;
+	TInt CalcComp(TInt aCompSize);
+	void ForceCompress(TInt aFreed);
 	};
 
 TInt RTestHeap::CheckAllocatedCell(const TAny* aCell) const
 	{
-	TInt len = AllocLen(aCell);
+	SCell* pC = GetAddress(aCell);
+	TInt len = pC->len;
+	TUint8* pEnd = (TUint8*)pC + len;
+	TEST_ALIGN(aCell, iAlign);
+	TEST_ALIGN(len, iAlign);
+	test(len >= iMinCell);
+	test((TUint8*)pC>=iBase && pEnd<=iTop);
 	return len;
 	}
 
@@ -150,7 +171,7 @@
 	if (p)
 		{
 		TInt len = CheckAllocatedCell(p);
-		test(len>=aSize);		
+		test((len-RHeap::EAllocCellSize)>=aSize);
 		((STestCell*)p)->Set(len);
 		}
 	return p;
@@ -175,7 +196,7 @@
 		return p;
 		}
 	TInt new_len = CheckAllocatedCell(p);
-	test(new_len>=aSize);		
+	test((new_len-RHeap::EAllocCellSize)>=aSize);
 	if (p == aPtr)
 		{
 		((STestCell*)p)->Verify(p, old_len, Min(old_len, new_len));
@@ -186,8 +207,9 @@
 	test(!(aMode & ENeverMove));
 	test((new_len > old_len) || (aMode & EAllowMoveOnShrink));
 	if (old_len)
-		((STestCell*)p)->Verify(aPtr, old_len, Min(old_len, aSize));		
-    ((STestCell*)p)->Set(new_len);
+		((STestCell*)p)->Verify(aPtr, old_len, Min(old_len, new_len));
+	if (new_len != old_len)
+		((STestCell*)p)->Set(new_len);
 	return p;
 	}
 
@@ -208,15 +230,22 @@
 		{
 		case EGoodAllocatedCell:
 			{
-			TInt len = aLen;
-			info.iTotalAllocSize += len;
-			STestCell* pT = (STestCell*)aCell;
+			test(aCell == info.iNextCell);
+			TInt len = ((SCell*)aCell)->len;
+			test(len == aLen);
+			info.iNextCell += len;
 			++info.iTotalAlloc;
+			info.iTotalAllocSize += (aLen-EAllocCellSize);
+			STestCell* pT = (STestCell*)((TUint8*)aCell + EAllocCellSize);
 			pT->Verify(len);
 			break;
 			}
 		case EGoodFreeCell:
 			{
+			test(aCell == info.iNextCell);
+			TInt len = ((SCell*)aCell)->len;
+			test(len == aLen);
+			info.iNextCell += len;
 			++info.iTotalFree;
 			break;
 			}
@@ -232,13 +261,877 @@
 	::SHeapCellInfo info;
 	Mem::FillZ(&info, sizeof(info));
 	info.iHeap = this;
+	info.iNextCell = iBase;
 	DebugFunction(EWalk, (TAny*)&WalkFullCheckCell, &info);
-	TInt count = AllocSize(iTotalAllocSize);
-	test(info.iTotalAlloc == count);
+	test(info.iNextCell == iTop);
+	test(info.iTotalAlloc == iCellCount);
 	test(info.iTotalAllocSize == iTotalAllocSize);
+	}
 
+TInt RTestHeap::FreeCellLen(const TAny* aPtr) const
+	{
+	SCell* p = iFree.next;
+	SCell* q = (SCell*)((TUint8*)aPtr - EAllocCellSize);
+	for (; p && p!=q; p = p->next) {}
+	if (p == q)
+		return p->len - EAllocCellSize;
+	return -1;
+	}
+
+TInt RTestHeap::LastFreeCellLen(void) const
+	{
+	SCell* p = iFree.next;
+	if (p==NULL)
+		return -1;	
+	for (; p->next; p=p->next){}
+	return p->len;
+	}
+
+
+/** Checks whether a call to Compress() will actually perform a reduction 
+	of the heap.
+	Relies on the free last cell on the heap being cell that has just been freed
+	plus any extra.
+	Intended for use by t_heap2.cpp - DoTest4().  
+	@param aFreedSize The size in bytes of the cell that was freed
+*/
+TInt RTestHeap::CalcComp(TInt aFreedSize)
+	{	
+	TInt largestCell=0;
+	largestCell = LastFreeCellLen();
+	// if the largest cell is too small or it would have been compressed by the
+	// free operation then return 0.
+	if (largestCell < iPageSize || aFreedSize >= KHeapShrinkHysRatio*(iGrowBy>>8))
+		{
+		return 0;			
+		}
+		else
+		{
+		return _ALIGN_DOWN(aFreedSize,iPageSize);
+		}	
 	}
 	
+/** compress the heap if the KHeapShrinkRatio is too large for what we are
+	expecting in DoTest4().
+*/
+void RTestHeap::ForceCompress(TInt aFreed)
+	{	
+	if (aFreed < KHeapShrinkHysRatio*(iGrowBy>>8))
+		{
+		Compress();
+		}
+	}
+RTestHeap* RTestHeap::FixedHeap(TInt aMaxLength, TInt aAlign, TBool aSingleThread)
+	{
+	RChunk c;
+	TInt bottom = 0x40000;
+	TInt top = bottom + aMaxLength;
+	TInt r = c.CreateDisconnectedLocal(bottom, top, top + bottom, EOwnerThread);
+	if (r!=KErrNone)
+		return NULL;
+	TUint8* base = c.Base() + bottom;
+	RTestHeap* h = (RTestHeap*)UserHeap::FixedHeap(base, aMaxLength, aAlign, aSingleThread);
+	if (!aAlign)
+		aAlign = RHeap::ECellAlignment;
+	test((TUint8*)h == base);
+	test(h->AccessCount() == 1);
+	test(h->HandleCount() == (aSingleThread ? 0 : 1));
+	test(h->Handles() == (aSingleThread ? NULL : (TInt*)&h->LockRef()));
+	test(h->Flags() == TUint32(RAllocator::EFixedSize | (aSingleThread ? RAllocator::ESingleThreaded : 0)));
+	test(h->CellCount() == 0);
+	test(h->TotalAllocSize() == 0);
+	test(h->MaxLength() == aMaxLength);
+	test(h->MinLength() == h->Top() - (TUint8*)h);
+	test(h->Offset() == 0);
+	test(h->GrowBy() == 0);
+	test(h->ChunkHandle() == 0);
+	test(h->Align() == aAlign);
+	TInt min_cell = _ALIGN_UP((KHeapMinCellSize + Max((TInt)RHeap::EAllocCellSize, (TInt)RHeap::EFreeCellSize)), aAlign);
+	TInt hdr_len = _ALIGN_UP(sizeof(RHeap) + RHeap::EAllocCellSize, aAlign) - RHeap::EAllocCellSize;
+	TInt user_len = _ALIGN_DOWN(aMaxLength - hdr_len, aAlign);
+	test(h->Base() == base + hdr_len);
+	test(h->MinCell() == min_cell);
+	test(h->Top() - h->Base() == user_len);
+	test(h->FreeRef().next == (RHeap::SCell*)h->Base());
+	h->TakeChunkOwnership(c);
+	return h;
+	}
+
+void RTestHeap::TakeChunkOwnership(RChunk aChunk)
+	{
+	iChunkHandle = aChunk.Handle();
+	++iHandleCount;
+	iHandles = &iChunkHandle;
+	}
+
+
+#define	ACCESS_COUNT(h)		(((RTestHeap*)h)->AccessCount())
+#define	HANDLE_COUNT(h)		(((RTestHeap*)h)->HandleCount())
+#define	HANDLES(h)			(((RTestHeap*)h)->Handles())
+#define	FLAGS(h)			(((RTestHeap*)h)->Flags())
+#define	CELL_COUNT(h)		(((RTestHeap*)h)->CellCount())
+#define	TOTAL_ALLOC_SIZE(h)	(((RTestHeap*)h)->TotalAllocSize())
+#define	MIN_LENGTH(h)		(((RTestHeap*)h)->MinLength())
+#define	OFFSET(h)			(((RTestHeap*)h)->Offset())
+#define	GROW_BY(h)			(((RTestHeap*)h)->GrowBy())
+#define	CHUNK_HANDLE(h)		(((RTestHeap*)h)->ChunkHandle())
+#define	LOCK_REF(h)			(((RTestHeap*)h)->LockRef())
+#define	TOP(h)				(((RTestHeap*)h)->Top())
+#define	ALIGN(h)			(((RTestHeap*)h)->Align())
+#define	MIN_CELL(h)			(((RTestHeap*)h)->MinCell())
+#define	PAGE_SIZE(h)		(((RTestHeap*)h)->PageSize())
+#define	FREE_REF(h)			(((RTestHeap*)h)->FreeRef())
+
+void DoTest1(RHeap* aH)
+	{
+	RTestHeap* h = (RTestHeap*)aH;
+	test.Printf(_L("Test Alloc: min=%x max=%x align=%d growby=%d\n"),
+						h->MinLength(), h->MaxLength(), h->Align(), h->GrowBy());
+	TInt l;
+	TAny* p = NULL;
+	TUint8* next = h->Base();
+	TUint8* top = h->Top();
+	TUint8* limit = (TUint8*)h + h->MaxLength();
+	TBool fixed = h->Flags() & RAllocator::EFixedSize;
+	for (l=1; l<=1024; ++l)
+		{
+		TInt remain1 = top - next;
+		TInt xl1 = _ALIGN_UP(Max((l+RHeap::EAllocCellSize), h->MinCell()), h->Align());
+		p = h->TestAlloc(l);
+		if ( (fixed && remain1 < xl1) || (next + xl1 > limit) )
+			{
+			test(p == NULL);
+			test(top == h->Top());
+			test.Printf(_L("Alloc failed at l=%d next=%08x\n"), l, next);
+			break;
+			}
+		test(p == next + RHeap::EAllocCellSize);
+		if (xl1 > remain1)
+			{
+			// no room for this cell
+			TInt g = h->GrowBy();
+			while (xl1 > remain1)
+				{
+				top += g;
+				remain1 += g;
+				}
+			}
+		test(top == h->Top());
+		if (xl1 + h->MinCell() > remain1)
+			{
+			// this cell fits but remainder is too small or nonexistent
+			xl1 = top - next;
+			next = top;
+			test(h->FreeRef().next == NULL);
+			}
+		else
+			{
+			// this cell fits and remainder can be reused
+			next += xl1;
+			}
+		test(aH->AllocLen(p) == xl1 - RHeap::EAllocCellSize);
+		}
+	h->FullCheck();
+	}
+
+void DoTest2(RHeap* aH)
+	{
+	RTestHeap* h = (RTestHeap*)aH;
+	test.Printf(_L("Test Free: min=%x max=%x align=%d growby=%d\n"),
+						h->MinLength(), h->MaxLength(), h->Align(), h->GrowBy());
+	TInt al;
+	TInt min = h->MinCell();
+	TBool pad = EFalse;
+	for (al=1; al<256; (void)((pad=!pad)!=0 || (al+=al+1)) )
+		{
+		TAny* p[32];
+		TInt last_len = 0;
+		TAny* last = NULL;
+		TInt i;
+		test.Printf(_L("al=%d pad=%d\n"), al, pad);
+		TUint8* top=0;
+		TAny* spare=0;
+		TBool heapReduced = EFalse;
+		for (i=0; i<32; ++i)
+			{
+			// Check whether the cell created for the allocation of al would end up
+			// including extra bytes from the last free cell that aren't enough
+			// to create a new free cell.
+			top = h->Top();
+			TInt freeLen=h->LastFreeCellLen();
+			TInt actualAllocBytes = Max(_ALIGN_UP(al + RHeap::EAllocCellSize, h->Align()), min);
+			TInt remainingBytes = freeLen - actualAllocBytes;
+			if (remainingBytes < min)
+				{
+				// Force the heap to grow so that once this allocation is freed
+				// the free cell left will be large enough to include the al allocation
+				// and to create a new free cell if necessary.
+				actualAllocBytes = _ALIGN_UP(actualAllocBytes + min, h->Align());
+				TAny* q = h->TestAlloc(actualAllocBytes);
+				// Check heap has grown
+				test(top < h->Top());
+				top = h->Top();
+				test(q!=NULL);
+				// Have grown the heap so allocate a cell as a place holder to stop
+				// the heap being shrunk and the actual cell we want to allocate from being the
+				// wrong size
+				spare=h->TestAlloc(8);
+				h->TestFree(q);
+				// Ensure heap wasn't shrunk after free
+				test(top == h->Top());
+				}
+			top = h->Top();
+			// Allocate the new 
+			p[i] = h->TestAlloc(al);
+			test(p[i]!=NULL);
+			if (remainingBytes < min)
+				{// now safe to free any padding as p[i] now allocated and its size can't change
+				h->TestFree(spare);
+				}
+			TInt tmp1=h->AllocLen(p[i]);
+			TInt tmp2=Max(_ALIGN_UP(al+RHeap::EAllocCellSize,h->Align()), min)-RHeap::EAllocCellSize;
+			test(tmp1 == tmp2);
+			}
+		last = (TUint8*)p[31] + _ALIGN_UP(Max((al + RHeap::EAllocCellSize), min), h->Align());
+		last_len = h->FreeCellLen(last);
+		test(last_len > 0);
+		if (pad)
+			{
+			test(h->TestAlloc(last_len) == last);
+			test(h->FreeRef().next == NULL);
+			}
+		else
+			last = NULL;
+		top = h->Top();
+		for (i=0,heapReduced=EFalse; i<32; ++i)
+			{
+			h->TestFree(p[i]);
+			TInt fl = h->FreeCellLen(p[i]);
+			TInt xfl = _ALIGN_UP(Max((al + RHeap::EAllocCellSize), h->MinCell()), h->Align()) - RHeap::EAllocCellSize;
+			if (h->Top() < top) // heap was reduced due to small KHeapShrinkHysRatio and big KHeapMinCellSize
+				{
+				top = h->Top();
+				heapReduced = ETrue;
+				}
+
+			if (i < 31 || pad)
+				test(fl == xfl);
+			else
+				{
+				if (!heapReduced)
+					test(fl == xfl + RHeap::EAllocCellSize + last_len);
+				else
+					{
+					heapReduced = EFalse;
+					}
+				}
+			test(h->TestAlloc(al)==p[i]);
+			}
+		for (i=0,heapReduced=EFalse; i<31; ++i)
+			{
+			TInt j = i+1;
+			TUint8* q;
+			// Free to adjacent cells and check that the free cell left is the combined
+			// size of the 2 adjacent cells just freed
+			h->TestFree(p[i]);
+			h->TestFree(p[j]);
+			TInt fl = h->FreeCellLen(p[i]);
+			if (h->Top() < top) // heap was reduced due to small KHeapShrinkHysRatio and big KHeapMinCellSize
+				{
+				top = h->Top();
+				heapReduced = ETrue;
+				}
+			TInt xfl = 2 * _ALIGN_UP(Max((al + RHeap::EAllocCellSize), h->MinCell()), h->Align()) - RHeap::EAllocCellSize;
+			if (j < 31 || pad)
+				test(fl == xfl);
+			else
+				{
+				if (!heapReduced)
+					test(fl == xfl + RHeap::EAllocCellSize + last_len);
+				else
+					{
+					heapReduced = EFalse;
+					}
+				}
+			test(h->FreeCellLen(p[j]) < 0);
+			test(h->TestAlloc(fl)==p[i]);
+			test(h->Top() == top);
+			h->TestFree(p[i]);
+			test(h->FreeCellLen(p[i]) == fl);
+			// test when you alloc a cell that is larger than cells just freed
+			// that its position is not the same as the freed cells
+			// will hold for all cells except top/last one
+			if (j < 31 && !pad && fl < last_len)
+				{
+				q = (TUint8*)h->TestAlloc(fl+1);
+				if (h->Top() > top)
+					top = h->Top();
+				test(h->Top() == top);
+				test(q > p[i]);
+				h->TestFree(q);
+				if (h->Top() < top) // heap was reduced due to small KHeapShrinkHysRatio and big KHeapMinCellSize
+					{
+					top = h->Top();
+					heapReduced = ETrue;
+					}
+				}
+			// check cell that is just smaller than space but not small enough 
+			// for a new free cell to be created, is the size of whole free cell
+			test(h->TestAlloc(fl-min+1)==p[i]);
+			test(h->Top() == top);
+			test(h->AllocLen(p[i])==fl);
+			h->TestFree(p[i]);
+			// Check cell that is small enough for new free cell and alloc'd cell to be
+			// created at p[i] cell is created at p[i]
+			test(h->TestAlloc(fl-min)==p[i]);
+			test(h->Top() == top);
+			// check free cell is at expected position
+			q = (TUint8*)p[i] + fl - min + RHeap::EAllocCellSize;
+			test(h->FreeCellLen(q) == min - RHeap::EAllocCellSize);
+			// alloc 0 length cell at q, will work as new cell of min length will be created
+			test(h->TestAlloc(0) == q);
+			test(h->Top() == top);
+			h->TestFree(p[i]);
+			test(h->FreeCellLen(p[i]) == fl - min);
+			h->TestFree(q);
+			// again check free cells are combined
+			test(h->FreeCellLen(q) < 0);
+			test(h->FreeCellLen(p[i]) == fl);
+			// check reallocating the cells places them back to same positions
+			test(h->TestAlloc(al)==p[i]);
+			test(h->Top() == top);
+			test(h->TestAlloc(al)==p[j]);
+			test(h->Top() == top);
+			if (pad)
+				test(h->FreeRef().next == NULL);
+			}
+		for (i=0,heapReduced=EFalse; i<30; ++i)
+			{
+			TInt j = i+1;
+			TInt k = i+2;
+			TUint8* q;
+			// Free 3 adjacent cells and check free cell created is combined size
+			h->TestFree(p[i]);
+			h->TestFree(p[k]);
+			h->TestFree(p[j]);
+			h->FullCheck();
+			if (h->Top() < top) // heap was reduced due to small KHeapShrinkHysRatio and big KHeapMinCellSize
+				{
+				top = h->Top();
+				heapReduced = ETrue;
+				}
+			TInt fl = h->FreeCellLen(p[i]);
+			TInt xfl = 3 * _ALIGN_UP(Max((al + RHeap::EAllocCellSize), h->MinCell()), h->Align()) - RHeap::EAllocCellSize;
+			if (k < 31 || pad)
+				test(fl == xfl);
+			else
+				{
+				if (!heapReduced)
+					test(fl == xfl + RHeap::EAllocCellSize + last_len);
+				else
+					{
+					heapReduced = EFalse;
+					}
+				}
+			test(h->FreeCellLen(p[j]) < 0);
+			test(h->FreeCellLen(p[k]) < 0);
+			//ensure created free cell is allocated to new cell of free cell size
+			test(h->TestAlloc(fl)==p[i]);
+			test(h->Top() == top);
+			h->TestFree(p[i]);
+			test(h->FreeCellLen(p[i]) == fl);
+			if (h->Top() < top) // heap was reduced due to small KHeapShrinkHysRatio and big KHeapMinCellSize
+				top = h->Top();
+			if (k < 31 && !pad && fl < last_len)
+				{
+				// Test new cell one larger than free cell size is allocated somewhere else
+				q = (TUint8*)h->TestAlloc(fl+1);
+				if (h->Top() > top)
+					top = h->Top();
+				test(h->Top() == top); 
+				test(q > p[i]);
+				h->TestFree(q);
+				if (h->Top() < top) // heap was reduced due to small KHeapShrinkHysRatio and big KHeapMinCellSize
+					{
+					top = h->Top();
+					heapReduced = ETrue;
+					}
+				}
+			// check allocating cell just smaller than free cell size but
+			// too large for neew free cell to be created, is size of whole free cell
+			test(h->TestAlloc(fl-min+1)==p[i]);
+			test(h->Top() == top);
+			test(h->AllocLen(p[i])==fl);
+			h->TestFree(p[i]);
+			// ensure free cell is created this time as well as alloc'd cell
+			test(h->TestAlloc(fl-min)==p[i]);
+			test(h->Top() == top);
+			q = (TUint8*)p[i] + fl - min + RHeap::EAllocCellSize;
+			test(h->FreeCellLen(q) == min - RHeap::EAllocCellSize);
+			test(h->TestAlloc(0) == q);
+			test(h->Top() == top);
+			h->TestFree(p[i]);
+			test(h->FreeCellLen(p[i]) == fl - min);
+			h->TestFree(q);
+			test(h->FreeCellLen(q) < 0);
+			test(h->FreeCellLen(p[i]) == fl);
+			// realloc all cells and check heap not expanded
+			test(h->TestAlloc(al)==p[i]);
+			test(h->Top() == top);
+			test(h->TestAlloc(al)==p[j]);
+			test(h->Top() == top);
+			test(h->TestAlloc(al)==p[k]);
+			test(h->Top() == top);
+			// If padding than no space should left on heap
+			if (pad)
+				test(h->FreeRef().next == NULL);
+			}
+		// when padding this will free padding from top of heap
+		h->TestFree(last);
+		}
+	h->FullCheck();
+	}
+
+void DoTest3(RHeap* aH)
+	{
+	RTestHeap* h = (RTestHeap*)aH;
+	test.Printf(_L("Test ReAlloc: min=%x max=%x align=%d growby=%d\n"),
+						h->MinLength(), h->MaxLength(), h->Align(), h->GrowBy());
+	// allocate continuous heap cell, then free them and reallocate again
+	TInt al;
+	for (al=1; al<256; al+=al+1)
+		{
+		TAny* p0 = h->TestAlloc(al);
+		TInt al0 = h->AllocLen(p0);
+		h->TestFree(p0);
+		TAny* p1 = h->TestReAlloc(NULL, al, 0);
+		TInt al1 = h->AllocLen(p1);
+		test(p1 == p0);
+		test(al1 == al0);
+		h->TestFree(p1);
+		TAny* p2 = h->TestAlloc(1);
+		TAny* p3 = h->TestReAlloc(p2, al, 0);
+		test(p3 == p0);
+		TInt al3 = h->AllocLen(p3);
+		test(al3 == al0);
+		h->TestFree(p3);
+		TAny* p4 = h->TestAlloc(1024);
+		TAny* p5 = h->TestReAlloc(p4, al, 0);
+		test(p5 == p0);
+		TInt al5 = h->AllocLen(p5);
+		test(al5 == al0);
+		h->TestFree(p5);
+		}
+	TInt i;
+	TInt j;
+	for (j=0; j<30; j+=3)
+		{
+		TAny* p[30];
+		TInt ala[30];
+		TInt fla[30];
+		h->Reset();
+		for (i=0; i<30; ++i)
+			{
+			p[i] = h->TestAlloc(8*i*i);
+			ala[i] = h->AllocLen(p[i]);
+			fla[i] = 0;
+			}
+		for (i=1; i<30; i+=3)
+			{
+			h->TestFree(p[i]);
+			fla[i] = h->FreeCellLen(p[i]);
+			test(fla[i] == ala[i]);
+			test(h->FreeCellLen(p[i-1]) < 0);
+			test(h->FreeCellLen(p[i+1]) < 0);
+			}
+		h->FullCheck();
+		TInt al1 = _ALIGN_UP(Max((RHeap::EAllocCellSize + 1), h->MinCell()), h->Align());
+		// adjust al1 for some case when reallocated heap cell will not be shrinked because remainder will not big enough
+		// to form a new free cell due to a big KHeapMinCellSize value
+		TInt alaj = ala[j] + RHeap::EAllocCellSize;
+		if (al1 < alaj && alaj - al1 < h->MinCell())
+			al1 = alaj;
+		TAny* p1 = h->TestReAlloc(p[j], 1, RHeap::ENeverMove);
+		test(p1 == p[j]);
+		test(h->AllocLen(p1) == al1 - RHeap::EAllocCellSize);
+		TAny* p1b = (TUint8*)p1 + al1;
+		test(h->FreeCellLen(p1b) == fla[j+1] + RHeap::EAllocCellSize + ala[j] - al1);
+		TInt l2 = ala[j] + fla[j+1] + RHeap::EAllocCellSize; // max without moving
+		TInt l3 = l2 - h->MinCell();
+		TAny* p3 = h->TestReAlloc(p[j], l3, RHeap::ENeverMove);
+		test(p3 == p[j]);
+		TAny* p3b = (TUint8*)p3 + h->AllocLen(p3) + RHeap::EAllocCellSize;
+		test(h->FreeCellLen(p3b) == h->MinCell() - RHeap::EAllocCellSize);
+		TAny* p2 = h->TestReAlloc(p[j], l2, RHeap::ENeverMove);
+		test(p2 == p[j]);
+		test(h->AllocLen(p2) == l2);
+		TAny* p4 = h->TestReAlloc(p[j], l2+1, RHeap::ENeverMove);
+		test(p4 == NULL);
+		test(h->AllocLen(p2) == l2);
+		TAny* p5 = h->TestReAlloc(p[j], l2+1, 0);
+		TInt k = 0;
+		for (; k<30 && fla[k] <= l2; ++k) {}
+		if (k < 30)
+			test(p5 == p[k]);
+		else
+			test(p5 >= (TUint8*)p[29] + ala[29]);
+		test(h->FreeCellLen(p2) == ala[j] + ala[j+1] + RHeap::EAllocCellSize);
+		TInt ali = _ALIGN_UP(RHeap::EAllocCellSize,h->Align());
+		TAny* p6b = (TUint8*)p[j+2] + ala[j+2] - ali + RHeap::EAllocCellSize;
+		test(h->FreeCellLen(p6b) < 0);
+		TAny* p6 = h->TestReAlloc(p[j+2], ala[j+2] - ali , 0);
+		test(p6 == p[j+2]);
+		if (h->AllocLen(p6) != ala[j+2]) // allocated heap cell size changed
+			test(h->FreeCellLen(p6b) == h->MinCell() - RHeap::EAllocCellSize);
+		TInt g = h->GrowBy();
+		TAny* p7 = h->TestReAlloc(p5, 8*g, 0);
+		test(p7 >= p5);
+		TUint8* p8 = (TUint8*)p7 - RHeap::EAllocCellSize + al1;
+		TUint8* p9 = (TUint8*)_ALIGN_UP(TLinAddr(p8), h->PageSize());
+		if (p9-p8 < h->MinCell())
+			p9 += h->PageSize();
+		TAny* p7b = h->TestReAlloc(p7, 1, 0);
+		test(p7b == p7);
+		test(h->Top() + (RHeap::EAllocCellSize & (h->Align()-1)) == p9);
+
+		h->FullCheck();
+		}
+	}
+
+// Test compression
+// {1 free cell, >1 free cell} x {reduce cell, eliminate cell, reduce cell but too small}
+//
+void DoTest4(RHeap* aH)
+	{
+	RTestHeap* h = (RTestHeap*)aH;
+	test.Printf(_L("Test Compress: min=%x max=%x align=%d growby=%d\n"),
+						h->MinLength(), h->MaxLength(), h->Align(), h->GrowBy());
+	TInt page_size;
+	UserHal::PageSizeInBytes(page_size);
+	test(page_size == h->PageSize());
+	TInt g = h->GrowBy();
+	TEST_ALIGN(g, page_size);
+	test(g >= page_size);
+	RChunk c;
+	c.SetHandle(h->ChunkHandle());
+	TInt align = h->Align();
+	TInt minc = h->MinCell();
+
+	TInt orig_size = c.Size();
+	TUint8* orig_top = h->Top();
+
+	// size in bytes that last free cell on the top of the heap must be 
+	// before the heap will be shrunk, size must include the no of bytes to
+	// store the cell data/header i.e RHeap::EAllocCellSize
+	TInt shrinkThres = KHeapShrinkHysRatio*(g>>8);
+
+	TInt pass;
+	for (pass=0; pass<2; ++pass)
+		{
+		TUint8* p0 = (TUint8*)h->TestAlloc(4);
+		test(p0 == h->Base() + RHeap::EAllocCellSize);
+		TInt l1 = h->Top() - (TUint8*)h->FreeRef().next;
+		TEST_ALIGN(l1, align);
+		l1 -= RHeap::EAllocCellSize;
+		TUint8* p1;
+		// Grow heap by 2*iGrowBy bytes
+		p1 = (TUint8*)h->TestAlloc(l1 + 2*g);
+		test(p1 == p0 + h->AllocLen(p0) + RHeap::EAllocCellSize);
+		test(h->Top() - orig_top == 2*g);
+		test(c.Size() - orig_size == 2*g);
+		// May compress heap, may not
+		h->TestFree(p1);
+		h->ForceCompress(2*g);
+		test(h->Top() == orig_top);
+		test(c.Size() == orig_size);
+		test((TUint8*)h->FreeRef().next == p1 - RHeap::EAllocCellSize);
+		h->FullCheck();
+		//if KHeapShrinkHysRatio is > 2.0 then heap compression will occur here
+		test(h->Compress() == 0);
+		test(h->TestAlloc(l1) == p1);
+		test(h->FreeRef().next == NULL);
+		if (pass)
+			h->TestFree(p0);	// leave another free cell on second pass
+		TInt l2 = g - RHeap::EAllocCellSize;
+		// Will grow heap by iGrowBy bytes
+		TUint8* p2 = (TUint8*)h->TestAlloc(l2);
+		test(p2 == orig_top + RHeap::EAllocCellSize);
+		test(h->Top() - orig_top == g);
+		test(c.Size() - orig_size == g);
+		// may or may not compress heap
+		h->TestFree(p2);
+		if (l2+RHeap::EAllocCellSize >= shrinkThres)
+			{
+			// When KHeapShrinkRatio small enough heap will have been compressed
+			test(h->Top() == orig_top);			
+			if (pass)
+				{
+				test((TUint8*)h->FreeRef().next == p0 - RHeap::EAllocCellSize);
+				test((TUint8*)h->FreeRef().next->next == NULL);
+				}
+			else
+				test((TUint8*)h->FreeRef().next == NULL);
+			}
+		else
+			{			
+			test(h->Top() - orig_top == g);
+			if (pass)
+				{
+				test((TUint8*)h->FreeRef().next == p0 - RHeap::EAllocCellSize);
+				test((TUint8*)h->FreeRef().next->next == orig_top);
+				}
+			else
+				test((TUint8*)h->FreeRef().next == orig_top);
+			}
+		// this compress will only do anything if the KHeapShrinkRatio is large 
+		// enough to introduce hysteresis otherwise the heap would have been compressed 
+		// by the free operation itself
+		TInt tmp1,tmp2;
+		tmp2=h->CalcComp(g);
+		tmp1=h->Compress();
+		test(tmp1 == tmp2);
+		test(h->Top() == orig_top);
+		test(c.Size() == orig_size);
+		h->FullCheck();
+		// shouldn't compress heap as already compressed
+		test(h->Compress() == 0);
+		//grow heap by iGrowBy bytes
+		test(h->TestAlloc(l2) == p2);
+		//grow heap by iGrowBy bytes
+		TUint8* p3 = (TUint8*)h->TestAlloc(l2);
+		test(p3 == p2 + g);
+		test(h->Top() - orig_top == 2*g);
+		test(c.Size() - orig_size == 2*g);
+		// may or may not reduce heap
+		h->TestFree(p2);
+		// may or may not reduce heap
+		h->TestFree(p3);
+		h->ForceCompress(2*g);
+		test(h->Top() == orig_top);
+		test(c.Size() == orig_size);
+		h->FullCheck();
+		if (pass)
+			{
+			test((TUint8*)h->FreeRef().next == p0 - RHeap::EAllocCellSize);
+			test((TUint8*)h->FreeRef().next->next == NULL);
+			}
+		else
+			test((TUint8*)h->FreeRef().next == NULL);
+		//grow heap by iGrowBy bytes
+		test(h->TestAlloc(l2) == p2);
+		//grow heap by iGrowBy*2 + page size bytes
+		test(h->TestAlloc(l2 + g + page_size) == p3);
+		test(h->Top() - orig_top == 4*g);
+		test(c.Size() - orig_size == 4*g);
+		// will compress heap if KHeapShrinkHysRatio <= KHeapShrinkRatioDflt
+		test(h->TestReAlloc(p3, page_size - RHeap::EAllocCellSize, 0) == p3);
+		h->ForceCompress(g+page_size);
+		test(h->Top() - orig_top == g + page_size);
+		test(c.Size() - orig_size == g + page_size);
+		h->FullCheck();
+		// will compress heap if KHeapShrinkHysRatio <= KHeapShrinkRatio1
+		h->TestFree(p2);
+		// will compress heap if KHeapShrinkHysRatio <= KHeapShrinkRatio1 && g<=page_size
+		// or KHeapShrinkHysRatio >= 2.0 and g==page_size
+		h->TestFree(p3);
+		// may or may not perform further compression
+		tmp1=h->CalcComp(g+page_size);
+		tmp2=h->Compress();
+		test(tmp1 == tmp2);
+		test(h->Top() == orig_top);
+		test(c.Size() == orig_size);
+		h->FullCheck();
+		test(h->TestAlloc(l2 - minc) == p2);
+		test(h->TestAlloc(l2 + g + page_size + minc) == p3 - minc);
+		test(h->Top() - orig_top == 4*g);
+		test(c.Size() - orig_size == 4*g);
+		h->TestFree(p3 - minc);
+		h->ForceCompress(l2 + g + page_size + minc);
+		test(h->Top() - orig_top == g);
+		test(c.Size() - orig_size == g);
+		h->FullCheck();
+		if (pass)
+			{
+			test((TUint8*)h->FreeRef().next == p0 - RHeap::EAllocCellSize);
+			test((TUint8*)h->FreeRef().next->next == p3 - minc - RHeap::EAllocCellSize);
+			}
+		else
+			test((TUint8*)h->FreeRef().next == p3 - minc - RHeap::EAllocCellSize);
+		h->TestFree(p2);
+		if (l2+RHeap::EAllocCellSize >= shrinkThres)
+			{
+			// When KHeapShrinkRatio small enough heap will have been compressed
+			test(h->Top() == orig_top);
+			test(c.Size() - orig_size == 0);
+			}
+		else
+			{
+			test(h->Top() - orig_top == g);
+			test(c.Size() - orig_size == g);
+			}
+		h->FullCheck();
+		if ( ((TLinAddr)orig_top & (align-1)) == 0)
+			{
+			TAny* free;
+			TEST_ALIGN(p2 - RHeap::EAllocCellSize, page_size);
+			// will have free space of g-minc
+			test(h->TestAlloc(l2 + minc) == p2);
+			test(h->Top() - orig_top == 2*g);
+			test(c.Size() - orig_size == 2*g);
+			free = pass ? h->FreeRef().next->next : h->FreeRef().next;
+			test(free != NULL);
+			test(h->TestReAlloc(p2, l2 - 4, 0) == p2);
+			TInt freeSp = g-minc + (l2+minc - (l2-4));
+			TInt adjust = 0;
+			if (freeSp >= shrinkThres && freeSp-page_size >= minc)
+				{
+				// if page_size is less than growBy (g) then heap will be shrunk
+				// by less than a whole g.
+				adjust = g-((page_size<g)?page_size:0);
+				}
+			test(h->Top() - orig_top == 2*g - adjust);
+			test(c.Size() - orig_size == 2*g - adjust);
+			free = pass ? h->FreeRef().next->next : h->FreeRef().next;
+			test(free != NULL);
+			TEST_ALIGN(TLinAddr(free)+4, page_size);
+			test(h->TestAlloc(l2 + g + page_size + 4) == p3 - 4);
+			test(h->Top() - orig_top == 4*g - adjust);
+			test(c.Size() - orig_size == 4*g - adjust);
+			h->TestFree(p3 - 4);
+			h->ForceCompress(l2 + g + page_size + 4);
+			test(h->Top() - orig_top == g + page_size);
+			test(c.Size() - orig_size == g + page_size);
+			h->FullCheck();
+			h->TestFree(p2);
+			h->ForceCompress(l2-4);
+			test(h->Compress() == 0);
+			// check heap is grown, will have free space of g-minc
+			test(h->TestAlloc(l2 + minc) == p2);
+			test(h->Top() - orig_top == 2*g);
+			test(c.Size() - orig_size == 2*g);
+			free = pass ? h->FreeRef().next->next : h->FreeRef().next;
+			test(free != NULL);
+			// may shrink heap as will now have g+minc free bytes
+			test(h->TestReAlloc(p2, l2 - minc, 0) == p2);
+			if (g+minc >= shrinkThres)
+				{
+				test(h->Top() - orig_top == g);
+				test(c.Size() - orig_size == g);
+				}
+			else
+				{
+				test(h->Top() - orig_top == 2*g);
+				test(c.Size() - orig_size == 2*g);
+				}
+			free = pass ? h->FreeRef().next->next : h->FreeRef().next;
+			test(free != NULL);
+			TEST_ALIGN(TLinAddr(free)+minc, page_size);
+			test(h->TestAlloc(l2 + g + page_size + minc) == p3 - minc);
+			test(h->Top() - orig_top == 4*g);
+			test(c.Size() - orig_size == 4*g);
+			h->TestFree(p3 - minc);
+			h->ForceCompress(l2 + g + page_size + minc);
+			test(h->Top() - orig_top == g);
+			test(c.Size() - orig_size == g);
+			h->FullCheck();
+			h->TestFree(p2);
+			}
+
+		h->TestFree(p1);
+		if (pass == 0)
+			h->TestFree(p0);
+		h->Compress();
+		}
+	h->FullCheck();
+	}
+
+void Test1()
+	{
+	RHeap* h;
+	h = RTestHeap::FixedHeap(0x1000, 0);
+	test(h != NULL);
+	DoTest1(h);
+	h->Close();
+	h = RTestHeap::FixedHeap(0x1000, 0, EFalse);
+	test(h != NULL);
+	DoTest1(h);
+	h->Close();
+	h = RTestHeap::FixedHeap(0x10000, 64);
+	test(h != NULL);
+	DoTest1(h);
+	h->Close();
+	h = RTestHeap::FixedHeap(0x100000, 4096);
+	test(h != NULL);
+	DoTest1(h);
+	h->Close();
+	h = RTestHeap::FixedHeap(0x100000, 8192);
+	test(h != NULL);
+	DoTest1(h);
+	h->Close();
+	h = UserHeap::ChunkHeap(&KNullDesC(), 0x1000, 0x1000, 0x1000, 4);
+	test(h != NULL);
+	DoTest1(h);
+	h->Close();
+	h = UserHeap::ChunkHeap(&KNullDesC(), 0x1000, 0x10000, 0x1000, 4);
+	test(h != NULL);
+	DoTest1(h);
+	h->Close();
+	h = UserHeap::ChunkHeap(&KNullDesC(), 0x1000, 0x100000, 0x1000, 4096);
+	test(h != NULL);
+	DoTest1(h);
+	h->Close();
+	h = UserHeap::ChunkHeap(&KNullDesC(), 0x1000, 0x100000, 0x1000, 4);
+	test(h != NULL);
+	DoTest1(h);
+	h->Reset();
+	DoTest2(h);
+	h->Reset();
+	DoTest3(h);
+	h->Reset();
+	DoTest4(h);
+	h->Close();
+	h = UserHeap::ChunkHeap(&KNullDesC(), 0x1000, 0x100000, 0x1000, 8);
+	test(h != NULL);
+	DoTest1(h);
+	h->Reset();
+	DoTest2(h);
+	h->Reset();
+	DoTest3(h);
+	h->Reset();
+	DoTest4(h);
+	h->Close();
+	h = UserHeap::ChunkHeap(&KNullDesC(), 0x1000, 0x100000, 0x1000, 16);
+	test(h != NULL);
+	DoTest1(h);
+	h->Reset();
+	DoTest2(h);
+	h->Reset();
+	DoTest3(h);
+	h->Reset();
+	DoTest4(h);
+	h->Close();
+	h = UserHeap::ChunkHeap(&KNullDesC(), 0x1000, 0x100000, 0x1000, 32);
+	test(h != NULL);
+	DoTest1(h);
+	h->Reset();
+	DoTest2(h);
+	h->Reset();
+	DoTest3(h);
+	h->Reset();
+	DoTest4(h);
+	h->Close();
+	h = UserHeap::ChunkHeap(&KNullDesC(), 0x3000, 0x100000, 0x3000, 4);
+	test(h != NULL);
+	DoTest1(h);
+	h->Reset();
+	DoTest2(h);
+	h->Reset();
+	DoTest3(h);
+	h->Reset();
+	DoTest4(h);
+	h->Close();
+	}
+
 struct SHeapStress
 	{
 	RThread iThread;
@@ -384,7 +1277,8 @@
 void DoStressTest1(RAllocator* aAllocator)
 	{
 	RTestHeap* h = (RTestHeap*)aAllocator;
-	test.Printf(_L("Test Stress 1: max=%x\n"),	h->MaxLength());
+	test.Printf(_L("Test Stress 1: min=%x max=%x align=%d growby=%d\n"),
+						h->MinLength(), h->MaxLength(), h->Align(), h->GrowBy());
 	SHeapStress hs;
 	hs.iSeed = 0xb504f334;
 	hs.iAllocator = aAllocator;
@@ -398,7 +1292,8 @@
 void DoStressTest2(RAllocator* aAllocator)
 	{
 	RTestHeap* h = (RTestHeap*)aAllocator;
-	test.Printf(_L("Test Stress 2: max=%x\n"),	h->MaxLength());	
+	test.Printf(_L("Test Stress 2: min=%x max=%x align=%d growby=%d\n"),
+						h->MinLength(), h->MaxLength(), h->Align(), h->GrowBy());
 	SHeapStress hs1;
 	SHeapStress hs2;
 	hs1.iSeed = 0xb504f334;
@@ -435,31 +1330,39 @@
 TInt TestHeapGrowInPlace(TInt aMode)
     {
     TBool reAllocs=EFalse;
+    TBool heapGrew=EFalse;
+    
     RHeap* myHeap;
-	//
-	// Fixed DL heap used. 
-	//
-	myHeap = UserHeap::ChunkHeap(NULL,0x4000,0x4000,0x1000);
+    
+    myHeap = UserHeap::ChunkHeap(NULL,0x1000,0x4000,0x1000);
     
     TAny *testBuffer,*testBuffer2;
     // Start size chosen so that 1st realloc will use up exactly all the heap.
     // Later iterations wont, and there will be a free cell at the end of the heap.
-    TInt currentSize = ((0x800) - KSizeOfHeap) - KAllocCellSize;
+    TInt currentSize = ((0x800) - sizeof(RHeap)) - RHeap::EAllocCellSize;
     TInt growBy = 0x800;
-
+    TInt newSpace, space;
+    
     testBuffer2 = myHeap->Alloc(currentSize);
 
+    newSpace = myHeap->Size();
     do 
     {
-    	testBuffer = testBuffer2;
+    	space = newSpace;
+		testBuffer = testBuffer2;
 	    currentSize+=growBy;
 		testBuffer2 = myHeap->ReAlloc(testBuffer,currentSize,aMode);	
 		
+		newSpace = myHeap->Size();
+		
 		if (testBuffer2) 
 			{
 				
 			if (testBuffer!=testBuffer2)
 					reAllocs = ETrue;
+				
+			if (newSpace>space)
+					heapGrew = ETrue;
 			}
 		growBy-=16;
  	} while (testBuffer2);
@@ -474,6 +1377,11 @@
     	test.Printf(_L("Failure - Memory was moved!\n"));
     	return -100;
     	}
+    if (!heapGrew) 
+    	{
+    	test.Printf(_L("Failure - Heap Never Grew!\n"));
+    	return -200;
+    	}
     if (currentSize<= 0x3000) 
     	{
     	test.Printf(_L("Failed to grow by a reasonable amount!\n"));
@@ -532,51 +1440,15 @@
 	TestDEF078391Heap->Close();
 	}
 
-void PageBitmapGrowTest()
-	{
-	// Create a large heap to allocate 4 Mb memory (64 * 68 kb).
-	test.Next(_L("Allocate 64 * 68 kbytes to cause page bitmap growing"));
-	RHeap* myHeap;
-	myHeap = UserHeap::ChunkHeap(NULL,0x1000,0x500000,0x1000);
-	test(myHeap!=NULL);
-	TInt OrigSize = myHeap->Size();	
-	TUint8* cell[64];
-		// allocate all cells
-	TInt i;
-	RTestHeap* h = (RTestHeap*)myHeap;
-	for (i=0; i<64; ++i)
-		{
-		cell[i] = (TUint8*)h->TestAlloc(0x11000);
-		test(cell[i]!=NULL);
-    	}
-	h->FullCheck();
-	
-	// Release all allocated buffers by reseting heap
-	TInt Size = myHeap->Size();
-	test(Size > 0x400000);	
-	myHeap->Reset();
-	TInt Count = myHeap->AllocSize(Size);
- 	test(Count==0);
-	test(Size==0);
-	Size = myHeap->Size();
-	test(Size==OrigSize);
-	
-	h->Close();
-	
-	}
-	
 TInt E32Main()
 	{
 	test.Title();
 	__KHEAP_MARK;
 	test.Start(_L("Testing heaps"));
 	TestDEF078391();
+	Test1();
 	StressTests();
 	ReAllocTests();
-	//
-	// Some special tests for slab- and paged allocator
-	//
-	PageBitmapGrowTest();	
 	test.End();
 	__KHEAP_MARKEND;
 	return 0;
--- a/kerneltest/e32test/heap/t_heapcheck.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,652 +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\debug\t_heapcorruption.cpp
-// This is a test application that will cause heap corruption 
-// to generate BTrace events (EHeapCorruption).
-// 
-//
-
-//  Include Files
-#include <e32test.h>
-#include <e32base.h>
-#include <e32panic.h>
-#include <e32cmn.h>
-#include "dla.h"
-#include "slab.h"
-#include "page_alloc.h"
-#include "heap_hybrid.h"
-
-LOCAL_D RTest test(_L("T_HEAPCHECK"));
-
-TUint32 gSeed = 0xb504f334;
-
-_LIT(KLitHeapCheck,"Heap Check");
-
-
-TUint32 Random()
-{
-	gSeed *= 69069;
-	gSeed += 41;
-	return gSeed;
-}
-
-TInt RandomNumber(TInt aMin, TInt aMax)
-{
-	TInt y = aMax - aMin;
-	if ( y <= 0 )
-		return aMax;
-	TUint32 x = Random() & 0xff;
-	TInt s = 0;
-	while ( y > (0x100 << s) )
-		{
-		s++;
-		}
-	return (aMin + (x << s) % y);
-}
-
-
-/**
-Friend class of RHeapHybrid to access to hybrid heap metadata
-*/
-class TestHybridHeap
-{
-	public:
-		TBool Init();
-		TBool Check();
-		TUint8* Alloc(TInt aLth);
-		TUint8* ReAlloc(TAny* aBfr, TInt aLth, TInt aMode);
-		void   Free(TAny* aBfr);
-		TInt  AllocLen(TAny* aBfr);
-		TInt  AllocSize(TInt& aTotalAllocSize);						
-		TBool SlabAllocatorExists();
-		TBool PageAllocatorExists();			   
-		TBool SlabsCreated();
-		TBool CorruptSmallBin();
-		TBool CorruptTreeBin();
-		TBool ConfigurePageAllocator();
-		TInt  CopyPageBitmap(TUint8* aBitmap, TInt aLth);
-		TBool RestorePageBitmap(TUint8* aBitmap, TInt aLth);
-		void AllocateSomeBuffers(TUint8** aBfrs, TInt aMinLth, TInt MaxLth, TInt aCount);
-		TBool PrintHeapInitData();		
-
-	private:
-		RHybridHeap* iHybridHeap;
-};
-
-
-
-TBool TestHybridHeap::Init()
-{
-	RHybridHeap::STestCommand cmd;
-	cmd.iCommand = RHybridHeap::EHeapMetaData;
-	RAllocator& heap = User::Allocator();
-	TInt ret = heap.DebugFunction(RHeap::EHybridHeap, &cmd, 0);
-	if (ret != KErrNone)
-		return EFalse;
-	iHybridHeap = (RHybridHeap*) cmd.iData;
-	
-	return ETrue;
-}
-
-TBool TestHybridHeap::Check()
-{
-	if ( iHybridHeap )
-		{
-		iHybridHeap->Check();  
-		}
-
-	return EFalse;
-}
-
-TUint8* TestHybridHeap::Alloc(TInt aLth)
-{
-	if ( iHybridHeap )
-		{
-		return (TUint8*)iHybridHeap->Alloc(aLth);  
-		}
-
-	return NULL;
-}
-
-TUint8* TestHybridHeap::ReAlloc(TAny* aBfr, TInt aLth, TInt aMode)
-{
-	if ( iHybridHeap )
-		{
-		return (TUint8*)iHybridHeap->ReAlloc(aBfr, aLth, aMode);  
-		}
-
-	return NULL;
-}
-
-void TestHybridHeap::Free(TAny* aBfr)
-{
-	if ( iHybridHeap )
-		{
-		iHybridHeap->Free(aBfr);  
-		}
-}
-
-TInt TestHybridHeap::AllocLen(TAny* aBfr)
-{
-	if ( iHybridHeap )
-		{
-		return iHybridHeap->AllocLen(aBfr);  
-		}
-	return 0;
-}
-
-TInt TestHybridHeap::AllocSize(TInt& aTotalAllocSize)
-{
-	aTotalAllocSize = 0;
-	if ( iHybridHeap )
-		{
-		return iHybridHeap->AllocSize(aTotalAllocSize);  
-		}
-	return 0;
-}
-
-TBool TestHybridHeap::SlabAllocatorExists()
-{
-	TBool status = EFalse;
-	if ( iHybridHeap )
-		{
-		status = !iHybridHeap->iDLOnly;
-		}
-	
-	return status;
-}
-
-TBool TestHybridHeap::PageAllocatorExists()
-{
-	TBool status = EFalse;
-	if ( iHybridHeap )
-		{
-		status = (!iHybridHeap->iDLOnly && (iHybridHeap->iPageThreshold < 31));
-		}
-
-	return status;
-}
-
-TBool TestHybridHeap::SlabsCreated()
-{
-	TBool status = EFalse;
-	if ( iHybridHeap )
-		{
-		status = (iHybridHeap->iSlabThreshold != 0);
-		}
-
-	return status;
-}
-
-TBool TestHybridHeap::ConfigurePageAllocator()
-{
-	TBool status = EFalse;
-	if ( iHybridHeap )
-		{
-		RHybridHeap::STestCommand conf;
-		conf.iCommand = RHybridHeap::ESetConfig;
-		conf.iConfig.iPagePower = 14;  // 16 Kb		
-		if ( iHybridHeap->DebugFunction(RHeap::EHybridHeap, (TAny*)&conf ) == KErrNone )
-			status = ETrue;
-		}
-
-	return status;
-}
-
-
-TBool TestHybridHeap::CorruptTreeBin()
-{
-	TBool status = EFalse;
-	if ( iHybridHeap )
-		{
-		TUint i;
-		for (i = 0; i < NTREEBINS; ++i)
-			{
-			tbinptr* tb = TREEBIN_AT(&iHybridHeap->iGlobalMallocState, i);
-			tchunkptr t = *tb;
-			if ( t )
-				{
-				// Corrupt tree bin by writing erroneous index value
-				t->iIndex ++;
-				return ETrue;
-				}
-			}
-		}
-
-	return status;
-}
-
-TBool TestHybridHeap::CorruptSmallBin()
-{
-	TBool status = EFalse;
-	if ( iHybridHeap )
-		{
-		TUint i;
-		for (i = 0; i < NSMALLBINS; ++i)
-			{
-			sbinptr b = SMALLBIN_AT(&iHybridHeap->iGlobalMallocState, i);
-			mchunkptr p = b->iBk;
-			if ( p != b )
-				{ 
-				b->iBk = b;
-				status = ETrue;
-				}
-			}
-		}
-
-	return status;
-}
-
-TInt TestHybridHeap::CopyPageBitmap(TUint8* aBitmap, TInt aLth)
-{
-	TInt lth = 0;
-	if ( iHybridHeap && (aLth > (TInt) sizeof(iHybridHeap->iBitMapBuffer)) )
-		{// Dirty version
-		memcpy(aBitmap, &iHybridHeap->iBitMapBuffer[0], sizeof(iHybridHeap->iBitMapBuffer));
-        lth = sizeof(iHybridHeap->iBitMapBuffer) << 3;
-		}
-
-	return lth;
-}
-
-TBool TestHybridHeap::RestorePageBitmap(TUint8* aBitmap, TInt aLth)
-{
-	TBool status = EFalse;
-	if ( iHybridHeap && ((aLth >> 3) <= (TInt) sizeof(iHybridHeap->iBitMapBuffer)) )
-		{// Dirty version
-		memcpy(&iHybridHeap->iBitMapBuffer[0], aBitmap, (aLth >> 3));
-		status = ETrue;
-		}
-
-	return status;
-}
-
-void TestHybridHeap::AllocateSomeBuffers(TUint8** aBfrs, TInt aMinLth, TInt MaxLth, TInt aCount )
-{
-	
-	TInt loop = RandomNumber(2, 8);
-
-	while ( loop )
-		{
-		// allocate all buffers
-		TInt i;
-		for (i=0; i<aCount; ++i)
-			{
-			if (!aBfrs[i])
-				{
-				aBfrs[i] = (TUint8*)Alloc(RandomNumber(aMinLth, MaxLth));
-				}
-			}
-
-		// free some cells
-		TInt n = RandomNumber(2, aCount);
-		while (--n)
-			{
-			i = RandomNumber(2, aCount);
-			if (aBfrs[i])
-				{
-				Free(aBfrs[i]);
-				aBfrs[i] = NULL;
-				}
-			}
-
-		// realloc some cells
-		n = RandomNumber(2, aCount);
-		while (--n)
-			{
-			TInt new_len = RandomNumber(aMinLth, MaxLth);
-			if (aBfrs[i])
-				{
-				TUint8* p = (TUint8*)ReAlloc(aBfrs[i], new_len, Random());
-				if (p)
-					{
-					aBfrs[i] = p;
-					}
-				}
-			}
-
-		loop --;
-		}
-
-}	
-
-TBool TestHybridHeap::PrintHeapInitData()
-{
-	TInt total;
-	TInt count = AllocSize(total);
-	RDebug::Printf("Heap initialised for test, alloc count: %d , alloc size: %d\n", count, total);
-	if ( iHybridHeap )
-		RDebug::Printf("Heap initialised for test, iCellCount: %d , iTotalAllocSize: %d\n", iHybridHeap->iCellCount, iHybridHeap->iTotalAllocSize);	    	
-	return (count != 0);
-}
-
-
-//  Local Functions
-LOCAL_D TInt HeapCheckTestThread(TAny* param)
-{
-	TInt t = *((TInt*)param);
-	TUint8* bfrs[256];
-	Mem::FillZ(bfrs, sizeof(bfrs));
-	TestHybridHeap heap;
-	test(heap.Init());
-
-	switch( t )
-		{
-		case 1:
-			{
-			// Overwrite Doug Lea buffer and check()
-			heap.AllocateSomeBuffers(bfrs, 0x40, 0xfff0, 256);
-			test(heap.PrintHeapInitData());
-			TUint8 *p = heap.Alloc(64);
-			test( p != NULL );
-			Mem::FillZ(p, 80);  // Heap corrupted
-			heap.Check();    // This should cause panic
-			break;
-			}
-
-		case 2:
-			// Corrupt a smallbin and check
-			{
-			TInt i = 0;
-			TBool smallbin_corrupted = EFalse;
-			while ( !smallbin_corrupted )
-				{
-				heap.AllocateSomeBuffers(bfrs, 0x4, 0xff, 256);
-				smallbin_corrupted = heap.CorruptSmallBin();
-				i ++;
-				if ( i > 9 )
-					break;
-				}
-			test(smallbin_corrupted);
-    		test(heap.PrintHeapInitData());
-			heap.Check();    // This should cause panic
-			}
-			break;
-
-		case 3:
-			// Corrupt a treebin and check
-			{
-			TInt i = 0;
-			TBool treebin_corrupted = EFalse;
-			while ( !treebin_corrupted )
-				{
-				heap.AllocateSomeBuffers(bfrs, 0x100, 0x4000, 256);
-				treebin_corrupted = heap.CorruptTreeBin();
-				i ++;
-				if ( i > 9 )
-					break;
-				}
-			test(treebin_corrupted);
-			test(heap.PrintHeapInitData());						
-			heap.Check();    // This should cause panic
-			break;
-			}
-
-		case 10:
-			// Overwrite slab buffer and check
-			{
-			TInt i = 0;
-			TBool slabs_created = EFalse;
-			if ( !heap.SlabAllocatorExists() )
-				{
-				User::Panic(KLitHeapCheck, ETHeapDebugUnmatchedCallToCheckHeap);
-				}
-
-			while ( !slabs_created )
-				{
-				// Allocate enough buffers to cause slab allocator to be
-				// initialised  		
-				heap.AllocateSomeBuffers(bfrs, 0x4, 0x2000, 256);
-				slabs_created = heap.SlabsCreated();
-				i ++;
-				if ( i > 9 )
-					break;
-				}
-			test(slabs_created);
-			test(heap.PrintHeapInitData());						
-			i = 0;
-			TUint8* p[10];
-			while ( i < 10 )
-				{
-				p[i] = heap.Alloc(24);
-				test( p[i] != NULL );
-				i ++;
-				}
-			i = 0;
-			while ( i < 10 )
-				{
-				heap.Free(p[i]);	
-				i +=2;
-				}
-			p[0] = heap.Alloc(24);
-			test( p[0] != NULL );
-			memset((TUint8*)(Floor(p[0], SLABSIZE) + sizeof(slabhdr)), 0xee, KMaxSlabPayload);  // Heap corrupted
-			heap.Check();         // This should cause panic
-			break;
-			}
-
-		case 11:
-			// Corrupt slab header
-			{
-			TInt i = 0;
-			TBool slabs_created = EFalse;
-			if ( !heap.SlabAllocatorExists() )
-				{
-				User::Panic(KLitHeapCheck, ETHeapDebugUnmatchedCallToCheckHeap);
-				}
-
-			while ( !slabs_created )
-				{
-				// Allocate enough buffers to cause slab allocator to be
-				// initialised  		
-				heap.AllocateSomeBuffers(bfrs, 0x4, 0x2000, 256);
-				slabs_created = heap.SlabsCreated();
-				i ++;
-				if ( i > 9 )
-					break;
-				}
-			test(slabs_created);
-			test(heap.PrintHeapInitData());						
-			TUint8* p = heap.Alloc(28);
-			test(p != NULL);
-			p = Floor(p, SLABSIZE);
-			*(TUint32*)p = 0xffeeddcc;
-			heap.Check();      // This should cause panic
-			break;
-			}
-
-		case 20:
-			// Corrupt page bitmap data and check
-			{
-			if ( !heap.PageAllocatorExists() )
-				{
-				User::Panic(KLitHeapCheck, ETHeapDebugUnmatchedCallToCheckHeap);
-				}
-			test(heap.ConfigurePageAllocator());
-			// Allocate some buffers to cause slab allocator to be
-			// initialised  		
-			heap.AllocateSomeBuffers(bfrs, 0x4000, 0x10000, 16);
-			test(heap.PrintHeapInitData());						
-			TUint8* bitmap = heap.Alloc(128);  // For saved bitmap
-			test(bitmap != NULL);
-			TInt bit_lth = heap.CopyPageBitmap(bitmap, 128);
-			test(bit_lth != 0);
-			memset(bitmap, 0xee, (bit_lth>>3));  //  corrupt bitmap data
-			heap.RestorePageBitmap(bitmap, bit_lth);
-			heap.Check();      // This should cause panic
-			break;
-			}
-
-		case 21:
-			// Corrupt page bitmap with a earlier freed "ghost" buffer info
-			{
-			if ( !heap.PageAllocatorExists() )
-				{
-				User::Panic(KLitHeapCheck, ETHeapDebugUnmatchedCallToCheckHeap);
-				}
-			test(heap.ConfigurePageAllocator());
-			// Allocate some buffers to cause slab allocator to be
-			// initialised  		
-			heap.AllocateSomeBuffers(bfrs, 0x4000, 0x10000, 16);
-			test(heap.PrintHeapInitData());						
-			TUint8* bitmap = heap.Alloc(128);  // For saved bitmap
-			test(bitmap != NULL);
-			TUint8* p = heap.Alloc(0x8000);     // One more page buffer
-			TInt bit_lth = heap.CopyPageBitmap(bitmap, 128);
-			test(bit_lth != 0);
-			heap.Free(p);
-			heap.RestorePageBitmap(bitmap, bit_lth);
-			heap.Check();      // This should cause panic
-			break;
-			}
-
-		default:
-			break;
-		}
-
-	User::Invariant();	// Should not reach here 
-	return 0;
-}
-
-
-class TestHeapCheck
-{
-	public:
-		void TestCheck(void);
-		TInt TestThreadExit(RThread& aThread, TExitType aExitType, TInt aExitReason);
-};
-
-
-TInt TestHeapCheck::TestThreadExit(RThread& aThread, TExitType aExitType, TInt aExitReason)
-{
-	// Disable JIT debugging.
-	TBool justInTime=User::JustInTime();
-	User::SetJustInTime(EFalse);
-
-	TRequestStatus status;
-	aThread.Logon(status); 
-	aThread.Resume();
-	User::WaitForRequest(status);
-	if (aExitType != aThread.ExitType())
-		return KErrGeneral;
-
-	if ( (status.Int() == ETHeapDebugUnmatchedCallToCheckHeap) && (aThread.ExitReason() == ETHeapDebugUnmatchedCallToCheckHeap))
-		{
-		CLOSE_AND_WAIT(aThread);
-		// Put JIT debugging back to previous status.
-		User::SetJustInTime(justInTime);
-		return KErrNotSupported;
-		}
-
-	if ( status.Int() == ERTestFailed )
-		return KErrGeneral;
-
-	if ( aExitReason > 0 )
-		{
-		if (aExitReason != status.Int())
-			return KErrGeneral;
-
-		if (aExitReason != aThread.ExitReason())
-			return KErrGeneral;		
-		}
-	
-	CLOSE_AND_WAIT(aThread);
-
-	// Put JIT debugging back to previous status.
-	User::SetJustInTime(justInTime);
-	return KErrNone;
-
-}
-
-void TestHeapCheck::TestCheck()
-{
-    TInt type;
-	TInt r;
-	
-	test.Next(_L("Testing Doug Lea allocator check"));
-	{
-	type = 1;
-	RThread thread;
-	test(thread.Create(_L("Check UserHeap"),HeapCheckTestThread, KDefaultStackSize, 0x1000, 0x400000,  (TAny*) &type)== KErrNone);
-	test(TestThreadExit(thread, EExitPanic, ETHeapBadCellAddress)==KErrNone);
-	
-    type = 2;
-    test(thread.Create(_L("Check UserHeap"),HeapCheckTestThread, KDefaultStackSize, 0x1000, 0x400000,  (TAny*) &type)==KErrNone);
-    test(TestThreadExit(thread, EExitPanic, ETHeapBadCellAddress)==KErrNone);
-
-	type = 3;
-	test(thread.Create(_L("Check UserHeap"),HeapCheckTestThread, KDefaultStackSize, 0x1000, 0x400000,  (TAny*) &type)==KErrNone);
-	test(TestThreadExit(thread, EExitPanic, ETHeapBadCellAddress)==KErrNone);
-	
-	}
-
-	test.Next(_L("Testing Slab allocator check"));	
-	{
-	type = 10;
-	RThread thread;
-	test(thread.Create(_L("Check UserHeap"),HeapCheckTestThread, KDefaultStackSize, 0x1000, 0x400000,  (TAny*) &type)==KErrNone);
-	r = TestThreadExit(thread, EExitPanic, ETHeapBadCellAddress);
-	if ( r != KErrNotSupported )
-		{
-		test(r==KErrNone);
-		
-		type = 11;
-		RThread thread;
-		test(thread.Create(_L("Check UserHeap"),HeapCheckTestThread, KDefaultStackSize, 0x1000, 0x400000,  (TAny*) &type)==KErrNone);
-		test(TestThreadExit(thread, EExitPanic, ETHeapBadCellAddress)==KErrNone);
-		}
-	else test.Printf(_L("Slab allocator does not exist, testes bypassed\n"));	
-	}
-
-	test.Next(_L("Testing Page allocator check"));	
-	{
-	type = 20;
-	RThread thread;
-	test(thread.Create(_L("Check UserHeap"),HeapCheckTestThread, KDefaultStackSize, 0x1000, 0x800000,  (TAny*) &type)==KErrNone);	
-	r = TestThreadExit(thread, EExitPanic, KErrNone);   // Accept any panic reason here
-	if ( r != KErrNotSupported )
-		{
-		test(r==KErrNone);
-
-		type = 21;
-		RThread thread;
-		test(thread.Create(_L("Check UserHeap"),HeapCheckTestThread, KDefaultStackSize, 0x1000, 0x800000,  (TAny*) &type)==KErrNone);
-		test(TestThreadExit(thread, EExitPanic,	KErrNone)==KErrNone);  // Accept any panic reason here
-		}
-    else test.Printf(_L("Page allocator does not exist, testes bypassed\n"));
-	}
-
-}
-
-
-
-
-//  Global Functions
-
-GLDEF_C TInt E32Main(void)
-	{
-
-	test.Title();
-	
-	test.Start(_L("Testing Heap Check function"));
-	
-	TestHeapCheck T;
-	
-	T.TestCheck();
-
-	test.End();
-	
-	return(0);
-	}
-
--- a/kerneltest/e32test/heap/t_heapdb.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/heap/t_heapdb.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -45,28 +45,18 @@
 #include <e32test.h>
 #include <e32def.h>
 #include <e32def_private.h>
-#include "dla.h"
-#include "slab.h"
-#include "page_alloc.h"
-#include "heap_hybrid.h"
-#define KHEAPCELLINFO RHybridHeap::SHeapCellInfo
 
 LOCAL_D RTest test(_L("T_HEAPDB"));
 
 #if defined(_DEBUG)
 
-KHEAPCELLINFO CellInfo[4];
+RHeap::SHeapCellInfo CellInfo[4];
 
 class RTestHeap : public RHeap
 	{
 public:
-	void AttachInfo(KHEAPCELLINFO* aInfo)
-		{
-		RHybridHeap::STestCommand cmd;
-		cmd.iData = aInfo;
-		cmd.iCommand = RHybridHeap::ETestData;
-		DebugFunction(RHeap::EHybridHeap, (TAny*)&cmd);
-		}
+	void AttachInfo(SHeapCellInfo* aInfo)
+		{iTestData = aInfo;}
 	};
 
 void AttachToHeap(RHeap* aHeap, TInt aInfo)
@@ -78,17 +68,19 @@
 
 void TestCellInfo(TInt aInfo, TInt aNest, TInt aAllocCount, TInt aLevelAlloc, TInt aSize, TAny* aAddr)
 	{
-	(void) aSize;
-	KHEAPCELLINFO& ci = CellInfo[aInfo];
+	RHeap::SHeapCellInfo& ci = CellInfo[aInfo];
 	RHeap::SDebugCell& cell = *ci.iStranded;
 	test(cell.nestingLevel == aNest);
 	test(cell.allocCount == aAllocCount);
 	test(ci.iLevelAlloc == aLevelAlloc);
+	test(cell.len == aSize + RHeap::EAllocCellSize);
 	test((&cell+1) == aAddr);
 	}
 
 const TInt KMaxFailureRate=100;
 const TInt KThreadMemError=-50;
+const TInt KCellSize=(sizeof(RHeap::SCell)); // Size of free cell header	
+const TInt KHeadSize=(sizeof(RHeap::SDebugCell)); // Size of allocated cell header with space for heaven info
 
 LOCAL_D TInt heapCount=1;
 LOCAL_D RSemaphore threadSemaphore;
--- a/kerneltest/e32test/heap/t_heapdl.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,509 +0,0 @@
-// Copyright (c) 1995-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\heap\t_heapdl.cpp
-// Overview:
-// Tests RHybridHeap class.
-// API Information:
-// RHybridHeap
-// Details:
-// 
-//
-
-#include <e32test.h>
-#include <e32math.h>
-#include <e32def_private.h>
-#include "dla.h"
-#include "slab.h"
-#include "page_alloc.h"
-#include "heap_hybrid.h"
-
-const TUint KTestIterations = 100;
-
-const TInt KHeadSize = (TInt)RHeap::EAllocCellSize;
-
-class TestHybridHeap
-  {
-public:
-  static void TopSize(TInt& aTopSize, const RHybridHeap * aHybridHeap);
-  static void DvSize(TInt& aDvSize, const RHybridHeap * aHybridHeap);
-  static void SmallMap(TUint& aSmallMap, const RHybridHeap * aHybridHeap);
-  static void TreeMap(TUint& aTreeMap, const RHybridHeap * aHybridHeap);
-  static void TrimCheck(TInt& aTrimCheck, const RHybridHeap * aHybridHeap);
-  static void GrowBy(TInt& aGrowBy, const RHybridHeap * aHybridHeap);
-  static void PageSize(TInt& aPageSize, const RHybridHeap * aHybridHeap);
-  };
-
-
-void TestHybridHeap::TopSize(TInt& aTopSize, const RHybridHeap * aHybridHeap)
-  {
-  aTopSize = aHybridHeap->iGlobalMallocState.iTopSize;
-  }
-
-
-void TestHybridHeap::DvSize(TInt& aDvSize, const RHybridHeap * aHybridHeap)
-  {
-  aDvSize = aHybridHeap->iGlobalMallocState.iDvSize;
-  }
-
-
-void TestHybridHeap::SmallMap(TUint& aSmallMap, const RHybridHeap * aHybridHeap)
-  {
-  aSmallMap = aHybridHeap->iGlobalMallocState.iSmallMap;
-  }
-
-
-void TestHybridHeap::TreeMap(TUint& aTreeMap, const RHybridHeap * aHybridHeap)
-  {
-  aTreeMap = aHybridHeap->iGlobalMallocState.iTreeMap;
-  }
-
-
-void TestHybridHeap::TrimCheck(TInt& aTrimCheck, const RHybridHeap * aHybridHeap)
-  {
-  aTrimCheck = aHybridHeap->iGlobalMallocState.iTrimCheck;
-  }
-
-
-void TestHybridHeap::GrowBy(TInt& aGrowBy, const RHybridHeap * aHybridHeap)
-  {
-  aGrowBy = aHybridHeap->iGrowBy;
-  }
-
-void TestHybridHeap::PageSize(TInt& aPageSize, const RHybridHeap * aHybridHeap)
-  {
-  aPageSize = aHybridHeap->iPageSize;
-  }
-
-
-LOCAL_D RTest test(_L("T_HEAPDL"));
-
-
-class TestRHeap
-  {
-public:
-  void InitTests();
-  void Test1(void);
-  void Test2(void);
-  void Test3(void);
-  void Test4(void);
-  void CloseTests();
-private:
-  RHybridHeap* iHybridHeap;
-  RHeap *iHeap;
-  };
-
-
-void TestRHeap::InitTests()
-  {
-  // Allocate a chunk heap
-  TPtrC testHeap=_L("TESTHEAP");
-  iHeap=User::ChunkHeap(&testHeap,0x1800,0x16000);
-        
-  RHybridHeap::STestCommand cmd;
-  cmd.iCommand = RHybridHeap::EHeapMetaData;
-  iHeap->DebugFunction(RHeap::EHybridHeap, (TAny*)&cmd );
-  iHybridHeap = (RHybridHeap*) cmd.iData;
-  }
-
-
-void TestRHeap::Test1(void)
-  {
-  //
-  //  Splitting a new cell off 'top' chunk
-  //  Growing and shrinking 'top' chunk
-  //  Coalesceing of adjacent free cells
-  //
-    
-  TInt topSizeBefore, topSizeAfter, allocSize;
-  TInt growBy, pageSize;
-  TestHybridHeap::GrowBy(growBy,iHybridHeap);
-  TestHybridHeap::PageSize(pageSize,iHybridHeap);
-        
-  //Splitting a new cell off 'top' chunk
-  TestHybridHeap::TopSize(topSizeBefore,iHybridHeap);
-  TAny* p1=iHeap->Alloc(0x256);
-  TestHybridHeap::TopSize(topSizeAfter,iHybridHeap);
-  test(topSizeBefore > topSizeAfter);
-  iHeap->Check();
-  iHeap->Free(p1);
-  iHeap->Check();
-    
-  //Growing 'top' chunk
-  test(iHeap!=NULL);
-  TestHybridHeap::TopSize(topSizeBefore,iHybridHeap);
-  p1=iHeap->Alloc(pageSize*2); 
-  test(p1!=NULL);
-  allocSize=iHeap->AllocLen(p1);
-  TestHybridHeap::TopSize(topSizeAfter,iHybridHeap);
-  test(topSizeBefore + growBy == topSizeAfter+allocSize+KHeadSize);
-    
-  //Splitting a new cell off 'top' chunk
-  TAny *p2=iHeap->Alloc(pageSize/8); 
-  test(p2!=NULL);
-  //Splitting a new cell off 'top' chunk
-  TAny *p3=iHeap->Alloc(pageSize/2); 
-  test(p3!=NULL);
-  //Growing 'top' chunk
-  TAny *p4=iHeap->Alloc(pageSize*2); 
-  test(p4!=NULL);
-  //Take allocSize of p4
-  allocSize=iHeap->AllocLen(p4);
-    
-  //Shrinking 'top' chunk
-  TInt trimCheck;
-  TestHybridHeap::TopSize(topSizeBefore,iHybridHeap);
-  iHeap->Free(p4);
-  TestHybridHeap::TopSize(topSizeAfter,iHybridHeap);
-  TestHybridHeap::TrimCheck(trimCheck,iHybridHeap);
-  test(topSizeAfter + trimCheck == topSizeBefore+allocSize+KHeadSize);
-  iHeap->Check();
-  
-  //Insert chunk into treebin
-  TUint treeMap,treeMap2;
-  TestHybridHeap::TreeMap(treeMap,iHybridHeap);
-  test(treeMap==0);
-  iHeap->Free(p2);
-  TestHybridHeap::TreeMap(treeMap,iHybridHeap);
-  test(treeMap>0);
-  iHeap->Check();
-    
-  //Coalesce adjacent free cells and insert chunk into treebin
-  TestHybridHeap::TreeMap(treeMap,iHybridHeap);
-  iHeap->Free(p1);
-  TestHybridHeap::TreeMap(treeMap2,iHybridHeap);
-  test(treeMap < treeMap2);
-  iHeap->Check();
-    
-  //free last allocation
-  iHeap->Free(p3);
-  iHeap->Check();
-  }
-
-
-void TestRHeap::Test2(void)
-  {
-  //
-  // Allocation of exact sized cells from 'small cell' lists (smallbin)
-  // Freeing of exact sized cells back to 'small cell' lists (smallbin)
-  //
-  TInt ArraySize=32;
-  TInt cellSize=0;
-  TInt topSizeBefore, topSizeAfter;
-     
-  TAny** ArrayOfCells;
-  ArrayOfCells= new TAny*[ArraySize];
-  TInt ArrayIndex;
-  // Allocate exact sized small cells 8,16,32,40--->
-  // and put them to the array. They are allocated from TOP chunk
-  for(ArrayIndex=0; ArrayIndex<ArraySize;ArrayIndex++)
-    {
-    TestHybridHeap::TopSize(topSizeBefore,iHybridHeap);
-    cellSize=cellSize+8;
-    ArrayOfCells[ArrayIndex]=iHeap->Alloc(cellSize);
-    TestHybridHeap::TopSize(topSizeAfter,iHybridHeap);
-    test(topSizeBefore > topSizeAfter);
-    }
-  iHeap->Check();
-  
-  TUint smallMap, smallMap2;
-  TInt dvSize, dvSize2;
-  TestHybridHeap::SmallMap(smallMap,iHybridHeap);
-  test(smallMap == 0);
-  // Free some of small cells from the array. So they are inserted
-  // to the smallbin
-  for(ArrayIndex=2; ArrayIndex<ArraySize-1; ArrayIndex+=5)
-    {
-    TestHybridHeap::SmallMap(smallMap,iHybridHeap);
-    iHeap->Free(ArrayOfCells[ArrayIndex]);
-    TestHybridHeap::SmallMap(smallMap2,iHybridHeap);
-    test(smallMap<smallMap2);
-    }
-  iHeap->Check();
-    
-  // Allocate exact sized cells from smallbin (or Designated Victim)   
-  TestHybridHeap::SmallMap(smallMap,iHybridHeap);
-  TAny* p1=iHeap->Alloc(32);
-  TestHybridHeap::SmallMap(smallMap2,iHybridHeap);
-  test(smallMap>smallMap2);
-    
-  TestHybridHeap::SmallMap(smallMap,iHybridHeap);
-  TestHybridHeap::DvSize(dvSize,iHybridHeap);
-  TAny* p2=iHeap->Alloc(32);
-  TestHybridHeap::SmallMap(smallMap2,iHybridHeap);
-  TestHybridHeap::DvSize(dvSize2,iHybridHeap);
-  if(dvSize <= dvSize2)
-    test(smallMap>smallMap2);
-    
-  TestHybridHeap::SmallMap(smallMap,iHybridHeap);
-  TestHybridHeap::DvSize(dvSize,iHybridHeap);
-  TAny* p3=iHeap->Alloc(32);
-  TestHybridHeap::SmallMap(smallMap2,iHybridHeap);
-  TestHybridHeap::DvSize(dvSize2,iHybridHeap);
-  if(dvSize <= dvSize2)
-  	test(smallMap>smallMap2);
-   
-  TestHybridHeap::SmallMap(smallMap,iHybridHeap);
-  TestHybridHeap::DvSize(dvSize,iHybridHeap);
-  TAny* p4=iHeap->Alloc(32);
-  TestHybridHeap::SmallMap(smallMap2,iHybridHeap);
-  TestHybridHeap::DvSize(dvSize2,iHybridHeap);
-  if(dvSize <= dvSize2)
-    test(smallMap>smallMap2);
-   
-  TestHybridHeap::SmallMap(smallMap,iHybridHeap);
-  TestHybridHeap::DvSize(dvSize,iHybridHeap);
-  TAny* p5=iHeap->Alloc(48);
-  TestHybridHeap::SmallMap(smallMap2,iHybridHeap);
-  TestHybridHeap::DvSize(dvSize2,iHybridHeap);
-  if(dvSize <= dvSize2)
-    test(smallMap>smallMap2);
-    
-  TestHybridHeap::SmallMap(smallMap,iHybridHeap);
-  TestHybridHeap::DvSize(dvSize,iHybridHeap);
-  TAny* p6=iHeap->Alloc(64);
-  TestHybridHeap::SmallMap(smallMap2,iHybridHeap);
-  TestHybridHeap::DvSize(dvSize2,iHybridHeap);
-  if(dvSize <= dvSize2)
-    test(smallMap>smallMap2);
-   
-  TestHybridHeap::SmallMap(smallMap,iHybridHeap);
-  TestHybridHeap::DvSize(dvSize,iHybridHeap);
-  TAny* p7=iHeap->Alloc(80);
-  TestHybridHeap::SmallMap(smallMap2,iHybridHeap);
-  TestHybridHeap::DvSize(dvSize2,iHybridHeap);
-  if(dvSize <= dvSize2)
-    test(smallMap>smallMap2);
-   
-  TestHybridHeap::SmallMap(smallMap,iHybridHeap);
-  TestHybridHeap::DvSize(dvSize,iHybridHeap);
-  TAny* p8=iHeap->Alloc(96);
-  TestHybridHeap::SmallMap(smallMap2,iHybridHeap);
-  TestHybridHeap::DvSize(dvSize2,iHybridHeap);
-  if(dvSize <= dvSize2)
-    test(smallMap>smallMap2);
-  iHeap->Check();
-  
-  // Freeing of exact sized cells back to smallbin
-  TestHybridHeap::SmallMap(smallMap,iHybridHeap);
-  iHeap->Free(p1);
-  iHeap->Free(p2);
-  iHeap->Free(p3);
-  iHeap->Free(p4);
-  iHeap->Free(p5);
-  iHeap->Free(p6);
-  iHeap->Free(p7);
-  iHeap->Free(p8);
-  TestHybridHeap::SmallMap(smallMap2,iHybridHeap);
-  test(smallMap < smallMap2);
-  iHeap->Check();
-  
-  // Now free rest of the array with Reset
-  iHeap->Reset();
-  iHeap->Check();
-  
-  delete [] ArrayOfCells;
-  }
-
-
-void TestRHeap::Test3(void)
-  {
-  //
-  // Allocation of approximate sized cells from 'small cell' lists (smallbin)
-  //
-  const TInt ArraySize=32;
-  TInt cellSize=0;
-  TAny** ArrayOfCells;
-  ArrayOfCells= new TAny*[ArraySize];
-  TInt ArrayIndex;
-  TInt topSizeBefore, topSizeAfter;
-    
-  // Allocate small approximate sized cells and put
-  //them to the array. They are allocated from TOP chunk
-  TUint8 randomSize[ArraySize];
-  for(ArrayIndex=0; ArrayIndex<ArraySize;ArrayIndex++)
-    {
-    TestHybridHeap::TopSize(topSizeBefore,iHybridHeap);
-    // Ensure that the size of the cell does not exceed 256 bytes on debug builds
-    randomSize[ArrayIndex] = (TUint8) (Math::Random() % (MAX_SMALL_REQUEST + 1 - RHeap::EDebugHdrSize));
-  	cellSize=randomSize[ArrayIndex];
-  	ArrayOfCells[ArrayIndex]=iHeap->Alloc(cellSize);
-  	TestHybridHeap::TopSize(topSizeAfter,iHybridHeap);
-  	test(topSizeBefore > topSizeAfter);
-  	}
-  iHeap->Check();
-  
-  TUint smallMap, smallMap2;
-  // Free some of allocated cells from the array. So they are inserted
-  // to the smallbin
-  TestHybridHeap::SmallMap(smallMap,iHybridHeap);
-  for(ArrayIndex=2; ArrayIndex<ArraySize-1; ArrayIndex+=5)
-    {
-    iHeap->Free(ArrayOfCells[ArrayIndex]);
-    }
-  TestHybridHeap::SmallMap(smallMap2,iHybridHeap);
-  test(smallMap<=smallMap2);
-  iHeap->Check();
-  
-  // Allocate approximate sized cells from smallbin
-  const TInt ArraySize2=6;
-  TInt cellSize2=0;
-  TAny** ArrayOfCells2;
-  ArrayOfCells2= new TAny*[ArraySize2];
-  TInt ArrayIndex2;
-  TestHybridHeap::SmallMap(smallMap,iHybridHeap);
-  TUint8 randomSize2[ArraySize2];
-  for(ArrayIndex2=0; ArrayIndex2<ArraySize2;ArrayIndex2++)
-    {
-    randomSize2[ArrayIndex2]=randomSize[2+ArrayIndex2*5];
-    cellSize2=randomSize2[ArrayIndex2];
-    ArrayOfCells2[ArrayIndex2]=iHeap->Alloc(cellSize2);
-    }
-  TestHybridHeap::SmallMap(smallMap2,iHybridHeap);
-  test(smallMap>=smallMap2);
-  iHeap->Check();
-  
-  // Freeing of approximate sized cells back to smallbin
-  for(ArrayIndex2=0; ArrayIndex2<ArraySize2-1; ArrayIndex2+=1)
-    {
-    iHeap->Free(ArrayOfCells2[ArrayIndex2]);
-    }
-  iHeap->Check();
-  
-  // Now free rest of the array with Reset
-  iHeap->Reset();
-  iHeap->Check();
-  
-  delete [] ArrayOfCells;
-  delete [] ArrayOfCells2; 
-  }
-
-
-void TestRHeap::Test4(void)
-  {
-  //
-  // Allocation of approximate sized cells from digital trees (treebin) and splitting
-  // Freeing of approximate sized cells back to digital trees (treebin)
-  //
-  const TInt ArraySize=32;
-  TInt cellSize=0;
-  TAny** ArrayOfCells;
-  ArrayOfCells= new TAny*[ArraySize];
-  TInt ArrayIndex;
-        
-  // Allocate approximate sized cells bigger than 256
-  // and put them to the array. They are allocated from TOP chunk
-  TUint8 randomSize[ArraySize];
-  for(ArrayIndex=0; ArrayIndex<ArraySize;ArrayIndex++)
-    {
-    randomSize[ArrayIndex] = (TUint8)Math::Random();
-    cellSize=(randomSize[ArrayIndex]+MAX_SMALL_REQUEST+1);
-    ArrayOfCells[ArrayIndex]=iHeap->Alloc(cellSize);
-    }
-  iHeap->Check();
-  
-  TUint treeMap,treeMap2;
-  // Free some of allocated cells from the array. So they are inserted
-  // to the treebin
-  for(ArrayIndex=2; ArrayIndex<ArraySize-1; ArrayIndex+=5)
-    {
-    TestHybridHeap::TreeMap(treeMap,iHybridHeap);
-    iHeap->Free(ArrayOfCells[ArrayIndex]);
-    TestHybridHeap::TreeMap(treeMap2,iHybridHeap);
-    test(treeMap <= treeMap2);
-    }
-  iHeap->Check();
-  
-  // Allocate approximate sized cells from treebin
-  const TInt ArraySize2=16;
-  TInt cellSize2=0;    
-  TAny** ArrayOfCells2;
-  ArrayOfCells2= new TAny*[ArraySize2];
-  TInt ArrayIndex2;
-  TUint8 randomSize2[ArraySize2];
-  for(ArrayIndex2=0; ArrayIndex2<ArraySize2;ArrayIndex2++)
-    {
-    TestHybridHeap::TreeMap(treeMap,iHybridHeap);
-    randomSize2[ArrayIndex2] = (TUint8)Math::Random();
-    cellSize2=(randomSize2[ArrayIndex2]+MAX_SMALL_REQUEST+1);
-    ArrayOfCells2[ArrayIndex2]=iHeap->Alloc(cellSize2);
-    TestHybridHeap::TreeMap(treeMap2,iHybridHeap);
-    test(treeMap >= treeMap2);
-    }
-  iHeap->Check();
-  
-  // Freeing of approximate sized cells back to treebin
-  TestHybridHeap::TreeMap(treeMap,iHybridHeap);
-  for(ArrayIndex2=0; ArrayIndex2<ArraySize2-1; ArrayIndex2+=1)
-    {
-    iHeap->Free(ArrayOfCells2[ArrayIndex2]);
-    }
-  TestHybridHeap::TreeMap(treeMap2,iHybridHeap);
-  test(treeMap <= treeMap2);
-  iHeap->Check();
-    
-  // Now free rest of the array with Reset
-  iHeap->Reset();
-  iHeap->Check();
-    
-  delete [] ArrayOfCells;
-  delete [] ArrayOfCells2; 
-  }
-
-
-void TestRHeap::CloseTests()
-  {
-  // close heap so we don't exceed chunk limit
-  iHeap->Close();  
-  }
-
-
-GLDEF_C TInt E32Main(void)
-  {
-  test.Title();
-
-  __KHEAP_MARK;
-
-  TestRHeap T;
-  TUint i;
-  test.Start(_L("Init DL allocator tests"));
-  T.InitTests();
-  test.Next(_L("Test DL allocator 1"));
-  for(i = 0; i < KTestIterations; i++)
-    {
-    T.Test1();
-    }
-  test.Next(_L("Test DL allocator 2"));
-  for(i = 0; i < KTestIterations; i++)
-    {
-    T.Test2();
-    }
-  test.Next(_L("Test DL allocator 3"));
-  for(i = 0; i < KTestIterations; i++)
-    {
-    T.Test3();
-    }
-  test.Next(_L("Test DL allocator 4"));
-  for(i = 0; i < KTestIterations; i++)
-    {
-    T.Test4();
-    }
-  test.Next(_L("Close DL allocator tests"));
-  T.CloseTests();
-	
-  __KHEAP_CHECK(0);
-  __KHEAP_MARKEND;
-
-  test.End();
-  return(0);
-  }
--- a/kerneltest/e32test/heap/t_heappagealloc.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,462 +0,0 @@
-// Copyright (c) 1995-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\heap\t_page_alloc.cpp
-// Overview:
-// Tests RHeap class.
-// API Information:
-// RHeap
-// Details:
-// - Tests that the page bitmap is consistent (i.e. encoded sizes are sensible and 
-// encoded in the correct fashion.
-// - Tests that pages which appear in the page bitmap are present in memory by 
-// reading them.
-// -Tests that other pages are not readable  
-// - Tests page bitmap by creating an allocator where all allocations >= 4kB use
-// paged allocator, allocating a large number of regions of various sizes (from
-// 4 kB to b MB), checking that the walk function finds them all correctly, freeing
-// some of them, checking the walk function again, and so on. 
-// Platforms/Drives/Compatibility:
-// All
-// Assumptions/Requirement/Pre-requisites:
-// Failures and causes:
-// Base Port information:
-// 
-//
-
-#include <e32test.h>
-#include <e32hal.h>
-#include <e32def.h>
-#include <e32math.h>
-#include <e32def_private.h>
-#include "dla.h"
-#include "slab.h"
-#include "page_alloc.h"
-#include "heap_hybrid.h"
-
-
-struct TMetaData
-    {
-    TBool           iDLOnly;
-    RFastLock*      iLock;
-    TInt            iChunkSize;
-    TInt            iSlabThreshold;
-    unsigned        iSlabInitThreshold;
-    unsigned        iSlabConfigBits;
-    slab*           iPartialPage;
-    slab*           iFullSlab;
-    page*           iSparePage;
-    TUint8*         iMemBase;
-    unsigned char   iSizeMap[(MAXSLABSIZE>>2)+1];
-    slabset         iSlabAlloc[MAXSLABSIZE>>2];
-    slab**          iSlabAllocRealRootAddress[MAXSLABSIZE>>2];
-    };
-
-LOCAL_D RTest test(_L("T_HEAPPAGEALLOC"));
-
-class TestHybridHeap
-    {
-public:
-    static TUint8* MemBase(const RHybridHeap * aHybridHeap);
-    static void GetHeapMetaData(RHeap& aHeap, TMetaData& aMeta);
-    };
-
-TUint8* TestHybridHeap::MemBase(const RHybridHeap * aHybridHeap)
-	{
-	return aHybridHeap->iMemBase;
-	}
-
-void TestHybridHeap::GetHeapMetaData(RHeap& aHeap, TMetaData& aMeta)
-{
-    RHybridHeap::STestCommand cmd;
-    cmd.iCommand = RHybridHeap::EHeapMetaData;
-    TInt ret = aHeap.DebugFunction(RHeap::EHybridHeap, &cmd, 0);
-    test(ret == KErrNone);
-    
-    RHybridHeap* hybridHeap = (RHybridHeap*) cmd.iData;
-    
-    aMeta.iDLOnly              = hybridHeap->iDLOnly;
-    aMeta.iLock                = &hybridHeap->iLock;
-    aMeta.iChunkSize           = hybridHeap->iChunkSize;
-    aMeta.iSlabThreshold       = hybridHeap->iSlabThreshold;
-    aMeta.iSlabInitThreshold   = hybridHeap->iSlabInitThreshold;
-    aMeta.iSlabConfigBits      = hybridHeap->iSlabConfigBits;
-    aMeta.iPartialPage         = hybridHeap->iPartialPage;
-    aMeta.iFullSlab            = hybridHeap->iFullSlab;
-    aMeta.iSparePage           = hybridHeap->iSparePage;
-    aMeta.iMemBase             = hybridHeap->iMemBase;
-
-    TInt i;
-    TInt count;
-    count = sizeof(aMeta.iSizeMap)/sizeof(unsigned char);
-    for (i=0; i<count; ++i)
-        {
-        aMeta.iSizeMap[i] = hybridHeap->iSizeMap[i];
-        }
-    count = sizeof(aMeta.iSlabAlloc)/sizeof(slabset);
-    for (i=0; i<count; ++i)
-        {
-        aMeta.iSlabAlloc[i].iPartial = hybridHeap->iSlabAlloc[i].iPartial;
-        aMeta.iSlabAllocRealRootAddress[i] = &hybridHeap->iSlabAlloc[i].iPartial;
-        }
-}
-
-LOCAL_C void GetMeta(RHeap& aHeap, TMetaData& aMeta)
-{
-    TestHybridHeap::GetHeapMetaData(aHeap, aMeta);
-}
-
-class TestRHeap : public RHeap
-	{
-public:
-	void InitTests();
-	void Test1(void);
-	void Test2(void);
-	void Test3(void);
-	void CloseTests();
-	TUint GetRandomSize(TUint aMaxSize);
-	TUint GetRandomIndex(TUint aMaxIndex);
-	static void WalkCallback(TAny* aPtr, TCellType aType, TAny* aCell, TInt aLen);
-	TBool CheckWalkArrayEmpty();
-			
-private:
-	RHybridHeap* iHybridHeap;
-	RHeap *iHeap;
-	TUint8* iMemBase;			     // bottom of Paged/Slab memory (chunk base)
-	static TUint iWalkArraySize;
-	static TUint iWalkArrayIndex;
-	static TAny** iWalkArrayOfCells;
-	TUint iAllocatedArrayIndex;
-	TAny** iAllocatedArrayOfCells;
-	};
-
-TUint TestRHeap::iWalkArraySize = 100;
-TUint TestRHeap::iWalkArrayIndex = 0;
-TAny** TestRHeap::iWalkArrayOfCells = new TAny*[iWalkArraySize];
-
-void TestRHeap::InitTests()
-{
-    // Allocate a chunk heap
-	TPtrC testHeap=_L("TESTHEAP");
-	iHeap=User::ChunkHeap(&testHeap,0x1800,0x800000); 
-	RHybridHeap::STestCommand cmd;
-	cmd.iCommand = RHybridHeap::EHeapMetaData;
-	iHeap->DebugFunction(RHeap::EHybridHeap, &cmd, 0);
-	iHybridHeap = (RHybridHeap*) cmd.iData;
-	iMemBase = TestHybridHeap::MemBase(iHybridHeap);
-	
-	// configure paged heap threshold 16 kB
-	cmd.iCommand = RHybridHeap::ESetConfig;
-	cmd.iConfig.iSlabBits = 0x0; //0xabe
-	cmd.iConfig.iDelayedSlabThreshold = 0x40000000;
-	cmd.iConfig.iPagePower = 14;
-	test(iHeap->DebugFunction(RHeap::EHybridHeap, &cmd, 0) == KErrNone);
-}
-
-
-TUint TestRHeap::GetRandomSize(TUint aMaxSize)
-{
-	TUint size = 0;
-	do
-	{
-		size = Math::Random() & aMaxSize;
-	}
-	while(size < 16384 ||  size > aMaxSize );
-	// subtract debug header size	
-	return size - 8;	
-}
-
-
-TUint TestRHeap::GetRandomIndex(TUint aMaxIndex)
-{
-	TUint index = 0;
-	do
-	    {
-        index = Math::Random() & 0x7F;
-	    }
-    while(index >= aMaxIndex || iWalkArrayOfCells[index] == 0);
-
-	return index;
-}
-
-
-void TestRHeap::WalkCallback(TAny* aPtr, TCellType aCellType, TAny* aBuffer, TInt aLen)
-{
-    if (aLen>16375 && aPtr>0)    // Don't test DL allocator
-        test(aCellType == EGoodAllocatedCell);
-    
-	TUint i = 0;
-	for(i=0; i<iWalkArrayIndex; i++)
-	{
-		if(iWalkArrayOfCells[i] == aBuffer)
-		{
-			iWalkArrayOfCells[i] = NULL;
-			break;
-		}
-	}
-}
-
-TBool TestRHeap::CheckWalkArrayEmpty()
-{
-	TUint i = 0;
-	for(i=0; i<iWalkArrayIndex; i++)
-	{
-		if(iWalkArrayOfCells[i])
-		{
-			return EFalse;
-		}
-	}
-	return ETrue;
-}
-
-
-///////////////////////////////////////////////////////////
-// Test page allocation with various sizes, 16 kB - 8 MB //
-// Simple test with fixed sizes.                         //
-///////////////////////////////////////////////////////////
-void TestRHeap::Test1(void)
-{
-	// Allocate and free single paged buffers of different size
-	// Small buffer
-	TAny* p1 = NULL;
-	p1=iHeap->Alloc(0x4000);
-	test(p1 != NULL && p1 >= iMemBase && p1 < iHybridHeap);
-	test(iHeap->Count() == 1);
-	iHeap->Free(p1);
-	p1 = NULL;
-	test(iHeap->Count() == 0);
-
-	// Medium buffer
-	p1=iHeap->Alloc(0x20000);
-	test(p1 != NULL && p1 >= iMemBase && p1 < iHybridHeap);
-	test(iHeap->Count() == 1);
-	iHeap->Free(p1);
-	p1 = NULL;
-	test(iHeap->Count() == 0);
-	
-	// Large buffer
-	p1=iHeap->Alloc(0x700000);
-	test(p1 != NULL && p1 >= iMemBase && p1 < iHybridHeap);
-	test(iHeap->Count() == 1);
-	iHeap->Free(p1);
-	p1 = NULL;
-	test(iHeap->Count() == 0);
-
-	// Oversized buffer, not allocated
-	p1=iHeap->Alloc(0x900000);
-	test(p1 == NULL);
-	test(iHeap->Count() == 0);
-}
-
-
-///////////////////////////////////////////////////////////////////////////
-// Allocate and free multiple random sized buffers, sizes under 65 kB.   //
-// Check that all are allocated succesfully with Count. Free every other //
-// of them, check the Count. Allocate more buffers sized under 655 kB    //
-// and free all buffers in reverse order. Check all are freed.           //
-///////////////////////////////////////////////////////////////////////////
-void TestRHeap::Test2(void)
-{
-    TInt ArraySize=10;
-	TInt ArrayIndex;
-	TAny** ArrayOfCells;
-	ArrayOfCells = new TAny*[ArraySize];
-
-	// Allocate set of buffers
-	for(ArrayIndex=0; ArrayIndex<ArraySize; ArrayIndex++)
-	{
-		ArrayOfCells[ArrayIndex] = 0;
-		ArrayOfCells[ArrayIndex] = iHeap->Alloc(GetRandomSize(0xFFFF));
-		test(ArrayOfCells[ArrayIndex] != NULL);
-	}
-	test(iHeap->Count() == 10);
-
-	// Free every other
-	for(ArrayIndex=0; ArrayIndex<ArraySize; ArrayIndex=ArrayIndex+2 )
-	{
-		iHeap->Free(ArrayOfCells[ArrayIndex]);
-		ArrayOfCells[ArrayIndex] = 0;
-	}
-	test(iHeap->Count() == 5);
-	
-	TInt ArraySize2=10;
-	TInt ArrayIndex2;
-	TAny** ArrayOfCells2;
-	ArrayOfCells2 = new TAny*[ArraySize2];
-
-	// Allocate larger buffers
-	for(ArrayIndex2=0; ArrayIndex2<ArraySize; ArrayIndex2++)
-	{
-		ArrayOfCells2[ArrayIndex2] = 0;
-		ArrayOfCells2[ArrayIndex2] = iHeap->Alloc(GetRandomSize(0x7FFFF));
-		test(ArrayOfCells2[ArrayIndex2] != NULL);
-	}
-	test(iHeap->Count() == 15);
-
-	// Free all buffers in reverse order
-	for(ArrayIndex=9; ArrayIndex>=0; ArrayIndex-- )
-	{
-		if(ArrayOfCells[ArrayIndex] != 0)
-		{
-			iHeap->Free(ArrayOfCells[ArrayIndex]);
-			ArrayOfCells[ArrayIndex] = 0;
-		}
-	}
-	for(ArrayIndex2=9; ArrayIndex2>=0; ArrayIndex2-- )
-	{
-		if(ArrayOfCells2[ArrayIndex2] != 0)
-		{
-			iHeap->Free(ArrayOfCells2[ArrayIndex2]);
-			ArrayOfCells2[ArrayIndex2] = 0;
-		}
-	}
-	test(iHeap->Count() == 0);
-}
-
-
-///////////////////////////////////////////////////////////////////////
-// Allocate and free multiple random sized buffers. Use              // 
-// DebugFunction(EWalk) to check that all allocated cells are found. //
-///////////////////////////////////////////////////////////////////////
-void TestRHeap::Test3(void)
-{
-    TUint iAllocatedArraySize = 100;
-    iAllocatedArrayOfCells = new TAny*[iAllocatedArraySize];
-    
-    // allocate 100 random cells and save them in iAllocatedArrayOfCells
-    for(iAllocatedArrayIndex=0; iAllocatedArrayIndex<iAllocatedArraySize; iAllocatedArrayIndex++)
-    {
-        iAllocatedArrayOfCells[iAllocatedArrayIndex] = 0;
-        iAllocatedArrayOfCells[iAllocatedArrayIndex] = iHeap->Alloc(GetRandomSize(0xFFFF));
-        test(iAllocatedArrayOfCells[iAllocatedArrayIndex] != NULL);
-    }
-    test(iHeap->Count() == 100);    //check that all 100 allocations have succeedeed
-	
-    // copy iAllocatedArrayOfCells => iWalkArrayOfCells
-    iWalkArrayOfCells = new TAny*[iWalkArrayIndex];
-    for(iWalkArrayIndex=0; iWalkArrayIndex<iWalkArraySize; iWalkArrayIndex++)
-        {
-            iWalkArrayOfCells[iWalkArrayIndex] = 0;
-            iWalkArrayOfCells[iWalkArrayIndex] = iAllocatedArrayOfCells[iWalkArrayIndex];
-            test(iWalkArrayOfCells[iWalkArrayIndex] == iAllocatedArrayOfCells[iWalkArrayIndex]);
-        }
-    
-    //check that walk finds all allocated cells...
-        iHeap->DebugFunction(EWalk, (TAny*)&WalkCallback, (TAny*)this);  
-        TBool ret = CheckWalkArrayEmpty();
-        test(ret);     // ...and iWalkArrayOfCells is emptied
-        
-	// copy iAllocatedArrayOfCells => iWalkArrayOfCells
-	    iWalkArrayOfCells = new TAny*[iWalkArrayIndex];
-	    for(iWalkArrayIndex=0; iWalkArrayIndex<iWalkArraySize; iWalkArrayIndex++)
-	        {
-	            iWalkArrayOfCells[iWalkArrayIndex] = 0;
-	            iWalkArrayOfCells[iWalkArrayIndex] = iAllocatedArrayOfCells[iWalkArrayIndex];
-	            test(iWalkArrayOfCells[iWalkArrayIndex] == iAllocatedArrayOfCells[iWalkArrayIndex]);
-	        }
-	
-	// free 40 random cells from iWalkArrayOfCells
-	TUint i;
-	for (i=0; i<40; i++)
-	    {
-        TUint RandomIndex = GetRandomIndex(99);
-        iHeap->Free(iWalkArrayOfCells[RandomIndex]);
-        iWalkArrayOfCells[RandomIndex] = 0;
-        iAllocatedArrayOfCells[RandomIndex] = 0;
-	    }
-	test(iHeap->Count() == 60);
-	
-	//check that walk finds all the remaining allocated cells...
-	iHeap->DebugFunction(EWalk, (TAny*)&WalkCallback, (TAny*)this);  
-	ret = CheckWalkArrayEmpty();
-	test(ret);     // ...and iWalkArrayOfCells is emptied
-	
-	// allocate 20 more random cells starting on the first available free cell
-	iAllocatedArrayIndex = 0;
-	for (i=0; i<20; i++)
-	    {
-        while (iAllocatedArrayOfCells[iAllocatedArrayIndex] != 0)
-            {
-            iAllocatedArrayIndex++;
-            }
-        iAllocatedArrayOfCells[iAllocatedArrayIndex] = iHeap->Alloc(GetRandomSize(0xFFFF));
-	    }
-	test(iHeap->Count() == 80);
-	
-	// copy iAllocatedArrayOfCells => iWalkArrayOfCells
-	iWalkArrayOfCells = new TAny*[iWalkArrayIndex];
-	    for(iWalkArrayIndex=0; iWalkArrayIndex<iWalkArraySize; iWalkArrayIndex++)
-	        {
-	            iWalkArrayOfCells[iWalkArrayIndex] = 0;
-	            iWalkArrayOfCells[iWalkArrayIndex] = iAllocatedArrayOfCells[iWalkArrayIndex];
-	            test(iWalkArrayOfCells[iWalkArrayIndex] == iAllocatedArrayOfCells[iWalkArrayIndex]);
-	        }
-	
-	//check that walk finds all the earlier and newly allocated cells...
-	iHeap->DebugFunction(EWalk, (TAny*)&WalkCallback, (TAny*)this);  
-	ret = CheckWalkArrayEmpty();
-	test(ret);     // ...and iWalkArrayOfCells is emptied
-}
-
-	
-void TestRHeap::CloseTests()
-	{
-		// close heap so we don't exceed chunk limit
-		iHeap->Close();  
-	}
-
-	
-GLDEF_C TInt E32Main(void)
-	{
-	test.Title();
-	__KHEAP_MARK;
-	
-	TestRHeap T;
-	
-	test.Start(_L("Page Allocator Test"));
-		    
-	TPtrC testHeapM=_L("TESTHEAP-MAIN");
-    RHeap* iHeapM;
-
-	iHeapM=User::ChunkHeap(&testHeapM,0x1800,0x800000); 
-	
-    TMetaData metaData;
-    GetMeta(*iHeapM, metaData);
-
-    iHeapM->Close();
-    
-    if (metaData.iDLOnly)
-        {
-        test.Printf(_L("Page allocator is not used, no tests to run.\n"));
-        __KHEAP_MARKEND;
-        test.End();
-        return(0);
-        }
-    
-    test.Next(_L("Init Paged allocator tests"));
-    T.InitTests();
-	test.Next(_L("Test Paged allocator 1"));
-	T.Test1();
-	test.Next(_L("Test Paged allocator 2"));
-	T.Test2();
-	test.Next(_L("Test Paged allocator 3"));
-	T.Test3();
-	T.CloseTests();
-
-	__KHEAP_CHECK(0);
-	__KHEAP_MARKEND;
-	
-	test.End();
-	
-	return (0);    
-    }
--- a/kerneltest/e32test/heap/t_heapslab.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1056 +0,0 @@
-// Copyright (c) 1995-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\heap\t_heapslab.cpp
-// Overview:
-// Tests RHybridHeap class: slab allocator
-// API Information:
-// RHybridHeap/RHeap
-// Details:
-//- Starts with empty allocator configured to use slab allocation
-//  on all cell sizes less than slab threshold (49).
-//- Allocate enough cells of the same size to fill 128 slabs.
-//- Check the number of pages used corresponds to the number of slabs.
-//- Check that a new slab is taken from a partially filled page if available.
-//- Check that a partially filled slab is used if available.
-//- Check that if all four slabs in a page are free, the page is freed.
-//- Free cells to give empty slab.
-//- Free cells to give partial slab.
-//- Reallocate cells.
-//- RAllocator::Check() is used to check internal consistency.
-// Platforms/Drives/Compatibility:
-// All
-// Assumptions/Requirement/Pre-requisites:
-// Failures and causes:
-// Base Port information:
-// 
-//
-
-#include <e32test.h>
-#include <e32hal.h>
-#include <e32def.h>
-#include <e32def_private.h>
-#include "dla.h"
-#include "slab.h"
-#include "page_alloc.h"
-#include "heap_hybrid.h"
-
-#define MAX_THREADS 4
-#define MAX_ALLOCS 20000 // 16128, if slab count is 128 and alloc size is 8
-
-//#define TSTSLAB_DBG(a) a
-#define TSTSLAB_DBG(a)
-
-struct TSlabTestThreadParm
-    {
-    RHeap*  iHeap;
-    TInt    iAllocSize;
-    TInt    iInitSlabCount;
-    TBool   iUseRandomSize;
-    TInt    iThreadCount;
-    TInt    iThreadIndex;
-    };
-
-struct TMetaData
-    {
-    TBool           iDLOnly;
-    RFastLock*      iLock;
-    TInt            iChunkSize;
-    TInt            iSlabThreshold;
-    unsigned        iSlabInitThreshold;
-    unsigned        iSlabConfigBits;
-    slab*           iPartialPage;
-    slab*           iFullSlab;
-    page*           iSparePage;
-    TUint8*         iMemBase;
-    unsigned char   iSizeMap[(MAXSLABSIZE>>2)+1];
-    slabset         iSlabAlloc[MAXSLABSIZE>>2];
-    slab**          iSlabAllocRealRootAddress[MAXSLABSIZE>>2];
-    };
-
-class TestHybridHeap
-    {
-public:
-    static void GetHeapMetaData(RHeap& aHeap, TMetaData& aMeta);
-    };
-
-LOCAL_D RTest test(_L("T_HEAPSLAB"));
-
-LOCAL_D TInt PageSize;
-
-LOCAL_D TAny* PtrBuf[MAX_THREADS][MAX_ALLOCS];
-LOCAL_D TSlabTestThreadParm ThreadParm[MAX_THREADS];
-
-enum TTestWalkFunc {ETestWalk, ETestFindSlab};
-
-
-static unsigned SlabHeaderPagemap(unsigned h) {return (h&0x00000f00)>>8;}
-
-void TestHybridHeap::GetHeapMetaData(RHeap& aHeap, TMetaData& aMeta)
-{
-    RHybridHeap::STestCommand cmd;
-    cmd.iCommand = RHybridHeap::EHeapMetaData;
-    TInt ret = aHeap.DebugFunction(RHeap::EHybridHeap, &cmd, 0);
-    test(ret == KErrNone);
-    
-    RHybridHeap* hybridHeap = (RHybridHeap*) cmd.iData;
-    
-    aMeta.iDLOnly              = hybridHeap->iDLOnly;
-    aMeta.iLock                = &hybridHeap->iLock;
-    aMeta.iChunkSize           = hybridHeap->iChunkSize;
-    aMeta.iSlabThreshold       = hybridHeap->iSlabThreshold;
-    aMeta.iSlabInitThreshold   = hybridHeap->iSlabInitThreshold;
-    aMeta.iSlabConfigBits      = hybridHeap->iSlabConfigBits;
-    aMeta.iPartialPage         = hybridHeap->iPartialPage;
-    aMeta.iFullSlab            = hybridHeap->iFullSlab;
-    aMeta.iSparePage           = hybridHeap->iSparePage;
-    aMeta.iMemBase             = hybridHeap->iMemBase;
-
-    TInt i;
-    TInt count;
-    count = sizeof(aMeta.iSizeMap)/sizeof(unsigned char);
-    for (i=0; i<count; ++i)
-        {
-        aMeta.iSizeMap[i] = hybridHeap->iSizeMap[i];
-        }
-    count = sizeof(aMeta.iSlabAlloc)/sizeof(slabset);
-    for (i=0; i<count; ++i)
-        {
-        aMeta.iSlabAlloc[i].iPartial = hybridHeap->iSlabAlloc[i].iPartial;
-        aMeta.iSlabAllocRealRootAddress[i] = &hybridHeap->iSlabAlloc[i].iPartial;
-        }
-}
-
-LOCAL_C void GetMeta(RHeap& aHeap, TMetaData& aMeta)
-{
-    TestHybridHeap::GetHeapMetaData(aHeap, aMeta);
-}
-
-/*LOCAL_C void PrintMeta(const char* aText, TMetaData& aMeta)
-{
-    RDebug::Printf("=========== HeapMetaData (local) - begin: %s", aText);
-
-    RDebug::Printf("iDLOnly: 0x%08x", aMeta.iDLOnly);
-    RDebug::Printf("iChunkSize: 0x%08x", aMeta.iChunkSize);
-    RDebug::Printf("iSlabThreshold: 0x%08x / %d", aMeta.iSlabThreshold, aMeta.iSlabThreshold);
-    RDebug::Printf("iSlabInitThreshold: 0x%08x / %d", aMeta.iSlabInitThreshold, aMeta.iSlabInitThreshold);
-    RDebug::Printf("iSlabConfigBits: 0x%08x", aMeta.iSlabConfigBits);
-    RDebug::Printf("iPartialPage: 0x%08x", aMeta.iPartialPage);
-    RDebug::Printf("iFullSlab: 0x%08x", aMeta.iFullSlab);
-    RDebug::Printf("iSparePage: 0x%08x", aMeta.iSparePage);
-    RDebug::Printf("iMemBase: 0x%08x", aMeta.iMemBase);
-
-    TInt i;
-    TInt count;
-    count = sizeof(aMeta.iSizeMap)/sizeof(unsigned char);
-    for (i=0; i<count; ++i)
-        {
-        RDebug::Printf("iSizeMap[%d]: %d", i, aMeta.iSizeMap[i]);
-        }
-    count = sizeof(aMeta.iSlabAlloc)/sizeof(slabset);
-    for (i=0; i<count; ++i)
-        {
-        RDebug::Printf("iSlabAlloc[%d].iPartial: 0x%08x", i, aMeta.iSlabAlloc[i].iPartial);
-        }
-    for (i=0; i<count; ++i)
-        {
-        RDebug::Printf("iSlabAllocRealRootAddress[%d]: 0x%08x", i, aMeta.iSlabAllocRealRootAddress[i]);
-        }
-    RDebug::Printf("=========== HeapMetaData (local) - end");
-}
-
-LOCAL_C void GetAndPrintMeta(RHeap& aHeap, const char* aText, TMetaData& aMeta)
-{
-    (void)aText;
-    GetMeta(aHeap, aMeta);
-    TSTSLAB_DBG(PrintMeta(aText, aMeta));
-}
-
-#ifndef __KERNEL_MODE__
-LOCAL_C void Lock(TMetaData& aMeta)
-   {((RFastLock&)*aMeta.iLock).Wait();}
-
-LOCAL_C void Unlock(TMetaData& aMeta)
-   {((RFastLock&)*aMeta.iLock).Signal();}
-#else
-LOCAL_C void Lock(TMetaData& aMeta)
-   {;}
-
-LOCAL_C void Unlock(TMetaData& aMeta)
-   {;}
-#endif
-*/
-
-LOCAL_C  page* PageFor(slab* s)
-    {
-        return reinterpret_cast<page*>(Floor(s, PAGESIZE));
-    }
-
-   
-LOCAL_C slab* SlabFor(const void* p)
-{
-    return (slab*)(Floor(p, SLABSIZE));
-}
-
-LOCAL_C TInt TreeWalk(slab** aRealRootAddress, slab* const* aRoot, TTestWalkFunc aFunc, TAny* aParm, TInt& aOutParm)
-{
-    TInt count = 0;
-    aOutParm = 0;
-    
-    slab* s = *aRoot;
-    if (!s)
-        return count;
-    
-    for (;;)
-        {
-        slab* c;
-        while ((c = s->iChild1) != 0)
-            s = c;      // walk down left side to end
-        for (;;)
-            {
-            count++;
-            TSTSLAB_DBG(RDebug::Printf("TreeWalk - slab: 0x%08x", s));
-            (void)aParm;
-            if (aFunc == ETestWalk)
-                {
-                ;
-                }
-            else if (aFunc == ETestFindSlab)
-                {
-                if ((slab*)aParm == s)
-                    {
-                    aOutParm = 1;
-                    return 0;
-                    }
-                }
-            
-            c = s->iChild2;
-            if (c)
-                {   // one step down right side, now try and walk down left
-                s = c;
-                break;
-                }
-            for (;;)
-                {   // loop to walk up right side
-                slab** pp = s->iParent;
-                if (pp == aRealRootAddress)
-                    return count;
-                s = SlabFor(pp);
-                if (pp == &s->iChild1)
-                    break;
-                }
-            }
-        }
-}
-
-LOCAL_C TInt WalkSlabSet(TInt aSlabsetIndex, TMetaData& aMeta, TTestWalkFunc aFunc, TAny* aParm, TInt& aOutParm)
-{
-    if (aSlabsetIndex >= (MAXSLABSIZE>>2))
-        {
-        return 0;
-        }
-    return TreeWalk(aMeta.iSlabAllocRealRootAddress[aSlabsetIndex], &aMeta.iSlabAlloc[aSlabsetIndex].iPartial, aFunc, aParm, aOutParm);
-}
-
-/*LOCAL_C void DebugPrintSlabs(TInt aSlabsetIndex, TMetaData& aMeta)
-    {
-    //RDebug::Printf("=========== DebugPrintSlabs: %s", aText);
-    RDebug::Printf("=========== DebugPrintSlabs");
-
-    RDebug::Printf("iSparePage: 0x%08x", aMeta.iSparePage);
-    
-    slab* fullSlab = aMeta.iFullSlab;
-    TInt fullSlabCount = 0;
-    while (fullSlab)
-        {
-        RDebug::Printf("fullSlab: 0x%08x", fullSlab);
-        fullSlabCount++;
-        fullSlab = fullSlab->iChild1;
-        }
-
-    TInt outParm;
-    TInt partialTreeSlabCount = 0;
-    partialTreeSlabCount += WalkSlabSet(aSlabsetIndex, aMeta, ETestWalk, 0, outParm);
-
-    slab* partialPageSlab = aMeta.iPartialPage;
-    TInt partialPageSlabCount = 0;
-    while (partialPageSlab)
-        {
-        RDebug::Printf("partialPageSlab (empty): 0x%08x", partialPageSlab);
-        partialPageSlabCount++;
-        partialPageSlab = partialPageSlab->iChild1;
-        }
-    }*/
-
-LOCAL_C void TestSlabFixedSizeManyThreads(TSlabTestThreadParm& aParm)
-    {
-    RHeap* heap = aParm.iHeap;
-    TInt allocSize = aParm.iAllocSize;
-    TInt initSlabCount = aParm.iInitSlabCount;
-    //TBool useRandomSize = aParm.iUseRandomSize;
-    //TInt threadCount = aParm.iThreadCount;
-    TInt threadIndex = aParm.iThreadIndex;
-
-    TInt slabsPerPage = PageSize/SLABSIZE;
-
-    test(initSlabCount % slabsPerPage == 0); // for this test
-    
-#ifdef _DEBUG
-    TInt allocRealCellSize = allocSize + RHeap::EDebugHdrSize;
-#else
-    TInt allocRealCellSize = allocSize;
-#endif
-
-    TMetaData metaData;
-    GetMeta(*heap, metaData);
-    
-    if (allocRealCellSize >= metaData.iSlabThreshold)
-        {
-        allocRealCellSize = metaData.iSlabThreshold - 1;
-#ifdef _DEBUG
-        allocSize = allocRealCellSize - RHeap::EDebugHdrSize;
-#else
-        allocSize = allocRealCellSize;
-#endif
-        }
-    
-    TAny** pBuf = &PtrBuf[threadIndex][0];
-    TInt i;
-    for (i=0; i<MAX_ALLOCS; ++i)
-        {
-        pBuf[i] = 0;
-        }
-
-    //Allocate enough cells of the same size to fill initSlabCount (128) slabs
-    TInt slabsetIndex = metaData.iSizeMap[(allocRealCellSize+3)>>2];
-    test(slabsetIndex != 0xff);
-    TInt slabCellSize = 4 + (slabsetIndex * 4);
-    
-    TInt slabPayloadSize = SLABSIZE - sizeof(slabhdr);
-    TInt cellCountPerSlab = slabPayloadSize / slabCellSize;
-    TInt initCellCount = initSlabCount * cellCountPerSlab;
-
-    TSTSLAB_DBG(RDebug::Printf("=========== Allocate enough cells of the same size to fill %d slabs", initSlabCount));
-    TSTSLAB_DBG(RDebug::Printf("=========== counts: %d %d %d", cellCountPerSlab, initCellCount, slabCellSize));
-
-    for (i=0; i<initCellCount; ++i)
-        {
-        pBuf[i] = heap->Alloc(allocSize);
-        test(pBuf[i] != 0);
-        }
-
-    heap->Check();
-
-    TInt maxI5 = initCellCount + (cellCountPerSlab*(slabsPerPage+1));
-    for (i=initCellCount; i<maxI5; ++i)
-        {
-        pBuf[i] = heap->Alloc(allocSize);
-        test(pBuf[i] != 0);
-        }
-
-    heap->Check();
-    
-    TAny* p2 = heap->Alloc(allocSize);
-    test(p2 != 0);
-
-    heap->Check();
-    heap->Free(p2);
-
-    heap->Check();
-    
-
-    TInt page2pBufIndexFirst = cellCountPerSlab * slabsPerPage;
-    //TInt page2pBufIndexLast = page2pBufIndexFirst + (cellCountPerSlab * slabsPerPage);
-    
-    slab* partialTreeSlabX1 = SlabFor(pBuf[page2pBufIndexFirst]);
-    page* partialTreeSlabPageX1 = PageFor(partialTreeSlabX1);
-    
-    heap->Free(pBuf[page2pBufIndexFirst]);
-    pBuf[page2pBufIndexFirst] = 0;
-
-    heap->Check();
-    
-    TAny* p3 = heap->Alloc(allocSize);
-    test(p3 != 0);
-    heap->Check();
-    heap->Free(p3);
-    heap->Check();
-    
-    TInt size2 = metaData.iChunkSize;
-    TSTSLAB_DBG(RDebug::Printf("---- size2: 0x%08x", size2));
-    if (metaData.iSparePage)
-        {
-        size2 -= PageSize;
-        }
-
-    for (i=0; i<MAX_ALLOCS; ++i)
-        {
-        if (pBuf[i]) {
-            page* page1 = PageFor(SlabFor(pBuf[i]));
-            if (partialTreeSlabPageX1 == page1)
-                {
-                heap->Free(pBuf[i]);
-                pBuf[i] = 0;
-                }
-            }
-        }
-
-    heap->Check();
-
-    TInt size3 = metaData.iChunkSize;
-    if (metaData.iSparePage)
-        {
-        size3 -= PageSize;
-        }
-
-    TInt bufIndexFirst = cellCountPerSlab;
-    TInt maxI = bufIndexFirst + cellCountPerSlab;
-    for (i=bufIndexFirst; i<=maxI; ++i)
-        {
-        if (pBuf[i])
-            {
-            heap->Free(pBuf[i]);
-            pBuf[i] = 0;
-            }
-        }
-
-    heap->Check();
-
-    TInt firstI = cellCountPerSlab * 3;
-    maxI = firstI + cellCountPerSlab;
-    for (i=firstI; i<=maxI; ++i)
-        {
-        if (i % 3 == 0)
-            {
-            if (pBuf[i])
-                {
-                heap->Free(pBuf[i]);
-                pBuf[i] = 0;
-                }
-            }
-        }
-    
-    heap->Check();
-    
-    //Reallocate cells.
-    for (i=0; i<(MAX_ALLOCS); ++i)
-        {
-        if (pBuf[i] != 0)
-            {
-            pBuf[i] = heap->ReAlloc(pBuf[i], allocSize);
-            test(pBuf[i] != 0);
-            }
-        }
-    
-    heap->Check();
-    
-    //Allocate cells.
-    for (i=0; i<(MAX_ALLOCS/4); ++i)
-        {
-        if (pBuf[i] == 0)
-            {
-            pBuf[i] = heap->Alloc(allocSize);
-            test(pBuf[i] != 0);
-            }
-        }
-
-    heap->Check();
-    
-    for (i=0; i<MAX_ALLOCS; ++i)
-        {
-        if (pBuf[i])
-            {
-            heap->Free(pBuf[i]);
-            pBuf[i] = 0;
-            }
-        }
-    heap->Check();
-
-    TSTSLAB_DBG(RDebug::Printf("=========== TestSlabFixedSizeManyThreads end"));
-    }
-    
-    
-LOCAL_C void TestSlabFixedSizeOneThread(TSlabTestThreadParm& aParm)
-    {
-    RHeap* heap = aParm.iHeap;
-    TInt allocSize = aParm.iAllocSize;
-    TInt initSlabCount = aParm.iInitSlabCount;
-    //TBool useRandomSize = aParm.iUseRandomSize;
-    //TInt threadCount = aParm.iThreadCount;
-    TInt threadIndex = aParm.iThreadIndex;
-
-    TInt slabsPerPage = PageSize/SLABSIZE;
-
-    test(initSlabCount % slabsPerPage == 0); // for this test
-    
-#ifdef _DEBUG
-    TInt allocRealCellSize = allocSize + RHeap::EDebugHdrSize;
-#else
-    TInt allocRealCellSize = allocSize;
-#endif
-
-    TMetaData metaData;
-    GetMeta(*heap, metaData);
-    
-    TSTSLAB_DBG(PrintMeta(" --- TestSlabFixedSizeOneThread start", metaData));
-
-    if (allocRealCellSize >= metaData.iSlabThreshold)
-        {
-        allocRealCellSize = metaData.iSlabThreshold - 1;
-#ifdef _DEBUG
-        allocSize = allocRealCellSize - RHeap::EDebugHdrSize;
-#else
-        allocSize = allocRealCellSize;
-#endif
-        }
-
-    TAny** pBuf = &PtrBuf[threadIndex][0];
-    TInt i;
-    for (i=0; i<MAX_ALLOCS; ++i)
-        {
-        pBuf[i] = 0;
-        }
-
-    //Allocate enough cells of the same size to fill initSlabCount (128) slabs
-    TInt slabsetIndex = metaData.iSizeMap[(allocRealCellSize+3)>>2];
-    test(slabsetIndex != 0xff);
-    TInt slabCellSize = 4 + (slabsetIndex * 4);
-    
-    TInt slabPayloadSize = SLABSIZE - sizeof(slabhdr);
-    TInt cellCountPerSlab = slabPayloadSize / slabCellSize;
-    TInt initCellCount = initSlabCount * cellCountPerSlab;
-
-    TSTSLAB_DBG(RDebug::Printf("=========== Allocate enough cells of the same size to fill %d slabs", initSlabCount));
-    TSTSLAB_DBG(RDebug::Printf("=========== counts: %d %d %d", cellCountPerSlab, initCellCount, slabCellSize));
-
-    for (i=0; i<initCellCount; ++i)
-        {
-        pBuf[i] = heap->Alloc(allocSize);
-        test(pBuf[i] != 0);
-        }
-
-    heap->Check();
-    GetMeta(*heap, metaData);
-    
-    TSTSLAB_DBG(PrintMeta("after init allocs", metaData));
-    TSTSLAB_DBG(DebugPrintSlabs(slabsetIndex, metaData));
-
-    //Check the number of pages used corresponds to the number of slabs.
-    TSTSLAB_DBG(RDebug::Printf("=========== Check the number of pages used corresponds to the number of slabs"));
-    
-    TInt pageCountForSlabs1 = (metaData.iChunkSize / PageSize) - 1;
-    TInt pageCountForSlabs2 = (initSlabCount+(slabsPerPage-1)) / slabsPerPage;
-    TSTSLAB_DBG(RDebug::Printf("=========== page counts: %d %d", pageCountForSlabs1, pageCountForSlabs2));
-    test(pageCountForSlabs1 == pageCountForSlabs2);
-
-    //-----------------------------------------
-    TSTSLAB_DBG(RDebug::Printf("=========== check slab counts in the lists"));
-    
-    slab* fullSlab = metaData.iFullSlab;
-    TInt fullSlabCount = 0;
-    while (fullSlab)
-        {
-        TSTSLAB_DBG(RDebug::Printf("fullSlab: 0x%08x", fullSlab));
-        fullSlabCount++;
-        fullSlab = fullSlab->iChild1;
-        }
-
-    TInt outParm;
-    TInt partialTreeSlabCount = 0;
-    partialTreeSlabCount = WalkSlabSet(slabsetIndex, metaData, ETestWalk, 0, outParm);
-
-    slab* partialPageSlab = metaData.iPartialPage;
-    TInt partialPageSlabCount = 0;
-    while (partialPageSlab)
-        {
-        TSTSLAB_DBG(RDebug::Printf("partialPageSlab (empty): 0x%08x", partialPageSlab));
-        partialPageSlabCount++;
-        partialPageSlab = partialPageSlab->iChild1;
-        }
-
-    test(fullSlabCount == (initSlabCount-1));
-    test(partialTreeSlabCount == 1);
-    if (initSlabCount % slabsPerPage == 0)
-        {
-        test(partialPageSlabCount == 0);
-        }
-    else
-        {
-        test(partialPageSlabCount == 1);
-        }
-    //-----------------------------------------
-    TSTSLAB_DBG(RDebug::Printf("=========== alloc one cell more -> one full slab more"));
-
-    TAny* p = heap->Alloc(allocSize);
-    test(p != 0);
-    
-    heap->Check();
-    GetMeta(*heap, metaData);
-    TSTSLAB_DBG(DebugPrintSlabs(slabsetIndex, metaData));
-    
-    fullSlab = metaData.iFullSlab;
-    fullSlabCount = 0;
-    while (fullSlab)
-        {
-        TSTSLAB_DBG(RDebug::Printf("fullSlab: 0x%08x", fullSlab));
-        fullSlabCount++;
-        fullSlab = fullSlab->iChild1;
-        }
-    test(fullSlabCount == initSlabCount);
-
-    heap->Free(p);
-
-    heap->Check();
-    GetMeta(*heap, metaData);
-    TSTSLAB_DBG(DebugPrintSlabs(slabsetIndex, metaData));
-    
-    //-----------------------------------------
-    //Check that a new slab is taken from a partially filled page if available.
-    TSTSLAB_DBG(RDebug::Printf("=========== Check that a new slab is taken from a partially filled page if available"));
-
-    // fill the first slab in the page (after iSparePage)
-    TInt maxI5 = initCellCount + (cellCountPerSlab*(slabsPerPage+1));
-    for (i=initCellCount; i<maxI5; ++i)
-        {
-        pBuf[i] = heap->Alloc(allocSize);
-        test(pBuf[i] != 0);
-        }
-
-    heap->Check();
-    GetMeta(*heap, metaData);
-    TSTSLAB_DBG(DebugPrintSlabs(slabsetIndex, metaData));
-    
-    partialPageSlab = metaData.iPartialPage;
-    partialPageSlabCount = 0;
-    while (partialPageSlab)
-        {
-        TSTSLAB_DBG(RDebug::Printf("partialPageSlab (empty): 0x%08x", partialPageSlab));
-        partialPageSlabCount++;
-        partialPageSlab = partialPageSlab->iChild1;
-        }
-    test(partialPageSlabCount == 1);
-
-    page* page1 = PageFor(metaData.iPartialPage);
-    unsigned header = page1->iSlabs[0].iHeader;
-    unsigned pagemap = SlabHeaderPagemap(header);
-    unsigned slabix = LOWBIT(pagemap);
-    slab* partialPageSlab2 = &page1->iSlabs[slabix];
-    
-    TAny* p2 = heap->Alloc(allocSize);
-    test(p2 != 0);
-
-    heap->Check();
-    TSTSLAB_DBG(RDebug::Printf("p2: 0x%08x; partialPageSlab2: 0x%08x", p2, partialPageSlab2));
-    test(partialPageSlab2 == SlabFor(p2));
-    heap->Free(p2);
-
-    heap->Check();
-    
-    //-----------------------------
-    // use the second page for the next test
-    TInt page2pBufIndexFirst = cellCountPerSlab * slabsPerPage;
-    //TInt page2pBufIndexLast = page2pBufIndexFirst + (cellCountPerSlab * slabsPerPage);
-    
-    //-----------------------------------------
-    //Check that a partially filled slab is used if available.
-    TSTSLAB_DBG(RDebug::Printf("=========== Check that a partially filled slab is used if available"));
-
-    slab* partialTreeSlabX1 = SlabFor(pBuf[page2pBufIndexFirst]);
-    page* partialTreeSlabPageX1 = PageFor(partialTreeSlabX1);
-    
-    heap->Free(pBuf[page2pBufIndexFirst]);
-    pBuf[page2pBufIndexFirst] = 0;
-
-    heap->Check();
-    
-    TAny* p3 = heap->Alloc(allocSize);
-    test(p3 != 0);
-    heap->Check();
-    test(partialTreeSlabX1 == SlabFor(p3));
-    heap->Free(p3);
-    heap->Check();
-    
-    //-----------------------------------------
-    //Check that if all four slabs in a page are free the page is freed.
-    TSTSLAB_DBG(RDebug::Printf("=========== Check that if all four slabs in a page are free, the page is freed"));
-
-    GetMeta(*heap, metaData);
-    TSTSLAB_DBG(DebugPrintSlabs(slabsetIndex, metaData));
-
-    TInt size2 = metaData.iChunkSize;
-    TSTSLAB_DBG(RDebug::Printf("---- size2: 0x%08x", size2));
-    if (metaData.iSparePage)
-        {
-        size2 -= PageSize;
-        }
-
-    for (i=0; i<MAX_ALLOCS; ++i)
-        {
-        if (pBuf[i]) {
-            page* page1 = PageFor(SlabFor(pBuf[i]));
-            if (partialTreeSlabPageX1 == page1)
-                {
-                heap->Free(pBuf[i]);
-                pBuf[i] = 0;
-                }
-            }
-        }
-
-    heap->Check();
-    GetMeta(*heap, metaData);
-    TSTSLAB_DBG(DebugPrintSlabs(slabsetIndex, metaData));
-
-    TInt size3 = metaData.iChunkSize;
-    if (metaData.iSparePage)
-        {
-        size3 -= PageSize;
-        }
-
-    test(size3 == (size2-PageSize));
-
-    //-----------------------------------------
-    //Free cells to give empty slab (The second slab in the first page)
-    TSTSLAB_DBG(RDebug::Printf("=========== Free cells to give empty slab (The second slab in the first page)"));
-    slab* emptySlabAddr = (slab*)(metaData.iMemBase + SLABSIZE);
-
-    //Check that emptySlabAddr is not already in iPartialPage list
-    partialPageSlab = metaData.iPartialPage;
-    while (partialPageSlab)
-        {
-        if (partialPageSlab == emptySlabAddr)
-            {
-            test(0);
-            }
-        partialPageSlab = partialPageSlab->iChild1;
-        }
-
-    // free cells to give empty slab  - emptySlabAddr
-    TInt bufIndexFirst = cellCountPerSlab;
-    TInt maxI = bufIndexFirst + cellCountPerSlab;
-    for (i=bufIndexFirst; i<=maxI; ++i)
-        {
-        if (pBuf[i])
-            {
-            heap->Free(pBuf[i]);
-            pBuf[i] = 0;
-            }
-        }
-
-    heap->Check();
-    GetMeta(*heap, metaData);
-    TSTSLAB_DBG(DebugPrintSlabs(slabsetIndex, metaData));
-
-    // Check that emptySlabAddr is not now in iPartialPage list
-    partialPageSlab = metaData.iPartialPage;
-    while (partialPageSlab)
-        {
-        if (partialPageSlab == emptySlabAddr)
-            {
-            break;
-            }
-        partialPageSlab = partialPageSlab->iChild1;
-        }
-    test(partialPageSlab != 0);
-
-    //Free cells to give partial slab (The third slab in the first page)
-    TSTSLAB_DBG(RDebug::Printf("=========== Free cells to give partial slab (The third slab in the first page)"));
-    slab* partialSlabAddr = (slab*)(metaData.iMemBase + (3*SLABSIZE));
-
-    // Check that partialSlabAddr is not now in iPartialSlab list
-    WalkSlabSet(slabsetIndex, metaData, ETestFindSlab, partialSlabAddr, outParm);
-    test(outParm == 0);
-
-    TInt firstI = cellCountPerSlab * 3;
-    maxI = firstI + cellCountPerSlab;
-    for (i=firstI; i<=maxI; ++i)
-        {
-        if (i % 3 == 0)
-            {
-            if (pBuf[i])
-                {
-                heap->Free(pBuf[i]);
-                pBuf[i] = 0;
-                }
-            }
-        }
-    
-    heap->Check();
-    GetMeta(*heap, metaData);
-    TSTSLAB_DBG(DebugPrintSlabs(slabsetIndex, metaData));
-    
-    // Check that partialSlabAddr is now in iPartialSlab list
-    WalkSlabSet(slabsetIndex, metaData, ETestFindSlab, partialSlabAddr, outParm);
-    test(outParm == 1);
-    
-    //Reallocate cells.
-    for (i=0; i<(MAX_ALLOCS); ++i)
-        {
-        if (pBuf[i] != 0)
-            {
-            pBuf[i] = heap->ReAlloc(pBuf[i], allocSize);
-            test(pBuf[i] != 0);
-            }
-        }
-
-    heap->Check();
-    
-    //Allocate cells.
-    for (i=0; i<(MAX_ALLOCS/4); ++i)
-        {
-        if (pBuf[i] == 0)
-            {
-            pBuf[i] = heap->Alloc(allocSize);
-            test(pBuf[i] != 0);
-            }
-        }
-
-    heap->Check();
-    
-    for (i=0; i<MAX_ALLOCS; ++i)
-        {
-        if (pBuf[i])
-            {
-            heap->Free(pBuf[i]);
-            pBuf[i] = 0;
-            }
-        }
-    heap->Check();
-
-    TSTSLAB_DBG(RDebug::Printf("=========== TestSlabFixedSizeOneThread end"));
-    }
-
-LOCAL_C RHeap* CreateSlabHeap(TInt aThreadCount)
-{
-    //TPtrC slabHeap=_L("SlabHeap");
-    //RHeap* heap = User::ChunkHeap(&slabHeap, 0x1000, 0x10000);
-    TInt maxLth = 0x60000 * aThreadCount;
-    RHeap* heap = User::ChunkHeap(0, 0x1000, maxLth);
-    test(heap!=NULL);
-
-    // Configure heap for slab
-    RHybridHeap::STestCommand cmd;
-    cmd.iCommand = RHybridHeap::ESetConfig;
-    cmd.iConfig.iSlabBits = 0xabe;
-    cmd.iConfig.iDelayedSlabThreshold = 0;
-    cmd.iConfig.iPagePower = 0;  // 16 // 0 -> no page allocator
-    TInt ret = heap->DebugFunction(RHeap::EHybridHeap, &cmd, 0);
-    test(ret == KErrNone);
-    
-    return heap;
-}
-
-LOCAL_C TInt SlabTestManyThreads(TAny* aThreadParm)
-    {
-    TSlabTestThreadParm* parm = (TSlabTestThreadParm*)aThreadParm;
-
-    TInt i;
-    TInt maxLoops = 30; //300;
-    for (i=0; i<maxLoops; ++i)
-        {
-        TestSlabFixedSizeManyThreads(*parm);
-        }
-                                
-    return KErrNone;
-    }
-    
-LOCAL_C TInt SlabTestOneThread(TAny* aThreadParm)
-    {
-    TSlabTestThreadParm* parm = (TSlabTestThreadParm*)aThreadParm;
-    TestSlabFixedSizeOneThread(*parm);
-    return KErrNone;
-    }
-    
-TInt StartThreads(TInt aThreadCount, TSlabTestThreadParm& aThreadParm)
-    {
-    const TInt KSlabTestThreadStackSize=0x4000; //0x10000; //0x2000;
-
-    TRequestStatus  theStatus[MAX_THREADS];
-    RThread         theThreads[MAX_THREADS];
-    TBool           threadInUse[MAX_THREADS];
-
-    TInt index;
-    TInt ret;
-
-    if (aThreadCount <= 0)
-        {
-        return KErrNone;
-        }
-
-    RHeap* heap = CreateSlabHeap(aThreadCount);
-    aThreadParm.iHeap = heap;
-    
-    for (index = 0; index < aThreadCount; index++)
-        {
-        ThreadParm[index].iHeap             = aThreadParm.iHeap;
-        ThreadParm[index].iAllocSize        = aThreadParm.iAllocSize;
-        ThreadParm[index].iInitSlabCount    = aThreadParm.iInitSlabCount;
-        ThreadParm[index].iUseRandomSize    = aThreadParm.iUseRandomSize;
-        ThreadParm[index].iThreadCount      = aThreadParm.iThreadCount;
-        
-        ThreadParm[index].iThreadIndex = index;
-        
-        TBuf<32> threadName;
-        threadName.Format(_L("SlabTest%d"), index);
-        if (aThreadCount == 1)
-            {
-            ret = theThreads[index].Create(threadName, SlabTestOneThread, KSlabTestThreadStackSize, NULL, (TAny*)&ThreadParm[index]);
-            }
-        else
-            {
-            ret = theThreads[index].Create(threadName, SlabTestManyThreads, KSlabTestThreadStackSize, NULL, (TAny*)&ThreadParm[index]);
-            }
-        test(ret == KErrNone);
-        theThreads[index].Logon(theStatus[index]);
-        test(theStatus[index] == KRequestPending);
-        threadInUse[index] = ETrue;
-        theThreads[index].Resume();
-        }
-
-    User::WaitForAnyRequest();
-    
-    TBool anyUsed = ETrue;
-    while (anyUsed)
-        {
-        User::After(1001000);
-        anyUsed = EFalse;
-        for (index = 0; index < aThreadCount; index++)
-            {
-            if (threadInUse[index])
-                {
-                if (theThreads[index].ExitType() != EExitPending)
-                    {
-                    threadInUse[index] = EFalse;
-                    }
-                else
-                    {
-                    anyUsed = ETrue;
-                    }
-                }
-            }
-        }
-    
-    for (index = 0; index < aThreadCount; index++)
-        {
-        theThreads[index].Close();
-        }
-    TSTSLAB_DBG(RDebug::Printf("=========== StartThreads end"));
-    heap->Close();
-
-    return KErrNone;
-    }
-
-GLDEF_C TInt E32Main(void)
-    {
-    TInt ret;
-    
-    test.Title();
-
-    __KHEAP_MARK;
-    
-    test.Start(_L("TestSlab"));
-    UserHal::PageSizeInBytes(PageSize);
-
-    RHeap* heap = CreateSlabHeap(1);
-    
-    TMetaData metaData;
-    GetMeta(*heap, metaData);
-
-    heap->Close();
-
-    if (metaData.iDLOnly)
-        {
-        test.Printf(_L("Slab allocator is not used, no tests to run\n"));
-        __KHEAP_MARKEND;
-        test.End();
-        return(0);
-        }
-    
-    TSlabTestThreadParm threadParm;
-    threadParm.iHeap = heap;
-    threadParm.iAllocSize = 17;
-    threadParm.iInitSlabCount = 128; // 12
-    threadParm.iUseRandomSize = EFalse;
-
-    test.Next(_L("TestSlab - one thread"));
-
-    TInt threadCount;
-    threadCount = 1;
-    if (threadCount > MAX_THREADS)
-        {
-        threadCount = MAX_THREADS;
-        }
-    threadParm.iThreadCount = threadCount;
-    
-#if 0
-    ret = StartThreads(threadCount, threadParm);
-    test(ret==KErrNone);
-    
-#else   
-    
-    TInt i;
-    for (i=1; i<metaData.iSlabThreshold; ++i)
-        {
-#ifdef _DEBUG
-        if ((i + RHeap::EDebugHdrSize) >= metaData.iSlabThreshold)
-            {
-            break;
-            }
-#endif // _DEBUG
-        TSTSLAB_DBG(RDebug::Printf("=========== StartThreads size: %d", i));
-        threadParm.iAllocSize = i;
-        test.Printf(_L("AllocSize: %d\n"), i);
-        ret = StartThreads(threadCount, threadParm);
-        test(ret==KErrNone);
-        }
-#endif
-
-    
-    test.Next(_L("TestSlab - many threads"));
-
-    threadParm.iAllocSize = 17;
-    
-    threadCount = 3;
-    if (threadCount > MAX_THREADS)
-        {
-        threadCount = MAX_THREADS;
-        }
-    threadParm.iThreadCount = threadCount;
-    
-#if 1
-    ret = StartThreads(threadCount, threadParm);
-    test(ret==KErrNone);
-    
-#else   
-    
-    TInt i;
-    for (i=1; i<metaData.iSlabThreshold; ++i)
-        {
-#ifdef _DEBUG
-        if ((i + RHeap::EDebugHdrSize) >= metaData.iSlabThreshold)
-            {
-            break;
-            }
-#endif // _DEBUG
-        TSTSLAB_DBG(RDebug::Printf("=========== StartThreads size: %d", i));
-        threadParm.iAllocSize = i;
-        test.Printf(_L("AllocSize: %d\n"), i);
-        ret = StartThreads(threadCount, threadParm);
-        test(ret==KErrNone);
-        }
-#endif
-
-    __KHEAP_MARKEND;
-    
-    test.End();
-    return(0);
-    }
--- a/kerneltest/e32test/heap/t_heapstress.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1233 +0,0 @@
-// 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:
-// e32test\heap\t_heaphybridstress.cpp
-// Overview:
-// Tests RHybridHeap class: stress test
-// API Information:
-// RHybridHeap/RHeap
-// Details:
-// - Stress test heap implementation that allocates, frees
-//   and reallocates cells in random patterns, and checks the heap.
-// - Allocated/reallocated buffer content is verified, when buffer is freed/reallocated.
-// - Stress test with a single thread
-// - Stress test with two threads that run concurrently.
-// - Tests configured for slab, doug lea, paged and hybrid allocators
-// Platforms/Drives/Compatibility:
-// All
-// Assumptions/Requirement/Pre-requisites:
-// Failures and causes:
-// Base Port information:
-// 
-//
-
-#include <e32test.h>
-#include <e32hal.h>
-#include <e32def.h>
-#include <e32def_private.h>
-#include "dla.h"
-#include "slab.h"
-#include "page_alloc.h"
-#include "heap_hybrid.h"
-
-// Needed for KHeapShrinkHysRatio which is now ROM 'patchdata'
-#include "TestRHeapShrink.h"
-
-//-------------------------------------------
-
-//#define TSTDBG_PRINTMETA(a) a
-#define TSTDBG_PRINTMETA(a)
-
-//-------------------------------------------
-
-
-#ifdef __EABI__
-       IMPORT_D extern const TInt KHeapMinCellSize;
-#else
-       const TInt KHeapMinCellSize = 0;
-#endif
-
-RTest test(_L("T_HEAPSTRESS"));
-
-#define TEST_ALIGN(p,a)     test((TLinAddr(p)&((a)-1))==0)
-
-
-#define TST_HEAP_MAX_LTH 0x4000000 // 64M
-#define MAX_CELL_COUNT 0x100000 // 0x100 0x1000 0x10000 0x100000
-#define MAX_THREAD_COUNT 2
-LOCAL_D TUint8* HeapStressCell[MAX_THREAD_COUNT][MAX_CELL_COUNT];
-LOCAL_D TInt HeapStressLen[MAX_THREAD_COUNT][MAX_CELL_COUNT];
-
-enum TTestHybridHeapFunc {ETstOnlySlab, ETstOnlyDl, ETstOnlyPaged, ETstHybrid};
-enum TTestType {ETestE32Test, ETestForeverOne, ETestForeverAll};
-
-LOCAL_D TTimeIntervalMicroSeconds32 TickPeriod;
-
-//--------- config parameters - begin
-LOCAL_D TTestType TestType;
-LOCAL_D TInt TestTimeAsSeconds;
-LOCAL_D TBool TestForeverMultiThreadTest;
-LOCAL_D TTestHybridHeapFunc TestHybridHeapFunc;
-LOCAL_D TInt CurrMaxCellCount;
-LOCAL_D TInt HeapMaxLength;
-//--------- config parameters - end
-
-LOCAL_D TBool DlOnly;
-
-LOCAL_D TInt SlabThreshold;
-LOCAL_D TInt PageThreshold;
-
-
-struct TMetaData
-    {
-    TBool           iDLOnly;
-    RFastLock*      iLock;
-    TInt            iChunkSize;
-    TInt            iSlabThreshold;
-    TInt            iPageThreshold;
-    TInt            iSlabInitThreshold;
-    TUint32         iSlabConfigBits;
-    slab*           iPartialPage;
-    slab*           iFullSlab;
-    page*           iSparePage;
-    TUint8*         iMemBase;
-    TUint8          iSizeMap[(MAXSLABSIZE>>2)+1];
-    slabset         iSlabAlloc[MAXSLABSIZE>>2];
-    slab**          iSlabAllocRealRootAddress[MAXSLABSIZE>>2];
-    };
-
-class TestHybridHeap
-    {
-public:
-    static void GetHeapMetaData(RHeap& aHeap, TMetaData& aMeta);
-    };
-
-void TestHybridHeap::GetHeapMetaData(RHeap& aHeap, TMetaData& aMeta)
-{
-    RHybridHeap::STestCommand cmd;
-    cmd.iCommand = RHybridHeap::EHeapMetaData;
-    TInt ret = aHeap.DebugFunction(RHeap::EHybridHeap, &cmd, 0);
-    test(ret == KErrNone);
-    
-    RHybridHeap* hybridHeap = (RHybridHeap*)cmd.iData;
-    
-    aMeta.iDLOnly              = hybridHeap->iDLOnly;
-    aMeta.iLock                = &hybridHeap->iLock;
-    aMeta.iChunkSize           = hybridHeap->iChunkSize;
-    aMeta.iSlabThreshold       = hybridHeap->iSlabThreshold;
-    aMeta.iPageThreshold       = hybridHeap->iPageThreshold;
-    aMeta.iSlabInitThreshold   = hybridHeap->iSlabInitThreshold;
-    aMeta.iSlabConfigBits      = hybridHeap->iSlabConfigBits;
-    aMeta.iPartialPage         = hybridHeap->iPartialPage;
-    aMeta.iFullSlab            = hybridHeap->iFullSlab;
-    aMeta.iSparePage           = hybridHeap->iSparePage;
-    aMeta.iMemBase             = hybridHeap->iMemBase;
-
-    TInt i;
-    TInt count;
-    count = sizeof(aMeta.iSizeMap)/sizeof(unsigned char);
-    for (i=0; i<count; ++i)
-        {
-        aMeta.iSizeMap[i] = hybridHeap->iSizeMap[i];
-        }
-    count = sizeof(aMeta.iSlabAlloc)/sizeof(slabset);
-    for (i=0; i<count; ++i)
-        {
-        aMeta.iSlabAlloc[i].iPartial = hybridHeap->iSlabAlloc[i].iPartial;
-        aMeta.iSlabAllocRealRootAddress[i] = &hybridHeap->iSlabAlloc[i].iPartial;
-        }
-}
-
-LOCAL_C void GetMeta(RHeap& aHeap, TMetaData& aMeta)
-{
-    TestHybridHeap::GetHeapMetaData(aHeap, aMeta);
-}
-
-
-TSTDBG_PRINTMETA(
-LOCAL_C void PrintMeta(const char* aText, TMetaData& aMeta)
-{
-    RDebug::Printf("=========== HeapMetaData (local) - begin: %s", aText);
-
-    RDebug::Printf("iDLOnly: 0x%08x", aMeta.iDLOnly);
-    RDebug::Printf("iChunkSize: 0x%08x", aMeta.iChunkSize);
-    RDebug::Printf("iSlabThreshold: 0x%08x / %d", aMeta.iSlabThreshold, aMeta.iSlabThreshold);
-    RDebug::Printf("iPageThreshold: 0x%08x / %d", aMeta.iPageThreshold, aMeta.iPageThreshold);
-    RDebug::Printf("iSlabInitThreshold: 0x%08x / %d", aMeta.iSlabInitThreshold, aMeta.iSlabInitThreshold);
-    RDebug::Printf("iSlabConfigBits: 0x%08x", aMeta.iSlabConfigBits);
-    RDebug::Printf("iPartialPage: 0x%08x", aMeta.iPartialPage);
-    RDebug::Printf("iFullSlab: 0x%08x", aMeta.iFullSlab);
-    RDebug::Printf("iSparePage: 0x%08x", aMeta.iSparePage);
-    RDebug::Printf("iMemBase: 0x%08x", aMeta.iMemBase);
-
-    TInt i;
-    TInt count;
-    count = sizeof(aMeta.iSizeMap)/sizeof(unsigned char);
-    for (i=0; i<count; ++i)
-        {
-        RDebug::Printf("iSizeMap[%d]: %d", i, aMeta.iSizeMap[i]);
-        }
-    count = sizeof(aMeta.iSlabAlloc)/sizeof(slabset);
-    for (i=0; i<count; ++i)
-        {
-        RDebug::Printf("iSlabAlloc[%d].iPartial: 0x%08x", i, aMeta.iSlabAlloc[i].iPartial);
-        }
-    for (i=0; i<count; ++i)
-        {
-        RDebug::Printf("iSlabAllocRealRootAddress[%d]: 0x%08x", i, aMeta.iSlabAllocRealRootAddress[i]);
-        }
-    RDebug::Printf("=========== HeapMetaData (local) - end");
-}
-)
-
-LOCAL_C void ConfHeap(RHeap* aHeap)
-{
-    RHybridHeap::STestCommand cmd;
-
-    if (TestHybridHeapFunc == ETstOnlySlab)
-        {
-        cmd.iCommand = RHybridHeap::ESetConfig;
-        cmd.iConfig.iSlabBits = 0xabe;
-        cmd.iConfig.iDelayedSlabThreshold = 0;            // 0 -> use slab at once from the beginning
-        cmd.iConfig.iPagePower = 0;                       // 0 -> no page allocator
-        }
-    else if (TestHybridHeapFunc == ETstOnlyDl)
-        {
-        cmd.iCommand = RHybridHeap::ESetConfig;
-        cmd.iConfig.iSlabBits = 0xabe;
-        cmd.iConfig.iDelayedSlabThreshold = 0x40000000;   // 1G -> slab never used
-        cmd.iConfig.iPagePower = 0;                       // 0 -> no page allocator
-        }
-    else if (TestHybridHeapFunc == ETstOnlyPaged)
-        {
-        cmd.iCommand = RHybridHeap::ESetConfig;
-        cmd.iConfig.iSlabBits = 0xabe;
-        cmd.iConfig.iDelayedSlabThreshold = 0x40000000;   // 1G -> slab never used
-        cmd.iConfig.iPagePower = 14;                      // min page 14 -> 16K
-        }
-    else if (TestHybridHeapFunc == ETstHybrid)
-        {
-        cmd.iCommand = RHybridHeap::ESetConfig;
-        cmd.iConfig.iSlabBits = 0xabe;
-        cmd.iConfig.iDelayedSlabThreshold = 0;            // 0 -> use slab at once from the beginning
-        cmd.iConfig.iPagePower = 14;                      // min page 14 -> 16K
-        }
-    else
-        {
-        test(0);
-        }
-    
-    TInt ret = aHeap->DebugFunction(RHeap::EHybridHeap, &cmd, 0);
-    test(ret == KErrNone);
-}
-
-LOCAL_C TInt MinPagedAllocLength(void)
-{
-    return (1 << PageThreshold);
-}
-
-LOCAL_C TUint32 RandomPagedLength(TUint32 aRandom)
-{
-    TUint32 ret;
-    ret = aRandom;
-    ret <<= PageThreshold;
-    if (TestHybridHeapFunc == ETstOnlyPaged)
-        {
-        //ret &= 0xfffff; // below 1M
-        ret &= 0x7ffff; // below 512K
-        }
-    else
-        {
-        ret &= 0x1ffff; // below 128K
-        }
-    if (ret == 0)
-        {
-        ret = MinPagedAllocLength();
-        }
-    return ret;
-}
-
-#if 0            
-LOCAL_C TUint TicksAsMilliSeconds(TUint aTicks)
-{
-    TUint time = TUint((TUint64)aTicks*(TUint64)TickPeriod.Int()/(TUint64)1000);
-    return time;
-}
-#endif
-
-LOCAL_C TBool IsDlOnly(void)
-{
-    TestHybridHeapFunc = ETstHybrid;
-    
-    RHeap* heap;
-    heap = UserHeap::ChunkHeap(&KNullDesC(), 0x1000, 0x4000, 0x1000, 4);
-    test(heap != NULL);
-
-    ConfHeap(heap);
-    
-    TMetaData metaData;
-    GetMeta(*heap, metaData);
-    
-    heap->Close();
-    return metaData.iDLOnly;
-}
-
-LOCAL_C RHeap* CreateTestHeap(TInt aAlign)
-{
-    if (HeapMaxLength > TST_HEAP_MAX_LTH)
-        {
-        HeapMaxLength = TST_HEAP_MAX_LTH;
-        }
-    
-    if (CurrMaxCellCount > MAX_CELL_COUNT)
-        {
-        CurrMaxCellCount = MAX_CELL_COUNT;
-        }
-    
-    RHeap* heap;
-    heap = UserHeap::ChunkHeap(&KNullDesC(), 0x1000, HeapMaxLength, 0x1000, aAlign);
-    test(heap != NULL);
-
-    ConfHeap(heap);
-    
-    TMetaData metaData;
-    GetMeta(*heap, metaData);
-    
-    if (TestHybridHeapFunc == ETstOnlySlab)
-        {
-        SlabThreshold = metaData.iSlabThreshold;
-        test(SlabThreshold != 0);
-        }
-    else if (TestHybridHeapFunc == ETstOnlyDl)
-        {
-        }
-    else if (TestHybridHeapFunc == ETstOnlyPaged)
-        {
-        PageThreshold = metaData.iPageThreshold;
-        test(PageThreshold >= 14);
-        }
-    else if (TestHybridHeapFunc == ETstHybrid)
-        {
-        }
-    else
-        {
-        test(0);
-        }
-
-    return heap;
-}
-
-//-------------------------------------------------------------------
-
-struct STestCell
-    {
-    enum {EMagic = 0xb8aa3b29};
-
-    TUint32 iLength;
-    TUint32 iData[1];
-
-    void Set(TInt aLength);
-    void Verify(TInt aLength);
-    void Verify(const TAny* aInitPtr, TInt aInitLength, TInt aLength);
-    };
-
-void STestCell::Set(TInt aLength)
-    {
-    TInt i;
-    TUint32 x = (TUint32)this ^ (TUint32)aLength ^ (TUint32)EMagic;
-    if (aLength < (TInt) sizeof(iLength))
-        {
-        return;
-        }
-    iLength = x;
-    aLength /= sizeof(TUint32);
-    for (i=0; i<aLength-1; ++i)
-        {
-        x *= 69069;
-        x += 41;
-        iData[i] = x;
-        }
-    }
-
-void STestCell::Verify(TInt aLength)
-    {
-    Verify(this, aLength, aLength);
-    }
-
-void STestCell::Verify(const TAny* aInitPtr, TInt aInitLength, TInt aLength)
-    {
-    TInt i;
-    TUint32 x = (TUint32)aInitPtr ^ (TUint32)aInitLength ^ (TUint32)EMagic;
-    if (aLength < (TInt) sizeof(iLength))
-        {
-        return;
-        }
-    test(iLength == x);
-    aLength /= sizeof(TUint32);
-    for (i=0; i<aLength-1; ++i)
-        {
-        x *= 69069;
-        x += 41;
-        test(iData[i] == x);
-        }
-    }
-
-class RTestHeap : public RHeap
-    {
-public:
-    TInt CheckAllocatedCell(const TAny* aCell) const;
-    void FullCheckAllocatedCell(const TAny* aCell) const;
-    TAny* TestAlloc(TInt aSize);
-    void TestFree(TAny* aPtr);
-    TAny* TestReAlloc(TAny* aPtr, TInt aSize, TInt aMode=0);
-    void FullCheck();
-    static void WalkFullCheckCell(TAny* aPtr, TCellType aType, TAny* aCell, TInt aLen);
-    };
-
-TInt RTestHeap::CheckAllocatedCell(const TAny* aCell) const
-    {
-    TInt len = AllocLen(aCell);
-    return len;
-    }
-
-void RTestHeap::FullCheckAllocatedCell(const TAny* aCell) const
-    {
-    ((STestCell*)aCell)->Verify(CheckAllocatedCell(aCell));
-    }
-
-TAny* RTestHeap::TestAlloc(TInt aSize)
-    {
-    TAny* p = Alloc(aSize);
-    if (p)
-        {
-        TInt len = CheckAllocatedCell(p);
-        test(len>=aSize);       
-        ((STestCell*)p)->Set(len);
-        }
-    return p;
-    }
-
-void RTestHeap::TestFree(TAny* aPtr)
-    {
-    if (aPtr)
-        {
-        FullCheckAllocatedCell(aPtr);
-        }
-    Free(aPtr);
-    }
-
-TAny* RTestHeap::TestReAlloc(TAny* aPtr, TInt aSize, TInt aMode)
-    {
-    TInt old_len = aPtr ? CheckAllocatedCell(aPtr) : 0;
-    if (aPtr)
-        ((STestCell*)aPtr)->Verify(old_len);
-    TAny* p = ReAlloc(aPtr, aSize, aMode);
-    if (!p)
-        {
-        ((STestCell*)aPtr)->Verify(old_len);
-        return p;
-        }
-    TInt new_len = CheckAllocatedCell(p);
-    test(new_len>=aSize);       
-    if (p == aPtr)
-        {
-        ((STestCell*)p)->Verify(p, old_len, Min(old_len, new_len));
-        if (new_len != old_len)
-            ((STestCell*)p)->Set(new_len);
-        return p;
-        }
-    test(!(aMode & ENeverMove));
-    test((new_len > old_len) || (aMode & EAllowMoveOnShrink));
-    if (old_len)
-        ((STestCell*)p)->Verify(aPtr, old_len, Min(old_len, aSize));
-    ((STestCell*)p)->Set(new_len);
-    return p;
-    }
-
-struct SHeapCellInfo
-    {
-    RTestHeap* iHeap;
-    TInt iTotalAlloc;
-    TInt iTotalAllocSize;
-    TInt iTotalFree;
-    TUint8* iNextCell;
-    };
-
-void RTestHeap::WalkFullCheckCell(TAny* aPtr, TCellType aType, TAny* aCell, TInt aLen)
-    {
-    (void)aCell;
-    ::SHeapCellInfo& info = *(::SHeapCellInfo*)aPtr;
-    switch(aType)
-        {
-        case EGoodAllocatedCell:
-            {
-            TInt len = aLen;
-            info.iTotalAllocSize += len;
-            STestCell* pT = (STestCell*)aCell;
-            ++info.iTotalAlloc;
-            pT->Verify(len);
-            break;
-            }
-        case EGoodFreeCell:
-            {
-            ++info.iTotalFree;
-            break;
-            }
-        default:
-            test.Printf(_L("TYPE=%d ??\n"),aType);
-            test(0);
-            break;
-        }
-    }
-
-void RTestHeap::FullCheck()
-    {
-    ::SHeapCellInfo info;
-    Mem::FillZ(&info, sizeof(info));
-    info.iHeap = this;
-    DebugFunction(EWalk, (TAny*)&WalkFullCheckCell, &info);
-    TInt count = AllocSize(iTotalAllocSize);
-    test(info.iTotalAlloc == count);
-    test(info.iTotalAllocSize == iTotalAllocSize);
-    }
-
-
-struct STestStress
-    {
-    RThread iThread;
-    volatile TBool iStop;
-    TInt iAllocs;
-    TInt iFailedAllocs;
-    TInt iFrees;
-    TInt iReAllocs;
-    TInt iFailedReAllocs;
-    TInt iChecks;
-    TUint32 iSeed;
-    RAllocator* iAllocator;
-    TInt iThreadIndex;
-
-    TUint32 Random();
-    };
-
-TUint32 FirstSeed(TInt aThreadIndex)
-    {
-    static TUint32 seed0 = 0xb504f334;
-    static TUint32 seed1 = 0xddb3d743;
-    static TBool first = ETrue;
-
-    TUint32 ret;
-
-    if (aThreadIndex == 0)
-        {
-        ret = seed0;
-        }
-    else
-        {
-        ret = seed1;
-        }
-    
-    if (first)
-        {
-        first = EFalse;
-        }
-    
-    if (aThreadIndex == 0)
-        {
-        seed0 *= 69069;
-        seed0 += 41;
-        }
-    else
-        {
-        seed1 *= 69069;
-        seed1 += 41;
-        }
-
-    test.Printf(_L("FirstSeed: 0x%08x\n"), ret);
-    return ret;
-    }
-
-TUint32 STestStress::Random()
-    {
-    iSeed *= 69069;
-    iSeed += 41;
-    return iSeed;
-    }
-
-TInt RandomLength(TUint32 aRandom)
-    {
-    TUint32 ret = 0;
-    
-    if (TestHybridHeapFunc == ETstOnlySlab)
-        {
-        test(SlabThreshold != 0);
-        ret = aRandom;
-        TInt realSlabThreshold = SlabThreshold;
-#ifdef _DEBUG
-        realSlabThreshold -= RHeap::EDebugHdrSize;
-#endif
-        ret %= realSlabThreshold;
-        }
-    else if (TestHybridHeapFunc == ETstOnlyDl)
-        {
-        TUint8 x = (TUint8)aRandom;
-        if (x & 0x80)
-            {
-            ret = x & 0x7f;
-            }
-        else
-            {
-            ret = (x & 0x7f) << 7;
-            }
-        }
-    else if (TestHybridHeapFunc == ETstOnlyPaged)
-        {
-        ret = RandomPagedLength(aRandom);
-        }
-    else if (TestHybridHeapFunc == ETstHybrid)
-        {
-        TUint8 x = (TUint8)aRandom;
-        if (x & 0x80)
-            {
-            ret = x & 0x7f;
-            }
-        else
-            {
-            if (x & 0x10)
-                {
-                ret = (x & 0x7f) << 7;
-                }
-            else
-                {
-                ret = RandomPagedLength(aRandom);
-                }
-            }
-        }
-    else
-        {
-        test(0);
-        }
-
-    return (TInt)ret;
-    }
-
-TInt HeapStress(TAny* aPtr)
-    {
-    STestStress& stress = *(STestStress*)aPtr;
-    RTestHeap* heap = (RTestHeap*)&User::Allocator();
-    TUint8** cell;
-    TInt* len;
-
-    if (stress.iThreadIndex >= MAX_THREAD_COUNT)
-        {
-        test(0);
-        }
-    cell = &HeapStressCell[stress.iThreadIndex][0];
-    len = &HeapStressLen[stress.iThreadIndex][0];
-
-    Mem::FillZ(cell, sizeof(*cell)*CurrMaxCellCount);
-    Mem::FillZ(len, sizeof(*len)*CurrMaxCellCount);
-
-    RThread::Rendezvous(KErrNone);
-    while (!stress.iStop)
-        {
-        // allocate all cells
-        TInt i;
-        for (i=0; i<CurrMaxCellCount; ++i)
-            {
-            if (!cell[i])
-                {
-                ++stress.iAllocs;
-                cell[i] = (TUint8*)heap->TestAlloc(RandomLength(stress.Random()));
-                if (cell[i])
-                    len[i] = heap->AllocLen(cell[i]);
-                else
-                    ++stress.iFailedAllocs;
-                }
-            }
-
-        // free some cells
-        TInt n = (CurrMaxCellCount/4) + (stress.Random() & (CurrMaxCellCount/2-1));
-        while (--n)
-            {
-            i = stress.Random() & (CurrMaxCellCount-1);
-            if (cell[i])
-                {
-                test(heap->AllocLen(cell[i]) == len[i]);
-                heap->TestFree(cell[i]);
-                cell[i] = NULL;
-                len[i] = 0;
-                ++stress.iFrees;
-                }
-            }
-
-        // realloc some cells
-        n = (CurrMaxCellCount/4) + (stress.Random() & (CurrMaxCellCount/2-1));
-        while (--n)
-            {
-            TUint32 rn = stress.Random();
-            i = (rn >> 8) & (CurrMaxCellCount-1);
-            TInt new_len = RandomLength(rn);
-            if (cell[i])
-                {
-                test(heap->AllocLen(cell[i]) == len[i]);
-                ++stress.iReAllocs;
-                TUint8* p = (TUint8*)heap->TestReAlloc(cell[i], new_len, rn >> 16);
-                if (p)
-                    {
-                    cell[i] = p;
-                    len[i] = heap->AllocLen(p);
-                    }
-                else
-                    {
-                    ++stress.iFailedReAllocs;
-                    }
-                }
-            }
-                
-        // check the heap
-        heap->Check();
-        ++stress.iChecks;
-        }
-    
-    return 0;
-    }
-
-void PrintSummary(STestStress& aStress)
-    {
-    test.Printf(_L("Total Allocs    : %11d\n"), aStress.iAllocs);
-    test.Printf(_L("Failed Allocs   : %11d\n"), aStress.iFailedAllocs);
-    test.Printf(_L("Total Frees     : %11d\n"), aStress.iFrees);
-    test.Printf(_L("Total ReAllocs  : %11d\n"), aStress.iReAllocs);
-    test.Printf(_L("Failed ReAllocs : %11d\n"), aStress.iFailedReAllocs);
-    test.Printf(_L("Heap checks     : %11d\n"), aStress.iChecks);
-    }
-    
-void CreateStressThread(STestStress& aStress)
-    {
-    RThread& thread = aStress.iThread;
-    TInt err = thread.Create(KNullDesC(), &HeapStress, 0x2000, aStress.iAllocator, &aStress);
-    test(err==KErrNone);
-    thread.SetPriority(EPriorityLess);
-    TRequestStatus status;
-    thread.Rendezvous(status);
-    test(status == KRequestPending);
-    thread.Resume();
-    User::WaitForRequest(status);
-    test(status == KErrNone);
-    test(thread.ExitType() == EExitPending);
-    thread.SetPriority(EPriorityMuchLess);
-    }
-
-void StopStressThread(STestStress& aStress)
-    {
-    RThread& thread = aStress.iThread;
-    TRequestStatus status;
-    thread.Logon(status);
-    aStress.iStop = ETrue;
-    User::WaitForRequest(status);
-    const TDesC& exitCat = thread.ExitCategory();
-    TInt exitReason = thread.ExitReason();
-    TInt exitType = thread.ExitType();
-    test.Printf(_L("Exit type %d,%d,%S\n"), exitType, exitReason, &exitCat);
-    test(exitType == EExitKill);
-    test(exitReason == KErrNone);
-    test(status == KErrNone);
-    PrintSummary(aStress);
-    }
-
-void WaitForKey(STestStress* aStress1, STestStress* aStress2)
-{
-    TRequestStatus keyStatus;
-    CConsoleBase* console = test.Console();
-    console->Read(keyStatus);
-    
-    for (;;)
-        {
-        User::WaitForRequest(keyStatus);
-        if (keyStatus != KRequestPending)
-            {
-            test(keyStatus == KErrNone);
-            if (console->KeyCode() == EKeyEscape)
-                {
-                test.Printf(_L("Forever test aborted by user\n"));
-                break;
-                }
-            else if (console->KeyCode() == EKeySpace)
-                {
-                if (aStress1 != NULL)
-                    {
-                    PrintSummary(*aStress1);
-                    }
-                if (aStress2 != NULL)
-                    {
-                    PrintSummary(*aStress2);
-                    }
-                }
-            }
-        console->Read(keyStatus);
-        }
-}
-
-TBool WaitForTimeoutOrKey(STestStress* aStress1, STestStress* aStress2)
-{
-    TBool abortedByUser = EFalse;
-    RTimer timer;
-    TRequestStatus timerStatus;
-    TInt err = timer.CreateLocal();
-    test(err == KErrNone);
-    timer.After(timerStatus, TestTimeAsSeconds*1000000);
-    
-    TRequestStatus keyStatus;
-    CConsoleBase* console = test.Console();
-    console->Read(keyStatus);
-    
-    for (;;)
-        {
-        User::WaitForRequest(keyStatus, timerStatus);
-        if (keyStatus != KRequestPending)
-            {
-            test(keyStatus == KErrNone);
-            if (console->KeyCode() == EKeyEscape)
-                {
-                abortedByUser = ETrue;
-                timer.Cancel();
-                test.Printf(_L("Forever test aborted by user\n"));
-                break;
-                }
-            else if (console->KeyCode() == EKeySpace)
-                {
-                if (aStress1 != NULL)
-                    {
-                    PrintSummary(*aStress1);
-                    }
-                if (aStress2 != NULL)
-                    {
-                    PrintSummary(*aStress2);
-                    }
-                }
-            console->Read(keyStatus);
-            }
-        if (timerStatus != KRequestPending)
-            {
-            if (timerStatus != KErrNone)
-                {
-                test(0);
-                }
-            console->ReadCancel();
-            break;
-            }
-        }
-    timer.Close();
-    return abortedByUser;
-}
-    
-TBool DoStressTest1(RAllocator* aAllocator)
-    {
-    TBool abortedByUser = EFalse;
-    
-    RTestHeap* heap = (RTestHeap*)aAllocator;
-    //test.Printf(_L("Test Stress 1: max=0x%x\n"),  heap->MaxLength());
-    
-    STestStress stress;
-    Mem::FillZ(&stress, sizeof(STestStress));
-    stress.iAllocator = aAllocator;
-    stress.iThreadIndex = 0;
-    if (TestType == ETestForeverAll)
-        {
-        stress.iSeed = FirstSeed(stress.iThreadIndex);
-        }
-    else
-        {
-        stress.iSeed = 0xb504f334;;
-        }
-    
-    CreateStressThread(stress);
-    
-    if (TestType == ETestE32Test)
-        {
-        User::After(TestTimeAsSeconds*1000000);
-        }
-    else if (TestType == ETestForeverAll)
-        {
-        abortedByUser = WaitForTimeoutOrKey(&stress, NULL);
-        }
-    else if (TestType == ETestForeverOne)
-        {
-        WaitForKey(&stress, NULL);
-        abortedByUser = ETrue;
-        }
-    else
-        {
-        test(0);
-        }
-    
-    StopStressThread(stress);
-    CLOSE_AND_WAIT(stress.iThread);
-    heap->FullCheck();
-    return abortedByUser;
-    }
-
-TBool DoStressTest2(RAllocator* aAllocator)
-    {
-    TBool abortedByUser = EFalse;
-    
-    RTestHeap* heap = (RTestHeap*)aAllocator;
-    //test.Printf(_L("Test Stress 2: max=0x%x\n"),  heap->MaxLength());    
-    
-    STestStress stress1;
-    Mem::FillZ(&stress1, sizeof(STestStress));
-    stress1.iAllocator = aAllocator;
-    stress1.iThreadIndex = 0;
-    
-    STestStress stress2;
-    Mem::FillZ(&stress2, sizeof(STestStress));
-    stress2.iAllocator = aAllocator;
-    stress2.iThreadIndex = 1;
-    
-    if (TestType == ETestForeverAll)
-        {
-        stress1.iSeed = FirstSeed(stress1.iThreadIndex);
-        stress2.iSeed = FirstSeed(stress2.iThreadIndex);
-        }
-    else
-        {
-        stress1.iSeed = 0xb504f334;
-        stress2.iSeed = 0xddb3d743;
-        }
-    CreateStressThread(stress1);
-    CreateStressThread(stress2);
-
-    if (TestType == ETestE32Test)
-        {
-        User::After(2*TestTimeAsSeconds*1000000);
-        }
-    else if (TestType == ETestForeverAll)
-        {
-        abortedByUser = WaitForTimeoutOrKey(&stress1, &stress2);
-        }
-    else if (TestType == ETestForeverOne)
-        {
-        WaitForKey(&stress1, &stress2);
-        abortedByUser = ETrue;
-        }
-    else
-        {
-        test(0);
-        }
-    
-    StopStressThread(stress1);
-    StopStressThread(stress2);
-    CLOSE_AND_WAIT(stress1.iThread);
-    CLOSE_AND_WAIT(stress2.iThread);
-    heap->FullCheck();
-    return abortedByUser;
-    }
-
-TBool StressTests(void)
-    {
-    TBool abortedByUser = EFalse;
-    RHeap* heap = 0;
-    
-    for (;;)
-        {
-        if (TestType == ETestE32Test ||
-            TestType == ETestForeverAll)
-            {
-            heap = CreateTestHeap(4);
-            test(heap != NULL);
-            test.Next(_L("one thread, align 4"));
-            abortedByUser = DoStressTest1(heap);
-            if (abortedByUser)
-                {
-                break;
-                }
-            heap->Close();
-            
-            heap = CreateTestHeap(4);
-            test.Next(_L("two threads, align 4"));
-            abortedByUser = DoStressTest2(heap);
-            if (abortedByUser)
-                {
-                break;
-                }
-            heap->Close();
-                
-            heap = CreateTestHeap(8);
-            test(heap != NULL);
-            test.Next(_L("one thread, align 8"));
-            abortedByUser = DoStressTest1(heap);
-            if (abortedByUser)
-                {
-                break;
-                }
-            heap->Close();
-
-            heap = CreateTestHeap(8);
-            test.Next(_L("two threads, align 8"));
-            abortedByUser = DoStressTest2(heap);
-            }
-        else if (TestType == ETestForeverOne)
-            {
-            heap = CreateTestHeap(4);
-            test(heap != NULL);
-            if (TestForeverMultiThreadTest)
-                {
-                test.Next(_L("two threads, align 4"));
-                abortedByUser = DoStressTest2(heap);
-                }
-            else
-                {
-                test.Next(_L("one thread, align 4"));
-                abortedByUser = DoStressTest1(heap);
-                }
-            }
-        else
-            {
-            test(0);
-            }
-        break;
-        }
-    heap->Close();
-    
-    return abortedByUser;
-    }           
-
-        
-void ForeverOneTest(void)
-    {
-    //--------- config parameters - begin
-    TestForeverMultiThreadTest = ETrue; // EFalse
-    TestHybridHeapFunc = ETstOnlySlab; // ETstOnlySlab // ETstOnlyDl // ETstOnlyPaged // ETstHybrid
-    //--------- config parameters - end
-
-    if (TestHybridHeapFunc == ETstOnlySlab && !DlOnly)
-        {
-        // slab tests
-#ifdef __WINS__
-        test.Next(_L("slab test 48M"));
-        CurrMaxCellCount = 0x100000; //0x10000; 0x100000
-        HeapMaxLength = 0x3000000; // 48M
-#else
-        test.Next(_L("slab test 3M"));
-        CurrMaxCellCount = 0x10000; //0x10000; 0x100000
-        HeapMaxLength = 0x300000; // 3M
-#endif          
-        StressTests();
-        }
-    else if (TestHybridHeapFunc == ETstOnlyDl)
-        {
-        // DL tests
-        test.Next(_L("DL test 32M"));
-        CurrMaxCellCount = 0x1000; //0x10000;
-        HeapMaxLength = 0x2000000; // 32M
-        StressTests();
-        }
-    else if (TestHybridHeapFunc == ETstOnlyPaged && !DlOnly)
-        {
-        // paged tests
-        test.Next(_L("paged test 64M"));
-        CurrMaxCellCount = 0x100; //0x10000;
-        HeapMaxLength = 0x4000000; // 64M
-        StressTests();
-        }
-    else if (TestHybridHeapFunc == ETstHybrid && !DlOnly)
-        {
-        // hybrid tests
-        test.Next(_L("hybrid test 64M"));
-        CurrMaxCellCount = 0x1000; //0x10000;
-        HeapMaxLength = 0x4000000; // 64M
-        StressTests();
-        }
-    else
-        {
-        test(0);
-        }
-    }
-    
-void ForeverAllTests(void)
-    {
-    //--------- config parameters - begin
-    TInt basicTimeAsSeconds = 30; //10;
-    //--------- config parameters - end
-
-    for (;;)
-        {
-        if (!DlOnly)
-            {
-            // slab tests
-            TestHybridHeapFunc = ETstOnlySlab;
-            TestTimeAsSeconds = basicTimeAsSeconds * 3;
-#ifdef __WINS__
-            test.Next(_L("slab test 48M"));
-            CurrMaxCellCount = 0x100000; //0x10000; 0x100000
-            HeapMaxLength = 0x3000000; // 48M
-#else
-            test.Next(_L("slab test 3M"));
-            CurrMaxCellCount = 0x10000; //0x10000; 0x100000
-            HeapMaxLength = 0x300000; // 3M
-#endif          
-            if (StressTests())
-                {
-                break;
-                }
-            }
-        
-        // DL tests
-        TestHybridHeapFunc = ETstOnlyDl;
-        TestTimeAsSeconds = basicTimeAsSeconds;
-        
-        test.Next(_L("DL test 32M"));
-        CurrMaxCellCount = 0x1000; //0x10000;
-        HeapMaxLength = 0x2000000; // 32M
-        if (StressTests())
-            {
-            break;
-            }
-        
-        test.Next(_L("DL test 16M"));
-        CurrMaxCellCount = 0x1000; //0x10000;
-        HeapMaxLength = 0x1000000; // 16M
-        if (StressTests())
-            {
-            break;
-            }
-        
-        if (!DlOnly)
-            {
-            // paged tests
-            TestHybridHeapFunc = ETstOnlyPaged;
-            TestTimeAsSeconds = basicTimeAsSeconds;
-            
-            test.Next(_L("paged test 64M"));
-            CurrMaxCellCount = 0x100; //0x10000;
-            HeapMaxLength = 0x4000000; // 64M
-            if (StressTests())
-                {
-                break;
-                }
-            }
-        
-        if (!DlOnly)
-            {
-            // hybrid tests
-            TestHybridHeapFunc = ETstHybrid;
-            TestTimeAsSeconds = basicTimeAsSeconds * 2;
-            
-            test.Next(_L("hybrid test 64M"));
-            CurrMaxCellCount = 0x1000; //0x10000;
-            HeapMaxLength = 0x4000000; // 64M
-            if (StressTests())
-                {
-                break;
-                }
-            }
-        }
-    }
-    
-void TestUsedInE32Tests(void)
-    {
-    //--------- config parameters - begin
-    TInt basicTimeAsSeconds = 10;
-    //--------- config parameters - end
-
-    if (!DlOnly)
-        {
-        // slab tests
-        TestHybridHeapFunc = ETstOnlySlab;
-        TestTimeAsSeconds = basicTimeAsSeconds * 3;
-#ifdef __WINS__
-        test.Next(_L("slab test 48M"));
-        CurrMaxCellCount = 0x100000; //0x10000; 0x100000
-        HeapMaxLength = 0x3000000; // 48M
-#else
-        test.Next(_L("slab test 3M"));
-        CurrMaxCellCount = 0x10000; //0x10000; 0x100000
-        HeapMaxLength = 0x300000; // 3M
-#endif          
-        StressTests();
-        }
-    
-    // DL tests
-    TestHybridHeapFunc = ETstOnlyDl;
-    TestTimeAsSeconds = basicTimeAsSeconds;
-    
-    test.Next(_L("DL test 32M"));
-    CurrMaxCellCount = 0x1000; //0x10000;
-    HeapMaxLength = 0x2000000; // 32M
-    StressTests();
-    
-    test.Next(_L("DL test 16M"));
-    CurrMaxCellCount = 0x1000; //0x10000;
-    HeapMaxLength = 0x1000000; // 16M
-    StressTests();
-    
-    if (!DlOnly)
-        {
-        // paged tests
-        TestHybridHeapFunc = ETstOnlyPaged;
-        TestTimeAsSeconds = basicTimeAsSeconds;
-        
-        test.Next(_L("paged test 64M"));
-        CurrMaxCellCount = 0x100; //0x10000;
-        HeapMaxLength = 0x4000000; // 64M
-        StressTests();
-        }
-
-    if (!DlOnly)
-        {
-        // hybrid tests
-        TestHybridHeapFunc = ETstHybrid;
-        TestTimeAsSeconds = basicTimeAsSeconds * 2;
-        
-        test.Next(_L("hybrid test 64M"));
-        CurrMaxCellCount = 0x1000; //0x10000;
-        HeapMaxLength = 0x4000000; // 64M
-        StressTests();
-        }
-    }
-    
-TInt E32Main()
-    {
-    test.Title();
-    __KHEAP_MARK;
-    test.Start(_L("Testing heaps"));
-
-    TInt err = UserHal::TickPeriod(TickPeriod);
-    test(err == KErrNone);
-
-    DlOnly = IsDlOnly();
-    
-    TestType = ETestE32Test; //ETestE32Test // ETestForeverOne // ETestForeverAll
-    // see other config parameters: TestUsedInE32Tests()/ForeverOneTest()/ForeverAllTests()
-   
-    if (TestType == ETestE32Test)
-        {
-        TestUsedInE32Tests();
-        }
-    else if (TestType == ETestForeverOne)
-        {
-        ForeverOneTest();
-        }
-    else if (TestType == ETestForeverAll)
-        {
-        ForeverAllTests();
-        }
-    else
-        {
-        test(0);
-        }
-    
-    test.End();
-    __KHEAP_MARKEND;
-    return 0;
-    }
--- a/kerneltest/e32test/heap/t_kheap.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/heap/t_kheap.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -54,7 +54,7 @@
 #include <f32dbg.h>
 #include "d_kheap.h"
 
-RTest test(_L("T_KHEAP"));
+RTest test(_L("T_KHeap"));
 RLoader LoaderSession;
 
 #ifdef _DEBUG
@@ -181,7 +181,6 @@
 	{
 	const TDesC* fileName = NULL;
 	const TDesC* objName = &KTestLddName();
-	User::FreeLogicalDevice(*objName);
 	switch (aDevice)
 		{
 		case 0:
--- a/kerneltest/e32test/iic/iic_psl/d_iic_client_ctrless.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/iic/iic_psl/d_iic_client_ctrless.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -33,7 +33,7 @@
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 // un-comment the following if debug printing is required
-//macro LOG_CLIENT
+macro LOG_CLIENT
 
 library spi_ctrless.lib
 library i2c_ctrless.lib
--- a/kerneltest/e32test/iic/iic_psl/d_iic_client_stubs.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +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/d_iic_client_stubs.mmp
-// Created for code coverage tests.
-
-
-#include "kernel/kern_ext.mmh"
-
-target         iic_client_stubs.ldd
-targettype     ldd
-
-//Both macros are only used for channel creation. It will create 
-//all 3 types of channels(Master, Slave, MasterSlave) when both 
-//macros are defined. For our code coverage improving tests, 
-//we need all these 3 types of channels, so we enable both macros here.
-macro MASTER_MODE
-macro SLAVE_MODE
-
-macro IIC_SIMULATED_PSL
-macro STANDALONE_CHANNEL
-macro IIC_STUBS
-
-sourcepath     .
-source         iic_client.cpp
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-// un-comment the following if debug printing is required
-//macro LOG_CLIENT
-
-library spi_ctrless.lib
-library i2c_masterstubs_ctrless.lib
-
-uid			0x100000af 0x10286b4d
-VENDORID 0x70000001
-
-capability		all
-epocallowdlldata
-
-start wins
-win32_headers
-end
-
-SMPSAFE
\ No newline at end of file
--- a/kerneltest/e32test/iic/iic_psl/d_iic_slaveclient_ctrless.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/iic/iic_psl/d_iic_slaveclient_ctrless.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -33,7 +33,7 @@
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 // un-comment the following if debug printing is required
-//macro LOG_SLAVECLIENT
+macro LOG_SLAVECLIENT
 
 library i2c_ctrless.lib
 
--- a/kerneltest/e32test/iic/iic_psl/d_iic_slaveclient_stubs.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +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/d_iic_slaveclient_stubs.mmp
-// created for code coverage tests
-
-#include "kernel/kern_ext.mmh"
-
-target         iic_slaveclient_stubs.ldd
-targettype     ldd
-
-//These macros are only used for channel creation
-//In the code coverage tests, we need all three types of channels
-//(Master, Slave, MasterSlave) to be tested, so enable both macros here.
-macro MASTER_MODE
-macro SLAVE_MODE
-
-macro IIC_SIMULATED_PSL
-
-macro STANDALONE_CHANNEL
-macro IIC_STUBS
-
-sourcepath     .
-source         iic_slaveclient.cpp
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-// un-comment the following if debug printing is required
-//macro LOG_SLAVECLIENT
-
-library spi_ctrless.lib
-library i2c_slavestubs_ctrless.lib
-
-uid			0x100000af 0x10286b4e
-VENDORID 0x70000001
-
-capability		all
-epocallowdlldata
-
-start wins
-win32_headers
-end
-
-SMPSAFE
--- a/kerneltest/e32test/iic/iic_psl/i2c.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/iic/iic_psl/i2c.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -20,7 +20,7 @@
 #include <drivers/iic_trace.h>
 #endif
 
-#ifndef STANDALONE_CHANNEL
+
 #if defined(MASTER_MODE) && !defined(SLAVE_MODE)
 const TInt KChannelTypeArray[NUM_CHANNELS] = {DIicBusChannel::EMaster, DIicBusChannel::EMaster, DIicBusChannel::EMaster};
 #elif defined(MASTER_MODE) && defined(SLAVE_MODE)
@@ -30,7 +30,6 @@
 #endif
 #define CHANNEL_TYPE(n) (KChannelTypeArray[n])	
 #define CHANNEL_DUPLEX(n) (DIicBusChannel::EHalfDuplex)
-#endif/*STANDALONE_CHANNEL*/
 
 #ifdef STANDALONE_CHANNEL
 _LIT(KPddNameI2c,"i2c_ctrless.pdd");
@@ -47,15 +46,14 @@
 	}
 #endif/*STANDALONE_CHANNEL*/
 
-//Macros MASTER_MODE and SLAVE_MODE are intentionally omitted from this file
-//This is for master and slave stubs to exercise the channel class,
-//and we need these stubs for code coverage tests.
+#ifdef SLAVE_MODE
 LOCAL_C TInt16 AssignSlaveChanId()
 	{
 	static TInt16 iBaseSlaveChanId = KI2cSlaveChannelIdBase;
 	I2C_PRINT(("I2C AssignSlaveChanId - on entry, iBaseSlaveChanId = 0x%x\n",iBaseSlaveChanId));
 	return iBaseSlaveChanId++; // Arbitrary, for illustration
 	}
+#endif/*SLAVE_MODE*/
 
 NONSHARABLE_CLASS(DSimulatedI2cDevice) : public DPhysicalDevice
 	{
@@ -127,10 +125,9 @@
 	aDes.Copy((TUint8*)&caps,size);
     }
 
-#ifndef STANDALONE_CHANNEL
 // supported channels for this implementation
 static DIicBusChannel* ChannelPtrArray[NUM_CHANNELS];
-#endif
+
 
 //DECLARE_EXTENSION_WITH_PRIORITY(BUS_IMPLMENTATION_PRIORITY)	
 DECLARE_STANDARD_PDD()		// I2c test driver to be explicitly loaded as an LDD, not kernel extension
@@ -231,6 +228,8 @@
 	return new DSimulatedI2cDevice;
 	}
 
+
+#ifdef MASTER_MODE
 #ifdef STANDALONE_CHANNEL
 EXPORT_C
 #endif
@@ -252,8 +251,6 @@
 	if(r == KErrNone)
 		SetDfcQ((TDfcQue*)iDynamicDfcQ);
 	DSimulatedIicBusChannelMasterI2c::SetRequestDelayed(this,EFalse);
-	//Call to base class DoCreate(not strictly necessary)
-	DIicBusChannelMaster::DoCreate();
 	return r;
 	}
 
@@ -424,8 +421,7 @@
 		default:
 			{
 			Kern::Printf("aFunction %d is not recognised \n",aFunction);
-			//For default case call the base class method for consistent handling
-            r=DIicBusChannelMaster::StaticExtension(aFunction,NULL,NULL);
+			r=KErrNotSupported;
 			}
 		}
 		
@@ -435,49 +431,22 @@
 	return r;
 	}
 
+//#ifdef MASTER_MODE
+#endif
+
+#ifdef SLAVE_MODE
+
 void DSimulatedIicBusChannelSlaveI2c::SlaveAsyncSimCallback(TAny* aPtr)
 	{
 	// To support simulating an asynchronous capture operation
+	// NOTE: this will be invoked in the context of DfcThread1
 	I2C_PRINT(("SlaveAsyncSimCallback\n"));
 	DSimulatedIicBusChannelSlaveI2c* channel = (DSimulatedIicBusChannelSlaveI2c*)aPtr;
-
-	// This will be invoked in the context of DfcThread1, so require
-	// synchronised access to iAsyncEvent and iRxTxTrigger
-	// Use local variables to enable early release of the spin lock
-	//
-	// If DfcThread1 runs on a separate core to the simulated I2C bus, the other core
-	// will have updated values, and since this core may cached copies, memory access
-	// should be observed. The spin lock mechanism is expected to incorpoate this.
-	TInt intState=__SPIN_LOCK_IRQSAVE(channel->iEventSpinLock);
-	
-	TAsyncEvent asyncEvent = channel->iAsyncEvent;
-	TInt rxTxTrigger = channel->iRxTxTrigger;
-	channel->iAsyncEvent = ENoEvent;
-	channel->iRxTxTrigger =  0;
-	__SPIN_UNLOCK_IRQRESTORE(channel->iEventSpinLock,intState);
-
-	switch(asyncEvent)
-		{
-		case (EAsyncChanCapture):
-			{
-			TInt r=KErrNone;// Just simulate successful capture
+	TInt r=KErrNone;// Just simulate successful capture
 #ifdef IIC_INSTRUMENTATION_MACRO
-			IIC_SCAPTCHANASYNC_END_PSL_TRACE;
+	IIC_SCAPTCHANASYNC_END_PSL_TRACE;
 #endif
-			channel->ChanCaptureCb(r);
-			break;
-			}
-		case (ERxWords):
-		case (ETxWords):
-		case (ERxTxWords):
-			{
-			channel->ChanNotifyClient(rxTxTrigger);
-			break;
-			}
-		default:
-			{
-			}
-		}
+	channel->ChanCaptureCb(r);
 	}
 
 #ifdef STANDALONE_CHANNEL
@@ -485,9 +454,8 @@
 #endif
 DSimulatedIicBusChannelSlaveI2c::DSimulatedIicBusChannelSlaveI2c(const DIicBusChannel::TBusType aBusType, const DIicBusChannel::TChannelDuplex aChanDuplex)
 	: DIicBusChannelSlave(aBusType,aChanDuplex,0), // 0 to be ignored by base class
-	iBlockedTrigger(0),iBlockNotification(EFalse),iAsyncEvent(ENoEvent),iRxTxTrigger(0),
-	iSlaveTimer(DSimulatedIicBusChannelSlaveI2c::SlaveAsyncSimCallback,this),
-	iEventSpinLock(TSpinLock::EOrderGenericIrqHigh2)  // Semi-arbitrary, high priority value (NTimer used)
+	iBlockedTrigger(0),iBlockNotification(EFalse),
+	iSlaveTimer(DSimulatedIicBusChannelSlaveI2c::SlaveAsyncSimCallback,this)
 	{
 	I2C_PRINT(("DSimulatedIicBusChannelSlaveI2c::DSimulatedIicBusChannelSlaveI2c, aBusType=%d,aChanDuplex=%d\n",aBusType,aChanDuplex));
 #ifndef STANDALONE_CHANNEL
@@ -520,10 +488,7 @@
 	IIC_SCAPTCHANASYNC_START_PSL_TRACE;
 #endif
 		// To simulate an asynchronous capture operation, just set a timer to expire
-		TInt intState=__SPIN_LOCK_IRQSAVE(iEventSpinLock);
-		iAsyncEvent = EAsyncChanCapture;
-		__SPIN_UNLOCK_IRQRESTORE(iEventSpinLock,intState);
-		iSlaveTimer.OneShot(KI2cSlaveAsyncDelaySim, ETrue); // Arbitrary timeout - expiry executes callback in context of DfcThread1
+		iSlaveTimer.OneShot(1000, ETrue); // Arbitrary timeout - expiry executes callback in context of DfcThread1
 		}
 	else
 		{
@@ -635,7 +600,7 @@
 
 void DSimulatedIicBusChannelSlaveI2c::ProcessData(TInt aTrigger, TIicBusSlaveCallback*  aCb)
 	{
-	I2C_PRINT(("DSimulatedIicBusChannelSlaveI2c::ProcessData trigger=0x%x\n",aTrigger));
+	I2C_PRINT(("DSimulatedIicBusChannelSlaveI2c::ProcessData\n"));
 	// fills in iReturn, iRxWords and/or iTxWords
 	//
 	if(aTrigger & ERxAllBytes)
@@ -666,6 +631,7 @@
 			iRxTxUnderOverRun&= ~ETxOverrun;
 			}
 		}
+
 	aCb->SetTrigger(aTrigger);
 	}
 
@@ -743,13 +709,8 @@
 			if(iBlockNotification == EFalse)
 				{
 				//
-				// Use a timer for asynchronous call to NotifyClient - this will invoke ProcessData and invoke the client callback
-				TInt intState=__SPIN_LOCK_IRQSAVE(iEventSpinLock);
-				// Tx may already have been requested, to add to the existing flags set in iRxTxTrigger
-				iRxTxTrigger |= trigger;
-				iAsyncEvent = ERxWords;
-				__SPIN_UNLOCK_IRQRESTORE(iEventSpinLock,intState);
-				iSlaveTimer.OneShot(KI2cSlaveAsyncDelaySim, ETrue); // Arbitrary timeout - expiry executes callback in context of DfcThread1
+				// Invoke DIicBusChannelSlave::NotifyClient - this will invoke ProcessData and invoke the client callback
+				NotifyClient(trigger);
 				}
 			else
 				{
@@ -823,14 +784,8 @@
 			if(iBlockNotification == EFalse)
 				{
 				//
-				// Use a timer for asynchronous call to NotifyClient - this will invoke ProcessData and invoke the client callback
-				TInt intState=__SPIN_LOCK_IRQSAVE(iEventSpinLock);
-				// Rx may already have been requested, to add to the existing flags set in iRxTxTrigger
-				iRxTxTrigger |= trigger;
-				iAsyncEvent = ETxWords;
-				__SPIN_UNLOCK_IRQRESTORE(iEventSpinLock,intState);
-				iSlaveTimer.OneShot(KI2cSlaveAsyncDelaySim, ETrue); // Arbitrary timeout - expiry executes callback in context of DfcThread1
-																	// No effect if OneShot already invoked
+				// Invoke DIicBusChannelSlave::NotifyClient - this will invoke ProcessData and invoke the client callback
+				NotifyClient(trigger);
 				}
 			else
 				{
@@ -913,13 +868,8 @@
 			if(iBlockNotification == EFalse)
 				{
 				//
-				// Use a timer for asynchronous call to NotifyClient - this will invoke ProcessData and invoke the client callback
-				TInt intState=__SPIN_LOCK_IRQSAVE(iEventSpinLock);
-				// Rx or Tx may already have been requested, to add to the existing flags set in iRxTxTrigger
-				iRxTxTrigger |= trigger;
-				iAsyncEvent = ERxTxWords;
-				__SPIN_UNLOCK_IRQRESTORE(iEventSpinLock,intState);
-				iSlaveTimer.OneShot(KI2cSlaveAsyncDelaySim, ETrue); // Arbitrary timeout - expiry executes callback in context of DfcThread1
+				// Invoke DIicBusChannelSlave::NotifyClient - this will invoke ProcessData and invoke the client callback
+				NotifyClient(trigger);
 				}
 			else
 				{
@@ -1039,8 +989,7 @@
 		default:
 			{
 			Kern::Printf("aFunction %d is not recognised \n",aFunction);
-			//For default case call the base class method for consistent handling
-            r=DIicBusChannelSlave::StaticExtension(aFunction,NULL,NULL);
+			r=KErrNotSupported;
 			}
 		}
 #ifdef IIC_INSTRUMENTATION_MACRO
@@ -1049,6 +998,12 @@
 	return r;
 	}
 
+
+
+//#ifdef MASTER_MODE
+#endif
+
+#if defined(MASTER_MODE) && defined(SLAVE_MODE)
 #ifdef STANDALONE_CHANNEL
 EXPORT_C
 #endif
@@ -1080,7 +1035,7 @@
 #ifndef STANDALONE_CHANNEL
 			r=DIicBusController::DeRegisterChannel(this);
 #else
-			r = KErrNotSupported;
+			return KErrNotSupported;
 #endif
 			break;
 			}
@@ -1099,13 +1054,15 @@
 		default:
 			{
 			Kern::Printf("aFunction %d is not recognised \n",aFunction);
-			//For default case call the base class method for consistent handling
-			r=DIicBusChannelMasterSlave::StaticExtension(aFunction,NULL,NULL);
+			r=KErrNotSupported;
 			}
 		}
 	return r;
 	}
 
 
+//#if defined(MASTER_MODE) && defined(SLAVE_MODE)
+#endif
 
 
+
--- a/kerneltest/e32test/iic/iic_psl/i2c.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/iic/iic_psl/i2c.h	Wed Sep 01 12:34:56 2010 +0100
@@ -42,15 +42,13 @@
 #endif/*STANDALONE_CHANNEL*/
 
 
+#if defined(MASTER_MODE)
 const TInt KI2cThreadPriority = 5; // Arbitrary, can be 0-7, 7 highest
+#endif
 
 const TInt16 KI2cSlaveChannelIdBase = 0x1D00;	// Arbitrary
 
-const TInt KI2cSlaveAsyncDelaySim = 20;	// Arbitrary delay, for timer to simulate asynchronous processing
-
-//Macros MASTER_MODE and SLAVE_MODE are intentionally omitted from this file
-//This is for master and slave stubs to exercise the channel class,
-//and we need these stubs for code coverage tests.
+#ifdef MASTER_MODE
 class DSimulatedIicBusChannelMasterI2c : public DIicBusChannelMaster
 	{
 	// platform specific implementation
@@ -87,7 +85,9 @@
 #ifndef STANDALONE_CHANNEL
 TInt8 DSimulatedIicBusChannelMasterI2c::iCurrentChanNum = KI2cChannelNumBase; // Initialise static member of DSimulatedIicBusChannelMasterI2c
 #endif
+#endif/*MASTER_MODE*/
 
+#ifdef SLAVE_MODE
 class DSimulatedIicBusChannelSlaveI2c : public DIicBusChannelSlave
 	{
 public:
@@ -110,16 +110,6 @@
 
 	inline void SetChanNum(TInt8 aChanNum) {iChannelNumber = aChanNum;};
 
-	enum TAsyncEvent
-		{
-		ENoEvent = 0,
-		EAsyncChanCapture,
-		ERxWords,
-		ETxWords,
-		ERxTxWords
-		};
-	inline void ChanNotifyClient(TInt aTrigger) {NotifyClient(aTrigger);}
-
 	protected:
 		virtual void SendBusErrorAndReturn() {return;} // Not implemented in simulated PSL
 
@@ -142,13 +132,11 @@
 		TInt iBlockedTrigger;
 		TBool iBlockNotification;
 
-		TAsyncEvent iAsyncEvent;
-		TInt iRxTxTrigger;
+		NTimer iSlaveTimer; // Used to simulate an asynchronous capture operation
+		};
+#endif/*SLAVE_MODE*/
 
-		NTimer iSlaveTimer; // Used to simulate an asynchronous capture operation
-		TSpinLock iEventSpinLock; // To serialise simulated bus events - Rx, Tx or Rx+Tx
-		};
-
+#if defined(MASTER_MODE) && defined(SLAVE_MODE)
 class DSimulatedIicBusChannelMasterSlaveI2c : public DIicBusChannelMasterSlave
 	{
 public:
@@ -159,5 +147,6 @@
 				
 	TInt StaticExtension(TUint aFunction, TAny* aParam1, TAny* aParam2);	
 	};
+#endif/*(MASTER_MODE) && (SLAVE_MODE)*/
 
 #endif /*I2C_H_*/
--- a/kerneltest/e32test/iic/iic_psl/i2c_ctrless.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/iic/iic_psl/i2c_ctrless.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -39,7 +39,7 @@
 macro SLAVE_MODE
 
 // un-comment the following if debug printing is required
-//macro LOG_I2C
+macro LOG_I2C
 
 // un-comment the following if BTRACE output is required
 macro IIC_INSTRUMENTATION_MACRO
--- a/kerneltest/e32test/iic/iic_psl/i2c_masterstubs_ctrless.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +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/iic/iic_psl/i2c_masterstubs_ctrless.mmp
-//
-
-macro STANDALONE_CHANNEL
-#define STANDALONE_CHANNEL /*Only for iic_channel.mmh to pick up the needed source files*/
-
-#include "../../../../kernel/eka/drivers/iic/iic_channel.mmh"
-
-//enable the SLAVE_MODE so all the functions defined in SLAVE_MODE can be tested.
-macro SLAVE_MODE
-
-
-target          i2c_masterstubs_ctrless.pdd
-targettype      pdd
-
-sourcepath	../../../../kernel/eka/drivers/iic
-source		IIC_PIL_SOURCE
-
-sourcepath		.
-source          i2c.cpp
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-macro IIC_SIMULATED_PSL
-macro BUS_TYPE=(DIicBusChannel::EI2c)
-
-// un-comment the following if debug printing is required
-//macro LOG_I2C
-
-// un-comment the following if BTRACE output is required
-macro IIC_INSTRUMENTATION_MACRO
-
-deffile				../../~/i2c_masterstubs_ctrless.def
-
-uid			0x100039d0 0x10286b50
-VENDORID 0x70000001
-
-//library				ecust.lib
-#ifdef WINS
-library				emulator.lib
-#endif 
-
-start wins
-win32_library			kernel32.lib
-#if defined(VC32)
-win32_library			msvcrt.lib
-#endif
-end
-
-SMPSAFE
\ No newline at end of file
--- a/kerneltest/e32test/iic/iic_psl/i2c_slavestubs_ctrless.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +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/iic/iic_psl/i2c_slave_stubs_ctrless.mmp
-//
-
-macro STANDALONE_CHANNEL
-#define STANDALONE_CHANNEL /*Only for iic_channel.mmh to pick up the needed source files*/
-
-#include "../../../../kernel/eka/drivers/iic/iic_channel.mmh"
-
-macro MASTER_MODE
-
-target          i2c_slavestubs_ctrless.pdd
-targettype      pdd
-
-sourcepath	../../../../kernel/eka/drivers/iic
-source		IIC_PIL_SOURCE
-
-sourcepath		.
-source          i2c.cpp
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-macro IIC_SIMULATED_PSL
-macro BUS_TYPE=(DIicBusChannel::EI2c)
-
-// un-comment the following if debug printing is required
-//macro LOG_I2C
-
-// un-comment the following if BTRACE output is required
-macro IIC_INSTRUMENTATION_MACRO
-
-deffile				../../~/i2c_slavestubs_ctrless.def
-
-uid			0x100039d0 0x10286b50
-VENDORID 0x70000001
-
-//library				ecust.lib
-#ifdef WINS
-library				emulator.lib
-#endif 
-
-start wins
-win32_library			kernel32.lib
-#if defined(VC32)
-win32_library			msvcrt.lib
-#endif
-end
-
-SMPSAFE
-
--- a/kerneltest/e32test/iic/iic_psl/iic_client.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/iic/iic_psl/iic_client.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -90,7 +90,7 @@
 class DIicClientChan : public DBase
 	{
 public:
-	DIicClientChan(DIicBusChannel* aChan, TInt8 aChanNum, TUint8 aChanType):iChanNumber(aChanNum),iChanType(aChanType),iChan(aChan){};
+	DIicClientChan(DIicBusChannel* aChan, TInt8 aChanNum, TUint8 aChanType):iChan(aChan),iChanNumber(aChanNum),iChanType(aChanType){};
 	~DIicClientChan();
 	TInt GetChanNum()const {return iChanNumber;};
 	TUint8 GetChanType()const {return iChanType;};
@@ -112,13 +112,8 @@
 
 
 #ifdef STANDALONE_CHANNEL
-#ifdef IIC_STUBS
-_LIT(KLddRootName,"iic_client_stubs");
+_LIT(KLddRootName,"iic_client_ctrless");
 #else
-_LIT(KLddRootName,"iic_client_ctrless");
-#endif/*IIC_STUBS*/
-
-#else/*STANDALONE_CHANNEL*/
 _LIT(KLddRootName,"iic_client");
 #endif
 _LIT(KIicClientThreadName,"IicClientLddThread");
@@ -408,7 +403,6 @@
 	TInt StaticExtension(TUint aId, TUint aFunction, TAny* aParam1, TAny* aParam2);
 	TInt CaptureChannel(TInt aBusId, TDes8* aConfigHdr, TIicBusSlaveCallback* aCallback, TInt& aChannelId, TBool aAsynch=NULL);
 	TInt ReleaseChannel(TInt aChannelId);
-	TInt Spare1(TInt aBusId);
 	public:
 	inline void Lock() {Kern::MutexWait(*iArrayMutex);}
 	inline void Unlock() {Kern::MutexSignal(*iArrayMutex);}
@@ -505,7 +499,7 @@
 // Constructor
     {
 	CLIENT_PRINT(("> DDeviceIicClient::DDeviceIicClient()"));
-    __KTRACE_OPT(KIIC, Kern::Printf("> DDeviceIicClient::DDeviceIicClient()"));
+    __KTRACE_OPT(KRESMANAGER, Kern::Printf("> DDeviceIicClient::DDeviceIicClient()"));
     iParseMask=0;		// No info, no PDD, no Units
     iUnitsMask=0;
     iVersion=TVersion(KIicClientMajorVersionNumber,
@@ -535,7 +529,7 @@
 DDeviceIicClient::~DDeviceIicClient()
     {
 	CLIENT_PRINT(("> DDeviceIicClient::~DDeviceIicClient()"));
-    __KTRACE_OPT(KIIC, Kern::Printf("> DDeviceIicClient::~DDeviceIicClient()"));
+    __KTRACE_OPT(KRESMANAGER, Kern::Printf("> DDeviceIicClient::~DDeviceIicClient()"));
 #ifdef STANDALONE_CHANNEL
     //For Standalone Channel, the client is responsible for channel destroy
     ChannelArray.ResetAndDestroy();
@@ -546,7 +540,7 @@
 // Install the device driver.
     {
 	CLIENT_PRINT(("> DDeviceIicClient::Install()"));
-    __KTRACE_OPT(KIIC, Kern::Printf("> DDeviceIicClient::Install()"));
+    __KTRACE_OPT(KRESMANAGER, Kern::Printf("> DDeviceIicClient::Install()"));
     return(SetName(&KLddRootName));
     }
 
@@ -769,7 +763,7 @@
 	DIicClientChan* aClientChan;
 	TInt r = KErrNone;
 	DIicBusChannel *chan = NULL, *chanM = NULL, *chanS = NULL;
-	TUint i;
+	TInt i;
 	for(i=0; i<NUM_CHANNELS_SPI; i++)
 		{
 		CLIENT_PRINT(("\n"));
@@ -1025,7 +1019,7 @@
 // Destructor
     {
 	CLIENT_PRINT(("> DChannelIicClient::~DChannelIicClient()"));
-    __KTRACE_OPT(KIIC, Kern::Printf("> DChannelIicClient::~DChannelIicClient()"));
+    __KTRACE_OPT(KRESMANAGER, Kern::Printf("> DChannelIicClient::~DChannelIicClient()"));
     delete iNotif;
     iArrayMutex->Close(NULL);
     iChanArrWrtSem->Close(NULL);
@@ -1330,56 +1324,6 @@
     return r;
 	}
 
-//this function is added for improving the code coverage of IIC.
-//Spare1 is a placeholder for future expansion, and so returns KErrNotSupported.
-#ifdef STANDALONE_CHANNEL
-TInt DChannelIicClient::Spare1(TInt aBusId)
-    {
-    TInt r = KErrNone;
-
-    TInt chanIndex = 0;
-    DIicClientChan* chanPtr = NULL;
-    if(r == KErrNone)
-        {
-        r = GetChanPtr(aBusId, chanIndex, chanPtr);
-        if(r == KErrNone)
-            {
-            if(!chanPtr)
-                {
-                r = KErrArgument;
-                }
-            else
-                {
-                switch(chanPtr->GetChanType())
-                    {
-                    case DIicBusChannel::EMaster:
-                        {
-                        r = ((DIicBusChannelMaster*)(chanPtr->GetChannelPtr()))->Spare1(0,NULL,NULL);
-                        break;
-                        }
-                    case DIicBusChannel::EMasterSlave:
-                        {
-                        r = KErrNotSupported;
-                        break;
-                        }
-                    case DIicBusChannel::ESlave:
-                        {
-                        r = ((DIicBusChannelSlave*)(chanPtr->GetChannelPtr()))->Spare1(0,NULL,NULL);
-                        break;
-                        }
-                    default:
-                        {
-                        r = KErrArgument;
-                        }
-                    }
-                }
-            }
-        }
-    return r;
-    }
-#endif
-
-#ifndef IIC_STUBS
 void DChannelIicClient::DoCancel(TInt aMask)
 	{
 // Cancel an outstanding request.
@@ -1462,68 +1406,7 @@
 
 	return;
 	}
-#else/*IIC_STUBS*/
-//should only be called in IIC_STUBS mode
-//DoCancel is used to cancel an asynchronous request which is still waiting in the queue and
-//has not yet been handled by IIC.
-//In the stub test, QueueTransaction should always return a KErrNotSupported error code
-//So we pretend there is an request waiting in the queue that can be cancelled by calling DoCancel.
-void DChannelIicClient::DoCancel(TInt aMask)
-    {
-    // Cancel an outstanding request.
-    CLIENT_PRINT(("DChannelIicClient::DoCancel invoked with aMask=0x%x\n", aMask));
 
-    // inline void CancelAsyncOperation(TRequestStatus* aStatus, TInt aBusId)   {TInt* parms[2]; parms[0]=(TInt*)aStatus; parms[1]=(TInt*)aBusId;DoCancel((TInt)&parms[0]);}
-    // aMask has the address on TInt* parms[2]
-    // parms[0] = TRequestStatus pointer
-    // parms[1] = Bus Identifier
-    TInt* parms[2];
-    TInt r=Kern::ThreadRawRead(iClient,(TAny*)aMask,&(parms[0]),2*sizeof(TInt*));
-    if(r!=KErrNone)
-        {
-        CLIENT_PRINT(("DChannelIicClient::DoCancel ERROR - Can't read parms[]\n"));
-        return; // Can't proceed if can't access request parameters
-        }
-    CLIENT_PRINT(("DChannelIicClient::DoCancel - TRequestStatus 0x%x, BusID = 0x%x\n",parms[0],parms[1]));
-    TRequestStatus* status= (TRequestStatus*)(parms[0]);
-    
-    //A valid transaction object is required here in order to exercise the API
-    TInt busIdI2c = (TInt)(parms[1]);
-    TConfigI2cBufV01* i2cBuf=NULL;
-    SET_BUS_TYPE(busIdI2c,EI2c);
-    SET_CHAN_NUM(busIdI2c,10);
-    // aDeviceId=1 ... 100kHz ... aTimeoutPeriod=100 ... aTransactionWaitCycles=10 - arbitrary paarmeters.
-    r=CreateI2cBuf(i2cBuf, EI2cAddr7Bit, 36, ELittleEndian, 100);
-    if(r!=KErrNone)
-        {
-        CLIENT_PRINT(("DChannelIicClient::DoCancel ERROR - Can't allocate memory for I2c buffer\n"));
-        return; // Can't proceed if can't access request parameters
-        }
-
-    TIicBusTransfer* tfer = new TIicBusTransfer(TIicBusTransfer::EMasterWrite,8,i2cBuf);
-    if(tfer == NULL) 
-        {
-        CLIENT_PRINT(("DChannelIicClient::DoCancel ERROR - Can't allocate memory for the transfer\n"));
-        delete i2cBuf; 
-        return;
-        }
-
-    TIicBusTransaction* transac = new TIicBusTransaction((TDes8*)i2cBuf, tfer);
-    if(transac == NULL) 
-        {
-        CLIENT_PRINT(("DChannelIicClient::DoCancel ERROR - Can't allocate memory for the transaction\n"));
-        delete i2cBuf; 
-        delete tfer; 
-        return;
-        }
-
-    r = CancelTransaction(busIdI2c, transac);
-    Kern::RequestComplete(iClient, status, r);
-    delete i2cBuf;
-    delete tfer;
-    delete transac;
-    }
-#endif/*IIC_STUBS*/
 
 // Function to support preamble testing
 void PreambleCallbackFunc(TIicBusTransaction* /*aTrans*/, TAny* aParam)
@@ -2192,6 +2075,7 @@
 	delete iI2cBuf;
 	iI2cBuf=NULL;
 	TIicBusTransfer* currTfer = iTfer;
+	TIicBusTransfer* nextTfer = NULL;
 	while(currTfer)
 		{
 		TIicBusTransfer* nextTfer = (TIicBusTransfer*)(currTfer->Next());
@@ -2203,6 +2087,7 @@
 		};
 	iTfer=NULL;
 	currTfer = iFdTfer;
+	nextTfer = NULL;
 	while(currTfer)
 		{
 		TIicBusTransfer* nextTfer = (TIicBusTransfer*)(currTfer->Next());
@@ -2512,17 +2397,8 @@
             r = channelInterface.TestInterface();
             break;         
             }
-        case(RBusDevIicClient::ETestSpare1):
-            {
-            r = Spare1((TInt)a1);
-            break;
-            }
-        case(RBusDevIicClient::ETestStaticEx):
-            {
-            r = StaticExtension((TUint32)a1, (TUint)RBusDevIicClient::ECtlIoNone, NULL, NULL);
-            break;
-            }
 #endif
+        
         default:
 			{
 			CLIENT_PRINT(("DChannelIicClient::DoControl - unrecognised value for aId=0x%x\n",aId));
--- a/kerneltest/e32test/iic/iic_psl/iic_slaveclient.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/iic/iic_psl/iic_slaveclient.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -67,7 +67,7 @@
 class DIicSlaveClientChan : public DBase
 	{
 public:
-	DIicSlaveClientChan(DIicBusChannel* aChan, TInt8 aChanNum, TInt aChanType):iChanNumber(aChanNum),iChanType(aChanType),iChan(aChan){};
+	DIicSlaveClientChan(DIicBusChannel* aChan, TInt8 aChanNum, TInt aChanType):iChan(aChan),iChanNumber(aChanNum),iChanType(aChanType){};
 	~DIicSlaveClientChan();
 	TInt GetChanNum()const {return iChanNumber;};
 	TInt GetChanType()const {return iChanType;};
@@ -93,11 +93,7 @@
 const TInt KMaxNumChannels = 2;	// 1 "true" slave, one "dummy"
 
 #ifdef STANDALONE_CHANNEL
-#ifdef IIC_STUBS
-_LIT(KLddRootName,"iic_slaveclient_stubs");
-#else
 _LIT(KLddRootName,"iic_slaveclient_ctrless");
-#endif/*IIC_STUBS*/
 #else
 _LIT(KLddRootName,"iic_slaveclient");
 #endif
@@ -168,9 +164,6 @@
 	TInt RegisterTxBuffer(TInt aChannelId, TPtr8 aTxBuffer, TInt8 aBufGranularity, TInt8 aNumWords, TInt8 aOffset);
 	TInt CaptureChannel(TInt aBusId, TDes8* aConfigHdr, TIicBusSlaveCallback* aCallback, TInt& aChannelId, TBool aAsynch=NULL);
 	TInt ReleaseChannel(TInt aChannelId);
-#ifdef STANDALONE_CHANNEL
-	TInt Spare1(TInt aBusId);
-#endif
 	private:
 	TDynamicDfcQue* iDfcQue;
 	TIicBusSlaveCallback* iNotif;
@@ -214,7 +207,7 @@
 	TInt iFullDuplexReq;
 	TInt iBlockedTrigger;
 
-	enum TTestOverUnderState
+	typedef enum TTestOverUnderState
 		{
 		EStartState  = 0x1,
 		ERxOverrun_1,
@@ -478,13 +471,6 @@
 	DIicSlaveClientChan* aChanPtr = NULL;
 	if(iCapturedChan.iChannelId == aChannelId)
 		aChanPtr = iCapturedChan.iChannel;
-#ifdef IIC_STUBS
-	//in the code coverage tests, a slave channel will not be captured before other slave
-	//operations get called, e.g. calling DIicBusChannelSlave::CaptureChannel in MASTER_MODE
-	//should return a KErrNotSupported. In controller-less mode, the client creates and manages its own channels.
-	//So in here, we pretend a slave channel has been captured and can be used for the current operation.
-	aChanPtr=iCapturedChan.iChannel;
-#endif/*IIC_STUBS*/
 	if(!aChanPtr)
 		return KErrArgument;
 	if(aChanPtr->GetChanType() == DIicBusChannel::EMasterSlave)
@@ -504,13 +490,6 @@
 	DIicSlaveClientChan* aChanPtr = NULL;
 	if(iCapturedChan.iChannelId == aChannelId)
 		aChanPtr = iCapturedChan.iChannel;
-#ifdef IIC_STUBS
-    //in the code coverage tests, a slave channel will not be captured before other slave
-	//operations get called, e.g. calling DIicBusChannelSlave::CaptureChannel in MASTER_MODE
-	//should return a KErrNotSupported. In controller-less mode, the client creates and manages its own channels.
-	//So in here, we pretend a slave channel has been captured and can be used for the current operation.
-    aChanPtr=iCapturedChan.iChannel;
-#endif/*IIC_STUBS*/
 	if(!aChanPtr)
 		return KErrArgument;
 	if(aChanPtr->GetChanType() == DIicBusChannel::EMasterSlave)
@@ -550,13 +529,6 @@
 	DIicSlaveClientChan* aChanPtr = NULL;
 	if(iCapturedChan.iChannelId == aChannelId)
 		aChanPtr = iCapturedChan.iChannel;
-#ifdef IIC_STUBS
-    //in the code coverage tests, a slave channel will not be captured before other slave
-	//operations get called, e.g. calling DIicBusChannelSlave::CaptureChannel in MASTER_MODE
-	//should return a KErrNotSupported. In controller-less mode, the client creates and manages its own channels.
-	//So in here, we pretend a slave channel has been captured and can be used for the current operation.
-    aChanPtr=iCapturedChan.iChannel;
-#endif/*IIC_STUBS*/
 	if(!aChanPtr)
 		return KErrArgument;
 	if(aChanPtr->GetChanType() == DIicBusChannel::EMasterSlave)
@@ -617,13 +589,6 @@
 						r = KErrArgument;
 						}
 					}
-#ifdef IIC_STUBS
-				//if we try to capture a slave channel in MASTER_MODE, the capture should fail with KErrNotSupported.
-				//However, we need a slave channel to be captured before running most of slave operation 
-				//tests,e.g. RegisterRxBuf. So in here, we pretend the channel is captured, and save
-				//the channel pointer in iCapturedChan, so it can be used for other slave operation tests. 
-				iCapturedChan.iChannel = chanPtr;
-#endif/*IIC_STUBS*/
 				// For synchronous capture, if successful then install the channel
 				if(r == KErrNone)
 					{
@@ -665,54 +630,6 @@
 #endif
 	return r;
 	}
-
-//this function is added for improving the code coverage of IIC.
-//Spare1 is a placeholder for future expansion, so returns KErrNotSupported.
-#ifdef STANDALONE_CHANNEL
-TInt DChannelIicSlaveClient::Spare1(TInt aBusId)
-    {
-    TInt r = KErrNone;
-    DIicSlaveClientChan* chanPtr = NULL;
-    if(r == KErrNone)
-        {
-        r = GetChanPtr(aBusId, chanPtr);
-        if(r == KErrNone)
-            {
-            if(!chanPtr)
-                {
-                r = KErrArgument;
-                }
-            else
-                {
-                switch(chanPtr->GetChanType())
-                    {
-                    case DIicBusChannel::EMaster:
-                        {
-                        r = ((DIicBusChannelMaster*)(chanPtr->GetChannelPtr()))->Spare1(0,NULL,NULL);
-                        break;
-                        }
-                    case DIicBusChannel::EMasterSlave:
-                        {
-                        r = KErrNotSupported;
-                        break;
-                        }
-                    case DIicBusChannel::ESlave:
-                        {
-                        r = ((DIicBusChannelSlave*)(chanPtr->GetChannelPtr()))->Spare1(0,NULL,NULL);
-                        break;
-                        }
-                    default:
-                        {
-                        r = KErrArgument;
-                        }
-                    }
-                }
-            }
-        }
-    return r;
-    }
-#endif
-
 TInt DChannelIicSlaveClient::CbProcessOverUnderRunRxTx()
 	{
 	CLIENT_PRINT(("> DChannelIicSlaveClient::CbProcessOverUnderRunRxTx(), iTestOverUnderState=%d\n",iTestOverUnderState));
@@ -1418,13 +1335,7 @@
 				iFullDuplexReq |= (ERxAllBytes|ETxAllBytes);
 			r = SetNotificationTrigger(parms[0],parms[1]);
 			if(r == KErrTimedOut)
-			    {
-                //the TRequestStatus is being completed with the error code to indicate 
-                //that the timeout was detected, but KErrNone is returned because 
-                //the requested notification settings were accepted.
-                Kern::RequestComplete(iClient, iStatus, r);
 				r=KErrNone;	// KErrTimedOut is returned if the Client has not interacted with IIC for a while
-			    }			
 			break;
 			}
 
@@ -1505,6 +1416,7 @@
 				iExpectedTrigger |= tempTrigger;
 			else
 				iBlockedTrigger |= tempTrigger;
+
 			// The bytes "transmitted" are stored in the simulated bus' iTxCheckBuf
 			// Since the simulated bus channel is also in the kernel process it shares the same address space
 			// Get the address of the buffer
@@ -1556,6 +1468,7 @@
 				iExpectedTrigger |= tempTrigger;
 			else
 				iBlockedTrigger |= tempTrigger;
+
 			// The bytes "transmitted" are stored in the simulated bus' iTxCheckBuf
 			// Since the simulated bus channel is also in the kernel process it shares the same address space
 			// Get the address of the buffer
@@ -1621,23 +1534,7 @@
 			r = StaticExtension((TUint)a1, (TUint)ctrlIoVal, NULL, NULL);
 			break;
 			}
-#ifdef STANDALONE_CHANNEL
-		 case(RBusDevIicClient::ETestSpare1):
-            {
-            //a1 represents a BusId passed from the user.
-			//Spare1 is a placeholder for future expansion.
-            r = Spare1((TInt)a1);
-            break;
-            }
-		 case(RBusDevIicClient::ETestStaticEx):
-            {
-		    //Passing a1, which represents a BusId, and the value of a function to StaticExtension.
-			//Using ECtlIoNone here, so StaticExtension will be called to execute the default case,
-			// but since this is only called when using stubs KErrNotSupported will be expected.
-            r = StaticExtension((TUint32)a1, (TUint)RBusDevIicClient::ECtlIoNone, NULL, NULL);
-            break;
-            }
-#endif
+
 		default:
 			{
 			CLIENT_PRINT(("DChannelIicSlaveClient::DoControl - unrecognised value for aId=0x%x\n",aId));
--- a/kerneltest/e32test/iic/iic_psl/iic_testpsl.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +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/iic/iic_psl/iic_testpsl.cpp
-//
-
-#include <drivers/iic.h>
-#include "iic_testpsl.h"
-
-// Global Controller pointer
-extern DIicBusController*& gTheController;
-
-#ifndef IIC_SIMULATED_PSL
-
-#error iic_testpsl.cpp being built when IIC_SIMULATED_PSL is not defined
-
-#else
-
-TVersion DIicPdd::VersionRequired()
-	{
-	const TInt KIicMajorVersionNumber=1;
-	const TInt KIicMinorVersionNumber=0;
-	const TInt KIicBuildVersionNumber=KE32BuildVersionNumber;
-	return TVersion(KIicMajorVersionNumber,KIicMinorVersionNumber,KIicBuildVersionNumber);
-	}
-
-/** Factory class constructor */
-DIicPdd::DIicPdd()
-	{
-    iVersion = DIicPdd::VersionRequired();
-	}
-
-DIicPdd::~DIicPdd()
-	{
-	delete gTheController;
-	}
-
-TInt DIicPdd::Install()
-    {
-    return(SetName(&KPddName));
-    }
-
-/**  Called by the kernel's device driver framework to create a Physical Channel. */
-TInt DIicPdd::Create(DBase*& /*aChannel*/, TInt /*aUint*/, const TDesC8* /*anInfo*/, const TVersion& /*aVer*/)
-    {
-    return KErrNone;
-    }
-
-/**  Called by the kernel's device driver framework to check if this PDD is suitable for use with a Logical Channel.*/
-TInt DIicPdd::Validate(TInt /*aUnit*/, const TDesC8* /*anInfo*/, const TVersion& aVer)
-    {
-   	if (!Kern::QueryVersionSupported(DIicPdd::VersionRequired(),aVer))
-		return(KErrNotSupported);
-    return KErrNone;
-    }
-
-/** Return the driver capabilities */
-void DIicPdd::GetCaps(TDes8& aDes) const
-    {
-	// Create a capabilities object
-	TCaps caps;
-	caps.iVersion = iVersion;
-	// Zero the buffer
-	TInt maxLen = aDes.MaxLength();
-	aDes.FillZ(maxLen);
-	// Copy cpabilities
-	TInt size=sizeof(caps);
-	if(size>maxLen)
-	   size=maxLen;
-	aDes.Copy((TUint8*)&caps,size);
-    }
-
-static DIicPdd* TheIicPdd;
-
-DECLARE_STANDARD_PDD()
-	{
-	gTheController = new DIicBusController;
-	if(!gTheController)
-		return NULL;
-	TInt r = gTheController->Create();
-	if(r == KErrNone)
-		{
-		TheIicPdd = new DIicPdd;
-		if(TheIicPdd)
-			return TheIicPdd;
-		}
-	
-	delete gTheController; 
-	return NULL;
-	}
-
-#endif/*IIC_SIMULATED_PSL*/
-
-
-
-
--- a/kerneltest/e32test/iic/iic_psl/iic_testpsl.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +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/iic/iic_psl/iic_testpsl.h
-//
-
-#ifndef IIC_TEST_PSL_H_
-#define IIC_TEST_PSL_H_
-
-_LIT(KPddName,"iic.pdd");
-
-NONSHARABLE_CLASS(DIicPdd) : public DPhysicalDevice
-	{
-// Class to faciliate loading of the IIC classes
-public:
-	class TCaps
-		{
-	public:
-		TVersion iVersion;
-		};
-public:
-	DIicPdd();
-	~DIicPdd();
-	virtual TInt Install();
-	virtual TInt Create(DBase*& aChannel, TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
-	virtual TInt Validate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
-	virtual void GetCaps(TDes8& aDes) const;
-	inline static TVersion VersionRequired();
-	};
-
-#endif
--- a/kerneltest/e32test/iic/iic_psl/iic_testpsl.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/iic/iic_psl/iic_testpsl.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -28,11 +28,9 @@
 
 sourcepath			../../../../kernel/eka/drivers/iic
 source				iic.cpp iic_transaction.cpp
-sourcepath			.
-source				iic_testpsl.cpp
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-USERINCLUDE		. ../../../../kernel/eka/drivers/iic
+USERINCLUDE		../../../../kernel/eka/drivers/iic
 
 // un-comment the following if BTRACE output is required
 macro IIC_INSTRUMENTATION_MACRO
--- a/kerneltest/e32test/iic/iic_psl/spi.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/iic/iic_psl/spi.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -19,7 +19,6 @@
 #include <drivers/iic_trace.h>
 #endif
 
-#ifndef STANDALONE_CHANNEL
 #define NUM_CHANNELS 4 // Arbitrary
 
 // Macros to be updated(?) with interaction with Configuration Repository
@@ -27,7 +26,6 @@
 #define CHANNEL_TYPE(n) (KChannelTypeArray[n])	
 const DIicBusChannel::TChannelDuplex KChannelDuplexArray[NUM_CHANNELS] = {DIicBusChannel::EHalfDuplex, DIicBusChannel::EHalfDuplex, DIicBusChannel::EHalfDuplex, DIicBusChannel::EFullDuplex};
 #define CHANNEL_DUPLEX(n) (KChannelDuplexArray[n]) 
-#endif/*STANDALONE_CHANNEL*/
 
 #ifdef LOG_SPI
 #define SPI_PRINT(str) Kern::Printf str
@@ -124,10 +122,8 @@
 	aDes.Copy((TUint8*)&caps,size);
     }
 
-#ifndef STANDALONE_CHANNEL
 // supported channels for this implementation
 static DIicBusChannel* ChannelPtrArray[NUM_CHANNELS];
-#endif
 
 //DECLARE_EXTENSION_WITH_PRIORITY(BUS_IMPLMENTATION_PRIORITY)	
 DECLARE_STANDARD_PDD()		// SPI test driver to be explicitly loaded as an LDD, not kernel extension
@@ -491,7 +487,10 @@
 TInt DSimulatedIicBusChannelMasterSpi::DoSimulatedTransaction()
 	{
 	TInt r = AsynchStateMachine(EHwTransferDone);
-	CancelTimeOut();
+	if(iTimeoutTimer.Cancel() == FALSE)
+		{
+		SPI_PRINT(("timer is not cancelled"));
+		}
 	return r;
 	}
 
--- a/kerneltest/e32test/iic/t_iic.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/iic/t_iic.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -37,28 +37,13 @@
 _LIT(KIicProxyFileNameRoot, "iic_client");
 _LIT(KIicProxySlaveFileName, "iic_slaveclient.ldd");	// Kernel-side proxy LDD acting as a slave client of the IIC
 _LIT(KIicProxySlaveFileNameRoot, "iic_slaveclient");
-//These are used to exercise stub functions.
-_LIT(KIicProxyFileNameStubs, "iic_client_stubs.ldd");
-_LIT(KIicProxyFileNameRootStubs, "iic_client_stubs");
-_LIT(KIicProxySlaveFileNameStubs, "iic_slaveclient_stubs.ldd");
-_LIT(KIicProxySlaveFileNameRootStubs, "iic_slaveclient_stubs");
-
 
 #ifdef IIC_SIMULATED_PSL
 _LIT(KSpiFileNameCtrlLess, "spi_ctrless.pdd");	// Simulated PSL bus implementation
-_LIT(KI2cFileNameCtrlLess, "i2c_ctrless.pdd");  // Simulated PSL bus implementation
+_LIT(KI2cFileNameCtrlLess, "i2c_ctrless.pdd");	// Simulated PSL bus implementation
 _LIT(KIicPslFileName, "iic_testpsl.pdd");	// Simulated PSL implementation
 _LIT(KSpiFileName, "spi.pdd");	// Simulated PSL bus implementation
-_LIT(KI2cFileName, "i2c.pdd");  // Simulated PSL bus implementation
-//These are used to exercise stubs. The I2C pdd to use for stub tests will depend on
-//whether Master, Slave mode has been selected. 
-#if defined(MASTER_MODE)&&!defined(SLAVE_MODE)
-_LIT(KI2cFileNameStubs, "i2c_slavestubs_ctrless.pdd");
-#elif !defined(MASTER_MODE)&& defined(SLAVE_MODE)
-_LIT(KI2cFileNameStubs, "i2c_masterstubs_ctrless.pdd");
-#else
-_LIT(KI2cFileNameStubs, "i2c_ctrless.pdd");
-#endif
+_LIT(KI2cFileName, "i2c.pdd");	// Simulated PSL bus implementation
 #endif
 
 _LIT(KIicPslFileNameRoot, "iic.pdd");
@@ -745,9 +730,6 @@
 //!						    of words. Wait for the TRequestStatus to be completed (with KErrNone). Specify a notification trigger for Tx and
 //!							Tx Overrun, then use controlIO to instruct the simulated bus to unblock Master responses.Wait for the TRequestStatus
 //!							to be completed.
-//!         
-//!                     12) Test the PIL behavior for a client timeout: request notification of an event but deliberately delay the client response.  
-//!                         The PIL should return KErrTimedOut when a subsequent request for a notification is made.
 //!
 //! @SYMTestExpectedResults 0) Kernel-side proxy client should return with KErrNone, exits otherwise.
 //!						1) Kernel-side proxy client should return with KErrNone, exits otherwise.
@@ -768,9 +750,6 @@
 //!						   TRequestStatus should be set to KErrNone, exits otherwise.
 //!						11) Kernel-side proxy client should return with KErrNone for each API call, exits otherwise. The associated
 //!						   TRequestStatus should be set to KErrNone in both cases, exits otherwise.
-//!                     12) Kernel-side proxy client should return with KErrNone for each API call, exits otherwise. The associated
-//!                        TRequestStatus should be set to KErrNone in both cases, exits otherwise, except for when the client response
-//!                        exceeds the timeout period, and the next request for a notification expects KErrTimedOut.
 //!
 //! @SYMTestPriority        High
 //! @SYMTestStatus          Implemented
@@ -1169,6 +1148,10 @@
 	gTest.Printf(_L("BlockNotification\n"));
 	r=gChanSlaveI2c.BlockNotification(busIdI2c, chanId);
 	gTest(r==KErrNone);
+	// Now instruct the bus implementation to represent the bus master attempting to read the required number of words
+	gTest.Printf(_L("\nStarting SimulateTxNWords\n"));
+	r=gChanSlaveI2c.SimulateTxNWords(busIdI2c, chanId, 12);
+	gTest(r==KErrNone);
 	//
 	// Wait for the notification
 	User::WaitForRequest(status);
@@ -1179,10 +1162,6 @@
 		gTest(r==KErrNone);
 		}
 	gTest.Printf(_L("Blocked notification test completed OK\n"));
-    // Now instruct the bus implementation to represent the bus master attempting to read the required number of words
-    gTest.Printf(_L("\nStarting SimulateTxNWords\n"));
-    r=gChanSlaveI2c.SimulateTxNWords(busIdI2c, chanId, 12);
-    gTest(r==KErrNone);
 	// Re-set the notification trigger - for the 'blocked' Tx
 	// This is required because, in the event of a bus error, the set of requested Rx,Tx
 	// flags are cleared
@@ -1210,50 +1189,6 @@
 	r=gChanSlaveI2c.SetNotificationTrigger(chanId,triggerMask,&status);
 	gTest(r==KErrNone);
 
-	//Test the PIL behavior for a client timeout: request notification of an event
-	//but deliberately delay the client response. The PIL should return KErrTimedOut 
-	//when a subsequent request for a notification is made.
-	gTest.Printf(_L("Starting test for SendBusErrorAndReturn.\n"));
-	
-	// For Rx, specify buffer granularity=4 (32-bit words), 8 words to receive, offset of 16 bytes
-	// 64 bytes as 16 words: words 0-3 offset, words 4-11 data, words 12-15 unused
-	gTest.Printf(_L("Starting RegisterRxBuffer\n"));
-	r=gChanSlaveI2c.RegisterRxBuffer(chanId, 4, 8, 16);
-	gTest(r==KErrNone);
-
-	// Now set the notification trigger
-	//TRequestStatus status;
-	triggerMask=ERxAllBytes;
-	
-    gTest.Printf(_L("Starting SetNotificationTrigger with ERxAllBytes\n"));
-    r=gChanSlaveI2c.SetNotificationTrigger(chanId,triggerMask,&status);
-    gTest(r==KErrNone);
-    // Now instruct the bus implementation to represent receipt of the required number of words from the bus master.
-    gTest.Printf(_L("Starting SimulateRxNWords\n"));
-    r=gChanSlaveI2c.SimulateRxNWords(busIdI2c, chanId, 8);
-    gTest(r==KErrNone);
-    //
-    // Wait for the notification
-    User::WaitForRequest(status);
-    r=status.Int();
-    if(r != KErrNone)
-        {
-        gTest.Printf(_L("TRequestStatus value after receiving data = %d\n"),r);
-        gTest(r==KErrNone);
-        }
-    //Delay the client response to exceed the timeout period, and check that the next
-    //request for a notification encounters the expected error code.
-    User::After(1000 * 1000);
-    r=gChanSlaveI2c.SetNotificationTrigger(chanId,triggerMask,&status);
-    gTest(r==KErrNone);
-    User::WaitForRequest(status);
-	r = status.Int();
-    if(r!=KErrTimedOut)
-        {
-        gTest.Printf(_L("TRequestStatus value = %d\n"),status.Int());
-        gTest(r==KErrTimedOut);
-        } 
-    gTest.Printf(_L("The test for SendBusErrorAndReturn is completed OK\n"));
 	// Release the channel
 	r = gChanSlaveI2c.ReleaseChannel( chanId );
 	gTest(r==KErrNone);
@@ -1468,125 +1403,6 @@
         }
     }
 
-//Only get called in stand alone mode
-LOCAL_C TInt IicTestStubs()
-    {
-    //Function to call the stub methods for Master and slave channels
-    //when Master and Slave functionality has not been built. The stubs
-    //return KErrNotSupported.
-    TInt r=KErrNone;
-    
-    TUint32 busIdI2c = 0;
-    TConfigI2cBufV01* i2cBuf=NULL;
-    TRequestStatus status;
-
-    //Starting master channel stubs test.
-    //a valid transaction is required when calling the Master QueueTransaction stub.
-    //Use I2C channel here. In MASTER_MODE, channelId starting from 10, 
-    //and 10 is a master channel
-    SET_BUS_TYPE(busIdI2c,EI2c);
-    SET_CHAN_NUM(busIdI2c,10);
-    // aDeviceId=1 ... 100kHz ... aTimeoutPeriod=100 ... aTransactionWaitCycles=10 - arbitrary paarmeters.
-    r=CreateI2cBuf(i2cBuf, EI2cAddr7Bit, 36, ELittleEndian, 100);
-    gTest(r==KErrNone);
-
-    // Use a single transfer
-    _LIT(halfDuplexText,"Half Duplex Text");
-    TBuf8<17> halfDuplexBuf_8;
-    halfDuplexBuf_8.Copy(halfDuplexText);
-    TUsideTferDesc* tfer = NULL;
-    r = CreateSingleUserSideTransfer(tfer, EMasterWrite, 8, &halfDuplexBuf_8, NULL);
-    gTest(r==KErrNone);
-
-    // Create the transaction object
-    TUsideTracnDesc* tracn = NULL;
-    r = CreateSingleUserSideTransaction(tracn, EI2c, i2cBuf, tfer, NULL, 0, NULL, NULL);
-    gTest(r==KErrNone);
-
-    // queue a synchronous transaction
-    gTest.Printf(_L("\n\nStarting synchronous QueueTransaction \n"));
-    r = gChanMasterI2c.QueueTransaction(busIdI2c, tracn);
-    gTest.Printf(_L("Synchronous QueueTransaction returned = %d\n"),r);
-    //Queueing a transaction in SLAVE_MODE should return KErrNotSupported 
-    gTest(r==KErrNotSupported); 
-    
-    // queue an asynchronous transaction and cancel the trasnaction
-    // QueueTransaction actually completes before CancelAsyncOperation with KErrNotSupported
-    // In test driver, we pretend the request is still in the queue and then cancel it.
-    gChanMasterI2c.QueueTransaction(status, busIdI2c, tracn);
-    gChanMasterI2c.CancelAsyncOperation(&status, busIdI2c);
-    User::WaitForRequest(status);
-    if(status != KErrNotSupported)
-        {
-        gTest.Printf(_L("TRequestStatus value after queue = %d\n"),status.Int());
-        gTest(r==KErrNotSupported);
-        }
-    //spare1 is an unused method that is present to provide for future extension,
-    //which just returns KErrNotSupported. 
-    r = gChanMasterI2c.TestSpare1(busIdI2c);
-    gTest(r == KErrNotSupported);
-    //StaticExtension is present for PSL implementations to override, the default
-    //implementation just returns KErrNotSupported
-    r = gChanMasterI2c.TestStaticExtension(busIdI2c);
-    gTest(r == KErrNotSupported);
-    //free the memory
-    delete i2cBuf;
-    delete tfer;
-    delete tracn;
-
-    //Start to test slave channel operations
-    SET_BUS_TYPE(busIdI2c,EI2c);
-    SET_CHAN_NUM(busIdI2c,11); // 11 is the Slave channel number
-    //
-    // clock speed=36Hz, aTimeoutPeriod=100 - arbitrary parameter
-    r=CreateI2cBuf(i2cBuf, EI2cAddr7Bit, 36, ELittleEndian, 100);
-    gTest(r==KErrNone);
-
-    // Synchronous capture of a Slave channel.
-    TInt chanId = 0; // Initialise to zero to silence compiler ...
-    gTest.Printf(_L("\n\nStarting synchronous CaptureChannel \n"));
-    r = gChanSlaveI2c.CaptureChannel(busIdI2c, i2cBuf, chanId );
-    gTest.Printf(_L("Synchronous CaptureChannel returned = %d, aChanId=0x%x\n"),r,chanId);
-    gTest(r==KErrNotSupported);
-    
-    gTest.Printf(_L("Starting RegisterRxBuffer\n"));
-    r=gChanSlaveI2c.RegisterRxBuffer(chanId, 4, 8, 16);
-    gTest(r==KErrNotSupported);
-    
-    gTest.Printf(_L("\nStarting RegisterTxBuffer\n"));
-    r=gChanSlaveI2c.RegisterTxBuffer(chanId, 4, 12, 8);
-    gTest(r==KErrNotSupported);
-    //
-    // Now set the notification trigger
-    TInt triggerMask=ERxAllBytes;
-
-    gTest.Printf(_L("Starting SetNotificationTrigger with ERxAllBytes\n"));
-    r=gChanSlaveI2c.SetNotificationTrigger(chanId,triggerMask,&status);
-    gTest(r==KErrNotSupported);
-    
-    r = gChanSlaveI2c.TestSpare1(busIdI2c);
-    gTest(r == KErrNotSupported);
-    r = gChanSlaveI2c.TestStaticExtension(busIdI2c);
-    gTest(r == KErrNotSupported);
-    delete i2cBuf;
-
-    //Start to test MasterSlave channel operations
-    //Create a Master-Slave channel
-    RBusDevIicClient chanMasterSlaveI2c;
-    TBufC<18> proxyName;
-    proxyName = KIicProxyFileNameRootStubs;
-    r = chanMasterSlaveI2c.Open(proxyName);
-    gTest(r==KErrNone);
-    
-    SET_BUS_TYPE(busIdI2c,EI2c);
-    SET_CHAN_NUM(busIdI2c,12); // 12 is the MasterSlave channel number
-    r = chanMasterSlaveI2c.TestStaticExtension(busIdI2c);
-    gTest(r==KErrNotSupported);
-    chanMasterSlaveI2c.Close();
-
-    return KErrNone;
-    }
-
 LOCAL_C TInt RunTests()
 //
 //	Utility method to invoke the separate tests
@@ -1706,8 +1522,6 @@
 	gChanSlaveI2c.Close();
 	
 	UserSvr::HalFunction(EHalGroupKernel, EKernelHalSupervisorBarrier, 0, 0);
-// Not safe to assume that heap clean-up has completed for the channels just closed, so insert a delay.(DEF145202)
-	User::After(20 * 1000);
 	__KHEAP_MARKEND;
 
 	gTest.Next(_L("Free kernel-side proxy IIC client"));
@@ -1784,8 +1598,6 @@
 	gChanSlaveI2c.Close();
 
 	UserSvr::HalFunction(EHalGroupKernel, EKernelHalSupervisorBarrier, 0, 0);
-// Not safe to assume that heap clean-up has completed for the channels just closed, so insert a delay.(DEF145202)
-	User::After(20 * 1000);
 	__KHEAP_MARKEND;
 
 	gTest.Next(_L("Free kernel-side proxy IIC client"));
@@ -1803,63 +1615,6 @@
 	gTest.Next(_L("Free Simulated PSL SPI bus driver"));
 	err = User::FreePhysicalDevice(KSpiFileNameCtrlLess);
 	gTest(err==KErrNone);
-	
-    //For simplicity, the code coverage tests are executed in STANDALONE_CHANNEL mode
-	//All the changes are made in test code, and not affect PIL.
-	gTest.Next(_L("Start the code coverage tests"));
-
-    gTest.Next(_L("Load Simulated PSL I2C bus driver"));
-    r = User::LoadPhysicalDevice(KI2cFileNameStubs);
-    gTest.Printf(_L("return value r=%d"),r);
-    gTest(r==KErrNone || r==KErrAlreadyExists);
-
-    gTest.Next(_L("Load kernel-side proxy IIC client"));
-    r = User::LoadLogicalDevice(KIicProxyFileNameStubs);
-    gTest(r==KErrNone || r==KErrAlreadyExists);
-
-    gTest.Next(_L("Load kernel-side proxy IIC slave client"));
-    r = User::LoadLogicalDevice(KIicProxySlaveFileNameStubs);
-    gTest(r==KErrNone || r==KErrAlreadyExists);
-
-    __KHEAP_MARK;
-    TBufC<30> proxyNameStubs(KIicProxyFileNameRootStubs);
-    // Open a Master I2C channel to the kernel side proxy
-    r = gChanMasterI2c.Open(proxyNameStubs);
-
-    gTest(r==KErrNone);
-    TBufC<35> proxySlaveNameStubs(KIicProxySlaveFileNameRootStubs);
-
-    r = gChanSlaveI2c.Open(proxySlaveNameStubs);
-    gTest(r==KErrNone);
-    r = gChanSlaveI2c.InitSlaveClient();
-    gTest(r==KErrNone);
-
-    // Instigate tests
-    r = IicTestStubs();
-    gTest(r==KErrNone);
-
-    gTest.Printf(_L("Tests completed OK, about to close channel\n"));
-    gChanMasterI2c.Close();
-    gChanSlaveI2c.Close();
-
-    UserSvr::HalFunction(EHalGroupKernel, EKernelHalSupervisorBarrier, 0, 0);
-    // Not safe to assume that heap clean-up has completed for the channels just closed, so insert a delay.(DEF145202)
-    User::After(20 * 1000);
-    __KHEAP_MARKEND;
-
-    gTest.Next(_L("Free kernel-side proxy IIC client"));
-
-    err = User::FreeLogicalDevice(KIicProxyFileNameRootStubs);
-    gTest(err==KErrNone || err==KErrAlreadyExists);
-    gTest.Next(_L("Free kernel-side proxy IIC slave client"));
-    err = User::FreeLogicalDevice(KIicProxySlaveFileNameRootStubs);
-    gTest(err==KErrNone || err==KErrAlreadyExists);
-
-    gTest.Next(_L("Free Simulated PSL I2C bus driver"));
-    err = User::FreePhysicalDevice(KI2cFileNameStubs);
-    gTest(err==KErrNone);
-
-	gTest.Next(_L("End the code coverage tests"));
 #else
 	gTest.Printf(_L("Don't do the test if it is not IIC_SIMULATED_PSL"));
 #endif
--- a/kerneltest/e32test/iic/t_iic.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/iic/t_iic.h	Wed Sep 01 12:34:56 2010 +0100
@@ -217,7 +217,7 @@
 // 27:23 - Reserved
 // 22:20 - Bus type
 // 19:15 - Channel number
-// 14:10 - Transaction speed	// deprecated
+// 14:10 - Transaction speed
 //  9:0  - Slave address
 #define HS_MASTER_ADDR_SHIFT 29
 #define HS_MASTER_ADDR_MASK 0x7
@@ -227,8 +227,8 @@
 #define BUS_TYPE_MASK 0x7
 #define CHANNEL_NO_SHIFT 15
 #define CHANNEL_NO_MASK 0x1F
-//#define TRANS_SPEED_SHIFT 10
-//#define TRANS_SPEED_MASK 0x1F
+#define TRANS_SPEED_SHIFT 10
+#define TRANS_SPEED_MASK 0x1F
 #define SLAVE_ADDR_SHIFT 0
 #define SLAVE_ADDR_MASK 0x3FF
 //
@@ -244,8 +244,8 @@
 #define SET_BUS_TYPE(aBusId,aBusType) SET_CONFIG_FIELD(aBusId,aBusType,BUS_TYPE_MASK,BUS_TYPE_SHIFT)
 #define GET_CHAN_NUM(aBusId) GET_CONFIG_FIELD(aBusId,CHANNEL_NO_MASK,CHANNEL_NO_SHIFT)
 #define SET_CHAN_NUM(aBusId,aChanNum) SET_CONFIG_FIELD(aBusId,aChanNum,CHANNEL_NO_MASK,CHANNEL_NO_SHIFT)
-//#define SET_TRANS_SPEED(aBusId,aTransSpeed) SET_CONFIG_FIELD(aBusId,aTransSpeed,TRANS_SPEED_MASK,TRANS_SPEED_SHIFT)
-//#define GET_TRANS_SPEED(aBusId) GET_CONFIG_FIELD(aBusId,TRANS_SPEED_MASK,TRANS_SPEED_SHIFT)
+#define SET_TRANS_SPEED(aBusId,aTransSpeed) SET_CONFIG_FIELD(aBusId,aTransSpeed,TRANS_SPEED_MASK,TRANS_SPEED_SHIFT)
+#define GET_TRANS_SPEED(aBusId) GET_CONFIG_FIELD(aBusId,TRANS_SPEED_MASK,TRANS_SPEED_SHIFT)
 #define SET_SLAVE_ADDR(aBusId,aSlaveAddr) SET_CONFIG_FIELD(aBusId,aSlaveAddr,SLAVE_ADDR_MASK,SLAVE_ADDR_SHIFT)
 #define GET_SLAVE_ADDR(aBusId) GET_CONFIG_FIELD(aBusId,SLAVE_ADDR_MASK,SLAVE_ADDR_SHIFT)
 
@@ -301,9 +301,7 @@
 		EReleaseChan,						/**< ReleaseChannel												*/
 		ERegisterRxBuffer,					/**< Register a buffer for receiving data						*/
 		ERegisterTxBuffer,					/**< Register a buffer for transmitting data					*/
-		ESetNotifTrigger,					/**< Set the notification triggers                               */
-		ETestSpare1,
-		ETestStaticEx
+		ESetNotifTrigger					/**< Set the notification triggers                               */									
 		};
 
 	enum TStaticExt
@@ -377,7 +375,7 @@
 	inline TInt ReleaseChannel(TInt aChannelId){return(DoControl(EReleaseChan,(TAny*)aChannelId,NULL));};
 	inline TInt RegisterRxBuffer(TInt aChannelId, TInt8 aBufGranularity, TInt8 aNumWords, TInt8 aOffset){TInt8 parms[3]; parms[0]=aBufGranularity; parms[1]=aNumWords; parms[2]=aOffset;return(DoControl(ERegisterRxBuffer,(TAny*)aChannelId,(TAny*)(&parms[0])));};
 	inline TInt RegisterTxBuffer(TInt aChannelId, TInt8 aBufGranularity, TInt8 aNumWords, TInt8 aOffset){TInt8 parms[3]; parms[0]=aBufGranularity; parms[1]=aNumWords; parms[2]=aOffset;return(DoControl(ERegisterTxBuffer,(TAny*)aChannelId,(TAny*)(&parms[0])));};
-	inline TInt SetNotificationTrigger(TInt aChannelId, TInt aTrigger, TRequestStatus* aStatus){TInt parms[2]; parms[0]=aChannelId; parms[1]=aTrigger; *aStatus=KRequestPending; return(DoControl(ESetNotifTrigger,(TAny*)aStatus,(TAny*)(&parms[0])));};
+	inline TInt SetNotificationTrigger(TInt aChannelId, TInt aTrigger, TRequestStatus* aStatus){TInt parms[2]; parms[0]=aChannelId; parms[1]=aTrigger;return(DoControl(ESetNotifTrigger,(TAny*)aStatus,(TAny*)(&parms[0])));};
 
 	// ControlIO functions follow
 	inline TInt BlockReqCompletion(TInt aBusId) {return(DoControl(ECtlIoBlockReqCompletion,(TAny*)aBusId));}
@@ -407,9 +405,7 @@
 	inline TInt SetNotifNoTrigger(TInt aChannelId, TInt aTrigger){return(DoControl(ECtrlIoNotifNoTrigger,(TAny*)aChannelId,(TAny*)aTrigger));};
 
 	inline void TestOverrunUnderrun(TInt aBusId, TInt aChannelId, TRequestStatus& aStatus) {DoRequest(ECtrlIoOvUndRunRxTx,aStatus,(TAny*)aBusId,(TAny*)aChannelId);}
-	
-	inline TInt TestSpare1(TInt aBusId) {return (DoControl(ETestSpare1, (TAny*)aBusId));}
-	inline TInt TestStaticExtension(TInt aBusId) {return (DoControl(ETestStaticEx, (TAny*)aBusId));}
+
 #endif
 	};
 
--- a/kerneltest/e32test/lffs/loadlffs.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/lffs/loadlffs.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -24,9 +24,10 @@
 
     RFormat format;
     TInt    count;
+    TInt    r;
     
     RDebug::Print(_L("Format LFFS drive %S\r\n"), &drive);
-	format.Open(TheFs, drive, EHighDensity, count);
+    r = format.Open(TheFs, drive, EHighDensity, count);
     
     while (count)
 		{
--- a/kerneltest/e32test/math/t_i64.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/math/t_i64.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -138,7 +138,7 @@
 			{
 			while (aMod >= (t << 31))
 				{
-				aDiv += static_cast<TUint32>(1U << 31);
+				aDiv += static_cast<TUint32>(1 << 31);
 				aMod -= t << 31;
 				}
 			}
--- a/kerneltest/e32test/math/t_r32.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/math/t_r32.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -72,12 +72,12 @@
 GLREF_C TReal32 __mulsf3(TReal32 a1,TReal32 a2);
 GLREF_C TReal32 __divsf3(TReal32 a1,TReal32 a2);
 GLREF_C TReal32 __truncdfsf2(TReal64 a1);
-GLDEF_D const TReal32 minDenormalTReal32=1.4E-45f;
 #endif
 
 GLDEF_D TReal32 NaNTReal32;
 GLDEF_D TReal32 posInfTReal32;
 GLDEF_D TReal32 negInfTReal32;
+GLDEF_D const TReal32 minDenormalTReal32=1.4E-45f;
 GLDEF_D TReal NaNTReal;
 GLDEF_D TReal posInfTReal;
 GLDEF_D TReal negInfTReal;
--- a/kerneltest/e32test/mediaext/d_nfe.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/mediaext/d_nfe.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -22,6 +22,7 @@
 
 #if defined(_DEBUG)
 //	#define TRACE_ENABLED
+#define TRACE_ENABLED	//*test*
 #else
 #endif
 
@@ -1051,9 +1052,6 @@
 
 //	__KTRACE_PRINT(Kern::Printf("NFE%d: HandleRead pos %lx len %lx status %d", iInstance, currentPos, remainingLength, di->Status()));
 
-	if (di->iEntry.iPartitionLen == 0)
-		return KErrNotReady;
-
 
 	di->iReadRequestCount++;
 
@@ -1215,30 +1213,40 @@
 
 TInt DMediaDriverNFE::HandleFormat(TLocDrvRequest& aReq)
 	{
+	TInt r = KErrNone;
 	TInt64 currentPos =  aReq.Pos();
+	TInt64 remainingLength = aReq.Length();
 	TNfeDriveInfo* di = &iInfo.iDrives[DriveIndex(aReq.Drive()->iDriveNumber)];
 
-	__KTRACE_PRINT(Kern::Printf("NFE%d: HandleFormat pos %lx len %lx status %d", iInstance, currentPos, aReq.Length(), di->Status()));
+//	__KTRACE_PRINT(Kern::Printf("NFE%d: HandleFormat pos %lx len %lx status %d", iInstance, currentPos, remainingLength, di->Status()));
+
 
-	if (di->Status() == ENfeEncrypting)
+	// just forward the request if the drive is not encrypted
+	if (di->Status() == ENfeDecrypted)
+		return ForwardRequest(aReq);
+
+	// otherwise create a buffer containing NULLs, encrypt it and write that to the attached drive
+	while(remainingLength && r == KErrNone)
 		{
-		di->iEncryptEndPos = di->iEntry.iPartitionBaseAddr + di->iEntry.iPartitionLen;
-		SetStatus(*di,  ENfeEncrypted);
-		__KTRACE_PRINT(Kern::Printf("NFE%d: HandleFormat() , Setting status to %s", iInstance, DriveStatus(di->Status())));
+		TInt64 currentLength = (remainingLength <= KBufSize ? remainingLength : KBufSize);
+
+		TBool encryptBuffer = AdjustRequest(di, currentPos, currentLength);
+
+		memclr(iBuffer, KBufSize);
+		TPtr8 des(iBuffer,KBufSize,KBufSize);
+
+		if (encryptBuffer)
+			EncryptBuffer(des);
+		
+		r = Write(di->iLocalDriveNum, currentPos, (TLinAddr) iBuffer, I64LOW(currentLength));
+		if(r != KErrNone)
+			break;
+
+		remainingLength-= currentLength;
+		currentPos+= currentLength;
 		}
 
-	if (currentPos >= di->iEntry.iPartitionBaseAddr && 
-		currentPos < di->iEntry.iPartitionBaseAddr + KSectorSize && 
-		di->IsUDADrive() &&
-		di->Status() == ENfeEncrypted)
-		{
-		__KTRACE_PRINT(Kern::Printf("NFE%d: Write to sector #0 detected", iInstance));
-		di->iUniqueID = 0;	// undefined
-		__KTRACE_PRINT(Kern::Printf("NFE%d: Setting Volume ID to %08X", iInstance, di->iUniqueID ));
-		}
-
-
-	return ForwardRequest(aReq);
+	return r == KErrNone ? KErrCompletion : r;
 	}
 
 
@@ -1355,13 +1363,9 @@
 TBool DMediaDriverNFE::ValidBootSector(TUint8* aBuffer)
 	{
 	if (aBuffer[0] == 0xEB || aBuffer[0] == 0xE9)
-		{
 		return ETrue;
-		}
 	else
-		{
 		return EFalse;
-		}
 	}
 
 
@@ -1406,7 +1410,7 @@
 
 	// Find out whether the volume has changed
 	TUint32 uniqueID = VolumeId(iBuffer);   
-	TBool volumeChanged = (aDi.iUniqueID != 0) && (uniqueID != aDi.iUniqueID);
+	TBool volumeChanged = uniqueID != aDi.iUniqueID;
 	__KTRACE_PRINT(Kern::Printf("NFE%d: Old Volume ID %08X", iInstance, aDi.iUniqueID));
 	__KTRACE_PRINT(Kern::Printf("NFE%d: New Volume ID %08X", iInstance, uniqueID));
 	__KTRACE_PRINT(Kern::Printf("NFE%d: volumeChanged %d", iInstance, volumeChanged));
@@ -1534,6 +1538,9 @@
 		return KErrNone;
 		}
 
+//	TInt KBackgroundPriority = 7;						//*test*
+//	Kern::SetThreadPriority(KBackgroundPriority);		//*test*
+
 	TInt r = KErrNone;
 	for (;;)
 		{
@@ -1620,6 +1627,8 @@
 	if (r != KErrCompletion)
 		iIdleTimer.OneShot(NKern::TimerTicks(KNotBusyInterval));
 
+//	Kern::SetThreadPriority(KNfeThreadPriority);	//*test*
+	
 	return r;
 	}
 
--- a/kerneltest/e32test/mediaext/t_nfe.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/mediaext/t_nfe.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -130,9 +130,9 @@
 	return r;
 	}
 
-void DisplayNfeDeviceInfo(TInt aNfeDrive, TNfeDeviceInfo& aDeviceInfo, TBool (&aNfeDrives)[KMaxLocalDrives])
+void DisplayNfeDeviceInfo(TInt aNfeDrive, TNfeDeviceInfo& aDeviceInfo)
 	{
-//	test.Printf(_L("Stats: \n"));
+	test.Printf(_L("Stats: \n"));
 
 	RLocalDrive	d;
 	TBool change = EFalse;
@@ -153,13 +153,6 @@
 		{
 		TNfeDriveInfo& di = aDeviceInfo.iDrives[i];
 
-		TInt localDriveNum = di.iLocalDriveNum;
-		test_Value(localDriveNum, di.iLocalDriveNum < KMaxLocalDrives);
-		
-		if (aNfeDrives[localDriveNum])
-			continue;
-		aNfeDrives[localDriveNum] = 1;
-
 		test.Printf(_L("*** drive index %d ***\n"), i);
 		test.Printf(_L("iLocalDriveNum %x\n"), di.iLocalDriveNum);
 		test.Printf(_L("iDriveLetter %c\n"), di.iDriveLetter >= 0 && di.iDriveLetter <= 25 ? di.iDriveLetter +'A' : '?');
@@ -396,13 +389,10 @@
 		}
 
 
-	TBool nfeDrives[KMaxLocalDrives];
-	memclr(nfeDrives, sizeof(nfeDrives));
-	
 	for(TInt nfeDrive = FindNfeDrive(0); nfeDrive != KErrNotFound; nfeDrive = FindNfeDrive(++nfeDrive))
 		{
 		TNfeDeviceInfo deviceInfo;
-		DisplayNfeDeviceInfo(nfeDrive, deviceInfo, nfeDrives);
+		DisplayNfeDeviceInfo(nfeDrive, deviceInfo);
 		}
 
 	fs.Close();
--- a/kerneltest/e32test/misc/ccthrash.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-// Copyright (c) 2009-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\misc\ccthrash.cpp
-// 
-//
-
-#define __E32TEST_EXTENSION__
-
-#include <e32test.h>
-#include <e32hal.h>
-#include <e32svr.h>
-#include <e32atomics.h>
-#include "u32std.h"
-#include "prbs.h"
-
-RTest test(_L("Core Control Thrasher"));
-
-TInt NumberOfCpus()
-	{
-	TInt r = UserSvr::HalFunction(EHalGroupKernel, EKernelHalNumLogicalCpus, 0, 0);
-	test(r>0);
-	return r;
-	}
-
-const TInt NCPU = NumberOfCpus();
-volatile TInt STFU = 1;
-
-TInt NumberOfActiveCpus(TInt* a)
-	{
-	SCpuStates s;
-	TInt r = UserSvr::HalFunction(EHalGroupKernel, EKernelHalCpuStates, &s, 0);
-	test_KErrNone(r);
-	TUint32 ta = s.iTA;
-	TUint32 ia = s.iIA;
-	if (a)
-		*a = __e32_bit_count_32(ta);
-	return __e32_bit_count_32(ia);
-	}
-
-TInt StableState()
-	{
-	SCpuStates s;
-	TInt r = UserSvr::HalFunction(EHalGroupKernel, EKernelHalCpuStates, &s, 0);
-	test_KErrNone(r);
-	if (s.iCU || s.iDC)
-		return KErrNotReady;
-	if (s.iTA != s.iIA)
-		return KErrNotReady;
-	if (s.iGD & s.iIA)
-		return KErrNotReady;
-	TInt i;
-	for (i=0; i<NCPU; ++i)
-		{
-		TBool attached = (s.iUDC[i] == s.iUAC[i]);
-		TBool on = s.iIA & (1u<<i);
-		if ((on && !attached) || (!on && attached))
-			return KErrNotReady;
-		}
-	return __e32_bit_count_32(s.iTA);
-	}
-
-class CThrasher : public CBase
-	{
-public:
-	CThrasher();
-	~CThrasher();
-	static CThrasher* New();
-	TInt Construct();
-	void Run();
-	void Display();
-	TInt ChangeNumberOfCores(TInt aNum, TInt* aCores);
-public:
-	TUint64 iRunCount;
-	TUint64 iTotalTime;
-	TUint32 iTimeouts;
-	TUint32 iDiff;
-	TUint32 iPeriod;
-	TUint iSeed[2];
-	TUint32 iLastDisplay;
-	TUint32 iDisplayPeriod;
-	TUint32 iTimeoutPeriod;
-	};
-
-CThrasher::CThrasher()
-	{
-	iSeed[0] = 0xb504f334u;
-	iPeriod = 19;
-	iLastDisplay = User::NTickCount();
-	iDisplayPeriod = 2000;
-	iTimeoutPeriod = 200;
-	}
-
-CThrasher::~CThrasher()
-	{
-	}
-
-TInt CThrasher::Construct()
-	{
-	return KErrNone;
-	}
-
-CThrasher* CThrasher::New()
-	{
-	CThrasher* p = new CThrasher;
-	if (!p)
-		return 0;
-	TInt r = p->Construct();
-	if (r!=KErrNone)
-		{
-		delete p;
-		return 0;
-		}
-	return p;
-	}
-
-TInt CThrasher::ChangeNumberOfCores(TInt aNum, TInt* aCores)
-	{
-	TUint32 initial = User::NTickCount();
-	TUint32 final = initial;
-	TUint32 elapsed = 0;
-	TInt n = -1;
-	TInt r = UserSvr::HalFunction(EHalGroupKernel, EKernelHalSetNumberOfCpus, (TAny*)aNum, 0);
-	test_KErrNone(r);
-	FOREVER
-		{
-		n = StableState();
-		final = User::NTickCount();
-		elapsed = final - initial;
-		if (n<0 || elapsed<iTimeoutPeriod)
-			break;
-		User::AfterHighRes(1000);
-		}
-	if (aCores)
-		*aCores = n;
-	if (n>=0)
-		return elapsed;
-	return KErrTimedOut;
-	}
-
-void CThrasher::Run()
-	{
-	TUint x = Random(iSeed);
-	x %= iPeriod;
-	x += 1;
-	x *= 1000;
-	User::AfterHighRes(x);
-	TUint y = Random(iSeed);
-	y %= TUint(NCPU);
-	y += 1;
-	TInt n = 0;
-	TInt t = ChangeNumberOfCores(y, &n);
-	if (t < 0)
-		{
-		++iTimeouts;
-		iTotalTime += TUint64(iTimeoutPeriod);
-		}
-	else
-		{
-		iTotalTime += TUint64(t);
-		if (TUint(n) != y)
-			++iDiff;
-		}
-	++iRunCount;
-	TUint32 now = User::NTickCount();
-	TUint32 elapsed = now - iLastDisplay;
-	if (elapsed >= iDisplayPeriod)
-		{
-		iLastDisplay = now;
-		Display();
-		}
-	}
-
-void CThrasher::Display()
-	{
-	TUint64 avg = iTotalTime;
-	avg *= TUint64(100);
-	avg += TUint64(50);
-	avg /= iRunCount;
-	TUint32 frac = TUint32(avg % TUint64(100));
-	TUint32 integer = TUint32(avg / TUint64(100));
-	TUint32 rc32 = (TUint32)iRunCount;
-	test.Printf(_L("RC:%10u AVG:%10u.%02u TO:%10u D:%10u\n"), rc32, integer, frac, iTimeouts, iDiff);
-	}
-
-GLDEF_C TInt E32Main()
-	{
-	test.Title();
-	RThread().SetPriority(EPriorityAbsoluteHigh);
-
-	if (NCPU==1)
-		{
-		test.Printf(_L("Only works on SMP systems\n"));
-		return 0;
-		}
-
-	CThrasher* p = CThrasher::New();
-	test_NotNull(p);
-	while(STFU)
-		{
-		p->Run();
-		}
-
-
-	return 0;
-	}
-
--- a/kerneltest/e32test/misc/cpumeter.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/misc/cpumeter.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -48,8 +48,6 @@
 	TInt Construct();
 	void Measure();
 	void Display(TInt aInterval);
-	void DisplayCoreControlInfo();
-	void ChangeNumberOfCores(TInt aNum);
 public:
 	TInt iNumCpus;
 	TInt iNextMeas;
@@ -154,38 +152,6 @@
 	test.Printf(buf);
 	}
 
-void CCpuMeter::DisplayCoreControlInfo()
-	{
-	SCpuStates s;
-	TInt r = UserSvr::HalFunction(EHalGroupKernel, EKernelHalCpuStates, &s, 0);
-	if (r != KErrNone)
-		{
-		test.Printf(_L("Error %d\n"), r);
-		return;
-		}
-	test.SetLogged(ETrue);
-	test.Printf(_L("  TA=%08x IA=%08x CU=%08x GD=%08x DC=%08x\n"), s.iTA, s.iIA, s.iCU, s.iGD, s.iDC);
-	test.Printf(_L("  SC=%08x RC=%08x PO=%02x      CCS=%08x PODC=%08x\n"), s.iSC, s.iRC, s.iPO, s.iCCS, s.iPODC);
-	TInt i;
-	for (i=0; i<iNumCpus; ++i)
-		{
-		test.Printf(_L("%1d:DS=%08x UDC=%08x UAC=%08x OP=%08x F=%08x\n"), i, s.iDS[i], s.iUDC[i], s.iUAC[i], s.iOP[i], s.iF[i]);
-		}
-	test.SetLogged(EFalse);
-	}
-
-void CCpuMeter::ChangeNumberOfCores(TInt aNum)
-	{
-	test.SetLogged(ETrue);
-	test.Printf(_L("#CORES->%d\n"), aNum);
-	TInt r = UserSvr::HalFunction(EHalGroupKernel, EKernelHalSetNumberOfCpus, (TAny*)aNum, 0);
-	if (r != KErrNone)
-		{
-		test.Printf(_L("Error %d\n"), r);
-		}
-	test.SetLogged(EFalse);
-	}
-
 void UseKernelCpuTime()
 	{
 	test.Start(_L("Create CCpuMeter"));
@@ -209,14 +175,6 @@
 				delete m;
 				return;
 				}
-			if (m->iNumCpus > 1)
-				{
-				// SMP only options
-				if (k == EKeySpace)
-					m->DisplayCoreControlInfo();
-				else if (k>='1' && k<=('0'+m->iNumCpus))
-					m->ChangeNumberOfCores(k - '0');
-				}
 			console->Read(s);
 			}
 		}
--- a/kerneltest/e32test/misc/d_TestKernCoreStats.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,168 +0,0 @@
-// 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".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// e32test\misc\d_kerncorestas.cpp
-// 
-//
-
-#include "d_TestKernCoreStats.h"
-
-#include <kernel/kernel.h>
-#include <kernel/kerncorestats.h>
-
-
-class DTestKernCoreStatsFactory : public DLogicalDevice
-        {
-public:
-        DTestKernCoreStatsFactory();
-        ~DTestKernCoreStatsFactory();
-        virtual TInt Install();
-        virtual void GetCaps(TDes8& aDes) const;
-        virtual TInt Create(DLogicalChannelBase*& aChannel);
-        };
-
-class DTestKernCoreStatsChannel : public DLogicalChannelBase
-        {
-public:
-        DTestKernCoreStatsChannel();
-        virtual ~DTestKernCoreStatsChannel();
-        TInt Request(TInt aFunction, TAny* a1, TAny* a2);
-        virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion&
-aVer);
-private:
-	TInt GetStats(TAny* aBuffer);
-	TInt Configure(TInt aMode);
-	TInt DumpInfo();
-private:
-	TInt iLength;
-        };
-
-
-DECLARE_STANDARD_LDD()
-        {
-        return new DTestKernCoreStatsFactory;
-        }
-
-DTestKernCoreStatsFactory::DTestKernCoreStatsFactory()
-        {
-        }
-
-DTestKernCoreStatsFactory::~DTestKernCoreStatsFactory()
-        {
-        }
-
-TInt DTestKernCoreStatsFactory::Install()
-        {
-        return SetName(&KTestKernCoreStatsName);
-        }
-
-
-void DTestKernCoreStatsFactory::GetCaps(TDes8&) const
-        {
-        }
-
-
-TInt DTestKernCoreStatsFactory::Create(DLogicalChannelBase*& aChannel)
-        {
-        aChannel=new DTestKernCoreStatsChannel();
-        if(!aChannel)
-                return KErrNoMemory;
-
-        return KErrNone;
-        }
-
-DTestKernCoreStatsChannel::DTestKernCoreStatsChannel()
-	{
-	}
-
-
-DTestKernCoreStatsChannel::~DTestKernCoreStatsChannel()
-	{
-	}
-
-TInt DTestKernCoreStatsChannel::DoCreate(TInt, const TDesC8*, const TVersion&)
-        {
-        return KErrNone;
-        }
-
-TInt DTestKernCoreStatsChannel::Request(TInt aFunction, TAny* a1, TAny*)
-        {
-        switch (aFunction)
-                {
-                case RTestKernCoreStats::ERequestGetStats:
-                        return GetStats( (TAny*) a1);
-                case RTestKernCoreStats::ERequestConfigure:
-                        return Configure( (TInt) a1);
-                case RTestKernCoreStats::ERequestDumpInfo:
-                        return DumpInfo();
-                default:
-                        return KErrNotSupported;
-                }
-        }
-
-
-TInt DTestKernCoreStatsChannel::GetStats(TAny* aBuffer)
-	{
-	NKern::ThreadEnterCS();
-	
-	if (iLength==0)
-		return KErrNone;
-	
-	TAny* tempBuff = Kern::Alloc(iLength);
-	if (!tempBuff)
-		{
-		NKern::ThreadLeaveCS();
-		return KErrNoMemory;
-		}
-
-	TInt r = KernCoreStats::Stats(tempBuff);
-
-
-	if (r==KErrNone)
-		kumemput(aBuffer, tempBuff, iLength);
-
-	Kern::Free(tempBuff);
-	NKern::ThreadLeaveCS();
-
-	return r;
-	}
-
-TInt DTestKernCoreStatsChannel::Configure(TInt aMode)
-	{
-
-	NKern::ThreadEnterCS();
-	TInt cores = NKern::NumberOfCpus();
-
-	TInt len = 0;
-	len+= (aMode & KStatsCoreTotalTimeInIdle)?		sizeof(TUint)*cores :0;
-	len+= (aMode & KStatsTimeCrossIdleAndActive)?		sizeof(TUint)*(cores+1) :0;
-	len+= (aMode & KStatsCoreNumTimesInIdle)?		sizeof(TUint)*cores :0;
-	len+= (aMode & KStatsNumEvents)?			sizeof(TUint) :0;
-	len+= (aMode & KStatsReadyStateChanges)?		sizeof(TUint)*2:0;
-	len+= (aMode & KStatsNumTimeSliceExpire)?		sizeof(TUint):0;
-
-	iLength=len;
-	Kern::Printf("KernCoreStats packet length = %d", len);
-	TInt r =  KernCoreStats::Configure(aMode);
-	NKern::ThreadLeaveCS();
-	return r;
-	}
-
-
-TInt DTestKernCoreStatsChannel::DumpInfo()
-	{
-
-	//KernCoreStats::Engage(0);
-
-	return iLength;
-	}
--- a/kerneltest/e32test/misc/d_TestKernCoreStats.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-// 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".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// e32test\misc\d_kerncorestas.h
-// 
-
-
-#ifndef D_TESTKERNCORESTATS
-#define D_TESTKERNCORESTATS
-
-
-#include <e32cmn.h>
-#include <e32ver.h>
-#ifndef __KERNEL_MODE__
-#include <e32std.h>
-#endif
-
-
-
-_LIT(KTestKernCoreStatsName,"TestKernCoreStats");
-
-
-
-class RTestKernCoreStats : public RBusLogicalChannel
-        {
-public:
-
-        enum TControl
-                {
-
-        ERequestGetStats,
-        ERequestConfigure,
-        ERequestDumpInfo
-                };
-public:
-        inline TInt Open();
-        inline TInt GetStats( TAny* a0);
-        inline TInt Configure( TInt a0);
-        inline TInt DumpInfo();
-
-        };
-
-#ifndef __KERNEL_MODE__
-
-inline TInt RTestKernCoreStats::Open()
-		{ return DoCreate(KTestKernCoreStatsName,TVersion(0,1,1),KNullUnit,NULL,NULL); }
-
-
-inline TInt RTestKernCoreStats::GetStats( TAny* a0)
-        { return DoControl(ERequestGetStats, (TAny*) a0); }
-
-inline TInt RTestKernCoreStats::Configure( TInt a0)
-        { return DoControl(ERequestConfigure, (TAny*) a0); }
-
-inline TInt RTestKernCoreStats::DumpInfo()
-        { return DoControl(ERequestDumpInfo,NULL); }
-
-
-
-
-#else
-
-#define DRIVER_NAME(x)
-#define DRIVER_REQUEST TInt
-
-#endif // __KERNEL_MODE__
-
-#endif
-
--- a/kerneltest/e32test/misc/t_cputime.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/misc/t_cputime.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -228,47 +228,22 @@
 	test(s==KRequestPending);
 
 	TTimeIntervalMicroSeconds time, time2;
-	TInt64 us;
-
-	// Test cpu time is initially zero
+	
+	// Test time is initially zero
 	FailIfError(thread.GetCpuTime(time));
 	test(time == 0);
 
-	// Test cpu time is not increased while thread is waiting on semaphore
+	// Test not increased while waiting on semaphore
 	thread.Resume();
 	User::After(KShortWait);
-	FailIfError(thread.GetCpuTime(time2));
-	us = time2.Int64();
-	test.Printf(_L("Time %dus\n"), us);
-	test(us < KTolerance); // wait should happen in less than 1ms
+	FailIfError(thread.GetCpuTime(time));
+	test(time < KTolerance); // wait happens in less than 0.5ms
 
-	// Test cpu time increases when thread allowed to run
-	// We want to allow 2% tolerance for the thread's CPU time, as there could be
-	// something else running on the system during that time which would result lower CPU time than the
-	// actual KShortPeriod or KLongPeriod wait time.
-	// Also User::After(t) might return within the range of <t, t + 1000000/64 + 2*NanoKarnelTickPeriod>.
-	// Given all that - we expect that the the cpu time should be within the range of:
-	// <t - 0.02*t, t + 15625 + 2*NanoKernelTickPeriod>
-	// or <0.98*t, t + 15625 + 2*NanoKernelTickPeriod>
-	TInt user_after_tolerance = 0;
-	HAL::Get(HAL::ENanoTickPeriod, user_after_tolerance);
-	user_after_tolerance += user_after_tolerance + 15625;
-
+	// Test increases when thread allowed to run
 	(threadParam.iSem).Signal();
 	User::After(KShortWait);
 	FailIfError(thread.GetCpuTime(time));
-	us = time.Int64() - time2.Int64();
-	test.Printf(_L("Time %dus\n"), us);
-	test(100*us >= 98*KShortWait); // left limit
-	test(us - KShortWait <= user_after_tolerance); // right limit
-
-	FailIfError(thread.GetCpuTime(time));
-	User::After(KLongWait);
-	FailIfError(thread.GetCpuTime(time2));
-	us = time2.Int64() - time.Int64();
-	test.Printf(_L("Time %dus\n"), us);
-	test(100*us >= 98*KLongWait); // left limit
-	test(us - KLongWait <= user_after_tolerance); // right limit
+	test(time > (KShortWait - KTolerance));
 
 	// Test not increased while suspended
 	thread.Suspend();
@@ -277,7 +252,7 @@
 	FailIfError(thread.GetCpuTime(time2));
 	test(time == time2);
 	thread.Resume();
-
+	
 	// Test not increased while dead
 	thread.Kill(KErrNone);
 	User::WaitForRequest(s);	// wait on undertaker since that completes in supervisor thread
--- a/kerneltest/e32test/misc/t_kerncorestats.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,398 +0,0 @@
-// 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".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// e32test\misc\t_kerncorestas.cpp
-// 
-//
-
-#define __E32TEST_EXTENSION__
-#include <e32test.h>
-#include <e32svr.h>
-#include <u32hal.h>
-#include <e32property.h>
-
-#include "d_testkerncorestats.h"
-
-LOCAL_D RTest test(_L("t_KernCoreStats"));
-
-
-// Kernel side stats (also used when obtaining stats from Kernel)
-const TInt KStatsCoreNumTimesInIdle	 = 0x0001;
-const TInt KStatsCoreTotalTimeInIdle	 = 0x0002;
-const TInt KStatsTimeCrossIdleAndActive	 = 0x0004;
-const TInt KStatsReadyStateChanges	 = 0x0008;
-const TInt KStatsNumTimeSliceExpire	 = 0x0010;
-const TInt KStatsNumEvents		 = 0x0020;
-
-
-_LIT(KLddName, "d_testkerncorestats");
-static RTestKernCoreStats gChan;
-TInt gCores;
-TInt gDelay = 500;
-TInt gThreads=0;
-
-void DisplayBuf(TInt aMode, TAny* aBuffer)
-	{
-	TUint* pVal = (TUint*) aBuffer;
-	test.Printf(_L("\nKernel Stats\n============\n"));
-
-	TInt core;
-	TUint TTI=0;
-
-	if (aMode & KStatsCoreTotalTimeInIdle)
-		{
-		test.Printf(_L("Time in Idle thread:"));	
-		TTI=0;
-		for (core=0; core<gCores; core++)
-			{
-			test.Console()->SetPos(22);
-			test.Printf(_L("%d: %10d \n"),core,*pVal);
-			TTI+=*pVal;
-			pVal++;
-			}
-
-		test.Console()->SetPos(22);
-		test.Printf(_L("Total:%10d \n\n"),TTI);
-		}
-
-
-	if (aMode & KStatsTimeCrossIdleAndActive)
-		{
-		TUint total=0;
-		TUint idletotal=0;
-		
-		TUint* pSavedPlace = pVal;
-
-		for (core=0;  core<(gCores+1); core++)
-			{
-			total+=*pVal;
-			idletotal+= *pVal*core;
-			pVal++;		
-			}
-		pVal = pSavedPlace;
-
-		TInt percent;
-		test.Printf(_L("Time in permutations: "));
-		for (core=0;  core<(gCores+1); core++)
-			{
-			test.Console()->SetPos(22);
-			percent = (total>0)?*pVal*100/total:0;
-			test.Printf(_L("%d: %10d (%3d%%)\n"),core,*pVal, percent);
-			pVal++;		
-			}
-
-
-
-
-		test.Console()->SetPos(22);
-		test.Printf(_L("Total Time :%10d        "),total);
-		if ((total- (TUint) gDelay > 100000) || ((TUint) gDelay>total))
-			test.Printf(_L("FAIL!\n"));
-		else
-			test.Printf(_L("PASS \n"));
-		
-
-		test.Console()->SetPos(22);
-		percent = (total>0)?idletotal*25/total:0;
-		test.Printf(_L("Total Idle :%10d (%3d%%) "), idletotal, percent);
-		if (aMode & KStatsCoreTotalTimeInIdle)
-			{
-			if (idletotal==TTI)
-				test.Printf(_L("PASS "));
-			else
-				test.Printf(_L("FAIL!"));
-			}
-		test.Printf(_L("\n\n"));
-		}
-
-	if (aMode & KStatsCoreNumTimesInIdle)
-		{
-		test.Printf(_L("Numer times in idle :"));
-		for (core=0; core<gCores; core++)
-			{
-			test.Console()->SetPos(22);
-			test.Printf(_L(" %d: %6d \n"),core,*pVal);
-			pVal++;
-			}
-		test.Printf(_L(" \n"));	
-		}
-
-	if (aMode & KStatsNumEvents)
-		{	
-		test.Printf(_L("Number of Events    : %d   \n"),*pVal);
-		pVal++;
-		}
-
-
-
-	if (aMode & KStatsReadyStateChanges)
-	{	
-		test.Printf(_L("Threads made Ready  : %d   \n"),*pVal);
-		pVal++;
-		test.Printf(_L("Threads made unready: %d   \n"),*pVal);
-		pVal++;
-	}
-
-	if (aMode & KStatsNumTimeSliceExpire)
-		test.Printf(_L("Time slices expired : %d   \n"),*pVal);
-
-	test.Printf(_L("BG threads: %d, delay %d \n"),gThreads,gDelay);
-
-	}
-	
-void InitBuff(TAny* aBuffer, TInt aSize)
-	{
-	TInt* pos = (TInt*) aBuffer;
-
-	TInt i;
-	for (i=0; i<aSize; i+=4)
-		{
-		*pos = -1;
-		pos++;
-		}
-	}
-
-RProperty gThreadsProperty;
-
-
-LOCAL_C TInt BusyThread(TAny* aThreadNo)
-	{
-	TInt threadNo= (TInt) aThreadNo;
-	TInt threadsNeeded;
-	TInt dummy=0;
-	do
-		{
-		TInt count;
-		for (count=0; count<10000; count++)
-			{
-			dummy=(dummy+count/3)/7;
-			}
-
-		gThreadsProperty.Get(threadsNeeded);
-		}
-	while (threadNo<=threadsNeeded);
-	return(KErrNone);
-	}
-
-
-
-const TInt KMaxThreads=16;
-RThread gThreadlist[KMaxThreads];
-TRequestStatus gThreadlist_stat[KMaxThreads];
-
-void AddThread()
-	{
-	if (gThreads==KMaxThreads)
-		return;
-	gThreads+=1;
-	test_KErrNone(gThreadsProperty.Set(gThreads));
-
-	test_KErrNone(gThreadlist[gThreads-1].Create(_L(""),BusyThread,KDefaultStackSize,NULL,(TAny*) gThreads));
-	gThreadlist[gThreads-1].Logon(gThreadlist_stat[gThreads-1]);
-	gThreadlist[gThreads-1].SetPriority(EPriorityLess);
-	gThreadlist[gThreads-1].Resume();
-	}
-void DecThread()
-	{
-	if (gThreads==0)
-		return;
-	gThreads-=1;
-	test_KErrNone(gThreadsProperty.Set(gThreads));
-
-	User::WaitForRequest(gThreadlist_stat[gThreads]);
-	gThreadlist[gThreads].Close();
-	}
-
-void RunTest(TInt aMode)
-	{
-	TAny* buffer;
-	TInt r;
-	gCores = UserSvr::HalFunction(EHalGroupKernel, EKernelHalNumLogicalCpus, 0, 0);
-	test_Compare(gCores, >, 0);
-
-	test.Next(_L("Load test kerncorestats LDD"));
-	r = User::LoadLogicalDevice(KLddName);
-	test_Value(r, r == KErrNone || r == KErrAlreadyExists);  
-	test.Next(_L("Open test kerncorestats LDD"));
-
-	test_KErrNone(gChan.Open());
-	
-	test.Next(_L("Call configure"));
-
-	r = gChan.Configure(aMode);
-	if (r==KErrInUse)
-		{
-		test.Printf(_L("Cannot configure KernCoreStats!!\nThis could be becouse you have already run this test since the last reboot (You can only call it once.) or that you are running a power manager that has already configured this."));
-		test.Printf(_L("Any such power manager must be disabled in order to run this test/util.\n\nPress a key.\n"));
-		test.Getch();
-		}
-	test_KErrNone(r);
-		
-
-	test.Next(_L("Call DumpInfo"));
-
-	r = gChan.DumpInfo();
-	test_NotNegative(r);
-	TInt size = r;
-
-	RProcess thisProcess;
-
-	test_KErrNone(RProperty::Define(thisProcess.SecureId(), 0, RProperty::EInt));
-
-	test_KErrNone(gThreadsProperty.Attach(thisProcess.SecureId(), 0));
-	test_KErrNone(gThreadsProperty.Set(0));
-
-
-	test.Printf(_L("Press a key to show output\n"));
-	test.Getch();
-
-
-	test.Next(_L("Start showing output."));
-	test.Printf(_L("Press ESC to stop. u/k threads h/m delay.\n"));
-
-
-
-	buffer=User::Alloc(size);
-	test_NotNull(buffer);
-
-	CConsoleBase* con = test.Console();
-	TInt y = con->WhereY();
-	TRequestStatus s;
-	TInt keycode;
-
-	do 
-		{
-		con->Read(s);
-		while (s==KRequestPending)
-			{
-			con->SetPos(0,y);
-			InitBuff(buffer,size);
-			test_KErrNone(gChan.GetStats(buffer));
-		
-			DisplayBuf(aMode,buffer);
-			User::After(gDelay*1000);
-			};
-
-		keycode=con->KeyCode();
-		switch ((TChar) keycode)
-			{
-			case 'u': AddThread();
-			break;
-			case 'k': DecThread();
-			break;
-			case 'h': gDelay+=100;
-			break;
-			case 'm': gDelay=(gDelay>99)?gDelay-100:gDelay;
-			break;
-			}
-
-		}
-	while (keycode!=27);
-
-	test.Next(_L("Close test kerncorestats LDD"));
-	while (gThreads>0)
-		DecThread();
-
-	gThreadsProperty.Close();
-	RProperty::Delete(0);
-	gChan.Close();
-
-	test_KErrNone( User::FreeLogicalDevice(KTestKernCoreStatsName) );
-	User::Free(buffer);
-	}
-
-// -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
-
-//
-// ParseCommandLine reads the arguments and sets globals accordingly.
-//
-
-TInt ParseCommandLine()
-	{
-	TInt mode=0;
-	TInt moderead;
-	TBuf<32> args;
-	User::CommandLine(args);
-	TLex lex(args);
-	TInt err=KErrNone;
-	FOREVER
-		{
-		TPtrC token=lex.NextToken();
-		TPtrC subtoken(_L(""));
-
-		if(token.Length()!=0)
-			{
-			if ((token==_L("help")) || (token==_L("-h")) || (token==_L("/h")) || (token==_L("-?")) || (token==_L("/?")))
-				{
-				test.Printf(_L("\nThis tests kerncorestats - but not automatically.  It can only be run *ONCE* per boot.\n\n"));
-				test.Printf(_L("\n -h : Help.\n -m mode number, which specifies which stats are collected."));
-				err=KErrCancel;
-				}
-			
-			else
-				if (token==_L("-m"))
-					{
-					subtoken.Set(lex.NextToken());
-
-					TLex lexv(subtoken);
-
-					if(subtoken.Length()==0)
-						{
-						subtoken.Set(_L("<NOTHING>"));
-						err = KErrArgument;
-						}
-					else if (lexv.Val(moderead)!=KErrNone)
-						err = KErrArgument;
-					else
-						mode|=moderead;
-
-					} // endif -m
-			else
-				{
-				err = KErrArgument;
-				} // endif token 
-			}
-		else
-			break;
-		
-		if (err!=KErrNone)
-			{
-			if (err==KErrArgument)
-				test.Printf(_L("\nUnknown argument '%S%s%S'\n"), &token, (subtoken.Length()==0)?"":" ", &subtoken);
-			test.Printf(_L("\nUsage:  t_kerncorestats -m <mode>\n\n"));
-			test.Getch();
-			return err;
-			}
-		}
-
-	if (mode==0)
-		{
-		mode=63;
-		}
-
-	return mode;
-	}
-
-
-GLDEF_C TInt E32Main()
-	{
-	test.Title();
-	test.Start(_L("KernCoreStats manual test"));
-	TInt mode = ParseCommandLine();
-	if (mode>0)
-		RunTest(mode);
-   	test.End();
-
-	return KErrNone;  
-	}
-
--- a/kerneltest/e32test/misc/t_loadsim.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2351 +0,0 @@
-// Copyright (c) 2009-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\misc\t_loadsim.cpp
-// 
-//
-
-
-//-------------------------------------------------------------------------------------------
-//! @SYMTestCaseID				KBASE-t_loadsim-2705
-//! @SYMTestCaseDesc			verifying the behaviour of the load balancer
-//! @SYMPREQ					417-52765/417-58889
-//! @SYMTestPriority			Critical
-//! @SYMTestActions				
-//! 1. This test runs a variety of loads on an SMP system. Loads types are:
-//!    1.1 Cpu intensive loads
-//!    1.2 memory intensive loads (high locality)
-//!    1.3 memory intensive loads (low locality)
-//!    1.4 memory intensive loads with atomic operations
-//!    1.5 cpu intensive loads with some serialization
-//! 2. For each test, the load is first run on a single cpu locked thread as a baseline
-//!    benchmark. Then the tests are run in the following configurations:
-//!    2.1 For n = 1 to 2*Number of cpus do a run with i threads.
-//!    2.2 For h = 1 to NumCpus ; For n = h to 2*NumCpus; run with h high priorty threads and 
-//!         n standard priority threads, with high priority threads cpu locked.
-//!    2.3 For h = 1 to NumCpus ; For n = h to 2*NumCpus; run with h high priorty threads and 
-//!         n standard priority threads.
-//! @SYMTestExpectedResults 
-//!     test passed. TTest is manual:
-//! 1. For each test we expect to see that the amount of CPU time obtained by each CPU is 
-//!     balanced. That is, all standard priority threads get roughly same amount of CPU time
-//!     and all high priority threads get roughly same amount of CPU time and a higher value
-//!     than lower priority threads.
-//! 2. We also expect the relative efficiency reported by the test between the benchmark
-//!    and each test run to be >=95% on average. Values well below this are acceptable in 
-//!    test runs involving atomic operations (1.4)
-
-//-------------------------------------------------------------------------------------------
-
-#define __E32TEST_EXTENSION__
-#include <e32test.h>
-#include <e32base.h>
-#include <hal.h>
-#include <e32atomics.h>
-#include <u32hal.h>
-#include <e32svr.h>
-
-//#define	TRACE(x)	x
-#define	TRACE(x)
-
-void Panic(TInt aLine)
-	{
-	User::Panic(_L("T_LOADSIM"),aLine);
-	}
-
-#define	assert(x)		((void)((x)||(Panic(__LINE__),0)))
-
-RTest test(_L("T_LOADSIM"));
-
-const TInt KErrCouldNotStart = -99;
-
-volatile TInt STFU = 1;
-
-/******************************************************************************
- * Random Number Generation
- ******************************************************************************/
-void LFSR(TUint64& a)
-	{
-	TInt i;
-	for (i=64; i>0; --i)
-		{
-		TUint64 x = a<<1;
-		TUint64 y = x<<1;
-		x^=y;
-		a = (y>>1) | (x>>63);
-		}
-	}
-
-// Returns 256*log2(a/2^64)
-TInt Log2(TUint64 a)
-	{
-	const TUint64 KBit63 = UI64LIT(0x8000000000000000);
-	TInt n = __e32_find_ms1_64(a);
-	a <<= (63-n);
-	n -= 64;
-	TInt i;
-	for (i=0; i<8; ++i)
-		{
-		a >>= 32;
-		a *= a;
-		n <<= 1;
-		if (a & KBit63)
-			{
-			++n;
-			}
-		else
-			{
-			a <<= 1;
-			}
-		}
-	return n;
-	}
-
-TUint32 ExpRV(TUint64 aU, TUint32 aMean, TUint32 aTick)
-	{
-	TInt n = -Log2(aU);
-	TUint64 x = TUint64(n) * TUint64(aMean);
-	x *= TUint64(22713);	// 2^15 * ln2
-	TUint64 p(aTick);
-	p <<= 22;
-	x += p;
-	p += p;
-	x /= p;
-	return I64LOW(x);
-	}
-
-
-
-/******************************************************************************
- * Generic High-Resolution Timing
- ******************************************************************************/
-class TTimestamp
-	{
-public:
-	typedef void (*TSampleFunc)(TAny*);
-public:
-	void Sample();
-	void Sample(TSampleFunc aFunc, TAny* aPtr);
-	TInt64 operator-(const TTimestamp&) const;
-	static void Init();
-private:
-	TUint32		iF;		// User::FastCounter() value
-	TUint32		iN;		// User::NTickCount() value
-private:
-	static TUint32 FF;	// User::FastCounter() frequency
-	static TUint32 NP;	// User::NTickCount() period
-	static TBool FU;	// User::FastCounter() counts up
-	static TUint32 FWrapM;	// Number of nanokernel ticks for FastCounter() to wrap / 2 * 2^FWrapS
-	static TInt FWrapS;	// Shift so that 2^31<=FWrapM<2^32
-	};
-
-TUint32	TTimestamp::FF;
-TUint32	TTimestamp::NP;
-TBool	TTimestamp::FU;
-TUint32	TTimestamp::FWrapM;
-TInt	TTimestamp::FWrapS;
-
-
-void TTimestamp::Sample()
-	{
-	TUint32 n = User::NTickCount();
-	do	{
-		iN = n;
-		iF = User::FastCounter();
-		n = User::NTickCount();
-		} while (n!=iN);
-	}
-
-void TTimestamp::Sample(TSampleFunc aFunc, TAny* aPtr)
-	{
-	TUint32 n = User::NTickCount();
-	do	{
-		iN = n;
-		(*aFunc)(aPtr);
-		iF = User::FastCounter();
-		n = User::NTickCount();
-		} while (n!=iN);
-	}
-
-// return (x*a)/b
-TUint64 scale(TUint64 x, TUint32 a, TUint32 b)
-	{
-	TUint64 mask = KMaxTUint32;
-	TUint64 x0 = x & mask;
-	TUint64 x1 = x >> 32;
-	x0 *= TUint64(a);
-	x1 *= TUint64(a);
-	x1 += (x0 >> 32);
-	x0 &= mask;
-	TUint64	q1 = x1 / TUint64(b);
-	TUint64 q0 = x1 - q1*TUint64(b);
-	q0 <<= 32;
-	q0 |= x0;
-	q0 /= TUint64(b);
-	return (q1<<32)|q0;
-	}
-
-
-// Return difference between a and this in microseconds
-TInt64 TTimestamp::operator-(const TTimestamp& a) const
-	{
-	TInt sign = 1;
-	TTimestamp start;
-	TTimestamp end;
-	if (iN-a.iN >= 0x80000000u)
-		{
-		sign = -1;
-		start = *this;
-		end = a;
-		}
-	else
-		{
-		start = a;
-		end = *this;
-		}
-	TUint32 fd32 = end.iF - start.iF;
-	if (!FU)
-		fd32 = ~fd32 + 1u;
-	TUint64 nd = TUint64(end.iN) - TUint64(start.iN);
-	nd <<= 31;	// 2^31 * difference in NTickCount
-	TUint64 x = TUint64(fd32) * TUint64(FWrapM);
-	x >>= FWrapS;	// ftick difference * (FWrapM/2^FWrapS) = 2^31 * ntick difference
-	nd -= x;	// Should now be a multiple of 2^31N where N=2^32*ftickp/ntickp
-				// i.e. should be a multiple of 2^63*ftickp/ntickp
-
-	// FWrapM = 2^(31+FWrapS)*ftickp/ntickp
-	// FWrapM << (32-FWrapS) = 2^63*ftickp/ntickp
-	TUint64 m = TUint64(FWrapM) << (32-FWrapS);
-
-	nd += (m>>1);
-	nd /= m;
-
-	nd = (nd<<32) + TUint64(fd32);	// final result in fast counter ticks
-	TInt64 r = scale(nd, 1000000, FF);	// convert to microseconds
-	if (sign<0)
-		r = -r;
-	return r;
-	}
-
-void TTimestamp::Init()
-	{
-	TInt r;
-	r = HAL::Get(HAL::ENanoTickPeriod, (TInt&)NP);
-	assert(r==KErrNone);
-	r = HAL::Get(HAL::EFastCounterFrequency, (TInt&)FF);
-	assert(r==KErrNone);
-	r = HAL::Get(HAL::EFastCounterCountsUp, (TInt&)FU);
-	assert(r==KErrNone);
-	TReal fpn = TReal(FF) * TReal(NP) / 1000000.0;	// fast counter ticks per NTick
-	TReal fwrap = 2147483648.0 / fpn;	// NTicks between fast counter wraparounds / 2
-	TInt exp = 0;
-	while (fwrap < 2147483648.0)
-		{
-		fwrap *= 2.0;
-		++exp;
-		}
-	fwrap += 0.5;
-	if (fwrap >= 4294967296.0)
-		{
-		fwrap *= 0.5;
-		--exp;
-		}
-	FWrapM = (TUint32)fwrap;
-	FWrapS = exp;	// NTicks for 2^31 fast ticks = FWrapM/2^FWrapS
-
-	test.Printf(_L("FastCounter frequency  %uHz\n"), FF);
-	if (FU)
-		test.Printf(_L("FastCounter counts     UP\n"));
-	else
-		test.Printf(_L("FastCounter counts     DOWN\n"));
-	test.Printf(_L("Nanokernel tick period %uus\n"), NP);
-	test.Printf(_L("FWrapM                 %08x\n"), FWrapM);
-	test.Printf(_L("FWrapS                 %d\n"), FWrapS);
-	}
-
-/******************************************************************************
- * CPU Usage Measurement
- ******************************************************************************/
-class TThreadCpuUsageSample
-	{
-public:
-	void Sample(RThread aThread);
-	TInt64 ElapsedTimeDelta(const TThreadCpuUsageSample& aStart) const;
-	TInt64 CpuTimeDelta(const TThreadCpuUsageSample& aStart) const;
-private:
-	static void SampleThreadCpuTime(TAny* aPtr);
-private:
-	TTimestamp	iElapsedTime;
-	TInt64		iCpuTime;
-	RThread		iThread;
-	};
-
-void TThreadCpuUsageSample::Sample(RThread aThread)
-	{
-	iThread = aThread;
-	iElapsedTime.Sample(&SampleThreadCpuTime, this);
-	}
-
-void TThreadCpuUsageSample::SampleThreadCpuTime(TAny* aPtr)
-	{
-	TThreadCpuUsageSample& me = *(TThreadCpuUsageSample*)aPtr;
-	TTimeIntervalMicroSeconds& rt = *(TTimeIntervalMicroSeconds*)&me.iCpuTime;
-	assert(me.iThread.GetCpuTime(rt) == KErrNone);
-	}
-
-TInt64 TThreadCpuUsageSample::ElapsedTimeDelta(const TThreadCpuUsageSample& aStart) const
-	{
-	return iElapsedTime - aStart.iElapsedTime;
-	}
-
-TInt64 TThreadCpuUsageSample::CpuTimeDelta(const TThreadCpuUsageSample& aStart) const
-	{
-	return iCpuTime - aStart.iCpuTime;
-	}
-
-class TCpuUsage
-	{
-public:
-	enum {EMaxCpus=8};
-public:
-	void Sample();
-	TInt64 ElapsedTimeDelta(const TCpuUsage& aStart) const;
-	TInt64 CpuTimeDelta(const TCpuUsage& aStart, TInt aCpu) const;
-	static TInt N() { return NumberOfCpus; }
-public:
-	static void Init();
-private:
-	static void SampleIdleTimes(TAny* aPtr);
-private:
-	TTimestamp	iElapsedTime;
-	TInt64		iIdleTime[EMaxCpus];
-private:
-	static TInt NumberOfCpus;
-	static RThread IdleThread[EMaxCpus];
-	};
-
-TInt TCpuUsage::NumberOfCpus = -1;
-RThread TCpuUsage::IdleThread[TCpuUsage::EMaxCpus];
-
-void TCpuUsage::Init()
-	{
-	TTimestamp::Init();
-
-	NumberOfCpus = UserSvr::HalFunction(EHalGroupKernel, EKernelHalNumLogicalCpus, 0, 0);
-	test.Printf(_L("NumberOfCpus = %d\n"), NumberOfCpus);
-	assert(NumberOfCpus > 0);
-	assert(NumberOfCpus <= EMaxCpus);
-
-	TTimeIntervalMicroSeconds ms;
-	TInt r;
-	r = RThread().GetCpuTime(ms);
-	if (r != KErrNone)
-		{
-		test.Printf(_L("RThread::GetCpuTime() returned %d\n"), r);
-		test.Printf(_L("This test requires a working RThread::GetCpuTime() to run\n"));
-		test(0);
-		}
-
-	TFullName kname;
-	_LIT(KLitKernelName, "ekern.exe*");
-	_LIT(KLitNull, "::Null");
-	TFindProcess fp(KLitKernelName);
-	test_KErrNone(fp.Next(kname));
-	test.Printf(_L("Found kernel process: %S\n"), &kname);
-	kname.Append(KLitNull);
-	TInt i;
-	for (i=0; i<NumberOfCpus; ++i)
-		{
-		TFullName tname(kname);
-		TFullName tname2;
-		if (i>0)
-			tname.AppendNum(i);
-		TFindThread ft(tname);
-		test_KErrNone(ft.Next(tname2));
-		TInt r = IdleThread[i].Open(ft);
-		test_KErrNone(r);
-		IdleThread[i].FullName(tname2);
-		test.Printf(_L("Found and opened %S\n"), &tname2);
-		}
-	}
-
-void TCpuUsage::Sample()
-	{
-	iElapsedTime.Sample(&SampleIdleTimes, this);
-	}
-
-void TCpuUsage::SampleIdleTimes(TAny* aPtr)
-	{
-	TCpuUsage& me = *(TCpuUsage*)aPtr;
-	assert(NumberOfCpus > 0);
-	TInt i;
-	for (i=0; i<NumberOfCpus; ++i)
-		assert(IdleThread[i].GetCpuTime((TTimeIntervalMicroSeconds&)me.iIdleTime[i]) == KErrNone);
-	}
-
-TInt64 TCpuUsage::ElapsedTimeDelta(const TCpuUsage& aStart) const
-	{
-	return iElapsedTime - aStart.iElapsedTime;
-	}
-
-TInt64 TCpuUsage::CpuTimeDelta(const TCpuUsage& aStart, TInt aCpu) const
-	{
-	assert(TUint(aCpu) < TUint(EMaxCpus));
-	if (aCpu >= NumberOfCpus)
-		return 0;
-	TInt64 idle_time = iIdleTime[aCpu] - aStart.iIdleTime[aCpu];
-	TInt64 elapsed_time = iElapsedTime - aStart.iElapsedTime;
-	return elapsed_time - idle_time;
-	}
-
- 
- 
-/******************************************************************************
- * Generic CPU Consumer
- ******************************************************************************/
-enum TCpuEaterType
-	{
-	EEaterStd				=0,		// do CPU-intensive work with few memory references
-	EEaterMemoryLocalS		=1,		// do loads of memory references with reasonable locality, shared
-	EEaterMemoryNonLocalS	=2,		// do loads of memory references with poor locality, shared
-	EEaterMemoryLocalU		=3,		// do loads of memory references with reasonable locality, unshared
-	EEaterMemoryNonLocalU	=4,		// do loads of memory references with poor locality, unshared
-	EEaterMemoryAtomic		=5,		// do loads of atomic memory references
-	EEaterMemoryAtomic2		=6,		// do loads of atomic memory references
-	EEaterAmdahl			=7,		// do CPU-intensive work interspersed with serialized sections
-	};
-
-class CDefaultCpuEater;
-
-class REaterArray;
-class MCpuEater
-	{
-public:
-	MCpuEater();
-	virtual ~MCpuEater();
-	virtual void Eat(TInt aTime, TUint32* aWorkDone)=0;
-	virtual void Calibrate();
-	inline TBool IsCalibrated() { return iCalibration!=0; }
-protected:
-	TUint32 WorkValue(TInt aTime);
-	TUint32	iCalibration;	// work value for 2^16 microseconds
-	TUint16	iInstance;
-	TUint16	iType;
-
-	friend class REaterArray;
-	};
-
-MCpuEater::MCpuEater()
-	{
-	iCalibration = 0;			// uncalibrated
-	iInstance = KMaxTUint16;	// dummy value
-	iType = KMaxTUint16;		// dummy value
-	}
-
-MCpuEater::~MCpuEater()
-	{
-	}
-
-// Calibration is for 2^KLog2CalibrateTime microseconds
-const TInt KLog2CalibrateTime = 13;
-
-TUint32 MCpuEater::WorkValue(TInt aTime)
-	{
-	if (iCalibration == 0)
-		return aTime;
-	TUint64 x = TUint64(aTime) * TUint64(iCalibration);
-	x >>= (KLog2CalibrateTime + 2);	// Factor of 4 margin for slowdowns
-	TUint32 r = I64LOW(x);
-	if (I64HIGH(x))
-		r = KMaxTUint32;
-	if (r == 0)
-		return 1;
-	if (r > iCalibration)
-		return iCalibration;
-	return r;
-	}
-
-void MCpuEater::Calibrate()
-	{
-	iCalibration = 0;
-	TUint32 work = 1;
-	TUint64 used = 1;
-	TUint64 threshold = 1;
-	threshold <<= KLog2CalibrateTime;
-	while (work)
-		{
-		TThreadCpuUsageSample initial;
-		TThreadCpuUsageSample final;
-		initial.Sample(RThread());
-		Eat(work, 0);
-		final.Sample(RThread());
-		used = final.CpuTimeDelta(initial);
-		if (used >= threshold)
-			break;
-		work <<= 1;
-		}
-	assert(work > 0);
-	TUint64 c(work);
-	c <<= KLog2CalibrateTime;
-	c /= used;
-	if (I64HIGH(c))
-		iCalibration = KMaxTUint32;
-	else if (I64LOW(c))
-		iCalibration = I64LOW(c);
-	else
-		iCalibration = 1;
-	test.Printf(_L("MCpuEater::Calibrate() %u\n"), iCalibration);
-	}
-
-
-class REaterArray : public RPointerArray<MCpuEater>
-	{
-public:
-	REaterArray();
-	void Close();
-	MCpuEater* Find(TInt aType, TInt aInstance);
-	MCpuEater* FindOrCreateL(TInt aType, TInt aInstance);
-private:
-	MCpuEater* CreateLC(TInt aType);
-private:
-	class MDummy : public MCpuEater
-		{
-	public:
-		MDummy(TInt aType, TInt aInstance)
-			{ iType=TUint16(aType); iInstance=TUint16(aInstance); }
-		virtual ~MDummy()
-			{}
-		virtual void Eat(TInt, TUint32*)
-			{}
-		};
-private:
-	static TBool Identity(const MCpuEater& aL, const MCpuEater& aR);
-	static TInt Ordering(const MCpuEater& aL, const MCpuEater& aR);
-	};
-
-REaterArray::REaterArray()
-	:	RPointerArray<MCpuEater>(8, 2*256)
-	{
-	}
-
-void REaterArray::Close()
-	{
-	ResetAndDestroy();
-	}
-
-TBool REaterArray::Identity(const MCpuEater& aL, const MCpuEater& aR)
-	{
-	return (aL.iType==aR.iType && aL.iInstance==aR.iInstance);
-	}
-
-TInt REaterArray::Ordering(const MCpuEater& aL, const MCpuEater& aR)
-	{
-	if (aL.iType > aR.iType)
-		return 1;
-	if (aL.iType < aR.iType)
-		return -1;
-	if (aL.iInstance > aR.iInstance)
-		return 1;
-	if (aL.iInstance < aR.iInstance)
-		return -1;
-	return 0;
-	}
-
-MCpuEater* REaterArray::Find(TInt aType, TInt aInstance)
-	{
-	MDummy search(aType, aInstance);
-	TInt ix = FindInOrder(&search, &Ordering);
-	if (ix < 0)
-		return 0;
-	return (*this)[ix];
-	}
-
-MCpuEater* REaterArray::FindOrCreateL(TInt aType, TInt aInstance)
-	{
-	MCpuEater* p = Find(aType, aInstance);
-	if (p)
-		return p;
-	p = CreateLC(aType);
-	p->iType = TUint16(aType);
-	p->iInstance = TUint16(aInstance);
-	InsertInOrderL(p, &Ordering);
-	CleanupStack::Pop();
-	return p;
-	}
-
-/******************************************************************************
- * Generic zero-drift timed events
- ******************************************************************************/
-class CLoadSim;
-class MEvent
-	{
-public:
-	MEvent(CLoadSim*, TInt);
-	virtual void Start()=0;
-	virtual ~MEvent();
-	inline TBool Queued() const
-		{ return iQueued; }
-protected:
-	void QueueAt(TUint32 aTime);
-	void QueueAfter(TUint32 aInterval);
-	void Dequeue();
-	virtual TInt Event();
-	inline TUint64 Random();
-protected:
-	TUint8		iId;
-	TUint8		iQueued;
-	TUint8		iE1;
-	TUint8		iE2;
-	MEvent*		iChain;
-	CLoadSim*	iT;
-	TUint32		iNextEventTime;
-	friend class CLoadSim;
-	};
-
-class CLoadSim : public CActive
-	{
-public:
-	static CLoadSim* NewL();
-	~CLoadSim();
-	inline TInt TimerPeriod() const
-		{ return iTimerPeriod; }
-	TUint64 Random();
-private:
-	CLoadSim();
-	virtual void RunL();
-	virtual void DoCancel();
-	void StartTimer();
-private:
-	RTimer		iTimer;
-	TUint64		iSeed;
-	MEvent*		iNextEvent;
-	TUint32		iIterations;
-	TUint32		iLastTrigger;		// Last trigger time in ticks
-	TInt		iCarry;
-	TInt		iTimerPeriod;		// Timer tick period in microseconds
-	TInt		iMaxDelta;
-	TUint8		iInRunL;
-	TUint8		iTimerRunning;
-	TUint8		iTimerInit;
-	TUint8		iOffsetInit;
-	TUint32		iOffset;
-private:
-	friend class MEvent;
-	};
-
-inline TUint64 MEvent::Random()
-	{ return iT->Random(); }
-
-CLoadSim::CLoadSim()
-	: CActive(EPriorityStandard)
-	{
-	iSeed = 0xadf85458;
-	assert(HAL::Get(HAL::ENanoTickPeriod, iTimerPeriod)==KErrNone);
-	iMaxDelta = KMaxTInt / (2*iTimerPeriod);
-	}
-
-CLoadSim::~CLoadSim()
-	{
-	Cancel();
-	iTimer.Close();
-	}
-
-CLoadSim* CLoadSim::NewL()
-	{
-	CLoadSim* p = new (ELeave) CLoadSim();
-	CleanupStack::PushL(p);
-	User::LeaveIfError(p->iTimer.CreateLocal());
-	CleanupStack::Pop();
-	return p;
-	}
-
-void CLoadSim::DoCancel()
-	{
-	iTimer.Cancel();
-	iTimerRunning = 0;
-	}
-
-void CLoadSim::RunL()
-	{
-	TRACE(RDebug::Printf("!%d\n", iStatus.Int()));
-	iTimerRunning = 0;
-	iInRunL = 1;
-	TUint32 now = iLastTrigger;
-	if (iStatus == KErrNone)
-		{
-		now += iCarry;
-		iLastTrigger = now;
-		}
-	else if (iStatus == KErrArgument)
-		{
-		now += iCarry;
-		}
-	else if (iStatus == KErrCancel)
-		{
-		iLastTrigger += iCarry;	// trigger time was still updated
-		}
-	iCarry = 0;
-	MEvent* e = 0;
-	FOREVER
-		{
-		++iIterations;
-		e = iNextEvent;
-		if (!e || e->iNextEventTime>now)
-			break;
-		iNextEvent = e->iChain;
-		e->iChain = 0;
-		e->iQueued = 0;
-		e->Event();
-		}
-	if (e)
-		{
-		TInt delta = TInt(e->iNextEventTime - iLastTrigger);
-		if (delta > iMaxDelta)
-			delta = iMaxDelta;
-		if (delta < -iMaxDelta)
-			delta = -iMaxDelta;
-		iCarry = delta;
-		TInt us = delta * iTimerPeriod;
-		TRACE(RDebug::Printf("T+%d\n", us));
-		iTimer.AgainHighRes(iStatus, us);
-		SetActive();
-		iTimerRunning = 1;
-		}
-	iInRunL = 0;
-	}
-
-void CLoadSim::StartTimer()
-	{
-	if (iInRunL)
-		return;
-	if (iTimerRunning)
-		{
-		TRACE(RDebug::Printf("TC\n"));
-		iTimer.Cancel();	// will cause RunL with KErrCancel which will restart timer
-		return;
-		}
-	TInt delta = TInt(iNextEvent->iNextEventTime - iLastTrigger);
-	if (delta > iMaxDelta)
-		delta = iMaxDelta;
-	if (delta < -iMaxDelta)
-		delta = -iMaxDelta;
-	iCarry = delta;
-	TInt us = delta * iTimerPeriod;
-	if (iTimerInit)
-		{
-		TRACE(RDebug::Printf("sT+%d\n", us));
-		iTimer.AgainHighRes(iStatus, us);
-		}
-	else
-		{
-		if (!iOffsetInit)
-			iOffsetInit=1, iOffset=User::NTickCount();
-		TRACE(RDebug::Printf("sT++%d\n", us));
-		iTimer.HighRes(iStatus, us);
-		iTimerInit = 1;
-		}
-	SetActive();
-	iTimerRunning = 1;
-	}
-
-TUint64 CLoadSim::Random()
-	{
-	LFSR(iSeed);
-	TUint32 h = I64HIGH(iSeed);
-	TUint32 l = I64LOW(iSeed);
-	h *= 0x9e3779b9u;
-	l *= 0x9e3779b9u;
-	return MAKE_TUINT64(l,h);
-	}
-
-MEvent::MEvent(CLoadSim* aT, TInt aId)
-	{
-	iId = (TUint8)aId;
-	iQueued = 0;
-	iE1 = 0;
-	iE2 = 0;
-	iChain = 0;
-	iT = aT;
-	iNextEventTime = 0;
-	}
-
-MEvent::~MEvent()
-	{
-	if (iT)
-		Dequeue();
-	}
-
-void MEvent::QueueAt(TUint32 aTime)
-	{
-	TRACE(RDebug::Printf("Q%d@%u\n", iId, aTime));
-	if (iQueued)
-		Dequeue();
-	MEvent** p = &iT->iNextEvent;
-	MEvent* e = iT->iNextEvent;
-	for (; e && e->iNextEventTime <= aTime; p=&e->iChain, e=e->iChain)
-		{}
-	iChain = e;
-	*p = this;
-	iNextEventTime = aTime;
-	iQueued = 1;
-	if (iT->iNextEvent==this && !iT->iInRunL)
-		iT->StartTimer();
-	}
-
-void MEvent::QueueAfter(TUint32 aInterval)
-	{
-	TRACE(RDebug::Printf("Q%d+%u\n", iId, aInterval));
-	TUint32 now = User::NTickCount();
-	if (!iT->iTimerInit)
-		iT->iOffset=now, iT->iOffsetInit=1;
-	QueueAt(now-iT->iOffset+aInterval);
-	}
-
-void MEvent::Dequeue()
-	{
-	TRACE(RDebug::Printf("DQ%d\n", iId));
-	if (!iQueued)
-		return;
-	MEvent* e = iT->iNextEvent;
-	for (; e && e->iChain!=this; e=e->iChain)
-		{}
-	if (e)
-		{
-		e->iChain = iChain;
-		}
-	iChain = 0;
-	iQueued = 0;
-	}
-
-TInt MEvent::Event()
-	{
-	TRACE(RDebug::Printf("*%d\n", iId));
-	return iId;
-	}
-
-
-
-/******************************************************************************
- * Poisson process simulation
- ******************************************************************************/
-class MDiscretePoisson : public MEvent
-	{
-public:
-	MDiscretePoisson(CLoadSim* aT, TInt aId, TUint32 aMicroseconds);
-	~MDiscretePoisson();
-	virtual void Start();
-	virtual TInt Event();
-	virtual void PoissonEvent();
-public:
-	TUint32		iUs;
-	TBool		iContinue;
-	};
-
-MDiscretePoisson::MDiscretePoisson(CLoadSim* aT, TInt aId, TUint32 aMicroseconds)
-	:	MEvent(aT, aId)
-	{
-	iUs = aMicroseconds;
-	iContinue = EFalse;
-	}
-
-MDiscretePoisson::~MDiscretePoisson()
-	{
-	}
-
-void MDiscretePoisson::Start()
-	{
-	iContinue = ETrue;
-	TUint32 gap = ExpRV(Random(), iUs, iT->TimerPeriod());
-	TRACE(RDebug::Printf("GG%u\n", gap));
-	QueueAt(iNextEventTime + gap);
-	}
-
-TInt MDiscretePoisson::Event()
-	{
-	PoissonEvent();
-	if (iContinue)
-		Start();
-	return MEvent::Event();
-	}
-
-void MDiscretePoisson::PoissonEvent()
-	{
-	}
-
-
-
-/******************************************************************************
- * Consume a specified amount of CPU time in either a continuous
- * or 'staccato' fashion (i.e. in irregular intervals punctuated by gaps)
- ******************************************************************************/
-class CStaccatoCpuEater : public CActive, public MEvent
-	{
-public:
-	CStaccatoCpuEater(CLoadSim* aT, MCpuEater* aE, TUint32 aGranularity, TUint32 aMeanGap);
-	~CStaccatoCpuEater();
-	void EatMore(TInt64 aMicroseconds);
-	TUint32 WorkDone() const { return iWorkDone; }
-	TUint32 Invocations() const { return iInvocations; }
-private:
-	virtual void RunL();
-	virtual void DoCancel();
-	virtual void Start();
-	virtual TInt Event();
-	void StartEating();
-private:
-	MCpuEater* iE;
-	TUint32 iWorkDone;
-	TUint32 iInvocations;
-	TUint32 iGranularity;
-	TUint32 iMeanGap;
-	TBool iEating;
-	TInt64 iRemainingCpuTime;
-	TTimeIntervalMicroSeconds iInitialCpuTime;
-	TTimeIntervalMicroSeconds iFinalCpuTime;
-	TInt64 iTotalCpuTime;
-	};
-
-CStaccatoCpuEater::CStaccatoCpuEater(CLoadSim* aT, MCpuEater* aE, TUint32 aGranularity, TUint32 aMeanGap)
-	:	CActive(EPriorityIdle),
-		MEvent(aT, 0x53)
-	{
-	iE = aE;
-	iWorkDone = 0;
-	iInvocations = 0;
-	iGranularity = aGranularity;
-	iMeanGap = aMeanGap;
-	iEating = EFalse;
-	iRemainingCpuTime = 0;
-	}
-
-CStaccatoCpuEater::~CStaccatoCpuEater()
-	{
-	Cancel();
-	}
-
-void CStaccatoCpuEater::EatMore(TInt64 aMicroseconds)
-	{
-	TRACE(RDebug::Printf("E+%08x %08x\n", I64HIGH(aMicroseconds), I64LOW(aMicroseconds)));
-	iRemainingCpuTime += aMicroseconds;
-	if (!Queued() && !iEating && iRemainingCpuTime>0)
-		StartEating();
-	}
-
-void CStaccatoCpuEater::RunL()
-	{
-	TInt time = KMaxTInt;
-	if (iRemainingCpuTime < TInt64(KMaxTInt))
-		time = I64LOW(iRemainingCpuTime);
-	++iInvocations;
-	iE->Eat(time, &iWorkDone);
-	TTimeIntervalMicroSeconds ms;
-	TInt r = RThread().GetCpuTime(ms);
-	assert(r==KErrNone);
-	if (ms < iFinalCpuTime)
-		{
-		SetActive();
-		TRequestStatus* pS = &iStatus;
-		User::RequestComplete(pS, 0);
-		return;
-		}
-	iEating = EFalse;
-	TInt64 delta = ms.Int64() - iInitialCpuTime.Int64();
-	iRemainingCpuTime -= delta;
-	iTotalCpuTime += delta;
-	TRACE(RDebug::Printf("D=%8u T=%10u\n",I64LOW(delta),I64LOW(iTotalCpuTime)));
-	if (iRemainingCpuTime > 0)
-		{
-		TUint32 gap = ExpRV(Random(), iMeanGap, iT->TimerPeriod());
-		TRACE(RDebug::Printf("G%u\n", gap));
-		QueueAfter(gap);
-		}
-	}
-
-void CStaccatoCpuEater::DoCancel()
-	{
-	MEvent::Dequeue();
-	iEating = EFalse;
-	}
-
-void CStaccatoCpuEater::Start()
-	{
-	}
-
-TInt CStaccatoCpuEater::Event()
-	{
-	if (!iEating && iRemainingCpuTime>0)
-		{
-		StartEating();
-		}
-	return MEvent::Event();
-	}
-
-void CStaccatoCpuEater::StartEating()
-	{
-	iEating = ETrue;
-	TInt r = RThread().GetCpuTime(iInitialCpuTime);
-	assert(r==KErrNone);
-	if (iGranularity)
-		{
-		TInt howmuch = ExpRV(iT->Random(), iGranularity, 1);
-		TRACE(RDebug::Printf("SE+%08x\n", howmuch));
-		iFinalCpuTime = iInitialCpuTime.Int64() + TInt64(howmuch);
-		}
-	else
-		iFinalCpuTime = iInitialCpuTime.Int64() + iRemainingCpuTime;	// continuous CPU use
-	SetActive();
-	TRequestStatus* pS = &iStatus;
-	User::RequestComplete(pS, 0);
-	}
-
-
-
-/******************************************************************************
- * Consume CPU time in a bursty fashion
- ******************************************************************************/
-class CBurstyCpuEater : public CStaccatoCpuEater, public MDiscretePoisson
-	{
-public:
-	struct SParams
-		{
-		MCpuEater*	iE;
-		TUint32		iGranularity;
-		TUint32		iMeanIntraBurstGap;
-		TUint32		iMeanBurstLength;
-		TUint32		iMeanInterBurstGap;
-		};
-public:
-	CBurstyCpuEater(CLoadSim* aT, const SParams& aParams);
-	~CBurstyCpuEater();
-	virtual void Start();
-	virtual void PoissonEvent();
-public:
-	TUint32		iMeanBurstLength;
-	TUint32		iMeanInterBurstGap;
-	};
-
-CBurstyCpuEater::CBurstyCpuEater(CLoadSim* aT, const SParams& aParams)
-	:	CStaccatoCpuEater(aT, aParams.iE, aParams.iGranularity, aParams.iMeanIntraBurstGap),
-		MDiscretePoisson(aT, 0x42, aParams.iMeanInterBurstGap)
-	{
-	iMeanBurstLength = aParams.iMeanBurstLength;
-	iMeanInterBurstGap = aParams.iMeanInterBurstGap;
-	}
-
-CBurstyCpuEater::~CBurstyCpuEater()
-	{
-	}
-
-void CBurstyCpuEater::Start()
-	{
-	if (iMeanInterBurstGap > 0)
-		{
-		PoissonEvent();
-		MDiscretePoisson::Start();
-		}
-	else
-		{
-		EatMore(iMeanBurstLength);	// one single burst
-		}
-	}
-
-void CBurstyCpuEater::PoissonEvent()
-	{
-	TInt burstLen = ExpRV(CStaccatoCpuEater::Random(), iMeanBurstLength, 1);
-	EatMore(burstLen);
-	}
-
-
-
-/******************************************************************************
- * Stop the active scheduler after a certain time
- ******************************************************************************/
-class CTimedStopper : public CActive
-	{
-public:
-	static CTimedStopper* NewL();
-	~CTimedStopper();
-	void Start(TInt64 aMicroseconds);
-private:
-	CTimedStopper();
-	virtual void RunL();
-	virtual void DoCancel();
-private:
-	RTimer	iTimer;
-	};
-
-CTimedStopper::CTimedStopper()
-	:	CActive(EPriorityHigh)
-	{
-	}
-
-CTimedStopper::~CTimedStopper()
-	{
-	Cancel();
-	iTimer.Close();
-	}
-
-CTimedStopper* CTimedStopper::NewL()
-	{
-	CTimedStopper* p = new (ELeave) CTimedStopper();
-	CleanupStack::PushL(p);
-	User::LeaveIfError(p->iTimer.CreateLocal());
-	CleanupStack::Pop();
-	return p;
-	}
-
-void CTimedStopper::DoCancel()
-	{
-	iTimer.Cancel();
-	}
-
-void CTimedStopper::RunL()
-	{
-	CActiveScheduler::Stop();
-	}
-
-void CTimedStopper::Start(TInt64 aMicroseconds)
-	{
-	TInt p = (TInt)aMicroseconds;
-	iTimer.HighRes(iStatus, p);
-	SetActive();
-	}
-
-
-
-
-
-/******************************************************************************
- * Do something CPU intensive to consume CPU time
- ******************************************************************************/
-class CDefaultCpuEater : public CBase, public MCpuEater
-	{
-public:
-	CDefaultCpuEater();
-	~CDefaultCpuEater();
-	virtual void Eat(TInt aTime, TUint32* aWorkDone);
-protected:
-	TUint64 iX;
-	};
-
-CDefaultCpuEater::CDefaultCpuEater()
-	{
-	iX = 1;
-	}
-
-CDefaultCpuEater::~CDefaultCpuEater()
-	{
-	}
-
-void CDefaultCpuEater::Eat(TInt aTime, TUint32* aWorkDone)
-	{
-	const TUint64 KMagic = UI64LIT(0x9e3779b97f4a7c15);
-	TUint32 work = WorkValue(aTime);
-	if (aWorkDone)
-		*aWorkDone += work;
-	while (work--)
-		iX *= KMagic;
-	}
-
-
-
-/******************************************************************************
- * Do something CPU intensive to consume CPU time, partially serialized
- ******************************************************************************/
-class CAmdahlCpuEater : public CDefaultCpuEater
-	{
-public:
-	static CAmdahlCpuEater* NewLC();
-	~CAmdahlCpuEater();
-	virtual void Eat(TInt aTime, TUint32* aWorkDone);
-protected:
-	CAmdahlCpuEater();
-	void ConstructL();
-protected:
-	RMutex iMutex;
-	TUint32 iFactor;
-	};
-
-CAmdahlCpuEater::CAmdahlCpuEater()
-	{
-	}
-
-CAmdahlCpuEater::~CAmdahlCpuEater()
-	{
-	iMutex.Close();
-	}
-
-CAmdahlCpuEater* CAmdahlCpuEater::NewLC()
-	{
-	CAmdahlCpuEater* p = new (ELeave) CAmdahlCpuEater();
-	CleanupStack::PushL(p);
-	p->ConstructL();
-	return p;
-	}
-
-void CAmdahlCpuEater::ConstructL()
-	{
-	User::LeaveIfError(iMutex.CreateLocal());
-	iFactor = KMaxTUint32 / (4*TCpuUsage::N());
-	}
-
-void CAmdahlCpuEater::Eat(TInt aTime, TUint32* aWorkDone)
-	{
-	TUint64 t(aTime);
-	t *= TUint64(iFactor);
-	t += TUint64(0x80000000u);
-	t >>= 32;
-	TInt stime = I64LOW(t);
-	if (IsCalibrated())
-		{
-		iMutex.Wait();
-		CDefaultCpuEater::Eat(stime, aWorkDone);
-		aTime -= stime;
-		iMutex.Signal();
-		}
-	CDefaultCpuEater::Eat(aTime, aWorkDone);
-	}
-
-
-
-/******************************************************************************
- * Do something memory intensive to consume CPU time
- ******************************************************************************/
-class CMemoryBandwidthEater : public CBase, public MCpuEater
-	{
-public:
-	static CMemoryBandwidthEater* NewLC(TUint32 aSize, TUint32 aRegionSize, TUint32 aRegionOffset);
-	~CMemoryBandwidthEater();
-	virtual void Calibrate();
-protected:
-	CMemoryBandwidthEater(TUint32 aSize, TUint32 aRegionSize, TUint32 aRegionOffset);
-	void ConstructL();
-	virtual void Eat(TInt aTime, TUint32* aWorkDone);
-	TAny* At(TUint32 aRegion, TUint32 aIndex);
-	TAny* StepWithinRegion(TAny* aInitial, TUint32 aStep);
-protected:
-	volatile TUint32 iRegionAlloc;
-	TUint32 iPageSize;
-	TUint32 iSize;				// multiple of page size
-	TAny* iData;				// page aligned
-	RChunk iChunk;
-	TUint8 iLog2RegionSize;		// log2(bytes per region)
-	TUint8 iLog2RO;				// log2(offset from region n to n+1 in bytes)
-	TUint8 iLog2PageSize;
-	TUint8 iRegionBits;			// number of bits to specify region
-	TUint32 iNRgn;
-	TUint32 iRegionMask;
-	TUint32 iLowerIndexMask;
-	TUint32 iUpperIndexMask;
-	};
-
-TUint32 AtomicClearLS1(volatile TUint32* aMask)
-	{
-	TUint32 initial = *aMask;
-	TUint32 final;
-	do	{
-		final = initial & (initial-1);
-		} while(!__e32_atomic_cas_ord32(aMask, &initial, final));
-	return initial;
-	}
-
-TInt AtomicAllocBit(volatile TUint32* aMask)
-	{
-	return __e32_find_ls1_32(AtomicClearLS1(aMask));
-	}
-
-TUint32 AtomicFreeBit(volatile TUint32* aMask, TInt aBit)
-	{
-	return __e32_atomic_ior_ord32(aMask, 1u<<aBit);
-	}
-
-
-
-CMemoryBandwidthEater* CMemoryBandwidthEater::NewLC(TUint32 aSize, TUint32 aRegionSize, TUint32 aRegionOffset)
-	{
-	CMemoryBandwidthEater* p = new (ELeave) CMemoryBandwidthEater(aSize, aRegionSize, aRegionOffset);
-	CleanupStack::PushL(p);
-	p->ConstructL();
-	return p;
-	}
-
-CMemoryBandwidthEater::CMemoryBandwidthEater(TUint32 aSize, TUint32 aRegionSize, TUint32 aRegionOffset)
-	{
-	TInt r = HAL::Get(HAL::EMemoryPageSize, (TInt&)iPageSize);
-	assert(r==KErrNone);
-	iLog2PageSize = (TUint8)__e32_find_ms1_32(iPageSize);
-	assert( !(aRegionSize & (aRegionSize-1)) );
-	assert( !(aRegionOffset & (aRegionOffset-1)) );
-	iLog2RegionSize = (TUint8)__e32_find_ms1_32(aRegionSize);
-	iLog2RO = (TUint8)__e32_find_ms1_32(aRegionOffset);
-	TUint32 round = (aRegionSize>iPageSize) ? aRegionSize : iPageSize;
-	iSize = (aSize + round - 1) &~ (round - 1);
-	--iSize;
-	iSize |= (iSize>>1);
-	iSize |= (iSize>>2);
-	iSize |= (iSize>>4);
-	iSize |= (iSize>>8);
-	iSize |= (iSize>>16);
-	++iSize;
-	iNRgn = iSize >> iLog2RegionSize;
-	if (iNRgn>=32)
-		iRegionAlloc = ~0u;
-	else
-		iRegionAlloc = ~((~0u)<<iNRgn);
-	iRegionBits = TUint8(1 + __e32_find_ms1_32(iNRgn-1));
-	iLowerIndexMask = ~((~0u)<<iLog2RO);
-	iRegionMask = (~((~0u)<<iRegionBits))<<iLog2RO;
-	iUpperIndexMask = ((iSize-1)>>(iRegionBits+iLog2RO))<<(iRegionBits+iLog2RO);
-	}
-
-CMemoryBandwidthEater::~CMemoryBandwidthEater()
-	{
-	iChunk.Close();
-	}
-
-void CMemoryBandwidthEater::ConstructL()
-	{
-	TInt mask = (1<<20)-1;
-	TInt maxSize = (TInt(iSize)+mask)&~mask;
-	User::LeaveIfError(iChunk.CreateLocal(iSize, maxSize, EOwnerThread));
-	iData = iChunk.Base();
-	}
-
-void CMemoryBandwidthEater::Calibrate()
-	{
-	MCpuEater::Calibrate();
-	MCpuEater::Calibrate();
-	}
-
-TAny* CMemoryBandwidthEater::At(TUint32 aRegion, TUint32 aIndex)
-	{
-	TUint32 offset = aIndex & iLowerIndexMask;
-	offset |= (aRegion<<iLog2RO);
-	offset |= ((aIndex<<iRegionBits) & iUpperIndexMask);
-	return ((TUint8*)iData) + offset;
-	}
-
-TAny* CMemoryBandwidthEater::StepWithinRegion(TAny* aInitial, TUint32 aStep)
-	{
-	TUintPtr offset = TUintPtr(aInitial) - TUintPtr(iData);
-	TUintPtr offset2 = offset + (aStep & iLowerIndexMask);
-	if ((offset^offset2)&iRegionMask)
-		{
-		offset2 -= (iLowerIndexMask+1);
-		aStep += (iLowerIndexMask+1);
-		}
-	offset2 += ((aStep<<iRegionBits)&iUpperIndexMask);
-	offset2 &= (iSize-1);
-	return ((TUint8*)iData) + offset2;
-	}
-
-void CMemoryBandwidthEater::Eat(TInt aTime, TUint32* aWorkDone)
-	{
-	TUint32 work = WorkValue(aTime);
-	if (aWorkDone)
-		*aWorkDone += work;
-	TInt region = AtomicAllocBit(&iRegionAlloc);
-	assert(region>=0);
-	TUint32 done = 0;
-	TUint32 rgnsz = 1u << iLog2RegionSize;
-	for (; work; work-=done)
-		{
-		done = (work>rgnsz) ? rgnsz : work;
-		TUint8* p = (TUint8*)At(region,0);
-		TUint8 prev = *p;
-		TUint32 n = done;
-		do	{
-			TUint8* q = p;
-			p = (TUint8*)StepWithinRegion(p, 31);
-			*q = *p;
-			} while(--n);
-		*p = prev;
-		}
-	AtomicFreeBit(&iRegionAlloc, region);
-	}
-
-
-/******************************************************************************
- * Do lots of atomic operations to consume CPU time
- ******************************************************************************/
-class CAtomicMemoryBandwidthEater : public CMemoryBandwidthEater
-	{
-public:
-	static CAtomicMemoryBandwidthEater* NewLC(TUint32 aSize);
-	~CAtomicMemoryBandwidthEater();
-protected:
-	CAtomicMemoryBandwidthEater(TUint32 aSize);
-	void ConstructL();
-	virtual void Eat(TInt aTime, TUint32* aWorkDone);
-protected:
-	volatile TUint32 iX;
-	};
-
-CAtomicMemoryBandwidthEater* CAtomicMemoryBandwidthEater::NewLC(TUint32 aSize)
-	{
-	CAtomicMemoryBandwidthEater* p = new (ELeave) CAtomicMemoryBandwidthEater(aSize);
-	CleanupStack::PushL(p);
-	p->ConstructL();
-	return p;
-	}
-
-CAtomicMemoryBandwidthEater::CAtomicMemoryBandwidthEater(TUint32 aSize)
-	:	CMemoryBandwidthEater(aSize, aSize, aSize)
-	{
-	iX = TUint32(this) ^ RThread().Id().operator TUint();
-	iX *= 0x9e3779b9u;
-	}
-
-CAtomicMemoryBandwidthEater::~CAtomicMemoryBandwidthEater()
-	{
-	}
-
-void CAtomicMemoryBandwidthEater::ConstructL()
-	{
-	CMemoryBandwidthEater::ConstructL();
-	}
-
-TUint32 AtomicRandom(volatile TUint32* a)
-	{
-	TUint32 initial = *a;
-	TUint32 final;
-	do	{
-		final = 69069*initial + 41;
-		} while(!__e32_atomic_cas_ord32(a, &initial, final));
-	return final;
-	}
-
-void CAtomicMemoryBandwidthEater::Eat(TInt aTime, TUint32* aWorkDone)
-	{
-	TUint32 work = WorkValue(aTime);
-	if (aWorkDone)
-		*aWorkDone += work;
-	volatile TUint32* pW = (volatile TUint32*)iData;
-	const TUint32 mask = iSize/sizeof(TUint32)-1;
-	TUint32 x = AtomicRandom(&iX);
-	TUint32 n = work;
-	do	{
-		TUint32 offset = (x>>2) & mask;
-		x = 69069*x+41;
-		__e32_atomic_add_rlx32(pW+offset, 1);
-		} while(--n);
-	}
-
-
-/******************************************************************************
- *
- ******************************************************************************/
-struct SThreadResult
-	{
-	TUint64		iElapsedTime;
-	TUint64		iCpuTime;
-	TUint32		iWorkDone;
-	TUint32		iInvocations;
-	};
-
-struct SThreadParams
-	{
-	TInt64		iTestTime;
-
-	TInt		iId;
-	TUint32		iCpuAffinity;
-
-	TInt		iPriority;
-	RSemaphore	iTurnstile;
-
-	SThreadResult* iResult;
-	TInt		iGroupId;
-
-	MCpuEater*	iE;
-	TUint32		iGranularity;
-	TUint32		iMeanIntraBurstGap;
-	TUint32		iMeanBurstLength;
-	TUint32		iMeanInterBurstGap;
-	};
-
-class MThreadCompletion
-	{
-public:
-	virtual void Complete(TBool aOk, SThreadParams* aParams)=0;
-	};
-
-class CThreadI : public CBase
-	{
-public:
-	CThreadI();
-	~CThreadI();
-	static TInt ThreadFunc(TAny* aPtr);
-	TInt Run();
-	void InitL();
-public:
-	CTrapCleanup*		iCleanup;
-	CActiveScheduler*	iAS;
-	CLoadSim*			iL;
-	CBurstyCpuEater*	iB;
-	CTimedStopper*		iStopper;
-	RSemaphore			iTurnstile;
-	SThreadParams*		iParams;
-	};
-
-CThreadI::CThreadI()
-	{
-	}
-
-CThreadI::~CThreadI()
-	{
-	iTurnstile.Close();
-	delete iStopper;
-	delete iB;
-	delete iL;
-	delete iAS;
-	delete iCleanup;
-	}
-
-TInt CThreadI::ThreadFunc(TAny* aPtr)
-	{
-	CThreadI* p = new CThreadI;
-	if (!p)
-		return KErrNoMemory;
-	p->iParams = (SThreadParams*)aPtr;
-	return p->Run();
-	}
-
-void CThreadI::InitL()
-	{
-	iTurnstile = iParams->iTurnstile;
-	User::LeaveIfError(iTurnstile.Duplicate(RThread(), EOwnerThread));
-	iAS = new (ELeave) CActiveScheduler;
-	CActiveScheduler::Install(iAS);
-	iL = CLoadSim::NewL();
-	CActiveScheduler::Add(iL);
-	const CBurstyCpuEater::SParams* params = (const CBurstyCpuEater::SParams*)&iParams->iE;
-	iB = new (ELeave) CBurstyCpuEater(iL, *params);
-	CActiveScheduler::Add(iB);
-	iStopper = CTimedStopper::NewL();
-	CActiveScheduler::Add(iStopper);
-	memclr(iParams->iResult, sizeof(*iParams->iResult));
-	RThread().SetPriority(TThreadPriority(iParams->iPriority));
-	UserSvr::HalFunction(EHalGroupKernel, EKernelHalLockThreadToCpu, (TAny*)iParams->iCpuAffinity, 0);
-	}
-
-TInt CThreadI::Run()
-	{
-	iCleanup = CTrapCleanup::New();
-	if (!iCleanup)
-		return KErrNoMemory;
-	TRAPD(r,InitL());
-	if (r == KErrNone)
-		{
-		TThreadCpuUsageSample initial;
-		TThreadCpuUsageSample final;
-		RThread::Rendezvous(KErrNone);
-		iTurnstile.Wait();
-		iB->Start();
-		initial.Sample(RThread());
-		iStopper->Start(iParams->iTestTime);
-		CActiveScheduler::Start();
-		final.Sample(RThread());
-		iParams->iResult->iWorkDone = iB->WorkDone();
-		iParams->iResult->iInvocations = iB->Invocations();
-		iParams->iResult->iElapsedTime = final.ElapsedTimeDelta(initial);
-		iParams->iResult->iCpuTime = final.CpuTimeDelta(initial);
-		}
-	delete this;
-	return r;
-	}
-
-
-/******************************************************************************
- *
- ******************************************************************************/
-class CThreadX : public CActive
-	{
-public:
-	static CThreadX* NewL(SThreadParams* aParams, MThreadCompletion* aComplete);
-	static CThreadX* NewLC(SThreadParams* aParams, MThreadCompletion* aComplete);
-	CThreadX();
-	~CThreadX();
-	void ConstructL();
-	virtual void RunL();
-	virtual void DoCancel();
-public:
-	RThread				iThread;
-	RTimer				iTimer;
-	SThreadParams*		iParams;
-	MThreadCompletion*	iComplete;
-	};
-
-CThreadX::CThreadX()
-	:	CActive(EPriorityStandard)
-	{
-	}
-
-CThreadX::~CThreadX()
-	{
-	Cancel();
-	iTimer.Close();
-	iThread.Close();
-	}
-
-CThreadX* CThreadX::NewL(SThreadParams* aParams, MThreadCompletion* aComplete)
-	{
-	CThreadX* p = NewLC(aParams, aComplete);
-	CleanupStack::Pop();
-	return p;
-	}
-
-CThreadX* CThreadX::NewLC(SThreadParams* aParams, MThreadCompletion* aComplete)
-	{
-	CThreadX* p = new (ELeave) CThreadX();
-	p->iParams = aParams;
-	p->iComplete = aComplete;
-	CleanupStack::PushL(p);
-	p->ConstructL();
-	return p;
-	}
-
-const TInt KThreadHeapMin = 0x1000;
-const TInt KThreadHeapMax = 0x200000;
-void CThreadX::ConstructL()
-	{
-	CActiveScheduler::Add(this);
-	TRequestStatus s0, s1;
-	User::LeaveIfError(iTimer.CreateLocal());
-	User::LeaveIfError(iThread.Create(KNullDesC, &CThreadI::ThreadFunc, 0x1000, KThreadHeapMin, KThreadHeapMax, iParams));
-	iThread.Rendezvous(s1);
-	if (s1!=KRequestPending)
-		{
-		User::WaitForRequest(s1);
-		User::Leave(s1.Int());
-		}
-	iTimer.After(s0, 5*1000*1000);
-	iThread.Resume();
-	User::WaitForRequest(s0, s1);
-	if (s1==KRequestPending)
-		{
-		iThread.Terminate(KErrCouldNotStart);
-		User::WaitForRequest(s1);
-		User::Leave(KErrTimedOut);
-		}
-	iTimer.Cancel();
-	User::WaitForRequest(s0);
-	if (iThread.ExitType() != EExitPending)
-		{
-		User::Leave(KErrDied);
-		}
-	iThread.Logon(iStatus);
-	if (iStatus!=KRequestPending)
-		{
-		User::WaitForRequest(iStatus);
-		User::Leave(iStatus.Int());
-		}
-	SetActive();
-	User::LeaveIfError(s1.Int());
-	}
-
-void CThreadX::DoCancel()
-	{
-	iThread.Terminate(KErrCouldNotStart);
-	}
-
-void CThreadX::RunL()
-	{
-	TBool ok = ETrue;
-	if (iThread.ExitType() != EExitKill)
-		ok = EFalse;
-	if (iThread.ExitReason() != KErrNone)
-		ok = EFalse;
-	if (iComplete)
-		iComplete->Complete(ok, iParams);
-	}
-
-
-/******************************************************************************
- *
- ******************************************************************************/
-struct STestThreadDesc
-	{
-	TUint32		iCpuAffinity;
-	TInt		iPriority;
-	TInt		iGroupId;
-	TUint16		iEaterType;
-	TUint16		iEaterInstance;
-	TUint32		iGranularity;
-	TUint32		iMeanIntraBurstGap;
-	TUint32		iMeanBurstLength;
-	TUint32		iMeanInterBurstGap;
-
-	static STestThreadDesc* ContinuousL(TInt aPri = EPriorityNormal);
-	static STestThreadDesc* ContinuousLC(TInt aPri = EPriorityNormal);
-	static STestThreadDesc* StaccatoL(TUint32 aGranularity, TUint32 aMeanGap, TInt aPri = EPriorityNormal);
-	static STestThreadDesc* StaccatoLC(TUint32 aGranularity, TUint32 aMeanGap, TInt aPri = EPriorityNormal);
-	};
-
-STestThreadDesc* STestThreadDesc::ContinuousLC(TInt aPri)
-	{
-	STestThreadDesc* p = (STestThreadDesc*)User::AllocLC(sizeof(STestThreadDesc));
-	p->iCpuAffinity = 0xffffffff;
-	p->iPriority = aPri;
-	p->iGroupId = 0;
-	p->iEaterType = EEaterStd;
-	p->iEaterInstance = 0;
-	p->iGranularity = 0;
-	p->iMeanIntraBurstGap = 0;
-	p->iMeanBurstLength = KMaxTInt32;
-	p->iMeanInterBurstGap = 0;
-	return p;
-	}
-
-STestThreadDesc* STestThreadDesc::ContinuousL(TInt aPri)
-	{
-	STestThreadDesc* p = ContinuousLC(aPri);
-	CleanupStack::Pop();
-	return p;
-	}
-
-STestThreadDesc* STestThreadDesc::StaccatoLC(TUint32 aGranularity, TUint32 aMeanGap, TInt aPri)
-	{
-	STestThreadDesc* p = (STestThreadDesc*)User::AllocLC(sizeof(STestThreadDesc));
-	p->iCpuAffinity = 0xffffffff;
-	p->iPriority = aPri;
-	p->iGroupId = 0;
-	p->iEaterType = EEaterStd;
-	p->iEaterInstance = 0;
-	p->iGranularity = aGranularity;
-	p->iMeanIntraBurstGap = aMeanGap;
-	p->iMeanBurstLength = KMaxTInt32;
-	p->iMeanInterBurstGap = 0;
-	return p;
-	}
-
-STestThreadDesc* STestThreadDesc::StaccatoL(TUint32 aGranularity, TUint32 aMeanGap, TInt aPri)
-	{
-	STestThreadDesc* p = StaccatoLC(aGranularity, aMeanGap, aPri);
-	CleanupStack::Pop();
-	return p;
-	}
-
-
-class CTest : public CBase, public MThreadCompletion
-	{
-public:
-	struct SStats
-		{
-		TInt64	iTotalCpu;
-		TInt64	iMinCpu;
-		TInt64	iMaxCpu;
-		TInt64	iTotalWork;
-		TInt64	iMinWork;
-		TInt64	iMaxWork;
-		};
-public:
-	static CTest* NewL(TInt64 aTestTime, TInt aNumTypes, ...);
-	~CTest();
-	RPointerArray<SThreadParams>& Threads()
-		{ return iP; }
-	TInt Execute();
-	void PrintResults() const;
-	void GetStats(SStats& aStats, TInt aFirstThread=0, TInt aCount=KMaxTInt) const;
-	TInt64 TotalCpuAll() const;
-private:
-	CTest();
-	void ConstructL(TInt64 aTestTime, TInt aNumTypes, VA_LIST aList);
-	SThreadParams* AddThreadParamsL();
-	CThreadX* AddThreadXL(SThreadParams* aParams);
-
-	virtual void Complete(TBool aOk, SThreadParams* aParams);
-private:
-	RPointerArray<SThreadParams> iP;
-	RPointerArray<CThreadX> iTX;
-	REaterArray iEaters;
-	RSemaphore iTurnstile;
-	TInt iCompleteCount;
-	TCpuUsage iInitialCpuUsage;
-	TCpuUsage iFinalCpuUsage;
-	};
-
-CTest::CTest()
-	:	iP(32),
-		iTX(32)
-	{
-	}
-
-CTest::~CTest()
-	{
-	iTX.ResetAndDestroy();
-
-	TInt i;
-	TInt c = iP.Count();
-	for (i=0; i<c; ++i)
-		{
-		SThreadParams* p = iP[i];
-		iP[i] = 0;
-		if (p)
-			{
-			User::Free(p->iResult);
-			User::Free(p);
-			}
-		}
-	iP.Close();
-	iEaters.Close();
-	iTurnstile.Close();
-	}
-
-CTest* CTest::NewL(TInt64 aTestTime, TInt aNumTypes, ...)
-	{
-	VA_LIST list;
-	VA_START(list, aNumTypes);
-	CTest* p = new (ELeave) CTest;
-	CleanupStack::PushL(p);
-	p->ConstructL(aTestTime, aNumTypes, list);
-	CleanupStack::Pop();
-	return p;
-	}
-
-SThreadParams* CTest::AddThreadParamsL()
-	{
-	SThreadResult* tr = (SThreadResult*)User::AllocLC(sizeof(SThreadResult));
-	SThreadParams* tp = (SThreadParams*)User::AllocLC(sizeof(SThreadParams));
-	memclr(tr, sizeof(SThreadResult));
-	tp->iResult = tr;
-	iP.AppendL(tp);
-	CleanupStack::Pop(2);
-	tp->iTurnstile = iTurnstile;
-	return tp;
-	}
-
-CThreadX* CTest::AddThreadXL(SThreadParams* aP)
-	{
-	if (aP->iGranularity==0 && aP->iMeanInterBurstGap==0)
-		{
-		// continuous use thread
-		if (TInt64(aP->iMeanBurstLength) >= aP->iTestTime)
-			aP->iMeanBurstLength = I64LOW(aP->iTestTime) + (I64LOW(aP->iTestTime)>>1);
-		}
-	CThreadX* tx = CThreadX::NewLC(aP, this);
-	iTX.AppendL(tx);
-	CleanupStack::Pop();
-	return tx;
-	}
-
-void CTest::Complete(TBool aOk, SThreadParams*)
-	{
-	if (!aOk || --iCompleteCount==0)
-		CActiveScheduler::Stop();
-	}
-
-
-void CTest::ConstructL(TInt64 aTestTime, TInt aNumTypes, VA_LIST aList)
-	{
-	typedef const STestThreadDesc* TTestThreadDescPtrC;
-
-	User::LeaveIfError(iTurnstile.CreateLocal(0));
-	TInt tt;
-	TInt tid = 0;
-	for (tt=0; tt<aNumTypes; ++tt)
-		{
-		TInt nThreads = VA_ARG(aList, TInt);
-		TInt inc = 0;
-		const TTestThreadDescPtrC* ppttd = 0;
-		TTestThreadDescPtrC pttd = 0;
-		if (nThreads < 0)
-			{
-			ppttd = VA_ARG(aList, const TTestThreadDescPtrC*);
-			nThreads = -nThreads;
-			inc = 1;
-			}
-		else
-			{
-			pttd = VA_ARG(aList, TTestThreadDescPtrC);
-			ppttd = &pttd;
-			}
-		TInt k;
-		for (k=0; k<nThreads; ++k, ++tid)
-			{
-			const STestThreadDesc& ttd = **ppttd;
-			ppttd += inc;
-			SThreadParams* tp = AddThreadParamsL();
-			tp->iId = tid;
-			tp->iTestTime = aTestTime;
-			tp->iCpuAffinity = ttd.iCpuAffinity;
-			tp->iPriority = ttd.iPriority;
-			tp->iGroupId = ttd.iGroupId;
-			tp->iE = iEaters.FindOrCreateL(ttd.iEaterType, ttd.iEaterInstance);
-			tp->iGranularity = ttd.iGranularity;
-			tp->iMeanIntraBurstGap = ttd.iMeanIntraBurstGap;
-			tp->iMeanBurstLength = ttd.iMeanBurstLength;
-			tp->iMeanInterBurstGap = ttd.iMeanInterBurstGap;
-			AddThreadXL(tp);
-			}
-		}
-	}
-
-TInt CTest::Execute()
-	{
-	iCompleteCount = iP.Count();
-	iInitialCpuUsage.Sample();
-	iTurnstile.Signal(iCompleteCount);
-	CActiveScheduler::Start();
-	iFinalCpuUsage.Sample();
-	return iCompleteCount ? KErrGeneral : KErrNone;
-	}
-
-void CTest::GetStats(SStats& a, TInt aFirstThread, TInt aCount) const
-	{
-	a.iTotalCpu = 0;
-	a.iMinCpu = KMaxTInt64;
-	a.iMaxCpu = KMinTInt64;
-	a.iTotalWork = 0;
-	a.iMinWork = KMaxTInt64;
-	a.iMaxWork = KMinTInt64;
-	TInt nt = iP.Count();
-	if (aFirstThread > nt)
-		aFirstThread = nt;
-	if (aCount > nt - aFirstThread)
-		aCount = nt - aFirstThread;
-	TInt i = aFirstThread;
-	for (; i<aFirstThread+aCount; ++i)
-		{
-		SThreadResult* tr = iP[i]->iResult;
-		TInt64 cpu = tr->iCpuTime;
-		TInt64 work = tr->iWorkDone;
-		a.iTotalCpu += cpu;
-		a.iTotalWork += work;
-		if (cpu < a.iMinCpu)
-			a.iMinCpu = cpu;
-		if (cpu > a.iMaxCpu)
-			a.iMaxCpu = cpu;
-		if (work < a.iMinWork)
-			a.iMinWork = work;
-		if (work > a.iMaxWork)
-			a.iMaxWork = work;
-		}
-	}
-
-TInt64 CTest::TotalCpuAll() const
-	{
-	TInt i;
-	TInt nc = TCpuUsage::N();
-	TInt64 totalCpuAll = 0;
-	for (i=0; i<nc; ++i)
-		{
-		TInt64 u = iFinalCpuUsage.CpuTimeDelta(iInitialCpuUsage, i);
-		totalCpuAll += u;
-		}
-	return totalCpuAll;
-	}
-
-void CTest::PrintResults() const
-	{
-	TInt i;
-	TInt nt = iP.Count();
-	TInt nc = TCpuUsage::N();
-	TInt64 totalCpuAll = 0;
-	TInt64 totalCpu = 0;
-	TInt64 totalWork = 0;
-	for (i=0; i<nt; ++i)
-		{
-		SThreadResult* tr = iP[i]->iResult;
-		test.Printf(_L("%2u: E=%10u     C=%10u     I=%10u     W=%10u\n"),
-			i, I64LOW(tr->iElapsedTime), I64LOW(tr->iCpuTime), tr->iInvocations, tr->iWorkDone );
-		totalCpu += tr->iCpuTime;
-		totalWork += TInt64(tr->iWorkDone);
-		}
-	test.Printf(_L("Total              C=%12Lu                    W=%12Lu\n"), totalCpu, totalWork);
-	for (i=0; i<nc; ++i)
-		{
-		TInt64 u = iFinalCpuUsage.CpuTimeDelta(iInitialCpuUsage, i);
-		totalCpuAll += u;
-		test.Printf(_L("Cpu%1u: %10u "), i, I64LOW(u));
-		}
-	test.Printf(_L("\n"));
-	test.Printf(_L("Total %12Lu\n"), totalCpuAll);
-	}
-
-
-
-MCpuEater* REaterArray::CreateLC(TInt aType)
-	{
-	switch (aType)
-		{
-		case EEaterStd:
-			{
-			CDefaultCpuEater* p = new (ELeave) CDefaultCpuEater();
-			CleanupStack::PushL(p);
-			p->Calibrate();
-			return p;
-			}
-		case EEaterMemoryLocalS:
-			{
-			CMemoryBandwidthEater* p = CMemoryBandwidthEater::NewLC(0x8000, 0x0800, 0x0800);
-			p->Calibrate();
-			return p;
-			}
-		case EEaterMemoryNonLocalS:
-			{
-			CMemoryBandwidthEater* p = CMemoryBandwidthEater::NewLC(0x100000, 0x10000, 0x4);
-			p->Calibrate();
-			return p;
-			}
-		case EEaterMemoryLocalU:
-			{
-			CMemoryBandwidthEater* p = CMemoryBandwidthEater::NewLC(0x4000, 0x4000, 0x4000);
-			p->Calibrate();
-			return p;
-			}
-		case EEaterMemoryNonLocalU:
-			{
-			CMemoryBandwidthEater* p = CMemoryBandwidthEater::NewLC(0x80000, 0x80000, 0x80000);
-			p->Calibrate();
-			return p;
-			}
-		case EEaterMemoryAtomic:
-			{
-			CAtomicMemoryBandwidthEater* p = CAtomicMemoryBandwidthEater::NewLC(0x1000);
-			p->Calibrate();
-			return p;
-			}
-		case EEaterMemoryAtomic2:
-			{
-			CAtomicMemoryBandwidthEater* p = CAtomicMemoryBandwidthEater::NewLC(0x8000);
-			p->Calibrate();
-			return p;
-			}
-		case EEaterAmdahl:
-			{
-			CAmdahlCpuEater* p = CAmdahlCpuEater::NewLC();
-			p->Calibrate();
-			return p;
-			}
-		default:
-			User::Leave(KErrNotSupported);
-		}
-	return 0;
-	}
-
-
-
-/******************************************************************************
- *
- ******************************************************************************/
-
-void RunBenchmarkL(CTest::SStats& aB, STestThreadDesc* aT, TInt aLength)
-	{
-	const TInt NC = TCpuUsage::N();
-	CTest* p;
-	TUint32 saved_aff = aT->iCpuAffinity;
-	aT->iCpuAffinity = NC-1;
-	p = CTest::NewL(aLength, 1, 1, aT);
-	TInt r = p->Execute();
-	test_KErrNone(r);
-	p->PrintResults();
-	p->GetStats(aB);
-	delete p;
-	aT->iCpuAffinity = saved_aff;
-	}
-
-void CompareToBenchmark(const CTest::SStats& aS, const CTest::SStats& aB)
-	{
-	TReal bCpu = (TReal)aB.iTotalCpu;
-	TReal bWork = (TReal)aB.iTotalWork;
-	TReal bEff = bWork/bCpu*1000000.0;
-	TReal tCpu = (TReal)aS.iTotalCpu;
-	TReal tWork = (TReal)aS.iTotalWork;
-	TReal tEff = tWork/tCpu*1000000.0;
-	TReal mCpu = (TReal)aS.iMinCpu;
-	TReal MCpu = (TReal)aS.iMaxCpu;
-	TReal mWork = (TReal)aS.iMinWork;
-	TReal MWork = (TReal)aS.iMaxWork;
-	test.Printf(_L("Total CPU usage %6.1f%% of benchmark\n"), 100.0*tCpu/bCpu);
-	test.Printf(_L("Total work done %6.1f%% of benchmark\n"), 100.0*tWork/bWork);
-	test.Printf(_L("Max/min ratio   %6.1f%% (CPU) %6.1f%% (Work)\n"), 100.0*MCpu/mCpu, 100.0*MWork/mWork);
-	test.Printf(_L("Work/sec bench: %10.1f test: %10.1f  Relative Efficiency %6.1f%%\n"), bEff, tEff, tEff/bEff*100.0);
-	}
-
-void ContinuousTestL(TInt aLength, TUint32 aWhich)
-	{
-	aLength *= 1000;
-	const TInt NC = TCpuUsage::N();
-	TInt r = 0;
-	TInt i = 0;
-	CTest::SStats benchmark;
-	CTest::SStats st;
-	CTest::SStats stm;
-	CTest* p = 0;
-	TUint et = aWhich >> 28;
-	TBool separate = (aWhich & 0x08000000u);
-	TInt instance = 0;
-	STestThreadDesc* td[2*TCpuUsage::EMaxCpus] = {0};
-	STestThreadDesc* tdm[TCpuUsage::EMaxCpus] = {0};
-	STestThreadDesc* tdl[TCpuUsage::EMaxCpus] = {0};
-	for (i=0; i<2*NC; ++i)
-		{
-		td[i] = STestThreadDesc::ContinuousLC();
-		td[i]->iEaterType = (TUint16)et;
-		td[i]->iEaterInstance = (TUint16)(separate ? (instance++) : 0);
-		if (i<NC)
-			{
-			tdm[i] = STestThreadDesc::ContinuousLC(EPriorityMore);
-			tdm[i]->iEaterType = (TUint16)et;
-			tdm[i]->iEaterInstance = (TUint16)(separate ? (instance++) : 0);
-			tdl[i] = STestThreadDesc::ContinuousLC();
-			tdl[i]->iCpuAffinity = i;
-			tdl[i]->iEaterType = (TUint16)et;
-			tdl[i]->iEaterInstance = (TUint16)(separate ? (instance++) : 0);
-			}
-		}
-
-	test.Printf(_L("\nTesting a single continuous CPU-locked thread\n"));
-	RunBenchmarkL(benchmark, tdl[NC-1], aLength);
-
-	TInt n;
-
-	if (aWhich & 1)
-		{
-		for (n=1; n<=2*NC; ++n)
-			{
-			test.Printf(_L("\nTesting %d continuous thread(s) ...\n"), n);
-			p = CTest::NewL(aLength, 1, -n, td);
-			r = p->Execute();
-			test_KErrNone(r);
-			p->PrintResults();
-			p->GetStats(st);
-			delete p;
-			CompareToBenchmark(st, benchmark);
-			}
-		}
-
-	TInt h;
-	if (aWhich & 2)
-		{
-		for (h=1; h<NC; ++h)
-			{
-			for (n=h; n<=2*NC; ++n)
-				{
-				TInt l = n - h;
-				test.Printf(_L("\nTesting %d continuous thread(s) (%d higher priority) CPU-locked...\n"), n, h);
-				p = CTest::NewL(aLength, 2, -h, tdl, l, tdl[h]);
-				r = p->Execute();
-				test_KErrNone(r);
-				p->PrintResults();
-				p->GetStats(st, h, l);
-				p->GetStats(stm, 0, h);
-				delete p;
-				CompareToBenchmark(stm, benchmark);
-				if (l>0)
-					CompareToBenchmark(st, benchmark);
-				}
-			}
-		}
-
-	if (aWhich & 4)
-		{
-		for (h=1; h<NC; ++h)
-			{
-			for (n=h; n<=2*NC; ++n)
-				{
-				TInt l = n - h;
-				test.Printf(_L("\nTesting %d continuous thread(s) (%d higher priority)...\n"), n, h);
-				p = CTest::NewL(aLength, 2, -h, tdm, -l, td);
-				r = p->Execute();
-				test_KErrNone(r);
-				p->PrintResults();
-				p->GetStats(st, h, l);
-				p->GetStats(stm, 0, h);
-				delete p;
-				CompareToBenchmark(stm, benchmark);
-				if (l>0)
-					CompareToBenchmark(st, benchmark);
-				}
-			}
-		}
-
-	CleanupStack::PopAndDestroy(NC*4);
-	}
-
-
-void TestWithOneSpecialL(const TDesC& aTitle, TInt aLength, const CTest::SStats& aB1, const CTest::SStats& aB0, STestThreadDesc* aT1, STestThreadDesc* aT0)
-	{
-	const TInt NC = TCpuUsage::N();
-	CTest::SStats st;
-	CTest::SStats sti;
-	CTest* p = 0;
-	TInt n;
-	TInt r;
-	for (n=1; n<=2*NC-1; ++n)
-		{
-		test.Printf(_L("\nTesting %d continuous thread(s) plus %S ...\n"), n, &aTitle);
-		p = CTest::NewL(aLength, 2, 1, aT1, n, aT0);
-		r = p->Execute();
-		test_KErrNone(r);
-		p->PrintResults();
-		p->GetStats(st, 1, n);
-		p->GetStats(sti, 0, 1);
-		delete p;
-		CompareToBenchmark(sti, aB1);
-		CompareToBenchmark(st, aB0);
-
-		test.Printf(_L("\nTesting %d continuous thread(s) plus %Sh ...\n"), n, &aTitle);
-		TInt orig_pri = aT1->iPriority;
-		aT1->iPriority = EPriorityMore;
-		p = CTest::NewL(aLength, 2, 1, aT1, n, aT0);
-		r = p->Execute();
-		test_KErrNone(r);
-		p->PrintResults();
-		p->GetStats(st, 1, n);
-		p->GetStats(sti, 0, 1);
-		delete p;
-		CompareToBenchmark(sti, aB1);
-		CompareToBenchmark(st, aB0);
-		aT1->iPriority = orig_pri;
-		}
-	}
-
-void ContinuousPlusIntermittentTestL(TInt aLength, TUint32 aWhich)
-	{
-	aLength *= 1000;
-	const TInt NC = TCpuUsage::N();
-	TInt i = 0;
-	CTest::SStats bmc, bmilc, bmilf, bmihc, bmihf;
-	STestThreadDesc* td = STestThreadDesc::ContinuousLC();
-	STestThreadDesc* tdl[TCpuUsage::EMaxCpus] = {0};
-	STestThreadDesc* tdilc[TCpuUsage::EMaxCpus] = {0};	// light load, coarse grained
-	STestThreadDesc* tdilf[TCpuUsage::EMaxCpus] = {0};	// light load, fine grained
-	STestThreadDesc* tdihc[TCpuUsage::EMaxCpus] = {0};	// heavy load, coarse grained
-	STestThreadDesc* tdihf[TCpuUsage::EMaxCpus] = {0};	// heavy load, fine grained
-	for (i=0; i<NC; ++i)
-		{
-		tdl[i] = STestThreadDesc::ContinuousLC();
-		tdl[i]->iCpuAffinity = i;
-		tdilc[i] = STestThreadDesc::StaccatoLC(45000, 500000);
-		tdilf[i] = STestThreadDesc::StaccatoLC(1000, 50000);
-		tdihc[i] = STestThreadDesc::StaccatoLC(400000, 500000);
-		tdihf[i] = STestThreadDesc::StaccatoLC(3000, 5000);
-		}
-
-	test.Printf(_L("\nTesting a single continuous CPU-locked thread\n"));
-	RunBenchmarkL(bmc, tdl[NC-1], aLength);
-
-	if (aWhich & 1)
-		{
-		test.Printf(_L("\nTesting a single ILC CPU-locked thread\n"));
-		RunBenchmarkL(bmilc, tdilc[NC-1], aLength);
-		}
-
-	if (aWhich & 2)
-		{
-		test.Printf(_L("\nTesting a single ILF CPU-locked thread\n"));
-		RunBenchmarkL(bmilf, tdilf[NC-1], aLength);
-		}
-
-	if (aWhich & 4)
-		{
-		test.Printf(_L("\nTesting a single IHC CPU-locked thread\n"));
-		RunBenchmarkL(bmihc, tdihc[NC-1], aLength);
-		}
-
-	if (aWhich & 8)
-		{
-		test.Printf(_L("\nTesting a single IHF CPU-locked thread\n"));
-		RunBenchmarkL(bmihf, tdihf[NC-1], aLength);
-		}
-
-	if (aWhich & 1)
-		{
-		TestWithOneSpecialL(_L("ILC"), aLength, bmilc, bmc, tdilc[0], td);
-		}
-	if (aWhich & 2)
-		{
-		TestWithOneSpecialL(_L("ILF"), aLength, bmilf, bmc, tdilf[0], td);
-		}
-	if (aWhich & 4)
-		{
-		TestWithOneSpecialL(_L("IHC"), aLength, bmihc, bmc, tdihc[0], td);
-		}
-	if (aWhich & 8)
-		{
-		TestWithOneSpecialL(_L("IHF"), aLength, bmihf, bmc, tdihf[0], td);
-		}
-	CleanupStack::PopAndDestroy(5*NC+1);
-	}
-
-
-TInt E32Main()
-	{
-	RThread().SetPriority(EPriorityAbsoluteHigh);
-	test.Title();
-	User::SetCritical(User::ESystemCritical);
-	TCpuUsage::Init();
-	TInt r = 0;
-
-	CTrapCleanup* cln = CTrapCleanup::New();
-	test_NotNull(cln);
-	CActiveScheduler* as = new CActiveScheduler;
-	test_NotNull(as);
-	CActiveScheduler::Install(as);
-
-	test.Printf(_L("\n************************************************************************\n"));
-	test.Printf(_L("* Testing with CPU intensive loads...\n"));
-	test.Printf(_L("************************************************************************\n"));
-	TRAP(r, ContinuousTestL(3000, 1+4));
-	test_KErrNone(r);
-	TRAP(r, ContinuousTestL(10000, 1+4));
-	test_KErrNone(r);
-	TRAP(r, ContinuousPlusIntermittentTestL(10000, 15));
-	test_KErrNone(r);
-
-	test.Printf(_L("\n************************************************************************\n"));
-	test.Printf(_L("* Testing with memory intensive loads, good locality...\n"));
-	test.Printf(_L("************************************************************************\n"));
-	TRAP(r, ContinuousTestL(3000, 1+4+0x08000000u+(EEaterMemoryLocalU<<28)));
-	test_KErrNone(r);
-	TRAP(r, ContinuousTestL(10000, 1+4+0x08000000u+(EEaterMemoryLocalU<<28)));
-	test_KErrNone(r);
-
-	test.Printf(_L("\n************************************************************************\n"));
-	test.Printf(_L("* Testing with memory intensive loads, poor locality...\n"));
-	test.Printf(_L("************************************************************************\n"));
-	TRAP(r, ContinuousTestL(3000, 1+4+0x08000000u+(EEaterMemoryNonLocalU<<28)));
-	test_KErrNone(r);
-	TRAP(r, ContinuousTestL(10000, 1+4+0x08000000u+(EEaterMemoryNonLocalU<<28)));
-	test_KErrNone(r);
-
-	test.Printf(_L("\n************************************************************************\n"));
-	test.Printf(_L("* Testing with memory intensive loads, atomic operations...\n"));
-	test.Printf(_L("************************************************************************\n"));
-	TRAP(r, ContinuousTestL(3000, 1+4+(EEaterMemoryAtomic<<28)));
-	test_KErrNone(r);
-	TRAP(r, ContinuousTestL(10000, 1+4+(EEaterMemoryAtomic<<28)));
-	test_KErrNone(r);
-
-	test.Printf(_L("\n************************************************************************\n"));
-	test.Printf(_L("* Testing with memory intensive loads, atomic operations 2...\n"));
-	test.Printf(_L("************************************************************************\n"));
-	TRAP(r, ContinuousTestL(3000, 1+4+(EEaterMemoryAtomic2<<28)));
-	test_KErrNone(r);
-	TRAP(r, ContinuousTestL(10000, 1+4+(EEaterMemoryAtomic2<<28)));
-	test_KErrNone(r);
-
-	test.Printf(_L("\n************************************************************************\n"));
-	test.Printf(_L("* Testing with CPU intensive loads with some serialization...\n"));
-	test.Printf(_L("************************************************************************\n"));
-	TRAP(r, ContinuousTestL(3000, 1+4+(EEaterAmdahl<<28)));
-	test_KErrNone(r);
-	TRAP(r, ContinuousTestL(10000, 1+4+(EEaterAmdahl<<28)));
-	test_KErrNone(r);
-
-	delete as;
-	delete cln;
-	return r;
-	}
-
--- a/kerneltest/e32test/misc/t_svr3.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/misc/t_svr3.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -578,8 +578,7 @@
 // Override heap creation for this process
 // This function runs at the beginning of every thread
 // Initial heap is shared but subsequent heaps are single threaded
-
-EXPORT_C TInt UserHeap::SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo)
+TInt UserHeap::SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo)
 	{
 	TInt r = KErrNone;
 	if (!aInfo.iAllocator && aInfo.iHeapInitialSize>0)
--- a/kerneltest/e32test/misc/t_svr6.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/misc/t_svr6.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -706,8 +706,7 @@
 // Override heap creation for this process
 // This function runs at the beginning of every thread
 // Initial heap is shared but subsequent heaps are single threaded
-
-EXPORT_C TInt UserHeap::SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo)
+TInt UserHeap::SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo)
 	{
 	TInt r = KErrNone;
 	if (!aInfo.iAllocator && aInfo.iHeapInitialSize>0)
--- a/kerneltest/e32test/misc/t_tmout.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/misc/t_tmout.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -132,11 +132,12 @@
 	RandomSignalInterval = interval;
 	RandomSignalCount = interval;
 
-	volatile TInt forever = 1;
-	while(forever)
+	FOREVER
 		{
 		test.Printf(_L("Total: %8d Timeout: %8d Bad: %4d Bad0: %4d Bad1: %4d\n"), TotalCount, TimeoutCount, BadCount, Bad0Count, Bad1Count);
 		User::After(1000000);
 		}
+
+
 	return 0;
 	}
--- a/kerneltest/e32test/misc/t_uid.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/misc/t_uid.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -45,6 +45,7 @@
 const TUid g2 = {0x10000002};
 const TUid g22 = {0x10000002};
 const TUid g3 = {0x10000003};
+const TUid g33 = {0x10000003};
 
 LOCAL_C void testUid()
 //
--- a/kerneltest/e32test/misc/t_ymodemz.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/misc/t_ymodemz.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -211,6 +211,7 @@
 			r=Initialise(z);
 			CHECK(r);
 			test.Printf(_L("Read header\n"));
+			TUint32 c=0;
 			RThread t;
 			t.SetHandle(z.iThreadHandle);
 			while (z.iRemain && z.iThreadStatus==KRequestPending)
@@ -227,6 +228,7 @@
 					{
 					// after reading first block, process the header
 					ProcessHeader(z);
+					c=User::NTickCount();
 					}
 				}
 			test.Printf(_L("\nWait for thread to exit\n"));
--- a/kerneltest/e32test/misc/t_zip.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/misc/t_zip.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -22,10 +22,8 @@
 
 TInt64 CrashTime() {return 0;}
 
-RFs gFs;
+RFs TheFs;
 RFile TheOutFile;
-CFileMan* gFileMan;
-_LIT(KZipFile,"c:\\out.zip");
 				
 class TCrashTestGzip : public MCrashGzip
 	{
@@ -40,10 +38,9 @@
 
 void TCrashTestGzip::SetOutput()
 	{
-	TInt r=TheOutFile.Replace(gFs, KZipFile, EFileWrite);
+	TInt r=TheOutFile.Replace(TheFs, _L("c:\\out.zip"),EFileWrite);
 	test(r==KErrNone);
-	TBool bOk=Init();
-	test(bOk);
+	Init();
 	}
 
 
@@ -62,18 +59,14 @@
 
 
 _LIT8(KText, "12345");
-const TUint32 KTextSize = 5;
+
 
 GLDEF_C TInt E32Main()
 	{
 	test.Title();
 
 	test.Start(_L("Connect to file server"));
-
-	CTrapCleanup* ct = CTrapCleanup::New();
-	test(ct!=0);
-	test(gFs.Connect()==KErrNone);
-	TRAPD(r, gFileMan=CFileMan::NewL(gFs));
+	TInt r=TheFs.Connect();
 	test(r==KErrNone);
 
 	test.Next(_L("Making zip file"));
@@ -82,30 +75,8 @@
 	zip.Write(KText);
 	zip.FlushEnd();
 
-	// get the number of uncompressed bytes and check that it matches the string
-	TUint32 uncompressedBytes=zip.GetDataCompressed();
-	test(uncompressedBytes==KTextSize);
-
 	TheOutFile.Close();
-
-	test.Next(_L("Re-open zip file and check size"));
-	// Check that file exists
-	r=TheOutFile.Open(gFs, KZipFile, EFileRead);
-	test(r==KErrNone);
-	
-	//check size
-	TInt size=0;
-	r=TheOutFile.Size(size);
-	test(r==KErrNone && size>0);
-
-	TheOutFile.Close();
-
-	// Cleanup
-	gFileMan->Delete(KZipFile);
-	delete gFileMan;
-	gFs.Close();
-	delete ct;
-	test.End();
+	TheFs.Close();
 
 	return KErrNone;
 	}
--- a/kerneltest/e32test/misc/ymodemtx.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,472 +0,0 @@
-// Copyright (c) 2009-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\misc\ymodemtx.cpp
-// 
-//
-
-#include <e32std.h>
-#include <e32svr.h>
-#include <f32file.h>
-#include <d32comm.h>
-
-RFs TheFs;
-RFile TheFile;
-TInt FileSize;
-RBusDevComm TheComm;
-RTimer TheTimer;
-TFileName FileName;
-TFileName FileName8b;
-TPtr8 FileName8(0,0,0);
-
-const TUint8 STX=0x02;
-const TUint8 EOT=0x04;
-const TUint8 ACK=0x06;
-const TUint8 BIGC=0x43;
-const TUint8 BIGG=0x47;
-
-#define PACKET_SIZE		1024
-
-#define MIN(a,b)		((a)<(b)?(a):(b))
-#define OFFSET(p,off)	((void*)((char*)p+off))
-
-#define RESET_COMM()	TheComm.ResetBuffers()
-
-#define assert(x)			((void)( (x) || (__Panic(__LINE__, #x),0) ))
-#define assert_KErrNone(r)	((void)( ((r)==KErrNone) || (__Panic(__LINE__, (r)),0) ))
-
-
-void __Panic(TInt aLine, TInt aError)
-	{
-	RDebug::Printf("Line %d Expected KErrNone got %d", aLine, aError);
-	User::Panic(_L("YMODEMTX"), aLine);
-	}
-
-void __Panic(TInt aLine, const char* aMessage)
-	{
-	RDebug::Printf("Line %d Assertion \"%s\" failed", aLine, aMessage);
-	User::Panic(_L("YMODEMTX"), aLine);
-	}
-
-/*
-YModem packet structure:
-Byte 0 = STX
-Byte 1 = sequence number (first user data packet is 1)
-Byte 2 = complement of sequence number
-Bytes 3-1026 = data (1K per packet)
-Bytes 1027, 1028 = 16-bit CRC (big-endian)
-
-A herald packet is sent first, with sequence number 0
-The data field consists of the null-terminated file name
-followed by the null-terminated file size in ASCII decimal
-digits.
-*/
-struct SPacket
-	{
-	TUint8 iPTI;
-	TUint8 iSeq;
-	TUint8 iSeqBar;
-	TUint8 iData[PACKET_SIZE];
-	TUint8 iCRC1;
-	TUint8 iCRC0;
-	};
-
-static const TUint16 crcTab[256] =
-    {
-	0x0000,0x1021,0x2042,0x3063,0x4084,0x50a5,0x60c6,0x70e7,0x8108,0x9129,0xa14a,
-	0xb16b,0xc18c,0xd1ad,0xe1ce,0xf1ef,0x1231,0x0210,0x3273,0x2252,0x52b5,0x4294,
-	0x72f7,0x62d6,0x9339,0x8318,0xb37b,0xa35a,0xd3bd,0xc39c,0xf3ff,0xe3de,0x2462,
-	0x3443,0x0420,0x1401,0x64e6,0x74c7,0x44a4,0x5485,0xa56a,0xb54b,0x8528,0x9509,
-	0xe5ee,0xf5cf,0xc5ac,0xd58d,0x3653,0x2672,0x1611,0x0630,0x76d7,0x66f6,0x5695,
-	0x46b4,0xb75b,0xa77a,0x9719,0x8738,0xf7df,0xe7fe,0xd79d,0xc7bc,0x48c4,0x58e5,
-	0x6886,0x78a7,0x0840,0x1861,0x2802,0x3823,0xc9cc,0xd9ed,0xe98e,0xf9af,0x8948,
-	0x9969,0xa90a,0xb92b,0x5af5,0x4ad4,0x7ab7,0x6a96,0x1a71,0x0a50,0x3a33,0x2a12,
-	0xdbfd,0xcbdc,0xfbbf,0xeb9e,0x9b79,0x8b58,0xbb3b,0xab1a,0x6ca6,0x7c87,0x4ce4,
-	0x5cc5,0x2c22,0x3c03,0x0c60,0x1c41,0xedae,0xfd8f,0xcdec,0xddcd,0xad2a,0xbd0b,
-	0x8d68,0x9d49,0x7e97,0x6eb6,0x5ed5,0x4ef4,0x3e13,0x2e32,0x1e51,0x0e70,0xff9f,
-	0xefbe,0xdfdd,0xcffc,0xbf1b,0xaf3a,0x9f59,0x8f78,0x9188,0x81a9,0xb1ca,0xa1eb,
-	0xd10c,0xc12d,0xf14e,0xe16f,0x1080,0x00a1,0x30c2,0x20e3,0x5004,0x4025,0x7046,
-	0x6067,0x83b9,0x9398,0xa3fb,0xb3da,0xc33d,0xd31c,0xe37f,0xf35e,0x02b1,0x1290,
-	0x22f3,0x32d2,0x4235,0x5214,0x6277,0x7256,0xb5ea,0xa5cb,0x95a8,0x8589,0xf56e,
-	0xe54f,0xd52c,0xc50d,0x34e2,0x24c3,0x14a0,0x0481,0x7466,0x6447,0x5424,0x4405,
-	0xa7db,0xb7fa,0x8799,0x97b8,0xe75f,0xf77e,0xc71d,0xd73c,0x26d3,0x36f2,0x0691,
-	0x16b0,0x6657,0x7676,0x4615,0x5634,0xd94c,0xc96d,0xf90e,0xe92f,0x99c8,0x89e9,
-	0xb98a,0xa9ab,0x5844,0x4865,0x7806,0x6827,0x18c0,0x08e1,0x3882,0x28a3,0xcb7d,
-	0xdb5c,0xeb3f,0xfb1e,0x8bf9,0x9bd8,0xabbb,0xbb9a,0x4a75,0x5a54,0x6a37,0x7a16,
-	0x0af1,0x1ad0,0x2ab3,0x3a92,0xfd2e,0xed0f,0xdd6c,0xcd4d,0xbdaa,0xad8b,0x9de8,
-	0x8dc9,0x7c26,0x6c07,0x5c64,0x4c45,0x3ca2,0x2c83,0x1ce0,0x0cc1,0xef1f,0xff3e,
-	0xcf5d,0xdf7c,0xaf9b,0xbfba,0x8fd9,0x9ff8,0x6e17,0x7e36,0x4e55,0x5e74,0x2e93,
-	0x3eb2,0x0ed1,0x1ef0
-    };
-
-void UpdateCrc(const void* aPtr, TInt aLength, TUint16& aCrc)
-//
-// Perform a CCITT CRC checksum.
-//
-	{
-
-	register const TUint8* pB = (const TUint8*)aPtr;
-	register TUint16 crc=aCrc;
-    while (aLength--)
-		crc=TUint16((crc<<8)^crcTab[(crc>>8)^*pB++]);
-	aCrc=crc;
-	}
-
-void ClearCommError()
-	{
-	}
-
-TInt CommRead1(TInt aTimeout)
-	{
-	TBuf8<1> c;
-	TRequestStatus s0, s1;
-	TheComm.ReadOneOrMore(s1, c);
-	TheTimer.After(s0, aTimeout*1000);
-	User::WaitForRequest(s0, s1);
-	if (s1 != KRequestPending)
-		{
-		TheTimer.Cancel();
-		User::WaitForRequest(s0);
-		return (s1==KErrNone) ? c[0] : s1.Int();
-		}
-	TheComm.ReadCancel();
-	User::WaitForRequest(s1);
-	return KErrTimedOut;
-	}
-
-TInt CommRead(TDes8& aBuf, TInt aTimeout)
-	{
-	aBuf.Zero();
-	TRequestStatus s0, s1;
-	TInt timeout = aTimeout * 1000;
-
-	TUint8* b = (TUint8*)aBuf.Ptr();
-	while (aBuf.Length() < aBuf.MaxLength())
-		{
-		TPtr8 p(b+aBuf.Length(), 0, aBuf.MaxLength()-aBuf.Length());
-		TheComm.ReadOneOrMore(s1, p);
-		TheTimer.After(s0, timeout);
-		User::WaitForRequest(s0, s1);
-		if (s1 == KErrNone)
-			{
-			TheTimer.Cancel();
-			User::WaitForRequest(s0);
-			aBuf.SetLength(aBuf.Length() + p.Length());
-			timeout = 500000;
-			continue;
-			}
-		if (s1 != KRequestPending)
-			{
-			TheTimer.Cancel();
-			User::WaitForRequest(s0);
-			break;
-			}
-		if (s0 != KRequestPending)
-			{
-			TheComm.ReadCancel();
-			User::WaitForRequest(s1);
-			break;
-			}
-		}
-	if (aBuf.Length()==0)
-		return KErrTimedOut;
-	return aBuf.Length();
-	}
-
-void CommWrite(const TDesC8& aBuf)
-	{
-	TRequestStatus s;
-	TheComm.Write(s, aBuf);
-	User::WaitForRequest(s);
-	}
-
-void CommWriteC(TUint aChar)
-	{
-	TBuf8<1> b;
-	b.SetLength(1);
-	b[0] = (TUint8)aChar;
-	CommWrite(b);
-	}
-
-void CommWriteS(const char* aString)
-	{
-	CommWrite(TPtrC8((const TUint8*)aString));
-	}
-
-TInt PreparePacket(SPacket& pkt, TInt aSeq)
-	{
-	TInt r = KErrNone;
-	TUint16 crc = 0;
-
-	pkt.iPTI = STX;
-	pkt.iSeq = (TUint8)(aSeq>=0 ? aSeq : 0);
-	pkt.iSeqBar = (TUint8)~pkt.iSeq;
-	if (aSeq>0)
-		{
-		TInt l;
-		TInt fpos = (aSeq-1)*PACKET_SIZE;	// file position of packet
-		if ( fpos >= FileSize )
-			return KErrEof;
-		l = MIN(PACKET_SIZE, FileSize-fpos);
-		TPtr8 d(pkt.iData, 0, l);
-		assert_KErrNone(TheFile.Read(d));
-		if (l<PACKET_SIZE)
-			memset(pkt.iData+l, 0, PACKET_SIZE-l);
-		}
-	else
-		{
-		memset(pkt.iData, 0, PACKET_SIZE);
-		if (aSeq==0)
-			{
-			TInt pos = FileName8.LocateReverse('\\');
-			TPtrC8 fn8(FileName8.Mid(pos+1));
-			memcpy(pkt.iData, fn8.Ptr(), fn8.Length());
-			TPtr8 d2(pkt.iData+fn8.Length()+1, 0, PACKET_SIZE-fn8.Length()-1);
-			d2.Num(FileSize);
-			}
-		}
-	UpdateCrc(pkt.iData, PACKET_SIZE, crc);
-	pkt.iCRC1 = (TUint8)(crc>>8);
-	pkt.iCRC0 = (TUint8)crc;
-	return r;
-	}
-
-TInt SendPacket(TInt& aSeq, TBool aStream)
-	{
-	TInt c;
-	SPacket pkt;
-	TInt retries = 10;
-	TInt tmout = (aSeq>=0) ? 2000 : 500;
-	TInt r = PreparePacket(pkt, aSeq);
-	if (r!=KErrNone)
-		return r;
-	for(;;)
-		{
-		RESET_COMM();
-		CommWrite(TPtrC8( (const TUint8*)&pkt, sizeof(pkt) ));
-		if (aStream)
-			break;
-		c = CommRead1(tmout);
-		if (c==KErrTimedOut && aSeq<0)
-			return KErrNone;
-		if (c>=0)
-			{
-			if (c==ACK)
-				break;
-			}
-		if (--retries==0)
-			return KErrTimedOut;
-		}
-	if (aSeq==0)
-		{
-		c = CommRead1(100);
-		if (c==KErrTimedOut)
-			{
-			++aSeq;
-			return KErrNone;
-			}
-		if (aStream && c!=BIGG)
-			return KErrTimedOut;
-		else if (!aStream && c!=BIGC)
-			return KErrTimedOut;
-		}
-	++aSeq;
-	return r;
-	}
-
-TInt SendImageFile()
-	{
-	TInt r = 0;
-	TInt b1;
-	TBool stream;
-	TInt seq = 0;
-
-	RESET_COMM();
-	r = CommRead1(20000);
-	if (r<0)
-		return r;
-	if (r!=BIGG && r!=BIGC)
-		return KErrTimedOut;
-	stream = (r==BIGG);
-	seq = 0;
-	r = KErrNone;
-	while (r==KErrNone)
-		{
-		r = SendPacket(seq, stream);
-		}
-	if (r!=KErrEof)
-		return r;
-	r=KErrNone;
-	RESET_COMM();
-	CommWriteC(EOT);
-	b1 = CommRead1(500);
-	if (b1==KErrTimedOut)
-		return KErrNone;
-	if (b1!=ACK)
-		return KErrNone;
-	b1 = CommRead1(1000);
-	if (b1==KErrTimedOut)
-		return KErrNone;
-	if (stream && b1!=BIGG)
-		return KErrNone;
-	else if (!stream && b1!=BIGC)
-		return KErrNone;
-	seq = -1;
-	r = SendPacket(seq, stream);
-	return r;
-	}
-
-
-#define	ALLOWBPS(x)	case x : bps = EBps##x; break
-
-void ParseCommandLine()
-	{
-	TInt r = 0;
-	TInt cmdLineLen = User::CommandLineLength();
-	HBufC* cmdLine = HBufC::New(cmdLineLen);
-	assert(cmdLine!=0);
-	TPtr cmdLineW(cmdLine->Des());
-	User::CommandLine(cmdLineW);
-	TLex16 cmdLineLex(*cmdLine);
-	TInt baud = 115200;
-	TInt port = 0;
-	while (!cmdLineLex.Eos())
-		{
-		TPtrC token(cmdLineLex.NextToken());
-		cmdLineLex.SkipSpace();
-		if (token[0]=='-')
-			{
-			switch (token[1])
-				{
-				case 'p':
-					{
-					r = cmdLineLex.Val(port);
-					assert_KErrNone(r);
-					break;
-					}
-				case 'b':
-					{
-					r = cmdLineLex.Val(baud);
-					assert_KErrNone(r);
-					break;
-					}
-				default:
-					assert(0);
-					break;
-				}
-			continue;
-			}
-		FileName = token;
-		assert(cmdLineLex.Eos());
-		}
-	assert(FileName.Length()>0);
-
-	TBps bps = EBpsSpecial;
-	switch (baud)
-		{
-		ALLOWBPS(50);
-		ALLOWBPS(75);
-		ALLOWBPS(110);
-		ALLOWBPS(134);
-		ALLOWBPS(150);
-		ALLOWBPS(300);
-		ALLOWBPS(600);
-		ALLOWBPS(1200);
-		ALLOWBPS(1800);
-		ALLOWBPS(2000);
-		ALLOWBPS(2400);
-		ALLOWBPS(3600);
-		ALLOWBPS(4800);
-		ALLOWBPS(7200);
-		ALLOWBPS(9600);
-		ALLOWBPS(19200);
-		ALLOWBPS(38400);
-		ALLOWBPS(57600);
-		ALLOWBPS(115200);
-		ALLOWBPS(230400);
-		ALLOWBPS(460800);
-		ALLOWBPS(576000);
-		ALLOWBPS(1152000);
-		ALLOWBPS(4000000);
-		ALLOWBPS(921600);
-		}
-	assert(bps != EBpsSpecial);
-
-	assert_KErrNone(TheFs.Connect());
-	assert_KErrNone(TheFile.Open(TheFs, FileName, EFileShareReadersOnly|EFileRead));
-	assert_KErrNone(TheFile.Size(FileSize));
-	FileName8b = FileName;
-	new (&FileName8) TPtr8(FileName8b.Collapse());
-	assert(TheComm.Open(port)==KErrNone);
-	TCommConfig cfgBuf;
-	TCommConfigV01& cfg = cfgBuf();
-	cfg.iRate = bps;
-	cfg.iDataBits = EData8;
-	cfg.iStopBits = EStop1;
-	cfg.iParity = EParityNone;
-	cfg.iHandshake = 0;
-	cfg.iParityError = 0;
-	cfg.iFifo = EFifoEnable;
-	cfg.iSpecialRate = 0;
-	cfg.iTerminatorCount = 0;
-	cfg.iSIREnable = ESIRDisable;
-	cfg.iSIRSettings = KConfigSIRShutDown;
-	assert_KErrNone(TheComm.SetConfig(cfgBuf));
-	CommWrite(_L8("Sending "));
-	CommWrite(FileName8);
-	CommWrite(_L8("\r\nWaiting for YModem or YModem-G receive...\r\n"));
-	}
-
-_LIT(KLddName,"ECOMM");
-_LIT(KPddName,"EUART");
-
-void LoadCommDrivers()
-	{
-	TInt r=User::LoadLogicalDevice(KLddName);
-	if (r!=KErrAlreadyExists)
-		assert_KErrNone(r);
-
-	TInt i;
-	TInt n=0;
-	for (i=-1; i<10; ++i)
-		{
-		TBuf<16> pddName=KPddName();
-		if (i>=0)
-			pddName.Append('0'+i);
-		r=User::LoadPhysicalDevice(pddName);
-		if (r==KErrNone || r==KErrAlreadyExists)
-			++n;
-		}
-	assert(n!=0);
-	}
-
-TInt E32Main()
-	{
-	TInt r;
-
-	LoadCommDrivers();
-	ParseCommandLine();
-
-	r = TheTimer.CreateLocal();
-	assert_KErrNone(r);
-
-	r = SendImageFile();
-	assert_KErrNone(r);
-
-	TheTimer.Close();
-	TheComm.Close();
-	TheFile.Close();
-	TheFs.Close();
-
-	return KErrNone;
-	}
--- a/kerneltest/e32test/mmu/d_demandpaging.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/mmu/d_demandpaging.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -158,7 +158,7 @@
 	case RDemandPagingTestLdd::ESetRealtimeTrace:
 		{
 #if defined(_DEBUG)
-		TUint32 bit = TUint32(1U<<(KREALTIME&31));
+		TUint32 bit = TUint32(1<<(KREALTIME&31));
 		__e32_atomic_axo_ord32(&Kern::SuperPage().iDebugMask[KREALTIME>>5], ~bit, a1?bit:0);
 #if 0 // can enable this to help debugging
 		bit = (1<<(KPAGING&31));
--- a/kerneltest/e32test/mmu/d_gobble.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/mmu/d_gobble.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -167,7 +167,7 @@
 TUint32 DGobbler::AllocMultiPage(TUint32 aSize)
 	{
 	TUint32 sz = 1u << __e32_find_ms1_32(aSize);	// round size down to power of 2
-	while (sz >= iPageSize)
+	while (sz > iPageSize)
 		{
 		TPhysAddr pa;
 		TInt r = Epoc::AllocPhysicalRam(sz, pa);
--- a/kerneltest/e32test/mmu/d_memorytest.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/mmu/d_memorytest.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -42,7 +42,7 @@
 private:
 	TInt TestAllocZerosMemory();
 	TInt TestReAllocZerosMemory();
-	TInt AllocTest1(TInt aSize);
+	TInt AllocTest1();
 	TInt ReAllocTest1();
 	TInt ReAllocTest2(TUint8*& mem1, TUint8*& mem2, TUint8*& mem3);
 	TInt AllocPhysTest(TUint32 aIters, TUint32 aSize); 
@@ -135,7 +135,7 @@
 		TUint32 value=(TUint32)a2;
 #ifdef _DEBUG
 		TInt debugMask = Kern::CurrentThread().iDebugMask;
-		Kern::CurrentThread().iDebugMask = debugMask&~(1U<<KPANIC);
+		Kern::CurrentThread().iDebugMask = debugMask&~(1<<KPANIC);
 #endif
 		XTRAP(r, XT_DEFAULT,
 			if(aFunction==RMemoryTestLdd::EReadWriteMemory)
@@ -215,12 +215,12 @@
 #ifdef _DEBUG
 		DThread& thread = Kern::CurrentThread();
 		TInt debugMask = thread.iDebugMask;
-		if(debugMask&(1U<<KPANIC))
+		if(debugMask&(1<<KPANIC))
 			old = true;
 		if(a1)
-			debugMask |= (1U<<KPANIC);
+			debugMask |= (1<<KPANIC);
 		else
-			debugMask &= ~(1U<<KPANIC);
+			debugMask &= ~(1<<KPANIC);
 		thread.iDebugMask = debugMask;
 #endif
 		return old;
@@ -434,32 +434,29 @@
 	{
 	TInt count = 100;
 	TInt r = KErrNotSupported;
-	TInt size = 256;
 
 	do	{	//re-try up to 100 times if memory conditions are not correct
-		r=AllocTest1(size);
-		size -= 2;
-		} while(((r == KErrNoMemory)||(r == KErrUnknown)) && --count );
+		r=AllocTest1();
+		} while(((r == KErrNoMemory)||(r == KErrUnknown)) && --count);
 
 	return r;
 	}
 
-TInt DMemoryTestChannel::AllocTest1(TInt aSize)
+TInt DMemoryTestChannel::AllocTest1()
 	{
+	const TInt KSize = 256;
 	TInt err = KErrNone;
-	TUint8* mem1 = (TUint8*)Kern::Alloc(aSize);
+	TUint8* mem1 = (TUint8*)Kern::Alloc(KSize);
 	if (!mem1)
 		return KErrNoMemory;
-  	memset(mem1, 0xff, aSize);	
+	memset(mem1, KSize, 0xff);
 	Kern::Free(mem1);
-	TUint8* mem2 = (TUint8*)Kern::Alloc(aSize);
+	TUint8* mem2 = (TUint8*)Kern::Alloc(KSize);
 	if (!mem2)
 		return KErrNoMemory;
-	
 	if (mem1 != mem2)
 		err = KErrUnknown;	// Test inconclusive, can retry
-
-	for (TInt i = 0 ; i<aSize && err==KErrNone; ++i)
+	for (TInt i = 0 ; i<KSize && err==KErrNone; ++i)
 		{
 		if (mem2[i] != 0)
 			FAIL_ALLOC_TEST(1, i, mem2[i]);
@@ -501,7 +498,7 @@
 // The actual size of the block allocated given the size requested.
 #define ALIGNED_SIZE(aReqSize) (_ALIGN_UP(aReqSize + RHeap::EAllocCellSize, RHeap::ECellAlignment) - RHeap::EAllocCellSize)
 
-// We only allocate blocks where the size we get is the size we ask for - this
+// We only acllocate blocks where the size we get is the size we ask for - this
 // just makes testing easier.
 const TInt KSize = ALIGNED_SIZE(200), KHalfSize = ALIGNED_SIZE(100), KSmallSize = ALIGNED_SIZE(50);
 
@@ -526,19 +523,14 @@
 		Kern::Free(mem2);
 		return KErrUnknown; // Don't expect move on shrink
 		}
-	//
-	// With DL allocator growth into original area cannot be expected !
-	//
-//	mem2 = (TUint8*)Kern::ReAlloc(mem1, KSize); // 3
-/*	
+	mem2 = (TUint8*)Kern::ReAlloc(mem1, KSize); // 3
 	if (mem1 != mem2)
 		{
 		mem1 = 0;
 		Kern::Free(mem2);
 		return KErrUnknown; // Expect growth into original area
 		}
-*/
-  	mem1 = (TUint8*)Kern::ReAlloc(mem1, KSize); // 3	
+	
 	TInt i;
 	for (i = 0 ; i<KHalfSize && err==KErrNone; ++i)
 		{
@@ -572,48 +564,27 @@
 	mem2 = (TUint8*)Kern::Alloc(KSmallSize); // 2
 	if (!mem2)
 		return KErrNoMemory;
-	//
-	// The following exception is not possible with DL allocator
-	//
-/*	
 	if (mem2 <= (mem1 + KSmallSize))
 		return KErrUnknown;	// Expect mem2 higher than mem1
-*/		
 	memset(mem2, 0xee, KSmallSize);		
 	mem3 = (TUint8*)Kern::Alloc(KSize); // 3
 	if (!mem3)
 		return KErrNoMemory;
-	//
-	// The following exception is not possible with DL allocator
-	//
-/*	
 	if (mem3 <= (mem2 + KSmallSize))
-		return KErrUnknown+2;	// Expect mem3 higher than mem2
-*/		
+		return KErrUnknown;	// Expect mem3 higher than mem2
 	memset(mem3, 0xdd, KSize);
 	Kern::Free(mem3);
-
-/*	
 	TUint8* m3 = mem3;
-*/	
 	mem3 = NULL;
-
 	TUint8* mem4 = (TUint8*)Kern::ReAlloc(mem1, KSize); // 4
 	if (!mem4)
-		return KErrNoMemory;
-	//
-	// The following exceptions are not possible with DL allocator
-	//
-/*	
-	if (mem3 <= (mem2 + KSmallSize))
-		return KErrUnknown+2;	// Expect mem3 higher than mem2
+		return KErrNoMemory;	
 	if (mem4 == mem1)
 		return KErrUnknown; // Expect move on grow
 	mem1=mem4;
 	if (mem4 != m3)
 		return KErrUnknown; // Expect to realloc to use old mem3 space
-*/
-	mem1=mem4;	
+	
 	TInt i;
 	TInt err = KErrNone;
 	for (i = 0 ; i<KSmallSize && err==KErrNone; ++i)
--- a/kerneltest/e32test/mmu/d_sharedchunk.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/mmu/d_sharedchunk.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -697,7 +697,7 @@
 				TInt addr = kernAddr+i1;
 #ifdef _DEBUG
 				TInt debugMask = Kern::CurrentThread().iDebugMask;
-				Kern::CurrentThread().iDebugMask = debugMask&~(1U<<KPANIC);
+				Kern::CurrentThread().iDebugMask = debugMask&~(1<<KPANIC);
 #endif
 				XTRAP(r, XT_DEFAULT, 
 					if(aFunction==RSharedChunkLdd::ECheckMemory)
--- a/kerneltest/e32test/mmu/freeram.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/mmu/freeram.h	Wed Sep 01 12:34:56 2010 +0100
@@ -18,32 +18,16 @@
 #ifndef __FREERAM_H__
 #define __FREERAM_H__
 
-/**
-Get the amount of free RAM in the system in bytes.
-
-This calls the kernel HAL supervisor barrier to ensure that asynchronous cleanup in the supervisor
-happens before the amount of free RAM is measured.
-
-There is also the option to wait for upto a specified timeout for the system to become idle.
-
-@param aIdleTimeoutMs If non-zero, the number of milliseconds to wait for the system to become idle.
-
-@return On sucess returns the amount of free RAM in bytes, KErrTimedOut if the timeout expired
-        without the system becoming idle, or one of the other system-wide error codes.
-*/
-TInt FreeRam(TInt aIdleTimeoutMs = 0)
+//
+// returns the free RAM in bytes
+//
+inline TInt FreeRam()
 	{
 	// wait for any async cleanup in the supervisor to finish first...
-	TInt r = UserSvr::HalFunction(EHalGroupKernel, EKernelHalSupervisorBarrier,
-								  (TAny*)aIdleTimeoutMs, 0);
-	if (r != KErrNone)
-		return r;
+	UserSvr::HalFunction(EHalGroupKernel, EKernelHalSupervisorBarrier, 0, 0);
 
 	TMemoryInfoV1Buf meminfo;
-	r = UserHal::MemoryInfo(meminfo);
-	if (r != KErrNone)
-		return r;
-	
+	UserHal::MemoryInfo(meminfo);
 	return meminfo().iFreeRamInBytes;
 	}
 
--- a/kerneltest/e32test/mmu/t_chunk3.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/mmu/t_chunk3.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -20,6 +20,7 @@
 #include "../misc/prbs.h"
 
 RTest test(_L("T_CHUNK3"));
+const TInt KHeapSize=4096;
 
 GLDEF_C TInt E32Main()
 	{
--- a/kerneltest/e32test/mmu/t_demandpaging.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/mmu/t_demandpaging.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -75,7 +75,6 @@
 #include <e32kpan.h>
 #include <e32property.h>
 #include <e32rom.h>
-#include <u32hal.h>
 #include "d_memorytest.h"
 #include "d_demandpaging.h"
 #include "d_gobble.h"
@@ -109,14 +108,6 @@
 // A descriptor whose header is in paged memory (actually just a pointer to a zero word)
 TDesC8* PagedHeaderDes = NULL;
 
-// An area of paged rom if rom paging is supported, or zero
-TUint8* RomPagedBuffer = NULL;
-TInt RomPagedBufferSize = 0;
-
-// An area of paged code if code paging is supported, or zero
-TUint8* CodePagedBuffer = NULL;
-TInt CodePagedBufferSize = 0;
-
 // A data paged chunk used as a buffer, if data paging is supported
 _LIT(KChunkName, "t_demandpaging chunk");
 RChunk DataPagedChunk;
@@ -128,13 +119,7 @@
 	return *aPtr;
 	}
 
-TUint8 WriteByte(volatile TUint8* aPtr)
-	{
-	return *aPtr = 1;
-	}
-
 #define READ(a) ReadByte((volatile TUint8*)(a))
-#define WRITE(a) WriteByte((volatile TUint8*)(a))
 
 void ThrashPaging(TUint aBytes)
 	{
@@ -450,13 +435,12 @@
 	EDesContentPaged
 	};
 
-enum TThreadOutcome
+enum TRealtimeOutcome
 	{
 	ENoError,
 	EBadDescriptor,
 	EServerTerminated,
-	ERealtimePanic,
-	EAbortPanic
+	ERealtimePanic
 	};
 
 class RTestSession : public RSessionBase
@@ -642,7 +626,7 @@
 	return r;
 	}
 
-void TestThreadOutcome(RThread aThread, TThreadOutcome aOutcome)
+void TestRealtimeOutcome(RThread aThread, TRealtimeOutcome aOutcome)
 	{
 	switch(aOutcome)
 		{
@@ -667,12 +651,6 @@
 			test_Equal(EIllegalFunctionForRealtimeThread, aThread.ExitReason());
 			break;
 
-		case EAbortPanic:
-			test_Equal(EExitPanic, aThread.ExitType());
-			// category for paging errors tested elsewhere
-			test_Equal(KErrAbort, aThread.ExitReason());
-			break;
-
 		default:
 			test(EFalse);
 		}
@@ -683,9 +661,8 @@
 				  TIpcObjectPaged aServerPaged,
 				  User::TRealtimeState aClientState,
 				  User::TRealtimeState aServerState,
-				  TThreadOutcome aClientOutcome,
-				  TThreadOutcome aServerOutcome,
-				  TPagingErrorContext aSimulatedError = EPagingErrorContextNone)
+				  TRealtimeOutcome aClientOutcome,
+				  TRealtimeOutcome aServerOutcome)
 	{
 	test.Printf(_L("TestPagedIpc %d %d %d %d %d %d %d\n"), aIpcDir, aClientPaged, aServerPaged,
 				aClientState, aServerState, aClientOutcome, aServerOutcome);
@@ -711,11 +688,6 @@
 	name = clientThread.Name();
 	test.Printf(_L("  client: %S\n"), &name);
 	clientThread.Logon(clientStatus);
-
-	// set up simulated failure if specifed
-	if (aSimulatedError != EPagingErrorContextNone)
-		test_KErrNone(UserSvr::HalFunction(EHalGroupVM, EVMHalDebugSetFail, (TAny*)aSimulatedError, 0));
-	
 	clientThread.Resume();
 
 	User::WaitForRequest(serverStatus);
@@ -724,13 +696,9 @@
 
 	User::WaitForRequest(clientStatus);
 	test.Printf(_L("  client exit type is %d %d\n"), clientThread.ExitType(), clientThread.ExitReason());
-	
-	// cancel any simulated failure
-	if (aSimulatedError != EPagingErrorContextNone)
-		test_KErrNone(UserSvr::HalFunction(EHalGroupVM, EVMHalDebugSetFail, (TAny*)EPagingErrorContextNone, 0));
 
-	TestThreadOutcome(serverThread, aServerOutcome);
-	TestThreadOutcome(clientThread, aClientOutcome);
+	TestRealtimeOutcome(serverThread, aServerOutcome);
+	TestRealtimeOutcome(clientThread, aClientOutcome);
 	
 	CLOSE_AND_WAIT(serverThread);
 	CLOSE_AND_WAIT(clientThread);
@@ -749,7 +717,7 @@
 	return KErrNone;
 	}
 
-TInt RunTestThread(User::TRealtimeState aType, TThreadOutcome aOutcome)
+TInt RunTestThread(User::TRealtimeState aType, TRealtimeOutcome aOutcome)
 	{
 	RThread thread;
 	TInt r=thread.Create(KNullDesC, &TestThreadFunction, 0x1000, NULL, (TAny*)aType);
@@ -761,7 +729,7 @@
 		return s.Int();
 	thread.Resume();
 	User::WaitForRequest(s);
-	TestThreadOutcome(thread, aOutcome);
+	TestRealtimeOutcome(thread, aOutcome);
 	CLOSE_AND_WAIT(thread);
 	return KErrNone;
 	}
@@ -843,141 +811,6 @@
 	test(KErrNone==DPTest::SetCacheSize(0,0));
 	}
 
-enum TPageFaultType
-	{
-	EPageFaultRomRead,
-	EPageFaultCodeRead,
-	EPageFaultDataRead,
-	EPageFaultDataWrite,
-	};
-
-
-TInt TestPagingErrorThreadFunction(TAny* aArg)
-	{
-	TUint8* ptr = (TUint8*)((TUint)aArg & ~1);
-	TBool write = ((TUint)aArg & 1) != 0;
-
-	if (write)
-		{
-		WRITE(ptr);
-		return DPTest::FlushCache();
-		}
-	else
-		{
-		READ(ptr);
-		return KErrNone;
-		}
-	}
-
-void TestPagingError(TPageFaultType aPageFaultType,
-					 TPagingErrorContext aSimulatedError,
-					 TExitType aExpectedExitType,
-					 const TDesC& aExpectedExitCategory,
-					 TInt aExpectedExitReason)
-	{
-	test.Printf(_L("TestPagingError %d %d %d \"%S\" %d\n"), aPageFaultType, aSimulatedError,
-				aExpectedExitType, &aExpectedExitCategory, aExpectedExitReason);
-	
-	TUint8* ptr;
-	TBool write;
-
-	switch(aPageFaultType)
-		{
-		case EPageFaultRomRead:   ptr = RomPagedBuffer;  write = EFalse; break;
-		case EPageFaultCodeRead:  ptr = CodePagedBuffer; write = EFalse; break;
-		case EPageFaultDataRead:  ptr = DataPagedBuffer; write = EFalse; break;
-		case EPageFaultDataWrite: ptr = DataPagedBuffer; write = ETrue;  break;
-		default: test(EFalse); return;
-		}
-
-	if (ptr == NULL) return;  // specified type of paging is not enabled
-
-	if (write)
-		READ(ptr);  // ensure data to be written is paged in
-	else
-		test_KErrNone(DPTest::FlushCache());  // ensure data to be read is paged out
-
-	// set up simulated failure
-	test_KErrNone(UserSvr::HalFunction(EHalGroupVM, EVMHalDebugSetFail, (TAny*)aSimulatedError, 0));
-	
-	RThread thread;
-	TAny* arg = (TAny*)((TUint)ptr | (write ? 1 : 0));
-	test_KErrNone(thread.Create(KNullDesC, &TestPagingErrorThreadFunction, 0x1000, NULL, arg));
-	TRequestStatus s;
-	thread.Logon(s);
-	test_Equal(KRequestPending, s.Int());
-	thread.Resume();
-	User::WaitForRequest(s);
-
-	// cancel any simulated failure
-	test_KErrNone(UserSvr::HalFunction(EHalGroupVM, EVMHalDebugSetFail, (TAny*)EPagingErrorContextNone, 0));
-
-	TExitCategoryName exitCategory = thread.ExitCategory();
-	test.Printf(_L("  thread exit type is %d \"%S\" %d\n"),
-				thread.ExitType(), &exitCategory, thread.ExitReason());
-	
-	test_Equal(aExpectedExitType, thread.ExitType());
-	if (aExpectedExitType == EExitPanic)
-		test_Equal(0, aExpectedExitCategory.Compare(exitCategory));	
-	test_Equal(aExpectedExitReason, thread.ExitReason());	
-	
-	CLOSE_AND_WAIT(thread);
-	}
-
-void CreateDataPagedChunk()
-	{
-	TChunkCreateInfo createInfo;
-	createInfo.SetNormal(KMinBufferSize, KMinBufferSize);
-	createInfo.SetPaging(TChunkCreateInfo::EPaged);
-	createInfo.SetOwner(EOwnerProcess);
-	createInfo.SetGlobal(KChunkName);
-	test_KErrNone(DataPagedChunk.Create(createInfo));
-	test(DataPagedChunk.IsPaged()); // this is only ever called if data paging is supported
-	DataPagedBuffer = (TUint8*)DataPagedChunk.Base();
-	}
-
-void TestPagingErrors()
-	{
-	// test what happens when the paging system encounters errors such as failure when accessing
-	// media or decompressing paged data
-
-	//              page fault type:     simulated error:                   exit type:  exit category:          exit reason:
-	TestPagingError(EPageFaultRomRead,   EPagingErrorContextNone,           EExitKill,  KNullDesC,              KErrNone);
-	TestPagingError(EPageFaultRomRead,   EPagingErrorContextRomRead,        EExitPanic, _L("PAGED-ROM-READ"),   KErrAbort);
-	TestPagingError(EPageFaultRomRead,   EPagingErrorContextRomDecompress,  EExitPanic, _L("PAGED-ROM-COMP"),   KErrAbort);
-	
-	TestPagingError(EPageFaultCodeRead,  EPagingErrorContextNone,           EExitKill,  KNullDesC,              KErrNone);
-	TestPagingError(EPageFaultCodeRead,  EPagingErrorContextCodeRead,       EExitPanic, _L("PAGED-CODE-READ"),  KErrAbort);
-	TestPagingError(EPageFaultCodeRead,  EPagingErrorContextCodeDecompress, EExitPanic, _L("PAGED-CODE-COMP"),  KErrAbort);
-
-	if (DataPagedBuffer)
-		{
-		// Note WDP write faults are only reported on the next read
-		WRITE(DataPagedBuffer);  // ensure page is not blank and will be read from swap
-		
-		//              page fault type:     simulated error:               exit type:  exit category:          exit reason:
-		TestPagingError(EPageFaultDataRead,  EPagingErrorContextNone,       EExitKill,  KNullDesC,              KErrNone);
-		TestPagingError(EPageFaultDataRead,  EPagingErrorContextDataRead,   EExitPanic, _L("PAGED-DATA-READ"),  KErrAbort);
-		TestPagingError(EPageFaultDataWrite, EPagingErrorContextDataWrite,  EExitKill,  KNullDesC,              KErrNone);
-		TestPagingError(EPageFaultDataRead,  EPagingErrorContextNone,       EExitPanic, _L("PAGED-DATA-WRITE"), KErrAbort);
-
-		// this will now always panic when we try to access the first page so destroy and re-create it
-		DataPagedChunk.Close();
-		CreateDataPagedChunk();
-		}
-
-	// test attribution of errors during IPC
-	TPagingErrorContext error;
-	if (RomPagedBuffer)
-		error = EPagingErrorContextRomRead;
-	else if (CodePagedBuffer)
-		error = EPagingErrorContextCodeRead;
-	else
-		error = EPagingErrorContextDataRead;
-	//           ipc dir:     client paged:     server paged:  client state:            server state:            client outcome:  server outcome:
-	TestPagedIpc(EServerRead, EDesContentPaged, ENothingPaged, User::ERealtimeStateOff, User::ERealtimeStateOff, EAbortPanic,     EBadDescriptor,  error);
-	}
-
 void TestLock()
 	{
 	// make sure live list is big enough
@@ -1454,45 +1287,50 @@
 	test.Start(_L("Initialisation"));
 	
 	if (DPTest::Attributes() & DPTest::ERomPaging)
-		{
 		test.Printf(_L("Rom paging supported\n"));
-		TRomHeader* romHeader = (TRomHeader*)UserSvr::RomHeaderAddress();
-		test(romHeader->iPageableRomStart);
-		// todo: for some reason the first part of page of paged rom doesn't seem to get paged out
-		// when we flush the paging cache, hence RomPagedBuffer starts some way into this
-		RomPagedBuffer = (TUint8*)romHeader + romHeader->iPageableRomStart + 64 * PageSize; 
-		RomPagedBufferSize = romHeader->iPageableRomSize - 64 * PageSize;
-		test(RomPagedBufferSize > 0);
-		}
-	
 	if (DPTest::Attributes() & DPTest::ECodePaging)
-		{
 		test.Printf(_L("Code paging supported\n"));
-		test_KErrNone(PagedLibrary.Load(KTCodePagingDll4));		
-		TGetAddressOfDataFunction func = (TGetAddressOfDataFunction)PagedLibrary.Lookup(KGetAddressOfDataFunctionOrdinal);
-		CodePagedBuffer = (TUint8*)func(CodePagedBufferSize);
-		test_NotNull(CodePagedBuffer);
-		test(CodePagedBufferSize > KMinBufferSize);
-		}
-	
 	if (DPTest::Attributes() & DPTest::EDataPaging)
 		{
 		test.Printf(_L("Data paging supported\n"));
 		DataPagingSupported = ETrue;
-		CreateDataPagedChunk();
+		TChunkCreateInfo createInfo;
+		createInfo.SetNormal(KMinBufferSize, KMinBufferSize);
+		createInfo.SetPaging(TChunkCreateInfo::EPaged);
+		createInfo.SetOwner(EOwnerProcess);
+		createInfo.SetGlobal(KChunkName);
+		test_KErrNone(DataPagedChunk.Create(createInfo));
+		test(DataPagedChunk.IsPaged()); // this is only ever called if data paging is supported
+		DataPagedBuffer = (TUint8*)DataPagedChunk.Base();
 		}
 
 	if (DPTest::Attributes() & DPTest::ERomPaging)
 		{
 		// Use paged part of rom for testing
-		LargeBuffer = RomPagedBuffer;
-		LargeBufferSize = RomPagedBufferSize;
+		TRomHeader* romHeader = (TRomHeader*)UserSvr::RomHeaderAddress();
+		test(romHeader->iPageableRomStart);
+		// todo: for some reason the first part of page of paged rom doesn't seem to get paged out
+		// when we flush the paging cache, hence LargeBuffer starts some way into this
+		LargeBuffer = (TUint8*)romHeader + romHeader->iPageableRomStart + 64 * PageSize; 
+		LargeBufferSize = romHeader->iPageableRomSize - 64 * PageSize;
+		test(LargeBufferSize > 0);
+		// Find a zero word in rom to set PagedHeaderDes to
+		TUint* ptr = (TUint*)LargeBuffer;
+		TUint* end = (TUint*)(LargeBuffer + LargeBufferSize);
+		while (*ptr && ptr < end)
+			++ptr;
+		test(*ptr == 0);
+		test.Printf(_L("Found zero word at %08x\n"), ptr);
+		PagedHeaderDes = (TDesC8*)ptr;
 		}
 	else if (DPTest::Attributes() & DPTest::ECodePaging)
 		{
 		// Use code paged DLL for testing
-		LargeBuffer = CodePagedBuffer;
-		LargeBufferSize = CodePagedBufferSize;
+		test_KErrNone(PagedLibrary.Load(KTCodePagingDll4));		
+		TGetAddressOfDataFunction func = (TGetAddressOfDataFunction)PagedLibrary.Lookup(KGetAddressOfDataFunctionOrdinal);
+		LargeBuffer = (TUint8*)func(LargeBufferSize);
+		test_NotNull(LargeBuffer);
+		PagedHeaderDes = (TDesC8*)LargeBuffer + 4;
 		}
 	else if (DPTest::Attributes() & DPTest::EDataPaging)
 		{
@@ -1506,16 +1344,7 @@
 		test.End();
 		return 0;
 		}
-	
-	// Find a paged zero word to set PagedHeaderDes to
-	TUint* ptr = (TUint*)LargeBuffer;
-	TUint* end = (TUint*)(LargeBuffer + LargeBufferSize);
-	while (*ptr && ptr < end)
-		++ptr;
-	test(*ptr == 0);
-	test.Printf(_L("Found zero word at %08x\n"), ptr);
-	PagedHeaderDes = (TDesC8*)ptr;
-
+		
 	test.Next(_L("Test HAL interface"));
 	TestHAL();
 	
@@ -1561,15 +1390,6 @@
 
 	test.Next(_L("Test no kernel faults when copying data from unpaged rom with mutex held"));
 	TestReadHoldingMutex();
-	
-#ifdef _DEBUG
-	// test hook in kernel not present in release mode
-	if ((MemModelAttributes() & EMemModelTypeMask) == EMemModelTypeFlexible)
-		{
-		test.Next(_L("Test unrecoverable errors while paging"));
-		TestPagingErrors();
-		}
-#endif
 
 	test.Next(_L("Close test driver"));
 	Ldd.DestroyPlatHwChunk();
@@ -1578,14 +1398,11 @@
 	test.Next(_L("Test setting publish and subscribe properties from paged area"));
 	TestPublishAndSubscribe();
 
-#ifndef _DEBUG
-	// no point benchmarking in debug mode
 	if (DPTest::Attributes() & DPTest::ERomPaging)
 		{
 		test.Next(_L("Rom Paging Benchmark"));
 		RomPagingBenchmark();
 		}
-#endif
 
 	PagedLibrary.Close();
 	gobbler.Close();
--- a/kerneltest/e32test/mmu/t_mmubm.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/mmu/t_mmubm.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -70,8 +70,9 @@
 	return KErrNone;
 	}
 
-LOCAL_C TInt AllocateChunk(TUint32 /*aIters*/, TUint32 aSize)
+LOCAL_C TInt AllocateChunk(TUint32 aIters, TUint32 aSize)
 	{
+	aIters = aSize;
 	return TheChunk.Adjust(aSize * 0x00100000);
 	}
 
--- a/kerneltest/e32test/mmu/t_shadow.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/mmu/t_shadow.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -195,28 +195,25 @@
 	{
 	test.Start(_L("Test allocating a shadow page when all free RAM is in 'chunk caches'"));
 	
+	test.Next(_L("Load gobbler LDD"));
+	TInt r = User::LoadLogicalDevice(KGobblerLddFileName);
+	test_Value(r, r==KErrNone || r==KErrAlreadyExists);
+	RGobbler gobbler;
+	test_KErrNone(gobbler.Open());
+	TUint32 taken = gobbler.GobbleRAM(496*1024*1024);
+	test.Printf(_L("  Gobbled: %dK\n"), taken/1024);
+	test.Printf(_L("  Free RAM 0x%08X bytes\n"),FreeRam());
+
 	// Remove limit on max size of live list
 	TUint originalMin = 0;
 	TUint originalMax = 0;
 	TUint currentSize = 0;
-	TInt r = DPTest::CacheSize(originalMin, originalMax, currentSize);
+	r = DPTest::CacheSize(originalMin, originalMax, currentSize);
 	test_Value(r, r == KErrNone || r == KErrNotSupported);
 	TBool resizeCache = r == KErrNone;
 	if (resizeCache)
 		test_KErrNone(DPTest::SetCacheSize(originalMin, KMaxTUint));
 
-	test.Next(_L("Load gobbler LDD"));
-	r = User::LoadLogicalDevice(KGobblerLddFileName);
-	test_Value(r, r==KErrNone || r==KErrAlreadyExists);
-	RGobbler gobbler, gobbler2;
-	test_KErrNone(gobbler.Open());
-	TUint32 taken = gobbler.GobbleRAM(496*1024*1024);
-	test.Printf(_L("  Gobbled: %dK\n"), taken/1024);
-	test.Printf(_L("  Free RAM 0x%08X bytes\n"),FreeRam());
-	//  Open 2nd globber here, while we still have some free pages.
-	test_KErrNone(gobbler2.Open());
-
-
 	// put all of free RAM in a chunk...
 	TChunkCreateInfo createInfo;
 	createInfo.SetCache(512*1024*1024);
@@ -226,14 +223,7 @@
 	while(KErrNone==(r=testChunk.Commit(commitEnd,PageSize)))
 		commitEnd += PageSize;
 	test_Equal(KErrNoMemory,r);
-
-	// Now we have some memory in a cache chunk ensure definitely no 
-	// other free pages.
-	taken = gobbler2.GobbleRAM(0);
-	test.Printf(_L("  Gobbled: %dK\n"), taken/1024);
-	test_Equal(0, FreeRam());
-
-
+	
 	// no memory to allocate shadow page...
 	test_Equal(KErrNoMemory,Shadow.Alloc(aPageAddr));
 	// unlock all of RAM in chunk...
@@ -249,7 +239,6 @@
 		test_KErrNone(DPTest::SetCacheSize(originalMin, originalMax));
 
 	gobbler.Close();
-	gobbler2.Close();
 	test.End();
 	}
 
--- a/kerneltest/e32test/mmu/t_sharedio.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/mmu/t_sharedio.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -128,6 +128,7 @@
 #include <f32dbg.h>
 #include <e32def.h>
 #include <e32def_private.h>
+#include "freeram.h"
 
 LOCAL_D RTest test(_L("T_SHAREDIO"));
 
@@ -349,6 +350,8 @@
 	{
 	TInt failResult=KErrGeneral;
 
+	TInt freeRam = FreeRam(); //This will also add a delay
+
 	for(TInt failCount=1; failCount<1000; failCount++)
 		{
 		test.Printf(_L("alloc fail count = %d\n"),failCount);
@@ -366,8 +369,10 @@
 
 		test(failResult==KErrNoMemory);
 		__KHEAP_MARKEND;
+
+		test(freeRam == FreeRam());  //This will also add a delay
 		}
-
+	User::__DbgSetAllocFail(ETrue,RAllocator::ENone,0);
 	__KHEAP_RESET;
 
 	test.Next(_L("Destroy buffer"));
@@ -376,7 +381,7 @@
 	else
 		ldd.DestroyBuffer();
 	
-	__KHEAP_MARKEND;
+	test(freeRam == FreeRam());  //This will also add a delay
 	}
 
 GLDEF_C TInt E32Main()
--- a/kerneltest/e32test/mmu/t_shbuf.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/mmu/t_shbuf.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -39,8 +39,6 @@
 
 const TInt* PtrBufSize;
 
-static TInt ThreadCounter = 0;
-
 RShBufTestChannel Ldd;
 
 _LIT(KTestSlave, "SLAVE");
@@ -624,14 +622,12 @@
 		{
 		RShBuf buf;
 		r = buf.Alloc(aPool);
-		RDebug::Printf("alloc buf %d returned %d", bufarray.Count(), r);
 		if (r==KErrNoMemory && KTestPoolSizeInBufs>bufarray.Count())
 			{
 			// try again after a delay, to allow for background resource allocation
 			
 			User::After(1000000);
 			r = buf.Alloc(aPool);
-			RDebug::Printf("re-alloc buf %d returned %d", bufarray.Count(), r);
 			}
 		if (!r)
 			{
@@ -649,7 +645,6 @@
 		{
 		bufarray[--n].Close();
 		}
-	RDebug::Printf("closed bufs");
 
 	User::After(500000);
 
@@ -658,13 +653,11 @@
 	while (n<bufarray.Count())
 		{
 		r = bufarray[n].Alloc(aPool);
-		RDebug::Printf("alloc buf %d returned %d", n, r);
 		if (r==KErrNoMemory)
 			{
 			// try again after a delay, to allow for background resource allocation
 			User::After(1000000);
 			r = bufarray[n].Alloc(aPool);
-			RDebug::Printf("re-alloc buf %d returned %d", n, r);
 			}
 		test_Assert(r == KErrNone, test.Printf(_L("n=%d r=%d\n"), n, r));
 		if(aligned)
@@ -674,14 +667,12 @@
 
 	RShBuf extrabuf;
 	r = extrabuf.Alloc(aPool);
-	RDebug::Printf("alloc extra buf returned %d", r);
 	test_Equal(KErrNoMemory, r);
 
 	while (n)
 		{
 		bufarray[--n].Close();
 		}
-	RDebug::Printf("closed bufs");
 
 	bufarray.Close();
 	}
@@ -1881,9 +1872,9 @@
  */
 void RequestLowSpacePanic(RShPool& aPool, TUint aThreshold1, TUint aThreshold2, TTestLowSpaceType aType, TInt aLine)
 	{
-	TBuf<40> threadname;
-	threadname.Format(_L("ThreadLowSpacePanic%d"), ++ThreadCounter);
-	test.Printf(_L("RequestLowSpacePanic@%d(%S)\n"), aLine, &threadname);
+	static TInt count = 0;
+	count++;
+	test.Printf(_L("RequestLowSpacePanic@%d(%d)\n"), aLine, count);
 	TBool jit = User::JustInTime();
 	User::SetJustInTime(EFalse);
 	TInt expectedpaniccode = KErrNone;	// Initialised to silence compiler warnings
@@ -1906,6 +1897,8 @@
 	RThread threadpanic;
 	TRequestStatus threadpanicrs;
 	TInt r;
+	TBuf<30> threadname;
+	threadname.Format(_L("ThreadLowSpacePanic%d"), count);
 	r = threadpanic.Create(threadname, ThreadLowSpacePanic, KDefaultStackSize, KMinHeapSize, 1 << 20, (TAny*) &targs);
 	test_KErrNone(r);
 	threadpanic.Logon(threadpanicrs);
@@ -1932,10 +1925,7 @@
 	test_KErrNone(r);
 	RThread thread;
 	TRequestStatus threadrs;
-	TBuf<40> threadname;
-	threadname.Format(_L("ThreadNotifications%d"), ++ThreadCounter);
-	test.Printf(_L("Create %S\n"), &threadname);
-	r = thread.Create(threadname, ThreadNotifications, KDefaultStackSize, KMinHeapSize, 1 << 20, (TAny*) &aPool);
+	r = thread.Create(_L("ThreadNotifications"), ThreadNotifications, KDefaultStackSize, KMinHeapSize, 1 << 20, (TAny*) &aPool);
 	test_KErrNone(r);
 	thread.SetPriority(EPriorityMore);
 	thread.Logon(threadrs);
@@ -2087,13 +2077,9 @@
 	RSemaphore sem;
 	r = sem.CreateGlobal(KTestLowSpaceSemaphore, 0);
 	test_KErrNone(r);
-
-	TBuf<40> threadname;
-	threadname.Format(_L("ThreadCancelNotifications%d"), ++ThreadCounter);
-	test.Printf(_L("Create %S\n"), &threadname);
 	RThread thread;
 	TRequestStatus threadrs;
-	r = thread.Create(threadname, ThreadNotifications, KDefaultStackSize, KMinHeapSize, 1 << 20, (TAny*) &aPool);
+	r = thread.Create(_L("ThreadCancelNotifications"), ThreadNotifications, KDefaultStackSize, KMinHeapSize, 1 << 20, (TAny*) &aPool);
 	test_KErrNone(r);
 	thread.SetPriority(EPriorityLess);
 	thread.Logon(threadrs);
--- a/kerneltest/e32test/mmu/t_wsd_tst.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/mmu/t_wsd_tst.h	Wed Sep 01 12:34:56 2010 +0100
@@ -47,7 +47,7 @@
 // Exports of DLL1
 #ifdef	T_WSD_DL1
 #else
-IMPORT_D extern TInt32 ExportedData;
+IMPORT_D TInt32 ExportedData;
 IMPORT_C TInt CheckExportedDataAddress(void *aDataAddr);
 #endif	// T_WSD_DL1
 
@@ -65,10 +65,10 @@
 #ifdef	T_WSD_DL3
 #else
 IMPORT_C void** GetAddressOfData(TInt& aSize, void*& aCodeAddr, void*& aDataAddr);
-IMPORT_D extern TInt32 TestDataSize;
-IMPORT_D extern void* WritableTestData[1 /* refer TestDataSize */];
-IMPORT_D extern const void* const* PointerToStaticData;
-IMPORT_D extern void** PointerToWritableData;
+IMPORT_D TInt32 TestDataSize;
+IMPORT_D void* WritableTestData[1 /* refer TestDataSize */];
+IMPORT_D const void* const* PointerToStaticData;
+IMPORT_D void** PointerToWritableData;
 #endif	// T_WSD_DL3
 
 #endif	// __T_WSD_TST_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/multimedia/t_camera_api.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,1487 @@
+// 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\multimedia\t_camera_api.cpp
+// 
+//
+
+#include <e32test.h>
+#include <d32camerasc.h>
+#include <e32def.h>
+#include <e32def_private.h>
+#include "t_camera_display.h"
+#include "t_camera_bitmap.h"
+#include "d_mmcsc.h"
+
+_LIT(KTstLddFileName,"D_MMCSC.LDD");
+_LIT(KCamLddFileName,"ECAMERASC.LDD");
+
+#ifdef __WINSCW__
+_LIT(KCamPddFileName,"_TEMPLATE_CAMERASC.PDD");
+#else
+_LIT(KCamPddFileName,"CAMERASC.PDD");
+#endif
+
+
+_LIT(KCamFreePddExtension,".*");
+
+_LIT(KFrameSize, "%dx%d");
+_LIT(KSensor, "d:\\Sensor_");
+_LIT(KUnderscore, "_");
+_LIT(KBmp, ".bmp");
+_LIT(KJpeg, ".jpg");
+_LIT(KSpeedTaggedJpeg, ".stj");
+
+LOCAL_D TCameraCapsV02* CameraCaps;
+LOCAL_D TInt CapsSize;
+LOCAL_D TAny* CapsBufPtr;
+RTest Test(_L("T_CAMERA_API"));
+
+const TInt KNumVideoFramesToAllocate=6;
+const TInt KNumVideoFramesToCapture=(KNumVideoFramesToAllocate-2);
+const TInt KHeapSize=0x4000;
+const TInt KUnit0=0;
+
+enum TSecThreadTestId
+	{
+	ESecThreadTestOpen,
+	ESecThreadTestDuplicateHandle,
+	ESecThreadReuseHandle
+	};
+
+struct SSecondaryThreadInfo
+	{
+	TSecThreadTestId iTestId;
+	TInt iExpectedRetVal;
+	TThreadId iThreadId;
+	TInt iDrvHandle;
+	TInt iCameraModuleIndex;
+	};
+
+LOCAL_C TInt secondaryThread(TAny* aTestInfo)
+	{
+	RTest stest(_L("Secondary test camera thread"));
+	stest.Title();
+
+	stest.Start(_L("Check which test to perform"));
+	SSecondaryThreadInfo sti =*((SSecondaryThreadInfo*)aTestInfo);
+	
+	TInt r;
+	switch(sti.iTestId)
+		{
+		case ESecThreadTestOpen:
+			{
+			stest.Next(_L("Open channel test"));
+			RDevCameraSc cam;
+			r=cam.Open(sti.iCameraModuleIndex);
+			stest(r==sti.iExpectedRetVal);
+			cam.Close();
+			break;
+			}
+		case ESecThreadTestDuplicateHandle:
+			{
+			stest.Next(_L("Duplicate channel handle test"));
+
+			// Get a reference to the main thread - which created the handle
+			RThread thread;
+			r=thread.Open(sti.iThreadId);
+			stest(r==KErrNone);
+
+			// Duplicate the driver handle passed from the other thread - for this thread
+			RDevCameraSc cam;
+			cam.SetHandle(sti.iDrvHandle);
+			r=cam.Duplicate(thread);
+			stest(r==sti.iExpectedRetVal);
+			cam.Close();
+			thread.Close();
+			break;
+			}
+		case ESecThreadReuseHandle:
+			{
+			stest.Next(_L("Re-use channel test"));
+			RDevCameraSc* camPtr=(RDevCameraSc*)sti.iDrvHandle;
+			TCameraConfigV02Buf camConfBuf;
+			camPtr->GetCamConfig(ECamCaptureModeImage, camConfBuf);	// This should cause a panic.
+			break;
+			}
+		default:
+			break;
+		}
+
+	stest.End();
+	return(KErrNone);
+	}
+
+/** Test for defect DEF135950. */
+LOCAL_C void DoCamDynamicSettingsTests(RDevCameraSc& aCam, RTest& aTest)
+	{
+	aTest.Next(_L("DYNAMIC SETTINGS TESTS"));
+	
+	aTest.Next(_L("Get the Caps size. Should be non-zero"));
+	TInt capsSize = aCam.CapsSize();
+	aTest(capsSize>0);
+
+	aTest.Next(_L("Get the Capabilities (driver owned copy)."));
+	TPtrC8 driverCopy = aCam.Caps();
+	aTest(driverCopy.Ptr() != NULL);
+	aTest(driverCopy.Length()>0);
+
+	aTest.Next(_L("Test failure (buffer too small)."));
+	TAny* capsBufPtr = User::Alloc(capsSize-1);
+	aTest(capsBufPtr != NULL);
+	TPtr8 smallBuf((TUint8*) capsBufPtr, capsSize-1, capsSize-1);
+	aTest(KErrArgument==aCam.Caps(smallBuf));
+	User::Free(capsBufPtr);
+
+	aTest.Next(_L("Get the Capabilities (client owned copy)."));
+	capsBufPtr = User::Alloc(capsSize);
+	aTest(capsBufPtr != NULL);
+	TPtr8 clientCopy((TUint8*) capsBufPtr, capsSize, capsSize);
+	aTest(KErrNone==aCam.Caps(clientCopy));
+	aTest(clientCopy.Ptr() != NULL);
+	aTest(clientCopy.Length()>0);
+
+	aTest.Next(_L("Obtain the range for Dynamic Settings from both copies (should be the same)."));
+	
+	TDynamicRange &driverRangeBrightness = ((TCameraCapsV02*)(driverCopy.Ptr()))->iDynamicRange[ECamAttributeBrightness];
+	TDynamicRange &clientRangeBrightness = ((TCameraCapsV02*)(clientCopy.Ptr()))->iDynamicRange[ECamAttributeBrightness];
+	
+	aTest(driverRangeBrightness.iMin == 0);
+	aTest(driverRangeBrightness.iMax == 6);
+	aTest(driverRangeBrightness.iMin == clientRangeBrightness.iMin);
+	aTest(driverRangeBrightness.iMax == clientRangeBrightness.iMax);
+
+	TDynamicRange &driverRangeContrast = ((TCameraCapsV02*)(driverCopy.Ptr()))->iDynamicRange[ECamAttributeContrast];
+	TDynamicRange &clientRangeContrast = ((TCameraCapsV02*)(clientCopy.Ptr()))->iDynamicRange[ECamAttributeContrast];
+
+	aTest(driverRangeContrast.iMin == 0);
+	aTest(driverRangeContrast.iMax == 6);
+	aTest(driverRangeContrast.iMin == clientRangeContrast.iMin);
+	aTest(driverRangeContrast.iMax == clientRangeContrast.iMax);
+	
+	TDynamicRange &driverRangeColorEffect = ((TCameraCapsV02*)(driverCopy.Ptr()))->iDynamicRange[ECamAttributeColorEffect];
+	TDynamicRange &clientRangeColorEffect = ((TCameraCapsV02*)(clientCopy.Ptr()))->iDynamicRange[ECamAttributeColorEffect];
+
+	aTest(driverRangeColorEffect.iMin == 0);
+	aTest(driverRangeColorEffect.iMax == 7); // TBC::OV3640 set to 7, template driver set to 0x0040 (enum)
+	aTest(driverRangeColorEffect.iMin == clientRangeColorEffect.iMin);
+	aTest(driverRangeColorEffect.iMax == clientRangeColorEffect.iMax);
+
+	aTest.Next(_L("Test for invalid Min range."));
+	aTest(aCam.SetDynamicAttribute(ECamAttributeBrightness, driverRangeBrightness.iMin-1)==KErrArgument);
+	aTest(aCam.SetDynamicAttribute(ECamAttributeContrast, driverRangeContrast.iMin-1)==KErrArgument);
+	aTest(aCam.SetDynamicAttribute(ECamAttributeColorEffect, driverRangeColorEffect.iMin-1)==KErrArgument);
+
+	aTest.Next(_L("Test for invalid Max range."));
+	aTest(aCam.SetDynamicAttribute(ECamAttributeBrightness, driverRangeBrightness.iMax+1)==KErrArgument);
+	aTest(aCam.SetDynamicAttribute(ECamAttributeContrast, driverRangeContrast.iMax+1)==KErrArgument);
+	aTest(aCam.SetDynamicAttribute(ECamAttributeColorEffect, driverRangeColorEffect.iMax+1)==KErrArgument);
+
+	aTest.Next(_L("Test all valid settings as reported by range - Brightness"));
+	for (TUint i=driverRangeBrightness.iMin; i <= driverRangeBrightness.iMax; ++i)
+		{
+		aTest(aCam.SetDynamicAttribute(ECamAttributeBrightness, i)==KErrNone);
+		}
+
+	aTest.Next(_L("Test all valid settings as reported by range - Contrast"));
+	for (TUint j=driverRangeContrast.iMin; j <= driverRangeContrast.iMax; ++j)
+		{
+		aTest(aCam.SetDynamicAttribute(ECamAttributeContrast, j)==KErrNone);
+		}
+
+	aTest.Next(_L("Test all valid settings as reported by range - ColorEffect"));
+	for (TUint k=driverRangeColorEffect.iMin; k <= driverRangeColorEffect.iMax; ++k)
+		{
+		aTest(aCam.SetDynamicAttribute(ECamAttributeColorEffect, k)==KErrNone);
+		}
+
+	User::Free(capsBufPtr);
+	}
+
+/** Test for defect DEF135949. */
+LOCAL_C void DoCamBufferOffsetTests(RDevCameraSc& aCam, RTest& aTest, const SDevCamPixelFormat& aPixelFormat, const SDevCamFrameSize& aFrameSize, TUint aFrameRate)
+	{
+	TInt r;
+
+	aTest.Next(_L("BUFFER ID OFFSET TESTS"));
+	aTest.Printf(_L("PixelFormat = %d, FrameSize = %d x %d\n"),aPixelFormat.iPixelFormat,aFrameSize.iWidth,aFrameSize.iHeight);
+
+	// Configure Image Capture
+	aTest.Next(_L("Get the camera config of Image mode"));
+	TCameraConfigV02Buf camConfBuf;
+	aCam.GetCamConfig(ECamCaptureModeImage, camConfBuf);
+	TCameraConfigV02 &camConf=camConfBuf();
+
+	camConf.iFrameSize=aFrameSize;
+	camConf.iPixelFormat=aPixelFormat;
+	camConf.iFrameRate=aFrameRate;
+
+	// Set the Image configuration.
+	aTest.Next(_L("Set the Get the camera config of Image mode"));
+	r=aCam.SetCamConfig(ECamCaptureModeImage,camConfBuf);
+	aTest(r==KErrNone);
+	aCam.GetCamConfig(ECamCaptureModeImage, camConfBuf);
+	PrintCamConf(camConf,aTest);
+
+	// Create an Image chunk handle.
+	aTest.Next(_L("Create the Image chunk"));
+	RChunk imgChunkImage;
+	TInt numBuffers=KNumVideoFramesToAllocate;
+	r=aCam.SetBufConfigChunkCreate(ECamCaptureModeImage,numBuffers,imgChunkImage);
+	aTest(r==KErrNone);
+
+	aTest.Next(_L("Read and display the Image buffer config"));
+	TMmSharedChunkBufConfig bufferConfig;
+	TPckg<TMmSharedChunkBufConfig> bufferConfigBuf(bufferConfig);
+	aCam.GetBufferConfig(ECamCaptureModeImage, bufferConfigBuf);
+	PrintBufferConf(bufferConfig,aTest);
+
+	// Configure Video Capture
+	aTest.Next(_L("Get the camera config of Video mode"));
+	aCam.GetCamConfig(ECamCaptureModeVideo, camConfBuf);
+	camConf=camConfBuf();
+
+	camConf.iFrameSize=aFrameSize;
+	camConf.iPixelFormat=aPixelFormat;
+	camConf.iFrameRate=aFrameRate;
+
+	// Set the video configuration.
+	aTest.Next(_L("Set the Get the camera config of Video mode"));
+	r=aCam.SetCamConfig(ECamCaptureModeVideo,camConfBuf);
+	aTest(r==KErrNone);
+	aCam.GetCamConfig(ECamCaptureModeVideo, camConfBuf);
+	PrintCamConf(camConf,aTest);
+
+	// Create an Video chunk handle.
+	aTest.Next(_L("Create the Video chunk"));
+	RChunk chunkVideo;
+	numBuffers=KNumVideoFramesToAllocate;
+	r=aCam.SetBufConfigChunkCreate(ECamCaptureModeVideo,numBuffers,chunkVideo);
+	aTest(r==KErrNone);
+
+	aTest.Next(_L("Read and display the Video buffer config"));
+	aCam.GetBufferConfig(ECamCaptureModeVideo, bufferConfigBuf);
+	PrintBufferConf(bufferConfig,aTest);
+
+	// Test that stop still returns an error.
+	r=aCam.Stop();
+	aTest(r==KErrGeneral);
+
+	// Set the current capture mode to image
+	aTest.Next(_L("Set the camera in Image mode and capture a buffer, then requesting the buffer offset."));
+	r=aCam.SetCaptureMode(ECamCaptureModeImage);
+	aTest(r==KErrNone);
+
+	// Start the camera
+	r=aCam.Start();
+	aTest(r==KErrNone);
+
+	aTest.Next(_L("Issue a capture request"));
+	TRequestStatus rs1;
+	aCam.NotifyNewImage(rs1);
+	User::WaitForRequest(rs1);
+	TInt retId=rs1.Int();
+	TInt retOffset=-1;
+	aTest(retId>=0);
+	aCam.BufferIdToOffset(ECamCaptureModeImage,retId,retOffset);
+	aTest.Printf(_L("Buffer offset: %d(%xH)\r\n"),retId,retOffset);
+	aTest(retOffset>=0);
+
+	// Change capture mode
+	aTest.Next(_L("Set the capture mode to Video."));
+	r=aCam.SetCaptureMode(ECamCaptureModeVideo);
+	aTest(r==KErrNone);
+
+	aTest.Next(_L("Request again the offset for the buffer in Image mode."));
+	aCam.BufferIdToOffset(ECamCaptureModeImage,retId,retOffset);
+	aTest.Printf(_L("Buffer offset: %d(%xH)\r\n"),retId,retOffset);
+	aTest(retOffset>=0);
+
+	// Stop the camera.
+	r=aCam.Stop();
+	aTest(r==KErrNone);
+
+	aTest.Next(_L("Close the chunk"));
+	r=aCam.ChunkClose(ECamCaptureModeImage);
+	aTest(r==KErrNone);
+	r=aCam.ChunkClose(ECamCaptureModeVideo);
+	aTest(r==KErrNone);
+	}
+
+
+LOCAL_C void DoCamOpenCapTests(RTest& aTest,TInt aCameraSensorIndex)
+	{
+	TInt r;
+
+	// Open the camera driver to obtain the basic capabilities for use throughout the tests and
+	// then close it again so that it may be confirmed that opening multiple times is ok
+	aTest.Next(_L("CHANNEL OPEN AND CAPABILITIES TESTS"));
+	RDevCameraSc cam;
+	aTest.Next(_L("Open a channel on the camera driver"));
+	r=cam.Open(aCameraSensorIndex);
+	aTest(r==KErrNone);
+
+	// Make sure that the driver can handle attempts to start it before it has been configured
+	aTest.Next(_L("Try to start/stop camera before its configured"));
+	r=cam.Start();
+	aTest(r==KErrNotReady);
+	r=cam.Stop();
+	aTest(r==KErrGeneral);
+
+	aTest.Next(_L("Read the capabilities structure size of this device"));
+	CapsSize=cam.CapsSize();
+	aTest.Next(_L("Read and display the capabilities of this device"));
+	CapsBufPtr = User::Alloc(CapsSize);
+	TPtr8 capsPtr( (TUint8*)CapsBufPtr, CapsSize, CapsSize );
+	r=cam.Caps(capsPtr);
+	aTest(r==KErrNone);
+	CameraCaps = (TCameraCapsV02*) capsPtr.Ptr();
+	PrintCamModes(CameraCaps,aTest);
+
+	TAny* frameSizeCapsBuf;
+	SDevCamPixelFormat* pixelFormat;
+	TBuf<80> buf;
+	SDevCamFrameSize* frameSize;
+	TPtr8 frameSizeCapsPtr(0,0,0);
+	TUint fsCount, pfCount, theCount = 0;
+
+	/* IMAGE */
+	/* Use pixel formats from 0 to CapsBuf->iNumImagePixelFormats */
+	buf.Zero();
+	buf.Append(KCaptureModeImage);
+	buf.Append(_L("\r\n"));
+	aTest.Printf(buf);
+	pixelFormat = (SDevCamPixelFormat*) (CameraCaps + 1);
+	for (pfCount = theCount; pfCount < CameraCaps->iNumImagePixelFormats; pfCount++)
+		{
+		buf.Zero();
+		AppendPixelFormat(buf, pixelFormat->iPixelFormat);
+		aTest.Printf(buf);
+		frameSizeCapsBuf = User::Alloc(pixelFormat->iNumFrameSizes*sizeof(SDevCamFrameSize));
+		new (&frameSizeCapsPtr) TPtr8((TUint8*)frameSizeCapsBuf, pixelFormat->iNumFrameSizes*sizeof(SDevCamFrameSize), pixelFormat->iNumFrameSizes*sizeof(SDevCamFrameSize));
+		r=cam.FrameSizeCaps(ECamCaptureModeImage, pixelFormat->iPixelFormat, frameSizeCapsPtr);
+		aTest(r==KErrNone);
+		frameSize = (SDevCamFrameSize*) frameSizeCapsPtr.Ptr();
+		for (fsCount = 0; fsCount < pixelFormat->iNumFrameSizes; fsCount++)
+			{
+			aTest.Printf(_L("%dx%d "),frameSize->iWidth,frameSize->iHeight);
+			frameSize++;
+			}
+		aTest.Printf(_L("\n"));
+		User::Free(frameSizeCapsBuf);
+		pixelFormat++;
+		}
+
+	/* VIDEO */
+	buf.Zero();
+	buf.Append(KCaptureModeVideo);
+	buf.Append(_L("\r\n"));
+	aTest.Printf(buf);
+	pixelFormat = (SDevCamPixelFormat*) (CameraCaps + 1);
+	pixelFormat += CameraCaps->iNumImagePixelFormats;
+	theCount = CameraCaps->iNumImagePixelFormats + CameraCaps->iNumVideoPixelFormats;
+	for (pfCount = CameraCaps->iNumImagePixelFormats; pfCount < theCount; pfCount++)
+		{
+		buf.Zero();
+		AppendPixelFormat(buf, pixelFormat->iPixelFormat);
+		aTest.Printf(buf);
+		frameSizeCapsBuf = User::Alloc(pixelFormat->iNumFrameSizes*sizeof(SDevCamFrameSize));
+		new (&frameSizeCapsPtr) TPtr8((TUint8*)frameSizeCapsBuf, pixelFormat->iNumFrameSizes*sizeof(SDevCamFrameSize), pixelFormat->iNumFrameSizes*sizeof(SDevCamFrameSize));
+		r=cam.FrameSizeCaps(ECamCaptureModeVideo, pixelFormat->iPixelFormat, frameSizeCapsPtr);
+		aTest(r==KErrNone);
+		frameSize = (SDevCamFrameSize*) frameSizeCapsPtr.Ptr();
+		for (fsCount = 0; fsCount < pixelFormat->iNumFrameSizes; fsCount++)
+			{
+			aTest.Printf(_L("%dx%d "),frameSize->iWidth,frameSize->iHeight);
+			frameSize++;
+			}
+		aTest.Printf(_L("\n"));
+		User::Free(frameSizeCapsBuf);
+		pixelFormat++;
+		}
+
+	/* VIEW FINDER */
+	buf.Zero();
+	buf.Append(KCaptureModeViewFinder);
+	buf.Append(_L("\r\n"));
+	aTest.Printf(buf);
+	pixelFormat = (SDevCamPixelFormat*) (CameraCaps + 1);
+	pixelFormat += (CameraCaps->iNumImagePixelFormats + CameraCaps->iNumVideoPixelFormats);
+	theCount = CameraCaps->iNumImagePixelFormats + CameraCaps->iNumVideoPixelFormats + CameraCaps->iNumViewFinderPixelFormats;
+	for (pfCount = CameraCaps->iNumImagePixelFormats + CameraCaps->iNumVideoPixelFormats; pfCount < theCount; pfCount++)
+		{
+		buf.Zero();
+		AppendPixelFormat(buf, pixelFormat->iPixelFormat);
+		aTest.Printf(buf);
+		frameSizeCapsBuf = User::Alloc(pixelFormat->iNumFrameSizes*sizeof(SDevCamFrameSize));
+		new (&frameSizeCapsPtr) TPtr8((TUint8*)frameSizeCapsBuf, pixelFormat->iNumFrameSizes*sizeof(SDevCamFrameSize), pixelFormat->iNumFrameSizes*sizeof(SDevCamFrameSize));
+		r=cam.FrameSizeCaps(ECamCaptureModeViewFinder, pixelFormat->iPixelFormat, frameSizeCapsPtr);
+		aTest(r==KErrNone);
+		frameSize = (SDevCamFrameSize*) frameSizeCapsPtr.Ptr();
+		for (fsCount = 0; fsCount < pixelFormat->iNumFrameSizes; fsCount++)
+			{
+			aTest.Printf(_L("%dx%d "),frameSize->iWidth,frameSize->iHeight);
+			frameSize++;
+			}
+		aTest.Printf(_L("\n"));
+		User::Free(frameSizeCapsBuf);
+		pixelFormat++;
+		}
+
+	aTest.Next(_L("Try opening the same unit a second time."));
+	RDevCameraSc cam2;
+	r=cam2.Open(aCameraSensorIndex);
+	aTest(r==KErrInUse);
+
+	aTest.Next(_L("Open a channel from the 2nd thread without closing the 1st"));
+	RThread thread;
+	TRequestStatus stat;
+	SSecondaryThreadInfo sti;
+
+	// Setup the 2nd thread to open a channel on the same unit
+	sti.iTestId=ESecThreadTestOpen;
+	sti.iExpectedRetVal=KErrInUse;
+	sti.iCameraModuleIndex=aCameraSensorIndex;
+	r=thread.Create(_L("Thread"),secondaryThread,KDefaultStackSize,KHeapSize,KHeapSize,&sti);
+	Test(r==KErrNone);
+	thread.Logon(stat);
+	thread.Resume();
+	User::WaitForRequest(stat);
+	Test(stat.Int()==KErrNone);
+	Test(thread.ExitType()==EExitKill);
+	thread.Close();
+	User::After(10000);	// Wait 10ms
+
+	aTest.Next(_L("Open a channel from the 2nd thread having closed the 1st"));
+	cam.Close();		// Close the 1st channel
+	sti.iTestId=ESecThreadTestOpen;
+	sti.iExpectedRetVal=KErrNone;
+	r=thread.Create(_L("Thread02"),secondaryThread,KDefaultStackSize,KHeapSize,KHeapSize,&sti);
+	Test(r==KErrNone);
+	thread.Logon(stat);
+	thread.Resume();
+	User::WaitForRequest(stat);
+	Test(stat.Int()==KErrNone);
+	Test(thread.ExitType()==EExitKill);
+	thread.Close();
+	User::After(10000);	// Wait 10ms
+
+	aTest.Next(_L("Re-open channel and duplicate it from 2nd thread"));
+	r=cam.Open(aCameraSensorIndex);		// Re-open the channel
+	aTest(r==KErrNone);
+	sti.iTestId=ESecThreadTestDuplicateHandle;
+	sti.iExpectedRetVal=KErrAccessDenied;
+	sti.iThreadId=RThread().Id();	// Get the ID of this thread
+	sti.iDrvHandle=cam.Handle();	// Pass the channel handle
+
+	r=thread.Create(_L("Thread03"),secondaryThread,KDefaultStackSize,KHeapSize,KHeapSize,&sti); // Create secondary thread
+	Test(r==KErrNone);
+	thread.Logon(stat);
+	thread.Resume();
+	User::WaitForRequest(stat);
+	Test(stat.Int()==KErrNone);
+	Test(thread.ExitType()==EExitKill);
+	thread.Close();
+	User::After(10000);	// Wait 10ms
+
+	aTest.Next(_L("Re-use the same channel from 2nd thread"));
+	sti.iTestId=ESecThreadReuseHandle;
+	sti.iDrvHandle=(TInt)&cam;	// Pass a pointer to the channel
+	r=thread.Create(_L("Thread04"),secondaryThread,KDefaultStackSize,KHeapSize,KHeapSize,&sti); // Create secondary thread
+	Test(r==KErrNone);
+	thread.Logon(stat);
+	thread.Resume();
+	User::WaitForRequest(stat);
+	TExitCategoryName exitCategoryName = thread.ExitCategory();
+	Test.Printf(_L("Thread exit info: Cat:%S, Reason:%x, Type:%d\r\n"),&exitCategoryName,thread.ExitReason(),thread.ExitType());
+	Test(thread.ExitType()==EExitPanic);	// Secondary thread is expected to panic
+	Test(stat.Int()==KErrNone);
+	thread.Close();
+	User::After(10000);	// Wait 10ms
+
+	cam.Close();
+	}
+
+LOCAL_C void DoCamConfigTests(RDevCameraSc& aCam, RTest& aTest, TDevCamCaptureMode aCaptureMode, const SDevCamPixelFormat& aPixelFormat, const SDevCamFrameSize& aFrameSize)
+	{
+	TInt r;
+
+	aTest.Next(_L("GETTING & SETTING CONFIG TESTS"));
+	aTest.Printf(_L("CaptureMode = %d, PixelFormat = %x, FrameSize = %d x %d\n"),aCaptureMode,aPixelFormat.iPixelFormat,aFrameSize.iWidth,aFrameSize.iHeight);
+
+	aTest.Next(_L("Read and display the default camera config for requested capture mode"));
+	TCameraConfigV02Buf camConfBuf;
+	aCam.GetCamConfig(aCaptureMode, camConfBuf);
+	TCameraConfigV02 &camConf=camConfBuf();
+	PrintCamConf(camConf,aTest);
+
+	aTest.Next(_L("Read and display the default buffer config for requested capture mode"));
+	TMmSharedChunkBufConfig bufferConfig;
+	TPckg<TMmSharedChunkBufConfig> bufferConfigBuf(bufferConfig);
+	aCam.GetBufferConfig(aCaptureMode, bufferConfigBuf);
+	PrintBufferConf(bufferConfig,aTest);
+
+	aTest.Next(_L("Setup the config - creating a chunk"));
+	camConf.iFrameSize=aFrameSize;
+	camConf.iPixelFormat=aPixelFormat;
+	camConf.iFrameRate=aFrameSize.iMaxFrameRate;
+	r=aCam.SetCamConfig(aCaptureMode, camConfBuf);
+	aTest(r==KErrNone);
+	RChunk chunk;
+	r=aCam.SetBufConfigChunkCreate(aCaptureMode, KNumVideoFramesToAllocate, chunk);
+	aTest(r==KErrNone);
+	aCam.GetCamConfig(aCaptureMode, camConfBuf);
+	PrintCamConf(camConf,aTest);
+
+	aTest.Next(_L("Read and display the resulting buffer config"));
+	aCam.GetBufferConfig(aCaptureMode, bufferConfigBuf);
+	PrintBufferConf(bufferConfig,aTest);
+
+	aTest.Next(_L("Close the chunk created"));
+	chunk.Close();
+
+	aTest.Next(_L("Open a channel on the test driver"));
+	RMmCreateSc tstDrv;
+	r=tstDrv.Open();		// Opening the channel results in the creation of a shared chunk.
+	aTest(r==KErrNone);
+
+	aTest.Next(_L("Get a handle on its shared chunk"));
+	r=tstDrv.GetChunkHandle(chunk);	// Get a handle on the shared chunk created by the test driver
+	aTest(r==KErrNone);
+
+	aTest.Next(_L("Read and display the buffer config"));
+	TMmSharedChunkBufConfig bufferConfigTest;
+	TPckg<TMmSharedChunkBufConfig> bufferConfigBufTest(bufferConfigTest);
+
+	// Get info on the buffers within the shared chunk
+	aTest.Next(_L("Get info. on the shared chunk"));
+	r=tstDrv.GetBufInfo(bufferConfigBufTest);
+	aTest(r==KErrNone);
+
+	PrintBufferConf(bufferConfigTest,aTest);
+	aTest.Next(_L("Setup the config - supplying a chunk"));
+	r=aCam.SetBufConfigChunkOpen(aCaptureMode, bufferConfigBufTest, chunk);
+	aTest(r==KErrNone);
+	aCam.GetCamConfig(aCaptureMode, camConfBuf);
+	PrintCamConf(camConf,aTest);
+	aCam.GetBufferConfig(aCaptureMode, bufferConfigBufTest);
+	PrintBufferConf(bufferConfigTest,aTest);
+
+	aTest.Next(_L("Close the chunk driver and the 2nd chunk"));
+	tstDrv.Close();
+	chunk.Close();
+	}
+
+LOCAL_C void DoCamVideoCaptureTests(RDevCameraSc& aCam, RTest& aTest, TDevCamCaptureMode aCaptureMode, const SDevCamPixelFormat& aPixelFormat, const SDevCamFrameSize& aFrameSize, TUint aFrameRate)
+	{
+	TInt r;
+
+	aTest.Next(_L("VIDEO CAPTURE TESTS"));
+	aTest.Printf(_L("CaptureMode = %d, PixelFormat = %x, FrameSize = %d x %d\n"),aCaptureMode,aPixelFormat.iPixelFormat,aFrameSize.iWidth,aFrameSize.iHeight);
+
+	// Configure Video or Viewfinder Capture
+	TCameraConfigV02Buf camConfBuf;
+	aCam.GetCamConfig(aCaptureMode, camConfBuf);
+	TCameraConfigV02 &camConf=camConfBuf();
+
+	camConf.iFrameSize=aFrameSize;
+	camConf.iPixelFormat=aPixelFormat;
+	camConf.iFrameRate=aFrameRate;
+
+	// Set the camera configuration.
+	r=aCam.SetCamConfig(aCaptureMode,camConfBuf);
+	aTest(r==KErrNone);
+	aCam.GetCamConfig(aCaptureMode, camConfBuf);
+	PrintCamConf(camConf,aTest);
+
+	// Create a chunk handle and trigger the buffer creation.
+	aTest.Next(_L("Setup the config - creating a chunk"));
+	RChunk chunkVideo;
+	TInt numBuffers=KNumVideoFramesToAllocate;
+	r=aCam.SetBufConfigChunkCreate(aCaptureMode,numBuffers,chunkVideo);
+	aTest(r==KErrNone);
+
+	aTest.Next(_L("Read and display the resulting buffer config"));
+	TMmSharedChunkBufConfig bufferConfig;
+	TPckg<TMmSharedChunkBufConfig> bufferConfigBufVideo(bufferConfig);
+	aCam.GetBufferConfig(aCaptureMode, bufferConfigBufVideo);
+	PrintBufferConf(bufferConfig,aTest);
+
+	// Request and print the camera and buffer configurations for all three capture modes
+	aTest.Next(_L("Read and display the camera configs"));
+	aCam.GetCamConfig(ECamCaptureModeVideo, camConfBuf);
+	PrintCamConf(camConf,aTest);
+	aCam.GetCamConfig(ECamCaptureModeImage, camConfBuf);
+	PrintCamConf(camConf,aTest);
+	aCam.GetCamConfig(ECamCaptureModeViewFinder, camConfBuf);
+	PrintCamConf(camConf,aTest);
+
+	// Create and configure a display handler
+	TCamDisplayHandler dispHand;
+	r=dispHand.Init();
+	aTest(r==KErrNone);
+
+	if (aPixelFormat.iPixelFormat!=EUidPixelFormatJPEG && aPixelFormat.iPixelFormat!=EUidPixelFormatSpeedTaggedJPEG)
+		{
+		r=dispHand.SetConfig(aFrameSize,aPixelFormat);
+		aTest(r==KErrNone);
+		}
+
+	// Test that stop still returns an error.
+	r=aCam.Stop();
+	aTest(r==KErrGeneral);
+
+	// Set the current capture mode
+	r=aCam.SetCaptureMode(aCaptureMode);
+	aTest(r==KErrNone);
+
+	aTest.Next(_L("Start the camera in video mode"));
+	r=aCam.Start();
+	aTest(r==KErrNone);
+
+	aTest.Next(_L("Issue capture requests"));
+	aTest.Printf(_L("Request %d frames\r\n"),KNumVideoFramesToCapture);
+	// Issue new image requests immediately. We'll have to wait while the
+	// camera captures the images.
+	TRequestStatus rs[KNumVideoFramesToCapture];
+	TInt i;
+	for (i=0 ; i<KNumVideoFramesToCapture; i++)
+		{
+		aTest.Printf(_L("Requesting new image... %d\n"), i);
+		aCam.NotifyNewImage(rs[i]);
+		aTest.Printf(_L("Requested new image... %d\n"), i);
+		}
+
+	TInt retId=-1;
+	TInt retOffset=-1;
+	for (i=0 ; i<KNumVideoFramesToCapture; i++)
+		{
+		aTest.Printf(_L("Waiting for... %d\n"), i);
+		User::WaitForRequest(rs[i]);
+		retId=rs[i].Int();
+		aTest(retId>=0);
+		aTest.Printf(_L("Getting buffer offset for... %d\n"), i);
+		aCam.BufferIdToOffset(aCaptureMode,retId,retOffset);
+		aTest.Printf(_L("Buffer%d(id:%d) offset: %d(%xH)\r\n"),i,retId,retOffset,retOffset);
+		aTest(retOffset>=0);
+		}
+
+	TUint8* imgBase;
+
+	// Display each image received for 333ms
+	for (i=0 ; i<KNumVideoFramesToCapture; i++)
+		{
+		if (aPixelFormat.iPixelFormat!=EUidPixelFormatJPEG && aPixelFormat.iPixelFormat!=EUidPixelFormatSpeedTaggedJPEG)
+			{
+			retId=rs[i].Int();
+			aTest(retId>=0);
+			aCam.BufferIdToOffset(aCaptureMode,retId,retOffset);
+			aTest(retOffset>=0);
+			imgBase=chunkVideo.Base()+retOffset;
+			r=dispHand.Process(imgBase);
+			
+#ifdef __WINSCW__
+			aTest(r==KErrNotSupported);
+#else
+			aTest(r==KErrNone);
+#endif
+
+			User::After(333000);	// 0.33sec
+			}
+		}
+
+	aTest.Next(_L("Free the buffers"));
+	for (i=0 ; i<KNumVideoFramesToCapture; i++)
+		{
+		aTest.Printf(_L("Releasing %d(i:%d) "),rs[i].Int(), i);
+		r=aCam.ReleaseBuffer(rs[i].Int());
+		aTest.Printf(_L("buffer(%d), r=%d\n"),rs[i].Int(),r);
+		aTest(r==KErrNone);
+		}
+
+	aTest.Next(_L("Issue more capture requests"));
+	// Wait a bit more so camera has images ready as soon as we issue the requests
+	User::After(500000);	// 0.5sec
+
+	aTest.Printf(_L("Request %d frames\r\n"),KNumVideoFramesToCapture);
+	for (i=0 ; i<KNumVideoFramesToCapture; i++)
+		aCam.NotifyNewImage(rs[i]);
+
+	for (i=0 ; i<KNumVideoFramesToCapture; i++)
+		{
+		User::WaitForRequest(rs[i]);
+		retId=rs[i].Int();
+		aTest(retId>=0);
+		aCam.BufferIdToOffset(aCaptureMode,retId,retOffset);
+		aTest.Printf(_L("Buffer%d(id:%d) offset: %d(%xH)\r\n"),i,retId,retOffset,retOffset);
+		aTest(retOffset>=0);
+		}
+
+	aTest.Next(_L("Stop the camera."));
+	r=aCam.Stop();
+	aTest(r==KErrNone);
+
+	aTest.Next(_L("Start it again."));
+	r=aCam.Start();
+	aTest(r==KErrNone);
+
+	aTest.Next(_L("Continuously display for 10 secs"));
+	RTimer tim;
+	tim.CreateLocal();
+	TRequestStatus timStatus;
+	const TUint KTimeOut=10000000;	// 10 seconds
+	tim.After(timStatus,KTimeOut);
+	aTest(timStatus==KRequestPending);
+	aCam.NotifyNewImage(rs[0]);
+	aCam.NotifyNewImage(rs[1]);
+	FOREVER
+		{
+		User::WaitForAnyRequest();
+		if (timStatus!=KRequestPending)
+			{
+			aCam.NotifyNewImageCancel();
+			User::WaitForRequest(rs[0]);
+			User::WaitForRequest(rs[1]);
+			break;
+			}
+		else if (rs[0]!=KRequestPending)
+			{
+			retId=rs[0].Int();
+			aTest(retId>=0);
+			aCam.BufferIdToOffset(aCaptureMode,retId,retOffset);
+			aTest(retOffset>=0);
+			imgBase=chunkVideo.Base()+retOffset;
+			if (aPixelFormat.iPixelFormat!=EUidPixelFormatJPEG && aPixelFormat.iPixelFormat!=EUidPixelFormatSpeedTaggedJPEG)
+				{
+				r=dispHand.Process(imgBase);
+				
+#ifdef __WINSCW__
+				aTest(r==KErrNotSupported);
+#else
+				aTest(r==KErrNone);
+#endif
+				
+				}
+			r=aCam.ReleaseBuffer(retId);
+			aTest(r==KErrNone);
+			aCam.NotifyNewImage(rs[0]);
+			}
+		else if (rs[1]!=KRequestPending)
+			{
+			retId=rs[1].Int();
+			aTest(retId>=0);
+			aCam.BufferIdToOffset(aCaptureMode,retId,retOffset);
+			aTest(retOffset>=0);
+			imgBase=chunkVideo.Base()+retOffset;
+			if (aPixelFormat.iPixelFormat!=EUidPixelFormatJPEG && aPixelFormat.iPixelFormat!=EUidPixelFormatSpeedTaggedJPEG)
+				{
+				r=dispHand.Process(imgBase);
+				
+#ifdef __WINSCW__
+				aTest(r==KErrNotSupported);
+#else
+				aTest(r==KErrNone);
+#endif
+				
+				}
+			r=aCam.ReleaseBuffer(retId);
+			aTest(r==KErrNone);
+			aCam.NotifyNewImage(rs[1]);
+			}
+		else
+			aTest(0);
+		}
+
+	tim.Close();
+
+	aTest.Next(_L("Stop the camera."));
+	r=aCam.Stop();
+	aTest(r==KErrNone);
+
+	aTest.Next(_L("Close the chunk"));
+	r=aCam.ChunkClose(aCaptureMode);
+	}
+
+LOCAL_C void DoCamImageCaptureTests(RDevCameraSc& aCam, RTest& aTest, TInt aCameraSensorIndex, const SDevCamPixelFormat& aPixelFormat, const SDevCamFrameSize& aFrameSize, TUint aFrameRate)
+	{
+	TInt r;
+
+	aTest.Next(_L("IMAGE CAPTURE TESTS"));
+	aTest.Printf(_L("PixelFormat = %d, FrameSize = %d x %d\n"),aPixelFormat.iPixelFormat,aFrameSize.iWidth,aFrameSize.iHeight);
+
+	// Configure Image Capture
+	TCameraConfigV02Buf camConfBuf;
+	aCam.GetCamConfig(ECamCaptureModeImage, camConfBuf);
+	TCameraConfigV02 &camConf=camConfBuf();
+
+	camConf.iFrameSize=aFrameSize;
+	camConf.iPixelFormat=aPixelFormat;
+	camConf.iFrameRate=aFrameRate;
+
+	// Set the camera configuration.
+	r=aCam.SetCamConfig(ECamCaptureModeImage,camConfBuf);
+	aTest(r==KErrNone);
+	aCam.GetCamConfig(ECamCaptureModeImage, camConfBuf);
+	PrintCamConf(camConf,aTest);
+
+	// Create a chunk handle and trigger the buffer creation.
+	aTest.Next(_L("Setup the config - creating a chunk"));
+	RChunk chunkImage;
+	TInt numBuffers=KNumVideoFramesToAllocate;
+	r=aCam.SetBufConfigChunkCreate(ECamCaptureModeImage,numBuffers,chunkImage);
+	aTest(r==KErrNone);
+
+	aTest.Next(_L("Read and display the resulting buffer config"));
+	TMmSharedChunkBufConfig bufferConfig;
+	TPckg<TMmSharedChunkBufConfig> bufferConfigBufImage(bufferConfig);
+	aCam.GetBufferConfig(ECamCaptureModeImage, bufferConfigBufImage);
+	PrintBufferConf(bufferConfig,aTest);
+
+	// Create and configure a display handler
+	TCamDisplayHandler dispHand;
+	r=dispHand.Init();
+	aTest(r==KErrNone);
+
+	if (aPixelFormat.iPixelFormat!=EUidPixelFormatJPEG && aPixelFormat.iPixelFormat!=EUidPixelFormatSpeedTaggedJPEG)
+		{
+		r=dispHand.SetConfig(aFrameSize,aPixelFormat);
+		aTest(r==KErrNone);
+		}
+
+	// Test that stop still returns an error.
+	r=aCam.Stop();
+	aTest(r==KErrGeneral);
+
+	// Set the current capture mode
+	r=aCam.SetCaptureMode(ECamCaptureModeImage);
+	aTest(r==KErrNone);
+
+	aTest.Next(_L("Start the camera in image capture mode"));
+	r=aCam.Start();
+	aTest(r==KErrNone);
+
+	aTest.Next(_L("Issue a capture request"));
+	TRequestStatus rs1;
+	aCam.NotifyNewImage(rs1);
+	User::WaitForRequest(rs1);
+	TInt retId=rs1.Int();
+	TInt retOffset=-1;
+	aTest(retId>=0);
+	aCam.BufferIdToOffset(ECamCaptureModeImage,retId,retOffset);
+	aTest.Printf(_L("Buffer offset: %d(%xH)\r\n"),retId,retOffset);
+	aTest(retOffset>=0);
+
+	TUint8* imgBase;
+	imgBase=chunkImage.Base()+retOffset;
+
+	if (aPixelFormat.iPixelFormat!=EUidPixelFormatJPEG && aPixelFormat.iPixelFormat!=EUidPixelFormatSpeedTaggedJPEG)
+		{
+		// Display the image received for 1s
+		r=dispHand.Process(imgBase);
+		
+#ifdef __WINSCW__
+        aTest(r==KErrNotSupported);
+#else
+        aTest(r==KErrNone);
+#endif
+        
+		User::After(1000000);	// 1 sec
+		}
+
+	// Save the to do MMC card with a filename to indicate its size.  If no MMC card is present
+	// then we will just display a warning rather than fail as this is an optional manual step
+	TBuf<100> fileName(KSensor);
+	fileName.AppendNum(aCameraSensorIndex);
+	fileName.Append(KUnderscore);
+	fileName.AppendFormat(KFrameSize, aFrameSize.iWidth, aFrameSize.iHeight);
+	fileName.Append(KUnderscore);
+	AppendPixelFormat(fileName, aPixelFormat.iPixelFormat);
+
+	TBool wrote = ETrue;
+	RBitmap bitmap;
+
+	if ((aPixelFormat.iPixelFormat == EUidPixelFormatJPEG) || (aPixelFormat.iPixelFormat == EUidPixelFormatSpeedTaggedJPEG))
+		{
+		fileName.Append((aPixelFormat.iPixelFormat == EUidPixelFormatJPEG) ? KJpeg : KSpeedTaggedJpeg);
+		r=bitmap.WriteBuffer(fileName, imgBase, (aFrameSize.iWidth * aFrameSize.iHeight * aPixelFormat.iPixelWidthInBytes));
+		}
+	else if ((aPixelFormat.iPixelFormat == EUidPixelFormatYUV_422Interleaved) || (aPixelFormat.iPixelFormat == EUidPixelFormatRGB_565))
+		{
+		fileName.Append(KBmp);
+		r=bitmap.WriteBMP(fileName, imgBase, aPixelFormat, aFrameSize.iWidth, aFrameSize.iHeight);
+		}
+	else
+		{
+		wrote = EFalse;
+		}
+
+	if (wrote)
+		{
+		if (r==KErrNone)
+			{
+			aTest.Printf(_L("Wrote image to %S\n"),&fileName);
+			}
+		else
+			{
+			aTest.Printf(_L("Warning: Unable to write %S (error = %d)\r\n"),&fileName,r);
+			}
+		}
+
+	aTest.Next(_L("Free the buffer"));
+	r=aCam.ReleaseBuffer(retId);
+	aTest(r==KErrNone);
+
+	aTest.Next(_L("Issue two consecutive capture requests"));
+	TRequestStatus rs2;
+	aCam.NotifyNewImage(rs1);
+	aCam.NotifyNewImage(rs2);
+
+	User::WaitForRequest(rs1);
+	retId=rs1.Int();
+	aTest(retId>=0);
+	aCam.BufferIdToOffset(ECamCaptureModeImage,retId,retOffset);
+	aTest.Printf(_L("Buffer0 offset: %d(%xH)\r\n"),retOffset,retOffset);
+	aTest(retOffset>=0);
+
+	if (aPixelFormat.iPixelFormat!=EUidPixelFormatJPEG && aPixelFormat.iPixelFormat!=EUidPixelFormatSpeedTaggedJPEG)
+		{
+		// Display the image received for 1s
+		imgBase=chunkImage.Base()+retOffset;
+		r=dispHand.Process(imgBase);
+		
+#ifdef __WINSCW__
+        aTest(r==KErrNotSupported);
+#else
+        aTest(r==KErrNone);
+#endif
+        
+		User::After(1000000);	// 1 sec
+		}
+
+	r=aCam.ReleaseBuffer(retId);
+	aTest(r==KErrNone);
+
+	User::WaitForRequest(rs2);
+	retId=rs2.Int();
+	aTest(retId>=0);
+	aCam.BufferIdToOffset(ECamCaptureModeImage,retId,retOffset);
+	aTest.Printf(_L("Buffer1 offset: %d(%xH)\r\n"),retOffset,retOffset);
+	aTest(retOffset>=0);
+
+	if (aPixelFormat.iPixelFormat!=EUidPixelFormatJPEG && aPixelFormat.iPixelFormat!=EUidPixelFormatSpeedTaggedJPEG)
+		{
+		// Display the image received for 1s
+		imgBase=chunkImage.Base()+retOffset;
+		r=dispHand.Process(imgBase);
+		
+#ifdef __WINSCW__
+        aTest(r==KErrNotSupported);
+#else
+        aTest(r==KErrNone);
+#endif
+        
+		User::After(1000000);	// 1 sec
+		}
+
+	r=aCam.ReleaseBuffer(retId);
+	aTest(r==KErrNone);
+
+	aTest.Next(_L("Issue four more separate capture requests"));
+	for (TInt i=0 ; i<4 ; i++)
+		{
+		aCam.NotifyNewImage(rs1);
+		User::WaitForRequest(rs1);
+		retId=rs1.Int();
+		aTest(retId>=0);
+		aCam.BufferIdToOffset(ECamCaptureModeImage,retId,retOffset);
+		aTest.Printf(_L("Buffer%d offset: %d(%xH)\r\n"),i,retOffset,retOffset);
+		aTest(retOffset>=0);
+
+		if (aPixelFormat.iPixelFormat!=EUidPixelFormatJPEG && aPixelFormat.iPixelFormat!=EUidPixelFormatSpeedTaggedJPEG)
+			{
+			// Display the image received for 1s
+			imgBase=chunkImage.Base()+retOffset;
+			r=dispHand.Process(imgBase);
+			
+#ifdef __WINSCW__
+            aTest(r==KErrNotSupported);
+#else
+            aTest(r==KErrNone);
+#endif
+            
+			User::After(1000000);	// 1 sec
+			}
+		}
+
+	r=aCam.ReleaseBuffer(retId);
+	aTest(r==KErrNone);
+
+	aTest.Next(_L("Stop the camera."));
+	r=aCam.Stop();
+	aTest(r==KErrNone);
+
+	aTest.Next(_L("Close the chunk"));
+	r=aCam.ChunkClose(ECamCaptureModeImage);
+	aTest(r==KErrNone);
+	}
+
+LOCAL_C void DoCamCancelTests(RTest& aTest, TInt aCameraSensorIndex)
+	{
+	TInt bufferSize, r;
+	SDevCamFrameSize* frameSizes;
+	TCameraConfigV02Buf camConfBuf;
+
+	aTest.Next(_L("CAPTURE CANCEL TESTS"));
+
+	RDevCameraSc cam;
+	aTest.Next(_L("Open a channel on the camera driver"));
+	r=cam.Open(aCameraSensorIndex);
+	aTest(r==KErrNone);
+
+	TInt numBuffers=KNumVideoFramesToAllocate;
+	SDevCamPixelFormat* pixelFormat = (SDevCamPixelFormat*) (CameraCaps + 1);
+
+	// Test Image Capture, if supported
+	if (CameraCaps->iNumImagePixelFormats)
+		{
+		// If iNumImagePixelFormats is > 0 then the matching iNumFrameSizes should also be > 0
+		Test(pixelFormat->iNumFrameSizes > 0);
+		frameSizes = new SDevCamFrameSize[pixelFormat->iNumFrameSizes];
+		Test(frameSizes != NULL);
+		bufferSize = (sizeof(SDevCamFrameSize) * pixelFormat->iNumFrameSizes);
+		TPtr8 frameSizesBuf((TUint8*) frameSizes, bufferSize, bufferSize);
+		r = cam.FrameSizeCaps(ECamCaptureModeImage, pixelFormat->iPixelFormat, frameSizesBuf);
+		Test(r == KErrNone);
+
+		cam.GetCamConfig(ECamCaptureModeImage, camConfBuf);
+
+		camConfBuf().iFrameSize=frameSizes[0];
+		camConfBuf().iPixelFormat=*pixelFormat;
+		camConfBuf().iFrameRate=frameSizes[0].iMaxFrameRate;
+
+		// Set the camera configuration.
+		r=cam.SetCamConfig(ECamCaptureModeImage, camConfBuf);
+		aTest(r==KErrNone);
+		cam.GetCamConfig(ECamCaptureModeImage, camConfBuf);
+		PrintCamConf(camConfBuf(), aTest);
+
+		// Create a chunk handle and trigger the buffer creation.
+		RChunk chunkImage;
+		aTest.Next(_L("Setup the config - creating a chunk for image capture"));
+		r=cam.SetBufConfigChunkCreate(ECamCaptureModeImage,numBuffers,chunkImage);
+		aTest(r==KErrNone);
+
+		aTest.Next(_L("Read and display the resulting buffer config"));
+		TMmSharedChunkBufConfig bufferConfig;
+		TPckg<TMmSharedChunkBufConfig> bufferConfigBufImage(bufferConfig);
+		cam.GetBufferConfig(ECamCaptureModeImage, bufferConfigBufImage);
+		PrintBufferConf(bufferConfig,aTest);
+
+		// Set the current capture mode
+		r=cam.SetCaptureMode(ECamCaptureModeImage);
+		aTest(r==KErrNone);
+
+		aTest.Next(_L("Start the camera in image capture mode."));
+		r=cam.Start();
+		aTest(r==KErrNone);
+
+		TRequestStatus rs[KNumVideoFramesToCapture];
+		TInt retId, retOffset;
+
+		aTest.Next(_L("Issue a request and then cancel it"));
+		cam.NotifyNewImage(rs[0]);
+		cam.NotifyNewImageCancel();
+		User::WaitForRequest(rs[0]);
+		retId=rs[0].Int();
+		aTest(retId==KErrCancel || retId>=0);
+		if (retId>=0)
+			{
+			cam.BufferIdToOffset(ECamCaptureModeImage,retId,retOffset);
+			aTest.Printf(_L("Buffer%d : %d\r\n"),retId,retOffset);
+			aTest(retOffset>=0);
+			cam.ReleaseBuffer(retId);
+			}
+
+		aTest.Next(_L("Stop the camera."));
+		r=cam.Stop();
+		aTest(r==KErrNone);
+
+		aTest.Next(_L("Close the Image chunk"));
+		chunkImage.Close();
+
+		delete [] frameSizes;
+		}
+
+	// Skip past the image pixel formats
+	pixelFormat += CameraCaps->iNumImagePixelFormats;
+
+	// Test Video Capture, if supported
+	if (CameraCaps->iNumVideoPixelFormats)
+		{
+		// If iNumVideoPixelFormats is > 0 then the matching iNumFrameSizes should also be > 0
+		Test(pixelFormat->iNumFrameSizes > 0);
+		frameSizes = new SDevCamFrameSize[pixelFormat->iNumFrameSizes];
+		Test(frameSizes != NULL);
+		bufferSize = (sizeof(SDevCamFrameSize) * pixelFormat->iNumFrameSizes);
+		TPtr8 frameSizesBuf((TUint8*) frameSizes, bufferSize, bufferSize);
+		r = cam.FrameSizeCaps(ECamCaptureModeImage, pixelFormat->iPixelFormat, frameSizesBuf);
+		Test(r == KErrNone);
+
+		cam.GetCamConfig(ECamCaptureModeVideo, camConfBuf);
+
+		camConfBuf().iFrameSize=frameSizes[0];
+		camConfBuf().iPixelFormat=*pixelFormat;
+		camConfBuf().iFrameRate=frameSizes[0].iMaxFrameRate;
+
+		// Set the camera configuration.
+		r=cam.SetCamConfig(ECamCaptureModeVideo, camConfBuf);
+		aTest(r==KErrNone);
+		cam.GetCamConfig(ECamCaptureModeVideo, camConfBuf);
+		PrintCamConf(camConfBuf(), aTest);
+
+		// Create a chunk handle and trigger the buffer creation.
+		RChunk chunkVideo;
+		aTest.Next(_L("Setup the config - creating a chunk for video capture"));
+		r=cam.SetBufConfigChunkCreate(ECamCaptureModeVideo,numBuffers,chunkVideo);
+		aTest(r==KErrNone);
+
+		aTest.Next(_L("Read and display the resulting buffer config"));
+		TMmSharedChunkBufConfig bufferConfig;
+		TPckg<TMmSharedChunkBufConfig> bufferConfigBufVideo(bufferConfig);
+		cam.GetBufferConfig(ECamCaptureModeVideo, bufferConfigBufVideo);
+		PrintBufferConf(bufferConfig,aTest);
+
+		// Set the current capture mode
+		r=cam.SetCaptureMode(ECamCaptureModeVideo);
+		aTest(r==KErrNone);
+
+		aTest.Next(_L("Start the camera in video mode"));
+		r=cam.Start();
+		aTest(r==KErrNone);
+
+		aTest.Next(_L("Issue capture requests and globally cancel them all"));
+		aTest.Printf(_L("Request %d frames\r\n"),KNumVideoFramesToCapture);
+		TRequestStatus rs[KNumVideoFramesToCapture];
+		TInt i;
+		for (i=0 ; i<KNumVideoFramesToCapture; i++)
+			cam.NotifyNewImage(rs[i]);
+
+		cam.NotifyNewImageCancel();
+
+		TInt retOffset = -2;
+		TInt retId = -2;
+		for (i=0 ; i<KNumVideoFramesToCapture; i++)
+			{
+			User::WaitForRequest(rs[i]);
+			retId=rs[i].Int();
+			aTest(retId==KErrCancel || retId>=0);
+			if (retId>=0)
+				{
+				cam.BufferIdToOffset(ECamCaptureModeVideo,retId,retOffset);
+				aTest.Printf(_L("Buffer%d : %d\r\n"),retId,retOffset);
+				aTest(retOffset>=0);
+				cam.ReleaseBuffer(retId);
+				}
+			}
+
+		aTest.Next(_L("Issue capture requests and individually cancel them all"));
+		aTest.Printf(_L("Request %d frames\r\n"),KNumVideoFramesToCapture);
+
+		for (i=0 ; i<KNumVideoFramesToCapture; i++)
+			cam.NotifyNewImage(rs[i]);
+
+		for (i=0 ; i<KNumVideoFramesToCapture; i++)
+			cam.NotifyNewImageCancel(rs[i]);
+
+		for (i=0 ; i<KNumVideoFramesToCapture; i++)
+			{
+			User::WaitForRequest(rs[i]);
+			retId=rs[i].Int();
+			aTest(retId==KErrCancel || retId>=0);
+			if (retId>=0)
+				{
+				cam.BufferIdToOffset(ECamCaptureModeVideo,retId,retOffset);
+				aTest.Printf(_L("Buffer%d : %d\r\n"),retId,retOffset);
+				aTest(retOffset>=0);
+				cam.ReleaseBuffer(retId);
+				}
+			}
+
+		aTest.Next(_L("Stop the camera."));
+		r=cam.Stop();
+		aTest(r==KErrNone);
+
+		aTest.Next(_L("Close the Video chunk"));
+		chunkVideo.Close();
+
+		delete [] frameSizes;
+		}
+
+	// Skip past the video pixel formats
+	pixelFormat += CameraCaps->iNumVideoPixelFormats;
+
+	// Test Viewfinder Capture, if supported
+	if (CameraCaps->iNumViewFinderPixelFormats)
+		{
+		// If iNumViewFinderPixelFormats is > 0 then the matching iNumFrameSizes should also be > 0
+		Test(pixelFormat->iNumFrameSizes > 0);
+		frameSizes = new SDevCamFrameSize[pixelFormat->iNumFrameSizes];
+		Test(frameSizes != NULL);
+		bufferSize = (sizeof(SDevCamFrameSize) * pixelFormat->iNumFrameSizes);
+		TPtr8 frameSizesBuf((TUint8*) frameSizes, bufferSize, bufferSize);
+		r = cam.FrameSizeCaps(ECamCaptureModeViewFinder, pixelFormat->iPixelFormat, frameSizesBuf);
+		Test(r == KErrNone);
+
+		cam.GetCamConfig(ECamCaptureModeViewFinder, camConfBuf);
+
+		camConfBuf().iFrameSize=frameSizes[0];
+		camConfBuf().iPixelFormat=*pixelFormat;
+		camConfBuf().iFrameRate=frameSizes[0].iMaxFrameRate;
+
+		// Set the camera configuration.
+		r=cam.SetCamConfig(ECamCaptureModeViewFinder, camConfBuf);
+		aTest(r==KErrNone);
+		cam.GetCamConfig(ECamCaptureModeViewFinder, camConfBuf);
+		PrintCamConf(camConfBuf(), aTest);
+
+		// Create a chunk handle and trigger the buffer creation.
+		RChunk chunkViewFinder;
+		aTest.Next(_L("Setup the config - creating a chunk for viewfinder capture"));
+		r=cam.SetBufConfigChunkCreate(ECamCaptureModeViewFinder,numBuffers,chunkViewFinder);
+		aTest(r==KErrNone);
+
+		aTest.Next(_L("Read and display the resulting buffer config"));
+		TMmSharedChunkBufConfig bufferConfig;
+		TPckg<TMmSharedChunkBufConfig> bufferConfigBufViewFinder(bufferConfig);
+		cam.GetBufferConfig(ECamCaptureModeViewFinder, bufferConfigBufViewFinder);
+		PrintBufferConf(bufferConfig,aTest);
+
+		aTest.Next(_L("Close the Viewfinder chunk"));
+		chunkViewFinder.Close();
+
+		delete [] frameSizes;
+		}
+
+	aTest.Next(_L("Close the drivers"));
+	cam.Close();
+	}
+
+void CameraTests(TInt aCameraSensorIndex)
+	{
+	TUint index, size;
+	Test.Printf(_L("Testing unit number: %d\r\n"),aCameraSensorIndex);
+
+	// Perform some basic opening and multithreaded tests.  We don't want just in time debugging during
+	// these tests
+	TBool justInTime=User::JustInTime();
+	User::SetJustInTime(EFalse);
+	DoCamOpenCapTests(Test,aCameraSensorIndex);
+	User::SetJustInTime(justInTime);
+
+	// Test request handling
+	DoCamCancelTests(Test, aCameraSensorIndex);
+
+	// Re-open the camera driver for use below and to ensure that it can deal with being re-opened (it
+	// has already been opened and closed by DoCamOpenCapTests())
+	RDevCameraSc cam;
+	Test.Next(_L("Open a channel on the camera driver"));
+	TInt r=cam.Open(aCameraSensorIndex);
+	Test(r==KErrNone);
+
+	// Test Dynamic Settings, e.g. Brightness, Contrast, etc.
+	DoCamDynamicSettingsTests(cam, Test);
+	
+	// Go through all supported image, video and viewfinder pixel formats and perform configuration
+	// and capture tests on them all, for all supported frame sizes and frame rates
+	TInt bufferSize;
+	SDevCamFrameSize* frameSizes;
+	TBool imageConfigTestsDone=EFalse, videoConfigTestsDone=EFalse, viewFinderConfigTestsDone=EFalse;
+	SDevCamPixelFormat* pixelFormat = (SDevCamPixelFormat*) (CameraCaps + 1);
+
+	for (index = 0; index < CameraCaps->iNumImagePixelFormats; ++index)
+		{
+		// If iNumImagePixelFormats is > 0 then the matching iNumFrameSizes should also be > 0
+		Test(pixelFormat->iNumFrameSizes > 0);
+		Test.Printf(_L("Image pixel format %x, number of frame sizes = %d\n"), pixelFormat->iPixelFormat, pixelFormat->iNumFrameSizes);
+		frameSizes=new SDevCamFrameSize[pixelFormat->iNumFrameSizes];
+		Test(frameSizes!=NULL);
+		bufferSize=(sizeof(SDevCamFrameSize) * pixelFormat->iNumFrameSizes);
+		TPtr8 frameSizesBuf((TUint8*) frameSizes, bufferSize, bufferSize);
+		r = cam.FrameSizeCaps(ECamCaptureModeImage, pixelFormat->iPixelFormat, frameSizesBuf);
+		Test(r == KErrNone);
+
+		// Test camera configuration for image capture.  This is only done once for the sake of
+		// test expediency
+		if (!imageConfigTestsDone)
+			{
+			imageConfigTestsDone = ETrue;
+			DoCamConfigTests(cam, Test, ECamCaptureModeImage, *pixelFormat, frameSizes[0]);
+			}
+
+		// Test image capture mode
+		for (size = 0; size < pixelFormat->iNumFrameSizes; ++size)
+			{
+			DoCamImageCaptureTests(cam, Test, aCameraSensorIndex, *pixelFormat, frameSizes[size], frameSizes[size].iMaxFrameRate);
+			}
+
+		// Test buffer offset
+		for (size = 0; size < pixelFormat->iNumFrameSizes; ++size)
+			{
+			DoCamBufferOffsetTests(cam, Test, *pixelFormat, frameSizes[size], frameSizes[size].iMaxFrameRate);
+			}
+
+		delete [] frameSizes;
+		++pixelFormat;
+		}
+
+	for (index = 0; index < CameraCaps->iNumVideoPixelFormats; ++index)
+		{
+		// If iNumVideoPixelFormats is > 0 then the matching iNumFrameSizes should also be > 0
+		Test(pixelFormat->iNumFrameSizes > 0);
+		Test.Printf(_L("Video pixel format %x, number of frame sizes = %d\n"), pixelFormat->iPixelFormat, pixelFormat->iNumFrameSizes);
+		frameSizes=new SDevCamFrameSize[pixelFormat->iNumFrameSizes];
+		Test(frameSizes!=NULL);
+		bufferSize=(sizeof(SDevCamFrameSize) * pixelFormat->iNumFrameSizes);
+		TPtr8 frameSizesBuf((TUint8*) frameSizes, bufferSize, bufferSize);
+		r = cam.FrameSizeCaps(ECamCaptureModeVideo, pixelFormat->iPixelFormat, frameSizesBuf);
+		Test(r == KErrNone);
+
+		// Test camera configuration for video capture.  This is only done once for the sake of
+		// test expediency
+		if (!videoConfigTestsDone)
+			{
+			videoConfigTestsDone=ETrue;
+			DoCamConfigTests(cam, Test, ECamCaptureModeVideo, *pixelFormat, frameSizes[0]);
+			}
+
+		// Test video capture mode
+		for (size = 0; size < pixelFormat->iNumFrameSizes; ++size)
+			{
+			DoCamVideoCaptureTests(cam, Test, ECamCaptureModeVideo, *pixelFormat,frameSizes[size], frameSizes[size].iMaxFrameRate);
+			}
+		delete [] frameSizes;
+		++pixelFormat;
+		}
+
+	for (index = 0; index < CameraCaps->iNumViewFinderPixelFormats; ++index)
+		{
+		// If iNumViewFinderPixelFormats is > 0 then the matching iNumFrameSizes should also be > 0
+		Test(pixelFormat->iNumFrameSizes > 0);
+		Test.Printf(_L("Viewfinder pixel format %x, number of frame sizes = %d\n"), pixelFormat->iPixelFormat, pixelFormat->iNumFrameSizes);
+		frameSizes=new SDevCamFrameSize[pixelFormat->iNumFrameSizes];
+		Test(frameSizes!=NULL);
+		bufferSize=(sizeof(SDevCamFrameSize) * pixelFormat->iNumFrameSizes);
+		TPtr8 frameSizesBuf((TUint8*) frameSizes, bufferSize, bufferSize);
+		r = cam.FrameSizeCaps(ECamCaptureModeViewFinder, pixelFormat->iPixelFormat, frameSizesBuf);
+		Test(r == KErrNone);
+
+		// Test camera configuration for view finder capture.  This is only done once for the sake of
+		// test expediency
+		if (!viewFinderConfigTestsDone)
+			{
+			viewFinderConfigTestsDone=ETrue;
+			DoCamConfigTests(cam, Test, ECamCaptureModeViewFinder, *pixelFormat, frameSizes[0]);
+			}
+
+		// Test view finder capture mode
+		for (size = 0; size < pixelFormat->iNumFrameSizes; ++size)
+			{
+			DoCamVideoCaptureTests(cam, Test, ECamCaptureModeViewFinder, *pixelFormat, frameSizes[size], frameSizes[size].iMaxFrameRate);
+			}
+		delete [] frameSizes;
+		++pixelFormat;
+		}
+	cam.Close();
+
+	// And free the global capabilities buffer that was allocated in DoCamOpenCapTests()
+	User::Free(CapsBufPtr);
+	}
+
+GLDEF_C TInt E32Main()
+	{
+	__UHEAP_MARK;
+
+	Test.Title();
+	Test.Start(_L("Camera module API test"));
+
+	Test.Next(_L("Loading CAMERA PDD"));
+	TInt r=User::LoadPhysicalDevice(KCamPddFileName);
+	Test.Printf(_L("Returned %d\r\n"),r);
+
+	if (r==KErrNotFound)
+		{
+		Test.Printf(_L("Shared chunk camera driver not supported - test skipped\r\n"));
+		Test.End();
+		Test.Close();
+		__UHEAP_MARKEND;
+		return(KErrNone);
+		}
+
+	Test(r==KErrNone || r==KErrAlreadyExists);
+
+	Test.Next(_L("Loading CAMERA LDD"));
+	r=User::LoadLogicalDevice(KCamLddFileName);
+	Test.Printf(_L("Returned %d\r\n"),r);
+	Test(r==KErrNone || r==KErrAlreadyExists);
+
+	Test.Next(_L("Loading D_MMCSC LDD"));
+	r=User::LoadLogicalDevice(KTstLddFileName);
+	Test.Printf(_L("Returned %d\r\n"),r);
+	Test(r==KErrNone||r==KErrAlreadyExists);
+
+	__KHEAP_MARK;
+
+	if (User::CommandLineLength()>0)
+		{
+		TBuf<0x100> cmd;
+		TInt moduleIndex = KUnit0;
+		User::CommandLine(cmd);
+		Test(cmd.Length()>0);
+		if (cmd[0]>='0' && cmd[0]<='9')
+			moduleIndex=(TInt)(cmd[0]-'0');
+		CameraTests(moduleIndex);
+		}
+	else // If no command line arguments are passed we perform tests on the module 0 and 1
+		{
+		CameraTests(0);
+		}
+
+	__KHEAP_MARKEND;
+
+	// Free the PDDs and LDDs
+	Test.Next(_L("Freeing ECAMERASC LDD"));
+	r=User::FreeLogicalDevice(KDevCameraScName);
+	Test(r==KErrNone);
+
+	Test.Next(_L("Freeing CAMERASC PDD"));
+	TFindPhysicalDevice fDr;
+	TFullName drivName;
+	TName searchName;
+	searchName.Append(KDevCameraScName);
+	searchName.Append(KCamFreePddExtension);
+	fDr.Find(searchName);
+	r=fDr.Next(drivName);
+	Test(r==KErrNone);
+	r=User::FreePhysicalDevice(drivName);
+	Test(r==KErrNone);
+
+	Test.Next(_L("Freeing D_MMCSC LDD"));
+	r=User::FreeLogicalDevice(KDevMmCScName);
+	Test(r==KErrNone);
+
+	Test.End();
+	Test.Close();
+
+	__UHEAP_MARKEND;
+	return(KErrNone);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/multimedia/t_camera_bitmap.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,291 @@
+// 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/multimedia/t_camera_bitmap.cpp
+// This is a basic Windows bitmap file writer, that can be used for converting YUV422 data into
+// RGB format and dumping it to a Windows .bmp file, for manual examination.
+// 
+//
+
+#include <e32test.h>
+#include <f32file.h>
+#include "t_camera_bitmap.h"
+
+#define CLIP(a) if (a < 0) a = 0; else if (a > 255) a = 255;
+
+/**
+Converts a RGB565 buffer into 24 bit RGB format in a second buffer.
+@param	aDest		Pointer to the buffer into which to place the 24 bit RGB data
+@param	aSource		Pointer to the buffer containing the RGB565 data to be converted
+@param	aWidth		The width of the data in the buffer in pixels
+@param	aHeight		The height of the data in the buffer in pixels
+*/
+void RBitmap::RGBToRGB(TUint8* aDest, TUint8* aSource, TInt aWidth, TInt aHeight)
+	{
+	TUint16* source = (TUint16*) aSource;
+	TUint16 pixel;
+
+	for (TInt y = 0; y < aHeight; ++y)
+		{
+		for (TInt x = 0; x < aWidth; ++x)
+			{
+			pixel = *source++;
+			*aDest++ = (TUint8) ((pixel & 0xf800) >> 8);
+			*aDest++ = (TUint8) ((pixel & 0x07e0) >> 3);
+			*aDest++ = (TUint8) ((pixel & 0x001f) << 3);
+			}
+		}
+	}
+
+/**
+Converts a YUV422 buffer into 24 bit RGB format in a second buffer.
+@param	aDest		Pointer to the buffer into which to place the 24 bit RGB data
+@param	aSource		Pointer to the buffer containing the YUV422 data to be converted
+@param	aWidth		The width of the data in the buffer in pixels
+@param	aHeight		The height of the data in the buffer in pixels
+*/
+void RBitmap::YUVToRGB(TUint8* aDest, TUint8* aSource, TInt aWidth, TInt aHeight)
+	{
+	TInt y, u, v, r, g, b;
+
+	aDest += ((aWidth * 3) * (aHeight - 1));
+
+	for (TInt l = 0; l < aHeight; ++l)
+		{
+		for (TInt x = 0; x < (aWidth / 2); ++x)
+			{
+			u = (aSource[0] - 128);
+			v = (aSource[2] - 128);
+			y = (aSource[3] - 16);
+
+			r = ((298 * y + 409 * u) / 256);
+			g = ((298 * y - 100 * v - 208 * u) / 256);
+			b = ((298 * y + 516 * v) / 256);
+
+			CLIP(r);
+			CLIP(g);
+			CLIP(b);
+
+			*aDest++ = (TUint8) r;
+			*aDest++ = (TUint8) g;
+			*aDest++ = (TUint8) b;
+
+			y = (aSource[1] - 16);
+
+			r = ((298 * y + 409 * u) / 256);
+			g = ((298 * y - 100 * v - 208 * u) / 256);
+			b = ((298 * y + 516 * v) / 256);
+
+			CLIP(r);
+			CLIP(g);
+			CLIP(b);
+
+			*aDest++ = (TUint8) r;
+			*aDest++ = (TUint8) g;
+			*aDest++ = (TUint8) b;
+			aSource += 4;
+			}
+
+		aDest -= (aWidth * 3 * 2);
+		}
+	}
+
+/**
+Converts a 32 bit long from whatever the host format is into little endian format in a user supplied buffer.
+@param	aBuffer		Pointer to the buffer into which to write the value
+@param	aLong		The value to be written
+*/
+void RBitmap::PutLong(TUint8* aBuffer, TInt aLong)
+	{
+	*aBuffer++ = (TUint8) (aLong & 0xff);
+	*aBuffer++ = (TUint8) ((aLong >> 8) & 0xff);
+	*aBuffer++ = (TUint8) ((aLong >> 16) & 0xff);
+	*aBuffer++ = (TUint8) ((aLong >> 24) & 0xff);
+	}
+
+/**
+Converts a 16 bit short from whatever the host format is into little endian format in a user supplied buffer.
+@param	aBuffer		Pointer to the buffer into which to write the value
+@param	aShort		The value to be written
+*/
+void RBitmap::PutShort(TUint8* aBuffer, TInt16 aShort)
+	{
+	*aBuffer++ = (TUint8) (aShort & 0xff);
+	*aBuffer++ = (TUint8) ((aShort >> 8) & 0xff);
+	}
+
+/**
+Writes a standard Windows .bmp header to a file, including the standard .bmp file header, followed
+by a V3 DIB header.
+@param	aFile		A reference to the file to which to write the header
+@param	aWidth		The width of the bitmap in pixels
+@param	aHeight		The height of the bitmap in pixels
+@return	KErrNone if write was successful, otherwise one of the other system wide error codes
+*/
+TInt RBitmap::WriteHeader(RFile& aFile, TInt aWidth, TInt aHeight)
+	{
+	TBuf8<14> header(14);
+	TUint8* buffer = (TUint8*) header.Ptr();
+
+	header.Fill(0);
+
+	header[0] = 'B';
+	header[1] = 'M';
+	PutLong((buffer + 2), (14 + 40 + (aWidth * aHeight * 3)));
+	PutLong((buffer + 10), (14 + 40));
+
+	TInt r = aFile.Write(header);
+
+	if (r == KErrNone)
+		{
+		TBuf8<40> bitmapInfoHeader(40);
+		TUint8* buffer = (TUint8*) bitmapInfoHeader.Ptr();
+
+		bitmapInfoHeader.Fill(0);
+
+		PutLong(buffer, 40);
+		PutLong((buffer + 4), aWidth);
+		PutLong((buffer + 8), aHeight);
+		PutShort((buffer + 12), 1);
+		PutShort((buffer + 14), 24);
+		PutLong((buffer + 20), (aWidth * aHeight * 3));
+
+		r = aFile.Write(bitmapInfoHeader);
+		}
+
+	return r;
+	}
+
+/**
+Converts a YUV422 or RGB565 buffer into 24 bit RGB format and writes it to a file.
+@param	aFile			A reference to the file to which to write the data
+@param	aBuffer			A pointer to the buffer containing the data to be converted and written
+@param	aPixelFormat	UID specifying the format of the source data
+@param	aWidth			The width of the data in the buffer in pixels
+@param	aHeight			The height of the data in the buffer in pixels
+@return	KErrNone if write was successful, otherwise one of the other system wide error codes
+*/
+TInt RBitmap::WriteBitmapData(RFile& aFile, TUint8* aBuffer, SDevCamPixelFormat aPixelFormat, TInt aWidth, TInt aHeight)
+	{
+	TInt length = (aWidth * aHeight * 3);
+	TUint8* rgbBuffer = new TUint8[length];
+
+	TInt r = KErrNone;
+
+	if (rgbBuffer)
+		{
+		if (aPixelFormat.iPixelFormat == EUidPixelFormatYUV_422Interleaved)
+			{
+			YUVToRGB(rgbBuffer, aBuffer, aWidth, aHeight);
+			}
+		else if (aPixelFormat.iPixelFormat == EUidPixelFormatRGB_565)
+			{
+			RGBToRGB(rgbBuffer, aBuffer, aWidth, aHeight);
+			}
+		else
+			{
+			r = KErrNotSupported;
+			}
+
+		if (r == KErrNone)
+			{
+			TPtr8 buffer(rgbBuffer, length, length);
+			r = aFile.Write(buffer);
+			}
+
+		delete [] rgbBuffer;
+		}
+	else
+		{
+		r = KErrNoMemory;
+		}
+
+	return r;
+	}
+
+/**
+Converts a YUV422 or RGB565 buffer into 24 bit RGB format and writes it to a Windows .bmp file.
+@param	aFileName		A reference to the fully qualified name of the file to write the .bmp file to
+@param	aBuffer			A pointer to the buffer containing the data to be converted and written
+@param	aPixelFormat	UID specifying the format of the source data
+@param	aWidth			The width of the data in the buffer in pixels
+@param	aHeight			The height of the data in the buffer in pixels
+@return	KErrNone if write was successful, otherwise one of the other system wide error codes
+*/
+TInt RBitmap::WriteBMP(const TDesC& aFileName, TUint8* aBuffer, SDevCamPixelFormat aPixelFormat, TInt aWidth, TInt aHeight)
+	{
+	TInt r;
+	RFile file;
+	RFs fs;
+
+	if ((r = fs.Connect()) == KErrNone)
+		{
+		if ((r = file.Replace(fs, aFileName, EFileWrite)) == KErrNone)
+			{
+			if ((r = WriteHeader(file, aWidth, aHeight)) == KErrNone)
+				{
+				r = WriteBitmapData(file, aBuffer, aPixelFormat, aWidth, aHeight);
+				}
+
+			file.Close();
+
+			// If anything went wrong, delete the file so that we do not leave partial files that
+			// might cause confusion
+			if (r != KErrNone)
+				{
+				fs.Delete(aFileName);
+				}
+			}
+
+		fs.Close();
+		}
+
+	return r;
+	}
+
+/**
+Dumps a buffer straight to disk, without any kind of processing.
+@param	aFileName		A reference to the fully qualified name of the file to write the file to
+@param	aBuffer			A pointer to the buffer containing the data to be converted written
+@param	aSize			The size of the buffer to be written, in bytes
+@return	KErrNone if write was successful, otherwise one of the other system wide error codes
+*/
+TInt RBitmap::WriteBuffer(const TDesC& aFileName, TUint8* aBuffer, TInt aSize)
+	{
+	TInt r;
+	RFile file;
+	RFs fs;
+
+	if ((r = fs.Connect()) == KErrNone)
+		{
+		if ((r = file.Replace(fs, aFileName, EFileWrite)) == KErrNone)
+			{
+			TPtrC8 buffer(aBuffer, aSize);
+
+			r = file.Write(buffer);
+
+			file.Close();
+
+			// If anything went wrong, delete the file so that we do not leave partial files that
+			// might cause confusion
+			if (r != KErrNone)
+				{
+				fs.Delete(aFileName);
+				}
+			}
+
+		fs.Close();
+		}
+
+	return r;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/multimedia/t_camera_bitmap.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,43 @@
+// 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/multimedia/t_camera_bitmap.h
+// This is a basic Windows bitmap file writer, that can be used for converting YUV422 data into
+// RGB format and dumping it to a Windows .bmp file, for manual examination.
+// 
+//
+
+#if !defined(__T_CAMERA_BITMAP_H__)
+#define __T_CAMERA_BITMAP_H__
+
+#include <d32camerasc.h>
+#include <f32file.h>
+
+class RBitmap
+	{
+public:
+
+	TInt WriteBMP(const TDesC& aFileName, TUint8* aBuffer, SDevCamPixelFormat aPixelFormat, TInt aWidth, TInt aHeight);
+	TInt WriteBuffer(const TDesC& aFileName, TUint8* aBuffer, TInt aSize);
+
+private:
+
+	void RGBToRGB(TUint8* aDest, TUint8* aSource, TInt aWidth, TInt aHeight);
+	void YUVToRGB(TUint8* aDest, TUint8* aSource, TInt aWidth, TInt aHeight);
+	void PutLong(TUint8* aBuffer, TInt aLong);
+	void PutShort(TUint8* aBuffer, TInt16 aShort);
+	TInt WriteHeader(RFile& aFile, TInt aWidth, TInt aHeight);
+	TInt WriteBitmapData(RFile& aFile, TUint8* aBuffer, SDevCamPixelFormat aPixelFormat, TInt aWidth, TInt aHeight);
+	};
+
+#endif // ! __T_CAMERA_BITMAP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/multimedia/t_camera_display.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,388 @@
+// 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\multimedia\t_camera_display.cpp
+// 
+//
+
+#include <e32test.h>
+#include <e32svr.h>
+#include <u32hal.h>
+#include <videodriver.h>
+#include "t_camera_display.h"
+
+_LIT(KFrameSizeConfTitle,"Current frame size  :");
+_LIT(KFrameSize, " %d x %d");
+
+#define CLIP(a) if (a < 0) a = 0; else if (a > 255) a = 255;
+
+/**
+Constructor
+*/
+TCamDisplayHandler::TCamDisplayHandler()
+	{}
+
+/**
+Initialise the display handler.
+@return KErrNone if write was successful, otherwise one of the other system wide error codes.
+*/
+TInt TCamDisplayHandler::Init()
+	{
+	TScreenInfoV01 screenInfo;
+	TPckg<TScreenInfoV01> screenInfoBuf(screenInfo);
+	UserSvr::ScreenInfo(screenInfoBuf);
+	iVideoAddress = (TUint8*) screenInfo.iScreenAddress;
+	iScreenWidth = screenInfo.iScreenSize.iWidth;
+	iScreenHeight = screenInfo.iScreenSize.iHeight;
+
+	TPckgBuf<TVideoInfoV01> videoInfoBuf;
+	UserSvr::HalFunction(EHalGroupDisplay, EDisplayHalCurrentModeInfo, &videoInfoBuf, NULL);
+	iBitsPerPixel = videoInfoBuf().iBitsPerPixel;
+
+	return(KErrNone);
+	}
+
+TInt TCamDisplayHandler::Min(TInt aA, TInt aB)
+	{
+	return (aA < aB) ? aA : aB;
+	}
+
+TInt TCamDisplayHandler::SetConfig(const SDevCamFrameSize& aSize,const SDevCamPixelFormat& aPixelFormat)
+	{
+	if (aPixelFormat.iPixelFormat==EUidPixelFormatYUV_422Interleaved || aPixelFormat.iPixelFormat==EUidPixelFormatRGB_565)
+		iPixelFormat=aPixelFormat;
+	else
+		return(KErrArgument);
+
+	iWidth = aSize.iWidth;
+	iHeight = aSize.iHeight;
+
+	return(KErrNone);
+	}
+
+/**
+Post process a received image.
+@return KErrNone if write was successful, otherwise one of the other system wide error codes.
+*/
+TInt TCamDisplayHandler::Process(TUint8* aImageBaseAddress)
+	{
+	switch (iPixelFormat.iPixelFormat)
+		{
+		case EUidPixelFormatYUV_422Interleaved:
+			return(ProcessYUV422(aImageBaseAddress));
+		case EUidPixelFormatRGB_565:
+			return(ProcessRGB565(aImageBaseAddress));
+		default:
+			return(KErrNotSupported);
+		}
+	}
+
+/**
+Post process a received RGB565 image.
+@return KErrNone if write was successful, otherwise one of the other system wide error codes.
+*/
+TInt TCamDisplayHandler::ProcessRGB565(TUint8* aImageBaseAddress)
+	{
+	TUint16* source = (TUint16*) aImageBaseAddress;
+	TUint16 pixel;
+	TInt sourceModulo, destModulo, width, height;
+	TInt r = KErrNone;
+
+	// Determine whether the screen or the picture to display is the widest, and calculate modulos
+	// and clipping sizes appropriately
+	if (iWidth < iScreenWidth)
+		{
+		width = iWidth;
+		sourceModulo = 0;
+		destModulo = (iScreenWidth - iWidth);
+		}
+	else
+		{
+		width = iScreenWidth;
+		sourceModulo = (iWidth - iScreenWidth);
+		destModulo = 0;
+		}
+
+	// Determine whether the screen or the picture to display is the highest
+	height = (iHeight < iScreenHeight) ? iHeight : iScreenHeight;
+
+	if (iBitsPerPixel == 16)
+		{
+		TUint16* dest = (TUint16*) iVideoAddress;
+
+		// Loop around and copy the data directly onto the screen
+		for (TInt line = 0; line < height; ++line)
+			{
+			for (TInt x = 0; x < width; ++x)
+				{
+				*dest++ = *source++;
+				}
+
+			source += sourceModulo;
+			dest += destModulo;
+			}
+		}
+	else if (iBitsPerPixel == 32)
+		{
+		TUint8* dest = iVideoAddress;
+
+		destModulo *= 4;
+
+		// Loop around and convert whatever part of the picture will fit onto the screen into BGRA,
+		// writing it directly onto the screen
+		for (TInt line = 0; line < height; ++line)
+			{
+			for (TInt x = 0; x < width; ++x)
+				{
+				pixel = *source++;
+				*dest++= (TUint8) ((pixel & 0x001f) << 3);
+				*dest++= (TUint8) ((pixel & 0x07e0) >> 3);
+				*dest++= (TUint8) ((pixel & 0xf800) >> 8);
+				*dest++ = 0xff;
+				}
+
+			source += sourceModulo;
+			dest += destModulo;
+			}
+		}
+	else
+		{
+		r = KErrNotSupported;
+		}
+
+	return r;
+	}
+
+/**
+Post process a received YUV422 image.
+@return KErrNone if write was successful, otherwise one of the other system wide error codes.
+*/
+TInt TCamDisplayHandler::ProcessYUV422(TUint8* aImageBaseAddress)
+	{
+	TUint16* dest16 = (TUint16*) iVideoAddress;
+	TUint32* dest32 = (TUint32*) iVideoAddress;
+	TUint8* source = aImageBaseAddress;
+	TInt y, u, v, r, g, b, sourceModulo, destModulo, width, height;
+	TInt retVal = KErrNone;
+
+	// Determine whether the screen or the picture to display is the widest, and calculate modulos
+	// and clipping sizes appropriately
+	if (iWidth < iScreenWidth)
+		{
+		width = (iWidth / 2);
+		sourceModulo = 0;
+		destModulo = (iScreenWidth - iWidth);
+		}
+	else
+		{
+		width = (iScreenWidth / 2);
+		sourceModulo = ((iWidth - iScreenWidth) * 2);
+		destModulo = 0;
+		}
+
+	// Determine whether the screen or the picture to display is the highest
+	height = (iHeight < iScreenHeight) ? iHeight : iScreenHeight;
+
+	// Only 16 and 32 bits per pixel are supported.  It is also assumed that 16 bit will be RGB565 and
+	// 32 bit will be BGRA.  You will need to add support for new formats if required
+	if ((iBitsPerPixel == 16) || (iBitsPerPixel == 32))
+		{
+		// Loop around and convert whatever part of the picture will fit onto the screen into RGB565 or BGRA,
+		// writing it directly onto the screen
+		for (TInt line = 0; line < height; ++line)
+			{
+			for (TInt x = 0; x < width; ++x)
+				{
+				u = (source[0] - 128);
+				v = (source[2] - 128);
+				y = (source[3] - 16);
+
+				r = ((298 * y + 409 * u) / 256);
+				g = ((298 * y - 100 * v - 208 * u) / 256);
+				b = ((298 * y + 516 * v) / 256);
+
+				CLIP(r);
+				CLIP(g);
+				CLIP(b);
+
+				if (iBitsPerPixel == 16)
+					{
+					*dest16++ = (TUint16) (((b & 0xf8) << 8) | ((g & 0xfc) << 3) | ((r & 0xf8) >> 3));
+					}
+				else
+					{
+					*dest32++ = (0xff000000 | (r << 16) | (g << 8) | b);
+					}
+
+				y = (source[1] - 16);
+
+				r = ((298 * y + 409 * u) / 256);
+				g = ((298 * y - 100 * v - 208 * u) / 256);
+				b = ((298 * y + 516 * v) / 256);
+
+				CLIP(r);
+				CLIP(g);
+				CLIP(b);
+
+				if (iBitsPerPixel == 16)
+					{
+					*dest16++ = (TUint16) (((b & 0xf8) << 8) | ((g & 0xfc) << 3) | ((r & 0xf8) >> 3));
+					}
+				else
+					{
+					*dest32++ = (0xff000000 | (r << 16) | (g << 8) | b);
+					}
+
+				source += 4;
+				}
+
+			source += sourceModulo;
+			dest16 += destModulo;
+			dest32 += destModulo;
+			}
+		}
+	else
+		{
+		retVal = KErrNotSupported;
+		}
+
+	return retVal;
+	}
+
+/**
+Appends a string representing a pixel format UID onto a descriptor.
+@param aBuffer		Reference to the descriptor into which to append the string.  It is up to the
+					caller to ensure that this is large enough.
+@param aPixelFormat	UID of the pixel format to be converted into a string.
+*/
+void AppendPixelFormat(TDes& aBuffer, TUidPixelFormat aPixelFormat)
+	{
+	if (aPixelFormat == EUidPixelFormatRGB_565)
+		aBuffer.Append(KPixelFormatRGB_565);
+	else if (aPixelFormat == EUidPixelFormatYUV_422Interleaved)
+		aBuffer.Append(KPixelFormatYUV_422Interleaved);
+	else if (aPixelFormat == EUidPixelFormatSpeedTaggedJPEG)
+		aBuffer.Append(KPixelFormatSpeedTaggedJPEG);
+	else if (aPixelFormat == EUidPixelFormatJPEG)
+		aBuffer.Append(KPixelFormatJPEG);
+	else
+		aBuffer.Append(KPixelFormatUnknown);
+	}
+
+void PrintCamModes(TCameraCapsV02* aCaps,RTest& aTest)
+	{
+	TBuf<80> buf;
+
+	// Display the supported capture modes
+	buf.Zero();
+	buf.Append(KCaptureModeCapsTitle);
+	if (aCaps->iNumImagePixelFormats)
+		buf.Append(KCaptureModeImage);
+	if (aCaps->iNumVideoPixelFormats)
+		buf.Append(KCaptureModeVideo);
+	if (aCaps->iNumViewFinderPixelFormats)
+		buf.Append(KCaptureModeViewFinder);
+	buf.Append(_L("\r\n"));
+	aTest.Printf(buf);
+
+	// Display the supported video pixel formats
+	TUint i;
+	SDevCamPixelFormat* pixelFormat;
+	if (aCaps->iNumImagePixelFormats)
+		{
+		buf.Zero();
+		buf.Append(KPixelFormatCapsTitle);
+		buf.Append(KCaptureModeImage);
+		pixelFormat = (SDevCamPixelFormat*) (aCaps + 1);
+		for (i = 0; i < aCaps->iNumImagePixelFormats; i++)
+			{
+			AppendPixelFormat(buf, pixelFormat->iPixelFormat);
+			pixelFormat++;
+			}
+		buf.Append(_L("\r\n"));
+		aTest.Printf(buf);
+		}
+
+	if (aCaps->iNumVideoPixelFormats)
+		{
+		buf.Zero();
+		buf.Append(KPixelFormatCapsTitle);
+		buf.Append(KCaptureModeVideo);
+		pixelFormat = (SDevCamPixelFormat*) (aCaps + 1);
+		for (i = aCaps->iNumImagePixelFormats; i < (aCaps->iNumImagePixelFormats + aCaps->iNumVideoPixelFormats); i++)
+			{
+			AppendPixelFormat(buf, pixelFormat->iPixelFormat);
+			pixelFormat++;
+			}
+		buf.Append(_L("\r\n"));
+		aTest.Printf(buf);
+		}
+
+	if (aCaps->iNumViewFinderPixelFormats)
+		{
+		buf.Zero();
+		buf.Append(KPixelFormatCapsTitle);
+		buf.Append(KCaptureModeViewFinder);
+		pixelFormat = (SDevCamPixelFormat*) (aCaps + 1);
+		i = aCaps->iNumImagePixelFormats + aCaps->iNumImagePixelFormats + 1;
+		for (i = aCaps->iNumImagePixelFormats + aCaps->iNumVideoPixelFormats; i < (aCaps->iNumImagePixelFormats + aCaps->iNumVideoPixelFormats + aCaps->iNumViewFinderPixelFormats); i++)
+			{
+			AppendPixelFormat(buf, pixelFormat->iPixelFormat);
+			pixelFormat++;
+			}
+		buf.Append(_L("\r\n"));
+		aTest.Printf(buf);
+		}
+	}
+
+void PrintCamConf(TCameraConfigV02& aConf,RTest& aTest)
+	{
+	TBuf<80> buf;
+
+	// Display the current frame size
+	buf.Zero();
+	buf.Append(KFrameSizeConfTitle);
+	buf.AppendFormat(KFrameSize, aConf.iFrameSize.iWidth, aConf.iFrameSize.iHeight);
+	buf.Append(_L("\r\n"));
+	aTest.Printf(buf);
+
+	// Display the current pixel format
+	buf.Zero();
+	buf.Append(KPixelFormatConfTitle);
+	AppendPixelFormat(buf, aConf.iPixelFormat.iPixelFormat);
+	buf.Append(_L("\r\n"));
+	aTest.Printf(buf);
+
+	// Display the current frame rate
+	buf.Zero();
+	buf.Format(_L("Current frame rate  : %d fps\r\n"),aConf.iFrameRate);
+	aTest.Printf(buf);
+	}
+
+void PrintBufferConf(TMmSharedChunkBufConfig& aBufConf,RTest& aTest)
+	{
+	TBuf<80> buf(0);
+
+	SBufSpecList* tempSpec = aBufConf.iSpec;
+
+	// Display the buffer configuration
+	buf.Format(_L("Buffer Config       : NumBufs:%d Size:%xH\r\n"),aBufConf.iNumBuffers,aBufConf.iBufferSizeInBytes);
+	aTest.Printf(buf);
+	if (aBufConf.iFlags & KScFlagBufOffsetListInUse)
+		{
+		buf.Format(_L(" Offsets[%08xH,%08xH,%08xH,%08xH]\r\n"),tempSpec[0].iBufferOffset,tempSpec[1].iBufferOffset,tempSpec[2].iBufferOffset,tempSpec[3].iBufferOffset);
+		aTest.Printf(buf);
+		buf.Format(_L(" Offsets[%08xH,%08xH,%08xH,%08xH]\r\n"),tempSpec[4].iBufferOffset,tempSpec[5].iBufferOffset,tempSpec[6].iBufferOffset,tempSpec[7].iBufferOffset);
+		aTest.Printf(buf);
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/multimedia/t_camera_display.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,72 @@
+// 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\multimedia\t_camera_display.h
+// 
+//
+
+#if !defined(__T_CAMERA_DISPLAY_H__)
+#define __T_CAMERA_DISPLAY_H__
+
+#include <e32test.h>
+#include <d32camerasc.h>
+#include <pixelformats.h>
+#include "d_mmcsc.h"
+
+_LIT(KCaptureModeCapsTitle, "Capture modes: ");
+_LIT(KCaptureModeImage, "Image ");
+_LIT(KCaptureModeVideo, "Video ");
+_LIT(KCaptureModeViewFinder, "ViewFinder ");
+
+_LIT(KPixelFormatCapsTitle, "Pixel formats: ");
+_LIT(KPixelFormatConfTitle, "Current pixel format: ");
+_LIT(KPixelFormatUnknown, "Pixel Format Unknown (Other) ");
+_LIT(KPixelFormatRGB_565, "RGB565 ");
+_LIT(KPixelFormatYUV_422Interleaved, "YUV422 Interleaved ");
+_LIT(KPixelFormatSpeedTaggedJPEG, "Speed Tagged JPEG ");
+_LIT(KPixelFormatJPEG, "JPEG ");
+
+class TCamDisplayHandler
+	{
+public:
+	TCamDisplayHandler();
+	TInt Init();
+	TInt SetConfig(const SDevCamFrameSize& aSize,const SDevCamPixelFormat& aPixelFormat);
+	TInt Process(TUint8* aImageBaseAddress);
+private:
+	TInt Min(TInt aA, TInt aB);
+	TInt ProcessRGB565(TUint8* aImageBaseAddress);
+	TInt ProcessYUV422(TUint8* aImageBaseAddress);
+private:
+	/** Pixel format of the data to be converted and displayed */
+	SDevCamPixelFormat iPixelFormat;
+	/** Address of the top left hand corner of screen memory */
+	TUint8* iVideoAddress;
+	/** Width of the frame to be displayed, in pixels */
+	TUint iWidth;
+	/** Height of the frame to be displayed, in pixels */
+	TUint iHeight;
+	/** Width of the screen, in pixels */
+	TUint iScreenWidth;
+	/** Height of the screen, in pixels */
+	TUint iScreenHeight;
+	/** Number of bits per pixel */
+	TInt iBitsPerPixel;
+	};
+
+void AppendPixelFormat(TDes& aBuffer, TUidPixelFormat aPixelFormat);
+void PrintCamModes(TCameraCapsV02* aCaps,RTest& aTest);
+void PrintCamConf(TCameraConfigV02& aConf,RTest& aTest);
+void PrintBufferConf(TMmSharedChunkBufConfig& aBufConf,RTest& aTest);
+
+#endif // __T_CAMERA_DISPLAY_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/multimedia/t_camera_gen.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,494 @@
+// 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:
+// e32test\multimedia\t_camera_gen.cpp
+// 
+//
+
+#include <e32test.h>
+#include <d32camerasc.h>
+#include <e32def.h>
+#include <e32def_private.h>
+#include "t_camera_display.h"
+#include "d_mmcsc.h"
+
+_LIT(KTstLddFileName,"D_MMCSC.LDD");
+_LIT(KCamLddFileName,"ECAMERASC.LDD");
+
+#ifdef __WINSCW__
+_LIT(KCamPddFileName,"_TEMPLATE_CAMERASC.PDD");
+#else
+_LIT(KCamPddFileName,"CAMERASC.PDD");
+#endif
+
+_LIT(KCamFreePddExtension,".*");
+
+const TInt KUnit0=0;
+const TInt KFrameRate=30;		// Run the test at 30fps
+
+class CCameraHandler;
+
+RTest test(_L("T_CAMERA_GEN"));
+CCameraHandler* camera;
+
+/**
+Wait for a key press, but timeout so automated tests
+are unaffected
+*/
+void util_getch_withtimeout(TUint aSecs)
+	{
+	TRequestStatus keyStat;
+	test.Console()->Read(keyStat);
+	RTimer timer;
+	test(timer.CreateLocal()==KErrNone);
+	TRequestStatus timerStat;
+	timer.After(timerStat,aSecs*1000000);
+	User::WaitForRequest(timerStat,keyStat);
+	if(keyStat!=KRequestPending)
+		(void)test.Console()->KeyCode();
+	timer.Cancel();
+	timer.Close();
+	test.Console()->ReadCancel();
+	User::WaitForAnyRequest();
+	}
+
+// Define the frame number to capture
+// For image capture this should be zero.
+const TInt64 KFrameNumberToCapture= 50;
+
+/// Defines camera handler
+class CCameraHandler : public CActive
+	{
+public:
+	static CCameraHandler* NewL();
+	~CCameraHandler();
+	TInt SetConfig(TDevCamCaptureMode aCaptureMode, SDevCamFrameSize aSize,SDevCamPixelFormat aPixelFormat,TBool aCreateChunk,TInt aNumBuffers);
+	void GetConfig(TDevCamCaptureMode aCaptureMode);
+	TInt GetCaps();
+	TInt SetFirstConfig(TUint aOffset);
+	TInt Start(TDevCamCaptureMode aCaptureMode);
+	TInt Stop();
+	void SetCaptureMode(TDevCamCaptureMode aCaptureMode);
+private:
+	CCameraHandler();
+	virtual void RunL();
+	virtual void DoCancel();
+	TInt Init();
+private:
+	TCamDisplayHandler iDispHandler[ECamCaptureModeMax];
+	RDevCameraSc iCamera;
+	RChunk iChunk[ECamCaptureModeMax];
+	TInt iFrameCount;
+	TDevCamCaptureMode iCaptureMode;
+	TInt iCapsSize;
+	TAny* iCapsBufPtr;
+	TCameraCapsV02* iCameraCaps;
+	};
+
+CCameraHandler::CCameraHandler() : CActive(EPriorityStandard)
+//
+// Constructor for the camera handler
+//
+	{
+	// Active object priority is set to normal
+	}
+
+CCameraHandler::~CCameraHandler()
+//
+// Destructor for the camera handler
+//
+	{
+	for (TInt captureMode=0; captureMode < ECamCaptureModeMax; captureMode++)
+		iChunk[captureMode].Close();
+	if(iCapsBufPtr)
+		User::Free(iCapsBufPtr);
+	iCamera.Close();
+	// Cancel any active request
+	CActive::Cancel();
+	}
+
+void CCameraHandler::DoCancel()
+	{
+
+	}
+
+CCameraHandler* CCameraHandler::NewL()
+//
+// Create active camera
+//
+	{
+	test.Printf(_L("NewL\r\n"));
+	CCameraHandler *cc = new (ELeave) CCameraHandler;
+	TInt r=cc->Init();
+	if (r!=KErrNone)
+		User::Leave(r);
+	CActiveScheduler::Add(cc);
+	return(cc);
+	}
+
+TInt CCameraHandler::Init()
+//
+// Initialise hardware
+//
+	{
+	test.Printf(_L("Init\r\n"));
+	TInt r;
+	for (TInt captureMode=0; captureMode < ECamCaptureModeMax; captureMode++)
+		{
+		r=iDispHandler[captureMode].Init();
+		if (r!=KErrNone)
+			return(r);
+		}
+
+	// Open camera driver channel
+	r=iCamera.Open(KUnit0);
+	return(r);
+	}
+
+void CCameraHandler::SetCaptureMode(TDevCamCaptureMode aCaptureMode)
+	{
+	iCaptureMode=aCaptureMode;
+	}
+
+TInt CCameraHandler::GetCaps()
+	{
+	test.Printf(_L("GetCaps\r\n"));
+	iCapsSize=iCamera.CapsSize();
+	iCapsBufPtr = User::Alloc(iCapsSize);
+	TPtr8 capsPtr( (TUint8*)iCapsBufPtr, iCapsSize, iCapsSize );
+	TInt r = iCamera.Caps(capsPtr);
+	if(r!=KErrNone)
+		return r;
+	iCameraCaps = (TCameraCapsV02*) capsPtr.Ptr();
+
+	test.Printf(_L("Number of supported pixel formats:%d\r\n"),iCameraCaps->iNumVideoPixelFormats);
+	return r;
+	}
+
+void CCameraHandler::GetConfig(TDevCamCaptureMode aCaptureMode)
+	{
+	test.Printf(_L("GetConfig\r\n"));
+	// Config camera
+	TCameraConfigV02Buf configBuf;
+	TCameraConfigV02 &config=configBuf();
+
+	iCamera.GetCamConfig(aCaptureMode, configBuf);
+
+	test.Printf(_L("Pixel Format:%d\r\n"),config.iPixelFormat);
+	test.Printf(_L("Frame Size  :%d\r\n"),config.iFrameSize);
+	test.Printf(_L("Frame rate  :%dfps\r\n"),config.iFrameRate);
+	}
+
+TInt CCameraHandler::SetFirstConfig(TUint aOffset)
+	{
+	test.Printf(_L("SetFirstConfig\r\n"));
+	TInt ret;
+	TAny* frameSizeCapsBuf=0;
+	SDevCamPixelFormat* pixelFormat;
+	SDevCamFrameSize* frameSize;
+	TPtr8 frameSizeCapsPtr(0,0,0);
+	pixelFormat = (SDevCamPixelFormat*) (iCameraCaps + 1);
+
+	if(camera->iCameraCaps->iNumVideoPixelFormats)
+		{
+		pixelFormat = pixelFormat + iCameraCaps->iNumImagePixelFormats + iCameraCaps->iNumVideoPixelFormats;
+		frameSizeCapsBuf = User::Alloc(pixelFormat->iNumFrameSizes*sizeof(SDevCamFrameSize));
+		new (&frameSizeCapsPtr) TPtr8((TUint8*)frameSizeCapsBuf, pixelFormat->iNumFrameSizes*sizeof(SDevCamFrameSize), pixelFormat->iNumFrameSizes*sizeof(SDevCamFrameSize));
+		ret=iCamera.FrameSizeCaps(ECamCaptureModeImage, pixelFormat->iPixelFormat, frameSizeCapsPtr);
+		test(ret==KErrNone);
+		frameSize = (SDevCamFrameSize*) frameSizeCapsPtr.Ptr();
+		if((pixelFormat->iNumFrameSizes>aOffset) && aOffset)
+			frameSize += aOffset;
+		ret=camera->SetConfig(ECamCaptureModeVideo,*frameSize,*pixelFormat,ETrue,3);
+		test(ret==KErrNone);
+		User::Free(frameSizeCapsBuf);
+		return(KErrNone);
+		}
+	else
+		return(KErrNotSupported);
+	}
+
+TInt CCameraHandler::SetConfig(TDevCamCaptureMode aCaptureMode, SDevCamFrameSize aSize,SDevCamPixelFormat aPixelFormat,TBool aCreateChunk,TInt aNumBuffers)
+	{
+	test.Printf(_L("SetConfig\r\n"));
+	TInt r=iDispHandler[aCaptureMode].SetConfig(aSize,aPixelFormat);
+	if (r!=KErrNone)
+		return(r);
+
+	// Config camera
+	TCameraConfigV02Buf configBuf;
+	TCameraConfigV02 &config=configBuf();
+	iCamera.GetCamConfig(aCaptureMode, configBuf);		// Load defaults
+
+	config.iFrameSize=aSize;
+	config.iPixelFormat=aPixelFormat;
+	config.iFrameRate=KFrameRate;
+
+	TMmSharedChunkBufConfig bufferConfig;
+	TPckg<TMmSharedChunkBufConfig> bufferConfigBuf(bufferConfig);
+
+	r=iCamera.SetCamConfig(aCaptureMode,configBuf);
+	if (r!=KErrNone)
+		return(r);
+
+	if (aCreateChunk)
+		{
+		r=iCamera.SetBufConfigChunkCreate(aCaptureMode,aNumBuffers,iChunk[aCaptureMode]);
+		if (r!=KErrNone)
+			return(r);
+		}
+	else
+		{
+		// 'aNumBuffers' is ignored here, D_MMCSC.LDD currently uses 2 buffers
+
+		RMmCreateSc tstDrv;
+		r=tstDrv.Open();
+		if (r!=KErrNone)
+			return(r);
+		r=tstDrv.GetChunkHandle(iChunk[aCaptureMode]);	// Get a handle on the shared chunk created by the test driver
+		if (r!=KErrNone)
+			return(r);
+		r=tstDrv.GetBufInfo(bufferConfigBuf);
+		if (r!=KErrNone)
+			return(r);
+		r=iCamera.SetBufConfigChunkOpen(aCaptureMode,bufferConfigBuf,iChunk[aCaptureMode]);
+		if (r!=KErrNone)
+			return(r);
+
+		tstDrv.Close();
+		}
+
+	iCamera.GetBufferConfig(aCaptureMode, bufferConfigBuf);
+	PrintBufferConf(bufferConfig,test);
+
+	return(r);
+	}
+
+TInt CCameraHandler::Start(TDevCamCaptureMode aCaptureMode)
+//
+// Set object active, start getting images from the camera
+//
+	{
+	test.Printf(_L("Start\r\n"));
+	// Set object active
+	iFrameCount=0;
+	SetActive();
+	iCamera.SetCaptureMode(aCaptureMode);
+	// Add request for a new image
+	TInt r=iCamera.Start();
+	if (r==KErrNone)
+		iCamera.NotifyNewImage(iStatus);
+	return(r);
+	}
+
+void CCameraHandler::RunL()
+//
+// Handles a new request
+//
+	{
+	TInt retId=iStatus.Int();
+	TInt retOffset=-1;
+	iCamera.BufferIdToOffset(iCaptureMode,retId,retOffset);
+	if (retId>=0)
+		{
+		TUint8* imgBase=iChunk[iCaptureMode].Base()+retOffset;
+		TInt r=iDispHandler[iCaptureMode].Process(imgBase);
+		
+#ifdef __WINSCW__
+		test(r==KErrNotSupported);
+#else
+		test(r==KErrNone);
+#endif
+		
+		// Release the buffer
+		test(iCamera.ReleaseBuffer(retId)==KErrNone);
+		iFrameCount++;
+		}
+	else
+		test.Printf(_L("Capture error (%d)\r\n"),retId);
+
+	if (iFrameCount<KFrameNumberToCapture)
+		{
+		// Add request for a new image
+		iCamera.NotifyNewImage(iStatus);
+		// re-set active
+		SetActive();
+		}
+
+	else
+		{
+		CActiveScheduler::Stop();
+		}
+	}
+
+TInt CCameraHandler::Stop()
+//
+// Stops camera
+//
+	{
+	test.Printf(_L("Stop\r\n"));
+	CActive::Cancel();
+	TInt r=iCamera.Stop();
+	return(r);
+	}
+
+//
+// Test for recording a certain number of frames in a particular configuration and displaying
+// the results.
+//
+void TestRecording()
+	{
+	TInt ret;
+
+	camera->GetConfig(ECamCaptureModeVideo);
+	camera->SetCaptureMode(ECamCaptureModeVideo);
+	test.Next(_L("Starting camera"));
+	ret=camera->Start(ECamCaptureModeVideo);
+	test.Printf(_L("Start returned %d\r\n"),ret);
+	test(ret==KErrNone);
+
+	// Calculate frame rate.
+	// We store cuurent time before receiving data from the camera and
+	// after to have received KFrameNumberToCapture pictures, we calculate
+	// time elapsed during the reception.
+	TTimeIntervalMicroSeconds microseconds ;
+	TTime now;
+	TTime iTime;
+	now.HomeTime();
+
+	test.Next(_L("Starting active scheduler"));
+	// Start active scheduler
+	CActiveScheduler::Start();
+
+	// We have received all pictures, so we store the new current time
+	iTime.HomeTime();
+
+	// We keep this time in microseconds to be more precise
+	microseconds = iTime.MicroSecondsFrom(now) ;
+
+	TInt64 timeElapsed = microseconds.Int64();
+
+	// We store in this variable, integer value of the frame rate
+	TInt64 intFrameRate = (TInt64)((KFrameNumberToCapture *1000000)/timeElapsed);
+
+	// We store in this variable, decimal value of the frame rate
+	TInt64 milliFrameRate = (TInt64)((KFrameNumberToCapture *1000000)%timeElapsed);
+	milliFrameRate = (milliFrameRate*1000) / timeElapsed;
+
+	test.Printf(_L("   Frame rate for frames received : %d.%03d frames per second\r\n"), static_cast<TInt>(intFrameRate), static_cast<TInt>(milliFrameRate));
+	test.Printf(_L("   Frame rate expected            : %d.000 frames per second\r\n"),KFrameRate);
+	test.Next(_L("Stopping camera"));
+	// Stop Camera
+	ret=camera->Stop();
+	test(ret==KErrNone);
+	}
+
+//
+// Test program main part
+//
+TInt E32Main()
+	{
+	__UHEAP_MARK;
+
+	test.Title();
+	test.Start(_L("Camera module GEN test"));
+
+	test.Next(_L("Loading CAMERA PDD"));
+	TInt ret=User::LoadPhysicalDevice(KCamPddFileName);
+	test.Printf(_L("Returned %d\r\n"),ret);
+
+	if (ret==KErrNotFound)
+		{
+		test.Printf(_L("Shared chunk camera driver not supported - test skipped\r\n"));
+		test.End();
+		test.Close();
+		__UHEAP_MARKEND;
+		return(KErrNone);
+		}
+
+	test(ret==KErrNone || ret==KErrAlreadyExists);
+
+	test.Next(_L("Loading CAMERA LDD"));
+	ret=User::LoadLogicalDevice(KCamLddFileName);
+	test.Printf(_L("Returned %d\r\n"),ret);
+	test(ret==KErrNone || ret==KErrAlreadyExists);
+
+	test.Next(_L("Loading D_MMCSC LDD"));
+	ret=User::LoadLogicalDevice(KTstLddFileName);
+	test.Printf(_L("Returned %d\r\n"),ret);
+	test(ret==KErrNone||ret==KErrAlreadyExists);
+
+	__KHEAP_MARK;
+
+	// Construct and install the active scheduler
+	test.Next(_L("Initialising active scheduler"));
+	CActiveScheduler *exampleScheduler = new (ELeave) CActiveScheduler();
+	// Install as the active scheduler
+	CActiveScheduler::Install(exampleScheduler);
+
+	// Create camera handler
+	test.Next(_L("Creating camera handler"));
+	camera = CCameraHandler::NewL();
+
+	test.Next(_L("+ Getting Camera Capabilities"));
+	ret=camera->GetCaps();
+	test(ret==KErrNone);
+
+	// SetConfig
+	test.Next(_L("Setting Camera Configuration"));
+	ret=camera->SetFirstConfig(0);
+	test(ret==KErrNone);
+	TestRecording();
+
+	// Repeat with a different configuration
+	test.Next(_L("Resetting Camera Configuration"));
+	ret=camera->SetFirstConfig(1);
+	test(ret==KErrNone);
+	TestRecording();
+
+	delete camera;
+	delete exampleScheduler;
+
+	__KHEAP_MARKEND;
+
+	// Free the PDDs and LDDs
+	test.Next(_L("Freeing ECAMERASC LDD"));
+	ret=User::FreeLogicalDevice(KDevCameraScName);
+	test(ret==KErrNone);
+
+	test.Next(_L("Freeing CAMERASC PDD")) ;
+	TFindPhysicalDevice fDr;
+	TFullName drivName;
+	TName searchName;
+	searchName.Append(KDevCameraScName);
+	searchName.Append(KCamFreePddExtension);
+	fDr.Find(searchName);
+	ret=fDr.Next(drivName);
+	test(ret==KErrNone);
+	ret=User::FreePhysicalDevice(drivName);
+	test(ret==KErrNone);
+
+	test.Next(_L("Freeing D_MMCSC LDD"));
+	ret=User::FreeLogicalDevice(KDevMmCScName);
+	test(ret==KErrNone);
+
+	test.Printf(_L("Hit any key to continue\r\n"));
+	util_getch_withtimeout(5);
+
+	test.End();
+	test.Close();
+
+	__UHEAP_MARKEND;
+
+	return KErrNone;
+	}
--- a/kerneltest/e32test/nkern/t_nktrace.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/nkern/t_nktrace.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -151,7 +151,9 @@
 	TRequestStatus timerStat;
 	timer.After(timerStat,10*1000000);
 	User::WaitForRequest(timerStat,keyStat);
-	(void)test.Console()->KeyCode();
+	TInt key;
+	if(keyStat!=KRequestPending)
+		key = test.Console()->KeyCode();
 	timer.Cancel();
 	test.Console()->ReadCancel();
 	User::WaitForAnyRequest();
--- a/kerneltest/e32test/nkernsa/arm/armutils.cia	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/nkernsa/arm/armutils.cia	Wed Sep 01 12:34:56 2010 +0100
@@ -90,7 +90,7 @@
 	asm("nop ");
 	asm("nop ");
 	asm("nop ");
-	asm("ldr	r0, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,iSSX.iLocalTimerAddr));
+	asm("ldr	r0, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,i_LocalTimerAddr));
 	asm("nop ");
 	asm("nop ");
 	asm("nop ");
@@ -103,7 +103,7 @@
 	asm("nop ");
 	asm("nop ");
 	asm("nop ");
-	asm("ldr	r1, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,iSSX.iLocalTimerAddr));
+	asm("ldr	r1, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,i_LocalTimerAddr));
 	asm("nop ");
 	asm("nop ");
 	asm("nop ");
@@ -118,7 +118,7 @@
 	asm("nop ");
 	asm("nop ");
 	asm("nop ");
-	asm("ldr	r1, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,iSSX.iLocalTimerAddr));
+	asm("ldr	r1, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,i_LocalTimerAddr));
 	asm("nop ");
 	asm("nop ");
 	asm("nop ");
@@ -133,7 +133,7 @@
 	asm("nop ");
 	asm("nop ");
 	asm("nop ");
-	asm("ldr	r1, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,iSSX.iLocalTimerAddr));
+	asm("ldr	r1, [r0, #%a0]" : : "i" _FOFF(TSubScheduler,i_LocalTimerAddr));
 	asm("nop ");
 	asm("nop ");
 	asm("nop ");
--- a/kerneltest/e32test/nkernsa/fastmutex.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/nkernsa/fastmutex.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1036,7 +1036,6 @@
 	NThreadGroup group;
 	SNThreadGroupCreateInfo ginfo;
 	ginfo.iCpuAffinity = aRWCpu;
-	ginfo.iDestructionDfc = 0;	//FIXME
 	TInt r = NKern::GroupCreate(&group, ginfo);
 	TEST_RESULT(r==KErrNone, "");
 	winfo->iGroup = &group;
--- a/kerneltest/e32test/nkernsa/kprintf.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/nkernsa/kprintf.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -302,7 +302,7 @@
 #define NEXT_FMT(c,p) if (((c)=*(p)++)==0) return outLen;
 
 	TInt outLen = 0;
-	while(outLen>=0)
+	FOREVER
 		{
 		char c;
 		NEXT_FMT(c,aFmt);
--- a/kerneltest/e32test/nkernsa/testdfc.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/nkernsa/testdfc.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1199,7 +1199,7 @@
 	TInt ncpus = NKern::NumberOfCpus();
 	TInt ocpu = NKern::CurrentCpu();
 	NThread* pC = NKern::CurrentThread();
-	volatile TUint32* pX = (volatile TUint32*)&pC->iRunCount.i32[1];	// HACK!
+	volatile TUint32* pX = (volatile TUint32*)&pC->iRunCount32[1];	// HACK!
 	TInt cpu = ocpu;
 	TInt i;
 	if ((iS->iMode & TDfcStress::EMode_SelfMigrate) && !pC->iEvents.IsEmpty())
@@ -1429,19 +1429,19 @@
 	{
 //	volatile TUint32* xc = 0;
 	NThreadBase* t = iS->iDfcQ[0]->iThread;
-	volatile TUint32* xc = &t->iRunCount.i32[1];	// HACK!
+	volatile TUint32* xc = &t->iRunCount32[1];	// HACK!
 	if (!(iFlags & EFlag_Timer))
 		{
 		TDfc* d = 0;
 		if (!(iFlags & EFlag_IDFC))
 			{
 			d = new TDfc(&TDfcX::DfcFn, this, iDfcQ, 1);
-			xc = (volatile TUint32*)&iDfcQ->iThread->iRunCount.i32[1];
+			xc = (volatile TUint32*)&iDfcQ->iThread->iRunCount32[1];
 			}
 		else if (iFlags & EFlag_Tied)
 			{
 			d = new TDfc(iXTied, &TDfcX::IDfcFn, this);
-			xc = (volatile TUint32*)&iXTied->iRunCount.i32[1];
+			xc = (volatile TUint32*)&iXTied->iRunCount32[1];
 			}
 		else
 			d = new TDfc(&TDfcX::IDfcFn, this);
@@ -1454,12 +1454,12 @@
 		if (iFlags & EFlag_DFC)
 			{
 			tmr = new NTimer(&TDfcX::TimerDfcFn, this, iDfcQ, 1);
-			xc = (volatile TUint32*)&iDfcQ->iThread->iRunCount.i32[1];
+			xc = (volatile TUint32*)&iDfcQ->iThread->iRunCount32[1];
 			}
 		else if (iFlags & EFlag_Tied)
 			{
 			tmr = new NTimer(iXTied, &TDfcX::TimerIsrFn, this);
-			xc = (volatile TUint32*)&iXTied->iRunCount.i32[1];
+			xc = (volatile TUint32*)&iXTied->iRunCount32[1];
 			}
 		else
 			tmr = new NTimer(&TDfcX::TimerIsrFn, this);
--- a/kerneltest/e32test/nkernsa/threadbasic.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/nkernsa/threadbasic.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -413,7 +413,7 @@
 				}
 			}
 		}
-	TEST_RESULT(RANGE_LQ(pointA, delta), "pointA");
+	TEST_RESULT(RANGE_CHECK(0, pointA, delta), "pointA");
 	if (aCpu != this_cpu)
 		{
 		TEST_RESULT(RANGE_CHECK(TUint32(aSpin1), pointB, TUint32(aSpin1)+delta), "pointB");
@@ -1246,7 +1246,6 @@
 	NThreadGroup* group = aJoin ? &TG1 : 0;
 	SNThreadGroupCreateInfo ginfo;
 	ginfo.iCpuAffinity = 0xffffffff;
-	ginfo.iDestructionDfc = 0;	//FIXME
 	TInt r = KErrNone;
 	if (group)
 		r = NKern::GroupCreate(group, ginfo);
--- a/kerneltest/e32test/nkernsa/tlsf.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/nkernsa/tlsf.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -357,6 +357,7 @@
 	TUint32 a;
 	TUint32 szs = 0;
 	TUint32 size;
+	TUint32 total_user_size;
 	TUint32 total_block_size = 0;
 	TUint32 block_count = 0;
 	TUint32 flb = 0;
@@ -366,35 +367,34 @@
 	TUint32 total_free = 0;
 	SBlock* b = iff;
 	SBlock* pb = 0;
-	TUint32 total_user_size;
 
 	memset(slb, 0, sizeof(slb));
-	__NK_ASSERT_ALWAYS(imin_size == 16);
-	__NK_ASSERT_ALWAYS(insl == 16);
-	__NK_ASSERT_ALWAYS(il2min == 4);
-	__NK_ASSERT_ALWAYS(il2nsl == 4);
-	__NK_ASSERT_ALWAYS(infl == __e32_find_ms1_32(itotal_size) - il2min + 1);
+	__NK_ASSERT_DEBUG(imin_size == 16);
+	__NK_ASSERT_DEBUG(insl == 16);
+	__NK_ASSERT_DEBUG(il2min == 4);
+	__NK_ASSERT_DEBUG(il2nsl == 4);
+	__NK_ASSERT_DEBUG(infl == __e32_find_ms1_32(itotal_size) - il2min + 1);
 	a = (TUint32)&islb[infl];
 	a = (a+63)&~63;
-	__NK_ASSERT_ALWAYS(isll == (SFreeBlock**)a);
+	__NK_ASSERT_DEBUG(isll == (SFreeBlock**)a);
 	a += insl * infl * sizeof(TUint32*);
-	__NK_ASSERT_ALWAYS(iff == (SBlock*)a);
+	__NK_ASSERT_DEBUG(iff == (SBlock*)a);
 	total_user_size = itotal_size - (a - (TUint32)this);
 
 	do	{
 		szs = b->size;
 		size = szs & BLOCK_SIZE_MASK;
-		__NK_ASSERT_ALWAYS(b->predecessor == pb);
-		__NK_ASSERT_ALWAYS(size > 0);
-		__NK_ASSERT_ALWAYS(size <= total_user_size);
-		__NK_ASSERT_ALWAYS(size == ((size >> il2min) << il2min));
+		__NK_ASSERT_DEBUG(b->predecessor == pb);
+		__NK_ASSERT_DEBUG(size > 0);
+		__NK_ASSERT_DEBUG(size <= total_user_size);
+		__NK_ASSERT_DEBUG(size == ((size >> il2min) << il2min));
 		total_block_size += size;
 		++block_count;
 		pb = b;
 		b = (SBlock*)((TUint32)b + size);
 		} while(!(szs & BLOCK_STATUS_FINAL));
-	__NK_ASSERT_ALWAYS((TUint32)b == (TUint32)this + itotal_size);
-	__NK_ASSERT_ALWAYS(total_block_size == total_user_size);
+	__NK_ASSERT_DEBUG((TUint32)b == (TUint32)this + itotal_size);
+	__NK_ASSERT_DEBUG(total_block_size == total_user_size);
 
 	b = iff;
 	do	{
@@ -403,9 +403,9 @@
 		if (szs & BLOCK_STATUS_FREE)
 			{
 			SFreeBlock* fb = (SFreeBlock*)b;
-			TUint32 lhi;
+			SFreeBlock* pfb = fb;
 			SFreeBlock* lh;
-			SFreeBlock* pfb = fb;
+			TUint32 lhi;
 			TInt lh_found = 0;
 			TInt c = (TInt)block_count;
 			TUint32 fli = __e32_find_ms1_32(size) - il2min;
@@ -415,8 +415,8 @@
 			(void)sli2, (void)fli2;
 			if (fli > il2nsl)
 				sli >>= (fli - il2nsl);
-			__NK_ASSERT_ALWAYS(fli == fli2);
-			__NK_ASSERT_ALWAYS(sli == sli2);
+			__NK_ASSERT_DEBUG(fli == fli2);
+			__NK_ASSERT_DEBUG(sli == sli2);
 			flb |= (1u << fli);
 			slb[fli] |= (1u << sli);
 			lhi = (fli << il2nsl) | sli;
@@ -426,27 +426,28 @@
 					lh_found = 1;
 				pfb = fb;
 				fb = fb->next;
-				__NK_ASSERT_ALWAYS(fb->prev == pfb);
-				__NK_ASSERT_ALWAYS(fb->b.size & BLOCK_STATUS_FREE);
+				__NK_ASSERT_DEBUG(fb->prev == pfb);
+				__NK_ASSERT_DEBUG(fb->b.size & BLOCK_STATUS_FREE);
 				} while ((fb != (SFreeBlock*)b) && --c>=0);
-			__NK_ASSERT_ALWAYS(fb == (SFreeBlock*)b);
-			__NK_ASSERT_ALWAYS(lh_found);
+			__NK_ASSERT_DEBUG(fb == (SFreeBlock*)b);
+			__NK_ASSERT_DEBUG(lh_found);
 			total_free += size;
 			}
 		b = (SBlock*)((TUint32)b + size);
 		} while(!(szs & BLOCK_STATUS_FINAL));
 
-	__NK_ASSERT_ALWAYS(flb == iflb);
+	__NK_ASSERT_DEBUG(flb == iflb);
 	for (fli=0; fli<infl; ++fli)
 		{
-		__NK_ASSERT_ALWAYS(slb[fli] == islb[fli]);
+		__NK_ASSERT_DEBUG(slb[fli] == islb[fli]);
 		if (!(flb & (1u<<fli)))
-			__NK_ASSERT_ALWAYS(slb[fli]==0);
+			__NK_ASSERT_DEBUG(slb[fli]==0);
 		for (sli=0; sli<insl; ++sli)
 			{
 			TUint32 lhi = (fli << il2nsl) | sli;
+			(void)lhi;
 			if (!(slb[fli] & (1u<<sli)))
-				__NK_ASSERT_ALWAYS(!isll[lhi]);
+				__NK_ASSERT_DEBUG(!isll[lhi]);
 			}
 		}
 	return total_free;
--- a/kerneltest/e32test/nkernsa/utils.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/nkernsa/utils.h	Wed Sep 01 12:34:56 2010 +0100
@@ -100,7 +100,6 @@
 #define TEST_OOM(p)	TEST_RESULT(p, "Out of memory");
 
 #define RANGE_CHECK(l,x,h)	((l)<=(x) && (x)<=(h))
-#define RANGE_LQ(x,h)	((x)<=(h))
 
 #ifdef __SMP__
 #define	for_each_cpu(cpu)	\
--- a/kerneltest/e32test/notifier/t_textnotifier.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/notifier/t_textnotifier.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -83,16 +83,7 @@
 	User::WaitForRequest(stat);
 	n.CancelNotifier(aUid);
 	test(stat==heapCellCount);
-	
-	TInt size1, size2;
-	TLex8 lex(heapInfo1);
-	r = lex.Val(size1);
-	test(r==KErrNone);
-	lex.Assign(heapInfo2);
-	r = lex.Val(size2);
-	test(r==KErrNone);
-	//allocated size after should not be greater than before BUT may be less with new allocator
-	test(size2 <= size1); 
+	test(heapInfo1==heapInfo2);
 
 	test.Next(_L("Close connection to notifier server"));
 	n.Close();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/pccd/sdapctest.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,81 @@
+// 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 <drivers/d_sdapc.h>
+
+#define __E32TEST_EXTENSION__
+
+#include <e32std.h>
+#include <e32test.h>
+#include <hal.h>
+
+LOCAL_D RTest test(_L("SDAPCTEST"));
+
+
+// This test is intended to simply load and free the associated LDD,
+// since the required funcionality is contained in the channel creation method (client registration, PSU locking)
+// and destructor (deregistration and unlocking).
+// 
+// The waits are intended to allow a generous sample time for logging of KTRACE from the PSU code
+// with the driver loaded/unloaded, to verify that it is behaving as expected.
+
+GLDEF_C TInt E32Main()
+	{
+#if !defined(__WINS__)
+	test.Title();
+		
+    RSDAuxiliaryPowerControlAPI TheDriver;
+
+	test.Start(_L("SDAPCTEST - Main Test"));
+
+	// Only test on platforms with SDIO support in all ROM configurations
+	TInt machineuid;
+    HAL::Get(HAL::EMachineUid, machineuid);
+    if(machineuid != HAL::EMachineUid_OmapH2)
+	    {
+        test.Printf(_L("Test not supported on this platform\n"));
+        }
+	else
+		{
+		TInt err = KErrGeneral;
+
+	    err = User::LoadLogicalDevice(_L("D_SDAPC"));
+		test.Printf(_L("Value of err is %d\n"), err);
+		test_Value(err, err==KErrNone || err==KErrAlreadyExists);
+    	        
+		err = TheDriver.Open(0,TheDriver.VersionRequired());
+		test_KErrNone(err);
+
+		test.Printf(_L("Wait for 10 seconds with SD auxiliary power-control driver loaded...\n"));
+		User::After(10000000);
+    	        
+		TheDriver.Close();
+        		    
+		err = User::FreeLogicalDevice(_L("D_SDAPC"));
+		test.Printf(_L("Value of err is %d\n"), err);
+
+		test.Printf(_L("Wait for 10 seconds without SD auxiliary power-control driver loaded...\n"));
+
+		User::After(10000000);
+		}
+		
+	test.End();
+#else
+	test.Printf(_L("This test does not run on emulator.\n"));
+#endif
+	return(KErrNone);
+	}
+
+
--- a/kerneltest/e32test/pccd/t_atadrv.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/pccd/t_atadrv.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -37,12 +37,7 @@
 const TInt KLongFormatInBytes=(KLongFormatInSectors<<KAtaSectorShift);
 
 const TInt KHeapSize=0x4000;
-
-#undef USE_IDLE_CURRENT
-#ifdef USE_IDLE_CURRENT
 const TInt KAtaIdleCurrentInMilliAmps=1; 
-#endif
-
 
 #define PDD_NAME _L("MEDATA")
 
@@ -268,13 +263,10 @@
 	test(info.iDriveAtt==(TUint)(KDriveAttLocal|KDriveAttRemovable));
 	test(info.iMediaAtt==KMediaAttFormattable);
 	test(info.iFileSystemId==KDriveFileSysFAT);
-#undef USE_IDLE_CURRENT
-#ifdef USE_IDLE_CURRENT
-	TSupplyInfoV1Buf supply2;
-	test(UserHal::SupplyInfo(supply2)==KErrNone);
-	if (mediaChangeSupported)
-		test(supply2().iCurrentConsumptionMilliAmps==supply1().iCurrentConsumptionMilliAmps+KAtaIdleCurrentInMilliAmps); // Snowball idle current is zero
-#endif
+//	TSupplyInfoV1Buf supply2;
+//	test(UserHal::SupplyInfo(supply2)==KErrNone);
+//	if (mediaChangeSupported)
+//		test(supply2().iCurrentConsumptionMilliAmps==supply1().iCurrentConsumptionMilliAmps+KAtaIdleCurrentInMilliAmps); // Snowball idle current is zero
 
 	b.Format(_L("ATA drive: Sector RdWr(%d)"),KAtaSectorSize);
 	test.Next(b);
@@ -458,11 +450,8 @@
 	test.Next(_L("ATA drive: Caps following media change"));
 	test(theAtaDrive.Caps(infoPckg)==KErrNone);
 	test(info.iType==EMediaHardDisk);
-#undef USE_IDLE_CURRENT
-#ifdef USE_IDLE_CURRENT
-	test(UserHal::SupplyInfo(supply2)==KErrNone);
-	test(supply2().iCurrentConsumptionMilliAmps==supply1().iCurrentConsumptionMilliAmps+KAtaIdleCurrentInMilliAmps);
-#endif
+//	test(UserHal::SupplyInfo(supply2)==KErrNone);
+//	test(supply2().iCurrentConsumptionMilliAmps==supply1().iCurrentConsumptionMilliAmps+KAtaIdleCurrentInMilliAmps);
 
 	test.Next(_L("ATA drive: Caps while OOM"));
 	TInt err=KErrNoMemory;
--- a/kerneltest/e32test/pccd/t_idrv.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/pccd/t_idrv.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -44,9 +44,7 @@
 
 const TInt KTestDriveLen=0x00040000;	//256K
 const TInt KSmallDriveInc=0x00000400;	//1K
-#if defined (__WINS__)
 const TInt KBigDriveLen=0x00100000;		//1M - WINS
-#endif
 const TInt KTestBufLen=256;
 
 
@@ -104,23 +102,28 @@
 
 	test.Next(_L("Find internal drive"));
 	
-	TInt drive;
-	for (drive = 0; drive < KMaxLocalDrives; drive++)
+	TDriveInfoV1Buf driveInfoBuf;
+	UserHal::DriveInfo(driveInfoBuf);
+	TDriveInfoV1& driveInfo = driveInfoBuf();
+
+	TInt drive = 0;
+	for ( ; drive < driveInfo.iTotalSupportedDrives; ++drive)
 		{
 		TBool changedFlag;
-		if (theInternalDrive.Connect(drive, changedFlag) != KErrNone)
-			continue;
+		theInternalDrive.Connect(drive, changedFlag);
 
 		TLocalDriveCapsV2 info;
 		TPckg<TLocalDriveCapsV2> infoPckg(info);
 		theInternalDrive.Caps(infoPckg);
 
 		if (info.iType == EMediaRam)
-			break;						// found it
+			{
+			break;
+			}
 
 		theInternalDrive.Disconnect();
 		}
-	test(drive < KMaxLocalDrives);		// iterated over all, found none
+	test(drive < driveInfo.iTotalSupportedDrives);
 
 	test.Next(_L("Capabilities"));
 	TLocalDriveCapsV2 info;
--- a/kerneltest/e32test/pccd/t_medch.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/pccd/t_medch.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -50,9 +50,6 @@
 
 const TInt KPowerUpTimeOut = 5000000; // Give the card 5 seconds to power up
 
-const TUint KDriveAttMask = KDriveAttLocal | KDriveAttRom | KDriveAttRemote;
-const TUint KMediaAttMask = KMediaAttVariableSize | KMediaAttDualDensity | KMediaAttLockable | KMediaAttLocked | KMediaAttHasPassword  | KMediaAttReadWhileWrite;
-
 LOCAL_D	RTest test(_L("Media change test"));
 
 LOCAL_D	TBusLocalDrive TheDrive;
@@ -60,129 +57,6 @@
 LOCAL_D TRequestStatus TheMediaStatus;
 LOCAL_D TBool TheChangedFlag;
 
-LOCAL_C TInt FindDataPagingDrive()
-/** 
-Find the drive containing the swap partition.
-
-@return		Local drive identifier or KErrNotFound if not found
-*/
-	{
-	TInt drive = KErrNotFound;
-	
-	RLocalDrive	d;
-	TBool change = EFalse;
-	TLocalDriveCapsV5 driveCaps;
-	TPckg<TLocalDriveCapsV5> capsPack(driveCaps);
-	
-	for(TInt i = 0; i < KMaxLocalDrives && drive < 0; ++i)
-		{
-		if(d.Connect(i, change) == KErrNone)
-			{
-			if(d.Caps(capsPack) == KErrNone)
-				{
-				if ((driveCaps.iMediaAtt & KMediaAttPageable) &&
-					(driveCaps.iPartitionType == KPartitionTypePagedData))
-					{
-					drive = i;
-					}
-				}
-			d.Close();
-			}
-		}
-		
-	if(drive == KErrNotFound)
-		{
-		test.Printf(_L("No data paging drive found\n"));
-		}
-		
-	return drive;
-	}
-	
-LOCAL_C TInt DataPagingMediaCaps(TLocalDriveCapsV5 &aCaps)
-/** 
-Return the caps of the media containing a swap partition.
-
-@return		Error code, on success aCaps contains the capabilities of the paging drive
-*/
-	{
-	TInt dataPagingDrive = FindDataPagingDrive();
-	
-	if (dataPagingDrive == KErrNotFound)
-		{
-		return KErrNotFound;
-		}
-
-	RLocalDrive	dpDrive;
-	TBool change = EFalse;
-
-	TInt r = dpDrive.Connect(dataPagingDrive, change);
-	test(r == KErrNone);
-	
-	TLocalDriveCapsV5 dpDriveCaps;
-	TPckg<TLocalDriveCapsV5> capsPack(dpDriveCaps);
-	r = dpDrive.Caps(capsPack);
-	test(r == KErrNone);
-	
-	if((dpDriveCaps.iDriveAtt & KDriveAttHidden) == 0)
-		{
-		test.Printf(_L("Paging partition is not hidden! Assuming it is correct anyway!\n"));
-		}
-	
-	aCaps = dpDriveCaps;
-	
-	return KErrNone;
-	}
-	
-LOCAL_C TBool IsDriveOnPagingMedia(TInt aDrive, TLocalDriveCapsV5 &aPagingMediaCaps)
-/** 
-Determines whether a drive is on the same media as the paging media by comparing 
-media characteristics
-
-@return		ETrue if (likely) to be on the same media, EFalse if not.
-*/	{
-	RLocalDrive	drive;
-	TBool change = EFalse;
-
-	TInt r = drive.Connect(aDrive, change);
-	test(r == KErrNone);
-	
-	TLocalDriveCapsV5 driveCaps;
-	TPckg<TLocalDriveCapsV5> capsPack(driveCaps);
-	r = drive.Caps(capsPack);
-	test(r == KErrNone);
-	
-	// Check media serial number
-	if(aPagingMediaCaps.iSerialNumLength > 0)
-		{
-		if((driveCaps.iSerialNumLength > 0) && 
-		   ((memcompare(driveCaps.iSerialNum, driveCaps.iSerialNumLength, 
-			aPagingMediaCaps.iSerialNum, aPagingMediaCaps.iSerialNumLength)) == 0))
-			{
-			// serial numbers equal, so drive in question is on same media as paging drive
-			test.Printf(_L("Based on serial number match, drive %d shares the same media as paging drive\n"), aDrive);
-			return ETrue;
-			}
-		}
-	else
-		{
-		// Turn off bits which may be different
-		aPagingMediaCaps.iDriveAtt &= KDriveAttMask;
-		aPagingMediaCaps.iMediaAtt &= KMediaAttMask;
-		driveCaps.iDriveAtt &= KDriveAttMask;
-		driveCaps.iMediaAtt &= KMediaAttMask;
-
-		if ((driveCaps.iType == aPagingMediaCaps.iType) &&
-			(driveCaps.iDriveAtt == aPagingMediaCaps.iDriveAtt) && 
-			(driveCaps.iMediaAtt == aPagingMediaCaps.iMediaAtt))
-			{
-			test.Printf(_L("Based on media characteristics match, drive %d shares the same media as paging drive\n"), aDrive);
-			return ETrue;
-			}
-		}
-		
-	return EFalse;
-	}
-
 
 LOCAL_C TBool SetupDrivesForPlatform(TInt& aDrive, TInt& aSocket)
 /**
@@ -201,30 +75,11 @@
 	aDrive  = -1;
 	aSocket = -1;
 	
-	TLocalDriveCapsV5 pagingMediaCaps;
-	TBool pagingMediaCheck = EFalse;
-	if(DataPagingMediaCaps(pagingMediaCaps) == KErrNone)
-		{
-		pagingMediaCheck = ETrue;
-		}
-	
 	for(aDrive=0; aDrive < di.iTotalSupportedDrives; aDrive++)
 		{
 		test.Printf(_L(" Drive %d - %S\r\n"), aDrive, &di.iDriveName[aDrive]);
 		if(di.iDriveName[aDrive].MatchF(_L("MultiMediaCard0")) == KErrNone)
-			{
-			if(pagingMediaCheck)
-				{
-				if( ! IsDriveOnPagingMedia(aDrive, pagingMediaCaps))
-					{
-					break;
-					}
-				}
-			else
-				{
-				break;
-				}
-			}
+			break;
 		}
 
 	if(aDrive == di.iTotalSupportedDrives)
@@ -317,14 +172,14 @@
  */
 	{
 	test.Console()->SetPos(20, 25);
-	test.Printf(_L("%S [%d cycles]\n"), &aTitle, aCycles);
+	test.Printf(_L("%S [%d cycles]"), &aTitle, aCycles);
 #ifdef __MANUAL_TEST__
 	test.Console()->SetPos(20, 27);
-	test.Printf(_L("<press a key>\n"));
+	test.Printf(_L("<press a key>"));
 	test.Getch();
 #endif
 	}
-
+		
 GLDEF_C TInt E32Main()
 /**
  * Test Entry Point for T_MEDCH.
@@ -358,7 +213,6 @@
 	 */
 	TInt drive;
 	TInt socket;
-
 	if(SetupDrivesForPlatform(drive, socket))
 		{
 		b.Format(_L("Connect to local drive %d"), drive);
--- a/kerneltest/e32test/pccd/t_pccdsr.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/pccd/t_pccdsr.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -32,6 +32,7 @@
 const TInt KAtaSectorSize=512;
 const TInt KMaxSectors=8;
 const TInt KMaxRdWrBufLen=(KAtaSectorSize*KMaxSectors); // 4K
+const TInt KHeapSize=0x4000;
 const TInt KMaxErr=8;
 
 #if defined (USE_F32_ACCESS)
--- a/kerneltest/e32test/pccd/t_setkey.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/pccd/t_setkey.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -66,12 +66,8 @@
 GLDEF_C TInt E32Main()									// main function called by E32
     {
 	CTrapCleanup* cleanup=CTrapCleanup::New();			// get clean-up stack
-#if defined(_DEBUG) 
 	TRAPD(error,SetupConsoleL());						// more initialization, then do example
 	__ASSERT_DEBUG(!error,User::Panic(_L("BossTextUi"),error));
-#else
-	TRAP_IGNORE(SetupConsoleL());
-#endif
 	delete cleanup;										// destroy clean-up stack
 	return 0;											// and return
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/pci/t_pci.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,865 @@
+// 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:
+// This is a test for the PCI driver, so far implemented only on the
+// Naviengine platform. It aims to test:
+//	-That known values of data in config and memory space, on a given
+//	device can be read as expected.
+//	-That data can be written and modified in config and memory space
+//	-PCI memory buffers mapped or allocated by the PCI driver work as
+//	expected. These are
+//		-DChunk created by PCI driver and accessible from PCI
+//		-DPlatHwChunk created by PCI driver and accessible from PCI
+//		-DChunk created externally, then mapped in to PCI memory space
+//	There are tests to:
+//		- Create and close each buffer. Heap checking ensures proper
+//		cleanup
+//		- Create and close multiple buffers from multiple threads.
+//		This is an SMP focused test to check that the implementation
+//		of the chunk manager and allocator in the driver are thread
+//		safe. The tests should pass without triggering any assertions in
+//		the driver's invariance checks.
+//		- Write to buffers from software, and read back via the
+//		system to PCI window, and vice-versa -- a loop-back test.
+//		This checks that PCI buffers are indeed accessible to PCI devices.
+//
+// The tests require several pieces of PSL specific information:
+//	- A TPciDevice containing the vendor and device IDs of a PCI device
+//	to use for testing.
+//	- TAddrSpaceTests which identify regions of a device's config and
+//	memory space with known values, or which are known to be writable.
+//
+//	The test driver grants access to the PCI API with the following
+//	constructs: 
+//	- TUserConfigSpace and TUserMemorySpace, derived from TUserPciSpace,
+//	which are user side equivalents of kernel-side objects allowing
+//	accesses of different sizes to a PCI device's config space or
+//	memory space.
+//	- RPciChunk which is derived from and RChunk and corresponds to
+//	a kernel-side DChunk, which in turn corresponds to a PCI chunk or
+//	buffer. The test driver uses these for all PCI chunk types (a
+//	"wrapper" DChunk is used to map the memory of a PCI DPlatHwChunk
+//	to user side).
+//
+//	Known Issues:
+//	The test driver d_pci is intended to be platform independent but
+//	for now still contains some PSL specific information .eg the test
+//	info structure (which should really be passed up from the PSL) and
+//	the address and size of the system to pci window. For now the
+//	test driver code will remain in the Naviengine baseport directory.
+//	If the PCI driver is ever ported to a new platform this can be
+//	rectified.
+//	
+//
+//
+#include "../misc/test_thread.h"
+#include <e32std.h>
+#define __E32TEST_EXTENSION__
+#include <e32test.h>
+#include "t_pci.h"
+#include <assp/naviengine/pci.h>
+
+class RPci;
+/**
+Extends RChunk to hold the PCI address
+associated with a chunk.
+*/
+class RPciChunk: public RChunk
+	{
+public:
+	TUint PciBase()
+		{
+		return iPciBaseAddr;
+		}
+
+	/**
+	Return the PCI accessible size
+	*/
+	TInt Size() const
+		{
+		return iPciSize;
+		}
+
+private:
+	friend class RPci;
+	TUint iPciBaseAddr;
+	TInt iPciSize; //size of the region mapped into PCI
+	};
+
+typedef TInt (RPci::*ChunkOpenFn)(RPciChunk&, TInt, TRequestStatus*);
+
+class RPci : public RBusLogicalChannel
+	{
+public:
+	TInt Open();
+	TInt GetTestInfo(TPciTestInfo& aTestInfo);
+
+	TInt Open(const TPciDevice&);
+
+	TUint AccessConfigSpace(const TUserConfigSpace& aCs);
+	TUint AccessMemorySpace(const TUserMemorySpace& aMs);
+	TInt  OpenPciDChunk(RPciChunk& aPciChunk,TInt aPciChunkSize, TRequestStatus* aStatus=0);
+	TInt  OpenPciPlatHwChunk(RPciChunk& aPciHwChunk,TInt aPciChunkSize, TRequestStatus* aStatus=0);
+	TInt  OpenPciMappedChunk(RPciChunk& aPciMappedChunk,TInt aPciChunkSize, TRequestStatus* aStatus=0);	
+	TInt  OpenPciWindowChunk(RChunk& aPciWindowChunk);
+	TInt  RunUnitTests();
+private:	
+	TInt DoOpenPciChunk(RPciChunk& aPciChunk, TInt aPciChunkSize, TPciTestCmd aCmd, TRequestStatus* aStatus);
+	};
+
+inline TInt RPci::Open()
+	{
+	return DoCreate(KPciLddFactory, TVersion(), KNullUnit, NULL, NULL);
+	}
+
+inline TInt RPci::Open(const TPciDevice& aDevice) 
+	{
+	TPckgC<TPciDevice> devicePkg(aDevice);
+	return DoCreate(KPciLddFactory, TVersion(), KNullUnit, NULL, &devicePkg);
+	}
+
+inline TInt RPci::GetTestInfo(TPciTestInfo& aTestInfo)
+	{
+	TPckg<TPciTestInfo> info(aTestInfo);
+	return DoControl(EGetTestInfo, &info);
+	}
+
+inline TInt RPci::RunUnitTests()
+	{
+	return DoControl(ERunUnitTests);
+	}
+
+TUint RPci::AccessConfigSpace(const TUserConfigSpace& aCs)
+	{
+	TPckgC<TUserConfigSpace> pkg(aCs);
+	return DoControl(EAccessConfigSpace, &pkg);
+	}
+
+TUint RPci::AccessMemorySpace(const TUserMemorySpace& aMs)
+	{
+	TPckgC<TUserMemorySpace> pkg(aMs);
+	return DoControl(EAccessMemorySpace, &pkg);
+	}
+
+TInt RPci::OpenPciDChunk(RPciChunk& aPciChunk,TInt aPciChunkSize, TRequestStatus* aStatus)	
+	{	
+	return DoOpenPciChunk(aPciChunk, aPciChunkSize, EOpenPciDChunk, aStatus);
+	}
+
+TInt RPci::OpenPciPlatHwChunk(RPciChunk& aPciHwChunk,TInt aPciChunkSize, TRequestStatus* aStatus)	
+	{
+	return DoOpenPciChunk(aPciHwChunk, aPciChunkSize, EOpenPciPlatHwChunk, aStatus);
+	}
+
+TInt RPci::OpenPciMappedChunk(RPciChunk& aPciMappedChunk,TInt aPciChunkSize, TRequestStatus* aStatus)	
+	{
+	return DoOpenPciChunk(aPciMappedChunk, aPciChunkSize, EOpenPciMappedChunk, aStatus);
+	}
+
+TInt RPci::OpenPciWindowChunk(RChunk& aPciWindowChunk)
+	{	
+	TUint chunkHandle = DoControl(EOpenPciWindowChunk);			
+	return aPciWindowChunk.SetReturnedHandle(chunkHandle);
+	}
+
+TInt RPci::DoOpenPciChunk(RPciChunk& aPciChunk, TInt aPciChunkSize, TPciTestCmd aCmd, TRequestStatus* aStatus)
+	{
+	const TInt constPciChunkSize = aPciChunkSize;
+	TPciChunkCreateInfo info(constPciChunkSize, aPciChunk.iPciBaseAddr, aStatus);
+	TPckgC<TPciChunkCreateInfo> pkg(info);
+
+	TUint chunkHandle = DoControl(aCmd, &pkg);	
+	
+	const TInt r = aPciChunk.SetReturnedHandle(chunkHandle);
+	if(r == KErrNone)
+		{		
+		aPciChunk.iPciSize = constPciChunkSize;					
+		}
+	return r;
+	}
+
+TUserPciSpace::TUserPciSpace(RPci& aPci)
+	:iPci(&aPci)
+	{}
+
+TUserConfigSpace::TUserConfigSpace(RPci& aPci)
+	:TUserPciSpace(aPci)
+	{}
+
+TUint TUserConfigSpace::Call()
+	{
+	return iPci->AccessConfigSpace(*this);
+	}
+
+TUserPciSpace* TUserConfigSpace::Clone() const
+	{
+	return new TUserConfigSpace(*this);
+	}
+
+TUserMemorySpace::TUserMemorySpace(RPci& aPci, TInt aBarIndex)
+	:TUserPciSpace(aPci), iBarIndex(aBarIndex)
+	{}
+
+TUint TUserMemorySpace::Call()
+	{
+	return iPci->AccessMemorySpace(*this);
+	}
+
+TUserPciSpace* TUserMemorySpace::Clone() const
+	{
+	return new TUserMemorySpace(*this);
+	}
+
+/**
+Test address allocator
+*/
+TInt TestRunPciUnitTest(RPci& pci)
+	{		
+	return pci.RunUnitTests();
+	}
+
+
+/**
+Read from a defined address in memory or config space, compare against expected values.
+8,16, and 32 bit accesses performed.
+
+@param aSpace Object gving access to either the config or memory space of a PCI device
+@param aInfo Contains the address and expected value of a dword
+*/
+void TestReadAddressSpace(TUserPciSpace& aSpace, const TPciTestInfo::TAddrSpaceTest& aInfo, RTest& test, TBool aVerbose=EFalse)
+	{
+	const TUint os = aInfo.iOffset;
+	//Iterate over different widths, and possible
+	//subfields of 32 bit word
+	for(TInt bitWidth=32; bitWidth>=8; bitWidth>>=1)
+		{
+		const TInt numberOfFields = (32/bitWidth);
+		for(TInt i=0; i< numberOfFields; i++)
+			{
+			const TInt extraByteOffset = i * (bitWidth >> 3);
+			const TInt byteOffset = os + extraByteOffset;
+			if(aVerbose)
+				test.Printf(_L("Access bitWidth=%d byte offset=%d\n"), bitWidth, byteOffset);
+
+			const TUint expected = aInfo.Expected(bitWidth, byteOffset);
+			const TUint read = aSpace.Read(bitWidth, byteOffset);
+			if(aVerbose)
+				test.Printf(_L("expect 0x%08x, read 0x%08x\n"), expected, read);
+			test_Equal(expected, read);
+			}
+		}
+	}
+
+/**
+Verify writes and modifications to a defined address in memory or config space. 8,16, and 32 bit
+accesses performed.
+
+@param aSpace Object gving access to either the config or memory space of a PCI device
+@param aInfo Contains the address of a (at least partially) writable dword
+*/
+void TestWriteAddressSpace(TUserPciSpace& aSpace, TPciTestInfo::TAddrSpaceTest& aInfo, RTest& test, TBool aVerbose=EFalse)
+	{
+	const TUint original = aSpace.Read(32, aInfo.iOffset);
+	const TUint os = aInfo.iOffset;
+	TUint mask = ~aInfo.iReadOnlyMask;
+
+	//The pattern will be truncated when used with bit widths
+	//less than 32.
+	const TUint initPattern = 0xFFFFFFFF;
+
+	for(TInt bitWidth=32; bitWidth>=8; bitWidth>>=1)
+		{
+		const TUint pattern = initPattern >> (32-bitWidth);
+		const TInt numberOfFields = (32/bitWidth);
+		for(TInt i=0; i< numberOfFields; i++)
+			{
+			const TInt extraByteOffset = i * (bitWidth >> 3);
+			const TInt byteOffset = os + extraByteOffset;
+			if(aVerbose)
+				test.Printf(_L("Access bitWidth=%d byte offset=%d\n"), bitWidth, byteOffset);
+			//the full dword we expect
+			//currently assume that the unwritable bits will be 0
+			const TUint writeExpect = (pattern << (bitWidth * i) ) & mask; 
+			const TUint clearExpect = 0;
+						
+			//do write followed by clear
+			const TUint expect[] = {writeExpect, clearExpect};
+			const TUint write[] = {pattern, 0};
+			for(TInt n = 0; n < 2; n++)
+				{
+				aSpace.Write(bitWidth, byteOffset, write[n]);
+				TUint result = aSpace.Read(32, os);
+							
+				if(aVerbose)
+					test.Printf(_L("wrote 0x%08x, expect 0x%08x, read 0x%08x\n"),
+						write[n], expect[n], result);
+				test_Equal(expect[n], result);
+				}
+
+			//test Modify calls. Set then clear pattern
+			TUint set[] = {pattern, 0};
+			TUint clear[] = {0, pattern};
+
+			for(TInt m = 0; m < 2; m++)
+				{	
+				aSpace.Modify(bitWidth, byteOffset, clear[m], set[m]);
+				TUint result = aSpace.Read(32, os);
+						
+				if(aVerbose)
+					test.Printf(_L("clear 0x%08x, set 0x%08x,  expect 0x%08x, read 0x%08x\n"), clear[m], set[m], expect[m], result);
+				test_Equal(expect[m], result);
+				}
+			}
+		}
+
+	//restore orginal value or we will not be able to access device
+	aSpace.Write(32, os, original);
+	}
+
+
+/**
+Verify that a PCI DChunk can be opened and closed from user side
+
+@param pci  The RPci object to use
+@param test The RTest object to use
+@param aPciChunkSize The size of the DChunk which would be created
+*/
+void TestOpenAndCloseDChunk(RPci& pci,RTest& test,TInt aPciChunkSize)
+	{
+	RPciChunk testPciDChunk;
+
+	// Create and open Chunk
+	TRequestStatus status;
+	TInt r = pci.OpenPciDChunk(testPciDChunk,aPciChunkSize, &status);	
+	test_KErrNone(r);
+	
+	test(testPciDChunk.IsWritable());
+	test(testPciDChunk.IsReadable());
+
+	test.Printf(_L("PCI Chunk base = 0x%08x\n"), testPciDChunk.Base());
+	test.Printf(_L("PCI Chunk size = %d\n"), testPciDChunk.Size());
+	test.Printf(_L("PCI Address = 0x%08x\n"), testPciDChunk.PciBase());	
+
+	//Close Chunk
+	test.Next(_L("Close PCI Chunk handle"));	
+
+	RTest::CloseHandleAndWaitForDestruction(testPciDChunk);
+	User::WaitForRequest(status);
+	}
+
+/**
+Verify that a PCI PlatHwChunk can be opened and closed from user side
+
+
+@param pci  The RPci object to use
+@param test The RTest object to use
+@param aPciChunkSize The size of the PlatHwChunk which would be created
+*/
+void TestOpenAndClosePciPlatHwChunk(RPci& pci,RTest& test,TInt aPciChunkSize)
+	{
+	RPciChunk testPciPlatHwChunk;
+
+	// Create and open Chunk
+	TRequestStatus status;
+	TInt r = pci.OpenPciPlatHwChunk(testPciPlatHwChunk,aPciChunkSize, &status);	
+	test_KErrNone(r);
+	
+	test(testPciPlatHwChunk.IsWritable());
+	test(testPciPlatHwChunk.IsReadable());
+
+	test.Printf(_L("PCI Chunk base = 0x%08x\n"), testPciPlatHwChunk.Base());
+	test.Printf(_L("PCI Chunk size = %d\n"), testPciPlatHwChunk.Size());
+	test.Printf(_L("PCI Address = 0x%08x\n"), testPciPlatHwChunk.PciBase());	
+
+	//Close Chunk	
+	testPciPlatHwChunk.Close();
+	User::WaitForRequest(status);
+	test.Next(_L("Closed PCI PlatHwChunk handle"));	
+	}
+
+/**
+Verify that pci-mapped DChunk can be opended and closed form user side 
+
+@param pci  The RPci object to use
+@param test The RTest object to use
+@param aPciChunkSize The size of the pci-mapped DChunk which would be created
+*/
+void TestPciMapppedChunk(RPci& pci,RTest& test,TInt aPciChunkSize)
+	{
+	RPciChunk testPciMappedChunk;
+
+	// Create and open Chunk
+	TRequestStatus status;
+	TInt r = pci.OpenPciMappedChunk(testPciMappedChunk,aPciChunkSize, &status);	
+	test_KErrNone(r);
+	
+	test(testPciMappedChunk.IsWritable());
+	test(testPciMappedChunk.IsReadable());
+
+	test.Printf(_L("PCI Chunk base = 0x%08x\n"), testPciMappedChunk.Base());
+	test.Printf(_L("PCI Chunk size = %d\n"), testPciMappedChunk.Size());
+	test.Printf(_L("PCI Address = 0x%08x\n"), testPciMappedChunk.PciBase());	
+
+	//Close Chunk
+	testPciMappedChunk.Close();
+	User::WaitForRequest(status);
+	test.Next(_L("Closed PCI Mapped Chunk handle"));	
+	}
+
+/**
+Verify that an RChunk can be open to grant access to the internal PCI window from the user side
+
+@param pci  The RPci object to use
+@param test The RTest object to use
+*/
+void TestPciWindowChunk(RPci& pci,RTest& test)
+	{
+	RChunk testPciWindowChunk;
+
+	// Create and open DChunk
+	TInt r = pci.OpenPciWindowChunk(testPciWindowChunk);	
+	test_KErrNone(r);
+	
+	test(testPciWindowChunk.IsWritable());
+	test(testPciWindowChunk.IsReadable());
+
+	test.Printf(_L("PCI Window Chunk base = 0x%08x\n"), testPciWindowChunk.Base());
+	test.Printf(_L("PCI Window Chunk size = %d\n"), testPciWindowChunk.Size());
+	
+	//Close Chunk
+	testPciWindowChunk.Close();
+	test.Next(_L("Closed PCI Window Chunk handle"));	
+	}
+
+
+class CPciTest : public CTest
+	{
+protected:
+	CPciTest(const TDesC& aName, TInt aIterations, RPci& aDevice)
+		: CTest(aName, aIterations), iDevice(aDevice)
+		{}
+
+	RPci iDevice;
+	};
+
+/**
+Each instance of test will open a chunk, using the function specified in
+the template argument, FUNC.
+
+The total number of chunks that can be opened by all instances is limited
+by iMaxCount.
+
+All intances of the test will hold their chunk open until iMaxCount has
+been reached.
+*/
+template<ChunkOpenFn FUNC>
+class CPciOpenChunkTest : public CPciTest
+	{
+public:
+	CPciOpenChunkTest(const TDesC& aName, TInt aIterations, RPci& aDevice,
+			RSemaphore aSemOpen, RSemaphore aSemClose, RFastLock aLock, TInt aMaxCount)
+		:CPciTest(aName, aIterations, aDevice),
+			iSemOpen(aSemOpen), iSemClose(aSemClose), iLock(aLock), iMaxCount(aMaxCount)
+		{
+		}
+
+	virtual void RunTest()
+		{
+		RTest test(iName);
+		RPciChunk chunk;
+
+		iSemOpen.Wait();
+		TRequestStatus status;
+		const TInt chunkSize = 0x400;
+		//open chunk by calling FUNC
+		TInt r = ((iDevice).*(FUNC))(chunk, chunkSize, &status);
+		test_KErrNone(r);
+
+		iLock.Wait();
+		iOpenCount++;
+		test.Printf(_L("Opened chunk %d\n"), iOpenCount);
+		if(iOpenCount == iMaxCount)
+			{
+			test.Printf(_L("Opened=%d, max=%d: Allow chunks to close\n"), iOpenCount, iMaxCount);
+			//release all waiting threads
+			//plus 1 preincrement so this
+			//thread also passes
+			iSemClose.Signal(iOpenCount);			
+			iOpenCount = 0;
+			}	
+		iLock.Signal();
+
+
+		iSemClose.Wait();
+		chunk.Close();
+		User::WaitForRequest(status);
+
+		// permit another chunk to be opened  
+		iSemOpen.Signal();
+		test.Close();
+		}
+
+	virtual CTest* Clone() const
+		{
+		//make shallow copy
+		return new CPciOpenChunkTest(*this);
+		}
+
+
+private:
+	RSemaphore& iSemOpen; ///!< Represents the number of available PCI mappings
+	RSemaphore& iSemClose; ///!< Represents the number of threads waiting to close their chunk
+	RFastLock& iLock;
+	static TInt iOpenCount;
+	const TInt iMaxCount;
+	};
+
+template<ChunkOpenFn FUNC>
+TInt CPciOpenChunkTest<FUNC>::iOpenCount = 0;
+
+
+/**
+Test which will perform various reads from a PCI address
+space (config or memory) and confirm that values are read
+as expected
+*/
+class CPciAddressSpaceRead : public CPciTest
+	{
+public:
+	CPciAddressSpaceRead(const TDesC& aName, TInt aIterations, RPci& aDevice,
+		const TUserPciSpace& aSpace, const TPciTestInfo::TAddrSpaceTest& aInfo)
+		:CPciTest(aName, aIterations, aDevice),
+			iAddressSpace(aSpace.Clone()), iSpaceTestInfo(aInfo)
+	{
+	}
+
+	CPciAddressSpaceRead(const CPciAddressSpaceRead& aOther)
+		:CPciTest(aOther)/* TODO-REVIEW have object-sliced aOther - is this ok?*/,
+			iAddressSpace(aOther.iAddressSpace->Clone()), iSpaceTestInfo(aOther.iSpaceTestInfo)
+	{
+	}
+
+	virtual ~CPciAddressSpaceRead()
+		{
+		delete iAddressSpace;
+		}
+
+	virtual void RunTest()
+		{
+		__UHEAP_MARK;
+		RTest test(iName);
+		TestReadAddressSpace(*iAddressSpace, iSpaceTestInfo, test);
+		test.Close();
+		__UHEAP_MARKEND;
+		}
+
+	virtual CTest* Clone() const
+		{
+		//make shallow copy
+		return new CPciAddressSpaceRead(*this);
+		}
+
+private:
+	TUserPciSpace* iAddressSpace;
+	const TPciTestInfo::TAddrSpaceTest& iSpaceTestInfo;
+	};
+
+/**
+For aBuffer, test writing to it then reading back from aWindow
+then write via window and read back from chunk
+
+@param test The RTest object to use
+@param aBuffer RChunk corresponding to a PCI accessible buffer
+@param aWindow RChunk coressponding an appropriate System-to-PCI memory window
+It is presumed to start at PCI address 0
+*/
+void DoLoopBackTest(RTest& test, RPciChunk aBuffer, RChunk aWindow)
+	{
+	test.Start(_L("Test accessing memory via PCI"));
+
+	TUint8* const bufferBase = aBuffer.Base();
+	const TUint bufferSize = aBuffer.Size();
+	const TUint bufferPciBase = aBuffer.PciBase();
+
+	TUint8* const windowBase = aWindow.Base();
+	const TUint windowSize = aWindow.Size();
+
+#define PRINT(N) RDebug::Printf("%s = 0x%08x (%d)", #N, (N), (N)) 
+	PRINT(bufferBase);
+	PRINT(bufferSize);
+	PRINT(bufferPciBase);
+
+	PRINT(windowBase);
+	PRINT(windowSize);
+
+#undef PRINT
+
+	//need to check that the end of the buffer
+	//is within the windowed region
+	test(bufferPciBase + bufferSize <= windowSize);
+	TUint8* const bufferBaseWithinWindow = windowBase + bufferPciBase;
+
+	test.Next(_L("write chunk"));
+	for(TUint i = 0; i < bufferSize; ++i)
+		{
+		//each byte will hold its own offset modulo 256
+		bufferBase[i] = (TUint8)i;
+		}
+
+	test.Next(_L("read back via window"));
+	for(TUint j=0; j < bufferSize; ++j)
+		{
+		const TUint8 result = bufferBaseWithinWindow[j];
+		test_Equal(j%256, result);
+		}
+
+	//clear chunk
+	memclr(bufferBase, bufferSize);
+	test.Next(_L("write via window"));
+	for(TUint k=0; k < bufferSize; ++k)
+		{
+		//each byte will hold its own offset modulo 256
+		bufferBaseWithinWindow[k] = (TUint8)k;
+		}
+
+	test.Next(_L("read back from chunk"));
+	for(TUint l=0; l < bufferSize; ++l)
+		{
+		const TUint8 result = bufferBase[l];
+		test_Equal(l%256, result);
+		}
+
+	test.End();
+	}
+
+/**
+Take care of opening a chunk, running the test and closing
+*/
+template<ChunkOpenFn OPEN_FUNC>
+inline void LoopBackTest(RPci& aPci, RTest& test, RChunk& aWindow)
+	{
+	RPciChunk pciChunk;
+	const TInt chunkSize = 0x400; //1k
+
+	//call the specified chunk opening function
+	TRequestStatus status;
+	TInt r = ((aPci).*(OPEN_FUNC))(pciChunk, chunkSize, &status);	
+	test_KErrNone(r);
+	DoLoopBackTest(test, pciChunk, aWindow);
+	pciChunk.Close();
+	User::WaitForRequest(status);
+	}
+
+/**
+Run the loopback test for the 3 types of buffer supported by the PCI driver.
+DChunk
+DPlatChunk
+Mapped In external memory
+*/
+void TestLoopBack(RPci& aPci, RTest& test)
+	{
+	test.Next(_L("Open PCI window"));
+	RChunk window;
+	
+	TInt r = aPci.OpenPciWindowChunk(window);	
+	test_KErrNone(r);
+
+	test.Next(_L("DChunk"));
+	LoopBackTest<&RPci::OpenPciDChunk>(aPci, test, window);
+
+	test.Next(_L("DPlatHwChunk"));
+	LoopBackTest<&RPci::OpenPciPlatHwChunk>(aPci, test, window);
+
+	test.Next(_L("DChunk (mapped in)"));
+	LoopBackTest<&RPci::OpenPciMappedChunk>(aPci, test, window);
+
+	window.Close();
+	}
+#ifndef __VC32__ //visual studio 6 doesn't approve of pointer to member function template parameters
+/**
+Run the CPciOpenChunkTest for each type of chunk. This function also creates (and destroys) the
+necessary semaphores and locks.
+CPciOpenChunkTest objects are run in multiple threads using MultipleTestRun().
+
+@param aDevice Handle to the test driver
+@param test RTest to use.
+@param aBufferLimit The maximum number of buffers which can be opened simultaneously
+*/
+void TestBufferOpenConcurrency(RPci& aDevice, RTest& test, TInt aBufferLimit)
+	{
+	RSemaphore semaphoreOpen;
+	RSemaphore semaphoreClose;
+	RFastLock lock;
+
+	TInt r = semaphoreOpen.CreateLocal(aBufferLimit);
+	test_KErrNone(r);
+
+	r = semaphoreClose.CreateLocal(0);
+	test_KErrNone(r);
+
+	r = lock.CreateLocal();
+	test_KErrNone(r);
+
+	const TInt iterations = 3;
+	{
+	test.Printf(_L("Opening %d PCI DChunks in %d threads\n"), aBufferLimit, aBufferLimit);
+	CPciOpenChunkTest<&RPci::OpenPciDChunk>
+		dChunkTest(_L("Concurrent-DChunk"), iterations, aDevice, semaphoreOpen, semaphoreClose, lock, aBufferLimit);
+
+	MultipleTestRun(test, dChunkTest, aBufferLimit);
+	}
+
+	{
+	test.Printf(_L("Opening %d PCI DPlatHwChunks in %d threads\n"), aBufferLimit, aBufferLimit);
+	CPciOpenChunkTest<&RPci::OpenPciPlatHwChunk>
+		platChunkTest(_L("Concurrent-DPlatHwChunk"), iterations, aDevice, semaphoreOpen, semaphoreClose, lock, aBufferLimit);
+
+	MultipleTestRun(test, platChunkTest, aBufferLimit);
+	}
+
+	{
+	test.Printf(_L("Opening %d PCI Mapped chunks in %d threads\n"), aBufferLimit, aBufferLimit);
+	CPciOpenChunkTest<&RPci::OpenPciMappedChunk>
+		mappedChunkTest(_L("Concurrent-DChunk(mapped)"), iterations, aDevice, semaphoreOpen, semaphoreClose, lock, aBufferLimit);
+
+	MultipleTestRun(test, mappedChunkTest, aBufferLimit);
+	}
+
+	semaphoreOpen.Close();
+	semaphoreClose.Close();
+	lock.Close();
+	}
+#endif
+
+TInt E32Main()
+	{
+	__UHEAP_MARK;
+
+	_LIT(KPci, "PCI");
+	RTest test(KPci);
+	test.Start(_L("Running PCI tests\n"));
+
+	TInt r = User::LoadLogicalDevice(KPciLdd);
+
+	__KHEAP_MARK;
+	
+	if(r==KErrNotFound)
+		{
+		test.Printf(_L("No PCI system present - skipping test\n"));
+		return KErrNone;
+		}
+	if(r!=KErrNone && r!=KErrAlreadyExists)
+		{
+		test_KErrNone(r);
+		}
+	
+	test.Next(_L("Open non-existant device\n"));
+	RPci device;
+	TPciDevice unavailable;
+	r = device.Open(unavailable);
+	test_Equal(KErrNotFound, r);
+
+	RPci pciInfo;
+	r = pciInfo.Open();
+	test_KErrNone(r);
+
+	test.Next(_L("Get test info from driver\n"));
+	TPciTestInfo info;
+	r = pciInfo.GetTestInfo(info);
+	test_KErrNone(r);
+	pciInfo.Close();
+
+	test.Next(_L("Open test device\n"));
+	r = device.Open(info.iDevice);
+	test_KErrNone(r);
+
+	test.Next(_L("Run Device Unit Test\n"));
+	r=TestRunPciUnitTest(device);	
+	test_KErrNone(r);
+
+	test.Next(_L("Read config space\n"));
+	TUserConfigSpace cs(device);
+	TestReadAddressSpace(cs, info.iCfgSpaceRead, test);
+
+	test.Next(_L("Write config space\n"));
+	TestWriteAddressSpace(cs, info.iCfgSpaceWrite, test);
+	
+	test.Next(_L("Read memory space\n"));
+	TUserMemorySpace ms(device, info.iMemSpaceIndex);
+	TestReadAddressSpace(ms, info.iMemSpaceRead, test);
+
+	test.Next(_L("Modify memory space\n"));
+	TestWriteAddressSpace(ms, info.iMemSpaceWrite, test);
+
+	{
+	const TInt addrSpaceThreadCount = 4;
+	const TInt iterations = 100;
+	test.Next(_L("Concurrent config space reads")); 
+	CPciAddressSpaceRead cfgSpaceRead(_L("Cfg Space Read"), iterations, device, cs, info.iCfgSpaceRead);
+	MultipleTestRun(test, cfgSpaceRead, addrSpaceThreadCount);
+
+	test.Next(_L("Concurrent memory space reads")); 
+	CPciAddressSpaceRead memSpaceRead(_L("Memory Space Read"), iterations, device, ms, info.iMemSpaceRead);
+	MultipleTestRun(test, memSpaceRead, addrSpaceThreadCount);
+	}
+
+	TInt testDChunkSize = 0x4000;
+	test.Next(_L("Open and Close DChunks\n"));	
+	TestOpenAndCloseDChunk(device,test,testDChunkSize);
+	
+	TInt testDPlatChunkSize = 0x2000;
+	test.Next(_L("Open and Close PlatHwChunks\n"));	
+	TestOpenAndClosePciPlatHwChunk(device,test,testDPlatChunkSize);
+
+	//TestPciMapppedChunk() fails for sizes greater than 4K.
+	//The issue is that a block of externally mapped memory must be
+	//naturally alligned in order to be accessible to the PCI bus (ie
+	//an 8k buffer would have to start at an address which is a
+	//multiple of 8k.
+	//
+	//Now we could fix this for sure on the kernel side, by making
+	//sure we only commit correctly aligned memory into the chunk (as
+	//the pci driver itself does),
+	//However, by using a 4k chunk, we know this will be on a page
+	//boundary so the alignment is correct (assuming the page size
+	//isn't changed). 	
+	TInt testMapppedChunkSize = 0x1000; 
+	test.Next(_L("Open and Close Pci Mappped Chunk\n"));	
+	TestPciMapppedChunk(device,test,testMapppedChunkSize);
+
+	test.Next(_L("Open and Close Pci Window Chunk\n"));	
+	TestPciWindowChunk(device,test);
+
+	const TInt numberOfThreads = info.iNumberOfBars;
+	test.Printf(_L("Open buffers concurrently, max supported = %d\n"), numberOfThreads);
+#ifndef __VC32__
+	TestBufferOpenConcurrency(device, test, numberOfThreads);
+#else
+	test.Printf(_L("TestBufferOpenConcurrency not implemented for WINS"), numberOfThreads);
+#endif
+
+	test.Next(_L("Test loop back"));	
+	TestLoopBack(device, test);
+
+	device.Close();
+	__KHEAP_MARKEND;
+
+	r = User::FreeLogicalDevice(KPciLdd);
+	test_KErrNone(r);
+
+	test.End();
+	test.Close();
+
+	__UHEAP_MARKEND;
+	return KErrNone;
+	}	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/pci/t_pci.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,254 @@
+// 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: This is the header file for the PCI driver test , so far implemented 
+//				only on the  Naviengine platform
+
+#ifndef __TPCI_TEST_H
+#define __TPCI_TEST_H
+
+#ifndef __KERNEL_MODE__
+#define __E32TEST_EXTENSION__
+#include <e32test.h>
+ #include <e32def_private.h>
+#endif // __KERNEL_MODE__
+
+_LIT(KPciLdd, "d_pci.ldd");
+_LIT(KPciLddFactory, "PCI_test_factory");
+_LIT(KPciTest, "PCI Test LDD");
+
+/**
+Test driver op-codes
+*/
+enum TPciTestCmd
+	{
+	EGetTestInfo,
+	EAccessConfigSpace,
+	EAccessMemorySpace,
+	EOpenPciDChunk,
+	EOpenPciPlatHwChunk,
+	EOpenPciMappedChunk,
+	EOpenPciWindowChunk,
+	ERunUnitTests
+	};
+
+/**
+Identifies a PCI Function (device) on the system
+*/
+struct TPciDevice
+	{
+	TPciDevice()
+		:iVendorId(0xFFFFFFFF), iDeviceId(0xFFFFFFFF), iInstance(0) {}
+
+	TPciDevice(TUint aVendorId, TUint aDeviceId, TInt aInstance=0)
+		:iVendorId(aVendorId), iDeviceId(aDeviceId), iInstance(aInstance) {}
+
+	TUint iVendorId;
+	TUint iDeviceId;
+	TInt iInstance; ///< Unit to open (there could be multiple devices on system)
+	};
+
+/**
+Used to send chunk size and recieve
+PCI address
+*/
+struct TPciChunkCreateInfo
+	{
+	TPciChunkCreateInfo()
+		:iSize(0), iPciAddress(NULL)
+		{
+		}
+
+	TPciChunkCreateInfo(TInt aSize, TUint& aPciAddress, TRequestStatus* aStatus=NULL)
+		:iSize(aSize), iPciAddress(&aPciAddress), iStatus(aStatus)
+		{
+		}
+	TInt iSize;
+	TUint* iPciAddress;
+	TRequestStatus* iStatus;
+	};	
+
+/**
+Information about the PSL required by the
+user side test
+*/
+struct TPciTestInfo
+	{
+	TPciDevice iDevice; ///< Probe for this
+
+	/**
+	Supplies the necessary information to test Read, Write, and
+	Modify for a word of PCI memory or configuration space
+	*/
+	struct TAddrSpaceTest
+		{
+		TAddrSpaceTest()
+			:iOffset(0), iExpectedValue(0), iReadOnlyMask(0)
+			{}
+
+		TAddrSpaceTest(TUint aOffset, TUint aExpectedValue, TUint aReadOnlyMask)
+			:iOffset(aOffset), iExpectedValue(aExpectedValue), iReadOnlyMask(aReadOnlyMask)
+			{}
+
+		/**
+		Returns a specified sub byte, or word from the whole dword
+		*/
+		inline TUint Expected(TInt aBitWidth, TInt aExtraOffset) const
+			{
+			//the right shift required to get field to bit 0
+			const TInt shift = 8 *((aExtraOffset + iOffset) % 4);
+			
+			const TUint mask = 0xFFFFFFFF >> (32-aBitWidth);
+			return (iExpectedValue >> shift) & mask;
+			}
+
+		const TUint iOffset;
+		const TUint iExpectedValue; ///< The initial value of word
+		const TUint iReadOnlyMask; ///< Mask of unwritable bits
+		//Future work, memory spaces should state a bar index
+		};
+
+
+	TAddrSpaceTest iCfgSpaceRead;
+	TAddrSpaceTest iCfgSpaceWrite;
+
+	TUint iMemSpaceIndex; ///< Memory space to select
+	TAddrSpaceTest iMemSpaceRead;
+	TAddrSpaceTest iMemSpaceWrite;
+
+	TInt iNumberOfBars; ///< Number of simultaneous mappings into PCI space
+	};
+
+class RPci;
+class TAddrSpace;
+/**
+This class encapsulates all the various read/write/and modify commands
+that can be carried out on a PCI memory space. The command is stored user
+side, and then executed on kernel side when KRun() is called.
+*/
+class TUserPciSpace
+	{
+public:
+	TUserPciSpace()
+		:iPci(NULL), iOperation(EInvalid), iBitWidth(0), iOffset(0),
+		iWriteValue(0), iClearMask(0), iSetMask(0)
+	{}
+	TUserPciSpace(RPci& aPci);
+	
+	/**
+	Perform the encapsulated read/write/or modify
+	@note Only run on kernel side
+	*/
+	TUint KRun(TAddrSpace& aAddrSpace);
+	
+	/**
+	Clone method is required so that multiple threads may
+	have their own copy of a TUserPciSpace (without knowing
+	its runtime type)
+	*/
+	virtual TUserPciSpace* Clone() const = 0;
+
+	TUint Read(TInt aBitWidth, TUint aOffset)
+		{
+		iOffset = aOffset;
+		iOperation = ERead;
+		iBitWidth = aBitWidth;
+
+		return Call();
+		}
+
+	void Write(TInt aBitWidth, TUint aOffset, TUint aValue)
+		{
+		iOffset = aOffset;
+		iOperation = EWrite;
+		iBitWidth = aBitWidth;
+		
+		iWriteValue = aValue;
+		Call();
+		}
+
+	void Modify(TInt aBitWidth, TUint aOffset, TUint aClearMask, TUint aSetMask)
+		{
+		iOffset = aOffset;
+		iOperation = EModify;
+		iBitWidth = aBitWidth;
+
+		iClearMask = aClearMask;
+		iSetMask = aSetMask;
+		Call();
+		}
+
+protected:
+	/**
+	Makes a request to iPci and passes a copy of this object to
+	the kernel side.
+	*/
+	virtual TUint Call() =0;
+
+	enum TOperation {EInvalid, ERead, EWrite, EModify};
+
+	/**
+	Pointer to a PCI device handle
+	*/
+	RPci* iPci;
+
+	TOperation iOperation; //!< Type of access to perform
+	TInt iBitWidth;
+	
+	TUint iOffset;
+	TUint32 iWriteValue;
+	TUint32 iClearMask;
+	TUint32 iSetMask;
+	};
+
+/**
+Grants access to a PCI device's (identified
+by aPci) config space from user side
+*/
+class TUserConfigSpace : public TUserPciSpace
+	{
+public:
+	TUserConfigSpace()
+		:TUserPciSpace()
+		{}
+	TUserConfigSpace(RPci& aPci);
+
+	virtual TUserPciSpace* Clone() const;
+private:
+	TUint Call();
+	};
+
+/**
+Grants access to some region of a PCI
+device's memory space. A PCI device(or function)
+may have up to 8 distinct memory spaces
+*/
+class TUserMemorySpace : public TUserPciSpace
+	{
+public:
+	TUserMemorySpace()
+		:TUserPciSpace(), iBarIndex(-1)
+		{}
+
+	TUserMemorySpace(RPci& aPci, TInt aBarIndex);	
+
+	virtual TUserPciSpace* Clone() const;
+	
+	inline TInt BarIndex() {return iBarIndex;}
+
+private:
+	TUint Call();
+
+	TInt iBarIndex; ///< Each PCI function may have up to 8 memory spaces
+	};
+
+#endif //__TPCI_TEST_H
--- a/kerneltest/e32test/personality/example/main.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/personality/example/main.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -676,6 +676,7 @@
 	random_isr_msg* m;
 	unsigned extra = 1;
 	unsigned count = 1;
+	int r;
 	if (!(n%11))
 		++count;
 	if (!(n%13))
@@ -687,7 +688,7 @@
 		m->random_isr_number = n;
 		extra *= n;
 		m->extra = extra;
-		send_msg(L1_TASK, &m->header);
+		r = send_msg(L1_TASK, &m->header);
 		}
 	if (random_sem_signal_count && !--random_sem_signal_count)
 		{
--- a/kerneltest/e32test/pipe/t_pipe.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/pipe/t_pipe.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -789,6 +789,7 @@
 
 // My VID and SID
 _LIT_VENDOR_ID(MyVID,0x70000001);
+
 void TestPipesPermissionCheck() {
 
 		RProcess			proc;
--- a/kerneltest/e32test/power/d_frqchg.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,421 +0,0 @@
-// Copyright (c) 2010-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:
-// e32test\power\d_frqchg.cpp
-// LDD for testing frequency changing
-// 
-//
-
-#include <kernel/kernel.h>
-#include "d_frqchg.h"
-
-#if defined(__EPOC32__) && defined(__SMP__) && defined(__MARM__)
-#define __SUPPORT_LOCAL_TIMER_PRESCALE__
-
-#include <nk_priv.h>
-#include <arm_tmr.h>
-#endif
-
-
-#ifdef __PLATFORM_SUPPORTS_DVFS__
-/**
-  Baseport needs to supply this function to disable DVFS whilst test is running. 
-  The test relies on changing prescalers in local and global timer directly rather than
-  actually changing frequency. Consequently DVFS must be disabled when the test is running
-
-  This function when driver is loaded. 
-  @return KErrNone if succesful
- */
-extern TInt DisableDvfs();
-
-/**
-   if plaftorm supports DVFS this function will be called when the driver is unloaded
- */
-extern void RestoreDvfs();
-#endif
-
-
-
-#if defined(__SUPPORT_LOCAL_TIMER_PRESCALE__)
-TInt Multiply(SRatio& aDest, const SRatio& aSrc)
-	{
-	TUint64 x = aDest.iM;
-	TUint64 y = aSrc.iM;
-	x *= y;
-	if (x==0)
-		{
-		aDest.iM = 0;
-		aDest.iX = 0;
-		return KErrNone;
-		}
-	TInt exp = aDest.iX + aSrc.iX + 32;
-	if (TInt64(x) >= 0)
-		x<<=1, --exp;
-	aDest.iM = I64HIGH(x);
-	if (I64LOW(x) & 0x80000000u)
-		{
-		if (++aDest.iM == 0)
-			aDest.iM = 0x80000000u, ++exp;
-		}
-	if (exp > 32767)
-		{
-		aDest.iM = 0xffffffffu;
-		aDest.iX = 32767;
-		return KErrOverflow;
-		}
-	if (exp < -32768)
-		{
-		aDest.iM = 0;
-		aDest.iX = 0;
-		return KErrUnderflow;
-		}
-	aDest.iX = (TInt16)exp;
-	return KErrNone;
-	}
-
-// Calculate frequency ratio for specified prescale value
-// Ratio = (default+1)/(current+1)
-void PrescaleRatio(SRatio& aR, TInt aDefault, TInt aCurrent)
-	{
-	SRatio df;
-	df.Set(TUint32(aDefault+1));
-	aR.Set(TUint32(aCurrent+1));
-	aR.Reciprocal();
-	Multiply(aR, df);
-	}
-#endif
-
-class DFrqChgFactory : public DLogicalDevice
-//
-// Test LDD factory
-//
-	{
-public:
-	DFrqChgFactory();
-	virtual ~DFrqChgFactory();
-	virtual TInt Install(); 					//overriding pure virtual
-	virtual void GetCaps(TDes8& aDes) const;	//overriding pure virtual
-	virtual TInt Create(DLogicalChannelBase*& aChannel); 	//overriding pure virtual
-	};
-
-class DFrqChg : public DLogicalChannelBase
-//
-// Test logical channel
-//
-	{
-public:
-	virtual ~DFrqChg();
-protected:
-	virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
-	virtual TInt Request(TInt aReqNo, TAny* a1, TAny* a2);
-#if defined(__SUPPORT_LOCAL_TIMER_PRESCALE__)
-	void PopulateDefaultPrescaleList();
-	void SetLocalTimerPrescaler(TUint32 aCpus, TInt aPrescale);
-	TScheduler* iS;
-	TInt iDefaultPrescale[KMaxCpus];
-#if defined(__CPU_ARM_HAS_GLOBAL_TIMER_BLOCK) && defined( __NKERN_TIMESTAMP_USE_SCU_GLOBAL_TIMER__)
-	void SetGlobalTimerPrescaler(TInt aPrescale);
-	TInt iDefaultGTPrescale;
-#endif
-#endif
-
-	};
-
-
-
-DECLARE_STANDARD_LDD()
-	{
-	return new DFrqChgFactory;
-	}
-
-//
-// Constructor
-//
-DFrqChgFactory::DFrqChgFactory()
-	{
-	}
-
-//
-// Destructor, called on unload
-//
-DFrqChgFactory::~DFrqChgFactory()
-	{
-#ifdef __PLATFORM_SUPPORTS_DVFS__
-	RestoreDvfs();
-#endif
-	}
-
-
-
-//
-// Create new channel
-//
-TInt DFrqChgFactory::Create(DLogicalChannelBase*& aChannel)
-	{
-	aChannel=new DFrqChg;
-	return aChannel?KErrNone:KErrNoMemory;
-	}
-
-
-//
-// Install the LDD - overriding pure virtual
-//
-TInt DFrqChgFactory::Install()
-	{
-#ifdef __PLATFORM_SUPPORTS_DVFS__
-	TInt r = DisableDvfs();
-	if (KErrNone != r) return r;
-#endif
-	return SetName(&KLddName);
-	}
-
-
-//
-// Get capabilities - overriding pure virtual
-//
-void DFrqChgFactory::GetCaps(TDes8& /*aDes*/) const
-	{
-	}
-
-
-//
-// Create channel
-//
-TInt DFrqChg::DoCreate(TInt /*aUnit*/, const TDesC8* /*aInfo*/, const TVersion& /*aVer*/)
-	{
-#if defined(__SUPPORT_LOCAL_TIMER_PRESCALE__)
-	iS = (TScheduler*)TScheduler::Ptr();
-	PopulateDefaultPrescaleList();
-#endif
-	return KErrNone;
-	}
-
-
-//
-// Destructor
-//
-DFrqChg::~DFrqChg()
-	{
-#if defined(__SUPPORT_LOCAL_TIMER_PRESCALE__)
-	// restore prescalers
-	SetLocalTimerPrescaler((TUint32) -1, -1);
-#if defined(__CPU_ARM_HAS_GLOBAL_TIMER_BLOCK) && defined( __NKERN_TIMESTAMP_USE_SCU_GLOBAL_TIMER__)
-	SetGlobalTimerPrescaler(-1);
-#endif
-#endif
-	}
-
-
-TInt DFrqChg::Request(TInt aReqNo, TAny* a1, TAny* a2)
-	{
-	SRatioInv ri;
-	TInt r = KErrNone;
-	switch (aReqNo)
-		{
-		case RFrqChg::EControl_RatioSet:
-			{
-			kumemget32(&ri.iR, a1, sizeof(SRatio));
-			ri.iR.Set(ri.iR.iM, (TUint32)a2);
-			kumemput32(a1, &ri.iR, sizeof(SRatio));
-			break;
-			}
-		case RFrqChg::EControl_RatioReciprocal:
-			{
-			kumemget32(&ri.iR, a1, sizeof(SRatio));
-			r = ri.iR.Reciprocal();
-			kumemput32(a1, &ri.iR, sizeof(SRatio));
-			break;
-			}
-		case RFrqChg::EControl_RatioMult:
-			{
-			kumemget32(&ri.iR, a1, sizeof(SRatio));
-			kumemget32(&ri.iI.iM, a2, sizeof(TUint32));
-			r = ri.iR.Mult(ri.iI.iM);
-			kumemput32(a2, &ri.iI.iM, sizeof(TUint32));
-			break;
-			}
-		case RFrqChg::EControl_RatioInvSet:
-			{
-			SRatio ratio;
-			const SRatio* p = 0;
-			if (a2)
-				{
-				kumemget32(&ratio, a2, sizeof(SRatio));
-				p = &ratio;
-				}
-			ri.Set(p);
-			kumemput32(a1, &ri, sizeof(SRatioInv));
-			break;
-			}
-#if defined(__EPOC32__) && defined(__SMP__) && defined(__MARM__)
-		case RFrqChg::EControl_FrqChgTestPresent:
-			break;
-		case RFrqChg::EControl_SetCurrentThreadPriority:
-			NKern::ThreadSetPriority(NKern::CurrentThread(), (TInt)a1);
-			break;
-		case RFrqChg::EControl_SetCurrentThreadCpu:
-			{
-			TUint32 old = 0;
-			old =  NKern::ThreadSetCpuAffinity(NKern::CurrentThread(), (TUint32)a1);
-			if (a2) 
-				{
-				kumemput32(a2, &old, sizeof(TUint32));
-				}
-			
-			old =  NKern::ThreadSetCpuAffinity(NKern::CurrentThread(), (TUint32)a1);
-			}
-			
-			break;
-		case RFrqChg::EControl_SetCurrentThreadTimeslice:
-			{
-			TInt ts = NKern::TimesliceTicks((TUint32)a1);
-			NKern::ThreadSetTimeslice(NKern::CurrentThread(), ts);
-			NKern::YieldTimeslice();
-			break;
-			}
-#endif
-#if defined(__SUPPORT_LOCAL_TIMER_PRESCALE__)
-		case RFrqChg::EControl_SetLocalTimerPrescaler:
-			{
-			TUint32 cpus = (TUint32)a1;
-			TInt prescale = (TInt)a2;
-			SetLocalTimerPrescaler(cpus, prescale);
-			break;
-			}
-#if defined(__CPU_ARM_HAS_GLOBAL_TIMER_BLOCK) && defined( __NKERN_TIMESTAMP_USE_SCU_GLOBAL_TIMER__)
-	case RFrqChg::EControl_ReadGlobalTimerAndTimestamp:
-		    {
-			ArmGlobalTimer* tmr = iS->iSX.iGlobalTimerAddr;
-			TUint32 highlow[2];
-			do
-				{
-				highlow[1] = tmr->iTimerCountHigh;
-				highlow[0] = tmr->iTimerCountLow;
-				} while(highlow[1]!=tmr->iTimerCountHigh);
-			TUint64 ts = NKern::Timestamp();
-			kumemput32(a1,&highlow[0],sizeof(TUint64));
-			kumemput32(a2,&ts,sizeof(TUint64));
-			break;
-		 }
-	case RFrqChg::EControl_SetGlobalTimerPrescaler:
-		    {
-			SetGlobalTimerPrescaler((TInt)a1);
-			break;
-		 }
-#endif
-#endif
-		default:
-			r = KErrNotSupported;
-			break;
-		}
-	return r;
-	}
-
-
-#if defined(__SUPPORT_LOCAL_TIMER_PRESCALE__)
-void DFrqChg::PopulateDefaultPrescaleList()
-	{
-	TInt nc = NKern::NumberOfCpus();
-	NThread* nt = NKern::CurrentThread();
-	TUint32 aff0 = NKern::ThreadSetCpuAffinity(nt, 0);
-	TInt i;
-	for (i=0; i<nc; ++i)
-		{
-		NKern::ThreadSetCpuAffinity(nt, i);
-		ArmLocalTimer* tmr = (ArmLocalTimer*)iS->iSX.iLocalTimerAddr;
-		TInt pv = (tmr->iTimerCtrl & E_ArmTmrCtrl_PrescaleMask) >> E_ArmTmrCtrl_PrescaleShift;
-		iDefaultPrescale[i] = pv;
-		}
-	NKern::ThreadSetCpuAffinity(nt, aff0);
-#if defined(__CPU_ARM_HAS_GLOBAL_TIMER_BLOCK) && defined( __NKERN_TIMESTAMP_USE_SCU_GLOBAL_TIMER__)
-	ArmGlobalTimer* tmr = iS->iSX.iGlobalTimerAddr;
-	TInt pv = (tmr->iTimerCtrl & E_ArmGTmrCtrl_PrescaleMask) >> E_ArmGTmrCtrl_PrescaleShift;
-	iDefaultGTPrescale = pv;
-#endif
-	}
-
-void DFrqChg::SetLocalTimerPrescaler(TUint32 aCpus, TInt aPrescale)
-	{
-	TInt nc = NKern::NumberOfCpus();
-	NThread* nt = NKern::CurrentThread();
-	TUint32 aff0 = NKern::ThreadSetCpuAffinity(nt, 0);
-	TInt i;
-	for (i=0; i<nc; ++i)
-		{
-		NKern::ThreadSetCpuAffinity(nt, i);
-		}
-	for (i=0; i<nc; ++i)
-		{
-		NKern::ThreadSetCpuAffinity(nt, i);
-		TInt pv = aPrescale;
-		if (pv < 0)
-			pv = iDefaultPrescale[i];
-		if (aCpus & (1u<<i))
-			{
-			TInt irq = NKern::DisableAllInterrupts();
-			ArmLocalTimer* tmr = (ArmLocalTimer*)iS->iSX.iLocalTimerAddr;
-			tmr->iTimerCtrl = (tmr->iTimerCtrl &~ E_ArmTmrCtrl_PrescaleMask) | ((pv << E_ArmTmrCtrl_PrescaleShift) & E_ArmTmrCtrl_PrescaleMask);
-			__e32_io_completion_barrier();
-			NKern::RestoreInterrupts(irq);
-			}
-		}
-	NKern::ThreadSetCpuAffinity(nt, aff0);
-	if (aCpus & 0x80000000u)
-		{
-		// notify nanokernel of frequency changes
-		SVariantInterfaceBlock* vib = iS->iVIB;
-		SRatio ratio[KMaxCpus];
-		for (i=0; i<nc; ++i)
-			{
-			if (aCpus & (1u<<i))
-				{
-				if (aPrescale<0)
-					ratio[i].Set(1);
-				else
-					PrescaleRatio(ratio[i], iDefaultPrescale[i], aPrescale);
-				vib->iTimerFreqR[i] = &ratio[i];
-				}
-			}
-		(*vib->iFrqChgFn)();
-		}
-	}
-
-#if defined(__CPU_ARM_HAS_GLOBAL_TIMER_BLOCK) && defined( __NKERN_TIMESTAMP_USE_SCU_GLOBAL_TIMER__)
-void DFrqChg::SetGlobalTimerPrescaler(TInt aPrescale)
-	{
-	TInt pv = aPrescale;
-	if (pv <= 0)
-		pv = iDefaultGTPrescale;
-
-	ArmGlobalTimer* tmr = iS->iSX.iGlobalTimerAddr;
-	// TInt irq = NKern::DisableAllInterrupts(); 
-	tmr->iTimerCtrl = (tmr->iTimerCtrl &~ E_ArmGTmrCtrl_PrescaleMask) | ((pv << E_ArmGTmrCtrl_PrescaleShift) & E_ArmGTmrCtrl_PrescaleMask);
-	__e32_io_completion_barrier();
-	// NKern::RestoreInterrupts(irq);
-
-	// notify nanokernel of frequency changes
-	SVariantInterfaceBlock* vib = iS->iVIB;
-	SRatio ratio;
-	
-	if (aPrescale<=0)
-		ratio.Set(1);
-	else
-		PrescaleRatio(ratio, iDefaultGTPrescale, aPrescale);
-
-	vib->iGTimerFreqR = &ratio;
-	(*vib->iFrqChgFn)();
-	}
-
-#endif
-#endif
-
--- a/kerneltest/e32test/power/d_frqchg.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-// Copyright (c) 2010-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:
-// e32test\power\d_frqchg.h
-// 
-//
-
-#if !defined(__D_FRQCHG_H__)
-#define __D_FRQCHG_H__
-
-#include <e32cmn.h>
-
-struct SRatio;
-struct SRatioInv;
-
-#ifndef __KERNEL_MODE__
-#include <e32std.h>
-
-struct SRatio
-	{
-	TUint32		iM;		// mantissa, normalised so bit 31=1
-	TInt16		iX;		// -exponent.
-	TUint8		iSpare1;
-	TUint8		iSpare2;
-	};
-
-struct SRatioInv
-	{
-	SRatio		iR;
-	SRatio		iI;
-	};
-#endif
-
-_LIT(KLddName,"D_FRQCHG.LDD");
-
-class RFrqChg : public RBusLogicalChannel
-	{
-public:
-	enum TControl
-		{
-		EControl_RatioSet,
-		EControl_RatioReciprocal,
-		EControl_RatioMult,
-		EControl_RatioInvSet,
-		EControl_FrqChgTestPresent,
-		EControl_SetCurrentThreadPriority,
-		EControl_SetCurrentThreadCpu,
-		EControl_SetCurrentThreadTimeslice,
-		EControl_SetLocalTimerPrescaler,
-		EControl_ReadGlobalTimerAndTimestamp,
-		EControl_SetGlobalTimerPrescaler,
-		ENumControls
-		};
-
-public:
-	inline TInt Open();
-	inline TInt RatioSet(SRatio& aRatio, TUint32 aInt, TInt aDivisorExp=0);
-	inline TInt RatioReciprocal(SRatio& aRatio);
-	inline TInt RatioMult(SRatio& aRatio, TUint32& aInt32);
-	inline TInt RatioInvSet(SRatioInv& aRI, const SRatio* aR);
-	inline TInt FrqChgTestPresent();
-	inline TInt SetCurrentThreadPriority(TInt aPri);
-	inline TInt SetCurrentThreadCpu(TUint32 aCpu, TUint32* aOldAffinity = NULL);
-	inline TInt SetCurrentThreadTimeslice(TInt aSlice);
-	inline TInt SetLocalTimerPrescaler(TUint32 aCpus, TInt aPrescale);
-	inline TInt ReadGlobalTimerAndTimestamp(TUint64& aTimerValue, TUint64& aTimestamp);
-	inline TInt SetGlobalTimerPrescaler(TInt aPrescale);
-	};
-
-#ifndef __KERNEL_MODE__
-inline TInt RFrqChg::Open()
-	{ return DoCreate(KLddName,TVersion(0,1,1),KNullUnit,NULL,NULL); }
-inline TInt RFrqChg::RatioSet(SRatio& aR, TUint32 aInt, TInt aDivisorExp)
-	{ aR.iM=aInt; return DoControl(EControl_RatioSet, (TAny*)&aR, (TAny*)aDivisorExp); }
-inline TInt RFrqChg::RatioReciprocal(SRatio& aR)
-	{ return DoControl(EControl_RatioReciprocal, (TAny*)&aR); }
-inline TInt RFrqChg::RatioMult(SRatio& aR, TUint32& aInt32)
-	{ return DoControl(EControl_RatioMult, (TAny*)&aR, (TAny*)&aInt32); }
-inline TInt RFrqChg::RatioInvSet(SRatioInv& aRI, const SRatio* aR)
-	{ return DoControl(EControl_RatioInvSet, (TAny*)&aRI, (TAny*)aR); }
-inline TInt RFrqChg::FrqChgTestPresent()
-	{ return DoControl(EControl_FrqChgTestPresent); }
-inline TInt RFrqChg::SetCurrentThreadPriority(TInt aPri)
-	{ return DoControl(EControl_SetCurrentThreadPriority, (TAny*)aPri); }
-inline TInt RFrqChg::SetCurrentThreadCpu(TUint32 aCpu, TUint32* aOldAffinity)
-	{ return DoControl(EControl_SetCurrentThreadCpu, (TAny*)aCpu, (TAny*) aOldAffinity); }
-inline TInt RFrqChg::SetCurrentThreadTimeslice(TInt aSlice)
-	{ return DoControl(EControl_SetCurrentThreadTimeslice, (TAny*)aSlice); }
-inline TInt RFrqChg::SetLocalTimerPrescaler(TUint32 aCpus, TInt aPrescale)
-	{ return DoControl(EControl_SetLocalTimerPrescaler, (TAny*)aCpus, (TAny*)aPrescale); }
-inline TInt RFrqChg::ReadGlobalTimerAndTimestamp(TUint64& aTimerValue, TUint64& aTimestamp)
-	{ return DoControl(EControl_ReadGlobalTimerAndTimestamp, (TAny*)&aTimerValue, (TAny*) &aTimestamp); }
-inline TInt RFrqChg::SetGlobalTimerPrescaler(TInt aPrescale)
-	{ return DoControl(EControl_SetGlobalTimerPrescaler, (TAny*)aPrescale); }
-#endif
-
-#endif   //__D_FRQCHG_H__
--- a/kerneltest/e32test/power/d_powermisctest.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,190 +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\power\d_powermisctest.cpp
-// 
-//
-
-#include <kernel/kernel.h>
-#include <kernel/kpower.h>
-#include "d_powermisctest.h"
-#include <smppower/idlehelper.h>
-#include "smpidlehandler.h"
-
-#ifdef __SMP__
-NONSHARABLE_CLASS(DTest_SMPIdleHandler) : public DSMPIdleHandler
-    {
-public:
-    DTest_SMPIdleHandler() : DSMPIdleHandler() {};
-    TInt SelfTest()
-    	{
-    	// call unused functions to ensure it is covered in tests
-    	ResetSyncPoints();
-    	return DoEnterIdle(0,0,NULL);
-    	}
-    TBool GetLowPowerMode(TInt aIdleTime, TInt &aLowPowerMode) {return ETrue;}
-    TBool EnterLowPowerMode(TInt aMode, TInt aCpuMask, TBool aLastCpu) {return ETrue;}	
-    };
-#endif
-
-class DTestFactory : public DLogicalDevice
-//
-// Test LDD factory
-//
-	{
-public:
-	DTestFactory();
-	virtual TInt Install(); 
-	virtual void GetCaps(TDes8& aDes) const;
-	virtual TInt Create(DLogicalChannelBase*& aChannel);
-	};
-
-class DTest1 : public DLogicalChannelBase
-//
-// Test logical channel
-//
-	{
-public:
-	virtual ~DTest1();
-protected:
-	virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
-	virtual TInt Request(TInt aReqNo, TAny* a1, TAny* a2);
-
-private:
-	TInt DoTest();
-#ifdef __SMP__
-private:    
-    DTest_SMPIdleHandler* iH;    
-#endif    
-	};
-
-
-
-DECLARE_STANDARD_LDD()
-	{
-	return new DTestFactory;
-	}
-
-//
-// Constructor
-//
-DTestFactory::DTestFactory()
-	{
-
-	}
-
-TInt DTestFactory::Create(DLogicalChannelBase*& aChannel)
-	{
-//
-// Create new channel
-//
-	aChannel=new DTest1;
-	return aChannel?KErrNone:KErrNoMemory;
-	}
-
-TInt DTestFactory::Install()
-//
-// Install the LDD - overriding pure virtual
-//
-	{
-	return SetName(&KLddName);
-	}
-
-void DTestFactory::GetCaps(TDes8& /*aDes*/) const
-//
-// Get capabilities - overriding pure virtual
-//
-	{
-	}
-
-TInt DTest1::DoCreate(TInt /*aUnit*/, const TDesC8* /*aInfo*/, const TVersion& /*aVer*/)
-//
-// Create channel
-//
-	{
-#ifdef __SMP__
-	iH = new DTest_SMPIdleHandler();
-	TIdleSupport();	
-#endif	
-	return KErrNone;
-	}
-
-DTest1::~DTest1()
-//
-// Destructor
-//
-	{
-#ifdef __SMP__		
-	delete iH;		
-#endif	
-	}
-
-TInt DTest1::Request(TInt aReqNo, TAny* /*a1*/, TAny* /*a2*/)
-	{
-
-	// 'Control' functions...
-	switch(aReqNo)
-		{
-		// DoControl
-		case RLddTest1::ECONTROL_TEST:
-			DoTest();
-			break;
-		}
-
-	return KErrNone;
-	}
-	
-TInt DTest1::DoTest()
-	{
-#ifdef __SMP__	
-	TInt r = KErrNone;
-	
-	// smp idle handler self tests
-	Kern::Printf("smp idle handler self test");
-	iH->SelfTest();
-	
-	// Test GetTimerCount using supplied timer
-	Kern::Printf("test GetTimerCount using supplied timer");
-	TUint32 TimerCount = 10;
-	TIdleSupport::SetupIdleSupport(0, 0, &TimerCount);
-	if(TIdleSupport::GetTimerCount() != 10)
-		{
-		return KErrGeneral;
-		}	
-	// Test GetTimerCount using default timer
-	Kern::Printf("test GetTimerCound using default timer");
-	TIdleSupport::SetupIdleSupport(0, 0, 0);
-	TimerCount = TIdleSupport::GetTimerCount();
-
-	// Test MarkCoreRetired()
-	Kern::Printf("test MarkCoreRetired");
-	TUint32 engagedMask = *(TIdleSupport::EngagedCpusMaskAddr());
-	TIdleSupport::MarkCoreRetired(0x1);
-	if(*(TIdleSupport::EngagedCpusMaskAddr())!= (engagedMask&(~0x1)))
-		{
-		return KErrGeneral;
-		}
-	// Test MarkCoreEngaged()
-	Kern::Printf("test MarkCoreEngaged");
-	TIdleSupport::MarkCoreEngaged(0x1);
-	if(*(TIdleSupport::EngagedCpusMaskAddr())!= (engagedMask|0x1))
-		{
-		return KErrGeneral;
-		}
-	return r;
-#else
-	Kern::Printf("DoTest no supported");
-	return KErrNotSupported;	
-#endif	
-
-	}
--- a/kerneltest/e32test/power/d_powermisctest.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +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\power\d_powermisctest.h
-// 
-//
-
-#if !defined(__D_POWERMISCTEST_H__)
-#define __D_POWERMISCTEST_H__
-
-#include <e32cmn.h>
-#ifndef __KERNEL_MODE__
-#include <e32std.h>
-#endif
-
-_LIT(KLddName,"D_POWERMISCTEST.LDD");
-
-class RLddTest1 : public RBusLogicalChannel
-	{
-public:
-	enum TControl
-		{
-		ECONTROL_TEST
-		};
-
-public:
-#ifndef __KERNEL_MODE__
-
-	inline TInt Open()
-		{ return DoCreate(KLddName,TVersion(0,1,1),KNullUnit,NULL,NULL); }
-	inline TInt Test()
-		{ return DoControl(ECONTROL_TEST); }
-
-#endif 
-	};
-#endif   //__D_POWERMISCTEST_H__
--- a/kerneltest/e32test/power/d_powermisctest.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +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/d_lddpowerseqtest.mmp
-// 
-//
-
-#include "kernel/kern_ext.mmh"
-
-TARGET         d_powermisctest.ldd
-TARGETTYPE     LDD
-SOURCEPATH     ../power
-SOURCE         d_powermisctest.cpp
-
-SYMBIAN_BASE_SYSTEMINCLUDE(drivers)
-USERINCLUDE		../../../kernel/eka/include/drivers/smppower/sample_idlehandler
-
-staticlibrary		idlehelper.lib
-staticlibrary		sample_smpidlehandler.lib
-
-EPOCALLOWDLLDATA
-
-UID		0x100000af
-VENDORID 0x70000001
-
-
-capability		all
-
-start wins
-win32_headers
-end
-SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/power/domainpolicytest.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,98 @@
+// 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:
+//
+
+#include <domainpolicy.h>
+#include "domainpolicytest.h"
+
+const TInt KDomainTimeout = 2000000; /* 2000ms */
+
+static const TDmDomainSpec DomainHierarchy[] = 
+	{
+		{ KDmIdRoot,	KDmIdNone,	_INIT_SECURITY_POLICY_C1(ECapabilityWriteDeviceData),		EStartupCriticalStatic,	KDomainTimeout	},
+
+		// row 1		
+		{ KDmIdTestA,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestB,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestC,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+
+		// row 2
+		{ KDmIdTestAA,	KDmIdTestA,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestAB,	KDmIdTestA,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestBA,	KDmIdTestB,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestCA,	KDmIdTestC,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		
+		// row 3
+		{ KDmIdTestABA,	KDmIdTestAB,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestABB,	KDmIdTestAB,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestCAA,	KDmIdTestCA,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+
+		// end of array marker
+		{ KDmIdNone,	KDmIdNone,	_INIT_SECURITY_POLICY_PASS,	0,	0	}
+	};
+static const TDmHierarchyPolicy HierarchyPolicy	= 
+	{ETraverseParentsFirst, ETraverseChildrenFirst, ETransitionFailureStop};
+	
+
+
+/**
+Gets access to the test hierarchy specification.
+
+The domain hierarchy specification is a simple array of TDmDomainSpec items.
+
+The default implementation provided by Symbian OS just returns a pointer to
+the domain hierarchy specification array.
+
+@return A pointer to the domain hierarchy specification array.
+*/
+EXPORT_C const TDmDomainSpec* DmPolicy::GetDomainSpecs()
+	{
+	return (TDmDomainSpec*) DomainHierarchy;
+	}
+
+
+
+
+/**
+Releases access to the specified domain hierarchy specification.
+
+The domain hierarchy specification is a simple array of TDmDomainSpec items.
+
+As the default Symbian OS implementation of GetDomainSpecs() just returns
+a pointer to the domain hierarchy specification array, then the default
+implementation of Release() is empty. The API is provided to permit
+more complex implementations, if required.
+
+@param aDomainSpec A pointer to the domain hierarchy specification array.
+*/
+EXPORT_C void DmPolicy::Release(const TDmDomainSpec* /*aDomainSpec*/)
+	{
+	}
+
+
+/**
+Retrieves the domain hierarchy policy 
+
+@param	aPolicy a client-supplied policy which on exit
+		will contain a copy of the policy for the requested domain hierarchy id.
+
+  
+@return	KErrNone
+*/
+EXPORT_C TInt DmPolicy::GetPolicy(TDmHierarchyPolicy& aPolicy)
+	{
+	aPolicy = HierarchyPolicy;
+	return KErrNone;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/power/domainpolicytest.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,73 @@
+// 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:
+//
+
+#ifndef __DOMAIN_POLICY_TEST_H__
+#define __DOMAIN_POLICY_TEST_H__
+
+// The test domain hierarchy id 
+
+static const TDmHierarchyId	KDmHierarchyIdTest = 99;
+
+/*
+Domains defined in this hiearchy
+The hierarchy desribed here looks like this:
+		Root
+		A				B				C
+		AA	AB			BA				CA
+			ABA	ABB						CAA
+
+*/
+static const TDmDomainId	KDmIdTestA		= 0x02;
+static const TDmDomainId	KDmIdTestB		= 0x03;
+static const TDmDomainId	KDmIdTestC		= 0x04;
+
+static const TDmDomainId	KDmIdTestAA		= 0x05;
+static const TDmDomainId	KDmIdTestAB		= 0x06;
+static const TDmDomainId	KDmIdTestBA		= 0x07;
+static const TDmDomainId	KDmIdTestCA		= 0x08;
+
+static const TDmDomainId	KDmIdTestABA	= 0x09;
+static const TDmDomainId	KDmIdTestABB	= 0x0A;
+static const TDmDomainId	KDmIdTestCAA	= 0x0B;
+static const TInt KTestDomains = 0x0B;	// number of domains including root
+
+
+/*
+System-wide start-up states
+
+Some of these states may be ommitted depending on the start-up mode.
+E.g. The system-starter might choose to omit EStartupNonCritical in "safe" mode
+*/
+enum TStartupState
+	{
+	/** In this state, all ROM based (static) components or resources that 
+	are critical to the operation of the phone are started */
+	EStartupCriticalStatic,
+
+	/** In this state, all non-ROM based (dynamic) components or resources that 
+	are critical to the operation of the phone are started */
+	EStartupCriticalDynamic,
+
+	/** In this state, all ROM based (static) or non-ROM based (dynamic) 
+	components or resources that are not critical to the operation of the phone 
+	are started */
+	EStartupNonCritical,
+
+	/** An integer that is strictly greater thean any legal start-up state value */
+	EStartupLimit
+	};
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/power/t_domain.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,2301 @@
+// 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"
+// 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\power\t_domain.cpp
+// Overview:
+// Domain manager tests
+// API Information:
+// RDmDomain, RDmDomainManager CDmDomain, CDmDomainManager
+// Details:
+// - Test a variety of domain transitions, check the expected number of
+// notifications and the first expected ordinal. Verify results are
+// as expected.
+// - Test system standby, check the expected number of notifications and 
+// the first expected ordinal. Use a timer to request a wakeup event.
+// Verify results are as expected.
+// - Test domain related simple error situations, verify results are
+// as expected.
+// - Perform platform security tests: launch a separate process with no 
+// capabilities, verify that results are as expected.
+// - Test domain transitions by connecting to two domain hierarchies 
+// simultaneously, add some test and power hierarchy members, verify
+// the expected target state, notifications and leaf nodes. Verify results.
+// - Verify that the same hierarchy can not be connected to more than once.
+// - Request a positive transition and request that the test domain use 
+// ETraverseParentsFirst. Verify results are as expected and verify 
+// domains are in the correct state.
+// - Request a negative transition and request that the test domain use 
+// ETraverseChildrenFirst. Verify results are as expected.
+// - Request a positive transition with zero acknowledgements. Verify 
+// results are as expected.
+// - Request a positive transition with error acknowledgements. Verify 
+// results are as expected.
+// - Perform a variety of negative tests and verify results are as expected.
+// - Perform various tests on domain transitions with activated observer.
+// Verify results are as expected.
+// Platforms/Drives/Compatibility:
+// All.
+// Assumptions/Requirement/Pre-requisites:
+// Failures and causes:
+// Base Port information:
+// 
+//
+
+#include <e32test.h>
+#include <domainmember.h>
+#include <domainmanager.h>
+#include <domainobserver.h>
+#include "domainpolicytest.h"
+#include <e32debug.h>
+#include <f32file.h>
+#include <e32ldr.h>
+#include <e32ldr_private.h>
+
+LOCAL_D RTest test(_L(" T_DOMAIN "));
+_LIT(KThreadName, "t_domain_panic_thread");
+
+#ifdef _DEBUG
+#define __PRINT(x) {RDebug::Print x;}
+#else
+#define __PRINT(x) 
+#endif
+
+class CDmTestMember;
+
+// interface for test domain memebers.
+// Any test memeber should derive from this interface 
+class MDmDomainMember
+	{
+public:
+	virtual TDmHierarchyId HierarchyId() = 0;
+	virtual TDmDomainId	DomainId() = 0;
+	virtual TDmDomainState State() = 0;
+	virtual TInt Status() = 0;
+	virtual TUint32 Ordinal() = 0;
+	virtual TInt Notifications() = 0;
+	};
+
+class MDmTest
+	{
+public:
+	virtual void Perform() = 0;
+	virtual void Release() = 0;
+	virtual TInt TransitionNotification(MDmDomainMember& aDomainMember) = 0;
+	virtual void TransitionRequestComplete() = 0;
+	};
+
+// for the test hierarchy, we generate an ordinal for each domain
+// each byte of which describes the exact location of the domain in the hierarchy
+#define ORDINAL_FROM_DOMAINID0(id) (id)
+#define ORDINAL_FROM_DOMAINID1(parent, id) ((parent << 8) | (id))
+#define ORDINAL_FROM_DOMAINID2(grandparent, parent, id) ((grandparent << 16) | (parent << 8) | id)
+#define ORDINAL_FROM_DOMAINID3(greatgrandparent, grandparent, parent, id) ((greatgrandparent << 24) | (grandparent << 16) | (parent << 8) | id)
+#define PARENT_ORDINAL(id) (id >> 8)
+
+#define ORDINAL_LEVEL(ordinal)			\
+	((ordinal & 0xFF00) == 0) ? 1 :			\
+	((ordinal & 0xFF0000) == 0) ? 2 :		\
+	((ordinal & 0xFF000000) == 0) ? 3 : 4;
+
+
+// get the least significant domain id character (for debugging purposes)
+TBool GetDomainChar(TDmDomainId aDomainId, TChar& aChar)
+	{
+	TBool found = ETrue;
+	switch(aDomainId)
+		{
+		
+		case KDmIdTestA:	aChar = 'A'; break;
+		case KDmIdTestB:	aChar = 'B'; break;
+		case KDmIdTestC:	aChar = 'C'; break;
+		case KDmIdTestAA:	aChar = 'A'; break;
+		case KDmIdTestAB:	aChar = 'B'; break;
+		case KDmIdTestBA:	aChar = 'A'; break;
+		case KDmIdTestCA:	aChar = 'A'; break;
+		case KDmIdTestABA:	aChar = 'A'; break;
+		case KDmIdTestABB:	aChar = 'B'; break;
+		case KDmIdTestCAA:	aChar = 'A'; break;
+		// domain char not found 
+		case KDmIdNone:
+		case KDmIdRoot:		
+		default:			
+			found = EFalse;
+		}
+	return found;
+	}
+
+// prints the 4-character domain string into the passed descriptor (for debugging purposes)
+// e.g. "CAA" for KDmIdTestCAA
+void GetDomainDesc(TUint32 aOrdinal, TDes& aDes)
+	{
+	if (aOrdinal == KDmIdRoot)
+		{
+		aDes.Append(_L("root"));
+		return;
+		}
+
+	TUint32 val =  aOrdinal;
+
+	for (TInt n=0; n<4; n++)
+		{
+		TDmDomainId domainId = (TDmDomainId) (val >> 24);
+		TChar ch;
+		TBool found = GetDomainChar(domainId, ch);
+		if (found)
+			aDes.Append(ch);
+		val = val << 8;
+		}
+
+	}
+
+
+class CDmTestMember : public CActive, public MDmDomainMember
+	{
+public:	
+	// from CActive
+	void RunL();
+	// from MDmDomainMember
+	inline TDmHierarchyId HierarchyId() {return iHierarchy;};
+	inline TDmDomainId	DomainId() {return iId;};
+	inline TDmDomainState State() {return iState;};
+	inline TInt Status() {return iStatus.Int();};
+	inline TUint32 Ordinal() {return iOrdinal;};
+	inline TInt Notifications() {return iNotifications;};
+
+	CDmTestMember(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest*);
+	~CDmTestMember();
+	void Acknowledge();
+
+protected:
+	// from CActive
+	virtual void DoCancel();
+
+
+public:
+	TDmHierarchyId iHierarchy;
+	TDmDomainId	iId;
+	TDmDomainState iState;
+	TUint32		iOrdinal;
+	MDmTest*	iTest;	
+	TInt		iNotifications;
+	RDmDomain	iDomain;
+	};
+
+
+
+CDmTestMember::CDmTestMember(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest* aTest) : CActive(CActive::EPriorityStandard), 
+	iHierarchy(aHierarchy), iId(aId), iOrdinal(aOrdinal), iTest(aTest)
+	{
+	TInt r;
+
+	if (iHierarchy == KDmHierarchyIdPower)
+		 r = iDomain.Connect(iId);
+	else
+		 r = iDomain.Connect(iHierarchy, iId);
+
+	test(r == KErrNone);
+
+	CActiveScheduler::Add(this);
+
+	iDomain.RequestTransitionNotification(CActive::iStatus);
+	CActive::SetActive();
+	}
+
+CDmTestMember::~CDmTestMember()
+	{
+	CActive::Cancel();
+	iDomain.Close();
+	}
+
+void CDmTestMember::Acknowledge()
+	{
+	iDomain.AcknowledgeLastState();
+	}
+
+void CDmTestMember::RunL()
+	{
+
+	iNotifications++;
+
+	iState = iDomain.GetState();
+
+	TInt ackError = iTest->TransitionNotification(*this);
+	if (ackError == KErrNone)
+		iDomain.AcknowledgeLastState();
+	else if (ackError == KErrAbort)	// don't acknowledge
+		;
+	else
+		iDomain.AcknowledgeLastState(ackError);
+
+	
+	// request another notification (even if we didn't acknowledge the last one)
+	iDomain.RequestTransitionNotification(CActive::iStatus);
+	CActive::SetActive();
+	}
+
+void CDmTestMember::DoCancel()
+	{
+	iDomain.CancelTransitionNotification();
+	}
+
+
+// CDomainMemberAo
+class CDomainMemberAo : public CDmDomain, public MDmDomainMember
+	{
+public:	
+	static CDomainMemberAo* NewL(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest*);
+	~CDomainMemberAo();
+
+	// from CActive
+	void RunL();
+
+	// from MDmDomainMember
+	inline TDmHierarchyId HierarchyId() {return iHierarchy;};
+	inline TDmDomainId	DomainId() {return iId;};
+	inline TDmDomainState State() {return iState;};
+	inline TInt Status() {return iStatus.Int();};
+	inline TUint32 Ordinal() {return iOrdinal;};
+	inline TInt Notifications() {return iNotifications;};
+
+private:
+	CDomainMemberAo(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest*);
+
+public:
+	TDmHierarchyId iHierarchy;
+	TDmDomainId	iId;
+	TDmDomainState iState;
+	TUint32		iOrdinal;
+	MDmTest*	iTest;	
+	TInt		iNotifications;
+	};
+
+CDomainMemberAo* CDomainMemberAo::NewL(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest* aTest)
+	{
+	CDomainMemberAo* self=new (ELeave) CDomainMemberAo(aHierarchy, aId, aOrdinal, aTest);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+
+	self->RequestTransitionNotification();
+
+	CleanupStack::Pop();
+	return self;
+	}
+
+CDomainMemberAo::CDomainMemberAo(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest* aTest) : 
+	CDmDomain(aHierarchy, aId), 
+	iHierarchy(aHierarchy), iId(aId), iOrdinal(aOrdinal), iTest(aTest)
+	{
+	}
+
+CDomainMemberAo::~CDomainMemberAo()
+	{
+	Cancel();
+	}
+
+void CDomainMemberAo::RunL()
+	{
+	iNotifications++;
+
+	iState = GetState();
+
+	TInt ackError = iTest->TransitionNotification(*this);
+	if (ackError == KErrNone)
+		AcknowledgeLastState(ackError);
+	else if (ackError == KErrAbort)	// don't acknowledge
+		;
+	else
+		AcknowledgeLastState(ackError); 
+	if (ackError != KErrAbort)	
+		AcknowledgeLastState(ackError);
+
+	
+	// request another notification (even if we didn't acknowledge the last one)
+	RequestTransitionNotification();
+	}
+
+
+// CDomainManagerAo
+class CDomainManagerAo : public CDmDomainManager
+	{
+public:	
+	~CDomainManagerAo();
+	static CDomainManagerAo* NewL(TDmHierarchyId aHierarchy, MDmTest& aTest);
+
+	// from CActive
+	void RunL();
+
+private:
+	CDomainManagerAo(TDmHierarchyId aHierarchy, MDmTest& aTest);
+
+private:
+	MDmTest& iTest;
+	};
+
+
+CDomainManagerAo* CDomainManagerAo::NewL(TDmHierarchyId aHierarchy, MDmTest& aTest)
+	{
+	CDomainManagerAo* self=new (ELeave) CDomainManagerAo(aHierarchy, aTest);
+	CleanupStack::PushL(self);
+
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+CDomainManagerAo::CDomainManagerAo(TDmHierarchyId aHierarchy, MDmTest& aTest) : 
+	CDmDomainManager(aHierarchy), iTest(aTest)
+	{
+	}
+
+CDomainManagerAo::~CDomainManagerAo()
+	{
+	}
+
+void CDomainManagerAo::RunL()
+	{
+	iTest.TransitionRequestComplete();
+	}
+
+
+class CDmTest1 : public CActive, public MDmTest
+	{
+public: // from CActive
+	void RunL();
+
+	// from MDmTest
+	void Perform();
+	void Release();
+	TInt TransitionNotification(MDmDomainMember& aDomainMember);
+	void TransitionRequestComplete() {};
+
+	CDmTest1 (TDmDomainId aId, TDmDomainState aState) : CActive(CActive::EPriorityStandard), iDomainId(aId), iState((TPowerState) aState) {}
+
+protected:
+	// from CActive
+	virtual void DoCancel();
+
+private:
+	enum { KMembersMax = 16 };
+	CDmTestMember*		iMembers[KMembersMax]; 
+	RDmDomainManager	iManager;
+	TDmDomainId			iDomainId;
+	TPowerState			iState;
+	TBool				iAcknowledge;
+	TInt				iMembersCount;
+	TInt				iCount;
+	TUint32				iOrdinal;
+	};
+
+void CDmTest1::Perform()
+	{
+	//
+	// Test domain transitions
+	//
+
+	test.Next(_L("Test 1"));
+	test.Printf(_L("Domain id = 0x%x Target State = 0x%x\n"), iDomainId, iState);
+	iMembers[0] = new CDmTestMember(KDmHierarchyIdPower, KDmIdRoot, 0, this);
+	test(iMembers[0] != NULL);
+	iMembers[1] = new CDmTestMember(KDmHierarchyIdPower, KDmIdRoot, 0, this);
+	test(iMembers[1] != NULL);
+	iMembers[2] = new CDmTestMember(KDmHierarchyIdPower, KDmIdApps, 1, this);
+	test(iMembers[2] != NULL);
+	iMembers[3] = new CDmTestMember(KDmHierarchyIdPower, KDmIdApps, 1, this);
+	test(iMembers[3] != NULL);
+	iMembers[4] = new CDmTestMember(KDmHierarchyIdPower, KDmIdUiApps, 1, this);
+	test(iMembers[4] != NULL);
+	iMembers[5] = new CDmTestMember(KDmHierarchyIdPower, KDmIdUiApps, 1, this);
+	test(iMembers[5] != NULL);
+	
+	// expected number of notifications
+	iMembersCount = (iDomainId == KDmIdRoot) ? 6 : 2;
+	// first expected ordinal
+	iOrdinal = (iState == EPwActive) ? 0 : 1;
+
+	TInt r = iManager.Connect();
+	test(r == KErrNone);
+
+	CActiveScheduler::Add(this);
+
+	iManager.RequestDomainTransition(iDomainId, iState, CActive::iStatus);
+	CActive::SetActive();
+
+	CActiveScheduler::Start();
+	}
+
+TInt CDmTest1::TransitionNotification(MDmDomainMember& aDomainMember)
+	{
+	++iCount;
+	if (aDomainMember.State() == EPwActive)
+		{
+		if(aDomainMember.Ordinal() < iOrdinal)
+			{
+			// Making the test to fail in RunL function inorder to complete the cleanup from domain manager.
+			test.Printf(_L("Making test to fail as Ordinal Mismatch Expected : %d, Returned : %d"), aDomainMember.Ordinal(), iOrdinal);
+			iCount--;
+			}
+		}
+	else
+		{
+		if(aDomainMember.Ordinal() > iOrdinal)
+			{
+			//Making the test to fail in RunL function inorder to complete the cleanup from domain manager.
+			test.Printf(_L("Making test to fail as Ordinal Mismatch Expected : %d, Returned : %d"), aDomainMember.Ordinal(), iOrdinal);
+			iCount--;
+			}
+		}
+	iOrdinal = aDomainMember.Ordinal();
+
+	// acknowledge one from two
+	iAcknowledge = !iAcknowledge;
+	return iAcknowledge?KErrNone:KErrGeneral;
+	}
+
+void CDmTest1::RunL()
+	{
+	CActiveScheduler::Stop();
+
+	iManager.Close();
+
+	CDmTestMember** mp;
+	for (mp = iMembers; *mp; ++mp)
+		delete *mp;
+	test(iCount == iMembersCount);
+	}
+
+void CDmTest1::DoCancel()
+	{
+	test(0);
+	}
+
+void CDmTest1::Release()
+	{
+	delete this;
+	}
+
+class CDmTest2Timer : public CTimer
+	{
+public: // fomr CTimer
+   void RunL();
+public:
+	CDmTest2Timer() : CTimer(0) 
+		{
+		TRAPD(r,
+			ConstructL());
+		test(r == KErrNone);
+		CActiveScheduler::Add(this);
+		}
+	};
+
+void CDmTest2Timer::RunL()
+	{
+	test.Printf(_L("Tick count after CDmTest2Timer::RunL() = %d\n"), User::NTickCount());
+
+	// kick the timer again in case power down hasn't happened yet
+	TTime wakeup;
+	wakeup.HomeTime();
+	wakeup += TTimeIntervalSeconds(3);
+	At(wakeup);
+	}
+
+class CDmTest2 : public CActive, public MDmTest
+	{
+public: // from CActive
+	void RunL();
+
+	// from MDmTest
+	void Perform();
+	void Release();
+	TInt TransitionNotification(MDmDomainMember& aDomainMember);
+	void TransitionRequestComplete() {};
+	CDmTest2 (TDmDomainState aState) : CActive(CActive::EPriorityStandard), iState((TPowerState) aState) {}
+
+protected:
+	// from CActive
+	virtual void DoCancel();
+
+private:
+	enum { KMembersMax = 16 };
+	CDmTestMember*		iMembers[KMembersMax]; 
+	RDmDomainManager	iManager;
+	TPowerState			iState;
+	TBool				iAcknowledge;
+	TInt				iMembersCount;
+	TInt				iCount;
+	TUint32				iOrdinal;
+	CDmTest2Timer*		iTimer;
+	};
+
+
+void CDmTest2::Perform()
+	{
+	//
+	// Test system standby
+	//
+
+	test.Next(_L("Test 2"));
+	test.Printf(_L("Target State = 0x%x\n"), iState);
+	iMembers[0] = new CDmTestMember(KDmHierarchyIdPower, KDmIdRoot, 0, this);
+	test(iMembers[0] != NULL);
+	iMembers[1] = new CDmTestMember(KDmHierarchyIdPower, KDmIdRoot, 0, this);
+	test(iMembers[1] != NULL);
+	iMembers[2] = new CDmTestMember(KDmHierarchyIdPower, KDmIdApps, 1, this);
+	test(iMembers[2] != NULL);
+	iMembers[3] = new CDmTestMember(KDmHierarchyIdPower, KDmIdApps, 1, this);
+	test(iMembers[3] != NULL);
+	iMembers[4] = new CDmTestMember(KDmHierarchyIdPower, KDmIdUiApps, 1, this);
+	test(iMembers[4] != NULL);
+	iMembers[5] = new CDmTestMember(KDmHierarchyIdPower, KDmIdUiApps, 1, this);
+	test(iMembers[5] != NULL);
+	
+	// expected number of notifications
+	iMembersCount = 12;
+	// first expected ordinal
+	iOrdinal = (iState == EPwActive) ? 0 : 1;
+
+	TInt r = iManager.Connect();
+	test(r == KErrNone);
+
+	CActiveScheduler::Add(this);
+
+	// Use an absolute timer to request a wakeup event
+	iTimer = new CDmTest2Timer();
+	TTime wakeup;
+	wakeup.HomeTime();
+	wakeup += TTimeIntervalSeconds(5);
+	test.Printf(_L("Tick count before timer = %d\n"), User::NTickCount());
+	iTimer->At(wakeup);
+	
+	iManager.RequestSystemTransition(iState, CActive::iStatus);
+	CActive::SetActive();
+
+	CActiveScheduler::Start();
+	}
+
+TInt CDmTest2::TransitionNotification(MDmDomainMember& aDomainMember)
+	{
+	++iCount;
+	if (aDomainMember.State() == EPwActive)
+		{
+		if(aDomainMember.Ordinal() < iOrdinal)
+			{
+			// Making the test to fail in RunL function inorder to complete the cleanup from domain manager.
+			test.Printf(_L("Making test to fail as Ordinal Mismatch Expected : %d, Returned : %d, State : %d"), 
+																		aDomainMember.Ordinal(), iOrdinal, aDomainMember.State());
+			iCount--;
+			}
+		}
+	else
+		{
+		if(aDomainMember.Ordinal() > iOrdinal)
+			{
+			// Making the test to fail in RunL function inorder to complete the cleanup from domain manager.
+			test.Printf(_L("Making test to fail as Ordinal Mismatch Expected : %d, Returned : %d, State: %d"), 
+																		aDomainMember.Ordinal(), iOrdinal, aDomainMember.State());
+			iCount--;
+			}
+		}
+	iOrdinal = aDomainMember.Ordinal();
+
+	// acknowledge one from two
+	iAcknowledge = !iAcknowledge;
+	return iAcknowledge?KErrNone:KErrAbort;
+	}
+
+void CDmTest2::RunL()
+	{
+	test.Printf(_L("Tick count after CDmTest2::RunL() = %d\n"), User::NTickCount());
+
+	iTimer->Cancel();	
+	CActiveScheduler::Stop();
+
+	iManager.Close();
+
+	CDmTestMember** mp;
+	for (mp = iMembers; *mp; ++mp)
+		delete *mp;
+	test(CActive::iStatus == KErrTimedOut);
+	test(iCount == iMembersCount);
+	}
+
+void CDmTest2::DoCancel()
+	{
+	test(0);
+	}
+
+void CDmTest2::Release()
+	{
+	if (iTimer)
+		{
+		iTimer->Cancel();
+		delete iTimer;
+		}
+	delete this;
+	}
+
+class CDmTest3 : public MDmTest
+	{
+public: 
+	// from MDmTest
+	void Perform();
+	void Release();
+	TInt TransitionNotification(MDmDomainMember& aDomainMember);
+	void TransitionRequestComplete() {};
+	};
+
+void CDmTest3::Perform()
+	{
+	//
+	// Test simple error situation
+	//
+	RDmDomainManager manager;
+	TInt r = manager.Connect();
+	test(r == KErrNone);
+
+	RDmDomainManager manager1;
+	r = manager1.Connect();
+	test(r == KErrInUse);
+
+	RDmDomain domain;
+	r = domain.Connect(KDmIdNone);
+	test(r == KDmErrBadDomainId);
+	CDmTestMember*		testMember;
+	testMember = new CDmTestMember(KDmHierarchyIdPower, KDmIdApps, 1, this);
+	test (testMember != NULL);
+
+	TRequestStatus status;
+	manager.RequestDomainTransition(KDmIdApps, EPwStandby, status);
+	test(status.Int() == KRequestPending);
+
+	TRequestStatus status1;
+	manager.RequestDomainTransition(KDmIdApps, EPwActive, status1);
+	User::WaitForRequest(status1);
+	test(status1.Int() == KDmErrBadSequence);
+	User::WaitForRequest(status);
+	test(status.Int() == KErrTimedOut);
+
+	// Since this test doesn't start the active scheduler, a domain member's RunL() will 
+	// not get called so we need to re-request a domain transition notification manually
+	User::WaitForRequest(testMember->iStatus);
+	test(testMember->iStatus.Int() == KErrNone);
+	testMember->iDomain.RequestTransitionNotification(testMember->iStatus);
+
+	manager.RequestDomainTransition(KDmIdApps, EPwActive, status);
+	test(status.Int() == KRequestPending);
+	manager.CancelTransition();
+	test(status.Int() == KErrCancel);
+	manager.CancelTransition();
+	User::WaitForRequest(status);
+	test(status.Int() == KErrCancel);
+
+	testMember->iDomain.CancelTransitionNotification();
+
+	delete testMember;
+	
+	domain.Close();
+	manager.Close();
+	}
+
+TInt CDmTest3::TransitionNotification(MDmDomainMember& /*aDomainMember*/)
+	{
+	test(0);
+	return KErrAbort;	// don't acknowledge
+	}
+
+void CDmTest3::Release()
+	{
+	delete this;
+	}
+
+class CDmTest4 : public MDmTest
+	{
+public: 
+	// from MDmTest
+	void Perform();
+	void Release();
+	TInt TransitionNotification(MDmDomainMember& aDomainMember);
+	void TransitionRequestComplete() {};
+private:
+	void ExecSlave(TUint arg);
+	};
+
+_LIT(KSecuritySlavePath, "t_domain_slave.exe");
+
+void CDmTest4::ExecSlave(TUint aArg)
+	{
+	RProcess proc;
+	TInt r = proc.Create(KSecuritySlavePath, TPtrC((TUint16*) &aArg, sizeof(aArg)/sizeof(TUint16)));
+	test(r == KErrNone);
+	TRequestStatus status;
+	proc.Logon(status);
+	proc.Resume();
+	User::WaitForRequest(status);
+
+    RDebug::Printf("CDmTest4::ExecSlave(%d) ExitType %d", aArg, proc.ExitType() );
+    RDebug::Printf("CDmTest4::ExecSlave(%d) ExitReason %d", aArg, proc.ExitReason() );
+	test(proc.ExitType() == EExitKill);
+//	test(proc.ExitReason() == KErrPermissionDenied);
+
+	CLOSE_AND_WAIT(proc);
+	}
+
+//! @SYMTestCaseID PBASE-T_DOMAIN-4
+//! @SYMTestType CT
+//! @SYMTestCaseDesc Dmain manager security tests
+//! @SYMREQ 3722
+//! @SYMTestActions Launches a separate process with no capabilities
+//! @SYMTestExpectedResults  DM APIs should fail with KErrPermissionDenied
+//! @SYMTestPriority High
+//! @SYMTestStatus Defined
+void CDmTest4::Perform()
+	{
+	//
+	// Security tests
+	//
+
+	ExecSlave(0);
+
+    ExecSlave(1);
+
+	}
+
+TInt CDmTest4::TransitionNotification(MDmDomainMember& /*aDomainMember*/)
+	{
+	test(0);
+	return KErrNone;
+	}
+
+void CDmTest4::Release()
+	{
+	delete this;
+	}
+
+// Test hierarchy tests
+class CDmTestStartupMember : public CDmTestMember
+	{
+public:
+	CDmTestStartupMember(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest*);
+
+public:
+private:
+	};
+
+CDmTestStartupMember::CDmTestStartupMember(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest* aTest) 
+	: CDmTestMember(aHierarchy, aId, aOrdinal, aTest)
+	{
+	}
+
+// Simultaneously testing of test domain defined in DomainPolicy99.dll
+// and the power domain defined in DomainPolicy.dll
+class CDmTest5 : public CActive, public MDmTest
+	{
+public: 
+	// from CActive
+	void RunL();
+	// from MDmTest
+	void Perform();
+	void Release();
+	TInt TransitionNotification(MDmDomainMember& aDomainMember);
+	void TransitionRequestComplete();	
+	void RunTestOnGetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailure);
+	
+	CDmTest5(TDmDomainId aPowerId, TDmDomainId aTestId, TDmDomainState aPowerState, TDmDomainState aTestState) : 
+		CActive(CActive::EPriorityStandard), 
+		iPowerDomainId(aPowerId), iTestDomainId(aTestId), iPowerState(aPowerState), iTestState(aTestState) {}
+protected:
+	// from CActive
+	virtual void DoCancel();
+
+private:
+	enum { KMembersMax = 16 };
+	enum TAckMode{ KAckAlways, KAckNever, KAckError, KAckOddDomainsOnly };
+
+	CDmTestMember*		iTestMembers[KMembersMax]; 
+	CDomainMemberAo*	iPowerMembers[KMembersMax]; 
+
+	RDmDomainManager	iTestDomainManager;
+	
+	TDmDomainId			iPowerDomainId;
+	TDmDomainId			iTestDomainId;
+
+	TDmDomainState		iPowerState;
+	TDmDomainState		iTestState;
+
+	// level number for iTestDomainId. E.g 1 for KDmIdRoot, 2 for KDmIdTestA, etc.
+	TInt				iTestDomainLevel;	
+
+	TDmTraverseDirection iTraverseDirection;
+
+	TAckMode			iAckMode;
+
+public:
+	TInt				iTestNotifications;
+	TInt				iPowerNotifications;
+	TInt				iTestNotificationsExpected;
+	TInt				iPowerNotificationsExpected;
+
+	TInt				iTransitionsCompleted;
+	TInt				iTransitionsExpected;
+	};
+
+void CDmTest5::RunTestOnGetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailure)
+	{
+	//*************************************************
+	// Test - OOM Testing on GetTransitionFailures()
+	// Simulates heap failure in GetTransitionFailures()
+	//*************************************************
+	TInt error = 0;
+	TInt count = 0;	
+	do
+		{		
+		__UHEAP_SETFAIL(RHeap::EFailNext, ++count);
+		error = iTestDomainManager.GetTransitionFailures(aTransitionFailure);						
+		test.Printf( _L( "CDmTest5::RunTestOnGetTransitionFailures, simulating heap failure on GetTransitionFailures(), Error=%d, Run=%d\n" ), error, count );
+		}while(error == KErrNoMemory);		
+		
+	__UHEAP_RESET;
+	
+	//Actual count of heap failure as the final iteration which terminates the loop would not return KErrNoMemory 
+	--count;
+	test(count > 0);
+	test.Printf( _L( "Out of memory tests on GetTransitionFailures() succeeded at heap failure rate of %i\n" ), count );
+	}
+
+//! @SYMTestCaseID PBASE-T_DOMAIN-5
+//! @SYMTestType CT
+//! @SYMTestCaseDesc Connects to two domain hierarchies simulteneously and perform various tests
+//! @SYMREQ 3704,3705,3706,3707,3708,3709,3710,3711,3720,3721,3724,3725,3726,3727
+//! @SYMTestActions Open two hiearchies simultaneously and perform various actions.
+//! @SYMTestExpectedResults  All tests should pass
+//! @SYMTestPriority High
+//! @SYMTestStatus Defined
+void CDmTest5::Perform()
+	{
+
+ 	__UHEAP_MARK;
+
+	//
+	// Test domain transitions
+	//
+	CActiveScheduler::Add(this);
+
+	TInt r = RDmDomainManager::AddDomainHierarchy(KDmHierarchyIdTest);
+
+    RDebug::Printf("RDmDomainManager::AddDomainHierarchy returns %d", r );
+
+	test(r == KErrNone);
+
+	CDomainManagerAo* powerDomainManager = NULL;
+	TRAP(r, powerDomainManager = CDomainManagerAo::NewL(KDmHierarchyIdPower, *this));
+	test (powerDomainManager != NULL);
+
+	r = CDomainManagerAo::AddDomainHierarchy(KDmHierarchyIdPower);
+	test(r == KErrNone);
+
+	//*************************************************
+	//	Test 5a - connect to two domain hierarchies simultaneously
+	//*************************************************
+	test.Next(_L("Test 5a - connect to two domain hierarchies simultaneously"));
+
+	test.Printf(_L("Domain id = 0x%x, Target State = 0x%x\n"), iTestDomainId, iTestState);
+
+	TInt testMemberCount = 0;
+
+	// Add some test hierarchy members - these use the RDmDomain API
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+	
+	// row 1
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestA, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestA), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestB, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestB), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestC, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestC), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+	
+	// row2
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestAA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAA), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestAB, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAB), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestBA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestB, KDmIdTestBA), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestCA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestC, KDmIdTestCA), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+	
+	// row 3
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestABA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABA), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestABB, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABB), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestCAA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestC, KDmIdTestCA, KDmIdTestCAA), this);
+	test(iTestMembers[testMemberCount++] != NULL);
+
+	// add some power hierarchy members - these use the CDmDomain AO API
+	TInt powerMemberCount = 0;
+	TRAP(r, iPowerMembers[powerMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdPower, KDmIdRoot, KDmIdRoot, this));
+	test(iTestMembers[powerMemberCount++] != NULL);
+	TRAP(r, iPowerMembers[powerMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdPower, KDmIdApps, KDmIdApps, this));
+	test(iTestMembers[powerMemberCount++] != NULL);
+	TRAP(r, iPowerMembers[powerMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdPower, KDmIdUiApps, KDmIdUiApps, this));
+	test(iTestMembers[powerMemberCount++] != NULL);
+
+
+	RArray<const TTransitionFailure> testFailures;
+	TInt testFailureCount;
+	RArray<const TTransitionFailure> powerFailures;
+	TInt powerFailureCount;
+
+
+
+	// calculate the expected number of notifications
+	TInt expectedTestNotifications = 0;
+	TInt leafNodes = 0;
+	
+
+	// work out the domain level, the number of leaf nodes and the expected number of 
+	// notifications for the domain that is being transitioned
+	switch(iTestDomainId)
+		{
+		case KDmIdRoot		:	iTestDomainLevel = 1; leafNodes = 5; expectedTestNotifications = testMemberCount; break;
+		case KDmIdTestA		:	iTestDomainLevel = 2; leafNodes = 3; expectedTestNotifications = 5; break;
+		case KDmIdTestB		:	iTestDomainLevel = 2; leafNodes = 1; expectedTestNotifications = 2; break;
+		case KDmIdTestC		:	iTestDomainLevel = 2; leafNodes = 1; expectedTestNotifications = 3; break;
+
+		case KDmIdTestAA	:	iTestDomainLevel = 3; leafNodes = 1; expectedTestNotifications = 1; break;
+		case KDmIdTestAB	:	iTestDomainLevel = 3; leafNodes = 2; expectedTestNotifications = 3; break;
+		case KDmIdTestBA	:	iTestDomainLevel = 3; leafNodes = 1; expectedTestNotifications = 1; break;
+		case KDmIdTestCA	:	iTestDomainLevel = 3; leafNodes = 1; expectedTestNotifications = 2; break;
+
+		case KDmIdTestABA	:	iTestDomainLevel = 4; leafNodes = 1; expectedTestNotifications = 1; break;
+		case KDmIdTestABB	:	iTestDomainLevel = 4; leafNodes = 1; expectedTestNotifications = 1; break;
+		case KDmIdTestCAA	:	iTestDomainLevel = 4; leafNodes = 1; expectedTestNotifications = 1; break;
+		default:
+			test(0);
+		}
+	test.Printf(_L("Test Domain id = 0x%x, Level = %d, Target State = 0x%x, expected notifications = %d, leafNodes = %d\n"), 
+		iTestDomainId, iTestDomainLevel, iTestState, expectedTestNotifications, leafNodes);
+
+	TInt expectedPowerNotifications = 0;
+	switch(iPowerDomainId)
+		{
+		case KDmIdRoot		:	expectedPowerNotifications = powerMemberCount; break;
+		case KDmIdApps		:	expectedPowerNotifications = 1; break;
+		case KDmIdUiApps	:	expectedPowerNotifications = 1; break;
+		default:
+			test(0);
+		}
+
+
+
+	// connect to the test hierarchy
+	r = iTestDomainManager.Connect(KDmHierarchyIdTest);
+	test(r == KErrNone);
+
+	// verify that we can't connect to the same hierarchy more than once
+	RDmDomainManager	domainManager;
+	r = domainManager.Connect(KDmHierarchyIdTest);
+	test(r == KErrInUse);
+
+
+
+	//*************************************************
+	// Test 5b - request a positive transition
+	// issue a positive  transition (i.e. transition state increases)
+	// and request that the test domain use ETraverseParentsFirst
+	//*************************************************
+	test.Next(_L("Test 5b - request a positive transition"));
+	iAckMode = KAckAlways;
+
+	iTransitionsCompleted = iTestNotifications = iPowerNotifications = 0;
+	iPowerNotificationsExpected = 0;
+	iTestNotificationsExpected = expectedTestNotifications;
+	iTransitionsExpected = 1;
+
+	// DON'T request any domain transition on the power hierarchy
+	// powerDomainManager->RequestDomainTransition(iPowerDomainId, EPwActive);
+	// request a domain transition on the test hierarchy
+	iTraverseDirection = ETraverseParentsFirst;
+	if (iTestDomainId == KDmIdRoot)
+		iTestDomainManager.RequestSystemTransition(iTestState, ETraverseDefault, CActive::iStatus);
+	else
+		iTestDomainManager.RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault, CActive::iStatus);
+	CActive::SetActive();
+
+	CActiveScheduler::Start();
+	test(powerDomainManager->iStatus == KErrNone);
+	test(iStatus == KErrNone);
+	test(iTestNotifications == iTestNotificationsExpected);
+	test(iPowerNotifications == iPowerNotificationsExpected);
+
+	//*************************************************
+	// Test 5c- verify domains are in correct state
+	//*************************************************
+	test.Next(_L("Test 5c- verify domains are in correct state"));
+	RDmDomain domainMember;
+	r = domainMember.Connect(KDmHierarchyIdTest, iTestDomainId);
+	test (r == KErrNone);
+	TDmDomainState state = domainMember.GetState();
+	domainMember.Close();
+	test (state == iTestState);
+
+	// if the transition request is not on the root, verify that that 
+	// the root domain and the transition domain are in different states
+	if (iTestDomainId != KDmIdRoot && iTestState != EStartupCriticalStatic)
+		{
+		r = domainMember.Connect(KDmHierarchyIdTest, KDmIdRoot);
+		test (r == KErrNone);
+		TDmDomainState state = domainMember.GetState();
+		domainMember.Close();
+		test (state != iTestState);
+		}
+
+
+	//*************************************************
+	// Test 5d- request a negative transition
+	// issue a negative transition (i.e. transition state decreases)
+	// and request that the test domain use ETraverseChildrenFirst
+	//*************************************************
+	test.Next(_L("Test 5d- request a negative transition"));
+	iAckMode = KAckAlways;
+	iTestState--;	// EStartupCriticalStatic;
+	iPowerState--;	// EPwStandby
+
+	iTransitionsCompleted = iTestNotifications = iPowerNotifications = 0;
+	iPowerNotificationsExpected = expectedPowerNotifications;
+	iTestNotificationsExpected = expectedTestNotifications;
+	iTransitionsExpected = 2;
+
+	// DO request a domain transition on the power hierarchy
+	powerDomainManager->RequestDomainTransition(iPowerDomainId, iPowerState, ETraverseDefault);
+
+	// request a domain transition on the test hierarchy
+	iTraverseDirection = ETraverseChildrenFirst;
+	iTestDomainManager.RequestDomainTransition(iTestDomainId, iTestState, iTraverseDirection, CActive::iStatus);
+	CActive::SetActive();
+
+	// wait for all test & power transitions to complete
+	CActiveScheduler::Start();
+	test(powerDomainManager->iStatus == KErrNone);
+	test(iStatus == KErrNone);
+	test(iTestNotifications == iTestNotificationsExpected);
+	test(iPowerNotifications == iPowerNotificationsExpected);
+	
+
+	//*************************************************
+	// Test 5e- request a positive transition, with zero acknowledgements
+	// issue a positive transition with no members acknowledging the transition
+	//*************************************************
+	test.Next(_L("Test 5e- request a positive transition, with zero acknowledgements"));
+	iAckMode = KAckNever;
+	iTestState++;		// EStartupCriticalDynamic;
+	iPowerState++;		// EPwActive
+
+	// power hierarchy should continue on failure, so we all power domains should transition
+	// test hierarchy should stop on failure, so should get notifications from all leaf nodes
+	iTransitionsCompleted = iTestNotifications = iPowerNotifications = 0;
+	iPowerNotificationsExpected = expectedPowerNotifications;
+	iTestNotificationsExpected = leafNodes;	// 5 leaf nodes for root domain
+	iTransitionsExpected = 2;
+
+	// DO request a domain transition on the power hierarchy
+	powerDomainManager->RequestDomainTransition(iPowerDomainId, iPowerState, ETraverseDefault);
+
+	// request a domain transition on the test hierarchy
+	iTraverseDirection = ETraverseChildrenFirst;
+	iTestDomainManager.RequestDomainTransition(iTestDomainId, iTestState, iTraverseDirection, CActive::iStatus);
+	CActive::SetActive();
+
+	// wait for all test & power transitions to complete
+	CActiveScheduler::Start();
+	test(powerDomainManager->iStatus == KErrTimedOut);
+	test(iStatus == KErrTimedOut);
+	test(iTestNotifications == iTestNotificationsExpected);
+	test(iPowerNotifications == iPowerNotificationsExpected);
+	
+	// get the failures on the test hierarchy
+	testFailureCount = iTestDomainManager.GetTransitionFailureCount();
+	test (testFailureCount == 1);
+
+#ifdef _DEBUG
+	//***************************************************************
+	// OOM Testing: Simulates heap failure in GetTransitionFailures()
+	//***************************************************************
+	__UHEAP_MARK;
+	RArray<const TTransitionFailure> oomTestFailures;
+	RunTestOnGetTransitionFailures(oomTestFailures);
+	test(oomTestFailures.Count()==1);
+	oomTestFailures.Close();
+	__UHEAP_MARKEND;
+#endif 
+	
+	r = iTestDomainManager.GetTransitionFailures(testFailures);
+	test(r == KErrNone);
+	test(testFailureCount == testFailures.Count());
+
+	test.Printf(_L("Test failures = %d\n"), testFailureCount);
+	TInt i;
+	for (i=0; i<testFailureCount; i++)
+		{
+		test.Printf(_L("%d: iDomainId %d, iError %d\n"), 
+			i, testFailures[i].iDomainId, testFailures[i].iError);
+		test(testFailures[i].iError == KErrTimedOut);
+		}
+
+	// get the failures on the power hierarchy
+	powerFailureCount = powerDomainManager->GetTransitionFailureCount();
+	test (powerFailureCount == expectedPowerNotifications);
+
+	r = powerDomainManager->GetTransitionFailures(powerFailures);
+	test(r == KErrNone);
+	test(powerFailureCount == powerFailures.Count());
+
+	test.Printf(_L("Power failures = %d\n"), powerFailureCount);
+	for (i=0; i<powerFailureCount; i++)
+		{
+		test.Printf(_L("%d: iDomainId %d, iError %d\n"), 
+			i, powerFailures[i].iDomainId, powerFailures[i].iError);
+		test(powerFailures[i].iError == KErrTimedOut);
+		}
+
+	
+	//*************************************************
+	// Test 5f- request a positive transition, with error acknowledgements
+	// issue a positive transition with all members nack'ing the transition
+	//*************************************************
+	test.Next(_L("Test 5f- request a positive transition, with error acknowledgements"));
+	iAckMode = KAckError;
+	iTestState++;		
+	iPowerState++;		
+
+	// power hierarchy should continue on failure, so all power domains should transition
+	// test hierarchy should stop on failure, so should get notifications from 
+	// anything from 1 to all the leaf nodes
+	iTransitionsCompleted = iTestNotifications = iPowerNotifications = 0;
+	iPowerNotificationsExpected = expectedPowerNotifications;
+	iTestNotificationsExpected = leafNodes;	// 5 leaf nodes for root domain
+	iTransitionsExpected = 2;
+
+	// DO request a domain transition on the power hierarchy
+	powerDomainManager->RequestDomainTransition(iPowerDomainId, iPowerState, ETraverseDefault);
+
+	// request a domain transition on the test hierarchy
+	iTraverseDirection = ETraverseChildrenFirst;
+	iTestDomainManager.RequestDomainTransition(iTestDomainId, iTestState, iTraverseDirection, CActive::iStatus);
+	CActive::SetActive();
+
+	// wait for all test & power transitions to complete
+	CActiveScheduler::Start();
+	test(powerDomainManager->iStatus == KErrGeneral);
+	test(iStatus == KErrGeneral);
+	test(iTestNotifications <= iTestNotificationsExpected);
+	test(iPowerNotifications == iPowerNotificationsExpected);
+	
+	// get the failures on the test hierarchy
+	testFailureCount = iTestDomainManager.GetTransitionFailureCount();
+	test (testFailureCount == 1);
+
+	r = iTestDomainManager.GetTransitionFailures(testFailures);
+	test(r == KErrNone);
+	test(testFailureCount == testFailures.Count());
+
+	test.Printf(_L("Test failures = %d\n"), testFailureCount);
+	for (i=0; i<testFailureCount; i++)
+		{
+		test.Printf(_L("%d: iDomainId %d, iError %d\n"), 
+			i, testFailures[i].iDomainId, testFailures[i].iError);
+		test(testFailures[i].iError == KErrGeneral);
+		}
+
+	// get the failures on the power hierarchy
+	powerFailureCount = powerDomainManager->GetTransitionFailureCount();
+	test (powerFailureCount == expectedPowerNotifications);
+
+	r = powerDomainManager->GetTransitionFailures(powerFailures);
+	test(r == KErrNone);
+	test(powerFailureCount == powerFailures.Count());
+
+	test.Printf(_L("Power failures = %d\n"), powerFailureCount);
+	for (i=0; i<powerFailureCount; i++)
+		{
+		test.Printf(_L("%d: iDomainId %d, iError %d\n"), 
+			i, powerFailures[i].iDomainId, powerFailures[i].iError);
+		test(powerFailures[i].iError == KErrGeneral);
+		}
+
+	
+	// cleanup
+
+	testFailures.Reset();
+	powerFailures.Reset();
+
+	iTestDomainManager.Close();
+	delete powerDomainManager;
+	powerDomainManager = NULL;
+
+	CDmTestMember** mt;
+	for (mt = iTestMembers; *mt; ++mt)
+		delete *mt;
+
+	CDomainMemberAo** mp;
+	for (mp = iPowerMembers; *mp; ++mp)
+		delete *mp;
+
+
+	// restore the domain hierarchies to their initial state so as not to 
+	// upset any subsequent tests which rely on this
+	{
+	RDmDomainManager manager;
+	TInt r = manager.Connect();
+	test (r == KErrNone);
+	TRequestStatus status;
+	manager.RequestDomainTransition(KDmIdRoot, EPwActive, status);
+	test(status.Int() == KRequestPending);
+	User::WaitForRequest(status);
+	test(status.Int() == KErrNone);
+	manager.Close();
+	
+	r = manager.Connect(KDmHierarchyIdTest);
+	test (r == KErrNone);
+	manager.RequestDomainTransition(KDmIdRoot, EStartupCriticalStatic, ETraverseDefault, status);
+	test(status.Int() == KRequestPending);
+	User::WaitForRequest(status);
+	test(status.Int() == KErrNone);
+	manager.Close();
+	}
+
+ 	__UHEAP_MARKEND;
+	}
+
+// This handles a transition notification from either a power domain member or 
+// a test domain member.
+// Verifies that the domain state is as expected.
+// Updates the number of notifications for each hierarchy and verifies that all parent 
+// domains have transitioned already (for parent-to-child transitions) or that all child 
+// domains have been transitioned already (for child-to-parent transitions).
+
+TInt CDmTest5::TransitionNotification(MDmDomainMember& aDomainMember)
+	{
+	if (aDomainMember.HierarchyId() == KDmHierarchyIdPower)
+		iPowerNotifications++;
+	else
+		iTestNotifications++;
+
+	if (aDomainMember.HierarchyId() == KDmHierarchyIdPower)
+		{
+		__PRINT((_L("CDmTest5::TransitionNotification(), Hierarchy = %d, iOrdinal = 0x%08X, state = 0x%x, status = %d\n"), 
+			aDomainMember.HierarchyId(), aDomainMember.Ordinal(), aDomainMember.State(), aDomainMember.Status()));
+		test(aDomainMember.State() == iPowerState);
+		}
+	else if (aDomainMember.HierarchyId() == KDmHierarchyIdTest)
+		{
+		TBuf16<4> buf;
+		GetDomainDesc(aDomainMember.Ordinal(), buf);
+
+		__PRINT((_L("CDmTest5::TransitionNotification(), Hierarchy = %d, domain = %S, iOrdinal = 0x%08X, state = 0x%x, status = %d\n"), 
+			aDomainMember.HierarchyId(), &buf, aDomainMember.Ordinal(), aDomainMember.State(), aDomainMember.Status()));
+		test(aDomainMember.State() == iTestState);
+		}
+	else
+		{
+		test(0);
+		}
+
+	// if we're going from parent to child, 
+	// check that each parent domain has received a notification already
+	// if not, check that each child domain has received a notification already
+
+	CDmTestMember** mp;
+
+	if (aDomainMember.HierarchyId() == KDmHierarchyIdTest && iAckMode == KAckAlways)
+		{
+
+		if (iTraverseDirection == ETraverseParentsFirst)
+			{
+			TUint ordThis = aDomainMember.Ordinal();
+			TUint ordParent = PARENT_ORDINAL(ordThis);
+
+			TInt levelParent = ORDINAL_LEVEL(ordParent);
+
+			TBuf16<4> buf;
+			GetDomainDesc(ordParent, buf);
+			if (levelParent >= iTestDomainLevel)
+				{
+				__PRINT((_L("Searching for parent domain = %S, ordinal = %08X \n"), &buf, ordParent));
+				for (mp = iTestMembers; *mp; ++mp)
+					{
+					if ((*mp)->Ordinal() == ordParent)
+						{
+						TBuf16<4> buf;
+						GetDomainDesc((*mp)->Ordinal(), buf);
+						__PRINT((_L("Found parent (%S). notification = %d\n"), &buf, (*mp)->Notifications()));
+						test ((*mp)->Notifications() == aDomainMember.Notifications());
+						break;
+						}
+					}
+				}
+			}
+		else
+			{
+			__PRINT((_L("Searching for children\n")));
+			for (mp = iTestMembers; *mp; ++mp)
+				{
+
+				TUint ordParent = PARENT_ORDINAL((*mp)->Ordinal());
+				if (ordParent == aDomainMember.Ordinal())
+					{
+					TBuf16<4> buf;
+					GetDomainDesc((*mp)->Ordinal(), buf);
+					__PRINT((_L("Found child (%S). notification = %d\n"), &buf, (*mp)->Notifications()));
+					test ((*mp)->Notifications() == aDomainMember.Notifications());
+					}
+				}
+			}
+		}
+
+	TInt ackError;
+	switch (iAckMode)
+		{
+		case KAckNever:
+			ackError = KErrAbort;
+			break;
+		case KAckError:		// return an error to the DM
+			ackError = KErrGeneral;
+			break;
+		case KAckOddDomainsOnly:
+			ackError = (aDomainMember.DomainId() & 1)?KErrNone:KErrAbort;
+			break;
+		case KAckAlways:
+		default:
+			ackError = KErrNone;
+			break;
+		}
+	return ackError;
+	}
+
+void CDmTest5::RunL()
+	{
+	iTransitionsCompleted++;
+
+	__PRINT((_L("CDmTest5::RunL(), error = %d, iTestNotifications %d, iPowerNotifications %d\n"), 
+		iStatus.Int(), iTestNotifications , iPowerNotifications));
+
+	if (iTransitionsCompleted == iTransitionsExpected)
+		CActiveScheduler::Stop();
+	}
+
+void CDmTest5::TransitionRequestComplete()
+	{
+	iTransitionsCompleted++;
+
+	__PRINT((_L("CDmTest5::TransitionRequestComplete(), error = %d, iTestNotifications %d, iPowerNotifications %d\n"), 
+		iStatus.Int(), iTestNotifications , iPowerNotifications));
+	
+	if (iTransitionsCompleted == iTransitionsExpected)
+		CActiveScheduler::Stop();
+	}
+
+void CDmTest5::DoCancel()
+	{
+	test(0);
+	}
+
+void CDmTest5::Release()
+	{
+	delete this;
+	}
+
+const TInt KMembersMax = 16;
+
+// Negative testing 
+class CDmTest6 : public CActive, public MDmTest
+	{
+public:
+	enum 
+	{
+	ENegTestTransitionNoConnect,
+	ENegTestGetStateNoConnect,
+	ENegTestTransitionInvalidMode
+	};
+
+	class TData 
+		{
+	public:
+		inline TData(TInt aTest) : iTest(aTest){};
+		TInt iTest;
+		};
+
+public: 
+	// from CActive
+	void RunL();
+ 
+	// from MDmTest
+	void Perform();
+	void Release();
+	TInt TransitionNotification(MDmDomainMember& aDomainMember);
+	void TransitionRequestComplete();
+
+
+	CDmTest6() : CActive(CActive::EPriorityStandard) {}
+
+protected:
+	// from CActive
+	virtual void DoCancel();
+
+private:
+	static TInt PanicThreadFunc(TAny* aData);
+	void PanicTest(TInt aTestNumber);
+
+
+	CDomainMemberAo*	iTestMembers[KMembersMax]; 
+	CDomainManagerAo*	iTestDomainManager;
+	
+	TDmDomainId			iTestDomainId;
+	TDmDomainState		iTestState;
+
+public:
+	TInt				iTestNotifications;
+	TInt				iTestNotificationsExpected;
+
+	TInt				iTransitionsCompleted;
+	TInt				iTransitionsExpected;
+	};
+
+TInt CDmTest6::PanicThreadFunc(TAny* aData)
+	{
+	const TData* data = (const TData*)aData;
+	switch (data->iTest)
+		{
+		case ENegTestTransitionNoConnect:
+			{
+			// request a transition notification without connecting first (should panic)
+			RDmDomain domainMember;
+			TRequestStatus status;
+			User::SetJustInTime(EFalse);
+			domainMember.RequestTransitionNotification(status);
+			}
+			break;
+		case ENegTestGetStateNoConnect:
+			{
+			// Get the domain state without connecting (should panic)
+			RDmDomain domainMember;
+			User::SetJustInTime(EFalse);
+			domainMember.GetState();
+			}
+			break;
+		case ENegTestTransitionInvalidMode:
+			{
+			RDmDomainManager manager;
+			TRequestStatus status;
+			TInt r = manager.Connect(KDmHierarchyIdTest);
+			test(r == KErrNone);
+
+			User::SetJustInTime(EFalse);
+			manager.RequestDomainTransition(KDmIdRoot, 0, TDmTraverseDirection(-1), status);
+			}
+			break;
+		default:
+			break;
+		}
+	return KErrNone;
+	}
+
+void CDmTest6::PanicTest(TInt aTestNumber)
+	{
+	test.Printf(_L("panic test number %d\n"), aTestNumber);
+
+	TBool jit = User::JustInTime();
+
+	TData data(aTestNumber);
+
+	TInt KHeapSize=0x2000;
+
+	RThread thread;
+	TInt ret = thread.Create(KThreadName, PanicThreadFunc, KDefaultStackSize, KHeapSize, KHeapSize, &data);
+	test(KErrNone == ret);
+	TRequestStatus stat;
+	thread.Logon(stat);
+	thread.Resume();
+	User::WaitForRequest(stat);
+
+	User::SetJustInTime(jit);
+
+	// The thread must panic
+	test(thread.ExitType() == EExitPanic);
+	TInt exitReason = thread.ExitReason();
+	test.Printf(_L("panic test exit reason = %d\n"), exitReason);
+
+	switch(aTestNumber)
+		{
+		case ENegTestTransitionNoConnect:
+			test (exitReason == EBadHandle);
+			break;
+		case ENegTestGetStateNoConnect:
+			test (exitReason == EBadHandle);
+			break;
+		case ENegTestTransitionInvalidMode:
+			break;
+		default:
+			break;
+		}
+
+	CLOSE_AND_WAIT(thread);
+	}
+
+
+//! @SYMTestCaseID PBASE-T_DOMAIN-6
+//! @SYMTestType CT
+//! @SYMTestCaseDesc Negative testing
+//! @SYMPREQ 810
+//! @SYMTestActions Various negative tests
+//! @SYMTestExpectedResults  All tests should pass
+//! @SYMTestPriority High
+//! @SYMTestStatus Defined
+void CDmTest6::Perform()
+	{
+
+ 	__UHEAP_MARK;
+
+	CActiveScheduler::Add(this);
+
+	CDomainManagerAo* iTestDomainManager = NULL;
+	TRAP_IGNORE(iTestDomainManager = CDomainManagerAo::NewL(KDmHierarchyIdTest, *this));
+	test (iTestDomainManager != NULL);
+
+	TInt r = CDomainManagerAo::AddDomainHierarchy(KDmHierarchyIdTest);
+	test(r == KErrNone);
+
+	//*************************************************
+	// Test 6a - Connect to the same hierarchy twice
+	//*************************************************
+	test.Next(_L("Test 6a - Connect to the same hierarchy twice"));
+
+	// verify that we can't connect to the same hierarchy more than once
+	CDomainManagerAo* testDomainManager = NULL;
+	TRAP(r, testDomainManager = CDomainManagerAo::NewL(KDmHierarchyIdTest, *this));
+	test(r == KErrInUse);
+	test (testDomainManager == NULL);
+
+
+	TInt testMemberCount = 0;
+
+	// Add some test hierarchy members
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	
+	// row 1
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestA, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestB, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestB), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestC, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestC), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	
+	// row2
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestAA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestAB, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAB), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestBA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestB, KDmIdTestBA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestCA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestC, KDmIdTestCA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	
+	// row 3
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestABA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestABB, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABB), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestCAA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestC, KDmIdTestCA, KDmIdTestCAA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+
+
+	//*************************************************
+	// Test 6b change to current state
+	//*************************************************
+	test.Next(_L("Test 6b change to current state"));
+	iTestState =  EStartupCriticalStatic;
+	iTestDomainId = KDmIdRoot;
+
+	iTransitionsCompleted = iTestNotifications = 0;
+	iTestNotificationsExpected = testMemberCount;
+	iTransitionsExpected = 1;
+
+	// request a domain transition
+	iTestDomainManager->RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault);
+
+	// wait for test transitions to complete
+	CActiveScheduler::Start();
+	test(iStatus == KErrNone);
+	test(iTestNotifications == iTestNotificationsExpected);
+	
+
+	// cancel a member notification request 
+	//*************************************************
+	// Test 6c cancel a member notification request
+	//*************************************************
+	test.Next(_L("Test 6c cancel a member notification request"));
+	RDmDomain domainMember;
+	TRequestStatus status;
+	domainMember.Connect(KDmHierarchyIdTest, iTestDomainId);
+	domainMember.RequestTransitionNotification(status);
+	domainMember.CancelTransitionNotification();
+	User::WaitForRequest(status);
+	domainMember.Close();
+
+	//*************************************************
+	// Test 6d cancel a member notification request without having first requested a notification
+	//*************************************************
+	test.Next(_L("Test 6d cancel a member notification request without having first requested a notification"));
+	domainMember.Connect(KDmHierarchyIdTest, iTestDomainId);
+	domainMember.CancelTransitionNotification();
+	domainMember.Close();
+
+	//*************************************************
+	// Test 6e domain controller adds invalid hierarchy
+	//*************************************************
+	test.Next(_L("Test 6e domain controller connects to invalid hierarchy"));
+	r = RDmDomainManager::AddDomainHierarchy(TDmHierarchyId(-1));
+	test(r == KErrBadHierarchyId);
+
+	//*************************************************
+	// Test 6f domain member connects to invalid hierarchy
+	//*************************************************
+	test.Next(_L("Test 6f domain member connects to invalid hierarchy"));
+	r = domainMember.Connect(TDmHierarchyId(-1), TDmDomainId(KDmIdRoot));
+	test (r == KErrBadHierarchyId);
+
+	//*************************************************
+	// Test 6g domain member connects to valid hierarchy but invalid domain
+	//*************************************************
+	test.Next(_L("Test 6g domain member connects to valid hierarchy but invalid domain"));
+	r = domainMember.Connect(KDmHierarchyIdTest, TDmDomainId(-1));
+	test (r == KDmErrBadDomainId);
+
+	delete iTestDomainManager;
+	iTestDomainManager = NULL;
+
+	// Panic tests
+
+	//*************************************************
+	// Test 6h request a transition notification without connecting first
+	//*************************************************
+	test.Next(_L("Test 6h request a transition notification without connecting first"));
+	PanicTest(ENegTestTransitionNoConnect);
+
+	//*************************************************
+	// Test 6i Get the domain state without connecting
+	//*************************************************
+	test.Next(_L("Test 6i Get the domain state without connecting"));
+	PanicTest(ENegTestGetStateNoConnect);
+
+	//*************************************************
+	// Test 6j request a transition notification with an invalid transition mode
+	//*************************************************
+	test.Next(_L("Test 6j request a transition notification with an invalid transition mode"));
+	PanicTest(ENegTestTransitionInvalidMode);
+
+
+	// cleanup
+
+	CDomainMemberAo** mt;
+	for (mt = iTestMembers; *mt; ++mt)
+		delete *mt;
+
+ 	__UHEAP_MARKEND;
+	}
+
+// This handles a transition notification from a test domain member.
+TInt CDmTest6::TransitionNotification(MDmDomainMember& aDomainMember)
+	{
+	TInt status = aDomainMember.Status();
+		
+	iTestNotifications++;
+
+	test (aDomainMember.HierarchyId() == KDmHierarchyIdTest);
+
+	TBuf16<4> buf;
+	GetDomainDesc(aDomainMember.Ordinal(), buf);
+
+	test.Printf(_L("CDmTest6::TransitionNotification(), Hierarchy = %d, domain = %S, iOrdinal = 0x%08X, state = 0x%x, status = %d\n"), 
+		aDomainMember.HierarchyId(), &buf, aDomainMember.Ordinal(), aDomainMember.State(), status);
+
+
+	return KErrNone;
+	}
+
+void CDmTest6::RunL()
+	{
+	iTransitionsCompleted++;
+
+	TInt error = iStatus.Int();
+
+	test.Printf(_L("CDmTest6::RunL(), error = %d, iTestNotifications %d\n"), 
+		error, iTestNotifications);
+
+	if (iTransitionsCompleted == iTransitionsExpected)
+		CActiveScheduler::Stop();
+	}
+
+void CDmTest6::TransitionRequestComplete()
+	{
+	iTransitionsCompleted++;
+
+	TInt error = iStatus.Int();
+	
+	test.Printf(_L("CDmTest6::TransitionRequestComplete(), error = %d, iTestNotifications %d\n"), 
+		error, iTestNotifications);
+	
+	if (iTransitionsCompleted == iTransitionsExpected)
+		CActiveScheduler::Stop();
+	}
+
+void CDmTest6::DoCancel()
+	{
+	test(0);
+	}
+
+void CDmTest6::Release()
+	{
+	delete this;
+	}
+
+// Transition progress Observer testing
+class CDmTest7 : public CActive, public MDmTest, public MHierarchyObserver
+	{
+public: 
+	// from CActive
+	void RunL();
+ 
+	// from MDmTest
+	void Perform();
+	void Release();
+	TInt TransitionNotification(MDmDomainMember& aDomainMember);
+	void TransitionRequestComplete();
+
+	// from MHierarchyObserver
+	virtual void TransProgEvent(TDmDomainId aDomainId, TDmDomainState aState);
+	virtual void TransFailEvent(TDmDomainId aDomainId, TDmDomainState aState, TInt aError);
+	virtual void TransReqEvent(TDmDomainId aDomainId, TDmDomainState aState);
+
+
+
+	CDmTest7(TDmDomainId aDomainId) : CActive(CActive::EPriorityStandard), iObservedDomainId(aDomainId) {}
+
+protected:
+	// from CActive
+	virtual void DoCancel();
+
+private:
+	void TestForCompletion();
+
+
+private:
+
+	enum { KMembersMax = 16 };
+
+	CDomainMemberAo*	iTestMembers[KMembersMax]; 
+	CDomainManagerAo*	iTestDomainManager;
+	
+	TDmDomainId			iTestDomainId;
+	TDmDomainState		iTestState;
+	TDmDomainId			iObservedDomainId;
+
+public:
+	TInt				iTestNotifications;
+	TInt				iTestNotificationsExpected;
+
+	TInt				iTransitionsCompleted;
+	TInt				iTransitionsExpected;
+
+	TInt				iTransProgEvents;
+	TInt				iTransFailEvents;
+	TInt				iTransReqEvents;
+
+	TInt				iTransProgEventsExpected;
+	TInt				iTransFailEventsExpected;
+	TInt				iTransReqEventsExpected;
+	};
+
+//! @SYMTestCaseID PBASE-T_DOMAIN-7
+//! @SYMTestType CT
+//! @SYMTestCaseDesc Transition progress Observer testing
+//! @SYMREQ REQ3723
+//! @SYMTestActions Various negative tests
+//! @SYMTestExpectedResults  All tests should pass
+//! @SYMTestPriority High
+//! @SYMTestStatus Defined
+void CDmTest7::Perform()
+	{
+
+ 	__UHEAP_MARK;
+
+	//
+	// Test domain transitions with activated observer
+	//
+	CActiveScheduler::Add(this);
+
+	TInt r = RDmDomainManager::AddDomainHierarchy(KDmHierarchyIdTest);
+	test(r == KErrNone);
+
+	CDomainManagerAo* iTestDomainManager = NULL;
+	TRAP_IGNORE(iTestDomainManager = CDomainManagerAo::NewL(KDmHierarchyIdTest, *this));
+	test (iTestDomainManager != NULL);
+
+	r = CDomainManagerAo::AddDomainHierarchy(KDmHierarchyIdTest);
+	test(r == KErrNone);
+
+	//*************************************************
+	// Test 7a - Testing observer notifications
+	//*************************************************
+	
+	test.Next(_L("Test 7a - Testing observer notifications"));
+
+	TInt testMemberCount = 0;
+
+	// Add some test hierarchy members
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	
+	// row 1
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestA, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestB, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestB), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestC, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestC), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	
+	// row2
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestAA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestAB, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAB), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestBA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestB, KDmIdTestBA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestCA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestC, KDmIdTestCA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	
+	// row 3
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestABA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestABB, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABB), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestCAA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestC, KDmIdTestCA, KDmIdTestCAA), this));
+	test(iTestMembers[testMemberCount++] != NULL);
+
+	// create an observer
+	CHierarchyObserver* observer = NULL;
+	TRAP(r, observer = CHierarchyObserver::NewL(*this, KDmHierarchyIdTest));
+	test (r == KErrNone);
+	test(observer != NULL);
+	observer->StartObserver(iObservedDomainId, EDmNotifyAll);
+	
+	// request a state change
+	iTestState =  EStartupCriticalDynamic;
+	iTestDomainId = KDmIdRoot;
+	iTransitionsCompleted = iTestNotifications = 0;
+	iTestNotificationsExpected = testMemberCount;
+	iTransitionsExpected = 1;
+
+	iTransProgEvents = iTransFailEvents = iTransReqEvents = 0;
+	
+	iTransReqEventsExpected = iTransProgEventsExpected = observer->ObserverDomainCount();
+	iTransFailEventsExpected = 0;
+
+
+	iTestDomainManager->RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault);
+
+	// wait for test transitions to complete
+	CActiveScheduler::Start();
+	test(iStatus == KErrNone);
+	test(iTestNotifications == iTestNotificationsExpected);
+	test (iTransProgEvents == iTransProgEventsExpected);
+	test (iTransFailEvents == iTransFailEventsExpected);
+	test (iTransReqEvents == iTransReqEventsExpected);
+
+
+	// cleanup
+	delete observer; 
+	observer = NULL;
+
+	//*************************************************
+	// Test 7b - start & stop the observer
+	//*************************************************
+	test.Next(_L("Test 7b - start & stop the observer"));
+
+	// create an observer, start it stop and then start it again
+	TRAP(r, observer = CHierarchyObserver::NewL(*this, KDmHierarchyIdTest));
+	test (r == KErrNone);
+	test(observer != NULL);
+	observer->StartObserver(iObservedDomainId, EDmNotifyAll);
+	observer->StopObserver();
+	observer->StartObserver(iObservedDomainId, EDmNotifyAll);
+
+	// request a state change
+	iTestState++;
+	iTestDomainId = KDmIdRoot;
+	iTransitionsCompleted = iTestNotifications = 0;
+	iTestNotificationsExpected = testMemberCount;
+	iTransitionsExpected = 1;
+
+	iTransProgEvents = iTransFailEvents = iTransReqEvents = 0;
+	
+	iTransProgEventsExpected = iTransReqEventsExpected = observer->ObserverDomainCount();
+	iTransFailEventsExpected = 0;
+
+	iTestDomainManager->RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault);
+
+	// wait for test transitions to complete
+	CActiveScheduler::Start();
+	test(iStatus == KErrNone);
+	test(iTestNotifications == iTestNotificationsExpected);
+	test (iTransProgEvents == iTransProgEventsExpected);
+	test (iTransFailEvents == iTransFailEventsExpected);
+	test (iTransReqEvents == iTransReqEventsExpected);
+
+	// stop the observer & request another state change
+	observer->StopObserver();
+	iTestState++;
+	iTestDomainId = KDmIdRoot;
+	iTransitionsCompleted = iTestNotifications = 0;
+	iTestNotificationsExpected = testMemberCount;
+	iTransitionsExpected = 1;
+
+	iTransProgEvents = iTransFailEvents = iTransReqEvents = 0;
+	
+	iTransProgEventsExpected = 0;
+	iTransFailEventsExpected = 0;
+	iTransReqEventsExpected = 0;
+
+	iTestDomainManager->RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault);
+	// wait for test transitions to complete
+	CActiveScheduler::Start();
+	test(iStatus == KErrNone);
+	test(iTestNotifications == iTestNotificationsExpected);
+	test (iTransProgEvents == iTransProgEventsExpected);
+	test (iTransFailEvents == iTransFailEventsExpected);
+	test (iTransReqEvents == iTransReqEventsExpected);
+
+	// Start the observer again on a different domain and only ask for transition requests
+	// Then request another state change
+	observer->StartObserver((iObservedDomainId == KDmIdRoot)?KDmIdTestCA:KDmIdRoot, EDmNotifyTransRequest);
+	iTestState++;
+	iTestDomainId = KDmIdRoot;
+	iTransitionsCompleted = iTestNotifications = 0;
+	iTestNotificationsExpected = testMemberCount;
+	iTransitionsExpected = 1;
+
+	iTransProgEvents = iTransFailEvents = iTransReqEvents = 0;
+	
+	iTransReqEventsExpected = observer->ObserverDomainCount();
+	iTransProgEventsExpected = 0;
+	iTransFailEventsExpected = 0;
+
+
+	iTestDomainManager->RequestDomainTransition(iTestDomainId, iTestState, ETraverseDefault);
+	// wait for test transitions to complete
+	CActiveScheduler::Start();
+	test(iStatus == KErrNone);
+	test(iTestNotifications == iTestNotificationsExpected);
+	test (iTransProgEvents == iTransProgEventsExpected);
+	test (iTransFailEvents == iTransFailEventsExpected);
+	test (iTransReqEvents == iTransReqEventsExpected);
+
+	delete observer; 
+	observer = NULL;
+
+	//*************************************************
+	// Test 7c - invalid arguments testing for observer
+	//*************************************************
+	test.Next(_L("Test 7c - Invalid arguments testing for observer"));
+	
+	const TDmHierarchyId	KDmHierarchyIdInvalid = 110;
+	
+	test.Printf(_L("Test 7c.1 - create observer with invalid hierarchy Id\n"));
+	
+	// create an observer
+	TRAP(r, observer = CHierarchyObserver::NewL(*this, KDmHierarchyIdInvalid));
+	test (r == KErrBadHierarchyId);
+	
+	
+	test.Printf(_L("Test 7c.2 - Starting the observer with wrong domain Id\n"));
+	TRAP(r, observer = CHierarchyObserver::NewL(*this, KDmHierarchyIdTest));
+	test (r == KErrNone);
+	test(observer != NULL);
+
+	//Wrong domain Id
+	const TDmDomainId	KDmIdInvalid	= 0x0f;
+	r= observer->StartObserver(KDmIdInvalid, EDmNotifyAll);
+	test(r==KDmErrBadDomainId);
+
+	test.Printf(_L("Test 7c.3 - Trying to create second observer on the same hierarchy\n"));
+	TRAP(r, CHierarchyObserver::NewL(*this, KDmHierarchyIdTest));
+	test (r == KDmErrBadSequence);
+
+	
+	
+	//*************************************************
+	// Test 7d - Wrong sequence of API calls for observer
+	//*************************************************
+	test.Next(_L("Test 7d - Observer wrong sequence of calls"));
+	
+	test.Printf(_L("Test 7d.1 - Stopping Observer before starting it\n"));
+	r = observer->StopObserver();
+	test(r==KDmErrBadSequence);
+	
+	test.Printf(_L("Test 7d.2 - Starting Observer twice\n"));
+	r= observer->StartObserver(KDmIdRoot, EDmNotifyAll);
+	test(r==KErrNone);
+
+	r= observer->StartObserver(KDmIdRoot, EDmNotifyAll);
+	test(r==KDmErrBadSequence);
+
+	
+	delete observer;
+
+	/***************************************/
+
+	delete iTestDomainManager;
+	iTestDomainManager = NULL;
+
+	CDomainMemberAo** mt;
+	for (mt = iTestMembers; *mt; ++mt)
+		delete *mt;
+
+
+	// restore the domain hierarchies to their initial state so as not to 
+	// upset any subsequent tests which rely on this
+	{
+	RDmDomainManager manager;
+	TRequestStatus status;
+	TInt r = manager.Connect(KDmHierarchyIdTest);
+	test (r == KErrNone);
+	manager.RequestDomainTransition(KDmIdRoot, EStartupCriticalStatic, ETraverseDefault, status);
+	test(status.Int() == KRequestPending);
+	User::WaitForRequest(status);
+	test(status.Int() == KErrNone);
+	manager.Close();
+	}
+
+ 	__UHEAP_MARKEND;
+	}
+
+// This handles a transition notification from a test domain member.
+TInt CDmTest7::TransitionNotification(MDmDomainMember& aDomainMember)
+	{
+		
+	iTestNotifications++;
+
+	test (aDomainMember.HierarchyId() == KDmHierarchyIdTest);
+
+	TBuf16<4> buf;
+	GetDomainDesc(aDomainMember.Ordinal(), buf);
+
+	__PRINT((_L("CDmTest7::TransitionNotification(), Hierarchy = %d, domain = %S, iOrdinal = 0x%08X, state = 0x%x, status = %d\n"), 
+		aDomainMember.HierarchyId(), &buf, aDomainMember.Ordinal(), aDomainMember.State(), aDomainMember.Status()));
+
+	return KErrNone;
+	}
+
+void CDmTest7::RunL()
+	{
+	iTransitionsCompleted++;
+
+	__PRINT((_L("CDmTest7::RunL(), error = %d, iTestNotifications %d\n"), 
+		iStatus.Int(), iTestNotifications));
+
+	TestForCompletion();
+	}
+
+void CDmTest7::TransitionRequestComplete()
+	{
+	iTransitionsCompleted++;
+
+	__PRINT((_L("CDmTest7::TransitionRequestComplete(), error = %d, iTestNotifications %d\n"), 
+		iStatus.Int(), iTestNotifications));
+	
+	TestForCompletion();
+	}
+
+void CDmTest7::DoCancel()
+	{
+	test(0);
+	}
+
+void CDmTest7::Release()
+	{
+	delete this;
+	}
+
+void CDmTest7::TestForCompletion()
+	{
+
+	if (iTransitionsCompleted == iTransitionsExpected &&
+		iTransProgEvents == iTransProgEventsExpected && 
+		iTransFailEvents == iTransFailEventsExpected &&
+		iTransReqEvents == iTransReqEventsExpected)
+		{
+		CActiveScheduler::Stop();
+		}
+	}
+
+#ifdef _DEBUG
+void CDmTest7::TransProgEvent(TDmDomainId aDomainId, TDmDomainState aState)
+#else
+void CDmTest7::TransProgEvent(TDmDomainId /*aDomainId*/, TDmDomainState /*aState*/)
+#endif
+	{
+	iTransProgEvents++;
+	__PRINT((_L("CDmTest7::TransProgEvent(), aDomainId = %d, aState %d, iTransProgEvents %d\n"), 
+		aDomainId, aState, iTransProgEvents));
+	TestForCompletion();
+	}
+
+#ifdef _DEBUG
+void CDmTest7::TransFailEvent(TDmDomainId aDomainId, TDmDomainState aState, TInt aError)
+#else
+void CDmTest7::TransFailEvent(TDmDomainId /*aDomainId*/, TDmDomainState /*aState*/, TInt /*aError*/)
+#endif
+
+	{
+	iTransFailEvents++;
+	__PRINT((_L("CDmTest7::TransFailEvent(), aDomainId = %d, aState %d aError %d, iTransFailEvents %d\n"), 
+		aDomainId, aState, iTransFailEvents, aError));
+	TestForCompletion();
+	}
+
+#ifdef _DEBUG
+void CDmTest7::TransReqEvent(TDmDomainId aDomainId, TDmDomainState aState)
+#else
+void CDmTest7::TransReqEvent(TDmDomainId /*aDomainId*/, TDmDomainState /*aState*/)
+#endif
+	{
+	iTransReqEvents++;
+	__PRINT((_L("CDmTest7::TransReqEvent(), aDomainId = %d, aState %d, iTransReqEvents %d\n"), 
+		aDomainId, aState, iTransReqEvents));
+	TestForCompletion();
+	}
+
+GLDEF_C TInt E32Main()
+	{
+	CTrapCleanup* trapHandler=CTrapCleanup::New();
+	test(trapHandler!=NULL);
+
+	CActiveScheduler* scheduler = new CActiveScheduler();
+	test(scheduler != NULL);
+	CActiveScheduler::Install(scheduler);
+
+	// Turn off evil lazy dll unloading
+	RLoader l;
+	test(l.Connect()==KErrNone);
+	test(l.CancelLazyDllUnload()==KErrNone);
+	l.Close();
+
+	//
+	// Perform the number of iterations specifed by the command line argument.
+	//
+	// If no arguments - perform two iterations
+	//
+//  TInt iter = 2;
+    TInt iter = 1;
+
+	TInt len = User::CommandLineLength();
+	if (len)
+		{
+		// Copy the command line in a buffer
+		HBufC* hb = HBufC::NewMax(len);
+		test(hb != NULL);
+		TPtr cmd((TUint16*) hb->Ptr(), len);
+		User::CommandLine(cmd);
+		// Extract the number of iterations
+		TLex l(cmd);
+		TInt i;
+		TInt r = l.Val(i);
+		if (r == KErrNone)
+			iter = i;
+		else
+			// strange command - silently ignore
+			{} 
+		delete hb;
+		}
+
+	test.Title();
+	test.Start(_L("Testing"));
+
+	test.Printf(_L("Go for %d iterations\n"), iter);
+
+	// Remember the number of open handles. Just for a sanity check ....
+	TInt start_thc, start_phc;
+	RThread().HandleCount(start_phc, start_thc);
+
+	while (iter--)
+		{
+		MDmTest* tests[] = 
+			{
+			new CDmTest1(KDmIdRoot, EPwStandby),
+			new CDmTest1(KDmIdRoot, EPwOff),
+			new CDmTest1(KDmIdRoot, EPwActive),
+			new CDmTest1(KDmIdApps, EPwStandby),
+			new CDmTest1(KDmIdApps, EPwOff),
+			new CDmTest1(KDmIdApps, EPwActive),
+			new CDmTest1(KDmIdUiApps, EPwStandby),
+			new CDmTest1(KDmIdUiApps, EPwOff),
+			new CDmTest1(KDmIdUiApps, EPwActive),
+			new CDmTest2(EPwStandby),
+			new CDmTest3(),
+	
+			// platform security tests
+			new CDmTest4(),
+
+			// PREQ810 tests :
+			// note that we use a fictitious power state to prevent any 
+			new CDmTest5(KDmIdRoot, KDmIdRoot, EPwActive+10, EStartupCriticalDynamic),
+			new CDmTest5(KDmIdUiApps, KDmIdTestAB, EPwActive+10, EStartupCriticalDynamic),
+
+        // negative tests
+			new CDmTest6(),
+
+
+			// observer tests
+     		new CDmTest7(KDmIdTestA),
+			new CDmTest7(KDmIdRoot),
+			
+			};
+
+		for (unsigned int i = 0; i < sizeof(tests)/sizeof(*tests); ++i)
+			{
+			test(tests[i] != NULL);
+			tests[i]->Perform();
+			tests[i]->Release();
+			}
+
+		}
+
+	test.End();
+
+	// Sanity check for open handles and for pending requests ...
+	TInt end_thc, end_phc;
+	RThread().HandleCount(end_phc, end_thc);
+	test(start_thc == end_thc);
+	test(start_phc == end_phc);
+	test(RThread().RequestCount() >= 0);
+
+	delete scheduler;
+	delete trapHandler;
+
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/power/t_domain_slave.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,140 @@
+// 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:
+// e32test\power\t_domain_slave.cpp
+// 
+//
+
+#include <e32power.h>
+#include <e32test.h>
+#include <domainmember.h>
+#include <domainmanager.h>
+#include <e32panic.h>
+#include <e32debug.h>
+
+LOCAL_D RTest test(_L(" T_DOMAIN_SLAVE "));
+
+// This will be run in its own thread as part of test #1. It should get killed when trying to connect 
+// to the manager without appropriate caps set
+TInt IncorrectClient(TAny*)
+{
+    	RDmDomain domain;
+		TInt r = domain.Connect(KDmIdRoot);
+
+		RDmDomainManager manager;
+		r = manager.Connect();
+
+        return(r);
+}
+
+GLDEF_C TInt E32Main()
+	{
+	test.Title();
+	test.Start(_L("Testing"));
+
+//	test.Next(_L("test security"));
+
+	// Get arguments from the command line
+	TInt len = User::CommandLineLength();
+	test (len);
+	TInt size = len * sizeof(TUint16);
+	test (size == sizeof(TInt));
+	TInt arg;
+	TPtr cmd((TUint16*) &arg, len);
+	User::CommandLine(cmd);
+
+	TInt expected_result = PlatSec::IsCapabilityEnforced(ECapabilityPowerMgmt) ? KErrPermissionDenied : KErrNone;
+
+	switch(arg)
+		{
+	case 0:
+		{
+        // This is the original t_domain_slave test, minus the panicking parts which now get
+        // tested as case 1.
+
+        test.Next(_L("test security -- 0"));       
+
+		RDmDomain domain;
+		TInt r = domain.Connect(KDmIdRoot);
+		test (r == expected_result);
+
+		break;
+		}
+    case 1:
+        {
+
+        test.Next(_L("test security -- 1")); 
+        
+        TBool jit = User::JustInTime();
+
+        User::SetJustInTime(EFalse);
+
+        _LIT(KPanicThread, "PanicThread");
+
+        RThread testThread;
+
+        TInt tt=testThread.Create(KPanicThread, IncorrectClient, KDefaultStackSize, 
+            NULL, NULL);
+
+        test (KErrNone == tt);
+
+        TRequestStatus tStatus;
+  //      testThread.Logon(tStatus);
+
+        RUndertaker deathChecker;
+        TInt dcOK = deathChecker.Create();
+
+        test (KErrNone == dcOK);
+
+        TInt nextDeadThread;
+
+        deathChecker.Logon(tStatus, nextDeadThread);
+
+        // threads are created in a suspended state. calling resume here starts the thread.
+        testThread.Resume();
+        User::WaitForRequest(tStatus);
+
+        // If thread suicided for the correct reason --> successful test
+        // NB. KErrPermissionDenied means that the server refused the 
+        // connection because of incorrect capabilities
+
+        RThread corpse;
+        corpse.SetHandle(nextDeadThread);
+
+        RDebug::Printf("Subthread exit type: %d", corpse.ExitType() );
+
+        RDebug::Printf("Subthread exit reason: %d",corpse.ExitReason() );
+
+        test (corpse.ExitType() == EExitKill);
+
+        test (corpse.ExitReason() == KErrPermissionDenied);
+
+        corpse.Close();
+  
+        // close the RUndertaker and test thread
+        deathChecker.Close();
+		CLOSE_AND_WAIT(testThread);
+
+        User::SetJustInTime(jit);
+
+		break;
+        }
+	default:
+		User::Panic(_L("USER"), EInvariantFalse);
+		break;
+		}
+
+	test.End();
+
+	return KErrNone;
+	}
--- a/kerneltest/e32test/power/t_frqchg.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,775 +0,0 @@
-// Copyright (c) 2010-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:
-// e32test\power\t_frqchg.cpp
-//
-//
-
-#define __E32TEST_EXTENSION__
-#include <e32test.h>
-#include <e32math.h>
-#include <e32atomics.h>
-#include <hal.h>
-#include "d_frqchg.h"
-#include <e32svr.h>
-#include "u32std.h"
-
-RFrqChg Driver;
-RTest test(_L("T_FRQCHG"));
-
-// test will fail if slice is > (expected+KSliceDeltaPercent%of expexted) 
-// or < (expected-KSliceDeltaPercent%expected)
-const TInt KSliceDeltaPercent = 5;   
-// test will fail for global timer based timestamps if interval measured 
-// is > (expected+KTimeStampDeltaPercent%of expexted) 
-// or < (expected-KTimeStampDeltaPercent%expected)
-const TInt KTimeStampDeltaPercent = 5;
-
-TInt RealToRatio(SRatio& aRatio, const TRealX& aReal)
-	{
-	aRatio.iSpare1 = 0;
-	aRatio.iSpare2 = 0;
-	if (aReal.iSign || aReal.IsZero() || aReal.IsNaN())
-		{
-		aRatio.iM = 0;
-		aRatio.iX = 0;
-		return (aReal.IsZero()) ? KErrNone : KErrNotSupported;
-		}
-	TRealX rx(aReal);
-	TRealX rr(rx);
-	rr.iExp -= 32;
-	rr.iMantLo = 0;
-	rr.iMantHi = 0x80000000u;
-	rx += rr;	// rounding
-	TInt exp = rx.iExp - 32767 - 31;
-	if (exp < -32768)
-		{
-		aRatio.iM = 0;
-		aRatio.iX = 0;
-		return KErrUnderflow;
-		}
-	if (exp > 32767)
-		{
-		aRatio.iM = 0xffffffffu;
-		aRatio.iX = 32767;
-		return KErrOverflow;
-		}
-	aRatio.iM = rx.iMantHi;
-	aRatio.iX = (TInt16)exp;
-	return KErrNone;
-	}
-
-TInt RatioToReal(TRealX& a, const SRatio& aRatio)
-	{
-	a.iSign = 0;
-	a.iFlag = 0;
-	a.iMantLo = 0;
-	a.iMantHi = aRatio.iM;
-	if (!aRatio.iM)
-		{
-		a.SetZero();
-		return KErrNone;
-		}
-	TInt exp = aRatio.iX + 31 + 32767;
-	if (exp > 65534)
-		{
-		a.SetInfinite(EFalse);
-		}
-	else
-		{
-		a.iExp = (TUint16)exp;
-		}
-	return KErrNone;
-	}
-
-TInt RatioSetValue(TRealX& a, TUint32 aInt, TInt aDivisorExp)
-	{
-	a.Set(TUint(aInt));
-	TInt exp = a.iExp;
-	exp -= aDivisorExp;
-	if (exp<1)
-		{
-		a.SetZero();
-		return KErrUnderflow;
-		}
-	if (exp>65534)
-		{
-		a.SetInfinite(EFalse);
-		return KErrOverflow;
-		}
-	a.iExp = (TInt16)exp;
-	return KErrNone;
-	}
-
-TInt RatioReciprocal(SRatio& aRatio)
-	{
-	TRealX rx;
-	TInt r = RatioToReal(rx, aRatio);
-	if (r != KErrNone)
-		return r;
-	rx = TRealX(1) / rx;
-	return RealToRatio(aRatio, rx);
-	}
-
-TInt RatioMult(const SRatio& aRatio, TUint32& aInt32)
-	{
-	TRealX rx;
-	TInt r = RatioToReal(rx, aRatio);
-	if (r != KErrNone)
-		return r;
-	r = rx.MultEq(TRealX((TUint)aInt32));
-	if (r != KErrNone)
-		return r;
-	if (rx.IsZero())
-		{
-		aInt32 = 0;
-		return KErrNone;
-		}
-	rx.AddEq(TRealX(0.5));
-	if (rx<TRealX(1))
-		{
-		aInt32 = 0;
-		return KErrUnderflow;
-		}
-	if (rx.iExp > 32767+31)
-		{
-		aInt32 = ~0u;
-		return KErrOverflow;
-		}
-	aInt32 = rx.operator TUint();
-	return KErrNone;
-	}
-
-void RatioPrint(const char* aTitle, const SRatio& aRatio)
-	{
-	TPtrC8 t8((const TUint8*)aTitle);
-	TBuf<256> t16;
-	t16.Copy(t8);
-	test.Printf(_L("%S: %08x %04x\n"), &t16, aRatio.iM, TUint16(aRatio.iX));
-	}
-
-void RatioPrint2(const char* aTitle, const SRatio& aR1, const SRatio& aR2)
-	{
-	TPtrC8 t8((const TUint8*)aTitle);
-	TBuf<256> t16;
-	t16.Copy(t8);
-	test.Printf(_L("%S: %08x %04x   %08x %04x\n"), &t16, aR1.iM, TUint16(aR1.iX), aR2.iM, TUint16(aR2.iX));
-	}
-
-void TestEqual(const SRatio& aActual, const SRatio& aExpected)
-	{
-	if (aActual.iM==aExpected.iM && aActual.iX==aExpected.iX)
-		return;
-	RatioPrint("Actual", aActual);
-	RatioPrint("Expected", aExpected);
-	test(0);
-	}
-
-const TUint32 MultTestIntegers[] =
-	{
-	0u, 1u, 2u, 3u, 5u, 7u, 11u, 13u, 17u, 19u, 23u, 29u, 31u, 37u, 41u, 43u, 47u,
-	50u, 51u, 53u, 59u, 61u, 63u, 67u, 71u, 72u, 81u, 100u, 127u, 133u, 187u, 200u,
-	4u, 8u, 16u, 32u, 64u, 128u, 256u, 512u, 1024u, 2048u, 4096u, 8192u, 16384u,
-	32768u, 65536u, 131072u, 262144u, 524288u, 1048576u, 2097152u, 4194304u, 8388608u,
-	16777216u, 33554432u, 67108864u, 134217728u, 268435456u, 536870912u, 1073741824u,
-	2147483648u, 4294967295u,
-	9u, 27u, 243u, 729u, 2187u, 6561u, 19683u, 59049u, 177147u, 531441u, 1594323u,
-	4782969u, 14348907u, 43046721u, 129140163u, 387420489u, 1162261467u, 3486784401u,
-	25u, 125u, 625u, 3125u, 15625u, 78125u, 390625u, 1953125u, 9765625u,
-	48828125u, 244140625u, 1220703125u,
-	49u, 343u, 2401u, 16807u, 117649u, 823543u, 5764801u, 40353607u, 282475249u, 1977326743u
-	};
-
-void Test1M(const SRatio& aRatio)
-	{
-	SRatio ratio = aRatio;
-	const TInt N = sizeof(MultTestIntegers)/sizeof(MultTestIntegers[0]);
-	test.Printf(_L("Testing %d integers\n"), N);
-	TInt i;
-	for (i=0; i<N; ++i)
-		{
-		TUint32 I = MultTestIntegers[i];
-		TUint32 I0 = I;
-		TUint32 I1 = I;
-		TInt r0 = RatioMult(aRatio, I0);
-		TInt r1 = Driver.RatioMult(ratio, I1);
-		if (r0!=KErrNone || r1!=KErrNone)
-			{
-			if (r0!=r1)
-				{
-				test.Printf(_L("Return code mismatch r0=%d r1=%d (I=%08x I0=%08x I1=%08x)\n"), r0, r1, I, I0, I1);
-				test(0);
-				}
-			}
-		else if (I0!=I1)
-			{
-			test.Printf(_L("Result mismatch I=%08x I0=%08x I1=%08x\n"), I, I0, I1);
-			}
-		}
-	}
-
-void Test1(TUint32 aInt, TInt aDivisorExp)
-	{
-	TRealX realx;
-	SRatio r0x;
-	SRatio r0;
-	SRatio r1x;
-	SRatio r1;
-	TInt r;
-	test.Printf(_L("Test1 %08x %d\n"), aInt, aDivisorExp);
-	r = RatioSetValue(realx, aInt, aDivisorExp);
-	test_KErrNone(r);
-	r = RealToRatio(r0x, realx);
-	test_KErrNone(r);
-	r = Driver.RatioSet(r0, aInt, aDivisorExp);
-	RatioPrint2("R0X,R0", r0x, r0);
-	TestEqual(r0, r0x);
-	Test1M(r0);
-	r1x = r0x;
-	r = RatioReciprocal(r1x);
-	test_KErrNone(r);
-	r1 = r0;
-	r = Driver.RatioReciprocal(r1);
-	test_KErrNone(r);
-	RatioPrint2("R1X,R1", r1x, r1);
-	TestEqual(r1, r1x);
-	Test1M(r1);
-	}
-
-void TestRatios()
-	{
-	Test1(1,0);
-	Test1(3,0);
-	Test1(0xb504f334u,32);
-	Test1(0xc90fdaa2u,30);
-	Test1(10,0);
-	Test1(0xcccccccd,35);
-	Test1(100,0);
-	Test1(0xa3d70a3d,38);
-	}
-
-class CircBuf
-	{
-public:
-	static CircBuf* New(TInt aSlots);
-	CircBuf();
-	~CircBuf();
-	TInt TryPut(TUint32 aIn);
-	void Reset();
-public:
-	volatile TUint32* iBufBase;
-	TUint32 iSlotCount;
-	volatile TUint32 iPutIndex;
-	};
-
-CircBuf* CircBuf::New(TInt aSlots)
-	{
-	test(TUint32(aSlots-1)<65536);
-	CircBuf* p = new CircBuf();
-	p->iSlotCount = aSlots;
-	p->iPutIndex = 0;
-	p->iBufBase = (TUint32*)User::Alloc(aSlots*sizeof(TUint32));
-	if (!p->iBufBase)
-		{
-		delete p;
-		p = 0;
-		}
-	__e32_memory_barrier();
-	return p;
-	}
-
-CircBuf::CircBuf()
-	{
-	iBufBase = 0;
-	}
-
-CircBuf::~CircBuf()
-	{
-	User::Free((TAny*)iBufBase);
-	}
-
-TInt CircBuf::TryPut(TUint32 aIn)
-	{
-	TUint32 orig = __e32_atomic_tau_rlx32(&iPutIndex, iSlotCount, 0, 1);
-	if (orig == iSlotCount)
-		return KErrOverflow;
-	iBufBase[orig] = aIn;
-	return KErrNone;
-	}
-
-void CircBuf::Reset()
-	{
-	__e32_atomic_store_ord32(&iPutIndex, 0);
-	}
-
-
-
-class CTimesliceTestThread : public CBase
-	{
-public:
-	CTimesliceTestThread();
-	~CTimesliceTestThread();
-	static CTimesliceTestThread* New(TUint32 aId, TInt aCpu, TInt aSlice, CircBuf* aBuf);
-	void Start();
-	void Wait();
-	TBool Finished();
-	TInt Construct(TUint32 aId, TInt aCpu, TInt aSlice, CircBuf* aBuf);
-	static TInt ThreadFunc(TAny*);
-public:
-	RThread	iThread;
-	TRequestStatus iExitStatus;
-	TUint32 iId;
-	CircBuf* iBuf;
-	TUint32 iFreq;
-	TUint32 iThresh;
-	TUint32 iThresh2;
-	TInt iCpu;
-	TInt iSlice;
-	};
-
-CTimesliceTestThread::CTimesliceTestThread()
-	{
-	iThread.SetHandle(0);
-	}
-
-CTimesliceTestThread::~CTimesliceTestThread()
-	{
-	if (iThread.Handle())
-		{
-		if (iThread.ExitType() == EExitPending)
-			{
-			iThread.Kill(0);
-			Wait();
-			}
-		CLOSE_AND_WAIT(iThread);
-		}
-	}
-
-TInt CTimesliceTestThread::Construct(TUint32 aId, TInt aCpu, TInt aSlice, CircBuf* aBuf)
-	{
-	iId = aId;
-	iCpu = aCpu;
-	iSlice = aSlice;
-	iBuf = aBuf;
-
-	TInt r = HAL::Get(HAL::EFastCounterFrequency, (TInt&)iFreq);
-	if (r!=KErrNone)
-		return r;
-	iThresh = iFreq / 3000;
-	if (iThresh < 10)
-		iThresh = 10;
-	iThresh2 = iFreq;
-	TBuf<16> name = _L("TSThrd");
-	name.AppendNum(iId);
-	r = iThread.Create(name, &ThreadFunc, 0x1000, NULL, this);
-	if (r!=KErrNone)
-		return r;
-	iThread.Logon(iExitStatus);
-	if (iExitStatus != KRequestPending)
-		{
-		iThread.Kill(0);
-		iThread.Close();
-		iThread.SetHandle(0);
-		return iExitStatus.Int();
-		}
-	return KErrNone;
-	}
-
-CTimesliceTestThread* CTimesliceTestThread::New(TUint32 aId, TInt aCpu, TInt aSlice, CircBuf* aBuf)
-	{
-	CTimesliceTestThread* p = new CTimesliceTestThread;
-	if (p)
-		{
-		TInt r = p->Construct(aId, aCpu, aSlice, aBuf);
-		if (r != KErrNone)
-			{
-			delete p;
-			p = 0;
-			}
-		}
-	return p;
-	}
-
-void CTimesliceTestThread::Start()
-	{
-	iThread.Resume();
-	}
-
-TBool CTimesliceTestThread::Finished()
-	{
-	return (KRequestPending!=iExitStatus.Int());
-	}
-
-void CTimesliceTestThread::Wait()
-	{
-	User::WaitForRequest(iExitStatus);
-	}
-
-TInt CTimesliceTestThread::ThreadFunc(TAny* aPtr)
-	{
-	CTimesliceTestThread& a = *(CTimesliceTestThread*)aPtr;
-	Driver.SetCurrentThreadCpu(a.iCpu);
-	Driver.SetCurrentThreadPriority(63);
-	Driver.SetCurrentThreadTimeslice(a.iSlice);
-	User::AfterHighRes(100000);
-	TUint id = a.iId;
-	TUint32 last_interval_begin = User::FastCounter();
-	TUint32 last_seen_time = User::FastCounter();
-	FOREVER
-		{
-		TUint32 nfc = User::FastCounter();
-		TUint32 delta = nfc - last_seen_time;
-		TUint32 interval_length = last_seen_time - last_interval_begin;
-		if (delta > a.iThresh || interval_length > a.iThresh2)
-			{
-			last_interval_begin = nfc;
-			TUint32 x = (id<<30) | (interval_length&0x3fffffffu);
-			TInt r = a.iBuf->TryPut(x);
-			if (r != KErrNone)
-				break;
-			}
-		last_seen_time = nfc;
-		}
-	return KErrNone;
-	}
-
-CircBuf* RunTimesliceTest(TInt aCpu, TInt aSlice, TInt aCount, TInt aInterfere = 0)
- 	{
-	TUint32 oldaff = 0;
-	TUint32 interfereAffinity = 0; 
-	TUint tellKernel = 0x80000000u;
-	
-	CircBuf* buf = CircBuf::New(aCount);
-	test(buf != 0);
-	CTimesliceTestThread* t0 = CTimesliceTestThread::New(0, aCpu, aSlice, buf);
-	test(t0 != 0);
-	CTimesliceTestThread* t1 = CTimesliceTestThread::New(1, aCpu, aSlice, buf);
-	test(t1 != 0);
-
-	if (aInterfere) 
-		{
-		if (aInterfere < 0) 
-			{
-			tellKernel = 0;
-			}
-		TInt r = UserSvr::HalFunction(EHalGroupKernel, EKernelHalNumLogicalCpus, 0, 0);
-		test(r>0);
-		interfereAffinity = (0x80000000 | ((0x1<<r)-1)) & ~0x2; // all except core 1
-		if (0x80000001 == interfereAffinity) 
-			{
-			interfereAffinity = 0;   // dual core system (not doing this fails affinity check later)
-			}
-		
-		Driver.SetCurrentThreadCpu(interfereAffinity , &oldaff);   // move away from core 1 (doesn't hurt though not much difference gained)
-		Driver.SetCurrentThreadPriority(63);                       // changing prescaler requires running on core 1 so priority needs to 
-		}                                                          // match test threads
-
-
-	t0->Start();
-	t1->Start();
-	if (aInterfere) 
-		{
-		TInt prescale = 1;
-		while (!t0->Finished() || !t1->Finished()) 
-			{
-			User::AfterHighRes(23000);
-			Driver.SetLocalTimerPrescaler((1u<<1)|tellKernel, prescale);
-			prescale++;
-			if (prescale >  4) 
-				{
-				prescale = 0;
-				}
-			}
-		}
-
-	t0->Wait();
-	t1->Wait();
-	
-	delete t0;
-	delete t1;
-	if (aInterfere) 
-		{
-		TUint32 aff;
-		Driver.SetLocalTimerPrescaler((1u<<1)|0x80000000u, -1);
-		RThread().SetPriority(EPriorityNormal);
-		Driver.SetCurrentThreadCpu(oldaff,&aff);
-		test_Equal(aff,interfereAffinity);
-		}
-	return buf;
-	}
-
-TUint32 ticks_to_us(TUint32 aTicks, TUint32 aF)
-	{
-	TUint64 x = TUint64(aTicks) * TUint64(1000000);
-	TUint64 f64 = aF;
-	x += (f64>>1);
-	x /= f64;
-	return I64LOW(x);
-	}
-
-void DisplayBuffer(CircBuf* aBuf, TUint32 aSlice )
-	{
-	TUint32 f;
-	TInt r = HAL::Get(HAL::EFastCounterFrequency, (TInt&)f);
-	test_KErrNone(r);
-	TUint32* p = (TUint32*)aBuf->iBufBase;
-	TInt c = aBuf->iSlotCount;
-	TInt i;
-	TInt lid = -1;
-	TUint32 min = ~0u;
-	TUint32 max = 0;
-	TUint32 totivus = 0;
-	TBool firstchg = ETrue;
-	for (i=0; i<c; ++i)
-		{
-		TUint32 x = p[i];
-		TUint32 id = x>>30;
-		TUint32 iv = (x<<2)>>2;
-		TUint32 ivus = ticks_to_us(iv,f);
-		if (lid >= 0)
-			{
-			if (lid == (TInt)id)
-				totivus += ivus;
-			else
-				{
-				if (!firstchg)
-					{
-					if (totivus < min)
-						min = totivus;
-					if (totivus > max)
-						max = totivus;
-					}
-				else
-					firstchg = EFalse;
-				totivus = ivus;
-				}
-			}
-		lid = (TInt)id;
-		test.Printf(_L("ID: %1d IV: %10d (=%10dus) TIV %10dus\n"), id, iv, ivus, totivus);
-		}
-
-	if (aSlice > 0)
-		{
-		// check timeslices where within acceptable ranges
-		TUint32 sliceError = KSliceDeltaPercent*aSlice/100;
-		test_Compare(max,<,aSlice+sliceError);  
-		test_Compare(min,>,aSlice-sliceError);  
-		}
-	test.Printf(_L("RANGE %d-%dus (%dus)\n"), min, max, max-min);
-	}
-
-void TT()
-	{
-	test.Printf(_L("Timeslicing test ...\n"));
-	CircBuf* b = RunTimesliceTest(1, 50000, 100);
-	test.Next(_L("Baseline - expecting normal"));
-	DisplayBuffer(b,50000u);
-	delete b;
-
-	Driver.SetLocalTimerPrescaler(1u<<1, 1);
-	b = RunTimesliceTest(1, 50000, 100);
-	test.Next(_L("expecting double"));
-	DisplayBuffer(b,100000u);
-	delete b;
-
-	Driver.SetLocalTimerPrescaler(1u<<1|0x80000000u, 1);
-	test.Next(_L("expecting normal again"));
-	b = RunTimesliceTest(1, 50000, 100);
-	DisplayBuffer(b,50000u);
-	delete b;
-
-	test.Next(_L("expecting half"));
-	Driver.SetLocalTimerPrescaler(1u<<1, -1);
-	b = RunTimesliceTest(1, 50000, 100);
-	DisplayBuffer(b,25000u);
-	delete b;
-
-	Driver.SetLocalTimerPrescaler(1u<<1|0x80000000u, -1);
-	test.Next(_L("expecting normal again"));
-	b = RunTimesliceTest(1, 50000, 100);
-	DisplayBuffer(b,50000u);
-	delete b;
-
-	b = RunTimesliceTest(1, 50000, 200 ,-1);
-	test.Next(_L("expecting random"));
-	DisplayBuffer(b,0u);  // timeslices should be fairly random on this run
-
-	b = RunTimesliceTest(1, 50000, 200 ,1);
-	test.Next(_L("expecting normal again"));
-	DisplayBuffer(b,50000u);
-	delete b;
-	}
-
-struct SGTRecord
-	{
-	TUint64 iTSInterval;
-	TUint64 iGTInterval;
-	};
-
-
-SGTRecord* RunGTTest(TInt aCount, TInt aWait)
-	{
-	TUint64 lastgt,lastts,gt,ts;
-
-	SGTRecord* res = new SGTRecord[aCount];
-	test(res!=0);
-
-
-	TInt r = Driver.ReadGlobalTimerAndTimestamp(lastgt,lastts);
-	test_Equal(r,KErrNone);
-
-	for (TInt i = 0; i < aCount; i++) 
-		{
-		User::AfterHighRes(aWait);
-		
-		TInt r = Driver.ReadGlobalTimerAndTimestamp(gt,ts);
-		test_Equal(r,KErrNone);
-		res[i].iGTInterval = gt-lastgt;
-		lastgt = gt;
-		res[i].iTSInterval = ts-lastts;
-		lastts = ts;
-		}
-
-	return res;
-	}
-
-void DisplayGTResults(SGTRecord* aRec, TInt aCount, TUint32 aFreq, TUint64 aExpectedTSInterval, TUint64 aExpectedGTInterval)
-	{
-	SGTRecord max = { 0ul , 0ul };
-	SGTRecord min = { KMaxTUint64 , KMaxTUint64 };
-	
-	TUint64 errgt = (aExpectedGTInterval*KTimeStampDeltaPercent)/100;
-	TUint64 errts = (aExpectedTSInterval*KTimeStampDeltaPercent)/100;
-
-	
-	for (TInt i = 0 ; i < aCount; i++) 
-		{
-		test.Printf(_L("gt interval : %Lu (gtticks) %Lu (us)\n"),
-					aRec[i].iGTInterval,
-					aRec[i].iTSInterval*1000000u/TUint64(aFreq));
-		
-		if (max.iTSInterval < aRec[i].iTSInterval) 
-			{
-			max.iTSInterval = aRec[i].iTSInterval;
-			}
-		if (max.iGTInterval < aRec[i].iGTInterval) 
-			{
-			max.iGTInterval = aRec[i].iGTInterval;
-			}
-		
-		if (min.iTSInterval > aRec[i].iTSInterval) 
-			{
-			min.iTSInterval = aRec[i].iTSInterval;
-			}
-		if (min.iGTInterval > aRec[i].iGTInterval) 
-			{
-			min.iGTInterval = aRec[i].iGTInterval;
-			}
-		}
-	
-	test.Printf(_L("RANGE Global Timer %Lu-%Lu ticks (%Lu ticks)\n"),
-				min.iGTInterval, max.iGTInterval, max.iGTInterval-min.iGTInterval);
-	
-	test.Printf(_L("RANGE Timestamp %Lu-%Lu us (%Lu us)\n"),
-				(1000000u*min.iGTInterval)/TUint64(aFreq), (1000000u*max.iGTInterval)/TUint64(aFreq),
-				(1000000u*max.iGTInterval)/TUint64(aFreq) - (1000000u*min.iGTInterval)/TUint64(aFreq));
-	
-	if (errts) 
-		{
-		test_Compare(max.iTSInterval,<,aExpectedTSInterval+errts);  
-		test_Compare(min.iTSInterval,>,aExpectedTSInterval);  
-		}
-	
-	if (errgt) 
-		{
-		test_Compare(max.iGTInterval,<,aExpectedGTInterval+errgt);  
-		test_Compare(min.iGTInterval,>,aExpectedGTInterval);  
-		}
-	
-	}
-
-void GTT()
-	{
-	test.Printf(_L("Global timer tests ...\n"));
-	TUint64 gt,ts;
-
-	TInt r = Driver.ReadGlobalTimerAndTimestamp(gt,ts);
-	if (KErrNotSupported == r ) 
-		{
-		test.Printf(_L("Global timer not supported in this plaform, skipping GT tests\n"));
-		return;
-		}
-
-	TUint32 f;
-	r = HAL::Get(HAL::EFastCounterFrequency, (TInt&)f);
-	test_KErrNone(r);
-	TInt wait = 100000; // 100ms
-	TInt count = 10;
-	
-	TUint64 expectedTs = (TUint64(f)*TUint64(wait))/1000000u;
-	TUint64 expectedGtOrig = expectedTs;
-	
-	SGTRecord* rec;
-	for (TInt i = 0; i < 10; i++)
-		{
-		TUint64 expectedGt = expectedGtOrig/(i+1);
-		r = Driver.SetGlobalTimerPrescaler(i);
-		test_KErrNone(r);
-		rec = RunGTTest(count, wait);
-		test.Printf(_L("expectedTS %Lu expectedGT %Lu\n"),expectedTs,expectedGt);
-		DisplayGTResults(rec,count, f, expectedTs , expectedGt);
-		delete rec;
-		}
-
-	r = Driver.SetGlobalTimerPrescaler(-1); // back to default
-	test_KErrNone(r);
-	}
-
-void RunTests()
-	{
-	TestRatios();
-	if (Driver.FrqChgTestPresent()!=KErrNone)
-		{
-		test.Printf(_L("Frequency Change not supported on this platform\n"));
-		return;
-		}
-	TT();
-	GTT();
-	}
-
-GLDEF_C TInt E32Main()
-	{
-	test.Title();
-	test.Start(_L("Testing"));
-	TInt r = User::LoadLogicalDevice(KLddName);
-	if (r==KErrNotFound)
-		{
-		test.Printf(_L("Test not supported on this platform\n"));
-		}
-	else 
-		{
-		if (r!=KErrNone)
-			{
-			test_Equal(KErrAlreadyExists, r);
-			}
-		r = Driver.Open();
-		test_KErrNone(r);
-		RunTests();
-		Driver.Close();
-		}
-
-	test.End();
-	r = User::FreeLogicalDevice(KLddName);
-	test_KErrNone(r);
-	return KErrNone;
-	}
--- a/kerneltest/e32test/power/t_powermisctest.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +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\power\t_powermisctest.cpp
-// 
-//
-
-#include <e32test.h>
-#include <e32hal.h>
-#include "d_powermisctest.h"
-#include <e32power.h>
-#include <e32svr.h>
-#include <hal.h>
-#include <u32hal.h>
-
-_LIT(KLddFileName, "D_POWERMISCTEST.LDD");
-
-RLddTest1 ldd;
-GLDEF_D RTest test(_L("T_POWERMISCTEST"));
-
-void DoTests()
-	{
-	TInt r = KErrNone;
-
-	test.Printf(_L("Loading logical device \n"));
-	r=User::LoadLogicalDevice(KLddFileName);
-	test(r == KErrNone);
-
-	test.Printf(_L("Opening of logical device\n"));
-	r = ldd.Open();
-	test(r == KErrNone);
-
-	test.Printf(_L("Start tests\n"));
-	r = ldd.Test();
-	test(r == KErrNone);
-
-	test.Printf(_L("Closing the channel\n"));
-	ldd.Close();
-
-	test.Printf(_L("Freeing logical device\n"));
-	r = User::FreeLogicalDevice(KLddFileName);;
-	test(r==KErrNone);
-
-	}
-
-GLDEF_C TInt E32Main()
-	{
-	test.Start(_L("Power misc tests"));
-	const TInt numCpus = UserSvr::HalFunction(EHalGroupKernel, EKernelHalNumLogicalCpus, 0, 0);
-	if(numCpus > 1)
-		{
-		DoTests();
-		}
-	else
-		{
-		test.Printf(_L("Not supported in unicore.\n"));
-		}
-	test.End();
-	test.Close();	
-
-	return(KErrNone);
-	}
--- a/kerneltest/e32test/power/t_powermisctest.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +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_powermisctest.mmp
-// 
-//
-
-TARGET         t_powermisctest.exe
-TARGETTYPE     EXE
-SOURCEPATH     ../power
-SOURCE         t_powermisctest.cpp
-LIBRARY        euser.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-USERINCLUDE  ../power
-
-
-capability		all
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/kerneltest/e32test/prime/t_semutx.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/prime/t_semutx.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -40,9 +40,7 @@
 
 #define __E32TEST_EXTENSION__
 #include <e32test.h>
-#include <hal.h>
-#include <e32atomics.h>
-#include <u32hal.h>
+#include <u32std.h>
 #include <e32svr.h>
 
 const TInt KMaxBufferSize=10;
@@ -53,352 +51,13 @@
 
 RTest test(_L("T_SEMUTX"));
 RMutex mutex;
-RCriticalSection criticalSn;
+RCriticalSection criticalSn;	
 TInt thread1Count,thread2Count;
 TInt arrayIndex;
-TInt array[KMaxArraySize];
+TInt array[KMaxArraySize];  
 TInt consumerArray[KNumProducerItems];
-RSemaphore slotAvailable,itemAvailable;
-TBool doCpuLocking = EFalse;
-
-// return num of cpus in system
-TInt NumCpus()
-	{
-	TInt r = UserSvr::HalFunction(EHalGroupKernel, EKernelHalNumLogicalCpus, 0, 0);
-	return r;
-	}
-
-
-TInt LockCurrentThreadToCpu0(TBool aCallingIsMainTestThread = EFalse)
-	{
-	if (aCallingIsMainTestThread) 
-		{
-		if (NumCpus() > 1) 
-			{
-			doCpuLocking = ETrue;
-			return UserSvr::HalFunction(EHalGroupKernel, EKernelHalLockThreadToCpu, 0, 0); 
-			}
-		else
-			{
-			return KErrNone;
-			}
-		}
-	return UserSvr::HalFunction(EHalGroupKernel, EKernelHalLockThreadToCpu, 0, 0); 
-	}
-
-TInt UnlockCurrentThreadToCpu0(TBool aCallingIsMainTestThread = EFalse)
-	{
-	if (aCallingIsMainTestThread) 
-		{
-		if (NumCpus() > 1) 
-			{
-			doCpuLocking = EFalse;
-			return UserSvr::HalFunction(EHalGroupKernel, EKernelHalLockThreadToCpu, (TAny*) 0xffffffffu, 0); 
-			}
-		else
-			{
-			return KErrNone;
-			}
-		}
-	return UserSvr::HalFunction(EHalGroupKernel, EKernelHalLockThreadToCpu, (TAny*) 0xffffffffu, 0); 
-	}
-
-
-/******************************************************************************
- * Random Number Generation
- ******************************************************************************/
-void Random(TUint64& a)
-	{
-	TInt i;
-	for (i=64; i>0; --i)
-		{
-		TUint64 x = a<<1;
-		TUint64 y = x<<1;
-		x^=y;
-		a = (y>>1) | (x>>63);
-		}
-	}
-
-// Returns 256*log2(a/2^64)
-TInt Log2(TUint64 a)
-	{
-	const TUint64 KBit63 = UI64LIT(0x8000000000000000);
-	TInt n = __e32_find_ms1_64(a);
-	a <<= (63-n);
-	n -= 64;
-	TInt i;
-	for (i=0; i<8; ++i)
-		{
-		a >>= 32;
-		a *= a;
-		n <<= 1;
-		if (a & KBit63)
-			{
-			++n;
-			}
-		else
-			{
-			a <<= 1;
-			}
-		}
-	return n;
-	}
-
-TUint32 ExpRV(TUint64 aU, TUint32 aMean, TUint32 aTick)
-	{
-	TInt n = -Log2(aU);
-	TUint64 x = TUint64(n) * TUint64(aMean);
-	x *= TUint64(22713);	// 2^15 * ln2
-	TUint64 p(aTick);
-	p <<= 22;
-	x += p;
-	p += p;
-	x /= p;
-	return I64LOW(x);
-	}
-
-
-
-/*----------------------------------------------------------------------------*/
-class MLock
-	{
-public:
-	enum {EPollable=1, ETimeoutAvail=2, ENestable=4, ELimit1=8, ELooseTimeout=16};
-public:
-	virtual TInt Flags()=0;
-	virtual void Release()=0;
-	virtual void Wait()=0;
-	virtual void Signal()=0;
-	virtual TInt Wait(TInt aTimeout);
-	virtual TInt Poll();
-	};
-
-TInt MLock::Wait(TInt)
-	{ return KErrNotSupported; }
-TInt MLock::Poll()
-	{ return KErrNotSupported; }
-
-/*----------------------------------------------------------------------------*/
-class LockS : public MLock
-	{
-public:
-	LockS();
-	virtual TInt Flags();
-	virtual void Release();
-	virtual void Wait();
-	virtual void Signal();
-	virtual TInt Wait(TInt aTimeout);
-	virtual TInt Poll();
-public:
-	RSemaphore	iT;
-	};
-
-LockS::LockS()
-	{ test_KErrNone(iT.CreateLocal(1)); }
-TInt LockS::Flags()
-	{ return EPollable|ETimeoutAvail; }
-void LockS::Release()
-	{ iT.Close(); }
-void LockS::Wait()
-	{ iT.Wait(); }
-void LockS::Signal()
-	{ iT.Signal(); }
-TInt LockS::Wait(TInt aTimeout)
-	{ return iT.Wait(aTimeout); }
-TInt LockS::Poll()
-	{ return iT.Poll(); }
-
-/*----------------------------------------------------------------------------*/
-class LockM : public MLock
-	{
-public:
-	LockM();
-	virtual TInt Flags();
-	virtual void Release();
-	virtual void Wait();
-	virtual void Signal();
-	virtual TInt Wait(TInt aTimeout);
-	virtual TInt Poll();
-public:
-	RMutex		iT;
-	};
-
-LockM::LockM()
-	{ test_KErrNone(iT.CreateLocal()); }
-TInt LockM::Flags()
-	{ return EPollable|ETimeoutAvail|ENestable|ELimit1; }
-void LockM::Release()
-	{ iT.Close(); }
-void LockM::Wait()
-	{ iT.Wait(); }
-void LockM::Signal()
-	{ iT.Signal(); }
-TInt LockM::Wait(TInt aTimeout)
-	{ return iT.Wait(aTimeout); }
-TInt LockM::Poll()
-	{ return iT.Poll(); }
-
-/*----------------------------------------------------------------------------*/
-
-class LockFL : public MLock
-	{
-public:
-	LockFL();
-	virtual TInt Flags();
-	virtual void Release();
-	virtual void Wait();
-	virtual void Signal();
-	virtual TInt Wait(TInt aTimeout);
-	virtual TInt Poll();
-public:
-	RFastLock	iT;
-	};
-
-LockFL::LockFL()
-	{ test_KErrNone(iT.CreateLocal()); }
-TInt LockFL::Flags()
-	{ return ETimeoutAvail|EPollable|ELimit1|ELooseTimeout; }
-void LockFL::Release()
-	{ iT.Close(); }
-void LockFL::Wait()
-	{ iT.Wait(); }
-void LockFL::Signal()
-	{ iT.Signal(); }
-TInt LockFL::Wait(TInt aTimeout)
-	{ return iT.Wait(aTimeout); }
-TInt LockFL::Poll()
-	{ return iT.Poll(); }
-
-/*----------------------------------------------------------------------------*/
-class LockCS : public MLock
-	{
-public:
-	LockCS();
-	virtual TInt Flags();
-	virtual void Release();
-	virtual void Wait();
-	virtual void Signal();
-public:
-	RCriticalSection iT;
-	};
-
-LockCS::LockCS()
-	{ test_KErrNone(iT.CreateLocal()); }
-TInt LockCS::Flags()
-	{ return ELimit1; }
-void LockCS::Release()
-	{ iT.Close(); }
-void LockCS::Wait()
-	{ iT.Wait(); }
-void LockCS::Signal()
-	{ iT.Signal(); }
-
-
+RSemaphore slotAvailable,itemAvailable;  
 			 
-/*----------------------------------------------------------------------------*/
-class LFSR
-	{
-public:
-	LFSR(TInt aBits, TInt aTap2, TInt aTap3=0, TInt aTap4=0);
-	~LFSR();
-	void Step();
-	void Step(TInt aSteps);
-	TBool operator==(const LFSR& a) const;
-public:
-	TUint32* iData;
-	TInt iBits;
-	TInt iTap2;
-	TInt iTap3;
-	TInt iTap4;
-	TInt iNW;
-	TInt iSh1;
-	TInt iIx2;
-	TInt iSh2;
-	TInt iIx3;
-	TInt iSh3;
-	TInt iIx4;
-	TInt iSh4;
-	};
-
-LFSR::LFSR(TInt aBits, TInt aTap2, TInt aTap3, TInt aTap4)
-	{
-	iBits = aBits;
-	iTap2 = aTap2;
-	iTap3 = aTap3;
-	iTap4 = aTap4;
-	iNW = (aBits + 31) >> 5;
-	iData = (TUint32*)User::AllocZ(iNW*sizeof(TUint32));
-	test(iData!=0);
-	iData[0] = 1;
-	iSh1 = (aBits-1)&31;
-	iIx2 = (iTap2-1)>>5;
-	iSh2 = (iTap2-1)&31;
-	if (iTap3)
-		{
-		iIx3 = (iTap3-1)>>5;
-		iSh3 = (iTap3-1)&31;
-		}
-	else
-		{
-		iIx3 = -1;
-		iSh3 = 0;
-		}
-	if (iTap4)
-		{
-		iIx4 = (iTap4-1)>>5;
-		iSh4 = (iTap4-1)&31;
-		}
-	else
-		{
-		iIx4 = -1;
-		iSh4 = 0;
-		}
-	}
-
-LFSR::~LFSR()
-	{
-	User::Free(iData);
-	}
-
-void LFSR::Step(TInt aSteps)
-	{
-	while (aSteps--)
-		Step();
-	}
-
-void LFSR::Step()
-	{
-	TUint32 b = iData[iNW-1]>>iSh1;
-	b ^= (iData[iIx2]>>iSh2);
-	if (iIx3>=0)
-		b ^= (iData[iIx3]>>iSh3);
-	if (iIx4>=0)
-		b ^= (iData[iIx4]>>iSh4);
-	b &= 1;
-	TInt i;
-	for (i=0; i<iNW; ++i)
-		{
-		TUint32 bb = iData[i] >> 31;
-		iData[i] = (iData[i]<<1)|b;
-		b = bb;
-		}
-	iData[iNW-1] &= ((2u<<iSh1)-1u);
-	}
-
-TBool LFSR::operator==(const LFSR& a) const
-	{
-	if (iBits!=a.iBits || iTap2!=a.iTap2 || iTap3!=a.iTap3 || iTap4!=a.iTap4 || iNW!=a.iNW)
-		return EFalse;
-	if (iData==a.iData)
-		return ETrue;
-	if (memcompare((const TUint8*)iData, iNW, (const TUint8*)a.iData, a.iNW))
-		return EFalse;
-	return ETrue;
-	}
-
-
-
-/*----------------------------------------------------------------------------*/
 class CStack
 	{
 public:	   
@@ -459,7 +118,6 @@
 // Mutex test thread 1
 //
 	{	
-	TInt n = NumCpus();
 
 	thread1Count=0;
 	TBool running=ETrue;
@@ -475,16 +133,6 @@
 		else
 			running=EFalse;
 		mutex.Signal();
-
-		if (n > 1) 
-			{
-			// when the mutex is singaled, due to priority balancing, the other
-			// thread will be scheduled to run on a CPU other than this one. The delay
-			// in getting that thread to run means that this one can manage to re-claim the 
-			// mutex before the other thread gets to run. So we add a small delay here 
-			User::After(100); 
-			}
-
 		} while (running);
 	return(KErrNone);
 	}
@@ -494,7 +142,6 @@
 // Mutex test thread 2
 //
 	{
-	TInt n = NumCpus();
 
 	thread2Count=0;
 	TBool running=ETrue;
@@ -510,17 +157,6 @@
 		else
 			running=EFalse;
 		mutex.Signal();
-
-		if (n > 1) 
-			{
-			// when the mutex is singaled, due to priority balancing, the other
-			// thread will be scheduled to run on a CPU other than this one. The delay
-			// in getting that thread to run means that this one can manage to re-claim the 
-			// mutex before the other thread gets to run. So we add a small delay here 
-			User::After(100); 
-			}
-		
-
 		} while (running);
 	return(KErrNone);
 	}
@@ -573,80 +209,27 @@
 	return(KErrNone);
 	}
 
-
-/*----------------------------------------------------------------------------*/
-struct SWaitLock
+struct SWaitSem
 	{
-	enum {EDummy=-2, EPoll=-1, EInfinite=0};
-
-	static TInt WaitLockThread(TAny*);
-	void Start(RThread& aT, TThreadPriority aP=EPriorityLess);
-	void Wait(RThread& aT, TInt aResult);
-	TInt DoTest2(RThread& aT, TInt aTimeout, TInt aResult, TThreadPriority aP=EPriorityLess);
-	void Test2();
-	void TestSignalled();
-	void TestNotSignalled();
-	void TestState();
-
-
-	MLock* iLock;
+	RSemaphore iSem;
 	TInt iTimeout;
 	};
 
-TInt SWaitLock::WaitLockThread(TAny* a)
+TInt WaitSemThread(TAny* a)
 	{
-	
-	if (doCpuLocking)
-		{
-		TInt r = LockCurrentThreadToCpu0();
-		if (KErrNone!=r) return r;
-		// Rendevous was requested
-		RThread::Rendezvous(KErrNone);
-		}
-	
-	SWaitLock& w = *(SWaitLock*)a;
-	TInt lfl = w.iLock->Flags();
-	TBool limit1 = lfl & MLock::ELimit1;
-	TInt r;
-	switch (w.iTimeout)
-		{
-		case EDummy:
-			return KErrNone;
-		case EPoll:
-			r = w.iLock->Poll();
-			break;
-		case EInfinite:
-			w.iLock->Wait();
-			r = KErrNone;
-			break;
-		default:
-			r = w.iLock->Wait(w.iTimeout);
-			break;
-		}
-	if (limit1 && r==KErrNone)
-		w.iLock->Signal();
-	return r;
+	SWaitSem& ws = *(SWaitSem*)a;
+	return ws.iSem.Wait(ws.iTimeout);
 	}
 
-void SWaitLock::Start(RThread& aT, TThreadPriority aP)
+void StartWaitSemThread(RThread& aT, SWaitSem& aW, TThreadPriority aP=EPriorityLess)
 	{
-	TRequestStatus st;
-	TInt r = aT.Create(KNullDesC, &WaitLockThread, 0x1000, 0x1000, 0x1000, this);
+	TInt r = aT.Create(KNullDesC, &WaitSemThread, 0x1000, 0x1000, 0x1000, &aW);
 	test_KErrNone(r);
 	aT.SetPriority(aP);
-	if (doCpuLocking) 
-		{
-		aT.Rendezvous(st);
-		}
 	aT.Resume();
-	if (doCpuLocking) 
-		{
-		User::WaitForRequest(st);
-		test_KErrNone(st.Int());
-		}
 	}
 
-void SWaitLock::Wait(RThread& aT, TInt aResult)
+void WaitForWaitSemThread(RThread& aT, TInt aResult)
 	{
 	TRequestStatus s;
 	aT.Logon(s);
@@ -657,67 +240,32 @@
 	CLOSE_AND_WAIT(aT);
 	}
 
-TInt SWaitLock::DoTest2(RThread& aT, TInt aTimeout, TInt aResult, TThreadPriority aP)
+TInt DummyThread(TAny*)
 	{
-	TTime initial;
-	TTime final;
-	iTimeout = aTimeout;
-	initial.HomeTime();
-	Start(aT, aP);
-	Wait(aT, aResult);
-	final.HomeTime();
-	TInt elapsed = I64INT(final.Int64()-initial.Int64());
-	return elapsed;
-	}
-
-void SWaitLock::TestSignalled()
-	{
-	TInt r = iLock->Poll();
-	if (r == KErrNotSupported)
-		r = iLock->Wait(1);
-	test_KErrNone(r);
+	return 0;
 	}
 
-void SWaitLock::TestNotSignalled()
-	{
-	TInt r = iLock->Poll();
-	if (r == KErrNotSupported)
-		r = iLock->Wait(1);
-	test_Equal(KErrTimedOut, r);
-	}
-
-void SWaitLock::TestState()
+void TestSemaphore2()
 	{
-	if (iLock->Flags() & MLock::ELimit1)
-		TestSignalled();	// not signalled afterwards
-	else
-		TestNotSignalled();
-	}
-
-void SWaitLock::Test2()
-	{
-	test.Start(_L("SWaitLock::Test2"));
+	test.Start(_L("Test semaphore wait with timeout"));
+	SWaitSem ws;
 	RThread t;
-	RThread t2;
 	TTime initial;
 	TTime final;
-	TInt elapsed = 0;
-	TInt r = 0;
-	TInt lfl = iLock->Flags();
-	TBool nestable = lfl & MLock::ENestable;
-	TBool limit1 = lfl & MLock::ELimit1;
-	TBool pollable = lfl & MLock::EPollable;
-	TBool to = lfl & MLock::ETimeoutAvail;
-	TBool lto = lfl & MLock::ELooseTimeout;
+	TInt elapsed=0;
+	TInt r = ws.iSem.CreateLocal(0);
+	test_KErrNone(r);
 
 	RThread().SetPriority(EPriorityAbsoluteVeryLow);
 	TInt threadcount=0;
-	iTimeout = EDummy;
 	initial.HomeTime();
 	while (elapsed<1000000)
 		{
-		Start(t, EPriorityMore);
-		Wait(t, KErrNone);
+		r = t.Create(KNullDesC, &DummyThread, 0x1000, NULL, NULL);
+		test_KErrNone(r);
+		t.SetPriority(EPriorityMore);
+		t.Resume();
+		t.Close();
 		++threadcount;
 		final.HomeTime();
 		elapsed = I64INT(final.Int64()-initial.Int64());
@@ -727,735 +275,125 @@
 	TInt overhead = 1000000/threadcount;
 	test.Printf(_L("overhead = %dus\n"),overhead);
 
-	iLock->Wait();
+	ws.iTimeout=1000000;
+	initial.HomeTime();
+	StartWaitSemThread(t, ws);
+	WaitForWaitSemThread(t, KErrTimedOut);
+	final.HomeTime();
+	elapsed = I64INT(final.Int64()-initial.Int64());
+	test.Printf(_L("Time taken = %dus\n"), elapsed);
+	test(elapsed>=900000+overhead && elapsed<1500000+overhead);
 
-	if (to)
-		{
-		elapsed = DoTest2(t, 1000000, KErrTimedOut);
-		test.Printf(_L("Time taken = %dus\n"), elapsed);
-		test(elapsed>=900000+overhead && elapsed<1500000+overhead);
-		elapsed = DoTest2(t, -99, KErrArgument);
-		test.Printf(_L("Time taken = %dus\n"), elapsed);
-		}
+	ws.iTimeout=-1;
+	initial.HomeTime();
+	StartWaitSemThread(t, ws);
+	WaitForWaitSemThread(t, KErrArgument);
+	final.HomeTime();
+	elapsed = I64INT(final.Int64()-initial.Int64());
+	test.Printf(_L("Time taken = %dus\n"), elapsed);
 
-	if (pollable)
-		{
-		test.Printf(_L("Testing Poll() function\n"));
-		r = iLock->Poll();
-		test_Equal((nestable ? KErrNone : KErrTimedOut), r);
-		if (nestable)
-			{
-			iTimeout=EPoll;
-			r = iLock->Poll();
-			test_KErrNone(r);
-			iLock->Signal();
-			Start(t, EPriorityMore);
-			Wait(t, KErrTimedOut);
-			}
-		iLock->Signal();
-		if (nestable)
-			{
-			iTimeout=EPoll;
-			r = iLock->Poll();
-			test_KErrNone(r);
-			iLock->Signal();
-			Start(t, EPriorityMore);
-			Wait(t, KErrTimedOut);
-			iLock->Signal();
-			Start(t, EPriorityMore);
-			Wait(t, KErrNone);
-			}
-		r = iLock->Poll();
-		test_KErrNone(r);
-		if (!nestable)
-			{
-			r = iLock->Poll();
-			test_Equal(KErrTimedOut, r);
-			iLock->Signal();
-			if (!limit1)
-				{
-				iLock->Signal();
-				r = iLock->Poll();
-				test_KErrNone(r);
-				}
-			r = iLock->Poll();
-			test_KErrNone(r);
-			r = iLock->Poll();
-			test_Equal(KErrTimedOut, r);
-			}
-		elapsed = DoTest2(t, EPoll, KErrTimedOut);
-		test.Printf(_L("Time taken = %dus\n"), elapsed);
-		test(elapsed<=50000+3*overhead);
-		iLock->Signal();
-		elapsed = DoTest2(t, EPoll, KErrNone);
-		test.Printf(_L("Time taken = %dus\n"), elapsed);
-		test(elapsed<=50000+3*overhead);
-		TestState();
-		iLock->Signal();
-		r = LockCurrentThreadToCpu0(ETrue);
-		test_KErrNone(r);
-		Start(t, EPriorityMuchMore);
-		Start(t2, EPriorityMore);
-		test_Equal(EExitKill, t2.ExitType());
-		test_Equal(EExitKill, t.ExitType());
-		Wait(t2, limit1 ? KErrNone : KErrTimedOut);
-		Wait(t, KErrNone);
-		r = UnlockCurrentThreadToCpu0(ETrue);
-		test_KErrNone(r);
-		TestState();
-		}
-	else
-		{
-		test.Printf(_L("Poll() function not supported\n"));
-		}
+	ws.iTimeout=2000000;
+	initial.HomeTime();
+	StartWaitSemThread(t, ws);
+	User::After(1000000);
+	ws.iSem.Signal();
+	WaitForWaitSemThread(t, KErrNone);
+	final.HomeTime();
+	elapsed = I64INT(final.Int64()-initial.Int64());
+	test.Printf(_L("Time taken = %dus\n"), elapsed);
+	test(elapsed>=900000+overhead && elapsed<1500000+overhead);
 
-	if (to)
-		{
-		iTimeout=2000000;
-		initial.HomeTime();
-		Start(t);
-		User::After(1000000);
-		iLock->Signal();
-		Wait(t, KErrNone);
-		final.HomeTime();
-		elapsed = I64INT(final.Int64()-initial.Int64());
-		test.Printf(_L("Time taken = %dus\n"), elapsed);
-		test(elapsed>=900000+overhead && elapsed<1500000+overhead);
-		TestState();
+	ws.iTimeout=100000;
+	StartWaitSemThread(t, ws, EPriorityMore);
+	t.Suspend();
+	ws.iSem.Signal();
+	User::After(200000);
+	t.Resume();
+	WaitForWaitSemThread(t, KErrTimedOut);
+	test_KErrNone(ws.iSem.Wait(1));
 
-		r = LockCurrentThreadToCpu0(ETrue);
-		test_KErrNone(r);
+	ws.iTimeout=100000;
+	StartWaitSemThread(t, ws, EPriorityMore);
+	t.Suspend();
+	ws.iSem.Signal();
+	User::After(50000);
+	t.Resume();
+	WaitForWaitSemThread(t, KErrNone);
+	test_Equal(KErrTimedOut, ws.iSem.Wait(1));
 
-		if (!lto)
-			{
-			iTimeout=100000;
-			Start(t, EPriorityMore);
-			t.Suspend();
-			iLock->Signal();
-			User::After(200000);
-			t.Resume();
-			Wait(t, KErrTimedOut);
-			TestSignalled();
+	RThread t2;
+	ws.iTimeout=100000;
+	StartWaitSemThread(t, ws, EPriorityMuchMore);
+	StartWaitSemThread(t2, ws, EPriorityMore);
+	t.Suspend();
+	ws.iSem.Signal();
+	test_Equal(EExitKill, t2.ExitType());
+	test_Equal(EExitPending, t.ExitType());
+	t.Resume();
+	WaitForWaitSemThread(t, KErrTimedOut);
+	WaitForWaitSemThread(t2, KErrNone);
+	test_Equal(KErrTimedOut, ws.iSem.Wait(1));
 
-			iTimeout=100000;
-			Start(t, EPriorityMore);
-			t.Suspend();
-			iLock->Signal();
-			User::After(50000);
-			t.Resume();
-			Wait(t, KErrNone);
-			TestState();
-
-			iTimeout=100000;
-			Start(t, EPriorityMuchMore);
-			Start(t2, EPriorityMore);
-			t.Suspend();
-			iLock->Signal();
-			test_Equal(EExitKill, t2.ExitType());
-			test_Equal(EExitPending, t.ExitType());
-			t.Resume();
-			Wait(t, limit1 ? KErrNone : KErrTimedOut);
-			Wait(t2, KErrNone);
-			TestState();
-			}
+	ws.iTimeout=1000000;
+	initial.HomeTime();
+	StartWaitSemThread(t2, ws, EPriorityMore);
+	StartWaitSemThread(t, ws, EPriorityMuchMore);
+	ws.iSem.Signal();
+	WaitForWaitSemThread(t, KErrNone);
+	final.HomeTime();
+	elapsed = I64INT(final.Int64()-initial.Int64());
+	test.Printf(_L("Time taken = %dus\n"), elapsed);
+	WaitForWaitSemThread(t2, KErrTimedOut);
+	final.HomeTime();
+	elapsed = I64INT(final.Int64()-initial.Int64());
+	test.Printf(_L("Time taken = %dus\n"), elapsed);
+	test(elapsed>=900000+2*overhead && elapsed<1500000+2*overhead);
 
-		iTimeout=1000000;
-		initial.HomeTime();
-		Start(t2, EPriorityMore);
-		Start(t, EPriorityMuchMore);
-		iLock->Signal();
-		Wait(t, KErrNone);
-		final.HomeTime();
-		elapsed = I64INT(final.Int64()-initial.Int64());
-		test.Printf(_L("Time taken = %dus\n"), elapsed);
-		Wait(t2, limit1 ? KErrNone : KErrTimedOut);
-		final.HomeTime();
-		elapsed = I64INT(final.Int64()-initial.Int64());
-		test.Printf(_L("Time taken = %dus\n"), elapsed);
-		if (!limit1)
-			{
-			test(elapsed>=900000+2*overhead && elapsed<1500000+2*overhead);
-			}
-		TestState();
-
-		iTimeout=1000000;
-		initial.HomeTime();
-		Start(t2, EPriorityMore);
-		Start(t, EPriorityMuchMore);
-		Wait(t, KErrTimedOut);
-		final.HomeTime();
-		elapsed = I64INT(final.Int64()-initial.Int64());
-		test.Printf(_L("Time taken = %dus\n"), elapsed);
-		Wait(t2, KErrTimedOut);
-		final.HomeTime();
-		elapsed = I64INT(final.Int64()-initial.Int64());
-		test.Printf(_L("Time taken = %dus\n"), elapsed);
-		test(elapsed>=900000+2*overhead && elapsed<1500000+2*overhead);
+	ws.iTimeout=1000000;
+	initial.HomeTime();
+	StartWaitSemThread(t2, ws, EPriorityMore);
+	StartWaitSemThread(t, ws, EPriorityMuchMore);
+	WaitForWaitSemThread(t, KErrTimedOut);
+	final.HomeTime();
+	elapsed = I64INT(final.Int64()-initial.Int64());
+	test.Printf(_L("Time taken = %dus\n"), elapsed);
+	WaitForWaitSemThread(t2, KErrTimedOut);
+	final.HomeTime();
+	elapsed = I64INT(final.Int64()-initial.Int64());
+	test.Printf(_L("Time taken = %dus\n"), elapsed);
+	test(elapsed>=900000+2*overhead && elapsed<1500000+2*overhead);
 
-		iTimeout=1000000;
-		initial.HomeTime();
-		Start(t2, EPriorityMore);
-		Start(t, EPriorityMuchMore);
-		t.Kill(299792458);
-		Wait(t2, KErrTimedOut);
-		Wait(t, 299792458);
-		final.HomeTime();
-		elapsed = I64INT(final.Int64()-initial.Int64());
-		test.Printf(_L("Time taken = %dus\n"), elapsed);
-		test(elapsed>=900000+2*overhead && elapsed<1500000+2*overhead);
+	ws.iTimeout=1000000;
+	initial.HomeTime();
+	StartWaitSemThread(t2, ws, EPriorityMore);
+	StartWaitSemThread(t, ws, EPriorityMuchMore);
+	t.Kill(299792458);
+	WaitForWaitSemThread(t2, KErrTimedOut);
+	WaitForWaitSemThread(t, 299792458);
+	final.HomeTime();
+	elapsed = I64INT(final.Int64()-initial.Int64());
+	test.Printf(_L("Time taken = %dus\n"), elapsed);
+	test(elapsed>=900000+2*overhead && elapsed<1500000+2*overhead);
 
-		iTimeout=1000000;
-		initial.HomeTime();
-		Start(t, EPriorityMore);
-		Start(t2, EPriorityMuchMore);
-		test_Equal(EExitPending, t.ExitType());
-		test_Equal(EExitPending, t2.ExitType());
-		iLock->Release();
-		test_Equal(EExitKill, t.ExitType());
-		test_Equal(EExitKill, t2.ExitType());
-		Wait(t2, KErrGeneral);
-		Wait(t, KErrGeneral);
-		final.HomeTime();
-		elapsed = I64INT(final.Int64()-initial.Int64());
-		test.Printf(_L("Time taken = %dus\n"), elapsed);
-		test(elapsed<=50000+3*overhead);
-		r = UnlockCurrentThreadToCpu0(ETrue);
-		test_KErrNone(r);
-		}
-	else
-		{
-		test.Printf(_L("Timed waits not supported\n"));
-		iLock->Release();
-		}
+	ws.iTimeout=1000000;
+	initial.HomeTime();
+	StartWaitSemThread(t, ws, EPriorityMore);
+	StartWaitSemThread(t2, ws, EPriorityMuchMore);
+	test_Equal(EExitPending, t.ExitType());
+	test_Equal(EExitPending, t2.ExitType());
+	ws.iSem.Close();
+	test_Equal(EExitKill, t.ExitType());
+	test_Equal(EExitKill, t2.ExitType());
+	WaitForWaitSemThread(t2, KErrGeneral);
+	WaitForWaitSemThread(t, KErrGeneral);
+	final.HomeTime();
+	elapsed = I64INT(final.Int64()-initial.Int64());
+	test.Printf(_L("Time taken = %dus\n"), elapsed);
+	test(elapsed<=50000+3*overhead);
+
 	test.End();
 	}
 
-volatile TBool NoRepeat = EFalse;
-void TestPollTimeout()
-	{
-	SWaitLock w;
-	do	{
-		test.Printf(_L("TestPollTimeout - RSemaphore\n"));
-		LockS ls;
-		w.iLock = &ls;
-		w.Test2();	// Release()s ls
-		} while(NoRepeat);
-	do	{
-		test.Printf(_L("TestPollTimeout - RMutex\n"));
-		LockM lm;
-		w.iLock = &lm;
-		w.Test2();	// Release()s lm
-		} while(NoRepeat);
-	do	{
-		test.Printf(_L("TestPollTimeout - RFastLock\n"));
-		LockFL fl;
-		w.iLock = &fl;
-		w.Test2();	// Release()s fl
-		} while(NoRepeat);
-	}
-
-
-/*----------------------------------------------------------------------------*/
-class CMXThreadGrp;
-
-struct SStats
-	{
-	SStats();
-	void Add(TInt aValue);
-	void Add(const SStats& aS);
-	TInt Count() const {return iN;}
-	TInt Min() const;
-	TInt Max() const;
-	TInt Mean() const;
-
-	TInt64	iSum;
-	TInt	iMin;
-	TInt	iMax;
-	TInt	iN;
-	TInt	iSp;
-	};
-
-SStats::SStats()
-	{
-	iSum = 0;
-	iMax = KMinTInt;
-	iMin = ~iMax;
-	iN = 0;
-	iSp = 0;
-	}
-
-void SStats::Add(TInt aValue)
-	{
-	TInt64 v = aValue;
-	iSum += v;
-	++iN;
-	if (aValue > iMax)
-		iMax = aValue;
-	if (aValue < iMin)
-		iMin = aValue;
-	}
-
-void SStats::Add(const SStats& a)
-	{
-	iN += a.iN;
-	iSum += a.iSum;
-	if (a.iMax > iMax)
-		iMax = a.iMax;
-	if (a.iMin < iMin)
-		iMin = a.iMin;
-	}
-
-TInt SStats::Min() const
-	{return iN ? iMin : 0;}
-
-TInt SStats::Max() const
-	{return iN ? iMax : 0;}
-
-TInt SStats::Mean() const
-	{
-	if (iN==0)
-		return 0;
-	return (TInt)(iSum/TInt64(iN));
-	}
-
-TUint32 ticks_to_us(TUint32 aTicks, TUint32 aF)
-	{
-	TUint64 x = aTicks;
-	TUint64 f = aF;
-	x *= TUint64(1000000);
-	x += (f>>1);
-	x /= f;
-	return I64LOW(x);
-	}
-
-class CMXThread : public CBase
-	{
-private:
-	CMXThread();
-	~CMXThread();
-	static CMXThread* New(CMXThreadGrp* aG, TUint32 aId, TUint32 aL, TUint32 aD);
-	void Start();
-	void Wait();
-	TInt Construct(CMXThreadGrp* aG, TUint32 aId, TUint32 aL, TUint32 aD);
-	TInt Steps();
-	TInt Action();
-	TInt Run();
-	static TInt ThreadFunc(TAny*);
-	void PrintStats();
-private:
-	TUint64 iSeed;
-	RThread	iThread;
-	TRequestStatus iExitStatus;
-	CMXThreadGrp* iG;
-	LFSR* iDummyLfsr;
-	TUint32 iId;
-	TUint32 iLambda;
-	TUint32 iDummySteps;
-	TInt iTotalSteps;
-	TInt iIterations;
-	TInt iPolls;
-	TInt iPollFails;
-	SStats iStats;
-	SStats iTimeoutStats;
-private:
-	friend class CMXThreadGrp;
-	};
-
-class CMXThreadGrp : public CBase
-	{
-public:
-	static CMXThreadGrp* New(MLock* aLock, TInt aNThreads, TUint32 aLambda, TUint32 aDummySteps, TUint32 aTime);
-	CMXThreadGrp();
-	~CMXThreadGrp();
-	TBool Run();
-	void PrintStats();
-private:
-	TInt Construct(MLock* aLock, TInt aNThreads, TUint32 aLambda, TUint32 aDummySteps, TUint32 aTime);
-private:
-	TInt iNThreads;
-	CMXThread** iThreads;
-	MLock* iLock;
-	LFSR* iLfsr;
-	LFSR* iLfsr0;
-	TUint32 iNTickPeriod;
-	TUint32 iFCF;
-	TUint32 iNTicks;
-	TInt iTotalSteps;
-	TInt iIterations;
-	TInt iPolls;
-	TInt iPollFails;
-	SStats iStats;
-	SStats iTimeoutStats;
-private:
-	friend class CMXThread;
-	};
-
-CMXThread::CMXThread()
-	{
-	iThread.SetHandle(0);
-	}
-
-CMXThread::~CMXThread()
-	{
-	delete iDummyLfsr;
-	if (iThread.Handle())
-		{
-		if (iThread.ExitType() == EExitPending)
-			{
-			iThread.Kill(0);
-			Wait();
-			}
-		CLOSE_AND_WAIT(iThread);
-		}
-	}
-
-void CMXThread::PrintStats()
-	{
-	test.Printf(_L("Thread %d:\n"), iId);
-	test.Printf(_L(" ST:%10d IT:%10d P:%10d PF:%10d TO:%10d\n"), iTotalSteps, iIterations, iPolls, iPollFails, iTimeoutStats.Count());
-	TUint32 min, max, mean;
-	min = ticks_to_us(iStats.Min(), iG->iFCF);
-	max = ticks_to_us(iStats.Max(), iG->iFCF);
-	mean = ticks_to_us(iStats.Mean(), iG->iFCF);
-	test.Printf(_L(" Lock acquire times MIN %10d MAX %10d AVG %10d\n"), min, max, mean);
-	min = ticks_to_us(iTimeoutStats.Min(), iG->iFCF);
-	max = ticks_to_us(iTimeoutStats.Max(), iG->iFCF);
-	mean = ticks_to_us(iTimeoutStats.Mean(), iG->iFCF);
-	test.Printf(_L(" Lock timeout times MIN %10d MAX %10d AVG %10d\n"), min, max, mean);
-	}
-
-TInt CMXThread::Construct(CMXThreadGrp* aG, TUint32 aId, TUint32 aL, TUint32 aD)
-	{
-	iG = aG;
-	iId = aId;
-	iLambda = aL;
-	iDummySteps = aD;
-	iSeed = iId + 1;
-	iDummyLfsr = new LFSR(785,693);
-	if (!iDummyLfsr)
-		return KErrNoMemory;
-	TBuf<16> name = _L("TSThrd");
-	name.AppendNum(iId);
-	TInt r = iThread.Create(name, &ThreadFunc, 0x1000, NULL, this);
-	if (r!=KErrNone)
-		return r;
-	iThread.Logon(iExitStatus);
-	if (iExitStatus != KRequestPending)
-		{
-		iThread.Kill(0);
-		iThread.Close();
-		iThread.SetHandle(0);
-		return iExitStatus.Int();
-		}
-	iThread.SetPriority(EPriorityLess);
-	return KErrNone;
-	}
-
-CMXThread* CMXThread::New(CMXThreadGrp* aG, TUint32 aId, TUint32 aL, TUint32 aD)
-	{
-	CMXThread* p = new CMXThread;
-	if (p)
-		{
-		TInt r = p->Construct(aG, aId, aL, aD);
-		if (r != KErrNone)
-			{
-			delete p;
-			p = 0;
-			}
-		}
-	return p;
-	}
-
-void CMXThread::Start()
-	{
-	iThread.Resume();
-	}
-
-void CMXThread::Wait()
-	{
-	User::WaitForRequest(iExitStatus);
-	}
-
-TInt CMXThread::ThreadFunc(TAny* aPtr)
-	{
-	CMXThread& a = *(CMXThread*)aPtr;
-	return a.Run();
-	}
-
-TInt CMXThread::Steps()
-	{
-	Random(iSeed);
-	return ExpRV(iSeed, iLambda, 1);
-	}
-
-TInt CMXThread::Action()
-	{
-	Random(iSeed);
-	return I64LOW(iSeed)%3;
-	}
-
-TInt CMXThread::Run()
-	{
-	MLock* lock = iG->iLock;
-	LFSR* lfsr = iG->iLfsr;
-	TInt lfl = lock->Flags();
-	TBool pollable = lfl & MLock::EPollable;
-	TBool to = lfl & MLock::ETimeoutAvail;
-	TUint32 start_time = User::NTickCount();
-	TInt r;
-
-	FOREVER
-		{
-		TUint32 now = User::NTickCount();
-		if (now - start_time >= iG->iNTicks)
-			break;
-		++iIterations;
-		iDummyLfsr->Step(iDummySteps);
-		TInt action = Action();
-		TInt steps = Steps();
-		TUint32 initial = User::FastCounter();
-		if (action==2 && to)
-			{
-			r = lock->Wait(1000);
-			if (r!=KErrNone)
-				{
-				TUint32 final = User::FastCounter();
-				TInt elapsed = TInt(final - initial);
-				iTimeoutStats.Add(elapsed);
-				}
-			}
-		else if (action==1 && pollable)
-			{
-			++iPolls;
-			r = lock->Poll();
-			if (r!=KErrNone)
-				++iPollFails;
-			}
-		else
-			{
-			lock->Wait();
-			r = KErrNone;
-			}
-		if (r == KErrNone)
-			{
-			TUint32 final = User::FastCounter();
-			lfsr->Step(steps);
-			lock->Signal();
-			TInt elapsed = TInt(final - initial);
-			iTotalSteps += steps;
-			iStats.Add(elapsed);
-			}
-		}
-
-	return KErrNone;
-	}
-
-CMXThreadGrp* CMXThreadGrp::New(MLock* aLock, TInt aNThreads, TUint32 aLambda, TUint32 aDummySteps, TUint32 aTime)
-	{
-	CMXThreadGrp* p = new CMXThreadGrp;
-	if (p)
-		{
-		TInt r = p->Construct(aLock, aNThreads, aLambda, aDummySteps, aTime);
-		if (r != KErrNone)
-			{
-			delete p;
-			p = 0;
-			}
-		}
-	return p;
-	}
-
-CMXThreadGrp::CMXThreadGrp()
-	{
-	}
-
-TInt CMXThreadGrp::Construct(MLock* aLock, TInt aNThreads, TUint32 aLambda, TUint32 aDummySteps, TUint32 aTime)
-	{
-	iNThreads = aNThreads;
-	iLock = aLock;
-	TInt r = HAL::Get(HAL::EFastCounterFrequency, (TInt&)iFCF);
-	if (r!=KErrNone)
-		return r;
-	r = HAL::Get(HAL::ENanoTickPeriod, (TInt&)iNTickPeriod);
-	if (r!=KErrNone)
-		return r;
-	iNTicks = (aTime+iNTickPeriod-1)/iNTickPeriod;
-	iLfsr = new LFSR(785,693);
-	iLfsr0 = new LFSR(785,693);
-	if (!iLfsr || !iLfsr0)
-		return KErrNoMemory;
-	iThreads = (CMXThread**)User::AllocZ(iNThreads*sizeof(CMXThread*));
-	if (!iThreads)
-		return KErrNoMemory;
-	TInt i;
-	for (i=0; i<iNThreads; ++i)
-		{
-		iThreads[i] = CMXThread::New(this, i, aLambda, aDummySteps);
-		if (!iThreads[i])
-			return KErrNoMemory;
-		}
-	return KErrNone;
-	}
-
-CMXThreadGrp::~CMXThreadGrp()
-	{
-	delete iLfsr;
-	delete iLfsr0;
-	if (iThreads)
-		{
-		TInt i;
-		for (i=0; i<iNThreads; ++i)
-			delete iThreads[i];
-		}
-	User::Free(iThreads);
-	}
-
-TBool CMXThreadGrp::Run()
-	{
-	TInt i;
-	test.Printf(_L("Starting test with N=%d L=%d D=%d T=%d\n"), iNThreads, iThreads[0]->iLambda, iThreads[0]->iDummySteps, iNTicks);
-	for (i=0; i<iNThreads; ++i)
-		iThreads[i]->Start();
-	for (i=0; i<iNThreads; ++i)
-		iThreads[i]->Wait();
-	for (i=0; i<iNThreads; ++i)
-		{
-		iTotalSteps += iThreads[i]->iTotalSteps;
-		iIterations += iThreads[i]->iIterations;
-		iPolls += iThreads[i]->iPolls;
-		iPollFails += iThreads[i]->iPollFails;
-		iStats.Add(iThreads[i]->iStats);
-		iTimeoutStats.Add(iThreads[i]->iTimeoutStats);
-		}
-	test.Printf(_L("Total LFSR steps %d\n"), iTotalSteps);
-	iLfsr0->Step(iTotalSteps);
-	TBool ok = (*iLfsr == *iLfsr0);
-	return ok;
-	}
-
-void CMXThreadGrp::PrintStats()
-	{
-	TInt i;
-	for (i=0; i<iNThreads; ++i)
-		{
-		iThreads[i]->PrintStats();
-		}
-	test.Printf(_L("TOTALS:\n"));
-	test.Printf(_L(" ST:%10d IT:%10d P:%10d PF:%10d TO:%10d\n"), iTotalSteps, iIterations, iPolls, iPollFails, iTimeoutStats.Count());
-	TUint32 min, max, mean;
-	min = ticks_to_us(iStats.Min(), iFCF);
-	max = ticks_to_us(iStats.Max(), iFCF);
-	mean = ticks_to_us(iStats.Mean(), iFCF);
-	test.Printf(_L(" Lock acquire times MIN %10d MAX %10d AVG %10d\n"), min, max, mean);
-	min = ticks_to_us(iTimeoutStats.Min(), iFCF);
-	max = ticks_to_us(iTimeoutStats.Max(), iFCF);
-	mean = ticks_to_us(iTimeoutStats.Mean(), iFCF);
-	test.Printf(_L(" Lock timeout times MIN %10d MAX %10d AVG %10d\n"), min, max, mean);
-	}
-
-TUint32 Calibrate()
-	{
-	TUint32 fcf;
-	TInt r = HAL::Get(HAL::EFastCounterFrequency, (TInt&)fcf);
-	test_KErrNone(r);
-	LFSR* d = new LFSR(785,693);
-	test(d!=0);
-	TInt steps = 2;
-	TUint32 ticks = fcf/10;
-	TUint32 elapsed;
-	FOREVER
-		{
-		TUint32 h0 = User::FastCounter();
-		d->Step(steps);
-		TUint32 h1 = User::FastCounter();
-		elapsed = h1 - h0;
-		if (elapsed > ticks)
-			break;
-		steps *= 2;
-		}
-	delete d;
-	test.Printf(_L("%d steps in %d fast ticks\n"), steps, elapsed);
-	TUint64 x = elapsed;
-	TUint64 s = steps;
-	TUint64 y = fcf;
-	y /= x;
-	s *= y;	// steps per second
-	TUint32 res = I64LOW(s);
-	test.Printf(_L("%d steps per second\n"), res);
-	return res;
-	}
-
-void DoTMX(MLock* aLock, TInt aNThreads, TUint32 aLambda, TUint32 aDummySteps, TUint32 aTime, TBool aShouldFail=EFalse)
-	{
-	CMXThreadGrp* g = CMXThreadGrp::New(aLock, aNThreads, aLambda, aDummySteps, aTime);
-	test(g!=0);
-	TBool ok = g->Run();
-	if (aShouldFail)
-		{
-		test(!ok);
-		}
-	else
-		{
-		test(ok);
-		}
-	g->PrintStats();
-	delete g;
-	}
-
-void DoTMX(MLock* aLock, TUint32 aLambda, TUint32 aDummySteps, TUint32 aTime)
-	{
-	TInt n;
-	for (n=1; n<=4; ++n)
-		{
-		TUint32 l = (n<2) ? aLambda : (aLambda/(n-1));
-		DoTMX(aLock, n, l, aDummySteps, aTime);
-		}
-	aLock->Release();
-	}
-
-
-void TestMutualExclusion()
-	{
-	TInt ntp;
-	TInt r = HAL::Get(HAL::ENanoTickPeriod, ntp);
-	test_KErrNone(r);
-	test.Printf(_L("Nanokernel tick period = %dus\n"), ntp);
-	TUint32 sps = Calibrate();
-	TUint32 lambda = sps/2000;
-	TUint32 dummy = sps/2000;
-	TUint32 time = 5000000;
-	do	{
-		test.Printf(_L("TestMutualExclusion - RSemaphore\n"));
-		LockS ls;
-		DoTMX(&ls, lambda, dummy, time);
-		} while(NoRepeat);
-	do	{
-		test.Printf(_L("TestMutualExclusion - RSemaphore init=2\n"));
-		LockS ls2;
-		ls2.Signal();	// count=2
-		DoTMX(&ls2, 4, lambda, dummy, time, ETrue);
-		} while(NoRepeat);
-	do	{
-		test.Printf(_L("TestMutualExclusion - RMutex\n"));
-		LockM lm;
-		DoTMX(&lm, lambda, dummy, time);
-		} while(NoRepeat);
-	do	{
-		test.Printf(_L("TestMutualExclusion - RFastLock\n"));
-		LockFL fl;
-		DoTMX(&fl, lambda, dummy, time);
-		} while(NoRepeat);
-	do	{
-		test.Printf(_L("TestMutualExclusion - RCriticalSection\n"));
-		LockCS cs;
-		DoTMX(&cs, lambda, dummy, time);
-		} while(NoRepeat);
-	}
-
-
-
-
-/*----------------------------------------------------------------------------*/
 void TestSemaphore()
 	{
 /*********** TO DO ************/
@@ -1479,23 +417,23 @@
 	test.Next(_L("Producer/Consumer scenario"));
 	// Test Rsemaphore with the producer/consumer scenario	RThread thread1, thread2;
 	TRequestStatus stat1, stat2;
-	test(mutex.CreateLocal()==KErrNone);
-	test(slotAvailable.CreateLocal(KMaxBufferSize)==KErrNone);
-	test(itemAvailable.CreateLocal(0)==KErrNone);
-	test(thread1.Create(_L("Thread1"),Producer,KDefaultStackSize,0x200,0x200,NULL)==KErrNone);
-	test(thread2.Create(_L("Thread2"),Consumer,KDefaultStackSize,0x200,0x200,NULL)==KErrNone);
+	test_KErrNone(mutex.CreateLocal());
+	test_KErrNone(slotAvailable.CreateLocal(KMaxBufferSize));
+	test_KErrNone(itemAvailable.CreateLocal(0));
+	test_KErrNone(thread1.Create(_L("Thread1"),Producer,KDefaultStackSize,0x200,0x200,NULL));
+	test_KErrNone(thread2.Create(_L("Thread2"),Consumer,KDefaultStackSize,0x200,0x200,NULL));
 	thread1.Logon(stat1);
 	thread2.Logon(stat2);
-	test(stat1==KRequestPending);
-	test(stat2==KRequestPending);
+	test_Equal(KRequestPending, stat1.Int());
+	test_Equal(KRequestPending, stat2.Int());
 	thread1.Resume(); 
 	thread2.Resume();
 	User::WaitForRequest(stat1);
 	User::WaitForRequest(stat2);
-	test(stat1==KErrNone);
-	test(stat2==KErrNone);
+	test_KErrNone(stat1.Int());
+	test_KErrNone(stat2.Int());
 	for(TInt jj=0;jj<KNumProducerItems;jj++)
-		test(consumerArray[jj]==jj);		
+		test_Equal(jj, consumerArray[jj]);		
 	
 	test.Next(_L("Close"));
 	mutex.Close();
@@ -1508,7 +446,7 @@
 	{
 	RMutex m;
 	test.Start(_L("Create"));
-	test(m.CreateLocal()==KErrNone);
+	test_KErrNone(m.CreateLocal());
 
 	// Test RMutex::IsHeld()
 	test.Next(_L("IsHeld ?"));
@@ -1528,7 +466,7 @@
 void TestMutex()
 	{
 	test.Start(_L("Create"));
-	test(mutex.CreateLocal()==KErrNone);
+	test_KErrNone(mutex.CreateLocal());
 	
 	test.Next(_L("Threads writing to arrays test"));
 //
@@ -1542,19 +480,19 @@
 //
 	arrayIndex=0;
 	RThread thread1,thread2;	
-	test(thread1.Create(_L("Thread1"),MutexThreadEntryPoint1,KDefaultStackSize,0x2000,0x2000,NULL)==KErrNone);
-	test(thread2.Create(_L("Thread2"),MutexThreadEntryPoint2,KDefaultStackSize,0x2000,0x2000,NULL)==KErrNone);			 
+	test_KErrNone(thread1.Create(_L("Thread1"),MutexThreadEntryPoint1,KDefaultStackSize,0x2000,0x2000,NULL));
+	test_KErrNone(thread2.Create(_L("Thread2"),MutexThreadEntryPoint2,KDefaultStackSize,0x2000,0x2000,NULL));			 
 	TRequestStatus stat1,stat2;
 	thread1.Logon(stat1);
 	thread2.Logon(stat2);
-	test(stat1==KRequestPending);
-	test(stat2==KRequestPending);
+	test_Equal(KRequestPending, stat1.Int());
+	test_Equal(KRequestPending, stat2.Int());
 	thread1.Resume(); 
 	thread2.Resume();
 	User::WaitForRequest(stat1);
 	User::WaitForRequest(stat2);
-	test(stat1==KErrNone);
-	test(stat2==KErrNone); 
+	test_KErrNone(stat1.Int());
+	test_KErrNone(stat2.Int()); 
 	TInt thread1ActualCount=0; 
 	TInt thread2ActualCount=0;
 	TInt ii=0;
@@ -1566,11 +504,11 @@
 			thread2ActualCount++;
 		ii++;
 		}
-	test.Printf(_L("T1 %d T1ACT %d T2 %d T2ACT %d\n"),thread1Count,thread1ActualCount,thread2Count,thread2ActualCount);
-	test(thread1ActualCount==thread1Count);
-	test(thread2ActualCount==thread2Count);
-	test(thread1Count==thread2Count);
-	test(thread1Count==(KMaxArraySize>>1));
+	test.Printf(_L("T1 %d T1ACT %d T2 %d T2ACT %d"),thread1Count,thread1ActualCount,thread2Count,thread2ActualCount);
+	test_Equal(thread1Count, thread1ActualCount);
+	test_Equal(thread2Count, thread2ActualCount);
+	test_Equal(thread2Count, thread1Count);
+	test_Equal((KMaxArraySize>>1), thread1Count);
 	
 	test.Next(_L("Close"));
 	CLOSE_AND_WAIT(thread1);
@@ -1586,7 +524,7 @@
 	{
 	
 	test.Start(_L("Create"));
-	test(criticalSn.CreateLocal()==KErrNone);
+	test_KErrNone(criticalSn.CreateLocal());
 
 /***************** TO DO ***********************
 
@@ -1615,21 +553,20 @@
 // threads think.
 //
 	arrayIndex=0;
-
 	RThread thread1,thread2;	
-	test(thread1.Create(_L("Thread1"),CriticalSnThreadEntryPoint1,KDefaultStackSize,0x2000,0x2000,NULL)==KErrNone);
-	test(thread2.Create(_L("Thread2"),CriticalSnThreadEntryPoint2,KDefaultStackSize,0x2000,0x2000,NULL)==KErrNone);			 
+	test_KErrNone(thread1.Create(_L("Thread1"),CriticalSnThreadEntryPoint1,KDefaultStackSize,0x2000,0x2000,NULL));
+	test_KErrNone(thread2.Create(_L("Thread2"),CriticalSnThreadEntryPoint2,KDefaultStackSize,0x2000,0x2000,NULL));			 
 	TRequestStatus stat1,stat2;
 	thread1.Logon(stat1);
 	thread2.Logon(stat2);
-	test(stat1==KRequestPending);
-	test(stat2==KRequestPending);
+	test_Equal(KRequestPending, stat1.Int());
+	test_Equal(KRequestPending, stat2.Int());
 	thread1.Resume(); 
 	thread2.Resume();
 	User::WaitForRequest(stat1);
 	User::WaitForRequest(stat2);
-	test(stat1==KErrNone);
-	test(stat2==KErrNone); 
+	test_KErrNone(stat1.Int());
+	test_KErrNone(stat2.Int()); 
 	TInt thread1ActualCount=0; 
 	TInt thread2ActualCount=0;
 	TInt ii=0;
@@ -1641,10 +578,10 @@
 			thread2ActualCount++;
 		ii++;
 		}
-	test(thread1ActualCount==thread1Count);
-	test(thread2ActualCount==thread2Count);
-	test(thread1Count==thread2Count);
-	test(thread1Count==(KMaxArraySize>>1));
+	test_Equal(thread1Count, thread1ActualCount);
+	test_Equal(thread2Count, thread2ActualCount);
+	test_Equal(thread2Count, thread1Count);
+	test_Equal((KMaxArraySize>>1), thread1Count);
 
 	test.Next(_L("Close"));
 	CLOSE_AND_WAIT(thread1);
@@ -1656,13 +593,22 @@
 
 GLDEF_C TInt E32Main()
 	{	
+	TInt cpus = UserSvr::HalFunction(EHalGroupKernel, EKernelHalNumLogicalCpus, 0, 0);
+	if (cpus != 1)
+		{
+		test(cpus>1);
+		// This test will require compatibility mode (and probably other changes)
+		// to work on SMP - it depends on explicit scheduling order.
+		test.Printf(_L("T_SEMUTX skipped, does not work on SMP\n"));
+		return KErrNone;
+		}	
+	
 
 	test.Title();
  	__UHEAP_MARK;
-	TestMutualExclusion();
-	TestPollTimeout();
 	test.Start(_L("Test RSemaphore"));
 	TestSemaphore();
+	TestSemaphore2();
 	test.Next(_L("Test RMutex"));
 	TestMutex();
 	TestMutex2();
--- a/kerneltest/e32test/realtime/t_lat2.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/realtime/t_lat2.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -110,14 +110,13 @@
 	SLatencyResults results;
 
 	l.Start();
-	volatile TInt forever = 1;
-	while(forever)
+	FOREVER
 		{
 		User::WaitForAnyRequest();
 		l.GetResults(results);
 		Latencies.Update(results);
 		}
-	return 0;
+	return r;
 	}
 
 void GetLatencies(SFullLatencyResults& aResults)
--- a/kerneltest/e32test/resmanus/d_resmanusbtrace.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,351 +0,0 @@
-// 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:
-// e32test\resmanus\d_resmanusbtrace.cpp
-// 
-//
-
-#include <kernel/kernel.h>
-#include <drivers/resource.h>
-#include <drivers/resourcecontrol.h>
-#include <drivers/resmanus_trace.h>
-#include <drivers/resourcecontrol_trace.h>
-#include "d_resmanusbtraceconst.h"
-#include "d_resmanusbtrace.h"
-
-class DTestFactory : public DLogicalDevice
-//
-// Test LDD factory
-//
-	{
-public:
-	DTestFactory();
-	virtual TInt Install(); 					//overriding pure virtual
-	virtual void GetCaps(TDes8& aDes) const;	//overriding pure virtual
-	virtual TInt Create(DLogicalChannelBase*& aChannel); 	//overriding pure virtual
-	};
-
-class DTest1 : public DLogicalChannelBase
-//
-// Test logical channel
-//
-	{
-public:
-	virtual ~DTest1();
-protected:
-	virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
-	virtual TInt Request(TInt aReqNo, TAny* a1, TAny* a2);
-
-private:
-	TInt DoSendLog(TLogInfo* aInfo);
-	TInt ClientHandle() { return KClientHandle; }
-	};
-
-
-
-DECLARE_STANDARD_LDD()
-	{
-	return new DTestFactory;
-	}
-
-//
-// Constructor
-//
-DTestFactory::DTestFactory()
-	{
-
-	}
-
-TInt DTestFactory::Create(DLogicalChannelBase*& aChannel)
-	{
-//
-// Create new channel
-//
-	aChannel=new DTest1;
-	return aChannel?KErrNone:KErrNoMemory;
-	}
-
-TInt DTestFactory::Install()
-//
-// Install the LDD - overriding pure virtual
-//
-	{
-	return SetName(&KLddName);
-	}
-
-void DTestFactory::GetCaps(TDes8& /*aDes*/) const
-//
-// Get capabilities - overriding pure virtual
-//
-	{
-	}
-
-TInt DTest1::DoCreate(TInt /*aUnit*/, const TDesC8* /*aInfo*/, const TVersion& /*aVer*/)
-//
-// Create channel
-//
-	{
-	return KErrNone;
-	}
-
-DTest1::~DTest1()
-//
-// Destructor
-//
-	{
-	}
-
-TInt DTest1::Request(TInt aReqNo, TAny* a1, TAny* /*a2*/)
-	{
-
-	// 'Control' functions...
-	switch(aReqNo)
-		{
-		// DoControl
-		case RLddTest1::ECONTROL_SENDLOG:
-		    TLogInfo info;
-			DoSendLog(&info);
-			Kern::ThreadRawWrite(&Kern::CurrentThread(), a1, &info, sizeof(info));
-			break;
-		}
-
-	return KErrNone;
-	}
-	
-class TestResource 
-    {
-public:
-    TestResource(const TDesC8& aName, TInt aDefaultLevel)
-        {
-        iName = (HBuf8*)&aName;
-        iDefaultLevel = aDefaultLevel;
-        }
-    HBuf* iName;
-    TInt iDefaultLevel;
-    TInt iResourceId;
-    };
-
-struct TestClient
-    {
-    TDes8* iName;
-    TInt iClientId;
-    };
-
-struct TestCallback
-    {
-    TInt iResourceId;
-    TInt iClientId;
-    };
-
-struct TestNotification
-    {
-    TestCallback iCallback;
-    };
-
-class TestRequest
-    {
-public:
-    TInt ResourceId() {return iResourceId;}
-    TInt ClientId() {return iClientId;}
-    TInt Level() {return iLevel;}
-    TInt iResourceId;
-    TInt iClientId;
-    TInt iLevel;
-    };
-
-TInt DTest1::DoSendLog(TLogInfo* aInfo)
-	{
-	TInt r = KErrNoMemory;
-	
-	TInt iClient = (TInt) KClient;
-	TBuf<80> Buffer;
-	TDes8* iUserNameUsed = &Buffer;
-	Buffer.Append(KCLIENTNAME);
-	Kern::Printf("PRM_US_OPEN_CHANNEL_START_TRACE");
-	PRM_US_OPEN_CHANNEL_START_TRACE
-	
-	Kern::Printf("PRM_US_OPEN_CHANNEL_END_TRACE %x", (TInt)ClientHandle());
-	PRM_US_OPEN_CHANNEL_END_TRACE
-	
-	TUint8 stateRes[3] = {KStatsRes1, KStatsRes2, KStatsRes3};
-	Kern::Printf("PRM_US_REGISTER_CLIENT_START_TRACE");
-	PRM_US_REGISTER_CLIENT_START_TRACE
-
-	Kern::Printf("PRM_US_REGISTER_CLIENT_END_TRACE");
-	PRM_US_REGISTER_CLIENT_END_TRACE
-	
-	Kern::Printf("PRM_US_DEREGISTER_CLIENT_START_TRACE");
-	PRM_US_DEREGISTER_CLIENT_START_TRACE
-	
-    Kern::Printf("PRM_US_DEREGISTER_CLIENT_END_TRACE");
-	PRM_US_DEREGISTER_CLIENT_END_TRACE	
-	
-	TUint resourceId = KResourceId;
-    Kern::Printf("PRM_US_GET_RESOURCE_STATE_START_TRACE");
-	PRM_US_GET_RESOURCE_STATE_START_TRACE
-	
-	TUint aResourceId = KResourceId;
-	TUint aLevel = KLevel;
-	TUint aClient = KClient;
-	TUint aResult = KResult;
-    Kern::Printf("PRM_US_GET_RESOURCE_STATE_END_TRACE");
-	PRM_US_GET_RESOURCE_STATE_END_TRACE
-	
-	TUint newState = KLevel;
-    Kern::Printf("PRM_US_SET_RESOURCE_STATE_START_TRACE");
-	PRM_US_SET_RESOURCE_STATE_START_TRACE
-	
-    Kern::Printf("PRM_US_SET_RESOURCE_STATE_END_TRACE");
-	PRM_US_SET_RESOURCE_STATE_END_TRACE
-	
-	Kern::Printf("PRM_US_CANCEL_GET_RESOURCE_STATE_START_TRACE");
-	PRM_US_CANCEL_GET_RESOURCE_STATE_START_TRACE
-	
-	Kern::Printf("PRM_US_CANCEL_GET_RESOURCE_STATE_END_TRACE");
-	PRM_US_CANCEL_GET_RESOURCE_STATE_END_TRACE
-	
-	Kern::Printf("PRM_US_CANCEL_SET_RESOURCE_STATE_START_TRACE");
-	PRM_US_CANCEL_SET_RESOURCE_STATE_START_TRACE
-	
-	Kern::Printf("PRM_US_CANCEL_SET_RESOURCE_STATE_END_TRACE");
-	PRM_US_CANCEL_SET_RESOURCE_STATE_END_TRACE
-	
-	TPowerResourceInfoV01 ResourceInfo;
-	TPowerResourceInfoV01* pResInfo = &ResourceInfo;
-	TestResource Resource(KRESOURCENAME, KDefaultLevel);
-	TestResource* pR = &Resource;
-	pResInfo->iMinLevel = KMinLevel;
-	pResInfo->iMaxLevel = KMaxLevel;
-	pResInfo->iDefaultLevel = KDefaultLevel;
-	TUint resCount = KResCount;
-    Kern::Printf("PRM_REGISTER_RESOURCE_TRACE");
-	PRM_REGISTER_RESOURCE_TRACE
-	
-	TUint aClientId = KClientId;
-	TBuf8<80> ClientName(KCLIENTNAME);
-	SPowerResourceClient ResourceClient;
-	SPowerResourceClient* pC = &ResourceClient;
-	pC->iName = &ClientName;
-    Kern::Printf("PRM_CLIENT_REGISTER_TRACE");
-	PRM_CLIENT_REGISTER_TRACE
-	
-    Kern::Printf("PRM_CLIENT_DEREGISTER_TRACE");
-	PRM_CLIENT_DEREGISTER_TRACE
-	
-	TInt aNewState = KLevel;
-	pC->iClientId = KClientId;
-	Kern::Printf("PRM_CLIENT_CHANGE_STATE_START_TRACE");
-	PRM_CLIENT_CHANGE_STATE_START_TRACE
-
-	pC->iClientId = KClientId;
-	Kern::Printf("PRM_CLIENT_CHANGE_STATE_END_TRACE");
-	PRM_CLIENT_CHANGE_STATE_END_TRACE
-	
-	TestNotification aN;
-	TestNotification* pN = &aN;
-	pN->iCallback.iResourceId = KResourceId;
-	
-    Kern::Printf("PRM_POSTNOTIFICATION_REGISTER_TRACE");
-	PRM_POSTNOTIFICATION_REGISTER_TRACE
-
-    Kern::Printf("PRM_POSTNOTIFICATION_DEREGISTER_TRACE");
-	PRM_POSTNOTIFICATION_DEREGISTER_TRACE
-	
-    Kern::Printf("PRM_POSTNOTIFICATION_SENT_TRACE");
-	PRM_POSTNOTIFICATION_SENT_TRACE
-	
-	TestCallback* pCb = &(pN->iCallback);
-	pCb->iClientId = KClientId;
-    Kern::Printf("PRM_CALLBACK_COMPLETION_TRACE");
-	PRM_CALLBACK_COMPLETION_TRACE
-	
-	TInt size = KSize;
-	PRM_MEMORY_USAGE_TRACE
-	
-	TestRequest aRequest;
-	aRequest.iClientId = KClientId;
-	aRequest.iResourceId = KResourceId;
-	
-	TDesC8* iName = iUserNameUsed;
-    Kern::Printf("PRM_PSL_RESOURCE_GET_STATE_START_TRACE");
-	PRM_PSL_RESOURCE_GET_STATE_START_TRACE
-	
-    Kern::Printf("PRM_RESOURCE_GET_STATE_START_TRACE");
-	PRM_RESOURCE_GET_STATE_START_TRACE
-	
-	TInt retVal = KRetVal;
-	TInt iCurLevel = KLevel;
-	TInt aState = KLevel;
-    Kern::Printf("PRM_PSL_RESOURCE_GET_STATE_END_TRACE");
-	PRM_PSL_RESOURCE_GET_STATE_END_TRACE
-	
-    Kern::Printf("PRM_RESOURCE_GET_STATE_END_TRACE");
-	PRM_RESOURCE_GET_STATE_END_TRACE
-	
-    Kern::Printf("PRM_RESOURCE_CANCEL_LONGLATENCY_OPERATION_TRACE");
-	PRM_RESOURCE_CANCEL_LONGLATENCY_OPERATION_TRACE
-	
-	aRequest.iLevel = KLevel;
-    Kern::Printf("PRM_PSL_RESOURCE_CHANGE_STATE_START_TRACE");
-	PRM_PSL_RESOURCE_CHANGE_STATE_START_TRACE
-	
-    Kern::Printf("PRM_PSL_RESOURCE_CHANGE_STATE_END_TRACE");
-	PRM_PSL_RESOURCE_CHANGE_STATE_END_TRACE
-	
-	TInt iDefaultLevel = KDefaultLevel;
-	TInt iFlags = KFlags;
-	TInt iMinLevel = KMinLevel;
-	TInt iMaxLevel = KMaxLevel;
-	TInt aReason = KErrNoMemory;
-    Kern::Printf("PRM_PSL_RESOURCE_CREATE_TRACE");
-	PRM_PSL_RESOURCE_CREATE_TRACE
-	
-    Kern::Printf("PRM_BOOTING_TRACE");
-	PRM_BOOTING_TRACE
-	
-	TestResource* aPDRes = &Resource;
-	aPDRes->iResourceId = KResourceId;
-	TestClient Client;
-	TestClient* aClientPtr = &Client;
-	aClientPtr->iName = &ClientName;
-	aClientPtr->iClientId = KClientId;
-    Kern::Printf("PRM_REGISTER_STATIC_RESOURCE_WITH_DEPENDENCY_TRACE");
-	PRM_REGISTER_STATIC_RESOURCE_WITH_DEPENDENCY_TRACE
-
-	TestResource* pDR = &Resource;
-	TInt level = KLevel;
-    Kern::Printf("PRM_REGISTER_DYNAMIC_RESOURCE_TRACE");
-	PRM_REGISTER_DYNAMIC_RESOURCE_TRACE
-	
-    Kern::Printf("PRM_DEREGISTER_DYNAMIC_RESOURCE_TRACE");
-	PRM_DEREGISTER_DYNAMIC_RESOURCE_TRACE
-	
-	TestResource* pR1 = &Resource;
-	TestResource* pR2 = &Resource;
-    Kern::Printf("PRM_REGISTER_RESOURCE_DEPENDENCY_TRACE");
-	PRM_REGISTER_RESOURCE_DEPENDENCY_TRACE
-	
-	TestResource* pDR1 = &Resource;
-	TestResource* pDR2 = &Resource;
-    Kern::Printf("PRM_DEREGISTER_RESOURCE_DEPENDENCY_TRACE");
-	PRM_DEREGISTER_RESOURCE_DEPENDENCY_TRACE
-	
-	aInfo->iPR = &Resource;
-	aInfo->iPC = &ResourceClient;
-	aInfo->iPN = pN;
-	aInfo->iPCb = pCb;
-	aInfo->iPClient = &Client;
-	aInfo->iPCallback = &(pN->iCallback);
-	
-	return KErrNone;
-	}
--- a/kerneltest/e32test/resmanus/d_resmanusbtrace.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-// 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:
-// e32test\resmanus\d_resmanusbtrace.h
-// 
-//
-
-#if !defined(__D_RESMANUSBTRACE_H__)
-#define __D_RESMANUSBTRACE_H__
-
-#include <e32cmn.h>
-#ifndef __KERNEL_MODE__
-#include <e32std.h>
-#endif
-
-_LIT(KLddName,"D_RESMANUSBTRACE.LDD");
-
-class RLddTest1 : public RBusLogicalChannel
-	{
-public:
-	enum TControl
-		{
-		ECONTROL_SENDLOG
-		};
-
-public:
-#ifndef __KERNEL_MODE__
-
-	inline TInt Open()
-		{ return DoCreate(KLddName,TVersion(0,1,1),KNullUnit,NULL,NULL); }
-	inline TInt SendLog(TLogInfo* aInfo)
-		{ return DoControl(ECONTROL_SENDLOG, aInfo); }
-
-#endif 
-	};
-#endif   //__D_RESMANUSBTRACE_H__
--- a/kerneltest/e32test/resmanus/d_resmanusbtrace.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-// 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:
-// e32test/resmanus/d_resmanusbtrace.mmp
-// 
-//
-
-#include "kernel/kern_ext.mmh"
-
-TARGET         d_resmanusbtrace.ldd
-TARGETTYPE     LDD
-SOURCEPATH     .
-SOURCE         d_resmanusbtrace.cpp
-
-
-EPOCALLOWDLLDATA
-
-UID		0x100000af
-VENDORID 0x70000001
-
-macro BTRACE_RESMANUS
-macro BTRACE_RESOURCE_MANAGER
-macro PRM_ENABLE_EXTENDED_VERSION
-capability		all
-
-start wins
-win32_headers
-end
-SMPSAFE
--- a/kerneltest/e32test/resmanus/d_resmanusbtraceconst.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-// 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:
-// e32test\resmanus\d_resmanusbtraceconst.h
-// 
-//
-
-#ifndef D_RESMANUSBTRACECONST_H_
-#define D_RESMANUSBTRACECONST_H_
-
-
-const TUint KClientId = 0x12345678;
-const TInt KClientHandle = 0x10;
-const TUint8 KStatsRes1 = 0x20;
-const TUint8 KStatsRes2 = 0x21;
-const TUint8 KStatsRes3 = 0x22;
-const TUint KResourceId = 0x80;
-const TUint KLevel = 0x90;
-const TUint KClient = 0xC800FFFF;
-const TUint KResult = 0x100;
-const TInt KMinLevel = -99;
-const TInt KMaxLevel = 99;
-const TInt KDefaultLevel = 50;
-const TInt KResCount = 20;
-const TInt KSize = 999;
-const TInt KRetVal = KErrNoMemory;
-const TUint KFlags = 0xAAAAAAAA;
-
-_LIT8(KRESOURCENAME, "ResourceName");
-_LIT8(KCLIENTNAME, "ClientName");
-
-struct TLogInfo
-    {
-    TAny* iPR;
-    TAny* iPC;
-    TAny* iPN;
-    TAny* iPCb;
-    TAny* iPClient;
-    TAny* iPCallback;
-    };
-
-
-
-#endif /* D_RESMANUSBTRACECONST_H_ */
--- a/kerneltest/e32test/resmanus/resourcecontrol.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/resmanus/resourcecontrol.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -30,7 +30,6 @@
 #endif
 
 macro RESOURCE_MANAGER_SIMULATED_PSL
-macro _DUMP_TRACKERS
 macro BTRACE_RESMANUS
 macro PRM_US_INSTRUMENTATION_MACRO
 
--- a/kerneltest/e32test/resmanus/resourcecontrollerextended.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/resmanus/resourcecontrollerextended.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -31,7 +31,6 @@
 
 macro RESOURCE_MANAGER_SIMULATED_PSL
 macro BTRACE_RESMANUS
-macro _DUMP_TRACKERS
 macro PRM_US_INSTRUMENTATION_MACRO
 macro PRM_ENABLE_EXTENDED_VERSION
 
--- a/kerneltest/e32test/resmanus/t_resmanus.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/resmanus/t_resmanus.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -43,6 +43,7 @@
 
 TBuf<16> gTestName(testName);
 
+GLDEF_D RTest gTest(testName);
 GLDEF_D RBusDevResManUs gChannel;
 
 TUint8 KNoOfGetStateRequests = 5;
@@ -74,116 +75,6 @@
 
 TBool gUseCached = EFalse;
 
-class RTestSafe: public RTest
-	{
-public:
-	RTestSafe(const TDesC &aTitle) :
-		RTest(aTitle), iCleanUpLevelMask (0), iFailHdnFunc(NULL)
-		{
-		}
-	RTestSafe(const TDesC &aTitle, void(*func)(RTestSafe &aTest)) :
-		RTest(aTitle), iFailHdnFunc(func)
-		{
-		}
-
-	// new version of operator(int), which calls our cleanup handler if check has failed
-	void operator()(TInt aResult)
-		{
-		if(!aResult && iFailHdnFunc)
-			iFailHdnFunc(*this);
-		RTest::operator ()(aResult);
-		}
-
-	void operator()(TInt aResult, TInt aLineNum)
-		{
-		if(!aResult && iFailHdnFunc)
-			iFailHdnFunc(*this);
-		RTest::operator ()(aResult, aLineNum);
-		}
-
-	void operator()(TInt aResult, TInt aLineNum, const TText* aFileName)
-		{
-		if(!aResult && iFailHdnFunc)
-			iFailHdnFunc(*this);
-		RTest::operator ()(aResult, aLineNum, aFileName);
-		}
-
-	// new version of End, which calls handler before exit..
-	void End()
-		{
-		if(iFailHdnFunc)
-			iFailHdnFunc(*this);
-		RTest::End();
-		}
-
-	void SetCleanupFlag(TUint aFlag)
-		{
-		iCleanUpLevelMask |= 1 << aFlag;
-		}
-
-	TBool CleanupNeeded(TUint aFlag)
-		{
-		return (iCleanUpLevelMask & (1 << aFlag)) >> aFlag;
-		}
-
-	TUint iCleanUpLevelMask;
-	void (*iFailHdnFunc)(RTestSafe &aTest);
-	};
-
-// cleanup handler
-enum TCleanupLevels
-	{
-	EPddLoaded = 0,
-	ELddLoaded,
-	EChannelOpened
-	};
-
-
-void TestCleanup(RTestSafe &aTest)
-	{
-	// cleanup for all 3 levels..
-	if(aTest.CleanupNeeded(EChannelOpened))
-		{
-		gChannel.Close();
-		}
-
-	if(aTest.CleanupNeeded(ELddLoaded))
-		{
-		User::FreeLogicalDevice(KLddRootName);
-		}
-
-	if(aTest.CleanupNeeded(EPddLoaded))
-		{
-		User::FreePhysicalDevice(PDD_NAME);
-		}
-	}
-
-// global gTest object..
-RTestSafe gTest(testName, &TestCleanup);
-
-LOCAL_C TInt CheckCaps()
-	{
-	TInt r = KErrNone;
-	RDevice d;
-	TPckgBuf<TCapsDevResManUs> caps;
-	r = d.Open(KLddRootName);
-	if(r == KErrNone)
-		{
-		d.GetCaps(caps);
-		d.Close();
-
-		TVersion ver = caps().version;
-		if(ver.iMajor != 1 || ver.iMinor != 0 || ver.iBuild != KE32BuildVersionNumber)
-			{
-			gTest.Printf(_L("Capabilities returned wrong version"));
-			gTest.Printf(_L("Expected(1, 0, %d), got (%d , %d, %d)"),
-			                KE32BuildVersionNumber, ver.iMajor, ver.iMinor, ver.iBuild);
-			r = KErrGeneral;
-			}
-		}
-	return r;
-	}
-
 LOCAL_C TInt OpenChannel(TDesC16& aName, RBusDevResManUs& aChannel)
 	{
 	TInt r = KErrNone;
@@ -1248,7 +1139,7 @@
 		}
 
 
-	// Fourth invocation - examine effect of oryginal client requesting a level for 
+	// Fourth invocation - examine effect of orignal client requesting a level for 
 	// the Shared resource
 	if(gHaveSharedRes)
 		{
@@ -1294,6 +1185,7 @@
 			}
 		}
 
+
 	// Close the temporary channels
 	channelTwo.Close();
 	channelThree.Close();
@@ -1451,10 +1343,8 @@
 	TInt r = KErrNone;
 
 	TRequestStatus status;
-	TRequestStatus status2;
 	TBool cached = gUseCached;
 	TInt readValue = 0;
-	TInt readValue2 = 0;
 	TInt levelOwnerId = 0;
 	TInt testNo = 0;
 
@@ -1634,20 +1524,10 @@
 
 	// 8) Call API to get the state of a long latency resource then call API without operation-type qualifier to cancel the request.
 	gTest.Printf(_L("TestGetSetResourceStateOps, starting test %d\n"),testNo++);
-	
-	// NOTE: Cancel operation can only remove request which is still inside the resource controller
-	// message queue. If the queue is empty, the resource controller may process the request very quickly
-	// after it is sent. It may cause the test fail. To solve this, two get long latency resource state 
-	// requests are submitted. So that the second one must be inside the resource controller. 
-	// And we will always test the second request
-	
 	gChannel.GetResourceState(status,gLongLatencyResource,cached,&readValue,&levelOwnerId);
-	gChannel.GetResourceState(status2,gLongLatencyResource,cached,&readValue2,&levelOwnerId);
 	gChannel.CancelAsyncOperation(&status);
-	gChannel.CancelAsyncOperation(&status2);
 	User::WaitForRequest(status);
-	User::WaitForRequest(status2);
-	if(status2.Int() != KErrCancel)
+	if(status.Int() != KErrCancel)
 		{
 		gTest.Printf(_L("TestGetSetResourceStateOps, cancelled get state status = %d\n"),r);
 		return r;
@@ -1655,21 +1535,11 @@
 
 	// 9) Call API to modify the state of the long latency resource then call API without operation-type qualifier to cancel the request.
 	gTest.Printf(_L("TestGetSetResourceStateOps, starting test %d\n"),testNo++);
-	
-	// NOTE: Cancel operation can only remove request which is still inside the resource controller
-	// message queue. If the queue is empty, the resource controller may process the request very quickly
-	// after it is sent. It may cause the test fail. To solve this, two get long latency resource state 
-	// requests are submitted. So that the second one must be inside the resource controller. 
-	// And we will always test the second request
-		
 	newLevel = (TUint)(readValue + gAsyncResStateDelta);
 	gChannel.ChangeResourceState(status,gLongLatencyResource,newLevel);
-	gChannel.ChangeResourceState(status2,gLongLatencyResource,newLevel);
 	gChannel.CancelAsyncOperation(&status);
-	gChannel.CancelAsyncOperation(&status2);
 	User::WaitForRequest(status);
-	User::WaitForRequest(status2);
-	if(status2.Int() != KErrCancel)
+	if(status.Int() != KErrCancel)
 		{
 		gTest.Printf(_L("TestGetSetResourceStateOps, cancelled change state status = %d\n"),r);
 		return r;
@@ -1727,12 +1597,7 @@
 	for(i=0;i<KLoopVarN;i++)
 		{
 		User::WaitForRequest(getReqStatus[i]);
-
-	// NOTE: Cancel operation can only remove request which is still inside the resource controller
-	// message queue. If the queue is empty, the resource controller may process the request very quickly
-	// after it is sent. It may cause the test fail. To solve this, we skip the test for request 0.
-			
-		if(i>0 && ((r=getReqStatus[i].Int()) != KErrCancel))
+		if((r=getReqStatus[i].Int()) != KErrCancel)
 			{
 			gTest.Printf(_L("TestGetSetResourceStateOps, cancelled get state status[%d] = %d\n"),i,r);
 			return r;
@@ -1750,12 +1615,7 @@
 	for(i=0;i<KLoopVarM;i++)
 		{
 		User::WaitForRequest(setReqStatus[i]);
-		
-	// NOTE: Cancel operation can only remove request which is still inside the resource controller
-	// message queue. If the queue is empty, the resource controller may process the request very quickly 
-	// after it is sent. It may cause the test fail. To solve this, we skip the test for request 0.
-		
-		if(i>0 && ((r=setReqStatus[i].Int()) != KErrCancel))
+		if((r=setReqStatus[i].Int()) != KErrCancel)
 			{
 			gTest.Printf(_L("TestGetSetResourceStateOps, cancelled change state status[%d] = %d\n"),i,r);
 			return r;
@@ -1831,12 +1691,7 @@
 	for(i=0;i<KLoopVarN;i++)
 		{
 		User::WaitForRequest(getReqStatus[i]);
-
-	// NOTE: Cancel operation can only remove request which is still inside the resource controller
-	// message queue. If the queue is empty, the resource controller may process the request very quickly 
-	// after it is sent. It may cause the test fail. To solve this, we skip the test for request 0.
-		
-		if(i>0 && ((r=getReqStatus[i].Int()) != KErrCancel))
+		if((r=getReqStatus[i].Int()) != KErrCancel)
 			{
 			gTest.Printf(_L("TestGetSetResourceStateOps, cancelled get state status[%d] = %d\n"),i,r);
 			return r;
@@ -1989,16 +1844,8 @@
 		r=gChannel.CancelGetResourceState(getReqStatus[i]);
 		if(r!=KErrNone)
 			{
-
-	// NOTE: Cancel operation can only remove request which is still inside the resource controller
-	// message queue. If the queue is empty, the resource controller may process the request very quickly 
-	// after it is sent. It may cause the test fail. To solve this, we skip the test for request 0.
-			
-			if(i!=0)
-				{
-				gTest.Printf(_L("TestGetSetResourceStateOps, CancelGetResourceState for index %d returned %d\n"),i,r);
-				return r;
-				}
+			gTest.Printf(_L("TestGetSetResourceStateOps, CancelGetResourceState for index %d returned %d\n"),i,r);
+			return r;
 			}
 		}
 	for(i=0;i<KLoopVarM;i++)
@@ -2021,12 +1868,7 @@
 	for(i=0;i<KLoopVarN;i++)
 		{
 		User::WaitForRequest(getReqStatus[i]);
-
-	// NOTE: Cancel operation can only remove request which is still inside the resource controller
-	// message queue. If the queue is empty, the resource controller may process the request very quickly 
-	// after it is sent. It may cause the test fail. To solve this, we skip the test for request 0.
-		
-		if(i>0 && ((r=getReqStatus[i].Int()) != KErrCancel))
+		if((r=getReqStatus[i].Int()) != KErrCancel)
 			{
 			gTest.Printf(_L("TestGetSetResourceStateOps, cancelled get state status[%d] = %d\n"),i,r);
 			return r;
@@ -3031,7 +2873,7 @@
 		gTest.Printf(_L("TestThreadExclusiveAccess: Duplicate with EOwnerProcess returned %d\n"),r);
 		if(r==KErrNone)
 			r=KErrGeneral;
-		return r; // return error which is neither KErrNone nor KErrAccessDenied
+		return r;
 		}
 	pirateChannel = gChannel;
 	if((r=pirateChannel.Duplicate(RThread(),EOwnerThread))!=KErrNone)
@@ -3155,7 +2997,7 @@
 		{
 		if(r==KErrNone)
 			r=KErrGeneral;
-		return r; // return error which is neither KErrPermissionDenied nor KErrGeneral
+		return r;
 		}
 	else
 		r=KErrNone; // Ensure misleading result is not propagated
@@ -3235,7 +3077,7 @@
 			{
 			if(r==KErrNone)
 				r=KErrGeneral;
-			return r; // return error which is neither KErrPermissionDenied nor KErrGeneral
+			return r;
 			}
 		else
 			r=KErrNone; // Ensure misleading result is not propagated
@@ -3929,7 +3771,7 @@
 		if((r=gChannel.GetInfoOnClientsUsingResource(gSharedResource, numClients, &infoPtrs, EFalse))!=KErrNotReady)
 			{
 			gTest.Printf(_L("TestTransientHandling: GetInfoOnClientsUsingResource (for gSharedResource) returned %d\n"),r);
-			return KErrGeneral;
+			return r;
 			}
 		infoPtrs.Close();
 		}
@@ -4238,82 +4080,104 @@
 //
 // Main
 //
-	{
-	gTest.Title();
+    {
 	gTest.Start(_L("Test Power Resource Manager user side API\n"));
+  
+	TInt r = KErrNone;
 
 	// Test attempted load of PDD
-	gTest.Next(_L("**Load PDD\n"));
-	TInt r = User::LoadPhysicalDevice(PDD_NAME);
-	gTest((r == KErrNone) || (r == KErrAlreadyExists));
-	gTest.SetCleanupFlag(EPddLoaded);
-
-	// Test attempted load of LDD
-	gTest.Next(_L("**Load LDD\n"));
-	r = User::LoadLogicalDevice(LDD_NAME);
-	gTest((r == KErrNone) || (r == KErrAlreadyExists));
-	r = KErrNone; // Re-initialise in case set to KErrAlreadyExists
-	gTest.SetCleanupFlag(ELddLoaded);
-
-	// test caps
-	gTest(CheckCaps() == KErrNone);
-
-	// Need a channel open for the following tests
-	gTest.Next(_L("**OpenAndRegisterChannel\n"));
-	r = OpenAndRegisterChannel();
-	gTest(r == KErrNone);
-	gTest.SetCleanupFlag(EChannelOpened);
-
-	// Get the version of the ResourceController
-	TUint version;
-	r = gChannel.GetResourceControllerVersion(version);
-	gTest.Printf(_L("TestTransientHandling: ResourceController version =0x%x\n"), version);
-	gTest(r == KErrNone);
-
-	gTest.Next(_L("**TestThreadExclusiveAccess\n"));
-	r = TestThreadExclusiveAccess();
-	gTest(r == KErrNone);
-
-	gTest.Next(_L("**TestGetClientGetResourceInfo - initial state\n"));
-	r = TestGetClientGetResourceInfo();
-	gTest(r == KErrNone);
-
-	gTest.Next(_L("**TestGetSetResourceStateOps\n"));
-	r = TestGetSetResourceStateOps();
-	gTest(r == KErrNone);
-
-	gTest.Next(_L("**TestGetClientGetResourceInfo - after changing stateof Async resource\n"));
-	r = TestGetClientGetResourceInfo();
-	gTest(r == KErrNone);
-
-	gTest.Next(_L("**TestGetSetResourceStateQuota\n"));
-	r = TestGetSetResourceStateQuota();
-	gTest(r == KErrNone);
-
-	gTest.Next(_L("**TestNotificationOps\n"));
-	r = TestNotificationOps();
-	gTest(r == KErrNone);
-
-	gTest.Next(_L("**TestNotificationQuota\n"));
-	r = TestNotificationQuota();
-	gTest(r == KErrNone);
-
-	// Should be no change since last invocation (assuming that
-	// no clients other than those in this test)
-	gTest.Next(_L("**TestGetClientGetResourceInfo - last invocation\n"));
-	r = TestGetClientGetResourceInfo();
-	gTest(r == KErrNone);
-
-	gTest.Next(_L("**TestAdditionalThread\n"));
-	r = TestAdditionalThread();
-	gTest(r == KErrNone);
-
-	gTest.Next(_L("**TestTransientHandling\n"));
-	r = TestTransientHandling();
-	gTest(r == KErrNone);
+    gTest.Next(_L("**Load PDD\n"));
+    r=User::LoadPhysicalDevice(PDD_NAME);
+    if((r!=KErrNone)&&(r!=KErrAlreadyExists))
+		{
+		gTest.Printf(_L("User::LoadPhysicalDevice error %d\n"),r);
+		}
+	else
+		{
+		// Test attempted load of LDD
+		gTest.Next(_L("**Load LDD\n"));
+		r=User::LoadLogicalDevice(LDD_NAME);
+		if((r!=KErrNone)&&(r!=KErrAlreadyExists))
+			gTest.Printf(_L("User::LoadLogicalDevice error - expected %d, got %d\n"),KErrAlreadyExists,r);
+		}
+    if((r==KErrNone)||(r==KErrAlreadyExists))
+		{
+		r = KErrNone; // Re-initialise in case set to KErrAlreadyExists
+		//
+		// Need a channel open for the following tests
+		gTest.Next(_L("**OpenAndRegisterChannel\n"));
+		r=OpenAndRegisterChannel();
+		if (r==KErrNone)
+			{
+			// Get the version of the ResourceController
+			TUint version;
+			if((r=gChannel.GetResourceControllerVersion(version))!=KErrNone)
+				{
+				gTest.Printf(_L("TestTransientHandling: GetResourceControllerVersion returned %d\n"),r);
+				return r;
+				}
+			gTest.Printf(_L("TestTransientHandling: ResourceController version =0x%x\n"),version);
+			}
+		if (r==KErrNone)
+			{
+			gTest.Next(_L("**TestThreadExclusiveAccess\n"));
+			r=TestThreadExclusiveAccess();
+			}
+		if (r==KErrNone)
+			{
+			gTest.Next(_L("**TestGetClientGetResourceInfo - initial state\n"));
+			r=TestGetClientGetResourceInfo();
+			}
+		if (r==KErrNone)
+			{
+			gTest.Next(_L("**TestGetSetResourceStateOps\n"));
+			r=TestGetSetResourceStateOps();
+			}
+		if (r==KErrNone)
+			{
+			gTest.Next(_L("**TestGetClientGetResourceInfo - after changing stateof Async resource\n"));
+			r=TestGetClientGetResourceInfo();
+			}
+		if (r==KErrNone)
+			{
+			gTest.Next(_L("**TestGetSetResourceStateQuota\n"));
+			r=TestGetSetResourceStateQuota();
+			}
+		if (r==KErrNone)
+			{
+			gTest.Next(_L("**TestNotificationOps\n"));
+			r=TestNotificationOps();
+			}
+		if (r==KErrNone)
+			{
+			gTest.Next(_L("**TestNotificationQuota\n"));
+			r=TestNotificationQuota();
+			}
+		if (r==KErrNone)
+			{
+			// Should be no change since last invocation (assuming that
+			// no clients other than those in this test)
+			gTest.Next(_L("**TestGetClientGetResourceInfo - last invocation\n"));
+			r=TestGetClientGetResourceInfo();
+			}
+		if (r==KErrNone)
+			{
+			gTest.Next(_L("**TestAdditionalThread\n"));
+			r=TestAdditionalThread();
+			}
+		if (r==KErrNone)
+			{
+			gTest.Next(_L("**TestTransientHandling\n"));
+			r=TestTransientHandling();
+			}
+		}
+	gChannel.Close();
+
+    User::FreeLogicalDevice(KLddRootName);
+    User::FreePhysicalDevice(PDD_NAME);	
+	User::After(100000);	// Allow idle thread to run for driver unloading
 
 	gTest.End();
-	return KErrNone;
-	}
-
-
+	return r;
+    }
+
--- a/kerneltest/e32test/resmanus/t_resmanus.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/resmanus/t_resmanus.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -18,7 +18,6 @@
 
 // Need simulated PSL to support this test
 macro RESOURCE_MANAGER_SIMULATED_PSL
-macro _DUMP_TRACKERS
 
 sourcepath      ../resmanus
 source  	t_resmanus.cpp
@@ -27,7 +26,7 @@
 
 library 	euser.lib hal.lib
 
-capability		PowerMgmt 
+capability		PowerMgmt
 
 vendorid 0x70000001
 SMPSAFE
--- a/kerneltest/e32test/resmanus/t_resmanusbtrace.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,754 +0,0 @@
-// 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:
-// e32test\resmanus\t_resmanusbtrace.cpp
-// 
-//
-
-#include <e32test.h>
-#include <e32hal.h>
-#include <d32btrace.h>
-#include <e32btrace.h>
-#include <e32svr.h>
-#include <hal.h>
-#include <u32hal.h>
-#include "d_resmanusbtraceconst.h"
-#include "d_resmanusbtrace.h"
-
-_LIT(KLddFileName, "D_RESMANUSBTRACE.LDD");
-
-RLddTest1 ldd;
-GLDEF_D RTest test(_L("T_RESMANUSBTRACE"));
-
-TInt BTraceHeaderSize = 0;
-
-RBTrace Trace;
-TUint8* BufferPtr;
-TInt Count;
-TLogInfo LogInfo;
-
-CConsoleBase* console;
-
-class CTestTraceBase
-    {
-public:    
-    CTestTraceBase(TUint8** aBufferPtrAddr, TInt aHeaderSize) : 
-            iBufferPtrAddr(aBufferPtrAddr), iHeaderSize(aHeaderSize)
-        {
-        iBuffer.Zero();
-        }
-    void SkipHeader()
-        {
-        *iBufferPtrAddr += iHeaderSize;
-        }
-    TInt Compare()
-        {
-	TInt i = 0;
-        TPtrC8 ptr2(*iBufferPtrAddr, iBuffer.Length());
-        TUint length = iBuffer.Length();
-        length = (length + 0x3) & (~0x3);
-
-        for(i = 0; i < ptr2.Length(); i++)
-            {
-            test.Printf(_L("%02x "), ptr2.Ptr()[i]);
-            }
-        test.Printf(_L("\n"));
-        for(i = 0; i < iBuffer.Length(); i++)
-            {
-            test.Printf(_L("%02x "), iBuffer.Ptr()[i]);
-            }
-        test.Printf(_L("\n"));
-
-        *iBufferPtrAddr += length;
-        return (iBuffer.Compare(ptr2)==0)?KErrNone:KErrCorrupt;
-        }
-    void AppendUInt(TUint aVal)
-        {
-        iBuffer.Append((TUint8*)&aVal, sizeof(TUint));
-        }
-    void AppendInt(TInt aVal)
-        {
-        iBuffer.Append((TUint8*)&aVal, sizeof(TInt));
-        }    
-    void AppendDes(const TDesC8& aDesPtr)
-        {
-        iBuffer.Append(aDesPtr);
-        }
-    TUint8** iBufferPtrAddr;
-    TBuf8<80> iBuffer;
-    TInt iHeaderSize;
-    };
-
-class Test_PRM_US_OPEN_CHANNEL_START_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_US_OPEN_CHANNEL_START_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClient);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        }
-    };
-
-class Test_PRM_US_OPEN_CHANNEL_END_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_US_OPEN_CHANNEL_END_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt((TUint)KClientHandle);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        }
-    };
-
-class Test_PRM_US_REGISTER_CLIENT_START_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_US_REGISTER_CLIENT_START_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientHandle);
-        TUint32 stateRes32 = ((KStatsRes1&0xFF) << 16) | ((KStatsRes2&0xFF) << 8) | ((KStatsRes3&0xFF));
-        AppendUInt(stateRes32);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        }
-    };
-
-class Test_PRM_US_REGISTER_CLIENT_END_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_US_REGISTER_CLIENT_END_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientHandle);
-        AppendInt(KRetVal);
-        }
-    };
-
-class Test_PRM_US_DEREGISTER_CLIENT_START_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_US_DEREGISTER_CLIENT_START_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientHandle);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        }
-    };
-
-class Test_PRM_US_DEREGISTER_CLIENT_END_TRACE   : public CTestTraceBase
-    {
-public:
-    Test_PRM_US_DEREGISTER_CLIENT_END_TRACE()  : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientHandle);
-        }
-    };
-    
-class Test_PRM_US_GET_RESOURCE_STATE_START_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_US_GET_RESOURCE_STATE_START_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KResourceId);
-        AppendUInt(KClientHandle);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        }
-    };
-
-class Test_PRM_US_GET_RESOURCE_STATE_END_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_US_GET_RESOURCE_STATE_END_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KResourceId);
-        AppendUInt(KLevel);
-        AppendUInt(KClient);
-        AppendUInt(KResult);
-        }
-    };
-
-class Test_PRM_US_SET_RESOURCE_STATE_START_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_US_SET_RESOURCE_STATE_START_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KResourceId);
-        AppendUInt(KLevel);
-        AppendUInt(KClientHandle);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        }
-    };
-
-class Test_PRM_US_SET_RESOURCE_STATE_END_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_US_SET_RESOURCE_STATE_END_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KResourceId);
-        AppendUInt(KLevel);
-        AppendUInt(KClient);
-        AppendUInt(KResult);
-        }
-    };
-
-class Test_PRM_US_CANCEL_GET_RESOURCE_STATE_START_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_US_CANCEL_GET_RESOURCE_STATE_START_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KResourceId);
-        AppendUInt(KClientHandle);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        }
-    };
-
-class Test_PRM_US_CANCEL_GET_RESOURCE_STATE_END_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_US_CANCEL_GET_RESOURCE_STATE_END_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KResourceId);
-        AppendUInt(KClientHandle);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        }
-    };
-
-class Test_PRM_US_CANCEL_SET_RESOURCE_STATE_START_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_US_CANCEL_SET_RESOURCE_STATE_START_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KResourceId);
-        AppendUInt(KClientHandle);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        }
-    };
-
-class Test_PRM_US_CANCEL_SET_RESOURCE_STATE_END_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_US_CANCEL_SET_RESOURCE_STATE_END_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KResourceId);
-        AppendUInt(KClientHandle);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        }
-    };
-
-class Test_PRM_REGISTER_RESOURCE_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_REGISTER_RESOURCE_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KResCount+1);
-        AppendUInt((TUint)(LogInfo.iPR));
-        AppendInt(KMinLevel);
-        AppendUInt(KMaxLevel);
-        AppendUInt(KDefaultLevel);
-        AppendUInt(KRESOURCENAME.iTypeLength);
-        AppendDes(KRESOURCENAME);
-        }
-    };
-
-class Test_PRM_CLIENT_REGISTER_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_CLIENT_REGISTER_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientId);
-        AppendUInt((TUint)LogInfo.iPC);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        }
-    };
-class Test_PRM_CLIENT_DEREGISTER_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_CLIENT_DEREGISTER_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientId);
-        AppendUInt((TUint)LogInfo.iPC);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        }
-    };
-
-class Test_PRM_CLIENT_CHANGE_STATE_START_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_CLIENT_CHANGE_STATE_START_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientId);
-        AppendUInt(KResourceId);
-        AppendUInt(KLevel);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        AppendUInt(KRESOURCENAME.iTypeLength);
-        AppendDes(KRESOURCENAME);        
-        }
-    };
-
-class Test_PRM_CLIENT_CHANGE_STATE_END_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_CLIENT_CHANGE_STATE_END_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientId);
-        AppendUInt(KResourceId);
-        AppendInt(KRetVal);
-        AppendUInt(KLevel);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        AppendUInt(KRESOURCENAME.iTypeLength);
-        AppendDes(KRESOURCENAME);         
-        }
-    };
-
-class Test_PRM_POSTNOTIFICATION_REGISTER_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_POSTNOTIFICATION_REGISTER_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientId);
-        AppendUInt(KResourceId);
-        AppendUInt((TUint)(LogInfo.iPCallback));
-        AppendInt(KRetVal);
-        }
-    };
-
-class Test_PRM_POSTNOTIFICATION_DEREGISTER_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_POSTNOTIFICATION_DEREGISTER_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientId);
-        AppendUInt(KResourceId);
-        AppendUInt((TUint)(LogInfo.iPCallback));
-        AppendInt(KRetVal);
-        }
-    };
-
-class Test_PRM_POSTNOTIFICATION_SENT_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_POSTNOTIFICATION_SENT_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientId);
-        AppendUInt(KResourceId);
-        }
-    };
-
-class Test_PRM_CALLBACK_COMPLETION_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_CALLBACK_COMPLETION_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientId);
-        AppendUInt(KResourceId);
-        }
-    };
-
-class Test_PRM_MEMORY_USAGE_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_MEMORY_USAGE_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KSize);
-        }
-    };
-
-class Test_PRM_PSL_RESOURCE_GET_STATE_START_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_PSL_RESOURCE_GET_STATE_START_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientId);
-        AppendUInt(KResourceId);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        }
-    };
-
-class Test_PRM_RESOURCE_GET_STATE_START_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_RESOURCE_GET_STATE_START_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientId);
-        AppendUInt(KResourceId);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        AppendUInt(KRESOURCENAME.iTypeLength);
-        AppendDes(KRESOURCENAME);
-        }
-    };
-
-class Test_PRM_PSL_RESOURCE_GET_STATE_END_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_PSL_RESOURCE_GET_STATE_END_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientId);
-        AppendUInt(KResourceId);
-        AppendUInt(KLevel);
-        AppendInt(KRetVal);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        }
-    };
-
-class Test_PRM_RESOURCE_GET_STATE_END_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_RESOURCE_GET_STATE_END_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientId);
-        AppendUInt(KResourceId);
-        AppendUInt(KLevel);
-        AppendInt(KRetVal);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        AppendUInt(KRESOURCENAME.iTypeLength);
-        AppendDes(KRESOURCENAME);        
-        }
-    };
-
-class Test_PRM_RESOURCE_CANCEL_LONGLATENCY_OPERATION_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_RESOURCE_CANCEL_LONGLATENCY_OPERATION_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientId);
-        AppendUInt(KResourceId);
-        AppendInt(KRetVal);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        AppendUInt(KRESOURCENAME.iTypeLength);
-        AppendDes(KRESOURCENAME);     
-        }
-    };
-
-class Test_PRM_PSL_RESOURCE_CHANGE_STATE_START_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_PSL_RESOURCE_CHANGE_STATE_START_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientId);
-        AppendUInt(KResourceId);
-        AppendUInt(KLevel);
-        AppendUInt(KLevel);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        }
-    };
-
-class Test_PRM_PSL_RESOURCE_CHANGE_STATE_END_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_PSL_RESOURCE_CHANGE_STATE_END_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientId);
-        AppendUInt(KResourceId);
-        AppendUInt(KLevel);
-        AppendUInt(KLevel);
-        AppendInt(KRetVal);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);    
-        }
-    };
-
-class Test_PRM_PSL_RESOURCE_CREATE_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_PSL_RESOURCE_CREATE_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendInt(KMinLevel);
-        AppendInt(KMaxLevel);
-        AppendInt(KDefaultLevel);
-        AppendUInt(KFlags);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        }
-    };
-
-class Test_PRM_BOOTING_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_BOOTING_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendInt(KErrNoMemory);
-        }
-    };
-
-class Test_PRM_REGISTER_STATIC_RESOURCE_WITH_DEPENDENCY_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_REGISTER_STATIC_RESOURCE_WITH_DEPENDENCY_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KResourceId);
-        AppendUInt((TUint)(LogInfo.iPR));
-        AppendInt(KMinLevel);
-        AppendInt(KMaxLevel);
-        AppendInt(KDefaultLevel);
-        AppendUInt(KRESOURCENAME.iTypeLength);
-        AppendDes(KRESOURCENAME);        
-        }
-    };
-
-class Test_PRM_REGISTER_DYNAMIC_RESOURCE_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_REGISTER_DYNAMIC_RESOURCE_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientId);
-        AppendUInt(KResourceId);
-        AppendUInt((TUint)(LogInfo.iPR));
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        AppendUInt(KRESOURCENAME.iTypeLength);
-        AppendDes(KRESOURCENAME);
-        }
-    };
-
-class Test_PRM_DEREGISTER_DYNAMIC_RESOURCE_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_DEREGISTER_DYNAMIC_RESOURCE_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientId);
-        AppendUInt(KResourceId);
-        AppendUInt((TUint)(LogInfo.iPR));
-        AppendUInt(KLevel);
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        AppendUInt(KRESOURCENAME.iTypeLength);
-        AppendDes(KRESOURCENAME);
-        }
-    };
-
-class Test_PRM_REGISTER_RESOURCE_DEPENDENCY_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_REGISTER_RESOURCE_DEPENDENCY_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientId);
-        AppendUInt(KResourceId);
-        AppendUInt(KResourceId);
-        AppendUInt((TUint)(LogInfo.iPR));
-        AppendUInt((TUint)(LogInfo.iPR));
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        AppendUInt(KRESOURCENAME.iTypeLength);
-        AppendDes(KRESOURCENAME);        
-        AppendUInt(KRESOURCENAME.iTypeLength);
-        AppendDes(KRESOURCENAME);  
-        }
-    };
-
-class Test_PRM_DEREGISTER_RESOURCE_DEPENDENCY_TRACE : public CTestTraceBase
-    {
-public:
-    Test_PRM_DEREGISTER_RESOURCE_DEPENDENCY_TRACE() : CTestTraceBase(&BufferPtr, BTraceHeaderSize)
-        {
-        AppendUInt(KClientId);
-        AppendUInt(KResourceId);
-        AppendUInt(KResourceId);
-        AppendUInt((TUint)(LogInfo.iPR));
-        AppendUInt((TUint)(LogInfo.iPR));
-        AppendUInt(KCLIENTNAME.iTypeLength);
-        AppendDes(KCLIENTNAME);
-        AppendUInt(KRESOURCENAME.iTypeLength);
-        AppendDes(KRESOURCENAME);        
-        AppendUInt(KRESOURCENAME.iTypeLength);
-        AppendDes(KRESOURCENAME);      
-        }
-    };
-
-void TestMacro()
-    {
-    const TInt numCpus = UserSvr::HalFunction(EHalGroupKernel, EKernelHalNumLogicalCpus, 0, 0);
-    if(numCpus>1)
-    	{
-	BTraceHeaderSize = 20;
-	}
-    else
-        {
-	BTraceHeaderSize = 12;
-	}
-
-    Test_PRM_US_OPEN_CHANNEL_START_TRACE testPRM_US_OPEN_CHANNEL_START_TRACE; //0
-    Test_PRM_US_OPEN_CHANNEL_END_TRACE testPRM_US_OPEN_CHANNEL_END_TRACE; //1
-    Test_PRM_US_REGISTER_CLIENT_START_TRACE testPRM_US_REGISTER_CLIENT_START_TRACE; //2
-    Test_PRM_US_REGISTER_CLIENT_END_TRACE testPRM_US_REGISTER_CLIENT_END_TRACE; //3
-    Test_PRM_US_DEREGISTER_CLIENT_START_TRACE testPRM_US_DEREGISTER_CLIENT_START_TRACE; //4
-    Test_PRM_US_DEREGISTER_CLIENT_END_TRACE   testPRM_US_DEREGISTER_CLIENT_END_TRACE; //5
-    Test_PRM_US_GET_RESOURCE_STATE_START_TRACE testPRM_US_GET_RESOURCE_STATE_START_TRACE; //6
-    Test_PRM_US_GET_RESOURCE_STATE_END_TRACE testPRM_US_GET_RESOURCE_STATE_END_TRACE; //7
-    Test_PRM_US_SET_RESOURCE_STATE_START_TRACE testPRM_US_SET_RESOURCE_STATE_START_TRACE; //8
-    Test_PRM_US_SET_RESOURCE_STATE_END_TRACE testPRM_US_SET_RESOURCE_STATE_END_TRACE; //9
-    Test_PRM_US_CANCEL_GET_RESOURCE_STATE_START_TRACE testPRM_US_CANCEL_GET_RESOURCE_STATE_START_TRACE; //10
-    Test_PRM_US_CANCEL_GET_RESOURCE_STATE_END_TRACE testPRM_US_CANCEL_GET_RESOURCE_STATE_END_TRACE; //11
-    Test_PRM_US_CANCEL_SET_RESOURCE_STATE_START_TRACE testPRM_US_CANCEL_SET_RESOURCE_STATE_START_TRACE; //12
-    Test_PRM_US_CANCEL_SET_RESOURCE_STATE_END_TRACE testPRM_US_CANCEL_SET_RESOURCE_STATE_END_TRACE; //13
-    Test_PRM_REGISTER_RESOURCE_TRACE testPRM_REGISTER_RESOURCE_TRACE; //14
-    Test_PRM_CLIENT_REGISTER_TRACE testPRM_CLIENT_REGISTER_TRACE; //15
-    Test_PRM_CLIENT_DEREGISTER_TRACE testPRM_CLIENT_DEREGISTER_TRACE; //16
-    Test_PRM_CLIENT_CHANGE_STATE_START_TRACE testPRM_CLIENT_CHANGE_STATE_START_TRACE; //17
-    Test_PRM_CLIENT_CHANGE_STATE_END_TRACE testPRM_CLIENT_CHANGE_STATE_END_TRACE; //18
-    Test_PRM_POSTNOTIFICATION_REGISTER_TRACE testPRM_POSTNOTIFICATION_REGISTER_TRACE; //19
-    Test_PRM_POSTNOTIFICATION_DEREGISTER_TRACE testPRM_POSTNOTIFICATION_DEREGISTER_TRACE; //20
-    Test_PRM_POSTNOTIFICATION_SENT_TRACE testPRM_POSTNOTIFICATION_SENT_TRACE; //21
-    Test_PRM_CALLBACK_COMPLETION_TRACE testPRM_CALLBACK_COMPLETION_TRACE; //22
-    Test_PRM_MEMORY_USAGE_TRACE testPRM_MEMORY_USAGE_TRACE; //23
-    Test_PRM_PSL_RESOURCE_GET_STATE_START_TRACE testPRM_PSL_RESOURCE_GET_STATE_START_TRACE; //24
-    Test_PRM_RESOURCE_GET_STATE_START_TRACE testPRM_RESOURCE_GET_STATE_START_TRACE; //25
-    Test_PRM_PSL_RESOURCE_GET_STATE_END_TRACE testPRM_PSL_RESOURCE_GET_STATE_END_TRACE; //26
-    Test_PRM_RESOURCE_GET_STATE_END_TRACE testPRM_RESOURCE_GET_STATE_END_TRACE; //27
-    Test_PRM_RESOURCE_CANCEL_LONGLATENCY_OPERATION_TRACE testPRM_RESOURCE_CANCEL_LONGLATENCY_OPERATION_TRACE; //28
-    Test_PRM_PSL_RESOURCE_CHANGE_STATE_START_TRACE testPRM_PSL_RESOURCE_CHANGE_STATE_START_TRACE; //29
-    Test_PRM_PSL_RESOURCE_CHANGE_STATE_END_TRACE testPRM_PSL_RESOURCE_CHANGE_STATE_END_TRACE; //30
-    Test_PRM_PSL_RESOURCE_CREATE_TRACE testPRM_PSL_RESOURCE_CREATE_TRACE; //31
-    Test_PRM_BOOTING_TRACE testPRM_BOOTING_TRACE; //32
-    Test_PRM_REGISTER_STATIC_RESOURCE_WITH_DEPENDENCY_TRACE testPRM_REGISTER_STATIC_RESOURCE_WITH_DEPENDENCY_TRACE; //33
-    Test_PRM_REGISTER_DYNAMIC_RESOURCE_TRACE testPRM_REGISTER_DYNAMIC_RESOURCE_TRACE; //34
-    Test_PRM_DEREGISTER_DYNAMIC_RESOURCE_TRACE testPRM_DEREGISTER_DYNAMIC_RESOURCE_TRACE; //35
-    Test_PRM_REGISTER_RESOURCE_DEPENDENCY_TRACE testPRM_REGISTER_RESOURCE_DEPENDENCY_TRACE; //36
-    Test_PRM_DEREGISTER_RESOURCE_DEPENDENCY_TRACE testPRM_DEREGISTER_RESOURCE_DEPENDENCY_TRACE; //37
-    
-//    const TInt KNumTest = 38;
-    CTestTraceBase* TestArray[] = 
-            {
-            &testPRM_US_OPEN_CHANNEL_START_TRACE,
-            &testPRM_US_OPEN_CHANNEL_END_TRACE,
-            &testPRM_US_REGISTER_CLIENT_START_TRACE,
-            &testPRM_US_REGISTER_CLIENT_END_TRACE,
-            &testPRM_US_DEREGISTER_CLIENT_START_TRACE,
-            &testPRM_US_DEREGISTER_CLIENT_END_TRACE,
-            &testPRM_US_GET_RESOURCE_STATE_START_TRACE,
-            &testPRM_US_GET_RESOURCE_STATE_END_TRACE,
-            &testPRM_US_SET_RESOURCE_STATE_START_TRACE,
-            &testPRM_US_SET_RESOURCE_STATE_END_TRACE,
-            &testPRM_US_CANCEL_GET_RESOURCE_STATE_START_TRACE,
-            &testPRM_US_CANCEL_GET_RESOURCE_STATE_END_TRACE,
-            &testPRM_US_CANCEL_SET_RESOURCE_STATE_START_TRACE,
-            &testPRM_US_CANCEL_SET_RESOURCE_STATE_END_TRACE,
-            &testPRM_REGISTER_RESOURCE_TRACE,
-            &testPRM_CLIENT_REGISTER_TRACE,
-            &testPRM_CLIENT_DEREGISTER_TRACE,
-            &testPRM_CLIENT_CHANGE_STATE_START_TRACE,
-            &testPRM_CLIENT_CHANGE_STATE_END_TRACE,
-            &testPRM_POSTNOTIFICATION_REGISTER_TRACE,
-            &testPRM_POSTNOTIFICATION_DEREGISTER_TRACE,
-            &testPRM_POSTNOTIFICATION_SENT_TRACE,
-            &testPRM_CALLBACK_COMPLETION_TRACE,
-            &testPRM_MEMORY_USAGE_TRACE,
-            &testPRM_PSL_RESOURCE_GET_STATE_START_TRACE,
-            &testPRM_RESOURCE_GET_STATE_START_TRACE,
-            &testPRM_PSL_RESOURCE_GET_STATE_END_TRACE,
-            &testPRM_RESOURCE_GET_STATE_END_TRACE,
-            &testPRM_RESOURCE_CANCEL_LONGLATENCY_OPERATION_TRACE,
-            &testPRM_PSL_RESOURCE_CHANGE_STATE_START_TRACE,
-            &testPRM_PSL_RESOURCE_CHANGE_STATE_END_TRACE,
-            &testPRM_PSL_RESOURCE_CREATE_TRACE,
-            &testPRM_BOOTING_TRACE,
-            &testPRM_REGISTER_STATIC_RESOURCE_WITH_DEPENDENCY_TRACE,
-            &testPRM_REGISTER_DYNAMIC_RESOURCE_TRACE,
-            &testPRM_DEREGISTER_DYNAMIC_RESOURCE_TRACE,
-            &testPRM_REGISTER_RESOURCE_DEPENDENCY_TRACE,
-            &testPRM_DEREGISTER_RESOURCE_DEPENDENCY_TRACE
-            };
-    
-    TInt r = KErrNone;
-    
-    for(TUint i = 0; i < sizeof(TestArray)/sizeof(CTestTraceBase*); i++)
-        {
-        TestArray[i]->SkipHeader();
-        test.Printf(_L("\n\nTest number %d\n\n"), i);
-        r = TestArray[i]->Compare();
-        test(r==KErrNone);
-        }
-    
-    }
-
-void DoTests()
-	{
-	TInt r = KErrNone;
-
-	test.Printf(_L("Loading logical device \n"));
-	r=User::LoadLogicalDevice(KLddFileName);
-	test(r == KErrNone);
-
-	test.Printf(_L("Opening of logical device\n"));
-	r = ldd.Open();
-	test(r == KErrNone);
-
-	Trace.Open();
-	TInt OrgBufSize = Trace.BufferSize();
-	if(OrgBufSize<1024)
-	    Trace.ResizeBuffer(1024);
-	
-    Trace.Empty();
-    Trace.SetMode(RBTrace::EEnable);
-	
-	Trace.SetFilter(BTrace::EResourceManagerUs, ETrue);
-	Trace.SetFilter(BTrace::EResourceManager, ETrue);	
-
-    test.Printf(_L("Test Cat 19 is enabled"));
-	test(Trace.Filter(19));
-    test.Printf(_L("Test Cat 20 is enabled"));
-	test(Trace.Filter(20));
-    
-	test.Printf(_L("Send log\n"));
-	r = ldd.SendLog(&LogInfo);
-	test(r == KErrNone);
-
-	Trace.GetData(BufferPtr);
-    
-	TestMacro();
-	
-	Trace.DataUsed();
-	
-	Trace.SetFilter(BTrace::EResourceManagerUs, EFalse);
-	Trace.SetFilter(BTrace::EResourceManager, EFalse);	
-	
-	if(OrgBufSize<1024)
-	    Trace.ResizeBuffer(1024);
-	
-	Trace.Close();
-	
-	test.Printf(_L("\nClosing the channel\n"));
-	ldd.Close();
-
-	test.Printf(_L("Freeing logical device\n"));
-	r = User::FreeLogicalDevice(KLddFileName);;
-	test(r==KErrNone);
-
-
-	}
-
-GLDEF_C TInt E32Main()
-    {
-	test.Start(_L("T_RESMANUSBTRACE"));
-	console = test.Console();
-	DoTests();
-	test.End();
-	test.Close();
-		
- 	return(KErrNone);
-    }
--- a/kerneltest/e32test/resmanus/t_resmanusbtrace.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-// 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:
-// e32test/t_resmanusbtrace.mmp
-// 
-//
-
-TARGET         t_resmanusbtrace.exe
-TARGETTYPE     EXE
-SOURCEPATH     .
-SOURCE         t_resmanusbtrace.cpp
-LIBRARY        euser.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-USERINCLUDE  .
-
-library btracec.lib
-capability		all
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/kerneltest/e32test/resmanus/t_resmanusextended.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/resmanus/t_resmanusextended.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -18,7 +18,6 @@
 
 // Need simulated PSL to support this test
 macro RESOURCE_MANAGER_SIMULATED_PSL
-macro _DUMP_TRACKERS
 macro PRM_ENABLE_EXTENDED_VERSION
 
 sourcepath      ../resmanus
@@ -28,7 +27,7 @@
 
 library 	euser.lib hal.lib
 
-capability		PowerMgmt 
+capability		PowerMgmt
 
 vendorid 0x70000001
 SMPSAFE
--- a/kerneltest/e32test/resmanus/t_resmanuskern.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/resmanus/t_resmanuskern.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -17,8 +17,7 @@
 targettype      exe
 
 // Need simulated PSL to support this test
-macro RESOURCE_MANAGER_SIMULATED_PSL
-macro _DUMP_TRACKERS
+macro RESOURCE_MANAGER_SIMULATED_PSL 
 macro PRM_ENABLE_EXTENDED_VERSION
 macro RESMANUS_KERN
 
--- a/kerneltest/e32test/resourceman/d_rescontrolcli.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/resourceman/d_rescontrolcli.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -283,6 +283,12 @@
 	{
 	if(iDfcQ)
 	  iDfcQ->Destroy();
+	if(iStaticRes)
+		delete iStaticRes;
+	if(iStaticResArray[0])
+		delete iStaticResArray[0];
+	if(iStaticResArray[2])
+		delete iStaticResArray[2];
 	}
 
 /** Entry point for this driver */
@@ -313,7 +319,7 @@
 		return NULL;
 		}
 	//Allocating memory earlier so that during failure conditions can cleanup easily
-	p->iStaticRes = new DLaterRegisterStaticResource(); // it will be registered, and later destroyed by the ResourceManager
+	p->iStaticRes = new DLaterRegisterStaticResource();
 	if(!p->iStaticRes)
 		{
 		delete p->iClient.pName;
@@ -321,7 +327,7 @@
 		p->AsyncDelete();
 		return NULL;
 		}
-	p->iStaticResArray[0] = new DLaterRegisterStaticResource1(); // it will be registered, and later destroyed by the ResourceManager
+	p->iStaticResArray[0] = new DLaterRegisterStaticResource1();
 	if(!p->iStaticResArray[0])
 		{
 		delete p->iStaticRes;
@@ -406,6 +412,13 @@
 	{
    	if (iOpenChannels != 0) //A Channel is already open
 		return KErrInUse;
+	//Deregister the client registered in ldd init. 
+	TInt r = PowerResourceManager::DeRegisterClient(DTestResManLddFactory::iClient.iClientId);
+	if(r != KErrNone)
+		Kern::Fault("PRM CLIENT DEREGISTER FAILED", __LINE__);
+	delete DTestResManLddFactory::iClient.pName;
+	DTestResManLddFactory::iClient.pName = NULL;
+	DTestResManLddFactory::iClient.iClientId = 0;
 	aChannel = new DTestResManLdd;
 	if(!aChannel)
 		return KErrNoMemory;
@@ -501,17 +514,7 @@
 		}
 	}
 
-/** 
-	Function used for polling the PostBoot Notification status. 
-*/
-TBool PollingPostBootStatus(TAny* aLddFactory)
-	{
-	if(aLddFactory)
-		if(((DTestResManLddFactory *)aLddFactory)->iPostBootNotiCount == EXPECTED_POST_NOTI_COUNT)
-			return ETrue;
-	return EFalse;
-	}
-	
+
 /**
   Process synchronous 'control' requests
 */
@@ -987,9 +990,12 @@
 			}
 		case RTestResMan::ECheckPostBootLevelNotifications:
 			{
-			//aPollPeriodMs = 3ms (3rd argument)
-			//aMaxPoll = 1000 (in total ~3000 ms timeout)
-			r = Kern::PollingWait(PollingPostBootStatus, (TAny*)iDevice, 3, 1000);
+				if(DTestResManLddFactory::iPostBootNotiCount != EXPECTED_POST_NOTI_COUNT)
+				{
+				r = KErrUnderflow;
+				break;
+				}
+			r = KErrNone;
 			break;
 			}
 		case RTestResMan::EGetControllerVersion:
@@ -1329,17 +1335,6 @@
 	iPostBootNotiCount++;
 	DPowerResourceNotification *ptr = (DPowerResourceNotification*)aParam;
 	TInt r = PowerResourceManager::CancelNotification(iClient.iClientId, aResId, *ptr);
-	if(r == KErrCancel)
-		{
-		ptr->AsyncDelete();
-		if(iPostBootNotiCount == EXPECTED_POST_NOTI_COUNT)
-			{
-			r = PowerResourceManager::DeRegisterClient(DTestResManLddFactory::iClient.iClientId);
-			if(r != KErrNone)
-				Kern::Fault("PRM CLIENT DEREGISTER FAILED", __LINE__);
-			delete DTestResManLddFactory::iClient.pName;
-			DTestResManLddFactory::iClient.pName = NULL;
-			DTestResManLddFactory::iClient.iClientId = 0;
-			}
-		}
+	if(r == KErrNone)
+		delete ptr;
 	}
--- a/kerneltest/e32test/resourceman/d_rescontrolclisync.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,419 +0,0 @@
-// 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:
-// e32test\resourceman\d_rescontrolclisync.cpp
-// 
-//
-
-#include <kernel/kern_priv.h>
-#include <drivers/resource_extend.h>
-#include <drivers/resourceman.h>
-#include "d_rescontrolclisync.h"
-
-#include "resourceman_psl/rescontrol_psl.h"
-
-_LIT(KTestPowerRCName, "D_RESCONTROLCLISYNC.LDD");
-
-
-const TInt KTestResManLddThreadPriority  = 0x5;
-const TUint KResourceId = 16; // DMLSHLGLSPResource
-const TInt KResourceMax = 65;
-const TInt KResourceMin = 10;
-
-_LIT(KTestResManLddThread, "TestResManLddThread");
-_LIT(KTestResManLddHelperThread, "TestResManLddHelperThread");
-_LIT(KTestResManLddCallbackThread, "TestResManLddCallbackThread");
-_LIT(KResClientName1, "ResTestClient1");
-_LIT(KResClientName2, "ResTestClient2");
-
-class DTestResManLdd;
-/**
-The logical device (factory class) for the resource manager client side test.
-*/
-class DTestResManLddFactory : public DLogicalDevice
-	{
-public:
-    enum {
-        ESignallerCallback,
-        EWaiterCallback
-    };
-	DTestResManLddFactory();
-	~DTestResManLddFactory();
-	virtual TInt Install();
-	virtual void GetCaps(TDes8 &aDes) const;
-	virtual TInt Create(DLogicalChannelBase*& aChannel);
-	
-    NFastSemaphore iSemaphore1; // fast semaphore for helper queue
-    NFastSemaphore iSemaphore2; // fast semaphore for call back thread
-
-	TInt iResourceClientRegisterCount;
-	TDynamicDfcQue* iLddQue;   // dfc que for logical channel (also running the primary ChangeResourceState
-	TDynamicDfcQue* iLddHelperQue; // helper dfc que to execute the secondary ChangeResourceState
-    TDynamicDfcQue* iCallbackQue;  // dfc que for call back 
- 
-    DTestResManLdd* iChannel1;
-    DTestResManLdd* iChannel2;
-    TInt iCallbackState;
-    TPowerResourceCb* iAsyncResourceCallback; 
-	};
-
-/** Logical channel class for Resource manager test LDD */
-class DTestResManLdd : public DLogicalChannel
-	{
-public:
-	DTestResManLdd();
-	virtual ~DTestResManLdd();
-	// Inherited from DLogicalChannel
-	virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
-	virtual void HandleMsg(TMessageBase* aMsg);
-
-    DThread* iClientThreadPtr;	
-    TRequestStatus* iStatus;
-    TUint iResClientId;
-    TDfc* iWaitAndChangeResourceDfc;
-    
-private:
-	TInt DoControl(TInt aFunction, TAny* a1, TAny* a2);
-	TInt DoRequest(TInt aFunction, TRequestStatus* aStatus, TAny* a1, TAny* a2);
-	TInt DoCancel(TUint aMask);
-	};
-
-void AsyncResourceCallbackFn(TUint /*aClientId*/, TUint /*aResourceId*/, TInt /*aLevel*/, TInt /*aLevelOwnerId*/, TInt aResult, TAny* aParam)
-    {
-    // call back function, always run on call back dfc queue
-    Kern::Printf(">AsyncResourceCallbackFn 0x%x", &(Kern::CurrentThread().iNThread));
-    DTestResManLddFactory* pLddFactory = (DTestResManLddFactory*)aParam;
-    DTestResManLdd* pLdd = NULL;
-
-    if(pLddFactory->iCallbackState == DTestResManLddFactory::ESignallerCallback)
-        {
-        pLdd = pLddFactory->iChannel1;
-        Kern::Printf("AsyncResourceCallbackFn cond 1 signal [#3.1]"); 
-        NKern::FSSignal(&(pLddFactory->iSemaphore1));
-        
-        Kern::Printf("AsyncResourceCallbackFn cond 1 wait [#3.2]");
-        NKern::FSWait(&(pLddFactory->iSemaphore2));
-        
-        Kern::Printf("AsyncResourceCallbackFn cond 1 wake up [#3.3]");
-        }
-    else if(pLddFactory->iCallbackState == DTestResManLddFactory::EWaiterCallback)
-        {
-        pLdd = pLddFactory->iChannel2;
-        // aResult should be equal to KErrNone (not KErrCompletion)
-        Kern::Printf("AsyncResourceCallbackFn cond 2 r = %d [#2.5]", aResult);
-        }
-    else
-        {
-        Kern::Fault("AsyncResourceCallbackFn", __LINE__);
-        }
-    
-    Kern::RequestComplete(pLdd->iClientThreadPtr, pLdd->iStatus, aResult);
-    pLdd->iStatus = NULL;    
-    Kern::Printf("<AsyncResourceCallbackFn");
-    }
-
-void WaitAndChangeResourceDfcFn(TAny* aLdd)
-    {
-    // helper function to call ChangeResourceState, always run on ldd helper dfc queue
-    Kern::Printf(">WaitAndChangeResourceDfcFn 0x%x [#2.1]", &(Kern::CurrentThread().iNThread));
-    DTestResManLdd* pLdd = (DTestResManLdd*)aLdd;
-    DTestResManLddFactory* pLddFactory = (DTestResManLddFactory*)(pLdd->iDevice);
-    
-    Kern::Printf(" WaitAndChangeResourceDfcFn - Wait for Semaphore [#2.2]");
-    NKern::FSWait(&(pLddFactory->iSemaphore1));
-    
-    Kern::Printf(" WaitAndChangeResourceDfcFn - ChangeResourceState [#2.3]");
-    pLddFactory->iCallbackState = DTestResManLddFactory::EWaiterCallback;
-    PowerResourceManager::ChangeResourceState(pLdd->iResClientId, KResourceId, KResourceMax, pLddFactory->iAsyncResourceCallback);
-    
-    Kern::Printf(" WaitAndChangeResourceDfcFn - signal [#2.4]");
-    NKern::FSSignal(&(pLddFactory->iSemaphore2));
-    
-    delete pLdd->iWaitAndChangeResourceDfc;
-    Kern::Printf("<WaitAndChangeResourceDfcFn");
-    }
-
-DTestResManLddFactory::DTestResManLddFactory()
-	{
-	iParseMask=0; // Allow info and pdd, but not units
-	iUnitsMask=0;
-	// Set version number for this device
-	iVersion=RTestResMan::VersionRequired();
-	}
-
-DTestResManLddFactory::~DTestResManLddFactory()
-	{
-    if(iLddQue)
-        iLddQue->Destroy();       
-    if(iLddHelperQue)
-      iLddHelperQue->Destroy(); 
-    if(iCallbackQue)
-      iCallbackQue->Destroy(); 
-    
-    if(iAsyncResourceCallback)
-      delete iAsyncResourceCallback;
-	}
-
-/** Entry point for this driver */
-DECLARE_STANDARD_LDD()
-	{
-	DTestResManLddFactory* p = new DTestResManLddFactory;
-	if(!p)
-		return NULL;
-
-	TInt r = KErrNone;
-	
-    r = Kern::DynamicDfcQCreate(p->iLddQue, KTestResManLddThreadPriority, KTestResManLddThread);
-    if(r != KErrNone)
-        {
-        return NULL;
-        }
-    Kern::Printf("iLddQue 0x%x", p->iLddQue->iThread);
-    
-    r = Kern::DynamicDfcQCreate(p->iLddHelperQue, KTestResManLddThreadPriority, KTestResManLddHelperThread);
-    if(r != KErrNone)
-        {
-        p->iLddQue->Destroy();  
-        return NULL;
-        }
-    p->iSemaphore1.iOwningThread = (NThreadBase*)(p->iLddHelperQue->iThread);
-    Kern::Printf("iSemaphore1 owning thread 0x%x", p->iSemaphore1.iOwningThread);
-
-    r = Kern::DynamicDfcQCreate(p->iCallbackQue, KTestResManLddThreadPriority, KTestResManLddCallbackThread);
-    if(r != KErrNone)
-        {
-        p->iLddQue->Destroy();  
-        p->iLddHelperQue->Destroy();          
-        return NULL;
-        }
-    p->iSemaphore2.iOwningThread = (NThreadBase*)(p->iCallbackQue->iThread);
-    Kern::Printf("iSemaphore2 owning thread 0x%x", p->iSemaphore2.iOwningThread);
-
-    p->iAsyncResourceCallback = new TPowerResourceCb(AsyncResourceCallbackFn, p, 
-            p->iCallbackQue, 5);    
-    
-#ifdef __SMP__      
-    NKern::ThreadSetCpuAffinity((NThread*)(p->iLddQue->iThread), 0);
-    NKern::ThreadSetCpuAffinity((NThread*)(p->iLddHelperQue->iThread), 0);
-    NKern::ThreadSetCpuAffinity((NThread*)(p->iCallbackQue->iThread), 1);
-#endif      
-    
-	r = DSimulatedPowerResourceController::CompleteResourceControllerInitialisation();
-	if(r != KErrNone)
-		Kern::Fault("PRM INIT FAILED", __LINE__);
-	return p;
-	}
-
-/** Second stage constuctor */
-TInt DTestResManLddFactory::Install()
-	{
-   	return(SetName(&KTestPowerRCName));
-	}
-
-/** Device capabilities */
-void DTestResManLddFactory::GetCaps(TDes8& aDes)const
-	{
-	// Create a capabilities object
-	RTestResMan::TCaps caps;
-	caps.iVersion = iVersion;
-	// Write it back to user memory
-	Kern::InfoCopy(aDes,(TUint8*)&caps,sizeof(caps));
-	}
-
-
-TInt DTestResManLddFactory::Create(DLogicalChannelBase*& aChannel)
-	{
-	aChannel = new DTestResManLdd();
-	if(!aChannel)
-		return KErrNoMemory;
-	if(!iChannel1)
-	    iChannel1 = (DTestResManLdd*)aChannel;
-	else if(!iChannel2)
-	    iChannel2 = (DTestResManLdd*)aChannel;
-	else
-	    {
-        delete aChannel;
-	    return KErrInUse;
-	    }
-	return KErrNone;
-	}
-
-/** Constructor */
-DTestResManLdd::DTestResManLdd()
-	{
-	iClientThreadPtr=&Kern::CurrentThread();
-	iResClientId = 0;
-
-	// Increase the DThread's ref count so that it does not close without us
-	((DObject*)iClientThreadPtr)->Open();
-	}
-
-/** Destructor */
-DTestResManLdd::~DTestResManLdd()
-	{
-	Kern::SafeClose((DObject*&)iClientThreadPtr,NULL);
-	}
-
-/** Second stage constructor. */
-TInt DTestResManLdd::DoCreate(TInt /*aUnit*/, const TDesC8* /*aInfo*/, const TVersion& aVer)
-	{
-   	// Check version
-	if (!Kern::QueryVersionSupported(RTestResMan::VersionRequired(),aVer))
-		return KErrNotSupported;
-
-	SetDfcQ(((DTestResManLddFactory*)iDevice)->iLddQue);
- 	iMsgQ.Receive();
-	return KErrNone;
-	}
-
-/** Process a message for this logical channel */
-void DTestResManLdd::HandleMsg(TMessageBase* aMsg)
-	{
-	TThreadMessage& m=*(TThreadMessage*)aMsg;
-	TInt id=m.iValue;
-
-	if (id==(TInt)ECloseMsg)
-		{
-		// Channel close.
-		m.Complete(KErrNone,EFalse);
-		return;
-		}
-	else if (id==KMaxTInt)
-		{
-		// DoCancel
-		m.Complete(KErrNone,ETrue);
-		return;
-		}
-	else if (id<0)
-		{
-		// DoRequest
-		TRequestStatus* pS=(TRequestStatus*)m.Ptr0();
-		TInt r=DoRequest(~id,pS,m.Ptr1(),m.Ptr2());
-		if (r!=KErrNone)
-			Kern::RequestComplete(iClientThreadPtr,pS,r);
-		m.Complete(KErrNone,ETrue);
-		}
-	else
-		{
-		// DoControl
-		TInt r=DoControl(id,m.Ptr0(),m.Ptr1());
-		m.Complete(r,ETrue);
-		}
-	}
-
-/**
-  Process synchronous 'control' requests
-*/
-TInt DTestResManLdd::DoControl(TInt aFunction, TAny* /*a1*/, TAny* /*a2*/)
-	{
-	TInt r = KErrNone;
-
-	switch(aFunction)
-		{
-		case RTestResMan::ERegisterClient:
-		    {
-            Kern::Printf("RTestResMan::ERegisterClient");		    
-			if(iResClientId!=0)
-				{
-				r = KErrInUse;
-				break;
-				}
-			if(((DTestResManLddFactory*)iDevice)->iResourceClientRegisterCount==0)
-			    {
-			    r = PowerResourceManager::RegisterClient(iResClientId, KResClientName1);
-			    }
-			else if(((DTestResManLddFactory*)iDevice)->iResourceClientRegisterCount==1)
-			    {
-                r = PowerResourceManager::RegisterClient(iResClientId, KResClientName2);
-                }                
-			else
-			    r = KErrInUse;
-			
-			(((DTestResManLddFactory*)iDevice)->iResourceClientRegisterCount)++;
-			
-			break;
-		    }
-	    case RTestResMan::EDeRegisterClient:
-	        {
-            Kern::Printf("RTestResMan::EDeRegisterClient");          
-            if(iResClientId==0)
-                {
-                r = KErrArgument;
-                break;
-                }
-            r = PowerResourceManager::DeRegisterClient(iResClientId);
-            break;
-	        }    
-        case RTestResMan::EPrintResourceInfo:
-            {
-            Kern::Printf("RTestResMan::EPrintResourceInfo");          
-            TPowerResourceInfoBuf01 info;
-            info.SetLength(0);
-            Kern::Printf("EPrintResourceInfo");
-            r = PowerResourceManager::GetResourceInfo(iResClientId,KResourceId,&info);
-            Kern::Printf("EPrintResourceInfo:%S", info().iResourceName);
-            break;
-            }
-		default:
-		    {
-			r = KErrNotSupported;
-			break;
-		    }
-		}
-	return r;
-
-	}
-
-
-TInt DTestResManLdd::DoRequest(TInt aReqNo, TRequestStatus* aStatus, TAny* /*a1*/, TAny* /*a2*/)
-	{
-	TInt r = KErrNone;
-
-	if(r != KErrNone)
-		Kern::RequestComplete(iClientThreadPtr, aStatus, r);
-	switch(aReqNo)
-		{
-        case RTestResMan::EWaitAndChangeResource:
-            // Queue a dfc which wait for the semaphore and then call ChangeResourceState
-            Kern::Printf("RTestResMan::EWaitAndChangeResource 0x%x [#1.1]", &(Kern::CurrentThread().iNThread));            
-            if(iStatus)
-                {
-                r = KErrInUse;
-                break;
-                }
-            iStatus = aStatus;
-
-            iWaitAndChangeResourceDfc = new TDfc(WaitAndChangeResourceDfcFn, this, 
-                    ((DTestResManLddFactory*)iDevice)->iLddHelperQue, 5);
-            iWaitAndChangeResourceDfc->Enque();
-
-            break;
-        case RTestResMan::EChangeResourceAndSignal:	
-            // call ChangeResourceState and signal the semaphore
-            Kern::Printf("RTestResMan::EChangeResourceAndSignal 0x%x [#1.2]", &(Kern::CurrentThread().iNThread));             
-            if(iStatus)
-                {
-                r = KErrInUse;
-                break;
-                }
-            iStatus = aStatus;
-            PowerResourceManager::ChangeResourceState(iResClientId, KResourceId, KResourceMin, 
-                    ((DTestResManLddFactory*)iDevice)->iAsyncResourceCallback);
-            ((DTestResManLddFactory*)iDevice)->iCallbackState = DTestResManLddFactory::ESignallerCallback;
-
-            break;            
-	    default:
-	        break;
-		}
-	return r;
-	}
--- a/kerneltest/e32test/resourceman/d_rescontrolclisync.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-// 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:
-// e32test\resourceman\d_rescontrolclisync.h
-// 
-//
-
-#ifndef __D_RESCONTROLCLISYNC_H__
-#define __D_RESCONTROLCLISYNC_H__
-
-#include <e32cmn.h>
-#include <e32ver.h>
-#ifndef __KERNEL_MODE__
-#include <e32std.h>
-#endif   
-
-_LIT(KLddFileName, "D_RESCONTROLCLISYNC.LDD");
-_LIT(KLddName, "D_RESCONTROLCLISYNC.LDD");
-_LIT(KPddFileName, "resourcecontroller.pdd");
-_LIT(KPddName, "resourcecontroller.pdd");
-
-
-/** User side logical channel */
-class RTestResMan : public RBusLogicalChannel
-	{
-public:
-	// Structure for holding driver capabilities information
-	class TCaps
-		{
-	public:
-		TVersion iVersion;
-		};
-
-private:
-	enum TControl //Request types for synchronous operation.
-		{ 
-		ERegisterClient,
-        EDeRegisterClient,	
-        EPrintResourceInfo,
-        ERegisterNotification,
-        EDeRegisterNotification,
-		EMaxControl,
-		
-		};
-	enum TRequest //Request types for asynchronous operation
-		{
-        EWaitAndChangeResource = EMaxControl + 1,
-        EChangeResourceAndSignal, 
-	    EMaxRequest, 
-		};
-	friend class DTestResManLdd;
-public:
-   	TInt Open();
-   	TInt PrintResourceInfo()
-   	    {return DoControl(EPrintResourceInfo);}
-   	TInt RegisterClient()
-   	    {return DoControl(ERegisterClient);}
-    TInt DeRegisterClient()
-        {return DoControl(EDeRegisterClient);}
-    TInt RegisterNotification()
-        {return DoControl(ERegisterNotification);}
-    TInt DeRegisterNotification()
-        {return DoControl(EDeRegisterNotification);}
-    void WaitAndChangeResource(TRequestStatus& aStatus)
-        {DoRequest(EWaitAndChangeResource, aStatus);}    
-    void ChangeResourceAndSignal(TRequestStatus& aStatus)
-        {DoRequest(EChangeResourceAndSignal, aStatus);}    
-
-    inline static TVersion VersionRequired();
-    
-    };
-
-inline TVersion RTestResMan::VersionRequired()
-	{
-	const TInt KMajorVersionNumber=1;
-	const TInt KMinorVersionNumber=0;
-	const TInt KBuildVersionNumber=KE32BuildVersionNumber;
-	return TVersion(KMajorVersionNumber,KMinorVersionNumber,KBuildVersionNumber);
-	}
-
-#ifndef __KERNEL_MODE__
-
-/** Open a channel for the driver.*/ 
-TInt RTestResMan::Open()
-	{
-    return DoCreate(KLddName, VersionRequired(), KNullUnit, &KPddName, NULL, EOwnerProcess, EFalse);
-	}
-
-
-#endif //__KERNEL_MODE__
-#endif //__D_RESCONTROLCLISYNC_H__
--- a/kerneltest/e32test/resourceman/resourceman_psl/rescontrol_extended_psl.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/resourceman/resourceman_psl/rescontrol_extended_psl.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -31,65 +31,56 @@
 									|						  |
 								ResourceF				   ResourceG	
 	*/
-
-TInt DSimulatedPowerResourceController::DoRegisterStaticResourcesDependency(RPointerArray <DStaticPowerResourceD> & aStaticResourceDArray)
+TInt DSimulatedPowerResourceController::DoRegisterStaticResourcesDependency(DStaticPowerResourceD**& aStaticResourceDArray, TUint16& aStaticResourceDCount)
 	{
 	Kern::Printf(">DSimulatedPowerResourceController::DoRegisterStaticResourcesDependency");
-
-	// this is just for testing purposes - try to call base-class implementation, which by default resets the values and returns KErrNone
-	TInt r = DPowerResourceController::DoRegisterStaticResourcesDependency(aStaticResourceDArray);
-	if(r != KErrNone || aStaticResourceDArray.Count())
-		{
-		Kern::Printf("DPowerResourceController::DoRegisterStaticResourcesDependency() default base class implementation has failed?");
-		return KErrGeneral;
-		}
-
+	aStaticResourceDArray = (DStaticPowerResourceD**)new(DStaticPowerResourceD*[MAX_DEPENDENT_RESOURCE_COUNT]);
+	if(!aStaticResourceDArray)
+		return KErrNoMemory;
 	DStaticPowerResourceD* pR = NULL;
-	TBool error_occured = EFalse;
-
 	pR = new DMLSLGLSPDependResource();
-	if(!SafeAppend(aStaticResourceDArray, pR))
-		error_occured = ETrue;
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResDependencyCount, aStaticResourceDArray, KErrNoMemory)
+	aStaticResourceDArray[iStaticResDependencyCount++] = pR;
 
 	pR = new DMLSIGLSNDependResource();
-	if(!SafeAppend(aStaticResourceDArray, pR))
-		error_occured = ETrue;
-
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResDependencyCount, aStaticResourceDArray, KErrNoMemory)
+	aStaticResourceDArray[iStaticResDependencyCount++] = pR;
+	
 	pR = new DBSIGLSPDependResource();
-	if(!SafeAppend(aStaticResourceDArray, pR))
-		error_occured = ETrue;
-	
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResDependencyCount, aStaticResourceDArray, KErrNoMemory)
+	aStaticResourceDArray[iStaticResDependencyCount++] = pR;
+
 	pR = new DMLSHIGLSPDependResource();
-	if(!SafeAppend(aStaticResourceDArray, pR))
-		error_occured = ETrue;
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResDependencyCount, aStaticResourceDArray, KErrNoMemory)
+	aStaticResourceDArray[iStaticResDependencyCount++] = pR;
 
 	pR = new DBSHLGLSNDependResource();
-	if(!SafeAppend(aStaticResourceDArray, pR))
-		error_occured = ETrue;
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResDependencyCount, aStaticResourceDArray, KErrNoMemory)
+	aStaticResourceDArray[iStaticResDependencyCount++] = pR;
 
 	pR = new DMLSHLGLSNDependResource();
-	if(!SafeAppend(aStaticResourceDArray, pR))
-		error_occured = ETrue;
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResDependencyCount, aStaticResourceDArray, KErrNoMemory)
+	aStaticResourceDArray[iStaticResDependencyCount++] = pR;
 
 	//Establish resource dependencies
-	r = CreateResourceDependency(aStaticResourceDArray);
-	if(r != KErrNone)
-		error_occured = ETrue;
+	if(CreateResourceDependency(aStaticResourceDArray))
+		CLEAN_AND_RETURN(iStaticResDependencyCount, aStaticResourceDArray, KErrNoMemory)
 
-	// the only error that could occur here is KErrNoMemory (also from calling CreateResourceDependency)
-	// clean-up if the error did occur
-	if(error_occured)
-		{
-		aStaticResourceDArray.ResetAndDestroy();
-		r = KErrNoMemory;
-		}
+	iDependencyResources = aStaticResourceDArray;
 
-	return r;
+	aStaticResourceDCount = iStaticResDependencyCount;
+	return KErrNone;
 	}
 
 
 // This function establishes above dependency between static dependent resource
-TInt DSimulatedPowerResourceController::CreateResourceDependency(RPointerArray <DStaticPowerResourceD> & pResArray)
+TInt DSimulatedPowerResourceController::CreateResourceDependency(DStaticPowerResourceD** pResArray)
 	{
 	iNodeArray = new SNode[10];
 	SNode* pN1;
--- a/kerneltest/e32test/resourceman/resourceman_psl/rescontrol_psl.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/resourceman/resourceman_psl/rescontrol_psl.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -49,8 +49,7 @@
 	}
 
 /** Constructor for simulated resource controller. */
-DSimulatedPowerResourceController::DSimulatedPowerResourceController()
-	: iEventDfc(EventDfcFunc, this)
+DSimulatedPowerResourceController::DSimulatedPowerResourceController():DPowerResourceController(),iStaticResourceCount(0), iEventDfc(EventDfcFunc, this)
 	{
 	Kern::Printf(">DSimulatedPowerResourceController");
 	}
@@ -58,51 +57,26 @@
 /** Destructor for simulated resource controller. */
 DSimulatedPowerResourceController::~DSimulatedPowerResourceController()
 	{
-	Kern::Printf(">~DSimulatedPowerResourceController()\n");
+	Kern::Printf("DSimulatedPowerResourceController::~DSimulatedPowerResourceController()\n");
 	((TDynamicDfcQue*)iDfcQ)->Destroy();
-	delete iMsgQ;
-
-	SPowerResourceClientLevel *pCL = iClientLevelPool;
-	while(iClientLevelPool) //Find the starting position of array to delete
+	DStaticPowerResource *pR;
+	TUint c;
+	for(c = 0; c < iStaticResourceCount; c++)
 		{
-		if(iClientLevelPool < pCL)
-			pCL = iClientLevelPool;
-		iClientLevelPool = iClientLevelPool->iNextInList;
+		pR = iResources[c];
+		delete pR;
 		}
-
-	delete [] pCL;
-	SPowerRequest *pReq = iRequestPool;
-	while(iRequestPool) //Find the starting position of array to delete
-		{
-		if(iRequestPool < pReq)
-			pReq = iRequestPool;
-		iRequestPool = iRequestPool->iNext;
-		}
-	delete [] pReq;
-
+	delete []iResources;
 #ifdef PRM_ENABLE_EXTENDED_VERSION
-	pCL = iResourceLevelPool;
-	while(iResourceLevelPool)
+	DStaticPowerResourceD* pDR;
+	
+	delete []iNodeArray; //Delete dependency nodes
+	for(c = 0; c < iStaticResDependencyCount; c++) 
 		{
-		if(iResourceLevelPool < pCL)
-			pCL = iResourceLevelPool;
-		iResourceLevelPool = iResourceLevelPool->iNextInList;
+		pDR = iDependencyResources[c];
+		delete pDR;
 		}
-	//delete resource pool
-	delete [] pCL;
-	delete iMsgQDependency;
-#endif
-
-	iClientList.Delete();
-	iUserSideClientList.Delete();
-	iStaticResourceArray.ResetAndDestroy();
-
-#ifdef PRM_ENABLE_EXTENDED_VERSION
-	iCleanList.ResetAndDestroy();
-	iDynamicResourceList.Delete();
-	iDynamicResDependencyList.Delete();
-	delete [] iNodeArray; //Delete dependency nodes
-	iStaticResDependencyArray.ResetAndDestroy();
+	delete []iDependencyResources;
 #endif
 	}
 
@@ -300,133 +274,147 @@
 	}
 
 //This registers all static resource with resource controller. This function is called by PIL
-TInt DSimulatedPowerResourceController::DoRegisterStaticResources(RPointerArray <DStaticPowerResource> & aStaticResourceArray)
+TInt DSimulatedPowerResourceController::DoRegisterStaticResources(DStaticPowerResource**& aStaticResourceArray, TUint16& aStaticResourceCount)
 	{
 	Kern::Printf(">DSimulatedPowerResourceController::DoRegisterStaticResources");
-
-	TBool error_occured = EFalse;
-	TInt r = KErrNone;
+	aStaticResourceArray = (DStaticPowerResource**)new(DStaticPowerResource*[MAX_RESOURCE_COUNT]);
+	if(!aStaticResourceArray)
+		return KErrNoMemory;
+	DStaticPowerResource* pR = NULL;
 
 	//Create Binary Single Instantaneous Positive Resource
-	DStaticPowerResource* pR = new DBSIGISPResource();
-	if(!SafeAppend(aStaticResourceArray, pR))
-		error_occured = ETrue;
+	pR = new DBSIGISPResource();
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
+	aStaticResourceArray[iStaticResourceCount++] = pR;
 
 	//Create Multilevel Single Instantaneous Positive Resource
 	pR = new DMLSIGISPResource();
-	if(!SafeAppend(aStaticResourceArray, pR))
-		error_occured = ETrue;
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
+	aStaticResourceArray[iStaticResourceCount++] = pR;
 
 	//Create Binary Single Instantaneous Negative Resource
 	pR = new DBSIGISNResource();
-	if(!SafeAppend(aStaticResourceArray, pR))
-		error_occured = ETrue;
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
+	aStaticResourceArray[iStaticResourceCount++] = pR;
 
 	//Create Multilevel Single Instantaneous Negative Resource
 	pR = new DMLSIGISNResource();
-	if(!SafeAppend(aStaticResourceArray, pR))
-		error_occured = ETrue;
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
+	aStaticResourceArray[iStaticResourceCount++] = pR;
 
-	//Create Binary Single Long latency Positive Resource
+	//Create Binary Single Longlatency Positive Resource
 	pR = new DBSLGLSPResource();
-	if(!SafeAppend(aStaticResourceArray, pR))
-		error_occured = ETrue;
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
+	aStaticResourceArray[iStaticResourceCount++] = pR;
 
-	//Create Multilevel Single Long latency  Positive Resource
+	//Create Multilevel Single Longlatency  Positive Resource
 	pR = new DMLSLGLSPResource();
-	if(!SafeAppend(aStaticResourceArray, pR))
-		error_occured = ETrue;
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
+	aStaticResourceArray[iStaticResourceCount++] = pR;
 
-	//Create Binary Single Long latency Get & Instantaneous Set Negative Resource
+	//Create Binary Single Longlatency Get & Instantaneous Set Negative Resource
 	pR = new DBSLGISNResource();
-	if(!SafeAppend(aStaticResourceArray, pR))
-		error_occured = ETrue;
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
+	aStaticResourceArray[iStaticResourceCount++] = pR;
 
-	//Create Multilevel Single Long latency Get & Instantaneous Set Negative Resource
+	//Create Multilevel Single Longlatency Get & Instantaneous Set Negative Resource
 	pR = new DMLSLGISNResource();
-	if(!SafeAppend(aStaticResourceArray, pR))
-		error_occured = ETrue;
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
+	aStaticResourceArray[iStaticResourceCount++] = pR;
 
-	//Create Binary Single Instantaneous Get & Long latency Set Positive Resource
+	//Create Binary Single Instantaneous Get & Longlatency Set Positive Resource
 	pR = new DBSIGLSPResource();
-	if(!SafeAppend(aStaticResourceArray, pR))
-		error_occured = ETrue;
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
+	aStaticResourceArray[iStaticResourceCount++] = pR;
 
-	//Create Multilevel Single Instantaneous Get & Long latency Set Positive Resource
+	//Create Multilevel Single Instantaneous Get & Longlatency Set Positive Resource
 	pR = new DMLSIGLSPResource();
-	if(!SafeAppend(aStaticResourceArray, pR))
-		error_occured = ETrue;
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
+	aStaticResourceArray[iStaticResourceCount++] = pR;
 
 	//Create Binary SHared Instantaneous Positive Resource
 	pR = new DBSHIGISPResource();
-	if(!SafeAppend(aStaticResourceArray, pR))
-		error_occured = ETrue;
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
+	aStaticResourceArray[iStaticResourceCount++] = pR;
 
 	//Create Multilevel SHared Instantaneous Positive Resource
 	pR = new DMLSHIGISPResource();
-	if(!SafeAppend(aStaticResourceArray, pR))
-		error_occured = ETrue;
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
+	aStaticResourceArray[iStaticResourceCount++] = pR;
 
 	//Create Binary SHared Instantaneous Negative Resource
 	pR = new DBSHIGISNResource();
-	if(!SafeAppend(aStaticResourceArray, pR))
-		error_occured = ETrue;
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
+	aStaticResourceArray[iStaticResourceCount++] = pR;
 
 	//Create Multilevel SHared Instantaneous Negative Resource
 	pR = new DMLSHIGISNResource();
-	if(!SafeAppend(aStaticResourceArray, pR))
-		error_occured = ETrue;
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
+	aStaticResourceArray[iStaticResourceCount++] = pR;
 
-	//Create Binary SHared Long latency Positive Resource
+	//Create Binary SHared Longlatency Positive Resource
 	pR = new DBSHLGLSPResource();
-	if(!SafeAppend(aStaticResourceArray, pR))
-		error_occured = ETrue;
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
+	aStaticResourceArray[iStaticResourceCount++] = pR;
 
-	//Create Multilevel SHared Long latency  Positive Resource
+	//Create Multilevel SHared Longlatency  Positive Resource
 	pR = new DMLSHLGLSPResource();
-	if(!SafeAppend(aStaticResourceArray, pR))
-		error_occured = ETrue;
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
+	aStaticResourceArray[iStaticResourceCount++] = pR;
 
-	//Create Binary SHared Long latency Get & Instantaneous Set Negative Resource
+	//Create Binary SHared Longlatency Get & Instantaneous Set Negative Resource
 	pR = new DBSHLGISNResource();
-	if(!SafeAppend(aStaticResourceArray, pR))
-		error_occured = ETrue;
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
+	aStaticResourceArray[iStaticResourceCount++] = pR;
 
-	//Create Multilevel SHared Long latency Get & Instantaneous Set Negative Resource
+	//Create Multilevel SHared Longlatency Get & Instantaneous Set Negative Resource
 	pR = new DMLSHLGISNResource();
-	if(!SafeAppend(aStaticResourceArray, pR))
-		error_occured = ETrue;
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
+	aStaticResourceArray[iStaticResourceCount++] = pR;
 
 	//Create holes in resource array
-	if(aStaticResourceArray.Append(NULL) != KErrNone)
-		error_occured = ETrue;
-
-	if(aStaticResourceArray.Append(NULL) != KErrNone)
-		error_occured = ETrue;
+	aStaticResourceArray[iStaticResourceCount++] = NULL;
+	aStaticResourceArray[iStaticResourceCount++] = NULL;
+	//Create Binary SHared Instantaneous Get & Longlatency Set Positive Resource
+	pR = new DBSHIGLSPResource();
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
+	aStaticResourceArray[iStaticResourceCount++] = pR;
 
-	//Create Binary SHared Instantaneous Get & Long latency Set Positive Resource
-	pR = new DBSHIGLSPResource();
-	if(!SafeAppend(aStaticResourceArray, pR))
-		error_occured = ETrue;
-
-	//Create Multilevel SHared Instantaneous Get & Long latency Set Positive Resource
+	//Create Multilevel SHared Instantaneous Get & Longlatency Set Positive Resource
 	pR = new DMLSHIGLSPResource();
-	if(!SafeAppend(aStaticResourceArray, pR))
-		error_occured = ETrue;
-
-	//Create Binary shared Long latency get and set Custom Resource
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
+	aStaticResourceArray[iStaticResourceCount++] = pR;
+	 
+	//Create Binary shared Longlatency get and set Custom Resource
 	pR = new DBSHLGLSCResource();
-	if(!SafeAppend(aStaticResourceArray, pR))
-		error_occured = ETrue;
+	if(!pR)
+		CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory)
+	aStaticResourceArray[iStaticResourceCount++] = pR;
 
-	// the only error that could occur here is KErrNoMemory
-	// clean-up if the error did occur
-	if(error_occured)
-		{
-		aStaticResourceArray.ResetAndDestroy();
-		r = KErrNoMemory;
-		}
-	return r;
+	iResources = aStaticResourceArray;
+
+	aStaticResourceCount = iStaticResourceCount;
+	return KErrNone;
 	}
 
 //Constructors of all resources
--- a/kerneltest/e32test/resourceman/resourceman_psl/rescontrol_psl.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/resourceman/resourceman_psl/rescontrol_psl.h	Wed Sep 01 12:34:56 2010 +0100
@@ -32,20 +32,15 @@
 #define MAX_RESOURCE_COUNT 30
 #define MAX_DEPENDENT_RESOURCE_COUNT 10
 
-#define MAX_BLOCK_TIME 400 //Maximum block time
-#define MIN_BLOCK_TIME 200 //Guaranteed minimum block
+#define MAX_BLOCK_TIME 200 //Maximum block time
+#define MIN_BLOCK_TIME 50 //Guaranteed minimum block
 
-template <class T>
-inline TBool SafeAppend(RPointerArray <T> & aStaticResourceArray, T* pR)
-	{
-	if(pR)
-		{
-		if(aStaticResourceArray.Append(pR) == KErrNone)
-			return ETrue;
-		else
-			delete pR;
-		}
-	return EFalse;
+#define CLEAN_AND_RETURN(resCount, resArray, error)				\
+	{															\
+	for(TUint count = 0; count < resCount; count++)				\
+		delete resArray[count];									\
+	delete resArray;											\
+	return error;												\
 	}
 
 const TUint KBinary = 0x0;
@@ -60,10 +55,10 @@
 	~DSimulatedPowerResourceController();
     TInt DoInitController();
     TInt DoInitResources();
-    TInt DoRegisterStaticResources(RPointerArray <DStaticPowerResource> & aStaticResourceArray);
+    TInt DoRegisterStaticResources(DStaticPowerResource**& aStaticResourceArray, TUint16& aStaticResourceCount);
 	// Function to process instantaneous resources
     TInt ProcessInstantaneousResources(TPowerRequest& req, TInt& aClientLevel, TInt aMaxLevel, TInt aMinLevel, TInt aDefaultLevel);
-	// Function to process polled resources
+	// Function to procces polled resources
     TInt ProcessPolledResources(TPowerRequest& req, TInt& aClientLevel, TInt aMaxLevel, TInt aMinLevel, TInt aDefaultLevel, TInt aBlockTime = 0);
 	// Function to change the state of the resource
     TInt ChangeResource(TPowerRequest& req, TInt& aClientLevel, TInt aMaxLevel, TInt aMinLevel);
@@ -72,15 +67,19 @@
     IMPORT_C static TInt CaptureIdleResourcesInfo(TUint aControllerId, TUint aNumResources, TPtr* aPtr);
 	IMPORT_C static TInt CompleteResourceControllerInitialisation();
 #ifdef PRM_ENABLE_EXTENDED_VERSION
-	TInt DoRegisterStaticResourcesDependency(RPointerArray <DStaticPowerResourceD> & aStaticResourceDArray);
-	TInt CreateResourceDependency(RPointerArray <DStaticPowerResourceD> & pResArray);
+	TInt DoRegisterStaticResourcesDependency(DStaticPowerResourceD**& aStaticResourceDArray, TUint16& aStaticResourceDCount);
+	TInt CreateResourceDependency(DStaticPowerResourceD** pResArray);
 #endif
 private:
-    static void TimerIsrFunc(TAny* ptr); //ISR Function called when specified timer expires. This is for even driven resources
-    static void EventDfcFunc(TAny* ptr); //Function to wake up the fast semaphore. This is called from timer ISR.
-    NFastSemaphore iEventFastSem; //Semaphore to block the PIL of resource controller for event driven resource operations.
+    static void TimerIsrFunc(TAny* ptr); //ISR Function called when specfied timer expires. This is for even driven resources
+    static void EventDfcFunc(TAny* ptr); //Function to wakeup the fast semphore. This is called from timer ISR.
+    DStaticPowerResource** iResources;
+    TUint16 iStaticResourceCount;
+    NFastSemaphore iEventFastSem; //Semphore to block the PIL of resource controller for event driven resource operations.
     TDfc iEventDfc; //Dfc to run to signal the event semaphore when the timer expires. Queued from timer ISR
 #ifdef PRM_ENABLE_EXTENDED_VERSION
+	DStaticPowerResourceD** iDependencyResources;
+	TUint16 iStaticResDependencyCount;
 	SNode* iNodeArray;
 	TUint16 iNodeCount;
 #endif
--- a/kerneltest/e32test/resourceman/t_rescontrolcli.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/resourceman/t_rescontrolcli.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -28,9 +28,6 @@
 #include <e32def_private.h>
 #include "d_rescontrolcli.h"
 
-#include <drivers/resourcecontrol_clientsettings.h>
-#include <drivers/resourcecontrol_settings.h>
-
 #define MAX_STATIC_RESOURCE_NUM 24 //Maximum number of static resources in simulated PSL
 #define MAX_STATIC_DEPENDENCY_RESOURCE_NUM 7 //Maximum number of static dependency resources in simulated PSL
 #define DEPENDENCY_RESOURCE_BIT_MASK 0x00010000
@@ -4240,87 +4237,10 @@
 	Clients.Close();
 	}
 
-void TestClientSettings(TInt aClientToken, TUint aExpectedBase)
-	{
-	TUint clientBase = ElementId_ClientSettingBase(aClientToken);
-	test(clientBase == aExpectedBase);
-
-	HCR::TElementId Id;
-
-	Id = ElementId_ClientName(aClientToken);
-	test(Id == aExpectedBase);
-
-	Id = ElementId_ClientPropertyFlag(aClientToken);
-	test(Id == (aExpectedBase + 1));
-
-	Id = ElementId_ClientPreallocation(aClientToken);
-	test(Id == (aExpectedBase + 2));
-
-	TInt firstResource = 0;
-	Id = ElementId_ClientStaticResource(aClientToken, firstResource);
-	test(Id == (aExpectedBase + 3));
-	
-	TInt thirdResource = 2;
-	Id = ElementId_ClientStaticResource(aClientToken, thirdResource);
-	test(Id == (aExpectedBase + 5));
-	}
-	
-void TestDynamicResourceSettings(TInt aDynamicResource,  TUint aExpectedBase)
-	{
-	TUint dynamicResourceBase = ElementId_DynamicResourceBase(aDynamicResource);
-	test(dynamicResourceBase == aExpectedBase);
-	
-	HCR::TElementId Id;	
-	
-	Id = ElementId_DynamicResourceName(aDynamicResource);
-	test(Id == aExpectedBase);
-
-	Id = ElementId_DynamicResourcePropertyFlag(aDynamicResource);
-	test(Id == (aExpectedBase + 1));
-
-	Id = ElementId_DynamicResourceMaxLevel(aDynamicResource);
-	test(Id == (aExpectedBase + 2));
-	
-	Id = ElementId_DynamicResourceMinLevel(aDynamicResource);
-	test(Id == (aExpectedBase + 3));
-
-	Id = ElementId_DynamicResourceDefaultLevel(aDynamicResource);
-	test(Id == (aExpectedBase + 4));
-
-	Id = ElementId_DynamicResourceDependencyMask1(aDynamicResource);
-	test(Id == (aExpectedBase + 5));
-
-	Id = ElementId_DynamicResourceDependencyMask2(aDynamicResource);
-	test(Id == (aExpectedBase + 6));
-
-	Id = ElementId_DynamicResourceDependencyMask3(aDynamicResource);
-	test(Id == (aExpectedBase + 7));
-	}
-	
-void TestClientHCRSettingMacros()
-	{
-	TInt clientToken = 2; // Random token number
-	TUint expectedBase = 80; // refer resourcecontrol_clientsettings.h for calculations
-	TestClientSettings(clientToken, expectedBase);
-	
-	clientToken = 0;
-	expectedBase = 16; // refer resourcecontrol_clientsettings.h for calculations
-	TestClientSettings(clientToken, expectedBase);
-
-	// Dynamic Resource settings
-	TUint dynamicResource = 3; // Random token number
-	expectedBase = 131168; // refer resourcecontrol_clientsettings.h for calculations
-	TestDynamicResourceSettings(dynamicResource, expectedBase);
-	
-	test.Printf(_L("Testing HCR client setting Macro's for Resource Manager successful \n"));
-	}
-	
 GLDEF_C TInt E32Main()
 	{
 	test.Title();
 	test.Start(_L("Testing Resource Manager...\n"));
-	test.Printf(_L("Testing HCR client setting Macro's for Resource Manager \n"));
-	TestClientHCRSettingMacros();
 	test.Next(_L("Load Physical device"));
 #ifndef PRM_ENABLE_EXTENDED_VERSION
 	r = User::LoadPhysicalDevice(KPddFileName);
@@ -4336,22 +4256,8 @@
 	r=User::LoadLogicalDevice(KExtLddFileName);
 	test(r==KErrNone || r==KErrAlreadyExists);
 #endif
-
-	RDevice d;
-	TPckgBuf<RTestResMan::TCaps> caps;
-	r = d.Open(KLddName);
-	test(r == KErrNone);
-	d.GetCaps(caps);
-	d.Close();
-
-	TVersion ver = caps().iVersion;
-	test(ver.iMajor == 1);
-	test(ver.iMinor == 0);
-	test(ver.iBuild == KE32BuildVersionNumber);
-
 	r = lddChan.Open();
 	test(r==KErrNone || r==KErrAlreadyExists);
-
 	//Check whether the notifications recieved as a result of postboot level setting is as expected.
 	r = lddChan.CheckPostBootLevelNotifications();
 	test(r == KErrNone);
--- a/kerneltest/e32test/resourceman/t_rescontrolclisync.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-// 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:
-// e32test\resourceman\t_rescontrolclisync.cpp
-// TestCase Description:
-// This test harness is to test the unsafe setup of power request call back object
-// inside resourcecontrol.cpp. The memeber variable of TPowerRequestCb should not 
-// be corrupted when a second ChangeResourceState is execute during the call back
-// function is running.
-// 
-//
-
-#include <e32test.h>
-#include <e32hal.h>
-#include <e32math.h>
-#include <e32def.h>
-#include <e32def_private.h>
-#include "d_rescontrolclisync.h"
-
-
-
-LOCAL_D RTest test(_L("T_RESCONTROLCLISYNC"));
-RTestResMan lddChan;
-RTestResMan lddChan2;
-
-#define TESTANDCLEAN(x) TestAndClean(x,__LINE__)
-
-void TestAndClean(TBool aTestValid, TInt aLine)
-    {
-    if(!aTestValid)
-        {
-        lddChan.DeRegisterClient();
-        lddChan2.DeRegisterClient();
-        lddChan.Close();
-        lddChan2.Close();
-        User::FreeLogicalDevice(KLddFileName);
-        User::FreePhysicalDevice(KPddFileName);
-        RDebug::Printf("Test fail at line %d", aLine);
-        test.HandleError(EFalse, aLine, (TText *)__FILE__);
-        }
-    }
-
-GLDEF_C TInt E32Main()
-	{
-	test.Title();
-	test.Start(_L("Testing Resource Manager...\n"));
-
-	test.Next(_L("Load Physical device"));
-	TInt r = User::LoadPhysicalDevice(KPddFileName);
-	test(r==KErrNone || r==KErrAlreadyExists);
-	test.Next(_L("Load Logical Device"));
-	r=User::LoadLogicalDevice(KLddFileName);
-	test(r==KErrNone || r==KErrAlreadyExists);
-    test.Next(_L("Open Logical Channel 1"));	
-	r = lddChan.Open();
-    test(r==KErrNone);	
-    test.Next(_L("Open Logical Channel 2"));        
-	r = lddChan2.Open();
-	test(r==KErrNone);
-
-    test.Next(_L("Register client 1"));    
-	r = lddChan.RegisterClient();
-    RDebug::Printf("Register client 1 return r = %d", r);
-    TESTANDCLEAN(r==KErrNone);
-
-	test.Next(_L("Register client 2"));    
-	r = lddChan2.RegisterClient();
-    RDebug::Printf("Register client 2 return r = %d", r);
-    TESTANDCLEAN(r==KErrNone);
-    
-    test.Next(_L("Print resource info"));    
-    r = lddChan.PrintResourceInfo();
-    RDebug::Printf("Print resource info return r = %d", r);
-    TESTANDCLEAN(r==KErrNone);
-
-    TRequestStatus RequestStatus;
-    TRequestStatus RequestStatus2;
-    
-    test.Next(_L("WaitAndChangeResource"));    
-    lddChan.WaitAndChangeResource(RequestStatus);
-
-    test.Next(_L("ChangeResourceAndSignal"));    
-    lddChan2.ChangeResourceAndSignal(RequestStatus2);
-
-    User::WaitForRequest(RequestStatus);
-    TESTANDCLEAN(RequestStatus.Int()==KErrNone);
-    User::WaitForRequest(RequestStatus2);
-    TESTANDCLEAN(RequestStatus2.Int()==KErrNone);
-
-    test.Next(_L("De-register client 1")); 
-	r = lddChan.DeRegisterClient();
-    test(r==KErrNone);
-    
-    test.Next(_L("De-register client 2")); 	
-    r = lddChan2.DeRegisterClient();
-    test(r==KErrNone);
-    
-	test.Printf(_L("Closing the channel\n"));
-	lddChan.Close();
-	lddChan2.Close();
-	test.Printf(_L("Freeing logical device\n"));
-	r = User::FreeLogicalDevice(KLddFileName);
-	test(r==KErrNone);
-	r = User::FreePhysicalDevice(KPddFileName);
-	test(r==KErrNone);
-	test.End();
-	test.Close();
-	return KErrNone;
-	}
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/basic_tests/r_kernel_low_memory_security_svr_session.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,39 @@
+// 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;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/basic_tests/r_kernel_low_memory_security_svr_session.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,39 @@
+// 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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/basic_tests/r_low_memory_security_svr_session.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,86 @@
+// 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;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/basic_tests/r_low_memory_security_svr_session.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,43 @@
+// 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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/basic_tests/r_user_low_memory_security_svr_session.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,54 @@
+// 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
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/basic_tests/r_user_low_memory_security_svr_session.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,39 @@
+// 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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/basic_tests/t_rmdebug2.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,4681 @@
+// 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"
+// 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 <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"
+#include "d_rmdebug_bkpt_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
+
+TBool gUseDelay;
+
+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));
+
+	TBool found = EFalse;
+	
+	/* We need these loops because on some system the kernel run mode debugger does not 
+	 immediately present the thread in the thread list. 
+	 */
+	
+	for(TInt retryCount = 0; retryCount < 10 && !found; retryCount++ )
+		{
+		//test getting this process's thread list, ETrue as should find the target debug thread
+		User::After(50000);
+		found = DoTestGetThreadList(ETrue, EScopeProcessSpecific, RProcess().Id().Id());
+		}
+	test( found );
+	found = EFalse;
+
+	for(TInt retryCount = 0; retryCount < 10 && !found; retryCount++ )
+		{
+		//test getting the global list, ETrue as should find the target debug thread
+		User::After(50000);
+		found = DoTestGetThreadList(ETrue, EScopeGlobal);
+		}
+	test( found );
+
+	found = EFalse;
+	for(TInt retryCount = 0; retryCount < 10 && !found; retryCount++ )
+		{
+		//test getting this thread's thread list, ETrue as should find the target debug thread
+		User::After(50000);
+		found = DoTestGetThreadList(ETrue, EScopeThreadSpecific, RThread().Id().Id());
+		}
+	test( found );
+
+	test(KErrNone == iServSession.ResumeThread(iThreadID));
+	test(KErrNone == iServSession.DetachExecutable(iFileName));
+	}
+			
+TBool CRunModeAgent::DoTestGetThreadList(const TBool aShouldPass, const TListScope aListScope, const TUint64 aTargetId)
+	{
+	//create data to pass
+	RBuf8 buffer;
+	TUint32 size = 0;
+
+	//perform the call to get the thread list
+	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;
+			break;
+			}
+
+		ptr += Align4(entry->GetSize());
+		}
+
+	//clean up
+	buffer.Close();
+	return found;
+
+	}
+
+//---------------------------------------------
+//! @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();
+
+	}
+
+
+/**
+ * Get a list from the run mode debug system. Most list calls will initially return KErrTooBig, 
+ * since the initial size of the buffer is 0. However it is sometimes valid for a list to be empty
+ * given its filtering and scope. These calls should return KErrNone.
+ */
+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;
+	
+	TInt ret = KErrNone;
+	//should pass this test (assuming we've passed in sensible arguments above...)
+	if(EScopeGlobal == aListScope)
+		{
+		ret = iServSession.GetList(aListId, aBuffer, aSize);
+		}
+	else if(EScopeThreadSpecific == aListScope)
+		{
+		ret = iServSession.GetList((TThreadId)aTargetId, aListId, aBuffer, aSize);
+		}
+	else if(EScopeProcessSpecific == aListScope)
+		{
+		ret = iServSession.GetList((TProcessId)aTargetId, aListId, aBuffer, aSize);
+		}
+	else
+		{
+		// unknown list scope
+		test(0);
+		}
+
+	if( KErrNone == ret )
+		{
+		/* In the case that there is no data, just return and let the caller check
+		the buffer. It is valid for a caller to not expect any data to be returned.
+		*/
+		return;
+		}
+	
+	// The only other allowed return is KErrTooBig
+	test( ret == KErrTooBig );
+
+	//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-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
+//! @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(flag == EValid)
+		{
+		/* The PC value was changed to execute the function TestFunction.
+		* TestFunction changes the value of TestData to a given value and 
+		* then calls RMDebug_BranchTst1.
+		* We place a breakpoint on RMDebug_BranchTst1 so that to we are able 
+		* to test the value of TestData.
+		*/
+
+		test(KErrNone == iServSession.SetEventAction(iFileName,EEventsBreakPoint, EActionSuspend));
+		TBreakId armBreakId;
+		TUint32 address = (TUint32)(&RMDebug_BranchTst1);
+		test(KErrNone == iServSession.SetBreak(armBreakId,iThreadID,address,EArmMode));
+
+		// 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 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);
+
+		test(KErrNone == iServSession.ClearBreak(armBreakId));
+
+		// Finally test the value
+		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()
+	{
+	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()
+	{
+	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++)
+		{
+		if( gUseDelay ) User::After(500000);
+
+		RDebug::Printf("CRunModeAgent::TestEventsWithExtraThreads 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)
+			{
+			//RDebug::Printf("CRunModeAgent::TestEventsWithExtraThreads EActionSuspend == aActionMain, j=%d", j);
+			// 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++)
+				{
+				//RDebug::Printf("CRunModeAgent::TestEventsWithExtraThreads dyingThreads, k=%d, j=%d", k,j);
+				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));
+					}
+				}
+			}
+
+		if( gUseDelay ) User::After(500000);
+
+		// 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...
+		TInt waitCount = 10;
+		while((waitCount-- > 0) && ProcessExists(processId))
+			{
+			/* Wait a little while and try again, just in case the process is still being removed.
+			This can happen on a very busy system or when a popup for the events is still active
+			*/
+			RDebug::Printf("CRunModeAgent::TestEventsWithExtraThreads. ProcessExists(id=%d), waiting count exit=%d", 
+				I64LOW(processId), waitCount);
+			User::After(50000);
+			}
+		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)
+	{
+	RThread lThread;
+	TInt ret = lThread.Open( aThreadId.Id() );
+
+	if( ret != KErrNone )
+		{
+		RDebug::Printf("ThreadExistsForProcess: thread id=%d opening returned %d",
+			I64LOW( aThreadId.Id() ), ret );
+		lThread.Close();
+		return EFalse;
+		}
+
+	RProcess lProcess;
+	ret = lThread.Process( lProcess );
+
+	lThread.Close();
+
+	if( ret != KErrNone )
+		{
+		RDebug::Printf("ThreadExistsForProcess: proc opening returned %d", ret );
+		ret = KErrNotFound;
+		}
+	else if( lProcess.Id() != aProcessId )
+		{
+		RDebug::Printf("ThreadExistsForProcess: lProcess.Id()(%d)!= aProcessId(%d)",
+				I64LOW(lProcess.Id().Id()), I64LOW(aProcessId.Id()));
+		ret = KErrNotFound;
+		}
+
+	lProcess.Close();
+	
+	return ( ret == KErrNone );
+	}
+
+// 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). Checks that DSS behaves correctly
+//!						when different versions are passed in to Connect().
+//!
+//! @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);
+
+	// 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)
+	//
+	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 where NAND flash is not currently supported we get a KErrNotSupported - this is still a pass
+	if (KErrNotSupported == err)
+		{
+		test.Printf(_L("Nand flash not supported - continue"));
+		return;
+		}
+
+ 	//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);
+
+	TInt processId = process.Id();
+	process.Close();
+
+	// program now running, so try to kill it
+	err = iServSession.KillProcess(processId, 0 /* kill reason */);
+	test(err == KErrNone);
+
+	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);
+
+	TInt process2Id = process2.Id();
+	process2.Close();
+
+	// program now running, so try to kill it
+	err = iServSession.KillProcess(process2Id, 0 /* kill reason */);
+	test(err == KErrPermissionDenied);
+
+	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)
+	{
+	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;
+
+			// Now stop the target thread from generating trace events
+			test(KErrNone == SwitchTestFunction(EDoNothing));
+			}
+		else
+			{
+			// Its EEventsUserTrace, so delay us in getting the next event so that it will be more 
+			// likely to get a EEventsUserTracesLost next time. 
+			// This is important on SMP since the platform can process lots of events, and thus
+			// withouth the delay it is difficult for this test to reproduce the abnormal situation of 
+			// lost trace packets
+			User::After(200000);
+			}
+
+		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)
+	{
+	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);
+
+	if( gUseDelay ) User::After(500000);
+
+	// Do we expect to successfully attach
+	if (aExpectSuccess)
+	{
+		// Yes
+		test(KErrNone == err);
+
+		// Now detach again
+		test(KErrNone == iServSession.DetachExecutable(aProcessName));
+		if( gUseDelay ) User::After(500000);
+	}
+	else
+	{
+		// No
+		test(KErrPermissionDenied == err);
+
+		// Just to be sure, try active attachment
+		test(KErrPermissionDenied == iServSession.AttachExecutable(aProcessName, ETrue));
+		if( gUseDelay ) User::After(500000);
+	}
+
+	// Kill the process, as we don't need it anymore
+	process.Kill(KErrNone);
+	if( gUseDelay ) User::After(500000);
+	}
+
+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("-d: use delays\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;
+				case 'd':
+					//store the fact that we want to run in reverse
+					gUseDelay = EFalse;
+					RDebug::Printf("Not using delays");
+					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]);
+		if( gUseDelay ) User::After(500000);
+		}
+	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::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()
+//
+// 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;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/basic_tests/t_rmdebug2.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,191 @@
+// 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"
+// 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 = 29; 
+
+//
+// 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();
+
+	TBool 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 TestBreakPointsInLoop();
+	void DoTestBreakPointsInLoop(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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/basic_tests/t_rmdebug2_oemtoken.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,32 @@
+// 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/common/t_target_launcher.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,221 @@
+// 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:
+// Helper app to launch debug targets. Uses command-line parameters as follows using a + sign:
+//  +n<number of applications to launch>
+//  +m<number of times to launch each application>
+//  +o<order of launch, 1 means launch in reverse order>
+//
+
+#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 <hal.h>
+#include <u32hal.h>
+#include <e32property.h>
+
+#include "t_target_launcher.h"
+
+
+/**
+  Launch a process
+
+  @param aProcess The RProcess object to use to create the process
+  @param aExeName File name of the executable to create the process from
+  @param aCommandLine The command line to pass to the new process
+  @return KErrNone on success, or one of the other system wide error codes
+  */
+TInt LaunchProcess(RProcess& aProcess, TDesC & aExeName, TPtr & aCommandLine )
+    {
+
+    TPtrC commandLine( aCommandLine );
+
+    TInt err = aProcess.Create( aExeName, commandLine );
+
+    // check that there was no error raised
+    if(err != KErrNone)
+        {
+        return err;
+        }
+
+    TRequestStatus status = KRequestPending;
+    aProcess.Rendezvous(status);
+
+    if(KRequestPending != status.Int())
+        {
+        // startup failed so kill the process
+        RDebug::Printf( "> RProcess Rendezvous() failed with %d. Killing process", status.Int() );
+        aProcess.Kill(KErrNone);
+        return status.Int();
+        }
+    else
+        {
+        // start up succeeded so resume the process
+        aProcess.Resume();
+        User::WaitForRequest(status);
+        if(KErrNone != status.Int())
+            {
+            RDebug::Printf( "> RProcess Resume() failed with %d. Killing process", status.Int() );
+            aProcess.Kill(KErrNone);
+            }
+        return status.Int();
+        }
+    }
+
+/**
+ * Read command line parameters and control the launching of targets. 
+ * Create global launch semaphore KLaunchMutexName
+ */
+void MainL()
+    {
+
+    TInt numApps = KNumApps;
+    TInt numLaunches = KNumLaunches;
+    TInt launchControl = 0;
+
+    TInt argc = User::CommandLineLength();
+    HBufC* commandLine = NULL;
+    RDebug::Printf( ">Launcher Process() argc=%d", argc );
+
+    if( argc )
+        {
+        commandLine = HBufC::NewLC(argc);
+        TPtr commandLineBuffer = commandLine->Des();
+        User::CommandLine(commandLineBuffer);
+
+        RBuf printCommandLine;
+        CleanupClosePushL( printCommandLine );
+        printCommandLine.CreateL( commandLine->Des().Length() );
+        printCommandLine.Copy( commandLine->Des() );
+        printCommandLine.Collapse();
+        RDebug::Printf( ">command line = %S", &printCommandLine );
+        CleanupStack::PopAndDestroy( &printCommandLine );
+
+        // create a lexer and read through the command line
+        TLex lex(*commandLine);
+        while (!lex.Eos())
+            {
+            // only look for options with first character '+', other switches are for the targets
+            if (lex.Get() == '+')
+                {
+                TChar arg = lex.Get();
+                switch (arg)
+                    {
+                    case 'n':
+                        lex.Val( numApps );
+                        RDebug::Printf("parsed numApps as %d", numApps);
+                        break;
+                    case 'm':
+                        lex.Val( numLaunches );
+                        RDebug::Printf("parsed numLaunches as %d", numLaunches );
+                        break;
+                    case 'o':
+                        lex.Val( launchControl );
+                        RDebug::Printf("parsed launchControl as %d", launchControl);
+                        break;
+                    default:
+                        // unknown argument ignore it
+                        break;             
+                    }//switch
+                }// if +
+            }//while
+        }//if argc
+
+   RSemaphore launchMutex;
+   TInt ret = KErrNone;
+   CleanupClosePushL( launchMutex );
+   ret = launchMutex.CreateGlobal( KLaunchMutexName, 0 );
+   RDebug::Printf( ">Target Launcher : RSemaphore.CreateGlobal ret %d", ret);
+   User::LeaveIfError( ret );
+
+   ret = launchMutex.OpenGlobal( KLaunchMutexName );
+   RDebug::Printf( ">Target Launcher : RSemaphore.OpenGlobal ret %d", ret);
+   User::LeaveIfError( ret );
+
+   //Now launch the requested number of apps for the requested number of launches
+   for( ; numLaunches > 0; numLaunches-- )
+       { 
+       for( TInt launchIndex = numApps; launchIndex > 0; launchIndex-- )  
+           {
+           RDebug::Printf( ">Target Launcher:  Mutex wait app %d, launch %d", launchIndex, numLaunches );
+           launchMutex.Wait();
+
+           RBuf targetName;
+           CleanupClosePushL( targetName );
+           RDebug::Printf( ">Target Launcher:  targetName.Create %d, launch %d", launchIndex, numLaunches );
+           targetName.Create( KTargetExe().Length() + 2 );
+
+           if( launchControl == 1 )
+               {
+               // Reverse the order of the apps launched by reversing the index in the name
+               RDebug::Printf( ">Target Launcher:  targetName.Format %d, launch %d", numApps - launchIndex + 1, numLaunches );
+               targetName.Format( KTargetExe(), numApps - launchIndex + 1 );
+               }
+           else
+               {
+               RDebug::Printf( ">Target Launcher:  targetName.Format %d, launch %d", launchIndex, numLaunches );
+               targetName.Format( KTargetExe(), launchIndex );
+               }
+
+           RProcess aProc;
+           CleanupClosePushL( aProc ); 
+    
+           RDebug::Printf( ">Target Launcher: LaunchProcess %d, launch %d", launchIndex, numLaunches );
+           RDebug::Printf( ">LaunchProcess %lS", &targetName );
+           TPtr cmdLinePtr( commandLine->Des() );
+           ret = LaunchProcess( aProc, targetName, cmdLinePtr );
+           CleanupStack::PopAndDestroy( &aProc );
+
+           RDebug::Printf( "<Target Launcher: LaunchProcess returned %d", ret );
+           CleanupStack::PopAndDestroy( &targetName );
+
+           User::LeaveIfError( ret );
+
+           //By now the add proc event should have been delivered to the
+           //test app agent.
+           }
+       }
+
+    launchMutex.Wait( 500000 );
+
+    CleanupStack::PopAndDestroy( &launchMutex );
+
+    if( commandLine )
+       CleanupStack::PopAndDestroy( commandLine );
+ 
+    }
+
+
+GLDEF_C TInt E32Main()
+	{
+	RProcess thisProcess;
+	thisProcess.Rendezvous(KErrNone);
+	RDebug::Printf( ">Launcher Process()" );
+
+	CTrapCleanup* trap = CTrapCleanup::New();
+	if (!trap)
+		return KErrNoMemory;
+
+	TRAPD(err, MainL());
+	RDebug::Printf( "< Target launching returned %d", err);
+	
+	delete trap;
+	
+	return err;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/common/t_target_launcher.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,47 @@
+// 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:
+// Definitions for target launcher
+// 
+//
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+
+#ifndef RMDEBUG_TARGET_LAUNCHER_H
+#define RMDEBUG_TARGET_LAUNCHER_H
+
+// Controls how many times the target applications are launched
+const TInt KNumLaunches = 3;
+
+// Controls how many applications are attached and launched
+// If changing this, need to make sure there are enough apps
+// being built. see KTargetExe and t_rmdebug_app*
+const TInt KNumApps = 4;  
+
+_LIT(KLaunchMutexName, "t_rmdebug_launch_mutex");
+_LIT(KLaunchMutexNameSearchString, "t_rmdebug_launch_mutex*");
+_LIT(KTargetExe,"z:\\sys\\bin\\t_rmdebug_app%d.exe");
+_LIT8(KTargetExeName,"t_rmdebug_app%d.exe");
+_LIT(KProcessFinder,"*t_rmdebug_app%d*");
+_LIT(KTargetOptions,"-f%d");
+
+_LIT(KZSysBin,"z:\\sys\\bin\\");
+_LIT(KLauncherExe,"z:\\sys\\bin\\t_rmdebug_target_launcher.exe");
+
+_LIT_SECURITY_POLICY_PASS(KAllowAllPolicy);
+
+#endif // RMDEBUG_TARGET_LAUNCHER_H
--- a/kerneltest/e32test/rm_debug/crashmonitor/t_crashmonitor.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/rm_debug/crashmonitor/t_crashmonitor.h	Wed Sep 01 12:34:56 2010 +0100
@@ -28,6 +28,7 @@
 #include <e32cons.h>
 #include <e32test.h>
 #include <e32cmn.h>
+#include <rm_debug_api.h>
 #include <scmdatatypes.h>
 #include <scmbytestreamutil.h>
 #include <hal.h>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/debug_targets/d_demand_paging.cia	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,57 @@
+// 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"
+// 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");
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/debug_targets/d_demand_paging.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,22 @@
+// 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"
+// 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_bkpt_test.h	Wed Sep 01 12:34:56 2010 +0100
@@ -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 Sep 01 12:34:56 2010 +0100
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_step_test.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,81 @@
+// 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"
+// 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_step_test.s	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,268 @@
+; 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"
+; 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-step$$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_step_test.s
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_step_test_armv4.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,50 @@
+// 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"
+// 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_step_test_armv4.s	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,130 @@
+; 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"
+; 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthread.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,106 @@
+// 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;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthread.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,38 @@
+// 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthread2.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,218 @@
+// 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"
+// 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_rmdebug_bkpt_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 	KNumberOfTraceCalls = 50;
+
+EXPORT_C TInt TestFunction()
+	{
+	// Set TestData to an arbitrary value that can be checked by a tester
+	TestData = 0xffeeddcc;
+	RMDebug_BranchTst1();
+	
+	// Code here may not be executed because tests can change the PC value
+	// at any time, typically once the test passes
+	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();
+
+	// The tester will change FunctionChooser once it gets what it needs out of the test
+	for(TInt cnt = KNumberOfTraceCalls; cnt>0 && (FunctionChooser==EMultipleTraceCalls); cnt--)
+		{
+		RDebug::Printf("T");
+		RDebug::Printf("R");
+		RDebug::Printf("A");
+		RDebug::Printf("C");
+		RDebug::Printf("E");
+		}
+	
+	//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;
+
+	/* Beware of adding printf or other debug-generating events in this loop because
+	* they interfere with the tests
+	*/
+	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();
+
+				// Breakpoints in loop test
+				RMDebug_Bkpt_Test_Entry();
+
+				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;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthread2.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,51 @@
+// 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,
+	EDoNothing = 4
+	};
+
+class CDebugServThread : public CBase
+	{
+	public:
+		CDebugServThread();
+		static TInt ThreadFunction(TAny* aStarted);    
+
+	public:
+	};
+
+#endif // RMDEBUGSVRTHRD_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthreadasm.cia	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,32 @@
+// 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
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthreadasm2.cia	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,35 @@
+// 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/t_rmdebug_app.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,382 @@
+// 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"
+// 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 <u32hal.h>
+#include <f32file.h>
+
+
+
+#include "t_rmdebug_app.h"
+
+IMPORT_C extern void RMDebug_BranchTst2();
+
+LOCAL_C void ParseCommandLineL(TInt32& aFunctionType, TUint& aDelay, TUint& aExtraThreads, TInt32& aCpuNumber)
+	{
+	// get the length of the command line arguments
+	TInt argc = User::CommandLineLength();
+	RDebug::Printf(" t_rmdebug_app: ParseCommandLineL argc=%d", argc);
+
+	// 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));
+					RDebug::Printf(" t_rmdebug_app: setting aFunctionType=%d", aFunctionType);
+					break;
+				case 'd':
+					// the digits following '-d' give the delay
+					User::LeaveIfError(lex.Val(aDelay));
+					RDebug::Printf(" t_rmdebug_app: setting aDelay=%d", aDelay);
+					break;
+				case 'e':
+					// the digits following '-e' give the number of extra threads to launch
+					User::LeaveIfError(lex.Val(aExtraThreads));
+					RDebug::Printf(" t_rmdebug_app: setting aExtraThreads=%d", aExtraThreads);
+					break;
+
+				case 'a':
+						// the digits following '-a' gives the cpu on which this thread will execute on
+					User::LeaveIfError(lex.Val(aCpuNumber));
+					RDebug::Printf(" t_rmdebug_app: CPU Number=%d", aCpuNumber);
+					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 NormalExit()
+    {
+    RDebug::Printf("Target app: NormalExit() function. Returning to MainL" );
+    }
+
+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);
+	}
+
+TInt NumberOfCpus()
+	{
+	TInt r = UserSvr::HalFunction(EHalGroupKernel, EKernelHalNumLogicalCpus, 0, 0);
+	return r;
+	}
+
+TInt SetCpuAffinity(TInt aCpuNumber)
+	{
+    TInt TestCpuCount = NumberOfCpus();
+	RDebug::Printf("SetCpuAffinity --> TestCpuCount = %d\n", TestCpuCount);		
+	TUint32 cpu = 0;
+
+	if ((aCpuNumber % TestCpuCount) != 0)
+	cpu = (TUint32)(aCpuNumber % TestCpuCount);
+
+	RDebug::Printf("SetCpuAffinity --> Setting cpu %3d\n", cpu);
+	TInt r = UserSvr::HalFunction(EHalGroupKernel, EKernelHalLockThreadToCpu, (TAny *)cpu, 0);
+	return r;
+	}
+
+// call the function corresponding to aFunctionType
+LOCAL_C void CallFunction(TDebugFunctionType aFunctionType, TUint aDelay, TUint aExtraThreads, TInt32 aCpuNumber)
+	{
+	// pause for aDelay microseconds
+	User::After(aDelay);
+
+	// set cpu on which this thread should execute on
+	if (aCpuNumber)
+		SetCpuAffinity(aCpuNumber);
+
+	// 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 ENormalExit:
+            NormalExit();
+            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()
+	{
+		
+	RDebug::Printf("t_rmdebug_app tid=%d,pid=%d", I64LOW(RThread().Id().Id()), I64LOW(RProcess().Id().Id()) ) ;
+	// 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;
+	TInt32 aCpuNumber = -1;
+
+	TRAPD(err, ParseCommandLineL(functionTypeAsTInt32, delay, extraThreads, aCpuNumber));
+
+	if(KErrNone == err)
+		{
+		// if the command line arguments were successfully read then call the appropriate function
+		CallFunction((TDebugFunctionType)functionTypeAsTInt32, delay, extraThreads, aCpuNumber);
+		}
+
+	// perform clean up and return any error which was recorded
+	delete cleanup;
+	__UHEAP_MARKEND;
+	return err;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_app.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,44 @@
+// 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,
+	ENormalExit
+	};
+
+#endif //T_RMDEBUG_APP_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_dll.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,25 @@
+// 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;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_dll.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,23 @@
+// 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();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_security.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,100 @@
+// 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;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/debug_targets/t_rmdebug_security.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,44 @@
+// 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_multi_agent_launcher.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,41 @@
+// 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:
+// Application that launches multiple agents which in-turn test the ability of 
+// the run mode debug component to debug several targets
+// 
+//
+
+targettype     exe
+target         t_multi_agent_launcher.exe
+
+library		euser.lib hal.lib
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+userinclude    ../debug_targets
+userinclude    ../common
+userinclude    ../multi_agent_tests
+
+sourcepath	   ../multi_agent_tests
+source         t_multi_agent_launcher.cpp 
+
+UID            0x0 0x4321bbbc
+SECUREID       0x1234aaab
+VENDORID       0x70000001
+
+DEBUGGABLE
+
+macro SYMBIAN_STANDARDDEBUG
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,40 @@
+// 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:
+// 
+//
+
+ALWAYS_BUILD_AS_ARM
+
+target         t_rmdebug.exe
+targettype     exe
+
+sourcepath	   	../metro_trk
+source        	d_rmdebugserver.cpp 
+source        	d_rmdebugthread.cpp 
+source        	t_rmdebug.cpp 
+sourcepath	   	../common
+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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug2.mmh	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,66 @@
+// 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"
+// 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:
+// 
+//
+
+ALWAYS_BUILD_AS_ARM
+
+targettype     exe
+
+sourcepath	   	..\debug_targets
+
+source        	d_rmdebugthread2.cpp 
+source			d_rmdebugthreadasm2.cia
+
+#if defined(MARM_ARMV5)
+source			d_rmdebug_step_test.s
+source			d_rmdebug_bkpt_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
+userinclude    ..\debug_targets
+
+
+#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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug2.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,35 @@
+// 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:
+// 
+//
+
+#include "t_rmdebug2.mmh"
+
+target         t_rmdebug2.exe
+
+sourcepath	   	../basic_tests
+source        	t_rmdebug2.cpp 
+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
+
+UID            0x0 0x4321bbbb
+SECUREID       0x1234aaaa
+VENDORID       0x70000001
+
+CAPABILITY 	READUSERDATA POWERMGMT ALLFILES
+
+DEBUGGABLE
+
+macro SYMBIAN_STANDARDDEBUG
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug2_oem.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,38 @@
+// 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:
+// 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
+
+sourcepath	   	../basic_tests
+source        	t_rmdebug2.cpp 
+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
+
+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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug2_oem2.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,38 @@
+// 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:
+// 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
+
+sourcepath	   	../basic_tests
+source        	t_rmdebug2.cpp 
+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
+
+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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug2_oemtoken.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,36 @@
+// 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:
+// 
+//
+
+ALWAYS_BUILD_AS_ARM
+
+target         OEMDebug_F123ABCD.exe
+targettype     exe
+
+sourcepath	   	../basic_tests
+
+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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug2_oemtoken2.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,37 @@
+// 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:
+// 
+//
+
+ALWAYS_BUILD_AS_ARM
+
+target         OEMDebug_F1234567.exe
+targettype     exe
+
+sourcepath	   	../basic_tests
+
+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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug_app.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,35 @@
+// 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:
+// 
+//
+
+target             t_rmdebug_app.exe
+targettype         exe
+
+sourcepath         ../debug_targets
+source             t_rmdebug_app.cpp 
+source			   d_rmdebugthreadasm2.cia
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+library            euser.lib hal.lib
+
+uid                0x0 0x0
+capability         none
+
+always_build_as_arm
+pagedcode
+
+DEBUGGABLE
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug_app1.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,36 @@
+// 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:
+// Target application to be debugged
+// 
+//
+
+target             t_rmdebug_app1.exe
+targettype         exe
+
+sourcepath         ../debug_targets
+source             t_rmdebug_app.cpp 
+source             d_rmdebugthreadasm2.cia
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+library            euser.lib hal.lib
+
+uid                0x0 0x0
+capability         none
+
+always_build_as_arm
+pagedcode
+
+DEBUGGABLE
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug_app10.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,36 @@
+// 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:
+// Target application to be debugged
+// 
+//
+
+target             t_rmdebug_app10.exe
+targettype         exe
+
+sourcepath         ../debug_targets
+source             t_rmdebug_app.cpp 
+source             d_rmdebugthreadasm2.cia
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+library            euser.lib hal.lib
+
+uid                0x0 0x0
+capability         none
+
+always_build_as_arm
+pagedcode
+
+DEBUGGABLE
+
+SMPSAFE
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug_app2.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,36 @@
+// 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:
+// Target application to be debugged
+// 
+//
+
+target             t_rmdebug_app2.exe
+targettype         exe
+
+sourcepath         ../debug_targets
+source             t_rmdebug_app.cpp 
+source             d_rmdebugthreadasm2.cia
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+library            euser.lib hal.lib
+
+uid                0x0 0x0
+capability         none
+
+always_build_as_arm
+pagedcode
+
+DEBUGGABLE
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug_app3.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,36 @@
+// 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:
+// Target application to be debugged
+// 
+//
+
+target             t_rmdebug_app3.exe
+targettype         exe
+
+sourcepath         ../debug_targets
+source             t_rmdebug_app.cpp 
+source             d_rmdebugthreadasm2.cia
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+library            euser.lib hal.lib
+
+uid                0x0 0x0
+capability         none
+
+always_build_as_arm
+pagedcode
+
+DEBUGGABLE
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug_app4.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,36 @@
+// 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:
+// Target application to be debugged
+// 
+//
+
+target             t_rmdebug_app4.exe
+targettype         exe
+
+sourcepath         ../debug_targets
+source             t_rmdebug_app.cpp 
+source             d_rmdebugthreadasm2.cia
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+library            euser.lib hal.lib
+
+uid                0x0 0x0
+capability         none
+
+always_build_as_arm
+pagedcode
+
+DEBUGGABLE
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug_app5.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,36 @@
+// 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:
+// Target application to be debugged
+// 
+//
+
+target             t_rmdebug_app5.exe
+targettype         exe
+
+sourcepath         ../debug_targets
+source             t_rmdebug_app.cpp 
+source             d_rmdebugthreadasm2.cia
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+library            euser.lib hal.lib
+
+uid                0x0 0x0
+capability         none
+
+always_build_as_arm
+pagedcode
+
+DEBUGGABLE
+
+SMPSAFE
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug_app6.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,36 @@
+// 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:
+// Target application to be debugged
+// 
+//
+
+target             t_rmdebug_app6.exe
+targettype         exe
+
+sourcepath         ../debug_targets
+source             t_rmdebug_app.cpp 
+source             d_rmdebugthreadasm2.cia
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+library            euser.lib hal.lib
+
+uid                0x0 0x0
+capability         none
+
+always_build_as_arm
+pagedcode
+
+DEBUGGABLE
+
+SMPSAFE
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug_app7.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,36 @@
+// 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:
+// Target application to be debugged
+// 
+//
+
+target             t_rmdebug_app7.exe
+targettype         exe
+
+sourcepath         ../debug_targets
+source             t_rmdebug_app.cpp 
+source             d_rmdebugthreadasm2.cia
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+library            euser.lib hal.lib
+
+uid                0x0 0x0
+capability         none
+
+always_build_as_arm
+pagedcode
+
+DEBUGGABLE
+
+SMPSAFE
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug_app8.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,36 @@
+// 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:
+// Target application to be debugged
+// 
+//
+
+target             t_rmdebug_app8.exe
+targettype         exe
+
+sourcepath         ../debug_targets
+source             t_rmdebug_app.cpp 
+source             d_rmdebugthreadasm2.cia
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+library            euser.lib hal.lib
+
+uid                0x0 0x0
+capability         none
+
+always_build_as_arm
+pagedcode
+
+DEBUGGABLE
+
+SMPSAFE
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug_app9.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,36 @@
+// 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:
+// Target application to be debugged
+// 
+//
+
+target             t_rmdebug_app9.exe
+targettype         exe
+
+sourcepath         ../debug_targets
+source             t_rmdebug_app.cpp 
+source             d_rmdebugthreadasm2.cia
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+library            euser.lib hal.lib
+
+uid                0x0 0x0
+capability         none
+
+always_build_as_arm
+pagedcode
+
+DEBUGGABLE
+
+SMPSAFE
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug_dll.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,38 @@
+// 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:
+// 
+//
+
+ALWAYS_BUILD_AS_ARM
+
+target         t_rmdebug_dll.dll
+targettype     dll
+
+DEFFILE        ../../~/t_rmdebug_dll.def
+
+sourcepath	   	../debug_targets
+
+source        	t_rmdebug_dll.cpp 
+
+library		euser.lib
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+capability PowerMgmt AllFiles ReadUserData
+
+UID            0x0 0x0
+SECUREID       0x0
+VENDORID       0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug_multi_agent.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,41 @@
+// 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:
+// Application that tests the ability of the run mode debug component 
+// to debug multiple targets 
+// 
+//
+
+targettype     exe
+target         t_rmdebug_multi_agent.exe
+
+library		euser.lib hal.lib
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+userinclude    ../debug_targets
+userinclude    ../common
+userinclude    ../multi_agent_tests
+
+sourcepath	   ../multi_agent_tests
+source         t_multi_agent.cpp t_agent_eventhandler.cpp 
+
+UID            0x0 0x4321bbbc
+SECUREID       0x1234aaab
+VENDORID       0x70000001
+
+DEBUGGABLE
+
+macro SYMBIAN_STANDARDDEBUG
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug_multi_target.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,43 @@
+// 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:
+// Application that tests the ability of the run mode debug component 
+// to debug several targets
+// 
+//
+
+ALWAYS_BUILD_AS_ARM
+
+targettype     exe
+target         t_rmdebug_multi_target.exe
+
+library		euser.lib hal.lib
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+userinclude    ../debug_targets
+userinclude    ../common
+userinclude    ../multi_target_tests
+
+sourcepath	   ../multi_target_tests
+source         t_multi_target.cpp 
+
+UID            0x0 0x4321bbbc
+SECUREID       0x1234aaab
+VENDORID       0x70000001
+
+DEBUGGABLE
+
+macro SYMBIAN_STANDARDDEBUG
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug_security0.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,36 @@
+// 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:
+// 
+//
+
+ALWAYS_BUILD_AS_ARM
+
+target         t_rmdebug_security0.exe
+targettype     exe
+
+sourcepath	   	../debug_targets
+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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug_security1.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,35 @@
+// 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:
+// 
+//
+
+ALWAYS_BUILD_AS_ARM
+
+target         t_rmdebug_security1.exe
+targettype     exe
+
+sourcepath	   	../debug_targets
+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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug_security2.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,37 @@
+// 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:
+// 
+//
+
+ALWAYS_BUILD_AS_ARM
+
+target         t_rmdebug_security2.exe
+targettype     exe
+
+sourcepath	   	../debug_targets
+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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug_security3.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,37 @@
+// 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:
+// 
+//
+
+ALWAYS_BUILD_AS_ARM
+
+target         t_rmdebug_security3.exe
+targettype     exe
+
+sourcepath	   	../debug_targets
+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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug_target_launcher.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,38 @@
+// 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:
+// Application that test the ability of the run mode debug component 
+// to handle several target applications
+// 
+//
+
+target         t_rmdebug_target_launcher.exe
+targettype     exe
+
+library		     euser.lib
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+userinclude    ../common
+sourcepath	   ../common
+source         t_target_launcher.cpp 
+
+UID            0x0 0x4321bbbd
+SECUREID       0x1234aaac
+VENDORID       0x70000001
+
+DEBUGGABLE
+
+macro SYMBIAN_STANDARDDEBUG
+
+SMPSAFE
--- a/kerneltest/e32test/rm_debug/group/t_trkdummyapp.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/rm_debug/group/t_trkdummyapp.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -27,6 +27,7 @@
 library		euser.lib
 library         hal.lib
 library         efsrv.lib
+library         t_rmdebug_dll.lib
 
 SYMBIAN_BASE_SYSTEMINCLUDE(nkern)
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/metro_trk/d_rmdebugclient.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,100 @@
+// 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/metro_trk/d_rmdebugserver.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,453 @@
+// 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;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/metro_trk/d_rmdebugserver.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,73 @@
+// 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/metro_trk/t_rmdebug.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,347 @@
+// 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;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/metro_trk/t_rmdebug.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,61 @@
+// 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/multi_agent_tests/t_agent_eventhandler.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,124 @@
+// 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"
+// 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 the handling of run mode events for a particular target executable
+// 
+
+#include <e32base.h>
+#include <e32property.h>
+#include <e32test.h>
+
+#include "t_rmdebug_app.h"
+#include "t_agent_eventhandler.h"
+#include "t_multi_agent.h"
+#include "t_debug_logging.h" 
+
+using namespace Debug;
+
+CAgentAsyncEvent::CAgentAsyncEvent(CMultiAgent& aDriver, const TDesC& aExeName, const TDesC& aExeConfig):
+	CActive(EPriorityStandard), iDriver(aDriver)
+	{
+	}
+
+CAgentAsyncEvent* CAgentAsyncEvent::NewLC(CMultiAgent& aDriver, const TDesC& aExeName, const TDesC& aExeConfig)
+	{
+	CAgentAsyncEvent* self = new(ELeave) CAgentAsyncEvent(aDriver, aExeName, aExeConfig);
+	CleanupStack::PushL(self);
+	self->ConstructL(aExeName, aExeConfig);
+	return self;
+	}
+
+CAgentAsyncEvent* CAgentAsyncEvent::NewL(CMultiAgent& aDriver, const TDesC& aExeName, const TDesC& aExeConfig)
+	{
+	CAgentAsyncEvent* self = CAgentAsyncEvent::NewLC(aDriver, aExeName, aExeConfig);
+	CleanupStack::Pop(); // self
+	return self;
+	}
+
+void CAgentAsyncEvent::ConstructL(const TDesC& aExeName, const TDesC& aExeConfig)
+	{
+	iExeName.CreateL(aExeName);
+	iExeConfig.CreateL(aExeConfig);
+	CActiveScheduler::Add(this);
+	}
+
+CAgentAsyncEvent::~CAgentAsyncEvent()
+	{
+	LOG_MSG2("~CAgentAsyncEvent(), this = 0x%08x", this);
+
+	iSEventInfo.iEventInfoBuf.Delete(0, sizeof(TEventInfo));
+	iExeName.Close();
+	iExeConfig.Close();
+	iProc.Close();
+	Cancel(); // Cancel any request, if outstanding
+	}
+
+/*
+ * Issue request to DSS and notify the active scheduler
+ */
+void CAgentAsyncEvent::Watch()
+	{
+	LOG_MSG2("ENTER: CAgentAsyncEvent::Watch, this = 0x%08x", this);
+	iDriver.DebugDriver().GetEvent(GetExecutable(), iStatus, iSEventInfo.iEventInfoBuf);
+
+	if (!IsActive())
+		{
+		LOG_MSG("CAgentAsyncEvent::Watch(): SetActive()");
+		SetActive();
+		}
+
+	LOG_MSG("EXIT: CAgentAsyncEvent::Watch");
+	}
+
+void CAgentAsyncEvent::RunL()
+	{
+	LOG_MSG4("ENTER: CAgentAsyncEvent::RunL iDebugType=%d, iStatus.Int() %d, this 0x%x08", 
+			 iSEventInfo.iEventInfo.iEventType, iStatus.Int(), this);
+	
+    LOG_MSG2("%S", &TPtr8((TUint8*)GetExecutable().Ptr(), 2*GetExecutable().Length(), 2*GetExecutable().Length()));	
+	iDriver.HandleEvent(iSEventInfo.iEventInfo);
+
+	LOG_MSG2("iDriver.GetNumApps() %d: ", iDriver.GetNumApps());
+	LOG_MSG2("iDriver.iLaunchCompleted  %d: ", iDriver.GetLaunchCompleted());
+
+	if (iDriver.GetLaunchCompleted() < iDriver.GetNumApps())
+		{
+		// Do not call Watch() if target has run to completion but test is still on going
+		if (iSEventInfo.iEventInfo.iEventType != EEventsRemoveProcess)
+			{
+			LOG_MSG("CAgentAsyncEvent::RunL Setting Watch()");
+			Watch();
+			}
+		}
+	else
+		{
+		// Stop event handling for all targets
+		LOG_MSG("CAgentAsyncEvent::RunL CActiveScheduler::Stop() & Cancel");
+		CActiveScheduler::Stop();
+		}
+
+	LOG_MSG2("EXIT: CAgentAsyncEvent::RunL", KNullDesC);
+	}
+
+void CAgentAsyncEvent::DoCancel()
+	{
+	LOG_MSG("CAgentAsyncEvent::DoCancel");
+	}
+
+TInt CAgentAsyncEvent::RunError(TInt aError)
+	{
+	LOG_MSG3(" RunL() has left with error %d, this 0x%08X", aError, this);
+	return aError; 
+	// Can we handle this error? Not at the moment!
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/multi_agent_tests/t_agent_eventhandler.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,90 @@
+// 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"
+// 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 event handling via the DSS and target specific information
+//
+//
+
+#ifndef RMDEBUG_AGENT_EVENTHANDLER_H
+#define RMDEBUG_AGENT_EVENTHANDLER_H
+
+#include "t_multi_agent.h"
+
+using namespace Debug;
+
+class CMultiAgent;
+
+/**
+ Class for gathering event data from the run-mode driver
+ */
+class TAgentEventInfo
+{
+public:
+	TAgentEventInfo() : 
+	iEventInfoBuf((TUint8*)&iEventInfo, sizeof(TEventInfo), sizeof(TEventInfo))
+	{ 	
+	}
+
+public:
+	// This is the underlying class for event interaction with the Run Mode debug API 
+	TEventInfo			iEventInfo;
+	
+	// A convenience handle for iEventInfo used across the Debug::GetEvent() method 
+	TPtr8				iEventInfoBuf;
+};
+
+/**
+  Active object class used to trap asynchronous events
+  Also, contains target specific parameters
+  */
+class CAgentAsyncEvent : public CActive
+	{
+public:
+	// Close buffers and Cancel and destroy
+	~CAgentAsyncEvent();	
+
+	// Two-phased constructor
+	static CAgentAsyncEvent* NewLC(CMultiAgent& aDriver, const TDesC& aExeName, const TDesC& aExeConfig);
+
+	// Two-phased constructor
+	static CAgentAsyncEvent* NewL(CMultiAgent& aDriver, const TDesC& aExeName, const TDesC& aExeConfig);
+
+	// set up ASP and issue another request	
+	void Watch();
+
+	TDesC& GetExecutable() { return iExeName; }
+ 	TDesC& GetExeConfig() { return iExeConfig; }
+	RProcess& GetProcHandle() { return iProc; }
+
+protected:
+	// from CActive
+	virtual void RunL();
+	virtual void DoCancel();
+	virtual TInt RunError(TInt aError);
+
+private:
+	CAgentAsyncEvent(CMultiAgent& aDriver, const TDesC& aExeName, const TDesC& aExeConfig);
+	void ConstructL(const TDesC& aExeName, const TDesC& aExeConfig);
+
+private:
+	RBuf iExeName;
+	RBuf iExeConfig;
+	RProcess iProc;
+
+	CMultiAgent& iDriver;
+	TAgentEventInfo iSEventInfo;
+	};
+
+#endif // RMDEBUG_AGENT_EVENTHANDLER_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/multi_agent_tests/t_debug_logging.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,52 @@
+// 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"
+// 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:
+// Logging macros for use in debug subsystem
+// 
+//
+
+#ifndef RMDEBUG_MULTI_AGENT_LOGGING_H
+#define RMDEBUG_MULTI_AGENT_LOGGING_H
+
+/* Debug messages
+ * 
+ * Debug messages are only generated for debug builds.
+ * 
+ * As user mode use RDebug::Printf(). 
+ * 
+ */
+
+// Uncomment if logging of multi agent test required
+// #define MULTI_AGENT_DEBUG_LOGGING 
+
+#ifdef MULTI_AGENT_DEBUG_LOGGING
+
+    #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 )
+
+#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 )
+
+#endif
+
+#endif //RMDEBUG_MULTI_AGENT_LOGGING_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/multi_agent_tests/t_multi_agent.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,432 @@
+// 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"
+// 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 run mode debug device component by launching multiple targets 
+// on different CPUs. On a single core the targets run on the same CPU.  
+//
+
+#include <e32base.h>
+#include <e32property.h>
+#include <hal.h>
+#include <e32test.h>
+#include <e32def.h>
+
+#include "t_rmdebug_app.h"
+#include "t_multi_agent.h"
+#include "t_agent_eventhandler.h"
+#include "t_debug_logging.h"
+
+const TVersion securityServerVersion(0,1,1);
+
+/**
+ * First phase constructor
+ */
+CMultiAgent* CMultiAgent::NewL()
+	{
+	CMultiAgent* self = new(ELeave) CMultiAgent();
+	self->ConstructL();
+	return self;
+	}
+
+/**
+  * Destructor
+  */
+CMultiAgent::~CMultiAgent()
+	{
+	LOG_MSG("~CMultiTargetAgent\n");
+	iServSession.Close();
+	}
+
+/**
+ * Constructor
+ */
+CMultiAgent::CMultiAgent() 
+	{
+	}
+
+/**
+ * Second phase constructor
+ */
+void CMultiAgent::ConstructL()
+	{
+	}
+
+/**
+  Parse the command line, set agent cpu affinity and call main test function
+  */
+void CMultiAgent::ClientAppL()
+	{
+	LOG_MSG("ENTER: CMultiTargetAgent::ClientAppL"); 
+
+	iNumApps = KNumApps;
+	iAgentCpuNo = KAgentCpu;
+	iTargetNameOffset = KTargetOffset;
+
+	TInt argc = User::CommandLineLength();
+	HBufC* commandLine = NULL;
+	LOG_MSG2(">Launcher Process() argc=%d", argc);
+	
+	if(argc)
+		{
+		commandLine = HBufC::NewLC(argc);
+		TPtr commandLineBuffer = commandLine->Des();
+		User::CommandLine(commandLineBuffer);
+
+		RBuf printCommandLine;
+		CleanupClosePushL(printCommandLine);
+		printCommandLine.CreateL(commandLine->Des().Length());
+		printCommandLine.Copy(commandLine->Des());
+		printCommandLine.Collapse();
+		LOG_MSG2(">command line = %S", &printCommandLine );
+		CleanupStack::PopAndDestroy( &printCommandLine );
+
+		// create a lexer and read through the command line
+		TLex lex(*commandLine);
+	
+		while (!lex.Eos())
+		{
+			// only look for options with first character '-'
+			if (lex.Get() == '-')
+			{
+			TChar arg = lex.Get();
+			
+				switch ( arg )
+				{
+				case 'n':
+					lex.Val( iNumApps );
+					LOG_MSG2("parsed numApps as %d", iNumApps); 
+					break;
+		
+				case 'a':
+					lex.Val( iAgentCpuNo );
+					LOG_MSG2("parsed agentCpuNo as %d", iAgentCpuNo);                        
+					break;
+
+				case 'o':
+					lex.Val( iTargetNameOffset );
+					LOG_MSG2("parsed iTargetNameOffset as %d", iTargetNameOffset);        
+					break;
+
+				default:
+					LOG_MSG("Bad argument from user"); 
+					break;                 
+				}
+			}
+		}
+	}
+	// Create active scheduler (to run active objects)
+	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
+	CleanupStack::PushL(scheduler);
+	CActiveScheduler::Install(scheduler);
+	
+	if (iAgentCpuNo)
+		{
+		LOG_MSG2("CMultiAgent::ClientAppL() - setting agent to cpu %d", iAgentCpuNo);
+		UserSvr::HalFunction(EHalGroupKernel, EKernelHalLockThreadToCpu, (TAny *)iAgentCpuNo, 0);
+		}
+
+	TInt err = iServSession.Connect(securityServerVersion);
+	
+	if (err != KErrNone)
+		{
+		User::Panic(_L("Can't open server session"), err);
+		}
+
+	StartTest();
+
+	// Note: below is a workaround to overcome an issue with RTest server crashing 
+	// when writing to the windows console from different agents (on different CPUs 
+	// at the same time). To overcome this we signal the launcher using a global 
+	// semaphore to indicate a RTest complete instead
+	RSemaphore launchSemaphore;
+	CleanupClosePushL(launchSemaphore);
+            
+	TFindSemaphore launchSemFinder(KLaunchSemaphoreSearchString);
+	TFullName semaphoreResult;
+	TInt ret = launchSemFinder.Next(semaphoreResult);
+	LOG_MSG3( "> Find Launch Semaphote.Next ret=%d, %lS", ret, &semaphoreResult);
+         
+	ret = launchSemaphore.OpenGlobal(semaphoreResult);
+	LOG_MSG2( ">OpenGlobal semaphore ret=%d", ret );         
+    
+	LOG_MSG( ">Signalling semaphore" );
+	launchSemaphore.Signal();
+	CleanupStack::PopAndDestroy(&launchSemaphore); // launchSemaphore
+
+	// Delete active scheduler
+	CleanupStack::PopAndDestroy(scheduler);
+
+	if (commandLine)
+	CleanupStack::PopAndDestroy(commandLine);
+	
+	LOG_MSG( "EXIT: CMultiTargetAgent::ClientAppL"); 
+	}
+
+/**
+  Launch a process
+  @param aProcess the RProcess object used to create the process
+  @param aFileName file name of the executable used to create the process
+  @return KErrNone on success, or one of the other system wide error codes
+  */
+TInt CMultiAgent::LaunchProcess(RProcess& aProcess, const TDesC& aExeName, const TDesC& aCommandLine)    
+	{
+	LOG_MSG( "ENTER: CMultiAgent::LaunchProcess");
+    LOG_MSG2("%S", &TPtr8((TUint8*)aExeName.Ptr(), 2*aExeName.Length(), 2*aExeName.Length()));	
+	
+	// wait for 0.5 seconds due to issue with creating several processes in smp quickly
+	User::After(500000);
+	
+	TInt err = aProcess.Create( aExeName, aCommandLine );
+	LOG_MSG2( "CMultiAgent::LaunchProcess, aProcess.Create err = %d", err); 
+
+	// check that there was no error raised
+	if (err != KErrNone)
+		return err;
+	
+	// rendezvous with process
+	TRequestStatus status = KRequestPending;
+	aProcess.Rendezvous(status);
+
+	if (KRequestPending != status.Int())
+		{
+		// startup failed so kill the process
+		LOG_MSG2( "> RProcess Rendezvous() failed with %d. Killing process", status.Int() );
+		aProcess.Kill(KErrNone);
+		LOG_MSG( "EXIT: CMultiAgent::LaunchProcess");
+		return status.Int();
+		}
+	else
+		{
+		// start the test target
+		aProcess.Resume();
+		User::WaitForRequest(status);
+	
+		LOG_MSG2( "> CMultiAgent::LaunchProcess: RProcess Resume() Rendezvous successful %d: ", status.Int() );
+
+		if(KErrNone != status.Int())
+			{
+			LOG_MSG2( "> RProcess Resume() failed with %d. Killing process", status.Int() );
+			aProcess.Kill(KErrNone);
+			}
+
+		LOG_MSG( "EXIT: CMultiAgent::LaunchProcess");
+		return status.Int();
+		}
+	}
+
+/**
+  Handle Event
+  @param aEventInfo object containing event information from the DSS 
+  */
+void CMultiAgent::HandleEvent(TEventInfo& aEventInfo)
+	{
+	LOG_MSG( "ENTER: CMultiAgent::HandleEvent" ); 
+	TInt ret = KErrNone;
+	const TInt idValid = 1;
+	
+	switch ( aEventInfo.iEventType )
+		{
+		case EEventsAddProcess:
+			{
+			LOG_MSG(">> EEventsAddProcess");                        
+			TPtrC8 exeNamePtr8(aEventInfo.iAddProcessInfo.iFileName, aEventInfo.iAddProcessInfo.iFileNameLength);
+	
+			RBuf8 exeName8;
+			CleanupClosePushL(exeName8);
+			exeName8.CreateL(exeNamePtr8);
+			LOG_MSG2("From event: exeName8=%S", &exeName8);
+			CleanupStack::PopAndDestroy(&exeName8);
+			LOG_MSG("Testing if event process id is valid");
+
+			LOG_MSG2("Got aEventInfo.iProcessId=%d", I64LOW( aEventInfo.iProcessId));
+			__ASSERT_ALWAYS((aEventInfo.iProcessIdValid==idValid), User::Panic(_L("ProcessId Invalid"), aEventInfo.iProcessIdValid));
+	
+			RProcess targetProc;
+			ret = targetProc.Open(TProcessId(aEventInfo.iProcessId));
+			LOG_MSG2("RProcess open ret=%d", ret);
+			targetProc.Close();
+
+			__ASSERT_ALWAYS((ret == KErrNone), User::Panic(_L("ProcessId Invalid"), aEventInfo.iProcessIdValid));
+			break;
+			}
+	
+		case EEventsStartThread:
+			{
+			LOG_MSG(">> EEventsStartThread");                
+			TPtrC8 exeNamePtr8(aEventInfo.iStartThreadInfo.iFileName, aEventInfo.iStartThreadInfo.iFileNameLength);
+			RBuf8 exe8Name;
+			CleanupClosePushL(exe8Name);
+			exe8Name.CreateL(exeNamePtr8);
+			LOG_MSG2("From event: exeName8=%S", &exe8Name);
+			CleanupStack::PopAndDestroy(&exe8Name);
+	
+			LOG_MSG("Testing if event process id is valid" );
+
+			__ASSERT_ALWAYS((aEventInfo.iProcessIdValid==idValid), User::Panic(_L("ProcessId Invalid"), aEventInfo.iProcessIdValid));
+
+			LOG_MSG2("Got aEventInfo.iProcessId=%d", I64LOW(aEventInfo.iProcessId));
+
+			LOG_MSG("Testing if event thread id is valid");
+
+			__ASSERT_ALWAYS((aEventInfo.iThreadIdValid==idValid), User::Panic(_L("ThreadId Invalid"), aEventInfo.iThreadIdValid));
+
+			LOG_MSG2("Got aEventInfo.iThreadId=%d", I64LOW(aEventInfo.iThreadId));
+			break;                    
+			}                       
+
+		case EEventsUserTrace:
+			{
+			LOG_MSG(">> EEventsUserTrace");  
+			break;
+			}
+
+		case EEventsRemoveProcess:
+			{
+			LOG_MSG( ">> EEventsRemoveProcess");                        
+			iLaunchCompleted++; 
+			break;
+			}
+	
+		default:   
+			{
+			LOG_MSG( ">> Unknown event - probably due to DSS busy?");
+			break;
+			}	
+		}
+ 	 
+	LOG_MSG("EXIT: CMultiAgent::HandleEvent"); 
+	}
+
+/**
+ * Main test function which launches several targets and stresses the DSS 
+ */
+TInt CMultiAgent::StartTest()
+	{
+	LOG_MSG("ENTER: CMultiTargetAgent::StartTest");
+
+	for( TInt i = 0; i < iNumApps; i++ )
+		{
+		RBuf targetName;
+		RBuf launcherOptions;
+
+		CleanupClosePushL(targetName); 
+		CleanupClosePushL(launcherOptions); 
+
+		targetName.CreateL( KTargetExe().Length() + 2 );
+		targetName.Format( KTargetExe(), i + iTargetNameOffset + 1 );
+
+		LOG_MSG2("App %d: ", i+1);
+		LOG_MSG2("%S", &TPtr8((TUint8*)targetName.Ptr(), 2*targetName.Length(), 2*targetName.Length()));	
+
+		launcherOptions.CreateL( KTargetOptions().Length() + 2 );
+		launcherOptions.Format( KTargetOptions(), (TUint)ENormalExit, (i+1) );
+
+		LOG_MSG( "AppOptions : ");
+		LOG_MSG2("%S", &TPtr8((TUint8*)launcherOptions.Ptr(), 2*launcherOptions.Length(), 2*launcherOptions.Length()));	
+		
+		// Add each test target to array
+		iTargetList.AppendL(CAgentAsyncEvent::NewL(*this, targetName, launcherOptions));
+		CleanupStack::PopAndDestroy(2, &targetName );
+		}
+	
+	iLaunchCompleted = 0;
+	TInt err = KErrNone;
+		
+	for (TInt i = 0; i < iNumApps; i++)
+		{
+		// Attach to process non-passively
+		LOG_MSG2( ">AttachExecutable app %d ", i + iTargetNameOffset + 1 );
+		LOG_MSG2("%S", &TPtr8((TUint8*)iTargetList[i]->GetExecutable().Ptr(), 2*iTargetList[i]->GetExecutable().Length(), 
+					2*iTargetList[i]->GetExecutable().Length()));
+
+		err = iServSession.AttachExecutable( iTargetList[i]->GetExecutable(), EFalse);
+		__ASSERT_ALWAYS((err == KErrNone), User::Panic(_L("DSS Attach failed"), err));
+
+		// Continue on interested event actions
+		LOG_MSG2( ">SetEventAction app %d,  EEventsStartThread EAcionContinue", i + iTargetNameOffset + 1);
+
+		err = iServSession.SetEventAction( iTargetList[i]->GetExecutable(), EEventsStartThread, EActionContinue);
+		__ASSERT_ALWAYS((err==KErrNone), User::Panic(_L("SetEventAction Error"), err));
+	
+		LOG_MSG2(">SetEventAction app %d,  EEventsAddProcess EActionContinue", i + iTargetNameOffset + 1);
+		err = iServSession.SetEventAction( iTargetList[i]->GetExecutable(), EEventsAddProcess, EActionContinue);
+		__ASSERT_ALWAYS((err==KErrNone), User::Panic(_L("SetEventAction Error"), err));
+
+		LOG_MSG2(">SetEventAction app %d,  EEventsUserTrace EActionContinue", i + iTargetNameOffset + 1);
+		err = iServSession.SetEventAction( iTargetList[i]->GetExecutable(), EEventsUserTrace, EActionContinue);
+		__ASSERT_ALWAYS((err==KErrNone), User::Panic(_L("SetEventAction Error"), err));
+	
+		LOG_MSG2(">SetEventAction app %d,  EEventsRemoveProcess EActionContinue", i + iTargetNameOffset + 1);
+		err = iServSession.SetEventAction( iTargetList[i]->GetExecutable(), EEventsRemoveProcess, EActionContinue);
+		__ASSERT_ALWAYS((err==KErrNone), User::Panic(_L("SetEventAction Error"), err));
+
+		// Add target object to active schedular
+		iTargetList[i]->Watch();
+		}
+
+	for (TInt i= 0; i< iNumApps; i++)
+		{
+		LOG_MSG( ">Calling LaunchProcess function");
+		err = LaunchProcess(iTargetList[i]->GetProcHandle(), iTargetList[i]->GetExecutable(), iTargetList[i]->GetExeConfig());
+		__ASSERT_ALWAYS((err==KErrNone), User::Panic(_L("LaunchProcess failed"), err));
+		}
+
+	LOG_MSG( ">CActiveScheduler::Start()");
+	CActiveScheduler::Start();
+
+	for (TInt i= 0; i < iNumApps; i++)
+		{
+		// Now detach again
+		LOG_MSG( "Before iServSession.DetachExecutable" );
+		err = iServSession.DetachExecutable(iTargetList[i]->GetExecutable());
+		__ASSERT_ALWAYS((err==KErrNone), User::Panic(_L("DetachExecutable failed"), err));
+		}
+	
+	// Free all the memory
+	iTargetList.ResetAndDestroy();
+	LOG_MSG( "EXIT: CMultiTargetAgent::StartTest" );
+
+	return KErrNone;
+	}
+
+/**
+  * Entry point for run mode debug driver test
+  */
+GLDEF_C TInt E32Main()
+	{
+	LOG_MSG( "ENTER: Multi_agent E32Main ");
+	__UHEAP_MARK;
+
+	TInt ret = KErrNone;
+	RProcess::Rendezvous(KErrNone);
+	
+	CTrapCleanup* trap = CTrapCleanup::New();
+		
+	if (!trap)
+		return KErrNoMemory;
+	
+	CMultiAgent *runModeAgent = CMultiAgent::NewL();
+
+	if (runModeAgent != NULL)
+		{
+		TRAP(ret,runModeAgent->ClientAppL());
+		LOG_MSG2( "ClientAppL returned %d", ret );
+		delete runModeAgent;
+		}
+
+	delete trap;
+	__UHEAP_MARKEND;
+	LOG_MSG( "EXIT: Multi_agent E32Main ");
+	return ret;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/multi_agent_tests/t_multi_agent.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,110 @@
+// 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_MULTI_AGENT_H
+#define RMDEBUG_MULTI_AGENT_H
+
+#include <u32hal.h>
+#include <f32file.h>
+#include <rm_debug_api.h>
+
+using namespace Debug;
+
+_LIT(KLaunchSemaphoreName, "t_rmdebug_launch_semaphore");
+_LIT(KLaunchSemaphoreSearchString, "t_rmdebug_launch_semaphore*");
+
+// Currently the targets are instances of t_rmdebug_app.exe
+_LIT(KTargetExe,"z:\\sys\\bin\\t_rmdebug_app%d.exe");
+
+_LIT(KTargetOptions,"-f%d -a%d");
+
+// If changing this, make sure there are enough apps built/in the rom 
+const TInt KNumApps = 5;
+
+// Default CPU execution for Agent
+const TInt KAgentCpu = 0;
+
+// Workaround to ensure we have the same agent binary when running multiple agents
+const TInt KTargetOffset = 0;
+
+class CAgentAsyncEvent;
+
+/**
+  @Class CRunModeAgent
+  
+  The basic run mode agent
+  */
+class CMultiAgent : public CBase
+	{
+	public:
+	static CMultiAgent* NewL();
+	~CMultiAgent();
+	void ClientAppL();  
+	RSecuritySvrSession&  DebugDriver() { return iServSession; };	
+	void HandleEvent(TEventInfo& aSEventInfo);
+
+	public:
+	TInt GetLaunchCompleted() const { return iLaunchCompleted; }
+	TInt GetNumApps() const { return iNumApps; }
+	TInt GetTargetOffset() const { return iTargetNameOffset; }
+
+	private:
+	CMultiAgent();
+	void ConstructL();
+	TInt StartTest();
+	TInt LaunchProcess(RProcess& aProcess, const TDesC& aExeName, const TDesC& aCommandLine);
+	
+	private:
+
+	/**
+	 * CPU agent executes on; by default this is 0 
+	 */
+	TInt iAgentCpuNo;
+
+	/*
+	 * Offset for running multiple targets using the same agent
+	 */
+	TInt iTargetNameOffset;
+
+	/** 
+	 * Number of applications/targets per agent
+	 */
+	TInt iNumApps;
+
+	/**
+	 * Flag used for terminating the event handling for a target 
+	 */	
+	TInt iLaunchCompleted;
+
+	/*
+	 * Handle to DSS
+	 */
+	RSecuritySvrSession iServSession;
+	
+	/**
+	 * Array to target parameters required by the agent
+	 */	
+	RPointerArray<CAgentAsyncEvent> iTargetList;
+	};
+
+#endif // RMDEBUG_MULTI_AGENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/multi_agent_tests/t_multi_agent_launcher.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,229 @@
+// 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:
+// Helper app to launch debug targets
+//
+//
+
+#include "t_multi_agent_launcher.h"
+
+#include "t_debug_logging.h"
+
+/**
+ * Launch a process
+ * @param aProcess the RProcess object used for creating the process
+ * @param aExeName the name of the executable to run 
+ * @param aCommandLine command line parameters to pass when creating the process 
+ * @return KErrNone on success, or one of the other system wide error codes
+ */
+TInt LaunchProcess(RProcess& aProcess, TDesC& aExeName, TDesC& aCommandLine )    
+	{
+	LOG_MSG("ENTER: t_multi_agent_launcher: launchProcess"); 
+
+	LOG_MSG2("aExeName %S ", &TPtr8((TUint8*)aExeName.Ptr(), 2*aExeName.Length(), 2*aExeName.Length()));
+	LOG_MSG2("aCommandLine %S", &TPtr8((TUint8*)aCommandLine.Ptr(), 2*aCommandLine.Length(), 2*aCommandLine.Length()));
+
+	TInt err = aProcess.Create( aExeName, aCommandLine );
+	LOG_MSG2("t_multi_agent_launcher launchProcess, aProcess.Create err = %d", err); 
+
+	// check that there was no error raised
+	if(err != KErrNone)
+		{
+		return err;
+		}
+
+	// rendezvous with process
+	TRequestStatus status = KRequestPending;
+	aProcess.Rendezvous(status);
+
+	if(KRequestPending != status.Int())
+		{
+		// startup failed so kill the process
+		LOG_MSG2("t_multi_agent_launcher: launchProcess: RProcess Rendezvous() failed with %d. Killing process", status.Int());
+		aProcess.Kill(KErrNone);
+		return status.Int();
+		}
+	else
+		{
+		aProcess.Resume();
+		User::WaitForRequest(status);
+
+		LOG_MSG2("t_multi_agent_launcher: launchProcess: RProcess Resume() Rendezvous successful %d: ", status.Int());
+
+		if(KErrNone != status.Int())
+			{
+			LOG_MSG2("t_multi_agent_launcher: RProcess Resume() failed with %d. Killing process", status.Int());
+			aProcess.Kill(KErrNone);
+			}
+
+		LOG_MSG("EXIT: t_multi_agent_launcher launchProcess");
+		return status.Int();
+		}
+	}
+
+/**
+ * Read command line parameters and control the launching of the agents. 
+ */
+void MainL()
+	{	
+	LOG_MSG( "ENTER: t_multi_agent_launcher MainL()");
+
+	TInt ret = KErrNone;
+	TInt numAgents = KNumAgents;
+	TInt numTargets = KNumTargets;
+	TInt numTestRuns = KNumTestRuns;
+
+	TInt argc = User::CommandLineLength();
+	HBufC* commandLine = NULL;
+	LOG_MSG2("t_multi_agent_launcher: MainL(): argc=%d", argc);
+    
+	if(argc)
+		{
+		commandLine = HBufC::NewLC(argc);
+		TPtr commandLineBuffer = commandLine->Des();
+		User::CommandLine(commandLineBuffer);
+
+		RBuf printCommandLine;
+		CleanupClosePushL( printCommandLine );
+		printCommandLine.CreateL( commandLine->Des().Length() );
+		printCommandLine.Copy( commandLine->Des() );
+		printCommandLine.Collapse();
+		LOG_MSG2("t_multi_agent_launcher: command line = %S", &printCommandLine);
+		CleanupStack::PopAndDestroy( &printCommandLine );
+ 
+		// create a lexer and read through the command line
+		TLex lex(*commandLine);
+		while (!lex.Eos())
+			{
+			// only look for options with first character '-'
+			if (lex.Get() == '-')
+				{
+					TChar arg = lex.Get();
+					switch ( arg )
+						{
+						case 'n':
+							lex.Val( numAgents );
+							LOG_MSG2("t_multi_agent_launcher: parsed numAgents as %d", numAgents);
+							break;
+						case 'm':
+							lex.Val( numTargets );
+							LOG_MSG2("t_multi_agent_launcher: parsed numTargets as %d", numTargets);                        
+							break;  
+						case 't':
+							lex.Val( numTestRuns );
+							LOG_MSG2("t_multi_agent_launcher: parsed numTestRuns as %d", numTestRuns);                        
+							break;                    
+						default:
+							LOG_MSG("t_multi_agent_launcher: unknown argument ignoring it");
+							break;                 
+						}
+				}
+			}
+		}
+
+	// Note: below is a workaround to overcome an issue with RTest server crashing 
+	// when writing to the windows console from different agents (on different CPUs 
+	// at the same time). To overcome this we get signaled by the agents when they have 
+	// completed their tests so that we can do a RTest complete
+	RSemaphore launchSemaphore;
+	CleanupClosePushL(launchSemaphore);
+	ret = launchSemaphore.CreateGlobal(KLaunchSemaphoreName, 0);
+	LOG_MSG2( ">Target Launcher : RSemaphore.CreateGlobal ret %d", ret);
+	User::LeaveIfError( ret );
+
+	ret = launchSemaphore.OpenGlobal(KLaunchSemaphoreName);
+	LOG_MSG2( ">Target Launcher : RSemaphore.OpenGlobal ret %d", ret);
+	User::LeaveIfError( ret );
+
+	//Now launch the requested number of apps for the requested number of test runs
+	for( TInt j = 0; j < numTestRuns; j++ )
+		{ 
+			for( TInt i = 0; i < numAgents; i++ )  
+				{
+					RBuf targetName;
+					targetName.CleanupClosePushL();
+					targetName.CreateL(KAgentExe());
+
+					RProcess aProc;
+					CleanupClosePushL(aProc); 
+					RBuf launcherOptions;
+					CleanupClosePushL(launcherOptions);
+				    const TInt additionalWords = 2;	
+					launcherOptions.CreateL( KAgentOptions().Length() + additionalWords );
+		
+					// Apply offset: launcherOptions.Format( .., .., i * numTargets, ..)
+					// workaround to ensure we have the same binary for multiple agents. 
+					// e.g. So if offset = 0, agent attaches to app1, app2, app3, app4, app5
+					// if offset = 5, agent attached to app6, app7, app8, app9, app10 etc.
+					// Note: apps need to be in rom otherwise the agent will fail on an assert 
+					// (with KErrNotFound)
+					launcherOptions.Format( KAgentOptions(), (TUint)numTargets, i * numTargets, 0);
+			
+					ret = LaunchProcess( aProc, targetName, launcherOptions );	
+					CleanupStack::PopAndDestroy(3,&targetName);
+					User::LeaveIfError(ret);
+				}
+		}
+
+	// Wait for all agents to do their testing before checking the semaphore
+	User::After(12000000);
+
+	LOG_MSG( ">Target Launcher:  Semaphore wait");
+
+	for (TInt i = 0; i < numAgents; i ++)
+		{
+		//We need this delay just in case an agent crashes and never signals the sem
+		ret = launchSemaphore.Wait(100000);
+		if( ret != KErrNone )
+			{
+			LOG_MSG3("launchSemaphore.Wait ret %d for agent %d", ret, i);
+			break;
+			}
+		}
+
+	LOG_MSG2( "testing for Semaphore ret %d", ret);
+
+	// We only want to have one RTest instance at any one time since otherwise RTest can panic
+	RTest test(_L("T_MULTI_AGENT_LAUNCHER"));
+	test.Start(_L("t_multi_agent_launcher Check for agents finishing correctly"));
+	test(ret == KErrNone);
+	test.End();
+	test.Close();
+
+	CleanupStack::PopAndDestroy(&launchSemaphore); // launchSemaphore
+
+	if( commandLine )
+	CleanupStack::PopAndDestroy(commandLine);
+	
+	LOG_MSG("EXIT: t_multi_agent_launcher MainL()");
+	}
+ 
+GLDEF_C TInt E32Main()
+	{
+	LOG_MSG("ENTER: Multi_agent_launcher E32Main()");
+	__UHEAP_MARK;
+
+	CTrapCleanup* trap = CTrapCleanup::New();
+	if (!trap)
+		return KErrNoMemory;
+
+	TRAPD(err, MainL());
+	LOG_MSG2("Multi_agent_launcher: returning from MainL(), err = %d", err);
+	
+	delete trap;
+	LOG_MSG("EXIT: Multi_agent_launcher E32Main()");
+	__UHEAP_MARKEND;
+
+	return err;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/multi_agent_tests/t_multi_agent_launcher.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,45 @@
+// 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:
+// Definitions for agent launcher
+// 
+//
+
+/**
+ @file
+ @internalTechnology
+ @released
+*/
+
+#ifndef RMDEBUG_MULTI_AGENT_LAUNCHER_H
+#define RMDEBUG_MULTI_AGENT_LAUNCHER_H
+
+#include <e32test.h>
+
+// Default test runs
+const TInt KNumTestRuns = 1; 
+
+// Default number of targets per agent
+const TInt KNumTargets = 5;
+
+// Default number of agents, if changing this make sure there are enough apps being built 
+const TInt KNumAgents = 2; 
+
+_LIT(KAgentExe,"z:\\sys\\bin\\t_rmdebug_multi_agent.exe");
+_LIT(KAgentOptions,"-n%d -o%d -a%d");
+
+_LIT(KLaunchSemaphoreName, "t_rmdebug_launch_semaphore");
+_LIT(KLaunchSemaphoreSearchString, "t_rmdebug_launch_semaphore*");
+
+#endif // RMDEBUG_MULTI_AGENT_LAUNCHER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/multi_target_tests/t_multi_target.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,405 @@
+// 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:
+// Test the ability of the debug system to handle events from several debug targets
+//
+//
+
+#include <e32base.h>
+#include <e32property.h>
+
+#include <hal.h>
+#include <e32test.h>
+
+#include "t_multi_target.h"
+#include "t_target_launcher.h"
+#include "t_rmdebug_app.h"
+
+#ifdef KERNEL_OOM_TESTING
+  #ifdef USER_OOM_TESTING
+    #error "Cannot define both KERNEL_OOM_TESTING and USER_OOM_TESTING"
+  #endif
+#endif
+
+
+using namespace Debug;
+
+const TVersion securityServerVersion(0,1,1);
+
+const TVersion testVersion(2,1,0);
+
+#ifdef SYMBIAN_STANDARDDEBUG
+LOCAL_D RTest test(_L("T_RMDEBUG_MULTI_TARGET"));
+#endif
+
+#ifdef SYMBIAN_OEMDEBUG
+LOCAL_D RTest test(_L("T_RMDEBUG_MULTI_TARGET_OEM"));
+#endif
+
+#ifdef SYMBIAN_OEM2DEBUG
+LOCAL_D RTest test(_L("T_RMDEBUG_MULTI_TARGET_OEM2"));
+#endif
+
+
+
+CMultiTargetAgent* CMultiTargetAgent::NewL()
+//
+// CMultiTargetAgent::NewL
+//
+  {
+  CMultiTargetAgent* self = new(ELeave) CMultiTargetAgent();
+
+  self->ConstructL();
+
+  return self;
+  }
+
+
+CMultiTargetAgent::~CMultiTargetAgent()
+//
+// CMultiTargetAgent destructor
+//
+    {
+    RDebug::Printf("~CMultiTargetAgent\n");
+    iServSession.Close();
+    }
+
+
+CMultiTargetAgent::CMultiTargetAgent() : 
+    iEventPtr( (TUint8*)&iEventInfo, sizeof(TEventInfo) )
+    {
+    }
+
+
+void CMultiTargetAgent::ConstructL()
+//
+// CMultiTargetAgent::ConstructL
+//
+  {
+  }
+
+/**
+ * Helper code for the stepping tests. Returns the number of nanokernel ticks in one second.
+ *
+ * @return Number of nanokernel ticks. 0 if unsuccesful.
+ */
+TInt CMultiTargetAgent::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;
+  }
+
+void CMultiTargetAgent::ClientAppL()
+//
+// Performs each test in turn
+//
+  {
+  test.Start(_L("ClientAppL"));
+  TInt err = iServSession.Connect(securityServerVersion);
+  if (err != KErrNone)
+      {
+      User::Panic(_L("Can't open server session"), err);
+      }
+  SetupDebugServerL();
+  LaunchTargetsInOrderL();
+  RDebug::Printf( "returning from CMultiTargetAgent::ClientAppL" );
+  test.End();
+  }
+
+/**
+  Launch a process
+
+  @param aProcess The RProcess object to use to create the process
+  @param aExeName File name of the executable to create the process from
+  @param aCommandLine The command line to pass to the new process
+  @return KErrNone on success, or one of the other system wide error codes
+  */
+TInt CMultiTargetAgent::LaunchProcess(RProcess& aProcess, TDesC & aExeName, TDesC & aCommandLine )
+    {    
+    TInt err = aProcess.Create( aExeName, aCommandLine );    
+    if(err != KErrNone)
+        {
+        RDebug::Printf( "aProcess.Create ret %d", err);
+        return err;
+        }
+
+    TRequestStatus status = KRequestPending;
+    aProcess.Rendezvous(status);
+    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();
+        // Give the process a chance to run
+        User::After( 500000 );
+        return KErrNone;
+        }
+    }
+
+void CMultiTargetAgent::SetupDebugServerL()
+    {
+    RDebug::Printf( "CMultiTargetAgent::SetupDebugServerL" );
+    test.Next(_L("SetupDebugServerL\n"));
+    iTargets.ReserveL( KNumApps );
+
+    RBuf targetName;
+    CleanupClosePushL( targetName );
+
+    for( TInt numApps = 0; numApps < KNumApps; numApps++ )
+        {
+        iTargets.AppendL( targetName );
+        RDebug::Printf( "Attach to DSS for app %d ", numApps );
+
+        iTargets[numApps].CreateL( KTargetExe().Length() + 2 );
+        iTargets[numApps].Format( KTargetExe(), numApps+1 );
+
+        TInt ret = iServSession.AttachExecutable( iTargets[numApps], EFalse );
+        test( ret == KErrNone );
+
+        RDebug::Printf( ">SetEventAction app %d,  EEventsStartThread EActionSuspend", numApps );
+        ret = iServSession.SetEventAction( iTargets[numApps], EEventsStartThread, EActionSuspend );
+        test( ret == KErrNone );
+
+        RDebug::Printf( ">SetEventAction app %d,  EEventsAddProcess EActionContinue", numApps );
+        ret = iServSession.SetEventAction( iTargets[numApps], EEventsAddProcess, EActionContinue );
+        test( ret == KErrNone );
+
+        RDebug::Printf( ">SetEventAction app %d,  EEventsRemoveProcess EActionContinue", numApps );
+        ret = iServSession.SetEventAction( iTargets[numApps], EEventsRemoveProcess, EActionContinue );
+        test( ret == KErrNone );
+        }
+
+    CleanupStack::PopAndDestroy( &targetName ); // targetName
+
+    }
+
+
+
+TInt CMultiTargetAgent::LaunchTargetsInOrderL()
+    {
+    RDebug::Printf( "CMultiTargetAgent::LaunchTargetsInOrderL" );
+    
+    RBuf launcher;
+    CleanupClosePushL( launcher );
+    launcher.CreateL( KLauncherExe() );
+    
+    RBuf launcherOptions;
+    CleanupClosePushL( launcherOptions ); 
+    launcherOptions.CreateL( KTargetOptions().Length() + 2 );
+    launcherOptions.Format( KTargetOptions(), (TUint)ENormalExit );
+
+    RDebug::Printf( ">LaunchProcess()" );
+    RProcess launcherProc; 
+    CleanupClosePushL( launcherProc );
+    
+    TInt ret = LaunchProcess( launcherProc, launcher, launcherOptions );
+    RDebug::Printf( "<LaunchProcess() ret %d", ret );
+    
+    CleanupStack::PopAndDestroy( &launcherProc ); // launcherProc
+    CleanupStack::PopAndDestroy( &launcherOptions ); // launcherOptions
+    CleanupStack::PopAndDestroy( &launcher ); //launcher 
+
+    test( ret == KErrNone );
+    
+    RSemaphore launchSemaphore;   
+    CleanupClosePushL( launchSemaphore );
+            
+    TFindSemaphore launchSemFinder( KLaunchMutexNameSearchString );
+    TFullName mutexResult;
+    ret = launchSemFinder.Next(mutexResult);
+    RDebug::Printf( ">  Find Launch Semaphote.Next ret=%d, %lS", ret, &mutexResult );
+    test( ret == KErrNone );   
+     
+    ret = launchSemaphore.OpenGlobal( mutexResult );
+    RDebug::Printf( "> OpenGlobal mutex ret=%d", ret );         
+    test( ret == KErrNone );    
+    
+    TBool thisLaunchCompleted; 
+
+    test.Next(_L("LaunchTargetsInOrderL\n"));
+    for( TInt numLaunches = KNumLaunches; numLaunches > 0; numLaunches-- )
+        {
+        for( TInt numApps = KNumApps; numApps > 0; numApps-- )
+            {
+            thisLaunchCompleted = EFalse;
+            // This will trigger the launcher app to launch the next target
+            RDebug::Printf( " >Mutex.Signal app=%d, launch=%d", numApps, numLaunches);
+            launchSemaphore.Signal();
+            
+            RBuf8 tgt8Name; 
+            CleanupClosePushL( tgt8Name );
+           
+            RBuf tgtCollapseName;
+            CleanupClosePushL( tgtCollapseName );
+                    
+            tgtCollapseName.CreateL( iTargets[numApps-1] );
+            tgt8Name.CreateL( tgtCollapseName.Collapse() );
+            
+
+            while( ! thisLaunchCompleted )
+                {
+                RDebug::Printf( ">GetEvent app %d for %S", numApps, &tgt8Name );
+                iServSession.GetEvent( iTargets[numApps-1], iStatus, iEventPtr );
+          
+                // Wait for the target to get started.
+                RDebug::Printf( " >Wait for event from target app=%d, launch=%d\n", numApps, numLaunches);
+                User::WaitForRequest( iStatus );
+                RDebug::Printf( " <Wait for request returned with status %d", iStatus.Int() );
+                test( iStatus==KErrNone );
+    
+                RDebug::Printf( " > Got iEventType =%d, app=%d", iEventInfo.iEventType, numApps );
+                switch( iEventInfo.iEventType )
+                    {
+                    case EEventsAddProcess:
+                        {
+                        RDebug::Printf( "Got EEventsAddProcess" );                        
+                        TPtrC8 exeNamePtr8( iEventInfo.iAddProcessInfo.iFileName, iEventInfo.iAddProcessInfo.iFileNameLength );
+                        
+                        RBuf8 exeName8;
+                        CleanupClosePushL( exeName8 );
+                        exeName8.CreateL( exeNamePtr8 );
+                        RDebug::Printf( " from event: exeName8=%S", &exeName8 );
+                        CleanupStack::PopAndDestroy( &exeName8 );
+                        
+                        RBuf8 compareName8;
+                        CleanupClosePushL( compareName8 );
+                        compareName8.CreateL( KTargetExeName().Length() + 10 );
+                        compareName8.Format( KTargetExeName(), numApps );
+                        RDebug::Printf( " comparing to: compareName8=%S", &compareName8 );
+                        
+                        test( compareName8.CompareC( exeNamePtr8 ) == 0 );
+                        CleanupStack::PopAndDestroy( &compareName8 );
+
+                        RDebug::Printf( "Testing if event process id is valid" );
+                        test( iEventInfo.iProcessIdValid );
+                        RDebug::Printf( "Got iEventInfo.iProcessId=%d", I64LOW( iEventInfo.iProcessId ) );
+                        
+                        RProcess targetProc;
+                        ret = targetProc.Open( TProcessId( iEventInfo.iProcessId ) );
+                        RDebug::Printf( "RProcess open ret=%d",ret );
+                        targetProc.Close();
+                        test( ret == KErrNone );
+                        
+                        break;
+                        }//EEventsAddProcess
+                        
+                    case EEventsStartThread:
+                        {
+                        RDebug::Printf( "Got EEventsStartThread" );
+                         
+                        TPtrC8 exeNamePtr8( iEventInfo.iStartThreadInfo.iFileName, iEventInfo.iStartThreadInfo.iFileNameLength );
+                        RBuf8 exe8Name;
+                        CleanupClosePushL( exe8Name );
+                        exe8Name.CreateL( exeNamePtr8 );
+                        RDebug::Printf( " from event: exeName8=%S", &exe8Name );
+                        CleanupStack::PopAndDestroy( &exe8Name );
+                        
+                        test( tgt8Name.CompareC( exeNamePtr8 ) == 0 );
+                        
+                        RDebug::Printf( "Testing if event process id is valid" );
+                        test( iEventInfo.iProcessIdValid );
+                        RDebug::Printf( "Got iEventInfo.iProcessId=%d", I64LOW( iEventInfo.iProcessId ) );
+                         
+                        RDebug::Printf( "Testing if event thread id is valid" );
+                        test( iEventInfo.iThreadIdValid );
+                        RDebug::Printf( "Got iEventInfo.iThreadId=%d", I64LOW( iEventInfo.iThreadId ) );
+                        
+                        RThread targetThread;
+                        CleanupClosePushL( targetThread );
+                        
+                        ret = targetThread.Open( TThreadId( iEventInfo.iThreadId ) );
+                        RDebug::Printf( "RThread open ret=%d", ret );
+                        test( ret == KErrNone ); 
+                         
+                        test( iEventInfo.iThreadId == targetThread.Id() );  
+
+                        RDebug::Printf( "Resuming thread for app=%d, id=%d", numApps, I64LOW( targetThread.Id() ));
+                        ret = iServSession.ResumeThread( iEventInfo.iThreadId );
+                        CleanupStack::PopAndDestroy( &targetThread );
+                        
+                        test( ret == KErrNone );
+                        
+                        ret = iServSession.ResumeThread( iEventInfo.iThreadId );
+                        break;                    
+                        }//case EEventsStartThread                        
+
+                    case ( EEventsRemoveProcess ):
+                        {
+                        RDebug::Printf( "*** Got EEventsRemoveProcess. app%d has exited. Moving on to next app", numApps );                        
+                        thisLaunchCompleted = ETrue;
+                        break;
+                        }
+                        
+                    default :   
+                        RDebug::Printf( "Got unknown event" );
+                        test( EFalse );
+                        break;
+                    }
+                }//while
+
+            CleanupStack::PopAndDestroy( &tgtCollapseName ); // tgtCollapseName
+            CleanupStack::PopAndDestroy( &tgt8Name ); // tgt8Name 
+            }
+        }    
+
+    launchSemaphore.Signal();
+    
+	CleanupStack::PopAndDestroy( &launchSemaphore ); // launchSemaphore
+  
+	for( TInt i = iTargets.Count()-1; i>=0; i-- )
+		{
+		RDebug::Printf( "Closing target %d", i );
+		iTargets[ i ].Close();
+		}
+
+	iTargets.Close();
+	
+	return KErrNone;
+    }
+
+
+GLDEF_C TInt E32Main()
+    {
+    TInt ret = KErrNone;
+   
+  
+    CTrapCleanup* trap = CTrapCleanup::New();
+    if (!trap)
+      return KErrNoMemory;
+    test.Title();
+   
+    CMultiTargetAgent *runModeAgent = CMultiTargetAgent::NewL();
+    if (runModeAgent != NULL)
+        {
+        __UHEAP_MARK;
+        TRAP(ret,runModeAgent->ClientAppL());
+        __UHEAP_MARKEND;
+        
+        RDebug::Printf( "ClientAppL returned %d", ret );
+        delete runModeAgent;
+        }
+
+    delete trap;
+    return ret;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/multi_target_tests/t_multi_target.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,93 @@
+// 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_MULTI_TARGET_H
+#define RMDEBUG_MULTI_TARGET_H
+
+#include "t_rmdebug_app.h"
+
+#include <rm_debug_api.h>
+
+class CMultiTargetAgent;
+
+//
+// class CRunModeAgent
+//
+// The basic run mode agent.
+//
+class CMultiTargetAgent : public CBase
+	{
+public:
+	static CMultiTargetAgent* NewL();
+	~CMultiTargetAgent();
+	void ClientAppL();
+	
+    TInt LaunchProcess(RProcess& aProcess, TDesC & aExeName, TDesC & aCommandLine );
+    
+private:
+	CMultiTargetAgent();
+	void ConstructL();
+
+	void ReportPerformance(void);
+
+	TInt HelpTicksPerSecond(void);
+
+	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
+		};
+	
+	TInt LaunchTargetsInOrderL();
+	void SetupDebugServerL();
+
+private:
+
+#if defined(KERNEL_OOM_TESTING)
+	RKernelLowMemorySecuritySvrSession iServSession;
+#elif defined (USER_OOM_TESTING)
+	RUserLowMemorySecuritySvrSession iServSession;
+#else
+	Debug::RSecuritySvrSession iServSession;
+#endif
+	RSemaphore iAddressGlobSem;
+
+	TUid iMySid;
+
+	// Timing information
+	TInt iStartTick;
+	TInt iStopTick;
+
+	RArray<RBuf> iTargets;
+  TRequestStatus iStatus;
+  Debug::TEventInfo iEventInfo;
+  TPtr8 iEventPtr;
+	};
+
+#endif // RMDEBUG_MULTI_TARGET_H
--- a/kerneltest/e32test/secure/t_platsecconfig.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/secure/t_platsecconfig.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -473,8 +473,9 @@
 	TRequestStatus timerStat;
 	timer.After(timerStat,20*1000000);
 	User::WaitForRequest(timerStat,keyStat);
+	TInt key = 0;
 	if(keyStat!=KRequestPending)
-		(void)test.Console()->KeyCode();
+		key = test.Console()->KeyCode();
 	timer.Cancel();
 	test.Console()->ReadCancel();
 	User::WaitForAnyRequest();
--- a/kerneltest/e32test/secure/t_sdrivers.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/secure/t_sdrivers.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -367,7 +367,7 @@
 
 	// get another thread to try and call device GetCaps with descriptor in kernel memory...
 	test.Next(_L("Check GetCaps with bad descriptor 2"));
-	r = thread.Create(_L("TestGetCapsThread2"),TestGetCapsThread,KDefaultStackSize,0x2000,0x2000,(TAny*)kernelPtr);
+	r = thread.Create(_L("TestGetCapsThread"),TestGetCapsThread,KDefaultStackSize,0x2000,0x2000,(TAny*)kernelPtr);
 	test_KErrNone(r);
 	thread.Logon(ls);
 	thread.Rendezvous(rs);
@@ -472,9 +472,9 @@
 	TRequestStatus timerStat;
 	timer.After(timerStat,20*1000000);
 	User::WaitForRequest(timerStat,keyStat);
+	TInt key = 0;
 	if(keyStat!=KRequestPending)
-		(void)test.Console()->KeyCode();
-
+		key = test.Console()->KeyCode();
 	timer.Cancel();
 	test.Console()->ReadCancel();
 	User::WaitForAnyRequest();
--- a/kerneltest/e32test/secure/t_shal.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/secure/t_shal.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -258,8 +258,9 @@
 	TRequestStatus timerStat;
 	timer.After(timerStat,20*1000000);
 	User::WaitForRequest(timerStat,keyStat);
+	TInt key = 0;
 	if(keyStat!=KRequestPending)
-		(void)test.Console()->KeyCode();
+		key = test.Console()->KeyCode();
 	timer.Cancel();
 	test.Console()->ReadCancel();
 	User::WaitForAnyRequest();
--- a/kerneltest/e32test/secure/t_sobject.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/secure/t_sobject.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -55,7 +55,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <e32test.h>
 #include <e32msgqueue.h>
 #include <f32file.h>
@@ -239,6 +238,11 @@
 	{
 	}
 
+const TInt KTestDataMaxLength8 = 20;
+const TInt KTestDataMaxLength16 = 40;
+_LIT8(KTestData8,"12345678");
+_LIT16(KTestData16,"1234567890123456");
+_LIT(KTestPanicCategory,"TEST PANIC");
 
 void CTestSession::ServiceL(const RMessage2& aMessage)
 	{
@@ -284,6 +288,7 @@
 			object.Close();
 			return;
 			}
+			break;
 
 		case CTestSession::ETestSemaphore:
 			{
@@ -313,6 +318,7 @@
 			object.Close();
 			return;
 			}
+			break;
 
 		case CTestSession::ETestMsgQueue:
 			{
@@ -342,7 +348,7 @@
 			object.Close();
 			return;
 			}
-
+			break;
 
 		case CTestSession::ETestCondVar:
 			{
@@ -372,7 +378,7 @@
 			object.Close();
 			return;
 			}
-
+			break;
 
 		case CTestSession::ETestChunk:
 			{
@@ -402,7 +408,7 @@
 			object.Close();
 			return;
 			}
-
+			break;
 
 		case CTestSession::ETestChunkAdjust:
 			{
@@ -618,13 +624,15 @@
 void TestPhysicalDevices()
 	{
 	TFullName name;
+	TInt r;
+
 	test.Start(_L("Test find named object"));
 	TFindPhysicalDevice find(_L("*"));
-	test((find.Next(name))==KErrNone);
+	test((r=find.Next(name))==KErrNone);
 
 	test.Next(_L("Try open found object"));
 	RTestHandle testObject;
-	test((testObject.Open(find))==PlatSecProcessIsolationError);
+	test((r=testObject.Open(find))==PlatSecProcessIsolationError);
 	testObject.Close();
 
 	test.End();
@@ -634,26 +642,27 @@
 
 void TestLogicalDevices()
 	{
-	TFullName name;	
+	TFullName name;
+	TInt r;
 	RDevice device;
 
 	test.Start(_L("Test find named object"));
 	TFindLogicalDevice find(_L("*"));
-	test((find.Next(name))==KErrNone);
+	test((r=find.Next(name))==KErrNone);
 
 	test.Next(_L("Test open found object"));
-	test((device.Open(find))==KErrNone);
+	test((r=device.Open(find))==KErrNone);
 
 	test.Next(_L("Test duplicate object in other thread"));
-	test((DuplicateInOtherThread(device))==KErrNone);
+	test((r=DuplicateInOtherThread(device))==KErrNone);
 
 	test.Next(_L("Test duplicate object in other process"));
-	test((DuplicateInOtherProcess(device))==KErrNone);
+	test((r=DuplicateInOtherProcess(device))==KErrNone);
 
 	device.Close();
 
 	test.Next(_L("Test open device by name"));
-	test((device.Open(name))==KErrNone);
+	test((r=device.Open(name))==KErrNone);
 	device.Close();
 
 	test.End();
@@ -664,13 +673,15 @@
 void TestLibraries()
 	{
 	TFullName name;
+	TInt r;
+
 	test.Start(_L("Test find named object"));
 	TFindLibrary find(_L("*"));
-	test((find.Next(name))==KErrNone);
+	test((r=find.Next(name))==KErrNone);
 
 	test.Next(_L("Try open found object"));
 	RTestHandle testObject;
-	test((testObject.Open(find))==PlatSecProcessIsolationError);
+	test((r=testObject.Open(find))==PlatSecProcessIsolationError);
 	testObject.Close();
 
 	test.End();
@@ -681,27 +692,28 @@
 void TestServers()
 	{
 	TFullName name;
+	TInt r;
 	RServer2 localObject(Servers[EAnonymousServer]);
 
 	test.Start(_L("Test find named object"));
 	TFindServer find(ServerName(EMainServer));
-	test((find.Next(name))==KErrNone);
+	test((r=find.Next(name))==KErrNone);
 
 	test.Next(_L("Try open found object"));
 	RTestHandle testObject;
-	test((testObject.Open(find))==KErrPermissionDenied);
+	test((r=testObject.Open(find))==KErrPermissionDenied);
 
 	test.Next(_L("Test duplicate named server in other thread"));
-	test((Session.Send(CTestSession::ETestServerDuplicateInThread))==KErrNone);
+	test((r=Session.Send(CTestSession::ETestServerDuplicateInThread))==KErrNone);
 
 	test.Next(_L("Try duplicate named server in other process"));
-	test((Session.Send(CTestSession::ETestServerDuplicateInProcess))==KErrPermissionDenied);
+	test((r=Session.Send(CTestSession::ETestServerDuplicateInProcess))==KErrPermissionDenied);
 
 	test.Next(_L("Test duplicate unnamed server in other thread"));
-	test((DuplicateInOtherThread(localObject))==KErrNone);
+	test((r=DuplicateInOtherThread(localObject))==KErrNone);
 
 	test.Next(_L("Try duplicate unnamed server in other process"));
-	test((DuplicateInOtherProcess(localObject))==KErrPermissionDenied);
+	test((r=DuplicateInOtherProcess(localObject))==KErrPermissionDenied);
 
 	test.End();
 	}
@@ -710,31 +722,32 @@
 
 void TestProcesses()
 	{
-	TFullName name;	
+	TFullName name;
+	TInt r;
 	RProcess process;
 
 	test.Start(_L("Test find named object"));
 	TFindProcess find(_L("EKern*"));
-	test((find.Next(name))==KErrNone);
+	test((r=find.Next(name))==KErrNone);
 
 	test.Next(_L("Test open found object"));
-	test((process.Open(find))==KErrNone);
+	test((r=process.Open(find))==KErrNone);
 
 	test.Next(_L("Test duplicate object in other thread"));
-	test((DuplicateInOtherThread(process))==KErrNone);
+	test((r=DuplicateInOtherThread(process))==KErrNone);
 
 	test.Next(_L("Test duplicate object in other process"));
-	test((DuplicateInOtherProcess(process))==KErrNone);
+	test((r=DuplicateInOtherProcess(process))==KErrNone);
 
 	process.Close();
 
 	test.Next(_L("Test open process by name"));
-	test((process.Open(name))==KErrNone);
+	test((r=process.Open(name))==KErrNone);
 	TProcessId id=process.Id();
 	process.Close();
 
 	test.Next(_L("Test open process by id"));
-	test((process.Open(id))==KErrNone);
+	test((r=process.Open(id))==KErrNone);
 	test(name==process.FullName());
 	process.Close();
 
@@ -746,63 +759,64 @@
 void TestThreads()
 	{
 	TFullName name;
-	
+	TInt r;
+
 	test.Start(_L("Creating threads"));
 	RThread globalObject;
 	RThread localObject;
 	RThread testObject;
-	test((globalObject.Create(_L("T_SOBJECT-test-global-thread"),TestThreadDuplicate,KDefaultStackSize,KDefaultStackSize,KDefaultStackSize,NULL))==KErrNone);
-	test((localObject.Create(_L(""),TestThreadDuplicate,KDefaultStackSize,KDefaultStackSize,KDefaultStackSize,NULL))==KErrNone);
+	test((r=globalObject.Create(_L("T_SOBJECT-test-global-thread"),TestThreadDuplicate,KDefaultStackSize,KDefaultStackSize,KDefaultStackSize,NULL))==KErrNone);
+	test((r=localObject.Create(_L(""),TestThreadDuplicate,KDefaultStackSize,KDefaultStackSize,KDefaultStackSize,NULL))==KErrNone);
 
 	test.Next(_L("Test find named thread"));
 	TFindThread find(globalObject.FullName());
-	test((find.Next(name))==KErrNone);
+	test((r=find.Next(name))==KErrNone);
 
 	test.Next(_L("Test open found object"));
-	test((testObject.Open(find))==KErrNone);
+	test((r=testObject.Open(find))==KErrNone);
 	testObject.Close();
 
 	test.Next(_L("Check can't find unnamed thread"));
 	TName objectName(localObject.FullName());
 	find.Find(objectName);
-	test((find.Next(name))==PlatSecFindError);
+	test((r=find.Next(name))==PlatSecFindError);
 
 	test.Next(_L("Test open named thread by name"));
-	test((testObject.Open(globalObject.FullName()))==KErrNone);
+	test((r=testObject.Open(globalObject.FullName()))==KErrNone);
 	testObject.Close();
 
 	test.Next(_L("Check can't open unnamed thread by name"));
-	test((testObject.Open(localObject.FullName()))==PlatSecFindError);
+	test((r=testObject.Open(localObject.FullName()))==PlatSecFindError);
 	testObject.Close();
 
 	test.Next(_L("Check can't open with no name"));
-	test((testObject.Open(KNullDesC))==KErrNotFound);
+	test((r=testObject.Open(KNullDesC))==KErrNotFound);
 	testObject.Close();
 
 	test.Next(_L("Test open named thread by id (in same process)"));
-	test((testObject.Open(globalObject.Id()))==KErrNone);
+	test((r=testObject.Open(globalObject.Id()))==KErrNone);
 	testObject.Close();
 
 	test.Next(_L("Test open named thread by id (in other process)"));
-	test((OpenThreadByIdInOtherProcess(globalObject.Id()))==KErrNone);
+	test((r=OpenThreadByIdInOtherProcess(globalObject.Id()))==KErrNone);
 
 	test.Next(_L("Test open unnamed thread by id (in same process)"));
-	test((testObject.Open(localObject.Id()))==KErrNone);
+	test((r=testObject.Open(localObject.Id()))==KErrNone);
 
 	test.Next(_L("Check can't open unnamed thread by id (in other process)"));
-	test((OpenThreadByIdInOtherProcess(localObject.Id()))==PlatSecProcessIsolationError);
+	test((r=OpenThreadByIdInOtherProcess(localObject.Id()))==PlatSecProcessIsolationError);
 
 	test.Next(_L("Test duplicate named thread in other process"));
-	test((DuplicateInOtherProcess(globalObject))==KErrNone);
+	test((r=DuplicateInOtherProcess(globalObject))==KErrNone);
 
 	test.Next(_L("Check can't duplicate unnamed thread in other process"));
-	test((DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
+	test((r=DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
 
 	test.Next(_L("Test duplicate named thread in other thread"));
-	test((DuplicateInOtherThread(globalObject))==KErrNone);
+	test((r=DuplicateInOtherThread(globalObject))==KErrNone);
 
 	test.Next(_L("Test duplicate unnamed thread in other thead"));
-	test((DuplicateInOtherThread(localObject))==KErrNone);
+	test((r=DuplicateInOtherThread(localObject))==KErrNone);
 
 	test.Next(_L("Closing threads"));
 	globalObject.Close();
@@ -816,58 +830,59 @@
 void TestChunks()
 	{
 	TFullName name;
-	
+	TInt r;
+
 	test.Start(_L("Creating chunks"));
 	RChunk globalObject;
 	RChunk localObject;
 	RChunk testObject;
-	test((globalObject.CreateGlobal(_L("T_SOBJECT-test-global-chunk"),4096,1024*1024))==KErrNone);
-	test((localObject.CreateLocal(4096,1024*1024))==KErrNone);
+	test((r=globalObject.CreateGlobal(_L("T_SOBJECT-test-global-chunk"),4096,1024*1024))==KErrNone);
+	test((r=localObject.CreateLocal(4096,1024*1024))==KErrNone);
 
 	test.Next(_L("Test find global object"));
 	TFindChunk find(globalObject.FullName());
-	test((find.Next(name))==KErrNone);
+	test((r=find.Next(name))==KErrNone);
 
 	test.Next(_L("Test open found object"));
-	test((testObject.Open(find))==KErrNone);
+	test((r=testObject.Open(find))==KErrNone);
 	testObject.Close();
 
 	test.Next(_L("Check can't find local object"));
 	TName objectName(localObject.FullName());
 	find.Find(objectName);
-	test((find.Next(name))==PlatSecFindError);
+	test((r=find.Next(name))==PlatSecFindError);
 
 	test.Next(_L("Test open with null name"));
-	test((testObject.OpenGlobal(KNullDesC,ETrue))==KErrNotFound);
+	test((r=testObject.OpenGlobal(KNullDesC,ETrue))==KErrNotFound);
 	testObject.Close();
 
 	test.Next(_L("Test open global object by name"));
-	test((testObject.OpenGlobal(globalObject.FullName(),ETrue))==KErrNone);
+	test((r=testObject.OpenGlobal(globalObject.FullName(),ETrue))==KErrNone);
 	testObject.Close();
 
 	test.Next(_L("Check can't open local object by name"));
-	test((testObject.OpenGlobal(localObject.FullName(),ETrue))==PlatSecFindError);
+	test((r=testObject.OpenGlobal(localObject.FullName(),ETrue))==PlatSecFindError);
 	testObject.Close();
 
 	test.Next(_L("Test duplicate global object in other process"));
-	test((DuplicateInOtherProcess(globalObject))==KErrNone);
+	test((r=DuplicateInOtherProcess(globalObject))==KErrNone);
 
 	test.Next(_L("Check can't duplicate local object in other process"));
-	test((DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
+	test((r=DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
 
 	test.Next(_L("Test duplicate global object in other thread"));
-	test((DuplicateInOtherThread(globalObject))==KErrNone);
+	test((r=DuplicateInOtherThread(globalObject))==KErrNone);
 
 	test.Next(_L("Test duplicate local object in other thead"));
-	test((DuplicateInOtherThread(localObject))==KErrNone);
+	test((r=DuplicateInOtherThread(localObject))==KErrNone);
 
 	test.Next(_L("Test Chunk protection"));
 	{
 	RChunk protectedChunk;
-	test((protectedChunk.CreateGlobal(KNullDesC,0x1000,0x100000,EOwnerProcess))==KErrNone);
-	test((Session.Send(CTestSession::ETestChunkAdjust,TIpcArgs(protectedChunk)))==KErrNone);
+	test((r=protectedChunk.CreateGlobal(KNullDesC,0x1000,0x100000,EOwnerProcess))==KErrNone);
+	test((r=Session.Send(CTestSession::ETestChunkAdjust,TIpcArgs(protectedChunk)))==KErrNone);
 	protectedChunk.SetRestrictions(RChunk::EPreventAdjust);
-	test((Session.Send(CTestSession::ETestChunkAdjust,TIpcArgs(protectedChunk)))==KErrAccessDenied);
+	test((r=Session.Send(CTestSession::ETestChunkAdjust,TIpcArgs(protectedChunk)))==KErrAccessDenied);
 	protectedChunk.Close();
 	}
 
@@ -883,50 +898,51 @@
 void TestSemaphores()
 	{
 	TFullName name;
-	
+	TInt r;
+
 	test.Start(_L("Creating semaphores"));
 	RSemaphore globalObject;
 	RSemaphore localObject;
 	RSemaphore testObject;
-	test((globalObject.CreateGlobal(_L("T_SOBJECT-test-global-semaphore"),1))==KErrNone);
-	test((localObject.CreateLocal(1))==KErrNone);
+	test((r=globalObject.CreateGlobal(_L("T_SOBJECT-test-global-semaphore"),1))==KErrNone);
+	test((r=localObject.CreateLocal(1))==KErrNone);
 
 	test.Next(_L("Test find global object"));
 	TFindSemaphore find(globalObject.FullName());
-	test((find.Next(name))==KErrNone);
+	test((r=find.Next(name))==KErrNone);
 
 	test.Next(_L("Test open found object"));
-	test((testObject.Open(find))==KErrNone);
+	test((r=testObject.Open(find))==KErrNone);
 	testObject.Close();
 
 	test.Next(_L("Check can't find local object"));
 	TName objectName(localObject.FullName());
 	find.Find(objectName);
-	test((find.Next(name))==PlatSecFindError);
+	test((r=find.Next(name))==PlatSecFindError);
 
 	test.Next(_L("Test open with null name"));
-	test((testObject.OpenGlobal(KNullDesC))==KErrNotFound);
+	test((r=testObject.OpenGlobal(KNullDesC))==KErrNotFound);
 	testObject.Close();
 
 	test.Next(_L("Test open global object by name"));
-	test((testObject.OpenGlobal(globalObject.FullName()))==KErrNone);
+	test((r=testObject.OpenGlobal(globalObject.FullName()))==KErrNone);
 	testObject.Close();
 
 	test.Next(_L("Check can't open local object by name"));
-	test((testObject.OpenGlobal(localObject.FullName()))==PlatSecFindError);
+	test((r=testObject.OpenGlobal(localObject.FullName()))==PlatSecFindError);
 	testObject.Close();
 
 	test.Next(_L("Test duplicate global object in other process"));
-	test((DuplicateInOtherProcess(globalObject))==KErrNone);
+	test((r=DuplicateInOtherProcess(globalObject))==KErrNone);
 
 	test.Next(_L("Check can't duplicate local object in other process"));
-	test((DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
+	test((r=DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
 
 	test.Next(_L("Test duplicate global object in other thread"));
-	test((DuplicateInOtherThread(globalObject))==KErrNone);
+	test((r=DuplicateInOtherThread(globalObject))==KErrNone);
 
 	test.Next(_L("Test duplicate local object in other thead"));
-	test((DuplicateInOtherThread(localObject))==KErrNone);
+	test((r=DuplicateInOtherThread(localObject))==KErrNone);
 
 	test.Next(_L("Closing Semaphores"));
 	globalObject.Close();
@@ -940,50 +956,51 @@
 void TestMutexes()
 	{
 	TFullName name;
-	
+	TInt r;
+
 	test.Start(_L("Creating mutexes"));
 	RMutex globalObject;
 	RMutex localObject;
 	RMutex testObject;
-	test((globalObject.CreateGlobal(_L("T_SOBJECT-test-global-mutex")))==KErrNone);
-	test((localObject.CreateLocal())==KErrNone);
+	test((r=globalObject.CreateGlobal(_L("T_SOBJECT-test-global-mutex")))==KErrNone);
+	test((r=localObject.CreateLocal())==KErrNone);
 
 	test.Next(_L("Test find global object"));
 	TFindMutex find(globalObject.FullName());
-	test((find.Next(name))==KErrNone);
+	test((r=find.Next(name))==KErrNone);
 
 	test.Next(_L("Test open found object"));
-	test((testObject.Open(find))==KErrNone);
+	test((r=testObject.Open(find))==KErrNone);
 	testObject.Close();
 
 	test.Next(_L("Check can't find local object"));
 	TName objectName(localObject.FullName());
 	find.Find(objectName);
-	test((find.Next(name))==PlatSecFindError);
+	test((r=find.Next(name))==PlatSecFindError);
 
 	test.Next(_L("Test open with null name"));
-	test((testObject.OpenGlobal(KNullDesC))==KErrNotFound);
+	test((r=testObject.OpenGlobal(KNullDesC))==KErrNotFound);
 	testObject.Close();
 
 	test.Next(_L("Test open global object by name"));
-	test((testObject.OpenGlobal(globalObject.FullName()))==KErrNone);
+	test((r=testObject.OpenGlobal(globalObject.FullName()))==KErrNone);
 	testObject.Close();
 
 	test.Next(_L("Check can't open local object by name"));
-	test((testObject.OpenGlobal(localObject.FullName()))==PlatSecFindError);
+	test((r=testObject.OpenGlobal(localObject.FullName()))==PlatSecFindError);
 	testObject.Close();
 
 	test.Next(_L("Test duplicate global object in other process"));
-	test((DuplicateInOtherProcess(globalObject))==KErrNone);
+	test((r=DuplicateInOtherProcess(globalObject))==KErrNone);
 
 	test.Next(_L("Check can't duplicate local object in other process"));
-	test((DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
+	test((r=DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
 
 	test.Next(_L("Test duplicate global object in other thread"));
-	test((DuplicateInOtherThread(globalObject))==KErrNone);
+	test((r=DuplicateInOtherThread(globalObject))==KErrNone);
 
 	test.Next(_L("Test duplicate local object in other thead"));
-	test((DuplicateInOtherThread(localObject))==KErrNone);
+	test((r=DuplicateInOtherThread(localObject))==KErrNone);
 
 	test.Next(_L("Closing mutexes"));
 	globalObject.Close();
@@ -996,36 +1013,38 @@
 
 void TestMessageQueues()
 	{
+	TInt r;
+
 	test.Start(_L("Creating message queues"));
 	RMsgQueue<TInt> globalObject;
 	RMsgQueue<TInt> localObject;
 	RMsgQueue<TInt> testObject;
-	test((globalObject.CreateGlobal(_L("T_SOBJECT-test-global-msgqueue"),1))==KErrNone);
-	test((localObject.CreateLocal(1))==KErrNone);
+	test((r=globalObject.CreateGlobal(_L("T_SOBJECT-test-global-msgqueue"),1))==KErrNone);
+	test((r=localObject.CreateLocal(1))==KErrNone);
 
 	test.Next(_L("Test open with null name"));
-	test((testObject.OpenGlobal(KNullDesC))==KErrNotFound);
+	test((r=testObject.OpenGlobal(KNullDesC))==KErrNotFound);
 	testObject.Close();
 
 	test.Next(_L("Test open global object by name"));
-	test((testObject.OpenGlobal(globalObject.FullName()))==KErrNone);
+	test((r=testObject.OpenGlobal(globalObject.FullName()))==KErrNone);
 	testObject.Close();
 
 	test.Next(_L("Check can't open local object by name"));
-	test((testObject.OpenGlobal(localObject.FullName()))==PlatSecFindError);
+	test((r=testObject.OpenGlobal(localObject.FullName()))==PlatSecFindError);
 	testObject.Close();
 
 	test.Next(_L("Test duplicate global object in other process"));
-	test((DuplicateInOtherProcess(globalObject))==KErrNone);
+	test((r=DuplicateInOtherProcess(globalObject))==KErrNone);
 
 	test.Next(_L("Check can't duplicate local object in other process"));
-	test((DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
+	test((r=DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
 
 	test.Next(_L("Test duplicate global object in other thread"));
-	test((DuplicateInOtherThread(globalObject))==KErrNone);
+	test((r=DuplicateInOtherThread(globalObject))==KErrNone);
 
 	test.Next(_L("Test duplicate local object in other thead"));
-	test((DuplicateInOtherThread(localObject))==KErrNone);
+	test((r=DuplicateInOtherThread(localObject))==KErrNone);
 
 	test.Next(_L("Closing message queues"));
 	globalObject.Close();
@@ -1037,37 +1056,39 @@
 
 
 void TestConditionVariables()
-	{	
+	{
+	TInt r;
+
 	test.Start(_L("Creating condition variables"));
 	RCondVar globalObject;
 	RCondVar localObject;
 	RCondVar testObject;
-	test((globalObject.CreateGlobal(_L("T_SOBJECT-test-global-condvar")))==KErrNone);
-	test((localObject.CreateLocal())==KErrNone);
+	test((r=globalObject.CreateGlobal(_L("T_SOBJECT-test-global-condvar")))==KErrNone);
+	test((r=localObject.CreateLocal())==KErrNone);
 
 	test.Next(_L("Test open with null name"));
-	test((testObject.OpenGlobal(KNullDesC))==KErrNotFound);
+	test((r=testObject.OpenGlobal(KNullDesC))==KErrNotFound);
 	testObject.Close();
 
 	test.Next(_L("Test open global object by name"));
-	test((testObject.OpenGlobal(globalObject.FullName()))==KErrNone);
+	test((r=testObject.OpenGlobal(globalObject.FullName()))==KErrNone);
 	testObject.Close();
 
 	test.Next(_L("Check can't open local object by name"));
-	test((testObject.OpenGlobal(localObject.FullName()))==PlatSecFindError);
+	test((r=testObject.OpenGlobal(localObject.FullName()))==PlatSecFindError);
 	testObject.Close();
 
 	test.Next(_L("Test duplicate global object in other process"));
-	test((DuplicateInOtherProcess(globalObject))==KErrNone);
+	test((r=DuplicateInOtherProcess(globalObject))==KErrNone);
 
 	test.Next(_L("Check can't duplicate local object in other process"));
-	test((DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
+	test((r=DuplicateInOtherProcess(localObject))==PlatSecProcessIsolationError);
 
 	test.Next(_L("Test duplicate global object in other thread"));
-	test((DuplicateInOtherThread(globalObject))==KErrNone);
+	test((r=DuplicateInOtherThread(globalObject))==KErrNone);
 
 	test.Next(_L("Test duplicate local object in other thead"));
-	test((DuplicateInOtherThread(localObject))==KErrNone);
+	test((r=DuplicateInOtherThread(localObject))==KErrNone);
 
 	test.Next(_L("Closing message queues"));
 	globalObject.Close();
@@ -1083,7 +1104,7 @@
 	RTestProcess server;
 	TRequestStatus rendezvous;
 	TInt r;
-	
+
 	test.Next(_L("Test sending LogicalChannel handles"));
 	{
 	RLddTest localLdd;
@@ -1379,6 +1400,7 @@
 
 
 	test.Title();
+	TInt r;
 	
 	test.Start(_L("Starting test servers"));
 	RTestProcess server;
@@ -1391,10 +1413,10 @@
 	User::WaitForRequest(rendezvous);
 	test(rendezvous==KServerRendezvous);
 	server.Close();
-	test((StartServerInThread(EAnonymousServer))==KErrNone);
+	test((r=StartServerInThread(EAnonymousServer))==KErrNone);
 
 	test.Next(_L("Openning server session"));
-	test((Session.Connect())==KErrNone);
+	test((r=Session.Connect())==KErrNone);
 
 	test.Next(_L("Test Find and Open PhysicalDevices"));
 	TestPhysicalDevices();
--- a/kerneltest/e32test/secure/t_sprocess.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/secure/t_sprocess.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -75,6 +75,7 @@
 
 _LIT(KTestPanicCategory,"TEST PANIC");
 _LIT(KTestProcessName,"TestName");
+_LIT(KTestProcessName2,"TestName2");
 
 
 TInt DoTestProcess(TInt aTestNum,TInt aArg1,TInt aArg2)
--- a/kerneltest/e32test/smpsoak/t_smpsoak.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/smpsoak/t_smpsoak.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -120,7 +120,7 @@
 const TDesC* CSMPSoakThread::KDeviceTable[] =
     {
     &KDevices, &KDevLdd1, &KDevLdd1Name, &KDevLdd2, &KDevLdd2Name, &KDevLdd3, &KDevLdd3Name,
-    &KDevLdd4, &KDevLdd4Name, NULL
+    &KDevLdd4, &KDevLdd4Name, &KDevLdd5, &KDevLdd5Name, NULL
     };
 
 //Constructor
@@ -412,7 +412,6 @@
 TInt CSMPSoakThread::DoSMPStressMemoryThread()
 	{
 	RTest test(_L("SMPStressMemoryThread"));
-	test.Start(_L("SMPStressMemoryThread"));
 	
 	TMemory *memoryTablePtr;
 	TChunkInfo chunkTable[KNumChunks];
@@ -478,8 +477,6 @@
 			}
 		User::After(gPeriod);
 		}
-	test.End();
-	test.Close();
 	return 0x00;
 	}
 //Device Thread : will do device associated operation
@@ -494,7 +491,6 @@
 TInt CSMPSoakThread::DoSMPStressDeviceThread()
 	{
 	RTest test(_L("SMPStressDeviceThread"));
-	test.Start(_L("SMPStressDeviceThread"));
 	
 	RTimer timer;
 	RFs session;
@@ -543,11 +539,7 @@
 			RDevice device;
 
 			TInt r = User::LoadLogicalDevice(*ptrDevices[i]);
-			if (r != KErrNone && r != KErrAlreadyExists)
-				{
-				test.Printf(_L("LDD %S not present\n"), ptrDevices[i]);
-				continue;
-				}
+			test(r == KErrNone || r == KErrAlreadyExists);
 
 			test_KErrNone(device.Open(*ptrDevices[i+1]));
 
@@ -570,8 +562,6 @@
 		}
 	timer.Close();
 	PRINT((_L("SMPStressDeviceThread MyTimer.Cancel() called\n")));
-	test.End();
-	test.Close();
 	return 0x00;
 	}
 //Spin Thread : will do thread sync 
@@ -586,7 +576,6 @@
 TInt CSMPSoakThread::DoSMPStressSpinThread()
 	{
 	RTest test(_L("SMPStressSpinThread"));
-	test.Start(_L("SMPStressSpinThread"));
 
 	TTime startTime;
 	TTime endTime;
@@ -607,8 +596,6 @@
 			break;
 		User::After(gPeriod);
 		}
-	test.End();
-	test.Close();
 	return 0x00;
 	}
 //Timer Thread : Timer operation and  thread sync 
@@ -623,7 +610,6 @@
 TInt CSMPSoakThread::DoSMPStressTimerThread()
 	{
 	RTest test(_L("SMPStressTimerThread"));
-	test.Start(_L("SMPStressTimerThread"));
 
 	PRINT (_L("SMPStressTimerThread\n"));
 	RTimer timer;
@@ -644,8 +630,6 @@
 		}
 	timer.Cancel();
 	PRINT((_L("SMPStressTimerThread MyTimer.Cancel() called\n")));
-	test.End();
-	test.Close();
 	return 0x00;
 	}
 // CActive class to monitor KeyStrokes from User
--- a/kerneltest/e32test/smpsoak/t_smpsoak.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/smpsoak/t_smpsoak.h	Wed Sep 01 12:34:56 2010 +0100
@@ -136,6 +136,8 @@
 _LIT(KDevLdd3Name,"Ethernet");
 _LIT(KDevLdd4,"esoundsc.ldd");
 _LIT(KDevLdd4Name,"SoundSc");
+_LIT(KDevLdd5,"eusbc.ldd");
+_LIT(KDevLdd5Name, "Usbc");
 
 //Thread data for each thread
 struct	TThreadData
--- a/kerneltest/e32test/system/d_khal.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,284 +0,0 @@
-// 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:
-// e32test\system\d_khal.cpp
-// LDD for testing class Kern HAL APIs
-// Kern::AddHalEntry(), Kern::RemoveHalEntry(), Kern::FindHalEntry()
-// 
-//
-
-#include <kernel/kernel.h>
-
-#include "d_khal.h"
-
-#define KMaxDeviceNumber 8 // same as KMaxHalEntries
-
-TUint 	gDeviceNumber=1;			// Device Number
-TUint	gRegisteredDeviceNumber;	// Holds the device number which we managed to register for
-TBool	gEntryForDevice0Registered; // indicator whether the device0 got registered
-TBool	gEntryForDeviceXRegistered;	// States HAL Entry Successfully registered or not
-TBool	gFirstCall=ETrue;			// for add function, this tells if this is first call or not
-
-class DKHalLDDTestFactory : public DLogicalDevice
-//
-// Test LDD factory
-//
-	{
-public:
-	DKHalLDDTestFactory();
-	virtual TInt Install(); 								//overriding pure virtual
-	virtual void GetCaps(TDes8& aDes) const;				//overriding pure virtual
-	virtual TInt Create(DLogicalChannelBase*& aChannel); 	//overriding pure virtual
-	};
-
-class DKHalLDDTestChannel : public DLogicalChannelBase
-//
-// Test logical channel
-//
-	{
-public:
-	virtual ~DKHalLDDTestChannel();
-protected:
-	virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
-	virtual TInt Request(TInt aReqNo, TAny* a1, TAny* a2);
-	};
-
-
-LOCAL_C TInt halFunction0(TAny* /*aPtr*/, TInt aFunction, TAny* /*a1*/, TAny* /*a2*/)
-	{
-	TInt r=KErrNotSupported;
-
-	switch(aFunction)
-		{
-		case RLddKHalTest::ETestHalFunc:
-			Kern::Printf("HAL function0 called successfully !");
-			r=KErrNone; // just return KErrNone
-			break;
-		default:
-			break;
-		}
-	return r;
-	}
-
-
-LOCAL_C TInt halFunctionX(TAny* /*aPtr*/, TInt aFunction, TAny* /*a1*/, TAny* /*a2*/)
-	{
-	TInt r=KErrNotSupported;
-
-	switch(aFunction)
-		{
-		case RLddKHalTest::ETestHalFunc:
-			Kern::Printf("HAL functionX called successfully !");
-			r=KErrNone; // just return KErrNone
-			break;
-		default:
-			break;
-		}
-	return r;
-	}
-
-DECLARE_STANDARD_LDD()
-	{
-	return new DKHalLDDTestFactory;
-	}
-
-//
-// Constructor
-//
-DKHalLDDTestFactory::DKHalLDDTestFactory()
-	{
-	}
-
-TInt DKHalLDDTestFactory::Create(DLogicalChannelBase*& aChannel)
-	{
-//
-// Create new channel
-//  
-	aChannel=new DKHalLDDTestChannel;
-	return aChannel?KErrNone:KErrNoMemory;
-	}
-
-TInt DKHalLDDTestFactory::Install()
-//
-// Install the LDD - overriding pure virtual
-	{
-	return SetName(&KLddName);
-	}
-
-void DKHalLDDTestFactory::GetCaps(TDes8& /*aDes*/) const
-//
-// Get capabilities - overriding pure virtual
-//
-	{
-	}
-
-TInt DKHalLDDTestChannel::DoCreate(TInt /*aUnit*/, const TDesC8* /*aInfo*/, const TVersion& /*aVer*/)
-//
-// Create channel
-//
-	{
-	return KErrNone;
-	}
-
-DKHalLDDTestChannel::~DKHalLDDTestChannel()
-//
-// Destructor
-//
-	{
-	}
-
-TInt DKHalLDDTestChannel::Request(TInt aReqNo, TAny* /*a1*/, TAny* /*a2*/)
-	{
-	TInt r=KErrNone;
-	switch(aReqNo)
-		{
-		case RLddKHalTest::EAddHalEntryDevice0:
-			{
-			// try to register the halfunction for PlatformSpecific category, device 0
-            NKern::ThreadEnterCS();
-			r=Kern::AddHalEntry(EHalGroupPlatformSpecific2,halFunction0,this);
-			NKern::ThreadLeaveCS();
-			//this function gets called twice, second time must not changed these values
-			if (gFirstCall)
-				{
-				if (r==KErrNone)
-					{
-					gEntryForDevice0Registered=ETrue;
-					}
-				else
-					{
-					gEntryForDevice0Registered=EFalse;
-					}
-				gFirstCall=EFalse;
-				}
-
-			break;
-			}
-		case RLddKHalTest::EAddHalEntryDeviceX:
-			{
-			// try to register the halfunction for PlatformSpecific category, device x
-            NKern::ThreadEnterCS();
-			do
-				{
-				r=Kern::AddHalEntry(EHalGroupPlatformSpecific2,halFunctionX,this,gDeviceNumber);
-				}
-            while((r==KErrInUse) && (++gDeviceNumber < KMaxDeviceNumber));
-			NKern::ThreadLeaveCS();
-
-			if((gDeviceNumber < KMaxDeviceNumber) && (r==KErrNone))
-				{
-				gEntryForDeviceXRegistered=ETrue;
-				gRegisteredDeviceNumber=gDeviceNumber;
-				}
-			else
-				{
-				gEntryForDeviceXRegistered=EFalse;
-				r=KErrInUse;
-				}
-
-			break;
-			}
-		case RLddKHalTest::EAddHalEntryForExistingFixed:
-			{
-			// try to add HAL entry for Kernel, should fail
-            NKern::ThreadEnterCS();
-			r=Kern::AddHalEntry(EHalGroupKernel,halFunction0,this);
-			NKern::ThreadLeaveCS();
-			break;
-			}
-		case RLddKHalTest::ERemoveHalEntryDevice0:
-			{
-			// try to remove the registered halfunction for device 0
-			if(gEntryForDevice0Registered)
-				r=Kern::RemoveHalEntry(EHalGroupPlatformSpecific2);
-		
-			break;
-			}
-		case RLddKHalTest::ERemoveHalEntryDeviceX:
-			{
-			// try to remove the registered halfunction for device x
-			if(gEntryForDeviceXRegistered)
-				r=Kern::RemoveHalEntry(EHalGroupPlatformSpecific2,gRegisteredDeviceNumber);
-			break;
-			}
-		case RLddKHalTest::ERemoveHalEntryExistingFixed:
-			{
-			// try to remove EGroupHalKernel. This operation should return an error
-			r=Kern::RemoveHalEntry(EHalGroupKernel);
-			break;
-			}
-		case RLddKHalTest::EGetRegisteredDeviceNumber:
-			{
-			// return the device number which we managed to register
-			if(gEntryForDeviceXRegistered)
-				{
-				r=gRegisteredDeviceNumber;
-				}
-			else
-				{
-				r=KErrNotFound;
-				}
-			break;
-			}
-		case RLddKHalTest::EFindHalEntryDevice0:
-			{
-			SHalEntry* pEntry=Kern::FindHalEntry(EHalGroupPlatformSpecific2);
-			// returns valid pEntry if EAddHalEntryForDevice0 managed to register
-			// an entry earlier
-			if (pEntry && pEntry->iFunction!=NULL)
-				{
-				r=KErrNone;
-				}
-			else
-				{
-				r=KErrNotFound;
-				}
-			break;
-			}
-		case RLddKHalTest::EFindHalEntryDevice0Other:
-			{
-			SHalEntry* pEntry=Kern::FindHalEntry(EHalGroupKernel);
-			//try to find an existing HAL group (kernel must exist)
-			if (pEntry && pEntry->iFunction!=NULL)
-				{
-				r=KErrNone;
-				}
-			else
-				{
-				r=KErrNotFound;
-				}
-			break;
-			}
-		case RLddKHalTest::EFindHalEntryDeviceX:
-			{
-			SHalEntry* pEntry=Kern::FindHalEntry(EHalGroupPlatformSpecific2,gRegisteredDeviceNumber);
-			// Should return valid pEntry if EAddHalEntryForDeviceX managed to register
-			// one earlier
-			if (pEntry && pEntry->iFunction!=NULL)
-				{
-				r=KErrNone;
-				}
-			else
-				{
-				r=KErrNotFound; 
-				}
-			break;
-			}
-
-		default:
-			r=KErrNotSupported;
-			break;
-		} 
-
-	return r;
-	}
--- a/kerneltest/e32test/system/d_khal.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,123 +0,0 @@
-// 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:
-// e32test\system\d_khal.h
-// 
-//
-
-#if !defined(__D_KHAL_H__)
-#define __D_KHAL_H__
-
-#include <e32cmn.h>
-#ifndef __KERNEL_MODE__
-#include <e32std.h>
-#endif
-
-_LIT(KLddName,"D_KHAL.LDD");
-
-class RLddKHalTest : public RBusLogicalChannel
-	{
-public:
-
-	enum TControl
-		{
-		EAddHalEntryDevice0 = 1,
-		EAddHalEntryDeviceX,
-		EAddHalEntryForExistingFixed,
-		ERemoveHalEntryDevice0,
-		ERemoveHalEntryDeviceX,
-		ERemoveHalEntryExistingFixed,
-		EGetRegisteredDeviceNumber,
-		EFindHalEntryDevice0,
-		EFindHalEntryDevice0Other,
-		EFindHalEntryDeviceX
-		};
-
-	enum THalFunc
-		{
-		ETestHalFunc
-		};
-
-public:
-	inline TInt Open();
-	inline TInt AddHalEntryDevice0();
-	inline TInt AddHalEntryDeviceX();
-	inline TInt AddHalEntryForExistingFixed();
-	inline TInt RemoveHalEntryDevice0();
-	inline TInt RemoveHalEntryDeviceX();
-	inline TInt RemoveHalEntryExistingFixed();
-	inline TInt GetRegisteredDeviceNumber();
-	inline TInt FindHalEntryDevice0();
-	inline TInt FindHalEntryDevice0Other();
-	inline TInt FindHalEntryDeviceX();
-	};
-
-
-#ifndef __KERNEL_MODE__
-inline TInt RLddKHalTest::Open()
-	{
-	return DoCreate(KLddName,TVersion(0,1,0),KNullUnit,NULL,NULL);
-	}
-
-inline TInt RLddKHalTest::AddHalEntryDevice0()
-	{
-    return DoControl(EAddHalEntryDevice0);
-	}
-
-inline TInt RLddKHalTest::AddHalEntryDeviceX()
-	{
-    return DoControl(EAddHalEntryDeviceX);
-	}
-
-inline TInt RLddKHalTest::AddHalEntryForExistingFixed()
-	{
-    return DoControl(EAddHalEntryForExistingFixed);
-	}
-
-inline TInt RLddKHalTest::RemoveHalEntryDevice0()
-	{
-    return DoControl(ERemoveHalEntryDevice0);
-	}
-
-inline TInt RLddKHalTest::RemoveHalEntryDeviceX()
-	{
-    return DoControl(ERemoveHalEntryDeviceX);
-	}
-
-inline TInt RLddKHalTest::RemoveHalEntryExistingFixed()
-	{
-    return DoControl(ERemoveHalEntryExistingFixed);
-	}
-
-inline TInt RLddKHalTest::GetRegisteredDeviceNumber()
-	{
-    return DoControl(EGetRegisteredDeviceNumber);
-	}
-
-inline TInt RLddKHalTest::FindHalEntryDevice0()
-	{
-    return DoControl(EFindHalEntryDevice0);
-	}
-
-inline TInt RLddKHalTest::FindHalEntryDevice0Other()
-	{
-    return DoControl(EFindHalEntryDevice0Other);
-	}
-
-inline TInt RLddKHalTest::FindHalEntryDeviceX()
-	{
-    return DoControl(EFindHalEntryDeviceX);
-	}
-#endif //__KERNEL_MODE__
-
-#endif   //__D_KHAL_H__
--- a/kerneltest/e32test/system/d_mstim.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/system/d_mstim.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -93,7 +93,7 @@
 #endif
 #ifdef __NE1_TB__
 inline TCounter TIMER()
-	{ return NETimer::Timer(5).iTimerCount; }
+	{ return NETimer::Timer(2).iTimerCount; }
 #endif
 #ifdef __MRAP__
 inline TCounter TIMER()
@@ -199,8 +199,8 @@
 	return aTicks*500;					// 2kHz tick
 #endif
 #if defined(__NE1_TB__)
-	NETimer& T5 = NETimer::Timer(5);
-	TUint prescale = __e32_find_ms1_32(T5.iPrescaler & 0x3f);
+	NETimer& T2 = NETimer::Timer(2);
+	TUint prescale = __e32_find_ms1_32(T2.iPrescaler & 0x3f);
 	TInt f = 66666667 >> prescale;
 	TInt64 x = I64LIT(1000000);
 	x *= TInt64(aTicks);
@@ -284,24 +284,7 @@
 	TRvEmuBoard::EnableTimer(KHwCounterTimer1, TRvEmuBoard::EEnable);
 #endif
 #if defined(__NE1_TB__)
-    // set up timer 5
-    NETimer& T5 = NETimer::Timer(5);
-
-	T5.iTimerCtrl = 0;						// stop and reset timer 5
-	T5.iGTICtrl = 0;						// disable timer 5 capture modes
-	__e32_io_completion_barrier();
-	T5.iPrescaler = KNETimerPrescaleBy32;	// Timer 5 prescaled by 32 (=2.0833MHz)
-	__e32_io_completion_barrier();
-	T5.iGTInterruptEnable = 0;
-	__e32_io_completion_barrier();
-	T5.iGTInterrupt = KNETimerGTIInt_All;
-	__e32_io_completion_barrier();
-	T5.iTimerCtrl = KNETimerCtrl_CE;		// deassert reset for timer 5, count still stopped
-	__e32_io_completion_barrier();
-	T5.iTimerReset = 0xffffffffu;			// timer 5 wraps after 2^32 counts
-	__e32_io_completion_barrier();
-	T5.iTimerCtrl = KNETimerCtrl_CE | KNETimerCtrl_CAE;	// start timer 5
-	__e32_io_completion_barrier();		
+	// nothing to do since variant has already set up timer
 #endif
 #if defined(__EPOC32__) && defined(__CPU_X86)
 	// Set up timer channel 2 as free running counter at 14318180/12 Hz
--- a/kerneltest/e32test/system/d_tick.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/system/d_tick.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -224,15 +224,6 @@
 	x /= TUint64(f);
 	return (TUint)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(__MAWD__) || defined(__MEIG__)
 	return aTicks*500;					// 2kHz tick
 #endif
@@ -611,9 +602,6 @@
 #if defined(__NE1_TB__)
 	// nothing to do since we use fast counter
 #endif
-#if defined(__MRAP__)
-	// nothing to do here RTC runs with 32.768 kHz
-#endif
 #ifdef __MAWD__
 	// Set up timer 1 as free running 2kHz clock
 	TWind::SetBuzzerControl(0);		// disable buzzer
--- a/kerneltest/e32test/system/t_atomic_common.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/system/t_atomic_common.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -39,35 +39,6 @@
 	DEBUGPRINT("Line %d: " #x "=%02x %02x %02x %02x  %02x %02x %02x %02x", __LINE__, p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]);	\
 	}
 
-#ifdef __WINS__
-#pragma warning( disable : 4127 )   // disable warning warning C4127: conditional expression is constant
-#endif
-template<typename T> void DebugPrintVar(T x, char *name, TInt line)
-	{
-	const TUint8 *p = (const TUint8 *)&x;
-	const TInt size = sizeof(T);
-	if (size < 2)
-		{
-		DEBUGPRINT("Line %d: %s =%02x", line, name, p[0]);
-		}
-	else if (size < 4)
-		{
-		DEBUGPRINT("Line %d: %s =%02x %02x", line, name, p[0], p[1]);
-		}
-	else if (size < 8)
-		{
-		DEBUGPRINT("Line %d: %s =%02x %02x %02x %02x", line, name, p[0], p[1], p[2], p[3]);
-		}
-	else
-		{
-		DEBUGPRINT("Line %d: %s =%02x %02x %02x %02x  %02x %02x %02x %02x", line, name, p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]);
-		}
-	}
-#ifdef __WINS__
-#pragma warning( default : 4127 )   // disable warning warning C4127: conditional expression is constant
-#endif
-
-
 extern "C" {
 
 // Simulated versions of atomic functions without the atomicity
@@ -310,10 +281,9 @@
 
 #define	DEBUGPRINTxyrc()	\
 		DEBUGPRINTVAR(x);	\
-		DebugPrintVar(y, "y", __LINE__);	\
-		DebugPrintVar(r, "r", __LINE__);	\
-		DebugPrintVar(c, "c", __LINE__)
-
+		DEBUGPRINTVAR(y);	\
+		DEBUGPRINTVAR(r);	\
+		DEBUGPRINTVAR(c)
 
 template<class T> TInt DoLoadTest(TInt aIndex, TAny* aPtr, T aInitialValue)
 	{
@@ -426,10 +396,10 @@
 		{
 		DEBUGPRINT("r=%d",r);
 		DEBUGPRINTVAR(x);
-		DebugPrintVar(ex, "ex", __LINE__);
+		DEBUGPRINTVAR(ex);
 		DEBUGPRINT("c=%d",c);
-		DebugPrintVar(y, "y", __LINE__);
-		DebugPrintVar(ey, "ey", __LINE__);
+		DEBUGPRINTVAR(y);
+		DEBUGPRINTVAR(ey);
 		}
 	return line;
 	}
--- a/kerneltest/e32test/system/t_atomicu.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,205 +0,0 @@
-// Copyright (c) 2003-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\system\t_atomicu.cpp
-// Overview:
-// Simple test for class User atomic operations
-// API Information:
-// User::SafeInc(), User::SafeDec(), User::LockedInc(),
-// User::LockedDec()
-// Details:
-// - Tests SafeInc, SafeDec, LockedInc and LockedDec
-// functions in single thread and determines that counts
-// match after finished
-// - Tests SafeInc, SafeDec, LockedInc and LockedDec
-// functions in multithreaded configuration and determines
-// that counts match after finished
-// Platforms/Drives/Compatibility:
-// All.
-// Assumptions/Requirement/Pre-requisites:
-// Failures and causes:
-// Base Port information:
-// 
-//
-
-#define __E32TEST_EXTENSION__
-#include <e32test.h>
-#include <e32svr.h>
-#include <e32def.h>
-
-LOCAL_D RTest test(_L("T_ATOMICU"));
-
-const TInt KMaxOps=20000;
-#define KNumThreads 20
-TInt gValue=0;
-
-void TestSafeIncAndSafeDec()
-	{
-	gValue=0;
-	// increasing when 0, should return 0
-	test(User::SafeInc(gValue)==0);
-	// value also should be 0
-	test(gValue==0);
-	
-	gValue=1;
-	TInt expected=0;
-	// gValue should vary only between 1 and 2
-	for (TInt i=0; i<KMaxOps; i++)
-		{
-		expected=User::SafeInc(gValue)+1;
-		test(expected==User::SafeDec(gValue));
-		}
-
-	// after running these, it should be 1
-	test(gValue==1);
-	
-	// should stay zero after decreasing from 1 multiple times
-	test(User::SafeDec(gValue)==1);
-	test(User::SafeDec(gValue)==0);
-	test(User::SafeDec(gValue)==0);
-	test(gValue==0);
-	}
-
-void TestLockedIncAndLockedDec()
-	{
-	gValue=0;
-	// increasing when 0, should return 0 as old value
-	test(User::LockedInc(gValue)==0);
-	// new value should be 1
-	test(gValue==1);
-
-	gValue=-1;
-
-	// gValue should vary only between 1 and 2
-	for (TInt i=0; i<KMaxOps; i++)
-		{
-		test((User::LockedInc(gValue)+1)==User::LockedDec(gValue));
-		}
-
-	// after running these, it should be back in -1
-	test(gValue==-1);
-	}
-
-TInt MultiThreadSafeIncAndSafeDec_FUNC(TAny*)
-	{
-	for (TInt i=0; i<KMaxOps; i++)
-		{
-		User::SafeInc(gValue);
-		User::SafeDec(gValue);
-		}
-	return KErrNone;
-	}
-
-TInt MultiThreadLockedIncAndLockedDec_FUNC(TAny*)
-	{
-	for (TInt i=0; i<KMaxOps; i++)
-		{
-		User::LockedInc(gValue);
-		User::LockedDec(gValue);
-		}
-	return KErrNone;
-	}
-
-void MultiThreadSafeIncAndSafeDec()
-	{
-	gValue=1; // start value 1
-	RThread threads[KNumThreads];
-	TRequestStatus stats[KNumThreads];
-	TInt i;
-
-	for (i=0;i<KNumThreads;i++)
-		{
-		test_KErrNone(threads[i].Create(KNullDesC,MultiThreadSafeIncAndSafeDec_FUNC,KDefaultStackSize,NULL,NULL));
-		threads[i].Logon(stats[i]);
-		}
-	
-	//lets increase our priority first, so that all the threads start
-	RThread().SetPriority(EPriorityMore);
-
-	test.Printf(_L("Resuming threads...\n"));
-	for(i=0; i<KNumThreads; i++)
-		threads[i].Resume();
-
-	for(i=0; i<KNumThreads; i++)
-		{
-		User::WaitForRequest(stats[i]);
-		test_KErrNone(stats[i].Int());
-		CLOSE_AND_WAIT(threads[i]);
-		}
-
-	test.Printf(_L("...Threads finished\n"));
-	
-	// back to normal
-	RThread().SetPriority(EPriorityNormal);
-
-	// test that we returned to the startvalue
-	test(gValue==1);
-	}
-
-void MultiThreadLockedIncAndLockedDec()
-	{
-	gValue=-1; // set start value to -1
-	RThread threads[KNumThreads];
-	TRequestStatus stats[KNumThreads];
-	TInt i;
-
-	for (i=0;i<KNumThreads;i++)
-		{
-		test_KErrNone(threads[i].Create(KNullDesC,MultiThreadLockedIncAndLockedDec_FUNC,KDefaultStackSize,NULL,NULL));
-		threads[i].Logon(stats[i]);
-		}
-	
-	//lets increase our priority first, so that all the threads start
-	RThread().SetPriority(EPriorityMore);
-
-	test.Printf(_L("Resuming threads...\n"));
-	for(i=0; i<KNumThreads; i++)
-		threads[i].Resume();
-
-	for(i=0; i<KNumThreads; i++)
-		{
-		User::WaitForRequest(stats[i]);
-		test_KErrNone(stats[i].Int());
-		CLOSE_AND_WAIT(threads[i]);
-		}
-
-	test.Printf(_L("...Threads finished\n"));
-	
-	// back to normal
-	RThread().SetPriority(EPriorityNormal);
-
-	// test that we returned to the startvalue
-	test(gValue==-1);
-	}
-
-
-TInt E32Main()
-	{
-	test.Title();
-	
-	test.Start(_L("Test single thread User::SafeInc and User::SafeDec"));
-	TestSafeIncAndSafeDec();
-	
-	test.Next(_L("Test single thread User::LockedInc and User::LockedDec"));
-	TestLockedIncAndLockedDec();
-
-	test.Next(_L("Test multiple thread User::SafeInc and User::SafeDec"));
-	MultiThreadSafeIncAndSafeDec();
-	
-	test.Next(_L("Test multiple thread User::LockedInc and User::LockedDec"));
-	MultiThreadLockedIncAndLockedDec();
-
-	test.End();
-
-	return KErrNone;
-	}
--- a/kerneltest/e32test/system/t_cobj.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/system/t_cobj.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -30,7 +30,6 @@
 // - Test all the objects together: create two containers, find objects by 
 // name in a variety of ways, delete objects and verify the results are 
 // as expected.
-// - Test panic functions by behaving badly
 // Platforms/Drives/Compatibility:
 // All.
 // Assumptions/Requirement/Pre-requisites:
@@ -46,7 +45,6 @@
 #include <e32test.h>
 #include <e32svr.h>
 #include <e32ver.h>
-#include <e32panic.h>
 #include "../misc/prbs.h"
 
 struct TCObjectDump
@@ -208,7 +206,6 @@
 	void Test6(void);
 	void Test7(void);
 	void Test8(void);
-	void Test9(void);
 private:
 	static void GetObjName(TName& aDest,const CObject& aObj);
 	static void GetObjFullName(TFullName& aDest,const CObject& aObj);
@@ -363,9 +360,6 @@
 	pCon->AddL(pObj2);
 	test(pCon->Count()==2);
 
-	test((*pCon)[0]==pObj1);
-	test((*pCon)[1]==pObj2);
-
 	aFindHandle=0;
 	test(pCon->FindByName(aFindHandle, _L("xxx"), gName)==KErrNotFound);
 	aFindHandle=0;
@@ -752,119 +746,6 @@
 
 	}
 
-
-TInt PanicCObjectConIndexOutOfRangeFn(TAny* aCObjectCon)
-	{	
-	CObjectCon* pCObjectCon=(CObjectCon*)aCObjectCon;
-	(*pCObjectCon)[1]; // no objects added to the container
-	return KErrNone; // should not come here
-	}
-
-TInt PanicCObjectConFindIndexOutOfRangeFn(TAny* aCObjectCon)
-	{
-	CObjectCon* pCObjectCon=(CObjectCon*)aCObjectCon;
-	TInt aFindHandle=1;
-	pCObjectCon->At(aFindHandle);
-	return KErrNone; // should not come here
-	}
-
-TInt PanicCObjectConFindBadHandleFn(TAny* aCObjectCon)
-	{	
-	CObjectCon* pCObjectCon=(CObjectCon*)aCObjectCon;
-	TInt aFindHandle=KMaxTInt;
-	pCObjectCon->At(aFindHandle);
-	return KErrNone; // should not come here
-	}
-
-TInt PanicCObjectIxIndexOutOfRangeFn(TAny* aCObjectIx)
-	{	
-	CObjectIx* pCObjectIx=(CObjectIx*)aCObjectIx;
-	(*pCObjectIx)[1]; // no objects added to the container
-	return KErrNone; // should not come here
-	}
-	
-void StartPanicTest(TInt aPanicType)
-	{
-	CObjectCon* pCObjectCon=CObjectCon::NewL();
-	CObjectIx* pCObjectIx=CObjectIx::NewL();
-	RThread thread;
-	TRequestStatus status;
-	TInt r=KErrNone;
-
-	switch (aPanicType)
-		{
-		case 0:		// this index used for (PanicCObjectIxIndexOutOfRange) CObjectIx index out of range
-			r=thread.Create(_L("PanicCObjectIxIndexOutOfRangeThread"),PanicCObjectIxIndexOutOfRangeFn,KDefaultStackSize,NULL,(TAny*)pCObjectIx);
-			break;
-		case EObjFindBadHandle:			// for testing CObjectCon panic (PanicCObjectConFindBadHandle)
-			r=thread.Create(_L("PanicCObjectConFindBadHandleThread"),PanicCObjectConFindBadHandleFn,KDefaultStackSize,NULL,(TAny*)pCObjectCon);
-			break;
-		case EObjFindIndexOutOfRange:	// for testing CObjectCon panic (PanicCObjectConFindIndexOutOfRange)
-			r=thread.Create(_L("PanicCObjectConFindIndexOutOfRangeThread"),PanicCObjectConFindIndexOutOfRangeFn,KDefaultStackSize,NULL,(TAny*)pCObjectCon);
-			break;
-		case EArrayIndexOutOfRange:		// for testing CObjectCon panic (PanicCObjectConIndexOutOfRange)
-			r=thread.Create(_L("PanicCObjectConIndexOutOfRangeThread"),PanicCObjectConIndexOutOfRangeFn,KDefaultStackSize,NULL,(TAny*)pCObjectCon);
-			break;
-		default:
-			break;
-		}
-
-	test (r==KErrNone);
-	thread.SetPriority(EPriorityMore);
-	thread.Logon(status);
-	thread.Resume();
-	User::WaitForRequest(status);
-
-	test(status.Int() != KErrNone);
-	test(thread.ExitType()==EExitPanic);
-	test(thread.ExitCategory()==_L("E32USER-CBase"));
-
-	switch (aPanicType)
-		{
-		case 0:		// this index used for (PanicCObjectIxIndexOutOfRange) CObjectIx index out of range
-			test(thread.ExitReason()==EArrayIndexOutOfRange);
-			break;
-		case EObjFindBadHandle:			// for testing CObjectCon panic (PanicCObjectConFindBadHandle)
-			test(thread.ExitReason()==EObjFindBadHandle);
-			break;
-		case EObjFindIndexOutOfRange:	// for testing CObjectCon panic (PanicCObjectConFindIndexOutOfRange)
-			test(thread.ExitReason()==EObjFindIndexOutOfRange);
-			break;
-		case EArrayIndexOutOfRange:		// for testing CObjectCon panic (PanicCObjectConIndexOutOfRange)
-			test(thread.ExitReason()==EArrayIndexOutOfRange);
-			break;
-		default:
-			break;
-		}
-	
-	CLOSE_AND_WAIT(thread);
-	delete pCObjectCon;
-	delete pCObjectIx;
-	}
-
-
-GLDEF_C void TestCObjects::Test9(void)
-	{
-	// Disable JIT debugging.
-	TBool justInTime=User::JustInTime();
-	User::SetJustInTime(EFalse);
-
-	test.Next(_L("test PanicCObjectConFindBadHandle"));
-	StartPanicTest(EObjFindBadHandle);
-	test.Next(_L("test PanicCObjectConFindIndexOutOfRange"));
-	StartPanicTest(EObjFindIndexOutOfRange);
-	test.Next(_L("test PanicCObjectConIndexOutOfRange"));
-	StartPanicTest(EArrayIndexOutOfRange);
-	test.Next(_L("test PanicCObjectIxIndexOutOfRange"));
-	StartPanicTest(0);
-
-	// Put JIT debugging back to previous status.
-	User::SetJustInTime(justInTime);
-
-	test.End();
-	}
-
-
 GLDEF_C void TestCObjects::GetObjName(TName& aDest,const CObject& aObj)
 //
 // Utility function to reduce stack usage in functions, and so get rid of __chkstk errors
@@ -1174,9 +1055,7 @@
 		
 		TInt handle = ix->AddL(obj);
 		test(ix->At(handle) == obj);
-		test(ix->AtL(handle) == obj);
 		test(ix->At(handle, con->UniqueID()) == obj);
-		test(ix->AtL(handle, con->UniqueID()) == obj);
 
 		TName name;
 		TInt findHandle = 0;
@@ -1299,10 +1178,6 @@
 		test.Printf(_L("TestCObjectConIxL left with %d\n"), err);
 	test(err == KErrNone);
 
-	//Test Panics
-	test.Start(_L("Test Panic functions"));
-	T.Test9();
-
 	test.End();
 
    	delete trapHandler;
--- a/kerneltest/e32test/system/t_ctrap.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/system/t_ctrap.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -39,8 +39,6 @@
 // - Test that the Cleanup stack can go re-entrant.
 // - Ensure that the stack is properly balanced with and without
 // leaving.
-// - Test creating cleanup with CCleanup::NewL in normal
-// memory conditions and condition where heap is full (panic)
 // Platforms/Drives/Compatibility:
 // All.
 // Assumptions/Requirement/Pre-requisites:
@@ -57,18 +55,14 @@
 #include <e32def.h>
 #include <e32def_private.h>
 
-#if defined(_DEBUG)
-	const TInt KInitialCount=2;
-	const TInt KInitialCountAll=3;
-#endif
 
+const TInt KInitialCount=2;
+const TInt KInitialCountAll=3;
 const TInt KLeaveValue=0x12345678;
 const TInt KMaxAlloc=6;	
-const TInt KTableSize = 1000;
 
 static const TInt KHeapSize = 0x2000;
 
-
 enum TWhat {EPop,EPopAndDestroy,EMulti,ENull};
 
 class CTest : public CBase
@@ -112,10 +106,12 @@
 
 LOCAL_C void ReallocateStackL()
 	{
+	TInt n = 0;
 	for(TInt i = 0; i < KMaxAlloc; ++i)
 		{
-		(void)HBufC::NewLC(4);   //Stack re-allocation will be performed due to the additional objects pushed
+		HBufC *p1 = HBufC::NewLC(4);   //Stack re-allocation will be performed due to the additional objects pushed
 									   //into the cleanup stack
+		n = p1->Length();			   //include this line to avoid warnigs for unused "p1" variable
 		}
 	test.Printf(_L("ReallocateStackL(): PopAndDestroy KMaxAlloc pointers\n"));
 	CleanupStack::PopAndDestroy(KMaxAlloc);
@@ -134,10 +130,12 @@
 	{
 	RDebug::Printf("~CTest3(): Modify Cleanup stack by pushing items");
 	
+	TInt n = 0;
 	for(TInt i = 0; i < KMaxAlloc; ++i)
 		{
-		HBufC::NewLC(4);   //Stack re-allocation will be performed due to the additional objects pushed
+		HBufC *p1 = HBufC::NewLC(4);   //Stack re-allocation will be performed due to the additional objects pushed
 									   //into the cleanup stack
+		n = p1->Length();			   //include this line to avoid warnigs for unused "p1" variable
 		}
 	}
 
@@ -150,11 +148,13 @@
 	CleanupStack::PopAndDestroy();
 	}
 
-LOCAL_C TInt PanicStackModifiedFn(TAny* /*aNopFn*/)
+LOCAL_C TInt PanicStackModifiedFn(TAny* aNopFn)
 	{
 	__UHEAP_MARK;
 	CTrapCleanup* cleanup = CTrapCleanup::New();
 
+	aNopFn = NULL;		//avoid warnings for unused "aNopFn" variable
+
 	TInt err = KErrNoMemory;
 
 	RDebug::Printf("PanicStackModifiedFn(): call TRAP(err, ModifyStack())");
@@ -1091,11 +1091,9 @@
 // when we do the cleanup. This test only works in debug mode.
 //
 	__UHEAP_FAILNEXT(1);
+	TRAPD(r,pC->PushL(p6));
 #if defined(_DEBUG)
-	TRAPD(r,pC->PushL(p6));
 	test(r==KErrNoMemory);
-#else
-	TRAP_IGNORE(pC->PushL(p6));
 #endif
 	__UHEAP_CHECK(KInitialCount+6);
 	pC->PopAndDestroyAll();
@@ -1302,7 +1300,7 @@
 // A cleanup operation which uses a trap harness and the cleanup stack
 //
 	{
-	TRAP_IGNORE(useCleanupStackL());
+	TRAPD(ignore,useCleanupStackL())
 	}
 
 LOCAL_C void addReentrantItemL()
@@ -1426,7 +1424,7 @@
 	test.Next(_L("Check the object has closed"));
 	__KHEAP_CHECK(0);
 
-	TRAP_IGNORE(testAutoCloseL());
+	TRAPD(r, testAutoCloseL());
 	test.Next(_L("Check object has been closed and cleaned up after leave"));
 	__KHEAP_MARKEND;
 	test.End();
@@ -1542,70 +1540,6 @@
 	test.End();
 	}
 
-void testCCleanupNewL()
-	{
-	// don't want just in time debugging as we trap panics
-	TBool justInTime=User::JustInTime(); 
-	User::SetJustInTime(EFalse); 
-
-	// no need to test otherwise, since this calls only
-	// CCleanup::New and that has been tested.
-	test.Start(_L("Create cleanup NewL"));
-	CCleanup* pC=CCleanup::NewL();
-	test(pC!=NULL);
-	delete pC;
-
-	TAny* ptrTable[KTableSize];
-	TInt allocSize=sizeof(CCleanup);
-	TAny* ptr=0;
-
-	__UHEAP_MARK;
-
-	TInt i=0;
-	// first alloc 4Kb bits
-	do
-		{
-		ptr=User::Alloc(0x1000);
-		if(ptr!=NULL)
-			{
-			ptrTable[i]=ptr;
-			i++;
-			}
-		}
-		while (ptr!=NULL && i<KTableSize);
-
-	// then eat memory with size of CCleanup object granurality
-	do
-		{
-		ptr=User::Alloc(allocSize);
-		if(ptr!=NULL)
-			{
-			ptrTable[i]=ptr;
-			i++;
-			}
-		}
-		while (ptr!=NULL && i<KTableSize);
-	
-	i--; // last one failed, so lets adjust this to last successfull entry
-
-	TInt r=KErrNone;
-	test.Next(_L("Create cleanup NewL while no room in heap"));
-	TRAP(r,pC=CCleanup::NewL());
-	test_Equal(KErrNoMemory,r);
-
-	for (;i>=0;i--)
-		{
-		User::Free(ptrTable[i]);
-		}
-	
-	__UHEAP_MARKEND;
-
-	//restore settings
-	User::SetJustInTime(justInTime); 
-
-	test.End();
-	}
-
 GLDEF_C TInt E32Main()
     {
 	test.Title();
@@ -1665,11 +1599,6 @@
 	test.Next(_L("Test TRAP_IGNORE"));
 	testTrapIgnore();
 
-	test.Next(_L("Test CCleanup::NewL"));
-	testCCleanupNewL();
-
-	delete pT;
-
 	test.End();
 	return(0);
     }
--- a/kerneltest/e32test/system/t_inact.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/system/t_inact.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -198,12 +198,13 @@
 
 void TestNonPositiveTimeout()
 	{
+	TInt ret;
 	TRequestStatus x1,x2;
 	RTimer rt1,rt2;
 
 	test.Next(_L("Test RTimer::Inactivity() with zero timeout"));
-	rt1.CreateLocal();
-	rt2.CreateLocal();
+	ret=rt1.CreateLocal();
+	ret=rt2.CreateLocal();
 
 	rt1.Inactivity(x1, 2);
 	User::After(500000);
--- a/kerneltest/e32test/system/t_inf.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/system/t_inf.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -43,7 +43,7 @@
 // Test the HAL info.
 //
 	{
-	test.Next(_L("Test UserHal::MemoryInfo"));
+
     TInt pageSize=0;
     UserHal::PageSizeInBytes(pageSize);
 
@@ -56,43 +56,55 @@
 	TInt freeMem=memoryInfo.iFreeRamInBytes;
 #endif
 	TInt8* someMem = new TInt8[0x4000];
-	// make an access to each page in order to get pages actually allocated also on data paged systems
-	someMem[0]=1;
-	someMem[0x1000]=2;
-	someMem[0x2000]=3;
-	someMem[0x3000]=4;
  	UserHal::MemoryInfo(membuf);
 	delete someMem;
 #if !defined(__WINS__)
-	if (!(freeMem>memoryInfo.iFreeRamInBytes))
-		test.Printf(_L("Warning: free RAM value didn't go down"));
+	test(freeMem>memoryInfo.iFreeRamInBytes);
 #endif
 
     test.Printf(_L("Total RAM size= %- 5dKBytes      : Free RAM size   = %- 5dKBytes\n"),memoryInfo.iTotalRamInBytes/1024,memoryInfo.iFreeRamInBytes/1024);
     test.Printf(_L("Max free RAM  = %- 5dKBytes      : ROM size        = %- 5dKBytes\n"),memoryInfo.iMaxFreeRamInBytes/1024,memoryInfo.iTotalRomInBytes/1024);
 	test.Printf(_L("RAM disk size = %- 5dKBytes\n"),memoryInfo.iInternalDiskRamInBytes/1024);
 
-	test.Next(_L("Test UserHal::MachineInfo"));
-
     TMachineInfoV2Buf mbuf;
     UserHal::MachineInfo(mbuf);
     TMachineInfoV2& machineInfo=*(TMachineInfoV2*)mbuf.Ptr();
 
-    TName tn = machineInfo.iRomVersion.Name();
+        TName tn = machineInfo.iRomVersion.Name();
  	test.Printf(_L("Page Size     = %- 16d : Rom version     = %- 16S\n"),pageSize,&tn);
    	test.Printf(_L("ScreenOffsetX = %- 16d : ScreenOffsetY   = %- 16d\n"),machineInfo.iOffsetToDisplayInPixels.iX,machineInfo.iOffsetToDisplayInPixels.iY);
    
-    TBool password=EFalse; // Password::IsEnabled(); This API was removed by __SECURE_API__
+        TBool password=EFalse; // Password::IsEnabled(); This API was removed by __SECURE_API__
   
-    TPtrC t1=onOff(password);
-    TPtrC t2=yesNo(machineInfo.iBacklightPresent);
-
+        TPtrC t1=onOff(password);
+        TPtrC t2=yesNo(machineInfo.iBacklightPresent);
  	test.Printf(_L("Password      = %- 16S : BacklightPresent= %S\n"),&t1,&t2);
 	test.Printf(_L("LanguageIndex = %- 16d : KeyboardIndex   = %d\n"),machineInfo.iLanguageIndex,machineInfo.iKeyboardIndex);
 
-	test.Next(_L("Test deprecated UserHal::RomInfo API"));
 	TRomInfoV1Buf rombuf;
-	test(UserHal::RomInfo(rombuf)==KErrNotSupported); // kernel side API has been deprecated
+	TRomInfoV1& rom=rombuf();
+	if (UserHal::RomInfo(rombuf)==KErrNone)		// KErrNotSupported in WINS
+		{
+		test.Getch();
+		TInt i, j;
+		j=0;
+		for( i=2; i<8; i++ )
+			{
+			j |= rom.iEntry[i].iSize;
+			j |= rom.iEntry[i].iWidth;
+			j |= rom.iEntry[i].iSpeed;
+			j |= (TInt)rom.iEntry[i].iType;
+			}
+		test(j==0);		// check that CS2-7 entries left blank
+		test.Printf(_L("CS0 ROM size      %08X\n"), rom.iEntry[0].iSize );
+		test.Printf(_L("CS0 ROM width     %d\n"), rom.iEntry[0].iWidth );
+		test.Printf(_L("CS0 ROM speed     %d\n"), rom.iEntry[0].iSpeed );
+		test.Printf(_L("CS0 ROM type      %d\n"), rom.iEntry[0].iType );
+		test.Printf(_L("CS1 ROM size      %08X\n"), rom.iEntry[1].iSize );
+		test.Printf(_L("CS1 ROM width     %d\n"), rom.iEntry[1].iWidth );
+		test.Printf(_L("CS1 ROM speed     %d\n"), rom.iEntry[1].iSpeed );
+		test.Printf(_L("CS1 ROM type      %d\n"), rom.iEntry[1].iType );
+		}
 	}
 
 GLDEF_C TInt E32Main()
@@ -100,10 +112,10 @@
 // Display system information
 //
     {
+
 	test.Title();
-	test.Start(_L("Test UserHal info APIs"));
 	testInfo();
-	test.End();
+    test.Getch();
 	return(KErrNone);
     }
 
--- a/kerneltest/e32test/system/t_khal.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,278 +0,0 @@
-// 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:
-// e32test\system\t_khal.cpp
-// Overview:
-// Test class Kern HAL APIs
-// API Information:
-// Kern::AddHalEntry(), Kern::RemoveHalEntry(), Kern::FindHalEntry()
-// Details:
-// - Adds a new HAL handler for EHalGroupPlatformSpecific2
-// - Tries to add handler for an existing group
-// - Calls the installed handler
-// - Tests Find API to find the installed handler 
-// - Removes the handler and tries to remove some fixed HAL group
-// - Tries to find removed handler
-// - Tries to call removed handler
-// Platforms/Drives/Compatibility:
-// All.
-// Assumptions/Requirement/Pre-requisites:
-// Failures and causes:
-// Base Port information:
-// 
-//
-
-#define __E32TEST_EXTENSION__
-
-#include <e32test.h>
-#include <e32hal.h>
-#include <u32hal.h>
-#include <e32svr.h>
-#include "d_khal.h"
-#include <hal.h>
-
-RLddKHalTest gLdd;
-GLDEF_D RTest test(_L("T_KHAL - class Kern HAL API test"));
-
-
-TBool gEntryForDevice0Registered; // indicator whether the device0 got registered
-TBool gEntryForDeviceXRegistered; // indicator whether the deviceX got registered
-TInt gTestDeviceNumber;			  // device number that was registered
-
-
-void TestAddHalHandler()
-	{
-	TInt r;
-
-	// Try to register PlatformSpecific2 handler for Device 0
-	test.Next(_L("Register new HAL handler - device 0"));
-	r=gLdd.AddHalEntryDevice0();
-	// we dont want to test() the value, since it might actually not be able to register the
-	// default device, if one already exists in the system
-	if (r==KErrNone)
-		{
-		gEntryForDevice0Registered=ETrue;
-		}
-	else
-		{
-		gEntryForDevice0Registered=EFalse;
-		test.Printf(_L("Couldn't register handler for device 0 (r=%d). Some test cases will not be executed"),r);
-		}
-	// lets try again for device0 if succeeded for the first time, should return error
-	if (gEntryForDevice0Registered)
-		{
-		test.Next(_L("Try to register new HAL handler again for Device0"));
-		test_Equal(KErrInUse,gLdd.AddHalEntryDevice0());
-		}
-
-	// Try to register PlatformSpecific2 handler for Device X. Trying for multiple devices, so
-	// it's highly unlikely that baseport has added this many devices for this group.
-	test.Next(_L("Register new HAL handler - device X"));
-	
-	r=gLdd.AddHalEntryDeviceX();
-	if (r==KErrNone)
-		{
-		gEntryForDeviceXRegistered = ETrue;
-		}
-	else
-		{
-		gEntryForDeviceXRegistered = EFalse;
-		test.Printf(_L("FAILED to register any device for EHalGroupPlatformSpecific2 (r=%d). Some test cases will not be executed"),r);
-		}
-
-    test_Value(r, (r==KErrNone || r==KErrInUse)); // this should not fail, but if it does, print indication
-
-	if (gEntryForDeviceXRegistered)
-		{
-		gTestDeviceNumber=gLdd.GetRegisteredDeviceNumber();
-		test(gTestDeviceNumber != KErrNotFound);
-		}
-
-	test.Next(_L("Try to register new HAL handler for fixed group (EHalGroupKernel) - should not be possible"));
-	test_Equal(KErrArgument,gLdd.AddHalEntryForExistingFixed());
-	}
-
-void TestCallHalHandler()
-	{
-	test.Next(_L("Call HAL handler function - device 0"));
-	if (gEntryForDevice0Registered)
-		{
-		test_KErrNone(UserSvr::HalFunction(EHalGroupPlatformSpecific2,RLddKHalTest::ETestHalFunc,0,0));
-		}
-	else
-		{
-		test.Printf(_L("Didn't try to call handler for device 0, since it wasn't registered in the beginning"));
-		}
-
-	test.Next(_L("Call HAL handler function - device X"));
-	if (gEntryForDeviceXRegistered)
-		{
-		test_KErrNone(UserSvr::HalFunction(EHalGroupPlatformSpecific2,RLddKHalTest::ETestHalFunc,0,0,gTestDeviceNumber));
-		}
-	else
-		{
-		test.Printf(_L("Didn't try to call handler for device x, since it wasn't registered in the beginning"));
-		}
-	}
-
-void TestCallRemovedHalHandler()
-	{
-	TInt r;
-
-	test.Next(_L("Call removed HAL handler function - device 0"));
-	if (gEntryForDevice0Registered)
-		{
-		r=UserSvr::HalFunction(EHalGroupPlatformSpecific2,RLddKHalTest::ETestHalFunc,0,0);
-		test_Compare(r, !=, KErrNone);
-		}
-	else
-		{
-		test.Printf(_L("Didn't try to call removed handler for device 0, since it wasn't registered in the beginning"));
-		}
-
-	test.Next(_L("Call removed HAL handler function - device X"));
-	if (gEntryForDeviceXRegistered)
-		{
-		r=UserSvr::HalFunction(EHalGroupPlatformSpecific2,RLddKHalTest::ETestHalFunc,0,0,gTestDeviceNumber);
-		test_Compare(r, !=, KErrNone);
-		}
-	else
-		{
-		test.Printf(_L("Didn't try to call removed handler for device x, since it wasn't registered in the beginning"));
-		}
-	}
-
-void TestFindHalHandler()
-	{
-	test.Next(_L("Try with one parameter find (device 0) for own handler"));
-	if (gEntryForDevice0Registered)
-		{
-		test_KErrNone(gLdd.FindHalEntryDevice0());
-		}
-	else
-		{
-		test.Printf(_L("Didn't try to find handler for device 0, since it wasn't registered in the beginning"));
-		}
-
-	test.Next(_L("Try with one parameter find (device 0) for an existing group"));
-	test_KErrNone(gLdd.FindHalEntryDevice0Other()); // should find because trying to get EHalGroupKernel, which must exist
-
-	test.Next(_L("Try with two parameter find (device x)"));
-	if (gEntryForDeviceXRegistered)
-		{
-		test_KErrNone(gLdd.FindHalEntryDeviceX()); // should find because handler for device x has been registered
-		}
-	else
-		{
-		test.Printf(_L("Didn't try to find handler for device X, since it wasn't registered in the beginning"));
-		}
-	}
-
-void TestRemoveHalHandler()
-	{
-	test.Next(_L("Remove HAL handler - device 0"));
-	if (gEntryForDevice0Registered)
-		{
-		test_KErrNone(gLdd.RemoveHalEntryDevice0());
-		}
-	else
-		{
-		test.Printf(_L("Didn't try to remove handler for device 0, since it wasn't registered in the beginning"));
-		}
-
-	test.Next(_L("Remove HAL handler - device X"));
-	if (gEntryForDeviceXRegistered)
-		{
-		test_KErrNone(gLdd.RemoveHalEntryDeviceX());
-		}
-	else
-		{
-		test.Printf(_L("Didn't try to remove handler for device x, since it wasn't registered in the beginning"));
-		}
-
-	test.Next(_L("Remove fixed HAL handler (EHalGroupKernel) - should not be possible"));
-	test_Equal(KErrArgument,gLdd.RemoveHalEntryExistingFixed());
-	}
-
-void TestFindRemovedHalHandler()
-	{
-	test.Next(_L("Try with one parameter find (device 0) for removed handler"));
-	if (gEntryForDevice0Registered)
-		{
-		test_Equal(KErrNotFound,gLdd.FindHalEntryDevice0());
-		}
-	else
-		{
-		test.Printf(_L("didn't try to find removed HAL handler for device 0 since it wasn't registered in the beginning"));
-		}
-
-	test.Next(_L("Try with two parameter find (device x) for removed handler"));
-	if (gEntryForDeviceXRegistered)
-		{
-		test_Equal(KErrNotFound,gLdd.FindHalEntryDeviceX());
-		}
-	else
-		{
-		test.Printf(_L("didn't try to find removed HAL handler for device X since it wasn't registered in the beginning"));
-		}
-	}
-
-void LoadDeviceDriver()
-	{
-	test_KErrNone(User::LoadLogicalDevice(KLddName));
-	test_KErrNone(gLdd.Open());
-	}
-
-void UnLoadDeviceDriver()
-	{
-	gLdd.Close();
-	test_KErrNone(User::FreeLogicalDevice(KLddName));
-	}
-
-
-GLDEF_C TInt E32Main()
-//
-// Test Kern HAL API
-//
-	{
-	test.Title();
-
-	test.Start(_L("Test class Kern HAL API functions"));
-	// load the driver
-	LoadDeviceDriver();
-
-	// add handlers for default device (0) and Device X
-	TestAddHalHandler();
-	
-	// call handlers that were managed to register
-	TestCallHalHandler();
-
-	// test find APIs
-	TestFindHalHandler();
-
-	// test removal of HAL handlers
-	TestRemoveHalHandler();
-
-	// test find APIs for removed handlers
-	TestFindRemovedHalHandler();
-
-	// try to call removed handlers
-	TestCallRemovedHalHandler();
-
-	// unload the driver
-	UnLoadDeviceDriver();
-
-	test.End();
-	test.Close();
- 	return(KErrNone);
-    }
--- a/kerneltest/e32test/system/t_panic.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/system/t_panic.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -27,9 +27,7 @@
 	RUndertaker u;
 	TInt r=u.Create();
 	test(r==KErrNone);
-	//to avoid RVCT4 warning of unreachable statement.
-	volatile TInt forever = 0;
-	while(forever)
+	FOREVER
 		{
 		TInt h;
 		TRequestStatus s;
--- a/kerneltest/e32test/system/t_prot.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/system/t_prot.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -49,6 +49,7 @@
 void DoUndefinedInstruction();
 
 const TInt KHeapSize=0x200;
+const TInt KThreadReturnValue=9999;
 
 _LIT(KLitKernExec,"KERN-EXEC");
 
@@ -425,6 +426,7 @@
 	User::WaitForRequest(s);
 	}
 
+_LIT(KLitUserCBase,"E32USER-CBase");
 GLDEF_C TInt E32Main()
 //
 // Main
--- a/kerneltest/e32test/system/t_reason2.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-// 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:
-// e32test\system\t_reason2.cpp
-// Overview:
-// Tests system startup reason HAL functions and exception info functions:
-// API Information:
-// UserHal::StartupReason() (deprecated), HAL:.Get(ESystemStartupReason,..),
-// UserHal::FaultReason, UserHal::ExceptionId and UserHal::ExceptionInfo
-// Details:
-// - Asks system startup reason from user hal
-// - Asks system startup reason with replacing hal::get method
-// - Asks Exception info
-// Platforms/Drives/Compatibility:
-// All.
-// Assumptions/Requirement/Pre-requisites:
-// Failures and causes:
-// Base Port information:
-// 
-//
-#define __E32TEST_EXTENSION__
-
-#include <e32hal.h>
-#include <e32test.h>
-#include <hal.h>
-#include <u32hal.h>
-#include <e32svr.h>
-
-LOCAL_D RTest test(_L("T_REASON2"));
-
-TInt gSysReason=KErrNotSupported;
-
-void GetSysStartupReason()
-	{
-	test.Next(_L("Get startup reason using (deprecated) UserHal::StartupReason API"));
-
-	TMachineStartupType reason;
-
-	test_KErrNone(UserHal::StartupReason(reason));
-	switch (reason)
-		{
-		case EStartupCold:			RDebug::Print(_L("Cold Start    ")); break;
-		case EStartupColdReset: 	RDebug::Print(_L("Cold Reset    ")); break;
-		case EStartupNewOs: 		RDebug::Print(_L("New OS        ")); break;
-		case EStartupPowerFail:		RDebug::Print(_L("Power failed  ")); break;
-		case EStartupWarmReset:		RDebug::Print(_L("Warm Reset    ")); break;
-		case EStartupKernelFault:	RDebug::Print(_L("Kernel fault  ")); break;
-		case EStartupSafeReset:		RDebug::Print(_L("Safe Reset    ")); break;
-		default:
-			RDebug::Print(_L("<?reason=%d>  "), reason);
-			test(EFalse); // fail, unknown reason returned
-			break;
-		}
-
-	// test the replacing API
-	TInt r=KErrNone;
-	test.Next(_L("Get system startup reason using HAL::Get()"));
-	r=HAL::Get(HAL::ESystemStartupReason,gSysReason);
-#if defined(__WINS__)
-	test(r=KErrNotSupported);
-#else
-	test_KErrNone(r);
-	switch (gSysReason)
-		{
-		case HAL::ESystemStartupReason_Cold:	RDebug::Print(_L("reason:Cold ")); break;
-		case HAL::ESystemStartupReason_Warm:	RDebug::Print(_L("reason:Warm ")); break;
-		case HAL::ESystemStartupReason_Fault: 	RDebug::Print(_L("reason:Fault")); break;
-		default:
-			RDebug::Print(_L("<?reason=%d>  "), gSysReason);
-			test(EFalse); // fail, unknown reason returned
-			break;
-		}
-#endif
-	}
-
-void GetExceptionInfo()
-	{
-	test.Next(_L("Get exception ID"));
-	TInt exceptno;
-	TInt faultno;
-
-	TExcInfo exceptInfo;
-	test_KErrNone(UserHal::ExceptionId(exceptno));
-				
-	test.Next(_L("Get exception info"));
-	test_KErrNone(UserHal::ExceptionInfo(exceptInfo));
-
-	test.Next(_L("Get fault reason"));
-	test_KErrNone(UserHal::FaultReason(faultno));
-
-	if (gSysReason==HAL::ESystemStartupReason_Warm || gSysReason==HAL::ESystemStartupReason_Fault)
-		{
-		RDebug::Print(_L("(last exception %d: code %08x data %08x) "), exceptno, exceptInfo.iCodeAddress,exceptInfo.iDataAddress);
-		}
-				
-	if (gSysReason==HAL::ESystemStartupReason_Fault)
-		{
-		if (faultno == 0x10000000)
-			{
-			RDebug::Print(_L("Kernel Exception  "));
-			}
-		else
-			{
-			if (faultno >= 0x10000)
-				{
-				RDebug::Print(_L("Kernel PANIC: %d  "), faultno-0x10000);
-				}
-			else
-				{
-				RDebug::Print(_L("Kernel FAULT: %d  "), faultno);
-				}
-			}
-		}
-	}
-
-TInt E32Main()
-	{
-	test.Title();
-
-	test.Start(_L("Test startup reasons from Hal"));
-
-	// test startup reason
-	GetSysStartupReason();
-
-	// test exception and fault info UserHal functions
-	GetExceptionInfo();
-
-	test.End();
-
-	return KErrNone;
-	}
--- a/kerneltest/e32test/thread/t_killer.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/thread/t_killer.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -94,14 +94,14 @@
 
 // CTestServer functions
 
-EXPORT_C CTestServer::CTestServer(TInt aPriority) 
+CTestServer::CTestServer(TInt aPriority) 
 //
 // Constructor - sets name
 //
 	: CServer2(aPriority)
 	{}
 
-EXPORT_C  CSession2* CTestServer::NewSessionL(const TVersion& aVersion, const RMessage2 &) const
+CSession2* CTestServer::NewSessionL(const TVersion& aVersion, const RMessage2 &) const
 //
 // Virtual fn - checks version supported and creates a CTestSession
 //
@@ -213,7 +213,7 @@
 			messagePtrs[count2].Complete(10-count2*2);
 	}
 
-EXPORT_C  void CTestSession::ServiceL(const RMessage2& aMessage)
+void CTestSession::ServiceL(const RMessage2& aMessage)
 //
 // Virtual message-handler
 //
--- a/kerneltest/e32test/thread/t_thread.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/thread/t_thread.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -601,8 +601,7 @@
 		test(thread.ExitCategory()==_L("panic"));
 		test(thread.ExitReason()==123);
 		test(thread.ExitType()==EExitPanic);
-		r = RTest::CloseHandleAndWaitForDestruction(thread);
-		test_KErrNone(r);
+		CLOSE_AND_WAIT(thread);
 		}
 	
 	test.Next(_L("Internal exit"));
--- a/kerneltest/e32test/timestamp/d_timestamp.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,461 +0,0 @@
-// 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:
-// d_timestamp.cpp
-//
-
-#include <kern_priv.h>
-#include <kernel.h>
-#include "d_timestamp.h"
-#include "d_timestamp_dev.h"
-
-// time stamp test defaults
-static const TInt KTimerDurationS = 5;  // time interval for NTimer
-static const TInt KNErrPercent = 1;  // percent error acceptable
-static const TInt KIterations = 5;  // required number of valid runs (with LPM entry) 
-static const TInt KRetries = 4;  // retries are reset on every succesful run
-
-//
-// DTimestampTestFactory
-//
-
-/**
-   Standard export function for LDDs. This creates a DLogicalDevice derived object,
-   in this case, our DTimestampTestFactory
-*/
-DECLARE_STANDARD_LDD()
-	{
-	return new DTimestampTestFactory;
-	}
-
-/**
-   Constructor
-*/
-DTimestampTestFactory::DTimestampTestFactory()
-	{
-	// Set version number for this device
-	iVersion=RTimestampTest::VersionRequired();
-    // Indicate that we work with a PDD
-	iParseMask=KDeviceAllowPhysicalDevice;
-    }
-
-/**
-   Second stage constructor for DTimestampTestFactory.
-   This must at least set a name for the driver object.
-
-   @return KErrNone if successful, otherwise one of the other system wide error codes.
-*/
-TInt DTimestampTestFactory::Install()
-	{
-	return SetName(&RTimestampTest::Name());
-	}
-
-/**
-   Destructor
-*/
-DTimestampTestFactory::~DTimestampTestFactory()
-	{
-    
-    }
-
-/**
-   Return the drivers capabilities.
-   Called in the response to an RDevice::GetCaps() request.
-
-   @param aDes User-side descriptor to write capabilities information into
-*/
-void DTimestampTestFactory::GetCaps(TDes8& aDes) const
-	{
-	// Create a capabilities object
-	RTimestampTest::TCaps caps;
-	caps.iVersion = iVersion;
-	// Write it back to user memory
-	Kern::InfoCopy(aDes,(TUint8*)&caps,sizeof(caps));
-	}
-
-
-/**
-   Called by the kernel's device driver framework to create a Logical Channel.
-   This is called in the context of the user thread (client) which requested the creation of a Logical Channel
-   (E.g. through a call to RBusLogicalChannel::DoCreate)
-   The thread is in a critical section.
-
-   @param aChannel Set to point to the created Logical Channel
-
-   @return KErrNone if successful, otherwise one of the other system wide error codes.
-*/
-TInt DTimestampTestFactory::Create(DLogicalChannelBase*& aChannel)
-	{
-	aChannel=new DTimestampTestChannel;
-	if(!aChannel)
-        {
-		return KErrNoMemory;
-        }
-    
-	return KErrNone;
-	}
-
-
-//
-// Logical Channel
-//
-
-/**
-   Constructor
-*/
-DTimestampTestChannel::DTimestampTestChannel()
-    :iTimer(timerExpire,this),iDfc(dfcFn,this,7),iStarted(EFalse)
-	{
-	// Get pointer to client threads DThread object
-	iClient=&Kern::CurrentThread();
-	// Open a reference on client thread so it's control block can't dissapear until
-	// this driver has finished with it.
-	// Note, this call to Open can't fail since its the thread we are currently running in
-	iClient->Open();
-	}
-
-/**
-   Second stage constructor called by the kernel's device driver framework.
-   This is called in the context of the user thread (client) which requested the creation of a Logical Channel
-   (E.g. through a call to RBusLogicalChannel::DoCreate)
-   The thread is in a critical section.
-
-   @param aUnit The unit argument supplied by the client to RBusLogicalChannel::DoCreate
-   @param aInfo The info argument supplied by the client to RBusLogicalChannel::DoCreate
-   @param aVer The version argument supplied by the client to RBusLogicalChannel::DoCreate
-
-   @return KErrNone if successful, otherwise one of the other system wide error codes.
-*/
-TInt DTimestampTestChannel::DoCreate(TInt /*aUnit*/, const TDesC8* /*aInfo*/, const TVersion& aVer)
-	{
-	// Check version
-	if (!Kern::QueryVersionSupported(RTimestampTest::VersionRequired(),aVer))
-		return KErrNotSupported;
-
-	// Setup LDD for receiving client messages
-    TInt r = Kern::CreateClientRequest(iStartRequest);
-    if (r != KErrNone) return r;
-    r = Kern::CreateClientDataRequest(iWaitOnTimerRequest);
-    if (r != KErrNone) return r;
-    r = Kern::DynamicDfcQCreate(iQue,Kern::DfcQue0()->iThread->iPriority,RTimestampTest::Name());
-    if (KErrNone!=r) return r;
-    iDfc.SetDfcQ(iQue);
-    SetDfcQ(iQue);
-    iMsgQ.Receive();
-    // Done
-	return KErrNone;
-	}
-
-
-/**
-   Destructor
-*/
-DTimestampTestChannel::~DTimestampTestChannel()
-	{
-	// Cancel all processing that we may be doing
-	DoCancel(TUint(RTimestampTest::EAllRequests));
-    Kern::DestroyClientRequest(iWaitOnTimerRequest);
-    Kern::DestroyClientRequest(iStartRequest);
-    iQue->Destroy();
-	// Close our reference on the client thread
-	Kern::SafeClose((DObject*&)iClient,NULL);
-	}
-
-/**
-   Called when a user thread requests a handle to this channel.
-*/
-TInt DTimestampTestChannel::RequestUserHandle(DThread* aThread, TOwnerType aType)
-	{
-	// Make sure that only our client can get a handle
-	if (aType!=EOwnerThread || aThread!=iClient)
-		return KErrAccessDenied;
-	return KErrNone;
-	}
-
-/**
-   override SendMsg method to allow pinning data in the context of the client thread
-*/
-TInt DTimestampTestChannel::SendMsg(TMessageBase* aMsg)
-	{
-	TThreadMessage& m=*(TThreadMessage*)aMsg;
-    TInt id = m.iValue;
-
-	// we only support one client
-	if (id != (TInt)ECloseMsg && m.Client() != iClient)
-		return KErrAccessDenied;
-	
-	TInt r = KErrNone;
-	if (id != (TInt)ECloseMsg && id != KMaxTInt)
-		{
-		if (id<0)
-			{
-			TRequestStatus* pS=(TRequestStatus*)m.Ptr0();
-			r = SendRequest(aMsg);
-			if (r != KErrNone)
-				Kern::RequestComplete(pS,r);
-			}
-		else
-			r = SendControl(aMsg);
-		}
-	else
-		r = DLogicalChannel::SendMsg(aMsg);
-	
-	return r;
-	}
-
-/**
-   Process a message for this logical channel.
-   This function is called in the context of a DFC thread.
-
-   @param aMessage The message to process.
-   The iValue member of this distinguishes the message type:
-   iValue==ECloseMsg, channel close message
-   iValue==KMaxTInt, a 'DoCancel' message
-   iValue>=0, a 'DoControl' message with function number equal to iValue
-   iValue<0, a 'DoRequest' message with function number equal to ~iValue
-*/
-void DTimestampTestChannel::HandleMsg(TMessageBase* aMsg)
-	{
-	TThreadMessage& m=*(TThreadMessage*)aMsg;
-
-	// Get message type
-	TInt id=m.iValue;
-
-	// Decode the message type and dispatch it to the relevent handler function...
-
-	if (id==(TInt)ECloseMsg)
-		{
-		// Channel Close
-        DoCancel(TUint(RTimestampTest::EAllRequests));
-        iMsgQ.CompleteAll(KErrServerTerminated);
-		m.Complete(KErrNone, EFalse);
-		return;
-		}
-
-	if (id==KMaxTInt)
-		{
-		// DoCancel
-		DoCancel(m.Int0());
-		m.Complete(KErrNone,ETrue);
-		return;
-		}
-
-	if (id<0)
-		{
-		// DoRequest
-		TRequestStatus* pS=(TRequestStatus*)m.Ptr0();
-		DoRequest(~id,pS,m.Ptr1(),m.Ptr2());
-		m.Complete(KErrNone,ETrue);
-		}
-	else
-		{
-		// DoControl
-		TInt r=DoControl(id,m.Ptr0(),m.Ptr1());
-		m.Complete(r,ETrue);
-		}
-	}
-
-/**
-   Preprocess synchronous 'control' requests
-*/
-TInt DTimestampTestChannel::SendControl(TMessageBase* aMsg)
-	{
-	TThreadMessage& m=*(TThreadMessage*)aMsg;
-    TInt id=m.iValue;
-
-	switch (id)
-		{
-        
-    case RTimestampTest::EConfig:
-        {
-        STimestampTestConfig info;
-#ifdef __SMP__
-        info.iFreq = NKern::TimestampFrequency();
-#else
-        info.iFreq = NKern::FastCounterFrequency();
-#endif
-        info.iIterations = KIterations;
-        info.iRetries = KRetries;
-        info.iTimerDurationS = KTimerDurationS;
-        info.iErrorPercent = KNErrPercent;
-        // Allow PDD to override defaults
-        Pdd().TestConfig(info);
-        kumemput(m.Ptr0(),&info,sizeof(STimestampTestConfig));
-        return KErrNone;
-		}
-    
-        }
-    
-
-	TInt r = DLogicalChannel::SendMsg(aMsg);
-	if (r != KErrNone)
-		return r;
-
-// 	switch (id)
-// 		{
-// 		}
-
-	return r;
-	}
-
-/**
-   Process synchronous 'control' requests
-*/
-TInt DTimestampTestChannel::DoControl(TInt aFunction, TAny* a1, TAny* a2)
-	{
-	(void)a2;   
-	(void)a1;   
-	(void) aFunction;
-
-	// TInt r = KErrNone;
-	// switch (aFunction)
-	// 	{
-    // default:
-    //     r = KErrNotSupported;
-	// 	}
-
-	return KErrNotSupported;
-	}
-
-
-/**
-   Preprocess asynchronous requests.
-*/
-TInt DTimestampTestChannel::SendRequest(TMessageBase* aMsg)
-    {
-	TThreadMessage& m=*(TThreadMessage*)aMsg;
-    TInt function = ~m.iValue;
-    TRequestStatus* pS=(TRequestStatus*)m.Ptr0();
-		
-	TInt r = KErrNotSupported;
-
-	switch (function)
-		{
-		case RTimestampTest::EStart:
-            if (!iStarted) 
-                {
-                r = iStartRequest->SetStatus(pS);
-                }
-            else 
-                {
-                r = KErrInUse;
-                }
-            break;
-            
-		case RTimestampTest::EWaitOnTimer:
-            if (iStarted)
-                {
-                iWaitOnTimerRequest->SetDestPtr(m.Ptr1());
-                r = iWaitOnTimerRequest->SetStatus(pS);
-                }
-            else
-                {
-                r = KErrNotReady;
-                }
-            
-            break;
-        default:
-            r = KErrNotSupported;
-		}
-
-	if (r == KErrNone)
-		r = DLogicalChannel::SendMsg(aMsg);
-	return r;
-    }
-
-
-/**
-   Process asynchronous requests.
-*/
-void DTimestampTestChannel::DoRequest(TInt aReqNo, TRequestStatus* aStatus, TAny* a1, TAny* a2)
-	{
-	(void)a2;   
-	(void)a1;   
-    (void)aStatus;
-    
-	TInt r = KErrNone;
-
-	switch(aReqNo)
-		{
-    case RTimestampTest::EStart:
-        iNTicks = (TInt) a1;
-        r = iTimer.OneShot(0);
-        if (KErrNone!=r) Kern::QueueRequestComplete(iClient,iStartRequest,r);
-        break;
-    case RTimestampTest::EWaitOnTimer:
-        Pdd().StartLPMEntryCheck();   // PDD will start checking if we have entered LPM
-        r = iTimer.Again(iNTicks);
-        if (KErrNone!=r) Kern::QueueRequestComplete(iClient,iWaitOnTimerRequest,r);
-        break;
-		}
-    
-	}
-
-
-
-/**
-   Process cancelling of asynchronous requests.
-*/
-void DTimestampTestChannel::DoCancel(TUint aMask)
-	{
-    (void)aMask;
-    iTimer.Cancel(); // no real guarantees on SMP systems
-    iDfc.Cancel();
-	}
-
-
-/**
- * process timer expiry
-*/
-void DTimestampTestChannel::DoTimerExpire()
-	{
-#ifdef __SMP__
-    TUint64 ts = NKern::Timestamp();
-#else
-    TUint64 ts = NKern::FastCounter();
-#endif
-    iTimestampDelta = ts-iLastTimestamp;
-    iLastTimestamp = ts;
-    iDfc.Add();
-	}
-
-void DTimestampTestChannel::timerExpire(TAny* aParam)
-    {
-    DTimestampTestChannel* pD = (DTimestampTestChannel*) aParam;
-    pD->DoTimerExpire();
-    }
-
-
-
-void DTimestampTestChannel::DoDfcFn()
-	{
-    if (!iStarted)
-        {
-        iStarted = ETrue;
-        Kern::QueueRequestComplete(iClient,iStartRequest,KErrNone);
-        }
-    else
-        {
-        iWaitOnTimerRequest->Data().iDelta = iTimestampDelta;
-        // PDD will return ETrue here if we have entered LPM
-        iWaitOnTimerRequest->Data().iLPMEntered = Pdd().EndLPMEntryCheck(); 
-        Kern::QueueRequestComplete(iClient,iWaitOnTimerRequest,KErrNone);
-        }
-	}
-
-void DTimestampTestChannel::dfcFn(TAny* aParam)
-    {
-    DTimestampTestChannel* pD = (DTimestampTestChannel*) aParam;
-    pD->DoDfcFn();
-    }
-
--- a/kerneltest/e32test/timestamp/d_timestamp.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,179 +0,0 @@
-// 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:
-// d_timestamp.h
-//
-
-
-#ifndef __TIMESTAMPTEST_H__
-#define __TIMESTAMPTEST_H__
-
-#include <e32cmn.h>
-#include <e32ver.h>
-#ifndef __KERNEL_MODE__
-#include <e32std.h>
-#endif
-
-/*
- *  Update by driver when a every time NTimer expires
- */
-
-struct STimestampResult
-    {
-    TUint64 iDelta;   // difference in timestamp value between this and the last run
-    TBool   iLPMEntered; // true if low power modes wich restored timestamp was entered
-                         // since last NTimer expiry
-    };
-
-/*
- *  Hold time stamp information, for now just freq
- */
-
-struct STimestampTestConfig
-    {
-    TUint32 iFreq;  
-    TUint  iIterations;
-    TUint  iRetries;
-    TUint  iTimerDurationS;
-    TUint  iErrorPercent;
-    };
-
-    
-/**
-User interface for 'TimestampTest'
-*/
-class RTimestampTest : public RBusLogicalChannel
-	{
-public:
-	/**
-	Structure for holding driver capabilities information
-	(Just a version number in this example.)
-	*/
-	class TCaps
-		{
-	public:
-		TVersion iVersion;
-		};
-    static TVersion VersionRequired();
-    static const TDesC& Name();
-    
-public:
-	TInt Open();
-	void Start(TRequestStatus& aStatus, TInt aNTicks);
-    void WaitOnTimer(TRequestStatus& aStatus, STimestampResult& aResult);
-	TInt Config(STimestampTestConfig& aConfig);
-private:
-	/**
-	Enumeration of Control messages.
-	*/
-	enum TControl
-		{
-        EConfig
-		};
-
-	/**
-	Enumeration of Request messages.
-	*/
-	enum TRequest
-		{
-        EStart,
-        EWaitOnTimer,
-        EAllRequests=-1        
-		};
-
-	// Kernel side LDD channel is a friend
-	friend class DTimestampTestChannel;
-	};
-
-/**
-  The driver's name
-
-  @return The name of the driver
-
-  @internalComponent
-*/
-inline const TDesC& RTimestampTest::Name()
-	{
-	_LIT(KTimestampTestName,"TIMESTAMPTEST");
-	return KTimestampTestName;
-	}
-
-/**
-  The driver's version
-
-  @return The version number of the driver
-
-  @internalComponent
-*/
-inline TVersion RTimestampTest::VersionRequired()
-	{
-	const TInt KMajorVersionNumber=1;
-	const TInt KMinorVersionNumber=0;
-	const TInt KBuildVersionNumber=KE32BuildVersionNumber;
-	return TVersion(KMajorVersionNumber,KMinorVersionNumber,KBuildVersionNumber);
-	}
-
-/*
-  NOTE: The following methods would normally be exported from a seperate client DLL
-  but are included inline in this header file for convenience.
-*/
-
-#ifndef __KERNEL_MODE__
-
-/**
-  Open a logical channel to the driver
-  @return One of the system wide error codes.
-*/
-TInt RTimestampTest::Open()
-	{
-	return DoCreate(Name(),VersionRequired(),KNullUnit,NULL,NULL,EOwnerThread);
-	}
-
-
-/**
-  Start measuring timestamp intervals in the timer
-  @param aStatus request status for aync request
-  @param aNTicks number of ticks used with the NTimer in the driver
-*/
-void RTimestampTest::Start(TRequestStatus& aStatus, TInt aNTicks)
-	{
-	DoRequest(EStart,aStatus,(TAny*) aNTicks);
-	}
-
-
-/**
-  Wait for next timer expiry of aNTicks used in Start function
-  @param aStatus request status for aync request
-  @param aStatus request status for aync request
-  
-*/
-void RTimestampTest::WaitOnTimer(TRequestStatus& aStatus, STimestampResult& aResult)
-	{
-	DoRequest(EWaitOnTimer,aStatus,(TAny*) &aResult);
-	}
-
-
-/**
-  Open a logical channel to the driver
-  @return One of the system wide error codes.
-*/
-TInt RTimestampTest::Config(STimestampTestConfig& aConfig)
-	{
-	return DoControl(EConfig,(TAny*) &aConfig);
-	}
-
-
-#endif  // !__KERNEL_MODE__
-
-#endif
-
--- a/kerneltest/e32test/timestamp/d_timestamp_dev.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-// 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:
-// d_timestamp_dev.h
-//
-
-#ifndef __D_TIMERSTAMP_DEV_H__
-#define __D_TIMERSTAMP_DEV_H__
-
-/**
-  Logical Device (factory class) for 'TimestampTest'
-*/
-class DTimestampTestFactory : public DLogicalDevice
-	{
-public:
-	DTimestampTestFactory();
-	~DTimestampTestFactory();
-	//	Inherited from DLogicalDevice
-	virtual TInt Install();
-	virtual void GetCaps(TDes8& aDes) const;
-	virtual TInt Create(DLogicalChannelBase*& aChannel);
-	};
-
-class DTimestampTestPddChannel;
-
-/**
-  Logical Channel class for 'TimestampTest'
-*/
-class DTimestampTestChannel : public DLogicalChannel
-	{
-public:
-	DTimestampTestChannel();
-	virtual ~DTimestampTestChannel();
-	//	Inherited from DObject
-	virtual TInt RequestUserHandle(DThread* aThread, TOwnerType aType);
-	// Inherited from DLogicalChannelBase
-	virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
-	virtual void HandleMsg(TMessageBase* aMsg);
-    // intercept messages on client thread
-    virtual TInt SendMsg(TMessageBase* aMsg);
-private:
-	// Panic reasons
-	enum TPanic
-		{
-		ERequestAlreadyPending = 1
-		};
-	// Implementation for the differnt kinds of messages sent through RBusLogicalChannel
-	TInt DoControl(TInt aFunction, TAny* a1, TAny* a2);
-	void DoRequest(TInt aReqNo, TRequestStatus* aStatus, TAny* a1, TAny* a2);
-    TInt SendRequest(TMessageBase* aMsg);
-    TInt SendControl(TMessageBase* aMsg);
-	void DoCancel(TUint aMask);
-    void DoTimerExpire();
-    void DoDfcFn();
-    // Accessor for the PDD
-	inline DTimestampTestPddChannel& Pdd();
-protected:
-    
-    
-private:
-    static void timerExpire(TAny* aParam);
-    static void dfcFn(TAny* aParam);
-    DThread* iClient;
-    TDynamicDfcQue* iQue;
-    TClientDataRequest<STimestampResult> *iWaitOnTimerRequest;
-    TClientRequest *iStartRequest;
-    TInt iNTicks;
-    NTimer iTimer;
-    TDfc iDfc;
-    TUint64 iLastTimestamp;
-    TUint64 iTimestampDelta;
-    TBool iStarted;
-	};
-
-
-inline DTimestampTestPddChannel& DTimestampTestChannel::Pdd()
-	{ return *((DTimestampTestPddChannel*)iPdd); }
-
-/*
- * DTimestampTestPddChannel
- * Interface Pdd
- */
-
-
-class DTimestampTestPddChannel : public DBase
-    {
-public:
-    /*
-     * reset any variables requried to check entry into a low power mode
-     * between time of call and time at which iTimer will next expire
-     */
-    virtual void StartLPMEntryCheck() = 0;
-    /*
-     * @return ETrue if a low power modes was entered
-     */
-    virtual TBool EndLPMEntryCheck() = 0;
-    /*
-     * Provide test parameters
-     */
-    virtual void TestConfig(STimestampTestConfig& aInfo) = 0;
-    };
-
-
-
-#endif //__D_TIMERSTAMP_DEV_H__
--- a/kerneltest/e32test/timestamp/t_timestamp.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,205 +0,0 @@
-// 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:
-//  
-// This test checks the accuracy if NKern::Timestamp (in SMP systems) or
-// NKern::Fastcounter (in unicore), when low power modes are being selected
-// during idle.
-// Platforms requiring this test need to provide a d_timestamp.pdd which
-// implements the functions required to test the accurary. If no pdd is 
-// supplied the test is skipped and claims to succeed.
-// Overview:
-
-//-------------------------------------------------------------------------------------------
-//! @SYMTestCaseID				KBASE-t_timestamp-2706
-//! @SYMTestCaseDesc			verifying that NKern::Timestamp/FastCounter works correctly 
-//!                             accross low power modes
-//! @SYMPREQ					417-52765
-//! @SYMTestPriority			High
-//! @SYMTestActions				
-//! 1. This test harness first gets information about NKern::Timestamp or
-//!     NKern::FastCounter in particular its frequency. It also obtains
-//!     the following constants: Number of timer to run the test, number
-//!     of retries before giving up if no low power modes are detected,
-//!     and acceptable error percent. Length in nanokernel ticks of each cycle
-//! 2. Then it measures the timestamp before and after a time interval 
-//!    controlled by NTimerIntervalInS (constant is in seconds)
-//!    2.1 If in period of KTimerInterval a low power mode was entered and 
-//!        the timer underlying NKern::Timestamp had to be restated then before
-//!        and after time is stored. The cycle is considered successful.
-//! 3. If KNMaxentries occur with no successful entries the test fails
-//! 4. If any valid entry has an interval as measured with NKern::Timestamp that
-//!    is outside KNErrPercent of the same interval as measured with nanokernel 
-//!    ticks then the test fails
-//! 5. If KNValidRuns valid cycles have an acceptable error the test succeeds
-//! 
-//! @SYMTestExpectedResults 
-//!     test passed
-//-------------------------------------------------------------------------------------------
-
-#include <e32std.h>
-#include <e32base.h>
-#include <e32debug.h>
-#define __E32TEST_EXTENSION__
-#include <e32test.h>
-#include <hal.h>
-#include <u32hal.h>
-#include <e32svr.h>
-#include "d_timestamp.h"
-
-_LIT(KTimestampTestLddFileName,"D_TIMESTAMP.LDD");
-_LIT(KTimestampTestPddFileName,"D_TIMESTAMP.PDD");
-
-RTest test(_L("T_TIMESTAMP"));
-
-LOCAL_C void UnloadDrivers()
-	{
-    test.Printf(_L("Unloading LDD\n"));
-
-	TInt r=User::FreeLogicalDevice(RTimestampTest::Name());
-    test_KErrNone(r);
-    
-	TName pddName(RTimestampTest::Name());
-	_LIT(KPddWildcardExtension,".*");
-	pddName.Append(KPddWildcardExtension);
-	TFindPhysicalDevice findPD(pddName);
-	TFullName findResult;
-	r=findPD.Next(findResult);
-	while (r==KErrNone)
-		{
-        test.Printf(_L("Unloading PDD: %S\n"),&findResult);
-		r=User::FreePhysicalDevice(findResult);
-        test_KErrNone(r);
-		findPD.Find(pddName); // Reset the find handle now that we have deleted something from the container.
-		r=findPD.Next(findResult);
-		} 
-	}
-
-
-GLDEF_C TInt E32Main()
-    {
-
-    TBool dontFail = (User::CommandLineLength()!=0);
-    
-    test.Title();
-
-    test.Start(_L("Timestamp accuracy test"));
-    
-
-    TInt r;
-    TRequestStatus st;
-    
-    r = User::LoadPhysicalDevice(KTimestampTestPddFileName);
-    if (KErrNotFound == r)
-        {
-        test.Printf(_L("No timestamp pdd, test skipped\n"));
-        test.End(); // skip test if this platform does not supply a PDD
-        return 0;
-        }
-    
-
-	r=User::LoadLogicalDevice(KTimestampTestLddFileName);
-	test(r==KErrNone || r==KErrAlreadyExists);
-    
-    RTimestampTest ldd;
-    r = ldd.Open();
-    test_KErrNone(r);
-    
-    test.Next(_L("Get timestamp frequency"));
-    STimestampTestConfig info;
-    r = ldd.Config(info);
-    test_KErrNone(r);
-    
-
-    TUint retries = 0;
-    TUint validruns = 0;
-    
-    test.Next(_L("Get nanotick frequency"));
-	TInt tickPeriod = 0;
-	r = HAL::Get(HAL::ENanoTickPeriod, tickPeriod);
-    test_KErrNone(r);
-    test.Printf(_L(" tick period in uS== %d\n"), tickPeriod);
-
-    TInt ticks = info.iTimerDurationS*1000000/tickPeriod;
-    TUint64 expected = info.iTimerDurationS*info.iFreq;
-    TUint64 acceptError = info.iErrorPercent*expected/100;
-    
-    test.Printf(_L("running at %dHz for %d interations, each lasting %d seconds and with %d retries\n"),
-                info.iFreq,
-                info.iIterations,
-                info.iTimerDurationS,
-                info.iRetries
-        );
-    
-    test.Printf(_L("expecting %lu with up to %lu error\n"),expected,acceptError);
-
-    test.Next(_L("test timer interval"));
-    STimestampResult result;
-    STimestampResult* validResults = new STimestampResult[info.iIterations];
-    memset(&validResults[0],0,sizeof(validResults));
-    ldd.Start(st,ticks);
-    User::WaitForRequest(st);
-    test_KErrNone(st.Int());
-    
-    FOREVER
-        {
-        ldd.WaitOnTimer(st,result);
-        User::WaitForRequest(st);
-        test_KErrNone(st.Int());
-        TUint64 error = (result.iDelta>expected) ? result.iDelta-expected : expected - result.iDelta;
-
-        if (error < acceptError)
-            {
-            test.Printf(_L("Got %lu expected %lu, LPM Entered:%d, error %lu is OK \n"),
-                        result.iDelta,expected,result.iLPMEntered,error);
-            }
-        else 
-            {
-            test.Printf(_L("Got %lu expected %lu, LPM Entered:%d, error %lu is BAD\n"),
-                        result.iDelta,expected,result.iLPMEntered,error);
-            if (!dontFail) 
-                {
-                delete [] validResults;
-                ldd.Close();
-                UnloadDrivers();
-                test(error < acceptError);
-                }
-            }
-
-        if (result.iLPMEntered)
-            {
-            retries = 0;
-            validResults[validruns] = result;
-            if (++validruns==info.iIterations) break;
-            }
-        else
-            {
-            retries++;
-            if (retries==info.iRetries) 
-                {
-                test.Printf(_L("several retries with no power mode entry ... aborting ...\n"));
-                ldd.Close();
-                delete [] validResults;
-                UnloadDrivers();
-                test_Compare(retries,<,info.iRetries);
-                }
-            
-            }
-        }
-
-    delete [] validResults;
-    ldd.Close();
-    UnloadDrivers();
-    test.End();
-	return(0);
-    }
--- a/kerneltest/e32test/traces_t_usb/OstTraceDefinitions.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-// 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:
-// 
-//
-
-
-#ifndef __OSTTRACEDEFINITIONS_H__
-#define __OSTTRACEDEFINITIONS_H__
-// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
-// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
-//#define OST_TRACE_COMPILER_IN_USE
-#include <opensystemtrace.h>
-#endif
--- a/kerneltest/e32test/traces_t_usb/fixed_id.definitions	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,251 +0,0 @@
-#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
-[GROUP]TRACE_NORMAL=0x86
-[GROUP]TRACE_VERBOSE=0xde
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING=0x85
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP01=0x86
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP02=0x87
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP03=0x88
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP04=0x89
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP05=0x8a
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEDOUBLEBUFFERING_DUP06=0x8b
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEENDPOINTDMA=0x7a
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP01=0x7b
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP02=0x7c
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP03=0x7d
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP04=0x7e
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP05=0x7f
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_ALLOCATEENDPOINTDMA_DUP06=0x80
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL=0x5
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL_DUP01=0x6
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL_DUP02=0x7
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL_DUP03=0x8
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL_DUP04=0x9
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL_DUP05=0xa
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL_DUP06=0xb
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL_DUP07=0xc
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL_DUP08=0xd
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL_DUP09=0xe
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL_DUP10=0xf
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_CONSTRUCTL_DUP11=0x10
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DCACTIVECONSOLE_DUP01=0x16
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DCACTIVECONSOLE_DUP02=0x17
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DCACTIVECONSOLE_DUP03=0x18
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DCACTIVECONSOLE_DUP04=0x19
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DCACTIVECONSOLE_DUP05=0x1a
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DCACTIVECONSOLE_DUP06=0x1b
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DEALLOCATEDOUBLEBUFFERING=0x8c
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DEALLOCATEDOUBLEBUFFERING_DUP01=0x8d
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DEALLOCATEDOUBLEBUFFERING_DUP02=0x8e
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DEALLOCATEDOUBLEBUFFERING_DUP03=0x8f
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DEALLOCATEENDPOINTDMA=0x81
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DEALLOCATEENDPOINTDMA_DUP01=0x82
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DEALLOCATEENDPOINTDMA_DUP02=0x83
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DEALLOCATEENDPOINTDMA_DUP03=0x84
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL=0x3e
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP01=0x3f
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP02=0x40
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP03=0x41
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP04=0x42
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP05=0x43
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP06=0x44
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP07=0x45
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP08=0x46
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP09=0x47
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP10=0x48
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP11=0x49
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP12=0x4a
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP13=0x4b
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP14=0x4c
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP15=0x4d
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP16=0x4e
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP17=0x4f
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP18=0x50
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP19=0x51
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP20=0x52
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP21=0x53
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP22=0x54
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP23=0x55
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP24=0x56
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP25=0x57
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP26=0x58
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP27=0x59
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP28=0x5a
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP29=0x5b
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP30=0x5c
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP31=0x5d
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP32=0x5e
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP33=0x5f
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP35=0x60
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYRXBUFFER=0x61
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYRXBUFFER_DUP01=0x62
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL=0x63
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP01=0x64
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP02=0x65
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP03=0x66
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP04=0x67
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP05=0x68
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP06=0x69
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP07=0x6a
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP08=0x6b
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP09=0x6c
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP10=0x6d
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP11=0x6e
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP12=0x6f
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP13=0x70
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP14=0x71
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP15=0x72
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP16=0x73
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP17=0x74
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP18=0x75
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP19=0x76
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP20=0x77
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP21=0x78
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_QUERYUSBCLIENTL_DUP22=0x79
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REENUMERATE=0x90
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REENUMERATE_DUP01=0x91
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REENUMERATE_DUP02=0x92
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REENUMERATE_DUP03=0x93
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REENUMERATE_DUP04=0x94
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REENUMERATE_DUP05=0x95
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REENUMERATE_DUP06=0x96
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REENUMERATE_DUP07=0x97
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REENUMERATE_DUP08=0x98
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REENUMERATE_DUP09=0x99
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER=0x1c
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP01=0x1d
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP02=0x1e
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP03=0x1f
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP04=0x20
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP05=0x21
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP06=0x22
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP07=0x23
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP08=0x24
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP09=0x25
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP10=0x26
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP11=0x27
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP12=0x28
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP13=0x29
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP14=0x2a
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP15=0x2b
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP16=0x2c
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP17=0x2d
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP18=0x2e
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP19=0x2f
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP20=0x30
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP21=0x31
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP22=0x32
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP23=0x33
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP24=0x34
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP25=0x35
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP26=0x36
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP27=0x37
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP28=0x38
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP29=0x39
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP30=0x3a
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP31=0x3b
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP32=0x3c
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_REQUESTCHARACTER_DUP33=0x3d
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_SETUPDESCRIPTORS=0x9a
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_SETUPDESCRIPTORS_DUP01=0x9b
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_SETUPINTERFACE=0x11
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_SETUPINTERFACE_DUP01=0x12
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_SETUPINTERFACE_DUP02=0x13
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_SETUPINTERFACE_DUP03=0x14
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_SETUPINTERFACE_DUP04=0x15
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL=0xc7
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP01=0xc8
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP02=0xc9
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP03=0xca
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP04=0xcb
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP05=0xcc
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP06=0xcd
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP07=0xce
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP08=0xcf
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_CONSTRUCTL_DUP01=0x9c
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_EXCHANGEVERSIONS_DUP01=0xb1
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_EXCHANGEVERSIONS_DUP02=0xb2
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_EXCHANGEVERSIONS_DUP03=0xb3
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_EXCHANGEVERSIONS_DUP04=0xb4
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READBUFFERFROMDISK=0xc3
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READBUFFERFROMDISK_DUP02=0xc4
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK=0xbd
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK_DUP01=0xbe
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK_DUP02=0xbf
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK_DUP03=0xc0
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK_DUP04=0xc1
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RECEIVEVERSION_DUP01=0xa6
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RECEIVEVERSION_DUP02=0xa7
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RECEIVEVERSION_DUP04=0xa8
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RECEIVEVERSION_DUP05=0xa9
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RECEIVEVERSION_DUP06=0xaa
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RECEIVEVERSION_DUP07=0xab
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RECEIVEVERSION_DUP08=0xac
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RECEIVEVERSION_DUP09=0xad
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RECEIVEVERSION_DUP10=0xae
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RECEIVEVERSION_DUP11=0xaf
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RECEIVEVERSION_DUP12=0xb0
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP01=0x9e
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP02=0x9f
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP03=0xa0
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP05=0xa1
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP06=0xa2
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP07=0xa3
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_SELECTDRIVE=0xb5
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_SELECTDRIVE_DUP01=0xb6
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_SELECTDRIVE_DUP02=0xb7
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_SELECTDRIVE_DUP03=0xb8
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_SELECTDRIVE_DUP04=0xb9
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_SELECTDRIVE_DUP05=0xba
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_SELECTDRIVE_DUP06=0xbb
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_SELECTDRIVE_DUP07=0xbc
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_SENDVERSION_DUP01=0xa4
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_SENDVERSION_DUP02=0xa5
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_SETMAXBUFSIZE=0x9d
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_STOP=0xc5
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_STOP_DUP01=0xc6
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_WRITEBUFFERTODISK_DUP01=0xc2
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN=0x2
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP01=0x3
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP02=0x4
-[TRACE]TRACE_NORMAL[0x86]_RUNAPPL_RUNAPPL=0x1
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONSOLE_DCACTIVECONSOLE=0x1
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONSOLE_DOCANCEL=0x2
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONSOLE_PROCESSKEYPRESSL_DUP34=0x4
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONSOLE_RUNL=0x3
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVEDEVICESTATENOTIFIER_DCACTIVEDEVICESTATENOTIFIER=0x25
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVEDEVICESTATENOTIFIER_DOCANCEL=0x26
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_CACTIVERW=0x5
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_COMPAREBUFFERS=0x1f
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_COMPAREBUFFERS_DUP01=0x20
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_COMPAREBUFFERS_DUP02=0x21
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_CONSTRUCTL=0x6
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_DCACTIVERW=0x7
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_DOCANCEL=0x1e
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_EXCHANGEVERSIONS=0x11
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READBUFFERFROMDISK_DUP01=0x17
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA=0x18
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA_DUP01=0x19
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA_DUP02=0x1a
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA_DUP03=0x1b
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA_DUP04=0x1c
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA_DUP05=0x1d
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RECEIVEVERSION=0xd
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RECEIVEVERSION_DUP03=0xe
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RECEIVEVERSION_DUP13=0xf
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RECEIVEVERSION_DUP14=0x10
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL=0x8
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL_DUP04=0x9
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SENDDATA=0x14
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SENDDATA_DUP01=0x15
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SENDPREAMBLE=0x12
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SENDPREAMBLE_DUP01=0x13
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SENDVERSION=0xa
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SENDVERSION_DUP03=0xb
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SENDVERSION_DUP04=0xc
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_WRITEBUFFERTODISK=0x16
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVESTALLNOTIFIER_DCACTIVESTALLNOTIFIER=0x22
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVESTALLNOTIFIER_DOCANCEL=0x23
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVESTALLNOTIFIER_RUNL=0x24
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVETIMER_DCACTIVETIMER=0x27
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVETIMER_DOCANCEL=0x28
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVETIMER_RUNL=0x29
--- a/kerneltest/e32test/traces_t_usb_device/OstTraceDefinitions.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-// 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:
-// 
-//
-
-
-#ifndef __OSTTRACEDEFINITIONS_H__
-#define __OSTTRACEDEFINITIONS_H__
-// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
-// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
-//#define OST_TRACE_COMPILER_IN_USE
-#include <opensystemtrace.h>
-#endif
--- a/kerneltest/e32test/traces_t_usb_device/fixed_id.definitions	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,321 +0,0 @@
-#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
-[GROUP]TRACE_ERROR=0x82
-[GROUP]TRACE_NORMAL=0x86
-[GROUP]TRACE_VERBOSE=0xde
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_READBUFFERFROMDISK=0xc
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_READFROMDISK_DUP02=0x8
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_READFROMDISK_DUP04=0x9
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_READFROMDISK_DUP06=0xa
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS=0x1
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS_DUP02=0x2
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS_DUP04=0x3
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS_DUP05=0x4
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS_DUP07=0x5
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS_DUP09=0x6
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_WRITEBUFFERTODISK_DUP01=0xb
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_WRITETODISK_DUP01=0x7
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING=0x41
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP01=0x42
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP02=0x43
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP03=0x44
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP04=0x45
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP05=0x46
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP06=0x47
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA=0x36
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP01=0x37
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP02=0x38
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP03=0x39
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP04=0x3a
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP05=0x3b
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP06=0x3c
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP05=0x58
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_CONSTRUCTL_DUP04=0x1
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DCACTIVECONTROL=0x7
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DCACTIVECONTROL_DUP01=0x8
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING=0x48
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING_DUP01=0x49
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING_DUP02=0x4a
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING_DUP03=0x4b
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEENDPOINTDMA=0x3d
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEENDPOINTDMA_DUP01=0x3e
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEENDPOINTDMA_DUP02=0x3f
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEENDPOINTDMA_DUP03=0x40
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PRINTHOSTLOG_DUP02=0x28
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PRINTHOSTLOG_DUP04=0x29
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP05=0xd
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP07=0xe
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP08=0xf
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP11=0x10
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP12=0x11
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP13=0x12
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP14=0x13
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP15=0x14
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP17=0x15
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP18=0x16
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP20=0x17
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP22=0x18
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP23=0x19
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP24=0x1a
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP25=0x1b
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP26=0x1c
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP27=0x1d
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP28=0x1e
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP29=0x1f
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP30=0x20
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP31=0x21
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP32=0x22
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP33=0x23
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP36=0x24
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP37=0x25
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP38=0x26
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP39=0x27
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL=0x2a
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP01=0x2b
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP02=0x2c
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP03=0x2d
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP04=0x2e
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP05=0x2f
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP06=0x30
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP07=0x31
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP08=0x32
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP09=0x33
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP10=0x34
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP11=0x35
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE=0x4c
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP01=0x4d
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP02=0x4e
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP03=0x4f
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP04=0x50
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP05=0x51
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP06=0x52
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP07=0x53
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP08=0x54
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP09=0x55
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_RUNL_DUP01=0x9
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_RUNL_DUP02=0xa
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_RUNL_DUP03=0xb
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_RUNL_DUP04=0xc
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPINTERFACE=0x2
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPINTERFACE_DUP01=0x3
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPINTERFACE_DUP02=0x4
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPINTERFACE_DUP03=0x5
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPINTERFACE_DUP04=0x6
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPTRANSFEREDINTERFACE_DUP01=0x56
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPTRANSFEREDINTERFACE_DUP02=0x57
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL=0x59
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP02=0x5a
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP03=0x5b
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP04=0x5c
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP05=0x5d
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP06=0x5e
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP07=0x5f
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP08=0x60
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP09=0x61
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP10=0x62
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP01=0x72
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP02=0x73
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP03=0x74
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP04=0x75
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP05=0x76
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP06=0x77
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP07=0x78
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_CONSTRUCTL_DUP01=0x63
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_PROCESSREADXFER=0x67
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_PROCESSREADXFER_DUP01=0x68
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_PROCESSREADXFER_DUP03=0x69
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READBUFFERFROMDISK_DUP02=0x6f
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK=0x6b
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK_DUP01=0x6c
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK_DUP03=0x6d
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK_DUP05=0x6e
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP01=0x64
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP02=0x65
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP08=0x66
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_STOP=0x70
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_STOP_DUP01=0x71
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_WRITETODISK=0x6a
-[TRACE]TRACE_NORMAL[0x86]_CFILESYSTEMDESCRIPTOR_NEWL=0xb0
-[TRACE]TRACE_NORMAL[0x86]_CFILESYSTEMDESCRIPTOR_NEWL_DUP01=0xb1
-[TRACE]TRACE_NORMAL[0x86]_CFILESYSTEMDESCRIPTOR_NEWL_DUP02=0xb2
-[TRACE]TRACE_NORMAL[0x86]_CFILESYSTEMDESCRIPTOR_NEWL_DUP03=0xb3
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS=0x8e
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP01=0x8f
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP02=0x90
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP03=0x91
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP04=0x92
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP05=0x93
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP07=0x94
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP08=0x95
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP09=0x96
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP11=0x97
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP12=0x98
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP13=0x99
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP14=0x9a
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP16=0x9b
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP18=0x9c
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP19=0x9d
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP20=0x9e
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP22=0x9f
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP24=0xa0
-[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL=0xbe
-[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP01=0xbf
-[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP02=0xc0
-[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP03=0xc1
-[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP04=0xc2
-[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP05=0xc3
-[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP06=0xc4
-[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP07=0xc5
-[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP08=0xc6
-[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP09=0xc7
-[TRACE]TRACE_NORMAL[0x86]_DORESTOREFS_DORESTOREFS=0xb4
-[TRACE]TRACE_NORMAL[0x86]_DORESTOREFS_DORESTOREFS_DUP01=0xb5
-[TRACE]TRACE_NORMAL[0x86]_DORESTOREFS_DORESTOREFS_DUP02=0xb6
-[TRACE]TRACE_NORMAL[0x86]_DORESTOREFS_DORESTOREFS_DUP03=0xb7
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN=0xac
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP01=0xad
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP02=0xae
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP03=0xaf
-[TRACE]TRACE_NORMAL[0x86]_MOUNTMSFS_MOUNTMSFS=0xb8
-[TRACE]TRACE_NORMAL[0x86]_MOUNTMSFS_MOUNTMSFS_DUP01=0xb9
-[TRACE]TRACE_NORMAL[0x86]_MOUNTMSFS_MOUNTMSFS_DUP02=0xba
-[TRACE]TRACE_NORMAL[0x86]_MOUNTMSFS_MOUNTMSFS_DUP03=0xbb
-[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE=0xa6
-[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP01=0xa7
-[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP02=0xa8
-[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP03=0xa9
-[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP04=0xaa
-[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP05=0xab
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS=0xca
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP01=0xcb
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP02=0xcc
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP03=0xcd
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP04=0xce
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP05=0xcf
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP06=0xd0
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP07=0xd1
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP08=0xd2
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP09=0xd3
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP10=0xd4
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP11=0xd5
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP14=0xd6
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_MEDIAERROR=0xd7
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_TRANSFERRED=0xc8
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_TRANSFERRED_DUP01=0xc9
-[TRACE]TRACE_NORMAL[0x86]_RESTOREMOUNT_RESTOREMOUNT=0xbc
-[TRACE]TRACE_NORMAL[0x86]_RESTOREMOUNT_RESTOREMOUNT_DUP01=0xbd
-[TRACE]TRACE_NORMAL[0x86]_RUNAPPL_RUNAPPL=0xa1
-[TRACE]TRACE_NORMAL[0x86]_RUNAPPL_RUNAPPL_DUP01=0xa2
-[TRACE]TRACE_NORMAL[0x86]_RUNAPPL_RUNAPPL_DUP02=0xa3
-[TRACE]TRACE_NORMAL[0x86]_RUNAPPL_RUNAPPL_DUP03=0xa4
-[TRACE]TRACE_NORMAL[0x86]_RUNAPPL_RUNAPPL_DUP04=0xa5
-[TRACE]TRACE_NORMAL[0x86]_TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS=0x89
-[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINT0MAXPACKETSIZES_TESTENDPOINT0MAXPACKETSIZES=0x8c
-[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINT0MAXPACKETSIZES_TESTENDPOINT0MAXPACKETSIZES_DUP01=0x8d
-[TRACE]TRACE_NORMAL[0x86]_TESTINTERFACEDESCRIPTOR_TESTINTERFACEDESCRIPTOR=0x79
-[TRACE]TRACE_NORMAL[0x86]_TESTOTGEXTENSIONS_TESTOTGEXTENSIONS=0x8a
-[TRACE]TRACE_NORMAL[0x86]_TESTOTGEXTENSIONS_TESTOTGEXTENSIONS_DUP01=0x8b
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS=0x7a
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP01=0x7b
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP02=0x7c
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP03=0x7d
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP04=0x7e
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP05=0x7f
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP06=0x80
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP07=0x81
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP08=0x82
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP09=0x83
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP10=0x84
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP11=0x85
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP12=0x86
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP13=0x87
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP14=0x88
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL=0x1
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD=0x22
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP01=0x23
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP02=0x24
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP03=0x25
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP04=0x26
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP06=0x27
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP07=0x28
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP08=0x29
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP01=0x2
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP02=0x3
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP03=0x4
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP05=0x5
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP06=0x6
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP07=0x7
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_DOCANCEL=0xd
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PRINTHOSTLOG=0x1e
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PRINTHOSTLOG_DUP01=0x1f
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PRINTHOSTLOG_DUP03=0x20
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET=0x11
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP01=0x12
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP02=0x13
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP03=0x14
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP04=0x15
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP06=0x16
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP09=0x17
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP10=0x18
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP16=0x19
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP19=0x1a
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP21=0x1b
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP34=0x1c
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP35=0x1d
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RECONNECT=0x8
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RECONNECT_DUP01=0x9
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RECONNECT_DUP02=0xa
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RECONNECT_DUP03=0xb
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RECONNECT_DUP04=0xc
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_REQUESTEP0CONTROLPACKET=0xe
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_REQUESTEP0CONTROLPACKET_DUP01=0xf
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RUNL=0x10
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_SETUPTRANSFEREDINTERFACE=0x21
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVEDEVICESTATENOTIFIER_DCACTIVEDEVICESTATENOTIFIER=0x2a
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVEDEVICESTATENOTIFIER_DOCANCEL=0x2b
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP01=0x2c
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP11=0x2d
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_CACTIVERW=0x2e
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_COMPAREBUFFERS=0x4b
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_CONSTRUCTL=0x2f
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_DCACTIVERW=0x30
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_DOCANCEL=0x4a
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_PROCESSREADXFER_DUP02=0x41
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READBUFFERFROMDISK_DUP01=0x45
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA=0x46
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA_DUP01=0x47
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA_DUP02=0x48
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA_DUP03=0x49
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RESUME=0x37
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL=0x3b
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL_DUP03=0x3c
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL_DUP04=0x3d
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL_DUP05=0x3e
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL_DUP06=0x3f
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL_DUP07=0x40
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SENDDATA=0x42
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SENDDATA_DUP01=0x43
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SETTESTPARAMS_DUP01=0x31
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SETTESTPARAMS_DUP03=0x32
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SETTESTPARAMS_DUP06=0x33
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SETTESTPARAMS_DUP08=0x34
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_STARTORSUSPEND=0x39
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_STARTORSUSPEND_DUP01=0x3a
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SUSPEND=0x35
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SUSPEND_DUP01=0x36
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_TESTCOMPLETE=0x4c
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_WRITEBUFFERTODISK=0x44
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_YIELD=0x38
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVESTALLNOTIFIER_DCACTIVESTALLNOTIFIER=0x4d
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVESTALLNOTIFIER_DOCANCEL=0x4e
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVESTALLNOTIFIER_RUNL=0x4f
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVETIMER_DCACTIVETIMER=0x50
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVETIMER_DOCANCEL=0x51
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVETIMER_RUNL=0x52
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP06=0x53
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP10=0x54
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP15=0x55
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP17=0x56
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP21=0x57
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP23=0x58
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP25=0x59
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP26=0x5a
--- a/kerneltest/e32test/traces_t_usb_scdevice/OstTraceDefinitions.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-// 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:
-// 
-//
-
-
-#ifndef __OSTTRACEDEFINITIONS_H__
-#define __OSTTRACEDEFINITIONS_H__
-// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
-// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
-//#define OST_TRACE_COMPILER_IN_USE
-#include <opensystemtrace.h>
-#endif
--- a/kerneltest/e32test/traces_t_usb_scdevice/fixed_id.definitions	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,326 +0,0 @@
-#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
-[GROUP]TRACE_ERROR=0x82
-[GROUP]TRACE_NORMAL=0x86
-[GROUP]TRACE_VERBOSE=0xde
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_READBUFFERFROMDISK=0xc
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_READFROMDISK_DUP02=0x8
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_READFROMDISK_DUP04=0x9
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_READFROMDISK_DUP06=0xa
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS=0x1
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS_DUP02=0x2
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS_DUP04=0x3
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS_DUP05=0x4
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS_DUP07=0x5
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_SETTESTPARAMS_DUP09=0x6
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_WRITEBUFFERTODISK_DUP01=0xb
-[TRACE]TRACE_ERROR[0x82]_CACTIVERW_WRITETODISK_DUP01=0x7
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING=0x41
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP01=0x42
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP02=0x43
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP03=0x44
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP04=0x45
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP05=0x46
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP06=0x47
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA=0x36
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP01=0x37
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP02=0x38
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP03=0x39
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP04=0x3a
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP05=0x3b
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP06=0x3c
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP05=0x58
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_CONSTRUCTL_DUP04=0x1
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DCACTIVECONTROL=0x7
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DCACTIVECONTROL_DUP01=0x8
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING=0x48
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING_DUP01=0x49
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING_DUP02=0x4a
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING_DUP03=0x4b
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEENDPOINTDMA=0x3d
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEENDPOINTDMA_DUP01=0x3e
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEENDPOINTDMA_DUP02=0x3f
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_DEALLOCATEENDPOINTDMA_DUP03=0x40
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PRINTHOSTLOG_DUP02=0x28
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PRINTHOSTLOG_DUP04=0x29
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP05=0xd
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP07=0xe
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP08=0xf
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP11=0x10
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP12=0x11
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP13=0x12
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP14=0x13
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP15=0x14
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP17=0x15
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP18=0x16
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP20=0x17
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP22=0x18
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP23=0x19
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP24=0x1a
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP25=0x1b
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP26=0x1c
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP27=0x1d
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP28=0x1e
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP29=0x1f
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP30=0x20
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP31=0x21
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP32=0x22
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP33=0x23
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP36=0x24
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP37=0x25
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP38=0x26
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP39=0x27
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL=0x2a
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP01=0x2b
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP02=0x2c
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP03=0x2d
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP04=0x2e
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP05=0x2f
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP06=0x30
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP07=0x31
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP08=0x32
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP09=0x33
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP10=0x34
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_QUERYUSBCLIENTL_DUP11=0x35
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE=0x4c
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP01=0x4d
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP02=0x4e
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP03=0x4f
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP04=0x50
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP05=0x51
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP06=0x52
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP07=0x53
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP08=0x54
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_REENUMERATE_DUP09=0x55
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_RUNL_DUP01=0x9
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_RUNL_DUP02=0xa
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_RUNL_DUP03=0xb
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_RUNL_DUP04=0xc
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPINTERFACE=0x2
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPINTERFACE_DUP01=0x3
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPINTERFACE_DUP02=0x4
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPINTERFACE_DUP03=0x5
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPINTERFACE_DUP04=0x6
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPTRANSFEREDINTERFACE_DUP01=0x56
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONTROL_SETUPTRANSFEREDINTERFACE_DUP02=0x57
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL=0x59
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP02=0x5a
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP03=0x5b
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP04=0x5c
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP05=0x5d
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP06=0x5e
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP07=0x5f
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP08=0x60
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP09=0x61
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP10=0x62
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP01=0x72
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP02=0x73
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP03=0x74
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP04=0x75
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP05=0x76
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP06=0x77
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_COMPAREBUFFERS_DUP07=0x78
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_CONSTRUCTL_DUP01=0x63
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_PROCESSREADXFER=0x67
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_PROCESSREADXFER_DUP01=0x68
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_PROCESSREADXFER_DUP03=0x69
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READBUFFERFROMDISK_DUP02=0x6f
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK=0x6b
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK_DUP01=0x6c
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK_DUP03=0x6d
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_READFROMDISK_DUP05=0x6e
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP01=0x64
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP02=0x65
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP08=0x66
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_STOP=0x70
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_STOP_DUP01=0x71
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_WRITETODISK=0x6a
-[TRACE]TRACE_NORMAL[0x86]_CFILESYSTEMDESCRIPTOR_NEWL=0xb5
-[TRACE]TRACE_NORMAL[0x86]_CFILESYSTEMDESCRIPTOR_NEWL_DUP01=0xb6
-[TRACE]TRACE_NORMAL[0x86]_CFILESYSTEMDESCRIPTOR_NEWL_DUP02=0xb7
-[TRACE]TRACE_NORMAL[0x86]_CFILESYSTEMDESCRIPTOR_NEWL_DUP03=0xb8
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS=0x8e
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP01=0x8f
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP02=0x90
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP03=0x91
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP04=0x92
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP05=0x93
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP07=0x94
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP08=0x95
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP09=0x96
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP11=0x97
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP12=0x98
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP13=0x99
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP14=0x9a
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP16=0x9b
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP18=0x9c
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP19=0x9d
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP20=0x9e
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP22=0x9f
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP24=0xa0
-[TRACE]TRACE_NORMAL[0x86]_CTRANHANDLESERVER_DCTRANHANDLESERVER=0xb1
-[TRACE]TRACE_NORMAL[0x86]_CTRANHANDLESERVER_NEWL=0xb0
-[TRACE]TRACE_NORMAL[0x86]_CTRANHANDLESERVER_NEWSESSIONL=0xb2
-[TRACE]TRACE_NORMAL[0x86]_CTRANHANDLESESSION_DCTRANHANDLESESSION=0xb3
-[TRACE]TRACE_NORMAL[0x86]_CTRANHANDLESESSION_SERVICEL=0xb4
-[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL=0xc3
-[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP01=0xc4
-[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP02=0xc5
-[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP03=0xc6
-[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP04=0xc7
-[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP05=0xc8
-[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP06=0xc9
-[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP07=0xca
-[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP08=0xcb
-[TRACE]TRACE_NORMAL[0x86]_CUSBWATCH_RUNL_DUP09=0xcc
-[TRACE]TRACE_NORMAL[0x86]_DORESTOREFS_DORESTOREFS=0xb9
-[TRACE]TRACE_NORMAL[0x86]_DORESTOREFS_DORESTOREFS_DUP01=0xba
-[TRACE]TRACE_NORMAL[0x86]_DORESTOREFS_DORESTOREFS_DUP02=0xbb
-[TRACE]TRACE_NORMAL[0x86]_DORESTOREFS_DORESTOREFS_DUP03=0xbc
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN=0xac
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP01=0xad
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP02=0xae
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP03=0xaf
-[TRACE]TRACE_NORMAL[0x86]_MOUNTMSFS_MOUNTMSFS=0xbd
-[TRACE]TRACE_NORMAL[0x86]_MOUNTMSFS_MOUNTMSFS_DUP01=0xbe
-[TRACE]TRACE_NORMAL[0x86]_MOUNTMSFS_MOUNTMSFS_DUP02=0xbf
-[TRACE]TRACE_NORMAL[0x86]_MOUNTMSFS_MOUNTMSFS_DUP03=0xc0
-[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE=0xa6
-[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP01=0xa7
-[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP02=0xa8
-[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP03=0xa9
-[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP04=0xaa
-[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP05=0xab
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS=0xcf
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP01=0xd0
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP02=0xd1
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP03=0xd2
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP04=0xd3
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP05=0xd4
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP06=0xd5
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP07=0xd6
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP08=0xd7
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP09=0xd8
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP10=0xd9
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP11=0xda
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_DRIVESTATUS_DUP14=0xdb
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_MEDIAERROR=0xdc
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_TRANSFERRED=0xcd
-[TRACE]TRACE_NORMAL[0x86]_PROPERTYHANDLERS_TRANSFERRED_DUP01=0xce
-[TRACE]TRACE_NORMAL[0x86]_RESTOREMOUNT_RESTOREMOUNT=0xc1
-[TRACE]TRACE_NORMAL[0x86]_RESTOREMOUNT_RESTOREMOUNT_DUP01=0xc2
-[TRACE]TRACE_NORMAL[0x86]_RUNAPPL_RUNAPPL=0xa1
-[TRACE]TRACE_NORMAL[0x86]_RUNAPPL_RUNAPPL_DUP01=0xa2
-[TRACE]TRACE_NORMAL[0x86]_RUNAPPL_RUNAPPL_DUP02=0xa3
-[TRACE]TRACE_NORMAL[0x86]_RUNAPPL_RUNAPPL_DUP03=0xa4
-[TRACE]TRACE_NORMAL[0x86]_RUNAPPL_RUNAPPL_DUP04=0xa5
-[TRACE]TRACE_NORMAL[0x86]_TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS=0x89
-[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINT0MAXPACKETSIZES_TESTENDPOINT0MAXPACKETSIZES=0x8c
-[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINT0MAXPACKETSIZES_TESTENDPOINT0MAXPACKETSIZES_DUP01=0x8d
-[TRACE]TRACE_NORMAL[0x86]_TESTINTERFACEDESCRIPTOR_TESTINTERFACEDESCRIPTOR=0x79
-[TRACE]TRACE_NORMAL[0x86]_TESTOTGEXTENSIONS_TESTOTGEXTENSIONS=0x8a
-[TRACE]TRACE_NORMAL[0x86]_TESTOTGEXTENSIONS_TESTOTGEXTENSIONS_DUP01=0x8b
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS=0x7a
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP01=0x7b
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP02=0x7c
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP03=0x7d
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP04=0x7e
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP05=0x7f
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP06=0x80
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP07=0x81
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP08=0x82
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP09=0x83
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP10=0x84
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP11=0x85
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP12=0x86
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP13=0x87
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP14=0x88
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL=0x1
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD=0x22
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP01=0x23
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP02=0x24
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP03=0x25
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP04=0x26
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP06=0x27
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP07=0x28
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP08=0x29
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP01=0x2
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP02=0x3
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP03=0x4
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP05=0x5
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP06=0x6
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_CONSTRUCTL_DUP07=0x7
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_DOCANCEL=0xd
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PRINTHOSTLOG=0x1e
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PRINTHOSTLOG_DUP01=0x1f
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PRINTHOSTLOG_DUP03=0x20
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET=0x11
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP01=0x12
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP02=0x13
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP03=0x14
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP04=0x15
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP06=0x16
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP09=0x17
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP10=0x18
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP16=0x19
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP19=0x1a
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP21=0x1b
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP34=0x1c
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP35=0x1d
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RECONNECT=0x8
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RECONNECT_DUP01=0x9
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RECONNECT_DUP02=0xa
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RECONNECT_DUP03=0xb
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RECONNECT_DUP04=0xc
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_REQUESTEP0CONTROLPACKET=0xe
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_REQUESTEP0CONTROLPACKET_DUP01=0xf
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_RUNL=0x10
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVECONTROL_SETUPTRANSFEREDINTERFACE=0x21
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVEDEVICESTATENOTIFIER_DCACTIVEDEVICESTATENOTIFIER=0x2a
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVEDEVICESTATENOTIFIER_DOCANCEL=0x2b
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP01=0x2c
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP11=0x2d
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_CACTIVERW=0x2e
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_COMPAREBUFFERS=0x4b
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_CONSTRUCTL=0x2f
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_DCACTIVERW=0x30
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_DOCANCEL=0x4a
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_PROCESSREADXFER_DUP02=0x41
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READBUFFERFROMDISK_DUP01=0x45
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA=0x46
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA_DUP01=0x47
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA_DUP02=0x48
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_READDATA_DUP03=0x49
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RESUME=0x37
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL=0x3b
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL_DUP03=0x3c
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL_DUP04=0x3d
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL_DUP05=0x3e
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL_DUP06=0x3f
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_RUNL_DUP07=0x40
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SENDDATA=0x42
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SENDDATA_DUP01=0x43
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SETTESTPARAMS_DUP01=0x31
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SETTESTPARAMS_DUP03=0x32
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SETTESTPARAMS_DUP06=0x33
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SETTESTPARAMS_DUP08=0x34
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_STARTORSUSPEND=0x39
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_STARTORSUSPEND_DUP01=0x3a
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SUSPEND=0x35
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_SUSPEND_DUP01=0x36
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_TESTCOMPLETE=0x4c
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_WRITEBUFFERTODISK=0x44
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVERW_YIELD=0x38
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVESTALLNOTIFIER_DCACTIVESTALLNOTIFIER=0x4d
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVESTALLNOTIFIER_DOCANCEL=0x4e
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVESTALLNOTIFIER_RUNL=0x4f
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVETIMER_DCACTIVETIMER=0x50
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVETIMER_DOCANCEL=0x51
-[TRACE]TRACE_VERBOSE[0xDE]_CACTIVETIMER_RUNL=0x52
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP06=0x53
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP10=0x54
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP15=0x55
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP17=0x56
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP21=0x57
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP23=0x58
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP25=0x59
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP26=0x5a
--- a/kerneltest/e32test/traces_t_usb_transfersrv/OstTraceDefinitions.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-// 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:
-// 
-//
-
-
-#ifndef __OSTTRACEDEFINITIONS_H__
-#define __OSTTRACEDEFINITIONS_H__
-// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
-// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
-//#define OST_TRACE_COMPILER_IN_USE
-#include <opensystemtrace.h>
-#endif
--- a/kerneltest/e32test/traces_t_usb_transfersrv/fixed_id.definitions	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
-[GROUP]TRACE_FATAL=0x81
-[GROUP]TRACE_NORMAL=0x86
-[GROUP]TRACE_VERBOSE=0xde
-[TRACE]TRACE_FATAL[0x81]_CTRANSFERHANDLE_RUNL=0x1
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS=0x1
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP01=0x2
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP02=0x3
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP03=0x4
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP04=0x5
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP05=0x6
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP07=0x7
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP08=0x8
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP09=0x9
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP11=0xa
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP12=0xb
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP13=0xc
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP14=0xd
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP16=0xe
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP18=0xf
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP19=0x10
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP20=0x11
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP22=0x12
-[TRACE]TRACE_NORMAL[0x86]_CONFIGPTRS_CONFIGPTRS_DUP24=0x13
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERHANDLE_DCTRANSFERHANDLE=0x14
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERHANDLE_DOCANCEL=0x15
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_CONSTRUCTL=0x19
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_DCTRANSFERSERVER=0x17
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_DCTRANSFERSERVER_DUP01=0x18
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_DECREMENTSESSIONCOUNT=0x1c
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_DECREMENTSESSIONCOUNT_DUP01=0x1d
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_ERROR=0x1a
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_INCREMENTSESSIONCOUNT=0x1b
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_LAUNCHSHUTDOWNTIMERIFNOSESSIONS=0x1e
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_LAUNCHSHUTDOWNTIMERIFNOSESSIONS_DUP01=0x1f
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_NEWLC=0x16
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL=0x2c
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL_DUP01=0x2d
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL_DUP02=0x2e
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL_DUP03=0x2f
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL_DUP04=0x30
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL_DUP05=0x31
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL_DUP06=0x32
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL_DUP07=0x33
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL_DUP08=0x34
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL_DUP09=0x35
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL_DUP10=0x36
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_QUERYUSBCLIENTL_DUP11=0x37
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPINTERFACE=0x20
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPINTERFACE_DUP01=0x21
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPLDDS=0x22
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPLDDS_DUP01=0x23
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPLDDS_DUP02=0x24
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPLDDS_DUP03=0x25
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPLDDS_DUP04=0x26
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPLDDS_DUP05=0x27
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPLDDS_DUP06=0x28
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPLDDS_DUP07=0x29
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPLDDS_DUP08=0x2a
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSERVER_SETUPLDDS_DUP09=0x2b
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSESSION_DCTRANSFERSESSION=0x38
-[TRACE]TRACE_NORMAL[0x86]_CTRANSFERSESSION_DCTRANSFERSESSION_DUP01=0x39
-[TRACE]TRACE_NORMAL[0x86]_RUNSERVERL_RUNSERVERL=0x3a
-[TRACE]TRACE_NORMAL[0x86]_RUNSERVERL_RUNSERVERL_DUP01=0x3b
-[TRACE]TRACE_NORMAL[0x86]_RUNSERVERL_RUNSERVERL_DUP02=0x3c
-[TRACE]TRACE_NORMAL[0x86]_RUNSERVERL_RUNSERVERL_DUP03=0x3d
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP06=0x1
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP10=0x2
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP15=0x3
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP17=0x4
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP21=0x5
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP23=0x6
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP25=0x7
-[TRACE]TRACE_VERBOSE[0xDE]_CONFIGPTRS_CONFIGPTRS_DUP26=0x8
--- a/kerneltest/e32test/traces_t_usb_transfersrvclient/OstTraceDefinitions.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-// 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:
-// 
-//
-
-
-#ifndef __OSTTRACEDEFINITIONS_H__
-#define __OSTTRACEDEFINITIONS_H__
-// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
-// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
-//#define OST_TRACE_COMPILER_IN_USE
-#include <opensystemtrace.h>
-#endif
--- a/kerneltest/e32test/traces_t_usb_transfersrvclient/fixed_id.definitions	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
-[GROUP]TRACE_NORMAL=0x86
-[TRACE]TRACE_NORMAL[0x86]_RTRANSFERSRV_CONNECT=0x7
-[TRACE]TRACE_NORMAL[0x86]_RTRANSFERSRV_CONNECT_DUP01=0x8
-[TRACE]TRACE_NORMAL[0x86]_RTRANSFERSRV_CONNECT_DUP02=0x9
-[TRACE]TRACE_NORMAL[0x86]_RTRANSFERSRV_CONNECT_DUP03=0xa
-[TRACE]TRACE_NORMAL[0x86]_RTRANSFERSRV_CONNECT_DUP04=0xb
-[TRACE]TRACE_NORMAL[0x86]_RTRANSFERSRV_SETCONFIGFILENAME=0xc
-[TRACE]TRACE_NORMAL[0x86]_STARTSERVER_STARTSERVER=0x1
-[TRACE]TRACE_NORMAL[0x86]_STARTSERVER_STARTSERVER_DUP01=0x2
-[TRACE]TRACE_NORMAL[0x86]_STARTSERVER_STARTSERVER_DUP02=0x3
-[TRACE]TRACE_NORMAL[0x86]_STARTSERVER_STARTSERVER_DUP03=0x4
-[TRACE]TRACE_NORMAL[0x86]_STARTSERVER_STARTSERVER_DUP04=0x5
-[TRACE]TRACE_NORMAL[0x86]_STARTSERVER_STARTSERVER_DUP05=0x6
--- a/kerneltest/e32test/traces_t_usbapi/OstTraceDefinitions.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-// 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:
-// 
-//
-
-
-#ifndef __OSTTRACEDEFINITIONS_H__
-#define __OSTTRACEDEFINITIONS_H__
-// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
-// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
-//#define OST_TRACE_COMPILER_IN_USE
-#include <opensystemtrace.h>
-#endif
--- a/kerneltest/e32test/traces_t_usbapi/fixed_id.definitions	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
-[GROUP]TRACE_NORMAL=0x86
-[TRACE]TRACE_NORMAL[0x86]_OPENCHANNEL_OPENCHANNEL=0x2
-[TRACE]TRACE_NORMAL[0x86]_QUERYENDPOINTSTATE_QUERYENDPOINTSTATE=0x1
-[TRACE]TRACE_NORMAL[0x86]_RUNTESTS_RUNTESTS=0x52
-[TRACE]TRACE_NORMAL[0x86]_RUNTESTS_RUNTESTS_DUP01=0x53
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE=0x7
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP01=0x8
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP02=0x9
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP03=0xa
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP04=0xb
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP05=0xc
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP06=0xd
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP07=0xe
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP08=0xf
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP09=0x10
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP10=0x11
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP11=0x12
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP12=0x13
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP13=0x14
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP14=0x15
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP15=0x16
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP16=0x17
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP17=0x18
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP18=0x19
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP19=0x1a
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP20=0x1b
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP21=0x1c
-[TRACE]TRACE_NORMAL[0x86]_SETUPINTERFACE_SETUPINTERFACE_DUP22=0x1d
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY=0x43
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP01=0x44
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP02=0x45
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP03=0x46
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP04=0x47
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP05=0x48
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP06=0x49
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP07=0x4a
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP08=0x4b
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP09=0x4c
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION=0x20
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP01=0x21
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP02=0x22
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP03=0x23
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP04=0x24
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP05=0x25
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP06=0x26
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP07=0x27
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP08=0x28
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP09=0x29
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION_DUP10=0x2a
-[TRACE]TRACE_NORMAL[0x86]_TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS=0x3c
-[TRACE]TRACE_NORMAL[0x86]_TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS_DUP01=0x3d
-[TRACE]TRACE_NORMAL[0x86]_TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS_DUP02=0x3e
-[TRACE]TRACE_NORMAL[0x86]_TESTDEVICEQUALIFIERDESCRIPTOR_TESTDEVICEQUALIFIERDESCRIPTOR=0x1e
-[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINT0MAXPACKETSIZES_TESTENDPOINT0MAXPACKETSIZES=0x41
-[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINT0MAXPACKETSIZES_TESTENDPOINT0MAXPACKETSIZES_DUP01=0x42
-[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINTDESCRIPTOR_TESTENDPOINTDESCRIPTOR=0x2b
-[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINTSTALLSTATUS_TESTENDPOINTSTALLSTATUS=0x4f
-[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINTSTALLSTATUS_TESTENDPOINTSTALLSTATUS_DUP01=0x50
-[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINTSTALLSTATUS_TESTENDPOINTSTALLSTATUS_DUP02=0x51
-[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINTSTATUSNOTIFY_TESTENDPOINTSTATUSNOTIFY=0x4d
-[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINTSTATUSNOTIFY_TESTENDPOINTSTATUSNOTIFY_DUP01=0x4e
-[TRACE]TRACE_NORMAL[0x86]_TESTEXTENDEDENDPOINTDESCRIPTOR_TESTEXTENDEDENDPOINTDESCRIPTOR=0x2c
-[TRACE]TRACE_NORMAL[0x86]_TESTOTGEXTENSIONS_TESTOTGEXTENSIONS=0x3f
-[TRACE]TRACE_NORMAL[0x86]_TESTOTGEXTENSIONS_TESTOTGEXTENSIONS_DUP01=0x40
-[TRACE]TRACE_NORMAL[0x86]_TESTOTHERSPEEDCONFIGURATIONDESCRIPTOR_TESTOTHERSPEEDCONFIGURATIONDESCRIPTOR=0x1f
-[TRACE]TRACE_NORMAL[0x86]_TESTRESOURCEALLOCATIONV1_TESTRESOURCEALLOCATIONV1=0x3
-[TRACE]TRACE_NORMAL[0x86]_TESTRESOURCEALLOCATIONV1_TESTRESOURCEALLOCATIONV1_DUP01=0x4
-[TRACE]TRACE_NORMAL[0x86]_TESTRESOURCEALLOCATIONV1_TESTRESOURCEALLOCATIONV1_DUP02=0x5
-[TRACE]TRACE_NORMAL[0x86]_TESTRESOURCEALLOCATIONV1_TESTRESOURCEALLOCATIONV1_DUP03=0x6
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS=0x2d
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP01=0x2e
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP02=0x2f
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP03=0x30
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP04=0x31
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP05=0x32
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP06=0x33
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP07=0x34
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP08=0x35
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP09=0x36
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP10=0x37
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP11=0x38
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP12=0x39
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP13=0x3a
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP14=0x3b
--- a/kerneltest/e32test/traces_t_usbcsc/OstTraceDefinitions.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-// 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:
-// 
-//
-
-
-#ifndef __OSTTRACEDEFINITIONS_H__
-#define __OSTTRACEDEFINITIONS_H__
-// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
-// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
-//#define OST_TRACE_COMPILER_IN_USE
-#include <opensystemtrace.h>
-#endif
--- a/kerneltest/e32test/traces_t_usbcsc/fixed_id.definitions	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,243 +0,0 @@
-#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
-[GROUP]TRACE_NORMAL=0x86
-[TRACE]TRACE_NORMAL[0x86]_BILREAD_BILREAD=0xc1
-[TRACE]TRACE_NORMAL[0x86]_BILREAD_BILREAD_DUP01=0xc2
-[TRACE]TRACE_NORMAL[0x86]_BILREAD_BILREAD_DUP02=0xc3
-[TRACE]TRACE_NORMAL[0x86]_BILREAD_BILREAD_DUP03=0xc4
-[TRACE]TRACE_NORMAL[0x86]_BILREAD_BILREAD_DUP04=0xc5
-[TRACE]TRACE_NORMAL[0x86]_BILREAD_BILREAD_DUP05=0xc6
-[TRACE]TRACE_NORMAL[0x86]_BILREAD_BILREAD_DUP06=0xc7
-[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE=0xb5
-[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE_DUP01=0xb6
-[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE_DUP02=0xb7
-[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE_DUP03=0xb8
-[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE_DUP04=0xb9
-[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE_DUP05=0xba
-[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE_DUP06=0xbb
-[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE_DUP07=0xbc
-[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE_DUP08=0xbd
-[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE_DUP09=0xbe
-[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE_DUP10=0xbf
-[TRACE]TRACE_NORMAL[0x86]_BILWRITE_BILWRITE_DUP11=0xc0
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_DOCANCEL=0x8
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_GETCHARACTER=0x7
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_RUNL=0x9
-[TRACE]TRACE_NORMAL[0x86]_CACTIVECONSOLE_RUNL_DUP01=0xa
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_CACTIVEDEVICESTATENOTIFIER=0xb
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_DCACTIVEDEVICESTATENOTIFIER=0xc
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_DOCANCEL=0xd
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL=0xe
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP01=0xf
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP02=0x10
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP03=0x11
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP04=0x12
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP05=0x13
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP06=0x14
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP07=0x15
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP08=0x16
-[TRACE]TRACE_NORMAL[0x86]_CACTIVEDEVICESTATENOTIFIER_RUNL_DUP09=0x17
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_DCACTIVERW=0x23
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_DOCANCEL=0x24
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_QUEUEREQUESTS=0x21
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL=0x38
-[TRACE]TRACE_NORMAL[0x86]_CACTIVERW_RUNL_DUP01=0x39
-[TRACE]TRACE_NORMAL[0x86]_CACTIVESTALLNOTIFIER_CACTIVESTALLNOTIFIER=0x18
-[TRACE]TRACE_NORMAL[0x86]_CACTIVESTALLNOTIFIER_DCACTIVESTALLNOTIFIER=0x19
-[TRACE]TRACE_NORMAL[0x86]_CACTIVESTALLNOTIFIER_DOCANCEL=0x1a
-[TRACE]TRACE_NORMAL[0x86]_CACTIVESTALLNOTIFIER_RUNL=0x1b
-[TRACE]TRACE_NORMAL[0x86]_CACTIVESTALLNOTIFIER_RUNL_DUP01=0x1c
-[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES=0x5c
-[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP01=0x5d
-[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP02=0x5e
-[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP03=0x5f
-[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP04=0x60
-[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP05=0x61
-[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP06=0x62
-[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP07=0x63
-[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP08=0x64
-[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP09=0x65
-[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP10=0x66
-[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP11=0x67
-[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP12=0x68
-[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP13=0x69
-[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP14=0x6a
-[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP15=0x6b
-[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP16=0x6c
-[TRACE]TRACE_NORMAL[0x86]_CHECKDEVICECAPABILITIES_CHECKDEVICECAPABILITIES_DUP17=0x6d
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN=0xf0
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP01=0xf1
-[TRACE]TRACE_NORMAL[0x86]_INVALIDSETTINGONE_INVALIDSETTINGONE=0x78
-[TRACE]TRACE_NORMAL[0x86]_INVALIDSETTINGTHREE_INVALIDSETTINGTHREE=0x7a
-[TRACE]TRACE_NORMAL[0x86]_INVALIDSETTINGTHREE_INVALIDSETTINGTHREE_DUP01=0x7b
-[TRACE]TRACE_NORMAL[0x86]_INVALIDSETTINGTWO_INVALIDSETTINGTWO=0x79
-[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE=0xeb
-[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP01=0xec
-[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP02=0xed
-[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP03=0xee
-[TRACE]TRACE_NORMAL[0x86]_PARSECOMMANDLINE_PARSECOMMANDLINE_DUP04=0xef
-[TRACE]TRACE_NORMAL[0x86]_PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS=0xa1
-[TRACE]TRACE_NORMAL[0x86]_PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP01=0xa2
-[TRACE]TRACE_NORMAL[0x86]_PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP02=0xa3
-[TRACE]TRACE_NORMAL[0x86]_PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP03=0xa4
-[TRACE]TRACE_NORMAL[0x86]_PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP04=0xa5
-[TRACE]TRACE_NORMAL[0x86]_PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP05=0xa6
-[TRACE]TRACE_NORMAL[0x86]_PRINTBILTESTOPTIONS_PRINTBILTESTOPTIONS_DUP06=0xa7
-[TRACE]TRACE_NORMAL[0x86]_PRINTSETUPPKT_PRINTSETUPPKT=0xac
-[TRACE]TRACE_NORMAL[0x86]_PRINTSETUPPKT_PRINTSETUPPKT_DUP01=0xad
-[TRACE]TRACE_NORMAL[0x86]_PRINTSETUPPKT_PRINTSETUPPKT_DUP02=0xae
-[TRACE]TRACE_NORMAL[0x86]_PRINTSETUPPKT_PRINTSETUPPKT_DUP03=0xaf
-[TRACE]TRACE_NORMAL[0x86]_PRINTSETUPPKT_PRINTSETUPPKT_DUP04=0xb0
-[TRACE]TRACE_NORMAL[0x86]_PRINTSETUPPKT_PRINTSETUPPKT_DUP05=0xb1
-[TRACE]TRACE_NORMAL[0x86]_PRINTSETUPPKT_PRINTSETUPPKT_DUP06=0xb2
-[TRACE]TRACE_NORMAL[0x86]_PRINTSETUPPKT_PRINTSETUPPKT_DUP07=0xb3
-[TRACE]TRACE_NORMAL[0x86]_PRINTSETUPPKT_PRINTSETUPPKT_DUP08=0xb4
-[TRACE]TRACE_NORMAL[0x86]_PRINTWRITEOPTIONS_PRINTWRITEOPTIONS=0xa8
-[TRACE]TRACE_NORMAL[0x86]_PRINTWRITEOPTIONS_PRINTWRITEOPTIONS_DUP01=0xa9
-[TRACE]TRACE_NORMAL[0x86]_PRINTWRITEOPTIONS_PRINTWRITEOPTIONS_DUP02=0xaa
-[TRACE]TRACE_NORMAL[0x86]_PRINTWRITEOPTIONS_PRINTWRITEOPTIONS_DUP03=0xab
-[TRACE]TRACE_NORMAL[0x86]_QUERYENDPOINTSTATE_QUERYENDPOINTSTATE=0x92
-[TRACE]TRACE_NORMAL[0x86]_SETTINGFIVE_SETTINGFIVE=0x76
-[TRACE]TRACE_NORMAL[0x86]_SETTINGFIVE_SETTINGFIVE_DUP01=0x77
-[TRACE]TRACE_NORMAL[0x86]_SETTINGFOUROUT_SETTINGFOUROUT=0x74
-[TRACE]TRACE_NORMAL[0x86]_SETTINGFOUROUT_SETTINGFOUROUT_DUP01=0x75
-[TRACE]TRACE_NORMAL[0x86]_SETTINGONE_SETTINGONE=0x6e
-[TRACE]TRACE_NORMAL[0x86]_SETTINGONE_SETTINGONE_DUP01=0x6f
-[TRACE]TRACE_NORMAL[0x86]_SETTINGTHREEIN_SETTINGTHREEIN=0x72
-[TRACE]TRACE_NORMAL[0x86]_SETTINGTHREEIN_SETTINGTHREEIN_DUP01=0x73
-[TRACE]TRACE_NORMAL[0x86]_SETTINGTWO_SETTINGTWO=0x70
-[TRACE]TRACE_NORMAL[0x86]_SETTINGTWO_SETTINGTWO_DUP01=0x71
-[TRACE]TRACE_NORMAL[0x86]_SETUPBULKINTERFACES_SETUPBULKINTERFACES=0xa0
-[TRACE]TRACE_NORMAL[0x86]_STARTTESTS_STARTTESTS=0xea
-[TRACE]TRACE_NORMAL[0x86]_TALTERNATESETTING_ACTIVATE=0x20
-[TRACE]TRACE_NORMAL[0x86]_TALTERNATESETTING_DTALTERNATESETTING=0x1f
-[TRACE]TRACE_NORMAL[0x86]_TALTERNATESETTING_SETCHANGEREQUESTFLAG=0x22
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA=0x3a
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP01=0x3b
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP02=0x3c
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP03=0x3d
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP04=0x3e
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP05=0x3f
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP06=0x40
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP07=0x41
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP08=0x42
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP09=0x43
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP10=0x44
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP11=0x45
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP12=0x46
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP13=0x47
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP14=0x48
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP15=0x49
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP16=0x4a
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP17=0x4b
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP18=0x4c
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP19=0x4e
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP20=0x4f
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP21=0x50
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_PROCESSDATA_DUP22=0x4d
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_SENDEP0PACKET=0x2f
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_SENDEP0PACKET_DUP01=0x30
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_SETUPHEADER=0x31
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_SETUPHEADER_DUP01=0x32
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_SETUPHEADER_DUP02=0x33
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_SETUPHEADER_DUP03=0x34
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_SETUPHEADER_DUP04=0x35
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_SETUPHEADER_DUP05=0x36
-[TRACE]TRACE_NORMAL[0x86]_TBUFFER_SETUPHEADER_DUP06=0x37
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY=0x96
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP01=0x97
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP02=0x98
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP03=0x99
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP04=0x9a
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP05=0x9b
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP06=0x9c
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP07=0x9d
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP08=0x9e
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEDEVICESTATUSNOTIFY_TESTALTERNATEDEVICESTATUSNOTIFY_DUP09=0x9f
-[TRACE]TRACE_NORMAL[0x86]_TESTALTERNATEINTERFACEMANIPULATION_TESTALTERNATEINTERFACEMANIPULATION=0x7e
-[TRACE]TRACE_NORMAL[0x86]_TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS=0x8f
-[TRACE]TRACE_NORMAL[0x86]_TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS_DUP01=0x90
-[TRACE]TRACE_NORMAL[0x86]_TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS_DUP02=0x91
-[TRACE]TRACE_NORMAL[0x86]_TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE=0xd3
-[TRACE]TRACE_NORMAL[0x86]_TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE_DUP01=0xd4
-[TRACE]TRACE_NORMAL[0x86]_TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE_DUP02=0xd5
-[TRACE]TRACE_NORMAL[0x86]_TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE_DUP03=0xd6
-[TRACE]TRACE_NORMAL[0x86]_TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE_DUP04=0xd7
-[TRACE]TRACE_NORMAL[0x86]_TESTBILALTERNATESETTINGCHANGE_TESTBILALTERNATESETTINGCHANGE_DUP05=0xd8
-[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0=0xd9
-[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP01=0xda
-[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP02=0xdb
-[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP03=0xdc
-[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP04=0xdd
-[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP05=0xde
-[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP06=0xdf
-[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP07=0xe0
-[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP08=0xe1
-[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP09=0xe2
-[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP10=0xe3
-[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP11=0xe4
-[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP12=0xe5
-[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP13=0xe6
-[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP14=0xe7
-[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP15=0xe8
-[TRACE]TRACE_NORMAL[0x86]_TESTBILEP0_TESTBILEP0_DUP16=0xe9
-[TRACE]TRACE_NORMAL[0x86]_TESTBILREADWRITE_TESTBILREADWRITE=0xc8
-[TRACE]TRACE_NORMAL[0x86]_TESTBILREADWRITE_TESTBILREADWRITE_DUP01=0xc9
-[TRACE]TRACE_NORMAL[0x86]_TESTBILREADWRITE_TESTBILREADWRITE_DUP02=0xca
-[TRACE]TRACE_NORMAL[0x86]_TESTBILREADWRITE_TESTBILREADWRITE_DUP03=0xcb
-[TRACE]TRACE_NORMAL[0x86]_TESTBILREADWRITE_TESTBILREADWRITE_DUP04=0xcc
-[TRACE]TRACE_NORMAL[0x86]_TESTBILREADWRITE_TESTBILREADWRITE_DUP05=0xcd
-[TRACE]TRACE_NORMAL[0x86]_TESTBILREADWRITE_TESTBILREADWRITE_DUP06=0xce
-[TRACE]TRACE_NORMAL[0x86]_TESTBILREADWRITE_TESTBILREADWRITE_DUP07=0xcf
-[TRACE]TRACE_NORMAL[0x86]_TESTBILREADWRITE_TESTBILREADWRITE_DUP08=0xd0
-[TRACE]TRACE_NORMAL[0x86]_TESTBILREADWRITE_TESTBILREADWRITE_DUP09=0xd1
-[TRACE]TRACE_NORMAL[0x86]_TESTBILREADWRITE_TESTBILREADWRITE_DUP10=0xd2
-[TRACE]TRACE_NORMAL[0x86]_TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION=0x1
-[TRACE]TRACE_NORMAL[0x86]_TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION_DUP01=0x2
-[TRACE]TRACE_NORMAL[0x86]_TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION_DUP02=0x3
-[TRACE]TRACE_NORMAL[0x86]_TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION_DUP03=0x4
-[TRACE]TRACE_NORMAL[0x86]_TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION_DUP04=0x5
-[TRACE]TRACE_NORMAL[0x86]_TESTBUFFERCONSTRUCTION_TESTBUFFERCONSTRUCTION_DUP05=0x6
-[TRACE]TRACE_NORMAL[0x86]_TESTBUFFERHANDLING_TESTBUFFERHANDLING=0x25
-[TRACE]TRACE_NORMAL[0x86]_TESTBUFFERHANDLING_TESTBUFFERHANDLING_DUP01=0x26
-[TRACE]TRACE_NORMAL[0x86]_TESTBUFFERHANDLING_TESTBUFFERHANDLING_DUP02=0x27
-[TRACE]TRACE_NORMAL[0x86]_TESTBUFFERHANDLING_TESTBUFFERHANDLING_DUP03=0x28
-[TRACE]TRACE_NORMAL[0x86]_TESTCANCEL_TESTCANCEL=0x51
-[TRACE]TRACE_NORMAL[0x86]_TESTCANCEL_TESTCANCEL_DUP01=0x52
-[TRACE]TRACE_NORMAL[0x86]_TESTCANCEL_TESTCANCEL_DUP02=0x53
-[TRACE]TRACE_NORMAL[0x86]_TESTCANCEL_TESTCANCEL_DUP03=0x54
-[TRACE]TRACE_NORMAL[0x86]_TESTDEVICEQUALIFIERDESCRIPTOR_TESTDEVICEQUALIFIERDESCRIPTOR=0x7c
-[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINTSTALLSTATUS_TESTENDPOINTSTALLSTATUS=0x93
-[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINTSTATUSNOTIFY_TESTENDPOINTSTATUSNOTIFY=0x94
-[TRACE]TRACE_NORMAL[0x86]_TESTENDPOINTSTATUSNOTIFY_TESTENDPOINTSTATUSNOTIFY_DUP01=0x95
-[TRACE]TRACE_NORMAL[0x86]_TESTEXTENDEDENDPOINTDESCRIPTOR_TESTEXTENDEDENDPOINTDESCRIPTOR=0x7f
-[TRACE]TRACE_NORMAL[0x86]_TESTINVALIDAPI_TESTINVALIDAPI=0x55
-[TRACE]TRACE_NORMAL[0x86]_TESTOTHERSPEEDCONFIGURATIONDESCRIPTOR_TESTOTHERSPEEDCONFIGURATIONDESCRIPTOR=0x7d
-[TRACE]TRACE_NORMAL[0x86]_TESTSETINTERFACE_TESTSETINTERFACE=0x56
-[TRACE]TRACE_NORMAL[0x86]_TESTSETINTERFACE_TESTSETINTERFACE_DUP01=0x57
-[TRACE]TRACE_NORMAL[0x86]_TESTSETINTERFACE_TESTSETINTERFACE_DUP02=0x58
-[TRACE]TRACE_NORMAL[0x86]_TESTSETINTERFACE_TESTSETINTERFACE_DUP03=0x59
-[TRACE]TRACE_NORMAL[0x86]_TESTSETINTERFACE_TESTSETINTERFACE_DUP04=0x5a
-[TRACE]TRACE_NORMAL[0x86]_TESTSETINTERFACE_TESTSETINTERFACE_DUP05=0x5b
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS=0x80
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP01=0x81
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP02=0x82
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP03=0x83
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP04=0x84
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP05=0x85
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP06=0x86
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP07=0x87
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP08=0x88
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP09=0x89
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP10=0x8a
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP11=0x8b
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP12=0x8c
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP13=0x8d
-[TRACE]TRACE_NORMAL[0x86]_TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP14=0x8e
-[TRACE]TRACE_NORMAL[0x86]_TINTERFACE_DTINTERFACE=0x1d
-[TRACE]TRACE_NORMAL[0x86]_TINTERFACE_SETACTIVEALTERNATESETTING=0x1e
-[TRACE]TRACE_NORMAL[0x86]_USER_AFTER=0x29
-[TRACE]TRACE_NORMAL[0x86]_USER_AFTER_DUP01=0x2a
-[TRACE]TRACE_NORMAL[0x86]_USER_AFTER_DUP02=0x2b
-[TRACE]TRACE_NORMAL[0x86]_USER_AFTER_DUP03=0x2c
-[TRACE]TRACE_NORMAL[0x86]_USER_AFTER_DUP04=0x2d
-[TRACE]TRACE_NORMAL[0x86]_USER_AFTER_DUP05=0x2e
--- a/kerneltest/e32test/usb/t_usb_device/configs/scvascobm.xml	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-<LDD name="eusbcsc">
-<ENDPOINTS>30</ENDPOINTS>
-<SOFTCONNECT>Y</SOFTCONNECT>
-<SELFPOWER>N</SELFPOWER>
-<REMOTEWAKEUP>N</REMOTEWAKEUP>
-<HIGHSPEED>Y</HIGHSPEED>
-<FEATURES>1</FEATURES>
-<MAXPOWER>50</MAXPOWER>
-<EPSTALL>Y</EPSTALL>
-<SPEC>0x200</SPEC>
-<VID>0xE22</VID>
-<PID>0x1110</PID>
-<RELEASE>0x305</RELEASE>
-<PRODUCT>VascoDevice</PRODUCT>
-<INTERFACE>
-<CLASS>255</CLASS>
-<SUBCLASS>255</SUBCLASS>
-<PROTOCOL>255</PROTOCOL>
-<DESCRIPTOR>"T_USB Test Interface 0 (Default Setting 0)"</DESCRIPTOR>
-<ENDPOINT type="BULK" direction="IN">
-<BUFFERSIZE>300000</BUFFERSIZE>
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="BULK" direction="OUT">
-<BUFFERSIZE>300000</BUFFERSIZE>
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="BULK" direction="IN">
-<BUFFERSIZE>300000</BUFFERSIZE>
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="BULK" direction="OUT">
-<BUFFERSIZE>300000</BUFFERSIZE>
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-</INTERFACE>
-</LDD>
\ No newline at end of file
--- a/kerneltest/e32test/usb/t_usb_device/configs/scvascoif0.xml	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-<LDD name="eusbcsc">
-<ENDPOINTS>30</ENDPOINTS>
-<SOFTCONNECT>Y</SOFTCONNECT>
-<SELFPOWER>N</SELFPOWER>
-<REMOTEWAKEUP>N</REMOTEWAKEUP>
-<HIGHSPEED>Y</HIGHSPEED>
-<FEATURES>1</FEATURES>
-<MAXPOWER>50</MAXPOWER>
-<EPSTALL>Y</EPSTALL>
-<SPEC>0x200</SPEC>
-<VID>0xE22</VID>
-<PID>0x1110</PID>
-<RELEASE>0x305</RELEASE>
-<PRODUCT>VascoDevice</PRODUCT>
-<INTERFACE>
-<CLASS>255</CLASS>
-<SUBCLASS>255</SUBCLASS>
-<PROTOCOL>255</PROTOCOL>
-<DESCRIPTOR>"T_USB Test Interface 0 (Default Setting 0)"</DESCRIPTOR>
-<ENDPOINT type="BULK" direction="IN">
-<BUFFERSIZE>128000</BUFFERSIZE>
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="BULK" direction="OUT">
-<BUFFERSIZE>128000</BUFFERSIZE>
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-</INTERFACE>
-</LDD>
\ No newline at end of file
--- a/kerneltest/e32test/usb/t_usb_device/configs/scvascoif0a3.xml	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-<LDD name="eusbcsc">
-<ENDPOINTS>30</ENDPOINTS>
-<SOFTCONNECT>Y</SOFTCONNECT>
-<SELFPOWER>N</SELFPOWER>
-<REMOTEWAKEUP>N</REMOTEWAKEUP>
-<HIGHSPEED>Y</HIGHSPEED>
-<FEATURES>1</FEATURES>
-<MAXPOWER>50</MAXPOWER>
-<EPSTALL>Y</EPSTALL>
-<SPEC>0x200</SPEC>
-<VID>0xE22</VID>
-<PID>0x1110</PID>
-<RELEASE>0x305</RELEASE>
-<PRODUCT>VascoDevice</PRODUCT>
-<INTERFACE>
-<CLASS>255</CLASS>
-<SUBCLASS>255</SUBCLASS>
-<PROTOCOL>255</PROTOCOL>
-<DESCRIPTOR>"T_USB Test Interface 0 (Default Setting 0)"</DESCRIPTOR>
-<ENDPOINT type="BULK" direction="IN">
-<BUFFERSIZE>128000</BUFFERSIZE>
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="BULK" direction="OUT">
-<BUFFERSIZE>128000</BUFFERSIZE>
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="INTERRUPT" direction="IN">
-<BUFFERSIZE>128000</BUFFERSIZE>
-<INTERVAL>1</INTERVAL>
-<SIZE>64</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="INTERRUPT" direction="OUT">
-<BUFFERSIZE>128000</BUFFERSIZE>
-<INTERVAL>1</INTERVAL>
-<SIZE>64</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="BULK" direction="IN">
-<BUFFERSIZE>128000</BUFFERSIZE>
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-</INTERFACE>
-<ALT_SETTING>
-<CLASS>255</CLASS>
-<SUBCLASS>255</SUBCLASS>
-<PROTOCOL>255</PROTOCOL>
-<DESCRIPTOR>"T_USB Test Interface 0 (Alternate Setting 1)"</DESCRIPTOR>
-<ENDPOINT type="INTERRUPT" direction="IN">
-<BUFFERSIZE>128000</BUFFERSIZE>
-<INTERVAL>1</INTERVAL>
-<SIZE>64</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="INTERRUPT" direction="OUT">
-<BUFFERSIZE>128000</BUFFERSIZE>
-<INTERVAL>1</INTERVAL>
-<SIZE>64</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="BULK" direction="IN">
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="BULK" direction="OUT">
-<BUFFERSIZE>128000</BUFFERSIZE>
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="BULK" direction="OUT">
-<BUFFERSIZE>128000</BUFFERSIZE>
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-</ALT_SETTING>
-<ALT_SETTING>
-<CLASS>255</CLASS>
-<SUBCLASS>255</SUBCLASS>
-<PROTOCOL>255</PROTOCOL>
-<DESCRIPTOR>"T_USB Test Interface 0 (Alternate Setting 2)"</DESCRIPTOR>
-<ENDPOINT type="BULK" direction="IN">
-<BUFFERSIZE>128000</BUFFERSIZE>
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="BULK" direction="OUT">
-<BUFFERSIZE>128000</BUFFERSIZE>
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="BULK" direction="OUT">
-<BUFFERSIZE>128000</BUFFERSIZE>
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="INTERRUPT" direction="IN">
-<BUFFERSIZE>128000</BUFFERSIZE>
-<SIZE>64</SIZE>
-<INTERVAL>1</INTERVAL>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="BULK" direction="OUT">
-<BUFFERSIZE>128000</BUFFERSIZE>
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-</ALT_SETTING>
-</LDD>
\ No newline at end of file
--- a/kerneltest/e32test/usb/t_usb_device/configs/scvascoif0a3if1a2if2.xml	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-<LDD name="eusbcsc">
-<ENDPOINTS>30</ENDPOINTS>
-<SOFTCONNECT>Y</SOFTCONNECT>
-<SELFPOWER>N</SELFPOWER>
-<REMOTEWAKEUP>N</REMOTEWAKEUP>
-<HIGHSPEED>Y</HIGHSPEED>
-<FEATURES>1</FEATURES>
-<MAXPOWER>50</MAXPOWER>
-<EPSTALL>Y</EPSTALL>
-<SPEC>0x200</SPEC>
-<VID>0xE22</VID>
-<PID>0x1110</PID>
-<RELEASE>0x305</RELEASE>
-<PRODUCT>VascoDevice</PRODUCT>
-<INTERFACE>
-<CLASS>255</CLASS>
-<SUBCLASS>255</SUBCLASS>
-<PROTOCOL>255</PROTOCOL>
-<DESCRIPTOR>"T_USB Test Interface 0 (Default Setting 0)"</DESCRIPTOR>
-<ENDPOINT type="BULK" direction="IN">
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="BULK" direction="OUT">
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="INTERRUPT" direction="IN">
-<INTERVAL>1</INTERVAL>
-<SIZE>64</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="INTERRUPT" direction="OUT">
-<INTERVAL>1</INTERVAL>
-<SIZE>64</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="BULK" direction="IN">
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-</INTERFACE>
-<ALT_SETTING>
-<CLASS>255</CLASS>
-<SUBCLASS>255</SUBCLASS>
-<PROTOCOL>255</PROTOCOL>
-<DESCRIPTOR>"T_USB Test Interface 0 (Alternate Setting 1)"</DESCRIPTOR>
-<ENDPOINT type="INTERRUPT" direction="IN">
-<INTERVAL>1</INTERVAL>
-<SIZE>64</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="INTERRUPT" direction="OUT">
-<INTERVAL>1</INTERVAL>
-<SIZE>64</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="BULK" direction="IN">
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="BULK" direction="OUT">
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="BULK" direction="OUT">
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-</ALT_SETTING>
-<ALT_SETTING>
-<CLASS>255</CLASS>
-<SUBCLASS>255</SUBCLASS>
-<PROTOCOL>255</PROTOCOL>
-<DESCRIPTOR>"T_USB Test Interface 0 (Alternate Setting 2)"</DESCRIPTOR>
-<ENDPOINT type="BULK" direction="IN">
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="BULK" direction="OUT">
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="BULK" direction="OUT">
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="INTERRUPT" direction="IN">
-<SIZE>64</SIZE>
-<INTERVAL>1</INTERVAL>
-<DMA>N</DMA>
-</ENDPOINT>
-<ENDPOINT type="BULK" direction="OUT">
-<SIZE>512</SIZE>
-<DMA>N</DMA>
-</ENDPOINT>
-</ALT_SETTING>
-<INTERFACE>
-<CLASS>255</CLASS>
-<SUBCLASS>255</SUBCLASS>
-<PROTOCOL>255</PROTOCOL>
-<DESCRIPTOR>"T_USB Test Interface 1 (Default Setting 0)"</DESCRIPTOR>
-<ENDPOINT type="BULK" direction="IN">
-<SIZE>512</SIZE>
-<DMA>Y</DMA>
-</ENDPOINT>
-<ENDPOINT type="BULK" direction="OUT">
-<SIZE>512</SIZE>
-<DMA>Y</DMA>
-</ENDPOINT>
-</INTERFACE>
-<ALT_SETTING>
-<CLASS>255</CLASS>
-<SUBCLASS>255</SUBCLASS>
-<PROTOCOL>255</PROTOCOL>
-<DESCRIPTOR>"T_USB Test Interface 1 (Alternate Setting 1)"</DESCRIPTOR>
-<ENDPOINT type="BULK" direction="OUT">
-<SIZE>512</SIZE>
-<DMA>Y</DMA>
-</ENDPOINT>
-<ENDPOINT type="INTERRUPT" direction="IN">
-<INTERVAL>1</INTERVAL>
-<SIZE>64</SIZE>
-<DMA>Y</DMA>
-</ENDPOINT>
-</ALT_SETTING>
-<INTERFACE>
-<CLASS>255</CLASS>
-<SUBCLASS>255</SUBCLASS>
-<PROTOCOL>255</PROTOCOL>
-<DESCRIPTOR>"T_USB Test Interface 2 (Default Setting 0)"</DESCRIPTOR>
-<ENDPOINT type="INTERRUPT" direction="IN">
-<INTERVAL>1</INTERVAL>
-<SIZE>64</SIZE>
-<DMA>Y</DMA>
-</ENDPOINT>
-<ENDPOINT type="BULK" direction="OUT">
-<SIZE>512</SIZE>
-<DMA>Y</DMA>
-</ENDPOINT>
-</INTERFACE>
-</LDD>
\ No newline at end of file
--- a/kerneltest/e32test/usb/t_usb_device/include/activecontrol.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/include/activecontrol.h	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,8 +20,6 @@
 
 #include "activestallnotifier.h"
 #include "activedevicestatenotifier.h"
-#include "transfersrv.h"
-#include "config.h"
 
 static const TInt KSetupPacketSize = 8;
 static const TInt KMaxControlBufferSize = 256;
@@ -53,8 +51,6 @@
 
 class CActiveRW;
 
-class CTranHandleServer;
-
 class CActiveControl : public CActive
 	{
 public:
@@ -68,9 +64,6 @@
 	void AllocateDoubleBuffering(RDEVCLIENT* aPort,TENDPOINTNUMBER aEndpoint);
 	void DeAllocateEndpointDMA(RDEVCLIENT* aPort,TENDPOINTNUMBER aEndpoint);
 	void DeAllocateDoubleBuffering(RDEVCLIENT* aPort,TENDPOINTNUMBER aEndpoint);
-#ifdef USB_SC	
-	void ConstructLOnSharedLdd(const RMessagePtr2& aMsg);
-#endif
 
 private:
 	CActiveControl(CConsoleBase* aConsole, TDes * aConfigFile, TDes * aScriptFile);
@@ -90,9 +83,6 @@
 	
 	void FillEndpointsResourceAllocation(IFConfigPtr aIfCfg);
 	void PopulateInterfaceResourceAllocation(IFConfigPtr aFirstIfCfg, TInt aPortNumber);
-#ifdef USB_SC	
-	void SetupTransferedInterface(IFConfigPtr* aIfPtr, TInt aPortNumber);
-#endif
 	
 private:
 	CConsoleBase* iConsole;											// a console to read from
@@ -123,9 +113,6 @@
 	RThread iIdleCounterThread;
 	RChunk iIdleCounterChunk;
 	struct TTestIdleCounter* iIdleCounter;
-#ifdef USB_SC	
-	CTranHandleServer*        iTranHandleServer;
-#endif
 	};
 
 #endif	// __ACTIVECONTROL_H__
--- a/kerneltest/e32test/usb/t_usb_device/include/activedevicestatenotifier.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/include/activedevicestatenotifier.h	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,8 +18,6 @@
 #ifndef __ACTIVEDEVICESTATENOTIFIER_H__
 #define __ACTIVEDEVICESTATENOTIFIER_H__
 
-#include "general.h"
-
 class CActiveDeviceStateNotifier : public CActive
 	{
 public:
--- a/kerneltest/e32test/usb/t_usb_device/include/activerw.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/include/activerw.h	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -39,7 +39,6 @@
 	void ResumeAltSetting(TUint aAltSetting);
 	void SendWaitSetting();
 	void StartOrSuspend();
-	inline RDEVCLIENT* Ldd();
 			
 private:
 	CActiveRW(CConsoleBase* aConsole, RDEVCLIENT* aPort, RFs aFs, TUint16 aIndex, TBool aLastSetting);
@@ -87,9 +86,4 @@
 	TBool iLastSetting;
 	};
 
-inline RDEVCLIENT* CActiveRW::Ldd()
-	{
-	return iPort;
-	}
-
 #endif	// __ACTIVERW_H__
--- a/kerneltest/e32test/usb/t_usb_device/include/activestallnotifier.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/include/activestallnotifier.h	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,7 +18,6 @@
 #ifndef __ACTIVESTALLNOTIFIER_H__
 #define __ACTIVESTALLNOTIFIER_H__
 
-#include "general.h"
 
 class CActiveStallNotifier : public CActive
 	{
--- a/kerneltest/e32test/usb/t_usb_device/include/general.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/include/general.h	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1997-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"
@@ -143,65 +143,51 @@
 
 #define TUSB_PRINT(string) \
 		do { \
-			if (iConsole) \
-			{			\
-		    iConsole->Printf(_L(string)); \
-		    iConsole->Printf(_L("\n")); \
-			} \
+		iConsole->Printf(_L(string)); \
+		iConsole->Printf(_L("\n")); \
+		RDebug::Print(_L(string)); \
 		} while (0)
 
 #define TUSB_PRINT1(string, a) \
 		do { \
-		if (iConsole) \
-			{			\
-			iConsole->Printf(_L(string), (a)); \
-			iConsole->Printf(_L("\n")); \
-			}	\
+		iConsole->Printf(_L(string), (a)); \
+		iConsole->Printf(_L("\n")); \
+		RDebug::Print(_L(string), (a)); \
 		} while (0)
 
 #define TUSB_PRINT2(string, a, b) \
 		do { \
-			if (iConsole) \
-			{			\
-			iConsole->Printf(_L(string), (a), (b)); \
-			iConsole->Printf(_L("\n")); \
-			}	\
+		iConsole->Printf(_L(string), (a), (b)); \
+		iConsole->Printf(_L("\n")); \
+		RDebug::Print(_L(string), (a), (b)); \
 		} while (0)
 
 #define TUSB_PRINT3(string, a, b, c) \
 		do { \
-			if (iConsole) \
-			{			\
-			iConsole->Printf(_L(string), (a), (b), (c)); \
-			iConsole->Printf(_L("\n")); \
-			}	\
+		iConsole->Printf(_L(string), (a), (b), (c)); \
+		iConsole->Printf(_L("\n")); \
+		RDebug::Print(_L(string), (a), (b), (c)); \
 		} while (0)
 
 #define TUSB_PRINT4(string, a, b, c, d) \
 		do { \
-			if (iConsole) \
-			{			\
-			iConsole->Printf(_L(string), (a), (b), (c), (d)); \
-			iConsole->Printf(_L("\n")); \
-			}	\
+		iConsole->Printf(_L(string), (a), (b), (c), (d)); \
+		iConsole->Printf(_L("\n")); \
+		RDebug::Print(_L(string), (a), (b), (c), (d)); \
 		} while (0)
 
 #define TUSB_PRINT5(string, a, b, c, d, e) \
 		do { \
-			if (iConsole) \
-			{			\
-			iConsole->Printf(_L(string), (a), (b), (c), (d), (e)); \
-			iConsole->Printf(_L("\n")); \
-			}	\
+		iConsole->Printf(_L(string), (a), (b), (c), (d), (e)); \
+		iConsole->Printf(_L("\n")); \
+		RDebug::Print(_L(string), (a), (b), (c), (d), (e)); \
 		} while (0)
 
 #define TUSB_PRINT6(string, a, b, c, d, e, f) \
 		do { \
-			if (iConsole) \
-			{			\
-			iConsole->Printf(_L(string), (a), (b), (c), (d), (e), (f)); \
-			iConsole->Printf(_L("\n")); \
-			}	\
+		iConsole->Printf(_L(string), (a), (b), (c), (d), (e), (f)); \
+		iConsole->Printf(_L("\n")); \
+		RDebug::Print(_L(string), (a), (b), (c), (d), (e), (f)); \
 		} while (0)
 
 #define TUSB_VERBOSE_PRINT(string) \
@@ -256,11 +242,9 @@
 		do { \
 		if (gVerbose) \
 			{ \
-				if (iConsole) \
-				{			\
-				aConsole->Printf(_L(string)); \
-				aConsole->Printf(_L("\n")); \
-				}	\
+			aConsole->Printf(_L(string)); \
+			aConsole->Printf(_L("\n")); \
+			RDebug::Print(_L(string)); \
 			} \
 		} while (0)
 
@@ -268,6 +252,8 @@
 		do { \
 			TInt totalSize = 0; \
 			TInt numCells = User::AllocSize (totalSize); \
+			RDebug::Print(_L(string)); \
+			RDebug::Print(_L(" Heap Cells %d Size %d\n"),numCells,totalSize); \
 		} while (0)
 	
 #endif	// __GENERAL_H__
--- a/kerneltest/e32test/usb/t_usb_device/include/tranhandleserver.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
-* 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"
-* 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
- @internalComponent
-*/
-
-#ifndef TRANHANDLESERVER_H
-#define TRANHANDLESERVER_H
-
-#include <e32base.h>
-
-class CActiveControl;
-
-NONSHARABLE_CLASS(CTranHandleServer) : public CPolicyServer
-    {
-public:
-    static CTranHandleServer* NewL(CActiveControl& aControl);
-    ~CTranHandleServer();
-
-private:
-    CTranHandleServer(CActiveControl& aControl);
-    
-private:
-    // from CPolicyServer
-    CSession2* NewSessionL(const TVersion &aVersion, const RMessage2& aMessage) const;
-    
-private:
-    // unowned
-    CActiveControl& iActiveControl;
-    };
-
-#endif // TRANHANDLESERVER_H
\ No newline at end of file
--- a/kerneltest/e32test/usb/t_usb_device/include/tranhandleserverconsts.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
-* 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"
-* 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
- @internalComponent
-*/
-
-#ifndef TRANHANDLESERVERCONSTS_H
-#define TRANHANDLESERVERCONSTS_H
-
-#include <e32base.h>
-
-_LIT(KTranHandleServerName, "!TranHandleSrv");
-
-/** Version numbers. */
-const TInt8 KTranHandleSrvMajorVersionNumber = 1;
-const TInt8 KTranHandleSrvMinorVersionNumber = 1;
-const TInt16 KTranHandleSrvBuildNumber = 0;
-
-/** IPC messages supported by the server. */
-enum TNcmIpc
-    {
-    ETransferHandle              = 0,
-    ENotSupport
-    };
-    
-
-#endif // TRANHANDLESERVERCONSTS_H
\ No newline at end of file
--- a/kerneltest/e32test/usb/t_usb_device/include/tranhandleserversecuritypolicy.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
-* 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"
-* 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 
- @internalComponent
-*/
- 
-#ifndef TRANHANDLESERVERSECURITYPOLICY_H
-#define TRANHANDLESERVERSECURITYPOLICY_H
-
-#include <e32base.h>
-#include "tranhandleserverconsts.h"
-
-const TInt KTranHanleServerRanges[] = 
-    {
-    ETransferHandle,             /** pass */
-    ENotSupport,        /** fail (to KMaxTInt) */
-    };
-
-const TUint KTranHanleServerRangeCount = sizeof(KTranHanleServerRanges) / sizeof(KTranHanleServerRanges[0]);
-
-const TInt KPolicyPass = 0;
-
-const TUint8 KTranHanleServerElementsIndex[KTranHanleServerRangeCount] = 
-    {
-    KPolicyPass,                  /** All (valid) APIs */
-    CPolicyServer::ENotSupported,   /** remainder of possible IPCs */
-    };
-
-
-const CPolicyServer::TPolicyElement KTranHanleServerElements[] = 
-    {
-        { 
-        _INIT_SECURITY_POLICY_PASS
-        },
-    };
-
-/** Main policy */
-const CPolicyServer::TPolicy KTranHandleServerPolicy = 
-    {
-    CPolicyServer::EAlwaysPass, /** Specifies all connect attempts should pass */
-    KTranHanleServerRangeCount,
-    KTranHanleServerRanges,
-    KTranHanleServerElementsIndex,
-    KTranHanleServerElements,
-    };
-    
-#endif // TRANHANDLESERVERSECURITYPOLICY_H
\ No newline at end of file
--- a/kerneltest/e32test/usb/t_usb_device/include/tranhandlesession.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* 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"
-* 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
- @internalComponent
-*/
-
-#ifndef TRANHANDLESESSION_H
-#define TRANHANDLESESSION_H
-
-#include <e32base.h>
-
-
-class CActiveControl;
-
-NONSHARABLE_CLASS(CTranHandleSession) : public CSession2
-    {
-public:
-    static CTranHandleSession* NewL(CActiveControl& aControl);
-    ~CTranHandleSession();
-
-private:
-    CTranHandleSession(CActiveControl& aControl);
-
-private: // from CSession2
-
-    void ServiceL(const RMessage2& aMessage);
-
-private:
-    // unowned
-    CActiveControl& iActiveControl;
-    };
-
-#endif // TRANHANDLESESSION_H
\ No newline at end of file
--- a/kerneltest/e32test/usb/t_usb_device/include/tranhandlesrv.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
-* 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"
-* 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
-*/
-
-#ifndef TRANHANDLESRV_H
-#define TRANHANDLESRV_H
-
-#include <e32base.h>
-
-NONSHARABLE_CLASS(RTranHandleSrv) : public RSessionBase
-    {
-public:
-    IMPORT_C RTranHandleSrv();
-    IMPORT_C ~RTranHandleSrv();
-
-public:
-
-    IMPORT_C TInt Connect();
-    IMPORT_C TVersion Version() const;
-
-public:
-    IMPORT_C TInt TransferHandle(RHandleBase& aHandle, RHandleBase& aChunk);
-private:
-    };
-
-#endif // TRANHANDLESRV_H
\ No newline at end of file
--- a/kerneltest/e32test/usb/t_usb_device/include/tranhandlsession.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
-* 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"
-* 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
- @internalComponent
-*/
-
-#ifndef TRANHANDLESERVERCONSTS_H
-#define TRANHANDLESERVERCONSTS_H
-
-#include <e32base.h>
-
-_LIT(KTranHandleServerName, "!TranHandleSrv");
-
-/** Version numbers. */
-const TInt8 KNcmSrvMajorVersionNumber = 1;
-const TInt8 KNcmSrvMinorVersionNumber = 1;
-const TInt16 KNcmSrvBuildNumber = 0;
-
-/** IPC messages supported by the server. */
-enum TNcmIpc
-    {
-    ENcmTransferHandle              = 0,
-    ENcmSetIapId,
-    ENcmSetDhcpResult,
-    ENcmDhcpProvisionNotify,
-    ENcmDhcpProvisionNotifyCancel,
-    ENcmTransferBufferSize,
-    ENcmNotSupport
-    };
-    
-/** Panic category with which the ACM server panics the client. */
-_LIT(KNcmSrvPanic,"NCMServer");
-
-/** Panic codes with which the ACM server panics the client. */
-enum TNcmSvrPanic
-    {
-    /** The client has sent a bad IPC message number. */
-    ENcmBadNcmMessage        = 0
-    };
-    
-/** Set value to server. the value is defined by type.*/
-enum TNcmSetType
-    {
-    ENcmSetTypeIapId,
-    ENcmSetTypeDhcpReturn
-    };
-
-#endif // ACMSERVERCONSTS_H
--- a/kerneltest/e32test/usb/t_usb_device/include/transferhandle.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
-* 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"
-* 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:
-* Header file NTB build policy base class
-*
-*/
-
-
-/**
-@file
-@internalComponent
-*/
-
-#ifndef TRANSFERHANDLE_H
-#define TRANSFERHANDLE_H
-
-
-#include <e32base.h>
-
-class CTransferServer;
-
-NONSHARABLE_CLASS(CTransferHandle) : public CActive
-    {
-public:
-    static CTransferHandle* NewL(CTransferServer& aServer);
-    ~CTransferHandle();
-	void StartTimer();
-	
-private:
-	CTransferHandle(CTransferServer& aServer);
-	CTransferServer& iServer;
-	void RunL();
-    void DoCancel();
-    void ConstructL();
-    RTimer iTimer;
-};
-
-
-
-
-#endif //TRANSFERHANDLE_H
-
--- a/kerneltest/e32test/usb/t_usb_device/include/transferserver.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/**
-* Copyright (c) 1997-2009 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"
-* 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 Symbian OS server that exposes the RUsb API
-* 
-*
-*/
-
-
-
-/**
- @file
-*/
-
-#ifndef __CTRANSFERSERVER_H__
-#define __CTRANSFERSERVER_H__
-
-#include "general.h"
-#include "config.h"
-
-
-class CTransferHandle;
-
- NONSHARABLE_CLASS(CTransferServer) : public CPolicyServer
-	{
-public:
-	static CTransferServer* NewLC();
-	virtual ~CTransferServer();
-
-	virtual CSession2* NewSessionL(const TVersion &aVersion, const RMessage2& aMessage) const;
-	void Error(TInt aError);
-
-	void IncrementSessionCount();
-	void DecrementSessionCount();
-	inline TInt SessionCount() const;
-	void LaunchShutdownTimerIfNoSessions();
-	TInt SetupLdds(TDes& aFileName);
-	void TransferHandleL();
-
-protected:
-	CTransferServer();
-	void ConstructL();
-	
-private:	
-	TInt iSessionCount;
-	enum {KShutdownDelay = 2 * 1000 * 1000};	// 2 seconds
-	class CShutdownTimer : public CTimer
-		{
-	public:
-		CShutdownTimer();
-		void ConstructL();
-		virtual void RunL();
-		};
-	CShutdownTimer* iShutdownTimer;
-	
-	void SetupInterface(IFConfigPtr* aIfPtr, TInt aPortNumber);
-	void FillEndpointsResourceAllocation(IFConfigPtr aIfCfg);
-	void PopulateInterfaceResourceAllocation(IFConfigPtr aFirstIfCfg, TInt aPortNumber);
-	void QueryUsbClientL(LDDConfigPtr aLddPtr, RDEVCLIENT* aPort);	
-
-	TInt iTotalChannels;
-	RFs iFs;
-	RFile iConfigFile;
-	LDDConfigPtr iLddPtr;
-	RDEVCLIENT iPort[KMaxInterfaces];
-	TBool iSupportResourceAllocationV2;
-	TBool iSoftwareConnect;
-	CConsoleBase* iConsole;
-
-	CTransferHandle* iTransferHandle;
-	};
-
-#endif
--- a/kerneltest/e32test/usb/t_usb_device/include/transferserversecuritypolicy.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +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 "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:
-* USBMAN Server Security Policy definitions for Platform security.
-*
-*/
-
-/**
- @file 
- @internalComponent
-*/
- 
-#if !defined(__TRANSFERSERVERSECURITYPOLICY_H__)
-#define __TRANSFERSERVERSECURITYPOLICY_H__
-
-
-const TInt KTransferServerRanges[] = 
-	{
-	ESetConfigFileName,                 			/** pass 		*/
-	ETransferNotSupport					 				/** fail (to KMaxTInt) 	*/
-	};
-
-const TUint KTransferServerRangeCount = sizeof(KTransferServerRanges) / sizeof(KTransferServerRanges[0]);
-
-/** Index numbers into KAcmServerElements[] */
-const TInt KPolicyPass = 0;
-
-/** Mapping IPCs to policy element */
-const TUint8 KTransferServerElementsIndex[KTransferServerRangeCount] = 
-    {
-    KPolicyPass,                  /** All (valid) APIs */
-    CPolicyServer::ENotSupported,   /** remainder of possible IPCs */
-    };
-
-/** Individual policy elements */
-const CPolicyServer::TPolicyElement KTransferServerElements[] = 
-	{
-  		{ _INIT_SECURITY_POLICY_PASS },
-	};
-
-/** Main policy */
-const CPolicyServer::TPolicy KTransferServerPolicy = 
-	{
-	CPolicyServer::EAlwaysPass, /** Specifies all connect attempts should pass */
-	KTransferServerRangeCount,
-	KTransferServerRanges,
-	KTransferServerElementsIndex,
-	KTransferServerElements,
-	};
-#endif //__TRANSFERSERVERSECURITYPOLICY_H__
--- a/kerneltest/e32test/usb/t_usb_device/include/transfersession.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/**
-* Copyright (c) 1997-2009 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"
-* 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 Session of a Symbian OS server for the RUsb API
-* 
-*
-*/
-
-
-
-/**
- @file
-*/
-
-#ifndef __CTRANSFERSESSION_H__
-#define __CTRANSFERSESSION_H__
-
-#include <e32std.h>
-#include "general.h"
-
-class CTransferServer;
-class CTransferHandle;
-
-NONSHARABLE_CLASS(CTransferSession) : public CSession2
-	{
-public:
-	static CTransferSession* NewL(CTransferServer* aServer);
-	virtual ~CTransferSession();
-
-	// CSession2
-	virtual void ServiceL(const RMessage2& aMessage);
-	virtual void CreateL();
-	void TransferHandleL();
-
-protected:
-	CTransferSession(CTransferServer* aServer);
-
-	void DispatchMessageL(const RMessage2& aMessage);
-
-private:
-	CTransferServer* iTransferServer;
-	CConsoleBase* iConsole;
-		
-	};
-
-#endif //__CTRANSFERSESSION_H__
--- a/kerneltest/e32test/usb/t_usb_device/include/transfersrv.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
-* Copyright (c) 2003-2009 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"
-* 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 required for RUsb
-*
-*/
-
-/**
- @file
- @internalComponent
-*/
-
-#ifndef __TRANSFER_H__
-#define __TRANSFER_H__
-
-#include <e32std.h>
-#include <e32base.h>
-
-
-_LIT(KTransferServerName, "!transferserver");
-
-const TInt KTransferSrvMajorVersionNumber = 1;
-const TInt KTransferSrvMinorVersionNumber = 1;
-const TInt KTransferSrvBuildVersionNumber = 0;
-
-const TUid KTransferSvrUid = {0x101FE1DB};
-
-
-enum TTransferMessages
-	{
-	ESetConfigFileName,
-	ETransferNotSupport
-	};
-
-NONSHARABLE_CLASS(RTransferSrv) : public RSessionBase
-    {
-public:
-    IMPORT_C RTransferSrv();
-    IMPORT_C ~RTransferSrv();
-
-public:
-    IMPORT_C TInt Connect();
-    IMPORT_C TVersion Version() const;
-	IMPORT_C TInt SetConfigFileName(TDes& aString);
-
-    };
-
-#endif //__TRANSFER_H__
-
--- a/kerneltest/e32test/usb/t_usb_device/src/activecontrol.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/activecontrol.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -14,25 +14,16 @@
 // e32test/usb/t_usb_device/src/activecontrol.cpp
 // USB Test Program T_USB_DEVICE, functional part.
 // Device-side part, to work against T_USB_HOST running on the host.
-//
+// 
 //
 
 
-#include "general.h"
+#include "general.h"									
 #include "usblib.h"											// Helpers
 #include "config.h"
 #include "activecontrol.h"
 #include "apitests.h"
 #include "activerw.h"
-#ifdef USB_SC
-#include "tranhandleserver.h"
-#endif
-
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "activecontrolTraces.h"
-#endif
-
 
 void StartMassStorage(RDEVCLIENT* aPort);
 void StopMassStorage(RDEVCLIENT* aPort);
@@ -51,9 +42,6 @@
 	};
 
 extern RTest test;
-#ifdef USB_SC
-extern TBool gShareHandle;
-#endif
 extern TBool gVerbose;
 extern TBool gSkip;
 extern TBool gTempTest;
@@ -163,37 +151,21 @@
 	return self;
 	}
 
+
 void CActiveControl::ConstructL()
 	{
 	CActiveScheduler::Add(this);
-#ifdef USB_SC
-	if (gShareHandle)
-		{
-		// to do add call to server to transfer config file name
-		iTranHandleServer = CTranHandleServer::NewL(*this);
-		RTransferSrv aSrv;
-		test.Next (_L("ConstructL"));
-		User::LeaveIfError(aSrv.Connect());
-		CleanupClosePushL(aSrv);	
-		test.Next (_L("ConstructL1"));
-		User::LeaveIfError(aSrv.SetConfigFileName(*iConfigFileName));
-		test.Next (_L("ConstructL2"));
-		CleanupStack::Pop();
-		aSrv.Close();
-		return;
-		}
-#endif
 	TInt r;
-
+	
 	User::LeaveIfError(iFs.Connect());
 
 	test.Start (_L("Configuration"));
-
+	
 	test_Compare(iConfigFileName->Length(),!=,0);
-
+		
 	iTimer.CreateLocal();
 	iPending = EPendingNone;
-
+	
 	test.Next (_L("Open configuration file"));
 	// set the session path to use the ROM if no drive specified
 	r=iFs.SetSessionPath(_L("Z:\\test\\"));
@@ -202,19 +174,15 @@
 	r = iConfigFile.Open(iFs, * iConfigFileName, EFileShareReadersOnly | EFileStreamText | EFileRead);
 	test_KErrNone(r);
 	TUSB_VERBOSE_PRINT1("Configuration file %s Opened successfully", iConfigFileName->PtrZ());
-	if(gVerbose)
-	    {
-	    OstTraceExt1(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTL, "Configuration file %S Opened successfully", *iConfigFileName);
-	    }
 
 	test.Next (_L("Process configuration file"));
 	test(ProcessConfigFile (iConfigFile,iConsole,&iLddPtr));
-
+	
 	iConfigFile.Close();
 
 	test.Next (_L("LDD in configuration file"));
 	test_NotNull(iLddPtr);
-
+		
 	LDDConfigPtr lddPtr = iLddPtr;
 	TInt nextPort = 0;
 	while (lddPtr != NULL)
@@ -224,15 +192,11 @@
 		//  was already loaded at boot time.)
 		test.Next (_L("Loading USB LDD"));
 		TUSB_VERBOSE_PRINT1("Loading USB LDD ",lddPtr->iName.PtrZ());
-		if(gVerbose)
-		    {
-		    OstTraceExt1(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTL_DUP01, "Loading USB LDD:%S ", lddPtr->iName);
-		    }
 		r = User::LoadLogicalDevice(lddPtr->iName);
 		test(r == KErrNone || r == KErrAlreadyExists);
-
+	
 		IFConfigPtr ifPtr = lddPtr->iIFPtr;
-
+		
 		test.Next (_L("Opening Channels"));
 		for (TInt portNumber = nextPort; portNumber < nextPort+lddPtr->iNumChannels; portNumber++)
 			{
@@ -242,10 +206,6 @@
 			r = iPort[portNumber].Open(0);
 			test_KErrNone(r);
 			TUSB_VERBOSE_PRINT("Successfully opened USB port");
-			if(gVerbose)
-			    {
-			    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTL_DUP02, "Successfully opened USB port");
-			    }
 
 			// Query the USB device/Setup the USB interface
 			if (portNumber == nextPort)
@@ -253,22 +213,22 @@
 				// Change some descriptors to contain suitable values
 				SetupDescriptors(lddPtr, &iPort[portNumber]);
 				}
-
+				
 			if (portNumber == 0)
 				{
 				QueryUsbClientL(lddPtr, &iPort[portNumber]);
 				}
 
 			test_NotNull(ifPtr);
-
+			
 			if (iSupportResourceAllocationV2)
 				{
 				PopulateInterfaceResourceAllocation(ifPtr, portNumber);
 				}
-
+				
 			IFConfigPtr defaultIfPtr = ifPtr;
 			SetupInterface(&ifPtr,portNumber);
-
+					
 			#ifdef USB_SC
 			RChunk *tChunk = &gChunk;
 			test_KErrNone(iPort[portNumber].FinalizeInterface(tChunk));
@@ -283,21 +243,17 @@
 					#ifndef USB_SC
 					defaultIfPtr->iEpDoubleBuff[i-1] ? AllocateDoubleBuffering(&iPort[portNumber],(TENDPOINTNUMBER)i) : DeAllocateDoubleBuffering(&iPort[portNumber],(TENDPOINTNUMBER)i);
 					#endif
-					}
+					}				
 				}
 			}
-
+	
 		iTotalChannels += lddPtr->iNumChannels;
-		nextPort += lddPtr->iNumChannels;
-		lddPtr = lddPtr->iPtrNext;
+		nextPort += lddPtr->iNumChannels;	
+		lddPtr = lddPtr->iPtrNext;	
 		}
-
+		
 	TUSB_VERBOSE_PRINT("All Interfaces and Alternate Settings successfully set up");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTL_DUP03, "All Interfaces and Alternate Settings successfully set up");
-	    }
-
+	
 	test.Next (_L("Start Idle Counter Thread"));
 	r = iIdleCounterThread.Create(_L("IdleCounter"), IdleCounterThread, KDefaultStackSize, KMinHeapSize, KMinHeapSize, NULL);
 	test_KErrNone(r);
@@ -314,25 +270,20 @@
 	User::After(1000000); // 1 second
 	TInt64 val2 = iIdleCounter->iCounter;
 	TUSB_PRINT1("Idle Counter when test inactive: %Ldinc/ms", (val2 - val1) / 1000);
-	OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_CONSTRUCTL_DUP04, "Idle Counter when test inactive: %Ldinc/ms", (val2 - val1) / 1000);
 
 	test.Next (_L("Enumeration..."));
 	r = ReEnumerate();
 	test_KErrNone(r);
-
+		
 	TUSB_VERBOSE_PRINT("Device successfully re-enumerated\n");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTL_DUP05, "Device successfully re-enumerated\n");
-	    }
 
 
 	if (iLddPtr->iHighSpeed && !gSkip)
 		{
 		test.Next (_L("High Speed"));
-		test(iHighSpeed);
+		test(iHighSpeed);	
 		}
-
+			
 	test.Next (_L("Create Notifiers"));
 	for (TInt portNumber = 0; portNumber < iTotalChannels; portNumber++)
 		{
@@ -342,26 +293,18 @@
 		test_NotNull(iDeviceStateNotifier[portNumber]);
 		iDeviceStateNotifier[portNumber]->Activate();
 		TUSB_VERBOSE_PRINT("Created device state notifier");
-		if(gVerbose)
-		    {
-		    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTL_DUP06, "Created device state notifier");
-		    }
 
 		// Create endpoint stall status active object
 		iStallNotifier[portNumber] = CActiveStallNotifier::NewL(iConsole, &iPort[portNumber]);
 		test_NotNull(iStallNotifier[portNumber]);
 		iStallNotifier[portNumber]->Activate();
 		TUSB_VERBOSE_PRINT("Created stall notifier");
-		if(gVerbose)
-		    {
-		    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTL_DUP07, "Created stall notifier");
-		    }
-
-		TestInvalidSetInterface (&iPort[portNumber],iNumInterfaceSettings[portNumber]);
+			
+		TestInvalidSetInterface (&iPort[portNumber],iNumInterfaceSettings[portNumber]);			
 		TestInvalidReleaseInterface (&iPort[portNumber],iNumInterfaceSettings[portNumber]);
-
+			
 		}
-
+		
 	test.Next (_L("Endpoint Zero Max Packet Sizes"));
 	TUint ep0Size = iPort[0].EndpointZeroMaxPacketSizes();
 	switch (ep0Size)
@@ -369,7 +312,7 @@
 		case KUsbEpSize8 :
 			iEp0PacketSize = 8;
 			break;
-
+					
 		case KUsbEpSize16 :
 			iEp0PacketSize = 16;
 			break;
@@ -381,10 +324,10 @@
 		case KUsbEpSize64 :
 			iEp0PacketSize = 64;
 			break;
-
+					
 		default:
 			iEp0PacketSize = 0;
-			break;
+			break;		
 		}
 	test_Compare(iEp0PacketSize,>,0);
 
@@ -396,9 +339,9 @@
 	r = iPort[0].OpenEndpoint(iEp0Buf,0);
 	test_KErrNone(r);
 	#endif
-
+	
 	test.End();
-
+	
 	}
 
 void CActiveControl::ReConnect()
@@ -411,7 +354,7 @@
 	while (lddPtr != NULL)
 		{
 		IFConfigPtr ifPtr = lddPtr->iIFPtr;
-
+		
 		test.Next (_L("Opening Channels"));
 		for (TInt portNumber = nextPort; portNumber < nextPort+lddPtr->iNumChannels; portNumber++)
 			{
@@ -419,10 +362,6 @@
 			r = iPort[portNumber].Open(0);
 			test_KErrNone(r);
 			TUSB_VERBOSE_PRINT("Successfully opened USB port");
-			if(gVerbose)
-			    {
-			    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_RECONNECT, "Successfully opened USB port");
-			    }
 
 			// Query the USB device/Setup the USB interface
 			if (portNumber == nextPort)
@@ -430,15 +369,15 @@
 				// Change some descriptors to contain suitable values
 				SetupDescriptors(lddPtr, &iPort[portNumber]);
 				}
-
+				
 			IFConfigPtr defaultIfPtr = ifPtr;
 			SetupInterface(&ifPtr,portNumber);
-
+					
 			#ifdef USB_SC
 			RChunk *tChunk = &gChunk;
 			test_KErrNone(iPort[portNumber].FinalizeInterface(tChunk));
 			#endif
-
+			
 			if (!iSupportResourceAllocationV2)
 				{
 				// 	allocate endpoint DMA and double buffering for all endpoints on default interface with resource allocation v1 api
@@ -449,29 +388,21 @@
 					defaultIfPtr->iEpDoubleBuff[i-1] ? AllocateDoubleBuffering(&iPort[portNumber],(TENDPOINTNUMBER)i) : DeAllocateDoubleBuffering(&iPort[portNumber],(TENDPOINTNUMBER)i);
 					#endif
 					}
-				}
+				}				
 			}
-
-		nextPort += lddPtr->iNumChannels;
-		lddPtr = lddPtr->iPtrNext;
+	
+		nextPort += lddPtr->iNumChannels;	
+		lddPtr = lddPtr->iPtrNext;	
 		}
-
+		
 	TUSB_VERBOSE_PRINT("All Interfaces and Alternate Settings successfully set up");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_RECONNECT_DUP01, "All Interfaces and Alternate Settings successfully set up");
-	    }
 
 	test.Next (_L("Enumeration..."));
 	r = ReEnumerate();
 	test_KErrNone(r);
-
+		
 	TUSB_VERBOSE_PRINT("Device successfully re-enumerated\n");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_RECONNECT_DUP02, "Device successfully re-enumerated\n");
-	    }
-
+	
 	for (TInt portNumber = 0; portNumber < iTotalChannels; portNumber++)
 		{
 		// Create device state active object
@@ -479,20 +410,12 @@
 		test_NotNull(iDeviceStateNotifier[portNumber]);
 		iDeviceStateNotifier[portNumber]->Activate();
 		TUSB_VERBOSE_PRINT("Created device state notifier");
-		if(gVerbose)
-		    {
-		    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_RECONNECT_DUP03, "Created device state notifier");
-		    }
 
 		// Create endpoint stall status active object
 		iStallNotifier[portNumber] = CActiveStallNotifier::NewL(iConsole, &iPort[portNumber]);
 		test_NotNull(iStallNotifier[portNumber]);
 		iStallNotifier[portNumber]->Activate();
 		TUSB_VERBOSE_PRINT("Created stall notifier");
-		if(gVerbose)
-		    {
-		    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_RECONNECT_DUP04, "Created stall notifier");
-		    }
 
 		if (portNumber == 0)
 			{
@@ -504,22 +427,22 @@
 			r = iPort[portNumber].OpenEndpoint(iEp0Buf,0);
 			test_KErrNone(r);
 			#endif
-
+			
 			}
 		}
-
+	
 	test.End();
 	}
 
 void CActiveControl::FillEndpointsResourceAllocation(IFConfigPtr aIfCfg)
 	{
-
+	
 	#ifdef USB_SC
 		TUsbcScInterfaceInfo* iInfoPtr = aIfCfg->iInfoPtr;
 	#else
 		TUsbcInterfaceInfo* iInfoPtr = aIfCfg->iInfoPtr;
 	#endif
-
+	
 	// 	fill resource allocation info in the endpoint info with resource allocation v2
 	for (TUint8 i = 1; i <= iInfoPtr->iTotalEndpointsUsed; i++)
 		{
@@ -541,14 +464,14 @@
 			iInfoPtr->iEndpointData[i-1].iFeatureWord1 &= (~KUsbcEndpointInfoFeatureWord1_DoubleBuffering);
 			}
 		#endif
-		}
+		}	
 	}
 
 // all alternative settings of the interface 'aFirstIfCfg' will be populated
 void CActiveControl::PopulateInterfaceResourceAllocation(IFConfigPtr aFirstIfCfg, TInt aPortNumber)
 	{
 	FillEndpointsResourceAllocation(aFirstIfCfg);
-
+	
 	IFConfigPtr ifCfgPtr = aFirstIfCfg->iPtrNext;
 	while (ifCfgPtr != NULL)
 		{
@@ -563,14 +486,13 @@
 			}
 		}
 	}
-
+	
 void CActiveControl::SetupInterface(IFConfigPtr* aIfPtr, TInt aPortNumber)
 	{
 	test.Start (_L("Setup Interface"));
-
-	// first of all set the default interface
+	
+	// first of all set the default interface	
 	TUSB_PRINT2 ("Set Default Interface with %d endpoints bandwidth 0x%x",(*aIfPtr)->iInfoPtr->iTotalEndpointsUsed,(*aIfPtr)->iBandwidthIn | (*aIfPtr)->iBandwidthOut);
-	OstTraceExt2 (TRACE_NORMAL, CACTIVECONTROL_SETUPINTERFACE, "Set Default Interface with %d endpoints bandwidth 0x%x",(*aIfPtr)->iInfoPtr->iTotalEndpointsUsed,(*aIfPtr)->iBandwidthIn | (*aIfPtr)->iBandwidthOut);
 	#ifdef USB_SC
 	TUsbcScInterfaceInfoBuf ifc = *((*aIfPtr)->iInfoPtr);
 	TInt r = iPort[aPortNumber].SetInterface(0, ifc);
@@ -593,36 +515,34 @@
 	if ((*aIfPtr)->iNumber != 0 && ifDescriptor[KIfcDesc_NumberOffset] != (*aIfPtr)->iNumber)
 		{
 		ifDescriptor[KIfcDesc_NumberOffset] = (*aIfPtr)->iNumber;
-		r = iPort[aPortNumber].SetInterfaceDescriptor(0, ifDescriptor);
+		r = iPort[aPortNumber].SetInterfaceDescriptor(0, ifDescriptor);	
 		test_KErrNone(r);
 		}
 	else
 		{
-		(*aIfPtr)->iNumber = ifDescriptor[KIfcDesc_NumberOffset];
+		(*aIfPtr)->iNumber = ifDescriptor[KIfcDesc_NumberOffset];	
 		}
 	TUint8 interfaceNumber = (*aIfPtr)->iNumber;
 	TUSB_PRINT1 ("Interface Number %d",interfaceNumber);
-	OstTrace1 (TRACE_NORMAL, CACTIVECONTROL_SETUPINTERFACE_DUP01, "Interface Number %d",interfaceNumber);
-
+		
 	// Check all endpoint descriptors
 	TBuf8<KUsbDescSize_AudioEndpoint> epDescriptor;
 	for (TUint i = 0; i < (*aIfPtr)->iInfoPtr->iTotalEndpointsUsed; i++)
 		{
 		if (!gSkip)
 			{
-			TestEndpointDescriptor (&iPort[aPortNumber],0,i+1,(*aIfPtr)->iInfoPtr->iEndpointData[i]);
+			TestEndpointDescriptor (&iPort[aPortNumber],0,i+1,(*aIfPtr)->iInfoPtr->iEndpointData[i]);	
 
 			}
 
 		if (firstBulkOutEndpoint < 0 && ((*aIfPtr)->iInfoPtr->iEndpointData[i].iDir & KUsbEpDirOut) &&
 			(*aIfPtr)->iInfoPtr->iEndpointData[i].iType == KUsbEpTypeBulk)
 			{
-			firstBulkOutEndpoint = i+1;
+			firstBulkOutEndpoint = i+1;	
 			}
 		}
 
 	TUSB_PRINT1 ("Interface number is %d",interfaceNumber);
-	OstTrace1 (TRACE_NORMAL, CACTIVECONTROL_SETUPINTERFACE_DUP02, "Interface number is %d",interfaceNumber);
 	(*aIfPtr)->iPortNumber = aPortNumber;
 	gInterfaceConfig [interfaceNumber] [0] = *aIfPtr;
 
@@ -641,15 +561,13 @@
 				ifc = *(ifPtr->iInfoPtr);
 				#ifdef USB_SC
 				TUSB_PRINT2 ("Set Alternate Interface Setting %d with %d endpoints",alternateNumber,ifPtr->iInfoPtr->iTotalEndpointsUsed);
-				OstTraceExt2 (TRACE_NORMAL, CACTIVECONTROL_SETUPINTERFACE_DUP03, "Set Alternate Interface Setting %d with %d endpoints",alternateNumber,ifPtr->iInfoPtr->iTotalEndpointsUsed);
 				r = iPort[aPortNumber].SetInterface(alternateNumber, ifc);
 				#else
 				TUSB_PRINT3 ("Set Alternate Interface Setting %d with %d endpoints bandwidth 0x%x",alternateNumber,ifPtr->iInfoPtr->iTotalEndpointsUsed,ifPtr->iBandwidthIn | iLddPtr->iIFPtr->iBandwidthOut);
-				OstTraceExt3 (TRACE_NORMAL, CACTIVECONTROL_SETUPINTERFACE_DUP04, "Set Alternate Interface Setting %d with %u endpoints bandwidth 0x%x",(TInt32)alternateNumber,(TUint32)ifPtr->iInfoPtr->iTotalEndpointsUsed,(TUint32)(ifPtr->iBandwidthIn | iLddPtr->iIFPtr->iBandwidthOut));
 				r = iPort[aPortNumber].SetInterface(alternateNumber, ifc, ifPtr->iBandwidthIn | iLddPtr->iIFPtr->iBandwidthOut);
 				#endif
 				test_KErrNone(r);
-
+					
 				r = iPort[aPortNumber].GetInterfaceDescriptor(alternateNumber, ifDescriptor);
 				test_KErrNone(r);
 
@@ -669,7 +587,7 @@
 
 					r = iPort[aPortNumber].GetEndpointDescriptor(alternateNumber, i+1, epDescriptor);
 					test_KErrNone(r);
-
+					
 					test((((*aIfPtr)->iInfoPtr->iEndpointData[i].iDir & KUsbEpDirIn) && (epDescriptor[KEpDesc_AddressOffset] & 0x80) ||
 						!((*aIfPtr)->iInfoPtr->iEndpointData[i].iDir & KUsbEpDirIn) && !(epDescriptor[KEpDesc_AddressOffset] & 0x80)) &&
 						EpTypeMask2Value((*aIfPtr)->iInfoPtr->iEndpointData[i].iType) == (TUint)(epDescriptor[KEpDesc_AttributesOffset] & 0x03) &&
@@ -692,11 +610,11 @@
 
 						test.Next(_L("Compare endpoint descriptor with value set"));
 						r = descriptor2.Compare(epDescriptor);
-						test_KErrNone(r);
+						test_KErrNone(r);						
 						}
 					}
-
-
+				
+					
 				// if no error move on to the next interface
 				ifPtr->iPortNumber = aPortNumber;
 				ifPtr->iNumber = interfaceNumber;
@@ -715,14 +633,14 @@
 	iNumInterfaceSettings[aPortNumber] = alternateNumber;
 	if (!gSkip)
 		{
-		TestInvalidSetInterface (&iPort[aPortNumber],iNumInterfaceSettings[aPortNumber]);
+		TestInvalidSetInterface (&iPort[aPortNumber],iNumInterfaceSettings[aPortNumber]);			
 		TestInvalidReleaseInterface (&iPort[aPortNumber],iNumInterfaceSettings[aPortNumber]);
 
 		TestDescriptorManipulation(iLddPtr->iHighSpeed,&iPort[aPortNumber],alternateNumber);
 		TestOtgExtensions(&iPort[aPortNumber]);
 		TestEndpoint0MaxPacketSizes(&iPort[aPortNumber]);
 		}
-
+		
 	test.End();
 	}
 
@@ -730,13 +648,12 @@
 CActiveControl::~CActiveControl()
 	{
 	TUSB_PRINT("CActiveControl::~CActiveControl()");
-	OstTrace0(TRACE_NORMAL, CACTIVECONTROL_DCACTIVECONTROL, "CActiveControl::~CActiveControl()");
 
 	Cancel();
-
+	
 	iTimer.Close();
-
-	// delete interfaces
+	
+	// delete interfaces		
 	while (iLddPtr->iIFPtr)
 		{
 		IFConfigPtr* ifPtrPtr = & iLddPtr->iIFPtr;
@@ -752,7 +669,7 @@
 
 	while (iLddPtr)
 		{
-		LDDConfigPtr* lddPtrPtr = &iLddPtr;
+		LDDConfigPtr* lddPtrPtr = &iLddPtr;	
 		while ((*lddPtrPtr)->iPtrNext)
 			{
 			lddPtrPtr = &(*lddPtrPtr)->iPtrNext;
@@ -763,21 +680,13 @@
 		delete (*lddPtrPtr);
 		* lddPtrPtr = NULL;
 		}
-#ifdef USB_SC
-	delete iTranHandleServer;
-	TUSB_PRINT("CActiveControl::delete iTranHandleServer");
-	OstTrace0(TRACE_NORMAL, CACTIVECONTROL_DCACTIVECONTROL_DUP01, "CActiveControl::delete iTranHandleServer");
-#endif
+
 	iFs.Close();
 	}
 
 void CActiveControl::DoCancel()
 	{
 	TUSB_VERBOSE_PRINT("CActiveControl::DoCancel()");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_DOCANCEL, "CActiveControl::DoCancel()");
-	    }
 	iConsole->ReadCancel();
 	}
 
@@ -792,7 +701,7 @@
 			if (!IsActive())
 				{
 				SetActive();
-				}
+				}		
 			}
 		}
 	else
@@ -804,14 +713,10 @@
 			}
 		}
 	}
-
+	
 void CActiveControl::RequestEp0ControlPacket()
 	{
 	TUSB_VERBOSE_PRINT("CActiveControl::RequestEp0ControlPacket()");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_REQUESTEP0CONTROLPACKET, "CActiveControl::RequestEp0ControlPacket()");
-	    }
 	// A request is issued to read a packet for endpoint 0
 	__ASSERT_ALWAYS(!IsActive(), User::Panic(KActivePanic, 660));
 	#ifdef	USB_SC
@@ -819,12 +724,8 @@
 	do
 		{
 		r = iEp0Buf.GetBuffer (iEp0Packet,iEp0Size,iEp0Zlp,iStatus);
-		TUSB_VERBOSE_PRINT4("Get Buffer Return code %d Status %d PacketPtr 0x%x Size %d", r, iStatus.Int(),(TInt)iEp0Packet,iEp0Size);
-		if(gVerbose)
-		    {
-		    OstTraceExt4(TRACE_VERBOSE, CACTIVECONTROL_REQUESTEP0CONTROLPACKET_DUP01, "Get Buffer Return code %d Status %d PacketPtr 0x%x Size %d", r, iStatus.Int(),(TInt)iEp0Packet,(TInt)iEp0Size);
-		    }
-		test_Value(r, (r == KErrNone) || (r == KErrCompletion) || (r == TEndpointBuffer::KStateChange) || (r == KErrAlternateSettingChanged));
+		TUSB_VERBOSE_PRINT4("Get Buffer Return code %d Status %d PacketPtr 0x%x Size %d", r, iStatus.Int(),iEp0Packet,iEp0Size);	
+		test_Value(r, (r == KErrNone) || (r == KErrCompletion) || (r == TEndpointBuffer::KStateChange) || (r == KErrAlternateSettingChanged));  
 		if (r == KErrCompletion)
 			{
 			// ignore anything except a setup packet
@@ -854,24 +755,19 @@
 void CActiveControl::RunL()
 	{
 	TInt r = KErrNone;
-
+	
 	TUSB_VERBOSE_PRINT("CActiveControl::RunL()");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_RUNL, "CActiveControl::RunL()");
-	    }
-
+	
 	switch (iPending)
 		{
 		case EPendingNone :
 			break;
-
+			
 		case EPendingEp0Read :
 			iPending = EPendingNone;
 			if (iStatus != KErrNone)
 				{
 				TUSB_PRINT1("ActiveControl::Error %d in Ep0 Read Packet", iStatus.Int());
-				OstTrace1(TRACE_NORMAL, CACTIVECONTROL_RUNL_DUP01, "ActiveControl::Error %d in Ep0 Read Packet", iStatus.Int());
 				test(EFalse);
 				}
 			#ifdef USB_SC
@@ -881,31 +777,29 @@
 			#else
 			if (ProcessEp0ControlPacket() == KErrCompletion)
 				RequestEp0ControlPacket();
-			#endif
-			break;
+			#endif		
+			break;		
 
 		case EPendingTimer :
 			iPending = EPendingNone;
 			if (iStatus != KErrNone)
 				{
 				TUSB_PRINT1("ActiveControl::Error %d in Connection Timer Delay", iStatus.Int());
-				OstTrace1(TRACE_NORMAL, CACTIVECONTROL_RUNL_DUP02, "ActiveControl::Error %d in Connection Timer Delay", iStatus.Int());
 				test(EFalse);
 				}
 			r = iPort[0].DeviceConnectToHost();
 			test_KErrNone (r);
-
+		
 			test.End();
-
+		
 			RequestEp0ControlPacket();
 			break;
-
+			
 		case EPendingEject :
 			iPending = EPendingNone;
 			if (iStatus != KErrNone)
 				{
 				TUSB_PRINT1("ActiveControl::Error %d in Eject Timer Delay", iStatus.Int());
-				OstTrace1(TRACE_NORMAL, CACTIVECONTROL_RUNL_DUP03, "ActiveControl::Error %d in Eject Timer Delay", iStatus.Int());
 				test(EFalse);
 				}
 			StopMassStorage(&iPort[0]);
@@ -913,20 +807,19 @@
 				iEp0Buf.Close();
 			#endif
 			ReConnect();
-
+							
 			RequestEp0ControlPacket();
 			break;
-
+					
 		case EPendingCancel :
 			iPending = EPendingNone;
 			if (iStatus != KErrNone && iStatus != KErrCancel)
 				{
 				TUSB_PRINT1("ActiveControl::Error %d in Eject Timer Delay", iStatus.Int());
-				OstTrace1(TRACE_NORMAL, CACTIVECONTROL_RUNL_DUP04, "ActiveControl::Error %d in Eject Timer Delay", iStatus.Int());
 				test(EFalse);
 				}
 		}
-
+	
 	}
 
 TInt CActiveControl::ProcessEp0ControlPacket()
@@ -935,10 +828,6 @@
 	TUint16 index = *reinterpret_cast<TUint16*>(&iEp0SetUpPacket[KUsb_Ep0wIndexOffset]);
 	TUint16 length= *reinterpret_cast<TUint16*>(&iEp0SetUpPacket[KUsb_Ep0wLengthOffset]);
 	TUSB_VERBOSE_PRINT3("ProcessEp0ControlPacket length 0x%x value 0x%x index 0x%x",length,value,index);
-	if(gVerbose)
-	    {
-	    OstTraceExt3(TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET, "ProcessEp0ControlPacket length 0x%x value 0x%x index 0x%x",length,value,index);
-	    }
 	TRequestStatus ep0Status;
 	TUint8 host_ver_major;
 	TUint8 host_ver_minor;
@@ -960,77 +849,56 @@
 		((iEp0SetUpPacket[KUsb_Ep0RequestTypeOffset] & KUsbRequestType_TypeMask) == KUsbRequestType_TypeClass))
 		{
 		TUSB_VERBOSE_PRINT("Received Device Directed setup packet");
-		if(gVerbose)
-		    {
-		    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP01, "Received Device Directed setup packet");
-		    }
 		if ((iEp0SetUpPacket[KUsb_Ep0RequestTypeOffset] & KUsbRequestType_DirMask) == KUsbRequestType_DirToDev)
 			{
 			iEp0DataBuffer.SetLength(0);
 			while (iEp0DataBuffer.Length() < length)
 				{
 				TUSB_VERBOSE_PRINT("Reading Ep0 data packet");
-				if(gVerbose)
-				    {
-				    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP02, "Reading Ep0 data packet");
-				    }
 				#ifdef USB_SC
 				r = iEp0Buf.GetBuffer (iEp0Packet,iEp0Size,iEp0Zlp,ep0Status);
 				test_Value(r, r == KErrNone || r == KErrCompletion || (r == KErrAlternateSettingChanged));
-				while (r == KErrNone)
+				while (r == KErrNone)  
 					{
 					TUSB_VERBOSE_PRINT("Waiting for Ep0 data packet");
-					if(gVerbose)
-					    {
-					    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP03, "Waiting for Ep0 data packet");
-					    }
 					User::WaitForRequest(ep0Status);
 					test_KErrNone(ep0Status.Int());
 					r = iEp0Buf.GetBuffer (iEp0Packet,iEp0Size,iEp0Zlp,ep0Status);
 					test_Value(r, r == KErrNone || r == KErrCompletion || (r == KErrAlternateSettingChanged));
 					}
 				TUSB_VERBOSE_PRINT1("Ep0 data packet - size %d",iEp0Size);
-				if(gVerbose)
-				    {
-				    OstTrace1(TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP04, "Ep0 data packet - size %d",iEp0Size);
-				    }
-				iEp0DataBuffer.Append((TUint8 *)iEp0Packet,iEp0Size);
+				iEp0DataBuffer.Append((TUint8 *)iEp0Packet,iEp0Size);								
 				#else
 				TUint16 packetLength = Min(length-iEp0DataBuffer.Length(),iEp0PacketSize);
 				iPort[0].ReadPacket(ep0Status, EEndpoint0, ep0DataPacket, packetLength);
 				User::WaitForRequest(ep0Status);
 				if (ep0Status == KErrNone)
 					{
-					iEp0DataBuffer.Append(ep0DataPacket);
+					iEp0DataBuffer.Append(ep0DataPacket);				
 					}
 				else
 					{
 					TUSB_PRINT1("ActiveControl::Error %d in Ep0 Read Data Packet", ep0Status.Int());
-					OstTrace1(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP05, "ActiveControl::Error %d in Ep0 Read Data Packet", ep0Status.Int());
 					test(EFalse);
-					return KErrNone;
+					return KErrNone;						
 					}
 				#endif
 				}
 			TUSB_VERBOSE_PRINT4("Setup ToDevice Type %d length %d value %d index %d",iEp0SetUpPacket[KUsb_Ep0RequestOffset],length,value,index);
-			if(gVerbose)
-			    {
-			    OstTraceExt4(TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP06, "Setup ToDevice Type %d length %d value %d index %d",iEp0SetUpPacket[KUsb_Ep0RequestOffset],length,value,index);
-			    }
 			sendStatus = ETrue;
-			switch (iEp0SetUpPacket[KUsb_Ep0RequestOffset])
+			switch (iEp0SetUpPacket[KUsb_Ep0RequestOffset])	
 				{
 				case EStop :
 					// send this now as the port will be disconnected
 					sendStatus = EFalse;
-					r = iPort[0].SendEp0StatusPacket();
+					r = iPort[0].SendEp0StatusPacket();					
 					test_KErrNone(r);
-
+		
 					if (value && firstBulkOutEndpoint > 0)
 						{
 						PrintHostLog();
 						}
-
+						
 					for (TInt portNumber = 0; portNumber < iTotalChannels; portNumber++)
 						{
 						// base class cancel -> calls our DoCancel
@@ -1042,44 +910,28 @@
 							if (r != KErrNone)
 								{
 								TUSB_PRINT1("Error %d on string removal", r);
-								OstTrace1(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP07, "Error %d on string removal", r);
 								}
 							r = iPort[portNumber].RemoveStringDescriptor(stridx2);
 							if (r != KErrNone)
 								{
 								TUSB_PRINT1("Error %d on string removal", r);
-								OstTrace1(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP08, "Error %d on string removal", r);
-								}
+								}	
 							}
 						TUSB_VERBOSE_PRINT1 ("Closing USB channel number %d",portNumber);
-						if(gVerbose)
-						    {
-						    OstTrace1 (TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP09, "Closing USB channel number %d",portNumber);
-						    }
-#ifdef USB_SC
-						RChunk* commChunk;
-						User::LeaveIfError(iPort[portNumber].GetDataTransferChunk(commChunk));
-						commChunk->Close(); 
-#endif
 						iPort[portNumber].Close();											// close USB channel
 						}
 					TUSB_VERBOSE_PRINT("Closing Idle Counter Thread");
-					if(gVerbose)
-					    {
-					    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP10, "Closing Idle Counter Thread");
-					    }
 					iIdleCounter->iCommand = ETestIdleCounterClose;
 					iIdleCounterChunk.Close();
 					// Allow time for low-priority thread to close
 					User::After(100000);
 					iIdleCounterThread.Close();
-
+					
 					CActiveScheduler::Stop();
 					break;
-
+					
 				case EVersion :
 					TUSB_PRINT("Receiving t_usb_host version");
-					OstTrace0(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP11, "Receiving t_usb_host version");
 					host_ver_major = iEp0DataBuffer[0];
 					host_ver_minor = iEp0DataBuffer[1];
 					host_ver_micro = iEp0DataBuffer[2];
@@ -1088,13 +940,9 @@
 					TUSB_PRINT5("Host-side: t_usb_host v%d.%d.%d  USBIO v%d.%d\n",
 						host_ver_major, host_ver_minor, host_ver_micro,
 						usbio_ver_major, usbio_ver_minor);
-					OstTraceExt5(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP12, "Host-side: t_usb_host v%d.%d.%d  USBIO v%d.%d\n",
-						host_ver_major, host_ver_minor, host_ver_micro,
-						usbio_ver_major, usbio_ver_minor);
 					if (host_ver_major < KHostVersionMajor)
 						{
 						TUSB_PRINT1("t_usb_host version not sufficient (need at least v%d.x.x)\n",KHostVersionMajor);
-						OstTrace1(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP13, "t_usb_host version not sufficient (need at least v%d.x.x)\n",KHostVersionMajor);
 						User::Leave(-1);
 						return KErrNone;
 						}
@@ -1105,8 +953,6 @@
 						{
 						TUSB_PRINT2("t_usb_host version not sufficient (need at least v%d.%d.x)\n",
 							KHostVersionMajor, KHostVersionMinor);
-						OstTraceExt2(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP14, "t_usb_host version not sufficient (need at least v%d.%d.x)\n",
-							KHostVersionMajor, KHostVersionMinor);
 						test(EFalse);
 						return KErrNone;
 						}
@@ -1116,25 +962,18 @@
 			 				!(host_ver_micro == KHostVersionMicro))
 						{
 						TUSB_PRINT3("USBRFLCT version not sufficient (need at least v%d.%d.%d)\n",
-							KHostVersionMajor, KHostVersionMinor, KHostVersionMicro);
-						OstTraceExt3(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP15, "USBRFLCT version not sufficient (need at least v%d.%d.%d)\n",
 									KHostVersionMajor, KHostVersionMinor, KHostVersionMicro);
 						test(EFalse);
 						return KErrNone;
 						}
 					break;
-
+					
 				case ETestParam :
 					tpPtr = (TestParamPtr)(&iEp0DataBuffer[0]);
 					TUSB_VERBOSE_PRINT4("Test Params - interface %d repeat %d settingRepeat %d beforeIndex %d",tpPtr->interfaceNumber,tpPtr->repeat,tpPtr->settingRepeat,tpPtr->beforeIndex);
-					if(gVerbose)
-					    {
-					    OstTraceExt4(TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP16, "Test Params - interface %d repeat %d settingRepeat %d beforeIndex %d",tpPtr->interfaceNumber,tpPtr->repeat,tpPtr->settingRepeat,tpPtr->beforeIndex);
-					    }
 					if (index >= KMaxConcurrentTests)
 						{
 						TUSB_PRINT2("Test index %d is greater than maximum allowed (%d) concurrent tests",index,KMaxConcurrentTests);
-						OstTraceExt2(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP17, "Test index %d is greater than maximum allowed (%d) concurrent tests",index,KMaxConcurrentTests);
 						test(EFalse);
 						return KErrNone;
 						}
@@ -1143,137 +982,127 @@
 					if (!pActiveRW)
 						{
 						TUSB_PRINT("Failed to create reader/writer");
-						OstTrace0(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP18, "Failed to create reader/writer");
 						test(EFalse);
 						return KErrNone;
 						}
 					TUSB_VERBOSE_PRINT("Created reader/writer");
-					if(gVerbose)
-					    {
-					    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP19, "Created reader/writer");
-					    }
 					pActiveRW->SetTestParams(tpPtr);
 					switch (value)
 						{
 					case 'X' :
 						test.Start (_L("Xml"));
 						break;
-
+							
 					case 'L' :
 						test.Start (_L("Loop"));
 						pActiveRW->SetTransferMode(ELoop);
 						gAltSettingOnNotify = ETrue;
 						if (tpPtr->settingRepeat && !firstSettingThread)
 							{
-							pActiveRW->Suspend(ESuspend);
+							pActiveRW->Suspend(ESuspend);	
 							}
 						else
 							{
-							pActiveRW->StartOrSuspend();
+							pActiveRW->StartOrSuspend();						
 							}
 						break;
-
+							
 					case 'C' :
 						test.Start (_L("Compare"));
 						pActiveRW->SetTransferMode(ELoopComp);
 						gAltSettingOnNotify = ETrue;
 						if (tpPtr->settingRepeat && !firstSettingThread)
 							{
-							pActiveRW->Suspend(ESuspend);
+							pActiveRW->Suspend(ESuspend);	
 							}
 						else
 							{
-							pActiveRW->StartOrSuspend();
+							pActiveRW->StartOrSuspend();						
 							}
 						break;
-
+							
 					case 'S' :
 						test.Start (_L("Stream"));
 						if (tpPtr->outPipe > KMaxEndpointsPerClient)
 							{
-							pActiveRW->SetTransferMode(ETransmitOnly);
+							pActiveRW->SetTransferMode(ETransmitOnly);						
 							gAltSettingOnNotify = ETrue;
 							if (tpPtr->settingRepeat && !firstSettingThread)
 								{
-								pActiveRW->Suspend(ESuspend);
+								pActiveRW->Suspend(ESuspend);	
 								}
 							else
 								{
-								pActiveRW->StartOrSuspend();
+								pActiveRW->StartOrSuspend();						
 								}
 							}
 						else
 							{
-							pActiveRW->SetTransferMode(EReceiveOnly);
+							pActiveRW->SetTransferMode(EReceiveOnly);						
 							gAltSettingOnNotify = ETrue;
 							if (tpPtr->settingRepeat && !firstSettingThread)
 								{
-								pActiveRW->Suspend(ESuspend);
+								pActiveRW->Suspend(ESuspend);	
 								}
 							else
 								{
-								pActiveRW->StartOrSuspend();
+								pActiveRW->StartOrSuspend();						
 								}
-							}
+							}					
 						break;
-
+							
 					case 'F' :
 						test.Start (_L("File"));
 						// send this now as the file setup takes a long time
 						sendStatus = EFalse;
-						r = iPort[0].SendEp0StatusPacket();
+						r = iPort[0].SendEp0StatusPacket();					
 						test_KErrNone(r);
 						if (tpPtr->outPipe > KMaxEndpointsPerClient)
 							{
 							pActiveRW->SetTransferMode(ETransmitOnly);
-							TInt maxFileSize = tpPtr->maxSize * tpPtr->repeat;
+							TInt maxFileSize = tpPtr->maxSize * tpPtr->repeat;						
 							pActiveRW->ReadFromDisk((TChar)tpPtr->minSize,maxFileSize);
 							gAltSettingOnNotify = ETrue;
 							if (tpPtr->settingRepeat && !firstSettingThread)
 								{
-								pActiveRW->Suspend(ESuspend);
+								pActiveRW->Suspend(ESuspend);	
 								}
 							else
 								{
-								pActiveRW->StartOrSuspend();
+								pActiveRW->StartOrSuspend();						
 								}
 							}
 						else
 							{
-							pActiveRW->SetTransferMode(EReceiveOnly);
+							pActiveRW->SetTransferMode(EReceiveOnly);						
 							pActiveRW->WriteToDisk((TChar)tpPtr->minSize);
 							gAltSettingOnNotify = ETrue;
 							if (tpPtr->settingRepeat && !firstSettingThread)
 								{
-								pActiveRW->Suspend(ESuspend);
+								pActiveRW->Suspend(ESuspend);	
 								}
 							else
 								{
-								pActiveRW->StartOrSuspend();
+								pActiveRW->StartOrSuspend();						
 								}
-							}
+							}					
 						break;
-
+						
 					default :
 						TUSB_PRINT1("Invalid test value %X",value);
-						OstTrace1(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP20, "Invalid test value %X",value);
 						test(EFalse);
 						}
-
+						
 					gRW[index] = pActiveRW;
 					break;
-
+					
 				case ETestResult :
 					TUSB_VERBOSE_PRINT2 ("Test index %d complete - value %d",index,value);
-					if(gVerbose)
-					    {
-					    OstTraceExt2 (TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP21, "Test index %d complete - value %d",index,value);
-					    }
-					// if failure, send this first to prevent panic corrupting EP0
+					// if failure, send this first to prevent panic corrupting EP0 
 					if (!value)
 						{
 						sendStatus = EFalse;
-						r = iPort[0].SendEp0StatusPacket();
+						r = iPort[0].SendEp0StatusPacket();					
 						}
 					if (index < KMaxConcurrentTests)
 						{
@@ -1287,14 +1116,12 @@
 						{
 						if (!value)
 							{
-							TUSB_PRINT("Host Test Fail");
-							OstTrace0(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP22, "Host Test Fail");
+							TUSB_PRINT("Host Test Fail");							
 							}
 						}
 					else
 						{
 						TUSB_PRINT2("Invalid test index %d for result %d",index,value);
-						OstTraceExt2(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP23, "Invalid test index %d for result %d",index,value);
 						}
 					if (!value)
 						{
@@ -1309,12 +1136,12 @@
 				case ETestConnect :
 					test.Start (_L("Connect"));
 					sendStatus = EFalse;
-					r = iPort[0].SendEp0StatusPacket();
+					r = iPort[0].SendEp0StatusPacket();					
 					if (iSoftwareConnect)
 						{
 						r = iPort[0].DeviceDisconnectFromHost();
 						test_KErrNone (r);
-
+						
 						TUint32 waitTime = (TUint32)value * 1000;
 						if (waitTime == 0)
 							{
@@ -1322,28 +1149,24 @@
 							}
 						iTimer.After(iStatus,waitTime);
 						iPending = EPendingTimer;
-
+						
 						SetActive();
 						}
 					else
 						{
 						iConsole->Printf(_L("This device does not support software\n"));
-						OstTrace0(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP24, "This device does not support software\n");
 						iConsole->Printf(_L("disconnect/reconnect\n"));
-						OstTrace0(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP25, "disconnect/reconnect\n");
 						iConsole->Printf(_L("Please physically unplug and replug\n"));
-						OstTrace0(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP26, "Please physically unplug and replug\n");
 						iConsole->Printf(_L("the USB cable NOW... "));
-						OstTrace0(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP27, "the USB cable NOW... ");
 						test.End ();
-						}
+						}				
 					break;
 
 				case ETestDisconnect :
 					test.Start (_L("Disconnect"));
 					// send this now as the port will be disconnected
 					sendStatus = EFalse;
-					r = iPort[0].SendEp0StatusPacket();
+					r = iPort[0].SendEp0StatusPacket();					
 					if (iSoftwareConnect)
 						{
 						r = iPort[0].DeviceDisconnectFromHost();
@@ -1352,26 +1175,22 @@
 					else
 						{
 						iConsole->Printf(_L("This device does not support software\n"));
-						OstTrace0(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP28, "This device does not support software\n");
 						iConsole->Printf(_L("disconnect/reconnect\n"));
-						OstTrace0(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP29, "disconnect/reconnect\n");
 						iConsole->Printf(_L("Please physically unplug and replug\n"));
-						OstTrace0(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP30, "Please physically unplug and replug\n");
 						iConsole->Printf(_L("the USB cable NOW... "));
-						OstTrace0(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP31, "the USB cable NOW... ");
-						}
+						}				
 
 					test.End ();
 					break;
 
 				case ETestMassStorage :
 					test.Start (_L("Select Mass Storage"));
-
+				
 					// send this now as the port will be disconnected
 					sendStatus = EFalse;
-					r = iPort[0].SendEp0StatusPacket();
+					r = iPort[0].SendEp0StatusPacket();					
 					test_KErrNone(r);
-
+			
 					for (TInt portNumber = 0; portNumber < iTotalChannels; portNumber++)
 						{
 						delete iDeviceStateNotifier[portNumber];
@@ -1382,41 +1201,26 @@
 							if (r != KErrNone)
 								{
 								TUSB_PRINT1("Error %d on string removal", r);
-								OstTrace1(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP32, "Error %d on string removal", r);
 								}
 							r = iPort[portNumber].RemoveStringDescriptor(stridx2);
 							if (r != KErrNone)
 								{
 								TUSB_PRINT1("Error %d on string removal", r);
-								OstTrace1(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP33, "Error %d on string removal", r);
-								}
+								}	
 							}
 						TUSB_VERBOSE_PRINT1 ("Closing USB channel number %d",portNumber);
-						if(gVerbose)
-						    {
-						    OstTrace1 (TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP34, "Closing USB channel number %d",portNumber);
-						    }
-#ifdef USB_SC
-						RChunk* commChunk;
-						User::LeaveIfError(iPort[portNumber].GetDataTransferChunk(commChunk));
-						commChunk->Close();	
-#endif							
 						iPort[portNumber].Close();											// close USB channel
 						}
-
+		
 					r = iPort[0].Open(0);
 					test_KErrNone(r);
 					TUSB_VERBOSE_PRINT("Successfully opened USB port");
-					if(gVerbose)
-					    {
-					    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP35, "Successfully opened USB port");
-					    }
 
 					SetupDescriptors(iLddPtr, &iPort[0],value);
 					StartMassStorage(&iPort[0]);
-
+		
 					test.Next (_L("Enumeration..."));
-					r = ReEnumerate();
+					r = ReEnumerate();				
 					test_KErrNone(r);
 
 
@@ -1429,10 +1233,9 @@
 				if (r != KErrNone)
 					{
 					TUSB_PRINT1("ActiveControl::Error %d in Ep0 Send Status Packet", r);
-					OstTrace1(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP36, "ActiveControl::Error %d in Ep0 Send Status Packet", r);
 					test(EFalse);
-					return KErrNone;
-					}
+					return KErrNone;						
+					}				
 				}
 			}
 		else
@@ -1440,13 +1243,12 @@
 			if ((iEp0SetUpPacket[KUsb_Ep0RequestOffset] == EVersion) && length > 0)
 				{
 				TUSB_PRINT4("Sending t_usb_device version: %d.%d.%d length %d \n", KDeviceVersionMajor, KDeviceVersionMinor, KDeviceVersionMicro, length);
-				OstTraceExt4(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP37, "Sending t_usb_device version: %u.%u.%u length %u \n", KDeviceVersionMajor, KDeviceVersionMinor, KDeviceVersionMicro, (TUint32)length);
 				#ifdef	USB_SC
 				TUint8 *ep0Buffer;
 				TUint8 *ep0BufPtr;
 				TUint ep0Length;
 				iEp0Buf.GetInBufferRange(((TAny*&)ep0Buffer),ep0Length);
-
+				
 				ep0BufPtr = ep0Buffer;
 				*(ep0Buffer++) = KDeviceVersionMajor;
 				*(ep0Buffer++) = KDeviceVersionMinor;
@@ -1471,7 +1273,7 @@
 				*(ep0Buffer++) = 0;
 				r = iEp0Buf.WriteBuffer(ep0BufPtr,length,FALSE,ep0Status);
 				test_KErrNone(r);
-				#else
+				#else				
 				iEp0DataBuffer.FillZ(length);
 				iEp0DataBuffer[0] = KDeviceVersionMajor;
 				iEp0DataBuffer[1] = KDeviceVersionMinor;
@@ -1479,7 +1281,7 @@
 				iEp0DataBuffer.SetLength(3);
 				iEp0DataBuffer.Append (*iConfigFileName);
 				iEp0DataBuffer.Append (*iScriptFileName);
-				iEp0DataBuffer.SetLength(length);
+				iEp0DataBuffer.SetLength(length);				
 				iPort[0].Write(ep0Status, EEndpoint0, iEp0DataBuffer, length);
 				#endif
 				User::WaitForRequest(ep0Status);
@@ -1491,18 +1293,17 @@
 				TInt64 val = (value == 0 || gActiveTestCount == 0) ? iIdleCounter->iCounter : 0;
 
 				TUSB_PRINT1("Sending counter value %Ld\n", val);
-				OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP38, "Sending counter value %Ld\n", val);
 				#ifdef	USB_SC
 
 				TUint8 *ep0Buffer;
 				TUint ep0Length;
 				iEp0Buf.GetInBufferRange(((TAny*&)ep0Buffer),ep0Length);
-
+				
 				*((TInt64*) ep0Buffer) = val;
-
+				
 				r = iEp0Buf.WriteBuffer(ep0Buffer,length,FALSE,ep0Status);
 				test_KErrNone(r);
-				#else
+				#else				
 
 				iEp0DataBuffer.FillZ(length);
 				*((TInt64*) iEp0DataBuffer.Ptr()) = val;
@@ -1517,31 +1318,26 @@
 		if (iEp0SetUpPacket[KUsb_Ep0RequestOffset] != EStop && iEp0SetUpPacket[KUsb_Ep0RequestOffset] != ETestConnect &&
 			iEp0SetUpPacket[KUsb_Ep0RequestOffset] != ETestMassStorage)
 			{
-			return KErrCompletion;
-			}
+			return KErrCompletion;		
+			}				
 		}
 	else
 		{
-		TUSB_PRINT1("Error : Incorrect SetUp Packet Request Type %X", iEp0SetUpPacket[0]);
-		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP39, "Error : Incorrect SetUp Packet Request Type %X", iEp0SetUpPacket[0]);
+		TUSB_PRINT1("Error : Incorrect SetUp Packet Request Type %X", iEp0SetUpPacket[0]);			
 		test(EFalse);
 		return KErrNone;
 		}
-
+	
 	return KErrNone;
 	}
-
+	
 void CActiveControl::PrintHostLog()
 	{
 	TRequestStatus status = 0;
 	wchar_t lineBuf[128];
 	TUint j = 0;
-
+	
 	TUSB_VERBOSE_PRINT("Reading Host log file\n");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_PRINTHOSTLOG, "Reading Host log file\n");
-	    }
 
 	#ifdef USB_SC
 	TInt r = 0;
@@ -1562,10 +1358,6 @@
 		if (r == KErrCompletion)
 			{
 			TUSB_VERBOSE_PRINT1("Host log file %d bytes read\n",readSize);
-			if(gVerbose)
-			    {
-			    OstTrace1(TRACE_VERBOSE, CACTIVECONTROL_PRINTHOSTLOG_DUP01, "Host log file %d bytes read\n",readSize);
-			    }
 			scCharPtr = (TUint8 *)scReadData;
 			// Print the host log file
 			for (TUint i = 0; i < readSize; i++)
@@ -1573,14 +1365,14 @@
 				if (* scCharPtr == '\r')
 					{
 					lineBuf[j++] = '\0';
-					OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_PRINTHOSTLOG_DUP02, "%S",*lineBuf);
-					j = 0;
+					RDebug::Print (_L("%s"),lineBuf);
+					j = 0;	
 					}
 				else
 					{
 					if (* scCharPtr != '\n')
 						{
-						lineBuf[j++] = * scCharPtr;
+						lineBuf[j++] = * scCharPtr;				
 						}
 					}
 				scCharPtr++;
@@ -1589,7 +1381,7 @@
 		if (r == KErrNone)
 			{
 			User::WaitForRequest(status);
-			test_KErrNone(status.Int());
+			test_KErrNone(status.Int());	
 			}
 		}
 	while (r >= KErrNone && !readZlp);
@@ -1599,30 +1391,26 @@
 	User::WaitForRequest(status);
 	test_KErrNone(status.Int());
 	TUSB_VERBOSE_PRINT1("Host log file %d bytes read\n",readBuf.Length());
-	if(gVerbose)
-	    {
-	    OstTrace1(TRACE_VERBOSE, CACTIVECONTROL_PRINTHOSTLOG_DUP03, "Host log file %d bytes read\n",readBuf.Length());
-	    }
 	for (TUint i = 0; i < readBuf.Length(); i++)
 		{
 		if (readBuf[i] == '\r')
 			{
 			lineBuf[j++] = '\0';
-			OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_PRINTHOSTLOG_DUP04, "%s",*lineBuf);
-			j = 0;
+			RDebug::Print (_L("%s"),lineBuf);
+			j = 0;	
 			}
 		else
 			{
 			if (readBuf[i] != '\n')
 				{
-				lineBuf[j++] = readBuf[i];
+				lineBuf[j++] = readBuf[i];				
 				}
 			}
 		}
 	User::Free ((TAny *)readBuf.Ptr());
 	#endif
 	}
-
+	
 void CActiveControl::QueryUsbClientL(LDDConfigPtr aLddPtr, RDEVCLIENT* aPort)
 	{
 	// Get device/endpoint capabilities
@@ -1650,7 +1438,7 @@
 
 	// Device
 	// === Device Descriptor
-
+	
 	test.Start(_L("Query device and Endpoint Capabilities"));
 
 
@@ -1661,55 +1449,38 @@
 	const TInt n = d_caps().iTotalEndpoints;
 
 	TUSB_PRINT("###  USB device capabilities:");
-	OstTrace0(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL, "###  USB device capabilities:");
 	TUSB_PRINT1("Number of endpoints:                %d", n);
-	OstTrace1(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL_DUP01, "Number of endpoints:                %d", n);
 	TUSB_PRINT1("Supports Software-Connect:          %s",
-		d_caps().iConnect ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL_DUP02, "Supports Software-Connect:          %s",
-				d_caps().iConnect ? _L("yes") : _S("no"));
+				d_caps().iConnect ? _S("yes") : _S("no"));
 	TUSB_PRINT1("Device is Self-Powered:             %s",
-		d_caps().iSelfPowered ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL_DUP03, "Device is Self-Powered:             %s",
-				d_caps().iSelfPowered ? _L("yes") : _L("no"));
+				d_caps().iSelfPowered ? _S("yes") : _S("no"));
 	TUSB_PRINT1("Supports Remote-Wakeup:             %s",
-		d_caps().iRemoteWakeup ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL_DUP04, "Supports Remote-Wakeup:             %s",
-				d_caps().iRemoteWakeup ? _L("yes") : _L("no"));
+				d_caps().iRemoteWakeup ? _S("yes") : _S("no"));
 	TUSB_PRINT1("Supports High-speed:                %s",
-		d_caps().iHighSpeed ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL_DUP05, "Supports High-speed:                %s",
-				d_caps().iHighSpeed ? _L("yes") : _L("no"));
+				d_caps().iHighSpeed ? _S("yes") : _S("no"));
 	TUSB_PRINT1("Supports unpowered cable detection: %s\n",
-		(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ?
-		_S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL_DUP06, "Supports unpowered cable detection: %s\n",
 				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ?
-				_L("yes") : _L("no"));
+				_S("yes") : _S("no"));
 	TUSB_PRINT1("Supports endpoint resource allocation v2 scheme: %s\n",
-		(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) ?
-		_S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL_DUP07, "Supports endpoint resource allocation v2 scheme: %s\n",
 				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) ?
-				_L("yes") : _L("no"));
+				_S("yes") : _S("no"));					
 	TUSB_PRINT("");
-	OstTrace0(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL_DUP08, "");
 
 	iSoftwareConnect = d_caps().iConnect;					// we need to remember this
 	test_Equal(aLddPtr->iSoftConnect,iSoftwareConnect);
 
 	iSupportResourceAllocationV2 = ((d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) != 0);
-
+	
 	// only check capabilities if set; therefore allowing them to be disabled
 	if (aLddPtr->iSelfPower)
 		{
-		test(d_caps().iSelfPowered);
+		test(d_caps().iSelfPowered);	
 		}
-
+	
 	// only check capabilities if set; therefore allowing them to be disabled
 	if (aLddPtr->iRemoteWakeup)
 		{
-		test(d_caps().iRemoteWakeup);
+		test(d_caps().iRemoteWakeup);		
 		}
 
 	test_Equal(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower,aLddPtr->iFeatures);
@@ -1717,9 +1488,9 @@
 	// only check capability if set; therefore allowing it to be disabled
 	if (aLddPtr->iHighSpeed)
 		{
-		test(d_caps().iHighSpeed);
+		test(d_caps().iHighSpeed);		
 		}
-
+	
 	test_Equal(aLddPtr->iNumEndpoints,n);
 
 	// Endpoints
@@ -1729,17 +1500,16 @@
 	test_KErrNone(r);
 
 	TUSB_PRINT("### USB device endpoint capabilities:");
-	OstTrace0(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL_DUP09, "### USB device endpoint capabilities:");
 	for (TInt i = 0; i < n; i++)
 		{
 		const TUsbcEndpointCaps* caps = &data[i].iCaps;
-
-
+		
+		
 		TBuf<40> sizeStr(_S("unknown"));
 		if (caps->iSizes == KUsbEpNotAvailable)
 			{
-			sizeStr = _S("Not Available");
-			}
+			sizeStr = _S("Not Available");	
+			}		
 		else
 			{
 			sizeStr.SetLength(0);
@@ -1778,83 +1548,77 @@
 			if (caps->iTypesAndDir & KUsbEpTypeInterrupt)
 				typeStr.Append(_S("Interrupt "),10);
 			if (caps->iTypesAndDir & KUsbEpTypeIsochronous)
-				typeStr.Append(_S("Isochronous"),11);
+				typeStr.Append(_S("Isochronous"),11);			
 			}
-
+			
 		TBuf<20> directionStr(_S("unknown"));
-
+		
 		if (caps->iTypesAndDir & KUsbEpDirIn)
 			directionStr = _S("In");
 		if (caps->iTypesAndDir & KUsbEpDirOut)
 			directionStr = _S("Out");
 		if (caps->iTypesAndDir & KUsbEpDirBidirect)
 			directionStr = _S("Both");
-
+				
 		TUSB_PRINT4("Endpoint:%d Sizes =%s Type = %s - %s",
 					i+1,sizeStr.PtrZ(), typeStr.PtrZ(), directionStr.PtrZ());
-		OstTraceExt4(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL_DUP10, "Endpoint:%d Sizes =%S Type = %S - %S",
-					i+1,sizeStr, typeStr, directionStr);
 		}
 	TUSB_PRINT("");
-	OstTrace0(TRACE_NORMAL, CACTIVECONTROL_QUERYUSBCLIENTL_DUP11, "");
 
 	test.End();
-
+			
 	}
 
 
 void CActiveControl::AllocateEndpointDMA(RDEVCLIENT* aPort,TENDPOINTNUMBER aEndpoint)
 	{
 	TBool res = EFalse;
-
+	
 	TInt r = aPort->AllocateEndpointResource(aEndpoint, EUsbcEndpointResourceDMA);
 	if (r == KErrNone)
-		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEENDPOINTDMA, "DMA allocation on endpoint %d: KErrNone", aEndpoint);
+		RDebug::Print(_L("DMA allocation on endpoint %d: KErrNone"), aEndpoint);
 	else if (r == KErrInUse)
-		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP01, "DMA allocation on endpoint %d: KErrInUse", aEndpoint);
+		RDebug::Print(_L("DMA allocation on endpoint %d: KErrInUse"), aEndpoint);
 	else if (r == KErrNotSupported)
-		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP02, "DMA allocation on endpoint %d: KErrNotSupported", aEndpoint);
+		RDebug::Print(_L("DMA allocation on endpoint %d: KErrNotSupported"), aEndpoint);
 	else
-		OstTraceExt2(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP03, "DMA allocation on endpoint %d: unexpected return value %d", aEndpoint, r);
-	#ifdef	USB_SC
-	res = aPort->QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDMA);
-	#else
-	res = aPort->QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDMA);
-	#endif
-
-	TUSB_PRINT2("DMA on endpoint %d %s\n",
-				aEndpoint, res ? _S("allocated") : _S("not allocated"));
-	OstTraceExt2(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP04, "DMA on endpoint %d %S\n",
-				aEndpoint, res ? _L("allocated") : _L("not allocated"));
-
-	if ((r == KErrNone) && !res)
-		OstTrace0(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP05, "(Allocation success but negative query result: contradiction!\n");
-	else if ((r != KErrNone) && res)
-		OstTrace0(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEENDPOINTDMA_DUP06, "(Allocation failure but positive query result: contradiction!\n");
-	}
-
-
-void CActiveControl::DeAllocateEndpointDMA(RDEVCLIENT* aPort,TENDPOINTNUMBER aEndpoint)
-	{
-	TBool res = FALSE;
-	TInt r = aPort->DeAllocateEndpointResource(aEndpoint, EUsbcEndpointResourceDMA);
-	if (r == KErrNone)
-		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_DEALLOCATEENDPOINTDMA, "DMA deallocation on endpoint %d: KErrNone", aEndpoint);
-	else if (r == KErrNotSupported)
-		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_DEALLOCATEENDPOINTDMA_DUP01, "DMA deallocation on endpoint %d: KErrNotSupported", aEndpoint);
-	else
-		OstTraceExt2(TRACE_NORMAL, CACTIVECONTROL_DEALLOCATEENDPOINTDMA_DUP02, "DMA deallocation on endpoint %d: unexpected return value %d",
+		RDebug::Print(_L("DMA allocation on endpoint %d: unexpected return value %d"),
 					  aEndpoint, r);
 	#ifdef	USB_SC
 	res = aPort->QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDMA);
 	#else
 	res = aPort->QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDMA);
 	#endif
-
+	
 	TUSB_PRINT2("DMA on endpoint %d %s\n",
 				aEndpoint, res ? _S("allocated") : _S("not allocated"));
-	OstTraceExt2(TRACE_NORMAL, CACTIVECONTROL_DEALLOCATEENDPOINTDMA_DUP03, "DMA on endpoint %d %s\n",
-				aEndpoint, res ? _L("allocated") : _L("not allocated"));
+
+	if ((r == KErrNone) && !res)
+		RDebug::Print(_L("(Allocation success but negative query result: contradiction!)\n"));
+	else if ((r != KErrNone) && res)
+		RDebug::Print(_L("(Allocation failure but positive query result: contradiction!)\n"));
+	}
+
+
+void CActiveControl::DeAllocateEndpointDMA(RDEVCLIENT* aPort,TENDPOINTNUMBER aEndpoint)
+	{
+	TBool res = FALSE;	
+	TInt r = aPort->DeAllocateEndpointResource(aEndpoint, EUsbcEndpointResourceDMA);
+	if (r == KErrNone)
+		RDebug::Print(_L("DMA deallocation on endpoint %d: KErrNone"), aEndpoint);
+	else if (r == KErrNotSupported)
+		RDebug::Print(_L("DMA deallocation on endpoint %d: KErrNotSupported"), aEndpoint);
+	else
+		RDebug::Print(_L("DMA deallocation on endpoint %d: unexpected return value %d"),
+					  aEndpoint, r);
+	#ifdef	USB_SC
+	res = aPort->QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDMA);
+	#else
+	res = aPort->QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDMA);
+	#endif
+	
+	TUSB_PRINT2("DMA on endpoint %d %s\n",
+				aEndpoint, res ? _S("allocated") : _S("not allocated"));
 	}
 
 #ifndef USB_SC
@@ -1863,24 +1627,22 @@
 	TBool res = FALSE;
 	TInt r = aPort->AllocateEndpointResource(aEndpoint, EUsbcEndpointResourceDoubleBuffering);
 	if (r == KErrNone)
-		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING, "Double Buffering allocation on endpoint %d: KErrNone", aEndpoint);
+		RDebug::Print(_L("Double Buffering allocation on endpoint %d: KErrNone"), aEndpoint);
 	else if (r == KErrInUse)
-		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP01, "Double Buffering allocation on endpoint %d: KErrInUse", aEndpoint);
+		RDebug::Print(_L("Double Buffering allocation on endpoint %d: KErrInUse"), aEndpoint);
 	else if (r == KErrNotSupported)
-		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP02, "Double Buffering allocation on endpoint %d: KErrNotSupported", aEndpoint);
+		RDebug::Print(_L("Double Buffering allocation on endpoint %d: KErrNotSupported"), aEndpoint);
 	else
-		OstTraceExt2(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP03, "Double Buffering allocation on endpoint %d: unexpected return value %d",
+		RDebug::Print(_L("Double Buffering allocation on endpoint %d: unexpected return value %d"),
 					  aEndpoint, r);
 	res = aPort->QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDoubleBuffering);
 	TUSB_PRINT2("Double Buffering on endpoint %d %s\n",
 				aEndpoint, res ? _S("allocated") : _S("not allocated"));
-	OstTraceExt2(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP04, "Double Buffering on endpoint %d %s\n",
-				aEndpoint, res ? _L("allocated") : _L("not allocated"));
 
 	if ((r == KErrNone) && !res)
-		OstTrace0(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP05, "(Allocation success but negative query result: contradiction!\n");
+		RDebug::Print(_L("(Allocation success but negative query result: contradiction!)\n"));
 	else if ((r != KErrNone) && res)
-		OstTrace0(TRACE_NORMAL, CACTIVECONTROL_ALLOCATEDOUBLEBUFFERING_DUP06, "(Allocation failure but positive query result: contradiction!\n");
+		RDebug::Print(_L("(Allocation failure but positive query result: contradiction!)\n"));
 	}
 
 
@@ -1888,17 +1650,15 @@
 	{
 	TInt r = aPort->DeAllocateEndpointResource(aEndpoint, EUsbcEndpointResourceDoubleBuffering);
 	if (r == KErrNone)
-		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING, "Double Buffering deallocation on endpoint %d: KErrNone", aEndpoint);
+		RDebug::Print(_L("Double Buffering deallocation on endpoint %d: KErrNone"), aEndpoint);
 	else if (r == KErrNotSupported)
-		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING_DUP01, "Double Buffering deallocation on endpoint %d: KErrNotSupported", aEndpoint);
+		RDebug::Print(_L("Double Buffering deallocation on endpoint %d: KErrNotSupported"), aEndpoint);
 	else
-		OstTraceExt2(TRACE_NORMAL, CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING_DUP02, "Double Buffering deallocation on endpoint %d: unexpected return value %d",
+		RDebug::Print(_L("Double Buffering deallocation on endpoint %d: unexpected return value %d"),
 					  aEndpoint, r);
 	TBool res = aPort->QueryEndpointResourceUse(aEndpoint, EUsbcEndpointResourceDoubleBuffering);
 	TUSB_PRINT2("Double Buffering on endpoint %d %s\n",
 				aEndpoint, res ? _S("allocated") : _S("not allocated"));
-	OstTraceExt2(TRACE_NORMAL, CACTIVECONTROL_DEALLOCATEDOUBLEBUFFERING_DUP03, "Double Buffering on endpoint %d %s\n",
-				aEndpoint, res ? _L("allocated") : _L("not allocated"));
 	}
 
 #endif
@@ -1910,21 +1670,15 @@
 	if (!iSoftwareConnect)
 		{
 		iConsole->Printf(_L("This device does not support software\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONTROL_REENUMERATE, "This device does not support software\n");
 		iConsole->Printf(_L("disconnect/reconnect\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONTROL_REENUMERATE_DUP01, "disconnect/reconnect\n");
 		iConsole->Printf(_L("Please physically unplug and replug\n"));
-		OstTrace0(TRACE_NORMAL, CACTIVECONTROL_REENUMERATE_DUP02, "Please physically unplug and replug\n");
 		iConsole->Printf(_L("the USB cable NOW... "));
-		OstTrace0(TRACE_NORMAL, CACTIVECONTROL_REENUMERATE_DUP03, "the USB cable NOW... ");
 		}
 	iConsole->Printf(_L("\n>>> Start the t_usb_win program on the host <<<\n"));
-	OstTrace0(TRACE_NORMAL, CACTIVECONTROL_REENUMERATE_DUP04, "\n>>> Start the t_usb_win program on the host <<<\n");
 	User::WaitForRequest(enum_status);
 	if (enum_status != KErrNone)
 		{
 		TUSB_PRINT1("Error: Re-enumeration status = %d", enum_status.Int());
-		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_REENUMERATE_DUP05, "Error: Re-enumeration status = %d", enum_status.Int());
 		return KErrGeneral;
 		}
 	TUsbcDeviceState device_state =	EUsbcDeviceStateUndefined;
@@ -1932,7 +1686,6 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("Error %d on querying device state", r);
-		OstTrace1(TRACE_NORMAL, CACTIVECONTROL_REENUMERATE_DUP06, "Error %d on querying device state", r);
 		}
 	else
 		{
@@ -1945,15 +1698,6 @@
 						((device_state == EUsbcDeviceStateConfigured) ? _S("Configured") :
 						 ((device_state == EUsbcDeviceStateSuspended) ? _S("Suspended") :
 						  _S("Unknown"))))))));
-		OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_REENUMERATE_DUP07, "Current device state: %s",
-					(device_state == EUsbcDeviceStateUndefined) ? _L("Undefined") :
-					((device_state == EUsbcDeviceStateAttached) ? _L("Attached") :
-					 ((device_state == EUsbcDeviceStatePowered) ? _L("Powered") :
-					  ((device_state == EUsbcDeviceStateDefault) ? _L("Default") :
-					   ((device_state == EUsbcDeviceStateAddress) ? _L("Address") :
-						((device_state == EUsbcDeviceStateConfigured) ? _L("Configured") :
-						 ((device_state == EUsbcDeviceStateSuspended) ? _L("Suspended") :
-						  _L("Unknown"))))))));
 		}
 
 	// Check the speed of the established physical USB connection
@@ -1961,403 +1705,13 @@
 	if (iHighSpeed)
 		{
 		TUSB_PRINT("---> USB High-speed Testing\n");
-		OstTrace0(TRACE_NORMAL, CACTIVECONTROL_REENUMERATE_DUP08, "---> USB High-speed Testing\n");
 		}
 	else
 		{
 		TUSB_PRINT("---> USB Full-speed Testing\n");
-		OstTrace0(TRACE_NORMAL, CACTIVECONTROL_REENUMERATE_DUP09, "---> USB Full-speed Testing\n");
 		}
 
 	return KErrNone;
 	}
 
-
-#ifdef USB_SC
-
-void CActiveControl::SetupTransferedInterface(IFConfigPtr* aIfPtr, TInt aPortNumber)
-	{
-	TInt r;
-	TUSB_VERBOSE_PRINT1("SetupTransferedInterface %d", aPortNumber);
-	if(gVerbose)
-	    {
-	    OstTrace1(TRACE_VERBOSE, CACTIVECONTROL_SETUPTRANSFEREDINTERFACE, "SetupTransferedInterface %d", aPortNumber);
-	    }
-	test.Start (_L("Setup Transfered Interface "));
-
-	#ifdef USB_SC
-	TUsbcScInterfaceInfoBuf ifc = *((*aIfPtr)->iInfoPtr);
-	#else
-	TUsbcInterfaceInfoBuf ifc = *((*aIfPtr)->iInfoPtr);
-	#endif
-
-	TBuf8<KUsbDescSize_Interface> ifDescriptor;
-	r = iPort[aPortNumber].GetInterfaceDescriptor(0, ifDescriptor);
-	test_KErrNone(r);
-
-	// Check the interface descriptor
-	test(ifDescriptor[KIfcDesc_SettingOffset] == 0 && ifDescriptor[KIfcDesc_NumEndpointsOffset] == (*aIfPtr)->iInfoPtr->iTotalEndpointsUsed &&
-	    ifDescriptor[KIfcDesc_ClassOffset] == (*aIfPtr)->iInfoPtr->iClass.iClassNum &&
-	    ifDescriptor[KIfcDesc_SubClassOffset] == (*aIfPtr)->iInfoPtr->iClass.iSubClassNum &&
-	    ifDescriptor[KIfcDesc_ProtocolOffset] == (*aIfPtr)->iInfoPtr->iClass.iProtocolNum);
-
-	if ((*aIfPtr)->iNumber != 0 && ifDescriptor[KIfcDesc_NumberOffset] != (*aIfPtr)->iNumber)
-		{
-		ifDescriptor[KIfcDesc_NumberOffset] = (*aIfPtr)->iNumber;
-		r = iPort[aPortNumber].SetInterfaceDescriptor(0, ifDescriptor);
-		test_KErrNone(r);
-		}
-	else
-		{
-		(*aIfPtr)->iNumber = ifDescriptor[KIfcDesc_NumberOffset];
-		}
-	TUint8 interfaceNumber = (*aIfPtr)->iNumber;
-	TUSB_PRINT1 ("Interface Number %d",interfaceNumber);
-	OstTrace1 (TRACE_NORMAL, CACTIVECONTROL_SETUPTRANSFEREDINTERFACE_DUP01, "Interface Number %d",interfaceNumber);
-
-	// Check all endpoint descriptors
-	TBuf8<KUsbDescSize_AudioEndpoint> epDescriptor;
-	for (TUint i = 0; i < (*aIfPtr)->iInfoPtr->iTotalEndpointsUsed; i++)
-		{
-		if (!gSkip)
-			{
-			TestEndpointDescriptor (&iPort[aPortNumber],0,i+1,(*aIfPtr)->iInfoPtr->iEndpointData[i]);
-
-			}
-
-		if (firstBulkOutEndpoint < 0 && ((*aIfPtr)->iInfoPtr->iEndpointData[i].iDir & KUsbEpDirOut) &&
-			(*aIfPtr)->iInfoPtr->iEndpointData[i].iType == KUsbEpTypeBulk)
-			{
-			firstBulkOutEndpoint = i+1;
-			}
-		}
-
-	TUSB_PRINT1 ("Interface number is %d",interfaceNumber);
-	OstTrace1 (TRACE_NORMAL, CACTIVECONTROL_SETUPTRANSFEREDINTERFACE_DUP02, "Interface number is %d",interfaceNumber);
-	(*aIfPtr)->iPortNumber = aPortNumber;
-	gInterfaceConfig [interfaceNumber] [0] = *aIfPtr;
-
-	TInt alternateNumber = 1;
-	// check for any alternatate interfaces and set any that are found
-	* aIfPtr = (*aIfPtr)->iPtrNext;
-	if (* aIfPtr != NULL)
-		{
-		test(SupportsAlternateInterfaces());
-
-		IFConfigPtr ifPtr = *aIfPtr;
-		while (ifPtr != NULL)
-			{
-			if (ifPtr->iAlternateSetting)
-				{
-				ifc = *(ifPtr->iInfoPtr);
-
-				r = iPort[aPortNumber].GetInterfaceDescriptor(alternateNumber, ifDescriptor);
-				test_KErrNone(r);
-
-				// Check the interface descriptor
-				test(ifDescriptor[KIfcDesc_SettingOffset] == alternateNumber && ifDescriptor[KIfcDesc_NumEndpointsOffset] == (*aIfPtr)->iInfoPtr->iTotalEndpointsUsed &&
-				    ifDescriptor[KIfcDesc_ClassOffset] == (*aIfPtr)->iInfoPtr->iClass.iClassNum &&
-				    ifDescriptor[KIfcDesc_SubClassOffset] == (*aIfPtr)->iInfoPtr->iClass.iSubClassNum &&
-				    ifDescriptor[KIfcDesc_ProtocolOffset] == (*aIfPtr)->iInfoPtr->iClass.iProtocolNum);
-
-				// Check all endpoint descriptors
-				for (TUint i = 0; i < ifPtr->iInfoPtr->iTotalEndpointsUsed; i++)
-					{
-					TInt desc_size;
-					r = iPort[aPortNumber].GetEndpointDescriptorSize(alternateNumber, i+1, desc_size);
-					test_KErrNone(r);
-					test_Equal(KUsbDescSize_Endpoint + (*aIfPtr)->iInfoPtr->iEndpointData[i].iExtra,static_cast<TUint>(desc_size));
-
-					r = iPort[aPortNumber].GetEndpointDescriptor(alternateNumber, i+1, epDescriptor);
-					test_KErrNone(r);
-
-					test((((*aIfPtr)->iInfoPtr->iEndpointData[i].iDir & KUsbEpDirIn) && (epDescriptor[KEpDesc_AddressOffset] & 0x80) ||
-						!((*aIfPtr)->iInfoPtr->iEndpointData[i].iDir & KUsbEpDirIn) && !(epDescriptor[KEpDesc_AddressOffset] & 0x80)) &&
-						EpTypeMask2Value((*aIfPtr)->iInfoPtr->iEndpointData[i].iType) == (TUint)(epDescriptor[KEpDesc_AttributesOffset] & 0x03) &&
-						(*aIfPtr)->iInfoPtr->iEndpointData[i].iInterval == epDescriptor[KEpDesc_IntervalOffset]);
-
-
-					if (!gSkip && (*aIfPtr)->iInfoPtr->iEndpointData[i].iExtra)
-						{
-						test.Next(_L("Extended Endpoint Descriptor Manipulation"));
-						TUint8 addr = 0x85;										// bogus address
-						if (epDescriptor[KEpDesc_SynchAddressOffset] == addr)
-							addr++;
-						epDescriptor[KEpDesc_SynchAddressOffset] = addr;
-						r = iPort[aPortNumber].SetEndpointDescriptor(alternateNumber, i+1, epDescriptor);
-						test_KErrNone(r);
-
-						TBuf8<KUsbDescSize_AudioEndpoint> descriptor2;
-						r = iPort[aPortNumber].GetEndpointDescriptor(alternateNumber, i+1, descriptor2);
-						test_KErrNone(r);
-
-						test.Next(_L("Compare endpoint descriptor with value set"));
-						r = descriptor2.Compare(epDescriptor);
-						test_KErrNone(r);
-						}
-					}
-
-
-				// if no error move on to the next interface
-				ifPtr->iPortNumber = aPortNumber;
-				ifPtr->iNumber = interfaceNumber;
-				gInterfaceConfig [interfaceNumber] [alternateNumber] = ifPtr;
-
-				alternateNumber++;
-				ifPtr = ifPtr->iPtrNext;
-				* aIfPtr = ifPtr;
-				}
-			else
-				{
-				ifPtr = NULL;
-				}
-			}
-		}
-	iNumInterfaceSettings[aPortNumber] = alternateNumber;
-	if (!gSkip)
-		{
-		TestInvalidSetInterface (&iPort[aPortNumber],iNumInterfaceSettings[aPortNumber]);
-		TestInvalidReleaseInterface (&iPort[aPortNumber],iNumInterfaceSettings[aPortNumber]);
-
-		//TestDescriptorManipulation(iLddPtr->iHighSpeed,&iPort[aPortNumber],alternateNumber);
-		TestOtgExtensions(&iPort[aPortNumber]);
-		TestEndpoint0MaxPacketSizes(&iPort[aPortNumber]);
-		}
-
-	test.End();
-	}
-
-
-void CActiveControl::ConstructLOnSharedLdd(const RMessagePtr2& aMsg)
-	{
-// currently only support one interface with one alternate settings
-	test.Start (_L("ConstructLOnSharedLdd Configuration"));
-
-	User::LeaveIfError(iPort[0].Open(aMsg, 0, EOwnerProcess));
-	CleanupClosePushL(iPort[0]);
-
-	RChunk* chunk;
-	//Get the Ldd's RChunk, but don't own it.
-	User::LeaveIfError(iPort[0].GetDataTransferChunk(chunk));
-	User::LeaveIfError(chunk->Open(aMsg, 1, FALSE, EOwnerProcess));
-	CleanupStack::Pop();
-
-
-	TInt r;
-
-	User::LeaveIfError(iFs.Connect());
-
-	test_Compare(iConfigFileName->Length(),!=,0);
-
-	iTimer.CreateLocal();
-	iPending = EPendingNone;
-
-	test.Next (_L("Open configuration file"));
-	// set the session path to use the ROM if no drive specified
-	r=iFs.SetSessionPath(_L("Z:\\test\\"));
-	test_KErrNone(r);
-
-	r = iConfigFile.Open(iFs, * iConfigFileName, EFileShareReadersOnly | EFileStreamText | EFileRead);
-	test_KErrNone(r);
-	TUSB_VERBOSE_PRINT1("Configuration file %s Opened successfully", iConfigFileName->PtrZ());
-	if(gVerbose)
-	    {
-	    OstTraceExt1(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTLONSHAREDLDD, "Configuration file %s Opened successfully", *iConfigFileName);
-	    }
-
-	test.Next (_L("Process configuration file"));
-	test(ProcessConfigFile (iConfigFile,iConsole,&iLddPtr));
-
-	iConfigFile.Close();
-
-	test.Next (_L("LDD in configuration file"));
-	test_NotNull(iLddPtr);
-
-	LDDConfigPtr lddPtr = iLddPtr;
-	TInt nextPort = 0;
-	while (lddPtr != NULL)
-		{
-		// Load logical driver (LDD)
-		// (There's no physical driver (PDD) with USB: it's a kernel extension DLL which
-		//  was already loaded at boot time.)
-		test.Next (_L("Loading USB LDD"));
-		TUSB_VERBOSE_PRINT1("Loading USB LDD ",lddPtr->iName.PtrZ());
-		if(gVerbose)
-		    {
-		    OstTraceExt1(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP01, "Loading USB LDD:%S ",lddPtr->iName);
-		    }
-		r = User::LoadLogicalDevice(lddPtr->iName);
-		test(r == KErrNone || r == KErrAlreadyExists);
-
-		IFConfigPtr ifPtr = lddPtr->iIFPtr;
-
-		test.Next (_L("Opening Channels"));
-		TUSB_VERBOSE_PRINT1("Successfully opened USB port %d", lddPtr->iNumChannels);
-		if(gVerbose)
-		    {
-		    OstTrace1(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP02, "Successfully opened USB port %d", lddPtr->iNumChannels);
-		    }
-		for (TInt portNumber = nextPort; portNumber < nextPort+lddPtr->iNumChannels; portNumber++)
-			{
-			test_Compare(lddPtr->iNumChannels,>,0);
-
-			// Open USB channel
-
-			TUSB_VERBOSE_PRINT("Successfully opened USB port");
-			if(gVerbose)
-			    {
-			    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP03, "Successfully opened USB port");
-			    }
-
-			// Query the USB device/Setup the USB interface
-			if (portNumber == nextPort)
-				{
-				// Change some descriptors to contain suitable values
-				SetupDescriptors(lddPtr, &iPort[portNumber]);
-				}
-
-			if (portNumber == 0)
-				{
-				QueryUsbClientL(lddPtr, &iPort[portNumber]);
-				}
-
-			test_NotNull(ifPtr);
-
-			if (iSupportResourceAllocationV2)
-				{
-				PopulateInterfaceResourceAllocation(ifPtr, portNumber);
-				}
-
-			IFConfigPtr defaultIfPtr = ifPtr;
-			SetupTransferedInterface(&ifPtr,portNumber);
-
-
-			if (!iSupportResourceAllocationV2)
-				{
-				// 	allocate endpoint DMA and double buffering for all endpoints on default interface when using resource allocation v1 api
-				for (TUint8 i = 1; i <= defaultIfPtr->iInfoPtr->iTotalEndpointsUsed; i++)
-					{
-					defaultIfPtr->iEpDMA[i-1] ? AllocateEndpointDMA(&iPort[portNumber],(TENDPOINTNUMBER)i) : DeAllocateEndpointDMA(&iPort[portNumber],(TENDPOINTNUMBER)i);
-					#ifndef USB_SC
-					defaultIfPtr->iEpDoubleBuff[i-1] ? AllocateDoubleBuffering(&iPort[portNumber],(TENDPOINTNUMBER)i) : DeAllocateDoubleBuffering(&iPort[portNumber],(TENDPOINTNUMBER)i);
-					#endif
-					}
-				}
-			}
-
-		iTotalChannels += lddPtr->iNumChannels;
-		nextPort += lddPtr->iNumChannels;
-		lddPtr = lddPtr->iPtrNext;
-		}
-
-	TUSB_VERBOSE_PRINT("All Interfaces and Alternate Settings successfully set up");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP04, "All Interfaces and Alternate Settings successfully set up");
-	    }
-
-	test.Next (_L("Start Idle Counter Thread"));
-	r = iIdleCounterThread.Create(_L("IdleCounter"), IdleCounterThread, KDefaultStackSize, KMinHeapSize, KMinHeapSize, NULL);
-	test_KErrNone(r);
-	iIdleCounterThread.Resume();
-	// Allow some time for low-priority counter process
-	User::After(100000); // 0.1 second
-	r = iIdleCounterChunk.OpenGlobal(KTestIdleCounterChunkName, EFalse);
-	test_KErrNone(r);
-	iIdleCounter = (struct TTestIdleCounter*) iIdleCounterChunk.Base();
-	test_NotNull(iIdleCounter);
-	// Allow some time for low-priority counter process
-	User::After(100000); // 0.1 second
-	TInt64 val1 = iIdleCounter->iCounter;
-	User::After(1000000); // 1 second
-	TInt64 val2 = iIdleCounter->iCounter;
-	TUSB_PRINT1("Idle Counter when test inactive: %Ldinc/ms", (val2 - val1) / 1000);
-	OstTraceExt1(TRACE_NORMAL, CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP05, "Idle Counter when test inactive: %Ldinc/ms", (val2 - val1) / 1000);
-
-	test.Next (_L("Enumeration..."));
-	r = ReEnumerate();
-	test_KErrNone(r);
-
-	TUSB_VERBOSE_PRINT("Device successfully re-enumerated\n");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP06, "Device successfully re-enumerated\n");
-	    }
-
-
-	if (iLddPtr->iHighSpeed && !gSkip)
-		{
-		test.Next (_L("High Speed"));
-		test(iHighSpeed);
-		}
-
-	test.Next (_L("Create Notifiers"));
-	for (TInt portNumber = 0; portNumber < iTotalChannels; portNumber++)
-		{
-
-		// Create device state active object
-		iDeviceStateNotifier[portNumber] = CActiveDeviceStateNotifier::NewL(iConsole, &iPort[portNumber], portNumber);
-		test_NotNull(iDeviceStateNotifier[portNumber]);
-		iDeviceStateNotifier[portNumber]->Activate();
-		TUSB_VERBOSE_PRINT("Created device state notifier");
-		if(gVerbose)
-		    {
-		    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP07, "Created device state notifier");
-		    }
-
-		// Create endpoint stall status active object
-		iStallNotifier[portNumber] = CActiveStallNotifier::NewL(iConsole, &iPort[portNumber]);
-		test_NotNull(iStallNotifier[portNumber]);
-		iStallNotifier[portNumber]->Activate();
-		TUSB_VERBOSE_PRINT("Created stall notifier");
-		if(gVerbose)
-		    {
-		    OstTrace0(TRACE_VERBOSE, CACTIVECONTROL_CONSTRUCTLONSHAREDLDD_DUP08, "Created stall notifier");
-		    }
-
-		TestInvalidSetInterface (&iPort[portNumber],iNumInterfaceSettings[portNumber]);
-		TestInvalidReleaseInterface (&iPort[portNumber],iNumInterfaceSettings[portNumber]);
-
-		}
-
-	test.Next (_L("Endpoint Zero Max Packet Sizes"));
-	TUint ep0Size = iPort[0].EndpointZeroMaxPacketSizes();
-	switch (ep0Size)
-		{
-		case KUsbEpSize8 :
-			iEp0PacketSize = 8;
-			break;
-
-		case KUsbEpSize16 :
-			iEp0PacketSize = 16;
-			break;
-
-		case KUsbEpSize32 :
-			iEp0PacketSize = 32;
-			break;
-
-		case KUsbEpSize64 :
-			iEp0PacketSize = 64;
-			break;
-
-		default:
-			iEp0PacketSize = 0;
-			break;
-		}
-	test_Compare(iEp0PacketSize,>,0);
-
-	test.Next (_L("Set Device Control"));
-	r = iPort[0].SetDeviceControl();
-	test_KErrNone(r);
-
-	#ifdef USB_SC
-	r = iPort[0].OpenEndpoint(iEp0Buf,0);
-	test_KErrNone(r);
-	#endif
-
-	test.End();
-	RequestEp0ControlPacket();
-	}
-
-#endif
 // -eof-
--- a/kerneltest/e32test/usb/t_usb_device/src/activedevicestatenotifier.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/activedevicestatenotifier.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -14,17 +14,13 @@
 // e32test/usb/t_usb_device/src/activestatenotifier.cpp
 // USB Test Program T_USB_DEVICE, functional part.
 // Device-side part, to work against T_USB_HOST running on the host.
-//
+// 
 //
 
 #include "general.h"
 #include "activerw.h"									// CActiveRW
 #include "config.h"
 #include "activeControl.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "activedevicestatenotifierTraces.h"
-#endif
 #include "activedevicestatenotifier.h"
 
 extern CActiveControl* gActiveControl;
@@ -68,10 +64,6 @@
 CActiveDeviceStateNotifier::~CActiveDeviceStateNotifier()
 	{
 	TUSB_VERBOSE_PRINT("CActiveDeviceStateNotifier::~CActiveDeviceStateNotifier()");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVEDEVICESTATENOTIFIER_DCACTIVEDEVICESTATENOTIFIER, "CActiveDeviceStateNotifier::~CActiveDeviceStateNotifier()");
-	    }
 	Cancel();												// base class
 	}
 
@@ -79,10 +71,6 @@
 void CActiveDeviceStateNotifier::DoCancel()
 	{
 	TUSB_VERBOSE_PRINT("CActiveDeviceStateNotifier::DoCancel()");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVEDEVICESTATENOTIFIER_DOCANCEL, "CActiveDeviceStateNotifier::DoCancel()");
-	    }
 	iPort->AlternateDeviceStatusNotifyCancel();
 	}
 
@@ -97,52 +85,28 @@
 		switch (iDeviceState)
 			{
 		case EUsbcDeviceStateUndefined:
-#ifdef	USB_SC
-			TUSB_PRINT("Device State notifier: Undefined0");
-			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL, "Device State notifier: Undefined0");
-			for (TUint16 i =0; i < KMaxConcurrentTests; i++)
-				{
-				if (gRW[i])
-					{
-					TUSB_VERBOSE_PRINT2("ResetAltSetting index %d, LDD %x",i, gRW[i]->Ldd());
-					if(gVerbose)
-					    {
-					    OstTraceExt2(TRACE_VERBOSE, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP01, "ResetAltSetting index %u, LDD %x",(TUint32)i, (TUint32)gRW[i]->Ldd());
-					    }
-					gRW[i]->Ldd()->ResetAltSetting();
-					}
-				}
-#endif
 			TUSB_PRINT("Device State notifier: Undefined");
-			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP02, "Device State notifier: Undefined");
 			break;
 		case EUsbcDeviceStateAttached:
 			TUSB_PRINT("Device State notifier: Attached");
-			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP03, "Device State notifier: Attached");
 			break;
 		case EUsbcDeviceStatePowered:
 			TUSB_PRINT("Device State notifier: Powered");
-			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP04, "Device State notifier: Powered");
 			break;
 		case EUsbcDeviceStateDefault:
 			TUSB_PRINT("Device State notifier: Default");
-			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP05, "Device State notifier: Default");
 			break;
 		case EUsbcDeviceStateAddress:
 			TUSB_PRINT("Device State notifier: Address");
-			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP06, "Device State notifier: Address");
 			break;
 		case EUsbcDeviceStateConfigured:
 			TUSB_PRINT("Device State notifier: Configured");
-			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP07, "Device State notifier: Configured");
 			break;
 		case EUsbcDeviceStateSuspended:
 			TUSB_PRINT("Device State notifier: Suspended");
-			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP08, "Device State notifier: Suspended");
 			break;
 		default:
 			TUSB_PRINT("Device State notifier: ***BAD***");
-			OstTrace0(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP09, "Device State notifier: ***BAD***");
 			}
 		}
 	else if (iDeviceState & KUsbAlternateSetting)
@@ -150,9 +114,7 @@
 		TUint8 altSetting = iDeviceState & ~KUsbAlternateSetting;
 		TUSB_PRINT2("Device State notifier: Alternate interface %d setting has changed: now %d",
 					iPortNumber, altSetting);
-		OstTraceExt2(TRACE_NORMAL, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP10, "Device State notifier: Alternate interface %u setting has changed: now %u",
-					(TUint32)iPortNumber, (TUint32)altSetting);
-
+					
 		TUsbDeviceCaps dCaps;
 		iPort->DeviceCaps(dCaps);
 		TBool isResourceAllocationV2 = ((dCaps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) != 0);
@@ -175,12 +137,12 @@
 							newIfPtr->iEpDoubleBuff[i-1] ? gActiveControl->AllocateDoubleBuffering(iPort,(TENDPOINTNUMBER)i) : gActiveControl->DeAllocateDoubleBuffering(iPort,(TENDPOINTNUMBER)i);
 							#endif
 							}
-						break;
+						break;				
 						}
 					}
 				}
-			}
-
+			}	
+						
 		if (gAltSettingOnNotify)
 			{
 			for (TUint16 i =0; i < KMaxConcurrentTests; i++)
@@ -188,11 +150,7 @@
 				if (gRW[i])
 					{
 					TUSB_VERBOSE_PRINT1("Resuming alternate Setting - activeRW index %d",i);
-					if(gVerbose)
-					    {
-					    OstTrace1(TRACE_VERBOSE, CACTIVEDEVICESTATENOTIFIER_RUNL_DUP11, "Resuming alternate Setting - activeRW index %d",i);
-					    }
-					gRW[i]->ResumeAltSetting(altSetting);
+					gRW[i]->ResumeAltSetting(altSetting);						
 					}
 				}
 			}
--- a/kerneltest/e32test/usb/t_usb_device/src/activerw.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/activerw.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -14,19 +14,14 @@
 // e32test/usb/t_usb_device/src/activerw.cpp
 // USB Test Program T_USB_DEVICE, functional part.
 // Device-side part, to work against T_USB_HOST running on the host.
-//
+// 
 //
 
 #include "general.h"									// CActiveControl, CActiveRW
 #include "config.h"
 #include "activerw.h"
-#include "activetimer.h"
+#include "activetimer.h" 
 #include "usblib.h"										// Helpers
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "activerwTraces.h"
-#endif
-
 
 _LIT(KFileName, "\\T_USBFILE.BIN");
 
@@ -52,7 +47,7 @@
 	: CActive(EPriorityNormal),
 		#ifndef USB_SC
 		iWriteBuf((TUint8 *)NULL,0,0),		// temporary initialisation
-		iReadBuf((TUint8 *)NULL,0,0),		// temporary initialisation
+		iReadBuf((TUint8 *)NULL,0,0),		// temporary initialisation	
 	  	#endif
 	  iConsole(aConsole),
 	  iPort(aPort),
@@ -71,17 +66,12 @@
 	{
 	gActiveTestCount++;
 	TUSB_VERBOSE_PRINT("CActiveRW::CActiveRW()");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVERW_CACTIVERW, "CActiveRW::CActiveRW()");
-	    }
 	}
 
 
 CActiveRW* CActiveRW::NewL(CConsoleBase* aConsole, RDEVCLIENT* aPort, RFs aFs, TUint16 aIndex, TBool aLastSetting)
 	{
-	//TUSB_VERBOSE_APRINT("CActiveRW::NewL()");
-	//OstTrace0(TRACE_NORMAL, CACTIVERW_NEWL, "CActiveRW::NewL()");
+	TUSB_VERBOSE_APRINT("CActiveRW::NewL()");
 
 	CActiveRW* self = new (ELeave) CActiveRW(aConsole, aPort, aFs, aIndex, aLastSetting);
 	CleanupStack::PushL(self);
@@ -95,17 +85,12 @@
 void CActiveRW::ConstructL()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::ConstructL()");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVERW_CONSTRUCTL, "CActiveRW::ConstructL()");
-	    }
 
 	// Create read timeout timer active object (but don't activate it yet)
 	iTimeoutTimer = CActiveTimer::NewL(iConsole, iPort);
 	if (!iTimeoutTimer)
 		{
 		TUSB_PRINT("Failed to create timeout timer");
-		OstTrace0(TRACE_NORMAL, CACTIVERW_CONSTRUCTL_DUP01, "Failed to create timeout timer");
 		}
 	}
 
@@ -113,10 +98,6 @@
 CActiveRW::~CActiveRW()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::~CActiveRW()");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVERW_DCACTIVERW, "CActiveRW::~CActiveRW()");
-	    }
 	Cancel();												// base class
 	delete iTimeoutTimer;
 	#ifdef USB_SC
@@ -142,7 +123,7 @@
 	{
 	iBufSz = aTpPtr->minSize;
 	iPktNum = aTpPtr->packetNumber;
-
+	
 	iTestParams = *aTpPtr;
 
 	gYieldRepeat = ((iTestParams.settingRepeat != 0) || (iIndex == 0))? 0 : KYieldRepeat;
@@ -154,38 +135,26 @@
 		if (newBuffer == NULL)
 			{
 			TUSB_PRINT ("Failure to allocate heap memory");
-			OstTrace0 (TRACE_ERROR, CACTIVERW_SETTESTPARAMS, "Failure to allocate heap memory");
 			test(EFalse);
 			}
 		iReadBuf.Set((TUint8 *)newBuffer,0,(TInt)aTpPtr->maxSize);
 		#endif
 		TBuf8<KUsbDescSize_Endpoint> descriptor;
 		TUSB_VERBOSE_PRINT2 ("GetEndpointDescriptor Alt Setting %d Endpoint %d",iTestParams.alternateSetting, iTestParams.outPipe);
-		if(gVerbose)
-		    {
-		    OstTraceExt2 (TRACE_VERBOSE, CACTIVERW_SETTESTPARAMS_DUP01, "GetEndpointDescriptor Alt Setting %d Endpoint %d",iTestParams.alternateSetting, iTestParams.outPipe);
-		    }
 		TInt r = iPort->GetEndpointDescriptor(iTestParams.alternateSetting, (TENDPOINTNUMBER)iTestParams.outPipe, descriptor);
 		if ((TUint)r != iReadSize)
 			{
 			TUSB_PRINT("Failed to get endpoint descriptor");
-			OstTrace0(TRACE_ERROR, CACTIVERW_SETTESTPARAMS_DUP02, "Failed to get endpoint descriptor");
 			test(EFalse);
 			return;
 			}
 
-		iMaxPktSz = EpSize(descriptor[KEpDesc_PacketSizeOffset],descriptor[KEpDesc_PacketSizeOffset+1]);
+		iMaxPktSz = EpSize(descriptor[KEpDesc_PacketSizeOffset],descriptor[KEpDesc_PacketSizeOffset+1]);		
 		TUSB_VERBOSE_PRINT5 ("Out Endpoint 0x%x attributes 0x%x interface %d setting %d max packet size %d",
 			descriptor[KEpDesc_AddressOffset],descriptor[KEpDesc_AttributesOffset],iTestParams.interfaceNumber,iTestParams.alternateSetting,iMaxPktSz);
-		if(gVerbose)
-		    {
-		    OstTraceExt5 (TRACE_VERBOSE, CACTIVERW_SETTESTPARAMS_DUP03, "Out Endpoint 0x%x attributes 0x%x interface %d setting %d max packet size %d",
-			(TUint)descriptor[KEpDesc_AddressOffset],(TUint)descriptor[KEpDesc_AttributesOffset],(TUint)iTestParams.interfaceNumber,(TUint)iTestParams.alternateSetting,(TUint)iMaxPktSz);
-		    }
 		if (!gSkip && iMaxPktSz != (TUint)gInterfaceConfig[iTestParams.interfaceNumber][iTestParams.alternateSetting]->iInfoPtr->iEndpointData[iTestParams.outPipe-1].iSize)
 			{
 			TUSB_PRINT4("Error - Interface %d Setting %d Endpoint %d Max Packet Size %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe,iMaxPktSz);
-			OstTraceExt4(TRACE_ERROR, CACTIVERW_SETTESTPARAMS_DUP04, "Error - Interface %d Setting %d Endpoint %d Max Packet Size %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe,iMaxPktSz);
 			test(EFalse);
 			return;
 			}
@@ -197,43 +166,31 @@
 		if (newBuffer == NULL)
 			{
 			TUSB_PRINT ("Failure to allocate heap memory");
-			OstTrace0 (TRACE_ERROR, CACTIVERW_SETTESTPARAMS_DUP05, "Failure to allocate heap memory");
 			test(EFalse);
 			}
 		iWriteBuf.Set((TUint8 *)newBuffer,0,(TInt)aTpPtr->maxSize);
 		#endif
 		TBuf8<KUsbDescSize_Endpoint> descriptor;
 		TUSB_VERBOSE_PRINT2 ("GetEndpointDescriptor Alt Setting %d Endpoint %d",iTestParams.alternateSetting, iTestParams.inPipe);
-		if(gVerbose)
-		    {
-		    OstTraceExt2 (TRACE_VERBOSE, CACTIVERW_SETTESTPARAMS_DUP06, "GetEndpointDescriptor Alt Setting %d Endpoint %d",iTestParams.alternateSetting, iTestParams.inPipe);
-		    }
 		TInt r = iPort->GetEndpointDescriptor(iTestParams.alternateSetting, (TENDPOINTNUMBER)iTestParams.inPipe, descriptor);
 		if (r != KErrNone)
 			{
 			TUSB_PRINT("Failed to get endpoint descriptor");
-			OstTrace0(TRACE_ERROR, CACTIVERW_SETTESTPARAMS_DUP07, "Failed to get endpoint descriptor");
 			test(EFalse);
 			return;
 			}
 
-		TInt maxPktSz = EpSize(descriptor[KEpDesc_PacketSizeOffset],descriptor[KEpDesc_PacketSizeOffset+1]);
+		TInt maxPktSz = EpSize(descriptor[KEpDesc_PacketSizeOffset],descriptor[KEpDesc_PacketSizeOffset+1]);		
 		TUSB_VERBOSE_PRINT5 ("In Endpoint 0x%x attributes 0x%x interface %d setting %d max packet size %d",
 			descriptor[KEpDesc_AddressOffset],descriptor[KEpDesc_AttributesOffset],iTestParams.interfaceNumber,iTestParams.alternateSetting,maxPktSz);
-		if(gVerbose)
-		    {
-		    OstTraceExt5 (TRACE_VERBOSE, CACTIVERW_SETTESTPARAMS_DUP08, "In Endpoint 0x%x attributes 0x%x interface %d setting %d max packet size %d",
-			descriptor[KEpDesc_AddressOffset],descriptor[KEpDesc_AttributesOffset],iTestParams.interfaceNumber,iTestParams.alternateSetting,maxPktSz);
-		    }
 		if (!gSkip && maxPktSz != gInterfaceConfig[iTestParams.interfaceNumber][iTestParams.alternateSetting]->iInfoPtr->iEndpointData[iTestParams.inPipe-1].iSize)
 			{
 			TUSB_PRINT4("Error - Interface %d Setting %d Endpoint %d Max Packet Size %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.inPipe,maxPktSz);
-			OstTraceExt4(TRACE_ERROR, CACTIVERW_SETTESTPARAMS_DUP09, "Error - Interface %d Setting %d Endpoint %d Max Packet Size %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.inPipe,maxPktSz);
 			test(EFalse);
 			return;
 			}
 		}
-
+		
 	}
 
 
@@ -251,16 +208,8 @@
 	{
 	if (aType == ESuspend)
 		TUSB_VERBOSE_PRINT1("Index %d Suspend",iIndex);
-		if(gVerbose)
-		    {
-		    OstTrace1(TRACE_VERBOSE, CACTIVERW_SUSPEND, "Index %d Suspend",iIndex);
-		    }
 	if (aType == EAltSetting)
-		TUSB_VERBOSE_PRINT3("Index %d Suspend for Alternate Setting - interface %d setting %d",iIndex,iTestParams.interfaceNumber,iTestParams.alternateSetting);
-		if(gVerbose)
-		    {
-		    OstTraceExt3(TRACE_VERBOSE, CACTIVERW_SUSPEND_DUP01, "Index %d Suspend for Alternate Setting - interface %d setting %d",iIndex,iTestParams.interfaceNumber,iTestParams.alternateSetting);
-		    }
+		TUSB_VERBOSE_PRINT3("Index %d Suspend for Alternate Setting - interface %d setting %d",iIndex,iTestParams.interfaceNumber,iTestParams.alternateSetting);	
 	iStatus = KRequestPending;
 	iCurrentXfer = aType;
 	if (!IsActive())
@@ -270,12 +219,8 @@
 	}
 
 void CActiveRW::Resume()
-	{
+	{	
 	TUSB_VERBOSE_PRINT3("Index %d Resume interface %d setting %d",iIndex,iTestParams.interfaceNumber,iTestParams.alternateSetting);
-	if(gVerbose)
-	    {
-	    OstTraceExt3(TRACE_VERBOSE, CACTIVERW_RESUME, "Index %d Resume interface %d setting %d",iIndex,iTestParams.interfaceNumber,iTestParams.alternateSetting);
-	    }
 	TRequestStatus* status = &iStatus;
 	User::RequestComplete(status,KErrNone);
 	if (!IsActive())
@@ -287,12 +232,8 @@
 void CActiveRW::Yield()
 	{
 	TUSB_VERBOSE_PRINT1("Index %d Scheduler Yield",iIndex);
-	if(gVerbose)
-	    {
-	    OstTrace1(TRACE_VERBOSE, CACTIVERW_YIELD, "Index %d Scheduler Yield",iIndex);
-	    }
 	// removes the active object from the scheduler queue then adds it back in again
-	Deque();
+	Deque();	
 	CActiveScheduler::Add(this);
 	}
 
@@ -307,7 +248,7 @@
 void CActiveRW::StartOrSuspend()
 	{
 	TInt altSetting;
-
+	
 	iPort->GetAlternateSetting (altSetting);
 	if (iTestParams.alternateSetting != altSetting)
 		{
@@ -322,169 +263,9 @@
 			gSettingNumber[iTestParams.interfaceNumber] = iTestParams.alternateSetting;
 			r = iPort->StartNextOutAlternateSetting(ETrue);
 			TUSB_VERBOSE_PRINT1("StartNextOutAlternateSetting retValue %d",r);
-			if(gVerbose)
-			    {
-			    OstTrace1(TRACE_VERBOSE, CACTIVERW_STARTORSUSPEND, "StartNextOutAlternateSetting retValue %d",r);
-			    }
 			test_Value(r, (r >= KErrNone) || (r == KErrNotReady)   || (r == KErrGeneral));
 			}
 		TUSB_VERBOSE_PRINT4 ("CActiveRW::StartOrSuspend() interface %d setting %d Out %d In %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe,iTestParams.inPipe);
-		if(gVerbose)
-		    {
-		    OstTraceExt4 (TRACE_VERBOSE, CACTIVERW_STARTORSUSPEND_DUP01, "CActiveRW::StartOrSuspend() interface %d setting %d Out %d In %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe,iTestParams.inPipe);
-		    }
-		if ((TENDPOINTNUMBER)iTestParams.outPipe <= KMaxEndpointsPerClient)
-			{
-			r = iPort->OpenEndpoint(iSCReadBuf,iTestParams.outPipe);
-			test_KErrNone(r);
-			}
-		if ((TENDPOINTNUMBER)iTestParams.inPipe <= KMaxEndpointsPerClient)
-			{
-			r = iPort->OpenEndpoint(iSCWriteBuf,iTestParams.inPipe);
-			test_KErrNone(r);
-			}
-		#endif
-		if (iXferMode == EReceiveOnly)
-			{
-			// read data and process any available
-			iReadSize = ReadData();
-			if (iReadSize != 0)
-				{
-				ProcessReadXfer();
-				}
-			}
-		else
-			{
-			SendData();										// or we send data
-			if (iXferMode == ETransmitOnly)
-				{
-				iPktNum++;
-				iRepeat++;
-				}
-			}
-		}
-	}
-
-void CActiveRW::RunL()
-	{
-	#ifdef USB_SC
-	TInt r = 0;
-	#else
-	TInt altSetting;
-	#endif
-
-	TUSB_VERBOSE_PRINT("CActiveRW::RunL()");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVERW_RUNL, "CActiveRW::RunL()");
-	    }
-
-	if ((iStatus != KErrNone) && (iStatus != KErrEof))
-		{
-		TUSB_PRINT1("Error %d in RunL", iStatus.Int());
-		OstTrace1(TRACE_NORMAL, CACTIVERW_RUNL_DUP01, "Error %d in RunL", iStatus.Int());
-		}
-	if (iDoStop)
-		{
-		TUSB_PRINT("Stopped");
-		OstTrace0(TRACE_NORMAL, CACTIVERW_RUNL_DUP02, "Stopped");
-		iDoStop = EFalse;
-		return;
-		}
-	switch (iCurrentXfer)
-		{
-	case EWaitSetting:
-		#ifdef USB_SC
-		if ((TENDPOINTNUMBER)iTestParams.outPipe <= KMaxEndpointsPerClient)
-			{
-			r = iSCReadBuf.Close();
-			test_KErrNone(r);
-			}
-		if ((TENDPOINTNUMBER)iTestParams.inPipe <= KMaxEndpointsPerClient)
-			{
-			r = iSCWriteBuf.Close();
-			test_KErrNone(r);
-			}
-		#endif
-		if (iTestParams.settingRepeat  && ((iRepeat < iTestParams.repeat) || !iLastSetting))
-			{
-			gRW[iTestParams.afterIndex]->Resume();
-			}
-		Suspend(ESuspend);
-		break;
-
-	case ESuspend:
-		#ifdef USB_SC
-		TUSB_VERBOSE_PRINT3("Index %d Resumed interface %d setting test=%d",iIndex,iTestParams.interfaceNumber,iTestParams.alternateSetting);
-		if(gVerbose)
-		    {
-		    OstTraceExt3(TRACE_VERBOSE, CACTIVERW_RUNL_DUP03, "Index %d Resumed interface %d setting test=%d",iIndex,iTestParams.interfaceNumber,iTestParams.alternateSetting);
-		    }
-		if (iTestParams.alternateSetting != gSettingNumber[iTestParams.interfaceNumber])
-			{
-			r = iPort->StartNextOutAlternateSetting(ETrue);
-			TUSB_VERBOSE_PRINT1("StartNextOutAlternateSetting retValue %d",r);
-			if(gVerbose)
-			    {
-			    OstTrace1(TRACE_VERBOSE, CACTIVERW_RUNL_DUP04, "StartNextOutAlternateSetting retValue %d",r);
-			    }
-			test_Value(r, (r >= KErrNone) || (r == KErrNotReady)  || (r == KErrGeneral));
-			if (r != KErrNotReady)
-				{
-				gSettingNumber[iTestParams.interfaceNumber] = r;
-				}
-			if (iTestParams.alternateSetting != gSettingNumber[iTestParams.interfaceNumber])
-				{
-				Suspend(EAltSetting);
-				break;
-				}
-			}
-		#else
-		iPort->GetAlternateSetting (altSetting);
-		TUSB_VERBOSE_PRINT4("Index %d Resumed interface %d setting test=%d actual=%d",iIndex,iTestParams.interfaceNumber,iTestParams.alternateSetting,altSetting);
-		if(gVerbose)
-		    {
-		    OstTraceExt4(TRACE_VERBOSE, CACTIVERW_RUNL_DUP05, "Index %d Resumed interface %d setting test=%d actual=%d",iIndex,iTestParams.interfaceNumber,iTestParams.alternateSetting,altSetting);
-		    }
-		if (gAltSettingOnNotify)
-			{
-			if (iTestParams.alternateSetting != altSetting)
-				{
-				Suspend(EAltSetting);
-				break;
-				}
-			}
-		#endif
-
-		// If alternate setting is ok drops through to EAltSetting to start next read or write
-		iCurrentXfer = EAltSetting;
-
-	case EAltSetting:
-		#ifdef USB_SC
-		if (iTestParams.alternateSetting != gSettingNumber[iTestParams.interfaceNumber])
-			{
-			r = iPort->StartNextOutAlternateSetting(ETrue);
-			TUSB_VERBOSE_PRINT1("StartNextOutAlternateSetting retValue %d",r);
-			if(gVerbose)
-			    {
-			    OstTrace1(TRACE_VERBOSE, CACTIVERW_RUNL_DUP06, "StartNextOutAlternateSetting retValue %d",r);
-			    }
-			test_Value(r, (r >= KErrNone) || (r == KErrNotReady)   || (r == KErrGeneral));
-			if (r != KErrNotReady)
-				{
-				gSettingNumber[iTestParams.interfaceNumber] = r;
-				}
-			if (iTestParams.alternateSetting != gSettingNumber[iTestParams.interfaceNumber])
-				{
-				Suspend(EAltSetting);
-				break;
-				}
-			}
-		TUSB_VERBOSE_PRINT4 ("CActiveRW::Runl() EAltSetting interface %d setting %d Out %d In %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe,iTestParams.inPipe);
-		if(gVerbose)
-		    {
-		    OstTraceExt4 (TRACE_VERBOSE, CACTIVERW_RUNL_DUP07, "CActiveRW::Runl() EAltSetting interface %d setting %d Out %d In %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe,iTestParams.inPipe);
-		    }
 		if ((TENDPOINTNUMBER)iTestParams.outPipe <= KMaxEndpointsPerClient)
 			{
 			r = iPort->OpenEndpoint(iSCReadBuf,iTestParams.outPipe);
@@ -510,8 +291,134 @@
 			SendData();										// or we send data
 			if (iXferMode == ETransmitOnly)
 				{
-				iPktNum++;
-				iRepeat++;
+				iPktNum++;				
+				iRepeat++;		
+				}
+			}	
+		}
+	}
+
+void CActiveRW::RunL()
+	{
+	#ifdef USB_SC
+	TInt r = 0;
+	#else
+	TInt altSetting;	
+	#endif
+	
+	TUSB_VERBOSE_PRINT("CActiveRW::RunL()");
+
+	if ((iStatus != KErrNone) && (iStatus != KErrEof))
+		{
+		TUSB_PRINT1("Error %d in RunL", iStatus.Int());
+		}
+	if (iDoStop)
+		{
+		TUSB_PRINT("Stopped");
+		iDoStop = EFalse;
+		return;
+		}
+	switch (iCurrentXfer)
+		{
+	case EWaitSetting:
+		#ifdef USB_SC
+		if ((TENDPOINTNUMBER)iTestParams.outPipe <= KMaxEndpointsPerClient)
+			{
+			r = iSCReadBuf.Close();
+			test_KErrNone(r);
+			}
+		if ((TENDPOINTNUMBER)iTestParams.inPipe <= KMaxEndpointsPerClient)
+			{
+			r = iSCWriteBuf.Close();
+			test_KErrNone(r);
+			}
+		#endif
+		if (iTestParams.settingRepeat  && ((iRepeat < iTestParams.repeat) || !iLastSetting))
+			{
+			gRW[iTestParams.afterIndex]->Resume();			
+			}
+		Suspend(ESuspend);	
+		break;
+			
+	case ESuspend:
+		#ifdef USB_SC
+		TUSB_VERBOSE_PRINT3("Index %d Resumed interface %d setting test=%d",iIndex,iTestParams.interfaceNumber,iTestParams.alternateSetting);	
+		if (iTestParams.alternateSetting != gSettingNumber[iTestParams.interfaceNumber])
+			{
+			r = iPort->StartNextOutAlternateSetting(ETrue);
+			TUSB_VERBOSE_PRINT1("StartNextOutAlternateSetting retValue %d",r);
+			test_Value(r, (r >= KErrNone) || (r == KErrNotReady)  || (r == KErrGeneral));
+			if (r != KErrNotReady)
+				{
+				gSettingNumber[iTestParams.interfaceNumber] = r;
+				}
+			if (iTestParams.alternateSetting != gSettingNumber[iTestParams.interfaceNumber])
+				{
+				Suspend(EAltSetting);
+				break;
+				}
+			}
+		#else
+		iPort->GetAlternateSetting (altSetting);
+		TUSB_VERBOSE_PRINT4("Index %d Resumed interface %d setting test=%d actual=%d",iIndex,iTestParams.interfaceNumber,iTestParams.alternateSetting,altSetting);	
+		if (gAltSettingOnNotify)
+			{
+			if (iTestParams.alternateSetting != altSetting)
+				{
+				Suspend(EAltSetting);
+				break;
+				}
+			}
+		#endif
+			
+		// If alternate setting is ok drops through to EAltSetting to start next read or write
+		iCurrentXfer = EAltSetting;
+			
+	case EAltSetting:
+		#ifdef USB_SC
+		if (iTestParams.alternateSetting != gSettingNumber[iTestParams.interfaceNumber])
+			{
+			r = iPort->StartNextOutAlternateSetting(ETrue);
+			TUSB_VERBOSE_PRINT1("StartNextOutAlternateSetting retValue %d",r);
+			test_Value(r, (r >= KErrNone) || (r == KErrNotReady)   || (r == KErrGeneral));
+			if (r != KErrNotReady)
+				{
+				gSettingNumber[iTestParams.interfaceNumber] = r;
+				}
+			if (iTestParams.alternateSetting != gSettingNumber[iTestParams.interfaceNumber])
+				{
+				Suspend(EAltSetting);
+				break;
+				}
+			}
+		TUSB_VERBOSE_PRINT4 ("CActiveRW::Runl() EAltSetting interface %d setting %d Out %d In %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe,iTestParams.inPipe);
+		if ((TENDPOINTNUMBER)iTestParams.outPipe <= KMaxEndpointsPerClient)
+			{
+			r = iPort->OpenEndpoint(iSCReadBuf,iTestParams.outPipe);
+			test_KErrNone(r);
+			}
+		if ((TENDPOINTNUMBER)iTestParams.inPipe <= KMaxEndpointsPerClient)
+			{
+			r = iPort->OpenEndpoint(iSCWriteBuf,iTestParams.inPipe);
+			test_KErrNone(r);
+			}
+		#endif
+		if (iXferMode == EReceiveOnly)
+			{
+			// read data and process any available
+			iReadSize = ReadData();
+			if (iReadSize != 0)
+				{
+				ProcessReadXfer();
+				}		
+			}
+		else
+			{
+			SendData();										// or we send data
+			if (iXferMode == ETransmitOnly)
+				{
+				iPktNum++;				
+				iRepeat++;		
 				}
 			}
 		break;
@@ -519,7 +426,7 @@
 	case EWriteXfer:
 		ProcessWriteXfer();
 		break;
-
+		
 	case EReadXfer:
 		#ifdef USB_SC
 		iReadSize = ReadData();
@@ -532,10 +439,9 @@
 		ProcessReadXfer();
 		#endif
 		break;
-
+		
 	default:
 		TUSB_PRINT("Oops. (Shouldn't end up here...)");
-		OstTrace0(TRACE_NORMAL, CACTIVERW_RUNL_DUP08, "Oops. (Shouldn't end up here...)");
 		break;
 		}
 	return;
@@ -546,7 +452,7 @@
 	if (iXferMode == ETransmitOnly)
 		{
 		if (iTestParams.settingRepeat && iRepeat)
-			{
+			{	
 			if (((iRepeat % iTestParams.settingRepeat) == 0) || (iRepeat >= iTestParams.repeat))
 				{
 				if ((iRepeat < iTestParams.repeat) || !iLastSetting)
@@ -557,12 +463,12 @@
 						test_KErrNone(iSCWriteBuf.Close());
 						}
 					#endif
-					gRW[iTestParams.afterIndex]->Resume();
+					gRW[iTestParams.afterIndex]->Resume();			
 					}
 				if (iRepeat < iTestParams.repeat)
 					{
-					Suspend(ESuspend);
-					return;
+					Suspend(ESuspend);	
+					return;					
 					}
 				}
 			}
@@ -577,8 +483,8 @@
 					Yield();
 					}
 				}
-			SendData();							// next we send data
-			iPktNum++;
+			SendData();							// next we send data			
+			iPktNum++;				
 			iRepeat++;
 			}
 		else
@@ -604,7 +510,6 @@
 	if ((iReadOffset + iReadSize) > iBufSz)
 		{
 		TUSB_PRINT2("*** rcv'd too much data: 0x%x (expected: 0x%x)", iReadOffset + iReadSize, iBufSz);
-		OstTraceExt2(TRACE_NORMAL, CACTIVERW_PROCESSREADXFER, "*** rcv'd too much data: 0x%x (expected: 0x%x)", iReadOffset + iReadSize, iBufSz);
 		test(EFalse);
 		}
 
@@ -616,11 +521,10 @@
 			const TUint32 num = *reinterpret_cast<const TUint32*>(iSCReadData);
 			#else
 			const TUint32 num = *reinterpret_cast<const TUint32*>(iReadBuf.Ptr());
-			#endif
+			#endif	
 			if (num != iPktNum)
 				{
 				TUSB_PRINT3("*** Repeat %d rcv'd wrong pkt number: 0x%x (expected: 0x%x)", iRepeat, num, iPktNum);
-				OstTraceExt3(TRACE_NORMAL, CACTIVERW_PROCESSREADXFER_DUP01, "*** Repeat %d rcv'd wrong pkt number: 0x%x (expected: 0x%x)", (TInt32)iRepeat, (TInt32)num, (TInt32)iPktNum);
 				iPktNum = num;
 				test(EFalse);
 				}
@@ -631,19 +535,15 @@
 			#ifdef USB_SC
 			TPtr8 readBuf((TUint8 *)iSCReadData,iReadSize,iReadSize);
 			WriteBufferToDisk(readBuf, iReadSize);
-			#else
+			#else	
 			TUSB_VERBOSE_PRINT2("Max Buffer Size = %d (iReadBuf.Size(): %d)", iTestParams.maxSize, iReadBuf.Size());
-			if(gVerbose)
-			    {
-			    OstTraceExt2(TRACE_VERBOSE, CACTIVERW_PROCESSREADXFER_DUP02, "Max Buffer Size = %u (iReadBuf.Size(): %d)", (TUint32)iTestParams.maxSize, (TUint32)iReadBuf.Size());
-			    }
 			WriteBufferToDisk(iReadBuf, iTestParams.maxSize);
 			#endif
-			}
+			}		
 		iReadOffset += iReadSize;
 		if (iReadOffset >= iBufSz)
 			{
-			iReadOffset = 0;
+			iReadOffset = 0;			
 			}
 		else
 			{
@@ -660,7 +560,7 @@
 		iRepeat++;
 		iReadSize = 0;
 		if (iTestParams.settingRepeat)
-			{
+			{	
 			if (((iRepeat % iTestParams.settingRepeat) == 0) || (iRepeat >= iTestParams.repeat))
 				{
 				#ifdef USB_SC
@@ -671,12 +571,12 @@
 				#endif
 				if ((iRepeat < iTestParams.repeat) || !iLastSetting)
 					{
-					gRW[iTestParams.afterIndex]->Resume();
+					gRW[iTestParams.afterIndex]->Resume();			
 					}
 				if (iRepeat < iTestParams.repeat)
 					{
-					Suspend(ESuspend);
-					return;
+					Suspend(ESuspend);	
+					return;					
 					}
 				}
 			}
@@ -696,9 +596,9 @@
 			if (!IsActive())
 				{
 				SetActive();
-				}
+				}	
 			#else
-			iReadSize = ReadData();
+			iReadSize = ReadData();			
 			#endif
 			}
 		else
@@ -724,14 +624,13 @@
 				if (num != iPktNum)
 					{
 					TUSB_PRINT2("*** rcv'd wrong pkt number: 0x%x (expected: 0x%x)", num, iPktNum);
-					OstTraceExt2(TRACE_NORMAL, CACTIVERW_PROCESSREADXFER_DUP03, "*** rcv'd wrong pkt number: 0x%x (expected: 0x%x)", num, iPktNum);
 					}
 				}
 			}
 		iReadOffset += iReadSize;
 		if (iReadOffset >= iBufSz)
 			{
-			iReadOffset = 0;
+			iReadOffset = 0;			
 			}
 		else
 			{
@@ -754,13 +653,13 @@
 		iRepeat++;
 		iReadSize = 0;
 		if (iTestParams.settingRepeat)
-			{
+			{	
 			if (((iRepeat % iTestParams.settingRepeat) == 0) || (iRepeat >= iTestParams.repeat))
 				{
 				if (iRepeat < iTestParams.repeat)
 					{
 					SendWaitSetting();
-					return;
+					return;					
 					}
 				else
 					{
@@ -773,15 +672,15 @@
 						{
 						test_KErrNone(iSCWriteBuf.Close());
 						}
-					#endif
+					#endif	
 					if (!iLastSetting)
 						{
-						gRW[iTestParams.afterIndex]->Resume();
+						gRW[iTestParams.afterIndex]->Resume();			
 						}
 					}
 				}
 			}
-
+			
 		if ((iTestParams.repeat == 0) || (iRepeat < iTestParams.repeat))
 			{
 			// Yield the scheduler to ensure other activeObjects can run
@@ -792,12 +691,12 @@
 					Yield();
 					}
 				}
-			SendData();
+			SendData();				
 			}
 		else
 			{
 			TestComplete(ETrue);
-			}
+			}	
 		}
 
 	return;
@@ -822,7 +721,7 @@
 		}
 	}
 
-
+	
 void CActiveRW::SendData()
 	{
 	__ASSERT_ALWAYS(!IsActive(), User::Panic(KActivePanic, 663));
@@ -837,7 +736,7 @@
 		}
 	if (iBufSz > 3)
 		*reinterpret_cast<TUint32*>(inBuffer) = iPktNum;
-
+	
 	if (iXferMode == ELoopComp)
 		{
 		for (TUint i = 4; i < iBufSz; i++)
@@ -846,10 +745,6 @@
 			}
 		}
 	TUSB_VERBOSE_PRINT3("SendData interface %d setting %d endpoint %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.inPipe);
-	if(gVerbose)
-	    {
-	    OstTraceExt3(TRACE_VERBOSE, CACTIVERW_SENDDATA, "SendData interface %d setting %d endpoint %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.inPipe);
-	    }
 	iCurrentXfer = EWriteXfer;
 	TInt r = iSCWriteBuf.WriteBuffer(inBuffer, iBufSz, FALSE, iStatus);
 	test_KErrNone(r);
@@ -870,10 +765,6 @@
 		}
 
 	TUSB_VERBOSE_PRINT3("SendData interface %d setting %d endpoint %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.inPipe);
-	if(gVerbose)
-	    {
-	    OstTraceExt3(TRACE_VERBOSE, CACTIVERW_SENDDATA_DUP01, "SendData interface %d setting %d endpoint %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.inPipe);
-	    }
 	iCurrentXfer = EWriteXfer;
 	iPort->Write(iStatus, (TENDPOINTNUMBER)iTestParams.inPipe, iWriteBuf, iBufSz);
 	#endif
@@ -891,7 +782,6 @@
 	iFileName.Format(_L("%c:"), aDriveLetter.operator TUint());
 	iFileName.Append(KFileName);
 	TUSB_PRINT1("\nFilename = %S", &iFileName);
-	OstTraceExt1(TRACE_NORMAL, CACTIVERW_WRITETODISK, "\nFilename = %S", iFileName);
 
 	// open the record file
 	r = iFile.Replace(iFs, iFileName, EFileWrite);
@@ -899,11 +789,10 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("RFile::Replace() returned %d", r);
-		OstTrace1(TRACE_ERROR, CACTIVERW_WRITETODISK_DUP01, "RFile::Replace() returned %d", r);
 		iDiskAccessEnabled = EFalse;
 		return r;
 		}
-
+		
 	return r;
 	}
 
@@ -916,16 +805,13 @@
 	iFileName.Format(_L("%c:"), aDriveLetter.operator TUint());
 	iFileName.Append(KFileName);
 	TUSB_PRINT1("\nFilename = %S", &iFileName);
-	OstTraceExt1(TRACE_NORMAL, CACTIVERW_READFROMDISK, "\nFilename = %S", iFileName);
 	TUSB_PRINT1("File size: %d", aMaxFileSize);
-	OstTrace1(TRACE_NORMAL, CACTIVERW_READFROMDISK_DUP01, "File size: %d", aMaxFileSize);
 
 	// First create the file & fill it
 	r = iFile.Replace(iFs, iFileName, EFileWrite);
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("RFile::Replace() returned %d", r);
-		OstTrace1(TRACE_ERROR, CACTIVERW_READFROMDISK_DUP02, "RFile::Replace() returned %d", r);
 		iDiskAccessEnabled = EFalse;
 		return r;
 		}
@@ -937,28 +823,24 @@
 		buffer[n] = static_cast<TUint8>(n & 0x000000ff);
 		}
 	TUSB_PRINT("Writing data to file (this may take some minutes...)");
-	OstTrace0(TRACE_NORMAL, CACTIVERW_READFROMDISK_DUP03, "Writing data to file (this may take some minutes...)");
 	for (TInt n = 0; n < aMaxFileSize; n += KBufferSize)
 		{
 		r = iFile.Write(buffer, KBufferSize);
 		if (r != KErrNone)
 			{
 			TUSB_PRINT1("RFile::Write() returned %d (disk full?)", r);
-			OstTrace1(TRACE_ERROR, CACTIVERW_READFROMDISK_DUP04, "RFile::Write() returned %d (disk full?)", r);
 			iFile.Close();
 			iDiskAccessEnabled = EFalse;
 			return r;
 			}
 		}
 	TUSB_PRINT("Done.");
-	OstTrace0(TRACE_NORMAL, CACTIVERW_READFROMDISK_DUP05, "Done.");
 	iFile.Close();
 	// Now open the file for reading
 	r = iFile.Open(iFs, iFileName, EFileRead);
 	if (r != KErrNone)
 		{
 		TUSB_PRINT1("RFile::Open() returned %d", r);
-		OstTrace1(TRACE_ERROR, CACTIVERW_READFROMDISK_DUP06, "RFile::Open() returned %d", r);
 		iDiskAccessEnabled = EFalse;
 		return r;
 		}
@@ -971,15 +853,10 @@
 void CActiveRW::WriteBufferToDisk(TDes8& aBuffer, TInt aLen)
 	{
 	TUSB_VERBOSE_PRINT1("CActiveRW::WriteBufferToDisk(), len = %d", aLen);
-	if(gVerbose)
-	    {
-	    OstTrace1(TRACE_VERBOSE, CACTIVERW_WRITEBUFFERTODISK, "CActiveRW::WriteBufferToDisk(), len = %d", aLen);
-	    }
 	TInt r = iFile.Write(aBuffer, aLen);
 	if (r != KErrNone)
 		{
 		TUSB_PRINT2("Error writing to %S (%d)", &iFileName, r);
-		OstTraceExt2(TRACE_ERROR, CACTIVERW_WRITEBUFFERTODISK_DUP01, "Error writing to %S (%d)", iFileName, r);
 		iDiskAccessEnabled = EFalse;
 		return;
 		}
@@ -993,22 +870,15 @@
 	if (r != KErrNone)
 		{
 		TUSB_PRINT2("Error reading from %S (%d)", &iFileName, r);
-		OstTraceExt2(TRACE_ERROR, CACTIVERW_READBUFFERFROMDISK, "Error reading from %S (%d)", iFileName, r);
 		iDiskAccessEnabled = EFalse;
 		return;
 		}
 	TInt readLen = aBuffer.Length();
 	TUSB_VERBOSE_PRINT1("CActiveRW::ReadBufferFromDisk(), len = %d\n", readLen);
-	if(gVerbose)
-	    {
-	    OstTrace1(TRACE_VERBOSE, CACTIVERW_READBUFFERFROMDISK_DUP01, "CActiveRW::ReadBufferFromDisk(), len = %d\n", readLen);
-	    }
 	if (readLen < aLen)
 		{
 		TUSB_PRINT3("Only %d bytes of %d read from file %S)",
 					readLen, aLen, &iFileName);
-		OstTraceExt3(TRACE_NORMAL, CACTIVERW_READBUFFERFROMDISK_DUP02, "Only %d bytes of %d read from file %S)",
-					readLen, aLen, iFileName);
 		iDiskAccessEnabled = EFalse;
 		return;
 		}
@@ -1021,17 +891,13 @@
 	__ASSERT_ALWAYS(!IsActive(), User::Panic(KActivePanic, 664));
 	iCurrentXfer = EReadXfer;
 	#ifdef	USB_SC
-	TUint readSize = 0;			// note that this returns zero when asynchronous read is pending
+	TUint readSize = 0;			// note that this returns zero when asynchronous read is pending 
 	TInt r = 0;
 	do
 		{
 		r = iSCReadBuf.GetBuffer (iSCReadData,readSize,iReadZlp,iStatus);
 		test_Value(r, (r == KErrNone) || (r == KErrCompletion) || (r == KErrEof));
-		TUSB_VERBOSE_PRINT4("Get Buffer Return code %d Status %d DataPtr 0x%x Size %d", r, iStatus.Int(),iSCReadData,readSize);
-		if(gVerbose)
-		    {
-		    OstTraceExt4(TRACE_VERBOSE, CACTIVERW_READDATA, "Get Buffer Return code %d Status %d DataPtr 0x%x Size %d", r, iStatus.Int(),(TInt)iSCReadData,readSize);
-		    }
+		TUSB_VERBOSE_PRINT4("Get Buffer Return code %d Status %d DataPtr 0x%x Size %d", r, iStatus.Int(),iSCReadData,readSize);	
 		}
 	while ((r == KErrCompletion && readSize == 0) || (r == KErrEof));
 	if (r == KErrCompletion)
@@ -1052,20 +918,12 @@
 		{
 		// Testing the packet version of Read()
 		TUSB_VERBOSE_PRINT3("ReadData (single packet) interface %d setting %d endpoint %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe);
-		if(gVerbose)
-		    {
-		    OstTraceExt3(TRACE_VERBOSE, CACTIVERW_READDATA_DUP01, "ReadData (single packet) interface %d setting %d endpoint %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe);
-		    }
 		iPort->ReadPacket(iStatus, (TENDPOINTNUMBER)iTestParams.outPipe, iReadBuf, iBufSz);
 		}
 	else if ((TUint)iBufSz == iTestParams.maxSize)
 		{
 		// Testing the two-parameter version
 		TUSB_VERBOSE_PRINT3("ReadData (w/o length) interface %d setting %d endpoint %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe);
-		if(gVerbose)
-		    {
-		    OstTraceExt3(TRACE_VERBOSE, CACTIVERW_READDATA_DUP02, "ReadData (w/o length) interface %d setting %d endpoint %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe);
-		    }
 		iPort->Read(iStatus, (TENDPOINTNUMBER)iTestParams.outPipe, iReadBuf);
 		}
 	else
@@ -1073,10 +931,6 @@
 		// otherwise, we use the universal default version
 		// Testing the three-parameter version
 		TUSB_VERBOSE_PRINT3("ReadData (normal) interface %d setting %d endpoint %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe);
-		if(gVerbose)
-		    {
-		    OstTraceExt3(TRACE_VERBOSE, CACTIVERW_READDATA_DUP03, "ReadData (normal) interface %d setting %d endpoint %d",iTestParams.interfaceNumber,iTestParams.alternateSetting,iTestParams.outPipe);
-		    }
 		iPort->Read(iStatus, (TENDPOINTNUMBER)iTestParams.outPipe, iReadBuf, iBufSz);
 		}
 	if (!IsActive())
@@ -1093,11 +947,9 @@
 	if (!IsActive())
 		{
 		TUSB_PRINT("CActiveRW::Stop(): Not active");
-		OstTrace0(TRACE_NORMAL, CACTIVERW_STOP, "CActiveRW::Stop(): Not active");
 		return;
 		}
 	TUSB_PRINT("Cancelling outstanding transfer requests\n");
-	OstTrace0(TRACE_NORMAL, CACTIVERW_STOP_DUP01, "Cancelling outstanding transfer requests\n");
 	iBufSz = 0;
 	iPktNum = 0;
 	iDoStop = ETrue;
@@ -1109,26 +961,18 @@
 void CActiveRW::DoCancel()
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::DoCancel()");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVERW_DOCANCEL, "CActiveRW::DoCancel()");
-	    }
 	// Canceling the transfer requests can be done explicitly
 	// for every transfer...
 	iPort->WriteCancel((TENDPOINTNUMBER)iTestParams.inPipe);
 	iPort->ReadCancel((TENDPOINTNUMBER)iTestParams.outPipe);
 	// or like this:
-	// iPort->EndpointTransferCancel(~0);
+	// iPort->EndpointTransferCancel(~0);	
 	}
 
 
 TBool CActiveRW::CompareBuffers()
 	{
 	TUSB_VERBOSE_PRINT2("CActiveRW::CompareBuffers() ReadOffset %d ReadSize %d",iReadOffset,iReadSize);
-	if(gVerbose)
-	    {
-	    OstTraceExt2(TRACE_VERBOSE, CACTIVERW_COMPAREBUFFERS, "CActiveRW::CompareBuffers() ReadOffset %d ReadSize %d",iReadOffset,iReadSize);
-	    }
 	#ifdef USB_SC
 	TUint8 *readPtr = reinterpret_cast<TUint8*>(iSCReadData);
 	TUint8* writePtr;
@@ -1141,10 +985,8 @@
 		#ifdef USB_SC
 		if (*readPtr != *writePtr)
 			{
-			TUSB_PRINT3 ("*** Error while comparing tx & rx buffers packet 0x%x length %d index %d",iPktNum, iReadSize,i + iReadOffset);
-			OstTraceExt3 (TRACE_NORMAL, CACTIVERW_COMPAREBUFFERS_DUP01, "*** Error while comparing tx & rx buffers packet 0x%x length %u index %u",iPktNum, (TUint32)iReadSize,(TUint32)(i + iReadOffset));
-			TUSB_PRINT2 ("*** Read byte 0x%x Write byte 0x%x",*readPtr,*writePtr);
-			OstTraceExt2 (TRACE_NORMAL, CACTIVERW_COMPAREBUFFERS_DUP02, "*** Read byte 0x%x Write byte 0x%x",*readPtr,*writePtr);
+			TUSB_PRINT3 ("*** Error while comparing tx & rx buffers packet 0x%x length %d index %d",iPktNum, iReadSize,i + iReadOffset); 
+			TUSB_PRINT2 ("*** Read byte 0x%x Write byte 0x%x",*readPtr,*writePtr); 
 			return EFalse;
 			}
 		readPtr++;
@@ -1152,26 +994,17 @@
 		#else
 		if (iReadBuf[i] != iWriteBuf[i + iReadOffset])
 			{
-			TUSB_PRINT3 ("*** Error while comparing tx & rx buffers packet 0x%x length %d index %d",iPktNum, iReadSize,i + iReadOffset);
-			OstTraceExt3 (TRACE_NORMAL, CACTIVERW_COMPAREBUFFERS_DUP03, "*** Error while comparing tx & rx buffers packet 0x%x length %u index %u",(TUint32)iPktNum, (TUint32)iReadSize,(TUint32)(i + iReadOffset));
+			TUSB_PRINT3 ("*** Error while comparing tx & rx buffers packet 0x%x length %d index %d",iPktNum, iReadSize,i + iReadOffset); 
 			TUSB_PRINT5 ("WriteBuf Start 0x%x 0x%x 0x%x 0x%x 0x%x",
-				iWriteBuf[i], iWriteBuf[i+1], iWriteBuf[i+2], iWriteBuf[i+3], iWriteBuf[i+4]);
-			OstTraceExt5 (TRACE_NORMAL, CACTIVERW_COMPAREBUFFERS_DUP04, "WriteBuf Start 0x%x 0x%x 0x%x 0x%x 0x%x",
-				iWriteBuf[i], iWriteBuf[i+1], iWriteBuf[i+2], iWriteBuf[i+3], iWriteBuf[i+4]);
+				iWriteBuf[i], iWriteBuf[i+1], iWriteBuf[i+2], iWriteBuf[i+3], iWriteBuf[i+4]); 
 			TUSB_PRINT5 ("ReadBuf Start 0x%x 0x%x 0x%x 0x%x 0x%x",
 				iReadBuf[i], iReadBuf[i+1], iReadBuf[i+2], iReadBuf[i+3], iReadBuf[i+4]);
-			OstTraceExt5 (TRACE_NORMAL, CACTIVERW_COMPAREBUFFERS_DUP05, "ReadBuf Start 0x%x 0x%x 0x%x 0x%x 0x%x",
-				iReadBuf[i], iReadBuf[i+1], iReadBuf[i+2], iReadBuf[i+3], iReadBuf[i+4]);
 			if (iReadSize >= 10)
 				{
 				TUSB_PRINT5 ("WriteBuf End 0x%x 0x%x 0x%x 0x%x 0x%x",
-					iWriteBuf[iReadSize-5], iWriteBuf[iReadSize-4], iWriteBuf[iReadSize-3], iWriteBuf[iReadSize-2], iWriteBuf[iReadSize-1]);
-				OstTraceExt5 (TRACE_NORMAL, CACTIVERW_COMPAREBUFFERS_DUP06, "WriteBuf End 0x%x 0x%x 0x%x 0x%x 0x%x",
-					iWriteBuf[iReadSize-5], iWriteBuf[iReadSize-4], iWriteBuf[iReadSize-3], iWriteBuf[iReadSize-2], iWriteBuf[iReadSize-1]);
+					iWriteBuf[iReadSize-5], iWriteBuf[iReadSize-4], iWriteBuf[iReadSize-3], iWriteBuf[iReadSize-2], iWriteBuf[iReadSize-1]); 
 				TUSB_PRINT5 ("ReadBuf End 0x%x 0x%x 0x%x 0x%x 0x%x",
-					iReadBuf[iReadSize-5], iReadBuf[iReadSize-4], iReadBuf[iReadSize-3], iReadBuf[iReadSize-2], iReadBuf[iReadSize-1]);
-				OstTraceExt5 (TRACE_NORMAL, CACTIVERW_COMPAREBUFFERS_DUP07, "ReadBuf End 0x%x 0x%x 0x%x 0x%x 0x%x",
-					iReadBuf[iReadSize-5], iReadBuf[iReadSize-4], iReadBuf[iReadSize-3], iReadBuf[iReadSize-2], iReadBuf[iReadSize-1]);
+					iReadBuf[iReadSize-5], iReadBuf[iReadSize-4], iReadBuf[iReadSize-3], iReadBuf[iReadSize-2], iReadBuf[iReadSize-1]); 
 				}
 			return EFalse;
 			}
@@ -1183,13 +1016,9 @@
 void CActiveRW::TestComplete(TBool aResult)
 	{
 	TUSB_VERBOSE_PRINT("CActiveRW::TestComplete()");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVERW_TESTCOMPLETE, "CActiveRW::TestComplete()");
-	    }
 
 	iResult = aResult;
-
+	
 	if (iComplete || !iResult || iTestParams.repeat == 0)
 		{
 		test(iResult);
--- a/kerneltest/e32test/usb/t_usb_device/src/activestallnotifier.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/activestallnotifier.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -18,10 +18,6 @@
 //
 
 #include "general.h"									// CActiveControl, CActiveRW
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "activestallnotifierTraces.h"
-#endif
 #include "activestallnotifier.h"
 
 extern RTest test;
@@ -60,10 +56,6 @@
 CActiveStallNotifier::~CActiveStallNotifier()
 	{
 	TUSB_VERBOSE_PRINT("CActiveStallNotifier::~CActiveStallNotifier()");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVESTALLNOTIFIER_DCACTIVESTALLNOTIFIER, "CActiveStallNotifier::~CActiveStallNotifier()");
-	    }
 	Cancel();												// base class
 	}
 
@@ -71,10 +63,6 @@
 void CActiveStallNotifier::DoCancel()
 	{
 	TUSB_VERBOSE_PRINT("CActiveStallNotifier::DoCancel()");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVESTALLNOTIFIER_DOCANCEL, "CActiveStallNotifier::DoCancel()");
-	    }
 	iPort->EndpointStatusNotifyCancel();
 	}
 
@@ -85,10 +73,6 @@
 	// In a real world program, the user could take here appropriate action (cancel a
 	// transfer request or whatever).
 	TUSB_VERBOSE_PRINT1("StallNotifier: Endpointstate 0x%x\n", iEndpointState);
-	if(gVerbose)
-	    {
-	    OstTrace1(TRACE_VERBOSE, CACTIVESTALLNOTIFIER_RUNL, "StallNotifier: Endpointstate 0x%x\n", iEndpointState);
-	    }
 	Activate();
 	}
 
--- a/kerneltest/e32test/usb/t_usb_device/src/activetimer.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/activetimer.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -18,10 +18,6 @@
 //
 
 #include "general.h"									// CActiveControl, CActiveRW
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "activetimerTraces.h"
-#endif
 #include "activetimer.h"
 
 extern RTest test;
@@ -62,10 +58,6 @@
 CActiveTimer::~CActiveTimer()
 	{
 	TUSB_VERBOSE_PRINT("CActiveTimer::~CActiveTimer()");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVETIMER_DCACTIVETIMER, "CActiveTimer::~CActiveTimer()");
-	    }
 	Cancel();												// base class
 	iTimer.Close();
 	}
@@ -74,10 +66,6 @@
 void CActiveTimer::DoCancel()
 	{
 	TUSB_VERBOSE_PRINT("CActiveTimer::DoCancel()");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVETIMER_DOCANCEL, "CActiveTimer::DoCancel()");
-	    }
 	iTimer.Cancel();
 	}
 
@@ -85,10 +73,6 @@
 void CActiveTimer::RunL()
 	{
 	TUSB_VERBOSE_PRINT("CActiveTimer::RunL()");
-	if(gVerbose)
-	    {
-	    OstTrace0(TRACE_VERBOSE, CACTIVETIMER_RUNL, "CActiveTimer::RunL()");
-	    }
 	// Nothing to do here, as we call ReadCancel() after a manual WaitForRequest()
 	// (in CActiveRW::ReceiveVersion()).
 	}
--- a/kerneltest/e32test/usb/t_usb_device/src/apitests.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/apitests.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -14,17 +14,12 @@
 // e32test/usb/t_usb_device/src/apitests.cpp
 // USB Test Program T_USB_DEVICE, functional part.
 // Device-side part, to work against T_USB_HOST running on the host.
-//
+// 
 //
 
 #include "general.h"									// CActiveControl, CActiveRW
 #include "config.h"
 #include "usblib.h"										// Helpers
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "apitestsTraces.h"
-#endif
-
 
 extern RTest test;
 extern TBool gVerbose;
@@ -70,14 +65,14 @@
 	deviceDescriptor[KUsbVendorIdOffset+1] = HiByte(aLddPtr->iVid);
 	// Change the device product ID (PID)
 	if (aPid != 0)
-		{
+		{	
 		deviceDescriptor[KUsbProductIdOffset]	= LoByte(aPid);		// little endian!
-		deviceDescriptor[KUsbProductIdOffset+1] = HiByte(aPid);
+		deviceDescriptor[KUsbProductIdOffset+1] = HiByte(aPid);		
 		}
 	else
 		{
 		deviceDescriptor[KUsbProductIdOffset]	= LoByte(aLddPtr->iPid);		// little endian!
-		deviceDescriptor[KUsbProductIdOffset+1] = HiByte(aLddPtr->iPid);
+		deviceDescriptor[KUsbProductIdOffset+1] = HiByte(aLddPtr->iPid);		
 		}
 	// Change the device release number
 	deviceDescriptor[KUsbDevReleaseOffset]	 = LoByte(aLddPtr->iRelease);	// little endian!
@@ -94,7 +89,7 @@
 
 		test.Next(_L("Compare device descriptor with value set"));
 		r = descriptor2.Compare(deviceDescriptor);
-		test_KErrNone(r);
+		test_KErrNone(r);	
 		}
 
 	// === Configuration Descriptor
@@ -115,7 +110,7 @@
 	const TUint8 KUsbAttributeDefault = 0x80;
 	const TUint8 KUsbAttributeSelfPower = 0x40;
 	const TUint8 KUsbAttributeRemoteWakeup = 0x20;
-	configDescriptor[KUsbAttributesOffset] = KUsbAttributeDefault | (aLddPtr->iSelfPower ? KUsbAttributeSelfPower : 0)
+	configDescriptor[KUsbAttributesOffset] = KUsbAttributeDefault | (aLddPtr->iSelfPower ? KUsbAttributeSelfPower : 0) 
 													| (aLddPtr->iRemoteWakeup ? KUsbAttributeRemoteWakeup : 0);
 	// Change the reported max power
 	// 100mA (= 2 * 0x32) is the highest value allowed for a bus-powered device.
@@ -135,7 +130,7 @@
 		r = descriptor2.Compare(configDescriptor);
 		test_KErrNone(r);
 		}
-
+		
 	// === String Descriptors
 
 	test.Next(_L("SetStringDescriptor"));
@@ -146,7 +141,7 @@
 		r = aPort->SetManufacturerStringDescriptor(* aLddPtr->iManufacturer);
 		test_KErrNone(r);
 		}
-
+		
 	if (aLddPtr->iProduct)
 		{
 		r = aPort->SetProductStringDescriptor(* aLddPtr->iProduct);
@@ -161,7 +156,7 @@
 
 	// Set up two arbitrary string descriptors, which can be queried
 	// manually from the host side for testing purposes
-
+	
 	TBuf16<KUsbStringDescStringMaxSize / 2> wr_str(KString_one);
 	r = aPort->SetStringDescriptor(stridx1, wr_str);
 	test_KErrNone(r);
@@ -172,7 +167,7 @@
 	test_KErrNone(r);
 
 	test.End();
-
+	
 	}
 
 static void TestDeviceQualifierDescriptor(RDEVCLIENT* aPort)
@@ -251,12 +246,12 @@
 	TBuf8<KUsbDescSize_Interface> descriptor2;
 	for (TInt i =0; i < aNumSettings; i++)
 		{
-
+		
 		test.Next(_L("GetInterfaceDescriptorSize()"));
 		r = aPort->GetInterfaceDescriptorSize(i, desc_size);
 		if (r != KErrNone)
 			{
-			OstTraceExt2(TRACE_NORMAL, TESTINTERFACEDESCRIPTOR_TESTINTERFACEDESCRIPTOR, "Error %d in GetInterfaceDescriptorSize %d\n",r,i);
+			RDebug::Printf ("Error %d in GetInterfaceDescriptorSize %d\n",r,i);
 			}
 		test_KErrNone(r);
 		test_Equal(KUsbDescSize_Interface,static_cast<TUint>(desc_size));
@@ -282,7 +277,7 @@
 		r = descriptor2.Compare(descriptor);
 		test_KErrNone(r);
 		}
-
+		
 	test.Next(_L("GetInterfaceDescriptor()"));
 	r = aPort->GetInterfaceDescriptor(aNumSettings, descriptor);
 	test_Equal(KErrNotFound,r);
@@ -290,7 +285,7 @@
 	test.Next(_L("SetInterfaceDescriptor()"));
 	r = aPort->SetInterfaceDescriptor(aNumSettings, descriptor);
 	test_Equal(KErrNotFound,r);
-
+		
 	test.End();
 	}
 
@@ -373,7 +368,7 @@
 		!(aEpInfo.iDir & KUsbEpDirIn) && !(epDescriptor[KEpDesc_AddressOffset] & 0x80)) &&
 			EpTypeMask2Value(aEpInfo.iType) == (TUint)(epDescriptor[KEpDesc_AttributesOffset] & 0x03) &&
 			aEpInfo.iInterval == epDescriptor[KEpDesc_IntervalOffset]);
-
+			
 	// Change the endpoint poll interval
 	TUint8 ival = 0x66;
 	if (epDescriptor[KEpDesc_IntervalOffset] == ival)
@@ -428,7 +423,6 @@
 	TInt r = aPort->GetStringDescriptorLangId(rd_langid_orig);
 	test_KErrNone(r);
 	test.Printf(_L("Original LANGID code: 0x%04X\n"), rd_langid_orig);
-	OstTrace1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS, "Original LANGID code: 0x%04X\n", rd_langid_orig);
 
 	test.Next(_L("SetStringDescriptorLangId()"));
 	TUint16 wr_langid = 0x0809;								// English (UK) Language ID
@@ -442,7 +436,6 @@
 	r = aPort->GetStringDescriptorLangId(rd_langid);
 	test_KErrNone(r);
 	test.Printf(_L("New LANGID code: 0x%04X\n"), rd_langid);
-	OstTrace1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP01, "New LANGID code: 0x%04X\n", rd_langid);
 
 	test.Next(_L("Compare LANGID codes"));
 	test_Equal(wr_langid,rd_langid);
@@ -466,13 +459,11 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Original Manufacturer string: \"%lS\"\n"), &rd_str_orig);
-		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP02, "Original Manufacturer string: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
 		{
 		test.Printf(_L("No Manufacturer string set\n"));
-		OstTrace0(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP03, "No Manufacturer string set\n");
 		restore_string = EFalse;
 		}
 
@@ -487,7 +478,6 @@
 	r = aPort->GetManufacturerStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Manufacturer string: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP04, "New Manufacturer string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Manufacturer strings"));
 	r = rd_str.Compare(wr_str);
@@ -505,7 +495,6 @@
 	r = aPort->GetManufacturerStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Manufacturer string: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP05, "New Manufacturer string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Manufacturer strings"));
 	r = rd_str.Compare(wr_str);
@@ -539,7 +528,6 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Old Product string: \"%lS\"\n"), &rd_str_orig);
-		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP06, "Old Product string: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
@@ -557,7 +545,6 @@
 	r = aPort->GetProductStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Product string: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP07, "New Product string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Product strings"));
 	r = rd_str.Compare(wr_str);
@@ -575,7 +562,6 @@
 	r = aPort->GetProductStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Product string: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP08, "New Product string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Product strings"));
 	r = rd_str.Compare(wr_str);
@@ -609,7 +595,6 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Old Serial Number: \"%lS\"\n"), &rd_str_orig);
-		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP09, "Old Serial Number: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
@@ -627,7 +612,6 @@
 	r = aPort->GetSerialNumberStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Serial Number: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP10, "New Serial Number: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Serial Number strings"));
 	r = rd_str.Compare(wr_str);
@@ -645,7 +629,6 @@
 	r = aPort->GetSerialNumberStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Serial Number: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP11, "New Serial Number: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Serial Number strings"));
 	r = rd_str.Compare(wr_str);
@@ -679,7 +662,6 @@
 	if (r == KErrNone)
 		{
 		test.Printf(_L("Old Configuration string: \"%lS\"\n"), &rd_str_orig);
-		OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP12, "Old Configuration string: \"%lS\"\n", rd_str_orig);
 		restore_string = ETrue;
 		}
 	else
@@ -697,7 +679,6 @@
 	r = aPort->GetConfigurationStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Configuration string: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP13, "New Configuration string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Configuration strings"));
 	r = rd_str.Compare(wr_str);
@@ -715,7 +696,6 @@
 	r = aPort->GetConfigurationStringDescriptor(rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New Configuration string: \"%lS\"\n"), &rd_str);
-	OstTraceExt1(TRACE_NORMAL, TESTSTANDARDSTRINGDESCRIPTORS_TESTSTANDARDSTRINGDESCRIPTORS_DUP14, "New Configuration string: \"%lS\"\n", rd_str);
 
 	test.Next(_L("Compare Configuration strings"));
 	r = rd_str.Compare(wr_str);
@@ -805,7 +785,6 @@
 	r = aPort->GetStringDescriptor(stridx3, rd_str);
 	test_KErrNone(r);
 	test.Printf(_L("New test string @ idx %d: \"%lS\"\n"), stridx3, &rd_str);
-	OstTraceExt2(TRACE_NORMAL, TESTARBITRARYSTRINGDESCRIPTORS_TESTARBITRARYSTRINGDESCRIPTORS, "New test string @ idx %d: \"%lS\"\n", stridx3, rd_str);
 
 	test.Next(_L("Compare test strings 3"));
 	r = rd_str.Compare(wr_str);
@@ -849,17 +828,17 @@
 	if (SupportsAlternateInterfaces())
 		{
 		TInt r = aPort->SetInterface(aNumSettings+1, ifc);
-		test_Compare(r,!=,KErrNone);
+		test_Compare(r,!=,KErrNone);		
 		}
-
+	
 	if (aNumSettings > 1)
 		{
 		TInt r = aPort->SetInterface(aNumSettings-1, ifc);
-		test_Compare(r,!=,KErrNone);
+		test_Compare(r,!=,KErrNone);		
 		}
 
 	TInt r = aPort->SetInterface(0, ifc);
-	test_Compare(r,!=,KErrNone);
+	test_Compare(r,!=,KErrNone);		
 
 	test.End();
 	}
@@ -871,13 +850,13 @@
 	if (aNumSettings > 2)
 		{
 		TInt r = aPort->ReleaseInterface(aNumSettings-3);
-		test_Compare(r,!=,KErrNone);
+		test_Compare(r,!=,KErrNone);		
 		}
 
 	if (aNumSettings > 1)
 		{
 		TInt r = aPort->ReleaseInterface(aNumSettings-2);
-		test_Compare(r,!=,KErrNone);
+		test_Compare(r,!=,KErrNone);		
 		}
 
 	test.End();
@@ -891,7 +870,7 @@
 		{
 		TestDeviceQualifierDescriptor(aPort);
 
-		TestOtherSpeedConfigurationDescriptor(aPort);
+		TestOtherSpeedConfigurationDescriptor(aPort);	
 		}
 
 	TestInterfaceDescriptor(aPort,aNumSettings);
@@ -901,7 +880,6 @@
 	TestStandardStringDescriptors(aPort);
 
 	TestArbitraryStringDescriptors(aPort,aNumSettings);
-	test.Next(_L("Test USB Descriptor Manipulation1"));
 
 	test.End();
 	}
@@ -955,14 +933,11 @@
 		TBool a_AltHnpSupport = (features & KUsbOtgAttr_A_AltHnpSupport) ? ETrue : EFalse;
 		test.Printf(_L("### OTG Features:\nB_HnpEnable(%d)\nA_HnpSupport(%d)\nA_Alt_HnpSupport(%d)\n"),
 					b_HnpEnable, a_HnpSupport, a_AltHnpSupport);
-		OstTraceExt3(TRACE_NORMAL, TESTOTGEXTENSIONS_TESTOTGEXTENSIONS, "### OTG Features:\nB_HnpEnable(%d)\nA_HnpSupport(%d)\nA_Alt_HnpSupport(%d)\n",
-					b_HnpEnable, a_HnpSupport, a_AltHnpSupport);
 		}
 	else
 		{
 		test_Equal(KErrNotSupported,r);
 		test.Printf(_L("GetOtgFeatures() not supported\n"));
-		OstTrace0(TRACE_NORMAL, TESTOTGEXTENSIONS_TESTOTGEXTENSIONS_DUP01, "GetOtgFeatures(not supported\n");
 		}
 
 	test.End();
@@ -1014,12 +989,10 @@
 			if (good)
 				{
 				test.Printf(_L("Ep0 supports %d bytes MaxPacketSize\n"), mpsize);
-				OstTrace1(TRACE_NORMAL, TESTENDPOINT0MAXPACKETSIZES_TESTENDPOINT0MAXPACKETSIZES, "Ep0 supports %d bytes MaxPacketSize\n", mpsize);
 				}
 			else
 				{
 				test.Printf(_L("Bad Ep0 size: 0x%08x, failure will occur\n"), bit);
-				OstTrace1(TRACE_NORMAL, TESTENDPOINT0MAXPACKETSIZES_TESTENDPOINT0MAXPACKETSIZES_DUP01, "Bad Ep0 size: 0x%08x, failure will occur\n", bit);
 				r = KErrGeneral;
 				}
 			}
--- a/kerneltest/e32test/usb/t_usb_device/src/config.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/config.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -14,14 +14,10 @@
 // e32test/usb/t_usbdev/src/config.cpp
 // USB Test Program T_USB_DEVICE.
 // Reading and converting the XML configuration file.
-//
+// 
 //
 
 #include "general.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "configTraces.h"
-#endif
 #include "config.h"
 
 _LIT(KCfgLDD,"LDD");
@@ -74,7 +70,7 @@
 
 static const TInt8 KMaxXMLNesting = 3;						// max 3 levels of xml nesting
 
-static const TPtrC xmlKeys[] =
+static const TPtrC xmlKeys[] = 
 	{
 	(TDesC&)KCfgLDD, (TDesC&)KCfgLDD1, (TDesC&)KCfgLDD2, (TDesC&)KCfgLDD3, (TDesC&)KCfgLDD4, (TDesC&)KCfgLDD5, (TDesC&)KCfgLDD6,
 	(TDesC&)KCfgLDD7, (TDesC&)KCfgLDD8, (TDesC&)KCfgLDD9, (TDesC&)KCfgLDD10, (TDesC&)KCfgLDD11, (TDesC&)KCfgLDD12, (TDesC&)KCfgLDD13,
@@ -103,7 +99,7 @@
 	ExiSerialNumber,
 	ExiOTG,
 	ExiInterface,					// xmlKeys index for Interface
-	ExiSetting,
+	ExiSetting,						
 	ExiClass,
 	ExiSubclass,
 	ExiProtocol,
@@ -122,13 +118,13 @@
 	ExiReadSize,
 	ExiLAST
 	};
-
+	
 // This array provides the index into xmlKeys for each level of xml key
 // the first index for level n being defined by xmlLevels[n]
 // and the last index for level n being defined by xmlLevels[n+1] - 1
 // this means this must have two more entries than the number of nesting levels
-// and the last entry must be the size of xmlKeys
-static const TUint8 xmlLevels[] =
+// and the last entry must be the size of xmlKeys 
+static const TUint8 xmlLevels[] = 
 	{
 	ExiLdd,ExiLdd+1,ExiSetting+1,ExiEndpoint+1,ExiLAST
 	};
@@ -190,8 +186,7 @@
 bool ProcessConfigFile (RFile aConfigFile,CConsoleBase* iConsole, LDDConfigPtr * LDDPtrPtr)
 	{
 	TUSB_PRINT ("Processing Configuration File");
-	OstTrace0 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS, "Processing Configuration File");
-
+	
 	TBuf8<100> configBuf;
 	TBuf<101> stringBuf;
 	bool done = false;
@@ -208,7 +203,7 @@
 	TInt levelKeys[KMaxXMLNesting+1];
 
 	* LDDPtrPtr = NULL;
-	ConfigPtrsPtr cpPtr = new ConfigPtrs (LDDPtrPtr);
+	ConfigPtrsPtr cpPtr = new ConfigPtrs (LDDPtrPtr); 			
 
 	while (!done && !error)
 		{
@@ -216,14 +211,13 @@
 		if (rStatus != KErrNone)
 			{
 			error = true;
-			TUSB_PRINT1("Config file error %d", rStatus);
-			OstTrace1(TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP01, "Config file error %d", rStatus);
+			TUSB_PRINT1("Config file error %d", rStatus);			
 			}
 		else
 			{
 			if (configBuf.Length() == 0)
 				{
-				done = true;
+				done = true;			
 				}
 			else
 				{
@@ -238,7 +232,6 @@
 						{
 						error = true;
 						TUSB_PRINT2 ("Config File Syntax Error at index %d of %s",i,stringBuf.PtrZ());
-						OstTraceExt2 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP02, "Config File Syntax Error at index %d of %S",i,stringBuf);
 						}
 					switch (state)
 						{
@@ -252,15 +245,14 @@
 									{
 									error = true;
 									TUSB_PRINT2 ("Config File Syntax Error at index %d of %s",i,stringBuf.PtrZ());
-									OstTraceExt2 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP03, "Config File Syntax Error at index %d of %S",i,stringBuf);
 									}
 							break;
-
+						
 						case EStartKey:
 							if (nextChar == '/')
 								{
 								state = EEndKey;
-								endkeyString.SetLength(0);
+								endkeyString.SetLength(0);															
 								}
 							else
 								{
@@ -270,8 +262,7 @@
 									if (level > KMaxXMLNesting)
 										{
 										error = true;
-										TUSB_PRINT1 ("Config File Too Many levels %s",stringBuf.PtrZ());
-										OstTraceExt1 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP04, "Config File Too Many levels %S",stringBuf);
+										TUSB_PRINT1 ("Config File Too Many levels %s",stringBuf.PtrZ());								
 										}
 									else
 										{
@@ -279,25 +270,19 @@
 										if (levelKeys[level] < 0)
 											{
 											error = true;
-											TUSB_PRINT1 ("Invalid XML key %s",keyString.PtrZ());
-											OstTraceExt1 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP05, "Invalid XML key %S",keyString);
+											TUSB_PRINT1 ("Invalid XML key %s",keyString.PtrZ());																	
 											}
 										else
 											{
 											if (CheckAttribute(iConsole,cpPtr,levelKeys[level],attributeString))
 												{
 												state = EValue;
-												TUSB_VERBOSE_PRINT2 ("Start key: %s level %d",keyString.PtrZ(),level);
-												if(gVerbose)
-												    {
-												    OstTraceExt2 (TRACE_VERBOSE, CONFIGPTRS_CONFIGPTRS_DUP06, "Start key: %S level %d",keyString,level);
-												    }
+												TUSB_VERBOSE_PRINT2 ("Start key: %s level %d",keyString.PtrZ(),level);			
 												}
 											else
 												{
-												error = true;
-												TUSB_PRINT1 ("No attribute for XML key %s",keyString.PtrZ());
-												OstTraceExt1 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP07, "No attribute for XML key %S",keyString);
+												error = true;	
+												TUSB_PRINT1 ("No attribute for XML key %s",keyString.PtrZ());																	
 												}
 											}
 										}
@@ -312,8 +297,7 @@
 										if (nextChar.IsSpace())
 											{
 											error = true;
-											TUSB_PRINT2 ("Config File Syntax Error at index %d of %s",i,stringBuf.PtrZ());
-											OstTraceExt2 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP08, "Config File Syntax Error at index %d of %S",i,stringBuf);
+											TUSB_PRINT2 ("Config File Syntax Error at index %d of %s",i,stringBuf.PtrZ());					
 											}
 										}
 									if (nextChar.IsSpace())
@@ -327,34 +311,28 @@
 									}
 								}
 							break;
-
+							
 						case EEndKey:
 							if (nextChar == '>')
 								{
 								if (levelKeys[level] != CheckXmlKey (endkeyString,level))
 									{
 									error = true;
-									TUSB_PRINT1 ("Invalid XML end key %s",endkeyString.PtrZ());
-									OstTraceExt1 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP09, "Invalid XML end key %S",endkeyString);
+									TUSB_PRINT1 ("Invalid XML end key %s",endkeyString.PtrZ());																	
 									}
 								else
-									{
+									{												
 									if (CheckValue(iConsole,cpPtr,levelKeys[level],valueString))
 										{
 										state = EEmpty;
 										TUSB_VERBOSE_PRINT2 ("End Key: %s value %s",endkeyString.PtrZ(),valueString.PtrZ());
-										if(gVerbose)
-										    {
-										    OstTraceExt2 (TRACE_VERBOSE, CONFIGPTRS_CONFIGPTRS_DUP10, "End Key: %S value %S",endkeyString,valueString);
-										    }
 										level--;
 										valueString.SetLength(0);
 										}
 									else
 										{
 										error = true;
-										TUSB_PRINT2 ("Incorrect value string %s for XML key %s",valueString.PtrZ(),endkeyString.PtrZ());
-										OstTraceExt2 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP11, "Incorrect value string %S for XML key %S",valueString,endkeyString);
+										TUSB_PRINT2 ("Incorrect value string %s for XML key %s",valueString.PtrZ(),endkeyString.PtrZ());	
 										}
 									}
 								}
@@ -362,14 +340,13 @@
 								{
 									error = true;
 									TUSB_PRINT2 ("Config File Syntax Error at index %d of %s",i,stringBuf.PtrZ());
-									OstTraceExt2 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP12, "Config File Syntax Error at index %d of %S",i,stringBuf);
 								}
 							else
 								{
 								endkeyString.Append(nextChar);
 								}
 							break;
-
+							
 						case EAttribute:
 							if (nextChar == '>')
 								{
@@ -377,8 +354,7 @@
 								if (level > KMaxXMLNesting)
 									{
 									error = true;
-									TUSB_PRINT1 ("Config File Too Many levels %s",stringBuf.PtrZ());
-									OstTraceExt1 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP13, "Config File Too Many levels %s",stringBuf);
+									TUSB_PRINT1 ("Config File Too Many levels %s",stringBuf.PtrZ());								
 									}
 								else
 									{
@@ -386,8 +362,7 @@
 									if (levelKeys[level] < 0)
 										{
 										error = true;
-										TUSB_PRINT1 ("Invalid XML key %s",keyString.PtrZ());
-										OstTraceExt1 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP14, "Invalid XML key %s",keyString);
+										TUSB_PRINT1 ("Invalid XML key %s",keyString.PtrZ());																	
 										}
 									else
 										{
@@ -395,16 +370,11 @@
 											{
 											state = EValue;
 											TUSB_VERBOSE_PRINT3 ("Start key: %s level %d attribute %s",keyString.PtrZ(),level,attributeString.PtrZ());
-											if(gVerbose)
-											    {
-											    OstTraceExt3 (TRACE_VERBOSE, CONFIGPTRS_CONFIGPTRS_DUP15, "Start key: %S level %d attribute %S",keyString,level,attributeString);
-											    }
 											}
 										else
 											{
-											error = true;
-											TUSB_PRINT2 ("Incorrect attribute %s for XML key %s",attributeString.PtrZ(),keyString.PtrZ());
-											OstTraceExt2 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP16, "Incorrect attribute %s for XML key %s",attributeString,keyString);
+											error = true;	
+											TUSB_PRINT2 ("Incorrect attribute %s for XML key %s",attributeString.PtrZ(),keyString.PtrZ());																	
 											}
 										}
 									}
@@ -414,7 +384,7 @@
 								attributeString.Append(nextChar);
 								}
 							break;
-
+							
 						case EValue:
 							if (nextChar == '<')
 								{
@@ -425,7 +395,7 @@
 								// Don't add any leading spaces
 								if (!nextChar.IsSpace() || valueString.Length() != 0)
 									{
-									valueString.Append(nextChar);
+									valueString.Append(nextChar);						
 									}
 								}
 							break;
@@ -434,14 +404,14 @@
 				}
 			}
 		}
-
+		
 	delete cpPtr;
 
 	return !error;
 	}
 
 
-
+	
 TBool CheckAttribute (CConsoleBase* iConsole, ConfigPtrsPtr cpPtr,TInt aKeyIndex, TPtrC aDes)
 	{
 	TBool retValue = ETrue;
@@ -466,14 +436,10 @@
 				if (attrib[0] == ((TDesC&)KQuote)[0] && attrib[attrib.Length()-1] == ((TDesC&)KQuote)[0])
 					{
 					TUSB_VERBOSE_PRINT1 ("LDD with attribute name %s",attrib.PtrZ());
-					if(gVerbose)
-					    {
-					    OstTraceExt1 (TRACE_VERBOSE, CONFIGPTRS_CONFIGPTRS_DUP17, "LDD with attribute name %s",attrib);
-					    }
-					cpPtr->iThisLDDPtr = new LDDConfig (attrib.MidTPtr(1,attrib.Length()-2));
+					cpPtr->iThisLDDPtr = new LDDConfig (attrib.MidTPtr(1,attrib.Length()-2));		
 					*cpPtr->iNextLDDPtrPtr = cpPtr->iThisLDDPtr;
 					cpPtr->iNextLDDPtrPtr = &(cpPtr->iThisLDDPtr->iPtrNext);
-					cpPtr->iNextIFPtrPtr = &(cpPtr->iThisLDDPtr->iIFPtr);
+					cpPtr->iNextIFPtrPtr = &(cpPtr->iThisLDDPtr->iIFPtr);			
 					}
 				else
 					retValue = EFalse;
@@ -483,7 +449,7 @@
 				retValue = EFalse;
 				}
 			break;
-
+			
 		//	level 1 index INTERFACE
 		case ExiInterface :
 			if (attrib.Find(KAttributeNumber) == 0)
@@ -496,38 +462,31 @@
 						if (cpPtr->iThisLDDPtr == NULL)
 							{
 							TUSB_PRINT ("No LDD container for interface");
-							OstTrace0 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP18, "No LDD container for interface");
-							retValue = EFalse;
+							retValue = EFalse;				
 							}
 						}
 					else
 						{
 						TUSB_PRINT2 ("Number conversion error %s %d",attrib.PtrZ(),ifNumber);
-						OstTraceExt2 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP19, "Number conversion error %S %u",attrib,ifNumber);
 						retValue = EFalse;
 						}
 					}
 				else
 					{
 					TUSB_PRINT1 ("Attribute number not in \"\" %s",attrib.PtrZ());
-					OstTraceExt1 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP20, "Attribute number not in \"\" %s",attrib);
-					retValue = EFalse;
+					retValue = EFalse;	
 					}
 				}
 			if (retValue)
 				{
 	 			TUSB_VERBOSE_PRINT1 ("Interface number %d",ifNumber);
-	 			if(gVerbose)
-	 			    {
-	 			    OstTrace1 (TRACE_VERBOSE, CONFIGPTRS_CONFIGPTRS_DUP21, "Interface number %d",ifNumber);
-	 			    }
 				cpPtr->iThisIFPtr = new IFConfig ((TUint8)ifNumber);
 				* cpPtr->iNextIFPtrPtr = cpPtr->iThisIFPtr;
 				cpPtr->iNextIFPtrPtr = &cpPtr->iThisIFPtr->iPtrNext;
 				cpPtr->iThisLDDPtr->iNumChannels++;
 				}
-			break;
-
+			break;	
+			
 
 		//	level 1 index Setting
 		case ExiSetting :
@@ -540,48 +499,43 @@
 				if (cpPtr->iThisLDDPtr == NULL)
 					{
 					TUSB_PRINT ("No LDD container for interface");
-					OstTrace0 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP22, "No LDD container for interface");
-					retValue = EFalse;
+					retValue = EFalse;				
 					}
 				else
 					{
-					TUSB_VERBOSE_PRINT ("Alternate Interface Setting");
-					if(gVerbose)
-					    {
-					    OstTrace0 (TRACE_VERBOSE, CONFIGPTRS_CONFIGPTRS_DUP23, "Alternate Interface Setting");
-					    }
-					cpPtr->iThisIFPtr = new IFConfig (0);
+					TUSB_VERBOSE_PRINT ("Alternate Interface Setting");			
+					cpPtr->iThisIFPtr = new IFConfig (0);		
 					* cpPtr->iNextIFPtrPtr = cpPtr->iThisIFPtr;
 					cpPtr->iNextIFPtrPtr = &cpPtr->iThisIFPtr->iPtrNext;
 					cpPtr->iThisIFPtr->iAlternateSetting = ETrue;
-					}
+					}					
 				}
 			break;
-
+			
 		//	level 2 index ENDPOINT
 		case ExiEndpoint :
 			typePos = attrib.Find(KAttributeType);
 			dirPos = attrib.Find(KAttributeDirection);
-
+			
 			if (typePos == KErrNotFound || dirPos == KErrNotFound)
 				{
 				retValue = EFalse;
 				}
-			else
+			else	
 				{
 				if (typePos < dirPos)
 					{
 					typePos += ((TDesC&)KAttributeType).Length();
 					typeLen = dirPos - typePos;
 					dirPos += ((TDesC&)KAttributeDirection).Length();
-					dirLen = attrib.Length() - dirPos;
+					dirLen = attrib.Length() - dirPos;			
 					}
 				else
 					{
-					dirPos += ((TDesC&)KAttributeDirection).Length();
+					dirPos += ((TDesC&)KAttributeDirection).Length();			
 					dirLen = typePos - dirPos;
 					typePos += ((TDesC&)KAttributeType).Length();
-					typeLen = attrib.Length() - typePos;
+					typeLen = attrib.Length() - typePos;			
 					}
 				TPtr attribPtr = attrib.MidTPtr(typePos,typeLen);
 				attribPtr.UpperCase();
@@ -604,7 +558,7 @@
 							}
 						else
 							{
-							retValue = EFalse;
+							retValue = EFalse;					
 							}
 						}
 					}
@@ -631,17 +585,12 @@
 					if (cpPtr->iThisIFPtr == NULL)
 						{
 						TUSB_PRINT ("No Interface container for Endpoint");
-						OstTrace0 (TRACE_NORMAL, CONFIGPTRS_CONFIGPTRS_DUP24, "No Interface container for Endpoint");
-						retValue = EFalse;
+						retValue = EFalse;				
 						}
 					else
 						{
 						TUint epIndex = cpPtr->iThisIFPtr->iInfoPtr->iTotalEndpointsUsed;
-						TUSB_VERBOSE_PRINT2 ("Endpoint with type %d %d",epType,epDir);
-						if(gVerbose)
-						    {
-						    OstTraceExt2 (TRACE_VERBOSE, CONFIGPTRS_CONFIGPTRS_DUP25, "Endpoint with type %u %u",(TUint32)epType,(TUint32)epDir);
-						    }
+						TUSB_VERBOSE_PRINT2 ("Endpoint with type %d %d",epType,epDir);			
 						cpPtr->iThisIFPtr->iInfoPtr->iEndpointData[epIndex].iType = epType;
 						cpPtr->iThisIFPtr->iInfoPtr->iEndpointData[epIndex].iDir = epDir;
 						#ifdef USB_SC
@@ -655,14 +604,14 @@
 					}
 				}
 			break;
-
+		
 		default :
 			if (aDes.Length() != 0)
 				{
 				retValue = EFalse;
 				}
 		}
-
+		
 	return retValue;
 	}
 
@@ -672,17 +621,13 @@
 	TBool boolValue;
 	TUint uintValue;
 	TInt epIndex = -1;
-
+	
 	if (cpPtr->iThisIFPtr != NULL)
 		{
 		epIndex = cpPtr->iThisIFPtr->iInfoPtr->iTotalEndpointsUsed -1;
 		}
-
+		
 	TUSB_VERBOSE_PRINT2 ("CheckValue keyIndex %d %s",aKeyIndex,aDes.Ptr());
-	if(gVerbose)
-	    {
-	    OstTraceExt2 (TRACE_VERBOSE, CONFIGPTRS_CONFIGPTRS_DUP26, "CheckValue keyIndex %d %s",aKeyIndex,aDes);
-	    }
 	switch (aKeyIndex)
 		{
 		case ExiLdd:						// xmlKeys index for LDD
@@ -693,19 +638,19 @@
 				retValue = EFalse;
 				}
 			break;
-
+			
 		case ExiEndpoints:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (uintValue == 0 || uintValue > 128)
 				{
-				retValue = EFalse;
+				retValue = EFalse;			
 				}
 			else
 				{
 				cpPtr->iThisLDDPtr->iNumEndpoints = uintValue;
 				}
 			break;
-
+			
 		case ExiSoftconnect:
 			retValue = TDesToBool (aDes, &boolValue);
 			if (cpPtr->iThisLDDPtr == NULL)
@@ -715,7 +660,7 @@
 				cpPtr->iThisLDDPtr->iSoftConnect = boolValue;
 				}
 			break;
-
+			
 		case ExiSelfPower:
 			retValue = TDesToBool (aDes, &boolValue);
 			if (cpPtr->iThisLDDPtr == NULL)
@@ -725,7 +670,7 @@
 				cpPtr->iThisLDDPtr->iSelfPower = boolValue;
 				}
 			break;
-
+			
 		case ExiRemoteWakeup:
 			retValue = TDesToBool (aDes, &boolValue);
 			if (cpPtr->iThisLDDPtr == NULL)
@@ -735,7 +680,7 @@
 				cpPtr->iThisLDDPtr->iRemoteWakeup = boolValue;
 				}
 			break;
-
+			
 		case ExiHighSpeed:
 			retValue = TDesToBool (aDes, &boolValue);
 			if (cpPtr->iThisLDDPtr == NULL)
@@ -745,7 +690,7 @@
 				cpPtr->iThisLDDPtr->iHighSpeed = boolValue;
 				}
 			break;
-
+			
 		case ExiFeatures:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (cpPtr->iThisLDDPtr == NULL)
@@ -755,7 +700,7 @@
 				cpPtr->iThisLDDPtr->iFeatures = uintValue;
 				}
 			break;
-
+			
 		case ExiMaxPower:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (cpPtr->iThisLDDPtr == NULL || uintValue > 50)
@@ -765,7 +710,7 @@
 				cpPtr->iThisLDDPtr->iMaxPower = uintValue;
 				}
 			break;
-
+			
 		case ExiEpStall:
 			retValue = TDesToBool (aDes, &boolValue);
 			if (cpPtr->iThisLDDPtr == NULL)
@@ -775,7 +720,7 @@
 				cpPtr->iThisLDDPtr->iEPStall = boolValue;
 				}
 			break;
-
+			
 		case ExiSpec:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (cpPtr->iThisLDDPtr == NULL)
@@ -785,7 +730,7 @@
 				cpPtr->iThisLDDPtr->iSpec = uintValue;
 				}
 			break;
-
+			
 		case ExiVID:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (cpPtr->iThisLDDPtr == NULL)
@@ -795,7 +740,7 @@
 				cpPtr->iThisLDDPtr->iVid = uintValue;
 				}
 			break;
-
+			
 		case ExiPID:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (cpPtr->iThisLDDPtr == NULL)
@@ -805,7 +750,7 @@
 				cpPtr->iThisLDDPtr->iPid = uintValue;
 				}
 			break;
-
+			
 		case ExiRelease:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (cpPtr->iThisLDDPtr == NULL)
@@ -815,7 +760,7 @@
 				cpPtr->iThisLDDPtr->iRelease = uintValue;
 				}
 			break;
-
+			
 		case ExiManufacturer:
 			cpPtr->iThisLDDPtr->iManufacturer = aDes.Alloc();
 			break;
@@ -830,7 +775,7 @@
 
 		case ExiOTG:
 			break;
-
+			
 		case ExiClass:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (cpPtr->iThisIFPtr == NULL || uintValue > 0xFF)
@@ -840,7 +785,7 @@
 				cpPtr->iThisIFPtr->iInfoPtr->iClass.iClassNum = uintValue;
 				}
 			break;
-
+			
 		case ExiSubclass:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (cpPtr->iThisIFPtr == NULL || uintValue > 0xFF)
@@ -850,7 +795,7 @@
 				cpPtr->iThisIFPtr->iInfoPtr->iClass.iSubClassNum = uintValue;
 				}
 			break;
-
+			
 		case ExiProtocol:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (cpPtr->iThisIFPtr == NULL || uintValue > 0xFF)
@@ -860,15 +805,15 @@
 				cpPtr->iThisIFPtr->iInfoPtr->iClass.iProtocolNum = uintValue;
 				}
 			break;
-
+			
 		case ExiDescriptor:
 			cpPtr->iThisIFPtr->iInfoPtr->iString = aDes.Alloc();
 			break;
-
+			
 		case ExiBandwidthIn:
 			#ifdef USB_SC
 			retValue = EFalse;
-			#else
+			#else			
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (cpPtr->iThisIFPtr == NULL || uintValue > 3)
 				retValue = EFalse;
@@ -892,11 +837,11 @@
 				}
 			#endif
 			break;
-
+			
 		case ExiBandwidthOut:
 			#ifdef USB_SC
 			retValue = EFalse;
-			#else
+			#else			
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (cpPtr->iThisIFPtr == NULL || uintValue > 3)
 				retValue = EFalse;
@@ -920,7 +865,7 @@
 				}
 			#endif
 			break;
-
+			
 		case ExiSize:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (epIndex < 0)
@@ -942,29 +887,29 @@
 								retValue = EFalse;
 							}
 						break;
-
+						
 					case KUsbEpTypeInterrupt :
 						if ((defaultIF && uintValue > 64) ||
 							(!cpPtr->iThisLDDPtr->iHighSpeed && uintValue > 64) ||
 							(!defaultIF && cpPtr->iThisLDDPtr->iHighSpeed && uintValue > 1024))
 							retValue = EFalse;
 						break;
-
+						
 					case KUsbEpTypeIsochronous :
 						if ((defaultIF && uintValue > 0) ||
 							(!defaultIF && !cpPtr->iThisLDDPtr->iHighSpeed && uintValue > 1023) ||
 							(!defaultIF && cpPtr->iThisLDDPtr->iHighSpeed && uintValue > 1024))
 							retValue = EFalse;
-						break;
+						break;					
 					}
 				if (retValue)
 					{
 					cpPtr->iThisIFPtr->iInfoPtr->iEndpointData[epIndex].iSize = uintValue;
 					}
 				}
-
+			
 			break;
-
+			
 		case ExiInterval:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (epIndex < 0)
@@ -976,16 +921,16 @@
 					case KUsbEpTypeBulk :
 						retValue = EFalse;
 						break;
-
+						
 					case KUsbEpTypeInterrupt :
 						if (uintValue < 1 || uintValue > 255)
 							retValue = EFalse;
 						break;
-
+						
 					case KUsbEpTypeIsochronous :
 						if (uintValue < 1 || uintValue > 16)
 							retValue = EFalse;
-						break;
+						break;					
 					}
 				if (retValue)
 					{
@@ -993,7 +938,7 @@
 					}
 				}
 			break;
-
+			
 		case ExiHSInterval:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (epIndex < 0 || !cpPtr->iThisLDDPtr->iHighSpeed)
@@ -1006,16 +951,16 @@
 						if (uintValue > 255)
 							retValue = EFalse;
 						break;
-
+						
 					case KUsbEpTypeInterrupt :
 						if (uintValue < 1 || uintValue > 16)
 							retValue = EFalse;
 						break;
-
+						
 					case KUsbEpTypeIsochronous :
 						if (uintValue < 1 || uintValue > 16)
 							retValue = EFalse;
-						break;
+						break;					
 					}
 				if (retValue)
 					{
@@ -1023,7 +968,7 @@
 					}
 				}
 			break;
-
+			
 		case ExiHSTransactions:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (epIndex < 0 || !cpPtr->iThisLDDPtr->iHighSpeed)
@@ -1038,7 +983,7 @@
 					}
 				}
 			break;
-
+			
 		case ExiDMA:
 			retValue = TDesToBool (aDes, &boolValue);
 			if (epIndex < 0)
@@ -1048,7 +993,7 @@
 				cpPtr->iThisIFPtr->iEpDMA[epIndex] = boolValue;
 				}
 			break;
-
+			
 		case ExiDoubleBuff:
 			#ifdef USB_SC
 			retValue = EFalse;
@@ -1062,7 +1007,7 @@
 				}
 			#endif
 			break;
-
+			
 		case ExiExtra:
 			retValue = TDesToTUint (aDes, &uintValue);
 			if (epIndex < 0)
@@ -1082,7 +1027,7 @@
 				{
 				cpPtr->iThisIFPtr->iInfoPtr->iEndpointData[epIndex].iBufferSize = uintValue;
 				}
-			#else
+			#else			
 			retValue = EFalse;
 			#endif
 			break;
@@ -1096,7 +1041,7 @@
 				{
 				cpPtr->iThisIFPtr->iInfoPtr->iEndpointData[epIndex].iReadSize = uintValue;
 				}
-			#else
+			#else			
 			retValue = EFalse;
 			#endif
 			break;
@@ -1104,11 +1049,11 @@
 
 	return retValue;
 	}
-
+	
 TInt CheckXmlKey (TPtrC aKey,TInt aLevel)
 	{
 	TInt keyIndex = -1;
-
+	
 	for (TInt i = xmlLevels[aLevel]; i < xmlLevels[aLevel+1]; i++)
 		{
 		if (aKey == xmlKeys[i])
@@ -1118,7 +1063,7 @@
 			}
 		}
 
-
+			
 	return keyIndex;
 	}
 
@@ -1130,13 +1075,13 @@
 	TBool conversionOK = ETrue;
 	TUint8 desIndex = 0;
 	* aValue = 0;
-
+	
 	if (numDes.LeftTPtr(((TDesC&)KHexPrefix).Length()) == KHexPrefix)
 		{
 		hexBase = ETrue;
-		desIndex = ((TDesC&)KHexPrefix).Length();
+		desIndex = ((TDesC&)KHexPrefix).Length();	
 		}
-
+		
 	while (desIndex < numDes.Length() && conversionOK)
 		{
 		if (hexBase)
@@ -1167,19 +1112,19 @@
 				else
 					{
 					conversionOK = EFalse;
-					* aValue = 222;
-					}
+					* aValue = 222;				
+					}	
 				}
 			else
 				{
-				conversionOK = EFalse;
+				conversionOK = EFalse;	
 				* aValue = 333;
 				}
-
+			
 			}
 		desIndex++;
 		}
-
+		
 	return conversionOK;
 	}
 
@@ -1189,7 +1134,7 @@
 	_LIT (KBoolN,"N");
 	TBool conversionOK = ETrue;
 	TBuf<50> boolDes = aDes;
-
+	
 	boolDes.TrimAll();
 	boolDes.UpperCase();
 	if (boolDes == KBoolY)
@@ -1204,9 +1149,9 @@
 			}
 		else
 			{
-			conversionOK = EFalse;
+			conversionOK = EFalse;	
 			}
 		}
-
+		
 	return conversionOK;
 	}
--- a/kerneltest/e32test/usb/t_usb_device/src/main.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/main.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -14,17 +14,13 @@
 // e32test/usb/t_usb_device/main.cpp
 // USB Test Program, main part.
 // Device-side part, to work against t_usb_host running on the host.
-//
+// 
 //
 
 #include "general.h"
 #include "config.h"
 #include "activecontrol.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "mainTraces.h"
-#endif
-#include "activerw.h"
+#include "activeRW.h"
 
 // --- Global Top Level Variables
 
@@ -34,10 +30,6 @@
 #else
 RTest test(_L("T_USB_DEVICE"));
 #endif
-
-#ifdef USB_SC
-TBool gShareHandle = EFalse;
-#endif
 TBool gVerbose = EFalse;
 TBool gSkip = EFalse;
 TBool gTempTest = EFalse;
@@ -51,7 +43,7 @@
 #ifdef USB_SC
 RChunk gChunk;
 #endif
-
+	
 
 void RunAppL(TDes * aConfigFile, TDes * aScriptFile)
 	{
@@ -70,19 +62,15 @@
 	CleanupStack::PushL(myConsole);
 
 	myConsole->Printf(_L("T_USB_SCDEVICE v%d.%d.%d\n"),KDeviceVersionMajor,KDeviceVersionMinor,KDeviceVersionMicro);
-	OstTraceExt3(TRACE_NORMAL, RUNAPPL_RUNAPPL, "T_USB_SCDEVICE v%d.%d.%d\n",(TInt32)KDeviceVersionMajor,(TInt32)KDeviceVersionMinor,(TInt32)KDeviceVersionMicro);
 	test.Printf(_L("T_USB_SCDEVICE v%d.%d.%d\n"),KDeviceVersionMajor,KDeviceVersionMinor,KDeviceVersionMicro);
-	OstTraceExt3(TRACE_NORMAL, RUNAPPL_RUNAPPL_DUP01, "T_USB_SCDEVICE v%d.%d.%d\n",(TInt32)KDeviceVersionMajor,(TInt32)KDeviceVersionMinor,(TInt32)KDeviceVersionMicro);
 	#else
 	CConsoleBase* myConsole = Console::NewL(_L("T_USB_DEVICE - USB Client Test"), TSize(KConsFullScreen, KConsFullScreen));
 	CleanupStack::PushL(myConsole);
 
 	myConsole->Printf(_L("T_USB_DEVICE v%d.%d.%d\n"),KDeviceVersionMajor,KDeviceVersionMinor,KDeviceVersionMicro);
-	OstTraceExt3(TRACE_NORMAL, RUNAPPL_RUNAPPL_DUP02, "T_USB_DEVICE v%u.%u.%u\n",KDeviceVersionMajor,KDeviceVersionMinor,KDeviceVersionMicro);
 	test.Printf(_L("T_USB_DEVICE v%d.%d.%d\n"),KDeviceVersionMajor,KDeviceVersionMinor,KDeviceVersionMicro);
-	OstTraceExt3(TRACE_NORMAL, RUNAPPL_RUNAPPL_DUP03, "T_USB_DEVICE v%u.%u.%u\n",KDeviceVersionMajor,KDeviceVersionMinor,KDeviceVersionMicro);
 	#endif
-
+	
 	// outermost test begin
 	test.Start(_L("Outermost test of t_usb_device\n"));
 
@@ -91,19 +79,14 @@
 		gActiveControl = CActiveControl::NewL(myConsole, aConfigFile, aScriptFile);
 		CleanupStack::PushL(gActiveControl);
 
-
+	
 		// Call request function
-#ifdef USB_SC
-		if (!gShareHandle)
-			gActiveControl->RequestEp0ControlPacket();
-#else
 		gActiveControl->RequestEp0ControlPacket();
-#endif
+
 		CActiveScheduler::Start();
-
+		
 		test.Printf (_L("Test Run Completed\n"));
-		OstTrace0(TRACE_NORMAL, RUNAPPL_RUNAPPL_DUP04, "Test Run Completed\n");
-
+		
 		if (gSoakCount > 0)
 			{
 			gSoakCount--;
@@ -111,7 +94,7 @@
 
 		// Suspend thread for 2 seconds
 		User::After(2000000);
-
+		
 		CleanupStack::PopAndDestroy(gActiveControl);
 
 		}
@@ -131,7 +114,7 @@
 void ParseCommandLine (TDes& aConfigFileName, TDes& aScriptFileName)
 	{
 	TBuf<64> c;
-
+	
 	User::CommandLine(c);
 	c.LowerCase();
 
@@ -146,31 +129,24 @@
 			{
 			if (token == _L("/v"))
 				{
-				OstTrace0(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE, "Verbose output enabled\n");
+				RDebug::Print(_L("Verbose output enabled\n"));
 				gVerbose = ETrue;
 				}
 			else if (token == _L("/s"))
 				{
-				OstTrace0(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE_DUP01, "Skipping some tests\n");
+				RDebug::Print(_L("Skipping some tests\n"));
 				gSkip = ETrue;
 				}
 			else if (token == _L("/t"))
 				{
-				OstTrace0(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE_DUP02, "Temporary Test\n");
+				RDebug::Print(_L("Temporary Test\n"));
 				gTempTest = ETrue;
 				}
 			else if (token == _L("/n"))
 				{
-				OstTrace0(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE_DUP03, "Not Stopping on Test Fail\n");
+				RDebug::Print(_L("Not Stopping on Test Fail\n"));
 				gStopOnFail = EFalse;
 				}
-#ifdef USB_SC
-			else if (token == _L("/a"))
-				{
-				OstTrace0(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE_DUP04, "share handle test\n");
-				gShareHandle = ETrue;
-				}
-#endif
 			else if (token.Left(5) == _L("/soak"))
 				{
 				TInt equalPos;
@@ -179,9 +155,9 @@
 				if ((equalPos+1) < token.Length())
 					{
 					TLex lexNum(token.Mid(equalPos+1));
-					lexNum.Val(gSoakCount,EDecimal);
+					lexNum.Val(gSoakCount,EDecimal);	
 					}
-				OstTrace1(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE_DUP05, "Soak test for %d iterations\n",gSoakCount);
+				RDebug::Print(_L("Soak test for %d iterations\n"),gSoakCount);
 				}
 			else if (token.Left(8) == _L("/script="))
 				{
@@ -193,31 +169,31 @@
 				}
 			}
 		}
-
+		
 	}
-
+	
 TInt E32Main()
 	{
 	__UHEAP_MARK;
-
+	
 	CTrapCleanup* cleanup = CTrapCleanup::New();			// get clean-up stack
 
 	TBuf<64> configFileName;
 	TBuf<64> scriptFileName;
 	ParseCommandLine (configFileName,scriptFileName);
-
+	
 	if (configFileName.Length() == 0)
 		{
-		OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN, "(T_USB: Warning - No Configuration File.\n");
+			RDebug::Print(_L("(T_USB: Warning - No Configuration File.)\n"));		
 		}
 	else
 		{
-		OstTraceExt1(TRACE_NORMAL, E32MAIN_E32MAIN_DUP01, "T_USB: Config File Name %S\n",configFileName);
+		RDebug::Print(_L("T_USB: Config File Name %s\n"),configFileName.PtrZ());
 		}
 
 	if (scriptFileName.Length() != 0)
 		{
-		OstTraceExt1(TRACE_NORMAL, E32MAIN_E32MAIN_DUP02, "T_USB: Script File Name %S\n",scriptFileName);
+		RDebug::Print(_L("T_USB: Script File Name %s\n"),scriptFileName.PtrZ());
 		}
 
 	TRAPD(error, RunAppL(& configFileName, &scriptFileName));
@@ -228,7 +204,7 @@
 
 	__UHEAP_MARKEND;
 
-	OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP03, "Program exit: done.\n");
+	RDebug::Print(_L("Program exit: done.\n"));
 
 	return 0;												// and return
 	}
--- a/kerneltest/e32test/usb/t_usb_device/src/tranhandleserver.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
-* 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"
-* 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
- @internalComponent
-*/
-
-
-#include "tranhandleserver.h"
-#include "tranhandlesession.h"
-#include "tranhandleserversecuritypolicy.h"
-#include "tranhandleserverconsts.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "tranhandleserverTraces.h"
-#endif
-#include "general.h"
-
-
-
-CTranHandleServer* CTranHandleServer::NewL(CActiveControl& aControl)
-    {
-    OstTrace0(TRACE_NORMAL, CTRANHANDLESERVER_NEWL, "CTranHandleServer::NewL");
-    CTranHandleServer* self = new(ELeave) CTranHandleServer(aControl);
-    CleanupStack::PushL(self);
-    TInt err = self->Start(KTranHandleServerName);
-
-    if ( err != KErrAlreadyExists )
-        {
-        User::LeaveIfError(err);
-        }
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-CTranHandleServer::~CTranHandleServer()
-    {
-    OstTrace0(TRACE_NORMAL, CTRANHANDLESERVER_DCTRANHANDLESERVER, "CTranHandleServer::~CTranHandleServer");
-    }
-
-CTranHandleServer::CTranHandleServer(CActiveControl& aControl)
- :  CPolicyServer(CActive::EPriorityStandard, KTranHandleServerPolicy, ESharableSessions),
-    iActiveControl(aControl)
-    {
-    }
-
-CSession2* CTranHandleServer::NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const
-    {
-    //Validate session as coming from UsbSvr
-	OstTrace0(TRACE_NORMAL, CTRANHANDLESERVER_NEWSESSIONL, "CTranHandleServer::NewSessionL");
-    CTranHandleSession* sess = CTranHandleSession::NewL(iActiveControl);
-    return sess;
-    }
--- a/kerneltest/e32test/usb/t_usb_device/src/tranhandlesession.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
-* 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"
-* 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
- @internalComponent
-*/
-
-#include <e32base.h>
-
-#include "tranhandleserverconsts.h"
-#include "tranhandlesession.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "tranhandlesessionTraces.h"
-#endif
-#include "activecontrol.h"
-
-
-
-CTranHandleSession* CTranHandleSession::NewL(CActiveControl& aControl)
-    {
-    CTranHandleSession* self = new(ELeave) CTranHandleSession(aControl);
-    return self;
-    }
-
-CTranHandleSession::CTranHandleSession(CActiveControl& aControl)
-    : iActiveControl(aControl)
-    {
-    }
-
-CTranHandleSession::~CTranHandleSession()
-    {
-    OstTrace0(TRACE_NORMAL, CTRANHANDLESESSION_DCTRANHANDLESESSION, "CTranHandleSession::~CTranHandleSession");
-    }
-
-void CTranHandleSession::ServiceL(const RMessage2& aMessage)
-    {
-	OstTrace0(TRACE_NORMAL, CTRANHANDLESESSION_SERVICEL, "CTranHandleSession::ServiceL");
-	TInt r;
-    switch ( aMessage.Function() )
-        {
-    case ETransferHandle:
-        {
-        RMessagePtr2 messagePtr(aMessage);
-        TRAP(r, iActiveControl.ConstructLOnSharedLdd(messagePtr));
-
-        aMessage.Complete(r);
-        break;
-        }
-
-    default:
-        aMessage.Complete(KErrNotSupported);
-        break;
-        }
-    }
--- a/kerneltest/e32test/usb/t_usb_device/src/tranhandlesrv.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
-* 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"
-* 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
-*/
-
-#include <e32base.h>
-#include "tranhandlesrv.h"
-#include "tranhandleserverconsts.h"
-
-
-/** Constructor */
-EXPORT_C RTranHandleSrv::RTranHandleSrv()
-    {
-    }
-
-/** Destructor */
-EXPORT_C RTranHandleSrv::~RTranHandleSrv()
-    {
-    }
-
-EXPORT_C TVersion RTranHandleSrv::Version() const
-    {
-    return TVersion(    KTranHandleSrvMajorVersionNumber,
-                        KTranHandleSrvMinorVersionNumber,
-                        KTranHandleSrvBuildNumber
-                    );
-    }
-
-EXPORT_C TInt RTranHandleSrv::Connect()
-    {
-    return CreateSession(KTranHandleServerName, Version(), 1);
-    }
-
-EXPORT_C TInt RTranHandleSrv::TransferHandle(RHandleBase& aHandle, RHandleBase& aChunk)
-    {
-    return SendReceive(ETransferHandle, TIpcArgs(aHandle, aChunk));
-    }
-
--- a/kerneltest/e32test/usb/t_usb_device/src/transferhandle.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
-* 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"
-* 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:
-* Header file NTB build policy base class
-*
-*/
-
-
-/**
-@file
-@internalComponent
-*/
-
-#include "transferhandle.h"
-#include "transferserver.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "transferhandleTraces.h"
-#endif
-
-CTransferHandle* CTransferHandle::NewL(CTransferServer& aServer)
-    {
-    CTransferHandle *self=new (ELeave) CTransferHandle(aServer);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;    
-    }
-
-CTransferHandle::CTransferHandle(CTransferServer& aServer)
-    : CActive(CActive::EPriorityStandard), iServer(aServer)
-    {
-    }
-
-CTransferHandle::~CTransferHandle()
-    {
-    OstTrace0(TRACE_NORMAL, CTRANSFERHANDLE_DCTRANSFERHANDLE, "CTransferHandle::~CTransferHandle");
-    Cancel();
-    iTimer.Close();
-    }
-
-void CTransferHandle::DoCancel()
-    {
-    OstTrace0(TRACE_NORMAL, CTRANSFERHANDLE_DOCANCEL, "CTransferHandle::DoCancel");
-    iTimer.Cancel();
-    }
-
-void CTransferHandle::ConstructL()
-    {
-    CActiveScheduler::Add(this);
-    User::LeaveIfError(iTimer.CreateLocal());
-    }
-
-_LIT(KPanic, "CTransferHandle");
-const TInt KTimerError = 1;
-
-
-void CTransferHandle::RunL()
-	{
-	if(iStatus.Int() != KErrNone)
-		{		
-		OstTrace0(TRACE_FATAL, CTRANSFERHANDLE_RUNL, "CTransferHandle::RunL");
-		User::Panic(KPanic, KTimerError);
-		return;
-		}
-	iServer.TransferHandleL();
-	}
-
-void CTransferHandle::StartTimer()
-	{
-	iStatus = KRequestPending;
-    iTimer.After(iStatus, 10000);
-    SetActive();
-	}
-
-
--- a/kerneltest/e32test/usb/t_usb_device/src/transferserver.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,514 +0,0 @@
-/*
-* Copyright (c) 1997-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"
-* 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:
-*
-*
-*/
-
-/**
- @file
-*/
-
-#include <e32svr.h>
-#include "transferserver.h"
-#include "transfersession.h"
-#include "transfersrv.h"
-#include "transferserversecuritypolicy.h"
-#include "transferhandle.h"
-#include "tranhandlesrv.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "transferserverTraces.h"
-#endif
-
-
-
-TBool gVerbose = ETrue;
-extern RTest test;
-
-
-CTransferServer* CTransferServer::NewLC()
-	{
-	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_NEWLC, "CTransferServer::NewLC");
-	CTransferServer* self = new(ELeave) CTransferServer;
-	CleanupStack::PushL(self);
-	self->StartL(KTransferServerName);
-	self->ConstructL();
-	return self;
-	}
-
-CTransferServer::~CTransferServer()
-	{
-	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_DCTRANSFERSERVER, "CTransferServer::~CTransferServer");
-	while (iLddPtr->iIFPtr)
-	{
-	IFConfigPtr* ifPtrPtr = & iLddPtr->iIFPtr;
-	while ((*ifPtrPtr)->iPtrNext)
-		{
-		ifPtrPtr = &(*ifPtrPtr)->iPtrNext;
-		}
-	delete (*ifPtrPtr)->iInfoPtr->iString;
-	delete (*ifPtrPtr)->iInfoPtr;
-	delete (*ifPtrPtr);
-	* ifPtrPtr = NULL;
-	}
-
-	while (iLddPtr)
-		{
-		LDDConfigPtr* lddPtrPtr = &iLddPtr;	
-		while ((*lddPtrPtr)->iPtrNext)
-			{
-			lddPtrPtr = &(*lddPtrPtr)->iPtrNext;
-			}
-		delete (*lddPtrPtr)->iManufacturer;
-		delete (*lddPtrPtr)->iProduct;
-		delete (*lddPtrPtr)->iSerialNumber;
-		delete (*lddPtrPtr);
-		* lddPtrPtr = NULL;
-		}
-
-	delete iShutdownTimer;	
-	delete iTransferHandle;	
-	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_DCTRANSFERSERVER_DUP01, "<<<CTransferServer::~CTransferServer");
-	}
-
-
-CTransferServer::CTransferServer()
-     : CPolicyServer(EPriorityHigh,KTransferServerPolicy)
-	{
-	}
-
-void CTransferServer::ConstructL()
-	{
-	iShutdownTimer = new(ELeave) CShutdownTimer;
-	iShutdownTimer->ConstructL(); 
-	
-	iTransferHandle = CTransferHandle::NewL(*this);
-	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_CONSTRUCTL, "CTransferServer::ConstructL");
-	}
-
-
-CSession2* CTransferServer::NewSessionL(const TVersion &aVersion, const RMessage2& aMessage) const
-	{
-	(void)aMessage;//Remove compiler warning
-	(void)aVersion;//Remove compiler warning
-	
-	CTransferServer* ncThis = const_cast<CTransferServer*>(this);
-	
-	CTransferSession* sess = CTransferSession::NewL(ncThis);
-		
-	return sess;
-	}
-
-
-void CTransferServer::Error(TInt aError)
-	{
-	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_ERROR, "CTransferServer::Error");
-	Message().Complete(aError);
-	ReStart();
-	}
-
-void CTransferServer::IncrementSessionCount()
-	{
-	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_INCREMENTSESSIONCOUNT, "CTransferServer::IncrementSessionCount");
-	
-	++iSessionCount;
-	iShutdownTimer->Cancel();
-
-	}
-
-void CTransferServer::DecrementSessionCount()
-	{
-	--iSessionCount;	
-	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_DECREMENTSESSIONCOUNT, "CTransferServer::DecrementSessionCount");
-	if (iSessionCount == 0)
-		{
-		iShutdownTimer->After(KShutdownDelay);
-		OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_DECREMENTSESSIONCOUNT_DUP01, "CTransferServer::DecrementSessionCount1");
-		}
-	}
-
-void CTransferServer::LaunchShutdownTimerIfNoSessions()
-	{
-	if (iSessionCount == 0)
-		iShutdownTimer->After(KShutdownDelay);
-	}
-
-CTransferServer::CShutdownTimer::CShutdownTimer()
-:	CTimer(EPriorityStandard)
-	{
-	CActiveScheduler::Add(this);
-	}
-
-
-void CTransferServer::CShutdownTimer::ConstructL()
-	{
-	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_LAUNCHSHUTDOWNTIMERIFNOSESSIONS, "CTransferServer::CShutdownTimer::ConstructL");
-	CTimer::ConstructL();
-	}
-
-
-void CTransferServer::CShutdownTimer::RunL()
-	{
-	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_LAUNCHSHUTDOWNTIMERIFNOSESSIONS_DUP01, "CShutdownTimer::RunL");
-	CActiveScheduler::Stop();
-	}
-
-
-void CTransferServer::TransferHandleL()
-	{
-	RTranHandleSrv aServer;
-	RChunk* commChunk = NULL;
-	User::LeaveIfError(aServer.Connect());
-	User::LeaveIfError(iPort[0].GetDataTransferChunk(commChunk));
-	User::LeaveIfError(aServer.TransferHandle(iPort[0], *commChunk));	
-	aServer.Close();
-	commChunk->Close();
-	iPort[0].Close();
-	}
-
-void CTransferServer::FillEndpointsResourceAllocation(IFConfigPtr aIfCfg)
-	{
-	
-#ifdef USB_SC
-		TUsbcScInterfaceInfo* iInfoPtr = aIfCfg->iInfoPtr;
-#else
-		TUsbcInterfaceInfo* iInfoPtr = aIfCfg->iInfoPtr;
-#endif
-	
-	//	fill resource allocation info in the endpoint info with resource allocation v2
-	for (TUint8 i = 1; i <= iInfoPtr->iTotalEndpointsUsed; i++)
-		{
-		if (aIfCfg->iEpDMA[i-1])
-			{
-			iInfoPtr->iEndpointData[i-1].iFeatureWord1 |= KUsbcEndpointInfoFeatureWord1_DMA;
-			}
-		else
-			{
-			iInfoPtr->iEndpointData[i-1].iFeatureWord1 &= (~KUsbcEndpointInfoFeatureWord1_DMA);
-			}
-	#ifndef USB_SC
-		if (aIfCfg->iEpDoubleBuff[i-1])
-			{
-			iInfoPtr->iEndpointData[i-1].iFeatureWord1 |= KUsbcEndpointInfoFeatureWord1_DoubleBuffering;
-			}
-		else
-			{
-			iInfoPtr->iEndpointData[i-1].iFeatureWord1 &= (~KUsbcEndpointInfoFeatureWord1_DoubleBuffering);
-			}
-	#endif
-		}	
-	}
-
-
-void CTransferServer::PopulateInterfaceResourceAllocation(IFConfigPtr aFirstIfCfg, TInt aPortNumber)
-	{
-	FillEndpointsResourceAllocation(aFirstIfCfg);
-	
-	IFConfigPtr ifCfgPtr = aFirstIfCfg->iPtrNext;
-	while (ifCfgPtr != NULL)
-		{
-		if (ifCfgPtr->iAlternateSetting)
-			{
-			FillEndpointsResourceAllocation(ifCfgPtr);
-			ifCfgPtr = ifCfgPtr->iPtrNext;
-			}
-		else
-			{
-			ifCfgPtr = NULL;
-			}
-		}
-	}
-
-void CTransferServer::SetupInterface(IFConfigPtr* aIfPtr, TInt aPortNumber)
-	{
-	test.Start (_L("Setup Interface"));
-	
-	// first of all set the default interface	
-	TUSB_PRINT2 ("Set Default Interface with %d endpoints bandwidth 0x%x",(*aIfPtr)->iInfoPtr->iTotalEndpointsUsed,(*aIfPtr)->iBandwidthIn | (*aIfPtr)->iBandwidthOut);
-	OstTraceExt2 (TRACE_NORMAL, CTRANSFERSERVER_SETUPINTERFACE, "Set Default Interface with %d endpoints bandwidth 0x%x",(*aIfPtr)->iInfoPtr->iTotalEndpointsUsed,(*aIfPtr)->iBandwidthIn | (*aIfPtr)->iBandwidthOut);
-#ifdef USB_SC
-	TUsbcScInterfaceInfoBuf ifc = *((*aIfPtr)->iInfoPtr);
-	TInt r = iPort[aPortNumber].SetInterface(0, ifc);
-#else
-	TUsbcInterfaceInfoBuf ifc = *((*aIfPtr)->iInfoPtr);
-	TInt r = iPort[aPortNumber].SetInterface(0, ifc, (*aIfPtr)->iBandwidthIn | (*aIfPtr)->iBandwidthOut);
-#endif
-	test_KErrNone(r);
-
-	TBuf8<KUsbDescSize_Interface> ifDescriptor;
-	r = iPort[aPortNumber].GetInterfaceDescriptor(0, ifDescriptor);
-	test_KErrNone(r);
-
-	// Check the interface descriptor
-	test(ifDescriptor[KIfcDesc_SettingOffset] == 0 && ifDescriptor[KIfcDesc_NumEndpointsOffset] == (*aIfPtr)->iInfoPtr->iTotalEndpointsUsed &&
-		ifDescriptor[KIfcDesc_ClassOffset] == (*aIfPtr)->iInfoPtr->iClass.iClassNum &&
-		ifDescriptor[KIfcDesc_SubClassOffset] == (*aIfPtr)->iInfoPtr->iClass.iSubClassNum &&
-		ifDescriptor[KIfcDesc_ProtocolOffset] == (*aIfPtr)->iInfoPtr->iClass.iProtocolNum);
-
-	if ((*aIfPtr)->iNumber != 0 && ifDescriptor[KIfcDesc_NumberOffset] != (*aIfPtr)->iNumber)
-		{
-		ifDescriptor[KIfcDesc_NumberOffset] = (*aIfPtr)->iNumber;
-		r = iPort[aPortNumber].SetInterfaceDescriptor(0, ifDescriptor); 
-		test_KErrNone(r);
-		}
-	else
-		{
-		(*aIfPtr)->iNumber = ifDescriptor[KIfcDesc_NumberOffset];	
-		}
-	TUint8 interfaceNumber = (*aIfPtr)->iNumber;
-	TUSB_PRINT1 ("Interface Number %d",interfaceNumber);
-	OstTrace1 (TRACE_NORMAL, CTRANSFERSERVER_SETUPINTERFACE_DUP01, "Interface Number %d",interfaceNumber);
-	test.End();
-	}
-
-
-TInt CTransferServer::SetupLdds(TDes& aFileName)
-	{
-	TInt r;
-	User::LeaveIfError(iFs.Connect());
-
-	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_SETUPLDDS, "Configuration");
-	
-	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_SETUPLDDS_DUP01, "Open configuration file");
-	// set the session path to use the ROM if no drive specified
-	r=iFs.SetSessionPath(_L("Z:\\test\\"));
-	test_KErrNone(r);
-
-	r = iConfigFile.Open(iFs, aFileName, EFileShareReadersOnly | EFileStreamText | EFileRead);
-	test_KErrNone(r);
-	OstTraceExt1(TRACE_NORMAL, CTRANSFERSERVER_SETUPLDDS_DUP02, "Configuration file %S Opened successfully", aFileName);
-
-	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_SETUPLDDS_DUP03, "Process configuration file");
-	test(ProcessConfigFile (iConfigFile,NULL,&iLddPtr));
-	
-	iConfigFile.Close();
-	iFs.Close();
-
-	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_SETUPLDDS_DUP04, "LDD in configuration file");
-	test_NotNull(iLddPtr);
-		
-	LDDConfigPtr lddPtr = iLddPtr;
-	TInt nextPort = 0;
-	while (lddPtr != NULL)
-		{
-		// Load logical driver (LDD)
-		// (There's no physical driver (PDD) with USB: it's a kernel extension DLL which
-		//	was already loaded at boot time.)
-		OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_SETUPLDDS_DUP05, "Loading USB LDD");
-		TUSB_PRINT1("Loading USB LDD ",lddPtr->iName.PtrZ());
-		OstTraceExt1(TRACE_NORMAL, CTRANSFERSERVER_SETUPLDDS_DUP06, "Loading USB LDD %s",lddPtr->iName);
-		r = User::LoadLogicalDevice(lddPtr->iName);
-		test(r == KErrNone || r == KErrAlreadyExists);
-	
-		IFConfigPtr ifPtr = lddPtr->iIFPtr;
-		
-		OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_SETUPLDDS_DUP07, "Opening Channels");
-		for (TInt portNumber = nextPort; portNumber < nextPort+lddPtr->iNumChannels; portNumber++)
-			{
-			test_Compare(lddPtr->iNumChannels,>,0);
-			test_Compare(lddPtr->iNumChannels,==,1);
-
-			// Open USB channel
-			r = iPort[portNumber].Open(0);
-			test_KErrNone(r);
-			TUSB_PRINT("Successfully opened USB port");
-			OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_SETUPLDDS_DUP08, "Successfully opened USB port");
-
-			// Query the USB device/Setup the USB interface
-			if (portNumber == nextPort)
-				{
-				// Change some descriptors to contain suitable values
-				//SetupDescriptors(lddPtr, &iPort[portNumber]);
-				}
-				
-
-			test_NotNull(ifPtr);
-			
-			if (iSupportResourceAllocationV2)
-				{
-				PopulateInterfaceResourceAllocation(ifPtr, portNumber);
-				}
-				
-			SetupInterface(&ifPtr,portNumber);
-					
-	#ifdef USB_SC
-//			RChunk *tChunk = &gChunk;
-			test_KErrNone(iPort[portNumber].FinalizeInterface());
-	#endif
-
-			}
-	
-		iTotalChannels += lddPtr->iNumChannels;
-		nextPort += lddPtr->iNumChannels;	
-		lddPtr = lddPtr->iPtrNext;	
-		}
-		
-	TUSB_PRINT("All Interfaces and Alternate Settings successfully set up");
-	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_SETUPLDDS_DUP09, "All Interfaces and Alternate Settings successfully set up");
-	
-	iTransferHandle->StartTimer();
-
-	return KErrNone;
-	}
-
-void CTransferServer::QueryUsbClientL(LDDConfigPtr aLddPtr, RDEVCLIENT* aPort)
-	{
-	test.Start(_L("Query device and Endpoint Capabilities"));
-
-
-	TUsbDeviceCaps d_caps;
-	TInt r = aPort->DeviceCaps(d_caps);
-	test_KErrNone(r);
-
-	const TInt n = d_caps().iTotalEndpoints;
-
-	TUSB_PRINT("###  USB device capabilities:");
-	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL, "###  USB device capabilities:");
-	TUSB_PRINT1("Number of endpoints:				 %d", n);
-	OstTrace1(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL_DUP01, "Number of endpoints:     %d", n);
-	TUSB_PRINT1("Supports Software-Connect: 		 %s",
-				d_caps().iConnect ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL_DUP02, "Supports Software-Connect:     %s",
-				d_caps().iConnect ? _L("yes") : _L("no"));
-	TUSB_PRINT1("Device is Self-Powered:			 %s",
-				d_caps().iConnect ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL_DUP03, "Device is Self-Powered:    %s",
-				d_caps().iSelfPowered ? _L("yes") : _L("no"));
-	TUSB_PRINT1("Supports Remote-Wakeup:			 %s",
-				d_caps().iConnect ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL_DUP04, "Supports Remote-Wakeup:    %s",
-				d_caps().iRemoteWakeup ? _L("yes") : _L("no"));
-	TUSB_PRINT1("Supports High-speed:				 %s",
-				d_caps().iConnect ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL_DUP05, "Supports High-speed:       %s",
-				d_caps().iHighSpeed ? _L("yes") : _L("no"));
-	TUSB_PRINT1("Supports unpowered cable detection: %s\n",
-				d_caps().iConnect ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL_DUP06, "Supports unpowered cable detection: %s\n",
-				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ?
-				_L("yes") : _L("no"));
-	TUSB_PRINT1("Supports endpoint resource allocation v2 scheme: %s\n",
-				d_caps().iConnect ? _S("yes") : _S("no"));
-	OstTraceExt1(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL_DUP07, "Supports endpoint resource allocation v2 scheme: %s\n",
-				(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) ?
-				_L("yes") : _L("no"));					
-	TUSB_PRINT("");
-	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL_DUP08, "");
-
-	iSoftwareConnect = d_caps().iConnect;					// we need to remember this
-	test_Equal(aLddPtr->iSoftConnect,iSoftwareConnect);
-
-	iSupportResourceAllocationV2 = ((d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) != 0);
-	
-	// only check capabilities if set; therefore allowing them to be disabled
-	if (aLddPtr->iSelfPower)
-		{
-		test(d_caps().iSelfPowered);	
-		}
-	
-	// only check capabilities if set; therefore allowing them to be disabled
-	if (aLddPtr->iRemoteWakeup)
-		{
-		test(d_caps().iRemoteWakeup);		
-		}
-
-	test_Equal(d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower,aLddPtr->iFeatures);
-
-	// only check capability if set; therefore allowing it to be disabled
-	if (aLddPtr->iHighSpeed)
-		{
-		test(d_caps().iHighSpeed);		
-		}
-	
-	test_Equal(aLddPtr->iNumEndpoints,n);
-
-	// Endpoints
-	TUsbcEndpointData data[KUsbcMaxEndpoints];
-	TPtr8 dataptr(reinterpret_cast<TUint8*>(data), sizeof(data), sizeof(data));
-	r = aPort->EndpointCaps(dataptr);
-	test_KErrNone(r);
-
-	TUSB_PRINT("### USB device endpoint capabilities:");
-	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL_DUP09, "### USB device endpoint capabilities:");
-	for (TInt i = 0; i < n; i++)
-		{
-		const TUsbcEndpointCaps* caps = &data[i].iCaps;
-		
-		
-		TBuf<40> sizeStr(_S("unknown"));
-		if (caps->iSizes == KUsbEpNotAvailable)
-			{
-			sizeStr = _S("Not Available");	
-			}		
-		else
-			{
-			sizeStr.SetLength(0);
-			if (caps->iSizes & KUsbEpSizeCont)
-				sizeStr.Append(_S(" Continuous"),11);
-			if (caps->iSizes & KUsbEpSize8)
-				sizeStr.Append(_S(" 8"),2);
-			if (caps->iSizes & KUsbEpSize16)
-				sizeStr.Append(_S(" 16"),3);
-			if (caps->iSizes & KUsbEpSize32)
-				sizeStr.Append(_S(" 32"),3);
-			if (caps->iSizes & KUsbEpSize64)
-				sizeStr.Append(_S(" 64"),3);
-			if (caps->iSizes & KUsbEpSize128)
-				sizeStr.Append(_S(" 128"),4);
-			if (caps->iSizes & KUsbEpSize256)
-				sizeStr.Append(_S(" 256"),4);
-			if (caps->iSizes & KUsbEpSize512)
-				sizeStr.Append(_S(" 512"),4);
-			if (caps->iSizes & KUsbEpSize1023)
-				sizeStr.Append(_S(" 1023"),5);
-			if (caps->iSizes & KUsbEpSize1024)
-				sizeStr.Append(_S(" 1024"),5);
-			}
-
-		TBuf<40> typeStr(_S("unknown"));
-		if (caps->iTypesAndDir == KUsbEpNotAvailable)
-			typeStr = _S("Not Available");
-		if (caps->iTypesAndDir & (KUsbEpTypeControl | KUsbEpTypeBulk | KUsbEpTypeInterrupt | KUsbEpTypeIsochronous))
-			{
-			typeStr.SetLength(0);
-			if (caps->iTypesAndDir & KUsbEpTypeBulk)
-				typeStr.Append(_S("Control "),8);
-			if (caps->iTypesAndDir & KUsbEpTypeBulk)
-				typeStr.Append(_S("Bulk "),5);
-			if (caps->iTypesAndDir & KUsbEpTypeInterrupt)
-				typeStr.Append(_S("Interrupt "),10);
-			if (caps->iTypesAndDir & KUsbEpTypeIsochronous)
-				typeStr.Append(_S("Isochronous"),11);			
-			}
-			
-		TBuf<20> directionStr(_S("unknown"));
-		
-		if (caps->iTypesAndDir & KUsbEpDirIn)
-			directionStr = _S("In");
-		if (caps->iTypesAndDir & KUsbEpDirOut)
-			directionStr = _S("Out");
-		if (caps->iTypesAndDir & KUsbEpDirBidirect)
-			directionStr = _S("Both");
-				
-		TUSB_PRINT4("Endpoint:%d Sizes =%s Type = %s - %s",
-			i+1,sizeStr.PtrZ(), typeStr.PtrZ(), directionStr.PtrZ());
-		OstTraceExt4(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL_DUP10, "Endpoint:%d Sizes =%S Type = %S - %S",
-					i+1,sizeStr, typeStr, directionStr);
-		}
-	TUSB_PRINT("");
-	OstTrace0(TRACE_NORMAL, CTRANSFERSERVER_QUERYUSBCLIENTL_DUP11, "");
-
-	test.End();
-			
-	}
-
--- a/kerneltest/e32test/usb/t_usb_device/src/transfersession.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/*
-* Copyright (c) 1997-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"
-* 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 Session of a Symbian OS server for the RUsb API
-*
-*/
-
-/**
- @file
-*/
-
-#define __E32TEST_EXTENSION__
-
-#include <e32test.h>
-#include <usb.h>
-#include "transfersession.h"
-#include "transferserver.h"
-#include "transfersrv.h"
-#include "tranhandlesrv.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "transfersessionTraces.h"
-#endif
-
-
-CTransferSession* CTransferSession::NewL(CTransferServer* aServer)
-	{
-	return (new (ELeave) CTransferSession(aServer));
-	}
-
-
-CTransferSession::CTransferSession(CTransferServer* aServer)
-	: iTransferServer(aServer)
-	{
-	iTransferServer->IncrementSessionCount();
-	}
-
-
-CTransferSession::~CTransferSession()
-	{
-	TUSB_PRINT("CTransferSession::~CTransferSession");
-	OstTrace0(TRACE_NORMAL, CTRANSFERSESSION_DCTRANSFERSESSION, "CTransferSession::~CTransferSession");
-	iTransferServer->DecrementSessionCount();
-	TUSB_PRINT("<<CTransferSession::~CTransferSession");
-	OstTrace0(TRACE_NORMAL, CTRANSFERSESSION_DCTRANSFERSESSION_DUP01, "<<CTransferSession::~CTransferSession");
-	}
-
-
-void CTransferSession::ServiceL(const RMessage2& aMessage)
-	{
-	DispatchMessageL(aMessage);
-	}
-
-void CTransferSession::CreateL()
-	{
-	}
-
-void CTransferSession::DispatchMessageL(const RMessage2& aMessage)
-	{
-	TInt ret = KErrNone;
-	TName string;
-
-	switch (aMessage.Function())
-		{
-	case ESetConfigFileName:
-		ret = aMessage.Read(0, string);
-		if (ret != KErrNone)
-			break;
-		ret = iTransferServer->SetupLdds(string);
-		break;
-
-	default:
-		ret = KErrNotSupported;
-		break;
-		}
-
-	aMessage.Complete(ret);
-	}
-
--- a/kerneltest/e32test/usb/t_usb_device/src/transfersrv.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +0,0 @@
-/*
-* 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"
-* 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
-*/
-
-#include <e32base.h>
-#include <e32test.h>
-#include <usb.h>
-#include "transfersrv.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "transfersrvTraces.h"
-#endif
-
-_LIT(KUsbmanImg, "z:\\system\\programs\\t_usb_transfersrv.exe");
-
-
-static TInt StartServer()
-//
-// Start the server process or thread
-//
-	{
-	const TUidType serverUid(KNullUid, KNullUid, KTransferSvrUid);
-	OstTrace0(TRACE_NORMAL, STARTSERVER_STARTSERVER, "StartServer1");
-
-	RProcess server;
-	TInt err = server.Create(KUsbmanImg, KNullDesC, serverUid);
-	OstTrace1(TRACE_NORMAL, STARTSERVER_STARTSERVER_DUP01, "StartServer2 %d", err);
-	
-	if (err != KErrNone)
-		{
-		return err;
-		}
-	OstTrace0(TRACE_NORMAL, STARTSERVER_STARTSERVER_DUP02, "StartServer3");
-
-	TRequestStatus stat;
-	server.Rendezvous(stat);
-	
-	if (stat!=KRequestPending)
-		server.Kill(0);		// abort startup
-	else
-		server.Resume();	// logon OK - start the server
-	OstTrace0(TRACE_NORMAL, STARTSERVER_STARTSERVER_DUP03, "StartServer4");
-
-	User::WaitForRequest(stat);		// wait for start or death
-
-	// we can't use the 'exit reason' if the server panicked as this
-	// is the panic 'reason' and may be '0' which cannot be distinguished
-	// from KErrNone
-	err = (server.ExitType() == EExitPanic) ? KErrServerTerminated : stat.Int();
-	OstTrace0(TRACE_NORMAL, STARTSERVER_STARTSERVER_DUP04, "StartServer5");
-
-	//server.Close();
-	
-	OstTrace0(TRACE_NORMAL, STARTSERVER_STARTSERVER_DUP05, "transfer server started successfully: \n");
-
-	return err;
-	}
-
-
-
-/** Constructor */
-EXPORT_C RTransferSrv::RTransferSrv()
-    {
-    }
-
-/** Destructor */
-EXPORT_C RTransferSrv::~RTransferSrv()
-    {
-    }
-
-EXPORT_C TVersion RTransferSrv::Version() const
-    {
-    return TVersion(    KTransferSrvMajorVersionNumber,
-                        KTransferSrvMinorVersionNumber,
-                        KTransferSrvBuildVersionNumber
-                    );
-    }
-
-EXPORT_C TInt RTransferSrv::Connect()
-    {
-	TInt retry = 2;
-	
-	OstTrace0(TRACE_NORMAL, RTRANSFERSRV_CONNECT, "Connect1");
-	FOREVER
-		{
-		TInt err = CreateSession(KTransferServerName, Version(), 10);
-		OstTrace0(TRACE_NORMAL, RTRANSFERSRV_CONNECT_DUP01, "Connect2");
-
-		if ((err != KErrNotFound) && (err != KErrServerTerminated))
-			{
-			return err;
-			}
-		OstTrace0(TRACE_NORMAL, RTRANSFERSRV_CONNECT_DUP02, "Connect3");
-
-		if (--retry == 0)
-			{
-			return err;
-			}
-		OstTrace0(TRACE_NORMAL, RTRANSFERSRV_CONNECT_DUP03, "Connect4");
-
-		err = StartServer();
-
-		if ((err != KErrNone) && (err != KErrAlreadyExists))
-			{
-			return err;
-			}
-		
-		OstTrace0(TRACE_NORMAL, RTRANSFERSRV_CONNECT_DUP04, "Connect5");
-		}
-    }
-
-EXPORT_C TInt RTransferSrv::SetConfigFileName(TDes& aString)
-	{
-	
-	OstTrace0(TRACE_NORMAL, RTRANSFERSRV_SETCONFIGFILENAME, "SetConfigFileName");
-	return SendReceive(ESetConfigFileName, TIpcArgs(&aString));
-	}
-
--- a/kerneltest/e32test/usb/t_usb_device/src/transfersrvmain.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
-* Copyright (c) 2003-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"
-* 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 <e32test.h>
-#include "transfersrv.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "transfersrvmainTraces.h"
-#endif
-#include "transferserver.h"
-
-static void RunServerL();
-
-
-RTest test(_L("T_USB_TRANSFER"));
-
-
-GLDEF_C TInt E32Main()
-	{
-	__UHEAP_MARK;
-
-	CTrapCleanup* cleanup = CTrapCleanup::New();
-
-	TInt ret = KErrNoMemory;
-
-	if (cleanup)
-		{
-		TRAP(ret, RunServerL());
-		delete cleanup;
-		}
-
-	__UHEAP_MARKEND;
-
-	return ret;
-	}
-
-static void RunServerL()
-//
-// Perform all server initialisation, in particular creation of the
-// scheduler and server and then run the scheduler
-//
-	{
-	test.Start(_L("transfer handle"));
-
-	// naming the server thread after the server helps to debug panics
-	User::LeaveIfError(User::RenameThread(KTransferServerName));
-	//
-	// create and install the active scheduler we need
-	CActiveScheduler* scheduler = new(ELeave) CActiveScheduler;
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install(scheduler);
-	//
-	// create the server (leave it on the cleanup stack)
-	CTransferServer* server = CTransferServer::NewLC();
-	//
-	RProcess::Rendezvous(KErrNone);
-
-	//
-	// Ready to run
-	OstTrace0(TRACE_NORMAL, RUNSERVERL_RUNSERVERL, ">>>CActiveScheduler::Start");
-	CActiveScheduler::Start();
-	OstTrace0(TRACE_NORMAL, RUNSERVERL_RUNSERVERL_DUP01, "<<<CActiveScheduler::Start");
-	test.End();
-	test.Close();
-
-	//
-	// Cleanup the server and scheduler
-	OstTrace0(TRACE_NORMAL, RUNSERVERL_RUNSERVERL_DUP02, "tranfermain exit 1");
-	CleanupStack::PopAndDestroy(2, scheduler);
-	OstTrace0(TRACE_NORMAL, RUNSERVERL_RUNSERVERL_DUP03, "tranfermain exit 2");
-	}
-
-//
-// End of file
--- a/kerneltest/e32test/usb/t_usb_device/src/usbms.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usb/t_usb_device/src/usbms.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -12,7 +12,7 @@
 //
 // Description:
 // USB Mass Storage Application
-//
+// 
 //
 
 /**
@@ -27,11 +27,6 @@
 #include <massstorage.h>
 
 #include "usbms.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "usbmsTraces.h"
-#endif
-
 
 extern CActiveControl* gActiveControl;
 extern RTest test;
@@ -80,10 +75,10 @@
     CFileSystemDescriptor* pSelf = new (ELeave) CFileSystemDescriptor;
 
     CleanupStack::PushL(pSelf);
-
+    
     pSelf->iFsName.CreateMaxL(aFsName.Length());
     pSelf->iFsName.Copy(aFsName);
-
+    
     pSelf->iPrimaryExtName.CreateMaxL(aPrimaryExtName.Length());
     pSelf->iPrimaryExtName.Copy(aPrimaryExtName);
 
@@ -96,7 +91,7 @@
 
 //-----------------------------------------------------------------------------
 /**
-    Dismounts the originally mounted FS and optional primary extension from the drive and stores
+    Dismounts the originally mounted FS and optional primary extension from the drive and stores 
     this information in the FS descriptor
 
     @return on success returns a pointer to the instantinated FS descriptor
@@ -109,7 +104,6 @@
     TBool       bDrvSync = EFalse;
 
     test.Printf(_L("DoDismountOrginalFS drv:%d\n"), aDrive);
-    OstTrace1(TRACE_NORMAL, CFILESYSTEMDESCRIPTOR_NEWL, "DoDismountOrginalFS drv:%d\n", aDrive);
 
     //-- 1. get file system name
     nRes = aFs.FileSystemName(fsName, aDrive);
@@ -130,25 +124,23 @@
     //-- other extensions (non-primary) are not supported yet
     nRes = aFs.ExtensionName(primaryExtName, aDrive, 0);
     if(nRes != KErrNone)
-        {
+        {   
         primaryExtName.SetLength(0);
         }
 
     //-- 3.1 check if the drive has non-primary extensions, fail in this case, because this FS can't be mounted back normally
     nRes = aFs.ExtensionName(primaryExtName, aDrive, 1);
     if(nRes == KErrNone)
-        {
+        {   
         test.Printf(_L("DoDismountOrginalFS Non-primary extensions are not supported!\n"));
-        OstTrace0(TRACE_NORMAL, CFILESYSTEMDESCRIPTOR_NEWL_DUP01, "DoDismountOrginalFS Non-primary extensions are not supported!\n");
         return NULL;
         }
 
     test.Printf(_L("DoDismountOrginalFS FS:%S, Prim ext:%S, synch:%d\n"), &fsName, &primaryExtName, bDrvSync);
-    OstTraceExt3(TRACE_NORMAL, CFILESYSTEMDESCRIPTOR_NEWL_DUP02, "DoDismountOrginalFS FS:%S, Prim ext:%S, synch:%d\n", fsName, primaryExtName, bDrvSync);
 
     //-- create FS descriptor and dismount the FS
-    CFileSystemDescriptor* pFsDesc = NULL;
-
+    CFileSystemDescriptor* pFsDesc = NULL; 
+    
     TRAP(nRes, pFsDesc = CFileSystemDescriptor::NewL(fsName, primaryExtName, bDrvSync));
     if(nRes != KErrNone)
         return NULL; //-- OOM ?
@@ -159,9 +151,8 @@
         delete pFsDesc;
         pFsDesc = NULL;
         test.Printf(_L("DoDismountOrginalFS Dismounting Err:%d\n"), nRes);
-        OstTrace1(TRACE_NORMAL, CFILESYSTEMDESCRIPTOR_NEWL_DUP03, "DoDismountOrginalFS Dismounting Err:%d\n", nRes);
         }
-
+    
     return pFsDesc;
 }
 
@@ -175,7 +166,6 @@
     TInt nRes;
 
     test.Printf(_L("DoRestoreFS drv:%d\n"), aDrive);
-    OstTrace1(TRACE_NORMAL, DORESTOREFS_DORESTOREFS, "DoRestoreFS drv:%d\n", aDrive);
 
     //-- 1. check that there is no FS installed
     TBuf<128>   fsName;
@@ -183,14 +173,12 @@
     if(nRes == KErrNone)
         {//-- there is a file system already installed
 		test.Printf(_L("DoRestoreFS This drive already has FS intalled:%S \n"), &fsName);
-		OstTraceExt1(TRACE_NORMAL, DORESTOREFS_DORESTOREFS_DUP01, "DoRestoreFS This drive already has FS intalled:%S \n", fsName);
         return KErrAlreadyExists;
         }
-
+ 
     TPtrC ptrN  (apFsDesc->FsName());
     TPtrC ptrExt(apFsDesc->PrimaryExtName());
     test.Printf(_L("DoRestoreFS Mounting FS:%S, Prim ext:%S, synch:%d\n"), &ptrN, &ptrExt, apFsDesc->DriveIsSynch());
-    OstTraceExt3(TRACE_NORMAL, DORESTOREFS_DORESTOREFS_DUP02, "DoRestoreFS Mounting FS:%S, Prim ext:%S, synch:%d\n", ptrN, ptrExt, apFsDesc->DriveIsSynch());
 
     if(ptrExt.Length() >0)
         {//-- there is a primary extension to be mounted
@@ -209,8 +197,7 @@
 
     if(nRes != KErrNone)
         {
-        test.Printf(_L("DoRestoreFS Mount failed! code:%d\n"),nRes);
-        OstTrace1(TRACE_NORMAL, DORESTOREFS_DORESTOREFS_DUP03, "DoRestoreFS Mount failed! code:%d\n",nRes);
+        test.Printf(_L("DoRestoreFS Mount failed! code:%d\n"),nRes);    
         }
 
     return nRes;
@@ -223,8 +210,7 @@
 */
 LOCAL_C void MountMsFs(TInt driveNumber)
 	{
-	test.Printf(_L("MountMsFs driveNumber=%d\n"), driveNumber);
-	OstTrace1(TRACE_NORMAL, MOUNTMSFS_MOUNTMSFS, "MountMsFs driveNumber=%d\n", driveNumber);
+	test.Printf(_L("MountMsFs driveNumber=%d\n"), driveNumber); 
 
     //-- 1. try dismounting the original FS
     CFileSystemDescriptor* fsDesc = DoDismountOrginalFS(fs, driveNumber);
@@ -234,19 +220,16 @@
         {
         TPtrC ptrN(fsDesc->FsName());
         test.Printf(_L("drv:%d FS:%S Dismounted OK\n"),driveNumber, &ptrN);
-        OstTraceExt2(TRACE_NORMAL, MOUNTMSFS_MOUNTMSFS_DUP01, "drv:%d FS:%S Dismounted OK\n",driveNumber, ptrN);
         }
     else
         {
         test.Printf(_L("drv:%d Dismount FS Failed!\n"),driveNumber);
-        OstTrace1(TRACE_NORMAL, MOUNTMSFS_MOUNTMSFS_DUP02, "drv:%d Dismount FS Failed!\n",driveNumber);
         }
 
     //-- 2. try to mount the "MSFS"
     TInt error;
     error = fs.MountFileSystem(KMsFs, driveNumber);
 	test.Printf(_L("MSFS Mount:   %S (%d)\n"), (error?&KError:&KOk), error);
-	OstTraceExt2(TRACE_NORMAL, MOUNTMSFS_MOUNTMSFS_DUP03, "MSFS Mount:   %S (%d)\n", (error?KError():KOk()), error);
 	if (!error)
 		msfsMountedList[driveNumber] = ETrue;
 
@@ -254,7 +237,7 @@
 
 //-----------------------------------------------------------------------------
 /**
-    Dismount MsFS and mount the original FS
+    Dismount MsFS and mount the original FS 
 */
 LOCAL_C TInt RestoreMount(TInt driveNumber)
 	{
@@ -265,7 +248,6 @@
 		{
 		err = fs.DismountFileSystem(KMsFs, driveNumber);
 		test.Printf(_L("MSFS Dismount:%S (%d)\n"), (err?&KError:&KOk), err);
-		OstTraceExt2(TRACE_NORMAL, RESTOREMOUNT_RESTOREMOUNT, "MSFS Dismount:%S (%d)\n", (err?KError():KOk()), err);
 		if (err)
 			return err;
 
@@ -280,7 +262,7 @@
 
         TPtrC ptrN(fsDesc->FsName());
         test.Printf(_L("%S Mount:    %S (%d)\n"), &ptrN, (err?&KError:&KOk), err);
-        OstTraceExt3(TRACE_NORMAL, RESTOREMOUNT_RESTOREMOUNT_DUP01, "%S Mount:    %S (%d)\n", ptrN, (err?KError():KOk()), err);
+        
         delete fsDesc;
         unmountedFsList[driveNumber] = NULL;
         }
@@ -352,8 +334,8 @@
 	}
 
 CUsbWatch::CUsbWatch(RUsb& aUsb)
-	:
-	CActive(0),
+	: 
+	CActive(0), 
 	iUsb(aUsb),
 	iUsbDeviceState(EUsbcDeviceStateUndefined),
 	iWasConfigured(EFalse)
@@ -388,7 +370,7 @@
 	fs.DriveToChar(driveNumber, driveLetter);
 	return driveLetter;
 	}
-
+	
 static TBool IsDriveInMountList(TUint driveLetter)
 	{
 	TUint16 driveLetter16 = static_cast<TUint16>(driveLetter);
@@ -404,44 +386,36 @@
 			{
 			case EUsbcDeviceStateUndefined : 					// 0
 				test.Printf(_L(">> CUSBWatch:Undefined %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured);
-				OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL, ">> CUSBWatch:Undefined %S\n", iWasConfigured ? KConfigured() : KNotConfigured());
 				break;
-
+			
 			case EUsbcDeviceStateAttached :						// 1
 				test.Printf(_L(">> CUSBWatch:Attached %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured);
-				OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL_DUP01, ">> CUSBWatch:Attached %S\n", iWasConfigured ? KConfigured() : KNotConfigured());
 				break;
-
+			
 			case EUsbcDeviceStatePowered :						// 2
 				test.Printf(_L(">> CUSBWatch:Powered %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured);
-				OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL_DUP02, ">> CUSBWatch:Powered %S\n", iWasConfigured ? KConfigured() : KNotConfigured());
 				break;
-
+	
 			case EUsbcDeviceStateDefault :						// 3
 				test.Printf(_L(">> CUSBWatch:Default %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured);
-				OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL_DUP03, ">> CUSBWatch:Default %S\n", iWasConfigured ? KConfigured() : KNotConfigured());
 				break;
-
+			
 			case EUsbcDeviceStateAddress :						// 4
 				test.Printf(_L(">> CUSBWatch:Address %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured);
-				OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL_DUP04, ">> CUSBWatch:Address %S\n", iWasConfigured ? KConfigured() : KNotConfigured());
 				break;
-
+			
 			case EUsbcDeviceStateConfigured :					// 5
 				test.Printf(_L(">> CUSBWatch:Configured %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured);
-				OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL_DUP05, ">> CUSBWatch:Configured %S\n", iWasConfigured ? KConfigured() : KNotConfigured());
 				break;
-
+			
 			case EUsbcDeviceStateSuspended : 					// 6
 				test.Printf(_L(">> CUSBWatch:Suspended %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured);
-				OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL_DUP06, ">> CUSBWatch:Suspended %S\n", iWasConfigured ? KConfigured() : KNotConfigured());
 				break;
-
+			
 			default :
 				test.Printf(_L(">> CUSBWatch:UNKNOWN %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured);
-				OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL_DUP07, ">> CUSBWatch:UNKNOWN %S\n", iWasConfigured ? KConfigured() : KNotConfigured());
 				break;
-
+		
 			}
 		}
 	iUsb.AlternateDeviceStatusNotify(iStatus, iUsbDeviceState);
@@ -454,7 +428,7 @@
 			{
 			if(IsDriveConnected(i))
 				{
-				OstTrace0(TRACE_NORMAL, CUSBWATCH_RUNL_DUP08, "CUsbWatch calling RestoreMount");
+				RDebug::Print(_L("CUsbWatch calling RestoreMount"));
 				RestoreMount(PropertyHandlers::allDrivesStatus[2*i]);
 				}
 			}
@@ -464,7 +438,7 @@
 
 	// If cable is connected, mount all drives in the auto-mount list.
 	// This is done for performance, since if this is not done here,
-	// mounting will happen later after each drive enters the
+	// mounting will happen later after each drive enters the 
 	// Connecting state.
 	if(iUsbDeviceState == EUsbcDeviceStateConfigured)
 		{
@@ -473,7 +447,7 @@
 			TInt driveNumber = PropertyHandlers::allDrivesStatus[2*i];
 			if(!IsDriveConnected(i) && IsDriveInMountList(DriveNumberToLetter(driveNumber)))
 				{
-				OstTrace0(TRACE_NORMAL, CUSBWATCH_RUNL_DUP09, "CUsbWatch calling MountMsFs");
+				RDebug::Print(_L("CUsbWatch calling MountMsFs"));
 				MountMsFs(driveNumber);
 				}
 			}
@@ -512,9 +486,7 @@
 			{
 			if (gVerbose)
 				{
-				test.Printf(KBytesTransferredFmt,
-						(char)DriveNumberToLetter(allDrivesStatus[2*i]), iKBytesRead[i], iKBytesWritten[i]);
-				OstTraceExt3(TRACE_NORMAL, PROPERTYHANDLERS_TRANSFERRED, "%c:%d/%d \n",
+				test.Printf(KBytesTransferredFmt, 
 						(char)DriveNumberToLetter(allDrivesStatus[2*i]), iKBytesRead[i], iKBytesWritten[i]);
 				}
 			}
@@ -522,16 +494,14 @@
 	else
 		{
 		test.Printf(KErrFmt, err);
-		OstTrace1(TRACE_NORMAL, PROPERTYHANDLERS_TRANSFERRED_DUP01, "Error: %d\r", err);
 		}
 	}
-
+	
 void PropertyHandlers::DriveStatus(RProperty& aProperty)
 	{
 	if (gVerbose)
 		{
 		test.Printf(_L(">> PropertyHandlers::DriveStatus"));
-		OstTrace0(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS, ">> PropertyHandlers::DriveStatus");
 		}
 	TInt err = aProperty.Get(allDrivesStatus);
 	if(err == KErrNone)
@@ -539,7 +509,6 @@
 		if (gVerbose)
 			{
 			test.Printf(_L(" Status:  "));
-			OstTrace0(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP01, " Status:  ");
 			}
 		for(TInt i = 0; i < allDrivesStatus.Length()/2; i++)
 			{
@@ -554,61 +523,51 @@
 					case EUsbMsDriveState_Disconnected:
 						{
 						test.Printf(_L("%c:%d:Disconnected\n"), (char)driveLetter, driveStatus);
-						OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP02, "%c:%d:Disconnected\n", (char)driveLetter, driveStatus);
 						break;
 						}
 					case EUsbMsDriveState_Connecting:
 						{
 						test.Printf(_L("%c:%d:Connecting\n"), (char)driveLetter, driveStatus);
-						OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP03, "%c:%d:Connecting\n", (char)driveLetter, driveStatus);
 						break;
 						}
 					case EUsbMsDriveState_Connected:
 						{
 						test.Printf(_L("%c:%d:Connected\n"), (char)driveLetter, driveStatus);
-						OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP04, "%c:%d:Connected\n", (char)driveLetter, driveStatus);
 						break;
 						}
 					case EUsbMsDriveState_Disconnecting:
 						{
 						test.Printf(_L("%c:%d:Disconnecting\n"), (char)driveLetter, driveStatus);
-						OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP05, "%c:%d:Disconnecting\n", (char)driveLetter, driveStatus);
 						break;
 						}
 					case EUsbMsDriveState_Active:
 						{
 						test.Printf(_L("%c:%d:Active\n"), (char)driveLetter, driveStatus);
-						OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP06, "%c:%d:Active\n", (char)driveLetter, driveStatus);
 						break;
 						}
 					case EUsbMsDriveState_Locked:
 						{
 						test.Printf(_L("%c:%d:Locked\n"), (char)driveLetter, driveStatus);
-						OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP07, "%c:%d:Locked\n", (char)driveLetter, driveStatus);
 						break;
 						}
 					case EUsbMsDriveState_MediaNotPresent:
 						{
 						test.Printf(_L("%c:%d:Not Present\n"), (char)driveLetter, driveStatus);
-						OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP08, "%c:%d:Not Present\n", (char)driveLetter, driveStatus);
 						break;
 						}
 					case EUsbMsDriveState_Removed:
 						{
 						test.Printf(_L("%c:%d:Removed\n"), (char)driveLetter, driveStatus);
-						OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP09, "%c:%d:Removed\n", (char)driveLetter, driveStatus);
 						break;
 						}
 					case EUsbMsDriveState_Error:
 						{
 						test.Printf(_L("%c:%d:Error\n"), (char)driveLetter, driveStatus);
-						OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP10, "%c:%d:Error\n", (char)driveLetter, driveStatus);
 						break;
 						}
 					default :
 						{
 						test.Printf(_L("%c:%d:Unknown\n"), (char)driveLetter, driveStatus);
-						OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP11, "%c:%d:Unknown\n", (char)driveLetter, driveStatus);
 						break;
 						}
 					}
@@ -616,11 +575,11 @@
 
 			if (driveStatus == EUsbMsDriveState_Connected)
 				{
-				gActiveControl->SetMSFinished(EFalse);
+				gActiveControl->SetMSFinished(EFalse);				
 				}
 			if (driveStatus == EUsbMsDriveState_Disconnected)
 				{
-				gActiveControl->SetMSFinished(ETrue);
+				gActiveControl->SetMSFinished(ETrue);				
 				}
 			if(IsDriveInMountList(driveLetter))
 				{
@@ -632,13 +591,20 @@
 					{
 					RestoreMount(driveNumber);
 					}
-    			}
+				else
+					{
+					//RDebug::Print(_L("PropertyHandlers::DriveStatus: nothing to do"));
+					}
+				}
+			else
+				{
+				//RDebug::Print(_L("PropertyHandlers::DriveStatus: %c: is not in mountList\n"), driveLetter);
+				}
 			}
 		}
 	else
 		{
 		test.Printf(KErrFmt, err);
-		OstTrace1(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP14, "Error: %d\r", err);
 		}
 
 	}
@@ -652,7 +618,6 @@
 		}
 
 	test.Printf(_L("Media Error %x\n"), iMediaError);
-	OstTrace1(TRACE_NORMAL, PROPERTYHANDLERS_MEDIAERROR, "Media Error %x\n", iMediaError);
 	if (iMediaError > 0)
 		{
 		gActiveControl->SetMSFinished(ETrue);
@@ -704,11 +669,11 @@
 
 	test.End();
 	}
-
+	
 void StopMassStorage(RDEVCLIENT* aPort)
 	{
     TInt r = KErrUnknown;
-
+	
 	test.Start (_L("Stop Mass Storage"));
 
 	r = UsbMs.Stop();
@@ -730,15 +695,15 @@
 	test_KErrNone (r);
 
 	fs.Close();
-
+	
 	delete usbWatch;
 	for (TUint i =0; i < KNumPropWatch; i++)
 		{
 		delete propWatch[i];
 		}
-
+	
 	aPort->Close();
-
+		
 	test.End();
 	}
 
--- a/kerneltest/e32test/usbho/t_otgdi/group/t_otgdi.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/group/t_otgdi.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,7 +1,7 @@
 // t_otgdi.mmp
 //
 
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -78,7 +78,6 @@
 
 // include files
 USERINCLUDE     ../inc
-USERINCLUDE     ../traces_t_otgdi
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 
--- a/kerneltest/e32test/usbho/t_otgdi/group/t_otgdi_fdfactor.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/group/t_otgdi_fdfactor.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,7 +1,7 @@
 // t_otgdi_fdfactor.mmp
 //
 
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -33,7 +33,6 @@
 
 // include files
 USERINCLUDE     ../inc
-USERINCLUDE     ../traces_t_otgdi_fdfactor
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 
--- a/kerneltest/e32test/usbho/t_otgdi/inc/b2bwatchers.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/inc/b2bwatchers.h	Wed Sep 01 12:34:56 2010 +0100
@@ -208,9 +208,9 @@
 class CNotifyWatcherBase : public CActive
 	{
 public:
-	virtual ~CNotifyWatcherBase() {  };
+	virtual ~CNotifyWatcherBase() {LOG_FUNC  };
 	
-	virtual void StartWatching(TInt aInterval) {  TInt n(aInterval); IssueAgain(); SetActive(); };
+	virtual void StartWatching(TInt aInterval) {LOG_FUNC  TInt n(aInterval); IssueAgain(); SetActive(); };
 	// getter
 	TWatcherNotifyType GetType() {return(iWatchType);};		
 	
@@ -248,16 +248,16 @@
 										const TWatcherNotifyType aWatchType, 
 										COtgRoot &aOtgRoot);
 		void ConstructL();
-		virtual ~COtgWatchdogWatcher() {Cancel();};
+		virtual ~COtgWatchdogWatcher() {LOG_FUNC ;Cancel();};
 		
 		void StartTimer(TInt aIntervalMs);
 		void StartWatching(TInt aIntervalMs) {StartTimer(aIntervalMs); };
 		
  
 		
-		TInt IssueAgain() { ASSERT(0); return(0);};
-		void DoCancel() {iTimer.Cancel();};
-		void DisplayEvent() {ASSERT(0); }; // should never fire this
+		TInt IssueAgain() { LOG_FUNC ASSERT(0); return(0);};
+		void DoCancel() {LOG_FUNC ;iTimer.Cancel();};
+		void DisplayEvent() {LOG_FUNC ASSERT(0); }; // should never fire this
 	TInt GetEventValue() {return(iIntervalMs);};
 	void StepExpired(TInt aInterval);		
 	
@@ -285,14 +285,14 @@
 	static COtgStateWatcher* NewL(MOtgNotificationHandler &wdHandler, const TWatcherNotifyType aWatchType, COtgRoot &aOtgRoot);
 	void ConstructL() {};
 	
-	virtual ~COtgStateWatcher() { Cancel(); };
+	virtual ~COtgStateWatcher() {LOG_FUNC Cancel(); };
 	
 	TInt IssueAgain() { iOtgRoot.otgQueueOtgStateRequest(iState , iStatus); return(ETrue);};
 	void DisplayEvent(); 
 
 	TInt GetEventValue() {return(iState);};
 	
-	void DoCancel() { iOtgRoot.otgCancelOtgStateRequest();};
+	void DoCancel() {LOG_FUNC iOtgRoot.otgCancelOtgStateRequest();};
 
 protected:
 	COtgStateWatcher(MOtgNotificationHandler &aHandler, const TWatcherNotifyType aWatchType, COtgRoot &aOtgRoot) :
@@ -310,12 +310,12 @@
 public:
 	static COtgEventWatcher* NewL(MOtgNotificationHandler &wdHandler, const TWatcherNotifyType aWatchType, COtgRoot &aOtgRoot);
 	void ConstructL() {};
-	virtual ~COtgEventWatcher() { Cancel(); };		
+	virtual ~COtgEventWatcher() {LOG_FUNC Cancel(); };		
 	
 	TInt IssueAgain() { iOtgRoot.otgQueueOtgEventRequest(iEvent , iStatus); return(ETrue);};
 	void DisplayEvent(); 
 	TInt GetEventValue() {return(iEvent);};
-	void DoCancel() {  iOtgRoot.otgCancelOtgEventRequest();};
+	void DoCancel() { LOG_FUNC iOtgRoot.otgCancelOtgEventRequest();};
 
 protected:
 	COtgEventWatcher(MOtgNotificationHandler &aHandler, const TWatcherNotifyType aWatchType, COtgRoot &aOtgRoot) : 
@@ -333,12 +333,12 @@
 public:
 	static COtgMessageWatcher* NewL(MOtgNotificationHandler &wdHandler, const TWatcherNotifyType aWatchType, COtgRoot &aOtgRoot);
 	void ConstructL() {};
-	virtual ~COtgMessageWatcher() { Cancel(); };	
+	virtual ~COtgMessageWatcher() {LOG_FUNC Cancel(); };	
 	
 	TInt IssueAgain() { iOtgRoot.otgQueueOtgMessageRequest(iMessage, iStatus); return(ETrue);};
 	void DisplayEvent();
 	TInt GetEventValue() {return(iMessage);};
-	void DoCancel() { iOtgRoot.otgCancelOtgMessageRequest();};
+	void DoCancel() {LOG_FUNC iOtgRoot.otgCancelOtgMessageRequest();};
 
 protected:
 	COtgMessageWatcher(MOtgNotificationHandler &aHandler, const TWatcherNotifyType aWatchType, COtgRoot &aOtgRoot) : 
@@ -354,12 +354,12 @@
 public:
 	static CPeripheralStateWatcher* NewL(MOtgNotificationHandler &wdHandler, const TWatcherNotifyType aWatchType, COtgRoot &aOtgRoot);
 	void ConstructL() {};
-	virtual ~CPeripheralStateWatcher() { Cancel(); };	
+	virtual ~CPeripheralStateWatcher() {LOG_FUNC Cancel(); };	
 	
 	TInt IssueAgain() { iOtgRoot.otgQueuePeripheralStateRequest(iPeripheralState, iStatus); return(ETrue);};
 	void DisplayEvent();
 	TInt GetEventValue() {return(iPeripheralState);};
-	void DoCancel() { iOtgRoot.otgCancelPeripheralStateRequest();};
+	void DoCancel() {LOG_FUNC iOtgRoot.otgCancelPeripheralStateRequest();};
 
 protected:
 	CPeripheralStateWatcher(MOtgNotificationHandler &aHandler, const TWatcherNotifyType aWatchType, COtgRoot &aOtgRoot) : 
@@ -375,12 +375,12 @@
 public:
 	static CAConnectionIdleWatcher* NewL(MOtgNotificationHandler &wdHandler, const TWatcherNotifyType aWatchType, COtgRoot &aOtgRoot);
 	void ConstructL() {};
-	virtual ~CAConnectionIdleWatcher() { Cancel(); };	
+	virtual ~CAConnectionIdleWatcher() {LOG_FUNC Cancel(); };	
 	
 	TInt IssueAgain() { iOtgRoot.otgQueueAConnectionIdleRequest(iAConnectionIdle, iStatus); return(ETrue);};
 	void DisplayEvent();
 	TInt GetEventValue() {return(iAConnectionIdle);};
-	void DoCancel() { iOtgRoot.otgCancelAConnectionIdleRequest();};
+	void DoCancel() {LOG_FUNC iOtgRoot.otgCancelAConnectionIdleRequest();};
 
 protected:
 	CAConnectionIdleWatcher(MOtgNotificationHandler &aHandler, const TWatcherNotifyType aWatchType, COtgRoot &aOtgRoot) : 
--- a/kerneltest/e32test/usbho/t_otgdi/inc/debugmacros.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/inc/debugmacros.h	Wed Sep 01 12:34:56 2010 +0100
@@ -27,6 +27,7 @@
  e.g. 
 <Function> void CMyClass::MyFunction (TInt aParam)
 */
+#define LOG_FUNC 	if (gVerboseOutput) RDebug::Printf("<Function> %s", __PRETTY_FUNCTION__);
 
 const TInt KErrAssertionInternal	= 3;
 
@@ -35,6 +36,7 @@
 									__ASSERT_ALWAYS(a, User::Panic(_L("Test F/W Err"), KErrAssertionInternal));};
 
 
+#define LOG_FUNCERROR(a) RDebug::Printf("[WARNING %s failed %d]", __PRETTY_FUNCTION__, a);
 
 /**
 Debug macro to output test in 'verbose' detail mode
--- a/kerneltest/e32test/usbho/t_otgdi/src/b2bwatchers.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/b2bwatchers.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -30,10 +30,6 @@
 #include <d32usbc.h>		// USBCC header
 #include "testcaseroot.h"
 #include "b2bwatchers.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "b2bwatchersTraces.h"
-#endif
 
 
 
@@ -49,10 +45,7 @@
 
 CNotifyCollector::CNotifyCollector(TRequestStatus &aStatus)  : iStatusStep(aStatus) 
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CNOTIFYCOLLECTOR_CNOTIFYCOLLECTOR);
-	    }
+	LOG_FUNC
 	TTimeIntervalDays oneday(1);
 	iTimeStarted.HomeTime();
 	iTimeStarted += (oneday); // force all durations to produce a negative (invalid) value
@@ -64,10 +57,7 @@
  */ 
 CNotifyCollector::~CNotifyCollector()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CNOTIFYCOLLECTOR_DCNOTIFYCOLLECTOR);
-	    }
+	LOG_FUNC
 	
 	ClearAllEvents(); // free event arrays
 
@@ -84,6 +74,7 @@
  */
 void CNotifyCollector::ClearAllEvents(TBool aClearRecieved/*=ETrue*/, TBool aClearRequired /*=ETrue*/)
 	{
+	//LOG_FUNC
 	if (aClearRequired)
 		{
 		iRequiredEvents.Reset();
@@ -101,10 +92,7 @@
  */
 void CNotifyCollector::CreateObserversL(COtgRoot &aOtgDriver)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CNOTIFYCOLLECTOR_CREATEOBSERVERSL);
-	    }
+	LOG_FUNC
 	TInt watchType;
 	ASSERT(aOtgDriver.LddLoaded());
 	
@@ -137,7 +125,7 @@
 		
 		// add it to our list so we can kill them after the test.
 		iNotifyObjects.Append(pWatcher);
-
+		//LOG_VERBOSE3(_L("Added watcher type %d, TRequest= %08X.\n"), iType, (TInt)(&pWatcher->iStatus));	
 		
 		// start all watchers, except for the watchdog
 		if (watchType != EWatcherTimeouts)
@@ -146,7 +134,6 @@
 			}
 		}
 	test.Printf(_L("\n"));
-	OstTrace0(TRACE_NORMAL, CNOTIFYCOLLECTOR_CREATEOBSERVERSL_DUP02, "\n");
 	}
 
 
@@ -154,19 +141,12 @@
  */
 void CNotifyCollector::DestroyObservers()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CNOTIFYCOLLECTOR_DESTROYOBSERVERS);
-	    }
+	LOG_FUNC
 	
 	// Free the Watchers
 	for (TInt idx=0; idx < iNotifyObjects.Count(); idx++)
 		{
 		LOG_VERBOSE2(_L(".. %d .."), idx);		
-		if(gVerboseOutput)
-		    {
-		    OstTrace1(TRACE_VERBOSE, CNOTIFYCOLLECTOR_DESTROYOBSERVERS_DUP01, ".. %d ..", idx);		
-		    }
 		delete iNotifyObjects[idx];	// they will call their own Cancel() methods
 		}
 	iNotifyObjects.Close();	
@@ -202,42 +182,22 @@
 		case EWatcherState:
 			COtgRoot::OtgStateString(static_cast<RUsbOtgDriver::TOtgState>(aValue), aDescription);
 			LOG_VERBOSE3(_L("AddRequiredNotification() State %d '%S' wanted\n"), aValue, &aDescription);
-			if(gVerboseOutput)
-			    {
-			    OstTraceExt2(TRACE_VERBOSE, CNOTIFYCOLLECTOR_ADDREQUIREDORFAILURENOTIFICATION, "AddRequiredNotification() State %d '%S' wanted\n", aValue, aDescription);
-			    }
 			break;
 		case EWatcherEvent:
 			COtgRoot::OtgEventString(static_cast<RUsbOtgDriver::TOtgEvent>(aValue), aDescription);
 			LOG_VERBOSE3(_L("AddRequiredNotification() Event %d '%S' wanted\n"), aValue, &aDescription);
-			if(gVerboseOutput)
-			    {
-			    OstTraceExt2(TRACE_VERBOSE, CNOTIFYCOLLECTOR_ADDREQUIREDORFAILURENOTIFICATION_DUP01, "AddRequiredNotification() Event %d '%S' wanted\n", aValue, aDescription);
-			    }
 			break;
 		case EWatcherMessage:
 			COtgRoot::OtgMessageString(static_cast<RUsbOtgDriver::TOtgMessage>(aValue), aDescription);
 			LOG_VERBOSE3(_L("AddRequiredNotification() Message %d '%S' wanted\n"), aValue, &aDescription);
-			if(gVerboseOutput)
-			    {
-			    OstTraceExt2(TRACE_VERBOSE, CNOTIFYCOLLECTOR_ADDREQUIREDORFAILURENOTIFICATION_DUP02, "AddRequiredNotification() Message %d '%S' wanted\n", aValue, aDescription);
-			    }
 			break;
 		case EWatcherPeripheralState:
 			COtgRoot::PeripheralStateString(static_cast<TUint>(aValue), aDescription);
 			LOG_VERBOSE3(_L("AddRequiredNotification() Peripheral State %d '%S' wanted\n"), aValue, &aDescription);
-			if(gVerboseOutput)
-			    {
-			    OstTraceExt2(TRACE_VERBOSE, CNOTIFYCOLLECTOR_ADDREQUIREDORFAILURENOTIFICATION_DUP03, "AddRequiredNotification() Peripheral State %d '%S' wanted\n", aValue, aDescription);
-			    }
 			break;
 		case EWatcherAConnectionIdle:
 			COtgRoot::AConnectionIdleString(static_cast<RUsbOtgDriver::TOtgConnection>(aValue), aDescription);
 			LOG_VERBOSE3(_L("AddRequiredNotification() AConnectionIdle %d '%S' wanted\n"), aValue, &aDescription);
-			if(gVerboseOutput)
-			    {
-			    OstTraceExt2(TRACE_VERBOSE, CNOTIFYCOLLECTOR_ADDREQUIREDORFAILURENOTIFICATION_DUP04, "AddRequiredNotification() AConnectionIdle %d '%S' wanted\n", aValue, aDescription);
-			    }
 			break;
 
 		}
@@ -351,7 +311,6 @@
 	if (aType == EWatcherTimeouts)
 		{
 		test.Printf(_L("Step timed out..(%dms).\n\n"), GetWatcher(aType)->GetEventValue());
-		OstTrace1(TRACE_NORMAL, CNOTIFYCOLLECTOR_HANDLEEVENT, "Step timed out..(%dms).\n\n", GetWatcher(aType)->GetEventValue());
 		CompleteStep(KTestCaseWatchdogTO);
 		return;
 		}
@@ -364,7 +323,6 @@
 	if (IsFailureEvent(evt))
 		{
 		test.Printf(_L("This event denotes failure for this test\n"));
-		OstTrace0(TRACE_NORMAL, CNOTIFYCOLLECTOR_HANDLEEVENT_DUP01, "This event denotes failure for this test\n");
 		CompleteStep(KTestCaseFailureEventReceived);
 		return;
 		}
@@ -374,6 +332,8 @@
 		// itterate all required events, search for each one in the incomming events list
 		while (start< iRequiredEvents.Count())
 			{
+				//LOG_VERBOSE3(_L("Search for=[%d,%d] :"), 
+				//					iRequiredEvents[start].GetType(), iRequiredEvents[start].GetValue());
 				
 				if (!EventReceivedAlready(iRequiredEvents[start]))
 					return;	// missing still, continue
@@ -381,16 +341,11 @@
 			}
 		// found all the required events
 		LOG_VERBOSE1(_L("Found all.\n"));
-		if(gVerboseOutput)
-		    {
-		    OstTrace0(TRACE_VERBOSE, CNOTIFYCOLLECTOR_HANDLEEVENT_DUP03, "Found all.\n");
-		    }
 		CompleteStep(KErrNone);
 		}
 	else
 		{
 		test.Printf(_L("Warning : No required events!\n"));
-		OstTrace0(TRACE_NORMAL, CNOTIFYCOLLECTOR_HANDLEEVENT_DUP04, "Warning : No required events!\n");
 		}	
 	}
 
@@ -402,7 +357,6 @@
 	if(iStatusStep.Int() != KRequestPending)
 		{
 		test.Printf(_L("Can't complete step - not KRequestPending!\n"));
-		OstTrace0(TRACE_NORMAL, CNOTIFYCOLLECTOR_COMPLETESTEP, "Can't complete step - not KRequestPending!\n");
 		}
 	else
 		{
@@ -418,10 +372,7 @@
 												const TWatcherNotifyType aWatchType, 
 												COtgRoot &aOtgRoot)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CNOTIFYCOLLECTOR_COMPLETESTEP_DUP01);
-	    }
+	LOG_FUNC 
 	COtgWatchdogWatcher* self = new (ELeave) COtgWatchdogWatcher(wdHandler, aWatchType, aOtgRoot);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -432,10 +383,7 @@
 
 void COtgWatchdogWatcher::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(COTGWATCHDOGWATCHER_CONSTRUCTL);
-	    }
+	LOG_FUNC
 	
 	iTimer.CreateLocal();
 	iIntervalMs = -1;
@@ -444,26 +392,21 @@
 
 void COtgWatchdogWatcher::StepExpired(TInt aInterval) 
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(COTGWATCHDOGWATCHER_STEPEXPIRED);
-	    }
+	LOG_FUNC ; 
 	iHandler.HandleEvent(EWatcherTimeouts, aInterval) ; 
 	}
 
 
 void COtgWatchdogWatcher::RunL()
 	{ 
+	//LOG_FUNC 
 	StepExpired(iIntervalMs); 
 	}
 
 
 void COtgWatchdogWatcher::StartTimer(TInt aIntervalMs)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(COTGWATCHDOGWATCHER_STARTTIMER);
-	    }
+	LOG_FUNC ;
 
 	iIntervalMs = aIntervalMs;	// save value for printing latter 
 	if (IsActive()) //cancel the last timer we set, this is easier than cancelling it in each test-step
@@ -478,10 +421,6 @@
 		SetActive();
 		}
 	LOG_VERBOSE2(_L("wd Timer %dms\n"), aIntervalMs)
-	if(gVerboseOutput)
-	    {
-	    OstTrace1(TRACE_VERBOSE, COTGWATCHDOGWATCHER_STARTTIMER_DUP01, "wd Timer %dms\n", aIntervalMs);
-	    }
 	}	
 
 
@@ -492,10 +431,7 @@
 										const TWatcherNotifyType aWatchType, 
 										COtgRoot &aOtgRoot)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(COTGMESSAGEWATCHER_NEWL);
-	    }
+	LOG_FUNC 
 	COtgMessageWatcher* self = new (ELeave) COtgMessageWatcher(wdHandler, aWatchType, aOtgRoot);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -509,7 +445,6 @@
 	TBuf<MAX_DSTRLEN> aDescription;	
 	iOtgRoot.OtgMessageString(iMessage, aDescription);
 	test.Printf(_L("Received Message %d '%S'\n"), iMessage, &aDescription);
-	OstTraceExt2(TRACE_NORMAL, COTGMESSAGEWATCHER_DISPLAYEVENT, "Received Message %d '%S'\n", iMessage, aDescription);
 	}
 
 
@@ -517,10 +452,7 @@
 										const TWatcherNotifyType aWatchType, 
 										COtgRoot &aOtgRoot)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(COTGSTATEWATCHER_NEWL);
-	    }
+	LOG_FUNC 
 	COtgStateWatcher* self = new (ELeave) COtgStateWatcher(wdHandler, aWatchType, aOtgRoot);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -531,10 +463,10 @@
 
 void COtgStateWatcher::DisplayEvent() 
 	{
+	//LOG_FUNC
 	TBuf<MAX_DSTRLEN> aDescription;	
 	iOtgRoot.OtgStateString(iState, aDescription);
 	test.Printf(_L("Received State %d '%S'\n"), iState, &aDescription);
-	OstTraceExt2(TRACE_NORMAL, COTGSTATEWATCHER_DISPLAYEVENT_DUP01, "Received State %d '%S'\n", iState, aDescription);
 	}
 
 
@@ -542,6 +474,7 @@
 										const TWatcherNotifyType aWatchType, 
 										COtgRoot &aOtgRoot)
 	{
+	//LOG_FUNC 
 	COtgEventWatcher* self = new (ELeave) COtgEventWatcher(wdHandler, aWatchType, aOtgRoot);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -554,13 +487,13 @@
 	TBuf<MAX_DSTRLEN> aDescription;	
 	iOtgRoot.OtgEventString(iEvent, aDescription);
 	test.Printf(_L("Received Event %d '%S'\n"), iEvent, &aDescription);
-	OstTraceExt2(TRACE_NORMAL, COTGEVENTWATCHER_DISPLAYEVENT, "Received Event %d '%S'\n", iEvent, aDescription);
 	}
 
 CPeripheralStateWatcher* CPeripheralStateWatcher::NewL(MOtgNotificationHandler &wdHandler, 
 														const TWatcherNotifyType aWatchType, 
 														COtgRoot &aOtgRoot)
 	{
+	//LOG_FUNC 
 	CPeripheralStateWatcher* self = new (ELeave) CPeripheralStateWatcher(wdHandler, aWatchType, aOtgRoot);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -573,13 +506,13 @@
 	TBuf<MAX_DSTRLEN> aDescription;	
 	iOtgRoot.PeripheralStateString(iPeripheralState, aDescription);
 	test.Printf(_L("Peripheral State %d '%S'\n"), iPeripheralState, &aDescription);
-	OstTraceExt2(TRACE_NORMAL, CPERIPHERALSTATEWATCHER_DISPLAYEVENT, "Peripheral State %u '%S'\n", iPeripheralState, aDescription);
 	}
 
 CAConnectionIdleWatcher* CAConnectionIdleWatcher::NewL(MOtgNotificationHandler &wdHandler, 
 														const TWatcherNotifyType aWatchType, 
 														COtgRoot &aOtgRoot)
 	{
+	//LOG_FUNC 
 	CAConnectionIdleWatcher* self = new (ELeave) CAConnectionIdleWatcher(wdHandler, aWatchType, aOtgRoot);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -617,5 +550,4 @@
 	TBuf<MAX_DSTRLEN> aDescription;	
 	iOtgRoot.AConnectionIdleString(iAConnectionIdle, aDescription);
 	test.Printf(_L("AConnectionIdle %d '%S'\n"), iAConnectionIdle, &aDescription);
-	OstTraceExt2(TRACE_NORMAL, CACONNECTIONIDLEWATCHER_DISPLAYEVENT, "AConnectionIdle %d '%S'\n", iAConnectionIdle, aDescription);
 	}
--- a/kerneltest/e32test/usbho/t_otgdi/src/exampletestcase.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/exampletestcase.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -27,10 +27,6 @@
 #include "testcasewd.h"
 #include "testcasefactory.h"
 #include "exampletestcase.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "exampletestcaseTraces.h"
-#endif
 
 
 
@@ -43,10 +39,7 @@
 
 CExampleTestCase* CExampleTestCase::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CEXAMPLETESTCASE_NEWL);
-	    }
+	LOG_FUNC
 	CExampleTestCase* self = new (ELeave) CExampleTestCase(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -58,19 +51,13 @@
 CExampleTestCase::CExampleTestCase(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CEXAMPLETESTCASE_CEXAMPLETESTCASE);
-	    }
+	LOG_FUNC
 	} 
 
 
 void CExampleTestCase::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CEXAMPLETESTCASE_CONSTRUCTL);
-	    }
+	LOG_FUNC
 	BaseConstructL();
 	iWDTimer = CTestCaseWatchdog::NewL();
 	}
@@ -78,10 +65,7 @@
 
 CExampleTestCase::~CExampleTestCase()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CEXAMPLETESTCASE_DCEXAMPLETESTCASE);
-	    }
+	LOG_FUNC
 
 	delete iWDTimer;
 	Cancel();
@@ -90,10 +74,7 @@
 
 void CExampleTestCase::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CEXAMPLETESTCASE_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EFirstStep;
 
 	//	
@@ -106,15 +87,11 @@
 void CExampleTestCase::DescribePreconditions()
 	{
 	test.Printf(_L("This is an example test, there is nothing to do beforehand.\n"));
-	OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_DESCRIBEPRECONDITIONS, "This is an example test, there is nothing to do beforehand.\n");
 	}
 	
 void CExampleTestCase::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CEXAMPLETESTCASE_DOCANCEL);
-	    }
+	LOG_FUNC
 
 	}
 
@@ -130,7 +107,6 @@
 	CExampleTestCase * p = REINTERPRET_CAST(CExampleTestCase *,pThis);
 	// cancel any pending call, and then complete our active obj with a timeout value
 	test.Printf(_L("@@@ FuncA cancel a keyboard Read() @@@\n"));
-	OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_FUNCA, "@@@ FuncA cancel a keyboard Read(@@@\n"));
 
 	p->iConsole->ReadCancel();
 
@@ -141,7 +117,6 @@
 	CExampleTestCase * p = REINTERPRET_CAST(CExampleTestCase *,pThis);
 	// cancel any pending call, and then complete our active obj with a timeout value
 	test.Printf(_L("@@@ FuncB cancel a 'B' keyboard Read() @@@\n"));
-	OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_FUNCB, "@@@ FuncB cancel a 'B' keyboard Read(@@@\n"));
 
 	p->Cancel();
 	p->iConsole->ReadCancel();
@@ -158,55 +133,43 @@
 // handle event completion	
 void CExampleTestCase::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CEXAMPLETESTCASE_RUNSTEPL);
-	    }
+	LOG_FUNC
 
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
-	OstTrace1(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP01, "Example test iStatus compl.=%d\n", completionCode);
+	RDebug::Printf("Example test iStatus compl.=%d\n", completionCode);
+	//test.Printf(_L("Example test iStatus compl.=%d\n"), completionCode);
 
 	switch(iCaseStep)
 		{
 		case EFirstStep:
 			iCaseStep=ESecondStep;
 			test.Printf(_L("Test step 1\n"));
-			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP03, "Test step 1\n");
 
 			SelfComplete();
 			break;
 		case ESecondStep:
 			iCaseStep=EThirdStep;
 			test.Printf(_L("Test step 2\n"));
-			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP04, "Test step 2\n");
 			test.Printf(_L("(this test step uses Keyboard)\n"));
-			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP05, "(this test step uses Keyboard\n"));
 			test.Printf(_L("Press ANY key once you have removed the 'A' connector...\n"));
-			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP06, "Press ANY key once you have removed the 'A' connector...\n");
 			RequestCharacter();
 			iWDTimer->IssueRequest(KDelayDurationForUserActivityMS, this, &FuncA);
 			break;
 		case EThirdStep:
 			test.Printf(_L("key was a '%c'\n"), iKeyCodeInput);
-			OstTrace1(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP07, "key was a '%c'\n", iKeyCodeInput);
 			iWDTimer->Cancel();
 			iCaseStep=EFourthStep;
 			test.Printf(_L("Test step 3\n"));
-			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP08, "Test step 3\n");
 			test.Printf(_L("(this test step uses Keyboard)\n"));
-			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP09, "(this test step uses Keyboard\n"));
 			test.Printf(_L("Press <SPACE> key once you have removed the 'A' connector...\n"));
-			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP10, "Press <SPACE> key once you have removed the 'A' connector...\n");
 			RequestCharacter();
 			iWDTimer->IssueRequest(KDelayDurationForUserActivityMS, this, &FuncB);
 			
 			break;
 		case EFourthStep:
 			test.Printf(_L("key was a '%c'\n"), iKeyCodeInput);
-			OstTrace1(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP11, "key was a '%c'\n", iKeyCodeInput);
 			test.Printf(_L("Test step 4\n"));
-			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP12, "Test step 4\n");
 			iWDTimer->Cancel();
 
 			iCaseStep=EFifthStep;
@@ -220,16 +183,13 @@
 		case EFifthStep:
 			iCaseStep=ESixthStep;
 			test.Printf(_L("Test step 5\n"));
-			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP13, "Test step 5\n");
 			test.Printf(_L("(this test uses a delay)\n"));
-			OstTrace0(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP14, "(this test uses a delay\n"));
 			iTimer.After(iStatus, 500000);
 			SetActive();
 			break;
 		case ESixthStep:
 			iCaseStep=ELastStep;
 			test.Printf(_L("Test step 6(%d)\n"), completionCode);
-			OstTrace1(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP15, "Test step 6(%d)\n", completionCode);
 			RequestCharacter();
 			iConsole->ReadCancel();
 			Cancel();
@@ -240,12 +200,12 @@
 		case ELastStep:
 			iCaseStep=ESecondStep;
 			test.Printf(_L("LAST step7 code (%d)\n"), completionCode);
-			OstTrace1(TRACE_NORMAL, CEXAMPLETESTCASE_RUNSTEPL_DUP16, "LAST step7 code (%d)\n", completionCode);
 			TestPolicy().SignalTestComplete(KErrNone);
 			return TestPassed();
 			//break;
 
 		default:
+			//test.Printf(_L("<Error> unknown test step"));
 			Cancel();
 			TestFailed(KErrCorrupt, _L("unknown test step"));
 			break;
--- a/kerneltest/e32test/usbho/t_otgdi/src/otgroot.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/otgroot.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -28,10 +28,6 @@
 #include <d32usbc.h>		// USBCC header
 #include "otgroot.h"
 #include "testcaseroot.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "otgrootTraces.h"
-#endif
 
 RUsbOtgDriver  oUsbOtgDriver;
 RDevUsbcClient oUsbcClient;
@@ -54,15 +50,8 @@
 TInt COtgRoot::otgLoadLdd()
 	{
 	
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(COTGROOT_OTGLOADLDD);
-	    }
+	LOG_FUNC
 	LOG_VERBOSE2(_L("Load driver: %S\n"), &KOTGDeviceInterfaceDriverName);
-	if(gVerboseOutput)
-	    {
-	    OstTraceExt1(TRACE_VERBOSE, COTGROOT_OTGLOADLDD_DUP01, "Load driver: %S\n", KOTGDeviceInterfaceDriverName);
-	    }
 
 	if (!LddLoaded())
 		{
@@ -72,17 +61,12 @@
 		if ( (err != KErrNone) && (err != KErrAlreadyExists) )
 			{
 			test.Printf(_L("<Error %d> Unable to load driver: %S\n"), err, &KOTGDeviceInterfaceDriverName);
-			OstTraceExt2(TRACE_NORMAL, COTGROOT_OTGLOADLDD_DUP02, "<Error %d> Unable to load driver: %S\n", err, KOTGDeviceInterfaceDriverName);
 			SetLoaded(EFalse);
 			return(err);
 			}
 		else
 			{
 			LOG_VERBOSE2(_L("Loaded driver: '%S' OK\n"), &KOTGDeviceInterfaceDriverName);
-			if(gVerboseOutput)
-			    {
-			    OstTraceExt1(TRACE_VERBOSE, COTGROOT_OTGLOADLDD_DUP03, "Loaded driver: '%S' OK\n", KOTGDeviceInterfaceDriverName);
-			    }
 			SetLoaded(ETrue);
 			}
 		
@@ -95,31 +79,19 @@
 */
 TInt COtgRoot::otgOpen()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(COTGROOT_OTGOPEN);
-	    }
+	LOG_FUNC
 	
 	LOG_VERBOSE2(_L("Opening session... loaded = %d\n"), LddLoaded());
-	if(gVerboseOutput)
-	    {
-	    OstTrace1(TRACE_VERBOSE, COTGROOT_OTGOPEN_DUP01, "Opening session... loaded = %d\n", LddLoaded());
-	    }
 
 	TInt err(oUsbOtgDriver.Open());
 	if (err != KErrNone)
 		{
 		test.Printf(_L("<Error %d> Unable to open a channel to USB OTG driver\n"),err);
-		OstTrace1(TRACE_NORMAL, COTGROOT_OTGOPEN_DUP02, "<Error %d> Unable to open a channel to USB OTG driver\n",err);
 		return(err);
 		}
 	else
 		{
 		LOG_VERBOSE1(_L("Open channel OK\n"));
-		if(gVerboseOutput)
-		    {
-		    OstTrace0(TRACE_VERBOSE, COTGROOT_OTGOPEN_DUP03, "Open channel OK\n");
-		    }
 		}
 		
 	return(KErrNone);	
@@ -130,13 +102,9 @@
 */
 void COtgRoot::otgClose()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(COTGROOT_OTGCLOSE);
-	    }
+	LOG_FUNC
 	
 	test.Printf(_L("Closing session... loaded = %d\n"), LddLoaded());
-	OstTrace1(TRACE_NORMAL, COTGROOT_OTGCLOSE_DUP01, "Closing session... loaded = %d\n", LddLoaded());
 	oUsbOtgDriver.Close();
 	}
 
@@ -145,10 +113,7 @@
  */ 
 TInt COtgRoot::otgActivateOptTestMode()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(COTGROOT_OTGACTIVATEOPTTESTMODE);
-	    }
+	LOG_FUNC
 
 	TInt err = oUsbOtgDriver.ActivateOptTestMode();
 
@@ -160,16 +125,13 @@
 */
 TInt COtgRoot::otgStartStacks()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(COTGROOT_OTGSTARTSTACKS);
-	    }
+	LOG_FUNC
 
 	TInt err(oUsbOtgDriver.StartStacks());
 	if (err != KErrNone)
 		{
 
-		OstTrace1(TRACE_WARNING, COTGROOT_OTGSTARTSTACKS_DUP01, "[WARNING failed %d]", err);
+		LOG_FUNCERROR(err)
 
 		}
 	return(err);
@@ -181,10 +143,7 @@
 */ 
 void COtgRoot::otgStopStacks()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(COTGROOT_OTGSTOPSTACKS);
-	    }
+	LOG_FUNC
 	
 	oUsbOtgDriver.StopStacks();
 	}
@@ -199,7 +158,7 @@
 	TInt err (User::FreeLogicalDevice(KOTGDeviceInterfaceDriverName));
 	if (err != KErrNone)
 		{
-		OstTrace1(TRACE_WARNING, COTGROOT_OTGUNLOADLDD, "[WARNING failed %d]", err);
+		LOG_FUNCERROR(err)
 		}
 
 	SetLoaded(EFalse);
@@ -210,11 +169,8 @@
 */
 void COtgRoot::otgQueueOtgEventRequest(RUsbOtgDriver::TOtgEvent& aEvent, TRequestStatus &aStatus)
 	{
+	//LOG_FUNC	
 	LOG_VERBOSE2(_L("Queue an Event Request %08X.\n"), (TInt)(&aStatus));
-	if(gVerboseOutput)
-	    {
-	    OstTrace1(TRACE_VERBOSE, COTGROOT_OTGQUEUEOTGEVENTREQUEST_DUP01, "Queue an Event Request %08X.\n", (TInt)(&aStatus));
-	    }
 
 	oUsbOtgDriver.QueueOtgEventRequest(aEvent, aStatus);
 	
@@ -226,10 +182,6 @@
 void COtgRoot::otgCancelOtgEventRequest()
 	{
 	LOG_VERBOSE1(_L("Cancel Event Request.\n"));
-	if(gVerboseOutput)
-	    {
-	    OstTrace0(TRACE_VERBOSE, COTGROOT_OTGCANCELOTGEVENTREQUEST, "Cancel Event Request.\n");
-	    }
 	oUsbOtgDriver.CancelOtgEventRequest();
 	}
     
@@ -238,13 +190,10 @@
 */
 void COtgRoot::otgQueueOtgMessageRequest(RUsbOtgDriver::TOtgMessage& aMessage, TRequestStatus &aStatus)
 	{
-
+	//LOG_FUNC	
 	LOG_VERBOSE2(_L("Queue a Message Request %08X.\n"), (TInt)(&aStatus));
-	if(gVerboseOutput)
-	    {
-	    OstTrace1(TRACE_VERBOSE, COTGROOT_OTGQUEUEOTGMESSAGEREQUEST_DUP01, "Queue a Message Request %08X.\n", (TInt)(&aStatus));
-	    }
 
+	//LOG_VERBOSE1(_L("Queue a Message Request.\n"));
 	oUsbOtgDriver.QueueOtgMessageRequest(aMessage, aStatus);
 		
 	}
@@ -255,50 +204,30 @@
 void COtgRoot::otgCancelOtgMessageRequest()
 	{
 	LOG_VERBOSE1(_L("Cancel Message Request.\n"));
-	if(gVerboseOutput)
-	    {
-	    OstTrace0(TRACE_VERBOSE, COTGROOT_OTGCANCELOTGMESSAGEREQUEST, "Cancel Message Request.\n");
-	    }
 	oUsbOtgDriver.CancelOtgMessageRequest();
 	}    
     
 void COtgRoot::otgQueuePeripheralStateRequest(TUint& aPeripheralState, TRequestStatus& aStatus)
 	{
 	LOG_VERBOSE1(_L("Queue Peripheral State Request.\n"));
-	if(gVerboseOutput)
-	    {
-	    OstTrace0(TRACE_VERBOSE, COTGROOT_OTGQUEUEPERIPHERALSTATEREQUEST, "Queue Peripheral State Request.\n");
-	    }
 	oUsbcClient.AlternateDeviceStatusNotify(aStatus, aPeripheralState);
 	}
 
 void COtgRoot::otgCancelPeripheralStateRequest()
 	{
 	LOG_VERBOSE1(_L("Cancel Peripheral State Request.\n"));
-	if(gVerboseOutput)
-	    {
-	    OstTrace0(TRACE_VERBOSE, COTGROOT_OTGCANCELPERIPHERALSTATEREQUEST, "Cancel Peripheral State Request.\n");
-	    }
 	oUsbcClient.AlternateDeviceStatusNotifyCancel();	
 	}
 
 void COtgRoot::otgQueueAConnectionIdleRequest(RUsbOtgDriver::TOtgConnection& aAConnectionIdle, TRequestStatus& aStatus)
 	{
 	LOG_VERBOSE1(_L("Queue A Connection Idle Request.\n"));
-	if(gVerboseOutput)
-	    {
-	    OstTrace0(TRACE_VERBOSE, COTGROOT_OTGQUEUEACONNECTIONIDLEREQUEST, "Queue A Connection Idle Request.\n");
-	    }
 	oUsbOtgDriver.QueueOtgConnectionNotification(aAConnectionIdle, aStatus);
 	}
 
 void COtgRoot::otgCancelAConnectionIdleRequest()
 	{
 	LOG_VERBOSE1(_L("Cancel A Connection Idle Request.\n"));
-	if(gVerboseOutput)
-	    {
-	    OstTrace0(TRACE_VERBOSE, COTGROOT_OTGCANCELACONNECTIONIDLEREQUEST, "Cancel A Connection Idle Request.\n");
-	    }
 	oUsbOtgDriver.CancelOtgConnectionNotification();
 	}
 
@@ -307,11 +236,8 @@
 */
 void COtgRoot::otgQueueOtgStateRequest(RUsbOtgDriver::TOtgState& aState, TRequestStatus &aStatus)
 	{
+	//LOG_FUNC	
 	LOG_VERBOSE2(_L("Queue a State Request %08X.\n"), (TInt)(&aStatus));
-	if(gVerboseOutput)
-	    {
-	    OstTrace1(TRACE_VERBOSE, COTGROOT_OTGQUEUEOTGSTATEREQUEST_DUP01, "Queue a State Request %08X.\n", (TInt)(&aStatus));
-	    }
 
 	oUsbOtgDriver.QueueOtgStateRequest(aState, aStatus);
 	
@@ -323,10 +249,6 @@
 void COtgRoot::otgCancelOtgStateRequest()
 	{
 	LOG_VERBOSE1(_L("Cancel State Request.\n"));
-	if(gVerboseOutput)
-	    {
-	    OstTrace0(TRACE_VERBOSE, COTGROOT_OTGCANCELOTGSTATEREQUEST, "Cancel State Request.\n");
-	    }
 	oUsbOtgDriver.CancelOtgStateRequest();
 	}
 
@@ -336,16 +258,13 @@
 */
 TInt COtgRoot::otgBusRequest()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(COTGROOT_OTGBUSREQUEST);
-	    }
+	LOG_FUNC
 	
 	TInt err(0);
 	err = oUsbOtgDriver.BusRequest();
 	if (err != KErrNone)
 		{
-		OstTrace1(TRACE_WARNING, COTGROOT_OTGBUSREQUEST_DUP01, "[WARNING failed %d]", err);
+		LOG_FUNCERROR(err)
 		}
 	return(err);
 	}
@@ -356,15 +275,12 @@
  */
 TInt COtgRoot::otgBusRespondSRP()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(COTGROOT_OTGBUSRESPONDSRP);
-	    }
+	LOG_FUNC
 	TInt err(0);
 		err = oUsbOtgDriver.BusRespondSrp();
 		if (err != KErrNone)
 			{
-			OstTrace1(TRACE_WARNING, COTGROOT_OTGBUSRESPONDSRP_DUP01, "[WARNING failed %d]", err);
+			LOG_FUNCERROR(err)
 			}
 		return(err);
 	}
@@ -374,15 +290,12 @@
 */	
 TInt COtgRoot::otgBusDrop()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(COTGROOT_OTGBUSDROP);
-	    }
+	LOG_FUNC
 	TInt err(0);
 	err = oUsbOtgDriver.BusDrop();
 	if (err != KErrNone)
 		{
-		OstTrace1(TRACE_WARNING, COTGROOT_OTGBUSDROP_DUP01, "[WARNING failed %d]", err);
+		LOG_FUNCERROR(err)
 		}
 	return(err);
 	}
@@ -391,16 +304,13 @@
 */
 TInt COtgRoot::otgBusClearError()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(COTGROOT_OTGBUSCLEARERROR);
-	    }
+	LOG_FUNC
 	
 	TInt err(0);
 	err = oUsbOtgDriver.BusClearError();
 	if (err != KErrNone)
 		{
-		OstTrace1(TRACE_WARNING, COTGROOT_OTGBUSCLEARERROR_DUP01, "[WARNING failed %d]", err);
+		LOG_FUNCERROR(err)
 		}
 	return(err);
 	}
@@ -409,20 +319,14 @@
 	
 void COtgRoot::otgQueueOtgIdPinNotification(RUsbOtgDriver::TOtgIdPin& aPin, TRequestStatus& aStatus)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(COTGROOT_OTGQUEUEOTGIDPINNOTIFICATION);
-	    }
+	LOG_FUNC
 	oUsbOtgDriver.QueueOtgIdPinNotification(aPin, aStatus);	// the kernel driver populates aPin...
 	}
 
 	
 void COtgRoot::otgCancelOtgIdPinNotification()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(COTGROOT_OTGCANCELOTGIDPINNOTIFICATION);
-	    }
+	LOG_FUNC
 	oUsbOtgDriver.CancelOtgIdPinNotification();
 	}
 
@@ -431,38 +335,25 @@
                                                 TRequestStatus& aStatus
                                                )
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(COTGROOT_OTGQUEUEOTGVBUSNOTIFICATION);
-	    }
+	LOG_FUNC
 	oUsbOtgDriver.QueueOtgVbusNotification(aVbus, aStatus);
 	}
 	
 	
 void COtgRoot::otgCancelOtgVbusNotification()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(COTGROOT_OTGCANCELOTGVBUSNOTIFICATION);
-	    }
+	LOG_FUNC
 	oUsbOtgDriver.CancelOtgVbusNotification();
 	}
 
 
 TBool COtgRoot::otgIdPinPresent()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(COTGROOT_OTGIDPINPRESENT);
-	    }
+	LOG_FUNC
 	TRequestStatus aStatus;
 	RUsbOtgDriver::TOtgIdPin aPin;
 	oUsbOtgDriver.QueueOtgIdPinNotification(aPin, aStatus);	// the kernel driver populates aPin...
 	LOG_VERBOSE2(_L("(sync) ID_PIN=%d\n"), iOTGIdPin);
-	if(gVerboseOutput)
-	    {
-	    OstTrace1(TRACE_VERBOSE, COTGROOT_OTGIDPINPRESENT_DUP01, "(sync) ID_PIN=%d\n", iOTGIdPin);
-	    }
 	
 	oUsbOtgDriver.CancelOtgIdPinNotification();
 	// swallow the event
@@ -478,10 +369,7 @@
 	
 TBool COtgRoot::otgVbusPresent()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(COTGROOT_OTGVBUSPRESENT);
-	    }
+	LOG_FUNC
 	TRequestStatus aStatus;
  	RUsbOtgDriver::TOtgVbus aVBus;
 	oUsbOtgDriver.QueueOtgVbusNotification(aVBus, aStatus);	// the kernel driver populates aPin in a kernel thread...
@@ -629,21 +517,21 @@
 	{
 	if(iFdfActorActive)
 		{
-		OstTrace0(TRACE_NORMAL, COTGROOT_OTGACTIVATEFDFACTOR, "FdfActor already exists!");
+		RDebug::Print(_L("FdfActor already exists!"));
 		return KErrAlreadyExists;
 		}
 		
 	const TUid KFdfSvrUid={0x10282B48};
 	const TUidType fdfActorUid(KNullUid, KNullUid, KFdfSvrUid);
 
-	OstTrace0(TRACE_NORMAL, COTGROOT_OTGACTIVATEFDFACTOR_DUP01, "About to activate FDF Actor");
+	RDebug::Print(_L("About to activate FDF Actor"));
 
 //	RProcess fdfActorProcess;
 	TInt err = iFdfActorProcess.Create(_L("t_otgdi_fdfactor.exe"), KNullDesC, fdfActorUid);
 	
 	if (err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, COTGROOT_OTGACTIVATEFDFACTOR_DUP02, "Failed to create FDF Actor, err=%d",err);
+		RDebug::Print(_L("Failed to create FDF Actor, err=%d"),err);
 		iFdfActorProcess.Close();
 		return err;
 		}
@@ -653,7 +541,7 @@
 	
 	if (stat!=KRequestPending)
 		{
-		OstTrace1(TRACE_NORMAL, COTGROOT_OTGACTIVATEFDFACTOR_DUP03, "Failed to commence rendezvous, err=%d",stat.Int());
+		RDebug::Print(_L("Failed to commence rendezvous, err=%d"),stat.Int());
 		iFdfActorProcess.Kill(0);		// abort startup
 		iFdfActorProcess.Close();
 		return stat.Int();
@@ -668,7 +556,7 @@
 		{
 		//	Wasn't KErrNone, which means that the FDFActor didn't successfully
 		//	start up. We shouldn't proceed with the test we're in.
-		OstTrace1(TRACE_NORMAL, COTGROOT_OTGACTIVATEFDFACTOR_DUP04, "Failed to activate FDF Actor, err=%d",stat.Int());
+		RDebug::Print(_L("Failed to activate FDF Actor, err=%d"),stat.Int());
 		iFdfActorProcess.Close();
 		return stat.Int();
 		}
@@ -676,7 +564,7 @@
 	//	We rendezvoused(?) with the FDFActor OK, so it is going to suspend
 	//	any devices it sees being attached, and will shut itself down
 	//	when this process signals its Rendezvous (at the end of the test)...
-	OstTrace0(TRACE_NORMAL, COTGROOT_OTGACTIVATEFDFACTOR_DUP05, "Activated FDF Actor");
+	RDebug::Print(_L("Activated FDF Actor"));
 	iFdfActorActive = ETrue;
 
 	return KErrNone;
@@ -686,7 +574,7 @@
 	{
 	if(!iFdfActorActive)
 		{
-		OstTrace0(TRACE_NORMAL, COTGROOT_OTGDEACTIVATEFDFACTOR, "FdfActor is not running!");
+		RDebug::Print(_L("FdfActor is not running!"));
 		return;
 		}
 
@@ -703,7 +591,6 @@
 	//	...and wait for it to go away.
 	User::WaitForRequest(waitForCloseStat);
 	test.Printf(_L("T_OTGDI confirms FDF Actor has gone away %d\n"), waitForCloseStat.Int());
-	OstTrace1(TRACE_NORMAL, COTGROOT_OTGDEACTIVATEFDFACTOR_DUP01, "T_OTGDI confirms FDF Actor has gone away %d\n", waitForCloseStat.Int());
 	
 	//	Now close our handle, and record that the process is no more...
 	iFdfActorProcess.Close();
@@ -716,20 +603,17 @@
 TBool COtgRoot::StepUnloadClient()
 	{
 	test.Printf(_L("Unload USBCC Client\n"));
-	OstTrace0(TRACE_NORMAL, COTGROOT_STEPUNLOADCLIENT, "Unload USBCC Client\n");
 
 	TInt err;
 
 	// Close the Client
 
 	test.Printf(_L("..Close\n"));
-	OstTrace0(TRACE_NORMAL, COTGROOT_STEPUNLOADCLIENT_DUP01, "..Close\n");
 	oUsbcClient.Close();
 
 	// Unload the LDD - note the name is *not* the same as for loading
 
 	test.Printf(_L("..Unload\n"));
-	OstTrace0(TRACE_NORMAL, COTGROOT_STEPUNLOADCLIENT_DUP02, "..Unload\n");
 	err = User::FreeLogicalDevice( KUsbDeviceName );
 	if (err != KErrNone)
 		{
@@ -751,7 +635,6 @@
 								TBool aEnableSRP/*=ETrue*/)
 	{
 	test.Printf(_L("Load USBCC Client 0x%04x\n"),aPID);
-	OstTrace1(TRACE_NORMAL, COTGROOT_STEPLOADCLIENT, "Load USBCC Client 0x%04x\n",aPID);
 
 	TInt err;
 
@@ -785,7 +668,6 @@
 	// Load the LDD - note the name is *not* the same as for unload
 
 	test.Printf(_L("..Load LDD\n"));
-	OstTrace0(TRACE_NORMAL, COTGROOT_STEPLOADCLIENT_DUP01, "..Load LDD\n");
 	err = User::LoadLogicalDevice( KUsbcLddFileName );
 	if ((err != KErrNone) && (err !=KErrAlreadyExists))
 		{
@@ -796,7 +678,6 @@
 	// Open the Client
 
 	test.Printf(_L("..Open LDD\n"));
-	OstTrace0(TRACE_NORMAL, COTGROOT_STEPLOADCLIENT_DUP02, "..Open LDD\n");
 	err = oUsbcClient.Open(0);
 	if (err != KErrNone)
 		{
@@ -807,7 +688,6 @@
 	// Set up descriptors
 	
 	test.Printf(_L("..Setup Descriptors\n"));
-	OstTrace0(TRACE_NORMAL, COTGROOT_STEPLOADCLIENT_DUP03, "..Setup Descriptors\n");
 
 	// the OTG descriptor
 	TBuf8<KUsbDescSize_Otg> theOtgDescriptor;
@@ -829,7 +709,6 @@
 		aByte |= (aEnableSRP? 1 : 0); 
 		aByte |= (aEnableHNP? 2 : 0); 
 	test.Printf(_L("..Change OTG 0x%02X->0x%02X\n"), theOtgDescriptor[2], aByte);
-	OstTraceExt2(TRACE_NORMAL, COTGROOT_STEPLOADCLIENT_DUP04, "..Change OTG 0x%02X->0x%02X\n", (TUint32)theOtgDescriptor[2], (TUint32)aByte);
 	theOtgDescriptor[2] = aByte;
 	
 	err = oUsbcClient.SetOtgDescriptor(theOtgDescriptor);
@@ -855,7 +734,6 @@
 
 	softwareConnect = d_caps().iConnect;
 	test.Printf(_L("..SoftwareConnect = %d\n"),softwareConnect);
-	OstTrace1(TRACE_NORMAL, COTGROOT_STEPLOADCLIENT_DUP05, "..SoftwareConnect = %d\n",softwareConnect);
 
 	if (n < 2)
 		{
@@ -951,7 +829,6 @@
 	theDeviceDescriptor[11] = ( aPID & 0xFF00 ) >> 8;
 
 	test.Printf(_L("..Change PID 0x%04X->0x%04X\n"), oldPID, aPID);
-	OstTraceExt2(TRACE_NORMAL, COTGROOT_STEPLOADCLIENT_DUP06, "..Change PID 0x%04X->0x%04X\n", (TUint32)oldPID, (TUint32)aPID);
 
 	err = oUsbcClient.SetDeviceDescriptor(theDeviceDescriptor);
 	if (err != KErrNone)
@@ -964,7 +841,6 @@
 	// Power Up UDC - KErrNotReady is expected
 
 	test.Printf(_L("..Power Up UDC\n"));
-	OstTrace0(TRACE_NORMAL, COTGROOT_STEPLOADCLIENT_DUP07, "..Power Up UDC\n");
 
 	err = oUsbcClient.PowerUpUdc();
 	if( err != KErrNotReady )
@@ -976,7 +852,6 @@
 	// Connect to Host
 
 	test.Printf(_L("..Connect to Host\n"));
-	OstTrace0(TRACE_NORMAL, COTGROOT_STEPLOADCLIENT_DUP08, "..Connect to Host\n");
 
 	err = oUsbcClient.DeviceConnectToHost();
 	if( err != KErrNone )
@@ -997,7 +872,6 @@
 TBool COtgRoot::StepDisconnect()
 	{
 	test.Printf(_L("Disconnect from Host\n"));
-	OstTrace0(TRACE_NORMAL, COTGROOT_STEPDISCONNECT, "Disconnect from Host\n");
 
 	TInt err;
 	
@@ -1016,7 +890,6 @@
 TBool COtgRoot::StepConnect()
 	{
 	test.Printf(_L("Connect to Host\n"));
-	OstTrace0(TRACE_NORMAL, COTGROOT_STEPCONNECT, "Connect to Host\n");
 
 	TInt err;
 	
@@ -1041,7 +914,6 @@
 
 	{
 	test.Printf(_L("Load USBCC HS Test Client 0x%04x/0x%04x\n"),aVID,aPID);
-	OstTraceExt2(TRACE_NORMAL, COTGROOT_STEPCHANGEVIDPID, "Load USBCC HS Test Client 0x%04x/0x%04x\n",(TUint32)aVID,(TUint32)aPID);
 
 	TInt err;
 
@@ -1062,7 +934,6 @@
 	theDeviceDescriptor[9] = ( aVID & 0xFF00 ) >> 8;
 
 	test.Printf(_L("..Change VID 0x%04X->0x%04X\n"), oldVID, aVID);
-	OstTraceExt2(TRACE_NORMAL, COTGROOT_STEPCHANGEVIDPID_DUP01, "..Change VID 0x%04X->0x%04X\n", (TUint32)oldVID, (TUint32)aVID);
 
 	TUint16 oldPID = ( theDeviceDescriptor[10] )
 		           + ( theDeviceDescriptor[11] << 8 );
@@ -1071,7 +942,6 @@
 	theDeviceDescriptor[11] = ( aPID & 0xFF00 ) >> 8;
 
 	test.Printf(_L("..Change PID 0x%04X->0x%04X\n"), oldPID, aPID);
-	OstTraceExt2(TRACE_NORMAL, COTGROOT_STEPCHANGEVIDPID_DUP02, "..Change PID 0x%04X->0x%04X\n", (TUint32)oldPID, (TUint32)aPID);
 
 	err = oUsbcClient.SetDeviceDescriptor(theDeviceDescriptor);
 	if (err != KErrNone)
@@ -1102,21 +972,12 @@
 TBool COtgRoot::StepUnloadLDD()
 	{ 
 	test.Printf(_L("Unload otg LDD (implicit Stop() + Close()) \n"));
-	OstTrace0(TRACE_NORMAL, COTGROOT_STEPUNLOADLDD, "Unload otg LDD (implicit Stop(+ Close()) \n");
 	
 	LOG_VERBOSE1(_L("  Stop OTG+Host Stack\n"));
-	if(gVerboseOutput)
-	    {
-	    OstTrace0(TRACE_VERBOSE, COTGROOT_STEPUNLOADLDD_DUP01, "  Stop OTG+Host Stack\n");
-	    }
 	otgStopStacks();
 	otgClose();
 	
 	LOG_VERBOSE1(_L("  Unload\n"));
-	if(gVerboseOutput)
-	    {
-	    OstTrace0(TRACE_VERBOSE, COTGROOT_STEPUNLOADLDD_DUP02, "  Unload\n");
-	    }
 	otgUnloadLdd();
 	
 	iOptActive = EFalse; // retain the OTGDI behavour to clears this flag when client shuts 
@@ -1133,10 +994,6 @@
 	TInt err;	
 
 	LOG_VERBOSE1(_L("Load otg LDD\n"));
-	if(gVerboseOutput)
-	    {
-	    OstTrace0(TRACE_VERBOSE, COTGROOT_STEPLOADLDD, "Load otg LDD\n");
-	    }
 	err = otgLoadLdd();
 	if (err != KErrNone)
 		{
@@ -1145,10 +1002,6 @@
 		}
 		
 	LOG_VERBOSE1(_L("Open the LDD session\n"));
-	if(gVerboseOutput)
-	    {
-	    OstTrace0(TRACE_VERBOSE, COTGROOT_STEPLOADLDD_DUP01, "Open the LDD session\n");
-	    }
 	err = otgOpen();
 	if (err != KErrNone)
 		{
@@ -1159,7 +1012,6 @@
 	if ( iOptActive )
 		{
 		test.Printf(_L("Activate OPT Test Mode\n"));
-		OstTrace0(TRACE_NORMAL, COTGROOT_STEPLOADLDD_DUP02, "Activate OPT Test Mode\n");
 		err = otgActivateOptTestMode();
 		if (err != KErrNone)
 			{
@@ -1169,7 +1021,6 @@
 		}
 
 	test.Printf(_L("Start OTG+Host Stack\n"));
-	OstTrace0(TRACE_NORMAL, COTGROOT_STEPLOADLDD_DUP03, "Start OTG+Host Stack\n");
 	err = otgStartStacks();
 	if (err != KErrNone)
 		{
--- a/kerneltest/e32test/usbho/t_otgdi/src/t_otgdi.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/t_otgdi.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -30,10 +30,6 @@
 #include "testengine.h"
 #include "testcaseroot.h"
 #include "b2bwatchers.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "t_otgdiTraces.h"
-#endif
 
 
 
@@ -106,38 +102,44 @@
 		if ( (err != KErrNone) && (err != KErrAlreadyExists) )
 			{
 			test.Printf(_L("<Error %d> Unable to load driver: %S"), err, &KOTGDeviceInterfaceDriverName);
-			OstTraceExt2(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE, "<Error %d> Unable to load driver: %S", err, KOTGDeviceInterfaceDriverName);
 			}
 		err = oUsbOtgDriver.Open();
 		if (err != KErrNone)
-		    {
 			test.Printf(_L("<Error %d> Unable to OPEN driver: %S"), err, &KOTGDeviceInterfaceDriverName);
-			OstTraceExt2(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP01, "<Error %d> Unable to OPEN driver: %S", err, KOTGDeviceInterfaceDriverName);
-			}
-		else
-			{	
+		else	
 			test.Printf(_L("OPEN driver: %S OK!"), &KOTGDeviceInterfaceDriverName);
-			OstTraceExt1(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP02, "OPEN driver: %S OK!", KOTGDeviceInterfaceDriverName);
-			}
 		
 		oUsbOtgDriver.StartStacks();
 		test.Printf(_L("Stack started\n"));
-		OstTrace0(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP03, "Stack started\n");
 		
+/*
+		for (TInt loop=0; loop <6; loop++)
+			// TEST Events
+			do		
+				{
+				test.Printf(_L("Waiting for OTG...\n"));
+				status1 = KRequestPending; // reset the status object
+				oUsbOtgDriver.QueueOtgEventRequest( event, status1 );
+				
+				// wait			
+				User::WaitForRequest(status1);
+				TInt completionCode(status1.Int());
+				CTestCaseRoot::OtgEventString(event, aDescription);
+				test.Printf(_L("Received event %d '%S' status(%d) \n"), event, &aDescription, completionCode);
+				}
+			while (event != RUsbOtgDriver::EEventAPlugInserted); // 'A' plug found
 
+*/
 		test.Printf(_L("API QueueOtgIdPinNotification test:\n"));
-		OstTrace0(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP06, "API QueueOtgIdPinNotification test:\n");
 
 		for (TInt loop=0; loop <6; loop++)
 			// TEST Events
 			do		
 				{
 				test.Printf(_L("Waiting for OTG...\n"));
-				OstTrace0(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP07, "Waiting for OTG...\n");
 				status1 = KRequestPending; // reset the status object
 				oUsbOtgDriver.QueueOtgIdPinNotification( OTGIdPin, status1 );
 				test.Printf(_L("Current pin %d  \n"), OTGIdPin);
-				OstTrace1(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP08, "Current pin %d  \n", OTGIdPin);
 				
 				// wait			
 				User::WaitForRequest(status1);
@@ -155,35 +157,28 @@
 						break;
 					}
 				test.Printf(_L("Received pin %d '%S' status(%d) \n"), OTGIdPin, &aDescription, completionCode);
-				OstTraceExt3(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP09, "Received pin %d '%S' status(%d) \n", OTGIdPin, aDescription, completionCode);
 				}
 			while (OTGIdPin != RUsbOtgDriver::EIdPinAPlug); // 'A' plug found
 
 		test.Printf(_L("Press any key.\n"));
-		OstTrace0(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP10, "Press any key.\n");
 		test.Getch();
 
 		test.Printf(_L("Shutting down stack.\n"));
-		OstTrace0(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP11, "Shutting down stack.\n");
 		oUsbOtgDriver.StopStacks();
 
 		oUsbOtgDriver.Close();
 
 		test.Printf(_L("Free the LDD.\n"));
-		OstTrace0(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP12, "Free the LDD.\n");
 		err = User::FreeLogicalDevice( RUsbOtgDriver::Name() );			
 		if (err != KErrNone)
 			{
 			test.Printf(_L("<Error %d> Unable to UN-load driver: %S"), err, &KOTGDeviceInterfaceDriverName);
-			OstTraceExt2(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP13, "<Error %d> Unable to UN-load driver: %S", err, KOTGDeviceInterfaceDriverName);
 			}		
 		test.Printf(_L("#############\nPress any key.\n"));
-		OstTrace0(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP14, "#############\nPress any key.\n");
 		}
 		test.Getch();
 
 		test.Printf(_L("Free the LDD.\n"));
-		OstTrace0(TRACE_NORMAL, PROTOTYPECODE_PROTOTYPECODE_DUP15, "Free the LDD.\n");
 		// end this process, if we do not want to run a test now as well
 		RProcess process;
 		process.Open(RProcess().Id());
@@ -195,10 +190,7 @@
 
 static void MainL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(MAINL_MAINL);
-	    }
+	LOG_FUNC
 	// Leave the hooks in for platform security
 #ifdef __DATA_CAGING__
 	RProcess().DataCaging(RProcess::EDataCagingOn);
@@ -254,15 +246,9 @@
 	else
 		{
 		if (-2 == err)
-		    {
 			test.Printf(_L("Warning, no tests were selected!: %d\n"), err);
-			OstTrace1(TRACE_NORMAL, MAINL_MAINL_DUP01, "Warning, no tests were selected!: %d\n", err);
-			}
 		else
-		    {
 			test.Printf(_L("Unable to create the test engine: %d\n"), err);
-			OstTrace1(TRACE_NORMAL, MAINL_MAINL_DUP02, "Unable to create the test engine: %d\n", err);
-			}
 		}
 
 	// test DONE, if we are running manual, have a delay
@@ -270,21 +256,18 @@
 		{
 		// Get the engine to hang around so we can look at the screen output
 		test.Printf(KPressAnyKeyToEnd);
-		OstTrace0(TRACE_NORMAL, MAINL_MAINL_DUP03, KPressAnyKeyToEnd);
 		test.Getch();
 		}
 
 	__UHEAP_MARKEND;
 #ifdef _DEBUG
 	test.Printf(_L("Test heap leaks #1 OK\n"));
-	OstTrace0(TRACE_NORMAL, MAINL_MAINL_DUP04, "Test heap leaks #1 OK\n");
 #endif
 
 	CleanupStack::PopAndDestroy(sched);
 	__UHEAP_MARKEND;
 #ifdef _DEBUG
 	test.Printf(_L("Test heap leaks #2 OK\n"));
-	OstTrace0(TRACE_NORMAL, MAINL_MAINL_DUP05, "Test heap leaks #2 OK\n");
 #endif
 	
 	// Finish test and release resources - this ends up closing the console (our application window)
@@ -296,10 +279,7 @@
 
 TInt E32Main()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(E32MAIN_E32MAIN);
-	    }
+	LOG_FUNC
 	// Create the new trap-cleanup mechanism
 	CTrapCleanup* cleanup = CTrapCleanup::New();
 	
@@ -313,7 +293,6 @@
 	if (err != KErrNone)
 		{
 		test.Printf(_L("MainL error: %d\n"),err);		
-		OstTrace1(TRACE_NORMAL, E32MAIN_E32MAIN_DUP01, "MainL error: %d\n",err);		
 		}
 	
 	delete cleanup;
--- a/kerneltest/e32test/usbho/t_otgdi/src/t_otgdi_fdfactor.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/t_otgdi_fdfactor.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,10 +19,6 @@
 */
 
 #include "t_otgdi_fdfactor.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "t_otgdi_fdfactorTraces.h"
-#endif
 #include <Usb.h>
 
 #define LOG_FUNC
@@ -52,7 +48,7 @@
 	TInt err(iDriver.Open());
 	if (err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CACTORFDF_CONSTRUCTL, "<Error %d> Unable to open driver channel",err);
+		RDebug::Print(_L("<Error %d> Unable to open driver channel"),err);
 		User::Leave(err);
 		}		
 	
@@ -60,7 +56,7 @@
 	if (err != KErrNone)
 		{
 		// Test case did not run successfully
-		OstTrace1(TRACE_NORMAL, CACTORFDF_CONSTRUCTL_DUP01, "<Error %d> USB Host stack not starting",err);		
+		RDebug::Print(_L("<Error %d> USB Host stack not starting"),err);		
 		}
 	}
 
@@ -96,7 +92,7 @@
 void CActorFDF::Monitor()
 	{
 	LOG_FUNC
-	OstTrace0(TRACE_NORMAL, CACTORFDF_MONITOR, "Monitoring Bus Events");
+	RDebug::Print(_L("Monitoring Bus Events"));
 	iDriver.WaitForBusEvent(iBusEvent,iStatus);
 	SetActive();
 	}
@@ -114,14 +110,14 @@
 
 	// Obtain completion code
 	TInt completionCode(iStatus.Int());
-	OstTrace1(TRACE_NORMAL, CACTORFDF_RUNL, "Completion code  : %d",completionCode);
+	RDebug::Print(_L("Completion code  : %d"),completionCode);
 	
 	 if (completionCode == KErrNone)
 		{
 		if (iBusEvent.iEventType == RUsbHubDriver::TBusEvent::EDeviceAttached)
 			{
 			// Device Attached
-			OstTrace1(TRACE_NORMAL, CACTORFDF_RUNL_DUP01, "Usb device attached: %d",iBusEvent.iDeviceHandle);
+			RDebug::Print(_L("Usb device attached: %d"),iBusEvent.iDeviceHandle);
 			
 			// Create the test device object
 			iDevices.InsertL(iBusEvent.iDeviceHandle,CUsbTestDevice::NewL(iDriver,iBusEvent.iDeviceHandle,iObserver));
@@ -133,23 +129,23 @@
 			CUsbTestDevice* newDevice = iDevices.FindL(iBusEvent.iDeviceHandle);
 			if(newDevice)
 				{
-				OstTrace1(TRACE_NORMAL, CACTORFDF_RUNL_DUP02, "Suspending device %d",iBusEvent.iDeviceHandle);
+				RDebug::Print(_L("Suspending device %d"),iBusEvent.iDeviceHandle);
 				TInt err = newDevice->Suspend();
 				if(err)
 					{
-					OstTraceExt2(TRACE_NORMAL, CACTORFDF_RUNL_DUP03, "Suspending device %d returned error %d", (TInt)iBusEvent.iDeviceHandle, err);
+					RDebug::Print(_L("Suspending device %d returned error %d"), iBusEvent.iDeviceHandle, err);
 					}
 				}
 			else
 				{
-				OstTrace1(TRACE_NORMAL, CACTORFDF_RUNL_DUP04, "Can't find newly attached device %d",iBusEvent.iDeviceHandle);
+				RDebug::Print(_L("Can't find newly attached device %d"),iBusEvent.iDeviceHandle);
 				}
 
 			}
 		else if (iBusEvent.iEventType == RUsbHubDriver::TBusEvent::EDeviceRemoved)
 			{
 			// Device Removed
-			OstTrace1(TRACE_NORMAL, CACTORFDF_RUNL_DUP05, "Usb device removed: %d",iBusEvent.iDeviceHandle);
+			RDebug::Print(_L("Usb device removed: %d"),iBusEvent.iDeviceHandle);
 			
 			// Notify observer
 			iObserver.DeviceRemovedL(iBusEvent.iDeviceHandle);
@@ -160,12 +156,12 @@
 			}
 		else
 			{
-			OstTraceExt2(TRACE_NORMAL, CACTORFDF_RUNL_DUP06, "<Warning> Bus event %d occured, still monitoring, reason = %d",iBusEvent.iEventType, iBusEvent.iReason);
+			RDebug::Print(_L("<Warning> Bus event %d occured, still monitoring, reason = %d"),iBusEvent.iEventType, iBusEvent.iReason);
 			}
 		}
 	else
 		{
-		OstTraceExt2(TRACE_NORMAL, CACTORFDF_RUNL_DUP07, "<Error %d> Bus event %d",completionCode,iBusEvent.iEventType);
+		RDebug::Print(_L("<Error %d> Bus event %d"),completionCode,iBusEvent.iEventType);
 		iObserver.BusErrorL(completionCode);
 		}
 	Monitor();	//	Requeue for notification of further bus events
@@ -175,7 +171,7 @@
 TInt CActorFDF::RunError(TInt aError)
 	{
 	LOG_FUNC
-	OstTrace1(TRACE_NORMAL, CACTORFDF_RUNERROR, "<Error %d> CActorFDF::RunError",aError);
+	RDebug::Print(_L("<Error %d> CActorFDF::RunError"),aError);
 	return KErrNone;
 	}
 	
@@ -226,14 +222,14 @@
 	TInt err(iDevice.GetDeviceDescriptor(iDeviceDescriptor));
 	if (err != KErrNone)
 		{
-		OstTraceExt2(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL, "<Error %d> Getting device (%d) descriptor",err,(TInt)iHandle);
+		RDebug::Print(_L("<Error %d> Getting device (%d) descriptor"),err,iHandle);
 		User::Leave(err);
 		}
 	
 	err = iDevice.GetConfigurationDescriptor(iConfigDescriptor);
 	if (err != KErrNone)
 		{
-		OstTraceExt2(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP01, "<Error %d> Getting device (%d) configuration descriptor",err,(TInt)iHandle);
+		RDebug::Print(_L("<Error %d> Getting device (%d) configuration descriptor"),err,iHandle);
 		User::Leave(err);
 		}
 
@@ -241,10 +237,10 @@
 	iPid = iDeviceDescriptor.ProductId();
 	iVid = iDeviceDescriptor.VendorId();
 	
-	OstTrace1(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP02, "%dmA configuration maximum power consumption",iConfigDescriptor.MaxPower()*2);
-	OstTrace1(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP03, "%d number of interface(s)",iConfigDescriptor.NumInterfaces());
-	OstTraceExt2(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP04, "Vendor Id=0x%04x, Product Id=0x%04x",iVid,iPid);
-	OstTrace1(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP05, "TotalLength() = %d",iConfigDescriptor.TotalLength());
+	RDebug::Print(_L("%dmA configuration maximum power consumption"),iConfigDescriptor.MaxPower()*2);
+	RDebug::Print(_L("%d number of interface(s)"),iConfigDescriptor.NumInterfaces());
+	RDebug::Print(_L("Vendor Id=0x%04x, Product Id=0x%04x"),iVid,iPid);
+	RDebug::Print(_L("TotalLength() = %d"),iConfigDescriptor.TotalLength());
 
 	// Get changes in device state
 	iDevice.QueueDeviceStateChangeNotification(iCurrentState,iStatus); // iCurrentState now holds the current device state
@@ -301,7 +297,7 @@
 	
 	if ( completionCode != KErrCancel )
 		{
-		OstTrace1(TRACE_NORMAL, CUSBTESTDEVICE_RUNL, "CUsbTestDevice::RunL completionCode(%d)",completionCode);
+		RDebug::Print(_L("CUsbTestDevice::RunL completionCode(%d)"),completionCode);
 		}
 	
 	if(completionCode == KErrNone)
@@ -319,7 +315,7 @@
 	{
 	LOG_FUNC
 
-	OstTrace1(TRACE_NORMAL, CUSBTESTDEVICE_RUNERROR, "<Error %d>",aError);
+	RDebug::Print(_L("<Error %d>"),aError);
 	return KErrNone;
 	}
 
@@ -337,7 +333,7 @@
 	TInt err=iTotgdiProcess.RendezvousCancel(iStatus);
 	if(err)
 		{
-		OstTrace1(TRACE_NORMAL, CFDFTOTGDIWATCHER_DOCANCEL, "Cancelling Rendezvous completed with %d",err);
+		RDebug::Print(_L("Cancelling Rendezvous completed with %d"),err);
 		}
 	}
 	
@@ -345,7 +341,7 @@
 	{
 	//	The t_otgdi process has signalled its rendezvous
 	//	Time to stop the active scheduler, tidy up and go away
-	OstTrace0(TRACE_NORMAL, CFDFTOTGDIWATCHER_RUNL, "Rendezvous signalled from t_otgdi");
+	RDebug::Print(_L("Rendezvous signalled from t_otgdi"));
 	CActiveScheduler::Stop();
 	}
 	
@@ -363,7 +359,7 @@
 	
 	if(err)
 		{
-		OstTrace0(TRACE_NORMAL, CFDFTOTGDIWATCHER_CONSTRUCTL, "Couldn't open process handle to t_otgdi.exe");
+		RDebug::Print(_L("Couldn't open process handle to t_otgdi.exe"));
 		}
 	User::LeaveIfError(err);
 
@@ -374,13 +370,13 @@
 	
 TInt CFdfTOtgdiWatcher::FindTOtgdiProcessName(TFullName& aProcessName)
 	{
-	OstTrace0(TRACE_NORMAL, CFDFTOTGDIWATCHER_FINDTOTGDIPROCESSNAME, "Into FindTOtgdiProcessName");
+	RDebug::Print(_L("Into FindTOtgdiProcessName"));
 	TInt successCode = KErrNotFound;
 	TFindProcess fp;
 	fp.Find(_L("t_otgdi.exe*"));	//	Process name match pattern
 	while(fp.Next(aProcessName)==KErrNone)
 		{
-		OstTraceExt1(TRACE_NORMAL, CFDFTOTGDIWATCHER_FINDTOTGDIPROCESSNAME_DUP01, "FDFActor Found process %S",aProcessName);
+		RDebug::Print(_L("FDFActor Found process %S"),&aProcessName);
 		successCode = KErrNone;
 		}
 	return successCode;
@@ -393,9 +389,9 @@
 	
 CFdfTOtgdiWatcher::~CFdfTOtgdiWatcher()
 	{
-	OstTrace0(TRACE_NORMAL, CFDFTOTGDIWATCHER_DCFDFTOTGDIWATCHER, "About to call CFdfTOtgdiWatcher::Cancel");
+	RDebug::Print(_L("About to call CFdfTOtgdiWatcher::Cancel"));
 	Cancel();
-	OstTrace0(TRACE_NORMAL, CFDFTOTGDIWATCHER_DCFDFTOTGDIWATCHER_DUP01, "About to call iTotgdiProcess.Close");
+	RDebug::Print(_L("About to call iTotgdiProcess.Close"));
 	iTotgdiProcess.Close();
 	}
 
--- a/kerneltest/e32test/usbho/t_otgdi/src/t_otgdi_fdfactor_main.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/t_otgdi_fdfactor_main.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,10 +24,6 @@
 #include <e32std_private.h>
 
 #include "t_otgdi_fdfactor.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "t_otgdi_fdfactor_mainTraces.h"
-#endif
 
 LOCAL_C void DoStartL()
 	{
@@ -35,7 +31,7 @@
 	TInt err = User::LoadLogicalDevice(KDriverLddFileName);
 	if(err)
 		{
-		OstTrace1(TRACE_NORMAL, DOSTARTL_DOSTARTL, "FDFActor failed to load LDD %d",err);
+		RDebug::Print(_L("FDFActor failed to load LDD %d"),err);
 		}
 
 	// Create active scheduler (to run active objects)
@@ -67,7 +63,7 @@
 	err = User::FreeLogicalDevice(RUsbHubDriver::Name());
 	if(err)
 		{
-		OstTrace1(TRACE_NORMAL, DOSTARTL_DOSTARTL_DUP01, "FDFActor failed to unload LDD %d",err);
+		RDebug::Print(_L("FDFActor failed to unload LDD %d"),err);
 		}	
 	}
 
@@ -85,7 +81,7 @@
 
 	if (mainError)
 		{
-		OstTrace1(TRACE_NORMAL, E32MAIN_E32MAIN, "FDF Actor left with %d", mainError);
+		RDebug::Print(_L("FDF Actor left with %d"), mainError);
 		//	Also means that we left before we did a Rendezvous(KErrNone) to free up t_otgdi.exe
 		//	Rendezvous with KErrAbort to indicate we couldn't start up properly.
 		RProcess::Rendezvous(KErrAbort);
@@ -94,7 +90,7 @@
 	delete cleanup;
 	__UHEAP_MARKEND;
 
-	OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP01, "About to end FDFActor process");
+	RDebug::Print(_L("About to end FDFActor process"));
 	return KErrNone;
 	}
 
--- a/kerneltest/e32test/usbho/t_otgdi/src/t_otgdi_uid.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/t_otgdi_uid.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+* 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"
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0456.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0456.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -26,10 +26,6 @@
 #include "testcaseroot.h"
 #include "testcasefactory.h"
 #include "testcase0456.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0456Traces.h"
-#endif
 
 
 
@@ -42,10 +38,7 @@
 
 CTestCase0456* CTestCase0456::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0456_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0456* self = new (ELeave) CTestCase0456(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -57,10 +50,7 @@
 CTestCase0456::CTestCase0456(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{	
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0456_CTESTCASE0456);
-	    }
+	LOG_FUNC
 	} 
 
 
@@ -69,10 +59,7 @@
 */
 void CTestCase0456::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0456_CONSTRUCTL);
-	    }
+	LOG_FUNC
 	iRepeats = OPEN_REPEATS;
 	
 	BaseConstructL();
@@ -81,10 +68,7 @@
 
 CTestCase0456::~CTestCase0456()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0456_DCTESTCASE0456);
-	    }
+	LOG_FUNC
 
 	Cancel();
 	}
@@ -92,10 +76,7 @@
 
 void CTestCase0456::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0456_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EPreconditions;
 	
 	CActiveScheduler::Add(this);
@@ -106,16 +87,12 @@
 void CTestCase0456::DescribePreconditions()
 	{
 	test.Printf(_L("Insert A connector beforehand.\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0456_DESCRIBEPRECONDITIONS, "Insert A connector beforehand.\n");
 	}
 
 	
 void CTestCase0456::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0456_DOCANCEL);
-	    }
+	LOG_FUNC
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -125,10 +102,7 @@
 // handle event completion	
 void CTestCase0456::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0456_RUNSTEPL);
-	    }
+	LOG_FUNC
 
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
@@ -138,7 +112,6 @@
 		case EPreconditions:
 			{
 			test.Printf(KPressAnyKeyToStart);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0456_RUNSTEPL_DUP01, KPressAnyKeyToStart);
 			iCaseStep = ELoadLdd;
 			RequestCharacter();			
 			break;			
@@ -147,7 +120,6 @@
 		
 		case ELoadLdd:
 			test.Printf(_L("Load the LDD iteration %d/%d\n"), OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
-			OstTraceExt2(TRACE_NORMAL, CTESTCASE0456_RUNSTEPL_DUP02, "Load the LDD iteration %d/%d\n", OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
 			if (!StepLoadLDD())
 				{
 				break;
@@ -166,7 +138,6 @@
 						
 		case ELoopDecrement:
 			test.Printf(_L("Repeat test\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0456_RUNSTEPL_DUP03, "Repeat test\n");
 
 			if (--iRepeats)
 				iCaseStep = ELoadLdd;
@@ -183,7 +154,6 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0456_RUNSTEPL_DUP04, "<Error> unknown test step");
 			Cancel();
 			TestPolicy().SignalTestComplete(KErrCorrupt);
 			break;
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0457.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0457.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,10 +24,6 @@
 #include <e32Test.h>	// RTest headder
 #include "testcaseroot.h"
 #include "testcase0457.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0457Traces.h"
-#endif
 
 
 
@@ -41,10 +37,7 @@
 
 CTestCase0457* CTestCase0457::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0457_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0457* self = new (ELeave) CTestCase0457(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -56,10 +49,7 @@
 CTestCase0457::CTestCase0457(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{	
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0457_CTESTCASE0457);
-	    }
+	LOG_FUNC
 	} 
 
 
@@ -68,10 +58,7 @@
 */
 void CTestCase0457::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0457_CONSTRUCTL);
-	    }
+	LOG_FUNC
 	iRepeats = OPEN_REPEATS;
 	
 	BaseConstructL();
@@ -80,10 +67,7 @@
 
 CTestCase0457::~CTestCase0457()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0457_DCTESTCASE0457);
-	    }
+	LOG_FUNC
 
 	Cancel();
 	}
@@ -91,10 +75,7 @@
 
 void CTestCase0457::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0457_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EPreconditions;
 	
 	CActiveScheduler::Add(this);
@@ -105,16 +86,12 @@
 void CTestCase0457::DescribePreconditions()
 	{
 	test.Printf(_L("Remove any USB plug beforehand.\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0457_DESCRIBEPRECONDITIONS, "Remove any USB plug beforehand.\n");
 	}
 
 	
 void CTestCase0457::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0457_DOCANCEL);
-	    }
+	LOG_FUNC
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -124,10 +101,7 @@
 // handle event completion	
 void CTestCase0457::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0457_RUNSTEPL);
-	    }
+	LOG_FUNC
 
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
@@ -137,7 +111,6 @@
 		case EPreconditions:
 			{
 			test.Printf(KPressAnyKeyToStart);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0457_RUNSTEPL_DUP01, KPressAnyKeyToStart);
 			iCaseStep = ELoadLdd;
 			RequestCharacter();			
 			break;			
@@ -145,7 +118,6 @@
 
 		case ELoadLdd:
 			test.Printf(_L("Load the LDD iteration %d/%d\n"), OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
-			OstTraceExt2(TRACE_NORMAL, CTESTCASE0457_RUNSTEPL_DUP02, "Load the LDD iteration %d/%d\n", OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
 			if (!StepLoadLDD())
 				{
 				break;
@@ -164,7 +136,6 @@
 						
 		case ELoopDecrement:
 			test.Printf(_L("Repeat test\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0457_RUNSTEPL_DUP03, "Repeat test\n");
 
 			if (--iRepeats)
 				iCaseStep = ELoadLdd;
@@ -181,7 +152,6 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0457_RUNSTEPL_DUP04, "<Error> unknown test step");
 			Cancel();
 			TestPolicy().SignalTestComplete(KErrCorrupt);
 			break;
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0458.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0458.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,10 +24,6 @@
 #include <e32Test.h>	// RTest headder
 #include "testcaseroot.h"
 #include "testcase0458.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0458Traces.h"
-#endif
 
 
 
@@ -59,10 +55,7 @@
 */
 void CTestCase0458::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0458_CONSTRUCTL);
-	    }
+	LOG_FUNC
 	iRepeats = OPEN_REPEATS;
 	
 	BaseConstructL();
@@ -71,10 +64,7 @@
 
 CTestCase0458::~CTestCase0458()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0458_DCTESTCASE0458);
-	    }
+	LOG_FUNC
 
 	Cancel();
 	}
@@ -82,10 +72,7 @@
 
 void CTestCase0458::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0458_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EPreconditions;
 	
 	CActiveScheduler::Add(this);
@@ -96,18 +83,13 @@
 void CTestCase0458::DescribePreconditions()
 	{
 	test.Printf(_L("Insert 'B' connector from cable\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0458_DESCRIBEPRECONDITIONS, "Insert 'B' connector from cable\n");
 	test.Printf(_L("attached to powered host beforehand.\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0458_DESCRIBEPRECONDITIONS_DUP01, "attached to powered host beforehand.\n");
 	}
 
 	
 void CTestCase0458::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0458_DOCANCEL);
-	    }
+	LOG_FUNC
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -117,10 +99,7 @@
 // handle event completion	
 void CTestCase0458::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0458_RUNSTEPL);
-	    }
+	LOG_FUNC
 
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
@@ -130,7 +109,6 @@
 		case EPreconditions:
 			{
 			test.Printf(KPressAnyKeyToStart);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0458_RUNSTEPL_DUP01, KPressAnyKeyToStart);
 			iCaseStep = ELoadLdd;
 			RequestCharacter();			
 			break;			
@@ -138,7 +116,6 @@
 
 		case ELoadLdd:
 			test.Printf(_L("Load the LDD iteration %d/%d\n"), OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
-			OstTraceExt2(TRACE_NORMAL, CTESTCASE0458_RUNSTEPL_DUP02, "Load the LDD iteration %d/%d\n", OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
 			if (!StepLoadLDD())
 				{
 				break;
@@ -157,7 +134,6 @@
 						
 		case ELoopDecrement:
 			test.Printf(_L("Repeat test\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0458_RUNSTEPL_DUP03, "Repeat test\n");
 
 			if (--iRepeats)
 				{
@@ -178,7 +154,6 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0458_RUNSTEPL_DUP04, "<Error> unknown test step");
 			Cancel();
 			TestPolicy().SignalTestComplete(KErrCorrupt);
 			break;
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0459.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0459.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -25,10 +25,6 @@
 #include "testcaseroot.h"
 #include "testcasefactory.h"
 #include "testcase0459.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0459Traces.h"
-#endif
 
 
 
@@ -39,10 +35,7 @@
 
 CTestCase0459* CTestCase0459::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0459_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0459* self = new (ELeave) CTestCase0459(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -54,10 +47,7 @@
 CTestCase0459::CTestCase0459(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0459_CTESTCASE0459);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -67,10 +57,7 @@
 */
 void CTestCase0459::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0459_CONSTRUCTL);
-	    }
+	LOG_FUNC
 	
 	BaseConstructL();
 	}
@@ -78,10 +65,7 @@
 
 CTestCase0459::~CTestCase0459()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0459_DCTESTCASE0459);
-	    }
+	LOG_FUNC
 
 	Cancel();
 	}
@@ -89,10 +73,7 @@
 
 void CTestCase0459::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0459_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EPreconditions;
 	
 	CActiveScheduler::Add(this);
@@ -104,16 +85,12 @@
 void CTestCase0459::DescribePreconditions()
 	{
 	test.Printf(_L("Remove 'A' connector beforehand.\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0459_DESCRIBEPRECONDITIONS, "Remove 'A' connector beforehand.\n");
 	}
 
 	
 void CTestCase0459::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0459_DOCANCEL);
-	    }
+	LOG_FUNC
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -123,10 +100,7 @@
 // handle event completion	
 void CTestCase0459::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0459_RUNSTEPL);
-	    }
+	LOG_FUNC
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -143,9 +117,7 @@
 				}
 			// prompt to remove connector
 			test.Printf(KRemoveAConnectorPrompt);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0459_RUNSTEPL_DUP01, KRemoveAConnectorPrompt);
 			test.Printf(KPressAnyKeyToContinue);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0459_RUNSTEPL_DUP02, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			
@@ -168,10 +140,8 @@
 				}
 
 			test.Printf(KInsertAConnectorPrompt);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0459_RUNSTEPL_DUP03, KInsertAConnectorPrompt);
 			iCaseStep = ETestStateA;
 			test.Printf(_L("Waiting for OTG Event\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0459_RUNSTEPL_DUP04, "Waiting for OTG Event\n");
 
 			otgQueueOtgEventRequest( iOTGEvent, iStatus);
 
@@ -196,7 +166,6 @@
 			TTimeIntervalMicroSeconds ivlMicro(iIDcheckEnd.MicroSecondsFrom(iIDcheckStart));
 			aMillisec = (TInt)(ivlMicro.Int64())/1000;	// USB times are in uSec, but in ms for the user layer
 			test.Printf(_L("Received event %d '%S' status(%d) in %d ms"), iOTGEvent, &aDescription, completionCode, aMillisec);
-			OstTraceExt4(TRACE_NORMAL, CTESTCASE0459_RUNSTEPL_DUP05, "Received event %d '%S' status(%d) in %d ms", iOTGEvent, aDescription, completionCode, aMillisec);
 			
 			// check the parameters gathered
 			if (RUsbOtgDriver::EEventAPlugInserted == iOTGEvent)
@@ -207,7 +176,6 @@
 					{
 					// 'A' was in the receptacle when we started the stack, so it fires immediately, consume it and wait for another.
 					test.Printf(_L("Please first remove and then replace the A connector.\n"));
-					OstTrace0(TRACE_NORMAL, CTESTCASE0459_RUNSTEPL_DUP06, "Please first remove and then replace the A connector.\n");
 					// wrong event in the Q already, keep at it
 					iCaseStep = ERegisterForEvents;	
 					}
@@ -231,7 +199,6 @@
 
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0459_RUNSTEPL_DUP07, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0460.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0460.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -25,10 +25,6 @@
 #include "testcaseroot.h"
 #include "testcasefactory.h"
 #include "testcase0460.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0460Traces.h"
-#endif
 
 
 
@@ -40,10 +36,7 @@
 
 CTestCase0460* CTestCase0460::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0460_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0460* self = new (ELeave) CTestCase0460(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -55,10 +48,7 @@
 CTestCase0460::CTestCase0460(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0460_CTESTCASE0460);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -68,10 +58,7 @@
 */
 void CTestCase0460::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0460_CONSTRUCTL);
-	    }
+	LOG_FUNC
 	
 	BaseConstructL();
 	}
@@ -79,10 +66,7 @@
 
 CTestCase0460::~CTestCase0460()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0460_DCTESTCASE0460);
-	    }
+	LOG_FUNC
 
 	Cancel();
 	}
@@ -90,10 +74,7 @@
 
 void CTestCase0460::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0460_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EPreconditions;
 	
 	CActiveScheduler::Add(this);
@@ -105,16 +86,12 @@
 void CTestCase0460::DescribePreconditions()
 	{
 	test.Printf(_L("Insert 'A' connector beforehand.\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0460_DESCRIBEPRECONDITIONS, "Insert 'A' connector beforehand.\n");
 	}
 
 	
 void CTestCase0460::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0460_DOCANCEL);
-	    }
+	LOG_FUNC
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -124,10 +101,7 @@
 // handle event completion	
 void CTestCase0460::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0460_RUNSTEPL);
-	    }
+	LOG_FUNC
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -144,9 +118,7 @@
 				}
 			// prompt to remove connector
 			test.Printf(KRemoveAConnectorPrompt);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0460_RUNSTEPL_DUP01, KRemoveAConnectorPrompt);
 			test.Printf(KPressAnyKeyToContinue);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0460_RUNSTEPL_DUP02, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			
@@ -161,9 +133,7 @@
 
 			// prompt to insert connector
 			test.Printf(KInsertAConnectorPrompt);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0460_RUNSTEPL_DUP03, KInsertAConnectorPrompt);
 			test.Printf(KPressAnyKeyToContinue);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0460_RUNSTEPL_DUP04, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			// wait on ID_PIN
@@ -175,7 +145,6 @@
 			iCaseStep = ETestStateA;
 
 			test.Printf(_L("Waiting for OTG Event\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0460_RUNSTEPL_DUP05, "Waiting for OTG Event\n");
 			otgQueueOtgEventRequest( iOTGEvent, iStatus);
 
 			SetActive();
@@ -191,7 +160,6 @@
 		case ETestStateA:
 			OtgEventString(iOTGEvent, aDescription);
 			test.Printf(_L("Received event %d '%S' status(%d)"), iOTGEvent, &aDescription, completionCode);
-			OstTraceExt3(TRACE_NORMAL, CTESTCASE0460_RUNSTEPL_DUP06, "Received event %d '%S' status(%d)", iOTGEvent, aDescription, completionCode);
 			if (RUsbOtgDriver::EEventAPlugInserted == iOTGEvent)
 				{
 				iCaseStep = EUnloadLdd;
@@ -215,7 +183,6 @@
 
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0460_RUNSTEPL_DUP07, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0461.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0461.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -25,10 +25,6 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0461.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0461Traces.h"
-#endif
 
 
 
@@ -39,10 +35,7 @@
 
 CTestCase0461* CTestCase0461::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0461_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0461* self = new (ELeave) CTestCase0461(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -54,10 +47,7 @@
 CTestCase0461::CTestCase0461(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0461_CTESTCASE0461);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -67,10 +57,7 @@
 */
 void CTestCase0461::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0461_CONSTRUCTL);
-	    }
+	LOG_FUNC
 	iRepeats = KOperationRetriesMax;
 	BaseConstructL();
 	
@@ -80,10 +67,7 @@
 
 CTestCase0461::~CTestCase0461()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0461_DCTESTCASE0461);
-	    }
+	LOG_FUNC
 
 	Cancel();
 	delete iWDTimer;
@@ -92,10 +76,7 @@
 
 void CTestCase0461::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0461_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = ELoadLdd;
 	
 	CActiveScheduler::Add(this);
@@ -107,16 +88,12 @@
 void CTestCase0461::DescribePreconditions()
 	{
 	test.Printf(_L("Insert 'A' connector beforehand.\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0461_DESCRIBEPRECONDITIONS, "Insert 'A' connector beforehand.\n");
 	}
 
 	
 void CTestCase0461::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0461_DOCANCEL);
-	    }
+	LOG_FUNC
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -134,10 +111,7 @@
 // handle event completion	
 void CTestCase0461::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0461_RUNSTEPL);
-	    }
+	LOG_FUNC
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -154,9 +128,7 @@
 				}
 			// prompt to insert connector
 			test.Printf(KInsertAConnectorPrompt);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0461_RUNSTEPL_DUP01, KInsertAConnectorPrompt);
 			test.Printf(KPressAnyKeyToContinue);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0461_RUNSTEPL_DUP02, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			
@@ -175,7 +147,6 @@
 		case ERegisterForEvents:
 			// prompt to remove connector
 			test.Printf(KRemoveAConnectorPrompt);		
-			OstTrace0(TRACE_NORMAL, CTESTCASE0461_RUNSTEPL_DUP03, KRemoveAConnectorPrompt);		
 			if (iDequeAttempts > 3)
 				{
 				return (TestFailed(KErrCorrupt, _L("<Error> too many irrelevant/incorrect events")));
@@ -208,7 +179,6 @@
 		case EGetAndCancelEvent: //4.
 			OtgEventString(iOTGEvent, aDescription);
 			test.Printf(_L("Received event %d '%S' status(%d)"), iOTGEvent, &aDescription, completionCode);
-			OstTraceExt3(TRACE_NORMAL, CTESTCASE0461_RUNSTEPL_DUP04, "Received event %d '%S' status(%d)", iOTGEvent, aDescription, completionCode);
 			if (RUsbOtgDriver::EEventAPlugRemoved == iOTGEvent)
 				{
 				otgQueueOtgEventRequest( iOTGEvent, iStatus);
@@ -242,10 +212,8 @@
 			iWDTimer->Cancel();
 			iConsole->ReadCancel();
 			test.Printf(KInsertAConnectorPrompt);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0461_RUNSTEPL_DUP05, KInsertAConnectorPrompt);
 			iCaseStep = ERemoveA;
 			test.Printf(KPressAnyKeyToContinue);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0461_RUNSTEPL_DUP06, KPressAnyKeyToContinue);
 			
 			RequestCharacter();
 			iWDTimer->IssueRequest(KDelayDurationForUserActivityMS, this, &CancelKB);			
@@ -258,7 +226,6 @@
 			iWDTimer->Cancel();
 			iConsole->ReadCancel();
 			test.Printf(KRemoveAConnectorPrompt);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0461_RUNSTEPL_DUP07, KRemoveAConnectorPrompt);
 			if (iRepeats-- >0)
 				{
 				// Do it again please
@@ -269,7 +236,6 @@
 				iCaseStep = ETallyEvents;
 				}
 			test.Printf(KPressAnyKeyToContinue);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0461_RUNSTEPL_DUP08, KPressAnyKeyToContinue);
 
 			RequestCharacter();			
 			iWDTimer->IssueRequest(KDelayDurationForUserActivityMS, this, &CancelKB);			
@@ -308,7 +274,6 @@
 
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0461_RUNSTEPL_DUP09, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0462.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0462.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,10 +24,6 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0462.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0462Traces.h"
-#endif
 
 
 
@@ -38,10 +34,7 @@
 
 CTestCase0462* CTestCase0462::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0462_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0462* self = new (ELeave) CTestCase0462(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -53,10 +46,7 @@
 CTestCase0462::CTestCase0462(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0462_CTESTCASE0462);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -66,10 +56,7 @@
 */
 void CTestCase0462::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0462_CONSTRUCTL);
-	    }
+	LOG_FUNC
 	iRepeats = KOperationRetriesMax;
 	iWDTimer = CTestCaseWatchdog::NewL();
 	
@@ -79,10 +66,7 @@
 
 CTestCase0462::~CTestCase0462()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0462_DCTESTCASE0462);
-	    }
+	LOG_FUNC
 
 	Cancel();
 	delete iWDTimer;
@@ -91,10 +75,7 @@
 
 void CTestCase0462::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0462_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = ELoadLdd;
 	
 	CActiveScheduler::Add(this);
@@ -106,16 +87,12 @@
 void CTestCase0462::DescribePreconditions()
 	{
 	test.Printf(_L("Insert 'A' connector beforehand.\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0462_DESCRIBEPRECONDITIONS, "Insert 'A' connector beforehand.\n");
 	}
 
 	
 void CTestCase0462::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0462_DOCANCEL);
-	    }
+	LOG_FUNC
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -134,10 +111,7 @@
 // handle event completion	
 void CTestCase0462::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0462_RUNSTEPL);
-	    }
+	LOG_FUNC
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	// NOTE: Look at its iStatus.iFlags. 
@@ -158,9 +132,7 @@
 				}
 			// prompt to insert connector
 			test.Printf(KInsertAConnectorPrompt);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0462_RUNSTEPL_DUP01, KInsertAConnectorPrompt);
 			test.Printf(KPressAnyKeyToContinue);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0462_RUNSTEPL_DUP02, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			
@@ -179,7 +151,6 @@
 		case ERegisterForEvents:
 			// prompt to remove connector
 			test.Printf(KRemoveAConnectorPrompt);		
-			OstTrace0(TRACE_NORMAL, CTESTCASE0462_RUNSTEPL_DUP03, KRemoveAConnectorPrompt);		
 			if (iDequeAttempts > 3)
 				{
 				return (TestFailed(KErrCorrupt, _L("<Error> too many irrelevant/incorrect events")));
@@ -214,7 +185,6 @@
 		case EGetAndCancelEvent:
 			OtgEventString(iOTGEvent, aDescription);
 			test.Printf(_L("Received event %d '%S' status(%d)"), iOTGEvent, &aDescription, completionCode);
-			OstTraceExt3(TRACE_NORMAL, CTESTCASE0462_RUNSTEPL_DUP04, "Received event %d '%S' status(%d)", iOTGEvent, aDescription, completionCode);
 			if (RUsbOtgDriver::EEventAPlugRemoved == iOTGEvent)
 				{
 				otgQueueOtgEventRequest( iOTGEvent, iStatus);
@@ -244,11 +214,9 @@
 		case EInsertA: // 6. remove 'A'
 			iConsole->ReadCancel();
 			test.Printf(KInsertAConnectorPrompt);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0462_RUNSTEPL_DUP05, KInsertAConnectorPrompt);
 
 			iCaseStep = ERemoveA;
 			test.Printf(KPressAnyKeyToContinue);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0462_RUNSTEPL_DUP06, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			
@@ -256,13 +224,11 @@
 		case ERemoveA:
 			iConsole->ReadCancel();
 			test.Printf(KRemoveAConnectorPrompt);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0462_RUNSTEPL_DUP07, KRemoveAConnectorPrompt);
 			if (iRepeats-- >0)
 				iCaseStep = EInsertA;
 			else
 				iCaseStep = ETallyEvents;
 			test.Printf(KPressAnyKeyToContinue);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0462_RUNSTEPL_DUP08, KPressAnyKeyToContinue);
 			RequestCharacter();
 			break;
 			
@@ -285,7 +251,6 @@
 
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0462_RUNSTEPL_DUP09, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0463.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0463.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,10 +24,6 @@
 #include <e32Test.h>	// RTest headder
 #include "testcaseroot.h"
 #include "testcase0463.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0463Traces.h"
-#endif
 
 
 
@@ -40,10 +36,7 @@
 
 CTestCase0463* CTestCase0463::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0463_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0463* self = new (ELeave) CTestCase0463(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -55,10 +48,7 @@
 CTestCase0463::CTestCase0463(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{	
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0463_CTESTCASE0463);
-	    }
+	LOG_FUNC
 	} 
 
 
@@ -67,10 +57,7 @@
 */
 void CTestCase0463::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0463_CONSTRUCTL);
-	    }
+	LOG_FUNC
 	iRepeats = OOMOPEN_REPEATS;
 	iAllocFailNumber = OOMOPEN_REPEATS + 1; // allocs 1..11 fail
 	
@@ -80,10 +67,7 @@
 
 CTestCase0463::~CTestCase0463()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0463_DCTESTCASE0463);
-	    }
+	LOG_FUNC
 
 	Cancel();
 	}
@@ -91,10 +75,7 @@
 
 void CTestCase0463::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0463_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EMarkStack;
 	CActiveScheduler::Add(this);
 
@@ -105,16 +86,12 @@
 void CTestCase0463::DescribePreconditions()
 	{
 	test.Printf(_L("Insert A connector beforehand.\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0463_DESCRIBEPRECONDITIONS, "Insert A connector beforehand.\n");
 	}
 
 	
 void CTestCase0463::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0463_DOCANCEL);
-	    }
+	LOG_FUNC
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -124,10 +101,7 @@
 // handle event completion	
 void CTestCase0463::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0463_RUNSTEPL);
-	    }
+	LOG_FUNC
 
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
@@ -143,7 +117,6 @@
 			__UHEAP_SETFAIL(RHeap::EDeterministic, iAllocFailNumber);
 			__UHEAP_MARK;
 			test.Printf(_L("Load the LDD iteration %d/%d\n"), OOMOPEN_REPEATS-iRepeats+1, OOMOPEN_REPEATS);
-			OstTraceExt2(TRACE_NORMAL, CTESTCASE0463_RUNSTEPL_DUP01, "Load the LDD iteration %d/%d\n", OOMOPEN_REPEATS-iRepeats+1, OOMOPEN_REPEATS);
 			aIntegerP = new TInt;
 			CleanupStack::PushL(aIntegerP);
 			if (!StepLoadLDD())
@@ -170,14 +143,12 @@
 				return TestFailed(KErrAbort,_L("Unload Ldd failure"));	
 			__UHEAP_MARKEND;
 			test.Printf(_L("Heap intact: Asize %d\n"), iAllocFailNumber);
-			OstTrace1(TRACE_NORMAL, CTESTCASE0463_RUNSTEPL_DUP03, "Heap intact: Asize %d\n", iAllocFailNumber);
 			iCaseStep = ELoopDecrement;
 			SelfComplete();			
 			break;
 						
 		case ELoopDecrement:
 			test.Printf(_L("Repeat test\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0463_RUNSTEPL_DUP04, "Repeat test\n");
 			__UHEAP_RESET;
 			iAllocFailNumber--;
 			
@@ -195,7 +166,6 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0463_RUNSTEPL_DUP05, "<Error> unknown test step");
 			Cancel();
 			TestPolicy().SignalTestComplete(KErrCorrupt);
 			break;
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0464.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0464.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -23,10 +23,6 @@
 #include <e32Test.h>	// RTest headder
 #include "testcaseroot.h"
 #include "testcase0464.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0464Traces.h"
-#endif
 
 
 
@@ -37,10 +33,7 @@
 
 CTestCase0464* CTestCase0464::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0464_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0464* self = new (ELeave) CTestCase0464(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -52,10 +45,7 @@
 CTestCase0464::CTestCase0464(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0464_CTESTCASE0464);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -65,10 +55,7 @@
 */
 void CTestCase0464::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0464_CONSTRUCTL);
-	    }
+	LOG_FUNC
 
 	BaseConstructL();
 	}
@@ -76,10 +63,7 @@
 
 CTestCase0464::~CTestCase0464()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0464_DCTESTCASE0464);
-	    }
+	LOG_FUNC
 
 	Cancel();
 	}
@@ -87,10 +71,7 @@
 
 void CTestCase0464::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0464_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EPreconditions;
 	
 	CActiveScheduler::Add(this);
@@ -101,16 +82,12 @@
 void CTestCase0464::DescribePreconditions()
 	{
 	test.Printf(_L("Insert 'A' connector beforehand.\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0464_DESCRIBEPRECONDITIONS, "Insert 'A' connector beforehand.\n");
 	}
 
 	
 void CTestCase0464::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0464_DOCANCEL);
-	    }
+	LOG_FUNC
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -130,10 +107,7 @@
 // handle event completion	
 void CTestCase0464::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0464_RUNSTEPL);
-	    }
+	LOG_FUNC
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -151,9 +125,7 @@
 				}
 			// prompt to insert 'A' connector
 			test.Printf(KInsertAConnectorPrompt);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0464_RUNSTEPL_DUP01, KInsertAConnectorPrompt);
 			test.Printf(KPressAnyKeyToContinue);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0464_RUNSTEPL_DUP02, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 
@@ -169,10 +141,6 @@
 
 		case EDriveBus:
 			LOG_VERBOSE1(_L("Turn ON VBus\n"))
-			if(gVerboseOutput)
-			    {
-			    OstTrace0(TRACE_VERBOSE, CTESTCASE0464_RUNSTEPL_DUP03, "Turn ON VBus\n");
-			    }
 			err = otgBusRequest();
 			if (KErrNone != err)
 				{
@@ -184,29 +152,19 @@
 
 		case EUnloadLdd:
 			LOG_VERBOSE1(_L("Unload.\n"))
-			if(gVerboseOutput)
-			    {
-			    OstTrace0(TRACE_VERBOSE, CTESTCASE0464_RUNSTEPL_DUP04, "Unload.\n");
-			    }
 			if (EFalse == StepUnloadLDD())
 				return TestFailed(KErrAbort,_L("unload Ldd failure"));	
 			test.Printf(_L("Measure VBus =0 and then press Y or N to continue."));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0464_RUNSTEPL_DUP05, "Measure VBus =0 and then press Y or N to continue.");
 			RequestCharacter();
 			iCaseStep = EVerifyVBusGone;
 			break;
 
 		case EVerifyVBusGone:
 			LOG_VERBOSE1(_L("Test !VBus after unload.\n"))
-			if(gVerboseOutput)
-			    {
-			    OstTrace0(TRACE_VERBOSE, CTESTCASE0464_RUNSTEPL_DUP06, "Test !VBus after unload.\n");
-			    }
 			// test key response (or via an API)
 			if (('y' == iKeyCodeInput) ||('Y' == iKeyCodeInput))
 				{
 				test.Printf(_L("VBUS drop 'seen' \n"));
-				OstTrace0(TRACE_NORMAL, CTESTCASE0464_RUNSTEPL_DUP07, "VBUS drop 'seen' \n");
 				SelfComplete();
 				}
 			else
@@ -221,7 +179,6 @@
 
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0464_RUNSTEPL_DUP08, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0465.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0465.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,10 +24,6 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0465.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0465Traces.h"
-#endif
 
 
 
@@ -39,10 +35,7 @@
 
 CTestCase0465* CTestCase0465::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0465_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0465* self = new (ELeave) CTestCase0465(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -54,10 +47,7 @@
 CTestCase0465::CTestCase0465(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0465_CTESTCASE0465);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -67,10 +57,7 @@
 */
 void CTestCase0465::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0465_CONSTRUCTL);
-	    }
+	LOG_FUNC
 	iWDTimer = CTestCaseWatchdog::NewL();
 	
 	BaseConstructL();
@@ -79,10 +66,7 @@
 
 CTestCase0465::~CTestCase0465()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0465_DCTESTCASE0465);
-	    }
+	LOG_FUNC
 
 	Cancel();
 	delete iWDTimer;
@@ -92,10 +76,7 @@
 
 void CTestCase0465::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0465_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EPreconditions;
 	
 	iRepeats = KOperationRetriesMax;	// VBus event rise retries
@@ -108,10 +89,7 @@
 	
 void CTestCase0465::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0465_DOCANCEL);
-	    }
+	LOG_FUNC
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -140,33 +118,21 @@
 void CTestCase0465::DescribePreconditions()
 	{
 	test.Printf(_L("BEFORE running this test\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0465_DESCRIBEPRECONDITIONS, "BEFORE running this test\n");
 	test.Printf(_L("\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP01, "\n");
 	test.Printf(_L("Insert 'A' connector\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP02, "Insert 'A' connector\n");
 	test.Printf(_L("\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP03, "\n");
 	test.Printf(_L("Confirm passing tests\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP04, "Confirm passing tests\n");
 	test.Printf(_L("\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP05, "\n");
 	test.Printf(_L("ID_PIN detection\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP06, "ID_PIN detection\n");
 	test.Printf(_L("VBus Driving\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP07, "VBus Driving\n");
 	test.Printf(_L("\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP08, "\n");
 	}
 		
 
 // handle event completion	
 void CTestCase0465::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0465_RUNSTEPL);
-	    }
+	LOG_FUNC
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -184,15 +150,10 @@
 				}
 			// prompt to insert connector
 			test.Printf(_L("\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP01, "\n");
 			test.Printf(KInsertAConnectorPrompt);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP02, KInsertAConnectorPrompt);
 			test.Printf(_L("\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP03, "\n");
 			test.Printf(KPressAnyKeyToContinue);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP04, KPressAnyKeyToContinue);
 			test.Printf(_L("\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP05, "\n");
 			RequestCharacter();			
 			break;
 			
@@ -230,7 +191,6 @@
 			iCaseStep = EUnloadLdd;
 			OtgEventString(iOTGEvent, aDescription);
 			test.Printf(_L("Received event %d '%S' status(%d)\n"), iOTGEvent, &aDescription, completionCode);
-			OstTraceExt3(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP06, "Received event %d '%S' status(%d)\n", iOTGEvent, aDescription, completionCode);
 			
 			if (iOTGEvent != RUsbOtgDriver::EEventVbusRaised)
 				{
@@ -246,7 +206,6 @@
 				break;	
 				}
 			test.Printf(_L("VBus seen OK.\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP07, "VBus seen OK.\n");
 			
 			SelfComplete();
 			break;
@@ -262,19 +221,12 @@
 			User::After(100000);
 			
 			test.Printf(_L("Use meter or oscilloscope\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP08, "Use meter or oscilloscope\n");
 			test.Printf(_L("to measure VBUS, which should\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP09, "to measure VBUS, which should\n");
 			test.Printf(_L("have dropped\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP10, "have dropped\n");
 			test.Printf(_L("\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP11, "\n");
 			test.Printf(_L("Is it below 0.2 volts?\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP12, "Is it below 0.2 volts?\n");
 			test.Printf(_L("\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP13, "\n");
 			test.Printf(_L("Select Y or N to continue\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP14, "Select Y or N to continue\n");
 			RequestCharacter();
 			iWDTimer->IssueRequest(KDelayDurationForUserActivityMS, this, &CancelKB);
 			iCaseStep = EVerifyBusGone;
@@ -291,7 +243,6 @@
 			if (('y' == iKeyCodeInput) ||('Y' == iKeyCodeInput))
 				{
 				test.Printf(_L("VBUS 'drop' seen\n"));
-				OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP15, "VBUS 'drop' seen\n");
 				SelfComplete();
 				}
 			else
@@ -307,7 +258,6 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0465_RUNSTEPL_DUP16, "<Error> unknown test step\n");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0466.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0466.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,10 +24,6 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0466.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0466Traces.h"
-#endif
 
 
 
@@ -38,10 +34,7 @@
 
 CTestCase0466* CTestCase0466::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0466_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0466* self = new (ELeave) CTestCase0466(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -53,10 +46,7 @@
 CTestCase0466::CTestCase0466(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0466_CTESTCASE0466);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -66,10 +56,7 @@
 */
 void CTestCase0466::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0466_CONSTRUCTL);
-	    }
+	LOG_FUNC
 	iWDTimer = CTestCaseWatchdog::NewL();
 	
 	BaseConstructL();
@@ -78,10 +65,7 @@
 
 CTestCase0466::~CTestCase0466()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0466_DCTESTCASE0466);
-	    }
+	LOG_FUNC
 
 	Cancel();
 	delete iWDTimer;
@@ -90,10 +74,7 @@
 
 void CTestCase0466::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0466_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EPreconditions;
 	
 	iRepeats = KOperationRetriesMax;
@@ -107,38 +88,23 @@
 void CTestCase0466::DescribePreconditions()
 	{
 	test.Printf(_L("BEFORE running this test\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS, "BEFORE running this test\n");
 	test.Printf(_L("\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP01, "\n");
 	test.Printf(_L("Insert the connector\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP02, "Insert the connector\n");
 	test.Printf(_L("from the OET with SW9\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP03, "from the OET with SW9\n");
 	test.Printf(_L("set to 'A-DEVICE' and\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP04, "set to 'A-DEVICE' and\n");
 	test.Printf(_L("all other switches OFF\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP05, "all other switches OFF\n");
 	test.Printf(_L("\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP06, "\n");
 	test.Printf(_L("Confirm passing tests\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP07, "Confirm passing tests\n");
 	test.Printf(_L("\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP08, "\n");
 	test.Printf(_L("ID_PIN detection\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP09, "ID_PIN detection\n");
 	test.Printf(_L("VBus Driving\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP10, "VBus Driving\n");
 	test.Printf(_L("\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP11, "\n");
 	}
 
 	
 void CTestCase0466::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0466_DOCANCEL);
-	    }
+	LOG_FUNC
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -157,10 +123,7 @@
 // handle event completion	
 void CTestCase0466::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0466_RUNSTEPL);
-	    }
+	LOG_FUNC
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -178,15 +141,10 @@
 				}
 			// prompt to insert connector
 			test.Printf(_L("\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP01, "\n");
 			test.Printf(KInsertAConnectorPrompt);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP02, KInsertAConnectorPrompt);
 			test.Printf(_L("\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP03, "\n");
 			test.Printf(KPressAnyKeyToContinue);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP04, KPressAnyKeyToContinue);
 			test.Printf(_L("\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP05, "\n");
 			RequestCharacter();			
 			break;
 			
@@ -224,17 +182,11 @@
 
 			// ...and tell user to apply load	
 			test.Printf(_L("\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP06, "\n");
 			test.Printf(_L("************************\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP07, "************************\n");
 			test.Printf(_L("* Using SW4 on the OET *\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP08, "* Using SW4 on the OET *\n");
 			test.Printf(_L("* Apply 100mA LOAD now *\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP09, "* Apply 100mA LOAD now *\n");
 			test.Printf(_L("************************\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP10, "************************\n");
 			test.Printf(_L("\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP11, "\n");
 			
 			iCaseStep = EVerifyBusFail;
 			
@@ -244,7 +196,6 @@
 		
 			OtgMessageString(iOTGMessage, aDescription);
 			test.Printf(_L("Received message %d '%S' status(%d)\n"), iOTGMessage, &aDescription, completionCode);
-			OstTraceExt3(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP12, "Received message %d '%S' status(%d)\n", iOTGMessage, aDescription, completionCode);
 
 			if (RUsbOtgDriver::EMessageVbusError == iOTGMessage)
 				{
@@ -283,22 +234,15 @@
 
 			// remove 100ma Load - this reminds the user
 			test.Printf(_L("\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP13, "\n");
 			test.Printf(_L("************************\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP14, "************************\n");
 			test.Printf(_L("* Using SW4 on the OET *\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP15, "* Using SW4 on the OET *\n");
 			test.Printf(_L("* Remove 100mA LOAD!   *\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP16, "* Remove 100mA LOAD!   *\n");
 			test.Printf(_L("************************\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP17, "************************\n");
 			test.Printf(_L("\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP18, "\n");
 			
 			iCaseStep = ELastStep;
 			// press any key
 			test.Printf(KPressAnyKeyToContinue);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP19, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			
@@ -307,7 +251,6 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0466_RUNSTEPL_DUP20, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0467.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0467.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,10 +24,6 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0467.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0467Traces.h"
-#endif
 
 
 
@@ -41,10 +37,7 @@
 
 CTestCase0467* CTestCase0467::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0467_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0467* self = new (ELeave) CTestCase0467(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -56,10 +49,7 @@
 CTestCase0467::CTestCase0467(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0467_CTESTCASE0467);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -69,10 +59,7 @@
 */
 void CTestCase0467::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0467_CONSTRUCTL);
-	    }
+	LOG_FUNC
 	iRepeats = INSERT_REPEATS;
 	iWDTimer = CTestCaseWatchdog::NewL();
 	
@@ -82,10 +69,7 @@
 
 CTestCase0467::~CTestCase0467()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0467_DCTESTCASE0467);
-	    }
+	LOG_FUNC
 
 	Cancel();
 	delete iWDTimer;
@@ -95,10 +79,7 @@
 
 void CTestCase0467::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0467_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EPreconditions;
 	
 	iRepeats = KOperationRetriesMax;	// VBus event rise retries
@@ -111,10 +92,7 @@
 	
 void CTestCase0467::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0467_DOCANCEL);
-	    }
+	LOG_FUNC
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -133,10 +111,7 @@
 
 void CTestCase0467::CancelIdPin(CTestCaseRoot *pThis)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0467_CANCELIDPIN);
-	    }
+	LOG_FUNC
 	
 	CTestCase0467 * p = REINTERPRET_CAST(CTestCase0467 *,pThis);
 	// cancel any pending call, and then complete our active obj with a timeout value
@@ -149,19 +124,14 @@
 void CTestCase0467::DescribePreconditions()
 	{
 	test.Printf(_L("Remove 'A' connector beforehand.\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0467_DESCRIBEPRECONDITIONS, "Remove 'A' connector beforehand.\n");
 	test.Printf(_L("ID_PIN detection and VBus driving tests must already pass.\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0467_DESCRIBEPRECONDITIONS_DUP01, "ID_PIN detection and VBus driving tests must already pass.\n");
 	}
 		
 
 // handle event completion	
 void CTestCase0467::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0467_RUNSTEPL);
-	    }
+	LOG_FUNC
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -178,9 +148,7 @@
 				}
 			// prompt to remove connector
 			test.Printf(KRemoveAConnectorPrompt);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP01, KRemoveAConnectorPrompt);
 			test.Printf(KPressAnyKeyToContinue);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP02, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			
@@ -198,7 +166,6 @@
 			
 		case ERepeatLoop: // 2
 			test.Printf(_L("Repeat test %d/%d\n"), INSERT_REPEATS-iRepeats+1, INSERT_REPEATS);
-			OstTraceExt2(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP03, "Repeat test %d/%d\n", INSERT_REPEATS-iRepeats+1, INSERT_REPEATS);
 
 			if (--iRepeats)
 				iCaseStep = EWaitForIDPresent;
@@ -210,7 +177,6 @@
 		case EWaitForIDPresent:
 			// 3. prompt for insertion
 			test.Printf(KInsertAConnectorPrompt);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP04, KInsertAConnectorPrompt);
 			otgQueueOtgIdPinNotification( iOTGIdPin, iStatus );
 
 			SetActive();
@@ -221,10 +187,6 @@
 		case EVerifyIDPresent:
 			// 4. detect id_pin event
 			LOG_VERBOSE1(_L("STEP4 - detect id_pin event 'A'\n"));
-			if(gVerboseOutput)
-			    {
-			    OstTrace0(TRACE_VERBOSE, CTESTCASE0467_RUNSTEPL_DUP05, "STEP4 - detect id_pin event 'A'\n");;
-			    }
 
 			// retrieve the current ID_PIN value
 			otgQueueOtgIdPinNotification( iOTGIdPin, iStatus );
@@ -262,7 +224,6 @@
 		case EWaitForIDGone: 
 			// 5. prompt for insertion
 			test.Printf(KRemoveAConnectorPrompt);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP06, KRemoveAConnectorPrompt);
 			otgQueueOtgIdPinNotification( iOTGIdPin, iStatus );
 			SetActive();
 			iCaseStep = EVerifyIDGone;
@@ -271,19 +232,13 @@
 		case EVerifyIDGone:
 			// 6. detect id_pin gone event
 			LOG_VERBOSE1(_L("STEP4 - detect id_pin remove event 'B'\n"));
-			if(gVerboseOutput)
-			    {
-			    OstTrace0(TRACE_VERBOSE, CTESTCASE0467_RUNSTEPL_DUP07, "STEP4 - detect id_pin remove event 'B'\n");;
-			    }
 			test.Printf(_L("ID_PIN=%d\n"), iOTGIdPin);
-			OstTrace1(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP08, "ID_PIN=%d\n", iOTGIdPin);
 
 			User::After(5000); // 5ms
 			otgQueueOtgIdPinNotification( iOTGIdPin, iStatus );
 			otgCancelOtgIdPinNotification();
 			User::WaitForRequest(iStatus); // swallow it
 			test.Printf(_L("ID_PIN=%d\n"), iOTGIdPin);
-			OstTrace1(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP09, "ID_PIN=%d\n", iOTGIdPin);
 
 			if (iOTGIdPin != RUsbOtgDriver::EIdPinBPlug)
 				{
@@ -323,7 +278,6 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0467_RUNSTEPL_DUP10, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0468.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0468.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,10 +24,6 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0468.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0468Traces.h"
-#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -40,10 +36,7 @@
 
 CTestCase0468* CTestCase0468::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0468_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0468* self = new (ELeave) CTestCase0468(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -55,10 +48,7 @@
 CTestCase0468::CTestCase0468(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0468_CTESTCASE0468);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -68,10 +58,7 @@
 */
 void CTestCase0468::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0468_CONSTRUCTL);
-	    }
+	LOG_FUNC
 	iWDTimer = CTestCaseWatchdog::NewL();
 	iRepeats = OPEN_REPEATS;
 		
@@ -81,10 +68,7 @@
 
 CTestCase0468::~CTestCase0468()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0468_DCTESTCASE0468);
-	    }
+	LOG_FUNC
 
 	Cancel();
 	delete iWDTimer;
@@ -94,10 +78,7 @@
 
 void CTestCase0468::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0468_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EPreconditions;
 	
 	iRepeats = KOperationRetriesMax;	// VBus event rise retries
@@ -110,10 +91,7 @@
 	
 void CTestCase0468::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0468_DOCANCEL);
-	    }
+	LOG_FUNC
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -122,10 +100,7 @@
 
 void CTestCase0468::CancelKB(CTestCaseRoot *pThis)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0468_CANCELKB);
-	    }
+	LOG_FUNC
 	CTestCase0468 * p = REINTERPRET_CAST(CTestCase0468 *,pThis);
 	// cancel any pending call, and then complete our active obj with a cancel value
 	p->iConsole->ReadCancel();
@@ -135,10 +110,7 @@
 
 void CTestCase0468::CancelNotify(CTestCaseRoot *pThis)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0468_CANCELNOTIFY);
-	    }
+	LOG_FUNC
 	CTestCase0468 * p = REINTERPRET_CAST(CTestCase0468 *,pThis);
 	// cancel any pending call, and then complete our active obj with a timeout value
 	p->otgCancelOtgVbusNotification();
@@ -150,18 +122,12 @@
 void CTestCase0468::DescribePreconditions()
 	{
 	test.Printf(_L("Insert 'A' connector beforehand.\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0468_DESCRIBEPRECONDITIONS, "Insert 'A' connector beforehand.\n");
 	test.Printf(_L("ID_PIN detection and VBus driving tests must already pass.\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0468_DESCRIBEPRECONDITIONS_DUP01, "ID_PIN detection and VBus driving tests must already pass.\n");
 	}
 
 void CTestCase0468::ContinueAfter(TTimeIntervalMicroSeconds32 aMicroSecs, TCaseSteps aStep)
 	{
 	LOG_VERBOSE2(_L("Wait %dms before drop VBus"), (TInt)(aMicroSecs.Int()/1000));
-	if(gVerboseOutput)
-	    {
-	    OstTrace1(TRACE_VERBOSE, CTESTCASE0468_CONTINUEAFTER, "Wait %dms before drop VBus", (TInt)(aMicroSecs.Int()/1000));;
-	    }
 	iTimer.After(iStatus, aMicroSecs);
 	iCaseStep = aStep;
 	SetActive();
@@ -170,10 +136,7 @@
 // handle event completion	
 void CTestCase0468::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0468_RUNSTEPL);
-	    }
+	LOG_FUNC
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -192,9 +155,7 @@
 				}
 			// prompt to insert connector
 			test.Printf(KInsertAConnectorPrompt);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0468_RUNSTEPL_DUP01, KInsertAConnectorPrompt);
 			test.Printf(KPressAnyKeyToContinue);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0468_RUNSTEPL_DUP02, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			
@@ -220,9 +181,7 @@
 			if (!otgIdPinPresent())
 				{
 				test.Printf(KInsertAConnectorPrompt);
-				OstTrace0(TRACE_NORMAL, CTESTCASE0468_RUNSTEPL_DUP03, KInsertAConnectorPrompt);
 				test.Printf(KPressAnyKeyToContinue);
-				OstTrace0(TRACE_NORMAL, CTESTCASE0468_RUNSTEPL_DUP04, KPressAnyKeyToContinue);
 				RequestCharacter();
 
 				iCaseStep = EDetectAPlug;
@@ -251,10 +210,8 @@
 			// 4. DRIVE VBUS
 			iWDTimer->Cancel();
 			test.Printf(_L("Drive VBus, iteration %d/%d\n"), OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
-			OstTraceExt2(TRACE_NORMAL, CTESTCASE0468_RUNSTEPL_DUP05, "Drive VBus, iteration %d/%d\n", OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
 			// test for VBus rise next
 			test.Printf(_L("Waiting for VBus Event\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0468_RUNSTEPL_DUP06, "Waiting for VBus Event\n");
 			iStatus = KRequestPending;
 			otgQueueOtgVbusNotification( iOTGVBus, iStatus );
 
@@ -272,10 +229,6 @@
 		case ELoopVerifyVBus:
 			// 5. get VBus rise event
 			LOG_VERBOSE2(_L("Post notification val=%d\n\n"), iOTGVBus);
-			if(gVerboseOutput)
-			    {
-			    OstTrace1(TRACE_VERBOSE, CTESTCASE0468_RUNSTEPL_DUP07, "Post notification val=%d\n\n", iOTGVBus);;
-			    }
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				return TestFailed(KErrAbort, _L("Vbus rise not signalled in time - FAILED!"));
@@ -360,7 +313,6 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0468_RUNSTEPL_DUP08, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0469.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0469.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,10 +24,6 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0469.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0469Traces.h"
-#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -40,10 +36,7 @@
 
 CTestCase0469* CTestCase0469::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0469_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0469* self = new (ELeave) CTestCase0469(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -54,10 +47,7 @@
 CTestCase0469::CTestCase0469(TBool aHost)
 	: CTestCaseB2BRoot(KTestCaseId, aHost, iStatus) 
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0469_CTESTCASE0469);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -66,10 +56,7 @@
 */
 void CTestCase0469::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0469_CONSTRUCTL);
-	    }
+	LOG_FUNC
     iDualRoleCase = EFalse; // Not back to back
 	BaseConstructL();
 	}
@@ -77,10 +64,7 @@
 
 CTestCase0469::~CTestCase0469()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0469_DCTESTCASE0469);
-	    }
+	LOG_FUNC
     iCollector.DestroyObservers();
 	Cancel();
 	}
@@ -88,10 +72,7 @@
 
 void CTestCase0469::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0469_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EPreconditions;
 	iRepeats = 3;
 	
@@ -102,10 +83,7 @@
 	
 void CTestCase0469::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0469_DOCANCEL);
-	    }
+	LOG_FUNC
 	// cancel our timer
 	iTimer.Cancel();
 	}
@@ -113,10 +91,7 @@
 // handle event completion	
 void CTestCase0469::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0469_RUNSTEPL);
-	    }
+	LOG_FUNC
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -130,11 +105,8 @@
         iCaseStep = ELoadLdd;
         // prompt to insert connectors
         test.Printf(KInsertBCablePrompt);
-        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP01, KInsertBCablePrompt);
         test.Printf(KRemoveAFromPC);
-        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP02, KRemoveAFromPC);
         test.Printf(KPressAnyKeyToContinue);
-        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP03, KPressAnyKeyToContinue);
         RequestCharacter();			
         break;
 			
@@ -177,12 +149,12 @@
 
         if (iRepeats--)
             {
-            OstTrace1(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP04, "ELoopControl around again %d", iRepeats);
+            RDebug::Printf("ELoopControl around again %d", iRepeats);
             iCaseStep = ETestVbusRise;
             }
         else
             {
-            OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP05, "ELoopControl we're done");
+            RDebug::Printf("ELoopControl we're done");
             iCaseStep = EUnloadLdd;
             }
         SelfComplete();
@@ -200,7 +172,6 @@
         iCollector.AddRequiredNotification(EWatcherEvent, RUsbOtgDriver::EEventVbusRaised);
         iCaseStep = ETestVbusFall;
         test.Printf(KInsertAIntoPC);
-        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP06, KInsertAIntoPC);
         SetActive();
         break;
 
@@ -216,20 +187,19 @@
         iCollector.AddRequiredNotification(EWatcherEvent, RUsbOtgDriver::EEventVbusDropped);
         iCaseStep = ELoopControl;
         test.Printf(KRemoveAFromPC);
-        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP07, KRemoveAFromPC);
         SetActive();
         break;
 
     case EUnloadLdd:
         LOG_STEPNAME(_L("EUnloadLdd"))
         iCollector.DestroyObservers();
-        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP08, "Destroyed observers");
+        RDebug::Printf("Destroyed observers");
         if (EFalse == StepUnloadLDD())
             return TestFailed(KErrAbort,_L("unload Ldd failure"));	
-        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP09, "unloaded ldd");
+        RDebug::Printf("unloaded ldd");
         if (!StepUnloadClient())
             return TestFailed(KErrAbort,_L("Client Unload Failure"));	
-        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP10, "unloaded client");
+        RDebug::Printf("unloaded client");
 
         iCaseStep = ELastStep;
         SelfComplete();
@@ -242,7 +212,6 @@
 			
     default:
         test.Printf(_L("<Error> unknown test step"));
-        OstTrace0(TRACE_NORMAL, CTESTCASE0469_RUNSTEPL_DUP11, "<Error> unknown test step");
         Cancel();
         return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0670.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0670.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,10 +24,6 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0670.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0670Traces.h"
-#endif
 
 
 
@@ -38,10 +34,7 @@
 
 CTestCase0670* CTestCase0670::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0670_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0670* self = new (ELeave) CTestCase0670(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -53,10 +46,7 @@
 CTestCase0670::CTestCase0670(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0670_CTESTCASE0670);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -92,10 +82,7 @@
 	
 void CTestCase0670::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0670_DOCANCEL);
-	    }
+	LOG_FUNC
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -123,29 +110,19 @@
 	{
 	// H4 width     ****************************
 	test.Printf(_L("***************************\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0670_DESCRIBEPRECONDITIONS, "***************************\n");
 	test.Printf(_L("* This test uses a Mini-A *\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP01, "* This test uses a Mini-A *\n");
 	test.Printf(_L("* to Mini-B cable to link *\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP02, "* to Mini-B cable to link *\n");
 	test.Printf(_L("* the H4 board to the OPT *\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP03, "* the H4 board to the OPT *\n");
 	test.Printf(_L("* and makes use of the    *\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP04, "* and makes use of the    *\n");
 	test.Printf(_L("*  USB OPT test code      *\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP05, "*  USB OPT test code      *\n");
 	test.Printf(_L("***************************\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP06, "***************************\n");
 	}
 
 
 // handle event completion	
 void CTestCase0670::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0670_RUNSTEPL);
-	    }
+	LOG_FUNC
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -178,14 +155,10 @@
 		case EConnectAtoB:
 			// H4 width     ****************************
 			test.Printf(_L("\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP01, "\n");
 			test.Printf(_L("***********************\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP02, "***********************\n");
 //			WAIT_ON_KEYOP( "Connect H4(A) to OPT(B)\n");
 			test.Printf(_L("Connect H4(A) to OPT(B)\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP03, "Connect H4(Ato OPT(B)\n");
 			test.Printf(KPressAnyKeyToContinue);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP04, KPressAnyKeyToContinue);
 
 			iCaseStep = EStartOptTD4_5;
 			RequestCharacter();	
@@ -194,15 +167,10 @@
 		case EStartOptTD4_5:
 			// H4 width     ****************************
 			test.Printf(_L("On the OPT, select:\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP05, "On the OPT, select:\n");
 			test.Printf(_L("  Certified FS-A-UUT Test\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP06, "  Certified FS-A-UUT Test\n");
 			test.Printf(_L("  Test TD.4.5-2.9ms-100ms\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP07, "  Test TD.4.5-2.9ms-100ms\n");
 			test.Printf(_L("  And then Click 'Run' "));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP08, "  And then Click 'Run' ");
 			test.Printf(_L("  When test starts, press any key"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP09, "  When test starts, press any key");
 			iCaseStep = EPromptYOpt4_5;
 			RequestCharacter();	
 			break;
@@ -210,7 +178,6 @@
 		case EPromptYOpt4_5:
 			iCaseStep = EConfirmOpt4_5;
 			test.Printf(_L("Did it PASS (Y/N)?"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP10, "Did it PASS (Y/N?");
 			RequestCharacter(); // 30 seconds for user input
 			iWDTimer->IssueRequest(KDelayDurationForTest4_5, this, &CancelKB);
 			break;
@@ -257,7 +224,6 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP11, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0671.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0671.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,10 +24,6 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0671.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0671Traces.h"
-#endif
 
 
 
@@ -38,10 +34,7 @@
 
 CTestCase0671* CTestCase0671::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0671_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0671* self = new (ELeave) CTestCase0671(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -53,10 +46,7 @@
 CTestCase0671::CTestCase0671(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0671_CTESTCASE0671);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -92,10 +82,7 @@
 	
 void CTestCase0671::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0671_DOCANCEL);
-	    }
+	LOG_FUNC
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -123,29 +110,19 @@
 	{
 	// H4 width     ****************************
 	test.Printf(_L("***************************\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0671_DESCRIBEPRECONDITIONS, "***************************\n");
 	test.Printf(_L("* This test uses a Mini-A *\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP01, "* This test uses a Mini-A *\n");
 	test.Printf(_L("* to Mini-B cable to link *\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP02, "* to Mini-B cable to link *\n");
 	test.Printf(_L("* the H4 board to the OPT *\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP03, "* the H4 board to the OPT *\n");
 	test.Printf(_L("* and makes use of the    *\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP04, "* and makes use of the    *\n");
 	test.Printf(_L("*  USB OPT test code      *\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP05, "*  USB OPT test code      *\n");
 	test.Printf(_L("***************************\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP06, "***************************\n");
 	}
 
 
 // handle event completion	
 void CTestCase0671::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0671_RUNSTEPL);
-	    }
+	LOG_FUNC
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -178,13 +155,9 @@
 		case EConnectAtoB:
 			// H4 width     ****************************
 			test.Printf(_L("\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0671_RUNSTEPL_DUP01, "\n");
 			test.Printf(_L("***********************\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0671_RUNSTEPL_DUP02, "***********************\n");
 			test.Printf(_L("Connect H4(B) to OPT(A)\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0671_RUNSTEPL_DUP03, "Connect H4(Bto OPT(A)\n");
 			test.Printf(KPressAnyKeyToContinue);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0671_RUNSTEPL_DUP04, KPressAnyKeyToContinue);
 
 			iCaseStep = EStartOptTD5_5;
 			RequestCharacter();	
@@ -193,15 +166,10 @@
 		case EStartOptTD5_5:
 			// H4 width     ****************************
 			test.Printf(_L("On the OPT, select:\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0671_RUNSTEPL_DUP05, "On the OPT, select:\n");
 			test.Printf(_L("  Certified FS-B-UUT Test\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0671_RUNSTEPL_DUP06, "  Certified FS-B-UUT Test\n");
 			test.Printf(_L("  Test TD.5.5\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0671_RUNSTEPL_DUP07, "  Test TD.5.5\n");
 			test.Printf(_L("  And then Click 'Run' "));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0671_RUNSTEPL_DUP08, "  And then Click 'Run' ");
 			test.Printf(_L("  When test starts, press any key"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0671_RUNSTEPL_DUP09, "  When test starts, press any key");
 			iCaseStep = EPromptYOpt5_5;
 			RequestCharacter();	
 			break;
@@ -209,7 +177,6 @@
 		case EPromptYOpt5_5:
 			iCaseStep = EConfirmOpt5_5;
 			test.Printf(_L("Did it PASS (Y/N)?"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0671_RUNSTEPL_DUP10, "Did it PASS (Y/N?");
 			RequestCharacter(); // 30 seconds for user input
 			iWDTimer->IssueRequest(KDelayDurationForTest4_5, this, &CancelKB);
 			break;
@@ -256,7 +223,6 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0671_RUNSTEPL_DUP11, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0675.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0675.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,10 +24,6 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0675.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0675Traces.h"
-#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -40,10 +36,7 @@
 
 CTestCase0675* CTestCase0675::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0675_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0675* self = new (ELeave) CTestCase0675(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -55,10 +48,7 @@
 CTestCase0675::CTestCase0675(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0675_CTESTCASE0675);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -68,10 +58,7 @@
 */
 void CTestCase0675::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0675_CONSTRUCTL);
-	    }
+	LOG_FUNC
 	iWDTimer = CTestCaseWatchdog::NewL();
 	iRepeats = OPEN_REPEATS;
 		
@@ -81,10 +68,7 @@
 
 CTestCase0675::~CTestCase0675()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0675_DCTESTCASE0675);
-	    }
+	LOG_FUNC
 
 	Cancel();
 	delete iWDTimer;
@@ -94,10 +78,7 @@
 
 void CTestCase0675::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0675_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EPreconditions;
 	
 	iRepeats = KOperationRetriesMax;	// VBus event rise retries
@@ -110,10 +91,7 @@
 	
 void CTestCase0675::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0675_DOCANCEL);
-	    }
+	LOG_FUNC
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -122,10 +100,7 @@
 
 void CTestCase0675::CancelKB(CTestCaseRoot *pThis)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0675_CANCELKB);
-	    }
+	LOG_FUNC
 	CTestCase0675 * p = REINTERPRET_CAST(CTestCase0675 *,pThis);
 	// cancel any pending call, and then complete our active obj with a cancel value
 	p->iConsole->ReadCancel();
@@ -135,10 +110,7 @@
 
 void CTestCase0675::CancelNotify(CTestCaseRoot *pThis)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0675_CANCELNOTIFY);
-	    }
+	LOG_FUNC
 	CTestCase0675 * p = REINTERPRET_CAST(CTestCase0675 *,pThis);
 	// cancel any pending call, and then complete our active obj with a timeout value
 	p->otgCancelOtgVbusNotification();
@@ -150,17 +122,12 @@
 void CTestCase0675::DescribePreconditions()
 	{
 	test.Printf(_L("Insert 'A' connector beforehand.\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0675_DESCRIBEPRECONDITIONS, "Insert 'A' connector beforehand.\n");
 	
 	}
 
 void CTestCase0675::ContinueAfter(TTimeIntervalMicroSeconds32 aMicroSecs, TCaseSteps aStep)
 	{
 	LOG_VERBOSE2(_L("Wait %dms before drop VBus"), (TInt)(aMicroSecs.Int()/1000));
-	if(gVerboseOutput)
-	    {
-	    OstTrace1(TRACE_VERBOSE, CTESTCASE0675_CONTINUEAFTER, "Wait %dms before drop VBus", (TInt)(aMicroSecs.Int()/1000));;
-	    }
 	iTimer.After(iStatus, aMicroSecs);
 	iCaseStep = aStep;
 	SetActive();
@@ -169,10 +136,7 @@
 // handle event completion	
 void CTestCase0675::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0675_RUNSTEPL);
-	    }
+	LOG_FUNC
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -191,9 +155,7 @@
 				}
 			// prompt to insert connector
 			test.Printf(KInsertAConnectorPrompt);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP01, KInsertAConnectorPrompt);
 			test.Printf(KPressAnyKeyToContinue);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP02, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			
@@ -219,9 +181,7 @@
 			if (!otgIdPinPresent())
 				{
 				test.Printf(KInsertAConnectorPrompt);
-				OstTrace0(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP03, KInsertAConnectorPrompt);
 				test.Printf(KPressAnyKeyToContinue);
-				OstTrace0(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP04, KPressAnyKeyToContinue);
 				RequestCharacter();
 				iCaseStep = EDetectAPlug;
 				}
@@ -249,10 +209,8 @@
 		case ELoopDriveVBus1:
 			iWDTimer->Cancel();
 			test.Printf(_L("Drive VBus, iteration %d/%d\n"), OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
-			OstTraceExt2(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP05, "Drive VBus, iteration %d/%d\n", OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
 			// test for VBus rise next
 			test.Printf(_L("Waiting for VBus Event\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP06, "Waiting for VBus Event\n");
 			iStatus = KRequestPending;
 			otgQueueOtgVbusNotification( iOTGVBus, iStatus );
 			SetActive();
@@ -289,7 +247,6 @@
 		case ELoopDriveVBus2:
 			iWDTimer->Cancel();
 			test.Printf(_L("Drive VBus double, iteration %d/%d\n"), OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
-			OstTraceExt2(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP07, "Drive VBus double, iteration %d/%d\n", OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
 
 			err = otgBusRequest();	// duplicate turn on VBus, we expect an error 
 			if (KErrUsbOtgVbusAlreadyRaised != err)
@@ -370,7 +327,6 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0675_RUNSTEPL_DUP08, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0676.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0676.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,10 +24,6 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0676.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0676Traces.h"
-#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -40,10 +36,7 @@
 
 CTestCase0676* CTestCase0676::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0676_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0676* self = new (ELeave) CTestCase0676(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -55,10 +48,7 @@
 CTestCase0676::CTestCase0676(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0676_CTESTCASE0676);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -68,10 +58,7 @@
 */
 void CTestCase0676::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0676_CONSTRUCTL);
-	    }
+	LOG_FUNC
 	iWDTimer = CTestCaseWatchdog::NewL();
 	iRepeats = OPEN_REPEATS;
 		
@@ -81,10 +68,7 @@
 
 CTestCase0676::~CTestCase0676()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0676_DCTESTCASE0676);
-	    }
+	LOG_FUNC
 
 	Cancel();
 	delete iWDTimer;
@@ -94,10 +78,7 @@
 
 void CTestCase0676::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0676_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EPreconditions;
 	
 	iRepeats = KOperationRetriesMax;	// VBus event rise retries
@@ -110,10 +91,7 @@
 	
 void CTestCase0676::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0676_DOCANCEL);
-	    }
+	LOG_FUNC
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -122,10 +100,7 @@
 
 void CTestCase0676::CancelKB(CTestCaseRoot *pThis)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0676_CANCELKB);
-	    }
+	LOG_FUNC
 	CTestCase0676 * p = REINTERPRET_CAST(CTestCase0676 *,pThis);
 	// cancel any pending call, and then complete our active obj with a cancel value
 	p->iConsole->ReadCancel();
@@ -135,10 +110,7 @@
 
 void CTestCase0676::CancelNotify(CTestCaseRoot *pThis)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0676_CANCELNOTIFY);
-	    }
+	LOG_FUNC
 	CTestCase0676 * p = REINTERPRET_CAST(CTestCase0676 *,pThis);
 	// cancel any pending call, and then complete our active obj with a timeout value
 	p->otgCancelOtgVbusNotification();
@@ -150,16 +122,11 @@
 void CTestCase0676::DescribePreconditions()
 	{
 	test.Printf(_L("Insert 'A' connector beforehand.\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0676_DESCRIBEPRECONDITIONS, "Insert 'A' connector beforehand.\n");
 	}
 
 void CTestCase0676::ContinueAfter(TTimeIntervalMicroSeconds32 aMicroSecs, TCaseSteps aStep)
 	{
 	LOG_VERBOSE2(_L("Wait %dms before drop VBus"), (TInt)(aMicroSecs.Int()/1000));
-	if(gVerboseOutput)
-	    {
-	    OstTrace1(TRACE_VERBOSE, CTESTCASE0676_CONTINUEAFTER, "Wait %dms before drop VBus", (TInt)(aMicroSecs.Int()/1000));;
-	    }
 	iTimer.After(iStatus, aMicroSecs);
 	iCaseStep = aStep;
 	SetActive();
@@ -168,10 +135,7 @@
 // handle event completion	
 void CTestCase0676::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0676_RUNSTEPL);
-	    }
+	LOG_FUNC
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -190,9 +154,7 @@
 				}
 			// prompt to insert connector
 			test.Printf(KInsertAConnectorPrompt);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0676_RUNSTEPL_DUP01, KInsertAConnectorPrompt);
 			test.Printf(KPressAnyKeyToContinue);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0676_RUNSTEPL_DUP02, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			
@@ -218,9 +180,7 @@
 			if (!otgIdPinPresent())
 				{
 				test.Printf(KInsertAConnectorPrompt);
-				OstTrace0(TRACE_NORMAL, CTESTCASE0676_RUNSTEPL_DUP03, KInsertAConnectorPrompt);
 				test.Printf(KPressAnyKeyToContinue);
-				OstTrace0(TRACE_NORMAL, CTESTCASE0676_RUNSTEPL_DUP04, KPressAnyKeyToContinue);
 				RequestCharacter();
 
 				iCaseStep = EDetectAPlug;
@@ -249,10 +209,8 @@
 			// 4. DRIVE VBUS
 			iWDTimer->Cancel();
 			test.Printf(_L("Drive VBus, iteration %d/%d\n"), OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
-			OstTraceExt2(TRACE_NORMAL, CTESTCASE0676_RUNSTEPL_DUP05, "Drive VBus, iteration %d/%d\n", OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
 			// test for VBus rise next
 			test.Printf(_L("Waiting for VBus Event\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0676_RUNSTEPL_DUP06, "Waiting for VBus Event\n");
 			iStatus = KRequestPending;
 			otgQueueOtgVbusNotification( iOTGVBus, iStatus );
 
@@ -353,7 +311,6 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0676_RUNSTEPL_DUP07, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0677.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0677.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,10 +24,6 @@
 #include "testcaseroot.h"
 #include "testcasewd.h"
 #include "testcase0677.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0677Traces.h"
-#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -40,10 +36,7 @@
 
 CTestCase0677* CTestCase0677::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0677_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0677* self = new (ELeave) CTestCase0677(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -55,10 +48,7 @@
 CTestCase0677::CTestCase0677(TBool aHost)
 :	CTestCaseRoot(KTestCaseId, aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0677_CTESTCASE0677);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -68,10 +58,7 @@
 */
 void CTestCase0677::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0677_CONSTRUCTL);
-	    }
+	LOG_FUNC
 	iWDTimer = CTestCaseWatchdog::NewL();
 	iRepeats = OPEN_REPEATS;
 		
@@ -81,10 +68,7 @@
 
 CTestCase0677::~CTestCase0677()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0677_DCTESTCASE0677);
-	    }
+	LOG_FUNC
 
 	Cancel();
 	delete iWDTimer;
@@ -94,10 +78,7 @@
 
 void CTestCase0677::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0677_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EPreconditions;
 	
 	iRepeats = KOperationRetriesMax;	// VBus event rise retries
@@ -110,10 +91,7 @@
 	
 void CTestCase0677::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0677_DOCANCEL);
-	    }
+	LOG_FUNC
 
 	// cancel our timer
 	iTimer.Cancel();
@@ -122,10 +100,7 @@
 
 void CTestCase0677::CancelKB(CTestCaseRoot *pThis)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0677_CANCELKB);
-	    }
+	LOG_FUNC
 	CTestCase0677 * p = REINTERPRET_CAST(CTestCase0677 *,pThis);
 	// cancel any pending call, and then complete our active obj with a cancel value
 	p->iConsole->ReadCancel();
@@ -135,10 +110,7 @@
 
 void CTestCase0677::CancelNotify(CTestCaseRoot *pThis)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0677_CANCELNOTIFY);
-	    }
+	LOG_FUNC
 	CTestCase0677 * p = REINTERPRET_CAST(CTestCase0677 *,pThis);
 	// cancel any pending call, and then complete our active obj with a timeout value
 	switch (p->iCancelWhat)
@@ -164,23 +136,15 @@
 void CTestCase0677::DescribePreconditions()
 	{
 	test.Printf(_L("Using OET, connect oscilloscope chan.A to VBus\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0677_DESCRIBEPRECONDITIONS, "Using OET, connect oscilloscope chan.A to VBus\n");
 	test.Printf(_L("Connect oscilloscope chan.B to D+\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0677_DESCRIBEPRECONDITIONS_DUP01, "Connect oscilloscope chan.B to D+\n");
 	test.Printf(_L("Trigger once, 200mV, 100ms \n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0677_DESCRIBEPRECONDITIONS_DUP02, "Trigger once, 200mV, 100ms \n");
 	test.Printf(_L("Prepare to observe VBus, D+ pulse.\n\n"));
-	OstTrace0(TRACE_NORMAL, CTESTCASE0677_DESCRIBEPRECONDITIONS_DUP03, "Prepare to observe VBus, D+ pulse.\n\n");
 	}
 
 
 void CTestCase0677::ContinueAfter(TTimeIntervalMicroSeconds32 aMicroSecs, TCaseSteps aStep)
 	{
 	LOG_VERBOSE2(_L("Wait %dms before drop VBus"), (TInt)(aMicroSecs.Int()/1000));
-	if(gVerboseOutput)
-	    {
-	    OstTrace1(TRACE_VERBOSE, CTESTCASE0677_CONTINUEAFTER, "Wait %dms before drop VBus", (TInt)(aMicroSecs.Int()/1000));;
-	    }
 	iTimer.After(iStatus, aMicroSecs);
 	iCaseStep = aStep;
 	SetActive();
@@ -190,10 +154,7 @@
 // handle event completion	
 void CTestCase0677::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0677_RUNSTEPL);
-	    }
+	LOG_FUNC
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -212,9 +173,7 @@
 				}
 			// prompt to insert connector
 			test.Printf(KAttachOETAsBDevice);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP01, KAttachOETAsBDevice);
 			test.Printf(KPressAnyKeyToContinue);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP02, KPressAnyKeyToContinue);
 			RequestCharacter();			
 			break;
 			
@@ -240,9 +199,7 @@
 			if (otgIdPinPresent())
 				{
 				test.Printf(KRemoveAConnectorPrompt);
-				OstTrace0(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP03, KRemoveAConnectorPrompt);
 				test.Printf(KPressAnyKeyToContinue);
-				OstTrace0(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP04, KPressAnyKeyToContinue);
 				RequestCharacter();
 
 				iCaseStep = EDetectBPlug;
@@ -259,7 +216,6 @@
 			iWDTimer->Cancel();
 
 			test.Printf(KMsgWaitingForSRPInitiated);
-			OstTrace0(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP05, KMsgWaitingForSRPInitiated);
 			otgQueueOtgEventRequest( iOTGEvent, iStatus );
 
 			// turn on VBus (B-SRP)
@@ -284,7 +240,6 @@
 				}
 			OtgEventString(iOTGEvent, aDescription);
 			test.Printf(_L("Received event %d '%S' status(%d)\n"), iOTGEvent, &aDescription, completionCode);
-			OstTraceExt3(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP06, "Received event %d '%S' status(%d)\n", iOTGEvent, aDescription, completionCode);
 			if (RUsbOtgDriver::EEventSrpInitiated == iOTGEvent)
 				{
 				// calc interval
@@ -293,22 +248,16 @@
 				aNowTime.HomeTime();
 				aIntvlMicro = aNowTime.MicroSecondsFrom(iTimeSRPStart);
 				LOG_VERBOSE2(_L("SRP active after %d ms\n"), (TInt)(aIntvlMicro.Int64()/1000));
-				if(gVerboseOutput)
-				    {
-				    OstTrace1(TRACE_VERBOSE, CTESTCASE0677_RUNSTEPL_DUP07, "SRP active after %d ms\n", (TInt)(aIntvlMicro.Int64()/1000));;
-				    }
 				iCancelWhat = ECancelMessageNotify;
 				otgQueueOtgMessageRequest( iOTGMessage, iStatus );
 				iCaseStep = EWaitForSRPTimeout;
 				test.Printf(KMsgWaitingForSRPTimeout);
-				OstTrace0(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP08, KMsgWaitingForSRPTimeout);
 				SetActive();
 				}
 			else
 				{
 				iCaseStep = EWaitForSRPInitiated;
 				test.Printf(KMsgWaitingForSRPInitiated);
-				OstTrace0(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP09, KMsgWaitingForSRPInitiated);
 				iStatus = KRequestPending;
 				otgQueueOtgEventRequest( iOTGEvent, iStatus );
 				SetActive();
@@ -323,7 +272,6 @@
 				}
 			OtgMessageString(iOTGMessage, aDescription);
 			test.Printf(_L("Received message %d '%S' status(%d)\n"), iOTGMessage, &aDescription, completionCode);
-			OstTraceExt3(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP10, "Received message %d '%S' status(%d)\n", iOTGMessage, aDescription, completionCode);
 			if (RUsbOtgDriver::EMessageSrpTimeout == iOTGMessage)
 				{
 				iWDTimer->Cancel();		//	Only cancel WD Timer here, when timed portion of test is over
@@ -333,10 +281,6 @@
 				aNowTime.HomeTime();
 				aIntvlMicro = aNowTime.MicroSecondsFrom(iTimeSRPStart);
 				LOG_VERBOSE2(_L("SRP times out after %d ms\n"), (TInt)(aIntvlMicro.Int64()/1000));
-				if(gVerboseOutput)
-				    {
-				    OstTrace1(TRACE_VERBOSE, CTESTCASE0677_RUNSTEPL_DUP11, "SRP times out after %d ms\n", (TInt)(aIntvlMicro.Int64()/1000));;
-				    }
 				// the correct value is 32 seconds, not 4.9 seconds as per the spec.
 
 				iCaseStep = EIssueSRPObservedPrompt;
@@ -346,7 +290,6 @@
 				{
 				iCaseStep = EWaitForSRPTimeout;
 				test.Printf(KMsgWaitingForSRPTimeout);
-				OstTrace0(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP12, KMsgWaitingForSRPTimeout);
 				iStatus = KRequestPending;
 				otgQueueOtgMessageRequest( iOTGMessage, iStatus );
 				SetActive();
@@ -356,9 +299,7 @@
 		case EIssueSRPObservedPrompt:
 			{
 			test.Printf(_L("\nPress Y to verify that SRP was observed\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP13, "\nPress Y to verify that SRP was observed\n");
 			test.Printf(_L("or any other key to fail test.\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP14, "or any other key to fail test.\n");
 			RequestCharacter();
 			iCaseStep = ECheckSRPObservedUserInput;
 			break;
@@ -391,7 +332,6 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0677_RUNSTEPL_DUP15, "<Error> unknown test step\n");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0678.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0678.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -25,10 +25,6 @@
 //#include "testcasewd.h"
 #include "b2bwatchers.h"
 #include "testcase0678.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0678Traces.h"
-#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -42,10 +38,7 @@
 
 CTestCase0678* CTestCase0678::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0678_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0678* self = new (ELeave) CTestCase0678(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -57,10 +50,7 @@
 CTestCase0678::CTestCase0678(TBool aHost)
 	: CTestCaseB2BRoot(KTestCaseId, aHost, iStatus) 
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0678_CTESTCASE0678);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -70,10 +60,7 @@
 */
 void CTestCase0678::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0678_CONSTRUCTL);
-	    }
+	LOG_FUNC
 
 	iDualRoleCase = ETrue;	// another back-back
 		
@@ -83,10 +70,7 @@
 
 CTestCase0678::~CTestCase0678()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0678_DCTESTCASE0678);
-	    }
+	LOG_FUNC
 	iCollector.DestroyObservers();
 	Cancel();
 	}
@@ -94,10 +78,7 @@
 
 void CTestCase0678::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0678_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EPreconditions;
 	iHNPCounter = 3;	//	To be decremented to govern the number of times we do HNP.
 	CActiveScheduler::Add(this);
@@ -107,10 +88,7 @@
 	
 void CTestCase0678::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0678_DOCANCEL);
-	    }
+	LOG_FUNC
 	// cancel our timer
 	iTimer.Cancel();
 	}
@@ -119,10 +97,7 @@
 // handle event completion	
 void CTestCase0678::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0678_RUNSTEPL);
-	    }
+	LOG_FUNC
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -203,7 +178,6 @@
 		case EDefaultRoles:
 			{
 			test.Printf(_L("Into EDefaultRoles step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0678_RUNSTEPL_DUP01, "Into EDefaultRoles step...\n");
 			
 			if ( --iHNPCounter >= 0)
 				{
@@ -236,7 +210,6 @@
 		case EBConfigured:	//	A B-Device only step!
 			{
 			test.Printf(_L("Into EBConfigured step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0678_RUNSTEPL_DUP02, "Into EBConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -251,7 +224,6 @@
 		case EBSuspended:	
 			{
 			test.Printf(_L("Into EBSuspended step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0678_RUNSTEPL_DUP03, "Into EBSuspended step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -260,7 +232,6 @@
 			
 			// issue HNP
 			test.Printf(_L("VBus present, attempting a swap.\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0678_RUNSTEPL_DUP04, "VBus present, attempting a swap.\n");
 			iCollector.AddRequiredNotification(EWatcherState, RUsbOtgDriver::EStateBHost);
 
 			err = otgBusRequest();	//	Request the host role
@@ -268,7 +239,6 @@
 			if (KErrNone != err)
 				{
 				test.Printf(_L("BusRequest returned %d\n"),err);
-				OstTrace1(TRACE_NORMAL, CTESTCASE0678_RUNSTEPL_DUP05, "BusRequest returned %d\n",err);
 				return TestFailed(KErrAbort, _L("BusRequest() failed!"));
 				}
 		
@@ -280,7 +250,6 @@
 		case ESwappedRoles:
 			{
 			test.Printf(_L("Into ESwappedRoles step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0678_RUNSTEPL_DUP06, "Into ESwappedRoles step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -306,7 +275,6 @@
 		case EAConfigured:	//	A-Device only step
 			{
 			test.Printf(_L("Into EWaitTillAConfigured step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0678_RUNSTEPL_DUP07, "Into EWaitTillAConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -322,7 +290,6 @@
 		case EASuspended:	//	A-Device only step
 			{
 			test.Printf(_L("Into EWaitTillASuspended step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0678_RUNSTEPL_DUP08, "Into EWaitTillASuspended step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -390,7 +357,6 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0678_RUNSTEPL_DUP09, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0679.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0679.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,10 +24,6 @@
 #include "testcaseroot.h"
 #include "b2bwatchers.h"
 #include "testcase0679.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0679Traces.h"
-#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -41,10 +37,7 @@
 
 CTestCase0679* CTestCase0679::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0679_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0679* self = new (ELeave) CTestCase0679(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -56,10 +49,7 @@
 CTestCase0679::CTestCase0679(TBool aHost)
 	: CTestCaseB2BRoot(KTestCaseId, aHost, iStatus) 
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0679_CTESTCASE0679);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -69,10 +59,7 @@
 */
 void CTestCase0679::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0679_CONSTRUCTL);
-	    }
+	LOG_FUNC
 
 	iDualRoleCase = ETrue;	// another back-back
 		
@@ -82,10 +69,7 @@
 
 CTestCase0679::~CTestCase0679()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0679_DCTESTCASE0679);
-	    }
+	LOG_FUNC
 	iCollector.DestroyObservers();
 	Cancel();
 	}
@@ -93,10 +77,7 @@
 
 void CTestCase0679::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0679_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EPreconditions;
 	CActiveScheduler::Add(this);
 	SelfComplete();
@@ -105,10 +86,7 @@
 	
 void CTestCase0679::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0679_DOCANCEL);
-	    }
+	LOG_FUNC
 	// cancel our timer
 	iTimer.Cancel();
 	}
@@ -117,10 +95,7 @@
 // handle event completion	
 void CTestCase0679::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0679_RUNSTEPL);
-	    }
+	LOG_FUNC
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -203,7 +178,6 @@
 		case EDefaultRoles:
 			{
 			test.Printf(_L("Into EDefaultRoles step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0679_RUNSTEPL_DUP01, "Into EDefaultRoles step...\n");
 			LOG_STEPNAME(_L("EWaitEnumeration"));
 			
 			if (gTestRoleMaster)
@@ -227,7 +201,6 @@
 				iCollector.AddStepTimeout(KTestCase0679ATimeout);	//	NB. In this test on the A-Device, we expect to timeout
 																	//	so a timeout isn't treated as a failure
 				test.Printf(_L("NOTE : Please observe test result on B-Device...\n"));
-				OstTrace0(TRACE_NORMAL, CTESTCASE0679_RUNSTEPL_DUP02, "NOTE : Please observe test result on B-Device...\n");
 				iCaseStep = EDropVBus;	//	This is the step the A-Device will go to
 										//	when the timer (set up in previous test) fires
 				}
@@ -239,7 +212,6 @@
 		case EBConfigured:	//	A B-Device only step!
 			{
 			test.Printf(_L("Into EBConfigured step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0679_RUNSTEPL_DUP03, "Into EBConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -254,7 +226,6 @@
 		case EBSuspended:	
 			{
 			test.Printf(_L("Into EBSuspended step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0679_RUNSTEPL_DUP04, "Into EBSuspended step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -263,7 +234,6 @@
 			
 			// issue HNP
 			test.Printf(_L("Attempting a swap on a non-HNP enabled link...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0679_RUNSTEPL_DUP05, "Attempting a swap on a non-HNP enabled link...\n");
 			iCollector.AddRequiredNotification(EWatcherMessage, RUsbOtgDriver::EMessageHnpNotEnabled);
 
 			err = otgBusRequest();	//	Request the host role
@@ -271,7 +241,6 @@
 			if (KErrNone != err)
 				{
 				test.Printf(_L("BusRequest returned %d)"),err);
-				OstTrace1(TRACE_NORMAL, CTESTCASE0679_RUNSTEPL_DUP06, "BusRequest returned %d)",err);
 				//DS Temp! return TestFailed(KErrAbort, _L("BusRequest() failed!"));
 				}
 		
@@ -283,7 +252,6 @@
 		case EBErrorReceived:
 			{
 			test.Printf(_L("Into EBErrorReceived step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0679_RUNSTEPL_DUP07, "Into EBErrorReceived step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -349,7 +317,6 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0679_RUNSTEPL_DUP08, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0680.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0680.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,10 +24,6 @@
 #include "testcaseroot.h"
 #include "b2bwatchers.h"
 #include "testcase0680.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0680Traces.h"
-#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -41,10 +37,7 @@
 
 CTestCase0680* CTestCase0680::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0680_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0680* self = new (ELeave) CTestCase0680(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -56,10 +49,7 @@
 CTestCase0680::CTestCase0680(TBool aHost)
 	: CTestCaseB2BRoot(KTestCaseId, aHost, iStatus) 
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0680_CTESTCASE0680);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -69,10 +59,7 @@
 */
 void CTestCase0680::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0680_CONSTRUCTL);
-	    }
+	LOG_FUNC
 
 	iDualRoleCase = ETrue;	// another back-back
 		
@@ -82,10 +69,7 @@
 
 CTestCase0680::~CTestCase0680()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0680_DCTESTCASE0680);
-	    }
+	LOG_FUNC
 	iCollector.DestroyObservers();
 	Cancel();
 	}
@@ -93,10 +77,7 @@
 
 void CTestCase0680::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0680_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EPreconditions;
 	CActiveScheduler::Add(this);
 	SelfComplete();
@@ -105,10 +86,7 @@
 	
 void CTestCase0680::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0680_DOCANCEL);
-	    }
+	LOG_FUNC
 	// cancel our timer
 	iTimer.Cancel();
 	}
@@ -117,10 +95,7 @@
 // handle event completion	
 void CTestCase0680::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0680_RUNSTEPL);
-	    }
+	LOG_FUNC
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -169,7 +144,6 @@
 		case EReadyToRaiseVBus:
 			{
 			test.Printf(_L("Into EReadyToRaiseVBus step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0680_RUNSTEPL_DUP01, "Into EReadyToRaiseVBus step...\n");
 			if (gTestRoleMaster)
 				{
 				// wait for Vbus to be raised
@@ -203,7 +177,6 @@
 		case EDefaultRoles:
 			{
 			test.Printf(_L("Into EDefaultRoles step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0680_RUNSTEPL_DUP02, "Into EDefaultRoles step...\n");
 			LOG_STEPNAME(_L("EWaitEnumeration"));
 			
 			if (gTestRoleMaster)
@@ -227,7 +200,6 @@
 				iCollector.AddStepTimeout(KTestCase0680ATimeout);	//	NB. In this test on the A-Device, we expect to timeout
 																	//	so a timeout isn't treated as a failure
 				test.Printf(_L("NOTE : Please observe test result on B-Device...\n"));
-				OstTrace0(TRACE_NORMAL, CTESTCASE0680_RUNSTEPL_DUP03, "NOTE : Please observe test result on B-Device...\n");
 				iCaseStep = EDropVBus;	//	This is the step the A-Device will go to
 										//	when the timer (set up in previous test) fires
 				}
@@ -239,7 +211,6 @@
 		case EBConfigured:	//	A B-Device only step!
 			{
 			test.Printf(_L("Into EBConfigured step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0680_RUNSTEPL_DUP04, "Into EBConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -249,13 +220,11 @@
 			iCollector.AddRequiredNotification(EWatcherMessage, RUsbOtgDriver::EMessageHnpNotSuspended);
 
 			test.Printf(_L("Attempting a swap on an unsuspended link...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0680_RUNSTEPL_DUP05, "Attempting a swap on an unsuspended link...\n");
 			err = otgBusRequest();	//	Request the host role
 
 			if (KErrNone != err)
 				{
 				test.Printf(_L("BusRequest returned %d)"),err);
-				OstTrace1(TRACE_NORMAL, CTESTCASE0680_RUNSTEPL_DUP06, "BusRequest returned %d)",err);
 				return TestFailed(KErrAbort, _L("BusRequest() failed!"));
 				}			
 
@@ -273,7 +242,6 @@
 				}
 
 			test.Printf(_L("Into EBErrorReceived step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0680_RUNSTEPL_DUP07, "Into EBErrorReceived step...\n");
 			iCaseStep = EDropVBus;	//	Test has pretty much passed now. Just wait for A-Device to drop VBus.
 			SelfComplete();
 			break;
@@ -334,7 +302,6 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0680_RUNSTEPL_DUP08, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0681.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0681.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,10 +24,6 @@
 #include "testcaseroot.h"
 #include "b2bwatchers.h"
 #include "testcase0681.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0681Traces.h"
-#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -41,10 +37,7 @@
 
 CTestCase0681* CTestCase0681::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0681_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0681* self = new (ELeave) CTestCase0681(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -56,10 +49,7 @@
 CTestCase0681::CTestCase0681(TBool aHost)
 	: CTestCaseB2BRoot(KTestCaseId, aHost, iStatus) 
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0681_CTESTCASE0681);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -69,10 +59,7 @@
 */
 void CTestCase0681::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0681_CONSTRUCTL);
-	    }
+	LOG_FUNC
 
 	iDualRoleCase = ETrue;	// another back-back
 		
@@ -82,10 +69,7 @@
 
 CTestCase0681::~CTestCase0681()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0681_DCTESTCASE0681);
-	    }
+	LOG_FUNC
 	iCollector.DestroyObservers();
 	Cancel();
 	}
@@ -93,10 +77,7 @@
 
 void CTestCase0681::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0681_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EPreconditions;
 	iHNPCounter = 3;	//	To be decremented to govern the number of times we do HNP.
 	CActiveScheduler::Add(this);
@@ -106,10 +87,7 @@
 	
 void CTestCase0681::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0681_DOCANCEL);
-	    }
+	LOG_FUNC
 	// cancel our timer
 	iTimer.Cancel();
 	}
@@ -120,24 +98,16 @@
 	if (gTestRoleMaster)
 		{ // "B" device
 		test.Printf(_L("***** Important note *****\n"));
-		OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS, "***** Important note *****\n");
 		test.Printf(_L("Before commencing test, please\n"));
-		OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS_DUP01, "Before commencing test, please\n");
 		test.Printf(_L("insert 'B'-cable end and activate\n"));
-		OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS_DUP02, "insert 'B'-cable end and activate\n");
 		test.Printf(_L("the test on the 'A' device.\n"));
-		OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS_DUP03, "the test on the 'A' device.\n");
 		test.Printf(_L("Then, press any key to continue.\n"));
-		OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS_DUP04, "Then, press any key to continue.\n");
 		test.Printf(_L("**************************\n"));
-		OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS_DUP05, "**************************\n");
 		}
 	else
 		{
 		test.Printf(KInsertACablePrompt);
-		OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS_DUP06, KInsertACablePrompt);
 		test.Printf(KPressAnyKeyToContinue);
-		OstTrace0(TRACE_NORMAL, CTESTCASE0681_STEPB2BPRECONDITIONS_DUP07, KPressAnyKeyToContinue);
 		}
 
 	RequestCharacter();	
@@ -146,10 +116,7 @@
 // handle event completion	
 void CTestCase0681::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0681_RUNSTEPL);
-	    }
+	LOG_FUNC
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -225,7 +192,6 @@
 		case EPerformSrp:
 			{
 			test.Printf(_L("Into EPerformSrp step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP01, "Into EPerformSrp step...\n");
 
 			if (gTestRoleMaster)
 				{
@@ -265,7 +231,6 @@
 		case EAReceivedSrp:		//	A-Device step only!
 			{
 			test.Printf(_L("Into EAReceivedSrp step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP02, "Into EAReceivedSrp step...\n");
 
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
@@ -292,7 +257,6 @@
 		case ESwappedRoles:
 			{
 			test.Printf(_L("Into ESwappedRoles step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP03, "Into ESwappedRoles step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -318,7 +282,6 @@
 		case EAConfigured:	//	A-Device only step
 			{
 			test.Printf(_L("Into EAConfigured step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP04, "Into EAConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -334,7 +297,6 @@
 		case EASuspended:	//	A-Device only step
 			{
 			test.Printf(_L("Into EASuspended step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP05, "Into EASuspended step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -351,7 +313,6 @@
 		case EDefaultRoles:
 			{
 			test.Printf(_L("Into EDefaultRoles step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP06, "Into EDefaultRoles step...\n");
 			
 			if ( --iHNPCounter >= 0)
 				{
@@ -384,7 +345,6 @@
 		case EBConfigured:	//	A B-Device only step!
 			{
 			test.Printf(_L("Into EBConfigured step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP07, "Into EBConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -399,7 +359,6 @@
 		case EBSuspended:	
 			{
 			test.Printf(_L("Into EBSuspended step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP08, "Into EBSuspended step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -408,7 +367,6 @@
 			
 			// issue HNP
 			test.Printf(_L("VBus present, attempting a swap.\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP09, "VBus present, attempting a swap.\n");
 			iCollector.AddRequiredNotification(EWatcherState, RUsbOtgDriver::EStateBHost);
 
 			err = otgBusRequest();	//	Request the host role
@@ -416,7 +374,6 @@
 			if (KErrNone != err)
 				{
 				test.Printf(_L("BusRequest returned %d\n"),err);
-				OstTrace1(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP10, "BusRequest returned %d\n",err);
 				return TestFailed(KErrAbort, _L("BusRequest() failed!"));
 				}
 		
@@ -481,7 +438,6 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0681_RUNSTEPL_DUP11, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0682.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0682.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,10 +24,6 @@
 #include "testcaseroot.h"
 #include "b2bwatchers.h"
 #include "testcase0682.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0682Traces.h"
-#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -40,10 +36,7 @@
 
 CTestCase0682* CTestCase0682::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0682_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0682* self = new (ELeave) CTestCase0682(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -56,10 +49,7 @@
 : 	CTestCaseB2BRoot(KTestCaseId, aHost, iStatus),
 	iFirstRoleSwap(ETrue)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0682_CTESTCASE0682);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -69,10 +59,7 @@
 */
 void CTestCase0682::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0682_CONSTRUCTL);
-	    }
+	LOG_FUNC
 
 	iDualRoleCase = ETrue;	// another back-back
 		
@@ -82,10 +69,7 @@
 
 CTestCase0682::~CTestCase0682()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0682_DCTESTCASE0682);
-	    }
+	LOG_FUNC
 	iCollector.DestroyObservers();
 	Cancel();
 	}
@@ -93,10 +77,7 @@
 
 void CTestCase0682::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0682_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EPreconditions;
 	iHNPCounter = 3;	//	To be decremented to govern the number of times we do HNP.
 	CActiveScheduler::Add(this);
@@ -106,10 +87,7 @@
 	
 void CTestCase0682::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0682_DOCANCEL);
-	    }
+	LOG_FUNC
 	// cancel our timer
 	iTimer.Cancel();
 	}
@@ -120,24 +98,16 @@
 	if (gTestRoleMaster)
 		{ // "B" device
 		test.Printf(_L("***** Important note *****\n"));
-		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS, "***** Important note *****\n");
 		test.Printf(_L("Before commencing test, please\n"));
-		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS_DUP01, "Before commencing test, please\n");
 		test.Printf(_L("insert 'B'-cable end and activate\n"));
-		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS_DUP02, "insert 'B'-cable end and activate\n");
 		test.Printf(_L("the test on the 'A' device.\n"));
-		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS_DUP03, "the test on the 'A' device.\n");
 		test.Printf(_L("Then, press any key to continue.\n"));
-		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS_DUP04, "Then, press any key to continue.\n");
 		test.Printf(_L("**************************\n"));
-		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS_DUP05, "**************************\n");
 		}
 	else
 		{
 		test.Printf(KInsertACablePrompt);
-		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS_DUP06, KInsertACablePrompt);
 		test.Printf(KPressAnyKeyToContinue);
-		OstTrace0(TRACE_NORMAL, CTESTCASE0682_STEPB2BPRECONDITIONS_DUP07, KPressAnyKeyToContinue);
 		}
 
 	RequestCharacter();	
@@ -146,10 +116,7 @@
 // handle event completion	
 void CTestCase0682::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0682_RUNSTEPL);
-	    }
+	LOG_FUNC
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -200,7 +167,6 @@
 		case EPerformSrp:
 			{
 			test.Printf(_L("Into EPerformSrp step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP01, "Into EPerformSrp step...\n");
 
 			if (gTestRoleMaster)
 				{
@@ -234,7 +200,6 @@
 		case EAReceivedSrp:		//	A-Device step only!
 			{
 			test.Printf(_L("Into EAReceivedSrp step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP02, "Into EAReceivedSrp step...\n");
 
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
@@ -263,7 +228,6 @@
 		case EDefaultRoles:
 			{
 			test.Printf(_L("Into EDefaultRoles step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP03, "Into EDefaultRoles step...\n");
 			
 			if ( --iHNPCounter >= 0)
 				{
@@ -296,7 +260,6 @@
 		case EBConfigured:	//	A B-Device only step!
 			{
 			test.Printf(_L("Into EBConfigured step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP04, "Into EBConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -311,7 +274,6 @@
 		case EBSuspended:	
 			{
 			test.Printf(_L("Into EBSuspended step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP05, "Into EBSuspended step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -330,7 +292,6 @@
 				if (KErrNone != err)
 					{
 					test.Printf(_L("BusRequest returned %d\n"),err);
-					OstTrace1(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP06, "BusRequest returned %d\n",err);
 					return TestFailed(KErrAbort, _L("BusRequest() failed!"));
 					}
 				}
@@ -348,7 +309,6 @@
 		case ESwappedRoles:
 			{
 			test.Printf(_L("Into ESwappedRoles step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP07, "Into ESwappedRoles step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -374,7 +334,6 @@
 		case EAConfigured:	//	A-Device only step
 			{
 			test.Printf(_L("Into EWaitTillAConfigured step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP08, "Into EWaitTillAConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -390,7 +349,6 @@
 		case EASuspended:	//	A-Device only step
 			{
 			test.Printf(_L("Into EWaitTillASuspended step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP09, "Into EWaitTillASuspended step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -458,7 +416,6 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0682_RUNSTEPL_DUP10, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0683.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0683.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -25,10 +25,6 @@
 //#include "testcasewd.h"
 #include "b2bwatchers.h"
 #include "testcase0683.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0683Traces.h"
-#endif
 
 #define _REPEATS (oOpenIterations*3)
 
@@ -42,10 +38,7 @@
 
 CTestCase0683* CTestCase0683::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0683_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0683* self = new (ELeave) CTestCase0683(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -57,10 +50,7 @@
 CTestCase0683::CTestCase0683(TBool aHost)
 	: CTestCaseB2BRoot(KTestCaseId, aHost, iStatus) 
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0683_CTESTCASE0683);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -70,10 +60,7 @@
 */
 void CTestCase0683::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0683_CONSTRUCTL);
-	    }
+	LOG_FUNC
 
 	iDualRoleCase = ETrue;	// another back-back
 		
@@ -83,10 +70,7 @@
 
 CTestCase0683::~CTestCase0683()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0683_DCTESTCASE0683);
-	    }
+	LOG_FUNC
 	iCollector.DestroyObservers();
 	Cancel();
 	}
@@ -94,10 +78,7 @@
 
 void CTestCase0683::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0683_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EPreconditions;
 	iHNPCounter = 3;	//	To be decremented to govern the number of times we do HNP.
 	CActiveScheduler::Add(this);
@@ -107,10 +88,7 @@
 	
 void CTestCase0683::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0683_DOCANCEL);
-	    }
+	LOG_FUNC
 	// cancel our timer
 	iTimer.Cancel();
 	}
@@ -119,10 +97,7 @@
 // handle event completion	
 void CTestCase0683::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0683_RUNSTEPL);
-	    }
+	LOG_FUNC
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
 	TBuf<MAX_DSTRLEN> aDescription;
@@ -206,7 +181,6 @@
 		case EDefaultRoles:
 			{
 			test.Printf(_L("Into EDefaultRoles step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP01, "Into EDefaultRoles step...\n");
 
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
@@ -255,7 +229,6 @@
 		case EBConfigured:	//	A B-Device only step!
 			{
 			test.Printf(_L("Into EBConfigured step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP02, "Into EBConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -270,7 +243,6 @@
 		case EBSuspended:	
 			{
 			test.Printf(_L("Into EBSuspended step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP03, "Into EBSuspended step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -281,14 +253,12 @@
 				{			
 				// issue bus request to trigger HNP
 				test.Printf(_L("VBus present, attempting a swap.\n"));
-				OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP04, "VBus present, attempting a swap.\n");
 				iCollector.AddRequiredNotification(EWatcherState, RUsbOtgDriver::EStateBHost);
 
 				err = otgBusRequest();	//	Request the host role
 				if (KErrNone != err)
 					{
 					test.Printf(_L("BusRequest returned %d\n"),err);
-					OstTrace1(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP05, "BusRequest returned %d\n",err);
 					return TestFailed(KErrAbort, _L("BusRequest() failed!"));
 					}
 			
@@ -309,7 +279,6 @@
 		case EAIdleHostPriorToAPeripheral:	//	an "A-Device only" step
 			{
 			test.Printf(_L("Into EAIdleHostPriorToAPeripheral step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP06, "Into EAIdleHostPriorToAPeripheral step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -327,7 +296,6 @@
 		case ESwappedRoles:
 			{
 			test.Printf(_L("Into ESwappedRoles step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP07, "Into ESwappedRoles step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -353,7 +321,6 @@
 		case EAConfigured:	//	A-Device only step
 			{
 			test.Printf(_L("Into EAConfigured step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP08, "Into EAConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -370,7 +337,6 @@
 		case EASuspended:	//	A-Device only step
 			{
 			test.Printf(_L("Into EASuspended step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP09, "Into EASuspended step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -388,7 +354,6 @@
 		case EAIdleHostPriorToVBusDown:
 			{
 			test.Printf(_L("Into EAIdleHostPriorToVBusDown step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP10, "Into EAIdleHostPriorToVBusDown step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -457,7 +422,6 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0683_RUNSTEPL_DUP11, "<Error> unknown test step");
 			Cancel();
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
 		}
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase0684.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase0684.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -25,10 +25,6 @@
 //#include "testcasewd.h"
 #include "b2bwatchers.h"
 #include "testcase0684.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase0684Traces.h"
-#endif
 
 #include <e32debug.h> 
 
@@ -44,10 +40,7 @@
 
 CTestCase0684* CTestCase0684::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0684_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase0684* self = new (ELeave) CTestCase0684(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -59,10 +52,7 @@
 CTestCase0684::CTestCase0684(TBool aHost)
 	: CTestCaseB2BRoot(KTestCaseId, aHost, iStatus) 
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0684_CTESTCASE0684);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -72,10 +62,7 @@
 */
 void CTestCase0684::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0684_CONSTRUCTL);
-	    }
+	LOG_FUNC
 
 	iDualRoleCase = ETrue;
 	iBusRequestCounter = 2;
@@ -87,10 +74,7 @@
 
 CTestCase0684::~CTestCase0684()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0684_DCTESTCASE0684);
-	    }
+	LOG_FUNC
 	iCollector.DestroyObservers();
 	Cancel();
 	}
@@ -98,10 +82,7 @@
 
 void CTestCase0684::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0684_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EPreconditions;
 	CActiveScheduler::Add(this);
 	SelfComplete();
@@ -110,19 +91,13 @@
 	
 void CTestCase0684::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0684_DOCANCEL);
-	    }
+	LOG_FUNC
 	// cancel our timer
 	iTimer.Cancel();
 	}
 void CTestCase0684::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE0684_RUNSTEPL);
-	    }
+	LOG_FUNC
 	
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
@@ -186,7 +161,6 @@
 		case EReadyToRaiseVBus:
 			{
 			test.Printf(_L("Into EReadyToRaiseVBus step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP01, "Into EReadyToRaiseVBus step...\n");
 			
 			if (gTestRoleMaster)
 				{
@@ -225,7 +199,6 @@
 		case EDefaultRoles:
 			{
 			test.Printf(_L("Into EDefaultRoles step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP02, "Into EDefaultRoles step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -248,7 +221,6 @@
 		case EAIdleHostPriorToAPeripheral:	//	an "A-Device only" step
 			{
 			test.Printf(_L("Into EAIdleHostPriorToAPeripheral step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP03, "Into EAIdleHostPriorToAPeripheral step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -268,11 +240,10 @@
 		case EBConfigured:
 			{
 			test.Printf(_L("Into EBConfigured step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP04, "Into EBConfigured step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
-				OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP05, "Timeout");
+				RDebug::Print(_L("Timeout"));
 				return TestFailed(KErrAbort, _L("Timeout"));
 				}
 			iCollector.AddRequiredNotification(EWatcherPeripheralState, EUsbcDeviceStateSuspended);
@@ -284,17 +255,15 @@
 		case EBSuspended:
 			{
 			test.Printf(_L("Into EBSuspended step...\n"));					
-			OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP06, "Into EBSuspended step...\n");					
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
-				OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP07, "Timeout");
+				RDebug::Print(_L("Timeout"));
 				return TestFailed(KErrAbort, _L("Timeout"));
 				}
 			
 			if(iBusRequestCounter > 0){
 				test.Printf(_L("VBus present, attempting a swap.\n"));
-				OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP08, "VBus present, attempting a swap.\n");
 				iCollector.AddRequiredNotification(EWatcherState, RUsbOtgDriver::EStateBHost);
 				
 				iBusRequestCounter --;
@@ -302,7 +271,6 @@
 				if (KErrNone != err)
 					{
 					test.Printf(_L("BusRequest returned %d\n"),err);
-					OstTrace1(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP09, "BusRequest returned %d\n",err);
 					return TestFailed(KErrAbort, _L("BusRequest() failed!"));
 					}
 				iCaseStep = EBToHost;
@@ -318,7 +286,6 @@
 		case EAToHost:
 			{
 			test.Printf(_L("Into EAToHost step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP10, "Into EAToHost step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -331,7 +298,6 @@
 				TUint16 val = 0;
 				GetMaxPower(val);
 				test.Printf(_L("bMaxPower= %d\n"), val);
-				OstTrace1(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP11, "bMaxPower= %d\n", val);
 				iCollector.AddRequiredNotification(EWatcherState, RUsbOtgDriver::EStateAPeripheral);
 				iCaseStep = EAToPeripheral;
 			}
@@ -347,7 +313,6 @@
 		case EAToPeripheral:
 			{
 			test.Printf(_L("Into EAToPeripheral step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP12, "Into EAToPeripheral step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -362,7 +327,6 @@
 		case EBToHost:
 			{
 			test.Printf(_L("Into EBToHost step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP13, "Into EBToHost step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -377,7 +341,6 @@
 		case EBToPeripheral:
 			{
 			test.Printf(_L("Into EBToPeripheral step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP14, "Into EBToPeripheral step...\n");
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
 				iCollector.DestroyObservers();
@@ -400,7 +363,6 @@
 		case EIdleHostPriorToVBusDown:
 			{
 			test.Printf(_L("Into EAIdleHostPriorToVBusDown step...\n"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP15, "Into EAIdleHostPriorToVBusDown step...\n");
 			
 			if (KTestCaseWatchdogTO == iStatus.Int())
 				{
@@ -473,7 +435,6 @@
 			
 		default:
 			test.Printf(_L("<Error> unknown test step"));
-			OstTrace0(TRACE_NORMAL, CTESTCASE0684_RUNSTEPL_DUP16, "<Error> unknown test step");
 			Cancel();
 			RequestCharacter();	
 			return (TestFailed(KErrCorrupt, _L("<Error> unknown test step")));
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcase1233.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcase1233.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -24,16 +24,11 @@
 #include "testcaseroot.h"
 #include "b2bwatchers.h"
 #include "testcase1233.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcase1233Traces.h"
-#endif
 
 #include <e32debug.h> 
 
 #define LOG_INTO_STEP(a) test.Printf(_L("\nInto Step [%S]\n\n"), &a);
 
-
 /* **************************************************************************************
  * the name below is used to add a pointer to our construction method to a pointer MAP in 
  * the class factory
@@ -43,10 +38,7 @@
 
 CTestCase1233* CTestCase1233::NewL(TBool aHost)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE1233_NEWL);
-	    }
+	LOG_FUNC
 	CTestCase1233* self = new (ELeave) CTestCase1233(aHost);
 	CleanupStack::PushL(self);
 	self->ConstructL();
@@ -58,10 +50,7 @@
 CTestCase1233::CTestCase1233(TBool aHost)
 	: CTestCaseB2BRoot(KTestCaseId, aHost, iStatus) 
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE1233_CTESTCASE1233);
-	    }
+	LOG_FUNC
 		
 	} 
 
@@ -71,10 +60,7 @@
 */
 void CTestCase1233::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE1233_CONSTRUCTL);
-	    }
+	LOG_FUNC
 
 	iTestVID = 0x0E22;		// Symbian
 	iTestPID = 0xF000 + 1233; // Test 1233
@@ -85,10 +71,7 @@
 
 CTestCase1233::~CTestCase1233()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE1233_DCTESTCASE1233);
-	    }
+	LOG_FUNC
 	iCollector.DestroyObservers();
 	Cancel();
 	}
@@ -96,10 +79,7 @@
 
 void CTestCase1233::ExecuteTestCaseL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE1233_EXECUTETESTCASEL);
-	    }
+	LOG_FUNC
 	iCaseStep = EPreconditions;
 	CActiveScheduler::Add(this);
 	SelfComplete();
@@ -108,10 +88,7 @@
 	
 void CTestCase1233::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE1233_DOCANCEL);
-	    }
+	LOG_FUNC
 	// cancel our timer
 	iTimer.Cancel();
 	}
@@ -119,10 +96,7 @@
 
 void CTestCase1233::RunStepL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASE1233_RUNSTEPL);
-	    }
+	LOG_FUNC
 	
 	// Obtain the completion code for this CActive obj.
 	TInt completionCode(iStatus.Int()); 
@@ -212,7 +186,6 @@
 			if ( iTestPID > 0x0108 )
 				{
 				test.Printf(_L("All VID/PID pairs done\n"));
-				OstTrace0(TRACE_NORMAL, CTESTCASE1233_RUNSTEPL_DUP01, "All VID/PID pairs done\n");
 				
 				iCaseStep = EUnloadLdd;
 				}
@@ -222,7 +195,6 @@
 					{
 					// B
 					test.Printf(_L("Setting VID/PID of 0x%04x/0x%04x\n"),iTestVID,iTestPID);
-					OstTraceExt2(TRACE_NORMAL, CTESTCASE1233_RUNSTEPL_DUP02, "Setting VID/PID of 0x%04x/0x%04x\n",(TUint32)iTestVID,(TUint32)iTestPID);
 					
 					if (!StepChangeVidPid(iTestVID,iTestPID))
 						{
@@ -233,7 +205,6 @@
 					{
 					// A
 					test.Printf(_L("Expecting VID/PID of 0x%04x/0x%04x\n"),iTestVID,iTestPID);
-					OstTraceExt2(TRACE_NORMAL, CTESTCASE1233_RUNSTEPL_DUP03, "Expecting VID/PID of 0x%04x/0x%04x\n",(TUint32)iTestVID,(TUint32)iTestPID);
 					}
 				
 				iCollector.ClearAllEvents();
@@ -268,7 +239,6 @@
 				{ 
 				// A device
 				test.Printf(_L("Raising VBUS for VID/PID = 0x%04x/0x%04x\n"),iTestVID,iTestPID);
-				OstTraceExt2(TRACE_NORMAL, CTESTCASE1233_RUNSTEPL_DUP04, "Raising VBUS for VID/PID = 0x%04x/0x%04x\n",(TUint32)iTestVID,(TUint32)iTestPID);
 				
 				if ( otgBusRequest() != KErrNone )
 					{
@@ -297,13 +267,11 @@
 			if ( otgVbusPresent() )
 				{
 				test.Printf(_L("...VBUS is UP\n"));
-				OstTrace0(TRACE_NORMAL, CTESTCASE1233_RUNSTEPL_DUP05, "...VBUS is UP\n");
 				iCaseStep = EDropVBus;
 				}
 			else
 				{
 				test.Printf(_L("...VBUS is DOWN\n"));
-				OstTrace0(TRACE_NORMAL, CTESTCASE1233_RUNSTEPL_DUP06, "...VBUS is DOWN\n");
 				return TestFailed(KErrAbort, _L("Vbus did not rise - FAILED!"));
 				}
 
@@ -376,13 +344,11 @@
 			if ( otgVbusPresent() )
 				{
 				test.Printf(_L("...VBUS is UP\n"));
-				OstTrace0(TRACE_NORMAL, CTESTCASE1233_RUNSTEPL_DUP07, "...VBUS is UP\n");
 				return TestFailed(KErrAbort, _L("Vbus did not rise - FAILED!"));
 				}
 			else
 				{
 				test.Printf(_L("...VBUS is DOWN\n"));
-				OstTrace0(TRACE_NORMAL, CTESTCASE1233_RUNSTEPL_DUP08, "...VBUS is DOWN\n");
 				iCaseStep = ELoopToNextPID;
 				}
 
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcasecontroller.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcasecontroller.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -29,10 +29,6 @@
 #include "testcaseroot.h"
 #include "testcasecontroller.h"
 #include "testengine.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcasecontrollerTraces.h"
-#endif
 
 
 
@@ -97,12 +93,10 @@
 	if (err != KErrNone)
 		{
 		test.Printf(_L("<Error> Test case %lS failed\n"),&iTestCaseId);
-		OstTraceExt1(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL, "<Error> Test case %lS failed\n",iTestCaseId);
 		}
 	else
 		{
 		test.Printf(_L("Test case %lS passed\n"),&iTestCaseId);
-		OstTraceExt1(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP01, "Test case %lS passed\n",iTestCaseId);
 		}
 		
 	// Find next test to run	
@@ -110,9 +104,7 @@
 	if (err == KErrNone)
 		{
 		test.Printf(_L("\n"));	// ensures blank line between tests
-		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP02, "\n");	// ensures blank line between tests
 		test.Printf(_L("\n"));
-		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP03, "\n");
 		test.Next(iTestCaseId);
 		
 		// run the next test here
@@ -121,12 +113,12 @@
 		}
 	else if (err == KErrNotFound)
 		{
-		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP04, "All specified test cases performed");
+		RDebug::Printf("All specified test cases performed");
 		CActiveScheduler::Stop();
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP05, "<Error %d> Unknown error from CTestEngine::NextTestCaseId",err);
+		RDebug::Printf("<Error %d> Unknown error from CTestEngine::NextTestCaseId",err);
 		User::Leave(err);
 		}
 	}
@@ -134,10 +126,7 @@
 	
 TInt CTestCaseController::RunError(TInt aError)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASECONTROLLER_RUNERROR);
-	    }
+	LOG_FUNC
 	switch (aError)
 		{
 		case KErrNoMemory:
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcasefactory.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcasefactory.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -26,10 +26,6 @@
 #include <e32def_private.h>
 #include "TestCaseFactory.h"
 #include "debugmacros.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcasefactoryTraces.h"
-#endif
 
 
 	
@@ -53,24 +49,25 @@
 	
 void RTestFactory::RegisterTestCase(const TDesC& aTestCaseId,TCreationMethod aCreationMethod)
 	{
+	//LOG_FUNC
 	TStringIdentity key(aTestCaseId);
 	TInt err(Instance().iTestCases.Insert(key,aCreationMethod));
 	if (err != KErrNone)
 		{
 		// Log that a test case could not be registered due to err
-		OstTraceExt1(TRACE_NORMAL, RTESTFACTORY_REGISTERTESTCASE_DUP01, "Test case '%S' could not be registered with test case factory",aTestCaseId);
+		RDebug::Print(_L("Test case '%S' could not be registered with test case factory"),&aTestCaseId);
 		}
 	else
 		{
 		RTestFactory::TCreationMethod* creatorFunction = Instance().iTestCases.Find(key);
 		if (creatorFunction == NULL)
 			{
-			OstTraceExt1(TRACE_NORMAL, RTESTFACTORY_REGISTERTESTCASE_DUP02, "<Error> Test case '%S' did not register",aTestCaseId);
+			RDebug::Print(_L("<Error> Test case '%S' did not register"),&aTestCaseId);
 			ListRegisteredTestCases();
 			}
 		else
 			{
-			OstTraceExt1(TRACE_NORMAL, RTESTFACTORY_REGISTERTESTCASE_DUP03, "Test case '%S' registered in factory",aTestCaseId);
+			RDebug::Print(_L("Test case '%S' registered in factory"),&aTestCaseId);
 			}
 		}
 	}
@@ -90,10 +87,7 @@
  */
 void RTestFactory::GetTestID(TInt aIndex, TBuf<KTestCaseIdLength> &aTestID)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(RTESTFACTORY_GETTESTID);
-	    }
+	LOG_FUNC
 
 	RFactoryMap::TIter it(Instance().iTestCases);
 	
@@ -133,16 +127,12 @@
  */	
 void RTestFactory::ListRegisteredTestCases(RPointerArray<HBufC> & aTestCaseNameArr)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(RTESTFACTORY_LISTREGISTEREDTESTCASES);
-	    }
+	LOG_FUNC
 	RFactoryMap::TIter it(Instance().iTestCases);
 	TInt count(0);
 	TInt cases(Instance().iTestCases.Count());
 	
 	test.Printf(_L("------ F A C T O R Y -------\n"));
-	OstTrace0(TRACE_NORMAL, RTESTFACTORY_LISTREGISTEREDTESTCASES_DUP01, "------ F A C T O R Y -------\n");
 	
 	it.Reset();
 	for (count=0; count<Instance().iTestCases.Count(); count++)
@@ -186,20 +176,15 @@
 	for (count=0; count<aTestCaseNameArr.Count(); count++)
 		{
 		test.Printf(_L("% 2d: %S\n"), count, aTestCaseNameArr[count]);
-		OstTraceExt2(TRACE_NORMAL, RTESTFACTORY_LISTREGISTEREDTESTCASES_DUP02, "% 2d: %S\n", count, *aTestCaseNameArr[count]);
 		}
 	
 	test.Printf(_L("----------------------------\n"));
-	OstTrace0(TRACE_NORMAL, RTESTFACTORY_LISTREGISTEREDTESTCASES_DUP03, "----------------------------\n");
 	}
 
 
 CTestCaseRoot* RTestFactory::CreateTestCaseL(const TDesC& aTestCaseId)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(RTESTFACTORY_CREATETESTCASEL);
-	    }
+	LOG_FUNC
 	RTestFactory::TCreationMethod creatorFunction = NULL;
 	TInt err(KErrNone);
 	TStringIdentity key(aTestCaseId);
@@ -208,12 +193,12 @@
 	if (err != KErrNone)
 		{
 		// Test case is not present in the factory therefore test cannot support specified test case
-		OstTraceExt2(TRACE_NORMAL, RTESTFACTORY_CREATETESTCASEL_DUP01, "<Error %d> Test case '%S' not supported",err,aTestCaseId);
+		RDebug::Print(_L("<Error %d> Test case '%S' not supported"),err,&aTestCaseId);
 		ListRegisteredTestCases();
 		User::Leave(err);
 		}
 
-	OstTraceExt1(TRACE_NORMAL, RTESTFACTORY_CREATETESTCASEL_DUP02, "Creating test case '%S'",aTestCaseId);
+	RDebug::Print(_L("Creating test case '%S'"),&aTestCaseId);
 		
 	// Call the creator function to create the test case object
 	return creatorFunction(gSemiAutomated);
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcaseroot.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcaseroot.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -29,10 +29,6 @@
 #include <d32otgdi.h>		// OTGDI header
 #include <d32usbc.h>		// USBCC header
 #include "testcaseroot.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcaserootTraces.h"
-#endif
 
 /* Implemention of classes CTestCaseRoot, CTestCaseB2BRoot
  *
@@ -52,24 +48,17 @@
 	
 void CTestCaseRoot::BaseConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASEROOT_BASECONSTRUCTL);
-	    }
+	LOG_FUNC
 	
 
 	TInt err(iTimer.CreateLocal());
 	if (err == KErrNone)
 		{
 		LOG_VERBOSE1(_L("Test case timer created"));
-		if(gVerboseOutput)
-		    {
-		    OstTrace0(TRACE_VERBOSE, CTESTCASEROOT_BASECONSTRUCTL_DUP01, "Test case timer created");
-		    }
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CTESTCASEROOT_BASECONSTRUCTL_DUP02, "<Error %d> Test case timer could not be created",err);
+		RDebug::Printf("<Error %d> Test case timer could not be created",err);
 		User::Leave(err);
 		}
 	//
@@ -80,24 +69,17 @@
 	
 CTestCaseRoot::~CTestCaseRoot()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASEROOT_DCTESTCASEROOT);
-	    }
+	LOG_FUNC
 	Cancel();
 	}
 
 // utility GUI methods
 void CTestCaseRoot::DisplayTestCaseOptions()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASEROOT_DISPLAYTESTCASEOPTIONS);
-	    }
+	LOG_FUNC
 
 	// commonly overridden to display any options for that test
 	test.Printf(_L("Press <ESC> to end the test.\n"));	
-	OstTrace0(TRACE_NORMAL, CTESTCASEROOT_DISPLAYTESTCASEOPTIONS_DUP01, "Press <ESC> to end the test.\n");	
 	}
 
     
@@ -118,10 +100,7 @@
 
 void CTestCaseRoot::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASEROOT_DOCANCEL);
-	    }
+	LOG_FUNC
 	}
 
     
@@ -137,10 +116,7 @@
     
 void CTestCaseRoot::ProcessEngineKey(TKeyCode &aKey)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASEROOT_PROCESSENGINEKEY);
-	    }
+	LOG_FUNC
 	
 	if (EKeyEscape == aKey)
 		{
@@ -159,10 +135,7 @@
 
 void CTestCaseRoot::RequestCharacter()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASEROOT_REQUESTCHARACTER);
-	    }
+	LOG_FUNC
 	  // A request is issued to the CConsoleBase to accept a
 	  // character from the keyboard.
 
@@ -176,10 +149,7 @@
 
 void CTestCaseRoot::RunL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASEROOT_RUNL);
-	    }
+	LOG_FUNC
 	TInt complCode(iStatus.Int());
 	if (iRequestedChar)
 		{
@@ -205,16 +175,8 @@
 		TInt currentStep(GetStepIndex());
 		PreRunStep();
 		LOG_VERBOSE2(_L("\n<< RunStepL() step=%d\n"), currentStep);
-		if(gVerboseOutput)
-		    {
-		    OstTrace1(TRACE_VERBOSE, CTESTCASEROOT_RUNL_DUP01, "\n<< RunStepL() step=%d\n", currentStep);
-		    }
 		RunStepL();
 		LOG_VERBOSE3(_L(">> RunStepL() step=%d->%d\n"), currentStep, GetStepIndex());
-		if(gVerboseOutput)
-		    {
-		    OstTraceExt2(TRACE_VERBOSE, CTESTCASEROOT_RUNL_DUP02, ">> RunStepL() step=%d->%d\n", currentStep, GetStepIndex());
-		    }
 		PostRunStep();
 		}
 	}
@@ -232,12 +194,8 @@
 
 TInt CTestCaseRoot::RunError(TInt aError)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASEROOT_RUNERROR);
-	    }
+	LOG_FUNC
 	test.Printf(_L("Test case C%lS::RunL left with %d"), &iTestCaseId, aError);
-	OstTraceExt2(TRACE_NORMAL, CTESTCASEROOT_RUNERROR_DUP01, "Test case C%lS::RunL left with %d", iTestCaseId, aError);
 	AssertionFailed(aError, _L("RunError"));
 	return KErrNone;
 	}
@@ -266,23 +224,15 @@
 
 void CTestCaseRoot::TestFailed(TInt aFailResult, const TDesC &aErrorDescription)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASEROOT_TESTFAILED);
-	    }
+	LOG_FUNC
 	iTestResult = aFailResult;
 	test.Printf(_L("Test %S\n"), &TestCaseId());
-	OstTraceExt1(TRACE_NORMAL, CTESTCASEROOT_TESTFAILED_DUP01, "Test %S\n", TestCaseId());
 	test.Printf(_L("Failed (%d)\n"), aFailResult);
-	OstTrace1(TRACE_NORMAL, CTESTCASEROOT_TESTFAILED_DUP02, "Failed (%d)\n", aFailResult);
 	test.Printf(_L("%S!\n"), &aErrorDescription);
-	OstTraceExt1(TRACE_NORMAL, CTESTCASEROOT_TESTFAILED_DUP03, "%S!\n", aErrorDescription);
 	if (!iAutomated)
 		{
 		test.Printf(_L("\n"));
-		OstTrace0(TRACE_NORMAL, CTESTCASEROOT_TESTFAILED_DUP04, "\n");
 		test.Printf(KPressAnyKeyToContinue);
-		OstTrace0(TRACE_NORMAL, CTESTCASEROOT_TESTFAILED_DUP05, KPressAnyKeyToContinue);
 		iConsole->Getch();
 		}
 	// the next call panics the framework!
@@ -292,21 +242,13 @@
 	
 void CTestCaseRoot::TestFailed2(TInt aFailResult, const TDesC &aErrorDescription, TInt errorCode)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASEROOT_TESTFAILED2);
-	    }
+	LOG_FUNC
 	iTestResult = aFailResult;
 	test.Printf(_L("Test %S FAILED %d '%S %d'!\n"), 
 	            &TestCaseId(), 
 	            aFailResult, 
 	            &aErrorDescription, 
 	            errorCode);
-	OstTraceExt4(TRACE_NORMAL, CTESTCASEROOT_TESTFAILED2_DUP01, "Test %S FAILED %d '%S %d'!\n", 
-	            TestCaseId(), 
-	            aFailResult, 
-	            aErrorDescription, 
-	            errorCode);
 	// the next call panics the framework!
 	TestPolicy().SignalTestComplete(iTestResult);
 	}
@@ -315,10 +257,7 @@
 	
 void CTestCaseRoot::TestPassed()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASEROOT_TESTPASSED);
-	    }
+	LOG_FUNC
 	iTestResult = KErrNone;
 	TestPolicy().SignalTestComplete(iTestResult);
 	}
@@ -346,11 +285,9 @@
 	if (gVerboseOutput) 
 		{
 		test.Printf(_L("--------------\n %S "), &aStepName);
-		OstTraceExt1(TRACE_NORMAL, CTESTCASEROOT_PRINTSTEPNAME, "--------------\n %S ", aStepName);
 		// B2B class method dumps the engine state
 		//
 		test.Printf(_L("\n--------------\n"));
-		OstTrace0(TRACE_NORMAL, CTESTCASEROOT_PRINTSTEPNAME_DUP01, "\n--------------\n");
 		}
 	}
 
@@ -361,20 +298,14 @@
 CTestCaseB2BRoot::CTestCaseB2BRoot(const TDesC& aTestCaseId, TBool aHost, TRequestStatus &aStatus) 
 	: CTestCaseRoot(aTestCaseId, aHost) , iCollector(aStatus)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASEB2BROOT_CTESTCASEB2BROOT);
-	    }
+	LOG_FUNC
 	
 	}
 
 
 CTestCaseB2BRoot::~CTestCaseB2BRoot()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASEB2BROOT_DCTESTCASEB2BROOT);
-	    }
+	LOG_FUNC
 	
 	}
 
@@ -385,7 +316,6 @@
 	if (gVerboseOutput) 
 		{
 		test.Printf(_L("--------------\n %S "), &aStepName);
-		OstTraceExt1(TRACE_NORMAL, CTESTCASEB2BROOT_PRINTSTEPNAME, "--------------\n %S ", aStepName);
 		// engine state
 		CNotifyWatcherBase *pWatcher = iCollector.GetWatcher(EWatcherState);
 		if (pWatcher)
@@ -395,13 +325,8 @@
 			
 			OtgStateString(aState, aDescription);
 			LOG_VERBOSE3(_L("OTGState %d '%S' \n"), aState, &aDescription);
-			if(gVerboseOutput)
-			    {
-			    OstTraceExt2(TRACE_VERBOSE, CTESTCASEB2BROOT_PRINTSTEPNAME_DUP01, "OTGState %d '%S' \n", aState, aDescription);
-			    }
 			}
 		test.Printf(_L(" : time = %dms\n--------------\n"), iCollector.DurationElapsed());
-		OstTrace1(TRACE_NORMAL, CTESTCASEB2BROOT_PRINTSTEPNAME_DUP02, " : time = %dms\n--------------\n", iCollector.DurationElapsed());
 		}
 	}
 
@@ -410,17 +335,10 @@
 void CTestCaseB2BRoot::DescribePreconditions()
 	{
 	test.Printf(KTestTypeB2BMsg); // B2B
-	OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_DESCRIBEPRECONDITIONS, KTestTypeB2BMsg); // B2B
 	if (gTestRoleMaster)
-	   {
 		test.Printf(KRoleMasterMsg);
-		OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_DESCRIBEPRECONDITIONS_DUP01, KRoleMasterMsg);
-		}
 	else
-	    {
 		test.Printf(KRoleSlaveMsg);
-		OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_DESCRIBEPRECONDITIONS_DUP02, KRoleSlaveMsg);
-		}
 	}
 
 
@@ -430,12 +348,10 @@
 	if (gTestRoleMaster)
 		{ // "B" device
 		test.Printf(KInsertBCablePrompt);
-		OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_STEPB2BPRECONDITIONS, KInsertBCablePrompt);
 		}
 	else
 		{
 		test.Printf(KInsertACablePrompt);
-		OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_STEPB2BPRECONDITIONS_DUP01, KInsertACablePrompt);
 		}
 	if (iAutomated)
 		{
@@ -444,7 +360,6 @@
 		return;
 		}
 	test.Printf(KPressAnyKeyToContinue);
-	OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_STEPB2BPRECONDITIONS_DUP02, KPressAnyKeyToContinue);
 	RequestCharacter();	
 	}
 
@@ -458,7 +373,6 @@
 		if (otgIdPinPresent())
 			{ // oops
 			test.Printf(KMsgErrorPreconditionFailed);
-			OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_CHECKROLECONNECTIONS, KMsgErrorPreconditionFailed);
 			return TestFailed(KErrAbort, KMsgBPlugNotFound);
 			}
 		}
@@ -467,7 +381,6 @@
 		if (!otgIdPinPresent())
 			{ // oops
 			test.Printf(KMsgErrorPreconditionFailed);
-			OstTrace0(TRACE_NORMAL, CTESTCASEB2BROOT_CHECKROLECONNECTIONS_DUP01, KMsgErrorPreconditionFailed);
 			return TestFailed(KErrAbort, KMsgAPlugNotFound);
 			}
 		}
@@ -479,10 +392,7 @@
  */
 void CTestCaseB2BRoot::PreRunStep()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASEB2BROOT_PRERUNSTEP);
-	    }
+	LOG_FUNC
 		
 		iCollector.ClearAllEvents(EFalse, ETrue);
 	}
@@ -490,10 +400,7 @@
 
 void CTestCaseB2BRoot::PostRunStep()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASEB2BROOT_POSTRUNSTEP);
-	    }
+	LOG_FUNC
 		// clear the recieved event Q, but not the expected Q
 		iCollector.ClearAllEvents(ETrue, EFalse);
 	
--- a/kerneltest/e32test/usbho/t_otgdi/src/testcasewd.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testcasewd.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -26,10 +26,6 @@
 #include <e32Test.h>	// RTest headder
 #include "testcaseroot.h"
 #include "TestCasewd.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testcasewdTraces.h"
-#endif
 
 
 
@@ -75,10 +71,7 @@
 void CTestCaseWatchdog::RunL()
 // Timer request has completed, so notify the timer's owner that we timed out
     {
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTCASEWATCHDOG_RUNL);
-	    }
+	LOG_FUNC
 	__ASSERT_ALWAYS(iCancelFriendFunc, User::Panic(KMsgWatchdogPanicd, EPanicWatchdogError));
 	__ASSERT_ALWAYS(iThisPointer, User::Panic(KMsgWatchdogPanicd, EPanicWatchdogError));
 	(*iCancelFriendFunc)(iThisPointer);
@@ -92,10 +85,6 @@
 		WDCancellerMethod cancelMethod)
 	{
 	LOG_VERBOSE2(_L("Watchdogging this step for %d ms\n"), aWatchdogIntervalMS);
-	if(gVerboseOutput)
-	    {
-	    OstTrace1(TRACE_VERBOSE, CTESTCASEWATCHDOG_ISSUEREQUEST, "Watchdogging this step for %d ms\n", aWatchdogIntervalMS);
-	    }
 	if (IsValid())
 		{
 		Cancel();
@@ -119,7 +108,6 @@
 		{
 		
 		test.Printf(_L("CTestCaseWatchdog obj not properly constructed!\n"));
-		OstTrace0(TRACE_NORMAL, CTESTCASEWATCHDOG_ISVALID, "CTestCaseWatchdog obj not properly constructed!\n");
 		return(EFalse);
 		}
 	return(ETrue);	
--- a/kerneltest/e32test/usbho/t_otgdi/src/testengine.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testengine.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -29,10 +29,6 @@
 #include "TestCaseController.h"
 #include "TestCaseFactory.h"
 #include "TestCaseRoot.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testengineTraces.h"
-#endif
 
 // Console application parameter options
 _LIT(KArgAllTestCases,"/ALL");			// see default test-list below
@@ -84,10 +80,7 @@
 
 CTestEngine::~CTestEngine()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTENGINE_DCTESTENGINE);
-	    }
+	LOG_FUNC
 	// Destroy the test case controller
 	if (iTestCaseController)
 		{
@@ -101,21 +94,15 @@
 	
 void CTestEngine::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTENGINE_CONSTRUCTL);
-	    }
+	LOG_FUNC
 	TInt menuSelection(0);
 
 	// Display information 
 	test.Title();
 	test.Start(_L("Test Engine Initiation v2.00 "));
 	test.Printf(_L(">>\n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP01, ">>\n");
 	test.Printf(_L(">>   T E S T   R U N \n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP02, ">>   T E S T   R U N \n");
 	test.Printf(_L(">>\n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP03, ">>\n");
 	
 
 	// Process the command line parameters for batch/etc
@@ -144,9 +131,7 @@
 		iTestCasesIdentities.ResetAndDestroy();
 		
 		test.Printf(_L("Please select 0 to %d\n"), RTestFactory::TestCaseCount()-1);
-		OstTrace1(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP04, "Please select 0 to %d\n", RTestFactory::TestCaseCount()-1);
 		test.Printf(_L("or 99<ENTER> to exit\n"));
-		OstTrace0(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP05, "or 99<ENTER> to exit\n");
 		GetNumericInput(menuSelection);
 		if ((menuSelection >=0) &&(menuSelection < RTestFactory::TestCaseCount()))
 			{
@@ -168,7 +153,6 @@
 		{
 		// Create the test case controller
 		test.Printf(_L("Creating the test controller\n"));
-		OstTrace0(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP06, "Creating the test controller\n");
 		iTestCaseController = CTestCaseController::NewL(*this, ETrue);
 		
 		// Test-engine is non CActive class
@@ -177,7 +161,6 @@
 		{
 		// nothing to do, exit. USER aborted
 		test.Printf(_L("Test run stopped by user, nothing to do.\n"));
-		OstTrace0(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP07, "Test run stopped by user, nothing to do.\n");
 		User::Leave(-2);
 		}
 	}
@@ -188,31 +171,18 @@
 void CTestEngine::PrintUsage()
 	{
 	test.Printf(_L("OTGDI Unit Test Suite.\n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE, "OTGDI Unit Test Suite.\n");
 	test.Printf(_L("Usage : t_otgdi.exe [/option] /G:<TESTNUM1>\n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP01, "Usage : t_otgdi.exe [/option] /G:<TESTNUM1>\n");
 	test.Printf(_L("  /ALL = add default test subset to List\n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP02, "  /ALL = add default test subset to List\n");
 	test.Printf(_L("  /G:<TESTNUM>  where <testname> is the test# to add \n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP03, "  /G:<TESTNUM>  where <testname> is the test# to add \n");
 	test.Printf(_L("  /AUTO  = largely unattended operation\n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP04, "  /AUTO  = largely unattended operation\n");
 	test.Printf(_L("  /VERBOSE = test debugging info\n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP05, "  /VERBOSE = test debugging info\n");
 	test.Printf(_L("  /LOOPO:<n> = Open/close repeat counter<n>\n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP06, "  /LOOPO:<n> = Open/close repeat counter<n>\n");
 	test.Printf(_L("  /LOOPM:<n> = OOM HEAP_ALLOCS counter<n>\n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP07, "  /LOOPM:<n> = OOM HEAP_ALLOCS counter<n>\n");
 	test.Printf(_L("  /SLAVE = Test-peer server mode\n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP08, "  /SLAVE = Test-peer server mode\n");
 	test.Printf(_L("  /PID:<n> = USB VID/PID in hex eg 2670\n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP09, "  /PID:<n> = USB VID/PID in hex eg 2670\n");
 	test.Printf(_L("Valid test ID range 0456...0469\n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP10, "Valid test ID range 0456...0469\n");
 	test.Printf(_L("and 0675...0684 .\n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP11, "and 0675...0684 .\n");
 	test.Printf(_L("\n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_PRINTUSAGE_DUP12, "\n");
 	}
 	
 /** process the command-line, ; arguments appear in any order
@@ -268,7 +238,6 @@
 			{
 			// skip some of the press-any key things
 			test.Printf(_L("Test semi-automated mode.\n"));
-			OstTrace0(TRACE_NORMAL, CTESTENGINE_PROCESSCOMMANDLINEL, "Test semi-automated mode.\n");
 			gSemiAutomated = ETrue;
 			tokenParsed = ETrue;
 			}
@@ -281,10 +250,6 @@
 			TPtrC testID = tc->Right(tc->Length() - pos - KArgGoTestCase().Length());
 
 			LOG_VERBOSE2(_L("Parameter found:'%S'\n"), &testID);
-			if(gVerboseOutput)
-			    {
-			    OstTraceExt1(TRACE_VERBOSE, CTESTENGINE_PROCESSCOMMANDLINEL_DUP01, "Parameter found:'%S'\n", testID);
-			    }
 
 			// Check if it is a test we know of in our suite, users may provide the full  
 			// name "PBASE-USB_OTGDI-0466", or just the last 4 digits "0466", in such cases, fetch the full name
@@ -298,7 +263,6 @@
 					{
 					
 					test.Printf(_L("Test case does NOT Exist: '%lS'\n"), &testID);
-					OstTraceExt1(TRACE_NORMAL, CTESTENGINE_PROCESSCOMMANDLINEL_DUP02, "Test case does NOT Exist: '%lS'\n", testID);
 					}
 				else
 					{ // only the number was supplied, copy the full name
@@ -311,7 +275,6 @@
 				HBufC* testIdentity = HBufC::NewLC(KTestCaseIdLength);
 				*testIdentity = testID;
 				test.Printf(_L("Test case specified: %lS\n"), testIdentity);
-				OstTraceExt1(TRACE_NORMAL, CTESTENGINE_PROCESSCOMMANDLINEL_DUP03, "Test case specified: %lS\n", *testIdentity);
 
 				iTestCasesIdentities.Append(testIdentity);
 				CleanupStack::Pop(testIdentity);
@@ -369,17 +332,12 @@
 					prodID = 0xFFFF;
 				tokenParsed = ETrue;
 				LOG_VERBOSE2(_L(" accept param %04X \n\n"), prodID);
-				if(gVerboseOutput)
-				    {
-				    OstTrace1(TRACE_VERBOSE, CTESTENGINE_PROCESSCOMMANDLINEL_DUP05, " accept param %04X \n\n", prodID);
-				    }
 				gUSBVidPid = prodID; // replace the vid-pid with the user-supplied one 
 				}
 			else
 				{
 				// print error
 				test.Printf(_L("Warning: VID+PID '%lS' not parsed .\n"), tc);
-				OstTraceExt1(TRACE_NORMAL, CTESTENGINE_PROCESSCOMMANDLINEL_DUP06, "Warning: VID+PID '%lS' not parsed .\n", *tc);
 				}
 			}
 		
@@ -402,7 +360,6 @@
 			{
 			// warn about unparsed parameter
 			test.Printf(_L("Warning: '%lS'??? not parsed\n"), tc);
-			OstTraceExt1(TRACE_NORMAL, CTESTENGINE_PROCESSCOMMANDLINEL_DUP07, "Warning: '%lS'??? not parsed\n", *tc);
 			iHelpRequested = ETrue;
 			}
 			
@@ -419,7 +376,6 @@
 void CTestEngine::AddAllDefaultTests()
 	{
 	test.Printf(_L("Adding default set test cases\n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_ADDALLDEFAULTTESTS, "Adding default set test cases\n");
 	//
 	TInt index(0);
 	while (index < sizeof(KAllDefaultTestIDs)/sizeof(KAllDefaultTestIDs[0]))
@@ -474,7 +430,6 @@
 		if ( ( key >= '0' ) && ( key <= '9' ) )
 			{
 			test.Printf(_L("%c"),key);
-			OstTraceExt1(TRACE_NORMAL, CTESTENGINE_GETNUMERICINPUT, "%c",key);
 			
 			value = ( 10 * value ) + ( key - '0' );
 			digits++;
@@ -485,7 +440,6 @@
 				value = value/10;
 				digits--;
 				test.Printf(_L("\r    \r%d"), value);
-				OstTrace1(TRACE_NORMAL, CTESTENGINE_GETNUMERICINPUT_DUP01, "\r    \r%d", value);
 				}
 			}
 		}
@@ -495,7 +449,6 @@
 		aNumber = value;
 		}
 	test.Printf(_L("\n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_GETNUMERICINPUT_DUP02, "\n");
 	}
 
 
@@ -505,25 +458,19 @@
 	{
 	TBuf<KTestCaseIdLength> aTestCaseId;
 	test.Printf(_L("============================\n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_REPORT, "============================\n");
 	test.Printf(_L("PASSED TESTS:\n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_REPORT_DUP01, "PASSED TESTS:\n");
 	// itterate our list of tests to perform
 	ResetTestCaseIndex();
 	while (KErrNone == NextTestCaseId(aTestCaseId))
 		{
 		test.Printf(_L("%S\n"), &aTestCaseId);
-		OstTraceExt1(TRACE_NORMAL, CTESTENGINE_REPORT_DUP02, "%S\n", aTestCaseId);
 		}
 	}
 	
 	
 void CTestEngine::DoCancel()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CTESTENGINE_DOCANCEL);
-	    }
+	LOG_FUNC
 	test.Console()->ReadCancel();	
 	}
 		
--- a/kerneltest/e32test/usbho/t_otgdi/src/testpolicy.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_otgdi/src/testpolicy.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -26,10 +26,6 @@
 #include "testcaseroot.h"
 #include "testpolicy.h"
 #include "testcasefactory.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testpolicyTraces.h"
-#endif
 
 
 
@@ -53,10 +49,7 @@
 		
 void CBasicTestPolicy::ConstructL()
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CBASICTESTPOLICY_CONSTRUCTL);
-	    }
+	LOG_FUNC
 
 	}
 	
@@ -77,10 +70,7 @@
  */
 void CBasicTestPolicy::RunTestCaseL(const TDesC& aTestCaseId, TRequestStatus* aNotifierStatus)
 	{
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CBASICTESTPOLICY_RUNTESTCASEL);
-	    }
+	LOG_FUNC
 	iNotifierStatus = aNotifierStatus;
 	// delete previous test run
 	if (iTestCase)
@@ -132,10 +122,7 @@
 	
 void CBasicTestPolicy::RunL()
 	{ 
-	if(gVerboseOutput)
-	    {
-	    OstTraceFunctionEntry0(CBASICTESTPOLICY_RUNL);
-	    }
+	LOG_FUNC
 	
 	}
 
--- a/kerneltest/e32test/usbho/t_otgdi/traces_t_otgdi/OstTraceDefinitions.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-// 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:
-// 
-//
-
-
-#ifndef __OSTTRACEDEFINITIONS_H__
-#define __OSTTRACEDEFINITIONS_H__
-// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
-// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
-//#define OST_TRACE_COMPILER_IN_USE
-#include <opensystemtrace.h>
-#endif
--- a/kerneltest/e32test/usbho/t_otgdi/traces_t_otgdi/fixed_id.definitions	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,747 +0,0 @@
-#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
-[GROUP]TRACE_FLOW=0x8a
-[GROUP]TRACE_NORMAL=0x86
-[GROUP]TRACE_VERBOSE=0xde
-[GROUP]TRACE_WARNING=0x83
-[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_CONSTRUCTL=0xf2
-[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_RUNL=0xf4
-[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_RUNTESTCASEL=0xf3
-[TRACE]TRACE_FLOW[0x8A]_CNOTIFYCOLLECTOR_CNOTIFYCOLLECTOR=0x1
-[TRACE]TRACE_FLOW[0x8A]_CNOTIFYCOLLECTOR_COMPLETESTEP_DUP01=0x5
-[TRACE]TRACE_FLOW[0x8A]_CNOTIFYCOLLECTOR_CREATEOBSERVERSL=0x3
-[TRACE]TRACE_FLOW[0x8A]_CNOTIFYCOLLECTOR_DCNOTIFYCOLLECTOR=0x2
-[TRACE]TRACE_FLOW[0x8A]_CNOTIFYCOLLECTOR_DESTROYOBSERVERS=0x4
-[TRACE]TRACE_FLOW[0x8A]_COTGMESSAGEWATCHER_NEWL=0x9
-[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGACTIVATEOPTTESTMODE=0xe
-[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGBUSCLEARERROR=0x14
-[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGBUSDROP=0x13
-[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGBUSREQUEST=0x11
-[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGBUSRESPONDSRP=0x12
-[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGCANCELOTGIDPINNOTIFICATION=0x16
-[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGCANCELOTGVBUSNOTIFICATION=0x18
-[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGCLOSE=0xd
-[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGIDPINPRESENT=0x19
-[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGLOADLDD=0xb
-[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGOPEN=0xc
-[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGQUEUEOTGIDPINNOTIFICATION=0x15
-[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGQUEUEOTGVBUSNOTIFICATION=0x17
-[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGSTARTSTACKS=0xf
-[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGSTOPSTACKS=0x10
-[TRACE]TRACE_FLOW[0x8A]_COTGROOT_OTGVBUSPRESENT=0x1a
-[TRACE]TRACE_FLOW[0x8A]_COTGSTATEWATCHER_NEWL=0xa
-[TRACE]TRACE_FLOW[0x8A]_COTGWATCHDOGWATCHER_CONSTRUCTL=0x6
-[TRACE]TRACE_FLOW[0x8A]_COTGWATCHDOGWATCHER_STARTTIMER=0x8
-[TRACE]TRACE_FLOW[0x8A]_COTGWATCHDOGWATCHER_STEPEXPIRED=0x7
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0456_CONSTRUCTL=0x1f
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0456_CTESTCASE0456=0x1e
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0456_DCTESTCASE0456=0x20
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0456_DOCANCEL=0x22
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0456_EXECUTETESTCASEL=0x21
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0456_NEWL=0x1d
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0456_RUNSTEPL=0x23
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0457_CONSTRUCTL=0x26
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0457_CTESTCASE0457=0x25
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0457_DCTESTCASE0457=0x27
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0457_DOCANCEL=0x29
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0457_EXECUTETESTCASEL=0x28
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0457_NEWL=0x24
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0457_RUNSTEPL=0x2a
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0458_CONSTRUCTL=0x2b
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0458_DCTESTCASE0458=0x2c
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0458_DOCANCEL=0x2e
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0458_EXECUTETESTCASEL=0x2d
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0458_RUNSTEPL=0x2f
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0459_CONSTRUCTL=0x32
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0459_CTESTCASE0459=0x31
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0459_DCTESTCASE0459=0x33
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0459_DOCANCEL=0x35
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0459_EXECUTETESTCASEL=0x34
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0459_NEWL=0x30
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0459_RUNSTEPL=0x36
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0460_CONSTRUCTL=0x39
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0460_CTESTCASE0460=0x38
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0460_DCTESTCASE0460=0x3a
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0460_DOCANCEL=0x3c
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0460_EXECUTETESTCASEL=0x3b
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0460_NEWL=0x37
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0460_RUNSTEPL=0x3d
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0461_CONSTRUCTL=0x40
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0461_CTESTCASE0461=0x3f
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0461_DCTESTCASE0461=0x41
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0461_DOCANCEL=0x43
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0461_EXECUTETESTCASEL=0x42
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0461_NEWL=0x3e
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0461_RUNSTEPL=0x44
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0462_CONSTRUCTL=0x47
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0462_CTESTCASE0462=0x46
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0462_DCTESTCASE0462=0x48
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0462_DOCANCEL=0x4a
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0462_EXECUTETESTCASEL=0x49
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0462_NEWL=0x45
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0462_RUNSTEPL=0x4b
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0463_CONSTRUCTL=0x4e
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0463_CTESTCASE0463=0x4d
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0463_DCTESTCASE0463=0x4f
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0463_DOCANCEL=0x51
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0463_EXECUTETESTCASEL=0x50
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0463_NEWL=0x4c
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0463_RUNSTEPL=0x52
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0464_CONSTRUCTL=0x55
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0464_CTESTCASE0464=0x54
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0464_DCTESTCASE0464=0x56
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0464_DOCANCEL=0x58
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0464_EXECUTETESTCASEL=0x57
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0464_NEWL=0x53
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0464_RUNSTEPL=0x59
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0465_CONSTRUCTL=0x5c
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0465_CTESTCASE0465=0x5b
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0465_DCTESTCASE0465=0x5d
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0465_DOCANCEL=0x5f
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0465_EXECUTETESTCASEL=0x5e
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0465_NEWL=0x5a
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0465_RUNSTEPL=0x60
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0466_CONSTRUCTL=0x63
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0466_CTESTCASE0466=0x62
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0466_DCTESTCASE0466=0x64
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0466_DOCANCEL=0x66
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0466_EXECUTETESTCASEL=0x65
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0466_NEWL=0x61
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0466_RUNSTEPL=0x67
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0467_CANCELIDPIN=0x6e
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0467_CONSTRUCTL=0x6a
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0467_CTESTCASE0467=0x69
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0467_DCTESTCASE0467=0x6b
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0467_DOCANCEL=0x6d
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0467_EXECUTETESTCASEL=0x6c
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0467_NEWL=0x68
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0467_RUNSTEPL=0x6f
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0468_CANCELKB=0x76
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0468_CANCELNOTIFY=0x77
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0468_CONSTRUCTL=0x72
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0468_CTESTCASE0468=0x71
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0468_DCTESTCASE0468=0x73
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0468_DOCANCEL=0x75
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0468_EXECUTETESTCASEL=0x74
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0468_NEWL=0x70
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0468_RUNSTEPL=0x78
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0469_CONSTRUCTL=0x7b
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0469_CTESTCASE0469=0x7a
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0469_DCTESTCASE0469=0x7c
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0469_DOCANCEL=0x7e
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0469_EXECUTETESTCASEL=0x7d
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0469_NEWL=0x79
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0469_RUNSTEPL=0x7f
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0670_CTESTCASE0670=0x81
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0670_DOCANCEL=0x82
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0670_NEWL=0x80
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0670_RUNSTEPL=0x83
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0671_CTESTCASE0671=0x85
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0671_DOCANCEL=0x86
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0671_NEWL=0x84
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0671_RUNSTEPL=0x87
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0675_CANCELKB=0x8e
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0675_CANCELNOTIFY=0x8f
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0675_CONSTRUCTL=0x8a
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0675_CTESTCASE0675=0x89
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0675_DCTESTCASE0675=0x8b
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0675_DOCANCEL=0x8d
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0675_EXECUTETESTCASEL=0x8c
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0675_NEWL=0x88
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0675_RUNSTEPL=0x90
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0676_CANCELKB=0x97
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0676_CANCELNOTIFY=0x98
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0676_CONSTRUCTL=0x93
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0676_CTESTCASE0676=0x92
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0676_DCTESTCASE0676=0x94
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0676_DOCANCEL=0x96
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0676_EXECUTETESTCASEL=0x95
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0676_NEWL=0x91
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0676_RUNSTEPL=0x99
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0677_CANCELKB=0xa0
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0677_CANCELNOTIFY=0xa1
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0677_CONSTRUCTL=0x9c
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0677_CTESTCASE0677=0x9b
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0677_DCTESTCASE0677=0x9d
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0677_DOCANCEL=0x9f
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0677_EXECUTETESTCASEL=0x9e
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0677_NEWL=0x9a
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0677_RUNSTEPL=0xa2
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0678_CONSTRUCTL=0xa5
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0678_CTESTCASE0678=0xa4
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0678_DCTESTCASE0678=0xa6
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0678_DOCANCEL=0xa8
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0678_EXECUTETESTCASEL=0xa7
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0678_NEWL=0xa3
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0678_RUNSTEPL=0xa9
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0679_CONSTRUCTL=0xac
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0679_CTESTCASE0679=0xab
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0679_DCTESTCASE0679=0xad
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0679_DOCANCEL=0xaf
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0679_EXECUTETESTCASEL=0xae
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0679_NEWL=0xaa
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0679_RUNSTEPL=0xb0
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0680_CONSTRUCTL=0xb3
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0680_CTESTCASE0680=0xb2
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0680_DCTESTCASE0680=0xb4
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0680_DOCANCEL=0xb6
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0680_EXECUTETESTCASEL=0xb5
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0680_NEWL=0xb1
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0680_RUNSTEPL=0xb7
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0681_CONSTRUCTL=0xba
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0681_CTESTCASE0681=0xb9
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0681_DCTESTCASE0681=0xbb
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0681_DOCANCEL=0xbd
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0681_EXECUTETESTCASEL=0xbc
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0681_NEWL=0xb8
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0681_RUNSTEPL=0xbe
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0682_CONSTRUCTL=0xc1
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0682_CTESTCASE0682=0xc0
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0682_DCTESTCASE0682=0xc2
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0682_DOCANCEL=0xc4
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0682_EXECUTETESTCASEL=0xc3
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0682_NEWL=0xbf
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0682_RUNSTEPL=0xc5
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0683_CONSTRUCTL=0xc8
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0683_CTESTCASE0683=0xc7
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0683_DCTESTCASE0683=0xc9
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0683_DOCANCEL=0xcb
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0683_EXECUTETESTCASEL=0xca
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0683_NEWL=0xc6
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0683_RUNSTEPL=0xcc
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0684_CONSTRUCTL=0xcf
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0684_CTESTCASE0684=0xce
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0684_DCTESTCASE0684=0xd0
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0684_DOCANCEL=0xd2
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0684_EXECUTETESTCASEL=0xd1
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0684_NEWL=0xcd
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE0684_RUNSTEPL=0xd3
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE1233_CONSTRUCTL=0xd6
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE1233_CTESTCASE1233=0xd5
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE1233_DCTESTCASE1233=0xd7
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE1233_DOCANCEL=0xd9
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE1233_EXECUTETESTCASEL=0xd8
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE1233_NEWL=0xd4
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASE1233_RUNSTEPL=0xda
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASEB2BROOT_CTESTCASEB2BROOT=0xea
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASEB2BROOT_DCTESTCASEB2BROOT=0xeb
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASEB2BROOT_POSTRUNSTEP=0xed
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASEB2BROOT_PRERUNSTEP=0xec
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_RUNERROR=0xdb
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASEROOT_BASECONSTRUCTL=0xdf
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASEROOT_DCTESTCASEROOT=0xe0
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASEROOT_DISPLAYTESTCASEOPTIONS=0xe1
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASEROOT_DOCANCEL=0xe2
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASEROOT_PROCESSENGINEKEY=0xe3
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASEROOT_REQUESTCHARACTER=0xe4
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASEROOT_RUNERROR=0xe6
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASEROOT_RUNL=0xe5
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASEROOT_TESTFAILED=0xe7
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASEROOT_TESTFAILED2=0xe8
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASEROOT_TESTPASSED=0xe9
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASEWATCHDOG_RUNL=0xee
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_CONSTRUCTL=0xf0
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_DCTESTENGINE=0xef
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_DOCANCEL=0xf1
-[TRACE]TRACE_FLOW[0x8A]_E32MAIN_E32MAIN=0x1c
-[TRACE]TRACE_FLOW[0x8A]_MAINL_MAINL=0x1b
-[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_CREATETESTCASEL=0xde
-[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_GETTESTID=0xdc
-[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_LISTREGISTEREDTESTCASES=0xdd
-[TRACE]TRACE_NORMAL[0x86]_CACONNECTIONIDLEWATCHER_DISPLAYEVENT=0xa
-[TRACE]TRACE_NORMAL[0x86]_CNOTIFYCOLLECTOR_COMPLETESTEP=0x5
-[TRACE]TRACE_NORMAL[0x86]_CNOTIFYCOLLECTOR_CREATEOBSERVERSL_DUP02=0x1
-[TRACE]TRACE_NORMAL[0x86]_CNOTIFYCOLLECTOR_HANDLEEVENT=0x2
-[TRACE]TRACE_NORMAL[0x86]_CNOTIFYCOLLECTOR_HANDLEEVENT_DUP01=0x3
-[TRACE]TRACE_NORMAL[0x86]_CNOTIFYCOLLECTOR_HANDLEEVENT_DUP04=0x4
-[TRACE]TRACE_NORMAL[0x86]_COTGEVENTWATCHER_DISPLAYEVENT=0x8
-[TRACE]TRACE_NORMAL[0x86]_COTGMESSAGEWATCHER_DISPLAYEVENT=0x6
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_OTGACTIVATEFDFACTOR=0xe
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_OTGACTIVATEFDFACTOR_DUP01=0xf
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_OTGACTIVATEFDFACTOR_DUP02=0x10
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_OTGACTIVATEFDFACTOR_DUP03=0x11
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_OTGACTIVATEFDFACTOR_DUP04=0x12
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_OTGACTIVATEFDFACTOR_DUP05=0x13
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_OTGCLOSE_DUP01=0xd
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_OTGDEACTIVATEFDFACTOR=0x14
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_OTGDEACTIVATEFDFACTOR_DUP01=0x15
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_OTGLOADLDD_DUP02=0xb
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_OTGOPEN_DUP02=0xc
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPCHANGEVIDPID=0x24
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPCHANGEVIDPID_DUP01=0x25
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPCHANGEVIDPID_DUP02=0x26
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPCONNECT=0x23
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPDISCONNECT=0x22
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPLOADCLIENT=0x19
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPLOADCLIENT_DUP01=0x1a
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPLOADCLIENT_DUP02=0x1b
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPLOADCLIENT_DUP03=0x1c
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPLOADCLIENT_DUP04=0x1d
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPLOADCLIENT_DUP05=0x1e
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPLOADCLIENT_DUP06=0x1f
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPLOADCLIENT_DUP07=0x20
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPLOADCLIENT_DUP08=0x21
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPLOADLDD_DUP02=0x28
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPLOADLDD_DUP03=0x29
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPUNLOADCLIENT=0x16
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPUNLOADCLIENT_DUP01=0x17
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPUNLOADCLIENT_DUP02=0x18
-[TRACE]TRACE_NORMAL[0x86]_COTGROOT_STEPUNLOADLDD=0x27
-[TRACE]TRACE_NORMAL[0x86]_COTGSTATEWATCHER_DISPLAYEVENT_DUP01=0x7
-[TRACE]TRACE_NORMAL[0x86]_CPERIPHERALSTATEWATCHER_DISPLAYEVENT=0x9
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0456_DESCRIBEPRECONDITIONS=0x3e
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0456_RUNSTEPL_DUP01=0x3f
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0456_RUNSTEPL_DUP02=0x40
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0456_RUNSTEPL_DUP03=0x41
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0456_RUNSTEPL_DUP04=0x42
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0457_DESCRIBEPRECONDITIONS=0x43
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0457_RUNSTEPL_DUP01=0x44
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0457_RUNSTEPL_DUP02=0x45
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0457_RUNSTEPL_DUP03=0x46
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0457_RUNSTEPL_DUP04=0x47
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0458_DESCRIBEPRECONDITIONS=0x48
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0458_DESCRIBEPRECONDITIONS_DUP01=0x49
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0458_RUNSTEPL_DUP01=0x4a
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0458_RUNSTEPL_DUP02=0x4b
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0458_RUNSTEPL_DUP03=0x4c
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0458_RUNSTEPL_DUP04=0x4d
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0459_DESCRIBEPRECONDITIONS=0x4e
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0459_RUNSTEPL_DUP01=0x4f
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0459_RUNSTEPL_DUP02=0x50
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0459_RUNSTEPL_DUP03=0x51
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0459_RUNSTEPL_DUP04=0x52
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0459_RUNSTEPL_DUP05=0x53
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0459_RUNSTEPL_DUP06=0x54
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0459_RUNSTEPL_DUP07=0x55
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0460_DESCRIBEPRECONDITIONS=0x56
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0460_RUNSTEPL_DUP01=0x57
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0460_RUNSTEPL_DUP02=0x58
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0460_RUNSTEPL_DUP03=0x59
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0460_RUNSTEPL_DUP04=0x5a
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0460_RUNSTEPL_DUP05=0x5b
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0460_RUNSTEPL_DUP06=0x5c
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0460_RUNSTEPL_DUP07=0x5d
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0461_DESCRIBEPRECONDITIONS=0x5e
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0461_RUNSTEPL_DUP01=0x5f
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0461_RUNSTEPL_DUP02=0x60
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0461_RUNSTEPL_DUP03=0x61
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0461_RUNSTEPL_DUP04=0x62
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0461_RUNSTEPL_DUP05=0x63
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0461_RUNSTEPL_DUP06=0x64
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0461_RUNSTEPL_DUP07=0x65
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0461_RUNSTEPL_DUP08=0x66
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0461_RUNSTEPL_DUP09=0x67
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0462_DESCRIBEPRECONDITIONS=0x68
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0462_RUNSTEPL_DUP01=0x69
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0462_RUNSTEPL_DUP02=0x6a
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0462_RUNSTEPL_DUP03=0x6b
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0462_RUNSTEPL_DUP04=0x6c
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0462_RUNSTEPL_DUP05=0x6d
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0462_RUNSTEPL_DUP06=0x6e
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0462_RUNSTEPL_DUP07=0x6f
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0462_RUNSTEPL_DUP08=0x70
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0462_RUNSTEPL_DUP09=0x71
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0463_DESCRIBEPRECONDITIONS=0x72
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0463_RUNSTEPL_DUP01=0x73
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0463_RUNSTEPL_DUP03=0x74
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0463_RUNSTEPL_DUP04=0x75
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0463_RUNSTEPL_DUP05=0x76
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0464_DESCRIBEPRECONDITIONS=0x77
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0464_RUNSTEPL_DUP01=0x78
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0464_RUNSTEPL_DUP02=0x79
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0464_RUNSTEPL_DUP05=0x7a
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0464_RUNSTEPL_DUP07=0x7b
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0464_RUNSTEPL_DUP08=0x7c
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_DESCRIBEPRECONDITIONS=0x7d
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP01=0x7e
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP02=0x7f
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP03=0x80
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP04=0x81
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP05=0x82
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP06=0x83
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP07=0x84
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_DESCRIBEPRECONDITIONS_DUP08=0x85
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP01=0x86
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP02=0x87
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP03=0x88
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP04=0x89
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP05=0x8a
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP06=0x8b
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP07=0x8c
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP08=0x8d
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP09=0x8e
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP10=0x8f
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP11=0x90
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP12=0x91
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP13=0x92
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP14=0x93
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP15=0x94
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0465_RUNSTEPL_DUP16=0x95
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS=0x96
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP01=0x97
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP02=0x98
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP03=0x99
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP04=0x9a
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP05=0x9b
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP06=0x9c
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP07=0x9d
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP08=0x9e
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP09=0x9f
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP10=0xa0
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_DESCRIBEPRECONDITIONS_DUP11=0xa1
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP01=0xa2
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP02=0xa3
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP03=0xa4
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP04=0xa5
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP05=0xa6
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP06=0xa7
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP07=0xa8
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP08=0xa9
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP09=0xaa
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP10=0xab
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP11=0xac
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP12=0xad
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP13=0xae
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP14=0xaf
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP15=0xb0
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP16=0xb1
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP17=0xb2
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP18=0xb3
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP19=0xb4
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0466_RUNSTEPL_DUP20=0xb5
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0467_DESCRIBEPRECONDITIONS=0xb6
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0467_DESCRIBEPRECONDITIONS_DUP01=0xb7
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0467_RUNSTEPL_DUP01=0xb8
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0467_RUNSTEPL_DUP02=0xb9
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0467_RUNSTEPL_DUP03=0xba
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0467_RUNSTEPL_DUP04=0xbb
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0467_RUNSTEPL_DUP06=0xbc
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0467_RUNSTEPL_DUP08=0xbd
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0467_RUNSTEPL_DUP09=0xbe
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0467_RUNSTEPL_DUP10=0xbf
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0468_DESCRIBEPRECONDITIONS=0xc0
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0468_DESCRIBEPRECONDITIONS_DUP01=0xc1
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0468_RUNSTEPL_DUP01=0xc2
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0468_RUNSTEPL_DUP02=0xc3
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0468_RUNSTEPL_DUP03=0xc4
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0468_RUNSTEPL_DUP04=0xc5
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0468_RUNSTEPL_DUP05=0xc6
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0468_RUNSTEPL_DUP06=0xc7
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0468_RUNSTEPL_DUP08=0xc8
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0469_RUNSTEPL_DUP01=0xc9
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0469_RUNSTEPL_DUP02=0xca
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0469_RUNSTEPL_DUP03=0xcb
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0469_RUNSTEPL_DUP04=0xcc
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0469_RUNSTEPL_DUP05=0xcd
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0469_RUNSTEPL_DUP06=0xce
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0469_RUNSTEPL_DUP07=0xcf
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0469_RUNSTEPL_DUP08=0xd0
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0469_RUNSTEPL_DUP09=0xd1
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0469_RUNSTEPL_DUP10=0xd2
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0469_RUNSTEPL_DUP11=0xd3
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_DESCRIBEPRECONDITIONS=0xd4
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP01=0xd5
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP02=0xd6
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP03=0xd7
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP04=0xd8
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP05=0xd9
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP06=0xda
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_RUNSTEPL_DUP01=0xdb
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_RUNSTEPL_DUP02=0xdc
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_RUNSTEPL_DUP03=0xdd
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_RUNSTEPL_DUP04=0xde
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_RUNSTEPL_DUP05=0xdf
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_RUNSTEPL_DUP06=0xe0
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_RUNSTEPL_DUP07=0xe1
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_RUNSTEPL_DUP08=0xe2
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_RUNSTEPL_DUP09=0xe3
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_RUNSTEPL_DUP10=0xe4
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0670_RUNSTEPL_DUP11=0xe5
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_DESCRIBEPRECONDITIONS=0xe6
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP01=0xe7
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP02=0xe8
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP03=0xe9
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP04=0xea
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP05=0xeb
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_DESCRIBEPRECONDITIONS_DUP06=0xec
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_RUNSTEPL_DUP01=0xed
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_RUNSTEPL_DUP02=0xee
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_RUNSTEPL_DUP03=0xef
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_RUNSTEPL_DUP04=0xf0
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_RUNSTEPL_DUP05=0xf1
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_RUNSTEPL_DUP06=0xf2
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_RUNSTEPL_DUP07=0xf3
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_RUNSTEPL_DUP08=0xf4
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_RUNSTEPL_DUP09=0xf5
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_RUNSTEPL_DUP10=0xf6
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0671_RUNSTEPL_DUP11=0xf7
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0675_DESCRIBEPRECONDITIONS=0xf8
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0675_RUNSTEPL_DUP01=0xf9
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0675_RUNSTEPL_DUP02=0xfa
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0675_RUNSTEPL_DUP03=0xfb
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0675_RUNSTEPL_DUP04=0xfc
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0675_RUNSTEPL_DUP05=0xfd
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0675_RUNSTEPL_DUP06=0xfe
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0675_RUNSTEPL_DUP07=0xff
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0675_RUNSTEPL_DUP08=0x100
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0676_DESCRIBEPRECONDITIONS=0x101
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0676_RUNSTEPL_DUP01=0x102
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0676_RUNSTEPL_DUP02=0x103
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0676_RUNSTEPL_DUP03=0x104
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0676_RUNSTEPL_DUP04=0x105
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0676_RUNSTEPL_DUP05=0x106
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0676_RUNSTEPL_DUP06=0x107
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0676_RUNSTEPL_DUP07=0x108
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_DESCRIBEPRECONDITIONS=0x109
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_DESCRIBEPRECONDITIONS_DUP01=0x10a
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_DESCRIBEPRECONDITIONS_DUP02=0x10b
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_DESCRIBEPRECONDITIONS_DUP03=0x10c
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP01=0x10d
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP02=0x10e
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP03=0x10f
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP04=0x110
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP05=0x111
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP06=0x112
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP08=0x113
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP09=0x114
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP10=0x115
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP12=0x116
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP13=0x117
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP14=0x118
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0677_RUNSTEPL_DUP15=0x119
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0678_RUNSTEPL_DUP01=0x11a
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0678_RUNSTEPL_DUP02=0x11b
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0678_RUNSTEPL_DUP03=0x11c
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0678_RUNSTEPL_DUP04=0x11d
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0678_RUNSTEPL_DUP05=0x11e
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0678_RUNSTEPL_DUP06=0x11f
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0678_RUNSTEPL_DUP07=0x120
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0678_RUNSTEPL_DUP08=0x121
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0678_RUNSTEPL_DUP09=0x122
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0679_RUNSTEPL_DUP01=0x123
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0679_RUNSTEPL_DUP02=0x124
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0679_RUNSTEPL_DUP03=0x125
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0679_RUNSTEPL_DUP04=0x126
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0679_RUNSTEPL_DUP05=0x127
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0679_RUNSTEPL_DUP06=0x128
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0679_RUNSTEPL_DUP07=0x129
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0679_RUNSTEPL_DUP08=0x12a
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0680_RUNSTEPL_DUP01=0x12b
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0680_RUNSTEPL_DUP02=0x12c
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0680_RUNSTEPL_DUP03=0x12d
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0680_RUNSTEPL_DUP04=0x12e
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0680_RUNSTEPL_DUP05=0x12f
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0680_RUNSTEPL_DUP06=0x130
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0680_RUNSTEPL_DUP07=0x131
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0680_RUNSTEPL_DUP08=0x132
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_RUNSTEPL_DUP01=0x13b
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_RUNSTEPL_DUP02=0x13c
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_RUNSTEPL_DUP03=0x13d
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_RUNSTEPL_DUP04=0x13e
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_RUNSTEPL_DUP05=0x13f
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_RUNSTEPL_DUP06=0x140
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_RUNSTEPL_DUP07=0x141
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_RUNSTEPL_DUP08=0x142
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_RUNSTEPL_DUP09=0x143
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_RUNSTEPL_DUP10=0x144
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_RUNSTEPL_DUP11=0x145
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_STEPB2BPRECONDITIONS=0x133
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_STEPB2BPRECONDITIONS_DUP01=0x134
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_STEPB2BPRECONDITIONS_DUP02=0x135
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_STEPB2BPRECONDITIONS_DUP03=0x136
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_STEPB2BPRECONDITIONS_DUP04=0x137
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_STEPB2BPRECONDITIONS_DUP05=0x138
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_STEPB2BPRECONDITIONS_DUP06=0x139
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0681_STEPB2BPRECONDITIONS_DUP07=0x13a
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_RUNSTEPL_DUP01=0x14e
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_RUNSTEPL_DUP02=0x14f
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_RUNSTEPL_DUP03=0x150
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_RUNSTEPL_DUP04=0x151
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_RUNSTEPL_DUP05=0x152
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_RUNSTEPL_DUP06=0x153
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_RUNSTEPL_DUP07=0x154
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_RUNSTEPL_DUP08=0x155
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_RUNSTEPL_DUP09=0x156
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_RUNSTEPL_DUP10=0x157
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_STEPB2BPRECONDITIONS=0x146
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_STEPB2BPRECONDITIONS_DUP01=0x147
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_STEPB2BPRECONDITIONS_DUP02=0x148
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_STEPB2BPRECONDITIONS_DUP03=0x149
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_STEPB2BPRECONDITIONS_DUP04=0x14a
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_STEPB2BPRECONDITIONS_DUP05=0x14b
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_STEPB2BPRECONDITIONS_DUP06=0x14c
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0682_STEPB2BPRECONDITIONS_DUP07=0x14d
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0683_RUNSTEPL_DUP01=0x158
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0683_RUNSTEPL_DUP02=0x159
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0683_RUNSTEPL_DUP03=0x15a
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0683_RUNSTEPL_DUP04=0x15b
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0683_RUNSTEPL_DUP05=0x15c
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0683_RUNSTEPL_DUP06=0x15d
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0683_RUNSTEPL_DUP07=0x15e
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0683_RUNSTEPL_DUP08=0x15f
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0683_RUNSTEPL_DUP09=0x160
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0683_RUNSTEPL_DUP10=0x161
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0683_RUNSTEPL_DUP11=0x162
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP01=0x163
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP02=0x164
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP03=0x165
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP04=0x166
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP05=0x167
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP06=0x168
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP07=0x169
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP08=0x16a
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP09=0x16b
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP10=0x16c
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP11=0x16d
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP12=0x16e
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP13=0x16f
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP14=0x170
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP15=0x171
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE0684_RUNSTEPL_DUP16=0x172
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE1233_RUNSTEPL_DUP01=0x173
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE1233_RUNSTEPL_DUP02=0x174
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE1233_RUNSTEPL_DUP03=0x175
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE1233_RUNSTEPL_DUP04=0x176
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE1233_RUNSTEPL_DUP05=0x177
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE1233_RUNSTEPL_DUP06=0x178
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE1233_RUNSTEPL_DUP07=0x179
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASE1233_RUNSTEPL_DUP08=0x17a
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASEB2BROOT_CHECKROLECONNECTIONS=0x19c
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASEB2BROOT_CHECKROLECONNECTIONS_DUP01=0x19d
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASEB2BROOT_DESCRIBEPRECONDITIONS=0x196
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASEB2BROOT_DESCRIBEPRECONDITIONS_DUP01=0x197
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASEB2BROOT_DESCRIBEPRECONDITIONS_DUP02=0x198
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASEB2BROOT_PRINTSTEPNAME=0x194
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASEB2BROOT_PRINTSTEPNAME_DUP02=0x195
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASEB2BROOT_STEPB2BPRECONDITIONS=0x199
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASEB2BROOT_STEPB2BPRECONDITIONS_DUP01=0x19a
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASEB2BROOT_STEPB2BPRECONDITIONS_DUP02=0x19b
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL=0x17b
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP01=0x17c
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP02=0x17d
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP03=0x17e
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP04=0x17f
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP05=0x180
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASEROOT_BASECONSTRUCTL_DUP02=0x189
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASEROOT_DISPLAYTESTCASEOPTIONS_DUP01=0x18a
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASEROOT_PRINTSTEPNAME=0x192
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASEROOT_PRINTSTEPNAME_DUP01=0x193
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASEROOT_RUNERROR_DUP01=0x18b
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASEROOT_TESTFAILED2_DUP01=0x191
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASEROOT_TESTFAILED_DUP01=0x18c
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASEROOT_TESTFAILED_DUP02=0x18d
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASEROOT_TESTFAILED_DUP03=0x18e
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASEROOT_TESTFAILED_DUP04=0x18f
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASEROOT_TESTFAILED_DUP05=0x190
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASEWATCHDOG_ISVALID=0x19e
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_ADDALLDEFAULTTESTS=0x1b8
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP01=0x19f
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP02=0x1a0
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP03=0x1a1
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP04=0x1a2
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP05=0x1a3
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP06=0x1a4
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP07=0x1a5
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_GETNUMERICINPUT=0x1b9
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_GETNUMERICINPUT_DUP01=0x1ba
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_GETNUMERICINPUT_DUP02=0x1bb
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE=0x1a6
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP01=0x1a7
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP02=0x1a8
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP03=0x1a9
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP04=0x1aa
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP05=0x1ab
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP06=0x1ac
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP07=0x1ad
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP08=0x1ae
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP09=0x1af
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP10=0x1b0
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP11=0x1b1
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PRINTUSAGE_DUP12=0x1b2
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PROCESSCOMMANDLINEL=0x1b3
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PROCESSCOMMANDLINEL_DUP02=0x1b4
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PROCESSCOMMANDLINEL_DUP03=0x1b5
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PROCESSCOMMANDLINEL_DUP06=0x1b6
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_PROCESSCOMMANDLINEL_DUP07=0x1b7
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_REPORT=0x1bc
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_REPORT_DUP01=0x1bd
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_REPORT_DUP02=0x1be
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP01=0x3d
-[TRACE]TRACE_NORMAL[0x86]_MAINL_MAINL_DUP01=0x38
-[TRACE]TRACE_NORMAL[0x86]_MAINL_MAINL_DUP02=0x39
-[TRACE]TRACE_NORMAL[0x86]_MAINL_MAINL_DUP03=0x3a
-[TRACE]TRACE_NORMAL[0x86]_MAINL_MAINL_DUP04=0x3b
-[TRACE]TRACE_NORMAL[0x86]_MAINL_MAINL_DUP05=0x3c
-[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE=0x2a
-[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP01=0x2b
-[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP02=0x2c
-[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP03=0x2d
-[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP06=0x2e
-[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP07=0x2f
-[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP08=0x30
-[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP09=0x31
-[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP10=0x32
-[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP11=0x33
-[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP12=0x34
-[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP13=0x35
-[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP14=0x36
-[TRACE]TRACE_NORMAL[0x86]_PROTOTYPECODE_PROTOTYPECODE_DUP15=0x37
-[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_CREATETESTCASEL_DUP01=0x187
-[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_CREATETESTCASEL_DUP02=0x188
-[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_LISTREGISTEREDTESTCASES_DUP01=0x184
-[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_LISTREGISTEREDTESTCASES_DUP02=0x185
-[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_LISTREGISTEREDTESTCASES_DUP03=0x186
-[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_REGISTERTESTCASE_DUP01=0x181
-[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_REGISTERTESTCASE_DUP02=0x182
-[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_REGISTERTESTCASE_DUP03=0x183
-[TRACE]TRACE_VERBOSE[0xDE]_CNOTIFYCOLLECTOR_ADDREQUIREDORFAILURENOTIFICATION=0x2
-[TRACE]TRACE_VERBOSE[0xDE]_CNOTIFYCOLLECTOR_ADDREQUIREDORFAILURENOTIFICATION_DUP01=0x3
-[TRACE]TRACE_VERBOSE[0xDE]_CNOTIFYCOLLECTOR_ADDREQUIREDORFAILURENOTIFICATION_DUP02=0x4
-[TRACE]TRACE_VERBOSE[0xDE]_CNOTIFYCOLLECTOR_ADDREQUIREDORFAILURENOTIFICATION_DUP03=0x5
-[TRACE]TRACE_VERBOSE[0xDE]_CNOTIFYCOLLECTOR_ADDREQUIREDORFAILURENOTIFICATION_DUP04=0x6
-[TRACE]TRACE_VERBOSE[0xDE]_CNOTIFYCOLLECTOR_DESTROYOBSERVERS_DUP01=0x1
-[TRACE]TRACE_VERBOSE[0xDE]_CNOTIFYCOLLECTOR_HANDLEEVENT_DUP03=0x7
-[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGCANCELACONNECTIONIDLEREQUEST=0x14
-[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGCANCELOTGEVENTREQUEST=0xe
-[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGCANCELOTGMESSAGEREQUEST=0x10
-[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGCANCELOTGSTATEREQUEST=0x16
-[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGCANCELPERIPHERALSTATEREQUEST=0x12
-[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGIDPINPRESENT_DUP01=0x17
-[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGLOADLDD_DUP01=0x9
-[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGLOADLDD_DUP03=0xa
-[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGOPEN_DUP01=0xb
-[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGOPEN_DUP03=0xc
-[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGQUEUEACONNECTIONIDLEREQUEST=0x13
-[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGQUEUEOTGEVENTREQUEST_DUP01=0xd
-[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGQUEUEOTGMESSAGEREQUEST_DUP01=0xf
-[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGQUEUEOTGSTATEREQUEST_DUP01=0x15
-[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_OTGQUEUEPERIPHERALSTATEREQUEST=0x11
-[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_STEPLOADLDD=0x1a
-[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_STEPLOADLDD_DUP01=0x1b
-[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_STEPUNLOADLDD_DUP01=0x18
-[TRACE]TRACE_VERBOSE[0xDE]_COTGROOT_STEPUNLOADLDD_DUP02=0x19
-[TRACE]TRACE_VERBOSE[0xDE]_COTGWATCHDOGWATCHER_STARTTIMER_DUP01=0x8
-[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0464_RUNSTEPL_DUP03=0x1c
-[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0464_RUNSTEPL_DUP04=0x1d
-[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0464_RUNSTEPL_DUP06=0x1e
-[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0467_RUNSTEPL_DUP05=0x1f
-[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0467_RUNSTEPL_DUP07=0x20
-[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0468_CONTINUEAFTER=0x21
-[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0468_RUNSTEPL_DUP07=0x22
-[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0675_CONTINUEAFTER=0x23
-[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0676_CONTINUEAFTER=0x24
-[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0677_CONTINUEAFTER=0x25
-[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0677_RUNSTEPL_DUP07=0x26
-[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASE0677_RUNSTEPL_DUP11=0x27
-[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASEB2BROOT_PRINTSTEPNAME_DUP01=0x2b
-[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASEROOT_BASECONSTRUCTL_DUP01=0x28
-[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASEROOT_RUNL_DUP01=0x29
-[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASEROOT_RUNL_DUP02=0x2a
-[TRACE]TRACE_VERBOSE[0xDE]_CTESTCASEWATCHDOG_ISSUEREQUEST=0x2c
-[TRACE]TRACE_VERBOSE[0xDE]_CTESTENGINE_PROCESSCOMMANDLINEL_DUP01=0x2d
-[TRACE]TRACE_VERBOSE[0xDE]_CTESTENGINE_PROCESSCOMMANDLINEL_DUP05=0x2e
-[TRACE]TRACE_WARNING[0x83]_COTGROOT_OTGBUSCLEARERROR_DUP01=0x6
-[TRACE]TRACE_WARNING[0x83]_COTGROOT_OTGBUSDROP_DUP01=0x5
-[TRACE]TRACE_WARNING[0x83]_COTGROOT_OTGBUSREQUEST_DUP01=0x3
-[TRACE]TRACE_WARNING[0x83]_COTGROOT_OTGBUSRESPONDSRP_DUP01=0x4
-[TRACE]TRACE_WARNING[0x83]_COTGROOT_OTGSTARTSTACKS_DUP01=0x1
-[TRACE]TRACE_WARNING[0x83]_COTGROOT_OTGUNLOADLDD=0x2
--- a/kerneltest/e32test/usbho/t_otgdi/traces_t_otgdi_fdfactor/OstTraceDefinitions.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-// 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:
-// 
-//
-
-
-#ifndef __OSTTRACEDEFINITIONS_H__
-#define __OSTTRACEDEFINITIONS_H__
-// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
-// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
-//#define OST_TRACE_COMPILER_IN_USE
-#include <opensystemtrace.h>
-#endif
--- a/kerneltest/e32test/usbho/t_otgdi/traces_t_otgdi_fdfactor/fixed_id.definitions	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
-[GROUP]TRACE_NORMAL=0x86
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_CONSTRUCTL=0x1
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_CONSTRUCTL_DUP01=0x2
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_MONITOR=0x3
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNERROR=0xc
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL=0x4
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL_DUP01=0x5
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL_DUP02=0x6
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL_DUP03=0x7
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL_DUP04=0x8
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL_DUP05=0x9
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL_DUP06=0xa
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL_DUP07=0xb
-[TRACE]TRACE_NORMAL[0x86]_CFDFTOTGDIWATCHER_CONSTRUCTL=0x17
-[TRACE]TRACE_NORMAL[0x86]_CFDFTOTGDIWATCHER_DCFDFTOTGDIWATCHER=0x1a
-[TRACE]TRACE_NORMAL[0x86]_CFDFTOTGDIWATCHER_DCFDFTOTGDIWATCHER_DUP01=0x1b
-[TRACE]TRACE_NORMAL[0x86]_CFDFTOTGDIWATCHER_DOCANCEL=0x15
-[TRACE]TRACE_NORMAL[0x86]_CFDFTOTGDIWATCHER_FINDTOTGDIPROCESSNAME=0x18
-[TRACE]TRACE_NORMAL[0x86]_CFDFTOTGDIWATCHER_FINDTOTGDIPROCESSNAME_DUP01=0x19
-[TRACE]TRACE_NORMAL[0x86]_CFDFTOTGDIWATCHER_RUNL=0x16
-[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL=0xd
-[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP01=0xe
-[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP02=0xf
-[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP03=0x10
-[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP04=0x11
-[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP05=0x12
-[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_RUNERROR=0x14
-[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_RUNL=0x13
-[TRACE]TRACE_NORMAL[0x86]_DOSTARTL_DOSTARTL=0x1c
-[TRACE]TRACE_NORMAL[0x86]_DOSTARTL_DOSTARTL_DUP01=0x1d
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN=0x1e
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP01=0x1f
--- a/kerneltest/e32test/usbho/t_usbdi/group/t_usbdi.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/group/t_usbdi.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -27,8 +27,7 @@
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 
-USERINCLUDE		../inc
-USERINCLUDE		../traces_t_usbdi
+USERINCLUDE		../inc 
 
 // Source file paths
 
@@ -40,31 +39,31 @@
 
 // Engine and controller
 
-SOURCE			TestEngine.cpp
-SOURCE			TestCaseController.cpp
-SOURCE			TestPolicy.cpp
-SOURCE			UsbDescriptorOffsets.cpp
-SOURCE			FDFActor.cpp
+SOURCE			testengine.cpp
+SOURCE			testcasecontroller.cpp
+SOURCE			testpolicy.cpp
+SOURCE			usbdescriptoroffsets.cpp
+SOURCE			fdfactor.cpp
 
 // Test factory
 
-SOURCE			TestCaseFactory.cpp
+SOURCE			testcasefactory.cpp
 
 // Timers/Watchers
 
-SOURCE			UsbClientStateWatcher.cpp
-SOURCE			BasicWatcher.cpp
-SOURCE			SoftwareConnectTimer.cpp
+SOURCE			usbclientstatewatcher.cpp
+SOURCE			basicwatcher.cpp
+SOURCE			softwareconnecttimer.cpp
 SOURCE			wakeuptimer.cpp
 
 // Modelled test devices
 
-SOURCE			TestDeviceBase.cpp
-SOURCE			TestInterfaceBase.cpp
+SOURCE			testdevicebase.cpp
+SOURCE			testinterfacebase.cpp
 SOURCE			testinterfacesettingbase.cpp
 SOURCE			vendordevice.cpp
 SOURCE			testdeviceA.cpp
-SOURCE			testdeviceb.cpp
+SOURCE			testdeviceB.cpp
 SOURCE			testdeviceC.cpp
 SOURCE			testdeviceD.cpp
 SOURCE			endpointreader.cpp
--- a/kerneltest/e32test/usbho/t_usbdi/group/t_usbhost_usbman.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/group/t_usbhost_usbman.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,8 +18,6 @@
 target			t_usbhost_usbman.exe
 targettype		exe
 
-USERINCLUDE ../traces_t_usbhost_usbman
-
 sourcepath		../t_usbhost_usbman_src
 source			t_usbhost_usbman.cpp
 
--- a/kerneltest/e32test/usbho/t_usbdi/inc/BasicWatcher.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/inc/BasicWatcher.h	Wed Sep 01 12:34:56 2010 +0100
@@ -110,6 +110,7 @@
 	*/
 	void DoCancel()
 		{
+		LOG_FUNC
 		iUsbInterface.CancelPermitSuspend();
 		}
 
@@ -118,6 +119,7 @@
 	*/
 	void RunL()
 		{
+		LOG_FUNC
 		iCompletionCode = iStatus.Int();
 		User::LeaveIfError(iResumeCallBack.CallBack());
 		}
@@ -126,6 +128,8 @@
 	*/
 	TInt RunError()
 		{
+		LOG_FUNC
+
 		return KErrNone;
 		}
 
--- a/kerneltest/e32test/usbho/t_usbdi/inc/EndpointStallWatcher.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/inc/EndpointStallWatcher.h	Wed Sep 01 12:34:56 2010 +0100
@@ -61,6 +61,8 @@
 	*/
 	void DoCancel()
 		{
+		LOG_FUNC
+		
 		iClientDriver.EndpointStatusNotifyCancel();
 		}
 		
@@ -73,6 +75,8 @@
 	of an endpoint.
 	*/
 		{
+		LOG_FUNC
+		
 		TUint epMask = iEpMask;
 
 		if(iStatus.Int() != KErrNone)
@@ -117,6 +121,8 @@
 	*/
 	TInt RunError(TInt aError)
 		{
+		LOG_FUNC
+		
 		return KErrNone;
 		}
 
--- a/kerneltest/e32test/usbho/t_usbdi/inc/HostTransfers.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/inc/HostTransfers.h	Wed Sep 01 12:34:56 2010 +0100
@@ -108,6 +108,8 @@
 	*/
 	void RunL()
 		{
+		LOG_FUNC
+		
 		TInt completionCode(iStatus.Int());
 		RDebug::Printf("Transfer err=%d",completionCode);
 		
@@ -119,6 +121,8 @@
 	*/
 	void DoCancel()
 		{
+		LOG_FUNC
+		
 		// Will cancel all transfers on this pipe
 		
 		Pipe().CancelAllTransfers();
--- a/kerneltest/e32test/usbho/t_usbdi/inc/testdebug.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/inc/testdebug.h	Wed Sep 01 12:34:56 2010 +0100
@@ -28,6 +28,14 @@
 #include <d32usbdi.h>
 #include <f32file.h>
 
+/**
+Debug macro for serial port logging of function names and signatures
+*/
+#define LOG_CFUNC TFunctionLog funcLog(__PRETTY_FUNCTION__, NULL);
+#define LOG_FUNC TFunctionLog funcLog(__PRETTY_FUNCTION__,this);
+
+#define LOG_POINT(x) RDebug::Printf(">> Debug point: " #x);
+
 //#define LOG_INFO(x) RDebug::Print x;
 
 #define LOG_INFO(x) 
--- a/kerneltest/e32test/usbho/t_usbdi/src/BaseBulkTestCase.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/BaseBulkTestCase.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -13,33 +13,27 @@
 // Description:
 // @file BaseBulkTestCase.cpp
 // @internalComponent
-//
+// 
 //
 
 #include "BaseBulkTestCase.h"
 #include "testpolicy.h"
 #include "modelleddevices.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "BaseBulkTestCaseTraces.h"
-#endif
 
 
-
+ 
 namespace NUnitTesting_USBDI
 	{
 
 //*****************************************************************************************************
 
-//Bulk Timer Class
+//Bulk Timer Class 
 CBulkTestTimer* CBulkTestTimer::NewL(MBulkTestTimerObserver& aParent)
 	{
-	OstTraceFunctionEntry1( CBULKTESTTIMER_NEWL_ENTRY, ( TUint )&( aParent ) );
 	CBulkTestTimer* self = new (ELeave) CBulkTestTimer(aParent);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CBULKTESTTIMER_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 
@@ -48,33 +42,27 @@
 :	CTimer(EPriorityStandard),
 	iParent(aParent)
 	{
-	OstTraceFunctionEntryExt( CBULKTESTTIMER_CBULKTESTTIMER_ENTRY, this );
 	CActiveScheduler::Add(this);
-	OstTraceFunctionExit1( CBULKTESTTIMER_CBULKTESTTIMER_EXIT, this );
 	}
 
 
 CBulkTestTimer::~CBulkTestTimer()
 	{
-	OstTraceFunctionEntry1( CBULKTESTTIMER_CBULKTESTTIMER_ENTRY_DUP01, this );
-	OstTraceFunctionExit1( CBULKTESTTIMER_CBULKTESTTIMER_EXIT_DUP01, this );
 	}
 
 
 void CBulkTestTimer::ConstructL()
 	{
-	OstTraceFunctionEntry1( CBULKTESTTIMER_CONSTRUCTL_ENTRY, this );
+	LOG_FUNC
 	CTimer::ConstructL();
-	OstTraceFunctionExit1( CBULKTESTTIMER_CONSTRUCTL_EXIT, this );
 	}
 
 
 void CBulkTestTimer::RunL()
 	{
-    OstTraceFunctionEntry1( CBULKTESTTIMER_RUNL_ENTRY, this );
+	LOG_FUNC
 
 	iParent.HandleBulkTestTimerFired();
-	OstTraceFunctionExit1( CBULKTESTTIMER_RUNL_EXIT, this );
 	}
 
 
@@ -87,33 +75,29 @@
 	: CBaseTestCase(aTestCaseId, aHostFlag, aHostOnly),
 	iInBufferPtr(NULL,0),
 	iOutBufferPtr(NULL,0),
-	iValidateBufferPtr(NULL,0)
+	iValidateBufferPtr(NULL,0)	
 	{
-	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_CBASEBULKTESTCASE_ENTRY, this );
-
-	OstTraceFunctionExit1( CBASEBULKTESTCASE_CBASEBULKTESTCASE_EXIT, this );
+	
 	}
 
 
 void CBaseBulkTestCase::BaseBulkConstructL()
 	{
-	OstTraceFunctionEntry1( CBASEBULKTESTCASE_BASEBULKCONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceD(this);
 	BaseConstructL();
-	OstTraceFunctionExit1( CBASEBULKTESTCASE_BASEBULKCONSTRUCTL_EXIT, this );
 	}
 
 
 CBaseBulkTestCase::~CBaseBulkTestCase()
 	{
-	OstTraceFunctionEntry1( CBASEBULKTESTCASE_CBASEBULKTESTCASE_ENTRY_DUP01, this );
-
+	LOG_FUNC
+	
 	Cancel();
 
 	//Do this before deleting the transfer objects
 	//NB this should do nothing if already called from a derived test class
 	CloseInterfaceAndPipes();
-
+	
 	delete iValidateBuffer;
 	delete iInBuffer;
 	delete iOutBuffer;
@@ -129,7 +113,7 @@
 		{
 		delete iInTransfer[count];
 		}
-
+	
 	delete iControlEp0;
 	delete iActorFDF;
 	if(!IsHost() && iTestDevice)
@@ -137,126 +121,115 @@
 		iTestDevice->Close();
 		}
 	delete iTestDevice;
-	OstTraceFunctionExit1( CBASEBULKTESTCASE_CBASEBULKTESTCASE_EXIT_DUP01, this );
 	}
-
-void CBaseBulkTestCase::ExecuteHostTestCaseL()
+	
+void CBaseBulkTestCase::ExecuteHostTestCaseL()	
 	{
-	OstTraceFunctionEntry1( CBASEBULKTESTCASE_EXECUTEHOSTTESTCASEL_ENTRY, this );
-
+	LOG_FUNC
+	
 	iActorFDF = CActorFDF::NewL(*this);
 	iControlEp0 = new (ELeave) CEp0Transfer(iUsbInterface0);
 	iActorFDF->Monitor();
 	TimeoutIn(30);
-	OstTraceFunctionExit1( CBASEBULKTESTCASE_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
-
+	
 void CBaseBulkTestCase::HostDoCancel()
 	{
-	OstTraceFunctionEntry1( CBASEBULKTESTCASE_HOSTDOCANCEL_ENTRY, this );
-
+	LOG_FUNC
+	
 	// Cancel the test step timeout timer
-
+	
 	CancelTimeout();
-	OstTraceFunctionExit1( CBASEBULKTESTCASE_HOSTDOCANCEL_EXIT, this );
 	}
-
-
+	
+	
 void CBaseBulkTestCase::ExecuteDeviceTestCaseL()
 	{
-	OstTraceFunctionEntry1( CBASEBULKTESTCASE_EXECUTEDEVICETESTCASEL_ENTRY, this );
-
+	LOG_FUNC
+	
 	iTestDevice->OpenL(TestCaseId());
 	iTestDevice->SubscribeToReports(iStatus);
 	SetActive();
-
+	
 	// Connect the device to the host
-
+	
 	iTestDevice->SoftwareConnect();
-	OstTraceFunctionExit1( CBASEBULKTESTCASE_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
-
+	
 void CBaseBulkTestCase::DeviceDoCancel()
 	{
-	OstTraceFunctionEntry1( CBASEBULKTESTCASE_DEVICEDOCANCEL_ENTRY, this );
-
+	LOG_FUNC
+	
 	// Cancel the test device error reports
-
+	
 	iTestDevice->CancelSubscriptionToReports();
-	OstTraceFunctionExit1( CBASEBULKTESTCASE_DEVICEDOCANCEL_EXIT, this );
 	}
-
-
+	
+	
 void CBaseBulkTestCase::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 				RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_DEVICESTATECHANGEL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
-	OstTraceFunctionExit1( CBASEBULKTESTCASE_DEVICESTATECHANGEL_EXIT, this );
 	}
-
-
+	
+	
 TInt CBaseBulkTestCase::BaseBulkDeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_ENTRY, this );
-	OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL, "this - %08x", this);
+	LOG_FUNC
+	RDebug::Printf("this - %08x", this);
 	return BaseBulkDeviceInsertedL(aDeviceHandle, EFalse);
 	}
 
 void CBaseBulkTestCase::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_DEVICEINSERTEDL_ENTRY, this );
 	//to be implemnted in individual test cases, possibly with the help of BaseBulkDeviceInsertedL
 	BaseBulkDeviceInsertedL(aDeviceHandle);
-	OstTraceFunctionExit1( CBASEBULKTESTCASE_DEVICEINSERTEDL_EXIT, this );
 	};
 
 TInt CBaseBulkTestCase::BaseBulkDeviceInsertedL(TUint aDeviceHandle, TBool aUseTwoInterfaces)
 	{
-	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_ENTRY_DUP01, this );
+	LOG_FUNC
 	TInt err(KErrNone);
-
-	// Validate connected device
+	
+	// Validate connected device	
 	CUsbTestDevice& testDevice = iActorFDF->DeviceL(aDeviceHandle);
-
-	OstTraceExt1(TRACE_NORMAL, CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP08, "device serial number (%S)",testDevice.SerialNumber());
-	OstTraceExt1(TRACE_NORMAL, CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP01, "Manufacturer (%S)",testDevice.Manufacturer());
-	OstTraceExt1(TRACE_NORMAL, CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP02, "Product (%S)",testDevice.Product());
-	OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP03, "ProductId (%d)",testDevice.ProductId());
-	OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP04, "VendorId (%d)",testDevice.VendorId());
-
+	
+	RDebug::Printf("device serial number (%S)",&testDevice.SerialNumber());
+	RDebug::Printf("Manufacturer (%S)",&testDevice.Manufacturer());
+	RDebug::Printf("Product (%S)",&testDevice.Product());
+	RDebug::Printf("ProductId (%d)",testDevice.ProductId());
+	RDebug::Printf("VendorId (%d)",testDevice.VendorId());
+	
 	if(testDevice.SerialNumber().Compare(TestCaseId()) != 0)
 		{
-		// Incorrect device for this test case
+		// Incorrect device for this test case	
 
-		OstTraceExt3(TRACE_NORMAL, CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP05, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
+		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
 
 		// Start the connection timeout again
 		TimeoutIn(30);
-		OstTraceFunctionExitExt( CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_EXIT, this, EDeviceConfigurationError );
 		return EDeviceConfigurationError;
-		}
+		}	
 
 
 	TUint32 token0;
 	err = testDevice.Device().GetTokenForInterface(0,token0);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP06, "<Error %d> Token for interface 0 could not be retrieved",err);
+		RDebug::Printf("<Error %d> Token for interface 0 could not be retrieved",err);
 
 		// Start the connection timeout again
 		TimeoutIn(30);
-		OstTraceFunctionExitExt( CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_EXIT_DUP01, this, EDeviceConfigurationError );
 		return EDeviceConfigurationError;
 		}
 	err = iUsbInterface0.Open(token0); // Default interface setting 0
 	if(err != KErrNone)
 		{
-		OstTraceExt2(TRACE_NORMAL, CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP07, "<Error %d> Unable to open interface 0 using token %d",err,token0);
+		RDebug::Printf("<Error %d> Unable to open interface 0 using token %d",err,token0);
 		// Start the connection timeout again
 		TimeoutIn(30);
-		OstTraceFunctionExitExt( CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_EXIT_DUP02, this, EDeviceConfigurationError );
 		return EDeviceConfigurationError;
 		}
 
@@ -264,17 +237,15 @@
 	if(err != ENone)
 		//msg already setup, and failure message sent
 		{
-		OstTraceFunctionExitExt( CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_EXIT_DUP03, this, EDeviceConfigurationError );
-		return EDeviceConfigurationError;
+		return EDeviceConfigurationError;	
 		}
-	OstTraceFunctionExitExt( CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_EXIT_DUP04, this, ENone );
 	return ENone;
 	}
 
 
 TInt CBaseBulkTestCase::SetUpInterfaceAndPipesL(TUint aDeviceHandle, TUint8 aInterfaceNum)
 	{
-	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_ENTRY, this );
+	LOG_FUNC
 	TInt err(KErrNone);
 	TInt endpointAddress;
 	RUsbInterface* pTestInterface = NULL;
@@ -282,7 +253,7 @@
 	RUsbPipe* pTestPipeBulkOut1 = NULL;
 	RUsbPipe* pTestPipeBulkOut2 = NULL;
 	CUsbTestDevice& testDevice = iActorFDF->DeviceL(aDeviceHandle);
-
+	
 	switch(aInterfaceNum)
 		{
 		case 1:
@@ -302,17 +273,16 @@
 			break;
 		}
 
-	OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL, "this - %08x", this);
-
+	RDebug::Printf("this - %08x", this);
+	
 	TUint32 token;
 	err = testDevice.Device().GetTokenForInterface(aInterfaceNum,token);
 	if(err != KErrNone)
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Token for interface 1 could not be retrieved"),err);
-		OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP01, msg);
+		RDebug::Print(msg);
 		TTestCaseFailed request(err,msg);
-		OstTraceFunctionExitExt( CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT, this, EDeviceConfigurationError );
 		return EDeviceConfigurationError;
 		}
 	if(pTestInterface != NULL)
@@ -322,13 +292,12 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Unable to open interface 1 using token %d"),err,token);
-			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP02, msg);
+			RDebug::Print(msg);
 			TTestCaseFailed request(err,msg);
-			OstTraceFunctionExitExt( CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP01, this, EDeviceConfigurationError );
 			return EDeviceConfigurationError;
 			}
 		}
-
+	
 	if(pTestPipeBulkIn != NULL)
 		{
 		err = GetEndpointAddress(*pTestInterface,0,KTransferTypeBulk,KEpDirectionIn,endpointAddress);
@@ -336,26 +305,24 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Address for bulk in endpoint could not be obtained"),err);
-			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP03, msg);
+			RDebug::Print(msg);
 			TTestCaseFailed request(err,msg);
-			OstTraceFunctionExitExt( CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP02, this, EDeviceConfigurationError );
 			return EDeviceConfigurationError;
 			}
-
-		OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP04, "IN Endpoint address %08x",endpointAddress);
-
+		
+		RDebug::Printf("IN Endpoint address %08x",endpointAddress);
+		
 		err = pTestInterface->OpenPipeForEndpoint(*pTestPipeBulkIn,endpointAddress,ETrue);
 		if(err != KErrNone)
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Unable to open pipe for endpoint %08x"),err,endpointAddress);
-			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP05, msg);
+			RDebug::Print(msg);
 			TTestCaseFailed request(err,msg);
-			OstTraceFunctionExitExt( CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP03, this, EDeviceConfigurationError );
 			return EDeviceConfigurationError;
 			}
 		}
-
+		
 	if(pTestPipeBulkOut1 != NULL)
 		{
 		err = GetEndpointAddress(*pTestInterface,0,KTransferTypeBulk,KEpDirectionOut,endpointAddress);
@@ -363,26 +330,24 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Address for(first) bulk out endpoint could not be obtained"),err);
-			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP06, msg);
+			RDebug::Print(msg);
 			TTestCaseFailed request(err,msg);
-			OstTraceFunctionExitExt( CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP04, this, EDeviceConfigurationError );
 			return EDeviceConfigurationError;
 			}
-
-		OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP07, "OUT Endpoint address %08x",endpointAddress);
-
+		
+		RDebug::Printf("OUT Endpoint address %08x",endpointAddress);
+		
 		err = pTestInterface->OpenPipeForEndpoint(*pTestPipeBulkOut1,endpointAddress,ETrue);
 		if(err != KErrNone)
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Unable to open pipe for endpoint %08x"),err,endpointAddress);
-			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP08, msg);
+			RDebug::Print(msg);
 			TTestCaseFailed request(err,msg);
-			OstTraceFunctionExitExt( CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP05, this, EDeviceConfigurationError );
 			return EDeviceConfigurationError;
 			}
 		}
-
+	
 	if(pTestPipeBulkOut2 != NULL)
 		{
 		err = GetEndpointAddress(*pTestInterface,0,KTransferTypeBulk,KEpDirectionOut,1,endpointAddress);
@@ -390,123 +355,111 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Address for(second) bulk out endpoint could not be obtained"),err);
-			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP09, msg);
+			RDebug::Print(msg);
 			TTestCaseFailed request(err,msg);
-			OstTraceFunctionExitExt( CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP06, this, EDeviceConfigurationError );
 			return EDeviceConfigurationError;
 			}
-
-		OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP10, "OUT Endpoint address %08x",endpointAddress);
-
+		
+		RDebug::Printf("OUT Endpoint address %08x",endpointAddress);
+		
 		err = pTestInterface->OpenPipeForEndpoint(*pTestPipeBulkOut2,endpointAddress,ETrue);
 		if(err != KErrNone)
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Unable to open pipe for endpoint %08x"),err,endpointAddress);
-			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP11, msg);
+			RDebug::Print(msg);
 			TTestCaseFailed request(err,msg);
-			OstTraceFunctionExitExt( CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP07, this, EDeviceConfigurationError );
 			return EDeviceConfigurationError;
 			}
 		}
 
-	OstTraceFunctionExitExt( CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP08, this, ENone );
 	return ENone;
 	}
-
+	
 void CBaseBulkTestCase::CloseInterfaceAndPipes()
 	{
-	OstTraceFunctionEntry1( CBASEBULKTESTCASE_CLOSEINTERFACEANDPIPES_ENTRY, this );
-
+	LOG_FUNC
+	
 	// Close the pipe(s) before interface(s)
 	iTestPipeInterface2BulkIn.Close();
 	iTestPipeInterface2BulkOut1.Close();
 	iTestPipeInterface2BulkOut2.Close();
 	iTestPipeInterface1BulkIn.Close();
 	iTestPipeInterface1BulkOut.Close();
-
+	
 	iUsbInterface2.Close();
 	iUsbInterface1.Close();
 	iUsbInterface0.Close();
-	OstTraceFunctionExit1( CBASEBULKTESTCASE_CLOSEINTERFACEANDPIPES_EXIT, this );
 	}
 
 void CBaseBulkTestCase::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_DEVICEREMOVEDL_ENTRY, this );
-
+	LOG_FUNC
+	
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
-
+	
 	TestFailed(KErrDisconnected);
-	OstTraceFunctionExit1( CBASEBULKTESTCASE_DEVICEREMOVEDL_EXIT, this );
 	}
-
-
+	
+	
 void CBaseBulkTestCase::BusErrorL(TInt aError)
 	{
-	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_BUSERRORL_ENTRY, this );
-
+	LOG_FUNC
+	
 	// This test case handles no failiures on the bus
-
+	
 	TestFailed(KErrCompletion);
-	OstTraceFunctionExit1( CBASEBULKTESTCASE_BUSERRORL_EXIT, this );
 	}
 
 void CBaseBulkTestCase::HostRunL()
 	{
-	OstTraceFunctionEntry1( CBASEBULKTESTCASE_HOSTRUNL_ENTRY, this );
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
-
+	
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_HOSTRUNL, "<Error> Action timeout");
+		RDebug::Printf("<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
+		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
-	OstTraceFunctionExit1( CBASEBULKTESTCASE_HOSTRUNL_EXIT, this );
 	}
 
 void CBaseBulkTestCase::DeviceRunL()
 	{
-	OstTraceFunctionEntry1( CBASEBULKTESTCASE_DEVICERUNL_ENTRY, this );
-
+	LOG_FUNC
+	
 	// Disconnect the device
 	iTestDevice->SoftwareDisconnect();
-
+	
 	// Complete the test case request
 	TestPolicy().SignalTestComplete(iStatus.Int());
-	OstTraceFunctionExit1( CBASEBULKTESTCASE_DEVICERUNL_EXIT, this );
 	}
 
 TBool CBaseBulkTestCase::ValidateData (const TDesC8& aDataToValidate, const TDesC8& aDataPattern)
 	{
-	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_VALIDATEDATA_ENTRY, this );
 	return ValidateData(aDataToValidate, aDataPattern, aDataPattern.Length());
 	}
 
 TBool CBaseBulkTestCase::ValidateData (const TDesC8& aDataToValidate, const TDesC8& aDataPattern, const TUint aNumBytes)
 	{
-	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_VALIDATEDATA_ENTRY_DUP01, this );
 	return ValidateData(aDataToValidate, aDataPattern, 0, aNumBytes);
 	}
 
 TBool CBaseBulkTestCase::ValidateData (const TDesC8& aDataToValidate, const TDesC8& aDataPattern, const TUint aStartPoint, const TUint aNumBytes)
 	{
-	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_VALIDATEDATA_ENTRY_DUP02, this );
-
+	LOG_FUNC
+		
 	__ASSERT_DEBUG(aDataPattern.Length()!=0, User::Panic(_L("Trying to validate with ZERO LENGTH STRING"), KErrArgument));
 
 	if(aDataToValidate.Length()!=aNumBytes)
 		{
-		OstTraceExt2(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA, "ROUND TRIP VALIDATION: Length Match Failure, Sent = %d, Returned = %d", aNumBytes, aDataToValidate.Length());
-		OstTraceFunctionExitExt( CBASEBULKTESTCASE_VALIDATEDATA_EXIT, this, EFalse );
+		RDebug::Printf("ROUND TRIP VALIDATION: Length Match Failure, Sent = %d, Returned = %d", aNumBytes, aDataToValidate.Length());
 		return EFalse;
 		}
 	TUint startPoint = aStartPoint%aDataPattern.Length();
@@ -519,17 +472,14 @@
 		{
 		if(aDataToValidate.Left(numStartBytes).Compare(aDataPattern.Mid(startPoint, numStartBytes)) != 0)
 			{
-			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP01, "ROUND TRIP VALIDATION: Start Bytes Match Failure");
-			OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP02, "ROUND TRIP VALIDATION: numStartBytes = %d", numStartBytes);
-			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP03, "Start of EXPECTED data ...");
-			const TPtrC8& midDataPattern = aDataPattern.Mid(startPoint, numStartBytes);
-			OstTraceData(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP50, "", midDataPattern.Ptr(), midDataPattern.Length());
-			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP04, "\n");
-			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP05, "Start of RETURNED data ...");
-			const TPtrC8& leftDataToValidate = aDataToValidate.Left(numStartBytes);
-			OstTraceData(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP51, "", leftDataToValidate.Ptr(), leftDataToValidate.Length());
-			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP06, "\n");
-			OstTraceFunctionExitExt( CBASEBULKTESTCASE_VALIDATEDATA_EXIT_DUP01, this, EFalse );
+			RDebug::Printf("ROUND TRIP VALIDATION: Start Bytes Match Failure");
+			RDebug::Printf("ROUND TRIP VALIDATION: numStartBytes = %d", numStartBytes);
+			RDebug::Printf("Start of EXPECTED data ...");
+			RDebug::RawPrint(aDataPattern.Mid(startPoint, numStartBytes));
+			RDebug::Printf("\n");
+			RDebug::Printf("Start of RETURNED data ...");				
+			RDebug::RawPrint(aDataToValidate.Left(numStartBytes));
+			RDebug::Printf("\n");
 			return EFalse;
 			}
 		}
@@ -537,17 +487,14 @@
 		{
 		if(aDataToValidate.Mid(startEndPoint,numEndBytes).Compare(aDataPattern.Left(numEndBytes)) != 0)
 			{
-			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP07, "ROUND TRIP VALIDATION: End Bytes Match Failure");
-			OstTraceExt2(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP08, "ROUND TRIP VALIDATION: startEndPoint = %d, numEndBytes = %d", startEndPoint, numEndBytes);
-			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP09, "End of EXPECTED data ...");
-			const TPtrC8& leftDataPattern = aDataPattern.Left(numEndBytes);
-			OstTraceData(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP52, "", leftDataPattern.Ptr(), leftDataPattern.Length());
-			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP10, "\n");
-			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP11, "End of RETURNED data ...");
-			const TPtrC8& midDataToValidate = aDataToValidate.Mid(startEndPoint,numEndBytes);
-			OstTraceData(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP53, "", midDataToValidate.Ptr(), midDataToValidate.Length());
-			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP12, "\n");
-			OstTraceFunctionExitExt( CBASEBULKTESTCASE_VALIDATEDATA_EXIT_DUP02, this, EFalse );
+			RDebug::Printf("ROUND TRIP VALIDATION: End Bytes Match Failure");
+			RDebug::Printf("ROUND TRIP VALIDATION: startEndPoint = %d, numEndBytes = %d", startEndPoint, numEndBytes);
+			RDebug::Printf("End of EXPECTED data ...");
+			RDebug::RawPrint(aDataPattern.Left(numEndBytes));
+			RDebug::Printf("\n");
+			RDebug::Printf("End of RETURNED data ...");				
+			RDebug::RawPrint(aDataToValidate.Mid(startEndPoint,numEndBytes));
+			RDebug::Printf("\n");
 			return EFalse;
 			}
 		}
@@ -555,93 +502,83 @@
 		{
 		if(aDataToValidate.Mid(numStartBytes + i*aDataPattern.Length(),aDataPattern.Length()).Compare(aDataPattern) != 0)
 			{
-			OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP13, "ROUND TRIP VALIDATION: Repeated Bytes Match Failure, Repeat %d",i);
-			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP14, "Middle block of EXPECTED data ...");
-			OstTraceData(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP54, "", aDataPattern.Ptr(), aDataPattern.Length());
-			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP15, "\n");
-			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP16, "Middle block of RETURNED data ...");
-			const TPtrC8& midDataToValidate = aDataToValidate.Mid(numStartBytes + i*aDataPattern.Length(),aDataPattern.Length());
-			OstTraceData(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP55, "", midDataToValidate.Ptr(), midDataToValidate.Length());
-			OstTrace0(TRACE_NORMAL, CBASEBULKTESTCASE_VALIDATEDATA_DUP17, "\n");
-			OstTraceFunctionExitExt( CBASEBULKTESTCASE_VALIDATEDATA_EXIT_DUP03, this, EFalse );
+			RDebug::Printf("ROUND TRIP VALIDATION: Repeated Bytes Match Failure, Repeat %d",i);
+			RDebug::Printf("Middle block of EXPECTED data ...");
+			RDebug::RawPrint(aDataPattern);
+			RDebug::Printf("\n");
+			RDebug::Printf("Middle block of RETURNED data ...");
+			RDebug::RawPrint(aDataToValidate.Mid(numStartBytes + i*aDataPattern.Length(),aDataPattern.Length()));
+			RDebug::Printf("\n");
 			return EFalse; //from 'for' loop
 			}
 		}
-	OstTraceFunctionExitExt( CBASEBULKTESTCASE_VALIDATEDATA_EXIT_DUP04, this, ETrue );
 	return ETrue;
 	}
 
 void CBaseBulkTestCase::RecordTime(const TUint8 aTimerIndex)
 	{
-	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_RECORDTIME_ENTRY, this );
+	LOG_FUNC
 	if(aTimerIndex >= KMaxNumTimers)
 		{
-		OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_RECORDTIME, "Record Timer with index %d called - index OUT OF RANGE", aTimerIndex);
+		RDebug::Printf("Record Timer with index %d called - index OUT OF RANGE", aTimerIndex);
 		User::Panic(_L("BAD TIMER INDEX"), KErrArgument);
 		}
 	iEndTime[aTimerIndex].HomeTime();
 	iTimeElapsed[aTimerIndex] = iEndTime[aTimerIndex].MicroSecondsFrom(iStartTime[aTimerIndex]);
-	OstTraceExt2(TRACE_NORMAL, CBASEBULKTESTCASE_RECORDTIME_DUP01, "Timer with index %d completed in %d uSec", aTimerIndex, (TInt)(iTimeElapsed[aTimerIndex].Int64()));
-	OstTraceFunctionExit1( CBASEBULKTESTCASE_RECORDTIME_EXIT, this );
+	RDebug::Printf("Timer with index %d completed in %d uSec", aTimerIndex, (TInt)(iTimeElapsed[aTimerIndex].Int64()));
 	}
 
 TInt CBaseBulkTestCase::CheckTimes(const TUint8 aFirstTimerIndex, const TUint8 aSecondTimerIndex, const TUint aPercentage)
 	{
-	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_CHECKTIMES_ENTRY, this );
+	LOG_FUNC
 	if(aFirstTimerIndex >= KMaxNumTimers)
 		{
-		OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_CHECKTIMES, "First timer with index %d called - index OUT OF RANGE", aFirstTimerIndex);
+		RDebug::Printf("First timer with index %d called - index OUT OF RANGE", aFirstTimerIndex);
 		User::Panic(_L("BAD TIMER INDEX"), KErrArgument);
 		}
 	if(aSecondTimerIndex >= KMaxNumTimers)
 		{
-		OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_CHECKTIMES_DUP01, "Second timer with index %d called - index OUT OF RANGE", aSecondTimerIndex);
+		RDebug::Printf("Second timer with index %d called - index OUT OF RANGE", aSecondTimerIndex);
 		User::Panic(_L("BAD TIMER INDEX"), KErrArgument);
 		}
 
 	TInt ret = KErrNone;
-	OstTraceExt4(TRACE_NORMAL, CBASEBULKTESTCASE_CHECKTIMES_DUP02, "Transfer %d completed in %d uSec\nTransfer %d completed in %d uSec", aFirstTimerIndex, (TInt)(iTimeElapsed[aFirstTimerIndex].Int64()), aSecondTimerIndex, (TInt)(iTimeElapsed[aSecondTimerIndex].Int64()));
+	RDebug::Printf("Transfer %d completed in %d uSec\nTransfer %d completed in %d uSec", aFirstTimerIndex, (TInt)(iTimeElapsed[aFirstTimerIndex].Int64()), aSecondTimerIndex, (TInt)(iTimeElapsed[aSecondTimerIndex].Int64()));
 	if(aPercentage*iTimeElapsed[aFirstTimerIndex].Int64() > KPercent*iTimeElapsed[aSecondTimerIndex].Int64())
 		{
 		ret = KErrTooBig;
-		OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_CHECKTIMES_DUP03, "Time %d too big", aFirstTimerIndex);
+		RDebug::Printf("Time %d too big", aFirstTimerIndex);
 		}
 	if(aPercentage*iTimeElapsed[aSecondTimerIndex].Int64() > KPercent*iTimeElapsed[aFirstTimerIndex].Int64())
 		{
 		ret = KErrTooBig;
-		OstTrace1(TRACE_NORMAL, CBASEBULKTESTCASE_CHECKTIMES_DUP04, "Time %d too big", aSecondTimerIndex);
+		RDebug::Printf("Time %d too big", aSecondTimerIndex);
 		}
-
-	OstTraceFunctionExitExt( CBASEBULKTESTCASE_CHECKTIMES_EXIT, this, ret );
+	
 	return ret;
 	}
 
 void CBaseBulkTestCase::ResetTimes(const TUint8 aTimerIndex)
 	{
-	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_RESETTIMES_ENTRY, this );
 	iStartTime[aTimerIndex] = 0;
 	iEndTime[aTimerIndex] = 0;
 	iTimeElapsed[aTimerIndex] = 0;
-	OstTraceFunctionExit1( CBASEBULKTESTCASE_RESETTIMES_EXIT, this );
 	}
 
 TInt CBaseBulkTestCase::CheckAndResetTimes(const TUint8 aFirstTimerIndex, const TUint8 aSecondTimerIndex, const TUint aPercentage)
 	{
-	OstTraceFunctionEntryExt( CBASEBULKTESTCASE_CHECKANDRESETTIMES_ENTRY, this );
-
+	LOG_FUNC
+	
 	TInt ret = CheckTimes(aFirstTimerIndex, aSecondTimerIndex, aPercentage);
 	ResetTimes(aFirstTimerIndex);
 	ResetTimes(aSecondTimerIndex);
-
-	OstTraceFunctionExitExt( CBASEBULKTESTCASE_CHECKANDRESETTIMES_EXIT, this, ret );
+	
 	return ret;
 	}
 
 void CBaseBulkTestCase::HandleBulkTestTimerFired()
 	{
-	OstTraceFunctionEntry1( CBASEBULKTESTCASE_HANDLEBULKTESTTIMERFIRED_ENTRY, this );
 	//do nothing here - leave to derived class if required
-	OstTraceFunctionExit1( CBASEBULKTESTCASE_HANDLEBULKTESTTIMERFIRED_EXIT, this );
 	}
 
 	}//end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/BaseTestCase.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/BaseTestCase.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -21,10 +21,6 @@
 #include <d32usbdi.h>
 #include "testdebug.h"
 #include "testpolicy.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "BaseTestCaseTraces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -50,51 +46,45 @@
 	iHost(aHostFlag),
 	iHostOnly(aHostOnly)
 	{
-	OstTraceFunctionEntryExt( CBASETESTCASE_CBASETESTCASE_ENTRY, this );
 	iTestCaseId.Copy(aTestCaseId);
 	CActiveScheduler::Add(this);
-	OstTraceFunctionExit1( CBASETESTCASE_CBASETESTCASE_EXIT, this );
 	}
 	
 void CBaseTestCase::BaseConstructL()
 	{
-	OstTraceFunctionEntry1( CBASETESTCASE_BASECONSTRUCTL_ENTRY, this );
-	OstTrace0(TRACE_NORMAL, CBASETESTCASE_BASECONSTRUCTL, "Creating test case timer");
+	LOG_FUNC	
+	RDebug::Printf("Creating test case timer");
 	TInt err(iTimer.CreateLocal());
 	if(err == KErrNone)
 		{
-		OstTrace0(TRACE_NORMAL, CBASETESTCASE_BASECONSTRUCTL_DUP01, "Test case timer created");
+		RDebug::Printf("Test case timer created");
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CBASETESTCASE_BASECONSTRUCTL_DUP02, "<Error %d> Test case timer could not be created",err);
+		RDebug::Printf("<Error %d> Test case timer could not be created",err);
 		User::Leave(err);
 		}	
-	OstTraceFunctionExit1( CBASETESTCASE_BASECONSTRUCTL_EXIT, this );
 	}
 
 void CBaseTestCase::TimeoutIn(TInt aTimeoutPeriod)
 	{
-	OstTraceFunctionEntryExt( CBASETESTCASE_TIMEOUTIN_ENTRY, this );
+	LOG_FUNC
 	
 	CancelTimeout();
 	iTimer.After(iStatus,aTimeoutPeriod*1000000);
 	SetActive();
-	OstTraceFunctionExit1( CBASETESTCASE_TIMEOUTIN_EXIT, this );
 	}
 
 
 void CBaseTestCase::CancelTimeout()
 	{
-	OstTraceFunctionEntry1( CBASETESTCASE_CANCELTIMEOUT_ENTRY, this );
 	iTimer.Cancel();
-	OstTraceFunctionExit1( CBASETESTCASE_CANCELTIMEOUT_EXIT, this );
 	}
 
 TInt CBaseTestCase::GenerateRefFile(const TDesC& aFileName)
 	{
-	OstTraceFunctionEntryExt( CBASETESTCASE_GENERATEREFFILE_ENTRY, this );
 	
+	LOG_FUNC
 	TBuf<256> refTreeFullFileName(KGeneratedFilesPath);
 	refTreeFullFileName.Append(aFileName);	
 	refTreeFullFileName.Append(KExtensionFile);
@@ -105,8 +95,7 @@
 	if(ret!=KErrNone && ret!=KErrAlreadyExists)
 	// if already connected, ignore
 		{ 
-		OstTrace1(TRACE_NORMAL, CBASETESTCASE_GENERATEREFFILE, "iFs.Connect fails, ret = %d", ret);
-		OstTraceFunctionExitExt( CBASETESTCASE_GENERATEREFFILE_EXIT, this, ret );
+		RDebug::Printf("iFs.Connect fails, ret = %d", ret);
 		return ret;
 		}
 			
@@ -118,8 +107,7 @@
 	
 	if(ret!=KErrNone) 
 		{ 
-		OstTrace1(TRACE_NORMAL, CBASETESTCASE_GENERATEREFFILE_DUP01, "refFile.Create fails, ret = %d", ret);
-		OstTraceFunctionExitExt( CBASETESTCASE_GENERATEREFFILE_EXIT_DUP01, this, ret );
+		RDebug::Printf("refFile.Create fails, ret = %d", ret);
 		return ret;
 		}
 		 
@@ -127,14 +115,13 @@
 	refFile.Flush(); 
 	refFile.Close();
 			 
-	OstTraceFunctionExitExt( CBASETESTCASE_GENERATEREFFILE_EXIT_DUP02, this, KErrNone );
 	return KErrNone;
 	}	
 
 TInt CBaseTestCase::CompareCurrentTreeToRef(const TDesC& aFileName, TBool& aIsIdentical)
 	{
-	OstTraceFunctionEntryExt( CBASETESTCASE_COMPARECURRENTTREETOREF_ENTRY, this );
 	
+	LOG_FUNC								
 	TBuf<256> refTreeFullFileName(KRefPath);
 	refTreeFullFileName.Append(aFileName);
 	refTreeFullFileName.Append(KExtensionFile);	 	
@@ -144,8 +131,7 @@
 	if(ret!=KErrNone && ret!=KErrAlreadyExists)
 	// if already connected, ignore
 		{ 
-		OstTrace1(TRACE_NORMAL, CBASETESTCASE_COMPARECURRENTTREETOREF, "iFs.Connect fails, ret = %d", ret);
-		OstTraceFunctionExitExt( CBASETESTCASE_COMPARECURRENTTREETOREF_EXIT, this, ret );
+		RDebug::Printf("iFs.Connect fails, ret = %d", ret);
 		return ret;
 		}
 
@@ -154,9 +140,8 @@
 		
 	if(ret!=KErrNone)
 		{
-		OstTraceExt1(TRACE_NORMAL, CBASETESTCASE_COMPARECURRENTTREETOREF_DUP01, "Reference File path: %S", refTreeFullFileName);
-		OstTrace1(TRACE_NORMAL, CBASETESTCASE_COMPARECURRENTTREETOREF_DUP02, "refFile.Open fails ret = %d", ret);
-		OstTraceFunctionExitExt( CBASETESTCASE_COMPARECURRENTTREETOREF_EXIT_DUP01, this, ret );
+		RDebug::Printf("Reference File path: %S", &refTreeFullFileName);
+		RDebug::Printf("refFile.Open fails ret = %d", ret);
 		return ret;
 		}
 		
@@ -166,7 +151,7 @@
 	// check size is identical
 	if(refFileSize != iTreeBuffer.Size())
 		{		
-		OstTraceExt2(TRACE_NORMAL, CBASETESTCASE_COMPARECURRENTTREETOREF_DUP03, "sizes are NOT identical, refFileSize = %d, iTreeBuffer.Size() = %d ", refFileSize, iTreeBuffer.Size());
+		RDebug::Printf("sizes are NOT identical, refFileSize = %d, iTreeBuffer.Size() = %d ", refFileSize, iTreeBuffer.Size());
 		//return KErrGeneral; not an issue, \n encoded differently by perforce... x0D x0A. (x0A only in generated ref file)
 		}
 		
@@ -177,8 +162,7 @@
 
 	if(ret!=KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CBASETESTCASE_COMPARECURRENTTREETOREF_DUP04, "refFile.Read fails %d", ret);
-		OstTraceFunctionExitExt( CBASETESTCASE_COMPARECURRENTTREETOREF_EXIT_DUP02, this, ret );
+		RDebug::Printf("refFile.Read fails %d", ret);
 		return ret;
 		}
 		
@@ -205,73 +189,66 @@
 		}
 	refBuf.Close();
 	
-	OstTrace1(TRACE_NORMAL, CBASETESTCASE_COMPARECURRENTTREETOREF_DUP05, "copyRefBuf.Size %d", copyRefBuf.Size());
+	RDebug::Printf("copyRefBuf.Size %d", copyRefBuf.Size());
 		
 
 	// check size is identical, should be identical now
 	if(copyRefBuf.Size() != iTreeBuffer.Size())
 		{		
-		OstTraceExt2(TRACE_NORMAL, CBASETESTCASE_COMPARECURRENTTREETOREF_DUP06, "sizes are NOT identical, copyRefBuf.Size() = %d, iTreeBuffer.Size() = %d ", refFileSize, iTreeBuffer.Size());
-		OstTraceFunctionExitExt( CBASETESTCASE_COMPARECURRENTTREETOREF_EXIT_DUP03, this, KErrGeneral );
+		RDebug::Printf("sizes are NOT identical, copyRefBuf.Size() = %d, iTreeBuffer.Size() = %d ", refFileSize, iTreeBuffer.Size());
 		return KErrGeneral;
 		}
 	
 	// now compare the 2 buffers		
     // Can only go as far as the smallest buffer
     TInt bufferSizeToCheck = Min(copyRefBuf.Size(), iTreeBuffer.Size());
-	OstTrace1(TRACE_NORMAL, CBASETESTCASE_COMPARECURRENTTREETOREF_DUP07, "bufferSizeToCheck = %d", bufferSizeToCheck);
+	RDebug::Print(_L("bufferSizeToCheck = %d"), bufferSizeToCheck);
 
 	aIsIdentical = ETrue;	
 	for(TInt iRefBuffer=0; iRefBuffer < bufferSizeToCheck; iRefBuffer++)
 		{
 		if(iTreeBuffer[iRefBuffer] != copyRefBuf[iRefBuffer])
 			{
-			OstTrace1(TRACE_NORMAL, CBASETESTCASE_COMPARECURRENTTREETOREF_DUP08, "Failed buffer comparison at position %d", iRefBuffer);
-            OstTraceExt4(TRACE_NORMAL, CBASETESTCASE_COMPARECURRENTTREETOREF_DUP09, "Missmatching chars (%d %d) (%c %c)", iTreeBuffer[iRefBuffer], copyRefBuf[iRefBuffer], iTreeBuffer[iRefBuffer], copyRefBuf[iRefBuffer]); 
+			RDebug::Print(_L("Failed buffer comparison at position %d"), iRefBuffer);
+            RDebug::Print(_L("Missmatching chars (%d %d) (%c %c)"), iTreeBuffer[iRefBuffer], copyRefBuf[iRefBuffer], iTreeBuffer[iRefBuffer], copyRefBuf[iRefBuffer]);
 			aIsIdentical = EFalse;
 			break;
 			}			 	 	 
 		}		
 
-	OstTrace1(TRACE_NORMAL, CBASETESTCASE_COMPARECURRENTTREETOREF_DUP10, "Finished Buffer comparison aIsIdentical=%d", aIsIdentical); 
+	RDebug::Print(_L("Finished Buffer comparison aIsIdentical=%d"), aIsIdentical); 
 
  	copyRefBuf.Close();
 	
-	OstTraceFunctionExitExt( CBASETESTCASE_COMPARECURRENTTREETOREF_EXIT_DUP04, this, KErrNone );
 	return KErrNone;	
 	}	
 
 CBaseTestCase::~CBaseTestCase()
 	{
-	OstTraceFunctionEntry1( CBASETESTCASE_CBASETESTCASE_ENTRY_DUP01, this );
+	LOG_FUNC
 	Cancel();
 	iTimer.Close();
 	iTreeBuffer.Close();
 	iFs.Close();
-	OstTraceFunctionExit1( CBASETESTCASE_CBASETESTCASE_EXIT_DUP01, this );
 	}
 
 void CBaseTestCase::SelfComplete()
 	{
-	OstTraceFunctionEntry1( CBASETESTCASE_SELFCOMPLETE_ENTRY, this );
 	SelfComplete(KErrNone);
-	OstTraceFunctionExit1( CBASETESTCASE_SELFCOMPLETE_EXIT, this );
 	}
 
 void CBaseTestCase::SelfComplete(TInt aError)
 	{
-	OstTraceFunctionEntryExt( CBASETESTCASE_SELFCOMPLETE_ENTRY_DUP01, this );
 	TRequestStatus* s = &iStatus;
 	iStatus = KRequestPending;
 	User::RequestComplete(s,aError);
 	SetActive();
-	OstTraceFunctionExit1( CBASETESTCASE_SELFCOMPLETE_EXIT_DUP01, this );
 	}
 
 
 void CBaseTestCase::DoCancel()
 	{
-	OstTraceFunctionEntry1( CBASETESTCASE_DOCANCEL_ENTRY, this );
+	LOG_FUNC
 	iTimer.Cancel();
 	if(iHost)
 		{
@@ -281,12 +258,10 @@
 		{
 		DeviceDoCancel();
 		}
-	OstTraceFunctionExit1( CBASETESTCASE_DOCANCEL_EXIT, this );
 	}
 
 void CBaseTestCase::RunL()
 	{
-	OstTraceFunctionEntry1( CBASETESTCASE_RUNL_ENTRY, this );
 	if(iHost)
 		{
 		HostRunL();
@@ -295,50 +270,39 @@
 		{
 		DeviceRunL();
 		}
-	OstTraceFunctionExit1( CBASETESTCASE_RUNL_EXIT, this );
 	}
 
 TInt CBaseTestCase::RunError(TInt aError)
 	{
-	OstTraceFunctionEntryExt( CBASETESTCASE_RUNERROR_ENTRY, this );
-	OstTraceExt2(TRACE_NORMAL, CBASETESTCASE_RUNERROR, "Test case C%lS::RunL left with %d",iTestCaseId,aError);
+	LOG_FUNC
+	RDebug::Printf("Test case C%lS::RunL left with %d",&iTestCaseId,aError);
 	iTestPolicy->SignalTestComplete(aError);
-	OstTraceFunctionExitExt( CBASETESTCASE_RUNERROR_EXIT, this, KErrNone );
 	return KErrNone;
 	}
 	
 TDesC& CBaseTestCase::TestCaseId()
 	{
-	OstTraceFunctionEntry1( CBASETESTCASE_TESTCASEID_ENTRY, this );
-	OstTraceFunctionExitExt( CBASETESTCASE_TESTCASEID_EXIT, this, ( TUint )&( iTestCaseId ) );
 	return iTestCaseId;
 	}
 	
 	
 TInt CBaseTestCase::TestResult() const
 	{
-	OstTraceFunctionEntry1( CBASETESTCASE_TESTRESULT_ENTRY, this );
-	OstTraceFunctionExitExt( CBASETESTCASE_TESTRESULT_EXIT, this, iTestResult );
 	return iTestResult;
 	}
 	
 TBool CBaseTestCase::IsHostOnly() const
 	{
-	OstTraceFunctionEntry1( CBASETESTCASE_ISHOSTONLY_ENTRY, this );
-	OstTraceFunctionExitExt( CBASETESTCASE_ISHOSTONLY_EXIT, this, iHostOnly );
 	return iHostOnly;
 	}
 		
 TBool CBaseTestCase::IsHost() const
 	{
-	OstTraceFunctionEntry1( CBASETESTCASE_ISHOST_ENTRY, this );
-	OstTraceFunctionExitExt( CBASETESTCASE_ISHOST_EXIT, this, iHost );
 	return iHost;
 	}
 		
 void CBaseTestCase::PerformTestL()
 	{
-	OstTraceFunctionEntry1( CBASETESTCASE_PERFORMTESTL_ENTRY, this );
 	
 	if(iHost)
 		{
@@ -349,44 +313,37 @@
 		{
 		ExecuteDeviceTestCaseL();
 		}	
-	OstTraceFunctionExit1( CBASETESTCASE_PERFORMTESTL_EXIT, this );
 	}
 
 void CBaseTestCase::SetTestPolicy(CBasicTestPolicy* aTestPolicy)
 	{
-	OstTraceFunctionEntryExt( CBASETESTCASE_SETTESTPOLICY_ENTRY, this );
 	iTestPolicy = aTestPolicy;
-	OstTraceFunctionExit1( CBASETESTCASE_SETTESTPOLICY_EXIT, this );
 	}
 
 void CBaseTestCase::TestFailed(TInt aFailResult)
 	{
-	OstTraceFunctionEntryExt( CBASETESTCASE_TESTFAILED_ENTRY, this );
+	LOG_FUNC
 	iTestResult = aFailResult;
 	if(!iHostOnly)
 		{
-		OstTrace0(TRACE_NORMAL, CBASETESTCASE_TESTFAILED, "CActiveScheduler::Stop CBaseTestCase::TestFailed");
+		RDebug::Printf("CActiveScheduler::Stop CBaseTestCase::TestFailed");
 		CActiveScheduler::Stop();
 		}		
-	OstTraceFunctionExit1( CBASETESTCASE_TESTFAILED_EXIT, this );
 	}
 	
 void CBaseTestCase::TestPassed()
 	{
-	OstTraceFunctionEntry1( CBASETESTCASE_TESTPASSED_ENTRY, this );
+	LOG_FUNC
 	iTestResult = KErrNone;	
 	if(!iHostOnly)
 		{
-		OstTrace0(TRACE_NORMAL, CBASETESTCASE_TESTPASSED, "CActiveScheduler::Stop CBaseTestCase::TestPassed");
+		RDebug::Printf("CActiveScheduler::Stop CBaseTestCase::TestPassed");
 		CActiveScheduler::Stop();
 		}
-	OstTraceFunctionExit1( CBASETESTCASE_TESTPASSED_EXIT, this );
 	}
 
 CBasicTestPolicy& CBaseTestCase::TestPolicy()
 	{
-	OstTraceFunctionEntry1( CBASETESTCASE_TESTPOLICY_ENTRY, this );
-	OstTraceFunctionExit1( CBASETESTCASE_TESTPOLICY_EXIT, this );
 	return *iTestPolicy;
 	}
 	
@@ -400,7 +357,7 @@
 TInt CBaseTestCase::GetEndpointAddress(RUsbInterface& aUsbInterface,TInt aInterfaceSetting,
 		TUint8 aTransferType,TUint8 aDirection,TInt& aEndpointAddress)
 	{
-	OstTraceFunctionEntryExt( CBASETESTCASE_GETENDPOINTADDRESS_ENTRY, this );
+	LOG_FUNC
 	
 	return GetEndpointAddress(aUsbInterface, aInterfaceSetting, aTransferType, aDirection, 0, aEndpointAddress);
 	}
@@ -413,48 +370,46 @@
 TInt CBaseTestCase::GetEndpointAddress(RUsbInterface& aUsbInterface,TInt aInterfaceSetting,
 		TUint8 aTransferType,TUint8 aDirection,TUint8 aIndex,TInt& aEndpointAddress)
 	{
-		OstTraceFunctionEntryExt( CBASETESTCASE_GETENDPOINTADDRESS_ENTRY_DUP01, this );
+	LOG_FUNC
 		
 	// Get the interface descriptor
-	OstTrace0(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS, "Getting the interface descriptor for this alternate setting");
+	RDebug::Printf("Getting the interface descriptor for this alternate setting");
 
 	TUsbInterfaceDescriptor alternateInterfaceDescriptor;
 	TInt err = aUsbInterface.GetAlternateInterfaceDescriptor(aInterfaceSetting, alternateInterfaceDescriptor);
 
 	if(err)
 		{
-		OstTraceExt2(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP01, "<Error %d> Unable to get alternate interface (%d) descriptor",err,aInterfaceSetting);
-		OstTraceFunctionExitExt( CBASETESTCASE_GETENDPOINTADDRESS_EXIT, this, err );
+		RDebug::Printf("<Error %d> Unable to get alternate interface (%d) descriptor",err,aInterfaceSetting);
 		return err;
 		}
 
 	// Parse the descriptor tree from the interface 	
-	OstTrace0(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP02, "Search the child descriptors for matching endpoint attributes");
+	RDebug::Printf("Search the child descriptors for matching endpoint attributes");
 	
 	TUsbGenericDescriptor* descriptor = alternateInterfaceDescriptor.iFirstChild;
 	TUint8 indexCount = 0;
 	while(descriptor)
 		{
-		OstTrace0(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP03, "Check descriptor type for endpoint");
+		RDebug::Printf("Check descriptor type for endpoint");
 
 		// Cast the descriptor to an endpoint descriptor
 		TUsbEndpointDescriptor* endpoint = TUsbEndpointDescriptor::Cast(descriptor);
 		
 		if(endpoint)
 			{
-			OstTrace0(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP04, "Match attributes for transfer type");
+			RDebug::Printf("Match attributes for transfer type");
 			
 			if( (endpoint->Attributes() & aTransferType) == aTransferType)
 				{
-				OstTrace0(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP05, "Match attributes for endpoint direction");
+				RDebug::Printf("Match attributes for endpoint direction");
 				
 				if( (endpoint->EndpointAddress() & aDirection) == aDirection) 
 					{
 					if(indexCount==aIndex)
 						{
 						aEndpointAddress = endpoint->EndpointAddress();
-						OstTrace0(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP06, "Endpoint address found");
-						OstTraceFunctionExitExt( CBASETESTCASE_GETENDPOINTADDRESS_EXIT_DUP01, this, KErrNone );
+						RDebug::Printf("Endpoint address found");
 						return KErrNone;
 						}
 					else
@@ -469,25 +424,21 @@
 		}
 
 	// Unable to find the endpoint address	
-	OstTrace0(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP07, "Unable to find endpoint address matching the specified attributes");
+	RDebug::Printf("Unable to find endpoint address matching the specified attributes");
 	
-	OstTraceFunctionExitExt( CBASETESTCASE_GETENDPOINTADDRESS_EXIT_DUP02, this, KErrNotFound );
 	return KErrNotFound;
 	}
 	
 /*static*/ void CBaseTestCase::LogWithCondAndInfo(const TDesC& aCondition, const TDesC& aFileName, TInt aLine)
 	{
-	OstTraceFunctionEntryExt( CBASETESTCASE_LOGWITHCONDANDINFO_ENTRY, 0 );
 	TBuf<256> buf;
  	buf.Format(KFailText, &aCondition, &aFileName, aLine);
- 	OstTrace0(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP08, buf);
- 	OstTraceFunctionExit1( CBASETESTCASE_LOGWITHCONDANDINFO_EXIT, 0 );
+ 	RDebug::Print(buf); 
  	} 	
  
   	
 /*static*/ void CBaseTestCase::PrintAndStoreTree(TUsbGenericDescriptor& aDesc, TInt aDepth)
 	{ 
-	OstTraceFunctionEntryExt( CBASETESTCASE_PRINTANDSTORETREE_ENTRY, 0 );
 	
 	TBuf8<20> buf;	
 	for(TInt depth=aDepth;depth>=0;--depth)
@@ -500,12 +451,12 @@
 	unicodeBuf.Copy(buf);	// Ideally this needs conversion to UNICODE
 	if(aDesc.iRecognisedAndParsed == TUsbGenericDescriptor::ERecognised)
 		{ 
-		OstTraceExt3(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP09, "%s+ length=%u, type=0x%02x", unicodeBuf, aDesc.ibLength, (TUint32)aDesc.ibDescriptorType);
+		RDebug::Printf("%S+ length=%d, type=0x%02x", &unicodeBuf, aDesc.ibLength, aDesc.ibDescriptorType);
    		iTreeBuffer.AppendFormat(_L8("%S+ length=%d, type=0x%02x\n"), &buf, aDesc.ibLength, aDesc.ibDescriptorType);		
 		}
 	else
 		{
-		OstTraceExt3(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP10, "%s- length=%u, type=0x%02x", unicodeBuf, aDesc.ibLength, (TUint32)aDesc.ibDescriptorType);
+		RDebug::Printf("%S- length=%d, type=0x%02x", &unicodeBuf, aDesc.ibLength, aDesc.ibDescriptorType);
 		iTreeBuffer.AppendFormat(_L8("%S- length=%d, type=0x%02x\n"), &buf, aDesc.ibLength, aDesc.ibDescriptorType);
 		} 		
 
@@ -513,24 +464,22 @@
 		
 		if(aDesc.iFirstChild)    
 		{
-		OstTraceExt1(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP11, "%s \n", unicodeBuf);
+		RDebug::Printf("%S \\ ", &unicodeBuf);
 		iTreeBuffer.AppendFormat(_L8("%S \\ \n"), &buf);		
 		
 		PrintAndStoreTree(*(aDesc.iFirstChild), aDepth+1);		
 	
-		OstTraceExt1(TRACE_NORMAL, CBASETESTCASE_GETENDPOINTADDRESS_DUP12, "%s \n", unicodeBuf);
+		RDebug::Printf("%S / ", &unicodeBuf);
 		iTreeBuffer.AppendFormat(_L8("%S / \n"), &buf);
 		}
 	if(aDesc.iNextPeer)
 		{
 		PrintAndStoreTree(*(aDesc.iNextPeer), aDepth);
 		}		
-	OstTraceFunctionExit1( CBASETESTCASE_PRINTANDSTORETREE_EXIT, 0 );
 	} 
 	   
 void CBaseTestCase::PrintAndStoreBlob(TDes8& aBuf, TPtrC8& aBlob)
 	{
-	OstTraceFunctionEntryExt( CBASETESTCASE_PRINTANDSTOREBLOB_ENTRY, this );
 	
 	HBufC8* chunk = HBufC8::New(KChunkSize);
 	
@@ -555,12 +504,10 @@
 		PrintAndStoreChunk(chunk, remainderSize ,aBlob,offset, i ,aBuf);				
 		}
 	delete chunk;
-	OstTraceFunctionExit1( CBASETESTCASE_PRINTANDSTOREBLOB_EXIT, this );
 	} 
 	
 void CBaseTestCase::PrintAndStoreChunk(HBufC8* aChunk, TUint aSize, TPtrC8& aBlob, TUint aOffset, TUint aIter, TDes8& aBuf)
 	{	
-	OstTraceFunctionEntryExt( CBASETESTCASE_PRINTANDSTORECHUNK_ENTRY, this );
 	for(TInt i=0;i<aSize;++i)
 		{
 		aChunk->Des().AppendFormat(_L8("%02x"), aBlob[i+aOffset]);
@@ -573,21 +520,20 @@
 			
 	if(aIter ==0)
 		{		
-		OstTraceExt2(TRACE_NORMAL, CBASETESTCASE_PRINTANDSTORECHUNK, "%S >%S", unicodeBuf, unicodeChunk);					
+		RDebug::Printf("%S >%S", &unicodeBuf, &unicodeChunk);					
 		iTreeBuffer.AppendFormat(_L8("%S >%S\n"), &aBuf, aChunk);	
 		}
 	else
 		{	
-		OstTraceExt2(TRACE_NORMAL, CBASETESTCASE_PRINTANDSTORECHUNK_DUP01, "%S  %S\n", unicodeBuf, unicodeChunk); 
+		RDebug::Printf("%S  %S\n", &unicodeBuf, &unicodeChunk); 
 		iTreeBuffer.AppendFormat(_L8("%S  %S\n"), &aBuf, aChunk);
 		}
 	aChunk->Des().Zero();		
-	OstTraceFunctionExit1( CBASETESTCASE_PRINTANDSTORECHUNK_EXIT, this );
 	}	
 	
 TInt CBaseTestCase::CheckTree(TUsbGenericDescriptor& aDevDesc, TUsbGenericDescriptor& aConfigDesc, const TDesC& aFileName)
 	{
-	OstTraceFunctionEntryExt( CBASETESTCASE_CHECKTREE_ENTRY, this );
+	LOG_FUNC
 	TInt ret = KErrNone;
 	
 	// flush buffer
@@ -606,37 +552,34 @@
 	TBool isIdentical;
 	if(KErrNone != CompareCurrentTreeToRef(aFileName, isIdentical))
 		{ 
-		OstTrace0(TRACE_NORMAL, CBASETESTCASE_CHECKTREE, "CompareCurrentTreeToRef error");
+		RDebug::Printf("CompareCurrentTreeToRef error"); 
 		ret = KErrGeneral;
 		}	
 	if(!isIdentical)
 		{ 
-		OstTrace0(TRACE_NORMAL, CBASETESTCASE_CHECKTREE_DUP01, "!isIdentical");
+		RDebug::Printf("!isIdentical"); 
 		ret = KErrGeneral;
 		}
-	OstTraceFunctionExitExt( CBASETESTCASE_CHECKTREE_EXIT, this, ret );
 	return ret;
 	}
 	
 	
 TInt CBaseTestCase::ParseConfigDescriptorAndCheckTree(TUsbDeviceDescriptor *devDesc, const TDesC8& configSet, TUint indexTest)
 	{
-	OstTraceFunctionEntryExt( CBASETESTCASE_PARSECONFIGDESCRIPTORANDCHECKTREE_ENTRY, this );
+	LOG_FUNC
 	// Parse config. descriptor
 	TUsbGenericDescriptor* parsed = NULL;
 	TInt err = UsbDescriptorParser::Parse(configSet, parsed);
 	if(err != KErrNone)
 		{
-		OstTrace0(TRACE_NORMAL, CBASETESTCASE_PARSECONFIGDESCRIPTORANDCHECKTREE, "parsing error : UsbDescriptorParser::Parse");
-		OstTraceFunctionExitExt( CBASETESTCASE_PARSECONFIGDESCRIPTORANDCHECKTREE_EXIT, this, err );
+		RDebug::Printf("parsing error : UsbDescriptorParser::Parse"); 
 		return err;
 		}
 	TUsbConfigurationDescriptor* configDesc = TUsbConfigurationDescriptor::Cast(parsed);
 	// checks 
 	if(configDesc == 0)
 		{
-		OstTrace0(TRACE_NORMAL, CBASETESTCASE_PARSECONFIGDESCRIPTORANDCHECKTREE_DUP01, "configDesc == 0");
-		OstTraceFunctionExitExt( CBASETESTCASE_PARSECONFIGDESCRIPTORANDCHECKTREE_EXIT_DUP01, this, KErrGeneral );
+		RDebug::Printf("configDesc == 0");
 		return KErrGeneral; 
 		}
 		
@@ -648,7 +591,7 @@
 	
 TInt CBaseTestCase::CheckTreeAfterDeviceInsertion(CUsbTestDevice& aTestDevice, const TDesC& aFileName)
 	{
-	OstTraceFunctionEntryExt( CBASETESTCASE_CHECKTREEAFTERDEVICEINSERTION_ENTRY, this );
+	LOG_FUNC
 	TUsbGenericDescriptor deviceDesc = aTestDevice.DeviceDescriptor();
 	TUsbGenericDescriptor configDesc = aTestDevice.ConfigurationDescriptor();	
 	return CheckTree(deviceDesc, configDesc, aFileName); 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/BasicWatcher.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/BasicWatcher.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,10 +18,6 @@
 
 #include "BasicWatcher.h"
 #include "testdebug.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "BasicWatcherTraces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -31,58 +27,51 @@
 	iCallBack(aCallBack),
 	iCompletionCode(KErrNone)
 	{
-	OstTraceFunctionEntryExt( CBASICWATCHER_CBASICWATCHER_ENTRY, this );
 	CActiveScheduler::Add(this);
-	OstTraceFunctionExit1( CBASICWATCHER_CBASICWATCHER_EXIT, this );
 	}
 	
 CBasicWatcher::~CBasicWatcher()
 	{
-    OstTraceFunctionEntry1( CBASICWATCHER_CBASICWATCHER_ENTRY_DUP01, this );
+	LOG_FUNC
 
 	Cancel();
-	OstTraceFunctionExit1( CBASICWATCHER_CBASICWATCHER_EXIT_DUP01, this );
 	}
 
 void CBasicWatcher::DoCancel()
 	{
-    OstTraceFunctionEntry1( CBASICWATCHER_DOCANCEL_ENTRY, this );
+	LOG_FUNC
 
-	OstTrace0(TRACE_NORMAL, CBASICWATCHER_DOCANCEL, "Watch cancelled");
+	RDebug::Printf("Watch cancelled");
 	iStatus = KErrCancel;
-	OstTraceFunctionExit1( CBASICWATCHER_DOCANCEL_EXIT, this );
 	}
 
 
 void CBasicWatcher::StartWatching()
 	{
-    OstTraceFunctionEntry1( CBASICWATCHER_STARTWATCHING_ENTRY, this );
+	LOG_FUNC
 
 	if(iStatus != KRequestPending)
 		{
 		User::Panic(_L("iStatus has not been set to pending this will lead to E32USER-CBase Panic"),46);
 		}
 	SetActive();
-	OstTraceFunctionExit1( CBASICWATCHER_STARTWATCHING_EXIT, this );
 	}
 
 
 void CBasicWatcher::RunL()
 	{
-    OstTraceFunctionEntry1( CBASICWATCHER_RUNL_ENTRY, this );
+	LOG_FUNC
 
 	iCompletionCode = iStatus.Int();
 	User::LeaveIfError(iCallBack.CallBack());
-	OstTraceFunctionExit1( CBASICWATCHER_RUNL_EXIT, this );
 	}
 
 
 TInt CBasicWatcher::RunError(TInt aError)
 	{
-    OstTraceFunctionEntryExt( CBASICWATCHER_RUNERROR_ENTRY, this );
+	LOG_FUNC
 
-	OstTrace1(TRACE_NORMAL, CBASICWATCHER_RUNERROR, "Watcher code Left with %d",aError);
-	OstTraceFunctionExitExt( CBASICWATCHER_RUNERROR_EXIT, this, KErrNone );
+	RDebug::Printf("Watcher code Left with %d",aError);
 	return KErrNone;
 	}
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/Ep0Reader.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/Ep0Reader.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -16,36 +16,28 @@
 
 #include "Ep0Reader.h"
 #include "testdebug.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "Ep0ReaderTraces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{
 	
 CDeviceEndpoint0* CDeviceEndpoint0::NewL(MRequestHandler& aRequestHandler)
 	{
-	OstTraceFunctionEntry1( CDEVICEENDPOINT0_NEWL_ENTRY, ( TUint )&( aRequestHandler ) );
 	CDeviceEndpoint0* self = new (ELeave) CDeviceEndpoint0();
 	CleanupStack::PushL(self);
 	self->ConstructL(aRequestHandler);
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CDEVICEENDPOINT0_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
 	
 CDeviceEndpoint0::CDeviceEndpoint0()
 	{
-	OstTraceFunctionEntry1( CDEVICEENDPOINT0_CDEVICEENDPOINT0_ENTRY, this );
-	OstTraceFunctionExit1( CDEVICEENDPOINT0_CDEVICEENDPOINT0_EXIT, this );
 	}	
 	
 	
 CDeviceEndpoint0::~CDeviceEndpoint0()
 	{
-    OstTraceFunctionEntry1( CDEVICEENDPOINT0_CDEVICEENDPOINT0_ENTRY_DUP01, this );
+	LOG_FUNC
 
 	// Destroy the reader/writer
 	delete iEndpoint0Writer; 
@@ -53,17 +45,16 @@
 	
 	// Close channel to the driver
 	iClientDriver.Close();
-	OstTraceFunctionExit1( CDEVICEENDPOINT0_CDEVICEENDPOINT0_EXIT_DUP01, this );
 	}
 	
 	
 void CDeviceEndpoint0::ConstructL(MRequestHandler& aRequestHandler)
 	{
-	OstTraceFunctionEntryExt( CDEVICEENDPOINT0_CONSTRUCTL_ENTRY, this );
+	LOG_FUNC
 	TInt err(iClientDriver.Open(0));
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CDEVICEENDPOINT0_CONSTRUCTL, "<Error %d> Unable to open a channel to USB client driver",err);
+		RDebug::Printf("<Error %d> Unable to open a channel to USB client driver",err);
 		User::Leave(err);
 		}
 	
@@ -72,13 +63,12 @@
 	
 	// Create the writer of data on device endpoint 0
 	iEndpoint0Writer = new (ELeave) CEndpointWriter(iClientDriver,EEndpoint0);
-	OstTraceFunctionExit1( CDEVICEENDPOINT0_CONSTRUCTL_EXIT, this );
 	}
 
 	
 TInt CDeviceEndpoint0::Start()
 	{
-	OstTraceFunctionEntry1( CDEVICEENDPOINT0_START_ENTRY, this );
+	LOG_FUNC
 	
 	// Make this channel to the driver able to get device directed ep0 requests
 	TInt err(iClientDriver.SetDeviceControl());
@@ -86,22 +76,20 @@
 	// Check operation success
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CDEVICEENDPOINT0_START, "<Error %d> Unable to obtain device control",err);
-		OstTraceFunctionExitExt( CDEVICEENDPOINT0_START_EXIT, this, err );
+		RDebug::Printf("<Error %d> Unable to obtain device control",err);
 		return err;
 		}
 		
 	// Start reading for requests from host
 	TRAP(err,iEndpoint0Reader->ReadRequestsL());
 	
-	OstTraceFunctionExitExt( CDEVICEENDPOINT0_START_EXIT_DUP01, this, err );
 	return err;
 	}
 
 
 TInt CDeviceEndpoint0::Stop()
 	{
-	OstTraceFunctionEntry1( CDEVICEENDPOINT0_STOP_ENTRY, this );
+	LOG_FUNC
 	// Cancel the data reader and writer
 	iEndpoint0Writer->Cancel();
 	iEndpoint0Reader->Cancel();
@@ -110,32 +98,26 @@
 	TInt err(iClientDriver.ReleaseDeviceControl());
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CDEVICEENDPOINT0_STOP, "<Error %d> Unable to release device control",err);
+		RDebug::Printf("<Error %d> Unable to release device control",err);
 		}
-	OstTraceFunctionExitExt( CDEVICEENDPOINT0_STOP_EXIT, this, err );
 	return err;
 	}
 
 
 void CDeviceEndpoint0::SendData(const TDesC8& aData)
 	{
-	OstTraceFunctionEntryExt( CDEVICEENDPOINT0_SENDDATA_ENTRY, this );
+	LOG_FUNC
 	iEndpoint0Writer->Write(aData, ETrue);
-	OstTraceFunctionExit1( CDEVICEENDPOINT0_SENDDATA_EXIT, this );
 	}
 
 TInt CDeviceEndpoint0::SendDataSynchronous(const TDesC8& aData)
 	{
-	OstTraceFunctionEntryExt( CDEVICEENDPOINT0_SENDDATASYNCHRONOUS_ENTRY, this );
-	TInt ret = iEndpoint0Writer->WriteSynchronous(aData, ETrue);
-	OstTraceFunctionExit1( CDEVICEENDPOINT0_SENDDATASYNCHRONOUS_EXIT, this );
-	return ret;
+	LOG_FUNC
+	return iEndpoint0Writer->WriteSynchronous(aData, ETrue);
 	}
 
 CControlEndpointReader& CDeviceEndpoint0::Reader()
 	{
-	OstTraceFunctionEntry1( CDEVICEENDPOINT0_READER_ENTRY, this );
-	OstTraceFunctionExit1( CDEVICEENDPOINT0_READER_EXIT, this );
 	return *iEndpoint0Reader;
 	}
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/FDFActor.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/FDFActor.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -21,10 +21,6 @@
 #include <Usb.h>
 #include "UsbDescriptorOffsets.h"
 #include "BaseTestCase.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "FDFActorTraces.h"
-#endif
 #include <e32property.h>
 
 extern RTest gtest;
@@ -38,12 +34,10 @@
 
 CActorFDF* CActorFDF::NewL(MUsbBusObserver& aObserver)
 	{
-	OstTraceFunctionEntry1( CACTORFDF_NEWL_ENTRY, ( TUint )&( aObserver ) );
 	CActorFDF* self = new (ELeave) CActorFDF(aObserver);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CACTORFDF_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 
@@ -52,24 +46,22 @@
 :	CActive(EPriorityStandard),
 	iObserver(aObserver)
 	{
-	OstTraceFunctionEntryExt( CACTORFDF_CACTORFDF_ENTRY, this );
-	OstTraceFunctionExit1( CACTORFDF_CACTORFDF_EXIT, this );
 	}
 
 
 void CActorFDF::ConstructL()
 	{
-	OstTraceFunctionEntry1( CACTORFDF_CONSTRUCTL_ENTRY, this );
+	LOG_FUNC
 	CActiveScheduler::Add(this);
 	
 	TInt err(iDriver.Open());
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CACTORFDF_CONSTRUCTL, "<Error %d> Unable to open driver channel",err);
+		RDebug::Printf("<Error %d> Unable to open driver channel",err);
 		User::Leave(err);
 		}		
 	
-	OstTrace0(TRACE_NORMAL, CACTORFDF_CONSTRUCTL_DUP01, "PBASE-T_USBDI-xxxx: Stack starting");
+	RDebug::Printf("PBASE-T_USBDI-xxxx: Stack starting");
 	/*
 	@SYMTestCaseID				PBASE-T_USBDI-xxxx
 	@SYMTestCaseDesc			Test for host stack initiation
@@ -86,15 +78,15 @@
 	if(err != KErrNone)
 		{
 		// Test case did not run successfully
-		OstTrace1(TRACE_NORMAL, CACTORFDF_CONSTRUCTL_DUP02, "<Error %d> USB Host stack not starting",err);		
+		RDebug::Printf("<Error %d> USB Host stack not starting",err);		
 		gtest(EFalse);
 		}
 	  
-	OstTrace0(TRACE_NORMAL, CACTORFDF_CONSTRUCTL_DUP03, "starting t_usbhost_usbman.exe");
+	RDebug::Printf("starting t_usbhost_usbman.exe");
 	TInt r = iOtgUsbMan.Create(_L("t_usbhost_usbman.exe"), KNullDesC); //LIT does not seem to work here
 	if(r != KErrNone && r != KErrAlreadyExists)
 		{
-  		OstTrace0(TRACE_NORMAL, CACTORFDF_CONSTRUCTL_DUP04, "can't start t_usbhost_usbman.exe");
+  		RDebug::Printf("can't start t_usbhost_usbman.exe");
 		gtest(EFalse);
 		}
 	
@@ -104,28 +96,25 @@
     r = RProperty::Define(KWordOfDeathCat, KWordOfDeathKey, RProperty::EInt,KAllowAllPolicy, KAllowAllPolicy, 0);
 	if(r != KErrNone && r != KErrAlreadyExists)
         {
-        OstTrace1(TRACE_NORMAL, CACTORFDF_CONSTRUCTL_DUP05, "Could not create the WordOfDeath P&S   (%d)", r);
+        RDebug::Printf("Could not create the WordOfDeath P&S   (%d)", r);
  		gtest(EFalse);
         }
 
 	iOtgUsbMan.Resume();	
 	
 	User::After(1500000); //allow time for t_usbhost_usbman.exe to start	
-	OstTraceFunctionExit1( CACTORFDF_CONSTRUCTL_EXIT, this );
 	}
 
 void KillTest()
 	{
-	OstTraceFunctionEntry0( _KILLTEST_ENTRY );
-	OstTrace0(TRACE_NORMAL, KILLTEST_KILLTEST, "BEFORE gtest(EFalse)");
+	RDebug::Printf("BEFORE gtest(EFalse)");
 	gtest(EFalse);
-	OstTrace0(TRACE_NORMAL, KILLTEST_KILLTEST_DUP01, "AFTER gtest(EFalse)");
-	OstTraceFunctionExit0( _KILLTEST_EXIT );
+	RDebug::Printf("AFTER gtest(EFalse)");
 	}
 
 CActorFDF::~CActorFDF()
 	{
-	OstTraceFunctionEntry1( CACTORFDF_CACTORFDF_ENTRY_DUP01, this );
+	LOG_FUNC
 	Cancel();
 	
 	// Destroy all test device objects that represented connected devices
@@ -137,11 +126,11 @@
 		delete *it.NextValue();
 		}
 
-	OstTrace0(TRACE_NORMAL, CACTORFDF_DCACTORFDF, "killing t_usbhost_usbman.exe");
+	RDebug::Printf("killing t_usbhost_usbman.exe");
 	TInt r = RProperty::Set(KWordOfDeathCat, KWordOfDeathKey, KErrAbort);   // Send the word of death
     if(r != KErrNone)
         {
-        OstTrace1(TRACE_NORMAL, CACTORFDF_DCACTORFDF_DUP01, "failed to kill t_usbhost-usbhan  (%d)", r);      
+        RDebug::Printf("failed to kill t_usbhost-usbhan  (%d)", r);      
 		RProperty::Delete(KWordOfDeathCat, KWordOfDeathKey); //try to clean this up ready for next test
 		User::After(1000000); //allow time for property to clean up
 		gtest(EFalse);
@@ -150,7 +139,7 @@
 
 	// Stop the USB Hub driver
 		
-	OstTrace0(TRACE_NORMAL, CACTORFDF_DCACTORFDF_DUP02, "UT-USBD-P1782-TN0001: Hub driver stopping...");
+	RDebug::Printf("UT-USBD-P1782-TN0001: Hub driver stopping...");
 
 	// Close the channel to the USB Hub driver	
 	iDriver.Close();	
@@ -168,58 +157,54 @@
 			//give up
 			{
 			User::After(1000000); //allow time for property to clean up JUST IN CASE it can despite returning an error!
-	        OstTrace1(TRACE_NORMAL, CACTORFDF_DCACTORFDF_DUP03, "failed to delete wordofdeath P&S  (%d)", r);
+	        RDebug::Printf("failed to delete wordofdeath P&S  (%d)", r);
 			gtest(EFalse);
 			}
         }
 
-	OstTraceFunctionExit1( CACTORFDF_CACTORFDF_EXIT_DUP01, this );
 	}
 	
 void CActorFDF::DoCancel()
 	{
-OstTraceFunctionEntry1( CACTORFDF_DOCANCEL_ENTRY, this );
+	LOG_FUNC
 
 
-	OstTrace0(TRACE_NORMAL, CACTORFDF_DOCANCEL, "Cancelling bus event notifications");
+	RDebug::Printf("Cancelling bus event notifications");
 	iDriver.CancelWaitForBusEvent();
 	gtest((iStatus == KErrCancel) || (iStatus == KErrNone));	
-	OstTrace0(TRACE_NORMAL, CACTORFDF_DOCANCEL_DUP01, "Bus event notifications successfully cancelled");
-	OstTraceFunctionExit1( CACTORFDF_DOCANCEL_EXIT, this );
+	RDebug::Printf("Bus event notifications successfully cancelled");	
 	}
 	
 void CActorFDF::Monitor()
 	{
-OstTraceFunctionEntry1( CACTORFDF_MONITOR_ENTRY, this );
+	LOG_FUNC
 
-	OstTrace0(TRACE_NORMAL, CACTORFDF_MONITOR, "Monitoring bus events");
+	RDebug::Printf("Monitoring bus events");
 	iDriver.WaitForBusEvent(iBusEvent,iStatus);
 	SetActive();
-	OstTraceFunctionExit1( CACTORFDF_MONITOR_EXIT, this );
 	}
 	
 	
 			
 CUsbTestDevice& CActorFDF::DeviceL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CACTORFDF_DEVICEL_ENTRY, this );
 	return *iDevices.FindL(aDeviceHandle);
 	}
 	
 void CActorFDF::RunL()
 	{
-OstTraceFunctionEntry1( CACTORFDF_RUNL_ENTRY, this );
+	LOG_FUNC
 
 	// Obtain completion code
 	TInt completionCode(iStatus.Int());
-	OstTrace1(TRACE_NORMAL, CACTORFDF_RUNL, "Completion code  : %d",completionCode);
+	RDebug::Printf("Completion code  : %d",completionCode);
 	
 	 if(completionCode == KErrNone)
 		{
 		if(iBusEvent.iEventType == RUsbHubDriver::TBusEvent::EDeviceAttached)
 			{
 			// Device Attached
-			OstTrace1(TRACE_NORMAL, CACTORFDF_RUNL_DUP01, "Usb device attached: %d",iBusEvent.iDeviceHandle);
+			RDebug::Printf("Usb device attached: %d",iBusEvent.iDeviceHandle);
 			
 			// Create the test device object
 			iDevices.InsertL(iBusEvent.iDeviceHandle,CUsbTestDevice::NewL(iDriver,iBusEvent.iDeviceHandle,iObserver));
@@ -230,7 +215,7 @@
 		else if(iBusEvent.iEventType == RUsbHubDriver::TBusEvent::EDeviceRemoved)
 			{
 			// Device Removed
-			OstTrace1(TRACE_NORMAL, CACTORFDF_RUNL_DUP02, "Usb device removed: %d",iBusEvent.iDeviceHandle);
+			RDebug::Printf("Usb device removed: %d",iBusEvent.iDeviceHandle);
 			
 			// Notify observer
 			iObserver.DeviceRemovedL(iBusEvent.iDeviceHandle);
@@ -242,26 +227,24 @@
 		else
 			{
 			// TODO: Upcall for USB Man etc
-			OstTraceExt2(TRACE_NORMAL, CACTORFDF_RUNL_DUP03, "<Warning> Bus event %d occured, still monitoring, reason = %d",iBusEvent.iEventType, iBusEvent.iReason);
+			RDebug::Printf("<Warning> Bus event %d occured, still monitoring, reason = %d",iBusEvent.iEventType, iBusEvent.iReason);
 			iDriver.WaitForBusEvent(iBusEvent,iStatus);
 			SetActive();
 			}
 		}
 	else
 		{
-		OstTraceExt2(TRACE_NORMAL, CACTORFDF_RUNL_DUP04, "<Error %d> Bus event %d",completionCode,iBusEvent.iEventType);
+		RDebug::Printf("<Error %d> Bus event %d",completionCode,iBusEvent.iEventType);
 		iObserver.BusErrorL(completionCode);
 		}
-	OstTraceFunctionExit1( CACTORFDF_RUNL_EXIT, this );
 	}
 	
 
 TInt CActorFDF::RunError(TInt aError)
 	{
-OstTraceFunctionEntryExt( CACTORFDF_RUNERROR_ENTRY, this );
+	LOG_FUNC
 
-	OstTrace1(TRACE_NORMAL, CACTORFDF_RUNERROR, "<Error %d> CActorFDF::RunError",aError);
-	OstTraceFunctionExitExt( CACTORFDF_RUNERROR_EXIT, this, KErrNone );
+	RDebug::Printf("<Error %d> CActorFDF::RunError",aError);
 	return KErrNone;
 	}
 	
@@ -277,12 +260,10 @@
 	
 CUsbTestDevice* CUsbTestDevice::NewL(RUsbHubDriver& aHubDriver,TUint aDeviceHandle,MUsbBusObserver& aObserver)
 	{
-	OstTraceFunctionEntryExt( CUSBTESTDEVICE_NEWL_ENTRY, 0 );
 	CUsbTestDevice* self = new (ELeave) CUsbTestDevice(aHubDriver,aDeviceHandle,aObserver);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUSBTESTDEVICE_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -292,23 +273,21 @@
 	iHandle(aHandle),
 	iObserver(aObserver)
 	{
-OstTraceFunctionEntryExt( CUSBTESTDEVICE_CUSBTESTDEVICE_ENTRY, this );
+	LOG_FUNC
 
 	CActiveScheduler::Add(this);
-	OstTraceFunctionExit1( CUSBTESTDEVICE_CUSBTESTDEVICE_EXIT, this );
 	}
 	
 CUsbTestDevice::~CUsbTestDevice()
 	{
-	OstTraceFunctionEntry1( CUSBTESTDEVICE_CUSBTESTDEVICE_ENTRY_DUP01, this );
+	LOG_FUNC
 	Cancel();
 	iDevice.Close();
-	OstTraceFunctionExit1( CUSBTESTDEVICE_CUSBTESTDEVICE_EXIT_DUP01, this );
 	}
 	
 void CUsbTestDevice::ConstructL()
 	{
-OstTraceFunctionEntry1( CUSBTESTDEVICE_CONSTRUCTL_ENTRY, this );
+	LOG_FUNC
 
 	// Open the usb device object
 	User::LeaveIfError(iDevice.Open(iDriver,iHandle));
@@ -316,14 +295,14 @@
 	TInt err(iDevice.GetDeviceDescriptor(iDeviceDescriptor));
 	if(err != KErrNone)
 		{
-		OstTraceExt2(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL, "<Error %d> Getting device (%u) descriptor",err,iHandle);
+		RDebug::Printf("<Error %d> Getting device (%d) descriptor",err,iHandle);
 		User::Leave(err);
 		}
 	
 	err = iDevice.GetConfigurationDescriptor(iConfigDescriptor);
 	if(err != KErrNone)
 		{
-		OstTraceExt2(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP01, "<Error %d> Getting device (%u) configuration descriptor",err,iHandle);
+		RDebug::Printf("<Error %d> Getting device (%d) configuration descriptor",err,iHandle);
 		User::Leave(err);
 		}
 
@@ -331,16 +310,16 @@
 	iPid = iDeviceDescriptor.ProductId();
 	iVid = iDeviceDescriptor.VendorId();
 	
-	OstTrace1(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP02, "%dmA configuration maximum power consumption",iConfigDescriptor.MaxPower()*2);
-	OstTrace1(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP03, "%d number of interface(s)",iConfigDescriptor.NumInterfaces());
-	OstTraceExt2(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP04, "Product Id=0x%04x, Vendor Id=0x%04x",(TUint32)iPid,(TUint32)iVid);
-	OstTrace1(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP05, "TotalLength() = %d",iConfigDescriptor.TotalLength());
+	RDebug::Printf("%dmA configuration maximum power consumption",iConfigDescriptor.MaxPower()*2);
+	RDebug::Printf("%d number of interface(s)",iConfigDescriptor.NumInterfaces());
+	RDebug::Printf("Product Id=0x%04x, Vendor Id=0x%04x",iPid,iVid);
+	RDebug::Printf("TotalLength() = %d",iConfigDescriptor.TotalLength());
 
 	// The manufacturer string
 	err = iDevice.GetStringDescriptor(iManufacturerStringDesc,iManufacturerStringData,iDeviceDescriptor.ManufacturerIndex());
 	if(err != KErrNone)
 		{
-		OstTraceExt2(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP06, "<Error %d> Getting device (%u) manufacturer string descriptor",err,iHandle);
+		RDebug::Printf("<Error %d> Getting device (%d) manufacturer string descriptor",err,iHandle);
 		User::Leave(err);
 		}
 	iManufacturerStringDesc->StringData(iManufacturerString);
@@ -349,7 +328,7 @@
 	err = iDevice.GetStringDescriptor(iProductStringDesc,iProductStringData,iDeviceDescriptor.ProductIndex());
 	if(err != KErrNone)
 		{
-		OstTraceExt2(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP07, "<Error %d> Getting device (%u) product string descriptor",err,iHandle);
+		RDebug::Printf("<Error %d> Getting device (%d) product string descriptor",err,iHandle);
 		User::Leave(err);
 		}
 	iProductStringDesc->StringData(iProductString);
@@ -358,7 +337,7 @@
 	err = iDevice.GetStringDescriptor(iSerialNumberDesc,iSerialNumberStringData,iDeviceDescriptor.SerialNumberIndex());
 	if(err != KErrNone)
 		{
-		OstTraceExt2(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP08, "<Error %d> Getting device (%u) serial number string descriptor",err,iHandle);
+		RDebug::Printf("<Error %d> Getting device (%d) serial number string descriptor",err,iHandle);
 		User::Leave(err);
 		}
 	iSerialNumberDesc->StringData(iSerialNumber);
@@ -367,7 +346,7 @@
 	err = iDevice.GetStringDescriptor(iConfigStringDesc,iConfigStringData,iConfigDescriptor.ConfigurationIndex());
 	if(err != KErrNone)
 		{
-		OstTraceExt2(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP09, "<Error %d> Getting device (%u) configuration string descriptor",err,iHandle);
+		RDebug::Printf("<Error %d> Getting device (%d) configuration string descriptor",err,iHandle);
 		User::Leave(err);
 		}
 	iConfigStringDesc->StringData(iConfigString);
@@ -379,102 +358,80 @@
 	if(err != KErrUsbStalled)
 		{
 		delete unusedStringDescriptor; //in case 'err ==  KErrNone', in which case this will need freeing
-		OstTraceExt2(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP10, "GetStringDescriptor with %d Handle %u",err,iHandle);
+		RDebug::Printf("GetStringDescriptor with nonExistentString didn't return KErrUsbStalled",err,iHandle);
 		User::Leave(err);
 		}
-	OstTrace1(TRACE_NORMAL, CUSBTESTDEVICE_CONSTRUCTL_DUP11, "String not present error(%d)",err);
+	RDebug::Printf("String not present error(%d)",err);
 
 	// Get changes in device state
 	iDevice.QueueDeviceStateChangeNotification(iCurrentState,iStatus); // iCurrentState now holds the current device state
 	SetActive();
-	OstTraceFunctionExit1( CUSBTESTDEVICE_CONSTRUCTL_EXIT, this );
 	}
 	
 RUsbDevice& CUsbTestDevice::Device()
 	{
-	OstTraceFunctionEntry1( CUSBTESTDEVICE_DEVICE_ENTRY, this );
-	OstTraceFunctionExitExt( CUSBTESTDEVICE_DEVICE_EXIT, this, ( TUint )&( iDevice ) );
 	return iDevice;
 	}
 	
 TUint16 CUsbTestDevice::DeviceSpec() const
 	{
-	OstTraceFunctionEntry1( CUSBTESTDEVICE_DEVICESPEC_ENTRY, this );
-	OstTraceFunctionExitExt( CUSBTESTDEVICE_DEVICESPEC_EXIT, this, ( TUint16 )( iDeviceSpec ) );
 	return iDeviceSpec;
 	}
 	
 TUint16 CUsbTestDevice::ProductId() const
 	{
-	OstTraceFunctionEntry1( CUSBTESTDEVICE_PRODUCTID_ENTRY, this );
-	OstTraceFunctionExitExt( CUSBTESTDEVICE_PRODUCTID_EXIT, this, ( TUint16 )( iPid ) );
 	return iPid;
 	}
 	
 TUint16 CUsbTestDevice::VendorId() const
 	{
-	OstTraceFunctionEntry1( CUSBTESTDEVICE_VENDORID_ENTRY, this );
-	OstTraceFunctionExitExt( CUSBTESTDEVICE_VENDORID_EXIT, this, ( TUint16 )( iVid ) );
 	return iVid;
 	}
 
 const TDesC16& CUsbTestDevice::SerialNumber() const
 	{
-	OstTraceFunctionEntry1( CUSBTESTDEVICE_SERIALNUMBER_ENTRY, this );
-	OstTraceFunctionExitExt( CUSBTESTDEVICE_SERIALNUMBER_EXIT, this, ( TUint )&( iSerialNumber ) );
 	return iSerialNumber;
 	}
 
 const TDesC16& CUsbTestDevice::Manufacturer() const
 	{
-	OstTraceFunctionEntry1( CUSBTESTDEVICE_MANUFACTURER_ENTRY, this );
-	OstTraceFunctionExitExt( CUSBTESTDEVICE_MANUFACTURER_EXIT, this, ( TUint )&( iManufacturerString ) );
 	return iManufacturerString;
 	}
 	
 const TDesC16& CUsbTestDevice::Product() const
 	{
-	OstTraceFunctionEntry1( CUSBTESTDEVICE_PRODUCT_ENTRY, this );
-	OstTraceFunctionExitExt( CUSBTESTDEVICE_PRODUCT_EXIT, this, ( TUint )&( iProductString ) );
 	return iProductString;
 	}
 	
 const TDesC16& CUsbTestDevice::ConfigurationString() const
 	{
-	OstTraceFunctionEntry1( CUSBTESTDEVICE_CONFIGURATIONSTRING_ENTRY, this );
-	OstTraceFunctionExitExt( CUSBTESTDEVICE_CONFIGURATIONSTRING_EXIT, this, ( TUint )&( iConfigString ) );
 	return iConfigString;
 	}
 
 const TUsbConfigurationDescriptor& CUsbTestDevice::ConfigurationDescriptor() const
 	{
-	OstTraceFunctionEntry1( CUSBTESTDEVICE_CONFIGURATIONDESCRIPTOR_ENTRY, this );
-	OstTraceFunctionExitExt( CUSBTESTDEVICE_CONFIGURATIONDESCRIPTOR_EXIT, this, ( TUint )&( iConfigDescriptor ) );
 	return iConfigDescriptor;
 	}
 		
 const TUsbDeviceDescriptor& CUsbTestDevice::DeviceDescriptor() const
 	{
-	OstTraceFunctionEntry1( CUSBTESTDEVICE_DEVICEDESCRIPTOR_ENTRY, this );
-	OstTraceFunctionExitExt( CUSBTESTDEVICE_DEVICEDESCRIPTOR_EXIT, this, ( TUint )&( iDeviceDescriptor ) );
 	return iDeviceDescriptor;
 	}
 
 void CUsbTestDevice::DoCancel()
 	{
-    OstTraceFunctionEntry1( CUSBTESTDEVICE_DOCANCEL_ENTRY, this );
+	LOG_FUNC
 
 	iDevice.CancelDeviceStateChangeNotification();
-	OstTraceFunctionExit1( CUSBTESTDEVICE_DOCANCEL_EXIT, this );
 	}
 
 
 void CUsbTestDevice::RunL()
 	{
-    OstTraceFunctionEntry1( CUSBTESTDEVICE_RUNL_ENTRY, this );
+	LOG_FUNC
 
 	TInt completionCode(iStatus.Int());
-	OstTrace1(TRACE_NORMAL, CUSBTESTDEVICE_RUNL, "CUsbTestDevice::RunL completionCode(%d)",completionCode);
+	RDebug::Printf("CUsbTestDevice::RunL completionCode(%d)",completionCode);
 
 	if(completionCode == KErrNone)
 		{
@@ -484,16 +441,14 @@
 		iObserver.DeviceStateChangeL(iCurrentState,newState,completionCode);
 		iCurrentState = newState;
 		}
-	OstTraceFunctionExit1( CUSBTESTDEVICE_RUNL_EXIT, this );
 	}
 
 
 TInt CUsbTestDevice::RunError(TInt aError)
 	{
-    OstTraceFunctionEntryExt( CUSBTESTDEVICE_RUNERROR_ENTRY, this );
+	LOG_FUNC
 
-	OstTrace1(TRACE_NORMAL, CUSBTESTDEVICE_RUNERROR, "<Error %d>",aError);
-	OstTraceFunctionExitExt( CUSBTESTDEVICE_RUNERROR_EXIT, this, KErrNone );
+	RDebug::Printf("<Error %d>",aError);
 	return KErrNone;
 	}
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0472.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0472.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -22,10 +22,6 @@
 #include <e32debug.h>
 #include "UsbDescriptorOffsets.h"
 #include "TestPolicy.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0472Traces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -35,12 +31,10 @@
 
 CUT_PBASE_T_USBDI_0472* CUT_PBASE_T_USBDI_0472::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0472_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0472* self = new (ELeave) CUT_PBASE_T_USBDI_0472(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -48,23 +42,19 @@
 CUT_PBASE_T_USBDI_0472::CUT_PBASE_T_USBDI_0472(TBool aHostRole)
 :	CBaseTestCase(KTestCaseId,aHostRole)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0472_CUT_PBASE_T_USBDI_0472_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_CUT_PBASE_T_USBDI_0472_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0472::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0472_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceVendor(this);
 	BaseConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0472::~CUT_PBASE_T_USBDI_0472()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0472_CUT_PBASE_T_USBDI_0472_ENTRY_DUP01, this );
+	LOG_FUNC
 	Cancel();
 
 	delete iClientAction;
@@ -74,57 +64,52 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_CUT_PBASE_T_USBDI_0472_EXIT_DUP01, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0472::ExecuteHostTestCaseL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0472_EXECUTEHOSTTESTCASEL_ENTRY, this );
+	LOG_FUNC
 	iActorFDF = CActorFDF::NewL(*this);
 	iClientAction = new (ELeave) CEp0Transfer(iInterface0);
 	iCaseStep = EConnectDevice;
 	iActorFDF->Monitor();
 	TimeoutIn(30);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0472::ExecuteDeviceTestCaseL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0472_EXECUTEDEVICETESTCASEL_ENTRY, this );
+	LOG_FUNC
 	
 	iTestDevice->OpenL(TestCaseId());
 	iTestDevice->SubscribeToReports(iStatus);	
 	SetActive();
 	iTestDevice->SoftwareConnect();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0472::HostDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0472_HOSTDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel the test step action timeout timer
 	
 	CancelTimeout();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_HOSTDOCANCEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0472::DeviceDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0472_DEVICEDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel the test device
 	
 	iTestDevice->CancelSubscriptionToReports();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0472::DeviceInsertedL(TUint aDeviceHandle)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 
 	Cancel();
 	TInt err(KErrNone);
@@ -136,13 +121,12 @@
 		{
 		// Incorrect device for this test case	
 
-		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
+		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
 
 		// Start the connection timeout again
 
 		TimeoutIn(30);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}	
 		
@@ -153,50 +137,50 @@
 		case EConnectDevice:
 			{
 			// Validate vendor identity
-			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP01, "Vendor identity: 0x%04x",testDevice.VendorId());
+			RDebug::Printf("Vendor identity: 0x%04x",testDevice.VendorId());
 			if(testDevice.VendorId() != 0x0E22)
 				{
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP02, "<Error> Vendor identity is not 0x0E22");
+				RDebug::Printf("<Error> Vendor identity is not 0x0E22");
 				return TestFailed(KErrCorrupt);
 				}
 				
 			// Validate product information
-			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP03, "Usb device supported specification: 0x%04x",testDevice.DeviceSpec());
+			RDebug::Printf("Usb device supported specification: 0x%04x",testDevice.DeviceSpec());
 			if(testDevice.DeviceSpec() != 0x0200)
 				{
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP04, "<Error> Usb device supported specification is not 2.0");
+				RDebug::Printf("<Error> Usb device supported specification is not 2.0");
 				return TestFailed(KErrCorrupt);
 				}
-			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP05, "Usb product identity: 0x%04x",testDevice.ProductId());
+			RDebug::Printf("Usb product identity: 0x%04x",testDevice.ProductId());
 			if(testDevice.ProductId() != 0x0040)
 				{
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP06, "<Error> Usb product idenity is not 0x0040");
+				RDebug::Printf("<Error> Usb product idenity is not 0x0040");
 				return TestFailed(KErrCorrupt);
 				}
 		
-			OstTraceExt1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP07, "testDevice.ConfigurationString() = %S",testDevice.ConfigurationString());		
+			RDebug::Printf("testDevice.ConfigurationString() = %S",&testDevice.ConfigurationString());		
 			gtest(KErrNone == testDevice.ConfigurationString().Compare(KConfigurationString()));		
 					
-			OstTraceExt1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP08, "testDevice.Manufacturer() = %S",testDevice.Manufacturer());
+			RDebug::Printf("testDevice.Manufacturer() = %S",&testDevice.Manufacturer());
 			gtest(KErrNone == testDevice.Manufacturer().Compare(KManufacturer()));
 			
-			OstTraceExt1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP09, "testDevice.SerialNumber = %s",testDevice.SerialNumber());	
+			RDebug::Printf("testDevice.SerialNumber = %s",&testDevice.SerialNumber());	
 			gtest(KErrNone == testDevice.SerialNumber().Compare(KTestCaseId()));
 		
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP10, "Waiting for device removal");
+			RDebug::Printf("Waiting for device removal");
 			iCaseStep = ERemoveDevice;
 			
 			TUint32 token;
 			err = testDevice.Device().GetTokenForInterface(0,token);
 			if(err != KErrNone)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP11, "<Error %d> Unable to get token for interface 0",err);
+				RDebug::Printf("<Error %d> Unable to get token for interface 0",err);
 				return TestFailed(err);
 				}
 			err = iInterface0.Open(token);
 			if(err != KErrNone)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP12, "<Error %d> Unable to open interface 0",err);
+				RDebug::Printf("<Error %d> Unable to open interface 0",err);
 				return TestFailed(err);
 				}
 			
@@ -213,7 +197,7 @@
 			break;
 			
 		case EConnectCancelled:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP13, "<Error> Bus event cancellation not successful");
+			RDebug::Printf("<Error> Bus event cancellation not successful");
 			TestFailed(KErrCorrupt);
 			break;
 			
@@ -223,13 +207,13 @@
 			err = testDevice.Device().GetTokenForInterface(0,token);
 			if(err != KErrNone)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP14, "<Error %d> Unable to get token for interface 0",err);
+				RDebug::Printf("<Error %d> Unable to get token for interface 0",err);
 				return TestFailed(err);
 				}
 			err = iInterface0.Open(token);
 			if(err != KErrNone)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP15, "<Error %d> Unable to open interface 0",err);
+				RDebug::Printf("<Error %d> Unable to open interface 0",err);
 				return TestFailed(err);
 				}
 	
@@ -240,17 +224,16 @@
 			break;
 			
 		default:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP16, "<Error> Test case actions out of sync");
+			RDebug::Printf("<Error> Test case actions out of sync");
 			TestFailed(KErrCorrupt);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0472::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0472_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
 	switch(iCaseStep)
 		{
@@ -273,17 +256,16 @@
 			break;
 			
 		default:
-			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_EP0TRANSFERCOMPLETEL, "<Error %d> Unknown test step",KErrCorrupt);
+			RDebug::Printf("<Error %d> Unknown test step",KErrCorrupt);
 			TestFailed(KErrCorrupt);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0472::DeviceRemovedL(TUint aDeviceHandle)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0472_DEVICEREMOVEDL_ENTRY, this );
+	LOG_FUNC
 
 	Cancel();
 	
@@ -299,32 +281,28 @@
 			break;
 			
 		default:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_DEVICEREMOVEDL, "<Error> Test case actions out of sync");
+			RDebug::Printf("<Error> Test case actions out of sync");
 			TestFailed(KErrCorrupt);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0472::BusErrorL(TInt aError)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0472_BUSERRORL_ENTRY, this );
 	// This test case handles no failiures on the bus
 
 	TestFailed(aError);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_BUSERRORL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0472::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 	RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0472_DEVICESTATECHANGEL_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_DEVICESTATECHANGEL_EXIT, this );
+	LOG_FUNC
 	}
 	
 void CUT_PBASE_T_USBDI_0472::HostRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0472_HOSTRUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -334,29 +312,28 @@
 		if(iCaseStep == EConnectCancelled)
 			{
 			// not a time-out 
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_HOSTRUNL, "Timer elapsed, reactivating notifications now");
+			RDebug::Printf("Timer elapsed, reactivating notifications now");
 			iCaseStep = EPassed;			
 			iActorFDF->Monitor();
 			}
 		else
 			{
 			// Action timeout
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_HOSTRUNL_DUP01, "<Error> Action timeout");
+			RDebug::Printf("<Error> Action timeout");
 			TestFailed(KErrTimedOut);
 			}	
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0472_HOSTRUNL_DUP02, "<Error %d> Timeout timer could not complete",completionCode);
+		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_HOSTRUNL_EXIT, this );
 	}
 	
 
 void CUT_PBASE_T_USBDI_0472::DeviceRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0472_DEVICERUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Disconnect the device
 	
@@ -365,7 +342,6 @@
 	// Complete the test case request
 	
 	TestPolicy().SignalTestComplete(iStatus.Int());
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0472_DEVICERUNL_EXIT, this );
 	}	
 	
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0473.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0473.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -21,10 +21,6 @@
 #include "testdebug.h"
 #include "modelleddevices.h"
 #include "TestPolicy.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0473Traces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -34,12 +30,10 @@
 
 CUT_PBASE_T_USBDI_0473* CUT_PBASE_T_USBDI_0473::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0473_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0473* self = new (ELeave) CUT_PBASE_T_USBDI_0473(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_NEWL_EXIT, ( TUint )( self ) );
 	return self; 
 	}
 	   
@@ -50,23 +44,19 @@
 	iSuspendedI1(EFalse),
 	iDeviceNotificationPending(ETrue)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0473_CUT_PBASE_T_USBDI_0473_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_CUT_PBASE_T_USBDI_0473_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0473::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0473_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceA(this);
 	BaseConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0473::~CUT_PBASE_T_USBDI_0473()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0473_CUT_PBASE_T_USBDI_0473_ENTRY_DUP01, this );
+	LOG_FUNC
 	
 	// Cancel any async operations
 	
@@ -88,13 +78,12 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_CUT_PBASE_T_USBDI_0473_EXIT_DUP01, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0473::ExecuteHostTestCaseL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0473_EXECUTEHOSTTESTCASEL_ENTRY, this );
+	LOG_FUNC
 	iCaseStep = EStepSuspend;
 	iActorFDF = CActorFDF::NewL(*this);
 	iControlEp0 = new (ELeave) CEp0Transfer(iUsbInterface0);
@@ -106,12 +95,11 @@
 
 	// Start the connection timeout	
 	TimeoutIn(30);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0473::ExecuteDeviceTestCaseL()
 	{
-    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0473_EXECUTEDEVICETESTCASEL_ENTRY, this );
+	LOG_FUNC
 
 	// Construct the device for the test case
 	iTestDevice->OpenL(TestCaseId());
@@ -120,32 +108,29 @@
 
 	// Connect the test device	
 	iTestDevice->SoftwareConnect();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0473::HostDoCancel()
 	{
-    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0473_HOSTDOCANCEL_ENTRY, this );
+	LOG_FUNC
 
 	// Cancel the timeout timer
 	CancelTimeout();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_HOSTDOCANCEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0473::DeviceDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0473_DEVICEDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel the device	
 	iTestDevice->CancelSubscriptionToReports();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0473::DeviceInsertedL(TUint aDeviceHandle)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 
 	Cancel(); // Cancel the timer
 	TInt err(KErrNone);
@@ -158,12 +143,11 @@
 		{
 		// Incorrect device for this test case
 
-		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
+		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
 
 		// Start the connection timeout again
 		TimeoutIn(30);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}	
 	// Check tree now	
@@ -177,61 +161,61 @@
 			TUint32 token1(0);
 			TUint32 token2(0);
 	
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP01, "Obtaining token for interface 0");
+			RDebug::Printf("Obtaining token for interface 0");
 			err = testDevice.Device().GetTokenForInterface(0,token1);
 			if(err != KErrNone)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP02, "<Error %d> Token for interface 0 could not be retrieved",err);
+				RDebug::Printf("<Error %d> Token for interface 0 could not be retrieved",err);
 				return TestFailed(err);
 				}
-			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP03, "Token 1 (%d) retrieved",token1);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP04, "Opening interface 0");
+			RDebug::Printf("Token 1 (%d) retrieved",token1);
+			RDebug::Printf("Opening interface 0");
 			err = iUsbInterface0.Open(token1); // Alternate interface setting 0
 			if(err != KErrNone)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP05, "<Error %d> Interface 0 could not be opened",err);
+				RDebug::Printf("<Error %d> Interface 0 could not be opened",err);
 				return TestFailed(err);
 				}
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP06, "Interface 0 opened");
+			RDebug::Printf("Interface 0 opened");
 		
 																
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP07, "Obtaining token for interface 1");
+			RDebug::Printf("Obtaining token for interface 1");
 			err = testDevice.Device().GetTokenForInterface(1,token2);
 			if(err != KErrNone)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP08, "<Error %d> Token for interface 1 could not be retrieved",err);
+				RDebug::Printf("<Error %d> Token for interface 1 could not be retrieved",err);
 				return TestFailed(err);			
 				}	
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP09, "Opening interface 1");
+			RDebug::Printf("Opening interface 1");
 			err = iUsbInterface1.Open(token2); // Alternate interface setting 0
 			if(err != KErrNone)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP10, "<Error %d> Interface 1 could not be opened",err);
+				RDebug::Printf("<Error %d> Interface 1 could not be opened",err);
 				return TestFailed(err);
 				}
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP11, "Interface 1 opened");
+			RDebug::Printf("Interface 1 opened");
 	
 			// close it
 			iUsbInterface1.Close();		
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP12, "Interface 1 closed");
+			RDebug::Printf("Interface 1 closed");
 	
 			//re-open now
 			err = iUsbInterface1.Open(token2); // Alternate interface setting 0
 			if(err != KErrNone)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP13, "<Error %d> Interface 1 could not be re-opened",err);
+				RDebug::Printf("<Error %d> Interface 1 could not be re-opened",err);
 				return TestFailed(err);
 				}
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP14, "Interface 1 re-opened");
+			RDebug::Printf("Interface 1 re-opened");
 			
 			
 			// Suspend interface 0
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP15, "Suspending interface 0");
+			RDebug::Printf("Suspending interface 0");
 			iInterface0Watcher->SuspendAndWatch();
 			iSuspendedI0 = ETrue;
 			
 			// Suspend interface 1
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP16, "Suspending interface 1");
+			RDebug::Printf("Suspending interface 1");
 			iInterface1Watcher->SuspendAndWatch();
 			iSuspendedI1 = ETrue;
 			
@@ -244,16 +228,15 @@
 			TestFailed(KErrCorrupt);
 			break;
 		}	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 
 
 TInt CUT_PBASE_T_USBDI_0473::Interface0ResumedL(TAny* aPtr)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0473_INTERFACE0RESUMEDL_ENTRY, 0 );
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_INTERFACE0RESUMEDL, "Interface 0 resumed");
+	LOG_CFUNC
+	RDebug::Printf("Interface 0 resumed");
 	CUT_PBASE_T_USBDI_0473* self = reinterpret_cast<CUT_PBASE_T_USBDI_0473*>(aPtr);
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_INTERFACE0RESUMEDL_DUP01, "watcher 0 iStatus=%d",self->iInterface0Watcher->CompletionCode());
+	RDebug::Printf("watcher 0 iStatus=%d",self->iInterface0Watcher->CompletionCode());
 	self->iSuspendedI0 = EFalse;
 	return self->CheckForAllResumedNotificationsAndContinueFSM();
 	}
@@ -261,10 +244,10 @@
 	
 TInt CUT_PBASE_T_USBDI_0473::Interface1ResumedL(TAny* aPtr)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0473_INTERFACE1RESUMEDL_ENTRY, 0 );
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_INTERFACE1RESUMEDL, "Interface 1 resumed");
+	LOG_CFUNC
+	RDebug::Printf("Interface 1 resumed");
 	CUT_PBASE_T_USBDI_0473* self = reinterpret_cast<CUT_PBASE_T_USBDI_0473*>(aPtr);
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_INTERFACE1RESUMEDL_DUP01, "watcher 1 iStatus=%d",self->iInterface1Watcher->CompletionCode());
+	RDebug::Printf("watcher 1 iStatus=%d",self->iInterface1Watcher->CompletionCode());
 	self->iSuspendedI1 = EFalse;
 	return self->CheckForAllResumedNotificationsAndContinueFSM();
 	}
@@ -272,41 +255,39 @@
 	
 void CUT_PBASE_T_USBDI_0473::DeviceRemovedL(TUint aDeviceHandle)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0473_DEVICEREMOVEDL_ENTRY, this );
+	LOG_FUNC
 
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 
 	TestFailed(KErrDisconnected);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0473::BusErrorL(TInt aError)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0473_BUSERRORL_ENTRY, this );
+	LOG_FUNC
 
 	// This test case handles no failiures on the bus
 
 	TestFailed(aError);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_BUSERRORL_EXIT, this );
 	}
 
 TInt CUT_PBASE_T_USBDI_0473::CheckForAllResumedNotificationsAndContinueFSM()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0473_CHECKFORALLRESUMEDNOTIFICATIONSANDCONTINUEFSM_ENTRY, this );
+	LOG_FUNC
 	TBool readyToContinueFSM= ETrue;
 	if( iInterface0Watcher->IsActive()
 	||  iInterface0Watcher->iStatus == KRequestPending)
 		{
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_CHECKFORALLRESUMEDNOTIFICATIONSANDCONTINUEFSM, "Interface 0 watcher still pending");
+		RDebug::Printf("Interface 0 watcher still pending");
 		readyToContinueFSM= EFalse;
 		}
 
 	if( iInterface1Watcher->IsActive()
 	||  iInterface1Watcher->iStatus == KRequestPending)
 		{
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_CHECKFORALLRESUMEDNOTIFICATIONSANDCONTINUEFSM_DUP01, "Interface 1 watcher still pending");
+		RDebug::Printf("Interface 1 watcher still pending");
 		readyToContinueFSM= EFalse;
 		}
 
@@ -321,28 +302,25 @@
 		}
 	else
 		{
-		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0473_CHECKFORALLRESUMEDNOTIFICATIONSANDCONTINUEFSM_EXIT, this, KErrNone );
 		return KErrNone;
 		}
 	}
 
 TInt CUT_PBASE_T_USBDI_0473::ContinueFSMAfterAllResumedNotifications()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_ENTRY, this );
+	LOG_FUNC
 	iDeviceNotificationPending= ETrue;
 	if(iSuspendedI0)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS, "<Error %d> Interface 0 still suspended",KErrCompletion);
+		RDebug::Printf("<Error %d> Interface 0 still suspended",KErrCompletion);
 		TestFailed(KErrCompletion);
-		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_EXIT, this, KErrCompletion );
 		return KErrCompletion;
 		}
 
 	if(iSuspendedI1)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP01, "<Error %d> Interface 1 still suspended",KErrCompletion);
+		RDebug::Printf("<Error %d> Interface 1 still suspended",KErrCompletion);
 		TestFailed(KErrCompletion);
-		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_EXIT_DUP01, this, KErrCompletion );
 		return KErrCompletion;
 		}
 
@@ -355,14 +333,14 @@
 			
 			if(err != KErrNone)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP02, "<Error %d> Unable to permit remote device wakeup",err);
+				RDebug::Printf("<Error %d> Unable to permit remote device wakeup",err);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(err,_L8("Unable to permit remote device wakeup"));
 				iControlEp0->SendRequest(request,this);
 				}
 			else
 				{
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP03, "Device is resumed, send request to client: Remote wake up in 6 secs");
+				RDebug::Printf("Device is resumed, send request to client: Remote wake up in 6 secs");
 				
 				TRemoteWakeupRequest request(6);
 				iControlEp0->SendRequest(request,this);			
@@ -377,11 +355,11 @@
 				{
 				// Now suspend the device again after resumption from remote wakeup
 			
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP04, "Suspending interface 0");
+				RDebug::Printf("Suspending interface 0");
 				iInterface0Watcher->SuspendAndWatch();
 				iSuspendedI0 = ETrue;
 				
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP05, "Suspending interface 1");
+				RDebug::Printf("Suspending interface 1");
 				iInterface1Watcher->SuspendAndWatch();
 				iSuspendedI1 = ETrue;
 				
@@ -389,31 +367,28 @@
 				}
 			else
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP06, "<Error %d> Device is still suspended",KErrCompletion);
+				RDebug::Printf("<Error %d> Device is still suspended",KErrCompletion);
 				TestFailed(KErrCompletion);
-				OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_EXIT_DUP02, this, KErrCompletion );
 				return KErrCompletion;
 				}
 			}
 			break;
 
 		default:
-			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP07, "CUT_PBASE_T_USBDI_0473::ContinueFSMAfterAllResumedNotifications: Invalid state %d", iCaseStep);
+			RDebug::Printf("CUT_PBASE_T_USBDI_0473::ContinueFSMAfterAllResumedNotifications: Invalid state %d", iCaseStep);
 			TestFailed(KErrCompletion);
-			OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_EXIT_DUP03, this, KErrCompletion );
 			return KErrCompletion;
 		}
 
-	OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_EXIT_DUP04, this, KErrNone );
 	return KErrNone;
 	}
 
 void CUT_PBASE_T_USBDI_0473::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
 	
-	OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL, "Device State change from %d to %d err=%d",aPreviousState,aNewState,aCompletionCode);
+	RDebug::Printf("Device State change from %d to %d err=%d",aPreviousState,aNewState,aCompletionCode);
 
 	switch(iCaseStep)
 		{
@@ -426,13 +401,13 @@
 				{
 				// Device state is suspended now resume it by resuming one of the interfaces
 				
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP01, "Device is suspended now resume device by resuming one of the interfaces");
+				RDebug::Printf("Device is suspended now resume device by resuming one of the interfaces");
 				iUsbInterface0.CancelPermitSuspend();
 				iCaseStep = EValidateResumptionAfterInterfaceSuspension;
 				}
 			else
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP02, "<Error %d> State was not suspended",KErrCompletion);
+				RDebug::Printf("<Error %d> State was not suspended",KErrCompletion);
 				
 				// Since the device is not suspended, send test case failed to the device
 	
@@ -455,7 +430,7 @@
 				}
 			else
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP03, "<Error %d> Device is still suspended",KErrCompletion);
+				RDebug::Printf("<Error %d> Device is still suspended",KErrCompletion);
 				return TestFailed(KErrCompletion);
 				}
 			}
@@ -468,7 +443,7 @@
 				{
 				// Now awaiting a remote wake up state change notification
 				
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP04, "Now awaiting a remote wake up state change notification");
+				RDebug::Printf("Now awaiting a remote wake up state change notification");
 				
 				CancelTimeout();
 				iTimer.After(iStatus,10000000); // Give 10 seconds for device to signal remote wake-up
@@ -477,7 +452,7 @@
 				}
 			else
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP05, "<Error %d> State was not suspended",KErrCompletion);
+				RDebug::Printf("<Error %d> State was not suspended",KErrCompletion);
 				
 				// Since the device is not suspended, send test case failed to the device
 	
@@ -491,7 +466,7 @@
 		// This step should never be reached as ep0 complete traps this step, but if it does test fails.
 		case ESuspendForRemoteWakeup:
 			{
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP06, "Resumed before suspended");
+			RDebug::Printf("Resumed before suspended");	    
 		    iCaseStep = EFailed;
 		    TTestCaseFailed request(KErrCompletion,_L8("State was not suspended"));
 		    iControlEp0->SendRequest(request,this);
@@ -517,15 +492,15 @@
 				// Device is now suspended, now activate the device again to send test case
 				// completed request to device
 	
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP07, "Device is now suspended, now activate the device again to send test case completed request to device");
+				RDebug::Printf("Device is now suspended, now activate the device again to send test case completed request to device");
 	
 				CUsbTestDevice& testDevice = iActorFDF->DeviceL(iDeviceHandle);
 	
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP08, "Resuming at device level");
+				RDebug::Printf("Resuming at device level");
 				TInt err(testDevice.Device().Resume());
 				if(err != KErrNone)
 					{
-					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP09, "<Error %d> Unable to suspend the device",err);
+					RDebug::Printf("<Error %d> Unable to suspend the device",err);
 					iCaseStep = EFailed;
 					TTestCaseFailed request(err,_L8("Unable to suspend the device"));
 					iControlEp0->SendRequest(request,this);
@@ -535,7 +510,7 @@
 				}
 			else
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP10, "<Error %d> State was not suspended",KErrCompletion);
+				RDebug::Printf("<Error %d> State was not suspended",KErrCompletion);
 				
 				// Since the device is not suspended, send test case failed to the device
 	
@@ -552,13 +527,13 @@
 			{
 			if(aNewState == RUsbDevice::EDeviceActive)
 				{
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP11, "Device is active again, test case passed");
+				RDebug::Printf("Device is active again, test case passed");
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
 				}
 			else
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP12, "<Error %d> Device is still suspended",KErrCompletion);
+				RDebug::Printf("<Error %d> Device is still suspended",KErrCompletion);
 				return TestFailed(KErrCompletion);
 				}
 			}
@@ -567,28 +542,27 @@
 		default:
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0473::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL_ENTRY, this );
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	LOG_FUNC
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	switch(iCaseStep)
 		{
 		case ESuspendForRemoteWakeup:
 			{
 			// Suspend device again so a remote wakeup can be achieved
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL_DUP01, "Suspend device again so a remote wakeup can be achieved");
+			RDebug::Printf("Suspend device again so a remote wakeup can be achieved");
 	
 			// Suspend interface 0
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL_DUP02, "Suspending interface 0");
+			RDebug::Printf("Suspending interface 0");
 			iInterface0Watcher->SuspendAndWatch();
 			iSuspendedI0 = ETrue;
 			
 			// Suspend interface 1
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL_DUP03, "Suspending interface 1");
+			RDebug::Printf("Suspending interface 1");
 			iInterface1Watcher->SuspendAndWatch();
 			iSuspendedI1 = ETrue;
 			
@@ -610,13 +584,12 @@
 			TestPassed();
 			break;
 			}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0473::HostRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0473_HOSTRUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -624,21 +597,20 @@
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_HOSTRUNL, "<Error> Action timeout");
+		RDebug::Printf("<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0473_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
+		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_HOSTRUNL_EXIT, this );
 	}
 	
 
 void CUT_PBASE_T_USBDI_0473::DeviceRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0473_DEVICERUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Disconnect the device
 	
@@ -647,7 +619,6 @@
 	// Complete the test case request
 	
 	TestPolicy().SignalTestComplete(iStatus.Int());
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0473_DEVICERUNL_EXIT, this );
 	}
 	
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0474.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0474.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,10 +19,6 @@
 #include "PBASE-T_USBDI-0474.h"
 #include "testpolicy.h"
 #include "modelleddevices.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0474Traces.h"
-#endif
 
 
 namespace NUnitTesting_USBDI
@@ -33,12 +29,10 @@
 
 CUT_PBASE_T_USBDI_0474* CUT_PBASE_T_USBDI_0474::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0474_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0474* self = new (ELeave) CUT_PBASE_T_USBDI_0474(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -47,23 +41,19 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0474_CUT_PBASE_T_USBDI_0474_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_CUT_PBASE_T_USBDI_0474_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0474::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0474_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceB(this);
 	BaseConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0474::~CUT_PBASE_T_USBDI_0474()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0474_CUT_PBASE_T_USBDI_0474_ENTRY_DUP01, this );
+	LOG_FUNC
 	Cancel();
 	
 	iUsbInterface0.Close();
@@ -75,58 +65,53 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_CUT_PBASE_T_USBDI_0474_EXIT_DUP01, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0474::ExecuteHostTestCaseL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0474_EXECUTEHOSTTESTCASEL_ENTRY, this );
+	LOG_FUNC
 	
 	iActorFDF = CActorFDF::NewL(*this);
 	iClientAction = new (ELeave) CEp0Transfer(iUsbInterface0);
 	iActorFDF->Monitor();
 	TimeoutIn(30);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 
 	
 void CUT_PBASE_T_USBDI_0474::ExecuteDeviceTestCaseL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0474_EXECUTEDEVICETESTCASEL_ENTRY, this );
+	LOG_FUNC
 	
 	iTestDevice->OpenL(TestCaseId());
 	iTestDevice->SubscribeToReports(iStatus);
 	SetActive();
 	iTestDevice->SoftwareConnect();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_EXECUTEDEVICETESTCASEL_EXIT, this );
 	} 
 	
 	
 void CUT_PBASE_T_USBDI_0474::HostDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0474_HOSTDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel the test step timeout
 	
 	CancelTimeout();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_HOSTDOCANCEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0474::DeviceDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0474_DEVICEDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel the device
 	
 	iTestDevice->CancelSubscriptionToReports();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_DEVICEDOCANCEL_EXIT, this );
 	}
 			
 void CUT_PBASE_T_USBDI_0474::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
 	TInt err(KErrNone); 
 	
@@ -136,13 +121,12 @@
 		{
 		// Incorrect device for this test case	
 
-		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
+		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
 
 		// Start the connection timeout again
 
 		TimeoutIn(30);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 		
@@ -158,58 +142,54 @@
 	err = testDevice.Device().GetTokenForInterface(0,token0);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_DUP01, "<Error %d> Token for interface 0 could not be retrieved",err);
+		RDebug::Printf("<Error %d> Token for interface 0 could not be retrieved",err);
 		return TestFailed(err);
 		}
 	err = iUsbInterface0.Open(token0); // Default interface setting 0
 	if(err != KErrNone)
 		{
-		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 1 using token %d",err,token0);
+		RDebug::Printf("<Error %d> Unable to open interface 1 using token %d",err,token0);
 		return TestFailed(err);
 		} 
 	 	
 	iCaseStep = EPassed;
 	TTestCasePassed request;
 	iClientAction->SendRequest(request,this);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0474::DeviceRemovedL(TUint aDeviceHandle)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0474_DEVICEREMOVEDL_ENTRY, this );
+	LOG_FUNC
 
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 
 	TestFailed(KErrDisconnected);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0474::BusErrorL(TInt aError)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0474_BUSERRORL_ENTRY, this );
+	LOG_FUNC
 
 	// This test case handles no failiures on the bus
 	
 	TestFailed(aError);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_BUSERRORL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0474::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 	RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0474_DEVICESTATECHANGEL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_DEVICESTATECHANGEL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0474::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0474_EP0TRANSFERCOMPLETEL_ENTRY, this );
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0474_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	LOG_FUNC
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(iCaseStep == EPassed)
 		{
@@ -220,13 +200,12 @@
 		{
 		TestFailed(KErrCompletion);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0474::HostRunL()
 	{
-    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0474_HOSTRUNL_ENTRY, this );
+	LOG_FUNC
 
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -234,20 +213,19 @@
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0474_HOSTRUNL, "<Error> Action timeout");
+		RDebug::Printf("<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0474_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
+		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_HOSTRUNL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0474::DeviceRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0474_DEVICERUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Disconnect the device
 	
@@ -256,7 +234,6 @@
 	// Complete the test case request
 	
 	TestPolicy().SignalTestComplete(iStatus.Int());
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_DEVICERUNL_EXIT, this );
 	}
 	
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0475.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0475.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,12 +20,6 @@
 #include "descriptorsRawData.h"
 #include <d32usbdescriptors.h>
 #include "testpolicy.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0475Traces.h"
-#endif
-
-
 
 namespace NUnitTesting_USBDI
 	{
@@ -35,12 +29,10 @@
 
 CUT_PBASE_T_USBDI_0475* CUT_PBASE_T_USBDI_0475::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0475* self = new (ELeave) CUT_PBASE_T_USBDI_0475(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -49,30 +41,26 @@
 :	CBaseTestCase(KTestCaseId,aHostRole,ETrue),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0475_CUT_PBASE_T_USBDI_0475_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_CUT_PBASE_T_USBDI_0475_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0475::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_CONSTRUCTL_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_CONSTRUCTL_EXIT, this );
+	LOG_FUNC
 	}
 
 
 CUT_PBASE_T_USBDI_0475::~CUT_PBASE_T_USBDI_0475()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_CUT_PBASE_T_USBDI_0475_ENTRY_DUP01, this );
+	LOG_FUNC
 	
 	Cancel();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_CUT_PBASE_T_USBDI_0475_EXIT_DUP01, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0475::ExecuteHostTestCaseL()	
 	{	
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_EXECUTEHOSTTESTCASEL_ENTRY, this );
+	LOG_FUNC
 	TInt err(KErrNone);
 	
 	TUsbGenericDescriptor* parsed = NULL;
@@ -104,41 +92,34 @@
 	CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorUnexpectedLengthTestCase3, 3) == KErrNone);
 
 	TestPassed();	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}   
 	
 void CUT_PBASE_T_USBDI_0475::HostDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_HOSTDOCANCEL_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_HOSTDOCANCEL_EXIT, this );
+	LOG_FUNC	
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0475::ExecuteDeviceTestCaseL()	
 	{	
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_EXECUTEDEVICETESTCASEL_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}	
 	
 void CUT_PBASE_T_USBDI_0475::DeviceDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_DEVICEDOCANCEL_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_DEVICEDOCANCEL_EXIT, this );
+	LOG_FUNC
 	}	
 
 
 
 void CUT_PBASE_T_USBDI_0475::HostRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_HOSTRUNL_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_HOSTRUNL_EXIT, this );
+	LOG_FUNC
 	}
 
 
 void CUT_PBASE_T_USBDI_0475::DeviceRunL()
 	{	
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0475_DEVICERUNL_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0475_DEVICERUNL_EXIT, this );
+	LOG_FUNC
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0476.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0476.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,12 +20,6 @@
 #include "descriptorsRawData.h"
 #include <d32usbdescriptors.h>
 #include "testpolicy.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0476Traces.h"
-#endif
-
-
 
 namespace NUnitTesting_USBDI
 	{
@@ -35,12 +29,10 @@
 
 CUT_PBASE_T_USBDI_0476* CUT_PBASE_T_USBDI_0476::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0476* self = new (ELeave) CUT_PBASE_T_USBDI_0476(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -49,31 +41,27 @@
 :	CBaseTestCase(KTestCaseId,aHostRole,ETrue),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0476_CUT_PBASE_T_USBDI_0476_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_CUT_PBASE_T_USBDI_0476_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0476::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_CONSTRUCTL_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_CONSTRUCTL_EXIT, this );
+	LOG_FUNC
 	}
 
 
 CUT_PBASE_T_USBDI_0476::~CUT_PBASE_T_USBDI_0476()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_CUT_PBASE_T_USBDI_0476_ENTRY_DUP01, this );
+	LOG_FUNC
 	
 	Cancel();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_CUT_PBASE_T_USBDI_0476_EXIT_DUP01, this );
 	}
 	
 
 			
 void CUT_PBASE_T_USBDI_0476::ExecuteHostTestCaseL()	
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_EXECUTEHOSTTESTCASEL_ENTRY, this );
+	LOG_FUNC
 	TInt err(KErrNone);
 	
 	TUsbGenericDescriptor* parsed = NULL;
@@ -129,40 +117,33 @@
 	CHECK(ParseConfigDescriptorAndCheckTree(devDesc, KConfigurationDescriptorWithIADTestCase14, 14) == KErrNone);
 	
 	TestPassed();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}   
 	
 void CUT_PBASE_T_USBDI_0476::HostDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_HOSTDOCANCEL_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_HOSTDOCANCEL_EXIT, this );
+	LOG_FUNC	
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0476::ExecuteDeviceTestCaseL()	
 	{	
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_EXECUTEDEVICETESTCASEL_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}	
 	
 void CUT_PBASE_T_USBDI_0476::DeviceDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_DEVICEDOCANCEL_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_DEVICEDOCANCEL_EXIT, this );
+	LOG_FUNC
 	}
 
 
 void CUT_PBASE_T_USBDI_0476::HostRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_HOSTRUNL_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_HOSTRUNL_EXIT, this );
+	LOG_FUNC
 	}
 
 
 void CUT_PBASE_T_USBDI_0476::DeviceRunL()
 	{	
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0476_DEVICERUNL_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0476_DEVICERUNL_EXIT, this );
+	LOG_FUNC
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0477.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0477.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,10 +19,6 @@
 #include "PBASE-T_USBDI-0477.h"
 #include "testpolicy.h"
 #include "modelleddevices.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0477Traces.h"
-#endif
 
 
 namespace NUnitTesting_USBDI
@@ -33,12 +29,10 @@
 
 CUT_PBASE_T_USBDI_0477* CUT_PBASE_T_USBDI_0477::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0477_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0477* self = new (ELeave) CUT_PBASE_T_USBDI_0477(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -47,23 +41,19 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0477_CUT_PBASE_T_USBDI_0477_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_CUT_PBASE_T_USBDI_0477_EXIT, this );
 	} 
 
  
 void CUT_PBASE_T_USBDI_0477::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0477_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceA(this);
 	BaseConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0477::~CUT_PBASE_T_USBDI_0477()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0477_CUT_PBASE_T_USBDI_0477_ENTRY_DUP01, this );
+	LOG_FUNC
 	Cancel();
 
 	iTestPipe.Close();
@@ -77,58 +67,53 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_CUT_PBASE_T_USBDI_0477_EXIT_DUP01, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0477::ExecuteHostTestCaseL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0477_EXECUTEHOSTTESTCASEL_ENTRY, this );
+	LOG_FUNC
 	
 	iActorFDF = CActorFDF::NewL(*this);
 	iClientAction = new (ELeave) CEp0Transfer(iUsbInterface0);
 	iActorFDF->Monitor();
 	TimeoutIn(30);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 
 	
 void CUT_PBASE_T_USBDI_0477::ExecuteDeviceTestCaseL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0477_EXECUTEDEVICETESTCASEL_ENTRY, this );
+	LOG_FUNC
 	
 	iTestDevice->OpenL(TestCaseId());
 	iTestDevice->SubscribeToReports(iStatus);
 	SetActive();
 	iTestDevice->SoftwareConnect();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0477::HostDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0477_HOSTDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel the test step timeout
 	
 	CancelTimeout();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_HOSTDOCANCEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0477::DeviceDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0477_DEVICEDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel the device
 	
 	iTestDevice->CancelSubscriptionToReports();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 TBool CUT_PBASE_T_USBDI_0477::CheckFirstInterfaceDescriptorDeviceA(TUsbInterfaceDescriptor& aIfDescriptor)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0477_CHECKFIRSTINTERFACEDESCRIPTORDEVICEA_ENTRY, this );
+	LOG_FUNC	
 	/*	Interface0	[setting0]
 		Interface1	[setting0]
 						[endpoint1] Bulk out
@@ -176,14 +161,13 @@
 		desc = desc->iNextPeer; // no peer
 		CHECK_RET_BOOL(desc == 0); 
 		
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_CHECKFIRSTINTERFACEDESCRIPTORDEVICEA, "CheckFirstInterfaceDescriptorDeviceA successfull!");
-		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0477_CHECKFIRSTINTERFACEDESCRIPTORDEVICEA_EXIT, this, ETrue );
+		RDebug::Printf("CheckFirstInterfaceDescriptorDeviceA successfull!");
 		return ETrue;
 	}
 	
 void CUT_PBASE_T_USBDI_0477::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
 	TInt err(KErrNone);
 	
@@ -193,12 +177,11 @@
 		{
 		// Incorrect device for this test case	
 
-		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
+		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
 
 		// Start the connection timeout again
 		TimeoutIn(30);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 			
@@ -207,14 +190,14 @@
 	err = testDevice.Device().GetTokenForInterface(0,token0);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP01, "<Error %d> Token for interface 0 could not be retrieved",err);
+		RDebug::Printf("<Error %d> Token for interface 0 could not be retrieved",err);
 		return TestFailed(err);
 		}
 		
 	err = iUsbInterface0.Open(token0);
 	if(err != KErrNone)
 		{
-		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0 using token %d",err,token0);
+		RDebug::Printf("<Error %d> Unable to open interface 0 using token %d",err,token0);
 		return TestFailed(err);
 		}
 	
@@ -225,11 +208,10 @@
 		TBuf<256> msg;
 		_LIT(string, "<Error %d> Token for interface could not be retrieved");
 		msg.Format(string,err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP03, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iClientAction->SendRequest(request,this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP01, this );
 		return;
 		}
 
@@ -238,17 +220,16 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to open interface using token %d"),err,token1);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP04, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iClientAction->SendRequest(request,this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP02, this );
 		return;
 		}
 		
 			
 	// check interface descriptor now				 
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP05, "check Interface descriptor now");
+	RDebug::Printf("check Interface descriptor now");
 	TUsbInterfaceDescriptor ifDescriptor;
 	CHECK(iUsbInterface1.GetInterfaceDescriptor(ifDescriptor) == KErrNone);	
 	CHECK(CheckFirstInterfaceDescriptorDeviceA(ifDescriptor));
@@ -259,15 +240,15 @@
 	// get busId now				
 	TUsbBusId busId;	 
 	CHECK(iUsbInterface1.GetBusId(busId) == KErrNone);
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP06, "busId(Interface) = %d",busId);
+	RDebug::Printf("busId(Interface) = %d",busId);
 	
 	// get device speed now
 	RUsbInterface::TDeviceSpeed deviceSpeed;
 	CHECK(iUsbInterface1.GetDeviceSpeed(deviceSpeed) == KErrNone);
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP07, "GetDeviceSpeed = %d", deviceSpeed);
+	RDebug::Printf("GetDeviceSpeed = %d", deviceSpeed);
 	CHECK(deviceSpeed == RUsbInterface::EFullSpeed);	
 		
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP08, "Number of alternate interface settings available: %d",iUsbInterface1.GetAlternateInterfaceCount());
+	RDebug::Printf("Number of alternate interface settings available: %d",iUsbInterface1.GetAlternateInterfaceCount());
 	gtest(iUsbInterface1.GetAlternateInterfaceCount() == 2);
 	
 	// Select alternate interface setting 1	
@@ -276,11 +257,10 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Selecting alternate interface setting 1 on interface 1"),err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP09, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iClientAction->SendRequest(request,this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP03, this );
 		return;
 		}	
 	
@@ -291,39 +271,37 @@
 		{
 		TBuf<128> msg;
 		msg.Format(_L("<Error %d> Could not get address for Bulk out endpoint"),err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP10, msg);
+		RDebug::Print(msg);
 		TTestCaseFailed request(err,msg);
 		iClientAction->SendRequest(request,this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP04, this );
 		return;
 		}
 		
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP11, "Opening pipe for endpoint address %02x on interface 1 setting 1",endpointAddress);
+	RDebug::Printf("Opening pipe for endpoint address %02x on interface 1 setting 1",endpointAddress);
 	err = iUsbInterface1.OpenPipeForEndpoint(iTestPipe,endpointAddress,EFalse);
 	if(err != KErrNone)
 		{
 		TBuf<128> msg;
 		msg.Format(_L("<Error %d> Unable to open pipe on interface 1 setting 0"),err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP12, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iClientAction->SendRequest(request,this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP05, this );
 		return;
 		}
 		
 	// get busId				
 	TUsbBusId busIdPipe;	 
 	CHECK(iTestPipe.GetBusId(busIdPipe) == KErrNone);
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP13, "busId(Pipe) = %d",busIdPipe);
+	RDebug::Printf("busId(Pipe) = %d",busIdPipe);
 	CHECK(busIdPipe == busId);
 	
 	TUsbEndpointId usbEpId;
 	CHECK(iTestPipe.GetEndpointId(usbEpId) == KErrNone);
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP14, "EndpointId = %d",usbEpId); 
+	RDebug::Printf("EndpointId = %d",usbEpId); 
 	
 	// check ep descriptor now				 
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP15, "check ep descriptor now");
+	RDebug::Printf("check ep descriptor now");
 	TUsbEndpointDescriptor epDescriptor;
 	
 
@@ -334,15 +312,15 @@
 	CHECK(epDescriptor.iNextPeer != 0);	// 1 peer
 
 		
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP16, "Pipe established now closing");
+	RDebug::Printf("Pipe established now closing");
 	iTestPipe.Close();
 	
 	// Select alternate interface 2, error expected
 	err = iUsbInterface1.SelectAlternateInterface(2);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP17, "<Warning %d> Selecting alternate interface 2",err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP18, "...Rolling Back....");
+		RDebug::Printf("<Warning %d> Selecting alternate interface 2",err);
+		RDebug::Printf("...Rolling Back....");
 		
 		// Establish pipes on rollback
 		// Open a pipe for endpoint (Bulk out)		
@@ -351,15 +329,14 @@
 			{
 			TBuf<128> msg;
 			msg.Format(_L("<Error %d> Unable to open pipe on interface 1 setting 1 for rollback case"),err);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP19, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(err,msg);
 			iClientAction->SendRequest(request,this);
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP06, this );
 			return;
 			}
 		
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP20, "Pipe established on rollback now closing");
+		RDebug::Printf("Pipe established on rollback now closing");
 		iTestPipe.Close();
 		}
 	
@@ -367,46 +344,42 @@
 	iCaseStep = EPassed;
 	TTestCasePassed request;
 	iClientAction->SendRequest(request,this);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP07, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0477::DeviceRemovedL(TUint aDeviceHandle)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0477_DEVICEREMOVEDL_ENTRY, this );
+	LOG_FUNC
 
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 
 	TestFailed(KErrDisconnected);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0477::BusErrorL(TInt aError)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0477_BUSERRORL_ENTRY, this );
+	LOG_FUNC
 
 	// This test case handles no failiures on the bus
 	
 	TestFailed(aError);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_BUSERRORL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0477::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 	RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0477_DEVICESTATECHANGEL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICESTATECHANGEL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0477::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0477_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(iCaseStep == EPassed)
 		{
@@ -417,13 +390,12 @@
 		{
 		TestFailed(KErrCompletion);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0477::HostRunL()
 	{
-    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0477_HOSTRUNL_ENTRY, this );
+	LOG_FUNC
 
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -431,20 +403,19 @@
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_HOSTRUNL, "<Error> Action timeout");
+		RDebug::Printf("<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
+		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_HOSTRUNL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0477::DeviceRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0477_DEVICERUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Disconnect the device
 	
@@ -453,7 +424,6 @@
 	// Complete the test case request
 	
 	TestPolicy().SignalTestComplete(iStatus.Int());
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0477_DEVICERUNL_EXIT, this );
 	}
 	
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0478.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0478.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,10 +19,6 @@
 #include "PBASE-T_USBDI-0478.h"
 #include "testpolicy.h"
 #include "modelleddevices.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0478Traces.h"
-#endif
 
 
 namespace NUnitTesting_USBDI
@@ -33,12 +29,10 @@
 
 CUT_PBASE_T_USBDI_0478* CUT_PBASE_T_USBDI_0478::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0478_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0478* self = new (ELeave) CUT_PBASE_T_USBDI_0478(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -47,23 +41,19 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0478_CUT_PBASE_T_USBDI_0478_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_CUT_PBASE_T_USBDI_0478_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0478::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0478_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceA(this);
 	BaseConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0478::~CUT_PBASE_T_USBDI_0478()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0478_CUT_PBASE_T_USBDI_0478_ENTRY_DUP01, this );
+	LOG_FUNC
 	
 	Cancel();
 
@@ -80,12 +70,11 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_CUT_PBASE_T_USBDI_0478_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0478::ExecuteHostTestCaseL()	
 	{
-    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0478_EXECUTEHOSTTESTCASEL_ENTRY, this );
+	LOG_FUNC
 
 	// Create the actor for the Function Driver Framework 
 	
@@ -102,23 +91,21 @@
 	// Start the connection timeout timer
 
 	TimeoutIn(30);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0478::HostDoCancel()
 	{
-    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0478_HOSTDOCANCEL_ENTRY, this );
+	LOG_FUNC
 
 	// Cancel the timeout timer for activity
 
 	CancelTimeout();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_HOSTDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0478::ExecuteDeviceTestCaseL()	
 	{
-    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0478_EXECUTEDEVICETESTCASEL_ENTRY, this );
+	LOG_FUNC
 
 	// Create the test device for this test case
 
@@ -129,33 +116,30 @@
 	// Connect the test device to the host
 
 	iTestDevice->SoftwareConnect();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0478::DeviceDoCancel()
 	{
-    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0478_DEVICEDOCANCEL_ENTRY, this );
+	LOG_FUNC
 
 	// Cancel the test device
 	
 	iTestDevice->CancelSubscriptionToReports();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0478::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 	RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0478_DEVICESTATECHANGEL_ENTRY, this );
+	LOG_FUNC
 
 	Cancel();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_DEVICESTATECHANGEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0478::DeviceInsertedL(TUint aDeviceHandle)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 
 	Cancel();
 	TInt err(KErrNone);
@@ -166,13 +150,12 @@
 		{
 		// Incorrect device for this test case	
 
-		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
+		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
 
 		// Start the connection timeout again
 
 		TimeoutIn(30);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 	
@@ -180,27 +163,27 @@
 	err = testDevice.Device().GetTokenForInterface(0,token0);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP01, "<Error %d> Token for interface 0 could not be retrieved",err);
+		RDebug::Printf("<Error %d> Token for interface 0 could not be retrieved",err);
 		return TestFailed(err);
 		}
 	err = iUsbInterface0.Open(token0); // Default interface setting 0
 	if(err != KErrNone)
 		{
-		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0 using token %d",err,token0);
+		RDebug::Printf("<Error %d> Unable to open interface 0 using token %d",err,token0);
 		return TestFailed(err);
 		}
 
 	err = testDevice.Device().GetTokenForInterface(1,token1);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP03, "<Error %d> Token for interface 1 could not be retrieved",err);
+		RDebug::Printf("<Error %d> Token for interface 1 could not be retrieved",err);
 		return TestFailed(err);
 		}
 
 	err = iUsbInterface1.Open(token1);
 	if(err != KErrNone)
 		{
-		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP04, "<Error %d> Unable to open interface using token %d",err,token1);
+		RDebug::Printf("<Error %d> Unable to open interface using token %d",err,token1);
 		return TestFailed(err);
 		}
 
@@ -211,35 +194,33 @@
 		{
 		TBuf<64> msg;
 		msg.Format(_L("<Error> Able to open a concurrent hande to an interface"));
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP05, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(KErrCompletion,msg);
 		iControlEp0->SendRequest(request,this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_EXIT_DUP01, this );
 		return;
 		}
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP06, "Attempt to open concurrent interface handle failed with: %d",err);
+	RDebug::Printf("Attempt to open concurrent interface handle failed with: %d",err);
 	
 	// Inform client device test case successful 
 	User::After(1000000);
 	iCaseStep = EPassed;
 	TTestCasePassed request;
 	iControlEp0->SendRequest(request,this);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_EXIT_DUP02, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0478::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0478_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0478_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{	
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0478_EP0TRANSFERCOMPLETEL_DUP01, msg);
+		RDebug::Print(msg);
 		}
 
 	if(iCaseStep == EPassed)
@@ -256,35 +237,32 @@
 		{
 		return TestFailed(KErrCompletion);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0478::DeviceRemovedL(TUint aDeviceHandle)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0478_DEVICEREMOVEDL_ENTRY, this );
+	LOG_FUNC
 
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 
 	TestFailed(KErrDisconnected);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0478::BusErrorL(TInt aError)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0478_BUSERRORL_ENTRY, this );
+	LOG_FUNC
 
 	// This test case handles no failiures on the bus
 	
 	TestFailed(aError);	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_BUSERRORL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0478::HostRunL()
 	{
-    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0478_HOSTRUNL_ENTRY, this );
+	LOG_FUNC
 
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -292,20 +270,19 @@
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0478_HOSTRUNL, "<Error> Action timeout");
+		RDebug::Printf("<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0478_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
+		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_HOSTRUNL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0478::DeviceRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0478_DEVICERUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Disconnect the device
 	
@@ -314,7 +291,6 @@
 	// Complete the test case request
 	
 	TestPolicy().SignalTestComplete(iStatus.Int());
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0478_DEVICERUNL_EXIT, this );
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0479.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0479.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,10 +19,6 @@
 #include "PBASE-T_USBDI-0479.h"
 #include "testpolicy.h"
 #include "modelleddevices.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0479Traces.h"
-#endif
 
 
 namespace NUnitTesting_USBDI
@@ -33,12 +29,10 @@
 
 CUT_PBASE_T_USBDI_0479* CUT_PBASE_T_USBDI_0479::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0479_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0479* self = new (ELeave) CUT_PBASE_T_USBDI_0479(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -47,23 +41,19 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0479_CUT_PBASE_T_USBDI_0479_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_CUT_PBASE_T_USBDI_0479_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0479::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0479_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceVendor(this);
 	BaseConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0479::~CUT_PBASE_T_USBDI_0479()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0479_CUT_PBASE_T_USBDI_0479_ENTRY_DUP01, this );
+	LOG_FUNC
 	
 	Cancel();
 	
@@ -77,63 +67,56 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_CUT_PBASE_T_USBDI_0479_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0479::ExecuteHostTestCaseL()	
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0479_EXECUTEHOSTTESTCASEL_ENTRY, this );
+	LOG_FUNC
 	
 	iActorFDF = CActorFDF::NewL(*this);
 	iClientAction = new (ELeave) CEp0Transfer(iUsbInterface0);
 	iActorFDF->Monitor();
 	TimeoutIn(30);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0479::HostDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0479_HOSTDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel timing out the test step
 	
 	CancelTimeout();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_HOSTDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0479::ExecuteDeviceTestCaseL()	
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0479_EXECUTEDEVICETESTCASEL_ENTRY, this );
+	LOG_FUNC
 	
 	iTestDevice->OpenL(TestCaseId());
 	iTestDevice->SubscribeToReports(iStatus);
 	SetActive();
 	iTestDevice->SoftwareConnect();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0479::DeviceDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0479_DEVICEDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel the device	
 	iTestDevice->CancelSubscriptionToReports();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0479::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 	RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0479_DEVICESTATECHANGEL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_DEVICESTATECHANGEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0479::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_ENTRY, this );
 	Cancel();
 	TInt err(KErrNone);
 	
@@ -143,13 +126,12 @@
 		{
 		// Incorrect device for this test case	
 
-		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
+		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
 
 		// Start the connection timeout again
 
 		TimeoutIn(30);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 
@@ -159,13 +141,13 @@
 	err = testDevice.Device().GetTokenForInterface(0,validToken);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_DUP01, "<Error %d> Token for interface could not be retrieved",err);
+		RDebug::Printf("<Error %d> Token for interface could not be retrieved",err);
 		return TestFailed(err);
 		}
 	err = iUsbInterface0.Open(validToken); // Default interface setting 0
 	if(err != KErrNone)
 		{
-		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0 using token %d",err,validToken);
+		RDebug::Printf("<Error %d> Unable to open interface 0 using token %d",err,validToken);
 		return TestFailed(err);
 		}
 	
@@ -174,57 +156,54 @@
 		{
 		TBuf<64> msg;
 		msg.Format(_L("<Error %d> Able to open an interface that is not present"),KErrCorrupt);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_DUP03, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(KErrCorrupt,msg);
 		iClientAction->SendRequest(request,this);
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_DUP04, "Opening interface with invalid token failed with %d",err);
+		RDebug::Printf("Opening interface with invalid token failed with %d",err);
 		User::After(1000000);
 		iCaseStep = EPassed;
 		TTestCasePassed request;
 		iClientAction->SendRequest(request,this);	
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0479::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0479_DEVICEREMOVEDL_ENTRY, this );
+	LOG_FUNC
 	
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 
 	TestFailed(KErrDisconnected);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0479::BusErrorL(TInt aError)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0479_BUSERRORL_ENTRY, this );
+	LOG_FUNC
 	
 	// This test case handles no failiures on the bus
 	
 	TestFailed(aError);	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_BUSERRORL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0479::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0479_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{	
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_EP0TRANSFERCOMPLETEL_DUP01, msg);
+		RDebug::Print(msg);
 		}
 
 	if(iCaseStep == EPassed)
@@ -241,33 +220,30 @@
 		{
 		return TestFailed(KErrCompletion);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0479::HostRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0479_HOSTRUNL_ENTRY, this );
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
 	
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_HOSTRUNL, "<Error> Action timeout");
+		RDebug::Printf("<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
+		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_HOSTRUNL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0479::DeviceRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0479_DEVICERUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Disconnect the device
 	
@@ -276,7 +252,6 @@
 	// Complete the test case request
 	
 	TestPolicy().SignalTestComplete(iStatus.Int());
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_DEVICERUNL_EXIT, this );
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0480.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0480.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,10 +19,6 @@
 #include "PBASE-T_USBDI-0480.h"
 #include "testpolicy.h"
 #include "modelleddevices.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0480Traces.h"
-#endif
 
 	
 namespace NUnitTesting_USBDI
@@ -35,12 +31,10 @@
 
 CUT_PBASE_T_USBDI_0480* CUT_PBASE_T_USBDI_0480::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0480* self = new (ELeave) CUT_PBASE_T_USBDI_0480(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -49,23 +43,19 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iPtrTemp(NULL,0)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0480_CUT_PBASE_T_USBDI_0480_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_CUT_PBASE_T_USBDI_0480_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0480::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceA(this);
 	BaseConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0480::~CUT_PBASE_T_USBDI_0480()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_CUT_PBASE_T_USBDI_0480_ENTRY_DUP01, this );
+	LOG_FUNC
 	
 	Cancel();
 	
@@ -81,64 +71,58 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_CUT_PBASE_T_USBDI_0480_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0480::ExecuteHostTestCaseL()	
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_EXECUTEHOSTTESTCASEL_ENTRY, this );
+	LOG_FUNC
 	
 	iActorFDF = CActorFDF::NewL(*this);
 	iControlEp0 = new (ELeave) CEp0Transfer(iUsbInterface0);
 	iActorFDF->Monitor();
 	
 	TimeoutIn(30);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0480::HostDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_HOSTDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	CancelTimeout();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_HOSTDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0480::ExecuteDeviceTestCaseL()	
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_EXECUTEDEVICETESTCASEL_ENTRY, this );
+	LOG_FUNC
 	
 	iTestDevice->OpenL(TestCaseId());
 	iTestDevice->SubscribeToReports(iStatus);
 	SetActive();
 	iTestDevice->SoftwareConnect();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0480::DeviceDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_DEVICEDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel the device	
 	iTestDevice->CancelSubscriptionToReports();	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0480::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 	RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0480_DEVICESTATECHANGEL_ENTRY, this );
+	LOG_FUNC
 	
 	Cancel();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICESTATECHANGEL_EXIT, this );
 	}
 	
 
 void CUT_PBASE_T_USBDI_0480::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 	
 	Cancel();
 	TInt err(KErrNone);
@@ -149,12 +133,11 @@
 		{
 		// Incorrect device for this test case	
 
-		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
+		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
 
 		// Start the connection timeout again
 		TimeoutIn(30);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 
@@ -163,13 +146,13 @@
 	err = testDevice.Device().GetTokenForInterface(0,token0);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP01, "<Error %d> Token for interface 0 could not be retrieved",err);
+		RDebug::Printf("<Error %d> Token for interface 0 could not be retrieved",err);
 		return TestFailed(err);
 		}
 	err = iUsbInterface0.Open(token0); // Default interface setting 0
 	if(err != KErrNone)
 		{
-		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0 using token %d",err,token0);
+		RDebug::Printf("<Error %d> Unable to open interface 0 using token %d",err,token0);
 		return TestFailed(err);
 		}
 	
@@ -178,11 +161,10 @@
 		{
 		TBuf<64> msg;
 		msg.Format(_L("<Error %d> Token for interface 1 could not be retrieved"),err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP03, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT_DUP01, this );
 		return;
 		}
 	err = iUsbInterface1.Open(token1);
@@ -190,11 +172,10 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to open interface 1 using token %d"),err,token1);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP04, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT_DUP02, this );
 		return;
 		}
 	
@@ -206,31 +187,29 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Descriptor for endpoint 0 cannot be obtained"),err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP05, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT_DUP03, this );
 		return;
 		}
 	TUint16 maxPacketSize(endpointDescriptor.MaxPacketSize());
 	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP06, "Maximum packet size for endpoint 1 on interface 1 setting 0 is: %d",maxPacketSize);
+	RDebug::Printf("Maximum packet size for endpoint 1 on interface 1 setting 0 is: %d",maxPacketSize);
 	
 	// Perform a device directed control transfer
 	User::After(1000000);	
 	iCaseStep = EEmptyDeviceXfer;
 	TEmptyDeviceRequest request;
 	iControlEp0->SendRequest(request,this);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT_DUP04, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0480::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
@@ -241,11 +220,10 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_DUP01, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -300,37 +278,34 @@
 			break;
 			
 		default:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_DUP02, "<Error> Unknown test step");
+			RDebug::Printf("<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0480::DeviceRemovedL(TUint aDeviceHandle)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0480_DEVICEREMOVEDL_ENTRY, this );
+	LOG_FUNC
 
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 	TestFailed(KErrDisconnected);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0480::BusErrorL(TInt aError)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0480_BUSERRORL_ENTRY, this );
+	LOG_FUNC
 
 	// This test case handles no failiures on the bus	
 	TestFailed(KErrGeneral);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_BUSERRORL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0480::HostRunL()
 	{
-    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_HOSTRUNL_ENTRY, this );
+	LOG_FUNC
 
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -338,27 +313,25 @@
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_HOSTRUNL, "<Error> Action timeout");
+		RDebug::Printf("<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0480_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
+		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_HOSTRUNL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0480::DeviceRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0480_DEVICERUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Disconnect the device	
 	iTestDevice->SoftwareDisconnect();
 	
 	// Complete the test case request	
 	TestPolicy().SignalTestComplete(iStatus.Int());
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0480_DEVICERUNL_EXIT, this );
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0481.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0481.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,10 +20,6 @@
 #include "testpolicy.h"
 #include "testdebug.h"
 #include "modelleddevices.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0481Traces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -33,12 +29,10 @@
 
 CUT_PBASE_T_USBDI_0481* CUT_PBASE_T_USBDI_0481::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0481_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0481* self = new (ELeave) CUT_PBASE_T_USBDI_0481(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	} 
 	
@@ -47,23 +41,19 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0481_CUT_PBASE_T_USBDI_0481_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_CUT_PBASE_T_USBDI_0481_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0481::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0481_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceA(this);
 	BaseConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0481::~CUT_PBASE_T_USBDI_0481()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0481_CUT_PBASE_T_USBDI_0481_ENTRY_DUP01, this );
+	LOG_FUNC
 	
 	Cancel();
 	
@@ -79,12 +69,11 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_CUT_PBASE_T_USBDI_0481_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0481::ExecuteHostTestCaseL()	
 	{
-    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0481_EXECUTEHOSTTESTCASEL_ENTRY, this );
+	LOG_FUNC
 
 	// Create the actor for the Function Driver Framework 	
 	iActorFDF = CActorFDF::NewL(*this);
@@ -97,13 +86,12 @@
 	
 	// Start the connection timeout timer
 	TimeoutIn(30);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0481::ExecuteDeviceTestCaseL()	
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0481_EXECUTEDEVICETESTCASEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Create the test device	
 	iTestDevice->OpenL(TestCaseId());
@@ -112,42 +100,38 @@
 	
 	// Connect the device to the host	
 	iTestDevice->SoftwareConnect();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0481::HostDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0481_HOSTDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel the test step action timeout timer	
 	CancelTimeout();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_HOSTDOCANCEL_EXIT, this );
 	}
 
 	
 void CUT_PBASE_T_USBDI_0481::DeviceDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0481_DEVICEDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel the device (the activity timer and the error reporting)	
 	iTestDevice->CancelSubscriptionToReports();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0481::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 		RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0481_DEVICESTATECHANGEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_DEVICESTATECHANGEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0481::DeviceInsertedL(TUint aDeviceHandle)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 
 	// Cancel the timeout timer	
 	Cancel();
@@ -159,12 +143,11 @@
 	if(testDevice.SerialNumber().Compare(TestCaseId()) != 0)
 		{
 		// Incorrect device for this test case
-		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
+		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
 
 		// Start the connection timeout again
 		TimeoutIn(30);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}	
 	
@@ -172,7 +155,7 @@
 	err = testDevice.Device().GetTokenForInterface(0,iToken0);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP01, "<Error %d> Unable to retrieve token for interface 0",err);
+		RDebug::Printf("<Error %d> Unable to retrieve token for interface 0",err);
 		TestFailed(err);
 		}
 	
@@ -180,7 +163,7 @@
 	err = iUsbInterface0.Open(iToken0);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0", err);
+		RDebug::Printf("<Error %d> Unable to open interface 0");
 		TestFailed(err);
 		}
 		
@@ -189,14 +172,14 @@
 	err = testDevice.Device().GetTokenForInterface(1,token1);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP03, "<Error %d> token1 for interface 1",err);
+		RDebug::Printf("<Error %d> token1 for interface 1",err);
 		return TestFailed(err);
 		}
 	// Open interface 1
 	err = iUsbInterface1.Open(token1); // Alternate interface setting 0
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP04, "<Error %d> Unable to open interface 1", err);
+		RDebug::Printf("<Error %d> Unable to open interface 1");
 		return TestFailed(err);
 		}
 
@@ -205,16 +188,16 @@
 	err = testDevice.Device().GetTokenForInterface(1,token1Bis);
 	if(err != KErrInUse)
 		{
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP05, "GetTokenForInterface(1,token1Bis), err != KErrInUse");
+		RDebug::Printf("GetTokenForInterface(1,token1Bis), err != KErrInUse");
 		return TestFailed(err);
 		}
 		
 	// Open interface 1 again, fails
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP06, "open it twice, catch error Code");
+	RDebug::Printf("open it twice, catch error Code");
 	err = iUsbInterface1.Open(token1); // Alternate interface setting 0
 	if(err != KErrInUse)
 		{
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP07, "iUsbInterface1.Open(token1), err != KErrInUse");
+		RDebug::Printf("iUsbInterface1.Open(token1), err != KErrInUse");
 		return TestFailed(err);
 		}
 
@@ -223,20 +206,19 @@
 	iCaseStep = EPassed;
 	TTestCasePassed request;
 	iControlEp0->SendRequest(request,this);	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0481::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0481_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{	
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_EP0TRANSFERCOMPLETEL_DUP01, msg);
+		RDebug::Print(msg);
 		}
 
 	if(iCaseStep == EPassed)
@@ -253,33 +235,30 @@
 		{
 		return TestFailed(KErrCompletion);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0481::DeviceRemovedL(TUint aDeviceHandle)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0481_DEVICEREMOVEDL_ENTRY, this );
+	LOG_FUNC
 
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 	TestFailed(KErrDisconnected);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0481::BusErrorL(TInt aError)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0481_BUSERRORL_ENTRY, this );
+	LOG_FUNC
 
 	// This test case handles no failiures on the bus
 	TestFailed(aError);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_BUSERRORL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0481::HostRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0481_HOSTRUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -287,15 +266,14 @@
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_HOSTRUNL, "<Error> Action timeout");
+		RDebug::Printf("<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0481_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
+		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_HOSTRUNL_EXIT, this );
 	}
 
 /**
@@ -304,12 +282,11 @@
 */
 void CUT_PBASE_T_USBDI_0481::DeviceRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0481_DEVICERUNL_ENTRY, this );
+	LOG_FUNC	
 	// Disconnect the device	
 	iTestDevice->SoftwareDisconnect();	
 	// Complete the test case request	
 	TestPolicy().SignalTestComplete(iStatus.Int());
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0481_DEVICERUNL_EXIT, this );
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0482.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0482.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,10 +18,6 @@
 
 #include "PBASE-T_USBDI-0482.h"
 #include "tada22.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0482Traces.h"
-#endif
 #include <d32usbdescriptors.h>
 
 
@@ -49,12 +45,10 @@
 
 CUT_PBASE_T_USBDI_0482* CUT_PBASE_T_USBDI_0482::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0482_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0482* self = new (ELeave) CUT_PBASE_T_USBDI_0482(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -63,25 +57,21 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0482_CUT_PBASE_T_USBDI_0482_ENTRY, this );
 	iEndpointAddressIn = 0x84;
 	iEndpointAddressOut = 0x01;
 	iOutTransferBuf.CreateL(KChunkSize);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_CUT_PBASE_T_USBDI_0482_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0482::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0482_CONSTRUCTL_ENTRY, this );
 	BaseConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0482::~CUT_PBASE_T_USBDI_0482()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0482_CUT_PBASE_T_USBDI_0482_ENTRY_DUP01, this );
+	LOG_FUNC
 	
 	Cancel();
 		
@@ -102,12 +92,11 @@
 	delete iIsochInTransfer;
 	delete iControlEp0;
 	delete iActorFDF;
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_CUT_PBASE_T_USBDI_0482_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0482::ExecuteHostTestCaseL()	
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0482_EXECUTEHOSTTESTCASEL_ENTRY, this );
+	LOG_FUNC
 	
 	iActorFDF = CActorFDF::NewL(*this);
 	iControlEp0 = new (ELeave) CEp0Transfer(iUsbInterface0);
@@ -115,101 +104,90 @@
 	
 	// Wait for the usb headset to be connected	
 	TimeoutIn(30);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 
 		
 void CUT_PBASE_T_USBDI_0482::HostDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0482_HOSTDOCANCEL_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_HOSTDOCANCEL_EXIT, this );
+	LOG_FUNC	
 	}	
 	
 
 void CUT_PBASE_T_USBDI_0482::ExecuteDeviceTestCaseL()	
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0482_EXECUTEDEVICETESTCASEL_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_EXECUTEDEVICETESTCASEL_EXIT, this );
+	LOG_FUNC
 	}
 		
 	
 void CUT_PBASE_T_USBDI_0482::DeviceDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0482_DEVICEDOCANCEL_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_DEVICEDOCANCEL_EXIT, this );
+	LOG_FUNC
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0482::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState,
 		TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0482_DEVICESTATECHANGEL_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_DEVICESTATECHANGEL_EXIT, this );
+	LOG_FUNC	
 	}
 	
 
 TInt CUT_PBASE_T_USBDI_0482::FindOUTIsochronousEndpoint(TUsbGenericDescriptor*& aDescriptor)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_ENTRY, this );
+	LOG_FUNC	
 	aDescriptor = NULL;
 
 	TUsbInterfaceDescriptor alternate;
 	TInt err = iUsbInterface1.GetAlternateInterfaceDescriptor(1, alternate);
 	if(err)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT, "iUsbInterface1.GetAlternateInterfaceDescriptor error = %d",err);
-		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_EXIT, this, err );
+		RDebug::Printf("iUsbInterface1.GetAlternateInterfaceDescriptor error = %d",err);
 		return err;
 		} 
 
 	TUsbGenericDescriptor* descriptor = alternate.iFirstChild;
 	while(descriptor)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_DUP01, "ibDescriptorType = %d", descriptor->ibDescriptorType);
+		RDebug::Printf("ibDescriptorType = %d", descriptor->ibDescriptorType);
 		if(descriptor->ibDescriptorType == EEndpoint)
 			{
 			aDescriptor = descriptor;
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_DUP02, "found descriptor return KErrNone");
-			OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_EXIT_DUP01, this, KErrNone );
+			RDebug::Printf("found descriptor return KErrNone");
 			return KErrNone;
 			}	
 		descriptor = descriptor->iNextPeer;
 		}
 
-	OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_EXIT_DUP02, this, KErrNotFound );
 	return KErrNotFound;	
 	}
 
 	
 TInt CUT_PBASE_T_USBDI_0482::FindINIsochronousEndpoint(TUsbGenericDescriptor*& aDescriptor)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_ENTRY, this );
+	LOG_FUNC	
 	aDescriptor = NULL;
 
 	TUsbInterfaceDescriptor alternate;
 	TInt err = iUsbInterface2.GetAlternateInterfaceDescriptor(1, alternate);
 	if(err)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT, "iUsbInterface2.GetAlternateInterfaceDescriptor error = %d",err);
-		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_EXIT, this, err );
+		RDebug::Printf("iUsbInterface2.GetAlternateInterfaceDescriptor error = %d",err);
 		return err;
 		} 
 
 	TUsbGenericDescriptor* descriptor = alternate.iFirstChild;
 	while(descriptor)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_DUP01, "ibDescriptorType = %d", descriptor->ibDescriptorType);
+		RDebug::Printf("ibDescriptorType = %d", descriptor->ibDescriptorType);
 		if(descriptor->ibDescriptorType == EEndpoint)
 			{
 			aDescriptor = descriptor;
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_DUP02, "found descriptor return KErrNone");
-			OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_EXIT_DUP01, this, KErrNone );
+			RDebug::Printf("found descriptor return KErrNone");
 			return KErrNone;
 			}
 		descriptor = descriptor->iNextPeer;
 		}
 
-	OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_EXIT_DUP02, this, KErrNotFound );
 	return KErrNotFound;	
 	}	
 	
@@ -217,7 +195,7 @@
 	
 void CUT_PBASE_T_USBDI_0482::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 	
 	Cancel();
 	CUsbTestDevice& testDevice = iActorFDF->DeviceL(aDeviceHandle);
@@ -235,7 +213,7 @@
 	
 	CHECK(iUsbInterface1.Open(token1) == KErrNone); // Default interface setting 0
 	
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL, "Selecting alternate interface setting 1");
+	RDebug::Printf("Selecting alternate interface setting 1");		
 	CHECK(iUsbInterface1.SelectAlternateInterface(1) == KErrNone);
 
 	
@@ -245,21 +223,21 @@
 	CHECK(iUsbInterface2.Open(token2) == KErrNone); // Default interface setting 0
 
 	
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP01, "Selecting alternate interface setting 1");
+	RDebug::Printf("Selecting alternate interface setting 1");		
 	CHECK(iUsbInterface2.SelectAlternateInterface(1) == KErrNone);
 
 																
 	iCaseStep = EWaitEndOfMusicTrack;
 												
 	// Open a pipe for endpoint (Isoch out)		
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP02, "Finding address for an out isoch endpoint on interface 1 setting 1");
+	RDebug::Printf("Finding address for an out isoch endpoint on interface 1 setting 1");
 	// Isochronous OUT	
 	TUsbGenericDescriptor* isochEpDescriptorOut;
 	CHECK(KErrNone == FindOUTIsochronousEndpoint(isochEpDescriptorOut));
 	
 	// Get the maximum packet size for this isochronous endpoint
 	TUint16 wMaxPacketSizeOut = isochEpDescriptorOut->TUint16At(KMaxPacketSizeOffset);	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP03, "wMaxPacketSizeOut = %d", wMaxPacketSizeOut);
+	RDebug::Printf("wMaxPacketSizeOut = %d", wMaxPacketSizeOut);
 	CHECK(wMaxPacketSizeOut == KMaxPacketSizeOutExpected); 
 	
 	// Isochronous IN		
@@ -268,22 +246,22 @@
 	
 	// Get the maximum packet size for this isochronous endpoint
 	TUint16 wMaxPacketSizeIn = isochEpDescriptorIn->TUint16At(KMaxPacketSizeOffset);	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP04, "wMaxPacketSizeIn = %d", wMaxPacketSizeIn);
+	RDebug::Printf("wMaxPacketSizeIn = %d", wMaxPacketSizeIn);
 	CHECK(wMaxPacketSizeIn == KMaxPacketSizeInExpected); 
 		
 	
 	// open pipes now.
 	// Out
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP05, "Opening a pipe to %08x",iEndpointAddressOut);
+	RDebug::Printf("Opening a pipe to %08x",iEndpointAddressOut);
 	CHECK(iUsbInterface1.OpenPipeForEndpoint(iPipeOut,iEndpointAddressOut,EFalse) == KErrNone);
 		
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP06, "Opened pipe to endpoint address %08x for isochronous transfer to device",iEndpointAddressOut);
+	RDebug::Printf("Opened pipe to endpoint address %08x for isochronous transfer to device",iEndpointAddressOut);
 				
 	// In
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP07, "Opening a pipe to %08x",iEndpointAddressIn);		
+	RDebug::Printf("Opening a pipe to %08x",iEndpointAddressIn);		
 	CHECK(iUsbInterface2.OpenPipeForEndpoint(iPipeIn,iEndpointAddressIn,EFalse) == KErrNone);
 		
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP08, "Opened pipe to endpoint address %08x for isochronous transfer to device",iEndpointAddressIn);
+	RDebug::Printf("Opened pipe to endpoint address %08x for isochronous transfer to device",iEndpointAddressIn);
 	
 	// SET_CUR class specific command
 	TSetCurRequest request(KHighRecordSamplingRate ,iEndpointAddressIn);
@@ -297,7 +275,7 @@
 	CHECK(iIsochInTransfer->RegisterTransferDescriptor() == KErrNone);
 			
 	// Initialise the descriptors for transfer	
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP09, "Initialising the transfer descriptors interface 2");
+	RDebug::Printf("Initialising the transfer descriptors interface 2"); 
 	CHECK(iUsbInterface2.InitialiseTransferDescriptors() == KErrNone);
 
 				
@@ -334,7 +312,7 @@
 	// create Transfers
 	for(iChunk = 0; iChunk < nbChunks; iChunk++)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP10, "iChunk = %d", iChunk);
+		RDebug::Printf("iChunk = %d", iChunk);
 		
 		// remainder(last loop)
 		if(remainderSize != 0 && (iChunk == nbChunks-1))
@@ -349,18 +327,18 @@
 		}			
 	
 	// Initialise the descriptors for transfer	
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP11, "Initialising the transfer descriptors");
+	RDebug::Printf("Initialising the transfer descriptors"); 
 	CHECK(iUsbInterface1.InitialiseTransferDescriptors() == KErrNone);
 	
 	// prepare & send transfers(TODO streaming algorithm with 3 Transfers only, filling 2 while the 3rd is transferring his data)
 	size = KChunkSize;
 	for(TInt iTransfers = 0; iTransfers < iOutTransfers.Count(); iTransfers++)
 		{	
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP12, "iTransfers = %d", iTransfers);	
+		RDebug::Printf("iTransfers = %d", iTransfers);	
 		// remainder(last loop)
 		if(remainderSize != 0 && (iTransfers == iOutTransfers.Count()-1))
 			{
-			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP13, "remainderSize = %d", remainderSize);
+			RDebug::Printf("remainderSize = %d", remainderSize);
 			size = remainderSize;
 			}			
 		CHECK(trackFile.Read(KChunkSize*iTransfers, iOutTransferBuf, size) == KErrNone);
@@ -368,20 +346,19 @@
 		CHECK(iOutTransfers[iTransfers]->TransferOut() == KErrNone);
 		iOutTransferBuf.Zero();		
 		}												
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_EXIT, this );
 	}
 	
 TBool CUT_PBASE_T_USBDI_0482::ReplayRecordedData()
 	{
-		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA_ENTRY, this );
+	LOG_FUNC
 		
 	iOutTransferBuf.Zero();	
 	
 	// Transfer OUT						
 	TInt nbChunks = iDataPolledBuf.Length()/KChunkSize;
 	TInt remainderSize = iDataPolledBuf.Length()%KChunkSize; 
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA, "nbChunks = %d", nbChunks);
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA_DUP01, "remainderSize = %d", remainderSize);
+	RDebug::Printf("nbChunks = %d", nbChunks);
+	RDebug::Printf("remainderSize = %d", remainderSize);
 		
 	if(remainderSize != 0) 
 		{
@@ -391,31 +368,29 @@
 	// prepare transfers	
 	for(TInt iTransfers = 0; iTransfers < nbChunks; iTransfers++)
 		{	
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA_DUP02, "iTransfers = %d", iTransfers);	
+		RDebug::Printf("iTransfers = %d", iTransfers);	
 		// remainder(last loop)
 		if(remainderSize != 0 && (iTransfers == nbChunks-1))
 			{
-			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA_DUP03, "remainderSize = %d", remainderSize);
+			RDebug::Printf("remainderSize = %d", remainderSize);
 			}		
 		CHECK_RET_BOOL(iOutTransfers[iTransfers]->PrepareTransfer(iDataPolledBuf) == KErrNone); // TODO retrieve relevant part of iDataPolledBuf if several chunks
 		CHECK_RET_BOOL(iOutTransfers[iTransfers]->TransferOut() == KErrNone);
 		iOutTransferBuf.Zero();	
 		}
-	OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA_EXIT, this, ETrue );
 	return ETrue;			
 	}
 		
 void CUT_PBASE_T_USBDI_0482::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_ENTRY, this );
-	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
+	LOG_FUNC
+	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
 	Cancel();
 
 	if(aCompletionCode != KErrNone)
 		{
-		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_DUP01, "<Error %d> Transfer %d not successful",aCompletionCode,aTransferId);
+		RDebug::Printf("<Error %d> Transfer %d not successful",aCompletionCode,aTransferId);
 		TestFailed(aCompletionCode);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_EXIT, this );
 		return;
 		}
 	
@@ -425,7 +400,6 @@
 		// 1. save data recorded
 		CHECK(iIsochInTransfer->DataPolled(KRecordedPacketsExpected, iDataPolledBuf));
 		// 2. waiting now for the end of the music track
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_EXIT_DUP01, this );
 		return;	
 		}
 				
@@ -435,14 +409,14 @@
 			{
 			if(aTransferId != iExpectedTransferId)
 				{
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_DUP02, "unexpected transfer!");
+				RDebug::Printf("unexpected transfer!");
 				TestFailed(KErrCorrupt);
 				}
 			iExpectedTransferId++;		
 			// is it the last transfer?
 			if(iExpectedTransferId == iOutTransfers.Count())
 				{
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_DUP03, "last transfer successful! lets replay recorded data");
+				RDebug::Printf("last transfer successful! lets replay recorded data");
 						
 				iCaseStep = EReplayRecordedData; // assuming that recording is finished
 				TSetCurRequest request(KLowSamplingRate ,iEndpointAddressOut);
@@ -461,20 +435,18 @@
 			TestFailed(KErrDisconnected);
 			break;
 		}			
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_EXIT_DUP02, this );
 	}									   
 
 void CUT_PBASE_T_USBDI_0482::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL_ENTRY, this );
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL, "Transfer EP0 completed aCompletionCode = %d", aCompletionCode);
+	LOG_FUNC
+	RDebug::Printf("Transfer EP0 completed aCompletionCode = %d", aCompletionCode);
 
 	if(aCompletionCode != KErrNone)
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL_DUP01, msg);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL_EXIT, this );
+		RDebug::Print(msg);			
 		return;			
 		}	
 	switch(iCaseStep)
@@ -489,17 +461,16 @@
 			break;			
 		
 		default:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL_DUP02, "<Error> Unknown test step");
+			RDebug::Printf("<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}	
 	 	
 	
 void CUT_PBASE_T_USBDI_0482::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0482_DEVICEREMOVEDL_ENTRY, this );
+	LOG_FUNC
 	
 	// Manual test over	
 	switch(iCaseStep)
@@ -513,22 +484,20 @@
 			TestFailed(KErrDisconnected);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0482::BusErrorL(TInt aError)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0482_BUSERRORL_ENTRY, this );
+	LOG_FUNC	
 	// This test case handles no failiures on the bus	
 	TestFailed(KErrCompletion);	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_BUSERRORL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0482::HostRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0482_HOSTRUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -536,21 +505,18 @@
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_HOSTRUNL, "<Error> Action timeout");
+		RDebug::Printf("<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0482_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
+		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_HOSTRUNL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0482::DeviceRunL()
 	{	
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0482_DEVICERUNL_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0482_DEVICERUNL_EXIT, this );
 	}
 		
 	}
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0483.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0483.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,10 +19,6 @@
 #include "PBASE-T_USBDI-0483.h"
 #include "testpolicy.h"
 #include "modelleddevices.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0483Traces.h"
-#endif
 
 
 namespace NUnitTesting_USBDI
@@ -33,12 +29,10 @@
 
 CUT_PBASE_T_USBDI_0483* CUT_PBASE_T_USBDI_0483::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0483_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0483* self = new (ELeave) CUT_PBASE_T_USBDI_0483(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -47,23 +41,18 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0483_CUT_PBASE_T_USBDI_0483_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_CUT_PBASE_T_USBDI_0483_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0483::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0483_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceB(this);
 	BaseConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0483::~CUT_PBASE_T_USBDI_0483()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0483_CUT_PBASE_T_USBDI_0483_ENTRY_DUP01, this );
 	Cancel();
 	
 	// Close the interface
@@ -76,12 +65,11 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_CUT_PBASE_T_USBDI_0483_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0483::ExecuteHostTestCaseL()	
 	{
-OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0483_EXECUTEHOSTTESTCASEL_ENTRY, this );
+	LOG_FUNC
 
 	// Create the actor for the Function Driver Framework 
 	
@@ -99,23 +87,21 @@
 
 	TimeoutIn(30);
 
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0483::HostDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0483_HOSTDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel the test step timeout timer
 	
 	CancelTimeout();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_HOSTDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0483::ExecuteDeviceTestCaseL()	
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0483_EXECUTEDEVICETESTCASEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Create the test device
 	
@@ -126,35 +112,32 @@
 	// Connect the device to the host
 	
 	iTestDevice->SoftwareConnect();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0483::DeviceDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0483_DEVICEDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel the reporting or errors from opertaions perfomed by the test device
 	
 	iTestDevice->CancelSubscriptionToReports();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0483::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 		RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0483_DEVICESTATECHANGEL_ENTRY, this );
+	LOG_FUNC       
 	
 	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_DEVICESTATECHANGEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0483::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
@@ -165,11 +148,10 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL_DUP01, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -198,15 +180,14 @@
 			break;
 			
 		default:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL_DUP02, "<Error> Unknown test step");
+			RDebug::Printf("<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}	
 void CUT_PBASE_T_USBDI_0483::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC 
 	Cancel();
 	
 	TInt err(KErrNone);
@@ -218,89 +199,83 @@
 		{
 		// Incorrect device for this test case	
 
-		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
+		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
 
 		// Start the connection timeout again
 
 		TimeoutIn(30);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}	
 		
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_DUP01, "iControlEp0->SendRequest(getConfiguration,this)");
+	RDebug::Printf("iControlEp0->SendRequest(getConfiguration,this)");
 	TUint32 token0;
 	err = testDevice.Device().GetTokenForInterface(0,token0);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_DUP02, "<Error %d> Token for interface 0 could not be retrieved",err);
+		RDebug::Printf("<Error %d> Token for interface 0 could not be retrieved",err);
 		return TestFailed(err);
 		}
 	err = iUsbInterface0.Open(token0); // Default interface setting 0
 	if(err != KErrNone)
 		{
-		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_DUP03, "<Error %d> Unable to open interface 1 using token %d",err,token0);
+		RDebug::Printf("<Error %d> Unable to open interface 1 using token %d",err,token0);
 		return TestFailed(err);
 		} 
 	
 	// get config. descriptor now
 	TUint totalLength = testDevice.ConfigurationDescriptor().TotalLength();
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_DUP04, "totalLength ==== %d",totalLength);
+	RDebug::Printf("totalLength ==== %d",totalLength);
 	iConfigDescriptorData = HBufC8::NewL(totalLength); 		
 	TPtr8 des(iConfigDescriptorData->Des());
 	des.SetLength(totalLength);		
 	TDescriptorGetRequest getConfiguration(KGetConfigDescriptor,0,des);
 	iControlEp0->SendRequest(getConfiguration,this);	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}	 
 
 	
 void CUT_PBASE_T_USBDI_0483::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0483_DEVICEREMOVEDL_ENTRY, this );
+	LOG_FUNC
 	
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 	
 	TestFailed(KErrDisconnected);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0483::BusErrorL(TInt aError)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0483_BUSERRORL_ENTRY, this );
+	LOG_FUNC
 	
 	// This test case handles no failiures on the bus
 	
 	TestFailed(KErrCompletion);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_BUSERRORL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0483::HostRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0483_HOSTRUNL_ENTRY, this );
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
 	
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0483_HOSTRUNL, "<Error> Action timeout");
+		RDebug::Printf("<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0483_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
+		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_HOSTRUNL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0483::DeviceRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0483_DEVICERUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Disconnect the device
 	
@@ -309,7 +284,6 @@
 	// Complete the test case request
 	
 	TestPolicy().SignalTestComplete(iStatus.Int());
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0483_DEVICERUNL_EXIT, this );
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0484.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0484.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,10 +19,6 @@
 #include "PBASE-T_USBDI-0484.h"
 #include "testpolicy.h"
 #include "modelleddevices.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0484Traces.h"
-#endif
 
 
  
@@ -41,12 +37,10 @@
 
 CUT_PBASE_T_USBDI_0484* CUT_PBASE_T_USBDI_0484::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0484_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0484* self = new (ELeave) CUT_PBASE_T_USBDI_0484(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -55,37 +49,32 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0484_CUT_PBASE_T_USBDI_0484_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_CUT_PBASE_T_USBDI_0484_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0484::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0484_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0484::~CUT_PBASE_T_USBDI_0484()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0484_CUT_PBASE_T_USBDI_0484_ENTRY_DUP01, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_CUT_PBASE_T_USBDI_0484_EXIT_DUP01, this );
+	LOG_FUNC
 	}
 	
 void CUT_PBASE_T_USBDI_0484::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0484_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	Cancel();	
 	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{	
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_EP0TRANSFERCOMPLETEL_DUP01, msg);
+		RDebug::Print(msg);
 		}
 
 	if(iCaseStep == EPassed)
@@ -102,16 +91,14 @@
 		{
 		return TestFailed(KErrCompletion);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0484::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_ENTRY, this );
 	Cancel();
 	TInt err(KErrNone);
-	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
+	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
 
 	if(aTransferId == KBulkTransferId1)
 		{
@@ -121,7 +108,7 @@
 				{
 				TBuf<256> msg;
 				msg.Format(_L("<Error %d> The transfer completed with no errors but should have stalled"),aCompletionCode);
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP01, msg);
+				RDebug::Print(msg);
 				TTestCaseFailed request(KErrCorrupt,msg);
 				return iControlEp0->SendRequest(request,this);
 				}
@@ -133,14 +120,14 @@
 					{
 					TBuf<256> msg;
 					msg.Format(_L("<Error %d> The remote stall cannot be cleared"),err);
-					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP02, msg);
+					RDebug::Print(msg);
 					iCaseStep = EFailed;
 					TTestCaseFailed request(err,msg);
 					return iControlEp0->SendRequest(request,this);
 					}
 					
 				// try to get data now, after EP has been stalled
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP03, "try to get data now, after EP has been stalled");
+				RDebug::Printf("try to get data now, after EP has been stalled");
 				iInTransfer[0]->TransferIn(KDataPayload1().Length());
 				iInTransfer[1]->TransferIn(KDataPayload2().Length());
 				iInTransfer[2]->TransferIn(KDataPayload3().Length());
@@ -148,7 +135,6 @@
 				iCaseStep = ETransferAfterStall;
 				TEndpointWriteRequest request(1,1,KDataPayload1);// EP1 because 1st writter EP
 				iControlEp0->SendRequest(request,this);	
-				OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_EXIT, this );
 				return;		
 				}
 			}
@@ -158,7 +144,7 @@
 				{
 				TBuf<256> msg;
 				msg.Format(_L("<Error %d> No data got after EP2 being stalled"),aCompletionCode);
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP04, msg);
+				RDebug::Print(msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(err,msg);
 				return iControlEp0->SendRequest(request,this);
@@ -171,13 +157,13 @@
 				{
 				TBuf<256> msg;
 				msg.Format(_L("<Error %d> Interrupt data received does not match data sent"),KErrCompletion);
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP05, msg);
+				RDebug::Print(msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(KErrCompletion,msg);
 				return iControlEp0->SendRequest(request,this);
 				}			 
 			// Comparison is a match, wait for next transfer
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP06, "Comparison is a match, wait for transfer 2");
+			RDebug::Printf("Comparison is a match, wait for transfer 2");
 			User::After(500000);
 			TEndpointWriteRequest request(1,1,KDataPayload2);// EP1 because 1st writter EP
 			iControlEp0->SendRequest(request,this);						
@@ -189,7 +175,7 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> No data got after EP2 being stalled"),aCompletionCode);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP07, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(err,msg);
 			return iControlEp0->SendRequest(request,this);
@@ -202,13 +188,13 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Interrupt data received does not match data sent"),KErrCompletion);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP08, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(KErrCompletion,msg);
 			return iControlEp0->SendRequest(request,this);
 			}			 
 		// Comparison is a match, wait for next transfer
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP09, "Comparison is a match, wait for transfer 3");
+		RDebug::Printf("Comparison is a match, wait for transfer 3");
 		User::After(500000);
 		TEndpointWriteRequest request(1,1,KDataPayload3);// EP1 because 1st writter EP
 		iControlEp0->SendRequest(request,this);					
@@ -219,7 +205,7 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> No data got after EP2 being stalled"),aCompletionCode);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP10, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(err,msg);
 			return iControlEp0->SendRequest(request,this);
@@ -231,7 +217,7 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Interrupt data received does not match data sent"),KErrCompletion);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP11, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(KErrCompletion,msg);
 			return iControlEp0->SendRequest(request,this);
@@ -243,19 +229,18 @@
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP12, "<Error> a transfer completed (id=%d) that was not expected",aTransferId);
+		RDebug::Printf("<Error> a transfer completed (id=%d) that was not expected",aTransferId);
 		return TestFailed(KErrCorrupt);
 		}	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0484::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 	
 	Cancel();
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL, "this - %08x", this);
+	RDebug::Printf("this - %08x", this);
 	
 	TBuf<256> msg;
 	TInt err = KErrNone;
@@ -273,7 +258,7 @@
 		iInTransfer[2] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,256,*this,KBulkTransferId3);	
 		
 		// Initialise the descriptors for transfer		
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL_DUP01, "Initialising the transfer descriptors - interface 1");
+		RDebug::Printf("Initialising the transfer descriptors - interface 1");
 		err = iUsbInterface1.InitialiseTransferDescriptors();
 		if(err != KErrNone)
 			{
@@ -283,7 +268,7 @@
 		}
 	if(err != KErrNone)
 		{
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL_DUP02, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
@@ -296,7 +281,6 @@
 		TStallEndpointRequest r2(2,1); // Stall endpoint 2 interface 1
 		iControlEp0->SendRequest(r2,this);		
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL_EXIT, this );
 	}
 	
 	}
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0485.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0485.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,10 +20,6 @@
 #include "testpolicy.h"
 #include "testdebug.h"
 #include "modelleddevices.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0485Traces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -33,12 +29,10 @@
 
 CUT_PBASE_T_USBDI_0485* CUT_PBASE_T_USBDI_0485::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0485_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0485* self = new (ELeave) CUT_PBASE_T_USBDI_0485(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	} 
 	
@@ -47,23 +41,19 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0485_CUT_PBASE_T_USBDI_0485_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_CUT_PBASE_T_USBDI_0485_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0485::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0485_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceVendor(this);
 	BaseConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0485::~CUT_PBASE_T_USBDI_0485()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0485_CUT_PBASE_T_USBDI_0485_ENTRY_DUP01, this );
+	LOG_FUNC
 	
 	Cancel();
 	
@@ -77,12 +67,11 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_CUT_PBASE_T_USBDI_0485_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0485::ExecuteHostTestCaseL()	
 	{
-OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0485_EXECUTEHOSTTESTCASEL_ENTRY, this );
+	LOG_FUNC
 
 	// Create the actor for the Function Driver Framework 
 	
@@ -99,13 +88,12 @@
 	// Start the connection timeout timer
 
 	TimeoutIn(30);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0485::ExecuteDeviceTestCaseL()	
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0485_EXECUTEDEVICETESTCASEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Create the test device
 	
@@ -116,44 +104,40 @@
 	// Connect the device to the host
 	
 	iTestDevice->SoftwareConnect();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0485::HostDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0485_HOSTDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel the test step action timeout timer
 	
 	CancelTimeout();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_HOSTDOCANCEL_EXIT, this );
 	}
 
 	
 void CUT_PBASE_T_USBDI_0485::DeviceDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0485_DEVICEDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel the device (the activity timer and the error reporting)
 	
 	iTestDevice->CancelSubscriptionToReports();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0485::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 		RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0485_DEVICESTATECHANGEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_DEVICESTATECHANGEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0485::DeviceInsertedL(TUint aDeviceHandle)
 	{
-OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 
 	// Cancel the timeout timer
 	
@@ -168,13 +152,12 @@
 		{
 		// Incorrect device for this test case	
 
-		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
+		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
 
 		// Start the connection timeout again
 
 		TimeoutIn(30);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}	
 	
@@ -183,7 +166,7 @@
 	err = testDevice.Device().GetTokenForInterface(0,iToken0);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_DUP01, "<Error %d> Unable to retrieve token for interface 0",err);
+		RDebug::Printf("<Error %d> Unable to retrieve token for interface 0",err);
 		TestFailed(err);
 		}
 	
@@ -191,7 +174,7 @@
 	err = iUsbInterface0.Open(iToken0);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0", err);
+		RDebug::Printf("<Error %d> Unable to open interface 0");
 		TestFailed(err);
 		}
 	
@@ -204,16 +187,15 @@
 	
 	// Wait 1 second then close the interface	
 	User::After(1000000);
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_DUP03, "Closing interface 0");
+	RDebug::Printf("Closing interface 0");
 	iUsbInterface0.Close();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0485::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 		
 	switch(iCaseStep)
 		{
@@ -221,24 +203,24 @@
 			{
 			if(aCompletionCode != KErrCancel)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_DUP01, "<Error %d> Nakking request was not cancelled by stack",aCompletionCode);
+				RDebug::Printf("<Error %d> Nakking request was not cancelled by stack",aCompletionCode);
 				return TestFailed(aCompletionCode);
 				}
 		
 			// No panic or leave so passed
 			
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_DUP02, "No leave or panic occured so open interface again and send test passed");
+			RDebug::Printf("No leave or panic occured so open interface again and send test passed");
 			
 			// Open the interface
 			
 			TInt err(iUsbInterface0.Open(iToken0));
 			if(err != KErrNone)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_DUP03, "<Error %d> Unable to open interface 0", err);
+				RDebug::Printf("<Error %d> Unable to open interface 0");
 				return TestFailed(err);
 				}
 			
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_DUP04, "Interface 0 re-opened");
+			RDebug::Printf("Interface 0 re-opened");
 			
 			iCaseStep = EPassed;
 			TTestCasePassed request;
@@ -255,35 +237,32 @@
 			TestFailed(KErrCompletion);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0485::DeviceRemovedL(TUint aDeviceHandle)
 	{
-OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0485_DEVICEREMOVEDL_ENTRY, this );
+	LOG_FUNC
 
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 
 	TestFailed(KErrDisconnected);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0485::BusErrorL(TInt aError)
 	{
-OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0485_BUSERRORL_ENTRY, this );
+	LOG_FUNC
 
 	// This test case handles no failiures on the bus
 
 	TestFailed(aError);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_BUSERRORL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0485::HostRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0485_HOSTRUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -291,15 +270,14 @@
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0485_HOSTRUNL, "<Error> Action timeout");
+		RDebug::Printf("<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0485_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
+		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_HOSTRUNL_EXIT, this );
 	}
 
 /**
@@ -308,7 +286,7 @@
 */
 void CUT_PBASE_T_USBDI_0485::DeviceRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0485_DEVICERUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Disconnect the device
 	
@@ -317,7 +295,6 @@
 	// Complete the test case request
 	
 	TestPolicy().SignalTestComplete(iStatus.Int());
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0485_DEVICERUNL_EXIT, this );
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0486.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0486.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,10 +20,6 @@
 #include "testpolicy.h"
 #include "testdebug.h"
 #include "modelleddevices.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0486Traces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -35,12 +31,10 @@
 
 CUT_PBASE_T_USBDI_0486* CUT_PBASE_T_USBDI_0486::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0486_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0486* self = new (ELeave) CUT_PBASE_T_USBDI_0486(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_NEWL_EXIT, ( TUint )( self ) );
 	return self;  
 	} 
 	
@@ -49,25 +43,20 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EWaitForDeviceCConnection)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0486_CUT_PBASE_T_USBDI_0486_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_CUT_PBASE_T_USBDI_0486_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0486::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0486_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
 	iTestDeviceC = new RUsbDeviceC(this);  // TODO check tree for device C, once inserted
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_CONSTRUCTL_EXIT, this );
 	}
 
 CUT_PBASE_T_USBDI_0486::~CUT_PBASE_T_USBDI_0486()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0486_CUT_PBASE_T_USBDI_0486_ENTRY_DUP01, this );
+	LOG_FUNC
 	
 	delete iTestDeviceC;
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_CUT_PBASE_T_USBDI_0486_EXIT_DUP01, this );
 	}
 	
 /**
@@ -76,41 +65,37 @@
 */
 void CUT_PBASE_T_USBDI_0486::DeviceRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0486_DEVICERUNL_ENTRY, this );
+	LOG_FUNC	
 	// Complete the test case request	
 	TestPolicy().SignalTestComplete(iStatus.Int());
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_DEVICERUNL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0486::DeviceDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0486_DEVICEDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	iTestDeviceC->CancelSubscriptionToReports();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 TBool CUT_PBASE_T_USBDI_0486::CheckSN(const TDesC16& aSerialNumberGot, const TDesC& aExpectedSerialNumber)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0486_CHECKSN_ENTRY, this );
 	TBool areSNsIdenticals = (aSerialNumberGot.Compare(aExpectedSerialNumber) == 0);	
 	 
 	if(!areSNsIdenticals)
 		{
 		// Incorrect device for this test case	
-		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_CHECKSN, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,aSerialNumberGot, aExpectedSerialNumber);
+		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,&aSerialNumberGot, &aExpectedSerialNumber);
 		}
-	OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0486_CHECKSN_EXIT, this, areSNsIdenticals );
 	return areSNsIdenticals;
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0486::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0486_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_EP0TRANSFERCOMPLETEL_DUP01, "--->Ep0TransferCompleteL, case step = %d", iCaseStep);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	RDebug::Printf("--->Ep0TransferCompleteL, case step = %d", iCaseStep);
 
 	switch(iCaseStep)
 		{
@@ -118,7 +103,7 @@
 			{
 			if(aCompletionCode != KErrNone)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_EP0TRANSFERCOMPLETEL_DUP02, "<Error %d> aCompletionCode != KErrNone",aCompletionCode);
+				RDebug::Printf("<Error %d> aCompletionCode != KErrNone",aCompletionCode);
 				return TestFailed(aCompletionCode);
 				}
 			// close interface 0			
@@ -135,14 +120,13 @@
 			TestFailed(KErrCompletion);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0486::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0486_TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_TRANSFERCOMPLETEL, "--->TransferCompleteL, case step = %d", iCaseStep);
+	RDebug::Printf("--->TransferCompleteL, case step = %d", iCaseStep);
 
 	if(aTransferId == KBulkTranferId)
 		{							
@@ -150,24 +134,23 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> The transfer completed with no errors but should have done so"),aCompletionCode);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_TRANSFERCOMPLETEL_DUP01, msg);
+			RDebug::Print(msg);
 			TTestCaseFailed request(KErrCorrupt,msg);
 			return iControlEp0->SendRequest(request,this);
 			} 					
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_TRANSFERCOMPLETEL_DUP02, "<Error> a transfer completed (id=%d) that was not expected",aTransferId);
+		RDebug::Printf("<Error> a transfer completed (id=%d) that was not expected",aTransferId);
 		return TestFailed(KErrCorrupt);
 		}	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_TRANSFERCOMPLETEL_EXIT, this );
 	}	
 	
 	
 void CUT_PBASE_T_USBDI_0486::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_ENTRY, this );
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL, "--->DeviceInsertedL, case step = %d", iCaseStep);
+	LOG_FUNC
+	RDebug::Printf("--->DeviceInsertedL, case step = %d", iCaseStep);
 
 	// Cancel the timeout timer	
 	Cancel();	
@@ -190,14 +173,14 @@
 			err = testDevice.Device().GetTokenForInterface(0,iToken0DeviceC);
 			if(err != KErrNone)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP01, "<Error %d> Unable to retrieve token for interface 0",err);
+				RDebug::Printf("<Error %d> Unable to retrieve token for interface 0",err);
 				TestFailed(err);
 				} 
 			// Open the interface	
 			err = iUsbInterface0.Open(iToken0DeviceC);
 			if(err != KErrNone)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0", err);
+				RDebug::Printf("<Error %d> Unable to open interface 0");
 				TestFailed(err);
 				}
 				
@@ -207,7 +190,7 @@
 				{
 				TBuf<256> msg;
 				msg.Format(_L("<Error %d> Token for interface 1 could not be retrieved"),err);
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP03, msg);
+				RDebug::Print(msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(err,msg);
 				return iControlEp0->SendRequest(request,this);
@@ -219,7 +202,7 @@
 				{
 				TBuf<256> msg;
 				msg.Format(_L("<Error %d> Unable to open interface 1 using token %d"),err,token1);
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP04, msg);
+				RDebug::Print(msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(err,msg);
 				return iControlEp0->SendRequest(request,this);
@@ -232,19 +215,19 @@
 				{
 				TBuf<256> msg;
 				msg.Format(_L("<Error %d> Address for bulk in endpoint could not be obtained"),err);
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP05, msg);
+				RDebug::Print(msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(err,msg);
 				return iControlEp0->SendRequest(request,this);
 				}
-			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP06, "Endpoint adress %08x",endpointAddress);
+			RDebug::Printf("Endpoint adress %08x",endpointAddress);
 	
 			err = iUsbInterface1.OpenPipeForEndpoint(iTestPipeInterface1BulkIn,endpointAddress,ETrue);
 			if(err != KErrNone)
 				{
 				TBuf<256> msg;
 				msg.Format(_L("<Error %d> Unable to open pipe for endpoint %08x"),err,endpointAddress);
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP07, msg);
+				RDebug::Print(msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(err,msg);
 				return iControlEp0->SendRequest(request,this);
@@ -254,13 +237,13 @@
 			iInTransfer[0] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,256,*this, KBulkTranferId);
 		
 			// Initialise the descriptors for transfer		
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP08, "Initialising the transfer descriptors");
+			RDebug::Printf("Initialising the transfer descriptors");
 			err = iUsbInterface1.InitialiseTransferDescriptors();
 			if(err != KErrNone)
 				{
 				TBuf<256> msg;
 				msg.Format(_L("<Error %d> Unable to initialise transfer descriptors"),err);
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP09, msg);
+				RDebug::Print(msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(err,msg);
 				return iControlEp0->SendRequest(request,this);
@@ -288,7 +271,7 @@
 			err = iUsbInterface0.Open(iToken0DeviceC);
 			if(err != KErrNotFound) // invalid token
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP10, "iUsbInterface0.Open(iToken0DeviceC) === %d", err);
+				RDebug::Printf("iUsbInterface0.Open(iToken0DeviceC) === %d", err);
 				TestFailed(err);
 				}
 			
@@ -297,14 +280,14 @@
 			err = testDevice.Device().GetTokenForInterface(0,token0DeviceA);
 			if(err != KErrNone)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP11, "<Error %d> Unable to retrieve token(device A) for interface 0",err);
+				RDebug::Printf("<Error %d> Unable to retrieve token(device A) for interface 0",err);
 				TestFailed(err);
 				} 
 			// Open the interface	
 			err = iUsbInterface0.Open(token0DeviceA);
 			if(err != KErrNone)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP12, "<Error %d> Unable to open interface 0(device A)", err);
+				RDebug::Printf("<Error %d> Unable to open interface 0(device A)");
 				TestFailed(err);
 				}
 			
@@ -319,19 +302,18 @@
 			
 		default:
 			{
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP13, "<Error> Test case actions out of sync");
+			RDebug::Printf("<Error> Test case actions out of sync");
 			TestFailed(KErrCorrupt);
 			}	
 			break;
 		}	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0486::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0486_DEVICEREMOVEDL_ENTRY, this );
+	LOG_FUNC
 	Cancel();	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEREMOVEDL, "--->DeviceRemovedL, case step = %d", iCaseStep);
+	RDebug::Printf("--->DeviceRemovedL, case step = %d", iCaseStep);
 
 	switch(iCaseStep)
 		{
@@ -343,25 +325,23 @@
 			break;		
 	
 		default:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEREMOVEDL_DUP01, "<Error> Test case actions out of sync");
+			RDebug::Printf("<Error> Test case actions out of sync");
 			TestFailed(KErrCorrupt);
 			break;
 			}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0486::HandleDeviceDConnection()
 	{
-		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0486_HANDLEDEVICEDCONNECTION_ENTRY, this );
+	LOG_FUNC
 		
 	iTestDevice->SubscribeToReports(iStatus);
 	SetActive();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_HANDLEDEVICEDCONNECTION_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0486::ExecuteDeviceTestCaseL()	
 	{ 
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0486_EXECUTEDEVICETESTCASEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Create the test device	
 	iTestDeviceC->OpenL(KTestDeviceC_SN());
@@ -370,20 +350,15 @@
 	
 	// Connect the device to the host	
 	iTestDeviceC->SoftwareConnect();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0486_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 
 RUsbDeviceC* CUT_PBASE_T_USBDI_0486::TestDeviceC()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0486_TESTDEVICEC_ENTRY, this );
-	OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0486_TESTDEVICEC_EXIT, this, ( TUint )( iTestDeviceC ) );
 	return iTestDeviceC;
 	}
 
 RUsbDeviceD* CUT_PBASE_T_USBDI_0486::TestDeviceD()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0486_TESTDEVICED_ENTRY, this );
-	OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0486_TESTDEVICED_EXIT, this, ( TUint )( iTestDevice ) );
 	return iTestDevice; //from CBaseBulkTestCase
 	}
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0487.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0487.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,10 +19,6 @@
 #include "PBASE-T_USBDI-0487.h"
 #include "testpolicy.h"
 #include "modelleddevices.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0487Traces.h"
-#endif
 
 
 namespace NUnitTesting_USBDI
@@ -41,12 +37,10 @@
 
 CUT_PBASE_T_USBDI_0487* CUT_PBASE_T_USBDI_0487::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0487_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0487* self = new (ELeave) CUT_PBASE_T_USBDI_0487(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -55,23 +49,19 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0487_CUT_PBASE_T_USBDI_0487_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_CUT_PBASE_T_USBDI_0487_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0487::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0487_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceA(this);
 	BaseConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0487::~CUT_PBASE_T_USBDI_0487()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0487_CUT_PBASE_T_USBDI_0487_ENTRY_DUP01, this );
+	LOG_FUNC
 	
 	Cancel();
 	delete iTransferIn;
@@ -92,62 +82,56 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_CUT_PBASE_T_USBDI_0487_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0487::ExecuteHostTestCaseL()	
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0487_EXECUTEHOSTTESTCASEL_ENTRY, this );
+	LOG_FUNC
 	
 	iActorFDF = CActorFDF::NewL(*this);
 	iControlEp0 = new (ELeave) CEp0Transfer(iUsbInterface0);
 	iActorFDF->Monitor();
 	
 	TimeoutIn(30);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0487::HostDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0487_HOSTDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel the timeout timer	
 	CancelTimeout();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_HOSTDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0487::ExecuteDeviceTestCaseL()	
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0487_EXECUTEDEVICETESTCASEL_ENTRY, this );
+	LOG_FUNC
 	
 	iTestDevice->OpenL(TestCaseId());
 	iTestDevice->SubscribeToReports(iStatus);
 	SetActive();
 	iTestDevice->SoftwareConnect();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0487::DeviceDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0487_DEVICEDOCANCEL_ENTRY, this );
+	LOG_FUNC	
 	// Cancel the device	
 	iTestDevice->CancelSubscriptionToReports();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0487::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState,
 		TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0487_DEVICESTATECHANGEL_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_DEVICESTATECHANGEL_EXIT, this );
+	LOG_FUNC	
 	}
 
 
 void CUT_PBASE_T_USBDI_0487::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
 	TInt err(KErrNone);
 	
@@ -157,15 +141,14 @@
 		{
 		// Incorrect device for this test case	
 
-		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
+		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
 
 		// Start the connection timeout again
 
 		CancelTimeout();
 		iTimer.After(iStatus,30000000);
 		SetActive();
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 
@@ -173,13 +156,13 @@
 	err = testDevice.Device().GetTokenForInterface(0,token0);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP01, "<Error %d> Token for interface 0 could not be retrieved",err);
+		RDebug::Printf("<Error %d> Token for interface 0 could not be retrieved",err);
 		return TestFailed(err);
 		}
 	err = iUsbInterface0.Open(token0); // Default interface setting 0
 	if(err != KErrNone)
 		{
-		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0 using token %d",err,token0);
+		RDebug::Printf("<Error %d> Unable to open interface 0 using token %d",err,token0);
 		return TestFailed(err);
 		}
 	
@@ -188,7 +171,7 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Token for interface 1 could not be retrieved"),err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP03, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
@@ -198,7 +181,7 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to open interface 1 using token %d"),err,token1);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP04, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
@@ -210,11 +193,10 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Selecting alternate interface setting 1 on interface 1"),err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP05, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_EXIT_DUP01, this );
 		return;
 		}
 	
@@ -225,11 +207,10 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> unable to get endpoint address for interrupt in endpoint"),err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP06, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_EXIT_DUP02, this );
 		return;
 		}	
 	
@@ -238,12 +219,12 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to open pipe for endpoint 1"),err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP07, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);		
 		}	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP08, "Opened pipe to endpoint address %08x for interrupt transfer to host",endpointAddress);
+	RDebug::Printf("Opened pipe to endpoint address %08x for interrupt transfer to host",endpointAddress);
 	
 	
 	// create an interrupt transfer
@@ -259,12 +240,11 @@
 	iTransferIn3->RegisterTransferDescriptor();		
 	
 	// Initialise the descriptors for transfer
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP09, "Initialising the transfer descriptors");
+	RDebug::Printf("Initialising the transfer descriptors");
 	err = iUsbInterface1.InitialiseTransferDescriptors();
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP10, "<Error %d> Unable to initialise transfer descriptors",err);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_EXIT_DUP03, this );
+		RDebug::Printf("<Error %d> Unable to initialise transfer descriptors",err);
 		return;
 		} 
 			
@@ -274,7 +254,7 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to queue an interrupt transfer"),err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP11, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);	
@@ -286,7 +266,7 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to queue an interrupt transfer"),err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP12, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);	
@@ -298,7 +278,7 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to queue an interrupt transfer"),err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP13, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);	
@@ -309,13 +289,12 @@
 	// Instruct the client device to write the following data through the valid endpoint	
 	TEndpointWriteRequest request(1,1,KDataPayload1);
 	iControlEp0->SendRequest(request,this);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_EXIT_DUP04, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0487::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0487_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
 	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d"),aCompletionCode;
 	
@@ -323,7 +302,7 @@
 		{	
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_EP0TRANSFERCOMPLETEL, msg);
+		RDebug::Print(msg);
 		}
 
 	if(iCaseStep == EPassed)
@@ -340,22 +319,21 @@
 		{
 		return TestFailed(KErrCompletion);
 		}	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0487::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
 	
-	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL, "Transfer %d completed with %d",aTransferId,aCompletionCode);
+	RDebug::Printf("Transfer %d completed with %d",aTransferId,aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Transfer %d did not complete successfully"),aCompletionCode,aTransferId);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP01, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(aCompletionCode,msg);
 		return iControlEp0->SendRequest(request,this);
@@ -365,20 +343,20 @@
 		{
 		TPtrC8 data(iTransferIn->DataPolled());
 		
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP02, "data.Length 1()= %d", data.Length());
+		RDebug::Printf("data.Length 1()= %d", data.Length());
 		
 			TBuf<256> msg;
 		for(int i = 0 ; i < data.Length(); i++)
 			{		
 			msg.AppendFormat(_L("%02x"),data[i]);
 			}
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP03, msg);
+			RDebug::Print(msg);	
 		// Compare the data to what is expected		
 		if(data.Compare(KDataPayload1) != 0)
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Interrupt data received does not match data sent"),KErrCompletion);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP04, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(KErrCompletion,msg);
 			return iControlEp0->SendRequest(request,this);
@@ -391,21 +369,21 @@
 	else if(aTransferId == KInterruptTransferId2)
 		{
 		TPtrC8 data(iTransferIn2->DataPolled());
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP05, "data.Length 2()= %d", data.Length());
+		RDebug::Printf("data.Length 2()= %d", data.Length());
 	
 		TBuf<256> msg;
 		for(int i = 0 ; i < data.Length(); i++)
 			{		
 			msg.AppendFormat(_L("%02x"),data[i]);
 			}
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP06, msg);
+			RDebug::Print(msg);
 				
 		// Compare the data to what is expected		
 		if(data.Compare(KDataPayload1) != 0)
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Interrupt data received does not match data sent"),KErrCompletion);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP07, msg);
+			RDebug::Print(msg);
 			//TODO if test fails! Test fail code below WAS commented out
 			iCaseStep = EFailed;
 			TTestCaseFailed request(KErrCompletion,msg);
@@ -424,7 +402,7 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Interrupt data received does not match data sent"),KErrCompletion);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP08, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(KErrCompletion,msg);
 			return iControlEp0->SendRequest(request,this);
@@ -436,63 +414,58 @@
 		}		
 	else
 		{
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP09, "<Error> Unknown transfer identity");
+		RDebug::Printf("<Error> Unknown transfer identity");
 		TestFailed(KErrUnknown);	
 		}	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0487::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0487_DEVICEREMOVEDL_ENTRY, this );
+	LOG_FUNC
 	
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error	
 	TestFailed(KErrDisconnected);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0487::BusErrorL(TInt aError)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0487_BUSERRORL_ENTRY, this );
+	LOG_FUNC
 	
 	// This test case handles no failiures on the bus	
 	TestFailed(KErrCompletion);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_BUSERRORL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0487::HostRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0487_HOSTRUNL_ENTRY, this );
+	LOG_FUNC	
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
 	
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_HOSTRUNL, "<Error> Action timeout");
+		RDebug::Printf("<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0487_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
+		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_HOSTRUNL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0487::DeviceRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0487_DEVICERUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Disconnect the device	
 	iTestDevice->SoftwareDisconnect();
 	
 	// Complete the test case request	
 	TestPolicy().SignalTestComplete(iStatus.Int());
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0487_DEVICERUNL_EXIT, this );
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0488.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0488.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,10 +19,6 @@
 #include "PBASE-T_USBDI-0488.h"
 #include "testpolicy.h"
 #include "modelleddevices.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0488Traces.h"
-#endif
 #include <d32usbdi_errors.h>
 
 namespace NUnitTesting_USBDI
@@ -33,12 +29,10 @@
 
 CUT_PBASE_T_USBDI_0488* CUT_PBASE_T_USBDI_0488::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0488_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0488* self = new (ELeave) CUT_PBASE_T_USBDI_0488(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -47,23 +41,19 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0488_CUT_PBASE_T_USBDI_0488_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_CUT_PBASE_T_USBDI_0488_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0488::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0488_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceA(this);
 	BaseConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0488::~CUT_PBASE_T_USBDI_0488()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0488_CUT_PBASE_T_USBDI_0488_ENTRY_DUP01, this );
+	LOG_FUNC
 	
 	Cancel();
 	
@@ -77,30 +67,27 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_CUT_PBASE_T_USBDI_0488_EXIT_DUP01, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0488::ExecuteHostTestCaseL()	
 	{
-		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0488_EXECUTEHOSTTESTCASEL_ENTRY, this );
+	LOG_FUNC
 		
 	iActorFDF = CActorFDF::NewL(*this);
 	iControlEp0 = new (ELeave) CEp0Transfer(iUsbInterface0);
 	iActorFDF->Monitor();
 	
 	TimeoutIn(30);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 	
 /*static*/ TInt CUT_PBASE_T_USBDI_0488::TestSelectAlternateInterfaceThenPanic(TAny* aTest) 
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0488_TESTSELECTALTERNATEINTERFACETHENPANIC_ENTRY, 0 );
+	LOG_CFUNC
 	
 	CTrapCleanup* trapHandler=CTrapCleanup::New();
 	if(!trapHandler)
 		{
-		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0488_TESTSELECTALTERNATEINTERFACETHENPANIC_EXIT, 0, KErrNoMemory );
 		return KErrNoMemory;
 		}		
 						
@@ -110,7 +97,6 @@
 	pTest->iUsbInterface1.SelectAlternateInterface(0); // panic expected
 	
 	// Should never get here.*/
-	OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0488_TESTSELECTALTERNATEINTERFACETHENPANIC_EXIT_DUP01, 0, KErrNone );
 	return KErrNone;
 	}
 	
@@ -118,43 +104,39 @@
 	
 void CUT_PBASE_T_USBDI_0488::HostDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0488_HOSTDOCANCEL_ENTRY, this );
+	LOG_FUNC	
 	// Cancel the timeout timer	
 	CancelTimeout();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_HOSTDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0488::ExecuteDeviceTestCaseL()	
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0488_EXECUTEDEVICETESTCASEL_ENTRY, this );
+	LOG_FUNC	
 	iTestDevice->OpenL(TestCaseId());
 	iTestDevice->SubscribeToReports(iStatus);
 	SetActive();
 	iTestDevice->SoftwareConnect();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0488::DeviceDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0488_DEVICEDOCANCEL_ENTRY, this );
+	LOG_FUNC	
 	// Cancel the device	
 	iTestDevice->CancelSubscriptionToReports();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0488::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState,
 		TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0488_DEVICESTATECHANGEL_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_DEVICESTATECHANGEL_EXIT, this );
+	LOG_FUNC	
 	}
 
 
 void CUT_PBASE_T_USBDI_0488::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
 	TInt err(KErrNone);
 	
@@ -163,13 +145,12 @@
 	if(testDevice.SerialNumber().Compare(TestCaseId()) != 0)
 		{
 		// Incorrect device for this test case
-		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
+		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
 		// Start the connection timeout again
 		CancelTimeout();
 		iTimer.After(iStatus,30000000);
 		SetActive();
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 	
@@ -178,13 +159,13 @@
 	err = testDevice.Device().GetTokenForInterface(0,token0);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP01, "<Error %d> Token for interface 0 could not be retrieved",err);
+		RDebug::Printf("<Error %d> Token for interface 0 could not be retrieved",err);
 		return TestFailed(err);
 		}
 	err = iUsbInterface0.Open(token0); // Default interface setting 0
 	if(err != KErrNone)
 		{
-		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0 using token %d",err,token0);
+		RDebug::Printf("<Error %d> Unable to open interface 0 using token %d",err,token0);
 		return TestFailed(err);
 		}
 		
@@ -194,7 +175,7 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Token for interface 1 could not be retrieved"),err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP03, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
@@ -204,7 +185,7 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to open interface 1 using token %d"),err,token1);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP04, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
@@ -216,11 +197,10 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Selecting alternate interface setting 1 on interface 1"),err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP05, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_EXIT_DUP01, this );
 		return;
 		}  
 	
@@ -231,11 +211,10 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> unable to get endpoint address for interrupt in endpoint"),err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP06, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_EXIT_DUP02, this );
 		return;
 		}	
 	
@@ -244,7 +223,7 @@
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to open pipe for endpoint 1"),err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP07, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);		
@@ -273,15 +252,15 @@
 
 void CUT_PBASE_T_USBDI_0488::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0488_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{	
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_EP0TRANSFERCOMPLETEL_DUP01, msg);
+		RDebug::Print(msg);
 		}
 
 	if(iCaseStep == EPassed)
@@ -298,60 +277,55 @@
 		{
 		return TestFailed(KErrCompletion);
 		}	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 
 void CUT_PBASE_T_USBDI_0488::DeviceRemovedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0488_DEVICEREMOVEDL_ENTRY, this );
+	LOG_FUNC
 	
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error	
 	TestFailed(KErrDisconnected);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0488::BusErrorL(TInt aError)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0488_BUSERRORL_ENTRY, this );
+	LOG_FUNC
 	
 	// This test case handles no failiures on the bus	
 	TestFailed(KErrCompletion);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_BUSERRORL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0488::HostRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0488_HOSTRUNL_ENTRY, this );
+	LOG_FUNC	
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
 	
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_HOSTRUNL, "<Error> Action timeout");
+		RDebug::Printf("<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0488_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
+		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_HOSTRUNL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_0488::DeviceRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0488_DEVICERUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Disconnect the device	
 	iTestDevice->SoftwareDisconnect();
 	
 	// Complete the test case request	
 	TestPolicy().SignalTestComplete(iStatus.Int());
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0488_DEVICERUNL_EXIT, this );
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0489.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0489.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,10 +20,6 @@
 #include "testpolicy.h"
 #include "testdebug.h"
 #include "modelleddevices.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0489Traces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -33,12 +29,10 @@
 
 CUT_PBASE_T_USBDI_0489* CUT_PBASE_T_USBDI_0489::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0489* self = new (ELeave) CUT_PBASE_T_USBDI_0489(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	} 
 	
@@ -47,23 +41,19 @@
 :	CBaseTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0489_CUT_PBASE_T_USBDI_0489_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_CUT_PBASE_T_USBDI_0489_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0489::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceVendor(this);
 	BaseConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0489::~CUT_PBASE_T_USBDI_0489()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_CUT_PBASE_T_USBDI_0489_ENTRY_DUP01, this );
+	LOG_FUNC
 	
 	Cancel();
 	
@@ -77,12 +67,11 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_CUT_PBASE_T_USBDI_0489_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0489::ExecuteHostTestCaseL()	
 	{
-    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_EXECUTEHOSTTESTCASEL_ENTRY, this );
+	LOG_FUNC
 
 	// Create the actor for the Function Driver Framework 
 	
@@ -99,13 +88,12 @@
 	// Start the connection timeout timer
 
 	TimeoutIn(30);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0489::ExecuteDeviceTestCaseL()	
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_EXECUTEDEVICETESTCASEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Create the test device
 	
@@ -116,44 +104,40 @@
 	// Connect the device to the host
 	
 	iTestDevice->SoftwareConnect();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0489::HostDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_HOSTDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel the test step action timeout timer
 	
 	CancelTimeout();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_HOSTDOCANCEL_EXIT, this );
 	}
 
 	
 void CUT_PBASE_T_USBDI_0489::DeviceDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_DEVICEDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel the device (the activity timer and the error reporting)
 	
 	iTestDevice->CancelSubscriptionToReports();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0489::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
 		RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0489_DEVICESTATECHANGEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_DEVICESTATECHANGEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0489::DeviceInsertedL(TUint aDeviceHandle)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 
 	// Cancel the timeout timer
 	
@@ -168,13 +152,12 @@
 		{
 		// Incorrect device for this test case	
 
-		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
+		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
 
 		// Start the connection timeout again
 
 		TimeoutIn(30);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}	
 	
@@ -183,7 +166,7 @@
 	err = testDevice.Device().GetTokenForInterface(0,iToken0);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_DUP01, "<Error %d> Unable to retrieve token for interface 0",err);
+		RDebug::Printf("<Error %d> Unable to retrieve token for interface 0",err);
 		TestFailed(err);
 		}
 	
@@ -191,7 +174,7 @@
 	err = iUsbInterface0.Open(iToken0);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0", err);
+		RDebug::Printf("<Error %d> Unable to open interface 0");
 		TestFailed(err);
 		}
 	
@@ -204,14 +187,13 @@
 	
 	// Wait 1 second then cancel EP0 transfer
 	User::After(1000000);
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_DUP03, "Cancelling EP0 transfer");
+	RDebug::Printf("Cancelling EP0 transfer");
 	iUsbInterface0.CancelEP0Transfer();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0489::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
 	switch(iCaseStep)
 		{
@@ -219,23 +201,23 @@
 			{
 			if(aCompletionCode != KErrCancel)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL, "<Error %d> Nakking request was not cancelled by stack",aCompletionCode);
+				RDebug::Printf("<Error %d> Nakking request was not cancelled by stack",aCompletionCode);
 				return TestFailed(aCompletionCode);
 				}
 		
 			// No panic or leave so passed
 			
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL_DUP01, "No leave or panic occured so open interface again and send test passed");
+			RDebug::Printf("No leave or panic occured so open interface again and send test passed");
 			
 			// Open the interface		
 			/*TODO DMA TInt err(iUsbInterface0.Open(iToken0));
 			if(err != KErrNone)
 				{
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL_DUP02, "<Error %d> Unable to open interface 0"));
+				RDebug::Printf("<Error %d> Unable to open interface 0"));
 				return TestFailed(err);
 				}
 			
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL_DUP03, "Interface 0 re-opened"));*/
+			RDebug::Printf("Interface 0 re-opened"));*/
 			
 			iCaseStep = EPassed;
 			TTestCasePassed request;
@@ -252,35 +234,32 @@
 			TestFailed(KErrCompletion);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0489::DeviceRemovedL(TUint aDeviceHandle)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0489_DEVICEREMOVEDL_ENTRY, this );
+	LOG_FUNC
 
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 
 	TestFailed(KErrDisconnected);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0489::BusErrorL(TInt aError)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0489_BUSERRORL_ENTRY, this );
+	LOG_FUNC
 
 	// This test case handles no failiures on the bus
 
 	TestFailed(aError);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_BUSERRORL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_0489::HostRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_HOSTRUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -288,15 +267,14 @@
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_HOSTRUNL, "<Error> Action timeout");
+		RDebug::Printf("<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0489_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
+		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_HOSTRUNL_EXIT, this );
 	}
 
 /**
@@ -305,7 +283,7 @@
 */
 void CUT_PBASE_T_USBDI_0489::DeviceRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0489_DEVICERUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Disconnect the device
 	
@@ -314,7 +292,6 @@
 	// Complete the test case request
 	
 	TestPolicy().SignalTestComplete(iStatus.Int());
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0489_DEVICERUNL_EXIT, this );
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0490.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0490.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,10 +19,6 @@
 #include "PBASE-T_USBDI-0490.h"
 #include "testpolicy.h"
 #include "modelleddevices.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0490Traces.h"
-#endif
 
 
  
@@ -44,12 +40,10 @@
 
 CUT_PBASE_T_USBDI_0490* CUT_PBASE_T_USBDI_0490::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0490_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0490* self = new (ELeave) CUT_PBASE_T_USBDI_0490(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0490_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -58,46 +52,40 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0490_CUT_PBASE_T_USBDI_0490_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0490_CUT_PBASE_T_USBDI_0490_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0490::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0490_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0490_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0490::~CUT_PBASE_T_USBDI_0490()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0490_CUT_PBASE_T_USBDI_0490_ENTRY_DUP01, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0490_CUT_PBASE_T_USBDI_0490_EXIT_DUP01, this );
+	LOG_FUNC
 	}
 	
 void CUT_PBASE_T_USBDI_0490::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
+			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_DUP02, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -115,31 +103,30 @@
 			break;
 			
 		case ETransferOut:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_DUP03, "Try to send data");
+			RDebug::Printf("Try to send data");
 			iOutTransfer[0]->TransferOut(KPayloadPattern);
 			break;
 		
 		case ETransferIn:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_DUP04, "Try to receive data");
+			RDebug::Printf("Try to receive data");
 			iInTransfer[0]->TransferIn(KBulkTransferSize);
 			break;
 	
 		default:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_DUP05, "<Error> Unknown test step");
+			RDebug::Printf("<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0490::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
 	
 	TInt err(KErrNone);
 	TBuf<256> msg;
-	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
+	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
 
 	switch(iCaseStep)
 		{
@@ -158,7 +145,7 @@
 						       err, KBulkTransferOutId, aTransferId);
 				break;
 				}
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL_DUP01, "Try to receive back sent data");
+			RDebug::Printf("Try to receive back sent data");
 			iCaseStep = ETransferIn;
 			TWriteSynchronousCachedReadDataRequest request(1,1,1); //Use first read EP and first write EP (on interface 1)
 			iControlEp0->SendRequest(request,this);	
@@ -190,7 +177,7 @@
 			if(err == KErrNone)
 				{
 				// Comparison is a match
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL_DUP02, "Comparison for IN transfer is a match");
+				RDebug::Printf("Comparison for IN transfer is a match");
 				iCaseStep = EPassed;
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
@@ -207,17 +194,16 @@
 	
 	if(err!=KErrNone)
 		{	
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL_DUP03, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
 		}	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0490::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0490_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
 	
 	if(BaseBulkDeviceInsertedL(aDeviceHandle) == EDeviceConfigurationError)
@@ -231,24 +217,22 @@
 	iOutTransfer[0] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkOut,iUsbInterface1,KBulkTransferSize,*this,KBulkTransferOutId);
 	
 	// Initialise the descriptors for transfer		
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_DEVICEINSERTEDL, "Initialising the transfer descriptors");
+	RDebug::Printf("Initialising the transfer descriptors");
 	TInt err = iUsbInterface1.InitialiseTransferDescriptors();
 	if(err != KErrNone)
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to initialise transfer descriptors"),err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0490_DEVICEINSERTEDL_DUP01, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0490_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 
 	iCaseStep = ETransferOut;
 	TEndpointReadUntilShortRequest request(1,1,KBulkTransferSize);// EP1 because 1st reader EP
 	iControlEp0->SendRequest(request,this);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0490_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 	} //end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0491.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0491.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,10 +20,6 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0491Traces.h"
-#endif
 
 
  
@@ -44,12 +40,10 @@
 
 CUT_PBASE_T_USBDI_0491* CUT_PBASE_T_USBDI_0491::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0491_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0491* self = new (ELeave) CUT_PBASE_T_USBDI_0491(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0491_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -58,46 +52,40 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0491_CUT_PBASE_T_USBDI_0491_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0491_CUT_PBASE_T_USBDI_0491_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0491::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0491_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0491_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0491::~CUT_PBASE_T_USBDI_0491()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0491_CUT_PBASE_T_USBDI_0491_ENTRY_DUP01, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0491_CUT_PBASE_T_USBDI_0491_EXIT_DUP01, this );
+	LOG_FUNC
 	}
 
 void CUT_PBASE_T_USBDI_0491::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
+			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_DUP02, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -115,31 +103,30 @@
 			break;
 			
 		case ETransferOut:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_DUP03, "Try to send data");
+			RDebug::Printf("Try to send data");
 			iOutTransfer[0]->TransferOut(KLiteralEnglish2(), KBulkTransferSize);
 			break;
 		
 		case ETransferIn:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_DUP04, "Try to receive data");
+			RDebug::Printf("Try to receive data");
 			iInTransfer[0]->TransferIn(KBulkTransferSize);
 			break;
 	
 		default:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_DUP05, "<Error> Unknown test step");
+			RDebug::Printf("<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0491::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
 	
 	TInt err(KErrNone);
 	TBuf<256> msg;
-	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
+	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
 
 	switch(iCaseStep)
 		{
@@ -158,7 +145,7 @@
 						       err, KBulkTransferOutId, aTransferId);
 				break;
 				}
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL_DUP01, "Try to receive back sent data");
+			RDebug::Printf("Try to receive back sent data");
 			iCaseStep = ETransferIn;
 			TWriteSynchronousCachedReadDataRequest request(1,1,1);  //Use first read EP and first write EP (on interface 1)
 			iControlEp0->SendRequest(request,this);	
@@ -190,7 +177,7 @@
 			if(err == KErrNone)
 				{
 				// Comparison is a match
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL_DUP02, "Comparison for IN transfer is a match");
+				RDebug::Printf("Comparison for IN transfer is a match");
 				iCaseStep = EPassed;
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
@@ -207,19 +194,18 @@
 	
 	if(err!=KErrNone)
 		{	
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL_DUP03, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
 		}	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0491::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL, "****** Father William Pattern Length is %d bytes! *********", KLiteralEnglish2().Length());
+	RDebug::Printf("****** Father William Pattern Length is %d bytes! *********", KLiteralEnglish2().Length());
 	
 	if(BaseBulkDeviceInsertedL(aDeviceHandle) == EDeviceConfigurationError)
 		// Prepare for response from control transfer to client
@@ -232,24 +218,22 @@
 	iOutTransfer[0] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkOut,iUsbInterface1,KBulkTransferSize,*this,KBulkTransferOutId);
 	
 	// Initialise the descriptors for transfer		
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL_DUP01, "Initialising the transfer descriptors");
+	RDebug::Printf("Initialising the transfer descriptors");
 	TInt err = iUsbInterface1.InitialiseTransferDescriptors();
 	if(err != KErrNone)
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to initialise transfer descriptors"),err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL_DUP02, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 
 	iCaseStep = ETransferOut;	
 	TEndpointReadUntilShortRequest request(1,1,KBulkTransferSize);// EP1 because 1st reader EP
 	iControlEp0->SendRequest(request,this);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 	} //end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0492.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0492.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,10 +20,6 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0492Traces.h"
-#endif
 
 
  
@@ -57,12 +53,10 @@
 
 CUT_PBASE_T_USBDI_0492* CUT_PBASE_T_USBDI_0492::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0492_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0492* self = new (ELeave) CUT_PBASE_T_USBDI_0492(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0492_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -71,47 +65,41 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0492_CUT_PBASE_T_USBDI_0492_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0492_CUT_PBASE_T_USBDI_0492_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0492::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0492_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0492_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0492::~CUT_PBASE_T_USBDI_0492()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0492_CUT_PBASE_T_USBDI_0492_ENTRY_DUP01, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0492_CUT_PBASE_T_USBDI_0492_EXIT_DUP01, this );
+	LOG_FUNC
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0492::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
+			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_DUP02, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -129,35 +117,34 @@
 			break;
 			
 		case ETransferOut:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_DUP03, "Try to send data");
+			RDebug::Printf("Try to send data");
 			iOutTransfer[0]->TransferOut(KLiteralEnglish8().Mid(0, KHostNumWriteBytes1), EFalse);
 			iOutTransfer[1]->TransferOut(KLiteralEnglish8().Mid(KHostNumWriteBytes1, KHostNumWriteBytes2), EFalse);
 			iOutTransfer[2]->TransferOut(KLiteralEnglish8().Mid(KHostNumWriteBytes1+KHostNumWriteBytes2, KHostNumWriteBytes3), ETrue); //do not suppress ZLP on this last one  (though should be irrelevant here)    
 			break;
 		
 		case ETransferIn:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_DUP04, "Try to receive data");
+			RDebug::Printf("Try to receive data");
 			iInTransfer[0]->TransferIn(KHostNumReadBytes1);
 			iInTransfer[1]->TransferIn(KHostNumReadBytes2);
 			iInTransfer[2]->TransferIn(KHostNumReadBytes3);
 			break;
 	
 		default:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_DUP05, "<Error> Unknown test step");
+			RDebug::Printf("<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0492::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
 	
 	TInt err(KErrNone);
 	TBuf<256> msg;
-	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
+	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
 
 	switch(iCaseStep)
 		{
@@ -175,7 +162,7 @@
 				case KBulkTransferOutId1:
 				case KBulkTransferOutId2:
 					iTransferComplete |= aTransferId;
-					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_DUP01, "Transfer %d completed", aTransferId);
+					RDebug::Printf("Transfer %d completed", aTransferId);
 					break; // switch(aTransferId)
 
 				default:
@@ -188,7 +175,7 @@
 
 			if(err==KErrNone && iTransferComplete == (KBulkTransferOutId0 | KBulkTransferOutId1 | KBulkTransferOutId2))
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_DUP02, "Try to receive back sent data. Transfers Completed %d", iTransferComplete);
+				RDebug::Printf("Try to receive back sent data. Transfers Completed %d", iTransferComplete);
 				iCaseStep = ETransferIn;
 				TUint numBytes[KNumSplitWriteSections] = {KHostNumReadBytes1, KHostNumReadBytes2, KHostNumReadBytes3};
 				TSplitWriteCachedReadDataRequest request(1,1,1,numBytes);
@@ -246,7 +233,7 @@
 					}
 
 				// Comparison is a match
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_DUP03, "Comparison for IN transfer is a match");
+				RDebug::Printf("Comparison for IN transfer is a match");
 				iCaseStep = EPassed;
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
@@ -268,17 +255,16 @@
 	
 	if(err!=KErrNone)
 		{	
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_DUP04, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
 		}	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0492::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0492_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 	
 	Cancel();
 	
@@ -297,24 +283,22 @@
 	iOutTransfer[2] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkOut,iUsbInterface1,KBulkTransferSize,*this,KBulkTransferOutId2);
 	
 	// Initialise the descriptors for transfer		
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_DEVICEINSERTEDL, "Initialising the transfer descriptors");
+	RDebug::Printf("Initialising the transfer descriptors");
 	TInt err = iUsbInterface1.InitialiseTransferDescriptors();
 	if(err != KErrNone)
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to initialise transfer descriptors"),err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0492_DEVICEINSERTEDL_DUP01, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0492_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 
 	iCaseStep = ETransferOut;	
 	TEndpointReadRequest request(1,1,KBulkTransferSize);// EP1 means endpoint index 1 not the actual endpoint number
 	iControlEp0->SendRequest(request,this);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0492_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 	} //end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0493.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0493.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,10 +20,6 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0493Traces.h"
-#endif
 
 
  
@@ -61,12 +57,10 @@
 
 CUT_PBASE_T_USBDI_0493* CUT_PBASE_T_USBDI_0493::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0493_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0493* self = new (ELeave) CUT_PBASE_T_USBDI_0493(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0493_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -76,30 +70,25 @@
 	iNumTransferBytes(KStartNumTransferBytes),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0493_CUT_PBASE_T_USBDI_0493_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0493_CUT_PBASE_T_USBDI_0493_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0493::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0493_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0493_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0493::~CUT_PBASE_T_USBDI_0493()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0493_CUT_PBASE_T_USBDI_0493_ENTRY_DUP01, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0493_CUT_PBASE_T_USBDI_0493_EXIT_DUP01, this );
+	LOG_FUNC
 	}
 
 void CUT_PBASE_T_USBDI_0493::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
@@ -110,11 +99,10 @@
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_DUP01, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -132,11 +120,8 @@
 			break;
 			
 		case ETransferOut:
-			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_DUP02, "Try to send %d bytes of data", iNumTransferBytes);
-			{
-			    const TPtrC8& midKLiteralEnglish = KLiteralEnglish8().Mid(0*KHostNumWriteBytes, KHostNumWriteBytes);
-                OstTraceData(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_DUP52, "", midKLiteralEnglish.Ptr(), midKLiteralEnglish.Length());
-			}
+			RDebug::Printf("Try to send %d bytes of data", iNumTransferBytes);
+			RDebug::RawPrint(KLiteralEnglish8().Mid(0*KHostNumWriteBytes, KHostNumWriteBytes));
 			iOutTransfer[0]->TransferOut(KLiteralEnglish8().Mid(0*KHostNumWriteBytes, KHostNumWriteBytes), EFalse);
 			iOutTransfer[1]->TransferOut(KLiteralEnglish8().Mid(1*KHostNumWriteBytes, KHostNumWriteBytes), EFalse);
 			iOutTransfer[2]->TransferOut(KLiteralEnglish8().Mid(2*KHostNumWriteBytes, KHostNumWriteBytes), EFalse);
@@ -144,7 +129,7 @@
 			break;
 		
 		case ETransferIn:
-			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_DUP03, "Try to receive max %d bytes of data", 3*KHostNumReadBytes + KHostFinalNumReadBytes);
+			RDebug::Printf("Try to receive max %d bytes of data", 3*KHostNumReadBytes + KHostFinalNumReadBytes);
 			iInTransfer[0]->TransferIn(KHostNumReadBytes);
 			iInTransfer[1]->TransferIn(KHostNumReadBytes);
 			iInTransfer[2]->TransferIn(KHostNumReadBytes);
@@ -152,21 +137,20 @@
 			break;
 	
 		default:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_DUP04, "<Error> Unknown test step");
+			RDebug::Printf("<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0493::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
 	
 	TInt err(KErrNone);
 	TBuf<256> msg;
-	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
+	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
 
 	switch(iCaseStep)
 		{
@@ -185,7 +169,7 @@
 				case KBulkTransferOutId2:		
 				case KBulkTransferOutId3:
 					iTransferComplete |= aTransferId;
-					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_DUP01, "Transfer %d completed", aTransferId);
+					RDebug::Printf("Transfer %d completed", aTransferId);
 					break; //switch(aTransferId)
 					
 				default:
@@ -198,7 +182,7 @@
 
 			if(err==KErrNone && iTransferComplete == (KBulkTransferOutId0 | KBulkTransferOutId1 | KBulkTransferOutId2 | KBulkTransferOutId3))
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_DUP02, "Try to receive back sent data. Transfers Completed %d", iTransferComplete);
+				RDebug::Printf("Try to receive back sent data. Transfers Completed %d", iTransferComplete);
 				iCaseStep = ETransferIn;
 				TWriteSynchronousCachedReadDataRequest request(1,1,1);  //Use first read EP and first write EP (on interface 1)
 				iControlEp0->SendRequest(request,this);	
@@ -223,7 +207,7 @@
 					break; //switch(aTransferId)
 					
 				default:
-					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_DUP03, "Bad Transfer ID");
+					RDebug::Printf("Bad Transfer ID");
 					iTransferComplete = 0; //reset
 					err = KUnexpectedTransferID;
 					msg.Format(_L("<Error %d> Unexpected transfer ID, wanted %d or %d or %d or %d, got %d"),
@@ -265,7 +249,7 @@
 				if(err == KErrNone)
 					{
 					// Comparison is a match
-					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_DUP04, "Comparison for IN transfer is a match - Number of Transfer Bytes %d", iNumTransferBytes);
+					RDebug::Printf("Comparison for IN transfer is a match - Number of Transfer Bytes %d", iNumTransferBytes);
 					iTransferComplete = 0; //reset
 					if(++iNumTransferBytes<=KFinishNumTransferBytes)
 						/*
@@ -300,22 +284,20 @@
 	
 	if(err!=KErrNone)
 		{	
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_DUP05, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_EXIT, this );
 		return;
 		}	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 
 void CUT_PBASE_T_USBDI_0493::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL, "****** Father William Pattern Length is %d bytes! *********", KLiteralEnglish8Length);
+	RDebug::Printf("****** Father William Pattern Length is %d bytes! *********", KLiteralEnglish8Length);
 	if(BaseBulkDeviceInsertedL(aDeviceHandle) == EDeviceConfigurationError)
 		// Prepare for response from control transfer to client
 		{
@@ -323,7 +305,7 @@
 		}
 	
 	// Create the bulk transfers	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_DUP01, "Trying to create the bulk transfers - size 0x%u", KBulkTransferMaxSize);
+	RDebug::Printf("Trying to create the bulk transfers - size 0x%u", KBulkTransferMaxSize);
 	iInTransfer[0] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,KBulkTransferMaxSize,*this,KBulkTransferInId0);
 	iInTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,KBulkTransferMaxSize,*this,KBulkTransferInId1);
 	iInTransfer[2] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,KBulkTransferMaxSize,*this,KBulkTransferInId2);
@@ -334,25 +316,23 @@
 	iOutTransfer[3] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkOut,iUsbInterface1,KBulkTransferMaxSize,*this,KBulkTransferOutId3);
 		
 	// Initialise the descriptors for transfer		
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_DUP02, "Initialising the transfer descriptors");
+	RDebug::Printf("Initialising the transfer descriptors");
 	TInt err = iUsbInterface1.InitialiseTransferDescriptors();
 	if(err != KErrNone)
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to initialise transfer descriptors"),err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_DUP03, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 			
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_DUP04, "Ask client to read %d bytes of data", KClientNumReadBytes);
+	RDebug::Printf("Ask client to read %d bytes of data", KClientNumReadBytes);
 	iCaseStep = ETransferOut;
 	TEndpointReadUntilShortRequest request(1,1,KClientNumReadBytes);// EP1 because 1st reader EP
 	iControlEp0->SendRequest(request,this);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 	} //end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0494.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0494.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,10 +20,6 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0494Traces.h"
-#endif
 
 
  
@@ -45,12 +41,10 @@
 
 CUT_PBASE_T_USBDI_0494* CUT_PBASE_T_USBDI_0494::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0494_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0494* self = new (ELeave) CUT_PBASE_T_USBDI_0494(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0494_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -59,46 +53,40 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0494_CUT_PBASE_T_USBDI_0494_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0494_CUT_PBASE_T_USBDI_0494_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0494::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0494_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0494_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0494::~CUT_PBASE_T_USBDI_0494()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0494_CUT_PBASE_T_USBDI_0494_ENTRY_DUP01, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0494_CUT_PBASE_T_USBDI_0494_EXIT_DUP01, this );
+	LOG_FUNC
 	}
 
 void CUT_PBASE_T_USBDI_0494::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
+			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_DUP02, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -116,31 +104,30 @@
 			break;
 			
 		case ETransferOut:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_DUP03, "Try to send data");
+			RDebug::Printf("Try to send data");
 			iOutTransfer[0]->TransferOut(KLiteralEnglish8(), KBulkTransferSize, ETrue);
 			break;
 		
 		case ETransferIn:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_DUP04, "Try to receive data");
+			RDebug::Printf("Try to receive data");
 			iInTransfer[0]->TransferIn(KBulkNumReadBytes); //require completion using ZLP
 			break;
 	
 		default:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_DUP05, "<Error> Unknown test step");
+			RDebug::Printf("<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0494::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
 	
 	TInt err(KErrNone);
 	TBuf<256> msg;
-	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
+	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
 
 	switch(iCaseStep)
 		{
@@ -161,7 +148,7 @@
 				break;
 				}
 
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL_DUP01, "Try to receive back sent data");
+			RDebug::Printf("Try to receive back sent data");
 			iCaseStep = ETransferIn;
 			TWriteSynchronousCachedReadDataRequest request(1,1,1);  //Use first read EP and first write EP (on interface 1)
 			iControlEp0->SendRequest(request,this);
@@ -196,7 +183,7 @@
 			if(err == KErrNone)
 				{
 				// Comparison is a match
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL_DUP02, "Comparison for IN transfer is a match");
+				RDebug::Printf("Comparison for IN transfer is a match");
 				iCaseStep = EPassed;
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
@@ -212,17 +199,16 @@
 	
 	if(err!=KErrNone)
 		{	
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL_DUP03, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
 		}	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0494::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0494_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
 	
 	if(BaseBulkDeviceInsertedL(aDeviceHandle) == EDeviceConfigurationError)
@@ -236,24 +222,22 @@
 	iOutTransfer[0] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkOut,iUsbInterface1,KBulkTransferMaxSize,*this,KBulkTranferOutId);
 	
 	// Initialise the descriptors for transfer		
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_DEVICEINSERTEDL, "Initialising the transfer descriptors");
+	RDebug::Printf("Initialising the transfer descriptors");
 	TInt err = iUsbInterface1.InitialiseTransferDescriptors();
 	if(err != KErrNone)
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to initialise transfer descriptors"),err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0494_DEVICEINSERTEDL_DUP01, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0494_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 
 	iCaseStep = ETransferOut;	
 	TEndpointReadUntilShortRequest request(1,1,KBulkTransferSize);// EP1 because 1st reader EP ??FIXME
 	iControlEp0->SendRequest(request,this);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0494_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 	} //end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0495.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0495.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,10 +20,6 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0495Traces.h"
-#endif
 
 
  
@@ -51,12 +47,10 @@
 
 CUT_PBASE_T_USBDI_0495* CUT_PBASE_T_USBDI_0495::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0495_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0495* self = new (ELeave) CUT_PBASE_T_USBDI_0495(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -66,14 +60,11 @@
 	iCaseStep(EInProgress),
 	iRequestValidationResultPtr(NULL,0)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0495_CUT_PBASE_T_USBDI_0495_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_CUT_PBASE_T_USBDI_0495_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0495::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0495_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
 
 	iInBuffer = HBufC8::NewL(KTestBufferLength);
@@ -89,39 +80,36 @@
 		iOutBufferPtr.Append(KLiteralEnglish5());
 		}
 
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_CONSTRUCTL, "CUT_PBASE_T_USBDI_0495::ConstructL(): buffer created");
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_CONSTRUCTL_EXIT, this );
+	RDebug::Printf("CUT_PBASE_T_USBDI_0495::ConstructL(): buffer created");
 	}
 
 
 CUT_PBASE_T_USBDI_0495::~CUT_PBASE_T_USBDI_0495()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0495_CUT_PBASE_T_USBDI_0495_ENTRY_DUP01, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_CUT_PBASE_T_USBDI_0495_EXIT_DUP01, this );
+	LOG_FUNC
 	}
 	
 void CUT_PBASE_T_USBDI_0495::KillTransfers()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0495_KILLTRANSFERS_ENTRY, this );
+	LOG_FUNC
 	
 	iOutTransfer[0]->Cancel();
 	iOutTransfer[1]->Cancel();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_KILLTRANSFERS_EXIT, this );
 	}
 	
 	
 	
 void CUT_PBASE_T_USBDI_0495::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d", aCompletionCode);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d", aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
+			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
@@ -129,11 +117,10 @@
 			KillTransfers();
 			_LIT(lit, "<Error %d> Transfer to control endpoint 0 was not successful");
 			msg.Format(lit,aCompletionCode);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP02, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -152,7 +139,7 @@
 		
 		case ERequestRepeatedReadAndValidate:
 			{
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP03, "Try to perform ALL transfers");
+			RDebug::Printf("Try to perform ALL transfers");
 	
 			iCaseStep = ETransfer;	
 			
@@ -162,7 +149,7 @@
 				{
 				_LIT(lit, "TEST FAILURE: No data to send!!");
 				TBuf<40> msg(lit);
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP04, msg);
+				RDebug::Print(msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(KErrAbort,msg);
 				return iControlEp0->SendRequest(request,this);
@@ -172,7 +159,7 @@
 			
 		case ERequestPrepareEndpointValidationResult:
 			{
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP05, "Asking client to prepare the result of its continuous validation");
+			RDebug::Printf("Asking client to prepare the result of its continuous validation");
 			iCaseStep = ERequestValidationResult;
 			iRequestValidationResultPtr.Set( iInBuffer->Des());
 			iRequestValidationResultPtr.Zero(); //reset
@@ -184,14 +171,14 @@
 	
 		case ERequestValidationResult:
 			{
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP06, "Collect client's return validation  result in a pass or fail string ...");
-            OstTraceData(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP56, "", iInBuffer->Ptr(), iInBuffer->Length());
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP07, "\n");
+			RDebug::Printf("Collect client's return validation  result in a pass or fail string ...");
+			RDebug::RawPrint(*iInBuffer);
+			RDebug::Printf("\n");
 			TPtr8 ptr(iInBuffer->Des());
 			if(ptr.Compare(KClientPassString) == 0)
 				{
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP08, "Client Validation Result is a PASS");
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP09, "This is the FINAL check - the whole test has a PASSED");
+				RDebug::Printf("Client Validation Result is a PASS");
+				RDebug::Printf("This is the FINAL check - the whole test has a PASSED");
 				iCaseStep = EPassed;
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
@@ -201,7 +188,7 @@
 				TBuf<256> msg;
 				_LIT(lit, "<Error> Bulk data VALIDATION check was NOT successful");
 				msg.Format(lit);
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP10, msg);
+				RDebug::Print(msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(KErrCorrupt,msg);
 				iControlEp0->SendRequest(request,this);
@@ -210,21 +197,20 @@
 			break;
 	
 		default:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP11, "<Error> Unknown test step");
+			RDebug::Printf("<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0495::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
 	
 	TInt err(KErrNone);
 	TBuf<256> msg;
-	OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
+	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
 
 
 	switch(iCaseStep)
@@ -249,7 +235,7 @@
 				break;
 				}
 
-			OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_DUP01, "Transfer OUT %d completed - num bytes sent = %u", aTransferId, iNumWriteBytesRequested);
+			RDebug::Printf("Transfer OUT %d completed - num bytes sent = %d", aTransferId, iNumWriteBytesRequested);
 			
 			iTransferComplete |= PerformNextTransfer(aTransferId);
 			
@@ -258,10 +244,10 @@
 				/*
 				Transfers all complete - now ask device to validate first interface's transfer OUT
 				*/
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_DUP02, "All Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
+				RDebug::Printf("All Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
 				if(err==KErrNone)
 					{
-					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_DUP03, "Asking client to post validation recorded on the endpoint on its interface - ready for collection");
+					RDebug::Printf("Asking client to post validation recorded on the endpoint on its interface - ready for collection");
 					iCaseStep = ERequestPrepareEndpointValidationResult;
 					TRecordedValidationResultRequest request(1,1);
 					iControlEp0->SendRequest(request,this);
@@ -287,20 +273,19 @@
 	if(err!=KErrNone)
 		{	
 		KillTransfers();
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_DUP04, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
 		}	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0495::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 	
 	Cancel();
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL, "this - %08x", this);
+	RDebug::Printf("this - %08x", this);
 	
 	TBuf<256> msg;
 	TInt err = KErrNone;
@@ -327,7 +312,7 @@
 			iOutTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkOut,iUsbInterface1,KBulkMaxTransferSize,*this,KBulkTransferOutId[1]);
 			
 			// Initialise the descriptors for transfer		
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_DUP01, "Initialising the transfer descriptors - interface 1");
+			RDebug::Printf("Initialising the transfer descriptors - interface 1");
 			err = iUsbInterface1.InitialiseTransferDescriptors();
 			if(err != KErrNone)
 				{
@@ -338,19 +323,18 @@
 		}
 	if(err != KErrNone)
 		{
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_DUP02, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
 		}
 	else
 		{
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_DUP03, "Asking client for continuous 'Read' and 'Validate'");
+		RDebug::Printf("Asking client for continuous 'Read' and 'Validate'");
 		iCaseStep = ERequestRepeatedReadAndValidate;	
 		TRepeatedReadAndValidateDataRequest request(1,1,KLiteralEnglish5,KDeviceNumReadBytes,KTotalBytesToTransfer);// EP2 means endpoint index 2 not the actual endpoint number, here the ep with 32 byte max packet size
 		iControlEp0->SendRequest(request,this);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_EXIT, this );
 	}
 
 TInt CUT_PBASE_T_USBDI_0495::PerformNextTransfer(TInt aTransferId)
@@ -361,13 +345,12 @@
 		transfer ID.
 */
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER_ENTRY, this );
+	LOG_FUNC
 	
 	if(iNumWriteBytesRequested >= KTotalBytesToTransfer)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER, "****ALL DONE for Transfer using ID %d****", aTransferId);
-		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER_DUP01, "Num bytes actually written = %u, num bytes required to be written = %u", iNumWriteBytesRequested, KTotalBytesToTransfer);
-		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER_EXIT, this, aTransferId );
+		RDebug::Printf("****ALL DONE for Transfer using ID %d****", aTransferId);
+		RDebug::Printf("Num bytes actually written = %d, num bytes required to be written = %d", iNumWriteBytesRequested, KTotalBytesToTransfer);
 		return aTransferId; //Not writing any more - signal to user that no more transfers are required on this transfer ID
 		}
 	TUint bytesToWrite = KTotalBytesToTransfer - iNumWriteBytesRequested;
@@ -379,7 +362,6 @@
 	bulkTransfer.TransferOut(iOutBufferPtr.Mid(iNumWriteBytesRequested%(KLiteralEnglish5().Length()), numWriteBytes), EFalse);
 	iNumWriteBytesRequested += numWriteBytes;
 
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER_EXIT_DUP01, this );
 	return 0; //Signal to the user that another transfer is queued on the specified transfer ID
 	}
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0496.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0496.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,10 +20,6 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0496Traces.h"
-#endif
 
 
  
@@ -52,12 +48,10 @@
 
 CUT_PBASE_T_USBDI_0496* CUT_PBASE_T_USBDI_0496::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0496_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0496* self = new (ELeave) CUT_PBASE_T_USBDI_0496(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -66,14 +60,11 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0496_CUT_PBASE_T_USBDI_0496_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_CUT_PBASE_T_USBDI_0496_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0496::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0496_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
 
 	iInBuffer = HBufC8::NewL(KTestBufferLength);
@@ -89,39 +80,36 @@
 		iValidateBufferPtr.Append(KLiteralEnglish5());
 		}
 	
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_CONSTRUCTL, "CUT_PBASE_T_USBDI_0496::ConstructL(): buffer created");
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_CONSTRUCTL_EXIT, this );
+	RDebug::Printf("CUT_PBASE_T_USBDI_0496::ConstructL(): buffer created");
 	}
 
 
 CUT_PBASE_T_USBDI_0496::~CUT_PBASE_T_USBDI_0496()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0496_CUT_PBASE_T_USBDI_0496_ENTRY_DUP01, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_CUT_PBASE_T_USBDI_0496_EXIT_DUP01, this );
+	LOG_FUNC
 	}
 	
 void CUT_PBASE_T_USBDI_0496::KillTransfers()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0496_KILLTRANSFERS_ENTRY, this );
+	LOG_FUNC
 	
 	iInTransfer[0]->Cancel();
 	iInTransfer[1]->Cancel();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_KILLTRANSFERS_EXIT, this );
 	}
 	
 	
 	
 void CUT_PBASE_T_USBDI_0496::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d", aCompletionCode);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d", aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
+			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
@@ -129,11 +117,10 @@
 			TBuf<256> msg;
 			_LIT(lit, "<Error %d> Transfer to control endpoint 0 was not successful");
 			msg.Format(lit,aCompletionCode);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP02, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -152,20 +139,20 @@
 		
 		case ERequestRepeatedWrite:
 			{
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP03, "Try to perform ALL transfers");
+			RDebug::Printf("Try to perform ALL transfers");
 			
 			iCaseStep = ETransfer;	
 			iIsValid = ETrue; //innocent until proved guilty
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP04, "\n");
+			RDebug::Printf("\n");
 			iTransferComplete |= ValidatePreviousAndPerformNextTransfers(KBulkTransferInId[0]); //should not validate - just perform necessary transfers
 			iTransferComplete |= ValidatePreviousAndPerformNextTransfers(KBulkTransferInId[1]); //should not validate - just perform necessary transfers
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP05, "\n");
+			RDebug::Printf("\n");
 			if((iTransferComplete & KBulkTransferIdMask) == KBulkTransferIdMask)
 				{
 				iTransferComplete = 0; //reset
 				_LIT(lit, "TEST FAILURE: No data to send!!");
 				TBuf<40> msg(lit);
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP06, msg);
+				RDebug::Print(msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(KErrAbort,msg);
 				return iControlEp0->SendRequest(request,this);
@@ -174,21 +161,20 @@
 			break;
 
 		default:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP07, "<Error> Unknown test step");
+			RDebug::Printf("<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0496::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
 	
 	TInt err(KErrNone);
 	TBuf<256> msg;
-	OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
+	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
 
 
 	switch(iCaseStep)
@@ -212,16 +198,16 @@
 				break;
 				}
 	
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP01, "\n");
+			RDebug::Printf("\n");
 			iTransferComplete |= ValidatePreviousAndPerformNextTransfers(aTransferId);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP02, "\n");
+			RDebug::Printf("\n");
 			
 			if(err==KErrNone && (iTransferComplete & KBulkTransferIdMask) == KBulkTransferIdMask)
 				{
 				/*
 				Transfers all complete - check all were valid, and if so pass the test
 				*/
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP03, "All Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
+				RDebug::Printf("All Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
 				if(!iIsValid)
 					{
 					err = KErrCompletion; //indicates data validation failure
@@ -229,7 +215,7 @@
 					break;
 					}
 				// Comparison is a match
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP04, "Comparison for IN transfer is a match");
+				RDebug::Printf("Comparison for IN transfer is a match");
 				iCaseStep = EPassed;
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
@@ -256,20 +242,19 @@
 	if(err!=KErrNone)
 		{	
 		KillTransfers();
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP05, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
 		}	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0496::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 	
 	Cancel();
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL, "this - %08x", this);
+	RDebug::Printf("this - %08x", this);
 	
 	TBuf<256> msg;
 	TInt err = KErrNone;
@@ -296,7 +281,7 @@
 			iInTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,KBulkMaxTransferSize,*this,KBulkTransferInId[1]);
 			
 			// Initialise the descriptors for transfer		
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_DUP01, "Initialising the transfer descriptors - interface 1");
+			RDebug::Printf("Initialising the transfer descriptors - interface 1");
 			err = iUsbInterface1.InitialiseTransferDescriptors();
 			if(err != KErrNone)
 				{
@@ -307,24 +292,22 @@
 		}
 	if(err != KErrNone)
 		{
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_DUP02, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
 		}
 	else
 		{
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_DUP03, "Asking client for 'Read' on interface 1");
+		RDebug::Printf("Asking client for 'Read' on interface 1");
 		iCaseStep = ERequestRepeatedWrite;	
 		TRepeatedWriteDataRequest request(1,1,KLiteralEnglish5(),KDeviceNumWriteBytes,KTotalBytesToTransfer);// EP2 means endpoint index 2 not the actual endpoint number, here the ep with 32 byte max packet size
 		iControlEp0->SendRequest(request,this);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_EXIT, this );
 	}
 
 TUint8 CUT_PBASE_T_USBDI_0496::Index(TUint8 aTransferId)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0496_INDEX_ENTRY, this );
 	switch(aTransferId)
 		{
 		case KBulkTransferInId0:
@@ -334,7 +317,6 @@
 		default:
 			_LIT(lit, "TRANSFER ID OUT OF RANGE");
 			User::Panic(lit, KErrArgument);
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_INDEX_EXIT, this );
 			return 0; //should never get here
 		}
 	}
@@ -347,11 +329,11 @@
 		transfer ID.
 */
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_ENTRY, this );
+	LOG_FUNC
 	
 	TUint8 index = Index(aTransferId);
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS, "\n");
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP01, "Transfer[%d]", index);
+	RDebug::Printf("\n");
+	RDebug::Printf("Transfer[%d]", index);
 	
 	
 	if(iNumBytesExpected[index] != 0)
@@ -359,7 +341,7 @@
 		TPtrC8 data1(iInTransfer[index]->DataPolled());
 		if(ValidateData(data1, iValidateBufferPtr.Mid(iValidationStringStartPointTransfer[index], iNumBytesExpected[index])) == EFalse)
 			{
-			OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP02, "=====VALIDATION FAILURE: Point of Validation String Entry %u, Newly Read Bytes %u=====",iValidationStringStartPointTransfer[index], iNumBytesExpected[index]);
+			RDebug::Printf("=====VALIDATION FAILURE: Point of Validation String Entry %d, Newly Read Bytes %d=====",iValidationStringStartPointTransfer[index], iNumBytesExpected[index]);
 			iIsValid = EFalse;
 			}
 		iNumBytesExpected[index] = 0; //reset
@@ -367,8 +349,7 @@
 	if(iNumBytesRequestedSoFar >= KTotalBytesToTransfer)
 		//if we are near the end the other transfer will mop up remaining bytes...
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP03, "****ALL DONE for Transfer[%d]****", index);
-		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_EXIT, this, aTransferId );
+		RDebug::Printf("****ALL DONE for Transfer[%d]****", index);
 		return aTransferId; //tell caller that all transfers are complete for this transfer ID
 		}
 
@@ -379,7 +360,6 @@
 	iInTransfer[index]->TransferIn(KHostNumReadBytes); //rely on ZLP to complete the last 'TransferIn'
 	iExpectedNextTransferNumber = 1 - iExpectedNextTransferNumber;
 
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_EXIT_DUP01, this );
 	return 0; //tell caller there are still transfers to complete for the requested transfer ID
 	}
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0497.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0497.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,10 +20,6 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0497Traces.h"
-#endif
 
 
  
@@ -67,12 +63,10 @@
 
 CUT_PBASE_T_USBDI_0497* CUT_PBASE_T_USBDI_0497::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0497_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0497* self = new (ELeave) CUT_PBASE_T_USBDI_0497(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0497_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -81,16 +75,12 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0497_CUT_PBASE_T_USBDI_0497_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0497_CUT_PBASE_T_USBDI_0497_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0497::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0497_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0497_CONSTRUCTL_EXIT, this );
 	}
 
 
@@ -99,7 +89,7 @@
 	The transfer objects have test specific names - so perform transfer specific clean up here.
 	*/
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0497_CUT_PBASE_T_USBDI_0497_ENTRY_DUP01, this );
+	LOG_FUNC
 	
 	Cancel();
 
@@ -121,31 +111,29 @@
 		delete iIfc2InTransfer[count];
 		iIfc2InTransfer[count] = NULL;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0497_CUT_PBASE_T_USBDI_0497_EXIT_DUP01, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0497::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
+			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP02, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -164,7 +152,7 @@
 		
 		case ERequestDeviceRead:
 			{
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP03, "Asking client for 'Read' on interface 2");
+			RDebug::Printf("Asking client for 'Read' on interface 2");
 			iCaseStep = ETransferOut;	
 			TEndpointReadRequest request(2,1,KDeviceNumReadBytes);// EP1 means endpoint index 1 not the actual endpoint number
 			iControlEp0->SendRequest(request,this);
@@ -172,7 +160,7 @@
 			break;
 			
 		case ETransferOut:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP04, "Try to write data on BOTH interfaces");
+			RDebug::Printf("Try to write data on BOTH interfaces");
 	
 			iStartTime[0].HomeTime();
 			iStartTime[1].HomeTime();
@@ -185,7 +173,7 @@
 		
 		case ERequestDeviceWriteBack:
 			{
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP05, "Asking client for 'Write' back on interface 2");
+			RDebug::Printf("Asking client for 'Write' back on interface 2");
 			iCaseStep = ETransferIn;	
 			TWriteCachedReadDataRequest request(2,1,1);// EP1 means endpoint index 1 not the actual endpoint number
 			iControlEp0->SendRequest(request,this);
@@ -193,7 +181,7 @@
 			break;
 			
 		case ETransferIn:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP06, "Try to receive data on BOTH interfaces");
+			RDebug::Printf("Try to receive data on BOTH interfaces");
 	
 			iStartTime[0].HomeTime();
 			iStartTime[1].HomeTime();
@@ -205,21 +193,20 @@
 			break;
 	
 		default:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP07, "<Error> Unknown test step");
+			RDebug::Printf("<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0497::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
 	
 	TInt err(KErrNone);
 	TBuf<256> msg;
-	OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
+	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
 
 	switch(iCaseStep)
 		{
@@ -242,7 +229,7 @@
 				case KIfc2BulkTransferOutId1:
 				case KIfc2BulkTransferOutId2:
 					iTransferComplete |= aTransferId;
-					OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP01, "Transfer OUT %d completed (Transfer Completion Aggregation Mask 0x%x)", aTransferId, iTransferComplete);
+					RDebug::Printf("Transfer OUT %d completed (Transfer Completion Aggregation Mask 0x%x)", aTransferId, iTransferComplete);
 					break; //switch(aTransferId)
 				default:
 					iTransferComplete = 0; //reset
@@ -266,7 +253,7 @@
 
 			if(err==KErrNone && (iTransferComplete & KBulkTransferOutIdMask) == KBulkTransferOutIdMask)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP02, "All OUT Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
+				RDebug::Printf("All OUT Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
 				iTransferComplete = 0; //reset
 				err = CheckAndResetTimes(0, 1, KMaxTimeDiffPercentage);
 				if(err!=KErrNone)
@@ -274,7 +261,7 @@
 					break; //switch(iCaseStep)
 					}
 	
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP03, "Asking client for 'Write' back on interface 1");
+				RDebug::Printf("Asking client for 'Write' back on interface 1");
 				iCaseStep = ERequestDeviceWriteBack;
 				TWriteCachedReadDataRequest request(1,1,1);// EP1 means endpoint index 1 not the actual endpoint number
 				iControlEp0->SendRequest(request,this);
@@ -301,7 +288,7 @@
 				case KIfc2BulkTransferInId1:
 				case KIfc2BulkTransferInId2:
 					iTransferComplete |= aTransferId;
-					OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP04, "Transfer OUT %d completed (Transfer Completion Aggregation Mask 0x%x)", aTransferId, iTransferComplete);
+					RDebug::Printf("Transfer OUT %d completed (Transfer Completion Aggregation Mask 0x%x)", aTransferId, iTransferComplete);
 					break; //switch(aTransferId)
 	
 				default:
@@ -327,7 +314,7 @@
 			if(err==KErrNone && (iTransferComplete & KBulkTransferInIdMask) == KBulkTransferInIdMask)
 				{
 				// ok, compare data rcvd now
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP05, "All IN Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
+				RDebug::Printf("All IN Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
 				iTransferComplete = 0; //reset
 				err = CheckAndResetTimes(0, 1, KMaxTimeDiffPercentage);
 				if(err!=KErrNone)
@@ -342,7 +329,7 @@
 				//Validate first transfer on Interface 1 for number of bytes originally written.
 				if(ValidateData(data1, KLiteralFrench4(), KHostNumWriteBytes1) == EFalse)
 					{
-					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP06, "Validation failure 1st transfer, Interface 1");
+					RDebug::Printf("Validation failure 1st transfer, Interface 1");
 					err = KErrCompletion; //indicates data validation failure
 					break; //switch(iCaseStep)
 					}
@@ -350,7 +337,7 @@
 				//Validate second transfer on Interface 1 for number of bytes originally written.
 				if(ValidateData(data2, KLiteralFrench4(), KHostNumWriteBytes1, KHostNumWriteBytes2) == EFalse)
 					{
-					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP07, "Validation failure 2nd transfer, Interface 1");
+					RDebug::Printf("Validation failure 2nd transfer, Interface 1");
 					err = KErrCompletion; //indicates data validation failure
 					break; //switch(iCaseStep)
 					}
@@ -358,7 +345,7 @@
 				//Validate first transfer on Interface 2 for number of bytes originally written.
 				if(ValidateData(data3, KLiteralEnglish8(), KHostNumWriteBytes1) == EFalse)
 					{
-					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP08, "Validation failure 1st transfer, Interface 2");
+					RDebug::Printf("Validation failure 1st transfer, Interface 2");
 					err = KErrCompletion; //indicates data validation failure
 					break; //switch(iCaseStep)
 					}
@@ -366,13 +353,13 @@
 				//Validate second transfer on Interface 2 for number of bytes originally written.
 				if(ValidateData(data4, KLiteralEnglish8(), KHostNumWriteBytes1, KHostNumWriteBytes2) == EFalse)
 					{
-					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP09, "Validation failure 2nd transfer, Interface 2");
+					RDebug::Printf("Validation failure 2nd transfer, Interface 2");
 					err = KErrCompletion; //indicates data validation failure
 					break; //switch(iCaseStep)
 					}
 
 				// Comparison is a match
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP10, "Comparison for IN transfer is a match");
+				RDebug::Printf("Comparison for IN transfer is a match");
 				iCaseStep = EPassed;
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
@@ -399,20 +386,19 @@
 	
 	if(err!=KErrNone)
 		{	
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP11, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
 		}	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0497::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 	
 	Cancel();
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL, "this - %08x", this);
+	RDebug::Printf("this - %08x", this);
 	
 	TBuf<256> msg;
 	TInt err = KErrNone;
@@ -444,7 +430,7 @@
 			iIfc2OutTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface2BulkOut1,iUsbInterface2,KBulkMaxTransferSize,*this,KIfc2BulkTransferOutId2);
 			
 			// Initialise the descriptors for transfer		
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_DUP01, "Initialising the transfer descriptors - interface 1");
+			RDebug::Printf("Initialising the transfer descriptors - interface 1");
 			err = iUsbInterface1.InitialiseTransferDescriptors();
 			if(err != KErrNone)
 				{
@@ -453,7 +439,7 @@
 			else
 				{
 				// Initialise the descriptors for transfer		
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_DUP02, "Initialising the transfer descriptors (Interface 2)");
+				RDebug::Printf("Initialising the transfer descriptors (Interface 2)");
 				err = iUsbInterface2.InitialiseTransferDescriptors();
 				if(err != KErrNone)
 					{
@@ -464,19 +450,18 @@
 		}
 	if(err != KErrNone)
 		{
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_DUP03, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
 		}
 	else
 		{
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_DUP04, "Asking client for 'Read' on interface 1");
+		RDebug::Printf("Asking client for 'Read' on interface 1");
 		iCaseStep = ERequestDeviceRead;	
 		TEndpointReadRequest request(1,1,KDeviceNumReadBytes);// EP1 means endpoint index 1 not the actual endpoint number
 		iControlEp0->SendRequest(request,this);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_EXIT, this );
 	}
 	
 	} //end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0498.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0498.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,10 +20,6 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0498Traces.h"
-#endif
 
 
  
@@ -69,12 +65,10 @@
 
 CUT_PBASE_T_USBDI_0498* CUT_PBASE_T_USBDI_0498::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0498_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0498* self = new (ELeave) CUT_PBASE_T_USBDI_0498(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0498_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -84,19 +78,15 @@
 	iCaseStep(EInProgress),
 	iRequestDeviceValidationResultPtr(NULL,0)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0498_CUT_PBASE_T_USBDI_0498_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0498_CUT_PBASE_T_USBDI_0498_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0498::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0498_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
 
 	iInBuffer = HBufC8::NewL(KTestBufferLength);
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_CONSTRUCTL, "CUT_PBASE_T_USBDI_0491::ConstructL(): buffer created");
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0498_CONSTRUCTL_EXIT, this );
+	RDebug::Printf("CUT_PBASE_T_USBDI_0491::ConstructL(): buffer created");
 	}
 
 
@@ -105,7 +95,7 @@
 The transfer objects have test specific names - so perform transfer specific clean up here.
 */
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0498_CUT_PBASE_T_USBDI_0498_ENTRY_DUP01, this );
+	LOG_FUNC
 	
 	Cancel();
 
@@ -127,31 +117,29 @@
 		delete iIfc2InTransfer[count];
 		iIfc2InTransfer[count] = NULL;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0498_CUT_PBASE_T_USBDI_0498_EXIT_DUP01, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0498::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
+			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP02, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -170,7 +158,7 @@
 		
 		case ERequestDeviceIFC1Read:
 			{
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP03, "Asking client for 'Read' on interface 2");
+			RDebug::Printf("Asking client for 'Read' on interface 2");
 			iCaseStep = ERequestDeviceIFC2Read;	
 			TEndpointReadRequest request(2,1,KDeviceNumReadBytes);// EP1 means endpoint index 1 not the actual endpoint number
 			iControlEp0->SendRequest(request,this);
@@ -179,7 +167,7 @@
 			
 		case ERequestDeviceIFC2Read:
 			{
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP04, "Asking client to 'Write' on interface 1");
+			RDebug::Printf("Asking client to 'Write' on interface 1");
 			iCaseStep = ERequestDeviceIFC1Write;	
 			TEndpointPatternWriteRequest request(1,1,KLiteralFrench4(),KDeviceNumWriteBytes);
 			iControlEp0->SendRequest(request,this);
@@ -188,7 +176,7 @@
 			
 		case ERequestDeviceIFC1Write:
 			{
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP05, "Asking client to 'Write' on interface 2");
+			RDebug::Printf("Asking client to 'Write' on interface 2");
 			iCaseStep = ERequestDeviceIFC2Write;	
 			TEndpointPatternWriteRequest request(2,1,KLiteralEnglish2(),KDeviceNumWriteBytes);
 			iControlEp0->SendRequest(request,this);
@@ -197,7 +185,7 @@
 			
 		case ERequestDeviceIFC2Write:
 			{
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP06, "Try to perform ALL transfers on BOTH interfaces");
+			RDebug::Printf("Try to perform ALL transfers on BOTH interfaces");
 	
 			iCaseStep = ETransfer;	
 	
@@ -221,7 +209,7 @@
 		case ERequestDeviceValidateIFC1:
 			{
 			iCaseStep = ERequestDeviceValidationResultIFC1;
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP07, "Interface 1: Request Client Validation Result");
+			RDebug::Printf("Interface 1: Request Client Validation Result");
 			iRequestDeviceValidationResultPtr.Set(iInBuffer->Des());
 			iRequestDeviceValidationResultPtr.Zero(); //reset
 			iRequestDeviceValidationResultPtr.SetLength(KPassFailStringLength);
@@ -232,14 +220,14 @@
 		
 		case ERequestDeviceValidationResultIFC1:
 			{
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP08, "Interface 1: Client Validation Result string ...");
-            OstTraceData(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP58, "", iInBuffer->Ptr(), iInBuffer->Length());
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP09, "\n");
+			RDebug::Printf("Interface 1: Client Validation Result string ...");
+			RDebug::RawPrint(*iInBuffer);
+			RDebug::Printf("\n");
 			TPtr8 ptr(iInBuffer->Des());
 			if(ptr.Compare(KClientPassString) == 0)
 				{
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP10, "Client Validation Interface 1 Result is a PASS");
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP11, "Now performing Client Validation for Interface 2");
+				RDebug::Printf("Client Validation Interface 1 Result is a PASS");
+				RDebug::Printf("Now performing Client Validation for Interface 2");
 				iCaseStep = ERequestDeviceValidateIFC2;
 				TEndpointStringValidationRequest request(2,1,KLiteralEnglish2(),KDeviceNumReadBytes);
 				iControlEp0->SendRequest(request,this);
@@ -248,7 +236,7 @@
 				{
 				TBuf<256> msg;
 				msg.Format(_L("<Error> Bulk data VALIDATION check was NOT successful"));
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP12, msg);
+				RDebug::Print(msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(KErrCorrupt,msg);
 				iControlEp0->SendRequest(request,this);
@@ -259,7 +247,7 @@
 		case ERequestDeviceValidateIFC2:
 			{
 			iCaseStep = ERequestDeviceValidationResultIFC2;
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP13, "Interface 2: Request Client Validation Result");
+			RDebug::Printf("Interface 2: Request Client Validation Result");
 			iRequestDeviceValidationResultPtr.Set(iInBuffer->Des());
 			iRequestDeviceValidationResultPtr.Zero(); //reset
 			iRequestDeviceValidationResultPtr.SetLength(KPassFailStringLength);
@@ -270,14 +258,14 @@
 		
 		case ERequestDeviceValidationResultIFC2:
 			{
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP14, "Interface 1: Client Validation Result string ...");
-            OstTraceData(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP54, "", iInBuffer->Ptr(), iInBuffer->Length());
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP15, "\n");
+			RDebug::Printf("Interface 1: Client Validation Result string ...");
+			RDebug::RawPrint(*iInBuffer);
+			RDebug::Printf("\n");
 			TPtr8 ptr(iInBuffer->Des());
 			if(ptr.Compare(KClientPassString) == 0)
 				{
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP16, "Client Validation Interface 2 Result is a PASS");
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP17, "This is the FINAL check - the whole test has a PASSED");
+				RDebug::Printf("Client Validation Interface 2 Result is a PASS");
+				RDebug::Printf("This is the FINAL check - the whole test has a PASSED");
 				iCaseStep = EPassed;
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
@@ -286,7 +274,7 @@
 				{
 				TBuf<256> msg;
 				msg.Format(_L("<Error> Bulk data VALIDATION check was NOT successful"));
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP18, msg);
+				RDebug::Print(msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(KErrCorrupt,msg);
 				iControlEp0->SendRequest(request,this);
@@ -295,21 +283,20 @@
 			break;
 	
 		default:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP19, "<Error> Unknown test step");
+			RDebug::Printf("<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0498::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
 	
 	TInt err(KErrNone);
 	TBuf<256> msg;
-	OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
+	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
 
 
 	switch(iCaseStep)
@@ -337,7 +324,7 @@
 				case KIfc2BulkTransferOutId1:
 				case KIfc2BulkTransferOutId2:
 					iTransferComplete |= aTransferId;
-					OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP01, "Transfer OUT %d completed (Transfer Completion Aggregation Mask 0x%x)", aTransferId, iTransferComplete);
+					RDebug::Printf("Transfer OUT %d completed (Transfer Completion Aggregation Mask 0x%x)", aTransferId, iTransferComplete);
 					break; //switch(aTransferId)
 
 				case KIfc1BulkTransferInId1:
@@ -345,7 +332,7 @@
 				case KIfc2BulkTransferInId1:
 				case KIfc2BulkTransferInId2:
 					iTransferComplete |= aTransferId;
-					OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP02, "Transfer OUT %d completed (Transfer Completion Aggregation Mask 0x%x)", aTransferId, iTransferComplete);
+					RDebug::Printf("Transfer OUT %d completed (Transfer Completion Aggregation Mask 0x%x)", aTransferId, iTransferComplete);
 					break; //switch(aTransferId)
 
 				default:
@@ -378,7 +365,7 @@
 				}
 			if(err==KErrNone && (iTransferComplete & KBulkTransferOutIdMask) == KBulkTransferOutIdMask)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP03, "All OUT Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
+				RDebug::Printf("All OUT Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
 				//Leave validation to the point at which all transfers have completed.
 				}
 	
@@ -396,7 +383,7 @@
 			if(err==KErrNone && (iTransferComplete & KBulkTransferInIdMask) == KBulkTransferInIdMask)
 				{
 				// ok, compare data rcvd now
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP04, "All IN Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
+				RDebug::Printf("All IN Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
 	
 				TPtrC8 data1(iIfc1InTransfer[0]->DataPolled());	
 				TPtrC8 data2(iIfc1InTransfer[1]->DataPolled());		
@@ -405,7 +392,7 @@
 				//Validate first transfer on Interface 1 for number of bytes originally written.
 				if(ValidateData(data1, KLiteralFrench4(), KHostNumWriteBytes1) == EFalse)
 					{
-					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP05, "Validation failure 1st transfer, Interface 1");
+					RDebug::Printf("Validation failure 1st transfer, Interface 1");
 					err = KErrCompletion; //indicates data validation failure
 					break; //switch(iCaseStep)
 					}
@@ -413,7 +400,7 @@
 				//Validate second transfer on Interface 1 for number of bytes originally written.
 				if(ValidateData(data2, KLiteralFrench4(), KHostNumWriteBytes1, KHostNumWriteBytes2) == EFalse)
 					{
-					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP06, "Validation failure 2nd transfer, Interface 1");
+					RDebug::Printf("Validation failure 2nd transfer, Interface 1");
 					err = KErrCompletion; //indicates data validation failure
 					break; //switch(iCaseStep)
 					}
@@ -421,7 +408,7 @@
 				//Validate first transfer on Interface 2 for number of bytes originally written.
 				if(ValidateData(data3, KLiteralEnglish2(), KHostNumWriteBytes1) == EFalse)
 					{
-					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP07, "Validation failure 1st transfer, Interface 2");
+					RDebug::Printf("Validation failure 1st transfer, Interface 2");
 					err = KErrCompletion; //indicates data validation failure
 					break; //switch(iCaseStep)
 					}
@@ -429,13 +416,13 @@
 				//Validate second transfer on Interface 2 for number of bytes originally written.
 				if(ValidateData(data4, KLiteralEnglish2(), KHostNumWriteBytes1, KHostNumWriteBytes2) == EFalse)
 					{
-					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP08, "Validation failure 2nd transfer, Interface 2");
+					RDebug::Printf("Validation failure 2nd transfer, Interface 2");
 					err = KErrCompletion; //indicates data validation failure
 					break; //switch(iCaseStep)
 					}
 				
 				// Comparison is a match
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP09, "Comparison for IN transfer is a match");
+				RDebug::Printf("Comparison for IN transfer is a match");
 				}
 			break; //switch(iCaseStep)
 
@@ -450,7 +437,7 @@
 	Transfers all complete - now ask device to validate first interface's transfer OUT
 	*/
 		{
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP10, "Checking all times against each other");
+		RDebug::Printf("Checking all times against each other");
 		err = CheckTimes(0, 1, KMaxTimeDiffPercentage);
 		err = err?err:CheckTimes(0, 2, KMaxTimeDiffPercentage);
 		err = err?err:CheckTimes(0, 3, KMaxTimeDiffPercentage);
@@ -464,7 +451,7 @@
 		
 		if(err==KErrNone)
 			{
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP11, "Asking client for 'Validate' data written on interface 1");
+			RDebug::Printf("Asking client for 'Validate' data written on interface 1");
 			iCaseStep = ERequestDeviceValidateIFC1;
 			TEndpointStringValidationRequest request(1,1,KLiteralFrench4(),KDeviceNumReadBytes);
 			iControlEp0->SendRequest(request,this);
@@ -485,20 +472,19 @@
 	
 	if(err!=KErrNone)
 		{	
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP12, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
 		}	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0498::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 	
 	Cancel();
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL, "this - %08x", this);
+	RDebug::Printf("this - %08x", this);
 	
 	TBuf<256> msg;
 	TInt err = KErrNone;
@@ -530,7 +516,7 @@
 			iIfc2OutTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface2BulkOut1,iUsbInterface2,KBulkMaxTransferSize,*this,KIfc2BulkTransferOutId2);
 			
 			// Initialise the descriptors for transfer		
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_DUP01, "Initialising the transfer descriptors - interface 1");
+			RDebug::Printf("Initialising the transfer descriptors - interface 1");
 			err = iUsbInterface1.InitialiseTransferDescriptors();
 			if(err != KErrNone)
 				{
@@ -539,7 +525,7 @@
 			else
 				{
 				// Initialise the descriptors for transfer		
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_DUP02, "Initialising the transfer descriptors (Interface 2)");
+				RDebug::Printf("Initialising the transfer descriptors (Interface 2)");
 				err = iUsbInterface2.InitialiseTransferDescriptors();
 				if(err != KErrNone)
 					{
@@ -550,19 +536,18 @@
 		}
 	if(err != KErrNone)
 		{
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_DUP03, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
 		}
 	else
 		{
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_DUP04, "Asking client for 'Read' on interface 1");
+		RDebug::Printf("Asking client for 'Read' on interface 1");
 		iCaseStep = ERequestDeviceIFC1Read;	
 		TEndpointReadRequest request(1,1,KDeviceNumReadBytes);// EP1 means endpoint index 1 not the actual endpoint number
 		iControlEp0->SendRequest(request,this);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_EXIT, this );
 	}
 	
 	} //end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0499.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0499.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,10 +20,6 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0499Traces.h"
-#endif
 
 
  
@@ -57,12 +53,10 @@
 
 CUT_PBASE_T_USBDI_0499* CUT_PBASE_T_USBDI_0499::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0499_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0499* self = new (ELeave) CUT_PBASE_T_USBDI_0499(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0499_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -71,47 +65,41 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0499_CUT_PBASE_T_USBDI_0499_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0499_CUT_PBASE_T_USBDI_0499_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0499::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0499_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0499_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0499::~CUT_PBASE_T_USBDI_0499()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0499_CUT_PBASE_T_USBDI_0499_ENTRY_DUP01, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0499_CUT_PBASE_T_USBDI_0499_EXIT_DUP01, this );
+	LOG_FUNC
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0499::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
+			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP02, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -135,7 +123,7 @@
 		
 		case EAwaitClearPreHalt:
 			{
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP03, "Client has been asked to clear endpoint buffer");
+			RDebug::Printf("Client has been asked to clear endpoint buffer");
 			User::After(1000000); //Give client time to clear buffer
 			TEndpointCancelReadRequest request(1,1);
 			iControlEp0->SendRequest(request,this);
@@ -152,32 +140,31 @@
 			break;
 			
 		case ETransferOut:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP04, "Try to send data (post halt)");
+			RDebug::Printf("Try to send data (post halt)");
 			iOutTransfer[0]->TransferOut(KLiteralEnglish8().Mid(0, KHostNumWriteBytesPostHalt1), EFalse);
 			iOutTransfer[1]->TransferOut(KLiteralEnglish8().Mid(KHostNumWriteBytesPostHalt1, KHostNumWriteBytesPostHalt2), EFalse);
 			break;
 		
 		case ETransferIn:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP05, "Try to receive data");
+			RDebug::Printf("Try to receive data");
 			iInTransfer[0]->TransferIn(KHostNumReadBytesPostHalt);
 			break;
 	
 		default:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP06, "<Error> Unknown test step");
+			RDebug::Printf("<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0499::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
 	
 	TInt err(KErrNone);
 	TBuf<256> msg;
-	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
+	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
 
 	switch(iCaseStep)
 		{
@@ -197,7 +184,7 @@
 				case KBulkTransferOutId0:
 				case KBulkTransferOutId1:
 					iTransferComplete |= aTransferId;
-					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP01, "Transfer %d stalled", aTransferId);
+					RDebug::Printf("Transfer %d stalled", aTransferId);
 					break; //switch(aTransferId)
 				
 				default:
@@ -210,7 +197,7 @@
 
 			if(err==KErrNone && iTransferComplete == (KBulkTransferOutId0 | KBulkTransferOutId1))
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP02, "Clear halt and try to send data again. Transfers Completed %d", iTransferComplete);
+				RDebug::Printf("Clear halt and try to send data again. Transfers Completed %d", iTransferComplete);
 				// Acknowledge the stall and clear				
 				err = iTestPipeInterface1BulkOut.ClearRemoteStall();
 				if(err != KErrNone)
@@ -242,7 +229,7 @@
 				case KBulkTransferOutId0:
 				case KBulkTransferOutId1:
 					iTransferComplete |= aTransferId;
-					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP03, "Transfer %d completed", aTransferId);
+					RDebug::Printf("Transfer %d completed", aTransferId);
 					break; //switch(aTransferId)
 
 				default:
@@ -255,7 +242,7 @@
 
 			if(err==KErrNone && iTransferComplete == (KBulkTransferOutId0 | KBulkTransferOutId1))
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP04, "Try to receive back sent data. Transfers Completed %d", iTransferComplete);
+				RDebug::Printf("Try to receive back sent data. Transfers Completed %d", iTransferComplete);
 				iCaseStep = ETransferIn;
 				TWriteSynchronousCachedReadDataRequest request(1,1,1);
 				iControlEp0->SendRequest(request,this);	
@@ -290,7 +277,7 @@
 				}
 			
 			// Comparison is a match
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP05, "Comparison for IN transfer is a match");
+			RDebug::Printf("Comparison for IN transfer is a match");
 			iCaseStep = EPassed;
 			TTestCasePassed request;
 			iControlEp0->SendRequest(request,this);
@@ -312,17 +299,16 @@
 	
 	if(err!=KErrNone)
 		{	
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP06, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
 		}	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0499::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0499_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 	
 	Cancel();
 	
@@ -338,24 +324,22 @@
 	iOutTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkOut,iUsbInterface1,KBulkMaxOUTTransferSize,*this,KBulkTransferOutId1);
 	
 	// Initialise the descriptors for transfer		
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_DEVICEINSERTEDL, "Initialising the transfer descriptors");
+	RDebug::Printf("Initialising the transfer descriptors");
 	TInt err = iUsbInterface1.InitialiseTransferDescriptors();
 	if(err != KErrNone)
 		{
 		TBuf<256> msg;
 		msg.Format(_L("<Error %d> Unable to initialise transfer descriptors"),err);
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0499_DEVICEINSERTEDL_DUP01, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0499_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}
 
 	iCaseStep = ETransferOutHalt;	
 	TEndpointReadAndHaltRequest request(1,1,KDeviceNumReadBytesPreHalt);// EP1 means endpoint index 1 not the actual endpoint number
 	iControlEp0->SendRequest(request,this);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0499_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 	
 	} //end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0500.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0500.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,10 +20,6 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-0500Traces.h"
-#endif
 
 
  
@@ -53,12 +49,10 @@
 
 CUT_PBASE_T_USBDI_0500* CUT_PBASE_T_USBDI_0500::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0500_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_0500* self = new (ELeave) CUT_PBASE_T_USBDI_0500(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -67,47 +61,41 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0500_CUT_PBASE_T_USBDI_0500_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_CUT_PBASE_T_USBDI_0500_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_0500::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0500_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_0500::~CUT_PBASE_T_USBDI_0500()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0500_CUT_PBASE_T_USBDI_0500_ENTRY_DUP01, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_CUT_PBASE_T_USBDI_0500_EXIT_DUP01, this );
+	LOG_FUNC
 	}
 	
 	
 void CUT_PBASE_T_USBDI_0500::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
+			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP02, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -125,33 +113,32 @@
 			break;
 			
 		case ETransferInHalt:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP03, "Try to receive data (pre halt)");
+			RDebug::Printf("Try to receive data (pre halt)");
 			iInTransfer[0]->TransferIn(KHostNumReadBytesPreHalt1);
 			iInTransfer[1]->TransferIn(KHostNumReadBytesPreHalt2);
 			break;
 		
 		case ETransferIn:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP04, "Try to receive data");
+			RDebug::Printf("Try to receive data");
 			iInTransfer[0]->TransferIn(KHostNumReadBytesPostHalt1);
 			iInTransfer[1]->TransferIn(KHostNumReadBytesPostHalt2);
 			break;
 	
 		default:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP05, "<Error> Unknown test step");
+			RDebug::Printf("<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0500::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
 	
 	TInt err(KErrNone);
 	TBuf<256> msg;
-	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
+	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode);
 
 	switch(iCaseStep)
 		{
@@ -171,7 +158,7 @@
 				case KBulkTransferInId0:
 				case KBulkTransferInId1:
 					iTransferComplete |= aTransferId;
-					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP01, "Transfer %d completed", aTransferId);
+					RDebug::Printf("Transfer %d completed", aTransferId);
 					break; //switch(aTransferId)
 
 				default:
@@ -184,7 +171,7 @@
 
 			if(err==KErrNone && iTransferComplete == (KBulkTransferInId0 | KBulkTransferInId1))
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP02, "Clear halt and try to send data again. Transfers Completed %d", iTransferComplete);
+				RDebug::Printf("Clear halt and try to send data again. Transfers Completed %d", iTransferComplete);
 				iTransferComplete = 0; //reset
 				// Acknowledge the stall and clear				
 				err = iTestPipeInterface1BulkIn.ClearRemoteStall();
@@ -217,7 +204,7 @@
 				case KBulkTransferInId0:
 				case KBulkTransferInId1:
 					iTransferComplete |= aTransferId;
-					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP03, "Transfer %d completed", aTransferId);
+					RDebug::Printf("Transfer %d completed", aTransferId);
 					break; //switch(aTransferId)
 
 				default:
@@ -250,7 +237,7 @@
 					}
 
 				// Comparison is a match
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP04, "Comparison for IN transfer is a match");
+				RDebug::Printf("Comparison for IN transfer is a match");
 				iCaseStep = EPassed;
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
@@ -272,20 +259,19 @@
 	
 	if(err!=KErrNone)
 		{	
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP05, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		return iControlEp0->SendRequest(request,this);
 		}	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_0500::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 	
 	Cancel();
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL, "this - %08x", this);
+	RDebug::Printf("this - %08x", this);
 	
 	TBuf<256> msg;
 	TInt err = KErrNone;
@@ -301,7 +287,7 @@
 		iInTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,KBulkMaxINTransferSize,*this,KBulkTransferInId1);
 		
 		// Initialise the descriptors for transfer		
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_DUP01, "Initialising the transfer descriptors");
+		RDebug::Printf("Initialising the transfer descriptors");
 		err = iUsbInterface1.InitialiseTransferDescriptors();
 		if(err != KErrNone)
 			{
@@ -310,19 +296,18 @@
 		}
 	if(err != KErrNone)
 		{
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_DUP02, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
 		}
 	else
 		{
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_DUP03, "Asking client for 'Write' and 'Halt'");
+		RDebug::Printf("Asking client for 'Write' and 'Halt'");
 		iCaseStep = ETransferInHalt;	
 		TEndpointPatternSynchronousWriteAndHaltRequest request(1,1,KLiteralFrench4(),KDeviceNumWriteBytesPreHalt);// EP1 means endpoint index 1 not the actual endpoint number
 		iControlEp0->SendRequest(request,this);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_EXIT, this );
 	}
 	
 	} //end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1229.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1229.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,10 +20,6 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-1229Traces.h"
-#endif
 
 
  
@@ -60,12 +56,10 @@
 
 CUT_PBASE_T_USBDI_1229* CUT_PBASE_T_USBDI_1229::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1229_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_1229* self = new (ELeave) CUT_PBASE_T_USBDI_1229(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -74,14 +68,11 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1229_CUT_PBASE_T_USBDI_1229_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_CUT_PBASE_T_USBDI_1229_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_1229::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1229_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
 
 	iInBuffer = HBufC8::NewL(KTestBufferLength);
@@ -101,42 +92,39 @@
 		iOutBufferPtr.Append(KLiteralEnglish5());
 		}
 
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_CONSTRUCTL, "CUT_PBASE_T_USBDI_1229::ConstructL(): buffer created");
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_CONSTRUCTL_EXIT, this );
+	RDebug::Printf("CUT_PBASE_T_USBDI_1229::ConstructL(): buffer created");
 	}
 
 
 CUT_PBASE_T_USBDI_1229::~CUT_PBASE_T_USBDI_1229()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1229_CUT_PBASE_T_USBDI_1229_ENTRY_DUP01, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_CUT_PBASE_T_USBDI_1229_EXIT_DUP01, this );
+	LOG_FUNC
 	}
 	
 void CUT_PBASE_T_USBDI_1229::KillTransfers()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1229_KILLTRANSFERS_ENTRY, this );
+	LOG_FUNC
 	
 	iOutTransfer[0]->Cancel();
 	iOutTransfer[1]->Cancel();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_KILLTRANSFERS_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_1229::ExtractDeviceReadBytes()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_ENTRY, this );
+	LOG_FUNC
 	
 	iControlEp0->LastRequestCompletionTime( iEndTime[KTestTimer]);
 	iTimingError = iTimingError == KErrNone ? CheckTimes(KBaseTimer, KTestTimer, KMaxTimeDiffPercentage) : iTimingError;
 	ResetTimes(KTestTimer);
 	
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES, "Collect client's return of the number of bytes read on its bulk out endpoint ...");
+	RDebug::Printf("Collect client's return of the number of bytes read on its bulk out endpoint ...");
 	TLex8 lex(iInBufferPtr.Left(KNumberStringLength));
 	TUint32 numBytes = 0;
 	User::LeaveIfError(lex.Val(numBytes, EDecimal));
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_DUP01, "********************NUM*BYTES****************************");
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_DUP02, "         NUM BYTES READ BY CLIENT ==== %d ====           ", numBytes);
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_DUP03, "********************NUM*BYTES****************************");
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_DUP04, "\n");
+	RDebug::Printf("********************NUM*BYTES****************************");
+	RDebug::Printf("         NUM BYTES READ BY CLIENT ==== %d ====           ", numBytes);
+	RDebug::Printf("********************NUM*BYTES****************************");
+	RDebug::Printf("\n");
 
 	if(numBytes != 0)
 		//Do not count this case - it may result from the remote resetting when all bulk transfers have completed
@@ -146,13 +134,11 @@
 		iDeviceMinTimedNumBytesRead = numBytesSinceLast < iDeviceMinTimedNumBytesRead ?  numBytesSinceLast : iDeviceMinTimedNumBytesRead ;
 		iDeviceMaxTimedNumBytesRead = numBytesSinceLast > iDeviceMaxTimedNumBytesRead ?  numBytesSinceLast : iDeviceMaxTimedNumBytesRead ;;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_1229::PostTransferAction()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1229_POSTTRANSFERACTION_ENTRY, this );
 	switch(iTransferResult)
 		{
 		case KErrNone:
@@ -162,22 +148,20 @@
 		case KTransferSuccess:
 			//indicates data validation failure
 			{
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_POSTTRANSFERACTION, "Asking client to post validation recorded on the endpoint on its interface - ready for collection");
+			RDebug::Printf("Asking client to post validation recorded on the endpoint on its interface - ready for collection");
 			iCaseStep = ERequestPrepareEndpointValidationResult;
 			TRecordedValidationResultRequest request(1,1);
 			iControlEp0->SendRequest(request,this);
 			}
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_POSTTRANSFERACTION_EXIT, this );
 			return;
 		
 		default:
 			{
 			iCaseStep = EFailed;
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_POSTTRANSFERACTION_DUP01, iMsg);
+			RDebug::Print(iMsg);
 			TTestCaseFailed request(iTransferResult,iMsg);
 			iControlEp0->SendRequest(request,this);
 			}
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_POSTTRANSFERACTION_EXIT_DUP01, this );
 			return;
 		}
 	}
@@ -185,12 +169,11 @@
 
 TBool CUT_PBASE_T_USBDI_1229::PerformNextTransfer(TInt aTransferId)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1229_PERFORMNEXTTRANSFER_ENTRY, this );
+	LOG_FUNC
 	
 	if(iNumWriteBytesRequested >= KTotalBytesToTransfer)
 		{
-		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_PERFORMNEXTTRANSFER, "All transfers sent - num bytes actually written = %u, num bytes required to be written = %u", iNumWriteBytesRequested, KTotalBytesToTransfer);
-		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_1229_PERFORMNEXTTRANSFER_EXIT, this, EFalse );
+		RDebug::Printf("All transfers sent - num bytes actually written = %d, num bytes required to be written = %d", iNumWriteBytesRequested, KTotalBytesToTransfer);
 		return EFalse; //Not writing any more - signal to user that no more transfers are required
 		}
 	TUint bytesToWrite = KTotalBytesToTransfer - iNumWriteBytesRequested;
@@ -202,35 +185,32 @@
 	bulkTransfer.TransferOut(iOutBufferPtr.Mid(iNumWriteBytesRequested%(KLiteralEnglish5().Length()), numWriteBytes), EFalse);
 	iNumWriteBytesRequested += numWriteBytes;
 
-	OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_1229_PERFORMNEXTTRANSFER_EXIT_DUP01, this, ETrue );
 	return ETrue;
 	}
 
 	
 void CUT_PBASE_T_USBDI_1229::RequestNumBytesSent(TUint8 aTimerIndex)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1229_REQUESTNUMBYTESSENT_ENTRY, this );
 	iInBufferPtr.Set(iInBuffer->Des());
 	iInBufferPtr.Zero(); //reset
 	iInBufferPtr.SetLength(KNumberStringLength);
 	TInterfaceGetRecordedNumBytesReadInPayload request(1,1,iInBufferPtr);
 	iControlEp0->SendRequest(request,this);
 	iControlEp0->LastRequestStartTime( iStartTime[aTimerIndex]);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_REQUESTNUMBYTESSENT_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_1229::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d, test step = %d", aCompletionCode, iCaseStep);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d, test step = %d", aCompletionCode, iCaseStep);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
+			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
@@ -238,11 +218,10 @@
 			KillTransfers();
 			_LIT(lit, "<Error %d> Transfer to control endpoint 0 was not successful");
 			msg.Format(lit,aCompletionCode);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP02, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -262,7 +241,7 @@
 		case EGetTimerBase:
 			{
 			iControlEp0->LastRequestCompletionTime( iEndTime[KBaseTimer]);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP03, "Asking client for continuous 'Read' and 'Validate'");
+			RDebug::Printf("Asking client for continuous 'Read' and 'Validate'");
 			iCaseStep = ERequestRepeatedReadAndValidate;
 			TRepeatedReadAndValidateDataRequest request(1,1,KLiteralEnglish5(),KDeviceNumReadBytes,KTotalBytesToTransfer);// EP2 means endpoint index 2 not the actual endpoint number, here the ep with 32 byte max packet size
 			iControlEp0->SendRequest(request,this);
@@ -271,7 +250,7 @@
 			
 		case ERequestRepeatedReadAndValidate:
 			{
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP04, "Try to perform ALL transfers");
+			RDebug::Printf("Try to perform ALL transfers");
 	
 			iCaseStep = ETransfer;	
 			
@@ -299,7 +278,7 @@
 			
 		case ERequestPrepareEndpointValidationResult:
 			{
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP05, "Asking client to prepare the result of its continuous validation");
+			RDebug::Printf("Asking client to prepare the result of its continuous validation");
 			iCaseStep = ERequestValidationResult;
 			iInBufferPtr.Set(iInBuffer->Des());
 			iInBufferPtr.Zero(); //reset
@@ -310,14 +289,14 @@
 			break;
 	
 		case ERequestValidationResult:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP06, "Collect client's return validation  result in a pass or fail string ...");
-            OstTraceData(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP56, "", iInBuffer->Ptr(), iInBuffer->Length());
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP07, "\n");
+			RDebug::Printf("Collect client's return validation  result in a pass or fail string ...");
+			RDebug::RawPrint(*iInBuffer);
+			RDebug::Printf("\n");
 			iInBufferPtr.Set(iInBuffer->Des());
 			if(iInBufferPtr.Compare(KClientPassString) == 0)
 				{
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP08, "Client Validation Result is a PASS");
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP09, "This is the FINAL check - the whole test has a PASSED");
+				RDebug::Printf("Client Validation Result is a PASS");
+				RDebug::Printf("This is the FINAL check - the whole test has a PASSED");
 				iCaseStep = EPassed;
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
@@ -327,7 +306,7 @@
 				TBuf<256> msg;
 				_LIT(lit, "<Error> Bulk data VALIDATION check was NOT successful");
 				msg.Format(lit);
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP10, msg);
+				RDebug::Print(msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(KErrCorrupt,msg);
 				iControlEp0->SendRequest(request,this);
@@ -335,20 +314,19 @@
 			break;
 	
 		default:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP11, "<Error> Unknown test step");
+			RDebug::Printf("<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_1229::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
 	
 	iTransferResult = KErrNone;
-	OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
+	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
 
 
 	switch(iCaseStep)
@@ -370,12 +348,12 @@
 				iMsg.Format(lit, iTransferResult, KBulkTransferOutId[0], KBulkTransferOutId[1], aTransferId);
 				break;
 				}
-			OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP01, "Transfer OUT %d completed - num bytes sent = %d", aTransferId, iNumWriteBytesRequested);
+			RDebug::Printf("Transfer OUT %d completed - num bytes sent = %d", aTransferId, iNumWriteBytesRequested);
 			
 			if(PerformNextTransfer(aTransferId)==EFalse)
 				{
 				iTransferComplete |= aTransferId;
-				OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP02, "All transfer OUT %ds completed (Transfer Completion Aggregation Mask 0x%x)", aTransferId, iTransferComplete);
+				RDebug::Printf("All transfer OUT %ds completed (Transfer Completion Aggregation Mask 0x%x)", aTransferId, iTransferComplete);
 				}
 			
 			if(iTransferResult==KErrNone && (iTransferComplete & KBulkTransferIdMask) == KBulkTransferIdMask)
@@ -383,7 +361,7 @@
 				/*
 				Transfers all complete - now ask device to validate first interface's transfer OUT
 				*/
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP03, "All Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
+				RDebug::Printf("All Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
 				if(iTransferResult==KErrNone)
 					{
 					iBulkTestTimer->Cancel(); //Cancel Timer 
@@ -396,9 +374,9 @@
 						}
 					if(KMaxBytesReadDiffPercentage*iDeviceMaxTimedNumBytesRead > KPercent*iDeviceMinTimedNumBytesRead)
 						{
-						OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP04, "Device APPARENTLY reading rate erratic:-");
-						OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP05, "Min Timed Number of Bytes = %d", iDeviceMinTimedNumBytesRead);
-						OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP06, "Max Timed Number of Bytes = %d", iDeviceMaxTimedNumBytesRead);
+						RDebug::Printf("Device APPARENTLY reading rate erratic:-");
+						RDebug::Printf("Min Timed Number of Bytes = %d", iDeviceMinTimedNumBytesRead);
+						RDebug::Printf("Max Timed Number of Bytes = %d", iDeviceMaxTimedNumBytesRead);
 						iTransferResult = KErrTooBig;
 						iDeviceMaxTimedNumBytesRead = 0;
 						iDeviceMinTimedNumBytesRead = KMaxTUint;
@@ -446,15 +424,14 @@
 			iCaseStep = EDelayedTransferComplete; //so that we move forward when the EP0 transfer has completed
 			}
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_1229::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1229_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 	
 	Cancel();
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_DEVICEINSERTEDL, "this - %08x", this);
+	RDebug::Printf("this - %08x", this);
 	
 	TBuf<256> msg;
 	TInt err = KErrNone;
@@ -481,7 +458,7 @@
 			iOutTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkOut,iUsbInterface1,KBulkMaxTransferSize,*this,KBulkTransferOutId[1]);
 			
 			// Initialise the descriptors for transfer		
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_DEVICEINSERTEDL_DUP01, "Initialising the transfer descriptors - interface 1");
+			RDebug::Printf("Initialising the transfer descriptors - interface 1");
 			err = iUsbInterface1.InitialiseTransferDescriptors();
 			if(err != KErrNone)
 				{
@@ -492,7 +469,7 @@
 		}
 	if(err != KErrNone)
 		{
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1229_DEVICEINSERTEDL_DUP02, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
@@ -505,17 +482,14 @@
 		iDeviceNumBytesReadInTotal = 0;
 		RequestNumBytesSent(KBaseTimer);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_DEVICEINSERTEDL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_1229::HandleBulkTestTimerFired()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1229_HANDLEBULKTESTTIMERFIRED_ENTRY, this );
 	if(iCaseStep == ETransfer)
 		{
 		RequestNumBytesSent(KTestTimer);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1229_HANDLEBULKTESTTIMERFIRED_EXIT, this );
 	}
 	
 	} //end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1230.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1230.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,10 +20,6 @@
 #include "testpolicy.h"
 #include "modelleddevices.h"
 #include "testliterals.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-1230Traces.h"
-#endif
 
 
  
@@ -62,12 +58,10 @@
 
 CUT_PBASE_T_USBDI_1230* CUT_PBASE_T_USBDI_1230::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1230_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_1230* self = new (ELeave) CUT_PBASE_T_USBDI_1230(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -76,14 +70,11 @@
 :	CBaseBulkTestCase(KTestCaseId,aHostRole),
 	iCaseStep(EInProgress)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1230_CUT_PBASE_T_USBDI_1230_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_CUT_PBASE_T_USBDI_1230_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_1230::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1230_CONSTRUCTL_ENTRY, this );
 	BaseBulkConstructL();
 
 	iInBuffer = HBufC8::NewL(KTestBufferLength);
@@ -101,42 +92,39 @@
 		iValidateBufferPtr.Append(KLiteralEnglish5());
 		}
 	
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_CONSTRUCTL, "CUT_PBASE_T_USBDI_1230::ConstructL(): buffer created");
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_CONSTRUCTL_EXIT, this );
+	RDebug::Printf("CUT_PBASE_T_USBDI_1230::ConstructL(): buffer created");
 	}
 
 
 CUT_PBASE_T_USBDI_1230::~CUT_PBASE_T_USBDI_1230()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1230_CUT_PBASE_T_USBDI_1230_ENTRY_DUP01, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_CUT_PBASE_T_USBDI_1230_EXIT_DUP01, this );
+	LOG_FUNC
 	}
 	
 void CUT_PBASE_T_USBDI_1230::KillTransfers()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1230_KILLTRANSFERS_ENTRY, this );
+	LOG_FUNC
 	
 	iInTransfer[0]->Cancel();
 	iInTransfer[1]->Cancel();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_KILLTRANSFERS_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_1230::ExtractDeviceReadBytes()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_ENTRY, this );
+	LOG_FUNC
 	
 	iControlEp0->LastRequestCompletionTime( iEndTime[KTestTimer]);
 	iTimingError = iTimingError == KErrNone ? CheckTimes(KBaseTimer, KTestTimer, KMaxTimeDiffPercentage) : iTimingError;
 	ResetTimes(KTestTimer);
 	
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES, "Collect client's return of the number of bytes written on its bulk in endpoint ...");
+	RDebug::Printf("Collect client's return of the number of bytes written on its bulk in endpoint ...");
 	TLex8 lex(iInBufferPtr.Left(KNumberStringLength));
 	TUint32 numBytes = 0;
 	User::LeaveIfError(lex.Val(numBytes, EDecimal));
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_DUP01, "********************NUM*BYTES****************************");
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_DUP02, "         NUM BYTES READ BY CLIENT ==== %d ====           ", numBytes);
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_DUP03, "********************NUM*BYTES****************************");
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_DUP04, "\n");
+	RDebug::Printf("********************NUM*BYTES****************************");
+	RDebug::Printf("         NUM BYTES READ BY CLIENT ==== %d ====           ", numBytes);
+	RDebug::Printf("********************NUM*BYTES****************************");
+	RDebug::Printf("\n");
 
 	if(numBytes != 0)
 		//Do not count this case - it may result from the remote resetting when all bulk transfers have completed
@@ -146,13 +134,11 @@
 		iDeviceMinTimedNumBytesRead = numBytesSinceLast < iDeviceMinTimedNumBytesRead ?  numBytesSinceLast : iDeviceMinTimedNumBytesRead ;
 		iDeviceMaxTimedNumBytesRead = numBytesSinceLast > iDeviceMaxTimedNumBytesRead ?  numBytesSinceLast : iDeviceMaxTimedNumBytesRead ;;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_1230::PostTransferAction()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1230_POSTTRANSFERACTION_ENTRY, this );
 	switch(iTransferResult)
 		{
 		case KErrNone:
@@ -162,24 +148,22 @@
 		case KTransferSuccess:
 			{
 			// Indicates success - comparison is a match
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_POSTTRANSFERACTION, "Comparison for IN transfer is a match");
+			RDebug::Printf("Comparison for IN transfer is a match");
 			iCaseStep = EPassed;
 			TTestCasePassed request;
 			iTransferComplete = 0; //reset
 			iControlEp0->SendRequest(request,this);
 			}
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_POSTTRANSFERACTION_EXIT, this );
 			return; 
 			
 			
 		default:
 			{
 			iCaseStep = EFailed;
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_POSTTRANSFERACTION_DUP01, iMsg);
+			RDebug::Print(iMsg);
 			TTestCaseFailed request(iTransferResult,iMsg);
 			iControlEp0->SendRequest(request,this);
 			}
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_POSTTRANSFERACTION_EXIT_DUP01, this );
 			return;
 		}
 	}
@@ -187,7 +171,7 @@
 
 TInt CUT_PBASE_T_USBDI_1230::ValidatePreviousAndPerformNextTransfers(TInt aTransferId)
 		{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_ENTRY, this );
+	LOG_FUNC
 	
 	TUint8 index = 0;
 	switch(aTransferId)
@@ -203,12 +187,11 @@
 		default:
 			_LIT(lit, "TRANSFER ID OUT OF RANGE");
 			User::Panic(lit, KErrArgument);
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_EXIT, this );
 			return 0; //should never get here
 		}
 
-	OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS, "\n");
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP01, "Transfer[%d]", index);
+	RDebug::Printf("\n");
+	RDebug::Printf("Transfer[%d]", index);
 	
 	
 	if(iNumBytesExpected[index] != 0)
@@ -216,7 +199,7 @@
 		TPtrC8 data1(iInTransfer[index]->DataPolled());
 		if(ValidateData(data1, iValidateBufferPtr.Mid(iValidationStringStartPointTransfer[index], iNumBytesExpected[index])) == EFalse)
 			{
-			OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP02, "=====VALIDATION FAILURE: Point of Validation String Entry %u, Newly Read Bytes %u=====",iValidationStringStartPointTransfer[index], iNumBytesExpected[index]);
+			RDebug::Printf("=====VALIDATION FAILURE: Point of Validation String Entry %d, Newly Read Bytes %d=====",iValidationStringStartPointTransfer[index], iNumBytesExpected[index]);
 			iIsValid = EFalse;
 			}
 		iNumBytesExpected[index] = 0; //reset
@@ -224,8 +207,7 @@
 	if(iNumBytesRequestedSoFar >= KTotalBytesToTransfer)
 		//if we are near the end end the other transfer will mop up remaining bytes...
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP03, "****ALL DONE for Transfer[%d]****", index);
-		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_EXIT_DUP01, this, (TUint)KBulkTransferInId[index] );
+		RDebug::Printf("****ALL DONE for Transfer[%d]****", index);
 		return KBulkTransferInId[index];
 		}
 	iValidationStringStartPointTransfer[index] = iNumBytesRequestedSoFar%(KLiteralEnglish5().Length()); //PRIOR TO THIS TRANSFER
@@ -235,35 +217,32 @@
 	iInTransfer[index]->TransferIn(KHostNumReadBytes); //rely on ZLP to complete the last 'TransferIn'
 	iExpectedNextTransferNumber = 1 - iExpectedNextTransferNumber;
 
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_EXIT_DUP02, this );
 	return 0;
 	}
 
 	
 void CUT_PBASE_T_USBDI_1230::RequestNumBytesSent(TUint8 aTimerIndex)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1230_REQUESTNUMBYTESSENT_ENTRY, this );
 	iInBufferPtr.Set(iInBuffer->Des());
 	iInBufferPtr.Zero(); //reset
 	iInBufferPtr.SetLength(KNumberStringLength);
 	TInterfaceGetRecordedNumBytesReadInPayload request(1,1,iInBufferPtr);
 	iControlEp0->SendRequest(request,this);
  	iControlEp0->LastRequestStartTime( iStartTime[aTimerIndex]);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_REQUESTNUMBYTESSENT_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_1230::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d, test step = %d", aCompletionCode, iCaseStep);
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d, test step = %d", aCompletionCode, iCaseStep);
 	
 	if(aCompletionCode != KErrNone)
 		{
 		if(iCaseStep == EFailed)
 			{// ignore error, nad catch the TestFailed method called further down.
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
+			RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
 			}
 		else
 			{
@@ -271,11 +250,10 @@
 			KillTransfers();
 			_LIT(lit, "<Error %d> Transfer to control endpoint 0 was not successful");
 			msg.Format(lit,aCompletionCode);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP02, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(aCompletionCode,msg);
 			iControlEp0->SendRequest(request,this);
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_EXIT, this );
 			return;
 			}
 		}
@@ -295,7 +273,7 @@
 		case EGetTimerBase:
 			{
 			iControlEp0->LastRequestCompletionTime( iEndTime[KBaseTimer]);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP03, "Asking client for repeated 'Write'");
+			RDebug::Printf("Asking client for repeated 'Write'");
 			iCaseStep = ERequestRepeatedWrite;	
 			TRepeatedWriteDataRequest request(1,1,KLiteralEnglish5(),KDeviceNumWriteBytes,KTotalBytesToTransfer);// EP2 means endpoint index 2 not the actual endpoint number, here the ep with 32 byte max packet size
 			iControlEp0->SendRequest(request,this);
@@ -304,14 +282,14 @@
 			
 		case ERequestRepeatedWrite:
 			{
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP04, "Try to perform ALL transfers");
+			RDebug::Printf("Try to perform ALL transfers");
 			
 			iCaseStep = ETransfer;	
 			iIsValid = ETrue; //innocent until proved guilty
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP05, "\n");
+			RDebug::Printf("\n");
 			ValidatePreviousAndPerformNextTransfers(KBulkTransferInId[0]); //should not validate - just perform necessary transfers
 			ValidatePreviousAndPerformNextTransfers(KBulkTransferInId[1]); //should not validate - just perform necessary transfers
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP06, "\n");
+			RDebug::Printf("\n");
 			_LITDBG("Bulk test timer NOT instanciated");
 			__ASSERT_DEBUG(iBulkTestTimer, User::Panic(lit, KErrGeneral));
 			iBulkTestTimer->After(KRepeatedTimerInterval);
@@ -337,20 +315,19 @@
 			break;
 			
 		default:
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP07, "<Error> Unknown test step");
+			RDebug::Printf("<Error> Unknown test step");
 			TestFailed(KErrUnknown);
 			break;
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 	}
 	
 void CUT_PBASE_T_USBDI_1230::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
 	
 	iTransferResult = KErrNone;
-	OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
+	RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
 
 
 	switch(iCaseStep)
@@ -373,18 +350,18 @@
 				break;
 				}
 		
-			OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP01, "Transfer IN %d completed - num bytes requested = %u", aTransferId, iNumBytesRequestedSoFar);
+			RDebug::Printf("Transfer IN %d completed - num bytes requested = %d", aTransferId, iNumBytesRequestedSoFar);
 	
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP02, "\n");
+			RDebug::Printf("\n");
 			iTransferComplete |= ValidatePreviousAndPerformNextTransfers(aTransferId);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP03, "\n");
+			RDebug::Printf("\n");
 			
 			if(iTransferResult==KErrNone && (iTransferComplete & KBulkTransferIdMask) == KBulkTransferIdMask)
 				{
 				/*
 				Transfers all complete - now check validation
 				*/
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP04, "All Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
+				RDebug::Printf("All Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
 				iBulkTestTimer->Cancel(); //Cancel Timer 
 				iTransferResult = KTransferSuccess;
 				if(!iIsValid)
@@ -402,9 +379,9 @@
 				
 				if(KMaxBytesWrittenDiffPercentage*iDeviceMaxTimedNumBytesRead > KPercent*iDeviceMinTimedNumBytesRead)
 					{
-					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP05, "Device APPARENTLY reading rate erratic:-");
-					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP06, "Min Timed Number of Bytes = %d", iDeviceMinTimedNumBytesRead);
-					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP07, "Max Timed Number of Bytes = %d", iDeviceMaxTimedNumBytesRead);
+					RDebug::Printf("Device APPARENTLY reading rate erratic:-");
+					RDebug::Printf("Min Timed Number of Bytes = %d", iDeviceMinTimedNumBytesRead);
+					RDebug::Printf("Max Timed Number of Bytes = %d", iDeviceMaxTimedNumBytesRead);
 					iTransferResult = KErrTooBig;
 					iDeviceMaxTimedNumBytesRead = 0;
 					iDeviceMinTimedNumBytesRead = KMaxTUint;
@@ -451,15 +428,14 @@
 			iCaseStep = EDelayedTransferComplete; //so that we move forward when the EP0 transfer has completed
 			}
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_1230::DeviceInsertedL(TUint aDeviceHandle)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1230_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 	
 	Cancel();
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_DEVICEINSERTEDL, "this - %08x", this);
+	RDebug::Printf("this - %08x", this);
 	
 	TBuf<256> msg;
 	TInt err = KErrNone;
@@ -486,7 +462,7 @@
 			iInTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,KBulkMaxTransferSize,*this,KBulkTransferInId[1]);
 			
 			// Initialise the descriptors for transfer		
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_DEVICEINSERTEDL_DUP01, "Initialising the transfer descriptors - interface 1");
+			RDebug::Printf("Initialising the transfer descriptors - interface 1");
 			err = iUsbInterface1.InitialiseTransferDescriptors();
 			if(err != KErrNone)
 				{
@@ -497,7 +473,7 @@
 		}
 	if(err != KErrNone)
 		{
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1230_DEVICEINSERTEDL_DUP02, msg);
+		RDebug::Print(msg);
 		iCaseStep = EFailed;
 		TTestCaseFailed request(err,msg);
 		iControlEp0->SendRequest(request,this);
@@ -510,17 +486,14 @@
 		iDeviceNumBytesReadInTotal = 0;
 		RequestNumBytesSent(KBaseTimer);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_DEVICEINSERTEDL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_1230::HandleBulkTestTimerFired()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1230_HANDLEBULKTESTTIMERFIRED_ENTRY, this );
 	if(iCaseStep == ETransfer)
 		{
 		RequestNumBytesSent(KTestTimer);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1230_HANDLEBULKTESTTIMERFIRED_EXIT, this );
 	}
 	
 	} //end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1231.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1231.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -21,10 +21,6 @@
 #include "testdebug.h"
 #include "modelleddevices.h"
 #include "TestPolicy.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-1231Traces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -36,40 +32,34 @@
 
 	CUT_PBASE_T_USBDI_1231* CUT_PBASE_T_USBDI_1231::NewL(TBool aHostRole)
 		{
-		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_NEWL_ENTRY, aHostRole );
 		CUT_PBASE_T_USBDI_1231* self = new (ELeave) CUT_PBASE_T_USBDI_1231(aHostRole);
 		CleanupStack::PushL(self);
 		self->ConstructL();
 		CleanupStack::Pop(self);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_NEWL_EXIT, ( TUint )( self ) );
 		return self;
 		}
 
 	CUT_PBASE_T_USBDI_1231::CUT_PBASE_T_USBDI_1231(TBool aHostRole) :
 		CBaseTestCase(KTestCaseId, aHostRole), iInterface0Resumed(EFalse)
 		{
-		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1231_CUT_PBASE_T_USBDI_1231_ENTRY, this );
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_CUT_PBASE_T_USBDI_1231_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::ConstructL()
 		{
-		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_CONSTRUCTL_ENTRY, this );
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_CUT_PBASE_T_USBDI_1231, "====> Constructor entry priority = %d", RThread().Priority());
+		RDebug::Printf("====> Constructor entry priority = %d", RThread().Priority());
 
 		// Collect existing thread priority (to reinstate later)
 		iPriority = RThread().Priority();
 
 		iTestDevice = new RUsbDeviceA(this);
 		BaseConstructL();
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_CONSTRUCTL_EXIT, this );
 		}
 
 	CUT_PBASE_T_USBDI_1231::~CUT_PBASE_T_USBDI_1231()
 		{
-        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_CUT_PBASE_T_USBDI_1231_ENTRY_DUP01, this );
+		LOG_FUNC
 
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231, "====> Destructor entry priority = %d", RThread().Priority());
+		RDebug::Printf("====> Destructor entry priority = %d", RThread().Priority());
 
 		// Reinstate original priority
 
@@ -95,20 +85,19 @@
 			iTestDevice->Close();
 			}
 		delete iTestDevice;
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_CUT_PBASE_T_USBDI_1231_EXIT_DUP01, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::ExecuteHostTestCaseL()
 		{
-        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_EXECUTEHOSTTESTCASEL_ENTRY, this );
+		LOG_FUNC
 
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP01, "====> ExecuteHostTestCaseL entry priority = %d",
+		RDebug::Printf("====> ExecuteHostTestCaseL entry priority = %d",
 				RThread().Priority());
 
 		// Bump thread priority for this test only
 
 		RThread().SetPriority(EPriorityAbsoluteHigh);
-		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP02, "Thread priority raised %d->%d", iPriority, RThread().Priority());
+		RDebug::Printf("Thread priority raised %d->%d", iPriority, RThread().Priority());
 
 		iCaseStep = EInProcess;
 		iActorFDF = CActorFDF::NewL(*this);
@@ -121,12 +110,11 @@
 
 		// Start the connection timeout	
 		TimeoutIn(30);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_EXECUTEHOSTTESTCASEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::ExecuteDeviceTestCaseL()
 		{
-        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_EXECUTEDEVICETESTCASEL_ENTRY, this );
+		LOG_FUNC
 
 		// Construct the device for the test case
 		iTestDevice->OpenL(TestCaseId());
@@ -135,34 +123,31 @@
 
 		// Connect the test device	
 		iTestDevice->SoftwareConnect();
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_EXECUTEDEVICETESTCASEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::HostDoCancel()
 		{
-        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_HOSTDOCANCEL_ENTRY, this );
+		LOG_FUNC
 
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP03, "====> HostDoCancel entry priority = %d", RThread().Priority());
+		RDebug::Printf("====> HostDoCancel entry priority = %d", RThread().Priority());
 
 		// Cancel the timeout timer
 		CancelTimeout();
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_HOSTDOCANCEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::DeviceDoCancel()
 		{
-        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_DEVICEDOCANCEL_ENTRY, this );
+		LOG_FUNC
 
 		// Cancel the device	
 		iTestDevice->CancelSubscriptionToReports();
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_DEVICEDOCANCEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::DeviceInsertedL(TUint aDeviceHandle)
 		{
-        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1231_DEVICEINSERTEDL_ENTRY, this );
+		LOG_FUNC
 
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP04, "====> DeviceInsertedL entry priority = %d", RThread().Priority());
+		RDebug::Printf("====> DeviceInsertedL entry priority = %d", RThread().Priority());
 		
 		iInterface0Resumed = EFalse;
 		
@@ -183,7 +168,6 @@
 
 			// Start the connection timeout again
 			TimeoutIn(30);
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_DEVICEINSERTEDL_EXIT, this );
 			return;
 			}
 		// Check tree now	
@@ -197,7 +181,7 @@
 				TUint32 token1(0);
 				TUint32 token2(0);
 
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP05, "Obtaining token for interface 0");
+				RDebug::Printf("Obtaining token for interface 0");
 				err = testDevice.Device().GetTokenForInterface(0, token1);
 				if (err != KErrNone)
 					{
@@ -206,8 +190,8 @@
 							err);
 					return TestFailed(err);
 					}
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP06, "Token 1 (%d) retrieved", token1);
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP07, "Opening interface 0");
+				RDebug::Printf("Token 1 (%d) retrieved", token1);
+				RDebug::Printf("Opening interface 0");
 				err = iUsbInterface0.Open(token1); // Alternate interface setting 0
 				if (err != KErrNone)
 					{
@@ -215,9 +199,9 @@
 							"<Error %d> Interface 0 could not be opened", err);
 					return TestFailed(err);
 					}
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP08, "Interface 0 opened");
+				RDebug::Printf("Interface 0 opened");
 
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP09, "Obtaining token for interface 1");
+				RDebug::Printf("Obtaining token for interface 1");
 				err = testDevice.Device().GetTokenForInterface(1, token2);
 				if (err != KErrNone)
 					{
@@ -226,7 +210,7 @@
 							err);
 					return TestFailed(err);
 					}
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP10, "Opening interface 1");
+				RDebug::Printf("Opening interface 1");
 				err = iUsbInterface1.Open(token2); // Alternate interface setting 0
 				if (err != KErrNone)
 					{
@@ -234,7 +218,7 @@
 							"<Error %d> Interface 1 could not be opened", err);
 					return TestFailed(err);
 					}
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP11, "Interface 1 opened");
+				RDebug::Printf("Interface 1 opened");
 
 				ResumeWhenSuspending();
 
@@ -245,23 +229,22 @@
 				TestFailed(KErrCorrupt);
 				break;
 			}
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_DEVICEINSERTEDL_EXIT_DUP01, this );
 		}
 
 	TInt CUT_PBASE_T_USBDI_1231::Interface0ResumedL(TAny* aPtr)
 		{
-        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1231_INTERFACE0RESUMEDL_ENTRY, 0 );
+		LOG_CFUNC
 
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP12, "====> Interface0ResumedL entry priority = %d", RThread().Priority());
+		RDebug::Printf("====> Interface0ResumedL entry priority = %d", RThread().Priority());
 
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP13, "-Interface 0 resumed");
+		RDebug::Printf("-Interface 0 resumed");
 		CUT_PBASE_T_USBDI_1231* self =
 				reinterpret_cast<CUT_PBASE_T_USBDI_1231*>(aPtr);
 		
 		TInt completionCode=self->iInterface0Watcher->CompletionCode();
 		
 		TInt testStep = self->iCaseStep;
-		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP14, " -watcher 0 iStatus = %d <teststep %d>",completionCode, testStep);
+		RDebug::Printf(" -watcher 0 iStatus = %d <teststep %d>",completionCode, testStep);
            
 		self->iInterface0Resumed = ETrue;
 		
@@ -272,7 +255,7 @@
 				{
 				if (completionCode == KErrNone)
 				 {
-				 OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP15, "Device resume while suspending succeed!");
+				 RDebug::Printf("Device resume while suspending succeed!");
 				 self->TimeoutIn(10);
 				 self->iCaseStep = EPassed;
 				 self->SendEp0Request();
@@ -292,55 +275,51 @@
 				break;
 			};
 
-		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_1231_INTERFACE0RESUMEDL_EXIT, 0, KErrNone );
 		return KErrNone;
 		}
 
 	TInt CUT_PBASE_T_USBDI_1231::Interface1ResumedL(TAny* aPtr)
 		{
-        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1231_INTERFACE1RESUMEDL_ENTRY, 0 );
+		LOG_CFUNC
 
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP16, "====> Interface1ResumedL entry priority = %d", RThread().Priority());
+		RDebug::Printf("====> Interface1ResumedL entry priority = %d", RThread().Priority());
 
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP17, "Interface 1 resumed");
+		RDebug::Printf("Interface 1 resumed");
 		CUT_PBASE_T_USBDI_1231* self =
 				reinterpret_cast<CUT_PBASE_T_USBDI_1231*>(aPtr);
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP18, "watcher 1 iStatus=%d",
+		RDebug::Printf("watcher 1 iStatus=%d",
 				self->iInterface1Watcher->CompletionCode());
-		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_1231_INTERFACE1RESUMEDL_EXIT, 0, KErrNone );
 		return KErrNone;
 		}
 
 	void CUT_PBASE_T_USBDI_1231::DeviceRemovedL(TUint aDeviceHandle)
 		{
-        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1231_DEVICEREMOVEDL_ENTRY, this );
+		LOG_FUNC
 
 		// The test device should not be removed until the test case has passed
 		// so this test case has not completed, and state this event as an error
 
 		TestFailed(KErrDisconnected);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_DEVICEREMOVEDL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::BusErrorL(TInt aError)
 		{
-        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1231_BUSERRORL_ENTRY, this );
+		LOG_FUNC
 
 		// This test case handles no failiures on the bus
 
 		TestFailed(aError);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_BUSERRORL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::DeviceStateChangeL(
 			RUsbDevice::TDeviceState aPreviousState,
 			RUsbDevice::TDeviceState aNewState, TInt aCompletionCode)
 		{
-		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1231_DEVICESTATECHANGEL_ENTRY, this );
+		LOG_FUNC
 		Cancel();
 
 		// test RInterface , the  RUsbDevice notification logic not used . 
-		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP19, " -Device State change from %d to %d err=%d",
+		RDebug::Printf(" -Device State change from %d to %d err=%d",
 				aPreviousState, aNewState, aCompletionCode);
 
 		switch (iCaseStep)
@@ -348,12 +327,12 @@
 			case EValidDeviceSuspend:
 				if (aNewState == RUsbDevice::EDeviceSuspended)
 					{
-					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP20, "Device suspend!");
+					RDebug::Printf("Device suspend!");
 					iCaseStep = EValidDeviceResume;
 					}
 				else
 					{
-					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP21, "Device suspend failed!");
+					RDebug::Printf("Device suspend failed!");
 					iCaseStep = EFailed;
 					SendEp0Request();
 					}
@@ -362,7 +341,7 @@
 
 				if (aNewState == RUsbDevice::EDeviceActive)
 					{
-					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP22, "Device resume!");
+					RDebug::Printf("Device resume!");
 					if (!iInterface0Resumed)
                         {
                         iCaseStep = EValidResumeWhenSuspending;
@@ -384,13 +363,12 @@
 				break;
 			}
 
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_DEVICESTATECHANGEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::Ep0TransferCompleteL(TInt aCompletionCode)
 		{
-		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1231_EP0TRANSFERCOMPLETEL_ENTRY, this );
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP23, "Ep0TransferCompleteL with aCompletionCode = %d",
+		LOG_FUNC
+		RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",
 				aCompletionCode);
 		switch (iCaseStep)
 			{
@@ -404,14 +382,13 @@
 				TestPassed();
 				break;
 			}
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_EP0TRANSFERCOMPLETEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::HostRunL()
 		{
-        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_HOSTRUNL_ENTRY, this );
+		LOG_FUNC
 
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP24, "====> HostRunL entry priority = %d", RThread().Priority());
+		RDebug::Printf("====> HostRunL entry priority = %d", RThread().Priority());
 
 		// Obtain the completion code
 		TInt completionCode(iStatus.Int());
@@ -419,21 +396,20 @@
 		if (completionCode == KErrNone)
 			{
 			// Action timeout
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP25, "<Error> Action timeout");
+			RDebug::Printf("<Error> Action timeout");
 			TestFailed(KErrTimedOut);
 			}
 		else
 			{
-			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP26, "<Error %d> Timeout timer could not complete",
+			RDebug::Printf("<Error %d> Timeout timer could not complete",
 					completionCode);
 			TestFailed(completionCode);
 			}
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_HOSTRUNL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::DeviceRunL()
 		{
-        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_DEVICERUNL_ENTRY, this );
+		LOG_FUNC
 
 		// Disconnect the device
 
@@ -442,38 +418,33 @@
 		// Complete the test case request
 
 		TestPolicy().SignalTestComplete(iStatus.Int());
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_DEVICERUNL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::ResumeWhenSuspending()
 		{
-		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_RESUMEWHENSUSPENDING_ENTRY, this );
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP27, "====> ResumeWhenSuspending entry priority = %d",
+		RDebug::Printf("====> ResumeWhenSuspending entry priority = %d",
 				RThread().Priority());
 
 		// Suspend interface 0
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP28, "Suspending interface 0");
+		RDebug::Printf("Suspending interface 0");
 		iInterface0Watcher->SuspendAndWatch();
 
 		// Suspend interface 1
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP29, "Suspending interface 1");
+		RDebug::Printf("Suspending interface 1");
 		iInterface1Watcher->SuspendAndWatch();
 
 		// Cancel suspend-in-progress
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP30, "Cancel Suspend interface 0");
+		RDebug::Printf("Cancel Suspend interface 0");
 		iUsbInterface0.CancelPermitSuspend();
 
 		iCaseStep = EValidDeviceSuspend;
 
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_RESUMEWHENSUSPENDING_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1231::SendEp0Request()
 		{
-		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_SENDEP0REQUEST_ENTRY, this );
 		TTestCasePassed request;
 		iControlEp0->SendRequest(request, this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_SENDEP0REQUEST_EXIT, this );
 		}
 
 	}//end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1232.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1232.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -21,10 +21,6 @@
 #include "testdebug.h"
 #include "modelleddevices.h"
 #include "TestPolicy.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-1232Traces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -50,7 +46,7 @@
 
 	void CUT_PBASE_T_USBDI_1232::ConstructL()
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_CUT_PBASE_T_USBDI_1232, "====> Constructor entry priority = %d", RThread().Priority());
+		RDebug::Printf("====> Constructor entry priority = %d", RThread().Priority());
 
 		// Collect existing thread priority (to reinstate later)
 		iPriority = RThread().Priority();
@@ -61,8 +57,9 @@
 
 	CUT_PBASE_T_USBDI_1232::~CUT_PBASE_T_USBDI_1232()
 		{
+		LOG_FUNC
 
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232, "====> Destructor entry priority = %d", RThread().Priority());
+		RDebug::Printf("====> Destructor entry priority = %d", RThread().Priority());
 
 		// Reinstate original priority
 
@@ -92,14 +89,15 @@
 
 	void CUT_PBASE_T_USBDI_1232::ExecuteHostTestCaseL()
 		{
+		LOG_FUNC
 
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP01, "====> ExecuteHostTestCaseL entry priority = %d",
+		RDebug::Printf("====> ExecuteHostTestCaseL entry priority = %d",
 				RThread().Priority());
 
 		// Bump thread priority for this test only
 
 		RThread().SetPriority(EPriorityAbsoluteHigh);
-		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP02, "Thread priority raised %d->%d", iPriority, RThread().Priority());
+		RDebug::Printf("Thread priority raised %d->%d", iPriority, RThread().Priority());
 
 		iCaseStep = EInProcess;
 		iActorFDF = CActorFDF::NewL(*this);
@@ -116,6 +114,7 @@
 
 	void CUT_PBASE_T_USBDI_1232::ExecuteDeviceTestCaseL()
 		{
+		LOG_FUNC
 
 		// Construct the device for the test case
 		iTestDevice->OpenL(TestCaseId());
@@ -128,8 +127,9 @@
 
 	void CUT_PBASE_T_USBDI_1232::HostDoCancel()
 		{
+		LOG_FUNC
 
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP03, "====> HostDoCancel entry priority = %d", RThread().Priority());
+		RDebug::Printf("====> HostDoCancel entry priority = %d", RThread().Priority());
 
 		// Cancel the timeout timer
 		CancelTimeout();
@@ -137,6 +137,7 @@
 
 	void CUT_PBASE_T_USBDI_1232::DeviceDoCancel()
 		{
+		LOG_FUNC
 
 		// Cancel the device	
 		iTestDevice->CancelSubscriptionToReports();
@@ -144,8 +145,9 @@
 
 	void CUT_PBASE_T_USBDI_1232::DeviceInsertedL(TUint aDeviceHandle)
 		{
+		LOG_FUNC
 
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP04, "====> DeviceInsertedL entry priority = %d", RThread().Priority());
+		RDebug::Printf("====> DeviceInsertedL entry priority = %d", RThread().Priority());
 
 		Cancel(); // Cancel the timer
 		TInt err(KErrNone);
@@ -177,7 +179,7 @@
 				TUint32 token1(0);
 				TUint32 token2(0);
 
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP05, "Obtaining token for interface 0");
+				RDebug::Printf("Obtaining token for interface 0");
 				err = testDevice.Device().GetTokenForInterface(0, token1);
 				if (err != KErrNone)
 					{
@@ -186,8 +188,8 @@
 							err);
 					return TestFailed(err);
 					}
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP06, "Token 1 (%d) retrieved", token1);
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP07, "Opening interface 0");
+				RDebug::Printf("Token 1 (%d) retrieved", token1);
+				RDebug::Printf("Opening interface 0");
 				err = iUsbInterface0.Open(token1); // Alternate interface setting 0
 				if (err != KErrNone)
 					{
@@ -195,9 +197,9 @@
 							"<Error %d> Interface 0 could not be opened", err);
 					return TestFailed(err);
 					}
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP08, "Interface 0 opened");
+				RDebug::Printf("Interface 0 opened");
 
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP09, "Obtaining token for interface 1");
+				RDebug::Printf("Obtaining token for interface 1");
 				err = testDevice.Device().GetTokenForInterface(1, token2);
 				if (err != KErrNone)
 					{
@@ -206,7 +208,7 @@
 							err);
 					return TestFailed(err);
 					}
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP10, "Opening interface 1");
+				RDebug::Printf("Opening interface 1");
 				err = iUsbInterface1.Open(token2); // Alternate interface setting 0
 				if (err != KErrNone)
 					{
@@ -214,15 +216,15 @@
 							"<Error %d> Interface 1 could not be opened", err);
 					return TestFailed(err);
 					}
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP11, "Interface 1 opened");
+				RDebug::Printf("Interface 1 opened");
 
 				// device go to suspend
 				// Suspend interface 0
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP12, "Suspending interface 0");
+				RDebug::Printf("Suspending interface 0");
 				iInterface0Watcher->SuspendAndWatch();
 
 				// Suspend interface 1
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP13, "Suspending interface 1");
+				RDebug::Printf("Suspending interface 1");
 				iInterface1Watcher->SuspendAndWatch();
 
 				iCaseStep = ESuspendWhenResuming;
@@ -243,14 +245,15 @@
 
 	TInt CUT_PBASE_T_USBDI_1232::Interface0ResumedL(TAny* aPtr)
 		{
+		LOG_CFUNC
 
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP14, "====> Interface0ResumedL entry priority = %d", RThread().Priority());
+		RDebug::Printf("====> Interface0ResumedL entry priority = %d", RThread().Priority());
 
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP15, " -Interface 0 resumed");
+		RDebug::Printf(" -Interface 0 resumed");
 		CUT_PBASE_T_USBDI_1232* self =
 				reinterpret_cast<CUT_PBASE_T_USBDI_1232*>(aPtr);
 		TInt completionCode = self->iInterface0Watcher->CompletionCode();
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP16, " -watcher 0 iStatus=%d",completionCode);
+		RDebug::Printf(" -watcher 0 iStatus=%d",completionCode);
 
 		switch (self->iCaseStep)
 			{	
@@ -259,12 +262,12 @@
 				{
 				if (completionCode == KErrNone)
 					{
-					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP17, "Device resume successed,test passed!");
+					RDebug::Printf("Device resume successed,test passed!");
 					self->SendEp0Request(); // stop client site
 					}
 				else
 					{
-					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP18, "Device resume failed, err = %d ",completionCode);
+					RDebug::Printf("Device resume failed, err = %d ",completionCode);
 					self->iCaseStep = EFailed;
 					self->SendEp0Request();
 					}
@@ -283,18 +286,20 @@
 
 	TInt CUT_PBASE_T_USBDI_1232::Interface1ResumedL(TAny* aPtr)
 		{
+		LOG_CFUNC
 
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP19, "====> Interface1ResumedL entry priority = %d", RThread().Priority());
+		RDebug::Printf("====> Interface1ResumedL entry priority = %d", RThread().Priority());
 
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP20, "Interface 1 resumed");
+		RDebug::Printf("Interface 1 resumed");
 		CUT_PBASE_T_USBDI_1232* self =
 				reinterpret_cast<CUT_PBASE_T_USBDI_1232*>(aPtr);
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP21, "watcher 1 iStatus=%d", self->iInterface1Watcher->CompletionCode());
+		RDebug::Printf("watcher 1 iStatus=%d", self->iInterface1Watcher->CompletionCode());
 		return KErrNone;
 		}
 
 	void CUT_PBASE_T_USBDI_1232::DeviceRemovedL(TUint aDeviceHandle)
 		{
+		LOG_FUNC
 
 		// The test device should not be removed until the test case has passed
 		// so this test case has not completed, and state this event as an error
@@ -304,6 +309,7 @@
 
 	void CUT_PBASE_T_USBDI_1232::BusErrorL(TInt aError)
 		{
+		LOG_FUNC
 
 		// This test case handles no failiures on the bus
 
@@ -314,17 +320,18 @@
 			RUsbDevice::TDeviceState aPreviousState,
 			RUsbDevice::TDeviceState aNewState, TInt aCompletionCode)
 		{
+		LOG_FUNC
 		Cancel();
 
 		// test RInterface , the  RUsbDevice notification logic not used . 
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP22, " -Device State change from err=%d",aCompletionCode);
+		RDebug::Printf(" -Device State change from err=%d",aCompletionCode);
 
 		switch (iCaseStep)
 			{
 			case ESuspendWhenResuming:
 				if (aNewState == RUsbDevice::EDeviceSuspended)
 					{
-					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP23, "====> device has suspended!");
+					RDebug::Printf("====> device has suspended!");
                     
 					SuspendWhenResuming();					
 					}
@@ -333,7 +340,7 @@
 				if (aPreviousState == RUsbDevice::EDeviceSuspended&&aNewState
 						== RUsbDevice::EDeviceSuspended)
 					{
-					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP24, "====> device suspended again,suspend while resuming succeed!");
+					RDebug::Printf("====> device suspended again,suspend while resuming succeed!");
 					iCaseStep = EPassed;
 					iUsbInterface0.CancelPermitSuspend();
 					}
@@ -352,7 +359,8 @@
 
 	void CUT_PBASE_T_USBDI_1232::Ep0TransferCompleteL(TInt aCompletionCode)
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP25, "Ep0TransferCompleteL with aCompletionCode = %d",
+		LOG_FUNC
+		RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",
 				aCompletionCode);
 		switch (iCaseStep)
 			{
@@ -370,8 +378,9 @@
 
 	void CUT_PBASE_T_USBDI_1232::HostRunL()
 		{
+		LOG_FUNC
 
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP26, "====> HostRunL entry priority = %d", RThread().Priority());
+		RDebug::Printf("====> HostRunL entry priority = %d", RThread().Priority());
 
 		// Obtain the completion code
 		TInt completionCode(iStatus.Int());
@@ -379,12 +388,12 @@
 		if (completionCode == KErrNone)
 			{
 			// Action timeout
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP27, "<Error> Action timeout");
+			RDebug::Printf("<Error> Action timeout");
 			TestFailed(KErrTimedOut);
 			}
 		else
 			{
-			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP28, "<Error %d> Timeout timer could not complete",
+			RDebug::Printf("<Error %d> Timeout timer could not complete",
 					completionCode);
 			TestFailed(completionCode);
 			}
@@ -392,6 +401,7 @@
 
 	void CUT_PBASE_T_USBDI_1232::DeviceRunL()
 		{
+		LOG_FUNC
 
 		// Disconnect the device
 
@@ -404,21 +414,21 @@
 
 	void CUT_PBASE_T_USBDI_1232::SuspendWhenResuming()
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP29, "====> SuspendWhenResuming entry priority = %d",
+		RDebug::Printf("====> SuspendWhenResuming entry priority = %d",
 				RThread().Priority());
 
 		// Cancel suspend-in-progress
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP30, "Cancel Suspend interface 0");
+		RDebug::Printf("Cancel Suspend interface 0");
 				
 		iUsbInterface0.CancelPermitSuspend();
 		
 		// how to prove, see log? 
 		// Suspend interface 0
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP31, "Suspending interface 0");
+		RDebug::Printf("Suspending interface 0");
 		iInterface0Watcher->SuspendAndWatch();			
 
 		// Suspend interface 1
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1232_DCUT_PBASE_T_USBDI_1232_DUP32, "Suspending interface 1");
+		RDebug::Printf("Suspending interface 1");
 		iInterface1Watcher->SuspendAndWatch();
 
 		iCaseStep = EValidSuspendWhenResuming;
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1234.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1234.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,10 +20,6 @@
 #include "modelleddevices.h"
 #include "testpolicy.h"
 #include "testliterals.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-1234Traces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -57,43 +53,35 @@
 
 	CUT_PBASE_T_USBDI_1234* CUT_PBASE_T_USBDI_1234::NewL(TBool aHostRole)
 		{
-		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1234_NEWL_ENTRY, aHostRole );
 		CUT_PBASE_T_USBDI_1234* self = new (ELeave) CUT_PBASE_T_USBDI_1234(aHostRole);
 		CleanupStack::PushL(self);
 		self->ConstructL();
 		CleanupStack::Pop(self);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_NEWL_EXIT, ( TUint )( self ) );
 		return self;
 		}
 
 	CUT_PBASE_T_USBDI_1234::CUT_PBASE_T_USBDI_1234(TBool aHostRole) :
 		CBaseBulkTestCase(KTestCaseId, aHostRole), iCaseStep(EInProgress)
 		{
-        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1234_CUT_PBASE_T_USBDI_1234_ENTRY, this );
 
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_CUT_PBASE_T_USBDI_1234_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1234::ExecuteHostTestCaseL()
 		{
-		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1234_EXECUTEHOSTTESTCASEL_ENTRY, this );
 		CBaseBulkTestCase::ExecuteHostTestCaseL();
 		iInterface0Watcher = new (ELeave) CInterfaceWatcher(iUsbInterface0,TCallBack(CUT_PBASE_T_USBDI_1234::Interface0ResumedL,this));
 		iInterface1Watcher = new (ELeave) CInterfaceWatcher(iUsbInterface1,TCallBack(CUT_PBASE_T_USBDI_1234::Interface1ResumedL,this));
 		iInterface2Watcher = new (ELeave) CInterfaceWatcher(iUsbInterface1,TCallBack(CUT_PBASE_T_USBDI_1234::Interface2ResumedL,this));
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_EXECUTEHOSTTESTCASEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1234::ConstructL()
 		{
-		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1234_CONSTRUCTL_ENTRY, this );
 		BaseBulkConstructL();
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_CONSTRUCTL_EXIT, this );
 		}
 
 	CUT_PBASE_T_USBDI_1234::~CUT_PBASE_T_USBDI_1234()
 		{
-		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1234_CUT_PBASE_T_USBDI_1234_ENTRY_DUP01, this );
+		LOG_FUNC
 		// Cancel any async operations
 
 		Cancel(); // Cancel host timer
@@ -111,12 +99,11 @@
 			delete iInterface2Watcher;
 			}
 
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_CUT_PBASE_T_USBDI_1234_EXIT_DUP01, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1234::DeviceInsertedL(TUint aDeviceHandle)
 		{
-        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1234_DEVICEINSERTEDL_ENTRY, this );
+		LOG_FUNC
 
 		Cancel();
 
@@ -141,17 +128,16 @@
 				= new (ELeave) CBulkTransfer(iTestPipeInterface1BulkOut,iUsbInterface1,KBulkTransferSize,*this,KBulkTransferOutId2);
 
 		// Initialise the descriptors for transfer		
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234, "Initialising the transfer descriptors");
+		RDebug::Printf("Initialising the transfer descriptors");
 		TInt err = iUsbInterface1.InitialiseTransferDescriptors();
 		if (err != KErrNone)
 			{
 			TBuf<256> msg;
 			msg.Format(_L("<Error %d> Unable to initialise transfer descriptors"),err);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP01, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(err, msg);
 			iControlEp0->SendRequest(request, this);
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_DEVICEINSERTEDL_EXIT, this );
 			return;
 			}
 
@@ -159,19 +145,18 @@
 
 		TrySuspendDeviceByInterfaces();
 
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_DEVICEINSERTEDL_EXIT_DUP01, this );
 		}
 
 	TInt CUT_PBASE_T_USBDI_1234::Interface0ResumedL(TAny* aPtr)
 		{
-		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1234_INTERFACE0RESUMEDL_ENTRY, 0 );
 		
 		// when device is really resumed , the whole of interfaces' previous call  PermitSuspendAndWaitForResume()'s requests of the device will be completed , random chose one .
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP02, "Interface 0 resumed");
+		LOG_CFUNC
+		RDebug::Printf("Interface 0 resumed");
 		CUT_PBASE_T_USBDI_1234* self =
 				reinterpret_cast<CUT_PBASE_T_USBDI_1234*>(aPtr);
 		TInt completionCode = self->iInterface0Watcher->CompletionCode();
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP03, "watcher 0 errCode=%d",completionCode);
+		RDebug::Printf("watcher 0 errCode=%d",completionCode);
 		self->iSuspendedI0 = EFalse;
 
 		switch (self->iCaseStep)
@@ -181,13 +166,13 @@
 				{
 				if (completionCode == KErrNone)
 					{
-					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP04, "device resumed succeed, do bulk transfer!");
+					RDebug::Printf("device resumed succeed, do bulk transfer!");
 					self->iCaseStep = EBulkTransferOutWhenResume;
 					self->SendEpTransferRequest();
 					}
 				else
 					{
-					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP05, "device resumed failed,<err %d> ",completionCode);
+					RDebug::Printf("device resumed failed,<err %d> ",completionCode);
 					self->iCaseStep = EFailed;
 					self->SendEpRequest();
 					}
@@ -199,33 +184,30 @@
 				break;
 			};
 
-		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_1234_INTERFACE0RESUMEDL_EXIT, 0, KErrNone );
 		return KErrNone;
 		}
 
 	TInt CUT_PBASE_T_USBDI_1234::Interface1ResumedL(TAny* aPtr)
 		{
-		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1234_INTERFACE1RESUMEDL_ENTRY, 0 );
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP06, "Interface 1 resumed");
+		LOG_CFUNC
+		RDebug::Printf("Interface 1 resumed");
 		CUT_PBASE_T_USBDI_1234* self =
 				reinterpret_cast<CUT_PBASE_T_USBDI_1234*>(aPtr);
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP07, "watcher 1 iStatus=%d",
+		RDebug::Printf("watcher 1 iStatus=%d",
 				self->iInterface1Watcher->CompletionCode());
 		self->iSuspendedI1 = EFalse;
-		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_1234_INTERFACE1RESUMEDL_EXIT, 0, KErrNone );
 		return KErrNone;
 		}
 
 	TInt CUT_PBASE_T_USBDI_1234::Interface2ResumedL(TAny* aPtr)
 		{
-		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1234_INTERFACE2RESUMEDL_ENTRY, 0 );
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP08, "Interface 2 resumed");
+		LOG_CFUNC
+		RDebug::Printf("Interface 2 resumed");
 		CUT_PBASE_T_USBDI_1234* self =
 				reinterpret_cast<CUT_PBASE_T_USBDI_1234*>(aPtr);
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP09, "watcher 2 iStatus=%d",
+		RDebug::Printf("watcher 2 iStatus=%d",
 				self->iInterface2Watcher->CompletionCode());
 		self->iSuspendedI2 = EFalse;
-		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_1234_INTERFACE2RESUMEDL_EXIT, 0, KErrNone );
 		return KErrNone;
 		}
 
@@ -233,18 +215,17 @@
 			RUsbDevice::TDeviceState aPreviousState,
 			RUsbDevice::TDeviceState aNewState, TInt aCompletionCode)
 		{
-		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1234_DEVICESTATECHANGEL_ENTRY, this );
+		LOG_FUNC
 		Cancel();
 
 		RDebug::Printf(
 				"Device State change from %d to %d err=%d",
 				aPreviousState, aNewState, aCompletionCode);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_DEVICESTATECHANGEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1234::Ep0TransferCompleteL(TInt aCompletionCode)
 		{
-        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1234_EP0TRANSFERCOMPLETEL_ENTRY, this );
+		LOG_FUNC
 
 		RDebug::Printf(
 				"Ep0TransferCompleteL with aCompletionCode = %d",
@@ -254,17 +235,16 @@
 			{
 			if (iCaseStep == EFailed)
 				{// ignore error, and catch the TestFailed method called further down.
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP10, "***Failure sending FAIL message to client on endpoint 0***");
+				RDebug::Printf("***Failure sending FAIL message to client on endpoint 0***");
 				}
 			else
 				{
 				TBuf<256> msg;
 				msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode);
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP11, msg);
+				RDebug::Print(msg);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(aCompletionCode, msg);
 				iControlEp0->SendRequest(request, this);
-				OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_EP0TRANSFERCOMPLETEL_EXIT, this );
 				return;
 				}
 			}
@@ -282,7 +262,7 @@
 				break;
 
 			case EBulkTransferOutWhenResume:
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP12, "Try to send data");
+				RDebug::Printf("Try to send data");
 				iOutTransfer[0]->TransferOut(KLiteralEnglish8().Mid(0, KHostNumWriteBytes1), EFalse);
 				iOutTransfer[1]->TransferOut(KLiteralEnglish8().Mid(KHostNumWriteBytes1, KHostNumWriteBytes2), EFalse);
 				iOutTransfer[2]->TransferOut(KLiteralEnglish8().Mid(KHostNumWriteBytes1+KHostNumWriteBytes2,
@@ -290,29 +270,28 @@
 				break;
 
 			case EValidBulkTransfeOut:
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP13, "Try to receive data");
+				RDebug::Printf("Try to receive data");
 				iInTransfer[0]->TransferIn(KHostNumReadBytes1);
 				iInTransfer[1]->TransferIn(KHostNumReadBytes2);
 				iInTransfer[2]->TransferIn(KHostNumReadBytes3);
 				break;
 
 			default:
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP14, "<Error> Unknown test step");
+				RDebug::Printf("<Error> Unknown test step");
 				TestFailed(KErrUnknown);
 				break;
 			}
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1234::TransferCompleteL(TInt aTransferId,
 			TInt aCompletionCode)
 		{
-		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1234_TRANSFERCOMPLETEL_ENTRY, this );
+		LOG_FUNC
 		Cancel();
 
 		TInt err(KErrNone);
 		TBuf<256> msg;
-		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP15, "Transfer completed (id=%d), aCompletionCode = %d",
+		RDebug::Printf("Transfer completed (id=%d), aCompletionCode = %d",
 				aTransferId, aCompletionCode);
 
 		switch (iCaseStep)
@@ -331,7 +310,7 @@
 					case KBulkTransferOutId1:
 					case KBulkTransferOutId2:
 						iTransferComplete |= aTransferId;
-						OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP16, "Transfer %d completed", aTransferId);
+						RDebug::Printf("Transfer %d completed", aTransferId);
 						break; // switch(aTransferId)
 
 					default:
@@ -413,7 +392,7 @@
 						}
 
 					// Comparison is a match
-					OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP17, "Comparison for IN transfer is a match");
+					RDebug::Printf("Comparison for IN transfer is a match");
 					iCaseStep = EPassed;
 					TTestCasePassed request;
 					iControlEp0->SendRequest(request, this);
@@ -435,30 +414,28 @@
 
 		if (err!=KErrNone)
 			{
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP18, msg);
+			RDebug::Print(msg);
 			iCaseStep = EFailed;
 			TTestCaseFailed request(err, msg);
 			iControlEp0->SendRequest(request, this);
 			}
 
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_TRANSFERCOMPLETEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1234::TrySuspendDeviceByInterfaces()
 		{
-		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1234_TRYSUSPENDDEVICEBYINTERFACES_ENTRY, this );
 		// Suspend interface 0
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP19, "Suspending interface 0");
+		RDebug::Printf("Suspending interface 0");
 		iInterface0Watcher->SuspendAndWatch();
 		iSuspendedI0 = ETrue;
 
 		// Suspend interface 1
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP20, "Suspending interface 1");
+		RDebug::Printf("Suspending interface 1");
 		iInterface1Watcher->SuspendAndWatch();
 		iSuspendedI1 = ETrue;
 
 		// Suspend interface 2
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP21, "Suspending interface 2");
+		RDebug::Printf("Suspending interface 2");
 		iInterface2Watcher->SuspendAndWatch();
 		iSuspendedI2 = ETrue;
 
@@ -469,22 +446,17 @@
 
 		iCaseStep = EValidateResumebyInterface;
 
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_TRYSUSPENDDEVICEBYINTERFACES_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1234::SendEpRequest()
 		{
-		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1234_SENDEPREQUEST_ENTRY, this );
 		TTestCasePassed request;
 		iControlEp0->SendRequest(request, this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_SENDEPREQUEST_EXIT, this );
 		}
 	void CUT_PBASE_T_USBDI_1234::SendEpTransferRequest()
 		{
-		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1234_SENDEPTRANSFERREQUEST_ENTRY, this );
 		TEndpointReadRequest request(1, 1, KBulkTransferSize);// EP1 means endpoint index 1 not the actual endpoint number
 		iControlEp0->SendRequest(request, this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1234_SENDEPTRANSFERREQUEST_EXIT, this );
 		}
 
 	}//end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1235.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1235.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -21,10 +21,6 @@
 #include "testdebug.h"
 #include "modelleddevices.h"
 #include "TestPolicy.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-1235Traces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -36,12 +32,10 @@
 
 	CUT_PBASE_T_USBDI_1235* CUT_PBASE_T_USBDI_1235::NewL(TBool aHostRole)
 		{
-		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1235_NEWL_ENTRY, aHostRole );
 		CUT_PBASE_T_USBDI_1235* self = new (ELeave) CUT_PBASE_T_USBDI_1235(aHostRole);
 		CleanupStack::PushL(self);
 		self->ConstructL();
 		CleanupStack::Pop(self);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_NEWL_EXIT, ( TUint )( self ) );
 		return self;
 		}
 
@@ -49,21 +43,17 @@
 		CBaseTestCase(KTestCaseId, aHostRole), iSuspendedI0(EFalse),
 				iSuspendedI1(EFalse)
 		{
-		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1235_CUT_PBASE_T_USBDI_1235_ENTRY, this );
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_CUT_PBASE_T_USBDI_1235_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1235::ConstructL()
 		{
-		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1235_CONSTRUCTL_ENTRY, this );
 		iTestDevice = new RUsbDeviceA(this);
 		BaseConstructL();
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_CONSTRUCTL_EXIT, this );
 		}
 
 	CUT_PBASE_T_USBDI_1235::~CUT_PBASE_T_USBDI_1235()
 		{
-        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1235_CUT_PBASE_T_USBDI_1235_ENTRY_DUP01, this );
+		LOG_FUNC
 
 		// Cancel any async operations
 
@@ -84,12 +74,11 @@
 			iTestDevice->Close();
 			}
 		delete iTestDevice;
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_CUT_PBASE_T_USBDI_1235_EXIT_DUP01, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1235::ExecuteHostTestCaseL()
 		{
-        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1235_EXECUTEHOSTTESTCASEL_ENTRY, this );
+		LOG_FUNC
 
 		iCaseStep = EInProcess;
 		iActorFDF = CActorFDF::NewL(*this);
@@ -102,12 +91,11 @@
 
 		// Start the connection timeout	
 		TimeoutIn(30);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_EXECUTEHOSTTESTCASEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1235::ExecuteDeviceTestCaseL()
 		{
-        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1235_EXECUTEDEVICETESTCASEL_ENTRY, this );
+		LOG_FUNC
 
 		// Construct the device for the test case
 		iTestDevice->OpenL(TestCaseId());
@@ -116,30 +104,27 @@
 
 		// Connect the test device	
 		iTestDevice->SoftwareConnect();
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_EXECUTEDEVICETESTCASEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1235::HostDoCancel()
 		{
-        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1235_HOSTDOCANCEL_ENTRY, this );
+		LOG_FUNC
 
 		// Cancel the timeout timer
 		CancelTimeout();
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_HOSTDOCANCEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1235::DeviceDoCancel()
 		{
-        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1235_DEVICEDOCANCEL_ENTRY, this );
+		LOG_FUNC
 
 		// Cancel the device	
 		iTestDevice->CancelSubscriptionToReports();
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_DEVICEDOCANCEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1235::DeviceInsertedL(TUint aDeviceHandle)
 		{
-        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1235_DEVICEINSERTEDL_ENTRY, this );
+		LOG_FUNC
 
 		Cancel(); // Cancel the timer
 		TInt err(KErrNone);
@@ -158,7 +143,6 @@
 
 			// Start the connection timeout again
 			TimeoutIn(30);
-			OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_DEVICEINSERTEDL_EXIT, this );
 			return;
 			}
 		// Check tree now	
@@ -172,7 +156,7 @@
 				TUint32 token1(0);
 				TUint32 token2(0);
 
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235, "Obtaining token for interface 0");
+				RDebug::Printf("Obtaining token for interface 0");
 				err = testDevice.Device().GetTokenForInterface(0, token1);
 				if (err != KErrNone)
 					{
@@ -181,8 +165,8 @@
 							err);
 					return TestFailed(err);
 					}
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP01, "Token 1 (%d) retrieved", token1);
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP02, "Opening interface 0");
+				RDebug::Printf("Token 1 (%d) retrieved", token1);
+				RDebug::Printf("Opening interface 0");
 				err = iUsbInterface0.Open(token1); // Alternate interface setting 0
 				if (err != KErrNone)
 					{
@@ -190,9 +174,9 @@
 							"<Error %d> Interface 0 could not be opened", err);
 					return TestFailed(err);
 					}
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP03, "Interface 0 opened");
+				RDebug::Printf("Interface 0 opened");
 
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP04, "Obtaining token for interface 1");
+				RDebug::Printf("Obtaining token for interface 1");
 				err = testDevice.Device().GetTokenForInterface(1, token2);
 				if (err != KErrNone)
 					{
@@ -201,7 +185,7 @@
 							err);
 					return TestFailed(err);
 					}
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP05, "Opening interface 1");
+				RDebug::Printf("Opening interface 1");
 				err = iUsbInterface1.Open(token2); // Alternate interface setting 0
 				if (err != KErrNone)
 					{
@@ -209,7 +193,7 @@
 							"<Error %d> Interface 1 could not be opened", err);
 					return TestFailed(err);
 					}
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP06, "Interface 1 opened");
+				RDebug::Printf("Interface 1 opened");
 
 				SuspendDeviceByInterfacesAndCancelWaitForResume();
 
@@ -222,13 +206,12 @@
 				TestFailed(KErrCorrupt);
 				break;
 			}
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_DEVICEINSERTEDL_EXIT_DUP01, this );
 		}
 
 	TInt CUT_PBASE_T_USBDI_1235::Interface0ResumedL(TAny* aPtr)
 		{
-		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1235_INTERFACE0RESUMEDL_ENTRY, 0 );
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP07, "Interface 0 resumed");
+		LOG_CFUNC
+		RDebug::Printf("Interface 0 resumed");
 		CUT_PBASE_T_USBDI_1235* self =
 				reinterpret_cast<CUT_PBASE_T_USBDI_1235*>(aPtr);
 		TInt completionCode=self->iInterface0Watcher->CompletionCode();
@@ -244,7 +227,7 @@
 				{
 				if (completionCode == KErrCancel)
 					{
-					OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP08, "CancelWaitForResume request: Success <%d>!",completionCode);
+					RDebug::Printf("CancelWaitForResume request: Success <>!",completionCode);
 				    // do not care the device's status.
 					self->iCaseStep = EPassed;					
 					}
@@ -264,49 +247,45 @@
 				break;
 			};
 
-		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_1235_INTERFACE0RESUMEDL_EXIT, 0, KErrNone );
 		return KErrNone;
 		}
 
 	TInt CUT_PBASE_T_USBDI_1235::Interface1ResumedL(TAny* aPtr)
 		{
-		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1235_INTERFACE1RESUMEDL_ENTRY, 0 );
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP09, "Interface 1 resumed");
+		LOG_CFUNC
+		RDebug::Printf("Interface 1 resumed");
 		CUT_PBASE_T_USBDI_1235* self =
 				reinterpret_cast<CUT_PBASE_T_USBDI_1235*>(aPtr);
 		TInt completionCode = self->iInterface1Watcher->CompletionCode();		
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP10, "watcher 1 iStatus=%d",completionCode);
+		RDebug::Printf("watcher 1 iStatus=%d",completionCode);
 		self->iSuspendedI1 = EFalse;
 		
 		if(self->iCaseStep == EPassed && completionCode == KErrNone )
 			{
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP11, "Device resumed,test passed!");
+			RDebug::Printf("Device resumed,test passed!");
 			self->SendEp0Request(); // stop client;
 			}
 		
-		OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_1235_INTERFACE1RESUMEDL_EXIT, 0, KErrNone );
 		return KErrNone;
 		}
 
 	void CUT_PBASE_T_USBDI_1235::DeviceRemovedL(TUint aDeviceHandle)
 		{
-        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1235_DEVICEREMOVEDL_ENTRY, this );
+		LOG_FUNC
 
 		// The test device should not be removed until the test case has passed
 		// so this test case has not completed, and state this event as an error
 
 		TestFailed(KErrDisconnected);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_DEVICEREMOVEDL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1235::BusErrorL(TInt aError)
 		{
-        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1235_BUSERRORL_ENTRY, this );
+		LOG_FUNC
 
 		// This test case handles no failiures on the bus
 
 		TestFailed(aError);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_BUSERRORL_EXIT, this );
 		}
 
 
@@ -314,7 +293,7 @@
 			RUsbDevice::TDeviceState aPreviousState,
 			RUsbDevice::TDeviceState aNewState, TInt aCompletionCode)
 		{
-		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1235_DEVICESTATECHANGEL_ENTRY, this );
+		LOG_FUNC
 		Cancel();
 		
 		// test RInterface , the  RUsbDevice notification logic not used . 
@@ -322,13 +301,12 @@
 				"-Device State change from %d to %d err=%d",
 				aPreviousState, aNewState, aCompletionCode);
 
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_DEVICESTATECHANGEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1235::Ep0TransferCompleteL(TInt aCompletionCode)
 		{
-		OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1235_EP0TRANSFERCOMPLETEL_ENTRY, this );
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP12, "Ep0TransferCompleteL with aCompletionCode = %d",
+		LOG_FUNC
+		RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",
 				aCompletionCode);
 		switch (iCaseStep)
 			{
@@ -342,12 +320,11 @@
 				TestPassed();
 				break;
 			}
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_EP0TRANSFERCOMPLETEL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1235::HostRunL()
 		{
-        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1235_HOSTRUNL_ENTRY, this );
+		LOG_FUNC
 
 		// Obtain the completion code
 		TInt completionCode(iStatus.Int());
@@ -355,21 +332,20 @@
 		if (completionCode == KErrNone)
 			{
 			// Action timeout
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP13, "<Error> Action timeout");
+			RDebug::Printf("<Error> Action timeout");
 			TestFailed(KErrTimedOut);
 			}
 		else
 			{
-			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP14, "<Error %d> Timeout timer could not complete",
+			RDebug::Printf("<Error %d> Timeout timer could not complete",
 					completionCode);
 			TestFailed(completionCode);
 			}
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_HOSTRUNL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1235::DeviceRunL()
 		{
-        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1235_DEVICERUNL_ENTRY, this );
+		LOG_FUNC
 
 		// Disconnect the device
 
@@ -378,41 +354,36 @@
 		// Complete the test case request
 
 		TestPolicy().SignalTestComplete(iStatus.Int());
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_DEVICERUNL_EXIT, this );
 		}
 
 	void CUT_PBASE_T_USBDI_1235::SuspendDeviceByInterfacesAndCancelWaitForResume()
 		{
-		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1235_SUSPENDDEVICEBYINTERFACESANDCANCELWAITFORRESUME_ENTRY, this );
 		// Suspend interface 0
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP15, "Suspending interface 0");
+		RDebug::Printf("Suspending interface 0");
 		iInterface0Watcher->SuspendAndWatch();
 		iSuspendedI0 = ETrue;
 		
 		// Suspend interface 1
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP16, "Suspending interface 1");
+		RDebug::Printf("Suspending interface 1");
 		iInterface1Watcher->SuspendAndWatch();
 		iSuspendedI1 = ETrue;
 		
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP17, "CancelPermitSuspend interface 1");
+		RDebug::Printf("CancelPermitSuspend interface 1");
 		// try to resume device,then host can notify peripheral test passed.
 		iUsbInterface1.CancelPermitSuspend();
 
 		// Only test the CancelWaitForResume() operation 
 		// If we let the devic to suspend ,the periperal site could not receive the test control transfer which test finish result.
         // select interface0 to test the function CancelWaitForResume	
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP18, "CacelWaitForResume interface 0");
+		RDebug::Printf("CacelWaitForResume interface 0");
 		iUsbInterface0.CancelWaitForResume();
 
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_SUSPENDDEVICEBYINTERFACESANDCANCELWAITFORRESUME_EXIT, this );
 		}
 	
 	void CUT_PBASE_T_USBDI_1235::SendEp0Request()
 		{		
-		OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1235_SENDEP0REQUEST_ENTRY, this );
 		TTestCasePassed request;
 		iControlEp0->SendRequest(request, this);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1235_SENDEP0REQUEST_EXIT, this );
 		}
 
 	}//end namespace
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1236.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-1236.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -22,10 +22,6 @@
 #include <d32usbdescriptors.h>
 #include "testdebug.h"
 #include "TestPolicy.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "PBASE-T_USBDI-1236Traces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -35,12 +31,10 @@
 
 CUT_PBASE_T_USBDI_1236* CUT_PBASE_T_USBDI_1236::NewL(TBool aHostRole)
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1236_NEWL_ENTRY, aHostRole );
 	CUT_PBASE_T_USBDI_1236* self = new (ELeave) CUT_PBASE_T_USBDI_1236(aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_NEWL_EXIT, ( TUint )( self ) );
 	return self; 
 	}
 	   
@@ -48,23 +42,19 @@
 CUT_PBASE_T_USBDI_1236::CUT_PBASE_T_USBDI_1236(TBool aHostRole)
 :	CBaseTestCase(KTestCaseId,aHostRole)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1236_CUT_PBASE_T_USBDI_1236_ENTRY, this );
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_CUT_PBASE_T_USBDI_1236_EXIT, this );
 	} 
 
 
 void CUT_PBASE_T_USBDI_1236::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1236_CONSTRUCTL_ENTRY, this );
 	iTestDevice = new RUsbDeviceA(this);
 	BaseConstructL();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_CONSTRUCTL_EXIT, this );
 	}
 
 
 CUT_PBASE_T_USBDI_1236::~CUT_PBASE_T_USBDI_1236()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1236_CUT_PBASE_T_USBDI_1236_ENTRY_DUP01, this );
+	LOG_FUNC
 	
 	// Cancel any async operations
 	
@@ -81,13 +71,12 @@
 		iTestDevice->Close();
 		}		
 	delete iTestDevice;
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_CUT_PBASE_T_USBDI_1236_EXIT_DUP01, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_1236::ExecuteHostTestCaseL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1236_EXECUTEHOSTTESTCASEL_ENTRY, this );
+	LOG_FUNC
 	iCaseStep = EStepGetInterfaceString;
 	iActorFDF = CActorFDF::NewL(*this);
 	iControlEp0 = new (ELeave) CEp0Transfer(iUsbInterface0);
@@ -97,12 +86,11 @@
 
 	// Start the connection timeout	
 	TimeoutIn(30);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_EXECUTEHOSTTESTCASEL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_1236::ExecuteDeviceTestCaseL()
 	{
-    OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1236_EXECUTEDEVICETESTCASEL_ENTRY, this );
+	LOG_FUNC
 
 	// Construct the device for the test case
 	iTestDevice->OpenL(TestCaseId());
@@ -111,13 +99,12 @@
 
 	// Connect the test device	
 	iTestDevice->SoftwareConnect();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_EXECUTEDEVICETESTCASEL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_1236::DeviceInsertedL(TUint aDeviceHandle)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_ENTRY, this );
+	LOG_FUNC
 
 	Cancel(); // Cancel the timer
 	TInt err(KErrNone);
@@ -130,12 +117,11 @@
 		{
 		// Incorrect device for this test case
 
-		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
-			KErrNotFound,testDevice.SerialNumber(),TestCaseId());
+		RDebug::Printf("<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
+			KErrNotFound,&testDevice.SerialNumber(),&TestCaseId());
 
 		// Start the connection timeout again
 		TimeoutIn(30);
-		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_EXIT, this );
 		return;
 		}	
 		
@@ -147,52 +133,52 @@
 			TUint32 token1(0);
 			TUint32 token2(0);
 	
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP01, "Obtaining token for interface 0");
+			RDebug::Printf("Obtaining token for interface 0");
 			err = testDevice.Device().GetTokenForInterface(0,token1);
 			if(err != KErrNone)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP02, "<Error %d> Token for interface 0 could not be retrieved",err);
+				RDebug::Printf("<Error %d> Token for interface 0 could not be retrieved",err);
 				return TestFailed(err);
 				}
-			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP03, "Token 1 (%d) retrieved",token1);
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP04, "Opening interface 0");
+			RDebug::Printf("Token 1 (%d) retrieved",token1);
+			RDebug::Printf("Opening interface 0");
 			err = iUsbInterface0.Open(token1); // Alternate interface setting 0
 			if(err != KErrNone)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP05, "<Error %d> Interface 0 could not be opened",err);
+				RDebug::Printf("<Error %d> Interface 0 could not be opened",err);
 				return TestFailed(err);
 				}
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP06, "Interface 0 opened");
+			RDebug::Printf("Interface 0 opened");
 		
 																
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP07, "Obtaining token for interface 1");
+			RDebug::Printf("Obtaining token for interface 1");
 			err = testDevice.Device().GetTokenForInterface(1,token2);
 			if(err != KErrNone)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP08, "<Error %d> Token for interface 1 could not be retrieved",err);
+				RDebug::Printf("<Error %d> Token for interface 1 could not be retrieved",err);
 				return TestFailed(err);			
 				}	
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP09, "Opening interface 1");
+			RDebug::Printf("Opening interface 1");
 			err = iUsbInterface1.Open(token2); // Alternate interface setting 0
 			if(err != KErrNone)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP10, "<Error %d> Interface 1 could not be opened",err);
+				RDebug::Printf("<Error %d> Interface 1 could not be opened",err);
 				return TestFailed(err);
 				}
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP11, "Interface 1 opened");
+			RDebug::Printf("Interface 1 opened");
 	
 			// close it
 			iUsbInterface1.Close();		
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP12, "Interface 1 closed");
+			RDebug::Printf("Interface 1 closed");
 	
 			//re-open now
 			err = iUsbInterface1.Open(token2); // Alternate interface setting 0
 			if(err != KErrNone)
 				{
-				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP13, "<Error %d> Interface 1 could not be re-opened",err);
+				RDebug::Printf("<Error %d> Interface 1 could not be re-opened",err);
 				return TestFailed(err);
 				}
-			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP14, "Interface 1 re-opened");
+			RDebug::Printf("Interface 1 re-opened");
 			
 
 			
@@ -209,14 +195,14 @@
 			u16String.SetLength(interfaceString.Length()/2);
 			if (u16String.Compare(_L16("i1s0")) == 0)
 				{
-				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP15, "interface String match");
+				RDebug::Printf("interface String match");
 				iCaseStep = EPassed;
 				TTestCasePassed request;
 				iControlEp0->SendRequest(request,this);
 				}
 			else
 				{
-				OstTraceExt1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP16, "interface String not match %s", interfaceString);
+				RDebug::Printf("interface String not match %S", &interfaceString);
 				iCaseStep = EFailed;
 				TTestCaseFailed request(KErrCompletion, _L8("interface string not match"));
 				iControlEp0->SendRequest(request,this);
@@ -228,46 +214,42 @@
 			TestFailed(KErrCorrupt);
 			break;
 		}	
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_EXIT_DUP01, this );
 	}
 
 
 	
 void CUT_PBASE_T_USBDI_1236::DeviceRemovedL(TUint aDeviceHandle)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1236_DEVICEREMOVEDL_ENTRY, this );
+	LOG_FUNC
 
 	// The test device should not be removed until the test case has passed
 	// so this test case has not completed, and state this event as an error
 
 	TestFailed(KErrDisconnected);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_DEVICEREMOVEDL_EXIT, this );
 	}
 	
 	
 void CUT_PBASE_T_USBDI_1236::BusErrorL(TInt aError)
 	{
-    OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1236_BUSERRORL_ENTRY, this );
+	LOG_FUNC
 
 	// This test case handles no failiures on the bus
 
 	TestFailed(aError);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_BUSERRORL_EXIT, this );
 	}
 	
 void CUT_PBASE_T_USBDI_1236::DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState,TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1236_DEVICESTATECHANGEL_ENTRY, this );
+	LOG_FUNC
 	Cancel();
-	OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_DEVICESTATECHANGEL, "Device State change from %d to %d err=%d",aPreviousState,aNewState,aCompletionCode);
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_DEVICESTATECHANGEL_EXIT, this );
+	RDebug::Printf("Device State change from %d to %d err=%d",aPreviousState,aNewState,aCompletionCode);
 	}
 
 
 void CUT_PBASE_T_USBDI_1236::Ep0TransferCompleteL(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1236_EP0TRANSFERCOMPLETEL_ENTRY, this );
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
+	LOG_FUNC
+	RDebug::Printf("Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode);
 	switch(iCaseStep)
 		{
 		// Fail the test case
@@ -282,13 +264,12 @@
 			TestPassed();
 			break;
 			}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_EP0TRANSFERCOMPLETEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_1236::HostRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1236_HOSTRUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Obtain the completion code
 	TInt completionCode(iStatus.Int());
@@ -296,21 +277,20 @@
 	if(completionCode == KErrNone)
 		{
 		// Action timeout
-		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_HOSTRUNL, "<Error> Action timeout");
+		RDebug::Printf("<Error> Action timeout");
 		TestFailed(KErrTimedOut);
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1236_HOSTRUNL_DUP01, "<Error %d> Timeout timer could not complete",completionCode);
+		RDebug::Printf("<Error %d> Timeout timer could not complete",completionCode);
 		TestFailed(completionCode);
 		}
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_HOSTRUNL_EXIT, this );
 	}
 	
 
 void CUT_PBASE_T_USBDI_1236::DeviceRunL()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1236_DEVICERUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Disconnect the device
 	
@@ -319,26 +299,23 @@
 	// Complete the test case request
 	
 	TestPolicy().SignalTestComplete(iStatus.Int());
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_DEVICERUNL_EXIT, this );
 	}
 
 void CUT_PBASE_T_USBDI_1236::HostDoCancel()
 	{
-OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1236_HOSTDOCANCEL_ENTRY, this );
+	LOG_FUNC
 
 	// Cancel the timeout timer
 	CancelTimeout();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_HOSTDOCANCEL_EXIT, this );
 	}
 
 
 void CUT_PBASE_T_USBDI_1236::DeviceDoCancel()
 	{
-	OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1236_DEVICEDOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel the device	
 	iTestDevice->CancelSubscriptionToReports();
-	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1236_DEVICEDOCANCEL_EXIT, this );
 	}
 	
 	}
--- a/kerneltest/e32test/usbho/t_usbdi/src/SoftwareConnectTimer.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/SoftwareConnectTimer.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -17,10 +17,6 @@
 //
 
 #include "softwareconnecttimer.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "SoftwareConnectTimerTraces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -29,12 +25,10 @@
 	
 CSoftwareConnectTimer* CSoftwareConnectTimer::NewL(RUsbTestDevice& aTestDevice)
 	{
-	OstTraceFunctionEntry1( CSOFTWARECONNECTTIMER_NEWL_ENTRY, ( TUint )&( aTestDevice ) );
 	CSoftwareConnectTimer* self = new (ELeave) CSoftwareConnectTimer(aTestDevice);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CSOFTWARECONNECTTIMER_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -44,54 +38,48 @@
 	iTestDevice(aTestDevice),
 	iConnectType(EUnknown)
 	{
-	OstTraceFunctionEntryExt( CSOFTWARECONNECTTIMER_CSOFTWARECONNECTTIMER_ENTRY, this );
 	CActiveScheduler::Add(this);
-	OstTraceFunctionExit1( CSOFTWARECONNECTTIMER_CSOFTWARECONNECTTIMER_EXIT, this );
 	}
 	
 	
 CSoftwareConnectTimer::~CSoftwareConnectTimer()
 	{
-	OstTraceFunctionEntry1( CSOFTWARECONNECTTIMER_CSOFTWARECONNECTTIMER_ENTRY_DUP01, this );
-	OstTraceFunctionExit1( CSOFTWARECONNECTTIMER_CSOFTWARECONNECTTIMER_EXIT_DUP01, this );
+	LOG_FUNC
 	}
 	
 	
 void CSoftwareConnectTimer::SoftwareConnect(TInt aInterval)
 	{
-	OstTraceFunctionEntryExt( CSOFTWARECONNECTTIMER_SOFTWARECONNECT_ENTRY, this );
+	LOG_FUNC
 	iConnectType = EConnect;
 	After(aInterval*KOneSecond);
-	OstTraceFunctionExit1( CSOFTWARECONNECTTIMER_SOFTWARECONNECT_EXIT, this );
 	}
 	
 
 void CSoftwareConnectTimer::SoftwareDisconnect(TInt aInterval)
 	{
-	OstTraceFunctionEntryExt( CSOFTWARECONNECTTIMER_SOFTWAREDISCONNECT_ENTRY, this );
+	LOG_FUNC
 	iConnectType = EDisconnect;
 	After(aInterval*KOneSecond);
-	OstTraceFunctionExit1( CSOFTWARECONNECTTIMER_SOFTWAREDISCONNECT_EXIT, this );
 	}
 	
 	
 void CSoftwareConnectTimer::SoftwareReConnect(TInt aInterval)
 	{
-	OstTraceFunctionEntryExt( CSOFTWARECONNECTTIMER_SOFTWARERECONNECT_ENTRY, this );
+	LOG_FUNC
 	iTestDevice.SoftwareDisconnect();
 	SoftwareConnect(aInterval);
-	OstTraceFunctionExit1( CSOFTWARECONNECTTIMER_SOFTWARERECONNECT_EXIT, this );
 	}
 
 
 void CSoftwareConnectTimer::RunL()
 	{
-	OstTraceFunctionEntry1( CSOFTWARECONNECTTIMER_RUNL_ENTRY, this );
+	LOG_FUNC
 	TInt completionCode(iStatus.Int());
 	
 	if(completionCode != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CSOFTWARECONNECTTIMER_RUNL, "<Error %d> software connect/disconnect timer error",completionCode);
+		RDebug::Printf("<Error %d> software connect/disconnect timer error",completionCode);
 		iTestDevice.ReportError(completionCode);
 		}
 	else
@@ -107,14 +95,13 @@
 				break;
 				
 			case EUnknown:
-				OstTrace0(TRACE_NORMAL, CSOFTWARECONNECTTIMER_RUNL_DUP01, "<Error> Unknown state for software connect timer");
+				RDebug::Printf("<Error> Unknown state for software connect timer");
 				break;
 			
 			default:
 				break;
 			}			
 		}	
-	OstTraceFunctionExit1( CSOFTWARECONNECTTIMER_RUNL_EXIT, this );
 	}
 
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/TestCaseController.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/TestCaseController.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -22,10 +22,6 @@
 #include "testengine.h"
 #include "testpolicy.h"
 #include "testdebug.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "TestCaseControllerTraces.h"
-#endif
 
 _LIT(KClientDeviceDriverName,"EUSBC");
 _LIT(KHostDeviceDriverName,"usbhubdriver");
@@ -37,12 +33,10 @@
 	
 CTestCaseController* CTestCaseController::NewL(CTestEngine& aTestEngine,TBool aHostRole)
 	{
-	OstTraceFunctionEntryExt( CTESTCASECONTROLLER_NEWL_ENTRY, 0 );
 	CTestCaseController* self = new (ELeave) CTestCaseController(aTestEngine,aHostRole);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CTESTCASECONTROLLER_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -52,16 +46,14 @@
 	iTestEngine(aTestEngine),
 	iHostRole(aHostRole)
 	{
-	OstTraceFunctionEntryExt( CTESTCASECONTROLLER_CTESTCASECONTROLLER_ENTRY, this );
 	// Add to current threads active scheduler
 	CActiveScheduler::Add(this);
-	OstTraceFunctionExit1( CTESTCASECONTROLLER_CTESTCASECONTROLLER_EXIT, this );
 	}
 	
 	
 CTestCaseController::~CTestCaseController()
 	{
-    OstTraceFunctionEntry1( CTESTCASECONTROLLER_CTESTCASECONTROLLER_ENTRY_DUP01, this );
+	LOG_FUNC 
 
 	Cancel(); // Cancels any oustanding test cases
 
@@ -72,19 +64,19 @@
 		TInt err = User::FreeLogicalDevice(KHostDeviceInterfaceDriverName);
 		if(err != KErrNone)
 			{
-			OstTraceExt2(TRACE_NORMAL, CTESTCASECONTROLLER_DCTESTCASECONTROLLER, "<Error %d> Unable to unload driver: %S",err,KHostDeviceInterfaceDriverName());
+			RDebug::Printf("<Error %d> Unable to unload driver: %S",err,&KHostDeviceInterfaceDriverName);
 			}
 		
 		err = User::FreeLogicalDevice(KHostDeviceDriverName);
 		if(err != KErrNone)
 			{
-			OstTraceExt2(TRACE_NORMAL, CTESTCASECONTROLLER_DCTESTCASECONTROLLER_DUP01, "<Error %d> Unable to unload driver: %S",err,KHostDeviceDriverName());
+			RDebug::Printf("<Error %d> Unable to unload driver: %S",err,&KHostDeviceDriverName);
 			}
 			
 		err = User::FreeLogicalDevice(KOtgdiLddFileName);
 		if(err != KErrNone)
 			{
-			OstTraceExt2(TRACE_NORMAL, CTESTCASECONTROLLER_DCTESTCASECONTROLLER_DUP02, "<Error %d> Unable to unload driver: %S",err,KHostDeviceDriverName());
+			RDebug::Printf("<Error %d> Unable to unload driver: %S",err,&KHostDeviceDriverName);
 			}			
 		}
 	else
@@ -92,15 +84,14 @@
 		TInt err(User::FreeLogicalDevice(KClientDeviceDriverName));
 		if(err != KErrNone)
 			{
-			OstTraceExt2(TRACE_NORMAL, CTESTCASECONTROLLER_DCTESTCASECONTROLLER_DUP03, "<Error %d> Unable to unload driver: %S",err,KClientDeviceDriverName());
+			RDebug::Printf("<Error %d> Unable to unload driver: %S",err,&KClientDeviceDriverName);
 			}		
 		}
-	OstTraceFunctionExit1( CTESTCASECONTROLLER_CTESTCASECONTROLLER_EXIT_DUP01, this );
 	}
 
 void CTestCaseController::ConstructL()
 	{
-	OstTraceFunctionEntry1( CTESTCASECONTROLLER_CONSTRUCTL_ENTRY, this );
+	LOG_FUNC
 	TInt err = KErrNone;
 	
 	_LIT(KLoadingNamedDriverString,"loading driver: %S\n");
@@ -110,18 +101,15 @@
 	if(iHostRole)
 		{
 		gtest.Printf(KLoadingNamedDriverString,&KHostDeviceDriverName);		
-		OstTraceExt1(TRACE_NORMAL, CTESTCASECONTROLLER_CONSTRUCTL, "loading driver: %S\n", KHostDeviceDriverName());		
 		// Load both Host USB device drivers
 		err = User::LoadLogicalDevice(KHostDeviceDriverName);
 		gtest((err == KErrNone) || (err == KErrAlreadyExists));
 		gtest.Printf(KLoadedNamedDriverString,&KHostDeviceDriverName);
-		OstTraceExt1(TRACE_NORMAL, CTESTCASECONTROLLER_CONSTRUCTL_DUP01, "loaded driver: %S\n",KHostDeviceDriverName());
 		
-		OstTraceExt1(TRACE_NORMAL, CTESTCASECONTROLLER_CONSTRUCTL_DUP02, "loading driver: %S\n",KHostDeviceInterfaceDriverName());
+		RDebug::Print(KLoadingNamedDriverString,&KHostDeviceInterfaceDriverName);
 		err = User::LoadLogicalDevice(KHostDeviceInterfaceDriverName);
 		gtest((err == KErrNone) || (err == KErrAlreadyExists));
 		gtest.Printf(KLoadedNamedDriverString,&KHostDeviceInterfaceDriverName);
-		OstTraceExt1(TRACE_NORMAL, CTESTCASECONTROLLER_CONSTRUCTL_DUP03, "loaded driver: %S\n",KHostDeviceInterfaceDriverName());
 		  												 
 		// If test cases are running USB host side actions
 		// then run each test case in its own thread		
@@ -132,11 +120,9 @@
 				  		
 		// Load the USB client driver	
 		gtest.Printf(KLoadingNamedDriverString,&KClientDeviceDriverName);
-		OstTraceExt1(TRACE_NORMAL, CTESTCASECONTROLLER_CONSTRUCTL_DUP04, "loading driver: %S\n",KClientDeviceDriverName());
 		err = User::LoadLogicalDevice(KClientDeviceDriverName);
 		gtest((err == KErrNone) || (err == KErrAlreadyExists));
 		gtest.Printf(KLoadedNamedDriverString,&KClientDeviceDriverName);
-		OstTraceExt1(TRACE_NORMAL, CTESTCASECONTROLLER_CONSTRUCTL_DUP05, "loaded driver: %S\n",KClientDeviceDriverName());
 		
 		// Run each test case in the main thread as its not new API 
 		// and not expected to panic
@@ -150,23 +136,20 @@
 	// Run the test case	
 	iTestPolicy->RunTestCaseL(iTestCaseId,iStatus);
 	SetActive();
-	OstTraceFunctionExit1( CTESTCASECONTROLLER_CONSTRUCTL_EXIT, this );
 	}
 	
 
 void CTestCaseController::DoCancel()
 	{
-	OstTraceFunctionEntry1( CTESTCASECONTROLLER_DOCANCEL_ENTRY, this );
 	// Cancel the outstanding test case running
 
 	iTestPolicy->Cancel();
-	OstTraceFunctionExit1( CTESTCASECONTROLLER_DOCANCEL_EXIT, this );
 	}
 	
 	
 void CTestCaseController::RunL()
 	{
-    OstTraceFunctionEntry1( CTESTCASECONTROLLER_RUNL_ENTRY, this );
+	LOG_FUNC
 
 	// Retrieve the completion code of the last test case run
 	TInt err(iStatus.Int());
@@ -176,13 +159,11 @@
 		{
 		iTestCasesResults.Append(EFalse);
 		gtest.Printf(_L("FAILED err=%d\n"),err);
-		OstTrace1(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL, "FAILED err=%d\n",err);
 		}
 	else
 		{
 		iTestCasesResults.Append(ETrue);
 		gtest.Printf(_L("PASSED\n"));
-		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP01, "PASSED\n");
 		}
 		
 	// Get the identity of the next test case to run
@@ -190,14 +171,14 @@
 	err = iTestEngine.NextTestCaseId(iTestCaseId);
 	if(err == KErrNone)
 		{
-		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP02, "\n");
-		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP03, "\n");
-		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP04, "\n");
+		RDebug::Printf("\n");
+		RDebug::Printf("\n");
+		RDebug::Printf("\n");
 		gtest.Next(iTestCaseId);
-		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP05, "                              --------------------");
-		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP06, "\n");
-		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP07, "\n");
-		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP08, "\n");
+		RDebug::Printf("                              --------------------");
+		RDebug::Printf("\n");
+		RDebug::Printf("\n");
+		RDebug::Printf("\n");
 		
 		// Run the next test case
 		
@@ -206,8 +187,8 @@
 		}
 	else if(err == KErrNotFound)
 		{
-		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP09, "All specified test cases performed");
-		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP10, "----------------------------------");
+		RDebug::Printf("All specified test cases performed");
+		RDebug::Printf("----------------------------------");
 		
 		
 		// count nb failures
@@ -221,15 +202,15 @@
 				nbFailures++;
 				}
 			}
-		OstTraceExt2(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP11, "There are %d test case results, %d failures", iTestCasesResults.Count(), nbFailures);
+		RDebug::Printf("There are %d test case results, %d failures", iTestCasesResults.Count(), nbFailures);
 
 		// Number of tests that should have been run (including repeats)
 		TUint nbTests = iTestEngine.TestCasesIdentities().Count() * iTestEngine.NumRepeats();
 		if(nbTests!=iTestCasesResults.Count())
 			{
-			OstTraceExt2(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP12, "The number of tests that should have been run (%d) DOES NOT EQUAL the actual number of tests run (%d).", 
+			RDebug::Printf("The number of tests that should have been run (%d) DOES NOT EQUAL the actual number of tests run (%d).", 
 						  nbTests, iTestCasesResults.Count());
-			OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP13, "This test suite will now PANIC!");
+			RDebug::Printf("This test suite will now PANIC!");
 			}
 		ASSERT((nbTests==iTestCasesResults.Count()));
 
@@ -238,36 +219,35 @@
 			{
 			if(iTestEngine.NumRepeats() > 1)
 				{
-				OstTrace1(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP14, "Test Case Loop %d..........",	repeat+1);			
+				RDebug::Printf("Test Case Loop %d..........",	repeat+1);			
 				}
 			for(TInt testIndex = 0; testIndex < iTestEngine.TestCasesIdentities().Count() ; testIndex++)
 				{
 				if(iTestCasesResults[testIndex])
 					{
-					OstTraceExt1(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP15, "Test Case: %S : PASSED",	*(iTestEngine.TestCasesIdentities())[testIndex]);			
+					RDebug::Print(_L("Test Case: %S : PASSED"),	(iTestEngine.TestCasesIdentities())[testIndex]);			
 					}
 				else
 					{
-					OstTraceExt1(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP16, "Test Case: %S : FAILED",	*(iTestEngine.TestCasesIdentities())[testIndex]);
+					RDebug::Print(_L("Test Case: %S : FAILED"),	(iTestEngine.TestCasesIdentities())[testIndex]);
 					}
 				}
 			}
 
-		OstTrace0(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP17, "CActiveScheduler::Stop CTestCaseController::RunL");
+		RDebug::Printf("CActiveScheduler::Stop CTestCaseController::RunL");
 		CActiveScheduler::Stop();
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CTESTCASECONTROLLER_RUNL_DUP18, "<Error %d> Unknown error from CTestEngine::NextTestCaseId",err);
+		RDebug::Printf("<Error %d> Unknown error from CTestEngine::NextTestCaseId",err);
 		User::Leave(err);
 		}
-	OstTraceFunctionExit1( CTESTCASECONTROLLER_RUNL_EXIT, this );
 	}
 	
 	
 TInt CTestCaseController::RunError(TInt aError)
 	{
-	OstTraceFunctionEntryExt( CTESTCASECONTROLLER_RUNERROR_ENTRY, this );
+	LOG_FUNC
 	
 	switch(aError)
 		{
@@ -277,7 +257,6 @@
 			gtest(EFalse);
 			break;
 		}
-	OstTraceFunctionExitExt( CTESTCASECONTROLLER_RUNERROR_EXIT, this, KErrNone );
 	return KErrNone;
 	}
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/TestCaseFactory.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/TestCaseFactory.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,10 +18,6 @@
 
 #include "TestCaseFactory.h"
 #include "testdevicebase.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "TestCaseFactoryTraces.h"
-#endif
 #include <e32debug.h>
 
 namespace NUnitTesting_USBDI
@@ -29,29 +25,23 @@
 	
 RTestFactory& RTestFactory::Instance()
 	{
-	OstTraceFunctionEntry1( RTESTFACTORY_INSTANCE_ENTRY, 0 );
 	static RTestFactory singleton;
-	OstTraceFunctionExitExt( RTESTFACTORY_INSTANCE_EXIT, 0, ( TUint )&( singleton ) );
 	return singleton;
 	}
 	
 RTestFactory::~RTestFactory()
 	{
-	OstTraceFunctionEntry1( RTESTFACTORY_RTESTFACTORY_ENTRY, this );
-	OstTraceFunctionExit1( RTESTFACTORY_RTESTFACTORY_EXIT, this );
 	}
 	
 	
 RTestFactory::RTestFactory()
 :	iTestCases(TStringIdentity::Hash,TStringIdentity::Id)
 	{
-	OstTraceFunctionEntry1( RTESTFACTORY_RTESTFACTORY_ENTRY_DUP01, this );
-	OstTraceFunctionExit1( RTESTFACTORY_RTESTFACTORY_EXIT_DUP01, this );
 	}
 	
 void RTestFactory::RegisterTestCase(const TDesC& aTestCaseId,TBaseTestCaseFunctor const* aFunctor)
 	{
-    OstTraceFunctionEntryExt( RTESTFACTORY_REGISTERTESTCASE_ENTRY, 0 );
+	LOG_CFUNC
 
 	LOG_INFO((_L("Registering test case '%S'"),&aTestCaseId))
 	
@@ -60,15 +50,14 @@
 	if(err != KErrNone)
 		{
 		// Log that a test case could not be registered due to err
-		OstTraceExt1(TRACE_NORMAL, RTESTFACTORY_REGISTERTESTCASE, "Test case '%S' could not be registered with test case factory",aTestCaseId);
+		RDebug::Printf("Test case '%S' could not be registered with test case factory",&aTestCaseId);
 		}
-	OstTraceFunctionExit1( RTESTFACTORY_REGISTERTESTCASE_EXIT, 0 );
 	}
 
 
 CBaseTestCase* RTestFactory::CreateTestCaseL(const TDesC& aTestCaseId,TBool aHostRole)
 	{
-	OstTraceFunctionEntryExt( RTESTFACTORY_CREATETESTCASEL_ENTRY, 0 );
+	LOG_CFUNC
 	
 	TStringIdentity key(aTestCaseId);
 	const TBaseTestCaseFunctor& functor = *(*Instance().iTestCases.Find(key));
@@ -78,19 +67,18 @@
 
 void RTestFactory::ListRegisteredTestCases()
 	{
-	OstTraceFunctionEntry1( RTESTFACTORY_LISTREGISTEREDTESTCASES_ENTRY, 0 );
+	LOG_CFUNC
 	RFactoryMap::TIter it(Instance().iTestCases);
 	
-	OstTrace0(TRACE_NORMAL, RTESTFACTORY_LISTREGISTEREDTESTCASES, "-------- F A C T O R Y ---------");
+	RDebug::Printf("-------- F A C T O R Y ---------");
 	
 	TInt count(0);
 	for(count=0; count<Instance().iTestCases.Count(); count++)
 		{
-		OstTrace1(TRACE_NORMAL, RTESTFACTORY_LISTREGISTEREDTESTCASES_DUP01, "%d",count);
+		RDebug::Printf("%d: %S",count,it.NextKey());
 		}
 	
-	OstTrace0(TRACE_NORMAL, RTESTFACTORY_LISTREGISTEREDTESTCASES_DUP02, "--------------------------------");
-	OstTraceFunctionExit1( RTESTFACTORY_LISTREGISTEREDTESTCASES_EXIT, 0 );
+	RDebug::Printf("--------------------------------");
 	}
 
 	}
--- a/kerneltest/e32test/usbho/t_usbdi/src/TestDeviceBase.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/TestDeviceBase.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -25,10 +25,6 @@
 #include "controltransferrequests.h"
 #include "testinterfacebase.h"
 #include "PBASE-T_USBDI-0486.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "TestDeviceBaseTraces.h"
-#endif
 #include <e32property.h>
 
 namespace NUnitTesting_USBDI
@@ -41,8 +37,6 @@
 	iConnectTimer(NULL), iWakeupTimer(NULL),
 	iAuxBuffer(NULL)
 	{
-	OstTraceFunctionEntry1( RUSBTESTDEVICE_RUSBTESTDEVICE_ENTRY, this );
-	OstTraceFunctionExit1( RUSBTESTDEVICE_RUSBTESTDEVICE_EXIT, this );
 	}
 	
 RUsbTestDevice::RUsbTestDevice(CBaseTestCase* aTestCase)
@@ -52,29 +46,25 @@
 	iConnectTimer(NULL), iWakeupTimer(NULL),
 	iAuxBuffer(NULL)
 	{
-	OstTraceFunctionEntryExt( RUSBTESTDEVICE_RUSBTESTDEVICE_ENTRY_DUP01, this );
+	LOG_FUNC	
 	iTestCase = aTestCase;
-	OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_RUSBTESTDEVICE, "iTestCase = %d", iTestCase);
-	OstTraceFunctionExit1( RUSBTESTDEVICE_RUSBTESTDEVICE_EXIT_DUP01, this );
+	RDebug::Printf("iTestCase = %d", iTestCase);
 	}
 		
 void RUsbTestDevice::ResetState()
 	{
-	OstTraceFunctionEntry1( RUSBTESTDEVICE_RESETSTATE_ENTRY, this );
 	iCurrentState = EUsbcDeviceStateUndefined;
-	OstTraceFunctionExit1( RUSBTESTDEVICE_RESETSTATE_EXIT, this );
 	}
 
 RUsbTestDevice::~RUsbTestDevice()
 	{
-	OstTraceFunctionEntry1( RUSBTESTDEVICE_RUSBTESTDEVICE_ENTRY_DUP02, this );
+	LOG_FUNC
 	
-	OstTraceFunctionExit1( RUSBTESTDEVICE_RUSBTESTDEVICE_EXIT_DUP02, this );
 	}
 	
 void RUsbTestDevice::Close()
 	{
-OstTraceFunctionEntry1( RUSBTESTDEVICE_CLOSE_ENTRY, this );
+	LOG_FUNC
 
 	delete iWakeupTimer;
 	delete iConnectTimer;
@@ -95,44 +85,41 @@
         TInt r = RProperty::Define(KWordOfDeathCat, KWordOfDeathKey, RProperty::EInt,KAllowAllPolicy, KAllowAllPolicy, 0);
         if(r != KErrNone)
             {
-            OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_CLOSE, "Could not create the WordOfDeath P&S   (%d)", r);
+            RDebug::Print(_L("Could not create the WordOfDeath P&S   (%d)"), r);
             }
-		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_CLOSE_DUP01, "killing t_usbhost_usbman.exe");
+		RDebug::Printf("killing t_usbhost_usbman.exe");
         RProperty::Set(KWordOfDeathCat, KWordOfDeathKey, KErrAbort);   // Send the word of death
         User::After(1000000); //allow time for t_usbhost_usbman.exe to clean up
 		}
-	OstTraceFunctionExit1( RUSBTESTDEVICE_CLOSE_EXIT, this );
 	}
 
 
 void RUsbTestDevice::SubscribeToReports(TRequestStatus& aObserverStatus)
 	{
-	OstTraceFunctionEntryExt( RUSBTESTDEVICE_SUBSCRIBETOREPORTS_ENTRY, this );
+	LOG_FUNC
 	
 	// Signal the request as pending
 	
 	iObserverStatus = &aObserverStatus;
 	*iObserverStatus = KRequestPending;
-	OstTraceFunctionExit1( RUSBTESTDEVICE_SUBSCRIBETOREPORTS_EXIT, this );
 	}
 
 
 void RUsbTestDevice::CancelSubscriptionToReports()
 	{
-	OstTraceFunctionEntry1( RUSBTESTDEVICE_CANCELSUBSCRIPTIONTOREPORTS_ENTRY, this );
+	LOG_FUNC
 	
 	// Signal the request as cancelled
 	User::RequestComplete(iObserverStatus,KErrCancel);
-	OstTraceFunctionExit1( RUSBTESTDEVICE_CANCELSUBSCRIPTIONTOREPORTS_EXIT, this );
 	}
 	
 		
 void RUsbTestDevice::OpenL()
 	{
-	OstTraceFunctionEntry1( RUSBTESTDEVICE_OPENL_ENTRY, this );
+	LOG_FUNC	
 	TInt err = KErrNone;
 	
-	OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_OPENL, "starting t_usbhost_usbman.exe");
+	RDebug::Printf("starting t_usbhost_usbman.exe");
 	TInt r = iOtgUsbMan.Create(_L("t_usbhost_usbman.exe"), _L("client"));
 	gtest(r == KErrNone);
 	iOtgUsbMan.Resume();	
@@ -143,7 +130,7 @@
 	err = iClientDriver.Open(0);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP01, "<Error %d> Unable to open a channel to USB client driver",err);
+		RDebug::Printf("<Error %d> Unable to open a channel to USB client driver",err);
 		User::Leave(err);
 		}
 	
@@ -151,7 +138,7 @@
 	err = iClientDriver.DeviceDisconnectFromHost();
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP02, "<Error %d> unable to disconnect device from host",err);
+		RDebug::Printf("<Error %d> unable to disconnect device from host",err);
 		User::Leave(err);
 		}
 	
@@ -169,29 +156,28 @@
 	_LIT8(KYes, "yes");
 	_LIT8(KNo, "no");
 	User::LeaveIfError(iClientDriver.DeviceCaps(iDeviceCaps));
- 	OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP03, "------ USB device capabilities -------");
-	OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP04, "Number of endpoints:                %d",iDeviceCaps().iTotalEndpoints);	
-	OstTraceExt1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP05, "Supports Software-Connect:          %s",iDeviceCaps().iConnect ? KYes() : KNo());
-	OstTraceExt1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP06, "Device is Self-Powered:             %S",iDeviceCaps().iSelfPowered ? KYes() : KNo());
-	OstTraceExt1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP07, "Supports Remote-Wakeup:             %S",iDeviceCaps().iRemoteWakeup ? KYes() : KNo());
-	OstTraceExt1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP08, "Supports High-speed:                %S",iDeviceCaps().iHighSpeed ? KYes() : KNo());
-	OstTraceExt1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP09, "Supports unpowered cable detection: %S",(iDeviceCaps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ? KYes() : KNo());
-	OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP10, "--------------------------------------");
+ 	RDebug::Printf("------ USB device capabilities -------");
+	RDebug::Printf("Number of endpoints:                %d",iDeviceCaps().iTotalEndpoints);	
+	RDebug::Printf("Supports Software-Connect:          %S",iDeviceCaps().iConnect ? &KYes() : &KNo());
+	RDebug::Printf("Device is Self-Powered:             %S",iDeviceCaps().iSelfPowered ? &KYes() : &KNo());
+	RDebug::Printf("Supports Remote-Wakeup:             %S",iDeviceCaps().iRemoteWakeup ? &KYes() : &KNo());
+	RDebug::Printf("Supports High-speed:                %S",iDeviceCaps().iHighSpeed ? &KYes() : &KNo());
+	RDebug::Printf("Supports unpowered cable detection: %S",(iDeviceCaps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ? &KYes() : &KNo());
+	RDebug::Printf("--------------------------------------");
 	
-	OstTraceFunctionExit1( RUSBTESTDEVICE_OPENL_EXIT, this );
 	}
 
 
 TInt RUsbTestDevice::SetClassCode(TUint8 aClassCode,TUint8 aSubClassCode,TUint8 aDeviceProtocol)
 	{
-    OstTraceFunctionEntryExt( RUSBTESTDEVICE_SETCLASSCODE_ENTRY, this );
+	LOG_FUNC
 
 	// Get Device descriptor
 	TBuf8<KUsbDescSize_Device> deviceDescriptor;
 	TInt err(iClientDriver.GetDeviceDescriptor(deviceDescriptor));
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETCLASSCODE, "<Error %d> Unable to obtain device descriptor",err);
+		RDebug::Printf("<Error %d> Unable to obtain device descriptor",err);
 		}
 	else
 		{
@@ -202,24 +188,23 @@
 		err = iClientDriver.SetDeviceDescriptor(deviceDescriptor);
 		if(err != KErrNone)
 			{
-			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETCLASSCODE_DUP01, "<Error %d> Unable to set the device dsecriptor",err);
+			RDebug::Printf("<Error %d> Unable to set the device dsecriptor",err);
 			}
 		}
-	OstTraceFunctionExitExt( RUSBTESTDEVICE_SETCLASSCODE_EXIT, this, err );
 	return err;
 	}
 
 
 TInt RUsbTestDevice::SetUsbSpecification(TUint16 aSpecification)
 	{
-    OstTraceFunctionEntryExt( RUSBTESTDEVICE_SETUSBSPECIFICATION_ENTRY, this );
+	LOG_FUNC
 
 	// Get Device descriptor
 	TBuf8<KUsbDescSize_Device> deviceDescriptor;
 	TInt err(iClientDriver.GetDeviceDescriptor(deviceDescriptor));
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETUSBSPECIFICATION, "<Error %d> Unable to obtain device descriptor",err);
+		RDebug::Printf("<Error %d> Unable to obtain device descriptor",err);
 		}
 	else
 		{
@@ -236,24 +221,23 @@
 		err = iClientDriver.SetDeviceDescriptor(deviceDescriptor);
 		if(err != KErrNone)
 			{
-			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETUSBSPECIFICATION_DUP01, "<Error %d> Unable to set the device dsecriptor",err);
+			RDebug::Printf("<Error %d> Unable to set the device dsecriptor",err);
 			}
 		}
-	OstTraceFunctionExitExt( RUSBTESTDEVICE_SETUSBSPECIFICATION_EXIT, this, err );
 	return err;
 	}
 
 
 TInt RUsbTestDevice::SetVendor(TUint16 aVendorId)
 	{
-    OstTraceFunctionEntryExt( RUSBTESTDEVICE_SETVENDOR_ENTRY, this );
+	LOG_FUNC
 
 	// Get Device descriptor
 	TBuf8<KUsbDescSize_Device> deviceDescriptor;
 	TInt err(iClientDriver.GetDeviceDescriptor(deviceDescriptor));
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETVENDOR, "<Error %d> Unable to obtain device descriptor",err);
+		RDebug::Printf("<Error %d> Unable to obtain device descriptor",err);
 		}
 	else
 		{
@@ -265,10 +249,9 @@
 		err = iClientDriver.SetDeviceDescriptor(deviceDescriptor);
 		if(err != KErrNone)
 			{
-			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETVENDOR_DUP01, "<Error %d> Unable to set the device descriptor",err);
+			RDebug::Printf("<Error %d> Unable to set the device descriptor",err);
 			}
 		}
-	OstTraceFunctionExitExt( RUSBTESTDEVICE_SETVENDOR_EXIT, this, err );
 	return err;
 	}
 
@@ -276,14 +259,14 @@
 TInt RUsbTestDevice::SetProduct(TUint16 aProductId,const TDesC16& aProductString,
 				const TDesC16& aManufacturerString,const TDesC16& aSerialNumberString)
 	{
-    OstTraceFunctionEntryExt( RUSBTESTDEVICE_SETPRODUCT_ENTRY, this );
+	LOG_FUNC
 
 	// Get Device descriptor
 	TBuf8<KUsbDescSize_Device> deviceDescriptor;
 	TInt err(iClientDriver.GetDeviceDescriptor(deviceDescriptor));
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETPRODUCT, "<Error %d> Unable to obtain device descriptor",err);
+		RDebug::Printf("<Error %d> Unable to obtain device descriptor",err);
 		}
 	else
 		{
@@ -295,19 +278,17 @@
 		err = iClientDriver.SetDeviceDescriptor(deviceDescriptor);
 		if(err != KErrNone)
 			{
-			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETPRODUCT_DUP01, "<Error %d> Unable to set the device dsecriptor",err);
-			OstTraceFunctionExitExt( RUSBTESTDEVICE_SETPRODUCT_EXIT, this, err );
+			RDebug::Printf("<Error %d> Unable to set the device dsecriptor",err);
 			return err;
 			}
 		
-		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_SETPRODUCT_DUP02, "Product Identity set");
+		RDebug::Printf("Product Identity set");
 	
 		// Product string
 		err = iClientDriver.SetProductStringDescriptor(aProductString);
 		if(err != KErrNone)
 			{
-			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETPRODUCT_DUP03, "<Error %d> Unable to set product string descriptor",err);
-			OstTraceFunctionExitExt( RUSBTESTDEVICE_SETPRODUCT_EXIT_DUP01, this, err );
+			RDebug::Printf("<Error %d> Unable to set product string descriptor",err);
 			return err;
 			}
 
@@ -315,8 +296,7 @@
 		err = iClientDriver.SetManufacturerStringDescriptor(aManufacturerString);
 		if(err != KErrNone)
 			{
-			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETPRODUCT_DUP04, "<Error %d> Unable to set the manufacturer string descriptor",err);
-			OstTraceFunctionExitExt( RUSBTESTDEVICE_SETPRODUCT_EXIT_DUP02, this, err );
+			RDebug::Printf("<Error %d> Unable to set the manufacturer string descriptor",err);
 			return err;
 			}
 	
@@ -324,61 +304,55 @@
 		err = iClientDriver.SetSerialNumberStringDescriptor(aSerialNumberString);
 		if(err != KErrNone)
 			{
-			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETPRODUCT_DUP05, "<Error %d> Unable to set the serial number string descriptor",err);
-			OstTraceFunctionExitExt( RUSBTESTDEVICE_SETPRODUCT_EXIT_DUP03, this, err );
+			RDebug::Printf("<Error %d> Unable to set the serial number string descriptor",err);
 			return err;
 			}
 		}
-	OstTraceFunctionExitExt( RUSBTESTDEVICE_SETPRODUCT_EXIT_DUP04, this, KErrNone );
 	return KErrNone;
 	}
 
 
 TInt RUsbTestDevice::SetConfigurationString(const TDesC16& aConfigString)
 	{
-    OstTraceFunctionEntryExt( RUSBTESTDEVICE_SETCONFIGURATIONSTRING_ENTRY, this );
+	LOG_FUNC
 
 	TInt err(iClientDriver.SetConfigurationStringDescriptor(aConfigString));
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETCONFIGURATIONSTRING, "<Error %d> Unable to set configuration string descriptor",err);
+		RDebug::Printf("<Error %d> Unable to set configuration string descriptor",err);
 		}
-	OstTraceFunctionExitExt( RUSBTESTDEVICE_SETCONFIGURATIONSTRING_EXIT, this, err );
 	return err;
 	}
 
 
 void RUsbTestDevice::AddInterface(CInterfaceBase* aInterface)
 	{
-	OstTraceFunctionEntryExt( RUSBTESTDEVICE_ADDINTERFACE_ENTRY, this );
+	LOG_FUNC
 		
 	// Add the interface to the device
 	TInt err = iInterfaces.Append(aInterface);
 	
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_ADDINTERFACE, "<Error %d> Unable to add interface",err);
+		RDebug::Printf("<Error %d> Unable to add interface",err);
 		return ReportError(err);
 		}
-	OstTraceFunctionExit1( RUSBTESTDEVICE_ADDINTERFACE_EXIT, this );
 	}
 
 
 CInterfaceBase& RUsbTestDevice::Interface(TInt aIndex)
 	{
-	OstTraceFunctionEntryExt( RUSBTESTDEVICE_INTERFACE_ENTRY, this );
-	OstTraceFunctionExit1( RUSBTESTDEVICE_INTERFACE_EXIT, this );
 	return *iInterfaces[aIndex];
 	}
 
 
 void RUsbTestDevice::SoftwareConnect()
 	{
-	OstTraceFunctionEntry1( RUSBTESTDEVICE_SOFTWARECONNECT_ENTRY, this );
+	LOG_FUNC
 	TInt err(iClientDriver.PowerUpUdc());
 	if((err != KErrNone) && (err != KErrNotReady))
 		{
-		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SOFTWARECONNECT, "<Error %d> Power Up Udc",err);
+		RDebug::Printf("<Error %d> Power Up Udc",err);
 		ReportError(err);
 		}
 		
@@ -387,63 +361,60 @@
 		err = iClientDriver.DeviceConnectToHost();
 		if(err != KErrNone)
 			{
-			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SOFTWARECONNECT_DUP01, "<Error %d> Unable to connect to the host",err);
+			RDebug::Printf("<Error %d> Unable to connect to the host",err);
 			ReportError(err);
 			}
 		}
 	else
 		{
-		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_SOFTWARECONNECT_DUP02, "Please connect device to Host");
+		RDebug::Printf("Please connect device to Host");
 		}	
-	OstTraceFunctionExit1( RUSBTESTDEVICE_SOFTWARECONNECT_EXIT, this );
 	}   	
 	 
 void RUsbTestDevice::SoftwareDisconnect()
 	{
-	OstTraceFunctionEntry1( RUSBTESTDEVICE_SOFTWAREDISCONNECT_ENTRY, this );
+	LOG_FUNC
 	
 	if(iDeviceCaps().iConnect) 
 		{
 		TInt err(iClientDriver.DeviceDisconnectFromHost());
 		if(err != KErrNone)
 			{
-			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SOFTWAREDISCONNECT, "<Error %d> Unable to disconnect from the host",err);
+			RDebug::Printf("<Error %d> Unable to disconnect from the host",err);
 			ReportError(err);
 			}
 		}
 	else
 		{
-		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_SOFTWAREDISCONNECT_DUP01, "Please disconnect device from Host");
+		RDebug::Printf("Please disconnect device from Host");
 		}
 		
-	OstTraceFunctionExit1( RUSBTESTDEVICE_SOFTWAREDISCONNECT_EXIT, this );
 	}       
 
 
 void RUsbTestDevice::RemoteWakeup()
 	{
-	OstTraceFunctionEntry1( RUSBTESTDEVICE_REMOTEWAKEUP_ENTRY, this );
+	LOG_FUNC
 	if(iDeviceCaps().iConnect) 
 		{
 		TInt err(iClientDriver.SignalRemoteWakeup());
 		if(err != KErrNone)
 			{
-			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_REMOTEWAKEUP, "<Error %d> Unable to perform a remote wakeup",err);
+			RDebug::Printf("<Error %d> Unable to perform a remote wakeup",err);
 			ReportError(err);
 			}
 		}
 	else
 		{
-		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_REMOTEWAKEUP_DUP01, "remote wakeup not supported");
+		RDebug::Printf("remote wakeup not supported");
 		}
-	OstTraceFunctionExit1( RUSBTESTDEVICE_REMOTEWAKEUP_EXIT, this );
 	}
 
 
 TInt RUsbTestDevice::ProcessRequestL(TUint8 aRequest,TUint16 aValue,TUint16 aIndex,
 	TUint16 aDataReqLength,const TDesC8& aPayload)
 	{
-	OstTraceFunctionEntryExt( RUSBTESTDEVICE_PROCESSREQUESTL_ENTRY, this );
+	LOG_FUNC
 	
 	if(aRequest == KVendorEmptyRequest)
 		{
@@ -460,7 +431,7 @@
 		}
 	else if(aRequest == KVendorDisconnectDeviceAThenConnectDeviceCRequest)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL, "**aRequest == KVendorDisconnectDeviceAThenConnectDeviceCRequest, this = 0x%08x", this);
+		RDebug::Printf("**aRequest == KVendorDisconnectDeviceAThenConnectDeviceCRequest, this = 0x%08x", this);
 		// Handle a reconnect requests from the host		
 		AcknowledgeRequestReceived();			
 		
@@ -474,12 +445,11 @@
 		iTestCaseT_USBDI_0486->TestDeviceC()->OpenL(KTestDeviceC_SN);		
 		// Connect the device to the host	
 		iTestCaseT_USBDI_0486->TestDeviceC()->SoftwareConnect();
-		OstTraceFunctionExitExt( RUSBTESTDEVICE_PROCESSREQUESTL_EXIT, this, KErrAbort );
 		return KErrAbort;
 		}
 	else if(aRequest == KVendorDisconnectDeviceCThenConnectDeviceARequest)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP01, "**aRequest == KVendorDisconnectDeviceCThenConnectDeviceARequest, this = 0x%08x", this);
+		RDebug::Printf("**aRequest == KVendorDisconnectDeviceCThenConnectDeviceARequest, this = 0x%08x", this);
 		// Handle a reconnect requests from the host		
 		AcknowledgeRequestReceived();		
 		 
@@ -498,7 +468,6 @@
 		
 		// Connect the device to the host	
 		iTestCaseT_USBDI_0486->TestDeviceD()->SoftwareConnect();	
-		OstTraceFunctionExitExt( RUSBTESTDEVICE_PROCESSREQUESTL_EXIT_DUP01, this, KErrAbort );
 		return KErrAbort;
 		}		
 	else if(aRequest == KVendorTestCasePassed)
@@ -518,7 +487,7 @@
 		
 		HBufC16* msg = HBufC16::NewL(aPayload.Length());
 		msg->Des().Copy(aPayload);
-		OstTraceExt1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP02, "<Host> Test case failed: %S",*msg);
+		RDebug::Printf("<Host> Test case failed: %S",msg);
 		delete msg;
 		msg = 0;
 		ReportError(-aValue);
@@ -535,10 +504,10 @@
 		// Handle a payload request from the host
 
 		AcknowledgeRequestReceived();
-		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP03, "Put payload");
+		RDebug::Printf("Put payload");
 		if(aPayload.Compare(_L8("DEADBEEF")) != 0)
 			{
-			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP04, "<Error %d> Payload not as expected",KErrCorrupt);
+			RDebug::Printf("<Error %d> Payload not as expected",KErrCorrupt);
 			ReportError(KErrCorrupt);
 			}
 		}
@@ -546,46 +515,45 @@
 		{
 		// Handle a payload request to the host
 
-		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP05, "Get payload");
+		RDebug::Printf("Get payload");
 		__ASSERT_DEBUG(iAuxBuffer, User::Panic(_L("Trying to write non-allocated buffer"), KErrGeneral));
-		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP06, "iAuxBuffer = ....");
-        OstTraceData(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP56, "", iAuxBuffer->Ptr(), iAuxBuffer->Length());
-		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP07, "\n");
+		RDebug::Printf("iAuxBuffer = ....");
+		RDebug::RawPrint(*iAuxBuffer);
+		RDebug::Printf("\n");
 		
 		//Perform synchronous write to EP0
 		//This allows the subsequent 'Read' request to
 		//take place
 		TInt ret = iDeviceEp0->SendDataSynchronous(*iAuxBuffer);
-		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP08, "Write (from device callback) executed with error %d", ret);
+		RDebug::Printf("Write (from device callback) executed with error %d", ret);
 		}
 	else if(aRequest == KVendorUnrespondRequest)
 		{
 		// Do not acknowledge this request
 		
-		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP09, "Unrespond request: continually NAK the host");
+		RDebug::Printf("Unrespond request: continually NAK the host");
 		}
 	else if(aRequest == KVendorStallRequest)
 		{
 		// Stall the specified endpoint
 		
 		AcknowledgeRequestReceived();
-		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP10, "Stalling endpoint %d",aValue);
+		RDebug::Printf("Stalling endpoint %d",aValue);
 						
 		}
 	else
 		{
 		// Maybe forward to derived classes
 		}
-	OstTraceFunctionExitExt( RUSBTESTDEVICE_PROCESSREQUESTL_EXIT_DUP02, this, KErrNone );
 	return KErrNone;
 	}
 
 
 void RUsbTestDevice::StateChangeL(TUsbcDeviceState aNewState,TInt aChangeCompletionCode)
 	{
-	OstTraceFunctionEntryExt( RUSBTESTDEVICE_STATECHANGEL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTraceExt2(TRACE_NORMAL, RUSBTESTDEVICE_STATECHANGEL, "Client state change to %d err=%d",aNewState,aChangeCompletionCode);
+	RDebug::Printf("Client state change to %d err=%d",aNewState,aChangeCompletionCode);
 	
 	// Notify the test case of failed state change notification
 	
@@ -609,7 +577,7 @@
 			// The is a state change from EUsbcDeviceStateConfigured to aNewState
 			// so stop reading from control ep0
 			
-			OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_STATECHANGEL_DUP01, "Ignoring control ep0");
+			RDebug::Printf("Ignoring control ep0");
 			
 			// Stop reading ep0 directed requests
 			
@@ -629,7 +597,7 @@
 			// Device has now been placed into a fully configured state by the host
 			// so start reading from control ep0
 			
-			OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_STATECHANGEL_DUP02, "Reading from control ep0");
+			RDebug::Printf("Reading from control ep0");
 			
 			// Start reading ep0 directed requests
 			
@@ -650,13 +618,12 @@
 	// Forward the state change notification to derived classes
 	
 	OnStateChangeL(aNewState);
-	OstTraceFunctionExit1( RUSBTESTDEVICE_STATECHANGEL_EXIT, this );
 	}
 	
 
 void RUsbTestDevice::StartEp0Reading()
 	{
-    OstTraceFunctionEntry1( RUSBTESTDEVICE_STARTEP0READING_ENTRY, this );
+	LOG_FUNC
 
 	// Start reading device directed ep0 requests
 	
@@ -673,13 +640,12 @@
 		{
 		iInterfaces[i]->StartEp0Reading();
 		}
-	OstTraceFunctionExit1( RUSBTESTDEVICE_STARTEP0READING_EXIT, this );
 	}
 
 
 void RUsbTestDevice::StopEp0Reading()
 	{
-    OstTraceFunctionEntry1( RUSBTESTDEVICE_STOPEP0READING_ENTRY, this );
+	LOG_FUNC
 
 	// Stop reading interface directed requests
 	
@@ -696,36 +662,33 @@
 		{
 		return ReportError(err);
 		}
-	OstTraceFunctionExit1( RUSBTESTDEVICE_STOPEP0READING_EXIT, this );
 	}
 
 
 void RUsbTestDevice::AcknowledgeRequestReceived()
 	{
-	OstTraceFunctionEntry1( RUSBTESTDEVICE_ACKNOWLEDGEREQUESTRECEIVED_ENTRY, this );
+	LOG_FUNC
 	
 	TInt err(iDeviceEp0->Reader().Acknowledge());
-	OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_ACKNOWLEDGEREQUESTRECEIVED, "err = %d",err);
+	RDebug::Printf("err = %d",err);
 	if(err != KErrNone)
 		{
 		ReportError(err);
 		}
-	OstTraceFunctionExit1( RUSBTESTDEVICE_ACKNOWLEDGEREQUESTRECEIVED_EXIT, this );
 	}
 
 
 
 void RUsbTestDevice::ReportError(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( RUSBTESTDEVICE_REPORTERROR_ENTRY, this );
-	OstTraceExt3(TRACE_NORMAL, RUSBTESTDEVICE_REPORTERROR, "err or aCompletionCode = %d, observer status = %d, KRequestPending = %d",
+	LOG_FUNC
+	RDebug::Printf("err or aCompletionCode = %d, observer status = %d, KRequestPending = %d",
 			aCompletionCode, iObserverStatus->Int(), KRequestPending);
 	if(*iObserverStatus == KRequestPending)
 		{
-		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_REPORTERROR_DUP01, "In complete request");
+		RDebug::Printf("In complete request");
 		User::RequestComplete(iObserverStatus,aCompletionCode);
 		}
-	OstTraceFunctionExit1( RUSBTESTDEVICE_REPORTERROR_EXIT, this );
 	}
 	
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/TestEngine.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/TestEngine.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -20,10 +20,6 @@
 #include "testdebug.h"
 #include "TestCaseController.h"
 #include "TestCaseFactory.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "TestEngineTraces.h"
-#endif
 
 // Console application options
 
@@ -47,12 +43,10 @@
 	
 CTestEngine* CTestEngine::NewL()
 	{
-	OstTraceFunctionEntry0( CTESTENGINE_NEWL_ENTRY );
 	CTestEngine* self = new (ELeave) CTestEngine;
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CTESTENGINE_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 
@@ -62,15 +56,12 @@
 :	CActive(EPriorityUserInput),
 	iTestCaseIndex(0), iRepeat(0), iNumRepeats(KDefaultNumRepeats)
 	{
-	OstTraceFunctionEntry1( CTESTENGINE_CTESTENGINE_ENTRY, this );
-	OstTraceFunctionExit1( CTESTENGINE_CTESTENGINE_EXIT, this );
 	}
 
 
 
 CTestEngine::~CTestEngine()
 	{
-	OstTraceFunctionEntry1( CTESTENGINE_CTESTENGINE_ENTRY_DUP01, this );
 	// Cancel reading user console input
 	Cancel();
 	
@@ -83,25 +74,21 @@
 	// Finish test and release resources
 	gtest.End();
 	gtest.Close();
-	OstTraceFunctionExit1( CTESTENGINE_CTESTENGINE_EXIT_DUP01, this );
 	}
 	
 	
 	
 void CTestEngine::ConstructL()
 	{
-	OstTraceFunctionEntry1( CTESTENGINE_CONSTRUCTL_ENTRY, this );
+	LOG_FUNC
 	CActiveScheduler::Add(this);
 
 	// Display information (construction text and OS build version number
 	gtest.Title();
 	gtest.Start(_L("Test Engine Initiation"));
 	gtest.Printf(_L(">>\n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL, ">>\n");
 	gtest.Printf(_L(">>   T E S T   R U N \n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP01, ">>   T E S T   R U N \n");
 	gtest.Printf(_L(">>\n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP02, ">>\n");
 
 	// Process the command line option for role
 	TInt cmdLineLength(User::CommandLineLength());
@@ -112,7 +99,6 @@
 	
 	// be careful, command line length is limited(248 characters)	
 	gtest.Printf(_L("***cmdLine = %lS\n"), cmdLine);
-	OstTraceExt1(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP03, "***cmdLine = %lS\n", *cmdLine);
 		
 	TLex args(*cmdLine);
 	args.SkipSpace();
@@ -137,14 +123,12 @@
 		else
 			{
 			gtest.Printf(_L("Test configuration: could not find option -role\n"));
-			OstTrace0(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP04, "Test configuration: could not find option -role\n");
 			gtest(EFalse);
 			}
 		}
 	else
 		{
 		gtest.Printf(_L("Test configuration option not found: %S\n"),&KArgRole);
-		OstTraceExt1(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP05, "Test configuration option not found: %S\n",KArgRole);
 		gtest(EFalse);
 		}
 		
@@ -177,7 +161,6 @@
 				}									
 							
 			gtest.Printf(_L("Test case specified: %S\n"),tc);
-			OstTraceExt1(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP06, "Test case specified: %S\n",*tc);
 			
 						
 			iTestCasesIdentities.Append(tc);
@@ -188,7 +171,6 @@
 	else
 		{
 		gtest.Printf(_L("Test configuration option not found: %S\n"),&KArgTestCases);
-		OstTraceExt1(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP07, "Test configuration option not found: %S\n",KArgTestCases());
 		gtest(EFalse);		
 		}
 				
@@ -205,39 +187,32 @@
 		if(ret)
 			{
 			gtest.Printf(_L("Test configuration option not found: %S\n"),&KArgTestRepeats);
-			OstTraceExt1(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP08, "Test configuration option not found: %S\n",KArgTestRepeats());
 			gtest.Printf(_L("DEFAULT to number of repeats = %d\n"),KDefaultNumRepeats);
-			OstTrace1(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP09, "DEFAULT to number of repeats = %d\n",KDefaultNumRepeats);
 			iNumRepeats = KDefaultNumRepeats;
 			}
 		gtest.Printf(_L("Test repeats specified: %d cycles\n"),iNumRepeats);
-		OstTrace1(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP10, "Test repeats specified: %d cycles\n",iNumRepeats);
 		}
 	else
 		{
 		gtest.Printf(_L("Test configuration option not found: %S\n"),&KArgTestRepeats);
-		OstTraceExt1(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP11, "Test configuration option not found: %S\n",KArgTestRepeats());
 		gtest.Printf(_L("DEFAULT to number of repeats = %d\n"),KDefaultNumRepeats);
-		OstTrace1(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP12, "DEFAULT to number of repeats = %d\n",KDefaultNumRepeats);
 		iNumRepeats = KDefaultNumRepeats;
 		}
 		
 	// Create the test case controller
 	gtest.Printf(_L("Creating the test controller\n"));
-	OstTrace0(TRACE_NORMAL, CTESTENGINE_CONSTRUCTL_DUP13, "Creating the test controller\n");
 	iTestCaseController = CTestCaseController::NewL(*this,hostFlag);
 
 	CleanupStack::PopAndDestroy(cmdLine);
 
 	gtest.Console()->Read(iStatus);
 	SetActive();	
-	OstTraceFunctionExit1( CTESTENGINE_CONSTRUCTL_EXIT, this );
 	}
 	
 
 TInt CTestEngine::NextTestCaseId(TDes& aTestCaseId)
 	{
-	OstTraceFunctionEntryExt( CTESTENGINE_NEXTTESTCASEID_ENTRY, this );
+	LOG_FUNC
 	if(iTestCaseIndex < iTestCasesIdentities.Count())
 		{
 		aTestCaseId = *iTestCasesIdentities[iTestCaseIndex++];
@@ -249,41 +224,34 @@
 				iTestCaseIndex = 0; //prepare to start again
 				}
 			}
-		OstTraceFunctionExitExt( CTESTENGINE_NEXTTESTCASEID_EXIT, this, KErrNone );
 		return KErrNone;
 		}
 	else
 		{
-		OstTraceFunctionExitExt( CTESTENGINE_NEXTTESTCASEID_EXIT_DUP01, this, KErrNotFound );
 		return KErrNotFound;
 		}
 	}
 
 RPointerArray<HBufC>& CTestEngine::TestCasesIdentities()
 	{
-	OstTraceFunctionEntry1( CTESTENGINE_TESTCASESIDENTITIES_ENTRY, this );
-	OstTraceFunctionExitExt( CTESTENGINE_TESTCASESIDENTITIES_EXIT, this, ( TUint )&( iTestCasesIdentities ) );
 	return iTestCasesIdentities;
 	}
 
 TUint CTestEngine::NumRepeats()
 	{
-	OstTraceFunctionEntry1( CTESTENGINE_NUMREPEATS_ENTRY, this );
-	OstTraceFunctionExitExt( CTESTENGINE_NUMREPEATS_EXIT, this, iNumRepeats );
 	return iNumRepeats;
 	}
 
 void CTestEngine::DoCancel()
 	{
-	OstTraceFunctionEntry1( CTESTENGINE_DOCANCEL_ENTRY, this );
+	LOG_FUNC
 	gtest.Console()->ReadCancel();	
-	OstTraceFunctionExit1( CTESTENGINE_DOCANCEL_EXIT, this );
 	}
 	
 
 void CTestEngine::RunL()
 	{
-	OstTraceFunctionEntry1( CTESTENGINE_RUNL_ENTRY, this );
+	LOG_FUNC
 	TInt completionCode(iStatus.Int());
 	
 	if(completionCode == KErrNone)
@@ -296,30 +264,24 @@
 			{
 			iTestCaseController->Cancel();
 			gtest.Printf(_L("Test module terminating\n"));
-			OstTrace0(TRACE_NORMAL, CTESTENGINE_RUNL, "Test module terminating\n");
-			OstTrace0(TRACE_NORMAL, CTESTENGINE_RUNL_DUP01, "CActiveScheduler::Stop CTestEngine::RunL");
+			RDebug::Printf("CActiveScheduler::Stop CTestEngine::RunL");
 			CActiveScheduler::Stop();
 			}
 		else
 			{
 			gtest.Printf(_L("%d key pressed"),keyCode);
-			OstTrace1(TRACE_NORMAL, CTESTENGINE_RUNL_DUP02, "%d key pressed",keyCode);
 			}
 		}
 	else
 		{
 		gtest.Printf(_L("Manual key error %d\n"),completionCode);
-		OstTrace1(TRACE_NORMAL, CTESTENGINE_RUNL_DUP03, "Manual key error %d\n",completionCode);
 		SetActive();
 		}
-	OstTraceFunctionExit1( CTESTENGINE_RUNL_EXIT, this );
 	}
 	
 	
 TInt CTestEngine::RunError(TInt aError)
 	{
-	OstTraceFunctionEntryExt( CTESTENGINE_RUNERROR_ENTRY, this );
-	OstTraceFunctionExitExt( CTESTENGINE_RUNERROR_EXIT, this, KErrNone );
 	return KErrNone;
 	}
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/TestInterfaceBase.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/TestInterfaceBase.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -22,10 +22,6 @@
 #include "testdebug.h"
 #include "controltransferrequests.h"
 #include "endpointwriter.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "TestInterfaceBaseTraces.h"
-#endif
 
 
 namespace NUnitTesting_USBDI
@@ -37,13 +33,11 @@
 	iInterfaceName(aName),
 	iCurrentAlternateInterfaceSetting(0) // The default alternate interface setting will be zero when opened
 	{
-	OstTraceFunctionEntryExt( CINTERFACEBASE_CINTERFACEBASE_ENTRY, this );
-	OstTraceFunctionExit1( CINTERFACEBASE_CINTERFACEBASE_EXIT, this );
 	}
 	
 CInterfaceBase::~CInterfaceBase()
 	{
-	OstTraceFunctionEntry1( CINTERFACEBASE_CINTERFACEBASE_ENTRY_DUP01, this );
+	LOG_FUNC
 	
 	delete iAuxBuffer;
 	delete iStallWatcher;
@@ -60,18 +54,17 @@
 	
 	// Close the channel to the driver
 	iClientDriver.Close();
-	OstTraceFunctionExit1( CINTERFACEBASE_CINTERFACEBASE_EXIT_DUP01, this );
 	}
 	
 	
 void CInterfaceBase::BaseConstructL()
 	{
-	OstTraceFunctionEntry1( CINTERFACEBASE_BASECONSTRUCTL_ENTRY, this );
+	LOG_FUNC
 	// Open channel to driver
 	TInt err(iClientDriver.Open(0));
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CINTERFACEBASE_BASECONSTRUCTL, "<Error %d> Unable to open a channel to USB client driver",err);
+		RDebug::Printf("<Error %d> Unable to open a channel to USB client driver",err);
 		User::Leave(err);
 		}
 
@@ -87,19 +80,18 @@
 
 	// Hide bus from host while interfaces are being set up
 	iClientDriver.DeviceDisconnectFromHost();
-	OstTraceFunctionExit1( CINTERFACEBASE_BASECONSTRUCTL_EXIT, this );
 	}
 
 
 void CInterfaceBase::AddInterfaceSettingL(CInterfaceSettingBase* aInterfaceSetting)
 	{
-	OstTraceFunctionEntryExt( CINTERFACEBASE_ADDINTERFACESETTINGL_ENTRY, this );
+	LOG_FUNC
 	
 	// Append to the container
 	TInt err(iAlternateSettings.Append(aInterfaceSetting));
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL, "<Error %d> Unable to add interface setting",err);
+		RDebug::Printf("<Error %d> Unable to add interface setting",err);
 		User::Leave(err);
 		}
 	
@@ -110,14 +102,14 @@
 	
 	if(endpointSettingCount > 0)
 		{
-		OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP01, "%u endpoint(s) to configure for this interface setting",endpointSettingCount);
+		RDebug::Printf("%u endpoint(s) to configure for this interface setting",endpointSettingCount);
 				
 		// Device capabilities
 		TUsbDeviceCaps devCaps;
 		err = iClientDriver.DeviceCaps(devCaps);
 		if(err != KErrNone)
 			{
-			OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP02, "<Error %d> Unable to retrieve device capabilities",err);
+			RDebug::Printf("<Error %d> Unable to retrieve device capabilities",err);
 			User::Leave(err);
 			}
 
@@ -127,7 +119,7 @@
 		err = iClientDriver.EndpointCaps(dataptr);
 		if(err != KErrNone)
 			{
-			OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP03, "<Error %d> Unable to get endpoint capabilities",err);
+			RDebug::Printf("<Error %d> Unable to get endpoint capabilities",err);
 			User::Leave(err);
 			}		
 		
@@ -141,13 +133,13 @@
 		
 		for(; epIndex<totalEndpoints; epIndex++)
 			{
-			OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP04, "Examining hardware endpoint %u",epIndex);
+			RDebug::Printf("Examining hardware endpoint %u",epIndex);
 			const TUsbcEndpointData ep = endpointCaps[epIndex];
 			
 			// Check the endpoint index to see if already claimed
 			if(!ep.iInUse)
 				{			
-				OstTrace0(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP05, "...its free");
+				RDebug::Printf("...its free");
 				const TUsbcEndpointCaps caps(ep.iCaps);
 				
 				// Information about the endpoint we are looking for	
@@ -165,18 +157,18 @@
 						// Create an endpoint writer for this endpoint
 						
 						aInterfaceSetting->CreateEndpointWriterL(iClientDriver,(epCount+1));
-						OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP06, "Created endpoint writer for endpoint%d",epCount+1);
+						RDebug::Printf("Created endpoint writer for endpoint%d",epCount+1);
 						}
 					else if(endpointSpec.iDir == KUsbEpDirOut)
 						{
 						// Create an endpoint reader for this endpoint
 												
 						aInterfaceSetting->CreateEndpointReaderL(iClientDriver,epCount+1);
-						OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP07, "Created endpoint reader for endpoint%d",epCount+1);
+						RDebug::Printf("Created endpoint reader for endpoint%d",epCount+1);
 						}					
 					
 					epCount++; // Increment to next endpoint spec
-					OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP08, "Endpoint %u configured",epCount);
+					RDebug::Printf("Endpoint %u configured",epCount);
 					endpointSpec.iSize = caps.MaxPacketSize();
 					
 					if(epCount >= endpointSettingCount)
@@ -188,107 +180,98 @@
 				}
 			else
 				{
-				OstTrace0(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP09, "...its busy");
+				RDebug::Printf("...its busy");
 				}
 			}
 		
-		OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP10, "Configure %u out of %u endpoints",epCount,endpointSettingCount);			
+		RDebug::Printf("Configure %u out of %u endpoints",epCount,endpointSettingCount);			
 		
 		if(epCount < endpointSettingCount)
 			{
-			OstTraceExt3(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP11, "<Error %d> Only managed to configure %u out of %u endpoints",KErrNotFound,epCount,endpointSettingCount);
+			RDebug::Printf("<Error %d> Only managed to configure %u out of %u endpoints",KErrNotFound,epCount,endpointSettingCount);
 			User::Leave(KErrNotFound);
 			}			
 		}
 	else
 		{
-		OstTrace0(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP12, "No endpoints for this interface setting");
+		RDebug::Printf("No endpoints for this interface setting");
 		}
 	
 	// Add the new setting to the device
 	err = iClientDriver.SetInterface(alternateSettingNumber,aInterfaceSetting->iInterfaceInfo);
 	if(err != KErrNone)
 		{
-		OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP13, "<Error %d> Unable to set the alternate interface setting %d",err,alternateSettingNumber);
+		RDebug::Printf("<Error %d> Unable to set the alternate interface setting %d",err,alternateSettingNumber);
 		User::Leave(err);
 		}
 	
-	OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP14, "Alternate interface setting %d set",alternateSettingNumber);
-	OstTraceFunctionExit1( CINTERFACEBASE_ADDINTERFACESETTINGL_EXIT, this );
+	RDebug::Printf("Alternate interface setting %d set",alternateSettingNumber);
 	}
 
 
 TInt CInterfaceBase::StallEndpoint(TUint16 aEndpointNumber)
 	{
-	OstTraceFunctionEntryExt( CINTERFACEBASE_STALLENDPOINT_ENTRY, this );
+	LOG_FUNC
 	
-	OstTrace1(TRACE_NORMAL, CINTERFACEBASE_STALLENDPOINT, "Stalling endpoint%d",aEndpointNumber);
+	RDebug::Printf("Stalling endpoint%d",aEndpointNumber);
 	return iClientDriver.HaltEndpoint(static_cast<TEndpointNumber>(aEndpointNumber));
 	}
 
 	
 CInterfaceSettingBase& CInterfaceBase::AlternateSetting(TInt aSettingNumber) const
 	{
-	OstTraceFunctionEntryExt( CINTERFACEBASE_ALTERNATESETTING_ENTRY, this );
-	OstTraceFunctionExit1( CINTERFACEBASE_ALTERNATESETTING_EXIT, this );
 	return *iAlternateSettings[aSettingNumber];
 	}
 
 	
 TInt CInterfaceBase::InterfaceSettingCount() const
 	{
-	OstTraceFunctionEntry1( CINTERFACEBASE_INTERFACESETTINGCOUNT_ENTRY, this );
 	return iAlternateSettings.Count();
 	}
 
 
 TUint32 CInterfaceBase::ExtractNumberL(const TDesC8& aPayload)
 	{
-OstTraceFunctionEntryExt( CINTERFACEBASE_EXTRACTNUMBERL_ENTRY, this );
+	LOG_FUNC
 
 	// Read the number of repeats and the data supplied by the host, on the specified endpoint
 	TLex8 lex(aPayload.Left(KNumberStringLength));
 	TUint32 numBytes;
 	User::LeaveIfError(lex.Val(numBytes, EDecimal));
-	OstTrace1(TRACE_NORMAL, CINTERFACEBASE_EXTRACTNUMBERL, "Writing %d bytes using string pattern below to IN endpoint",numBytes);
-	const TPtrC8& midPayload = aPayload.Mid(KNumberStringLength);
-    OstTraceData(TRACE_NORMAL, CINTERFACEBASE_EXTRACTNUMBERL_DUP50, "", midPayload.Ptr(), midPayload.Length());
-	OstTrace0(TRACE_NORMAL, CINTERFACEBASE_EXTRACTNUMBERL_DUP01, "");
-	OstTraceFunctionExitExt( CINTERFACEBASE_EXTRACTNUMBERL_EXIT, this, ( TUint )( numBytes ) );
+	RDebug::Printf("Writing %d bytes using string pattern below to IN endpoint",numBytes);
+	RDebug::RawPrint(aPayload.Mid(KNumberStringLength));
+	RDebug::Printf(""); //new line
 	return numBytes;
 	}
 
 void CInterfaceBase::ExtractTwoNumbersL(const TDesC8& aPayload, TUint32& aFirstNum, TUint32& aSecondNum)
 	{
-OstTraceFunctionEntryExt( CINTERFACEBASE_EXTRACTTWONUMBERSL_ENTRY, this );
+	LOG_FUNC
 
 	// Read the number of repeats and the data supplied by the host, on the specified endpoint
 	TLex8 lex1(aPayload.Left(KNumberStringLength));
 	User::LeaveIfError(lex1.Val(aFirstNum, EDecimal));
 	TLex8 lex2(aPayload.Mid(KNumberStringLength, KNumberStringLength));
 	User::LeaveIfError(lex2.Val(aSecondNum, EDecimal));
-	OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_EXTRACTTWONUMBERSL, "Writing or Reading a total of %d bytes in repeats of %d bytes using string pattern below to IN endpoint",aFirstNum,aSecondNum);
-	const TPtrC8& midPayload = aPayload.Mid(2*KNumberStringLength);
-    OstTraceData(TRACE_NORMAL, CINTERFACEBASE_EXTRACTTWONUMBERSL_DUP50, "", midPayload.Ptr(), midPayload.Length());
-	OstTrace0(TRACE_NORMAL, CINTERFACEBASE_EXTRACTTWONUMBERSL_DUP01, "");
-	OstTraceFunctionExit1( CINTERFACEBASE_EXTRACTTWONUMBERSL_EXIT, this );
+	RDebug::Printf("Writing or Reading a total of %d bytes in repeats of %d bytes using string pattern below to IN endpoint",aFirstNum,aSecondNum);
+	RDebug::RawPrint(aPayload.Mid(2*KNumberStringLength));
+	RDebug::Printf(""); //new line
 	return;
 	}
 
 void CInterfaceBase::AlternateInterfaceSelectedL(TInt aAlternateInterfaceSetting)
 	{
-	OstTraceFunctionEntryExt( CINTERFACEBASE_ALTERNATEINTERFACESELECTEDL_ENTRY, this );
-	OstTraceExt1(TRACE_NORMAL, CINTERFACEBASE_ALTERNATEINTERFACESELECTEDL, "Interface %S:",iInterfaceName);	
+	LOG_FUNC
+	RDebug::Printf("Interface %S:",&iInterfaceName);	
 	iCurrentAlternateInterfaceSetting = aAlternateInterfaceSetting;
-	OstTraceFunctionExit1( CINTERFACEBASE_ALTERNATEINTERFACESELECTEDL_EXIT, this );
 	}
 
 
 TInt CInterfaceBase::ProcessRequestL(TUint8 aRequest,TUint16 aValue,TUint16 aIndex,
 	TUint16 aDataReqLength,const TDesC8& aPayload)
 	{
-	OstTraceFunctionEntryExt( CINTERFACEBASE_PROCESSREQUESTL_ENTRY, this );
-	OstTraceExt1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL, "Interface %S:",iInterfaceName);
+	LOG_FUNC
+	RDebug::Printf("Interface %S:",&iInterfaceName);
 	
 	switch(aRequest)
 		{
@@ -296,34 +279,34 @@
 			// Acknowledge the request and do nothing
 			iEp0Reader->Acknowledge();
 			
-			OstTrace0(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP01, "Request: Empty");
+			RDebug::Printf("Request: Empty");
 			break;
 			
 		case KVendorPutPayloadRequest:
 			// Acknowledge the request
 			iEp0Reader->Acknowledge();
 			
-			OstTrace0(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP02, "Put payload");
+			RDebug::Printf("Put payload");
 			if(aPayload.Compare(_L8("DEADBEEF")) != 0)
 				{
-				OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP03, "<Error %d> Payload not as expected",KErrCorrupt);
+				RDebug::Printf("<Error %d> Payload not as expected",KErrCorrupt);
 				iDevice.ReportError(KErrCorrupt);
 				}
 			break;
 			
 		case KVendorGetPayloadRequest:
 			{
-			OstTrace0(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP04, "Get payload");
+			RDebug::Printf("Get payload");
 			__ASSERT_DEBUG(iAuxBuffer, User::Panic(_L("Trying to write non-allocated buffer"), KErrGeneral));
-			OstTrace0(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP05, "iAuxBuffer = ....");
-            OstTraceData(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP55, "", iAuxBuffer->Ptr(), iAuxBuffer->Length());
-			OstTrace0(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP06, "\n");
+			RDebug::Printf("iAuxBuffer = ....");
+			RDebug::RawPrint(*iAuxBuffer);
+			RDebug::Printf("\n");
 			
 			//Perform synchronous write to EP0
 			//This allows the subsequent 'Read' request to
 			//take place
 			TInt ret = iEp0Writer->WriteSynchronous(*iAuxBuffer, ETrue);
-			OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP07, "Write (from interface callback) executed with error %d", ret);
+			RDebug::Printf("Write (from interface callback) executed with error %d", ret);
 			}
 			break;
 			
@@ -341,7 +324,7 @@
 			//This allows the subsequent 'Read' request to
 			//take place
 			TInt ret = iEp0Writer->WriteSynchronous(*iAuxBuffer, ETrue);
-			OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP08, "Write (from interface callback) executed with error %d", ret);
+			RDebug::Printf("Write (from interface callback) executed with error %d", ret);
 			}
 			break;
 			
@@ -359,7 +342,7 @@
 			//This allows the subsequent 'Read' request to
 			//take place
 			TInt ret = iEp0Writer->WriteSynchronous(*iAuxBuffer, ETrue);
-			OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP09, "Write (from interface callback) executed with error %d", ret);
+			RDebug::Printf("Write (from interface callback) executed with error %d", ret);
 			}
 			break;
 			
@@ -367,7 +350,7 @@
 			// Acknowledge the request
 			iEp0Reader->Acknowledge();
 			
-			OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP10, "Writing %d bytes to IN endpoint (index %d)",aPayload.Length(),aValue);
+			RDebug::Printf("Writing %d bytes to IN endpoint (index %d)",aPayload.Length(),aValue);
 			
 			// Write the data supplied by the host, back to the host though the specified endpoint
 			
@@ -378,7 +361,7 @@
 			// Acknowledge the request
 			iEp0Reader->Acknowledge();
 			
-			OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP11, "CANCEL Writing to IN endpoint (index %d)",aValue);
+			RDebug::Printf("CANCEL Writing to IN endpoint (index %d)",aValue);
 			
 			// CANCEL writing the data supplied by the host, back to the host though the specified endpoint
 			
@@ -433,7 +416,7 @@
 			TUint32 numBytesPerRead = 0;
 			TUint32 totalNumBytes = 0;
 			ExtractTwoNumbersL(aPayload, numBytesPerRead, totalNumBytes);
-			OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP12, "Extracted: Number of Bytes per Read = %d, Total Number of Bytes = %d",numBytesPerRead,totalNumBytes);
+			RDebug::Printf("Extracted: Number of Bytes per Read = %d, Total Number of Bytes = %d",numBytesPerRead,totalNumBytes);
 			
 			// Write the data supplied by the host, back to the host though the specified endpoint
 			AlternateSetting(iCurrentAlternateInterfaceSetting).RepeatedReadAndValidateFromEndpointL(aPayload.Mid(KTwoNumberStringLength),numBytesPerRead,totalNumBytes,aValue);
@@ -449,7 +432,7 @@
 			TUint32 numBytesPerWrite = 0;
 			TUint32 totalNumBytes = 0;
 			ExtractTwoNumbersL(aPayload, numBytesPerWrite, totalNumBytes);
-			OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP13, "Extracted: Number of Bytes per Read = %d, Total Number of Bytes = %d",numBytesPerWrite,totalNumBytes);
+			RDebug::Printf("Extracted: Number of Bytes per Read = %d, Total Number of Bytes = %d",numBytesPerWrite,totalNumBytes);
 			
 			// Write the data supplied by the host, back to the host though the specified endpoint
 			AlternateSetting(iCurrentAlternateInterfaceSetting).RepeatedWriteSpecifiedDataToEndpointL(aPayload.Mid(KTwoNumberStringLength),numBytesPerWrite,totalNumBytes,aValue);
@@ -464,7 +447,7 @@
 			TUint16 readEndpoint = aValue >> 8; //HI 8 buts
 			TUint16 writeEndpoint = aValue & 0x00ff; //LO 8 bits
 			
-			OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP14, "Writing data cached on OUT endpoint (index %d) to IN endpoint (index %d)",readEndpoint,writeEndpoint);
+			RDebug::Printf("Writing data cached on OUT endpoint (index %d) to IN endpoint (index %d)",readEndpoint,writeEndpoint);
 			
 			// Write the data supplied by the host, back to the host though the specified endpoint
 			
@@ -480,7 +463,7 @@
 			TUint16 readEndpoint = aValue >> 8; //HI 8 buts
 			TUint16 writeEndpoint = aValue & 0x00ff; //LO 8 bits
 			
-			OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP15, "Writing data cached on OUT endpoint (index %d) to IN endpoint (index %d)",readEndpoint,writeEndpoint);
+			RDebug::Printf("Writing data cached on OUT endpoint (index %d) to IN endpoint (index %d)",readEndpoint,writeEndpoint);
 			
 			// Write the data supplied by the host, back to the host though the specified endpoint
 			
@@ -495,7 +478,7 @@
 			
 			TUint16 readEndpoint = aValue >> 8; //HI 8 buts
 			TUint16 writeEndpoint = aValue & 0x00ff; //LO 8 bits
-			OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP16, "Writing data cached on OUT endpoint (index %d) to IN endpoint (index %d) in sections of....",readEndpoint,writeEndpoint);
+			RDebug::Printf("Writing data cached on OUT endpoint (index %d) to IN endpoint (index %d) in sections of....",readEndpoint,writeEndpoint);
 			
 			// Read the number of bytes to use for each Write
 			TUint numBytes[KNumSplitWriteSections];
@@ -504,7 +487,7 @@
 				{
 				TLex8 lex(aPayload.Mid(i*KNumberStringLength, KNumberStringLength));
 				User::LeaveIfError(lex.Val(numBytes[i], EDecimal));
-				OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP17, "%d bytes", numBytes[i]);
+				RDebug::Printf("%d bytes", numBytes[i]);
 				// Write the data supplied by the host, back to the host though the specified endpoint
 				AlternateSetting(iCurrentAlternateInterfaceSetting).WriteSynchronousCachedEndpointDataToEndpointL(readEndpoint,writeEndpoint,numBytesWritten,numBytes[i]);
 				// Updates bytes written for next round of 'for'loop
@@ -522,7 +505,7 @@
 			TLex8 lex(aPayload);
 			TUint32 numBytes;
 			User::LeaveIfError(lex.Val(numBytes, EDecimal));
-			OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP18, "Reading %u bytes on OUT endpoint (index %u)",numBytes,(TUint32)aValue);
+			RDebug::Printf("Reading %d bytes on OUT endpoint (index %d)",numBytes,aValue);
 			AlternateSetting(iCurrentAlternateInterfaceSetting).ReadDataFromEndpointL(numBytes,aValue);
 			}
 			break;
@@ -536,7 +519,7 @@
 			TLex8 lex(aPayload);
 			TUint32 numBytes;
 			User::LeaveIfError(lex.Val(numBytes, EDecimal));
-			OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP19, "Reading %u bytes on OUT endpoint (index %u) ... then halting endpoint",numBytes,(TUint32)aValue);
+			RDebug::Printf("Reading %d bytes on OUT endpoint (index %d) ... then halting endpoint",numBytes,aValue);
 			AlternateSetting(iCurrentAlternateInterfaceSetting).ReadDataFromAndHaltEndpointL(numBytes,aValue);
 			}
 			break;
@@ -546,7 +529,7 @@
 			// Acknowledge the request
 			iEp0Reader->Acknowledge();
 			
-			OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP20, "CANCEL Reading on OUT endpoint (index %u)",(TUint32)aValue);
+			RDebug::Printf("CANCEL Reading on OUT endpoint (index %d)",aValue);
 			AlternateSetting(iCurrentAlternateInterfaceSetting).CancelAnyReadDataFromEndpointL(aValue);
 			}
 			break;
@@ -560,7 +543,7 @@
 			TLex8 lex(aPayload);
 			TUint32 numBytes;
 			User::LeaveIfError(lex.Val(numBytes, EDecimal));
-			OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP21, "Reading %u bytes on OUT endpoint (index %u)",numBytes,(TUint32)aValue);
+			RDebug::Printf("Reading %d bytes on OUT endpoint (index %d)",numBytes,aValue);
 			AlternateSetting(iCurrentAlternateInterfaceSetting).ReadDataUntilShortFromEndpointL(numBytes,aValue);
 			}
 			break;
@@ -572,13 +555,12 @@
 			
 			// Read the number of repeats and the data supplied by the host, on the specified endpoint
 			TLex8 lex(aPayload.Left(KNumberStringLength));
-			OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP22, "NUMBER STRING LENGTH CALCULATED AS %d",KNumberStringLength);
+			RDebug::Printf("NUMBER STRING LENGTH CALCULATED AS %d",KNumberStringLength);
 			TUint32 numBytes;
 			User::LeaveIfError(lex.Val(numBytes, EDecimal));
-			OstTrace0(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP23, "Validation");
-			OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP24, "Checking %u bytes using string pattern below exist in the buffer for endpoint %u",numBytes,(TUint32)aValue);
-            const TPtrC8& midPayload = aPayload.Mid(KNumberStringLength);
-            OstTraceData(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP54, "", midPayload.Ptr(), midPayload.Length());
+			RDebug::Printf("Validation");
+			RDebug::Printf("Checking %d bytes using string pattern below exist in the buffer for endpoint %d",numBytes,aValue);
+			RDebug::RawPrint(aPayload.Mid(KNumberStringLength));
 			
 			delete iAuxBuffer;
 			iAuxBuffer = HBufC8::NewL(KPassFailStringLength);
@@ -616,18 +598,18 @@
 		case KVendorUnrespondRequest:
 			// Do not acknowledge this request
 			
-			OstTrace0(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP25, "Unrespond request: continually NAK the host");
+			RDebug::Printf("Unrespond request: continually NAK the host");
 			break;
 			
 		case KVendorStallRequest:
 			{
 			// Stall the specified endpoint		
 			iEp0Reader->Acknowledge();
-			OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP26, "Stalling endpoint%d",aValue);
+			RDebug::Printf("Stalling endpoint%d",aValue);
 			TInt err = StallEndpoint(aValue);
 			if(err != KErrNone)
 				{
-				OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP27, "<Error %d> unable to stall endpoint index %d",err,aValue);
+				RDebug::Printf("<Error %d> unable to stall endpoint index %d",err,aValue);
 				iDevice.ReportError(err);
 				}
 			}
@@ -637,26 +619,23 @@
 			break;
 		}
 
-	OstTraceFunctionExitExt( CINTERFACEBASE_PROCESSREQUESTL_EXIT, this, KErrNone );
 	return KErrNone;
 	}
 	
 
 void CInterfaceBase::StartEp0Reading()
 	{
-	OstTraceFunctionEntry1( CINTERFACEBASE_STARTEP0READING_ENTRY, this );
+	LOG_FUNC
 	
 	iEp0Reader->ReadRequestsL();
-	OstTraceFunctionExit1( CINTERFACEBASE_STARTEP0READING_EXIT, this );
 	}
 	
 
 void CInterfaceBase::StopEp0Reading()
 	{
-	OstTraceFunctionEntry1( CINTERFACEBASE_STOPEP0READING_ENTRY, this );
+	LOG_FUNC
 	
 	iEp0Reader->Cancel();		
-	OstTraceFunctionExit1( CINTERFACEBASE_STOPEP0READING_EXIT, this );
 	}
 
 	}
--- a/kerneltest/e32test/usbho/t_usbdi/src/TestPolicy.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/TestPolicy.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -21,22 +21,16 @@
 #include "BaseTestCase.h"
 #include "TestCaseFactory.h"
 #include "testdebug.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "TestPolicyTraces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{
 	
 CBasicTestPolicy* CBasicTestPolicy::NewL()
 	{
-	OstTraceFunctionEntry0( CBASICTESTPOLICY_NEWL_ENTRY );
 	CBasicTestPolicy* self = new (ELeave) CBasicTestPolicy;
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CBASICTESTPOLICY_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 
@@ -44,31 +38,26 @@
 CBasicTestPolicy::CBasicTestPolicy()
 :	CActive(EPriorityStandard)
 	{
-	OstTraceFunctionEntry1( CBASICTESTPOLICY_CBASICTESTPOLICY_ENTRY, this );
 	CActiveScheduler::Add(this);
-	OstTraceFunctionExit1( CBASICTESTPOLICY_CBASICTESTPOLICY_EXIT, this );
 	}
 
 	
 CBasicTestPolicy::~CBasicTestPolicy()
 	{
-    OstTraceFunctionEntry1( CBASICTESTPOLICY_CBASICTESTPOLICY_ENTRY_DUP01, this );
+	LOG_FUNC
 
 	Cancel();
-	OstTraceFunctionExit1( CBASICTESTPOLICY_CBASICTESTPOLICY_EXIT_DUP01, this );
 	}
 	
 
 void CBasicTestPolicy::ConstructL()
 	{
-	OstTraceFunctionEntry1( CBASICTESTPOLICY_CONSTRUCTL_ENTRY, this );
-	OstTraceFunctionExit1( CBASICTESTPOLICY_CONSTRUCTL_EXIT, this );
 	}
 
 	
 void CBasicTestPolicy::RunTestCaseL(const TDesC& aTestCaseId,TRequestStatus& aNotifierStatus)
 	{
-    OstTraceFunctionEntryExt( CBASICTESTPOLICY_RUNTESTCASEL_ENTRY, this );
+	LOG_FUNC
 
 	iNotifierStatus = &aNotifierStatus;
 
@@ -82,13 +71,12 @@
 	
 	*iNotifierStatus = iStatus = KRequestPending;
 	SetActive();
-	OstTraceFunctionExit1( CBASICTESTPOLICY_RUNTESTCASEL_EXIT, this );
 	}
 
 
 void CBasicTestPolicy::DoCancel()
 	{
-    OstTraceFunctionEntry1( CBASICTESTPOLICY_DOCANCEL_ENTRY, this );
+	LOG_FUNC
 
 	// Cancel running the test cases
 	
@@ -97,26 +85,24 @@
 	// Notify the test case controller that test case execution was cancelled
 	
 	User::RequestComplete(iNotifierStatus,KErrCancel);
-	OstTraceFunctionExit1( CBASICTESTPOLICY_DOCANCEL_EXIT, this );
 	}
 
 
 void CBasicTestPolicy::SignalTestComplete(TInt aCompletionCode)
 	{
-	OstTraceFunctionEntryExt( CBASICTESTPOLICY_SIGNALTESTCOMPLETE_ENTRY, this );
+	LOG_FUNC
 	
 	// Complete the test policy request with the test case completion code
 	// (Basically self completion)
 	
 	TRequestStatus* s = &iStatus;	
 	User::RequestComplete(s,aCompletionCode);
-	OstTraceFunctionExit1( CBASICTESTPOLICY_SIGNALTESTCOMPLETE_EXIT, this );
 	}
 
 	
 void CBasicTestPolicy::RunL()
 	{
-	OstTraceFunctionEntry1( CBASICTESTPOLICY_RUNL_ENTRY, this );
+	LOG_FUNC
 	
 	// Complete the request of the notifier with the test case 
 	// completion code
@@ -126,62 +112,52 @@
 	// Destroy the test case
 	
 	delete iTestCase;
-	OstTraceFunctionExit1( CBASICTESTPOLICY_RUNL_EXIT, this );
 	}
 
 
 TInt CBasicTestPolicy::RunError(TInt aError)
 	{
-	OstTraceFunctionEntryExt( CBASICTESTPOLICY_RUNERROR_ENTRY, this );
+	LOG_FUNC
 	
 	aError = KErrNone;
-	OstTraceFunctionExitExt( CBASICTESTPOLICY_RUNERROR_EXIT, this, aError );
 	return aError;
 	}
 	
 CThreadTestPolicy* CThreadTestPolicy::NewL()
 	{
-	OstTraceFunctionEntry0( CTHREADTESTPOLICY_NEWL_ENTRY );
 	CThreadTestPolicy* self = new (ELeave) CThreadTestPolicy;
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CTHREADTESTPOLICY_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
 	
 CThreadTestPolicy::CThreadTestPolicy()
 	{
-	OstTraceFunctionEntry1( CTHREADTESTPOLICY_CTHREADTESTPOLICY_ENTRY, this );
-	OstTraceFunctionExit1( CTHREADTESTPOLICY_CTHREADTESTPOLICY_EXIT, this );
 	}
 	
 	
 CThreadTestPolicy::~CThreadTestPolicy()
 	{
-	OstTraceFunctionEntry1( CTHREADTESTPOLICY_CTHREADTESTPOLICY_ENTRY_DUP01, this );
 	iTestThread.Close();
 	if(iTestCaseId)
 		{
 		delete iTestCaseId;
 		iTestCaseId = NULL;
 		}
-	OstTraceFunctionExit1( CTHREADTESTPOLICY_CTHREADTESTPOLICY_EXIT_DUP01, this );
 	}
 
 void CThreadTestPolicy::ConstructL()
 	{
-	OstTraceFunctionEntry1( CTHREADTESTPOLICY_CONSTRUCTL_ENTRY, this );
-	OstTraceFunctionExit1( CTHREADTESTPOLICY_CONSTRUCTL_EXIT, this );
 	}
 
 void CThreadTestPolicy::RunTestCaseL(const TDesC& aTestCaseId,TRequestStatus& aNotifierStatus)
 	{
-    OstTraceFunctionEntryExt( CTHREADTESTPOLICY_RUNTESTCASEL_ENTRY, this );
+	LOG_FUNC
 
 	iNotifierStatus = &aNotifierStatus;
-	OstTraceExt1(TRACE_NORMAL, CTHREADTESTPOLICY_RUNTESTCASEL, "Creating thread for test case '%S'",aTestCaseId);
+	RDebug::Printf("Creating thread for test case '%S'",&aTestCaseId);
 		
 	if(iTestCaseId)
 		{
@@ -197,61 +173,58 @@
 	
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CTHREADTESTPOLICY_RUNTESTCASEL_DUP01, "Test thread creation unsuccessful: %d",err);
+		RDebug::Printf("Test thread creation unsuccessful: %d",err);
 		User::Leave(err);
 		}
 
-	OstTraceExt1(TRACE_NORMAL, CTHREADTESTPOLICY_RUNTESTCASEL_DUP02, "Test thread '%S' created",aTestCaseId);
+	RDebug::Printf("Test thread '%S' created",&aTestCaseId);
 	// Start the test case in the thread
 	iTestThread.Logon(iStatus);
 	SetActive();
 	iTestThread.Resume();
 	*iNotifierStatus = KRequestPending;
-	OstTraceFunctionExit1( CTHREADTESTPOLICY_RUNTESTCASEL_EXIT, this );
 	}
 
 
 void CThreadTestPolicy::SignalTestComplete(TInt aCompletionCode)
 	{
-    OstTraceFunctionEntryExt( CTHREADTESTPOLICY_SIGNALTESTCOMPLETE_ENTRY, this );
+	LOG_FUNC
 
 	if(aCompletionCode == KErrNone)
 		{
-		OstTrace0(TRACE_NORMAL, CTHREADTESTPOLICY_SIGNALTESTCOMPLETE, "CActiveScheduler::Stop CThreadTestPolicy::SignalTestComplete");
+		RDebug::Printf("CActiveScheduler::Stop CThreadTestPolicy::SignalTestComplete");
 		CActiveScheduler::Stop();
 		}
 	else
 		{
-		OstTrace1(TRACE_NORMAL, CTHREADTESTPOLICY_SIGNALTESTCOMPLETE_DUP01, "Killing thread with: %d",aCompletionCode);
+		RDebug::Printf("Killing thread with: %d",aCompletionCode);
 		iTestThread.Kill(aCompletionCode);
 		}
-	OstTraceFunctionExit1( CTHREADTESTPOLICY_SIGNALTESTCOMPLETE_EXIT, this );
 	}
 
 void CThreadTestPolicy::DoCancel()
 	{
-    OstTraceFunctionEntry1( CTHREADTESTPOLICY_DOCANCEL_ENTRY, this );
+	LOG_FUNC
 
 	iTestCase->Cancel();
-	OstTrace0(TRACE_NORMAL, CTHREADTESTPOLICY_DOCANCEL, ">> Debug point: 1");
+	LOG_POINT(1)
 	TInt err(iTestThread.LogonCancel(iStatus));
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CTHREADTESTPOLICY_DOCANCEL_DUP01, "Unable to cancel thread logon: %d",err);
+		RDebug::Printf("Unable to cancel thread logon: %d",err);
 		}
-	OstTrace0(TRACE_NORMAL, CTHREADTESTPOLICY_DOCANCEL_DUP02, ">> Debug point: 2");
+	LOG_POINT(2)
 	TRequestStatus cancelStatus;
 	iTestThread.Logon(cancelStatus);
-	OstTrace0(TRACE_NORMAL, CTHREADTESTPOLICY_DOCANCEL_DUP03, ">> Debug point: 3");
+	LOG_POINT(3)
 	iTestThread.Kill(KErrCancel);		
-	OstTrace0(TRACE_NORMAL, CTHREADTESTPOLICY_DOCANCEL_DUP04, ">> Debug point: 4");
+	LOG_POINT(4)
 	User::RequestComplete(iNotifierStatus,cancelStatus.Int());
-	OstTraceFunctionExit1( CTHREADTESTPOLICY_DOCANCEL_EXIT, this );
 	}
 	
 TInt CThreadTestPolicy::ThreadFunction(TAny* aThreadParameter)
 	{
-	OstTraceFunctionEntry0( CTHREADTESTPOLICY_THREADFUNCTION_ENTRY);
+	LOG_CFUNC
 
 	TInt err(KErrNone);
 	TInt leaveCode(KErrNone);
@@ -262,26 +235,24 @@
 	CTrapCleanup* cleanup = CTrapCleanup::New();
 	if(cleanup == NULL)
 		{
-		OstTraceFunctionExitExt( CTHREADTESTPOLICY_THREADFUNCTION_EXIT, 0, KErrNoMemory );
 		return KErrNoMemory;
 		}
 		
 	TRAP(leaveCode,err = CThreadTestPolicy::DoTestL(*testCaseId));
 	if(leaveCode != KErrNone)
 		{
-		OstTraceExt2(TRACE_NORMAL, CTHREADTESTPOLICY_THREADFUNCTION, "<Error %d> Thread '%S' DoTest",leaveCode, *testCaseId);
+		RDebug::Printf("<Error %d> Thread '%S' DoTest",leaveCode,&testCaseId);
 		err = leaveCode;
 		}
 	
 	delete cleanup;
-	OstTraceFunctionExitExt( CTHREADTESTPOLICY_THREADFUNCTION_EXIT_DUP01, 0, err );
 	return err;
 	}
 	
 	
 TInt CThreadTestPolicy::DoTestL(const TDesC& aTestCaseId)
 	{
-	OstTraceFunctionEntryExt( CTHREADTESTPOLICY_DOTESTL_ENTRY, 0 );
+	LOG_CFUNC
 	TInt err(KErrNone);
 	
 	// Create a new active scheduler for this thread
@@ -298,7 +269,7 @@
 	if(!testCase->IsHostOnly())
 		{
 		// Loop for active objects
-		OstTrace0(TRACE_NORMAL, CTHREADTESTPOLICY_DOTESTL, "CActiveScheduler::Start in CThreadTestPolicy::DoTestL");
+		RDebug::Printf("CActiveScheduler::Start in CThreadTestPolicy::DoTestL");	
 		CActiveScheduler::Start();
 		}	
 	// Get the test case execution result 
@@ -310,19 +281,18 @@
 	// Destroy the active scheduler	
 	CleanupStack::PopAndDestroy(sched);
 	
-	OstTraceFunctionExitExt( CTHREADTESTPOLICY_DOTESTL_EXIT, 0, err );
 	return err;
 	}
 
 void CThreadTestPolicy::RunL()
 	{
-	OstTraceFunctionEntry1( CTHREADTESTPOLICY_RUNL_ENTRY, this );
+	LOG_FUNC
 	TInt completionCode(iStatus.Int());
 	
 	TExitType exitType(iTestThread.ExitType());
 	TExitCategoryName exitName(iTestThread.ExitCategory());
 	TInt exitReason(iTestThread.ExitReason());
-	OstTraceExt2(TRACE_NORMAL, CTHREADTESTPOLICY_RUNL, "Test thread '%S' completed with completion code %d",iTestThread.Name(),completionCode);
+	RDebug::Printf("Test thread '%S' completed with completion code %d",&iTestThread.Name(),completionCode);
 		
 	switch(exitType)
 		{
@@ -330,8 +300,8 @@
 		// This will occur if test API panics or RTest expression is false (i.e. test case fails)
 		case EExitPanic:
 			{
-			OstTraceExt3(TRACE_NORMAL, CTHREADTESTPOLICY_RUNL_DUP01, "Test thread '%S' has panicked with category '%S' reason %d",
-						iTestThread.Name(),exitName,exitReason);
+			RDebug::Printf("Test thread '%S' has panicked with category '%S' reason %d",
+						&iTestThread.Name(),&exitName,exitReason);
 			// May require to stop and start host/client USB depending on what panic category it is
 			// can no longer trust RUsbHubDriver/RDevUsbcClient to be in good state
 			completionCode = KErrAbort;
@@ -341,8 +311,8 @@
 		// The thread has been terminated
 		case EExitTerminate:
 			{
-			OstTraceExt3(TRACE_NORMAL, CTHREADTESTPOLICY_RUNL_DUP02, "Test thread '%S' terminated with category %s reason %d",
-				iTestThread.Name(),exitName,exitReason);
+			RDebug::Printf("Test thread '%S' terminated with category %s reason %d",
+				&iTestThread.Name(),&exitName,exitReason);
 			}
 			break;
 				
@@ -350,7 +320,7 @@
 		// This will occur when the test thread executes normally or is cancelled
 		case EExitKill:
 			{
-			OstTraceExt2(TRACE_NORMAL, CTHREADTESTPOLICY_RUNL_DUP03, "Test thread '%S' has been killed with reason %d",iTestThread.Name(),exitReason);
+			RDebug::Printf("Test thread '%S' has been killed with reason %d",&iTestThread.Name(),exitReason);
 			}
 			break;
 				
@@ -366,14 +336,11 @@
 		
 	// Complete the notifier's request status
 	User::RequestComplete(iNotifierStatus,completionCode);
-	OstTraceFunctionExit1( CTHREADTESTPOLICY_RUNL_EXIT, this );
 	}
 
 TInt CThreadTestPolicy::RunError(TInt aError)
 	{
-	OstTraceFunctionEntryExt( CTHREADTESTPOLICY_RUNERROR_ENTRY, this );
-	OstTrace1(TRACE_NORMAL, CTHREADTESTPOLICY_RUNERROR, "<Error %d><Test Policy> RunError",aError);
-	OstTraceFunctionExitExt( CTHREADTESTPOLICY_RUNERROR_EXIT, this, KErrNone );
+	RDebug::Printf("<Error %d><Test Policy> RunError",aError);
 	return KErrNone;
 	}
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/UsbClientStateWatcher.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/UsbClientStateWatcher.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -17,10 +17,6 @@
 //
 
 #include "UsbClientStateWatcher.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "UsbClientStateWatcherTraces.h"
-#endif
 #include <d32usbc.h>
 #include <e32test.h>
 #include <e32debug.h>
@@ -32,12 +28,10 @@
 
 CUsbClientStateWatcher* CUsbClientStateWatcher::NewL(RDevUsbcClient& aClientDriver,MUsbClientStateObserver& aStateObserver)
 	{
-	OstTraceFunctionEntryExt( CUSBCLIENTSTATEWATCHER_NEWL_ENTRY, 0 );
 	CUsbClientStateWatcher* self = new (ELeave) CUsbClientStateWatcher(aClientDriver,aStateObserver);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -47,41 +41,33 @@
 	iClientDriver(aClientDriver),
 	iStateObserver(aStateObserver)
 	{
-	OstTraceFunctionEntryExt( CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_ENTRY, this );
 	CActiveScheduler::Add(this);
-	OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_EXIT, this );
 	}
 
 
 CUsbClientStateWatcher::~CUsbClientStateWatcher()
 	{
-	OstTraceFunctionEntry1( CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_ENTRY_DUP01, this );
+	LOG_FUNC
 	Cancel();
-	OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_EXIT_DUP01, this );
 	}
 	
 	
 void CUsbClientStateWatcher::ConstructL()
 	{
-	OstTraceFunctionEntry1( CUSBCLIENTSTATEWATCHER_CONSTRUCTL_ENTRY, this );
-	OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_CONSTRUCTL, "<Client State Watcher> Watching state of device");
+	RDebug::Printf("<Client State Watcher> Watching state of device");
 	iClientDriver.AlternateDeviceStatusNotify(iStatus,iState);
 	SetActive();
-	OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_CONSTRUCTL_EXIT, this );
 	}
 
 
 void CUsbClientStateWatcher::DoCancel()
 	{
-	OstTraceFunctionEntry1( CUSBCLIENTSTATEWATCHER_DOCANCEL_ENTRY, this );
 	// Cancel device status notification
 	iClientDriver.AlternateDeviceStatusNotifyCancel();	
-	OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_DOCANCEL_EXIT, this );
 	}
 
 void CUsbClientStateWatcher::RunL()
 	{
-	OstTraceFunctionEntry1( CUSBCLIENTSTATEWATCHER_RUNL_ENTRY, this );
 	// Retrieve the asynchronous completion code
 	TInt completionCode(iStatus.Int());
 	
@@ -97,42 +83,42 @@
 			switch(iState)
 				{
 				case EUsbcDeviceStateUndefined:
-					OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL, "<Client State> Not attached");
+					RDebug::Printf("<Client State> Not attached");
 					break;
 				
 				case EUsbcDeviceStateAttached:
-					OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP01, "<Client State> Attached to host but not powered");
+					RDebug::Printf("<Client State> Attached to host but not powered");
 					break;
 					
 				case EUsbcDeviceStatePowered:
-					OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP02, "<Client State> Attached and powered but no reset");
+					RDebug::Printf("<Client State> Attached and powered but no reset");
 					break;
 					
 				case EUsbcDeviceStateDefault:
-					OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP03, "<Client State> Reset but not addressed");
+					RDebug::Printf("<Client State> Reset but not addressed");
 					break;
 					
 				case EUsbcDeviceStateAddress:
-					OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP04, "<Client State> Addressed but not configured");
+					RDebug::Printf("<Client State> Addressed but not configured");
 					break;
 	 
 				case EUsbcDeviceStateConfigured:
-					OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP05, "<Client State> Fully configured");
+					RDebug::Printf("<Client State> Fully configured");
 					break;
 	 
 				case EUsbcDeviceStateSuspended:
-					OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP06, "<Client State> Suspended");
+					RDebug::Printf("<Client State> Suspended");
 					break;
 					
 				case EUsbcNoState: //follow through
 				default:
-					OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP07, "<Client State> Not specified");
+					RDebug::Printf("<Client State> Not specified");
 					break;
 				}
 			}
 		else
 			{
-			OstTrace1(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP08, "<Client State> Notification error %d",completionCode);
+			RDebug::Printf("<Client State> Notification error %d",completionCode);
 			}
 		
 		// Device state change
@@ -142,15 +128,12 @@
 	// Keep asking to be informed for status notifications
 	iClientDriver.AlternateDeviceStatusNotify(iStatus,iState);
 	SetActive();	
-	OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_RUNL_EXIT, this );
 	}
 	
 	
 TInt CUsbClientStateWatcher::RunError(TInt aError)
 	{
-	OstTraceFunctionEntryExt( CUSBCLIENTSTATEWATCHER_RUNERROR_ENTRY, this );
 	aError = KErrNone;
-	OstTraceFunctionExitExt( CUSBCLIENTSTATEWATCHER_RUNERROR_EXIT, this, aError );
 	return aError;
 	}
 
@@ -162,12 +145,10 @@
 CAlternateInterfaceSelectionWatcher* CAlternateInterfaceSelectionWatcher::NewL(
 	RDevUsbcClient& aClientDriver,MAlternateSettingObserver& aObserver)
 	{
-	OstTraceFunctionEntryExt( CALTERNATEINTERFACESELECTIONWATCHER_NEWL_ENTRY, 0 );
 	CAlternateInterfaceSelectionWatcher* self = new (ELeave) CAlternateInterfaceSelectionWatcher(aClientDriver,aObserver);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
@@ -178,43 +159,38 @@
 	iClientDriver(aClientDriver),
 	iObserver(aObserver)
 	{
-	OstTraceFunctionEntryExt( CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_ENTRY, this );
 	CActiveScheduler::Add(this);
-	OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_EXIT, this );
 	}
 	
 	
 CAlternateInterfaceSelectionWatcher::~CAlternateInterfaceSelectionWatcher()
 	{
-    OstTraceFunctionEntry1( CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_ENTRY_DUP01, this );
+	LOG_FUNC
 
 	Cancel();
-	OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_EXIT_DUP01, this );
 	}
 	
 	
 void CAlternateInterfaceSelectionWatcher::ConstructL()
 	{
-    OstTraceFunctionEntry1( CALTERNATEINTERFACESELECTIONWATCHER_CONSTRUCTL_ENTRY, this );
+	LOG_FUNC
 
 	iClientDriver.AlternateDeviceStatusNotify(iStatus,iState);
 	SetActive();	
-	OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_CONSTRUCTL_EXIT, this );
 	}
 
 
 void CAlternateInterfaceSelectionWatcher::DoCancel()
 	{
-    OstTraceFunctionEntry1( CALTERNATEINTERFACESELECTIONWATCHER_DOCANCEL_ENTRY, this );
+	LOG_FUNC
 
 	iClientDriver.AlternateDeviceStatusNotifyCancel();
-	OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_DOCANCEL_EXIT, this );
 	}
 	
 	
 void CAlternateInterfaceSelectionWatcher::RunL()
 	{
-    OstTraceFunctionEntry1( CALTERNATEINTERFACESELECTIONWATCHER_RUNL_ENTRY, this );
+	LOG_FUNC
 
 	TInt completionCode(iStatus.Int());
 	
@@ -225,15 +201,13 @@
 	// Keep asking to be informed for status notifications
 	iClientDriver.AlternateDeviceStatusNotify(iStatus,iState);
 	SetActive();	
-	OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_RUNL_EXIT, this );
 	}
 
 
 TInt CAlternateInterfaceSelectionWatcher::RunError(TInt aError)
 	{
-    OstTraceFunctionEntryExt( CALTERNATEINTERFACESELECTIONWATCHER_RUNERROR_ENTRY, this );
+	LOG_FUNC
 
-	OstTraceFunctionExitExt( CALTERNATEINTERFACESELECTIONWATCHER_RUNERROR_EXIT, this, KErrNone );
 	return KErrNone;
 	}
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/controlendpointreader.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/controlendpointreader.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,10 +18,6 @@
 
 #include "controlendpointreader.h"
 #include "testdebug.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "controlendpointreaderTraces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{	
@@ -32,48 +28,43 @@
 	iDataPhase(EFalse),
 	iRequestHandler(aRequestHandler)
 	{
-	OstTraceFunctionEntryExt( CCONTROLENDPOINTREADER_CCONTROLENDPOINTREADER_ENTRY, this );
-	OstTraceFunctionExit1( CCONTROLENDPOINTREADER_CCONTROLENDPOINTREADER_EXIT, this );
 	}
 	
 	
 CControlEndpointReader::~CControlEndpointReader()
 	{
-	OstTraceFunctionEntry1( CCONTROLENDPOINTREADER_CCONTROLENDPOINTREADER_ENTRY_DUP01, this );
-	OstTraceFunctionExit1( CCONTROLENDPOINTREADER_CCONTROLENDPOINTREADER_EXIT_DUP01, this );
+	LOG_FUNC
 	}
 
 
 void CControlEndpointReader::ReadRequestsL()
 	{
-	OstTraceFunctionEntry1( CCONTROLENDPOINTREADER_READREQUESTSL_ENTRY, this );
+	LOG_FUNC
 	
 	// Read a packet from endpoint 0 (this should incorporate a request)
 	
 	ReadPacketL(this);
-	OstTraceFunctionExit1( CCONTROLENDPOINTREADER_READREQUESTSL_EXIT, this );
 	}
 	
 
 void CControlEndpointReader::EndpointReadError(TEndpointNumber aEndpointNumber,TInt aErrorCode)
 	{
-	OstTraceFunctionEntryExt( CCONTROLENDPOINTREADER_ENDPOINTREADERROR_ENTRY, this );
+	LOG_FUNC
 	
-	OstTraceExt2(TRACE_NORMAL, CCONTROLENDPOINTREADER_ENDPOINTREADERROR, "<Error %d> Asynchronous read on endpoint %d",aErrorCode,aEndpointNumber);
-	OstTraceFunctionExit1( CCONTROLENDPOINTREADER_ENDPOINTREADERROR_EXIT, this );
+	RDebug::Printf("<Error %d> Asynchronous read on endpoint %d",aErrorCode,aEndpointNumber);
 	}
 	
 	
 void CControlEndpointReader::DataReceivedFromEndpointL(TEndpointNumber aEndpointNumber,const TDesC8& aData)
 	{
-	OstTraceFunctionEntryExt( CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_ENTRY, this );
+	LOG_FUNC
 	
-	OstTraceExt5(TRACE_NORMAL, CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL, "ibRequestType = %d, ibRequest = %d, iwValue = %d, iwIndex = %d, iwLength = %d",ibRequestType, ibRequest, iwValue, iwIndex, iwLength);
-	OstTraceExt2(TRACE_NORMAL, CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP01, "iDeviceToHost = %d, iDataPhase = %d",iDeviceToHost,iDataPhase);
+	RDebug::Printf("ibRequestType = %d, ibRequest = %d, iwValue = %d, iwIndex = %d, iwLength = %d",ibRequestType, ibRequest, iwValue, iwIndex, iwLength);
+	RDebug::Printf("iDeviceToHost = %d, iDataPhase = %d",iDeviceToHost,iDataPhase);
 	if(iDeviceToHost && iDataPhase)
 		{
 		TInt err = iRequestHandler.ProcessRequestL(ibRequest,iwValue,iwIndex,iwLength,aData);
-		OstTrace1(TRACE_NORMAL, CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP02, "ProdessRequestL returned %d",err);
+		RDebug::Printf("ProdessRequestL returned %d",err);
 		
 		if(err != KErrAbort)
 			{
@@ -113,12 +104,12 @@
 		
 		// Read all information about the request sent by the host
 		// i.e. any DATA1 packets sent after the setup DATA0 packet
-		OstTrace0(TRACE_NORMAL, CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP03, "AFTER UPDATES");
-		OstTraceExt5(TRACE_NORMAL, CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP04, "ibRequestType = %d, ibRequest = %d, iwValue = %d, iwIndex = %d, iwLength = %d",ibRequestType, ibRequest, iwValue, iwIndex, iwLength);
-		OstTraceExt2(TRACE_NORMAL, CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP05, "iDeviceToHost = %d, iDataPhase = %d",iDeviceToHost,iDataPhase);
+		RDebug::Printf("AFTER UPDATES");
+		RDebug::Printf("ibRequestType = %d, ibRequest = %d, iwValue = %d, iwIndex = %d, iwLength = %d",ibRequestType, ibRequest, iwValue, iwIndex, iwLength);
+		RDebug::Printf("iDeviceToHost = %d, iDataPhase = %d",iDeviceToHost,iDataPhase);
 		if(iDeviceToHost && iDataPhase)
 			{
-			OstTrace1(TRACE_NORMAL, CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP06, "Issuing another read of %d bytes",iwLength);
+			RDebug::Printf("Issuing another read of %d bytes",iwLength);
 			ReadL(iwLength);
 			}
 		else
@@ -133,7 +124,6 @@
 				}
 			}
 		}
-	OstTraceFunctionExit1( CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_EXIT, this );
 	}
 	
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/controltransferrequests.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/controltransferrequests.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,10 +18,6 @@
 
 #include "controltransferrequests.h"
 #include "testdebug.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "controltransferrequestsTraces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -32,181 +28,162 @@
 	iUsbInterface0(aInterface0),
 	iDataRequest(EFalse)
 	{
-	OstTraceFunctionEntryExt( CEP0TRANSFER_CEP0TRANSFER_ENTRY, this );
 	CActiveScheduler::Add(this);
-	OstTraceFunctionExit1( CEP0TRANSFER_CEP0TRANSFER_EXIT, this );
 	}
 	
 	
 CEp0Transfer::~CEp0Transfer()
 	{
-	OstTraceFunctionEntry1( CEP0TRANSFER_CEP0TRANSFER_ENTRY_DUP01, this );
+	LOG_FUNC
 	Cancel();
-	OstTraceFunctionExit1( CEP0TRANSFER_CEP0TRANSFER_EXIT_DUP01, this );
 	}
 	
 	
 void CEp0Transfer::DoCancel()
 	{
-	OstTraceFunctionEntry1( CEP0TRANSFER_DOCANCEL_ENTRY, this );
 	// Pretend cancel
 	TRequestStatus* s = &iStatus;
 	User::RequestComplete(s,KErrCancel);
-	OstTraceFunctionExit1( CEP0TRANSFER_DOCANCEL_EXIT, this );
 	}
 
 void CEp0Transfer::CancelSendRequest()
 	{
-	OstTraceFunctionEntry1( CEP0TRANSFER_CANCELSENDREQUEST_ENTRY, this );
 	// Pretend cancel
 	iUsbInterface0.CancelEP0Transfer();
-	OstTraceFunctionExit1( CEP0TRANSFER_CANCELSENDREQUEST_EXIT, this );
 	}
 
 
 void CEp0Transfer::SendRequest(TEmptyRequest& aSetupPacket,MCommandObserver* aObserver) 
 	{
-	OstTraceFunctionEntryExt( CEP0TRANSFER_SENDREQUEST_ENTRY, this );
+	LOG_FUNC
 	iObserver = aObserver;	
 	
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST, "bmRequestType: 0x%02x",aSetupPacket.iRequestType);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP01, "bRequest     : 0x%02x",aSetupPacket.iRequest);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP02, "wValue       : 0x%04x",aSetupPacket.iValue);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP03, "wIndex       : 0x%04x",aSetupPacket.iIndex);
-	OstTrace0(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP04, "total sent   : 8");
+	RDebug::Printf("bmRequestType: 0x%02x",aSetupPacket.iRequestType);
+	RDebug::Printf("bRequest     : 0x%02x",aSetupPacket.iRequest);
+	RDebug::Printf("wValue       : 0x%04x",aSetupPacket.iValue);
+	RDebug::Printf("wIndex       : 0x%04x",aSetupPacket.iIndex);
+	RDebug::Printf("total sent   : 8");
 	
 	iUsbInterface0.Ep0Transfer(aSetupPacket,KNullDesC8,iTemp,iStatus);
 	iRequestTime.HomeTime();
 	SetActive();	
-	OstTraceFunctionExit1( CEP0TRANSFER_SENDREQUEST_EXIT, this );
 	}
 
 
 void CEp0Transfer::SendRequest(TDataSendRequest& aSetupPacket,MCommandObserver* aObserver)
 	{
-	OstTraceFunctionEntryExt( CEP0TRANSFER_SENDREQUEST_ENTRY_DUP01, this );
+	LOG_FUNC
 	iObserver = aObserver;
 	
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP10, "bmRequestType: 0x%02x",aSetupPacket.iRequestType);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP11, "bRequest     : 0x%02x",aSetupPacket.iRequest);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP12, "wValue       : 0x%04x",aSetupPacket.iValue);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP13, "wIndex       : 0x%04x",aSetupPacket.iIndex);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP14, "data length  : %d",aSetupPacket.iSendData.Length());
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP15, "total sent   : %d",8+aSetupPacket.iSendData.Length());
+	RDebug::Printf("bmRequestType: 0x%02x",aSetupPacket.iRequestType);
+	RDebug::Printf("bRequest     : 0x%02x",aSetupPacket.iRequest);
+	RDebug::Printf("wValue       : 0x%04x",aSetupPacket.iValue);
+	RDebug::Printf("wIndex       : 0x%04x",aSetupPacket.iIndex);
+	RDebug::Printf("data length  : %d",aSetupPacket.iSendData.Length());
+	RDebug::Printf("total sent   : %d",8+aSetupPacket.iSendData.Length());
 	
 	iUsbInterface0.Ep0Transfer(aSetupPacket,aSetupPacket.iSendData,iTemp,iStatus);
 	iRequestTime.HomeTime();
 	SetActive();
-	OstTraceFunctionExit1( CEP0TRANSFER_SENDREQUEST_EXIT_DUP01, this );
 	}
 	
 void CEp0Transfer::SendRequest(TWriteSynchronousCachedReadDataRequest& aSetupPacket,MCommandObserver* aObserver)
 	{
-	OstTraceFunctionEntryExt( CEP0TRANSFER_SENDREQUEST_ENTRY_DUP02, this );
+	LOG_FUNC
 	iObserver = aObserver;
 	
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP20, "bmRequestType: 0x%02x",aSetupPacket.iRequestType);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP21, "bRequest     : 0x%02x",aSetupPacket.iRequest);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP22, "wValue       : 0x%04x",aSetupPacket.iValue);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP23, "wIndex       : 0x%04x",aSetupPacket.iIndex);
-	OstTrace0(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP24, "total sent   : 8");
+	RDebug::Printf("bmRequestType: 0x%02x",aSetupPacket.iRequestType);
+	RDebug::Printf("bRequest     : 0x%02x",aSetupPacket.iRequest);
+	RDebug::Printf("wValue       : 0x%04x",aSetupPacket.iValue);
+	RDebug::Printf("wIndex       : 0x%04x",aSetupPacket.iIndex);
+	RDebug::Printf("total sent   : 8");
 	
 	iUsbInterface0.Ep0Transfer(aSetupPacket,KNullDesC8,iTemp,iStatus);
 	iRequestTime.HomeTime();
 	SetActive();
-	OstTraceFunctionExit1( CEP0TRANSFER_SENDREQUEST_EXIT_DUP02, this );
 	}
 
 
 void CEp0Transfer::SendRequest(TEndpointReadRequest& aSetupPacket,MCommandObserver* aObserver)
 	{
-	OstTraceFunctionEntryExt( CEP0TRANSFER_SENDREQUEST_ENTRY_DUP03, this );
+	LOG_FUNC
 	iObserver = aObserver;
 	
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP30, "bmRequestType: 0x%02x",aSetupPacket.iRequestType);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP31, "bRequest     : 0x%02x",aSetupPacket.iRequest);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP32, "wValue       : 0x%04x",aSetupPacket.iValue);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP33, "wIndex       : 0x%04x",aSetupPacket.iIndex);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP34, "data length  : %d",aSetupPacket.iReadSpecificationData.Length());
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP35, "total sent   : %d",8+aSetupPacket.iReadSpecificationData.Length());
+	RDebug::Printf("bmRequestType: 0x%02x",aSetupPacket.iRequestType);
+	RDebug::Printf("bRequest     : 0x%02x",aSetupPacket.iRequest);
+	RDebug::Printf("wValue       : 0x%04x",aSetupPacket.iValue);
+	RDebug::Printf("wIndex       : 0x%04x",aSetupPacket.iIndex);
+	RDebug::Printf("data length  : %d",aSetupPacket.iReadSpecificationData.Length());
+	RDebug::Printf("total sent   : %d",8+aSetupPacket.iReadSpecificationData.Length());
 	TLex8 lex(aSetupPacket.iReadSpecificationData);
 	TUint numBytes = 0;
 	lex.Val(numBytes, EDecimal);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP06, "Read length required (in bytes)   : %d",numBytes);
+	RDebug::Printf("Read length required (in bytes)   : %d",numBytes);
 	
 	iUsbInterface0.Ep0Transfer(aSetupPacket,aSetupPacket.iReadSpecificationData,iTemp,iStatus);
 	iRequestTime.HomeTime();
 	SetActive();
-	OstTraceFunctionExit1( CEP0TRANSFER_SENDREQUEST_EXIT_DUP03, this );
 	}
 	
 void CEp0Transfer::SendRequest(TClassDataSendRequest& aSetupPacket,MCommandObserver* aObserver)
 	{
-	OstTraceFunctionEntryExt( CEP0TRANSFER_SENDREQUEST_ENTRY_DUP04, this );
+	LOG_FUNC
 	iObserver = aObserver;
 	
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP40, "bmRequestType: 0x%02x",aSetupPacket.iRequestType);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP41, "bRequest     : 0x%02x",aSetupPacket.iRequest);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP42, "wValue       : 0x%04x",aSetupPacket.iValue);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP43, "wIndex       : 0x%04x",aSetupPacket.iIndex);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP44, "data length  : %d",aSetupPacket.iSendData.Length());
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP45, "total sent   : %d",8+aSetupPacket.iSendData.Length());
+	RDebug::Printf("bmRequestType: 0x%02x",aSetupPacket.iRequestType);
+	RDebug::Printf("bRequest     : 0x%02x",aSetupPacket.iRequest);
+	RDebug::Printf("wValue       : 0x%04x",aSetupPacket.iValue);
+	RDebug::Printf("wIndex       : 0x%04x",aSetupPacket.iIndex);
+	RDebug::Printf("data length  : %d",aSetupPacket.iSendData.Length());
+	RDebug::Printf("total sent   : %d",8+aSetupPacket.iSendData.Length());
 	
 	iUsbInterface0.Ep0Transfer(aSetupPacket,aSetupPacket.iSendData,iTemp,iStatus);
 	iRequestTime.HomeTime();
 	SetActive();
-	OstTraceFunctionExit1( CEP0TRANSFER_SENDREQUEST_EXIT_DUP04, this );
 	}
 	
 void CEp0Transfer::SendRequest(TDataRecvRequest& aSetupPacket,MCommandObserver* aObserver)
 	{
-	OstTraceFunctionEntryExt( CEP0TRANSFER_SENDREQUEST_ENTRY_DUP05, this );
+	LOG_FUNC
 	iObserver = aObserver;
 	
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP50, "bmRequestType: 0x%02x",aSetupPacket.iRequestType);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP51, "bRequest     : 0x%02x",aSetupPacket.iRequest);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP52, "wValue       : 0x%04x",aSetupPacket.iValue);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP53, "wIndex       : 0x%04x",aSetupPacket.iIndex);
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_SENDREQUEST_DUP54, "data length  : %d",aSetupPacket.iRecvData.Length());
+	RDebug::Printf("bmRequestType: 0x%02x",aSetupPacket.iRequestType);
+	RDebug::Printf("bRequest     : 0x%02x",aSetupPacket.iRequest);
+	RDebug::Printf("wValue       : 0x%04x",aSetupPacket.iValue);
+	RDebug::Printf("wIndex       : 0x%04x",aSetupPacket.iIndex);
+	RDebug::Printf("data length  : %d",aSetupPacket.iRecvData.Length());
 	
 	iUsbInterface0.Ep0Transfer(aSetupPacket,KNullDesC8,aSetupPacket.iRecvData,iStatus);
 	iRequestTime.HomeTime();
 	SetActive();
-	OstTraceFunctionExit1( CEP0TRANSFER_SENDREQUEST_EXIT_DUP05, this );
 	}
 
 
 void CEp0Transfer::RunL()
 	{
-	OstTraceFunctionEntry1( CEP0TRANSFER_RUNL_ENTRY, this );
 	iCompletionTime.HomeTime();
+	LOG_FUNC
 	TInt completionCode(iStatus.Int());
 	
-	OstTrace1(TRACE_NORMAL, CEP0TRANSFER_RUNL, "Client command sent, Completion code: %d",completionCode);
+	RDebug::Printf("Client command sent, Completion code: %d",completionCode);
 	iObserver->Ep0TransferCompleteL(completionCode);
-	OstTraceFunctionExit1( CEP0TRANSFER_RUNL_EXIT, this );
 	}
 	
 	
 TInt CEp0Transfer::RunError(TInt aError)
 	{
-	OstTraceFunctionEntryExt( CEP0TRANSFER_RUNERROR_ENTRY, this );
-	OstTraceFunctionExitExt( CEP0TRANSFER_RUNERROR_EXIT, this, KErrNone );
+	LOG_FUNC
 	return KErrNone;
 	}
 
 void CEp0Transfer::LastRequestStartTime( TTime& aDuration)
 	{
-	OstTraceFunctionEntryExt( CEP0TRANSFER_LASTREQUESTSTARTTIME_ENTRY, this );
 	aDuration= iRequestTime.Int64();
-	OstTraceFunctionExit1( CEP0TRANSFER_LASTREQUESTSTARTTIME_EXIT, this );
 	}
 
 void CEp0Transfer::LastRequestCompletionTime( TTime& aDuration)
 	{
-	OstTraceFunctionEntryExt( CEP0TRANSFER_LASTREQUESTCOMPLETIONTIME_ENTRY, this );
 	aDuration= iCompletionTime.Int64();
-	OstTraceFunctionExit1( CEP0TRANSFER_LASTREQUESTCOMPLETIONTIME_EXIT, this );
 	}
 	
 	}
--- a/kerneltest/e32test/usbho/t_usbdi/src/endpointreader.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/endpointreader.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,10 +19,6 @@
 #include "endpointreader.h"
 #include "controltransferrequests.h"
 #include "testdebug.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "endpointreaderTraces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -35,47 +31,38 @@
 	iDataPtr(NULL,0),
 	iValidationPatternPtr(NULL,0)
 	{
-	OstTraceFunctionEntryExt( CENDPOINTREADER_CENDPOINTREADER_ENTRY, this );
 	CActiveScheduler::Add(this);
-	OstTraceFunctionExit1( CENDPOINTREADER_CENDPOINTREADER_EXIT, this );
 	}
 	
 CEndpointReader::~CEndpointReader()
 	{
-	OstTraceFunctionEntry1( CENDPOINTREADER_CENDPOINTREADER_ENTRY_DUP01, this );
+	LOG_FUNC
 	Cancel();
 	delete iDataBuffer;
 	iDataBuffer = NULL;
 	delete iValidationPatternBuffer;
 	iValidationPatternBuffer = NULL;
-	OstTraceFunctionExit1( CENDPOINTREADER_CENDPOINTREADER_EXIT_DUP01, this );
 	}
 			
 TPtr8 CEndpointReader::Buffer()
 	{
-	OstTraceFunctionEntry1( CENDPOINTREADER_BUFFER_ENTRY, this );
-	OstTraceFunctionExitExt( CENDPOINTREADER_BUFFER_EXIT, this, ( TUint )&( iDataPtr ) );
 	return iDataPtr;
 	}
 
 TBool CEndpointReader::IsValid()
 	{
-	OstTraceFunctionEntry1( CENDPOINTREADER_ISVALID_ENTRY, this );
-	OstTraceFunctionExitExt( CENDPOINTREADER_ISVALID_EXIT, this, iIsValid );
 	return iIsValid;
 	}
 
 TUint CEndpointReader::NumBytesReadSoFar()
 	{
-	OstTraceFunctionEntry1( CENDPOINTREADER_NUMBYTESREADSOFAR_ENTRY, this );
-	OstTraceFunctionExitExt( CENDPOINTREADER_NUMBYTESREADSOFAR_EXIT, this, iNumBytesReadSoFar );
 	return iNumBytesReadSoFar;
 	}
 
 void CEndpointReader::ReadPacketL(MEndpointDataHandler* aHandler)
 	{
-	OstTraceFunctionEntryExt( CENDPOINTREADER_READPACKETL_ENTRY, this );
-	OstTrace1(TRACE_NORMAL, CENDPOINTREADER_READPACKETL, "Endpoint %d", iEndpoint);
+	LOG_FUNC
+	RDebug::Printf("Endpoint %d", iEndpoint);
 	
 	iHandler = aHandler;
 
@@ -92,14 +79,13 @@
 	// Read from the endpoint
 	iClientDriver.ReadPacket(iStatus,iEndpoint,iDataPtr,KFullSpeedPacketSize);
 	SetActive();
-	OstTraceFunctionExit1( CENDPOINTREADER_READPACKETL_EXIT, this );
 	}
 
 
 void CEndpointReader::ReadL(TInt aByteCount)
 	{
-	OstTraceFunctionEntryExt( CENDPOINTREADER_READL_ENTRY, this );
-	OstTrace1(TRACE_NORMAL, CENDPOINTREADER_READL, "Endpoint %d", iEndpoint);
+	LOG_FUNC
+	RDebug::Printf("Endpoint %d", iEndpoint);
 	
 	// Allocate buffer for reading a data packet
 	if(iDataBuffer)
@@ -113,13 +99,12 @@
 	// Read from the endpoint
 	iClientDriver.Read(iStatus,iEndpoint,iDataPtr,aByteCount);
 	SetActive();
-	OstTraceFunctionExit1( CENDPOINTREADER_READL_EXIT, this );
 	}
 
 void CEndpointReader::ReadUntilShortL(TInt aByteCount)
 	{
-	OstTraceFunctionEntryExt( CENDPOINTREADER_READUNTILSHORTL_ENTRY, this );
-	OstTrace1(TRACE_NORMAL, CENDPOINTREADER_READUNTILSHORTL, "Endpoint %d", iEndpoint);
+	LOG_FUNC
+	RDebug::Printf("Endpoint %d", iEndpoint);
 	
 	// Allocate buffer for reading a data packet
 	if(iDataBuffer)
@@ -133,20 +118,18 @@
 	// Read from the endpoint
 	iClientDriver.ReadUntilShort(iStatus,iEndpoint,iDataPtr,aByteCount);
 	SetActive();
-	OstTraceFunctionExit1( CENDPOINTREADER_READUNTILSHORTL_EXIT, this );
 	}
 
 void CEndpointReader::ReadAndHaltL(TInt aByteCount)
 	{
-	OstTraceFunctionEntryExt( CENDPOINTREADER_READANDHALTL_ENTRY, this );
+	LOG_FUNC
 	iCompletionAction = EHaltEndpoint;
 	ReadL(aByteCount);
-	OstTraceFunctionExit1( CENDPOINTREADER_READANDHALTL_EXIT, this );
 	}
 
 void CEndpointReader::RepeatedReadAndValidateL(const TDesC8& aDataPattern, TUint aNumBytesPerRead, TUint aTotalNumBytes)
 	{
-OstTraceFunctionEntryExt( CENDPOINTREADER_REPEATEDREADANDVALIDATEL_ENTRY, this );
+	LOG_FUNC
 
 	iCompletionAction = ERepeatedRead;
 	iRepeatedReadTotalNumBytes = aTotalNumBytes;
@@ -154,7 +137,7 @@
 	iNumBytesReadSoFar = 0;
 	iDataPatternLength = aDataPattern.Length();
 	iIsValid = ETrue; //until proven guilty!
-	OstTraceExt2(TRACE_NORMAL, CENDPOINTREADER_REPEATEDREADANDVALIDATEL, "Total Bytes To Read: %u, Bytes Per Individual Read: %u", iRepeatedReadTotalNumBytes, iRepeatedReadNumBytesPerRead);
+	RDebug::Printf("Total Bytes To Read: %d, Bytes Per Individual Read: %d", iRepeatedReadTotalNumBytes, iRepeatedReadNumBytesPerRead);
 	//Create buffer to contain two lots of the payload pattern
 	//..so that we may grab cyclic chunks of said payload pattern
 	delete iValidationPatternBuffer;
@@ -168,39 +151,36 @@
 		}
 
 	ReadUntilShortL(iRepeatedReadNumBytesPerRead);
-	OstTraceFunctionExit1( CENDPOINTREADER_REPEATEDREADANDVALIDATEL_EXIT, this );
 	}
 
 
 TInt CEndpointReader::Acknowledge()
 	{
-	OstTraceFunctionEntry1( CENDPOINTREADER_ACKNOWLEDGE_ENTRY, this );
+	LOG_FUNC
 	TInt err(iClientDriver.SendEp0StatusPacket());
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CENDPOINTREADER_ACKNOWLEDGE, "<Error %d> Sending acknowledge packet",err);
+		RDebug::Printf("<Error %d> Sending acknowledge packet",err);
 		}
-	OstTraceFunctionExitExt( CENDPOINTREADER_ACKNOWLEDGE_EXIT, this, err );
 	return err;
 	}
 			
 			
 void CEndpointReader::DoCancel()
 	{
-	OstTraceFunctionEntry1( CENDPOINTREADER_DOCANCEL_ENTRY, this );
+	LOG_FUNC
 	
 	// Cancel reading from the endpoint
 	
 	iClientDriver.ReadCancel(iEndpoint);
-	OstTraceFunctionExit1( CENDPOINTREADER_DOCANCEL_EXIT, this );
 	}
 	
 	
 void CEndpointReader::RunL()
 	{
-	OstTraceFunctionEntry1( CENDPOINTREADER_RUNL_ENTRY, this );
-	OstTrace1(TRACE_NORMAL, CENDPOINTREADER_RUNL, "Endpoint %d", iEndpoint);
-	OstTrace1(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP01, "Completion Action %d", iCompletionAction);
+	LOG_FUNC
+	RDebug::Printf("Endpoint %d", iEndpoint);
+	RDebug::Printf("Completion Action %d", iCompletionAction);
 	TCompletionAction completionAction = iCompletionAction;
 	iCompletionAction = ENone; //reset here in case of 'early' returns
 	
@@ -209,7 +189,7 @@
 	
 	if(completionCode != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP02, "<Error> void CEndpointReader::RunL()completed with ERROR %d", completionCode);
+		RDebug::Printf("<Error> void CEndpointReader::RunL()completed with ERROR %d", completionCode);
 		
 		// Nak the packet received
 		iClientDriver.HaltEndpoint(iEndpoint);
@@ -220,7 +200,7 @@
 			}
 		else
 			{
-			OstTrace0(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP03, "No handler set");
+			RDebug::Printf("No handler set");
 			}
 		}
 	else
@@ -230,7 +210,7 @@
 		ent = ent==0?1:ent;
 		for(TInt i=0; i<iDataBuffer->Length(); i+=ent)
 			{
-			OstTraceExt3(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP04, "byte %d %02x %c",i,(*iDataBuffer)[i],(*iDataBuffer)[i]);
+			RDebug::Printf("byte %d %02x %c",i,(*iDataBuffer)[i],(*iDataBuffer)[i]);
 			}
 
 		if(iHandler)
@@ -239,18 +219,18 @@
 			}
 		else
 			{
-			OstTrace0(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP05, "No handler set");
+			RDebug::Printf("No handler set");
 			}
 		
 		if(completionAction==EHaltEndpoint)
 			{
-			OstTrace0(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP06, "Halting Endpoint");
+			RDebug::Printf("Halting Endpoint");
 			iClientDriver.HaltEndpoint(iEndpoint);
 			}
 
 		if(completionAction==ERepeatedRead)
 			{
-			OstTrace0(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP07, "Repeated Read");
+			RDebug::Printf("Repeated Read");
 			iCompletionAction = ERepeatedRead;
 			
 			//Prepare to validate
@@ -260,16 +240,16 @@
 			TInt err = iDataPtr.Compare(valDesc);
 
 			iNumBytesReadSoFar += iDataPtr.Length();
-			OstTraceExt2(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP08, "Bytes read so far %u, Total bytes to read %u", iNumBytesReadSoFar, iRepeatedReadTotalNumBytes);
+			RDebug::Printf("Bytes read so far %d, Total bytes to read %d", iNumBytesReadSoFar, iRepeatedReadTotalNumBytes);
 
 			if(err!=0)
 				{
-				OstTraceExt3(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP09, "Validation Result %d, Validation String Length %d, Bytes Actually Read %d", err, valDesc.Length(), iDataPtr.Length());
-				OstTrace0(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP10, "Expected string, followed by read string");
-                OstTraceData(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP50, "", valDesc.Ptr(), valDesc.Length());
-				OstTrace0(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP11, "\n");
-                OstTraceData(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP51, "", iDataPtr.Ptr(), iDataPtr.Length());
-				OstTrace0(TRACE_NORMAL, CENDPOINTREADER_RUNL_DUP12, "\n");
+				RDebug::Printf("Validation Result %d, Validation String Length %d, Bytes Actually Read %d", err, valDesc.Length(), iDataPtr.Length());
+				RDebug::Printf("Expected string, followed by read string");
+				RDebug::RawPrint(valDesc);
+				RDebug::Printf("\n");
+				RDebug::RawPrint(iDataPtr);
+				RDebug::Printf("\n");
 				iIsValid = EFalse; //record validation error
 				}
 			
@@ -288,20 +268,18 @@
 				}
 			}
 		}
-	OstTraceFunctionExit1( CENDPOINTREADER_RUNL_EXIT, this );
 	}
 
 TInt CEndpointReader::RunError(TInt aError)
 	{
-	OstTraceFunctionEntryExt( CENDPOINTREADER_RUNERROR_ENTRY, this );
+	LOG_FUNC
 	
-	OstTrace1(TRACE_NORMAL, CENDPOINTREADER_RUNERROR, "<Leaving Error> void CEndpointReader::RunError()called with ERROR %d", aError);
+	RDebug::Printf("<Leaving Error> void CEndpointReader::RunError()called with ERROR %d", aError);
 
 	// Nak the packet received
 	iClientDriver.HaltEndpoint(iEndpoint);
 
 	aError = KErrNone;	
-	OstTraceFunctionExitExt( CENDPOINTREADER_RUNERROR_EXIT, this, aError );
 	return aError;
 	}
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/endpointwriter.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/endpointwriter.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -13,7 +13,7 @@
 // Description:
 // @file endpointwriter.cpp
 // @internalComponent
-//
+// 
 //
 
 #include <e32base.h>
@@ -21,10 +21,6 @@
 #include <d32usbc.h>
 #include "endpointwriter.h"
 #include "testdebug.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "endpointwriterTraces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -37,54 +33,48 @@
 	iEndpoint(aEndpoint),
 	iBufPtr(NULL,0)
 	{
-	OstTraceFunctionEntryExt( CENDPOINTWRITER_CENDPOINTWRITER_ENTRY, this );
 	CActiveScheduler::Add(this);
-	OstTraceFunctionExit1( CENDPOINTWRITER_CENDPOINTWRITER_EXIT, this );
 	}
-
-
+	
+					
 CEndpointWriter::~CEndpointWriter()
 	{
-	OstTraceFunctionEntry1( CENDPOINTWRITER_CENDPOINTWRITER_ENTRY_DUP01, this );
-
+	LOG_FUNC
+	
 	Cancel();
 	if(iBuffer)
 		{
-		OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_DCENDPOINTWRITER, "Freeing %d bytes", iBuffer->Size());
+		RDebug::Printf("Freeing %d bytes", iBuffer->Size());
 		}
 	delete iBuffer;
-	OstTraceFunctionExit1( CENDPOINTWRITER_CENDPOINTWRITER_EXIT_DUP01, this );
 	}
 
 
 void CEndpointWriter::DoCancel()
 	{
-	OstTraceFunctionEntry1( CENDPOINTWRITER_DOCANCEL_ENTRY, this );
-
+	LOG_FUNC
+	
 	// Cancel the write to the endpoint
-
+	
 	iClientDriver.WriteCancel(iEndpoint);
-	OstTraceFunctionExit1( CENDPOINTWRITER_DOCANCEL_EXIT, this );
 	}
-
-
+	
+	
 TUint CEndpointWriter::NumBytesWrittenSoFar()
 	{
-	OstTraceFunctionEntry1( CENDPOINTWRITER_NUMBYTESWRITTENSOFAR_ENTRY, this );
-	OstTraceFunctionExitExt( CENDPOINTWRITER_NUMBYTESWRITTENSOFAR_EXIT, this, iNumBytesWritten );
 	return iNumBytesWritten;
 	}
 
 void CEndpointWriter::RunL()
 	{
-	OstTraceFunctionEntry1( CENDPOINTWRITER_RUNL_ENTRY, this );
-
+	LOG_FUNC
+	
 	TInt completionCode(iStatus.Int());
-	OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_RUNL, "Write completed, err=%d",completionCode);
-
+	RDebug::Printf("Write completed, err=%d",completionCode);
+	
 	iNumBytesWritten += iNumBytesOnCurrentWrite; // all zero if not a repeated write
 	if(iNumBytesWritten < iTotalNumBytes)
-		//This conditional will not be entered for non-repeat cases because then
+		//This conditional will not be entered for non-repeat cases because then 
 		//'iNumBytesWritten' and 'iTotalNumBytes' will both be zero.
 		{
 		TUint totalNumBytesStillToWrite = iTotalNumBytes - iNumBytesWritten;
@@ -95,30 +85,30 @@
 		//Only add a ZLP, if requested and if the last 'Write'
 		TBool useUsb = totalNumBytesStillToWrite <= iNumBytesOnCurrentWrite ? iUseZLP : EFalse;
 		TPtrC8 writeDesc = iBufPtr.Mid(iNumBytesWritten%iDataPatternLength, iNumBytesOnCurrentWrite);
-		OstTraceExt4(TRACE_NORMAL, CENDPOINTWRITER_RUNL_DUP01, "Total Bytes To Write = %u, Bytes Still To Write = %u, Bytes Written = %d, Bytes on Current Write = %d", iTotalNumBytes, totalNumBytesStillToWrite, iNumBytesWritten, iNumBytesOnCurrentWrite);
-
-		OstTrace0(TRACE_NORMAL, CENDPOINTWRITER_RUNL_DUP02, "\n");
-		OstTrace0(TRACE_NORMAL, CENDPOINTWRITER_RUNL_DUP03, "First 256 bytes (or all) of data to write");
-		OstTraceData(TRACE_NORMAL, CENDPOINTWRITER_RUNL_DUP53, "", writeDesc.Ptr(), writeDesc.Length());
-		OstTrace0(TRACE_NORMAL, CENDPOINTWRITER_RUNL_DUP04, "\n");
-
-
+		RDebug::Printf("Total Bytes To Write = %d, Bytes Still To Write = %d, Bytes Written = %d, Bytes on Current 'Write'", iTotalNumBytes, totalNumBytesStillToWrite, iNumBytesWritten, iNumBytesOnCurrentWrite);
+		 
+		RDebug::Printf("\n");
+		RDebug::Printf("First 256 bytes (or all) of data to write");
+		RDebug::RawPrint(writeDesc);
+		RDebug::Printf("\n");
+		
+		
 		Write(writeDesc, useUsb, EFalse);
 		}
 	else
 		{
 		if(iBuffer!=NULL)
 			{
-			OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_RUNL_DUP05, "Freeing %d bytes", iBuffer->Size());
+			RDebug::Printf("Freeing %d bytes", iBuffer->Size());
 			}
 		else
 			{
-			OstTrace0(TRACE_NORMAL, CENDPOINTWRITER_RUNL_DUP06, "iBuffer is NULL");
+			RDebug::Printf("iBuffer is NULL");
 			}
 		if(iTotalNumBytes != 0)
 			//if a repeated write
 			{
-			OstTraceExt2(TRACE_NORMAL, CENDPOINTWRITER_RUNL_DUP07, "Total Bytes = %u, Bytes Written = %u", iTotalNumBytes, iNumBytesWritten);
+			RDebug::Printf("Total Bytes = %d, Bytes Written = %d", iTotalNumBytes, iNumBytesWritten);
 			}
 		delete iBuffer;
 		iBuffer = 0;
@@ -128,36 +118,33 @@
 		iDataPatternLength = 0;
 		iUseZLP = EFalse;
 		}
-	OstTraceFunctionExit1( CENDPOINTWRITER_RUNL_EXIT, this );
 	}
 
 
 TInt CEndpointWriter::RunError(TInt aError)
 	{
-	OstTraceFunctionEntryExt( CENDPOINTWRITER_RUNERROR_ENTRY, this );
-
+	LOG_FUNC
+	
 	aError = KErrNone;
-	OstTraceFunctionExitExt( CENDPOINTWRITER_RUNERROR_EXIT, this, aError );
 	return aError;
 	}
 
 
 void CEndpointWriter::Write(const TDesC8& aData, TBool aUseZLP, TBool aCreateBuffer)
 	{
-	OstTraceFunctionEntryExt( CENDPOINTWRITER_WRITE_ENTRY, this );
-
+	LOG_FUNC
+	
   	if(aCreateBuffer == EFalse)
   		{
-  		OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_WRITE, "Use ZLP %d", aUseZLP?1:0);
+  		RDebug::Printf("Use ZLP %d", aUseZLP?1:0);
   		iClientDriver.Write(iStatus,iEndpoint,aData,aData.Length(),aUseZLP);
   		SetActive();
- 		OstTraceFunctionExit1( CENDPOINTWRITER_WRITE_EXIT, this );
  		return;
   		}
 
-
+	
 	//Copy aData to this object's buffer
-	//'aData' will go out of scope before the USB driver 'Write' completes
+	//'aData' will go out of scope before the USB driver 'Write' completes	
 	delete iBuffer;
   	iBuffer = NULL;
 	iBuffer = HBufC8::NewL(aData.Length());
@@ -165,33 +152,32 @@
 	iBufPtr.Copy(aData);
 
 	// Write the data to the host through the endpoint (host opened pipe)
-	OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_WRITE_DUP01, "Write Length = %d", iBufPtr.Length());
-	OstTraceData(TRACE_NORMAL, CENDPOINTWRITER_WRITE_DUP51, "", iBufPtr.Ptr(), iBufPtr.Length());
-	OstTrace0(TRACE_NORMAL, CENDPOINTWRITER_WRITE_DUP02, "\n");
-	OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_WRITE_DUP03, "Use ZLP %d", aUseZLP?1:0);
+	RDebug::Printf("Write Length = %d", iBufPtr.Length());
+	RDebug::RawPrint(iBufPtr);
+	RDebug::Printf("\n");
+	RDebug::Printf("Use ZLP %d", aUseZLP?1:0);
 	iClientDriver.Write(iStatus,iEndpoint,iBufPtr,iBufPtr.Length(),aUseZLP);
 	SetActive();
-	OstTraceFunctionExit1( CENDPOINTWRITER_WRITE_EXIT_DUP01, this );
 	}
 
 TInt CEndpointWriter::WriteSynchronous(const TDesC8& aData, TBool aUseZLP)
 	{
-	OstTraceFunctionEntryExt( CENDPOINTWRITER_WRITESYNCHRONOUS_ENTRY, this );
-
+	LOG_FUNC
+	
 	TRequestStatus status = KRequestPending;
-	OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_WRITESYNCHRONOUS, "Write Length = %d", aData.Length());
-	OstTraceData(TRACE_NORMAL, CENDPOINTWRITER_WRITESYNCHRONOUS_DUP50, "", aData.Ptr(), aData.Length());
-	OstTrace0(TRACE_NORMAL, CENDPOINTWRITER_WRITESYNCHRONOUS_DUP01, "\n");
-	OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_WRITESYNCHRONOUS_DUP02, "Use ZLP %d", aUseZLP?1:0);
+	RDebug::Printf("Write Length = %d", aData.Length());
+	RDebug::RawPrint(aData);
+	RDebug::Printf("\n");
+	RDebug::Printf("Use ZLP %d", aUseZLP?1:0);
 	iClientDriver.Write(status,iEndpoint,aData,aData.Length(),aUseZLP);
 	User::WaitForRequest(status);
-	OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_WRITESYNCHRONOUS_DUP03, "Write has completed with error %d", status.Int());
+	RDebug::Printf("Write has completed with error %d", status.Int());
 	return status.Int();
 	}
 
 void CEndpointWriter::WriteSynchronousUsingPatternL(const TDesC8& aData, const TUint aNumBytes, const TBool aUseZLP)
 	{
-    OstTraceFunctionEntryExt( CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNL_ENTRY, this );
+	LOG_FUNC
 
 	TBool useZLP = EFalse; //only want this if you are making the last call to client Write (=WriteSynchronous)
 	if(aNumBytes <= aData.Length())
@@ -260,33 +246,29 @@
 		}
 	delete iBuffer;
 	iBuffer = 0;
-	OstTraceFunctionExit1( CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNL_EXIT, this );
 	}
 
 void CEndpointWriter::WriteSynchronousUsingPatternL(const TDesC8& aData, const TUint aNumBytes)
 	{
-	OstTraceFunctionEntryExt( CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNL_ENTRY_DUP01, this );
 	WriteSynchronousUsingPatternL(aData, aNumBytes, ETrue);
-	OstTraceFunctionExit1( CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNL_EXIT_DUP01, this );
 	}
 
 void CEndpointWriter::WriteSynchronousUsingPatternAndHaltL(const TDesC8& aData, const TUint aNumBytes)
 	{
-	OstTraceFunctionEntryExt( CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNANDHALTL_ENTRY, this );
+	LOG_FUNC
 	WriteSynchronousUsingPatternL(aData, aNumBytes, EFalse);
 	iClientDriver.HaltEndpoint(iEndpoint);
-	OstTraceFunctionExit1( CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNANDHALTL_EXIT, this );
 	}
 
 void CEndpointWriter::WriteUsingPatternL(const TDesC8& aData, const TUint aNumBytes, const TBool aUseZLP)
 	{
-    OstTraceFunctionEntryExt( CENDPOINTWRITER_WRITEUSINGPATTERNL_ENTRY, this );
+	LOG_FUNC
 
-	OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_WRITEUSINGPATTERNL, "Allocating %d bytes", aNumBytes);
+	RDebug::Printf("Allocating %d bytes", aNumBytes);
   	delete iBuffer;
   	iBuffer = NULL;
 	iBuffer = HBufC8::NewL(aNumBytes);
-	OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_WRITEUSINGPATTERNL_DUP01, "Allocated %d bytes", aNumBytes);
+	RDebug::Printf("Allocated %d bytes", aNumBytes);
 	iBufPtr.Set(iBuffer->Des());
 	iBufPtr.Zero();
 	TInt repeats = aNumBytes/aData.Length();
@@ -299,12 +281,11 @@
 		iBufPtr.Append(aData.Left(extraBytes));
 		}
 	Write(*iBuffer, aUseZLP, EFalse);
-	OstTraceFunctionExit1( CENDPOINTWRITER_WRITEUSINGPATTERNL_EXIT, this );
 	}
 
 void CEndpointWriter::WriteInPartsUsingPatternL(const TDesC8& aData, const TUint aNumBytesPerWrite, TUint aTotalNumBytes, const TBool aUseZLP)
 	{
-    OstTraceFunctionEntryExt( CENDPOINTWRITER_WRITEINPARTSUSINGPATTERNL_ENTRY, this );
+	LOG_FUNC
 
 	iUseZLP = aUseZLP;
 	TInt repeats = aNumBytesPerWrite/aData.Length() + 1;
@@ -315,9 +296,8 @@
 	iNumBytesOnCurrentWrite = aNumBytesPerWrite;
 	iNumBytesWritten = 0;
 	Write(iBufPtr.Mid(iNumBytesWritten%iDataPatternLength, iNumBytesOnCurrentWrite), EFalse, EFalse); //this is not the first 'Write' so do not use a ZLP
-	OstTrace1(TRACE_NORMAL, CENDPOINTWRITER_WRITEINPARTSUSINGPATTERNL, "Write %d bytes",iNumBytesOnCurrentWrite);
-	OstTraceExt2(TRACE_NORMAL, CENDPOINTWRITER_WRITEINPARTSUSINGPATTERNL_DUP01, "Total Bytes = %u, Data Pattern Length = %u", iTotalNumBytes, iDataPatternLength);
-	OstTraceFunctionExit1( CENDPOINTWRITER_WRITEINPARTSUSINGPATTERNL_EXIT, this );
+	RDebug::Printf("Write %d bytes",iNumBytesOnCurrentWrite);
+	RDebug::Printf("Total Bytes = %d, Data Pattern Length = %d", iTotalNumBytes, iDataPatternLength);
 	}
 
 void CEndpointWriter::CreateBigBuffer(const TDesC8& aData, const TUint aRepeats)
@@ -325,12 +305,11 @@
 Create a payload buffer a section of which can always be used for each cyclic 'Write'.
 */
 	{
-	OstTraceFunctionEntryExt( CENDPOINTWRITER_CREATEBIGBUFFER_ENTRY, this );
 	//We require a buffer containing a sufficient number of repeats of the data pattern
 	//to allow us simply to use a section of it for any individual 'Write' payload.
  	delete iBuffer;
  	iBuffer = NULL;
- 	OstTraceExt2(TRACE_NORMAL, CENDPOINTWRITER_CREATEBIGBUFFER, "Data buffer is using %u repeats of string starting...\n\"%s\"", aRepeats, aData);
+ 	RDebug::Printf("Data buffer is using %d repeats of string starting...\n\"%S\"", aRepeats, &aData);
  	iBuffer = HBufC8::NewL(aRepeats*aData.Length());
 	iBufPtr.Set(iBuffer->Des());
 	iBufPtr.Zero();
@@ -338,7 +317,6 @@
   		{
   		iBufPtr.Append(aData);
   		}
-	OstTraceFunctionExit1( CENDPOINTWRITER_CREATEBIGBUFFER_EXIT, this );
 	}
 
 	}
--- a/kerneltest/e32test/usbho/t_usbdi/src/hostbulktransfers.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/hostbulktransfers.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -17,10 +17,6 @@
 //
 
 #include "hosttransfers.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "hostbulktransfersTraces.h"
-#endif
 #include <e32debug.h>
 
 namespace NUnitTesting_USBDI
@@ -31,65 +27,60 @@
 :	CBaseTransfer(aPipe,aInterface,aObserver,aTransferId),
 	iTransferDescriptor(aMaxTransferSize) // Allocate the buffer for bulk transfers
 	{
-    OstTraceFunctionEntryExt( CBULKTRANSFER_CBULKTRANSFER_ENTRY, this );
 
 	// Register the transfer descriptor with the interface
 	
 	TInt err(Interface().RegisterTransferDescriptor(iTransferDescriptor));
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CBULKTRANSFER_CBULKTRANSFER, "<Error %d> Unable to register transfer descriptor",err);
+		RDebug::Printf("<Error %d> Unable to register transfer descriptor",err);
 		}
-	OstTraceFunctionExit1( CBULKTRANSFER_CBULKTRANSFER_EXIT, this );
 	}
 	
 	
 CBulkTransfer::~CBulkTransfer()
 	{
-	OstTraceFunctionEntry1( CBULKTRANSFER_CBULKTRANSFER_ENTRY_DUP01, this );
+	LOG_FUNC
 	
 	// Cancel the transfer
 
 	Cancel();
-	OstTraceFunctionExit1( CBULKTRANSFER_CBULKTRANSFER_EXIT_DUP01, this );
 	}
 	
 	
 TPtrC8 CBulkTransfer::DataPolled()
 	{
-	OstTraceFunctionEntry1( CBULKTRANSFER_DATAPOLLED_ENTRY, this );
 	return iTransferDescriptor.Buffer();
 	}
 
 
 void CBulkTransfer::TransferIn(TInt aExpectedDataSize)
 	{
-	OstTraceFunctionEntryExt( CBULKTRANSFER_TRANSFERIN_ENTRY, this );
+	LOG_FUNC
 	
 	// Activate the asynchronous transfer 
 	
-	OstTrace0(TRACE_NORMAL, CBULKTRANSFER_TRANSFERIN, "Activating bulk in transfer");
+	RDebug::Printf("Activating bulk in transfer");
 	iTransferDescriptor.SaveData(aExpectedDataSize);
 	Pipe().Transfer(iTransferDescriptor,iStatus);
 	SetActive();
-	OstTraceFunctionExit1( CBULKTRANSFER_TRANSFERIN_EXIT, this );
 	}
 
 void CBulkTransfer::TransferOut(const TDesC8& aBulkData, TBool aUseZLPIfRequired)
 	{
-    OstTraceFunctionEntryExt( CBULKTRANSFER_TRANSFEROUT_ENTRY, this );
+	LOG_FUNC
 
 	// Copy the data across
 	if(aBulkData.Length() > iTransferDescriptor.iMaxSize)
 		{
-		OstTrace0(TRACE_NORMAL, CBULKTRANSFER_TRANSFEROUT, "Too much data in bulk transfer. This test suite will now PANIC!");
-		OstTraceExt2(TRACE_NORMAL, CBULKTRANSFER_TRANSFEROUT_DUP01, "Bytes requested %d, Max allowed %d", aBulkData.Length(), iTransferDescriptor.iMaxSize);
+		RDebug::Printf("Too much data in bulk transfer. This test suite will now PANIC!");
+		RDebug::Printf("Bytes requested %d, Max allowed %d", aBulkData.Length(), iTransferDescriptor.iMaxSize);
 		ASSERT(EFalse);
 		}
 		
 	TPtr8 buffer = iTransferDescriptor.WritableBuffer();
 	buffer.Copy(aBulkData);
-	OstTrace1(TRACE_NORMAL, CBULKTRANSFER_TRANSFEROUT_DUP02, "Transfer buffer now has %d bytes to write",buffer.Length());
+	RDebug::Printf("Transfer buffer now has %d bytes to write",buffer.Length());
 	iTransferDescriptor.SaveData(buffer.Length());
 	if(aUseZLPIfRequired)
 		{
@@ -102,35 +93,33 @@
 	
 	// Activate the asynchronous transfer 
 	
-	OstTrace0(TRACE_NORMAL, CBULKTRANSFER_TRANSFEROUT_DUP03, "Activating bulk out transfer");
+	RDebug::Printf("Activating bulk out transfer");
 	Pipe().Transfer(iTransferDescriptor,iStatus);
 	SetActive();
-	OstTraceFunctionExit1( CBULKTRANSFER_TRANSFEROUT_EXIT, this );
 	}
 
 void CBulkTransfer::TransferOut(const TDesC8& aBulkDataPattern, TUint aNumBytes, TBool aUseZLPIfRequired)
 	{
-	OstTraceFunctionEntryExt( CBULKTRANSFER_TRANSFEROUT_ENTRY_DUP01, this );
+	LOG_FUNC
 	
 	TransferOut(aBulkDataPattern, 0, aNumBytes, aUseZLPIfRequired);
-	OstTraceFunctionExit1( CBULKTRANSFER_TRANSFEROUT_EXIT_DUP01, this );
 	}
 
 
 void CBulkTransfer::TransferOut(const TDesC8& aBulkDataPattern, TUint aStartPoint, TUint aNumBytes, TBool aUseZLPIfRequired)
 	{
-    OstTraceFunctionEntryExt( CBULKTRANSFER_TRANSFEROUT_ENTRY_DUP02, this );
+	LOG_FUNC
 
 	// Copy the data across
 	if(aNumBytes > iTransferDescriptor.iMaxSize)
 		{
-		OstTrace0(TRACE_NORMAL, CBULKTRANSFER_TRANSFEROUT_DUP10, "Too much data in bulk transfer. This test suite will now PANIC!");
-		OstTraceExt2(TRACE_NORMAL, CBULKTRANSFER_TRANSFEROUT_DUP11, "Bytes requested %d, Max allowed %d", aNumBytes, iTransferDescriptor.iMaxSize);
+		RDebug::Printf("Too much data in bulk transfer. This test suite will now PANIC!");
+		RDebug::Printf("Bytes requested %d, Max allowed %d", aNumBytes, iTransferDescriptor.iMaxSize);
 		ASSERT(EFalse);
 		}
 	if(aBulkDataPattern.Length()<=0)
 		{
-		OstTrace0(TRACE_NORMAL, CBULKTRANSFER_TRANSFEROUT_DUP12, "ZERO LENGTH data pattern used in TransferOut. This test suite will now PANIC!");
+		RDebug::Printf("ZERO LENGTH data pattern used in TransferOut. This test suite will now PANIC!");
 		ASSERT(EFalse);
 		}
 	TUint startPoint = aStartPoint%aBulkDataPattern.Length();
@@ -151,7 +140,7 @@
 		{
 		buffer.Append(aBulkDataPattern.Left(numEndBytes));
 		}
-	OstTrace1(TRACE_NORMAL, CBULKTRANSFER_TRANSFEROUT_DUP13, "Transfer buffer now has %d bytes to write",buffer.Length());
+	RDebug::Printf("Transfer buffer now has %d bytes to write",buffer.Length());
 	iTransferDescriptor.SaveData(buffer.Length());	
 	if(aUseZLPIfRequired)
 		{
@@ -164,10 +153,9 @@
 	
 	// Activate the asynchronous transfer 
 	
-	OstTrace0(TRACE_NORMAL, CBULKTRANSFER_TRANSFEROUT_DUP14, "Activating bulk out transfer");
+	RDebug::Printf("Activating bulk out transfer");
 	Pipe().Transfer(iTransferDescriptor,iStatus);
 	SetActive();
-	OstTraceFunctionExit1( CBULKTRANSFER_TRANSFEROUT_EXIT_DUP02, this );
 	}
 
 	}
--- a/kerneltest/e32test/usbho/t_usbdi/src/hostinterrupttransfers.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/hostinterrupttransfers.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,10 +18,6 @@
 
 #include "hosttransfers.h"
 #include "testdebug.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "hostinterrupttransfersTraces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -31,53 +27,47 @@
 :	CBaseTransfer(aPipe,aInterface,aObserver,aTransferId),
 	iTransferDescriptor(aMaxTransferSize) // Allocate the buffer for interrupt transfers
 	{
-    OstTraceFunctionEntryExt( CINTERRUPTTRANSFER_CINTERRUPTTRANSFER_ENTRY, this );
 
-	OstTraceFunctionExit1( CINTERRUPTTRANSFER_CINTERRUPTTRANSFER_EXIT, this );
 	}
 	
 CInterruptTransfer::~CInterruptTransfer()
 	{
-	OstTraceFunctionEntry1( CINTERRUPTTRANSFER_CINTERRUPTTRANSFER_ENTRY_DUP01, this );
+	LOG_FUNC 
 	
 	// Cancel the transfer
 
 	Cancel();
-	OstTraceFunctionExit1( CINTERRUPTTRANSFER_CINTERRUPTTRANSFER_EXIT_DUP01, this );
 	}
 	
 	
 TPtrC8 CInterruptTransfer::DataPolled()
 	{
-	OstTraceFunctionEntry1( CINTERRUPTTRANSFER_DATAPOLLED_ENTRY, this );
 	return iTransferDescriptor.Buffer();
 	}
 	
 	
 TInt CInterruptTransfer::TransferInL(TInt aSize)
 	{
-	OstTraceFunctionEntryExt( CINTERRUPTTRANSFER_TRANSFERINL_ENTRY, this );
+	LOG_FUNC
 	
 	// Activate the asynchronous transfer 	
-	OstTrace0(TRACE_NORMAL, CINTERRUPTTRANSFER_TRANSFERINL, "Activating interrupt in transfer");
+	RDebug::Printf("Activating interrupt in transfer");
 	iTransferDescriptor.SaveData(aSize);
 	Pipe().Transfer(iTransferDescriptor,iStatus);
 	SetActive();
-	OstTraceFunctionExitExt( CINTERRUPTTRANSFER_TRANSFERINL_EXIT, this, KErrNone );
 	return KErrNone;
 	}
 
 TInt CInterruptTransfer::RegisterTransferDescriptor()
 	{
-	OstTraceFunctionEntry1( CINTERRUPTTRANSFER_REGISTERTRANSFERDESCRIPTOR_ENTRY, this );
+	LOG_FUNC
 	
 	// Register the transfer descriptor with the interface	
 	TInt err(Interface().RegisterTransferDescriptor(iTransferDescriptor));
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CINTERRUPTTRANSFER_REGISTERTRANSFERDESCRIPTOR, "<Error %d> Unable to register transfer descriptor",err);
+		RDebug::Printf("<Error %d> Unable to register transfer descriptor",err);
 		}
-	OstTraceFunctionExitExt( CINTERRUPTTRANSFER_REGISTERTRANSFERDESCRIPTOR_EXIT, this, err );
 	return err;
 	}
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/hostisochronoustransfers.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/hostisochronoustransfers.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -17,10 +17,6 @@
 //
 
 #include "hosttransfers.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "hostisochronoustransfersTraces.h"
-#endif
 #include <e32debug.h>
 #include <e32test.h>
 
@@ -35,24 +31,21 @@
 	iTransferDescriptor(aMaxPacketSize,aMaxNumPackets),
 	iMaxPacketSize(aMaxPacketSize)
 	{
-	OstTraceFunctionEntryExt( CISOCHTRANSFER_CISOCHTRANSFER_ENTRY, this );
-	OstTraceExt2(TRACE_NORMAL, CISOCHTRANSFER_CISOCHTRANSFER, "aMaxPacketSize = %d, aMaxNumPackets = %d",aMaxPacketSize, aMaxNumPackets);
-	OstTraceFunctionExit1( CISOCHTRANSFER_CISOCHTRANSFER_EXIT, this );
+	RDebug::Printf("aMaxPacketSize = %d, aMaxNumPackets = %d",aMaxPacketSize, aMaxNumPackets);
 	}
 	
 CIsochTransfer::~CIsochTransfer()
 	{
-	OstTraceFunctionEntry1( CISOCHTRANSFER_CISOCHTRANSFER_ENTRY_DUP01, this );
+	LOG_FUNC
 	
 	// Cancel the transfer
 
 	Cancel();
-	OstTraceFunctionExit1( CISOCHTRANSFER_CISOCHTRANSFER_EXIT_DUP01, this );
 	}	
 	
 TBool CIsochTransfer::DataPolled(TUint aPacketsToBeRead, RBuf8& aDataPolled) 
 	{
-	OstTraceFunctionEntryExt( CISOCHTRANSFER_DATAPOLLED_ENTRY, this );
+	LOG_FUNC
 	TInt numOfPacketsReturned = 0;	
 	
 	TInt firstPacketIndex = 0;
@@ -64,27 +57,26 @@
 		
 	do {						
 		TPtrC8 ptrRet = iTransferDescriptor.Packets(firstPacketIndex, packetsToBeRead, numOfPacketsReturned); 
-		OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_DATAPOLLED, "numOfPacketsReturned = %d", numOfPacketsReturned);
-		OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_DATAPOLLED_DUP01, "ptrRet.Length() = %d", ptrRet.Length());
+		RDebug::Printf("numOfPacketsReturned = %d", numOfPacketsReturned);
+		RDebug::Printf("ptrRet.Length() = %d", ptrRet.Length());
 		firstPacketIndex = numOfPacketsReturned;
 		totalPacketsRead += numOfPacketsReturned;
 		packetsToBeRead = packetsToBeRead - numOfPacketsReturned;
-		OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_DATAPOLLED_DUP02, "totalPacketsRead = %d", totalPacketsRead);	
-		OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_DATAPOLLED_DUP03, "packetsToBeRead = %d", packetsToBeRead);	
+		RDebug::Printf("totalPacketsRead = %d", totalPacketsRead);	
+		RDebug::Printf("packetsToBeRead = %d", packetsToBeRead);	
 		aDataPolled.Append(ptrRet);		
 		}	while(totalPacketsRead != aPacketsToBeRead); 	
 		
-	OstTraceFunctionExitExt( CISOCHTRANSFER_DATAPOLLED_EXIT, this, ETrue );
 	return ETrue; 
 	}
 	
 	
 TInt CIsochTransfer::TransferInL(TInt aPacketsExpected)
 	{
-	OstTraceFunctionEntryExt( CISOCHTRANSFER_TRANSFERINL_ENTRY, this );
+	LOG_FUNC
 	
 	// Activate the asynchronous transfer 	
-	OstTrace0(TRACE_NORMAL, CISOCHTRANSFER_TRANSFERINL, "Activating isoch. in transfer");
+	RDebug::Printf("Activating isoch. in transfer");
 	
 	iTransferDescriptor.Reset();
 	TPacketLengths fullLengths = iTransferDescriptor.Lengths();
@@ -94,38 +86,36 @@
 		fullLengths[packet] = iMaxPacketSize;
 		}	
 
-	OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_TRANSFERINL_DUP01, "fullLengths.MaxNumPackets() == %d",fullLengths.MaxNumPackets());
+	RDebug::Printf("fullLengths.MaxNumPackets() == %d",fullLengths.MaxNumPackets());
 	iTransferDescriptor.ReceivePackets(aPacketsExpected);
 		
 	Pipe().Transfer(iTransferDescriptor,iStatus);
 	SetActive();
-	OstTraceFunctionExitExt( CISOCHTRANSFER_TRANSFERINL_EXIT, this, KErrNone );
 	return KErrNone;																
 	}
 		
 TInt CIsochTransfer::RegisterTransferDescriptor()
 	{
-	OstTraceFunctionEntry1( CISOCHTRANSFER_REGISTERTRANSFERDESCRIPTOR_ENTRY, this );
+	LOG_FUNC
 	
 	// Register the transfer descriptor with the interface	
 	TInt err(Interface().RegisterTransferDescriptor(iTransferDescriptor));
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_REGISTERTRANSFERDESCRIPTOR, "<Error %d> Unable to register transfer descriptor",err);
+		RDebug::Printf("<Error %d> Unable to register transfer descriptor",err);
 		}
-	OstTraceFunctionExitExt( CISOCHTRANSFER_REGISTERTRANSFERDESCRIPTOR_EXIT, this, err );
 	return err;	
 	}
 	
 TInt CIsochTransfer::PrepareTransfer(const TDesC8& aIsochData)
 	{
-OstTraceFunctionEntryExt( CISOCHTRANSFER_PREPARETRANSFER_ENTRY, this );
+	LOG_FUNC
 
 	//	
 	iTransferDescriptor.Reset();
 	TPacketLengths fullLengths = iTransferDescriptor.Lengths();
 
-	OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_PREPARETRANSFER, "fullLengths.MaxNumPackets() == %d",fullLengths.MaxNumPackets());
+	RDebug::Printf("fullLengths.MaxNumPackets() == %d",fullLengths.MaxNumPackets());
 	
 	//	
 	TInt bytesRemaining(aIsochData.Size());
@@ -133,7 +123,7 @@
 	TInt startOffset(0);
 	TInt startPacket(0); 
 	
-	OstTrace1(TRACE_NORMAL, CISOCHTRANSFER_PREPARETRANSFER_DUP01, "Audio data is %d bytes",bytesRemaining);
+	RDebug::Printf("Audio data is %d bytes",bytesRemaining);
 	
 	// Keep saving the isoch data to transfer in each packet buffer supplied 
 	// by the transfer descriptor
@@ -146,7 +136,7 @@
 		
 		if(dataToWrite == 0)
 			{
-			OstTrace0(TRACE_NORMAL, CISOCHTRANSFER_PREPARETRANSFER_DUP02, "<Warning> dropping the rest of the isoch data");
+			RDebug::Printf("<Warning> dropping the rest of the isoch data");
 			break;
 			}
 		
@@ -167,18 +157,15 @@
 		startOffset += maxPacket * iMaxPacketSize;
 		startPacket += maxPacket;
 		}	
-	OstTraceFunctionExitExt( CISOCHTRANSFER_PREPARETRANSFER_EXIT, this, KErrNone );
 	return KErrNone;
 	}
 
 TInt CIsochTransfer::TransferOut()
 	{	
-	OstTraceFunctionEntry1( CISOCHTRANSFER_TRANSFEROUT_ENTRY, this );
 	// Transfer the iscohronous data	
-	OstTrace0(TRACE_NORMAL, CISOCHTRANSFER_TRANSFEROUT, "Activating isochronous out transfer");
+	RDebug::Printf("Activating isochronous out transfer");
 	Pipe().Transfer(iTransferDescriptor,iStatus);
 	SetActive();
-	OstTraceFunctionExitExt( CISOCHTRANSFER_TRANSFEROUT_EXIT, this, KErrNone );
 	return KErrNone;
 	}
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/main.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/main.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -22,10 +22,6 @@
 
 #include "testdebug.h"
 #include "TestEngine.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "mainTraces.h"
-#endif
 
 using namespace NUnitTesting_USBDI;
 
@@ -35,7 +31,7 @@
 
 static void MainL()
 	{
-	OstTraceFunctionEntry0( _MAINL_ENTRY );
+	LOG_CFUNC
 	// Leave the hooks in for platform security
 #ifdef __DATA_CAGING__
 	RProcess().DataCaging(RProcess::EDataCagingOn);
@@ -64,7 +60,7 @@
 		RProcess::Rendezvous(KErrNone);
 
         User::After(150000);
-		OstTrace0(TRACE_NORMAL, MAINL_MAINL, "CActiveScheduler::Start MainL");	
+		RDebug::Print(_L("CActiveScheduler::Start MainL"));	
 		CActiveScheduler::Start();
 		
 		CleanupStack::PopAndDestroy(testEngine);
@@ -72,23 +68,20 @@
 	else
 		{
 		gtest.Printf(_L("Unable to create the test engine: %d\n"),err);
-		OstTrace1(TRACE_NORMAL, MAINL_MAINL_DUP01, "Unable to create the test engine: %d\n",err);
 		}
 		
 	User::After(5000000);
 	CleanupStack::PopAndDestroy(sched);		
-	OstTraceFunctionExit0( _MAINL_EXIT );
 	}
 
 TInt E32Main()
 	{
-	OstTraceFunctionEntry0( _E32MAIN_ENTRY );
+	LOG_CFUNC
 	// Create the new trap-cleanup mechanism
 	CTrapCleanup* cleanup = CTrapCleanup::New();
 	
 	if(cleanup == NULL)
 		{
-		OstTraceFunctionExit0( _E32MAIN_EXIT );
 		return KErrNoMemory;
 		}
 		
@@ -97,13 +90,11 @@
 	if(err != KErrNone)
 		{
 		gtest.Printf(_L("MainL error: %d\n"),err);		
-		OstTrace1(TRACE_NORMAL, E32MAIN_E32MAIN, "MainL error: %d\n",err);		
 		}
 	
 	delete cleanup;
 	
 	// Provide no error
-	OstTraceFunctionExit0( _E32MAIN_EXIT_DUP01 );
 	return KErrNone;
 	}
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/testdeviceA.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/testdeviceA.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,12 +19,6 @@
 #include "modelleddevices.h"
 #include "testinterfacebase.h"
 #include "testinterfacesettingbase.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testdeviceATraces.h"
-#endif
-
-
 
 
 namespace NUnitTesting_USBDI
@@ -32,26 +26,23 @@
 	
 RUsbDeviceA::RUsbDeviceA()
 	{
-	OstTraceFunctionEntry1( RUSBDEVICEA_RUSBDEVICEA_ENTRY, this );
-	OstTraceFunctionExit1( RUSBDEVICEA_RUSBDEVICEA_EXIT, this );
+	LOG_FUNC
 	}
 	
 RUsbDeviceA::RUsbDeviceA(CBaseTestCase* aTestCase):RUsbDeviceVendor(aTestCase)
 	{
-	OstTraceFunctionEntryExt( RUSBDEVICEA_RUSBDEVICEA_ENTRY_DUP01, this );
-	OstTraceFunctionExit1( RUSBDEVICEA_RUSBDEVICEA_EXIT_DUP01, this );
+	LOG_FUNC
 	}
 	
 RUsbDeviceA::~RUsbDeviceA()
 	{
-	OstTraceFunctionEntry1( RUSBDEVICEA_RUSBDEVICEA_ENTRY_DUP02, this );
-	OstTraceFunctionExit1( RUSBDEVICEA_RUSBDEVICEA_EXIT_DUP02, this );
+	LOG_FUNC	
 	}
 	
 
 void RUsbDeviceA::OpenL(const TDesC16& aSerialNumber)
 	{
-	OstTraceFunctionEntryExt( RUSBDEVICEA_OPENL_ENTRY, this );
+	LOG_FUNC
 	
 	RUsbDeviceVendor::OpenL(aSerialNumber);
 	
@@ -98,14 +89,12 @@
 	
 	AddInterface(interface1);
 	CleanupStack::Pop(interface1);
-	OstTraceFunctionExit1( RUSBDEVICEA_OPENL_EXIT, this );
 	}
 
 	
 void RUsbDeviceA::OnStateChangeL(TUsbcDeviceState aNewState)
 	{
-	OstTraceFunctionEntryExt( RUSBDEVICEA_ONSTATECHANGEL_ENTRY, this );
-	OstTraceFunctionExit1( RUSBDEVICEA_ONSTATECHANGEL_EXIT, this );
+	LOG_FUNC
 	}	
 	
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/testdeviceC.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/testdeviceC.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,11 +19,6 @@
 #include "modelleddevices.h"
 #include "testinterfacebase.h"
 #include "testinterfacesettingbase.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testdeviceCTraces.h"
-#endif
-
 
 
 namespace NUnitTesting_USBDI
@@ -32,26 +27,23 @@
 
 RUsbDeviceC::RUsbDeviceC()
 	{
-	OstTraceFunctionEntry1( RUSBDEVICEC_RUSBDEVICEC_ENTRY, this );
-	OstTraceFunctionExit1( RUSBDEVICEC_RUSBDEVICEC_EXIT, this );
+	LOG_FUNC	
 	}
 	
 RUsbDeviceC::RUsbDeviceC(CBaseTestCase* aTestCase):RUsbDeviceVendor(aTestCase)
 	{
-	OstTraceFunctionEntryExt( RUSBDEVICEC_RUSBDEVICEC_ENTRY_DUP01, this );
-	OstTraceFunctionExit1( RUSBDEVICEC_RUSBDEVICEC_EXIT_DUP01, this );
+	LOG_FUNC
 	}
 	
 RUsbDeviceC::~RUsbDeviceC()
 	{
-	OstTraceFunctionEntry1( RUSBDEVICEC_RUSBDEVICEC_ENTRY_DUP02, this );
-	OstTraceFunctionExit1( RUSBDEVICEC_RUSBDEVICEC_EXIT_DUP02, this );
+	LOG_FUNC	
 	}
 	
 
 void RUsbDeviceC::OpenL(const TDesC16& aSerialNumber)
 	{
-	OstTraceFunctionEntryExt( RUSBDEVICEC_OPENL_ENTRY, this );
+	LOG_FUNC
 	
 	RUsbDeviceVendor::OpenL(aSerialNumber);
 	
@@ -112,14 +104,12 @@
 	
 	AddInterface(interface1);
 	CleanupStack::Pop(interface1);
-	OstTraceFunctionExit1( RUSBDEVICEC_OPENL_EXIT, this );
 	}
 
 	
 void RUsbDeviceC::OnStateChangeL(TUsbcDeviceState aNewState)
 	{
-	OstTraceFunctionEntryExt( RUSBDEVICEC_ONSTATECHANGEL_ENTRY, this );
-	OstTraceFunctionExit1( RUSBDEVICEC_ONSTATECHANGEL_EXIT, this );
+	LOG_FUNC
 	}	
 	
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/testdeviceD.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/testdeviceD.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,12 +19,6 @@
 #include "modelleddevices.h"
 #include "testinterfacebase.h"
 #include "testinterfacesettingbase.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testdeviceDTraces.h"
-#endif
-
-
 
 
 namespace NUnitTesting_USBDI
@@ -32,26 +26,23 @@
 	
 RUsbDeviceD::RUsbDeviceD()
 	{
-	OstTraceFunctionEntry1( RUSBDEVICED_RUSBDEVICED_ENTRY, this );
-	OstTraceFunctionExit1( RUSBDEVICED_RUSBDEVICED_EXIT, this );
+	LOG_FUNC
 	}
 	
 RUsbDeviceD::RUsbDeviceD(CBaseTestCase* aTestCase):RUsbDeviceVendor(aTestCase)
 	{
-	OstTraceFunctionEntryExt( RUSBDEVICED_RUSBDEVICED_ENTRY_DUP01, this );
-	OstTraceFunctionExit1( RUSBDEVICED_RUSBDEVICED_EXIT_DUP01, this );
+	LOG_FUNC
 	}
 	
 RUsbDeviceD::~RUsbDeviceD()
 	{
-	OstTraceFunctionEntry1( RUSBDEVICED_RUSBDEVICED_ENTRY_DUP02, this );
-	OstTraceFunctionExit1( RUSBDEVICED_RUSBDEVICED_EXIT_DUP02, this );
+	LOG_FUNC	
 	}
 	
 
 void RUsbDeviceD::OpenL(const TDesC16& aSerialNumber)
 	{
-	OstTraceFunctionEntryExt( RUSBDEVICED_OPENL_ENTRY, this );
+	LOG_FUNC
 	
 	RUsbDeviceVendor::OpenL(aSerialNumber);
 	
@@ -129,14 +120,12 @@
 	
 	AddInterface(interface2);
 	CleanupStack::Pop(interface2);
-	OstTraceFunctionExit1( RUSBDEVICED_OPENL_EXIT, this );
 	}
 
 	
 void RUsbDeviceD::OnStateChangeL(TUsbcDeviceState aNewState)
 	{
-	OstTraceFunctionEntryExt( RUSBDEVICED_ONSTATECHANGEL_ENTRY, this );
-	OstTraceFunctionExit1( RUSBDEVICED_ONSTATECHANGEL_EXIT, this );
+	LOG_FUNC
 	}	
 	
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/testdeviceb.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/testdeviceb.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,10 +19,6 @@
 #include "modelleddevices.h"
 #include "testinterfacesettingbase.h"
 #include "testinterfacebase.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testdevicebTraces.h"
-#endif
 #include <e32test.h>
 
 namespace NUnitTesting_USBDI
@@ -30,26 +26,21 @@
 
 RUsbDeviceB::RUsbDeviceB()
 	{
-	OstTraceFunctionEntry1( RUSBDEVICEB_RUSBDEVICEB_ENTRY, this );
-	OstTraceFunctionExit1( RUSBDEVICEB_RUSBDEVICEB_EXIT, this );
 	}
 	
 RUsbDeviceB::RUsbDeviceB(CBaseTestCase* aTestCase):RUsbTestDevice(aTestCase)
 	{
-	OstTraceFunctionEntryExt( RUSBDEVICEB_RUSBDEVICEB_ENTRY_DUP01, this );
-	OstTraceFunctionExit1( RUSBDEVICEB_RUSBDEVICEB_EXIT_DUP01, this );
+	LOG_FUNC	
 	}
 
 RUsbDeviceB::~RUsbDeviceB()
 	{
-	OstTraceFunctionEntry1( RUSBDEVICEB_RUSBDEVICEB_ENTRY_DUP02, this );
-	OstTraceFunctionExit1( RUSBDEVICEB_RUSBDEVICEB_EXIT_DUP02, this );
 	}
 
 
 void RUsbDeviceB::OpenL(const TDesC& aSerialNumber)
 	{
-	OstTraceFunctionEntryExt( RUSBDEVICEB_OPENL_ENTRY, this );
+	LOG_FUNC
 	
 	RUsbTestDevice::OpenL();
 	
@@ -87,7 +78,7 @@
 	TInt err(iClientDriver.SetInterface(0,interfaceSetting));
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL, "<Error %d> Unable to set interface setting 0",err);
+		RDebug::Printf("<Error %d> Unable to set interface setting 0",err);
 		User::Leave(err);
 		}
 		
@@ -98,7 +89,7 @@
 	err = iClientDriver.SetCSInterfaceDescriptorBlock(0,cs_interfaceDescriptor);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP01, "<Error %d> Unable to set class-specific interface setting 0 descriptor",err);
+		RDebug::Printf("<Error %d> Unable to set class-specific interface setting 0 descriptor",err);
 		User::Leave(err);
 		}
 
@@ -107,21 +98,21 @@
 	err = iClientDriver.SetCSEndpointDescriptorBlock(0,1,cs_endpointDescriptor);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP02, "<Error %d> Unable to set class-specific endpoint 1 descriptor on setting 0",err);
+		RDebug::Printf("<Error %d> Unable to set class-specific endpoint 1 descriptor on setting 0",err);
 		User::Leave(err);
 		}
 			
 	err = iClientDriver.SetCSEndpointDescriptorBlock(0,2,cs_endpointDescriptor);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP03, "<Error %d> Unable to set class-specific endpoint 2 descriptor on setting 0",err);
+		RDebug::Printf("<Error %d> Unable to set class-specific endpoint 2 descriptor on setting 0",err);
 		User::Leave(err);
 		}	
 		
 	err = iClientDriver.SetCSEndpointDescriptorBlock(0,3,cs_endpointDescriptor);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP04, "<Error %d> Unable to set class-specific endpoint 3 descriptor on setting 0",err);
+		RDebug::Printf("<Error %d> Unable to set class-specific endpoint 3 descriptor on setting 0",err);
 		User::Leave(err);
 		}
 	
@@ -130,7 +121,7 @@
 	err = iClientDriver.SetInterface(1,interfaceSetting);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP05, "<Error %d> Unable to set interface setting 1",err);
+		RDebug::Printf("<Error %d> Unable to set interface setting 1",err);
 		User::Leave(err);
 		}
 	
@@ -141,7 +132,7 @@
 	err = iClientDriver.SetCSInterfaceDescriptorBlock(1,cs_interfaceDescriptor);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP06, "<Error %d> Unable to set class-specific interface setting 1 descriptor",err);
+		RDebug::Printf("<Error %d> Unable to set class-specific interface setting 1 descriptor",err);
 		User::Leave(err);
 		}
 
@@ -150,21 +141,21 @@
 	err = iClientDriver.SetCSEndpointDescriptorBlock(1,1,cs_endpointDescriptor);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP07, "<Error %d> Unable to set class-specific endpoint 1 descriptor on setting 1",err);
+		RDebug::Printf("<Error %d> Unable to set class-specific endpoint 1 descriptor on setting 1",err);
 		User::Leave(err);
 		}
 	
 	err = iClientDriver.SetCSEndpointDescriptorBlock(1,2,cs_endpointDescriptor);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP08, "<Error %d> Unable to set class-specific endpoint 2 descriptor on setting 1",err);
+		RDebug::Printf("<Error %d> Unable to set class-specific endpoint 2 descriptor on setting 1",err);
 		User::Leave(err);
 		}
 		
 	err = iClientDriver.SetCSEndpointDescriptorBlock(1,3,cs_endpointDescriptor);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP09, "<Error %d> Unable to set class-specific endpoint 3 descriptor on setting 1",err);
+		RDebug::Printf("<Error %d> Unable to set class-specific endpoint 3 descriptor on setting 1",err);
 		User::Leave(err);
 		}
 
@@ -173,7 +164,7 @@
 	err = iClientDriver.SetInterface(2,interfaceSetting);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP10, "<Error %d> Unable to set interface setting 2",err);
+		RDebug::Printf("<Error %d> Unable to set interface setting 2",err);
 		User::Leave(err);
 		}
 
@@ -184,7 +175,7 @@
 	err = iClientDriver.SetCSInterfaceDescriptorBlock(2,cs_interfaceDescriptor);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP11, "<Error %d> Unable to set class-specific interface setting 2 descriptor",err);
+		RDebug::Printf("<Error %d> Unable to set class-specific interface setting 2 descriptor",err);
 		User::Leave(err);
 		}
 
@@ -193,31 +184,29 @@
 	err = iClientDriver.SetCSEndpointDescriptorBlock(2,1,cs_endpointDescriptor);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP12, "<Error %d> Unable to set class-specific endpoint 1 descriptor on setting 2",err);
+		RDebug::Printf("<Error %d> Unable to set class-specific endpoint 1 descriptor on setting 2",err);
 		User::Leave(err);
 		}
 	
 	err = iClientDriver.SetCSEndpointDescriptorBlock(2,2,cs_endpointDescriptor);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP13, "<Error %d> Unable to set class-specific endpoint 2 descriptor on setting 2",err);
+		RDebug::Printf("<Error %d> Unable to set class-specific endpoint 2 descriptor on setting 2",err);
 		User::Leave(err);
 		}
 		
 	err = iClientDriver.SetCSEndpointDescriptorBlock(2,3,cs_endpointDescriptor);
 	if(err != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, RUSBDEVICEB_OPENL_DUP14, "<Error %d> Unable to set class-specific endpoint 3 descriptor on setting 2",err);
+		RDebug::Printf("<Error %d> Unable to set class-specific endpoint 3 descriptor on setting 2",err);
 		User::Leave(err);
 		}
-	OstTraceFunctionExit1( RUSBDEVICEB_OPENL_EXIT, this );
 	}
 
 
 void RUsbDeviceB::OnStateChangeL(TUsbcDeviceState aNewState)
 	{
-	OstTraceFunctionEntryExt( RUSBDEVICEB_ONSTATECHANGEL_ENTRY, this );
-	OstTraceFunctionExit1( RUSBDEVICEB_ONSTATECHANGEL_EXIT, this );
+	LOG_FUNC
 	}
 	
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/testinterfacesettingbase.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/testinterfacesettingbase.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,10 +19,6 @@
 #include "testinterfacesettingbase.h"
 #include "testinterfacebase.h"
 #include "controltransferrequests.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "testinterfacesettingbaseTraces.h"
-#endif
  
  
 namespace NUnitTesting_USBDI
@@ -33,51 +29,43 @@
 	iIdRelEndpoint(EndpointIdentityRelationship),
 	iEndpoints(iHashEndpointFunction,iIdRelEndpoint)
 	{	
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_CINTERFACESETTINGBASE_ENTRY, this );
 	// Set the name of this interface setting
 	iSettingString.Copy(aString);
 	iInterfaceInfo().iString = &iSettingString;
 	
 	// Zero count the number of endpoints used for this setting
 	iInterfaceInfo().iTotalEndpointsUsed = 0;
-	OstTraceFunctionExit1( CINTERFACESETTINGBASE_CINTERFACESETTINGBASE_EXIT, this );
 	}
 
 	
 CInterfaceSettingBase::~CInterfaceSettingBase()
 	{
-	OstTraceFunctionEntry1( CINTERFACESETTINGBASE_CINTERFACESETTINGBASE_ENTRY_DUP01, this );
+	LOG_FUNC
 	
 	iEndpointReaders.ResetAndDestroy();
 	iEndpointWriters.ResetAndDestroy();
-	OstTraceFunctionExit1( CINTERFACESETTINGBASE_CINTERFACESETTINGBASE_EXIT_DUP01, this );
 	}
 	
 
 const TDesC& CInterfaceSettingBase::Name() const
 	{
-	OstTraceFunctionEntry1( CINTERFACESETTINGBASE_NAME_ENTRY, this );
-	OstTraceFunctionExitExt( CINTERFACESETTINGBASE_NAME_EXIT, this, ( TUint )&( iSettingString ) );
 	return iSettingString;
 	}
 
 
 void CInterfaceSettingBase::SetClassCodeL(TUint8 aClassCode,TUint8 aSubClassCode,TUint8 aDeviceProtocol)
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_SETCLASSCODEL_ENTRY, this );
 	// Set class specific information
 	iInterfaceInfo().iClass = TUsbcClassInfo(aClassCode,aSubClassCode,aDeviceProtocol);
-	OstTraceFunctionExit1( CINTERFACESETTINGBASE_SETCLASSCODEL_EXIT, this );
 	}
 
 
 TInt CInterfaceSettingBase::AddEndpoint(TEndpoint& aEndpoint)
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_ADDENDPOINT_ENTRY, this );
+	LOG_FUNC
 	
 	if(aEndpoint.iEndpointNumber == EEndpoint0)
 		{
-		OstTraceFunctionExitExt( CINTERFACESETTINGBASE_ADDENDPOINT_EXIT, this, KErrInUse );
 		return KErrInUse;
 		}
 	
@@ -90,12 +78,10 @@
 		// Update the total endpoints used on this interface
 		iInterfaceInfo().iTotalEndpointsUsed = iEndpoints.Count();
 		
-		OstTraceFunctionExitExt( CINTERFACESETTINGBASE_ADDENDPOINT_EXIT_DUP01, this, KErrNone );
 		return KErrNone;
 		}
 	else
 		{
-		OstTraceFunctionExitExt( CINTERFACESETTINGBASE_ADDENDPOINT_EXIT_DUP02, this, KErrOverflow );
 		return KErrOverflow;
 		}
 	}
@@ -103,103 +89,93 @@
 
 void CInterfaceSettingBase::CreateEndpointReaderL(RDevUsbcClient& aClientDriver,TUint aEndpoint)
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_CREATEENDPOINTREADERL_ENTRY, this );
+	LOG_FUNC	
 	// Create the reader for this endpoint and store in the container	
 	CEndpointReader* epReader = new (ELeave) CEndpointReader(aClientDriver,
 	iEndpoints.Find(static_cast<TEndpointNumber>(aEndpoint))->iEndpointNumber);
 	CleanupStack::PushL(epReader);
 	iEndpointReaders.AppendL(epReader);
 	CleanupStack::Pop(epReader);
-	OstTraceFunctionExit1( CINTERFACESETTINGBASE_CREATEENDPOINTREADERL_EXIT, this );
 	}
 
 
 void CInterfaceSettingBase::CreateEndpointWriterL(RDevUsbcClient& aClientDriver,TUint aEndpoint)
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_CREATEENDPOINTWRITERL_ENTRY, this );
+	LOG_FUNC	
 	// Create the writer for this endpoint and store in the container	
 	CEndpointWriter* epWriter = new (ELeave) CEndpointWriter(aClientDriver,
 	iEndpoints.Find(static_cast<TEndpointNumber>(aEndpoint))->iEndpointNumber);
 	CleanupStack::PushL(epWriter);
 	iEndpointWriters.AppendL(epWriter);
 	CleanupStack::Pop(epWriter);
-	OstTraceFunctionExit1( CINTERFACESETTINGBASE_CREATEENDPOINTWRITERL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::WriteSpecifiedDataToEndpointL(const TDesC8& aData,TUint16 aEndpointNumber)
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_WRITESPECIFIEDDATATOENDPOINTL_ENTRY, this );
+	LOG_FUNC	
 	// Access the correct writer for the given endpoint
 	// and write the data to the host			
 	iEndpointWriters[aEndpointNumber-1]->Write(aData, ETrue);
-	OstTraceFunctionExit1( CINTERFACESETTINGBASE_WRITESPECIFIEDDATATOENDPOINTL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::WriteSpecifiedDataToEndpointL(const TDesC8& aDataPattern, const TUint aNumBytes, TUint16 aEndpointNumber)
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_WRITESPECIFIEDDATATOENDPOINTL_ENTRY_DUP01, this );
+	LOG_FUNC	
 	// Access the correct writer for the given endpoint
 	// and write the data to the host
 	iEndpointWriters[aEndpointNumber-1]->WriteUsingPatternL(aDataPattern,aNumBytes,ETrue);
-	OstTraceFunctionExit1( CINTERFACESETTINGBASE_WRITESPECIFIEDDATATOENDPOINTL_EXIT_DUP01, this );
 	}
 
 void CInterfaceSettingBase::RepeatedWriteSpecifiedDataToEndpointL(const TDesC8& aDataPattern, TUint aNumBytesPerWrite, TUint aTotalNumBytes, TUint16 aEndpointNumber)
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_REPEATEDWRITESPECIFIEDDATATOENDPOINTL_ENTRY, this );
+	LOG_FUNC	
 	// Access the correct writer for the given endpoint
 	// and write the data to the host
 	iEndpointWriters[aEndpointNumber-1]->WriteInPartsUsingPatternL(aDataPattern,aNumBytesPerWrite,aTotalNumBytes,ETrue);
-	OstTraceFunctionExit1( CINTERFACESETTINGBASE_REPEATEDWRITESPECIFIEDDATATOENDPOINTL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::WriteCachedEndpointDataToEndpointL(const TUint16 aReadEndpointNumber,TUint16 aWriteEndpointNumber)
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_WRITECACHEDENDPOINTDATATOENDPOINTL_ENTRY, this );
+	LOG_FUNC
 	
 	iEndpointWriters[aWriteEndpointNumber-1]->Write(iEndpointReaders[aReadEndpointNumber-1]->Buffer(), ETrue);
-	OstTraceFunctionExit1( CINTERFACESETTINGBASE_WRITECACHEDENDPOINTDATATOENDPOINTL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::CancelWriteDataToEndpointL(TUint16 aEndpointNumber)
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_CANCELWRITEDATATOENDPOINTL_ENTRY, this );
+	LOG_FUNC	
 	// Access the correct writer for the given endpoint
 	// and cancel any outstanding write. This will not of course work for 'synchronous' writes.			
 	iEndpointWriters[aEndpointNumber-1]->Cancel();
-	OstTraceFunctionExit1( CINTERFACESETTINGBASE_CANCELWRITEDATATOENDPOINTL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::WriteSynchronousSpecifiedDataToEndpointL(const TDesC8& aDataPattern, const TUint aNumBytes, TUint16 aEndpointNumber)
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_WRITESYNCHRONOUSSPECIFIEDDATATOENDPOINTL_ENTRY, this );
+	LOG_FUNC	
 	// Access the correct writer for the given endpoint
 	// and write the data to the host
 	iEndpointWriters[aEndpointNumber-1]->WriteSynchronousUsingPatternL(aDataPattern,aNumBytes,ETrue);
-	OstTraceFunctionExit1( CINTERFACESETTINGBASE_WRITESYNCHRONOUSSPECIFIEDDATATOENDPOINTL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::WriteSynchronousSpecifiedDataToAndHaltEndpointL(const TDesC8& aDataPattern, const TUint aNumBytes, TUint16 aEndpointNumber)
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_WRITESYNCHRONOUSSPECIFIEDDATATOANDHALTENDPOINTL_ENTRY, this );
+	LOG_FUNC	
 	// Access the correct writer for the given endpoint
 	// and write the data to the host
 	iEndpointWriters[aEndpointNumber-1]->WriteSynchronousUsingPatternAndHaltL(aDataPattern,aNumBytes);
-	OstTraceFunctionExit1( CINTERFACESETTINGBASE_WRITESYNCHRONOUSSPECIFIEDDATATOANDHALTENDPOINTL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::WriteSynchronousCachedEndpointDataToEndpointL(const TUint16 aReadEndpointNumber,TUint16 aWriteEndpointNumber)
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_WRITESYNCHRONOUSCACHEDENDPOINTDATATOENDPOINTL_ENTRY, this );
+	LOG_FUNC
 	
 	//Attempt to write the complete cached buffer by starting at zero and choosing the max length posible
 	WriteSynchronousCachedEndpointDataToEndpointL(aReadEndpointNumber, aWriteEndpointNumber, 0, KMaxTInt);
-	OstTraceFunctionExit1( CINTERFACESETTINGBASE_WRITESYNCHRONOUSCACHEDENDPOINTDATATOENDPOINTL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::WriteSynchronousCachedEndpointDataToEndpointL(const TUint16 aReadEndpointNumber,TUint16 aWriteEndpointNumber, TUint aStartPoint, TUint aLength)
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_WRITESYNCHRONOUSCACHEDENDPOINTDATATOENDPOINTL_ENTRY_DUP01, this );
+	LOG_FUNC	
 	// Access the correct writer for the given endpoint
 	// Access the 'source' endpoint buffer. This contains data from that endpoint's last read.
 	// Write this data to the host using 'write' endpoint.
@@ -217,12 +193,11 @@
 	// Do the 'Write'
 	// Note we need a synchronous 'Write' here
 	iEndpointWriters[aWriteEndpointNumber-1]->WriteSynchronous(iEndpointReaders[aReadEndpointNumber-1]->Buffer().Mid(aStartPoint, aLength), ETrue);
-	OstTraceFunctionExit1( CINTERFACESETTINGBASE_WRITESYNCHRONOUSCACHEDENDPOINTDATATOENDPOINTL_EXIT_DUP01, this );
 	}
 
 TBool CInterfaceSettingBase::CachedEndpointResultL(const TUint16 aEndpointNumber)
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_CACHEDENDPOINTRESULTL_ENTRY, this );
+	LOG_FUNC	
 	// Access endpoint buffer containing data from the endpoint's last read
 	// and validate with the supplied data pattern
 
@@ -231,7 +206,7 @@
 
 TInt CInterfaceSettingBase::NumBytesReadSoFarL(const TUint16 aEndpointNumber)
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_NUMBYTESREADSOFARL_ENTRY, this );
+	LOG_FUNC	
 	// Access endpoint buffer containing data from the endpoint's last read
 	// and validate with the supplied data pattern
 
@@ -240,7 +215,7 @@
 
 TInt CInterfaceSettingBase::NumBytesWrittenSoFarL(const TUint16 aEndpointNumber)
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_NUMBYTESWRITTENSOFARL_ENTRY, this );
+	LOG_FUNC	
 	// Access endpoint buffer containing data from the endpoint's last read
 	// and validate with the supplied data pattern
 
@@ -249,7 +224,7 @@
 
 TBool CInterfaceSettingBase::ValidateCachedEndpointDataL(const TDesC8& aDataPattern, const TUint aNumBytes, const TUint16 aEndpointNumber)
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_ENTRY, this );
+	LOG_FUNC	
 	// Access endpoint buffer containing data from the endpoint's last read
 	// and validate with the supplied data pattern
 
@@ -258,7 +233,7 @@
 
 TBool CInterfaceSettingBase::ValidateCachedEndpointDataL(const TDesC8& aDataPattern, const TUint aStartPoint, const TUint aNumBytes, const TUint16 aEndpointNumber)
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_ENTRY_DUP01, this );
+	LOG_FUNC	
 	__ASSERT_DEBUG(aDataPattern.Length()!=0, User::Panic(_L("Trying to validate with ZERO LENGTH STRING"), KErrArgument));
 
 	//Check data in endpoint buffer
@@ -275,17 +250,14 @@
 		{
 		if(dataToValidate.Left(numStartBytes).Compare(aDataPattern.Mid(startPoint, numStartBytes)) != 0)
 			{
-			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL, "ROUND TRIP VALIDATION: Start Bytes Match Failure");
-			OstTrace1(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP01, "ROUND TRIP VALIDATION: numStartBytes = %d", numStartBytes);
-			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP02, "Start of sent data ...");
-            const TPtrC8& midDataPattern = aDataPattern.Mid(startPoint, numStartBytes);
-            OstTraceData(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP52, "", midDataPattern.Ptr(), midDataPattern.Length());
-			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP03, "\n");
-			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP04, "ROUND TRIP VALIDATION: Start of returned data ...");
-            const TPtrC8& leftDataToValidate = dataToValidate.Left(numStartBytes);
-            OstTraceData(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP54, "", leftDataToValidate.Ptr(), leftDataToValidate.Length());
-			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP05, "\n");
-			OstTraceFunctionExitExt( CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_EXIT, this, EFalse );
+			RDebug::Printf("ROUND TRIP VALIDATION: Start Bytes Match Failure");
+			RDebug::Printf("ROUND TRIP VALIDATION: numStartBytes = %d", numStartBytes);
+			RDebug::Printf("Start of sent data ...");
+			RDebug::RawPrint(aDataPattern.Mid(startPoint, numStartBytes));
+			RDebug::Printf("\n");
+			RDebug::Printf("ROUND TRIP VALIDATION: Start of returned data ...");				
+			RDebug::RawPrint(dataToValidate.Left(numStartBytes));
+			RDebug::Printf("\n");
 			return EFalse;
 			}
 		}
@@ -293,17 +265,14 @@
 		{
 		if(dataToValidate.Mid(startEndPoint,numEndBytes).Compare(aDataPattern.Left(numEndBytes)) != 0)
 			{
-			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP06, "ROUND TRIP VALIDATION: End Bytes Match Failure");
-			OstTraceExt2(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP07, "ROUND TRIP VALIDATION: startEndPoint = %u, numEndBytes = %u", startEndPoint, numEndBytes);
-			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP08, "End of sent data ...");
-            const TPtrC8& leftDataPattern = aDataPattern.Left(numEndBytes);
-            OstTraceData(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP58, "", leftDataPattern.Ptr(), leftDataPattern.Length());
-			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP09, "\n");
-			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP10, "ROUND TRIP VALIDATION: End of returned data ...");
-            const TPtrC8& midDataToValidate = dataToValidate.Mid(startEndPoint,numEndBytes);
-            OstTraceData(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP60, "", midDataToValidate.Ptr(), midDataToValidate.Length());
-			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP11, "\n");
-			OstTraceFunctionExitExt( CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_EXIT_DUP01, this, EFalse );
+			RDebug::Printf("ROUND TRIP VALIDATION: End Bytes Match Failure");
+			RDebug::Printf("ROUND TRIP VALIDATION: startEndPoint = %d, numEndBytes = %d", startEndPoint, numEndBytes);
+			RDebug::Printf("End of sent data ...");
+			RDebug::RawPrint(aDataPattern.Left(numEndBytes));
+			RDebug::Printf("\n");
+			RDebug::Printf("ROUND TRIP VALIDATION: End of returned data ...");				
+			RDebug::RawPrint(dataToValidate.Mid(startEndPoint,numEndBytes));
+			RDebug::Printf("\n");
 			return EFalse;
 			}
 		}
@@ -311,67 +280,59 @@
 		{
 		if(dataToValidate.Mid(numStartBytes + i*aDataPattern.Length(),aDataPattern.Length()).Compare(aDataPattern) != 0)
 			{
-			OstTrace1(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP12, "ROUND TRIP VALIDATION: Repeated Bytes Match Failure, Repeat %d",i);
-			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP13, "sent data middle block ...");
-            OstTraceData(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP53, "", aDataPattern.Ptr(), aDataPattern.Length());
-			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP14, "\n");
-			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP15, "ROUND TRIP VALIDATION: Middle block of returned data ...");
-            const TPtrC8& midDataToValidate = dataToValidate.Mid(numStartBytes + i*aDataPattern.Length(),aDataPattern.Length());
-            OstTraceData(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP55, "", midDataToValidate.Ptr(), midDataToValidate.Length());
-			OstTrace0(TRACE_NORMAL, CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP16, "\n");
-			OstTraceFunctionExitExt( CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_EXIT_DUP02, this, EFalse );
+			RDebug::Printf("ROUND TRIP VALIDATION: Repeated Bytes Match Failure, Repeat %d",i);
+			RDebug::Printf("sent data middle block ...");
+			RDebug::RawPrint(aDataPattern);
+			RDebug::Printf("\n");
+			RDebug::Printf("ROUND TRIP VALIDATION: Middle block of returned data ...");
+			RDebug::RawPrint(dataToValidate.Mid(numStartBytes + i*aDataPattern.Length(),aDataPattern.Length()));
+			RDebug::Printf("\n");
 			return EFalse; //from 'for' loop
 			}
 		}
-	OstTraceFunctionExitExt( CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_EXIT_DUP03, this, ETrue );
 	return ETrue;
 	}
 
 
 void CInterfaceSettingBase::ReadDataFromEndpointL(TUint aNumBytes, TUint16 aEndpointNumber)	
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_READDATAFROMENDPOINTL_ENTRY, this );
+	LOG_FUNC	
 	// Access the correct readerer for the given endpoint
 	// and prepare to read the data to be sent by the host			
 	iEndpointReaders[aEndpointNumber-1]->ReadL(aNumBytes);
-	OstTraceFunctionExit1( CINTERFACESETTINGBASE_READDATAFROMENDPOINTL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::CancelAnyReadDataFromEndpointL(TUint16 aEndpointNumber)
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_CANCELANYREADDATAFROMENDPOINTL_ENTRY, this );
+	LOG_FUNC	
 	// Access the correct writer for the given endpoint
 	// and cancel any outstanding write. This will not of course work for 'synchronous' writes.			
 	iEndpointReaders[aEndpointNumber-1]->Cancel();
-	OstTraceFunctionExit1( CINTERFACESETTINGBASE_CANCELANYREADDATAFROMENDPOINTL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::ReadDataFromAndHaltEndpointL(TUint aNumBytes, TUint16 aEndpointNumber)	
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_READDATAFROMANDHALTENDPOINTL_ENTRY, this );
+	LOG_FUNC	
 	// Access the correct reader for the given endpoint
 	// and prepare to read the data to be sent by the host			
 	iEndpointReaders[aEndpointNumber-1]->ReadAndHaltL(aNumBytes);
-	OstTraceFunctionExit1( CINTERFACESETTINGBASE_READDATAFROMANDHALTENDPOINTL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::RepeatedReadAndValidateFromEndpointL(const TDesC8& aDataPattern, TUint aNumBytesPerRead, TUint aTotalNumBytes, TUint16 aEndpointNumber)
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_REPEATEDREADANDVALIDATEFROMENDPOINTL_ENTRY, this );
+	LOG_FUNC	
 	// Access the correct reader for the given endpoint
 	// and prepare to read the data to be sent by the host
 	// using multiple 'Reads'
 	iEndpointReaders[aEndpointNumber-1]->RepeatedReadAndValidateL(aDataPattern, aNumBytesPerRead, aTotalNumBytes);
-	OstTraceFunctionExit1( CINTERFACESETTINGBASE_REPEATEDREADANDVALIDATEFROMENDPOINTL_EXIT, this );
 	}
 
 void CInterfaceSettingBase::ReadDataUntilShortFromEndpointL(TUint aNumBytes, TUint16 aEndpointNumber)	
 	{
-	OstTraceFunctionEntryExt( CINTERFACESETTINGBASE_READDATAUNTILSHORTFROMENDPOINTL_ENTRY, this );
+	LOG_FUNC	
 	// Access the correct reader for the given endpoint
 	// and prepare to read the data to be sent by the host			
 	iEndpointReaders[aEndpointNumber-1]->ReadUntilShortL(aNumBytes);
-	OstTraceFunctionExit1( CINTERFACESETTINGBASE_READDATAUNTILSHORTFROMENDPOINTL_EXIT, this );
 	}
 	}
 
--- a/kerneltest/e32test/usbho/t_usbdi/src/vendordevice.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/vendordevice.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -19,10 +19,6 @@
 #include "modelleddevices.h"
 #include "testinterfacebase.h"
 #include "testinterfacesettingbase.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "vendordeviceTraces.h"
-#endif
 
 namespace NUnitTesting_USBDI
 	{
@@ -30,28 +26,23 @@
 
 RUsbDeviceVendor::RUsbDeviceVendor()
 	{
-	OstTraceFunctionEntry1( RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_ENTRY, this );
-	OstTraceFunctionExit1( RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_EXIT, this );
 	}
 	
 RUsbDeviceVendor::RUsbDeviceVendor(CBaseTestCase* aTestCase):RUsbTestDevice(aTestCase)
 	{
-	OstTraceFunctionEntryExt( RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_ENTRY_DUP01, this );
-	OstTrace1(TRACE_NORMAL, RUSBDEVICEVENDOR_RUSBDEVICEVENDOR, "aTestCase = %d", aTestCase);
-	OstTraceFunctionExit1( RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_EXIT_DUP01, this );
+	LOG_FUNC
+	RDebug::Printf("aTestCase = %d", aTestCase);
 	}
 	
 
 RUsbDeviceVendor::~RUsbDeviceVendor()
 	{	
-	OstTraceFunctionEntry1( RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_ENTRY_DUP02, this );
-	OstTraceFunctionExit1( RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_EXIT_DUP02, this );
 	}
 	
 
 void RUsbDeviceVendor::OpenL(const TDesC& aSerialNumber)
 	{
-	OstTraceFunctionEntryExt( RUSBDEVICEVENDOR_OPENL_ENTRY, this );
+	LOG_FUNC
 	
 	RUsbTestDevice::OpenL();
 	
@@ -76,14 +67,12 @@
 	CleanupStack::Pop(interface0s0);
 	AddInterface(interface0);
 	CleanupStack::Pop(interface0);
-	OstTraceFunctionExit1( RUSBDEVICEVENDOR_OPENL_EXIT, this );
 	}
 
 
 void RUsbDeviceVendor::OnStateChangeL(TUsbcDeviceState aNewState)
 	{
-	OstTraceFunctionEntryExt( RUSBDEVICEVENDOR_ONSTATECHANGEL_ENTRY, this );
-	OstTraceFunctionExit1( RUSBDEVICEVENDOR_ONSTATECHANGEL_EXIT, this );
+	LOG_FUNC
 	}
 
 	
--- a/kerneltest/e32test/usbho/t_usbdi/src/wakeuptimer.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/wakeuptimer.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -17,10 +17,6 @@
 //
 
 #include "wakeuptimer.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "wakeuptimerTraces.h"
-#endif
 
 
 namespace NUnitTesting_USBDI
@@ -30,12 +26,10 @@
 
 CRemoteWakeupTimer* CRemoteWakeupTimer::NewL(RUsbTestDevice& aTestDevice)
 	{
-	OstTraceFunctionEntry1( CREMOTEWAKEUPTIMER_NEWL_ENTRY, ( TUint )&( aTestDevice ) );
 	CRemoteWakeupTimer* self = new (ELeave) CRemoteWakeupTimer(aTestDevice);
 	CleanupStack::PushL(self);
 	self->ConstructL();
 	CleanupStack::Pop(self);
-	OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 
@@ -44,50 +38,43 @@
 :	CTimer(EPriorityStandard),
 	iTestDevice(aTestDevice)
 	{
-	OstTraceFunctionEntryExt( CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_ENTRY, this );
 	CActiveScheduler::Add(this);
-	OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_EXIT, this );
 	}
 
 
 CRemoteWakeupTimer::~CRemoteWakeupTimer()
 	{
-	OstTraceFunctionEntry1( CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_ENTRY_DUP01, this );
-	OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_EXIT_DUP01, this );
 	}
 
 
 void CRemoteWakeupTimer::ConstructL()
 	{
-	OstTraceFunctionEntry1( CREMOTEWAKEUPTIMER_CONSTRUCTL_ENTRY, this );
+	LOG_FUNC
 	CTimer::ConstructL();
-	OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_CONSTRUCTL_EXIT, this );
 	}
 
 
 void CRemoteWakeupTimer::WakeUp(TUint16 aInterval)
 	{
-	OstTraceFunctionEntryExt( CREMOTEWAKEUPTIMER_WAKEUP_ENTRY, this );
+	LOG_FUNC
 	After(aInterval*KOneSecond);
-	OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_WAKEUP_EXIT, this );
 	}
 
 
 void CRemoteWakeupTimer::RunL()
 	{
-	OstTraceFunctionEntry1( CREMOTEWAKEUPTIMER_RUNL_ENTRY, this );
+	LOG_FUNC
 	TInt completionCode(iStatus.Int());
 	
 	if(completionCode != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, CREMOTEWAKEUPTIMER_RUNL, "<Error %d> software connect/disconnect timer error",completionCode);
+		RDebug::Printf("<Error %d> software connect/disconnect timer error",completionCode);
 		iTestDevice.ReportError(completionCode);
 		}
 	else
 		{
 		iTestDevice.RemoteWakeup();
 		}	
-	OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_RUNL_EXIT, this );
 	}	
 
 	}
--- a/kerneltest/e32test/usbho/t_usbdi/t_usbhost_usbman_src/t_usbhost_usbman.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/t_usbhost_usbman_src/t_usbhost_usbman.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// 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"
@@ -18,10 +18,6 @@
 #include <e32property.h>
 #include <d32otgdi.h>
 #include "..\..\t_usbdi\inc\testdebug.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "t_usbhost_usbmanTraces.h"
-#endif
 
 _LIT(KOtgdiLddFileName, "otgdi");
 _LIT(KArgClient,        "client");
@@ -34,7 +30,7 @@
 
 TInt E32Main()
 	{
-	OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN, "---> Main OTG Sub-Process");
+	RDebug::Print(_L("---> Main OTG Sub-Process"));
 
 	CTrapCleanup* trapHandler = CTrapCleanup::New();
 
@@ -62,12 +58,12 @@
 		if(firstToken.Compare(KArgClient) == 0)
 			{
 			clientFlag = ETrue;
-            OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP01, "usbhost_usbman running as a Client");
+            RDebug::Print(_L("usbhost_usbman running as a Client"));
 			}
 		else
 			{
 			clientFlag = EFalse;
-            OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP02, "usbhost_usbman running as a Host");
+            RDebug::Print(_L("usbhost_usbman running as a Host"));
 			}
 
 		delete cmdLine;
@@ -77,7 +73,7 @@
 
 	if(r != KErrNone && r != KErrAlreadyExists) // persistent loading since process will be killed while it is in the loop below and doesnt unload it
 		{
-		OstTrace1(TRACE_NORMAL, E32MAIN_E32MAIN_DUP03, "   LoadLogicalDevice(KOtgdiLddFileName) error = %d", r);
+		RDebug::Print(_L("   LoadLogicalDevice(KOtgdiLddFileName) error = %d"), r);
 		delete trapHandler;
 		return r;		
 		}
@@ -90,28 +86,28 @@
 	RUsbOtgDriver::TOtgEvent event;
 	TBool running = ETrue;
 	
-	OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP04, "   opening otg driver");
+	RDebug::Print(_L("   opening otg driver"));
 	
 	r = otg.Open();
 	if(r != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, E32MAIN_E32MAIN_DUP05, "   otg.Open fails %d", r);
+		RDebug::Print(_L("   otg.Open fails %d"), r);
         goto Abort;
 		}
 
-	OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP06, "   otg driver successfully opened");
+	RDebug::Print(_L("   otg driver successfully opened"));
 
-	OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP07, "   otg : starting stacks now");
+	RDebug::Print(_L("   otg : starting stacks now"));
 	
 	r = otg.StartStacks();
 
 	if(r != KErrNone)
 		{
-		OstTrace1(TRACE_NORMAL, E32MAIN_E32MAIN_DUP08, "   otg.StartStacks fails %d", r);
+		RDebug::Print(_L("   otg.StartStacks fails %d"), r);
         goto Abort;
 		}	
 
-	OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP09, "   otg stacks successfully started");
+	RDebug::Print(_L("   otg stacks successfully started"));
 
 //	RProcess::Rendezvous(KErrNone);
 
@@ -119,7 +115,7 @@
     r = wordofdeath.Attach(KWordOfDeathCat, KWordOfDeathKey, EOwnerThread);
     if(r != KErrNone)
         {
-        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS, "Failed to connect to word of death");
+        RDebug::Print(_L("Failed to connect to word of death"));
         }
     
     // wait for the previously attached counterproperty to be updated
@@ -129,8 +125,8 @@
 		otg.QueueOtgEventRequest(event, status);
 		User::WaitForRequest(status, waiting_for_death);
 
-        OstTrace1(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP01, "waiting_for_death= %d", waiting_for_death.Int());
-        OstTrace1(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP02, "Otg Event        = %d", status.Int());
+        RDebug::Print(_L("waiting_for_death= %d"), waiting_for_death.Int());
+        RDebug::Print(_L("Otg Event        = %d"), status.Int());
 
         r = waiting_for_death.Int();
         if(r != KRequestPending)
@@ -156,23 +152,23 @@
 
 	// Shut down nicely
 
-    OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP03, "StopStacks()");
+    RDebug::Print(_L("StopStacks()"));
 
     otg.StopStacks(); //NB This drops the bus
 
-    OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP04, "******** ShutdownStack Complete ********");
+    RDebug::Print(_L("******** ShutdownStack Complete ********"));
 
-    OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP05, "Close Otg stack()");
+    RDebug::Print(_L("Close Otg stack()"));
 
     otg.Close();
 
 Abort:
-    OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP06, "Free LDD");
+    RDebug::Print(_L("Free LDD"));
     User::FreeLogicalDevice(RUsbOtgDriver::Name());
 
     delete trapHandler;
 
-    OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP07, "usbhost_usbman Finished");
+    RDebug::Print(_L("usbhost_usbman Finished"));
 
     return KErrNone;
     }
@@ -185,15 +181,15 @@
     switch(event)
         {
     case RUsbOtgDriver::EEventVbusRaised:
-        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP08, "Client Side : Vbus raise detected due to Event VbusRaised");
+        RDebug::Print(_L("Client Side : Vbus raise detected due to Event VbusRaised"));
         break;
 
     case RUsbOtgDriver::EEventRoleChangedToDevice:
-        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP09, "Client Side : Vbus raise detected due to Event RoleChangedToDevice");
+        RDebug::Print(_L("Client Side : Vbus raise detected due to Event RoleChangedToDevice"));
         break;
 
     default:
-        OstTrace1(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP10, "Client Side : Event %d received", event);
+        RDebug::Print(_L("Client Side : Event %d received"), event);
         break;
         }
 
@@ -209,71 +205,71 @@
     switch(event)
         {
     case RUsbOtgDriver::EEventAPlugInserted:
-        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP11, "Host side otg got APlugInserted Event");
+        RDebug::Print(_L("Host side otg got APlugInserted Event"));
         r = aOtg.BusRequest();
-        OstTrace1(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP12, "BusRequest() made - returned %d", r);
+        RDebug::Print(_L("BusRequest() made - returned %d"), r);
         break;
 
     case RUsbOtgDriver::EEventAPlugRemoved:
-        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP13, "Host side otg got APlugRemoved Event - shutting down");
+        RDebug::Print(_L("Host side otg got APlugRemoved Event - shutting down"));
         return EFalse;
 
     case RUsbOtgDriver::EEventVbusRaised:
-        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP14, "Host side otg got VbusRaised Event");
+        RDebug::Print(_L("Host side otg got VbusRaised Event"));
         break;
 
     case RUsbOtgDriver::EEventVbusDropped:
-        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP15, "Host side otg got VbusDropped Event");
+        RDebug::Print(_L("Host side otg got VbusDropped Event"));
         break;
 
     case RUsbOtgDriver::EEventSrpInitiated:
-        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP16, "Host side otg got SrpInitiated Event");
+        RDebug::Print(_L("Host side otg got SrpInitiated Event"));
         break;
 
     case RUsbOtgDriver::EEventSrpReceived:
-        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP17, "Host side otg got SrpReceived Event");
+        RDebug::Print(_L("Host side otg got SrpReceived Event"));
         break;
 
     case RUsbOtgDriver::EEventHnpEnabled:
-        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP18, "Host side otg got HnpEnabled Event");
+        RDebug::Print(_L("Host side otg got HnpEnabled Event"));
         break;
 
     case RUsbOtgDriver::EEventHnpDisabled:
-        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP19, "Host side otg got HnpDisabled Event");
+        RDebug::Print(_L("Host side otg got HnpDisabled Event"));
         break;
 
     case RUsbOtgDriver::EEventHnpSupported:
-        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP20, "Host side otg got HnpSupported Event");
+        RDebug::Print(_L("Host side otg got HnpSupported Event"));
         break;
 
     case RUsbOtgDriver::EEventHnpAltSupported:
-        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP21, "Host side otg got HnpAltSupported Event");
+        RDebug::Print(_L("Host side otg got HnpAltSupported Event"));
         break;
 
 
     case RUsbOtgDriver::EEventBusConnectionBusy:
-        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP22, "Host side otg got BusConnectionBusy Event");
+        RDebug::Print(_L("Host side otg got BusConnectionBusy Event"));
         break;
 
     case RUsbOtgDriver::EEventBusConnectionIdle:
-        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP23, "Host side otg got BusConnectionIdle Event");
+        RDebug::Print(_L("Host side otg got BusConnectionIdle Event"));
         break;
 
 
     case RUsbOtgDriver::EEventRoleChangedToHost:
-        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP24, "Host side otg got RoleChangedToHost Event");
+        RDebug::Print(_L("Host side otg got RoleChangedToHost Event"));
         break;
 
     case RUsbOtgDriver::EEventRoleChangedToDevice:
-        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP25, "Host side otg got RoleChangedToDevice Event");
+        RDebug::Print(_L("Host side otg got RoleChangedToDevice Event"));
         break;
 
     case RUsbOtgDriver::EEventRoleChangedToIdle:
-        OstTrace0(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP26, "Host side otg got RoleChangedToIdle Event");
+        RDebug::Print(_L("Host side otg got RoleChangedToIdle Event"));
         break;
 
     default:
-        OstTrace1(TRACE_NORMAL, RPROCESS_RENDEZVOUS_DUP27, "Host Side otg unknown event catcher tickled - event %d - shutting down", event);
+        RDebug::Print(_L("Host Side otg unknown event catcher tickled - event %d - shutting down"), event);
         return EFalse;
      }
 
--- a/kerneltest/e32test/usbho/t_usbdi/traces_t_usbdi/OstTraceDefinitions.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-// 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:
-// 
-//
-
-
-#ifndef __OSTTRACEDEFINITIONS_H__
-#define __OSTTRACEDEFINITIONS_H__
-// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
-// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
-//#define OST_TRACE_COMPILER_IN_USE
-#include <opensystemtrace.h>
-#endif
--- a/kerneltest/e32test/usbho/t_usbdi/traces_t_usbdi/fixed_id.definitions	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2769 +0,0 @@
-#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
-[GROUP]TRACE_FLOW=0x8a
-[GROUP]TRACE_NORMAL=0x86
-[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_CACTORFDF_ENTRY=0x4c2
-[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_CACTORFDF_ENTRY_DUP01=0x4c8
-[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_CACTORFDF_EXIT=0x4c3
-[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_CACTORFDF_EXIT_DUP01=0x4c9
-[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_CONSTRUCTL_ENTRY=0x4c4
-[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_CONSTRUCTL_EXIT=0x4c5
-[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_DEVICEL_ENTRY=0x4ce
-[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_DOCANCEL_ENTRY=0x4ca
-[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_DOCANCEL_EXIT=0x4cb
-[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_MONITOR_ENTRY=0x4cc
-[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_MONITOR_EXIT=0x4cd
-[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_NEWL_ENTRY=0x4c0
-[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_NEWL_EXIT=0x4c1
-[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_RUNERROR_ENTRY=0x4d1
-[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_RUNERROR_EXIT=0x4d2
-[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_RUNL_ENTRY=0x4cf
-[TRACE]TRACE_FLOW[0x8A]_CACTORFDF_RUNL_EXIT=0x4d0
-[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_ENTRY=0x63e
-[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_ENTRY_DUP01=0x640
-[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_EXIT=0x63f
-[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_EXIT_DUP01=0x641
-[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_CONSTRUCTL_ENTRY=0x642
-[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_CONSTRUCTL_EXIT=0x643
-[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_DOCANCEL_ENTRY=0x644
-[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_DOCANCEL_EXIT=0x645
-[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_NEWL_ENTRY=0x63c
-[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_NEWL_EXIT=0x63d
-[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_RUNERROR_ENTRY=0x648
-[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_RUNERROR_EXIT=0x649
-[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_RUNL_ENTRY=0x646
-[TRACE]TRACE_FLOW[0x8A]_CALTERNATEINTERFACESELECTIONWATCHER_RUNL_EXIT=0x647
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_BASEBULKCONSTRUCTL_ENTRY=0xd
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_BASEBULKCONSTRUCTL_EXIT=0xe
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_ENTRY=0x1b
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_ENTRY_DUP01=0x1e
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_EXIT=0x1f
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_EXIT_DUP01=0x20
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_EXIT_DUP02=0x21
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_EXIT_DUP03=0x22
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_EXIT_DUP04=0x23
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_BUSERRORL_ENTRY=0x32
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_BUSERRORL_EXIT=0x33
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_CBASEBULKTESTCASE_ENTRY=0xb
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_CBASEBULKTESTCASE_ENTRY_DUP01=0xf
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_CBASEBULKTESTCASE_EXIT=0xc
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_CBASEBULKTESTCASE_EXIT_DUP01=0x10
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_CHECKANDRESETTIMES_ENTRY=0x46
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_CHECKANDRESETTIMES_EXIT=0x47
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_CHECKTIMES_ENTRY=0x42
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_CHECKTIMES_EXIT=0x43
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_CLOSEINTERFACEANDPIPES_ENTRY=0x2e
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_CLOSEINTERFACEANDPIPES_EXIT=0x2f
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_DEVICEDOCANCEL_ENTRY=0x17
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_DEVICEDOCANCEL_EXIT=0x18
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_DEVICEINSERTEDL_ENTRY=0x1c
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_DEVICEINSERTEDL_EXIT=0x1d
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_DEVICEREMOVEDL_ENTRY=0x30
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_DEVICEREMOVEDL_EXIT=0x31
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_DEVICERUNL_ENTRY=0x36
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_DEVICERUNL_EXIT=0x37
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_DEVICESTATECHANGEL_ENTRY=0x19
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_DEVICESTATECHANGEL_EXIT=0x1a
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_EXECUTEDEVICETESTCASEL_ENTRY=0x15
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_EXECUTEDEVICETESTCASEL_EXIT=0x16
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_EXECUTEHOSTTESTCASEL_ENTRY=0x11
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_EXECUTEHOSTTESTCASEL_EXIT=0x12
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_HANDLEBULKTESTTIMERFIRED_ENTRY=0x48
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_HANDLEBULKTESTTIMERFIRED_EXIT=0x49
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_HOSTDOCANCEL_ENTRY=0x13
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_HOSTDOCANCEL_EXIT=0x14
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_HOSTRUNL_ENTRY=0x34
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_HOSTRUNL_EXIT=0x35
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_RECORDTIME_ENTRY=0x40
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_RECORDTIME_EXIT=0x41
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_RESETTIMES_ENTRY=0x44
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_RESETTIMES_EXIT=0x45
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_ENTRY=0x24
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT=0x25
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP01=0x26
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP02=0x27
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP03=0x28
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP04=0x29
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP05=0x2a
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP06=0x2b
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP07=0x2c
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_EXIT_DUP08=0x2d
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_VALIDATEDATA_ENTRY=0x38
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_VALIDATEDATA_ENTRY_DUP01=0x39
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_VALIDATEDATA_ENTRY_DUP02=0x3a
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_VALIDATEDATA_EXIT=0x3b
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_VALIDATEDATA_EXIT_DUP01=0x3c
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_VALIDATEDATA_EXIT_DUP02=0x3d
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_VALIDATEDATA_EXIT_DUP03=0x3e
-[TRACE]TRACE_FLOW[0x8A]_CBASEBULKTESTCASE_VALIDATEDATA_EXIT_DUP04=0x3f
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_BASECONSTRUCTL_ENTRY=0x4c
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_BASECONSTRUCTL_EXIT=0x4d
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_CANCELTIMEOUT_ENTRY=0x50
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_CANCELTIMEOUT_EXIT=0x51
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_CBASETESTCASE_ENTRY=0x4a
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_CBASETESTCASE_ENTRY_DUP01=0x5c
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_CBASETESTCASE_EXIT=0x4b
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_CBASETESTCASE_EXIT_DUP01=0x5d
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_CHECKTREEAFTERDEVICEINSERTION_ENTRY=0x8c
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_CHECKTREE_ENTRY=0x87
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_CHECKTREE_EXIT=0x88
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_COMPARECURRENTTREETOREF_ENTRY=0x56
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_COMPARECURRENTTREETOREF_EXIT=0x57
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_COMPARECURRENTTREETOREF_EXIT_DUP01=0x58
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_COMPARECURRENTTREETOREF_EXIT_DUP02=0x59
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_COMPARECURRENTTREETOREF_EXIT_DUP03=0x5a
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_COMPARECURRENTTREETOREF_EXIT_DUP04=0x5b
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_DOCANCEL_ENTRY=0x62
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_DOCANCEL_EXIT=0x63
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_GENERATEREFFILE_ENTRY=0x52
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_GENERATEREFFILE_EXIT=0x53
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_GENERATEREFFILE_EXIT_DUP01=0x54
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_GENERATEREFFILE_EXIT_DUP02=0x55
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_GETENDPOINTADDRESS_ENTRY=0x7a
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_GETENDPOINTADDRESS_ENTRY_DUP01=0x7b
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_GETENDPOINTADDRESS_EXIT=0x7c
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_GETENDPOINTADDRESS_EXIT_DUP01=0x7d
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_GETENDPOINTADDRESS_EXIT_DUP02=0x7e
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_ISHOSTONLY_ENTRY=0x6c
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_ISHOSTONLY_EXIT=0x6d
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_ISHOST_ENTRY=0x6e
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_ISHOST_EXIT=0x6f
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_LOGWITHCONDANDINFO_ENTRY=0x7f
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_LOGWITHCONDANDINFO_EXIT=0x80
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_PARSECONFIGDESCRIPTORANDCHECKTREE_ENTRY=0x89
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_PARSECONFIGDESCRIPTORANDCHECKTREE_EXIT=0x8a
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_PARSECONFIGDESCRIPTORANDCHECKTREE_EXIT_DUP01=0x8b
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_PERFORMTESTL_ENTRY=0x70
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_PERFORMTESTL_EXIT=0x71
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_PRINTANDSTOREBLOB_ENTRY=0x83
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_PRINTANDSTOREBLOB_EXIT=0x84
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_PRINTANDSTORECHUNK_ENTRY=0x85
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_PRINTANDSTORECHUNK_EXIT=0x86
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_PRINTANDSTORETREE_ENTRY=0x81
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_PRINTANDSTORETREE_EXIT=0x82
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_RUNERROR_ENTRY=0x66
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_RUNERROR_EXIT=0x67
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_RUNL_ENTRY=0x64
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_RUNL_EXIT=0x65
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_SELFCOMPLETE_ENTRY=0x5e
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_SELFCOMPLETE_ENTRY_DUP01=0x60
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_SELFCOMPLETE_EXIT=0x5f
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_SELFCOMPLETE_EXIT_DUP01=0x61
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_SETTESTPOLICY_ENTRY=0x72
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_SETTESTPOLICY_EXIT=0x73
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TESTCASEID_ENTRY=0x68
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TESTCASEID_EXIT=0x69
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TESTFAILED_ENTRY=0x74
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TESTFAILED_EXIT=0x75
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TESTPASSED_ENTRY=0x76
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TESTPASSED_EXIT=0x77
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TESTPOLICY_ENTRY=0x78
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TESTPOLICY_EXIT=0x79
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TESTRESULT_ENTRY=0x6a
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TESTRESULT_EXIT=0x6b
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TIMEOUTIN_ENTRY=0x4e
-[TRACE]TRACE_FLOW[0x8A]_CBASETESTCASE_TIMEOUTIN_EXIT=0x4f
-[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_CBASICTESTPOLICY_ENTRY=0x607
-[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_CBASICTESTPOLICY_ENTRY_DUP01=0x609
-[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_CBASICTESTPOLICY_EXIT=0x608
-[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_CBASICTESTPOLICY_EXIT_DUP01=0x60a
-[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_CONSTRUCTL_ENTRY=0x60b
-[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_CONSTRUCTL_EXIT=0x60c
-[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_DOCANCEL_ENTRY=0x60f
-[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_DOCANCEL_EXIT=0x610
-[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_NEWL_ENTRY=0x605
-[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_NEWL_EXIT=0x606
-[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_RUNERROR_ENTRY=0x615
-[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_RUNERROR_EXIT=0x616
-[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_RUNL_ENTRY=0x613
-[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_RUNL_EXIT=0x614
-[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_RUNTESTCASEL_ENTRY=0x60d
-[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_RUNTESTCASEL_EXIT=0x60e
-[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_SIGNALTESTCOMPLETE_ENTRY=0x611
-[TRACE]TRACE_FLOW[0x8A]_CBASICTESTPOLICY_SIGNALTESTCOMPLETE_EXIT=0x612
-[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_CBASICWATCHER_ENTRY=0x456
-[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_CBASICWATCHER_ENTRY_DUP01=0x458
-[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_CBASICWATCHER_EXIT=0x457
-[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_CBASICWATCHER_EXIT_DUP01=0x459
-[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_DOCANCEL_ENTRY=0x45a
-[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_DOCANCEL_EXIT=0x45b
-[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_RUNERROR_ENTRY=0x460
-[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_RUNERROR_EXIT=0x461
-[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_RUNL_ENTRY=0x45e
-[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_RUNL_EXIT=0x45f
-[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_STARTWATCHING_ENTRY=0x45c
-[TRACE]TRACE_FLOW[0x8A]_CBASICWATCHER_STARTWATCHING_EXIT=0x45d
-[TRACE]TRACE_FLOW[0x8A]_CBULKTESTTIMER_CBULKTESTTIMER_ENTRY=0x3
-[TRACE]TRACE_FLOW[0x8A]_CBULKTESTTIMER_CBULKTESTTIMER_ENTRY_DUP01=0x5
-[TRACE]TRACE_FLOW[0x8A]_CBULKTESTTIMER_CBULKTESTTIMER_EXIT=0x4
-[TRACE]TRACE_FLOW[0x8A]_CBULKTESTTIMER_CBULKTESTTIMER_EXIT_DUP01=0x6
-[TRACE]TRACE_FLOW[0x8A]_CBULKTESTTIMER_CONSTRUCTL_ENTRY=0x7
-[TRACE]TRACE_FLOW[0x8A]_CBULKTESTTIMER_CONSTRUCTL_EXIT=0x8
-[TRACE]TRACE_FLOW[0x8A]_CBULKTESTTIMER_NEWL_ENTRY=0x1
-[TRACE]TRACE_FLOW[0x8A]_CBULKTESTTIMER_NEWL_EXIT=0x2
-[TRACE]TRACE_FLOW[0x8A]_CBULKTESTTIMER_RUNL_ENTRY=0x9
-[TRACE]TRACE_FLOW[0x8A]_CBULKTESTTIMER_RUNL_EXIT=0xa
-[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_CBULKTRANSFER_ENTRY=0x4f5
-[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_CBULKTRANSFER_ENTRY_DUP01=0x4f7
-[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_CBULKTRANSFER_EXIT=0x4f6
-[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_CBULKTRANSFER_EXIT_DUP01=0x4f8
-[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_DATAPOLLED_ENTRY=0x4f9
-[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_TRANSFERIN_ENTRY=0x4fa
-[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_TRANSFERIN_EXIT=0x4fb
-[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_TRANSFEROUT_ENTRY=0x4fc
-[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_TRANSFEROUT_ENTRY_DUP01=0x4fe
-[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_TRANSFEROUT_ENTRY_DUP02=0x500
-[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_TRANSFEROUT_EXIT=0x4fd
-[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_TRANSFEROUT_EXIT_DUP01=0x4ff
-[TRACE]TRACE_FLOW[0x8A]_CBULKTRANSFER_TRANSFEROUT_EXIT_DUP02=0x501
-[TRACE]TRACE_FLOW[0x8A]_CCONTROLENDPOINTREADER_CCONTROLENDPOINTREADER_ENTRY=0x462
-[TRACE]TRACE_FLOW[0x8A]_CCONTROLENDPOINTREADER_CCONTROLENDPOINTREADER_ENTRY_DUP01=0x464
-[TRACE]TRACE_FLOW[0x8A]_CCONTROLENDPOINTREADER_CCONTROLENDPOINTREADER_EXIT=0x463
-[TRACE]TRACE_FLOW[0x8A]_CCONTROLENDPOINTREADER_CCONTROLENDPOINTREADER_EXIT_DUP01=0x465
-[TRACE]TRACE_FLOW[0x8A]_CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_ENTRY=0x46a
-[TRACE]TRACE_FLOW[0x8A]_CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_EXIT=0x46b
-[TRACE]TRACE_FLOW[0x8A]_CCONTROLENDPOINTREADER_ENDPOINTREADERROR_ENTRY=0x468
-[TRACE]TRACE_FLOW[0x8A]_CCONTROLENDPOINTREADER_ENDPOINTREADERROR_EXIT=0x469
-[TRACE]TRACE_FLOW[0x8A]_CCONTROLENDPOINTREADER_READREQUESTSL_ENTRY=0x466
-[TRACE]TRACE_FLOW[0x8A]_CCONTROLENDPOINTREADER_READREQUESTSL_EXIT=0x467
-[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_CDEVICEENDPOINT0_ENTRY=0x8f
-[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_CDEVICEENDPOINT0_ENTRY_DUP01=0x91
-[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_CDEVICEENDPOINT0_EXIT=0x90
-[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_CDEVICEENDPOINT0_EXIT_DUP01=0x92
-[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_CONSTRUCTL_ENTRY=0x93
-[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_CONSTRUCTL_EXIT=0x94
-[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_NEWL_ENTRY=0x8d
-[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_NEWL_EXIT=0x8e
-[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_READER_ENTRY=0x9e
-[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_READER_EXIT=0x9f
-[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_SENDDATASYNCHRONOUS_ENTRY=0x9c
-[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_SENDDATASYNCHRONOUS_EXIT=0x9d
-[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_SENDDATA_ENTRY=0x9a
-[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_SENDDATA_EXIT=0x9b
-[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_START_ENTRY=0x95
-[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_START_EXIT=0x96
-[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_START_EXIT_DUP01=0x97
-[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_STOP_ENTRY=0x98
-[TRACE]TRACE_FLOW[0x8A]_CDEVICEENDPOINT0_STOP_EXIT=0x99
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_ACKNOWLEDGE_ENTRY=0x49c
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_ACKNOWLEDGE_EXIT=0x49d
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_BUFFER_ENTRY=0x48c
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_BUFFER_EXIT=0x48d
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_CENDPOINTREADER_ENTRY=0x488
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_CENDPOINTREADER_ENTRY_DUP01=0x48a
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_CENDPOINTREADER_EXIT=0x489
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_CENDPOINTREADER_EXIT_DUP01=0x48b
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_DOCANCEL_ENTRY=0x49e
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_DOCANCEL_EXIT=0x49f
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_ISVALID_ENTRY=0x48e
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_ISVALID_EXIT=0x48f
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_NUMBYTESREADSOFAR_ENTRY=0x490
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_NUMBYTESREADSOFAR_EXIT=0x491
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_READANDHALTL_ENTRY=0x498
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_READANDHALTL_EXIT=0x499
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_READL_ENTRY=0x494
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_READL_EXIT=0x495
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_READPACKETL_ENTRY=0x492
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_READPACKETL_EXIT=0x493
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_READUNTILSHORTL_ENTRY=0x496
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_READUNTILSHORTL_EXIT=0x497
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_REPEATEDREADANDVALIDATEL_ENTRY=0x49a
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_REPEATEDREADANDVALIDATEL_EXIT=0x49b
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_RUNERROR_ENTRY=0x4a2
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_RUNERROR_EXIT=0x4a3
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_RUNL_ENTRY=0x4a0
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTREADER_RUNL_EXIT=0x4a1
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_CENDPOINTWRITER_ENTRY=0x4a4
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_CENDPOINTWRITER_ENTRY_DUP01=0x4a6
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_CENDPOINTWRITER_EXIT=0x4a5
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_CENDPOINTWRITER_EXIT_DUP01=0x4a7
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_CREATEBIGBUFFER_ENTRY=0x4be
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_CREATEBIGBUFFER_EXIT=0x4bf
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_DOCANCEL_ENTRY=0x4a8
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_DOCANCEL_EXIT=0x4a9
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_NUMBYTESWRITTENSOFAR_ENTRY=0x4aa
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_NUMBYTESWRITTENSOFAR_EXIT=0x4ab
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_RUNERROR_ENTRY=0x4ae
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_RUNERROR_EXIT=0x4af
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_RUNL_ENTRY=0x4ac
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_RUNL_EXIT=0x4ad
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITEINPARTSUSINGPATTERNL_ENTRY=0x4bc
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITEINPARTSUSINGPATTERNL_EXIT=0x4bd
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNANDHALTL_ENTRY=0x4b8
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNANDHALTL_EXIT=0x4b9
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNL_ENTRY=0x4b4
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNL_ENTRY_DUP01=0x4b6
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNL_EXIT=0x4b5
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITESYNCHRONOUSUSINGPATTERNL_EXIT_DUP01=0x4b7
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITESYNCHRONOUS_ENTRY=0x4b3
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITEUSINGPATTERNL_ENTRY=0x4ba
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITEUSINGPATTERNL_EXIT=0x4bb
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITE_ENTRY=0x4b0
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITE_EXIT=0x4b1
-[TRACE]TRACE_FLOW[0x8A]_CENDPOINTWRITER_WRITE_EXIT_DUP01=0x4b2
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_CANCELSENDREQUEST_ENTRY=0x472
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_CANCELSENDREQUEST_EXIT=0x473
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_CEP0TRANSFER_ENTRY=0x46c
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_CEP0TRANSFER_ENTRY_DUP01=0x46e
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_CEP0TRANSFER_EXIT=0x46d
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_CEP0TRANSFER_EXIT_DUP01=0x46f
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_DOCANCEL_ENTRY=0x470
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_DOCANCEL_EXIT=0x471
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_LASTREQUESTCOMPLETIONTIME_ENTRY=0x486
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_LASTREQUESTCOMPLETIONTIME_EXIT=0x487
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_LASTREQUESTSTARTTIME_ENTRY=0x484
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_LASTREQUESTSTARTTIME_EXIT=0x485
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_RUNERROR_ENTRY=0x482
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_RUNERROR_EXIT=0x483
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_RUNL_ENTRY=0x480
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_RUNL_EXIT=0x481
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_ENTRY=0x474
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_ENTRY_DUP01=0x476
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_ENTRY_DUP02=0x478
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_ENTRY_DUP03=0x47a
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_ENTRY_DUP04=0x47c
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_ENTRY_DUP05=0x47e
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_EXIT=0x475
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_EXIT_DUP01=0x477
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_EXIT_DUP02=0x479
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_EXIT_DUP03=0x47b
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_EXIT_DUP04=0x47d
-[TRACE]TRACE_FLOW[0x8A]_CEP0TRANSFER_SENDREQUEST_EXIT_DUP05=0x47f
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_ADDINTERFACESETTINGL_ENTRY=0x5be
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_ADDINTERFACESETTINGL_EXIT=0x5bf
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_ALTERNATEINTERFACESELECTEDL_ENTRY=0x5c8
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_ALTERNATEINTERFACESELECTEDL_EXIT=0x5c9
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_ALTERNATESETTING_ENTRY=0x5c1
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_ALTERNATESETTING_EXIT=0x5c2
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_BASECONSTRUCTL_ENTRY=0x5bc
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_BASECONSTRUCTL_EXIT=0x5bd
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_CINTERFACEBASE_ENTRY=0x5b8
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_CINTERFACEBASE_ENTRY_DUP01=0x5ba
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_CINTERFACEBASE_EXIT=0x5b9
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_CINTERFACEBASE_EXIT_DUP01=0x5bb
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_EXTRACTNUMBERL_ENTRY=0x5c4
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_EXTRACTNUMBERL_EXIT=0x5c5
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_EXTRACTTWONUMBERSL_ENTRY=0x5c6
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_EXTRACTTWONUMBERSL_EXIT=0x5c7
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_INTERFACESETTINGCOUNT_ENTRY=0x5c3
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_PROCESSREQUESTL_ENTRY=0x5ca
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_PROCESSREQUESTL_EXIT=0x5cb
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_STALLENDPOINT_ENTRY=0x5c0
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_STARTEP0READING_ENTRY=0x5cc
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_STARTEP0READING_EXIT=0x5cd
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_STOPEP0READING_ENTRY=0x5ce
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACEBASE_STOPEP0READING_EXIT=0x5cf
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_ADDENDPOINT_ENTRY=0x5d8
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_ADDENDPOINT_EXIT=0x5d9
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_ADDENDPOINT_EXIT_DUP01=0x5da
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_ADDENDPOINT_EXIT_DUP02=0x5db
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CACHEDENDPOINTRESULTL_ENTRY=0x5f2
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CANCELANYREADDATAFROMENDPOINTL_ENTRY=0x5fd
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CANCELANYREADDATAFROMENDPOINTL_EXIT=0x5fe
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CANCELWRITEDATATOENDPOINTL_ENTRY=0x5e8
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CANCELWRITEDATATOENDPOINTL_EXIT=0x5e9
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CINTERFACESETTINGBASE_ENTRY=0x5d0
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CINTERFACESETTINGBASE_ENTRY_DUP01=0x5d2
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CINTERFACESETTINGBASE_EXIT=0x5d1
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CINTERFACESETTINGBASE_EXIT_DUP01=0x5d3
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CREATEENDPOINTREADERL_ENTRY=0x5dc
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CREATEENDPOINTREADERL_EXIT=0x5dd
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CREATEENDPOINTWRITERL_ENTRY=0x5de
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_CREATEENDPOINTWRITERL_EXIT=0x5df
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_NAME_ENTRY=0x5d4
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_NAME_EXIT=0x5d5
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_NUMBYTESREADSOFARL_ENTRY=0x5f3
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_NUMBYTESWRITTENSOFARL_ENTRY=0x5f4
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_READDATAFROMANDHALTENDPOINTL_ENTRY=0x5ff
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_READDATAFROMANDHALTENDPOINTL_EXIT=0x600
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_READDATAFROMENDPOINTL_ENTRY=0x5fb
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_READDATAFROMENDPOINTL_EXIT=0x5fc
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_READDATAUNTILSHORTFROMENDPOINTL_ENTRY=0x603
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_READDATAUNTILSHORTFROMENDPOINTL_EXIT=0x604
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_REPEATEDREADANDVALIDATEFROMENDPOINTL_ENTRY=0x601
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_REPEATEDREADANDVALIDATEFROMENDPOINTL_EXIT=0x602
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_REPEATEDWRITESPECIFIEDDATATOENDPOINTL_ENTRY=0x5e4
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_REPEATEDWRITESPECIFIEDDATATOENDPOINTL_EXIT=0x5e5
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_SETCLASSCODEL_ENTRY=0x5d6
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_SETCLASSCODEL_EXIT=0x5d7
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_ENTRY=0x5f5
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_ENTRY_DUP01=0x5f6
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_EXIT=0x5f7
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_EXIT_DUP01=0x5f8
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_EXIT_DUP02=0x5f9
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_EXIT_DUP03=0x5fa
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITECACHEDENDPOINTDATATOENDPOINTL_ENTRY=0x5e6
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITECACHEDENDPOINTDATATOENDPOINTL_EXIT=0x5e7
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESPECIFIEDDATATOENDPOINTL_ENTRY=0x5e0
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESPECIFIEDDATATOENDPOINTL_ENTRY_DUP01=0x5e2
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESPECIFIEDDATATOENDPOINTL_EXIT=0x5e1
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESPECIFIEDDATATOENDPOINTL_EXIT_DUP01=0x5e3
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESYNCHRONOUSCACHEDENDPOINTDATATOENDPOINTL_ENTRY=0x5ee
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESYNCHRONOUSCACHEDENDPOINTDATATOENDPOINTL_ENTRY_DUP01=0x5f0
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESYNCHRONOUSCACHEDENDPOINTDATATOENDPOINTL_EXIT=0x5ef
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESYNCHRONOUSCACHEDENDPOINTDATATOENDPOINTL_EXIT_DUP01=0x5f1
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESYNCHRONOUSSPECIFIEDDATATOANDHALTENDPOINTL_ENTRY=0x5ec
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESYNCHRONOUSSPECIFIEDDATATOANDHALTENDPOINTL_EXIT=0x5ed
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESYNCHRONOUSSPECIFIEDDATATOENDPOINTL_ENTRY=0x5ea
-[TRACE]TRACE_FLOW[0x8A]_CINTERFACESETTINGBASE_WRITESYNCHRONOUSSPECIFIEDDATATOENDPOINTL_EXIT=0x5eb
-[TRACE]TRACE_FLOW[0x8A]_CINTERRUPTTRANSFER_CINTERRUPTTRANSFER_ENTRY=0x502
-[TRACE]TRACE_FLOW[0x8A]_CINTERRUPTTRANSFER_CINTERRUPTTRANSFER_ENTRY_DUP01=0x504
-[TRACE]TRACE_FLOW[0x8A]_CINTERRUPTTRANSFER_CINTERRUPTTRANSFER_EXIT=0x503
-[TRACE]TRACE_FLOW[0x8A]_CINTERRUPTTRANSFER_CINTERRUPTTRANSFER_EXIT_DUP01=0x505
-[TRACE]TRACE_FLOW[0x8A]_CINTERRUPTTRANSFER_DATAPOLLED_ENTRY=0x506
-[TRACE]TRACE_FLOW[0x8A]_CINTERRUPTTRANSFER_REGISTERTRANSFERDESCRIPTOR_ENTRY=0x509
-[TRACE]TRACE_FLOW[0x8A]_CINTERRUPTTRANSFER_REGISTERTRANSFERDESCRIPTOR_EXIT=0x50a
-[TRACE]TRACE_FLOW[0x8A]_CINTERRUPTTRANSFER_TRANSFERINL_ENTRY=0x507
-[TRACE]TRACE_FLOW[0x8A]_CINTERRUPTTRANSFER_TRANSFERINL_EXIT=0x508
-[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_CISOCHTRANSFER_ENTRY=0x50b
-[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_CISOCHTRANSFER_ENTRY_DUP01=0x50d
-[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_CISOCHTRANSFER_EXIT=0x50c
-[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_CISOCHTRANSFER_EXIT_DUP01=0x50e
-[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_DATAPOLLED_ENTRY=0x50f
-[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_DATAPOLLED_EXIT=0x510
-[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_PREPARETRANSFER_ENTRY=0x515
-[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_PREPARETRANSFER_EXIT=0x516
-[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_REGISTERTRANSFERDESCRIPTOR_ENTRY=0x513
-[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_REGISTERTRANSFERDESCRIPTOR_EXIT=0x514
-[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_TRANSFERINL_ENTRY=0x511
-[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_TRANSFERINL_EXIT=0x512
-[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_TRANSFEROUT_ENTRY=0x517
-[TRACE]TRACE_FLOW[0x8A]_CISOCHTRANSFER_TRANSFEROUT_EXIT=0x518
-[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_CONSTRUCTL_ENTRY=0x65a
-[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_CONSTRUCTL_EXIT=0x65b
-[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_ENTRY=0x656
-[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_ENTRY_DUP01=0x658
-[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_EXIT=0x657
-[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_EXIT_DUP01=0x659
-[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_NEWL_ENTRY=0x654
-[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_NEWL_EXIT=0x655
-[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_RUNL_ENTRY=0x65e
-[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_RUNL_EXIT=0x65f
-[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_WAKEUP_ENTRY=0x65c
-[TRACE]TRACE_FLOW[0x8A]_CREMOTEWAKEUPTIMER_WAKEUP_EXIT=0x65d
-[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_CSOFTWARECONNECTTIMER_ENTRY=0x520
-[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_CSOFTWARECONNECTTIMER_ENTRY_DUP01=0x522
-[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_CSOFTWARECONNECTTIMER_EXIT=0x521
-[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_CSOFTWARECONNECTTIMER_EXIT_DUP01=0x523
-[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_NEWL_ENTRY=0x51e
-[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_NEWL_EXIT=0x51f
-[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_RUNL_ENTRY=0x52a
-[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_RUNL_EXIT=0x52b
-[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_SOFTWARECONNECT_ENTRY=0x524
-[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_SOFTWARECONNECT_EXIT=0x525
-[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_SOFTWAREDISCONNECT_ENTRY=0x526
-[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_SOFTWAREDISCONNECT_EXIT=0x527
-[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_SOFTWARERECONNECT_ENTRY=0x528
-[TRACE]TRACE_FLOW[0x8A]_CSOFTWARECONNECTTIMER_SOFTWARERECONNECT_EXIT=0x529
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_CONSTRUCTL_ENTRY=0x532
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_CONSTRUCTL_EXIT=0x533
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_CTESTCASECONTROLLER_ENTRY=0x52e
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_CTESTCASECONTROLLER_ENTRY_DUP01=0x530
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_CTESTCASECONTROLLER_EXIT=0x52f
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_CTESTCASECONTROLLER_EXIT_DUP01=0x531
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_DOCANCEL_ENTRY=0x534
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_DOCANCEL_EXIT=0x535
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_NEWL_ENTRY=0x52c
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_NEWL_EXIT=0x52d
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_RUNERROR_ENTRY=0x538
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_RUNERROR_EXIT=0x539
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_RUNL_ENTRY=0x536
-[TRACE]TRACE_FLOW[0x8A]_CTESTCASECONTROLLER_RUNL_EXIT=0x537
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_CONSTRUCTL_ENTRY=0x5a9
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_CONSTRUCTL_EXIT=0x5aa
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_CTESTENGINE_ENTRY=0x5a5
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_CTESTENGINE_ENTRY_DUP01=0x5a7
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_CTESTENGINE_EXIT=0x5a6
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_CTESTENGINE_EXIT_DUP01=0x5a8
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_DOCANCEL_ENTRY=0x5b2
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_DOCANCEL_EXIT=0x5b3
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_NEWL_ENTRY=0x5a3
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_NEWL_EXIT=0x5a4
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_NEXTTESTCASEID_ENTRY=0x5ab
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_NEXTTESTCASEID_EXIT=0x5ac
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_NEXTTESTCASEID_EXIT_DUP01=0x5ad
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_NUMREPEATS_ENTRY=0x5b0
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_NUMREPEATS_EXIT=0x5b1
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_RUNERROR_ENTRY=0x5b6
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_RUNERROR_EXIT=0x5b7
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_RUNL_ENTRY=0x5b4
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_RUNL_EXIT=0x5b5
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_TESTCASESIDENTITIES_ENTRY=0x5ae
-[TRACE]TRACE_FLOW[0x8A]_CTESTENGINE_TESTCASESIDENTITIES_EXIT=0x5af
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_CONSTRUCTL_ENTRY=0x61d
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_CONSTRUCTL_EXIT=0x61e
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_CTHREADTESTPOLICY_ENTRY=0x619
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_CTHREADTESTPOLICY_ENTRY_DUP01=0x61b
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_CTHREADTESTPOLICY_EXIT=0x61a
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_CTHREADTESTPOLICY_EXIT_DUP01=0x61c
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_DOCANCEL_ENTRY=0x623
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_DOCANCEL_EXIT=0x624
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_DOTESTL_ENTRY=0x628
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_DOTESTL_EXIT=0x629
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_NEWL_ENTRY=0x617
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_NEWL_EXIT=0x618
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_RUNERROR_ENTRY=0x62c
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_RUNERROR_EXIT=0x62d
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_RUNL_ENTRY=0x62a
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_RUNL_EXIT=0x62b
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_RUNTESTCASEL_ENTRY=0x61f
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_RUNTESTCASEL_EXIT=0x620
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_SIGNALTESTCOMPLETE_ENTRY=0x621
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_SIGNALTESTCOMPLETE_EXIT=0x622
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_THREADFUNCTION_ENTRY=0x625
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_THREADFUNCTION_EXIT=0x626
-[TRACE]TRACE_FLOW[0x8A]_CTHREADTESTPOLICY_THREADFUNCTION_EXIT_DUP01=0x627
-[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_CONSTRUCTL_ENTRY=0x634
-[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_CONSTRUCTL_EXIT=0x635
-[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_ENTRY=0x630
-[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_ENTRY_DUP01=0x632
-[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_EXIT=0x631
-[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_EXIT_DUP01=0x633
-[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_DOCANCEL_ENTRY=0x636
-[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_DOCANCEL_EXIT=0x637
-[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_NEWL_ENTRY=0x62e
-[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_NEWL_EXIT=0x62f
-[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_RUNERROR_ENTRY=0x63a
-[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_RUNERROR_EXIT=0x63b
-[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_RUNL_ENTRY=0x638
-[TRACE]TRACE_FLOW[0x8A]_CUSBCLIENTSTATEWATCHER_RUNL_EXIT=0x639
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_CONFIGURATIONDESCRIPTOR_ENTRY=0x4eb
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_CONFIGURATIONDESCRIPTOR_EXIT=0x4ec
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_CONFIGURATIONSTRING_ENTRY=0x4e9
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_CONFIGURATIONSTRING_EXIT=0x4ea
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_CONSTRUCTL_ENTRY=0x4d9
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_CONSTRUCTL_EXIT=0x4da
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_CUSBTESTDEVICE_ENTRY=0x4d5
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_CUSBTESTDEVICE_ENTRY_DUP01=0x4d7
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_CUSBTESTDEVICE_EXIT=0x4d6
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_CUSBTESTDEVICE_EXIT_DUP01=0x4d8
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_DEVICEDESCRIPTOR_ENTRY=0x4ed
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_DEVICEDESCRIPTOR_EXIT=0x4ee
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_DEVICESPEC_ENTRY=0x4dd
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_DEVICESPEC_EXIT=0x4de
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_DEVICE_ENTRY=0x4db
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_DEVICE_EXIT=0x4dc
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_DOCANCEL_ENTRY=0x4ef
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_DOCANCEL_EXIT=0x4f0
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_MANUFACTURER_ENTRY=0x4e5
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_MANUFACTURER_EXIT=0x4e6
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_NEWL_ENTRY=0x4d3
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_NEWL_EXIT=0x4d4
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_PRODUCTID_ENTRY=0x4df
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_PRODUCTID_EXIT=0x4e0
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_PRODUCT_ENTRY=0x4e7
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_PRODUCT_EXIT=0x4e8
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_RUNERROR_ENTRY=0x4f3
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_RUNERROR_EXIT=0x4f4
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_RUNL_ENTRY=0x4f1
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_RUNL_EXIT=0x4f2
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_SERIALNUMBER_ENTRY=0x4e3
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_SERIALNUMBER_EXIT=0x4e4
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_VENDORID_ENTRY=0x4e1
-[TRACE]TRACE_FLOW[0x8A]_CUSBTESTDEVICE_VENDORID_EXIT=0x4e2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_BUSERRORL_ENTRY=0xb7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_BUSERRORL_EXIT=0xb8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_CONSTRUCTL_ENTRY=0xa4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_CONSTRUCTL_EXIT=0xa5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_CUT_PBASE_T_USBDI_0472_ENTRY=0xa2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_CUT_PBASE_T_USBDI_0472_ENTRY_DUP01=0xa6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_CUT_PBASE_T_USBDI_0472_EXIT=0xa3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_CUT_PBASE_T_USBDI_0472_EXIT_DUP01=0xa7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_DEVICEDOCANCEL_ENTRY=0xae
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_DEVICEDOCANCEL_EXIT=0xaf
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_ENTRY=0xb0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_EXIT=0xb1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_EXIT_DUP01=0xb2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_DEVICEREMOVEDL_ENTRY=0xb5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_DEVICEREMOVEDL_EXIT=0xb6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_DEVICERUNL_ENTRY=0xbd
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_DEVICERUNL_EXIT=0xbe
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_DEVICESTATECHANGEL_ENTRY=0xb9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_DEVICESTATECHANGEL_EXIT=0xba
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_EP0TRANSFERCOMPLETEL_ENTRY=0xb3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_EP0TRANSFERCOMPLETEL_EXIT=0xb4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_EXECUTEDEVICETESTCASEL_ENTRY=0xaa
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_EXECUTEDEVICETESTCASEL_EXIT=0xab
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_EXECUTEHOSTTESTCASEL_ENTRY=0xa8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_EXECUTEHOSTTESTCASEL_EXIT=0xa9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_HOSTDOCANCEL_ENTRY=0xac
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_HOSTDOCANCEL_EXIT=0xad
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_HOSTRUNL_ENTRY=0xbb
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_HOSTRUNL_EXIT=0xbc
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_NEWL_ENTRY=0xa0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0472_NEWL_EXIT=0xa1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_BUSERRORL_ENTRY=0xd6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_BUSERRORL_EXIT=0xd7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CHECKFORALLRESUMEDNOTIFICATIONSANDCONTINUEFSM_ENTRY=0xd8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CHECKFORALLRESUMEDNOTIFICATIONSANDCONTINUEFSM_EXIT=0xd9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CONSTRUCTL_ENTRY=0xc3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CONSTRUCTL_EXIT=0xc4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_ENTRY=0xda
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_EXIT=0xdb
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_EXIT_DUP01=0xdc
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_EXIT_DUP02=0xdd
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_EXIT_DUP03=0xde
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_EXIT_DUP04=0xdf
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CUT_PBASE_T_USBDI_0473_ENTRY=0xc1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CUT_PBASE_T_USBDI_0473_ENTRY_DUP01=0xc5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CUT_PBASE_T_USBDI_0473_EXIT=0xc2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_CUT_PBASE_T_USBDI_0473_EXIT_DUP01=0xc6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_DEVICEDOCANCEL_ENTRY=0xcd
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_DEVICEDOCANCEL_EXIT=0xce
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_ENTRY=0xcf
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_EXIT=0xd0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_EXIT_DUP01=0xd1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_DEVICEREMOVEDL_ENTRY=0xd4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_DEVICEREMOVEDL_EXIT=0xd5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_DEVICERUNL_ENTRY=0xe6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_DEVICERUNL_EXIT=0xe7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_ENTRY=0xe0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_EXIT=0xe1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL_ENTRY=0xe2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL_EXIT=0xe3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_EXECUTEDEVICETESTCASEL_ENTRY=0xc9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_EXECUTEDEVICETESTCASEL_EXIT=0xca
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_EXECUTEHOSTTESTCASEL_ENTRY=0xc7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_EXECUTEHOSTTESTCASEL_EXIT=0xc8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_HOSTDOCANCEL_ENTRY=0xcb
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_HOSTDOCANCEL_EXIT=0xcc
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_HOSTRUNL_ENTRY=0xe4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_HOSTRUNL_EXIT=0xe5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_INTERFACE0RESUMEDL_ENTRY=0xd2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_INTERFACE1RESUMEDL_ENTRY=0xd3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_NEWL_ENTRY=0xbf
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0473_NEWL_EXIT=0xc0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_BUSERRORL_ENTRY=0xfd
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_BUSERRORL_EXIT=0xfe
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_CONSTRUCTL_ENTRY=0xec
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_CONSTRUCTL_EXIT=0xed
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_CUT_PBASE_T_USBDI_0474_ENTRY=0xea
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_CUT_PBASE_T_USBDI_0474_ENTRY_DUP01=0xee
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_CUT_PBASE_T_USBDI_0474_EXIT=0xeb
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_CUT_PBASE_T_USBDI_0474_EXIT_DUP01=0xef
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_DEVICEDOCANCEL_ENTRY=0xf6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_DEVICEDOCANCEL_EXIT=0xf7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_ENTRY=0xf8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_EXIT=0xf9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_EXIT_DUP01=0xfa
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_DEVICEREMOVEDL_ENTRY=0xfb
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_DEVICEREMOVEDL_EXIT=0xfc
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_DEVICERUNL_ENTRY=0x105
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_DEVICERUNL_EXIT=0x106
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_DEVICESTATECHANGEL_ENTRY=0xff
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_DEVICESTATECHANGEL_EXIT=0x100
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_EP0TRANSFERCOMPLETEL_ENTRY=0x101
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_EP0TRANSFERCOMPLETEL_EXIT=0x102
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_EXECUTEDEVICETESTCASEL_ENTRY=0xf2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_EXECUTEDEVICETESTCASEL_EXIT=0xf3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_EXECUTEHOSTTESTCASEL_ENTRY=0xf0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_EXECUTEHOSTTESTCASEL_EXIT=0xf1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_HOSTDOCANCEL_ENTRY=0xf4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_HOSTDOCANCEL_EXIT=0xf5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_HOSTRUNL_ENTRY=0x103
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_HOSTRUNL_EXIT=0x104
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_NEWL_ENTRY=0xe8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0474_NEWL_EXIT=0xe9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_CONSTRUCTL_ENTRY=0x10b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_CONSTRUCTL_EXIT=0x10c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_CUT_PBASE_T_USBDI_0475_ENTRY=0x109
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_CUT_PBASE_T_USBDI_0475_ENTRY_DUP01=0x10d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_CUT_PBASE_T_USBDI_0475_EXIT=0x10a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_CUT_PBASE_T_USBDI_0475_EXIT_DUP01=0x10e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_DEVICEDOCANCEL_ENTRY=0x115
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_DEVICEDOCANCEL_EXIT=0x116
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_DEVICERUNL_ENTRY=0x119
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_DEVICERUNL_EXIT=0x11a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_EXECUTEDEVICETESTCASEL_ENTRY=0x113
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_EXECUTEDEVICETESTCASEL_EXIT=0x114
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_EXECUTEHOSTTESTCASEL_ENTRY=0x10f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_EXECUTEHOSTTESTCASEL_EXIT=0x110
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_HOSTDOCANCEL_ENTRY=0x111
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_HOSTDOCANCEL_EXIT=0x112
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_HOSTRUNL_ENTRY=0x117
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_HOSTRUNL_EXIT=0x118
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_NEWL_ENTRY=0x107
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0475_NEWL_EXIT=0x108
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_CONSTRUCTL_ENTRY=0x11f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_CONSTRUCTL_EXIT=0x120
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_CUT_PBASE_T_USBDI_0476_ENTRY=0x11d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_CUT_PBASE_T_USBDI_0476_ENTRY_DUP01=0x121
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_CUT_PBASE_T_USBDI_0476_EXIT=0x11e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_CUT_PBASE_T_USBDI_0476_EXIT_DUP01=0x122
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_DEVICEDOCANCEL_ENTRY=0x129
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_DEVICEDOCANCEL_EXIT=0x12a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_DEVICERUNL_ENTRY=0x12d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_DEVICERUNL_EXIT=0x12e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_EXECUTEDEVICETESTCASEL_ENTRY=0x127
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_EXECUTEDEVICETESTCASEL_EXIT=0x128
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_EXECUTEHOSTTESTCASEL_ENTRY=0x123
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_EXECUTEHOSTTESTCASEL_EXIT=0x124
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_HOSTDOCANCEL_ENTRY=0x125
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_HOSTDOCANCEL_EXIT=0x126
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_HOSTRUNL_ENTRY=0x12b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_HOSTRUNL_EXIT=0x12c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_NEWL_ENTRY=0x11b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0476_NEWL_EXIT=0x11c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_BUSERRORL_ENTRY=0x14c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_BUSERRORL_EXIT=0x14d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_CHECKFIRSTINTERFACEDESCRIPTORDEVICEA_ENTRY=0x13f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_CHECKFIRSTINTERFACEDESCRIPTORDEVICEA_EXIT=0x140
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_CONSTRUCTL_ENTRY=0x133
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_CONSTRUCTL_EXIT=0x134
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_CUT_PBASE_T_USBDI_0477_ENTRY=0x131
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_CUT_PBASE_T_USBDI_0477_ENTRY_DUP01=0x135
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_CUT_PBASE_T_USBDI_0477_EXIT=0x132
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_CUT_PBASE_T_USBDI_0477_EXIT_DUP01=0x136
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEDOCANCEL_ENTRY=0x13d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEDOCANCEL_EXIT=0x13e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_ENTRY=0x141
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT=0x142
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP01=0x143
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP02=0x144
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP03=0x145
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP04=0x146
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP05=0x147
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP06=0x148
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_EXIT_DUP07=0x149
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEREMOVEDL_ENTRY=0x14a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICEREMOVEDL_EXIT=0x14b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICERUNL_ENTRY=0x154
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICERUNL_EXIT=0x155
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICESTATECHANGEL_ENTRY=0x14e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_DEVICESTATECHANGEL_EXIT=0x14f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_EP0TRANSFERCOMPLETEL_ENTRY=0x150
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_EP0TRANSFERCOMPLETEL_EXIT=0x151
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_EXECUTEDEVICETESTCASEL_ENTRY=0x139
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_EXECUTEDEVICETESTCASEL_EXIT=0x13a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_EXECUTEHOSTTESTCASEL_ENTRY=0x137
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_EXECUTEHOSTTESTCASEL_EXIT=0x138
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_HOSTDOCANCEL_ENTRY=0x13b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_HOSTDOCANCEL_EXIT=0x13c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_HOSTRUNL_ENTRY=0x152
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_HOSTRUNL_EXIT=0x153
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_NEWL_ENTRY=0x12f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0477_NEWL_EXIT=0x130
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_BUSERRORL_ENTRY=0x170
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_BUSERRORL_EXIT=0x171
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_CONSTRUCTL_ENTRY=0x15a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_CONSTRUCTL_EXIT=0x15b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_CUT_PBASE_T_USBDI_0478_ENTRY=0x158
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_CUT_PBASE_T_USBDI_0478_ENTRY_DUP01=0x15c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_CUT_PBASE_T_USBDI_0478_EXIT=0x159
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_CUT_PBASE_T_USBDI_0478_EXIT_DUP01=0x15d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICEDOCANCEL_ENTRY=0x164
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICEDOCANCEL_EXIT=0x165
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_ENTRY=0x168
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_EXIT=0x169
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_EXIT_DUP01=0x16a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_EXIT_DUP02=0x16b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICEREMOVEDL_ENTRY=0x16e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICEREMOVEDL_EXIT=0x16f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICERUNL_ENTRY=0x174
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICERUNL_EXIT=0x175
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICESTATECHANGEL_ENTRY=0x166
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_DEVICESTATECHANGEL_EXIT=0x167
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_EP0TRANSFERCOMPLETEL_ENTRY=0x16c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_EP0TRANSFERCOMPLETEL_EXIT=0x16d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_EXECUTEDEVICETESTCASEL_ENTRY=0x162
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_EXECUTEDEVICETESTCASEL_EXIT=0x163
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_EXECUTEHOSTTESTCASEL_ENTRY=0x15e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_EXECUTEHOSTTESTCASEL_EXIT=0x15f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_HOSTDOCANCEL_ENTRY=0x160
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_HOSTDOCANCEL_EXIT=0x161
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_HOSTRUNL_ENTRY=0x172
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_HOSTRUNL_EXIT=0x173
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_NEWL_ENTRY=0x156
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0478_NEWL_EXIT=0x157
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_BUSERRORL_ENTRY=0x18d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_BUSERRORL_EXIT=0x18e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_CONSTRUCTL_ENTRY=0x17a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_CONSTRUCTL_EXIT=0x17b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_CUT_PBASE_T_USBDI_0479_ENTRY=0x178
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_CUT_PBASE_T_USBDI_0479_ENTRY_DUP01=0x17c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_CUT_PBASE_T_USBDI_0479_EXIT=0x179
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_CUT_PBASE_T_USBDI_0479_EXIT_DUP01=0x17d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_DEVICEDOCANCEL_ENTRY=0x184
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_DEVICEDOCANCEL_EXIT=0x185
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_ENTRY=0x188
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_EXIT=0x189
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_EXIT_DUP01=0x18a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_DEVICEREMOVEDL_ENTRY=0x18b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_DEVICEREMOVEDL_EXIT=0x18c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_DEVICERUNL_ENTRY=0x193
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_DEVICERUNL_EXIT=0x194
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_DEVICESTATECHANGEL_ENTRY=0x186
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_DEVICESTATECHANGEL_EXIT=0x187
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_EP0TRANSFERCOMPLETEL_ENTRY=0x18f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_EP0TRANSFERCOMPLETEL_EXIT=0x190
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_EXECUTEDEVICETESTCASEL_ENTRY=0x182
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_EXECUTEDEVICETESTCASEL_EXIT=0x183
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_EXECUTEHOSTTESTCASEL_ENTRY=0x17e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_EXECUTEHOSTTESTCASEL_EXIT=0x17f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_HOSTDOCANCEL_ENTRY=0x180
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_HOSTDOCANCEL_EXIT=0x181
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_HOSTRUNL_ENTRY=0x191
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_HOSTRUNL_EXIT=0x192
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_NEWL_ENTRY=0x176
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0479_NEWL_EXIT=0x177
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_BUSERRORL_ENTRY=0x1b2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_BUSERRORL_EXIT=0x1b3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_CONSTRUCTL_ENTRY=0x199
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_CONSTRUCTL_EXIT=0x19a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_CUT_PBASE_T_USBDI_0480_ENTRY=0x197
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_CUT_PBASE_T_USBDI_0480_ENTRY_DUP01=0x19b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_CUT_PBASE_T_USBDI_0480_EXIT=0x198
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_CUT_PBASE_T_USBDI_0480_EXIT_DUP01=0x19c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICEDOCANCEL_ENTRY=0x1a3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICEDOCANCEL_EXIT=0x1a4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_ENTRY=0x1a7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT=0x1a8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT_DUP01=0x1a9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT_DUP02=0x1aa
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT_DUP03=0x1ab
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_EXIT_DUP04=0x1ac
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICEREMOVEDL_ENTRY=0x1b0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICEREMOVEDL_EXIT=0x1b1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICERUNL_ENTRY=0x1b6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICERUNL_EXIT=0x1b7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICESTATECHANGEL_ENTRY=0x1a5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_DEVICESTATECHANGEL_EXIT=0x1a6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_ENTRY=0x1ad
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_EXIT=0x1ae
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x1af
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_EXECUTEDEVICETESTCASEL_ENTRY=0x1a1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_EXECUTEDEVICETESTCASEL_EXIT=0x1a2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_EXECUTEHOSTTESTCASEL_ENTRY=0x19d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_EXECUTEHOSTTESTCASEL_EXIT=0x19e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_HOSTDOCANCEL_ENTRY=0x19f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_HOSTDOCANCEL_EXIT=0x1a0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_HOSTRUNL_ENTRY=0x1b4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_HOSTRUNL_EXIT=0x1b5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_NEWL_ENTRY=0x195
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0480_NEWL_EXIT=0x196
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_BUSERRORL_ENTRY=0x1d1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_BUSERRORL_EXIT=0x1d2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_CONSTRUCTL_ENTRY=0x1bc
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_CONSTRUCTL_EXIT=0x1bd
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_CUT_PBASE_T_USBDI_0481_ENTRY=0x1ba
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_CUT_PBASE_T_USBDI_0481_ENTRY_DUP01=0x1be
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_CUT_PBASE_T_USBDI_0481_EXIT=0x1bb
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_CUT_PBASE_T_USBDI_0481_EXIT_DUP01=0x1bf
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_DEVICEDOCANCEL_ENTRY=0x1c6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_DEVICEDOCANCEL_EXIT=0x1c7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_ENTRY=0x1ca
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_EXIT=0x1cb
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_EXIT_DUP01=0x1cc
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_DEVICEREMOVEDL_ENTRY=0x1cf
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_DEVICEREMOVEDL_EXIT=0x1d0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_DEVICERUNL_ENTRY=0x1d5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_DEVICERUNL_EXIT=0x1d6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_DEVICESTATECHANGEL_ENTRY=0x1c8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_DEVICESTATECHANGEL_EXIT=0x1c9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_EP0TRANSFERCOMPLETEL_ENTRY=0x1cd
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_EP0TRANSFERCOMPLETEL_EXIT=0x1ce
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_EXECUTEDEVICETESTCASEL_ENTRY=0x1c2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_EXECUTEDEVICETESTCASEL_EXIT=0x1c3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_EXECUTEHOSTTESTCASEL_ENTRY=0x1c0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_EXECUTEHOSTTESTCASEL_EXIT=0x1c1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_HOSTDOCANCEL_ENTRY=0x1c4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_HOSTDOCANCEL_EXIT=0x1c5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_HOSTRUNL_ENTRY=0x1d3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_HOSTRUNL_EXIT=0x1d4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_NEWL_ENTRY=0x1b8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0481_NEWL_EXIT=0x1b9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_BUSERRORL_ENTRY=0x1fe
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_BUSERRORL_EXIT=0x1ff
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_CONSTRUCTL_ENTRY=0x1db
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_CONSTRUCTL_EXIT=0x1dc
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_CUT_PBASE_T_USBDI_0482_ENTRY=0x1d9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_CUT_PBASE_T_USBDI_0482_ENTRY_DUP01=0x1dd
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_CUT_PBASE_T_USBDI_0482_EXIT=0x1da
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_CUT_PBASE_T_USBDI_0482_EXIT_DUP01=0x1de
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_DEVICEDOCANCEL_ENTRY=0x1e5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_DEVICEDOCANCEL_EXIT=0x1e6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_ENTRY=0x1f1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_EXIT=0x1f2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_DEVICEREMOVEDL_ENTRY=0x1fc
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_DEVICEREMOVEDL_EXIT=0x1fd
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_DEVICERUNL_ENTRY=0x202
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_DEVICERUNL_EXIT=0x203
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_DEVICESTATECHANGEL_ENTRY=0x1e7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_DEVICESTATECHANGEL_EXIT=0x1e8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL_ENTRY=0x1f9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL_EXIT=0x1fa
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x1fb
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_EXECUTEDEVICETESTCASEL_ENTRY=0x1e3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_EXECUTEDEVICETESTCASEL_EXIT=0x1e4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_EXECUTEHOSTTESTCASEL_ENTRY=0x1df
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_EXECUTEHOSTTESTCASEL_EXIT=0x1e0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_ENTRY=0x1ed
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_EXIT=0x1ee
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_EXIT_DUP01=0x1ef
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_EXIT_DUP02=0x1f0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_ENTRY=0x1e9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_EXIT=0x1ea
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_EXIT_DUP01=0x1eb
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_EXIT_DUP02=0x1ec
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_HOSTDOCANCEL_ENTRY=0x1e1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_HOSTDOCANCEL_EXIT=0x1e2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_HOSTRUNL_ENTRY=0x200
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_HOSTRUNL_EXIT=0x201
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_NEWL_ENTRY=0x1d7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_NEWL_EXIT=0x1d8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA_ENTRY=0x1f3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA_EXIT=0x1f4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_ENTRY=0x1f5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_EXIT=0x1f6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_EXIT_DUP01=0x1f7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_EXIT_DUP02=0x1f8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_BUSERRORL_ENTRY=0x21e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_BUSERRORL_EXIT=0x21f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_CONSTRUCTL_ENTRY=0x208
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_CONSTRUCTL_EXIT=0x209
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_CUT_PBASE_T_USBDI_0483_ENTRY=0x206
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_CUT_PBASE_T_USBDI_0483_ENTRY_DUP01=0x20a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_CUT_PBASE_T_USBDI_0483_EXIT=0x207
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_CUT_PBASE_T_USBDI_0483_EXIT_DUP01=0x20b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_DEVICEDOCANCEL_ENTRY=0x212
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_DEVICEDOCANCEL_EXIT=0x213
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_ENTRY=0x219
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_EXIT=0x21a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_EXIT_DUP01=0x21b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_DEVICEREMOVEDL_ENTRY=0x21c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_DEVICEREMOVEDL_EXIT=0x21d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_DEVICERUNL_ENTRY=0x222
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_DEVICERUNL_EXIT=0x223
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_DEVICESTATECHANGEL_ENTRY=0x214
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_DEVICESTATECHANGEL_EXIT=0x215
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL_ENTRY=0x216
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL_EXIT=0x217
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x218
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_EXECUTEDEVICETESTCASEL_ENTRY=0x210
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_EXECUTEDEVICETESTCASEL_EXIT=0x211
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_EXECUTEHOSTTESTCASEL_ENTRY=0x20c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_EXECUTEHOSTTESTCASEL_EXIT=0x20d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_HOSTDOCANCEL_ENTRY=0x20e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_HOSTDOCANCEL_EXIT=0x20f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_HOSTRUNL_ENTRY=0x220
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_HOSTRUNL_EXIT=0x221
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_NEWL_ENTRY=0x204
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0483_NEWL_EXIT=0x205
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_CONSTRUCTL_ENTRY=0x228
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_CONSTRUCTL_EXIT=0x229
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_CUT_PBASE_T_USBDI_0484_ENTRY=0x226
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_CUT_PBASE_T_USBDI_0484_ENTRY_DUP01=0x22a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_CUT_PBASE_T_USBDI_0484_EXIT=0x227
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_CUT_PBASE_T_USBDI_0484_EXIT_DUP01=0x22b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL_ENTRY=0x231
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL_EXIT=0x232
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_EP0TRANSFERCOMPLETEL_ENTRY=0x22c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_EP0TRANSFERCOMPLETEL_EXIT=0x22d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_NEWL_ENTRY=0x224
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_NEWL_EXIT=0x225
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_ENTRY=0x22e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_EXIT=0x22f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_EXIT_DUP01=0x230
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_BUSERRORL_ENTRY=0x24c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_BUSERRORL_EXIT=0x24d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_CONSTRUCTL_ENTRY=0x237
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_CONSTRUCTL_EXIT=0x238
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_CUT_PBASE_T_USBDI_0485_ENTRY=0x235
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_CUT_PBASE_T_USBDI_0485_ENTRY_DUP01=0x239
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_CUT_PBASE_T_USBDI_0485_EXIT=0x236
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_CUT_PBASE_T_USBDI_0485_EXIT_DUP01=0x23a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_DEVICEDOCANCEL_ENTRY=0x241
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_DEVICEDOCANCEL_EXIT=0x242
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_ENTRY=0x245
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_EXIT=0x246
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_EXIT_DUP01=0x247
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_DEVICEREMOVEDL_ENTRY=0x24a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_DEVICEREMOVEDL_EXIT=0x24b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_DEVICERUNL_ENTRY=0x250
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_DEVICERUNL_EXIT=0x251
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_DEVICESTATECHANGEL_ENTRY=0x243
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_DEVICESTATECHANGEL_EXIT=0x244
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_ENTRY=0x248
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_EXIT=0x249
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_EXECUTEDEVICETESTCASEL_ENTRY=0x23d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_EXECUTEDEVICETESTCASEL_EXIT=0x23e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_EXECUTEHOSTTESTCASEL_ENTRY=0x23b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_EXECUTEHOSTTESTCASEL_EXIT=0x23c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_HOSTDOCANCEL_ENTRY=0x23f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_HOSTDOCANCEL_EXIT=0x240
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_HOSTRUNL_ENTRY=0x24e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_HOSTRUNL_EXIT=0x24f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_NEWL_ENTRY=0x233
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0485_NEWL_EXIT=0x234
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_CHECKSN_ENTRY=0x25e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_CHECKSN_EXIT=0x25f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_CONSTRUCTL_ENTRY=0x256
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_CONSTRUCTL_EXIT=0x257
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_CUT_PBASE_T_USBDI_0486_ENTRY=0x254
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_CUT_PBASE_T_USBDI_0486_ENTRY_DUP01=0x258
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_CUT_PBASE_T_USBDI_0486_EXIT=0x255
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_CUT_PBASE_T_USBDI_0486_EXIT_DUP01=0x259
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_DEVICEDOCANCEL_ENTRY=0x25c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_DEVICEDOCANCEL_EXIT=0x25d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_ENTRY=0x264
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_EXIT=0x265
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_DEVICEREMOVEDL_ENTRY=0x266
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_DEVICEREMOVEDL_EXIT=0x267
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_DEVICERUNL_ENTRY=0x25a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_DEVICERUNL_EXIT=0x25b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_EP0TRANSFERCOMPLETEL_ENTRY=0x260
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_EP0TRANSFERCOMPLETEL_EXIT=0x261
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_EXECUTEDEVICETESTCASEL_ENTRY=0x26a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_EXECUTEDEVICETESTCASEL_EXIT=0x26b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_HANDLEDEVICEDCONNECTION_ENTRY=0x268
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_HANDLEDEVICEDCONNECTION_EXIT=0x269
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_NEWL_ENTRY=0x252
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_NEWL_EXIT=0x253
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_TESTDEVICEC_ENTRY=0x26c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_TESTDEVICEC_EXIT=0x26d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_TESTDEVICED_ENTRY=0x26e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_TESTDEVICED_EXIT=0x26f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_TRANSFERCOMPLETEL_ENTRY=0x262
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0486_TRANSFERCOMPLETEL_EXIT=0x263
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_BUSERRORL_ENTRY=0x28e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_BUSERRORL_EXIT=0x28f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_CONSTRUCTL_ENTRY=0x274
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_CONSTRUCTL_EXIT=0x275
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_CUT_PBASE_T_USBDI_0487_ENTRY=0x272
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_CUT_PBASE_T_USBDI_0487_ENTRY_DUP01=0x276
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_CUT_PBASE_T_USBDI_0487_EXIT=0x273
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_CUT_PBASE_T_USBDI_0487_EXIT_DUP01=0x277
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICEDOCANCEL_ENTRY=0x27e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICEDOCANCEL_EXIT=0x27f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_ENTRY=0x282
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_EXIT=0x283
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_EXIT_DUP01=0x284
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_EXIT_DUP02=0x285
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_EXIT_DUP03=0x286
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_EXIT_DUP04=0x287
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICEREMOVEDL_ENTRY=0x28c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICEREMOVEDL_EXIT=0x28d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICERUNL_ENTRY=0x292
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICERUNL_EXIT=0x293
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICESTATECHANGEL_ENTRY=0x280
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_DEVICESTATECHANGEL_EXIT=0x281
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_EP0TRANSFERCOMPLETEL_ENTRY=0x288
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_EP0TRANSFERCOMPLETEL_EXIT=0x289
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_EXECUTEDEVICETESTCASEL_ENTRY=0x27c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_EXECUTEDEVICETESTCASEL_EXIT=0x27d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_EXECUTEHOSTTESTCASEL_ENTRY=0x278
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_EXECUTEHOSTTESTCASEL_EXIT=0x279
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_HOSTDOCANCEL_ENTRY=0x27a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_HOSTDOCANCEL_EXIT=0x27b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_HOSTRUNL_ENTRY=0x290
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_HOSTRUNL_EXIT=0x291
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_NEWL_ENTRY=0x270
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_NEWL_EXIT=0x271
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_ENTRY=0x28a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_EXIT=0x28b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_BUSERRORL_ENTRY=0x2b1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_BUSERRORL_EXIT=0x2b2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_CONSTRUCTL_ENTRY=0x298
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_CONSTRUCTL_EXIT=0x299
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_CUT_PBASE_T_USBDI_0488_ENTRY=0x296
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_CUT_PBASE_T_USBDI_0488_ENTRY_DUP01=0x29a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_CUT_PBASE_T_USBDI_0488_EXIT=0x297
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_CUT_PBASE_T_USBDI_0488_EXIT_DUP01=0x29b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICEDOCANCEL_ENTRY=0x2a5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICEDOCANCEL_EXIT=0x2a6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_ENTRY=0x2a9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_EXIT=0x2aa
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_EXIT_DUP01=0x2ab
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_EXIT_DUP02=0x2ac
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICEREMOVEDL_ENTRY=0x2af
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICEREMOVEDL_EXIT=0x2b0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICERUNL_ENTRY=0x2b5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICERUNL_EXIT=0x2b6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICESTATECHANGEL_ENTRY=0x2a7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_DEVICESTATECHANGEL_EXIT=0x2a8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_EP0TRANSFERCOMPLETEL_ENTRY=0x2ad
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_EP0TRANSFERCOMPLETEL_EXIT=0x2ae
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_EXECUTEDEVICETESTCASEL_ENTRY=0x2a3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_EXECUTEDEVICETESTCASEL_EXIT=0x2a4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_EXECUTEHOSTTESTCASEL_ENTRY=0x29c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_EXECUTEHOSTTESTCASEL_EXIT=0x29d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_HOSTDOCANCEL_ENTRY=0x2a1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_HOSTDOCANCEL_EXIT=0x2a2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_HOSTRUNL_ENTRY=0x2b3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_HOSTRUNL_EXIT=0x2b4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_NEWL_ENTRY=0x294
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_NEWL_EXIT=0x295
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_TESTSELECTALTERNATEINTERFACETHENPANIC_ENTRY=0x29e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_TESTSELECTALTERNATEINTERFACETHENPANIC_EXIT=0x29f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0488_TESTSELECTALTERNATEINTERFACETHENPANIC_EXIT_DUP01=0x2a0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_BUSERRORL_ENTRY=0x2d0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_BUSERRORL_EXIT=0x2d1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_CONSTRUCTL_ENTRY=0x2bb
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_CONSTRUCTL_EXIT=0x2bc
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_CUT_PBASE_T_USBDI_0489_ENTRY=0x2b9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_CUT_PBASE_T_USBDI_0489_ENTRY_DUP01=0x2bd
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_CUT_PBASE_T_USBDI_0489_EXIT=0x2ba
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_CUT_PBASE_T_USBDI_0489_EXIT_DUP01=0x2be
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_DEVICEDOCANCEL_ENTRY=0x2c5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_DEVICEDOCANCEL_EXIT=0x2c6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_ENTRY=0x2c9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_EXIT=0x2ca
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_EXIT_DUP01=0x2cb
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_DEVICEREMOVEDL_ENTRY=0x2ce
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_DEVICEREMOVEDL_EXIT=0x2cf
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_DEVICERUNL_ENTRY=0x2d4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_DEVICERUNL_EXIT=0x2d5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_DEVICESTATECHANGEL_ENTRY=0x2c7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_DEVICESTATECHANGEL_EXIT=0x2c8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL_ENTRY=0x2cc
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL_EXIT=0x2cd
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_EXECUTEDEVICETESTCASEL_ENTRY=0x2c1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_EXECUTEDEVICETESTCASEL_EXIT=0x2c2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_EXECUTEHOSTTESTCASEL_ENTRY=0x2bf
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_EXECUTEHOSTTESTCASEL_EXIT=0x2c0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_HOSTDOCANCEL_ENTRY=0x2c3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_HOSTDOCANCEL_EXIT=0x2c4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_HOSTRUNL_ENTRY=0x2d2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_HOSTRUNL_EXIT=0x2d3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_NEWL_ENTRY=0x2b7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0489_NEWL_EXIT=0x2b8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_CONSTRUCTL_ENTRY=0x2da
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_CONSTRUCTL_EXIT=0x2db
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_CUT_PBASE_T_USBDI_0490_ENTRY=0x2d8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_CUT_PBASE_T_USBDI_0490_ENTRY_DUP01=0x2dc
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_CUT_PBASE_T_USBDI_0490_EXIT=0x2d9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_CUT_PBASE_T_USBDI_0490_EXIT_DUP01=0x2dd
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_DEVICEINSERTEDL_ENTRY=0x2e3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_DEVICEINSERTEDL_EXIT=0x2e4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_DEVICEINSERTEDL_EXIT_DUP01=0x2e5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_ENTRY=0x2de
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_EXIT=0x2df
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x2e0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_NEWL_ENTRY=0x2d6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_NEWL_EXIT=0x2d7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL_ENTRY=0x2e1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL_EXIT=0x2e2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_CONSTRUCTL_ENTRY=0x2ea
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_CONSTRUCTL_EXIT=0x2eb
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_CUT_PBASE_T_USBDI_0491_ENTRY=0x2e8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_CUT_PBASE_T_USBDI_0491_ENTRY_DUP01=0x2ec
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_CUT_PBASE_T_USBDI_0491_EXIT=0x2e9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_CUT_PBASE_T_USBDI_0491_EXIT_DUP01=0x2ed
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL_ENTRY=0x2f3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL_EXIT=0x2f4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL_EXIT_DUP01=0x2f5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_ENTRY=0x2ee
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_EXIT=0x2ef
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x2f0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_NEWL_ENTRY=0x2e6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_NEWL_EXIT=0x2e7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL_ENTRY=0x2f1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL_EXIT=0x2f2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_CONSTRUCTL_ENTRY=0x2fa
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_CONSTRUCTL_EXIT=0x2fb
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_CUT_PBASE_T_USBDI_0492_ENTRY=0x2f8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_CUT_PBASE_T_USBDI_0492_ENTRY_DUP01=0x2fc
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_CUT_PBASE_T_USBDI_0492_EXIT=0x2f9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_CUT_PBASE_T_USBDI_0492_EXIT_DUP01=0x2fd
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_DEVICEINSERTEDL_ENTRY=0x303
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_DEVICEINSERTEDL_EXIT=0x304
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_DEVICEINSERTEDL_EXIT_DUP01=0x305
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_ENTRY=0x2fe
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_EXIT=0x2ff
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x300
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_NEWL_ENTRY=0x2f6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_NEWL_EXIT=0x2f7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_ENTRY=0x301
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_EXIT=0x302
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_CONSTRUCTL_ENTRY=0x30a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_CONSTRUCTL_EXIT=0x30b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_CUT_PBASE_T_USBDI_0493_ENTRY=0x308
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_CUT_PBASE_T_USBDI_0493_ENTRY_DUP01=0x30c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_CUT_PBASE_T_USBDI_0493_EXIT=0x309
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_CUT_PBASE_T_USBDI_0493_EXIT_DUP01=0x30d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_ENTRY=0x314
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_EXIT=0x315
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_EXIT_DUP01=0x316
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_ENTRY=0x30e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_EXIT=0x30f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x310
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_NEWL_ENTRY=0x306
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_NEWL_EXIT=0x307
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_ENTRY=0x311
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_EXIT=0x312
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_EXIT_DUP01=0x313
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_CONSTRUCTL_ENTRY=0x31b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_CONSTRUCTL_EXIT=0x31c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_CUT_PBASE_T_USBDI_0494_ENTRY=0x319
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_CUT_PBASE_T_USBDI_0494_ENTRY_DUP01=0x31d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_CUT_PBASE_T_USBDI_0494_EXIT=0x31a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_CUT_PBASE_T_USBDI_0494_EXIT_DUP01=0x31e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_DEVICEINSERTEDL_ENTRY=0x324
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_DEVICEINSERTEDL_EXIT=0x325
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_DEVICEINSERTEDL_EXIT_DUP01=0x326
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_ENTRY=0x31f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_EXIT=0x320
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x321
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_NEWL_ENTRY=0x317
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_NEWL_EXIT=0x318
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL_ENTRY=0x322
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL_EXIT=0x323
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_CONSTRUCTL_ENTRY=0x32b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_CONSTRUCTL_EXIT=0x32c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_CUT_PBASE_T_USBDI_0495_ENTRY=0x329
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_CUT_PBASE_T_USBDI_0495_ENTRY_DUP01=0x32d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_CUT_PBASE_T_USBDI_0495_EXIT=0x32a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_CUT_PBASE_T_USBDI_0495_EXIT_DUP01=0x32e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_ENTRY=0x336
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_EXIT=0x337
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_ENTRY=0x331
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_EXIT=0x332
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x333
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_KILLTRANSFERS_ENTRY=0x32f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_KILLTRANSFERS_EXIT=0x330
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_NEWL_ENTRY=0x327
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_NEWL_EXIT=0x328
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER_ENTRY=0x338
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER_EXIT=0x339
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER_EXIT_DUP01=0x33a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_ENTRY=0x334
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_EXIT=0x335
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_CONSTRUCTL_ENTRY=0x33f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_CONSTRUCTL_EXIT=0x340
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_CUT_PBASE_T_USBDI_0496_ENTRY=0x33d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_CUT_PBASE_T_USBDI_0496_ENTRY_DUP01=0x341
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_CUT_PBASE_T_USBDI_0496_EXIT=0x33e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_CUT_PBASE_T_USBDI_0496_EXIT_DUP01=0x342
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_ENTRY=0x34a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_EXIT=0x34b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_ENTRY=0x345
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_EXIT=0x346
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x347
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_INDEX_ENTRY=0x34c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_INDEX_EXIT=0x34d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_KILLTRANSFERS_ENTRY=0x343
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_KILLTRANSFERS_EXIT=0x344
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_NEWL_ENTRY=0x33b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_NEWL_EXIT=0x33c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_ENTRY=0x348
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_EXIT=0x349
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_ENTRY=0x34e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_EXIT=0x34f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_EXIT_DUP01=0x350
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_CONSTRUCTL_ENTRY=0x355
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_CONSTRUCTL_EXIT=0x356
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_CUT_PBASE_T_USBDI_0497_ENTRY=0x353
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_CUT_PBASE_T_USBDI_0497_ENTRY_DUP01=0x357
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_CUT_PBASE_T_USBDI_0497_EXIT=0x354
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_CUT_PBASE_T_USBDI_0497_EXIT_DUP01=0x358
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_ENTRY=0x35e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_EXIT=0x35f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_ENTRY=0x359
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_EXIT=0x35a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x35b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_NEWL_ENTRY=0x351
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_NEWL_EXIT=0x352
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_ENTRY=0x35c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_EXIT=0x35d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_CONSTRUCTL_ENTRY=0x364
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_CONSTRUCTL_EXIT=0x365
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_CUT_PBASE_T_USBDI_0498_ENTRY=0x362
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_CUT_PBASE_T_USBDI_0498_ENTRY_DUP01=0x366
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_CUT_PBASE_T_USBDI_0498_EXIT=0x363
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_CUT_PBASE_T_USBDI_0498_EXIT_DUP01=0x367
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_ENTRY=0x36d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_EXIT=0x36e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_ENTRY=0x368
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_EXIT=0x369
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x36a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_NEWL_ENTRY=0x360
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_NEWL_EXIT=0x361
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_ENTRY=0x36b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_EXIT=0x36c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_CONSTRUCTL_ENTRY=0x373
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_CONSTRUCTL_EXIT=0x374
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_CUT_PBASE_T_USBDI_0499_ENTRY=0x371
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_CUT_PBASE_T_USBDI_0499_ENTRY_DUP01=0x375
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_CUT_PBASE_T_USBDI_0499_EXIT=0x372
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_CUT_PBASE_T_USBDI_0499_EXIT_DUP01=0x376
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_DEVICEINSERTEDL_ENTRY=0x37c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_DEVICEINSERTEDL_EXIT=0x37d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_DEVICEINSERTEDL_EXIT_DUP01=0x37e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_ENTRY=0x377
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_EXIT=0x378
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x379
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_NEWL_ENTRY=0x36f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_NEWL_EXIT=0x370
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_ENTRY=0x37a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_EXIT=0x37b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_CONSTRUCTL_ENTRY=0x383
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_CONSTRUCTL_EXIT=0x384
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_CUT_PBASE_T_USBDI_0500_ENTRY=0x381
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_CUT_PBASE_T_USBDI_0500_ENTRY_DUP01=0x385
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_CUT_PBASE_T_USBDI_0500_EXIT=0x382
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_CUT_PBASE_T_USBDI_0500_EXIT_DUP01=0x386
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_ENTRY=0x38c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_EXIT=0x38d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_ENTRY=0x387
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_EXIT=0x388
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x389
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_NEWL_ENTRY=0x37f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_NEWL_EXIT=0x380
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_ENTRY=0x38a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_EXIT=0x38b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_CONSTRUCTL_ENTRY=0x392
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_CONSTRUCTL_EXIT=0x393
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_CUT_PBASE_T_USBDI_1229_ENTRY=0x390
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_CUT_PBASE_T_USBDI_1229_ENTRY_DUP01=0x394
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_CUT_PBASE_T_USBDI_1229_EXIT=0x391
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_CUT_PBASE_T_USBDI_1229_EXIT_DUP01=0x395
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_DEVICEINSERTEDL_ENTRY=0x3a7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_DEVICEINSERTEDL_EXIT=0x3a8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_ENTRY=0x3a2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_EXIT=0x3a3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x3a4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_ENTRY=0x398
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_EXIT=0x399
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_HANDLEBULKTESTTIMERFIRED_ENTRY=0x3a9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_HANDLEBULKTESTTIMERFIRED_EXIT=0x3aa
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_KILLTRANSFERS_ENTRY=0x396
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_KILLTRANSFERS_EXIT=0x397
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_NEWL_ENTRY=0x38e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_NEWL_EXIT=0x38f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_PERFORMNEXTTRANSFER_ENTRY=0x39d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_PERFORMNEXTTRANSFER_EXIT=0x39e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_PERFORMNEXTTRANSFER_EXIT_DUP01=0x39f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_POSTTRANSFERACTION_ENTRY=0x39a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_POSTTRANSFERACTION_EXIT=0x39b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_POSTTRANSFERACTION_EXIT_DUP01=0x39c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_REQUESTNUMBYTESSENT_ENTRY=0x3a0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_REQUESTNUMBYTESSENT_EXIT=0x3a1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_ENTRY=0x3a5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_EXIT=0x3a6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_CONSTRUCTL_ENTRY=0x3af
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_CONSTRUCTL_EXIT=0x3b0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_CUT_PBASE_T_USBDI_1230_ENTRY=0x3ad
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_CUT_PBASE_T_USBDI_1230_ENTRY_DUP01=0x3b1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_CUT_PBASE_T_USBDI_1230_EXIT=0x3ae
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_CUT_PBASE_T_USBDI_1230_EXIT_DUP01=0x3b2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_DEVICEINSERTEDL_ENTRY=0x3c5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_DEVICEINSERTEDL_EXIT=0x3c6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_ENTRY=0x3c0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_EXIT=0x3c1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x3c2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_ENTRY=0x3b5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_EXIT=0x3b6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_HANDLEBULKTESTTIMERFIRED_ENTRY=0x3c7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_HANDLEBULKTESTTIMERFIRED_EXIT=0x3c8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_KILLTRANSFERS_ENTRY=0x3b3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_KILLTRANSFERS_EXIT=0x3b4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_NEWL_ENTRY=0x3ab
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_NEWL_EXIT=0x3ac
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_POSTTRANSFERACTION_ENTRY=0x3b7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_POSTTRANSFERACTION_EXIT=0x3b8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_POSTTRANSFERACTION_EXIT_DUP01=0x3b9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_REQUESTNUMBYTESSENT_ENTRY=0x3be
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_REQUESTNUMBYTESSENT_EXIT=0x3bf
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_ENTRY=0x3c3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_EXIT=0x3c4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_ENTRY=0x3ba
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_EXIT=0x3bb
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_EXIT_DUP01=0x3bc
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_EXIT_DUP02=0x3bd
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_BUSERRORL_ENTRY=0x3e2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_BUSERRORL_EXIT=0x3e3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_CONSTRUCTL_ENTRY=0x3cd
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_CONSTRUCTL_EXIT=0x3ce
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_CUT_PBASE_T_USBDI_1231_ENTRY=0x3cb
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_CUT_PBASE_T_USBDI_1231_ENTRY_DUP01=0x3cf
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_CUT_PBASE_T_USBDI_1231_EXIT=0x3cc
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_CUT_PBASE_T_USBDI_1231_EXIT_DUP01=0x3d0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_DEVICEDOCANCEL_ENTRY=0x3d7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_DEVICEDOCANCEL_EXIT=0x3d8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_DEVICEINSERTEDL_ENTRY=0x3d9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_DEVICEINSERTEDL_EXIT=0x3da
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_DEVICEINSERTEDL_EXIT_DUP01=0x3db
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_DEVICEREMOVEDL_ENTRY=0x3e0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_DEVICEREMOVEDL_EXIT=0x3e1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_DEVICERUNL_ENTRY=0x3ea
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_DEVICERUNL_EXIT=0x3eb
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_DEVICESTATECHANGEL_ENTRY=0x3e4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_DEVICESTATECHANGEL_EXIT=0x3e5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_EP0TRANSFERCOMPLETEL_ENTRY=0x3e6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_EP0TRANSFERCOMPLETEL_EXIT=0x3e7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_EXECUTEDEVICETESTCASEL_ENTRY=0x3d3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_EXECUTEDEVICETESTCASEL_EXIT=0x3d4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_EXECUTEHOSTTESTCASEL_ENTRY=0x3d1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_EXECUTEHOSTTESTCASEL_EXIT=0x3d2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_HOSTDOCANCEL_ENTRY=0x3d5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_HOSTDOCANCEL_EXIT=0x3d6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_HOSTRUNL_ENTRY=0x3e8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_HOSTRUNL_EXIT=0x3e9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_INTERFACE0RESUMEDL_ENTRY=0x3dc
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_INTERFACE0RESUMEDL_EXIT=0x3dd
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_INTERFACE1RESUMEDL_ENTRY=0x3de
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_INTERFACE1RESUMEDL_EXIT=0x3df
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_NEWL_ENTRY=0x3c9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_NEWL_EXIT=0x3ca
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_RESUMEWHENSUSPENDING_ENTRY=0x3ec
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_RESUMEWHENSUSPENDING_EXIT=0x3ed
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_SENDEP0REQUEST_ENTRY=0x3ee
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1231_SENDEP0REQUEST_EXIT=0x3ef
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_CONSTRUCTL_ENTRY=0x3f6
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_CONSTRUCTL_EXIT=0x3f7
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_CUT_PBASE_T_USBDI_1234_ENTRY=0x3f2
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_CUT_PBASE_T_USBDI_1234_ENTRY_DUP01=0x3f8
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_CUT_PBASE_T_USBDI_1234_EXIT=0x3f3
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_CUT_PBASE_T_USBDI_1234_EXIT_DUP01=0x3f9
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_DEVICEINSERTEDL_ENTRY=0x3fa
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_DEVICEINSERTEDL_EXIT=0x3fb
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_DEVICEINSERTEDL_EXIT_DUP01=0x3fc
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_DEVICESTATECHANGEL_ENTRY=0x403
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_DEVICESTATECHANGEL_EXIT=0x404
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_EP0TRANSFERCOMPLETEL_ENTRY=0x405
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_EP0TRANSFERCOMPLETEL_EXIT=0x406
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_EP0TRANSFERCOMPLETEL_EXIT_DUP01=0x407
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_EXECUTEHOSTTESTCASEL_ENTRY=0x3f4
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_EXECUTEHOSTTESTCASEL_EXIT=0x3f5
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_INTERFACE0RESUMEDL_ENTRY=0x3fd
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_INTERFACE0RESUMEDL_EXIT=0x3fe
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_INTERFACE1RESUMEDL_ENTRY=0x3ff
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_INTERFACE1RESUMEDL_EXIT=0x400
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_INTERFACE2RESUMEDL_ENTRY=0x401
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_INTERFACE2RESUMEDL_EXIT=0x402
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_NEWL_ENTRY=0x3f0
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_NEWL_EXIT=0x3f1
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_SENDEPREQUEST_ENTRY=0x40c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_SENDEPREQUEST_EXIT=0x40d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_SENDEPTRANSFERREQUEST_ENTRY=0x40e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_SENDEPTRANSFERREQUEST_EXIT=0x40f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_TRANSFERCOMPLETEL_ENTRY=0x408
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_TRANSFERCOMPLETEL_EXIT=0x409
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_TRYSUSPENDDEVICEBYINTERFACES_ENTRY=0x40a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1234_TRYSUSPENDDEVICEBYINTERFACES_EXIT=0x40b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_BUSERRORL_ENTRY=0x429
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_BUSERRORL_EXIT=0x42a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_CONSTRUCTL_ENTRY=0x414
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_CONSTRUCTL_EXIT=0x415
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_CUT_PBASE_T_USBDI_1235_ENTRY=0x412
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_CUT_PBASE_T_USBDI_1235_ENTRY_DUP01=0x416
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_CUT_PBASE_T_USBDI_1235_EXIT=0x413
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_CUT_PBASE_T_USBDI_1235_EXIT_DUP01=0x417
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_DEVICEDOCANCEL_ENTRY=0x41e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_DEVICEDOCANCEL_EXIT=0x41f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_DEVICEINSERTEDL_ENTRY=0x420
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_DEVICEINSERTEDL_EXIT=0x421
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_DEVICEINSERTEDL_EXIT_DUP01=0x422
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_DEVICEREMOVEDL_ENTRY=0x427
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_DEVICEREMOVEDL_EXIT=0x428
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_DEVICERUNL_ENTRY=0x431
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_DEVICERUNL_EXIT=0x432
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_DEVICESTATECHANGEL_ENTRY=0x42b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_DEVICESTATECHANGEL_EXIT=0x42c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_EP0TRANSFERCOMPLETEL_ENTRY=0x42d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_EP0TRANSFERCOMPLETEL_EXIT=0x42e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_EXECUTEDEVICETESTCASEL_ENTRY=0x41a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_EXECUTEDEVICETESTCASEL_EXIT=0x41b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_EXECUTEHOSTTESTCASEL_ENTRY=0x418
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_EXECUTEHOSTTESTCASEL_EXIT=0x419
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_HOSTDOCANCEL_ENTRY=0x41c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_HOSTDOCANCEL_EXIT=0x41d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_HOSTRUNL_ENTRY=0x42f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_HOSTRUNL_EXIT=0x430
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_INTERFACE0RESUMEDL_ENTRY=0x423
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_INTERFACE0RESUMEDL_EXIT=0x424
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_INTERFACE1RESUMEDL_ENTRY=0x425
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_INTERFACE1RESUMEDL_EXIT=0x426
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_NEWL_ENTRY=0x410
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_NEWL_EXIT=0x411
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_SENDEP0REQUEST_ENTRY=0x435
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_SENDEP0REQUEST_EXIT=0x436
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_SUSPENDDEVICEBYINTERFACESANDCANCELWAITFORRESUME_ENTRY=0x433
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1235_SUSPENDDEVICEBYINTERFACESANDCANCELWAITFORRESUME_EXIT=0x434
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_BUSERRORL_ENTRY=0x448
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_BUSERRORL_EXIT=0x449
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_CONSTRUCTL_ENTRY=0x43b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_CONSTRUCTL_EXIT=0x43c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_CUT_PBASE_T_USBDI_1236_ENTRY=0x439
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_CUT_PBASE_T_USBDI_1236_ENTRY_DUP01=0x43d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_CUT_PBASE_T_USBDI_1236_EXIT=0x43a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_CUT_PBASE_T_USBDI_1236_EXIT_DUP01=0x43e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_DEVICEDOCANCEL_ENTRY=0x454
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_DEVICEDOCANCEL_EXIT=0x455
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_ENTRY=0x443
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_EXIT=0x444
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_EXIT_DUP01=0x445
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_DEVICEREMOVEDL_ENTRY=0x446
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_DEVICEREMOVEDL_EXIT=0x447
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_DEVICERUNL_ENTRY=0x450
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_DEVICERUNL_EXIT=0x451
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_DEVICESTATECHANGEL_ENTRY=0x44a
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_DEVICESTATECHANGEL_EXIT=0x44b
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_EP0TRANSFERCOMPLETEL_ENTRY=0x44c
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_EP0TRANSFERCOMPLETEL_EXIT=0x44d
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_EXECUTEDEVICETESTCASEL_ENTRY=0x441
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_EXECUTEDEVICETESTCASEL_EXIT=0x442
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_EXECUTEHOSTTESTCASEL_ENTRY=0x43f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_EXECUTEHOSTTESTCASEL_EXIT=0x440
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_HOSTDOCANCEL_ENTRY=0x452
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_HOSTDOCANCEL_EXIT=0x453
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_HOSTRUNL_ENTRY=0x44e
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_HOSTRUNL_EXIT=0x44f
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_NEWL_ENTRY=0x437
-[TRACE]TRACE_FLOW[0x8A]_CUT_PBASE_T_USBDI_1236_NEWL_EXIT=0x438
-[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_CREATETESTCASEL_ENTRY=0x542
-[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_INSTANCE_ENTRY=0x53a
-[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_INSTANCE_EXIT=0x53b
-[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_LISTREGISTEREDTESTCASES_ENTRY=0x543
-[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_LISTREGISTEREDTESTCASES_EXIT=0x544
-[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_REGISTERTESTCASE_ENTRY=0x540
-[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_REGISTERTESTCASE_EXIT=0x541
-[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_RTESTFACTORY_ENTRY=0x53c
-[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_RTESTFACTORY_ENTRY_DUP01=0x53e
-[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_RTESTFACTORY_EXIT=0x53d
-[TRACE]TRACE_FLOW[0x8A]_RTESTFACTORY_RTESTFACTORY_EXIT_DUP01=0x53f
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEA_ONSTATECHANGEL_ENTRY=0x54d
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEA_ONSTATECHANGEL_EXIT=0x54e
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEA_OPENL_ENTRY=0x54b
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEA_OPENL_EXIT=0x54c
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEA_RUSBDEVICEA_ENTRY=0x545
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEA_RUSBDEVICEA_ENTRY_DUP01=0x547
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEA_RUSBDEVICEA_ENTRY_DUP02=0x549
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEA_RUSBDEVICEA_EXIT=0x546
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEA_RUSBDEVICEA_EXIT_DUP01=0x548
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEA_RUSBDEVICEA_EXIT_DUP02=0x54a
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEB_ONSTATECHANGEL_ENTRY=0x557
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEB_ONSTATECHANGEL_EXIT=0x558
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEB_OPENL_ENTRY=0x555
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEB_OPENL_EXIT=0x556
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEB_RUSBDEVICEB_ENTRY=0x54f
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEB_RUSBDEVICEB_ENTRY_DUP01=0x551
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEB_RUSBDEVICEB_ENTRY_DUP02=0x553
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEB_RUSBDEVICEB_EXIT=0x550
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEB_RUSBDEVICEB_EXIT_DUP01=0x552
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEB_RUSBDEVICEB_EXIT_DUP02=0x554
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEC_ONSTATECHANGEL_ENTRY=0x561
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEC_ONSTATECHANGEL_EXIT=0x562
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEC_OPENL_ENTRY=0x55f
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEC_OPENL_EXIT=0x560
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEC_RUSBDEVICEC_ENTRY=0x559
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEC_RUSBDEVICEC_ENTRY_DUP01=0x55b
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEC_RUSBDEVICEC_ENTRY_DUP02=0x55d
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEC_RUSBDEVICEC_EXIT=0x55a
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEC_RUSBDEVICEC_EXIT_DUP01=0x55c
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEC_RUSBDEVICEC_EXIT_DUP02=0x55e
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICED_ONSTATECHANGEL_ENTRY=0x56b
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICED_ONSTATECHANGEL_EXIT=0x56c
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICED_OPENL_ENTRY=0x569
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICED_OPENL_EXIT=0x56a
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICED_RUSBDEVICED_ENTRY=0x563
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICED_RUSBDEVICED_ENTRY_DUP01=0x565
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICED_RUSBDEVICED_ENTRY_DUP02=0x567
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICED_RUSBDEVICED_EXIT=0x564
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICED_RUSBDEVICED_EXIT_DUP01=0x566
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICED_RUSBDEVICED_EXIT_DUP02=0x568
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEVENDOR_ONSTATECHANGEL_ENTRY=0x652
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEVENDOR_ONSTATECHANGEL_EXIT=0x653
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEVENDOR_OPENL_ENTRY=0x650
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEVENDOR_OPENL_EXIT=0x651
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_ENTRY=0x64a
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_ENTRY_DUP01=0x64c
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_ENTRY_DUP02=0x64e
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_EXIT=0x64b
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_EXIT_DUP01=0x64d
-[TRACE]TRACE_FLOW[0x8A]_RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_EXIT_DUP02=0x64f
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_ACKNOWLEDGEREQUESTRECEIVED_ENTRY=0x59f
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_ACKNOWLEDGEREQUESTRECEIVED_EXIT=0x5a0
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_ADDINTERFACE_ENTRY=0x58b
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_ADDINTERFACE_EXIT=0x58c
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_CANCELSUBSCRIPTIONTOREPORTS_ENTRY=0x579
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_CANCELSUBSCRIPTIONTOREPORTS_EXIT=0x57a
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_CLOSE_ENTRY=0x575
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_CLOSE_EXIT=0x576
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_INTERFACE_ENTRY=0x58d
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_INTERFACE_EXIT=0x58e
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_OPENL_ENTRY=0x57b
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_OPENL_EXIT=0x57c
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_PROCESSREQUESTL_ENTRY=0x595
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_PROCESSREQUESTL_EXIT=0x596
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_PROCESSREQUESTL_EXIT_DUP01=0x597
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_PROCESSREQUESTL_EXIT_DUP02=0x598
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_REMOTEWAKEUP_ENTRY=0x593
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_REMOTEWAKEUP_EXIT=0x594
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_REPORTERROR_ENTRY=0x5a1
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_REPORTERROR_EXIT=0x5a2
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_RESETSTATE_ENTRY=0x571
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_RESETSTATE_EXIT=0x572
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_RUSBTESTDEVICE_ENTRY=0x56d
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_RUSBTESTDEVICE_ENTRY_DUP01=0x56f
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_RUSBTESTDEVICE_ENTRY_DUP02=0x573
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_RUSBTESTDEVICE_EXIT=0x56e
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_RUSBTESTDEVICE_EXIT_DUP01=0x570
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_RUSBTESTDEVICE_EXIT_DUP02=0x574
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETCLASSCODE_ENTRY=0x57d
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETCLASSCODE_EXIT=0x57e
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETCONFIGURATIONSTRING_ENTRY=0x589
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETCONFIGURATIONSTRING_EXIT=0x58a
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETPRODUCT_ENTRY=0x583
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETPRODUCT_EXIT=0x584
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETPRODUCT_EXIT_DUP01=0x585
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETPRODUCT_EXIT_DUP02=0x586
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETPRODUCT_EXIT_DUP03=0x587
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETPRODUCT_EXIT_DUP04=0x588
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETUSBSPECIFICATION_ENTRY=0x57f
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETUSBSPECIFICATION_EXIT=0x580
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETVENDOR_ENTRY=0x581
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SETVENDOR_EXIT=0x582
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SOFTWARECONNECT_ENTRY=0x58f
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SOFTWARECONNECT_EXIT=0x590
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SOFTWAREDISCONNECT_ENTRY=0x591
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SOFTWAREDISCONNECT_EXIT=0x592
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_STARTEP0READING_ENTRY=0x59b
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_STARTEP0READING_EXIT=0x59c
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_STATECHANGEL_ENTRY=0x599
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_STATECHANGEL_EXIT=0x59a
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_STOPEP0READING_ENTRY=0x59d
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_STOPEP0READING_EXIT=0x59e
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SUBSCRIBETOREPORTS_ENTRY=0x577
-[TRACE]TRACE_FLOW[0x8A]_RUSBTESTDEVICE_SUBSCRIBETOREPORTS_EXIT=0x578
-[TRACE]TRACE_FLOW[0x8A]__E32MAIN_ENTRY=0x51b
-[TRACE]TRACE_FLOW[0x8A]__E32MAIN_EXIT=0x51c
-[TRACE]TRACE_FLOW[0x8A]__E32MAIN_EXIT_DUP01=0x51d
-[TRACE]TRACE_FLOW[0x8A]__KILLTEST_ENTRY=0x4c6
-[TRACE]TRACE_FLOW[0x8A]__KILLTEST_EXIT=0x4c7
-[TRACE]TRACE_FLOW[0x8A]__MAINL_ENTRY=0x519
-[TRACE]TRACE_FLOW[0x8A]__MAINL_EXIT=0x51a
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_CONSTRUCTL=0x34e
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_CONSTRUCTL_DUP01=0x34f
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_CONSTRUCTL_DUP02=0x350
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_CONSTRUCTL_DUP03=0x351
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_CONSTRUCTL_DUP04=0x352
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_CONSTRUCTL_DUP05=0x353
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_DCACTORFDF=0x356
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_DCACTORFDF_DUP01=0x357
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_DCACTORFDF_DUP02=0x358
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_DCACTORFDF_DUP03=0x359
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_DOCANCEL=0x35a
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_DOCANCEL_DUP01=0x35b
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_MONITOR=0x35c
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNERROR=0x362
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL=0x35d
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL_DUP01=0x35e
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL_DUP02=0x35f
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL_DUP03=0x360
-[TRACE]TRACE_NORMAL[0x86]_CACTORFDF_RUNL_DUP04=0x361
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL=0x1
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP01=0x3
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP02=0x4
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP03=0x5
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP04=0x6
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP05=0x7
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP06=0x8
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP07=0x9
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_BASEBULKDEVICEINSERTEDL_DUP08=0x2
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_CHECKTIMES=0x32
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_CHECKTIMES_DUP01=0x33
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_CHECKTIMES_DUP02=0x34
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_CHECKTIMES_DUP03=0x35
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_CHECKTIMES_DUP04=0x36
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_HOSTRUNL=0x16
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_HOSTRUNL_DUP01=0x17
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_RECORDTIME=0x30
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_RECORDTIME_DUP01=0x31
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL=0xa
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP01=0xb
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP02=0xc
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP03=0xd
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP04=0xe
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP05=0xf
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP06=0x10
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP07=0x11
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP08=0x12
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP09=0x13
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP10=0x14
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_SETUPINTERFACEANDPIPESL_DUP11=0x15
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA=0x18
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP01=0x19
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP02=0x1a
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP03=0x1b
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP04=0x1d
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP05=0x1e
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP06=0x20
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP07=0x21
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP08=0x22
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP09=0x23
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP10=0x25
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP11=0x26
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP12=0x28
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP13=0x29
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP14=0x2a
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP15=0x2c
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP16=0x2d
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP17=0x2f
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP50=0x1c
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP51=0x1f
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP52=0x24
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP53=0x27
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP54=0x2b
-[TRACE]TRACE_NORMAL[0x86]_CBASEBULKTESTCASE_VALIDATEDATA_DUP55=0x2e
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_BASECONSTRUCTL=0x37
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_BASECONSTRUCTL_DUP01=0x38
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_BASECONSTRUCTL_DUP02=0x39
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_CHECKTREE=0x59
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_CHECKTREE_DUP01=0x5a
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_COMPARECURRENTTREETOREF=0x3c
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_COMPARECURRENTTREETOREF_DUP01=0x3d
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_COMPARECURRENTTREETOREF_DUP02=0x3e
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_COMPARECURRENTTREETOREF_DUP03=0x3f
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_COMPARECURRENTTREETOREF_DUP04=0x40
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_COMPARECURRENTTREETOREF_DUP05=0x41
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_COMPARECURRENTTREETOREF_DUP06=0x42
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_COMPARECURRENTTREETOREF_DUP07=0x43
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_COMPARECURRENTTREETOREF_DUP08=0x44
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_COMPARECURRENTTREETOREF_DUP09=0x45
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_COMPARECURRENTTREETOREF_DUP10=0x46
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GENERATEREFFILE=0x3a
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GENERATEREFFILE_DUP01=0x3b
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS=0x4a
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP01=0x4b
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP02=0x4c
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP03=0x4d
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP04=0x4e
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP05=0x4f
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP06=0x50
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP07=0x51
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP08=0x52
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP09=0x53
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP10=0x54
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP11=0x55
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_GETENDPOINTADDRESS_DUP12=0x56
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_PARSECONFIGDESCRIPTORANDCHECKTREE=0x5b
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_PARSECONFIGDESCRIPTORANDCHECKTREE_DUP01=0x5c
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_PRINTANDSTORECHUNK=0x57
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_PRINTANDSTORECHUNK_DUP01=0x58
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_RUNERROR=0x47
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_TESTFAILED=0x48
-[TRACE]TRACE_NORMAL[0x86]_CBASETESTCASE_TESTPASSED=0x49
-[TRACE]TRACE_NORMAL[0x86]_CBASICWATCHER_DOCANCEL=0x2f3
-[TRACE]TRACE_NORMAL[0x86]_CBASICWATCHER_RUNERROR=0x2f4
-[TRACE]TRACE_NORMAL[0x86]_CBULKTRANSFER_CBULKTRANSFER=0x371
-[TRACE]TRACE_NORMAL[0x86]_CBULKTRANSFER_TRANSFERIN=0x372
-[TRACE]TRACE_NORMAL[0x86]_CBULKTRANSFER_TRANSFEROUT=0x373
-[TRACE]TRACE_NORMAL[0x86]_CBULKTRANSFER_TRANSFEROUT_DUP01=0x374
-[TRACE]TRACE_NORMAL[0x86]_CBULKTRANSFER_TRANSFEROUT_DUP02=0x375
-[TRACE]TRACE_NORMAL[0x86]_CBULKTRANSFER_TRANSFEROUT_DUP03=0x376
-[TRACE]TRACE_NORMAL[0x86]_CBULKTRANSFER_TRANSFEROUT_DUP10=0x377
-[TRACE]TRACE_NORMAL[0x86]_CBULKTRANSFER_TRANSFEROUT_DUP11=0x378
-[TRACE]TRACE_NORMAL[0x86]_CBULKTRANSFER_TRANSFEROUT_DUP12=0x379
-[TRACE]TRACE_NORMAL[0x86]_CBULKTRANSFER_TRANSFEROUT_DUP13=0x37a
-[TRACE]TRACE_NORMAL[0x86]_CBULKTRANSFER_TRANSFEROUT_DUP14=0x37b
-[TRACE]TRACE_NORMAL[0x86]_CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL=0x2f6
-[TRACE]TRACE_NORMAL[0x86]_CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP01=0x2f7
-[TRACE]TRACE_NORMAL[0x86]_CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP02=0x2f8
-[TRACE]TRACE_NORMAL[0x86]_CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP03=0x2f9
-[TRACE]TRACE_NORMAL[0x86]_CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP04=0x2fa
-[TRACE]TRACE_NORMAL[0x86]_CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP05=0x2fb
-[TRACE]TRACE_NORMAL[0x86]_CCONTROLENDPOINTREADER_DATARECEIVEDFROMENDPOINTL_DUP06=0x2fc
-[TRACE]TRACE_NORMAL[0x86]_CCONTROLENDPOINTREADER_ENDPOINTREADERROR=0x2f5
-[TRACE]TRACE_NORMAL[0x86]_CDEVICEENDPOINT0_CONSTRUCTL=0x5d
-[TRACE]TRACE_NORMAL[0x86]_CDEVICEENDPOINT0_START=0x5e
-[TRACE]TRACE_NORMAL[0x86]_CDEVICEENDPOINT0_STOP=0x5f
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_ACKNOWLEDGE=0x324
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_READL=0x321
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_READPACKETL=0x320
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_READUNTILSHORTL=0x322
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_REPEATEDREADANDVALIDATEL=0x323
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNERROR=0x334
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL=0x325
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP01=0x326
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP02=0x327
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP03=0x328
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP04=0x329
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP05=0x32a
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP06=0x32b
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP07=0x32c
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP08=0x32d
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP09=0x32e
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP10=0x32f
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP11=0x331
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP12=0x333
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP50=0x330
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTREADER_RUNL_DUP51=0x332
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_CREATEBIGBUFFER=0x34d
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_DCENDPOINTWRITER=0x335
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_RUNL=0x336
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_RUNL_DUP01=0x337
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_RUNL_DUP02=0x338
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_RUNL_DUP03=0x339
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_RUNL_DUP04=0x33b
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_RUNL_DUP05=0x33c
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_RUNL_DUP06=0x33d
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_RUNL_DUP07=0x33e
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_RUNL_DUP53=0x33a
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITE=0x33f
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITEINPARTSUSINGPATTERNL=0x34b
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITEINPARTSUSINGPATTERNL_DUP01=0x34c
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITESYNCHRONOUS=0x344
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITESYNCHRONOUS_DUP01=0x346
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITESYNCHRONOUS_DUP02=0x347
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITESYNCHRONOUS_DUP03=0x348
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITESYNCHRONOUS_DUP50=0x345
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITEUSINGPATTERNL=0x349
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITEUSINGPATTERNL_DUP01=0x34a
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITE_DUP01=0x340
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITE_DUP02=0x342
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITE_DUP03=0x343
-[TRACE]TRACE_NORMAL[0x86]_CENDPOINTWRITER_WRITE_DUP51=0x341
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_RUNL=0x31f
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST=0x2fd
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP01=0x2fe
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP02=0x2ff
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP03=0x300
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP04=0x301
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP06=0x313
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP10=0x302
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP11=0x303
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP12=0x304
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP13=0x305
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP14=0x306
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP15=0x307
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP20=0x308
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP21=0x309
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP22=0x30a
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP23=0x30b
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP24=0x30c
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP30=0x30d
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP31=0x30e
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP32=0x30f
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP33=0x310
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP34=0x311
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP35=0x312
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP40=0x314
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP41=0x315
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP42=0x316
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP43=0x317
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP44=0x318
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP45=0x319
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP50=0x31a
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP51=0x31b
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP52=0x31c
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP53=0x31d
-[TRACE]TRACE_NORMAL[0x86]_CEP0TRANSFER_SENDREQUEST_DUP54=0x31e
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL=0x407
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP01=0x408
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP02=0x409
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP03=0x40a
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP04=0x40b
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP05=0x40c
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP06=0x40d
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP07=0x40e
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP08=0x40f
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP09=0x410
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP10=0x411
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP11=0x412
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP12=0x413
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP13=0x414
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ADDINTERFACESETTINGL_DUP14=0x415
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_ALTERNATEINTERFACESELECTEDL=0x41d
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_BASECONSTRUCTL=0x406
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_EXTRACTNUMBERL=0x417
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_EXTRACTNUMBERL_DUP01=0x419
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_EXTRACTNUMBERL_DUP50=0x418
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_EXTRACTTWONUMBERSL=0x41a
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_EXTRACTTWONUMBERSL_DUP01=0x41c
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_EXTRACTTWONUMBERSL_DUP50=0x41b
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL=0x41e
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP01=0x41f
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP02=0x420
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP03=0x421
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP04=0x422
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP05=0x423
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP06=0x425
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP07=0x426
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP08=0x427
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP09=0x428
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP10=0x429
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP11=0x42a
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP12=0x42b
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP13=0x42c
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP14=0x42d
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP15=0x42e
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP16=0x42f
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP17=0x430
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP18=0x431
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP19=0x432
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP20=0x433
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP21=0x434
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP22=0x435
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP23=0x436
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP24=0x437
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP25=0x439
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP26=0x43a
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP27=0x43b
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP54=0x438
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_PROCESSREQUESTL_DUP55=0x424
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACEBASE_STALLENDPOINT=0x416
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL=0x43c
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP01=0x43d
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP02=0x43e
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP03=0x440
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP04=0x441
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP05=0x443
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP06=0x444
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP07=0x445
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP08=0x446
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP09=0x448
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP10=0x449
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP11=0x44b
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP12=0x44c
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP13=0x44d
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP14=0x44f
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP15=0x450
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP16=0x452
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP52=0x43f
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP53=0x44e
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP54=0x442
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP55=0x451
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP58=0x447
-[TRACE]TRACE_NORMAL[0x86]_CINTERFACESETTINGBASE_VALIDATECACHEDENDPOINTDATAL_DUP60=0x44a
-[TRACE]TRACE_NORMAL[0x86]_CINTERRUPTTRANSFER_REGISTERTRANSFERDESCRIPTOR=0x37d
-[TRACE]TRACE_NORMAL[0x86]_CINTERRUPTTRANSFER_TRANSFERINL=0x37c
-[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_CISOCHTRANSFER=0x37e
-[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_DATAPOLLED=0x37f
-[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_DATAPOLLED_DUP01=0x380
-[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_DATAPOLLED_DUP02=0x381
-[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_DATAPOLLED_DUP03=0x382
-[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_PREPARETRANSFER=0x386
-[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_PREPARETRANSFER_DUP01=0x387
-[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_PREPARETRANSFER_DUP02=0x388
-[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_REGISTERTRANSFERDESCRIPTOR=0x385
-[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_TRANSFERINL=0x383
-[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_TRANSFERINL_DUP01=0x384
-[TRACE]TRACE_NORMAL[0x86]_CISOCHTRANSFER_TRANSFEROUT=0x389
-[TRACE]TRACE_NORMAL[0x86]_CREMOTEWAKEUPTIMER_RUNL=0x46f
-[TRACE]TRACE_NORMAL[0x86]_CSOFTWARECONNECTTIMER_RUNL=0x38d
-[TRACE]TRACE_NORMAL[0x86]_CSOFTWARECONNECTTIMER_RUNL_DUP01=0x38e
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_CONSTRUCTL=0x393
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_CONSTRUCTL_DUP01=0x394
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_CONSTRUCTL_DUP02=0x395
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_CONSTRUCTL_DUP03=0x396
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_CONSTRUCTL_DUP04=0x397
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_CONSTRUCTL_DUP05=0x398
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_DCTESTCASECONTROLLER=0x38f
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_DCTESTCASECONTROLLER_DUP01=0x390
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_DCTESTCASECONTROLLER_DUP02=0x391
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_DCTESTCASECONTROLLER_DUP03=0x392
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL=0x399
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP01=0x39a
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP02=0x39b
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP03=0x39c
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP04=0x39d
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP05=0x39e
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP06=0x39f
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP07=0x3a0
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP08=0x3a1
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP09=0x3a2
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP10=0x3a3
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP11=0x3a4
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP12=0x3a5
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP13=0x3a6
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP14=0x3a7
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP15=0x3a8
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP16=0x3a9
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP17=0x3aa
-[TRACE]TRACE_NORMAL[0x86]_CTESTCASECONTROLLER_RUNL_DUP18=0x3ab
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL=0x3f4
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP01=0x3f5
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP02=0x3f6
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP03=0x3f7
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP04=0x3f8
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP05=0x3f9
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP06=0x3fa
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP07=0x3fb
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP08=0x3fc
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP09=0x3fd
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP10=0x3fe
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP11=0x3ff
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP12=0x400
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_CONSTRUCTL_DUP13=0x401
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_RUNL=0x402
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_RUNL_DUP01=0x403
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_RUNL_DUP02=0x404
-[TRACE]TRACE_NORMAL[0x86]_CTESTENGINE_RUNL_DUP03=0x405
-[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_DOCANCEL=0x458
-[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_DOCANCEL_DUP01=0x459
-[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_DOCANCEL_DUP02=0x45a
-[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_DOCANCEL_DUP03=0x45b
-[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_DOCANCEL_DUP04=0x45c
-[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_DOTESTL=0x45e
-[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_RUNERROR=0x463
-[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_RUNL=0x45f
-[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_RUNL_DUP01=0x460
-[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_RUNL_DUP02=0x461
-[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_RUNL_DUP03=0x462
-[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_RUNTESTCASEL=0x453
-[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_RUNTESTCASEL_DUP01=0x454
-[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_RUNTESTCASEL_DUP02=0x455
-[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_SIGNALTESTCOMPLETE=0x456
-[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_SIGNALTESTCOMPLETE_DUP01=0x457
-[TRACE]TRACE_NORMAL[0x86]_CTHREADTESTPOLICY_THREADFUNCTION=0x45d
-[TRACE]TRACE_NORMAL[0x86]_CUSBCLIENTSTATEWATCHER_CONSTRUCTL=0x464
-[TRACE]TRACE_NORMAL[0x86]_CUSBCLIENTSTATEWATCHER_RUNL=0x465
-[TRACE]TRACE_NORMAL[0x86]_CUSBCLIENTSTATEWATCHER_RUNL_DUP01=0x466
-[TRACE]TRACE_NORMAL[0x86]_CUSBCLIENTSTATEWATCHER_RUNL_DUP02=0x467
-[TRACE]TRACE_NORMAL[0x86]_CUSBCLIENTSTATEWATCHER_RUNL_DUP03=0x468
-[TRACE]TRACE_NORMAL[0x86]_CUSBCLIENTSTATEWATCHER_RUNL_DUP04=0x469
-[TRACE]TRACE_NORMAL[0x86]_CUSBCLIENTSTATEWATCHER_RUNL_DUP05=0x46a
-[TRACE]TRACE_NORMAL[0x86]_CUSBCLIENTSTATEWATCHER_RUNL_DUP06=0x46b
-[TRACE]TRACE_NORMAL[0x86]_CUSBCLIENTSTATEWATCHER_RUNL_DUP07=0x46c
-[TRACE]TRACE_NORMAL[0x86]_CUSBCLIENTSTATEWATCHER_RUNL_DUP08=0x46d
-[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL=0x363
-[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP01=0x364
-[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP02=0x365
-[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP03=0x366
-[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP04=0x367
-[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP05=0x368
-[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP06=0x369
-[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP07=0x36a
-[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP08=0x36b
-[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP09=0x36c
-[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP10=0x36d
-[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_CONSTRUCTL_DUP11=0x36e
-[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_RUNERROR=0x370
-[TRACE]TRACE_NORMAL[0x86]_CUSBTESTDEVICE_RUNL=0x36f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL=0x60
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP01=0x61
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP02=0x62
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP03=0x63
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP04=0x64
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP05=0x65
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP06=0x66
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP07=0x67
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP08=0x68
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP09=0x69
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP10=0x6a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP11=0x6b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP12=0x6c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP13=0x6d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP14=0x6e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP15=0x6f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEINSERTEDL_DUP16=0x70
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_DEVICEREMOVEDL=0x72
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_EP0TRANSFERCOMPLETEL=0x71
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_HOSTRUNL=0x73
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_HOSTRUNL_DUP01=0x74
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0472_HOSTRUNL_DUP02=0x75
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_CHECKFORALLRESUMEDNOTIFICATIONSANDCONTINUEFSM=0x8b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_CHECKFORALLRESUMEDNOTIFICATIONSANDCONTINUEFSM_DUP01=0x8c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS=0x8d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP01=0x8e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP02=0x8f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP03=0x90
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP04=0x91
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP05=0x92
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP06=0x93
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_CONTINUEFSMAFTERALLRESUMEDNOTIFICATIONS_DUP07=0x94
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL=0x76
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP01=0x77
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP02=0x78
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP03=0x79
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP04=0x7a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP05=0x7b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP06=0x7c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP07=0x7d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP08=0x7e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP09=0x7f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP10=0x80
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP11=0x81
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP12=0x82
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP13=0x83
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP14=0x84
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP15=0x85
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICEINSERTEDL_DUP16=0x86
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL=0x95
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP01=0x96
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP02=0x97
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP03=0x98
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP04=0x99
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP05=0x9a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP06=0x9b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP07=0x9c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP08=0x9d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP09=0x9e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP10=0x9f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP11=0xa0
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_DEVICESTATECHANGEL_DUP12=0xa1
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL=0xa2
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL_DUP01=0xa3
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL_DUP02=0xa4
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_EP0TRANSFERCOMPLETEL_DUP03=0xa5
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_HOSTRUNL=0xa6
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_HOSTRUNL_DUP01=0xa7
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_INTERFACE0RESUMEDL=0x87
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_INTERFACE0RESUMEDL_DUP01=0x88
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_INTERFACE1RESUMEDL=0x89
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0473_INTERFACE1RESUMEDL_DUP01=0x8a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL=0xa8
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_DUP01=0xa9
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_DUP02=0xaa
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0474_EP0TRANSFERCOMPLETEL=0xab
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0474_HOSTRUNL=0xac
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0474_HOSTRUNL_DUP01=0xad
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_CHECKFIRSTINTERFACEDESCRIPTORDEVICEA=0xae
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL=0xaf
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP01=0xb0
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP02=0xb1
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP03=0xb2
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP04=0xb3
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP05=0xb4
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP06=0xb5
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP07=0xb6
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP08=0xb7
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP09=0xb8
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP10=0xb9
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP11=0xba
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP12=0xbb
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP13=0xbc
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP14=0xbd
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP15=0xbe
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP16=0xbf
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP17=0xc0
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP18=0xc1
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP19=0xc2
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP20=0xc3
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_EP0TRANSFERCOMPLETEL=0xc4
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_HOSTRUNL=0xc5
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0477_HOSTRUNL_DUP01=0xc6
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL=0xc7
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP01=0xc8
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP02=0xc9
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP03=0xca
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP04=0xcb
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP05=0xcc
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0478_DEVICEINSERTEDL_DUP06=0xcd
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0478_EP0TRANSFERCOMPLETEL=0xce
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0478_EP0TRANSFERCOMPLETEL_DUP01=0xcf
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0478_HOSTRUNL=0xd0
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0478_HOSTRUNL_DUP01=0xd1
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL=0xd2
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_DUP01=0xd3
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_DUP02=0xd4
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_DUP03=0xd5
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_DUP04=0xd6
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0479_EP0TRANSFERCOMPLETEL=0xd7
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0479_EP0TRANSFERCOMPLETEL_DUP01=0xd8
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0479_HOSTRUNL=0xd9
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0479_HOSTRUNL_DUP01=0xda
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL=0xdb
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP01=0xdc
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP02=0xdd
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP03=0xde
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP04=0xdf
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP05=0xe0
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_DEVICEINSERTEDL_DUP06=0xe1
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL=0xe2
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_DUP01=0xe3
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_EP0TRANSFERCOMPLETEL_DUP02=0xe4
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_HOSTRUNL=0xe5
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0480_HOSTRUNL_DUP01=0xe6
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL=0xe7
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP01=0xe8
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP02=0xe9
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP03=0xea
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP04=0xeb
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP05=0xec
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP06=0xed
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_DEVICEINSERTEDL_DUP07=0xee
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_EP0TRANSFERCOMPLETEL=0xef
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_EP0TRANSFERCOMPLETEL_DUP01=0xf0
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_HOSTRUNL=0xf1
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0481_HOSTRUNL_DUP01=0xf2
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL=0xf9
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP01=0xfa
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP02=0xfb
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP03=0xfc
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP04=0xfd
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP05=0xfe
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP06=0xff
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP07=0x100
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP08=0x101
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP09=0x102
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP10=0x103
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP11=0x104
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP12=0x105
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_DEVICEINSERTEDL_DUP13=0x106
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL=0x10f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL_DUP01=0x110
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_EP0TRANSFERCOMPLETEL_DUP02=0x111
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT=0xf6
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_DUP01=0xf7
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_FINDINISOCHRONOUSENDPOINT_DUP02=0xf8
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT=0xf3
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_DUP01=0xf4
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_FINDOUTISOCHRONOUSENDPOINT_DUP02=0xf5
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_HOSTRUNL=0x112
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_HOSTRUNL_DUP01=0x113
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA=0x107
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA_DUP01=0x108
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA_DUP02=0x109
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_REPLAYRECORDEDDATA_DUP03=0x10a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL=0x10b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_DUP01=0x10c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_DUP02=0x10d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0482_TRANSFERCOMPLETEL_DUP03=0x10e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL=0x117
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_DUP01=0x118
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_DUP02=0x119
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_DUP03=0x11a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0483_DEVICEINSERTEDL_DUP04=0x11b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL=0x114
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL_DUP01=0x115
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0483_EP0TRANSFERCOMPLETEL_DUP02=0x116
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0483_HOSTRUNL=0x11c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0483_HOSTRUNL_DUP01=0x11d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL=0x12d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL_DUP01=0x12e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_DEVICEINSERTEDL_DUP02=0x12f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_EP0TRANSFERCOMPLETEL=0x11e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_EP0TRANSFERCOMPLETEL_DUP01=0x11f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL=0x120
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP01=0x121
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP02=0x122
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP03=0x123
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP04=0x124
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP05=0x125
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP06=0x126
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP07=0x127
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP08=0x128
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP09=0x129
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP10=0x12a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP11=0x12b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0484_TRANSFERCOMPLETEL_DUP12=0x12c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL=0x130
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_DUP01=0x131
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_DUP02=0x132
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0485_DEVICEINSERTEDL_DUP03=0x133
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL=0x134
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_DUP01=0x135
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_DUP02=0x136
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_DUP03=0x137
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0485_EP0TRANSFERCOMPLETEL_DUP04=0x138
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0485_HOSTRUNL=0x139
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0485_HOSTRUNL_DUP01=0x13a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_CHECKSN=0x13b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL=0x142
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP01=0x143
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP02=0x144
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP03=0x145
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP04=0x146
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP05=0x147
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP06=0x148
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP07=0x149
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP08=0x14a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP09=0x14b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP10=0x14c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP11=0x14d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP12=0x14e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP13=0x14f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEREMOVEDL=0x150
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_DEVICEREMOVEDL_DUP01=0x151
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_EP0TRANSFERCOMPLETEL=0x13c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_EP0TRANSFERCOMPLETEL_DUP01=0x13d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_EP0TRANSFERCOMPLETEL_DUP02=0x13e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_TRANSFERCOMPLETEL=0x13f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_TRANSFERCOMPLETEL_DUP01=0x140
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0486_TRANSFERCOMPLETEL_DUP02=0x141
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL=0x152
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP01=0x153
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP02=0x154
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP03=0x155
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP04=0x156
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP05=0x157
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP06=0x158
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP07=0x159
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP08=0x15a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP09=0x15b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP10=0x15c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP11=0x15d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP12=0x15e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_DEVICEINSERTEDL_DUP13=0x15f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_EP0TRANSFERCOMPLETEL=0x160
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_HOSTRUNL=0x16b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_HOSTRUNL_DUP01=0x16c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL=0x161
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP01=0x162
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP02=0x163
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP03=0x164
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP04=0x165
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP05=0x166
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP06=0x167
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP07=0x168
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP08=0x169
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0487_TRANSFERCOMPLETEL_DUP09=0x16a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL=0x16d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP01=0x16e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP02=0x16f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP03=0x170
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP04=0x171
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP05=0x172
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP06=0x173
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_DEVICEINSERTEDL_DUP07=0x174
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_EP0TRANSFERCOMPLETEL=0x175
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_EP0TRANSFERCOMPLETEL_DUP01=0x176
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_HOSTRUNL=0x177
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0488_HOSTRUNL_DUP01=0x178
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL=0x179
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_DUP01=0x17a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_DUP02=0x17b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0489_DEVICEINSERTEDL_DUP03=0x17c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL=0x17d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0489_EP0TRANSFERCOMPLETEL_DUP01=0x17e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0489_HOSTRUNL=0x17f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0489_HOSTRUNL_DUP01=0x180
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_DEVICEINSERTEDL=0x18b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_DEVICEINSERTEDL_DUP01=0x18c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL=0x181
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_DUP01=0x182
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_DUP02=0x183
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_DUP03=0x184
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_DUP04=0x185
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_EP0TRANSFERCOMPLETEL_DUP05=0x186
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL=0x187
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL_DUP01=0x188
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL_DUP02=0x189
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0490_TRANSFERCOMPLETEL_DUP03=0x18a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL=0x197
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL_DUP01=0x198
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_DEVICEINSERTEDL_DUP02=0x199
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL=0x18d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_DUP01=0x18e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_DUP02=0x18f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_DUP03=0x190
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_DUP04=0x191
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_EP0TRANSFERCOMPLETEL_DUP05=0x192
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL=0x193
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL_DUP01=0x194
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL_DUP02=0x195
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0491_TRANSFERCOMPLETEL_DUP03=0x196
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_DEVICEINSERTEDL=0x1a5
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_DEVICEINSERTEDL_DUP01=0x1a6
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL=0x19a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_DUP01=0x19b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_DUP02=0x19c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_DUP03=0x19d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_DUP04=0x19e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_EP0TRANSFERCOMPLETEL_DUP05=0x19f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL=0x1a0
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_DUP01=0x1a1
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_DUP02=0x1a2
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_DUP03=0x1a3
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0492_TRANSFERCOMPLETEL_DUP04=0x1a4
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL=0x1b3
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_DUP01=0x1b4
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_DUP02=0x1b5
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_DUP03=0x1b6
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_DUP04=0x1b7
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL=0x1a7
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_DUP01=0x1a8
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_DUP02=0x1a9
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_DUP03=0x1ab
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_DUP04=0x1ac
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_DUP52=0x1aa
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL=0x1ad
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_DUP01=0x1ae
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_DUP02=0x1af
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_DUP03=0x1b0
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_DUP04=0x1b1
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0493_TRANSFERCOMPLETEL_DUP05=0x1b2
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_DEVICEINSERTEDL=0x1c2
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_DEVICEINSERTEDL_DUP01=0x1c3
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL=0x1b8
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_DUP01=0x1b9
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_DUP02=0x1ba
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_DUP03=0x1bb
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_DUP04=0x1bc
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_EP0TRANSFERCOMPLETEL_DUP05=0x1bd
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL=0x1be
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL_DUP01=0x1bf
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL_DUP02=0x1c0
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0494_TRANSFERCOMPLETEL_DUP03=0x1c1
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_CONSTRUCTL=0x1c4
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL=0x1d7
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_DUP01=0x1d8
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_DUP02=0x1d9
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_DEVICEINSERTEDL_DUP03=0x1da
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL=0x1c5
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP01=0x1c6
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP02=0x1c7
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP03=0x1c8
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP04=0x1c9
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP05=0x1ca
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP06=0x1cb
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP07=0x1cd
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP08=0x1ce
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP09=0x1cf
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP10=0x1d0
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP11=0x1d1
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_EP0TRANSFERCOMPLETEL_DUP56=0x1cc
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER=0x1db
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_PERFORMNEXTTRANSFER_DUP01=0x1dc
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL=0x1d2
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_DUP01=0x1d3
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_DUP02=0x1d4
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_DUP03=0x1d5
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0495_TRANSFERCOMPLETEL_DUP04=0x1d6
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_CONSTRUCTL=0x1dd
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL=0x1ec
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_DUP01=0x1ed
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_DUP02=0x1ee
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_DUP03=0x1ef
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL=0x1de
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP01=0x1df
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP02=0x1e0
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP03=0x1e1
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP04=0x1e2
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP05=0x1e3
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP06=0x1e4
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP07=0x1e5
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL=0x1e6
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP01=0x1e7
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP02=0x1e8
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP03=0x1e9
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP04=0x1ea
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP05=0x1eb
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS=0x1f0
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP01=0x1f1
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP02=0x1f2
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP03=0x1f3
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL=0x208
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_DUP01=0x209
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_DUP02=0x20a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_DUP03=0x20b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_DEVICEINSERTEDL_DUP04=0x20c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL=0x1f4
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP01=0x1f5
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP02=0x1f6
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP03=0x1f7
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP04=0x1f8
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP05=0x1f9
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP06=0x1fa
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_EP0TRANSFERCOMPLETEL_DUP07=0x1fb
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL=0x1fc
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP01=0x1fd
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP02=0x1fe
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP03=0x1ff
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP04=0x200
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP05=0x201
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP06=0x202
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP07=0x203
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP08=0x204
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP09=0x205
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP10=0x206
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0497_TRANSFERCOMPLETEL_DUP11=0x207
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_CONSTRUCTL=0x20d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL=0x231
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_DUP01=0x232
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_DUP02=0x233
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_DUP03=0x234
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_DEVICEINSERTEDL_DUP04=0x235
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL=0x20e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP01=0x20f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP02=0x210
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP03=0x211
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP04=0x212
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP05=0x213
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP06=0x214
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP07=0x215
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP08=0x216
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP09=0x218
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP10=0x219
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP11=0x21a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP12=0x21b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP13=0x21c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP14=0x21d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP15=0x21f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP16=0x220
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP17=0x221
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP18=0x222
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP19=0x223
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP54=0x21e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_EP0TRANSFERCOMPLETEL_DUP58=0x217
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL=0x224
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP01=0x225
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP02=0x226
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP03=0x227
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP04=0x228
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP05=0x229
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP06=0x22a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP07=0x22b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP08=0x22c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP09=0x22d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP10=0x22e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP11=0x22f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0498_TRANSFERCOMPLETEL_DUP12=0x230
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_DEVICEINSERTEDL=0x244
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_DEVICEINSERTEDL_DUP01=0x245
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL=0x236
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP01=0x237
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP02=0x238
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP03=0x239
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP04=0x23a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP05=0x23b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_EP0TRANSFERCOMPLETEL_DUP06=0x23c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL=0x23d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP01=0x23e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP02=0x23f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP03=0x240
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP04=0x241
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP05=0x242
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0499_TRANSFERCOMPLETEL_DUP06=0x243
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL=0x252
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_DUP01=0x253
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_DUP02=0x254
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_DUP03=0x255
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL=0x246
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP01=0x247
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP02=0x248
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP03=0x249
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP04=0x24a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP05=0x24b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL=0x24c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP01=0x24d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP02=0x24e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP03=0x24f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP04=0x250
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP05=0x251
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_CONSTRUCTL=0x256
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_DEVICEINSERTEDL=0x273
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_DEVICEINSERTEDL_DUP01=0x274
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_DEVICEINSERTEDL_DUP02=0x275
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL=0x25f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP01=0x260
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP02=0x261
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP03=0x262
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP04=0x263
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP05=0x264
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP06=0x265
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP07=0x267
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP08=0x268
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP09=0x269
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP10=0x26a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP11=0x26b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EP0TRANSFERCOMPLETEL_DUP56=0x266
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES=0x257
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_DUP01=0x258
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_DUP02=0x259
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_DUP03=0x25a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_EXTRACTDEVICEREADBYTES_DUP04=0x25b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_PERFORMNEXTTRANSFER=0x25e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_POSTTRANSFERACTION=0x25c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_POSTTRANSFERACTION_DUP01=0x25d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL=0x26c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP01=0x26d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP02=0x26e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP03=0x26f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP04=0x270
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP05=0x271
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1229_TRANSFERCOMPLETEL_DUP06=0x272
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_CONSTRUCTL=0x276
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_DEVICEINSERTEDL=0x292
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_DEVICEINSERTEDL_DUP01=0x293
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_DEVICEINSERTEDL_DUP02=0x294
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL=0x282
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP01=0x283
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP02=0x284
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP03=0x285
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP04=0x286
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP05=0x287
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP06=0x288
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EP0TRANSFERCOMPLETEL_DUP07=0x289
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES=0x277
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_DUP01=0x278
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_DUP02=0x279
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_DUP03=0x27a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_EXTRACTDEVICEREADBYTES_DUP04=0x27b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_POSTTRANSFERACTION=0x27c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_POSTTRANSFERACTION_DUP01=0x27d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL=0x28a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP01=0x28b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP02=0x28c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP03=0x28d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP04=0x28e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP05=0x28f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP06=0x290
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_TRANSFERCOMPLETEL_DUP07=0x291
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS=0x27e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP01=0x27f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP02=0x280
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1230_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP03=0x281
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_CUT_PBASE_T_USBDI_1231=0x295
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231=0x296
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP01=0x297
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP02=0x298
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP03=0x299
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP04=0x29a
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP05=0x29b
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP06=0x29c
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP07=0x29d
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP08=0x29e
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP09=0x29f
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP10=0x2a0
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP11=0x2a1
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP12=0x2a2
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP13=0x2a3
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP14=0x2a4
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP15=0x2a5
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP16=0x2a6
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP17=0x2a7
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP18=0x2a8
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP19=0x2a9
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP20=0x2aa
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP21=0x2ab
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP22=0x2ac
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP23=0x2ad
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP24=0x2ae
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP25=0x2af
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP26=0x2b0
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP27=0x2b1
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP28=0x2b2
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP29=0x2b3
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP30=0x2b4
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234=0x2b5
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP01=0x2b6
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP02=0x2b7
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP03=0x2b8
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP04=0x2b9
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP05=0x2ba
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP06=0x2bb
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP07=0x2bc
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP08=0x2bd
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP09=0x2be
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP10=0x2bf
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP11=0x2c0
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP12=0x2c1
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP13=0x2c2
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP14=0x2c3
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP15=0x2c4
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP16=0x2c5
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP17=0x2c6
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP18=0x2c7
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP19=0x2c8
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP20=0x2c9
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1234_DCUT_PBASE_T_USBDI_1234_DUP21=0x2ca
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235=0x2cb
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP01=0x2cc
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP02=0x2cd
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP03=0x2ce
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP04=0x2cf
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP05=0x2d0
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP06=0x2d1
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP07=0x2d2
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP08=0x2d3
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP09=0x2d4
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP10=0x2d5
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP11=0x2d6
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP12=0x2d7
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP13=0x2d8
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP14=0x2d9
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP15=0x2da
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP16=0x2db
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP17=0x2dc
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1235_DCUT_PBASE_T_USBDI_1235_DUP18=0x2dd
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL=0x2de
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP01=0x2df
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP02=0x2e0
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP03=0x2e1
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP04=0x2e2
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP05=0x2e3
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP06=0x2e4
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP07=0x2e5
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP08=0x2e6
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP09=0x2e7
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP10=0x2e8
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP11=0x2e9
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP12=0x2ea
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP13=0x2eb
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP14=0x2ec
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP15=0x2ed
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICEINSERTEDL_DUP16=0x2ee
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_DEVICESTATECHANGEL=0x2ef
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_EP0TRANSFERCOMPLETEL=0x2f0
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_HOSTRUNL=0x2f1
-[TRACE]TRACE_NORMAL[0x86]_CUT_PBASE_T_USBDI_1236_HOSTRUNL_DUP01=0x2f2
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN=0x38c
-[TRACE]TRACE_NORMAL[0x86]_KILLTEST_KILLTEST=0x354
-[TRACE]TRACE_NORMAL[0x86]_KILLTEST_KILLTEST_DUP01=0x355
-[TRACE]TRACE_NORMAL[0x86]_MAINL_MAINL=0x38a
-[TRACE]TRACE_NORMAL[0x86]_MAINL_MAINL_DUP01=0x38b
-[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_LISTREGISTEREDTESTCASES=0x3ad
-[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_LISTREGISTEREDTESTCASES_DUP01=0x3ae
-[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_LISTREGISTEREDTESTCASES_DUP02=0x3af
-[TRACE]TRACE_NORMAL[0x86]_RTESTFACTORY_REGISTERTESTCASE=0x3ac
-[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL=0x3b0
-[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP01=0x3b1
-[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP02=0x3b2
-[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP03=0x3b3
-[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP04=0x3b4
-[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP05=0x3b5
-[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP06=0x3b6
-[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP07=0x3b7
-[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP08=0x3b8
-[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP09=0x3b9
-[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP10=0x3ba
-[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP11=0x3bb
-[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP12=0x3bc
-[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP13=0x3bd
-[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEB_OPENL_DUP14=0x3be
-[TRACE]TRACE_NORMAL[0x86]_RUSBDEVICEVENDOR_RUSBDEVICEVENDOR=0x46e
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_ACKNOWLEDGEREQUESTRECEIVED=0x3f1
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_ADDINTERFACE=0x3da
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_CLOSE=0x3c0
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_CLOSE_DUP01=0x3c1
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_OPENL=0x3c2
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_OPENL_DUP01=0x3c3
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_OPENL_DUP02=0x3c4
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_OPENL_DUP03=0x3c5
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_OPENL_DUP04=0x3c6
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_OPENL_DUP05=0x3c7
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_OPENL_DUP06=0x3c8
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_OPENL_DUP07=0x3c9
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_OPENL_DUP08=0x3ca
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_OPENL_DUP09=0x3cb
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_OPENL_DUP10=0x3cc
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL=0x3e2
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL_DUP01=0x3e3
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL_DUP02=0x3e4
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL_DUP03=0x3e5
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL_DUP04=0x3e6
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL_DUP05=0x3e7
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL_DUP06=0x3e8
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL_DUP07=0x3ea
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL_DUP08=0x3eb
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL_DUP09=0x3ec
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL_DUP10=0x3ed
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_PROCESSREQUESTL_DUP56=0x3e9
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_REMOTEWAKEUP=0x3e0
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_REMOTEWAKEUP_DUP01=0x3e1
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_REPORTERROR=0x3f2
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_REPORTERROR_DUP01=0x3f3
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_RUSBTESTDEVICE=0x3bf
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETCLASSCODE=0x3cd
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETCLASSCODE_DUP01=0x3ce
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETCONFIGURATIONSTRING=0x3d9
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETPRODUCT=0x3d3
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETPRODUCT_DUP01=0x3d4
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETPRODUCT_DUP02=0x3d5
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETPRODUCT_DUP03=0x3d6
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETPRODUCT_DUP04=0x3d7
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETPRODUCT_DUP05=0x3d8
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETUSBSPECIFICATION=0x3cf
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETUSBSPECIFICATION_DUP01=0x3d0
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETVENDOR=0x3d1
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SETVENDOR_DUP01=0x3d2
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SOFTWARECONNECT=0x3db
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SOFTWARECONNECT_DUP01=0x3dc
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SOFTWARECONNECT_DUP02=0x3dd
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SOFTWAREDISCONNECT=0x3de
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_SOFTWAREDISCONNECT_DUP01=0x3df
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_STATECHANGEL=0x3ee
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_STATECHANGEL_DUP01=0x3ef
-[TRACE]TRACE_NORMAL[0x86]_RUSBTESTDEVICE_STATECHANGEL_DUP02=0x3f0
--- a/kerneltest/e32test/usbho/t_usbdi/traces_t_usbhost_usbman/OstTraceDefinitions.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-// 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:
-// 
-//
-
-
-#ifndef __OSTTRACEDEFINITIONS_H__
-#define __OSTTRACEDEFINITIONS_H__
-// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
-// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
-//#define OST_TRACE_COMPILER_IN_USE
-#include <opensystemtrace.h>
-#endif
--- a/kerneltest/e32test/usbho/t_usbdi/traces_t_usbhost_usbman/fixed_id.definitions	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
-[GROUP]TRACE_NORMAL=0x86
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN=0x1
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP01=0x2
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP02=0x3
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP03=0x4
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP04=0x5
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP05=0x6
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP06=0x7
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP07=0x8
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP08=0x9
-[TRACE]TRACE_NORMAL[0x86]_E32MAIN_E32MAIN_DUP09=0xa
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS=0xb
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP01=0xc
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP02=0xd
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP03=0xe
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP04=0xf
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP05=0x10
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP06=0x11
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP07=0x12
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP08=0x13
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP09=0x14
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP10=0x15
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP11=0x16
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP12=0x17
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP13=0x18
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP14=0x19
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP15=0x1a
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP16=0x1b
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP17=0x1c
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP18=0x1d
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP19=0x1e
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP20=0x1f
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP21=0x20
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP22=0x21
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP23=0x22
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP24=0x23
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP25=0x24
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP26=0x25
-[TRACE]TRACE_NORMAL[0x86]_RPROCESS_RENDEZVOUS_DUP27=0x26
--- a/kerneltest/e32test/video/t_video.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/video/t_video.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -420,6 +420,7 @@
 
 	TInt count;
 
+	TInt fourBppMode = -1;
 
 	for (count = 0; count < totalModes; count++)
 		{
@@ -455,6 +456,9 @@
 		ret = HAL::Get(HAL::EDisplayBitsPerPixel, HALArg);
 		test (KErrNone == ret);
 
+		if (HALArg == 4)
+			fourBppMode = count;
+
 		}
 
 
@@ -1031,6 +1035,8 @@
 
 	TInt count;
 
+	TInt fourBppMode = -1;
+
 	for (count = 0; count < totalModes; count++)
 		{
 
@@ -1065,6 +1071,9 @@
 		ret = HAL::Get(screen, HAL::EDisplayBitsPerPixel, HALArg);
 		test (KErrNone == ret);
 
+		if (HALArg == 4)
+			fourBppMode = count;
+
 		}
 
 
--- a/kerneltest/e32test/video/t_videomemory.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/video/t_videomemory.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -115,7 +115,6 @@
 		test(KErrNone == ret);
 		
 		pChunkBase = reinterpret_cast<TUint32 *>(chunk.Base());
-		test.Printf(_L("Display Memory Address = %08x\n"), reinterpret_cast<TUint>(pChunkBase));
 		*pChunkBase = KTestValue2;
 		test(KTestValue2 == *pChunkBase);
 		// We should see the new value through the pMemory pointer!
@@ -123,7 +122,8 @@
 			{
 			test(KTestValue2 == *pMemory);
 			}
-	
+        // print it after test as this will corrupt memory buffer
+		test.Printf(_L("Display Memory Address = %08x\n"), reinterpret_cast<TUint>(pChunkBase));
 		}
 	else
 		{
@@ -186,10 +186,11 @@
 		test(KErrNone == ret);
 		
 		pChunkBase2 = reinterpret_cast<TUint32 *>(chunk2.Base());
-		test.Printf(_L("Display Memory Address = %08x\n"), reinterpret_cast<TUint>(pChunkBase));
 		test(KTestValue2 == *pChunkBase2);
 		*pChunkBase2 = KTestValue3;
 		test(KTestValue3 == *pChunkBase2);
+        // print it after test as this will corrupt memory buffer
+        test.Printf(_L("Display Memory Address = %08x\n"), reinterpret_cast<TUint>(pChunkBase));
 		chunk2.Close();
 		}
 	
--- a/kerneltest/e32test/window/t_keys.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/window/t_keys.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1996-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1996-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"
@@ -14,11 +14,10 @@
 // e32test\window\t_keys.cpp
 // 
 //
-#define __E32TEST_EXTENSION__
+
 #include <e32test.h>
 #include <e32hal.h>
 #include <e32twin.h>
-#include <e32keys.h>
 #include <e32svr.h>
 
 const TBool KEY_UP=ETrue;
@@ -26,8 +25,6 @@
 const TBool EXPECT_NO_KEY_PRESS=EFalse;
 const TBool EXPECT_KEY_PRESS=ETrue;
 
-_LIT(REFKDATA, "REFKDATA");
-
 LOCAL_D RTest test(_L("T_KEYS"));
 LOCAL_D CKeyTranslator *KeyTranslator;
 LOCAL_D CCaptureKeys *CaptureKeys;
@@ -138,73 +135,7 @@
 
 	CaptureKeys->Construct();
 
-
-	test.Printf(_L("Load template EKData dll \n"));       // Test with rfkdata.dll	 
-	TInt res=KeyTranslator->ChangeKeyData(REFKDATA);
-	test_KErrNone(res);
-	
-	/* Test the AddCapture failure case */
-	TCaptureKey ck;
-	ck.iModifiers.iMask = 11;
-	ck.iModifiers.iValue = 100;
-	ck.iKeyCodePattern.iKeyCode = EKeyNull;
-	ck.iKeyCodePattern.iPattern = EAnyKey;
-	ck.iApp = 111;
-	ck.iHandle = 123;
-
-	TInt r = KErrNone;
-	TRAP(r, CaptureKeys->AddCaptureKeyL(ck));
-	test_Equal(r, KErrArgument);
-
-	/* Test the AddCapture success case */
-	ck.iModifiers.iMask = 11;
-	ck.iModifiers.iValue = 1;
-
-	TRAP(r, CaptureKeys->AddCaptureKeyL(ck));
-	test_KErrNone(r);
-
-	/* Test the SetCapture case */
-	TCaptureKey replaceck;
-	replaceck.iModifiers.iMask = 0;
-	replaceck.iModifiers.iValue = 0;
-	replaceck.iKeyCodePattern.iKeyCode = EKeyNull;
-	replaceck.iKeyCodePattern.iPattern = EAnyKey;
-	replaceck.iApp = 222;
-	replaceck.iHandle = 456;
-
-	/* Test the SetCapture failure case */
-	CaptureKeys->SetCaptureKey(replaceck.iHandle, ck);
-
-	/* Test the SetCapture success case */
-	CaptureKeys->SetCaptureKey(ck.iHandle, replaceck, 0x80);
-
-	/* Test the Cancelcapture failure case */
-	CaptureKeys->CancelCaptureKey(ck.iHandle);
-
-	/* Let us add one more with a different set of mask to test ProcessCaptureKeys */
-	ck.iModifiers.iMask = 11;
-	ck.iModifiers.iValue = 1;
-	ck.iKeyCodePattern.iKeyCode = EKeyNull;
-	ck.iKeyCodePattern.iPattern = EMatchLeftOrRight+1;
-	ck.iApp = 111;
-	ck.iHandle = 123;
-
-	TRAP(r, CaptureKeys->AddCaptureKeyL(ck));
-	test_KErrNone(r);
-
-	/* Let us add one more with a different set of mask to test ProcessCaptureKeys */
-	ck.iModifiers.iMask = 11;
-	ck.iModifiers.iValue = 1;
-	ck.iKeyCodePattern.iKeyCode = EKeyNull;
-	ck.iKeyCodePattern.iPattern = EAnyKey;
-	ck.iApp = 333;
-	ck.iHandle = 789;
-
-	TRAP(r, CaptureKeys->AddCaptureKeyL(ck));
-	test_KErrNone(r);
-
     TUint scancode=EStdKeyLeftArrow;
-
 //
 // Test that the special keys pass through and anything after
 // or before raises an error
@@ -328,29 +259,6 @@
 	testAccents('6','E',0xea);
 
 */
-
-	/* Test the CancelAllCaptureKeys failure case */
-	CaptureKeys->CancelAllCaptureKeys(ck.iApp);
-
-	/* Test the CancelCaptureKey success case */
-	CaptureKeys->CancelCaptureKey(replaceck.iHandle);
-
-	/* Now add a CaptureKey to test CancelAllCaptureKeys success case */
-	ck.iModifiers.iMask = 11;
-	ck.iModifiers.iValue = 1;
-	ck.iKeyCodePattern.iKeyCode = EKeyNull;
-	ck.iKeyCodePattern.iPattern = EAnyKey;
-	ck.iApp = 111;
-	ck.iHandle = 123;
-
-	TRAP(r, CaptureKeys->AddCaptureKeyL(ck));
-	test_KErrNone(r);
-
-	/* Test CancelAllCaptureKeys success case */
-	CaptureKeys->CancelAllCaptureKeys(ck.iApp);
-
-	delete CaptureKeys;
-
 	test.End();
 	return(KErrNone);
     }
--- a/kerneltest/e32test/window/t_mmcpw.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32test/window/t_mmcpw.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -18,7 +18,6 @@
 
 #include <e32svr.h>
 
-#define __E32TEST_EXTENSION__
 #include <e32test.h>
 #include <e32twin.h>
 #include <e32def.h>
@@ -36,8 +35,8 @@
 	RNotifier n;
 	
 	test.Next(_L("Connected to notify server."));
-	TInt r = n.Connect();
-	test_KErrNone(r);
+	TInt r;
+	test((r = n.Connect()) == KErrNone);
 
 	TPckgBuf<TMediaPswdSendNotifyInfoV1> send;
 	send().iVersion = TVersion(1, 0, 0);
--- a/kerneltest/e32utils/group/bld.inf	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32utils/group/bld.inf	Wed Sep 01 12:34:56 2010 +0100
@@ -41,6 +41,7 @@
 ../demandpaging/dptestcons.oby 				/epoc32/rom/include/dptestcons.oby
 
 PRJ_TESTEXPORTS
+../trace/btracevw.pl /epoc32/tools/btracevw.pl
 
 PRJ_TESTMMPFILES
 #if defined(TOOLS2)
--- a/kerneltest/e32utils/hcrscripts/hcrdat.pm	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,378 +0,0 @@
-#!perl -w
-#
-# 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:
-#
-use strict;
-
-#use Math::BigInt;
-
-#
-# Perl module to create and maintain feature manager data files.
-# You can either set up the information programmatically or else load up
-# information from a pre-existing feature data file and then modify it. You
-# can also save the information to a file (in feature manager dataset format).
-#
-# This class maintains header information plus two arrays, one containing
-# feature flag information and the other containing default supported range
-# information. Those are themselves objects and have their own accessor
-# methods.
-#
-
-package HCRdat;
-
-use HCRrec;
-
-
-#
-# n e w
-#
-# Create a new HCRdat object. For example 'my $hd = HCRdat->new("filea");
-#
-sub new
-{
-	my $arg = shift;
-	my $fn = shift;
-	my $class = ref($arg) || $arg;
-	my $self = {
-			        fingerprint => "HCRf",  # 4 bytes wide.
-					fileversion => 1,       # 2 bytes.
-					fileflags => 0x0001,  # 2 bytes.
-					numrecords => 0,      # 4 bytes. 
-					lsdoffset => 0,       # 4 bytes. 
-					lsdsize => 0,         # 4 bytes.
-				    packprefix => "V",    # Changed with endian-ness.
-					                      # Used to create binary strings.
-
-					settingrecords => [],  # Array of objects
-					lsd => [],             # Array of bytes
-	           };
-    bless $self, $class;
-	return $self;
-}
-
-
-# Print to STDOUT the header information we have.
-sub ShowHeader
-{
-	my $self = shift;
-	return undef unless(ref($self));
-
-	# Get header information..
-	my $typefield = $self->TypeField();
-	my $fileversion = $self->FileVersion();
-	my $fileflags = $self->FileFlags();
-	my $numrecords = $self->NumRecords();
-	my $lsdoffset = $self->LsdOffset();
-	my $lsdsize = $self->LsdSize();
-	
-	# Display it in English.
-	print "  FINGERPRINTF: '$typefield'\n";
-	print "  FILEVERSION: '$fileversion'\n";
-	print "  FILEFLAGS: '$fileflags'\n";
-	print "  NUMRECORDS: '$numrecords'\n";
-	print "  LSDOFFSET: '$lsdoffset'\n";
-    print "  LSDSIZE: '$lsdsize'\n";
-
-	return(0);
-}
-
-# Get/Set the endian-ness we want. Changes the 'packprefix' member which is
-# used in the creation of binary data.
-sub Endian
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $arg = shift;
-	return $self->{endian} unless(defined($arg));
-	if($arg =~ m/(LE|BE)/i)
-	{
-		my $endian = uc($1);
-		$self->{endian} = $endian;
-		# Used by 'pack' to generate binary strings.
-		$self->{packprefix} = "V" if($endian eq "LE");
-		$self->{packprefix} = "N" if($endian eq "BE");
-	}
-	return $self->{endian};
-}
-
-# This is the fingerprint.
-sub TypeField
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $arg = shift;
-	$self->{fingerprint} = $arg if(defined($arg));
-	return $self->{fingerprint};
-}
-
-sub FileVersion
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $arg = shift;
-	# Should we be testing for a numeric value?
-	$self->{fileversion} = $arg if(defined($arg));
-	return $self->{fileversion};
-}
-
-sub FileFlags
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $arg = shift;
-	$self->{fileflags} = $arg if(defined($arg));
-	return $self->{fileflags};
-}
-
-# How many feature flag objects have we got?
-sub NumRecords
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $arg = shift;
-	$self->{numrecords} += $arg if(defined($arg));
-	return $self->{numrecords};
-}
-
-
-sub LsdOffset
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $arg = shift;
-	$self->{lsdoffset} = $arg if(defined($arg));
-	return $self->{lsdoffset};
-}
-
-sub LsdSize
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $arg = shift;
-	$self->{lsdsize} = $arg if(defined($arg));
-	return $self->{lsdsize};
-}
-
-# Create a binary string containing the header information for the
-# feature manager data file based on the various fields in this object.
-sub CreateBinaryHeader
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $hdrstring;
-
-	# Get the letter for packing information with 'pack' into a binary form.
-	my $pack16 = lc($self->{packprefix});
-	my $pack32 = uc($self->{packprefix});
-	
-	# Get header information..
-	my $typefield = $self->TypeField();
-	my $fileversion = $self->FileVersion();
-	my $fileflags = $self->FileFlags();
-	my $numrecords = $self->NumRecords();
-	my $lsdoffset = $self->LsdOffset();
-	my $lsdsize = $self->LsdSize();
-
-	# Write the 'type' field out. This is 'feat'. Would this be different on
-	# big-endian systems?
-	$hdrstring = $typefield;
-
-	# Now the file version number. A 16-bit value.. Will this cause trouble
-	# if the shifted value is signed?
-	$hdrstring .= pack($pack16 . "1", $fileversion);
-
-	# Now the file flags. Another 16-bit value..
-	$hdrstring .= pack($pack16 . "1", $fileflags);
-
-	# Now the number of listed features - a 32-bit value.
-	$hdrstring .= pack($pack32 . "1", $numrecords);
-
-	# Now the number of listed features - a 32-bit value.
-	$hdrstring .= pack($pack32 . "1", $lsdoffset);
-
-	# Now the number of listed features - a 32-bit value.
-	$hdrstring .= pack($pack32 . "1", $lsdsize);
-
-	# Now the 3 reserved words
-	$hdrstring .= pack($pack32 . "3", (0, 0, 0));
-
-	return $hdrstring;
-}
-
-sub CreateImageHdr
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	#my $partid = shift;
-	#return -1 unless(defined($partid));
-
-	# Add fingerprint, 1st reserved word and format version
-	my $imghdr = pack "V4", (0x5F524348, 0x54524150, 0x00000000, 0x00000001);
-	# Add space for image size, timestamp, 2nd reserved word
-	$imghdr .= pack "V3", (0x00000000, time, 0x00000000);
-	# Add space for payload checksum, HCR Payload constants: UID and 0x0 flags
-    $imghdr .= pack "V3", (0x00000000, 0x10286AB8, 0x00000000);
-    #Reserved space
-    $imghdr .= pack "x216", (0x00000000);
- 
-    return $imghdr;
-}
-
-sub WriteToImage
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $imgfile = shift;
-	return -1 unless(defined($imgfile));
-	my $datfile = shift;
-	return -1 unless(defined($datfile));
-	#my $partid = shift;
-	#return -1 unless(defined($partid));
-	my $rc = 0;
-	
-    open IMGFILE, "> $imgfile" or die "Couldn't open file '$imgfile' for writing.\n";
-	binmode IMGFILE;
-   
- 	syswrite(IMGFILE, $self->CreateImageHdr(), 256);	
- 	
-    open DATFILE, "$datfile" or die "Couldn't open file '$datfile' for reading.\n";
-	binmode DATFILE;
-	# print FILE $self->BinaryContent();
-	
-    #my $wordsum = 0x1200000000;
-    #my $wordsum = Math::BigInt->new("0x0220100123");
-    #printf("test: %x\n", $wordsum->external();
-
-	my $imgsize = 256;
-	my $word;
-	printf("-reading image:\n")  if ($mhd::otrace);
-	while (sysread (DATFILE, $word, 4)) {
-	    #printf ("%08x ",$word)  if ($mhd::otrace);
-        my $iword = unpack("V" , $word);
-	    printf ("%08x ",$iword)  if ($mhd::otrace);
-        $rc = syswrite (IMGFILE, $word, 4);
-        die "error: ($rc) failed to write datfile word into imgfile.\n" if ($rc != 4);
-	    #$wordsum->badd($iword);
-        $imgsize += 4;
-	    print "\n" if (($mhd::otrace) && ($imgsize%16==0));
-        }
-    print "\n" if ($mhd::otrace);
-    # ordsum: 0x". $wordsum ."\n" if ($mhd::otrace);
-	my $checksum = 0x12345678;
-	close DATFILE;
-	
-	printf("-image size: %d, checksum: 0x%08x", $imgsize, $checksum) if ($mhd::otrace);
-	
-	$rc = sysseek(IMGFILE, 16, 0);
-	die "error: ($rc) failed to seek in image to write header.\n" if ($rc != 16);
-
-	# Write out the image size	
-	my $imginfo1 = pack "V1", ($imgsize);
-	$rc = syswrite(IMGFILE, $imginfo1, 4);
-	die "error: ($rc) failed to write image size/checksum to image header.\n" if ($rc != 4);
-
-	$rc = sysseek(IMGFILE, 28, 0);
-	die "error: ($rc) failed to seek in image to write header.\n" if ($rc != 28);
-	
-	# Write out the image checksum 
-	my $imginfo2 = pack "V1", ($checksum);
-	$rc = syswrite(IMGFILE, $imginfo2, 4);
-	die "error: ($rc) failed to write image size/checksum to image header.\n" if ($rc != 4);
-  
-	close IMGFILE; 	
-	
-    return 0;
-}
-
-# Writes the binary file specified as an argument with the content of this
-# and contained feature flag and dsr objects.
-sub WriteToFile
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $file = shift;
-	return undef unless(defined($file));
-    open FILE, "> $file" or die "Couldn't open file '$file' for writing.\n";
-	binmode FILE;
-	print FILE $self->BinaryContent();
-	
-	close FILE;
-	return 0;
-}
-
-
-# Create the binary equivalent of the internal data and return it as a
-# string.
-sub BinaryContent
-{
-	my $self = shift;
-	return undef unless(ref($self));
-
-    # Get the feature flag entries.. This is an array reference.
-	# For each one append the binary representation of the information
-	# contained.
-	my $records = "";
-    my $lsd = "";
-   	my $ffs_ref = $self->SettingRecords();
-	my $ff;
-
-    my $count = 0;
-	foreach $ff (@$ffs_ref)
-	{
-	    $count++;
-	    printf("-encoding record: %04d (0x%08x:%04d)\n", $count, $ff->CUID(), $ff->EID());
-		$records .= $ff->GetRecHdrBinary(length ($lsd));
-	    my $stype = $ff->Type();
-    	if (($stype & 0xffff0000) && ($ff->Length() > 0)) {
-		    $lsd .= $ff->GetRecLsdBinary();
-            }
-	}
-
-    $self->LsdOffset(32+length ($records));     # header size 32
-    $self->LsdSize(length ($lsd));
-    
-	my $header = $self->CreateBinaryHeader();
-
-	return $header . $records . $lsd;
-}
-
-# Return a reference to the 'feature flags' array.
-sub SettingRecords
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	return $self->{settingrecords};
-}
-
-# Add a Feature Flag object. Perhaps there should be code to check if we
-# already know about this feature flag. (i.e check the uid against the ones
-# we have).
-sub AddSettingRecord
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $arg = shift;
-	die "panic: method 'AddSettingRecord' requires a 'HCRrec' object as argument.\n"
-   	    unless(ref($arg) eq  "HCRrec");
-   	
-	push @{$self->SettingRecords()}, $arg;
-	$self->NumRecords(1);
-	
-    return 0;
-}
-
-
-1;
-
--- a/kerneltest/e32utils/hcrscripts/hcrmd.bat	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-@rem
-@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-@rem All rights reserved.
-@rem This component and the accompanying materials are made available
-@rem under the terms of the License "Eclipse Public License v1.0"
-@rem which accompanies this distribution, and is available
-@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
-@rem
-@rem Initial Contributors:
-@rem Nokia Corporation - initial contribution.
-@rem
-@rem Contributors:
-@rem
-@rem Description:
-@rem
-
-@echo off
-
-@perl -S -I%EPOCROOT%epoc32/tools/hcr %EPOCROOT%epoc32/tools/hcr/makehcrdat.pl %*
--- a/kerneltest/e32utils/hcrscripts/hcrrec.pm	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,437 +0,0 @@
-#!perl -w
-#
-# 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:
-#
-use strict;
-
-#
-# A simple class to manage feature flags for a feature set data file.
-#
-package HCRrec;
-
-my %typemap = (
-    Int32 =>       0x00000001,
-    Int16 =>       0x00000002,    
-    Int8 =>        0x00000004,
-    Bool =>        0x00000008,    
-    UInt32 =>      0x00000010,
-    UInt16 =>      0x00000020,    
-    UInt8 =>       0x00000040,
-    LinAddr =>     0x00000100,
-    BinData =>     0x00010000,
-    Text8 =>       0x00020000,    
-	ArrayInt32 =>  0x00040000,
-	ArrayUInt32 => 0x00080000,
-    Int64 =>       0x01000000,
-    UInt64 =>      0x02000000,    
-);
-my %maptype = reverse %typemap;
-my %lsdtype2packmap = (
-    0x00010000 => "C",
-    0x00020000 => "a",    
-    0x01000000 => "C",
-    0x02000000 => "C",    
-);
-
-# Create a feature flag object.
-sub new
-{
-	my $arg = shift;
-	my $class = ref($arg) || $arg;
-
-	my $self = {
-			     cuid => 0,              # 4 bytes
-			     eid => 0,               # 4 bytes
-			     type => 0,              # 4 bytes
-			     flagword => 0x0000,     # 2 bytes 
-                 valueset => 0,
-                           
-			     intvalue => 0,           # 4 bytes
-			     strvalue => "",          # array of chars
-			     binvalue => [],          # array of bytes
-			     arrvalue => [],		  # array of 4 byte integers
-			     
-   				 endian => "LE",
-			   };
- 
-	bless $self, $class;
-	return $self;
-}
-
-sub Endian
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $arg = shift;
-	return $self->{endian} unless(defined($arg) and $arg =~ m/(^BE$|^LE$)/i);
-	$self->{endian} = lc($1);
-	return $self->{endian};
-}
-
-# Return a twelve byte string 'feature flag' information.
-sub GetRecHdrBinary
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	
-	my $lsd_size = shift;
-	
-	my $stype = $self->Type(); 
-	my @hdrarr = ( $self->CUID(), $self->EID(), $stype, $self->Flags(),
-                $self->SizeInBytes() );
-    
-	# Decide whether we want big or little endian output.
-	# According to the documentation, 'V', 'N' are GUARANTEED to be 32-bit.
-	my $packstring;
-	if($self->Endian() eq "BE") {
-	    $packstring = "N3n2N";
-        }
-    else {
-        $packstring = "V3v2V"; # Little endian.
-        }
-        
-    #
-    # Could add range checks here for 8-bit and 16-bit types.
-    # However would stop negative test cases from being generated.
-    # Do it later.
-    #
-    
-    if ($stype & 0xffff) {
-        print "Writing integer\n" if ($mhd::otrace);
-        push @hdrarr, $self->IntValue();
-        }
-    
-    if ($stype & 0xffff0000) {
-        if ($self->Length() > 0) {
-            print "Writing offset: " . $lsd_size . "\n" if ($mhd::otrace);
-            push @hdrarr, $lsd_size;
-            }
-        else {
-            print "Writing null offset: 0\n" if ($mhd::otrace);
-            push @hdrarr, 0;            
-            }
-        }
-
-	my $hdr_string = pack $packstring, @hdrarr;
-	
-	return $hdr_string;
-}
-
-# Return a twelve byte string 'feature flag' information.
-# Assumes Little Endian output!
-sub GetRecLsdBinary
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	
-    my $value = "";
-    my $valuelen = $self->Length();
-    my $vallen = $valuelen;
-    #print "vallen before:" . $vallen . "\n";
-    $vallen = ($valuelen+3)&0xfffc if ($valuelen%4) ;
-    #print "vallen after:" . $vallen . "\n";
-	my $valtype = $self->{type};
-
-    # String
-    if ($valtype & 0x00020000) {
-	    my $packstr = $lsdtype2packmap{$valtype} . $vallen;
-	    printf ("packstr:%s\n", $packstr) if($mhd::otrace);
-        printf ("strvalue:%s\n", $self->{strvalue}) if($mhd::otrace);
-        $value = pack $packstr,  $self->{strvalue} ;
-        }
-    # Binary Data
-    elsif ($valtype & 0x00010000) {
-        for (my $c=0;  $c < $valuelen; $c++) {
-            my $byte = $self->{binvalue}[$c];
-            $value .= pack $lsdtype2packmap{$valtype}, $byte;
-            $vallen--;     
-        }
-        while ($vallen > 0) {
-            $value .= pack "C", ( 0x00 );
-            $vallen--;
-            }
-    }
-    # 64bit quantity
-    elsif ($valtype & 0x03000000) {
-        die "error: 64 bit integer missing hex binvalues\n" if (! exists $self->{binvalue}[7]);
-        $value  = pack $lsdtype2packmap{$valtype}, $self->{binvalue}[0];
-        $value  .= pack $lsdtype2packmap{$valtype}, $self->{binvalue}[1];
-        $value  .= pack $lsdtype2packmap{$valtype}, $self->{binvalue}[2];
-        $value  .= pack $lsdtype2packmap{$valtype}, $self->{binvalue}[3];
-        $value  .= pack $lsdtype2packmap{$valtype}, $self->{binvalue}[4];
-        $value  .= pack $lsdtype2packmap{$valtype}, $self->{binvalue}[5];
-        $value  .= pack $lsdtype2packmap{$valtype}, $self->{binvalue}[6];
-        $value  .= pack $lsdtype2packmap{$valtype}, $self->{binvalue}[7];
-        }
-    # array of 32bit quantity
-    elsif ($valtype & 0x000C0000) {
-        for (my $c=0;  $c < $valuelen; $c++) {
-            my $int = $self->{arrvalue}[$c];
-            $value .= pack "V", $int;
-            $vallen--;     
-            }
-	}    
-    else {
-        die "panic: proramming error!!";
-    }
-    
-	return $value;
-	}
-
-# A single 32-bit number.
-sub CUID
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $uid = shift;
-	return $self->{cuid} unless(defined($uid));
-	my $uidv = hex($uid);
-	$self->{cuid} = $uidv;
-	return $uidv;
-}
-
-# A single 32-bit number.
-sub EID
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $id = shift;
-	return $self->{eid} unless(defined($id));
-	my $idv = int($id);
-	$self->{eid} = $idv;
-	return $idv;
-}
-
-sub Type
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $type = shift;
-	return $self->{type} unless(defined($type));
-	my $enum = $typemap{$type};
-	#print "--->Defined\n" if (defined $enum);
-	#print "--->NOT Defined\n" if (! defined $enum);
-	die "error: unknown setting type found in input file\n" if (! defined $enum);
-   	$self->{type} = $enum;
-	return $enum;
-}
-
-sub TypeName
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	return "Undefined Type" if (! exists $maptype{$self->{type}});
-	return $maptype{$self->{type}};
-}
-
-sub Flags
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $flags = shift;
-	return $self->{flagword} unless(defined($flags));
-	my $vf = hex($flags);
-	$self->{flagword} = $vf;
-	return $vf;
-}
-
-sub Length
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $len = shift;
-	die "panic: Length() does not take an argument!\n" if (defined($len));
-	
-	my $length = 0;
-	if ($self->{type} & 0x00020000) {
-        $length = length ($self->{strvalue});
-        }
-    elsif ($self->{type} & 0x03010000) {
-	    my $array_ref = $self->{binvalue};
-	    my @array = @$array_ref;
-	    $length = $#array+1;
-	    }
-    elsif ($self->{type} & 0x000C0000) {
-	    my $array_ref = $self->{arrvalue};
-	    my @array = @$array_ref;
-	    $length = $#array+1;
-	    #printf ("arrval length %d %d\n",  length ($self->{arrval}), $length);
-	    }
-	else {
-	    $length = 0;
-        }
-	return $length;	
-}
-
-sub SizeInBytes
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $len = shift;
-	die "panic: Length() does not take an argument!\n" if (defined($len));
-	
-	my $size = 0;
-	if ($self->{type} & 0x00020000) {
-        $size = length ($self->{strvalue});
-        }
-    elsif ($self->{type} & 0x03010000) {
-	    my $array_ref = $self->{binvalue};
-	    my @array = @$array_ref;
-	    $size = $#array+1;
-	    }
-    elsif ($self->{type} & 0x000C0000) {
-	    my $array_ref = $self->{arrvalue};
-	    my @array = @$array_ref;
-	    $size = ($#array+1)*4;
-	    #printf ("arrval length %d %d\n",  length ($self->{arrval}), $length);
-	    }
-	else {
-	    $size = 0;
-        }
-	return $size;	
-}
-
-sub IsValid
-{
-	my $self = shift;
-	return undef unless(ref($self));
-
-    if (($self->{cuid} == 0) || ($self->{eid} == 0) ||
-        ($self->{type} == 0) || ($self->{flagword} != 0) ||
-        ($self->IsValueSet() == 0)) {
-        return 0;
-        }    
-    
-    #Record valid if we reach here
-    return 1;    
-}
-
-sub IsValueSet
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	return $self->{valueset};
-}
-
-sub MarkValueSet
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	$self->{valueset} = 1;
-}
-
-sub IntValue
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $value = shift;
-	if (defined($value)) {
-        my $int = int($value);
-        $self->{intvalue} = $int;
-        $self->MarkValueSet();
-        }
-	return $self->{intvalue};
-}
-
-sub HexValue
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $value = shift;
-	return $self->{intvalue} unless(defined($value));
-	my $int = hex($value);
-	$self->{intvalue} = $int;
-	$self->MarkValueSet();
-    return $int;
-}
-
-sub StrValue
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $value = shift;
-	return $self->{strvalue} unless(defined($value));
-	#printf ("strlen before %d\n", length ($self->{strvalue}));	
-    $self->{strvalue} .= $value;
-	#printf ("strlen after %d\n",  length ($self->{strvalue}));
-	$self->MarkValueSet();
-    return $value;
-}
-
-sub ArrValue
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $value = shift;
-
-	return $self->{arrvalue} unless(defined($value));
-
-    my $int = int($value);
-	my $index = $self->Length();
-
-	$self->{arrvalue}[$index] = $int; # Increments the array size as well as appending item
-	$index*=4; 
-
-	printf ("warning: array value larger than HCR maximum (512 bytes): %d\n", $index) if ($index > 512);    
-	$self->MarkValueSet();
-
-    return $self->{arrvalue};
-}
-
-sub BinValue
-{
-	my $self = shift;
-	return undef unless(ref($self));
-	my $value = shift;
-	
-	return $self->{binvalue} unless(defined($value));
-
-    my @hwords = split(/\s/,$value);
-    shift @hwords if ($hwords[0] eq "");
-    my $hwordslen = scalar(@hwords);  
-
-    #printf("(len:%d)(0:%04x 1:%04x last:%04x)\n", $hwordslen, hex($hwords[0]), hex($hwords[1]), hex($hwords[$hwordslen-1])) if ($mhd::trace);
-    
-    my $index = $self->Length();
-	#printf ("binlen before %d\n", $index);
-         
-    #print "Index: " . $index . "\n";
-    foreach my $word (@hwords) {
-        if (length ($word) == 2) {
-	        $self->{binvalue}[$index] = hex($word);
-            }
-        else {
-            die "error: hexadecimal value '$word' too short/large for 8-bit integer\n";
-            }
-
-
-	   #$self->{binvalue}[$index] = $mint;
-	   #printf("%d: %04x\n", $count, $self->{binvalue}[$count]);
-       $index++;	  
-	   }
-	  
-
-	#printf ("binlen after %d\n", $index);
-            
-    printf ("warning: binary value larger than HCR maximum (512 bytes): %d\n", $index) if ($index > 512);
-    $self->MarkValueSet();            
-	return $self->{binvalue};
-}
-
-
-# ###########################################################################
-
-1;
-
--- a/kerneltest/e32utils/hcrscripts/hcrscripts.inf	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +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:
-// Hardware Configuration Respoitory Scripts and Utils
-// Convienence inf file, to build:  bldmake -f hcrscripts.inf bldfiles
-// Scripts not part of the offical OS build, hence these are unsupported.
-// Available for developer adhoc-testing only until offical HCR tools available.
-//
-
-/**
-@file
-Hardware Configuration Repository Scripts
-*/
-
-PRJ_EXPORTS
-
-./hcrmd.bat								/epoc32/tools/hcrmd.bat
-./hcrdat.pm								/epoc32/tools/hcr/hcrdat.pm
-./hcrrec.pm								/epoc32/tools/hcr/hcrrec.pm	
-./makehcrdat.pl							/epoc32/tools/hcr/makehcrdat.pl
-
--- a/kerneltest/e32utils/hcrscripts/makehcrdat.pl	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,219 +0,0 @@
-#!perl -w
-#
-# 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:
-# This simple script makes a binary HCR data file from a text input file
-#
-use strict;
-
-use HCRdat;
-use HCRrec;
-
-package mhd;
-
-#
-# Find out what file the user is interested in..
-# Make sure it's specified and exists.
-#
-$mhd::trace = 0;
-$mhd::otrace = 0;
-
-if (@ARGV < 2 || @ARGV > 4) {
-    die "\nUsage: hcrmd.bat <source_textfile> <dest_datfile> [-i]\n";
-    }
-
-my $textfile = shift @ARGV;
-my $datfile  = shift @ARGV;
-
-my $do_create_image = 0;
-my $opt_i = shift @ARGV;
-#my $partid = 0x10000005;
-if (defined($opt_i)) {
-    $do_create_image = 1 if ($opt_i eq "-i");
-    die "error: unknown command option\n" if ($opt_i ne "-i");
-    #my $i_no = shift @ARGV;
-    #$partid = hex($i_no) if (defined($i_no)); 
-    #printf("partitionid: 0x%x\n", $partid)
-    }
-
-
-print "\n    HCR Binary Data File Generator, version v0.1\n";
-print "    Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.\n\n";
-print "-input: $textfile\n" if($mhd::trace);
-print "-output: $datfile\n" if($mhd::trace);
-
-die "error: Specifed source_textfile not found!" unless(-f $textfile);
-#die "error: Specified dest_binfile '$datfile' already exists!" if(-e $datfile);
-
-printf "\nReading input file... $textfile\n";
-
-printf "-opening text file\n" if($mhd::trace);
-my $tfh;
-open($tfh, "<$textfile");
-
-printf "-started conversion...\n"  if($mhd::trace);
-my $datobj = HCRdat->new();
-my $inrec = 0;
-my $ln = 0;
-my $recobj;
-
-while (<$tfh>)
-    {
-    $ln++;
-    if ($_ =~ '^\s*#') {
-        printf "-comment\n" if($mhd::trace);
-        }
-    elsif ($_ =~ '^@') {
-        die "error: Syntax error line $ln: New record started before previous one is closed" if($inrec > 0);
-        printf "-start\n" if($mhd::trace);
-        $inrec = 1;
-        $recobj = HCRrec->new();
-        }
-    elsif ($_ =~ '^\.') {
-        die "error: Syntax error line $ln: Record closed before a new record has been opened" if($inrec == 0); 
-        printf "-end\n" if($mhd::trace);
-        if ($recobj->IsValid()) {
-            $datobj->AddSettingRecord($recobj);
-            }
-        else {
-            die "error: Record after record " . $datobj->NumRecords() . " completed but not valid, missing or has =0  fields?\n";
-            }
-        $inrec = 0;
-        }
-    elsif ($_ =~ '^\s*$') {
-        printf "-blank\n" if($mhd::trace);
-        }
-    elsif ($_ =~ '^\s*cuid:\s') {
-        print "--cuid " if($mhd::trace);
-        my @hwords = split(/\s+/,$_);
-        die "error: 'cuid:' line incorrectly formed" if (scalar(@hwords) != 2); 
-
-        $recobj->CUID($hwords[1]);
-        printf("=0x%08x\n", $recobj->CUID()) if($mhd::trace);
-        }
-    elsif ($_ =~ '^\s*eid:\s') {
-        print "--eid " if($mhd::trace);
-        my @hwords = split(/\s+/,$_);
-        die "error: 'eid:' line incorrectly formed" if (scalar(@hwords) != 2); 
-
-        $recobj->EID($hwords[1]);
-        print "=".($recobj->EID())."\n" if($mhd::trace);  
-        }
-    elsif ($_ =~ '^\s*type:\s') {
-        print "--type " if($mhd::trace);
-        my @hwords = split(/\s+/,$_);
-        die "error: 'type:' line incorrectly formed" if (scalar(@hwords) != 2); 
-        
-        $recobj->Type($hwords[1]); 
-        printf("=0x%08x (%s)\n", $recobj->Type(), $recobj->TypeName()) if($mhd::trace);
-        }
-    elsif ($_ =~ '^\s*flags:\s') {
-        print "--flags " if($mhd::trace);
-        my @hwords = split(/\s+/,$_);
-        die "error: 'flags:' line incorrectly formed" if (scalar(@hwords) != 2);
-        
-        $recobj->Flags($hwords[1]);
-        printf ("=0x%x\n", $recobj->Flags()) if($mhd::trace);  
-        printf ("warning: flag length value greater than 2-bytes\n") if ($recobj->Flags() > 0xffff);
-        }
-    elsif ($_ =~ '^\s*intval:\s') {
-        print "--intval " if($mhd::trace);
-        my @hwords = split(/\s+/,$_);
-        die "error: 'intval:' line incorrectly formed" if (scalar(@hwords) != 2); 
-
-        $recobj->IntValue($hwords[1]);
-        printf("=%d (0x%x)\n", $recobj->IntValue(), $recobj->IntValue()) if($mhd::trace);  
-        }
-    elsif ($_ =~ '^\s*hexval:\s') {
-        print "--hexval " if($mhd::trace);
-        my @hwords = split(/\s+/,$_);
-        die "error: 'hexval:' line incorrectly formed" if (scalar(@hwords) != 2); 
-
-        $recobj->HexValue($hwords[1]);
-        printf("=%d (0x%x)\n", $recobj->IntValue(), $recobj->IntValue()) if($mhd::trace);  
-        }
-    elsif ($_ =~ '^\s*arrval:\s') {
-        print "--arrval " if($mhd::trace);
-        my @hwords = split(/\s+/,$_);
-        die "error: 'arrval:' line incorrectly formed" if (scalar(@hwords) != 2); 
-        
-		print  $hwords[1]."\n" if ($mhd::trace);
-        $recobj->ArrValue($hwords[1]);  
-        }
-    elsif ($_ =~ '^\s*strval:\s') {
-        print "--strval " if($mhd::trace);
-        my @hwords = split(/\"/,$_);
-        die "error: 'strval:' line incorrectly formed" if (scalar(@hwords) != 3); 
-
-        my $strval_size = $recobj->Length();
-        $recobj->StrValue($hwords[1]);
-        
-        printf("=\"%s\"\n", substr($recobj->StrValue(), $strval_size)) if($mhd::trace);  
-        }
-    elsif ($_ =~ '^\s*binval:\s') {
-        print "--binval " if($mhd::trace);
-        my @hwords = split(/:/,$_);
-        die "error: 'binval:' line incorrectly formed" if (scalar(@hwords) < 2); 
-
-        my $binval_size = $recobj->Length();
-        $recobj->BinValue($hwords[1]);
-        
-        my $binval_ref = $recobj->BinValue();
-        my @binval = @$binval_ref;
-        
-        printf("(%d) =", $#binval+1) if($mhd::trace);
-        my $uint16 = $binval_size;
-        for (; $uint16 < @binval; $uint16++) {
-            printf("%02x ", $binval[$uint16]) if($mhd::trace);
-            } 
-
-        print "\n" if($mhd::trace);
-        }
-    elsif ($_ =~ '') {
-        }
-    else {
-        die "error: unknown line type '$_'" 
-#        print $_  if($mhd::trace);
-        }
-    }
-
-close $tfh;
-
-printf "\nGenerating output file... $datfile\n";
-
-printf "-creating binary data file\n"  if($mhd::otrace);
-if ($datobj->WriteToFile($datfile.".tmp") != 0) {
-    die "error: failed to write to dest_binfile";
-    }
-    
-printf "-renaming file to temp file to $datfile\n"  if($mhd::otrace);
-rename ($datfile.".tmp", $datfile);
-
-printf "-file header written:\n"  if($mhd::otrace);
-$datobj->ShowHeader() if($mhd::otrace);
-
-if ($do_create_image) {
-    my $imgfile = $datfile . ".img";
-    print "\nGenerating partition image... ".  $imgfile . "\n";
-
-    if ($datobj->WriteToImage($imgfile, $datfile) != 0) {
-        die "error: failed to write to image file $imgfile";
-        }
-    }
-
-print "\nDone.\n";
-exit 0;
-
-
-
Binary file kerneltest/e32utils/hcrscripts/test/array_hcrfile.dat has changed
Binary file kerneltest/e32utils/hcrscripts/test/array_hcrfile.dat.img has changed
--- a/kerneltest/e32utils/hcrscripts/test/array_test.txt	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-#------------------------------------------------------------------------------
-# Large Array Settings Test file for use with the 'hcrmd' tool.
-#
-
-#------------------------------------------------------------------------------
-# Signed Integer array 32-bit tests
-#
-@
-cuid: 0xee000001
-eid:  121
-type: ArrayInt32
-flags: 0x0000
-arrval: 2147483647
-arrval: 2147483647
-.
-@
-cuid: 0xee000001
-eid:  122
-type: ArrayInt32
-flags: 0x0000
-arrval: 1
-.
-@
-cuid: 0xee000001
-eid:  123
-type: ArrayInt32
-flags: 0x0000
-arrval: -2147483648
-arrval: -2147483648
-arrval: -2147483648
-.
-
-
-#------------------------------------------------------------------------------
-# Unsigned Integer array 32-bit tests
-#
-@
-cuid: 0xee000004
-eid:  131
-type: ArrayUInt32
-flags: 0x0000
-arrval: 4294967295
-arrval: 4294967295
-arrval: 4294967295
-arrval: 4294967295
-.
-
-@
-cuid: 0xee000004
-eid:  132
-type: ArrayUInt32
-flags: 0x0000
-arrval: 0
-.
Binary file kerneltest/e32utils/hcrscripts/test/integer_hcrfile.dat has changed
Binary file kerneltest/e32utils/hcrscripts/test/integer_hcrfile.dat.img has changed
--- a/kerneltest/e32utils/hcrscripts/test/integer_test.txt	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,205 +0,0 @@
-#------------------------------------------------------------------------------
-# Integer Setting Test file for use with the 'hcrmd' tool.
-#
-
-#------------------------------------------------------------------------------
-# Signed Integer 32-bit tests
-#
-@
-cuid: 0xff000001
-eid:  1
-type: Int32
-flags: 0x0000
-intval: 2147483647
-.
-@
-cuid: 0xff000001
-eid:  2
-type: Int32
-flags: 0x0000
-intval: 0
-.
-@
-cuid: 0xff000001
-eid:  3
-type: Int32
-flags: 0x0000
-intval: -2147483648
-.
-
-#------------------------------------------------------------------------------
-# Signed Integer 16-bit tests
-#
-@
-cuid: 0xff000002
-eid:  11
-type: Int16
-flags: 0x0000
-intval: 32767
-.
-@
-cuid: 0xff000002
-eid:  12
-type: Int16
-flags: 0x0000
-intval: 0
-.
-@
-cuid: 0xff000002
-eid:  13
-type: Int16
-flags: 0x0000
-intval: -32768
-.
-
-#------------------------------------------------------------------------------
-# Signed Integer 8-bit tests
-#
-@
-cuid: 0xff000003
-eid:  21
-type: Int8
-flags: 0x0000
-intval: 127
-.
-
-@
-cuid: 0xff000003
-eid:  22
-type: Int8
-flags: 0x0000
-intval: 0
-.
-@
-cuid: 0xff000003
-eid:  23
-type: Int8
-flags: 0x0000
-intval: -128
-.
-
-#------------------------------------------------------------------------------
-# Unsigned Integer tests
-#
-@
-cuid: 0xff000004
-eid:  31
-type: UInt32
-flags: 0x0000
-intval: 4294967295
-.
-@
-cuid: 0xff000004
-eid:  32
-type: UInt16
-flags: 0x0000
-intval: 65535
-.
-@
-cuid: 0xff000004
-eid:  33
-type: UInt8
-flags: 0x0000
-intval: 255
-.
-
-#------------------------------------------------------------------------------
-# Boolean tests
-#
-@
-cuid: 0xff000005
-eid:  41
-type: Bool
-flags: 0x0000
-intval: 1
-.
-@
-cuid: 0xff000005
-eid:  42
-type: Bool
-flags: 0x0000
-intval: 0
-.
-
-
-#------------------------------------------------------------------------------
-# Linear Addrress tests
-#
-@
-cuid: 0xff000006
-eid:  51
-type: LinAddr
-flags: 0x0000
-hexval: 0x80000000
-.
-@
-cuid: 0xff000006
-eid:  52
-type: LinAddr
-flags: 0x0000
-hexval: 0x01008004
-.
-@
-cuid: 0xff000006
-eid:  53
-type: LinAddr
-flags: 0x0000
-hexval: 0x00000000
-.
-
-
-#------------------------------------------------------------------------------
-# Synatx tests
-#
-
-# Tool should cope with these
-@
-cuid: 0xffff0001
-eid:  101
-type: Int32
-intval: 1889025
-.
-@
-cuid: 0xffff0002
-eid:  102
-type: Int32
-intval: 5889025
-.
-
-# Missing fields - Tool should abort for these records
-# 
-#@
-#cuid: 0xffff0003
-#eid:  103
-#type: Int32
-#.
-#@
-#cuid: 0xffff0004
-#eid:  104
-#.
-#@
-#cuid: 0xffff0005
-#.
-#@
-#.
-
-# Incorrect Types - Tool should abort for these records
-# 
-#@
-#cuid: 0xffff0006
-#eid:  106
-#type: int32
-#intval: 1889025
-#.
-#@
-#cuid: 0xffff0007
-#eid:  107
-#type: Int
-#intval: 1889025
-#.
-#@
-#cuid: 0xffff0008
-#eid:  108
-#type: Int32ab
-#intval: 1889025
-#.
Binary file kerneltest/e32utils/hcrscripts/test/large_hcrfile.dat has changed
Binary file kerneltest/e32utils/hcrscripts/test/large_hcrfile.dat.img has changed
--- a/kerneltest/e32utils/hcrscripts/test/large_test.txt	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,378 +0,0 @@
-#------------------------------------------------------------------------------
-# Large Settings Test file for use with the 'hcrmd' tool.
-#
-
-#------------------------------------------------------------------------------
-# BinData tests
-#
-
-@
-cuid: 0x000000ff
-eid:  13
-type: BinData
-flags: 000000
-binval: 0E
-.
-@
-cuid: 0x000000ff
-eid:  23
-type: BinData
-flags: 000000
-binval: 0E 1F 
-.
-@
-cuid: 0x000000ff
-eid:  33
-type: BinData
-flags: 000000
-binval: 0E 1F BA
-.
-@
-cuid: 0x000000ff
-eid:  43
-type: BinData
-flags: 000000
-binval: 0E 1F BA 11
-.
-@
-cuid: 0x000000ff
-eid:  53
-type: BinData
-flags: 000000
-binval: 0E 1F BA 11 1F
-.
-@
-cuid: 0x000000ff
-eid:  63
-type: BinData
-flags: 000000
-binval: FF FF BA 0E 00 B4 
-.
-@
-cuid: 0x000000ff
-eid:  64
-type: BinData
-flags: 000000
-binval: FF FF BA 0E 00 B4 2E
-.
-@
-cuid: 0x000000ff
-eid:  73
-type: BinData
-flags: 000000
-binval: FF FF BA 0E 00 B4 2E AA
-.
-@
-cuid: 0x000000ff
-eid:  83
-type: BinData
-flags: 000000
-binval: FF FF BA 0E 00 B4 2E AA DD
-.
-@
-cuid: 0x000000ff
-eid:  93
-type: BinData
-flags: 000000
-binval: FF FF BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68
-binval: 69 73 20 70 72 6F 67 72 61 6D 20 63 61 6E 6E 6F 
-binval: 74 20 62 65 20 72 75 6E 20 69 6E 20 44 4F 53 20 
-binval: 6D 6F 64 65 2E 0D 0D 0A 24 00 00 00 00 00 00 0F
-binval: 0E 1F BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68 
-binval: 69 73 20 70 72 6F 67 72 61 6D 11 11 22 22 00 FF
-.
-
-@
-cuid: 0x000000ff
-eid:  103
-type: BinData
-flags: 000000
-binval: FF FF BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68
-binval: 69 73 20 70 72 6F 67 72 61 6D 20 63 61 6E 6E 6F 
-binval: 74 20 62 65 20 72 75 6E 20 69 6E 20 44 4F 53 20 
-binval: 6D 6F 64 65 2E 0D 0D 0A 24 00 00 00 00 00 00 0F
-binval: 0E 1F BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68 
-binval: 69 73 20 70 72 6F 67 72 61 6D 11 11 22 22 00 FF
-binval: FF FF BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68
-binval: 69 73 20 70 72 6F 67 72 61 6D 20 63 61 6E 6E 6F 
-binval: 74 20 62 65 20 72 75 6E 20 69 6E 20 44 4F 53 20 
-binval: 6D 6F 64 65 2E 0D 0D 0A 24 00 00 00 00 00 00 0F
-binval: 0E 1F BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68 
-binval: 69 73 20 70 72 6F 67 72 61 6D 11 11 22 22 00 FF
-binval: FF FF BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68
-binval: 69 73 20 70 72 6F 67 72 61 6D 20 63 61 6E 6E 6F 
-binval: 74 20 62 65 20 72 75 6E 20 69 6E 20 44 4F 53 20 
-binval: 6D 6F 64 65 2E 0D 0D 0A 24 00 00 00 00 00 00 0F
-binval: 0E 1F BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68 
-binval: 69 73 20 70 72 6F 67 72 61 6D 11 11 22 22 00 FF
-binval: FF FF BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68
-binval: 69 73 20 70 72 6F 67 72 61 6D 20 63 61 6E 6E 6F 
-binval: 74 20 62 65 20 72 75 6E 20 69 6E 20 44 4F 53 20 
-binval: 6D 6F 64 65 2E 0D 0D 0A 24 00 00 00 00 00 00 0F
-binval: 0E 1F BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68 
-binval: 69 73 20 70 72 6F 67 72 61 6D 11 11 22 22 00 FF
-binval: FF FF BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68
-binval: 69 73 20 70 72 6F 67 72 61 6D 20 63 61 6E 6E 6F 
-binval: 74 20 62 65 20 72 75 6E 20 69 6E 20 44 4F 53 20 
-binval: 6D 6F 64 65 2E 0D 0D 0A 24 00 00 00 00 00 00 0F
-binval: 0E 1F BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68 
-binval: 69 73 20 70 72 6F 67 72 61 6D 11 11 22 22 00 FF
-binval: FF FF BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68
-binval: 69 73 20 70 72 6F 67 72 61 6D 20 63 61 6E 6E 6F 
-.
-
-@
-cuid: 0x000000ff
-eid:  113
-type: BinData
-flags: 000000
-binval: FF FF BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68
-binval: 69 73 20 70 72 6F 67 72 61 6D 20 63 61 6E 6E 6F 
-binval: 74 20 62 65 20 72 75 6E 20 69 6E 20 44 4F 53 20 
-binval: 6D 6F 64 65 2E 0D 0D 0A 24 00 00 00 00 00 00 0F
-binval: 0E 1F BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68 
-binval: 69 73 20 70 72 6F 67 72 61 6D 11 11 22 22 00 FF
-binval: FF FF BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68
-binval: 69 73 20 70 72 6F 67 72 61 6D 20 63 61 6E 6E 6F 
-binval: 74 20 62 65 20 72 75 6E 20 69 6E 20 44 4F 53 20 
-binval: 6D 6F 64 65 2E 0D 0D 0A 24 00 00 00 00 00 00 0F
-binval: 0E 1F BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68 
-binval: 69 73 20 70 72 6F 67 72 61 6D 11 11 22 22 00 FF
-binval: FF FF BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68
-binval: 69 73 20 70 72 6F 67 72 61 6D 20 63 61 6E 6E 6F 
-binval: 74 20 62 65 20 72 75 6E 20 69 6E 20 44 4F 53 20 
-binval: 6D 6F 64 65 2E 0D 0D 0A 24 00 00 00 00 00 00 0F
-binval: 0E 1F BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68 
-binval: 69 73 20 70 72 6F 67 72 61 6D 11 11 22 22 00 FF
-binval: FF FF BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68
-binval: 69 73 20 70 72 6F 67 72 61 6D 20 63 61 6E 6E 6F 
-binval: 74 20 62 65 20 72 75 6E 20 69 6E 20 44 4F 53 20 
-binval: 6D 6F 64 65 2E 0D 0D 0A 24 00 00 00 00 00 00 0F
-binval: 0E 1F BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68 
-binval: 69 73 20 70 72 6F 67 72 61 6D 11 11 22 22 00 FF
-binval: FF FF BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68
-binval: 69 73 20 70 72 6F 67 72 61 6D 20 63 61 6E 6E 6F 
-binval: 74 20 62 65 20 72 75 6E 20 69 6E 20 44 4F 53 20 
-binval: 6D 6F 64 65 2E 0D 0D 0A 24 00 00 00 00 00 00 0F
-binval: 0E 1F BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68 
-binval: 69 73 20 70 72 6F 67 72 61 6D 11 11 22 22 00 FF
-binval: FF FF BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68
-binval: 69 73 20 70 72 6F 67 72 61 6D 20 63 61 6E 6E 6F  
-binval: 0E 1F BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68 
-binval: 69 73 20 70 72 6F 67 72 61 6D 11 11 22 22 00 FF
-binval: FF FF BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68
-binval: 69 73 20 70 72 6F 67 72 61 6D 20 63 61 6E 6E 6F  
-.
-
-#------------------------------------------------------------------------------
-# Text8 tests
-#
-
-# Length field tests
-#
-@
-cuid: 0x11223301
-eid:  1
-type: Text8
-flags: 0x0000
-strval: "Hello World!!"   
-.
-@
-cuid: 0x11223302
-eid:  2
-type: Text8
-flags: 0x0000
-strval: "Hell"   
-.
-@
-cuid: 0x11223303
-eid:  3
-type: Text8
-flags: 0x0000
-strval: "Hello World!!    "   
-.
-
-# strval field tests
-#
-@
-cuid: 0x11223304
-eid:  1
-type: Text8
-flags: 0x0000
-strval: ""   
-.
-@
-cuid: 0x11223305
-eid:  5
-type: Text8
-flags: 0x0000
-strval: "012345678901234567890123456789ab012345678901234567890123456789ab012345678901234567890123456789ab012345678901234567890123456789ab"
-.
-
-@
-cuid: 0x11223306
-eid:  6
-type: Text8
-flags: 0x0000
-strval: "012345678901234567890123456789ab012345678901234567890123456789ab012345678901234567890123456789ab012345678901234567890123456789ab"
-strval: "012345678901234567890123456789ab012345678901234567890123456789ab012345678901234567890123456789ab012345678901234567890123456789bc"
-strval: "012345678901234567890123456789ab012345678901234567890123456789ab012345678901234567890123456789ab012345678901234567890123456789cd"
-strval: "012345678901234567890123456789ab012345678901234567890123456789ab012345678901234567890123456789ab012345678901234567890123456789de" 
-.
-
-
-# strval field and padding tests
-#
-@
-cuid: 0x11223311
-eid:  128
-type: Text8
-flags: 0x0000
-strval: "A"   
-.
-@
-cuid: 0x11223312
-eid:  128
-type: Text8
-flags: 0x0000
-strval: "We"  
-. 
-@
-cuid: 0x11223313
-eid:  128
-type: Text8
-flags: 0x0000
-strval: "Car"   
-.
-@
-cuid: 0x11223314
-eid:  128
-type: Text8
-flags: 0x0000
-strval: "Cake"   
-.
-@
-cuid: 0x11223315
-eid:  128
-type: Text8
-flags: 0x0000
-strval: "1---A"
-.
-@
-cuid: 0x11223316
-eid:  128
-type: Text8
-flags: 0x0000
-strval: "1---We"  
-. 
-@
-cuid: 0x11223317
-eid:  128
-type: Text8
-flags: 0x0000
-strval: "1---Car"   
-.
-@
-cuid: 0x11223318
-eid:  128
-type: Text8
-flags: 0x0000
-strval: "1---Cake"   
-.
-@
-cuid: 0x11223319
-eid:  128
-type: Text8
-flags: 0x0000
-strval: "1---2---A"
-.
-@
-cuid: 0x1122331a 
-eid:  128
-type: Text8
-flags: 0x0000
-strval: "1---2---We"  
-. 
-@
-cuid: 0x1122331b
-eid:  128
-type: Text8
-flags: 0x0000
-strval: "1---2---Car"   
-.
-@
-cuid: 0x1122331c
-eid:  128
-type: Text8
-flags: 0x0000
-strval: "1---2---Cake"   
-.
-@
-cuid: 0x1122331d
-eid:  128
-type: Text8
-flags: 0x0000
-strval: "1---2---3---A"
-.
-@
-cuid: 0x1122331e
-eid:  128
-type: Text8
-flags: 0x0000
-strval: "1---2---3---We"  
-. 
-@
-cuid: 0x1122331f
-eid:  128
-type: Text8
-flags: 0x0000
-strval: "1---2---3---Car"   
-.
-@
-cuid: 0x11223320
-eid:  128
-type: Text8
-flags: 0x0000
-strval: "1---2---3---Cake"   
-.
-
-
-#------------------------------------------------------------------------------
-# UInt64 & Int64 tests
-#
-
-@
-cuid: 0x55667711
-eid:  91
-type: Int64
-flags: 0x0000
-binval: 00 00 00 00 00 00 00 80
-.
-@
-cuid: 0x55667711
-eid:  92
-type: Int64
-flags: 0x0000
-binval: 00 00 00 00 00 00 00 00
-.
-#@
-#cuid: 0x55667711
-#eid:  192
-#type: Int64
-#flags: 0x0000
-#binval: 00
-#.
-@
-cuid: 0x55667711
-eid:  93
-type: Int64
-flags: 0x0000
-binval: ff ff ff ff ff ff ff 7f 
-.
-@
-cuid: 0x55667711
-eid:  94
-type: UInt64
-flags: 0x0000
-binval: ff ff ff ff ff ff ff ff
-.
--- a/kerneltest/e32utils/nistsecurerng/include/cephes.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
-* Description: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-#ifndef _CEPHES_H_
-#define _CEPHES_H_
-
-double cephes_igamc(double a, double x);
-double cephes_igam(double a, double x);
-double cephes_lgam(double x);
-double cephes_p1evl(double x, double *coef, int N);
-double cephes_polevl(double x, double *coef, int N);
-double cephes_erf(double x);
-double cephes_erfc(double x);
-double cephes_normal(double x);
-
-#endif /*  _CEPHES_H_  */
--- a/kerneltest/e32utils/nistsecurerng/include/config.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
-* Description: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-#ifndef _CONFIG_H_
-#define	_CONFIG_H_
-
-//#define	WINDOWS32
-//#define	PROTOTYPES
-//#define	LITTLE_ENDIAN
-//#define	LOWHI
-
-/*
- * AUTO DEFINES (DON'T TOUCH!)
- */
-
-#ifndef	CSTRTD
-typedef char *CSTRTD;
-#endif
-#ifndef	BSTRTD
-typedef unsigned char *BSTRTD;
-#endif
-
-#ifndef	BYTE
-typedef unsigned char BYTE;
-#endif
-#ifndef	UINT
-typedef unsigned int UINT;
-#endif
-#ifndef	USHORT
-typedef unsigned short USHORT;
-#endif
-#ifndef	ULONG
-typedef unsigned long ULONG;
-#endif
-#ifndef	DIGIT
-typedef USHORT DIGIT;	/* 16-bit word */
-#endif
-#ifndef	DBLWORD
-typedef ULONG DBLWORD;  /* 32-bit word */
-#endif
-
-#ifndef	WORD64
-typedef ULONG WORD64[2];  /* 64-bit word */
-#endif
-
-#endif /* _CONFIG_H_ */
-
-#if defined(__cplusplus)
-}
-#endif
--- a/kerneltest/e32utils/nistsecurerng/include/decls.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-#ifndef _DECLS_H_
-#define _DECLS_H_ 
-
-#include "../include/defs.h"
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-                   G L O B A L   D A T A  S T R U C T U R E S 
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-BitSequence	*epsilon;				// BIT STREAM
-TP			tp;						// TEST PARAMETER STRUCTURE
-FILE		*stats[NUMOFTESTS+1];	// FILE OUTPUT STREAM
-FILE		*results[NUMOFTESTS+1];	// FILE OUTPUT STREAM
-FILE		*freqfp;				// FILE OUTPUT STREAM
-FILE		*summary;				// FILE OUTPUT STREAM
-int			testVector[NUMOFTESTS+1];
-
-char	generatorDir[NUMOFGENERATORS][20] = { "AlgorithmTesting", "LCG", "QCG1", "QCG2","CCG", "XOR",
-			"MODEXP", "BBS", "MS", "G-SHA1", "HASH_DRBG" };
-				
-char	testNames[NUMOFTESTS+1][32] = { " ", "Frequency", "BlockFrequency", "CumulativeSums", "Runs", "LongestRun", "Rank",
-			"FFT", "NonOverlappingTemplate", "OverlappingTemplate", "Universal", "ApproximateEntropy", "RandomExcursions",
-			"RandomExcursionsVariant", "Serial", "LinearComplexity" };
-
-#endif // _DECLS_H_
-
--- a/kerneltest/e32utils/nistsecurerng/include/defs.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-                       D E B U G G I N G  A I D E S
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _DEFS_H_
-#define _DEFS_H_
-
-#include "config.h"
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-                              M A C R O S
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-#define MAX(x,y)             ((x) <  (y)  ? (y)  : (x))
-#define MIN(x,y)             ((x) >  (y)  ? (y)  : (x))
-#define isNonPositive(x)     ((x) <= 0.e0 ?   1  : 0)
-#define isPositive(x)        ((x) >  0.e0 ?   1 : 0)
-#define isNegative(x)        ((x) <  0.e0 ?   1 : 0)
-#define isGreaterThanOne(x)  ((x) >  1.e0 ?   1 : 0)
-#define isZero(x)            ((x) == 0.e0 ?   1 : 0)
-#define isOne(x)             ((x) == 1.e0 ?   1 : 0)
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
-                         G L O B A L  C O N S T A N T S
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-#define ALPHA							0.01	/* SIGNIFICANCE LEVEL */
-#define MAXNUMOFTEMPLATES				148		/* APERIODIC TEMPLATES: 148=>temp_length=9 */
-#define NUMOFTESTS						15		/* MAX TESTS DEFINED  */
-#define NUMOFGENERATORS					11		/* MAX PRNGs */
-#define MAXFILESPERMITTEDFORPARTITION	148
-#define	TEST_FREQUENCY					1
-#define	TEST_BLOCK_FREQUENCY			2
-#define	TEST_CUSUM						3
-#define	TEST_RUNS						4
-#define	TEST_LONGEST_RUN				5
-#define	TEST_RANK						6
-#define	TEST_FFT						7
-#define	TEST_NONPERIODIC				8
-#define	TEST_OVERLAPPING				9
-#define	TEST_UNIVERSAL					10
-#define	TEST_APEN						11
-#define	TEST_RND_EXCURSION				12
-#define	TEST_RND_EXCURSION_VAR			13
-#define	TEST_SERIAL						14
-#define	TEST_LINEARCOMPLEXITY			15
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-                   G L O B A L   D A T A  S T R U C T U R E S
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-typedef unsigned char	BitSequence;
-
-typedef struct _testParameters {
-	int		n;
-	int		blockFrequencyBlockLength;
-	int		nonOverlappingTemplateBlockLength;
-	int		overlappingTemplateBlockLength;
-	int		serialBlockLength;
-	int		linearComplexitySequenceLength;
-	int		approximateEntropyBlockLength;
-	int		numOfBitStreams;
-} TP;
-
-#endif // _DEFS_H_
-
--- a/kerneltest/e32utils/nistsecurerng/include/externs.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-#ifndef _EXTERNS_H_
-#define _EXTERNS_H_
-
-#include "../include/defs.h"
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-                   G L O B A L   D A T A  S T R U C T U R E S 
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-extern BitSequence	*epsilon;				// BIT STREAM
-extern TP			tp;						// TEST PARAMETER STRUCTURE
-extern FILE			*stats[NUMOFTESTS+1];	// FILE OUTPUT STREAM
-extern FILE			*results[NUMOFTESTS+1];	// FILE OUTPUT STREAM
-extern FILE			*freqfp;				// FILE OUTPUT STREAM
-extern FILE			*summary;				// FILE OUTPUT STREAM
-extern int			testVector[NUMOFTESTS+1];
-
-extern char	generatorDir[NUMOFGENERATORS][20];
-extern char	testNames[NUMOFTESTS+1][32];
-
-#endif // _EXTERNS_H_
-
--- a/kerneltest/e32utils/nistsecurerng/include/generators.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-#ifndef _GENERATORS_H_
-#define _GENERATORS_H_
-//#include	"../include/sha.h"
-
-void	lcg();
-double	lcg_rand(int, double, double*, int);
-void	quadRes1();
-void	quadRes2();
-void	cubicRes();
-void	exclusiveOR();
-void	modExp();
-void	bbs();
-void	micali_schnorr();
-void	SHA1();
-void    HASH_DRBG();
-
-/* The circular shifts. */
-#define CS1(x) ((((ULONG)x)<<1)|(((ULONG)x)>>31))
-#define CS5(x)  ((((ULONG)x)<<5)|(((ULONG)x)>>27))
-#define CS30(x)  ((((ULONG)x)<<30)|(((ULONG)x)>>2))
-
-/* K constants */
-
-#define K0  0x5a827999L
-#define K1  0x6ed9eba1L
-#define K2  0x8f1bbcdcL
-#define K3  0xca62c1d6L
-
-#define f1(x,y,z)   ( (x & (y ^ z)) ^ z )
-
-#define f3(x,y,z)   ( (x & ( y ^ z )) ^ (z & y) )
-
-#define f2(x,y,z)   ( x ^ y ^ z )                           /* Rounds 20-39 */
-
-#define  expand(x)  Wbuff[x%16] = CS1(Wbuff[(x - 3)%16 ] ^ Wbuff[(x - 8)%16 ] ^ Wbuff[(x - 14)%16] ^ Wbuff[x%16])
-
-#define sub1Round1(count)      { \
-	 temp = CS5(A) + f1(B, C, D) + E + Wbuff[count] + K0; \
-	 E = D; \
-	 D = C; \
-	 C = CS30( B ); \
-	 B = A; \
-	 A = temp; \
-	 } \
-
-#define sub2Round1(count)   \
-	 { \
-	 expand(count); \
-	 temp = CS5(A) + f1(B, C, D) + E + Wbuff[count%16] + K0; \
-	 E = D; \
-	 D = C; \
-	 C = CS30( B ); \
-	 B = A; \
-	 A = temp; \
-	} \
-
-#define Round2(count)     \
-	 { \
-	 expand(count); \
-	 temp = CS5( A ) + f2( B, C, D ) + E + Wbuff[count%16] + K1;  \
-	 E = D; \
-	 D = C; \
-	 C = CS30( B ); \
-	 B = A; \
-	 A = temp;  \
-	 } \
-
-#define Round3(count)    \
-	 { \
-	 expand(count); \
-	 temp = CS5( A ) + f3( B, C, D ) + E + Wbuff[count%16] + K2; \
-	 E = D; \
-	 D = C; \
-	 C = CS30( B ); \
-	 B = A; \
-	 A = temp; \
-	 }
-
-#define Round4(count)    \
-	 { \
-	 expand(count); \
-	 temp = CS5( A ) + f2( B, C, D ) + E + Wbuff[count%16] + K3; \
-	 E = D; \
-	 D = C; \
-	 C = CS30( B ); \
-	 B = A; \
-	 A = temp; \
-	 }
-
-#endif
--- a/kerneltest/e32utils/nistsecurerng/include/genutils.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-#ifndef _GENUTILS_H_
-#define _GENUTILS_H_
-
-#include "openc.h"
-#include "config.h"
-
-typedef struct _MP_struct {
-	int		size;	/*  in bytes  */
-	int		bitlen;	/*  in bits, duh  */
-	BYTE	*val;
-	} MP;
-
-#define	FREE(A)	if ( (A) ) { free((A)); (A) = NULL; }
-#define	ASCII2BIN(ch)	( (((ch) >= '0') && ((ch) <= '9')) ? ((ch) - '0') : (((ch) >= 'A') && ((ch) <= 'F')) ? ((ch) - 'A' + 10) : ((ch) - 'a' + 10) )
-
-#ifndef EXPWD
-#define	EXPWD		((DBLWORD)1<<NUMLEN)
-#endif
-
-#define	sniff_bit(ptr,mask)		(*(ptr) & mask)
-
-/*
- * Function Declarations
- */
-int		greater(BYTE *x, BYTE *y, int l);
-int		less(BYTE *x, BYTE *y, int l);
-BYTE	bshl(BYTE *x, int l);
-void	bshr(BYTE *x, int l);
-int		Mult(BYTE *A, BYTE *B, int LB, BYTE *C, int LC);
-void	ModSqr(BYTE *A, BYTE *B, int LB, BYTE *M, int LM);
-void	ModMult(BYTE *A, BYTE *B, int LB, BYTE *C, int LC, BYTE *M, int LM);
-void	smult(BYTE *A, BYTE b, BYTE *C, int L);
-void	Square(BYTE *A, BYTE *B, int L);
-void	ModExp(BYTE *A, BYTE *B, int LB, BYTE *C, int LC, BYTE *M, int LM);
-int		DivMod(BYTE *x, int lenx, BYTE *n, int lenn, BYTE *quot, BYTE *rem);
-void	Mod(BYTE *x, int lenx, BYTE *n, int lenn);
-void	Div(BYTE *x, int lenx, BYTE *n, int lenn);
-void	sub(BYTE *A, int LA, BYTE *B, int LB);
-int		negate(BYTE *A, int L);
-BYTE	add(BYTE *A, int LA, BYTE *B, int LB);
-void	prettyprintBstr(char *S, BYTE *A, int L);
-void	byteReverse(ULONG *buffer, int byteCount);
-void	ahtopb (char *ascii_hex, BYTE *p_binary, int bin_len);
-
-#endif  /* _GENUTILS_H_ */
--- a/kerneltest/e32utils/nistsecurerng/include/matrix.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-       R A N K  A L G O R I T H M  F U N C T I O N  P R O T O T Y P E S 
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _MATRIX_H_
-#define _MATRIX_H_
-
-int				computeRank(int M, int Q, BitSequence **matrix);
-void			perform_elementary_row_operations(int flag, int i, int M, int Q, BitSequence **A);
-int				find_unit_element_and_swap(int flag, int i, int M, int Q, BitSequence **A);
-int				swap_rows(int i, int index, int Q, BitSequence **A);
-int				determine_rank(int m, int M, int Q, BitSequence **A);
-BitSequence**	create_matrix(int M, int Q);
-void			display_matrix(int M, int Q, BitSequence **m);
-void			def_matrix(int M, int Q, BitSequence **m,int k);
-void			delete_matrix(int M, BitSequence **matrix);
-
-#endif // _MATRIX_H_
--- a/kerneltest/e32utils/nistsecurerng/include/stat_fncs.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-     S T A T I S T I C A L  T E S T  F U N C T I O N  P R O T O T Y P E S 
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-#ifndef _STAT_FNCS_H_
-#define _STAT_FNCS_H_
-
-void	Frequency(int n);
-void	BlockFrequency(int M, int n);
-void	CumulativeSums(int n);
-void	Runs(int n);
-void	LongestRunOfOnes(int n);
-void	Rank(int n);
-void	DiscreteFourierTransform(int n);
-void	NonOverlappingTemplateMatchings(int m, int n);
-void	OverlappingTemplateMatchings(int m, int n);
-void	Universal(int n);
-void	ApproximateEntropy(int m, int n);
-void	RandomExcursions(int n);
-void	RandomExcursionsVariant(int n);
-void	LinearComplexity(int M, int n);
-void	Serial(int m, int n);
-
-#endif // _STAT_FNCS_H_
-
--- a/kerneltest/e32utils/nistsecurerng/include/utilities.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-              U T I L I T Y  F U N C T I O N  P R O T O T Y P E S 
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _UTILITIES_H_
-#define _UTILITIES_H_
-
-int		displayGeneratorOptions();
-int		generatorOptions(char** streamFile);
-void	chooseTests();
-void	fixParameters();
-void	fileBasedBitStreams(char *streamFile);
-void	readBinaryDigitsInASCIIFormat(FILE *fp, char *streamFile);
-void	readHexDigitsInBinaryFormat(FILE *fp);
-int		convertToBits(const BYTE *x, int xBitLength, int bitsNeeded, int *num_0s, int *num_1s, int *bitsRead);
-void	openOutputStreams(int option);
-void    InitializeNISTSuiteL(int option);
-void    ReleaseResources();
-void	invokeTestSuite(int option, char *streamFile);
-void	nist_test_suite();
-void    GetNextTemplateItem(BitSequence aBitSequence[]);
-
-
-extern CConsoleBase*    gConsole;
-extern TBuf8<KMaxFileName>       gLogFilePath;
-
-extern TInt gTemplateIndex;
-
-const TInt KMaxBit = 32;
-
-
-
-// inline functions
-inline void ResetTemplateIndex()
-    {
-    gTemplateIndex = 1;
-    }
-
-
-#endif // _UTILITIES_H_
-
--- a/kerneltest/e32utils/nistsecurerng/include/utils/openc.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +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 "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 _OPENC_H_
-#define _OPENC_H_
-
-#include <e32base.h>
-#include <e32std.h>
-#include <e32cons.h>            // Console
-#include <f32file.h>
-
-#include <e32math.h>
-
-extern RFs gFileSession;
-
-// Math functions
-double log(double);
-double exp(double);
-double fabs(double);
-double floor(double);
-double sqrt(double);
-double erf(double);
-double erfc(double);
-
-double pow(double, double);
-
-// Math trigonometric functions
-double sin(double);
-double cos(double);
-
-
-// data types
-typedef RFile FILE;
-#define EOF (-1)
-typedef TUint32     u_int32_t;
-typedef TInt32      int32_t;
-
-#define SEEK_SET    0   /* set file offset to offset */
-#define SEEK_CUR    1   /* set file offset to current plus offset */
-#define SEEK_END    2   /* set file offset to EOF plus offset */
-
-
-// stdio functions
-int     printf(const char * __restrict, ...);
-int     scanf(const char * __restrict, ...);
-int     sprintf(char * __restrict, const char * __restrict, ...);
-int     puts ( const char * str );
-int     putchar ( int character );
-char*   strcpy(char* aDest, const char* aSrc);
-
-FILE    *fopen(const char * __restrict, const char * __restrict);
-int     fclose(FILE *);
-int     fprintf(FILE * __restrict, const char * __restrict, ...);
-int     fscanf(FILE * __restrict, const char * __restrict, ...);
-TUint32  fread(void * __restrict, TUint32, TUint32, FILE * __restrict);
-int     fseek(FILE *, long, int);
-
-int     fflush(FILE *);
-
-// stdlib functions
-void*   calloc(TUint32, TUint32);
-void    free(void *);
-
-void    qsort (void* base, TUint32 nmemb, TUint32 size, int (*compar)(const void*, const void*));
-
-void    exit (int status);
-
-// Other utility functions
-void ReadStringFromConsole(TDes& aString);
-TInt ReadIntL(TInt& aValue);
-
-#endif /* _OPENC_H_ */
--- a/kerneltest/e32utils/nistsecurerng/src/approximateEntropy.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-#include "openc.h"
-#include "../include/externs.h"
-#include "../include/utilities.h"
-#include "../include/cephes.h"  
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-                A P P R O X I M A T E  E N T R O P Y   T E S T
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-void
-ApproximateEntropy(int m, int n)
-{
-	int				i, j, k, r, blockSize, seqLength, powLen, index;
-	double			sum, numOfBlocks, ApEn[2], apen, chi_squared, p_value;
-	unsigned int	*P;
-	
-	fprintf(stats[TEST_APEN], "\t\t\tAPPROXIMATE ENTROPY TEST\n");
-	fprintf(stats[TEST_APEN], "\t\t--------------------------------------------\n");
-	fprintf(stats[TEST_APEN], "\t\tCOMPUTATIONAL INFORMATION:\n");
-	fprintf(stats[TEST_APEN], "\t\t--------------------------------------------\n");
-	fprintf(stats[TEST_APEN], "\t\t(a) m (block length)    = %d\n", m);
-
-	seqLength = n;
-	r = 0;
-	
-	for ( blockSize=m; blockSize<=m+1; blockSize++ ) {
-		if ( blockSize == 0 ) {
-			ApEn[0] = 0.00;
-			r++;
-		}
-		else {
-			numOfBlocks = (double)seqLength;
-			powLen = (int)pow(2, blockSize+1)-1;
-			if ( (P = (unsigned int*)calloc(powLen,sizeof(unsigned int)))== NULL ) {
-				fprintf(stats[TEST_APEN], "ApEn:  Insufficient memory available.\n");
-				return;
-			}
-			for ( i=1; i<powLen-1; i++ )
-				P[i] = 0;
-			for ( i=0; i<numOfBlocks; i++ ) { /* COMPUTE FREQUENCY */
-				k = 1;
-				for ( j=0; j<blockSize; j++ ) {
-					k <<= 1;
-					if ( (int)epsilon[(i+j) % seqLength] == 1 )
-						k++;
-				}
-				P[k-1]++;
-			}
-			/* DISPLAY FREQUENCY */
-			sum = 0.0;
-			index = (int)pow(2, blockSize)-1;
-			for ( i=0; i<(int)pow(2, blockSize); i++ ) {
-				if ( P[index] > 0 )
-					sum += P[index]*log(P[index]/numOfBlocks);
-				index++;
-			}
-			sum /= numOfBlocks;
-			ApEn[r] = sum;
-			r++;
-			free(P);
-		}
-	}
-	apen = ApEn[0] - ApEn[1];
-	
-	chi_squared = 2.0*seqLength*(log(2) - apen);
-	p_value = cephes_igamc(pow(2, m-1), chi_squared/2.0);
-	
-	fprintf(stats[TEST_APEN], "\t\t(b) n (sequence length) = %d\n", seqLength);
-	fprintf(stats[TEST_APEN], "\t\t(c) Chi^2               = %f\n", chi_squared);
-	fprintf(stats[TEST_APEN], "\t\t(d) Phi(m)	       = %f\n", ApEn[0]);
-	fprintf(stats[TEST_APEN], "\t\t(e) Phi(m+1)	       = %f\n", ApEn[1]);
-	fprintf(stats[TEST_APEN], "\t\t(f) ApEn                = %f\n", apen);
-	fprintf(stats[TEST_APEN], "\t\t(g) Log(2)              = %f\n", log(2.0));
-	fprintf(stats[TEST_APEN], "\t\t--------------------------------------------\n");
-
-	if ( m > (int)(log(seqLength)/log(2)-5) ) {
-		fprintf(stats[TEST_APEN], "\t\tNote: The blockSize = %d exceeds recommended value of %d\n", m,
-			MAX(1, (int)(log(seqLength)/log(2)-5)));
-		fprintf(stats[TEST_APEN], "\t\tResults are inaccurate!\n");
-		fprintf(stats[TEST_APEN], "\t\t--------------------------------------------\n");
-	}
-	
-	fprintf(stats[TEST_APEN], "%s\t\tp_value = %f\n\n", p_value < ALPHA ? "FAILURE" : "SUCCESS", p_value);
-	fprintf(results[TEST_APEN], "%f\n", p_value);
-}
--- a/kerneltest/e32utils/nistsecurerng/src/assess.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,419 +0,0 @@
-/*
-* Portions 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 "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: 
-*/
-
-
-/* --------------------------------------------------------------------------
-   Title       :  The NIST Statistical Test Suite
-
-   Date        :  December 1999
-
-   Programmer  :  Juan Soto
-
-   Summary     :  For use in the evaluation of the randomness of bitstreams
-                  produced by cryptographic random number generators.
-
-   Package     :  Version 1.0
-
-   Copyright   :  (c) 1999 by the National Institute Of Standards & Technology
-
-   History     :  Version 1.0 by J. Soto, October 1999
-                  Revised by J. Soto, November 1999
-                  Revised by Larry Bassham, March 2008
-
-   Keywords    :  Pseudorandom Number Generator (PRNG), Randomness, Statistical 
-                  Tests, Complementary Error functions, Incomplete Gamma 
-                  Function, Random Walks, Rank, Fast Fourier Transform, 
-                  Template, Cryptographically Secure PRNG (CSPRNG),
-                  Approximate Entropy (ApEn), Secure Hash Algorithm (SHA-1), 
-                  Blum-Blum-Shub (BBS) CSPRNG, Micali-Schnorr (MS) CSPRNG, 
-
-   Source      :  David Banks, Elaine Barker, James Dray, Allen Heckert, 
-                  Stefan Leigh, Mark Levenson, James Nechvatal, Andrew Rukhin, 
-                  Miles Smid, Juan Soto, Mark Vangel, and San Vo.
-
-   Technical
-   Assistance  :  Larry Bassham, Ron Boisvert, James Filliben, Daniel Lozier,
-                  and Bert Rust.
-
-   Warning     :  Portability Issues.
-
-   Limitation  :  Amount of memory allocated for workspace.
-
-   Restrictions:  Permission to use, copy, and modify this software without 
-                  fee is hereby granted, provided that this entire notice is 
-                  included in all copies of any software which is or includes
-                  a copy or modification of this software and in all copies 
-                  of the supporting documentation for such software.
-   -------------------------------------------------------------------------- */
-//system include
-#include <e32base.h>
-#include <e32std.h>
-#include <e32cons.h>
-
-// user include
-#include "openc.h"
-#include "../include/decls.h"
-#include "../include/cephes.h"  
-#include "../include/utilities.h"
-#include "../include/generators.h"
-
-typedef int (*CompareFnType)(const void*, const void*);
-
-void	partitionResultFile(int numOfFiles, int numOfSequences, int option, int testNameID);
-void	postProcessResults(int option);
-int		cmp(const double *a, const double *b);
-int		computeMetrics(char *s, int test);
-
-int
-StartNISTTest()
-{
-	int		i;
-	int		option = 10;			/* TEMPLATE LENGTH/STREAM LENGTH/GENERATOR*/
-	char	*streamFile = NULL;	/* STREAM FILENAME     */
-	
-
-	tp.n = 1000000; // length of the individual bit stream(s) to be processed
-	tp.blockFrequencyBlockLength = 128;
-	tp.nonOverlappingTemplateBlockLength = 9;
-	tp.overlappingTemplateBlockLength = 9;
-	tp.approximateEntropyBlockLength = 10;
-	tp.serialBlockLength = 16;
-	tp.linearComplexitySequenceLength = 500;
-	tp.numOfBitStreams = 100;
-	chooseTests();
-	fixParameters();
-	openOutputStreams(option);
-	invokeTestSuite(option, streamFile);
-	fclose(freqfp);
-	for( i=1; i<=NUMOFTESTS; i++ ) {
-		if ( stats[i] != NULL )
-			fclose(stats[i]);
-		if ( results[i] != NULL )
-			fclose(results[i]);
-	}
-	if ( (testVector[0] == 1) || (testVector[TEST_CUSUM] == 1) ) 
-		partitionResultFile(2, tp.numOfBitStreams, option, TEST_CUSUM);
-	if ( (testVector[0] == 1) || (testVector[TEST_NONPERIODIC] == 1) ) 
-		partitionResultFile(MAXNUMOFTEMPLATES, tp.numOfBitStreams, option, TEST_NONPERIODIC);
-	if ( (testVector[0] == 1) || (testVector[TEST_RND_EXCURSION] == 1) )
-		partitionResultFile(8, tp.numOfBitStreams, option, TEST_RND_EXCURSION);
-	if ( (testVector[0] == 1) || (testVector[TEST_RND_EXCURSION_VAR] == 1) )
-		partitionResultFile(18, tp.numOfBitStreams, option, TEST_RND_EXCURSION_VAR);
-	if ( (testVector[0] == 1) || (testVector[TEST_SERIAL] == 1) )
-		partitionResultFile(2, tp.numOfBitStreams, option, TEST_SERIAL);
-	fprintf(summary, "------------------------------------------------------------------------------\n");
-	fprintf(summary, "RESULTS FOR THE UNIFORMITY OF P-VALUES AND THE PROPORTION OF PASSING SEQUENCES\n");
-	fprintf(summary, "------------------------------------------------------------------------------\n");
-	fprintf(summary, " C1  C2  C3  C4  C5  C6  C7  C8  C9 C10  P-VALUE  PROPORTION  STATISTICAL TEST\n");
-	fprintf(summary, "------------------------------------------------------------------------------\n");
-	postProcessResults(option);
-	fclose(summary);
-
-	return 1;
-    }
-
-void
-partitionResultFile(int numOfFiles, int numOfSequences, int option, int testNameID)
-{ 
-	int		i, k, m, j, start, end, num, numread;
-	float	c;
-	FILE	**fp = (FILE **)calloc(numOfFiles+1, sizeof(FILE *));
-	int		*results = (int *)calloc(numOfFiles, sizeof(int *));
-	char	*s[MAXFILESPERMITTEDFORPARTITION];
-	char	resultsDir[200];
-	
-	for ( i=0; i<MAXFILESPERMITTEDFORPARTITION; i++ )
-		s[i] = (char*)calloc(200, sizeof(char));
-	
-	sprintf(resultsDir, "%s\\experiments\\%s\\%s\\results", gLogFilePath.PtrZ(), generatorDir[option], testNames[testNameID]);
-	
-	if ( (fp[numOfFiles] = fopen(resultsDir, "r")) == NULL ) {
-		printf("%s", resultsDir);
-		printf(" -- file not found. Exiting program.\n");
-		exit(-1);
-	}
-	
-	for ( i=0; i<numOfFiles; i++ ) 
-	    {
-		sprintf(s[i], "%s\\experiments\\%s\\%s\\data%d", gLogFilePath.PtrZ(), generatorDir[option], testNames[testNameID], i+1);
-        }
-	numread = 0;
-	m = numOfFiles/20;
-	if ( (numOfFiles%20) != 0 )
-		m++;
-	for ( i=0; i<numOfFiles; i++ ) {
-		if ( (fp[i] = fopen(s[i], "w")) == NULL ) {
-			printf("%s", s[i]);
-			printf(" -- file not found. Exiting program.\n");
-			exit(-1);
-		}
-		fclose(fp[i]);
-	}
-	for ( num=0; num<numOfSequences; num++ ) {
-		for ( k=0; k<m; k++ ) { 			/* FOR EACH BATCH */
-			
-			start = k*20;		/* BOUNDARY SEGMENTS */
-			end   = k*20+19;
-			if ( k == (m-1) )
-				end = numOfFiles-1;
-			
-			for ( i=start; i<=end; i++ ) {		/* OPEN FILE */
-				if ( (fp[i] = fopen(s[i], "a")) == NULL ) {
-					printf("%s", s[i]);
-					printf(" -- file not found. Exiting program.\n");
-					exit(-1);
-				}
-			}
-			
-			for ( j=start; j<=end; j++ ) {		/* POPULATE FILE */
-				fscanf(fp[numOfFiles], "%f", &c);
-				fprintf(fp[j], "%f\n", c);
-				numread++;
-			}
-
-			for ( i=start; i<=end; i++ )		/* CLOSE FILE */
-				fclose(fp[i]);
-		}
-	}
-	fclose(fp[numOfFiles]);
-	for ( i=0; i<MAXFILESPERMITTEDFORPARTITION; i++ )
-		free(s[i]);
-	
-	free(fp);
-	free(results);
-	return;
-}
-
-int
-cmp(const double *a, const double *b)
-{
-	if ( *a < *b )
-		return -1;
-	if ( *a == *b )
-		return 0;
-	return 1;
-}
-
-void
-postProcessResults(int option)
-{
-	int    i, k;
-	int    randomExcursionSampleSize = 0;
-	int    generalSampleSize = 0;
-	int		case1, case2, numOfFiles = 2;
-	double	passRate;
-	char	s[200];
-	
-	for ( i=1; i<=NUMOFTESTS; i++ ) {		// FOR EACH TEST
-		if ( testVector[i] ) {
-			// SPECIAL CASES -- HANDLING MULTIPLE FILES FOR A SINGLE TEST
-			if ( ((i == TEST_CUSUM) && testVector[TEST_CUSUM] ) ||
-				 ((i == TEST_NONPERIODIC) && testVector[TEST_NONPERIODIC] ) ||
-				 ((i == TEST_RND_EXCURSION) && testVector[TEST_RND_EXCURSION]) ||
-				 ((i == TEST_RND_EXCURSION_VAR) && testVector[TEST_RND_EXCURSION_VAR]) || 
-				 ((i == TEST_SERIAL) && testVector[TEST_SERIAL]) ) {
-				
-				if ( (i == TEST_NONPERIODIC) && testVector[TEST_NONPERIODIC] )  
-					numOfFiles = MAXNUMOFTEMPLATES;
-				else if ( (i == TEST_RND_EXCURSION) && testVector[TEST_RND_EXCURSION] ) 
-					numOfFiles = 8;
-				else if ( (i == TEST_RND_EXCURSION_VAR) && testVector[TEST_RND_EXCURSION_VAR] ) 
-					numOfFiles = 18;
-				else
-					numOfFiles = 2;
-				for ( k=0; k<numOfFiles; k++ ) {
-					if ( k < 10 )
-						sprintf(s, "%s\\experiments\\%s\\%s\\data%1d", gLogFilePath.PtrZ(), generatorDir[option], testNames[i], k+1);
-					else if ( k < 100 )
-						sprintf(s, "%s\\experiments\\%s\\%s\\data%2d", gLogFilePath.PtrZ(), generatorDir[option], testNames[i], k+1);
-					else
-						sprintf(s, "%s\\experiments\\%s\\%s\\data%3d", gLogFilePath.PtrZ(), generatorDir[option], testNames[i], k+1);
-					if ( (i == TEST_RND_EXCURSION) || (i == TEST_RND_EXCURSION_VAR) ) 
-						randomExcursionSampleSize = computeMetrics(s,i);
-					else
-						generalSampleSize = computeMetrics(s,i);
-				}
-			}
-			else {
-				sprintf(s, "%s\\experiments\\%s\\%s\\results", gLogFilePath.PtrZ(), generatorDir[option], testNames[i]);
-				generalSampleSize = computeMetrics(s,i);
-			}
-		}
-	}
-
-	fprintf(summary, "\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n");
-	case1 = 0;
-	case2 = 0;
-	if ( testVector[TEST_RND_EXCURSION] || testVector[TEST_RND_EXCURSION_VAR] ) 
-		case2 = 1;
-	for ( i=1; i<=NUMOFTESTS; i++ ) {
-		if ( testVector[i] && (i != TEST_RND_EXCURSION) && (i != TEST_RND_EXCURSION_VAR) ) {
-			case1 = 1;
-			break;
-		}
-	}
-	if ( case1 ) {
-		if ( generalSampleSize == 0 ) {
-			fprintf(summary, "The minimum pass rate for each statistical test with the exception of the\n");
-			fprintf(summary, "random excursion (variant) test is undefined.\n\n");
-		}
-		else {
-			passRate = 0.99-3.0*sqrt(0.01*(1.0-ALPHA)/(double)generalSampleSize);
-			fprintf(summary, "The minimum pass rate for each statistical test with the exception of the\n");
-			fprintf(summary, "random excursion (variant) test is approximately = %f for a\n", generalSampleSize ? passRate : 0.0);
-			fprintf(summary, "sample size = %d binary sequences.\n\n", generalSampleSize);
-		}
-	}
-	if ( case2 ) {
-		if ( randomExcursionSampleSize == 0 )
-			fprintf(summary, "The minimum pass rate for the random excursion (variant) test is undefined.\n\n");
-		else {
-			passRate = 0.99-3.0*sqrt(0.01*(1.0-ALPHA)/(double)randomExcursionSampleSize);
-			fprintf(summary, "The minimum pass rate for the random excursion (variant) test\n");
-			fprintf(summary, "is approximately %f for a sample size = %d binary sequences.\n\n", passRate, randomExcursionSampleSize);
-		}
-	}
-	fprintf(summary, "For further guidelines construct a probability table using the MAPLE program\n");
-	fprintf(summary, "provided in the addendum section of the documentation.\n");
-	fprintf(summary, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n");
-}
-
-int
-computeMetrics(char *s, int test)
-{
-	int		j, pos, count, sampleSize, expCount;
-	int		freqPerBin[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-	double	*A = NULL;
-	double  *T = NULL;
-	double  chi2, proportion, uniformity;
-	float	c;
-	FILE	*fp = NULL;
-
-	if ( (fp = fopen(s, "r")) == NULL ) {
-		printf("%s",s);
-		printf(" -- file not found. Exiting program.\n");
-		exit(-1);
-	}
-	
-	/* Compute Metric 1: Proportion of Passing Sequences */
-	
-	count = 0; 		
-	sampleSize = tp.numOfBitStreams;
-	
-	if ( (test == TEST_RND_EXCURSION) || (test == TEST_RND_EXCURSION_VAR) ) { /* Special Case: Random Excursion Tests */
-		if ( (T = (double *)calloc(tp.numOfBitStreams, sizeof(double))) == NULL ) {
-			printf("Final Analysis Report aborted due to insufficient workspace\n");
-			// Perform cleanup before returning
-			fclose(fp);
-			return 0;
-		}
-		for ( j=0; j<sampleSize; j++ ) {
-			fscanf(fp, "%f", &c);
-			if ( c > 0.000000 )
-				T[count++] = c;
-		}
-
-		if ( (A = (double *)calloc(count, sizeof(double))) == NULL ) {
-			printf("Final Analysis Report aborted due to insufficient workspace\n");
-            // Perform cleanup before returning
-            fclose(fp);
-            free(T);
-			return 0;
-		}
-
-		for ( j=0; j<count; j++ )
-			A[j] = T[j];
-		
-		sampleSize = count;
-		count = 0;
-		for ( j=0; j<sampleSize; j++ )
-			if ( A[j] < ALPHA )
-				count++;
-		free(T);
-		T = NULL;
-	}
-	else {
-		if ( (A = (double *)calloc(sampleSize, sizeof(double))) == NULL ) {
-			printf("Final Analysis Report aborted due to insufficient workspace\n");
-            // Perform cleanup before returning
-            fclose(fp);
-			return 0;
-		}
-		for ( j=0; j<sampleSize; j++ ) {
-			fscanf(fp, "%f", &c);
-			if ( c < ALPHA )
-				count++;
-			A[j] = c;
-		}
-	}
-	if ( sampleSize == 0 )
-		proportion = 0.0;
-	else
-		proportion = 1.0-(double)count/sampleSize;
-
-	/* Compute Metric 2: Histogram */
-
-	qsort((void *)A, sampleSize, sizeof(double), (CompareFnType)cmp);
-	
-	for ( j=0; j<sampleSize; j++ ) {
-		pos = (int)floor(A[j]*10);
-		if ( pos == 10 )
-			pos--;
-		freqPerBin[pos]++;
-	}
-	chi2 = 0.0;
-	expCount = sampleSize/10;
-	for ( j=0; j<10; j++ )
-		chi2 += pow(freqPerBin[j]-expCount, 2)/expCount;
-	uniformity = cephes_igamc(9.0/2.0, chi2/2.0);
-
-	for ( j=0; j<10; j++ )			/* DISPLAY RESULTS */
-		fprintf(summary, "%3d ", freqPerBin[j]);
-
-	if ( expCount == 0 )
-		fprintf(summary, "    ----    ");
-	else if ( uniformity < 0.0001 )
-		fprintf(summary, " %8.6f * ", uniformity);
-	else
-		fprintf(summary, " %8.6f   ", uniformity);
-
-	if ( sampleSize == 0 )
-		fprintf(summary, " ----     %s\n", testNames[test]);
-	else if ( proportion < 0.96 )
-		fprintf(summary, "%6.4f *  %s\n", proportion, testNames[test]);
-	else
-		fprintf(summary, "%6.4f    %s\n", proportion, testNames[test]);
-
-	fclose(fp);
-	free(A);
-	
-	return sampleSize;
-}
-
-/*
-Gobal Entry Function
-*/
-GLDEF_C TInt E32Main()
-    {
-    __UHEAP_MARK;
-    TInt ret = StartNISTTest();
-    __UHEAP_MARKEND;
-    
-    return ret;
-    }
-
-
-
--- a/kerneltest/e32utils/nistsecurerng/src/blockFrequency.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-
-#include "openc.h"
-#include "../include/externs.h"
-#include "../include/cephes.h"
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-                    B L O C K  F R E Q U E N C Y  T E S T
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-void
-BlockFrequency(int M, int n)
-{
-	int		i, j, N, blockSum;
-	double	p_value, sum, pi, v, chi_squared;
-	
-	N = n/M; 		/* # OF SUBSTRING BLOCKS      */
-	sum = 0.0;
-	
-	for ( i=0; i<N; i++ ) {
-		blockSum = 0;
-		for ( j=0; j<M; j++ )
-			blockSum += epsilon[j+i*M];
-		pi = (double)blockSum/(double)M;
-		v = pi - 0.5;
-		sum += v*v;
-	}
-	chi_squared = 4.0 * M * sum;
-	p_value = cephes_igamc(N/2.0, chi_squared/2.0);
-
-	fprintf(stats[TEST_BLOCK_FREQUENCY], "\t\t\tBLOCK FREQUENCY TEST\n");
-	fprintf(stats[TEST_BLOCK_FREQUENCY], "\t\t---------------------------------------------\n");
-	fprintf(stats[TEST_BLOCK_FREQUENCY], "\t\tCOMPUTATIONAL INFORMATION:\n");
-	fprintf(stats[TEST_BLOCK_FREQUENCY], "\t\t---------------------------------------------\n");
-	fprintf(stats[TEST_BLOCK_FREQUENCY], "\t\t(a) Chi^2           = %f\n", chi_squared);
-	fprintf(stats[TEST_BLOCK_FREQUENCY], "\t\t(b) # of substrings = %d\n", N);
-	fprintf(stats[TEST_BLOCK_FREQUENCY], "\t\t(c) block length    = %d\n", M);
-	fprintf(stats[TEST_BLOCK_FREQUENCY], "\t\t(d) Note: %d bits were discarded.\n", n % M);
-	fprintf(stats[TEST_BLOCK_FREQUENCY], "\t\t---------------------------------------------\n");
-
-	fprintf(stats[TEST_BLOCK_FREQUENCY], "%s\t\tp_value = %f\n\n", p_value < ALPHA ? "FAILURE" : "SUCCESS", p_value);
-	fprintf(results[TEST_BLOCK_FREQUENCY], "%f\n", p_value);
-}
--- a/kerneltest/e32utils/nistsecurerng/src/cephes.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,357 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-
-
-#include "openc.h"
-#include "../include/cephes.h"
-
-static const double	rel_error = 1E-12;
-
-double MACHEP = 1.11022302462515654042E-16;		// 2**-53
-double MAXLOG = 7.09782712893383996732224E2;	// log(MAXNUM)
-double MAXNUM = 1.7976931348623158E308;			// 2**1024*(1-MACHEP)
-double PI     = 3.14159265358979323846;			// pi, duh!
-
-static double big = 4.503599627370496e15;
-static double biginv =  2.22044604925031308085e-16;
-
-int sgngam = 0;
-
-double
-cephes_igamc(double a, double x)
-{
-	double ans, ax, c, yc, r, t, y, z;
-	double pk, pkm1, pkm2, qk, qkm1, qkm2;
-
-	if ( (x <= 0) || ( a <= 0) )
-		return( 1.0 );
-
-	if ( (x < 1.0) || (x < a) )
-		return( 1.e0 - cephes_igam(a,x) );
-
-	ax = a * log(x) - x - cephes_lgam(a);
-
-	if ( ax < -MAXLOG ) {
-		printf("igamc: UNDERFLOW\n");
-		return 0.0;
-	}
-	ax = exp(ax);
-
-	/* continued fraction */
-	y = 1.0 - a;
-	z = x + y + 1.0;
-	c = 0.0;
-	pkm2 = 1.0;
-	qkm2 = x;
-	pkm1 = x + 1.0;
-	qkm1 = z * x;
-	ans = pkm1/qkm1;
-
-	do {
-		c += 1.0;
-		y += 1.0;
-		z += 2.0;
-		yc = y * c;
-		pk = pkm1 * z  -  pkm2 * yc;
-		qk = qkm1 * z  -  qkm2 * yc;
-		if ( qk != 0 ) {
-			r = pk/qk;
-			t = fabs( (ans - r)/r );
-			ans = r;
-		}
-		else
-			t = 1.0;
-		pkm2 = pkm1;
-		pkm1 = pk;
-		qkm2 = qkm1;
-		qkm1 = qk;
-		if ( fabs(pk) > big ) {
-			pkm2 *= biginv;
-			pkm1 *= biginv;
-			qkm2 *= biginv;
-			qkm1 *= biginv;
-		}
-	} while ( t > MACHEP );
-
-	return ans*ax;
-}
-
-double
-cephes_igam(double a, double x)
-{
-	double ans, ax, c, r;
-
-	if ( (x <= 0) || ( a <= 0) )
-		return 0.0;
-
-	if ( (x > 1.0) && (x > a ) )
-		return 1.e0 - cephes_igamc(a,x);
-
-	/* Compute  x**a * exp(-x) / gamma(a)  */
-	ax = a * log(x) - x - cephes_lgam(a);
-	if ( ax < -MAXLOG ) {
-		printf("igam: UNDERFLOW\n");
-		return 0.0;
-	}
-	ax = exp(ax);
-
-	/* power series */
-	r = a;
-	c = 1.0;
-	ans = 1.0;
-
-	do {
-		r += 1.0;
-		c *= x/r;
-		ans += c;
-	} while ( c/ans > MACHEP );
-
-	return ans * ax/a;
-}
-
-
-/* A[]: Stirling's formula expansion of log gamma
- * B[], C[]: log gamma function between 2 and 3
- */
-static unsigned short A[] = {
-	0x6661,0x2733,0x9850,0x3f4a,
-	0xe943,0xb580,0x7fbd,0xbf43,
-	0x5ebb,0x20dc,0x019f,0x3f4a,
-	0xa5a1,0x16b0,0xc16c,0xbf66,
-	0x554b,0x5555,0x5555,0x3fb5
-};
-static unsigned short B[] = {
-	0x6761,0x8ff3,0x8901,0xc095,
-	0xb93e,0x355b,0xf234,0xc0e2,
-	0x89e5,0xf890,0x3d73,0xc114,
-	0xdb51,0xf994,0xbc82,0xc131,
-	0xf20b,0x0219,0x4589,0xc13a,
-	0x055e,0x5418,0x0c67,0xc12a
-};
-static unsigned short C[] = {
-	/*0x0000,0x0000,0x0000,0x3ff0,*/
-	0x12b2,0x1cf3,0xfd0d,0xc075,
-	0xd757,0x7b89,0xaa0d,0xc0d0,
-	0x4c9b,0xb974,0xeb84,0xc10a,
-	0x0043,0x7195,0x6286,0xc131,
-	0xf34c,0x892f,0x5255,0xc143,
-	0xe14a,0x6a11,0xce4b,0xc13e
-};
-
-#define MAXLGM 2.556348e305
-
-
-/* Logarithm of gamma function */
-double
-cephes_lgam(double x)
-{
-	double	p, q, u, w, z;
-	int		i;
-
-	sgngam = 1;
-
-	if ( x < -34.0 ) {
-		q = -x;
-		w = cephes_lgam(q); /* note this modifies sgngam! */
-		p = floor(q);
-		if ( p == q ) {
-lgsing:
-			goto loverf;
-		}
-		i = (int)p;
-		if ( (i & 1) == 0 )
-			sgngam = -1;
-		else
-			sgngam = 1;
-		z = q - p;
-		if ( z > 0.5 ) {
-			p += 1.0;
-			z = p - q;
-		}
-		z = q * sin( PI * z );
-		if ( z == 0.0 )
-			goto lgsing;
-		/*      z = log(PI) - log( z ) - w;*/
-		z = log(PI) - log( z ) - w;
-		return z;
-	}
-
-	if ( x < 13.0 ) {
-		z = 1.0;
-		p = 0.0;
-		u = x;
-		while ( u >= 3.0 ) {
-			p -= 1.0;
-			u = x + p;
-			z *= u;
-		}
-		while ( u < 2.0 ) {
-			if ( u == 0.0 )
-				goto lgsing;
-			z /= u;
-			p += 1.0;
-			u = x + p;
-		}
-		if ( z < 0.0 ) {
-			sgngam = -1;
-			z = -z;
-		}
-		else
-			sgngam = 1;
-		if ( u == 2.0 )
-			return( log(z) );
-		p -= 2.0;
-		x = x + p;
-		p = x * cephes_polevl( x, (double *)B, 5 ) / cephes_p1evl( x, (double *)C, 6);
-
-		return log(z) + p;
-	}
-
-	if ( x > MAXLGM ) {
-loverf:
-		printf("lgam: OVERFLOW\n");
-
-		return sgngam * MAXNUM;
-	}
-
-	q = ( x - 0.5 ) * log(x) - x + log( sqrt( 2*PI ) );
-	if ( x > 1.0e8 )
-		return q;
-
-	p = 1.0/(x*x);
-	if ( x >= 1000.0 )
-		q += ((   7.9365079365079365079365e-4 * p
-		        - 2.7777777777777777777778e-3) *p
-				+ 0.0833333333333333333333) / x;
-	else
-		q += cephes_polevl( p, (double *)A, 4 ) / x;
-
-	return q;
-}
-
-double
-cephes_polevl(double x, double *coef, int N)
-{
-	double	ans;
-	int		i;
-	double	*p;
-
-	p = coef;
-	ans = *p++;
-	i = N;
-
-	do
-		ans = ans * x  +  *p++;
-	while ( --i );
-
-	return ans;
-}
-
-double
-cephes_p1evl(double x, double *coef, int N)
-{
-	double	ans;
-	double	*p;
-	int		i;
-
-	p = coef;
-	ans = x + *p++;
-	i = N-1;
-
-	do
-		ans = ans * x  + *p++;
-	while ( --i );
-
-	return ans;
-}
-
-double
-cephes_erf(double x)
-{
-	static const double two_sqrtpi = 1.128379167095512574;
-	double	sum = x, term = x, xsqr = x * x;
-	int		j = 1;
-
-	if ( fabs(x) > 2.2 )
-		return 1.0 - cephes_erfc(x);
-
-	do {
-		term *= xsqr/j;
-		sum -= term/(2*j+1);
-		j++;
-		term *= xsqr/j;
-		sum += term/(2*j+1);
-		j++;
-	} while ( fabs(term)/sum > rel_error );
-
-	return two_sqrtpi*sum;
-}
-
-double
-cephes_erfc(double x)
-{
-	static const double one_sqrtpi = 0.564189583547756287;
-	double	a = 1, b = x, c = x, d = x*x + 0.5;
-	double	q1, q2 = b/d, n = 1.0, t;
-
-	if ( fabs(x) < 2.2 )
-		return 1.0 - cephes_erf(x);
-	if ( x < 0 )
-		return 2.0 - cephes_erfc(-x);
-
-	do {
-		t = a*n + b*x;
-		a = b;
-		b = t;
-		t = c*n + d*x;
-		c = d;
-		d = t;
-		n += 0.5;
-		q1 = q2;
-		q2 = b/d;
-	} while ( fabs(q1-q2)/q2 > rel_error );
-
-	return one_sqrtpi*exp(-x*x)*q2;
-}
-
-
-double
-cephes_normal(double x)
-{
-	double arg, result, sqrt2=1.414213562373095048801688724209698078569672;
-
-	if (x > 0) {
-		arg = x/sqrt2;
-		result = 0.5 * ( 1 + erf(arg) );
-	}
-	else {
-		arg = -x/sqrt2;
-		result = 0.5 * ( 1 - erf(arg) );
-	}
-
-	return( result);
-}
--- a/kerneltest/e32utils/nistsecurerng/src/cusum.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-#include "openc.h"
-#include "../include/externs.h"
-#include "../include/cephes.h"
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-		    C U M U L A T I V E  S U M S  T E S T
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-void
-CumulativeSums(int n)
-{
-	int	   S, sup, inf;
-	int    z = 0;
-	int    zrev = 0;
-	int    k;
-	double	sum1, sum2, p_value;
-
-	S = 0;
-	sup = 0;
-	inf = 0;
-	for ( k=0; k<n; k++ ) {
-		epsilon[k] ? S++ : S--;
-		if ( S > sup )
-			sup++;
-		if ( S < inf )
-			inf--;
-		z = (sup > -inf) ? sup : -inf;
-		zrev = (sup-S > S-inf) ? sup-S : S-inf;
-	}
-	
-	// forward
-	sum1 = 0.0;
-	for ( k=(-n/z+1)/4; k<=(n/z-1)/4; k++ ) {
-		sum1 += cephes_normal(((4*k+1)*z)/sqrt(n));
-		sum1 -= cephes_normal(((4*k-1)*z)/sqrt(n));
-	}
-	sum2 = 0.0;
-	for ( k=(-n/z-3)/4; k<=(n/z-1)/4; k++ ) {
-		sum2 += cephes_normal(((4*k+3)*z)/sqrt(n));
-		sum2 -= cephes_normal(((4*k+1)*z)/sqrt(n));
-	}
-
-	p_value = 1.0 - sum1 + sum2;
-	
-	fprintf(stats[TEST_CUSUM], "\t\t      CUMULATIVE SUMS (FORWARD) TEST\n");
-	fprintf(stats[TEST_CUSUM], "\t\t-------------------------------------------\n");
-	fprintf(stats[TEST_CUSUM], "\t\tCOMPUTATIONAL INFORMATION:\n");
-	fprintf(stats[TEST_CUSUM], "\t\t-------------------------------------------\n");
-	fprintf(stats[TEST_CUSUM], "\t\t(a) The maximum partial sum = %d\n", z);
-	fprintf(stats[TEST_CUSUM], "\t\t-------------------------------------------\n");
-
-	if ( isNegative(p_value) || isGreaterThanOne(p_value) )
-		fprintf(stats[TEST_CUSUM], "\t\tWARNING:  P_VALUE IS OUT OF RANGE\n");
-
-	fprintf(stats[TEST_CUSUM], "%s\t\tp_value = %f\n\n", p_value < ALPHA ? "FAILURE" : "SUCCESS", p_value);
-	fprintf(results[TEST_CUSUM], "%f\n", p_value);
-		
-	// backwards
-	sum1 = 0.0;
-	for ( k=(-n/zrev+1)/4; k<=(n/zrev-1)/4; k++ ) {
-		sum1 += cephes_normal(((4*k+1)*zrev)/sqrt(n));
-		sum1 -= cephes_normal(((4*k-1)*zrev)/sqrt(n));
-	}
-	sum2 = 0.0;
-	for ( k=(-n/zrev-3)/4; k<=(n/zrev-1)/4; k++ ) {
-		sum2 += cephes_normal(((4*k+3)*zrev)/sqrt(n));
-		sum2 -= cephes_normal(((4*k+1)*zrev)/sqrt(n));
-	}
-	p_value = 1.0 - sum1 + sum2;
-
-	fprintf(stats[TEST_CUSUM], "\t\t      CUMULATIVE SUMS (REVERSE) TEST\n");
-	fprintf(stats[TEST_CUSUM], "\t\t-------------------------------------------\n");
-	fprintf(stats[TEST_CUSUM], "\t\tCOMPUTATIONAL INFORMATION:\n");
-	fprintf(stats[TEST_CUSUM], "\t\t-------------------------------------------\n");
-	fprintf(stats[TEST_CUSUM], "\t\t(a) The maximum partial sum = %d\n", zrev);
-	fprintf(stats[TEST_CUSUM], "\t\t-------------------------------------------\n");
-
-	if ( isNegative(p_value) || isGreaterThanOne(p_value) )
-		fprintf(stats[TEST_CUSUM], "\t\tWARNING:  P_VALUE IS OUT OF RANGE\n");
-
-	fprintf(stats[TEST_CUSUM], "%s\t\tp_value = %f\n\n", p_value < ALPHA ? "FAILURE" : "SUCCESS", p_value);
-	fprintf(results[TEST_CUSUM], "%f\n", p_value);
-}
--- a/kerneltest/e32utils/nistsecurerng/src/dfft.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1399 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original of this file was released into the public domain, see below for details
-*/
-
-
-/* Notes from RFB: 
-
-   Looks like the user-level routines are:
-
-   Real FFT
-
-   void __ogg_fdrffti(int n, double *wsave, int *ifac)
-   void __ogg_fdrfftf(int n,double *r,double *wsave,int *ifac)
-   void __ogg_fdrfftb(int n, double *r, double *wsave, int *ifac)
-
-     __ogg_fdrffti == initialization
-     __ogg_fdrfftf == forward transform
-     __ogg_fdrfftb == backward transform
-
-     Parameters are
-     n == length of sequence
-     r == sequence to be transformed (input)
-       == transformed sequence (output)
-     wsave == work array of length 2n (allocated by caller)
-     ifac == work array of length 15 (allocated by caller)
-
-   Cosine quarter-wave FFT
-
-   void __ogg_fdcosqi(int n, double *wsave, int *ifac)
-   void __ogg_fdcosqf(int n,double *x,double *wsave,int *ifac)
-   void __ogg_fdcosqb(int n,double *x,double *wsave,int *ifac)
-*/
-
-/********************************************************************
- *                                                                  *
- * THIS FILE IS PART OF THE OggSQUISH SOFTWARE CODEC SOURCE CODE.   *
- *                                                                  *
- ********************************************************************
-
-  file: fft.c
-  function: Fast discrete Fourier and cosine transforms and inverses
-  author: Monty <xiphmont@mit.edu>
-  modifications by: Monty
-  last modification date: Jul 1 1996
-
- ********************************************************************/
-
-/* These Fourier routines were originally based on the Fourier
-   routines of the same names from the NETLIB bihar and fftpack
-   fortran libraries developed by Paul N. Swarztrauber at the National
-   Center for Atmospheric Research in Boulder, CO USA.  They have been
-   reimplemented in C and optimized in a few ways for OggSquish. */
-
-/* As the original fortran libraries are public domain, the C Fourier
-   routines in this file are hereby released to the public domain as
-   well.  The C routines here produce output exactly equivalent to the
-   original fortran routines.  Of particular interest are the facts
-   that (like the original fortran), these routines can work on
-   arbitrary length vectors that need not be powers of two in
-   length. */
-
-#include "openc.h"
-#define STIN static
-
-static void drfti1(int n, double *wa, int *ifac){
-  static int ntryh[4] = { 4,2,3,5 };
-  static double tpi = 6.28318530717958647692528676655900577;
-  double arg,argh,argld,fi;
-  int ntry=0,i,j=-1;
-  int k1, l1, l2, ib;
-  int ld, ii, ip, is, nq, nr;
-  int ido, ipm, nfm1;
-  int nl=n;
-  int nf=0;
-
- L101:
-  j++;
-  if (j < 4)
-    ntry=ntryh[j];
-  else
-    ntry+=2;
-
- L104:
-  nq=nl/ntry;
-  nr=nl-ntry*nq;
-  if (nr!=0) goto L101;
-
-  nf++;
-  ifac[nf+1]=ntry;
-  nl=nq;
-  if(ntry!=2)goto L107;
-  if(nf==1)goto L107;
-
-  for (i=1;i<nf;i++){
-    ib=nf-i+1;
-    ifac[ib+1]=ifac[ib];
-  }
-  ifac[2] = 2;
-
- L107:
-  if(nl!=1)goto L104;
-  ifac[0]=n;
-  ifac[1]=nf;
-  argh=tpi/n;
-  is=0;
-  nfm1=nf-1;
-  l1=1;
-
-  if(nfm1==0)return;
-
-  for (k1=0;k1<nfm1;k1++){
-    ip=ifac[k1+2];
-    ld=0;
-    l2=l1*ip;
-    ido=n/l2;
-    ipm=ip-1;
-
-    for (j=0;j<ipm;j++){
-      ld+=l1;
-      i=is;
-      argld=(double)ld*argh;
-      fi=0.;
-      for (ii=2;ii<ido;ii+=2){
-	fi+=1.;
-	arg=fi*argld;
-	wa[i++]=cos(arg);
-	wa[i++]=sin(arg);
-      }
-      is+=ido;
-    }
-    l1=l2;
-  }
-}
-
-void __ogg_fdrffti(int n, double *wsave, int *ifac){
-
-  if (n == 1) return;
-  drfti1(n, wsave+n, ifac);
-}
-
-void __ogg_fdcosqi(int n, double *wsave, int *ifac){
-  static double pih = 1.57079632679489661923132169163975;
-  static int k;
-  static double fk, dt;
-
-  dt=pih/n;
-  fk=0.;
-  for(k=0;k<n;k++){
-    fk+=1.;
-    wsave[k] = cos(fk*dt);
-  }
-
-  __ogg_fdrffti(n, wsave+n,ifac);
-}
-
-STIN void dradf2(int ido,int l1,double *cc,double *ch,double *wa1){
-  int i,k;
-  double ti2,tr2;
-  int t0,t1,t2,t3,t4,t5,t6;
-  
-  t1=0;
-  t0=(t2=l1*ido);
-  t3=ido<<1;
-  for(k=0;k<l1;k++){
-    ch[t1<<1]=cc[t1]+cc[t2];
-    ch[(t1<<1)+t3-1]=cc[t1]-cc[t2];
-    t1+=ido;
-    t2+=ido;
-  }
-
-  if(ido<2)return;
-  if(ido==2)goto L105;
-
-  t1=0;
-  t2=t0;
-  for(k=0;k<l1;k++){
-    t3=t2;
-    t4=(t1<<1)+(ido<<1);
-    t5=t1;
-    t6=t1+t1;
-    for(i=2;i<ido;i+=2){
-      t3+=2;
-      t4-=2;
-      t5+=2;
-      t6+=2;
-      tr2=wa1[i-2]*cc[t3-1]+wa1[i-1]*cc[t3];
-      ti2=wa1[i-2]*cc[t3]-wa1[i-1]*cc[t3-1];
-      ch[t6]=cc[t5]+ti2;
-      ch[t4]=ti2-cc[t5];
-      ch[t6-1]=cc[t5-1]+tr2;
-      ch[t4-1]=cc[t5-1]-tr2;
-    }
-    t1+=ido;
-    t2+=ido;
-  }
-
-  if(ido%2==1)return;
-
- L105:
-  t3=(t2=(t1=ido)-1);
-  t2+=t0;
-  for(k=0;k<l1;k++){
-    ch[t1]=-cc[t2];
-    ch[t1-1]=cc[t3];
-    t1+=ido<<1;
-    t2+=ido;
-    t3+=ido;
-  }
-}
-
-STIN void dradf4(int ido,int l1,double *cc,double *ch,double *wa1,
-	    double *wa2,double *wa3){
-  static double hsqt2 = .70710678118654752440084436210485;
-  int i,k,t0,t1,t2,t3,t4,t5,t6;
-  double ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4;
-  t0=l1*ido;
-  
-  t1=t0;
-  t4=t1<<1;
-  t2=t1+(t1<<1);
-  t3=0;
-
-  for(k=0;k<l1;k++){
-    tr1=cc[t1]+cc[t2];
-    tr2=cc[t3]+cc[t4];
-    ch[t5=t3<<2]=tr1+tr2;
-    ch[(ido<<2)+t5-1]=tr2-tr1;
-    ch[(t5+=(ido<<1))-1]=cc[t3]-cc[t4];
-    ch[t5]=cc[t2]-cc[t1];
-
-    t1+=ido;
-    t2+=ido;
-    t3+=ido;
-    t4+=ido;
-  }
-
-  if(ido<2)return;
-  if(ido==2)goto L105;
-
-  t1=0;
-  for(k=0;k<l1;k++){
-    t2=t1;
-    t4=t1<<2;
-    t5=(t6=ido<<1)+t4;
-    for(i=2;i<ido;i+=2){
-      t3=(t2+=2);
-      t4+=2;
-      t5-=2;
-
-      t3+=t0;
-      cr2=wa1[i-2]*cc[t3-1]+wa1[i-1]*cc[t3];
-      ci2=wa1[i-2]*cc[t3]-wa1[i-1]*cc[t3-1];
-      t3+=t0;
-      cr3=wa2[i-2]*cc[t3-1]+wa2[i-1]*cc[t3];
-      ci3=wa2[i-2]*cc[t3]-wa2[i-1]*cc[t3-1];
-      t3+=t0;
-      cr4=wa3[i-2]*cc[t3-1]+wa3[i-1]*cc[t3];
-      ci4=wa3[i-2]*cc[t3]-wa3[i-1]*cc[t3-1];
-
-      tr1=cr2+cr4;
-      tr4=cr4-cr2;
-      ti1=ci2+ci4;
-      ti4=ci2-ci4;
-      ti2=cc[t2]+ci3;
-      ti3=cc[t2]-ci3;
-      tr2=cc[t2-1]+cr3;
-      tr3=cc[t2-1]-cr3;
-
-      
-      ch[t4-1]=tr1+tr2;
-      ch[t4]=ti1+ti2;
-
-      ch[t5-1]=tr3-ti4;
-      ch[t5]=tr4-ti3;
-
-      ch[t4+t6-1]=ti4+tr3;
-      ch[t4+t6]=tr4+ti3;
-
-      ch[t5+t6-1]=tr2-tr1;
-      ch[t5+t6]=ti1-ti2;
-    }
-    t1+=ido;
-  }
-  if(ido%2==1)return;
-
- L105:
-  
-  t2=(t1=t0+ido-1)+(t0<<1);
-  t3=ido<<2;
-  t4=ido;
-  t5=ido<<1;
-  t6=ido;
-
-  for(k=0;k<l1;k++){
-    ti1=-hsqt2*(cc[t1]+cc[t2]);
-    tr1=hsqt2*(cc[t1]-cc[t2]);
-    ch[t4-1]=tr1+cc[t6-1];
-    ch[t4+t5-1]=cc[t6-1]-tr1;
-    ch[t4]=ti1-cc[t1+t0];
-    ch[t4+t5]=ti1+cc[t1+t0];
-    t1+=ido;
-    t2+=ido;
-    t4+=t3;
-    t6+=ido;
-  }
-}
-
-STIN void dradfg(int ido,int ip,int l1,int idl1,double *cc,double *c1,
-			  double *c2,double *ch,double *ch2,double *wa){
-
-  static double tpi=6.28318530717958647692528676655900577;
-  int idij,ipph,i,j,k,l,ic,ik,is;
-  int t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
-  double dc2,ai1,ai2,ar1,ar2,ds2;
-  int nbd;
-  double dcp,arg,dsp,ar1h,ar2h;
-  int idp2,ipp2;
-  
-  arg=tpi/(double)ip;
-  dcp=cos(arg);
-  dsp=sin(arg);
-  ipph=(ip+1)>>1;
-  ipp2=ip;
-  idp2=ido;
-  nbd=(ido-1)>>1;
-  t0=l1*ido;
-  t10=ip*ido;
-
-  if(ido==1)goto L119;
-  for(ik=0;ik<idl1;ik++)ch2[ik]=c2[ik];
-
-  t1=0;
-  for(j=1;j<ip;j++){
-    t1+=t0;
-    t2=t1;
-    for(k=0;k<l1;k++){
-      ch[t2]=c1[t2];
-      t2+=ido;
-    }
-  }
-
-  is=-ido;
-  t1=0;
-  if(nbd>l1){
-    for(j=1;j<ip;j++){
-      t1+=t0;
-      is+=ido;
-      t2= -ido+t1;
-      for(k=0;k<l1;k++){
-	idij=is-1;
-	t2+=ido;
-	t3=t2;
-	for(i=2;i<ido;i+=2){
-	  idij+=2;
-	  t3+=2;
-	  ch[t3-1]=wa[idij-1]*c1[t3-1]+wa[idij]*c1[t3];
-	  ch[t3]=wa[idij-1]*c1[t3]-wa[idij]*c1[t3-1];
-	}
-      }
-    }
-  }else{
-
-    for(j=1;j<ip;j++){
-      is+=ido;
-      idij=is-1;
-      t1+=t0;
-      t2=t1;
-      for(i=2;i<ido;i+=2){
-	idij+=2;
-	t2+=2;
-	t3=t2;
-	for(k=0;k<l1;k++){
-	  ch[t3-1]=wa[idij-1]*c1[t3-1]+wa[idij]*c1[t3];
-	  ch[t3]=wa[idij-1]*c1[t3]-wa[idij]*c1[t3-1];
-	  t3+=ido;
-	}
-      }
-    }
-  }
-
-  t1=0;
-  t2=ipp2*t0;
-  if(nbd<l1){
-    for(j=1;j<ipph;j++){
-      t1+=t0;
-      t2-=t0;
-      t3=t1;
-      t4=t2;
-      for(i=2;i<ido;i+=2){
-	t3+=2;
-	t4+=2;
-	t5=t3-ido;
-	t6=t4-ido;
-	for(k=0;k<l1;k++){
-	  t5+=ido;
-	  t6+=ido;
-	  c1[t5-1]=ch[t5-1]+ch[t6-1];
-	  c1[t6-1]=ch[t5]-ch[t6];
-	  c1[t5]=ch[t5]+ch[t6];
-	  c1[t6]=ch[t6-1]-ch[t5-1];
-	}
-      }
-    }
-  }else{
-    for(j=1;j<ipph;j++){
-      t1+=t0;
-      t2-=t0;
-      t3=t1;
-      t4=t2;
-      for(k=0;k<l1;k++){
-	t5=t3;
-	t6=t4;
-	for(i=2;i<ido;i+=2){
-	  t5+=2;
-	  t6+=2;
-	  c1[t5-1]=ch[t5-1]+ch[t6-1];
-	  c1[t6-1]=ch[t5]-ch[t6];
-	  c1[t5]=ch[t5]+ch[t6];
-	  c1[t6]=ch[t6-1]-ch[t5-1];
-	}
-	t3+=ido;
-	t4+=ido;
-      }
-    }
-  }
-
-L119:
-  for(ik=0;ik<idl1;ik++)c2[ik]=ch2[ik];
-
-  t1=0;
-  t2=ipp2*idl1;
-  for(j=1;j<ipph;j++){
-    t1+=t0;
-    t2-=t0;
-    t3=t1-ido;
-    t4=t2-ido;
-    for(k=0;k<l1;k++){
-      t3+=ido;
-      t4+=ido;
-      c1[t3]=ch[t3]+ch[t4];
-      c1[t4]=ch[t4]-ch[t3];
-    }
-  }
-
-  ar1=1.;
-  ai1=0.;
-  t1=0;
-  t2=ipp2*idl1;
-  t3=(ip-1)*idl1;
-  for(l=1;l<ipph;l++){
-    t1+=idl1;
-    t2-=idl1;
-    ar1h=dcp*ar1-dsp*ai1;
-    ai1=dcp*ai1+dsp*ar1;
-    ar1=ar1h;
-    t4=t1;
-    t5=t2;
-    t6=t3;
-    t7=idl1;
-
-    for(ik=0;ik<idl1;ik++){
-      ch2[t4++]=c2[ik]+ar1*c2[t7++];
-      ch2[t5++]=ai1*c2[t6++];
-    }
-
-    dc2=ar1;
-    ds2=ai1;
-    ar2=ar1;
-    ai2=ai1;
-
-    t4=idl1;
-    t5=(ipp2-1)*idl1;
-    for(j=2;j<ipph;j++){
-      t4+=idl1;
-      t5-=idl1;
-
-      ar2h=dc2*ar2-ds2*ai2;
-      ai2=dc2*ai2+ds2*ar2;
-      ar2=ar2h;
-
-      t6=t1;
-      t7=t2;
-      t8=t4;
-      t9=t5;
-      for(ik=0;ik<idl1;ik++){
-	ch2[t6++]+=ar2*c2[t8++];
-	ch2[t7++]+=ai2*c2[t9++];
-      }
-    }
-  }
-
-  t1=0;
-  for(j=1;j<ipph;j++){
-    t1+=idl1;
-    t2=t1;
-    for(ik=0;ik<idl1;ik++)ch2[ik]+=c2[t2++];
-  }
-
-  if(ido<l1)goto L132;
-
-  t1=0;
-  t2=0;
-  for(k=0;k<l1;k++){
-    t3=t1;
-    t4=t2;
-    for(i=0;i<ido;i++)cc[t4++]=ch[t3++];
-    t1+=ido;
-    t2+=t10;
-  }
-
-  goto L135;
-
- L132:
-  for(i=0;i<ido;i++){
-    t1=i;
-    t2=i;
-    for(k=0;k<l1;k++){
-      cc[t2]=ch[t1];
-      t1+=ido;
-      t2+=t10;
-    }
-  }
-
- L135:
-  t1=0;
-  t2=ido<<1;
-  t3=0;
-  t4=ipp2*t0;
-  for(j=1;j<ipph;j++){
-
-    t1+=t2;
-    t3+=t0;
-    t4-=t0;
-
-    t5=t1;
-    t6=t3;
-    t7=t4;
-
-    for(k=0;k<l1;k++){
-      cc[t5-1]=ch[t6];
-      cc[t5]=ch[t7];
-      t5+=t10;
-      t6+=ido;
-      t7+=ido;
-    }
-  }
-
-  if(ido==1)return;
-  if(nbd<l1)goto L141;
-
-  t1=-ido;
-  t3=0;
-  t4=0;
-  t5=ipp2*t0;
-  for(j=1;j<ipph;j++){
-    t1+=t2;
-    t3+=t2;
-    t4+=t0;
-    t5-=t0;
-    t6=t1;
-    t7=t3;
-    t8=t4;
-    t9=t5;
-    for(k=0;k<l1;k++){
-      for(i=2;i<ido;i+=2){
-	ic=idp2-i;
-	cc[i+t7-1]=ch[i+t8-1]+ch[i+t9-1];
-	cc[ic+t6-1]=ch[i+t8-1]-ch[i+t9-1];
-	cc[i+t7]=ch[i+t8]+ch[i+t9];
-	cc[ic+t6]=ch[i+t9]-ch[i+t8];
-      }
-      t6+=t10;
-      t7+=t10;
-      t8+=ido;
-      t9+=ido;
-    }
-  }
-  return;
-
- L141:
-
-  t1=-ido;
-  t3=0;
-  t4=0;
-  t5=ipp2*t0;
-  for(j=1;j<ipph;j++){
-    t1+=t2;
-    t3+=t2;
-    t4+=t0;
-    t5-=t0;
-    for(i=2;i<ido;i+=2){
-      t6=idp2+t1-i;
-      t7=i+t3;
-      t8=i+t4;
-      t9=i+t5;
-      for(k=0;k<l1;k++){
-	cc[t7-1]=ch[t8-1]+ch[t9-1];
-	cc[t6-1]=ch[t8-1]-ch[t9-1];
-	cc[t7]=ch[t8]+ch[t9];
-	cc[t6]=ch[t9]-ch[t8];
-	t6+=t10;
-	t7+=t10;
-	t8+=ido;
-	t9+=ido;
-      }
-    }
-  }
-}
-
-STIN void drftf1(int n,double *c,double *ch,double *wa,int *ifac){
-  int i,k1,l1,l2;
-  int na,kh,nf;
-  int ip,iw,ido,idl1,ix2,ix3;
-
-  nf=ifac[1];
-  na=1;
-  l2=n;
-  iw=n;
-
-  for(k1=0;k1<nf;k1++){
-    kh=nf-k1;
-    ip=ifac[kh+1];
-    l1=l2/ip;
-    ido=n/l2;
-    idl1=ido*l1;
-    iw-=(ip-1)*ido;
-    na=1-na;
-
-    if(ip!=4)goto L102;
-
-    ix2=iw+ido;
-    ix3=ix2+ido;
-    if(na!=0)
-      dradf4(ido,l1,ch,c,wa+iw-1,wa+ix2-1,wa+ix3-1);
-    else
-      dradf4(ido,l1,c,ch,wa+iw-1,wa+ix2-1,wa+ix3-1);
-    goto L110;
-
- L102:
-    if(ip!=2)goto L104;
-    if(na!=0)goto L103;
-
-    dradf2(ido,l1,c,ch,wa+iw-1);
-    goto L110;
-
-  L103:
-    dradf2(ido,l1,ch,c,wa+iw-1);
-    goto L110;
-
-  L104:
-    if(ido==1)na=1-na;
-    if(na!=0)goto L109;
-
-    dradfg(ido,ip,l1,idl1,c,c,c,ch,ch,wa+iw-1);
-    na=1;
-    goto L110;
-
-  L109:
-    dradfg(ido,ip,l1,idl1,ch,ch,ch,c,c,wa+iw-1);
-    na=0;
-
-  L110:
-    l2=l1;
-  }
-
-  if(na==1)return;
-
-  for(i=0;i<n;i++)c[i]=ch[i];
-}
-
-void __ogg_fdrfftf(int n,double *r,double *wsave,int *ifac){
-  if(n==1)return;
-  drftf1(n,r,wsave,wsave+n,ifac);
-}
-
-STIN void dcsqf1(int n,double *x,double *w,double *xh,int *ifac){
-  int modn,i,k,kc;
-  int np2,ns2;
-  double xim1;
-
-  ns2=(n+1)>>1;
-  np2=n;
-
-  kc=np2;
-  for(k=1;k<ns2;k++){
-    kc--;
-    xh[k]=x[k]+x[kc];
-    xh[kc]=x[k]-x[kc];
-  }
-
-  modn=n%2;
-  if(modn==0)xh[ns2]=x[ns2]+x[ns2];
-
-  for(k=1;k<ns2;k++){
-    kc=np2-k;
-    x[k]=w[k-1]*xh[kc]+w[kc-1]*xh[k];
-    x[kc]=w[k-1]*xh[k]-w[kc-1]*xh[kc];
-  }
-
-  if(modn==0)x[ns2]=w[ns2-1]*xh[ns2];
-
-  __ogg_fdrfftf(n,x,xh,ifac);
-
-  for(i=2;i<n;i+=2){
-    xim1=x[i-1]-x[i];
-    x[i]=x[i-1]+x[i];
-    x[i-1]=xim1;
-  }
-}
-
-void __ogg_fdcosqf(int n,double *x,double *wsave,int *ifac){
-    static double sqrt2=1.4142135623730950488016887242097;
-    double tsqx;
-
-  switch(n){
-  case 0:case 1:
-    return;
-  case 2:
-    tsqx=sqrt2*x[1];
-    x[1]=x[0]-tsqx;
-    x[0]+=tsqx;
-    return;
-  default:
-    dcsqf1(n,x,wsave,wsave+n,ifac);
-    return;
-  }
-}
-
-STIN void dradb2(int ido,int l1,double *cc,double *ch,double *wa1){
-  int i,k,t0,t1,t2,t3,t4,t5,t6;
-  double ti2,tr2;
-
-  t0=l1*ido;
-  
-  t1=0;
-  t2=0;
-  t3=(ido<<1)-1;
-  for(k=0;k<l1;k++){
-    ch[t1]=cc[t2]+cc[t3+t2];
-    ch[t1+t0]=cc[t2]-cc[t3+t2];
-    t2=(t1+=ido)<<1;
-  }
-
-  if(ido<2)return;
-  if(ido==2)goto L105;
-
-  t1=0;
-  t2=0;
-  for(k=0;k<l1;k++){
-    t3=t1;
-    t5=(t4=t2)+(ido<<1);
-    t6=t0+t1;
-    for(i=2;i<ido;i+=2){
-      t3+=2;
-      t4+=2;
-      t5-=2;
-      t6+=2;
-      ch[t3-1]=cc[t4-1]+cc[t5-1];
-      tr2=cc[t4-1]-cc[t5-1];
-      ch[t3]=cc[t4]-cc[t5];
-      ti2=cc[t4]+cc[t5];
-      ch[t6-1]=wa1[i-2]*tr2-wa1[i-1]*ti2;
-      ch[t6]=wa1[i-2]*ti2+wa1[i-1]*tr2;
-    }
-    t2=(t1+=ido)<<1;
-  }
-
-  if(ido%2==1)return;
-
-L105:
-  t1=ido-1;
-  t2=ido-1;
-  for(k=0;k<l1;k++){
-    ch[t1]=cc[t2]+cc[t2];
-    ch[t1+t0]=-(cc[t2+1]+cc[t2+1]);
-    t1+=ido;
-    t2+=ido<<1;
-  }
-}
-
-STIN void dradb3(int ido,int l1,double *cc,double *ch,double *wa1,
-			  double *wa2){
-  static double taur = -.5;
-  static double taui = .86602540378443864676372317075293618;
-  int i,k,t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
-  double ci2,ci3,di2,di3,cr2,cr3,dr2,dr3,ti2,tr2;
-  t0=l1*ido;
-
-  t1=0;
-  t2=t0<<1;
-  t3=ido<<1;
-  t4=ido+(ido<<1);
-  t5=0;
-  for(k=0;k<l1;k++){
-    tr2=cc[t3-1]+cc[t3-1];
-    cr2=cc[t5]+(taur*tr2);
-    ch[t1]=cc[t5]+tr2;
-    ci3=taui*(cc[t3]+cc[t3]);
-    ch[t1+t0]=cr2-ci3;
-    ch[t1+t2]=cr2+ci3;
-    t1+=ido;
-    t3+=t4;
-    t5+=t4;
-  }
-
-  if(ido==1)return;
-
-  t1=0;
-  t3=ido<<1;
-  for(k=0;k<l1;k++){
-    t7=t1+(t1<<1);
-    t6=(t5=t7+t3);
-    t8=t1;
-    t10=(t9=t1+t0)+t0;
-
-    for(i=2;i<ido;i+=2){
-      t5+=2;
-      t6-=2;
-      t7+=2;
-      t8+=2;
-      t9+=2;
-      t10+=2;
-      tr2=cc[t5-1]+cc[t6-1];
-      cr2=cc[t7-1]+(taur*tr2);
-      ch[t8-1]=cc[t7-1]+tr2;
-      ti2=cc[t5]-cc[t6];
-      ci2=cc[t7]+(taur*ti2);
-      ch[t8]=cc[t7]+ti2;
-      cr3=taui*(cc[t5-1]-cc[t6-1]);
-      ci3=taui*(cc[t5]+cc[t6]);
-      dr2=cr2-ci3;
-      dr3=cr2+ci3;
-      di2=ci2+cr3;
-      di3=ci2-cr3;
-      ch[t9-1]=wa1[i-2]*dr2-wa1[i-1]*di2;
-      ch[t9]=wa1[i-2]*di2+wa1[i-1]*dr2;
-      ch[t10-1]=wa2[i-2]*dr3-wa2[i-1]*di3;
-      ch[t10]=wa2[i-2]*di3+wa2[i-1]*dr3;
-    }
-    t1+=ido;
-  }
-}
-
-STIN void dradb4(int ido,int l1,double *cc,double *ch,double *wa1,
-			  double *wa2,double *wa3){
-  static double sqrt2=1.4142135623730950488016887242097;
-  int i,k,t0,t1,t2,t3,t4,t5,t6,t7,t8;
-  double ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4;
-  t0=l1*ido;
-  
-  t1=0;
-  t2=ido<<2;
-  t3=0;
-  t6=ido<<1;
-  for(k=0;k<l1;k++){
-    t4=t3+t6;
-    t5=t1;
-    tr3=cc[t4-1]+cc[t4-1];
-    tr4=cc[t4]+cc[t4]; 
-    tr1=cc[t3]-cc[(t4+=t6)-1];
-    tr2=cc[t3]+cc[t4-1];
-    ch[t5]=tr2+tr3;
-    ch[t5+=t0]=tr1-tr4;
-    ch[t5+=t0]=tr2-tr3;
-    ch[t5+=t0]=tr1+tr4;
-    t1+=ido;
-    t3+=t2;
-  }
-
-  if(ido<2)return;
-  if(ido==2)goto L105;
-
-  t1=0;
-  for(k=0;k<l1;k++){
-    t5=(t4=(t3=(t2=t1<<2)+t6))+t6;
-    t7=t1;
-    for(i=2;i<ido;i+=2){
-      t2+=2;
-      t3+=2;
-      t4-=2;
-      t5-=2;
-      t7+=2;
-      ti1=cc[t2]+cc[t5];
-      ti2=cc[t2]-cc[t5];
-      ti3=cc[t3]-cc[t4];
-      tr4=cc[t3]+cc[t4];
-      tr1=cc[t2-1]-cc[t5-1];
-      tr2=cc[t2-1]+cc[t5-1];
-      ti4=cc[t3-1]-cc[t4-1];
-      tr3=cc[t3-1]+cc[t4-1];
-      ch[t7-1]=tr2+tr3;
-      cr3=tr2-tr3;
-      ch[t7]=ti2+ti3;
-      ci3=ti2-ti3;
-      cr2=tr1-tr4;
-      cr4=tr1+tr4;
-      ci2=ti1+ti4;
-      ci4=ti1-ti4;
-
-      ch[(t8=t7+t0)-1]=wa1[i-2]*cr2-wa1[i-1]*ci2;
-      ch[t8]=wa1[i-2]*ci2+wa1[i-1]*cr2;
-      ch[(t8+=t0)-1]=wa2[i-2]*cr3-wa2[i-1]*ci3;
-      ch[t8]=wa2[i-2]*ci3+wa2[i-1]*cr3;
-      ch[(t8+=t0)-1]=wa3[i-2]*cr4-wa3[i-1]*ci4;
-      ch[t8]=wa3[i-2]*ci4+wa3[i-1]*cr4;
-    }
-    t1+=ido;
-  }
-
-  if(ido%2 == 1)return;
-
- L105:
-
-  t1=ido;
-  t2=ido<<2;
-  t3=ido-1;
-  t4=ido+(ido<<1);
-  for(k=0;k<l1;k++){
-    t5=t3;
-    ti1=cc[t1]+cc[t4];
-    ti2=cc[t4]-cc[t1];
-    tr1=cc[t1-1]-cc[t4-1];
-    tr2=cc[t1-1]+cc[t4-1];
-    ch[t5]=tr2+tr2;
-    ch[t5+=t0]=sqrt2*(tr1-ti1);
-    ch[t5+=t0]=ti2+ti2;
-    ch[t5+=t0]=-sqrt2*(tr1+ti1);
-
-    t3+=ido;
-    t1+=t2;
-    t4+=t2;
-  }
-}
-
-STIN void dradbg(int ido,int ip,int l1,int idl1,double *cc,double *c1,
-	    double *c2,double *ch,double *ch2,double *wa){
-  static double tpi=6.28318530717958647692528676655900577;
-  int idij,ipph,i,j,k,l,ik,is,t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,
-      t11,t12;
-  double dc2,ai1,ai2,ar1,ar2,ds2;
-  int nbd;
-  double dcp,arg,dsp,ar1h,ar2h;
-  int ipp2;
-
-  t10=ip*ido;
-  t0=l1*ido;
-  arg=tpi/(double)ip;
-  dcp=cos(arg);
-  dsp=sin(arg);
-  nbd=(ido-1)>>1;
-  ipp2=ip;
-  ipph=(ip+1)>>1;
-  if(ido<l1)goto L103;
-  
-  t1=0;
-  t2=0;
-  for(k=0;k<l1;k++){
-    t3=t1;
-    t4=t2;
-    for(i=0;i<ido;i++){
-      ch[t3]=cc[t4];
-      t3++;
-      t4++;
-    }
-    t1+=ido;
-    t2+=t10;
-  }
-  goto L106;
-
- L103:
-  t1=0;
-  for(i=0;i<ido;i++){
-    t2=t1;
-    t3=t1;
-    for(k=0;k<l1;k++){
-      ch[t2]=cc[t3];
-      t2+=ido;
-      t3+=t10;
-    }
-    t1++;
-  }
-
- L106:
-  t1=0;
-  t2=ipp2*t0;
-  t7=(t5=ido<<1);
-  for(j=1;j<ipph;j++){
-    t1+=t0;
-    t2-=t0;
-    t3=t1;
-    t4=t2;
-    t6=t5;
-    for(k=0;k<l1;k++){
-      ch[t3]=cc[t6-1]+cc[t6-1];
-      ch[t4]=cc[t6]+cc[t6];
-      t3+=ido;
-      t4+=ido;
-      t6+=t10;
-    }
-    t5+=t7;
-  }
-
-  if (ido == 1)goto L116;
-  if(nbd<l1)goto L112;
-
-  t1=0;
-  t2=ipp2*t0;
-  t7=0;
-  for(j=1;j<ipph;j++){
-    t1+=t0;
-    t2-=t0;
-    t3=t1;
-    t4=t2;
-
-    t7+=(ido<<1);
-    t8=t7;
-    for(k=0;k<l1;k++){
-      t5=t3;
-      t6=t4;
-      t9=t8;
-      t11=t8;
-      for(i=2;i<ido;i+=2){
-	t5+=2;
-	t6+=2;
-	t9+=2;
-	t11-=2;
-	ch[t5-1]=cc[t9-1]+cc[t11-1];
-	ch[t6-1]=cc[t9-1]-cc[t11-1];
-	ch[t5]=cc[t9]-cc[t11];
-	ch[t6]=cc[t9]+cc[t11];
-      }
-      t3+=ido;
-      t4+=ido;
-      t8+=t10;
-    }
-  }
-  goto L116;
-
- L112:
-  t1=0;
-  t2=ipp2*t0;
-  t7=0;
-  for(j=1;j<ipph;j++){
-    t1+=t0;
-    t2-=t0;
-    t3=t1;
-    t4=t2;
-    t7+=(ido<<1);
-    t8=t7;
-    t9=t7;
-    for(i=2;i<ido;i+=2){
-      t3+=2;
-      t4+=2;
-      t8+=2;
-      t9-=2;
-      t5=t3;
-      t6=t4;
-      t11=t8;
-      t12=t9;
-      for(k=0;k<l1;k++){
-	ch[t5-1]=cc[t11-1]+cc[t12-1];
-	ch[t6-1]=cc[t11-1]-cc[t12-1];
-	ch[t5]=cc[t11]-cc[t12];
-	ch[t6]=cc[t11]+cc[t12];
-	t5+=ido;
-	t6+=ido;
-	t11+=t10;
-	t12+=t10;
-      }
-    }
-  }
-
-L116:
-  ar1=1.;
-  ai1=0.;
-  t1=0;
-  t9=(t2=ipp2*idl1);
-  t3=(ip-1)*idl1;
-  for(l=1;l<ipph;l++){
-    t1+=idl1;
-    t2-=idl1;
-
-    ar1h=dcp*ar1-dsp*ai1;
-    ai1=dcp*ai1+dsp*ar1;
-    ar1=ar1h;
-    t4=t1;
-    t5=t2;
-    t6=0;
-    t7=idl1;
-    t8=t3;
-    for(ik=0;ik<idl1;ik++){
-      c2[t4++]=ch2[t6++]+ar1*ch2[t7++];
-      c2[t5++]=ai1*ch2[t8++];
-    }
-    dc2=ar1;
-    ds2=ai1;
-    ar2=ar1;
-    ai2=ai1;
-
-    t6=idl1;
-    t7=t9-idl1;
-    for(j=2;j<ipph;j++){
-      t6+=idl1;
-      t7-=idl1;
-      ar2h=dc2*ar2-ds2*ai2;
-      ai2=dc2*ai2+ds2*ar2;
-      ar2=ar2h;
-      t4=t1;
-      t5=t2;
-      t11=t6;
-      t12=t7;
-      for(ik=0;ik<idl1;ik++){
-	c2[t4++]+=ar2*ch2[t11++];
-	c2[t5++]+=ai2*ch2[t12++];
-      }
-    }
-  }
-
-  t1=0;
-  for(j=1;j<ipph;j++){
-    t1+=idl1;
-    t2=t1;
-    for(ik=0;ik<idl1;ik++)ch2[ik]+=ch2[t2++];
-  }
-
-  t1=0;
-  t2=ipp2*t0;
-  for(j=1;j<ipph;j++){
-    t1+=t0;
-    t2-=t0;
-    t3=t1;
-    t4=t2;
-    for(k=0;k<l1;k++){
-      ch[t3]=c1[t3]-c1[t4];
-      ch[t4]=c1[t3]+c1[t4];
-      t3+=ido;
-      t4+=ido;
-    }
-  }
-
-  if(ido==1)goto L132;
-  if(nbd<l1)goto L128;
-
-  t1=0;
-  t2=ipp2*t0;
-  for(j=1;j<ipph;j++){
-    t1+=t0;
-    t2-=t0;
-    t3=t1;
-    t4=t2;
-    for(k=0;k<l1;k++){
-      t5=t3;
-      t6=t4;
-      for(i=2;i<ido;i+=2){
-	t5+=2;
-	t6+=2;
-	ch[t5-1]=c1[t5-1]-c1[t6];
-	ch[t6-1]=c1[t5-1]+c1[t6];
-	ch[t5]=c1[t5]+c1[t6-1];
-	ch[t6]=c1[t5]-c1[t6-1];
-      }
-      t3+=ido;
-      t4+=ido;
-    }
-  }
-  goto L132;
-
- L128:
-  t1=0;
-  t2=ipp2*t0;
-  for(j=1;j<ipph;j++){
-    t1+=t0;
-    t2-=t0;
-    t3=t1;
-    t4=t2;
-    for(i=2;i<ido;i+=2){
-      t3+=2;
-      t4+=2;
-      t5=t3;
-      t6=t4;
-      for(k=0;k<l1;k++){
-	ch[t5-1]=c1[t5-1]-c1[t6];
-	ch[t6-1]=c1[t5-1]+c1[t6];
-	ch[t5]=c1[t5]+c1[t6-1];
-	ch[t6]=c1[t5]-c1[t6-1];
-	t5+=ido;
-	t6+=ido;
-      }
-    }
-  }
-
-L132:
-  if(ido==1)return;
-
-  for(ik=0;ik<idl1;ik++)c2[ik]=ch2[ik];
-
-  t1=0;
-  for(j=1;j<ip;j++){
-    t2=(t1+=t0);
-    for(k=0;k<l1;k++){
-      c1[t2]=ch[t2];
-      t2+=ido;
-    }
-  }
-
-  if(nbd>l1)goto L139;
-
-  is= -ido-1;
-  t1=0;
-  for(j=1;j<ip;j++){
-    is+=ido;
-    t1+=t0;
-    idij=is;
-    t2=t1;
-    for(i=2;i<ido;i+=2){
-      t2+=2;
-      idij+=2;
-      t3=t2;
-      for(k=0;k<l1;k++){
-	c1[t3-1]=wa[idij-1]*ch[t3-1]-wa[idij]*ch[t3];
-	c1[t3]=wa[idij-1]*ch[t3]+wa[idij]*ch[t3-1];
-	t3+=ido;
-      }
-    }
-  }
-  return;
-
- L139:
-  is= -ido-1;
-  t1=0;
-  for(j=1;j<ip;j++){
-    is+=ido;
-    t1+=t0;
-    t2=t1;
-    for(k=0;k<l1;k++){
-      idij=is;
-      t3=t2;
-      for(i=2;i<ido;i+=2){
-	idij+=2;
-	t3+=2;
-	c1[t3-1]=wa[idij-1]*ch[t3-1]-wa[idij]*ch[t3];
-	c1[t3]=wa[idij-1]*ch[t3]+wa[idij]*ch[t3-1];
-      }
-      t2+=ido;
-    }
-  }
-}
-
-STIN void drftb1(int n, double *c, double *ch, double *wa, int *ifac){
-  int i,k1,l1,l2;
-  int na;
-  int nf,ip,iw,ix2,ix3,ido,idl1;
-
-  nf=ifac[1];
-  na=0;
-  l1=1;
-  iw=1;
-
-  for(k1=0;k1<nf;k1++){
-    ip=ifac[k1 + 2];
-    l2=ip*l1;
-    ido=n/l2;
-    idl1=ido*l1;
-    if(ip!=4)goto L103;
-    ix2=iw+ido;
-    ix3=ix2+ido;
-
-    if(na!=0)
-      dradb4(ido,l1,ch,c,wa+iw-1,wa+ix2-1,wa+ix3-1);
-    else
-      dradb4(ido,l1,c,ch,wa+iw-1,wa+ix2-1,wa+ix3-1);
-    na=1-na;
-    goto L115;
-
-  L103:
-    if(ip!=2)goto L106;
-
-    if(na!=0)
-      dradb2(ido,l1,ch,c,wa+iw-1);
-    else
-      dradb2(ido,l1,c,ch,wa+iw-1);
-    na=1-na;
-    goto L115;
-
-  L106:
-    if(ip!=3)goto L109;
-
-    ix2=iw+ido;
-    if(na!=0)
-      dradb3(ido,l1,ch,c,wa+iw-1,wa+ix2-1);
-    else
-      dradb3(ido,l1,c,ch,wa+iw-1,wa+ix2-1);
-    na=1-na;
-    goto L115;
-
-  L109:
-/*    The radix five case can be translated later..... */
-/*    if(ip!=5)goto L112;
-
-    ix2=iw+ido;
-    ix3=ix2+ido;
-    ix4=ix3+ido;
-    if(na!=0)
-      dradb5(ido,l1,ch,c,wa+iw-1,wa+ix2-1,wa+ix3-1,wa+ix4-1);
-    else
-      dradb5(ido,l1,c,ch,wa+iw-1,wa+ix2-1,wa+ix3-1,wa+ix4-1);
-    na=1-na;
-    goto L115;
-
-  L112:*/
-    if(na!=0)
-      dradbg(ido,ip,l1,idl1,ch,ch,ch,c,c,wa+iw-1);
-    else
-      dradbg(ido,ip,l1,idl1,c,c,c,ch,ch,wa+iw-1);
-    if(ido==1)na=1-na;
-
-  L115:
-    l1=l2;
-    iw+=(ip-1)*ido;
-  }
-
-  if(na==0)return;
-
-  for(i=0;i<n;i++)c[i]=ch[i];
-}
-
-void __ogg_fdrfftb(int n, double *r, double *wsave, int *ifac){
-  if (n == 1)return;
-  drftb1(n, r, wsave, wsave+n, ifac);
-}
-
-STIN void dcsqb1(int n,double *x,double *w,double *xh,int *ifac){
-  int modn,i,k,kc;
-  int np2,ns2;
-  double xim1;
-
-  ns2=(n+1)>>1;
-  np2=n;
-
-  for(i=2;i<n;i+=2){
-    xim1=x[i-1]+x[i];
-    x[i]-=x[i-1];
-    x[i-1]=xim1;
-  }
-
-  x[0]+=x[0];
-  modn=n%2;
-  if(modn==0)x[n-1]+=x[n-1];
-
-  __ogg_fdrfftb(n,x,xh,ifac);
-
-  kc=np2;
-  for(k=1;k<ns2;k++){
-    kc--;
-    xh[k]=w[k-1]*x[kc]+w[kc-1]*x[k];
-    xh[kc]=w[k-1]*x[k]-w[kc-1]*x[kc];
-  }
-
-  if(modn==0)x[ns2]=w[ns2-1]*(x[ns2]+x[ns2]);
-
-  kc=np2;
-  for(k=1;k<ns2;k++){
-    kc--;
-    x[k]=xh[k]+xh[kc];
-    x[kc]=xh[k]-xh[kc];
-  }
-  x[0]+=x[0];
-}
-
-void __ogg_fdcosqb(int n,double *x,double *wsave,int *ifac){
-  static double tsqrt2 = 2.8284271247461900976033774484194;
-  double x1;
-
-  if(n<2){
-    x[0]*=4;
-    return;
-  }
-  if(n==2){
-    x1=(x[0]+x[1])*4;
-    x[1]=tsqrt2*(x[0]-x[1]);
-    x[0]=x1;
-    return;
-  }
-  
-  dcsqb1(n,x,wsave,wsave+n,ifac);
-}
--- a/kerneltest/e32utils/nistsecurerng/src/discreteFourierTransform.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-#include "openc.h"
-#include "../include/externs.h"
-#include "../include/utilities.h"
-#include "../include/cephes.h"
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-         D I S C R E T E  F O U R I E R  T R A N S F O R M  T E S T 
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-void  __ogg_fdrffti(int n, double* wsave, int* ifac);
-void  __ogg_fdrfftf(int n, double* X, double* wsave, int* ifac);
-
-void
-DiscreteFourierTransform(int n)
-{
-	double     p_value, upperBound, percentile, N_l, N_o, d;
-	double*    m = NULL;
-	double*    X = NULL;
-	double*    wsave = NULL;
-	int*       ifac = NULL;
-	int		i, count;
-	
-	if ( ((X = (double*) calloc(n,sizeof(double))) == NULL) ||
-		 ((wsave = (double *)calloc(2*n+15,sizeof(double))) == NULL) ||
-		 ((ifac = (int *)calloc(15,sizeof(int))) == NULL) ||
-		 ((m = (double*)calloc(n/2+1, sizeof(double))) == NULL) ) {
-			fprintf(stats[7],"\t\tUnable to allocate working arrays for the DFT.\n");
-			if( X != NULL )
-				free(X);
-			if( wsave != NULL )
-				free(wsave);
-			if( ifac != NULL )
-				free(ifac);
-			if( m != NULL )
-				free(m);
-			return;
-	}
-	for ( i=0; i<n; i++ )
-		X[i] = 2*(int)epsilon[i] - 1;
-	
-	__ogg_fdrffti(n, wsave, ifac);		/* INITIALIZE WORK ARRAYS */
-	__ogg_fdrfftf(n, X, wsave, ifac);	/* APPLY FORWARD FFT */
-	
-	m[0] = sqrt(X[0]*X[0]);	    /* COMPUTE MAGNITUDE */
-	
-	for ( i=0; i<n/2; i++ ) {	   	    /* DISPLAY FOURIER POINTS */
-		m[i+1] = sqrt(pow(X[2*i+1],2)+pow(X[2*i+2],2)); 
-	}
-	count = 0;				       /* CONFIDENCE INTERVAL */
-	upperBound = sqrt(2.995732274*n);
-	for ( i=0; i<n/2; i++ )
-		if ( m[i] < upperBound )
-			count++;
-	percentile = (double)count/(n/2)*100;
-	N_l = (double) count;       /* number of peaks less than h = sqrt(3*n) */
-	N_o = (double) 0.95*n/2.0;
-	d = (N_l - N_o)/sqrt(n/2.0*0.95*0.05);
-	p_value = erfc(fabs(d)/sqrt(2.0));
-
-	fprintf(stats[TEST_FFT], "\t\t\t\tFFT TEST\n");
-	fprintf(stats[TEST_FFT], "\t\t-------------------------------------------\n");
-	fprintf(stats[TEST_FFT], "\t\tCOMPUTATIONAL INFORMATION:\n");
-	fprintf(stats[TEST_FFT], "\t\t-------------------------------------------\n");
-	fprintf(stats[TEST_FFT], "\t\t(a) Percentile = %f\n", percentile);
-	fprintf(stats[TEST_FFT], "\t\t(b) N_l        = %f\n", N_l);
-	fprintf(stats[TEST_FFT], "\t\t(c) N_o        = %f\n", N_o);
-	fprintf(stats[TEST_FFT], "\t\t(d) d          = %f\n", d);
-	fprintf(stats[TEST_FFT], "\t\t-------------------------------------------\n");
-
-	fprintf(stats[TEST_FFT], "%s\t\tp_value = %f\n\n", p_value < ALPHA ? "FAILURE" : "SUCCESS", p_value);
-	fprintf(results[TEST_FFT], "%f\n", p_value);
-
-	free(X);
-	free(wsave);
-	free(ifac);
-	free(m);
-}
--- a/kerneltest/e32utils/nistsecurerng/src/frequency.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-#include "openc.h"
-#include "../include/externs.h"
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-                          F R E Q U E N C Y  T E S T
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-void
-Frequency(int n)
-{
-	int		i;
-	double	f, s_obs, p_value, sum, sqrt2 = 1.41421356237309504880;
-	
-	sum = 0.0;
-	for ( i=0; i<n; i++ )
-		sum += 2*(int)epsilon[i]-1;
-	s_obs = fabs(sum)/sqrt(n);
-	f = s_obs/sqrt2;
-	p_value = erfc(f);
-
-	fprintf(stats[TEST_FREQUENCY], "\t\t\t      FREQUENCY TEST\n");
-	fprintf(stats[TEST_FREQUENCY], "\t\t---------------------------------------------\n");
-	fprintf(stats[TEST_FREQUENCY], "\t\tCOMPUTATIONAL INFORMATION:\n");
-	fprintf(stats[TEST_FREQUENCY], "\t\t---------------------------------------------\n");
-	fprintf(stats[TEST_FREQUENCY], "\t\t(a) The nth partial sum = %d\n", (int)sum);
-	fprintf(stats[TEST_FREQUENCY], "\t\t(b) S_n/n               = %f\n", sum/n);
-	fprintf(stats[TEST_FREQUENCY], "\t\t---------------------------------------------\n");
-
-	fprintf(stats[TEST_FREQUENCY], "%s\t\tp_value = %f\n\n", p_value < ALPHA ? "FAILURE" : "SUCCESS", p_value);
-	fprintf(results[TEST_FREQUENCY], "%f\n", p_value);
-}
--- a/kerneltest/e32utils/nistsecurerng/src/generators.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,510 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-#include "openc.h"
-#include "../include/externs.h"
-#include "../include/utilities.h"
-#include "../include/generators.h"
-#include "../include/genutils.h"
-
-const int KRandomByteCount = 1024;
-
-double
-lcg_rand(int N, double SEED, double* DUNIF, int NDIM)
-{
-	int    i;
-	double	DZ, DOVER, DZ1, DZ2, DOVER1, DOVER2;
-	double	DTWO31, DMDLS, DA1, DA2;
-
-	DTWO31 = 2147483648.0; /* DTWO31=2**31  */
-	DMDLS  = 2147483647.0; /* DMDLS=2**31-1 */
-	DA1 = 41160.0;       /* DA1=950706376 MOD 2**16 */
-	DA2 = 950665216.0;   /* DA2=950706376-DA1 */
-
-	DZ = SEED;
-	if ( N > NDIM )
-		N = NDIM;
-	for ( i=1; i<=N; i++ ) {
-		DZ = floor(DZ);
-		DZ1 = DZ*DA1;
-		DZ2 = DZ*DA2;
-		DOVER1 = floor(DZ1/DTWO31);
-		DOVER2 = floor(DZ2/DTWO31);
-		DZ1 = DZ1-DOVER1*DTWO31;
-		DZ2 = DZ2-DOVER2*DTWO31;
-		DZ = DZ1+DZ2+DOVER1+DOVER2;
-		DOVER = floor(DZ/DMDLS);
-		DZ = DZ-DOVER*DMDLS;
-		DUNIF[i-1] = DZ/DMDLS;
-		SEED = DZ;
-	}
-
-	return SEED;
-}
-
-void
-lcg()
-{
-	double*    DUNIF = NULL;
-	double     SEED;
-	int		i;
-	unsigned bit;
-	int		num_0s, num_1s, v, bitsRead;
-
-	SEED = 23482349.0;
-	if ( ((epsilon = (BitSequence *) calloc(tp.n, sizeof(BitSequence))) == NULL) ||
-	     ((DUNIF = (double*)calloc(tp.n, sizeof(double))) == NULL) ) {
-		printf("Insufficient memory available.\n");
-		exit(1);
-	}
-	 
-	for ( v=0; v<tp.numOfBitStreams; v++ ) {
-		num_0s = 0;
-		num_1s = 0;
-		bitsRead = 0;
-		SEED = lcg_rand(tp.n, SEED, DUNIF, tp.n);
-		for ( i=0; i<tp.n; i++ ) {
-			if ( DUNIF[i] < 0.5 ) {
-				bit = 0;
-				num_0s++;
-			}
-			else {
-				bit = 1;
-				num_1s++;
-			}
-			bitsRead++;
-			epsilon[i] = (BitSequence)bit;
-		}
-		fprintf(freqfp, "\t\tBITSREAD = %d 0s = %d 1s = %d\n", bitsRead, num_0s, num_1s);
-		nist_test_suite();
-		}
-	free(DUNIF);
-	free(epsilon);
-}
-
-
-void
-quadRes1()
-{
-	int		k, num_0s, num_1s, bitsRead, done;
-	BYTE	p[64], g[64], x[128];
-	
-	if ( ((epsilon = (BitSequence *)calloc(tp.n, sizeof(BitSequence))) == NULL) ) {
-		printf("Insufficient memory available.\n");
-		exit(1);
-	}
-	ahtopb("987b6a6bf2c56a97291c445409920032499f9ee7ad128301b5d0254aa1a9633fdbd378d40149f1e23a13849f3d45992f5c4c6b7104099bc301f6005f9d8115e1", p, 64);
-	ahtopb("3844506a9456c564b8b8538e0cc15aff46c95e69600f084f0657c2401b3c244734b62ea9bb95be4923b9b7e84eeaf1a224894ef0328d44bc3eb3e983644da3f5", g, 64);
-	num_0s = 0;
-	num_1s = 0;
-	done = 0;
-	bitsRead = 0;
-	for ( k=0; k<tp.numOfBitStreams; k++ ) {
-		num_0s = 0;
-		num_1s = 0;
-		done = 0;
-		bitsRead = 0;
-		do {
-			memset(x, 0x00, 128);
-			ModMult(x, g, 64, g, 64, p,64);
-			memcpy(g, x+64, 64);
-			done = convertToBits(g, 512, tp.n, &num_0s, &num_1s, &bitsRead);
-		} while ( !done );
-		fprintf(freqfp, "\t\tBITSREAD = %d 0s = %d 1s = %d\n", bitsRead, num_0s, num_1s);
-		nist_test_suite();
-	}
-	free(epsilon);
-
-	return;
-}
-
-void
-quadRes2()
-{
-	BYTE	g[64], x[129], t1[65];
-	BYTE	One[1], Two, Three[1];
-	int		k, num_0s, num_1s, bitsRead, done;
-	
-	if ( ((epsilon = (BitSequence *)calloc(tp.n, sizeof(BitSequence))) == NULL) ) {
-		printf("Insufficient memory available.\n");
-		exit(1);
-	}
-	One[0] = 0x01;
-	Two = 0x02;
-	Three[0] = 0x03;
-
-	ahtopb("7844506a9456c564b8b8538e0cc15aff46c95e69600f084f0657c2401b3c244734b62ea9bb95be4923b9b7e84eeaf1a224894ef0328d44bc3eb3e983644da3f5", g, 64);
-	
-	for( k=0; k<tp.numOfBitStreams; k++ ) {
-		num_0s = 0;
-		num_1s = 0;
-		done = 0;
-		bitsRead = 0;
-		do {
-			memset(t1, 0x00, 65);
-			memset(x, 0x00, 129);
-			smult(t1, Two, g, 64);		/* 2x */
-			add(t1, 65, Three, 1);		/* 2x+3 */
-			Mult(x, t1, 65, g, 64);		/* x(2x+3) */
-			add(x, 129, One, 1);		/* x(2x+3)+1 */
-			memcpy(g, x+65, 64);
-			done = convertToBits(g, 512, tp.n, &num_0s, &num_1s, &bitsRead);
-		} while ( !done) ;
-		fprintf(freqfp, "\t\tBITSREAD = %d 0s = %d 1s = %d\n", bitsRead, num_0s, num_1s);
-		nist_test_suite();
-	}
-	free(epsilon);
-
-	return;
-}
-
-void
-cubicRes()
-{
-	BYTE	g[64], tmp[128], x[192];
-	int		k, num_0s, num_1s, bitsRead, done;
-	
-	if ( ((epsilon = (BitSequence *)calloc(tp.n, sizeof(BitSequence))) == NULL) ) {
-		printf("Insufficient memory available.\n");
-		exit(1);
-	}
-	
-	ahtopb("7844506a9456c564b8b8538e0cc15aff46c95e69600f084f0657c2401b3c244734b62ea9bb95be4923b9b7e84eeaf1a224894ef0328d44bc3eb3e983644da3f5", g, 64);
-
-	for ( k=0; k<tp.numOfBitStreams; k++ ) {
-		num_0s = 0;
-		num_1s = 0;
-		bitsRead = 0;
-		done = 0;
-		do {
-			memset(tmp, 0x00, 128);
-			memset(x, 0x00, 192);
-			Mult(tmp, g, 64, g, 64);
-			Mult(x, tmp, 128, g, 64); // Don't need to mod by 2^512, just take low 64 bytes
-			memcpy(g, x+128, 64);
-			done = convertToBits(g, 512, tp.n, &num_0s, &num_1s, &bitsRead);
-		} while ( !done );
-		fprintf(freqfp, "\t\tBITSREAD = %d 0s = %d 1s = %d\n", bitsRead, num_0s, num_1s);
-		nist_test_suite();
-	}
-	free(epsilon);
-
-	return;
-}
-
-void
-exclusiveOR()
-{
-	int		i, num_0s, num_1s, bitsRead;
-	BYTE	bit_sequence[127];
-	
-	if ( ((epsilon = (BitSequence *)calloc(tp.n,sizeof(BitSequence))) == NULL) ) {
-		printf("Insufficient memory available.\n");
-		exit(1);
-	}
-
-	memcpy(bit_sequence, "0001011011011001000101111001001010011011101101000100000010101111111010100100001010110110000000000100110000101110011111111100111", 127);
-	num_0s = 0;
-	num_1s = 0;
-	bitsRead = 0;
-	for (i=0; i<127; i++ ) {
-		if ( bit_sequence[i]  ) {
-			epsilon[bitsRead] = 1;
-			num_1s++;
-		}
-		else {
-			epsilon[bitsRead] = 0;
-			num_1s++;
-		}
-		bitsRead++;
-	}
-	for ( i=127; i<tp.n*tp.numOfBitStreams; i++ ) {
-		if ( bit_sequence[(i-1)%127] != bit_sequence[(i-127)%127] ) {
-			bit_sequence[i%127] = 1;
-			epsilon[bitsRead] = 1;
-			num_1s++;
-		}
-		else {
-			bit_sequence[i%127] = 0;
-			epsilon[bitsRead] = 0;
-			num_0s++;
-		}
-		bitsRead++;
-		if ( bitsRead == tp.n ) {
-			fprintf(freqfp, "\t\tBITSREAD = %d 0s = %d 1s = %d\n", bitsRead, num_0s, num_1s);
-			nist_test_suite();
-			num_0s = 0;
-			num_1s = 0;
-			bitsRead = 0;
-		}
-	}
-	free(epsilon);
-		
-	return;
-}
-
-
-void
-modExp()
-{
-	int		k, num_0s, num_1s, bitsRead, done;
-	BYTE	p[64], g[64], x[192], y[20];
-
-	if ( (epsilon = (BitSequence *)calloc(tp.n, sizeof(BitSequence))) == NULL ) {
-		printf("Insufficient memory available.\n");
-		exit(1);
-	}
-	ahtopb("7AB36982CE1ADF832019CDFEB2393CABDF0214EC", y, 20);
-	ahtopb("987b6a6bf2c56a97291c445409920032499f9ee7ad128301b5d0254aa1a9633fdbd378d40149f1e23a13849f3d45992f5c4c6b7104099bc301f6005f9d8115e1", p, 64);
-	ahtopb("3844506a9456c564b8b8538e0cc15aff46c95e69600f084f0657c2401b3c244734b62ea9bb95be4923b9b7e84eeaf1a224894ef0328d44bc3eb3e983644da3f5", g, 64);
-
-	for ( k=0; k<tp.numOfBitStreams; k++ ) {
-		num_0s = 0;
-		num_1s = 0;
-		bitsRead = 0;
-		done = 0;
-		do {
-			memset(x, 0x00, 128);
-			ModExp(x, g, 64, y, 20, p, 64);	      /* NOTE:  g must be less than p */
-			done = convertToBits(x, 512, tp.n, &num_0s, &num_1s, &bitsRead);
-			memcpy(y, x+44, 20);
-			} while ( !done );
-		fprintf(freqfp, "\t\tBITSREAD = %d 0s = %d 1s = %d\n", bitsRead, num_0s, num_1s);
-		nist_test_suite();
-	}
-	free(epsilon);
-
-	return;
-}
-
-void
-bbs()
-{
-	int		i, v, bitsRead;
-	BYTE	p[64], q[64], n[128], s[64], x[256];
-	int		num_0s, num_1s;
-
-	if ( (epsilon = (BitSequence*)calloc(tp.n, sizeof(BitSequence))) == NULL ) {
-		printf("Insufficient memory available.\n");
-		exit(1);
-	}
-	ahtopb("E65097BAEC92E70478CAF4ED0ED94E1C94B154466BFB9EC9BE37B2B0FF8526C222B76E0E915017535AE8B9207250257D0A0C87C0DACEF78E17D1EF9DC44FD91F", p, 64);
-	ahtopb("E029AEFCF8EA2C29D99CB53DD5FA9BC1D0176F5DF8D9110FD16EE21F32E37BA86FF42F00531AD5B8A43073182CC2E15F5C86E8DA059E346777C9A985F7D8A867", q, 64);
-	memset(n, 0x00, 128);
-	Mult(n, p, 64, q, 64);
-	memset(s, 0x00, 64);
-	ahtopb("10d6333cfac8e30e808d2192f7c0439480da79db9bbca1667d73be9a677ed31311f3b830937763837cb7b1b1dc75f14eea417f84d9625628750de99e7ef1e976", s, 64);
-	memset(x, 0x00, 256);
-	ModSqr(x, s, 64, n, 128);
- 
-	for ( v=0; v<tp.numOfBitStreams; v++ ) {
-		num_0s = 0;
-		num_1s = 0;
-		bitsRead = 0;
-		for ( i=0; i<tp.n; i++ ) {
-			ModSqr(x, x, 128, n, 128);
-			memcpy(x, x+128, 128);
-			if ( (x[127] & 0x01) == 0 ) {
-				num_0s++;
-				epsilon[i] = 0;
-			}
-			else {
-				num_1s++;
-				epsilon[i] = 1;
-			}
-			bitsRead++;
-			if ( (i % 50000) == 0 )
-				printf("\t\tBITSREAD = %d 0s = %d 1s = %d\n", bitsRead, num_0s, num_1s);
-		}
-
-		fprintf(freqfp, "\t\tBITSREAD = %d 0s = %d 1s = %d\n", bitsRead, num_0s, num_1s);
-		nist_test_suite();
-	}
-	free(epsilon);
-}
-
-
-// The exponent, e, is set to 11
-// This results in k = 837 and r = 187
-void
-micali_schnorr()
-{
-	long	i, j;
-	int		k=837, num_0s, num_1s, bitsRead, done;
-	BYTE	p[64], q[64], n[128], e[1], X[128], Y[384], Tail[105];
-
-	if ( (epsilon = (BitSequence *)calloc(tp.n, sizeof(BitSequence))) == NULL ) {
-		printf("Insufficient memory available.\n");
-		exit(1);
-	}
-	ahtopb("E65097BAEC92E70478CAF4ED0ED94E1C94B154466BFB9EC9BE37B2B0FF8526C222B76E0E915017535AE8B9207250257D0A0C87C0DACEF78E17D1EF9DC44FD91F", p, 64);
-	ahtopb("E029AEFCF8EA2C29D99CB53DD5FA9BC1D0176F5DF8D9110FD16EE21F32E37BA86FF42F00531AD5B8A43073182CC2E15F5C86E8DA059E346777C9A985F7D8A867", q, 64);
-	memset(n, 0x00, 128);
-	Mult(n, p, 64, q, 64);
-	e[0] = 0x0b;
-	memset(X, 0x00, 128);
-	ahtopb("237c5f791c2cfe47bfb16d2d54a0d60665b20904ec822a6", X+104, 24);
-
-	for ( i=0; i<tp.numOfBitStreams; i++ ) {
-		num_0s = 0;
-		num_1s = 0;
-		bitsRead = 0;
-		do {
-			ModExp(Y, X, 128, e, 1, n, 128);
-			memcpy(Tail, Y+23, 105);
-			for ( j=0; j<3; j++ )
-				bshl(Tail, 105);
-			done = convertToBits(Tail, k, tp.n, &num_0s, &num_1s, &bitsRead);
-			memset(X, 0x00, 128);
-			memcpy(X+104, Y, 24);
-			for ( j=0; j<5; j++ )
-				bshr(X+104, 24);
-		} while ( !done );
-
-		fprintf(freqfp, "\t\tBITSREAD = %d 0s = %d 1s = %d\n", bitsRead, num_0s, num_1s);
-		nist_test_suite();
-	}
-	free(epsilon);
-}
-
-//  Uses 160 bit Xkey and no XSeed (b=160)
-//  This is the generic form of the generator found on the last page of the Change Notice for FIPS 186-2
-void
-SHA1()
-{
-	ULONG	A, B, C, D, E, temp, Wbuff[16];
-	BYTE	Xkey[20], G[20], M[64];
-	BYTE	One[1] = { 0x01 };
-	int		i, num_0s, num_1s, bitsRead;
-	int		done;
-	ULONG	tx[5] = { 0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0 };
-	
-	if ( ((epsilon = (BitSequence *) calloc(tp.n,sizeof(BitSequence))) == NULL) ) {
-		printf("Insufficient memory available.\n");
-		exit(1);
-	}
-
-	ahtopb("ec822a619d6ed5d9492218a7a4c5b15d57c61601", Xkey, 20);
-	
-	for ( i=0; i<tp.numOfBitStreams; i++ ) {
-		num_0s = 0;
-		num_1s = 0;
-		bitsRead = 0;
-		do {
-			memcpy(M, Xkey, 20);
-			memset(M+20, 0x00, 44);
-			
-			// Start: SHA Steps A-E
-			A = tx[0];
-			B = tx[1];
-			C = tx[2];
-			D = tx[3];
-			E = tx[4];
-
-			memcpy((BYTE *)Wbuff, M, 64);
-#ifdef LITTLE_ENDIAN
-			byteReverse(Wbuff, 20);
-#endif
-			sub1Round1( 0 );  sub1Round1( 1 );  sub1Round1( 2 );  sub1Round1( 3 );
-			sub1Round1( 4 );  sub1Round1( 5 );  sub1Round1( 6 );  sub1Round1( 7 );
-			sub1Round1( 8 );  sub1Round1( 9 );  sub1Round1( 10 ); sub1Round1( 11 );
-			sub1Round1( 12 ); sub1Round1( 13 ); sub1Round1( 14 ); sub1Round1( 15 );
-			sub2Round1( 16 ); sub2Round1( 17 ); sub2Round1( 18 ); sub2Round1( 19 );
-			Round2( 20 ); Round2( 21 ); Round2( 22 ); Round2( 23 );
-			Round2( 24 ); Round2( 25 ); Round2( 26 ); Round2( 27 );
-			Round2( 28 ); Round2( 29 ); Round2( 30 ); Round2( 31 );
-			Round2( 32 ); Round2( 33 ); Round2( 34 ); Round2( 35 );
-			Round2( 36 ); Round2( 37 ); Round2( 38 ); Round2( 39 );
-			Round3( 40 ); Round3( 41 ); Round3( 42 ); Round3( 43 );
-			Round3( 44 ); Round3( 45 ); Round3( 46 ); Round3( 47 );
-			Round3( 48 ); Round3( 49 ); Round3( 50 ); Round3( 51 );
-			Round3( 52 ); Round3( 53 ); Round3( 54 ); Round3( 55 );
-			Round3( 56 ); Round3( 57 ); Round3( 58 ); Round3( 59 );
-			Round4( 60 ); Round4( 61 ); Round4( 62 ); Round4( 63 );
-			Round4( 64 ); Round4( 65 ); Round4( 66 ); Round4( 67 );
-			Round4( 68 ); Round4( 69 ); Round4( 70 ); Round4( 71 );
-			Round4( 72 ); Round4( 73 ); Round4( 74 ); Round4( 75 );
-			Round4( 76 ); Round4( 77 ); Round4( 78 ); Round4( 79 );
-			
-			A += tx[0];
-			B += tx[1];
-			C += tx[2];
-			D += tx[3];
-			E += tx[4];
-			
-			memcpy(G, (BYTE *)&A, 4);
-			memcpy(G+4, (BYTE *)&B, 4);
-			memcpy(G+8, (BYTE *)&C, 4);
-			memcpy(G+12, (BYTE *)&D, 4);
-			memcpy(G+16, (BYTE *)&E, 4);
-#ifdef LITTLE_ENDIAN
-			byteReverse((ULONG *)G, 20);
-#endif
-			// End: SHA Steps A-E
-
-			done = convertToBits(G, 160, tp.n, &num_0s, &num_1s, &bitsRead);
-			add(Xkey, 20, G, 20);
-			add(Xkey, 20, One, 1);
-		} while ( !done );
-		fprintf(freqfp, "\t\tBITSREAD = %d 0s = %d 1s = %d\n", bitsRead, num_0s, num_1s);
-		nist_test_suite();
-	}
-	free(epsilon);
-}
-
-void HASH_DRBG()
-    {
-    int     done = 0;
-    int     num_0s = 0;
-    int     num_1s = 0;
-    int     bitsRead = 0;
-
-    if ( ((epsilon = (BitSequence *) calloc(tp.n,sizeof(BitSequence))) == NULL) ) {
-        printf("Insufficient memory available.\n");
-        exit(1);
-    }
-    
-    TBuf8<KRandomByteCount> randBuffer(KRandomByteCount);
-
-    for (int i = 0; i < tp.numOfBitStreams; ++i) 
-        {
-        gConsole->Printf(_L("Starting test %d\n"), i+1);
-        num_0s = 0;
-        num_1s = 0;
-        bitsRead = 0;
-        done = 0;
-        do 
-            {
-            Math::Random(randBuffer);
-            done = convertToBits(randBuffer.Ptr() , KRandomByteCount*8, tp.n, &num_0s, &num_1s, &bitsRead);
-            } while ( !done );
-        fprintf(freqfp, "\t\tBITSREAD = %d 0s = %d 1s = %d\n", bitsRead, num_0s, num_1s);
-        
-        nist_test_suite();
-        }
-        free(epsilon);
-    }
-
--- a/kerneltest/e32utils/nistsecurerng/src/genutils.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,693 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-/*
- * file: mp.c
- *
- * DESCRIPTION
- *
- * These functions comprise a multi-precision integer arithmetic
- * and discrete function package.
- */
-
-#include	"../include/genutils.h"
-
-#define	MAXPLEN		384
-
-
-/*****************************************
-** greater - Test if x > y               *
-**                                       *
-** Returns TRUE (1) if x greater than y, *
-** otherwise FALSE (0).                  *
-**                                       *
-** Parameters:                           *
-**                                       *
-**  x      Address of array x            *
-**  y      Address of array y            *
-**  l      Length both x and y in bytes  *
-**                                       *
-******************************************/ 
-int greater(BYTE *x, BYTE *y, int l)
-{
-	int		i;
-
-	for ( i=0; i<l; i++ )
-		if ( x[i] != y[i] )
-			break;
-
-	if ( i == l )
-		return 0;
-
-	if ( x[i] > y[i] )
-		return 1;
-
-	return 0;
-}
-
-
-/*****************************************
-** less - Test if x < y                  *
-**                                       *
-** Returns TRUE (1) if x less than y,    *
-** otherwise FALSE (0).                  *
-**                                       *
-** Parameters:                           *
-**                                       *
-**  x      Address of array x            *
-**  y      Address of array y            *
-**  l      Length both x and y in bytes  *
-**                                       *
-******************************************/ 
-int less(BYTE *x, BYTE *y, int l)
-{
-	int		i;
-
-	for ( i=0; i<l; i++ )
-		if ( x[i] != y[i] )
-			break;
-
-	if ( i == l ) {
-		return 0;
-	}
-
-	if ( x[i] < y[i] ) {
-		return 1;
-	}
-
-	return 0;
-}
-
-
-/*****************************************
-** bshl - shifts array left              *
-**                  by one bit.          *
-**                                       *	
-** x = x * 2                             *
-**                                       *
-** Parameters:                           *	
-**                                       *
-**  x      Address of array x            *
-**  l      Length array x in bytes       *
-**                                       *
-******************************************/ 
-BYTE bshl(BYTE *x, int l)
-{
-	BYTE	*p;
-	int		c1, c2;
-
-	p = x + l - 1;
-	c1 = 0;
-	c2 = 0;
-	while ( p != x ) {
-		if ( *p & 0x80 )
-			c2 = 1;
-		*p <<= 1;  /* shift the word left once (ls bit = 0) */
-		if ( c1 )
-			*p |= 1;
-		c1 = c2;
-		c2 = 0;
-		p--;
-	}
-
-	if ( *p & 0x80 )
-		c2 = 1;
-	*p <<= 1;  /* shift the word left once (ls bit = 0) */
-	if ( c1 )
-		*p |= (DIGIT)1;
-
-	return (BYTE)c2;
-}
-
-
-/*****************************************
-** bshr - shifts array right             *
-**                   by one bit.         *
-**                                       *	
-** x = x / 2                             *
-**                                       *
-** Parameters:                           *	
-**                                       *
-**  x      Address of array x            *
-**  l      Length array x in bytes       *	
-**                                       *
-******************************************/
-void bshr(BYTE *x, int l)	
-{
-	BYTE	*p;
-	int		c1,c2;
-
-	p = x;
-	c1 = 0;
-	c2 = 0;
-	while ( p != x+l-1 ) {
-		if ( *p & 0x01 )
-			c2 = 1;
-		*p >>= 1;  /* shift the word right once (ms bit = 0) */
-		if ( c1 )
-			*p |= 0x80;
-		c1 = c2;
-		c2 = 0;
-		p++;
-	}
-
-	*p >>= 1;  /* shift the word right once (ms bit = 0) */
-	if ( c1 )
-		*p |= 0x80;
-}
-
-
-/*****************************************
-** Mult - Multiply two integers          *
-**                                       *
-** A = B * C                             *
-**                                       *
-** Parameters:                           *	
-**                                       *
-**  A      Address of the result         *
-**  B      Address of the multiplier     *
-**  C      Address of the multiplicand   *
-**  LB      Length of B in bytes         *
-**  LC      Length of C in bytes         *
-**                                       *
-**  NOTE:  A MUST be LB+LC in length     *
-**                                       *
-******************************************/
-int Mult(BYTE *A, BYTE *B, int LB, BYTE *C, int LC)
-{
-	int    i, j;
-	int    k = 0;
-	DIGIT	result;
-
-
-	for ( i=LB-1; i>=0; i-- ) {
-		result = 0;
-		for ( j=LC-1; j>=0; j-- ) {
-			k = i+j+1;
-			result = (DIGIT)((DIGIT)A[k] + ((DIGIT)(B[i] * C[j])) + (result >> 8));
-			A[k] = (BYTE)result;
-			}
-		A[--k] = (BYTE)(result >> 8);
-	}
-
-	return 0;
-}
-
-
-void ModSqr(BYTE *A, BYTE *B, int LB, BYTE *M, int LM)
-{
-
-	Square(A, B, LB);
-	Mod(A, 2*LB, M, LM);
-}
-
-void ModMult(BYTE *A, BYTE *B, int LB, BYTE *C, int LC, BYTE *M, int LM)
-{
-	Mult(A, B, LB, C, LC);
-	Mod(A, (LB+LC), M, LM);
-}
-
-
-/*****************************************
-** smult - Multiply array by a scalar.   *
-**                                       *
-** A = b * C                             *
-**                                       *
-** Parameters:                           *	
-**                                       *
-**  A      Address of the result         *
-**  b      Scalar (1 BYTE)               *
-**  C      Address of the multiplicand   *
-**  L      Length of C in bytes          *
-**                                       *
-**  NOTE:  A MUST be L+1 in length       *
-**                                       *
-******************************************/
-void smult(BYTE *A, BYTE b, BYTE *C, int L)
-{
-	int		i;
-	DIGIT	result;
-
-	result = 0;
-	for ( i=L-1; i>0; i-- ) {
-		result = (DIGIT)(A[i] + ((DIGIT)b * C[i]) + (result >> 8));
-		A[i] = (BYTE)(result & 0xff);
-		A[i-1] = (BYTE)(result >> 8);
-	}
-}
-
-/*****************************************
-** Square() - Square an integer          *
-**                                       *
-** A = B^2                               *
-**                                       *
-** Parameters:                           *
-**                                       *
-**  A      Address of the result         *
-**  B      Address of the operand        *
-**  L      Length of B in bytes          *
-**                                       *
-**  NOTE:  A MUST be 2*L in length       *
-**                                       *
-******************************************/
-void Square(BYTE *A, BYTE *B, int L)
-{
-	Mult(A, B, L, B, L);
-}
-
-/*****************************************
-** ModExp - Modular Exponentiation       *
-**                                       *
-** A = B ** C (MOD M)                    *
-**                                       *	
-** Parameters:                           *	
-**                                       *
-**  A      Address of result             *
-**  B      Address of mantissa           *
-**  C      Address of exponent           *
-**  M      Address of modulus            *
-**  LB     Length of B in bytes          *
-**  LC     Length of C in bytes          *
-**  LM     Length of M in bytes          *
-**                                       *
-**  NOTE: The integer B must be less     *
-**        than the modulus M.      	 *
-**  NOTE: A must be at least 3*LM        *
-**        bytes long.  However, the      *
-**        result stored in A will be     *
-**        only LM bytes long.            *
-******************************************/
-void ModExp(BYTE *A, BYTE *B, int LB, BYTE *C, int LC, BYTE *M, int LM)
-{
-	BYTE	wmask;
-	int		bits;
-
-	bits = LC*8;
-	wmask = 0x80;
-
-	A[LM-1] = 1;
-
-	while ( !sniff_bit(C,wmask) ) {
-		wmask >>= 1;
-		bits--;
-		if ( !wmask ) {
-			wmask = 0x80;
-			C++;
-		}
-	}
-
-	while ( bits-- ) {
-		memset(A+LM, 0x00, LM*2);
-
-		/* temp = A*A (MOD M) */
-		ModSqr(A+LM, A,LM,  M,LM);
-
-		/* A = lower L bytes of temp */
-		memcpy(A, A+LM*2, LM);
-		memset(A+LM, 0x00, 2*LM);
-
-		if ( sniff_bit(C,wmask) ) {
-			memset(A+LM, 0x00, (LM+LB));
-			ModMult(A+LM, B,LB, A,LM,  M,LM);       /* temp = B * A (MOD M) */
-			memcpy(A, A+LM+(LM+LB)-LM, LM);  /* A = lower LM bytes of temp */
-			memset(A+LM, 0x00, 2*LM);
-		}
- 
-		wmask >>= 1;
-		if ( !wmask ) {
-			wmask = 0x80;
-			C++;
-		}
-	}
-}
-
-
-/* DivMod:
- *
- *   computes:
- *         quot = x / n
- *         rem = x % n
- *   returns:
- *         length of "quot"
- *
- *  len of rem is lenx+1
- */
-int DivMod(BYTE *x, int lenx, BYTE *n, int lenn, BYTE *quot, BYTE *rem)
-{
-	BYTE	*tx, *tn, *ttx, *ts, bmult[1];
-	int		i, shift, lgth_x, lgth_n, t_len, lenq;
-	DIGIT	tMSn, mult;
-	ULONG	tMSx;
-	int		underflow;
-
-	tx = x;
-	tn = n;
-	
-	/* point to the MSD of n  */
-	for ( i=0, lgth_n=lenn; i<lenn; i++, lgth_n-- ) {
-		if ( *tn )
-			break;
-		tn++;
-	}
-	if ( !lgth_n )
-		return 0;
-	
-	/* point to the MSD of x  */
-	for ( i=0, lgth_x=lenx; i<lenx; i++, lgth_x-- ) {
-		if ( *tx )
-			break;
-		tx++;
-	}
-	if ( !lgth_x )
-		return 0;
-
-	if ( lgth_x < lgth_n )
-		lenq = 1;
-	else
-		lenq = lgth_x - lgth_n + 1;
-	memset(quot, 0x00, lenq);
-	
-	/* Loop while x > n,  WATCH OUT if lgth_x == lgth_n */
-	while ( (lgth_x > lgth_n) || ((lgth_x == lgth_n) && !less(tx, tn, lgth_n)) ) {
-		shift = 1;
-		if ( lgth_n == 1 ) {
-			if ( *tx < *tn ) {
-				tMSx = (DIGIT) (((*tx) << 8) | *(tx+1));
-				tMSn = *tn;
-				shift = 0;
-			}
-			else {
-				tMSx = *tx;
-				tMSn = *tn;
-			}
-		}
-		else if ( lgth_n > 1 ) {
-			tMSx = (DIGIT) (((*tx) << 8) | *(tx+1));
-			tMSn = (DIGIT) (((*tn) << 8) | *(tn+1));
-			if ( (tMSx < tMSn) || ((tMSx == tMSn) && less(tx, tn, lgth_n)) ) {
-				tMSx = (tMSx << 8) | *(tx+2);
-				shift = 0;
-			}
-		}
-		else {
-			tMSx = (DIGIT) (((*tx) << 8) | *(tx+1));
-			tMSn = *tn;
-			shift = 0;
-		}
-
-		mult = (DIGIT) (tMSx / tMSn);
-		if ( mult > 0xff )
-			mult = 0xff;
-		bmult[0] = (BYTE)(mult & 0xff);
-
-		ts = rem;
-		do {
-			memset(ts, 0x00, lgth_x+1);
-			Mult(ts, tn, lgth_n, bmult, 1);
-
-			underflow = 0;
-			if ( shift ) {
-				if ( ts[0] != 0 )
-					underflow = 1;
-				else {
-					for ( i=0; i<lgth_x; i++ )
-						ts[i] = ts[i+1];
-					ts[lgth_x] = 0x00;
-				}
-			}
-			if ( greater(ts, tx, lgth_x) || underflow ) {
-				bmult[0]--;
-				underflow = 1;
-			}
-			else
-				underflow = 0;
-		} while ( underflow );
-		sub(tx, lgth_x, ts, lgth_x);
-		if ( shift )
-			quot[lenq - (lgth_x - lgth_n) - 1] = bmult[0];
-		else
-			quot[lenq - (lgth_x - lgth_n)] = bmult[0];
-		
-		ttx = tx;
-		t_len = lgth_x;
-		for ( i=0, lgth_x=t_len; i<t_len; i++, lgth_x-- ) {
-			if ( *ttx )
-				break;
-			ttx++;
-		}
-		tx = ttx;
-	}
-	memset(rem, 0x00, lenn);
-	if ( lgth_x )
-		memcpy(rem+lenn-lgth_x, tx, lgth_x);
-
-	return lenq;
-}
-
-
-/* 
- * Mod - Computes an integer modulo another integer
- *
- * x = x (mod n)
- *
- */
-void Mod(BYTE *x, int lenx, BYTE *n, int lenn)
-{
-	BYTE	quot[MAXPLEN+1], rem[2*MAXPLEN+1];
-
-	memset(quot, 0x00, sizeof(quot));
-	memset(rem, 0x00, sizeof(rem));
-	if ( DivMod(x, lenx, n, lenn, quot, rem) ) {
-		memset(x, 0x00, lenx);
-		memcpy(x+lenx-lenn, rem, lenn);
-	}
-}
-
-/* 
- * Div - Computes the integer division of two numbers
- *
- * x = x / n
- *
- */
-void Div(BYTE *x, int lenx, BYTE *n, int lenn)
-{
-	BYTE	quot[MAXPLEN+1], rem[2*MAXPLEN+1];
-	int		lenq;
-
-	memset(quot, 0x00, sizeof(quot));
-	memset(rem, 0x00, sizeof(rem));
-	if ( (lenq = DivMod(x, lenx, n, lenn, quot, rem)) != 0 ) {
-		memset(x, 0x00, lenx);
-		memcpy(x+lenx-lenq, quot, lenq);
-	}
-}
-
-
-/*****************************************
-** sub - Subtract two integers           *
-**                                       *
-** A = A - B                             *
-**                                       *
-**                                       *
-** Parameters:                           *	
-**                                       *
-**  A      Address of subtrahend integer *
-**  B      Address of subtractor integer *
-**  L      Length of A and B in bytes    *
-**                                       *
-**  NOTE: In order to save RAM, B is     *
-**        two's complemented twice,      *
-**        rather than using a copy of B  *
-**                                       *
-******************************************/
-void sub(BYTE *A, int LA, BYTE *B, int LB)
-{
-	BYTE	*tb;
-
-	tb = (BYTE *)calloc(LA, 1);
-	memcpy(tb, B, LB);
-	negate(tb, LB);
-	add(A, LA, tb, LA);
-
-	FREE(tb);
-}
-
-
-/*****************************************
-** negate - Negate an integer            *
-**                                       *
-** A = -A                                *
-**                                       *
-**                                       *
-** Parameters:                           *	
-**                                       *
-**  A      Address of integer to negate  *
-**  L      Length of A in bytes          *
-**                                       *
-******************************************/
-int negate(BYTE *A, int L)
-{
-	int		i, tL;
-	DIGIT	accum;
-
-	/* Take one's complement of A */
-	for ( i=0; i<L; i++ )
-		A[i] = (BYTE)(~(A[i]));
-
-	/* Add one to get two's complement of A */
-	accum = 1;
-	tL = L-1;
-	while ( accum && (tL >= 0) ) {
-		accum = (DIGIT)(accum + A[tL]);
-		A[tL--] = (BYTE)(accum & 0xff);
-		accum = (DIGIT)(accum >> 8);
-	}
-
-	return accum;
-}
-
-
-/*
- * add()
- *
- * A = A + B
- *
- * LB must be <= LA
- *
- */
-BYTE add(BYTE *A, int LA, BYTE *B, int LB)
-{
-	int		i, indexA, indexB;
-	DIGIT	accum;
-
-	indexA = LA - 1; 	/* LSD of result */
-	indexB = LB - 1; 	/* LSD of B */
-
-	accum = 0;
-	for ( i = 0; i < LB; i++ ) {
-		accum = (DIGIT)(accum + A[indexA]);
-		accum = (DIGIT)(accum + B[indexB--]);
-		A[indexA--] = (BYTE)(accum & 0xff);
-		accum = (DIGIT)(accum >> 8);
-	}
-
-	if ( LA > LB )
-		while ( accum  && (indexA >= 0) ) {
-			accum = (DIGIT)(accum + A[indexA]);
-			A[indexA--] = (BYTE)(accum & 0xff);
-			accum = (DIGIT)(accum >> 8);
-		}
-
-	return (BYTE)accum;
-}
-
-
-void prettyprintBstr(char *S, BYTE *A, int L)
-{
-	int		i, extra, ctrb, ctrl;
-
-	if ( L == 0 )
-		printf("%s <empty>", S);
-	else
-		printf("%s\n\t", S);
-	extra = L % 24;
-	if ( extra ) {
-		ctrb = 0;
-		for ( i=0; i<24-extra; i++ ) {
-			printf("  ");
-			if ( ++ctrb == 4) {
-				printf(" ");
-				ctrb = 0;
-			}
-		}
-
-		for ( i=0; i<extra; i++ ) {
-			printf("%02X", A[i]);
-			if ( ++ctrb == 4) {
-				printf(" ");
-				ctrb = 0;
-			}
-		}
-		printf("\n\t");
-	}
-
-	ctrb = ctrl = 0;
-	for ( i=extra; i<L; i++ ) {
-		printf("%02X", A[i]);
-		if ( ++ctrb == 4) {
-			ctrl++;
-			if ( ctrl == 6 ) {
-				printf("\n\t");
-				ctrl = 0;
-			}
-			else
-				printf(" ");
-			ctrb = 0;
-		}
-	}
-	printf("\n\n");
-}
-
-
-/**********************************************************************/
-/*  Performs byte reverse for PC based implementation (little endian) */
-/**********************************************************************/
-void byteReverse(ULONG *buffer, int byteCount)
-{
-	ULONG value;
-	int count;
-
-	byteCount /= sizeof( ULONG );
-	for( count = 0; count < byteCount; count++ ) {
-		value = ( buffer[ count ] << 16 ) | ( buffer[ count ] >> 16 );
-		buffer[ count ] = ( ( value & 0xFF00FF00L ) >> 8 ) | ( ( value & 0x00FF00FFL ) << 8 );
-	}
-}
-
-void
-ahtopb (char *ascii_hex, BYTE *p_binary, int bin_len)
-{
-	BYTE    nibble;
-	int     i; 
-	
-	for ( i=0; i<bin_len; i++ ) {
-        nibble = ascii_hex[i * 2];
-	    if ( nibble > 'F' )
-	        nibble -= 0x20;   
-	    if ( nibble > '9' )
-	        nibble -= 7;      
-	    nibble -= '0';   
-	    p_binary[i] = (BYTE)(nibble << 4);
-		
-	    nibble = ascii_hex[i * 2 + 1];
-	    if ( nibble > 'F' )
-			nibble -= 0x20;
-        if ( nibble > '9' )
-            nibble -= 7;   
-        nibble -= '0';
-		p_binary[i] = (BYTE)(p_binary[i] + nibble);
-	}
-}
--- a/kerneltest/e32utils/nistsecurerng/src/linearComplexity.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,153 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-#include "openc.h"
-#include "../include/externs.h"
-#include "../include/cephes.h"  
-
-void
-LinearComplexity(int M, int n)
-{
-	int       i, ii, j, d, N, L, m, N_, sign, K = 6;
-	double    p_value, T_, mean, nu[7], chi2;
-	double    pi[7] = { 0.01047, 0.03125, 0.12500, 0.50000, 0.25000, 0.06250, 0.020833 };
-	BitSequence*   T = NULL;
-	BitSequence*   P = NULL;
-	BitSequence*   B_ = NULL;
-	BitSequence*   C = NULL;
-	
-	N = (int)floor(n/M);
-	if ( ((B_ = (BitSequence *) calloc(M, sizeof(BitSequence))) == NULL) ||
-		 ((C  = (BitSequence *) calloc(M, sizeof(BitSequence))) == NULL) ||
-		 ((P  = (BitSequence *) calloc(M, sizeof(BitSequence))) == NULL) ||
-		 ((T  = (BitSequence *) calloc(M, sizeof(BitSequence))) == NULL) ) {
-		printf("Insufficient Memory for Work Space:: Linear Complexity Test\n");
-		if ( B_!= NULL )
-			free(B_);
-		if ( C != NULL )
-			free(C);
-		if ( P != NULL )
-			free(P);
-		if ( T != NULL )
-			free(T);
-		return;
-	}
-
-
-	fprintf(stats[TEST_LINEARCOMPLEXITY], "-----------------------------------------------------\n");
-	fprintf(stats[TEST_LINEARCOMPLEXITY], "\tL I N E A R  C O M P L E X I T Y\n");
-	fprintf(stats[TEST_LINEARCOMPLEXITY], "-----------------------------------------------------\n");
-	fprintf(stats[TEST_LINEARCOMPLEXITY], "\tM (substring length)     = %d\n", M);
-	fprintf(stats[TEST_LINEARCOMPLEXITY], "\tN (number of substrings) = %d\n", N);
-	fprintf(stats[TEST_LINEARCOMPLEXITY], "-----------------------------------------------------\n");
-	fprintf(stats[TEST_LINEARCOMPLEXITY], "        F R E Q U E N C Y                            \n");
-	fprintf(stats[TEST_LINEARCOMPLEXITY], "-----------------------------------------------------\n");
-	fprintf(stats[TEST_LINEARCOMPLEXITY], "  C0   C1   C2   C3   C4   C5   C6    CHI2    P-value\n");
-	fprintf(stats[TEST_LINEARCOMPLEXITY], "-----------------------------------------------------\n");
-	fprintf(stats[TEST_LINEARCOMPLEXITY], "\tNote: %d bits were discarded!\n", n%M);
-
-	for ( i=0; i<K+1; i++ )
-		nu[i] = 0.00;
-	for ( ii=0; ii<N; ii++ ) {
-		for ( i=0; i<M; i++ ) {
-			B_[i] = 0;
-			C[i] = 0;
-			T[i] = 0;
-			P[i] = 0;
-		}
-		L = 0;
-		m = -1;
-		d = 0;
-		C[0] = 1;
-		B_[0] = 1;
-		
-		/* DETERMINE LINEAR COMPLEXITY */
-		N_ = 0;
-		while ( N_ < M ) {
-			d = (int)epsilon[ii*M+N_];
-			for ( i=1; i<=L; i++ )
-				d += C[i] * epsilon[ii*M+N_-i];
-			d = d%2;
-			if ( d == 1 ) {
-				for ( i=0; i<M; i++ ) {
-					T[i] = C[i];
-					P[i] = 0;
-				}
-				for ( j=0; j<M; j++ )
-					if ( B_[j] == 1 )
-						P[j+N_-m] = 1;
-				for ( i=0; i<M; i++ )
-					C[i] = (BitSequence)((C[i] + P[i])%2);
-				if ( L <= N_/2 ) {
-					L = N_ + 1 - L;
-					m = N_;
-					for ( i=0; i<M; i++ )
-						B_[i] = T[i];
-				}
-			}
-			N_++;
-		}
-		if (((M+1)%2) == 0 ) 
-			sign = -1;
-		else 
-			sign = 1;
-		mean = M/2.0 + (9.0+sign)/36.0 - 1.0/pow(2, M) * (M/3.0 + 2.0/9.0);
-		if ( (M%2) == 0 )
-			sign = 1;
-		else 
-			sign = -1;
-		T_ = sign * (L - mean) + 2.0/9.0;
-		
-		if ( T_ <= -2.5 )
-			nu[0]++;
-		else if ( T_ > -2.5 && T_ <= -1.5 )
-			nu[1]++;
-		else if ( T_ > -1.5 && T_ <= -0.5 )
-			nu[2]++;
-		else if ( T_ > -0.5 && T_ <= 0.5 )
-			nu[3]++;
-		else if ( T_ > 0.5 && T_ <= 1.5 )
-			nu[4]++;
-		else if ( T_ > 1.5 && T_ <= 2.5 )
-			nu[5]++;
-		else
-			nu[6]++;
-	}
-	chi2 = 0.00;
-	for ( i=0; i<K+1; i++ ) 
-		fprintf(stats[TEST_LINEARCOMPLEXITY], "%4d ", (int)nu[i]);
-	for ( i=0; i<K+1; i++ )
-		chi2 += pow(nu[i]-N*pi[i], 2) / (N*pi[i]);
-	p_value = cephes_igamc(K/2.0, chi2/2.0);
-
-	fprintf(stats[TEST_LINEARCOMPLEXITY], "%9.6f%9.6f\n", chi2, p_value);
-	fprintf(results[TEST_LINEARCOMPLEXITY], "%f\n", p_value);
-
-	free(B_);
-	free(P);
-	free(C);
-	free(T);
-}
--- a/kerneltest/e32utils/nistsecurerng/src/longestRunOfOnes.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-/* got rid of unused 'k' */
-
-#include "openc.h"
-#include "../include/externs.h"
-#include "../include/cephes.h"  
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-                      L O N G E S T  R U N S  T E S T
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-void
-LongestRunOfOnes(int n)
-{
-	double			pval, chi2, pi[7];
-	int				run, v_n_obs, N, i, j, K, M, V[7];
-	unsigned int	nu[7] = { 0, 0, 0, 0, 0, 0, 0 };
-
-	if ( n < 128 ) {
-		fprintf(stats[TEST_LONGEST_RUN], "\t\t\t  LONGEST RUNS OF ONES TEST\n");
-		fprintf(stats[TEST_LONGEST_RUN], "\t\t---------------------------------------------\n");
-		fprintf(stats[TEST_LONGEST_RUN], "\t\t   n=%d is too short\n", n);
-		return;
-	}
-	if ( n < 6272 ) {
-		K = 3;
-		M = 8;
-		V[0] = 1; V[1] = 2; V[2] = 3; V[3] = 4;
-		pi[0] = 0.21484375;
-		pi[1] = 0.3671875;
-		pi[2] = 0.23046875;
-		pi[3] = 0.1875;
-	}
-	else if ( n < 750000 ) {
-		K = 5;
-		M = 128;
-		V[0] = 4; V[1] = 5; V[2] = 6; V[3] = 7; V[4] = 8; V[5] = 9;
-		pi[0] = 0.1174035788;
-		pi[1] = 0.242955959;
-		pi[2] = 0.249363483;
-		pi[3] = 0.17517706;
-		pi[4] = 0.102701071;
-		pi[5] = 0.112398847;
-	}
-	else {
-		K = 6;
-		M = 10000;
-			V[0] = 10; V[1] = 11; V[2] = 12; V[3] = 13; V[4] = 14; V[5] = 15; V[6] = 16;
-		pi[0] = 0.0882;
-		pi[1] = 0.2092;
-		pi[2] = 0.2483;
-		pi[3] = 0.1933;
-		pi[4] = 0.1208;
-		pi[5] = 0.0675;
-		pi[6] = 0.0727;
-	}
-	
-	N = n/M;
-	for ( i=0; i<N; i++ ) {
-		v_n_obs = 0;
-		run = 0;
-		for ( j=0; j<M; j++ ) {
-			if ( epsilon[i*M+j] == 1 ) {
-				run++;
-				if ( run > v_n_obs )
-					v_n_obs = run;
-			}
-			else
-				run = 0;
-		}
-		if ( v_n_obs < V[0] )
-			nu[0]++;
-		for ( j=0; j<=K; j++ ) {
-			if ( v_n_obs == V[j] )
-				nu[j]++;
-		}
-		if ( v_n_obs > V[K] )
-			nu[K]++;
-	}
-
-	chi2 = 0.0;
-	for ( i=0; i<=K; i++ )
-		chi2 += ((nu[i] - N * pi[i]) * (nu[i] - N * pi[i])) / (N * pi[i]);
-
-	pval = cephes_igamc((double)(K/2.0), chi2 / 2.0);
-
-	fprintf(stats[TEST_LONGEST_RUN], "\t\t\t  LONGEST RUNS OF ONES TEST\n");
-	fprintf(stats[TEST_LONGEST_RUN], "\t\t---------------------------------------------\n");
-	fprintf(stats[TEST_LONGEST_RUN], "\t\tCOMPUTATIONAL INFORMATION:\n");
-	fprintf(stats[TEST_LONGEST_RUN], "\t\t---------------------------------------------\n");
-	fprintf(stats[TEST_LONGEST_RUN], "\t\t(a) N (# of substrings)  = %d\n", N);
-	fprintf(stats[TEST_LONGEST_RUN], "\t\t(b) M (Substring Length) = %d\n", M);
-	fprintf(stats[TEST_LONGEST_RUN], "\t\t(c) Chi^2                = %f\n", chi2);
-	fprintf(stats[TEST_LONGEST_RUN], "\t\t---------------------------------------------\n");
-	fprintf(stats[TEST_LONGEST_RUN], "\t\t      F R E Q U E N C Y\n");
-	fprintf(stats[TEST_LONGEST_RUN], "\t\t---------------------------------------------\n");
-
-	if ( K == 3 ) {
-		fprintf(stats[TEST_LONGEST_RUN], "\t\t  <=1     2     3    >=4   P-value  Assignment");
-		fprintf(stats[TEST_LONGEST_RUN], "\n\t\t %3d %3d %3d  %3d ", nu[0], nu[1], nu[2], nu[3]);
-	}
-	else if ( K == 5 ) {
-		fprintf(stats[TEST_LONGEST_RUN], "\t\t<=4  5  6  7  8  >=9 P-value  Assignment");
-		fprintf(stats[TEST_LONGEST_RUN], "\n\t\t %3d %3d %3d %3d %3d  %3d ", nu[0], nu[1], nu[2],
-				nu[3], nu[4], nu[5]);
-	}
-	else {
-		fprintf(stats[TEST_LONGEST_RUN],"\t\t<=10  11  12  13  14  15 >=16 P-value  Assignment");
-		fprintf(stats[TEST_LONGEST_RUN],"\n\t\t %3d %3d %3d %3d %3d %3d  %3d ", nu[0], nu[1], nu[2],
-				nu[3], nu[4], nu[5], nu[6]);
-	}
-	if ( isNegative(pval) || isGreaterThanOne(pval) )
-		fprintf(stats[TEST_LONGEST_RUN], "WARNING:  P_VALUE IS OUT OF RANGE.\n");
-
-	fprintf(stats[TEST_LONGEST_RUN], "%s\t\tp_value = %f\n\n", pval < ALPHA ? "FAILURE" : "SUCCESS", pval);
-	fprintf(results[TEST_LONGEST_RUN], "%f\n", pval);
-}
--- a/kerneltest/e32utils/nistsecurerng/src/math/erf.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,355 +0,0 @@
-/*
-* Portions 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 "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: 
-*/
-
-/* @(#)s_erf.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-#ifndef __SYMBIAN32__
-#ifndef lint
-static char rcsid[] = "$FreeBSD: src/lib/msun/src/s_erf.c,v 1.7 2002/05/28 18:15:04 alfred Exp $";
-#endif
-#endif //__SYMBIAN32__
-
-#include <e32std.h>
-
-#include "openc.h"
-
-/* double erf(double x)
- * double erfc(double x)
- *               x
- *            2      |\
- *     erf(x)  =  ---------  | exp(-t*t)dt
- *         sqrt(pi) \|
- *               0
- *
- *     erfc(x) =  1-erf(x)
- *  Note that
- *      erf(-x) = -erf(x)
- *      erfc(-x) = 2 - erfc(x)
- *
- * Method:
- *  1. For |x| in [0, 0.84375]
- *      erf(x)  = x + x*R(x^2)
- *          erfc(x) = 1 - erf(x)           if x in [-.84375,0.25]
- *                  = 0.5 + ((0.5-x)-x*R)  if x in [0.25,0.84375]
- *     where R = P/Q where P is an odd poly of degree 8 and
- *     Q is an odd poly of degree 10.
- *                       -57.90
- *          | R - (erf(x)-x)/x | <= 2
- *
- *
- *     Remark. The formula is derived by noting
- *          erf(x) = (2/sqrt(pi))*(x - x^3/3 + x^5/10 - x^7/42 + ....)
- *     and that
- *          2/sqrt(pi) = 1.128379167095512573896158903121545171688
- *     is close to one. The interval is chosen because the fix
- *     point of erf(x) is near 0.6174 (i.e., erf(x)=x when x is
- *     near 0.6174), and by some experiment, 0.84375 is chosen to
- *     guarantee the error is less than one ulp for erf.
- *
- *      2. For |x| in [0.84375,1.25], let s = |x| - 1, and
- *         c = 0.84506291151 rounded to single (24 bits)
- *          erf(x)  = sign(x) * (c  + P1(s)/Q1(s))
- *          erfc(x) = (1-c)  - P1(s)/Q1(s) if x > 0
- *            1+(c+P1(s)/Q1(s))    if x < 0
- *          |P1/Q1 - (erf(|x|)-c)| <= 2**-59.06
- *     Remark: here we use the taylor series expansion at x=1.
- *      erf(1+s) = erf(1) + s*Poly(s)
- *           = 0.845.. + P1(s)/Q1(s)
- *     That is, we use rational approximation to approximate
- *          erf(1+s) - (c = (single)0.84506291151)
- *     Note that |P1/Q1|< 0.078 for x in [0.84375,1.25]
- *     where
- *      P1(s) = degree 6 poly in s
- *      Q1(s) = degree 6 poly in s
- *
- *      3. For x in [1.25,1/0.35(~2.857143)],
- *          erfc(x) = (1/x)*exp(-x*x-0.5625+R1/S1)
- *          erf(x)  = 1 - erfc(x)
- *     where
- *      R1(z) = degree 7 poly in z, (z=1/x^2)
- *      S1(z) = degree 8 poly in z
- *
- *      4. For x in [1/0.35,28]
- *          erfc(x) = (1/x)*exp(-x*x-0.5625+R2/S2) if x > 0
- *          = 2.0 - (1/x)*exp(-x*x-0.5625+R2/S2) if -6<x<0
- *          = 2.0 - tiny        (if x <= -6)
- *          erf(x)  = sign(x)*(1.0 - erfc(x)) if x < 6, else
- *          erf(x)  = sign(x)*(1.0 - tiny)
- *     where
- *      R2(z) = degree 6 poly in z, (z=1/x^2)
- *      S2(z) = degree 7 poly in z
- *
- *      Note1:
- *     To compute exp(-x*x-0.5625+R/S), let s be a single
- *     precision number and s := x; then
- *      -x*x = -s*s + (s-x)*(s+x)
- *          exp(-x*x-0.5626+R/S) =
- *          exp(-s*s-0.5625)*exp((s-x)*(s+x)+R/S);
- *      Note2:
- *     Here 4 and 5 make use of the asymptotic series
- *            exp(-x*x)
- *      erfc(x) ~ ---------- * ( 1 + Poly(1/x^2) )
- *            x*sqrt(pi)
- *     We use rational approximation to approximate
- *          g(s)=f(1/x^2) = log(erfc(x)*x) - x*x + 0.5625
- *     Here is the error bound for R1/S1 and R2/S2
- *          |R1/S1 - f(x)|  < 2**(-62.57)
- *          |R2/S2 - f(x)|  < 2**(-61.52)
- *
- *      5. For inf > x >= 28
- *          erf(x)  = sign(x) *(1 - tiny)  (raise inexact)
- *          erfc(x) = tiny*tiny (raise underflow) if x > 0
- *          = 2 - tiny if x<0
- *
- *      7. Special case:
- *          erf(0)  = 0, erf(inf)  = 1, erf(-inf) = -1,
- *          erfc(0) = 1, erfc(inf) = 0, erfc(-inf) = 2,
- *      erfc/erf(NaN) is NaN
- */
-
-
-
-
-
-////--------------------------------------------------
-
-#define __ieee754_exp   exp
-typedef TUint32 u_int32_t;
-typedef TInt32 int32_t;
-
-typedef union
-    {
-    double value;
-    struct
-        {
-        u_int32_t lsw;
-        u_int32_t msw;
-        } parts;
-    } ieee_double_shape_type;
-
-
-inline void GET_HIGH_WORD(int32_t& aHighWord, double aValue)
-    {
-    ieee_double_shape_type gh_u;
-    gh_u.value = aValue;
-    aHighWord = gh_u.parts.msw;                  
-    }
-    
-inline void SET_LOW_WORD(double& aValue, int32_t aLowWord)
-    {
-    ieee_double_shape_type sl_u;
-    sl_u.value = aValue;
-    sl_u.parts.lsw = aLowWord;
-    aValue = sl_u.value;
-    }
-
-//----------------------------------------------------------------math_private.h
-
-static const double tiny    = 1e-300;
-static const double tinySquare    = 0.00; // tiny * tiny 
-static const double half    = 5.00000000000000000000e-01; /* 0x3FE00000, 0x00000000 */
-static const double one     = 1.00000000000000000000e+00; /* 0x3FF00000, 0x00000000 */
-static const double two     = 2.00000000000000000000e+00; /* 0x40000000, 0x00000000 */
-    /* c = (float)0.84506291151 */
-static const double erx     = 8.45062911510467529297e-01; /* 0x3FEB0AC1, 0x60000000 */
-/*
- * Coefficients for approximation to  erf on [0,0.84375]
- */
-static const double efx     =  1.28379167095512586316e-01; /* 0x3FC06EBA, 0x8214DB69 */
-static const double efx8    =  1.02703333676410069053e+00; /* 0x3FF06EBA, 0x8214DB69 */
-static const double pp0     =  1.28379167095512558561e-01; /* 0x3FC06EBA, 0x8214DB68 */
-static const double pp1     = -3.25042107247001499370e-01; /* 0xBFD4CD7D, 0x691CB913 */
-static const double pp2     = -2.84817495755985104766e-02; /* 0xBF9D2A51, 0xDBD7194F */
-static const double pp3     = -5.77027029648944159157e-03; /* 0xBF77A291, 0x236668E4 */
-static const double pp4     = -2.37630166566501626084e-05; /* 0xBEF8EAD6, 0x120016AC */
-static const double qq1     =  3.97917223959155352819e-01; /* 0x3FD97779, 0xCDDADC09 */
-static const double qq2     =  6.50222499887672944485e-02; /* 0x3FB0A54C, 0x5536CEBA */
-static const double qq3     =  5.08130628187576562776e-03; /* 0x3F74D022, 0xC4D36B0F */
-static const double qq4     =  1.32494738004321644526e-04; /* 0x3F215DC9, 0x221C1A10 */
-static const double qq5     = -3.96022827877536812320e-06; /* 0xBED09C43, 0x42A26120 */
-/*
- * Coefficients for approximation to  erf  in [0.84375,1.25]
- */
-static const double pa0     = -2.36211856075265944077e-03; /* 0xBF6359B8, 0xBEF77538 */
-static const double pa1     =  4.14856118683748331666e-01; /* 0x3FDA8D00, 0xAD92B34D */
-static const double pa2     = -3.72207876035701323847e-01; /* 0xBFD7D240, 0xFBB8C3F1 */
-static const double pa3     =  3.18346619901161753674e-01; /* 0x3FD45FCA, 0x805120E4 */
-static const double pa4     = -1.10894694282396677476e-01; /* 0xBFBC6398, 0x3D3E28EC */
-static const double pa5     =  3.54783043256182359371e-02; /* 0x3FA22A36, 0x599795EB */
-static const double pa6     = -2.16637559486879084300e-03; /* 0xBF61BF38, 0x0A96073F */
-static const double qa1     =  1.06420880400844228286e-01; /* 0x3FBB3E66, 0x18EEE323 */
-static const double qa2     =  5.40397917702171048937e-01; /* 0x3FE14AF0, 0x92EB6F33 */
-static const double qa3     =  7.18286544141962662868e-02; /* 0x3FB2635C, 0xD99FE9A7 */
-static const double qa4     =  1.26171219808761642112e-01; /* 0x3FC02660, 0xE763351F */
-static const double qa5     =  1.36370839120290507362e-02; /* 0x3F8BEDC2, 0x6B51DD1C */
-static const double qa6     =  1.19844998467991074170e-02; /* 0x3F888B54, 0x5735151D */
-/*
- * Coefficients for approximation to  erfc in [1.25,1/0.35]
- */
-static const double ra0     = -9.86494403484714822705e-03; /* 0xBF843412, 0x600D6435 */
-static const double ra1     = -6.93858572707181764372e-01; /* 0xBFE63416, 0xE4BA7360 */
-static const double ra2     = -1.05586262253232909814e+01; /* 0xC0251E04, 0x41B0E726 */
-static const double ra3     = -6.23753324503260060396e+01; /* 0xC04F300A, 0xE4CBA38D */
-static const double ra4     = -1.62396669462573470355e+02; /* 0xC0644CB1, 0x84282266 */
-static const double ra5     = -1.84605092906711035994e+02; /* 0xC067135C, 0xEBCCABB2 */
-static const double ra6     = -8.12874355063065934246e+01; /* 0xC0545265, 0x57E4D2F2 */
-static const double ra7     = -9.81432934416914548592e+00; /* 0xC023A0EF, 0xC69AC25C */
-static const double sa1     =  1.96512716674392571292e+01; /* 0x4033A6B9, 0xBD707687 */
-static const double sa2     =  1.37657754143519042600e+02; /* 0x4061350C, 0x526AE721 */
-static const double sa3     =  4.34565877475229228821e+02; /* 0x407B290D, 0xD58A1A71 */
-static const double sa4     =  6.45387271733267880336e+02; /* 0x40842B19, 0x21EC2868 */
-static const double sa5     =  4.29008140027567833386e+02; /* 0x407AD021, 0x57700314 */
-static const double sa6     =  1.08635005541779435134e+02; /* 0x405B28A3, 0xEE48AE2C */
-static const double sa7     =  6.57024977031928170135e+00; /* 0x401A47EF, 0x8E484A93 */
-static const double sa8     = -6.04244152148580987438e-02; /* 0xBFAEEFF2, 0xEE749A62 */
-/*
- * Coefficients for approximation to  erfc in [1/.35,28]
- */
-static const double rb0     = -9.86494292470009928597e-03; /* 0xBF843412, 0x39E86F4A */
-static const double rb1     = -7.99283237680523006574e-01; /* 0xBFE993BA, 0x70C285DE */
-static const double rb2     = -1.77579549177547519889e+01; /* 0xC031C209, 0x555F995A */
-static const double rb3     = -1.60636384855821916062e+02; /* 0xC064145D, 0x43C5ED98 */
-static const double rb4     = -6.37566443368389627722e+02; /* 0xC083EC88, 0x1375F228 */
-static const double rb5     = -1.02509513161107724954e+03; /* 0xC0900461, 0x6A2E5992 */
-static const double rb6     = -4.83519191608651397019e+02; /* 0xC07E384E, 0x9BDC383F */
-static const double sb1     =  3.03380607434824582924e+01; /* 0x403E568B, 0x261D5190 */
-static const double sb2     =  3.25792512996573918826e+02; /* 0x40745CAE, 0x221B9F0A */
-static const double sb3     =  1.53672958608443695994e+03; /* 0x409802EB, 0x189D5118 */
-static const double sb4     =  3.19985821950859553908e+03; /* 0x40A8FFB7, 0x688C246A */
-static const double sb5     =  2.55305040643316442583e+03; /* 0x40A3F219, 0xCEDF3BE6 */
-static const double sb6     =  4.74528541206955367215e+02; /* 0x407DA874, 0xE79FE763 */
-static const double sb7     = -2.24409524465858183362e+01; /* 0xC03670E2, 0x42712D62 */
-
-double erf(double x)
-{
-    TInt32 hx,ix,i;
-    double R,S,P,Q,s,y,z,r;
-    GET_HIGH_WORD(hx,x);
-    ix = hx&0x7fffffff;
-    if(ix>=0x7ff00000) {        /* erf(nan)=nan */
-        i = ((TUint32)hx>>31)<<1;
-        return (double)(1-i)+one/x; /* erf(+-inf)=+-1 */
-    }
-
-    if(ix < 0x3feb0000) {       /* |x|<0.84375 */
-        if(ix < 0x3e300000) {   /* |x|<2**-28 */
-            if (ix < 0x00800000)
-            return 0.125*(8.0*x+efx8*x);  /*avoid underflow */
-        return x + efx*x;
-        }
-        z = x*x;
-        r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4)));
-        s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5))));
-        y = r/s;
-        return x + x*y;
-    }
-    if(ix < 0x3ff40000) {       /* 0.84375 <= |x| < 1.25 */
-        s = fabs(x)-one;
-        P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6)))));
-        Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6)))));
-        if(hx>=0) return erx + P/Q; else return -erx - P/Q;
-    }
-    if (ix >= 0x40180000) {     /* inf>|x|>=6 */
-        if(hx>=0) return one-tiny; else return tiny-one;
-    }
-    x = fabs(x);
-    s = one/(x*x);
-    if(ix< 0x4006DB6E) {    /* |x| < 1/0.35 */
-        R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(
-                ra5+s*(ra6+s*ra7))))));
-        S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(
-                sa5+s*(sa6+s*(sa7+s*sa8)))))));
-    } else {    /* |x| >= 1/0.35 */
-        R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(
-                rb5+s*rb6)))));
-        S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(
-                sb5+s*(sb6+s*sb7))))));
-    }
-    z  = x;
-    SET_LOW_WORD(z,0);
-    r  =  __ieee754_exp(-z*z-0.5625)*__ieee754_exp((z-x)*(z+x)+R/S);
-    if(hx>=0) return one-r/x; else return  r/x-one;
-}
-
-double erfc(double x)
-{
-    int32_t hx,ix;
-    double R,S,P,Q,s,y,z,r;
-    GET_HIGH_WORD(hx,x);
-    ix = hx&0x7fffffff;
-    if(ix>=0x7ff00000) {            /* erfc(nan)=nan */
-                        /* erfc(+-inf)=0,2 */
-        return (double)(((u_int32_t)hx>>31)<<1)+one/x;
-    }
-
-    if(ix < 0x3feb0000) {       /* |x|<0.84375 */
-        if(ix < 0x3c700000)     /* |x|<2**-56 */
-        return one-x;
-        z = x*x;
-        r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4)));
-        s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5))));
-        y = r/s;
-        if(hx < 0x3fd00000) {   /* x<1/4 */
-        return one-(x+x*y);
-        } else {
-        r = x*y;
-        r += (x-half);
-            return half - r ;
-        }
-    }
-    if(ix < 0x3ff40000) {       /* 0.84375 <= |x| < 1.25 */
-        s = fabs(x)-one;
-        P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6)))));
-        Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6)))));
-        if(hx>=0) {
-            z  = one-erx; return z - P/Q;
-        } else {
-        z = erx+P/Q; return one+z;
-        }
-    }
-    if (ix < 0x403c0000) {      /* |x|<28 */
-        x = fabs(x);
-        s = one/(x*x);
-        if(ix< 0x4006DB6D) {    /* |x| < 1/.35 ~ 2.857143*/
-            R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(
-                ra5+s*(ra6+s*ra7))))));
-            S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(
-                sa5+s*(sa6+s*(sa7+s*sa8)))))));
-        } else {            /* |x| >= 1/.35 ~ 2.857143 */
-        if(hx<0&&ix>=0x40180000) return two-tiny;/* x < -6 */
-            R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(
-                rb5+s*rb6)))));
-            S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(
-                sb5+s*(sb6+s*sb7))))));
-        }
-        z  = x;
-        SET_LOW_WORD(z,0);
-        r  =  __ieee754_exp(-z*z-0.5625)*
-            __ieee754_exp((z-x)*(z+x)+R/S);
-        if(hx>0) return r/x; else return two-r/x;
-    } else {
-        if(hx>0) return tinySquare; else return two-tiny;
-    }
-}
--- a/kerneltest/e32utils/nistsecurerng/src/matrix.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,189 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-#include "openc.h"
-#include "../include/externs.h"
-#include "../include/matrix.h"
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-R A N K  A L G O R I T H M  R O U T I N E S
-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-#define	MATRIX_FORWARD_ELIMINATION	0
-#define	MATRIX_BACKWARD_ELIMINATION	1
-
-int
-computeRank(int M, int Q, BitSequence **matrix)
-{
-	int		i, rank, m=MIN(M,Q);
-	
-	/* FORWARD APPLICATION OF ELEMENTARY ROW OPERATIONS */ 
-	for ( i=0; i<m-1; i++ ) {
-		if ( matrix[i][i] == 1 ) 
-			perform_elementary_row_operations(MATRIX_FORWARD_ELIMINATION, i, M, Q, matrix);
-		else { 	/* matrix[i][i] = 0 */
-			if ( find_unit_element_and_swap(MATRIX_FORWARD_ELIMINATION, i, M, Q, matrix) == 1 ) 
-				perform_elementary_row_operations(MATRIX_FORWARD_ELIMINATION, i, M, Q, matrix);
-		}
-	}
-
-	/* BACKWARD APPLICATION OF ELEMENTARY ROW OPERATIONS */ 
-	for ( i=m-1; i>0; i-- ) {
-		if ( matrix[i][i] == 1 )
-			perform_elementary_row_operations(MATRIX_BACKWARD_ELIMINATION, i, M, Q, matrix);
-		else { 	/* matrix[i][i] = 0 */
-			if ( find_unit_element_and_swap(MATRIX_BACKWARD_ELIMINATION, i, M, Q, matrix) == 1 )
-				perform_elementary_row_operations(MATRIX_BACKWARD_ELIMINATION, i, M, Q, matrix);
-		}
-	} 
-
-	rank = determine_rank(m, M, Q, matrix);
-
-	return rank;
-}
-
-void
-perform_elementary_row_operations(int flag, int i, int M, int Q, BitSequence **A)
-{
-	int		j, k;
-	
-	if ( flag == MATRIX_FORWARD_ELIMINATION ) {
-		for ( j=i+1; j<M;  j++ )
-			if ( A[j][i] == 1 ) 
-				for ( k=i; k<Q; k++ ) 
-					A[j][k] = (BitSequence)((A[j][k] + A[i][k]) % 2);
-	}
-	else {
-		for ( j=i-1; j>=0;  j-- )
-			if ( A[j][i] == 1 )
-				for ( k=0; k<Q; k++ )
-					A[j][k] = (BitSequence)((A[j][k] + A[i][k]) % 2);
-	}
-}
-
-int
-find_unit_element_and_swap(int flag, int i, int M, int Q, BitSequence **A)
-{ 
-	int		index, row_op=0;
-	
-	if ( flag == MATRIX_FORWARD_ELIMINATION ) {
-		index = i+1;
-		while ( (index < M) && (A[index][i] == 0) ) 
-			index++;
-			if ( index < M )
-				row_op = swap_rows(i, index, Q, A);
-	}
-	else {
-		index = i-1;
-		while ( (index >= 0) && (A[index][i] == 0) ) 
-			index--;
-			if ( index >= 0 )
-				row_op = swap_rows(i, index, Q, A);
-	}
-	
-	return row_op;
-}
-
-int
-swap_rows(int i, int index, int Q, BitSequence **A)
-{
-	int			p;
-	BitSequence	temp;
-	
-	for ( p=0; p<Q; p++ ) {
-		temp = A[i][p];
-		A[i][p] = A[index][p];
-		A[index][p] = temp;
-	}
-	
-	return 1;
-}
-
-int
-determine_rank(int m, int M, int Q, BitSequence **A)
-{
-	int		i, j, rank, allZeroes;
-	
-	/* DETERMINE RANK, THAT IS, COUNT THE NUMBER OF NONZERO ROWS */
-	
-	rank = m;
-	for ( i=0; i<M; i++ ) {
-		allZeroes = 1; 
-		for ( j=0; j<Q; j++)  {
-			if ( A[i][j] == 1 ) {
-				allZeroes = 0;
-				break;
-			}
-		}
-		if ( allZeroes == 1 )
-			rank--;
-	} 
-	
-	return rank;
-}
-
-BitSequence**
-create_matrix(int M, int Q)
-{
-	int			i;
-	BitSequence	**matrix;
-	
-	if ( (matrix = (BitSequence **) calloc(M, sizeof(BitSequence *))) == NULL ) {
-		printf("ERROR IN FUNCTION create_matrix:  Insufficient memory available.\n");
-		
-		return NULL;
-	}
-	else {
-		for ( i=0; i<M; i++ ) {
-			if ( (matrix[i] = (unsigned char*)calloc(Q, sizeof(BitSequence))) == NULL ) {
-				printf("ERROR IN FUNCTION create_matrix: Insufficient memory for %dx%d matrix.\n", M, M);
-
-				return NULL;
-			}
-		}
-		return matrix;
-	}
-}
-
-void
-def_matrix(int M, int Q, BitSequence **m,int k)
-{
-	int		i,j;
-	
-	for ( i=0; i<M; i++ ) 
-		for ( j=0; j<Q; j++ )
-			m[i][j] = epsilon[k*(M*Q)+j+i*M];
-}
-
-void
-delete_matrix(int M, BitSequence **matrix)
-{
-	int		i;
-
-	for ( i=0; i<M; i++ )
-		free(matrix[i]);
-	free(matrix);
-}
--- a/kerneltest/e32utils/nistsecurerng/src/nonOverlappingTemplateMatchings.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-#include "openc.h"
-#include "../include/externs.h"
-#include "../include/utilities.h"
-#include "../include/cephes.h"  
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-          N O N O V E R L A P P I N G  T E M P L A T E  T E S T
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-void
-NonOverlappingTemplateMatchings(int m, int n)
-{
-	int		numOfTemplates[100] = {0, 0, 2, 4, 6, 12, 20, 40, 74, 148, 284, 568, 1116,
-						2232, 4424, 8848, 17622, 35244, 70340, 140680, 281076, 562152};
-	/*----------------------------------------------------------------------------
-	NOTE:  Should additional templates lengths beyond 21 be desired, they must 
-	first be constructed, saved into files and then the corresponding 
-	number of nonperiodic templates for that file be stored in the m-th 
-	position in the numOfTemplates variable.
-	----------------------------------------------------------------------------*/
-	unsigned int	W_obs, *Wj = NULL; 
-	double			sum, chi2, p_value, lambda, pi[6], varWj;
-	int				i, j, jj, k, match, SKIP, M, N, K = 5;
-	
-	ResetTemplateIndex();
-
-	N = 8;
-	M = n/N;
-
-	if ( (Wj = (unsigned int*)calloc(N, sizeof(unsigned int))) == NULL ) {
-		fprintf(stats[TEST_NONPERIODIC], "\tNONOVERLAPPING TEMPLATES TESTS ABORTED DUE TO ONE OF THE FOLLOWING : \n");
-		fprintf(stats[TEST_NONPERIODIC], "\tInsufficient memory for required work space.\n");
-		return;
-	}
-	lambda = (M-m+1)/pow(2, m);
-	varWj = M*(1.0/pow(2.0, m) - (2.0*m-1.0)/pow(2.0, 2.0*m));
-
-	if ( isNegative(lambda) || isZero(lambda)) 
-	    {
-		fprintf(stats[TEST_NONPERIODIC], "\tNONOVERLAPPING TEMPLATES TESTS ABORTED DUE TO ONE OF THE FOLLOWING : \n");
-		fprintf(stats[TEST_NONPERIODIC], "\tLambda (%f) not being positive!\n", lambda);
-		}
-	else {
-		fprintf(stats[TEST_NONPERIODIC], "\t\t  NONPERIODIC TEMPLATES TEST\n");
-		fprintf(stats[TEST_NONPERIODIC], "-------------------------------------------------------------------------------------\n");
-		fprintf(stats[TEST_NONPERIODIC], "\t\t  COMPUTATIONAL INFORMATION\n");
-		fprintf(stats[TEST_NONPERIODIC], "-------------------------------------------------------------------------------------\n");
-		fprintf(stats[TEST_NONPERIODIC], "\tLAMBDA = %f\tM = %d\tN = %d\tm = %d\tn = %d\n", lambda, M, N, m, n);
-		fprintf(stats[TEST_NONPERIODIC], "-------------------------------------------------------------------------------------\n");
-		fprintf(stats[TEST_NONPERIODIC], "\t\tF R E Q U E N C Y\n");
-		fprintf(stats[TEST_NONPERIODIC], "Template   W_1  W_2  W_3  W_4  W_5  W_6  W_7  W_8    Chi^2   P_value Assignment Index\n");
-		fprintf(stats[TEST_NONPERIODIC], "-------------------------------------------------------------------------------------\n");
-
-		if ( numOfTemplates[m] < MAXNUMOFTEMPLATES )
-			SKIP = 1;
-		else
-			SKIP = (int)(numOfTemplates[m]/MAXNUMOFTEMPLATES);
-		numOfTemplates[m] = (int)numOfTemplates[m]/SKIP;
-		
-		sum = 0.0;
-		for ( i=0; i<2; i++ ) {                      /* Compute Probabilities */
-			pi[i] = exp(-lambda+i*log(lambda)-cephes_lgam(i+1));
-			sum += pi[i];
-		}
-		pi[0] = sum;
-		for ( i=2; i<=K; i++ ) {                      /* Compute Probabilities */
-			pi[i-1] = exp(-lambda+i*log(lambda)-cephes_lgam(i+1));
-			sum += pi[i-1];
-		}
-		pi[K] = 1 - sum;
-
-        BitSequence templateSequence[KMaxBit];
-
-        for( jj=0; jj<MIN(MAXNUMOFTEMPLATES, numOfTemplates[m]); jj++ ) {
-			sum = 0;
-            GetNextTemplateItem(templateSequence);
-
-			fprintf(stats[TEST_NONPERIODIC], " ");
-			for ( i=0; i<N; i++ ) {
-				W_obs = 0;
-				for ( j=0; j<M-m+1; j++ ) {
-					match = 1;
-					for ( k=0; k<m; k++ ) {
-					
-                    if ( (int)templateSequence[KMaxBit - k - 1] != (int)epsilon[i*M+j+k] ) {
-							match = 0;
-							break;
-						}
-					}
-					if ( match == 1 )
-						W_obs++;
-				}
-				Wj[i] = W_obs;
-			}
-			sum = 0;
-			chi2 = 0.0;                                   /* Compute Chi Square */
-			for ( i=0; i<N; i++ ) {
-				if ( m == 10 )
-					fprintf(stats[TEST_NONPERIODIC], "%3d  ", Wj[i]);
-				else
-					fprintf(stats[TEST_NONPERIODIC], "%4d ", Wj[i]);
-				chi2 += pow(((double)Wj[i] - lambda)/pow(varWj, 0.5), 2);
-			}
-			p_value = cephes_igamc(N/2.0, chi2/2.0);
-		
-			if ( isNegative(p_value) || isGreaterThanOne(p_value) )
-				fprintf(stats[TEST_NONPERIODIC], "\t\tWARNING:  P_VALUE IS OUT OF RANGE.\n");
-
-			fprintf(stats[TEST_NONPERIODIC], "%9.6f %f %s %3d\n", chi2, p_value, p_value < ALPHA ? "FAILURE" : "SUCCESS", jj);
-			if ( SKIP > 1 )
-			    {
-			    for(int index = 0; index < (SKIP-1)*2*m; ++index)
-			        {
-			        GetNextTemplateItem(templateSequence);
-			        }
-			    }
-			fprintf(results[TEST_NONPERIODIC], "%f\n", p_value);
-		}
-	}
-	
-	fprintf(stats[TEST_NONPERIODIC], "\n");
-	free(Wj);
-}
--- a/kerneltest/e32utils/nistsecurerng/src/overlappingTemplateMatchings.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-#include "openc.h"
-#include "../include/externs.h"
-#include "../include/utilities.h"
-#include "../include/cephes.h"  
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-               O V E R L A P P I N G  T E M P L A T E  T E S T
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-double	Pr(int u, double eta);
-
-void
-OverlappingTemplateMatchings(int m, int n)
-{
-	int				i, k, match;
-	double			W_obs, eta, sum, chi2, p_value, lambda;
-	int				M, N, j, K = 5;
-	unsigned int	nu[6] = { 0, 0, 0, 0, 0, 0 };
-	double			pi[6] = { 0.143783, 0.139430, 0.137319, 0.124314, 0.106209, 0.348945 };
-	BitSequence		*sequence;
-
-	M = 1032;
-	N = n/M;
-	
-	if ( (sequence = (BitSequence *) calloc(m, sizeof(BitSequence))) == NULL ) {
-		fprintf(stats[TEST_OVERLAPPING], "\t\t    OVERLAPPING TEMPLATE OF ALL ONES TEST\n");
-		fprintf(stats[TEST_OVERLAPPING], "\t\t---------------------------------------------\n");
-		fprintf(stats[TEST_OVERLAPPING], "\t\tTEMPLATE DEFINITION:  Insufficient memory, Overlapping Template Matchings test aborted!\n");
-	}
-	else
-		for ( i=0; i<m; i++ )
-			sequence[i] = 1;
-	
-	lambda = (double)(M-m+1)/pow(2,m);
-	eta = lambda/2.0;
-	sum = 0.0;
-	for ( i=0; i<K; i++ ) {			/* Compute Probabilities */
-		pi[i] = Pr(i, eta);
-		sum += pi[i];
-	}
-	pi[K] = 1 - sum;
-
-	for ( i=0; i<N; i++ ) {
-		W_obs = 0;
-		for ( j=0; j<M-m+1; j++ ) {
-			match = 1;
-			for ( k=0; k<m; k++ ) {
-				if ( sequence[k] != epsilon[i*M+j+k] )
-					match = 0;
-			}
-			if ( match == 1 )
-				W_obs++;
-		}
-		if ( W_obs <= 4 )
-			nu[(int)W_obs]++;
-		else
-			nu[K]++;
-	}
-	sum = 0;
-	chi2 = 0.0;                                   /* Compute Chi Square */
-	for ( i=0; i<K+1; i++ ) {
-		chi2 += pow((double)nu[i] - (double)N*pi[i], 2)/((double)N*pi[i]);
-		sum += nu[i];
-	}
-	p_value = cephes_igamc(K/2.0, chi2/2.0);
-
-	fprintf(stats[TEST_OVERLAPPING], "\t\t    OVERLAPPING TEMPLATE OF ALL ONES TEST\n");
-	fprintf(stats[TEST_OVERLAPPING], "\t\t-----------------------------------------------\n");
-	fprintf(stats[TEST_OVERLAPPING], "\t\tCOMPUTATIONAL INFORMATION:\n");
-	fprintf(stats[TEST_OVERLAPPING], "\t\t-----------------------------------------------\n");
-	fprintf(stats[TEST_OVERLAPPING], "\t\t(a) n (sequence_length)      = %d\n", n);
-	fprintf(stats[TEST_OVERLAPPING], "\t\t(b) m (block length of 1s)   = %d\n", m);
-	fprintf(stats[TEST_OVERLAPPING], "\t\t(c) M (length of substring)  = %d\n", M);
-	fprintf(stats[TEST_OVERLAPPING], "\t\t(d) N (number of substrings) = %d\n", N);
-	fprintf(stats[TEST_OVERLAPPING], "\t\t(e) lambda [(M-m+1)/2^m]     = %f\n", lambda);
-	fprintf(stats[TEST_OVERLAPPING], "\t\t(f) eta                      = %f\n", eta);
-	fprintf(stats[TEST_OVERLAPPING], "\t\t-----------------------------------------------\n");
-	fprintf(stats[TEST_OVERLAPPING], "\t\t   F R E Q U E N C Y\n");
-	fprintf(stats[TEST_OVERLAPPING], "\t\t  0   1   2   3   4 >=5   Chi^2   P-value  Assignment\n");
-	fprintf(stats[TEST_OVERLAPPING], "\t\t-----------------------------------------------\n");
-	fprintf(stats[TEST_OVERLAPPING], "\t\t%3d %3d %3d %3d %3d %3d  %f ",
-		nu[0], nu[1], nu[2], nu[3], nu[4], nu[5], chi2);
-
-	if ( isNegative(p_value) || isGreaterThanOne(p_value) )
-		fprintf(stats[TEST_OVERLAPPING], "WARNING:  P_VALUE IS OUT OF RANGE.\n");
-
-	free(sequence);
-	fprintf(stats[TEST_OVERLAPPING], "%f %s\n\n", p_value, p_value < ALPHA ? "FAILURE" : "SUCCESS");
-	fprintf(results[TEST_OVERLAPPING], "%f\n", p_value);
-}
-
-double
-Pr(int u, double eta)
-{
-	int		l;
-	double	sum, p;
-	
-	if ( u == 0 )
-		p = exp(-eta);
-	else {
-		sum = 0.0;
-		for ( l=1; l<=u; l++ )
-			sum += exp(-eta-u*log(2)+l*log(eta)-cephes_lgam(l+1)+cephes_lgam(u)-cephes_lgam(l)-cephes_lgam(u-l+1));
-		p = sum;
-	}
-	return p;
-}
--- a/kerneltest/e32utils/nistsecurerng/src/randomExcursions.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-#include "openc.h"
-#include "../include/externs.h"
-#include "../include/cephes.h"  
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-                     R A N D O M  E X C U R S I O N S  T E S T
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-void
-RandomExcursions(int n)
-{
-	int		b, i, j, k, J, x;
-	int		cycleStart, cycleStop, *cycle = NULL, *S_k = NULL;
-	int		stateX[8] = { -4, -3, -2, -1, 1, 2, 3, 4 };
-	int		counter[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-	double	p_value, sum, constraint, nu[6][8];
-	double	pi[5][6] = { {0.0000000000, 0.00000000000, 0.00000000000, 0.00000000000, 0.00000000000, 0.0000000000}, 
-						 {0.5000000000, 0.25000000000, 0.12500000000, 0.06250000000, 0.03125000000, 0.0312500000},
-						 {0.7500000000, 0.06250000000, 0.04687500000, 0.03515625000, 0.02636718750, 0.0791015625},
-						 {0.8333333333, 0.02777777778, 0.02314814815, 0.01929012346, 0.01607510288, 0.0803755143},
-						 {0.8750000000, 0.01562500000, 0.01367187500, 0.01196289063, 0.01046752930, 0.0732727051} };
-	
-	if ( ((S_k = (int *)calloc(n, sizeof(int))) == NULL) ||
-		 ((cycle = (int *)calloc(MAX(1000, n/100), sizeof(int))) == NULL) ) {
-		printf("Random Excursions Test:  Insufficent Work Space Allocated.\n");
-		if ( S_k != NULL )
-			free(S_k);
-		if ( cycle != NULL )
-			free(cycle);
-		return;
-	}
-	
-	J = 0; 					/* DETERMINE CYCLES */
-	S_k[0] = 2*(int)epsilon[0] - 1;
-	for( i=1; i<n; i++ ) {
-		S_k[i] = S_k[i-1] + 2*epsilon[i] - 1;
-		if ( S_k[i] == 0 ) {
-			J++;
-			if ( J > MAX(1000, n/100) ) {
-				printf("ERROR IN FUNCTION randomExcursions:  EXCEEDING THE MAX NUMBER OF CYCLES EXPECTED\n.");
-				free(S_k);
-				free(cycle);
-				return;
-			}
-			cycle[J] = i;
-		}
-	}
-	if ( S_k[n-1] != 0 )
-		J++;
-	cycle[J] = n;
-
-	fprintf(stats[TEST_RND_EXCURSION], "\t\t\t  RANDOM EXCURSIONS TEST\n");
-	fprintf(stats[TEST_RND_EXCURSION], "\t\t--------------------------------------------\n");
-	fprintf(stats[TEST_RND_EXCURSION], "\t\tCOMPUTATIONAL INFORMATION:\n");
-	fprintf(stats[TEST_RND_EXCURSION], "\t\t--------------------------------------------\n");
-	fprintf(stats[TEST_RND_EXCURSION], "\t\t(a) Number Of Cycles (J) = %04d\n", J);
-	fprintf(stats[TEST_RND_EXCURSION], "\t\t(b) Sequence Length (n)  = %d\n", n);
-
-	constraint = MAX(0.005*pow(n, 0.5), 500);
-	if (J < constraint) {
-		fprintf(stats[TEST_RND_EXCURSION], "\t\t---------------------------------------------\n");
-		fprintf(stats[TEST_RND_EXCURSION], "\t\tWARNING:  TEST NOT APPLICABLE.  THERE ARE AN\n");
-		fprintf(stats[TEST_RND_EXCURSION], "\t\t\t  INSUFFICIENT NUMBER OF CYCLES.\n");
-		fprintf(stats[TEST_RND_EXCURSION], "\t\t---------------------------------------------\n");
-		for(i = 0; i < 8; i++)
-			fprintf(results[TEST_RND_EXCURSION], "%f\n", 0.0);
-	}
-	else {
-		fprintf(stats[TEST_RND_EXCURSION], "\t\t(c) Rejection Constraint = %f\n", constraint);
-		fprintf(stats[TEST_RND_EXCURSION], "\t\t-------------------------------------------\n");
-
-		cycleStart = 0;
-		cycleStop  = cycle[1];
-		for ( k=0; k<6; k++ )
-			for ( i=0; i<8; i++ )
-				nu[k][i] = 0.;
-		for ( j=1; j<=J; j++ ) {                           /* FOR EACH CYCLE */
-			for ( i=0; i<8; i++ )
-				counter[i] = 0;
-			for ( i=cycleStart; i<cycleStop; i++ ) {
-				if ( (S_k[i] >= 1 && S_k[i] <= 4) || (S_k[i] >= -4 && S_k[i] <= -1) ) {
-					if ( S_k[i] < 0 )
-						b = 4;
-					else
-						b = 3;
-					counter[S_k[i]+b]++;
-				}
-			}
-			cycleStart = cycle[j]+1;
-			if ( j < J )
-				cycleStop = cycle[j+1];
-			
-			for ( i=0; i<8; i++ ) {
-				if ( (counter[i] >= 0) && (counter[i] <= 4) )
-					nu[counter[i]][i]++;
-				else if ( counter[i] >= 5 )
-					nu[5][i]++;
-			}
-		}
-		
-		for ( i=0; i<8; i++ ) {
-			x = stateX[i];
-			sum = 0.;
-			for ( k=0; k<6; k++ )
-				sum += pow(nu[k][i] - J*pi[(int)fabs(x)][k], 2) / (J*pi[(int)fabs(x)][k]);
-			p_value = cephes_igamc(2.5, sum/2.0);
-			
-			if ( isNegative(p_value) || isGreaterThanOne(p_value) )
-				fprintf(stats[TEST_RND_EXCURSION], "WARNING:  P_VALUE IS OUT OF RANGE.\n");
-
-			fprintf(stats[TEST_RND_EXCURSION], "%s\t\tx = %2d chi^2 = %9.6f p_value = %f\n",
-					p_value < ALPHA ? "FAILURE" : "SUCCESS", x, sum, p_value);
-			fprintf(results[TEST_RND_EXCURSION], "%f\n", p_value);
-		}
-	} 
-	fprintf(stats[TEST_RND_EXCURSION], "\n");
-	free(S_k);
-	free(cycle);
-}
--- a/kerneltest/e32utils/nistsecurerng/src/randomExcursionsVariant.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-#include "openc.h"
-#include "../include/externs.h"
-#include "../include/cephes.h"
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-            R A N D O M  E X C U R S I O N S  V A R I A N T  T E S T
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-void
-RandomExcursionsVariant(int n)
-{
-	int		i, p, J, x, constraint, count, *S_k;
-	int		stateX[18] = { -9, -8, -7, -6, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
-	double	p_value;
-	
-	if ( (S_k = (int *)calloc(n, sizeof(int))) == NULL ) {
-		fprintf(stats[TEST_RND_EXCURSION_VAR], "\t\tRANDOM EXCURSIONS VARIANT: Insufficent memory allocated.\n");
-		return;
-	}
-	J = 0;
-	S_k[0] = 2*(int)epsilon[0] - 1;
-	for ( i=1; i<n; i++ ) {
-		S_k[i] = S_k[i-1] + 2*epsilon[i] - 1;
-		if ( S_k[i] == 0 )
-			J++;
-	}
-	if ( S_k[n-1] != 0 )
-		J++;
-
-	fprintf(stats[TEST_RND_EXCURSION_VAR], "\t\t\tRANDOM EXCURSIONS VARIANT TEST\n");
-	fprintf(stats[TEST_RND_EXCURSION_VAR], "\t\t--------------------------------------------\n");
-	fprintf(stats[TEST_RND_EXCURSION_VAR], "\t\tCOMPUTATIONAL INFORMATION:\n");
-	fprintf(stats[TEST_RND_EXCURSION_VAR], "\t\t--------------------------------------------\n");
-	fprintf(stats[TEST_RND_EXCURSION_VAR], "\t\t(a) Number Of Cycles (J) = %d\n", J);
-	fprintf(stats[TEST_RND_EXCURSION_VAR], "\t\t(b) Sequence Length (n)  = %d\n", n);
-	fprintf(stats[TEST_RND_EXCURSION_VAR], "\t\t--------------------------------------------\n");
-
-	constraint = (int)MAX(0.005*pow(n, 0.5), 500);
-	if (J < constraint) {
-		fprintf(stats[TEST_RND_EXCURSION_VAR], "\n\t\tWARNING:  TEST NOT APPLICABLE.  THERE ARE AN\n");
-		fprintf(stats[TEST_RND_EXCURSION_VAR], "\t\t\t  INSUFFICIENT NUMBER OF CYCLES.\n");
-		fprintf(stats[TEST_RND_EXCURSION_VAR], "\t\t---------------------------------------------\n");
-		for ( i=0; i<18; i++ )
-			fprintf(results[TEST_RND_EXCURSION_VAR], "%f\n", 0.0);
-	}
-	else {
-		for ( p=0; p<=17; p++ ) {
-			x = stateX[p];
-			count = 0;
-			for ( i=0; i<n; i++ )
-				if ( S_k[i] == x )
-					count++;
-			p_value = erfc(fabs(count-J)/(sqrt(2.0*J*(4.0*fabs(x)-2))));
-
-			if ( isNegative(p_value) || isGreaterThanOne(p_value) )
-				fprintf(stats[TEST_RND_EXCURSION_VAR], "\t\t(b) WARNING: P_VALUE IS OUT OF RANGE.\n");
-			fprintf(stats[TEST_RND_EXCURSION_VAR], "%s\t\t", p_value < ALPHA ? "FAILURE" : "SUCCESS");
-			fprintf(stats[TEST_RND_EXCURSION_VAR], "(x = %2d) Total visits = %4d; p-value = %f\n", x, count, p_value);
-			fprintf(results[TEST_RND_EXCURSION_VAR], "%f\n", p_value);
-		}
-	}
-	fprintf(stats[TEST_RND_EXCURSION_VAR], "\n");
-	free(S_k);
-}
--- a/kerneltest/e32utils/nistsecurerng/src/rank.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-#include "openc.h"
-#include "../include/externs.h"
-#include "../include/cephes.h"
-#include "../include/matrix.h"
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-                              R A N K  T E S T
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-void
-Rank(int n)
-{
-	int			N, i, k, r;
-	double		p_value, product, chi_squared, arg1, p_32, p_31, p_30, R, F_32, F_31, F_30;
-	
-	N = n/(32*32);
-	if ( isZero(N) ) {
-		fprintf(stats[TEST_RANK], "\t\t\t\tRANK TEST\n");
-		fprintf(stats[TEST_RANK], "\t\tError: Insuffucient # Of Bits To Define An 32x32 (%dx%d) Matrix\n", 32, 32);
-		p_value = 0.00;
-	}
-	else {
-        BitSequence **matrix = create_matrix(32, 32);
-		
-        r = 32;					/* COMPUTE PROBABILITIES */
-		product = 1;
-		for ( i=0; i<=r-1; i++ )
-			product *= ((1.e0-pow(2, i-32))*(1.e0-pow(2, i-32)))/(1.e0-pow(2, i-r));
-		p_32 = pow(2, r*(32+32-r)-32*32) * product;
-		
-		r = 31;
-		product = 1;
-		for ( i=0; i<=r-1; i++ )
-			product *= ((1.e0-pow(2, i-32))*(1.e0-pow(2, i-32)))/(1.e0-pow(2, i-r));
-		p_31 = pow(2, r*(32+32-r)-32*32) * product;
-		
-		p_30 = 1 - (p_32+p_31);
-		
-		F_32 = 0;
-		F_31 = 0;
-		for ( k=0; k<N; k++ ) {			/* FOR EACH 32x32 MATRIX   */
-			def_matrix(32, 32, matrix, k);
-#if (DISPLAY_MATRICES == 1)
-			display_matrix(32, 32, matrix);
-#endif
-			R = computeRank(32, 32, matrix);
-			if ( R == 32 )
-				F_32++;			/* DETERMINE FREQUENCIES */
-			if ( R == 31 )
-				F_31++;
-		}
-		F_30 = (double)N - (F_32+F_31);
-		
-		chi_squared =(pow(F_32 - N*p_32, 2)/(double)(N*p_32) +
-					  pow(F_31 - N*p_31, 2)/(double)(N*p_31) +
-					  pow(F_30 - N*p_30, 2)/(double)(N*p_30));
-		
-		arg1 = -chi_squared/2.e0;
-
-		fprintf(stats[TEST_RANK], "\t\t\t\tRANK TEST\n");
-		fprintf(stats[TEST_RANK], "\t\t---------------------------------------------\n");
-		fprintf(stats[TEST_RANK], "\t\tCOMPUTATIONAL INFORMATION:\n");
-		fprintf(stats[TEST_RANK], "\t\t---------------------------------------------\n");
-		fprintf(stats[TEST_RANK], "\t\t(a) Probability P_%d = %f\n", 32,p_32);
-		fprintf(stats[TEST_RANK], "\t\t(b)             P_%d = %f\n", 31,p_31);
-		fprintf(stats[TEST_RANK], "\t\t(c)             P_%d = %f\n", 30,p_30);
-		fprintf(stats[TEST_RANK], "\t\t(d) Frequency   F_%d = %d\n", 32,(int)F_32);
-		fprintf(stats[TEST_RANK], "\t\t(e)             F_%d = %d\n", 31,(int)F_31);
-		fprintf(stats[TEST_RANK], "\t\t(f)             F_%d = %d\n", 30,(int)F_30);
-		fprintf(stats[TEST_RANK], "\t\t(g) # of matrices    = %d\n", N);
-		fprintf(stats[TEST_RANK], "\t\t(h) Chi^2            = %f\n", chi_squared);
-		fprintf(stats[TEST_RANK], "\t\t(i) NOTE: %d BITS WERE DISCARDED.\n", n%(32*32));
-		fprintf(stats[TEST_RANK], "\t\t---------------------------------------------\n");
-
-		p_value = exp(arg1);
-		if ( isNegative(p_value) || isGreaterThanOne(p_value) )
-			fprintf(stats[TEST_RANK], "WARNING:  P_VALUE IS OUT OF RANGE.\n");
-
-		for ( i=0; i<32; i++ )				/* DEALLOCATE MATRIX  */
-			free(matrix[i]);
-		free(matrix);
-	}
-	fprintf(stats[TEST_RANK], "%s\t\tp_value = %f\n\n", p_value < ALPHA ? "FAILURE" : "SUCCESS", p_value);
-	fprintf(results[TEST_RANK], "%f\n", p_value);
-}
--- a/kerneltest/e32utils/nistsecurerng/src/runs.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-#include "openc.h"
-#include "../include/externs.h"
-#include "../include/cephes.h"
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-                              R U N S  T E S T 
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-void
-Runs(int n)
-{
-	int		S, k;
-	double	pi, V, erfc_arg, p_value;
-
-	S = 0;
-	for ( k=0; k<n; k++ )
-		if ( epsilon[k] )
-			S++;
-	pi = (double)S / (double)n;
-
-	if ( fabs(pi - 0.5) > (2.0 / sqrt(n)) ) {
-		fprintf(stats[TEST_RUNS], "\t\t\t\tRUNS TEST\n");
-		fprintf(stats[TEST_RUNS], "\t\t------------------------------------------\n");
-		fprintf(stats[TEST_RUNS], "\t\tPI ESTIMATOR CRITERIA NOT MET! PI = %f\n", pi);
-		p_value = 0.0;
-	}
-	else {
-
-		V = 1;
-		for ( k=1; k<n; k++ )
-			if ( epsilon[k] != epsilon[k-1] )
-				V++;
-	
-		erfc_arg = fabs(V - 2.0 * n * pi * (1-pi)) / (2.0 * pi * (1-pi) * sqrt(2*n));
-		p_value = erfc(erfc_arg);
-		
-		fprintf(stats[TEST_RUNS], "\t\t\t\tRUNS TEST\n");
-		fprintf(stats[TEST_RUNS], "\t\t------------------------------------------\n");
-		fprintf(stats[TEST_RUNS], "\t\tCOMPUTATIONAL INFORMATION:\n");
-		fprintf(stats[TEST_RUNS], "\t\t------------------------------------------\n");
-		fprintf(stats[TEST_RUNS], "\t\t(a) Pi                        = %f\n", pi);
-		fprintf(stats[TEST_RUNS], "\t\t(b) V_n_obs (Total # of runs) = %d\n", (int)V);
-		fprintf(stats[TEST_RUNS], "\t\t(c) V_n_obs - 2 n pi (1-pi)\n");
-		fprintf(stats[TEST_RUNS], "\t\t    -----------------------   = %f\n", erfc_arg);
-		fprintf(stats[TEST_RUNS], "\t\t      2 sqrt(2n) pi (1-pi)\n");
-		fprintf(stats[TEST_RUNS], "\t\t------------------------------------------\n");
-		if ( isNegative(p_value) || isGreaterThanOne(p_value) )
-			fprintf(stats[TEST_RUNS], "WARNING:  P_VALUE IS OUT OF RANGE.\n");
-
-		fprintf(stats[TEST_RUNS], "%s\t\tp_value = %f\n\n", p_value < ALPHA ? "FAILURE" : "SUCCESS", p_value);
-	}
-
-	fprintf(results[TEST_RUNS], "%f\n", p_value);
-}
--- a/kerneltest/e32utils/nistsecurerng/src/serial.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-#include "openc.h"
-#include "../include/externs.h"
-#include "../include/cephes.h"  
-
-double psi2(int m, int n);
-
-void
-Serial(int m, int n)
-{
-	double	p_value1, p_value2, psim0, psim1, psim2, del1, del2;
-	
-	psim0 = psi2(m, n);
-	psim1 = psi2(m-1, n);
-	psim2 = psi2(m-2, n);
-	del1 = psim0 - psim1;
-	del2 = psim0 - 2.0*psim1 + psim2;
-	p_value1 = cephes_igamc(pow(2, m-1)/2, del1/2.0);
-	p_value2 = cephes_igamc(pow(2, m-2)/2, del2/2.0);
-	
-	fprintf(stats[TEST_SERIAL], "\t\t\t       SERIAL TEST\n");
-	fprintf(stats[TEST_SERIAL], "\t\t---------------------------------------------\n");
-	fprintf(stats[TEST_SERIAL], "\t\t COMPUTATIONAL INFORMATION:		  \n");
-	fprintf(stats[TEST_SERIAL], "\t\t---------------------------------------------\n");
-	fprintf(stats[TEST_SERIAL], "\t\t(a) Block length    (m) = %d\n", m);
-	fprintf(stats[TEST_SERIAL], "\t\t(b) Sequence length (n) = %d\n", n);
-	fprintf(stats[TEST_SERIAL], "\t\t(c) Psi_m               = %f\n", psim0);
-	fprintf(stats[TEST_SERIAL], "\t\t(d) Psi_m-1             = %f\n", psim1);
-	fprintf(stats[TEST_SERIAL], "\t\t(e) Psi_m-2             = %f\n", psim2);
-	fprintf(stats[TEST_SERIAL], "\t\t(f) Del_1               = %f\n", del1);
-	fprintf(stats[TEST_SERIAL], "\t\t(g) Del_2               = %f\n", del2);
-	fprintf(stats[TEST_SERIAL], "\t\t---------------------------------------------\n");
-
-	fprintf(stats[TEST_SERIAL], "%s\t\tp_value1 = %f\n", p_value1 < ALPHA ? "FAILURE" : "SUCCESS", p_value1);
-	fprintf(results[TEST_SERIAL], "%f\n", p_value1);
-
-	fprintf(stats[TEST_SERIAL], "%s\t\tp_value2 = %f\n\n", p_value2 < ALPHA ? "FAILURE" : "SUCCESS", p_value2);
-	fprintf(results[TEST_SERIAL], "%f\n", p_value2);
-}
-
-double
-psi2(int m, int n)
-{
-	int				i, j, k, powLen;
-	double			sum, numOfBlocks;
-	unsigned int	*P;
-	
-	if ( (m == 0) || (m == -1) )
-		return 0.0;
-	numOfBlocks = n;
-	powLen = (int)pow(2, m+1)-1;
-	if ( (P = (unsigned int*)calloc(powLen,sizeof(unsigned int)))== NULL ) {
-		fprintf(stats[TEST_SERIAL], "Serial Test:  Insufficient memory available.\n");
-		fflush(stats[TEST_SERIAL]);
-		return 0.0;
-	}
-	for ( i=1; i<powLen-1; i++ )
-		P[i] = 0;	  /* INITIALIZE NODES */
-	for ( i=0; i<numOfBlocks; i++ ) {		 /* COMPUTE FREQUENCY */
-		k = 1;
-		for ( j=0; j<m; j++ ) {
-			if ( epsilon[(i+j)%n] == 0 )
-				k *= 2;
-			else if ( epsilon[(i+j)%n] == 1 )
-				k = 2*k+1;
-		}
-		P[k-1]++;
-	}
-	sum = 0.0;
-	for ( i=(int)pow(2, m)-1; i<(int)pow(2, m+1)-1; i++ )
-		sum += pow(P[i], 2);
-	sum = (sum * pow(2, m)/(double)n) - (double)n;
-	free(P);
-	
-	return sum;
-}
--- a/kerneltest/e32utils/nistsecurerng/src/universal.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-#include "openc.h"
-#include "../include/externs.h"
-#include "../include/utilities.h"
-#include "../include/cephes.h"
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-                         U N I V E R S A L  T E S T
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-void
-Universal(int n)
-{
-	int		i, j, p, L, Q, K;
-	double	arg, sqrt2, sigma, phi, sum, p_value, c;
-	long	*T, decRep;
-	double	expected_value[17] = { 0, 0, 0, 0, 0, 0, 5.2177052, 6.1962507, 7.1836656,
-				8.1764248, 9.1723243, 10.170032, 11.168765,
-				12.168070, 13.167693, 14.167488, 15.167379 };
-	double   variance[17] = { 0, 0, 0, 0, 0, 0, 2.954, 3.125, 3.238, 3.311, 3.356, 3.384,
-				3.401, 3.410, 3.416, 3.419, 3.421 };
-	
-	/* * * * * * * * * ** * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-	 * THE FOLLOWING REDEFINES L, SHOULD THE CONDITION:     n >= 1010*2^L*L       *
-	 * NOT BE MET, FOR THE BLOCK LENGTH L.                                        *
-	 * * * * * * * * * * ** * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-	L = 5;
-	if ( n >= 387840 )     L = 6;
-	if ( n >= 904960 )     L = 7;
-	if ( n >= 2068480 )    L = 8;
-	if ( n >= 4654080 )    L = 9;
-	if ( n >= 10342400 )   L = 10;
-	if ( n >= 22753280 )   L = 11;
-	if ( n >= 49643520 )   L = 12;
-	if ( n >= 107560960 )  L = 13;
-	if ( n >= 231669760 )  L = 14;
-	if ( n >= 496435200 )  L = 15;
-	if ( n >= 1059061760 ) L = 16;
-	
-	Q = 10*(int)pow(2, L);
-	K = (int) (floor(n/L) - (double)Q);	 		    /* BLOCKS TO TEST */
-	
-	p = (int)pow(2, L);
-	if ( (L < 6) || (L > 16) || ((double)Q < 10*pow(2, L)) ||
-		 ((T = (long *)calloc(p, sizeof(long))) == NULL) ) {
-		fprintf(stats[TEST_UNIVERSAL], "\t\tUNIVERSAL STATISTICAL TEST\n");
-		fprintf(stats[TEST_UNIVERSAL], "\t\t---------------------------------------------\n");
-		fprintf(stats[TEST_UNIVERSAL], "\t\tERROR:  L IS OUT OF RANGE.\n");
-		fprintf(stats[TEST_UNIVERSAL], "\t\t-OR- :  Q IS LESS THAN %f.\n", 10*pow(2, L));
-		fprintf(stats[TEST_UNIVERSAL], "\t\t-OR- :  Unable to allocate T.\n");
-		return;
-	}
-	
-	/* COMPUTE THE EXPECTED:  Formula 16, in Marsaglia's Paper */
-	c = 0.7 - 0.8/(double)L + (4 + 32/(double)L)*pow(K, -3/(double)L)/15;
-	sigma = c * sqrt(variance[L]/(double)K);
-	sqrt2 = sqrt(2);
-	sum = 0.0;
-	for ( i=0; i<p; i++ )
-		T[i] = 0;
-	for ( i=1; i<=Q; i++ ) {		/* INITIALIZE TABLE */
-		decRep = 0;
-		for ( j=0; j<L; j++ )
-			decRep += epsilon[(i-1)*L+j] * (long)pow(2, L-1-j);
-		T[decRep] = i;
-	}
-	for ( i=Q+1; i<=Q+K; i++ ) { 	/* PROCESS BLOCKS */
-		decRep = 0;
-		for ( j=0; j<L; j++ )
-			decRep += epsilon[(i-1)*L+j] * (long)pow(2, L-1-j);
-		sum += log(i - T[decRep])/log(2);
-		T[decRep] = i;
-	}
-	phi = (double)(sum/(double)K);
-
-	fprintf(stats[TEST_UNIVERSAL], "\t\tUNIVERSAL STATISTICAL TEST\n");
-	fprintf(stats[TEST_UNIVERSAL], "\t\t--------------------------------------------\n");
-	fprintf(stats[TEST_UNIVERSAL], "\t\tCOMPUTATIONAL INFORMATION:\n");
-	fprintf(stats[TEST_UNIVERSAL], "\t\t--------------------------------------------\n");
-	fprintf(stats[TEST_UNIVERSAL], "\t\t(a) L         = %d\n", L);
-	fprintf(stats[TEST_UNIVERSAL], "\t\t(b) Q         = %d\n", Q);
-	fprintf(stats[TEST_UNIVERSAL], "\t\t(c) K         = %d\n", K);
-	fprintf(stats[TEST_UNIVERSAL], "\t\t(d) sum       = %f\n", sum);
-	fprintf(stats[TEST_UNIVERSAL], "\t\t(e) sigma     = %f\n", sigma);
-	fprintf(stats[TEST_UNIVERSAL], "\t\t(f) variance  = %f\n", variance[L]);
-	fprintf(stats[TEST_UNIVERSAL], "\t\t(g) exp_value = %f\n", expected_value[L]);
-	fprintf(stats[TEST_UNIVERSAL], "\t\t(h) phi       = %f\n", phi);
-	fprintf(stats[TEST_UNIVERSAL], "\t\t(i) WARNING:  %d bits were discarded.\n", n-(Q+K)*L);
-	fprintf(stats[TEST_UNIVERSAL], "\t\t-----------------------------------------\n");
-
-	arg = fabs(phi-expected_value[L])/(sqrt2 * sigma);
-	p_value = erfc(arg);
-	if ( isNegative(p_value) || isGreaterThanOne(p_value) )
-		fprintf(stats[TEST_UNIVERSAL], "\t\tWARNING:  P_VALUE IS OUT OF RANGE\n");
-
-	fprintf(stats[TEST_UNIVERSAL], "%s\t\tp_value = %f\n\n", p_value < ALPHA ? "FAILURE" : "SUCCESS", p_value);    
-	fprintf(results[TEST_UNIVERSAL], "%f\n", p_value);
-	
-	free(T);
-}
--- a/kerneltest/e32utils/nistsecurerng/src/utilities.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,637 +0,0 @@
-/*
-* Portions 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 "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: 
-* The original NIST Statistical Test Suite code is placed in public domain.
-* (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) 
-* 
-* This software was developed at the National Institute of Standards and Technology by 
-* employees of the Federal Government in the course of their official duties. Pursuant
-* to title 17 Section 105 of the United States Code this software is not subject to 
-* copyright protection and is in the public domain. The NIST Statistical Test Suite is
-* an experimental system. NIST assumes no responsibility whatsoever for its use by other 
-* parties, and makes no guarantees, expressed or implied, about its quality, reliability, 
-* or any other characteristic. We would appreciate acknowledgment if the software is used.
-*/
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-U T I L I T I E S
-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-#include "openc.h"
-#include "../include/externs.h"
-#include "../include/utilities.h"
-#include "../include/generators.h"
-#include "../include/stat_fncs.h"
-
-
-TBuf8<KMaxFileName> gLogFilePath;
-TInt                gTemplateIndex = 1;
-
-bool ConvertToAperiodicBits(BitSequence aSequence[32], long value);
-
-
-int
-displayGeneratorOptions()
-{
-	int		option = 0;
-
-	printf("           G E N E R A T O R    S E L E C T I O N \n");
-	printf("           ______________________________________\n\n");
-	printf("    [0] Input File                 [1] Linear Congruential\n");
-	printf("    [2] Quadratic Congruential I   [3] Quadratic Congruential II\n");
-	printf("    [4] Cubic Congruential         [5] XOR\n");
-	printf("    [6] Modular Exponentiation     [7] Blum-Blum-Shub\n");
-	printf("    [8] Micali-Schnorr             [9] G Using SHA-1\n\n");
-	printf("   Enter Choice: ");
-	scanf("%d", &option);
-	printf("\n\n");
-
-	return option;
-}
-
-
-int
-generatorOptions(char** streamFile)
-{
-	char	file[200];
-	int		option = NUMOFGENERATORS+1; 
-	
-	while ( (option < 0) || (option > NUMOFGENERATORS) ) {
-		option = displayGeneratorOptions();
-		switch( option ) {
-			case 0:
-				printf("\t\tUser Prescribed Input File: ");
-				scanf("%s", file);
-				*streamFile = (char*)calloc(200, sizeof(char));
-				sprintf(*streamFile, "%s", file);
-				printf("\n");
-				break;
-			case 1:
-				*streamFile = "Linear-Congruential";
-				break;
-			case 2:
-				*streamFile = "Quadratic-Congruential-1";
-				break;
-			case 3:
-				*streamFile = "Quadratic-Congruential-2";
-				break;
-			case 4:
-				*streamFile = "Cubic-Congruential";
-				break;
-			case 5:
-				*streamFile = "XOR";
-				break;
-			case 6:
-				*streamFile = "Modular-Exponentiation";
-				break;
-			case 7:
-				*streamFile = "Blum-Blum-Shub";
-				break;
-			case 8:
-				*streamFile = "Micali-Schnorr";
-				break;
-			case 9:
-				*streamFile = "G using SHA-1";
-				break;
-				
-			/* INTRODUCE NEW PRNG NAMES HERE */
-			/*
-			case 10:  *streamFile = "myNewPRNG";
-				break;
-			*/
-			default:
-				printf("Error:  Out of range - Try again!\n");
-				break;
-		}
-	}
-	return option;
-}
-
-
-void
-chooseTests()
-{
-	int		i;
-	
-	printf("                S T A T I S T I C A L   T E S T S\n");
-	printf("                _________________________________\n\n");
-	printf("    [01] Frequency                       [02] Block Frequency\n");
-	printf("    [03] Cumulative Sums                 [04] Runs\n");
-	printf("    [05] Longest Run of Ones             [06] Rank\n");
-	printf("    [07] Discrete Fourier Transform      [08] Nonperiodic Template Matchings\n");
-	printf("    [09] Overlapping Template Matchings  [10] Universal Statistical\n");
-	printf("    [11] Approximate Entropy             [12] Random Excursions\n");
-	printf("    [13] Random Excursions Variant       [14] Serial\n");
-	printf("    [15] Linear Complexity\n\n");
-	printf("         INSTRUCTIONS\n");
-	printf("            Enter 0 if you DO NOT want to apply all of the\n");
-	printf("            statistical tests to each sequence and 1 if you DO.\n\n");
-	printf("   Enter Choice: ");
-	scanf("%d", &testVector[0]);
-	printf("\n");
-	if ( testVector[0] == 1 )
-	    {
-		for( i=1; i<=NUMOFTESTS; i++ )
-			testVector[i] = 1;
-		
-		// Disable Fast Fourier Transform Test.
-		// NIST has discovered a problem with the Fast Fourier Transform test. 
-		// At this time NIST advises disregarding the results of this test until 
-		// a further update is posted.
-		// Link: http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html
-		//
-		// When the FFT test is fixed remove the following 5 lines.
-		printf(" Please Note: \n");
-		printf(" NIST has discovered a problem with the DFT test and hence the DFT results are invalid currently.\n");
-		printf(" DFT test will be disabled at the momemt in the NIST test suite run \n \n");        
-		testVector[TEST_FFT] = 0; 
-		testVector[0] = 0; 
-	    }
-	else {
-		printf("         INSTRUCTIONS\n");
-		printf("            Enter a 0 or 1 to indicate whether or not the numbered statistical\n");
-		printf("            test should be applied to each sequence.\n\n");
-		printf("      123456789111111\n");
-		printf("               012345\n");
-		printf("      ");
-        for ( i=1; i<=NUMOFTESTS; i++ ) 
-            scanf("%1d", &testVector[i]);
-        printf("\n\n");
-    }
-}
-
-
-void
-fixParameters()
-{
-	int		counter, testid;
-	
-	//  Check to see if any parameterized tests are selected
-	if ( (testVector[TEST_BLOCK_FREQUENCY] != 1) && (testVector[TEST_NONPERIODIC] != 1) && 
-		 (testVector[TEST_OVERLAPPING] != 1) && (testVector[TEST_APEN] != 1) &&
-		 (testVector[TEST_SERIAL] != 1) && (testVector[TEST_LINEARCOMPLEXITY] != 1) )
-			return;
-		
-	do {
-		counter = 1;
-		printf("        P a r a m e t e r   A d j u s t m e n t s\n");
-		printf("        -----------------------------------------\n");
-		if ( testVector[TEST_BLOCK_FREQUENCY] == 1 )
-			printf("    [%d] Block Frequency Test - block length(M):         %d\n", counter++, tp.blockFrequencyBlockLength);
-		if ( testVector[TEST_NONPERIODIC] == 1 )
-			printf("    [%d] NonOverlapping Template Test - block length(m): %d\n", counter++, tp.nonOverlappingTemplateBlockLength);
-		if ( testVector[TEST_OVERLAPPING] == 1 )
-			printf("    [%d] Overlapping Template Test - block length(m):    %d\n", counter++, tp.overlappingTemplateBlockLength);
-		if ( testVector[TEST_APEN] == 1 )
-			printf("    [%d] Approximate Entropy Test - block length(m):     %d\n", counter++, tp.approximateEntropyBlockLength);
-		if ( testVector[TEST_SERIAL] == 1 )
-			printf("    [%d] Serial Test - block length(m):                  %d\n", counter++, tp.serialBlockLength);
-		if ( testVector[TEST_LINEARCOMPLEXITY] == 1 )
-			printf("    [%d] Linear Complexity Test - block length(M):       %d\n", counter++, tp.linearComplexitySequenceLength);
-		printf("\n");
-		printf("   Select Test (0 to continue): ");
-		scanf("%1d", &testid);
-		printf("\n");
-		
-		counter = 0;
-		if ( testVector[TEST_BLOCK_FREQUENCY] == 1 ) {
-			counter++;
-			if ( counter == testid ) {
-				printf("   Enter Block Frequency Test block length: ");
-				scanf("%d", &tp.blockFrequencyBlockLength);
-				printf("\n");
-				continue;
-			}
-		}
-		if ( testVector[TEST_NONPERIODIC] == 1 ) {
-			counter++;
-			if ( counter == testid ) {
-				printf("   Enter NonOverlapping Template Test block Length: ");
-				scanf("%d", &tp.nonOverlappingTemplateBlockLength);
-				printf("\n");
-				continue;
-			}
-		}
-		if ( testVector[TEST_OVERLAPPING] == 1 ) {
-			counter++;
-			if ( counter == testid ) {
-				printf("   Enter Overlapping Template Test block Length: ");
-				scanf("%d", &tp.overlappingTemplateBlockLength);
-				printf("\n");
-				continue;
-			}
-		}
-		if ( testVector[TEST_APEN] == 1 ) {
-			counter++;
-			if ( counter == testid ) {
-				printf("   Enter Approximate Entropy Test block Length: ");
-				scanf("%d", &tp.approximateEntropyBlockLength);
-				printf("\n");
-				continue;
-			}
-		}
-		if ( testVector[TEST_SERIAL] == 1 ) {
-			counter++;
-			if ( counter == testid ) {
-				printf("   Enter Serial Test block Length: ");
-				scanf("%d", &tp.serialBlockLength);
-				printf("\n");
-				continue;
-			}
-		}
-		if ( testVector[TEST_LINEARCOMPLEXITY] == 1 ) {
-			counter++;
-			if ( counter == testid ) {
-				printf("   Enter Linear Complexity Test block Length: ");
-				scanf("%d", &tp.linearComplexitySequenceLength);
-				printf("\n");
-				continue;
-			}
-		}
-	} while ( testid != 0 );
-}
-
-
-void
-fileBasedBitStreams(char *streamFile)
-{
-	FILE	*fp;
-	int		mode;
-	
-	printf("   Input File Format:\n");
-	printf("    [0] ASCII - A sequence of ASCII 0's and 1's\n");
-	printf("    [1] Binary - Each byte in data file contains 8 bits of data\n\n");
-	printf("   Select input mode:  ");
-	scanf("%1d", &mode);
-	printf("\n");
-	if ( mode == 0 ) {
-		if ( (fp = fopen(streamFile, "r")) == NULL ) {
-			printf("ERROR IN FUNCTION fileBasedBitStreams:  file %s could not be opened.\n",  streamFile);
-			exit(-1);
-		}
-		readBinaryDigitsInASCIIFormat(fp, streamFile);
-		fclose(fp);
-	}
-	else if ( mode == 1 ) {
-		if ( (fp = fopen(streamFile, "rb")) == NULL ) {
-			printf("ERROR IN FUNCTION fileBasedBitStreams:  file %s could not be opened.\n", streamFile);
-			exit(-1);
-		}
-		readHexDigitsInBinaryFormat(fp);
-		fclose(fp);
-	}
-}
-
-
-void
-readBinaryDigitsInASCIIFormat(FILE *fp, char *streamFile)
-{
-	int		i, j, num_0s, num_1s, bitsRead, bit;
-	
-	if ( (epsilon = (BitSequence *) calloc(tp.n, sizeof(BitSequence))) == NULL ) {
-		printf("BITSTREAM DEFINITION:  Insufficient memory available.\n");
-		printf("Statistical Testing Aborted!\n");
-		return;
-	}
-	printf("     Statistical Testing In Progress.........\n\n");   
-	for ( i=0; i<tp.numOfBitStreams; i++ ) {
-		num_0s = 0;
-		num_1s = 0;
-		bitsRead = 0;
-		for ( j=0; j<tp.n; j++ ) {
-			if ( fscanf(fp, "%1d", &bit) == EOF ) {
-				printf("ERROR:  Insufficient data in file %s.  %d bits were read.\n", streamFile, bitsRead);
-				fclose(fp);
-				free(epsilon);
-				return;
-			}
-			else {
-				bitsRead++;
-				if ( bit == 0 ) 
-					num_0s++;
-				else 
-					num_1s++;
-				epsilon[j] = (BitSequence)bit;
-			}
-		}
-		fprintf(freqfp, "\t\tBITSREAD = %d 0s = %d 1s = %d\n", bitsRead, num_0s, num_1s);
-		nist_test_suite();
-	}
-	free(epsilon);
-}
-
-
-void
-readHexDigitsInBinaryFormat(FILE *fp)
-{
-	int		i, done, num_0s, num_1s, bitsRead;
-	BYTE	buffer[4];
-	
-	if ( (epsilon = (BitSequence *) calloc(tp.n,sizeof(BitSequence))) == NULL ) {
-		printf("BITSTREAM DEFINITION:  Insufficient memory available.\n");
-		return;
-	}
-
-	printf("     Statistical Testing In Progress.........\n\n");   
-	for ( i=0; i<tp.numOfBitStreams; i++ ) {
-		num_0s = 0;
-		num_1s = 0;
-		bitsRead = 0;
-		done = 0;
-		do {
-			if ( fread(buffer, sizeof(unsigned char), 4, fp) != 4 ) {
-				printf("READ ERROR:  Insufficient data in file.\n");
-				free(epsilon);
-				return;
-			}
-			done = convertToBits(buffer, 32, tp.n, &num_0s, &num_1s, &bitsRead);
-		} while ( !done );
-		fprintf(freqfp, "\t\tBITSREAD = %d 0s = %d 1s = %d\n", bitsRead, num_0s, num_1s);
-		
-		nist_test_suite();
-		
-	}
-	free(epsilon);
-}
-
-
-int
-convertToBits(const BYTE *x, int xBitLength, int bitsNeeded, int *num_0s, int *num_1s, int *bitsRead)
-{
-	int		i, j, count, bit;
-	BYTE	mask;
-	int		zeros, ones;
-
-	count = 0;
-	zeros = ones = 0;
-	for ( i=0; i<(xBitLength+7)/8; i++ ) {
-		mask = 0x80;
-		for ( j=0; j<8; j++ ) {
-			if ( *(x+i) & mask ) {
-				bit = 1;
-				(*num_1s)++;
-				ones++;
-			}
-			else {
-				bit = 0;
-				(*num_0s)++;
-				zeros++;
-			}
-			mask >>= 1;
-			epsilon[*bitsRead] = (BitSequence)bit;
-			(*bitsRead)++;
-			if ( *bitsRead == bitsNeeded )
-				return 1;
-			if ( ++count == xBitLength )
-				return 0;
-		}
-	}
-	
-	return 0;
-}
-
-
-void
-openOutputStreams(int option)
-{
-	int		i, numOfBitStreams, numOfOpenFiles = 0;
-	char	freqfn[200], statsDir[200], resultsDir[200];
-    TBuf16<200>      logFilePath;
-    logFilePath.Copy(_L("c:\\nist"));
-
-    printf("      Directory for logs : ");
-    gConsole->Printf(logFilePath);
-    ReadStringFromConsole(logFilePath);
-    gConsole->Printf(_L("\r\n"));
-    gLogFilePath.Copy(logFilePath);
-
-    TBuf8<100> tempName;
-    TBuf<100> directoryName;
-
-    for(i = 1; i <= NUMOFTESTS; ++i)
-        {
-        tempName.Format(_L8("%s\\experiments\\%s\\%s\\"), gLogFilePath.PtrZ(),  generatorDir[option], testNames[i]);
-        directoryName.Copy(tempName);
-        gFileSession.MkDirAll(directoryName);
-        }
-	
-	sprintf(freqfn, "%s\\experiments\\%s\\freq", gLogFilePath.PtrZ(), generatorDir[option]);
-	if ( (freqfp = fopen(freqfn, "w")) == NULL ) {
-		printf("\t\tMAIN:  Could not open freq file: experiments/%s/freq", generatorDir[option]);
-		exit(-1);
-	}
-
-	TBuf8<512> finalAnalysisReport;
-    finalAnalysisReport.Format(_L8("%s\\finalAnalysisReport"), gLogFilePath.PtrZ());
-
-    if ( (summary = fopen((const char *)finalAnalysisReport.PtrZ(), "w")) == NULL ) {
-		printf("\t\tMAIN:  Could not open stats file: %s\\experiments\\%s\\finalAnalysisReport",gLogFilePath.PtrZ(), generatorDir[option]);
-		exit(-1);
-	}
-	
-	for( i=1; i<=NUMOFTESTS; i++ ) {
-		if ( testVector[i] == 1 ) {
-			sprintf(statsDir, "%s\\experiments\\%s\\%s\\stats", gLogFilePath.PtrZ(), generatorDir[option], testNames[i]);
-			sprintf(resultsDir, "%s\\experiments\\%s\\%s\\results", gLogFilePath.PtrZ(), generatorDir[option], testNames[i]);
-			if ( (stats[i] = fopen(statsDir, "w")) == NULL ) {	/* STATISTICS LOG */
-				printf("ERROR: LOG FILES COULD NOT BE OPENED.\n");
-				printf("       MAX # OF OPENED FILES HAS BEEN REACHED = %d\n", numOfOpenFiles);
-				printf("-OR-   THE OUTPUT DIRECTORY DOES NOT EXIST.\n");
-				exit(-1);
-			}
-			else
-				numOfOpenFiles++;
-			if ( (results[i] = fopen(resultsDir, "w")) == NULL ) {	/* P_VALUES LOG   */
-				 printf("ERROR: LOG FILES COULD NOT BE OPENED.\n");
-				 printf("       MAX # OF OPENED FILES HAS BEEN REACHED = %d\n", numOfOpenFiles);
-				 printf("-OR-   THE OUTPUT DIRECTORY DOES NOT EXIST.\n");
-				 exit(-1);
-			}
-			else
-				numOfOpenFiles++;
-		}
-	}
-	printf("   How many bitstreams? ");
-	scanf("%d", &numOfBitStreams);
-	tp.numOfBitStreams = numOfBitStreams;
-	printf("\n");
-}
-
-
-void
-invokeTestSuite(int option, char *streamFile)
-{
-	fprintf(freqfp, "________________________________________________________________________________\n\n");
-	fprintf(freqfp, "\t\tALPHA = %6.4f\n", ALPHA);
-	fprintf(freqfp, "________________________________________________________________________________\n\n");
-	if ( option != 0 )
-		printf("     Statistical Testing In Progress.........\n\n");
-	switch( option ) {
-		case 0:
-			fileBasedBitStreams(streamFile);
-			break;
-		case 1:
-			lcg();
-			break;
-		case 2:
-			quadRes1();
-			break;
-		case 3:
-			quadRes2();
-			break;
-		case 4:
-			cubicRes();
-			break;
-		case 5:
-			exclusiveOR();
-			break;
-		case 6:
-			modExp();
-			break;
-		case 7:
-			bbs();
-			break;
-		case 8:
-			micali_schnorr();
-			break;
-		case 9:
-			SHA1();
-			break;
-		case 10:
-		    HASH_DRBG();
-		    break;
-			
-		/* INTRODUCE NEW PSEUDO RANDOM NUMBER GENERATORS HERE */
-			
-		default:
-			printf("Error in invokeTestSuite!\n");
-			break;
-	}
-	printf("     Statistical Testing Complete!!!!!!!!!!!!\n\n");
-}
-
-
-void
-nist_test_suite()
-{
-	if ( (testVector[0] == 1) || (testVector[TEST_FREQUENCY] == 1) ) 
-		Frequency(tp.n);
-	
-	if ( (testVector[0] == 1) || (testVector[TEST_BLOCK_FREQUENCY] == 1) ) 
-		BlockFrequency(tp.blockFrequencyBlockLength, tp.n);
-	
-	if ( (testVector[0] == 1) || (testVector[TEST_CUSUM] == 1) )
-		CumulativeSums(tp.n);
-	
-	if ( (testVector[0] == 1) || (testVector[TEST_RUNS] == 1) )
-		Runs(tp.n); 
-	
-	if ( (testVector[0] == 1) || (testVector[TEST_LONGEST_RUN] == 1) )
-		LongestRunOfOnes(tp.n);
-	
-	if ( (testVector[0] == 1) || (testVector[TEST_RANK] == 1) )
-		Rank(tp.n);
-	
-	if ( (testVector[0] == 1) || (testVector[TEST_FFT] == 1) )
-	    {
-        // Disable Fast Fourier Transform Test.
-		// NIST has discovered a problem with the Fast Fourier Transform test. 
-		// At this time NIST advises disregarding the results of this test until 
-		// a further update is posted.
-		// Link: http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html
-		//
-		// When the FFT test is fixed remove the following 3 printf lines and uncomment the 4th line.
-        printf("  Please Note: NIST has discovered a problem with the DFT test and hence\n");
-        printf("  the DFT results are invalid currently.\n");
-        printf("  So all tests except DFT will run until futher notification from NIST \n \n");   
-        //DiscreteFourierTransform(tp.n);
-	    }
-	    	
-	if ( (testVector[0] == 1) || (testVector[TEST_NONPERIODIC] == 1) )
-		NonOverlappingTemplateMatchings(tp.nonOverlappingTemplateBlockLength, tp.n);
-	
-	if ( (testVector[0] == 1) || (testVector[TEST_OVERLAPPING] == 1) )
-		OverlappingTemplateMatchings(tp.overlappingTemplateBlockLength, tp.n);
-	
-	if ( (testVector[0] == 1) || (testVector[TEST_UNIVERSAL] == 1) )
-		Universal(tp.n);
-	
-	if ( (testVector[0] == 1) || (testVector[TEST_APEN] == 1) )
-		ApproximateEntropy(tp.approximateEntropyBlockLength, tp.n);
-	
-	if ( (testVector[0] == 1) || (testVector[TEST_RND_EXCURSION] == 1) )
-		RandomExcursions(tp.n);
-	
-	if ( (testVector[0] == 1) || (testVector[TEST_RND_EXCURSION_VAR] == 1) )
-		RandomExcursionsVariant(tp.n);
-	
-	if ( (testVector[0] == 1) || (testVector[TEST_SERIAL] == 1) )
-		Serial(tp.serialBlockLength,tp.n);
-	
-	if ( (testVector[0] == 1) || (testVector[TEST_LINEARCOMPLEXITY] == 1) )
-		LinearComplexity(tp.linearComplexitySequenceLength, tp.n);
-}
-
-void GetNextTemplateItem(BitSequence aBitSequence[])
-    {
-    int count = (TInt)pow(2, tp.overlappingTemplateBlockLength);
-    
-    for(bool isSuccess = false; (!isSuccess) && (gTemplateIndex < count); ++gTemplateIndex)
-        {
-        isSuccess = ConvertToAperiodicBits(aBitSequence, gTemplateIndex);
-        }
-    }
-
-
-bool ConvertToAperiodicBits(BitSequence aSequence[32], long value)
-    {
-    int bitMask = int(1U << (KMaxBit-1));
-
-    long count = tp.overlappingTemplateBlockLength;
-    
-    for(int c = 0; c < KMaxBit; c++) 
-        {
-        if (value & bitMask)
-            aSequence[c] = 1;
-        else
-            aSequence[c] = 0;
-        value <<= 1;
-        }
-
-    bool match = false;
-    
-    for(int i = 1; i < count; i++) 
-        {
-        match = false;
-        if ((aSequence[KMaxBit-count]!= aSequence[KMaxBit-1]) && ((aSequence[KMaxBit-count]!= aSequence[KMaxBit-2])||(aSequence[KMaxBit-count+1] != aSequence[KMaxBit-1]))) 
-            {
-            for(int c = KMaxBit-count; c <= (KMaxBit-1)-i; c++) 
-                {
-                if (aSequence[c] != aSequence[c+i]) 
-                    {
-                    match = true;
-                    break;
-                    }
-                }
-            }
-        
-        if (!match) 
-            {
-            break;
-            }
-        }
-
-    return match;
-    }
-
--- a/kerneltest/e32utils/nistsecurerng/src/utils/openc.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,616 +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 "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: 
-*/
-
-
-//------------------------------------ System Header Files ------------------------------------------------
-#include <e32cons.h>        // ConsoleBase
-//------------------------------------ Local Header Files -------------------------------------------------
-#include "openc.h"
-
-//-------------------------------- Constants, global variables and Macro Definitions ----------------------------------------
-_LIT(KConsoleName, "NIST Test Console");
-CConsoleBase* gConsole = NULL;
-
-
-int PrintToScreen(const char* aString);
-
-const TInt KIntStringLen = 10;
-RFs gFileSession;
-
-enum TDataType
-    {
-    EInteger,
-    EFloat,
-    EUnknownType = 0x10000
-    };
-
-const TInt KMaxReadSize = 50;
-const TInt KMaxScreenBufferSize = 100;
-
-TBuf<KMaxScreenBufferSize> gScreenBuffer;
-
-class GlobalInitilizer
-    {
-public:
-    GlobalInitilizer()
-        {
-        TInt err = gFileSession.Connect();
-
-        if(err != KErrNone)
-            {
-            User::Exit(err);
-            }
-
-        TRAP(err, gConsole = Console::NewL(KConsoleName, TSize(KConsFullScreen,KConsFullScreen)));
-        if(err != KErrNone)
-            {
-            User::Exit(err);
-            }
-        }
-    ~GlobalInitilizer()
-        {
-        gFileSession.Close();
-        delete gConsole;
-        }
-    };
-
-GlobalInitilizer globalObj;
-
-//------------------------------------ Function Definitions -----------------------------------------------
-
-double log(double aSource)
-    {
-    double result = 0.0;
-    Math::Ln(result, aSource);
-    return result;
-    }
-
-double exp(double aSource)
-    {
-    double result = 0.0;
-    Math::Exp(result, aSource);
-    return result;
-    }
-
-double fabs(double aSource)
-    {
-    return (aSource >= 0.0)? aSource: -aSource;
-    }
-
-
-double floor(double aSource)
-    {
-    if(aSource >= 0.0 || aSource == (TInt64)aSource)
-        {
-        return (double)(TInt64)aSource;
-        }
-   
-    return (double)((TInt64)aSource - 1);
-    }
-
-double sqrt(double aSource)
-    {
-    double result = 0.0;
-    Math::Sqrt(result, aSource);
-    return result;
-    }
-
-double pow(double aSource, double aPower)
-    {
-    double result = 0.0;
-    Math::Pow(result, aSource, aPower);
-    return result;
-    }
-
-// Math trigonometric functions
-double sin(double aSource)
-    {
-    double result = 0.0;
-    Math::Sin(result, aSource);
-    return result;
-    }
-
-double cos(double aSource)
-    {
-    double result = 0.0;
-    Math::Cos(result, aSource);
-    return result;
-    }
-
-// Stdio functions
-int printf(const char* aFormatString, ...)
-    {
-    TUint length = User::StringLength((TUint8*)aFormatString) + 100;
-    HBufC8* buffer = HBufC8::New(length);
-    if(NULL == buffer)
-        {
-        return KErrNoMemory;
-        }
-    
-    TPtr8 targetPtr = buffer->Des();
-    TPtrC8 formatPtr((TUint8*)aFormatString);
-
-    VA_LIST list;
-    VA_START(list, aFormatString);
-    
-    targetPtr.FormatList(formatPtr, list);
-    
-    PrintToScreen((const char*)targetPtr.PtrZ());
-
-    delete buffer;
-
-    return targetPtr.Length();
-    }
-
-int puts(const char* aString)
-    {
-    int ret = PrintToScreen(aString);
-    gConsole->Printf(_L("\n"));
-    
-    return ret;
-    }
-
-int putchar(int aChar)
-    {
-    gConsole->Printf(_L("%c"), aChar);
-    return aChar;
-    }
-
-char* strcpy(char* aDst, const char* aSrc)
-    {
-    char* cp = aDst;
-
-    while((*cp++ = *aSrc++) != 0)
-        ; // Copy src over dst
-
-    return(aDst);
-    }
-
-int scanf(const char* aFormatString, ...)
-    {
-    TDataType type = EUnknownType;
-    TBool byteRead = EFalse;
-    
-    if(Mem::Compare((const unsigned char*)aFormatString, 2, (const unsigned char*)"%d", 2) == 0)
-        {
-        type = EInteger;
-        }
-    else if(Mem::Compare((const unsigned char*)aFormatString, 2, (const unsigned char*)"%f", 2) == 0)
-        {
-        type = EFloat;
-        }
-    else if(Mem::Compare((const unsigned char*)aFormatString, 3, (const unsigned char*)"%1d", 3) == 0)
-        {
-        type = EInteger;
-        byteRead = ETrue;
-        }
-    else
-        {
-        User::Panic(_L("NIST TestSuit Error"), KErrArgument);
-        }
-    
-    if(!byteRead || (gScreenBuffer.Length() == 0))
-        {
-        ReadStringFromConsole(gScreenBuffer);
-        }
-
-    TLex parser(gScreenBuffer);
-    parser.SkipSpace();
-    
-    VA_LIST list;
-    VA_START(list, aFormatString);
-
-    switch(type)
-        {
-        case EInteger:
-            {
-            TInt* ptr = VA_ARG(list, TInt*);
-            if(byteRead)
-                {
-                TChar ch(gScreenBuffer[0]);
-                gScreenBuffer.Delete(0, 1);
-                *ptr = ch.GetNumericValue();
-                }
-            else
-                {
-                parser.Val(*ptr);
-                gScreenBuffer.Zero();
-                }
-            break;
-            }
-        case EFloat:
-            {
-            float* ptr = VA_ARG(list, float*);
-            parser.Val(*ptr);
-            gScreenBuffer.Zero();
-            break;
-            }
-        case EUnknownType:
-            {
-            User::Panic(_L("NIST TestSuit Error"), KErrArgument);
-            }
-        }
-
-    return 1;
-    }
-
-int sprintf(char *aBuffer, const char* aFormatString, ...)
-    {
-    TUint length = User::StringLength((TUint8*)aFormatString) + 100;
-    TPtr8 aTargetPtr((TUint8*)aBuffer, length);
-    TPtrC8 formatPtr((TUint8*)aFormatString);
-
-    VA_LIST list;
-    VA_START(list, aFormatString);
-    
-    aTargetPtr.FormatList(formatPtr, list);
-    aTargetPtr.ZeroTerminate();
-
-    return User::StringLength((TUint8*)aBuffer);;
-    }
-
-int GetFileMode(const char* aModeStr, TFileMode& aFileMode, TBool& aIsAppend)
-    {
-    aIsAppend = EFalse;
-    switch (*aModeStr)
-        {
-        case 'r':
-            aFileMode = EFileRead;
-            break;
-            
-        case 'w':
-            aFileMode = EFileWrite;
-            break;
-            
-        case 'a':
-            aFileMode = EFileWrite;
-            aIsAppend = ETrue;
-            break;
-            
-        default:
-            return KErrArgument;
-        } 
-      
-    return KErrNone;
-    }
-
-FILE *fopen(const char *aFileName, const char *aMode)
-    {
-    TPtrC8 fileNamePtr(reinterpret_cast<const unsigned char*>(aFileName));
-    TFileName fileName;
-    fileName.Copy(fileNamePtr);
-    RFile* file = new RFile;
-    if(NULL == file)
-        {
-        return NULL;
-        }
-
-    TFileMode mode = EFileRead;
-    TBool isAppend = EFalse;
-    GetFileMode(aMode, mode, isAppend);
-    int err = KErrArgument;
-    switch(mode)
-        {
-        case EFileRead:
-            {
-            err = file->Open(gFileSession, fileName, mode);
-            break;
-            }
-        case EFileWrite:
-            {
-            if(isAppend)
-                {
-                err = file->Open(gFileSession, fileName, mode);
-                if(err == KErrNone)
-                    {
-                    TInt offset = 0;
-                    err = file->Seek(ESeekEnd, offset);
-                    break;
-                    }
-                }
-            
-            err = file->Replace(gFileSession, fileName, mode);
-            break;
-            }
-        default:
-            err = KErrArgument;
-        }
-
-    if(KErrNone != err)
-        {
-        file->Close();
-        delete file;
-        file = NULL;
-        }
-    return file;
-    }
-
-
-
-int fclose(FILE *aFp)
-    {
-    if(NULL != aFp)
-        {
-        aFp->Close();
-        delete aFp;
-        }
-    return KErrNone;
-    }
-
-int fprintf(FILE* aFile, const char* aFormatString, ...)
-    {
-    TUint length = User::StringLength((TUint8*)aFormatString) + 100;
-    HBufC8* buffer = HBufC8::New(length);
-    if(NULL == buffer)
-        {
-        return KErrNoMemory;
-        }
-    
-    TPtr8 targetPtr = buffer->Des();
-    TPtrC8 formatPtr((TUint8*)aFormatString);
-
-    VA_LIST list;
-    VA_START(list, aFormatString);
-    
-    targetPtr.FormatList(formatPtr, list);
-    targetPtr.ZeroTerminate();
-    
-    aFile->Write(targetPtr);
-    
-    delete buffer;
-
-    return targetPtr.Length();
-    }
-
-int fscanf(FILE* aFp, const char * aFormatString, ...)
-    {
-    TDataType type = EUnknownType;
-    TBool byteRead = EFalse;
-    
-    if(Mem::Compare((const unsigned char*)aFormatString, 2, (const unsigned char*)"%d", 2) == 0)
-        {
-        type = EInteger;
-        }
-    else if(Mem::Compare((const unsigned char*)aFormatString, 2, (const unsigned char*)"%f", 2) == 0)
-        {
-        type = EFloat;
-        }
-    else if(Mem::Compare((const unsigned char*)aFormatString, 3, (const unsigned char*)"%1d", 3) == 0)
-        {
-        type = EInteger;
-        byteRead = ETrue;
-        }
-    else
-        {
-        User::Panic(_L("NIST TestSuit Error"), KErrArgument);
-        }
-    
-    TInt initialOffset = 0;
-    aFp->Seek(ESeekCurrent, initialOffset);
-    TBuf8<KMaxReadSize + 1> readBuffer;
-    aFp->Read(readBuffer, KMaxReadSize);
-    readBuffer.ZeroTerminate();
-    TLex8 parser(readBuffer);
-    parser.SkipSpace();
-    
-    VA_LIST list;
-    VA_START(list, aFormatString);
-
-    switch(type)
-        {
-        case EInteger:
-            {
-            TInt* ptr = VA_ARG(list, TInt*);
-            TChar ch = parser.Peek();
-            
-            if(!ch.IsDigit())
-                {
-                break;
-                }
-            
-            if(byteRead)
-                {
-                ch = parser.Get();
-                *ptr = ch.GetNumericValue();
-                }
-            else
-                {
-                parser.Val(*ptr);
-                }
-
-            break;
-            }
-        case EFloat:
-            {
-            float* ptr = VA_ARG(list, float*);
-            parser.Val(*ptr);
-            break;
-            }
-        case EUnknownType:
-            {
-            User::Panic(_L("NIST TestSuit Error"), KErrArgument);
-            }
-        }
-
-    TInt len = initialOffset + parser.Offset();
-    aFp->Seek(ESeekStart, len);
-    
-    return 1;
-    }
-
-TUint32 fread(void* aPtr, TUint32 aSize, TUint32 aCount, FILE* aFile)
-    {
-    TUint32 size = aSize * aCount;
-    TPtr8 dataPtr((TUint8*)aPtr, size);
-    TInt err = aFile->Read(dataPtr);
-    if(KErrNone != err)
-        {
-        size = (TUint32)dataPtr.Length();
-        }
-    return size;
-    }
-
-int fseek(FILE* aFile, long aOffset, int aWhence)
-    {
-    int ret = KErrNone;
-    int fileOffset = aOffset;
-    switch(aWhence)
-        {
-        case SEEK_SET:
-            {
-            ret = aFile->Seek(ESeekStart, fileOffset);
-            break;
-            }
-        case SEEK_CUR:
-            {
-            ret = aFile->Seek(ESeekCurrent, fileOffset);
-            break;
-            }
-        case SEEK_END:
-            {
-            ret = aFile->Seek(ESeekEnd, fileOffset);
-            break;
-            }
-        default:
-            User::Panic(_L("NIST TestSuit Error"), KErrArgument);
-        }
-    
-    return ret;
-    }
-
-
-
-int fflush(FILE *aFile)
-    {
-    TInt err = aFile->Flush();
-    if(err != KErrNone)
-        {
-        err = EOF;
-        }
-    return err;
-    }
-
-
-// Conio functions
-void* calloc(TUint32 aElementCount, TUint32 aSize)
-    {
-    aSize *= aElementCount;
-    return User::AllocZ(aSize);
-    }
-
-void free(void *aMemory)
-    {
-    User::Free(aMemory);
-    }
-
-TBool IsCharacterKey(TKeyCode aKey)
-    {
-    if(aKey > EKeyEscape && aKey < EKeyDelete)
-        {
-        return ETrue;
-        }
-    
-    return EFalse;
-    }
-
-_LIT(KLineBreaker, "\r\n");
-
-void ReadStringFromConsole(TDes& aString)
-    {
-    // This infinte loop terminates when user hits an "enter" key
-    FOREVER
-        {
-        // Get a key(character) from the console
-        TKeyCode ch = gConsole->Getch();
-        
-        switch(ch)
-            {
-            case EKeyEnter:
-                {
-                if(aString.Length() == 0)
-                    {
-                    break;// At least one character should be read.
-                    }
-                gConsole->Printf(KLineBreaker);
-                return;
-                }
-            case EKeyBackspace:
-                {
-                if(0 != aString.Length())
-                    {
-                    // Back-space only takes the cursor one position back
-                    // So to delete a character blank-space is inserted at
-                    // that position and later cursor is again adjusted.
-                    gConsole->Printf(_L("%c%c%c"), EKeyBackspace, 
-                                                   EKeySpace, 
-                                                   EKeyBackspace);
-                    // Delete the character from the target string also. 
-                    aString.Delete(aString.Length() - 1, 1);
-                    }
-                break;
-                }
-            default:
-                {
-                TInt maxBufferLength = aString.MaxLength();
-                // IsCharacterKey will return true if ch is a displayable
-                // character else it will return false.
-                if(IsCharacterKey(ch) && aString.Length() != maxBufferLength)
-                    {
-                    gConsole->Printf(_L("%c"), ch);
-                    aString.Append(ch);
-                    }
-                }
-            }
-        }
-    }
-  
-TInt ReadIntL(TInt& aValue)
-    {
-    TBuf<KIntStringLen> string;
-    ReadStringFromConsole(string);
-    TLex lexObj(string);
-    return lexObj.Val(aValue);
-    }
-
-int PrintToScreen(const char* aString)
-    {
-    TUint length = User::StringLength((TUint8*)aString);
-    HBufC* buffer = HBufC::New(length);
-    if(NULL == buffer)
-        {
-        return EOF;
-        }
-    
-    TPtr targetPtr = buffer->Des();
-
-    TPtrC8 stringPtr((TUint8*)aString);
-
-    targetPtr.Copy(stringPtr);
-    gConsole->Printf(targetPtr);
-    
-    delete buffer;
-    
-    return KErrNone;
-    }
-
-void exit ( int status )
-    {
-    User::Exit(status);
-    for(;;){} // So that GCC compiler don't complain about noreturn function returns.
-    }
-
-//------------------------------------------  E  O  F -----------------------------------------------------
-
--- a/kerneltest/e32utils/nistsecurerng/src/utils/qsort.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,203 +0,0 @@
-/*
-* Copyright (c) 1997-2009 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"
-* 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:
-* Map ANSI bsearch and qsort onto EPOC32 functions 
-*/
-
-#include <e32std.h>
-#include "openc.h"
-
-NONSHARABLE_CLASS(TAnsiKey) : public TKey
-	{
-public:
-	TAnsiKey(const TAny* key, const TAny* base, TInt length, TInt (*compar)(const TAny*, const TAny*))
-		: iSearchKey(key), iCmp(compar)
-		{ SetPtr(base); iKeyLength=length; }
-
-	virtual TInt Compare(TInt aLeft,TInt aRight) const;
-	virtual TAny *At(TInt anIndex) const;
-private:
-	const TAny* iSearchKey;
-	TInt (*iCmp)(const TAny*, const TAny*);
-	};
-
-TInt TAnsiKey::Compare (TInt aLeft,TInt aRight) const
-	{
-	if (aRight==KIndexPtr)
-		return (*iCmp)(At(aLeft),iSearchKey);
-	else
-		return (*iCmp)(At(aLeft),At(aRight));
-	}
-
-TAny* TAnsiKey::At (TInt aPos) const
-	{
-	return (TUint8*)iPtr+(aPos*iKeyLength);
-	}
-
-NONSHARABLE_CLASS(TAnsiSwap) : public TSwap
-	{
-public:
-	TAnsiSwap(const TAny* base, TInt length) : iPtr(base), iLength(length) {}
-
-	virtual void Swap(TInt aLeft,TInt aRight) const;
-private:
-	TUint8* At(TInt aPos) const {return (TUint8*)iPtr+(aPos*iLength);}
-
-	const TAny* iPtr;
-	TInt  iLength;
-	};
-
-void TAnsiSwap::Swap(TInt aLeft,TInt aRight) const
-	{
-	TUint8* left=At(aLeft);
-	TUint8* right=At(aRight);
-	TUint8 tmp;
-
-	for (TInt i=iLength; i>0; i--)
-		{
-		tmp=*left;
-		*left++=*right;
-		*right++=tmp;
-		}
-	}
-
-/*
-FUNCTION
-<<bsearch>>---binary search
-
-INDEX
-	bsearch
-
-ANSI_SYNOPSIS
-	#include <stdlib.h>
-	void *bsearch(const void *<[key]>, const void *<[base]>,
-		size_t <[nmemb]>, size_t <[size]>,
-		int (*<[compar]>)(const void *, const void *));
-
-TRAD_SYNOPSIS
-	#include <stdlib.h>
-	char *bsearch(<[key]>, <[base]>, <[nmemb]>, <[size]>, <[compar]>)
-	char *<[key]>;
-	char *<[base]>;
-	size_t <[nmemb]>, <[size]>;
-	int (*<[compar]>)();
-
-DESCRIPTION
-<<bsearch>> searches an array beginning at <[base]> for any element
-that matches <[key]>, using binary search.  <[nmemb]> is the element
-count of the array; <[size]> is the size of each element.
-
-The array must be sorted in ascending order with respect to the
-comparison function <[compar]> (which you supply as the last argument of
-<<bsearch>>).
-
-You must define the comparison function <<(*<[compar]>)>> to have two
-arguments; its result must be negative if the first argument is
-less than the second, zero if the two arguments match, and
-positive if the first argument is greater than the second (where
-``less than'' and ``greater than'' refer to whatever arbitrary
-ordering is appropriate).
-
-RETURNS
-Returns a pointer to an element of <[array]> that matches <[key]>.  If
-more than one matching element is available, the result may point to
-any of them. Returns NULL if no matching element is found.
-
-PORTABILITY
-<<bsearch>> is ANSI.
-
-No supporting OS subroutines are required.
-*/
-
-/**
-searches an array beginning at <[base]> for any element
-that matches <[key]>, using binary search
-@return a pointer to an element of <[array]> that matches <[key]>.  If
-more than one matching element is available, the result may point to
-any of them. Returns NULL if no matching element is found.
-@param key
-@param base
-@param nmemb
-@param size
-*/
-void* bsearch (const void* key, const void* base, TUint32 nmemb, TUint32 size,
-	int (*compar)(const void*, const void*))
-	{
-	TAnsiKey searchMe(key, base, size, compar);
-	TInt result=KIndexPtr;
-	TInt r=User::BinarySearch(nmemb, searchMe, result);
-	if (r==0)
-		return searchMe.At(result);
-	else
-		return NULL;
-	}
-
-/*
-FUNCTION
-<<qsort>>---sort an array
-
-INDEX
-	qsort
-
-ANSI_SYNOPSIS
-	#include <stdlib.h>
-	void qsort(void *<[base]>, size_t <[nmemb]>, size_t <[size]>,
-		   int (*<[compar]>)(const void *, const void *) );
-
-TRAD_SYNOPSIS
-	#include <stdlib.h>
-	qsort(<[base]>, <[nmemb]>, <[size]>, <[compar]> )
-	char *<[base]>;
-	size_t <[nmemb]>;
-	size_t <[size]>;
-	int (*<[compar]>)();
-
-DESCRIPTION
-<<qsort>> sorts an array (beginning at <[base]>) of <[nmemb]> objects.
-<[size]> describes the size of each element of the array.
-
-You must supply a pointer to a comparison function, using the argument
-shown as <[compar]>.  (This permits sorting objects of unknown
-properties.)  Define the comparison function to accept two arguments,
-each a pointer to an element of the array starting at <[base]>.  The
-result of <<(*<[compar]>)>> must be negative if the first argument is
-less than the second, zero if the two arguments match, and positive if
-the first argument is greater than the second (where ``less than'' and
-``greater than'' refer to whatever arbitrary ordering is appropriate).
-
-The array is sorted in place; that is, when <<qsort>> returns, the
-array elements beginning at <[base]> have been reordered.
-
-RETURNS
-<<qsort>> does not return a result.
-
-PORTABILITY
-<<qsort>> is required by ANSI (without specifying the sorting algorithm).
-*/
-
-/**
-Sort an array.
-@param base 
-@param nmemb
-@param size describes the size of each element of the array
-*/
-void qsort (void* base, TUint32 nmemb, TUint32 size,
-	int (*compar)(const void*, const void*))
-	{
-	TAnsiKey  searchMe(NULL, base, size, compar);
-	TAnsiSwap swapUs(base,size);
-	User::QuickSort(nmemb, searchMe, swapUs);
-	return;
-	}
-
Binary file kerneltest/e32utils/nistsecurerng/testdata/testdata.zip has changed
--- a/kerneltest/e32utils/trace/btrace_analyse.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/e32utils/trace/btrace_analyse.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -433,7 +433,6 @@
 		CASE_CAT_NAME(EProfiling);
 		CASE_CAT_NAME(ESymbianKernelSync);
 		CASE_CAT_NAME(EFlexibleMemModel);
-		CASE_CAT_NAME(EHSched);
 		CASE_CAT_NAME(ETest1);
 		CASE_CAT_NAME(ETest2);
 		default:
@@ -630,12 +629,6 @@
 			}
 		break;
 
-	case BTrace::EHSched:
-		switch((BTrace::THSched)aSubCategory)
-			{
-		CASE_CAT_NAME(ELbDone);
-			}
-		break;
 		}
 	return UnknownNames[aSubCategory];
 	}
@@ -1397,7 +1390,7 @@
 		{
 	case BTrace::ENanoThreadCreate:
 		CHECK_TRACE_DATA_WORDS(1);
-		Thread::FindOrCreate(aTrace,0);
+		thread = Thread::FindOrCreate(aTrace,0);
 		break;
 
 	case BTrace::ENanoThreadDestroy:
@@ -1437,7 +1430,7 @@
 		CHECK_TRACE_DATA_WORDS(2);
 		if(aTrace.iData[0])
 			{
-			Thread::FindOrCreate(aTrace,0);
+			thread = Thread::FindOrCreate(aTrace,0);
 			process = Process::Find(aTrace.iData[1]);
 			if(!process || (process->iNameLength && !process->IsName(aTrace.iData+2,aTrace.iDataSize-2*4)))
 				{
@@ -1457,13 +1450,13 @@
 	case BTrace::EThreadId:
 		CHECK_TRACE_DATA_WORDS(2);
 		thread = Thread::FindOrCreate(aTrace,0);
-		Process::FindOrCreate(aTrace,1);
+		process = Process::FindOrCreate(aTrace,1);
 		thread->iId = aTrace.iData[2];
 		break;
 
 	case BTrace::EProcessCreate:
 		CHECK_TRACE_DATA_WORDS(1);
-		Process::FindOrCreate(aTrace,0);
+		process = Process::FindOrCreate(aTrace,0);
 		break;
 
 	case BTrace::EProcessDestroy:
@@ -1894,7 +1887,7 @@
 
 	case BTrace::ECodeSegMapped:
 		CHECK_TRACE_DATA_WORDS(2);
-		CodeSeg::FindOrCreate(aTrace,0);
+		codeseg = CodeSeg::FindOrCreate(aTrace,0);
 		Process::FindOrCreate(aTrace,1);
 		break;
 
@@ -2542,22 +2535,6 @@
 	printf("\n");
 	}
 
-
-void PreProcessHSched(TraceRecord& aTrace)
-	{
-	switch((BTrace::THSched)aTrace.iSubCategory)
-		{
-		case BTrace::ELbDone:
-			{
-			CHECK_TRACE_DATA_WORDS(2);
-			Thread::Find(aTrace, 0);
-			break;
-			}
-		}
-	}
-
-
-
 //
 // Trace processing
 //
@@ -2747,8 +2724,6 @@
 		PreProcessProfiling(aTrace); break;
 	case BTrace::ESymbianKernelSync:
 		PreProcessSymbianKernelSync(aTrace); break;
-	case BTrace::EHSched:
-		PreProcessHSched(aTrace); break;
 	default:
 		break;
 		}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32utils/trace/btracevw.pl	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,1952 @@
+#
+# 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:
+#
+
+#!/usr/bin/perl
+
+use File::Find;
+use File::Spec::Functions;
+
+
+	my $TraceFileName;
+	
+	my $PrintFlagFilePos = 0;
+	my $PrintFlagHdrLen = 0;
+	my $PrintFlagHdrFlags = 0;
+	my $PrintFlagFormatString = 0;
+	my $VerboseMode = 0;
+	my $RawMode = 0;
+	my $FormatIdIsSubCategory = 0;
+	my $OutputSawDictionaryMode = 0;
+	
+	# for the category range 0-191, the format string is indexed by the category & subcategory
+	%FormatTables = 
+		(
+		0 => 			# ERDebugPrintf
+			{
+			0 => "ThreadId %h, %s",
+			},
+	
+		1 => 			# ERKernPrintf
+			{
+			0 => "ThreadId %h, %s",
+			},
+
+		3 =>			# EThreadIdentification
+			{	
+			0 => "ENanoThreadCreate, NThread %x",
+			1 => "ENanoThreadDestroy, NThread %x",
+			2 => "EThreadCreate, NThread %x, DProcess %x, name %s",
+			3 => "EThreadDestroy, NThread %x, DProcess %x, Id %x",
+			4 => "EThreadName, NThread %x, DProcess %x, name %s",
+			5 => "EProcessName, NThread %x, DProcess %x, name %s",
+			6 => "EThreadId, NThread %x, DProcess %x, Id %x",
+			7 => "EProcessCreate, DProcess %x",
+			8 => "EProcessDestroy, DProcess %x",
+			},
+		);
+
+	my @typedefs;
+	my @members;
+	my %values	= (
+#		UTF::KInitialClientFormat		=>	{type=>"TFormatId", size=>2, value=>512}
+		KMaxTUint8						=> {type=>"TUint8", size=>1, value=>255},
+		KMaxTUint16						=> {type=>"TUint16", size=>2, value=>65535}
+	);
+	my %macros;
+	my @classes;
+	my @enums;
+	my %formatStrings;		# each enum may have it's own format string
+	my %formatCategories;	# each enum may have it's own format category
+	
+	my %filescope;
+	$filescope{file}=1;
+	undef $filescope{name};	
+
+	$filescope{typedefs}=\@typedefs;
+	$filescope{members}=\@members;
+	$filescope{values}=\%values;
+	$filescope{macros} = \%macros;
+	$filescope{FormatTables} = \%FormatTables;
+	
+	$filescope{classes} = \@classes;
+	$filescope{enums} = \@enums;
+
+	$filescope{formatStrings} =\%formatStrings;
+	$filescope{formatCategories} = \%formatCategories;
+	
+		
+		
+	if (@ARGV == 0)
+  		{
+  		print "BTraceVw.pl \n";
+  		print "An unsupported utility which extracts UTrace-style format-strings\n";
+  		print "from header files & uses these to decode a BTrace output file\n";
+  		print "Syntax : BTraceVw.pl [-v] [-r] [-sd] [-i <IncFilePath>] [<BTrace file>]\n";
+  		print "where  : -v  = verbose mode\n";
+  		print "       : -r  = raw output mode\n";
+  		print "       : -sd = produce SAW trace viewer dictionary file\n";
+  		print "       :       this file then needs to be merged into the 'com.symbian.analysis.trace.ui.prefs' file\n";
+  		print "       :       located under the carbide workspace directory\n";
+		print "\n";
+  		
+		print "e.g. (this decodes a trace file & produces a comma-separated output file) : \n";
+		print "btracevw.pl -i /os/kernelhwsrv/userlibandfileserver/fileserver/inc/f32tracedef.h -i /os/kernelhwsrv/userlibandfileserver/fileserver/inc/utraceefsrv.h -i /os/kernelhwsrv/userlibandfileserver/fileserver/inc/utraceefile.h trace.utf >trace.csv\n";
+		print "\n";
+		print "e.g. (this overwrites the SAW dictioany file) : \n";
+		print "btracevw.pl -sd -i /os/kernelhwsrv/userlibandfileserver/fileserver/inc/f32tracedef.h -i /os/kernelhwsrv/userlibandfileserver/fileserver/inc/utraceefsrv.h -i /os/kernelhwsrv/userlibandfileserver/fileserver/inc/utraceefile.h >com.symbian.analysis.trace.ui.prefs\n";
+  		
+		exit;
+		}
+
+	while (@ARGV > 0)
+		{
+		
+		if ($ARGV[0] eq "-i")
+	        {
+	        shift @ARGV;
+		    ($FilePath) = @ARGV;
+	        shift @ARGV;
+
+	        undef @incFiles;
+		    @incFiles;
+		
+		    find sub { push @incFiles, $File::Find::name if m/\.h$/i;}, $FilePath ;
+		    foreach $incFile (@incFiles)
+		        {
+				H2Trace($incFile, \%filescope);
+		        }
+	        }
+		elsif ($ARGV[0] eq "-r")
+	        {
+		    $RawMode = 1;
+   	        shift @ARGV;
+	        }
+		elsif ($ARGV[0] eq "-sd")
+	        {
+		    $OutputSawDictionaryMode = 1;
+   	        shift @ARGV;
+	        }
+		elsif ($ARGV[0] eq "-v")
+	        {
+		    $VerboseMode = 1;
+   	        shift @ARGV;
+	        }
+	    else
+	    	{
+			$TraceFileName = "$ARGV[0]";
+	        shift @ARGV;
+	    	}
+        }
+		
+	if ($VerboseMode)
+		{
+		dump_scope(\%filescope);
+		PrintFormatTables(\%FormatTables);
+		}
+	if ($OutputSawDictionaryMode)
+		{
+		OutputSawDictionary(\%FormatTables);
+		}
+
+    if (defined ($TraceFileName))
+        {
+        ReadTraceFile($RawMode);
+        }
+
+        
+        
+        
+sub ReadTraceFile($)
+    {
+	(my $RawMode) = @_;
+#	print "Trace file is $TraceFileName, RawMode $RawMode, VerboseMode $VerboseMode\n\n";
+
+	open (LOGFILE, "<$TraceFileName") or die "Can't open $TraceFileName: $!\n";
+	binmode (LOGFILE);
+
+	my $val = 0;
+
+
+	# enum TFlags from e32btrace.h
+	$EHeader2Present	= 1<<0;
+	$ETimestampPresent	= 1<<1;
+	$ETimestamp2Present	= 1<<2;
+	$EContextIdPresent	= 1<<3;
+	$EPcPresent			= 1<<4;
+	$EExtraPresent		= 1<<5;
+	$ERecordTruncated	= 1<<6;
+	$EMissingRecord		= 1<<7;
+	
+	# enum TFlags2 from e32btrace.h
+	$EMultipartFlagMask	= 3<<0;
+	$ECpuIdMask			= 0xfff<<20;
+
+	# enum TMultiPart from e32btrace.h
+	$EMultipartFirst	= 1;
+	$EMultipartMiddle	= 2;
+	$EMultipartLast		= 3;
+	
+	$EMaxBTraceDataArray = 80;
+	
+	# enum TCategory from e32btrace.h
+	$EThreadIdentification = 3;
+	
+	# enum TThreadIdentification from e32btrace.h
+	$EThreadCreate = 2;
+	$EThreadName = 4;
+	$EProcessName = 5;
+	$EThreadId = 6;
+	
+	# Context Id bits from e32btrace.h
+	$EContextIdMask = 0x00000003;
+	$EContextIdThread = 0;
+	$EContextIdFIQ = 0x1;
+	$EContextIdIRQ = 0x2;
+	$EContextIdIDFC = 0x3;
+
+	# enum TClassificationRange from e32btraceu.h
+	$EAllRangeFirst = 192;
+	$EAllRangeLast = 222;
+
+	%TCategoryIdToString = 
+		(
+		0 => "ERDebugPrintf",
+		1 => "EKernPrintf",
+		2 => "EPlatsecPrintf",
+		3 => "EThreadIdentification",
+		4 => "ECpuUsage",
+        5 => "EKernPerfLog",
+        6 => "EClientServer",
+        7 => "ERequests",
+        8 => "EChunks",
+        9 => "ECodeSegs",
+		10 => "EPaging",
+		11 => "EThreadPriority",
+		12 => "EPagingMedia",
+		13 => "EKernelMemory",
+		14 => "EHeap",
+		15 => "EMetaTrace",
+		16 => "ERamAllocator",
+		17 => "EFastMutex",
+		18 => "EProfiling", 
+        19 => "EResourceManager",
+        20 => "EResourceManagerUs",
+		21 => "ERawEvent ",
+		128 => "EPlatformSpecificFirst",
+		191 => "EPlatformSpecificLast",
+		192 => "ESymbianExtentionsFirst",
+
+		# UTrace "ALL" range 
+		192 => "EPanic",
+		193 => "EError",
+		194 => "EWarning", 
+		195 => "EBorder", 
+		196 => "EState", 
+		197 => "EInternals", 
+		198 => "EDump", 
+		199 => "EFlow", 
+		200 => "ESystemCharacteristicMetrics", 
+		201 => "EAdhoc",
+
+		253 => "ESymbianExtentionsLast",
+		254 => "ETest1",
+		255 => "ETest2",
+		);
+
+
+	%ProcessNames;
+	%ThreadNames;
+	%ThreadIds;
+	
+	
+	# print column titles
+	if ($PrintFlagFilePos) {printf "FilePos, ";}	# col #0
+	if ($PrintFlagHdrLen) {	printf "Len, ";}		# col #1
+	if ($PrintFlagHdrFlags) {printf "Flags, "; }	# col #2
+	printf "Category, ";			# col #3
+	printf "TimeStamp, ";			# col #4
+	printf "Delta, ";				# col #5
+	printf "context Id, ";			# col #6
+	printf "PC, ";					# col #7
+	printf "UID, ";					# col #8
+	if ($PrintFlagFormatString){printf "Format string, ";}	# col #9
+	printf "Formatted text, ";		# col #10
+	print "\n\n";
+
+	
+	while (1)
+		{
+		my $pos = tell (LOGFILE);
+		
+		# print file pos (col #0)
+		if ($PrintFlagFilePos){	printf ("0x%08X, ", $pos);}
+		
+		my $category;
+		my $subCategory;
+		my $multipartFlags = 0;
+		my $recordData = "";
+		my $recordLen;
+		my $recordPos = 0;
+		
+		$recordLen = ReadRecord(LOGFILE, \$pos, \$recordData, \$category, \$subCategory, \$multipartFlags, $RawMode);
+		if ($recordLen == -1)
+			{last;}
+
+			
+		if (!$RawMode && ($multipartFlags == $EMultipartMiddle || $multipartFlags == $EMultipartLast))
+			{next;}
+					
+#		print record contents
+#		my $buf;
+#					for (my $i=0; $i < $recordLen; $i+=4)
+#						{
+#		$buf.= sprintf ("%08X ", unpack("V", substr($recordData, $recordPos+$i, 4)));
+#						}
+#		printf "\n[$buf\n]";				
+
+
+		# for UTrace "ALL" range, read UID 
+		if ($category >= $EAllRangeFirst && $category <= $EAllRangeLast && 
+			(!$RawMode) && $multipartFlags != $EMultipartMiddle && $multipartFlags != $EMultipartLast)
+			{
+			$uid = unpack("V", substr($recordData, $recordPos, 4));
+			$recordPos+= 4;	
+
+			# then read formatID			
+			$FormatIdIsSubCategory = ($subCategory != 0) ? 1 : 0;
+			if ($FormatIdIsSubCategory)
+				{
+				$formatId = $subCategory
+				}
+			else				
+				{
+				$formatId = unpack("V", substr($recordData, $recordPos, 4));
+  				$recordPos+= 4;
+				}
+			}
+		
+					
+		# print UID (col #8)
+		printf "0x%08X, ", $uid;
+
+			
+		my $formatTable;
+		my $formatString;
+		if ($category >= $EAllRangeFirst && $category <= $EAllRangeLast)
+			{
+			$formatString = $FormatTables{$uid}{$formatId};
+			}
+		else
+			{
+			$formatString = $FormatTables{$category}{$subCategory};
+			}
+
+
+		# Get thread names
+		if ($category == $EThreadIdentification)
+			{
+			if ($subCategory == $EProcessName)
+				{
+				my $process = unpack("V", substr($recordData, 4, 4));
+				my $processName = substr($recordData, 8, $recordLen - 8);	
+#				printf ("\nprocess [%08X] processName [$processName]\n", $process);
+				$ProcessNames{$process} = $processName;
+				}
+			elsif ($subCategory == $EThreadCreate || $subCategory == $EThreadName)
+				{
+				my $thread = unpack("V", substr($recordData, 0, 4));
+				my $process = unpack("V", substr($recordData, 4, 4));
+				my $threadName = substr($recordData, 8, $recordLen - 8);	
+#				printf ("\nprocess [%08X] thread [%08X] threadName [$threadName]\n", $process, $thread, $threadName);
+				$ThreadNames{$thread} = $ProcessNames{$process} . "::" . $threadName;
+				}
+			elsif ($subCategory == $EThreadId)
+				{
+				my $thread = unpack("V", substr($recordData, 0, 4));
+				my $process = unpack("V", substr($recordData, 4, 4));
+				my $threadId = unpack("V", substr($recordData, 8, 4));
+#				printf ("\nprocess [%08X] thread [%08X] threadId [%08X]\n", $process, $thread, $threadId);
+				$ThreadIds{$thread} = $threadId;
+				}
+			}
+			
+			
+		# print Format string (col #9)
+		if ($PrintFlagFormatString)
+			{
+			my $formatStringWithoutCommas = $formatString;
+			$formatStringWithoutCommas=~ s/,/ /g;
+			printf "%s, ", $formatStringWithoutCommas;
+			}
+
+		my $formattedText;
+		
+		my $lenFormatString = length($formatString);
+		if ($lenFormatString && !$RawMode && $multipartFlags != $EMultipartMiddle && $multipartFlags != $EMultipartLast)
+			{
+			for (my $i=0; $i<$lenFormatString; $i++)
+				{
+				my $c = (substr ($formatString, $i, 1));
+#				printf "$c\n";
+				if ($c eq "%")
+					{
+					undef my $fieldLen;
+					$i++;
+	        		$c = (substr ($formatString, $i, 1));
+					if ($c eq "%")
+						{
+						$formattedText.= substr ($formatString, $i, 1);
+						next;
+						}
+					if ($c eq "*")	## take length from buffer
+						{
+						$fieldLen = unpack("V", substr($recordData, $recordPos, 4));
+						if ($fieldLen > $recordLen-$recordPos)
+							{
+							$formattedText.= "*** Invalid field length ***";
+							last;
+							}
+						$recordPos+= 4;
+						$i++;
+		        		$c = (substr ($formatString, $i, 1));
+						}
+					if (lc $c eq "x" || $c eq "h")
+						{
+						if (defined $fieldLen)
+							{
+							if (($fieldLen & 3) == 0)
+								{
+								for (my $i=0; $i< $fieldLen; $i+= 4)
+									{
+									$formattedText.= sprintf ("%08X ", unpack("V", substr($recordData, $recordPos, 4)));
+									$recordPos+= 4;
+									}
+								}
+							else
+								{
+								for (my $i=0; $i< $fieldLen; $i++)
+									{
+									$formattedText.= sprintf ("%02X ", unpack("C", substr($recordData, $recordPos, 1)));
+									$recordPos++;
+									}
+								}
+							}
+						else
+							{
+							$formattedText.= sprintf ("0x%08X", unpack("V", substr($recordData, $recordPos, 4)));
+							$recordPos+= 4;
+							}
+						$recordPos = ($recordPos + 3) & ~3;
+						next;
+						}
+					# display "%ld" as hex for now as don't know how to get perl to use or display a 64 decimal value
+					elsif (lc $c eq "l" && substr ($formatString, $i+1, 1) eq "d")
+						{
+						$i++;
+						my $loWord = unpack("V", substr($recordData, $recordPos, 4));
+						$recordPos+= 4;
+						my $hiWord = unpack("V", substr($recordData, $recordPos, 4));
+						$recordPos+= 4;
+						$formattedText.= sprintf ("0x%X:%08X", $hiWord, $loWord);
+						}
+					elsif (lc $c eq "l" && substr ($formatString, $i+1, 1) eq "x")
+						{
+						$i++;
+						my $loWord = unpack("V", substr($recordData, $recordPos, 4));
+						$recordPos+= 4;
+						my $hiWord = unpack("V", substr($recordData, $recordPos, 4));
+						$recordPos+= 4;
+						$formattedText.= sprintf ("0x%X:%08X", $hiWord, $loWord);
+						}
+					elsif (lc $c eq "d")
+						{
+						$formattedText.= sprintf ("%d", unpack("V", substr($recordData, $recordPos, 4)));
+						$recordPos+= 4;
+						$recordPos = ($recordPos + 3) & ~3;
+						next;
+						}
+					elsif ($c eq "s")
+						{
+						if (!defined $fieldLen) 
+							{$fieldLen = $recordLen - $recordPos;}
+						$formattedText.= substr($recordData, $recordPos, $fieldLen);
+						$recordPos+= $fieldLen; 
+						$recordPos = ($recordPos + 3) & ~3;
+						next;
+						}
+					elsif ($c eq "S")
+						{
+						if (!defined $fieldLen) 
+							{$fieldLen = $recordLen-$recordPos;}
+						for (my $j=0; $j < $fieldLen; $j+=2)
+							{
+					        my $byte = unpack("c", substr ($recordData, $recordPos+$j, 1));
+ 							$formattedText.= sprintf ("%c", $byte);
+							}
+						$recordPos+= $fieldLen; 
+						$recordPos = ($recordPos + 3) & ~3;
+						next;
+						}
+					elsif ($c eq "c")
+						{
+				        my $byte = unpack("c", substr ($recordData, $recordPos, 1));
+						$formattedText.= sprintf ("%c", $byte);
+						}
+					}
+				else
+					{
+					$formattedText.= $c;
+					}
+				}
+			}
+		else	# no format string : print as hex
+			{
+			for (my $i=0; $i < $recordLen; $i+=4)
+				{
+				$formattedText.= sprintf ("%08X ", unpack("V", substr($recordData, $i, 4)));
+				}
+			$recordPos+= $recordLen; $recordLen = 0;
+			
+			}
+		
+
+		# print Formatted text (col #10)
+		$formattedText=~ s/,/;/g;
+		$formattedText=~ s/\r//g;
+		$formattedText=~ s/\n/,/g;
+		printf "%s", $formattedText;
+
+		printf("\n");
+
+		if ($len < 0 || $recordLen < 0)	{die "truncated file";}
+  
+
+		$pos+= ($len +3) & ~3;
+		seek (LOGFILE, $pos, SEEK_SET) or die "truncated file";
+		$i++;
+		}
+
+	close (LOGFILE);
+
+	if ($VerboseMode)
+		{
+		print "*** Processes ***\n";
+		for $id ( keys %ProcessNames )
+			{
+			printf ("process %08X ProcessName %s\n", $id, $ProcessNames{$id});
+			}
+		print "*** Thread ***\n";
+		for $id ( keys %ThreadNames )
+			{
+			printf ("thread %08X ThreadName %s::%X\n", $id, $ThreadNames{$id}, $ThreadIds{$id});
+			}
+		}
+
+    }
+
+    
+sub ReadSingleRecord
+	{
+	($fh, $data, $dataLen, $recordLen, $category, $subCategory, $multipartFlags, $extraN, $totalLen, $offset, $RawMode) = @_;	
+	
+	my $hdr;
+	my $flags;
+	my $header2;
+	my $timestamp;
+	my $timestamp2;
+	my $contextId;
+	my $programConter;	
+	
+	my $recordOffset = 0;
+	
+	$timestampLast;	
+	my $timestampDelta = 0;	
+	
+	my $bytesRead = read($fh, $hdr, 4);
+	
+	
+	if ($bytesRead < 4)	
+		{return -1;}
+
+	($$recordLen,$flags,$$category,$$subCategory) = unpack("CCCC", $hdr);
+	$$dataLen = $$recordLen-4;
+	
+	if ($flags & $EHeader2Present)
+		{$$multipartFlags = (ReadDword($fh) & $EMultipartFlagMask); $$dataLen-= 4}
+	else
+		{$$multipartFlags = 0;}
+	if ($flags & $ETimestampPresent)
+		{$timestamp = ReadDword($fh); $$dataLen-= 4;}
+	if ($flags & $ETimestamp2Present)
+		{$timestamp2 = ReadDword($fh); $$dataLen-= 4;}
+	if ($flags & $EContextIdPresent)
+		{$contextId = ReadDword($fh); $$dataLen-= 4;}
+	if ($flags & $EPcPresent)
+		{$programConter = ReadDword($fh); $$dataLen-= 4;}
+	if ($flags & $EExtraPresent)
+		{$$extraN = ReadDword($fh); $$dataLen-= 4;}
+	if ($$multipartFlags != 0)
+		{
+		$$totalLen = ReadDword($fh);  $$dataLen-= 4;
+		if ($$multipartFlags == $EMultipartMiddle || $$multipartFlags == $EMultipartLast)
+			{$$offset = ReadDword($fh);  $$totalLen-= 4; $$dataLen-= 4;}
+		}				
+
+	$timestampDelta = $timestamp - $timestampLast;
+	$timestampLast = $timestamp;
+
+	read($fh, $$data, ($$dataLen + 3) & ~3);
+
+
+	if ($RawMode || $$multipartFlags == $EMultipartFirst || $$multipartFlags == 0)
+		{
+		# print header len (col #1)
+		if ($PrintFlagHdrLen){printf ("0x%02X, ", $$recordLen);}
+	
+		# print header flags (col #2)
+		if ($PrintFlagHdrFlags)
+			{
+			printf ("%02X ", $flags);
+			if ($flags & $EHeader2Present) {printf "EHeader2Present ";}
+			if ($flags & $ETimestampPresent) {printf "ETimestampPresent ";}
+			if ($flags & $ETimestamp2Present) {printf "ETimestamp2Present ";}
+			if ($flags & $EContextIdPresent) {printf "EContextIdPresent ";}
+			if ($flags & $EPcPresent) {printf "EPcPresent ";}
+			if ($$multipartFlags != 0)
+				{
+				printf "EExtraPresent ";
+				if ($$multipartFlags == $EMultipartFirst) {print "EMultipartFirst ";}
+				elsif ($$multipartFlags == $EMultipartMiddle) {print "EMultipartMiddle ";}
+				elsif ($$multipartFlags == $EMultipartLast) {print "EMultipartLast ";}
+				printf ("ExtraN(0x%08X) ", $$extraN);
+				}
+			if ($flags & $ERecordTruncated) {printf "ERecordTruncated ";}
+			if ($flags & $EMissingRecord) {printf "EMissingRecord ";}
+			print ",";
+			}
+				
+		# print category (col #3)
+		printf "(%d;%d) $categoryString  , ", $$category, $$subCategory;
+	
+		# print timestamp(s) (col #4)
+		printf "0x";
+		if (defined $timestamp2) {printf "%08X : ", $timestamp2;}
+		printf "%08X", $timestamp;
+		printf ", ";;
+	
+		# print timestamp delta (col #5)
+		printf "0x%08X, ", $timestampDelta;
+
+		# print context Id (col #6)
+		if (!$RawMode && defined $ThreadNames{$contextId})
+			{
+			printf ("%s::%X, ", $ThreadNames{$contextId}, $ThreadIds{$contextId});
+			}
+		else			
+			{
+			if ((($contextId & $EContextIdMask) == $EContextIdThread) || $RawMode)
+				{printf "0x%08X, ", $contextId;}
+			elsif (($contextId & $EContextIdMask) == $EContextIdFIQ)
+				{printf "FIQ, ";}
+			elsif (($contextId & $EContextIdMask) == $EContextIdIRQ)
+				{printf "IRQ, ";}
+			elsif (($contextId & $EContextIdMask) == $EContextIdIDFC)
+				{printf "IDFC, ";}
+			}
+	
+		# print Program Counter (col #7)
+		printf "0x%08X, ", $programConter;
+		}
+
+		
+	
+	
+#########################################################
+#	my $hex;
+#	for (my $i=0; $i < $$dataLen; $i+=4)
+#		{
+#		$hex.= sprintf ("%08X ", unpack("V", substr($$data, $i, 4)));
+#		}
+#	printf "\nadding [$hex]\n";
+#########################################################
+	return $bytesRead
+	}
+
+	      
+sub ReadRecord 
+	{
+	($fh, $recordPos, $recordData, $category, $subCategory, $multipartFlags, $RawMode) = @_;
+#	printf "CurrentPos %08X\n", $pos;
+
+
+
+	seek ($fh, $$recordPos, SEEK_SET) or die "truncated file";
+	my $recordLen;
+	my $extraN;
+	my $totalLen;
+	my $offset;
+	my $dataLen;
+	my $data;
+	my $bytesRead;
+	
+	
+	$bytesRead = ReadSingleRecord($fh,  \$data, \$dataLen, \$recordLen, \$$category, \$$subCategory, \$$multipartFlags, \$extraN, \$totalLen, \$offset, $RawMode);
+
+	if ($bytesRead == -1)	# eof ?
+		{return -1; }
+	$$recordPos+= ($recordLen +3) & ~3;
+	
+	$$recordData = $data;
+    $offset = $dataLen;
+
+	$offset-= 4;		# subtract 4 bytes for UID ?????????
+    
+    if ($RawMode || $$multipartFlags != $EMultipartFirst)
+    	{return $dataLen;}
+
+    $pos = $$recordPos;
+
+	while (1)
+		{
+		
+		# find next record, i.e. look for a record which matches $extraN 
+		
+		seek ($fh, $pos, SEEK_SET) or die "truncated file";
+
+		my $recordLen;
+		
+		my $category;
+		my $subCategory;
+		my $multipartFlags;
+		my $currentExtraN;
+		my $currentOffset;
+		
+		my $totalLen;
+		my $currentDataLen;
+		my $data;
+		$bytesRead = ReadSingleRecord($fh, \$data, \$currentDataLen, \$recordLen, \$category, \$subCategory, \$multipartFlags, \$currentExtraN, \$totalLen, \$currentOffset, $RawMode);
+		if ($bytesRead == -1)	# eof ?
+			{return -1; }
+		$pos+= ($recordLen +3) & ~3;
+		
+#		printf "\npos %08X, Seaching for (extra %08X, offset %08X), found (extra %08X, offset %08X)\n",
+#			$pos, $extraN, $offset, $currentExtraN, $currentOffset;
+
+		if ($currentExtraN == $extraN && $currentOffset == $offset)
+			{
+			$$recordData.= $data;
+			$offset+= $currentDataLen;
+			$dataLen+= $currentDataLen;
+			}
+			
+		if ($multipartFlags == $EMultipartLast)
+			{last;}
+		}
+	
+	return $dataLen;
+	}	
+
+sub ReadDword {
+	(my $fh) = @_;
+	my $buffer;
+
+	$bytesRead = read($fh, $buffer, 4);
+	if ($bytesRead < 4) 	{die "truncated file";}
+
+	my $dword = unpack("V", $buffer);
+
+	return $dword
+	};
+
+sub ReadByte {
+	(my $fh) = @_;
+	my $buffer;
+
+	$bytesRead = read($fh, $buffer, 1);
+	if ($bytesRead < 1) 	{die "truncated file";}
+
+	my $byte = unpack("C", $buffer);
+
+	return $byte
+	};
+
+    
+	
+sub PrintFormatTables($)
+	{
+	my ($formatTables) = @_;
+		
+	for $tableIndex ( sort keys %$formatTables )
+		{
+		printf ("SYMTraceFormatCategory %08X:\n", $tableIndex);
+		for $formatId (sort keys %{ $$formatTables{$tableIndex} } )
+			{
+			printf ("%08X => %s\n", $formatId, $$formatTables{$tableIndex}{$formatId});
+			}
+			print "\n";
+		}
+	}
+        
+
+
+sub OutputSawDictionary($)
+	{
+	my ($formatTables) = @_;
+
+
+	# SAW enums
+	$EFieldTypeHexDump = 0;
+	$EFieldTypeHex = 1;
+	$EFieldTypeDecimal = 2;
+	$EFieldTypeStringToEnd = 3;
+	$EFieldTypeNullTerminatedString = 4;
+	$EFieldTypeHexDumpToEnd = 5;
+	$EFieldTypeUnicodeToEnd = 6;
+	$EFieldTypeNullTerminatedUnicode = 7;
+	$EFieldTypeCountedUnicode = 8;
+	$EFieldTypeCountedHexDump = 9;
+	$EFieldTypeCountedString = 10;
+
+	my $moduleIds;	# string containg all UIDs separared by semi-colons
+		
+	for $tableIndex ( sort keys %$formatTables )
+		{
+		if ($tableIndex < 256)
+			{
+			next;
+			}
+		$moduleIds.= sprintf ("%08X;", $tableIndex);
+		
+		printf ("MODULEID_%08X_DESC=\n", $tableIndex);
+		printf ("MODULEID_%08X_NAME=%08X\n", $tableIndex, $tableIndex);
+		
+		my $formatIds;
+		$formatIds = sprintf ("MODULEID_%08X_FORMATIDS=", $tableIndex);
+		
+		for $formatId  (sort keys %{ $$formatTables{$tableIndex} } )
+			{
+			$formatIds.= sprintf ("%d;", $formatId);
+			}
+		printf ("$formatIds\n");
+		
+		
+		for $formatId (sort keys %{ $$formatTables{$tableIndex} } )
+			{
+			my $fieldCount = 0;
+			my $formatString = $$formatTables{$tableIndex}{$formatId};
+			
+#printf ("formatString = (%s)\n", $formatString);
+
+			# format name is the first format string up until the first space or '%' character or end-of line ...
+			$formatString=~ m/^[^%\s]*/;
+			my $formatName = $&;
+			
+			# thow the format name away
+			$formatString = $';
+			
+			# strip the leading space
+			$formatString=~ s/\s*//;
+
+			printf ("MODULEID_%08X_FORMATID_%d_NAME=%s\n", $tableIndex, $formatId, $formatName);
+#printf ("MODULEID_%08X_FORMATID_%d_DESC=\n", $tableIndex, $formatId);
+
+			my $lenFormatString = length($formatString);
+			
+			my $formattedText;
+			my $fieldType = $EFieldTypeHex;
+			my $fieldLen = 0;
+			while (length($formatString))
+				{
+				my $c = (substr ($formatString, 0, 1));
+#print ("[$formatString][$c]\n");				
+				$formatString=~ s/.//;	# strip the leading space
+				if ($c eq "%")
+					{
+#print "found %\n";							
+					my $fieldLenSpecified = 0;
+	        		$c = (substr ($formatString, 0, 1));
+					$formatString=~ s/.//;	# discard char
+#print "c2=$c\n";							
+					if ($c eq "%")
+						{
+						$formattedText.= substr ($formatString, 0, 1);
+						next;
+						}
+					if ($c eq "*")	## take length from buffer
+						{
+						$fieldLenSpecified = 1;
+		        		$c = (substr ($formatString, 0, 1));
+						$formatString=~ s/.//;	# discard char
+						}
+					if (lc $c eq "x" || $c eq "h")
+						{
+						## deal wilth $fieldLenSpecified
+						if ($fieldLenSpecified)
+							{
+							$fieldType = $EFieldTypeCountedHexDump;
+							$fieldLen = 0;
+							}
+						else
+							{
+							$fieldType = $EFieldTypeHex;
+							$fieldLen = 4;
+							}
+						}
+					elsif (lc $c eq "l" && substr ($formatString, 0, 1) eq "d")
+						{
+						$formatString=~ s/.//;	# discard char
+						$fieldType = $EFieldTypeDecimal;
+						$fieldLen = 8;
+						}
+					elsif (lc $c eq "l" && substr ($formatString, 0, 1) eq "x")
+						{
+						$formatString=~ s/.//;	# discard char
+						$fieldType = $EFieldTypeHex;
+						$fieldLen = 8;
+						}
+					elsif (lc $c eq "d")
+						{
+						$fieldType = $EFieldTypeDecimal;
+						$fieldLen = 4;
+						}
+					elsif ($c eq "s")
+						{
+						## deal wilth $fieldLenSpecified
+						if ($fieldLenSpecified)
+							{
+							$fieldType = $EFieldTypeCountedString;
+							$fieldLen = 0;
+							}
+						else
+							{
+							$fieldType = $EFieldTypeStringToEnd;
+							$fieldLen = 0;
+							}
+						}
+					elsif ($c eq "S")
+						{
+						## deal wilth $fieldLenSpecified
+						if ($fieldLenSpecified)
+							{
+							$fieldType = $EFieldTypeCountedUnicode;
+							$fieldLen = 0;
+							}
+						else
+							{
+							$fieldType = EFieldTypeUnicodeToEnd;
+							$fieldLen = 0;
+							}
+						}
+					elsif ($c eq "c")
+						{
+						$fieldType = $EFieldTypeHex;
+						$fieldLen = 1;
+						}
+					printf ("MODULEID_%08X_FORMATID_%d_FIELD_%d_NAME=%s\n", $tableIndex, $formatId, $fieldCount, $formattedText);
+					printf ("MODULEID_%08X_FORMATID_%d_FIELD_%d_TYPE=%s\n", $tableIndex, $formatId, $fieldCount, $fieldType);
+					if ($fieldLen > 0)
+						{printf ("MODULEID_%08X_FORMATID_%d_FIELD_%d_LENGTH=%s\n", $tableIndex, $formatId, $fieldCount, $fieldLen);}
+					$fieldCount++;
+					$formattedText="";
+					
+					$formatString=~ s/\s//;	# strip the leading space
+					}
+				else
+					{
+#					if ($c eq ":") {$formattedText.= '\\'; }
+					$formattedText.= $c;
+					}
+				}
+			printf ("MODULEID_%08X_FORMATID_%d_FIELDS=%d\n", $tableIndex, $formatId, $fieldCount);
+			
+			}
+		print "MODULEIDS=$moduleIds\n";
+		}
+	}
+	
+	
+	
+	
+	
+	
+	        
+        
+sub H2Trace($$)
+{
+	%basictypes = (
+		TInt8		=>	1,
+		TUint8		=>	1,
+		TInt16		=>	2,
+		TUint16		=>	2,
+		TInt32		=>	4,
+		TUint32		=>	4,
+		TInt		=>	4,
+		TUint		=>	4,
+		TBool		=>	4,
+		TInt64		=>	8,
+		TUint64		=>	8,
+		TLinAddr	=>	4,
+		TVersion	=>	4,
+		TPde		=>	4,
+		TPte		=>	4,
+		TProcessPriority => 4,
+		TFormatId	=>  2,
+	);
+	
+	if (scalar(@_)!= 2) {
+		die "perl h2trace.pl <input.h>\n";
+	}
+	my ($infile, $filescope) = @_;
+	
+	if ($VerboseMode)
+		{print "\nOpening $infile\n";}
+	
+	open IN, $infile or die "Can't open $infile for input\n";
+	my $in;
+	while (<IN>) {
+		$in.=$_;
+	}
+	close IN;
+	
+	# First remove any backslash-newline combinations
+	$in =~ s/\\\n//gms;
+	
+	# Remove any character constants
+	$in =~  s/\'(.?(${0})*?)\'//gms;
+	
+	# Strip comments beginning with //
+	$in =~ s/\/\/(.*?)\n/\n/gms;    #//(.*?)\n
+	
+	# Strip comments (/* */) but leave doxygen comments (/** */)
+	$in =~ s/\/\*[^*](.*?)\*\//\n/gms;  #/*(.*?)*/
+	
+	
+	# Collapse whitespace into a single space or newline
+	$in =~ s/\t/\ /gms;
+	$in =~ s/\r/\ /gms;
+	
+	# Tokenize on non-identifier characters
+	my @tokens0 = split(/(\W)/,$in);
+	my @tokens;
+	my $inString = 0;
+	my $inComment = 0;
+	my $string;
+	foreach $t (@tokens0) {
+		next if ($t eq "");
+		next if (!$inString && ($t eq " " or $t eq ""));
+		if ($inComment == 0) 
+			{
+			if ($t eq "/")
+				{$inComment = 1;}
+			}
+		elsif ($inComment == 1) 
+			{
+			if ($t eq "*")
+				{$inComment = 2;}
+			else
+				{$inComment = 0;}
+			}
+		elsif ($inComment == 2) 
+			{
+			if ($t eq "*")
+				{$inComment = 3;}
+			}
+		elsif ($inComment == 3) 
+			{
+			if ($t eq "/")
+				{
+				$inComment = 0;
+		        # if we were in a string, need to push previous '*'
+		        if ($inString)
+		          {
+		          push @tokens, "*";
+		          }
+				$inString = 0;	# end of comment aborts a string
+				$string = "";
+				}
+			else
+				{$inComment = 2;}
+			}
+			
+		if ($t eq "\"")
+			{
+			if (!$inString) 
+				{
+				$inString=1;
+				next;
+				}
+			else
+				{
+				$inString=0;
+				$t = $string;
+				$string = "";
+#				if ($VerboseMode) {print "string : [$t]\n";	}
+				}
+			}
+			
+		if ($inString)
+			{
+			$string.= $t;
+			next;
+			}
+		push @tokens, $t;
+	}
+	
+	my $CurrentTraceFormatString;
+	my $CurrentTraceFormatCategory;
+	# format Key as specified by the @TraceFormatCategory tag is either the current category 
+	# or the current UID
+	my $CurrentFormatTableKey;	
+	
+	
+	my $line=1;
+	parse_scope($filescope, \@tokens, \$line);
+
+	#print $in;
+	#print join (" ", @tokens);
+}	# end of     H2Trace
+	
+
+
+	sub parse_scope($$$) {
+		my ($scope, $tokens, $line) = @_;
+		my $state = 1;
+		
+		my @classes;
+		my $curr_offset=0;
+		my $overall_align=0;
+#		print ">parse_scope $scope->{name}\n";
+		
+		while (scalar(@$tokens))
+			{
+			my $t = shift @$tokens;
+#			printf "t: [$t] [$$line]\n";
+	    	if (!defined ($t)) {
+	      		printf "undefined !";
+	      		next;
+	      	}
+			if ($state>=-1 and $t eq "\n") {
+				++$$line;
+				$state=1;
+				next;
+			} elsif ($state==-1 and $t ne "\n") {
+				next;
+			} elsif ($state==-2 and $t ne ';') {
+				next;
+			}
+			
+			if ($state>0 and $t eq '#') {
+				$t = shift @$tokens;
+				if ($t eq 'define') {
+					my $ident = shift @$tokens;
+					my $defn = shift @$tokens;
+					if ($defn ne '(') {	# don't do macros with parameters
+#					print "MACRO: $ident :== $defn\n";
+					$macros{$ident} = $defn;
+					}
+				}
+				$state=-1;	# skip to next line
+				next;
+			}
+			
+			
+			if (parse_doxygen($scope,$tokens, $line, $t) == 1)
+				{next;}
+	
+			if ($t eq "namespace" ) {
+				$state=0;
+				my %cl;
+				$cl{specifier}=$t;
+				$cl{scope}=$scope;
+				$cl{values}=$scope->{values};
+				$cl{members}=\$scope->{members};
+				$cl{typedefs}=\$scope->{typedefs};
+				$cl{FormatTables}=$scope->{FormatTables};
+				$cl{formatStrings} =$scope->{formatStrings};
+				$cl{formatCategories} =$scope->{formatCategories};
+				
+				my $new_namespace = \%cl;
+				my $n = get_token($scope,$tokens,$line);
+				if ($n !~ /\w+/) {
+					warn "Unnamed $t not supported at line $$line\n";
+					return;
+				}
+				$new_namespace->{name}=$n;
+				my @class_match = grep {$_->{name} eq $n} @classes;
+				my $exists = scalar(@class_match);
+				my $b = get_token($scope,$tokens,$line);
+				if ($b eq ':') {
+					die "Inheritance not supported at line $$line\n";
+				} elsif ($b eq ';') {
+					# forward declaration
+					push @classes, $new_namespace unless ($exists);
+					next;
+				} elsif ($b ne '{') {
+					warn "Syntax error#1 at line $$line\n";
+					return;
+				}
+				if ($exists) {
+					$new_namespace = $class_match[0];
+					if ($new_namespace->{complete}) {
+						warn "Duplicate definition of $cl{specifier} $n\n";
+					}
+				}
+				push @classes, $new_namespace unless ($exists);
+				parse_scope($new_namespace, $tokens, $line);
+				next;
+			}
+			
+			if ($t eq "struct" or $t eq "class" or $t eq "NONSHARABLE_CLASS") {
+				next if ($state==0);
+				$state=0;
+				my %cl;
+				$cl{specifier}=$t;
+				$cl{scope}=$scope;
+				my @members;
+				my @typedefs;
+				$cl{members}=\@members;
+				$cl{typedefs}=\@typedefs;
+				$cl{FormatTables}=$scope->{FormatTables};
+				my $new_class = \%cl;
+				my $n;
+
+				if ($t eq "NONSHARABLE_CLASS")
+					{
+					my $b = get_token($scope,$tokens,$line);
+					if ($b !~ /\(/) {die "Syntax error at line $$line\n";}
+					$n = get_token($scope,$tokens,$line);
+  				$b = get_token($scope,$tokens,$line);
+					if ($b !~ /\)/) {die "Syntax error at line $$line\n";}
+					}
+				else					
+					{
+					$n = get_token($scope,$tokens,$line);
+					}
+								
+				
+				if ($n !~ /\w+/) {
+					warn "Unnamed $t not supported at line $$line\n";
+					return;
+				}
+				$new_class->{name}=$n;
+				my @class_match = grep {$_->{name} eq $n} @classes;
+				my $exists = scalar(@class_match);
+				my $b = get_token($scope,$tokens,$line);
+				#skip inheritance etc until we get to a '{' or \ ';'
+				while ($b ne '{' && $b ne ';')
+					{
+			        $b = get_token($scope,$tokens,$line);
+			        die "Syntax error#2 at line $$line\n" if  (!defined $b);
+					}
+				if ($b eq ';') {
+					# forward declaration
+					push @classes, $new_class unless ($exists);
+					next;
+				} 
+				if ($exists) {
+					$new_class = $class_match[0];
+					if ($new_class->{complete}) {
+						warn "Duplicate definition of $cl{specifier} $n\n";
+					}
+				}
+				push @classes, $new_class unless ($exists);
+				parse_scope($new_class, $tokens, $line);
+				next;
+			} elsif ($t eq "enum") {
+				$state=0;
+				my $n = get_token($scope,$tokens,$line);
+				my $name="";
+				if ($n =~ /\w+/) {
+					$name = $n;
+					$n = get_token($scope,$tokens,$line);
+				}
+				push @enums, $name;
+				if ($n ne '{') {
+					die "Syntax error#4 at line $$line\n";
+				}
+				parse_enum($scope, $tokens, $line, $name);
+				next;
+			} elsif ($t eq '}') {
+				$state=0;
+				if ($scope->{scope}) {
+			        if ($scope->{specifier} eq "namespace")
+			        	{
+						$scope->{complete}=1;
+#						print "Scope completed\n";
+						last;
+						}
+					$t = get_token($scope,$tokens,$line);
+					# skip to next ';'
+					while (defined ($t) and $t ne ';')
+						{$t = get_token($scope,$tokens,$line);}
+					die "Syntax error#5 at line $$line\n" if ($t ne ';');
+					$scope->{complete}=1;
+#					print "Scope completed\n";
+					last;
+				}
+				warn "Syntax error#5 at line $$line\n";
+				return;
+			}
+			$state=0;
+			if ($scope->{scope}) {
+				if ($t eq "public" or $t eq "private" or $t eq "protected") {
+					if (shift (@$tokens) eq ':') {
+						next;	# ignore access specifiers
+					}
+				die "Syntax error#6 at line $$line\n";
+				}
+			}
+			unshift @$tokens, $t;
+			
+			my @currdecl = parse_decl_def($scope, $tokens, $line);
+#			print scalar (@currdecl), "\n";
+			if ($t eq 'static') {
+				next;	# skip static members
+			}
+			my $typedef;
+			if ($t eq 'typedef') {
+#			print "TYPEDEF\n";
+				$typedef = 1;
+				$t = shift @currdecl;
+				$t = $currdecl[0];
+			} else {
+#			print "NOT TYPEDEF\n";
+				$typedef = 0;
+			}
+#			print "$currdecl[0]\n";
+			next if (scalar(@currdecl)==0);
+			
+			if ($t eq "const") {
+				# check for constant declaration
+#				print "CONST $currdecl[1] $currdecl[2] $currdecl[3]\n";
+				my $ctype = lookup_type($scope, $currdecl[1]);
+#				print "$ctype->{basic}    $ctype->{size}\n";
+				if ($ctype->{basic} and $currdecl[2]=~/^\w+$/ and $currdecl[3] eq '=') {
+					if ($typedef!=0) {
+						die "Syntax error#7 at line $$line\n";
+					}
+					shift @currdecl;
+					shift @currdecl;
+					my $type = $ctype->{name};
+					my $name;		#### = shift @currdecl;
+
+					if ($scope->{name})
+						{	
+						$name = $scope->{name} . "::" . shift @currdecl;
+						}
+					else
+						{
+						$name = shift @currdecl;
+						}
+#					printf "[$name,$scope->{name}]";
+					my $size = $ctype->{size};
+					shift @currdecl;
+					my $value = get_constant_expr($scope,\@currdecl,$line);
+					$values{$name} = {type=>$type, size=>$size, value=>$value};
+					next;
+				}
+			}
+			
+			
+			
+		}
+	}
+	
+	sub get_token($$$) {
+		my ($scope,$tokenlist,$line) = @_;
+		while (scalar(@$tokenlist)) {
+			my $t = shift @$tokenlist;
+			return $t if (!defined($t));
+			if (parse_doxygen($scope,$tokenlist, $line, $t) == 1)
+				{next;}
+			if ($t !~ /^[\s]*$/)
+				{
+				if ($$tokenlist[0] eq ":" and $$tokenlist[1] eq ":")
+					{
+					$t.= shift @$tokenlist;
+					$t.= shift @$tokenlist;
+					$t.= shift @$tokenlist;
+#					print "Colon-separated token";
+					}
+				return $t
+				}
+			++$$line;
+		}
+  		return undef;
+	}
+	
+	sub skip_qualifiers($) {
+		my ($tokens) = @_;
+		my $f=0;
+		my %quals = (
+			EXPORT_C => 1,
+			IMPORT_C => 1,
+			inline => 1,
+			virtual => 0,
+			const => 0,
+			volatile => 0,
+			static => 0,
+			extern => 0,
+			LOCAL_C => 0,
+			LOCAL_D => 0,
+			GLDEF_C => 0,
+			GLREF_C => 0,
+			GLDEF_D => 0,
+			GLREF_D => 0
+			);
+		for (;;) {
+			my $t = $$tokens[0];
+			my $q = $quals{$t};
+			last unless (defined ($q));
+			$f |= $q;
+			shift @$tokens;
+		}
+		return $f;
+	}
+	
+	sub parse_indirection($) {
+		my ($tokens) = @_;
+		my $level = 0;
+		for (;;) {
+			my $t = $$tokens[0];
+			if ($t eq '*') {
+				++$level;
+				shift @$tokens;
+				next;
+			}
+			last if ($t ne "const" and $t ne "volatile");
+			shift @$tokens;
+		}
+		return $level;
+	}
+	
+	sub get_operand($$$) {
+		my ($scope,$tokens,$line) = @_;
+		my $t = get_token($scope,$tokens,$line);
+		if ($t eq '-') {
+			my $x = get_operand($scope,$tokens,$line);
+			return -$x;
+		} elsif ($t eq '+') {
+			my $x = get_operand($scope,$tokens,$line);
+			return $x;
+		} elsif ($t eq '~') {
+			my $x = get_operand($scope,$tokens,$line);
+			return ~$x;
+		} elsif ($t eq '!') {
+			my $x = get_operand($scope,$tokens,$line);
+			return $x ? 0 : 1;
+		} elsif ($t eq '(') {
+			my $x = get_constant_expr($scope,$tokens,$line);
+			my $t = get_token($scope,$tokens,$line);
+			if ($t ne ')') {
+				warn "Missing ) at line $$line\n";
+				return undefined;
+			}
+			return $x;
+		} elsif ($t eq "sizeof") {
+			my $ident = get_token($scope,$tokens,$line);
+			if ($ident eq '(') {
+				$ident = get_token($scope,$tokens,$line);
+				my $cb = get_token($scope,$tokens,$line);
+				if ($cb ne ')') {
+					warn "Bad sizeof() syntax at line $$line\n";
+					return undefined;
+				}
+			}
+			$ident = look_through_macros($ident);
+			if ($ident !~ /^\w+$/) {
+				warn "Bad sizeof() syntax at line $$line\n";
+				return undefined;
+			}
+			my $type = lookup_type($scope, $ident);
+			if (!defined $type) {
+				warn "Unrecognised type $ident at line $$line\n";
+				return undefined;
+			}
+			if ($type->{basic}) {
+				return $type->{size};
+			} elsif ($type->{enum}) {
+				return 4;
+			} elsif ($type->{ptr}) {
+				return 4;
+			} elsif ($type->{fptr}) {
+				return 4;
+			}
+			my $al = $type->{class}->{align};
+			my $sz = $type->{class}->{size};
+			return ($sz+$al-1)&~($al-1);
+		}
+		$t = look_through_macros($t);
+		if ($t =~ /^0x/i) {
+			return oct($t);
+		} elsif ($t =~ /^\d/) {
+			return $t;
+		} elsif ($t =~ /^\w+$/) {
+			my $x = lookup_value($scope,$t);
+#			die "Unrecognised identifier '$t' at line $$line\n" unless defined($x);
+			if (!defined($x)) {
+				print "Unrecognised identifier '$t' at line $$line\n" ;
+			}
+			return $x;
+		} elsif ($t =~ /^\w+::\w+$/) {
+			my $x = lookup_value($scope,$t);
+#			die "Unrecognised identifier '$t' at line $$line\n" unless defined($x);
+			if (!defined($x)) {
+				print "Unrecognised identifier '$t' at line $$line\n" ;
+			}
+			return $x;
+		} else {
+			warn "Syntax error#10 at line $$line\n";
+			return undefined;
+		}
+	}
+	
+	sub look_through_macros($) {
+		my ($ident) = @_;
+		while ($ident and $macros{$ident}) {
+			$ident = $macros{$ident};
+		}
+		return $ident;
+	}
+	
+	sub lookup_value($$) {
+		my ($scope,$ident) = @_;
+		while ($scope) {
+			my $vl = $scope->{values};
+			if (defined($vl->{$ident})) {
+				return $vl->{$ident}->{value};
+			}
+			$scope = $scope->{scope};
+		}
+		return undef();
+	}
+	
+	sub lookup_type($$) {
+		my ($scope,$ident) = @_;
+		if ($basictypes{$ident}) {
+			return {scope=>$scope, basic=>1, name=>$ident, size=>$basictypes{$ident} };
+		}
+		while ($scope) {
+			if ($basictypes{$ident}) {
+				return {scope=>$scope, basic=>1, name=>$ident, size=>$basictypes{$ident} };
+			}
+			my $el = $scope->{enums};
+			my $cl = $scope->{classes};
+			my $td = $scope->{typedefs};
+			if (grep {$_ eq $ident} @$el) {
+				return {scope=>$scope, enum=>1, name=>$ident, size=>4 };
+			}
+			my @match_class = (grep {$_->{name} eq $ident} @$cl);
+			if (scalar(@match_class)) {
+				return {scope=>$scope, class=>$match_class[0]};
+			}
+			my @match_td = (grep {$_->{name} eq $ident} @$td);
+			if (scalar(@match_td)) {
+				my $tdr = $match_td[0];
+				my $cat = $tdr->{category};
+				if ($cat eq 'basic' or $cat eq 'enum' or $cat eq 'class') {
+					$ident = $tdr->{alias};
+					next;
+				} else {
+					return { scope=>$scope, $cat=>1, $size=>$tdr->{size} };
+				}
+			}
+			$scope = $scope->{scope};
+		}
+		return undef();
+	}
+	
+	sub get_mult_expr($$$) {
+		my ($scope,$tokens,$line) = @_;
+		my $x = get_operand($scope,$tokens,$line);
+		my $t;
+		for (;;) {
+			$t = get_token($scope,$tokens,$line);
+			if ($t eq '*') {
+				my $y = get_operand($scope,$tokens,$line);
+				$x = $x * $y;
+			} elsif ($t eq '/') {
+				my $y = get_operand($scope,$tokens,$line);
+				if ($y != 0)
+					{$x = int($x / $y);}
+			} elsif ($t eq '%') {
+				my $y = get_operand($scope,$tokens,$line);
+				if ($y != 0)
+					{$x = int($x % $y);}
+			} else {
+				last;
+			}
+		}
+		unshift @$tokens, $t;
+		return $x;
+	}
+	
+	sub get_add_expr($$$) {
+		my ($scope,$tokens,$line) = @_;
+		my $x = get_mult_expr($scope,$tokens,$line);
+		my $t;
+		for (;;) {
+			$t = get_token($scope,$tokens,$line);
+			if ($t eq '+') {
+				my $y = get_mult_expr($scope,$tokens,$line);
+				$x = $x + $y;
+			} elsif ($t eq '-') {
+				my $y = get_mult_expr($scope,$tokens,$line);
+				$x = $x - $y;
+			} else {
+				last;
+			}
+		}
+		unshift @$tokens, $t;
+		return $x;
+	}
+	
+	sub get_shift_expr($$$) {
+		my ($scope,$tokens,$line) = @_;
+		my $x = get_add_expr($scope,$tokens,$line);
+		my $t, $t2;
+		for (;;) {
+			$t = get_token($scope,$tokens,$line);
+			if ($t eq '<' or $t eq '>') {
+				$t2 = get_token($scope,$tokens,$line);
+				if ($t2 ne $t) {
+					unshift @$tokens, $t2;
+					last;
+				}
+			}
+			if ($t eq '<') {
+				my $y = get_add_expr($scope,$tokens,$line);
+				$x = $x << $y;
+			} elsif ($t eq '>') {
+				my $y = get_add_expr($scope,$tokens,$line);
+				$x = $x >> $y;
+			} else {
+				last;
+			}
+		}
+		unshift @$tokens, $t;
+		return $x;
+	}
+	
+	sub get_and_expr($$$) {
+		my ($scope,$tokens,$line) = @_;
+		my $x = get_shift_expr($scope,$tokens,$line);
+		my $t;
+		for (;;) {
+			$t = get_token($scope,$tokens,$line);
+			if ($t eq '&') {
+				my $y = get_shift_expr($scope,$tokens,$line);
+				$x = $x & $y;
+			} else {
+				last;
+			}
+		}
+		unshift @$tokens, $t;
+		return $x;
+	}
+	
+	sub get_xor_expr($$$) {
+		my ($scope,$tokens,$line) = @_;
+		my $x = get_and_expr($scope,$tokens,$line);
+		my $t;
+		for (;;) {
+			$t = get_token($scope,$tokens,$line);
+			if ($t eq '^') {
+				my $y = get_and_expr($scope,$tokens,$line);
+				$x = $x ^ $y;
+			} else {
+				last;
+			}
+		}
+		unshift @$tokens, $t;
+		return $x;
+	}
+	
+	sub get_ior_expr($$$) {
+		my ($scope,$tokens,$line) = @_;
+		my $x = get_xor_expr($scope,$tokens,$line);
+		my $t;
+		for (;;) {
+			$t = get_token($scope,$tokens,$line);
+			if ($t eq '|') {
+				my $y = get_xor_expr($scope,$tokens,$line);
+				$x = $x | $y;
+			} else {
+				last;
+			}
+		}
+		unshift @$tokens, $t;
+		return $x;
+	}
+	
+	sub get_constant_expr($$$) {
+		my ($scope,$tokens,$line) = @_;
+		my $x = get_ior_expr($scope,$tokens,$line);
+		return $x;
+	}
+	
+	sub parse_enum($$$$) {
+		my ($scope,$tokens,$line,$enum_name) = @_;
+		my $vl = $scope->{values};
+		my $fstr = $scope->{formatStrings};
+		my $fcat = $scope->{formatCategories};
+		my $fmtTable = $scope->{FormatTables};
+		
+		my $x = 0;
+		for (;;) {
+			my $t = get_token($scope,$tokens,$line);
+			last if ($t eq '}');
+			if (!defined($t)) {
+				die "Unexpected end of file #2 at line $$line\n";
+			}
+			
+			if ($t eq '#') {
+				next;
+				}
+			
+			if ($t !~ /^\w+$/) {
+				warn "Syntax error#11 at line $$line\n";
+				next;
+			}
+
+			if ($scope->{name})
+				{	
+				$t = $scope->{name} . "::" . $t;
+				}
+
+			if (defined($vl->{$t})) {
+				warn "Duplicate identifier [$t] at line $$line\n";
+			}
+			my $t2 = get_token($scope,$tokens,$line);
+			if ($t2 eq ',') {
+				$vl->{$t} = {type=>$enum_name, size=>4, value=>$x, enum=>1};
+				$fstr->{$t} = $CurrentTraceFormatString; 
+				$fcat->{$t} = $CurrentTraceFormatCategory; 
+				if (defined $CurrentTraceFormatCategory && defined $CurrentTraceFormatString)
+					{ $fmtTable->{$CurrentTraceFormatCategory}{$x} = $CurrentTraceFormatString; }
+				undef $CurrentTraceFormatString;
+				++$x;
+			} elsif ($t2 eq '}') {
+				$vl->{$t} = {type=>$enum_name, size=>4, value=>$x, enum=>1};
+				$fstr->{$t} = $CurrentTraceFormatString; 
+				$fcat->{$t} = $CurrentTraceFormatCategory; 
+				if (defined $CurrentTraceFormatCategory && defined $CurrentTraceFormatString)
+					{ $fmtTable->{$CurrentTraceFormatCategory}{$x} = $CurrentTraceFormatString; }
+				undef $CurrentTraceFormatString;
+				++$x;
+				last;
+			} elsif ($t2 eq '=') {
+				$x = get_constant_expr($scope, $tokens, $line);
+				$vl->{$t} = {type=>$enum_name, size=>4, value=>$x, enum=>1};
+				$fstr->{$t} = $CurrentTraceFormatString; 
+				$fcat->{$t} = $CurrentTraceFormatCategory;
+				if (defined $CurrentTraceFormatCategory && defined $CurrentTraceFormatString)
+					{ $fmtTable->{$CurrentTraceFormatCategory}{$x} = $CurrentTraceFormatString; }
+				undef $CurrentTraceFormatString; 
+				++$x;
+				$t2 = get_token($scope,$tokens,$line);
+				last if ($t2 eq '}');
+				next if ($t2 eq ',');
+				warn "Syntax error#12 at line $$line\n";
+			} else {
+				unshift @$tokens, $t2;
+			}
+		}
+		my $t = get_token($scope,$tokens,$line);
+		if ($t ne ';') {
+			warn "Missing ; at line $$line\n";
+		}
+	}
+	
+	
+	sub  parse_decl_def($$$) {
+		my ($scope,$tokens,$line) = @_;
+		my $level=0;
+		my @decl;
+		while ( scalar(@$tokens) ) {
+			my $t = get_token($scope,$tokens, $line);
+			if ( (!defined ($t) || $t eq ';') and ($level==0)) {
+				return @decl;
+			}
+	
+			if ($t eq "static")
+				{
+				next;
+				}
+	
+			push @decl, $t;
+			if ($t eq '{') {
+				++$level;
+			}
+			if ($t eq '}') {
+				if ($level==0) {
+					warn "Syntax error#13 at line $$line\n";
+					unshift @$tokens, $t;
+					return @decl;
+					
+				}
+				if (--$level==0) {
+					return ();	# end of function definition reached
+				}
+			}
+		}
+		die "Unexpected end of file #3 at line $$line\n";
+	}
+	
+	sub dump_scope($) {
+		my ($scope) = @_;
+		my $el = $scope->{enums};
+		my $cl = $scope->{classes};
+		my $vl = $scope->{values};
+		my $fstr = $scope->{formatStrings};
+		my $fcat = $scope->{formatCategories};
+		print "SCOPE: $scope->{name}\n";
+		if (scalar(@$el)) {
+			print "\tenums:\n";
+			foreach (@$el) {
+				print "\t\t$_\n";
+			}
+		}
+		if (scalar(keys(%$vl))) {
+			print "\tvalues:\n";
+			foreach $vname (keys(%$vl)) {
+				my $v = $vl->{$vname};
+				my $x = $v->{value};
+				my $t = $v->{type};
+				my $sz = $v->{size};
+				my $fstring = $fstr->{$vname};
+				my $fcategory = $fcat->{$vname};
+				if ($v->{enum}) {
+					printf ("\t\t$vname\=$x (enum $t) size=$sz fcat=[0x%x] fstr=[%s]\n", $fcategory,$fstring);
+				} else {
+					printf ("\t\t$vname\=$x (type $t) size=$sz fcat=[0x%x] fstr=[%s]\n", $fcategory, $fstring);
+				}
+			}
+		}
+		if ($scope->{scope}) {
+			my $members = $scope->{members};
+			foreach (@$members) {
+				my $n = $_->{name};
+				my $sz = $_->{size};
+				my $off = $_->{offset};
+				my $spc = $_->{spacing};
+				if (defined $spc) {
+					print "\t$n\[\]\: spacing $spc size $sz offset $off\n";
+				} else {
+					print "\t$n\: size $sz offset $off\n";
+				}
+			}
+			print "\tOverall size : $scope->{size}\n";
+			print "\tOverall align: $scope->{align}\n";
+		}
+		foreach $s (@$cl) {
+			dump_scope($s);
+		}
+	}
+	
+	
+	
+		
+	sub parse_doxygen($$$$) {
+		my ($scope,$tokens,$line,$t) = @_;
+	
+		if ($t ne "/")
+			{
+			return 0;	# not a doxygen comment
+			}
+		if ($t eq "/") {
+			$state=0;
+			my $t2 = shift @$tokens;
+			my $t3 = shift @$tokens;
+	
+			if ($t2 ne "*" || $t3 ne "*")
+				{
+				unshift @$tokens, $t3;
+				unshift @$tokens, $t2;
+				return 0;	# not a doxygen comment
+				}
+		}
+#		printf "doxygen start on line %d\n", $$line;
+		for (;;) {
+			my $t = shift @$tokens;
+			if (!defined($t)) 
+					{
+					warn "Unexpected end of file #4 at line $$line\n";	
+					return
+					}
+			
+			if ($t eq "\n"){++$$line };
+			
+			if ($t eq '*')
+				{
+				my $t2 = shift @$tokens;
+				last if ($t2 eq '/');
+				unshift @$tokens, $t2;
+				}
+			
+			if ($t eq '@')
+				{
+				my $t2 = shift @$tokens;
+				if ($t2 eq 'SYMTraceFormatString')
+					{
+					my $t3 = shift @$tokens;
+#					if ($VerboseMode){print "SYMTraceFormatString = [$t3]\n";}
+					$CurrentTraceFormatString = $t3;
+					}
+				if ($t2 eq 'SYMTraceFormatCategory')
+					{
+					$CurrentTraceFormatCategory = get_operand($scope,$tokens,$line);
+#					if ($VerboseMode){printf ("SYMTraceFormatCategory = 0x%x\n", $CurrentTraceFormatCategory);}
+					}
+				else
+					{
+					unshift @$tokens, $t2;
+					}
+				}
+	
+		}
+#		printf ("doxygen end  on line %d\n", $$line);
+		return 1;	# is a doxygen comment
+	}
+	
+
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+                
--- a/kerneltest/f32test/bench/t_fcachebm.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/bench/t_fcachebm.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -68,6 +68,7 @@
 TBuf16<25> gFileA;
 TBuf16<25> gFileB;
 TBuf16<25> gStreamFile;
+TInt64 gMediaSize;
 
 HBufC8* gBuf = NULL;
 TPtr8 gBufReadPtr(NULL, 0);	
@@ -1455,6 +1456,8 @@
 	r = TheFs.Volume(volInfo, drive);
 	FailIfError(r);
 	
+	gMediaSize = volInfo.iSize;
+	
 	FormatFat(gSessionPath[0]-'A');
 	TheFs.MkDirAll(gSessionPath);
 
--- a/kerneltest/f32test/bench/t_fsysbm.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/bench/t_fsysbm.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -31,69 +31,63 @@
 //#define SYMBIAN_TEST_COPY					// read from one drive and write to another
 
 
-RTest test(_L("File System Benchmarks"));
+GLDEF_D RTest test(_L("File System Benchmarks"));
 
 static const TUint K1K = 1024;								// 1K
 static const TUint K1M = 1024 * 1024;						// 1M
 static const TUint K2M = 2 * K1M;						    // 2M
 
 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
-const TInt64 KGb  	= 1 << 30;								// 1GB
-const TInt64 K3GB   = 3 * KGb;								// 3GB
-const TInt64 K4GB   = 4 * KGb;								// 4GB
+const TInt64 KGb  	= 1 << 30;
+const TInt64 K3GB   = 3 * KGb;
+const TInt64 K4GB   = 4 * KGb;
 #endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
 
 #if defined(__WINS__)
-static TInt KMaxFileSize = 256 * K1K;					// 256K
-//static TInt KMaxFileSize = K1M;						// 1M
+LOCAL_D TInt KMaxFileSize = 256 * K1K;						// 256K
+//LOCAL_D TInt KMaxFileSize = K1M;							// 1M
 #else
-//static TInt KMaxFileSize = 256 * K1K;					// 256K
-//static TInt KMaxFileSize = K1M;						// 1M
-static TInt KMaxFileSize = K2M;							// 2M
+//LOCAL_D TInt KMaxFileSize = 256 * K1K;					// 256K
+//LOCAL_D TInt KMaxFileSize = K1M;							// 1M
+LOCAL_D TInt KMaxFileSize = K2M;							// 2M
 #endif
 
 const TTimeIntervalMicroSeconds32 KFloatingPointTestTime = 10000000;	// 10 seconds
-static const TInt KHeapSize = 0x4000;
+LOCAL_D const TInt KHeapSize = 0x4000;
 
-static TPtr8 DataBuf(NULL, KMaxFileSize,KMaxFileSize);
-static HBufC8* DataBufH = NULL;
+LOCAL_D TPtr8 DataBuf(NULL, KMaxFileSize,KMaxFileSize);
+LOCAL_D HBufC8* DataBufH = NULL;
 
-static RSharedChunkLdd Ldd;
-static RChunk TheChunk;
-static TInt PageSize;
+LOCAL_D RSharedChunkLdd Ldd;
+LOCAL_D RChunk TheChunk;
+LOCAL_D TInt PageSize;
 const TUint ChunkSize = KMaxFileSize;
 
 
-static RFile File, File2;
-#if defined SYMBIAN_TEST_COPY
-static TChar gDriveToTest2;
-#endif
+LOCAL_D RFile File, File2;
+LOCAL_D TChar gDriveToTest2;
 
 // if enabled, Read and Write operations are not boundary aligned.
-static TBool gMisalignedReadWrites = EFalse;
+LOCAL_D TBool gMisalignedReadWrites = EFalse;
 
-// read & write caching enabled flags - may be overridden by +/-r +/-w command line switches
-static TBool gReadCachingOn  = EFalse;
-static TBool gWriteCachingOn = EFalse;
+// read & write caching enabled flags - may be overriden by +/-r +/-w command line switches
+LOCAL_D TBool gReadCachingOn  = EFalse;
+LOCAL_D TBool gWriteCachingOn = EFalse;
 
 // if enabled, timings are for write AND flush
-static TBool gFlushAfterWrite = ETrue;
+LOCAL_D TBool gFlushAfterWrite = ETrue;
 
 // if enabled, contiguous shared memory is used for Data buffer
-static TBool gSharedMemory = EFalse;
+LOCAL_D TBool gSharedMemory = EFalse;
 
 // if enabled, fragmented shared memory is used for Data buffer
-static TBool gFragSharedMemory = EFalse;
+LOCAL_D TBool gFragSharedMemory = EFalse;
 
-// if enabled, file is opened in EFileSequential (non-Rugged) file mode for write tests
-// - may be overridden by +/-q command line switches
-static TBool gFileSequentialModeOn = EFalse;
-
-static TInt gFastCounterFreq;
+LOCAL_D TInt gFastCounterFreq;
 
 
 
-static void RecursiveRmDir(const TDesC& aDes)
+LOCAL_C void RecursiveRmDir(const TDesC& aDes)
 //
 // Delete directory contents recursively
 //
@@ -104,7 +98,7 @@
 	TInt r=TheFs.GetDir(n,KEntryAttMaskSupported,EDirsLast,pD);
 	if (r==KErrNotFound || r==KErrPathNotFound)
 		return;
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt count=pD->Count();
 	TInt i=0;
 	while (i<count)
@@ -121,30 +115,30 @@
 			TFileName fileName;
 			fileName.Format(_L("%S%S"),&aDes,&e.iName);
 			r=TheFs.Delete(fileName);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			}
 		}
 	delete pD;
 	r=TheFs.RmDir(aDes);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 
-void static ClearSessionDirectory()
+void LOCAL_C ClearSessionDirectory()
 //
 // Delete the contents of F32-TST
 //
 	{
 	TParse sessionPath;
 	TInt r=TheFs.Parse(_L("\\F32-TST\\"),_L(""),sessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RecursiveRmDir(sessionPath.FullName());
 	r=TheFs.MkDir(sessionPath.FullName());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 
-static void DoTestFileRead(TInt aBlockSize, TInt aFileSize = KMaxFileSize, TBool aReRead = EFalse)
+LOCAL_C void DoTestFileRead(TInt aBlockSize, TInt aFileSize = KMaxFileSize, TBool aReRead = EFalse)
 //
 // Do Read Test
 //
@@ -160,7 +154,7 @@
 	// To allow this test to run on a non-preq914 branch :
 	enum {EFileWriteDirectIO = 0x00001000};
 	TInt r = File.Create(TheFs, _L("READTEST"), EFileStream | EFileWriteDirectIO);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	TInt count = aFileSize / DataBuf.Length();
 	while (count--)
 		File.Write(DataBuf);
@@ -169,7 +163,7 @@
 
 	enum {EFileReadBuffered = 0x00002000, EFileReadDirectIO = 0x00004000};
 	r = File.Open(TheFs, _L("READTEST"), EFileStream | (gReadCachingOn ? EFileReadBuffered : EFileReadDirectIO));
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 //	const TInt maxReadCount = aFileSize / aBlockSize;
 	TUint functionCalls = 0;
@@ -178,7 +172,7 @@
 	// To allow this test to run on a non-preq914 branch :
 	enum {EFileWriteDirectIO = 0x00001000};
 	TInt r = File2.Replace(TheFs, _L("WRITETEST"), EFileStream | EFileWriteDirectIO);
-	test_KErrNone(r);
+	test(r == KErrNone);
 #endif
 
 	TTime startTime(0);
@@ -215,14 +209,14 @@
 //				test.Printf(_L("%d"),DataBuf[a]);
 
 			TInt r = File.Read(DataBuf, readLen);
-			test_KErrNone(r);
+			test (r == KErrNone);
 
 			if (DataBuf.Length() == 0)
 				break;
 
 #if defined SYMBIAN_TEST_COPY
 			r = File2.Write(DataBuf, readLen);
-			test_KErrNone(r);
+			test (r == KErrNone);
 #endif
 			functionCalls++;
 
@@ -260,12 +254,12 @@
 
 	File.Close();
 	r = TheFs.Delete(_L("READTEST"));
-	test_KErrNone(r);
+	test(r == KErrNone);
 	return;
 	}
 
 
-static void TestFileRead(TInt aFileSize = KMaxFileSize, TBool aMisalignedReadWrites = EFalse, TBool aReRead = EFalse)
+LOCAL_C void TestFileRead(TInt aFileSize = KMaxFileSize, TBool aMisalignedReadWrites = EFalse, TBool aReRead = EFalse)
 //
 // Benchmark read method
 //
@@ -298,10 +292,8 @@
 	DoTestFileRead(64 * 1024+misalignedOffset, aFileSize, aReRead);
 	DoTestFileRead(128 * 1024+misalignedOffset, aFileSize, aReRead);
 	DoTestFileRead(256 * 1024+misalignedOffset, aFileSize, aReRead);
-#ifndef __WINS__	// Block sizes are too large for the emulator
 	DoTestFileRead(512 * 1024+misalignedOffset, aFileSize, aReRead);
 	DoTestFileRead(1024 * 1024+misalignedOffset, aFileSize, aReRead);
-#endif
 #else
 	DoTestFileRead(16+misalignedOffset, aFileSize, aReRead);
 	DoTestFileRead(512+misalignedOffset, aFileSize, aReRead);
@@ -314,7 +306,7 @@
 	}
 
 
-static TInt FloatingPointLoop(TAny* funcCount)
+LOCAL_C TInt FloatingPointLoop(TAny* funcCount)
 	{
 	TUint& count = *(TUint*) funcCount;
 	TReal eq = KPi;
@@ -328,7 +320,7 @@
 	}
 
 
-static void DoTestFileReadCPU(TInt aBlockSize)
+LOCAL_C void DoTestFileReadCPU(TInt aBlockSize)
 //
 // Benchmark CPU utilisation for Read method
 //
@@ -338,7 +330,7 @@
 	{
 	enum {EFileReadBuffered = 0x00002000, EFileReadDirectIO = 0x00004000};
 	TInt r = File.Open(TheFs, _L("READCPUTEST"), EFileStream | (gReadCachingOn ? EFileReadBuffered : EFileReadDirectIO));
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	TInt pos = 0;
 
@@ -371,7 +363,7 @@
 	for (TInt i = 0; reqStat==KRequestPending; i++)
 		{
 		TInt r = File.Read(pos, DataBuf, aBlockSize);
-		test_KErrNone(r);
+		test (r == KErrNone);
 
 		pos += aBlockSize;
 		if (pos > KMaxFileSize-aBlockSize)
@@ -406,7 +398,7 @@
 	}
 
 
-static void TestFileReadCPU(TBool aMisalignedReadWrites = EFalse)
+LOCAL_C void TestFileReadCPU(TBool aMisalignedReadWrites = EFalse)
 //
 // Benchmark CPU utilisation for Read method
 //
@@ -422,7 +414,7 @@
 	DataBuf.SetLength(KMaxFileSize);
 
 	TInt r = File.Create(TheFs, _L("READCPUTEST"), EFileStream | EFileWriteDirectIO);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	File.Write(DataBuf);
 
@@ -448,17 +440,16 @@
 	DoTestFileReadCPU(64 * 1024+misalignedOffset);
 	DoTestFileReadCPU(128 * 1024+misalignedOffset);
 	DoTestFileReadCPU(256 * 1024+misalignedOffset);
-#ifndef __WINS__	// Block sizes are too large for the emulator
 	DoTestFileReadCPU(512 * 1024+misalignedOffset);
 	DoTestFileReadCPU(K1M+misalignedOffset);
-#endif
+
 
 	r = TheFs.Delete(_L("READCPUTEST"));
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}
 
 
-static void DoTestFileWrite(TInt aBlockSize, TInt aFileSize = KMaxFileSize, TBool aUpdate = EFalse)
+LOCAL_C void DoTestFileWrite(TInt aBlockSize, TInt aFileSize = KMaxFileSize, TBool aUpdate = EFalse)
 //
 // Do Write benchmark
 //
@@ -469,17 +460,17 @@
 	TFileName testDir(_L("?:\\F32-TST\\"));
 	testDir[0] = (TText) gDriveToTest;
 	TInt r = TheFs.MkDir(testDir);
-	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+	test(r == KErrNone || r == KErrAlreadyExists);
 
 	TFileName fileName;
-	r = File.Temp(TheFs, testDir, fileName, EFileWrite | (gFileSequentialModeOn ? EFileSequential : 0) 
-											| (gWriteCachingOn ? EFileWriteBuffered : EFileWriteDirectIO));
-	test_KErrNone(r);
+	enum {EFileWriteDirectIO = 0x00001000, EFileWriteBuffered = 0x00000800};
+	r = File.Temp(TheFs, testDir, fileName, EFileWrite | (gWriteCachingOn ? EFileWriteBuffered : EFileWriteDirectIO));
+	test(r == KErrNone);
 
 	if (aUpdate)
 		{
 		TInt r = File.SetSize(aFileSize);
-		test_KErrNone(r);
+		test(r == KErrNone);
 		}
 
 	TUint functionCalls = 0;
@@ -543,7 +534,7 @@
 	}
 
 
-static void TestFileWrite(TInt aFileSize = KMaxFileSize, TBool aMisalignedReadWrites = EFalse, TBool aUpdate = EFalse)
+LOCAL_C void TestFileWrite(TInt aFileSize = KMaxFileSize, TBool aMisalignedReadWrites = EFalse, TBool aUpdate = EFalse)
 //
 // Benchmark write method
 //
@@ -577,10 +568,8 @@
 	DoTestFileWrite(64 * 1024+misalignedOffset, aFileSize, aUpdate);
 	DoTestFileWrite(128 * 1024+misalignedOffset, aFileSize, aUpdate);
 	DoTestFileWrite(256 * 1024+misalignedOffset, aFileSize, aUpdate);
-#ifndef __WINS__	// Block sizes are too large for the emulator
 	DoTestFileWrite(512 * 1024+misalignedOffset, aFileSize, aUpdate);
 	DoTestFileWrite(1024 * 1024+misalignedOffset, aFileSize, aUpdate);
-#endif
 #else
 	DoTestFileWrite(16+misalignedOffset, aFileSize, aUpdate);
 	DoTestFileWrite(512+misalignedOffset, aFileSize, aUpdate);
@@ -593,7 +582,7 @@
 
 
 
-static void DoTestFileWriteCPU(TInt aBlockSize)
+LOCAL_C void DoTestFileWriteCPU(TInt aBlockSize)
 //
 // Benchmark CPU utilisation for Write method
 //
@@ -606,12 +595,12 @@
 	TFileName testDir(_L("?:\\F32-TST\\"));
 	testDir[0] = (TText) gDriveToTest;
 	TInt r = TheFs.MkDir(testDir);
-	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+	test(r == KErrNone || r == KErrAlreadyExists);
 
 	TFileName fileName;
-	r = File.Temp(TheFs, testDir, fileName, EFileWrite | (gFileSequentialModeOn ? EFileSequential : 0)
-											| (gWriteCachingOn ? EFileWriteBuffered : EFileWriteDirectIO));
-	test_KErrNone(r);
+	enum {EFileWriteDirectIO = 0x00001000, EFileWriteBuffered = 0x00000800};
+	r = File.Temp(TheFs, testDir, fileName, EFileWrite | (gWriteCachingOn ? EFileWriteBuffered : EFileWriteDirectIO));
+	test(r == KErrNone);
 
 	TUint functionCalls = 0;
 	TUint fltPntCalls = 0;
@@ -675,7 +664,7 @@
 	}
 
 
-static void TestFileWriteCPU(TBool aMisalignedReadWrites = EFalse)
+LOCAL_C void TestFileWriteCPU(TBool aMisalignedReadWrites = EFalse)
 //
 // Benchmark CPU utilisation for Write method
 //
@@ -705,14 +694,12 @@
 	DoTestFileWriteCPU(64 * 1024+misalignedOffset);
 	DoTestFileWriteCPU(128 * 1024+misalignedOffset);
 	DoTestFileWriteCPU(256 * 1024+misalignedOffset);
-#ifndef __WINS__	// Block sizes are too large for the emulator
 	DoTestFileWriteCPU(512 * 1024+misalignedOffset);
 	DoTestFileWriteCPU(K1M+misalignedOffset);
-#endif
 	}
 
 
-static void TestFileSeek()
+LOCAL_C void TestFileSeek()
 //
 // Benchmark file seek method
 //
@@ -727,7 +714,7 @@
 	TBuf8<1024> testdata(1024);
 	RFile f;
 	TInt r=f.Create(TheFs,_L("SEEKTEST"),EFileStream);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=64;
 	while (count--)
 		f.Write(testdata);
@@ -754,7 +741,7 @@
 
 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
 
-static void CreateManyLargFiles(TInt aNumber)
+LOCAL_C void CreateManyLargFiles(TInt aNumber)
 //
 // Make a directory with aNumber entries
 //
@@ -766,7 +753,7 @@
 
 	TFileName sessionPath;
 	TInt r=TheFs.SessionPath(sessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.MkDir(_L("\\F32-TST\\"));
 	test((r==KErrNone)||(r==KErrAlreadyExists));
 	r=TheFs.MkDir(_L("\\F32-TST\\BENCH_DELETE\\"));
@@ -777,11 +764,11 @@
 		TFileName baseName=_L("\\F32-TST\\BENCH_DELETE\\FILE");
 		baseName.AppendNum(i);
 		r=f.Replace(TheFs,baseName,EFileWrite);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r = f.SetSize(K3GB);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=f.Write((K3GB-30),WriteData);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		f.Flush();
 		f.Close();
 		}
@@ -797,12 +784,12 @@
 		TInt r=f.Open(TheFs,baseName,EFileRead);
 		if (r!=KErrNone)
 			{
-			test_Value(r, r == KErrNotFound && j==maxEntry);
+			test(r==KErrNotFound && j==maxEntry);
 			return;
 			}
 		ReadData.FillZ();
 		r=f.Read((K3GB-30),ReadData);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(f.Size(Size)==KErrNone);
 		test(K3GB == Size);
 		test(ReadData==WriteData);
@@ -811,7 +798,7 @@
 	}
 
 
-static void TestLargeFileDelete()
+LOCAL_C void TestLargeFileDelete()
 //
 // This test require MMC/SD card size >=4GB-2 in size
 //
@@ -830,14 +817,9 @@
     TInt r;
 
     r = TheFs.Volume(volInfo);
-    test_KErrNone(r);
-    
+    test(r == KErrNone);
+
 	TInt numberOfFiles = (TUint)(volInfo.iFree/(K4GB -2));
-#ifdef __WINS__
-	// Fix a maximum number of large files to create on the emulator
-	if (numberOfFiles > 5)
-		numberOfFiles = 5;
-#endif
 	test.Printf(_L("Number of large files =%d \n"),numberOfFiles);
 
 	if(numberOfFiles<=0)
@@ -862,7 +844,7 @@
 			baseName.AppendNum(index);
 
 			TInt r=TheFs.Delete(baseName);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			}
 
 		TTime endTime;
@@ -895,7 +877,7 @@
 		for (TInt index=0;index<numberOfFiles;index++)
 			{
 			TInt r=fMan->Delete(_L("\\F32-TST\\BENCH_DELETE\\FILE*"));
-			test_Value(r, r == KErrNone || r==KErrNotFound);
+			test(r==KErrNone || r==KErrNotFound);
 			}
 
 		TTime endTime;
@@ -916,7 +898,7 @@
 #endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
 
 
-static void CreateManyFiles(TInt aNumber)
+LOCAL_C void CreateManyFiles(TInt aNumber)
 //
 // Make a directory with aNumber entries
 //
@@ -928,7 +910,7 @@
 
 	TFileName sessionPath;
 	TInt r=TheFs.SessionPath(sessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.MkDir(_L("\\F32-TST\\"));
 	test((r==KErrNone)||(r==KErrAlreadyExists));
 	r=TheFs.MkDir(_L("\\F32-TST\\BENCH_DELETE\\"));
@@ -939,9 +921,9 @@
 		TFileName baseName=_L("\\F32-TST\\BENCH_DELETE\\FILE");
 		baseName.AppendNum(i);
 		r=f.Replace(TheFs,baseName,EFileRead);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=f.Write(_L8("Wibble"));
-		test_KErrNone(r);
+		test(r==KErrNone);
 		f.Close();
 		}
 
@@ -953,19 +935,19 @@
 		TInt r=f.Open(TheFs,baseName,EFileRead);
 		if (r!=KErrNone)
 			{
-			test_Value(r, r == KErrNotFound && j==maxEntry);
+			test(r==KErrNotFound && j==maxEntry);
 			return;
 			}
 		TBuf8<16> data;
 		r=f.Read(data);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(data==_L8("Wibble"));
 		f.Close();
 		}
 	}
 
 
-static void TestFileDelete()
+LOCAL_C void TestFileDelete()
 //
 //
 //
@@ -994,7 +976,7 @@
 			baseName.AppendNum(index);
 
 			TInt r=TheFs.Delete(baseName);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			}
 
 		TTime endTime;
@@ -1027,7 +1009,7 @@
 		for (TInt index=0;index<numberOfFiles;index++)
 			{
 			TInt r=fMan->Delete(_L("\\F32-TST\\BENCH_DELETE\\FILE*"));
-			test_Value(r, r == KErrNone || r==KErrNotFound);
+			test(r==KErrNone || r==KErrNotFound);
 			}
 
 		TTime endTime;
@@ -1048,7 +1030,7 @@
 
 /*
 TInt maxDirEntry=200;
-static void TestDirRead()
+LOCAL_C void TestDirRead()
 //
 // Benchmark directory read method
 //
@@ -1098,7 +1080,7 @@
 	}
 
 
-void static PrintDirResults()
+void LOCAL_C PrintDirResults()
 //
 // Print results of Directory Benchmark
 //
@@ -1113,7 +1095,7 @@
 */
 
 
-static void TestMkDir()
+LOCAL_C void TestMkDir()
 	{
 	test.Next(_L("Benchmark MkDir"));
 	ClearSessionDirectory();
@@ -1130,7 +1112,7 @@
 		dirName.AppendNum(n);
 		dirName.Append(_L("\\"));
 		TInt r = TheFs.MkDir(dirName);
-		test_KErrNone(r);
+		test(r == KErrNone);
 		}
 
 	endTime.HomeTime();
@@ -1156,15 +1138,15 @@
 
 		test.Printf(_L("Initialise\n"));
 		TInt r = UserHal::PageSizeInBytes(PageSize);
-		test_KErrNone(r);
+		test(r==KErrNone);
 
 		test.Printf(_L("Loading test driver\n"));
 		r = User::LoadLogicalDevice(KSharedChunkLddName);
-		test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+		test(r==KErrNone || r==KErrAlreadyExists);
 
 		test.Printf(_L("Opening channel\n"));
 		r = Ldd.Open();
-		test_KErrNone(r);
+		test(r==KErrNone);
 
 		test.Printf(_L("Create chunk\n"));
 
@@ -1175,13 +1157,13 @@
 
 		TUint ChunkAttribs = TotalChunkSize|aCreateFlags;
 		r = Ldd.CreateChunk(ChunkAttribs);
-		test_KErrNone(r);
+		test(r==KErrNone);
 
 		if (gSharedMemory)
 			{
 		    test.Printf(_L("Commit Contigouos Memory\n"));
 		    r = Ldd.CommitMemory(aCommitType,TotalChunkSize);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			}
 		else
 			{
@@ -1194,14 +1176,14 @@
 				i-=PageSize;
 				test.Printf(_L("Commit %d\n"), i);
 				r = Ldd.CommitMemory(aCommitType|i,PageSize);
-				test_KErrNone(r);
+				test(r==KErrNone);
 				}while (i>0);
 /*
 			for (TInt i = (ChunkSize-PageSize); i>=0; )
 				{
 				test.Printf(_L("Commit %d\n"), i);
 				r = Ldd.CommitMemory(aCommitType|i,PageSize);
-				test_KErrNone(r);
+				test(r==KErrNone);
 				i-=PageSize;
 				}
 */
@@ -1209,7 +1191,7 @@
 
 		test.Printf(_L("\nOpen user handle\n"));
 		r = Ldd.GetChunkHandle(TheChunk);
-		test_KErrNone(r);
+		test(r==KErrNone);
 
 		DataBuf.Set(TheChunk.Base(),KMaxFileSize, KMaxFileSize);
 		}
@@ -1236,11 +1218,11 @@
 
 		test.Printf(_L("Close kernel chunk handle\n"));
 		TInt r = Ldd.CloseChunk();
-		test_Value(r, r == 1);
+		test(r==1);
 
 		test.Printf(_L("Check chunk is destroyed\n"));
 		r = Ldd.IsDestroyed();
-		test_Value(r, r == 1);
+		test(r==1);
 
 		test.Printf(_L("Close test driver\n"));
 		Ldd.Close();
@@ -1312,17 +1294,6 @@
 			gFragSharedMemory = ETrue;
 			continue;
 			}
-		
-		if (token.CompareF(_L("+q"))== 0)
-			{
-			gFileSequentialModeOn = ETrue;
-			continue;
-			}
-		if (token.CompareF(_L("-q"))== 0)
-			{
-			gFileSequentialModeOn = EFalse;
-			continue;
-			}
 
 		test.Printf(_L("CLP=%S\n"),&token);
 
@@ -1366,11 +1337,10 @@
 	RProcess().SetPriority(EPriorityBackground);
 
 	TInt r = HAL::Get(HAL::EFastCounterFrequency, gFastCounterFreq);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test.Printf(_L("HAL::EFastCounterFrequency %d\n"), gFastCounterFreq);
 
-	test.Printf(_L("gReadCachingOn %d  gWriteCachingOn %d gFlushAfterWrite %d gFileSequentialModeOn %d\n"),
-				gReadCachingOn, gWriteCachingOn, gFlushAfterWrite, gFileSequentialModeOn);
+	test.Printf(_L("gReadCachingOn %d  gWriteCachingOn %d gFlushAfterWrite %d\n"), gReadCachingOn, gWriteCachingOn, gFlushAfterWrite);
 
 	TestFileSeek();
 
--- a/kerneltest/f32test/concur/t_cfsbench.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/concur/t_cfsbench.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -17,7 +17,6 @@
 
 //! @file f32test\concur\t_cfsbench.cpp
 
-#define	__E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <f32dbg.h>
@@ -119,7 +118,7 @@
 		return EFalse;
 	TDriveInfo info;
 	r=TheFs.Drive(info,drv);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	return (info.iDriveAtt != 0 && !(info.iDriveAtt & KDriveAttRom));
 	}
 
@@ -132,19 +131,19 @@
 	TBuf<64> b;
 	TChar c;
 	r=TheFs.DriveToChar(aDrive,c);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	b.Format(_L("Mount test file system on %c:"),(TUint)c);
 	test.Next(b);
 
 	r=TheFs.AddFileSystem(KFsFile);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 
 	r=TheFs.FileSystemName(gOldFsName,aDrive);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 
 	TDriveInfo drv;
 	r = TheFs.Drive(drv, aDrive);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	gNoMedia = (drv.iType == EMediaUnknown || drv.iType == EMediaNotPresent);
 
@@ -152,14 +151,14 @@
 		{
 		TTest::Printf(_L("Dismount %C: %S"), (TUint)c, &gOldFsName);
 		r=TheFs.DismountFileSystem(gOldFsName,aDrive);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 
 	r=TheFs.MountFileSystem(KFsName,aDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.FileSystemName(gNewFsName,aDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(gNewFsName.CompareF(KFsName)==0);
 	return c;
 	}
@@ -169,9 +168,9 @@
 	{
 	TChar c;
 	TInt r=TheFs.DriveToChar(aDrive,c);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.DismountFileSystem(gNewFsName,aDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	// if there's no media present, don't try to mount it
 	if (gNoMedia)
 		{
@@ -181,7 +180,7 @@
 		{
 		test.Printf(_L("Mount    %C: %S"), (TUint)c, &gOldFsName);
 		r=TheFs.MountFileSystem(gOldFsName,aDrive);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	if (r != KErrNone)
 		test.Printf(_L("Error %d remounting %S on %C\n"), r, &gOldFsName, (TUint)c);
@@ -196,12 +195,16 @@
 	TChar c;
 	TInt r=TheFs.DriveToChar(aDrive,c);
 	r=TheFs.FileSystemName(gFsName, aDrive);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 
 	if (gFsName.Length() > 0)
 		{
 		r=TheFs.DismountFileSystem(gFsName, aDrive);
-		test_KErrNone(r);
+		if(r!=KErrNone)
+			{
+			test.Printf(_L("Error = %d"),r);
+			test(EFalse);
+			}
 		}
 
 	TBufC<16> type = _L("asynchronous");
@@ -215,7 +218,7 @@
 	r=TheFs.MountFileSystem(gFsName, aDrive);
 #endif
 
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 enum TOper
@@ -864,7 +867,7 @@
 //
 	{
 	TInt r = TTest::Init();
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	TChar drvch0 = TTest::DefaultDriveChar();
 	TChar drvch1 = 0;
@@ -884,7 +887,7 @@
 		drvch2 = User::UpperCase(argv[3][0]);
 
 	r = TheFs.CharToDrive(drvch0, drive0);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	if (TheFs.IsValidDrive(drive0))
 		MountTestFileSystem(drive0);
@@ -899,14 +902,14 @@
 		}
 
 	r = TheFs.CharToDrive(drvch1, drive1);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = TheFs.CharToDrive(drvch2, drive2);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	r = TheFs.FileSystemName(gFsName1, drive1);
-	test_Value(r, r == KErrNone || r == KErrNotFound);
+	test(r == KErrNone || r == KErrNotFound);
 	r = TheFs.FileSystemName(gFsName2, drive2);
-	test_Value(r, r == KErrNone || r == KErrNotFound);
+	test(r == KErrNone || r == KErrNotFound);
 
 	gDataLock.CreateLocal();
 
@@ -1036,7 +1039,7 @@
 	gDataLock.Close();
 
 	UnmountFileSystem(drive0);
-	test_Value(r, r == 0);
+	test(r == 0);
 	}
 
 
@@ -1055,7 +1058,7 @@
     test.Start(_L("Starting tests..."));
 
     r=TheFs.Connect();
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     // TheFs.SetAllocFailure(gAllocFailOn);
     TTime timerC;
@@ -1071,7 +1074,7 @@
     endTimeC.HomeTime();
     TTimeIntervalSeconds timeTakenC;
     r=endTimeC.SecondsFrom(timerC,timeTakenC);
-    test_KErrNone(r);
+    test(r==KErrNone);
     test.Printf(_L("Time taken for test = %d seconds\n"),timeTakenC.Int());
     // TheFs.SetAllocFailure(gAllocFailOff);
     TheFs.Close();
--- a/kerneltest/f32test/concur/t_cfsmain.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/concur/t_cfsmain.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -130,7 +130,7 @@
 	{
 	TFileName f;
 	TInt r=aFsSession.FileSystemName(f,aDrive);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 	return (f.CompareF(KFatName)==0);
 	}
 
@@ -219,7 +219,7 @@
 
 	TEntry entry;
 	TInt r=TheFs.Entry(aName,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iAtt==anAttributes);
 	if (aModified!=TTime(0))
 		test(entry.iModified==aModified);
@@ -284,20 +284,20 @@
 
 	RFile file;
 	TInt r=file.Replace(TheFs,aFileName,0);
-	test_Value(r, r == KErrNone || r==KErrPathNotFound);
+	test(r==KErrNone || r==KErrPathNotFound);
 	if (r==KErrPathNotFound)
 		{
 		r=TheFs.MkDirAll(aFileName);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file.Replace(TheFs,aFileName,0);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	TCheckedUid checkedUid(aUidType);
 	TPtrC8 uidData((TUint8*)&checkedUid,sizeof(TCheckedUid));
 	r=file.Write(uidData);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(aFileContents);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	}
 
@@ -314,16 +314,16 @@
 		test.Printf(_L("ERROR: r=%d"),r);
 		test(EFalse);
 		}
-	test_Value(r, r == KErrNone || r==KErrPathNotFound);
+	test(r==KErrNone || r==KErrPathNotFound);
 	if (r==KErrPathNotFound)
 		{
 		r=TheFs.MkDirAll(aFileName);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file.Replace(TheFs,aFileName,0);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	r=file.Write(aFileContents);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	}
 
@@ -335,17 +335,17 @@
 
 	RFile file;
 	TInt r=file.Replace(TheFs,aFileName,0);
-	test_Value(r, r == KErrNone || r==KErrPathNotFound);
+	test(r==KErrNone || r==KErrPathNotFound);
 	if (r==KErrPathNotFound)
 		{
 		r=TheFs.MkDirAll(aFileName);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file.Replace(TheFs,aFileName,0);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	file.Close();
 	r=TheFs.SetAtt(aFileName,anAttributes,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 GLDEF_C void SetSessionPath(const TDesC& aPathName)
@@ -355,9 +355,9 @@
 	{
 
 	TInt r=TheFs.SetSessionPath(aPathName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 GLDEF_C void MakeFile(const TDesC& aFileName)
@@ -376,7 +376,7 @@
 	{
 
 	TInt r=TheFs.MkDirAll(aDirName);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	}
 
 GLDEF_C TInt CheckFileExists(const TDesC& aName,TInt aResult,TBool aCompRes/*=ETrue*/)
@@ -387,7 +387,7 @@
 
 	TEntry entry;
 	TInt r=TheFs.Entry(aName,entry);
-	test_Value(r, r == aResult);
+	test(r==aResult);
 	if (aResult!=KErrNone)
 		return(0);
 	TParsePtrC nameParse(aName);
@@ -406,15 +406,15 @@
 
 	RFile f;
 	TInt r=f.Open(TheFs,aName,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	HBufC8* testBuf=HBufC8::NewL(aContents.Length());
 	test(testBuf!=NULL);
 	TPtr8 bufPtr(testBuf->Des());
 	r=f.Read(bufPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(bufPtr==aContents);
 	r=f.Read(bufPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(bufPtr.Length()==0);
 	f.Close();
 	User::Free(testBuf);
@@ -433,12 +433,12 @@
 	CFileMan* fMan=CFileMan::NewL(TheFs);
 	test(fMan!=NULL);
 	TInt r=TheFs.SessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.CheckDisk(gSessionPath);
 	if (r!=KErrNone && r!=KErrNotSupported)
 		ReportCheckDiskFailure(r);
 	r=fMan->RmDir(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	delete fMan;
 	}
 
@@ -451,11 +451,11 @@
 	test(path.DrivePresent()==EFalse);
 
 	TInt r=TheFs.SetSessionPath(aSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.MkDirAll(gSessionPath);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	}
 
 GLDEF_C TInt CurrentDrive()
@@ -466,7 +466,7 @@
 
 	TInt driveNum;
 	TInt r=TheFs.CharToDrive(gSessionPath[0],driveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	return(driveNum);
 	}
 
@@ -482,11 +482,11 @@
 	RFormat format;
 	TInt count;
 	TInt r=format.Open(TheFs,driveBuf,EHighDensity,count);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	while(count)
 		{
 		TInt r=format.Next(count);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	format.Close();
 	}
@@ -512,10 +512,10 @@
 	gSessionPath=_L("?:\\F32-TST\\");
 	TChar driveLetter;
 	TInt r=TheFs.DriveToChar(aDrive,driveLetter);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	gSessionPath[0]=(TText)driveLetter;
 	r=TheFs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 // !!! Disable platform security tests until we get the new APIs
 //	if(User::Capability() & KCapabilityRoot)
@@ -624,7 +624,7 @@
 	test.Start(_L("Starting tests..."));
 
 	r=TheFs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	ParseCommandArguments(); //need this for drive letter to test
 
@@ -649,7 +649,7 @@
 
 	TInt theDrive;
 	r=TheFs.CharToDrive(gDriveToTest,theDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	// set up debug register
 	test.Printf(_L("debug register = 0x%X"), gDebugFlags);
@@ -665,7 +665,7 @@
 	endTimeC.HomeTime();
 	TTimeIntervalSeconds timeTakenC;
 	r=endTimeC.SecondsFrom(timerC,timeTakenC);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("Time taken for test = %d seconds\n"),timeTakenC);
 	TheFs.SetAllocFailure(gAllocFailOff);
 	TheFs.Close();
--- a/kerneltest/f32test/concur/t_cfsperform.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/concur/t_cfsperform.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -17,7 +17,6 @@
 
 //! @file f32test\concur\t_cfsbench.cpp
 
-#define	__E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <f32dbg.h>
@@ -83,7 +82,7 @@
 		return EFalse;
 	TDriveInfo info;
 	r=TheFs.Drive(info,drv);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	return (info.iDriveAtt != 0 && !(info.iDriveAtt & KDriveAttRom));
 	}
 
@@ -96,19 +95,19 @@
 	TBuf<64> b;
 	TChar c;
 	r=TheFs.DriveToChar(aDrive,c);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	b.Format(_L("Mount test file system on %c:"),(TUint)c);
 	test.Next(b);
 
 	r=TheFs.AddFileSystem(KFsFile);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	
 	r=TheFs.FileSystemName(gOldFsName,aDrive);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 
 	TDriveInfo drv;
 	r = TheFs.Drive(drv, aDrive);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	gNoMedia = (drv.iType == EMediaUnknown || drv.iType == EMediaNotPresent);
 
@@ -116,14 +115,14 @@
 		{
 		TTest::Printf(_L("Dismount %C: %S"), (TUint)c, &gOldFsName);
 		r=TheFs.DismountFileSystem(gOldFsName,aDrive);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 
 	r=TheFs.MountFileSystem(KFsName,aDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.FileSystemName(gNewFsName,aDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(gNewFsName.CompareF(KFsName)==0);
 	return c;
 	}
@@ -133,9 +132,9 @@
 	{
 	TChar c;
 	TInt r=TheFs.DriveToChar(aDrive,c);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.DismountFileSystem(gNewFsName,aDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	// if there's no media present, don't try to mount it
 	if (gNoMedia)
 		{
@@ -145,7 +144,7 @@
 		{
 		test.Printf(_L("Mount    %C: %S"), (TUint)c, &gOldFsName);
 		r=TheFs.MountFileSystem(gOldFsName,aDrive);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	if (r != KErrNone)
 		test.Printf(_L("Error %d remounting %S on %C\n"), r, &gOldFsName, (TUint)c);
@@ -160,7 +159,7 @@
 	TChar c;
 	TInt r=TheFs.DriveToChar(aDrive,c);
 	r=TheFs.FileSystemName(gFsName, aDrive);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 
 	if (gFsName.Length() > 0)
 		{
@@ -184,7 +183,7 @@
 	r=TheFs.MountFileSystem(gFsName, aDrive);
 #endif
 
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 enum TOper
@@ -358,7 +357,7 @@
 
 		TInt sizeFile = 0;
 		r = iF.Size(sizeFile);
-		test_KErrNone(r);
+		test(r == KErrNone);
         if (gVerbose)
 			{
 			test.Printf(_L("File Size = %d, %d buffers of size %d\n"), sizeFile, iMax, iBufSize);
@@ -469,7 +468,10 @@
 	for (TInt pos=0; pos<iFileSize; pos+= buf->Length())
 		{
 		r = iF.Write(pos, bufptr);
-		test_KErrNone(r);
+		if (r != KErrNone)
+			test.Printf(_L("Write() returned %d\n"), r);
+
+		test(r == KErrNone);
 		}
 	delete buf; buf = NULL;
 
@@ -650,15 +652,15 @@
 
 
 	r = TheFs.DriveToChar(aDrive1, dc1);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = TheFs.DriveToChar(aDrive2, dc2);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	// allocate buffers
 	r = f1.Init(dc1, aBufSize1);
-	test_KErrNone(r);
+		test(r == KErrNone);
 	r = f2.Init(dc2, aBufSize2);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	
 	_LIT(KSync, " sync");
@@ -684,21 +686,21 @@
 		if (aBufSize1 > 0)
 			{
 			r = f1.CreateReadFile();
-			test_KErrNone(r);
+			test(r == KErrNone);
 			}
 		if (aBufSize2 > 0)
 			{
 			r = f2.CreateReadFile();
-			test_KErrNone(r);
+			test(r == KErrNone);
 			}
 
 		if (aBufSize1 > 0)
 			r = f1.Open(RFileOps::ERead);
-		test_KErrNone(r);
+		test(r == KErrNone);
 		
 		if (aBufSize2 > 0)
 			r = f2.Open(RFileOps::ERead);
-		test_KErrNone(r);
+		test(r == KErrNone);
 
 
 		timer.After(tstat, KTimeBM * KSecond);
@@ -738,13 +740,13 @@
 		if (aBufSize1 > 0)
 			{
 			r = f1.Open(RFileOps::EWrite);
-			test_KErrNone(r);
+			test(r == KErrNone);
 			}
 	
 		if (aBufSize2 > 0)
 			{
 			r = f2.Open(RFileOps::EWrite);
-			test_KErrNone(r);
+			test(r == KErrNone);
 			}
 
 		timer.After(tstat, KTimeBM * KSecond);
@@ -902,7 +904,7 @@
 GLDEF_C void CallTestsL()
 	{
 	TInt r = TTest::Init();
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	TChar drvch1 = 0;
 	TChar drvch2 = 0;
@@ -961,14 +963,14 @@
 		}
 
 	r = TheFs.CharToDrive(drvch1, drive1);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = TheFs.CharToDrive(drvch2, drive2);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	r = TheFs.FileSystemName(gFsName1, drive1);
-	test_Value(r, r == KErrNone || r == KErrNotFound);
+	test(r == KErrNone || r == KErrNotFound);
 	r = TheFs.FileSystemName(gFsName2, drive2);
-	test_Value(r, r == KErrNone || r == KErrNotFound);
+	test(r == KErrNone || r == KErrNotFound);
 
 	if (testFs)
 		{
@@ -1049,7 +1051,7 @@
 		UnmountFileSystem(drive1);
 		UnmountFileSystem(drive2);
 		}
-	test_Value(r, r == 0);
+	test(r == 0);
 	}
 
 
@@ -1067,7 +1069,7 @@
     test.Start(_L("Starting tests..."));
 
     r=TheFs.Connect();
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     // TheFs.SetAllocFailure(gAllocFailOn);
     TTime timerC;
@@ -1082,7 +1084,7 @@
     endTimeC.HomeTime();
     TTimeIntervalSeconds timeTakenC;
     r=endTimeC.SecondsFrom(timerC,timeTakenC);
-    test_KErrNone(r);
+    test(r==KErrNone);
     test.Printf(_L("Time taken for test = %d seconds\n"),timeTakenC.Int());
     // TheFs.SetAllocFailure(gAllocFailOff);
     TheFs.Close();
--- a/kerneltest/f32test/demandpaging/t_wdpstress.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/demandpaging/t_wdpstress.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -475,7 +475,7 @@
 	}
 
 
-EXPORT_C void CTestSession::ServiceL(const RMessage2& aMessage)
+void CTestSession::ServiceL(const RMessage2& aMessage)
 //
 // Virtual message-handler
 //
--- a/kerneltest/f32test/fileshare/handshare.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/fileshare/handshare.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -16,7 +16,6 @@
 //
 
 #include <e32svr.h>
-#define __E32TEST_EXTENSION__
 #include <e32test.h>
 #include "handshare.h"
 
@@ -152,9 +151,9 @@
 			// stop server2
 			RFileHandleSharer2 handsvr2;
 			TInt r=handsvr2.Connect();
-			test_KErrNone(r);
+			test(r==KErrNone);
 			r = handsvr2.Exit();
-			test_Value(r, r ==KErrNone || r == KErrServerTerminated);
+			test(r==KErrNone || r == KErrServerTerminated);
 			handsvr2.Close();
 
 			aMessage.Complete(KErrNone);	
@@ -191,29 +190,29 @@
 	RFs fs;
 	TInt r=fs.Connect();
 	r=fs.CreatePrivatePath(gTestDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs.SetSessionToPrivate(gTestDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs.ShareProtected();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RFile file1;
 	r=file1.Create(fs,KSvrFileName,EFileWrite);
-	test_Value(r, r ==KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	if (r==KErrAlreadyExists)
 		{
 		r=file1.Open(fs,KSvrFileName, EFileWrite);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	r=file1.Write(KTestData1());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(fs,KSvrFileName, fileMode);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TInt fssh=file1.SubSessionHandle();
 	r=aMsg.Write(0, TPckgC<TInt>(fssh));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	aMsg.Complete(fs);
 	fs.Close();
 	}
@@ -233,32 +232,32 @@
 
 	RFileHandleSharer2 handsvr2;
 	TInt r = handsvr2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TInt ssh;
 	TInt fsh = handsvr2.GetFileHandle(ssh, TFileMode(fileMode));
-	test_Value(fsh, fsh >= 0);
+	test(fsh >= 0);
 
 	// adopt the file from FHServer2
 	RFile file;
 	r=file.AdoptFromServer(fsh, ssh);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("RFile::TransferToClient()"));
 
 	// transfer the file to the client
 	r = file.TransferToClient(aMsg, 0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// test we can still use the file
 	TInt pos = 0;
 	r = file.Seek(ESeekStart, pos);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf8<100> rbuf;
 	r=file.Read(0,rbuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=rbuf.CompareF(KTestData1());
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	handsvr2.Close();
 
@@ -278,28 +277,28 @@
 	// connect to FHServer2
 	RFileHandleSharer2 handsvr2;
 	TInt r = handsvr2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RFile file;
 
 	// Message slot 0 is a RFs handle
 	// Message slot 1 is a RFile Subsession handle (RFile::SubSessionHandle())
 	r = file.AdoptFromClient(aMsg, 0, 1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 
 
 	TBuf8<100> rbuf;
 	r=file.Read(0,rbuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=rbuf.CompareF(KTestData());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(KTestData1());
-	test_Value(r, r ==KErrAccessDenied);
+	test(r==KErrAccessDenied);
 	r=file.ChangeMode(EFileWrite);
-	test_Value(r, r ==KErrArgument);
+	test(r==KErrArgument);
 	r=file.Rename(_L("\\newname.txt"));
-	test_Value(r, r ==KErrPermissionDenied || r==KErrAccessDenied);
+	test(r==KErrPermissionDenied || r==KErrAccessDenied);
 //	should try a delete
 
 	// pass the file handle to FHServer2
@@ -308,15 +307,15 @@
 	TIpcArgs ipcArgs;
 	file.TransferToServer(ipcArgs, 0, 1);
 	r = handsvr2.PassFileHandle(ipcArgs);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TInt pos = 0;
 	r = file.Seek(ESeekStart, pos);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Read(0,rbuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=rbuf.CompareF(KTestData());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	file.Close();
 
@@ -335,33 +334,33 @@
 
 	RFile file;
 	TInt r = file.AdoptFromCreator(1, 2);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	TBuf8<100> rbuf;
 	r=file.Read(0,rbuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=rbuf.CompareF(KTestData());
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("RFile::Rename()"));
 
 	// define a filename in our private path
 	RFs fs;
 	r=fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TFileName sessionp;
 	fs.SessionPath(sessionp);
 	r = fs.MkDirAll(sessionp);
-	test_Value(r, r ==KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 
 	r=fs.ShareProtected();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=fs.CreatePrivatePath(gTestDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs.SetSessionToPrivate(gTestDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TPath newPath;
 	fs.PrivatePath(newPath);
@@ -371,10 +370,10 @@
 	
 	// delete the file before we try to rename anything to it
 	r = fs.Delete(newFileName);
-	test_Value(r, r  == KErrNone || r == KErrNotFound);
+	test(r == KErrNone || r == KErrNotFound);
 
 	r=file.Rename(newFileName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	file.Close();
 
@@ -382,7 +381,7 @@
 	// have been moved to our private directory)
 	test.Next(_L("RFs::Delete()"));
 	r = fs.Delete(newFileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	fs.Close();
 
@@ -403,7 +402,7 @@
 	// Message slot 0 is a RFs handle
 	// Message slot 1 is a RFile Subsession handle (RFile::SubSessionHandle())
 	TInt r = file.AdoptFromClient(aMsg, 0, 1);
-	test_Value(r, r ==KErrBadHandle);
+	test(r==KErrBadHandle);
 
 
 	aMsg.Complete(r);
@@ -648,10 +647,10 @@
 	// Sanity check for open handles
 	TInt end_thc, end_phc;
 	RThread().HandleCount(end_phc, end_thc);
-	test_Value(start_thc, start_thc == end_thc);
+	test(start_thc == end_thc);
 //	test(start_phc == end_phc);
 	// and also for pending requests ...
-	test_Value(RThread().RequestCount(), RThread().RequestCount() == 0);
+	test(RThread().RequestCount() == 0);
 
 	
 	return KErrNone;
@@ -690,7 +689,7 @@
 	// start server2 in a seperate thread
 	RThread server2Thread;
 	TInt r = server2Thread.Create(_L("FHServer2"), FHServer2, KDefaultStackSize, KHeapSize, KHeapSize, NULL);	
-	test_KErrNone(r);	
+	test(r==KErrNone);	
 	TRequestStatus statq;
 	server2Thread.Logon(statq);
 	server2Thread.Resume();
@@ -700,17 +699,17 @@
 
 	// wait for server2's thread to end gracefully
 	User::WaitForRequest(statq);
-	test_KErrNone(statq.Int());
+	test(statq == KErrNone);
 
 	server2Thread.Close();
 
 	RFs cleanupfs;
 	r = cleanupfs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=cleanupfs.SetSessionToPrivate(gTestDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=cleanupfs.Delete(KSvrFileName);
-	test_Value(r, r ==KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 	cleanupfs.Close();
 
 
@@ -723,9 +722,9 @@
 	// Sanity check for open handles and pending requests
 	TInt end_thc, end_phc;
 	RThread().HandleCount(end_phc, end_thc);
-	test_Value(start_thc, start_thc == end_thc);
-	test_Value(start_phc, start_phc == end_phc);
-	test_Value(RThread().RequestCount(), RThread().RequestCount() == 0);
+	test(start_thc == end_thc);
+	test(start_phc == end_phc);
+	test(RThread().RequestCount() == 0);
 	
 	return 0;
 	}
--- a/kerneltest/f32test/fileshare/handshare64bit.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/fileshare/handshare64bit.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -18,7 +18,7 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
+
 #include <e32svr.h>
 #include <e32test.h>
 #include "handshare64bit.h"
@@ -162,7 +162,7 @@
 	if (r == KErrNone)
 	r = file1.Replace(fs,KServerFileName,EFileWrite);
 	r=file1.SetSize(K4GB-1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = file1.Write(K4GB-10,KTestData4());
 		
 	file1.Close();
@@ -178,17 +178,17 @@
 
 	// transfer the file to the client
 	r = file1.TransferToClient(aMsg, 0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// test we can still use the file
 	TInt64 pos = 0;
 	r = file1.Seek(ESeekStart, pos);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	TBuf8<9> rbuf;
 	r=file1.Read(K4GB-10,rbuf);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r=rbuf.CompareF(KTestData4());
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	file1.Close();
 	fs.Close();
@@ -209,19 +209,19 @@
 	// Message slot 0 is a RFs handle
 	// Message slot 1 is a RFile Subsession handle (RFile::SubSessionHandle())
 	TInt r = file.AdoptFromClient(aMsg, 0, 1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TBuf8<9> rbuf;
 	r=file.Read(K4GB-10,rbuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=rbuf.CompareF(KTestData3());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(KTestData1());
-	test_Value(r, r==KErrAccessDenied);
+	test(r==KErrAccessDenied);
 	r=file.ChangeMode(EFileWrite);
-	test_Value(r, r==KErrArgument);
+	test(r==KErrArgument);
 	r=file.Rename(_L("\\newname.txt"));
-	test_Value(r, r==KErrPermissionDenied || r==KErrAccessDenied);
+	test(r==KErrPermissionDenied || r==KErrAccessDenied);
 	file.Close();
 
 	aMsg.Complete(KErrNone);
@@ -237,33 +237,33 @@
 
 	RFile64 file;
 	TInt r = file.AdoptFromCreator(1, 2);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	TBuf8<3> rbuf;
 	r=file.Read(K4GB-10,rbuf,3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=rbuf.CompareF(KTestData2());
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("RFile::Rename()"));
 
 	// define a filename in our private path
 	RFs fs;
 	r=fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TFileName sessionp;
 	fs.SessionPath(sessionp);
 	r = fs.MkDirAll(sessionp);
-	test_Value(r, r==KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 
 	r=fs.ShareProtected();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=fs.CreatePrivatePath(gTestDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs.SetSessionToPrivate(gTestDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TPath newPath;
 	fs.PrivatePath(newPath);
@@ -273,14 +273,14 @@
 	
 	// delete the file before we try to rename anything to it
 	r = fs.Delete(newFileName);
-	test_Value(r, r == KErrNone || r == KErrNotFound);
+	test(r == KErrNone || r == KErrNotFound);
 
 	TFileName fileName;
 	r = file.FullName(fileName);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	
 	r=file.Rename(newFileName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	file.Close();
 
@@ -288,7 +288,7 @@
 	// have been moved to our private directory)
 	test.Next(_L("RFs::Delete()"));
 	r = fs.Delete(newFileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	fs.Close();
 
@@ -376,11 +376,11 @@
 
 	RFs cleanupfs;
 	TInt r = cleanupfs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=cleanupfs.SetSessionToPrivate(gTestDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=cleanupfs.Delete(KSvrFileName);
-	test_Value(r, r==KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 	cleanupfs.Close();
 
 
@@ -393,9 +393,9 @@
 	// Sanity check for open handles and pending requests
 	TInt end_thc, end_phc;
 	RThread().HandleCount(end_phc, end_thc);
-	test_Value(start_thc, start_thc == end_thc);
-	test_Value(start_phc, start_phc == end_phc);
-	test_Value(RThread().RequestCount(), RThread().RequestCount() == 0);
+	test(start_thc == end_thc);
+	test(start_phc == end_phc);
+	test(RThread().RequestCount() == 0);
 	
 	return 0;
 	}
--- a/kerneltest/f32test/fileshare/t_handshare.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/fileshare/t_handshare.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define	__E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include "t_server.h"
@@ -42,49 +41,49 @@
 		r=handsvr.Connect();
 		}
 		while(r==KErrNotFound);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=handsvr.SetTestDrive(drivenum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt ssh;
 	RFs fs1;
 	TInt fsh = handsvr.GetFileHandle(ssh, EFileRead);
 
 	r = fs1.SetReturnedHandle(fsh);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	RFile file;
 	r=file.Adopt(fs1,ssh);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TBuf8<100> rbuf;
 	r=file.Read(0,rbuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=rbuf.CompareF(KTestData1());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file.Write(KTestData());
-	test_Value(r, r==KErrAccessDenied);
+	test(r==KErrAccessDenied);
 	
 	r=file.ChangeMode(EFileWrite);
-	test_Value(r, r==KErrArgument);
+	test(r==KErrArgument);
 	
 	r=file.Rename(_L("\\newname.txt"));
-	test_Value(r, r==KErrPermissionDenied || r==KErrAccessDenied);
+	test(r==KErrPermissionDenied || r==KErrAccessDenied);
 
 	file.Close();
 
 	fsh = handsvr.GetFileHandle(ssh, EFileRead);
 	r = fs1.SetReturnedHandle(fsh);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// Adopt a bad sub-session handle
 
 	r=file.Adopt(fs1, KNullHandle);
-	test_Value(r, r==KErrBadHandle);
+	test(r==KErrBadHandle);
 
 	r=file.Adopt(fs1, -1);
-	test_Value(r, r==KErrBadHandle);
+	test(r==KErrBadHandle);
 
 
 	handsvr.Close();
@@ -102,43 +101,43 @@
 
 	RFs fs;
 	TInt r=fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// Check the number of open file handles
 	TInt resCount = fs.ResourceCount();
-	test_Value(resCount, resCount == 0);
+	test(resCount == 0);
 
 	// create a file & fill it with data	
 	RFile file1;
 	r=file1.Replace(fs,KCliFileName,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file1.Write(KTestData());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	// open the file for read
 	r = file1.Open(fs,KCliFileName,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf8<100> rbuf;
 	r = file1.Read(0,rbuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=rbuf.CompareF(KTestData);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 
 	// clone the file
 	RFile file2;
 	r = file2.Duplicate(file1);
-	test_Value(r, r==0);
+	test(r==0);
 
 	// make sure file positions are the same
 	TInt pos1 = 0;
 	r = file1.Seek(ESeekCurrent, pos1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt pos2 = 0;
 	r = file2.Seek(ESeekCurrent, pos2);
-	test_KErrNone(r);
-	test_Value(pos1, pos1 == pos2);
+	test(r==KErrNone);
+	test(pos1 == pos2);
 
 	// change the position on the duplcated file handle & 
 	// verify that the original file handle's position is unchanged
@@ -147,25 +146,25 @@
 	const TInt newPos2 = 5;
 	pos2 = newPos2;
 	r = file2.Seek(ESeekStart, pos2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	pos1 = 0;
 	r = file1.Seek(ESeekCurrent, pos1);
-	test_KErrNone(r);
-	test_Value(pos1, pos1 == oldPos1);
+	test(r==KErrNone);
+	test(pos1 == oldPos1);
 	
 	pos2 = 0;
 	r = file2.Seek(ESeekCurrent, pos2);
-	test_KErrNone(r);
-	test_Value(pos2, pos2 == newPos2);
-	test_Value(pos1, pos1 != pos2);
+	test(r==KErrNone);
+	test(pos2 == newPos2);
+	test(pos1 != pos2);
 
 	// close the parent file and check we can still use the duplicated one.
 	file1.Close();
 
 	// Check the number of open file handles - should be 1 (the duplicated one)
 	resCount = fs.ResourceCount();
-	test_Value(resCount, resCount == 1);
+	test(resCount == 1);
 
 	fs.Close();
 
@@ -174,36 +173,36 @@
 	// reset to pos 0
 	pos2 = 0;
 	r = file2.Seek(ESeekStart, pos2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file2.Read(0,rbuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=rbuf.CompareF(KTestData);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file2.Close();
 
 	// start again - this time we're going to close the duplicated file first
 	// and check we can still use the parent file
 
 	r = fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// Make a note of the number of open resources
 	fs.ResourceCountMarkStart();
 
 	// open the file for read
 	r = file1.Open(fs,KCliFileName,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 
 	// clone the file & check we can read it
 	r = file2.Duplicate(file1, EOwnerThread);
-	test_Value(r, r==0);
+	test(r==0);
 	rbuf.FillZ();
 	r = file2.Read(0,rbuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=rbuf.CompareF(KTestData);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 
 	// close the duplicated file and check we can still use the parent one.
@@ -213,9 +212,9 @@
 
 	// check we can read the parent file
 	r=file1.Read(0,rbuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=rbuf.CompareF(KTestData);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// close the parent
 	file1.Close();
@@ -223,7 +222,7 @@
 	// Check the number of open file handles
 	fs.ResourceCountMarkEnd();
 	resCount = fs.ResourceCount();
-	test_Value(resCount, resCount == 0);
+	test(resCount == 0);
 
 	fs.Close();
 	}
@@ -240,10 +239,10 @@
 		r=handsvr.Connect();
 		}
 	while(r==KErrNotFound);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=handsvr.SetTestDrive(drivenum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TInt ssh;
 	TInt fsh = handsvr.GetFileHandle2(ssh, EFileWrite);
@@ -261,57 +260,57 @@
 
 	RFile file;
 	r=file.AdoptFromServer(fsh, ssh);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TBuf8<100> rbuf;
 	r=file.Read(0,rbuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// server should write KTestData1 ("Server Write Server Write") to file
 	r=rbuf.CompareF(KTestData1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// reset to pos 0
 	TInt pos = 0;
 	r = file.Seek(ESeekStart, pos);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	// overwrite with KTestData ("Client Write Client Write") to file
 	r=file.Write(KTestData());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	rbuf.FillZ();
 	r=file.Read(0,rbuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=rbuf.CompareF(KTestData);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 // !!! Disable platform security tests until we get the new APIs
 //	r=file.Rename(_L("\\newname.txt"));
-//	test_Value(r, r==KErrPermissionDenied);
+//	test(r==KErrPermissionDenied);
 
 	test.Next(_L("RFile::Name()"));
 
 	// retrieve the file name from the server
 	TFileName name;
 	r = file.Name(name);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = name.Compare(KSvrFileName());
-	test_Value(r, r==0);
+	test(r==0);
 	
 
 	test.Next(_L("RFile::Duplicate()"));
 	RFile file2;
 	r = file2.Duplicate(file);
-	test_Value(r, r==0);
+	test(r==0);
 
 
 	TInt pos1 = 0;
 	r = file.Seek(ESeekCurrent, pos1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt pos2 = 0;
 	r = file2.Seek(ESeekCurrent, pos2);
-	test_KErrNone(r);
-	test_Value(pos1, pos1 == pos2);
+	test(r==KErrNone);
+	test(pos1 == pos2);
 
 	// close the parent file and check we can still use the duplicated one.
 	file.Close();
@@ -321,12 +320,12 @@
 	// reset to pos 0
 	pos2 = 0;
 	r = file2.Seek(ESeekStart, pos2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file2.Read(0,rbuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=rbuf.CompareF(KTestData);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file2.Close();
 	}
 
@@ -340,9 +339,9 @@
 
 	RFs fs;
 	r=fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs.ShareProtected();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	
 	// define a filename in our private path
@@ -353,7 +352,7 @@
 	newFileName.Append(_L("newname.txt"));
 	
 	r=fs.CreatePrivatePath(drivenum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs.SetSessionToPrivate(drivenum);
 
 	RFileHandleSharer handsvr;
@@ -362,10 +361,10 @@
 		r=handsvr.Connect();
 		}
 	while(r==KErrNotFound);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=handsvr.SetTestDrive(drivenum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// Next verify that we can copy a file retrieved from the server
 	// using CFileMan::Copy()
@@ -378,35 +377,35 @@
 
 	RFile file;
 	r=file.AdoptFromServer(fsh, ssh);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 
 	CFileMan* fileMan = NULL;
 	TRAP(r, fileMan = CFileMan::NewL(fs));
-	test_Value(r, r ==  KErrNone && fileMan != NULL);
+	test(r == KErrNone && fileMan != NULL);
 
 	// copy to file, overwrite 
 	r = fileMan->Copy(file, newFileName, CFileMan::EOverWrite);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	// copy to file, don't overwrite 
 	r = fileMan->Copy(file, newFileName, 0);	
-	test_Value(r, r ==  KErrAlreadyExists);
+	test(r == KErrAlreadyExists);
 
 	// copy to file, overwrite
 	r = fileMan->Copy(file, newFileName, CFileMan::EOverWrite);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	// copy to path
 	r = fileMan->Copy(file, newPath, CFileMan::EOverWrite);	
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	// copy to file, overwrite, asynchnonous
 	TRequestStatus status(KRequestPending);
 	r = fileMan->Copy(file, newFileName, CFileMan::EOverWrite, status);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	User::WaitForRequest(status);
-	test_KErrNone(status.Int());
+	test(status == KErrNone);
 
 
 	// Negative tests...
@@ -419,7 +418,7 @@
 	for (len=newLongPath.Length(); len< KMaxPath -4; len = newLongPath.Length())
 		newLongPath.Append(_L("x\\"));
 	r = fileMan->Copy(file, newLongPath, CFileMan::EOverWrite);	
-	test_Value(r, r ==  KErrBadName);
+	test(r == KErrBadName);
 
 	// copy to very long but valid path (no filename) which will overflow
 	// when drive letter is pre-pended to it
@@ -427,25 +426,25 @@
 	for (len=newLongPath.Length(); len< KMaxPath -2; len = newLongPath.Length())
 		newLongPath.Append(_L("x\\"));
 	r = fileMan->Copy(file, newLongPath, CFileMan::EOverWrite);	
-	test_Value(r, r ==  KErrBadName);
+	test(r == KErrBadName);
 
 	// copy to very long but valid path and filename which will overflow
 	// when drive letter is pre-pended to it
 	newLongPath.Append(_L("y"));
 	r = fileMan->Copy(file, newLongPath, CFileMan::EOverWrite);	
-	test_Value(r, r ==  KErrBadName);
+	test(r == KErrBadName);
 
 	// copy to badly formed path 
 	newLongPath = newPath;
 	newLongPath.Append(_L("\\y"));
 	r = fileMan->Copy(file, newLongPath, CFileMan::EOverWrite);	
-	test_Value(r, r ==  KErrBadName);
+	test(r == KErrBadName);
 
 	// copy to correctly formed path which doesn't exist
 	newLongPath = newPath;
 	newLongPath.Append(_L("x\\y\\z"));
 	r = fileMan->Copy(file, newLongPath, CFileMan::EOverWrite);	
-	test_Value(r, r ==  KErrPathNotFound);
+	test(r == KErrPathNotFound);
 
 	delete fileMan; fileMan = NULL;
 
@@ -462,17 +461,17 @@
 
 	// adopt the file handle from FHServer
 	r=file.AdoptFromServer(fsh, ssh);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file.Rename(_L("newname.txt"));
-	test_Value(r, r==KErrPermissionDenied || r==KErrAccessDenied);
+	test(r==KErrPermissionDenied || r==KErrAccessDenied);
 
 	// delete the file before we try to rename anything to it
 	r = fs.Delete(newFileName);
-	test_Value(r, r ==  KErrNone || r == KErrNotFound);
+	test(r == KErrNone || r == KErrNotFound);
 
 	r=file.Rename(newFileName);
-	test_Value(r, r==KErrPermissionDenied || r==KErrAccessDenied);
+	test(r==KErrPermissionDenied || r==KErrAccessDenied);
 
 	file.Close();
 
@@ -486,14 +485,14 @@
 	test (fsh >= 0);
 
 	r=file.AdoptFromServer(fsh, ssh);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// delete the file before we try to rename anything to it
 	r = fs.Delete(newFileName);
-	test_Value(r, r ==  KErrNone || r == KErrNotFound);
+	test(r == KErrNone || r == KErrNotFound);
 
 	r=file.Rename(newFileName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	file.Close();
 
@@ -501,7 +500,7 @@
 	// have been moved to our private directory)
 	test.Next(_L("RFs::Delete()"));
 	r = fs.Delete(newFileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	handsvr.Close();
 
@@ -516,25 +515,25 @@
 	{
 	RFs fs;
 	TInt r=fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// Check the number of open file handles
 	TInt resCount = fs.ResourceCount();
-	test_Value(resCount, resCount == 0);
+	test(resCount == 0);
 
 	r=fs.ShareProtected();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=fs.CreatePrivatePath(drivenum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs.SetSessionToPrivate(drivenum);
 	
 	
 	RFile file1;
 	r=file1.Replace(fs,KCliFileName,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file1.Write(KTestData());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	RFileHandleSharer handsvr;
@@ -543,16 +542,16 @@
 		r=handsvr.Connect();
 		}
 	while(r==KErrNotFound);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=handsvr.SetTestDrive(drivenum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=fs.SetSessionToPrivate(drivenum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.Open(fs,KCliFileName,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	// pass the file handle to FHServer
 	test.Next(_L("RFile::TransferToServer()"));
@@ -566,13 +565,13 @@
 	// verify that the original file handle's position is unchanged
 	TInt pos = 0;
 	r = file1.Seek(ESeekCurrent, pos);
-	test_KErrNone(r);
-	test_Value(pos, pos == 0);
+	test(r==KErrNone);
+	test(pos == 0);
 
 	// make sure we can still use it
 	TBuf8<100> rbuf;
 	r=file1.Read(0,rbuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// Close the file
 	file1.Close();	
@@ -580,11 +579,11 @@
 	handsvr.Close();
 
 	r=fs.MkDir(_L("C:\\mdir"));
-	test_Value(r, r==KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	
 	// Check the number of open file handles
 	resCount = fs.ResourceCount();
-	test_Value(resCount, resCount == 0);
+	test(resCount == 0);
 
 	fs.Close();
 	}
@@ -599,25 +598,25 @@
 
 	RFs fs;
 	TInt r=fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// Check the number of open file handles
 	TInt resCount = fs.ResourceCount();
-	test_Value(resCount, resCount == 0);
+	test(resCount == 0);
 
 	r=fs.ShareProtected();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=fs.CreatePrivatePath(drivenum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs.SetSessionToPrivate(drivenum);
 	
 	
 	RFile file1;
 	r=file1.Replace(fs,KCliFileName,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file1.Write(KTestData());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	RFileHandleSharer handsvr;
@@ -626,20 +625,20 @@
 		r=handsvr.Connect();
 		}
 	while(r==KErrNotFound);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=handsvr.SetTestDrive(drivenum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=fs.SetSessionToPrivate(drivenum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.Open(fs,KCliFileName,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	// check the resoure count - there should be 1 open file handle
 	resCount = fs.ResourceCount();
-	test_Value(resCount, resCount == 1);
+	test(resCount == 1);
 
 	// pass an invalid file handle to FHServer
 	// by overwriting the IPC slots
@@ -652,35 +651,35 @@
 
 	// check the resoure count - there should be 2 open file handles
 	resCount = fs.ResourceCount();
-	test_Value(resCount, resCount == 2);
+	test(resCount == 2);
 
 	ipcArgs.Set(0, 0);	// invalidate the RFs handle
 	r = handsvr.PassInvalidFileHandle(ipcArgs);
-	test_Value(r, r == KErrBadHandle);
+	test (r == KErrBadHandle);
 
 	// Pass a bad RFile handle
 	file1.TransferToServer(ipcArgs, 0, 1);
 
 	// check the resoure count - there should be 3 open file handles
 	resCount = fs.ResourceCount();
-	test_Value(resCount, resCount == 3);
+	test(resCount == 3);
 
 	ipcArgs.Set(1, 0);	// invalidate the RFile handle
 	r = handsvr.PassInvalidFileHandle(ipcArgs);
-	test_Value(r, r == KErrBadHandle);
+	test (r == KErrBadHandle);
 
 	// Pass bad RFs and RFile handles
 	file1.TransferToServer(ipcArgs, 0, 1);
 
 	// check the resoure count - there should be 4 open file handles
 	resCount = fs.ResourceCount();
-	test_Value(resCount, resCount == 4);
+	test(resCount == 4);
 
 
 	ipcArgs.Set(0, 0);	// invalidate the RFs handle
 	ipcArgs.Set(1, 0);	// invalidate the RFile handle
 	r = handsvr.PassInvalidFileHandle(ipcArgs);
-	test_Value(r, r == KErrBadHandle);
+	test (r == KErrBadHandle);
 
 	// Close the file
 	handsvr.Close();
@@ -688,7 +687,7 @@
 
 	// Check the number of open file handles
 	resCount = fs.ResourceCount();
-	test_Value(resCount, resCount == 3);
+	test(resCount == 3);
 
 	fs.Close();
 	}
@@ -703,30 +702,30 @@
 	
 	RFs fs;
 	TInt r=fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// Check the number of open file handles
 	TInt resCount = fs.ResourceCount();
-	test_Value(resCount, resCount == 0);
+	test(resCount == 0);
 
 	r=fs.ShareProtected();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=fs.CreatePrivatePath(drivenum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs.SetSessionToPrivate(drivenum);
 	
 	
 	RFile file1;
 	r=file1.Replace(fs,KCliFileName,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file1.Write(KTestData());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(fs, KCliFileName, EFileWrite);
 
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	// NB slot 0 is reserved for the command line
 
@@ -735,26 +734,26 @@
 	r = file1.TransferToProcess(aProcess, 1, 2);
 
 	r = aProcess.SetParameter(3, drivenum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=fs.SetSessionToPrivate(drivenum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// make sure we can still read from the file
 	TBuf8<100> rbuf;
 	r=file1.Read(0,rbuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=rbuf.CompareF(KTestData());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=fs.MkDir(_L("C:\\mdir"));
-	test_Value(r, r==KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	
 	// Check the number of open file handles - 
 	// should be 1 (the one duplicated for the other process)
 	resCount = fs.ResourceCount();
-	test_Value(resCount, resCount == 1);
+	test(resCount == 1);
 
 	fs.Close();
 
@@ -770,15 +769,15 @@
 		r=handsvr.Connect();
 		}
 	while(r==KErrNotFound);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 
 	r=handsvr.SetTestDrive(drivenum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// wait for server to read the file
 	r = handsvr.PassFileHandleProcess();
-	test_KErrNone(r);
+	test (r == KErrNone);
 	
 	handsvr.Close();
 	}
@@ -792,12 +791,12 @@
 	// make sure the session path exists
 	RFs fs;
 	TInt r = fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TFileName sessionp;
 	fs.SessionPath(sessionp);
 	r = fs.MkDirAll(sessionp);
-	test_Value(r, r==KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	fs.Close();
 
 	// Remember the number of open handles. Just for a sanity check ....
@@ -808,7 +807,7 @@
 	//create test server
 	RProcess p;
 	r = p.Create(_L("FHServer.exe"), KNullDesC);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// RFile::Duplicate() tests
 	Duplicate();
@@ -826,6 +825,7 @@
 	// Get an open writeable file from FHServer2 via FHServer 
 	// using RFile::AdoptFromServer()
 	RequestFileWrite();
+
 	// Deprecated RFile::Adopt() test
 	RequestFileDeprecatedAdopt();
 
@@ -842,19 +842,19 @@
 	// stop the servers
 	RFileHandleSharer handsvr;
 	r=handsvr.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = handsvr.Exit();
-	test_KErrNone(r);
+	test(r == KErrNone);
 	handsvr.Close();
 	
 	// delete the test file
 	RFs cleanupfs;
 	r=cleanupfs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=cleanupfs.SetSessionToPrivate(drivenum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=cleanupfs.Delete(KCliFileName);
-	test_Value(r, r==KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 	cleanupfs.Close();
 
 
@@ -872,11 +872,11 @@
 	RThread().HandleCount(end_phc, end_thc);
 	test.Printf(_L("Handles: end_phc %d, end_thc %d\n"), end_phc, end_thc);
 
-	test_Value(start_thc, start_thc == end_thc);
-	test_Value(start_phc, start_phc == end_phc);
+	test(start_thc == end_thc);
+	test(start_phc == end_phc);
 	
 	// and also for pending requests ...
-	test_Value(RThread().RequestCount(), RThread().RequestCount() == 0);
+	test(RThread().RequestCount() == 0);
 	
 	
 	RDebug::Print(_L("End Of Tests"));
--- a/kerneltest/f32test/filesystem/automounter/automounter.inf	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-// Copyright (c) 1998-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:
-// 
-// Test code for file server
-// 
-//
-
-/**
- @file
-*/
-
-
-PRJ_PLATFORMS
-
-BASEUSERDEFAULT
-
-PRJ_TESTMMPFILES
-t_automounter
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/f32test/filesystem/automounter/bld.inf	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,30 @@
+// Copyright (c) 1998-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:
+// 
+// Test code for file server
+// 
+//
+
+/**
+ @file
+*/
+
+
+PRJ_PLATFORMS
+
+BASEUSERDEFAULT
+
+PRJ_TESTMMPFILES
+t_automounter
+
--- a/kerneltest/f32test/filesystem/fat/b_fat32.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/filesystem/fat/b_fat32.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 //
 //
 
-#define	__E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32math.h>
@@ -149,10 +148,10 @@
         {
         pos += TheBootSector.ReservedSectors() * TheBootSector.BytesPerSector();
         TInt r=TheDisk.Open(TheFs,gSessionPath[0]-'A');
-        test_KErrNone(r);
+        test(r==KErrNone);
         TPtr8 buf(&data[0], 4);
         r=TheDisk.Read(pos, buf);
-        test_KErrNone(r);
+        test(r==KErrNone);
         TheDisk.Close();
         }
 
@@ -186,15 +185,15 @@
     pos += TheBootSector.ReservedSectors() * TheBootSector.BytesPerSector();
 
     TInt r=TheDisk.Open(TheFs,gSessionPath[0]-'A');
-    test_KErrNone(r);
+    test(r==KErrNone);
     TUint8  data[4];
     TPtr8 buf(&data[0], 4);
     r=TheDisk.Read(pos, buf);
-    test_KErrNone(r);
+    test(r==KErrNone);
     data[3] &= 0x0F;
     data[3] |= 0xA0;
     r=TheDisk.Write(pos, buf);
-    test_KErrNone(r);
+    test(r==KErrNone);
     TheDisk.Close();
         }
 
@@ -469,9 +468,9 @@
             test(buf!=NULL);
             TPtr8 ptr=buf->Des();
             TInt r=TheDisk.Open(TheFs,gSessionPath[0]-'A');
-            test_KErrNone(r);
+            test(r==KErrNone);
             r=TheDisk.Read(ClusterToByte(cluster), ptr);
-            test_KErrNone(r);
+            test(r==KErrNone);
             TheDisk.Close();
             RDebug::Print(_L("Cluster %d @ 0x%08X:"), cluster, ClusterToByte(cluster));
             DumpDirCluster(ptr.Ptr());
@@ -500,12 +499,12 @@
         test(buf!=NULL);
         TPtr8 ptr=buf->Des();
         TInt r=TheDisk.Open(TheFs,gSessionPath[0]-'A');
-        test_KErrNone(r);
+        test(r==KErrNone);
         RDebug::Print(_L("--------------- ROOT DIR ------------------"));
         for (TInt i = 0; i < num; i++)
             {
             r=TheDisk.Read(pos, ptr);
-            test_KErrNone(r);
+            test(r==KErrNone);
             if (!DumpDirEntry(ent, ptr.Ptr()))
                 break;
             pos += KSizeOfFatDirEntry;
@@ -764,7 +763,7 @@
         }
 
     TInt r=TheDisk.Open(TheFs,CurrentDrive());
-    test_KErrNone(r);
+    test(r==KErrNone);
     test(ReadWriteDWord(pos,mask,aValue)==KErrNone);
     TheDisk.Close();
     }
@@ -1084,7 +1083,7 @@
         Error(_L("Error deleting file"),r);
     RDebug::Print(_L("File removed"));
     r=TheFs.CheckDisk(gSessionPath);
-    test_KErrNone(r);
+    test(r==KErrNone);
     }
 
 static  void TestFatEntry(TUint16 aFileSize,TInt aCorruptFatCluster)
@@ -1097,22 +1096,22 @@
     FormatPack();
 
     r=TheFile.Replace(TheFs,_L("\\CORRUPT2.TMP"),EFileRead|EFileWrite);
-    test_KErrNone(r);
+    test(r==KErrNone);
     TheBuffer.SetLength(aFileSize);
     Mem::Fill(&TheBuffer[0],aFileSize,'A');
     r=TheFile.Write(TheBuffer);
-    test_KErrNone(r);
+    test(r==KErrNone);
     TheFile.Close();
 
     FatWrite(gFirstDataCluster,aCorruptFatCluster);
 
     TInt pos=0;
     r=TheFile.Open(TheFs,_L("\\CORRUPT2.TMP"),EFileRead|EFileWrite);
-    test_Value(r, r == KErrNone || r==KErrCorrupt);
+    test(r==KErrNone || r==KErrCorrupt);
     if (r==KErrNone)
         {
         r=TheFile.Seek(ESeekStart,pos);
-        test_KErrNone(r);
+        test(r==KErrNone);
         r=TheFile.Write(TheBuffer);
 
         if ((gDriveCacheFlags & EFileCacheWriteOn) && (r == KErrNone))
@@ -1130,9 +1129,9 @@
 
     pos=0;
     r=TheFile.Open(TheFs,_L("\\CORRUPT2.TMP"),EFileRead|EFileWrite);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheFile.Seek(ESeekStart,pos);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheFile.Write(TheBuffer);
 
     if ((gDriveCacheFlags & EFileCacheWriteOn) && (r == KErrNone))
@@ -1172,15 +1171,15 @@
     TheBuffer.SetLength(anInitialSize);
     Mem::Fill(&TheBuffer[0],anInitialSize,'A');
     r=TheFile.Write(TheBuffer);
-    test_KErrNone(r);
+    test(r==KErrNone);
     TheFile.Close();
 
     r=TheDisk.Open(TheFs,CurrentDrive());
-    test_KErrNone(r);
+    test(r==KErrNone);
     TPtr8 sectorBuf((TUint8*)pBuffer1->Ptr(),TheBootSector.BytesPerSector());
     TInt pos = gRootDirStart;
     r=TheDisk.Read(pos,sectorBuf);
-    test_KErrNone(r);
+    test(r==KErrNone);
     TFatDirEntry* pE=(TFatDirEntry*)pBuffer1->Ptr();
     while (pE->IsVFatEntry())   //  UNICODE entries are VFat by definition
         pE++;
@@ -1194,16 +1193,16 @@
     //-- the data
     TheDisk.Close();
     r=TheDisk.Open(TheFs,CurrentDrive());
-    test_KErrNone(r);
+    test(r==KErrNone);
 
 
     pos=0;
     TPtr8 buffer1(pBuffer1->Des());
     r=TheDisk.Read(pos,buffer1);
-    test_KErrNone(r);
+    test(r==KErrNone);
     TheDisk.Close();
     r=TheFs.Entry(_L("\\CORRUPT1.TMP"),TheEntry);
-    test_Value(r, r == KErrNone || r==KErrCorrupt);
+    test(r==KErrNone || r==KErrCorrupt);
     TTime saveTime=TheEntry.iModified;
     if (r!=KErrNone)
         saveTime.HomeTime();
@@ -1222,11 +1221,11 @@
         }
 
     r=TheDisk.Open(TheFs,CurrentDrive());
-    test_KErrNone(r);
+    test(r==KErrNone);
     pos=0;
     TPtr8 buffer2(pBuffer2->Des());
     r=TheDisk.Read(pos,buffer2);
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     //-- this bit is dodgy. The buffers may differ because of volume finalisation stuff
     //-- FAT[1] and FSInfo sectors
@@ -1234,9 +1233,9 @@
     TheDisk.Close();
 
     r=TheFs.SetModified(_L("\\CORRUPT1.TMP"),saveTime);
-    test_Value(r, r == KErrNone || r==KErrCorrupt);
+    test(r==KErrNone || r==KErrCorrupt);
     r=TheFs.Entry(_L("\\CORRUPT1.TMP"),TheEntry);
-    test_Value(r, r == KErrNone || r==KErrCorrupt);
+    test(r==KErrNone || r==KErrCorrupt);
     }
 
 static  void TestBounds()
@@ -1248,7 +1247,7 @@
     test(TheFs.Volume(TheVolumeInfo,CurrentDrive())==KErrNone);
     TInt64 size=TheVolumeInfo.iSize;
     TInt r=TheDisk.Open(TheFs,CurrentDrive());
-    test_KErrNone(r);
+    test(r==KErrNone);
     TPtr8 buffer(pBuffer1->Des());
     TInt64 pos=size - 2*buffer.MaxLength();
     TInt inc=buffer.MaxLength();
@@ -1257,7 +1256,7 @@
         TPtr8 tempbuf((TUint8*)pBuffer1->Ptr(),inc);
         r=TheDisk.Read(pos,tempbuf);
         test.Printf(_L("Read %08X:%08X len %d r %d\r"), I64HIGH(pos),I64LOW(pos), inc, r);
-        test_Value(r, r == KErrNone || r==KErrCorrupt);
+        test(r==KErrNone || r==KErrCorrupt);
         if (r==KErrNone)
             pos+=inc;
         else
@@ -1295,7 +1294,7 @@
                 TInt expect = (lpos+bsize-1 < maxpos ? KErrNone : KErrCorrupt);
                 r=TheDisk.Read(lpos, temp);
                 RDebug::Print(_L("Read %08X:%08X result %d     \r"), I64HIGH(lpos), I64LOW(lpos), r);
-                test_Value(r, r == expect);
+                test(r==expect);
                 }
             }
         }
@@ -1391,37 +1390,37 @@
     TInt r;
 
     r=f.Replace(TheFs,_L("\\GOBLIN.TMP"),EFileRead|EFileWrite);
-    test_KErrNone(r);
+    test(r==KErrNone);
     f.SetSize(4*gBytesPerCluster); // 4 Clusters
     f.Close();
 
     r=f.Replace(TheFs,_L("\\WIZARD.TMP"),EFileRead|EFileWrite);
-    test_KErrNone(r);
+    test(r==KErrNone);
     f.SetSize(5*gBytesPerCluster); // 5 Clusters
     f.Close();
 
     r=f.Replace(TheFs,_L("\\TROLL.TMP"),EFileRead|EFileWrite);
-    test_KErrNone(r);
+    test(r==KErrNone);
     f.SetSize(3*gBytesPerCluster); // 3 Clusters
     f.Close();
 
     r=f.Replace(TheFs,_L("\\GNOME.TMP"),EFileRead|EFileWrite);
-    test_KErrNone(r);
+    test(r==KErrNone);
     f.SetSize(10*gBytesPerCluster); // 10 Clusters
     f.Close();
 
     r=f.Replace(TheFs,_L("\\CYCLOPS.TMP"),EFileRead|EFileWrite);
-    test_KErrNone(r);
+    test(r==KErrNone);
     f.SetSize(gBytesPerCluster); // 1 Cluster
     f.Close();
 
     r=f.Replace(TheFs,_L("\\PIXIE.TMP"),EFileRead|EFileWrite);
-    test_KErrNone(r);
+    test(r==KErrNone);
     f.SetSize(gBytesPerCluster); // 1 Cluster
     f.Close();
 
     r=TheDisk.Open(TheFs,CurrentDrive());
-    test_KErrNone(r);
+    test(r==KErrNone);
     TPtr8 sectorBuf((TUint8*)pBuffer1->Ptr(),TheBootSector.BytesPerSector());
     TInt pos = gRootDirStart;
     test(TheDisk.Read(pos,sectorBuf)==KErrNone);
@@ -1480,17 +1479,17 @@
     test(name==_L8("PIXIE   TMP"));
 
     r=TheFs.Delete(_L("\\GOBLIN.TMP"));
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheFs.Delete(_L("\\WIZARD.TMP"));
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheFs.Delete(_L("\\TROLL.TMP"));
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheFs.Delete(_L("\\GNOME.TMP"));
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheFs.Delete(_L("\\CYCLOPS.TMP"));
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheFs.Delete(_L("\\PIXIE.TMP"));
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     FormatPack();
 
@@ -1505,7 +1504,7 @@
     test.Printf(_L("Checking cluster %02d, parent %d: \"%S\"\n"), aNewClust, aParentClust, &aName);
 
     TInt r=TheFs.MkDir(aName);
-    test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+    test(r==KErrNone || r==KErrAlreadyExists);
 
     TInt pos=ClusterToByte(aNewClust);
     TPtr8 sectorBuf((TUint8*)pBuffer1->Ptr(),gBytesPerCluster);
@@ -1671,7 +1670,7 @@
         }
 
     r = f.Create(TheFs, _L("\\123456.78"), EFileRead|EFileWrite);
-    test_Value(r, r == KErrDirFull);
+    test(r==KErrDirFull);
     f.Close();
 
 
@@ -1679,22 +1678,22 @@
     for (i=0;i<KMaxFiles;i++)
         {
         r=TheFs.Delete(fileName[i]);
-        test_KErrNone(r);
+        test(r==KErrNone);
         }
 
     r=TheFs.SetSessionPath(_L("\\"));
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     TInt nameLength=(KMaxFiles-1)*13;   // -1 for zero terminator
     CreateLongName(tempName,gSeed,nameLength*2);
     r=f.Create(TheFs,tempName,0);       //  Needs 9 free entries - there are only 5 available
-    test_Value(r, r == KErrDirFull);
+    test(r==KErrDirFull);
     tempName.SetLength(nameLength+1);
     r=f.Create(TheFs,tempName,0);       //  Needs 6 free entries - there are only 5 available
-    test_Value(r, r == KErrDirFull);
+    test(r==KErrDirFull);
     tempName.SetLength(nameLength);
     r=f.Create(TheFs,tempName,0);       //  Needs 5 free entries - there are 5 available
-    test_KErrNone(r);
+    test(r==KErrNone);
     f.Close();
 
 #if 0       // This is the old test that assumed UNICODE builds
@@ -1703,54 +1702,54 @@
     for (i=0;i<KMaxFiles-2;i++)
         {
         r=TheFs.Delete(fileName[i]);    //  UNICODE build - free 6 entries (delete 3 files)
-        test_KErrNone(r);
+        test(r==KErrNone);
         }
 
     r=TheFs.SetSessionPath(_L("\\"));
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     TInt vFatUnitNameSize=13;
     TInt nameLength=(KMaxFiles-1)*vFatUnitNameSize-1;   //
     CreateLongName(tempName,gSeed,nameLength*2);
     r=f.Create(TheFs,tempName,0);                       //  Needs 9 free entries
-    test_Value(r, r == KErrDirFull);
+    test(r==KErrDirFull);
 
     nameLength=(KMaxFiles)*vFatUnitNameSize;
     tempName.SetLength(nameLength+1);
     r=f.Create(TheFs,tempName,0);                       //  Needs 7 free entries
-    test_Value(r, r == KErrDirFull);
+    test(r==KErrDirFull);
     tempName.SetLength(nameLength);
     r=f.Create(TheFs,tempName,0);                       //  Needs 6 free entries
-    test_KErrNone(r);
+    test(r==KErrNone);
     f.Close();
 #endif
 
     TheFs.Delete(tempName);
     tempName.SetLength(nameLength-7);
     r=f.Create(TheFs,tempName,0);
-    test_KErrNone(r);
+    test(r==KErrNone);
     f.Close();
 
     r=f.Create(TheFs,_L("ASDF"),0);
-    test_Value(r, r == KErrDirFull);
+    test(r==KErrDirFull);
 
     TheFs.Delete(tempName);
     tempName.SetLength(nameLength-15);
     r=f.Create(TheFs,tempName,0);
-    test_KErrNone(r);
+    test(r==KErrNone);
     f.Close();
 
     tempName=_L("testname");
     r=f.Create(TheFs,tempName,0);
-    test_Value(r, r == KErrDirFull);
+    test(r==KErrDirFull);
     tempName.UpperCase();
     r=f.Create(TheFs,tempName,0);
-    test_KErrNone(r);
+    test(r==KErrNone);
     f.Close();
 
 
     r=TheFs.SetSessionPath(gSessionPath);
-    test_KErrNone(r);
+    test(r==KErrNone);
     }
 
 static  void TestVolumeSize()
@@ -1763,7 +1762,7 @@
 
     TVolumeInfo volInfo;
     TInt r=TheFs.Volume(volInfo);
-    test_KErrNone(r);
+    test(r==KErrNone);
     TInt64 calcsize = MAKE_TINT64(0, gClusterCount)*gBytesPerCluster;
     if (volInfo.iSize > calcsize)
         {
@@ -1795,7 +1794,7 @@
         fileName=_L("\\File");
         fileName.AppendNum(i);
         r=f[i].Create(TheFs,fileName,0);
-        test_KErrNone(r);
+        test(r==KErrNone);
         }
 
     TInt maxTotalSize=1048576;
@@ -1808,7 +1807,7 @@
             {
             TInt randSize=Math::Rand(gSeed)%maxFileSize;
             r=f[i].SetSize(randSize);
-            test_KErrNone(r);
+            test(r==KErrNone);
             }
         test.Printf(_L("Countdown .. %d   \r"),maxIterations);
         }
@@ -1821,12 +1820,12 @@
         {
         TInt size=0;
         r=f[i].Size(size);
-        test_KErrNone(r);
+        test(r==KErrNone);
         totalSize+=((size+gBytesPerCluster-1)/gBytesPerCluster)*gBytesPerCluster;
         }
 
     r=TheFs.Volume(volInfo);
-    test_KErrNone(r);
+    test(r==KErrNone);
     if (gDiskType == EFat32)
         volInfo.iSize -= gBytesPerCluster; // root dir is part of the 'size'
     if (volInfo.iSize-volInfo.iFree!=totalSize)
@@ -1847,13 +1846,13 @@
         fileName=_L("\\File");
         fileName.AppendNum(i);
         r=TheFs.Delete(fileName);
-        test_KErrNone(r);
+        test(r==KErrNone);
         }
 
     r=TheFs.Volume(volInfo);
     if (gDiskType == EFat32)
         volInfo.iSize -= gBytesPerCluster; // root dir is part of the 'size'
-    test_KErrNone(r);
+    test(r==KErrNone);
     test(volInfo.iSize-volInfo.iFree==0);
 
     MakeDir(gSessionPath);
@@ -1871,7 +1870,7 @@
 
 
     r=TheFs.Volume(volInfo);
-    test_KErrNone(r);
+    test(r==KErrNone);
     if (gDiskType == EFat32)
         volInfo.iSize -= gBytesPerCluster; // root dir is part of the 'size'
     test.Printf(_L("volInfo.iSize = %ld\n"), volInfo.iSize);
@@ -1887,7 +1886,7 @@
     CreateFatEntry(gSessionPath, EFalse);
 
     r=TheFs.Volume(volInfo);
-    test_KErrNone(r);
+    test(r==KErrNone);
     if (gDiskType == EFat32)
         volInfo.iSize -= gBytesPerCluster; // root dir is part of the 'size'
     test.Printf(_L("volInfo.iSize = %ld\n"), volInfo.iSize);
@@ -1901,10 +1900,10 @@
 
     CFileMan* fMan=CFileMan::NewL(TheFs);
     r=fMan->RmDir(gSessionPath);
-    test_KErrNone(r);
+    test(r==KErrNone);
     delete fMan;
     r=TheFs.Volume(volInfo);
-    test_KErrNone(r);
+    test(r==KErrNone);
     if (gDiskType == EFat32)
         volInfo.iSize -= gBytesPerCluster; // root dir is part of the 'size'
     if (volInfo.iSize-volInfo.iFree!=0)
@@ -1936,22 +1935,22 @@
     buffer.Replace(0,11,_L8("TEST1      "));
 
     TInt r=TheDisk.Open(TheFs,CurrentDrive());
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheDisk.Write(pos,buffer);
-    test_KErrNone(r);
+    test(r==KErrNone);
     TheDisk.Close();
 
     r=TheDir.Open(TheFs,_L("\\"),KEntryAttMaskSupported);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheDir.Read(TheEntry);
-    test_KErrNone(r);
+    test(r==KErrNone);
     test(TheEntry.iName==_L("TEST1"));
     r=TheDir.Read(TheEntry);
-    test_Value(r, r == KErrEof);
+    test(r==KErrEof);
     TheDir.Close();
 
     r=TheFs.SetSessionPath(_L("\\"));
-    test_KErrNone(r);
+    test(r==KErrNone);
     TEntry e;
     r=TheFs.Entry(_L("TEST1"),e);
     if(e.iName!=_L("TEST1"))
@@ -1986,9 +1985,9 @@
     TInt r=TheDisk.Open(TheFs,CurrentDrive());
     if (r != KErrNone)
         test.Printf(_L("Error %d opening on %C"), r, (TUint)gDriveToTest);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheDisk.Read(0, boot);
-    test_KErrNone(r);
+    test(r==KErrNone);
     TUint32 val = GetValue(boot, 510, 2);
     RDebug::Print(_L("BPB magic number = 0x%X\n"), val);
     test(aTestOnly || val == 0xAA55);
@@ -2114,7 +2113,7 @@
     for(i=0; i<=20; i++)
         {
         r = TheFile.Write(TheBuffer);
-        test_KErrNone(r);
+        test(r==KErrNone);
         }
 
     TheFile.Close();
@@ -2471,7 +2470,7 @@
             testVal.iSectorsPerCluster,
             testVal.iRootDirEntries);
         TInt r = fatAlignment.AdjustFirstDataSectorAlignment(testVal.iBlockSize);
-        test_KErrNone(r);
+        test (r == KErrNone);
         fatAlignment.Display();
         }
 
@@ -2584,7 +2583,7 @@
 
     TVolumeInfo volInfo;
     r=TheFs.Volume(volInfo);
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     TInt64 spaceToUse = volInfo.iFree - gBytesPerCluster; // whole disk except 1 cluster
 
@@ -2598,42 +2597,42 @@
         {
         TFileName tempName;
         r=f.Temp(TheFs,_L("\\"),tempName,EFileRead|EFileWrite);
-        test_KErrNone(r);
+        test(r==KErrNone);
         r=f.SetSize(K1GigaByte);
-        test_KErrNone(r);
+        test(r==KErrNone);
         f.Close();
         spaceToUse -= K1GigaByte;
         tempfiles++;
         }
 
     r=f.Replace(TheFs,_L("\\USESPACE.TMP"),EFileRead|EFileWrite);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=f.SetSize((TInt)spaceToUse);
-    test_KErrNone(r);
+    test(r==KErrNone);
     f.Close();
 
     r=TheFs.Volume(volInfo);
-    test_KErrNone(r);
+    test(r==KErrNone);
     test.Printf(_L("After fill, volInfo.iSize %ld volInfo.iFree %ld\n"), volInfo.iSize, volInfo.iFree);
 
     test(volInfo.iFree==gBytesPerCluster); // check we have 1 cluster free
 
     r=f.Replace(TheFs,_L("\\FILE.TMP"),EFileRead|EFileWrite);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=f.SetSize(2*gBytesPerCluster); // 2 clusters (will fail since there's not space)
-    test_Value(r, r == KErrDiskFull);
+    test(r==KErrDiskFull);
     f.Close();
 
     r=TheFs.Volume(volInfo);
-    test_KErrNone(r);
+    test(r==KErrNone);
     test(volInfo.iFree==gBytesPerCluster); // check we still have 1 cluster free
 
     r=f.Replace(TheFs,_L("\\USESPACE.TMP"),EFileRead|EFileWrite); // truncate file to 0
-    test_KErrNone(r);
+    test(r==KErrNone);
     f.Close();
 
     r=TheFs.Volume(volInfo);
-    test_KErrNone(r);
+    test(r==KErrNone);
     test(volInfo.iFree==(spaceToUse+gBytesPerCluster)); // check we've freed up the space from USESPACE plus one cluster
 
     
@@ -2643,7 +2642,7 @@
     
     //-- read 1 sector of the root dir.
     r = MediaRawRead(TheFs, CurrentDrive(), rootDirpos, TheBootSector.BytesPerSector(), TheBuffer);
-    test_KErrNone(r);
+    test(r == KErrNone);
 
     const TFatDirEntry* pE=(TFatDirEntry*)TheBuffer.Ptr();
     while (tempfiles-- > 0)
@@ -2690,7 +2689,7 @@
 
     TInt drvNum;
     TInt r=TheFs.CharToDrive(gDriveToTest,drvNum);
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     if (!Is_Fat(TheFs,drvNum))
         {
@@ -2705,7 +2704,7 @@
     // check this is not the internal ram drive
     TVolumeInfo v;
     r=TheFs.Volume(v, drvNum);
-    test_KErrNone(r);
+    test(r==KErrNone);
     TBool isRamDrive = v.iDrive.iMediaAtt&KMediaAttVariableSize;
 
     gSessionPath[0] = (TText)gDriveToTest;
--- a/kerneltest/f32test/filesystem/fat/group/fatfs.inf	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/filesystem/fat/group/fatfs.inf	Wed Sep 01 12:34:56 2010 +0100
@@ -11,7 +11,7 @@
 // Contributors:
 //
 // Description:
-// f32test/filesystem/fat/group/fatfs.inf
+// f32test/group/bld.inf
 // Test code for file server
 // 
 //
@@ -37,7 +37,6 @@
 //b_fat //obsolete
 t_mount
 t_fatcache_bm
-t_raw
+t_raw   
 t_fatcorrupt
-t_nonrugged
 
--- a/kerneltest/f32test/filesystem/fat/group/t_nonrugged.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-// Copyright (c) 2009-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:
-// f32test/filesystem/fat/group/t_nonrugged.mmp
-//
-//
-
-target			t_nonrugged.exe        
-targettype		exe
-sourcepath		..
-source			t_nonrugged.cpp
-source			t_main.cpp
-sourcepath		../../../fileutils/src
-source			fat_utils.cpp f32_test_utils.cpp
-library			euser.lib efsrv.lib hal.lib btracec.lib
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-userinclude		../../../fileutils/inc
-capability		tcb diskadmin allfiles
-vendorid		0x70000001
-
-SMPSAFE
--- a/kerneltest/f32test/filesystem/fat/t_checkdisk.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/filesystem/fat/t_checkdisk.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -562,7 +562,7 @@
 	TInt r = TheFs.Volume(volInfo, gDrive);
 	test_KErrNone(r);
 
-	gMediaSize = volInfo.iFree;
+	gMediaSize = volInfo.iSize;
 	gSmallFileSize = KBlockSize;
 	gBigFileSize = KBlockSize*20;
 	while(((2*gBigFileSize)+KOneMeg) > gMediaSize )
--- a/kerneltest/f32test/filesystem/fat/t_compat32.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/filesystem/fat/t_compat32.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -98,13 +98,13 @@
 
 	RFile file;
 	TInt r=file.Create(TheFs,fileName,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 //	Assume this file is the first entry in the root directory
 
 
 	r=TheDisk.Open(TheFs,CurrentDrive());
-	test_KErrNone(r);
+	test(r==KErrNone);
 
     //-- read 1st dir. entry it can be FAT or VFat , depending on the filename
     const TInt posEntry1=gBootSector.RootDirStartSector() << KDefaultSectorLog2; //-- dir entry1 position
@@ -169,16 +169,16 @@
     TInt r;
 
 	r=file.Replace(TheFs,_L("\\FILE.TMP"),EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(_L8("Hello World"));
 	file.Close();
 
 	r=TheFs.Replace(_L("\\File.tmp"),_L("\\Word"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	CDir* entryCount;
 	r=TheFs.GetDir(_L("\\*.*"),KEntryAttMaskSupported,ESortNone,entryCount);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt count=entryCount->Count();
 
 	test(count==1);
@@ -202,17 +202,17 @@
     DoFiddleWithFileNames(aCase);
 
 	r=file.Create(TheFs,_L("\\TEST"),EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	r=TheFs.Rename(_L("\\TEST"),_L("\\Word"));
-	test_Value(r, r == KErrAlreadyExists);
+	test(r==KErrAlreadyExists);
 	r=TheFs.Delete(_L("\\TEST"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	CDir* entryCount;
 	r=TheFs.GetDir(_L("\\*.*"),KEntryAttMaskSupported,ESortNone,entryCount);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt count=entryCount->Count();
 	test(count==1);
 	delete entryCount;
@@ -241,14 +241,14 @@
     fn.Format(_L("%c:\\\x60\x60\x60.TXT"), (TUint8)gDriveToTest);
 
     r = TheFs.Delete(fn);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 
 	r = file.Create(TheFs, fn, EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	r=TheDisk.Open(TheFs,CurrentDrive());
-	test_KErrNone(r);
+	test(r==KErrNone);
 
     //-- read 1st dir. it should be DOS Entry
     const TInt posEntry1=gBootSector.RootDirStartSector() << KDefaultSectorLog2; //-- dir entry1 position
@@ -261,11 +261,11 @@
     // tests short name
     TFileName sn;
     r = TheFs.GetShortName(fn, sn);
-    test_KErrNone(r);
+    test(r==KErrNone);
     test(sn.Compare(_L("```.TXT"))==0);
 
     r = TheFs.Delete(fn);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
@@ -295,23 +295,23 @@
     TInt drvNum;
 
     r = TheFs.CharToDrive(gDriveToTest,drvNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
     // turn on FatUtilityFunctions
     r = TheFs.ControlIo(drvNum, KControlIoEnableFatUtilityFunctions);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// load cp932 codepage dll
 	r = UserSvr::ChangeLocale(KTestLocale);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
     // create file "\x65B0\x6587\x4EF6", check DOS entry & VFat entry
 	r = file.Create(TheFs, KTestUnicodeFileName, EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	r=TheDisk.Open(TheFs,CurrentDrive());
-	test_KErrNone(r);
+	test(r==KErrNone);
 
     //-- read 1st dir. it should be VFat
 //    const TInt posEntry1=gRootDirStart; //-- dir entry1 position
@@ -339,11 +339,11 @@
     // delete file
     TheDisk.Close();
     r = TheFs.Delete(KTestUnicodeFileName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// turn off FatUtilityFunctions
 	r = TheFs.ControlIo(drvNum, KControlIoDisableFatUtilityFunctions);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 #else
 	test.Printf(_L("Test only runs on DEBUG builds, see test logs of debug builds for details."));
@@ -607,7 +607,7 @@
 
 	TInt drvNum;
 	TInt r=TheFs.CharToDrive(gDriveToTest,drvNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
     if (!Is_Fat(TheFs,drvNum))
 		{
--- a/kerneltest/f32test/filesystem/fat/t_fatcorrupt.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/filesystem/fat/t_fatcorrupt.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -28,7 +28,6 @@
 //! @See EFat and EFat32 components
 //! @file f32test\server\t_fatcorrupt.cpp
 
-#define	__E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32math.h>
@@ -103,9 +102,9 @@
     test.Printf(_L("RestoreEnv()\n"));
 
     TInt r = TheFs.DismountExtension(KExtName, gDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r = TheFs.RemoveExtension(KExtName);
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     if(gExtExists)      // remount existing secondary extension
         {
@@ -115,7 +114,7 @@
 
     //-- We need a full format, because quick format preserves bad sectors marked in FAT
     r = FormatFatDrive(TheFs, gDrive, EFalse);
-    test_KErrNone(r);
+    test(r == KErrNone);
 
     }
 
@@ -127,7 +126,7 @@
     test.Printf(_L("PrepareMountL(), drive:%d \n"),gDrive);
 
     TInt r = TheFs.AddExtension(KExtName);
-    test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+    test(r==KErrNone || r==KErrAlreadyExists);
     r = TheFs.ExtensionName(gExtName,gDrive,0);
     if (r == KErrNone)              // an extension already exists -> dismount it
         {
@@ -139,14 +138,14 @@
             test(TheFs.RemoveExtension(KExtName) == KErrNone);
             return EFalse;
             }
-        test_KErrNone(r);
+        test(r==KErrNone);
         gExtExists=ETrue;
         }
-    test_Value(r, r == KErrNone || r==KErrNotFound);
+    test(r == KErrNone || r==KErrNotFound);
     r = TheFs.MountExtension(KExtName, gDrive);
     if (r != KErrNone)
         test(TheFs.RemoveExtension(KExtName) == KErrNone);
-    test_KErrNone(r);
+    test(r==KErrNone);
     return ETrue;
     }
 
@@ -561,7 +560,7 @@
     RRawDisk rawDisk;
 
     TInt r=rawDisk.Open(TheFs,gSessionPath[0]-'A');
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     //Mark Cluster 2  & 3 as bad
     const TInt fatStartPos = BootSector.FirstFatSector() * BootSector.BytesPerSector();
@@ -574,17 +573,17 @@
     data[3] = 0x0F;
 
     r=rawDisk.Write(pos, data);
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     pos += 4;
     r = rawDisk.Write(pos, data);
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     rawDisk.Close();
 
     //-- quick format the drive
     r = FormatFatDrive(TheFs, gDrive, ETrue);
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     const TUint oldClusterNum = BootSector.RootClusterNum();
     ReadBootSector();
@@ -609,14 +608,14 @@
     WriteVersionNumber();
 
     TInt r = TheFs.FileSystemName(name, gDrive);
-    test_KErrNone(r);
+    test(r == KErrNone);
 
     r = DismountFileSystem(TheFs, name, gDrive);
-    test_KErrNone(r);
+    test(r == KErrNone);
 
     r = MountFileSystem(TheFs, name, gDrive);
 
-    test_Value(r, r == KErrCorrupt);
+    test(r == KErrCorrupt);
 
 }
 
@@ -636,22 +635,22 @@
     // Test quick format
     RFormat formatQuick;
     TInt r = formatQuick.Open(TheFs, gDriveName, EQuickFormat, count);
-    test_KErrNone(r);
+    test(r == KErrNone);
 
     r = DoFormatSteps(formatQuick, count);
-    test_KErrNone(r);
+    test(r == KErrNone);
 
     formatQuick.Close();
 
     ReadBootSector();
     r = TheFs.FileSystemName(name, gDrive);
-    test_KErrNone(r);
+    test(r == KErrNone);
 
     r = DismountFileSystem(TheFs, name, gDrive);
-    test_KErrNone(r);
+    test(r == KErrNone);
 
     r = MountFileSystem(TheFs, name, gDrive);
-    test_KErrNone(r);
+    test(r == KErrNone);
 
 }
 
@@ -735,10 +734,10 @@
 
     //Mini SD cards works properly only with ESpecialFormat. Fix for Defect DEF091659
     TInt r = formatFull.Open(TheFs, gDriveName, ESpecialFormat, count);
-    test_KErrNone(r);
+    test(r == KErrNone);
 
     r = DoFormatSteps(formatFull, count);
-    test_KErrNone(r);
+    test(r == KErrNone);
 
     formatFull.Close();
 
@@ -763,7 +762,7 @@
     // Only test FAT filesystem
     TInt r;
     r = TheFs.CharToDrive(gDriveToTest, gDrive);
-    test_KErrNone(r);
+    test(r == KErrNone);
     gDriveName[0] = (TText)gDriveToTest;
     gDriveName[1] = ':';
 
@@ -782,7 +781,7 @@
     // No need for variable size disk
     TDriveInfo info;
     r = TheFs.Drive(info, gDrive);
-    test_KErrNone(r);
+    test(r == KErrNone);
     if (info.iMediaAtt & KMediaAttVariableSize)
         {
         test.Printf(_L("Drive %d is variable-size disk, skip\n"),gDrive);
--- a/kerneltest/f32test/filesystem/fat/t_mount.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/filesystem/fat/t_mount.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -629,12 +629,12 @@
     bDriveFinalised = DoCheckVolumeFinalised(gDriveNum);
     test(!bDriveFinalised); //-- the volume has become "unfinalised"
 
-    //-- 2.1 open a file, try to finalise; This should be OK
+    //-- 2.1 open a file, try to finalise; Shall dail with KErrInUse
     nRes = file.Replace(TheFs, KFileName, EFileWrite | EFileRead);
     test_KErrNone(nRes);
 
     nRes =TheFs.FinaliseDrive(gDriveNum, RFs::EFinal_RW);
-    test_KErrNone(nRes);
+    test(nRes==KErrInUse); //-- can't finalise drives with opened objects
 
     file.Close();
 
@@ -1274,6 +1274,7 @@
     PrintDrvInfo(TheFs, gDriveNum);
     InitGlobals();
 
+
     TestNotifyDiskSpace();
 
     //-------------------------------------
--- a/kerneltest/f32test/filesystem/fat/t_nonrugged.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,295 +0,0 @@
-// Copyright (c) 2009-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:
-// f32test\filesystem\fat\t_nonrugged.cpp
-// Functional tests for the non-Rugged file mode (also called the File Sequential mode)
-// Only perform tests on the Rugged FAT file system
-//
-
-#define __E32TEST_EXTENSION__
-
-#include <f32file.h>
-#include <e32test.h>
-
-#include "t_server.h"
-#include "fat_utils.h"
-using namespace Fat_Test_Utils;
-
-
-RTest test(_L("T_NONRUGGED"));
-
-TInt gDriveNum;
-
-_LIT(KTestPath, ":\\F32-TST\\T_NONRUGGED\\");	// 22
-
-
-enum TNonRuggedFileMode
-	{
-	ENormalFileMode,	// File is in normal (Rugged) mode
-	ENonRuggedFileMode	// File is in non-Rugged file mode (EFileSequential)
-	};
-
-enum TNonRuggedControlIO
-/*
- * ControlIo enum values
- */
-    {
-    EControlIOIsRuggedFSys		= 4,			// Defined as EIsRuggedFSys in \fileserver\sfat32\common_constants.h
-    EControlIOIsFileSequential	= KMaxTInt-23	// Defined as KControlIoIsFileSequential in \fileserver\inc\f32dbg.h
-    };
-
-
-void CreateFile(RFile& aFile, const TDesC& aPath, TUint aFileMode)
-/*
- * Creates/opens a file in Rugged/non-Rugged mode after emptying the trace buffer
- */
-	{
-	TInt r = TheFs.MkDirAll(aPath);
-	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
-	r = aFile.Replace(TheFs, aPath, aFileMode);
-	test_KErrNone(r);
-	}
-
-
-void DeleteFileAndDir(const TDesC& aPath)
-/*
- * Deletes a single file and the directory containing it
- */
-	{
-	TInt r = TheFs.Delete(aPath);
-	test_KErrNone(r);
-	r = TheFs.RmDir(aPath);
-	test_KErrNone(r);
-	}
-
-
-void SingleClientTest()
-/*
- * Unit test for Non-Rugged File mode with a single client
-	 ***********************************************************************************
-	 * 1. Create a file in non-Rugged file mode and then close the file.
-	 * 2. Open the file in normal Rugged file mode and then close it.
-	 * 3. Open the file in non-Rugged file mode again and then close it.
-	 * Expected Results:
-	 * 1. File is in non-Rugged file mode.
-	 * 2. File is in normal Rugged file mode.
-	 * 3. File is in non-Rugged file mode.
-	 ***********************************************************************************
- */
-	{
-	test.Next(_L("Test single client"));
-
-	TBuf<34> singleFile;
-	singleFile.Append(gDriveToTest);		//  1
-	singleFile.Append(KTestPath);			// 22
-	singleFile.Append(_L("file.single"));	// 11
-	TInt r = TheFs.Delete(singleFile);
-	test_Value(r, r == KErrNone || r == KErrNotFound || r == KErrPathNotFound);
-	TBuf8<KMaxPath> singleFilePkg;
-	singleFilePkg.Copy(singleFile.Mid(2));
-	TUint8 fileMode = 0;
-	TPtr8 fileModePkg(&fileMode, 1, 1);
-
-	test.Printf(_L("Create file in non-Rugged file mode\n"));
-	RFile file;
-	CreateFile(file, singleFile, (EFileWrite | EFileSequential));
-	r = TheFs.ControlIo(gDriveNum, EControlIOIsFileSequential, singleFilePkg, fileModePkg);
-	test_KErrNone(r);
-	test_Equal(ENonRuggedFileMode, fileMode);
-	file.Close();
-
-	test.Printf(_L("Open file in normal mode\n"));
-	CreateFile(file, singleFile, EFileWrite);
-	r = TheFs.ControlIo(gDriveNum, EControlIOIsFileSequential, singleFilePkg, fileModePkg);
-	test_KErrNone(r);
-	test_Equal(ENormalFileMode, fileMode);
-	file.Close();
-
-	test.Printf(_L("Open file in non-Rugged file mode again\n"));
-	CreateFile(file, singleFile, (EFileWrite | EFileSequential));
-	r = TheFs.ControlIo(gDriveNum, EControlIOIsFileSequential, singleFilePkg, fileModePkg);
-	test_KErrNone(r);
-	test_Equal(ENonRuggedFileMode, fileMode);
-	file.Close();
-
-	DeleteFileAndDir(singleFile);
-	}
-
-
-void MultipleClientsTest()
-/*
- * Unit tests for Non-Rugged File mode with multiple clients accessing the same file
- */
-	{
-	/***********************************************************************************
-	 * Use Case 1:
-	 * 1. Client1 opens a file in non-Rugged file mode.
-	 * 2. Client2 then opens the same file in normal Rugged file mode.
-	 * Expected Results:
-	 * 1. File is in non-Rugged file mode.
-	 * 2. File changed to normal Rugged file mode.
-	 ***********************************************************************************
-	 */
-	test.Next(_L("Test multiple clients - Use case 1"));
-
-	TBuf<33> fileName1;
-	fileName1.Append(gDriveToTest);		//  1
-	fileName1.Append(KTestPath);		// 22
-	fileName1.Append(_L("file1.mult"));	// 10
-	TInt r = TheFs.Delete(fileName1);
-	test_Value(r, r == KErrNone || r == KErrNotFound || r == KErrPathNotFound);
-	TBuf8<31> fileName1Pkg;
-	fileName1Pkg.Copy(fileName1.Mid(2));
-	TUint8 fileMode = 0;
-	TPtr8 fileModePkg(&fileMode, 1, 1);
-
-
-	// Use Case 1.1, Client 1 (Non-Rugged Client) ------------------------------------
-	test.Printf(_L("Client1 create file in non-Rugged file mode\n"));
-
-	RFile file1;
-	CreateFile(file1, fileName1, (EFileWrite | EFileSequential | EFileShareAny));
-	r = TheFs.ControlIo(gDriveNum, EControlIOIsFileSequential, fileName1Pkg, fileModePkg);
-	test_KErrNone(r);
-	test_Equal(ENonRuggedFileMode, fileMode);
-
-
-	// Use Case 1.2, Client 2 (Rugged Client) ----------------------------------------
-	test.Printf(_L("Client2 open file in 'normal' Rugged file mode\n"));
-
-	RFile file2;
-	CreateFile(file2, fileName1, (EFileWrite | EFileShareAny));
-	r = TheFs.ControlIo(gDriveNum, EControlIOIsFileSequential, fileName1Pkg, fileModePkg);
-	test_KErrNone(r);
-	test_Equal(ENormalFileMode, fileMode);
-
-
-	file1.Close();
-	file2.Close();
-	r = TheFs.Delete(fileName1);
-	test_KErrNone(r);
-
-
-	/***********************************************************************************
-	 * Use Case 2:
-	 * 1. Client1 opens a file in normal Rugged file mode.
-	 * 2. Client2 then opens the same file in non-Rugged file mode.
-	 * Expected Results:
-	 * 1. File is in normal Rugged file mode.
-	 * 2. File does not change to non-Rugged file mode.
-	 ***********************************************************************************
-	 */
-	test.Next(_L("Test multiple clients - Use case 2"));
-
-	TBuf<34> fileName2;
-	fileName2.Append(gDriveToTest);		//  1
-	fileName2.Append(KTestPath);		// 22
-	fileName2.Append(_L("file2.mult"));	// 10
-	r = TheFs.Delete(fileName2);
-	test_Value(r, r == KErrNone || r == KErrNotFound || r == KErrPathNotFound);
-	TBuf8<KMaxPath> fileName2Pkg;
-	fileName2Pkg.Copy(fileName2.Mid(2));
-
-
-	// Use Case 2.1, Client 1 (Rugged Client) ----------------------------------------
-	test.Printf(_L("Client1 create file in 'normal' Rugged file mode\n"));
-
-	CreateFile(file1, fileName2, (EFileWrite | EFileShareAny));
-	r = TheFs.ControlIo(gDriveNum, EControlIOIsFileSequential, fileName2Pkg, fileModePkg);
-	test_KErrNone(r);
-	test_Equal(ENormalFileMode, fileMode);
-
-
-	// Use Case 2.2, Client 2 (Non-Rugged Client) ------------------------------------
-	test.Printf(_L("Client2 open file in non-Rugged file mode\n"));
-
-	CreateFile(file2, fileName2, (EFileWrite | EFileSequential | EFileShareAny));
-	r = TheFs.ControlIo(gDriveNum, EControlIOIsFileSequential, fileName2Pkg, fileModePkg);
-	test_KErrNone(r);
-	test_Equal(ENormalFileMode, fileMode);
-
-
-	file1.Close();
-	file2.Close();
-	DeleteFileAndDir(fileName2);
-	}
-
-
-
-void CallTestsL()
-/*
- * Start point of T_NONRUGGED
- */
-	{
-#ifndef _DEBUG
-    test.Printf(_L("T_NONRUGGED skipped. To run only on debug builds.\n"));
-    return;
-#else
-    
-	TInt r = TheFs.CharToDrive(gDriveToTest, gDriveNum);
-	test_KErrNone(r);
-	
-	// Currently only FAT file system supports Rugged drive
-    if (!Is_Fat(TheFs, gDriveNum))
-		{
-		test.Printf(_L("T_NONRUGGED skipped. Requires FAT filesystem to run.\n"));
-		return;
-		}
-
-// Use this to set filesystem to Rugged if it is not set as such
-#if(0)
-	{
-	// Ensure that the FAT filesystem is Rugged
-	TUint8 ruggedVal = 0;
-	TPtr8 ruggedPkg(&ruggedVal, 1, 1);
-	r = TheFs.ControlIo(gDriveNum, EControlIOIsRuggedFSys, ruggedPkg);
-	test_KErrNone(r);
-	if (!ruggedVal)
-		{
-		r = TheFs.ControlIo(gDriveNumber, KControlIoRuggedOn);
-		test_KErrNone(r);
-		}
-	}
-#endif
-	
-    // Test to run only on a rugged FAT drive
-    TUint8 ruggedVal = 0;
-    TPtr8 ruggedPkg(&ruggedVal, 1, 1);
-    r = TheFs.ControlIo(gDriveNum, EControlIOIsRuggedFSys, ruggedPkg);
-    test_KErrNone(r);
-    if (!ruggedVal)
-    	{
-		test.Printf(_L("T_NONRUGGED skipped. Requires Rugged FAT to run.\n"));
-		return;
-    	}
-
-	test.Start(_L("T_NONRUGGED Test Start"));
-	
-	// Run tests
-	SingleClientTest();
-	MultipleClientsTest();
-	
-// Use this to unset filesystem to non-Rugged if it has been set above
-#if(0)
-	// Set filesystem back to non-Rugged
-	if (!ruggedVal)
-		{
-		r = TheFs.ControlIo(gDriveNumber, KControlIoRuggedOff);
-		test_KErrNone(r);
-		}
-#endif
-	
-	test.End();
-	test.Close();
-#endif
-	}
--- a/kerneltest/f32test/filesystem/fat/t_raw.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/filesystem/fat/t_raw.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -39,12 +39,12 @@
 	test.Start(_L("Test all methods"));
 	RRawDisk rd;
 	TInt r=rd.Open(TheFs,gDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf8<16> buf;
 	r=rd.Read(0,buf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=rd.Write(0,buf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	rd.Close();
 	test.End();
 	}
@@ -60,49 +60,49 @@
 
 	RFile f;
 	TInt r=f.Open(TheFs,_L("TRAW.TST"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RRawDisk rd;
 	r=rd.Open(TheFs,gDrive);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	f.Close();
 	r=rd.Open(TheFs,gDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	rd.Close();
 
 	TFileName fileName;
 	r=f.Temp(TheFs,_L(""),fileName,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=rd.Open(TheFs,gDrive);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	f.Close();
 	r=rd.Open(TheFs,gDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	rd.Close();
 
 	RDir d;
 	r=d.Open(TheFs,_L("TRAWTEST"),KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=rd.Open(TheFs,gDrive);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	d.Close();
 	r=rd.Open(TheFs,gDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	rd.Close();
 
     RFormat fmt;
     TInt count;
     r=fmt.Open(TheFs,gSessionPath,EQuickFormat,count);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=rd.Open(TheFs,gDrive); // Raw disk access ok during formatting
     test.Printf(_L("open rd when fmt opn r=%d"),r);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
     fmt.Close();
     r=rd.Open(TheFs,gDrive);
 	test.Printf(_L("open rd when fmt closed r=%d"),r);
-    test_KErrNone(r);
+    test(r==KErrNone);
 	RRawDisk rd2;
 	r=rd2.Open(TheFs,gDrive);	//should only have one Raw object open
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	rd2.Close();
     rd.Close();
 	}
@@ -118,34 +118,34 @@
 
 	RRawDisk rd;
 	TInt r=rd.Open(TheFs,gDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RFile f;
 	TFileName fileName;
 	r=f.Open(TheFs,_L("TRAW.TST"),EFileWrite);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=f.Temp(TheFs,_L(""),fileName,EFileWrite);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 
 	RDir d;
 	r=d.Open(TheFs,_L("TRAW"),KEntryAttNormal);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 
 	RFormat fmt;
 	TInt count;
 	r=fmt.Open(TheFs,gSessionPath,EQuickFormat,count);
     if (r != KErrInUse)
         test.Printf(_L("Error %d. Sess = %S"), r, &gSessionPath);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 
 	CDir* dir=(CDir*)0x05;
 	r=TheFs.GetDir(_L("\\F32-TST\\*.*"),KEntryAttNormal,ESortNone,dir);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	test(dir==NULL);
 
 	RRawDisk rd2;
 	r=rd2.Open(TheFs,gDrive);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 
 //	fmt.Close();
 	rd.Close();
@@ -163,7 +163,7 @@
 
 	RRawDisk rd;
 	TInt r=rd.Open(TheFs,gDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TBuf8<32> textBuf;
 	TInt64 pos=0;
@@ -190,14 +190,14 @@
 
 	TBuf8<32> contents2=_L8("This File says MOO");
 	r=rd.Write(pos,contents2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	rd.Close();
 
 	RFile f;
 	r=f.Open(TheFs,_L("TRAW.TST"),EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Read(textBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(textBuf==contents2);
 	f.Close();
 	}
@@ -260,7 +260,7 @@
 
 	RThread thread;
 	TInt r=thread.Create(_L("MyThread"),MyThreadFunction,0x1000,0x1000,0x1000,(TAny*)EThreadForgetToCloseSession);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TRequestStatus reqStat;
 	thread.Logon(reqStat);
 	thread.Resume();
@@ -274,11 +274,11 @@
 
 	RFile f;
 	r=f.Open(TheFs,_L("TEST.FILE"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 
 	r=thread.Create(_L("MyThread"),MyThreadFunction,0x1000,0x1000,0x1000,(TAny*)EThreadForgetToCloseRaw);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread.Logon(reqStat);
 	thread.Resume();
 	User::WaitForRequest(reqStat);
@@ -290,19 +290,19 @@
 	FsBarrier();
 
 	r=f.Open(TheFs,_L("TEST.FILE"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 
 	r=gSemaphore.CreateGlobal(_L("MySemaphore"),0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=thread.Create(_L("MyThread"),MyThreadFunction,0x1000,0x1000,0x1000,(TAny*)EThreadHang);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread.Resume();
 	gSemaphore.Wait();
 	gSemaphore.Close();
 
 	r=f.Open(TheFs,_L("TEST.FILE"),EFileWrite);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	TBool jit = User::JustInTime();
 	User::SetJustInTime(EFalse);
 	thread.Kill(KErrGeneral);
@@ -315,7 +315,7 @@
 	FsBarrier();
 
 	r=f.Open(TheFs,_L("TEST.FILE"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 	}
 
@@ -330,7 +330,7 @@
     Fat_Test_Utils::SetConsole(test.Console());
 
 	TInt r=TheFs.CharToDrive(gSessionPath[0],gDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
     PrintDrvInfo(TheFs, gDrive);
 
--- a/kerneltest/f32test/filesystem/fat/t_scn32dr1.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/filesystem/fat/t_scn32dr1.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -11,11 +11,9 @@
 // Contributors:
 //
 // Description:
-// f32test\filesystem\fat\t_scn32dr1.cpp
-// Tests that ScanDrive fixes known errors to a Rugged FAT drive
+// f32test\scndrv\t_scn32dr1.cpp
 //
-
-#define __E32TEST_EXTENSION__
+//
 
 #include <f32file.h>
 #include <e32test.h>
@@ -264,10 +262,10 @@
         {
         pos += BootSector.ReservedSectors() * BootSector.BytesPerSector();
         TInt r=TheRawDisk.Open(TheFs,gSessionPath[0]-'A');
-        test_KErrNone(r);
+        test(r==KErrNone);
         TPtr8 buf(&data[0], 4);
         r=TheRawDisk.Read(pos, buf);
-        test_KErrNone(r);
+        test(r==KErrNone);
         TheRawDisk.Close();
         }
 
@@ -292,7 +290,7 @@
     return val;
     }
 
-LOCAL_C void WriteToFatBuf(TInt aFatIndex,TInt aValue,const TUint8* aFat)
+LOCAL_C void WriteFat(TInt aFatIndex,TInt aValue,const TUint8* aFat)
 //
 // Write a value to both fats starting at aFat
 //
@@ -346,7 +344,7 @@
     {
 
     TInt nRes = ReadBootSector(TheFs, CurrentDrive(), KBootSectorNum<<KDefaultSectorLog2, BootSector);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     if(!BootSector.IsValid())
         {
@@ -710,12 +708,12 @@
     if (aStart < 2 && gDiskType != EFat32)
         {
         HBufC8* buf=HBufC8::New(BootSector.RootDirEntries() * KSizeOfFatDirEntry);
-        test_NotNull(buf);
+        test(buf != NULL);
         TPtr8 ptr=buf->Des();
         TInt r=TheRawDisk.Open(TheFs,gSessionPath[0]-'A');
-        test_KErrNone(r);
+        test(r==KErrNone);
         r=TheRawDisk.Read(gRootDirStart, ptr);
-        test_KErrNone(r);
+        test(r==KErrNone);
         TheRawDisk.Close();
         DumpRootDir(buf->Ptr());
         delete(buf);
@@ -726,12 +724,12 @@
         if (GetFatEntry(cluster, aFat) != 0)
             {
             HBufC8* buf=HBufC8::New(gBytesPerCluster);
-            test_NotNull(buf);
+            test(buf!=NULL);
             TPtr8 ptr=buf->Des();
             TInt r=TheRawDisk.Open(TheFs,gSessionPath[0]-'A');
-            test_KErrNone(r);
+            test(r==KErrNone);
             r=TheRawDisk.Read(ClusterToByte(cluster), ptr);
-            test_KErrNone(r);
+            test(r==KErrNone);
             TheRawDisk.Close();
             RDebug::Print(_L("Cluster %d @ 0x%08X:"), cluster, ClusterToByte(cluster));
             DumpDirCluster(ptr.Ptr());
@@ -800,12 +798,12 @@
 //
     {
     HBufC8* buf=HBufC8::New(gBytesPerCluster*2);
-    test_NotNull(buf);
+    test(buf!=NULL);
     TPtr8 ptr=buf->Des();
     TInt r=TheRawDisk.Open(TheFs,gSessionPath[0]-'A');
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheRawDisk.Read(ClusterToByte(aCluster), ptr);
-    test_KErrNone(r);
+    test(r==KErrNone);
     TheRawDisk.Close();
     RDebug::Print(_L("Cluster %d @ 0x%08X:"), aCluster, ClusterToByte(aCluster));
     TFatDirEntry* d = (TFatDirEntry*)ptr.Ptr() + aEntry;
@@ -843,7 +841,7 @@
     nRes = FormatFatDrive(TheFs, CurrentDrive(), ETrue);
 #endif
 
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     }
 
@@ -861,7 +859,7 @@
         num[0] = TText(aDepth % 26 + 'A');
         aDir+=num;
         r=TheFs.MkDir(aDir);
-        test_KErrNone(r);
+        test(r==KErrNone);
         }
     }
 
@@ -874,7 +872,7 @@
     while(aDepth--)
         {
         r=TheFs.RmDir(aDir);
-        test_KErrNone(r);
+        test(r==KErrNone);
         aDir.SetLength(aDir.Length()-2);
         }
     }
@@ -891,7 +889,7 @@
     aDir2=aDir1;
     aDir2+=_L("a\\");
     TInt r=TheFs.MkDir(aDir2);
-    test_KErrNone(r);
+    test(r==KErrNone);
     // create dir with depth of 126 directories - one short of max depth
     CreateDeepDir(aDir1,101);
     // create dir with depth of 90
@@ -905,7 +903,7 @@
     {
     DeleteDeepDir(aDir2,64);
     TInt r=TheFs.RmDir(aDir2);
-    test_KErrNone(r);
+    test(r==KErrNone);
     aDir2.SetLength(aDir2.Length()-2);
     DeleteDeepDir(aDir1,102);
     DeleteDeepDir(aDir1,24);
@@ -939,7 +937,7 @@
         aLong[len+1] = TText(count%26 + 'A');
         count++;
         TInt r=temp.Create(TheFs,aLong,EFileShareAny);
-        test_KErrNone(r);
+        test(r==KErrNone);
         temp.Close();
         }
     }
@@ -958,7 +956,7 @@
         aLong[len+1] = TText(count%26 + 'A');
         count++;
         TInt r=TheFs.Delete(aLong);
-        test_Value(r, r==KErrNone || r==KErrNotFound);
+        test(r==KErrNone || r==KErrNotFound);
         }
     }
 
@@ -980,7 +978,7 @@
         name[2]=(TUint16)(count/26%26+'a');
         name[3]=(TUint16)(count%26+'a');
         r=TheFs.Delete(name);
-        test_Value(r, r==KErrNone || r==KErrNotFound);
+        test(r==KErrNone || r==KErrNotFound);
         ++count;
         }
     }
@@ -1004,7 +1002,7 @@
         name[2]=(TUint16)(count/26%26+'a');
         name[3]=(TUint16)(count%26+'a');
         r=f.Create(TheFs, name, EFileWrite);
-        test_KErrNone(r);
+        test(r==KErrNone);
         f.Close();
         ++count;
         }
@@ -1026,7 +1024,7 @@
         dir[1]=(TUint16)(count/26+'a');
         dir[2]=(TUint16)(count%26+'a');
         r=TheFs.MkDir(dir);
-        test_KErrNone(r);
+        test(r==KErrNone);
         entriesSoFar+=2;
         ++count;
         }
@@ -1046,7 +1044,7 @@
         dir[1]=TUint16(count/26+'a');
         dir[2]=TUint16(count%26+'a');
         r=TheFs.RmDir(dir);
-        test_KErrNone(r);
+        test(r==KErrNone);
         entriesSoFar-=2;
         ++count;
         }
@@ -1059,27 +1057,27 @@
     {
     test.Next(_L("Delete Directory Structure"));
     TInt r=TheFs.RmDir(_L("\\scndrv\\dir2\\almostfull\\"));
-    test_KErrNone(r);
+    test(r==KErrNone);
     TInt entriesNeeded=(gEntriesPerCluster-2) / 2;  //7*2entries + . + .. = full sector
     for (TInt i = 0; i < entriesNeeded; i++)
         {
         TFileName file=_L("\\scndrv\\dir2\\full\\__a");
         file.AppendNum(i);
         r=TheFs.Delete(file);
-        test_Value(r, r==KErrNone||r==KErrNotFound);
+        test(r==KErrNone||r==KErrNotFound);
         }
     r=TheFs.RmDir(_L("\\scndrv\\dir2\\full\\"));
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheFs.RmDir(_L("\\scndrv\\dir2\\"));
-    test_KErrNone(r);
+    test(r==KErrNone);
     TFileName veryLongName=(_L("\\scndrv\\dir1\\"));
     MakeVeryLongName(veryLongName);
     r=TheFs.Delete(veryLongName);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheFs.RmDir(_L("\\scndrv\\dir1\\"));
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheFs.RmDir(_L("\\scndrv\\"));
-    test_KErrNone(r);
+    test(r==KErrNone);
     }
 
 LOCAL_C void CreateDirectoryStructure()
@@ -1090,34 +1088,34 @@
     test.Next(_L("Create Directory Structure"));
     // cluster 3 (root dir is cluster 2)
     TInt r=TheFs.MkDir(_L("\\scndrv\\"));
-    test_KErrNone(r);
+    test(r==KErrNone);
     // cluster 4
     r=TheFs.MkDir(_L("\\scndrv\\dir1\\"));
-    test_KErrNone(r);
+    test(r==KErrNone);
     TFileName veryLongName=(_L("\\scndrv\\dir1\\"));
     MakeVeryLongName(veryLongName);
     RFile f;
     // cluster 5
     r=f.Create(TheFs,veryLongName,EFileShareAny);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=f.SetSize(512);
-    test_KErrNone(r);
+    test(r==KErrNone);
     f.Close();
     // cluster 6
     r=TheFs.MkDir(_L("\\scndrv\\dir2\\"));
-    test_KErrNone(r);
+    test(r==KErrNone);
     // cluster 7
     r=TheFs.MkDir(_L("\\scndrv\\dir2\\full\\"));
-    test_KErrNone(r);
+    test(r==KErrNone);
     // cluster 8
     r=TheFs.MkDir(_L("\\scndrv\\dir2\\somedirwith3entries\\"));
-    test_KErrNone(r);
+    test(r==KErrNone);
     // cluster 9
     r=TheFs.MkDir(_L("\\scndrv\\dir2\\somedir2with3entries\\"));
-    test_KErrNone(r);
+    test(r==KErrNone);
     // cluster 10
     r=TheFs.MkDir(_L("\\scndrv\\dir2\\almostfull\\"));
-    test_KErrNone(r);
+    test(r==KErrNone);
     // cluster 11-17
     TInt entriesNeeded=(gEntriesPerCluster-2) / 2;  //7*2entries + . + .. = full sector
     for (TInt i = 0; i < entriesNeeded; i++)
@@ -1126,11 +1124,11 @@
         file.AppendNum(i);
         LastInFull = file;
         r=f.Create(TheFs,file,EFileShareAny);
-        test_KErrNone(r);
+        test(r==KErrNone);
         if (i < 7)
             {
             r=f.SetSize(512);
-            test_KErrNone(r);
+            test(r==KErrNone);
             }
         f.Close();
         }
@@ -1146,14 +1144,14 @@
     file1.AppendNum(1);
     file2.AppendNum(2);
     r=f.Create(TheFs,file1,EFileShareAny);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=f.SetSize(512);
-    test_KErrNone(r);
+    test(r==KErrNone);
     f.Close();
     r=f.Create(TheFs,file2,EFileShareAny);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=f.SetSize(512);
-    test_KErrNone(r);
+    test(r==KErrNone);
     f.Close();
     }
 
@@ -1179,16 +1177,16 @@
         // contains aOffset
         ExtBufLen = 2 * gBytesPerCluster;
         ExtBufPtr = HBufC8::New(ExtBufLen);
-        test_NotNull(ExtBufPtr);
+        test(ExtBufPtr != NULL);
         // read the clusters in
         ExtBufAdd = aOffset - aOffset % gBytesPerCluster;
         TInt clust = (ExtBufAdd - (gDataStartBytes - gRootDirStart)) /gBytesPerCluster + 2;
         RDebug::Print(_L("Extension buffer for cluster %d allocated"), clust);
         TInt r=TheRawDisk.Open(TheFs,gSessionPath[0]-'A');
-        test_KErrNone(r);
+        test(r==KErrNone);
         TPtr8 des(ExtBufPtr->Des());
         r=TheRawDisk.Read(gRootDirStart + ExtBufAdd, des);
-        test_KErrNone(r);
+        test(r==KErrNone);
         TheRawDisk.Close();
         }
     // convert to offset in the extension buffer
@@ -1223,10 +1221,10 @@
 // reads directory section of disk into buffer
 //
     {
-    test_Value(aCluster, aCluster != 1);
+    test(aCluster != 1);
 
     TInt r=TheRawDisk.Open(TheFs,gSessionPath[0]-'A');
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     if (aCluster == -1) // all clusters ?
         {
@@ -1247,7 +1245,7 @@
         r=TheRawDisk.Read(gRootDirStart + pos, dirPtr);
         }
 
-    test_KErrNone(r);
+    test(r==KErrNone);
     TheRawDisk.Close();
     }
 
@@ -1257,21 +1255,21 @@
 //
     {
     TInt r=TheRawDisk.Open(TheFs,gSessionPath[0]-'A');
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheRawDisk.Read(gFatStartBytes, aFatBuf);
-    test_KErrNone(r);
+    test(r==KErrNone);
     TheRawDisk.Close();
     }
 
-LOCAL_C void WriteDirEntryToDisk(TDes8& aDirBuf, TInt aCluster = -1)
+LOCAL_C void WriteDirDisk(TDes8& aDirBuf, TInt aCluster = -1)
 //
-// writes dir entry buffer to disk
+// writes dir buffer to disk
 //
     {
-	test_Value(aCluster, aCluster != 1);
+    test(aCluster != 1);
 
     TInt r=TheRawDisk.Open(TheFs,gSessionPath[0]-'A');
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     if (aCluster == -1)
         {
@@ -1292,29 +1290,29 @@
         r=TheRawDisk.Write(gRootDirStart + pos, dirPtr);
         }
 
-    test_KErrNone(r);
+    test(r==KErrNone);
     if (ExtBufPtr)
         {
         TPtr8 des(ExtBufPtr->Des());
         r=TheRawDisk.Write(gRootDirStart + ExtBufAdd, des);
-        test_KErrNone(r);
+        test(r==KErrNone);
         }
     TheRawDisk.Close();
     }
 
-LOCAL_C void WriteFatToDisk(TDes8& aFatBuf, TInt aStart=0)
+LOCAL_C void WriteFatDisk(TDes8& aFatBuf, TInt aStart=0)
 //
 // writes fat buffer to disk
 //
     {
     TInt r=TheRawDisk.Open(TheFs,gSessionPath[0]-'A');
-    test_KErrNone(r);
+    test(r==KErrNone);
     TInt fatCount=BootSector.NumberOfFats() - aStart;
     TInt pos = gFatStartBytes + aStart * gFatSizeSectors*BootSector.BytesPerSector();
     while(fatCount--)
         {
         r=TheRawDisk.Write(pos, aFatBuf);
-        test_KErrNone(r);
+        test(r==KErrNone);
         pos += gFatSizeSectors*BootSector.BytesPerSector();
         }
     TheRawDisk.Close();
@@ -1371,15 +1369,15 @@
         gFatTestEntries = KMaxFatSize;
     gFatTestSize = PosInBytes(gFatTestEntries);
     FatBufPtr=HBufC8::New(gFatTestSize);
-    test_NotNull(FatBufPtr);
+    test(FatBufPtr!=NULL);
     DirBufPtr=HBufC8::New(DirBufferSize());
-    test_NotNull(DirBufPtr);
+    test(DirBufPtr!=NULL);
 
     // Buffers for reading from disk
     FatDiskPtr=HBufC8::New(gFatTestSize);
-    test_NotNull(FatDiskPtr);
+    test(FatDiskPtr!=NULL);
     DirDiskPtr=HBufC8::New(DirBufferSize());
-    test_NotNull(DirDiskPtr);
+    test(DirDiskPtr!=NULL);
     }
 
 LOCAL_C TBool IsSameAsDrive(const TDes8& aFatBuf,const TDes8& aDirBuf)
@@ -1466,12 +1464,12 @@
     else if (ExtBufPtr)
         {
         HBufC8* extPtr = HBufC8::New(ExtBufLen);
-        test_NotNull(extPtr);
+        test(extPtr != NULL);
         TInt r=TheRawDisk.Open(TheFs,gSessionPath[0]-'A');
-        test_KErrNone(r);
+        test(r==KErrNone);
         TPtr8 des(extPtr->Des());
         r=TheRawDisk.Read(ExtBufAdd+gRootDirStart, des);
-        test_KErrNone(r);
+        test(r==KErrNone);
         TheRawDisk.Close();
         TInt i = FindUnMatch(ExtBufPtr->Ptr(), extPtr->Ptr(), ExtBufLen);
         if (i >= 0)
@@ -1520,7 +1518,7 @@
     if(aAddEOfDir)
         WriteEndOfDir(aTrg.iBytePos+aTrg.iLength*KSizeOfFatDirEntry);
     TPtr8 dirBuf=DirBufPtr->Des();
-    WriteDirEntryToDisk(dirBuf);
+    WriteDirDisk(dirBuf);
     }
 
 LOCAL_C TBool TestPartialEntry(TEntryInfo aEntry)
@@ -1530,7 +1528,7 @@
     {
     test.Next(_L("TestPartialEntry"));
     TInt r=TheFs.ScanDrive(gSessionPath);
-    test_KErrNone(r);
+    test(r==KErrNone);
     WriteDelete(aEntry.iBytePos,aEntry.iLength);
 
     TPtr8 fatBuf=FatBufPtr->Des();
@@ -1553,7 +1551,7 @@
     if(aAddEOfDir)
         WriteEndOfDir(aTrg.iBytePos+aTrg.iLength*KSizeOfFatDirEntry);
     TPtr8 dirBuf=DirBufPtr->Des();
-    WriteDirEntryToDisk(dirBuf);
+    WriteDirDisk(dirBuf);
     }
 
 LOCAL_C TBool TestMatchingEntry(TEntryInfo aToDelete)
@@ -1564,7 +1562,7 @@
     test.Next(_L("TestMatchingEntries"));
     WriteDelete(aToDelete.iBytePos,aToDelete.iLength);
     TInt r=TheFs.ScanDrive(gSessionPath);
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     TPtr8 fatBuf=FatBufPtr->Des();
     TPtr8 dirBuf=DirBufPtr->Des();
@@ -1588,8 +1586,8 @@
     CDir* dirs;
     // check no entries in the root directory
     TInt r=TheFs.GetDir(KRoot,KEntryAttMaskSupported,ESortNone,dirs);
-    test_KErrNone(r);
-    test_Equal(0,dirs->Count());
+    test(r==KErrNone);
+    test(dirs->Count()==0);
     delete(dirs);
     dirs=NULL;
 
@@ -1607,13 +1605,13 @@
 
     RFile file;
     r=file.Replace(TheFs,TestFileName,EFileShareExclusive);
-    test_KErrNone(r);
+    test(r==KErrNone);
     file.Close();
 
     // get short name
     TFileName shortName;
     r=TheFs.GetShortName(TestFileName,shortName);
-    test_KErrNone(r);
+    test(r==KErrNone);
     test(shortName==KOrigShortName);
 
     // must be first entry in root, modify to read like
@@ -1622,26 +1620,26 @@
     TInt bytePos=ClusterEntryToBytes(0,1);
     RRawDisk raw;
     r=raw.Open(TheFs,gSessionPath[0]-'A');
-    test_KErrNone(r);
+    test(r==KErrNone);
     TBuf8<1> buf(1);
 
     //-- change 2nd character in the short name (Fat DOS entry)
     buf[0]=(TUint8)'\xC4';
     r=raw.Write(gRootDirStart+bytePos+1,buf);
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     //-- fix the fiddled short name checksum in the corresponding VFat entry
     bytePos=ClusterEntryToBytes(0,0);
     buf[0]=(TUint8)0x2f;
     r=raw.Write(gRootDirStart+bytePos+13,buf);
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     // retrieve short name from media.
     // Note: do not use RFs::GetShortName() as its behaviours are code page dependent.
     bytePos=ClusterEntryToBytes(0,1);
     TBuf8<11> shortNameBuf8;
     r=raw.Read(gRootDirStart+bytePos,shortNameBuf8);
-    test_KErrNone(r);
+    test(r==KErrNone);
     shortNameBuf8 = DosNameFromStdFormat(shortNameBuf8);
     shortName.Copy(shortNameBuf8);
     raw.Close();
@@ -1652,15 +1650,15 @@
     //TheFs.SetDebugRegister(KFSYS);
     r=TheFs.ScanDrive(gSessionPath);
     TheFs.SetDebugRegister(0);
-    test_KErrNone(r);
+    test(r==KErrNone);
     DumpData(NULL, 0, 20);
 
     // retrieve short name from media.
     r=raw.Open(TheFs,gSessionPath[0]-'A');
-    test_KErrNone(r);
+    test(r==KErrNone);
     bytePos=ClusterEntryToBytes(0,1);
     r=raw.Read(gRootDirStart+bytePos,shortNameBuf8);
-    test_KErrNone(r);
+    test(r==KErrNone);
     shortNameBuf8 = DosNameFromStdFormat(shortNameBuf8);
     shortName.Copy(shortNameBuf8);
     raw.Close();
@@ -1669,7 +1667,7 @@
 
     // delete file
     r=TheFs.Delete(TestFileName);
-    test_KErrNone(r);
+    test(r==KErrNone);
     }
 
 LOCAL_C void TestMountAndScan()
@@ -1682,47 +1680,46 @@
 
     test.Next(_L("TestMountAndScan"));
     HBufC8* newFat=HBufC8::New(gFatTestSize);
-    test_NotNull(newFat);
+    test(newFat!=NULL);
     TPtr8 fat=newFat->Des();
     TPtr8 origFat=FatBufPtr->Des();
     TPtr8 origDir=DirBufPtr->Des();
 
     // set cluster of \scndrv\dir1\ to a hanging cluster
     ReadFatDisk(fat);
-    WriteToFatBuf(gClusterDir1ext,35,fat.Ptr());
-    WriteToFatBuf(35,36,fat.Ptr());
-    WriteFatToDisk(fat);
+    WriteFat(gClusterDir1ext,35,fat.Ptr());
+    WriteFat(35,36,fat.Ptr());
+    WriteFatDisk(fat);
     // set the default path to something other than the current drive
     TFileName fsName;
     TInt r=TheFs.FileSystemName(fsName,gSessionPath[0]-'A');
-    test_KErrNone(r);
+    test(r==KErrNone);
     TFileName origDefPath, newDefPath;
     r=TheFs.SessionPath(origDefPath);
-    test_KErrNone(r);
+    test(r==KErrNone);
     newDefPath=origDefPath;
     newDefPath[0]=(TText)'z';
     r=TheFs.SetSessionPath(newDefPath);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r = TheFs.ExtensionName(extName,gSessionPath[0]-'A',0);
     if (r == KErrNone)
         {
         primaryExtensionExists = ETrue;
         }
     r=TheFs.DismountFileSystem(fsName,gSessionPath[0]-'A');
-    test_KErrNone(r);
+    test(r==KErrNone);
     // mount file system and check scandrive corrects error
     TBool isMount;
     if (primaryExtensionExists)
         r=TheFs.MountFileSystemAndScan(fsName,extName,gSessionPath[0]-'A',isMount);
     else
         r=TheFs.MountFileSystemAndScan(fsName,gSessionPath[0]-'A',isMount);
-    test(isMount);
-    test_KErrNone(r);
+    test(isMount && r==KErrNone);
     TBool res=IsSameAsDrive(origFat,origDir);
     test(res);
 
     r=TheFs.SetSessionPath(origDefPath);
-    test_KErrNone(r);
+    test(r==KErrNone);
     delete newFat;
     }
 
@@ -1736,14 +1733,14 @@
     TBool primaryExtensionExists = EFalse;
     TFileName fsName;
     TInt r=TheFs.FileSystemName(fsName,gSessionPath[0]-'A');
-    test_KErrNone(r);
+    test(r==KErrNone);
     r = TheFs.ExtensionName(extName,gSessionPath[0]-'A',0);
     if (r == KErrNone)
         {
         primaryExtensionExists = ETrue;
         }
     r=TheFs.DismountFileSystem(fsName,gSessionPath[0]-'A');
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     // RFs::MountFileSystemAndScan twice consecutively
     // first time
@@ -1752,37 +1749,15 @@
         r=TheFs.MountFileSystemAndScan(fsName,extName,gSessionPath[0]-'A',isMount);
     else
         r=TheFs.MountFileSystemAndScan(fsName,gSessionPath[0]-'A',isMount);
-    test(isMount);
-    test_KErrNone(r);
+    test(isMount && r==KErrNone);
     // and a second time
     if (primaryExtensionExists)
         r=TheFs.MountFileSystemAndScan(fsName,extName,gSessionPath[0]-'A',isMount);
     else
         r=TheFs.MountFileSystemAndScan(fsName,gSessionPath[0]-'A',isMount);
-    test(!isMount);
-    test_Equal(KErrAccessDenied,r);
+    test(!isMount && r==KErrAccessDenied);
     }
 
-
-static void CreateContiguousClusterChain(TUint32 aStartIndex, TUint32 aEndIndex, const TUint8* aFatPtr, TBool aMarkEoc)
-/*
- * Creates a contiguous cluster chain in the FAT buffer.
- * 
- * @param	aStartIndex	The first cluster index of the chain
- * 			aEndIndex	The last cluster index of the chain 
- * 			aFatPtr		FAT table buffer pointer
- * 			aMarkEoc	If ETrue, aEndIndex will be marked as EOC, else it will be a hanging cluster chain
- */
-	{
-	// Write cluster chain
-    for(TUint i=aStartIndex; i<aEndIndex; ++i)
-        WriteToFatBuf(i, i+1, aFatPtr);
-    // Mark EOC if needed
-    if (aMarkEoc)
-    	WriteToFatBuf(aEndIndex, gEndOfChain, aFatPtr);
-	}
-
-
 LOCAL_C void DoHangingClusters()
 //
 // Tests that scandrive removes hanging clusters
@@ -1790,42 +1765,42 @@
     {
     test.Next(_L("Check Hanging clusters"));
     HBufC8* newFat=HBufC8::New(gFatTestSize);
-    test_NotNull(newFat);
+    test(newFat!=NULL);
     TPtr8 fat=newFat->Des();
     TPtr8 origFat=FatBufPtr->Des();
     TPtr8 origDir=DirBufPtr->Des();
 
-    // Set cluster of \scndrv\dir1\ to hanging cluster chain
+    // set cluster of \scndrv\dir1\ to a hanging cluster
     test.Start(_L("Test hanging cluster in \\scndrv\\dir1\\"));
     ReadFatDisk(fat);
-    WriteToFatBuf(gClusterDir1ext,35,fat.Ptr());
-    WriteToFatBuf(35,36,fat.Ptr());
-    WriteFatToDisk(fat); // gClusterDir1ext->35->36
+    WriteFat(gClusterDir1ext,35,fat.Ptr());
+    WriteFat(35,36,fat.Ptr());
+    WriteFatDisk(fat);
     TInt r=TheFs.ScanDrive(gSessionPath);
-    test_KErrNone(r);
+    test(r==KErrNone);
     TBool res=IsSameAsDrive(origFat,origDir);
     test(res);
 
-    // Set cluster chain of first entry of \scndrv\dir1\ to
+    // set  cluster chain of first entry of \scndrv\dir1\ to
     // larger size than file size
     test.Next(_L("Test hanging cluster in first entry"));
     ReadFatDisk(fat);
-    WriteToFatBuf(gClusterDir1ext,39,fat.Ptr());
-    WriteToFatBuf(39,500,fat.Ptr());
-    CreateContiguousClusterChain(500, 505, fat.Ptr(), ETrue);
-    WriteFatToDisk(fat); // gClusterDir1ext->39->500->501->502->503->504->505->EOC
+    WriteFat(gClusterDir1ext,39,fat.Ptr());
+    WriteFat(39,500,fat.Ptr());
+    WriteFat(500,gEndOfChain,fat.Ptr());
+    WriteFatDisk(fat);
     r=TheFs.ScanDrive(gSessionPath);
-    test_KErrNone(r);
+    test(r==KErrNone);
     res=IsSameAsDrive(origFat,origDir);
     test(res);
 
-    // Set cluster of \scndrv\ to a hanging cluster
+    // set cluster of \scndrv\ to a hanging cluster
     test.Next(_L("Test hanging cluster of \\scndrv\\"));
     ReadFatDisk(fat);
-    WriteToFatBuf(gClusterScnDrv,511,fat.Ptr());
-    WriteFatToDisk(fat); // gClusterScnDrv->511
+    WriteFat(gClusterScnDrv,511,fat.Ptr());
+    WriteFatDisk(fat);
     r=TheFs.ScanDrive(gSessionPath);
-    test_KErrNone(r);
+    test(r==KErrNone);
     res=IsSameAsDrive(origFat,origDir);
     test(res);
 
@@ -1840,7 +1815,7 @@
     {
     test.Next(_L("Check lost clusters"));
     HBufC8* newFat=HBufC8::New(gFatTestSize);
-    test_NotNull(newFat);
+    test(newFat!=NULL);
     TPtr8 fat=newFat->Des();
     TPtr8 origFat=FatBufPtr->Des();
     TPtr8 origDir=DirBufPtr->Des();
@@ -1850,10 +1825,12 @@
     // write cluster chain
     test.Start(_L("Test removal of lost cluster chain"));
     ReadFatDisk(fat);
-    CreateContiguousClusterChain(25, 35, fat.Ptr(), ETrue);
-    WriteFatToDisk(fat); // 25->26->27->28->29->30->31->32->33->34->35->EOC
+    for(TInt i=25;i<35;++i)
+        WriteFat(i,i+1,fat.Ptr());
+    WriteFat(35,gEndOfChain,fat.Ptr());
+    WriteFatDisk(fat);
     TInt r=TheFs.ScanDrive(gSessionPath);
-    test_KErrNone(r);
+    test(r==KErrNone);
     TBool res=IsSameAsDrive(origFat,origDir);
     test(res);
 
@@ -1864,17 +1841,17 @@
         TInt off = j*BootSector.BytesPerSector()+j*7%512;
         fat[off]=1;
         }
-    WriteFatToDisk(fat);
+    WriteFatDisk(fat);
     r=TheFs.ScanDrive(gSessionPath);
-    test_KErrNone(r);
+    test(r==KErrNone);
     res=IsSameAsDrive(origFat,origDir);
     test(res);
 
     // write semi-random changes to second fat
     test.Next(_L("Test semi-random changes to second fat"));
-    WriteFatToDisk(fat, 1);
+    WriteFatDisk(fat, 1);
     r=TheFs.ScanDrive(gSessionPath);
-    test_KErrNone(r);
+    test(r==KErrNone);
     res=IsSameAsDrive(origFat,origDir);
     test(res);
 
@@ -1882,74 +1859,6 @@
     test.End();
     }
 
-
-static void DoHangingAndLostClusters()
-/*
- * Tests that ScanDrive fixes MULTIPLE hanging clusters and removes lost clusters.
- * It creates multiple hanging and lost cluster chains in the FAT table and
- * expects ScanDrive to fix them all.
- */
-	{
-	test.Start(_L("Check multiple hanging and lost cluster chains"));
-	HBufC8* newFat = HBufC8::New(gFatTestSize);
-	test_NotNull(newFat);
-	TPtr8 fat = newFat->Des();
-	TPtr8 origFat = FatBufPtr->Des();
-	TPtr8 origDir = DirBufPtr->Des();
-	ReadFatDisk(origFat);
-	ReadDirDisk(origDir);
-
-	test.Printf(_L("Create multiple hanging cluster chains\n"));
-	ReadFatDisk(fat);
-	// Set hanging cluster for the file in \scndrv\dir1
-	// gClusterDir1ext+1->25->26->27->28->29->30->31->32->33->34->35
-	WriteToFatBuf(gClusterDir1ext+1, 25, fat.Ptr());
-	CreateContiguousClusterChain(25, 35, fat.Ptr(), EFalse);
-	// Set hanging cluster for the first file in \scndrv\dir2
-	// gClusterDir2_AFull+1->249->250->53->54->55->EOC
-	WriteToFatBuf(gClusterDir2_AFull+1, 249, fat.Ptr());
-	WriteToFatBuf(249, 250, fat.Ptr());
-	WriteToFatBuf(250, 53, fat.Ptr());
-	CreateContiguousClusterChain(53, 55, fat.Ptr(), ETrue);
-	// Set hanging cluster for the fourth file in \scndrv\dir2
-	// gClusterDir2_AFull+4->59->60->61->62->63
-	WriteToFatBuf(gClusterDir2_AFull+4, 59, fat.Ptr());
-	CreateContiguousClusterChain(59, 63, fat.Ptr(), EFalse);
-	// Set hanging cluster for the second file in \scndrv\dir2
-	// gClusterDir2_AFull+2->67->68->69->EOC
-	WriteToFatBuf(gClusterDir2_AFull+2, 67, fat.Ptr());
-	CreateContiguousClusterChain(67, 69, fat.Ptr(), ETrue);
-
-	test.Printf(_L("Create multiple lost clusters\n"));
-	// Create 1st lost cluster chain (clusters 36-45)
-	CreateContiguousClusterChain(36, 45, fat.Ptr(), ETrue);
-	// Create 2nd lost cluster chain (clusters 246-248,56-58)
-	CreateContiguousClusterChain(246, 248, fat.Ptr(), EFalse);
-	WriteToFatBuf(248, 56, fat.Ptr());
-	CreateContiguousClusterChain(56, 58, fat.Ptr(), ETrue);
-	// Create 3rd lost cluster chain (clusters 251-253,564-566, with hanging end)
-	CreateContiguousClusterChain(251, 253, fat.Ptr(), EFalse);
-	WriteToFatBuf(253, 564, fat.Ptr());
-	CreateContiguousClusterChain(564, 566, fat.Ptr(), EFalse);
-	
-	// Flush all FAT changes to the media
-	WriteFatToDisk(fat);
-
-	test.Next(_L("Test ScanDrive fixes multiple hanging and lost cluster chains"));
-	TInt r = TheFs.CheckDisk(gSessionPath);	// CheckDisk should detect an error
-	test_Value(r, r != KErrNone);
-	r = TheFs.ScanDrive(gSessionPath);		// ScanDrive should find the errors and fix them
-	test_KErrNone(r);
-	r = TheFs.CheckDisk(gSessionPath);
-	test_KErrNone(r);
-	TBool res = IsSameAsDrive(origFat, origDir);
-	test(res);
-
-	delete newFat;
-	test.End();
-	}
-
-
 LOCAL_C void DoPartEntries()
 //
 // Tests that scandrive detects/corrects partial entries
@@ -1963,9 +1872,9 @@
     TPtr8 dirBuf=DirBufPtr->Des();
 
     TInt r=TheFs.RmDir(_L("\\scndrv\\dir2\\somedirwith3entries\\"));
-    test_Value(r, r==KErrNone || r==KErrNotFound || r==KErrPathNotFound);
+    test(r==KErrNone || r==KErrNotFound || KErrPathNotFound);
     r=TheFs.RmDir(_L("\\scndrv\\dir2\\somedir2with3entries\\"));
-    test_Value(r, r==KErrNone || r==KErrNotFound || r==KErrPathNotFound);
+    test(r==KErrNone || r==KErrNotFound || KErrPathNotFound);
 
     if (BootSector.RootDirEntries() != 0)
         {
@@ -1974,7 +1883,7 @@
         test.Next(_L("Partial entry at end of rootdir"));
         FillUpRootDir(2);
         r=temp.Create(TheFs,_L("\\temp"),EFileShareAny);
-        test_KErrNone(r);
+        test(r==KErrNone);
         temp.Close();
         ReadDirDisk(dirBuf);
         ReadFatDisk(fatBuf);
@@ -1994,7 +1903,7 @@
     CreatePartialEntry(partial2,3,EFalse);
     // entry has been allocated a cluster which scandrive should delete along with partial entry
     if (last > 0)
-        WriteToFatBuf(last,0,fatBuf.Ptr());
+        WriteFat(last,0,fatBuf.Ptr());
     res=TestPartialEntry(partial2);
     test(res);
 
@@ -2002,26 +1911,26 @@
     test.Next(_L("Test directory reclaim"));
     last = GetStartCluster(gClusterDir2_Full,gEntriesPerCluster-2);
     WriteEndOfDir(ClusterEntryToBytes(gClusterDir2_Full,gEntriesPerCluster-2));
-    WriteDirEntryToDisk(dirBuf);
+    WriteDirDisk(dirBuf);
     TInt entry = GetFatEntry(gClusterDir2_Full, fatBuf.Ptr());
-    WriteToFatBuf(gClusterDir2_Full,gEndOfChain,fatBuf.Ptr());
+    WriteFat(gClusterDir2_Full,gEndOfChain,fatBuf.Ptr());
     while (entry && (entry & gEndOfChain) != gEndOfChain)
         {
         TInt next = GetFatEntry(entry, fatBuf.Ptr());
-        WriteToFatBuf(entry,0,fatBuf.Ptr());
+        WriteFat(entry,0,fatBuf.Ptr());
         entry = next;
         }
     if (last > 0)
-        WriteToFatBuf(last,0,fatBuf.Ptr());
+        WriteFat(last,0,fatBuf.Ptr());
     r=TheFs.ScanDrive(gSessionPath);
-    test_KErrNone(r);
+    test(r==KErrNone);
     res=IsSameAsDrive(fatBuf,dirBuf);
     test(res);
 
     // use last entry of first cluster in \scndrv\dir2\full\ 
     test.Next(_L("Partial entry at end of subdir"));
     r=temp.Create(TheFs,_L("\\scndrv\\dir2\\full\\temp"),EFileShareAny);
-    test_KErrNone(r);
+    test(r==KErrNone);
     temp.Close();
     ReadDirDisk(dirBuf);
     ReadFatDisk(fatBuf);
@@ -2034,12 +1943,12 @@
     test.Next(_L("Partial entry preceeding end-of-dir marker"));
     last = GetStartCluster(gClusterDir2_AFull,14);
     if (last > 0)
-        WriteToFatBuf(last,0,fatBuf.Ptr());
+        WriteFat(last,0,fatBuf.Ptr());
     last = GetStartCluster(gClusterDir2_AFull,8);
     if (last > 0)
-        WriteToFatBuf(last,0,fatBuf.Ptr());
+        WriteFat(last,0,fatBuf.Ptr());
     WriteEndOfDir(ClusterEntryToBytes(gClusterDir2_AFull,14));
-    WriteDirEntryToDisk(dirBuf);
+    WriteDirDisk(dirBuf);
     TEntryInfo partial4(ClusterEntryToBytes(gClusterDir2_AFull,8),6);
     CreatePartialEntry(partial4,4,EFalse);
     res=TestPartialEntry(partial4);
@@ -2055,14 +1964,14 @@
 	// create entry in \scndrv\dir2\almostfull\ 
 //	test.Next(_L("Partial entry with invalid dos name"));
 //	r=temp.Create(TheFs,_L("\\scndrv\\dir2\\almostfull\\Dodgy file name"),EFileShareAny);
-//	test_KErrNone(r);
+//	test(r==KErrNone);
 //	temp.Close();
 //	ReadDirDisk(dirBuf);
 //	TInt dosStart=ClusterEntryToBytes(gClusterDir2_AFull,4);
 //	dirBuf[dosStart+4]=0x1;
 //	WriteDirDisk(dirBuf);
 //	r=TheFs.ScanDrive(gSessionPath);
-//	test_KErrNone(r);
+//	test(r==KErrNone);
 //	WriteDelete(dosStart-2*32,3);
 //	res=IsSameAsDrive(fatBuf,dirBuf);
 //	test(res);
@@ -2074,26 +1983,26 @@
         last = GetStartCluster(gClusterDir2_Full,gEntriesPerCluster-1);
         WriteEndOfDir(ClusterEntryToBytes(gClusterDir2_Full,gEntriesPerCluster-2));
         WriteEndOfDir(ClusterEntryToBytes(gClusterDir2_Full,gEntriesPerCluster-1));
-        WriteDirEntryToDisk(dirBuf);
+        WriteDirDisk(dirBuf);
         TFileName longFile=_L("\\scndrv\\dir2\\full\\");
         MakeVeryLongName(longFile);
         r=temp.Create(TheFs,longFile,EFileShareAny);
-        test_KErrNone(r);
+        test(r==KErrNone);
         temp.Close();
         ReadDirDisk(dirBuf);
-        WriteToFatBuf(gClusterDir2_Full,gClusterDir2_SD3E,fatBuf.Ptr());
-        WriteToFatBuf(gClusterDir2_SD3E,gClusterDir2_SD23E,fatBuf.Ptr());
-        WriteToFatBuf(gClusterDir2_SD23E,gEndOfChain,fatBuf.Ptr());
+        WriteFat(gClusterDir2_Full,gClusterDir2_SD3E,fatBuf.Ptr());
+        WriteFat(gClusterDir2_SD3E,gClusterDir2_SD23E,fatBuf.Ptr());
+        WriteFat(gClusterDir2_SD23E,gEndOfChain,fatBuf.Ptr());
         if (last > 0)
-            WriteToFatBuf(last,0,fatBuf.Ptr());
+            WriteFat(last,0,fatBuf.Ptr());
         TEntryInfo partial5(ClusterEntryToBytes(gClusterDir2_Full,gEntriesPerCluster-2),19);
         CreatePartialEntry(partial5,7,EFalse);
         res=TestPartialEntry(partial5);
         test(res);
         r=TheFs.Delete(longFile);
-        test_Value(r, r==KErrNone || r==KErrNotFound);
+        test(r==KErrNone || r==KErrNotFound);
         r=TheFs.Delete(_L("\\temp"));
-        test_Value(r, r==KErrNone || r==KErrNotFound);
+        test(r==KErrNone || r==KErrNotFound);
         }
     ReadDirDisk(dirBuf);
 
@@ -2143,16 +2052,16 @@
     test.Next(_L("matching entries in same subdir"));
     // delete entries to allow contiguous clusters in \scndrv\dir2\full directory
     TInt r=TheFs.RmDir(_L("\\scndrv\\dir2\\somedirwith3entries\\"));
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheFs.RmDir(_L("\\scndrv\\dir2\\somedir2with3entries\\"));
-    test_KErrNone(r);
+    test(r==KErrNone);
     // ensure directory is expanded
     RFile temp;
     r=temp.Create(TheFs,_L("\\scndrv\\dir2\\full\\temp"),EFileShareAny);
-    test_KErrNone(r);
+    test(r==KErrNone);
     temp.Close();
     r=TheFs.Delete(_L("\\scndrv\\dir2\\full\\temp"));
-    test_KErrNone(r);
+    test(r==KErrNone);
     ReadDirDisk(dirBuf);
     ReadFatDisk(fatBuf);
     TEntryInfo from4(ClusterEntryToBytes(gClusterDir2_Full,4),2);
@@ -2165,14 +2074,14 @@
     test.Next(_L("matching entries in diff dirs + new cluster"));
     // delete last entry in directory
     r=TheFs.Delete(LastInFull);
-    test_KErrNone(r);
+    test(r==KErrNone);
     TFileName veryLongName=_L("\\scndrv\\dir2\\full\\");
     MakeVeryLongName(veryLongName);
     r=temp.Create(TheFs,veryLongName,EFileShareAny);
-    test_KErrNone(r);
+    test(r==KErrNone);
     temp.Close();
     r=TheFs.Delete(veryLongName);
-    test_KErrNone(r);
+    test(r==KErrNone);
     ReadDirDisk(dirBuf);
     ReadFatDisk(fatBuf);
     TEntryInfo from5(ClusterEntryToBytes(gClusterDir1,2),19);
@@ -2202,7 +2111,7 @@
     ReadFatDisk(fatBuf);
     // run scandisk and compare
     TInt r=TheFs.ScanDrive(gSessionPath);
-    test_KErrNone(r);
+    test(r==KErrNone);
     TBool res=IsSameAsDrive(fatBuf,dirBuf);
     test(res);
     // Create a entry with matching start cluster and check fixed up
@@ -2229,7 +2138,7 @@
     ReadFatDisk(fatBuf);
 
     TInt r=TheFs.ScanDrive(gSessionPath);
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     TBool res=IsSameAsDrive(fatBuf,dirBuf);
     test(res);
@@ -2322,9 +2231,9 @@
             name.AppendNumFixedWidth(i+totalFilesCreated, EHex, 3);
             RFile f;
             r = f.Create(TheFs, name, EFileShareAny);
-            test_KErrNone(r);
+            test(r == KErrNone);
             r = f.Write(buf);
-            test_KErrNone(r);
+            test(r == KErrNone);
             f.Close();
             }
 
@@ -2357,7 +2266,7 @@
 
             }
 
-        WriteDirEntryToDisk(dirBuf, cluster);
+        WriteDirDisk(dirBuf, cluster);
         totalFilesCreated += filesThisTime;
         test.Printf(_L("   created %d entries\n"), totalFilesCreated);
         }
@@ -2369,7 +2278,7 @@
 
     test.Printf(_L("Running ScanDrive\n"), filesThisTime);
     r=TheFs.ScanDrive(gSessionPath);
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     TBool res=IsSameAsDrive(fatBuf,dirBuf);
     test(res);
@@ -2381,17 +2290,17 @@
         name.Append(_L("tempfile."));
         name.AppendNumFixedWidth(i, EHex, 3);
         r = TheFs.Delete(name);
-        test_KErrNone(r);
+        test(r == KErrNone);
         }
 
     ReadDirDisk(dirBuf);
     ReadFatDisk(fatBuf);
     WriteEndOfDir(ClusterEntryToBytes(cluster, startEntry));
-    WriteDirEntryToDisk(dirBuf);
+    WriteDirDisk(dirBuf);
 
     test.Printf(_L("Running ScanDrive\n"), filesThisTime);
     r=TheFs.ScanDrive(gSessionPath);
-    test_KErrNone(r);
+    test(r==KErrNone);
     res=IsSameAsDrive(fatBuf,dirBuf);
     test(res);
     }
@@ -2432,7 +2341,6 @@
     DoPartEntries();
     DoLostClusters();
     DoHangingClusters();
-    DoHangingAndLostClusters();
     TestMountAndScan();
     TestConsecutiveMountAndScans();
     DeleteDirectoryStructure();
@@ -2454,7 +2362,7 @@
     {
     TInt r;
     r = TheFs.CharToDrive(gSessionPath[0], gDriveNumber);
-    test_KErrNone(r);
+    test( KErrNone == r );
 
 
     //-- set up console output
@@ -2472,7 +2380,7 @@
     // check this is not the internal ram drive
     TVolumeInfo v;
     r=TheFs.Volume(v);
-    test_KErrNone(r);
+    test(r==KErrNone);
     if(v.iDrive.iMediaAtt&KMediaAttVariableSize)
         {
         test.Printf(_L("Error: Internal ram drive not tested\n"));
@@ -2480,7 +2388,7 @@
         }
 
     r=TheFs.SetSessionPath(gSessionPath);
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     DoTests();
 
--- a/kerneltest/f32test/filesystem/fat/t_scn32dr2.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/filesystem/fat/t_scn32dr2.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -11,10 +11,9 @@
 // Contributors:
 //
 // Description:
-// f32test\filesystem\fat\t_scn32dr2.cpp
+// f32test\scndrv\t_scn32dr2.cpp
 //
-
-#define __E32TEST_EXTENSION__
+//
 
 #include <f32file.h>
 #include <e32test.h>
@@ -72,7 +71,7 @@
     TInt gDriveNumber;
 
     TInt r = TheFs.CharToDrive( gSessionPath[0], gDriveNumber );
-    test_KErrNone(r);
+    test( KErrNone == r );
 
     //-- set up console output
     Fat_Test_Utils::SetConsole(test.Console());
@@ -96,18 +95,18 @@
     TUint8 oldFsys;
     TPtr8 pRugged(&oldFsys,1,1);
     r=TheFs.ControlIo(gDriveNumber,KControlIoIsRugged,pRugged);
-    test_KErrNone(r);
+    test(r==KErrNone);
     if(oldFsys==0)
         {
         r=TheFs.ControlIo(gDriveNumber,KControlIoRuggedOn);
-        test_KErrNone(r);
+        test(r==KErrNone);
         }
     DoTests();
     // if nec, set filing system back to !rugged
     if(oldFsys==0)
         {
         r=TheFs.ControlIo(gDriveNumber,KControlIoRuggedOff);
-        test_KErrNone(r);
+        test(r==KErrNone);
         }
 
     return;
--- a/kerneltest/f32test/filesystem/fat/t_scn32dr3.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/filesystem/fat/t_scn32dr3.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 //
 //
 
-#define	__E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32svr.h>
@@ -75,23 +74,23 @@
             tempDirName = _L("?:\\SYSTEM\\BIN\\");
         tempDirName[0] = gSessionPath[0];
         r=TheFs.MkDirAll(tempDirName);
-        test_Value(r, r == KErrNone||r==KErrAlreadyExists);
+        test(r==KErrNone||r==KErrAlreadyExists);
         CFileMan* fileMan=NULL;
         TRAP(r,fileMan = CFileMan::NewL(TheFs));
-        test_KErrNone(r);
+        test(r==KErrNone);
         //Copy the test from Z drive.
         TFileName temp=_L("Z:\\SYS\\BIN\\T_SCN32DR3.EXE");
         r = fileMan->Copy(temp, TestExeName, CFileMan::EOverWrite);
-        test_KErrNone(r);
+        test(r==KErrNone);
         r = fileMan->Copy(TestExeName, StartupExeName, CFileMan::EOverWrite);
-        test_KErrNone(r);
+        test(r == KErrNone);
         //Mask read attribute. Fix for DEF081323
         r = fileMan->Attribs(StartupExeName, 0, KEntryAttReadOnly, 0);
-        test_KErrNone(r);
+        test(r == KErrNone);
         r = fileMan->Attribs(TestExeName, 0, KEntryAttReadOnly, 0);
-        test_KErrNone(r);
+        test(r == KErrNone);
         r = logFile.Replace(TheFs,LogFileName,EFileShareExclusive|EFileWrite);
-        test_KErrNone(r);
+        test(r == KErrNone);
         logFile.Close();
         delete fileMan;
         }
@@ -124,11 +123,11 @@
     TUint8 oldFsys;
     TPtr8 pRugged(&oldFsys,1,1);
     r=TheFs.ControlIo(gSessionPath[0]-'A',KControlIoIsRugged,pRugged);
-    test_KErrNone(r);
+    test(r==KErrNone);
     if(oldFsys==0)
         {
         r=TheFs.ControlIo(gSessionPath[0]-'A',KControlIoRuggedOn);
-        test_KErrNone(r);
+        test(r==KErrNone);
         }
     TheFunctionNumber=0;
     TheOpNumber=0;
@@ -139,14 +138,14 @@
     OverrideEShell();
     ReadLogFile();
     r=TheFs.ScanDrive(gSessionPath);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheFs.CheckDisk(gSessionPath);
-    test_KErrNone(r);
+    test(r==KErrNone);
     DoTests();
     r=TheFs.Delete(LogFileName);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheFs.Delete(StartupExeName);
-    test_KErrNone(r);
+    test(r==KErrNone);
     // return file system to original state
     if(oldFsys==0)
         r=TheFs.ControlIo(gSessionPath[0]-'A',KControlIoRuggedOff);
--- a/kerneltest/f32test/filesystem/fat/t_server.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/filesystem/fat/t_server.h	Wed Sep 01 12:34:56 2010 +0100
@@ -11,7 +11,7 @@
 // Contributors:
 //
 // Description:
-// f32test\filesystem\fat\t_server.h
+// f32test\server\t_server.h
 //
 //
 
--- a/kerneltest/f32test/filesystem/fat/t_tscan32.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/filesystem/fat/t_tscan32.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -11,10 +11,9 @@
 // Contributors:
 //
 // Description:
-// f32test\filesystem\fat\t_tscan32.cpp
+// f32test\scndrv\t_tscan32.cpp
 // 
-
-#define __E32TEST_EXTENSION__
+//
 
 #include <f32file.h>
 #include <e32test.h>
@@ -37,9 +36,9 @@
 
 #ifdef _DEBUG
 GLREF_D RTest test;
-GLDEF_D TInt TheFunctionNumber;	// Indicates which test to run
-GLDEF_D TInt TheOpNumber;		// Indicates which file operation to be tested
-GLDEF_D TInt TheFailCount;		
+GLDEF_D TInt TheFunctionNumber;
+GLDEF_D TInt TheOpNumber;
+GLDEF_D TInt TheFailCount;
 GLDEF_D TBool IsReset;
 GLDEF_D TFileName TestExeName=_L("?:\\T_SCANDR.EXE"); //Renaming it to fit in one root dir entry.
 GLDEF_D TFileName LogFileName=_L("?:\\T_SCANDR.LOG"); //Renaming it to fit in one root dir entry.
@@ -57,8 +56,8 @@
 const TInt KDirAttrLongMask  = KDirAttrLongName | KDirAttrDirectory | KDirAttrArchive;
 const TInt KDirLastLongEntry = 0x40;
 
-GLDEF_D TInt WriteFailValue;	// Indicates what error should return from a write failure
-								// Value assigned in t_scn32dr2 and t_scn32dr3
+GLDEF_D TInt WriteFailValue;
+
 LOCAL_C TFatBootSector BootSector;	
 LOCAL_D RRawDisk TheRawDisk;
 
@@ -80,13 +79,7 @@
 LOCAL_D HBufC8* gFatBuf  = NULL;
 LOCAL_D TInt    gFatAddr = -1;
 
-enum TFatChain
-	{
-	EChainStd,			// Cluster chain grows contiguously
-	EChainAlternate,	// Cluster chain grows forward but not contiguously
-	EChainBackwards,	// Cluster chain first goes backwards(up to 3.5kb for fat16 file) and then forwards
-	EChainForwards		// Cluster chain first goes forward (upto 3.5kb for fat16 file) and then backwards
-	};
+enum TFatChain {EChainStd,EChainAlternate,EChainBackwards,EChainForwards};
 
 LOCAL_C TBool IsInternalRam()
 //
@@ -95,7 +88,7 @@
 	{
 	TVolumeInfo v;
 	TInt r=TheFs.Volume(v,gSessionPath[0]-'A');
-	test_KErrNone(r);
+	test(r==KErrNone);
 	return(v.iDrive.iMediaAtt&KMediaAttVariableSize);
 	}
 
@@ -109,10 +102,10 @@
 	TInt r=log.Open(TheFs,LogFileName,EFileShareExclusive|EFileWrite);
 	if(r!=KErrNone)
 		test.Printf(_L("error=%d\n"),r);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt size;
 	r=log.Size(size);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf8<16> buf;
 	buf.SetLength(4);
 	buf[0]=(TUint8)TheFunctionNumber;
@@ -120,7 +113,7 @@
 	buf[2]=(TUint8)TheFailCount;
 	buf[3]='\n';
 	r=log.Write(size,buf,buf.Length());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("Written func=%d,op=%d,fail=%d\n"),TheFunctionNumber,TheOpNumber,TheFailCount);
 	log.Close();
 	}
@@ -148,8 +141,8 @@
 	TInt r=log.Open(TheFs,LogFileName,EFileShareExclusive);
 	if(r!=KErrNone)
 		test.Printf(_L("error in ReadLogFile()=%d\n"),r);
-	test_KErrNone(r);
-	
+	test(r==KErrNone);
+	test(r==KErrNone);
 	TInt fileSize;
 	r=log.Size(fileSize);
 	if(fileSize==0)
@@ -194,7 +187,7 @@
 */
 static void DoZeroFillMedia(TInt64 aStartPos, TInt64 aEndPos, RRawDisk& aWriter)
 {
-	test(aStartPos >=0 && aEndPos >=0 && aStartPos < aEndPos);
+    test(aStartPos >=0 && aEndPos >=0 && aStartPos < aEndPos);
     
     if(aStartPos == aEndPos)
         return;
@@ -205,7 +198,7 @@
     const TUint32 KBufSz=65536*2; //-- buffer with zeroes
     
     nRes = buf.CreateMax(KBufSz);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     buf.FillZ();
 
@@ -216,7 +209,7 @@
     
         TPtrC8 ptr(buf.Ptr(), bytesToWrite);
         nRes = aWriter.Write(aStartPos, ptr);
-        test_Value(nRes, nRes == KErrNone || nRes == KErrDiskFull);
+        test(nRes == KErrNone || nRes == KErrDiskFull);
 
         aStartPos+=bytesToWrite;
         rem-=bytesToWrite;
@@ -234,7 +227,7 @@
 	{
 
 	TInt r=TheRawDisk.Open(TheFs,gSessionPath[0]-'A');
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TUint32 startPos = gDataStartBytes;
 	if (gDiskType == EFat32)
@@ -276,7 +269,7 @@
 	{
 	
     TInt nRes = ReadBootSector(TheFs, CurrentDrive(), KBootSectorNum<<KDefaultSectorLog2, BootSector);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     if(!BootSector.IsValid())
         {
@@ -330,7 +323,7 @@
 	if (!gFatBuf)
 		{
 		gFatBuf=HBufC8::New(gBytesPerCluster);
-		test_NotNull(gFatBuf);
+		test(gFatBuf!=NULL);
 		gFatAddr = -1;
 		}
 
@@ -346,10 +339,10 @@
 		if (gFatAddr < 0 || pos < gFatAddr || pos >= gFatAddr + gBytesPerCluster)
 			{
 			TPtr8 ptr=gFatBuf->Des();
-			TInt r=TheRawDisk.Open(TheFs,gSessionPath[0]-'A');
-			test_KErrNone(r);
+		TInt r=TheRawDisk.Open(TheFs,gSessionPath[0]-'A');
+			test(r==KErrNone);
 			r=TheRawDisk.Read(pos, ptr);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			TheRawDisk.Close();
 			gFatAddr = pos;
 			}
@@ -638,12 +631,12 @@
 		if (GetFatEntry(cluster, aFat) != 0)
 			{
 			HBufC8* buf=HBufC8::New(gBytesPerCluster);
-			test_NotNull(buf);
+			test(buf!=NULL);
 			TPtr8 ptr=buf->Des();
 			TInt r=TheRawDisk.Open(TheFs,gSessionPath[0]-'A');
-			test_KErrNone(r);
+			test(r==KErrNone);
 			r=TheRawDisk.Read(ClusterToByte(cluster), ptr);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			TheRawDisk.Close();
 			RDebug::Print(_L("Cluster %d @ 0x%08X:"), cluster, ClusterToByte(cluster));
 			DumpDirCluster(ptr.Ptr());
@@ -727,7 +720,7 @@
 		dir[1]=TUint16(count/26+'a');
 		dir[2]=TUint16(count%26+'a');
 		r=TheFs.MkDir(dir);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		entriesSoFar+=2;
 		++count;
 		}
@@ -752,7 +745,7 @@
 		dir[1]=TUint16(count/26+'a');
 		dir[2]=TUint16(count%26+'a');
 		r=TheFs.RmDir(dir);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		entriesSoFar-=2;
 		++count;
 		}
@@ -774,7 +767,7 @@
 	{
 	TEntry entry;
 	TInt r=TheFs.Entry(aName,entry);
-	test_Value(r, r==KErrNone||r==KErrNotFound);
+	test(r==KErrNone||r==KErrNotFound);
 	return(r==KErrNone?(TBool)ETrue:(TBool)EFalse);
 	}
 
@@ -813,7 +806,7 @@
 //
 	{
 	TInt r=TheFs.Entry(aName,aEntry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 LOCAL_C TBool IsSameEntryDetails(TEntry aOldEntry,TEntry aNewEntry)
@@ -836,9 +829,9 @@
 	TInt size1,size2;
 	size1=size2=0;
 	TInt r=file1.Create(TheFs,aNameOne,EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file2.Create(TheFs,aNameTwo,EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	// one entry for file1 for every 40 entries for file2
 	// if file 1 subseqently deleted then 7 entries available
 	// in that fat sector - ~3.5kb file size - for fat16
@@ -850,15 +843,15 @@
 			{
 			size1+=gBytesPerCluster;
 			r=file1.SetSize(size1);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			first=EFalse;
 			--entries;
 			}
 		else
 			{
 			size2+=gBytesPerCluster*ratio;
-			r=file2.SetSize(size2);
-			test_KErrNone(r);
+			r=file1.SetSize(size1);
+			test(r==KErrNone);
 			first=ETrue;
 			entries-=ratio;
 			}
@@ -911,7 +904,7 @@
 		TFileName fullName(aName);
 		fullName.Append(fn);
 		TInt r = TheFs.Delete(fullName);
-		test_KErrNone(r);
+		test(r == KErrNone);
 		entry += 1 + (fn.Length() + 12) / 13;
 		}
 	RDebug::Print(_L("CleanDirectory(%S, %d)"), &aName, aClusters);
@@ -946,7 +939,7 @@
 		fullName.Append(fn);
 		RFile file;
 		TInt r = file.Create(TheFs,fullName,EFileShareAny);
-		test_KErrNone(r);
+		test(r == KErrNone);
 		file.Close();
 		entry += 1 + (fn.Length() + 12) / 13;
 		}
@@ -961,7 +954,7 @@
 //
 	{
 	TInt r=TheFs.Delete(_L("\\fat\\file2"));
-	test_Value(r, r==KErrNone||r==KErrNotFound);
+	test(r==KErrNone||KErrNotFound);
 	if(aIsDir)
 		return(TheFs.RmDir(aName));
 	else
@@ -975,7 +968,7 @@
 //
 	{
 	TInt r=DeleteAlternateEntry(aName,aIsDir);
-	test_Value(r, r==KErrNone||r==KErrNotFound);
+	test(r==KErrNone||r==KErrNotFound);
 	RFile file;
 	if(aIsDir)
 		{
@@ -989,17 +982,17 @@
 		if(r!=KErrNone)
 			return(r);
 		r=file.SetSize(1); //ensure file allocated a start cluster
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	CreateAlternate(_L("\\fat\\file1"),_L("\\fat\\file2"));
 	r=TheFs.Delete(_L("\\fat\\file1"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	if(aIsDir)
 		ExpandDirectory(aName,aSize);
 	else
 		{
 		r=file.SetSize(aSize);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		file.Close();
 		}
 	return(KErrNone);
@@ -1011,11 +1004,11 @@
 //
 	{
 	TInt r=TheFs.Delete(_L("\\fat\\file2"));
-	test_Value(r, r==KErrNone||r==KErrNotFound);
+	test(r==KErrNone||r==KErrNotFound);
 	r=TheFs.Delete(_L("\\fat\\file4"));
-	test_Value(r, r==KErrNone||r==KErrNotFound);
+	test(r==KErrNone||r==KErrNotFound);
 	r=TheFs.Delete(_L("\\fat\\file5"));
-	test_Value(r, r==KErrNone||r==KErrNotFound);
+	test(r==KErrNone||r==KErrNotFound);
 	if(aIsDir)
 		r=TheFs.RmDir(aName);
 	else
@@ -1030,16 +1023,16 @@
 //	
 	{
 	TInt r=DeleteForwardEntry(aName,aIsDir);
-	test_Value(r, r==KErrNone||r==KErrNotFound);
+	test(r==KErrNone||r==KErrNotFound);
 	RFile file1,file2,entry;
 	r=file1.Create(TheFs,_L("\\fat\\file1"),EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file1.SetSize(EntriesPerFatSector()*gBytesPerCluster);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file2.Create(TheFs,_L("\\fat\\file2"),EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file2.SetSize(EntriesPerFatSector()*gBytesPerCluster);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	if(aIsDir)
 		{
 		r=TheFs.MkDir(aName);
@@ -1052,27 +1045,27 @@
 		if(r!=KErrNone)
 			return(r);
 		r=entry.SetSize(1);	// ensure entry has start cluster allocated
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	CreateAlternate(_L("\\fat\\file3"),_L("\\fat\\file4"));
 	RFile file5;
 	r=file5.Create(TheFs,_L("\\fat\\file5"),EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file5.SetSize(EntriesPerFatSector()*gBytesPerCluster*2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	file2.Close();
 	file5.Close();
 	r=TheFs.Delete(_L("\\fat\\file1"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("\\fat\\file3"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	if(aIsDir)
 		ExpandDirectory(aName,aSize);
 	else
 		{
 		r=entry.SetSize(aSize);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		entry.Close();
 		}
 	return(KErrNone);
@@ -1084,9 +1077,9 @@
 //
 	{
 	TInt r=TheFs.Delete(_L("\\fat\\file2"));
-	test_Value(r, r==KErrNone||r==KErrNotFound);
+	test(r==KErrNone||r==KErrNotFound);
 	r=TheFs.Delete(_L("\\fat\\file3"));
-	test_Value(r, r==KErrNone||r==KErrNotFound);
+	test(r==KErrNone||r==KErrNotFound);
 	if(aIsDir)
 		r=TheFs.RmDir(aName);
 	else
@@ -1101,7 +1094,7 @@
 //
 	{
 	TInt r=DeleteBackwardEntry(aName,aIsDir);
-	test_Value(r, r==KErrNone||r==KErrNotFound);
+	test(r==KErrNone||r==KErrNotFound);
 	CreateAlternate(_L("\\fat\\file1"),_L("\\fat\\file2"));
 	RFile entry;
 	if(aIsDir)
@@ -1116,22 +1109,22 @@
 		if(r!=KErrNone)
 			return(r);
 		r=entry.SetSize(1);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	RFile file3;
 	r=file3.Create(TheFs,_L("\\fat\\file3"),EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file3.SetSize(EntriesPerFatSector()*gBytesPerCluster);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("\\fat\\file1"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file3.Close();
 	if(aIsDir)
 		ExpandDirectory(aName,aSize);
 	else
 		{
 		r=entry.SetSize(aSize);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		entry.Close();
 		}
 	return(KErrNone);	
@@ -1154,7 +1147,7 @@
 //
 	{
 	TInt r=DeleteStdEntry(aName,aIsDir);
-	test_Value(r, r==KErrNone||r==KErrNotFound);
+	test(r==KErrNone||r==KErrNotFound);
 	if(aIsDir)
 		{
 		r=TheFs.MkDir(aName);
@@ -1169,12 +1162,12 @@
 		if(r==KErrNone)
 			{
 			r=file.SetSize(aSize);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			}
 		else if(r==KErrAlreadyExists)
 			{
 			TInt res =file.Open(TheFs,aName,EFileShareAny);
-			test_KErrNone(res);
+			test(res==KErrNone);
 			}
 		else
 			return(r);
@@ -1225,28 +1218,28 @@
 		{
 		test.Printf(_L("failCount=%d\n"),failCount);
 		r=CreateEntry(aName,EFalse,aChain,aFileSize);
-		test_Value(r, r==KErrNone||r==KErrAlreadyExists);
+		test(r==KErrNone||r==KErrAlreadyExists);
 		if(IsReset)
 			{
 			++TheFailCount;
 			WriteLogFile();
 			}
 		r=SetWriteFailOn(failCount);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.Delete(aName);
 		if(r==KErrNone)
 			break;
-		test_Equal(WriteFailValue,r);
+		test(r==WriteFailValue);
 		r=TheFs.ScanDrive(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.CheckDisk(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		++failCount;
 		}
 	r=TheFs.ControlIo(gSessionPath[0]-'A',KControlIoWriteFailOff);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.CheckDisk(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(!EntryExists(aName));
 	++TheOpNumber;
 	TheFailCount=0;
@@ -1281,18 +1274,18 @@
 		{
 		test.Printf(_L("failCount=%d\n"),failCount);
 		r=CreateEntry(aName,ETrue,aChain,aDirSize);
-		test_Value(r, r==KErrNone||r==KErrAlreadyExists);
+		test(r==KErrNone||r==KErrAlreadyExists);
 		if(IsReset)
 			{
 			++TheFailCount;
 			WriteLogFile();
 			}
 		r=SetWriteFailOn(failCount);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.RmDir(aName);
 		if(r==KErrNone)
 			break;
-		test_Equal(WriteFailValue,r);
+		test(r==WriteFailValue);
 		r=TheFs.ScanDrive(gSessionPath);
 		RDebug::Print(_L("%6d: ScanDrive = %d"), __LINE__, r);
 		if (r != KErrNone)
@@ -1301,16 +1294,16 @@
 			DumpFat();
 			DumpData(NULL, 0, 200);
 		}
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.CheckDisk(gSessionPath);
 		RDebug::Print(_L("%6d: CheckDisk = %d"), __LINE__, r);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		++failCount;
 		}
 	r=TheFs.ControlIo(gSessionPath[0]-'A',KControlIoWriteFailOff);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.CheckDisk(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(!EntryExists(aName));
 	++TheOpNumber;
 	TheFailCount=0;
@@ -1328,31 +1321,31 @@
 		{
 		test.Printf(_L("failCount=%d\n"),failCount);
 		r=DeleteEntry(aName,ETrue,EChainStd);
-		test_Value(r, r==KErrNone||r==KErrNotFound);
+		test(r==KErrNone||r==KErrNotFound);
 		if(IsReset)
 			{
 			++TheFailCount;
 			WriteLogFile();
 			}
 		r=SetWriteFailOn(failCount);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.MkDir(aName);
 		if(r==KErrNone)
 			break;
-		test_Equal(WriteFailValue,r);
+		test(r==WriteFailValue);
 		r=TheFs.ScanDrive(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.CheckDisk(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		++failCount;
 		}
 	r=TheFs.ControlIo(gSessionPath[0]-'A',KControlIoWriteFailOff);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.CheckDisk(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(EntryExists(aName));
 	r=DeleteEntry(aName,ETrue,EChainStd);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	++TheOpNumber;
 	TheFailCount=0;
 	}
@@ -1370,9 +1363,9 @@
 		{
 		test.Printf(_L("failCount=%d\n"),failCount);
 		r=CreateEntry(aOldName,aIsDir,aChain,aSize);
-		test_Value(r, r==KErrNone||r==KErrAlreadyExists);
+		test(r==KErrNone||r==KErrAlreadyExists);
 		r=DeleteEntry(aNewName,aIsDir,aChain);
-		test_Value(r, r==KErrNone||r==KErrNotFound);
+		test(r==KErrNone||r==KErrNotFound);
 		GetEntryDetails(aOldName,oldEntryInfo);
 		if(IsReset)
 			{
@@ -1380,29 +1373,34 @@
 			WriteLogFile();
 			}
 		r=SetWriteFailOn(failCount);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.Rename(aOldName,aNewName);
 		if(r==KErrNone)
 			break;
-		test_Equal(WriteFailValue,r);
+		if(r!=WriteFailValue)
+			{
+			test.Printf(_L("r=%d\n"),r);
+			test(EFalse);
+			}
+		test(r==WriteFailValue);
 		r=TheFs.ScanDrive(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.CheckDisk(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		// no start cluster if aSize==0
 		if(aSize!=0)
 			test(OneEntryExists(aOldName,aNewName));
 		++failCount;
 		}
 	r=TheFs.ControlIo(gSessionPath[0]-'A',KControlIoWriteFailOff);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.CheckDisk(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(EntryExists(aNewName) && !EntryExists(aOldName));
 	GetEntryDetails(aNewName,newEntryInfo);
 	test(IsSameEntryDetails(oldEntryInfo,newEntryInfo));
 	r=DeleteEntry(aNewName,aIsDir,aChain);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	++TheOpNumber;
 	TheFailCount=0;
 	}
@@ -1424,16 +1422,16 @@
 		{
 		test.Printf(_L("failCount=%d\n"),failCount);
 		r=CreateEntry(aOldName,EFalse,aChain,aFileSize);
-		test_Value(r, r==KErrNone||r==KErrAlreadyExists);
+		test(r==KErrNone||r==KErrAlreadyExists);
 		if(aBothExist)
 			{
 			r=CreateEntry(aNewName,EFalse,aChain,aFileSize);
-			test_Value(r, r==KErrNone||r==KErrAlreadyExists);
+			test(r==KErrNone||r==KErrAlreadyExists);
 			}
 		else
 			{
 			r=DeleteEntry(aNewName,EFalse,aChain);
-			test_Value(r, r==KErrNone||r==KErrNotFound);
+			test(r==KErrNone||r==KErrNotFound);
 			}
 		GetEntryDetails(aOldName,oldEntryInfo);
 		if(IsReset)
@@ -1442,15 +1440,15 @@
 			WriteLogFile();
 			}
 		r=SetWriteFailOn(failCount);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.Replace(aOldName,aNewName);
 		if(r==KErrNone)
 			break;
-		test_Equal(WriteFailValue,r);
+		test(r==WriteFailValue);
 		r=TheFs.ScanDrive(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.CheckDisk(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		if(!aBothExist && aFileSize!=0)
 			test(OneEntryExists(aOldName,aNewName));
 		else if(aBothExist)
@@ -1458,14 +1456,14 @@
 		++failCount;
 		}
 	r=TheFs.ControlIo(gSessionPath[0]-'A',KControlIoWriteFailOff);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.CheckDisk(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(EntryExists(aNewName) && !EntryExists(aOldName));
 	GetEntryDetails(aNewName,newEntryInfo);
 	test(IsSameEntryDetails(oldEntryInfo,newEntryInfo));
 	r=DeleteEntry(aNewName,EFalse,aChain);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	++TheOpNumber;
 	TheFailCount=0;
 	}
@@ -1482,35 +1480,35 @@
 		{
 		test.Printf(_L("failCount=%d\n"),failCount);
 		r=DeleteEntry(aName,EFalse,EChainStd);
-		test_Value(r, r==KErrNone||r==KErrNotFound);
+		test(r==KErrNone||r==KErrNotFound);
 		if(IsReset)
 			{
 			++TheFailCount;
 			WriteLogFile();
 			}
 		r=SetWriteFailOn(failCount);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		RFile file;
 		r=file.Create(TheFs,aName,EFileShareAny);
 		if(r==KErrNone)
 			{
 			r=TheFs.ControlIo(gSessionPath[0]-'A',KControlIoWriteFailOff);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			file.Close();
 			break;
 			}
-		test_Equal(WriteFailValue,r);
+		test(r==WriteFailValue);
 		r=TheFs.ScanDrive(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.CheckDisk(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		++failCount;
 		}
 	r=TheFs.CheckDisk(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(EntryExists(aName));
 	r=DeleteEntry(aName,EFalse,EChainStd);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	++TheOpNumber;
 	TheFailCount=0;
 	}
@@ -1533,28 +1531,28 @@
 			WriteLogFile();
 			}
 		r=SetWriteFailOn(failCount);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		RFile file;
  		r=file.Temp(TheFs,aPath,temp,EFileShareAny);
 		if(r==KErrNone)
 			{
 			r=TheFs.ControlIo(gSessionPath[0]-'A',KControlIoWriteFailOff);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			file.Close();
 			break;
 			}
 		test(r==WriteFailValue);
 		r=TheFs.ScanDrive(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.CheckDisk(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		++failCount;
 		}
 	r=TheFs.CheckDisk(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(EntryExists(temp));
 	r=DeleteEntry(temp,EFalse,EChainStd);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	++TheOpNumber;
 	TheFailCount=0;
 	}
@@ -1572,9 +1570,9 @@
 		{
 		test.Printf(_L("failCount=%d\n"),failCount);
 		r=CreateEntry(aOldName,EFalse,aChain,aFileSize);
-		test_Value(r, r==KErrNone||r==KErrAlreadyExists);
+		test(r==KErrNone||r==KErrAlreadyExists);
 		r=DeleteEntry(aNewName,EFalse,aChain);
-		test_Value(r, r==KErrNone||r==KErrNotFound);
+		test(r==KErrNone||r==KErrNotFound);
 		GetEntryDetails(aOldName,oldEntryInfo);
 		if(IsReset)
 			{
@@ -1583,34 +1581,34 @@
 			}
 		RFile file;
 		r=file.Open(TheFs,aOldName,EFileShareExclusive|EFileWrite);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=SetWriteFailOn(failCount);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file.Rename(aNewName);
 		if(r==KErrNone)
 			{
 			r=TheFs.ControlIo(gSessionPath[0]-'A',KControlIoWriteFailOff);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			file.Close();
 			break;
 			}
-		test_Equal(WriteFailValue,r);
+		test(r==WriteFailValue);
 		file.Close();
 		r=TheFs.ScanDrive(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.CheckDisk(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		if(aFileSize)
 			test(OneEntryExists(aOldName,aNewName));
 		++failCount;
 		}
 	r=TheFs.CheckDisk(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(EntryExists(aNewName) && !EntryExists(aOldName));
 	GetEntryDetails(aNewName,newEntryInfo);
 	test(IsSameEntryDetails(oldEntryInfo,newEntryInfo));
 	r=DeleteEntry(aNewName,EFalse,aChain);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	++TheOpNumber;
 	TheFailCount=0;
 	}
@@ -1629,12 +1627,12 @@
 		if(aAlreadyExists)
 			{
 			r=CreateEntry(aName,EFalse,aChain,aFileSize);
-			test_Value(r, r==KErrNone||r==KErrAlreadyExists);
+			test(r==KErrNone||r==KErrAlreadyExists);
 			}
 		else
 			{
 			r=DeleteEntry(aName,EFalse,aChain);
-			test_Value(r, r==KErrNone||r==KErrNotFound);
+			test(r==KErrNone||r==KErrNotFound);
 			}
 		if(IsReset)
 			{
@@ -1642,28 +1640,28 @@
 			WriteLogFile();
 			}
 		r=SetWriteFailOn(failCount);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		RFile file;
 		r=file.Replace(TheFs,aName,EFileShareAny);
 		if(r==KErrNone)
 			{
 			r=TheFs.ControlIo(gSessionPath[0]-'A',KControlIoWriteFailOff);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			file.Close();
 			break;
 			}
-		test_Equal(WriteFailValue,r);
+		test(r==WriteFailValue);
 		r=TheFs.ScanDrive(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.CheckDisk(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		++failCount;
 		}
 	r=TheFs.CheckDisk(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(EntryExists(aName));
 	r=DeleteEntry(aName,EFalse,aChain);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	if(!aAlreadyExists)
 		{
 		++TheOpNumber;
@@ -1689,54 +1687,54 @@
 		{
 		test.Printf(_L("failCount=%d\n"),failCount);
 		r=CreateEntry(aName,EFalse,aChain,aOldFileSize);
-		test_Value(r, r==KErrNone||r==KErrAlreadyExists);
+		test(r==KErrNone||r==KErrAlreadyExists);
 		if(IsReset)
 			{
 			++TheFailCount;
 			WriteLogFile();
 			}
 		r=SetWriteFailOn(failCount);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		RFile file;
 		r=file.Open(TheFs,aName,EFileShareAny|EFileWrite);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file.SetSize(aNewFileSize);
 		// close the file before testing the return value!
 		file.Close();
 		if(r==KErrNone)
 			{
 			r=TheFs.ControlIo(gSessionPath[0]-'A',KControlIoWriteFailOff);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			file.Close();
 			break;
 			}
 		file.Close();
-		test_Equal(WriteFailValue,r);
+		test(r==WriteFailValue);
 		r=TheFs.ScanDrive(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.CheckDisk(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file.Open(TheFs,aName,EFileShareAny|EFileWrite);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		TInt size;
 		r=file.Size(size);
-		test_KErrNone(r);
-		test_Value(size, size==aNewFileSize||size==aOldFileSize);
+		test(r==KErrNone);
+		test(size==aNewFileSize||size==aOldFileSize);
 		file.Close();
 		++failCount;
 		}
 	r=TheFs.CheckDisk(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RFile file;
 	r=file.Open(TheFs,aName,EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt fileSize;
 	r=file.Size(fileSize);
-	test_KErrNone(r);
-	test_Equal(aNewFileSize,fileSize);
+	test(r==KErrNone);
+	test(aNewFileSize==fileSize);
 	file.Close();
 	r=DeleteEntry(aName,EFalse,aChain);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	++TheFunctionNumber;
 	TheFailCount=0;
 	}
@@ -1753,7 +1751,7 @@
 	TInt newSize=(aFileSize>=aPos+aLength)?aFileSize:aPos+aLength;
 	HBufC8* desPtr;
 	desPtr=HBufC8::New(aLength);
-	test_NotNull(desPtr);
+	test(desPtr!=NULL);
 	TPtr8 des=desPtr->Des();
 	des.SetLength(aLength);
 	InitialiseWriteBuffer(des);
@@ -1761,64 +1759,64 @@
 		{
 		test.Printf(_L("failCount=%d\n"),failCount);
 		r=CreateEntry(aName,EFalse,aChain,aFileSize);
-		test_Value(r, r==KErrNone||r==KErrAlreadyExists);
+		test(r==KErrNone||r==KErrAlreadyExists);
 		if(IsReset)
 			{
 			++TheFailCount;
 			WriteLogFile();
 			}
 		r=SetWriteFailOn(failCount);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		RFile file;
 		r=file.Open(TheFs,aName,EFileShareAny|EFileWrite);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file.Write(aPos,des,aLength);
 		if(r==KErrNone)
 			{
 			r=TheFs.ControlIo(gSessionPath[0]-'A',KControlIoWriteFailOff);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			file.Close();
 			break;
 			}
-		test_Equal(WriteFailValue,r);
+		test(r==WriteFailValue);
 		file.Close();
 		r=TheFs.ScanDrive(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.CheckDisk(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		file.Open(TheFs,aName,EFileShareAny);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		TInt fileSize;
 		r=file.Size(fileSize);
 		// with fair scheduling enabled it's possible for the file 
 		// size to grow even if the write appears to have failed...
-//		test_Value(fileSize, fileSize==aFileSize||fileSize==newSize);
-		test_Value(fileSize, fileSize>=aFileSize && fileSize <= newSize);
+//		test(fileSize==aFileSize||fileSize==newSize);
+		test(fileSize>=aFileSize && fileSize <= newSize);
 
 		file.Close();
 		++failCount;
 		}
 	r=TheFs.CheckDisk(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RFile file;
 	r=file.Open(TheFs,aName,EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt fileSize;
 	r=file.Size(fileSize);
-	test_KErrNone(r);
-	test_Equal(newSize,fileSize);
+	test(r==KErrNone);
+	test(newSize==fileSize);
 	HBufC8* desPtr2;
 	desPtr2=HBufC8::New(aLength);
-	test_NotNull(desPtr2);
+	test(desPtr2!=NULL);
 	TPtr8 des2=desPtr2->Des();
 	des2.SetLength(aLength);
 	r=file.Read(aPos,des2,des2.Length());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=des2.Compare(des);
-	test_KErrNone(r);
+	test(r==0);
 	file.Close();
 	r=DeleteEntry(aName,EFalse,aChain);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	delete desPtr;
 	delete desPtr2;
 	++TheFunctionNumber;
@@ -1987,7 +1985,7 @@
 	ClearDiskData();
 
 	r=TheFs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	switch(TheFunctionNumber)
 		{
@@ -1995,15 +1993,15 @@
 		case(1):{
 				TestOperation1();
 				r=TheFs.MkDir(_L("\\fat\\"));
-				test_KErrNone(r);
+				test(r==KErrNone);
 				r=TheFs.MkDir(_L("\\test\\"));
-				test_KErrNone(r);
+				test(r==KErrNone);
 				r=TheFs.MkDir(_L("\\ANother\\"));
-				test_KErrNone(r);
+				test(r==KErrNone);
 				r=TheFs.MkDir(_L("\\test\\subdir1\\"));
-				test_KErrNone(r);
+				test(r==KErrNone);
 				r=TheFs.MkDir(_L("\\test\\subdir2\\"));
-				test_KErrNone(r);}
+				test(r==KErrNone);}
 		case(2):{
 				TestOperation2();
 				// add some filler files
@@ -2051,15 +2049,15 @@
 	DeleteEntry(_L("\\test\\subdir1\\FillerTwo"),EFalse,EChainStd);
 	DeleteEntry(_L("\\test\\subdir1\\FillerOne"),EFalse,EChainStd);
 	r=TheFs.RmDir(_L("\\test\\subdir2\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(_L("\\test\\subdir1\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(_L("\\ANother\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(_L("\\test\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(_L("\\fat\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	if (gFatBuf)
 		{
 		delete gFatBuf;
--- a/kerneltest/f32test/fileutils/inc/f32_test_utils.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/fileutils/inc/f32_test_utils.h	Wed Sep 01 12:34:56 2010 +0100
@@ -59,13 +59,6 @@
 
 TInt FormatDrive(RFs &aFs, TInt aDrive, TBool aQuickFormat); 
 
-//-----------------------------------------------------------------------------
-
-TBool CompareBuffers(const TDesC8& aBuf1, const TDesC8& aBuf2);
-TBool CompareBuffers(const TAny* apBuf1, TUint aBuf1Len, const TAny* apBuf2, TUint aBuf2Len);
-
-void  HexDump(const TDesC8& aBuf);
-void  HexDump(const TAny* apBuf, TUint aBufLen);
 
 //-----------------------------------------------------------------------------
 /** 
@@ -145,14 +138,11 @@
 
 
 
-TBool Is_Lffs(RFs &aFs, TInt aDrive);	//-- returns ETrue if "lffs" FS is mounted on this drive 
-TBool Is_Win32(RFs &aFs, TInt aDrive);	//-- returns ETrue if "Win32" FS is mounted on this drive (i.e this is emulator's drive C:)										
-TBool Is_ExFat(RFs &aFs, TInt aDrive);	//-- returns ETrue if "exFAT" FS is mounted on this drive 
-TBool Is_Automounter(RFs &aFs, TInt aDrive);	//-- returns ETrue if "Automounter" FS is mounted on this drive 
+TBool Is_Lffs(RFs &aFs, TInt aDrive);   //-- returns ETrue if "lffs" FS is mounted on this drive 
+TBool Is_Win32(RFs &aFs, TInt aDrive);  //-- returns ETrue if "win32" FS is mounted on this drive (i.e this is emulator's drive c:)
+TBool Is_ExFat(RFs &aFs, TInt aDrive);  //-- returns ETrue if "exFAT" FS is mounted on this drive 
+TBool Is_Automounter(RFs &aFs, TInt aDrive);  //-- returns ETrue if "Automounter" FS is mounted on this drive 
 
-TBool Is_HVFS(RFs &aFs, TInt aDrive);			//-- returns ETrue if "HVFS" is mounted on this drive (i.e PlatSim's drive C:)
-TBool Is_SimulatedSystemDrive(RFs &aFs, TInt aDrive);	//-- returns ETrue if "HVFS" or "Win32" FS is mounted on this drive
-														//	 (i.e drive C: of PlatSim or the emulator)
 
 TBool Is_Fat(RFs &aFs, TInt aDrive);    //-- returns ETrue if "FAT" FS (FAT12/16/32) is mounted on this drive 
 
@@ -162,8 +152,6 @@
 
 
 
-
-
 //#############################################################################
 //#  some  private helper functions  
 //#############################################################################
--- a/kerneltest/f32test/fileutils/inc/tf32testtimer.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-// 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:
-// @file
-// 
-// 
-//
-
-
-class TF32TestTimer
-{
-public:
-    TF32TestTimer();
-
-    void Start();
-    void Stop();
-
-    TInt64 TimeTaken() const;
-    TTimeIntervalMicroSeconds Time() const;
-    TTimeIntervalMicroSeconds32 Time32() const;
-    int TimeInMicroSeconds() const;
-    int TimeInMilliSeconds() const;
-
-    static TInt TimeInMilliSeconds(TTimeIntervalMicroSeconds aTime);
-    static TInt TimeInMilliSeconds(TTimeIntervalMicroSeconds32 aTime);
-
-protected:
-    TInt64 Diff(TUint32 aTicks) const;
-
-protected:
-    TInt iFastCounterFreq;
-    TUint32 startTicks;
-    TUint32 endTicks;
-};
-
-
-class TF32TestTimer2: public TF32TestTimer
-{
-public:
-    void Stop2();
-
-    TInt64 TimeTaken2() const;
-    TTimeIntervalMicroSeconds32 Time2() const;
-    int Time2InMicroSeconds() const;
-
-private:
-    TUint32 endTicks2;
-};
-
-inline TF32TestTimer::TF32TestTimer()
-{   
-    TInt r = HAL::Get(HAL::EFastCounterFrequency, iFastCounterFreq);
-    test_KErrNone(r);
-}
-
-inline void TF32TestTimer::Start()
-{
-    startTicks = User::FastCounter();
-}
-
-inline void TF32TestTimer::Stop()
-{
-    endTicks = User::FastCounter();;
-}
-
-inline void TF32TestTimer2::Stop2()
-{
-    endTicks2 = User::FastCounter();;
-}
-
-inline TInt64 TF32TestTimer::Diff(TUint32 aTicks) const
-{
-    if (aTicks == startTicks)
-        {
-        test.Printf(_L("Warning: tick not advanced"));
-        }
-
-    TInt64 diff;
-    if (aTicks > startTicks)
-        {
-        diff = static_cast<TInt64>(aTicks) - static_cast<TInt64>(startTicks);
-        }
-    else
-        {
-        // handle counter rollover
-        diff = ((static_cast<TInt64>(KMaxTUint32) + 1 + aTicks) - static_cast<TInt64>(startTicks));
-        }
-    //RDebug::Printf("%x %x %ld", aTicks, startTicks, diff);
-    diff *= TInt64(1000000);
-    diff /= TInt64(iFastCounterFreq);
-    
-    return diff;
-}
-
-inline TInt64 TF32TestTimer::TimeTaken() const
-{
-    return Diff(endTicks);
-}
-
-inline TInt64 TF32TestTimer2::TimeTaken2() const
-{
-    return Diff(endTicks2);
-}
-
-inline int TF32TestTimer::TimeInMicroSeconds() const
-{
-    return static_cast <int>(TimeTaken());
-}
-
-inline int TF32TestTimer2::Time2InMicroSeconds() const
-{
-    return static_cast <int>(TimeTaken2());
-}
-
-inline TTimeIntervalMicroSeconds TF32TestTimer::Time() const
-{
-    return TimeTaken();
-}
-
-inline TTimeIntervalMicroSeconds32 TF32TestTimer2::Time2() const
-{    
-    return static_cast <int>(TimeTaken2());
-}
-
-inline TTimeIntervalMicroSeconds32 TF32TestTimer::Time32() const
-{
-    return static_cast <int>(TimeTaken());
-}
-
-inline int TF32TestTimer::TimeInMilliSeconds() const
-{
-    return static_cast <int>(TimeTaken() / 1000);
-}
-
-TInt TF32TestTimer::TimeInMilliSeconds(TTimeIntervalMicroSeconds aTime)
-{
-    return static_cast <int>(aTime.Int64()/static_cast<TInt64>(1000));
-}
-
-TInt TF32TestTimer::TimeInMilliSeconds(TTimeIntervalMicroSeconds32 aTime)
-{
-    return static_cast <int>(aTime.Int()/1000);
-}
-
--- a/kerneltest/f32test/fileutils/src/f32_test_utils.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/fileutils/src/f32_test_utils.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -36,196 +36,6 @@
 static CConsoleBase* pConsole = NULL;   //-- pointer to the text console for printing out data
 static TBool  bPrintOutEnabled = ETrue; //-- global flag, if EFalse, all printing out is disabled
 
-
-
-//-------------------------------------------------------------------------------------------------------------------
-
-/**
-    Prints out a hex dump of a descriptor contents
-    @param  aBuf data descriptor to dump
-*/
-void  F32_Test_Utils::HexDump(const TDesC8& aBuf)
-{
-    HexDump(aBuf.Ptr(), aBuf.Size());
-}
-
-//-------------------------------------------------------------------------------------------------------------------
-/**
-    Prints out a hex dump of a buffer
-    @param  apBuf   pointer to the data to dump
-    @param  aBufLen buffer length
-*/
-void  F32_Test_Utils::HexDump(const TAny* apBuf, TUint aBufLen)
-{
-    DoPrintf(_L("~ F32_Test_Utils::HexDump() size:%u\n"), aBufLen);
-  
-    ASSERT(apBuf);
-    
-    if(!aBufLen)
-        return;
-
-    const TUint colDmpWidth = 16;
-    const TUint8* pBuf = (const TUint8*)apBuf;
-    TBuf<256> buf1;
-    TBuf<64>  buf2;
-
-    TUint dumpPos;
-    
-    for(dumpPos=0; dumpPos < aBufLen-1; )
-    {
-        buf1.Format(_L("%06X: "), dumpPos);
-        buf2.Zero();
-
-        for(TUint i=0; i<colDmpWidth; ++i)
-        {
-            buf1.AppendFormat(_L("%02x "), pBuf[dumpPos+i]);
-        
-            const TChar ch = pBuf[dumpPos+i];
-            if(ch.IsPrint())
-                buf2.Append(ch);
-            else    
-                buf2.Append(_L("."));
-            
-
-            if(++dumpPos >= aBufLen)
-            {    
-                while(++i < colDmpWidth)
-                {
-                    buf1.Append(_L("   "));
-                    buf2.Append(_L(" "));
-                }
-
-                break;
-            }
-        }
-
-        buf1.Append(buf2);
-        DoPrintf(buf1);
-    
-    }
-
-    DoPrintf(_L("\n"));
-
-}
-
-
-//-------------------------------------------------------------------------------------------------------------------
-/**
-    Compare 2 buffers and print out the difference if there is any.
-    Buffer sizes must be the same and non-0
-
-    @param  aBuf1   buffer 1 descriptor
-    @param  aBuf2   buffer 2 descriptor
-    
-    @return ETrue if buffers are the same, EFalse otherwise
-*/
-TBool F32_Test_Utils::CompareBuffers(const TDesC8& aBuf1, const TDesC8& aBuf2)
-{
-    return CompareBuffers(aBuf1.Ptr(), aBuf1.Size(), aBuf2.Ptr(), aBuf2.Size());
-}
-
-//-------------------------------------------------------------------------------------------------------------------
-/**
-    Compare 2 buffers and print out the difference if there is any.
-    Buffer sizes must be the same and non-0
-
-    @param  apBuf1   pointer to the buffer 1 
-    @param  aBuf1Len buffer1 length
-    @param  apBuf2   pointer to the buffer 2 
-    @param  aBuf2Len buffer2 length
-
-    @return ETrue if buffers are the same, EFalse otherwise
-*/
-TBool F32_Test_Utils::CompareBuffers(const TAny* apBuf1, TUint aBuf1Len, const TAny* apBuf2, TUint aBuf2Len)
-{
-    ASSERT(apBuf1 && apBuf2);
-    
-    if(aBuf1Len != aBuf2Len)
-    {
-        DoPrintf(_L("~ F32_Test_Utils::CompareBuffers() different sizes! %u:%u\n"), aBuf1Len, aBuf2Len);
-        ASSERT(0);
-        return EFalse;
-    }
-
-    if(!aBuf1Len)
-    {//-- empty buffers to compare
-        return ETrue;
-    }
-
-
-    const TUint8* pBuf1 = (const TUint8*)apBuf1;
-    const TUint8* pBuf2 = (const TUint8*)apBuf2;   
-        
-    if(!Mem::Compare(pBuf1, aBuf1Len, pBuf2, aBuf2Len))
-        return ETrue; //-- buffers are the same. 
-
-
-    //-- the buffers' contents are different
-    TUint diffpos;
-    TBuf<256> buf1;
-    TBuf<100> buf2;
-
-    const TUint colDmpWidth = 16;
-    TBool bBannerPrinted = EFalse;
-
-    //-- dump chunks of the buffer with differences only
-    for(diffpos=0; diffpos<aBuf1Len-1; )
-    {
-        if(pBuf1[diffpos] == pBuf2[diffpos])
-            {
-            ++diffpos;
-            continue;
-            }
-
-        if(!bBannerPrinted)
-        {
-            bBannerPrinted = ETrue;
-            DoPrintf(_L("~ F32_Test_Utils::CompareBuffers() buffers' contents are different starting at pos:%u (0x%x). Hexdump:\n"), diffpos, diffpos);
-
-        }
-
-        //-- difference found, dump chunks of the buffer with differences only
-        TUint dumpPos = (diffpos >> 4) << 4; //-- round down to 16
-
-        buf1.Format(_L("%06X: "), dumpPos);
-        buf2.Format(_L("|"));
-        
-        for(TUint i=0; i<colDmpWidth; ++i)
-        {
-            buf1.AppendFormat(_L("%02x"), pBuf1[dumpPos+i]);
-            buf2.AppendFormat(_L("%02x"), pBuf2[dumpPos+i]);
-
-            if(i < colDmpWidth-1)
-            {
-                buf1.Append(_L(" "));
-                buf2.Append(_L(" "));
-            }
-
-        
-            if(++diffpos >= aBuf1Len)
-            {//-- pad the dump with spaces
-                while(++i < colDmpWidth)
-                {
-                    buf1.Append(_L("   "));
-                    buf2.Append(_L("   "));
-                }
-            
-                break;
-            }
-
-        }
-
-        buf1.Append(buf2);
-        DoPrintf(buf1);
-    }
-    
-    DoPrintf(_L("\n"));
-
-    return EFalse;
-}
-
-
-//-------------------------------------------------------------------------------------------------------------------
 /**
     Set the console where the ouput will go.
     @param  apConsole pointer to the console. if NULL, the print out will be debug port only.
@@ -438,7 +248,6 @@
 _LIT(KFsName_Win32, "Win32");
 _LIT(KFsName_ExFAT, "ExFat");
 _LIT(KFsName_AutoMonuter, "automounter");
-_LIT(KFsName_HVFS, "HVFS");
 
 /**  @return ETrue if "Automounter" FS is mounted on this drive */
 TBool F32_Test_Utils::Is_Automounter(RFs &aFs, TInt aDrive)
@@ -464,7 +273,7 @@
 
 }
    
-/** @return ETrue if "Win32" FS is mounted on this drive (i.e this is emulator's drive C:) */
+/** @return ETrue if "Win32" FS is mounted on this drive (i.e this is emulator's drive c:) */
 TBool F32_Test_Utils::Is_Win32(RFs &aFs, TInt aDrive)   
 {
 	ASSERT(aDrive >= EDriveA && aDrive <= EDriveZ);
@@ -475,29 +284,6 @@
     return (f.CompareF(KFsName_Win32) == 0 );
 }
 
-/** @return ETrue if "HVFS" is mounted on this drive (i.e PlatSim's drive C:) */
-TBool F32_Test_Utils::Is_HVFS(RFs &aFs, TInt aDrive)
-{
-	ASSERT(aDrive >= EDriveA && aDrive <= EDriveZ);
-    TFSName f;
-	TInt r = aFs.FileSystemName(f, aDrive);
-    __ASSERT_ALWAYS((r==KErrNone) && (f.Length()>0), User::Invariant());
-
-    return (f.CompareF(KFsName_HVFS) == 0);
-}
-
-/** @return ETrue if "HVFS" or "Win32" FS is mounted on this drive
- * 			(i.e drive C: of PlatSim or the emulator) */
-TBool F32_Test_Utils::Is_SimulatedSystemDrive(RFs &aFs, TInt aDrive)
-{
-	ASSERT(aDrive >= EDriveA && aDrive <= EDriveZ);
-    TFSName f;
-	TInt r = aFs.FileSystemName(f, aDrive);
-    __ASSERT_ALWAYS((r==KErrNone) && (f.Length()>0), User::Invariant());
-
-    return (f.CompareF(KFsName_HVFS) == 0 || f.CompareF(KFsName_Win32) == 0);
-}
-
 /** @return ETrue if the filesystem if FAT (fat12/16/32) */
 TBool F32_Test_Utils::Is_Fat(RFs &aFs, TInt aDrive)
 {
--- a/kerneltest/f32test/fsstress/t_ramstr.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/fsstress/t_ramstr.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define	__E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32math.h>
@@ -84,12 +83,12 @@
 	TBuf<128> fileName=aBaseName;
 	fileName.AppendNum(aX);
 	TInt r=TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 //	r=TheFs.CheckDisk(fileName);
 //	if (r!=KErrNone && r!=KErrNotSupported)
 //		{
 //		test.Printf(_L("ERROR:: CheckDisk returned %d\n"),r);
-//		test_KErrNone(r);
+//		test(r==KErrNone);
 //		}
 	test.Printf(_L("Deleted File %d\n"),aX);
 	return(KErrNone);
@@ -104,7 +103,7 @@
 	testBuf.SetLength(testBuf.MaxSize());
 	Mem::Fill(bufPtr,testBuf.MaxSize(),aCluster);
 	TInt r=aFile.Write(testBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 LOCAL_C void SeekToCluster(RFile& aFile,TInt aCluster)
@@ -114,7 +113,7 @@
 	{
 	TBuf8<508> seekBuf(508);
 	TInt r=aFile.Read(aCluster*testBuf.MaxSize(),seekBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(seekBuf[0]==(TUint8)aCluster && seekBuf[507]==(TUint8)aCluster);
 	}
 
@@ -125,10 +124,10 @@
 	{
 	TBuf8<508> seekBuf(508);
 	TInt r=aFile.Read(aCluster1*testBuf.MaxSize(),seekBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(seekBuf[0]==(TUint8)aCluster1 && seekBuf[507]==(TUint8)aCluster1);
 	r=aFile.Read(aCluster2*testBuf.MaxSize(),seekBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(seekBuf[0]==(TUint8)aCluster2 && seekBuf[507]==(TUint8)aCluster2);
 	}
 
@@ -159,9 +158,9 @@
 	RFile f1,f2;
 
 	TInt r=f1.Replace(TheFs,_L("BIGFILE1.TST"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f2.Replace(TheFs,_L("BIGFILE2.TST"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TInt maxListLength=4;
 	TInt i=0,k=0;
@@ -206,9 +205,9 @@
 	f1.Close();
 	f2.Close();
 	r=TheFs.Delete(_L("BIGFile1.tst"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("BIGFile2.tst"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckDisk();
 	}
 
@@ -221,9 +220,9 @@
 	RFile f1,f2;
 
 	TInt r=f1.Replace(TheFs,_L("BIGFILE1.TST"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f2.Replace(TheFs,_L("BIGFILE2.TST"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	WriteCluster(f1,0);
 	WriteCluster(f1,1);
@@ -240,9 +239,9 @@
 	f1.Close();
 	f2.Close();
 	r=TheFs.Delete(_L("BIGFile1.tst"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("BIGFile2.tst"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckDisk();
 	}
 
@@ -257,10 +256,10 @@
 	TheSeed=917824;
 	TInt i=0,j=0;
 	TInt r=f1.Replace(TheFs,_L("BIGFILE1.TST"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=f1.SetSize(65534);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	for(i=0;i<=15;i++)
 		WriteCluster(f1,i);
@@ -274,7 +273,7 @@
 
 	test.Next(_L("Increase Size"));
 	r=f1.SetSize(1048577);
-	test_Value(r, r == KErrNone || r==KErrDiskFull);
+	test(r==KErrNone || r==KErrDiskFull);
 	if (r==KErrDiskFull)
 		{
 		test.Printf(_L("File too big\n"));
@@ -292,7 +291,7 @@
 
 	TInt newPos=8192;
 	r=f1.Seek(ESeekStart,newPos);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("Write more data"));
 	for(i=16;i<83;i++)
@@ -308,7 +307,7 @@
 
 	test.Next(_L("Reduce file size"));
 	r=f1.SetSize(135000);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("Test data still present"));
 	for (j=0;j<200;j++)
@@ -341,7 +340,7 @@
 	{
 
 	TInt r=iFile.Read(0,iData);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 void TFileReader::Next(TUint8& aVal,TInt& aLength)
@@ -353,7 +352,7 @@
 	if (iPos==iData.Length())
 		{
 		TInt r=iFile.Read(iData);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		iPos=0;
 		if (iData.Length()==0)
 			{
@@ -477,13 +476,13 @@
 	HBufC8* dataBuf=HBufC8::NewL(KMaxBufferLength);
 
 	TInt r=f[0].Replace(TheFs,_L("TEST1.DAT"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f[1].Replace(TheFs,_L("TEST2.DAT"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f[2].Replace(TheFs,_L("TEST3.DAT"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f[3].Replace(TheFs,_L("TEST4.DAT"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TInt size=0;
 	TInt iteration=0;
@@ -508,7 +507,7 @@
 			TInt s=len*mult[fileNum];
 			TInt filePos=pos*mult[fileNum];
 			r=f[fileNum].Seek(ESeekStart,filePos);
-			test_KErrNone(r);
+			test(r==KErrNone);
 
 			while(s>0)
 				{
@@ -517,7 +516,7 @@
 				r=f[fileNum].Write(*dataBuf);
 				if (r==KErrDiskFull)
 					goto End;
-				test_KErrNone(r);
+				test(r==KErrNone);
 				s-=l;
 				}
 			
@@ -538,7 +537,7 @@
 				{
 				TInt fileNum=(order+i)%KMaxFiles;
 				r=f[fileNum].SetSize(size*mult[fileNum]);
-				test_KErrNone(r);
+				test(r==KErrNone);
 				}
 			CheckFileContents(&f[0]);
 			}
@@ -557,10 +556,10 @@
 	{
 	test.Start(_L("Test multiple file creation, deletion and resize operations"));
 	TInt r=TheFs.MkDirAll(_L("\\F32-TST\\BIGDIRECTORY\\"));
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	TFileName sessionPath;
 	r=TheFs.SessionPath(sessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TInt index=0;
 	TBuf<128> fileName=_L("\\F32-TST\\BIGDIRECTORY\\FILE");
@@ -571,7 +570,7 @@
 		if (r!=KErrNone)
 			break;
 
-		test_KErrNone(r);
+		test(r==KErrNone);
 		
 #if defined(__WINS__)
 		if (index==32 && sessionPath[0]=='C')
@@ -602,7 +601,7 @@
 		baseName=fileName;
 		baseName.AppendNum(index);
 		r=file.Open(TheFs,baseName,EFileRead|EFileWrite);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test.Printf(_L("Resized %S from %d to %d\n"),&baseName,anInitialSize,anInitialSize*2);		
 		r=file.SetSize(2*anInitialSize);
 		test((r==KErrNone)||(r==KErrDiskFull));
--- a/kerneltest/f32test/fsstress/t_remote.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/fsstress/t_remote.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -19,7 +19,6 @@
 #include <f32file.h>
 #endif
 #if !defined(__E32TEST_H__)
-#define	__E32TEST_EXTENSION__
 #include <e32test.h>
 #endif
 #if !defined(__T_STD_H__)
@@ -109,15 +108,15 @@
 	fn = _L("Z:\\TEST\\T_FSRV.CPP");
 	fn[0] = gExeFileName[0];
 	TInt r=file1.Open(TheFs,fn,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fn = _L("Z:\\TEST\\T_FILE.CPP");
 	fn[0] = gExeFileName[0];
 	r=file2.Open(TheFs,fn,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fn = _L("Z:\\TEST\\T_FSRV.CPP");
 	fn[0] = gExeFileName[0];
 	r=file3.Open(TheFs,fn,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	CFileList* list;
 	TOpenFileScan fileScan(TheFs);
@@ -165,28 +164,28 @@
 
 	RFs fs1,fs2,fs3,fs4;
 	TInt r=fs1.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs3.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs4.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RFile file1,file2,file3;
 	TFileName fn;
 	fn = _L("Z:\\TEST\\T_FSRV.CPP");
 	fn[0] = gExeFileName[0];
 	r=file1.Open(fs2,fn,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fn = _L("Z:\\TEST\\T_FILE.CPP");
 	fn[0] = gExeFileName[0];
 	r=file2.Open(fs2,fn,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fn = _L("Z:\\TEST\\T_FSRV.CPP");
 	fn[0] = gExeFileName[0];
 	r=file3.Open(fs2,fn,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	CFileList* list;
 	TOpenFileScan fileScan(TheFs);
@@ -238,39 +237,39 @@
 
 	RFs fs1,fs2,fs3,fs4;
 	TInt r=fs1.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs3.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs4.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RFile file1,file2,file3;
 	TFileName fn;
 	fn = _L("Z:\\TEST\\T_FSRV.CPP");
 	fn[0] = gExeFileName[0];
 	r=file1.Open(fs2,fn,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fn = _L("Z:\\TEST\\T_FILE.CPP");
 	fn[0] = gExeFileName[0];
 	r=file2.Open(fs2,fn,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fn = _L("Z:\\TEST\\T_FSRV.CPP");
 	fn[0] = gExeFileName[0];
 	r=file3.Open(fs2,fn,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Open(fs4,fn,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fn = _L("Z:\\TEST\\T_FILE.CPP");
 	fn[0] = gExeFileName[0];
 	r=file2.Open(fs4,fn,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fn = _L("Z:\\TEST\\T_FSRV.CPP");
 	fn[0] = gExeFileName[0];
 	r=file3.Open(fs4,fn,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	CFileList* list;
 	TOpenFileScan fileScan(TheFs);
@@ -338,51 +337,51 @@
 	RFs fs1,fs2,fs3,fs4;
 	TFileName fn;
 	TInt r=fs1.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs3.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs4.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RDir dir1,dir2,dir3,dir4;
 	fn = _L("Z:\\TEST\\*.XDE");
 	fn[0] = gExeFileName[0];
 	r=dir1.Open(TheFs,fn,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=dir2.Open(TheFs,fn,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=dir3.Open(TheFs,fn,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=dir4.Open(TheFs,fn,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RFile file1,file2,file3;
 	fn = _L("Z:\\TEST\\T_FSRV.CPP");
 	fn[0] = gExeFileName[0];
 	r=file1.Open(fs2,fn,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fn = _L("Z:\\TEST\\T_FILE.CPP");
 	fn[0] = gExeFileName[0];
 	r=file2.Open(fs2,fn,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fn = _L("Z:\\TEST\\T_FSRV.CPP");
 	fn[0] = gExeFileName[0];
 	r=file3.Open(fs2,fn,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	RDir dir5,dir6,dir7,dir8;
 	fn = _L("Z:\\TEST\\*.XDE");
 	fn[0] = gExeFileName[0];
 	r=dir5.Open(fs4,fn,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=dir6.Open(fs4,fn,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=dir7.Open(fs4,fn,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=dir8.Open(fs4,fn,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	CFileList* list;
 	TOpenFileScan fileScan(TheFs);
@@ -440,27 +439,27 @@
 	fn = _L("Z:\\TEST\\T_FSRV.CPP");
 	fn[0] = gExeFileName[0];
 	TInt r=file1.Open(TheFs,fn,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fn = _L("Z:\\TEST\\T_FILE.CPP");
 	fn[0] = gExeFileName[0];
 	r=file2.Open(TheFs,fn,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fn = _L("Z:\\TEST\\T_FSRV.CPP");
 	fn[0] = gExeFileName[0];
 	r=file3.Open(TheFs,fn,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	RDir dir1,dir2,dir3,dir4;
 	fn = _L("Z:\\TEST\\*.XDE");
 	fn[0] = gExeFileName[0];
 	r=dir1.Open(TheFs,fn,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=dir2.Open(TheFs,fn,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=dir3.Open(TheFs,fn,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=dir4.Open(TheFs,fn,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	CFileList* list;
 	TOpenFileScan fileScan(TheFs);
@@ -526,7 +525,7 @@
 	for (; i<maxNumberSessions; i++)
 		{
 		r=session[i].Connect();
-		test_KErrNone(r);
+		test(r==KErrNone);
 		testObject[i].Initialise(session[i]);
 		testObject[i].SetSessionPath(aDrive);
 		testObject[i].RunTests(aTest);		//	Run the set of tests for each session
@@ -552,7 +551,7 @@
 		testObject[i+1].testDriveList(aTest);
 	//	Reconnect session[i]	
 		r=session[i].Connect();
-		test_KErrNone(r);
+		test(r==KErrNone);
 		testObject[i].Initialise(session[i]);
 		testObject[i].SetSessionPath(aDrive);
 		testObject[i].testSetVolume(aTest);
@@ -570,7 +569,7 @@
 		testObject[i].testDriveList(aTest);
 	//	Reconnect session[i+1]	
 		r=session[i+1].Connect();
-		test_KErrNone(r);
+		test(r==KErrNone);
 		testObject[i+1].Initialise(session[i+1]);
 		testObject[i+1].SetSessionPath(aDrive);
 		testObject[i].testSetVolume(aTest);
--- a/kerneltest/f32test/fsstress/t_rmain.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/fsstress/t_rmain.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -19,7 +19,6 @@
 #include <f32file.h>
 #endif
 #if !defined(__E32TEST_H__)
-#define	__E32TEST_EXTENSION__
 #include <e32test.h>
 #endif
 #if !defined(__E32HAL_H__)
@@ -78,11 +77,11 @@
 	RFormat format;
 	TInt count;
 	TInt r=format.Open(TheFs,driveBuf,EHighDensity,count);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	while(count)
 		{
 		TInt r=format.Next(count);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	format.Close();
 	}
@@ -108,12 +107,12 @@
 	gSessionPath=_L("?:\\F32-TST\\");
 	TChar driveLetter;
 	TInt r=TheFs.DriveToChar(aDrive,driveLetter);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	gSessionPath[0]=(TText)driveLetter;
 	r=TheFs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.MkDirAll(gSessionPath);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	TheFs.ResourceCountMarkStart();
 	
 	switch(aDrive)
@@ -270,7 +269,7 @@
 	test.Title();
 	test.Start(_L("Starting tests..."));
 	r=TheFs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 //	TheFs.SetAllocFailure(gAllocFailOn);
 
 //	Default drive testing
@@ -279,7 +278,7 @@
 //	Remote drive testing
 	RThread clientThreadQ;
 	r=clientThreadQ.Create(_L("TestRemoteDrive"), TestRemoteDrive, KDefaultStackSize,KHeapSize,KHeapSize,NULL);	
-	test_KErrNone(r);	
+	test(r==KErrNone);	
 	TRequestStatus statq;
 	clientThreadQ.Logon(statq);
 	test.Next(_L("Resume clientThreadQ"));	
@@ -288,7 +287,7 @@
 //	MARM CF card drive testing (WINS emulates CF card on X)
 	RThread clientThreadX;
 	r=clientThreadX.Create(_L("TestXDrive"), TestXDrive, KDefaultStackSize,KHeapSize,KHeapSize,NULL);	
-	test_KErrNone(r);	
+	test(r==KErrNone);	
 	TRequestStatus statx;
 	clientThreadX.Logon(statx);
 	test.Next(_L("Resume clientThreadX"));	
@@ -297,7 +296,7 @@
 //	MARM RAM drive testing (WINS emulates FAT filesystem on Y)  	
 	RThread clientThreadY;
 	r=clientThreadY.Create(_L("TestYDrive"), TestYDrive, KDefaultStackSize,KHeapSize,KHeapSize,NULL);	
-	test_KErrNone(r);	
+	test(r==KErrNone);	
 	TRequestStatus staty;
 	clientThreadY.Logon(staty);
 	test.Next(_L("Resume clientThreadY"));	
--- a/kerneltest/f32test/fsstress/t_sesfs.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/fsstress/t_sesfs.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -262,24 +262,20 @@
 	test(w.iDrive.iDriveAtt==KDriveAttSubsted);
 	test(w.iDrive.iMediaAtt==v.iDrive.iMediaAtt);
 	test(w.iUniqueID==v.iUniqueID);
-
-    if(v.iDrive.iType != EMediaRam) // We can't assume that RAM disk will be the same size since last recorded...
-    {
-	    test(w.iSize==v.iSize);
+	test(w.iSize==v.iSize);
 
-    // If this test is being run under windows using drive C then skip free space comparison
-    // as it is likely to fail as the windows file system is unlike to have static freespace
+// If this test is being run under windows using drive C then skip free space comparison
+// as it is likely to fail as the windows file system is unlike to have static freespace
 #ifdef __WINS__
-	    if(User::UpperCase(gTestSessionPath[0]) != 'C')
-		    {
+	if(User::UpperCase(gTestSessionPath[0]) != 'C')
+		{
 #endif
-		    test(w.iFree==v.iFree);
+		test(w.iFree==v.iFree);
 
 #ifdef __WINS__
-		    }
+		}
 #endif
-    }
-
+	
 	test(w.iName==v.iName);
 	TDriveList driveList;
 	r=iFs.DriveList(driveList);
--- a/kerneltest/f32test/group/b_file.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/b_file.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,13 +15,12 @@
 // 
 //
 
-TARGET         b_file.exe
+TARGET         b_file.exe        
 TARGETTYPE     EXE
 SOURCEPATH     ../server
 SOURCE         b_file.cpp
 SOURCE         t_main.cpp 
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 LIBRARY        euser.lib efsrv.lib hal.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/kerneltest/f32test/group/b_mtst.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/b_mtst.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,8 +21,7 @@
 SOURCE         b_mtst.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
-SOURCE         t_chlffs.cpp
+SOURCE         t_chlffs.cpp 
 LIBRARY        euser.lib efsrv.lib hal.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 USERINCLUDE    ../server
--- a/kerneltest/f32test/group/b_open.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/b_open.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 SOURCE         b_open.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 LIBRARY        euser.lib efsrv.lib hal.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/kerneltest/f32test/group/b_osfil.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/b_osfil.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,8 +21,7 @@
 SOURCE         b_osfil.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
-SOURCE         t_chlffs.cpp
+SOURCE         t_chlffs.cpp 
 LIBRARY        euser.lib efsrv.lib hal.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 USERINCLUDE    ../server
--- a/kerneltest/f32test/group/b_rand.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/b_rand.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,8 +21,7 @@
 SOURCE         b_rand.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
-SOURCE         t_chlffs.cpp
+SOURCE         t_chlffs.cpp 
 LIBRARY        euser.lib efsrv.lib hal.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 USERINCLUDE    ../server
--- a/kerneltest/f32test/group/b_rep.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/b_rep.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,8 +21,7 @@
 SOURCE         b_rep.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
-SOURCE         t_chlffs.cpp
+SOURCE         t_chlffs.cpp 
 LIBRARY        euser.lib efsrv.lib hal.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 USERINCLUDE    ../server
--- a/kerneltest/f32test/group/bld.inf	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/bld.inf	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-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"
@@ -26,9 +26,9 @@
 
 PRJ_TESTEXPORTS
 
-../../../userlibandfileserver/fileserver/shostmassstorage/client/rusbhostmslogicalunit.h        OS_LAYER_PLATFORM_EXPORT_PATH(rusbhostmslogicalunit.h)
+../../../userlibandfileserver/fileserver/shostmassstorage/client/rusbhostmslogicalunit.h        /epoc32/include/
 
-../../../userlibandfileserver/fileserver/inc/runtests.h                         OS_LAYER_PLATFORM_EXPORT_PATH(runtests.h)
+../../../userlibandfileserver/fileserver/inc/runtests.h                         /epoc32/include/
 
 PRJ_TESTMMPFILES
 ../../e32test/mediaext/t_nfe
@@ -156,7 +156,7 @@
 //t_scndr1    manual //-- obsolte; replaced by t_scn32dr1
 //t_scndr2    manual //-- obsolte; replaced by t_scn32dr2
 //T_MMC     manual
-t_pwstr
+t_pwstr manual
 
 
 t_fsys
@@ -252,7 +252,7 @@
 
 t_swapfsys manual
 #include "../filesystem/fat/group/fatfs.inf"
-#include "../filesystem/automounter/automounter.inf"
+#include "../filesystem/automounter/bld.inf"
 
 
 #include "perf_test.inf"
@@ -263,14 +263,14 @@
 
 t_localtime 
 
-t_dircache
-
 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
 t_file64bit manual
 fhserver64bit       support
 #include "../plugins/version_2/file64bit/group/file64bit_plugin.inf"
 #endif
 
+t_ftrace
+
 t_surrogatepair
 
 // this test loads a actual codepage dll (cp932.dll),  should be the last test.
--- a/kerneltest/f32test/group/clean_prepdc.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/clean_prepdc.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,8 +21,7 @@
 SOURCE         clean_prepdc.cpp
 SOURCE         t_main.cpp 
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
-SOURCE         t_chlffs.cpp
+SOURCE         t_chlffs.cpp 
 LIBRARY        euser.lib efsrv.lib hal.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 USERINCLUDE    ../server
--- a/kerneltest/f32test/group/t_alert.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_alert.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 SOURCE         t_alert.cpp
 SOURCE         t_main.cpp 
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp 
 LIBRARY        euser.lib efsrv.lib hal.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/kerneltest/f32test/group/t_appins.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_appins.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -20,8 +20,7 @@
 SOURCEPATH	../server
 SOURCE         t_appins.cpp t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
-SOURCE         t_chlffs.cpp
+SOURCE         t_chlffs.cpp 
 LIBRARY        euser.lib efsrv.lib hal.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 USERINCLUDE    ../server
--- a/kerneltest/f32test/group/t_bigfile.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_bigfile.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 SOURCE         T_BIGFILE.CPP
 SOURCE         T_MAIN.CPP
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp 
 LIBRARY        EUSER.LIB EFSRV.LIB HAL.LIB
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/kerneltest/f32test/group/t_blockmap.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_blockmap.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 SOURCE		t_blockmap.cpp
 SOURCE		t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp 
 LIBRARY        euser.lib efsrv.lib hal.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/kerneltest/f32test/group/t_cfileman.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_cfileman.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -24,7 +24,6 @@
 SOURCEPATH     ../server
 SOURCE	       t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 USERINCLUDE    ../server
--- a/kerneltest/f32test/group/t_chkuid.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_chkuid.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 SOURCE         t_chkuid.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp 
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_clobbr.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_clobbr.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -22,7 +22,6 @@
 SOURCEPATH	../server
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp 
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_dcallcaps.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_dcallcaps.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 SOURCE         t_dcallcaps.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp 
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_dcallfiles.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_dcallfiles.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 SOURCE         t_dcallfiles.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp 
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_dcdiskadmin.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_dcdiskadmin.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,8 +21,7 @@
 SOURCE         t_dcdiskadmin.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
-SOURCE         t_chlffs.cpp
+SOURCE         t_chlffs.cpp 
 
 LIBRARY        euser.lib efsrv.lib hal.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/kerneltest/f32test/group/t_dcdiskadminallfiles.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_dcdiskadminallfiles.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 SOURCE         t_dcdiskadminallfiles.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_dcnone.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_dcnone.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,8 +21,7 @@
 SOURCE         t_dcnone.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
-SOURCE         t_chlffs.cpp
+SOURCE         t_chlffs.cpp 
 
 LIBRARY        euser.lib efsrv.lib hal.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/kerneltest/f32test/group/t_dctcb.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_dctcb.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,8 +21,7 @@
 SOURCE         	t_dctcb.cpp
 SOURCE         	t_main.cpp
 SOURCEPATH      ../fileutils/src
-SOURCE          f32_test_utils.cpp
-SOURCE          t_chlffs.cpp
+SOURCE          t_chlffs.cpp 
 
 LIBRARY        	euser.lib efsrv.lib hal.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/kerneltest/f32test/group/t_dctcballfiles.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_dctcballfiles.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,8 +21,7 @@
 SOURCE         t_dctcballfiles.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
-SOURCE         t_chlffs.cpp
+SOURCE         t_chlffs.cpp 
 
 LIBRARY        euser.lib efsrv.lib hal.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/kerneltest/f32test/group/t_dctcbdiskadmin.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_dctcbdiskadmin.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,8 +21,7 @@
 SOURCE         t_dctcbdiskadmin.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
-SOURCE         t_chlffs.cpp
+SOURCE         t_chlffs.cpp 
 
 LIBRARY        euser.lib efsrv.lib hal.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/kerneltest/f32test/group/t_dircache.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-// 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:
-// f32test/group/t_dircache.mmp
-//
-//
-
-target		t_dircache.exe
-targettype	exe
-sourcepath	../server
-source		t_main.cpp t_dircache.cpp
-sourcepath	../fileutils/src
-source 		t_chlffs.cpp f32_test_utils.cpp fat_utils.cpp
-
-library		euser.lib efsrv.lib hal.lib efile.lib
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-USERINCLUDE 	../server
-userinclude     ../fileutils/inc
-epocstacksize	0x4000
-capability		tcb diskadmin allfiles
-vendorid		0x70000001
-
-SMPSAFE
-
--- a/kerneltest/f32test/group/t_dlocl.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_dlocl.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -20,8 +20,7 @@
 SOURCEPATH	../server
 SOURCE         t_dlocl.cpp t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
-SOURCE         t_chlffs.cpp
+SOURCE         t_chlffs.cpp 
 
 LIBRARY        euser.lib efsrv.lib ektran.lib hal.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/kerneltest/f32test/group/t_dspace.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_dspace.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,8 +21,7 @@
 SOURCE         t_dspace.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
-SOURCE         t_chlffs.cpp
+SOURCE         t_chlffs.cpp 
 
 LIBRARY        euser.lib efsrv.lib hal.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/kerneltest/f32test/group/t_fman.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_fman.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 source		t_fman.cpp
 source		t_main.cpp
 sourcepath      ../fileutils/src
-source          f32_test_utils.cpp
 source          t_chlffs.cpp
 
 library		euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_fnames.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_fnames.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 SOURCE         t_fnames.cpp
 SOURCE         t_main.cpp 
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 LIBRARY        euser.lib efsrv.lib hal.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/kerneltest/f32test/group/t_fragmentdp.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_fragmentdp.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -22,7 +22,6 @@
 SOURCEPATH     ../server
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 LIBRARY        euser.lib efsrv.lib hal.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/kerneltest/f32test/group/t_fsched.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_fsched.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -20,12 +20,9 @@
 
 SOURCEPATH		../server
 SOURCE			t_fsched.cpp
-SOURCEPATH		../fileutils/src
-SOURCE			f32_test_utils.cpp
 
 LIBRARY			euser.lib efsrv.lib hal.lib 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-USERINCLUDE		../fileutils/inc
 EPOCSTACKSIZE	0x10000
 EPOCHEAPSIZE	0x1000 0x02000000
 
--- a/kerneltest/f32test/group/t_fsrvbm.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_fsrvbm.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -22,7 +22,6 @@
 SOURCEPATH     ../server
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_fsy2k.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_fsy2k.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 SOURCE         t_fsy2k.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_fsysbm.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_fsysbm.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -22,7 +22,6 @@
 SOURCEPATH     ../server
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/f32test/group/t_ftrace.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,34 @@
+// Copyright (c) 1997-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:
+// f32test/group/t_ftrace.mmp
+//
+//
+
+TARGET         t_ftrace.exe
+TARGETTYPE     EXE
+SOURCEPATH	../server
+SOURCE         t_ftrace.cpp
+SOURCE         t_main.cpp
+SOURCEPATH     ../fileutils/src
+SOURCE         t_chlffs.cpp
+
+LIBRARY        euser.lib efsrv.lib hal.lib btracec.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+USERINCLUDE    ../server
+USERINCLUDE    ../fileutils/inc
+
+CAPABILITY		TCB DISKADMIN ALLFILES
+VENDORID 0x70000001
+
+SMPSAFE
--- a/kerneltest/f32test/group/t_gdir.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_gdir.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 SOURCE         t_gdir.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_gen.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_gen.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -20,7 +20,6 @@
 SOURCEPATH     ../server
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 SOURCEPATH     ../math
 SOURCE         t_gen.cpp
--- a/kerneltest/f32test/group/t_gen32.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_gen32.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -20,7 +20,6 @@
 SOURCEPATH     ../server
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 SOURCEPATH	../math
 SOURCE         t_gen32.cpp
--- a/kerneltest/f32test/group/t_handshare.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_handshare.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -22,7 +22,6 @@
 SOURCEPATH 	../server
 SOURCE         	t_main.cpp
 SOURCEPATH      ../fileutils/src
-SOURCE          f32_test_utils.cpp
 SOURCE          t_chlffs.cpp
 
 LIBRARY        	euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_localtime.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_localtime.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -20,7 +20,6 @@
 SOURCEPATH	../server
 SOURCE		t_localtime.cpp t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_locate.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_locate.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 SOURCE         t_locate.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY         euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_lock.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_lock.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 SOURCE         t_lock.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY         euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_misc.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_misc.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 SOURCE          t_misc.cpp
 SOURCE          t_main.cpp
 SOURCEPATH      ../fileutils/src
-SOURCE          f32_test_utils.cpp
 SOURCE          t_chlffs.cpp
 
 LIBRARY         euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_nmbs.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_nmbs.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 SOURCE         t_nmbs.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY         euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_notifier.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_notifier.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -20,9 +20,8 @@
 sourcepath		../server
 source			t_notifier.cpp
 source			t_main.cpp 
-sourcepath		../fileutils/src
-source			f32_test_utils.cpp
-source			t_chlffs.cpp
+sourcepath      ../fileutils/src
+source          t_chlffs.cpp
 library			euser.lib efsrv.lib hal.lib
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/kerneltest/f32test/group/t_notify.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_notify.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 source	       t_notify.cpp
 source	       t_main.cpp
 SOURCEPATH     ../fileutils/src
-source         f32_test_utils.cpp
 source         t_chlffs.cpp
 
 library		euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_notify_mfs.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_notify_mfs.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -22,9 +22,8 @@
 source			t_notify_perf_impl.cpp t_notify_perf_util.cpp
 sourcepath		../server
 source			t_notify_mfs.cpp t_main.cpp
-sourcepath		../fileutils/src
-source			f32_test_utils.cpp
-source			t_chlffs.cpp
+sourcepath      ../fileutils/src
+source          t_chlffs.cpp
 
 library			euser.lib efsrv.lib hal.lib
 
--- a/kerneltest/f32test/group/t_notify_perf.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_notify_perf.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -23,8 +23,7 @@
 sourcepath		../server
 source			t_main.cpp
 sourcepath		../fileutils/src
-source			f32_test_utils.cpp
-source			t_chlffs.cpp
+source          t_chlffs.cpp
 
 library			euser.lib efsrv.lib hal.lib
 
--- a/kerneltest/f32test/group/t_notifydismount.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_notifydismount.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -20,7 +20,6 @@
 SOURCEPATH     ../server
 SOURCE         t_notifydismount.cpp t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY         euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_oom.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_oom.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -22,7 +22,6 @@
 SOURCEPATH     ../server
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_open.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_open.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 SOURCE         t_open.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY         euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_parse.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_parse.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -20,7 +20,6 @@
 SOURCEPATH     ../server
 SOURCE         t_parse.cpp t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY         euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_proc.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_proc.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -20,9 +20,8 @@
 SOURCEPATH     ../server
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
-SOURCEPATH     ../manager
+SOURCEPATH	   ../manager
 SOURCE         t_proc.cpp
 
 LIBRARY         euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_ramstr.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_ramstr.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -22,7 +22,6 @@
 SOURCEPATH     ../server
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_rand.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_rand.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 SOURCE         t_rand.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_rcount.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_rcount.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 SOURCE         t_rcount.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_rdsect.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_rdsect.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -20,7 +20,6 @@
 SOURCEPATH     ../server
 SOURCE         t_rdsect.cpp t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_resize.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_resize.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 SOURCE         t_resize.cpp
 SOURCE	       t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_romg.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_romg.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -22,7 +22,6 @@
 SOURCEPATH     ../SERVER
 SOURCE         T_MAIN.CPP
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         T_CHLFFS.CPP
 
 LIBRARY        EUSER.LIB EFSRV.LIB HAL.LIB
--- a/kerneltest/f32test/group/t_scan.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_scan.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 SOURCE         t_scan.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 LIBRARY        euser.lib efsrv.lib hal.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/kerneltest/f32test/group/t_sess.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_sess.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -23,7 +23,6 @@
 SOURCEPATH     ../server
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_soak1.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_soak1.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -22,7 +22,6 @@
 SOURCEPATH	../server
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_vfat.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_vfat.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 SOURCE         t_vfat.cpp
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 LIBRARY        euser.lib efsrv.lib hal.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/kerneltest/f32test/group/t_virus.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_virus.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -22,7 +22,6 @@
 SOURCEPATH     ../server
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_wcache.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_wcache.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -23,7 +23,6 @@
 
 LIBRARY		euser.lib efsrv.lib hal.lib 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-USERINCLUDE		../fileutils/inc
 EPOCSTACKSIZE	0x10000
 
 CAPABILITY		TCB DISKADMIN ALLFILES
--- a/kerneltest/f32test/group/t_whet.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_whet.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -22,7 +22,6 @@
 SOURCEPATH     ../server
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/t_whetvfp.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/t_whetvfp.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -22,7 +22,6 @@
 SOURCEPATH     ../server
 SOURCE         t_main.cpp
 SOURCEPATH     ../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/group/wintest.bat	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/group/wintest.bat	Wed Sep 01 12:34:56 2010 +0100
@@ -28,9 +28,6 @@
 call :GetParentDirPath F32TEST_PATH
 echo F32TEST_PATH = %F32TEST_PATH%
 set EPOC32_DIR=%EPOCROOT%EPOC32\
-set F32TEST_BUILD_PATH=%EPOC32_DIR%BUILD%F32TEST_PATH%GROUP\
-if exist %EPOC32_DIR%data\z\test\f32test set F32TEST_BUILD_PATH=%EPOC32_DIR%data\z\test\f32test\
-echo F32TEST_BUILD_PATH = %F32TEST_BUILD_PATH%
 echo EPOC32_DIR = %EPOC32_DIR%
 set EMUL_MEDIA_PATH=%EPOC32_DIR%DATA\MEDIA\
 echo EMUL_MEDIA_PATH = %EMUL_MEDIA_PATH%
@@ -103,7 +100,7 @@
 copy %F32TEST_PATH%\SERVER\T_FILE.CPP %EMUL_Z%\TEST\T_FILE.CPP
 copy %F32TEST_PATH%\SERVER\T_FSRV.CPP %EMUL_Z%\TEST\T_FSRV.CPP
 copy %F32TEST_PATH%\SERVER\T_RDSECT.TXT %EMUL_Z%\TEST\T_RDSECT.TXT
-copy %F32TEST_BUILD_PATH%\%1.AUTO.BAT %EMUL_Z%\TEST\%1.AUTO.BAT
+copy %EPOC32_DIR%BUILD%F32TEST_PATH%\GROUP\%1.AUTO.BAT %EMUL_Z%\TEST\%1.AUTO.BAT
 copy %REL_DIR%\T_CHKUID.EXE %EMUL_Z%\TEST\T_CHKUID.EXE
 
 REM Use both Sys and System directories until the switch has been made
--- a/kerneltest/f32test/loader/dlltree.pl	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/loader/dlltree.pl	Wed Sep 01 12:34:56 2010 +0100
@@ -57,16 +57,6 @@
 my $copy_end=$year+1900;
 
 my $argc=scalar(@ARGV);
-
-# check whether its raptor specific  
-my $is_raptor = 0;
-if ($ARGV[$argc-1] eq "raptor") # change "raptor" to something you want.
-{
-	pop(@ARGV);
-	$is_raptor = 1;
-	$argc--;
-}
-
 ($argc==1 or $argc==2 or $argc==3) or die "Usage: perl dlltree.pl <filename> <dir> [-allowbad]\n";
 my $infile=$ARGV[0];
 open IN, $infile or die "Cannot open input file $infile\n";
@@ -805,20 +795,13 @@
 open OUT, ">$dlltreename" or die "Could not open $dlltreename for output\n";
 print OUT @dlltree;
 close OUT;
-
-my $testbatch ='';
-if($is_raptor) {
-	$testbatch="$ENV{EPOCROOT}\\epoc32\\data\\z\\test\\gen\\##MAIN##.auto.bat";
-}
-else {
-	$testbatch = "$ENV{EPOCROOT}epoc32\\build";
-	$destpath =~ s/\//\\/go;
-	$testbatch.="\\" unless ($destpath =~ /^\\/);
-	$testbatch.=$destpath;
-	$testbatch.="##MAIN##.auto.bat";
-	}
-if (!$allowbad){
-	push @iby, "data=$testbatch\t\ttest\\loader.auto.bat\n";	
+my $testbatch = "$ENV{EPOCROOT}epoc32\\build";
+$destpath =~ s/\//\\/go;
+$testbatch.="\\" unless ($destpath =~ /^\\/);
+$testbatch.=$destpath;
+$testbatch.="##MAIN##.auto.bat";
+if (!$allowbad) {
+	push @iby, "data=$testbatch\t\ttest\\loader.auto.bat\n";
 }
 open OUT, ">$ibyname" or die "Could not open $ibyname for output\n";
 print OUT @iby;
--- a/kerneltest/f32test/loader/exet.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/loader/exet.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -34,9 +34,9 @@
 
 extern "C" TInt _E32Startup();
 
-extern "C" __MODULE_IMPORT void RegisterConstructorCall(TInt aDllNum);
-extern "C" __MODULE_IMPORT void RegisterInitCall(TInt aDllNum);
-extern "C" __MODULE_IMPORT void RegisterDestructorCall(TInt aDllNum);
+extern "C" IMPORT_C void RegisterConstructorCall(TInt aDllNum);
+extern "C" IMPORT_C void RegisterInitCall(TInt aDllNum);
+extern "C" IMPORT_C void RegisterDestructorCall(TInt aDllNum);
 
 #define PANIC()		ExeTPanic(__LINE__)
 #define EXET_ASSERT(c)	((void)((c)||(PANIC(),0)))
--- a/kerneltest/f32test/loader/ldrtst.flm	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/loader/ldrtst.flm	Wed Sep 01 12:34:56 2010 +0100
@@ -20,7 +20,7 @@
 	cp -u $$(filter-out %generated,$$^) $$@
 
 $(TO_BLDINF)/$(GDIR)/generated: $(TO_BLDINF)/dlltree.pl $(TO_BLDINF)/dlltree.txt
-	perl $(TO_BLDINF)/dlltree.pl $(TO_BLDINF)/dlltree.txt $(TO_BLDINF)/$(GDIR) raptor
+	perl $(TO_BLDINF)/dlltree.pl $(TO_BLDINF)/dlltree.txt $(TO_BLDINF)/$(GDIR)
 	touch $$@
 endif
 
--- a/kerneltest/f32test/loader/security/exet.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/loader/security/exet.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -32,9 +32,9 @@
 
 extern "C" TInt _E32Startup();
 
-extern "C" __MODULE_IMPORT void RegisterConstructorCall(TInt aDllNum);
-extern "C" __MODULE_IMPORT void RegisterInitCall(TInt aDllNum);
-extern "C" __MODULE_IMPORT void RegisterDestructorCall(TInt aDllNum);
+extern "C" IMPORT_C void RegisterConstructorCall(TInt aDllNum);
+extern "C" IMPORT_C void RegisterInitCall(TInt aDllNum);
+extern "C" IMPORT_C void RegisterDestructorCall(TInt aDllNum);
 
 #define PANIC()		ExeTPanic(__LINE__)
 #define EXET_ASSERT(c)	((void)((c)||(PANIC(),0)))
--- a/kerneltest/f32test/loader/t_ldrtst.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/loader/t_ldrtst.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -338,7 +338,7 @@
 		}
 	TCodeSegCreateInfo info;
 	TInt r=iDev.GetCodeSegInfo(h, info);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TFileName fn;
 	fn.Copy(info.iFileName);
 	test.Printf(_L("DCodeSeg@%08x Data=%08x+%x,%x File %S,attr=0x%x\n"),h,info.iDataRunAddress,info.iDataSize,info.iBssSize,&fn,info.iAttr);
@@ -418,23 +418,21 @@
 	test(expected == isCodePaged);
 #endif
 	if ((flags & KModuleFlagXIP) && mmtype!=EMemModelTypeEmul)
-		{
-		test_Value(aInfo.iEntryPointAddress, IsRomAddress(aInfo.iEntryPointAddress));
-		}
+		test(IsRomAddress(aInfo.iEntryPointAddress));
 	else
 		{
-		test_Value(aInfo.iEntryPointAddress, IsRamCodeAddress(aInfo.iEntryPointAddress));
+		test(IsRamCodeAddress(aInfo.iEntryPointAddress));
 		if(mmtype==EMemModelTypeFlexible)
 			{
 			// can't make assumtions about current processes address space
 			}
 		else if (mmtype==EMemModelTypeMultiple)
 			{
-			test_Value(aInfo.iEntryPointAddress, !AddressReadable(aInfo.iEntryPointAddress));
+			test(!AddressReadable(aInfo.iEntryPointAddress));
 			}
 		else
 			{
-			test_Value(aInfo.iEntryPointAddress, AddressReadable(aInfo.iEntryPointAddress));
+			test(AddressReadable(aInfo.iEntryPointAddress));
 			}
 		}
 
@@ -475,20 +473,20 @@
 				{
 				if (!(GetModuleFlags(deps[j])&KModuleFlagExe))
 					{
-					test_Value(aList.iInfo[i].iDllNum, aList.iInfo[i].iDllNum==deps[j]);
+					test(aList.iInfo[i].iDllNum==deps[j]);
 					++i;
 					}
 				++j;
 				}
 			else if (j==ndeps)
 				{
-				test_Value(aList.iInfo[i].iDllNum, aList.iInfo[i].iDllNum==aRoot);
+				test(aList.iInfo[i].iDllNum==aRoot);
 				++i;
 				++j;
 				}
 			else
 				{
-				test_Value(aList.iInfo[i].iDllNum, aList.iInfo[i].iDllNum<0);
+				test(aList.iInfo[i].iDllNum<0);
 				++i;
 				}
 			}
@@ -510,17 +508,13 @@
 		{
 		if (i<nd)
 			{
-			test_Value(aList.iInfo[i].iDllNum, aList.iInfo[i].iDllNum>=0);
+			test(aList.iInfo[i].iDllNum>=0);
 			ml.Remove(aList.iInfo[i].iDllNum);
 			}
 		else if (i==nd && !root_included)
-			{
-			test_Value(aList.iInfo[i].iDllNum, aList.iInfo[i].iDllNum == aRoot);
-			}
+			test(aList.iInfo[i].iDllNum==aRoot);
 		else
-			{
-			test_Value(aList.iInfo[i].iDllNum, aList.iInfo[i].iDllNum<0);
-			}
+			test(aList.iInfo[i].iDllNum<0);
 		}
 	test(ml.iCount==0);
 	}
@@ -542,11 +536,11 @@
 	{
 	test.Next(_L("Load device driver"));
 	TInt r=User::LoadLogicalDevice(_L("D_LDRTST"));
-	test_Value(r, r==KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	r=iDev.Open();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=iFs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TBuf<256> cmdline;
 	User::CommandLine(cmdline);
@@ -605,14 +599,14 @@
 		r=LoadExe(x, 0, p, tt);
 		test.Printf(_L("LoadExe(%d)->%d\n"),x,r);
 		test.Printf(_L("BENCHMARK: LoadExe(%d)->%dms\n"),x,tt);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		RLoaderTest lt;
 		r=lt.Connect(x);
 		test.Printf(_L("Connect(%d)->%d\n"),x,r);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		TModuleList exe_info;
 		r=lt.GetExeDepList(exe_info.iInfo);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		exe_info.SetCount();
 		DumpModuleList(exe_info, x);
 		CheckModuleList(x, exe_info);
@@ -681,7 +675,7 @@
 				test(r==y);
 				r=lt.CloseDll(h);
 				test.Printf(_L("CloseDll(%d)->%d\n"),h,r);
-				test_KErrNone(r);
+				test(r==KErrNone);
 				test(lt.GetCDList(dll_d_info.iInfo)==KErrNone);
 				dll_d_info.SetCount();
 				dll_d_info.Display(_L("Destruct:  "));
@@ -750,10 +744,10 @@
 		r=LoadExe(x, 0, p1, tt);
 		test.Printf(_L("LoadExe1(%d)->%d\n"),x,r);
 		test.Printf(_L("BENCHMARK: LoadExe1(%d)->%dms\n"),x,tt);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=lt1.Connect(x, 0);
 		test.Printf(_L("Connect1(%d)->%d\n"),x,r);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		TInt s=DetermineLoadExe2Result(x);
 		r=LoadExe(x, 1, p2, tt);
 		test.Printf(_L("LoadExe2(%d)->%d (%d)\n"),x,r,s);
@@ -765,13 +759,13 @@
 			{
 			r=lt2.Connect(x, 1);
 			test.Printf(_L("Connect2(%d)->%d\n"),x,r);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			r=lt1.GetExeDepList(exe_info1.iInfo);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			exe_info1.SetCount();
 			DumpModuleList(exe_info1, x);
 			r=lt2.GetExeDepList(exe_info2.iInfo);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			exe_info2.SetCount();
 			DumpModuleList(exe_info2, x);
 
@@ -858,7 +852,7 @@
 
 						r=lt2.CloseDll(h2);
 						test.Printf(_L("CloseDll2(%d)->%d\n"),h2,r);
-						test_KErrNone(r);
+						test(r==KErrNone);
 						test(lt2.GetCDList(dll_d_info2.iInfo)==KErrNone);
 						dll_d_info2.SetCount();
 						dll_d_info2.Display(_L("Destruct2:  "));
@@ -869,7 +863,7 @@
 
 					r=lt1.CloseDll(h1);
 					test.Printf(_L("CloseDll1(%d)->%d\n"),h1,r);
-					test_KErrNone(r);
+					test(r==KErrNone);
 					test(lt1.GetCDList(dll_d_info1.iInfo)==KErrNone);
 					dll_d_info1.SetCount();
 					dll_d_info1.Display(_L("Destruct1:  "));
@@ -1016,20 +1010,22 @@
 			{
 			r=LoadExe(x, 0, p, tt);
 			test.Printf(_L("LoadExe(%d)->%d\n"),x,r);
-			test_Value(r, r==KErrNone || (loom.iState!=TLoopOOM::ERFsError && r==KErrNoMemory) || 
+			test(r==KErrNone || (loom.iState!=TLoopOOM::ERFsError && r==KErrNoMemory) || 
 				(loom.iState==TLoopOOM::ERFsError && r==KRFsError));
-			if (r != KErrNone)
-				continue;
-			r = lt.Connect(x);
-			test_KErrNone(r);
-			lt.Exit();
-			p.Close();
+			if (r==KErrNone)
+				{
+				TInt s=lt.Connect(x);
+				test.Printf(_L("Connect(%d)->%d\n"),x,s);
+				test(s==KErrNone);
+				lt.Exit();
+				p.Close();
+				}
 			}
 		SetLoaderFail(0,0);
 		r=LoadExe(x, 0, p, tt);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=lt.Connect(x);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		const TInt* tests=TC_DllOOM;
 		TInt ntests=*tests++;
 		TModuleList list;
@@ -1049,13 +1045,14 @@
 				r=Min(h,0);
 				test.Printf(_L("%d:LoadDll(%d)->%d\n"),x,m,h);
 				
-				test_Value(r, r==KErrNone || r==KErrNotSupported || r==KErrNoMemory || 
+				test(r==KErrNone || r==KErrNotSupported || KErrNoMemory || 
 					(loom.iState==TLoopOOM::ERFsError && r==KRFsError) );
-				if (r!=KErrNone)
-					continue;
-
-				r=lt.CloseDll(h);
-				test_KErrNone(r);
+					
+				if (r==KErrNone)
+					{
+					TInt s=lt.CloseDll(h);
+					test(s==KErrNone);
+					}
 				}
 			}
 		lt.Exit();
@@ -1123,7 +1120,7 @@
 		TUint32 tt;
 		r=LoadExe(x, 0, p, tt);
 		test.Printf(_L("LoadCorruptExe(%d)->%d\n"),x,r);
-		test_Value(r,r==KErrCorrupt);
+		test(r==KErrCorrupt);
 		}
 	}
 
@@ -1156,7 +1153,7 @@
 	hashDir[0] = (TUint8) RFs::GetSystemDriveChar();
 
 	TInt r = Fs.MkDirAll(hashDir);
-	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+	test(r == KErrNone || r == KErrAlreadyExists);
 
 	for (TInt d = 0; d <= (TInt)sizeof(SpecialDriveList); ++d)
 		{
@@ -1193,7 +1190,7 @@
 		fn.Append(_L(":\\sys\\bin\\"));
 		r = Fs.MkDirAll(fn);
 		test.Printf(_L("MkDirAll %S returns %d\n"), &fn, r);
-		test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+		test(r == KErrNone || r == KErrAlreadyExists);
 		}
 	}
 
@@ -1282,17 +1279,17 @@
 		const TParsePtrC sppc(fnSrc);
 		TBuf<MAX_PATH> sName;
 		r = MapEmulatedFileName(sName, sppc.NameAndExt());
-		test_KErrNone(r);
+		test(r == KErrNone);
 
 		TBuf<MAX_PATH> dName;
 		r = MapEmulatedFileName(dName, fnDest);
-		test_KErrNone(r);
+		test(r == KErrNone);
 
 		BOOL b = Emulator::CopyFile((LPCTSTR)sName.PtrZ(),(LPCTSTR)dName.PtrZ(),FALSE);
 		test(b);
 #else
 		r = fm->Copy(fnSrc, fnDest);
-		test_KErrNone(r);
+		test(r == KErrNone);
 #endif
 
 		r = Fs.SetAtt(fnDest, 0, KEntryAttReadOnly);
@@ -1442,7 +1439,7 @@
 
 		r = Fs.Delete(fnDest);
 		test.Printf(_L("DeleteExecutables:fnDest=%S,del=%d\n"), &fnDest, r);
-		test_KErrNone(r);
+		test(r == KErrNone);
 
 		// only need to delete hash files for binaries copied to removable media,
 		// but simpler to delete and test for KErrNotFound
@@ -1450,7 +1447,7 @@
 		GetHashFileName(fnDest, fnHash);
 		r = Fs.Delete(fnHash);
 		test.Printf(_L("DeleteExecutables,h=%S,hdel=%d\n"), &fnHash, r);
-		test_Value(r, r == KErrPathNotFound || r == KErrNotFound || r == KErrNone);
+		test(r == KErrPathNotFound || r == KErrNotFound || r == KErrNone);
 
 		if (aCorruptMode)
 			++numCorruptFiles;
@@ -1486,7 +1483,7 @@
 	test.Printf(_L("CopyExecutablesL()\n"));
 	CTrapCleanup* cleanup=CTrapCleanup::New();
 	TRAPD(r, CopyExecutablesL());
-	test_KErrNone(r);
+	test(r == KErrNone);
 	delete cleanup;
 
 	if (tm&1)
--- a/kerneltest/f32test/locl/t_filematch.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/locl/t_filematch.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -114,8 +114,7 @@
 	r = dir.Open(TheFs, name, KEntryAttNormal);
 	test_KErrNone(r);
 	TEntry entry;
-	r = dir.Read(entry);
-	test_KErrNone(r);
+	test(dir.Read(entry) == KErrNone);
 	dir.Close();
 	}
 
@@ -129,8 +128,7 @@
 	r = dir.Open(TheFs, name, KEntryAttNormal);
 	test_KErrNone(r);
 	TEntry entry;
-	r = dir.Read(entry);
-	test_Equal(KErrEof, r);
+	test(dir.Read(entry) == KErrEof);
 	dir.Close();
 	}
 
@@ -186,11 +184,11 @@
     F32_Test_Utils::SetConsole(test.Console()); 
     
     TInt nRes=TheFs.CharToDrive(gDriveToTest, gDriveNum);
-    test_KErrNone(nRes);
+    test(nRes==KErrNone);
     
     PrintDrvInfo(TheFs, gDriveNum);
 
-    if(Is_SimulatedSystemDrive(TheFs, gDriveNum) || Is_Fat(TheFs, gDriveNum) || Is_Lffs(TheFs, gDriveNum))
+    if(Is_Win32(TheFs, gDriveNum) || Is_Fat(TheFs, gDriveNum) || Is_Lffs(TheFs, gDriveNum))
         {
 	    TestFilenameMatches();
         }
--- a/kerneltest/f32test/manager/t_clobbr.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/manager/t_clobbr.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define	__E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include "t_server.h"
@@ -31,55 +30,55 @@
 
 	RFile file;
 	TInt r=file.Replace(TheFs,_L("test.dat"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file.Write(0,_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf8<0x40> buf1;
 	r=file.Read(0,buf1);
-	test_Value(r, r == KErrNone&&buf1.Length()==36);
+	test(r==KErrNone&&buf1.Length()==36);
 	if (buf1!=_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"))
 		test.Printf(_L("1). *BAD*\n"));
 	
 	r=file.SetSize(511);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf8<0x40> buf2;
 	r=file.Read(0,buf2);
-	test_Value(r, r == KErrNone&&buf2.Length()==0x40);
+	test(r==KErrNone&&buf2.Length()==0x40);
 	buf2.SetLength(36);
 	if (buf2!=_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"))
 		test.Printf(_L("2). *BAD*\n"));
 	
 	r=file.SetSize(512);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf8<0x40> buf3;
 	r=file.Read(0,buf3);
-	test_Value(r, r == KErrNone&&buf3.Length()==0x40);
+	test(r==KErrNone&&buf3.Length()==0x40);
 	buf3.SetLength(36);
 	if (buf3!=_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"))
 		test.Printf(_L("3). *BAD*\n"));
 	
 	r=file.Write(0,_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf8<0x40> buf4;
 	r=file.Read(0,buf4);
-	test_Value(r, r == KErrNone&&buf4.Length()==0x40);
+	test(r==KErrNone&&buf4.Length()==0x40);
 	buf4.SetLength(36);
 	if (buf4!=_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"))
 		test.Printf(_L("4). *BAD*\n"));
 	r=file.SetSize(511);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf8<0x40> buf5;
 	r=file.Read(0,buf5);
-	test_Value(r, r == KErrNone&&buf5.Length()==0x40);
+	test(r==KErrNone&&buf5.Length()==0x40);
 	buf5.SetLength(36);
 	if (buf5!=_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"))
 		test.Printf(_L("5). *BAD*\n"));
 	r=file.SetSize(512);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf8<0x40> buf6;
 	r=file.Read(0,buf6);
-	test_Value(r, r == KErrNone&&buf6.Length()==0x40);
+	test(r==KErrNone&&buf6.Length()==0x40);
 	buf6.SetLength(36);
 	if (buf6!=_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"))
 		test.Printf(_L("6). *BAD*\n"));
--- a/kerneltest/f32test/manager/t_oom.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/manager/t_oom.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define	__E32TEST_EXTENSION__
 #include <hal.h>
 #include <f32file.h>
 #include <e32test.h>
@@ -33,10 +32,10 @@
 	RFormat format;
 	TFileName sessionPath;
 	TInt r=TheFs.SessionPath(sessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt count;
 	r=format.Open(TheFs,sessionPath,EHighDensity,count);
-	test_KErrNone(r);
+	test(r==KErrNone);
 //	test(count==100);
 //	TRequestStatus status;
 //	TPckgBuf<TInt> step;
@@ -68,14 +67,14 @@
 	test.Printf(_L("FileSize = 0x%x\n"),size);
 	RFile file;
 	TInt r=file.Replace(TheFs,_L("\\F32-TST\\GOBBLE.DAT"),EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.SetSize(size);
-	test_Value(r, r == KErrNone || r==KErrDiskFull);
+	test(r==KErrNone || r==KErrDiskFull);
 	if (r==KErrDiskFull)
 		{
 		TFileName sessionPath;
 		r=TheFs.SessionPath(sessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test.Printf(_L("Error %S diskfull\n"),&sessionPath);
 // Reintroduce when we can detect that the test is being run manually
 //		test.Getch();
@@ -126,7 +125,7 @@
 			bfDir.Append(KTstDir);
 			test.Printf(_L("creating directory \"%S\".\n"), &bfDir);
 			r = TheFs.MkDir(bfDir);
-			test_KErrNone(r);
+			test(r == KErrNone);
 
 			TBuf<3 + 3 + 8 + 1 + 3> bfFlNm(bfDir);
 			TInt ctr = 0;						// create files until KErrDiskFull
@@ -141,11 +140,11 @@
 
 				RFile f;
 				r = f.Create(TheFs, bfFlNm, EFileShareExclusive | EFileStream | EFileWrite);
-				test_Value(r, r == KErrNone || r == KErrDiskFull);
+				test(r == KErrNone || r == KErrDiskFull);
 				if (r == KErrNone)
 					{
 					r = f.SetSize(KFileSize);
-					test_Value(r, r == KErrNone || r == KErrDiskFull);
+					test(r == KErrNone || r == KErrDiskFull);
 					}
 				f.Close();
 
@@ -185,7 +184,7 @@
 
 	TDriveInfo driveInfo;
 	TInt r=TheFs.Drive(driveInfo);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	if (driveInfo.iType==EMediaNotPresent)
 		{
 		test.Printf(_L("ERROR: MEDIA NOT PRESENT\n"));
@@ -196,9 +195,9 @@
 
 	TFileName sessionPath;
 	r=TheFs.SessionPath(sessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.MkDirAll(sessionPath);
-	test_Value(r, r == KErrCorrupt || r==KErrAlreadyExists || r==KErrNone);
+	test(r==KErrCorrupt || r==KErrAlreadyExists || r==KErrNone);
 	if (r==KErrCorrupt)
 		FormatFat();
 	if (r==KErrAlreadyExists)
@@ -206,13 +205,13 @@
 		test.Next(_L("Remove test directory"));
 		CFileMan* fman=CFileMan::NewL(TheFs);
 		TInt ret=fman->RmDir(sessionPath);
-		test_KErrNone(ret);
+		test(ret==KErrNone);
 		delete fman;
 		}
 	if (r!=KErrNone)
 		{
 		r=TheFs.MkDirAll(sessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 
 	Test1();
--- a/kerneltest/f32test/manager/t_romg.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/manager/t_romg.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define	__E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32rom.h>
@@ -453,12 +452,12 @@
 //
 	test.Next(_L("Create root mem dir"));
 	TRAPD(r,TheRootDir=CMemDir::NewL());
-	test_KErrNone(r);
+	test(r==KErrNone);
 //
 	test.Next(_L("Load directory structure"));
 	TheLevel=(-1);
 	TRAP(r,TheRootDir->LoadDirL(n));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(TheLevel==(-1));
 //
 	delete buf;
@@ -554,11 +553,11 @@
 		test.End();
 		return;
 		}
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 //
 	test.Next(_L("Generating ROM image"));
 	TRAP(r,buildRomImageL());
-	test_KErrNone(r);
+	test(r==KErrNone);
 //
 	test.Next(_L("Basing the rom image"));
 	baseRomImage();
@@ -567,7 +566,7 @@
 	b+=TheFileName;
 	test.Next(b);
 	r=TheFile.Replace(TheFs,TheFileName,EFileStream|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	writeRomImage();
 	TheFile.Close();
 	delete TheRootDir;
--- a/kerneltest/f32test/plugins/version_2/crypto_encryption/group/t_encplugin.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/plugins/version_2/crypto_encryption/group/t_encplugin.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -22,7 +22,6 @@
 SOURCEPATH     ../../../../server
 SOURCE         t_main.cpp
 SOURCEPATH     ../../../../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp 
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/plugins/version_2/file64bit/group/t_file64bit_plugin.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/plugins/version_2/file64bit/group/t_file64bit_plugin.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -26,7 +26,6 @@
 SOURCEPATH     ../../../../server
 SOURCE         t_main.cpp
 SOURCEPATH     ../../../../fileutils/src
-SOURCE         f32_test_utils.cpp
 SOURCE         t_chlffs.cpp
 
 LIBRARY        euser.lib efsrv.lib hal.lib
--- a/kerneltest/f32test/plugins/version_2/group/t_plugin_v2.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/plugins/version_2/group/t_plugin_v2.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -27,7 +27,6 @@
 SOURCEPATH	../../../server
 SOURCE		t_main.cpp
 SOURCEPATH	../../../fileutils/src
-SOURCE          f32_test_utils.cpp
 SOURCE          t_chlffs.cpp
 
 USERINCLUDE	../../../server
--- a/kerneltest/f32test/plugins/version_2beta/t_plugin_v2beta.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/plugins/version_2beta/t_plugin_v2beta.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -172,7 +172,7 @@
 
 		}
 	else
-		if ((gFileSystemExtensionLoaded || F32_Test_Utils::Is_Win32(TheFs,driveNum)) && r == KErrNotSupported)
+		if ((gFileSystemExtensionLoaded || name.CompareF(_L("Win32"))==0)&& r == KErrNotSupported)
 			{
 			test.Printf(_L("File system extension does not support local buffers\n"));
 			file.Close();
@@ -449,7 +449,7 @@
 	// run T_FILE with trace plugin installed
 
 #if defined(__WINS__)	// only in WINS to save time
-	TestLoadingOfTracePlugin();
+TestLoadingOfTracePlugin();
 
 	RProcess p;
 
@@ -464,11 +464,11 @@
 	p.Logon(status);
 	p.Resume();
 	User::WaitForRequest(status);
-	TestUnloadingOfTracePlugin();
+TestUnloadingOfTracePlugin();
 #endif // __WINS__
 
 	// Cannot format drive C: so skip this test on that drive
-	if (!F32_Test_Utils::Is_SimulatedSystemDrive(TheFs, EDriveC))
+	if (!F32_Test_Utils::Is_Win32(TheFs, EDriveC))
 	    {
         TestLoadingOfFormatPlugin();
         TestFormatDriveIntercept();
--- a/kerneltest/f32test/rofs/rofs_tests.mrp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-# Dummy MRP to keep the package_defintion.xml file happy - f32test\rofs is still part of the base_f32test.mrp but is built separately.
\ No newline at end of file
--- a/kerneltest/f32test/server/b_file.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/b_file.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32math.h>
 #include <e32test.h>
@@ -73,7 +72,7 @@
     TInt pos=0; // Relative position zero
     aret=TheFile.Seek(ESeekCurrent,pos);
     test.Printf(_L("bwrite2,pos=%u\n"),pos);
-    test_KErrNone(aret);
+    test(aret==KErrNone);
     TInt count=pos&0xff;
 	tbuf.SetLength(aLength);
 	TText8* p=(TText8*)tbuf.Ptr();
@@ -99,7 +98,7 @@
 	CheckDisk();
     TInt pos=0; // Relative position zero
     aret=TheFile.Seek(ESeekCurrent,pos);
-    test_KErrNone(aret);
+    test(aret==KErrNone);
     TInt count=pos&0xff;
     aret=TheFile.Read(tbuf,aLength);
     if (bret<KErrNone)
@@ -128,7 +127,7 @@
 	CheckDisk();
     TInt newpos=aPos;
     aret=TheFile.Seek(ESeekStart,newpos);
-    test_KErrNone(aret);
+    test(aret==KErrNone);
     test(newpos==aPos);
 	CheckDisk();
     }
@@ -166,7 +165,7 @@
     bret=KErrAccessDenied; bwrite(1); bret=0;
     bclose();
 	aret=TheFile.Open(TheFs,tzzz,EFileRead);
-	test_Value(aret, aret == KErrNotFound);
+	test(aret==KErrNotFound);
 	test.End();
     }
 
@@ -200,15 +199,15 @@
     bposa(0);
     bret=1100; bread(1100); bret=0;
     aret=TheFile.Flush();
-    test_KErrNone(aret);
+    test(aret==KErrNone);
     aret=TheFile.SetSize(2000);
-    test_KErrNone(aret);
+    test(aret==KErrNone);
     TInt pos=0;
     aret=TheFile.Seek(ESeekCurrent,pos);
-    test_Value(aret, aret == KErrNone && pos==1100);
+    test(aret==KErrNone && pos==1100);
     pos=0;
     aret=TheFile.Seek(ESeekEnd,pos);
-    test_Value(aret, aret == KErrNone && pos==2000);
+    test(aret==KErrNone && pos==2000);
     bclose();
 	test.End();
     }
@@ -226,32 +225,32 @@
     test.Start(_L("RNDTEST..."));
     TInt64 seed(0),zero(0);
 	aret=TheFile.Replace(TheFs,rndm,EFileWrite|aMode);
-	test_KErrNone(aret);
+	test(aret==KErrNone);
     for (cnt=0;cnt<KRandomNumbers;cnt++)
         {
 		TBuf8<0x10> b;
 		b.Format(TPtrC8((TUint8*)"%8x"),Math::Rand(seed));
 		aret=TheFile.Write(b);
-		test_KErrNone(aret);
+		test(aret==KErrNone);
         }
 	TheFile.Close();
 //
     test.Next(_L("Reading back"));
     seed=zero;
 	aret=TheFile.Open(TheFs,rndm,aMode);
-	test_KErrNone(aret);
+	test(aret==KErrNone);
     for (cnt=0;cnt<KRandomNumbers;cnt++)
         {
 		TBuf8<8> b;
 		b.Format(TPtrC8((TUint8*)"%8x"),Math::Rand(seed));
 		TBuf8<8> r;
 		aret=TheFile.Read(r);
-		test_KErrNone(aret);
+		test(aret==KErrNone);
 		test(b==r);
         }
 	TheFile.Close();
     aret=TheFs.Delete(rndm);
-	test_KErrNone(aret);
+	test(aret==KErrNone);
 //
 	test.End();
     }
@@ -265,14 +264,14 @@
     test.Start(_L("TAutoClose..."));
 	TAutoClose<RFile> f;
 	aret=f.iObj.Replace(TheFs,rndm,EFileWrite);
-	test_KErrNone(aret);
+	test(aret==KErrNone);
     TInt64 seed;
     for (TInt cnt=0;cnt<KRandomNumbers;cnt++)
         {
 		TBuf8<0x10> b;
 		b.Format(TPtrC8((TUint8*)"%8x"),Math::Rand(seed));
 		aret=f.iObj.Write(b);
-		test_KErrNone(aret);
+		test(aret==KErrNone);
         }
 	test.End();
     }
@@ -284,7 +283,7 @@
 	TRequestStatus status = KRequestPending;
 	TheFile.Open(TheFs,tbin,EFileRead);
  	ret = TheFile.Read(0,tbuf,-1);			// sync
- 	test_Value(ret, ret == KErrArgument);
+ 	test ( ret == KErrArgument);
  	TheFile.Read(0,tbuf,-1,status);		// async
  	User::WaitForRequest(status);
  	test(status.Int() == KErrArgument);
@@ -300,16 +299,16 @@
 	RFile f;             
 	MakeFile(_L("C:\\F32-TST\\TFILE\\hello2.txt"));
 	TInt r=f.Open(TheFs,_L("C:\\F32-TST\\TFILE\\hello2.txt"),EFileRead); 
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TBuf8<0x100> a;
 	test.Next(_L("Check Negative length when file is empty"));
 	r=f.Read(a, -10);
-	test_Value(r, r == KErrArgument);
+	test(r==KErrArgument);
 	r=f.Read(0,a, -1);
-	test_Value(r, r == KErrArgument);
+	test(r==KErrArgument);
 	r=f.Read(0,a, -10);
-	test_Value(r, r == KErrArgument);
+	test(r==KErrArgument);
 	TRequestStatus	stat1;
 	f.Read(0,a,-5,stat1);
 	User::WaitForRequest(stat1);
--- a/kerneltest/f32test/server/b_gen.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/b_gen.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -13,7 +13,6 @@
 // Description:
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32math.h>
@@ -33,6 +32,8 @@
 #define MINIMUM_DATE (315532800L)
 #define DateTests   10
 
+// GLREF_D P_DEVICE p_file;
+// GLREF_D P_DEVICE p_wind,p_screen,p_cons;
 
 TBuf<0x100> gNameBuf;
 TBuf<0x100> gNameOut;
@@ -51,7 +52,30 @@
 static TFileName pathBuf;
 
 
+const TInt NameErr=KErrBadName;
+const TInt DirErr=KErrPathNotFound;
+const TInt AccessErr=KErrAccessDenied;
+const TInt LockedErr=KErrInUse;
+const TInt ExistsErr=KErrAlreadyExists;
+const TInt NotExistsErr=KErrNotFound;
+const TInt EofErr=KErrEof;
+const TInt DeviceErr=KErrNotReady;
+//LOCAL_D TInt NoFileSystemErr=KErrNotReady;
+//LOCAL_D TInt NotSupportedErr=KErrNotSupported;
+const TInt ReadOnlyErr=KErrAccessDenied;
 
+const TInt P_FASTREAM=EFileStream;
+const TInt P_FAEXEC=0;
+const TInt P_FAMOD=KEntryAttArchive;
+const TInt P_FAREAD=KEntryAttReadOnly;
+//LOCAL_D TInt P_FAHIDDEN=KEntryAttHidden;
+//LOCAL_D TInt P_FASYSTEM=KEntryAttSystem;
+//static TInt P_FAVOLUME=KEntryAttVolume;
+const TInt P_FADIR=KEntryAttDir;
+const TInt P_FRANDOM=0;
+const TInt P_FABS=ESeekStart;
+
+const TInt P_FUPDATE=EFileWrite;
 
 
 static void doError(const TDesC &aMess, TInt anErr, TInt line)
@@ -137,7 +161,7 @@
 	TChar drive(aDirName[0]);
 	TInt driveNo;
 	c=RFs::CharToDrive(drive,driveNo);
-	test_KErrNone(c);
+	test(c==KErrNone);
 	if ((c=TheFs.Volume(volInfo,driveNo))!=KErrNone)
 		Error(_L("Device info 1000"),c);
     }
@@ -176,7 +200,7 @@
 	if (aDeviceName.Length())
 		{
 		c=RFs::CharToDrive(aDeviceName[0],drive);
-		test_KErrNone(c);
+		test(c==KErrNone);
 		}		
 	if ((c=TheFs.Volume(volInfo,drive))!=anErr)
 		Error(_L("Device info"),c);
@@ -203,14 +227,14 @@
 		{
 		if (aFileName.Length()>=2 && aFileName[0]=='Z' && aFileName[1]==':')
 			{
-			if ((gFileEntry.iAtt&(KEntryAttReadOnly|EFileStream)) != (TUint32)(KEntryAttReadOnly|EFileStream) && gFileEntry.iAtt!=KEntryAttDir)
+			if ((gFileEntry.iAtt&(P_FAREAD|P_FAEXEC|P_FASTREAM)) != (TUint32)(P_FAREAD|P_FAEXEC|P_FASTREAM) && gFileEntry.iAtt!=KEntryAttDir)
 				Error(_L("Info status check Z:\\"),0);
 			}
 		else
 			{
 			if (gFileEntry.iAtt&KEntryAttDir)
 				return; // Found directory entry
-			if (gFileEntry.iAtt!=(TUint32)(EFileStream|KEntryAttArchive))
+			if (gFileEntry.iAtt!=(TUint32)(P_FASTREAM|P_FAMOD))
 				Error(_L("Info status check"),0);
 			if (gFileEntry.iSize!=0L)
 				Error(_L("Info size check"),0);
@@ -230,7 +254,7 @@
 	if ((c=gFile.Open(TheFs,aDName,EFileStream))!=KErrNone)
 		Error(_L("Open 92"),c);
 	gFile.Close();
-	if ((c=TheFs.Delete(aRName))!=KErrNotFound)
+	if ((c=TheFs.Delete(aRName))!=NotExistsErr)
 		Error(_L("Delete 92"),c);
 	}
 
@@ -249,7 +273,7 @@
 	if ((c=gFile.Open(TheFs,rName,EFileStream))!=KErrNone)
 		Error(_L("Open 91"),c);
 	gFile.Close();
-	if ((c=TheFs.Delete(pName))!=KErrNotFound)
+	if ((c=TheFs.Delete(pName))!=NotExistsErr)
 		Error(_L("Delete 91"),c);
 	}
 
@@ -284,11 +308,11 @@
 	dirname.Append(KPathDelimiter);
 	MakeDir(dirname);
 	TInt err = TheFs.Rename(KDir1, KDir2);
-	test_KErrNone(err);
+	test(err == KErrNone);
 	err = TheFs.RmDir(dirname);
-	test_KErrNone(err);
+	test(err == KErrNone);
 	err = TheFs.RmDir(KDir1);
-	test_KErrNone(err);
+	test(err == KErrNone);
 	}
 	
 static void testRename()
@@ -303,7 +327,7 @@
 	test.Printf(_L("Test TheFs.Rename\n"));
 
 	test.Printf(_L("Test rename into root\n"));
-	if ((c=gFile.Replace(TheFs,_L("\\TESTPAT1.DAT"),EFileStream|EFileWrite))!=KErrNone)
+	if ((c=gFile.Replace(TheFs,_L("\\TESTPAT1.DAT"),EFileStream|P_FUPDATE))!=KErrNone)
 		Error(_L("Create testpat1"),c);
 	gDataBuf.Fill('X',512);
 	if ((c=gFile.Write(gDataBuf,512))!=KErrNone)
@@ -340,28 +364,28 @@
 		Error(_L("Delete 80"),c);
 
 	test.Printf(_L("Test rename with wild cards\n"));
-	if ((c=TheFs.Rename(_L("*.*"),_L("FRED")))!=KErrBadName)
+	if ((c=TheFs.Rename(_L("*.*"),_L("FRED")))!=NameErr)
 		Error(_L("Rename 100"),c);
-	if ((c=TheFs.Rename(_L("?"),_L("FRED")))!=KErrBadName)
+	if ((c=TheFs.Rename(_L("?"),_L("FRED")))!=NameErr)
 		Error(_L("Rename 101"),c);
-	if ((c=TheFs.Rename(_L(""),_L("FRED")))!=KErrBadName) // KErrBadName)
+	if ((c=TheFs.Rename(_L(""),_L("FRED")))!=KErrBadName) // NameErr)
 		Error(_L("Rename 101.11"),c);
-	if ((c=TheFs.Rename(_L("."),_L("FRED")))!=KErrBadName)
+	if ((c=TheFs.Rename(_L("."),_L("FRED")))!=NameErr)
 		Error(_L("Rename 101.12"),c);
-	if ((c=TheFs.Rename(_L("NOEXIST"),_L("*")))!=KErrBadName)
+	if ((c=TheFs.Rename(_L("NOEXIST"),_L("*")))!=NameErr)
 		Error(_L("Rename 101.1"),c);
 	if ((c=gFile.Create(TheFs,_L("FILE1"),EFileStream))!=KErrNone)
 		Error(_L("Create 101.2"),c);
 	gFile.Close();
-	if ((c=TheFs.Rename(_L("FILE1"),_L("AAA?")))!=KErrBadName)
+	if ((c=TheFs.Rename(_L("FILE1"),_L("AAA?")))!=NameErr)
 		Error(_L("Rename 101.3"),c);
-	if ((c=TheFs.Rename(_L("FILE1"),_L("")))!=KErrBadName) // KErrBadName)
+	if ((c=TheFs.Rename(_L("FILE1"),_L("")))!=KErrBadName) // NameErr)
 		Error(_L("Rename 101.41"),c);
-	if ((c=TheFs.Rename(_L(""),_L("")))!=KErrBadName) // KErrBadName)
+	if ((c=TheFs.Rename(_L(""),_L("")))!=KErrBadName) // NameErr)
 		Error(_L("Rename 101.42"),c);
 	if ((c=TheFs.Delete(_L("FILE1")))!=KErrNone)
 		Error(_L("Delete 101.5"),c);
-	if ((c=TheFs.Rename(_L("\\"),_L("FRED")))!=KErrBadName)
+	if ((c=TheFs.Rename(_L("\\"),_L("FRED")))!=NameErr)
 		Error(_L("Rename 101.6"),c);
 
 	test.Printf(_L("Test rename of directories\n"));
@@ -371,7 +395,7 @@
 		Error(_L("Rename 103.1"),c);
 	if ((c=TheFs.Rename(_L("\\A2345678.123"),_L("\\DIR2")))!=KErrNone)
 		Error(_L("Rename 103.2"),c);
-	if ((c=TheFs.Rename(_L("\\DIR2"),_L("\\A234567.1234")))!=KErrNone) // ****** KErrBadName) Long filenames are supported
+	if ((c=TheFs.Rename(_L("\\DIR2"),_L("\\A234567.1234")))!=KErrNone) // ****** NameErr) Long filenames are supported
 		Error(_L("Rename 103.3"),c);
 	if ((c=TheFs.Rename(_L("\\A234567.1234"),_L("\\DIR2")))!=KErrNone)
 		Error(_L("Rename 103.3"),c);
@@ -381,18 +405,18 @@
 	test.Printf(_L("Test rename of open files\n"));
 	if ((c=gFile.Create(TheFs,_L("\\DIR1\\FILE1"),EFileStreamText))!=KErrNone)
 		Error(_L("Create 105"),c);
-	if ((c=TheFs.Rename(_L("\\DIR1\\FILE1"),_L("\\DIR1\\FILE1")))!=KErrInUse)
+	if ((c=TheFs.Rename(_L("\\DIR1\\FILE1"),_L("\\DIR1\\FILE1")))!=LockedErr)
 		Error(_L("Rename 106"),c);
-	if ((c=TheFs.Rename(_L("\\DIR1\\FILE1"),_L("\\DIR2\\FILE1")))!=KErrInUse)
+	if ((c=TheFs.Rename(_L("\\DIR1\\FILE1"),_L("\\DIR2\\FILE1")))!=LockedErr)
 		Error(_L("Rename 106.1"),c);
-	if ((c=gFile2.Open(TheFs,_L("\\DIR2\\FILE1"),EFileStream))!=KErrNotFound)
+	if ((c=gFile2.Open(TheFs,_L("\\DIR2\\FILE1"),EFileStream))!=NotExistsErr)
 		Error(_L("Create 105"),c);
 	gFile.Close();
 
 	test.Printf(_L("Test rename to same name\n"));
-	if ((c=TheFs.Rename(_L("\\DIR1\\FILE1"),_L("\\DIR1\\FILE1")))!=KErrNone) // !=KErrAlreadyExists)
+	if ((c=TheFs.Rename(_L("\\DIR1\\FILE1"),_L("\\DIR1\\FILE1")))!=KErrNone) // !=ExistsErr)
 		Error(_L("Rename 105.1"),c);
-	if ((c=TheFs.Rename(_L("\\DIR1"),_L("\\DIR1")))!=KErrNone) // !=KErrAlreadyExists)
+	if ((c=TheFs.Rename(_L("\\DIR1"),_L("\\DIR1")))!=KErrNone) // !=ExistsErr)
 		Error(_L("Rename 105.2"),c);
 
 	test.Printf(_L("Test rename of read-only files\n"));     // IS ALLOWED //
@@ -401,15 +425,15 @@
 	if ((c=TheFs.Entry(_L("\\DIR1\\FILE1"),gFileEntry))!=KErrNone)
 		Error(_L("File info 106.1"),c);
 	test.Printf(_L("STATUS=%04x\n"),gFileEntry.iAtt);
-	if (gFileEntry.iAtt!=(TUint32)(KEntryAttReadOnly|EFileStream|KEntryAttArchive))
+	if (gFileEntry.iAtt!=(TUint32)(P_FAREAD|P_FASTREAM|P_FAMOD))
 		Error(_L("Status check 106.2"),0);
 	if ((c=TheFs.Entry(_L("\\DIR1"),gFileEntry))!=KErrNone)
 		Error(_L("File info 106.3"),c);
 	test.Printf(_L("STATUS=%04x\n"),gFileEntry.iAtt);
-	if (gFileEntry.iAtt!=(TUint32)(EFileStream|KEntryAttDir))
+	if (gFileEntry.iAtt!=(TUint32)(P_FASTREAM|P_FADIR))
 		Error(_L("Status check 106.4"),0);
 
-	if ((c=TheFs.Rename(_L("\\DIR1\\FILE1"),_L("\\DIR1\\FILE1")))!=KErrNone) // !=KErrAlreadyExists)
+	if ((c=TheFs.Rename(_L("\\DIR1\\FILE1"),_L("\\DIR1\\FILE1")))!=KErrNone) // !=ExistsErr)
 		Error(_L("Rename 107"),c);
 	if ((c=TheFs.Rename(_L("\\DIR1\\FILE1"),_L("\\DIR1\\FILE2")))!=KErrNone)
 		Error(_L("Rename 108"),c);
@@ -431,9 +455,9 @@
 	gFile.Close();
 
 	test.Printf(_L("Test rename of directories across directories\n"));
-	if ((c=TheFs.Rename(_L("\\DIR1"),_L("\\DIR2\\DIR1")))!=KErrNone) // ******** KErrAccessDenied)
+	if ((c=TheFs.Rename(_L("\\DIR1"),_L("\\DIR2\\DIR1")))!=KErrNone) // ******** AccessErr)
 		Error(_L("Rename 114"),c);
-	if ((c=TheFs.Rename(_L("\\DIR1"),_L("\\")))!=KErrBadName)
+	if ((c=TheFs.Rename(_L("\\DIR1"),_L("\\")))!=NameErr)
 		Error(_L("Rename 114.1"),c);
 
 	if ((c=TheFs.Delete(_L("\\DIR2\\FILE1")))!=KErrNone)
@@ -459,11 +483,11 @@
 		Error(_L("Make dir 500"),c);
 	if ((c=gFile.Create(TheFs,_L("\\TESTDIR\\NAME.EXT"),EFileStream))!=KErrNone)
 		Error(_L("Create"),c);
-	if ((c=TheFs.Delete(_L("\\TESTDIR\\")))!=KErrBadName) // ******* KErrAccessDenied)
+	if ((c=TheFs.Delete(_L("\\TESTDIR\\")))!=KErrBadName) // ******* AccessErr)
 		Error(_L("Delete 501"),c);
 
 	test.Printf(_L("Test delete open file\n"));
-	if ((c=TheFs.Delete(_L("\\TESTDIR\\NAME.EXT")))!=KErrInUse)
+	if ((c=TheFs.Delete(_L("\\TESTDIR\\NAME.EXT")))!=LockedErr)
 		Error(_L("Delete 502"),c);
 	gFile.Close();
 	if ((c=TheFs.Delete(_L("\\TESTDIR\\NAME.EXT")))!=KErrNone)
@@ -593,7 +617,7 @@
 		{
         TParse parse;
         c=TheFs.Parse(aDirName,parse);
-        test_KErrNone(c);
+        test(c==KErrNone);
         buf=parse.Path();
         buf.Append(_L("*"));
         if (buf.Length()<=64)
@@ -602,7 +626,7 @@
             if ((c=gDir.Open(TheFs,buf,KEntryAttMaskSupported))!=KErrNone)
                 Error2(_L("Directory open 1"),c, line);
             gDataBuf[0]=0;
-            if ((c=gDir.Read(gFileEntry))!=KErrEof)
+            if ((c=gDir.Read(gFileEntry))!=EofErr)
             	{
                 test.Printf(_L("buf=\"%S\"\n"),&gFileEntry.iName);
                 Error2(_L("Directory read"),c, line);
@@ -689,16 +713,16 @@
     F32_Test_Utils::SetConsole(test.Console());
 
     TInt nRes=TheFs.CharToDrive(gDriveToTest, gDriveNum);
-    test_KErrNone(nRes);
+    test(nRes==KErrNone);
     
     PrintDrvInfo(TheFs, gDriveNum);
 
-    //-- quick format the drive, if it isn't drive C: of the emulator or PlatSim
-    if(!Is_SimulatedSystemDrive(TheFs, gDriveNum))
-    	{
+    //-- quick format the drive, if it isn't the emulator's C:  
+    if(!Is_Win32(TheFs, gDriveNum))
+    {
         nRes = FormatDrive(TheFs, gDriveNum, ETrue); 
-        test_KErrNone(nRes);
-    	}
+        test(nRes==KErrNone);
+    }
 
     //-----------------------------------
 	TInt c;
@@ -726,15 +750,15 @@
 	testDir(_L("Z:\\*.*"));
 
 	test.Printf(_L("Test names containing '\\'\n"));
-	if ((c=gFile.Create(TheFs,_L("Q\\ZZZ"),EFileWrite))!=KErrBadName)
+	if ((c=gFile.Create(TheFs,_L("Q\\ZZZ"),EFileWrite))!=NameErr)
 		Error(_L("Create 1"),c);
 
 	test.Printf(_L("Test create in non-exist directory\n"));
-	if ((c=gFile.Create(TheFs,_L("\\Q1DDX\\ZZZ"),EFileWrite))!=KErrPathNotFound)
+	if ((c=gFile.Create(TheFs,_L("\\Q1DDX\\ZZZ"),EFileWrite))!=DirErr)
 		Error(_L("Create 2"),c);
 
 	test.Printf(_L("Test filenames starting with '.'\n"));
-	if ((c=gFile.Create(TheFs,_L("\\.ZZZ"),EFileWrite))!=KErrNone) // ****** KErrBadName)
+	if ((c=gFile.Create(TheFs,_L("\\.ZZZ"),EFileWrite))!=KErrNone) // ****** NameErr)
 		Error(_L("Create 3"),c);
 	gFile.Close();
 	if ((c=TheFs.Delete(_L("\\.ZZZ")))!=KErrNone)
@@ -802,18 +826,18 @@
 	testDelete();
 	testRename();
 	test.Printf(_L("Test get file info\n"));
-//	testFileInfo(_L("*.*"),KErrBadName); ********** Allowed (?)
-	testFileInfo(_L(""),KErrNone); // KErrBadName);
-	testFileInfo(_L("\\"),KErrBadName);
-	testFileInfo(_L("."),KErrBadName);
-	testFileInfo(_L(".."),KErrBadName);
-	testFileInfo(_L("a.1234"),KErrNotFound); // ********* KErrBadName);
-	testFileInfo(_L("a23456789"),KErrNotFound); // ********* KErrBadName);
-	testFileInfo(_L(".a"),KErrNotFound); // ********** KErrBadName);
-	testFileInfo(_L("?"),KErrBadName);
-	testFileInfo(_L("NOEXIST"),KErrNotFound);
-	testFileInfo(_L("\\NODIR\\NAME"),KErrPathNotFound);
-	testFileInfo(_L("L:\\NAME"),KErrNotReady);
+//	testFileInfo(_L("*.*"),NameErr); ********** Allowed (?)
+	testFileInfo(_L(""),KErrNone); // NameErr);
+	testFileInfo(_L("\\"),NameErr);
+	testFileInfo(_L("."),NameErr);
+	testFileInfo(_L(".."),NameErr);
+	testFileInfo(_L("a.1234"),KErrNotFound); // ********* NameErr);
+	testFileInfo(_L("a23456789"),KErrNotFound); // ********* NameErr);
+	testFileInfo(_L(".a"),KErrNotFound); // ********** NameErr);
+	testFileInfo(_L("?"),NameErr);
+	testFileInfo(_L("NOEXIST"),NotExistsErr);
+	testFileInfo(_L("\\NODIR\\NAME"),DirErr);
+	testFileInfo(_L("L:\\NAME"),DeviceErr);
 	gNameBuf.SetLength(0);
 	if ((c=gFile.Temp(TheFs,gNameBuf,gNameOut,EFileStream))!=KErrNone)
 		Error(_L("Open 1.1"),c);
@@ -825,7 +849,7 @@
 
 	test.Printf(_L("Test get device info\n"));
 	testDeviceInfo(_L(""),FALSE);           // NULL is current device //
-	testDeviceInfo(_L("L:"),KErrNotReady);
+	testDeviceInfo(_L("L:"),DeviceErr);
 	testDeviceInfo(_L("Z:"),FALSE);
 	testDeviceInfo(fBuf,FALSE);
 	
@@ -848,88 +872,88 @@
 //	testNodeInfo(_L("...::"),0,E_GEN_FSYS);
 
 //	testFileInfo(_L("Z:SYS$WSRV.IMG"),FALSE);
-//	testFileInfo(_L("Z:\\SYS$WSRV.IMG"),KErrBadName);    // \ not allowed  - no path //
+//	testFileInfo(_L("Z:\\SYS$WSRV.IMG"),NameErr);    // \ not allowed  - no path //
 //	testFileInfo(_L("Z:*"),FALSE);               // Z: allows *'s ! //
-//	testFileInfo(_L("Z:SYS$WSRV."),KErrNotFound);
+//	testFileInfo(_L("Z:SYS$WSRV."),NotExistsErr);
 //	testFileInfo(_L("XXX::"),NoFileSystemErr);
 	if(PlatSec::ConfigSetting(PlatSec::EPlatSecEnforceSysBin))
 		testFileInfo(_L("Z:\\Sys\\Bin\\ESHELL.EXE"),FALSE);    // we now have paths //
 	else
 		testFileInfo(_L("Z:\\System\\Bin\\ESHELL.EXE"),FALSE);    // we now have paths //
 //	testFileInfo(_L("Z:*"),KErrPathNotFound); // session path gets inserted ,FALSE);
-//	testFileInfo(_L("Z:SYS$WSRV."),KErrNotFound);
+//	testFileInfo(_L("Z:SYS$WSRV."),NotExistsErr);
 //	testFileInfo(_L("H:"),KErrBadName); // ************** NoFileSystemErr);
 
 	test.Printf(_L("Test weird filenames\n"));
 // Test SPACES // 
 
-	testFileName(_L("A B"),KErrNone); // ******* KErrBadName);
-	testFileName(_L(" AB"),KErrNone); // ******* KErrBadName);
-	testFileName(_L(" AB      "),KErrNone); // ******* KErrBadName);
+	testFileName(_L("A B"),KErrNone); // ******* NameErr);
+	testFileName(_L(" AB"),KErrNone); // ******* NameErr);
+	testFileName(_L(" AB      "),KErrNone); // ******* NameErr);
 	testFileName(_L("    AB"),KErrNone);
 	testFileName(_L(" AB  . cdef"),KErrNone);
 	testFileName(_L(" AB  .  cdef  "),KErrNone);
-	testFileName(_L("A2345678 "),KErrNone); // ******* KErrBadName);
-	testFileName(_L("A2345678.XY "),KErrNone); // ******* KErrBadName);
-	testFileName(_L("A2345678.XYZ "),KErrNone); // ******* KErrBadName);
-	testFileName(_L("A2345678 XYZ"),KErrNone); // ******* KErrBadName);
-	testFileName(_L(" "),KErrBadName);
-	testFileName(_L("\\A B\\NAME"),KErrPathNotFound); // ******* KErrBadName);
-	testFileName(_L("\\ \\NAME"),KErrBadName);
-	testFileName(_L("\\asdf\\qer\\   \\asdf\\NAME"),KErrBadName);
-	testFileName(_L("     "),KErrBadName);
-	testFileName(_L("C:\\asdf\\     "),KErrBadName);
+	testFileName(_L("A2345678 "),KErrNone); // ******* NameErr);
+	testFileName(_L("A2345678.XY "),KErrNone); // ******* NameErr);
+	testFileName(_L("A2345678.XYZ "),KErrNone); // ******* NameErr);
+	testFileName(_L("A2345678 XYZ"),KErrNone); // ******* NameErr);
+	testFileName(_L(" "),NameErr);
+	testFileName(_L("\\A B\\NAME"),KErrPathNotFound); // ******* NameErr);
+	testFileName(_L("\\ \\NAME"),NameErr);
+	testFileName(_L("\\asdf\\qer\\   \\asdf\\NAME"),NameErr);
+	testFileName(_L("     "),NameErr);
+	testFileName(_L("C:\\asdf\\     "),NameErr);
 // Test short names //
-	testFileName(_L(""),KErrBadName);
-	testFileName(_L("\\"),KErrBadName);
+	testFileName(_L(""),NameErr);
+	testFileName(_L("\\"),NameErr);
 	testFileName(_L("1"),FALSE);
-	testFileName(_L(".1"),KErrNone); // ******* KErrBadName);
-	testFileName(_L(".1"),KErrNone); // ******* KErrBadName);
-	testFileName(_L("\\.1"),KErrNone); // ******* KErrBadName);
+	testFileName(_L(".1"),KErrNone); // ******* NameErr);
+	testFileName(_L(".1"),KErrNone); // ******* NameErr);
+	testFileName(_L("\\.1"),KErrNone); // ******* NameErr);
 	testFileName(_L("1.1"),FALSE);
 // Test long names //
 	testFileName(_L("12345678.123"),FALSE);
-	testFileName(_L("123456789.123"),KErrNone); // ******* KErrBadName);
-	testFileName(_L("12345678.1234"),KErrNone); // ******* KErrBadName);
-	testFileName(_L("1.1234"),KErrNone); // ******* KErrBadName);
-	testFileName(_L("123456789"),KErrNone); // ******* KErrBadName);
+	testFileName(_L("123456789.123"),KErrNone); // ******* NameErr);
+	testFileName(_L("12345678.1234"),KErrNone); // ******* NameErr);
+	testFileName(_L("1.1234"),KErrNone); // ******* NameErr);
+	testFileName(_L("123456789"),KErrNone); // ******* NameErr);
 	gDataBuf.SetLength(256);
 	gDataBuf.Fill('A',255);
-	testFileName(gDataBuf,KErrBadName);
+	testFileName(gDataBuf,NameErr);
 	gDataBuf.SetLength(257);
 	gDataBuf.Fill('B',256);
-	testFileName(gDataBuf,KErrBadName);
+	testFileName(gDataBuf,NameErr);
 	gDataBuf.SetLength(258);
 	gDataBuf.Fill('C',257);
-	testFileName(gDataBuf,KErrBadName);
+	testFileName(gDataBuf,NameErr);
 	gDataBuf.SetLength(4096);
 	gDataBuf.Fill('D',4095);
-	testFileName(gDataBuf,KErrBadName);
+	testFileName(gDataBuf,NameErr);
 // Test DOTS //
 	testFileName(_L("A.X"),FALSE);
-	testFileName(_L("A..X"),KErrNone); // ******* KErrBadName);
-	testFileName(_L("A.........X"),KErrNone); // ******* KErrBadName);
+	testFileName(_L("A..X"),KErrNone); // ******* NameErr);
+	testFileName(_L("A.........X"),KErrNone); // ******* NameErr);
 	testFileName(_L("A."),FALSE);
-	testFileName(_L(".X"),KErrNone); // ******* KErrBadName);
-	testFileName(_L("."),KErrBadName);
-	testFileName(_L(".."),KErrBadName);
-//	testFileName(_L("..."),KErrNone); // KErrBadName); // !!! ********* NT error KErrAccessDenied (?)
-	testFileName(_L("\\a.x\\NAME"),KErrPathNotFound); // KErrPathNotFound == KErrPathNotFound
-	testFileName(_L("\\a..x\\NAME"),KErrPathNotFound); // ******** KErrBadName);
-	testFileName(_L("\\.\\NAME"),KErrBadName);
-	testFileName(_L("\\..\\NAME"),KErrBadName);
-//	testFileName(_L("\\...\\NAME"),KErrPathNotFound); // ******** KErrBadName); // !! NT treats ... as .. ??
+	testFileName(_L(".X"),KErrNone); // ******* NameErr);
+	testFileName(_L("."),NameErr);
+	testFileName(_L(".."),NameErr);
+//	testFileName(_L("..."),KErrNone); // NameErr); // !!! ********* NT error KErrAccessDenied (?)
+	testFileName(_L("\\a.x\\NAME"),DirErr); // DirErr == KErrPathNotFound
+	testFileName(_L("\\a..x\\NAME"),DirErr); // ******** NameErr);
+	testFileName(_L("\\.\\NAME"),NameErr);
+	testFileName(_L("\\..\\NAME"),NameErr);
+//	testFileName(_L("\\...\\NAME"),KErrPathNotFound); // ******** NameErr); // !! NT treats ... as .. ??
 // Test WILD CARDS //
-	testFileName(_L("*.*"),KErrBadName);
-	testFileName(_L("*"),KErrBadName);
-	testFileName(_L("\\*"),KErrBadName);
-	testFileName(_L("?"),KErrBadName);
-	testFileName(_L("\\?"),KErrBadName);
-	testFileName(_L("\\A?B\\NAME"),KErrBadName);
-	testFileName(_L("\\A*B\\NAME"),KErrBadName);
-	testFileName(_L("\\*\\NAME"),KErrBadName);
-	testFileName(_L("\\********.***\\NAME"),KErrBadName);
-	testFileName(_L("A?X"),KErrBadName);
+	testFileName(_L("*.*"),NameErr);
+	testFileName(_L("*"),NameErr);
+	testFileName(_L("\\*"),NameErr);
+	testFileName(_L("?"),NameErr);
+	testFileName(_L("\\?"),NameErr);
+	testFileName(_L("\\A?B\\NAME"),NameErr);
+	testFileName(_L("\\A*B\\NAME"),NameErr);
+	testFileName(_L("\\*\\NAME"),NameErr);
+	testFileName(_L("\\********.***\\NAME"),NameErr);
+	testFileName(_L("A?X"),NameErr);
 
 	test.Printf(_L("Test set volume name\n"));
 // New behaviour: SetVolumeName accepts any string < 12 chars
@@ -994,64 +1018,64 @@
 
 // Test path 
 	testMakeDir(_L("\\A2345678.A23\\NAME"),FALSE);
-	testMakeDir(_L("\\A23456789.A23\\NAME"),KErrNone); // ******** KErrBadName);
-	testMakeDir(_L("\\A2345678.A234\\NAME"),KErrNone); // ******** KErrBadName);
-	testMakeDir(_L("\\A.1234\\NAME"),KErrNone); // ********* KErrBadName);
+	testMakeDir(_L("\\A23456789.A23\\NAME"),KErrNone); // ******** NameErr);
+	testMakeDir(_L("\\A2345678.A234\\NAME"),KErrNone); // ******** NameErr);
+	testMakeDir(_L("\\A.1234\\NAME"),KErrNone); // ********* NameErr);
 	testMakeDir(_L("\\A2345678\\NAME"),FALSE);
-	testMakeDir(_L("\\A23456789\\NAME"),KErrNone); // ******** KErrBadName);
+	testMakeDir(_L("\\A23456789\\NAME"),KErrNone); // ******** NameErr);
 	testMakeDir(_L("\\A.X\\NAME"),FALSE);
-	testMakeDir(_L("\\A..X\\NAME"),KErrNone); // ******** KErrBadName);
-	testMakeDir(_L("\\A.\\NAME"),KErrBadName);
-	testMakeDir(_L("\\.X\\NAME"),KErrNone); // ******** KErrBadName);
-	testMakeDir(_L("\\.\\NAME"),KErrBadName);
-	testMakeDir(_L("\\..\\NAME"),KErrBadName);
-	testMakeDir(_L("\\\\NAME"),KErrBadName);
-	testMakeDir(_L("\\\\"),KErrBadName);
-	testMakeDir(_L("\\A\\A2\\A23\\a2345678\\a2345678.\\a2345678.1\\a2345678.123"),KErrBadName);
-	testMakeDir(_L("\\A\\A2\\A23\\a2345678\\a2345678.\\a2345678.1\\a2345678..123"),KErrBadName); // ******* KErrBadName);
-	testMakeDir(_L("\\A\\A2\\A23\\a2345678\\a2345678.\\a2345678.1\\a2345678.1234"),KErrBadName); // ******* KErrBadName);
+	testMakeDir(_L("\\A..X\\NAME"),KErrNone); // ******** NameErr);
+	testMakeDir(_L("\\A.\\NAME"),NameErr);
+	testMakeDir(_L("\\.X\\NAME"),KErrNone); // ******** NameErr);
+	testMakeDir(_L("\\.\\NAME"),NameErr);
+	testMakeDir(_L("\\..\\NAME"),NameErr);
+	testMakeDir(_L("\\\\NAME"),NameErr);
+	testMakeDir(_L("\\\\"),NameErr);
+	testMakeDir(_L("\\A\\A2\\A23\\a2345678\\a2345678.\\a2345678.1\\a2345678.123"),NameErr);
+	testMakeDir(_L("\\A\\A2\\A23\\a2345678\\a2345678.\\a2345678.1\\a2345678..123"),NameErr); // ******* NameErr);
+	testMakeDir(_L("\\A\\A2\\A23\\a2345678\\a2345678.\\a2345678.1\\a2345678.1234"),NameErr); // ******* NameErr);
 	gDataBuf.SetLength(256);
 	gDataBuf.Fill('V',255);
-	testMakeDir(gDataBuf,KErrBadName);
+	testMakeDir(gDataBuf,NameErr);
 	gDataBuf.SetLength(257);
 	gDataBuf.Fill('W',256);
-	testMakeDir(gDataBuf,KErrBadName);
+	testMakeDir(gDataBuf,NameErr);
 	gDataBuf.SetLength(258);
 	gDataBuf.Fill('X',257);
-	testMakeDir(gDataBuf,KErrBadName);
+	testMakeDir(gDataBuf,NameErr);
 	gDataBuf.SetLength(259);
 	gDataBuf.Fill('Y',258);
-	testMakeDir(gDataBuf,KErrBadName);
+	testMakeDir(gDataBuf,NameErr);
 	gDataBuf.SetLength(4096);
 	gDataBuf.Fill('Z',4095);
-	testMakeDir(gDataBuf,KErrBadName);
+	testMakeDir(gDataBuf,NameErr);
 
 // Test names 
-	testMakeDir(_L("A..X"),KErrAlreadyExists); // ******* KErrBadName);
+	testMakeDir(_L("A..X"),KErrAlreadyExists); // ******* NameErr);
 	testMakeDir(_L("\\A\\"),FALSE);
 	testMakeDir(_L("\\12345678.123\\"),FALSE);
-	testMakeDir(_L("\\.\\"),KErrBadName);
-	testMakeDir(_L("\\..\\"),KErrBadName);
+	testMakeDir(_L("\\.\\"),NameErr);
+	testMakeDir(_L("\\..\\"),NameErr);
 	testMakeDir(_L("\\X\\"),FALSE);
-	testMakeDir(_L("\\12345678.1234\\"),KErrNone); // ******* KErrBadName);
-	testMakeDir(_L("\\123456789\\"),KErrNone); // ******** KErrBadName);
+	testMakeDir(_L("\\12345678.1234\\"),KErrNone); // ******* NameErr);
+	testMakeDir(_L("\\123456789\\"),KErrNone); // ******** NameErr);
 // Test max levels
 	testMakeDir(_L("\\A\\B\\C\\D\\E\\F\\G\\H\\I\\J\\K\\L\\M\\N\\O\\P\\Q\\R\\S\\T\\U\\V\\W\\X\\Y\\Z"),FALSE);
 	testMakeDir(_L("\\00000000.000\\11111111.111\\22222222.222\\33333333.333\\45678901.3"),FALSE);
 	testMakeDir(_L("\\00000000.000\\11111111.111\\22222222.222\\33333333.333\\45678901.34"),FALSE);
 	testMakeDir(_L("\\00000000.000\\11111111.111\\22222222.222\\33333333.333\\45678901.345"),FALSE);
 	testMakeDir(_L("\\00000000.000\\11111111.111\\22222222.222\\33333333.333\\45678901.3\\xxxxxxxx.xxx"),FALSE);
-	testMakeDir(_L("\\00000000.000\\11111111.111\\22222222.222\\33333333.333\\45678901.34\\xxxxxxxx.xxx"),KErrNone); // ******* KErrBadName);
-	testMakeDir(_L("\\00000000.000\\11111111.111\\22222222.222\\33333333.333\\45678901.345\\xxxxxxxx.xxx"),KErrNone); // ******* KErrBadName);
+	testMakeDir(_L("\\00000000.000\\11111111.111\\22222222.222\\33333333.333\\45678901.34\\xxxxxxxx.xxx"),KErrNone); // ******* NameErr);
+	testMakeDir(_L("\\00000000.000\\11111111.111\\22222222.222\\33333333.333\\45678901.345\\xxxxxxxx.xxx"),KErrNone); // ******* NameErr);
 	testMakeDir(_L("\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\23"),FALSE);
 	testMakeDir(_L("\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\23456789.123"),FALSE);
 	testMakeDir(_L("\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\23\\5"),FALSE);
 	testMakeDir(_L("\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\23\\56789012.456"),FALSE);
-	testMakeDir(_L("\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\234\\6"),KErrNone); // ******** KErrBadName);
-	testMakeDir(_L("Z:\\ROMDIR\\"),KErrAccessDenied); //
+	testMakeDir(_L("\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\2\\4\\6\\8\\0\\234\\6"),KErrNone); // ******** NameErr);
+	testMakeDir(_L("Z:\\ROMDIR\\"),KErrAccessDenied); // *********** NotSupportedErr);
 	test.Printf(_L("Test setEof to same length\n"));
 	gNameBuf.SetLength(0);
-	if ((c=gFile.Temp(TheFs,gNameBuf,gNameOut,EFileStream|EFileWrite))!=KErrNone)
+	if ((c=gFile.Temp(TheFs,gNameBuf,gNameOut,EFileStream|P_FUPDATE))!=KErrNone)
 		Error(_L("Open 50"),c);
 	gFile.Close();
 	testSetEof(gNameOut,0L,FALSE);  // should be no change //
@@ -1075,29 +1099,29 @@
 	test.Printf(_L("Test read of zero bytes\n"));
 	gNameBuf.SetLength(0);
 
-	if ((c=gFile.Temp(TheFs,gNameBuf,gNameOut,EFileStream|EFileWrite))!=KErrNone)
+	if ((c=gFile.Temp(TheFs,gNameBuf,gNameOut,EFileStream|P_FUPDATE))!=KErrNone)
 		Error(_L("Open 60"),c);
-	if ((c=gFile.Read(gDataBuf,0))!=KErrNone) // ******** KErrEof)
+	if ((c=gFile.Read(gDataBuf,0))!=KErrNone) // ******** EofErr)
 		Error(_L("Read 61"),c);
-	if ((c=gFile.Read(gDataBuf,0))!=KErrNone) // ******** KErrEof)
+	if ((c=gFile.Read(gDataBuf,0))!=KErrNone) // ******** EofErr)
 		Error(_L("Read 62"),c);
 	if ((c=gFile.Write(gDataBuf,0))!=KErrNone)
 		Error(_L("Write 63"),c);
-	if ((c=gFile.Read(gDataBuf,0))!=KErrNone) // ******** KErrEof)
+	if ((c=gFile.Read(gDataBuf,0))!=KErrNone) // ******** EofErr)
 		Error(_L("Read 64"),c);
 	gFile.Close();
-	if ((c=gFile.Open(TheFs,gNameOut,EFileStream|EFileWrite))!=KErrNone)
+	if ((c=gFile.Open(TheFs,gNameOut,EFileStream|P_FUPDATE|P_FRANDOM))!=KErrNone)
 		Error(_L("Open 70"),c);
-	if ((c=gFile.Read(gDataBuf,0))!=KErrNone) // ******** KErrEof)
+	if ((c=gFile.Read(gDataBuf,0))!=KErrNone) // ******** EofErr)
 		Error(_L("Read 71"),c);
 	gDataBuf.SetLength(1);
 	gDataBuf[0]=0xf0;
 	if ((c=gFile.Write(gDataBuf,1))!=KErrNone)
 		Error(_L("Write 72"),c);
-	if ((c=gFile.Read(gDataBuf,0))!=KErrNone) // ********* KErrEof)
+	if ((c=gFile.Read(gDataBuf,0))!=KErrNone) // ********* EofErr)
 		Error(_L("Read 73"),c);
 	pos=0L;
-	if ((c=gFile.Seek((TSeek)ESeekStart,pos))!=KErrNone)
+	if ((c=gFile.Seek((TSeek)P_FABS,pos))!=KErrNone)
 		Error(_L("Seek 74"),c);
 	gDataBuf.SetLength(1);
 	gDataBuf[0]=0x83;
@@ -1112,9 +1136,9 @@
 		Error(_L("Read 77"),c);
 	if (gDataBuf[0]!=0xf0)
 		Error(_L("buffer 1 check"),0);
-	if ((c=gFile.Read(gDataBuf,0))!=KErrNone) // ******** KErrEof)
+	if ((c=gFile.Read(gDataBuf,0))!=KErrNone) // ******** EofErr)
 		Error(_L("Read 78"),c);
-	if ((c=gFile.Read(gDataBuf,16384))!=KErrNone) // ******* KErrEof)
+	if ((c=gFile.Read(gDataBuf,16384))!=KErrNone) // ******* EofErr)
 		Error(_L("Read 79"),c);
 	gFile.Close();
 	if ((c=TheFs.Delete(gNameOut))!=KErrNone)
@@ -1122,7 +1146,7 @@
 
     test.Printf(_L("Test write of zero bytes\n"));
     gNameBuf.SetLength(0);
-    if ((c=gFile.Temp(TheFs,gNameBuf,gNameOut,EFileStream|EFileWrite))!=KErrNone)
+    if ((c=gFile.Temp(TheFs,gNameBuf,gNameOut,EFileStream|P_FUPDATE))!=KErrNone)
         Error(_L("Open 50"),c);
     gFile.Close();
 //	********** Error(_L("Close"),c); close has no return value
@@ -1142,45 +1166,45 @@
 
 	test.Printf(_L("Test ReadOnly files\n"));
 	gNameBuf.SetLength(0);
-	if ((c=gFile.Create(TheFs,_L("TEST1.TMP"),EFileStream|EFileWrite))!=KErrNone)
+	if ((c=gFile.Create(TheFs,_L("TEST1.TMP"),EFileStream|P_FUPDATE))!=KErrNone)
 		Error(_L("Create 40"),c);
 	gFile.Close();
-	if ((c=gFile.Temp(TheFs,gNameBuf,gNameOut,EFileStream|EFileWrite))!=KErrNone)
+	if ((c=gFile.Temp(TheFs,gNameBuf,gNameOut,EFileStream|P_FUPDATE))!=KErrNone)
 		Error(_L("Open 40"),c);
 	mask=0;
 	attrib=KEntryAttReadOnly;                       // Remove writable //
-	if ((c=TheFs.SetAtt(gNameOut,attrib,mask))!=KErrInUse)
+	if ((c=TheFs.SetAtt(gNameOut,attrib,mask))!=LockedErr)
 		Error(_L("TheFs.SetAtt not locked"),c);
 	gFile.Close();
 	if ((c=TheFs.SetAtt(gNameOut,attrib,mask))!=KErrNone)
 		Error(_L("Att 41"),c);
-	if ((c=gFile.Open(TheFs,gNameOut,EFileStream|EFileWrite))!=KErrAccessDenied)
+	if ((c=gFile.Open(TheFs,gNameOut,EFileStream|P_FUPDATE))!=AccessErr)
 		Error(_L("Open 41"),c);
 	if ((c=gFile.Open(TheFs,gNameOut,EFileStream))!=KErrNone)
 		Error(_L("Open 42"),c);
-	if ((c=gFileErr.Open(TheFs,gNameOut,EFileStream))!=KErrInUse)
+	if ((c=gFileErr.Open(TheFs,gNameOut,EFileStream))!=LockedErr)
 		Error(_L("Open 43"),c);
-	if ((c=TheFs.Rename(_L("TEST1.TMP"),gNameOut))!=KErrAlreadyExists)
+	if ((c=TheFs.Rename(_L("TEST1.TMP"),gNameOut))!=ExistsErr)
 		Error(_L("Rename 43.1"),c);
-	if ((c=gFileErr.Create(TheFs,gNameOut,EFileStream))!=KErrAlreadyExists) // KErrInUse)
+	if ((c=gFileErr.Create(TheFs,gNameOut,EFileStream))!=ExistsErr) // LockedErr)
 		Error(_L("Open 44"),c);
-	if ((c=gFileErr.Replace(TheFs,gNameOut,EFileStream))!=KErrInUse)
+	if ((c=gFileErr.Replace(TheFs,gNameOut,EFileStream))!=LockedErr)
 		Error(_L("Open 45"),c);
 	gFile.Close();
-	if ((c=gFile.Create(TheFs,gNameOut,EFileStream))!=KErrAlreadyExists)
+	if ((c=gFile.Create(TheFs,gNameOut,EFileStream))!=ExistsErr)
 		Error(_L("Create 46"),c);
-	if ((c=gFile.Replace(TheFs,gNameOut,EFileStream))!=KErrAccessDenied)
+	if ((c=gFile.Replace(TheFs,gNameOut,EFileStream))!=AccessErr)
 		Error(_L("Replace 47"),c);
 	if ((c=gFile.Create(TheFs,_L("FILE1.TMP"),EFileStream))!=KErrNone)
 		Error(_L("Create 48"),c);
-	if ((c=TheFs.Rename(_L("FILE1.TMP"),_L("FILE2.TMP")))!=KErrInUse)
+	if ((c=TheFs.Rename(_L("FILE1.TMP"),_L("FILE2.TMP")))!=LockedErr)
 		Error(_L("Rename 49"),c);
 	gFile.Close();
 	if ((c=TheFs.Rename(_L("FILE1.TMP"),_L("FILE2.TMP")))!=KErrNone)
 		Error(_L("Rename 50"),c);
-	if ((c=TheFs.Rename(_L("FILE2.TMP"),gNameOut))!=KErrAlreadyExists)
+	if ((c=TheFs.Rename(_L("FILE2.TMP"),gNameOut))!=ExistsErr)
 		Error(_L("Rename 51"),c);
-	if ((c=TheFs.Delete(gNameOut))!=KErrAccessDenied)
+	if ((c=TheFs.Delete(gNameOut))!=AccessErr)
 		Error(_L("Delete"),c);
 	mask=KEntryAttReadOnly;
 	attrib=0;
@@ -1200,13 +1224,13 @@
 	if ((c=gFile.Open(TheFs,_L("B_GEN.001"),EFileStream))!=KErrNone)
 		Error(_L("Open 30"),c);
 	pos=1L;
-	if ((c=gFile.SetSize(pos))!=KErrAccessDenied)
+	if ((c=gFile.SetSize(pos))!=ReadOnlyErr)
 		Error(_L("Set EOF 30"),c);
 	if ((c=TheFs.Entry(_L("B_GEN.001"),gFileEntry))!=KErrNone)
 		Error(_L("File info 30"),c);
 	if (gFileEntry.iSize!=0L)
 		Error(_L("Size check 30"),0);
-	if ((c=gFile.Write(gDataBuf,1))!=KErrAccessDenied)
+	if ((c=gFile.Write(gDataBuf,1))!=ReadOnlyErr)
 		Error(_L("Write 30"),c);
 	if ((c=TheFs.Entry(_L("B_GEN.001"),gFileEntry))!=KErrNone)
 		Error(_L("File info 31"),c);
@@ -1223,55 +1247,28 @@
 
 	test.Printf(_L("Test dir entries are written out\n"));
 	gNameBuf.SetLength(0);
-	
-    if ((c=gFile.Temp(TheFs,gNameBuf,gNameOut,EFileStream))!=KErrNone)
+	if ((c=gFile.Temp(TheFs,gNameBuf,gNameOut,EFileStream|P_FRANDOM))!=KErrNone)
 		Error(_L("Open 20"),c); 
-	
 	if ((c=TheFs.Entry(gNameOut,gFileEntry))!=KErrNone)
 		Error(_L("File info 0"),c);
-	
-    if ((gFileEntry.iAtt & KEntryAttArchive)==0)
+	if ((gFileEntry.iAtt & P_FAMOD)==0)
 		Error(_L("Status 20"),0);
-	
 	test.Printf(_L("Size=%u\n"),gFileEntry.iSize);
-	
 	if (gFileEntry.iSize!=0L)
 		Error(_L("Size check 0"),0);
-	
 	saveTime=gFileEntry.iModified;
 	test.Printf(_L("Wait 3 seconds...\n"));
 	User::After(3000000L);
 	gDataBuf.SetLength(1);
-	
 	if ((c=gFile.Write(gDataBuf,1))!=KErrNone)
 		Error(_L("Write 1"),c);
-	
-         /* === pay attention to the code below if the "not updating file timestamp on Flush" mode is enabled (at least on FAT)
-         //-- the timestamp in the "real" entry on the media (RFs::Entry()) and what we get by RFile::Modified()
-         //-- can differ even after flushing file. The timestamp will be updated only on _closing_ the file.
-         //-- This behaviour can be an optimisation to reduce number of media writes due to updating file timestamps.
-         gFile.Close();
-         nRes = gFile.Open(TheFs, gNameOut, EFileWrite);
-         test_KErrNone(nRes);
-         //-- restore the expected position in the file
-         TInt pos1 = 0;
-         nRes = gFile.Seek(ESeekEnd, pos1);
-         test_KErrNone(nRes);
-         //------------------------------------ 
-         */
-
-
 	if ((c=TheFs.Entry(gNameOut,gFileEntry))!=KErrNone)
 		Error(_L("File info 1"),c);
-	
 	test.Printf(_L("Size=%u\n"),gFileEntry.iSize);
 	if (gFileEntry.iSize!=1L)
 		Error(_L("Size check 1"),0);
-	
 	if (gFileEntry.iModified==saveTime)
 		Error(_L("Time update"),0);
-
-
 	gDataBuf.SetLength(16384);
 	if ((c=gFile.Write(gDataBuf,16384))!=KErrNone)
 		Error(_L("Write 2"),c);
@@ -1281,7 +1278,7 @@
 	if (gFileEntry.iSize!=16385L)
 		Error(_L("Size check 2"),0);
 	pos=0L;
-	if ((c=gFile.Seek((TSeek)ESeekStart,pos))!=KErrNone)
+	if ((c=gFile.Seek((TSeek)P_FABS,pos))!=KErrNone)
 		Error(_L("Seek 0"),c);
 	if ((c=gFile.Write(gDataBuf,1))!=KErrNone)
 		Error(_L("Write 3"),c);
@@ -1291,7 +1288,7 @@
 	if (gFileEntry.iSize!=16385L)
 		Error(_L("Size check 3"),0);
 	pos=0L;
-	if ((c=gFile.Seek((TSeek)ESeekStart,pos))!=KErrNone)
+	if ((c=gFile.Seek((TSeek)P_FABS,pos))!=KErrNone)
 		Error(_L("Seek 1"),c);
 	if ((c=gFile.Write(gDataBuf,16384))!=KErrNone)
 		Error(_L("Write 4"),c);
@@ -1333,46 +1330,46 @@
 		Error(_L("File info 8"),c);
 	if (gFileEntry.iSize!=0L)
 		Error(_L("Size check 7"),0);
-	mask=KEntryAttArchive;
+	mask=P_FAMOD;
 	attrib=0;
 	if ((c=TheFs.SetAtt(gNameOut,attrib,mask))!=KErrNone)
 		Error(_L("Att 20"),c);
 
 //
-	if ((c=gFile.Open(TheFs,gNameOut,EFileStream|EFileWrite))!=KErrNone)
+	if ((c=gFile.Open(TheFs,gNameOut,EFileStream|P_FUPDATE|P_FRANDOM))!=KErrNone)
 		Error(_L("Open 21"),c);
 	if ((c=TheFs.Entry(gNameOut,gFileEntry))!=KErrNone)
 		Error(_L("File info 9"),c);
-	if (gFileEntry.iAtt & KEntryAttArchive)
+	if (gFileEntry.iAtt & P_FAMOD)
 		Error(_L("Status 21"),0);
 	if ((c=gFile.Write(gDataBuf,0))!=KErrNone)
 		Error(_L("Write 21"),c);
 	if ((c=TheFs.Entry(gNameOut,gFileEntry))!=KErrNone)
 		Error(_L("File info 9"),c);
-	if ((gFileEntry.iAtt & KEntryAttArchive))       // write 0 should not modify //
+	if ((gFileEntry.iAtt & P_FAMOD))       // write 0 should not modify //
 		Error(_L("Status 22"),0);
 	gFile.Close();
-	mask=KEntryAttArchive;
+	mask=P_FAMOD;
 	attrib=0;
 	if ((c=TheFs.SetAtt(gNameOut,attrib,mask))!=KErrNone)
 		Error(_L("Att 20"),c);
-	if ((c=gFile.Open(TheFs,gNameOut,EFileStream|EFileWrite))!=KErrNone)
+	if ((c=gFile.Open(TheFs,gNameOut,EFileStream|P_FUPDATE|P_FRANDOM))!=KErrNone)
 		Error(_L("Open 22"),c);
 	if ((c=TheFs.Entry(gNameOut,gFileEntry))!=KErrNone)
 		Error(_L("File info 9"),c);
-	if (gFileEntry.iAtt & KEntryAttArchive)
+	if (gFileEntry.iAtt & P_FAMOD)
 		Error(_L("Status 23"),0);
 	pos=0L;
 	if ((c=gFile.SetSize(pos))!=KErrNone)        // no change //
 		Error(_L("Set EOF 21"),c);
 	if ((c=TheFs.Entry(gNameOut,gFileEntry))!=KErrNone)
 		Error(_L("File info 9"),c);
-	if ((gFileEntry.iAtt & KEntryAttArchive))
+	if ((gFileEntry.iAtt & P_FAMOD))
 		Error(_L("Status 24"),0);
 	gFile.Close();
 	if ((c=TheFs.Entry(gNameOut,gFileEntry))!=KErrNone)
 		Error(_L("File info 0"),c);
-	if ((c=gFile.Open(TheFs,gNameOut,EFileStream|EFileWrite))!=KErrNone)
+	if ((c=gFile.Open(TheFs,gNameOut,EFileStream|P_FUPDATE|P_FRANDOM))!=KErrNone)
 		Error(_L("Open 23"),c);
 	saveTime=gFileEntry.iModified;
 	test.Printf(_L("Wait 3 seconds...\n"));
@@ -1386,7 +1383,7 @@
 		Error(_L("File info 61"),c);
 	if (gFileEntry.iModified!=saveTime)
 		Error(_L("Close new time"),0);
-	if ((c=gFile.Open(TheFs,gNameOut,EFileStream|EFileWrite))!=KErrNone)
+	if ((c=gFile.Open(TheFs,gNameOut,EFileStream|P_FUPDATE|P_FRANDOM))!=KErrNone)
 		Error(_L("Open 24"),c);
 	if ((c=gFile.Write(gDataBuf,1))!=KErrNone)
 		Error(_L("Write 60"),c);
@@ -1415,7 +1412,7 @@
 	if ((c=gFile.Open(TheFs,gNameOut,EFileStream))!=KErrNone)
 		Error(_L("Open 10"),c); // Temp file is created as writable. 
 	TTime fileTime(0);
-	if ((c=gFile.SetModified(fileTime))!=KErrAccessDenied) // KErrInUse)
+	if ((c=gFile.SetModified(fileTime))!=AccessErr) // LockedErr)
 		Error(_L("Set file date 10"),c);
 	gFile.Close();
 
@@ -1451,15 +1448,15 @@
 	gNameOut.SetLength(0);
 	if ((c=gFile.Temp(TheFs,gNameBuf,gNameOut,EFileStream))!=KErrNone)
 		Error(_L("Open 1"),c);
-	if ((c=gFormat.Open(TheFs,fBuf,EFullFormat,count))!=KErrInUse)
+	if ((c=gFormat.Open(TheFs,fBuf,EFullFormat,count))!=LockedErr)
 		Error(_L("Format lock check 1"),c);
-	if ((c=gFormat.Open(TheFs,fBuf,EQuickFormat,count))!=KErrInUse)
+	if ((c=gFormat.Open(TheFs,fBuf,EQuickFormat,count))!=LockedErr)
 		Error(_L("Format lock check 2"),c);
 	gFile.Close();
 
 	if ((c=gFormat.Open(TheFs,fBuf,EFullFormat,count))!=KErrNone)
 		{
-		if (c==KErrInUse || c==KErrAccessDenied)
+		if (c==LockedErr || c==AccessErr)
 			{
 			test.Printf(_L("Format: locked, no test\n"));
 			}
--- a/kerneltest/f32test/server/b_mtst.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/b_mtst.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -16,7 +16,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include "t_server.h"
@@ -53,20 +52,20 @@
     {
     test.Printf(_L("Opening: %S\n"),&nameBuf1);
     TInt r=file1.Open(TheFs,nameBuf1,EFileStream);
-	test_KErrNone(r);
+	test(r==KErrNone);
     test.Printf(_L("Opening: %S\n"),&nameBuf2);
 	r=file2.Open(TheFs,nameBuf2,EFileStream);
-	test_KErrNone(r);
+	test(r==KErrNone);
     test.Printf(_L("Checking test pattern...\n"));
 	for (TInt i=0 ; i<nTimes ; i++)
         {
         r=file1.Read(buf,len1);
-		test_KErrNone(r);
+		test(r==KErrNone);
         TInt j;
 		for (j=0 ; j< len1 ; j++)
             test(buf[j]==j);
         r=file2.Read(buf,len2);
-		test_KErrNone(r);
+		test(r==KErrNone);
         for (j=0 ; j< len2 ; j++)
             test(buf[j]=='A');
         }
@@ -92,34 +91,34 @@
         buf5.Append('D');       
 
     TInt r=file1.Create(TheFs,nameBuf1,EFileStream|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
     test.Printf(_L("Created: %S\n"),&nameBuf1);
     r=file2.Create(TheFs,nameBuf2,EFileStream|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
     test.Printf(_L("Created: %S\n"),&nameBuf2);
     r=file3.Create(TheFs,nameBuf3,EFileStream|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
     test.Printf(_L("Created: %S\n"),&nameBuf3);
     r=file4.Create(TheFs,nameBuf4,EFileStream|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
     test.Printf(_L("Created: %S\n"),&nameBuf4);
     r=file5.Create(TheFs,nameBuf5,EFileStream|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
     test.Printf(_L("Created: %S\n"),&nameBuf5);
     
     test.Next(_L("Writing test pattern..."));
     for (i=0 ; i<nTimes ; i++)
         {
         r=file1.Write(buf1,len1);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file2.Write(buf2,len2);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file3.Write(buf3,len3);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file4.Write(buf4,len4);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file5.Write(buf5,len5);
-		test_KErrNone(r);
+		test(r==KErrNone);
         }
     file1.Close();
 	file2.Close();
@@ -130,10 +129,10 @@
     test.Next(_L("Delete"));
     test.Printf(_L("Deleting: %S\n"),&nameBuf1);
     r=TheFs.Delete(nameBuf1);
-	test_KErrNone(r);
+	test(r==KErrNone);
     test.Printf(_L("Deleting: %S\n"),&nameBuf2);
 	r=TheFs.Delete(nameBuf2);
-	test_KErrNone(r);
+	test(r==KErrNone);
     
     file3.Close();
     file4.Close();
@@ -141,13 +140,13 @@
     
     test.Printf(_L("Deleting: %S\n"),&nameBuf3);
     r=TheFs.Delete(nameBuf3);
-	test_KErrNone(r);
+	test(r==KErrNone);
     test.Printf(_L("Deleting: %S\n"),&nameBuf4);
 	r=TheFs.Delete(nameBuf4);
-	test_KErrNone(r);
+	test(r==KErrNone);
     test.Printf(_L("Deleting: %S\n"),&nameBuf5);
 	r=TheFs.Delete(nameBuf5);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 //	test.Close();
     }
--- a/kerneltest/f32test/server/b_open.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/b_open.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -23,9 +23,6 @@
 #include <f32dbg.h>
 #include "t_server.h"
 #include "t_chlffs.h"
-#include "f32_test_utils.h"
-
-using namespace F32_Test_Utils;
 
 #ifdef __WINS__
 #define WIN32_LEAN_AND_MEAN
@@ -347,15 +344,15 @@
 // Call tests that may leave
 //
 	{
-    if (Is_SimulatedSystemDrive(TheFs, CurrentDrive()))
-        {
-		// These tests try to create a huge file to fill up the drive.
-		// This fails on WINS with drives with > 1/2G free because
-		// RFile::SetSize() (among other things) only takes a TInt.
-		test.Printf(_L("Skipping B_OPEN on PlatSim/Emulator drive %C:\n"), gSessionPath[0]);
+
+#ifdef __WINS__
+// These tests try to create a huge file to fill up the drive.
+// This fails on WINS with drives with > 1/2G free because
+// RFile::SetSize() (among other things) only takes a TInt.
+//
+	if (gSessionPath.Left(1).CompareF(_L("C")) == 0)
 		return;
-        }
-
+#endif
 	CreateTestDirectory(_L("\\B_OPEN\\"));
 	InitTest();
 	testOpenFiles();
--- a/kerneltest/f32test/server/b_osfil.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/b_osfil.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include "t_server.h"
@@ -48,18 +47,18 @@
 	{
 	TEntry entry;
 	TInt r=TheFs.Entry(noDevice,entry);
-	test_Value(r, (r == KErrNotReady)||(r==KErrPathNotFound));
+	test((r==KErrNotReady)||(r==KErrPathNotFound));
 	r=TheFs.Entry(noDirectory,entry);
-	test_Value(r, r == KErrPathNotFound);
+	test(r==KErrPathNotFound);
 	r=TheFs.Entry(noFile,entry);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=TheFs.Entry(existsFile,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iSize==KSizeExistsFile);
 	test(!entry.IsDir());
 	test(!(entry.iAtt&KEntryAttDir));
 	r=TheFs.Entry(existsFile2,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iSize==KSizeExistsFile2);
 	test(!entry.IsDir());
 	test(!(entry.iAtt&KEntryAttDir));
@@ -71,20 +70,20 @@
 */
 	{
 	TInt r=TheFs.Delete(noDevice);
-	test_Value(r, (r == KErrNotReady)||(r==KErrPathNotFound));
+	test((r==KErrNotReady)||(r==KErrPathNotFound));
 	r=TheFs.Delete(noDirectory);
-	test_Value(r, r == KErrPathNotFound);
+	test(r==KErrPathNotFound);
 	r=TheFs.Delete(noFile);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=TheFs.Delete(existsFile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(existsFile2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TEntry entry;
 	r=TheFs.Entry(existsFile,entry);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=TheFs.Entry(existsFile2,entry);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	}
 
 LOCAL_C void TestRename()
@@ -93,50 +92,50 @@
 */
 	{
 	TInt r=TheFs.Rename(noDevice,fileName);
-	test_Value(r, r == KErrArgument);
+	test(r==KErrArgument);
 	r=TheFs.Rename(noDirectory,fileName);
-	test_Value(r, r == KErrPathNotFound);
+	test(r==KErrPathNotFound);
 	r=TheFs.Rename(noFile,fileName);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=TheFs.Rename(existsFile,existsFile2);
-	test_Value(r, r == KErrAlreadyExists);
+	test(r==KErrAlreadyExists);
 	r=TheFs.Delete(existsFile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Rename(existsFile,existsFile);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=TheFs.Rename(existsFile2,existsFile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TEntry entry;
 	r=TheFs.Entry(existsFile2,entry);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=TheFs.Entry(existsFile,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(existsFile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 LOCAL_C void TestMkDir()
 	{
 	TParse fparse;
 	TInt r=TheFs.MkDirAll(directoryFile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TEntry entry;
 	r=TheFs.Entry(directoryFile.Left(directoryFile.Length()-1),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.IsDir());
 	test(entry.iAtt&KEntryAttDir);
 	r=TheFs.RmDir(directoryFile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fparse.Set(directoryFile,NULL,NULL);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fparse.PopDir();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(fparse.DriveAndPath());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fparse.PopDir();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(fparse.DriveAndPath());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 
@@ -149,108 +148,108 @@
 	RFile p2;
 
 	TInt r=p1.Open(TheFs,noDevice,EFileStreamText);
-	test_Value(r, (r == KErrNotReady)||(r==KErrPathNotFound));
+	test((r==KErrNotReady)||(r==KErrPathNotFound));
 	r=p1.Open(TheFs,noDirectory,EFileStreamText);
-	test_Value(r, r == KErrPathNotFound);
+	test(r==KErrPathNotFound);
 	TFileName generated1;
 	r=p1.Temp(TheFs,noDevicePath,generated1,EFileStreamText);
-	test_Value(r, (r == KErrNotReady)||(r==KErrPathNotFound));
+	test((r==KErrNotReady)||(r==KErrPathNotFound));
 	r=p1.Temp(TheFs,noDirectoryPath,generated1,EFileStreamText);
-	test_Value(r, r == KErrPathNotFound);
+	test(r==KErrPathNotFound);
 
 	r=p1.Temp(TheFs,_L(""),generated1,EFileStreamText);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TFileName generated2;
 	r=p2.Temp(TheFs,_L(""),generated2,EFileStreamText);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(generated1!=generated2);
 	p1.Close();
 	TFileName generated3;
 	r=p1.Temp(TheFs,_L(""),generated3,EFileStream);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(generated3!=generated2);
 	test(generated3!=generated1);
 	p2.Close();
 	p1.Close();
 
 	r=TheFs.Delete(generated1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(generated2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(generated3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=p1.Temp(TheFs,_L(""),generated1,EFileStreamText);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=p2.Temp(TheFs,_L(""),generated2,EFileStreamText);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(generated1!=generated2);
 	p1.Close();
 	r=p1.Temp(TheFs,_L(""),generated3,EFileStream);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(generated3!=generated2);
 	test(generated3!=generated1);
 	p2.Close();
 	p1.Close();
 
 	r=TheFs.Delete(generated1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(generated2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(generated3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.MkDir(openUniqueDir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=p1.Temp(TheFs,openUniqueDir,generated1,EFileStream);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=p2.Temp(TheFs,openUniqueDir,generated2,EFileStreamText|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=p1.Write(_L8("junk"),4);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt pos=0;
 	r=p1.Seek(ESeekCurrent,pos);//P_FSET
-	test_KErrNone(r);
+	test(r==KErrNone);
 	p1.Close();
 	p2.Close();
 	
 	r=TheFs.Delete(generated1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(generated2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=p1.Temp(TheFs,openUniqueDir,generated1,EFileStream);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=p2.Temp(TheFs,openUniqueDir,generated2,EFileStreamText);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	p1.Close();
 
 	pos=0;
 	r=p2.Seek(ESeekStart,pos);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	p2.Close();
 	r=TheFs.Delete(generated1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(generated2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(openUniqueDir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 LOCAL_C void TestPaths()
 	{
 	TFileName path1;
 	TInt r=TheFs.SessionPath(path1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetSessionPath(path1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TFileName path2;
 	r=TheFs.SessionPath(path2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(path1==path2);
 	RDir dir;
 	r=dir.Open(TheFs,path1,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	}
 
@@ -258,7 +257,7 @@
 	{
 	TEntry blk;
 	TInt r=TheFs.Entry(existsFile,blk);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TEntry blk1=blk;
 
 /* Toggle the write attribute */
@@ -274,9 +273,9 @@
 		set=KEntryAttReadOnly;
 		}
 	r=TheFs.SetEntry(existsFile,blk1.iModified,set,clear);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(existsFile,blk);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	if (blk1.IsReadOnly())
 		test(!blk.IsReadOnly());
 	else
@@ -284,9 +283,9 @@
 
 /* set write attrib back */
 	r=TheFs.SetEntry(existsFile,blk1.iModified,clear,set);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(existsFile,blk);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	if (blk1.IsReadOnly())
 		test(blk.IsReadOnly());
 	else
@@ -304,18 +303,18 @@
 		set=KEntryAttArchive;
 		}
 	r=TheFs.SetEntry(existsFile,blk1.iModified,set,clear);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(existsFile,blk);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	if (blk1.IsArchive())
 		test(!blk.IsArchive());
 	else
 		test(blk.IsArchive());
 /* set archive attrib back */
 	r=TheFs.SetEntry(existsFile,blk1.iModified,clear,set);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(existsFile,blk);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	if (blk1.IsArchive())
 		test(blk.IsArchive());
 	else
@@ -333,18 +332,18 @@
 		set=KEntryAttHidden;
 		}
 	r=TheFs.SetEntry(existsFile,blk1.iModified,set,clear);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(existsFile,blk);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	if (blk1.IsHidden())
 		test(!blk.IsHidden());
 	else
 		test(blk.IsHidden());
 /* set hidden attrib back */
 	r=TheFs.SetEntry(existsFile,blk1.iModified,clear,set);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(existsFile,blk);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	if (blk1.IsHidden())
 		test(blk.IsHidden());
 	else
@@ -362,26 +361,26 @@
 		set=KEntryAttSystem;
 		}
 	r=TheFs.SetEntry(existsFile,blk1.iModified,set,clear);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(existsFile,blk);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	if (blk1.IsSystem())
 		test(!blk.IsSystem());
 	else
 		test(blk.IsSystem());
 /* set system attrib back */
 	r=TheFs.SetEntry(existsFile,blk1.iModified,clear,set);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(existsFile,blk);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	if (blk1.IsSystem())
 		test(blk.IsSystem());
 	else
 		test(!blk.IsSystem());
 	r=TheFs.Delete(existsFile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(existsFile2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 
@@ -389,15 +388,15 @@
 	{
 	RFile fcb;
 	TInt r=fcb.Replace(TheFs,existsFile,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fcb.Write(_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),KSizeExistsFile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fcb.Close();
 
 	r=fcb.Replace(TheFs,existsFile2,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fcb.Write(_L8("bcdefghijklmnopqrstuvwxyz"),KSizeExistsFile2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fcb.Close();
 	}
 
@@ -410,7 +409,7 @@
 
 	TVolumeInfo di;
 	TInt r=TheFs.Volume(di);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Start(_L("Info()"));
 	CreateTestFiles();
 	TestInfo();
--- a/kerneltest/f32test/server/b_rand.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/b_rand.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32math.h>
 #include <e32test.h>
--- a/kerneltest/f32test/server/b_rep.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/b_rep.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include "t_server.h"
@@ -43,43 +42,43 @@
 
         // Replace file and write data
 		r=TheFile.Replace(TheFs,nameBuf1,EFileStream);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFile.Write(testPat1);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		
 		Mem::Copy(&buf[0],&numb,sizeof(TInt));
 		r=TheFile.Write(buf);
-		test_KErrNone(r);
+		test(r==KErrNone);
 
         // Seek to 0 and check data
 		TInt pos=0; 
 		r=TheFile.Seek(ESeekStart,pos);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(pos==0);
 		r=TheFile.Read(chkPat1,len);
-        test_KErrNone(r);
+        test(r==KErrNone);
         test(chkPat1==testPat1);
 		r=TheFile.Read(testBuf,sizeof(TInt));
-        test_KErrNone(r);
+        test(r==KErrNone);
 		TInt chkNumb=*((TInt*)testBuf.Ptr());
         test(chkNumb==numb);
 
         // Close, then re-open file and check data
 		TheFile.Close();
 		r=TheFile.Open(TheFs,nameBuf1,EFileStream);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFile.Read(chkPat1,len);
-        test_KErrNone(r);
+        test(r==KErrNone);
         test(chkPat1==testPat1);
 		r=TheFile.Read(testBuf,sizeof(TInt));
-        test_KErrNone(r);
+        test(r==KErrNone);
 		chkNumb=*((TInt*)testBuf.Ptr());
         test(chkNumb==numb);
 		TheFile.Close();
 		}
 	test.Printf(_L("\n"));
 	r=TheFs.Delete(nameBuf1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 GLDEF_C void CallTestsL(void)
@@ -102,9 +101,9 @@
 	test.Next(_L("Subdirectory"));
 	gSessionPath=_L("\\F32-TST\\TEST1\\");
 	TInt r=TheFs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.MkDirAll(gSessionPath);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 
 	DoTest();
 
--- a/kerneltest/f32test/server/clean_prepdc.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/clean_prepdc.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -18,7 +18,6 @@
 //
 
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32std.h>
@@ -57,11 +56,11 @@
 	{
 	CFileMan* fMan=CFileMan::NewL(TheFs);
 	TInt r=fMan->RmDir(_L("\\Resource\\"));
-	test_Value(r, r == KErrNone || r==KErrPathNotFound);
+	test(r==KErrNone || r==KErrPathNotFound);
 	r=fMan->RmDir(_L("\\Sys\\"));
-	test_Value(r, r == KErrNone || r==KErrPathNotFound);
+	test(r==KErrNone || r==KErrPathNotFound);
 	r=fMan->RmDir(_L("\\Private\\"));
-	test_Value(r, r == KErrNone || r==KErrPathNotFound);
+	test(r==KErrNone || r==KErrPathNotFound);
 	delete fMan;
 	}
 
@@ -71,12 +70,12 @@
 //
 	{
 	TInt r=TheFs.MkDir(_L("\\Resource\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.MkDir(_L("\\Sys\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RFile f;
 	r=f.Create(TheFs,_L("\\Resource\\resourcefile.txt"),EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	f.Close();
 	}	
 
@@ -87,7 +86,7 @@
 	{
 	TBuf<30> tmp;
 	TInt r= TheFs.SessionPath(tmp);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RDebug::Print(_L("sessp=%S"),&tmp);
 	CleanupL();
 	TestSetup();
--- a/kerneltest/f32test/server/t_alert.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_alert.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32math.h>
@@ -164,7 +163,7 @@
 	
 	RThread clientThread;
 	TInt r=clientThread.Create(_L("TALERT_Thread0"),FileAccess,0x4000,KHeapSize,KHeapSize,(TAny*)&gPathThread0,EOwnerThread);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	clientThread.Resume();
 	clientThread.Close();
 	}
@@ -177,7 +176,7 @@
 	
 	RThread clientThread;
 	TInt r=clientThread.Create(_L("TALERT_Thread1"),FileAccess,0x4000,KHeapSize,KHeapSize,(TAny*)&gPathThread1,EOwnerThread);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	clientThread.Resume();
 	clientThread.Close();
 	}
@@ -190,7 +189,7 @@
 	
 	RThread clientThread;
 	TInt r=clientThread.Create(_L("TALERT_Thread2"),FileAccess,0x4000,KHeapSize,KHeapSize,(TAny*)&gPathThread2,EOwnerThread);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	clientThread.Resume();
 	clientThread.Close();
 	}
@@ -248,7 +247,7 @@
 	
 	RThread clientThread;
 	TInt r=clientThread.Create(_L("TALERT_Thread3"),NotifyAccess,0x4000,KHeapSize,KHeapSize,NULL,EOwnerThread);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	clientThread.Resume();
 	clientThread.Close();
 	}
@@ -278,7 +277,7 @@
 	
 	RThread clientThread;
 	TInt r=clientThread.Create(_L("TALERT_Thread4"),MediaChange,0x4000,KHeapSize,KHeapSize,NULL,EOwnerThread);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	clientThread.SetPriority(EPriorityMore);
 	clientThread.Resume();
 	clientThread.Close();
@@ -325,7 +324,7 @@
 		t.Close();
 	}
 	else 
-		test_Value(r, r == KErrNotFound);
+		test(r==KErrNotFound);
 
 	r=t.Open(_L("TALERT_Thread1"),EOwnerThread);
 	if(r==KErrNone)
@@ -334,7 +333,7 @@
 		t.Close();
 	}
 	else 
-		test_Value(r, r == KErrNotFound);
+		test(r==KErrNotFound);
 
 	r=t.Open(_L("TALERT_Thread2"),EOwnerThread);
 	if(r==KErrNone)
@@ -343,7 +342,7 @@
 		t.Close();
 	}
 	else 
-		test_Value(r, r == KErrNotFound);
+		test(r==KErrNotFound);
 
 	r=t.Open(_L("TALERT_Thread3"),EOwnerThread);
 	if(r==KErrNone)
@@ -352,7 +351,7 @@
 		t.Close();
 	}
 	else 
-		test_Value(r, r == KErrNotFound);
+		test(r==KErrNotFound);
 	
 	r=t.Open(_L("TALERT_Thread4"),EOwnerThread);
 	if(r==KErrNone)
@@ -361,7 +360,7 @@
 		t.Close();
 	}
 	else 
-		test_Value(r, r == KErrNotFound);
+		test(r==KErrNotFound);
 	
 /*	TFindThread threadFinder(_L("TALERT_*"));
 	FOREVER
@@ -371,11 +370,11 @@
 		test.Printf(_L("r=%d"),r);
 		if (r==KErrNotFound)
 			break;
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test.Printf(_L("Killing Thread %S\n"),&threadName);
 		RThread t;
 		r=t.Open(threadName,EOwnerThread);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		t.Kill(KErrCancel);
 		t.Close();
 		} */
@@ -389,9 +388,9 @@
 	{
 	test.Next(_L("Create lots of threads and change notifiers"));
 	TInt r=TheFs.MkDirAll(gPathThread1);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	r=TheFs.MkDir(gPathThread2);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 
 	StartThread0(); // Read and write to D:
 	StartThread1(); // Read and write to C:
@@ -438,12 +437,12 @@
 
 	test.Next(_L("Create a hung server and kill the thread it is writing to"));
 	TInt r=TheFs.MkDir(gPathThread0);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	StartThread4(); // Generate media changes
 
 	RThread clientThread;
 	r=clientThread.Create(_L("TALERT_ThreadHangTest"),ThreadHangTest,0x4000,KHeapSize,KHeapSize,NULL,EOwnerThread);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TRequestStatus status;
 	clientThread.Logon(status);
 	clientThread.Resume();
@@ -477,7 +476,7 @@
 	r=TheFs.MkDir(gPathThread0); // Check fileserver ok
 	if(r!=KErrNone && r!=KErrAlreadyExists)
 		test.Printf(_L("r=%d"),r);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	
 	}		
 
@@ -514,7 +513,7 @@
 	FileMan=CFileMan::NewL(TheFs);
 	TInt r=FileMan->RmDir(_L("\\F32-TST\\TALERT\\"));
 	test.Printf(_L("r=%d"),r);
-	test_Value(r, r == KErrNone || r==KErrPathNotFound);
+	test(r==KErrNone || r==KErrPathNotFound);
 	delete FileMan;
 */
 	}
--- a/kerneltest/f32test/server/t_appins.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_appins.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <hal.h>
@@ -54,11 +53,11 @@
 	path=_L("?:\\F32-TST\\T_APPINS\\");
 		
 	TInt r=TheNotifyFs.SessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TChar driveChar;
 	r=RFs::DriveToChar(RemovableDrive,driveChar);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	if (gSessionPath[0]=='C')
 		(gSessionPath[0] == (TText)gDriveToTest)? (path[0] = (TText)driveChar):(path[0] = (TText)gDriveToTest);
@@ -77,7 +76,7 @@
 	TRequestStatus statWilder(KRequestPending);
 
 	r=TheFs.RmDir(path);
-	test_Value(r, (r == KErrNone)||(r==KErrNotFound)||(r==KErrPathNotFound));
+	test((r==KErrNone)||(r==KErrNotFound)||(r==KErrPathNotFound));
 
 	test.Printf(_L("Notify Session Path %S\n"),&gSessionPath);
 
@@ -90,7 +89,7 @@
 	TheNotifyFs.NotifyChange(ENotifyEntry,statWilder,_L("*:\\"));
 
 	r=TheFs.MkDir(path);	
-	test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+	test((r==KErrNone)||(r==KErrAlreadyExists));
 	User::WaitForAnyRequest();
 	test(statEntry==KErrNone);
 	test(statFile==KErrNone);
@@ -113,7 +112,7 @@
 	r=file.Replace(TheFs,filePath,EFileRead|EFileWrite);
 	file.Close();
 	User::WaitForAnyRequest();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test (statEntry==KErrNone);
 	test(statFile==KErrNone);
 	test(statDir==KRequestPending);
@@ -128,7 +127,7 @@
 	TheNotifyFs.NotifyChange(ENotifyEntry,statWilder,_L("*:\\"));
 	
 	r=TheFs.Delete(filePath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForAnyRequest();
 	test (statEntry==KErrNone);
 	test(statFile==KErrNone);
@@ -144,7 +143,7 @@
 	TheNotifyFs.NotifyChange(ENotifyFile,statWilder,_L("*:\\"));
 
 	r=TheFs.RmDir(path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForAnyRequest();
 	test (statEntry==KErrNone);
 	test(statFile==KRequestPending);
@@ -167,7 +166,7 @@
 		
 	TChar driveChar;
 	TInt err=RFs::DriveToChar(RemovableDrive,driveChar);
-	test_KErrNone(err);
+	test(err==KErrNone);
 
 	if (gSessionPath[0]=='C')
 		(gSessionPath[0] == (TText)gDriveToTest)? (sessionPath[0] = (TText)driveChar):(sessionPath[0] = (TText)gDriveToTest);
@@ -180,13 +179,13 @@
 		//return;
 	
 	TInt r=TheFs.SetSessionPath(sessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TFileName path;
 	path=_L("\\F32-TST\\T_APPINS\\");	//	Takes drive implicitly from associated session path
 						
 	r=TheFs.RmDir(path);
-	test_Value(r, (r == KErrNone)||(r==KErrNotFound)||(r==KErrPathNotFound));
+	test((r==KErrNone)||(r==KErrNotFound)||(r==KErrPathNotFound));
 	
 	TRequestStatus statEntry(KRequestPending);
 	TRequestStatus statFile(KRequestPending);
@@ -207,7 +206,7 @@
 	TheNotifyFs.NotifyChange(ENotifyAll,statWilder,_L("*:\\"));
 
 	r=TheFs.MkDir(path);										//	Creates the directory on the drive
-	test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));				//	associated with TheFs session path
+	test((r==KErrNone)||(r==KErrAlreadyExists));				//	associated with TheFs session path
 	test (statEntry==KRequestPending);
 	test(statFile==KRequestPending);
 	test(statDir==KRequestPending);	//	No notification because it's watching a different drive!
@@ -225,7 +224,7 @@
 	RFile file;
 	r=file.Replace(TheFs,filePath,EFileRead|EFileWrite);
 	file.Close();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test (statEntry==KRequestPending);	//	No notification!
 	test(statFile==KRequestPending);
@@ -238,7 +237,7 @@
 	TheNotifyFs.NotifyChange(ENotifyDir,statWilder,_L("*:\\"));
 
 	r=TheFs.Delete(filePath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 //	Still no notification	
 	test (statEntry==KRequestPending);
 	test(statFile==KRequestPending);
@@ -251,7 +250,7 @@
 	TheNotifyFs.NotifyChange(ENotifyDir,statWild,_L("?:\\F32-TST\\T_APPINS\\"));
 //	TheNotifyFs.NotifyChange(ENotifyDir,statWilder,_L("*:\\"));
 	r=TheFs.RmDir(path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 //	Still no notification	
 	test (statEntry==KRequestPending);
 	test(statFile==KRequestPending);
@@ -272,7 +271,7 @@
 	TFileName path;
 	path=_L("\\F32-TST\\T_APPINS\\");
 	TInt r=TheFs.RmDir(path);
-	test_Value(r, (r == KErrNone)||(r==KErrNotFound)||(r==KErrPathNotFound));
+	test((r==KErrNone)||(r==KErrNotFound)||(r==KErrPathNotFound));
 	
 	TRequestStatus statEntry(KRequestPending);
 	TRequestStatus statFile(KRequestPending);
@@ -284,7 +283,7 @@
 //	Set the session path of the session	which creates the file/directory to be
 //	the same as the notification session's session path
 	r=TheFs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 //	Submit notify change requests (requesting ahead)
 	test.Printf(_L("Create a directory %S\n"),&path);
@@ -295,7 +294,7 @@
 	TheNotifyFs.NotifyChange(ENotifyEntry,statWilder,_L("*:\\"));
 
 	r=TheFs.MkDir(path);	
-	test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+	test((r==KErrNone)||(r==KErrAlreadyExists));
 	User::WaitForAnyRequest();
 	test (statEntry==KErrNone);
 	test(statFile==KErrNone);
@@ -319,7 +318,7 @@
 	r=file.Replace(TheFs,filePath,EFileRead|EFileWrite);
 	file.Close();
 	User::WaitForAnyRequest();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test (statEntry==KErrNone);
 	test(statFile==KErrNone);
 	test(statDir==KRequestPending);	
@@ -334,7 +333,7 @@
 	TheNotifyFs.NotifyChange(ENotifyEntry,statWilder,_L("*:\\"));
 
 	r=TheFs.Delete(filePath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForAnyRequest();
 	test (statEntry==KErrNone);
 	test(statFile==KErrNone);
@@ -350,7 +349,7 @@
 	TheNotifyFs.NotifyChange(ENotifyEntry,statWilder,_L("*:\\"));
 
 	r=TheFs.RmDir(path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForAnyRequest();
 	test (statEntry==KErrNone);
 	test(statFile==KRequestPending);
@@ -375,7 +374,7 @@
 	
 	TChar driveChar;
 	TInt r=RFs::DriveToChar(RemovableDrive,driveChar);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	if (gDriveToTest =='C')
 		pathBuf[0]=driveChar;
@@ -384,21 +383,21 @@
 	
 	path = pathBuf;
 	r=TheFs.RmDir(path);
-	test_Value(r, (r == KErrNone)||(r==KErrNotFound)||(r==KErrPathNotFound));
+	test((r==KErrNone)||(r==KErrNotFound)||(r==KErrPathNotFound));
 		
 	TInt result;
 	result=TheFs.MkDir(_L("C:\\SILLY\\"));
-	test_Value(result, (result == KErrNone)||(result==KErrAlreadyExists));
+	test((result==KErrNone)||(result==KErrAlreadyExists));
 	result=TheFs.MkDir(_L("C:\\SILLY\\SILLIER\\"));
-	test_Value(result, (result == KErrNone)||(result==KErrAlreadyExists));
+	test((result==KErrNone)||(result==KErrAlreadyExists));
 	result=TheFs.MkDir(_L("C:\\SILLY\\SILLIER\\SILLIEST\\"));
-	test_Value(result, (result == KErrNone)||(result==KErrAlreadyExists));
+	test((result==KErrNone)||(result==KErrAlreadyExists));
 
 	result=TheNotifyFs.SetSessionPath(_L("C:\\SILLY\\SILLIER\\SILLIEST\\"));
-	test_KErrNone(result);
+	test(result==KErrNone);
 	
 	result=TheNotifyFs.SessionPath(gSessionPath);
-	test_KErrNone(result);
+	test(result==KErrNone);
 	test.Printf(_L("Session Path %S\n"),&gSessionPath);
 
 	TRequestStatus statEntry(KRequestPending);
@@ -412,7 +411,7 @@
 	TheNotifyFs.NotifyChange(ENotifyDir,statDir,path);
 
 	r=TheFs.MkDir(path);	
-	test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+	test((r==KErrNone)||(r==KErrAlreadyExists));
 	User::WaitForAnyRequest();
 	test (statEntry==KErrNone);
 	test(statFile==KErrNone);
@@ -431,7 +430,7 @@
 	r=file.Replace(TheFs,filePath,EFileRead|EFileWrite);
 	file.Close();
 	User::WaitForAnyRequest();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test (statEntry==KErrNone);
 	test(statFile==KErrNone);
 	test(statDir==KRequestPending);
@@ -442,7 +441,7 @@
 	TheNotifyFs.NotifyChange(ENotifyFile,statFile,path);
 	
 	r=TheFs.Delete(filePath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForAnyRequest();
 	test (statEntry==KErrNone);
 	test(statFile==KErrNone);
@@ -453,18 +452,18 @@
 	TheNotifyFs.NotifyChange(ENotifyEntry,statEntry,path);
 	TheNotifyFs.NotifyChange(ENotifyFile,statFile,path);
 	r=TheFs.RmDir(path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForAnyRequest();
 	test (statEntry==KErrNone);
 	test(statFile==KRequestPending);
 	test(statDir==KErrNone);
 
 	result=TheFs.RmDir(_L("C:\\SILLY\\SILLIER\\SILLIEST\\"));
-	test_Value(result, (result == KErrNone)||(result==KErrAlreadyExists));
+	test((result==KErrNone)||(result==KErrAlreadyExists));
 	result=TheFs.RmDir(_L("C:\\SILLY\\SILLIER\\"));
-	test_Value(result, (result == KErrNone)||(result==KErrAlreadyExists));
+	test((result==KErrNone)||(result==KErrAlreadyExists));
 	result=TheFs.RmDir(_L("C:\\SILLY\\"));
-	test_Value(result, (result == KErrNone)||(result==KErrAlreadyExists));	
+	test((result==KErrNone)||(result==KErrAlreadyExists));	
 	}
 
 #endif
@@ -499,7 +498,7 @@
 
 	test.Start(_L("Testing filesystem"));
 	TInt r=TheNotifyFs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TFileName sessionPath;
 	TInt uid;
 	test(HAL::Get(HAL::EMachineUid,uid)==KErrNone);
@@ -512,7 +511,7 @@
 #if !defined(__WINS__)
 //	MARM TESTS
 	r=TheFs.MkDir(_L("C:\\F32-TST\\"));
-	test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+	test((r==KErrNone)||(r==KErrAlreadyExists));
 
 	if(KErrNone == TheFs.DriveList(drvList))
 		{
@@ -544,7 +543,7 @@
 		}
 	
 	r=RFs::DriveToChar(RemovableDrive,driveChar);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	if(gDriveToTest == 'C')
 		dirBuf[0] = (TText)driveChar;
@@ -559,12 +558,12 @@
 		//test.Getch();
 		r=TheFs.MkDir(dirBuf);
 		}
-	test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));	
+	test((r==KErrNone)||(r==KErrAlreadyExists));	
 		
 //	Set the notification session path to the test directory on C drive
 	sessionPath=_L("C:\\F32-TST\\");
 	r=TheNotifyFs.SetSessionPath(sessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 //	Run tests
 	TRAP(r,DoTests());
 	if (r!=KErrNone)
@@ -580,9 +579,9 @@
 		
 
 	r=TheNotifyFs.SetSessionPath(sessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TRAP(r,DoTests());
 	if (r!=KErrNone)
 		test.Printf(_L("Error: %d\n"),r);
@@ -590,12 +589,12 @@
 	CheckDisk();
 #elif defined (__WINS__)
 	r=TheFs.MkDir(_L("X:\\F32-TST\\"));
-	test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+	test((r==KErrNone)||(r==KErrAlreadyExists));
 	r=TheFs.MkDir(_L("Y:\\F32-TST\\"));
-	test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+	test((r==KErrNone)||(r==KErrAlreadyExists));
 //	Set session path to test directory on Y drive
 	r=TheNotifyFs.SetSessionPath(_L("Y:\\F32-TST\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TRAP(r,DoTests());
 	if (r!=KErrNone)
 		test.Printf(_L("Error: %d\n"),r);
@@ -605,7 +604,7 @@
 	//we have no X drive on eka2 yet
 //	Set session path to test directory on X drive	
 //	r=TheNotifyFs.SetSessionPath(_L("X:\\F32-TST\\"));
-//	test_KErrNone(r);
+//	test(r==KErrNone);
 //	TRAP(r,DoTests());
 
 	if (r!=KErrNone)
--- a/kerneltest/f32test/server/t_bigfile.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_bigfile.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -34,7 +34,6 @@
 //
 
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32svr.h>
@@ -115,7 +114,6 @@
 
 MFileManObserver::TControl CFileManObserver::NotifyFileManStarted()
 	{
-    (void)MFileManObserver::NotifyFileManStarted();
 	TInt lastError = iFileMan->GetLastError();
 	TFileName fileName = iFileMan->CurrentEntry().iName;
 	test.Printf(_L("NotifyFileManStarted(): Error %d File %S\n"),lastError, &fileName);
@@ -124,7 +122,6 @@
 
 MFileManObserver::TControl CFileManObserver::NotifyFileManOperation()
 	{
-    (void)MFileManObserver::NotifyFileManOperation();
 	TInt lastError = iFileMan->GetLastError();
 	TFileName fileName = iFileMan->CurrentEntry().iName;
 	test.Printf(_L("NotifyFileManOperation(): Error %d File %S\n"),lastError, &fileName);
@@ -171,27 +168,27 @@
 	test.Next(_L("2GBMinusOne File: Open"));
 
 	r = f.Open(TheFs, fname, EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	testSize = K2GbMinusOne;
 	
 	test.Next(_L("2GBMinusOne File: Read"));
 
 	r=f.Size((TInt&) size);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(size == testSize);
 	
 	r = TheFs.Entry(fname, entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test ((TUint) entry.iSize == testSize);
 
 	// seek to just below 2GB
 	testPos = (K2GbMinusOne - K1Kb) & KPosMask;
 	r = f.Seek(ESeekStart, (TInt&) testPos);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r = f.Read(bufPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TUint posRead =  * ((TUint*) &bufPtr[0]);
 	test.Printf(_L("position read %08X, expected %08X\n"), posRead, testPos);
@@ -224,13 +221,13 @@
 
 	test.Next(_L("2GB File: Test the size with RFs::Entry"));
 	r = TheFs.Entry(fname, entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test ((TUint) entry.iSize == testSize);
 
 	test.Next(_L("2GB File: Attempt to open (should fail with KErrToBig)"));
 
 	r = f.Open(TheFs, fname, EFileRead);
-	test_Value(r, r == KErrTooBig);
+	test(r==KErrTooBig);
 	}
 
 //----------------------------------------------------------------------------------------------
@@ -257,13 +254,13 @@
 
 	test.Next(_L("3GB File: Test the size with RFs::Entry"));
 	r = TheFs.Entry(fname, entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test ((TUint) entry.iSize == testSize);
 
 	test.Next(_L("3GB File: Attempt to open (should fail with KErrToBig)"));
 
 	r = f.Open(TheFs, fname, EFileRead);
-	test_Value(r, r == KErrTooBig);
+	test(r==KErrTooBig);
 	}
 
 //----------------------------------------------------------------------------------------------
@@ -291,13 +288,13 @@
 	test.Next(_L("4GB File: Test the size with RFs::Entry"));
 	r = TheFs.Entry(fname, entry);
 	
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test ((TUint) entry.iSize == testSize);
 
 	test.Next(_L("4GB File: Attempt to open (should fail with KErrToBig)"));
 
 	r = f.Open(TheFs, fname, EFileRead);
-	test_Value(r, r == KErrTooBig);
+	test(r==KErrTooBig);
 	}
 
 //----------------------------------------------------------------------------------------------
@@ -327,27 +324,27 @@
 	test.Next(_L("2GBMinusOne File: Open"));
 
 	r = f.Open(TheFs, fname, EFileRead | EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	
 	test.Next(_L("2GBMinusOne File: Attempt to extend"));
 
 	r=f.Size((TInt&) size);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(size == testSize);
 	
 	r = TheFs.Entry(fname, entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test ((TUint) entry.iSize == testSize);
 
 	// seek to end
 	testPos = 0;
 	r = f.Seek(ESeekEnd, (TInt&) testPos);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	bufPtr.SetLength(1);
 	r = f.Write(bufPtr);
-	test_Value(r, r == KErrTooBig);
+	test(r==KErrTooBig);
 
 	f.Close();
 	}
@@ -368,7 +365,7 @@
 	test.Printf(_L("Deleting %S\n"), &aFileName);
 
 	TInt r = TheFs.Delete(aFileName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	CheckDisk();
 	}
@@ -391,11 +388,11 @@
 
 	RDir dir;
 	TInt r = dir.Open(TheFs, _L("*.*"), KEntryAttNormal);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	
 	TEntryArray entryArray;
 	r = dir.Read(entryArray);
-	test_Value(r, r == KErrEof);
+	test (r == KErrEof);
 
 	test(entryArray.Count() == gFilesInDirectory);
 
@@ -428,7 +425,7 @@
 	test.Next(_L("Read a directory containing large files using CDir & sort by size"));
 	CDir* dirList;
 	r=TheFs.GetDir(_L("*.*"), KEntryAttMaskSupported, ESortBySize, dirList);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(dirList->Count() == gFilesInDirectory);
 	for (n=0; n<dirList->Count(); n++)
 		{
@@ -486,16 +483,16 @@
 	TPath filePathNew =	_L("?:\\TEST\\");
 	TChar driveLetter;
 	TInt r=TheFs.DriveToChar(gDrive,driveLetter);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	filePathNew[0] = (TText) driveLetter;
 
 	// move to new directory
 	r = fileMan->Move(filePathOld, filePathNew, CFileMan::ERecurse | CFileMan::EOverWrite);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	// then move back again
 	r = fileMan->Move(filePathNew, filePathOld);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	delete fileMan;
 	}
@@ -525,7 +522,7 @@
 	TPath filePathNew =	_L("?:\\TEST\\");
 	TChar driveLetter;
 	TInt r = TheFs.DriveToChar(gDrive,driveLetter);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	filePathNew[0] = (TText) driveLetter;
 
 	// create some small files in the source directory 
@@ -535,47 +532,47 @@
 	_LIT(KFileSmall2, "FileSmallTwo.txt");
 	_LIT(KFileSmall3, "FileSmallThree.txt");
 	r = file.Create(TheFs, KFileSmall1(), EFileWrite | EFileShareAny);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = file.Write(_L8("1"));
-	test_KErrNone(r);
+	test(r == KErrNone);
 	file.Close();
 
 	r = file.Create(TheFs, KFileSmall2(), EFileWrite | EFileShareAny);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = file.Write(_L8("12"));
-	test_KErrNone(r);
+	test(r == KErrNone);
 	file.Close();
 
 	r = file.Create(TheFs, KFileSmall3(), EFileWrite | EFileShareAny);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = file.Write(_L8("123"));
-	test_KErrNone(r);
+	test(r == KErrNone);
 	file.Close();
 
 	// copy to new directory
 	r = fileMan->Copy(filePathOld, filePathNew, CFileMan::ERecurse | CFileMan::EOverWrite);
-	test_Value(r, r == KErrNone || r == KErrTooBig);
+	test(r == KErrNone || r == KErrTooBig);
 
 
 	// check SMALL files have been copied
 	RDir dir;
 	r = dir.Open(TheFs, filePathNew, KEntryAttNormal);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	TEntryArray entryArray;
 	r = dir.Read(entryArray);
-	test_Value(r, r == KErrEof);
+	test (r == KErrEof);
 	test(entryArray.Count() == 3);
 	dir.Close();
 	
 	// then delete the new directory
 	r = fileMan->Delete(filePathNew);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	
 	// attempt to copy to new directory again - this time with an observer
 	fileMan->SetObserver(observer);
 	r = fileMan->Copy(filePathOld, filePathNew, CFileMan::ERecurse | CFileMan::EOverWrite);
-	test_Value(r, r == KErrNone || r == KErrTooBig);
+	test(r == KErrNone || r == KErrTooBig);
 	
 	// test that 3 small files were copied and 1 or 2 large files failed to copy
 	// (For 8 GB disk, the 4GB file is missing)
@@ -584,15 +581,15 @@
 
 	// check SMALL files have been copied
 	r = dir.Open(TheFs, filePathNew, KEntryAttNormal);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	r = dir.Read(entryArray);
-	test_Value(r, r == KErrEof);
+	test (r == KErrEof);
 	test(entryArray.Count() == 3);
 	dir.Close();
 	
 	// then delete the new directory
 	r = fileMan->Delete(filePathNew);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	delete observer;
 	delete fileMan;
@@ -615,17 +612,17 @@
 
 	CDirScan* scanner = NULL;
 	TRAP(r, scanner = CDirScan::NewL(TheFs));
-	test_Value(r, r == KErrNone && scanner);
+	test(r == KErrNone && scanner);
 
 	TRAP(r, scanner->SetScanDataL(aName,KEntryAttDir,ESortByName|EAscending,aDirection));
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	CDir *entryList=NULL;
 	TInt filesFound = 0;
 	for (;;)
 		{
 		TRAP(r, scanner->NextL(entryList));
-		test_Value(r, r == aError);
+		test(r == aError);
 		if (entryList==NULL)
 			break;
 		TInt count = entryList->Count();
@@ -672,11 +669,11 @@
 	TInt r;
 
 	r = TheFs.CharToDrive(gDriveToTest, gDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 #ifdef __MOUNT_RAW_EXT__
 	r=TheFs.FileSystemName(gOldFsName, gDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	if (gOldFsName.CompareF(KFATName) != 0)
 		{
@@ -685,9 +682,9 @@
 		}
 
     r = TheFs.AddExtension(KExtName);
-    test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+    test(r==KErrNone || r==KErrAlreadyExists);
     r = TheFs.MountExtension(KExtName, gDrive);
-    test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+    test(r==KErrNone || r==KErrAlreadyExists);
 #endif
 
 	TVolumeInfo vi;
@@ -718,7 +715,7 @@
 		
 		test.Next(_L("Scan Drive"));
 		r = TheFs.ScanDrive(gSessionPath);
-		test_KErrNone(r);
+		test (r == KErrNone);
 
 		// NB the 4GB file will not be present unless the disk is > 8GB (because it doesn't fit)
 		if (!FilePresent(KFile4GBMinusOne()))
@@ -764,10 +761,10 @@
 
 #ifdef __MOUNT_RAW_EXT__
 	r = TheFs.DismountExtension(KExtName, gDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r = TheFs.RemoveExtension(KExtName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 #endif
 
--- a/kerneltest/f32test/server/t_blockmap.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_blockmap.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -33,7 +33,6 @@
 //! @SYMTestStatus          Implemented
 
 
-#define __E32TEST_EXTENSION__
 #include <e32test.h>
 #include <e32svr.h>
 #include <f32file.h>
@@ -81,12 +80,12 @@
 	r = fMan->Delete(name);
 
 	r = fMan->Copy(KTestFile, name);
-	test_KErrNone(r);
+	test( r == KErrNone );
 
 	TInt localDriveNum = 0;
 	RFile testFile;
 	r = testFile.Open( TheFs, name, EFileRead );
-	test_KErrNone(r);
+	test( r == KErrNone );
 	
 	RArray<SBlockMapInfo> map;	// From RArray<TBlockMapEntry> map; to RArray<SBlockMapInfo> map;
 	SBlockMapInfo info;
@@ -103,9 +102,9 @@
 			map.Close();
 			testFile.Close();
 			r = fMan->Attribs(name, 0, KEntryAttReadOnly, 0);
-			test_KErrNone(r);
+			test( r == KErrNone );
 			r = fMan->Delete(name);
-			test_KErrNone(r);
+			test( r == KErrNone );
 			delete fMan;
 			return bmErr;
 			}
@@ -118,7 +117,7 @@
 
 	TInt size;
 	r = testFile.Size(size);
-	test_KErrNone(r);
+	test( r == KErrNone );
 
 	TBuf8<KReadBufferSize> buf1;
 	TBuf8<KReadBufferSize> buf2;
@@ -145,7 +144,7 @@
 
 	const TInt KTotalSegments = totalSegments;
 	r = localDrive.Connect( localDriveNum, changed );
-	test_KErrNone(r);
+	test( r == KErrNone );
 
 //	For each SBlockMapInfo object in RArray map
 	for ( c = 0; c < map.Count(); c++ )
@@ -176,7 +175,7 @@
 					testFile.Read( startPos + amountRead, buf1, KReadBufferSize );
 					localDrive.Read( map[c].iStartBlockAddress + myBlockMapEntry->iStartBlock * map[c].iBlockGranularity + (c2 == 1?map[c].iBlockStartOffset:0) + myCounter*KReadBufferSize, KReadBufferSize, buf2);
 					r = buf1.Compare( buf2 );
-					test_Value(r, r == 0 );
+					test( r == 0 );
 					buf1.Zero();
 					buf2.Zero();
 					myCounter++;
@@ -189,7 +188,7 @@
 					testFile.Read(startPos + amountRead, buf1, miniLength);
 					localDrive.Read( map[c].iStartBlockAddress + myBlockMapEntry->iStartBlock * map[c].iBlockGranularity + (c2 == 1?map[c].iBlockStartOffset:0) + myCounter*KReadBufferSize, miniLength, buf2);
 					r = buf1.Compare( buf2 );
-					test_Value(r, r == 0 );
+					test( r == 0 );
 					amountRead += miniLength;
 					length -= miniLength;
 					miniLength = 0;
@@ -202,9 +201,9 @@
 
 	testFile.Close();
 	r=fMan->Attribs(name, 0, KEntryAttReadOnly, 0);
-	test_KErrNone(r);
+	test( r == KErrNone );
 	r = fMan->Delete(name);
-	test_KErrNone(r);
+	test( r == KErrNone );
 	delete fMan;
 	return bmErr;
 	}
@@ -217,7 +216,7 @@
 	TInt localDriveNum = 0;
 	RFile testFile;
 	TInt r = testFile.Open( TheFs, KTestFileFAT, EFileRead );
-	test_KErrNone(r);
+	test( r == KErrNone );
 	
 	RArray<SBlockMapInfo> map;	// From RArray<TBlockMapEntry> map; to RArray<SBlockMapInfo> map;
 	SBlockMapInfo info;
@@ -244,7 +243,7 @@
 
 	TInt size;
 	r = testFile.Size(size);
-	test_KErrNone(r);
+	test( r == KErrNone );
 
 	TBuf8<KReadBufferSize> buf1;
 	TBuf8<KReadBufferSize> buf2;
@@ -269,7 +268,7 @@
 
 	const TInt KTotalSegments = totalSegments;
 	r = localDrive.Connect( localDriveNum, changed );
-	test_KErrNone(r);
+	test( r == KErrNone );
 
 //	For each SBlockMapInfo object in RArray map
 	for ( c = 0; c < map.Count(); c++ )
@@ -301,7 +300,7 @@
 					testFile.Read( startPos + amountRead, buf1, KReadBufferSize );
 					localDrive.Read( map[c].iStartBlockAddress + myBlockMapEntry->iStartBlock * map[c].iBlockGranularity + (c2 == 1?map[c].iBlockStartOffset:0) + myCounter*KReadBufferSize, KReadBufferSize, buf2);
 					r = buf1.Compare( buf2 );
-					test_Value(r, r == 0 );
+					test( r == 0 );
 					buf1.Zero();
 					buf2.Zero();
 					myCounter++;
@@ -314,7 +313,7 @@
 					testFile.Read(startPos + amountRead, buf1, miniLength);
 					localDrive.Read( map[c].iStartBlockAddress + myBlockMapEntry->iStartBlock * map[c].iBlockGranularity + (c2 == 1?map[c].iBlockStartOffset:0) + myCounter*KReadBufferSize, miniLength, buf2);
 					r = buf1.Compare( buf2 );
-					test_Value(r, r == 0 );
+					test( r == 0 );
 					amountRead += miniLength;
 					length -= miniLength;
 					miniLength = 0;
@@ -336,7 +335,7 @@
 	TInt localDriveNum = 0;
 	RFile testFile;
 	TInt r = testFile.Open( TheFs, KTestFile, EFileRead );
-	test_KErrNone(r);
+	test( r == KErrNone );
 	
 	RArray<SBlockMapInfo> map;	// From RArray<TBlockMapEntry> map; to RArray<SBlockMapInfo> map;
 	SBlockMapInfo info;
@@ -363,7 +362,7 @@
 
 	TInt size;
 	r = testFile.Size(size);
-	test_KErrNone(r);
+	test( r == KErrNone );
 
 	TBuf8<KReadBufferSize> buf1;
 	TBuf8<KReadBufferSize> buf2;
@@ -385,7 +384,7 @@
 		totalSegments += granularity;
 		}
 	r = localDrive.Connect( localDriveNum, changed );
-	test_KErrNone(r);
+	test( r == KErrNone );
 
 //	For each SBlockMapInfo object in RArray map
 	for ( c = 0; c < map.Count(); c++ )
@@ -413,7 +412,7 @@
 					testFile.Read( startPos + amountRead, buf1, KReadBufferSize );
 					localDrive.Read( map[c].iStartBlockAddress + myBlockMapEntry->iStartBlock * map[c].iBlockGranularity + (c2 == 1?map[c].iBlockStartOffset:0) + myCounter*KReadBufferSize, KReadBufferSize, buf2);
 					r = buf1.Compare( buf2 );
-					test_Value(r, r == 0 );
+					test( r == 0 );
 					buf1.Zero();
 					buf2.Zero();
 					myCounter++;
@@ -426,7 +425,7 @@
 					testFile.Read(startPos + amountRead, buf1, miniLength);
 					localDrive.Read( map[c].iStartBlockAddress + myBlockMapEntry->iStartBlock * map[c].iBlockGranularity + (c2 == 1?map[c].iBlockStartOffset:0) + myCounter*KReadBufferSize, miniLength, buf2);
 					r = buf1.Compare( buf2 );
-					test_Value(r, r == 0 );
+					test( r == 0 );
 					amountRead += miniLength;
 					length -= miniLength;
 					miniLength = 0;
@@ -456,12 +455,12 @@
 	r = fMan->Delete(name);
 
 	r = fMan->Copy(KTestFile, name);
-	test_Value(r, r == KErrNone  || r == KErrAlreadyExists);
+	test( r == KErrNone  || r == KErrAlreadyExists);
 
 	TInt localDriveNum = 0;
 	RFile testFile;
 	r = testFile.Open( TheFs, name, EFileRead );
-	test_KErrNone(r);
+	test( r == KErrNone );
 	
 	RArray<SBlockMapInfo> map;	// From RArray<TBlockMapEntry> map; to RArray<SBlockMapInfo> map;
 	SBlockMapInfo info;
@@ -478,9 +477,9 @@
 			map.Close();
 			testFile.Close();
 			r = fMan->Attribs(name, 0, KEntryAttReadOnly, 0);
-			test_KErrNone(r);
+			test( r == KErrNone );
 			r = fMan->Delete(name);
-			test_KErrNone(r);
+			test( r == KErrNone );
 			delete fMan;
 			return bmErr;
 			}
@@ -493,7 +492,7 @@
 
 	TInt size;
 	r = testFile.Size(size);
-	test_KErrNone(r);
+	test( r == KErrNone );
 
 	TBuf8<KReadBufferSize> buf1;
 	TBuf8<KReadBufferSize> buf2;
@@ -521,7 +520,7 @@
 	const TInt KTotalSegments = totalSegments;
 
 	r = localDrive.Connect( localDriveNum, changed );
-	test_KErrNone(r);
+	test( r == KErrNone );
 
 //	For each SBlockMapInfo object in RArray map
 	for ( c = 0; c < map.Count(); c++ )
@@ -553,7 +552,7 @@
 					testFile.Read( startPos + amountRead, buf1, KReadBufferSize );
 					localDrive.Read( map[c].iStartBlockAddress + myBlockMapEntry->iStartBlock * map[c].iBlockGranularity + (c2 == 1?map[c].iBlockStartOffset:0) + myCounter*KReadBufferSize, KReadBufferSize, buf2);
 					r = buf1.Compare( buf2 );
-					test_Value(r, r == 0 );
+					test( r == 0 );
 					buf1.Zero();
 					buf2.Zero();
 					myCounter++;
@@ -566,7 +565,7 @@
 					testFile.Read(startPos + amountRead, buf1, miniLength);
 					localDrive.Read( map[c].iStartBlockAddress + myBlockMapEntry->iStartBlock * map[c].iBlockGranularity + (c2 == 1?map[c].iBlockStartOffset:0) + myCounter*KReadBufferSize, miniLength, buf2);
 					r = buf1.Compare( buf2 );
-					test_Value(r, r == 0 );
+					test( r == 0 );
 					amountRead += miniLength;
 					length -= miniLength;
 					miniLength = 0;
@@ -579,9 +578,9 @@
 
 	testFile.Close();
 	r=fMan->Attribs(name, 0, KEntryAttReadOnly, 0);
-	test_KErrNone(r);
+	test( r == KErrNone );
 	r = fMan->Delete(name);
-	test_KErrNone(r);
+	test( r == KErrNone );
 	delete fMan;
 	return bmErr;
 	}
@@ -601,11 +600,11 @@
 	r = fMan->Delete(name);
 
 	r = fMan->Copy(KTestFile, name);
-	test_Value(r, r == KErrNone  || r == KErrAlreadyExists);
+	test( r == KErrNone  || r == KErrAlreadyExists);
 
 	RFile testFile;
 	r = testFile.Open( TheFs, name, EFileRead );
-	test_KErrNone(r);
+	test( r == KErrNone );
 	
 	RArray<SBlockMapInfo> map;	// From RArray<TBlockMapEntry> map; to RArray<SBlockMapInfo> map;
 	SBlockMapInfo info;
@@ -617,9 +616,9 @@
 
 	testFile.Close();
 	r = fMan->Attribs(name, 0, KEntryAttReadOnly, 0);
-	test_KErrNone(r);
+	test( r == KErrNone );
 	r = fMan->Delete(name);
-	test_KErrNone(r);
+	test( r == KErrNone );
 	delete fMan;
 	return bmErr;
 	}
@@ -636,11 +635,11 @@
 	name.Append( KTestFileName );
 
 	TInt r=fMan->Copy(KTestFile, name);
-	test_Value(r, r == KErrNone  || r == KErrAlreadyExists);
+	test( r == KErrNone  || r == KErrAlreadyExists);
 
 	RFile testFile;
 	r = testFile.Open( TheFs, name, EFileRead );
-	test_KErrNone(r);
+	test( r == KErrNone );
 	
 	RArray<SBlockMapInfo> map;	// From RArray<TBlockMapEntry> map; to RArray<SBlockMapInfo> map;
 	SBlockMapInfo info;
@@ -649,9 +648,9 @@
 
 	testFile.Close();
 	r=fMan->Attribs(name, 0, KEntryAttReadOnly, 0);
-	test_KErrNone(r);
+	test( r == KErrNone );
 	r = fMan->Delete(name);
-	test_KErrNone(r);
+	test( r == KErrNone );
 	delete fMan;
 	return bmErr;
 	}
@@ -668,12 +667,12 @@
 	name.Append( KTestFileName );
 
 	TInt r=fMan->Copy(KTestFile, name);
-	test_Value(r, r == KErrNone  || r == KErrAlreadyExists);
+	test( r == KErrNone  || r == KErrAlreadyExists);
 
 	TInt localDriveNum = 0;
 	RFile testFile;
 	r = testFile.Open( TheFs, name, EFileRead );
-	test_KErrNone(r);
+	test( r == KErrNone );
 	
 	RArray<SBlockMapInfo> map;	// From RArray<TBlockMapEntry> map; to RArray<SBlockMapInfo> map;
 	SBlockMapInfo info;
@@ -690,9 +689,9 @@
 			map.Close();
 			testFile.Close();
 			r = fMan->Attribs(name, 0, KEntryAttReadOnly, 0);
-			test_KErrNone(r);
+			test( r == KErrNone );
 			r = fMan->Delete(name);
-			test_KErrNone(r);
+			test( r == KErrNone );
 			delete fMan;
 			return bmErr;
 			}
@@ -705,7 +704,7 @@
 
 	TInt size;
 	r = testFile.Size(size);
-	test_KErrNone(r);
+	test( r == KErrNone );
 
 	TBuf8<KReadBufferSize> buf1;
 	TBuf8<KReadBufferSize> buf2;
@@ -733,7 +732,7 @@
 	const TInt KTotalSegments = totalSegments;
 
 	r = localDrive.Connect( localDriveNum, changed );
-	test_KErrNone(r);
+	test( r == KErrNone );
 
 //	For each SBlockMapInfo object in RArray map
 	for ( c = 0; c < map.Count(); c++ )
@@ -765,7 +764,7 @@
 					testFile.Read( startPos + amountRead, buf1, KReadBufferSize );
 					localDrive.Read( map[c].iStartBlockAddress + myBlockMapEntry->iStartBlock * map[c].iBlockGranularity + (c2 == 1?map[c].iBlockStartOffset:0) + myCounter*KReadBufferSize, KReadBufferSize, buf2);
 					r = buf1.Compare( buf2 );
-					test_Value(r, r == 0 );
+					test( r == 0 );
 					buf1.Zero();
 					buf2.Zero();
 					myCounter++;
@@ -778,7 +777,7 @@
 					testFile.Read(startPos + amountRead, buf1, miniLength);
 					localDrive.Read( map[c].iStartBlockAddress + myBlockMapEntry->iStartBlock * map[c].iBlockGranularity + (c2 == 1?map[c].iBlockStartOffset:0) + myCounter*KReadBufferSize, miniLength, buf2);
 					r = buf1.Compare( buf2 );
-					test_Value(r, r == 0 );
+					test( r == 0 );
 					amountRead += miniLength;
 					length -= miniLength;
 					miniLength = 0;
@@ -791,9 +790,9 @@
 
 	testFile.Close();
 	r=fMan->Attribs(name, 0, KEntryAttReadOnly, 0);
-	test_KErrNone(r);
+	test( r == KErrNone );
 	r = fMan->Delete(name);
-	test_KErrNone(r);
+	test( r == KErrNone );
 	delete fMan;
 	return bmErr;
 	}
@@ -815,7 +814,7 @@
 	TInt localDriveNum = 0;
 	RFile testFile;
 	TInt r = testFile.Open( TheFs, name, EFileRead );
-	test_KErrNone(r);
+	test( r == KErrNone );
 	RArray<SBlockMapInfo> map;	// From RArray<TBlockMapEntry> map; to RArray<SBlockMapInfo> map;
 	SBlockMapInfo info;
 	TInt counter = 0;
@@ -833,9 +832,9 @@
 			if ( Finished )
 				{
 				r = fMan->Attribs(name, 0, KEntryAttReadOnly, 0);
-				test_KErrNone(r);
+				test( r == KErrNone );
 				r = fMan->Delete(name);
-				test_KErrNone(r);
+				test( r == KErrNone );
 				}
 			delete fMan;
 			return bmErr;
@@ -848,7 +847,7 @@
 	TInt granularity;
 	TInt size;
 	r = testFile.Size(size);
-	test_KErrNone(r);
+	test( r == KErrNone );
 
 	TBuf8<KReadBufferSize> buf1;
 	TBuf8<KReadBufferSize> buf2;
@@ -875,7 +874,7 @@
 
 	const TInt KTotalSegments = totalSegments;
 	r = localDrive.Connect( localDriveNum, changed );
-	test_KErrNone(r);
+	test( r == KErrNone );
 
 //	For each SBlockMapInfo object in RArray map
 	for ( c = 0; c < map.Count(); c++ )
@@ -907,7 +906,7 @@
 					testFile.Read( startPos + amountRead, buf1, KReadBufferSize );
 					localDrive.Read( map[c].iStartBlockAddress + myBlockMapEntry->iStartBlock * map[c].iBlockGranularity + (c2 == 1?map[c].iBlockStartOffset:0) + myCounter*KReadBufferSize, KReadBufferSize, buf2);
 					r = buf1.Compare( buf2 );
-					test_Value(r, r == 0 );
+					test( r == 0 );
 					buf1.Zero();
 					buf2.Zero();
 					myCounter++;
@@ -920,7 +919,7 @@
 					testFile.Read(startPos + amountRead, buf1, miniLength );
 					localDrive.Read( map[c].iStartBlockAddress + myBlockMapEntry->iStartBlock * map[c].iBlockGranularity + (c2 == 1?map[c].iBlockStartOffset:0) + myCounter*KReadBufferSize, miniLength, buf2);
 					r = buf1.Compare( buf2 );
-					test_Value(r, r == 0 );
+					test( r == 0 );
 					amountRead += miniLength;
 					length -= miniLength;
 					miniLength = 0;
@@ -935,9 +934,9 @@
 	if ( Finished )
 		{
 		r=fMan->Attribs(name, 0, KEntryAttReadOnly, 0);
-		test_KErrNone(r);
+		test( r == KErrNone );
 		r = fMan->Delete(name);
-		test_KErrNone(r);
+		test( r == KErrNone );
 		}
 	delete fMan;
 	return bmErr;	
@@ -958,7 +957,7 @@
 	name1.Append( KFragmentedFileName1 );
 	RFile file1;
 	r = file1.Create(TheFs, name1, EFileWrite);
-	test_KErrNone(r);
+	test( r == KErrNone );
 	file1.Close();
 
 	TFileName name2(KDriveBase);
@@ -973,7 +972,7 @@
 	name2.Append( KFragmentedFileName2 );
 	RFile file2;
 	r = file2.Create(TheFs, name2, EFileWrite);
-	test_KErrNone(r);
+	test( r == KErrNone );
 	file2.Close();
 	TInt64 randomSeed;
 	TBuf8<KMaxFragmentSize> tempBuf;	
@@ -1000,31 +999,31 @@
 			*buf++ = (TUint8)('A' + (Math::Rand(randomSeed) % ('Z' - 'A')));
 			}
 		r = file1.Open( TheFs, name1, EFileWrite );
-		test_KErrNone(r);
+		test( r == KErrNone );
 		r = file1.Seek( ESeekEnd, pos1 );
-		test_KErrNone(r);
+		test( r == KErrNone );
 		r = file1.Write( pos1, tempBuf );
-		test_KErrNone(r);
+		test( r == KErrNone );
 		r = file1.Flush();
-		test_KErrNone(r);		
+		test( r == KErrNone );		
 		file1.Close();
 		if ( mycount++ < 6 )
 			{
 			r = file2.Open( TheFs, name2, EFileWrite );
-			test_KErrNone(r);
+			test( r == KErrNone );
 			r = file2.Seek( ESeekEnd, pos2 );
-			test_KErrNone(r);
+			test( r == KErrNone );
 			r = file2.Write( pos2, tempBuf );
-			test_KErrNone(r);
+			test( r == KErrNone );
 			r = file2.Flush();
-			test_KErrNone(r);
+			test( r == KErrNone );
 			file2.Close();
 			}
 		} while ( fileSize < KMaxFileSize );
 	CFileMan* fMan=CFileMan::NewL(TheFs);
 	test(fMan!=NULL);
 	r = fMan->Delete(name2);
-	test_KErrNone(r);
+	test( r == KErrNone );
 	delete fMan;
 	}
 
@@ -1038,7 +1037,7 @@
 		TInt r = TheFs.Drive(info, i);
 		if ( r != KErrNone )
 			continue;
-		test_KErrNone(r);
+		test( r == KErrNone );
 		if ( aDriveType == EDriveNand )	
 			{
 			c++ == 0 ? test.Printf( _L("Searching for NAND drive.")) : test.Printf( _L("."));
@@ -1121,9 +1120,9 @@
 	TInt testFileSize = 0;
 	RFile testFile;
 	TInt r = testFile.Open(TheFs, KTestFile, EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = testFile.Size(testFileSize);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(testFileSize>16384);
 	testFile.Close();
 
@@ -1131,7 +1130,7 @@
 		{
 		TInt value;
 		r = HAL::Get( HAL::EMachineUid, value );
-		test_KErrNone(r);
+		test( r == KErrNone );
 		if ( value != HAL::EMachineUid_Lubbock )	// Lubbock cannot run FindDrive as it doesn't support the NAND API
 			{
 			test.Next(_L("Test BlockMap retrieval on NAND FAT."));
@@ -1139,184 +1138,184 @@
 			if ( NandDrive > -1 )	// not finding a NAND drive isn't an error as only NAND builds have one
 				{
 				r = TestBlockMapNandFATUserData(0, -1);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandFATUserData(1024, 4096);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandFATUserData(1020, 4100);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandFATUserData(1024, 4100);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandFATUserData(1020, 4096);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandFATUserData(1025, 1200);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandFATUserData(0, testFileSize+100);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapNandFATUserData(-5, -1);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapNandFATUserData(-5, testFileSize+100);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapNandFATUserData(0, 0);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapNandFATUserData(testFileSize, -1);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapNandFATUserData(0, -1);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandFATUserData(2000, 2001);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandFATUserData(0, 0);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapNandFATUserData(2000, 2000);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapNandFATUserData(2048, 2048);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				test.Printf(_L("Generating Fragmented File..."));
 				GenerateFragmentedFiles(EDriveNand);
 				test.Printf(_L("Done!\n"));
 				test.Next(_L("Test BlockMap retrieval on NAND FAT (User area) (fragmented)."));	
 				r = TestBlockMapFragmented(EDriveNand, 0, -1);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapFragmented(EDriveNand, 1024, 4096);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapFragmented(EDriveNand, 1020, 4100);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapFragmented(EDriveNand, 1024, 4100);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapFragmented(EDriveNand, 1020, 4096);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapFragmented(EDriveNand, 1025, 1200);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapFragmented(EDriveNand, 0, testFileSize+100);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapFragmented(EDriveNand, -5, -1);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapFragmented(EDriveNand, -5, testFileSize+100);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapFragmented(EDriveNand, 0, 0);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapFragmented(EDriveNand, testFileSize, -1);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapFragmented(EDriveNand, 0, -1);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapFragmented(EDriveNand, 2000, 2001);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapFragmented(EDriveNand, 0, 0);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapFragmented(EDriveNand, 2000, 2000);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				Finished = ETrue;
 				r = TestBlockMapFragmented(EDriveNand, 2048, 2048);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				test.Next(_L("Test BlockMap retrieval on NAND FAT."));	
 				r = TestBlockMapNandFAT(0, -1);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandFAT(1024, 4096);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandFAT(1020, 4100);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandFAT(1024, 4100);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandFAT(1020, 4096);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandFAT(1025, 1200);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandFAT(0, testFileSize+100);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapNandFAT(-5, -1);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapNandFAT(-5, testFileSize+100);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapNandFAT(0, 0);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapNandFAT(testFileSize, -1);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapNandFAT(0, -1);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandFAT(2000, 2001);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandFAT(0, 0);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapNandFAT(2000, 2000);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapNandFAT(2048, 2048);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				test.Next(_L("Test BlockMap retrieval on NAND ROFS."));
 				r = TestBlockMapNandROFS(0, -1);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandROFS(1024, 4096);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandROFS(1020, 4100);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandROFS(1024, 4100);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandROFS(1020, 4096);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandROFS(1025, 1200);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandROFS(0, testFileSize+100);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapNandROFS(-5, -1);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapNandROFS(-5, testFileSize+100);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapNandROFS(0, 0);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapNandROFS(testFileSize, -1);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapNandROFS(0, -1);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandROFS(2000, 2001);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapNandROFS(0, 0);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapNandROFS(2000, 2000);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapNandROFS(2048, 2048);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				test.Next(_L("Test BlockMap retrieval on RAM FAT."));
 				FindDrive(EDriveRam);
 				test( RamFatDrive > -1 );
 				r = TestBlockMapRamFAT(0, -1);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapRamFAT(1024, 4096);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapRamFAT(1020, 4100);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapRamFAT(1024, 4100);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapRamFAT(1020, 4096);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapRamFAT(1025, 1200);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapRamFAT(0, testFileSize+100);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapRamFAT(-5, -1);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapRamFAT(-5, testFileSize+100);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapRamFAT(0, 0);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapRamFAT(testFileSize, -1);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapRamFAT(0, -1);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapRamFAT(2000, 2001);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapRamFAT(0, 0);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapRamFAT(2000, 2000);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapRamFAT(2048, 2048);
-				test_Value(r, r == KErrArgument ); 
+				test( r == KErrArgument ); 
 				test.Next(_L("Test BlockMap retrieval on Ram FAT (2)."));
 				r = TestBlockMapRamFAT2(0, -1);
-				test_Value(r, r == KErrNotSupported );
+				test( r == KErrNotSupported );
 				FindDrive(EDriveRemovable);
 				if ( RemovableFatDrive > -1)
 					{
 					test.Next(_L("Test BlockMap retrieval on removable FAT."));
 					r = TestBlockMapRemovableFAT(0, -1);
-					test_Value(r, r == Pageable ? KErrNotSupported : KErrCompletion);
+					Pageable?test( r == KErrNotSupported ):test( r == KErrCompletion );
 					}
 				else
 					{
@@ -1324,37 +1323,37 @@
 					FindDrive(EDriveInternalRemovable);
 					test( InternalRemovableFatDrive > -1);
 					r = TestBlockMapInternalRemovableFAT(0, -1);
-					test_Value(r, r == KErrCompletion );
+					test( r == KErrCompletion );
 					r = TestBlockMapInternalRemovableFAT(1024, 4096);
-					test_Value(r, r == KErrCompletion );
+					test( r == KErrCompletion );
 					r = TestBlockMapInternalRemovableFAT(1020, 4100);
-					test_Value(r, r == KErrCompletion );
+					test( r == KErrCompletion );
 					r = TestBlockMapInternalRemovableFAT(1024, 4100);
-					test_Value(r, r == KErrCompletion );
+					test( r == KErrCompletion );
 					r = TestBlockMapInternalRemovableFAT(1020, 4096);
-					test_Value(r, r == KErrCompletion );
+					test( r == KErrCompletion );
 					r = TestBlockMapInternalRemovableFAT(1025, 1200);
-					test_Value(r, r == KErrCompletion );
+					test( r == KErrCompletion );
 					r = TestBlockMapInternalRemovableFAT(0, testFileSize+100);
-					test_Value(r, r == KErrArgument );
+					test( r == KErrArgument );
 					r = TestBlockMapInternalRemovableFAT(-5, -1);
-					test_Value(r, r == KErrArgument );
+					test( r == KErrArgument );
 					r = TestBlockMapInternalRemovableFAT(-5, testFileSize+100);
-					test_Value(r, r == KErrArgument );
+					test( r == KErrArgument );
 					r = TestBlockMapInternalRemovableFAT(0, 0);
-					test_Value(r, r == KErrArgument );
+					test( r == KErrArgument );
 					r = TestBlockMapInternalRemovableFAT(testFileSize, -1);
-					test_Value(r, r == KErrArgument );
+					test( r == KErrArgument );
 					r = TestBlockMapInternalRemovableFAT(0, -1);
-					test_Value(r, r == KErrCompletion );
+					test( r == KErrCompletion );
 					r = TestBlockMapInternalRemovableFAT(2000, 2001);
-					test_Value(r, r == KErrCompletion );
+					test( r == KErrCompletion );
 					r = TestBlockMapInternalRemovableFAT(0, 0);
-					test_Value(r, r == KErrArgument );
+					test( r == KErrArgument );
 					r = TestBlockMapInternalRemovableFAT(2000, 2000);
-					test_Value(r, r == KErrArgument );
+					test( r == KErrArgument );
 					r = TestBlockMapInternalRemovableFAT(2048, 2048);
-					test_Value(r, r == KErrArgument );
+					test( r == KErrArgument );
 					}
 				test.Next(_L("Test BlockMap retrieval on Ram FAT (fragmented)."));	
 				test.Printf(_L("Generating Fragmented File..."));
@@ -1362,38 +1361,38 @@
 				test.Printf(_L("Done!\n"));
 				Finished = EFalse;
 				r = TestBlockMapFragmented(EDriveRam, 0, -1);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapFragmented(EDriveRam, 1020, 4100);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapFragmented(EDriveRam, 2049, 4096);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapFragmented(EDriveRam, 1024, 4100);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapFragmented(EDriveRam, 1020, 4096);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapFragmented(EDriveRam, 1025, 1200);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapFragmented(EDriveRam, 0, testFileSize+100);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapFragmented(EDriveRam, -5, -1);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapFragmented(EDriveRam, -5, testFileSize+100);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapFragmented(EDriveRam, 0, 0);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapFragmented(EDriveRam, testFileSize, -1);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapFragmented(EDriveRam, 0, -1);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapFragmented(EDriveRam, 2000, 2001);
-				test_Value(r, r == KErrCompletion );
+				test( r == KErrCompletion );
 				r = TestBlockMapFragmented(EDriveRam, 0, 0);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				r = TestBlockMapFragmented(EDriveRam, 2000, 2000);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				Finished = ETrue;
 				r = TestBlockMapFragmented(EDriveRam, 2048, 2048);
-				test_Value(r, r == KErrArgument );
+				test( r == KErrArgument );
 				}
 			else
 				{
--- a/kerneltest/f32test/server/t_chkuid.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_chkuid.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 //
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include "t_server.h"
@@ -38,67 +37,67 @@
     // Create \\gSessionPath\\UIDCHKNO.SHT - no uid, zero length
 	RFile file;
 	TInt r=file.Replace(TheFs,_L("UIDCHKNO.SHT"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
     // Create \\gSessionPath\\UIDCHKNO.LNG - no uid, long length
 	r=file.Replace(TheFs,_L("UIDCHKNO.LNG"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(_L8("Hello World needs to be over 16 bytes"));
 	file.Close();
 
     // Create \\gSessionPath\\UIDCHK.BLG - with uid no data
 	r=file.Replace(TheFs,_L("UIDCHK.BLG"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TUidType uidType(TUid::Uid('U'),TUid::Uid('I'),TUid::Uid('D'));
 	TCheckedUid checkedUid(uidType);
 	TPtrC8 buf((TUint8*)&checkedUid,sizeof(TCheckedUid));
 	r=file.Write(buf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
     // Create \\gSessionPath\\UIDCHK.MSG - with uid and data
 	r=file.Replace(TheFs,_L("UIDCHK.MSG"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TUidType uidType2(TUid::Uid('X'),TUid::Uid('Y'),TUid::Uid('Z'));
 	checkedUid.Set(uidType2);
 	buf.Set((TUint8*)&checkedUid,sizeof(TCheckedUid));
 	r=file.Write(buf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(_L8("More file data"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
     // Create \\gSessionPath\\UIDCHK.DAT - uid stored only in the file
 	r=file.Replace(TheFs,_L("UIDCHK.DAT"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TUidType uidType3(TUid::Uid('D'),TUid::Uid('A'),TUid::Uid('T'));
 	checkedUid.Set(uidType3);
 	buf.Set((TUint8*)&checkedUid,sizeof(TCheckedUid));
 	r=file.Write(buf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(_L8("More file data"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
     // Create \\gSessionPath\\UIDCHK.PE - uid stored in WINS PE file header
 	r=file.Replace(TheFs,_L("UIDWINS.PE"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 #if defined(__WINS__)
     if (!IsTestingLFFS())
         {
 	    RFile fileSource;
 	    r=fileSource.Open(TheFs,_L("Z:\\TEST\\T_CHKUID.EXE"),EFileShareReadersOnly|EFileRead);
-	    test_KErrNone(r);
+	    test(r==KErrNone);
 
 	    TBuf8<0x100> buffer;
 	    do
 		    {
 		    r=fileSource.Read(buffer);
-		    test_KErrNone(r);
+		    test(r==KErrNone);
 		    r=file.Write(buffer);
-		    test_KErrNone(r);
+		    test(r==KErrNone);
 		    }
 	    while (buffer.Length()==buffer.MaxLength());
 
@@ -107,11 +106,11 @@
     else
         {
 	    r=file.Write(_L8("Some zany stuff here!"));
-	    test_KErrNone(r);
+	    test(r==KErrNone);
         }
 #else
 	r=file.Write(_L8("Some zany stuff here!"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 #endif
 	file.Close();
 	}
@@ -126,7 +125,7 @@
 	CDir* dum=NULL;
 	TInt r=TheFs.GetDir(_L("UID*"),KEntryAttAllowUid,ESortByName,dum);
 	CDir& dir=*dum;
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt count=dir.Count();
 	test(count==6);
 
@@ -181,7 +180,7 @@
 	CDir* dum=NULL;
 	TInt r=TheFs.GetDir(_L("UID*"),0,ESortByName,dum);
 	CDir& dir=*dum;
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt count=dir.Count();
 	test(count==6);
 
@@ -220,35 +219,35 @@
 	test.Next(_L("Use RFs::EntryL() to check files"));
 	TEntry entry;
 	TInt r=TheFs.Entry(_L("UIDCHKNO.SHT"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("UIDCHKNO.SHT"));
 	test(entry.IsTypeValid()==EFalse);
 
 	r=TheFs.Entry(_L("UIDCHKNO.LNG"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("UIDCHKNO.LNG"));
 	test(entry.IsTypeValid()==EFalse);
 
 	r=TheFs.Entry(_L("UIDCHK.MSG"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("UIDCHK.MSG"));
 	test(entry.IsTypeValid());
 	test(entry.iType[0]==TUid::Uid('X') && entry.iType[1]==TUid::Uid('Y') && entry.iType[2]==TUid::Uid('Z'));
 
 	r=TheFs.Entry(_L("UIDCHK.BLG"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("UIDCHK.BLG"));
 	test(entry.IsTypeValid());
 	test(entry.iType[0]==TUid::Uid('U') && entry.iType[1]==TUid::Uid('I') && entry.iType[2]==TUid::Uid('D'));
 
 	r=TheFs.Entry(_L("UIDCHK.DAT"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("UIDCHK.DAT"));
 	test(entry.IsTypeValid());
 	test(entry.iType[0]==TUid::Uid('D') && entry.iType[1]==TUid::Uid('A') && entry.iType[2]==TUid::Uid('T'));
 
 	r=TheFs.Entry(_L("UIDWINS.PE"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("UIDWINS.PE"));
 #if defined(__WINS__)
 	TFileName sessionPath;
@@ -279,34 +278,34 @@
 	RFile f;
 	TEntry entry;
 	TInt r=f.Open(TheFs,_L("UIDCHK.DAT"),EFileShareExclusive|EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("UIDCHK.DAT"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("UIDCHK.DAT"));
 	test(entry.IsTypeValid());
 	test(entry.iType[0]==TUid::Uid('D') && entry.iType[1]==TUid::Uid('A') && entry.iType[2]==TUid::Uid('T'));
 	f.Close();
 
 	r=f.Open(TheFs,_L("UIDCHK.DAT"),EFileShareExclusive|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("UIDCHK.DAT"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("UIDCHK.DAT"));
 	test(entry.IsTypeValid());
 	test(entry.iType[0]==TUid::Uid('D') && entry.iType[1]==TUid::Uid('A') && entry.iType[2]==TUid::Uid('T'));
 
 	r=f.SetSize(256);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf8<16> des;
 	r=TheFs.ReadFileSection(_L("UIDCHK.DAT"),0,des,16);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	f.Close();
 
 	r=f.Open(TheFs,_L("UIDCHK.DAT"),EFileShareReadersOnly|EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("UIDCHK.DAT"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("UIDCHK.DAT"));
 	test(entry.IsTypeValid());
 	test(entry.iType[0]==TUid::Uid('D') && entry.iType[1]==TUid::Uid('A') && entry.iType[2]==TUid::Uid('T'));
@@ -315,27 +314,27 @@
 //	EFileShareReadersOnly|EFileWrite is illegal
 
 	r=f.Open(TheFs,_L("UIDCHK.DAT"),EFileShareAny|EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("UIDCHK.DAT"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("UIDCHK.DAT"));
 	test(entry.IsTypeValid());
 	test(entry.iType[0]==TUid::Uid('D') && entry.iType[1]==TUid::Uid('A') && entry.iType[2]==TUid::Uid('T'));
 	f.Close();
 
 	r=f.Open(TheFs,_L("UIDCHK.DAT"),EFileShareAny|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RFile secondFile;
 	r=secondFile.Open(TheFs,_L("UIDCHK.DAT"),EFileShareAny|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RFile thirdFile;
 	r=thirdFile.Open(TheFs,_L("UIDCHK.DAT"),EFileShareAny|EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Entry(_L("UIDCHK.DAT"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("UIDCHK.DAT"));
 	test(entry.IsTypeValid());
 	test(entry.iType[0]==TUid::Uid('D') && entry.iType[1]==TUid::Uid('A') && entry.iType[2]==TUid::Uid('T'));
@@ -344,10 +343,10 @@
 	thirdFile.Close();
 
 	r=f.Open(TheFs,_L("UIDWINS.PE"),EFileShareAny|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Entry(_L("UIDWINS.PE"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("UIDWINS.PE"));
 #if defined(__WINS__)
 	TFileName sessionPath;
@@ -380,7 +379,7 @@
 		test.Printf(_L("Error: Unable to open Z:\n"));
 		return;
 		}
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CDir& dir=*dum;
 	TInt count=dir.Count();
 	if (count==0)
@@ -414,7 +413,7 @@
 	TFileName sessionPath;
 
 	TInt r=TheFs.SessionPath(sessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TChar driveLetter=sessionPath[0];
 	b.Format(_L("Testing filesystem on %c:"),(TText)driveLetter);
 	test.Next(b);
--- a/kerneltest/f32test/server/t_corruptlog.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_corruptlog.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -24,7 +24,6 @@
 //! @SYMCreationDate 1/11/04
 //! @SYMTestCaseDesc Check trap action of CorruptFileNames.lst
 
-#define __E32TEST_EXTENSION__
 #include <e32test.h>
 RTest test(_L("t_corruptlog"));
 
@@ -107,7 +106,7 @@
 	// Note that C: is used in the IoControl call, which requires a valid drive, but has no other relevance
 	TInt numberOfRecords;
 	TInt r=controlIo(TheFs, EDriveC, KControlIoGetNumberOfCorruptLogRecords, numberOfRecords);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	return numberOfRecords;
 	}
 
@@ -116,7 +115,7 @@
 	// fetchs a trap record
 	// Note that C: is used in the IoControl call, which requires a valid drive, but has no other relevance
 	TInt r=controlIo(TheFs, EDriveC, KControlIoGetCorruptLogRecord, alogRec, aRecordNumber);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	return r;
 	}
 
@@ -126,7 +125,7 @@
 	// the corrupt files list.
 	// Note that C: is used in the IoControl call, which requires a valid drive, but has no other relevance
 	TInt r=controlIo(TheFs, EDriveC, KControlIoGetCorruptListFile, aFileName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	return r;
 	}
 
@@ -137,22 +136,22 @@
 	const TInt attribs=EFileShareExclusive|EFileStreamText|EFileRead;
 	// File1 
 	TInt r=f.Open(TheFs,KTestFile1,attribs);
-	test_Value(r, r == KTestFile1Error1);
+	test(r==KTestFile1Error1);
 	f.Close();
 	numberOfTraps+=(r==KErrNone?0:1);
 	// try again
 	r=f.Open(TheFs,KTestFile1,attribs);
-	test_Value(r, r == KTestFile1Error2);
+	test(r==KTestFile1Error2);
 	f.Close();
 	numberOfTraps+=(r==KErrNone?0:1);
 	// File2 
 	r=f.Open(TheFs,KTestFile2,attribs);
-	test_Value(r, r == KTestFile2Error1);
+	test(r==KTestFile2Error1);
 	f.Close();
 	numberOfTraps+=(r==KErrNone?0:1);
 	// try again
 	r=f.Open(TheFs,KTestFile2,attribs);
-	test_Value(r, r == KTestFile2Error2);
+	test(r==KTestFile2Error2);
 	f.Close();
 	numberOfTraps+=(r==KErrNone?0:1);
 	}
@@ -162,7 +161,7 @@
 	TFileName corruptFileNamesList;
     test.Next(_L("Get name of file with list of nominated files"));
 	TInt r=GetCorruptFileListFile(corruptFileNamesList);
-    test_KErrNone(r);
+    test(r==KErrNone);
  	test.Printf(_L("Using %S\n"),&corruptFileNamesList);
 
 	AccessFiles();
@@ -175,9 +174,9 @@
 	for (TInt i=1;i<=nRecs;i++)
 		{ // fetch record #i
 		TInt r=GetTrapLogRecord(logRec,i);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=logRec().iProcessName.CompareF(_L("t_corruptlog.exe"));
-		test_KErrNone(r);
+		test(r==KErrNone);
 		PrintLogRecord(logRec,i);
 		}
 	}
@@ -195,7 +194,7 @@
     test.Start(_L("Corrupt File trap log"));
 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
 	TInt r=TheFs.Connect();
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     TheFs.ResourceCountMarkStart();
     
--- a/kerneltest/f32test/server/t_cp_plugin.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_cp_plugin.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -16,7 +16,6 @@
 //
 
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32ldr.h>
 #include <e32ldr_private.h>
@@ -43,6 +42,8 @@
 void TestCompatibility();
 void TestINC126563();
 
+// Codepage dll name
+_LIT(KCP932Name,"T_CP932");
 
 TInt LoadCodePageDll(const TDesC& aCodePageDllName)
 	{
@@ -94,8 +95,7 @@
 	test.Start(_L("Starting T_CP_PLUGIN tests"));
 
 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
-	// Codepage dll name
-	_LIT(KCP932Name,"T_CP932");
+
 	// Test only runs on Fat file systems
 	TheFs.SessionPath(gSessionPath);
 	TInt driveNum = CurrentDrive();
@@ -111,13 +111,13 @@
 			{
 			TBuf<16> CodepageDllName(KCP932Name);
 			r = LoadCodePageDll(CodepageDllName);
-			test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+			test(r == KErrNone || r == KErrAlreadyExists);
 
 			if(r == KErrNone)
 				{
 				// should not allow loading again codepage dll.
 				r = LoadCodePageDll(CodepageDllName);
-				test_Value(r, r == KErrAlreadyExists);
+				test(r == KErrAlreadyExists);
 
 				}
 
@@ -129,7 +129,7 @@
 
 			// Disables codepage dll implementation of LocaleUtils functions for other base tests
 			r = TheFs.ControlIo(driveNum, KControlIoDisableFatUtilityFunctions);
-			test_KErrNone(r);
+			test(r == KErrNone);
 			}
 		}
 	else
--- a/kerneltest/f32test/server/t_cp_plugintest.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_cp_plugintest.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -45,7 +45,7 @@
 void ReadBootSector(TFatBootSector& aBootSector)
 	{
     TInt nRes = ReadBootSector(TheFs, CurrentDrive(), KBootSectorNum<<KDefaultSectorLog2, aBootSector);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     if(!aBootSector.IsValid())
         {
@@ -73,32 +73,32 @@
 
 	// Create new directory and check creation
 	TInt r = TheFs.MkDir(longDirNamePath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TUint dumUint=0;
 	CDir* dumDir;
 	r= TheFs.GetDir(longDirNamePath, dumUint, dumUint, dumDir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test_NotNull(dumDir);
 	delete dumDir;
 
 	// Check short name
 	r = TheFs.GetShortName(longDirNamePath, shortName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = shortName.Compare(aShortName);
-	test_Value(r, r == 0);
+	test(r==0);
 	
 	// Check long name
 	shortDirNamePath = gSessionPath;
 	shortDirNamePath += shortName;
 	shortDirNamePath.Append('\\');
 	r = TheFs.GetLongName(shortDirNamePath, longName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = longName.Compare(aLongName);
-	test_Value(r, r == 0);
+	test(r==0);
 
 	r = TheFs.RmDir(longDirNamePath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 void doFileNameTest(const TDesC& aLongName, const TDesC& aShortName)
@@ -109,28 +109,28 @@
 	TFileName shn;
 
 	TInt r = TheFs.SessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	lgnFullPath = gSessionPath;
 	lgnFullPath += aLongName;
 	
 	MakeFile_CPTest(lgnFullPath);
 	// Check short name	
 	r = TheFs.GetShortName(lgnFullPath, shn);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = shn.Compare(aShortName);
-	test_Value(r, r == 0);
+	test(r==0);
 
 	// Check long name	
 	shnFullPath = gSessionPath;
 	shnFullPath += aShortName;
 
 	r = TheFs.GetLongName(shnFullPath, lgn);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = lgn.Compare(aLongName);
-	test_Value(r, r == 0);
+	test(r==0);
 
 	r = TheFs.Delete(lgnFullPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	}
 #endif //_DEBUG || _DEBUG_RELEASE
@@ -160,10 +160,10 @@
 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
 
 	TInt r = TheFs.SessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt driveNum;
 	r = TheFs.CharToDrive(gSessionPath[0], driveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// Retrieves the original volume label
 	TVolumeInfo vInfo;
@@ -175,24 +175,24 @@
 	_LIT(KUnicodeVolumeLabel, 		"\x65B0\x65B0\x65B0");
 
 	r = TheFs.SetVolumeLabel(KUnicodeVolumeLabel, driveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = TheFs.Volume(vInfo, driveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = vInfo.iName.Compare(KUnicodeVolumeLabel);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// Tests setting volume label with unicode characters that bigger than 11 bytes
 	_LIT(KVolumeLabelOverflow,		"\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0");
 	r = TheFs.SetVolumeLabel(KVolumeLabelOverflow, driveNum);
-	test_Value(r, r == KErrOverflow);
+	test(r==KErrOverflow);
 
 	// Sets back the original volume label
 	r = TheFs.SetVolumeLabel(originalVolumeLabel, driveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = TheFs.Volume(vInfo, driveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = vInfo.iName.Compare(originalVolumeLabel);
-	test_Value(r, r == 0);
+	test(r==0);
 #else
 	test.Printf(_L("Test only runs on DEBUG builds, see test logs of debug builds for details."));
 #endif  // _DEBUG) || _DEBUG_RELEASE
@@ -432,25 +432,25 @@
 	MakeFile_CPTest(KTestFileName4C8B);
 	MakeFile_CPTest(KTestFileName7C11B);
 	r = TheFs.GetShortName(KTestFileName7C11B, sn);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = sn.Compare(KTestFileName7C11B_short);
-	test_Value(r, r == 0);
+	test(r==0);
 
 
 	MakeFile_CPTest(KTestFileName8C12B);
 	r = TheFs.GetShortName(KTestFileName8C12B, sn);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = sn.Compare(KTestFileName8C12B_short);
-	test_Value(r, r == 0);
+	test(r==0);
 
 	r = TheFs.Delete(KTestFileName4C8B);
-	test_KErrNone(r);
+	test(r==KErrNone);
 		
 	r = TheFs.Delete(KTestFileName7C11B);
-	test_KErrNone(r);
+	test(r==KErrNone);
 		
 	r = TheFs.Delete(KTestFileName8C12B);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 #else
 	test.Printf(_L("Test only runs on DEBUG builds, see test logs of debug builds for details."));
@@ -509,15 +509,15 @@
 	TFileName sn;
 	
 	r = TheFs.GetShortName(KTestDirName7C11B, sn);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = sn.Compare(KTestDirName7C11B_short);
-	test_Value(r, r == 0);
+	test(r==0);
 
 	MakeDir(KTestDirName8C12B);
 	r = TheFs.GetShortName(KTestDirName8C12B, sn);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = sn.Compare(KTestDirName8C12B_short);
-	test_Value(r, r == 0);
+	test(r==0);
 
 #else
 	test.Printf(_L("Test only runs on DEBUG builds, see test logs of debug builds for details."));
@@ -552,9 +552,9 @@
 	MakeFile_CPTest(KTestFilePathAndName);
 	TFileName sn;
 	r = TheFs.GetShortName(KTestFilePathAndName, sn);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = sn.Compare(KTestFileShortName);
-	test_Value(r, r == 0);
+	test(r==0);
 
 #else
 	test.Printf(_L("Test only runs on DEBUG builds, see test logs of debug builds for details."));
@@ -587,14 +587,14 @@
 	
 	TFileName sn;
 	r = TheFs.GetShortName(KTestFilePathAndName, sn);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = sn.Compare(KTestFileName);
-	test_Value(r, r == 0);
+	test(r==0);
 	TFileName ln;
 	r = TheFs.GetLongName(KTestFilePathAndName, ln);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = ln.Compare(KTestFileName);
-	test_Value(r, r == 0);
+	test(r==0);
 
 #else
 	test.Printf(_L("Test only runs on DEBUG builds, see test logs of debug builds for details."));
@@ -624,12 +624,12 @@
 	TFileName fn = _L("\\ABCD");
 	
 	TInt r=file.Create(TheFs,fn,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	//	Assume this file is the first entry in the root directory
 	r=TheDisk.Open(TheFs,CurrentDrive());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
     //-- read the 1st dir entry, it should be a DOS entry 
     const TInt posEntry1=gBootSector.RootDirStartSector() << KDefaultSectorLog2; //-- dir entry1 position
@@ -665,9 +665,9 @@
 	
 	TEntry entry;
 	TInt err = TheFs.Entry(fn, entry);
-	test_KErrNone(err);
+	test(err==KErrNone);
 	err = TheFs.Delete(fn);
-	test_KErrNone(err);
+	test(err==KErrNone);
 #else
 	test.Printf(_L("Test only runs on DEBUG builds, see test logs of debug builds for details."));
 #endif  // _DEBUG) || _DEBUG_RELEASE
@@ -697,13 +697,13 @@
 	
 	test.Next(_L("create file \"AB\" under root directory"));
 	TInt r=file.Create(TheFs,fn,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	test.Next(_L("manually change file name to \"0x7F0x450x7F0x45\" via raw disk accessing"));
 	//	Assume this file is the first entry in the root directory
 	r=TheDisk.Open(TheFs,CurrentDrive());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
     //-- read the first dir entry, it should be a DOS entry 
     const TInt posEntry1=gBootSector.RootDirStartSector() << KDefaultSectorLog2; //-- dir entry1 position
@@ -783,15 +783,15 @@
 	_LIT(KShortName, "\x3055\x307E\x3056~1");
 	TFileName sn;
 	r = TheFs.GetShortName(fn, sn);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = sn.Compare(KShortName);
-	test_Value(r, r == 0);
+	test(r==0);
 	
 	r = TheFs.ScanDrive(_L("gSessionPath"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r = TheFs.Delete(fn);
-	test_KErrNone(r);
+	test(r == KErrNone);
 #else
 	test.Printf(_L("Test only runs on DEBUG builds, see test logs of debug builds for details."));
 #endif  // _DEBUG) || _DEBUG_RELEASE
--- a/kerneltest/f32test/server/t_dcallcaps.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_dcallcaps.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -13,7 +13,6 @@
 // Description:
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32std.h>
@@ -77,6 +76,9 @@
 TRequestStatus aStat3;
 TRequestStatus aStat4;
 
+TVolumeInfo aVolInfo;
+//	TDriveInfo adriveInfo;
+
 TBuf<40> systestfile;
 TBuf<40> pritestfile;
 TBuf<40> restestfile;
@@ -103,22 +105,22 @@
 	mkdirname.Append(systestname);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.RmDir(mkdirname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(systestname,EDriveO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(_L(""),EDriveO); //to unsubst
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(systestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TheFs.NotifyChange(ENotifyAll,aStat1,systestname);
 	test(aStat1==KRequestPending);
@@ -133,29 +135,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(systestfile, shortfilename);
-	test_Value(r, r == KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(systestfile1, longfilename);
-	test_Value(r, r == KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,systestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Rename(systestfile,systestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Entry(systestfile1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetEntry(systestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(systestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 LOCAL_C void ResourceRFsTest()
@@ -170,22 +172,22 @@
 	mkdirname.Append(restestname);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.RmDir(mkdirname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(restestname,EDriveO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(_L(""),EDriveO); 
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(restestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TheFs.NotifyChange(ENotifyAll,aStat4,restestname);
 	test(aStat4==KRequestPending);
@@ -200,29 +202,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(restestfile, shortfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(restestfile1, longfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,restestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Rename(restestfile,restestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Entry(restestfile1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetEntry(restestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(restestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	}
 
@@ -241,22 +243,22 @@
 	mkdirname.Append(KMkDirSub);
 
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(pritestfalseidname,EDriveO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(_L(""),EDriveO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(pritestfalseidname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyAll,aStat2,pritestfalseidname);
 	test(aStat2==KRequestPending);
@@ -272,29 +274,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(pritestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	}
 
@@ -314,22 +316,22 @@
 	mkdirname.Append(KMkDirSub);
 
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(pritestname,EDriveO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(_L(""),EDriveO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(pritestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyAll,aStat2,pritestname);
 	test(aStat2==KRequestPending);
@@ -345,29 +347,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(pritestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	}
 
@@ -381,22 +383,22 @@
 	mkdirname.Append(theprivatepath);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(theprivatepath,EDriveO);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(_L(""),EDriveO);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(theprivatepath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyAll,aStat3,theprivatepath);
 	test(aStat3==KRequestPending);
@@ -411,29 +413,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(pritestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 
@@ -444,29 +446,29 @@
 	{
 
 	r=TheFs.SetSessionPath(systestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.Temp(TheFs,systestname,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFileSys,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileSys,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileSys,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Replace(TheFs,KFileSys,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Rename(KFileSys3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
     TFindFile finder(TheFs);
@@ -474,7 +476,7 @@
     r=finder.FindWildByDir(KWildFile, KWildPath, dir);
 	if (!(r==KErrNone))
         test.Printf(_L("T_DCALLCAPS: test find wildcards r = %d (expected KErrNone)\n"), r);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	delete dir;
 	}
 
@@ -484,40 +486,40 @@
 //
 	{
 	r=TheFs.SetSessionPath(restestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.Temp(TheFs,restestname,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFileRes,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes,EFileWrite|EFileShareExclusive );
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Rename(KFileRes3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes3,EFileShareReadersOrWriters|EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes3,EFileShareReadersOrWriters|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes3,EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.ChangeMode(EFileShareExclusive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Replace(TheFs,KFileRes,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();	
 	}
 
@@ -528,29 +530,29 @@
 //
 	{
 	r=TheFs.SetSessionPath(pritestfalseidname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.Temp(TheFs,pritestfalseidname,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFilePri,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Replace(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Rename(KFilePri3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	}
 
@@ -560,29 +562,29 @@
 //
 	{
 	r=TheFs.SetSessionPath(pritestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.Temp(TheFs,pritestname,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Open(TheFs,KFilePri,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Replace(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Rename(KFilePri3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	}
 
@@ -594,29 +596,29 @@
 //
 	{
 	r=TheFs.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Temp(TheFs,theprivatepath,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Open(TheFs,KFilePri,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Replace(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Rename(KFilePri3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	}
 
@@ -631,30 +633,30 @@
 	TBuf<30> dirNameBuf(KSystemPath);
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dirNameBuf.Zero();
 	delete dirEntries;
 	//Private//falseID
 	dirNameBuf=KPrivateFalseID;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dirNameBuf.Zero();
 	delete dirEntries;
 	//Private
 	dirNameBuf=KPrivatePath;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dirNameBuf.Zero();
 	delete dirEntries;
 	//Private/uid
@@ -662,19 +664,19 @@
 	dirNameBuf.Insert(0,_L("?:"));
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dirNameBuf.Zero();
 	delete dirEntries;
 	//Resource
 	dirNameBuf=KResourcePath;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	delete dirEntries;
 	}
@@ -686,20 +688,20 @@
 //
 	{
 	r=TheFs.FileSystemName(fsname,gTheDriveNum);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 	r=DismountFileSystem(TheFs, fsname,gTheDriveNum);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 //	r=TheFs.RemoveFileSystem(fsname);	//can not test due to bug else where fix exists
-//	test_KErrNone(r);
+//	test(r==KErrNone);
 //	r=TheFs.AddFileSystem(fsname);
-//	test_KErrNone(r);
+//	test(r==KErrNone);
 	r=MountFileSystem(TheFs,fsname,gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetDriveName(gTheDriveNum,KDriveName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 #ifndef __WINS__
  	r=TheFs.SetVolumeLabel(KVolLable, gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 #endif
 
 	systemRFsTest();
@@ -725,11 +727,11 @@
 	test(aStat4==KErrNone);
 
 	r=TheFs.SetSessionPath(systestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 //Test RRawDisk class
 	r=rawdisk.Open(TheFs,gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	rawdisk.Close();
 
 	RDirtest();
@@ -740,21 +742,21 @@
 		{
 		//Test RFormat class
 		r=format.Open(TheFs,driveBuf,EHighDensity,count);
-		test_KErrNone(r);
+		test(r==KErrNone);
 
 		while(count)	
 			{
 			TInt r=format.Next(count);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			}
 		format.Close();
 		}
 
 	driveBuf[0]=(TText)gDriveToTest;
 	r=TheFs.ScanDrive(driveBuf);
-	test_Value(r, r == KErrNone || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotSupported);
 	r=TheFs.CheckDisk(driveBuf);
-	test_Value(r, r == KErrNone || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotSupported);
 	}
 
 LOCAL_C void TestCaps()
@@ -775,16 +777,16 @@
 
 	driveBuf[0]=(TText)gDriveToTest;
 	r=TheFs.SessionPath(temp);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Printf(_L("Session path: %S"),&temp);
 
 	r=TheFs.CreatePrivatePath(gTheDriveNum);
-	test_Value(r, r == KErrNone || r== KErrAlreadyExists);
+	test(r==KErrNone || r== KErrAlreadyExists);
 
 	TBuf<18> tempPri;
 	r=TheFs.PrivatePath(tempPri);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	theprivatepath = _L("?:");
 	theprivatepath.Append(tempPri);
 
@@ -793,9 +795,9 @@
 	TFileName thesessionpath;
 
 	r=TheFs.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SessionPath(thesessionpath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	test(thesessionpath == theprivatepath);
 	}
@@ -808,7 +810,7 @@
 	test.Next(_L("Delete test directory"));
 	CFileMan* fMan=CFileMan::NewL(TheFs);
 	TInt r=fMan->RmDir(gSessionPath);
-	test_Value(r, r == KErrNone || r == KErrPathNotFound);
+	test(r==KErrNone || KErrPathNotFound);
 	delete fMan;
 	}
 
@@ -825,7 +827,7 @@
 	sesspath[0] = (TText)gDriveToTest;
 
 	TInt r= TheFs.SetSessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	//cleanup from previous run of this test
 	TBuf<20> delDir;
@@ -833,15 +835,15 @@
 	delDir=KResourcePath;
 	delDir[0]=(TText)gDriveToTest;
 	r=fMan->RmDir(delDir);
-	test_Value(r, r == KErrNone || r == KErrNotFound);
+	test(r==KErrNone || KErrNotFound);
 	delDir=KSystemPath;
 	delDir[0]=(TText)gDriveToTest;
 	r=fMan->RmDir(delDir);
-	test_Value(r, r == KErrNone || r == KErrNotFound);
+	test(r==KErrNone || KErrNotFound);
 	delDir=KPrivatePath;
 	delDir[0]=(TText)gDriveToTest;
 	r=fMan->RmDir(delDir);
-	test_Value(r, r == KErrNone || r == KErrNotFound);
+	test(r==KErrNone || KErrNotFound);
 	delete fMan;
 
 	//check double mode ie that Defpath still works	
@@ -849,30 +851,30 @@
 	RFs fs2;
 	
 	r=fs1.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs1.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("session1 Path=%S"),&sesspath);
 
 	TBuf<30> privatepath;
 	r=fs1.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs1.PrivatePath(privatepath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=privatepath.Compare(KExpectedPrivatePath());
-	test_Value(r, r == 0);
+	test(r==0);
 	r=fs1.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=privatepath.Compare(sesspath.Mid(KPathPosition));
-	test_Value(r, r == 0);
+	test(r==0);
 	r=fs1.CreatePrivatePath(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fs1.Close();
 
 	r=fs2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs2.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("session2 Path=%S"),&sesspath);
 	fs2.Close();
 
--- a/kerneltest/f32test/server/t_dcallfiles.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_dcallfiles.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -13,7 +13,6 @@
 // Description:
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32std.h>
@@ -89,6 +88,9 @@
 TRequestStatus aStat3;
 TRequestStatus aStat4;
 
+TVolumeInfo aVolInfo;
+//	TDriveInfo adriveInfo;
+
 TBuf<40> systestfile;
 TBuf<40> pritestfile;
 TBuf<40> restestfile;
@@ -111,13 +113,13 @@
 //
     {
     TInt r = TheFs.Rename(_L("\\sys"), _L("\\sysbad"));
-    test_Value(r, r == KErrPermissionDenied);
+    test(r == KErrPermissionDenied);
     r = TheFs.Rename(_L("\\resource"), _L("\\resourcebad"));
-    test_Value(r, r == KErrPermissionDenied);
+    test(r == KErrPermissionDenied);
     r = TheFs.Rename(_L("\\private"), _L("\\privatebad"));
-    test_KErrNone(r);
+    test(r == KErrNone);
     r = TheFs.Rename(_L("\\privatebad"), _L("\\private"));
-    test_KErrNone(r);
+    test(r == KErrNone);
     }
 
 LOCAL_C void systemRFstest()
@@ -133,16 +135,16 @@
 	mkdirname.Append(systestname);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetSubst(systestname,EDriveO);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.SetSessionPath(systestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyAll,aStat1,systestname);
 	test(aStat1==KRequestPending);		
@@ -157,29 +159,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(systestfile, shortfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(systestfile1, longfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,systestfile);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Rename(systestfile,systestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Entry(systestfile1,entry);
-	test_Value(r, r == KErrNone || r==KErrNotFound);	
+	test(r==KErrNone || r==KErrNotFound);	
 
 	r=TheFs.SetEntry(systestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.Delete(systestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	}
 
@@ -197,20 +199,20 @@
 	mkdirname.Append(restestname);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	TheFs.RmDir(mkdirname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 
 	r=TheFs.SetSubst(restestname,EDriveO);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(restestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TheFs.NotifyChange(ENotifyAll,aStat4,restestname);
 	test(aStat4==KRequestPending);
@@ -226,29 +228,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(restestfile, shortfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(restestfile1, longfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,restestfile);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Rename(restestfile,restestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Entry(restestfile1,entry);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 
 	r=TheFs.SetEntry(restestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.Delete(restestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	}
 
@@ -267,19 +269,19 @@
 	mkdirname.Append(KMkDirSub);
 
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone );
 
 	r=TheFs.RmDir(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone );
 
 	r=TheFs.SetSubst(pritestfalseidname,EDriveO);
-	test_Value(r, r == KErrPermissionDenied); 
+	test(r==KErrPermissionDenied); 
 
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(pritestfalseidname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyAll,aStat2,pritestfalseidname);
 	test(aStat2==KRequestPending);
@@ -294,29 +296,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(pritestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	}
 
@@ -335,19 +337,19 @@
 	mkdirname.Append(KMkDirSub);
 
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone );
 
 	r=TheFs.RmDir(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone );
 
 	r=TheFs.SetSubst(pritestname,EDriveO);
-	test_Value(r, r == KErrPermissionDenied); 
+	test(r==KErrPermissionDenied); 
 
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(pritestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyAll,aStat2,pritestname);
 	test(aStat2==KRequestPending);
@@ -362,29 +364,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(pritestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	}
 
@@ -403,19 +405,19 @@
 	mkdirname.Append(theprivatepath);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(theprivatepath,EDriveO);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(theprivatepath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyAll,aStat3,theprivatepath);
 	test(aStat3==KRequestPending);
@@ -430,29 +432,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(pritestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	}
 
@@ -465,10 +467,10 @@
 
 
 	r=TheFs.SetSessionPath(systestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.Temp(TheFs,systestname,fromTemp,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 
 	TBuf<25> sysfilename;
@@ -476,36 +478,36 @@
 	sysfilename.Append(KFileSys);
 
 	r=file1.Create(TheFs,sysfilename,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Open(TheFs,sysfilename,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	// DEF113117
 	r=file1.Open(TheFs, KSysBinFile, EFileShareReadersOnly | EFileRead | EFileReadBuffered);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs, KSysBinFile, EFileStreamText | EFileReadBuffered | EFileReadAheadOn);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs, KSysBinFile, EFileStreamText | EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,sysfilename,EFileRead);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 
 	r=file1.Replace(TheFs,sysfilename,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
     TFindFile finder(TheFs);
     CDir* dir = NULL;
     r=finder.FindWildByDir(KWildFile, KWildPath, dir);
 	if (!(r==KErrNone))
         test.Printf(_L("T_DCALLFILES: test find wildcards r = %d (expected KErrNone)\n"), r);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 	delete dir;
 	}
 
@@ -517,45 +519,45 @@
 	{
 
 	r=TheFs.SetSessionPath(restestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.Temp(TheFs,restestname,fromTemp,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFileRes,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes,EFileRead|EFileShareReadersOnly);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes,EFileShareReadersOrWriters|EFileRead);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes,EFileShareReadersOrWriters|EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes,EFileShareReadersOnly);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 
 	r=file1.ChangeMode(EFileShareExclusive);	//this is not illegal though will prevent shared access to resource which is nit my fault but may be desirable to prevent
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	//this operation is prevented as you can not open a file for write access in the resource directory
 	r=file1.Rename(KFileRes3);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=file1.Replace(TheFs,KFileRes,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();	
 
 	}
@@ -568,29 +570,29 @@
 	{
 
 	r=TheFs.SetSessionPath(pritestfalseidname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.Temp(TheFs,pritestfalseidname,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Open(TheFs,KFilePri,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 		
 	r=file1.Replace(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Rename(KFilePri3);
-	test_Value(r, r == KErrNone || r== KErrAlreadyExists);
+	test(r==KErrNone || r== KErrAlreadyExists);
 	file1.Close();
 	}
 
@@ -603,29 +605,29 @@
 	{
 
 	r=TheFs.SetSessionPath(pritestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.Temp(TheFs,pritestname,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Open(TheFs,KFilePri,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Replace(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Rename(KFilePri3);
-	test_Value(r, r == KErrNone || r== KErrAlreadyExists);
+	test(r==KErrNone || r== KErrAlreadyExists);
 	file1.Close();
 	}
 
@@ -638,29 +640,29 @@
 //Rfile Testing with session path set to //Private//UID//
 
 	r=TheFs.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 		
 	r=file1.Temp(TheFs,theprivatepath,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Open(TheFs,KFilePri,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 		
 	r=file1.Replace(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Rename(KFilePri3);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	}
@@ -676,11 +678,11 @@
 	dirNameBuf = KSystemPath;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 	dir.Close();
 
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	delete dirEntries;
 
 	dirNameBuf.Zero();
@@ -688,20 +690,20 @@
 	dirNameBuf=KPrivateFalseID;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dirNameBuf.Zero();
 	delete dirEntries;
 	//Private
 	dirNameBuf=KPrivatePath;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dirNameBuf.Zero();
 	delete dirEntries;
 	//Private/uid
@@ -709,20 +711,20 @@
 	dirNameBuf.Insert(0,_L("?:"));
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dirNameBuf.Zero();
 	delete dirEntries;
 	//Resource
 	dirNameBuf=KResourcePath;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	delete dirEntries;
 	dir.Close();
 	}
@@ -737,19 +739,19 @@
 //
 	{
 	r=TheFs.FileSystemName(fsname,gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.DismountFileSystem(fsname,gTheDriveNum);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 //	r=TheFs.RemoveFileSystem(fsname);	//can not test due to bug else where fix exists
-//	test_Value(r, r == KErrPermissionDenied);
+//	test(r==KErrPermissionDenied);
 //	r=TheFs.AddFileSystem(fsname);
-//	test_Value(r, r == KErrPermissionDenied);
+//	test(r==KErrPermissionDenied);
 	r=TheFs.MountFileSystem(fsname,gTheDriveNum);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	r=TheFs.SetDriveName(gTheDriveNum,KDriveName);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 //	r=TheFs.SetVolumeLabel(KVolLable, gTheDriveNum);
-//	test_KErrNone(r);
+//	test(r==KErrNone);
 
 	systemRFstest();
 	resourceRFstest();
@@ -779,22 +781,22 @@
 	
 
 	r=TheFs.SetSessionPath(systestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 //Test RRawDisk class
 	r=rawdisk.Open(TheFs,gTheDriveNum);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=format.Open(TheFs,driveBuf,EHighDensity,count);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	RDirtest();
 
 	driveBuf[0]=(TText)gDriveToTest;
 	r=TheFs.ScanDrive(driveBuf);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	r=TheFs.CheckDisk(driveBuf);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	}
 
 LOCAL_C void TestCaps()
@@ -810,16 +812,16 @@
 
 	driveBuf[0]=(TText)gDriveToTest;
 	r=TheFs.SessionPath(temp);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Printf(_L("Session path: %S"),&temp);
 
 	r=TheFs.CreatePrivatePath(gTheDriveNum);
-	test_Value(r, r == KErrNone || r== KErrAlreadyExists);
+	test(r==KErrNone || r== KErrAlreadyExists);
 
 	TBuf<18> tempPri;
 	r=TheFs.PrivatePath(tempPri);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	theprivatepath = _L("?:");
 	theprivatepath.Append(tempPri);
 
@@ -827,9 +829,9 @@
 
 	TFileName thesessionpath;
 	r=TheFs.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SessionPath(thesessionpath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(thesessionpath == theprivatepath);
 	}
 
@@ -839,16 +841,16 @@
 	{
 	CDirScan* scanner = NULL;
 	TRAP(r, scanner = CDirScan::NewL(TheFs));
-	test_Value(r, r == KErrNone && scanner);
+	test(r == KErrNone && scanner);
 
 	TRAP(r, scanner->SetScanDataL(aName,KEntryAttDir,ESortByName|EAscending,aDirection));
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	CDir *entryList=NULL;
 	for (;;)
 		{
 		TRAP(r, scanner->NextL(entryList));
-		test_Value(r, r == aError);
+		test(r == aError);
 		if (entryList==NULL)
 			break;
 		TInt count=entryList->Count();
@@ -886,11 +888,11 @@
 		test.Printf(_L("Private Path is=%S"),&privatepath);
 		
 		r = TheFs.MkDir(_L("\\Caged\\"));
-		test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+		test(r==KErrNone || r==KErrAlreadyExists);
 		
 		CDir* entryCount=NULL;
 		r=TheFs.GetDir(_L("\\*.*"),KEntryAttNormal,ESortNone,entryCount);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		TInt rootCount= entryCount->Count();
 		
 		delete entryCount;
@@ -900,12 +902,12 @@
 		//Testing Copy
 		CDir* entryCount2=NULL;
 		r=fMan->Copy(_L("\\sys\\"),_L("\\Caged\\"));
-		test_Value(r, r == KErrNotFound);
+		test(r == KErrNotFound);
 		r=fMan->Copy(_L("\\*"),_L("\\Caged\\"));
-		test_KErrNone(r);
+		test(r == KErrNone);
 		
 		r=TheFs.GetDir(_L("\\Caged\\*.*"),KEntryAttNormal,ESortNone,entryCount2);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		TInt cagedCount= entryCount2->Count();
 		
 		test(cagedCount==rootCount);
@@ -915,12 +917,12 @@
 
 	
 		r=fMan->Copy(_L("\\private\\two\\moo"),_L("\\private\\two\\mew")); 
-		test_Value(r, r == KErrPathNotFound);
+		test(r == KErrPathNotFound);
 	
 		// Create a test file
 		RFile testFile;
 		r = testFile.Replace(TheFs, _L("\\capTest"),EFileWrite);
-		test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+		test(r==KErrNone || r==KErrAlreadyExists);
 		testFile.Close();
 		
 		TFileName name;
@@ -928,90 +930,90 @@
 		name.Append(_L("privateFile.tst"));
 		RFile privateFile;
 		r = privateFile.Replace(TheFs, name,EFileWrite);
-		test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+		test(r==KErrNone || r==KErrAlreadyExists);
 		privateFile.Close();
 
 	
 		r=fMan->Copy(_L("\\capTest"),_L("\\private\\to\\moo")); 
-		test_Value(r, r == KErrPathNotFound);
+		test(r == KErrPathNotFound);
 		r=fMan->Copy(_L("\\capTest"),_L("\\sys\\bin\\moo")); 
-		test_Value(r, r == KErrPermissionDenied); 
+		test(r == KErrPermissionDenied); 
 		r=fMan->Copy(_L("\\sys\\bin\\capTest"),_L("\\sys\\bin\\moo"));
-		test_Value(r, r == KErrPathNotFound); 
+		test(r == KErrPathNotFound); 
 		r=fMan->Copy(_L("\\sys\\*"),_L("\\"));
-		test_Value(r, r == KErrNone || r==KErrNotFound);
+		test (r==KErrNone || r==KErrNotFound);
 		r=fMan->Copy(name,_L("\\sys\\"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r==KErrPermissionDenied);
 		
 		// Testing Move
 		r=fMan->Move(_L("\\capTest"),_L("\\private\\wst\\moo"), CFileMan::ERecurse); // Recurse flag needed as destination path does not exist.
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Move(_L("\\sys\\bin\\capTest"),_L("\\sys\\bin\\moo"));
-		test_Value(r, r == KErrPathNotFound); 
+		test(r == KErrPathNotFound); 
 		r=fMan->Move(_L("\\sys\\*"),_L("\\"));
-		test_Value(r, r == KErrNone || r==KErrNotFound);
+		test (r==KErrNone || r==KErrNotFound);
 		r=fMan->Move(name,_L("\\sys\\"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r==KErrPermissionDenied);
 		r=fMan->Move(_L("\\private\\two\\moo"),_L("\\private\\one\\moo"));
-		test_Value(r, r == KErrPathNotFound);
+		test(r == KErrPathNotFound);
 		r=fMan->Move(_L("\\private\\two\\moo.."),_L("\\private\\one\\moo"));
-		test_Value(r, r == KErrPathNotFound);
+		test(r == KErrPathNotFound);
 		r=fMan->Move(_L("\\private\\two\\moo"),_L("\\private\\one\\moo.."));
-		test_Value(r, r == KErrPathNotFound);
+		test(r == KErrPathNotFound);
 		r=fMan->Move(name,_L("\\privateFile.tst"));
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Move(_L("\\privateFile.tst"),name);
-		test_KErrNone(r);
+		test(r == KErrNone);
 
 		
 		// Testing Attribs
 		r=fMan->Attribs(_L("\\private\\two\\moo"),KEntryAttReadOnly,0,TTime(0)); 
-		test_Value(r, r == KErrPathNotFound);
+		test(r == KErrPathNotFound);
 		r=fMan->Attribs(_L("\\private\\moo"),KEntryAttReadOnly,0,TTime(0)); 
-		test_Value(r, r == KErrNotFound);
+		test(r == KErrNotFound);
 		r=fMan->Attribs(name,KEntryAttReadOnly,0,TTime(0));
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Attribs(name,0,KEntryAttReadOnly,TTime(0));
-		test_KErrNone(r);		
+		test(r == KErrNone);		
 
 		// Testing RmDir
 		r=fMan->RmDir(_L("\\private\\"));
-		test_KErrNone(r);
+		test(r == KErrNone);
 		// put it back where it was
 		r = TheFs.MkDirAll(_L("\\private\\00000001\\"));
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->RmDir(_L("\\private\\two\\"));
-		test_Value(r, r == KErrPathNotFound);
+		test(r == KErrPathNotFound);
 		r=fMan->RmDir(_L("\\private\\tw?\\"));
-		test_Value(r, r == KErrBadName);
+		test(r == KErrBadName);
 		r=fMan->RmDir(_L("\\sys\\"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		
 		// Testing Rename
 		r=fMan->Rename(_L("\\private\\two\\moo"),_L("\\private\\two\\mew")); 
-		test_Value(r, r == KErrPathNotFound);
+		test(r == KErrPathNotFound);
 		
 		// Testing Delete
 		r=fMan->Delete(_L("\\private\\two\\test")); 
-		test_Value(r, r == KErrPathNotFound);
+		test(r == KErrPathNotFound);
 		r=fMan->Delete(_L("\\private\\moo")); 
-		test_Value(r, r == KErrNotFound);
+		test(r == KErrNotFound);
 		
 		//Something that actually exists in Private
 		r=fMan->Rename(name,_L("\\private\\00000001\\moo")); 
-		test_Value(r, r == KErrNotFound); //deleted the file previously
+		test(r == KErrNotFound); //deleted the file previously
 		r=fMan->Rename(_L("\\private\\00000001\\moo"),name); 
-		test_Value(r, r == KErrNotFound);
+		test(r == KErrNotFound);
 		r=fMan->Copy(name,_L("\\private\\00000001\\moo")); 
-		test_Value(r, r == KErrNotFound);
+		test(r == KErrNotFound);
 		r=fMan->Delete(_L("\\private\\00000001\\moo")); 
-		test_Value(r, r == KErrNotFound);
+		test(r == KErrNotFound);
 
 		// Clean up the test data
 		r=fMan->RmDir(_L("\\Caged\\")); 
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Delete(_L("\\capTest")); 
-		test_Value(r, r == KErrNone || r == KErrNotFound);
+		test(r == KErrNone || KErrNotFound);
 		delete(fMan);
 		}
 	
@@ -1032,7 +1034,7 @@
 	test.Next(_L("Delete test directory"));
 	CFileMan* fMan=CFileMan::NewL(TheFs);
 	TInt r=fMan->RmDir(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	delete fMan;
 	}
 
@@ -1056,14 +1058,14 @@
 	sesspath[0] = (TText)gDriveToTest;
 
 	TInt r= TheFs.SetSessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TBuf<2> cmd;
 	cmd.SetLength(1);
 	cmd[0] = (TText)gDriveToTest;
 	RProcess tp;
 	r=tp.Create(_L("clean_prepdc.exe"),sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	{
 	TRequestStatus ps;
 	tp.Logon(ps);
@@ -1077,30 +1079,30 @@
 	RFs fs2;
 	
 	r=fs1.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs1.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("session1 Path=%S"),&sesspath);
 
 	TBuf<30> privatepath;
 	r=fs1.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs1.PrivatePath(privatepath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=privatepath.Compare(KExpectedPrivatePath());
-	test_Value(r, r == 0);
+	test(r==0);
 	r=fs1.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=privatepath.Compare(sesspath.Mid(KPathPosition));
-	test_Value(r, r == 0);
+	test(r==0);
 	r=fs1.CreatePrivatePath(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fs1.Close();
 
 	r=fs2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs2.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("session2 Path=%S"),&sesspath);
 	fs2.Close();
 
--- a/kerneltest/f32test/server/t_dcdiskadmin.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_dcdiskadmin.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32std.h>
@@ -76,6 +75,9 @@
 TRequestStatus aStat3;
 TRequestStatus aStat4;
 
+TVolumeInfo aVolInfo;
+//	TDriveInfo adriveInfo;
+
 TBuf<40> systestfile;
 TBuf<40> pritestfile;
 TBuf<40> restestfile;
@@ -106,16 +108,16 @@
 	mkdirname.Append(systestname);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetSubst(systestname,EDriveS);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.SetSessionPath(systestname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	TheFs.NotifyChange(ENotifyAll,aStat1,systestname);
 	test(aStat1==KErrPermissionDenied);
@@ -130,29 +132,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(systestfile, shortfilename);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.GetLongName(systestfile1, longfilename);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,systestfile);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Rename(systestfile,systestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Entry(systestfile1,entry);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetEntry(systestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.Delete(systestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 
 	// DEF141257: Security Issue in File Server 
@@ -166,24 +168,24 @@
 	SysTestFileDot.Append(KFileSys);
 	RFile file;
 	r = file.Replace(TheFs, SysTestFileDot, EFileWrite);
-	test_Value(r, r == KErrPathNotFound);
+	test(r==KErrPathNotFound);
 
 	// try creating a subst drive for "\.SYS"...
 	TBuf<40> SysTestNameDot;
 	SysTestNameDot=KSystemPathDot;
 	SysTestNameDot[0]=(TText)('A' + gTheDriveNum);
 	r=TheFs.SetSubst(SysTestNameDot,EDriveA);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// try creating a file using substituted drive...
 	TBuf<40> SubstTestFile = _L("A:\\");
 	SubstTestFile.Append(KFileSys);
 
 	r = file.Replace(TheFs, SubstTestFile, EFileWrite);
-	test_Value(r, r == KErrPathNotFound);
+	test(r==KErrPathNotFound);
 
 	r = TheFs.SetSubst(_L(""),EDriveA);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 
 
@@ -192,7 +194,7 @@
 	TFindFile finder(TheFs);
 	CDir* dir = NULL;
 	r=finder.FindWildByDir(KWildFile, KWildPathDot, dir);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	delete dir;
 
 	// Deliberately create a directory called "\.SYS"
@@ -201,17 +203,17 @@
 	mkdirname.Append(KSystemPathDot);
 	mkdirname[0]=(TText)('A' + gTheDriveNum);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.GetShortName(mkdirname, shortfilename);
-	test_Value(r, r == KErrNone || r==KErrNotSupported);	// short names not supported on LFFS
+	test(r==KErrNone || r==KErrNotSupported);	// short names not supported on LFFS
 //	r = shortfilename.Compare(_L("SYS~1"));
-//	test_KErrNone(r);
+//	test(r==KErrNone);
 	r = shortfilename.Compare(_L("SYS"));
 	test (r != 0);
 
 	r = TheFs.RmDir(mkdirname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// Deliberately create a directory called "\..SYS"
 	// and verify shortname is NOT the same as "SYS"
@@ -220,17 +222,17 @@
 	mkdirname.Append(KSystemPathDotDot);
 	mkdirname[0]=(TText)('A' + gTheDriveNum);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.GetShortName(mkdirname, shortfilename);
-	test_Value(r, r == KErrNone || r==KErrNotSupported);	// short names not supported on LFFS
+	test(r==KErrNone || r==KErrNotSupported);	// short names not supported on LFFS
 //	r = shortfilename.Compare(_L("_.SYS"));
-//	test_KErrNone(r);
+//	test(r==KErrNone);
 	r = shortfilename.Compare(_L("SYS"));
 	test (r != 0);
 
 	r = TheFs.RmDir(mkdirname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 
@@ -247,26 +249,26 @@
 	mkdirname.Append(restestname);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	TheFs.RmDir(mkdirname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	// Change due to defect DEF099546 fix
 	// TCB capability is required for following operation.
 	r=TheFs.SetSubst(restestname,EDriveS);
-	//test_KErrNone(r);
-	test_Value(r, r == KErrPermissionDenied);
+	//test(r==KErrNone);
+	test(r==KErrPermissionDenied);
 	
 	// SetSubst will fail.
 	//r=TheFs.RealName(_L("S:\\File.XXX"),realName);
-	//test_KErrNone(r);
+	//test(r==KErrNone);
 
 	//r=TheFs.SetSubst(_L(""),EDriveS); 
-	//test_KErrNone(r);
+	//test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(restestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TheFs.NotifyChange(ENotifyAll,aStat4,restestname);
 	test(aStat4==KRequestPending);
@@ -282,32 +284,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(restestfile, shortfilename);
-	test(r == KErrNone || KErrPathNotFound);
-//	test_Value(r, r == KErrNone || r == KErrPathNotFound);
+	test(r==KErrNone || KErrPathNotFound);
 
 	r=TheFs.GetLongName(restestfile1, longfilename);
-	test(r == KErrNone || KErrPathNotFound);
-//	test_Value(r, r == KErrNone || r == KErrPathNotFound);
+	test(r==KErrNone || KErrPathNotFound);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,restestfile);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Rename(restestfile,restestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Entry(restestfile1,entry);
-	test(r == KErrNone || KErrPathNotFound);
-//	test_Value(r, r == KErrNone || r == KErrPathNotFound);
+	test(r==KErrNone || KErrPathNotFound);
 
 	r=TheFs.SetEntry(restestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.Delete(restestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	}
 
 
@@ -324,16 +323,16 @@
 	mkdirname.Append(KMkDirSub);
 
 	r=TheFs.MkDirAll(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetSubst(pritestfalseidname,EDriveS);
-	test_Value(r, r == KErrPermissionDenied); 
+	test(r==KErrPermissionDenied); 
 	
 	r=TheFs.SetSessionPath(pritestfalseidname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	TheFs.NotifyChange(ENotifyAll,aStat2,pritestfalseidname);
 	test(aStat2==KErrPermissionDenied);
@@ -348,29 +347,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.Delete(pritestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	}
 
@@ -390,16 +389,16 @@
 	mkdirname.Append(KMkDirSub);
 
 	r=TheFs.MkDirAll(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetSubst(pritestname,EDriveS);
-	test_Value(r, r == KErrPermissionDenied); 
+	test(r==KErrPermissionDenied); 
 	
 	r=TheFs.SetSessionPath(pritestname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	TheFs.NotifyChange(ENotifyAll,aStat2,pritestname);
 	test(aStat2==KErrPermissionDenied);
@@ -414,29 +413,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.Delete(pritestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	}
 
@@ -454,22 +453,22 @@
 	mkdirname.Append(theprivatepath);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(theprivatepath,EDriveS);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.RealName(_L("S:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(_L(""),EDriveS);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.SetSessionPath(theprivatepath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyAll,aStat3,theprivatepath);
 	test(aStat3==KRequestPending);
@@ -484,31 +483,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test(r == KErrNone || KErrPathNotFound);
-//	test_Value(r, r == KErrNone || r == KErrPathNotFound);
+	test(r==KErrNone || KErrPathNotFound);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test(r == KErrNone || KErrPathNotFound);
-//	test_Value(r, r == KErrNone || r == KErrPathNotFound);
+	test(r==KErrNone || KErrPathNotFound);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(pritestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 LOCAL_C void systemRFiletest()
@@ -519,32 +516,32 @@
 //RFile testing with session path set to //system//
 
 	r=TheFs.SetSessionPath(systestname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Temp(TheFs,systestname,fromTemp,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	TBuf<25> sysfilename;
 	sysfilename.Append(systestname);
 	sysfilename.Append(KFileSys);
 	r=file1.Create(TheFs,sysfilename,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Open(TheFs,sysfilename,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Open(TheFs,sysfilename,EFileRead);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Replace(TheFs,sysfilename,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
     TFindFile finder(TheFs);
     CDir* dir = NULL;
     r=finder.FindWildByDir(KWildFile, KWildPath, dir);
 	if (!(r==KErrPermissionDenied))
         test.Printf(_L("T_DCDISKADMIN: test find wildcards r = %d (expected KErrPermissionDenied)\n"), r);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	delete dir;
 	}
 
@@ -555,45 +552,45 @@
 	{
 //RFile testing with session path set to //resource//
 	r=TheFs.SetSessionPath(restestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.Temp(TheFs,restestname,fromTemp,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFileRes,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes,EFileRead|EFileShareReadersOnly);
-	test_Value(r, r == KErrNone || r==KErrPathNotFound);
+	test(r==KErrNone || r==KErrPathNotFound);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes,EFileShareReadersOrWriters|EFileRead);
-	test_Value(r, r == KErrNone || r==KErrPathNotFound);
+	test(r==KErrNone || r==KErrPathNotFound);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes,EFileShareReadersOrWriters|EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes,EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.ChangeMode(EFileShareExclusive);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	//this operation is prevented as you can not open a file for write access in the resource directory
 	r=file1.Rename(KFileRes3);
-	test_Value(r, r == KErrPermissionDenied || r==KErrAccessDenied);
+	test(r==KErrPermissionDenied || r==KErrAccessDenied);
 	file1.Close();
 
 	r=file1.Replace(TheFs,KFileRes,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	}
@@ -605,26 +602,26 @@
 //
 	{
 	r=TheFs.SetSessionPath(pritestfalseidname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Temp(TheFs,pritestfalseidname,fromTemp,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	TBuf<25> prifilename;
 	prifilename.Append(pritestname);
 	prifilename.Append(KFileSys);
 
 	r=file1.Create(TheFs,prifilename,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Open(TheFs,prifilename,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Open(TheFs,prifilename,EFileRead);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Replace(TheFs,prifilename,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	}
 
 
@@ -634,26 +631,26 @@
 //
 	{
 	r=TheFs.SetSessionPath(pritestname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Temp(TheFs,pritestname,fromTemp,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	TBuf<25> prifilename;
 	prifilename.Append(pritestname);
 	prifilename.Append(KFileSys);
 
 	r=file1.Create(TheFs,prifilename,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Open(TheFs,prifilename,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=file1.Open(TheFs,prifilename,EFileRead);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Replace(TheFs,prifilename,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	}
 
 
@@ -663,29 +660,29 @@
 //
 	{
 	r=TheFs.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 		
 	r=file1.Temp(TheFs,theprivatepath,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFilePri,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Open(TheFs,KFilePri,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Replace(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Rename(KFilePri3);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 	}
 
@@ -700,30 +697,30 @@
 	dirNameBuf = KSystemPath;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dirNameBuf.Zero();
 	delete dirEntries;
 	//Private//falseid
 	dirNameBuf=KPrivateFalseID;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dirNameBuf.Zero();
 	delete dirEntries;
 	//Private
 	dirNameBuf=KPrivatePath;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dirNameBuf.Zero();
 	delete dirEntries;
 	//Private/uid
@@ -731,19 +728,19 @@
 	dirNameBuf.Insert(0,_L("?:"));
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dirNameBuf.Zero();
 	delete dirEntries;
 	//Resource
 	dirNameBuf=KResourcePath;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_Value(r, r == KErrNone || r==KErrPathNotFound || r==KErrNotFound);
+	test(r==KErrNone || r==KErrPathNotFound || r==KErrNotFound);
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_Value(r, r == KErrNone || r==KErrPathNotFound || r==KErrNotFound);
+	test(r==KErrNone || r==KErrPathNotFound || r==KErrNotFound);
 	dir.Close();
 	delete dirEntries;
 	}
@@ -755,19 +752,19 @@
 //
 	{
 	r=TheFs.FileSystemName(fsname,gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = DismountFileSystem(TheFs, fsname, gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 //	r=TheFs.RemoveFileSystem(fsname);	//can not test due to bug else where fix exists
-//	test_Value(r, r == KErrPermissionDenied);
+//	test(r==KErrPermissionDenied);
 //	r=TheFs.AddFileSystem(fsname);
-//	test_Value(r, r == KErrPermissionDenied);
+//	test(r==KErrPermissionDenied);
 	r = MountFileSystem(TheFs, fsname, gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetDriveName(gTheDriveNum,KDriveName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetVolumeLabel(KVolLable, gTheDriveNum);
-	test_Value(r, r == KErrNone || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotSupported);
 
 	systemRFstest();
 	resourceRFstest();
@@ -792,11 +789,11 @@
 	test(aStat3==KErrNone);
 	
 	r=TheFs.SetSessionPath(systestname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 //Test RRawDisk class
 	r=rawdisk.Open(TheFs,gTheDriveNum);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	rawdisk.Close();
 
 	RDirtest();
@@ -807,21 +804,21 @@
 		{
 		//Test RFormat class
 		r=format.Open(TheFs,driveBuf,EHighDensity,count);
-		test_KErrNone(r);
+		test(r==KErrNone);
 
 		while(count)
 			{
 			TInt r=format.Next(count);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			}
 		format.Close();
 		}
 
 	driveBuf[0]=(TText)gDriveToTest;
 	r=TheFs.ScanDrive(driveBuf);
-	test_Value(r, r == KErrNone || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotSupported);
 	r=TheFs.CheckDisk(driveBuf);
-	test_Value(r, r == KErrNone || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotSupported);
 	}
 
 
@@ -833,16 +830,16 @@
 	{
 	driveBuf[0]=(TText)gDriveToTest;
 	r=TheFs.SessionPath(temp);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Printf(_L("Session path: %S"),&temp);
 
 	r=TheFs.CreatePrivatePath(gTheDriveNum);
-	test_Value(r, r == KErrNone || r== KErrAlreadyExists);
+	test(r==KErrNone || r== KErrAlreadyExists);
 
 	TBuf<18> tempPri;
 	r=TheFs.PrivatePath(tempPri);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	theprivatepath = _L("?:");
 	theprivatepath.Append(tempPri);
 	
@@ -851,9 +848,9 @@
 	TFileName thesessionpath;
 
 	r=TheFs.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SessionPath(thesessionpath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test(thesessionpath == theprivatepath);
 	}
@@ -867,8 +864,7 @@
 	test.Next(_L("Delete test directory"));
 	CFileMan* fMan=CFileMan::NewL(TheFs);
 	TInt r=fMan->RmDir(gSessionPath);
-	test(r == KErrNone || KErrPathNotFound);
-//	test_Value(r, r == KErrNone || r == KErrPathNotFound);
+	test(r==KErrNone || KErrPathNotFound);
 	delete fMan;
 	}
 
@@ -892,7 +888,7 @@
 	sesspath[0] = (TText)gDriveToTest;
 
 	TInt r= TheFs.SetSessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	//cleanup from previous run of this test
 	TBuf<2> cmd;
@@ -900,7 +896,7 @@
 	cmd[0] = (TText)gDriveToTest;
 	RProcess tp;
 	r=tp.Create(_L("clean_prepdc.exe"),sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	{
 	TRequestStatus ps;
 	tp.Logon(ps);
@@ -914,30 +910,30 @@
 	RFs fs2;
 	
 	r=fs1.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs1.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("session1 Path=%S"),&sesspath);
 
 	TBuf<30> privatepath;
 	r=fs1.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs1.PrivatePath(privatepath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=privatepath.Compare(KExpectedPrivatePath());
-	test_Value(r, r == 0);
+	test(r==0);
 	r=fs1.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=privatepath.Compare(sesspath.Mid(KPathPosition));
-	test_Value(r, r == 0);
+	test(r==0);
 	r=fs1.CreatePrivatePath(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fs1.Close();
 
 	r=fs2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs2.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("session2 Path=%S"),&sesspath);
 	fs2.Close();
 
--- a/kerneltest/f32test/server/t_dcdiskadminallfiles.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_dcdiskadminallfiles.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32std.h>
@@ -84,6 +83,9 @@
 TRequestStatus aStat3;
 TRequestStatus aStat4;
 
+TVolumeInfo aVolInfo;
+//	TDriveInfo adriveInfo;
+
 TBuf<40> systestfile;
 TBuf<40> pritestfile;
 TBuf<40> restestfile;
@@ -111,16 +113,16 @@
 	mkdirname.Append(systestname);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	TheFs.RmDir(mkdirname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetSubst(systestname,EDriveO);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.SetSessionPath(systestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TheFs.NotifyChange(ENotifyAll,aStat1,systestname);
 	test(aStat1==KRequestPending);
@@ -135,29 +137,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(systestfile, shortfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(systestfile1, longfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,systestfile);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Rename(systestfile,systestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Entry(systestfile1,entry);
-	test_Value(r, r == KErrNone || r == KErrNotFound);
+	test(r==KErrNone || KErrNotFound);
 
 	r=TheFs.SetEntry(systestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.Delete(systestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	}
 
 LOCAL_C void ResourceRFsTest()
@@ -172,26 +174,26 @@
 	mkdirname.Append(restestname);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	TheFs.RmDir(mkdirname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	// Change due to defect DEF099546 fix
 	// TCB capability is required for following operation.
 	r=TheFs.SetSubst(restestname,EDriveO);
-	//test_KErrNone(r);
-	test_Value(r, r == KErrPermissionDenied);
+	//test(r==KErrNone);
+	test(r==KErrPermissionDenied);
 	
 	// SetSubst will fail.
 	//r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	//test_KErrNone(r);
+	//test(r==KErrNone);
 
 	//r=TheFs.SetSubst(_L(""),EDriveO); 
-	//test_KErrNone(r);
+	//test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(restestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TheFs.NotifyChange(ENotifyAll,aStat4,restestname);
 	test(aStat4==KRequestPending);
@@ -206,29 +208,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(restestfile, shortfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(restestfile1, longfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,restestfile);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Rename(restestfile,restestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Entry(restestfile1,entry);
-	test_Value(r, r == KErrNone || r==KErrPathNotFound || r==KErrNotFound);
+	test(r==KErrNone || r==KErrPathNotFound || r==KErrNotFound);
 
 	r=TheFs.SetEntry(restestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.Delete(restestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	}
 
@@ -246,22 +248,22 @@
 	mkdirname.Append(KMkDirSub);
 
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(pritestfalseidname,EDriveO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(_L(""),EDriveO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(pritestfalseidname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyAll,aStat2,pritestfalseidname);
 	test(aStat2==KRequestPending);
@@ -277,29 +279,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(pritestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	}
 
@@ -318,22 +320,22 @@
 	mkdirname.Append(KMkDirSub);
 
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(pritestname,EDriveO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(_L(""),EDriveO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(pritestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyAll,aStat2,pritestname);
 	test(aStat2==KRequestPending);
@@ -349,29 +351,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(pritestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	}
 
@@ -385,22 +387,22 @@
 	mkdirname.Append(theprivatepath);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(theprivatepath,EDriveO);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(_L(""),EDriveO);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(theprivatepath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyAll,aStat3,theprivatepath);
 	test(aStat3==KRequestPending);
@@ -415,29 +417,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(pritestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 
@@ -448,33 +450,33 @@
 	{
 
 	r=TheFs.SetSessionPath(systestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.Temp(TheFs,systestname,fromTemp,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 	
 	systestfile=systestname;
 	systestfile.Append(KFileSys);
 	r=file1.Create(TheFs,systestfile,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=file1.Open(TheFs,systestfile,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Open(TheFs,systestfile,EFileRead);
-	test_Value(r, r == KErrNone|| r==KErrNotFound);
+	test(r==KErrNone|| r==KErrNotFound);
 	
 	r=file1.Replace(TheFs,systestfile,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
     TFindFile finder(TheFs);
     CDir* dir = NULL;
     r=finder.FindWildByDir(KWildFile, KWildPath, dir);
 	if (!(r==KErrNone))
         test.Printf(_L("T_DCDISKADMINALLFILES: test find wildcards r = %d (expected KErrNone)\n"), r);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	delete dir;
 	}
 
@@ -484,33 +486,33 @@
 //
 	{
 	r=TheFs.SetSessionPath(restestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.Temp(TheFs,restestname,fromTemp,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFileRes,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes,EFileWrite|EFileShareExclusive );
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=file1.Open(TheFs,KFileRes,EFileShareReadersOnly);
-	test_Value(r, r == KErrNone || r == KErrPathNotFound || r == KErrNotFound);
+	test(r==KErrNone || KErrPathNotFound || KErrNotFound);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes,EFileShareReadersOrWriters|EFileRead);
-	test_Value(r, r == KErrNone || r == KErrPathNotFound || r == KErrNotFound);
+	test(r==KErrNone || KErrPathNotFound || KErrNotFound);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes,EFileShareReadersOrWriters|EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 	
 	r=file1.Replace(TheFs,KFileRes3,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 	}
 
@@ -521,29 +523,29 @@
 //
 	{
 	r=TheFs.SetSessionPath(pritestfalseidname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.Temp(TheFs,pritestfalseidname,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Open(TheFs,KFilePri,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Replace(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Rename(KFilePri3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	}
 
@@ -554,29 +556,29 @@
 //
 	{
 	r=TheFs.SetSessionPath(pritestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.Temp(TheFs,pritestname,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Open(TheFs,KFilePri,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Replace(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Rename(KFilePri3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	}
 
@@ -587,30 +589,30 @@
 //
 	{
 	r=TheFs.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Temp(TheFs,theprivatepath,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFilePri,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 
 	r=file1.Replace(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Rename(KFilePri3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	}
 
@@ -625,12 +627,12 @@
 	TBuf<30> dirNameBuf(KSystemPath);
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_Value(r, r == KErrNone || r==KErrPathNotFound || r==KErrNotFound);
+	test(r==KErrNone || r==KErrPathNotFound || r==KErrNotFound);
 	dir.Close();
 	if(r==KErrNone)
 		{
 		r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		delete dirEntries;
 		}
 	dirNameBuf.Zero();
@@ -638,20 +640,20 @@
 	dirNameBuf=KPrivateFalseID;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dirNameBuf.Zero();
 	delete dirEntries;
 	//Private
 	dirNameBuf=KPrivatePath;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dirNameBuf.Zero();
 	delete dirEntries;
 	//Private/uid
@@ -659,21 +661,21 @@
 	dirNameBuf.Insert(0,_L("?:"));
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dirNameBuf.Zero();
 	delete dirEntries;
 	//Resource
 	dirNameBuf=KResourcePath;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_Value(r, r == KErrNone || r==KErrPathNotFound);
+	test(r==KErrNone || r==KErrPathNotFound);
 	if(r==KErrNone)
 		{
 		r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		dir.Close();
 		delete dirEntries;
 		}
@@ -686,20 +688,20 @@
 //
 	{
 	r=TheFs.FileSystemName(fsname,gTheDriveNum);
-	test_KErrNone(r);	
+	test(r==KErrNone);	
 	r = DismountFileSystem(TheFs, fsname, gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 //	r=TheFs.RemoveFileSystem(fsname);	//can not test due to bug else where fix exists
-//	test_KErrNone(r);
+//	test(r==KErrNone);
 //	r=TheFs.AddFileSystem(fsname);
-//	test_KErrNone(r);
+//	test(r==KErrNone);
 	r = MountFileSystem(TheFs, fsname, gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetDriveName(gTheDriveNum,KDriveName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 #ifndef __WINS__
  	r=TheFs.SetVolumeLabel(KVolLable, gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 #endif
 
 	systemRFsTest();
@@ -731,11 +733,11 @@
 	test(aStat4==KErrCancel);
 
 	r=TheFs.SetSessionPath(systestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 //Test RRawDisk class
 	r=rawdisk.Open(TheFs,gTheDriveNum);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	rawdisk.Close();
 
 	RDirtest();
@@ -746,20 +748,20 @@
 		{
 		//Test RFormat class
 		r=format.Open(TheFs,driveBuf,EHighDensity,count);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		while(count)	
 			{
 			TInt r=format.Next(count);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			}
 		format.Close();
 		}
 
 	driveBuf[0]=(TText)gDriveToTest;
 	r=TheFs.ScanDrive(driveBuf);
-	test_Value(r, r == KErrNone || r==KErrNotSupported || r == KErrInUse);
+	test(r==KErrNone || r==KErrNotSupported || KErrInUse);
 	r=TheFs.CheckDisk(driveBuf);
-	test_Value(r, r == KErrNone || r==KErrNotSupported || r == KErrInUse);
+	test(r==KErrNone || r==KErrNotSupported || KErrInUse);
 	}
 
 LOCAL_C void TestCaps()
@@ -777,16 +779,16 @@
 
 	driveBuf[0]=(TText)gDriveToTest;
 	r=TheFs.SessionPath(temp);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Printf(_L("Session path: %S"),&temp);
 
 	r=TheFs.CreatePrivatePath(gTheDriveNum);
-	test_Value(r, r == KErrNone || r== KErrAlreadyExists);
+	test(r==KErrNone || r== KErrAlreadyExists);
 
 	TBuf<18> tempPri;
 	r=TheFs.PrivatePath(tempPri);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	theprivatepath = _L("?:");
 	theprivatepath.Append(tempPri);
 
@@ -794,9 +796,9 @@
 	
 	TFileName thesessionpath;
 	r=TheFs.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SessionPath(thesessionpath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(thesessionpath == theprivatepath);
 	}
 
@@ -809,7 +811,7 @@
 	test.Next(_L("Delete test directory"));
 	CFileMan* fMan=CFileMan::NewL(TheFs);
 	TInt r=fMan->RmDir(gSessionPath);
-	test_Value(r, r == KErrNone || r == KErrPathNotFound);
+	test(r==KErrNone || KErrPathNotFound);
 	delete fMan;
 	}
 
@@ -833,14 +835,14 @@
 	sesspath[0] = (TText)gDriveToTest;
 
 	TInt r= TheFs.SetSessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TBuf<2> cmd;
 	cmd.SetLength(1);
 	cmd[0] = (TText)gDriveToTest;
 	RProcess tp;
 	r=tp.Create(_L("clean_prepdc.exe"),sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	{
 	TRequestStatus ps;
 	tp.Logon(ps);
@@ -854,30 +856,30 @@
 	RFs fs2;
 	
 	r=fs1.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs1.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("session1 Path=%S"),&sesspath);
 
 	TBuf<30> privatepath;
 	r=fs1.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs1.PrivatePath(privatepath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=privatepath.Compare(KExpectedPrivatePath());
-	test_Value(r, r == 0);
+	test(r==0);
 	r=fs1.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=privatepath.Compare(sesspath.Mid(KPathPosition));
-	test_Value(r, r == 0);
+	test(r==0);
 	r=fs1.CreatePrivatePath(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fs1.Close();
 
 	r=fs2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs2.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("session2 Path=%S"),&sesspath);
 	fs2.Close();
 
--- a/kerneltest/f32test/server/t_dcnone.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_dcnone.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -13,7 +13,6 @@
 // Description:
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32std.h>
@@ -95,6 +94,9 @@
 TRequestStatus aStat3;
 TRequestStatus aStat4;
 
+TVolumeInfo aVolInfo;
+//	TDriveInfo adriveInfo;
+
 TBuf<40> systestfile;
 TBuf<40> pritestfile;
 TBuf<40> restestfile;
@@ -117,11 +119,11 @@
 //
     {
     TInt r = TheFs.Rename(_L("\\sys"), _L("\\sysbad"));
-    test_Value(r, r == KErrPermissionDenied);
+    test(r == KErrPermissionDenied);
     r = TheFs.Rename(_L("\\resource"), _L("\\resourcebad"));
-    test_Value(r, r == KErrPermissionDenied);
+    test(r == KErrPermissionDenied);
     r = TheFs.Rename(_L("\\private"), _L("\\privatebad"));
-    test_Value(r, r == KErrPermissionDenied);
+    test(r == KErrPermissionDenied);
     }
 
 LOCAL_C void systemRFstest()
@@ -136,16 +138,16 @@
 	mkdirname.Append(systestname);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetSubst(systestname,EDriveP);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.SetSessionPath(systestname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	TheFs.NotifyChange(ENotifyAll,aStat1,systestname);
 	test(aStat1==KErrPermissionDenied);
@@ -160,42 +162,42 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(systestfile, shortfilename);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.GetLongName(systestfile1, longfilename);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,systestfile);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Rename(systestfile,systestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	// check that the entry for the system directory itself can be retrieved with no error
 	// - with or without a slash
 	TPtrC restrictedDir(systestname.Ptr(), systestname.Length());
 	r=TheFs.Entry(restrictedDir, entry);
 	test.Printf(_L("RFs::Entry(%S) returned %d"), &restrictedDir, r);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test (entry.iAtt & KEntryAttDir);
 
 	TPtrC restrictedDirWithNoBackSlash(restrictedDir.Ptr(), restrictedDir.Length()-1);
 	r=TheFs.Entry(restrictedDirWithNoBackSlash,entry);
 	test.Printf(_L("RFs::Entry(%S) returned %d"), &restrictedDirWithNoBackSlash, r);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Entry(systestfile1,entry);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.SetEntry(systestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.Delete(systestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	}
 
@@ -213,19 +215,19 @@
 	mkdirname.Append(restestname);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	TheFs.RmDir(mkdirname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetSubst(restestname,EDriveP);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.RealName(_L("P:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(restestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TheFs.NotifyChange(ENotifyAll,aStat4,restestname);
 	test(aStat4==KRequestPending);
@@ -241,44 +243,42 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(restestfile, shortfilename);
-//	test_Value(r, r == KErrNone || r == KErrPathNotFound);
-	test(r == KErrNone || KErrPathNotFound);
+	test(r==KErrNone || KErrPathNotFound);
 
 	r=TheFs.GetLongName(restestfile1, longfilename);
-//	test_Value(r, r == KErrNone || r == KErrPathNotFound);
-	test(r == KErrNone || KErrPathNotFound);
+	test(r==KErrNone || KErrPathNotFound);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,restestfile);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Rename(restestfile,restestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	// check that the entry for the resource directory itself can be retrieved with no error
 	// - with or without a slash
 	TPtrC restrictedDir(restestname.Ptr(), restestname.Length());
 	r=TheFs.Entry(restrictedDir, entry);
 	test.Printf(_L("RFs::Entry(%S) returned %d"), &restrictedDir, r);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test (entry.iAtt & KEntryAttDir);
 
 	TPtrC restrictedDirWithNoBackSlash(restrictedDir.Ptr(), restrictedDir.Length()-1);
 	r=TheFs.Entry(restrictedDirWithNoBackSlash,entry);
 	test.Printf(_L("RFs::Entry(%S) returned %d"), &restrictedDirWithNoBackSlash, r);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Entry(restestfile1,entry);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 
 	r=TheFs.SetEntry(restestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.Delete(restestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	}
 
@@ -296,13 +296,13 @@
 	mkdirname.Append(KMkDirSub);
 
 	r=TheFs.MkDirAll(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetSubst(pritestfalseidname,EDriveP);
-	test_Value(r, r == KErrPermissionDenied); 
+	test(r==KErrPermissionDenied); 
 
 	TheFs.NotifyChange(ENotifyAll,aStat2,pritestfalseidname);
 	test(aStat2==KErrPermissionDenied);
@@ -318,29 +318,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.Delete(pritestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	}
 
@@ -359,13 +359,13 @@
 	mkdirname.Append(KMkDirSub);
 
 	r=TheFs.MkDirAll(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetSubst(pritestname,EDriveP);
-	test_Value(r, r == KErrPermissionDenied); 
+	test(r==KErrPermissionDenied); 
 
 	TheFs.NotifyChange(ENotifyAll,aStat2,pritestname);
 	test(aStat2==KErrPermissionDenied);
@@ -381,42 +381,42 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	// check that the entry for the private directory itself can be retrieved with no error
 	// - with or without a slash
 	TPtrC restrictedDir(pritestname.Ptr(), pritestname.Length());
 	r=TheFs.Entry(restrictedDir, entry);
 	test.Printf(_L("RFs::Entry(%S) returned %d"), &restrictedDir, r);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test (entry.iAtt & KEntryAttDir);
 
 	TPtrC restrictedDirWithNoBackSlash(restrictedDir.Ptr(), restrictedDir.Length()-1);
 	r=TheFs.Entry(restrictedDirWithNoBackSlash,entry);
 	test.Printf(_L("RFs::Entry(%S) returned %d"), &restrictedDirWithNoBackSlash, r);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.Delete(pritestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	}
 
@@ -433,19 +433,19 @@
 	mkdirname.Append(theprivatepath);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(theprivatepath,EDriveP);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.RealName(_L("P:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.SetSessionPath(theprivatepath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyAll,aStat3,theprivatepath);
 	test(aStat3==KRequestPending);
@@ -461,47 +461,45 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-//	test_Value(r, r == KErrNone || r == KErrPathNotFound);
-	test(r == KErrNone || KErrPathNotFound);
+	test(r==KErrNone || KErrPathNotFound);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-//	test_Value(r, r == KErrNone || r == KErrPathNotFound);
-	test(r == KErrNone || KErrPathNotFound);
+	test(r==KErrNone || KErrPathNotFound);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	//Test Entry with correct SID
 	r=TheFs.Entry(theprivatepath,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	//Test Entry with correct SID and without "//" appended
 	r=TheFs.Entry(KPrivatePathTest1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	//Test Entry with invalid SID, without // appended
 	r=TheFs.Entry(KPrivatePathTest2,entry);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	//Test Entry with invalid SID
 	r=TheFs.Entry(KPrivatePathTest3,entry);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(pritestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	}
 
@@ -512,10 +510,10 @@
 //
 	{
 	r=TheFs.SetSessionPath(systestname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Temp(TheFs,systestname,fromTemp,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 
 	TBuf<25> sysfilename;
@@ -523,23 +521,23 @@
 	sysfilename.Append(KFileSys);
 
 	r=file1.Create(TheFs,sysfilename,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Open(TheFs,sysfilename,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=file1.Open(TheFs,sysfilename,EFileRead);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=file1.Replace(TheFs,sysfilename,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	TFindFile finder(TheFs);
 	CDir* dir = NULL;
 	r=finder.FindWildByDir(KWildFile, KWildPath, dir);
 	if (!(r==KErrPermissionDenied))
 		test.Printf(_L("T_DCNONE: test find wildcards r = %d (expected KErrPermissionDenied)\n"), r);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	delete dir;
 	}
 
@@ -549,46 +547,46 @@
 //
 	{
 	r=TheFs.SetSessionPath(restestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.Temp(TheFs,restestname,fromTemp,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFileRes,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes,EFileRead|EFileShareReadersOnly);
-	test_Value(r, r == KErrNone || r==KErrPathNotFound);
+	test(r==KErrNone || r==KErrPathNotFound);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes,EFileShareReadersOrWriters|EFileRead);
-	test_Value(r, r == KErrNone || r==KErrPathNotFound);
+	test(r==KErrNone || r==KErrPathNotFound);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes,EFileShareReadersOrWriters|EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes,EFileShareReadersOnly);
-	test_Value(r, r == KErrNone || r==KErrPathNotFound);
+	test(r==KErrNone || r==KErrPathNotFound);
 
 	r=file1.ChangeMode(EFileShareExclusive);	//this is not illegal though will prevent shared access to resource which is nit my fault but may be desirable to prevent
-	test_Value(r, r == KErrNone || r==KErrPathNotFound);
+	test(r==KErrNone || r==KErrPathNotFound);
 
 	//this operation is prevented as you can not open a file for write access in the resource directory
 	r=file1.Rename(KFileRes3);
-	test_Value(r, r == KErrPermissionDenied || r==KErrAccessDenied);
+	test(r==KErrPermissionDenied || r==KErrAccessDenied);
 
 	file1.Close();
 
 	r=file1.Replace(TheFs,KFileRes,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	}
@@ -601,28 +599,28 @@
 	{
 
 	r=TheFs.SetSessionPath(pritestfalseidname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Temp(TheFs,pritestfalseidname,fromTemp,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	TBuf<25> prifilename;
 	prifilename.Append(pritestname);
 	prifilename.Append(KFileSys);
 
 	r=file1.Create(TheFs,prifilename,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 
 	r=file1.Open(TheFs,prifilename,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Open(TheFs,prifilename,EFileRead);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	
 	r=file1.Replace(TheFs,prifilename,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	}
 
@@ -635,29 +633,29 @@
 	{
 
 	r=TheFs.SetSessionPath(pritestname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Temp(TheFs,pritestname,fromTemp,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	TBuf<25> prifilename;
 	prifilename.Append(pritestname);
 	prifilename.Append(KFileSys);
 
 	r=file1.Create(TheFs,prifilename,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 
 	r=file1.Open(TheFs,prifilename,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	
 	r=file1.Open(TheFs,prifilename,EFileRead);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 
 	r=file1.Replace(TheFs,prifilename,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	}
 
@@ -668,24 +666,24 @@
 	{
 
 	r=TheFs.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 		
 	r=file1.Temp(TheFs,theprivatepath,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	r=file1.Create(TheFs,KFilePri,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 	r=file1.Open(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	r=file1.Open(TheFs,KFilePri,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	r=file1.Replace(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file1.Rename(KFilePri3);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	}
@@ -701,20 +699,20 @@
 	TBuf<30> dirNameBuf(KSystemPath);
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dirNameBuf.Zero();
 	delete dirEntries;
 	
 	dirNameBuf=KPrivateFalseID;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dirNameBuf.Zero();
 	delete dirEntries;
 
@@ -722,10 +720,10 @@
 	dirNameBuf=KPrivatePath;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dirNameBuf.Zero();
 	delete dirEntries;
 	//Private/uid
@@ -733,19 +731,19 @@
 	dirNameBuf.Insert(0,_L("?:"));
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dirNameBuf.Zero();
 	delete dirEntries;
 	//Resource
 	dirNameBuf=KResourcePath;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	delete dirEntries;
 	}
@@ -757,19 +755,19 @@
 //
 	{
 	r=TheFs.FileSystemName(fsname,gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = DismountFileSystem(TheFs, fsname, gTheDriveNum);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 //	r=TheFs.RemoveFileSystem(fsname);	//can not test due to bug elsewhere fix exists
-//	test_Value(r, r == KErrPermissionDenied);
+//	test(r==KErrPermissionDenied);
 //	r=TheFs.AddFileSystem(fsname);
-//	test_Value(r, r == KErrPermissionDenied);
+//	test(r==KErrPermissionDenied);
 	r = MountFileSystem(TheFs, fsname, gTheDriveNum);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	r=TheFs.SetDriveName(gTheDriveNum,KDriveName);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 //	r=TheFs.SetVolumeLabel(KVolLable, gTheDriveNum);	//broken on wins C:
-//	test_Value(r, r == KErrPermissionDenied);
+//	test(r==KErrPermissionDenied);
 
 	systemRFstest();
 	resourceRFstest();
@@ -794,24 +792,24 @@
 	test(aStat3==KErrNone);
 	
 	r=TheFs.SetSessionPath(systestname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	
 //Test RRawDisk class
 	r=rawdisk.Open(TheFs,gTheDriveNum);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 //	rawdisk.Close();
 
 	r=format.Open(TheFs,driveBuf,EHighDensity,count);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	RDirtest();
 
 	driveBuf[0]=(TText)gDriveToTest;
 	r=TheFs.ScanDrive(driveBuf);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	r=TheFs.CheckDisk(driveBuf);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	}
 
 LOCAL_C void TestCaps()
@@ -833,14 +831,14 @@
 
 	driveBuf[0]=(TText)gDriveToTest;
 	r=TheFs.SessionPath(temp);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.CreatePrivatePath(gTheDriveNum);
-	test_Value(r, r == KErrNone || r== KErrAlreadyExists);
+	test(r==KErrNone || r== KErrAlreadyExists);
 
 	TBuf<18> tempPri;
 	r=TheFs.PrivatePath(tempPri);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	theprivatepath = _L("?:");
 	theprivatepath.Append(tempPri);
 
@@ -848,9 +846,9 @@
 
 	TFileName thesessionpath;
 	r=TheFs.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SessionPath(thesessionpath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	test(thesessionpath == theprivatepath);
 
@@ -864,25 +862,25 @@
 	{
 	TInt r;
 	r = TheFs.MkDir(_L("\\normal\\"));
-	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+	test(r == KErrNone || r == KErrAlreadyExists);
 	r = TheFs.MkDir(_L("\\normal\\one\\"));
-	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+	test(r == KErrNone || r == KErrAlreadyExists);
 	r = TheFs.MkDir(_L("\\normal\\two\\"));
-	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+	test(r == KErrNone || r == KErrAlreadyExists);
 	r = TheFs.MkDir(_L("\\sys\\"));
-	test_Value(r, r == KErrPermissionDenied);
+	test(r == KErrPermissionDenied);
 	r = TheFs.MkDir(_L("\\sys\\one\\"));
-	test_Value(r, r == KErrPermissionDenied);
+	test(r == KErrPermissionDenied);
 	r = TheFs.MkDir(_L("\\sys\\two\\"));
-	test_Value(r, r == KErrPermissionDenied);
+	test(r == KErrPermissionDenied);
 	r = TheFs.MkDir(_L("\\private\\"));
-	test_Value(r, r == KErrPermissionDenied);
+	test(r == KErrPermissionDenied);
 	r = TheFs.MkDir(_L("\\private\\one\\"));
-	test_Value(r, r == KErrPermissionDenied);
+	test(r == KErrPermissionDenied);
 	r = TheFs.MkDir(_L("\\private\\two\\"));
-	test_Value(r, r == KErrPermissionDenied);
+	test(r == KErrPermissionDenied);
 	r = TheFs.MkDir(_L("\\ZZZZZZ\\"));
-	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+	test(r == KErrNone || r == KErrAlreadyExists);
 	}
 
 TFileName dirName;
@@ -891,16 +889,16 @@
 	{
 	CDirScan* scanner = NULL;
 	TRAP(r, scanner = CDirScan::NewL(TheFs));
-	test_Value(r, r == KErrNone && scanner);
+	test(r == KErrNone && scanner);
 
 	TRAP(r, scanner->SetScanDataL(aName,KEntryAttDir,ESortByName|EAscending,aDirection));
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	CDir *entryList=NULL;
 	for (;;)
 		{
 		TRAP(r, scanner->NextL(entryList));
-		test_Value(r, r == aError);
+		test(r == aError);
 		if (entryList==NULL)
 			break;
 		TInt count=entryList->Count();
@@ -939,11 +937,11 @@
 		test.Printf(_L("Private Path is=%S"),&privatepath);
 		
 		r = TheFs.MkDir(_L("\\Caged\\"));
-		test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+		test(r==KErrNone || r==KErrAlreadyExists);
 		
 		CDir* entryCount=NULL;
 		r=TheFs.GetDir(_L("\\*.*"),KEntryAttNormal,ESortNone,entryCount);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		TInt rootCount= entryCount->Count();
 		
 		delete entryCount;
@@ -953,12 +951,12 @@
 		//Testing Copy
 		CDir* entryCount2=NULL;
 		r=fMan->Copy(_L("\\sys\\"),_L("\\Caged\\"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Copy(_L("\\*"),_L("\\Caged\\"));
-		test_KErrNone(r);
+		test(r == KErrNone);
 		
 		r=TheFs.GetDir(_L("\\Caged\\*.*"),KEntryAttNormal,ESortNone,entryCount2);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		TInt cagedCount= entryCount2->Count();
 		
 		test(cagedCount==rootCount);
@@ -969,24 +967,24 @@
 		// Check if both copied sys and private are empty (no information is exposed)
 		CDir* entryCount3=NULL;
 		r=TheFs.GetDir(_L("\\Caged\\private\\*.*"),KEntryAttNormal|KEntryAttDir,ESortNone,entryCount3);
-		test_Value(r, r == KErrPathNotFound);
+		test(r==KErrPathNotFound);
 		delete entryCount3;
 		entryCount3=NULL;
 		
 		CDir* entryCount4=NULL;
 		r=TheFs.GetDir(_L("\\Caged\\sys\\*.*"),KEntryAttNormal|KEntryAttDir,ESortNone,entryCount4);
-		test_Value(r, r == KErrPathNotFound);
+		test(r==KErrPathNotFound);
 		delete entryCount4;
 		entryCount4=NULL;
 
 	
 		r=fMan->Copy(_L("\\private\\two\\moo"),_L("\\private\\two\\mew")); 
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 	
 		// Create a test file
 		RFile testFile;
 		r = testFile.Replace(TheFs, _L("\\capTest"),EFileWrite);
-		test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+		test(r==KErrNone || r==KErrAlreadyExists);
 		testFile.Close();
 		
 		TFileName name;
@@ -994,96 +992,96 @@
 		name.Append(_L("privateFile.tst"));
 		RFile privateFile;
 		r = privateFile.Replace(TheFs, name,EFileWrite);
-		test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+		test(r==KErrNone || r==KErrAlreadyExists);
 		privateFile.Close();
 
 	
 		r=fMan->Copy(_L("\\capTest"),_L("\\private\\two\\moo")); 
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Copy(_L("\\capTest"),_L("\\sys\\bin\\moo")); 
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Copy(_L("\\sys\\bin\\capTest"),_L("\\sys\\bin\\moo"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Copy(_L("\\sys\\*"),_L("\\"));
-		test_Value(r, r == KErrPermissionDenied);
+		test (r==KErrPermissionDenied);
 		r=fMan->Copy(name,_L("\\sys\\"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r==KErrPermissionDenied);
 
 		// Testing Move
 		r=fMan->Move(_L("\\private\\two\\moo"),_L("\\private\\one\\moo"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Move(_L("\\private\\two\\moo.."),_L("\\private\\one\\moo"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Move(_L("\\private\\two\\moo"),_L("\\private\\one\\moo.."));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Move(name,_L("\\privateFile.tst"));
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Move(_L("\\privateFile.tst"),name);
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Move(_L("\\capTest"),_L("\\private\\two\\moo")); 
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Move(_L("\\capTest"),_L("\\sys\\bin\\moo")); 
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Move(_L("\\sys\\bin\\capTest"),_L("\\sys\\bin\\moo"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Move(_L("\\sys\\*"),_L("\\"));
-		test_Value(r, r == KErrPermissionDenied);
+		test (r==KErrPermissionDenied);
 		r=fMan->Move(name,_L("\\sys\\"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r==KErrPermissionDenied);
 
 
 		// Testing Attribs
 		r=fMan->Attribs(_L("\\private\\two\\moo"),KEntryAttReadOnly,0,TTime(0)); 
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Attribs(_L("\\private\\moo"),KEntryAttReadOnly,0,TTime(0)); 
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Attribs(name,KEntryAttReadOnly,0,TTime(0));
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Attribs(name,0,KEntryAttReadOnly,TTime(0));
-		test_KErrNone(r);
+		test(r == KErrNone);
 
 
 		// Testing RmDir
 		r=fMan->RmDir(_L("\\private\\"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->RmDir(_L("\\private\\two\\"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->RmDir(_L("\\private\\tw?\\"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->RmDir(_L("\\sys\\"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		
 		
 		// Testing Rename
 		r=fMan->Rename(_L("\\private\\two\\moo"),_L("\\private\\two\\mew")); 
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		
 		// Testing Delete
 		r=fMan->Delete(_L("\\private\\two\\test")); 
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Delete(_L("\\private\\moo")); 
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Delete(_L("\\sys\\moo")); 
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		
 
 		//Something that actually exists in Private
 		r=fMan->Rename(name,_L("\\private\\00000001\\moo")); 
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Rename(_L("\\private\\00000001\\moo"),name); 
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Copy(name,_L("\\private\\00000001\\moo")); 
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Delete(_L("\\private\\00000001\\moo")); 
-		test_KErrNone(r);
+		test(r == KErrNone);
 
 		// Clean up the test data
 		r=fMan->RmDir(_L("\\Caged\\")); 
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Delete(_L("\\capTest")); 
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Delete(name); 
-		test_KErrNone(r);
+		test(r == KErrNone);
 		delete(fMan);
 		}
 	
@@ -1103,25 +1101,25 @@
 	{
 	TInt r;
 	r = TheFs.RmDir(_L("\\normal\\one\\"));
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = TheFs.RmDir(_L("\\normal\\two\\"));
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = TheFs.RmDir(_L("\\normal\\"));
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = TheFs.RmDir(_L("\\sys\\one\\"));
-	test_Value(r, r == KErrPermissionDenied);
+	test(r == KErrPermissionDenied);
 	r = TheFs.RmDir(_L("\\sys\\two\\"));
-	test_Value(r, r == KErrPermissionDenied);
+	test(r == KErrPermissionDenied);
 	r = TheFs.RmDir(_L("\\sys\\"));
-	test_Value(r, r == KErrPermissionDenied);
+	test(r == KErrPermissionDenied);
 	r = TheFs.RmDir(_L("\\private\\one\\"));
-	test_Value(r, r == KErrPermissionDenied);
+	test(r == KErrPermissionDenied);
 	r = TheFs.RmDir(_L("\\private\\two\\"));
-	test_Value(r, r == KErrPermissionDenied);
+	test(r == KErrPermissionDenied);
 	r = TheFs.RmDir(_L("\\private\\"));
-	test_Value(r, r == KErrPermissionDenied);
+	test(r == KErrPermissionDenied);
 	r = TheFs.RmDir(_L("\\ZZZZZZ\\"));
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}
 
 TFileName gDirList[100];
@@ -1137,11 +1135,11 @@
 	CDirScan* scanner = NULL;
 	TInt r;
 	TRAP(r, scanner = CDirScan::NewL(TheFs));
-	test_Value(r, r == KErrNone && scanner);
+	test(r == KErrNone && scanner);
 	TParse dirName;
 	TheFs.Parse(_L("\\"),dirName);
 	TRAP(r, scanner->SetScanDataL(dirName.FullName(),KEntryAttDir,ESortByName|EAscending));
-	test_KErrNone(r);
+	test(r == KErrNone);
 	CDir *entryList;
 	test.Printf(_L("------ ALL DIRECTORIES ------\n"));
 	for (;;)
@@ -1178,11 +1176,11 @@
 	CDirScan* scanner = NULL;
 	TInt r;
 	TRAP(r, scanner = CDirScan::NewL(TheFs));
-	test_Value(r, r == KErrNone && scanner);
+	test(r == KErrNone && scanner);
 	TParse dirName;
 	TheFs.Parse(_L("\\"),dirName);
 	TRAP(r, scanner->SetScanDataL(dirName.FullName(),KEntryAttDir,ESortByName|EAscending));
-	test_KErrNone(r);
+	test(r == KErrNone);
 	CDir *entryList = NULL;
 	TInt  num = 0;
 	test.Printf(_L("------ ACCESSIBLE DIRECTORIES ------\n"));
@@ -1217,7 +1215,7 @@
 		}
 	delete scanner;
 	CleanDirs();
-	test_KErrNone(r);
+	test(r == KErrNone);
 	if (num < gDirNum)
 		{
 		test.Printf(_L("Directory not as expected (%d found < %d expected\n"), num, gDirNum);
@@ -1248,7 +1246,7 @@
 	test.Next(_L("Delete test directory"));
 	CFileMan* fMan=CFileMan::NewL(TheFs);
 	TInt r=fMan->RmDir(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	delete fMan;
 	}
 
@@ -1273,14 +1271,14 @@
 	sesspath[0] = (TText)gDriveToTest;
 
 	TInt r= TheFs.SetSessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TBuf<2> cmd;
 	cmd.SetLength(1);
 	cmd[0] = (TText)gDriveToTest;
 	RProcess tp;
 	r=tp.Create(_L("clean_prepdc.exe"),sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	{
 	TRequestStatus ps;
 	tp.Logon(ps);
@@ -1294,30 +1292,30 @@
 	RFs fs2;
 	
 	r=fs1.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs1.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("session1 Path=%S"),&sesspath);
 
 	TBuf<30> privatepath;
 	r=fs1.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs1.PrivatePath(privatepath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=privatepath.Compare(KExpectedPrivatePath());
-	test_Value(r, r == 0);
+	test(r==0);
 	r=fs1.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=privatepath.Compare(sesspath.Mid(KPathPosition));
-	test_Value(r, r == 0);
+	test(r==0);
 	r=fs1.CreatePrivatePath(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fs1.Close();
 
 	r=fs2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs2.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("session2 Path=%S"),&sesspath);
 	fs2.Close();
 
--- a/kerneltest/f32test/server/t_dctcb.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_dctcb.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -13,7 +13,6 @@
 // Description:
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32std.h>
@@ -88,6 +87,8 @@
 TRequestStatus aStat3;
 TRequestStatus aStat4;
 
+TVolumeInfo aVolInfo;
+
 TBuf<40> systestfile;
 TBuf<40> pritestfile;
 TBuf<40> restestfile;
@@ -110,15 +111,15 @@
 //
     {
     TInt r = TheFs.Rename(_L("\\sys"), _L("\\sysbad"));
-    test_KErrNone(r);
+    test(r == KErrNone);
     r = TheFs.Rename(_L("\\resource"), _L("\\resourcebad"));
-    test_KErrNone(r);
+    test(r == KErrNone);
     r = TheFs.Rename(_L("\\sysbad"), _L("\\sys"));
-    test_KErrNone(r);
+    test(r == KErrNone);
     r = TheFs.Rename(_L("\\resourcebad"), _L("\\resource"));
-    test_KErrNone(r);
+    test(r == KErrNone);
     r = TheFs.Rename(_L("\\private"), _L("\\privatebad"));
-    test_Value(r, r == KErrPermissionDenied);
+    test(r == KErrPermissionDenied);
     }
 
 LOCAL_C void systemRFsTest()
@@ -134,19 +135,19 @@
 	mkdirname.Append(systestname);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.RmDir(mkdirname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(systestname,EDriveO);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(systestname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	TheFs.NotifyChange(ENotifyAll,aStat1,systestname);
 	test(aStat1==KErrPermissionDenied);
@@ -161,32 +162,32 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(systestfile, shortfilename);
-	test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported);
+	test(r==KErrPermissionDenied || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(systestfile1, longfilename);
-	test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported);
+	test(r==KErrPermissionDenied || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,systestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Delete(systestfile1);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 
 	r=TheFs.Rename(systestfile,systestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Entry(systestfile1,entry);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetEntry(systestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(systestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	__UHEAP_MARKEND;
 
@@ -206,19 +207,19 @@
 	mkdirname.Append(restestname);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.RmDir(mkdirname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(restestname,EDriveO);
-	test_Value(r, r == KErrPermissionDenied || r==KErrGeneral);
+	test(r==KErrPermissionDenied || r==KErrGeneral);
 	
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(restestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TheFs.NotifyChange(ENotifyAll,aStat4,restestname);
 	test(aStat4==KRequestPending);
@@ -233,31 +234,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(restestfile, shortfilename);
-//	test_Value(r, r == KErrNone || r == KErrNotFound || r==KErrNotSupported);
-	test(r == KErrNone || KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(restestfile1, longfilename);
-//	test_Value(r, r == KErrNone || r == KErrNotFound || r==KErrNotSupported);
-	test(r == KErrNone || KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,restestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Rename(restestfile,restestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Entry(restestfile1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetEntry(restestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(restestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	__UHEAP_MARK;
 
@@ -279,22 +278,22 @@
 	mkdirname.Append(KMkDirSub);
 
 	r=TheFs.MkDirAll(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetSubst(pritestfalseidname,EDriveO);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(pritestfalseidname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	TheFs.NotifyChange(ENotifyAll,aStat2,pritestfalseidname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 
 	pritestfile=KPrivateFalseID;
@@ -307,29 +306,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported);
+	test(r==KErrPermissionDenied || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported);
+	test(r==KErrPermissionDenied || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.Delete(pritestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	__UHEAP_MARKEND;
 	}
@@ -351,22 +350,22 @@
 	mkdirname.Append(KMkDirSub);
 
 	r=TheFs.MkDirAll(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetSubst(pritestname,EDriveO);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(pritestname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	TheFs.NotifyChange(ENotifyAll,aStat2,pritestname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 
 	pritestfile=KPrivatePath;
@@ -379,29 +378,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported);
+	test(r==KErrPermissionDenied || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported);
+	test(r==KErrPermissionDenied || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.Delete(pritestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	__UHEAP_MARKEND;
 	}
@@ -418,19 +417,19 @@
 	mkdirname.Append(theprivatepath);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(theprivatepath,EDriveO);	
-	test_Value(r, r == KErrPermissionDenied || r==KErrGeneral); // Drive may already be substituted
+	test(r==KErrPermissionDenied || r==KErrGeneral); // Drive may already be substituted
 
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(theprivatepath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyAll,aStat3,theprivatepath);
 	test(aStat3==KRequestPending);
@@ -445,29 +444,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(pritestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	__UHEAP_MARKEND;
 	}
@@ -481,10 +480,10 @@
 	__UHEAP_MARK;
 
 	r=TheFs.SetSessionPath(systestname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Temp(TheFs,systestname,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	TBuf<25> sysfilename;
@@ -492,26 +491,26 @@
 	sysfilename.Append(KFileSys);
 
 	r=file1.Create(TheFs,sysfilename,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,sysfilename,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Open(TheFs,sysfilename,EFileRead);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 	
 	r=file1.Replace(TheFs,sysfilename,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TBuf<25> sysfilename2;
 	sysfilename2.Append(systestname);
 	sysfilename2.Append(KFileSys3);
 		
 	r=file1.Rename(sysfilename2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
     TFindFile finder(TheFs);
@@ -519,7 +518,7 @@
     r=finder.FindWildByDir(KWildFile, KWildPath, dir);
 	if (!(r==KErrPermissionDenied))
         test.Printf(_L("T_DCTCB: test find wildcards r = %d (expected KErrPermissionDenied)\n"), r);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	delete dir;
 
 	__UHEAP_MARKEND;
@@ -533,40 +532,40 @@
 	__UHEAP_MARK;
 
 	r=TheFs.SetSessionPath(restestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.Temp(TheFs,restestname,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFileRes,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes,EFileWrite|EFileShareExclusive );
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Rename(KFileRes3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes3,EFileShareReadersOrWriters|EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes3,EFileShareReadersOrWriters|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes3,EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.ChangeMode(EFileShareExclusive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Replace(TheFs,KFileRes,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();	
 	
 	__UHEAP_MARKEND;
@@ -582,10 +581,10 @@
 	__UHEAP_MARK;
 
 	r=TheFs.SetSessionPath(pritestfalseidname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Temp(TheFs,pritestfalseidname,fromTemp,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	// Since can't set session path create explicit path
@@ -594,23 +593,23 @@
 	pritestfile.Append(KFilePri);
 
 	r=file1.Create(TheFs,pritestfile,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=file1.Open(TheFs,pritestfile,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 	
 	r=file1.Open(TheFs,pritestfile,EFileRead);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 		
 	r=file1.Replace(TheFs,pritestfile,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	// File does not exist so can't rename it	
 /*	r=file1.Rename(KFilePri3);
-	test_Value(r, r == KErrAlreadyExists || r==KErrNone);
+	test(r==KErrAlreadyExists || r==KErrNone);
 	file1.Close();
 */	__UHEAP_MARKEND;
 	}
@@ -624,10 +623,10 @@
 	__UHEAP_MARK;
 
 	r=TheFs.SetSessionPath(pritestname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Temp(TheFs,pritestname,fromTemp,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	// Since can't set session path create explicit path
@@ -636,23 +635,23 @@
 	pritestfile.Append(KFilePri);
 
 	r=file1.Create(TheFs,pritestfile,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=file1.Open(TheFs,pritestfile,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 	
 	r=file1.Open(TheFs,pritestfile,EFileRead);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 	
 	r=file1.Replace(TheFs,pritestfile,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	// File does not exist so can't be renamed	
 /*	r=file1.Rename(KFilePri3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 */
 	__UHEAP_MARKEND;
@@ -666,29 +665,29 @@
 	{
 	__UHEAP_MARK;
 	r=TheFs.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Temp(TheFs,theprivatepath,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Open(TheFs,KFilePri,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Replace(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Rename(KFilePri3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	__UHEAP_MARKEND;
 	}
@@ -705,10 +704,10 @@
 	TBuf<30> dirNameBuf(KSystemPath);
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dirNameBuf.Zero();
 	delete dirEntries;
 
@@ -716,10 +715,10 @@
 	dirNameBuf=KPrivatePath;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dirNameBuf.Zero();
 	delete dirEntries;
 
@@ -727,10 +726,10 @@
 	dirNameBuf=KPrivateFalseID;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dirNameBuf.Zero();
 	delete dirEntries;
 
@@ -739,19 +738,19 @@
 	dirNameBuf.Insert(0,_L("?:"));
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dirNameBuf.Zero();
 	delete dirEntries;
 	//Resource
 	dirNameBuf=KResourcePath;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	delete dirEntries;
 	__UHEAP_MARKEND;
@@ -765,16 +764,16 @@
 	{
 	__UHEAP_MARK;
 	r=TheFs.FileSystemName(fsname,gTheDriveNum);
-	test_KErrNone(r);	
+	test(r==KErrNone);	
 	r = DismountFileSystem(TheFs, fsname, gTheDriveNum);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	r = MountFileSystem(TheFs, fsname, gTheDriveNum);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	r=TheFs.SetDriveName(gTheDriveNum,KDriveName);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 #ifndef __WINS__
  	r=TheFs.SetVolumeLabel(KVolLable, gTheDriveNum);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 #endif
 
 	systemRFsTest();
@@ -801,11 +800,11 @@
 	test(aStat4==KErrNone);
 
 	r=TheFs.SetSessionPath(systestname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 //Test RRawDisk class
 	r=rawdisk.Open(TheFs,gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
     rawdisk.Close();
 
 	RDirtest();
@@ -816,21 +815,21 @@
 		{
 		//Test RFormat class
 		r=format.Open(TheFs,driveBuf,EHighDensity,count);
-		test_Value(r, r == KErrPermissionDenied);
+		test(r==KErrPermissionDenied);
 
 		while(count)	
 			{
 			TInt r=format.Next(count);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			}
 		format.Close();
 		}
 
 	driveBuf[0]=(TText)gDriveToTest;
 	r=TheFs.ScanDrive(driveBuf);
-	test_Value(r, (r == KErrPermissionDenied)||(r==KErrNotSupported));
+	test((r==KErrPermissionDenied)||(r==KErrNotSupported));
 	r=TheFs.CheckDisk(driveBuf);
-	test_Value(r, (r == KErrPermissionDenied)||(r==KErrNotSupported));
+	test((r==KErrPermissionDenied)||(r==KErrNotSupported));
 	__UHEAP_MARKEND;
 	}
 
@@ -848,14 +847,14 @@
 
 	driveBuf[0]=(TText)gDriveToTest;
 	r=TheFs.SessionPath(temp);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("Session path: %S"),&temp);
 	r=TheFs.CreatePrivatePath(gTheDriveNum);
-	test_Value(r, r == KErrNone || r== KErrAlreadyExists);
+	test(r==KErrNone || r== KErrAlreadyExists);
 
 	TBuf<18> tempPri;
 	r=TheFs.PrivatePath(tempPri);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	theprivatepath = _L("?:");
 	theprivatepath.Append(tempPri);
 
@@ -863,9 +862,9 @@
 
 	TFileName thesessionpath;
 	r=TheFs.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SessionPath(thesessionpath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(thesessionpath == theprivatepath);
 	__UHEAP_MARKEND;
 	}
@@ -877,16 +876,16 @@
 	{
 	CDirScan* scanner = NULL;
 	TRAP(r, scanner = CDirScan::NewL(TheFs));
-	test_Value(r, r == KErrNone && scanner);
+	test(r == KErrNone && scanner);
 
 	TRAP(r, scanner->SetScanDataL(aName,KEntryAttDir,ESortByName|EAscending,aDirection));
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	CDir *entryList=NULL;
 	for (;;)
 		{
 		TRAP(r, scanner->NextL(entryList));
-		test_Value(r, r == aError);
+		test(r == aError);
 		if (entryList==NULL)
 			break;
 		TInt count=entryList->Count();
@@ -925,11 +924,11 @@
 		test.Printf(_L("Private Path is=%S"),&privatepath);
 		
 		r = TheFs.MkDir(_L("\\Caged\\"));
-		test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+		test(r==KErrNone || r==KErrAlreadyExists);
 		
 		CDir* entryCount=NULL;
 		r=TheFs.GetDir(_L("\\*.*"),KEntryAttNormal,ESortNone,entryCount);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		TInt rootCount= entryCount->Count();
 		
 		delete entryCount;
@@ -939,12 +938,12 @@
 		//Testing Copy
 		CDir* entryCount2=NULL;
 		r=fMan->Copy(_L("\\sys\\"),_L("\\Caged\\"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Copy(_L("\\*"),_L("\\Caged\\"));
-		test_KErrNone(r);
+		test(r == KErrNone);
 		
 		r=TheFs.GetDir(_L("\\Caged\\*.*"),KEntryAttNormal,ESortNone,entryCount2);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		TInt cagedCount= entryCount2->Count();
 		
 		test(cagedCount==rootCount);
@@ -953,12 +952,12 @@
 		entryCount2=NULL;
 	
 		r=fMan->Copy(_L("\\private\\two\\moo"),_L("\\private\\two\\mew")); 
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 	
 		// Create a test file
 		RFile testFile;
 		r = testFile.Replace(TheFs, _L("\\capTest"),EFileWrite);
-		test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+		test(r==KErrNone || r==KErrAlreadyExists);
 		testFile.Close();
 		
 		TFileName name;
@@ -966,99 +965,99 @@
 		name.Append(_L("privateFile.tst"));
 		RFile privateFile;
 		r = privateFile.Replace(TheFs, name,EFileWrite);
-		test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+		test(r==KErrNone || r==KErrAlreadyExists);
 		privateFile.Close();
 
 	
 		r=fMan->Copy(_L("\\capTest"),_L("\\private\\two\\moo")); 
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Copy(_L("\\capTest"),_L("\\sys\\bin\\moo")); 
-		test_Value(r, r == KErrPathNotFound); 
+		test(r == KErrPathNotFound); 
 		r=fMan->Copy(_L("\\sys\\bin\\capTest"),_L("\\sys\\bin\\moo")); 
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Copy(_L("\\capTest"),_L("\\sys\\capTest")); 
-		test_Value(r, r == KErrNone || r==KErrAlreadyExists); 
+		test(r == KErrNone || r==KErrAlreadyExists); 
 		r=fMan->Copy(_L("\\sys\\*"),_L("\\"));
-		test_Value(r, r == KErrPermissionDenied);
+		test (r==KErrPermissionDenied);
 		r=fMan->Copy(name,_L("\\sys\\"));
-		test_KErrNone(r);
+		test(r==KErrNone);
 
 		// Testing Move
 		r=fMan->Move(_L("\\private\\two\\moo"),_L("\\private\\one\\moo"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Move(_L("\\private\\two\\moo.."),_L("\\private\\one\\moo"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Move(_L("\\private\\two\\moo"),_L("\\private\\one\\moo.."));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Move(name,_L("\\privateFile.tst"));
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Move(_L("\\privateFile.tst"),name);
-		test_KErrNone(r);
+		test(r == KErrNone);
 
 
 		// Testing Attribs
 		r=fMan->Attribs(_L("\\private\\two\\moo"),KEntryAttReadOnly,0,TTime(0)); 
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Attribs(_L("\\private\\moo"),KEntryAttReadOnly,0,TTime(0)); 
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Attribs(name,KEntryAttReadOnly,0,TTime(0));
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Attribs(name,0,KEntryAttReadOnly,TTime(0));
-		test_KErrNone(r);
+		test(r == KErrNone);
 
 		// Testing Move
 		r=fMan->Move(_L("\\private\\two\\moo"),_L("\\private\\one\\moo"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Move(_L("\\private\\two\\moo.."),_L("\\private\\one\\moo"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Move(_L("\\private\\two\\moo"),_L("\\private\\one\\moo.."));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Move(name,_L("\\privateFile.tst"));
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Move(_L("\\privateFile.tst"),name);
-		test_KErrNone(r);
+		test(r == KErrNone);
 
 
 		// Testing RmDir
 		r=fMan->RmDir(_L("\\private\\"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->RmDir(_L("\\private\\two\\"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->RmDir(_L("\\private\\tw?\\"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->RmDir(_L("\\sys\\"));
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		
 		
 		// Testing Rename
 		r=fMan->Rename(_L("\\private\\two\\moo"),_L("\\private\\two\\mew")); 
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		
 		// Testing Delete
 		r=fMan->Delete(_L("\\private\\two\\test")); 
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Delete(_L("\\private\\moo")); 
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 		r=fMan->Delete(_L("\\sys\\")); 
-		test_Value(r, r == KErrPermissionDenied);
+		test(r == KErrPermissionDenied);
 
 		//Something that actually exists in Private
 		r=fMan->Rename(name,_L("\\private\\00000001\\moo")); 
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Rename(_L("\\private\\00000001\\moo"),name); 
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Copy(name,_L("\\private\\00000001\\moo")); 
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Delete(_L("\\private\\00000001\\moo")); 
-		test_KErrNone(r);
+		test(r == KErrNone);
 
 		// Clean up the test data
 		r=fMan->RmDir(_L("\\Caged\\")); 
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Delete(_L("\\capTest")); 
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Delete(name); 
-		test_KErrNone(r);
+		test(r == KErrNone);
 		delete(fMan);
 		}
 	
@@ -1089,14 +1088,14 @@
 					test.Printf(_L("Setting %c:"), 'A'+i);
 					TInt ret = TheFs.SetSystemDrive((TDriveNumber)i);
 					test.Printf(_L("%d\n"), ret);
-					test_Value(ret, ret == KErrNone || ret == KErrAlreadyExists);
+					test(ret == KErrNone || ret == KErrAlreadyExists);
 					if(ret == KErrNone)
 						{
 						drive = (TDriveNumber)i;
 						test.Printf(_L("Re-setting %c:"), 'A'+i);
 						ret = TheFs.SetSystemDrive(drive);
 						test.Printf(_L("%d\n"), ret);
-						test_Value(ret, ret == KErrAlreadyExists);
+						test(ret == KErrAlreadyExists);
 						}
 					}
 				}
@@ -1115,8 +1114,7 @@
 	test.Next(_L("Delete test directory"));
 	CFileMan* fMan=CFileMan::NewL(TheFs);
 	TInt r=fMan->RmDir(gSessionPath);
-//	test_Value(r, r == KErrNone || r == KErrPathNotFound);
-	test(r == KErrNone || KErrPathNotFound);
+	test(r==KErrNone || KErrPathNotFound);
 	delete fMan;
 	}
 
@@ -1140,7 +1138,7 @@
 	sesspath[0] = (TText)gDriveToTest;
 
 	TInt r= TheFs.SetSessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	//cleanup from previous run of this test
 	TBuf<20> delDir;
@@ -1148,18 +1146,15 @@
 	delDir=KResourcePath;
 	delDir[0]=(TText)gDriveToTest;
 	r=fMan->RmDir(delDir);
-//	test_Value(r, r == KErrNone || r == KErrNotFound);
-	test(r == KErrNone || KErrNotFound);
+	test(r==KErrNone || KErrNotFound);
 	delDir=KSystemPath;
 	delDir[0]=(TText)gDriveToTest;
 	r=fMan->RmDir(delDir);
-//	test_Value(r, r == KErrNone || r == KErrNotFound);
-	test(r == KErrNone || KErrNotFound);
+	test(r==KErrNone || KErrNotFound);
 	delDir=KPrivatePath;
 	delDir[0]=(TText)gDriveToTest;
 	r=fMan->RmDir(delDir);
-//	test_Value(r, r == KErrNone || r == KErrNotFound);
-	test(r == KErrNone || KErrNotFound);
+	test(r==KErrNone || KErrNotFound);
 	delete fMan;
 
 	//check double mode ie that Defpath still works	
@@ -1167,30 +1162,30 @@
 	RFs fs2;
 	
 	r=fs1.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs1.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("session1 Path=%S"),&sesspath);
 
 	TBuf<30> privatepath;
 	r=fs1.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs1.PrivatePath(privatepath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=privatepath.Compare(KExpectedPrivatePath());
-	test_Value(r, r == 0);
+	test(r==0);
 	r=fs1.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=privatepath.Compare(sesspath.Mid(KPathPosition));
-	test_Value(r, r == 0);
+	test(r==0);
 	r=fs1.CreatePrivatePath(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fs1.Close();
 
 	r=fs2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs2.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("session2 Path=%S"),&sesspath);
 	fs2.Close();
 
--- a/kerneltest/f32test/server/t_dctcballfiles.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_dctcballfiles.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -13,7 +13,6 @@
 // Description:
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32std.h>
@@ -77,6 +76,9 @@
 TRequestStatus aStat3;
 TRequestStatus aStat4;
 
+TVolumeInfo aVolInfo;
+//	TDriveInfo adriveInfo;
+
 TBuf<40> systestfile;
 TBuf<40> pritestfile;
 TBuf<40> restestfile;
@@ -104,19 +106,19 @@
 	mkdirname.Append(systestname);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.RmDir(mkdirname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(systestname,EDriveO);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(systestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TheFs.NotifyChange(ENotifyAll,aStat1,systestname);
 	test(aStat1==KRequestPending);
@@ -131,29 +133,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(systestfile, shortfilename);
-	test_Value(r, r == KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(systestfile1, longfilename);
-	test_Value(r, r == KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,systestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Rename(systestfile,systestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Entry(systestfile1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetEntry(systestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(systestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 LOCAL_C void ResourceRFsTest()
@@ -168,19 +170,19 @@
 	mkdirname.Append(restestname);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.RmDir(mkdirname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(restestname,EDriveO);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(restestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TheFs.NotifyChange(ENotifyAll,aStat4,restestname);
 	test(aStat4==KRequestPending);
@@ -195,29 +197,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(restestfile, shortfilename);
-	test_Value(r, r == KErrNone || r == KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(restestfile1, longfilename);
-	test_Value(r, r == KErrNone || r == KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,restestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Rename(restestfile,restestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Entry(restestfile1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetEntry(restestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(restestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	}
 
@@ -235,19 +237,19 @@
 	mkdirname.Append(KMkDirSub);
 
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(pritestfalseidname,EDriveO);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(pritestfalseidname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyAll,aStat2,pritestfalseidname);
 	test(aStat2==KRequestPending);
@@ -263,29 +265,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(pritestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	}
 
@@ -304,19 +306,19 @@
 	mkdirname.Append(KMkDirSub);
 
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(pritestname,EDriveO);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(pritestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyAll,aStat2,pritestname);
 	test(aStat2==KRequestPending);
@@ -332,29 +334,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(pritestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	}
 
@@ -368,19 +370,19 @@
 	mkdirname.Append(theprivatepath);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(theprivatepath,EDriveO);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(theprivatepath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyAll,aStat3,theprivatepath);
 	test(aStat3==KRequestPending);
@@ -395,29 +397,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(pritestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 
@@ -428,29 +430,29 @@
 	{
 
 	r=TheFs.SetSessionPath(systestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.Temp(TheFs,systestname,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFileSys,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileSys,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Open(TheFs,KFileSys,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Replace(TheFs,KFileSys,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Rename(KFileSys3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
     TFindFile finder(TheFs);
@@ -458,7 +460,7 @@
     r=finder.FindWildByDir(KWildFile, KWildPath, dir);
 	if (!(r==KErrNone))
         test.Printf(_L("T_DCTCBALLFILES: test find wildcards r = %d (expected KErrNone)\n"), r);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	delete dir;
 	}
 
@@ -468,40 +470,40 @@
 //
 	{
 	r=TheFs.SetSessionPath(restestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.Temp(TheFs,restestname,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFileRes,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes,EFileWrite|EFileShareExclusive );
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Rename(KFileRes3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes3,EFileShareReadersOrWriters|EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes3,EFileShareReadersOrWriters|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes3,EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.ChangeMode(EFileShareExclusive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Replace(TheFs,KFileRes,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();	
 	}
 
@@ -512,29 +514,29 @@
 //
 	{
 	r=TheFs.SetSessionPath(pritestfalseidname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.Temp(TheFs,pritestfalseidname,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Open(TheFs,KFilePri,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Replace(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Rename(KFilePri3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	}
 
@@ -545,29 +547,29 @@
 //
 	{
 	r=TheFs.SetSessionPath(pritestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.Temp(TheFs,pritestname,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Open(TheFs,KFilePri,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Replace(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Rename(KFilePri3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	}
 
@@ -578,29 +580,29 @@
 //
 	{
 	r=TheFs.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Temp(TheFs,theprivatepath,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Open(TheFs,KFilePri,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Replace(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Rename(KFilePri3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	}
 
@@ -615,10 +617,10 @@
 	TBuf<30> dirNameBuf(KSystemPath);
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dirNameBuf.Zero();
 	delete dirEntries;
 
@@ -626,10 +628,10 @@
 	dirNameBuf=KPrivatePath;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dirNameBuf.Zero();
 	delete dirEntries;
 
@@ -637,10 +639,10 @@
 	dirNameBuf=KPrivateFalseID;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dirNameBuf.Zero();
 	delete dirEntries;
 
@@ -649,19 +651,19 @@
 	dirNameBuf.Insert(0,_L("?:"));
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dirNameBuf.Zero();
 	delete dirEntries;
 	//Resource
 	dirNameBuf=KResourcePath;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	delete dirEntries;
 	}
@@ -673,21 +675,21 @@
 //
 	{
 	r=TheFs.FileSystemName(fsname,gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = DismountFileSystem(TheFs, fsname, gTheDriveNum);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 //	r=TheFs.RemoveFileSystem(fsname);	//can not test due to bug else where fix exists
-//	test_KErrNone(r);
+//	test(r==KErrNone);
 //	r=TheFs.AddFileSystem(fsname);
-//	test_KErrNone(r);
+//	test(r==KErrNone);
 	r = MountFileSystem(TheFs, fsname, gTheDriveNum);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	test.Printf(_L("r=%d"),r);
 	r=TheFs.SetDriveName(gTheDriveNum,KDriveName);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 #ifndef __WINS__
  	r=TheFs.SetVolumeLabel(KVolLable, gTheDriveNum);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 #endif
 
 	systemRFsTest();
@@ -713,11 +715,11 @@
 	test(aStat4==KErrNone);
 
 	r=TheFs.SetSessionPath(systestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 //Test RRawDisk class
 	r=rawdisk.Open(TheFs,gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	rawdisk.Close();
 
 	RDirtest();
@@ -728,12 +730,12 @@
 		{
 		//Test RFormat class
 		r=format.Open(TheFs,driveBuf,EHighDensity,count);
-		test_Value(r, r == KErrPermissionDenied);
+		test(r==KErrPermissionDenied);
 
 		while(count)	
 			{
 			TInt r=format.Next(count);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			}
 		format.Close();
 		}
@@ -741,9 +743,9 @@
 	driveBuf[0]=(TText)gDriveToTest;
 	r=TheFs.ScanDrive(driveBuf);
 	RDebug::Print(_L("r=%d"),r);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	r=TheFs.CheckDisk(driveBuf);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	}
 
 LOCAL_C void TestCaps()
@@ -761,16 +763,16 @@
 	
 	driveBuf[0]=(TText)gDriveToTest;
 	r=TheFs.SessionPath(temp);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Printf(_L("Session path: %S"),&temp);
 
 	r=TheFs.CreatePrivatePath(gTheDriveNum);
-	test_Value(r, r == KErrNone || r== KErrAlreadyExists);
+	test(r==KErrNone || r== KErrAlreadyExists);
 
 	TBuf<18> tempPri;
 	r=TheFs.PrivatePath(tempPri);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	theprivatepath = _L("?:");
 	theprivatepath.Append(tempPri);
 
@@ -778,9 +780,9 @@
 	
 	TFileName thesessionpath;
 	r=TheFs.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SessionPath(thesessionpath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test(thesessionpath == theprivatepath);
 	}
@@ -792,16 +794,16 @@
 	{
 	CDirScan* scanner = NULL;
 	TRAP(r, scanner = CDirScan::NewL(TheFs));
-	test_Value(r, r == KErrNone && scanner);
+	test(r == KErrNone && scanner);
 
 	TRAP(r, scanner->SetScanDataL(aName,KEntryAttDir,ESortByName|EAscending,aDirection));
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	CDir *entryList=NULL;
 	for (;;)
 		{
 		TRAP(r, scanner->NextL(entryList));
-		test_Value(r, r == aError);
+		test(r == aError);
 		if (entryList==NULL)
 			break;
 
@@ -843,11 +845,11 @@
 		test.Printf(_L("Private Path is=%S"),&privatepath);
 		
 		r = TheFs.MkDir(_L("\\Caged\\"));
-		test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+		test(r==KErrNone || r==KErrAlreadyExists);
 		
 		CDir* entryCount=NULL;
 		r=TheFs.GetDir(_L("\\*.*"),KEntryAttNormal|KEntryAttDir,ESortNone,entryCount);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		
 		delete entryCount;
 		entryCount=NULL;
@@ -856,23 +858,23 @@
 		//Testing Copy
 		CDir* entryCount2=NULL;
 		r=fMan->Copy(_L("\\sys\\"),_L("\\Caged\\"));
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Copy(_L("\\*"),_L("\\Caged\\"));
-		test_KErrNone(r);
+		test(r == KErrNone);
 		
 		r=TheFs.GetDir(_L("\\Caged\\*.*"),KEntryAttNormal|KEntryAttDir,ESortNone,entryCount2);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		
 		delete entryCount2;
 		entryCount2=NULL;
 	
 		r=fMan->Copy(_L("\\private\\two\\moo"),_L("\\private\\two\\mew")); 
-		test_Value(r, r == KErrPathNotFound);
+		test(r == KErrPathNotFound);
 	
 		// Create a test file
 		RFile testFile;
 		r = testFile.Replace(TheFs, _L("\\capTest"),EFileWrite);
-		test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+		test(r==KErrNone || r==KErrAlreadyExists);
 		testFile.Close();
 		
 		TFileName name;
@@ -880,88 +882,88 @@
 		name.Append(_L("privateFile.tst"));
 		RFile privateFile;
 		r = privateFile.Replace(TheFs, name,EFileWrite);
-		test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+		test(r==KErrNone || r==KErrAlreadyExists);
 		privateFile.Close();
 
 	
 		r=fMan->Copy(_L("\\capTest"),_L("\\private\\two\\moo")); 
-		test_Value(r, r == KErrPathNotFound);
+		test(r == KErrPathNotFound);
 		r=fMan->Copy(_L("\\capTest"),_L("\\sys\\bin\\moo")); 
-		test_Value(r, r == KErrPathNotFound); 
+		test(r == KErrPathNotFound); 
 		r=fMan->Copy(_L("\\sys\\bin\\capTest"),_L("\\sys\\bin\\moo")); 
-		test_Value(r, r == KErrPathNotFound);
+		test(r == KErrPathNotFound);
 		r=fMan->Copy(_L("\\capTest"),_L("\\sys\\capTest")); 
-		test_Value(r, r == KErrNone || r==KErrAlreadyExists); 
+		test(r == KErrNone || r==KErrAlreadyExists); 
 		r=fMan->Copy(_L("\\sys\\*"),_L("\\"));
-		test_KErrNone(r);
+		test (r==KErrNone);
 		r=fMan->Copy(name,_L("\\sys\\"));
-		test_KErrNone(r);
+		test(r==KErrNone);
 
 		// Testing Attribs
 		r=fMan->Attribs(_L("\\private\\two\\moo"),KEntryAttReadOnly,0,TTime(0)); 
-		test_Value(r, r == KErrPathNotFound);
+		test(r == KErrPathNotFound);
 		r=fMan->Attribs(_L("\\private\\moo"),KEntryAttReadOnly,0,TTime(0)); 
-		test_Value(r, r == KErrNotFound);
+		test(r == KErrNotFound);
 		r=fMan->Attribs(name,KEntryAttReadOnly,0,TTime(0));
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Attribs(name,0,KEntryAttReadOnly,TTime(0));
-		test_KErrNone(r);
+		test(r == KErrNone);
 
 		// Testing Move
 		r=fMan->Move(_L("\\private\\two\\moo"),_L("\\private\\one\\moo"));
-		test_Value(r, r == KErrPathNotFound);
+		test(r == KErrPathNotFound);
 		r=fMan->Move(_L("\\private\\two\\moo.."),_L("\\private\\one\\moo"));
-		test_Value(r, r == KErrPathNotFound);
+		test(r == KErrPathNotFound);
 		r=fMan->Move(_L("\\private\\two\\moo"),_L("\\private\\one\\moo.."));
-		test_Value(r, r == KErrPathNotFound);
+		test(r == KErrPathNotFound);
 		r=fMan->Move(name,_L("\\privateFile.tst"));
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Move(_L("\\privateFile.tst"),name);
-		test_KErrNone(r);
+		test(r == KErrNone);
 
 
 		// Testing RmDir
 		r=fMan->RmDir(_L("\\private\\"));
-		test_KErrNone(r);
+		test(r == KErrNone);
 		// put it back where it was
 		r = TheFs.MkDirAll(_L("\\private\\00000001\\"));
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->RmDir(_L("\\private\\two\\"));
-		test_Value(r, r == KErrPathNotFound);
+		test(r == KErrPathNotFound);
 		r=fMan->RmDir(_L("\\private\\tw?\\"));
-		test_Value(r, r == KErrBadName);
+		test(r == KErrBadName);
 
 		r=fMan->RmDir(_L("\\private\\two\\"));
-		test_Value(r, r == KErrPathNotFound);
+		test(r == KErrPathNotFound);
 		r=fMan->RmDir(_L("\\private\\tw?\\"));
-		test_Value(r, r == KErrBadName);
+		test(r == KErrBadName);
 		
 		
 		// Testing Rename
 		r=fMan->Rename(_L("\\private\\two\\moo"),_L("\\private\\two\\mew")); 
-		test_Value(r, r == KErrPathNotFound);
+		test(r == KErrPathNotFound);
 		
 		// Testing Delete
 		r=fMan->Delete(_L("\\private\\two\\test")); 
-		test_Value(r, r == KErrPathNotFound);
+		test(r == KErrPathNotFound);
 		r=fMan->Delete(_L("\\private\\moo")); 
-		test_Value(r, r == KErrNotFound);
+		test(r == KErrNotFound);
 		
 		//Something that actually exists in Private
 		r=fMan->Rename(name,_L("\\private\\00000001\\moo")); 
-		test_Value(r, r == KErrNotFound);
+		test(r == KErrNotFound);
 		r=fMan->Rename(_L("\\private\\00000001\\moo"),name); 
-		test_Value(r, r == KErrNotFound);
+		test(r == KErrNotFound);
 		r=fMan->Copy(name,_L("\\private\\00000001\\moo")); 
-		test_Value(r, r == KErrNotFound);
+		test(r == KErrNotFound);
 		r=fMan->Delete(_L("\\private\\00000001\\moo")); 
-		test_Value(r, r == KErrNotFound);
+		test(r == KErrNotFound);
 
 		// Clean up the test data
 		r=fMan->RmDir(_L("\\Caged\\")); 
-		test_KErrNone(r);
+		test(r == KErrNone);
 		r=fMan->Delete(_L("\\capTest")); 
-		test_KErrNone(r);
+		test(r == KErrNone);
 		delete(fMan);
 		}
 	
@@ -982,7 +984,7 @@
 	test.Next(_L("Delete test directory"));
 	CFileMan* fMan=CFileMan::NewL(TheFs);
 	TInt r=fMan->RmDir(gSessionPath);
-	test_Value(r, r == KErrNone || r == KErrPathNotFound);
+	test(r==KErrNone || KErrPathNotFound);
 	delete fMan;
 	}
 
@@ -1006,7 +1008,7 @@
 	sesspath[0] = (TText)gDriveToTest;
 
 	TInt r= TheFs.SetSessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	//cleanup from previous run of this test
 	TBuf<20> delDir;
@@ -1014,15 +1016,15 @@
 	delDir=KResourcePath;
 	delDir[0]=(TText)gDriveToTest;
 	r=fMan->RmDir(delDir);
-	test_Value(r, r == KErrNone || r == KErrNotFound || r == KErrPathNotFound);
+	test(r==KErrNone || KErrNotFound);
 	delDir=KSystemPath;
 	delDir[0]=(TText)gDriveToTest;
 	r=fMan->RmDir(delDir);
-	test_Value(r, r == KErrNone || r == KErrNotFound || r == KErrPathNotFound);
+	test(r==KErrNone || KErrNotFound);
 	delDir=KPrivatePath;
 	delDir[0]=(TText)gDriveToTest;
 	r=fMan->RmDir(delDir);
-	test_Value(r, r == KErrNone || r == KErrNotFound || r == KErrPathNotFound);
+	test(r==KErrNone || KErrNotFound);
 	delete fMan;
 
 	//check double mode ie that Defpath still works	
@@ -1030,30 +1032,30 @@
 	RFs fs2;
 	
 	r=fs1.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs1.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("session1 Path=%S"),&sesspath);
 
 	TBuf<30> privatepath;
 	r=fs1.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs1.PrivatePath(privatepath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=privatepath.Compare(KExpectedPrivatePath());
-	test_Value(r, r == 0);
+	test(r==0);
 	r=fs1.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=privatepath.Compare(sesspath.Mid(KPathPosition));
-	test_Value(r, r == 0);
+	test(r==0);
 	r=fs1.CreatePrivatePath(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fs1.Close();
 
 	r=fs2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs2.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("session2 Path=%S"),&sesspath);
 	fs2.Close();
 
--- a/kerneltest/f32test/server/t_dctcbdiskadmin.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_dctcbdiskadmin.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -13,7 +13,6 @@
 // Description:
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32std.h>
@@ -76,6 +75,9 @@
 TRequestStatus aStat3;
 TRequestStatus aStat4;
 
+TVolumeInfo aVolInfo;
+//	TDriveInfo adriveInfo;
+
 TBuf<40> systestfile;
 TBuf<40> pritestfile;
 TBuf<40> restestfile;
@@ -107,19 +109,19 @@
 	mkdirname.Append(KMkDirSub);
 
 	r=TheFs.MkDirAll(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetSubst(pritestfalseidname,EDriveO);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(pritestfalseidname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	TheFs.NotifyChange(ENotifyAll,aStat2,pritestfalseidname);
 	test(aStat2==KErrPermissionDenied);
@@ -135,32 +137,32 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported);
+	test(r==KErrPermissionDenied || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported);
+	test(r==KErrPermissionDenied || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.Delete(pritestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.Delete(oldName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	__UHEAP_MARKEND;
 	}
@@ -178,22 +180,22 @@
 	mkdirname.Append(systestname);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.RmDir(mkdirname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(systestname,EDriveO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetSubst(_L(""),EDriveO); //to unsubst
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(systestname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	TheFs.NotifyChange(ENotifyAll,aStat1,systestname);
 	test(aStat1==KErrPermissionDenied);
@@ -208,32 +210,32 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(systestfile, shortfilename);
-	test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported);
+	test(r==KErrPermissionDenied || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(systestfile1, longfilename);
-	test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported);
+	test(r==KErrPermissionDenied || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,systestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Delete(systestfile1);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 
 	r=TheFs.Rename(systestfile,systestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Entry(systestfile1,entry);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetEntry(systestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(systestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	__UHEAP_MARKEND;
 	}
@@ -252,22 +254,22 @@
 	mkdirname.Append(restestname);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.RmDir(mkdirname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(restestname,EDriveO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(_L(""),EDriveO); //to unsubst
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(restestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TheFs.NotifyChange(ENotifyAll,aStat4,restestname);
 	test(aStat4==KRequestPending);
@@ -282,32 +284,32 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(restestfile, shortfilename);
-	test_Value(r, r == KErrNone || r == KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(restestfile1, longfilename);
-	test_Value(r, r == KErrNone || r == KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,restestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Delete(restestfile1);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 
 	r=TheFs.Rename(restestfile,restestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Entry(restestfile1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetEntry(restestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(restestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 
 	__UHEAP_MARKEND;
@@ -329,19 +331,19 @@
 	mkdirname.Append(KMkDirSub);
 
 	r=TheFs.MkDirAll(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetSubst(pritestname,EDriveO);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(pritestname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	TheFs.NotifyChange(ENotifyAll,aStat2,pritestname);
 	test(aStat2==KErrPermissionDenied);
@@ -357,29 +359,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported);
+	test(r==KErrPermissionDenied || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test_Value(r, r == KErrPermissionDenied || r==KErrNotSupported);
+	test(r==KErrPermissionDenied || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=TheFs.Delete(pritestfile1);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 
 	__UHEAP_MARKEND;
@@ -397,22 +399,22 @@
 	mkdirname.Append(theprivatepath);
 	mkdirname.Append(KMkDirSub);
 	r=TheFs.MkDirAll(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.RmDir(mkdirname);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(theprivatepath,EDriveO);	
-	test_KErrNone(r); 
+	test(r==KErrNone); 
 
 	r=TheFs.RealName(_L("O:\\File.XXX"),realName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSubst(_L(""),EDriveO);	 //to unsubst
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetSessionPath(theprivatepath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyAll,aStat3,theprivatepath);
 	test(aStat3==KRequestPending);
@@ -427,29 +429,29 @@
 	oldName[0]=(TText)gDriveToTest;
 
 	r=TheFs.GetShortName(pritestfile, shortfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=TheFs.GetLongName(pritestfile1, longfilename);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotFound || r==KErrNotSupported);
 
 	r=file1.Create(TheFs,oldName,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=TheFs.Replace(oldName,pritestfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=TheFs.Rename(pritestfile,pritestfile1);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	
 	r=TheFs.Entry(pritestfile1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.SetEntry(pritestfile1,testtime,KEntryAttNormal,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(pritestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	__UHEAP_MARKEND;
 	}
@@ -463,10 +465,10 @@
 	__UHEAP_MARK;
 
 	r=TheFs.SetSessionPath(systestname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Temp(TheFs,systestname,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	systestfile=KSystemPath;
@@ -476,22 +478,22 @@
 	systestfile1.Append(KFileSys3);
 
 	r=file1.Create(TheFs,systestfile,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,systestfile,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Open(TheFs,systestfile,EFileRead);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=file1.Replace(TheFs,systestfile,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Rename(systestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
     TFindFile finder(TheFs);
@@ -499,14 +501,14 @@
     r=finder.FindWildByDir(KWildFile, KWildPath, dir);
 	if (!(r==KErrPermissionDenied))
         test.Printf(_L("T_DCTCBDISKADMIN: test find wildcards r = %d (expected KErrPermissionDenied)\n"), r);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 //	delete dir;
 
 	r=TheFs.Delete(fromTemp);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(systestfile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 
 	__UHEAP_MARKEND;
@@ -520,50 +522,50 @@
 	__UHEAP_MARK;
 
 	r=TheFs.SetSessionPath(restestname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.Temp(TheFs,restestname,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFileRes,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes,EFileWrite|EFileShareExclusive );
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Rename(KFileRes3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes3,EFileShareReadersOrWriters|EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes3,EFileShareReadersOrWriters|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFileRes3,EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file1.ChangeMode(EFileShareExclusive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Replace(TheFs,KFileRes,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();	
 
 	r=TheFs.Delete(KFileRes);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(KFileRes3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(fromTemp);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	__UHEAP_MARKEND;
 	}
@@ -577,7 +579,7 @@
 	__UHEAP_MARK;
 
 	r=TheFs.SetSessionPath(pritestfalseidname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	// Since can't set the session path to what is required, so use
 	// an explicit path
@@ -586,23 +588,23 @@
 	pritestfile.Append(KFilePri);
 
 	r=file1.Temp(TheFs,pritestfalseidname,fromTemp,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=file1.Create(TheFs,pritestfile,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=file1.Open(TheFs,pritestfile,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 	
 	r=file1.Replace(TheFs,pritestfile,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	// Can't perform this operation since file1 has not been created
 /*	r=file1.Rename(KFilePri3);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 */
 	__UHEAP_MARKEND;
@@ -618,10 +620,10 @@
 	__UHEAP_MARK;
 
 	r=TheFs.SetSessionPath(pritestname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	r=file1.Temp(TheFs,pritestname,fromTemp,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	// Since can't set session path create explicit path
@@ -630,28 +632,28 @@
 	pritestfile.Append(KFilePri);
 
 	r=file1.Create(TheFs,pritestfile,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=file1.Open(TheFs,pritestfile,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 	
 	r=file1.Open(TheFs,pritestfile,EFileRead);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 	
 	r=file1.Replace(TheFs,pritestfile,EFileWrite);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 
 	// Can't rename nor delete since file1 not created
 /*
 	r=file1.Rename(KFilePri3);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	file1.Close();
 
 	r=TheFs.Delete(fromTemp);
-	test_KErrNone(r);
+	test(r==KErrNone);
 */
 
 	__UHEAP_MARKEND;
@@ -667,36 +669,36 @@
 	__UHEAP_MARK;
 
 	r=TheFs.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Temp(TheFs,theprivatepath,fromTemp,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=file1.Create(TheFs,KFilePri,EFileWrite);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	file1.Close();
 
 	r=file1.Open(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Open(TheFs,KFilePri,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	
 	r=file1.Replace(TheFs,KFilePri,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Rename(KFilePri3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 
 	r=TheFs.Delete(KFilePri3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Delete(fromTemp);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	__UHEAP_MARKEND;
 	}
@@ -714,10 +716,10 @@
 	TBuf<30> dirNameBuf(KSystemPath);
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dirNameBuf.Zero();
 	delete dirEntries;
 
@@ -725,10 +727,10 @@
 	dirNameBuf=KPrivatePath;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dirNameBuf.Zero();
 	delete dirEntries;
 
@@ -736,10 +738,10 @@
 	dirNameBuf=KPrivateFalseID;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	dirNameBuf.Zero();
 	delete dirEntries;
 
@@ -748,10 +750,10 @@
 	dirNameBuf.Insert(0,_L("?:"));
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dirNameBuf.Zero();
 	delete dirEntries;
 	//Resource
@@ -759,9 +761,9 @@
 	dirNameBuf=KResourcePath;
 	dirNameBuf[0]=(TText)gDriveToTest;
 	r=dir.Open(TheFs,dirNameBuf,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.GetDir(dirNameBuf,KEntryAttMatchMask,ESortByName,dirEntries);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	delete dirEntries;
 
@@ -777,20 +779,20 @@
 	__UHEAP_MARK;
 
 	r=TheFs.FileSystemName(fsname,gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = DismountFileSystem(TheFs, fsname, gTheDriveNum);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 //	r=TheFs.RemoveFileSystem(fsname);	//can not test due to bug else where fix exists
-//	test_KErrNone(r);
+//	test(r==KErrNone);
 //	r=TheFs.AddFileSystem(fsname);
-//	test_KErrNone(r);
+//	test(r==KErrNone);
 	r = MountFileSystem(TheFs, fsname, gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetDriveName(gTheDriveNum,KDriveName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 #ifndef __WINS__
  	r=TheFs.SetVolumeLabel(KVolLable, gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 #endif
 
 	systemRFsTest();
@@ -816,11 +818,11 @@
 	test(aStat4==KErrNone);
 
 	r=TheFs.SetSessionPath(systestname);
-	test_Value(r, r == KErrPermissionDenied);
+	test(r==KErrPermissionDenied);
 	
 //Test RRawDisk class
 	r=rawdisk.Open(TheFs,gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	rawdisk.Close();
 
 	RDirtest();
@@ -831,21 +833,21 @@
 		{
 		//Test RFormat class
 		r=format.Open(TheFs,driveBuf,EHighDensity,count);
-		test_KErrNone(r);
+		test(r==KErrNone);
 
 		while(count)	
 			{
 			TInt r=format.Next(count);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			}
 		format.Close();
 		}
 
 	driveBuf[0]=(TText)gDriveToTest;
 	r=TheFs.ScanDrive(driveBuf);
-	test_Value(r, r == KErrNone || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotSupported);
 	r=TheFs.CheckDisk(driveBuf);
-	test_Value(r, r == KErrNone || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotSupported);
 
 	__UHEAP_MARKEND;
 	}
@@ -865,16 +867,16 @@
 
 	driveBuf[0]=(TText)gDriveToTest;
 	r=TheFs.SessionPath(temp);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Printf(_L("Session path: %S"),&temp);
 
 	r=TheFs.CreatePrivatePath(gTheDriveNum);
-	test_Value(r, r == KErrNone || r== KErrAlreadyExists);
+	test(r==KErrNone || r== KErrAlreadyExists);
 
 	TBuf<18> tempPri;
 	r=TheFs.PrivatePath(tempPri);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	theprivatepath = _L("?:");
 	theprivatepath.Append(tempPri);
 
@@ -883,9 +885,9 @@
 	TFileName thesessionpath;
 
 	r=TheFs.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SessionPath(thesessionpath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	test(thesessionpath == theprivatepath);
 
@@ -900,19 +902,19 @@
 	test.Next(_L("Delete test directory"));
 	CFileMan* fMan=CFileMan::NewL(TheFs);
 	TInt r=fMan->RmDir(gSessionPath);
-	test_Value(r, r == KErrNone || r==KErrPathNotFound);
+	test(r==KErrNone || r==KErrPathNotFound);
 
 	TBuf<20> delDir;
 	delDir=KResourcePath;
 	delDir[0]=(TText)gDriveToTest;
 	r=fMan->RmDir(delDir);
-	test_Value(r, r == KErrNone || r==KErrPathNotFound);
+	test(r==KErrNone || r==KErrPathNotFound);
 	delete fMan;
 
 	delDir=KSystemPath;
 	delDir[0]=(TText)gDriveToTest;
 	r=TheFs.RmDir(delDir);
-	test_Value(r, r == KErrNone || r==KErrPathNotFound || r==KErrNotFound);
+	test(r==KErrNone || r==KErrPathNotFound || r==KErrNotFound);
 	}
 
 GLDEF_C void CallTestsL(/*TChar aDriveLetter*/)
@@ -939,12 +941,12 @@
 	sesspath[0] = (TText)gDriveToTest;
 
 	TInt r= TheFs.SetSessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	//cleanup from previous run of this test
 	RProcess tp;
 	r=tp.Create(_L("clean_prepdc.exe"),sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	{
 	TRequestStatus ps;
 	tp.Logon(ps);
@@ -958,30 +960,30 @@
 	RFs fs2;
 	
 	r=fs1.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs1.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("session1 Path=%S"),&sesspath);
 
 	TBuf<30> privatepath;
 	r=fs1.SetSessionToPrivate(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs1.PrivatePath(privatepath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=privatepath.Compare(KExpectedPrivatePath());
-	test_Value(r, r == 0);
+	test(r==0);
 	r=fs1.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=privatepath.Compare(sesspath.Mid(KPathPosition));
-	test_Value(r, r == 0);
+	test(r==0);
 	r=fs1.CreatePrivatePath(gTheDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fs1.Close();
 
 	r=fs2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs2.SessionPath(sesspath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("session2 Path=%S"),&sesspath);
 	fs2.Close();
 
--- a/kerneltest/f32test/server/t_dircache.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,612 +0,0 @@
-// Copyright (c) 1995-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:
-// f32test\server\t_dircache.cpp
-// 
-//
-#define __E32TEST_EXTENSION__
-#include <f32file.h>
-#include <f32fsys.h>
-#include <e32test.h>
-#include <f32dbg.h>
-#include "t_server.h"
-#include "t_chlffs.h"
-#include "f32_test_utils.h"
-#include "fat_utils.h"
-#include "d_pagestress.h"
-
-RTest test(_L("T_DIRCACHE"));
-
-/*
- * This whole test execute on UDEB mode only.
- */
-#if defined(_DEBUG) || defined(_DEBUG_RELEASE)
-
-TInt gDrive=-1;
-const TInt32 KDef_KLeafDirCacheSize = 32;                    // default leaf dir cache number
-const TInt32 KDef_DynamicDirCacheMinInBytes = 128 << 10;     // default minimum fat dir cache size in bytes
-const TInt32 KDef_DynamicDirCacheMaxInBytes = 256 << 10;     // default maximum fat dir cache size in bytes
-const TInt32 KDef_MaxDynamicDirCachePageSzLog2 = 14;         // default value for directory cache single page 
-                                                              //  maximal size Log2, 2^14 (16K) by default
-const TInt32 KMaxThreadCount = 1;                            // the maximum number of multiple threads that can
-                                                              //  access dir cache concurrently.
-const TInt32 KSegmentSize = 1 << 12;                            // the smallest memory unit that Kernel manages  
-
-template <class C>
-TInt controlIo(RFs &fs, TInt drv, TInt fkn, C &c)
-    {
-    TPtr8 ptrC((TUint8 *)&c, sizeof(C), sizeof(C));
-
-    TInt r = fs.ControlIo(drv, fkn, ptrC);
-
-    return r;
-    }
-
-// See f32\sfile\sf_memory_man.cpp for the default value settings
-const TInt  KDefaultGlobalCacheMemorySize = (8 << 10) << 10;
-const TInt  KDefaultLowMemoryThreshold = 10;
-//----------------------------------------------------------------------------------------------
-//@SYMTestCaseID      PBASE-XXXX 
-//@SYMTestType        FT
-//@SYMPREQ            PREQ1885
-//@SYMTestCaseDesc    Check global cache settings. The global cache should be either:
-//                      1. 0 (disabled)
-//                      2. no less than the sum of all per-drive settings
-//----------------------------------------------------------------------------------------------
-void TestGlobalSettings()
-    {
-    test.Next(_L("Test global cache settings"));
-    // read global cache settings from estart.txt
-    TGlobalCacheConfig globalCacheConfig;
-    TInt r = controlIo(TheFs,gDrive, KControlIoGlobalCacheConfig, globalCacheConfig);
-	test_KErrNone(r);
-    test_Value (globalCacheConfig.iGlobalCacheSizeInBytes,
-				globalCacheConfig.iGlobalCacheSizeInBytes > 0 || globalCacheConfig.iGlobalCacheSizeInBytes == KErrNotFound);
-    test_Value (globalCacheConfig.iGlobalLowMemoryThreshold,
-				globalCacheConfig.iGlobalLowMemoryThreshold >= 0 || globalCacheConfig.iGlobalLowMemoryThreshold == KErrNotFound);
-
-    const TInt32 globalCacheSize = globalCacheConfig.iGlobalCacheSizeInBytes > 0 ? 
-                                       globalCacheConfig.iGlobalCacheSizeInBytes : KDefaultGlobalCacheMemorySize;
-
-    // test if global cache is enabled, it is configured in the way that its figure is no less
-    //  than the sum of per-drive max size settings (taking default values into account). 
-    TInt32 sumDirCacheMaxSize = 0;
-    for (TInt i = 0; i < KMaxDrives; i++)
-        {
-        TBuf<0x20>  fsName;
-        r = TheFs.FileSystemName(fsName, i);
-
-        if (r == KErrNone && (F32_Test_Utils::Is_Fat(TheFs, i) || F32_Test_Utils::Is_ExFat(TheFs, i)))
-            {
-            test.Printf(_L("drive[%C:] file system: (\"%S\")\n"), 'A' + i, &fsName);
-            TDirCacheConfig dirCacheConfig;
-            r = controlIo(TheFs,gDrive, KControlIoDirCacheConfig, dirCacheConfig);
-            test_KErrNone(r);
-            if(dirCacheConfig.iDirCacheSizeMax > 0)
-                {
-                sumDirCacheMaxSize += (dirCacheConfig.iDirCacheSizeMax > KDef_DynamicDirCacheMaxInBytes ? dirCacheConfig.iDirCacheSizeMax : KDef_DynamicDirCacheMaxInBytes);
-                }
-            else
-                {
-                sumDirCacheMaxSize += KDef_DynamicDirCacheMaxInBytes;
-                }
-            test.Printf(_L("++sumDirCacheMaxSize = %d\n"), sumDirCacheMaxSize);
-            }
-        }
-    test_Compare(globalCacheSize, >=, sumDirCacheMaxSize);
-    }
-
-//----------------------------------------------------------------------------------------------
-//@SYMTestCaseID      PBASE-XXXX 
-//@SYMTestType        FT
-//@SYMPREQ            PREQ1885
-//@SYMTestCaseDesc    Test current drive's dir cache configurations, the current dir cache info should
-//                      match the configurations read from estart.txt file.
-//----------------------------------------------------------------------------------------------
-void TestDirCacheSettings()
-    {
-    test.Next(_L("Test current drive's dir cache settings"));
-    
-    // test global cache config is ON 
-    TGlobalCacheConfig globalCacheConfig;
-    TInt r = controlIo(TheFs,gDrive, KControlIoGlobalCacheConfig, globalCacheConfig);
-    test_KErrNone(r);
-    test_Value (globalCacheConfig.iGlobalCacheSizeInBytes,
-				globalCacheConfig.iGlobalCacheSizeInBytes > 0 || globalCacheConfig.iGlobalCacheSizeInBytes == KErrNotFound);
-    test_Value (globalCacheConfig.iGlobalLowMemoryThreshold,
-				globalCacheConfig.iGlobalLowMemoryThreshold >= 0 || globalCacheConfig.iGlobalLowMemoryThreshold == KErrNotFound);
-    
-    // test global cache info is corresponding to the configurations
-    TGlobalCacheInfo globalCacheInfo;
-    r = controlIo(TheFs,gDrive, KControlIoGlobalCacheInfo, globalCacheInfo);
-    test_KErrNone(r);
-
-    if (globalCacheConfig.iGlobalCacheSizeInBytes == KErrNotFound)
-        {
-        test_Equal(KDefaultGlobalCacheMemorySize, globalCacheInfo.iGlobalCacheSizeInBytes);
-        }
-    else
-        {
-        test_Equal(globalCacheConfig.iGlobalCacheSizeInBytes, globalCacheInfo.iGlobalCacheSizeInBytes);
-        }
-
-    if (globalCacheConfig.iGlobalLowMemoryThreshold == KErrNotFound)
-        {
-        test_Equal(KDefaultLowMemoryThreshold, globalCacheInfo.iGlobalLowMemoryThreshold);
-        }
-    else
-        {
-        test_Equal(globalCacheConfig.iGlobalLowMemoryThreshold, globalCacheInfo.iGlobalLowMemoryThreshold);
-        }
-    
-    // read per-drive settings from estart.txt
-    TDirCacheConfig dirCacheConfig;
-    r = controlIo(TheFs,gDrive, KControlIoDirCacheConfig, dirCacheConfig);
-    test_KErrNone(r);
-    test_Value (dirCacheConfig.iLeafDirCacheSize,
-				dirCacheConfig.iLeafDirCacheSize >= 0 || dirCacheConfig.iLeafDirCacheSize == KErrNotFound);
-    test_Value (dirCacheConfig.iDirCacheSizeMin,
-				dirCacheConfig.iDirCacheSizeMin >= 0 || dirCacheConfig.iDirCacheSizeMin == KErrNotFound);
-    test_Value (dirCacheConfig.iDirCacheSizeMax,
-				dirCacheConfig.iDirCacheSizeMax >= 0 || dirCacheConfig.iDirCacheSizeMax == KErrNotFound);
-    
-    // caculate expected settings according to the readings from estart.txt
-    if (dirCacheConfig.iLeafDirCacheSize == 0)
-        dirCacheConfig.iLeafDirCacheSize = 1;
-    if (dirCacheConfig.iLeafDirCacheSize == KErrNotFound)
-        dirCacheConfig.iLeafDirCacheSize = KDef_KLeafDirCacheSize;
-    if (dirCacheConfig.iDirCacheSizeMin < KDef_DynamicDirCacheMinInBytes)
-        dirCacheConfig.iDirCacheSizeMin = KDef_DynamicDirCacheMinInBytes;
-    if (dirCacheConfig.iDirCacheSizeMax < KDef_DynamicDirCacheMaxInBytes)
-        dirCacheConfig.iDirCacheSizeMax = KDef_DynamicDirCacheMaxInBytes;
-    
-    TVolumeIOParamInfo ioParam;
-    r = TheFs.VolumeIOParam(gDrive, ioParam);
-    test_KErrNone(r);
-    const TInt32 KClusterSize = ioParam.iClusterSize;
-    test.Printf(_L("DRV[%C:] cluster = %d\n"), gDrive + 'A', ioParam.iClusterSize); 
-
-    const TInt32 KDefMaxCachePageSize = 1 << KDef_MaxDynamicDirCachePageSzLog2;
-    const TInt32 KPageSizeInData = KClusterSize < KDefMaxCachePageSize ? KClusterSize : KDefMaxCachePageSize;
-    const TInt32 KPageSizeInMem = KPageSizeInData < KSegmentSize ? KSegmentSize : KPageSizeInData;
-    const TInt32 KCacheSizeMinInPages = dirCacheConfig.iDirCacheSizeMin / KPageSizeInMem;
-    const TInt32 KCacheSizeMaxInPages = dirCacheConfig.iDirCacheSizeMax / KPageSizeInMem;
-    const TInt32 KUnlockedPageNum = 0;
-    
-    // remount drive, get current dir cache info and test
-    r = F32_Test_Utils::RemountFS (TheFs, CurrentDrive(), NULL);
-    test_KErrNone(r);
-
-    TDirCacheInfo dirCacheInfo;
-    r = controlIo(TheFs,gDrive, KControlIoDirCacheInfo, dirCacheInfo);
-    test_KErrNone(r);
-    
-    test_Equal(KSegmentSize, dirCacheInfo.iMemorySegmentSize);
-    test_Equal(KPageSizeInMem, dirCacheInfo.iPageSizeInMemory);
-    test_Equal(KPageSizeInData, dirCacheInfo.iPageSizeInData);
-    test_Equal(KCacheSizeMinInPages, dirCacheInfo.iMinCacheSizeInPages);
-    test_Equal(KCacheSizeMaxInPages, dirCacheInfo.iMaxCacheSizeInPages);
-    test_Equal(KMaxThreadCount, dirCacheInfo.iLockedPageNumber);
-    test_Equal(KUnlockedPageNum, dirCacheInfo.iUnlockedPageNumber);
-    }
-
-//----------------------------------------------------------------------------------------------
-//@SYMTestCaseID      PBASE-XXXX 
-//@SYMTestType        FT
-//@SYMPREQ            PREQ1885
-//@SYMTestCaseDesc    Test populating dir cache under normal memory conditions.
-//----------------------------------------------------------------------------------------------
-void TestPopulateCache()
-    {
-    test.Next(_L("Test populating dir cache under normal memory conditions"));
-    
-    CFileMan* fileMan = CFileMan::NewL(TheFs);
-    test_NotNull(fileMan);
-    TInt r = fileMan->RmDir(_L("\\TEST_DIRCACHE\\"));
-    test_Value(r, r==KErrNone || r==KErrPathNotFound);
-
-    // remount drive, get current dir cache info
-    r = F32_Test_Utils::RemountFS (TheFs, CurrentDrive(), NULL);
-    test_KErrNone(r);
-
-    /*
-     * Test populating dir cache 
-     */
-    TVolumeIOParamInfo ioParam;
-    r = TheFs.VolumeIOParam(gDrive, ioParam);
-    test_KErrNone(r);
-    const TInt32 KClusterSize = ioParam.iClusterSize;
-
-    TFileName dirPath = _L("\\TEST_DIRCACHE\\");
-    r = TheFs.MkDirAll(dirPath);
-    test_KErrNone(r);
-
-    TDirCacheInfo dirCacheInfo;
-    r = controlIo(TheFs,gDrive, KControlIoDirCacheInfo, dirCacheInfo);
-    test_KErrNone(r);
-
-    // this calculation is for volumes that have a large cluster size, larger than the allowed maximum
-    //  page size. on this case, creating a new directory will generate two or more new pages in the 
-    //  dir cache 
-    const TUint pagesPerDir = KClusterSize > dirCacheInfo.iPageSizeInMemory ? 
-                            KClusterSize / dirCacheInfo.iPageSizeInMemory : 1;
-    
-    // should be KMaxThreadCount + root dir (1 page) + "\\TEST_DIRCACHE\\" (number of pages that are 
-    //  needed for new directories, i.e. pagesPerDir)
-    test_Equal(KMaxThreadCount + 1 + pagesPerDir, dirCacheInfo.iLockedPageNumber);
-
-    const TInt initialUnlockedPage = dirCacheInfo.iUnlockedPageNumber;
-
-    const TInt createdNewDirs = dirCacheInfo.iMinCacheSizeInPages - dirCacheInfo.iLockedPageNumber;
-    // create directories so that it grows to KCacheSizeMinInPages
-    for (TInt i = 1; i <= createdNewDirs; i++)
-        {
-        dirPath = _L("\\TEST_DIRCACHE\\");
-        TFileName dirName;
-        dirName.Format(_L("DIR%d\\"), i);
-        dirPath += dirName;
-        r = TheFs.MkDirAll(dirPath);
-        test_KErrNone(r);
-        }
-    
-    const TInt KFatDirEntrySize = 32;
-    const TInt subDirNum = dirCacheInfo.iMinCacheSizeInPages - dirCacheInfo.iLockedPageNumber;
-    // calculate the extra pages needed for the newly created sub dir entries (plus the original 
-    //  "." and ".." entries)
-    TInt extraPagesForLeafdir = ((subDirNum + 2) * KFatDirEntrySize / dirCacheInfo.iPageSizeInData) - 1;
-    if (((subDirNum + 2) * KFatDirEntrySize) % dirCacheInfo.iPageSizeInData > 0)
-        extraPagesForLeafdir++;
-    test.Printf(_L("!!Extra pages needed for leafdir = %d\n"), extraPagesForLeafdir);   //kk
-
-    r = controlIo(TheFs,gDrive, KControlIoDirCacheInfo, dirCacheInfo);
-    test_KErrNone(r);
-    r = controlIo(TheFs,gDrive, 15, dirCacheInfo);
-    test_KErrNone(r);
-
-    test_Equal(dirCacheInfo.iMinCacheSizeInPages, dirCacheInfo.iLockedPageNumber);
-    
-    const TInt maxUnlockedPage = dirCacheInfo.iMaxCacheSizeInPages - dirCacheInfo.iMinCacheSizeInPages;
-    // calculating the expected unlocked page number here.
-    TInt newUnlockedPage = initialUnlockedPage;
-    newUnlockedPage += extraPagesForLeafdir;                // if any extra pages are created for the leafdir
-    newUnlockedPage += createdNewDirs * (pagesPerDir - 1);   // if more than one page is needed for each dir creation 
-    test_Equal((newUnlockedPage > maxUnlockedPage ? maxUnlockedPage : newUnlockedPage), dirCacheInfo.iUnlockedPageNumber);
-
-    // create directories so that it grows to KCacheSizeMinInPages + KCacheSizeMaxInPages
-    if (dirCacheInfo.iMaxCacheSizeInPages > dirCacheInfo.iMinCacheSizeInPages)
-        {
-        for (TInt i = 1; i <= dirCacheInfo.iMaxCacheSizeInPages - dirCacheInfo.iMinCacheSizeInPages; i++)
-            {
-            dirPath = _L("\\TEST_DIRCACHE\\");
-            TFileName dirName;
-            dirName.Format(_L("DIR_UNLOCKED%d\\"), i);
-            dirPath += dirName;
-            r = TheFs.MkDirAll(dirPath);
-            test_KErrNone(r);
-            }
-        r = controlIo(TheFs,gDrive, KControlIoDirCacheInfo, dirCacheInfo);
-        test_KErrNone(r);
-        r = controlIo(TheFs,gDrive, 15, dirCacheInfo);
-        test_KErrNone(r);
-
-        test_Equal(dirCacheInfo.iMinCacheSizeInPages, dirCacheInfo.iLockedPageNumber);
-        
-        test_Equal(dirCacheInfo.iMaxCacheSizeInPages - dirCacheInfo.iMinCacheSizeInPages, dirCacheInfo.iUnlockedPageNumber);
-        }
-    
-    // create more directories and check that dir cache doesn't grow beyond KCacheSizeMaxInPages
-    for (TInt j = 1; j <= dirCacheInfo.iMinCacheSizeInPages; j++)
-        {
-        dirPath = _L("\\TEST_DIRCACHE\\");
-        TFileName dirName;
-        dirName.Format(_L("DIR_MORE%d\\"), j);
-        dirPath += dirName;
-        r = TheFs.MkDirAll(dirPath);
-        test_KErrNone(r);
-        }
-    r = controlIo(TheFs,gDrive, KControlIoDirCacheInfo, dirCacheInfo);
-    test_KErrNone(r);
-    r = controlIo(TheFs,gDrive, 15, dirCacheInfo);
-    test_KErrNone(r);
-
-    test_Equal(dirCacheInfo.iMinCacheSizeInPages, dirCacheInfo.iLockedPageNumber);
-    test_Equal(dirCacheInfo.iMaxCacheSizeInPages - dirCacheInfo.iMinCacheSizeInPages, dirCacheInfo.iUnlockedPageNumber);
-
-    r = controlIo(TheFs,gDrive, KControlIoDirCacheInfo, dirCacheInfo);
-    test_KErrNone(r);
-
-    r = fileMan->RmDir(_L("\\TEST_DIRCACHE\\"));
-    test_KErrNone(r);
-    
-    delete fileMan;
-    }
-
-//----------------------------------------------------------------------------------------------
-//@SYMTestCaseID      PBASE-XXXX 
-//@SYMTestType        FT
-//@SYMPREQ            PREQ1885
-//@SYMTestCaseDesc    Test simulating low memory condition.
-//                    1. The cache should stop growing when it is at its minimum cache size in pages
-//                    2. The cache should function properly when it stops simulating low memory condition 
-//----------------------------------------------------------------------------------------------
-void TestSimulatingLowMemory()
-    {
-    // remount drive, get current dir cache info and test
-    test.Next(_L("Test dir cache growth when simulating low memory condition"));
-
-    CFileMan* fileMan = CFileMan::NewL(TheFs);
-    test(fileMan != NULL);
-    TInt r = fileMan->RmDir(_L("\\TEST_DIRCACHE\\"));
-    test_Value(r, r==KErrNone || r==KErrPathNotFound);
-
-    r = F32_Test_Utils::RemountFS (TheFs, CurrentDrive(), NULL);
-    test_KErrNone(r);
-
-    r = TheFs.ControlIo(gDrive, KControlIoSimulateMemoryLow);
-    test_KErrNone(r);
-
-    /*
-     * Test populating dir cache 
-     */
-    TFileName dirPath = _L("\\TEST_DIRCACHE\\");
-    r = TheFs.MkDirAll(dirPath);
-    test_KErrNone(r);
-
-    TDirCacheInfo dirCacheInfo;
-    r = controlIo(TheFs,gDrive, KControlIoDirCacheInfo, dirCacheInfo);
-    test_KErrNone(r);
-
-    // create directories so that it grows to KCacheSizeMaxInPages
-    for (TInt i = 1; i <= dirCacheInfo.iMaxCacheSizeInPages; i++)
-        {
-        dirPath = _L("\\TEST_DIRCACHE\\");
-        TFileName dirName;
-        dirName.Format(_L("DIR%d\\"), i);
-        dirPath += dirName;
-        r = TheFs.MkDirAll(dirPath);
-        test_KErrNone(r);
-        }
-
-    r = controlIo(TheFs,gDrive, KControlIoDirCacheInfo, dirCacheInfo);
-    test_KErrNone(r);
-
-    test_Equal(dirCacheInfo.iMinCacheSizeInPages, dirCacheInfo.iLockedPageNumber);
-    test_Equal(0, dirCacheInfo.iUnlockedPageNumber);
-    
-    r = fileMan->RmDir(_L("\\TEST_DIRCACHE\\"));
-    test_KErrNone(r);
- 
-    // test when stop simulating the low memory condition, cache grows normally
-    test.Next(_L("Test dir cache growth when stop simulating low memory condition"));
-    r = TheFs.ControlIo(gDrive, KControlIoStopSimulateMemoryLow);
-    test_KErrNone(r);
-
-    r = F32_Test_Utils::RemountFS (TheFs, CurrentDrive(), NULL);
-    test_KErrNone(r);
-
-    /*
-     * Test populating dir cache 
-     */
-    dirPath = _L("\\TEST_DIRCACHE\\");
-    r = TheFs.MkDirAll(dirPath);
-    test_KErrNone(r);
-
-    // create directories so that it grows to KCacheSizeMaxInPages
-    for (TInt j = 1; j <= dirCacheInfo.iMaxCacheSizeInPages; j++)
-        {
-        dirPath = _L("\\TEST_DIRCACHE\\");
-        TFileName dirName;
-        dirName.Format(_L("DIR%d\\"), j);
-        dirPath += dirName;
-        r = TheFs.MkDirAll(dirPath);
-        test_KErrNone(r);
-        }
-
-    r = controlIo(TheFs,gDrive, KControlIoDirCacheInfo, dirCacheInfo);
-    test_KErrNone(r);
-
-    test_Equal(dirCacheInfo.iMinCacheSizeInPages, dirCacheInfo.iLockedPageNumber);
-    test_Equal(dirCacheInfo.iMaxCacheSizeInPages - dirCacheInfo.iMinCacheSizeInPages, dirCacheInfo.iUnlockedPageNumber);
-    
-    r = fileMan->RmDir(_L("\\TEST_DIRCACHE\\"));
-    test_KErrNone(r);
-
-    delete fileMan;
-    }
-
-//----------------------------------------------------------------------------------------------
-//@SYMTestCaseID      PBASE-XXXX 
-//@SYMTestType        FT
-//@SYMPREQ            PREQ1885
-//@SYMTestCaseDesc    Test low memory threshold on hardware platforms
-//                    1. Stress the system memory to below the low memory threshold configured
-//                    2. The cache should stop growing when it is at its minimum cache size in pages
-//                    3. Resume the system memory before step 1.
-//                    2. The cache should function properly when it stops simulating low memory condition 
-//----------------------------------------------------------------------------------------------
-void TestLowMemoryHW()
-    {
-    test.Next(_L("Test low memory threshold on hardware"));
-#if !defined(__WINS__)
-
-    CFileMan* fileMan = CFileMan::NewL(TheFs);
-    test_NotNull(fileMan);
-    TInt r = fileMan->RmDir(_L("\\TEST_DIRCACHE\\"));
-    test_Value(r, r==KErrNone || r==KErrPathNotFound);
-
-    r = F32_Test_Utils::RemountFS (TheFs, CurrentDrive(), NULL);
-    test_KErrNone(r);
-
-    RPageStressTestLdd PagestressLdd;
-    TMemoryInfoV1Buf memInfo;
-    r = UserHal::MemoryInfo(memInfo);
-    test_KErrNone(r);
-
-    TGlobalCacheInfo globalCacheInfo;
-    r = controlIo(TheFs,gDrive, KControlIoGlobalCacheInfo, globalCacheInfo);
-    test_KErrNone(r);
-
-    test.Printf(_L("Free RAM before setup %d\n"), memInfo().iFreeRamInBytes);
-    const TReal lowMemThreshold = globalCacheInfo.iGlobalLowMemoryThreshold / 200.00;
-    test.Printf(_L("Low memory threshold = %d%%\n"), globalCacheInfo.iGlobalLowMemoryThreshold);
-    test.Printf(_L("Current memory available = %d%%\n"), lowMemThreshold * 100);
-
-    const TInt totalRamInBytes = memInfo().iTotalRamInBytes;
-    const TInt setupFreeRamInBytes = (TInt) (lowMemThreshold * totalRamInBytes);
-    const TInt setupFreeRamInPages = setupFreeRamInBytes / KSegmentSize;
-    
-    r = User::LoadLogicalDevice(KPageStressTestLddName);
-    test_Value(r, r==KErrNone || r==KErrAlreadyExists);
-    r = PagestressLdd.Open();
-    test_KErrNone(r);
-    r = PagestressLdd.DoSetDebugFlag((TInt)ETrue);
-    test_KErrNone(r);
-    if (setupFreeRamInPages > 0 && setupFreeRamInBytes < totalRamInBytes)
-        {
-        r = PagestressLdd.DoConsumeRamSetup(setupFreeRamInPages, 1);
-        test_KErrNone(r);
-        r = UserHal::MemoryInfo(memInfo);
-        test_KErrNone(r);
-        test.Printf(_L("Free RAM after setup %d\n"), memInfo().iFreeRamInBytes);
-        }
-    else
-        {
-        test.Printf(_L("Current memory is already low: %d\n"), memInfo().iFreeRamInBytes);
-        }
-
-    /*
-     * Test populating dir cache 
-     */
-    TFileName dirPath = _L("\\TEST_DIRCACHE\\");
-    r = TheFs.MkDirAll(dirPath);
-    test_KErrNone(r);
-
-    TDirCacheInfo dirCacheInfo;
-    r = controlIo(TheFs,gDrive, KControlIoDirCacheInfo, dirCacheInfo);
-    test_KErrNone(r);
-
-    // create directories so that it grows to KCacheSizeMaxInPages
-    for (TInt i = 1; i <= dirCacheInfo.iMaxCacheSizeInPages; i++)
-        {
-        dirPath = _L("\\TEST_DIRCACHE\\");
-        TFileName dirName;
-        dirName.Format(_L("DIR%d\\"), i);
-        dirPath += dirName;
-        r = TheFs.MkDirAll(dirPath);
-        test_KErrNone(r);
-        }
-
-    r = controlIo(TheFs,gDrive, KControlIoDirCacheInfo, dirCacheInfo);
-    test_KErrNone(r);
-
-    test_Equal(dirCacheInfo.iMinCacheSizeInPages, dirCacheInfo.iLockedPageNumber);
-    test_Equal(0, dirCacheInfo.iUnlockedPageNumber);
-    
-    // release memory
-    PagestressLdd.DoConsumeRamFinish();
-    PagestressLdd.Close();
-    r = User::FreeLogicalDevice(KPageStressTestLddName);
-    test_KErrNone(r);
-    
-    r = UserHal::MemoryInfo(memInfo);
-    test_KErrNone(r);
-    test.Printf(_L("Free RAM after test %d\n"), memInfo().iFreeRamInBytes);
-
-    r = fileMan->RmDir(_L("\\TEST_DIRCACHE\\"));
-    test_KErrNone(r);
-    delete fileMan;
-#else
-    test.Printf(_L("This test step only runs on hardware!!\n"));
-#endif //#if !defined(__WINS__)
-    }
-
-#endif // #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
-
-GLDEF_C void CallTestsL()
-//
-// Test the file server.
-//
-    {
-#if defined(_DEBUG) || defined(_DEBUG_RELEASE)
-    TInt nRes=TheFs.CharToDrive(gDriveToTest, gDrive);
-    test_KErrNone(nRes);
-
-    TDriveInfo  driveInfo;
-    nRes = TheFs.Drive(driveInfo, gDrive);
-    test.Printf(_L("MediaType: 0x%x\n"), driveInfo.iType);
-    test_KErrNone(nRes);
-    
-    if (F32_Test_Utils::Is_Fat(TheFs, gDrive) && driveInfo.iType != EMediaRam)
-        {
-        nRes = F32_Test_Utils::FormatDrive(TheFs, gDrive, ETrue);
-        test_KErrNone(nRes);
-        
-        F32_Test_Utils::PrintDrvInfo(TheFs, gDrive);
-        
-        TVolumeInfo v;
-        TInt r=TheFs.Volume(v, CurrentDrive());
-        test_KErrNone(r);
-        
-        CreateTestDirectory(_L("\\F32-TST\\TDIRCACHE\\"));
-        
-        TestGlobalSettings();
-        TestDirCacheSettings();
-        TestPopulateCache();
-        TestSimulatingLowMemory();
-        TestLowMemoryHW();
-        
-        DeleteTestDirectory();
-        }
-    else
-        {
-        test.Printf(_L("This test executes on FAT drives and non-RAM media only!!\n"));
-        }
-#else
-    test.Printf(_L("This test executes on DEBUG mode only!!\n"));
-#endif //#if defined(_DEBUG) || defined(_DEBUG_RELEASE)
-    }
-
-/*
-void TestReadEstart()
-    {
-    TDirCacheConfig dirCacheConfig;
-    TInt r = controlIo(TheFs,gDrive, KControlIoDirCacheConfig, dirCacheConfig);
-    test_KErrNone(r);
-    test.Printf(_L("Dir cache: \n Drive %C \n iLeafDirCacheSize %d \n iDirCacheSizeMin %d \n iDirCacheSizeMax %d \n iGlobalCacheMemorySize %d \n iLowMemoryThreshold %%%d"), 
-            dirCacheConfig.iDrive + 'A',
-            dirCacheConfig.iLeafDirCacheSize,
-            dirCacheConfig.iDirCacheSizeMin,
-            dirCacheConfig.iDirCacheSizeMax);
-    }
-
-*/
-
-//          const TInt KControlIoGlobalCacheConfig=KMaxTInt-21;
-//          const TInt KControlIoGlobalCacheInfo=KMaxTInt-22;
-//          const TInt KControlIoDirCacheConfig=KMaxTInt-23;
-//          const TInt KControlIoDirCacheInfo=KMaxTInt-24;
-//
-//class TGlobalCacheConfig
-//class TGlobalCacheInfo
-//class TDirCacheConfig
-//class TDirCacheInfo 
-
-//  this test is for FAT only!!
-//if (F32_Test_Utils::Is_ExFat(TheFs, gDrive))
-//    {
-//    // test cluster size
-//    TVolumeIOParamInfo ioParam;
-//    TInt r = TheFs.VolumeIOParam(gDrive, ioParam);
-//    test.Printf(_L("TheFs.VolumeIOParam for EXFAT: (cluster = %d) = %d\n"), ioParam.iClusterSize, r); 
-//    }
-//
--- a/kerneltest/f32test/server/t_dirs.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_dirs.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include "t_server.h"
@@ -42,20 +41,20 @@
 	test.Next(_L("Create a directory with 55 entries"));
 	TFileName sessionPath;
 	TInt r=TheFs.SessionPath(sessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.MkDir(_L("\\F32-TST\\"));
-	test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+	test((r==KErrNone)||(r==KErrAlreadyExists));
 	r=TheFs.MkDir(_L("\\F32-TST\\TDIRS\\"));
-	test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+	test((r==KErrNone)||(r==KErrAlreadyExists));
 	
 	for (TInt i=0;i<maxEntry;i++)
 		{
 		TFileName baseName=_L("\\F32-TST\\TDIRS\\FILE");
 		baseName.AppendNum(i);
 		r=f.Replace(TheFs,baseName,EFileRead);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=f.Write(_L8("Hello World"));
-		test_KErrNone(r);
+		test(r==KErrNone);
 		f.Close();
 		}
 	test.Next(_L("Test all entries have been created successfully."));
@@ -66,12 +65,12 @@
 		TInt r=f.Open(TheFs,baseName,EFileRead);
 		if (r!=KErrNone)
 			{
-			test_Value(r, r == KErrNotFound && j==maxEntry);
+			test(r==KErrNotFound && j==maxEntry);
 			return;
 			}
 		TBuf8<16> data;
 		r=f.Read(data);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(data==_L8("Hello World"));
 		f.Close();
 		}
@@ -116,10 +115,10 @@
 	RDir d;
 	
 	TInt r=d.Open(TheFs,PlatSec::ConfigSetting(PlatSec::EPlatSecEnforceSysBin)?_L("\\Sys\\Bin\\ESHELL.EXE\\*"):_L("\\System\\Bin\\ESHELL.EXE\\*"),KEntryAttMaskSupported);
-	test_Value(r, r == KErrPathNotFound);
+	test(r==KErrPathNotFound);
 	
 	r=d.Open(TheFs,PlatSec::ConfigSetting(PlatSec::EPlatSecEnforceSysBin)?_L("\\Sys\\Bin\\ESHELL.EXE"):_L("\\System\\Bin\\ESHELL.EXE"),KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=d.Read(entry);
 	if (r==KErrEof)
@@ -129,21 +128,21 @@
 		}
 	else
 		{
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(entry.iName.FindF(_L("ESHELL.EXE"))>=0);
 		r=d.Read(entry);
-		test_Value(r, r == KErrEof);
+		test(r==KErrEof);
 		}
 	d.Close();
 
 	r=d.Open(TheFs,_L("\\*.XQP"),KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=d.Read(entry);
-	test_Value(r, r == KErrEof);
+	test(r==KErrEof);
 	d.Close();
 
 	r=d.Open(TheFs,PlatSec::ConfigSetting(PlatSec::EPlatSecEnforceSysBin)?_L("\\Sys\\Bin\\"):_L("\\System\\Bin\\"),KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=d.Read(entry);
 	
 	if (r==KErrEof)
@@ -153,19 +152,19 @@
 		}
 	else
 		{
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test.Printf(_L("First Entry = %S\n"),&entry.iName);
 		r=d.Read(entry);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test.Printf(_L("Second Entry = %S\n"),&entry.iName);
 		d.Close();
 		}
 
 	r=d.Open(TheFs,_L("\\*"),KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	d.Close();
 	r=d.Open(TheFs,PlatSec::ConfigSetting(PlatSec::EPlatSecEnforceSysBin)?_L("\\Sys\\Bin\\*"):_L("\\System\\Bin\\*"),KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	d.Close();
 	}
 
@@ -179,39 +178,39 @@
 	TEntry entry;
 	RFile f;
 	TInt r=f.Replace(TheFs,_L("\\F32-TST\\TDIRS\\TESTFILEORISITA.DIR"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Write(_L8("TESTDATATESTDATATESTDATATESTDATATESTDATATESTDATATESTDATATESTDATATESTDATATESTDATATESTDATATESTDATA"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("\\F32-TST\\TDIRS\\TESTFILEORISITA.DIR"));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	f.Close();
 	RDir d;
 	r=d.Open(TheFs,_L("\\F32-TST\\TDIRS\\TESTFILEORISITA.DIR\\*"),KEntryAttMaskSupported);
-	test_Value(r, r == KErrPathNotFound);
+	test(r==KErrPathNotFound);
 	r=d.Open(TheFs,_L("\\F32-TST\\TDIRS\\*.XQP"),KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=d.Read(entry);
-	test_Value(r, r == KErrEof);
+	test(r==KErrEof);
 	d.Close();
 	r=d.Open(TheFs,_L("\\F32-TST\\TDIRS\\TESTFILEORISITA.DIR"),KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=d.Read(entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName.FindF(_L("TESTFILEORISITA.DIR"))>=0);
 	r=d.Read(entry);
-	test_Value(r, r == KErrEof);
+	test(r==KErrEof);
 	d.Close();
 	r=d.Open(TheFs,_L("\\"),KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	d.Close();
 	r=d.Open(TheFs,_L("\\F32-TST\\"),KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	d.Close();
 	r=d.Open(TheFs,_L("\\*"),KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	d.Close();
 	r=d.Open(TheFs,_L("\\F32-TST\\*"),KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	d.Close();
 	
 	// create a small file on the root
@@ -227,20 +226,20 @@
 	
 	
 	r=TheFs.MkDir(_L("\\F32-TST\\EMPTY\\"));
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	r=d.Open(TheFs,_L("\\F32-TST\\EMPTY\\*"),KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 //	r=TheFs.RmDir(_L("\\F32-TST\\EMPTY\\"));
 	r=d.Read(entry);
-	test_Value(r, r == KErrEof);
+	test(r==KErrEof);
 //	r=TheFs.RmDir(_L("\\F32-TST\\EMPTY\\"));
-//	test_Value(r, r == KErrInUse);
+//	test(r==KErrInUse);
 	r=d.Read(entry);
 	r=d.Read(entry);
 	r=d.Read(entry);
 	d.Close();
 	r=TheFs.RmDir(_L("\\F32-TST\\EMPTY\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 
@@ -257,21 +256,21 @@
 	CFileMan* fMan=CFileMan::NewL(TheFs);
 	test(fMan!=NULL);
 	TInt r=fMan->RmDir(_L("\\F32-TST\\TDIRS\\SORT_NONE\\"));
-	test_Value(r, (r == KErrNone)||(r==KErrPathNotFound));
+	test((r==KErrNone)||(r==KErrPathNotFound));
 	delete fMan;	
 
 	gTimeNow.HomeTime();	//	Set global TTime gTimeNow to time now - for later tests
 	r=TheFs.MkDirAll(_L("\\F32-TST\\TDIRS\\SORT_NONE\\"));
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	MakeFile(_L("\\f32-tst\\tdirs\\sort_none\\file1.txt"));
 	r=TheFs.MkDir(_L("\\F32-TST\\TDIRS\\SORT_NONE\\FILE_DIR1.APP\\"));
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	MakeFile(_L("\\f32-tst\\tdirs\\sort_none\\file1.app"));
 	r=TheFs.MkDir(_L("\\F32-TST\\TDIRS\\SORT_NONE\\FILE_DIR2.TXT\\"));
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	MakeFile(_L("\\f32-tst\\tdirs\\sort_none\\file2.txt"));
 	r=TheFs.MkDir(_L("\\F32-TST\\TDIRS\\SORT_NONE\\FILE_DIR3.APP\\"));
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	MakeFile(_L("\\f32-tst\\tdirs\\sort_none\\ZZZZ"));
 	MakeFile(_L("\\f32-tst\\tdirs\\sort_none\\AAAA"));
 	MakeFile(_L("\\f32-tst\\tdirs\\sort_none\\WWWW"));
@@ -300,33 +299,33 @@
 	TheFs.SetAllocFailure(gAllocFailOff);
 
 	TInt r=TheFs.GetDir(_L("\\f32-tst\\tdirs\\sort_none\\*"),KEntryAttMaskSupported,ESortNone,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt count=dir->Count();
 	test(count==15);
 	r=TheFs.GetDir(_L("\\f32-tst\\tdirs\\sort_none\\*"),KEntryAttMaskSupported,ESortByName,dirSorted);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(dirSorted->Count()==15);
 	delete dirSorted;
 	delete dir;
 
 	r=TheFs.GetDir(_L("\\f32-tst\\tdirs\\sort_none\\*.txt"),KEntryAttNormal,ESortNone,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(dir->Count()==3);
 	delete dir;
 	r=TheFs.GetDir(_L("\\f32-tst\\tdirs\\sort_none\\*.app"),KEntryAttNormal,ESortNone,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(dir->Count()==3);
 	delete dir;
 	r=TheFs.GetDir(_L("\\f32-tst\\tdirs\\sort_none\\*.app"),KEntryAttNormal|KEntryAttDir,ESortNone,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(dir->Count()==5);
 	delete dir;
 	r=TheFs.GetDir(_L("\\f32-tst\\tdirs\\sort_none\\*.app"),KEntryAttNormal|KEntryAttDir,ESortNone|EDirsFirst,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(dir->Count()==5);
 	delete dir;
 	r=TheFs.GetDir(_L("\\f32-tst\\tdirs\\sort_none\\*.app"),KEntryAttNormal|KEntryAttDir,ESortNone|EDirsLast,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(dir->Count()==5);
 	delete dir;
 
@@ -342,9 +341,9 @@
 	test.Next(_L("Test return values"));
 	RDir dir;
 	TInt r=dir.Open(TheFs,_L("\\DoesNotExist\\*"),KEntryAttMaskSupported);
-	test_Value(r, r == KErrPathNotFound);
+	test(r==KErrPathNotFound);
 	r=dir.Open(TheFs,_L("\\"),KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir.Close();
 	}
 
@@ -358,7 +357,7 @@
 	test.Next(_L("Test *.* matches all files"));
 	CDir* dirList;
 	TInt r=TheFs.GetDir(_L("\\f32-tst\\tdirs\\sort_none\\*.*"),KEntryAttNormal|KEntryAttDir,ESortByName|EDirsLast,dirList);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt count=dirList->Count();
 	test(count==15);
 	TEntry entry=(*dirList)[0];
@@ -395,7 +394,7 @@
 
 	RDir dir;
 	r=dir.Open(TheFs,_L("\\f32-tst\\tdirs\\sort_none\\*.*"),KEntryAttNormal|KEntryAttDir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TTime time;
 	TInt64 difference;
@@ -406,14 +405,14 @@
 	for (TInt i=0; i<15; i++)
 		{
 		r=dir.Read(entry);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		time=entry.iModified;
 		difference=time.Int64()-gTimeNow.Int64();
 		test(difference<maxOK);
 		}
 
 	r=dir.Read(entry);
-	test_Value(r, r == KErrEof);
+	test(r==KErrEof);
 	dir.Close();
 
 	TheFs.SetAllocFailure(gAllocFailOn);
@@ -434,7 +433,7 @@
         }    
 
     TInt r = FormatDrive(TheFs, gDriveNum, ETrue);
-    test_KErrNone(r);
+    test(r==KErrNone);
 
 	TBuf<32> baseName=_L("\\RD");
 	TBuf<32> id;
@@ -454,7 +453,7 @@
 			{
 			break;
 			}
-		test_KErrNone(r);
+		test(r==KErrNone);
 		f.Close();
 		count++;
 		if(count >= 1000)
@@ -472,7 +471,7 @@
 		fileName+=baseName;
 		fileName+=id;
 		TInt r=TheFs.Delete(fileName);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test.Printf(_L("DeleteFile	:	%d	: %S\r"),count,&fileName);
 		--count;
 		}
@@ -486,34 +485,34 @@
 	longFileName[0]='\\';
 	longFileName[253]='\\';
 	r=TheFs.MkDir(longFileName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CDir* dirList=NULL;
 	r=TheFs.GetDir(longFileName,KEntryAttMaskSupported,ESortByName,dirList);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=dirList->Count();
 	test(count==0);
 	delete dirList;
 	TParse parse;
 	r=TheFs.Parse(longFileName,parse);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TEntry entry;
 	r=TheFs.Entry(longFileName,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetSessionPath(longFileName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.GetDir(longFileName,KEntryAttMaskSupported,ESortByName,dirList);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=dirList->Count();
 	test(count==0);
 	delete dirList;
 	r=TheFs.Parse(longFileName,_L("*"),parse);
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=f.Open(TheFs,_L("asdf.asdf"),0);
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.Entry(longFileName,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(longFileName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 static void Test8()
@@ -526,21 +525,21 @@
 	MakeDir(_L("C:\\MOON\\"));
 	RDir dir;
 	TInt r=dir.Open(TheFs,_L("C:\\MOON\\"),0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TFileName driveName;
 	r=TheFs.GetDriveName(11,driveName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TEntryArray entryArray;
 	r=dir.Read(entryArray);
-	test_Value(r, r == KErrEof);
+	test(r==KErrEof);
 	test(entryArray.Count()==0);
 	dir.Close();
 	r=TheFs.RmDir(_L("C:\\MOON\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("MkDir all on nonexistent drive"));
 	r=TheFs.MkDirAll(_L("L:\\MOON"));
-	test_Value(r, (r == KErrNotReady)||(r==KErrPathNotFound));
+	test((r==KErrNotReady)||(r==KErrPathNotFound));
 	}
 
 static void CleanupL()
@@ -552,9 +551,9 @@
 	test.Next(_L("Delete test directory"));
 	CFileMan* fMan=CFileMan::NewL(TheFs);
 	TInt r=fMan->RmDir(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fMan->Delete(_L("\\Filluptherootdir*"));
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 	delete fMan;
 	}
 
@@ -567,15 +566,15 @@
 	test.Next(_L("Testing directory names with trailing dots"));
 	TInt r;
 	r=TheFs.MkDir(_L("\\test9..\\"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.MkDir(_L("\\test9\\"));
-	test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+	test((r==KErrNone)||(r==KErrAlreadyExists));
 	r=TheFs.Rename(_L("\\test9\\"),_L("\\test9..\\"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r= TheFs.RmDir(_L("\\test9\\"));
-	test_KErrNone(r);
+	test((r==KErrNone));
 	r=TheFs.MkDir(_L("\\t.\\"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	}
 
 
@@ -606,7 +605,7 @@
 	CFileMan* fMan=CFileMan::NewL(TheFs);
 	test(fMan!=NULL);
 	TInt r=fMan->RmDir(aPath);
-	test_Value(r, (r == KErrNone)||(r==KErrPathNotFound));
+	test((r==KErrNone)||(r==KErrPathNotFound));
 	delete fMan;	
 	}
 
@@ -620,7 +619,7 @@
 
 	gTimeNow.HomeTime();	//	Set global TTime gTimeNow to time now - for later tests
 	TInt r=TheFs.MkDirAll(aPath);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 
 	TBuf<128> fileName;
 	for (TInt i = 0; i < aNumFiles; i++)
@@ -646,7 +645,7 @@
 	TBuf<128> sortSpec(KSortByNamePath);
 	sortSpec.Append(KSortAll);
 	TInt r=TheFs.GetDir(sortSpec, KEntryAttNormal | KEntryAttDir, ESortByName | EDirsLast, dirList);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt count=dirList->Count();
 	test(count==numFiles);
 
@@ -671,7 +670,7 @@
 
 
 	r=TheFs.GetDir(sortSpec, KEntryAttNormal | KEntryAttDir, ESortByName | EDirsLast | EDescending, dirList);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=dirList->Count();
 	test(count==numFiles);
 
@@ -738,7 +737,7 @@
 	TBuf<128> sortSpec(KSortByExtPath);
 	sortSpec.Append(KSortAll);
 	TInt r=TheFs.GetDir(sortSpec, KEntryAttNormal | KEntryAttDir, ESortByExt | EDirsLast, dirList);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt count=dirList->Count();
 	test(count==numFiles);
 
@@ -774,7 +773,7 @@
 	test.Next(_L("Test ESortByExt (descending)"));
 
 	r=TheFs.GetDir(sortSpec, KEntryAttNormal | KEntryAttDir, ESortByExt | EDirsLast | EDescending, dirList);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=dirList->Count();
 	test(count==numFiles);
 
@@ -858,55 +857,55 @@
 	dirTest6 = _L("\\F32-TST\\TDIRS\\test6. .\\");
 
     TInt err = TheFs.MkDir(dirTest1);
-    test_KErrNone(err);
+    test(err == KErrNone);
     err = TheFs.MkDir(dirTest2);
-    test_Value(err, err == KErrBadName);
+    test(err == KErrBadName);
     err = TheFs.MkDir(dirTest3);
-    test_Value(err, err == KErrBadName);
+    test(err == KErrBadName);
     err = TheFs.MkDir(dirTest4);
-    test_Value(err, err == KErrBadName);
+    test(err == KErrBadName);
     err = TheFs.MkDir(dirTest5);
-    test_Value(err, err == KErrBadName);
+    test(err == KErrBadName);
     err = TheFs.MkDir(dirTest6);
-    test_Value(err, err == KErrBadName);
+    test(err == KErrBadName);
 
     RDir rdir;
     err = rdir.Open(TheFs, dirTest1, 0);
     rdir.Close();
-    test_KErrNone(err);
+    test(err == KErrNone);
 
     err = rdir.Open(TheFs, dirTest2, 0);
     rdir.Close();
-    test_Value(err, err == KErrBadName);
+    test(err == KErrBadName);
 
     err = rdir.Open(TheFs, dirTest3, 0);
     rdir.Close();
-    test_Value(err, err == KErrBadName);
+    test(err == KErrBadName);
 
     err = rdir.Open(TheFs, dirTest4, 0);
     rdir.Close();
-    test_Value(err, err == KErrBadName);
+    test(err == KErrBadName);
 
     err = rdir.Open(TheFs, dirTest5, 0);
     rdir.Close();
-    test_Value(err, err == KErrBadName);
+    test(err == KErrBadName);
 
     err = rdir.Open(TheFs, dirTest6, 0);
     rdir.Close();
-    test_Value(err, err == KErrBadName);
+    test(err == KErrBadName);
 
     err = TheFs.RmDir(dirTest1);
-    test_KErrNone(err);
+    test(err == KErrNone);
     err = TheFs.RmDir(dirTest2);
-    test_Value(err, err == KErrBadName);
+    test(err == KErrBadName);
     err = TheFs.RmDir(dirTest3);
-    test_Value(err, err == KErrBadName);
+    test(err == KErrBadName);
     err = TheFs.RmDir(dirTest4);
-    test_Value(err, err == KErrBadName);
+    test(err == KErrBadName);
     err = TheFs.RmDir(dirTest5);
-    test_Value(err, err == KErrBadName);
+    test(err == KErrBadName);
     err = TheFs.RmDir(dirTest6);
-    test_Value(err, err == KErrBadName);
+    test(err == KErrBadName);
 	}
 
 void CallTestsL()
@@ -919,7 +918,7 @@
     F32_Test_Utils::SetConsole(test.Console()); 
     
     TInt nRes=TheFs.CharToDrive(gDriveToTest, gDriveNum);
-    test_KErrNone(nRes);
+    test(nRes==KErrNone);
     
     PrintDrvInfo(TheFs, gDriveNum);
 
@@ -929,11 +928,11 @@
 	if (!gTestedZ)
 		{
 		TInt r=TheFs.SetSessionPath(_L("Z:\\"));
-		test_KErrNone(r);
+		test(r==KErrNone);
 		Test2();
 		TestZ();
 		r=TheFs.SetSessionPath(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test.Next(_L("Run all other tests from \\F32-TST\\TDIRS\\"));
 		gTestedZ=ETrue;
 		}
--- a/kerneltest/f32test/server/t_dlocl.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_dlocl.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -73,7 +73,7 @@
 
     RLibrary testLib;
     TInt res=testLib.Load(EKDATA);
-    test_KErrNone(res);
+    test(res==KErrNone);
     THandleInfo handleInfo;
     testLib.HandleInfo(&handleInfo);
     test(handleInfo.iNumOpenInThread==2);
@@ -81,16 +81,16 @@
 
     test.Printf(_L("Change to unknown dll \n"));                // Test with non keydata type dll
     res=KeyTranslator->ChangeKeyData(DUMMYDLL);
-    test_Value(res, res == KErrArgument);
+    test(res==KErrArgument);
     
     res=testLib.Load(EKDATA);
-    test_KErrNone(res);
+    test(res==KErrNone);
     testLib.HandleInfo(&handleInfo);
     test(handleInfo.iNumOpenInThread==2);
     testLib.Close();
 
     res=testLib.Load(DUMMYDLL);
-    test_KErrNone(res);
+    test(res==KErrNone);
     testLib.HandleInfo(&handleInfo);
     test(handleInfo.iNumOpenInThread==1);
     testLib.Close();
@@ -106,15 +106,15 @@
     //
     test.Printf(_L("Change to EKDATA.dll\n"));
     res=KeyTranslator->ChangeKeyData(EKDATA);
-    test_KErrNone(res);
+    test(res==KErrNone);
     
     res=testLib.Load(EKDATA);
-    test_KErrNone(res);
+    test(res==KErrNone);
     testLib.HandleInfo(&handleInfo);
     test(handleInfo.iNumOpenInThread==2);
     testLib.Close();
     res=testLib.Load(DUMMYDLL);
-    test_KErrNone(res);
+    test(res==KErrNone);
     testLib.HandleInfo(&handleInfo);
     test(handleInfo.iNumOpenInThread==1);
     testLib.Close();
@@ -134,16 +134,16 @@
 
     test.Printf(_L("Change back to Default KeyData\n"));
     res=KeyTranslator->ChangeKeyData(_L(""));
-    test_KErrNone(res);
+    test(res==KErrNone);
     
     res=testLib.Load(EKDATA);
-    test_KErrNone(res);
+    test(res==KErrNone);
     testLib.HandleInfo(&handleInfo);
     test(handleInfo.iNumOpenInThread==2);
     testLib.Close();
 
     res=testLib.Load(DUMMYDLL);
-    test_KErrNone(res);
+    test(res==KErrNone);
     testLib.HandleInfo(&handleInfo);
     test(handleInfo.iNumOpenInThread==1);
     testLib.Close();
@@ -280,7 +280,7 @@
         test.Printf(_L("SubscribeToSystemChangeNotification(0x%x), attempt:%d\n"), aEventMask, i);   
 
         TInt nRes = aNotifier.Logon(aStatus);
-        test_KErrNone(nRes);
+        test(nRes==KErrNone);
 
         if(aStatus.Int() == KRequestPending)
             break;
@@ -322,11 +322,11 @@
     
     RChangeNotifier notifier;
     TInt res=notifier.Create();
-    test_KErrNone(res);
+    test(res==KErrNone);
     TRequestStatus stat;
     
     res=notifier.Logon(stat);
-    test_KErrNone(res);
+    test(res==KErrNone);
 	// initial value of stat already tested by t_chnot
 
     SubscribeToSystemChangeNotification(notifier, stat, EChangesLocale);
@@ -334,7 +334,7 @@
         test.Printf(_L("Change to US Locale\n"));   
         res=UserSvr::ChangeLocale(ELOCLUS);
         test.Printf(_L("res=%d\n"),res);
-        test_KErrNone(res);
+        test(res==KErrNone);
 
     WaitForSystemChange(notifier, stat, EChangesLocale);
     test(stat.Int() & EChangesLocale);
@@ -350,7 +350,7 @@
         test.Printf(_L("Change to GE Locale\n"));
         res=UserSvr::ChangeLocale(ELOCLGE);
         test.Printf(_L("res=%d\n"),res);
-        test_KErrNone(res);
+        test(res==KErrNone);
 
     WaitForSystemChange(notifier, stat, EChangesLocale);
     test(stat.Int() & EChangesLocale);
@@ -367,7 +367,7 @@
         test.Printf(_L("Load non ELOCL type DLL\n"));    
         res=UserSvr::ChangeLocale(DUMMYDLL);
         test.Printf(_L("res=%d\n"),res);
-        test_Value(res, res == KErrNotSupported);
+        test(res == KErrNotSupported);
     
     //-- ensure that there wasn't locale change
     const TInt KMaxAttempts = 100;
@@ -396,7 +396,7 @@
         test.Printf(_L("Change to US1 Locale\n"));  
         res=UserSvr::ChangeLocale(ELOCLUS1);
         test.Printf(_L("res=%d\n"),res);
-        test_KErrNone(res);
+        test(res==KErrNone);
     
     WaitForSystemChange(notifier, stat, EChangesLocale);
     test(stat.Int() & EChangesLocale);
@@ -437,7 +437,7 @@
         test.Printf(_L("Back to default UK Locale\n"));
         res=UserSvr::ChangeLocale(ELOCL_DEFAULT);
         test.Printf(_L("res=%d\n"),res);
-        test_KErrNone(res);
+        test(res==KErrNone);
     
     WaitForSystemChange(notifier, stat, EChangesLocale);
     test(stat.Int() & EChangesLocale);
@@ -459,12 +459,12 @@
         _LIT(KTestFile, "TEST.TXT");
         RFile file;
         res = file.Replace(TheFs, KTestFile, 0);
-        test_KErrNone(res);
+        test(res == KErrNone);
 
 
         res=UserSvr::ChangeLocale(ELOCLUS);
         test.Printf(_L("res=%d\n"),res);
-        test_KErrNone(res);
+        test(res==KErrNone);
 
 
     WaitForSystemChange(notifier, stat, EChangesLocale);
@@ -477,14 +477,14 @@
 
         _LIT8(KTestData, "Arsenal");
         res = file.Write(KTestData);
-        test_KErrNone(res);
+        test(res==KErrNone);
         file.Close();
 
         res = file.Open(TheFs, KTestFile, 0);
-        test_KErrNone(res);
+        test(res == KErrNone);
         file.Close();
         res = TheFs.Delete(KTestFile);
-        test_KErrNone(res);
+        test(res==KErrNone);
 
     //************************************************
 
@@ -650,11 +650,11 @@
     TExtendedLocale locale;
     locale.LoadLocale(ELOCLUS);
     TInt r = locale.SaveSystemSettings();
-    test_KErrNone(r);
+    test(r == KErrNone);
     testExtendedUS(ELocaleLanguageSettings | ELocaleCollateSetting | ELocaleLocaleSettings | ELocaleTimeDateSettings, locale);
 
     r = locale.SetCurrencySymbol(TPtrC(_S("Leu")));
-    test_KErrNone(r);
+    test(r == KErrNone);
     TCurrencySymbol symbol;
     symbol.Set();
     test(symbol.Compare(TPtrC(_S("Leu"))) == 0);
@@ -668,39 +668,35 @@
     eloclus.Copy(ELOCLUS);
     eloclus.Append(TPtrC(KDLLExtension));
     r = locale.GetLocaleDllName(ELocaleLanguageSettings, dllName);
-    test_KErrNone(r);
-	dllName.UpperCase();
+    test(r == KErrNone);
     test.Printf(_L("dllName looking for %s (%s)\n"), dllName.Ptr(), eloclus.Ptr());
     test(dllName.Find(eloclus) != KErrNotFound);
     
     dllName.FillZ();
 
     r = locale.GetLocaleDllName(ELocaleCollateSetting, dllName);
-    test_KErrNone(r);
-	dllName.UpperCase();
+    test(r == KErrNone);
     test(dllName.Find(eloclus) != KErrNotFound);
     
     dllName.FillZ();
 
     r = locale.GetLocaleDllName(ELocaleLocaleSettings, dllName);
-    test_KErrNone(r);
-	dllName.UpperCase();
+    test(r == KErrNone);
     test(dllName.Find(eloclus) != KErrNotFound);
     
     dllName.FillZ();
 
     r = locale.GetLocaleDllName(ELocaleTimeDateSettings, dllName);
-    test_KErrNone(r);
-	dllName.UpperCase();
+    test(r == KErrNone);
     test(dllName.Find(eloclus) != KErrNotFound);
     
     dllName.FillZ();
 
     r = locale.LoadLocaleAspect(ELocaleLocaleSettings | ELocaleTimeDateSettings, ELOCLGE);
-    test_KErrNone(r);
+    test(r == KErrNone);
 
     r = locale.SaveSystemSettings();
-    test_KErrNone(r);
+    test(r == KErrNone);
 
     testExtendedUS(ELocaleLanguageSettings | ELocaleCollateSetting, locale);
 
@@ -723,29 +719,25 @@
     eloclge.Copy(ELOCLGE);
     eloclge.Append(KDLLExtension);
     r = locale.GetLocaleDllName(ELocaleLanguageSettings, dllName);
-    test_KErrNone(r);
-	dllName.UpperCase();
+    test(r == KErrNone);
     test(dllName.Find(eloclus) != KErrNotFound);
     
     dllName.FillZ();
 
     r = locale.GetLocaleDllName(ELocaleCollateSetting, dllName);
-    test_KErrNone(r);
-	dllName.UpperCase();
+    test(r == KErrNone);
     test(dllName.Find(eloclus) != KErrNotFound);
     
     dllName.FillZ();
 
     r = locale.GetLocaleDllName(ELocaleLocaleSettings, dllName);
-    test_KErrNone(r);
-	dllName.UpperCase();
+    test(r == KErrNone);
     test(dllName.Find(eloclge) != KErrNotFound);
     
     dllName.FillZ();
 
     r = locale.GetLocaleDllName(ELocaleTimeDateSettings, dllName);
-    test_KErrNone(r);
-	dllName.UpperCase();
+    test(r == KErrNone);
     test(dllName.Find(eloclge) != KErrNotFound);
     
     dllName.FillZ();
--- a/kerneltest/f32test/server/t_dspace.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_dspace.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 //
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include "t_server.h"
@@ -105,7 +104,7 @@
 	{
 	TVolumeInfo v;
 	TInt r=TheFs.Volume(v,aDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	return(v.iFree);
 	}
 
@@ -116,7 +115,7 @@
 	{
 	TVolumeInfo v;
 	TInt r=TheFs.Volume(v,aDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	return(v.iSize);
 	}
 
@@ -127,7 +126,7 @@
 LOCAL_C TInt MinimumFileSize(TInt aDrive)
 	{
 	TInt r = TheFs.Delete(KTestFile1);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 
 	TInt64 freeSpace = FreeDiskSpace(aDrive);
 
@@ -135,15 +134,15 @@
 
 
 	r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r = file.Write(TheBuffer,1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	TInt64 newSpace = FreeDiskSpace(aDrive);
 
 	r = TheFs.Delete(KTestFile1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 
 	TInt64 minFileSize = freeSpace - newSpace;
@@ -217,7 +216,7 @@
 	// initialise removable drive descriptor
 	TChar c;
 	TInt r=RFs::DriveToChar(RemovableDrive,c);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RemovableDriveBuf[0]=(TText)c;
 
 	if( !LffsDrive )
@@ -231,7 +230,7 @@
 	// better format the default drive as long as not WINS c drive
 	TInt drive;
 	r= RFs::CharToDrive(gSessionPath[0],drive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 #if defined(__WINS__)
 	if(drive!=EDriveC)
 		Format(drive);
@@ -243,18 +242,18 @@
 	TheDiskSize=DiskSize(KDefaultDrive);
 	// and set the default directory
 	r=TheFs.MkDirAll(gSessionPath);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 
 	r=TheFs.Delete(KFileFiller);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 	r=TheFs.Delete(KTestFile1);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 	r=TheFs.Delete(KTestFile2);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 	r=TheFs.RmDir(KTestDir1);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 	r=TheFs.RmDir(KTestDir2);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 
 	gMinFileSize = MinimumFileSize(drive);
 	}
@@ -272,7 +271,7 @@
 		TInt r=aFile.Write(TheBuffer,s);
 		if( !LffsDrive )
 			{
-			test_KErrNone(r);
+			test(r==KErrNone);
 			}
 		else
 			{
@@ -327,7 +326,7 @@
 
 		if( !LffsDrive )
 			{
-			test_KErrNone(r);
+			test(r==KErrNone);
 			}
 		else
 			{
@@ -354,17 +353,17 @@
 		{
 		case ETaskMkDir:
 			r=TheFs.RmDir(KTestDir1);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			break;
 		case ETaskRmDir: break;
 		case ETaskDelete: break;
 		case ETaskReplace:
 			r=TheFs.Delete(KTestFile2);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			break;
 		case ETaskFileReplace:
 			r=TheFs.Delete(KTestFile1);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			break;
 		case ETaskFileWrite:
 		case ETaskFileWrite4KB:
@@ -397,15 +396,15 @@
 		case ETaskMkDir:	break;
 		case ETaskRmDir:
 			r=TheFs.MkDir(KTestDir1);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			break;
 		case ETaskDelete:
 			r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			if( !LffsDrive )
 				{
 				r=file.SetSize(KFileSize1);
-				test_KErrNone(r);
+				test(r==KErrNone);
 				}
 			else
 				{
@@ -417,11 +416,11 @@
 			break;
 		case ETaskReplace:
 			r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			if( !LffsDrive )
 				{
 				r=file.SetSize(KFileSize1);
-				test_KErrNone(r);
+				test(r==KErrNone);
 				}
 			else
 				{
@@ -429,11 +428,11 @@
 				}
 			file.Close();
 			r=file2.Create(TheFs,KTestFile2,EFileShareAny|EFileWrite);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			if( !LffsDrive )
 				{
 				r=file2.SetSize(KFileSize3);
-				test_KErrNone(r);
+				test(r==KErrNone);
 				}
 			else
 				{
@@ -443,7 +442,7 @@
 			break;
 		case ETaskFileReplace:
 			r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			if( !LffsDrive )
 				{
 				r=file.SetSize(KFileSize3*2);
@@ -452,7 +451,7 @@
 				{
 				WriteToFile( file, KFileSize3 );
 				}
-			test_KErrNone(r);
+			test(r==KErrNone);
 			file.Close();
 			break;
 		case ETaskFileWrite:
@@ -460,16 +459,16 @@
 		case ETaskFileWrite64KB:
 		case ETaskFileSetSize:
 			r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			file.Close();
 			break;
 		case ETaskNoChange1:
 			r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			if( !LffsDrive )
 				{
 				r=file.SetSize(KFileSize1);
-				test_KErrNone(r);
+				test(r==KErrNone);
 				}
 			else
 				{
@@ -479,7 +478,7 @@
 			break;
 		case ETaskNoChange2:
 			r=file.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			file.Close();
 			break;
 		case ETaskFileCreateLffs:
@@ -498,37 +497,37 @@
 	RTest test(_L("T_DSPACE_ThreadFunction"));
 	RFs fs;
 	TInt r=fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TThreadTask task=*(TThreadTask*)&aThreadTask;
 	RFile file;
 	switch(task)
 		{
 		case ETaskMkDir:
 			r=fs.MkDir(KTestDir1);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			break;
 		case ETaskRmDir:
 			r=fs.RmDir(KTestDir1);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			break;
 		case ETaskDelete:
 			r=fs.Delete(KTestFile1);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			break;
 		case ETaskReplace:
 			r=fs.Replace(KTestFile1,KTestFile2);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			break;
 		case ETaskFileReplace:
 			r=file.Replace(fs,KTestFile1,EFileShareAny|EFileWrite);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			file.Close();
 			break;
 		case ETaskFileWrite:
 			r=file.Open(fs,KTestFile1,EFileShareAny|EFileWrite);
-			test_KErrNone(r);
+			test(r==KErrNone);
 #if defined(__WINS__)
 			WriteToFile( file, gMinFileSize << 4);	// 512 * 16 = 8K
 #else
@@ -538,35 +537,35 @@
 			break;
 		case ETaskFileWrite4KB:
 			r=file.Open(fs,KTestFile1,EFileShareAny|EFileWrite);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			WriteToFile(file,gMinFileSize << 3);	// 512 * 2^3 = 512 * 8 = 4K
 			file.Close();
 			break;
 		case ETaskFileWrite64KB:
 			r=file.Open(fs,KTestFile1,EFileShareAny|EFileWrite);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			WriteToFile(file,gMinFileSize<<7);	// 512 * 2^7 = 512 * 128 = 64K
 			file.Close();
 			break;
 		case ETaskFileSetSize:
 			r=file.Open(fs,KTestFile1,EFileShareAny|EFileWrite);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			r=file.SetSize(KFileSize3);
 			file.Close();
 			break;
 		case ETaskFileCreateLffs:
 			r=file.Create(fs,KTestFile1,EFileShareAny|EFileWrite);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			file.Close();
 			break;
 		case ETaskNoChange1:
 			{
 			r=file.Open(fs,KTestFile1,EFileShareAny|EFileWrite);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			TTime time;
 			time.HomeTime();
 			r=file.SetModified(time);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			file.Close();
 			break;
 			}
@@ -574,7 +573,7 @@
 			{
 			TEntry e;
 			r=fs.Entry(KTestFile1,e);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			break;
 			}
 		case ETaskSpin:
@@ -733,13 +732,13 @@
 	// make default directory
 	_LIT(defaultDir,"C:\\F32-TST\\");
 	TInt r=TheFs.MkDirAll(defaultDir);
-	test_Value(r, r == KErrNone||r==KErrAlreadyExists);
+	test(r==KErrNone||r==KErrAlreadyExists);
 	// create the filler file
 	RFile file;
 	TFileName fileName=_L("C:");
 	fileName+=KFileFiller;
 	r=file.Create(TheFs,fileName,EFileShareAny|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt64 free=FreeDiskSpace(EDriveC);
 	// use up 16KB
 	FillDisk(file,free-16384,EDriveC);
@@ -755,11 +754,11 @@
 	RFormat f;
 	TInt count;
 	r=f.Open(TheFs,RemovableDriveBuf,EQuickFormat,count);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	while(count)
 		{
 		r=f.Next(count);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	f.Close();
 	User::After(1000000);
@@ -773,7 +772,7 @@
 	fName+=RemovableDriveBuf;
 	fName+=_L("F32-TST\\");
 	r=TheFs.MkDirAll(fName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// test that a media change notifies clients on all drives
 	test.Next(_L("media change"));
@@ -807,7 +806,7 @@
 	test.Next(_L("scandrive"));
 	// first test that scandrive does not find any problems on the removable media
 	r=TheFs.ScanDrive(RemovableDriveBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	// now set up disk space notification
 	freeC=FreeDiskSpace(EDriveC);
 	freeD=FreeDiskSpace(RemovableDrive);
@@ -817,7 +816,7 @@
 	TheFs.NotifyDiskSpace(freeD-8192,RemovableDrive,stat2);
 	test(stat1==KRequestPending && stat2==KRequestPending);
 	r=TheFs.ScanDrive(RemovableDriveBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::After(1000000);
 	User::WaitForRequest(stat2);
 	test(stat1==KRequestPending && stat2==KErrNone);
@@ -826,11 +825,11 @@
 
 	file.Close();
 	r=TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	if(gSessionPath[0]!=(TText)'C')
 		{
 		r=TheFs.RmDir(defaultDir);
-		test_Value(r, r == KErrNone||r==KErrInUse);
+		test(r==KErrNone||r==KErrInUse);
 		}
 
 	}
@@ -846,7 +845,7 @@
 	// create the filler file
 	RFile file;
 	TInt r=file.Create(TheFs,KFileFiller,EFileShareAny|EFileWrite|EFileWriteDirectIO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt64 newSpace = FreeDiskSpace(KDefaultDrive)-8192;
 	FillDisk(file,newSpace,KDefaultDrive);
 
@@ -861,7 +860,7 @@
 	test(stat1==KRequestPending);
 	RThread thread;
 	r=thread.Create(_L("thread1"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread.Resume();
 	User::WaitForRequest(stat1);
 	test(stat1==KErrNone);
@@ -886,7 +885,7 @@
 		TheFs.NotifyDiskSpace(threshold,KDefaultDrive,stat1);
 		test(stat1==KRequestPending);
 		r=thread.Create(_L("thread2"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		TRequestStatus deathStat;
 		thread.Logon( deathStat );
 		thread.Resume();
@@ -912,7 +911,7 @@
 	TheFs.NotifyDiskSpace(threshold,KDefaultDrive,stat1);
 	test(stat1==KRequestPending);
 	r=thread.Create(_L("thread3"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread.Logon( deathStat );
 	thread.Resume();
 
@@ -945,7 +944,7 @@
 	TheFs.NotifyDiskSpace(threshold,KDefaultDrive,stat1);
 	test(stat1==KRequestPending);
 	r=thread.Create(_L("thread4"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread.Logon( deathStat );
 	thread.Resume();
 	User::WaitForRequest(stat1);
@@ -981,7 +980,7 @@
 	    test(stat1==KRequestPending);
 
 	    r=thread.Create(_L("thread5"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task);
-	    test_KErrNone(r);
+	    test(r==KErrNone);
 	    thread.Logon( deathStat );
 	    thread.Resume();
 
@@ -1005,7 +1004,7 @@
 	    TheFs.NotifyDiskSpace(threshold,KDefaultDrive,stat1);
 	    test(stat1==KRequestPending);
 	    r=thread.Create(_L("thread6"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task);
-	    test_KErrNone(r);
+	    test(r==KErrNone);
 	    thread.Logon( deathStat );
 	    thread.Resume();
 	    User::WaitForRequest(stat1);
@@ -1034,15 +1033,15 @@
 		TBuf<10> someFile=_L("?:\\abcdef");
 		TChar c;
 		TInt r=RFs::DriveToChar(RemovableDrive,c);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		someFile[0]=(TText)c;
 #endif
 		_LIT(someDir,"C:\\1234\\");
 
 		r=f2.Create(TheFs,someFile,EFileShareAny|EFileWrite);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.MkDir(someDir);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		TRequestStatus stat2;
 		TInt64 freeC=FreeDiskSpace(EDriveC);
 		TInt64 freeD=FreeDiskSpace(RemovableDrive);
@@ -1052,7 +1051,7 @@
 		// before fix this would result in iTheDrive not being updated in next subsession call
 		// therefore this could would not result in a disk space notification
 		r=f2.SetSize(8192);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		User::After(1000000);
 		User::WaitForRequest(stat2);
 
@@ -1067,14 +1066,14 @@
 		TheFs.NotifyDiskSpaceCancel();
 		test(stat1==KErrCancel);
 		r=TheFs.Delete(someFile);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.RmDir(someDir);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 
 	file.Close();
 	r=TheFs.Delete(KFileFiller);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 
@@ -1090,7 +1089,7 @@
 	// create the filler file
 	RFile file;
 	TInt r=file.Create(TheFs,KFileFiller,EFileShareAny|EFileWrite|EFileWriteDirectIO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt64 newSpace = FreeDiskSpace(KDefaultDrive)-8192;
 	FillDisk(file,newSpace,KDefaultDrive);
 
@@ -1109,7 +1108,7 @@
 	test(stat1==KRequestPending && stat2==KRequestPending);
 	RThread thread;
 	r=thread.Create(_L("thread7"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TRequestStatus deathStat;
 	thread.Logon( deathStat );
 	thread.Resume();
@@ -1144,7 +1143,7 @@
 	TheFs.NotifyDiskSpace(threshold3,KDefaultDrive,stat3);
 	test(stat1==KRequestPending && stat2==KRequestPending && stat3==KRequestPending);
 	r=thread.Create(_L("thread8"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread.Logon( deathStat );
 	thread.SetPriority( EPriorityLess );
 	thread.Resume();	// start spinning, blocks background thread
@@ -1159,7 +1158,7 @@
 	test( KErrNone==r );
 	// create a  file to force some roll-forward
 	r=file2.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(stat1);
 	test(stat1==KErrNone);
 	test(stat2==KRequestPending);
@@ -1194,13 +1193,13 @@
 	TheFs.NotifyDiskSpace(threshold3,KDefaultDrive,stat3);
 	test(stat1==KRequestPending && stat2==KRequestPending && stat3==KRequestPending);
 	r=thread.Create(_L("thread9"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread.Logon( deathStat );
 	thread.SetPriority( EPriorityLess );
 	thread.Resume();	// start spinning, blocks background thread
 	// create a  file to force some roll-forward
 	r=file2.Create(TheFs,KTestFile1,EFileShareAny|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(stat1);
 	test(stat1==KErrNone);
 	test(stat2==KRequestPending);
@@ -1225,7 +1224,7 @@
 
 	file.Close();
 	r=TheFs.Delete(KFileFiller);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 
@@ -1237,13 +1236,13 @@
 	// create the filler file
 	RFile file;
 	TInt r=file.Create(TheFs,KFileFiller,EFileShareAny|EFileWrite|EFileWriteDirectIO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt64 free=FreeDiskSpace(KDefaultDrive);
 	TInt64 freeSpaceLeft = gMinFileSize << 4;	// 512 * 2^4 = 512 * 16 = 8K
 	FillDisk(file,free-freeSpaceLeft,KDefaultDrive);
 	TInt size;
 	r=file.Size(size);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(size>1024);
 	test.Printf(_L("filler file size=0x%x\n"),size);
 
@@ -1266,7 +1265,7 @@
 	test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending);
 	RThread thread;
 	r=thread.Create(_L("thread1"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TRequestStatus deathStat;
 	thread.Logon( deathStat );
 	thread.Resume();
@@ -1303,7 +1302,7 @@
 		TheFs.NotifyDiskSpace(threshold3,KDefaultDrive,stat3);
 		test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending);
 		r=thread.Create(_L("thread2"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		thread.Logon( deathStat );
 		thread.Resume();
 		User::After(10000);
@@ -1340,13 +1339,13 @@
 	test.Next(_L("test multiple sessions on same drive"));
 	RFs ses2,ses3;
 	r=ses2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=ses3.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=ses2.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=ses3.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	task=ETaskFileReplace;
 	InitialiseForThread(task);
 	free=FreeDiskSpace(KDefaultDrive);
@@ -1359,7 +1358,7 @@
 	ses3.NotifyDiskSpace(threshold3,KDefaultDrive,stat3);
 	test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending);
 	r=thread.Create(_L("thread3"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread.Logon( deathStat );
 	thread.Resume();
 	User::After(1000000);
@@ -1391,7 +1390,7 @@
 		{
 		TInt sessionDrive;
 		r=RFs::CharToDrive(gSessionPath[0],sessionDrive);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		if(sessionDrive!=RemovableDrive)
 			{
 			// first create a file on the removable drive
@@ -1400,9 +1399,9 @@
 			file2name+=_L("F32-TST\\testfile1");
 			TheFs.Delete(file2name);
 			r=file2.Create(TheFs,file2name,EFileShareAny|EFileWrite);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			r=file2.SetSize(KFileSize3);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			// test multiple sessions not notified on disk space change on wrong drive
 			test.Next(_L("test multiple sessions on different drives"));
 			task=ETaskFileReplace;
@@ -1415,7 +1414,7 @@
 			ses2.NotifyDiskSpace(threshold2,RemovableDrive,stat2);
 			test(stat1==KRequestPending&&stat2==KRequestPending);
 			r=thread.Create(_L("thread4"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			thread.Logon( deathStat );
 			thread.Resume();
 			User::After(1000000);
@@ -1432,7 +1431,7 @@
 			test(stat2==KErrCancel);
 			file2.Close();
 			r=TheFs.Delete(file2name);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			}
 		}
 
@@ -1442,7 +1441,7 @@
 
 	file.Close();
 	r=TheFs.Delete(KFileFiller);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	}
 
@@ -1455,12 +1454,12 @@
 	// create the filler file
 	RFile file;
 	TInt r=file.Create(TheFs,KFileFiller,EFileShareAny|EFileWrite|EFileWriteDirectIO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt64 free=FreeDiskSpace(KDefaultDrive);
 	FillDisk(file,free-8192,KDefaultDrive);
 	TInt size;
 	r=file.Size(size);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("filler file size=0x%x\n"),size);
 
 
@@ -1481,7 +1480,7 @@
 	test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending);
 	RThread thread;
 	r=thread.Create(_L("thread10"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TRequestStatus deathStat;
 	thread.Logon( deathStat );
 //	test.Printf(_L("Resuming other thread"));
@@ -1512,7 +1511,7 @@
 
 	TInt sessionDrive;
 	r=RFs::CharToDrive(gSessionPath[0],sessionDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	if(sessionDrive!=EDriveC)
 		{
 		// test multiple sessions not notified on disk space change on wrong drive
@@ -1520,13 +1519,13 @@
 
 		RFs ses2,ses3;
 		r=ses2.Connect();
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=ses3.Connect();
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=ses2.SetSessionPath(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=ses3.SetSessionPath(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 
 		// first create a file on the C:\ drive
 		RFile file2;
@@ -1537,7 +1536,7 @@
 		file2name+=_L("testfile1");
 		TheFs.Delete(file2name);
 		r=file2.Create(TheFs,file2name,EFileShareAny|EFileWrite);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		WriteToFile( file2, KFileSize3 );
 
 		task=ETaskFileReplace;
@@ -1550,7 +1549,7 @@
 		ses2.NotifyDiskSpace(threshold2,EDriveC,stat2);
 		test(stat1==KRequestPending&&stat2==KRequestPending);
 		r=thread.Create(_L("thread11"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		thread.Logon( deathStat );
 		thread.Resume();
 		User::After(1000000);
@@ -1568,7 +1567,7 @@
 		test(stat2==KErrCancel);
 		file2.Close();
 		r=TheFs.Delete(file2name);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		ses2.Close();
 		ses3.Close();
 		}
@@ -1577,7 +1576,7 @@
 
 	file.Close();
 	r=TheFs.Delete(KFileFiller);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	}
 
@@ -1590,7 +1589,7 @@
 	// create a filler file
 	RFile file;
 	TInt r=file.Create(TheFs,KFileFiller,EFileShareAny|EFileWrite|EFileWriteDirectIO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt64 free=FreeDiskSpace(KDefaultDrive);
 	// use 8KB in filler file
 	FillDisk(file,free-8192,KDefaultDrive);
@@ -1609,7 +1608,7 @@
 	test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending);
 	RThread thread;
 	r=thread.Create(_L("thread1"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TRequestStatus deathStat;
 	thread.Logon( deathStat );
 	thread.Resume();
@@ -1636,13 +1635,13 @@
 	test.Next(_L(" test change notification and disk space notification"));
 	RFs session2,session3;
 	r=session2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=session3.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=session2.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=session3.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	task=ETaskFileWrite;
 	InitialiseForThread(task);
 	free=FreeDiskSpace(KDefaultDrive);
@@ -1652,7 +1651,7 @@
 	session3.NotifyChange(ENotifyAll,stat3,KTestFile1);
 	test(stat1==KRequestPending&&stat2==KRequestPending&&stat3==KRequestPending);
 	r=thread.Create(_L("thread2"),ThreadFunction,KStackSize,KHeapSize,KHeapSize,(TAny*)task);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread.Logon( deathStat );
 	thread.Resume();
 	User::After(1000000);
@@ -1693,7 +1692,7 @@
 
 	file.Close();
 	r=TheFs.Delete(KFileFiller);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	}
 
@@ -1709,11 +1708,11 @@
 _LIT(KPreModifierPluginName,"PreModifierPlugin");
 const TUint KTestFileSize = KKilo * 100;
 
-#define SAFETEST_KErrNone(a)        if(a != KErrNone)\
+#define SAFETEST(a)				if(a != KErrNone)\
                                         {\
                                         TheFs.DismountPlugin(KPreModifierPluginName);\
                                         TheFs.RemovePlugin(KPreModifierPluginName);\
-                                        test_KErrNone(a);\
+                                        test(a == KErrNone);\
                                         }
 
 TInt PluginTestThreadFunction(TAny*)
@@ -1723,19 +1722,19 @@
     fs.Connect();
     
     TInt r = fs.SetSessionPath(gSessionPath);
-    test_KErrNone(r);
+    test(r == KErrNone);
     
     RFile file;
     r = file.Create(fs, KTestFile1, EFileShareAny|EFileWrite);
-    test_KErrNone(r);
+    test(r == KErrNone);
     r = file.SetSize(KTestFileSize);
-    test_KErrNone(r);
+    test(r == KErrNone);
     file.Close();
       
     User::After(5000000); // wait for 5 seconds, to ensure first notification received.
     
     r = fs.Delete(KTestFile1);
-    test_KErrNone(r);
+    test(r == KErrNone);
     
     fs.Close();
     return KErrNone;
@@ -1747,17 +1746,17 @@
       
     TInt drive;
     TInt r = RFs::CharToDrive(gSessionPath[0],drive);
-    SAFETEST_KErrNone(r);
+    SAFETEST(r);
     Format(drive);
     
     r = TheFs.MkDirAll(gSessionPath);
-    SAFETEST_KErrNone(r);
+    SAFETEST(r);
      
     r = TheFs.AddPlugin(KPreModifierPluginFileName);
-    SAFETEST_KErrNone(r);
+    SAFETEST(r);
 
     r = TheFs.MountPlugin(KPreModifierPluginName);
-    SAFETEST_KErrNone(r);
+    SAFETEST(r);
     
     TInt64 free = FreeDiskSpace(drive);
     TInt64 threshold = free - KTestFileSize + 1;
@@ -1769,26 +1768,26 @@
     
     RThread thread;
     r = thread.Create(_L("PluginTestThread"), PluginTestThreadFunction, KStackSize, KHeapSize, KHeapSize, NULL);
-    SAFETEST_KErrNone(r);
+    SAFETEST(r);
     thread.Logon(statusDeath);
     thread.Resume();
     
     User::WaitForRequest(status);
-    SAFETEST_KErrNone(status.Int());
+    SAFETEST(status.Int());
     
     TheFs.NotifyDiskSpace(threshold, drive, status);
     User::WaitForRequest(status);
-    SAFETEST_KErrNone(status.Int());
+    SAFETEST(status.Int());
     
     User::WaitForRequest(statusDeath);
-    SAFETEST_KErrNone(statusDeath.Int());
+    SAFETEST(statusDeath.Int());
     thread.Close();
     
     r = TheFs.DismountPlugin(KPreModifierPluginName);
-    SAFETEST_KErrNone(r);
+    SAFETEST(r);
 
     r = TheFs.RemovePlugin(KPreModifierPluginName);
-    SAFETEST_KErrNone(r);
+    SAFETEST(r);
 
     Format(drive);
     }
@@ -1831,7 +1830,7 @@
 		}
 	//Test uses C drive as secondary drive so test can't be tested on that drive
 	r = TheFs.CharToDrive(gSessionPath[0], driveNumber);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	if(driveNumber == EDriveC)
 		{
 		test.Printf(_L("Test uses C drive as secondary drive so test can't be test on C drive, test will exit"));
--- a/kerneltest/f32test/server/t_ext1.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_ext1.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32svr.h>
@@ -47,97 +46,98 @@
 	test.Next(_L("TestSecondaryExtensions()"));
 	TInt drive;
 	TInt err=RFs::CharToDrive(gDriveToTest,drive);
-	test_KErrNone(err);
+	test(err==KErrNone);
 	
 	TPckgBuf<TBool> drvSyncBuf;
 	err = TheFs.QueryVolumeInfoExt(drive, EIsDriveSync, drvSyncBuf);
-	test_KErrNone(err);
+	test(err==KErrNone);
 	const TBool bDrvSync = drvSyncBuf();
 			
 
 	TFullName fsName;
 	TInt r=TheFs.FileSystemName(fsName,drive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("fsName=%S\n"),&fsName);
 
-	if (Is_SimulatedSystemDrive(TheFs, drive))
+#if defined(__WINS__)
+	if(drive==EDriveC)
 		{
-		// check that the extension cannot be mounted since it is not supported by the file system
-		test.Printf(_L("Test extension cannot be mounted"));
+		// check that the extension cannot be mounted since not supported by the file system
 		r=TheFs.AddExtension(KExtensionLog);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.MountExtension(KExtensionLogName,drive);
-		test_Value(r, r == KErrNotSupported);
+		test(r==KErrNotSupported);
 		r=TheFs.RemoveExtension(KExtensionLogName);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		return;
 		}
+#endif
 
 	test.Next(_L("RFs::AddExtension()"));
 	r=TheFs.AddExtension(KExtensionLog);
 	RDebug::Print(_L("addext=%d"),r);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.AddExtension(KExtensionLog);
-	test_Value(r, r == KErrAlreadyExists);
+	test(r==KErrAlreadyExists);
 	r=TheFs.AddExtension(KExtensionRubbish);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=TheFs.AddExtension(KExtensionEmpty);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("RFs::MountExtension()"));
 #if !defined(__WINS__)
 	// check that the extension cannot be mounted on file system that does not support extensions
 	r=TheFs.MountExtension(KExtensionLogName,EDriveZ);
-	test_Value(r, r == KErrNotSupported);
+	test(r==KErrNotSupported);
 #endif
 	// test mounting on drive with no file system
 	r=TheFs.DismountFileSystem(fsName,drive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.MountExtension(KExtensionLogName,drive);
-	test_Value(r, r == KErrNotReady);
+	test(r==KErrNotReady);
 	r=TheFs.MountFileSystem(fsName,drive,bDrvSync);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	// test with a resource open
 	_LIT(KFileName,"testing.doc");
 	RFile file;
 	r=file.Replace(TheFs,KFileName,EFileShareExclusive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.MountExtension(KExtensionLogName,drive);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	file.Close();
 	r=TheFs.Delete(KFileName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	// test with a format open
 	TBuf<4> driveBuf=_L("?:\\");
 	driveBuf[0]=(TText)(drive+'A');
 	RFormat format;
 	TInt count;
 	r=format.Open(TheFs,driveBuf,EHighDensity,count);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.MountExtension(KExtensionLogName,drive);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	format.Close();
 	// get the extension name
 	TFullName extName;
 	r=TheFs.ExtensionName(extName,drive,0);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	// now load the extension
 	r=TheFs.MountExtension(KExtensionLogName,drive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.ExtensionName(extName,drive,0);
-	test_Value(r, r == KErrNone && extName==KExtensionLogName);
+	test(r==KErrNone && extName==KExtensionLogName);
 	r=TheFs.ExtensionName(extName,drive,1);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	// try remounting the same extension
 	r=TheFs.MountExtension(KExtensionLogName,drive);
-	test_Value(r, r == KErrAlreadyExists);
+	test(r==KErrAlreadyExists);
 	// mount a second extension
 	r=TheFs.MountExtension(KExtensionEmptyName,drive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.ExtensionName(extName,drive,0);
-	test_Value(r, r == KErrNone && extName==KExtensionLogName);
+	test(r==KErrNone && extName==KExtensionLogName);
 	r=TheFs.ExtensionName(extName,drive,1);
-	test_Value(r, r == KErrNone && extName==KExtensionEmptyName);
+	test(r==KErrNone && extName==KExtensionEmptyName);
 	
     // force a remount on a removable media and check that extensions both exist
     test.Printf(_L("Test forcing remount\n"));
@@ -153,7 +153,7 @@
 
         test.Printf(_L("Remounting the drive\n"), r);
         r = TheFs.RemountDrive(drive, NULL, (TUint) KMediaRemountForceMediaChange);
-        test_Value(r, r == KErrNotReady || r == KErrNone);
+        test(r == KErrNotReady || r == KErrNone);
         
         do
         {
@@ -181,7 +181,7 @@
     	RLocalDrive d;
 		TBool flag=EFalse;
 		r=d.Connect(1,flag);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		d.ForceMediaChange();
 		d.Close();
 //#if defined(__WINS__)
@@ -195,9 +195,9 @@
 
 
 	r=TheFs.ExtensionName(extName,drive,0);
-	test_Value(r, r == KErrNone && extName==KExtensionLogName);
+	test(r==KErrNone && extName==KExtensionLogName);
 	r=TheFs.ExtensionName(extName,drive,1);
-	test_Value(r, r == KErrNone && extName==KExtensionEmptyName);
+	test(r==KErrNone && extName==KExtensionEmptyName);
 
     test.Printf(_L("Accessing media...\n"));
 	// and now do some file system operations
@@ -207,64 +207,64 @@
     test.Printf(_L("res=%d\n"), r);
 
 
-	test_Value(r, r == KErrNone||r==KErrAlreadyExists);
+	test(r==KErrNone||r==KErrAlreadyExists);
 	RFile file1;
 	r=file1.Replace(TheFs,file1Name,EFileShareExclusive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file1.Write(toWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file1.Read(0,readBuf);
 	test(readBuf==toWrite);
 	r=file1.SetSize(0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	r=TheFs.Delete(file1Name);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(dir1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("RFs::DismountExtension()"));
 	// test with a resource open
 	r=file.Replace(TheFs,KFileName,EFileShareExclusive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.DismountExtension(KExtensionLogName,drive);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	file.Close();
 	r=TheFs.Delete(KFileName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	// test with a format open
 	r=format.Open(TheFs,driveBuf,EHighDensity,count);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.DismountExtension(KExtensionLogName,drive);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	format.Close();
 	// now dismount an extension
 	r=TheFs.DismountExtension(KExtensionLogName,drive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.ExtensionName(extName,drive,0);
-	test_Value(r, r == KErrNone && extName==KExtensionEmptyName);
+	test(r==KErrNone && extName==KExtensionEmptyName);
 	r=TheFs.ExtensionName(extName,drive,1);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	// try to dismount an extension that is not mounted
 	r=TheFs.DismountExtension(KExtensionLogName,drive);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=TheFs.ExtensionName(extName,drive,0);
-	test_Value(r, r == KErrNone && extName==KExtensionEmptyName);
+	test(r==KErrNone && extName==KExtensionEmptyName);
 	r=TheFs.ExtensionName(extName,drive,1);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	// dismount the remaining extension
 	r=TheFs.DismountExtension(KExtensionEmptyName,drive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.ExtensionName(extName,drive,0);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=TheFs.ExtensionName(extName,drive,1);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 
 	test.Next(_L("RFs::RemoveExtension()"));
 	r=TheFs.RemoveExtension(KExtensionLogName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RemoveExtension(KExtensionEmptyName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 void TestPrimaryExtensions()
@@ -276,17 +276,16 @@
 	test.Next(_L("TestPrimaryExtensions()"));
 	TInt drive;
 	TInt err=RFs::CharToDrive(gDriveToTest,drive);
-	test_KErrNone(err);
+	test(err==KErrNone);
 
-	if(Is_SimulatedSystemDrive(TheFs, drive))
-	    {
-		test.Printf(_L("Skipping TestPrimaryExtensions on PlatSim/Emulator drive %C:\n"), gSessionPath[0]);
+#if defined(__WINS__)
+	if(drive==EDriveC)
 		return;
-	    }
+#endif
 
 	TPckgBuf<TBool> drvSyncBuf;
 	err = TheFs.QueryVolumeInfoExt(drive, EIsDriveSync, drvSyncBuf);
-	test_KErrNone(err);
+	test(err==KErrNone);
     const TBool bDrvSync = drvSyncBuf();
 
 	// don't test on ram drive since accesses memory directly
@@ -297,142 +296,142 @@
 
 	TFullName fsName;
 	r=TheFs.FileSystemName(fsName,drive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("fsName=%S\n"),&fsName);
 
 	test.Next(_L("RFs::AddExtension()"));
 	r=TheFs.AddExtension(KExtensionLog);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.AddExtension(KExtensionEmpty);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.AddExtension(KExtensionBit);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("RFs::MountFileSystem()"));
 	// test with file system that already exists
 	r=TheFs.MountFileSystem(fsName,KExtensionBitName,drive,bDrvSync);
-	test_Value(r, r == KErrAccessDenied);
+	test(r==KErrAccessDenied);
 	// unmount drive and mount primary extension along with file system
 	r=TheFs.DismountFileSystem(fsName,drive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
     //-- !! N.B this extension mangles data read/written ftom/to the media, for some file systems it is OK and mounting succeeds
     //-- for others - this will result in KErrCorrupt
 	r=TheFs.MountFileSystem(fsName,KExtensionBitName,drive,bDrvSync);
-	test_Value(r, r == KErrNone||r==KErrCorrupt);
+	test(r==KErrNone||r==KErrCorrupt);
 	
     // and now format
 	Format(drive);
 	TFullName extName;
 	r=TheFs.ExtensionName(extName,drive,0);
-	test_Value(r, r == KErrNone && extName==KExtensionBitName);
+	test(r==KErrNone && extName==KExtensionBitName);
 	r=TheFs.ExtensionName(extName,drive,1);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	
 	// and now do some file system operations
 	TBuf8<16> readBuf;
 	r=TheFs.MkDir(dir1);
-	test_Value(r, r == KErrNone||r==KErrAlreadyExists);
+	test(r==KErrNone||r==KErrAlreadyExists);
 	RFile file1;
 	r=file1.Replace(TheFs,file1Name,EFileShareExclusive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file1.Write(toWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file1.Read(0,readBuf);
 	test(readBuf==toWrite);
 	r=file1.SetSize(0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	r=TheFs.Delete(file1Name);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(dir1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// add a secondary extension
 	test.Printf(_L("RFs::MountExtension()"));
 	r=TheFs.MountExtension(KExtensionLogName,drive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.ExtensionName(extName,drive,0);
-	test_Value(r, r == KErrNone && extName==KExtensionBitName);
+	test(r==KErrNone && extName==KExtensionBitName);
 	r=TheFs.ExtensionName(extName,drive,1);
-	test_Value(r, r == KErrNone && extName==KExtensionLogName);
+	test(r==KErrNone && extName==KExtensionLogName);
 	// try to add the same extension
 	r=TheFs.MountExtension(KExtensionBitName,drive);
-	test_Value(r, r == KErrAlreadyExists);
+	test(r==KErrAlreadyExists);
 	r=TheFs.ExtensionName(extName,drive,0);
-	test_Value(r, r == KErrNone && extName==KExtensionBitName);
+	test(r==KErrNone && extName==KExtensionBitName);
 	r=TheFs.ExtensionName(extName,drive,1);
-	test_Value(r, r == KErrNone && extName==KExtensionLogName);
+	test(r==KErrNone && extName==KExtensionLogName);
 	// try to add a third extension
 	r=TheFs.MountExtension(KExtensionEmptyName,drive);
-	test_Value(r, r == KErrAccessDenied);
+	test(r==KErrAccessDenied);
 	r=TheFs.ExtensionName(extName,drive,0);
-	test_Value(r, r == KErrNone && extName==KExtensionBitName);
+	test(r==KErrNone && extName==KExtensionBitName);
 	r=TheFs.ExtensionName(extName,drive,1);
-	test_Value(r, r == KErrNone && extName==KExtensionLogName);
+	test(r==KErrNone && extName==KExtensionLogName);
 
 	// and now do some file system operations
 	r=TheFs.MkDir(dir1);
-	test_Value(r, r == KErrNone||r==KErrAlreadyExists);
+	test(r==KErrNone||r==KErrAlreadyExists);
 	r=file1.Replace(TheFs,file1Name,EFileShareExclusive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file1.Write(toWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file1.Read(0,readBuf);
 	test(readBuf==toWrite);
 	r=file1.SetSize(0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file1.Close();
 	r=TheFs.Delete(file1Name);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(dir1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Printf(_L("RFs::DismountExtension()"));
 	// test that can't dismount a primary extension via this method
 	r=TheFs.DismountExtension(KExtensionLogName,drive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.ExtensionName(extName,drive,0);
-	test_Value(r, r == KErrNone && extName==KExtensionBitName);
+	test(r==KErrNone && extName==KExtensionBitName);
 	r=TheFs.ExtensionName(extName,drive,1);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=TheFs.DismountExtension(KExtensionBitName,drive);
-	test_Value(r, r == KErrAccessDenied);
+	test(r==KErrAccessDenied);
 	r=TheFs.ExtensionName(extName,drive,0);
-	test_Value(r, r == KErrNone && extName==KExtensionBitName);
+	test(r==KErrNone && extName==KExtensionBitName);
 	r=TheFs.ExtensionName(extName,drive,1);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	
 	test.Printf(_L("RFs::DismountFileSystem()"));
 	r=TheFs.MountExtension(KExtensionLogName,drive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.ExtensionName(extName,drive,0);
-	test_Value(r, r == KErrNone && extName==KExtensionBitName);
+	test(r==KErrNone && extName==KExtensionBitName);
 	r=TheFs.ExtensionName(extName,drive,1);
-	test_Value(r, r == KErrNone && extName==KExtensionLogName);
+	test(r==KErrNone && extName==KExtensionLogName);
 	// and now dismount
 	r=TheFs.DismountFileSystem(fsName,drive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.ExtensionName(extName,drive,0);
-	test_Value(r, r == KErrNotReady);
+	test(r==KErrNotReady);
 	r=TheFs.ExtensionName(extName,drive,1);
-	test_Value(r, r == KErrNotReady);
+	test(r==KErrNotReady);
 	// remount the file system
 	r=TheFs.MountFileSystem(fsName,drive,bDrvSync);
-	test_Value(r, r == KErrNone||r==KErrCorrupt);
+	test(r==KErrNone||r==KErrCorrupt);
 	r=TheFs.ExtensionName(extName,drive,0);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=TheFs.ExtensionName(extName,drive,1);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	Format(drive);
 
 	test.Next(_L("RFs::RemoveExtension()"));
 	r=TheFs.RemoveExtension(KExtensionLogName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RemoveExtension(KExtensionEmptyName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RemoveExtension(KExtensionBitName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 
@@ -447,21 +446,8 @@
     TInt drive;
 	TInt err=RFs::CharToDrive(gDriveToTest,drive);
 	test.Start(_L("Starting Test - T_EXT1"));
-	test_KErrNone(err);
+	test(err==KErrNone);
 
-	// Check that the drive supports extensions.
-	TBool extensionsSupported = EFalse;
-	TPckg<TBool> dataBuf(extensionsSupported);
-	err = TheFs.QueryVolumeInfoExt(drive,EFSysExtensionsSupported,dataBuf);
-	test_KErrNone(err);
-	if(!extensionsSupported)
-	    {
-        test.Printf(_L("Drive %C: does not support file sys extensions. Skipping T_EXT1."), gSessionPath[0]);
-        test.End();
-        test.Close();
-        return;
-	    }
-	
     PrintDrvInfo(TheFs, drive);
 
 //Do not run this test on the NAND drive, as
@@ -475,7 +461,6 @@
 	TheFs.Drive(driveInfo,drive);
 	if (driveInfo.iType == EMediaNANDFlash)
 		{
-		test.Printf(_L("Skipping T_EXT1 as drive %C: is NAND\n"), gSessionPath[0]);
 		return;
 		}
 #endif
--- a/kerneltest/f32test/server/t_falsespace.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_falsespace.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1049,7 +1049,7 @@
 	test_KErrNone(nRes);
     for(i=0; i<MaxDummyFiles; ++i)
 	    {
-        nRes = DeleteFileX(KBaseFN, i);
+        nRes = DeleteFileX(KBaseFN, i); 
         test_KErrNone(nRes);
 		}
 	}
@@ -1084,6 +1084,7 @@
 	}
 
 
+
 //-----------------------------------------------------------------------------
 /**
     Test that the reserving some drive space does not takes more space than required.
@@ -1150,15 +1151,14 @@
 }
 
 //-----------------------------------------------------------------------------
-
-GLDEF_C void CallTestsL()
+void CallTestsL()
 //
 // Do tests relative to session path
 //
 	{
-	//-- set up console output
-	Fat_Test_Utils::SetConsole(test.Console());
-
+	//-- set up console output 
+	Fat_Test_Utils::SetConsole(test.Console()); 
+	
 	// If TESTFAST mode (for automated test builds) is set, don't run LFFS tests.
 	if ((UserSvr::DebugMask(2) & 0x00000002) && IsTestingLFFS())
 		{
@@ -1178,9 +1178,11 @@
 	r = TheFs.Drive(drv, gTestDrive);
 	test_KErrNone(r);
 
+
 	//-- print drive information
 	PrintDrvInfo(TheFs, gTestDrive);
 
+
 	// do not run the remainder of this test on RAM drive
 	if (drv.iType == EMediaRam)
 		{
@@ -1189,9 +1191,9 @@
 		return;
 		}
 
-	if (Is_SimulatedSystemDrive(TheFs, gTestDrive))
+	if (Is_Win32(TheFs, gTestDrive))
 		{
-		test.Printf(_L("Skipping T_FALSESPACE on PlatSim/Emulator drive %C:\n"), gSessionPath[0]);
+		test.Printf(_L("Skipping on emulator %C: drive\n"), gSessionPath[0]);
 		return;
 		}
 
@@ -1199,14 +1201,14 @@
 	Test1();	// General test for new APIs
 	Test2();	// Test to ensure drive and session reserve limits are not exceeded
 	Test3();
-	Test4();	// Test filling the drive and that each checked API fails
+	Test4();	// test filling the drive and that each checked API fails
 	Test5();
 	Test6();
 	Test7();
 	TestForDEF142554();
-	Test2();	// Run this test to check reserves are being cleared correctly
+	Test2();	// run this test to check reserves are being cleared correctly
 
 	TestFAT4G_Boundary();
-
+    
 	TurnAllocFailureOff();
 	}
--- a/kerneltest/f32test/server/t_fatcharsetconv_aux.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_fatcharsetconv_aux.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -50,11 +50,11 @@
 	RFormat format;
 	TInt count;
 	TInt r=format.Open(TheFs,driveBuf,EQuickFormat,count);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	while(count)
 		{
 		TInt r=format.Next(count);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	format.Close();
 	}
@@ -65,7 +65,7 @@
 //
 	{
 	TInt r=TheFs.MkDirAll(aDirName);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	}
 
 
@@ -94,11 +94,11 @@
 	TParsePtrC path(aSessionPath);
 	test(path.DrivePresent()==EFalse);
 	TInt r=TheFs.SetSessionPath(aSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.MkDirAll(gSessionPath);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	}
 
 TInt CurrentDrive(TChar aDriveChar)
@@ -108,7 +108,7 @@
 	{
 	TInt driveNum;
 	TInt r = TheFs.CharToDrive(aDriveChar,driveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	gDriveToTest = gSessionPath[0] = (TText)aDriveChar;
 	return(driveNum);
 	}
@@ -120,7 +120,7 @@
 	{
 	TInt driveNum;
 	TInt r = TheFs.CharToDrive(gSessionPath[0],driveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	return(driveNum);
 	}
 
@@ -131,20 +131,20 @@
 	{
 	RFile file;
 	TInt r=file.Replace(TheFs,aFileName,0);
-	test_Value(r, r == KErrNone || r==KErrPathNotFound);
+	test(r==KErrNone || r==KErrPathNotFound);
 	if (r==KErrPathNotFound)
 		{
 		r=TheFs.MkDirAll(aFileName);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file.Replace(TheFs,aFileName,0);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	TCheckedUid checkedUid(aUidType);
 	TPtrC8 uidData((TUint8*)&checkedUid,sizeof(TCheckedUid));
 	r=file.Write(uidData);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(aFileContents);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	}
 
@@ -160,16 +160,16 @@
 		test.Printf(_L("ERROR: r=%d"),r);
 		test(EFalse);
 		}
-	test_Value(r, r == KErrNone || r==KErrPathNotFound);
+	test(r==KErrNone || r==KErrPathNotFound);
 	if (r==KErrPathNotFound)
 		{
 		r=TheFs.MkDirAll(aFileName);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file.Replace(TheFs,aFileName,0);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	r=file.Write(aFileContents);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	}
 
@@ -180,17 +180,17 @@
 	{
 	RFile file;
 	TInt r=file.Replace(TheFs,aFileName,0);
-	test_Value(r, r == KErrNone || r==KErrPathNotFound);
+	test(r==KErrNone || r==KErrPathNotFound);
 	if (r==KErrPathNotFound)
 		{
 		r=TheFs.MkDirAll(aFileName);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file.Replace(TheFs,aFileName,0);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	file.Close();
 	r=TheFs.SetAtt(aFileName,anAttributes,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 void MakeFile(const TDesC& aFileName)
@@ -210,7 +210,7 @@
 void ReadBootSector(TFatBootSector& aBootSector)
 	{
     TInt r = ReadBootSector(TheFs, CurrentDrive(), KBootSectorNum<<KDefaultSectorLog2, aBootSector);
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     if(!aBootSector.IsValid())
         {
@@ -558,9 +558,9 @@
 	TFileName filename_dir = aDirName;
 	TInt r = 0;
 	r = TheFs.SetAtt(filename_dir, 0, KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=gFileMan->RmDir(filename_dir);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrPathNotFound || r==KErrInUse);
+	test(r==KErrNone || r==KErrNotFound || r==KErrPathNotFound || r==KErrInUse);
 	}
 
 // Cleanup test variables
@@ -788,7 +788,7 @@
 	logFileName.Append(KExtension);
 
 	TInt r = file.Create(TheFs, logFileName, EFileRead|EFileWrite);
-	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+	test(r == KErrNone || r == KErrAlreadyExists);
 
 	if (r == KErrNone)
 		{
@@ -799,10 +799,10 @@
 	if (r == KErrAlreadyExists)
 		{
 		r = file.Open(TheFs, logFileName, EFileRead|EFileWrite);
-		test_KErrNone(r);
+		test(r == KErrNone);
 		TInt start = 0;
 		r=file.Seek(ESeekEnd,start);
-		test_KErrNone(r);
+		test(r == KErrNone);
 		}
 	
 	tempBuf.SetLength(0);
--- a/kerneltest/f32test/server/t_fatcharsetconv_aux.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_fatcharsetconv_aux.h	Wed Sep 01 12:34:56 2010 +0100
@@ -17,7 +17,7 @@
 
 #ifndef T_FATCHARSETCONV_AUX_H
 #define T_FATCHARSETCONV_AUX_H
-#define __E32TEST_EXTENSION__
+
 #include <f32file.h>
 #include <e32test.h>
 #include <hal.h>
--- a/kerneltest/f32test/server/t_fatcharsetconv_main.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_fatcharsetconv_main.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1188,11 +1188,11 @@
 	{
 	// Enables codepage dll implementation of LocaleUtils functions for this test only
 	TInt r = TheFs.ControlIo(CurrentDrive(), KControlIoEnableFatUtilityFunctions);
-	test_KErrNone(r);
+	test(r == KErrNone);
 		
 	test.Printf(_L("Load the Code Page DLL"));
 	r = UserSvr::ChangeLocale(KTestLocale);
-	test_KErrNone(r);
+	test(r == KErrNone);
 			
 	test.Next(_L("Test Unitary APIs with only Sync Variant with DLL"));
 	gLogFailureData.iFuncName = KDoAllBasicUnitaryTestsL;
@@ -1204,7 +1204,7 @@
 	
 	// Disables codepage dll implementation of LocaleUtils functions for other base tests
 	r = TheFs.ControlIo(CurrentDrive(), KControlIoDisableFatUtilityFunctions);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}
 	
 void TestMainWithoutDLLL(TTestSwitches& aSwitches)
@@ -1213,7 +1213,7 @@
 
 	// Disables codepage dll implementation of LocaleUtils functions
 	TInt r = TheFs.ControlIo(CurrentDrive(), KControlIoDisableFatUtilityFunctions);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	gLogFailureData.iFuncName = KDoAllBasicUnitaryTestsL;
 	DoAllBasicUnitaryTestsL(gBasicUnitaryTestCases, aSwitches, EFalse);
@@ -1410,10 +1410,10 @@
 	gSessionPath=_L("?:\\F32-TST\\");
 	TChar driveLetter;
 	TInt r=TheFs.DriveToChar(aDrive,driveLetter);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	gSessionPath[0]=(TText)driveLetter;
 	r=TheFs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("gSessionPath = \"%S\"\n"), &gSessionPath);
 
 // !!! Disable platform security tests until we get the new APIs
@@ -1429,7 +1429,7 @@
 		{
 		Format(aDrive);
 		r=TheFs.MkDirAll(gSessionPath);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	if (r!=KErrNone && r!=KErrAlreadyExists)
 		{
@@ -1469,7 +1469,7 @@
 	ParseCommandArguments(testSwitches);
 
 	r=TheFs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TheFs.SetAllocFailure(gAllocFailOn);
 
 	TTime timerC;
@@ -1477,13 +1477,13 @@
 
 	TInt theDrive;
 	r=TheFs.CharToDrive(gDriveToTest,theDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
 	TPckgBuf<TIOCacheValues> pkgOrgValues;
 	TIOCacheValues& orgValues=pkgOrgValues();
 	r = controlIo(TheFs,theDrive, KControlIoCacheCount, orgValues);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Printf(_L("\n"));
 	test.Printf(_L("Requests on close queue at start=%d\n"),orgValues.iCloseCount);
@@ -1498,7 +1498,7 @@
 	endTimeC.HomeTime();
 	TTimeIntervalSeconds timeTakenC;
 	r=endTimeC.SecondsFrom(timerC,timeTakenC);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Printf(_L("Time taken for test = %d seconds\n"),timeTakenC.Int());
 	TheFs.SetAllocFailure(gAllocFailOff);
@@ -1507,7 +1507,7 @@
 	TPckgBuf<TIOCacheValues> pkgValues;
 	TIOCacheValues& values=pkgValues();
 	r = controlIo(TheFs,theDrive, KControlIoCacheCount, values);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	test.Printf(_L("Requests on close queue at end=%d\n"),values.iCloseCount);
 	test.Printf(_L("Requests on free queue at end=%d\n"),values.iFreeCount);
--- a/kerneltest/f32test/server/t_file.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_file.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -50,10 +50,10 @@
 
 	RFile f1;
 	TInt r=f1.Open(TheFs,_L("TESTER"),EFileRead|EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RFile f2;
 	r=f2.Open(TheFs,_L("TESTER"),EFileWrite|EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=f2.Write(_L("0"));
 	test.Printf(_L("returned %d"),r);
@@ -62,49 +62,49 @@
 	f2.Close();
 
 	r=TheFs.Delete(_L("TESTER"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 */
 
 	RFile f1;
 	TInt r=f1.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareExclusive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RFile f2;
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareExclusive);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOnly);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareAny);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	f1.Close();
 	r=f1.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileWrite|EFileShareExclusive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f1.Close();
 
 	test.Next(_L("Test readers only sharing"));
 	r=f1.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileWrite|EFileShareReadersOnly);
-	test_Value(r, r == KErrArgument);
+	test(r==KErrArgument);
 	r=f1.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareExclusive);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareAny);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileWrite|EFileShareReadersOnly);
-	test_Value(r, r == KErrArgument);
+	test(r==KErrArgument);
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f1.Close();
 	f2.Close();
 
 	test.Next(_L("Test any sharing"));
 	r=f1.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileWrite|EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareExclusive);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOnly);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f1.Close();
 	f2.Close();
 
@@ -121,63 +121,63 @@
 	RFile f1;
 	RFile f2;
 	TInt r=f1.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareExclusive);
-	test_KErrNone(r); // Opened exclusive
+	test(r==KErrNone); // Opened exclusive
 	r=f1.ChangeMode(EFileShareReadersOnly);
-	test_KErrNone(r); // Change to readers only
+	test(r==KErrNone); // Change to readers only
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOnly);
-	test_KErrNone(r); // Open as reader
+	test(r==KErrNone); // Open as reader
 	r=f1.ChangeMode(EFileShareExclusive);
-	test_Value(r, r == KErrAccessDenied); // Change back to exclusive fails
+	test(r==KErrAccessDenied); // Change back to exclusive fails
 	r=f2.ChangeMode(EFileShareExclusive);
-	test_Value(r, r == KErrAccessDenied); // Change to exclusive fails
+	test(r==KErrAccessDenied); // Change to exclusive fails
 	f1.Close(); // Close other reader
 	r=f2.ChangeMode(EFileShareExclusive);
-	test_KErrNone(r); // Change to exclusive succeeds.
+	test(r==KErrNone); // Change to exclusive succeeds.
 	f2.Close();
 
 	r=f1.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOnly);
-	test_KErrNone(r); // Opened readers only
+	test(r==KErrNone); // Opened readers only
 	r=f1.ChangeMode(EFileShareExclusive);
-	test_KErrNone(r); // Change to exclusive
+	test(r==KErrNone); // Change to exclusive
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOnly);
-	test_Value(r, r == KErrInUse); // Open as reader fails
+	test(r==KErrInUse); // Open as reader fails
 	r=f1.ChangeMode(EFileShareReadersOnly);
-	test_KErrNone(r); // Change to readers only
+	test(r==KErrNone); // Change to readers only
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOnly);
-	test_KErrNone(r); // Open as reader
+	test(r==KErrNone); // Open as reader
 	r=f1.ChangeMode(EFileShareExclusive);
-	test_Value(r, r == KErrAccessDenied); // Change back to exclusive fails
+	test(r==KErrAccessDenied); // Change back to exclusive fails
 	r=f2.ChangeMode(EFileShareExclusive);
-	test_Value(r, r == KErrAccessDenied); // Change to exclusive fails
+	test(r==KErrAccessDenied); // Change to exclusive fails
 	f1.Close(); // Close other reader
 	r=f2.ChangeMode(EFileShareExclusive);
-	test_KErrNone(r); // Change to exclusive succeeds.
+	test(r==KErrNone); // Change to exclusive succeeds.
 	f2.Close();
 
 	r=f1.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileWrite|EFileShareExclusive);
-	test_KErrNone(r); // Opened exclusive for writing
+	test(r==KErrNone); // Opened exclusive for writing
 	r=f1.ChangeMode(EFileShareReadersOnly);
-	test_Value(r, r == KErrAccessDenied); // Change to readers fails
+	test(r==KErrAccessDenied); // Change to readers fails
 	r=f1.ChangeMode(EFileShareExclusive);
-	test_KErrNone(r); // No change ok
+	test(r==KErrNone); // No change ok
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOnly);
-	test_Value(r, r == KErrInUse); // Open as reader fails
+	test(r==KErrInUse); // Open as reader fails
 	f1.Close();
 
 	r=f1.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareAny);
-	test_KErrNone(r); // Opened share any
+	test(r==KErrNone); // Opened share any
 	r=f1.ChangeMode(EFileShareExclusive);
-	test_Value(r, r == KErrAccessDenied); // Change to exclusive fails
+	test(r==KErrAccessDenied); // Change to exclusive fails
 	r=f1.ChangeMode(EFileShareReadersOnly);
-	test_Value(r, r == KErrAccessDenied); // Change to readers only fails
+	test(r==KErrAccessDenied); // Change to readers only fails
 	f1.Close();
 
 	r=f1.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareExclusive);
-	test_KErrNone(r); // Opened exclusive
+	test(r==KErrNone); // Opened exclusive
 	r=f1.ChangeMode(EFileShareAny);
-	test_Value(r, r == KErrArgument); // Change to share any fails KErrArgument
+	test(r==KErrArgument); // Change to share any fails KErrArgument
 	r=f1.ChangeMode((TFileMode)42);
-	test_Value(r, r == KErrArgument); // Change to random value fails
+	test(r==KErrArgument); // Change to random value fails
 	f1.Close();
 	test.End();
 	}
@@ -190,15 +190,12 @@
 
 	test.Start(_L("Test read file"));
 	RFile f,ZFile;
-	
-    TInt r=f.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText);
-	test_KErrNone(r);
-	
-    TFileName fn = _L("Z:\\TEST\\T_FILE.CPP");
+	TInt r=f.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText);
+	test(r==KErrNone);
+	TFileName fn = _L("Z:\\TEST\\T_FILE.CPP");
 	fn[0] = gExeFileName[0];
-	
-    r=ZFile.Open(TheFs,fn,EFileStreamText);
-	test_KErrNone(r);
+	r=ZFile.Open(TheFs,fn,EFileStreamText);
+	test(r==KErrNone);
 
 	// check the file on the Z: drive his read-only
 	TEntry fileAtt;
@@ -209,41 +206,36 @@
 
 	test.Next(_L("Read file"));
 	TBuf8<0x100> a,b;
-	
-    for(;;)
+	FOREVER
 		{
 		r=f.Read(b);
-		test_KErrNone(r);
-		
-        r=ZFile.Read(a);
-		test_KErrNone(r);
-		
-        test(CompareBuffers(a, b));
-		
-        if (b.Length()<b.MaxLength())
+		test(r==KErrNone);
+		r=ZFile.Read(a);
+		test(r==KErrNone);
+		test(a==b);
+		if (b.Length()<b.MaxLength())
 			break;
 		}
-
 	b.SetLength(10);
 	r=f.Read(b);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(b.Length()==0);
 	f.Close();
 	ZFile.Close();
 
 	test.Next(_L("Read way beyond the end of the file"));
 	r=f.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Read(3000000,gBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 
 	test.Next(_L("Write way beyond the end of the file"));
 	r=f.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	gBuf.SetLength(10);
 	r=f.Write(3000000,gBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 	test.End();
 	}
@@ -255,30 +247,23 @@
 	{
 
 	test.Start(_L("Test multiple read file"));
-	
-    RFile f1;
+	RFile f1;
 	TInt r=f1.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOnly);
-	test_KErrNone(r);
-	
-    RFile f2;
+	test(r==KErrNone);
+	RFile f2;
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("Read file"));
-	
-    TBuf8<0x100> b1;
-    TBuf8<0x100> b2;
-    
-    for(;;)
+	FOREVER
 		{
-        r=f1.Read(b1);
-		test_KErrNone(r);
-        
+		TBuf8<0x100> b1;
+		r=f1.Read(b1);
+		test(r==KErrNone);
+		TBuf8<0x100> b2;
 		r=f2.Read(b2);
-		test_KErrNone(r);
-		
-        test(CompareBuffers(b1, b2));
-
+		test(r==KErrNone);
+		test(b1==b2);
 		if (b1.Length()<b1.MaxLength())
 			break;
 		}
@@ -302,68 +287,68 @@
 
 	// write test 1
 	TInt r=file.Replace(TheFs,fn,EFileStreamText);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("Write file"));
 
 	r=file.Write(testData);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	file.Close();
 
 	// test write modes
 	// test writing with EFileRead
 	r=file.Open(TheFs,fn,EFileStreamText|EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("Write file"));
 	r=file.Write(testData);
-	test_Value(r, r == KErrAccessDenied);
+	test(r==KErrAccessDenied);
 	file.Close();
 
 	// test writing with EFileWrite
 	r=file.Open(TheFs,fn,EFileStreamText|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("Write file"));
 	r=file.Write(testData);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	// test writing with share mode EFileShareExclusive
 	r=file.Open(TheFs,fn,EFileStreamText|EFileWrite|EFileShareExclusive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("Write file"));
 	r=file.Write(testData);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	// test writing with share mode EFileShareReadersOnly (fails with KErrArgument)
 	r=file.Open(TheFs,fn,EFileStreamText|EFileWrite|EFileShareReadersOnly);
-	test_Value(r, r == KErrArgument);
+	test(r==KErrArgument);
 
 	// test writing with share mode EFileShareReadersOrWriters
 	r=file.Open(TheFs,fn,EFileStreamText|EFileWrite|EFileShareReadersOrWriters);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("Write file"));
 	r=file.Write(testData);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	// test writing with share mode EFileShareAny
 	r=file.Open(TheFs,fn,EFileStreamText|EFileWrite|EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("Write file"));
 	r=file.Write(testData);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	// tidy up
 	r=TheFs.Delete(fn);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.End();
 	}
@@ -379,30 +364,30 @@
 	TParse f;
 	TInt r;
 	r=TheFs.Parse(fn,f);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TParse fCopy;
 	r=TheFs.Parse(f.NameAndExt(),fCopy);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RFile f1;
 	r=f1.Open(TheFs,f.FullName(),EFileStreamText|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RFile f2;
 	r=f2.Replace(TheFs,fCopy.FullName(),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf8<512> copyBuf;
 	TInt rem;
 	r=f1.Size(rem);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt pos=0;
 	while (rem)
 		{
 		TInt s=Min(rem,copyBuf.MaxSize());
 		r=f1.Read(pos,copyBuf,s);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(copyBuf.Length()==s);
 		r=f2.Write(pos,copyBuf,s);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		pos+=s;
 		rem-=s;
 		}
@@ -426,26 +411,26 @@
 
 	RFile f;
 	TInt r=f.Replace(TheFs,_L("TEXTFILE.TXT"),0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TFileText textFile;
 	textFile.Set(f);
 	TInt i=0;
 	for (i=0;i<5;i++)
 		{
 		r=textFile.Write(record[i]);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	r=textFile.Seek(ESeekStart);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf<16> recBuf;
 	for(i=0;i<5;i++)
 		{
 		r=textFile.Read(recBuf);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(recBuf==record[i]);
 		}
 	r=textFile.Read(recBuf);
-	test_Value(r, r == KErrEof);
+	test(r==KErrEof);
 	test(recBuf.Length()==0);
 	f.Close();
 
@@ -467,36 +452,36 @@
 	trecord[5].Set((TUint8*)tTextrecord[5].Ptr(),tTextrecord[5].Length()*sizeof(TText));
 	trecord[6].Set((TUint8*)tTextrecord[6].Ptr(),tTextrecord[6].Length()*sizeof(TText));
 	r=f.Replace(TheFs,_L("TEXTFILE.TXT"),0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	for(i=0;i<7;i++)
 		{
 		TBuf8<256> buf;
 		buf.Copy(trecord[i]);
 		r=f.Write(buf);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	textFile.Set(f);
 	textFile.Seek(ESeekStart);
 	for(i=0;i<5;i++)
 		{
 		r=textFile.Read(recBuf);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(recBuf==record[i]);
 		}
 	r=textFile.Read(recBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(recBuf==_L("Sixth record"));
 	r=textFile.Read(recBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(recBuf==_L("\rSeventh record"));
 	r=textFile.Read(recBuf);
-	test_Value(r, r == KErrEof);
+	test(r==KErrEof);
 	test(recBuf.Length()==0);
 	f.Close();
 
 	test.Next(_L("Test read with bufferSize == dataSize"));
 	r=f.Replace(TheFs,_L("TEXTFILE.TXT"),0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	record[0].Set(_L("1234567890123456"));
 //	trecord[0].Set(_L8("1234567890123456\r\n"));
 //	trecord[1].Set(_L8("1234567890123456\n"));
@@ -511,37 +496,37 @@
 	for (i=0;i<2;i++)
 		{
 		r=f.Write(trecord[i]);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	textFile.Set(f);
 	textFile.Seek(ESeekStart);
 	for(i=0;i<2;i++)
 		{
 		r=textFile.Read(recBuf);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(recBuf==record[0]);
 		}
 	r=textFile.Read(recBuf);
-	test_Value(r, r == KErrEof);
+	test(r==KErrEof);
 	test(recBuf.Length()==0);
 	f.Close();
 
 	test.Next(_L("Read into a buffer < recordSize"));
 	TBuf<8> smallBuf;
 	r=f.Open(TheFs,_L("TEXTFILE.txt"),0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	textFile.Set(f);
 	for(i=0;i<2;i++)
 		{
 		r=textFile.Read(smallBuf);
-		test_Value(r, r == KErrTooBig);
+		test(r==KErrTooBig);
 		test(smallBuf==_L("12345678"));
 		}
 	f.Close();
 
 	test.Next(_L("Nasty cases: 1) \\r \\n split over buffer boundary"));
 	r=f.Replace(TheFs,_L("TEXTFILE.txt"),0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	HBufC* largeRecord=HBufC::NewL(600);
 	largeRecord->Des().SetLength(250);
 	largeRecord->Des().Fill('A');
@@ -549,96 +534,96 @@
 	TPtrC8 bufPtr;
 	bufPtr.Set((TUint8*)largeRecord->Ptr(),largeRecord->Size()); // Size() returns length in bytes
 	r=f.Write(bufPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf<16> boundaryBuf=_L("12345\r\n");
 	bufPtr.Set((TUint8*)boundaryBuf.Ptr(),boundaryBuf.Size());
 	r=f.Write(bufPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Write(trecord[0]);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	textFile.Set(f);
 	textFile.Seek(ESeekStart);
 	r=textFile.Read(recBuf);
-	test_Value(r, r == KErrTooBig);
+	test(r==KErrTooBig);
 	test(recBuf==_L("AAAAAAAAAAAAAAAA"));
 	r=textFile.Read(recBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(recBuf==_L("12345"));
 	r=textFile.Read(recBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(recBuf==record[0]);
 	f.Close();
 
 	test.Next(_L("Nasty cases: 2) \\r on buffer boundary"));
 	r=f.Replace(TheFs,_L("TEXTFILE.txt"),0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	largeRecord->Des().SetLength(250);
 	largeRecord->Des().Fill('A');
 	largeRecord->Des()[249]='\n';
 	bufPtr.Set((TUint8*)largeRecord->Ptr(),largeRecord->Size());
 	r=f.Write(bufPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	boundaryBuf=_L("12345\rxyz\n");
 	bufPtr.Set((TUint8*)boundaryBuf.Ptr(),boundaryBuf.Size());
 	r=f.Write(bufPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Write(trecord[0]);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	textFile.Set(f);
 	textFile.Seek(ESeekStart);
 	r=textFile.Read(recBuf);
-	test_Value(r, r == KErrTooBig);
+	test(r==KErrTooBig);
 	test(recBuf==_L("AAAAAAAAAAAAAAAA"));
 	r=textFile.Read(recBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(recBuf==_L("12345\rxyz"));
 	r=textFile.Read(recBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(recBuf==record[0]);
 	f.Close();
 
 	test.Next(_L("Nasty cases: 3) record size > buffer size"));
 	r=f.Replace(TheFs,_L("TEXTFILE.txt"),0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	largeRecord->Des().SetLength(600);
 	largeRecord->Des().Fill('Z');
 	largeRecord->Des()[511]='\r';
 	largeRecord->Des()[599]='\n';
 	bufPtr.Set((TUint8*)largeRecord->Ptr(),largeRecord->Size());
 	r=f.Write(bufPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	boundaryBuf=_L("12345\rxyz\n");
 	bufPtr.Set((TUint8*)boundaryBuf.Ptr(),boundaryBuf.Size());
 	r=f.Write(bufPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Write(trecord[0]);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	textFile.Set(f);
 	textFile.Seek(ESeekStart);
 	r=textFile.Read(recBuf);
-	test_Value(r, r == KErrTooBig);
+	test(r==KErrTooBig);
 	test(recBuf==_L("ZZZZZZZZZZZZZZZZ"));
 	r=textFile.Read(recBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(recBuf==_L("12345\rxyz"));
 	r=textFile.Read(recBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(recBuf==record[0]);
 
 	TBuf<601> bigBuf;
 	TPtrC largePtr((TText*)largeRecord->Ptr(),(largeRecord->Length()-1));
 	textFile.Seek(ESeekStart);
 	r=textFile.Read(bigBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(bigBuf==largePtr);
 	r=textFile.Read(recBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(recBuf==_L("12345\rxyz"));
 	r=textFile.Read(recBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(recBuf==record[0]);
 	f.Close();
 
@@ -654,60 +639,60 @@
 	test.Next(_L("Test FileText last record has no terminator"));
 	RFile f;
 	TInt r=f.Replace(TheFs,_L("TextFile"),0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TPtrC8 bufPtr;
 	TBuf<16>boundaryBuf=_L("Record1\n");
 	bufPtr.Set((TUint8*)boundaryBuf.Ptr(),boundaryBuf.Size());
 	r=f.Write(bufPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	boundaryBuf=_L("Record2\n");
 	bufPtr.Set((TUint8*)boundaryBuf.Ptr(),boundaryBuf.Size());
 	r=f.Write(bufPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	boundaryBuf=_L("Record3\n");
 	bufPtr.Set((TUint8*)boundaryBuf.Ptr(),boundaryBuf.Size());
 	r=f.Write(bufPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TFileText fText;
 	fText.Set(f);
 	r=fText.Seek(ESeekStart);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf<32> recBuf;
 	r=fText.Read(recBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(recBuf.MatchF(_L("record1"))!=KErrNotFound);
 	r=fText.Read(recBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(recBuf.MatchF(_L("record2"))!=KErrNotFound);
 	r=fText.Read(recBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(recBuf.MatchF(_L("record3"))!=KErrNotFound);
 	r=fText.Read(recBuf);
-	test_Value(r, r == KErrEof);
+	test(r==KErrEof);
 	test(recBuf.Length()==0);
 	f.Close();
 
 	TBuf<0x100> bigBuf(0x100);
 	bigBuf.Fill('A');
 	r=f.Replace(TheFs,_L("TextFile"),0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
     bufPtr.Set((TUint8*)bigBuf.Ptr(),bigBuf.Size());
 	r=f.Write(bufPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	fText.Set(f);
 	r=fText.Seek(ESeekStart);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	bigBuf.SetLength(0);
 	r=fText.Read(bigBuf);
 	test.Printf(_L("fText.Read returns %d\n"),r);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("BigBuf.Length()==%d\n"),bigBuf.Length());
 	test(bigBuf.Length()==0x100);
 	r=fText.Read(bigBuf);
-	test_Value(r, r == KErrEof);
+	test(r==KErrEof);
 	test(bigBuf.Length()==0);
 	f.Close();
 	}
@@ -722,7 +707,7 @@
 	TFileName tempFileName;
 	RFile f;
 	TInt r=f.Temp(TheFs,_L(""),tempFileName,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TParse p;
 	p.Set(tempFileName,NULL,NULL);
 	test(p.DrivePresent());
@@ -732,10 +717,10 @@
 	f.Close();
 
 	r=f.Replace(TheFs,_L("WELCOMETO"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 	r=f.Replace(TheFs,_L("WELCOMETO.WRD"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 	}
 
@@ -754,189 +739,189 @@
 	test.Next(_L("Archive att is set after creation"));
 	RFile f;
 	TInt r=TheFs.Delete(_L("FILEATT.ARC"));
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 	r=f.Create(TheFs,_L("FILEATT.ARC"),EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TUint atts;
 	r=f.Att(atts);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test((atts&ATT_MASK)==KEntryAttArchive);
 	TEntry fileAtt;
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==KEntryAttArchive);
 	f.Close();
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==KEntryAttArchive);
 
 	test.Next(_L("Archive att is set after a write"));
 	TheFs.SetAtt(_L("FILEATT.ARC"),0,KEntryAttArchive);
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==0);
 	r=f.Open(TheFs,_L("FILEATT.ARC"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Write(_L8("Hello World"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Att(atts);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test((atts&ATT_MASK)==KEntryAttArchive);
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==KEntryAttArchive);
 	f.Close();
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==KEntryAttArchive);
 
 	test.Next(_L("Archive att is set after setsize"));
 	TheFs.SetAtt(_L("FILEATT.ARC"),0,KEntryAttArchive);
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==0);
 	r=f.Open(TheFs,_L("FILEATT.ARC"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.SetSize(447);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt size;
 	r=f.Size(size);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(size==447);
 	r=f.Att(atts);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test((atts&ATT_MASK)==KEntryAttArchive);
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==KEntryAttArchive);
 	f.Close();
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==KEntryAttArchive);
 
 	test.Next(_L("Archive att is not set after open"));
 	r=TheFs.SetAtt(_L("FILEATT.ARC"),0,KEntryAttArchive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Open(TheFs,_L("FILEATT.ARC"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Att(atts);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test((atts&ATT_MASK)==0);
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==0);
 	f.Close();
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==0);
 
 	test.Next(_L("Archive att is not set after a read"));
 	TheFs.SetAtt(_L("FILEATT.ARC"),0,KEntryAttArchive);
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==0);
 	r=f.Open(TheFs,_L("FILEATT.ARC"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf8<16> readBuf;
 	r=f.Read(readBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Att(atts);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test((atts&ATT_MASK)==0);
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==0);
 	f.Close();
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==0);
 
 	test.Next(_L("Archive att is set after replace"));
 	r=f.Replace(TheFs,_L("FILEATT.ARC"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Att(atts);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test((atts&ATT_MASK)==KEntryAttArchive);
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==KEntryAttArchive);
 	f.Close();
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==KEntryAttArchive);
 
 	test.Next(_L("Read only bit can be unset"));
 	r=TheFs.SetAtt(_L("FILEATT.ARC"),KEntryAttReadOnly|KEntryAttHidden,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==(KEntryAttReadOnly|KEntryAttHidden|KEntryAttArchive));
 
 	r=TheFs.SetAtt(_L("FILEATT.ARC"),0,KEntryAttHidden);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==(KEntryAttReadOnly|KEntryAttArchive));
 
 	r=TheFs.SetAtt(_L("FILEATT.ARC"),0,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==(KEntryAttArchive));
 
 	r=TheFs.SetAtt(_L("FILEATT.ARC"),KEntryAttReadOnly|KEntryAttHidden,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==(KEntryAttReadOnly|KEntryAttHidden|KEntryAttArchive));
 
 	r=TheFs.SetAtt(_L("FILEATT.ARC"),0,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==(KEntryAttHidden|KEntryAttArchive));
 
 	r=TheFs.SetAtt(_L("FILEATT.ARC"),0,KEntryAttHidden);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==(KEntryAttArchive));
 
 	TTime time(0);
 	r=TheFs.SetEntry(_L("FILEATT.ARC"),time,KEntryAttReadOnly|KEntryAttHidden,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==(KEntryAttReadOnly|KEntryAttHidden|KEntryAttArchive));
 
 	r=TheFs.SetEntry(_L("FILEATT.ARC"),time,0,KEntryAttHidden);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==(KEntryAttReadOnly|KEntryAttArchive));
 
 	r=TheFs.SetEntry(_L("FILEATT.ARC"),time,0,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==(KEntryAttArchive));
 
 	r=TheFs.SetEntry(_L("FILEATT.ARC"),time,KEntryAttReadOnly|KEntryAttHidden,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==(KEntryAttReadOnly|KEntryAttHidden|KEntryAttArchive));
 
 	r=TheFs.SetEntry(_L("FILEATT.ARC"),time,0,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==(KEntryAttHidden|KEntryAttArchive));
 
 	r=TheFs.SetEntry(_L("FILEATT.ARC"),time,0,KEntryAttHidden);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("FILEATT.ARC"),fileAtt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fileAtt.iAtt==(KEntryAttArchive));
 
 	test.Next(_L("Cashing the 'read-only' attribute"));
@@ -944,35 +929,35 @@
 
 	// Test RO attribute after creating a file
 	r=f.Create(TheFs,fname,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.SetAtt(KEntryAttReadOnly,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Write(_L8("Hello World"));
-	test_KErrNone(r);					// <-- here!
+	test(r==KErrNone);					// <-- here!
 	f.Close();
 
 	// Test we can't open for write or delete a RO file
 	r=f.Open(TheFs,fname,EFileWrite);
-	test_Value(r, r == KErrAccessDenied);
+	test(r==KErrAccessDenied);
 	r=TheFs.Delete(fname);
-	test_Value(r, r == KErrAccessDenied);
+	test(r==KErrAccessDenied);
 
 	// Tidy up and re-create test file
 	r=TheFs.SetAtt(fname,0,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(fname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Create(TheFs,fname,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 
 	// Test RO attribute after opening a file
 	r=f.Open(TheFs,fname,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.SetAtt(KEntryAttReadOnly,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Write(_L8("Hello World"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 
 
@@ -1015,9 +1000,9 @@
 
 	// Tidy up
 	r=TheFs.SetAtt(fname,0,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(fname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 static void testShortNameAccessorFunctions()
@@ -1036,21 +1021,21 @@
 
 	TBuf<64> sessionPath;
 	TInt r=TheFs.SessionPath(sessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RFile f;
 	r=TheFs.MkDirAll(_L("\\F32-TST\\TFILE\\TOPLEVEL\\MIDDLE-DIRECTORY\\LASTDIR\\RANDOM.ENDBIT"));
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	r=f.Replace(TheFs,_L("LONGFILENAME.LONGEXT"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 	r=f.Replace(TheFs,_L("\\F32-TST\\TFILE\\TOPLEVEL\\MIDDLE-DIRECTORY\\LASTDIR\\LONGFILENAME.LONGEXT"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 	r=f.Replace(TheFs,_L("\\F32-TST\\TFILE\\TOPLEVEL\\MIDDLE-DIRECTORY\\LASTDIR\\BAD CHAR"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 	r=f.Replace(TheFs,_L("\\F32-TST\\TFILE\\TOPLEVEL\\MIDDLE-DIRECTORY\\LASTDIR\\GoodCHAR.TXT"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 	TBuf<12> shortName1;
 	TBuf<12> shortName2;
@@ -1058,15 +1043,15 @@
 	TBuf<12> shortName4;
 	TBuf<12> shortName5;
 	r=TheFs.GetShortName(_L("LONGFILENAME.LONGEXT"),shortName1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.GetShortName(_L("\\F32-TST\\TFILE\\TOPLEVEL\\MIDDLE-DIRECTORY\\LASTDIR\\LONGFILENAME.LONGEXT"),shortName2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.GetShortName(_L("\\F32-TST\\TFILE\\TOPLEVEL\\MIDDLE-DIRECTORY\\LASTDIR\\BAD CHAR"),shortName3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.GetShortName(_L("\\F32-TST\\TFILE\\TOPLEVEL\\MIDDLE-DIRECTORY\\LASTDIR\\GOODCHAR.TXT"),shortName4);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.GetShortName(_L("\\F32-TST\\TFILE\\TOPLEVEL\\MIDDLE-DIRECTORY"),shortName5);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	if(Is_Win32(TheFs, gDriveNum))
 		{
@@ -1095,48 +1080,48 @@
 	if (Is_Win32(TheFs, gDriveNum))
 		{
 		r=TheFs.GetLongName(_L("LONGFI~1.LON"),longName1);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.GetLongName(_L("\\F32-TST\\TFILE\\TOPLEVEL\\MIDDLE-DIRECTORY\\LASTDIR\\LONGFI~1.LON"),longName2);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.GetLongName(_L("\\F32-TST\\TFILE\\TOPLEVEL\\MIDDLE-DIRECTORY\\LASTDIR\\BADCHA~1"),longName3);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.GetLongName(_L("\\F32-TST\\TFILE\\TOPLEVEL\\MIDDLE-DIRECTORY\\LASTDIR\\GOODCHAR.TXT"),longName4);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.GetLongName(_L("\\F32-TST\\TFILE\\TOPLEVEL\\MIDDLE~1"),longName5);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	else if (!IsTestingLFFS())
 		{
 		r=TheFs.GetLongName(_L("LONGFI~1.LON"),longName1);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.GetLongName(_L("\\F32-TST\\TFILE\\TOPLEVEL\\MIDDLE-DIRECTORY\\LASTDIR\\LONGFI~1.LON"),longName2);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.GetLongName(_L("\\F32-TST\\TFILE\\TOPLEVEL\\MIDDLE-DIRECTORY\\LASTDIR\\BAD_CHAR"),longName3);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.GetLongName(_L("\\F32-TST\\TFILE\\TOPLEVEL\\MIDDLE-DIRECTORY\\LASTDIR\\GOODCHAR.TXT"),longName4);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.GetLongName(_L("\\F32-TST\\TFILE\\TOPLEVEL\\MIDDLE~1"),longName5);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
     else
     	{
 		// LFFS longname tests
         r=TheFs.GetLongName(shortName1,longName1);
-        test_KErrNone(r);
+        test(r==KErrNone);
         r=TheFs.SetSessionPath(_L("\\F32-TST\\TFILE\\TOPLEVEL\\MIDDLE-DIRECTORY\\LASTDIR\\"));
-        test_KErrNone(r);
+        test(r==KErrNone);
         r=TheFs.GetLongName(shortName2,longName2);
-        test_KErrNone(r);
+        test(r==KErrNone);
         r=TheFs.GetLongName(shortName3,longName3);
-        test_KErrNone(r);
+        test(r==KErrNone);
         r=TheFs.GetLongName(shortName4,longName4);
-        test_KErrNone(r);
+        test(r==KErrNone);
         r=TheFs.SetSessionPath(_L("\\F32-TST\\TFILE\\TOPLEVEL\\"));
-        test_KErrNone(r);
+        test(r==KErrNone);
         r=TheFs.GetLongName(shortName5,longName5);
-        test_KErrNone(r);
+        test(r==KErrNone);
         r=TheFs.SetSessionPath(sessionPath);
-        test_KErrNone(r);
+        test(r==KErrNone);
     	}
 
 	test(longName1==_L("LONGFILENAME.LONGEXT"));
@@ -1146,16 +1131,16 @@
 	test(longName5==_L("MIDDLE-DIRECTORY"));
 
 	r=TheFs.GetShortName(_L("XXX.YYY"),shortName1);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=TheFs.GetShortName(_L("\\F32-TST\\TFILE\\TOPLEVEL\\MIDDLE-YROTCERID\\LASTDIR\\BAD-CHAR"),shortName1);
-	test_Value(r, r == KErrPathNotFound);
+	test(r==KErrPathNotFound);
 	r=TheFs.GetLongName(_L("XXX.YYY"),longName1);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=TheFs.GetLongName(_L("\\F32-TST\\TFILE\\TOPLEVEL\\MIDDLE-YROTCERID\\LASTDIR\\BAD-CHAR"),longName1);
-	test_Value(r, r == KErrPathNotFound);
+	test(r==KErrPathNotFound);
 
 	r=TheFs.Delete(_L("LONGFILENAME.LONGEXT"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TEntry romEntry;
 	r=TheFs.Entry(_L("Z:\\System"),romEntry);
@@ -1165,13 +1150,13 @@
 		//test.Getch();
 		//return;
 		}
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf<64> romFileName=_L("Z:\\");
 	romFileName.Append(romEntry.iName);
 	r=TheFs.GetShortName(romFileName,shortName1);
-	test_Value(r, r == KErrNotSupported);
+	test(r==KErrNotSupported);
 	r=TheFs.GetLongName(_L("Z:\\system"),longName1);
-	test_Value(r, r == KErrNotSupported);
+	test(r==KErrNotSupported);
 	}
 
 static void RmDir(const TDesC& aDirName)
@@ -1182,7 +1167,7 @@
 	CFileMan* fMan=CFileMan::NewL(TheFs);
 	test(fMan!=NULL);
 	TInt r=TheFs.SessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.CheckDisk(gSessionPath);
 	if (r!=KErrNone && r!=KErrNotSupported)
 		ReportCheckDiskFailure(r);
@@ -1192,7 +1177,7 @@
 
 	fMan->Attribs(removeDirName, 0, KEntryAttReadOnly, 0, CFileMan::ERecurse);
 	r=fMan->RmDir(removeDirName);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrPathNotFound);
+	test(r==KErrNone || r==KErrNotFound || r==KErrPathNotFound);
 
 	delete fMan;
 	}
@@ -1233,10 +1218,14 @@
 	// Check the generated shortname of the original file
 	TBuf<12> shortName;
 	err = TheFs.GetShortName(KOrigFileName, shortName);
-	test_KErrNone(err);
-
-	// Validate the generated shortname against the original filename.
-	if(!IsTestingLFFS())
+	test(err==KErrNone);
+
+	// Validate the generated shorname against the original filename.
+	if (Is_Win32(TheFs, gDriveNum))
+		{
+		test(shortName==_L("2222~1.JAR"));
+		}
+	else if(!IsTestingLFFS())
 		{
 		// LFFS short names not the same as VFAT ones
 		test(shortName==_L("2222~1.JAR"));
@@ -1247,7 +1236,7 @@
 	CheckFileExists(KOrigFileShortName, KErrNone, EFalse);
 
 	err = TheFs.Rename(KOrigFileName,KDestinationFileName);
-	test_KErrNone(err);
+	test(err==KErrNone);
 
 	// Clean up before leaving
 	RmDir(_L("INC112803\\"));
@@ -1262,43 +1251,43 @@
 	test.Next(_L("Test IsFileOpen"));
 	TBool answer;
 	TInt r=TheFs.IsFileOpen(_L("OPEN.FILE"),answer);
-	test_Value(r, r == KErrNotFound || (r==KErrNone && answer==EFalse));
+	test(r==KErrNotFound || (r==KErrNone && answer==EFalse));
 	RFile f;
 	r=f.Replace(TheFs,_L("OPEN.FILE"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.IsFileOpen(_L("OPEN.FILE"),answer);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(answer!=EFalse);
 	f.Close();
 	r=TheFs.IsFileOpen(_L("OPEN.FILE"),answer);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(answer==EFalse);
 	r=TheFs.Delete(_L("OPEN.FILE"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RFile f2;
 	r=f2.Replace(TheFs,_L("AnotherOpen.File"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.IsFileOpen(_L("AnotherOpen.File"),answer);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(answer!=EFalse);
 	r=f.Replace(TheFs,_L("OPEN.FILE"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.IsFileOpen(_L("OPEN.FILE"),answer);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(answer!=EFalse);
 	f2.Close();
 	r=TheFs.IsFileOpen(_L("OPEN.FILE"),answer);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(answer!=EFalse);
 	f.Close();
 	r=TheFs.IsFileOpen(_L("OPEN.FILE"),answer);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(answer==EFalse);
 	r=TheFs.Delete(_L("AnotherOpen.File"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("OPEN.FILE"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 static void testDeleteOpenFiles()
@@ -1311,99 +1300,99 @@
 	RFile f;
 	f.Close();
 	TInt r=f.Replace(TheFs,_L("Open.File"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("OPEN.FILE"));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	f.Close();
 	f.Close();
 	f.Close();
 	r=TheFs.Delete(_L("Open.FILe"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TFileName fileName;
 	r=f.Temp(TheFs,_L(""),fileName,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(fileName);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	f.Close();
 	r=TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	MakeFile(_L("\\Documents\\TEstfile.txt"));
 	r=f.Open(TheFs,_L("\\Documents\\TEstfile.txt"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("\\Documents\\TEstfile.txt"));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=TheFs.Delete(_L("\\documents\\TEstfile.txt"));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=TheFs.Delete(_L("\\Documents.\\TEstfile.txt"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.Delete(_L("\\documents.\\TEstfile.txt"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.Delete(_L("\\Documents\\Testfile.txt"));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=TheFs.Delete(_L("\\documents\\testfile.txt"));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=TheFs.Delete(_L("\\Documents.\\TEstfile.TXT"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.Delete(_L("\\docUMENTS.\\TESTFILE.TXT"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	f.Close();
 	r=TheFs.Delete(_L("\\Documents\\TEstfile.TXT"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	MakeFile(_L("\\Documents\\Documents\\TEstfile.txt"));
 	r=f.Open(TheFs,_L("\\Documents\\Documents\\TEstfile.txt"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("\\Documents\\documents.\\TEstfile.txt"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.Delete(_L("\\documents\\Documents.\\TEstfile.txt"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.Delete(_L("\\Documents.\\documents\\TEstfile.txt"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.Delete(_L("\\documents.\\Documents\\TEstfile.txt"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.Delete(_L("\\Documents\\Documents\\Testfile.txt"));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=TheFs.Delete(_L("\\documents\\documents\\testfile.txt"));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=TheFs.Delete(_L("\\Documents.\\Documents.\\TEstfile.TXT"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.Delete(_L("\\docUMENTS.\\docUMENTS.\\TESTFILE.TXT"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 
 
 	r=TheFs.RmDir(_L("\\Documents\\"));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=TheFs.RmDir(_L("\\documents\\"));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=TheFs.RmDir(_L("\\Documents.\\"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.RmDir(_L("\\documents.\\"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.RmDir(_L("\\Documents\\documents\\"));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=TheFs.RmDir(_L("\\documents\\documents.\\"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.RmDir(_L("\\Documents.\\Documents\\"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.RmDir(_L("\\documents.\\Documents.\\"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.RmDir(_L("\\Documents\\TestFile.TXT"));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=TheFs.RmDir(_L("\\documents\\TestFile"));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=TheFs.RmDir(_L("\\Documents.\\Testfile."));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.RmDir(_L("\\documents.\\t"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	f.Close();
 	r=TheFs.Delete(_L("\\Documents\\documents\\TEstfile.TXT"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(_L("\\Documents\\documents.\\"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.RmDir(_L("\\Documents.\\"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	}
 
 static void testFileSeek()
@@ -1414,7 +1403,7 @@
 	test.Next(_L("Test file seek"));
 	RFile f;
 	TInt r=f.Open(TheFs,_L("T_File.cpp"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TBuf8<20> text1;TInt pos1=0;
 	TBuf8<20> text2;TInt pos2=510;
@@ -1423,67 +1412,67 @@
 	TBuf8<20> text5;TInt pos5=4999;
 
 	r=f.Read(pos1,text1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Read(pos2,text2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Read(pos3,text3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Read(pos4,text4);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Read(pos5,text5);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TBuf8<20> testBuf;
 
 	r=f.Read(pos3,testBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(testBuf==text3);
 
 	r=f.Read(pos1,testBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(testBuf==text1);
 
 	r=f.Read(pos4,testBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(testBuf==text4);
 
 	r=f.Read(pos2,testBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(testBuf==text2);
 
 	r=f.Read(pos5,testBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(testBuf==text5);
 
 	r=f.Read(pos2,testBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(testBuf==text2);
 	r=f.SetSize(1023);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Read(pos2,testBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(testBuf==text2);
 	r=f.SetSize(1024);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Read(pos1,testBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(testBuf==text1);
 	r=f.Read(pos2,testBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(testBuf==text2);
 
 	r=f.Read(pos1,testBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(testBuf==text1);
 	r=f.SetSize(511);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Read(pos1,testBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(testBuf==text1);
 	r=f.SetSize(512);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Read(pos1,testBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(testBuf==text1);
 	f.Close();
 	}
@@ -1496,60 +1485,60 @@
 //	Create a zero length file
 	RFile file;
 	TInt r=file.Replace(TheFs,_L("\\F32-TST\\TFILE\\seektest"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.SetSize(20);
-	test_KErrNone(r);
+	test(r==KErrNone);
 //	Seek beyond the length of the file
 	TInt seekPos;
 	seekPos = 80;								//	Pick a likely offset
     TInt err = file.Seek(ESeekEnd, seekPos);	//	and go there
-    test_KErrNone(err);
+    test(err==KErrNone);
 	test(seekPos==20);							//	Somewhat non-intuitive?
 
 	r=file.Write(_L8("A Devil's Haircut"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt newFileSize;
 	r=file.Size(newFileSize);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	seekPos = 0;
     err = file.Seek(ESeekCurrent, seekPos);		//	Find out where we ended up?
-	test_KErrNone(err);
+	test(err==KErrNone);
 	test(seekPos==37);
 
 	file.SetSize(512);
 	seekPos=513;
 	err=file.Seek(ESeekStart, seekPos);
-	test_KErrNone(err);
+	test(err==KErrNone);
 	test(seekPos==513);
 
 	err=file.Seek(ESeekEnd, seekPos);
-	test_KErrNone(err);
+	test(err==KErrNone);
 	test(seekPos==512);
 
 	seekPos=-530;
 	err=file.Seek(ESeekEnd, seekPos);
-	test_KErrNone(err);
+	test(err==KErrNone);
 	test(seekPos==0);
 
 	seekPos=-10;
 	err=file.Seek(ESeekEnd, seekPos);
-	test_KErrNone(err);
+	test(err==KErrNone);
 	test(seekPos==502);
 
 	seekPos=-10;
 	err=file.Seek(ESeekStart,seekPos);
-	test_Value(err, err == KErrArgument);
+	test(err==KErrArgument);
 	test(seekPos==-10);
 
 	seekPos=0;
 	err=file.Seek(ESeekEnd,seekPos);
-	test_KErrNone(err);
+	test(err==KErrNone);
 	test(seekPos==512);
 
 	file.Close();
 	r=TheFs.Delete(_L("\\F32-TST\\TFILE\\seektest"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 static void testSetSize()
@@ -1562,18 +1551,18 @@
 	RFile f1;
 	TInt i=0;
 	TInt r=f1.Replace(TheFs,_L("File.File"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	gBuf.SetLength(32);
 	for(i=0;i<32;i++)
 		gBuf[i]=(TUint8)i;
 	r=f1.Write(gBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	gBuf.SetLength(1334);
 	for(i=64;i<1334+64;i++)
 		gBuf[i-64]=(TUint8)i;
 	r=f1.Write(30,gBuf);
 	r=f1.Read(30,gBuf,1000);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(gBuf[0]==64);
 	test(gBuf[1]==65);
 	test(gBuf[2]==66);
@@ -1581,23 +1570,23 @@
 
 	test.Next(_L("Open a large file"));
 	r=f1.Replace(TheFs,_L("File.File"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckDisk();
 	r=f1.SetSize(131072); // 128K
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf8<16> testData=_L8("testData");
 	r=f1.Write(131060,testData);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f1.Close();
 	r=f1.Open(TheFs,_L("File.File"),EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt size;
 	r=f1.Size(size);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(size==131072);
 	TBuf8<16> testData2;
 	r=f1.Read(131060,testData2,8);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(testData==testData2);
 	f1.Close();
 	TheFs.Delete(_L("File.file"));
@@ -1608,10 +1597,10 @@
 	{
 	RFile f;
 	TInt r=f.Open(TheFs, PlatSec::ConfigSetting(PlatSec::EPlatSecEnforceSysBin)?_L("Z:\\Sys\\Bin\\eshell.exe"):_L("Z:\\System\\Bin\\eshell.exe"), EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt anAddress=0;
 	r=f.Seek(ESeekAddress, anAddress);
-	test_KErrNone(r);
+	test(r==KErrNone);
 #if !defined(__WINS__)
 	test(RFs::IsRomAddress((TAny *)anAddress)); // Always returns EFalse if WINS
 #endif
@@ -1632,25 +1621,25 @@
 	RFile f1;
 	TInt temp;
 	TInt r=f1.Replace(TheFs,_L("File.File"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f1.Size(temp);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(temp==0);
 	TUint data=0;
 	TPtrC8 buf((TText8*)&data,1);
 	r=f1.Write(buf);
 //	r=f1.Write(_L("\0"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f1.Size(temp);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(temp==1);
 	temp=0;
 	r=f1.Seek(ESeekStart,temp);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(temp==0);
 	TBuf8<32> testBuf;
 	r=f1.Read(testBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(testBuf==buf);
 	f1.Close();
 
@@ -1663,15 +1652,15 @@
 
 	RHackFile f2;
 	f2.Open(TheFs, _L("File.File"), EFileRead);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = f2.SendReceive(/*47*/ EFsFileChangeMode, TIpcArgs(EFileRead | EFileWrite));	// <- must fail!
-	test_Value(r, r == KErrArgument);
+	test(r == KErrArgument);
 	r = f2.Write(_L8("Hacked!"));	// <- must fail!
-	test_Value(r, r == KErrAccessDenied);
+	test(r == KErrAccessDenied);
 	f2.Close();
 
 	r=TheFs.Delete(_L("File.FIle"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 static void testFileRename()
@@ -1691,46 +1680,46 @@
 
     //-- test renaming a file to a non-existing directory
     r = TheFs.MkDir(_L("\\temp\\"));
-    test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+    test(r==KErrNone || r==KErrAlreadyExists);
 
     r = f1.Replace(TheFs, _L("\\temp\\file1"), 0);
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     r = f1.Rename(_L("\\temp\\temp\\file1"));
-    test_Value(r, r == KErrPathNotFound);
+    test(r == KErrPathNotFound);
 
     f1.Close();
 
 
 	r=f1.Replace(TheFs,name2,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f1.Write(_L8("1234"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt len=CheckFileExists(name2,KErrNone);
 	test(len==4);
 	r=f1.Rename(name1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=f1.Read(0,contents);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(contents==_L8("1234"));
 	r=f1.Write(4,_L8("5678"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	len=CheckFileExists(name1,KErrNone);
 	test(len==8);
 	CheckFileExists(name2,KErrNotFound);
 	r=f1.Write(8,_L8("90"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f1.Close();
 	len=CheckFileExists(name1,KErrNone);
 	test(len==10);
 
 	test.Next(_L("Test can change case using rename"));
 	r=f1.Open(TheFs,name1,EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f1.Rename(name3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckFileExists(name1,KErrNone,EFalse);
 	len=CheckFileExists(name3,KErrNone);
 	test(len==10);
@@ -1741,9 +1730,9 @@
 
 	test.Next(_L("Test can rename to an identical filename"));
 	r=f1.Open(TheFs,name3,EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f1.Rename(name3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	len=CheckFileExists(name3,KErrNone);
 	test(len==10);
 	f1.Close();
@@ -1752,20 +1741,20 @@
 
 	test.Next(_L("Test rename to a name containing a wildcard is rejected"));
 	r=f1.Open(TheFs,name3,EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f1.Rename(_L("asdf*ASDF"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=f1.Rename(_L("asdf?AF"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	f1.Close();
 
 	r=f1.Open(TheFs,name3,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f1.Read(contents);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(contents==_L8("1234567890"));
 	r=f1.Read(contents);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(contents.Length()==0);
 	f1.Close();
 
@@ -1773,26 +1762,26 @@
 	TDateTime dateTime(1995,(TMonth)10,19,23,0,0,0);
 	TTime oldTime(dateTime);
 	r=TheFs.SetEntry(name3,oldTime,0,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f1.Open(TheFs,name3,EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TTime check;
 	r=f1.Modified(check);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(check==oldTime);
 
 	r=f1.Rename(_L("OldFile.Old"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=f1.Modified(check);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(check==oldTime);
 	r=TheFs.Modified(_L("oldfile.old"),check);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(check==oldTime);
 	f1.Close();
 	r=TheFs.Modified(_L("oldfile.old"),check);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(check==oldTime);
 	}
 
@@ -1810,20 +1799,20 @@
 
 	TEntry e;
 	TInt r=TheFs.Entry(_L("Tmp04005.$$$"),e);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(uidData==e.iType);
 	r=TheFs.Entry(_L("Sketch(01)"),e);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(uidData1==e.iType);
 
 	test.Next(_L("Test replace preserves UIDs"));
 	r=TheFs.Replace(_L("Tmp04005.$$$"),_L("Sketch(01)"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Entry(_L("Tmp04005.$$$"),e);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=TheFs.Entry(_L("Sketch(01)"),e);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(uidData==e.iType);
 	}
 
@@ -1833,11 +1822,11 @@
 // Test max length filenames can be created/deleted
 //
 	{
-	if(Is_SimulatedSystemDrive(TheFs, gDriveNum))
-		{
-		test.Printf(_L("Skipping TestMaxLengthFilenames() on PlatSim/Emulator drive %C:\n"), gSessionPath[0]);
+
+#if defined(__WINS__)
+	if (gSessionPath[0]=='C')
 		return;
-		}
+#endif
 
 	test.Next(_L("Test max length filenames"));
 	TFileName bigName;
@@ -1845,10 +1834,10 @@
 	bigName[0]='\\';
 	RFile f;
 	TInt r=f.Create(TheFs,bigName,EFileRead);
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	bigName.SetLength(254);
 	r=f.Create(TheFs,bigName,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 
 	TInt count;
@@ -1861,35 +1850,35 @@
 		if (r==KErrDirFull)
 			{
 			r=TheFs.Delete(countedBigName);
-			test_Value(r, r == KErrNotFound);
+			test(r==KErrNotFound);
 			break;
 			}
 		if (r!=KErrNone)
 			test.Printf(_L("File create failed:%d"),r);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		f.Close();
 		}
 	while(count--)
 		{
 		countedBigName[2]=(TText)('A'+count);
 		r=TheFs.Delete(countedBigName);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 
 	r=TheFs.Delete(bigName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TFileName subDirFileName=_L("\\F32-TST\\TFILE");
 	bigName.SetLength(241);
 	subDirFileName.Append(bigName);
 	r=f.Create(TheFs,subDirFileName,EFileRead);
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	subDirFileName.SetLength(254);
 	r=f.Create(TheFs,subDirFileName,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 	r=TheFs.Delete(subDirFileName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 
@@ -1907,30 +1896,30 @@
 	// Open a file in EFileShareReadersOnly mode
 	RFile f1;
 	TInt r=f1.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// Opening a share in EFileShareReadersOnly mode should succeed
 	RFile f2;
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f2.Close();
 
 	// Opening a share in EFileShareReadersOrWriters mode with EFileRead access should succeed
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOrWriters|EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f2.Close();
 
 	// Opening a share in EFileShareReadersOrWriters mode with EFileWrite access should succeed
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOrWriters|EFileWrite);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 
 	// Opening a share in EFileShareReadersOrWriters mode with EFileRead|EFileWrite access should succeed
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOrWriters|EFileRead|EFileWrite);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 
 	// Opening a share in EShareAny mode should fail
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareAny);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 
 	f1.Close();
 
@@ -1938,36 +1927,36 @@
 
 	// Open a file in EFileShareReadersOrWriters mode for reading
 	r=f1.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOrWriters|EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// Opening a share in EFileShareExclusive mode should fail
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareExclusive);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 
 	// Opening a share in EFileShareReadersOnly mode should succeed
 	// (the share doesn't care if the file is opened for reading or writing)
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f2.Close();
 
 	// Opening a share in EFileShareReadersOnly mode with EFileRead accesss should succeed
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOrWriters|EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f2.Close();
 
 	// Opening a share in EFileShareReadersOnly mode with EFileWrite accesss should succeed
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOrWriters|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f2.Close();
 
 	// Opening a share in EFileShareReadersOnly mode with EFileRead|EFileWrite accesss should succeed
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOrWriters|EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f2.Close();
 
 	// Opening a share in EFileShareAny mode should succeed
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f2.Close();
 
 	f1.Close();
@@ -1976,34 +1965,34 @@
 
 	// Open a file in EFileShareReadersOrWriters mode for writing
 	r=f1.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOrWriters|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// Opening a share in EFileShareExclusive mode should fail
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareExclusive);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 
 	// Opening a share in EFileShareReadersOnly mode should fail
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOnly);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 
 	// Opening a share in EFileShareReadersOrWriters mode with EFileRead access should succeed
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOrWriters|EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f2.Close();
 
 	// Opening a share in EFileShareReadersOrWriters mode with EFileWrite access should succeed
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOrWriters|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f2.Close();
 
 	// Opening a share in EFileShareReadersOrWriters mode with EFileRead|EFileWrite access should succeed
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOrWriters|EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f2.Close();
 
 	// Opening a share in EFileShareAny mode should succeed
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f2.Close();
 
 	f1.Close();
@@ -2012,34 +2001,34 @@
 
 	// Open a file in EFileShareAny mode
 	r=f1.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// Opening a share in EFileShareExclusive mode should fail
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareExclusive);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 
 	// Opening a share in EFileShareReadersOnly mode should fail
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOnly);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 
 	// Opening a share in EFileShareReadersOrWriters mode with EFileRead access should succeed
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOrWriters|EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f2.Close();
 
 	// Opening a share in EFileShareReadersOrWriters mode with EFileWrite access should succeed
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOrWriters|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f2.Close();
 
 	// Opening a share in EFileShareReadersOrWriters mode with EFileRead|EFileWrite access should succeed
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOrWriters|EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f2.Close();
 
 	// Opening a share in EFileShareAny mode with should succeed
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f2.Close();
 
 	f1.Close();
@@ -2048,12 +2037,12 @@
 
 	// Open a file in EFileShareReadersOrWriters mode for reading
 	r=f1.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOrWriters|EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// Opening a share in EFileShareReadersOnly mode should succeed
 	//  - The share should now be promoted to EFileShareReadersOnly mode
 	r=f2.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TInt pass = 2;
 	while(pass--)
@@ -2061,7 +2050,7 @@
 		RFile f3;
 		// Opening a share in EFileShareReadersOnly mode with EFileRead accesss should succeed
 		r=f3.Open(TheFs,_L("T_FILE.CPP"),EFileStreamText|EFileShareReadersOrWriters|EFileRead);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		f3.Close();
 
 		// Opening a share in EFileShareReadersOnly mode with EFileWrite accesss should fail
@@ -2069,12 +2058,12 @@
 		if(pass == 1)
 			{
 			// The share is promoted - should obey EFileShareReadersOnly rules
-			test_Value(r, r == KErrInUse);
+			test(r==KErrInUse);
 			}
 		else
 			{
 			// The share is demoted - should obey EFileShareReadersOrWriters rules
-			test_KErrNone(r);
+			test(r==KErrNone);
 			f3.Close();
 			}
 
@@ -2083,12 +2072,12 @@
 		if(pass == 1)
 			{
 			// The share is promoted - should obey EFileShareReadersOnly rules
-			test_Value(r, r == KErrInUse);
+			test(r==KErrInUse);
 			}
 		else
 			{
 			// The share is demoted - should obey EFileShareReadersOrWriters rules
-			test_KErrNone(r);
+			test(r==KErrNone);
 			f3.Close();
 			}
 
@@ -2097,13 +2086,13 @@
 		if(pass == 1)
 			{
 			// The share is promoted - should obey EFileShareReadersOnly rules
-			test_Value(r, r == KErrInUse);
+			test(r==KErrInUse);
 			f2.Close();
 			}
 		else
 			{
 			// The share is demoted - should obey EFileShareReadersOrWriters rules
-			test_KErrNone(r);
+			test(r==KErrNone);
 			f3.Close();
 			}
 		}
@@ -2206,7 +2195,7 @@
 	createTestFile(TheFile);
 
 	r=TheFile.Write(gBuf, -1);
-	test_Value(r, r == KErrArgument);
+	test(r==KErrArgument);
 
 	removeTestFile(TheFile);
 
@@ -2223,7 +2212,7 @@
 // EXPORT_C TInt RFile::Write(TInt aPos,const TDesC8& aDes,TInt aLength)
 	createTestFile(TheFile);
 	r = TheFile.Write(0,gBuf,-1);
-	test_Value(r, r == KErrArgument);
+	test(r==KErrArgument);
 	removeTestFile(TheFile);
 
 
@@ -2341,7 +2330,7 @@
 
 	test.Next(_L("Execute sync call RFile::Write(const TDesC8& aDes) with zero length aDes"));
 	TInt r=TheFile.Write(gLongBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Printf(_L("Test case passed\n"));
 
@@ -2408,7 +2397,7 @@
 #else
 
 	r=TheFile.Write(gLongBuf, 0x80000);
-	test_KErrNone(r);
+	test(r==KErrNone);
 #endif
 
 	test.Printf(_L("Test case passed\n"));
@@ -2460,7 +2449,7 @@
 
 	test.Next(_L("Execute sync call RFile::Write(TInt aPos, const TDesC8& aDes) with zero length aDes"));
 	r=TheFile.Write(0, gLongBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Printf(_L("Test case passed\n"));
 
@@ -2511,7 +2500,7 @@
 
 	test.Next(_L("Execute sync call RFile::Write(TInt aPos, const TDesC8& aDes, TInt aLength) with zero length aDes"));
 	r=TheFile.Write(0, gLongBuf, 0x80000);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Printf(_L("Test case passed\n"));
 
@@ -2575,7 +2564,7 @@
 
 // EXPORT_C TInt RFile::Read(TDes8& aDes,TInt aLength) const
 	err = file.Read(buf8,5);
-	test_Value(err, err == KErrOverflow);
+	test(err==KErrOverflow);
 	err = KErrNone;
 
 // EXPORT_C void RFile::Read(TDes8& aDes,TInt aLength,TRequestStatus& aStatus) const
@@ -2585,7 +2574,7 @@
 
 // EXPORT_C TInt RFile::Read(TInt aPos,TDes8& aDes,TInt aLength) const
 	err = file.Read(0,buf8,5);
-	test_Value(err, err == KErrOverflow);
+	test(err==KErrOverflow);
 
 // EXPORT_C void RFile::Read(TInt aPos,TDes8& aDes,TInt aLength,TRequestStatus& aStatus) const
 	file.Read(0,buf8,5,status);
@@ -2611,13 +2600,13 @@
 	RFile file;
 
 	TInt r=fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	if (testMode & EDoCDeleteOnClose)
 		fileMode|=EDeleteOnClose;
 	r=file.Temp(fs,_L(""),gLastTempFileName,fileMode);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	// Signal controlling thread and pause for panic where requested
 	// by caller.
 	if (testMode & EDoCPanic)
@@ -2663,11 +2652,11 @@
 //! 	1.	The temporary file is successfully created and deleted.
 //---------------------------------------------------------------------------------------------------------------------
 	r=clientThread.Create(_L("DeleteOnCloseClientThread 1"),DeleteOnCloseClientThread,KDefaultStackSize,0x2000,0x2000,(TAny*)0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	clientThread.Resume();
 	gSleepThread.Wait();
 	r=TheFs.Delete(gLastTempFileName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	clientThread.Close();
 
 //
@@ -2690,11 +2679,11 @@
 //---------------------------------------------------------------------------------------------------------------------
 	test.Next(_L("RFile::Temp EDeleteOnClose behaviour"));
 	r=clientThread.Create(_L("DeleteOnCloseClientThread 2"),DeleteOnCloseClientThread,KDefaultStackSize,0x2000,0x2000,(TAny*)EDoCDeleteOnClose);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	clientThread.Resume();
 	gSleepThread.Wait();
 	r=TheFs.Delete(gLastTempFileName);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	clientThread.Close();
 
 //
@@ -2715,7 +2704,7 @@
 //---------------------------------------------------------------------------------------------------------------------
 	test.Next(_L("RFile::Temp default panic behaviour"));
 	r=clientThread.Create(_L("DeleteOnCloseClientThread 3"),DeleteOnCloseClientThread,KDefaultStackSize,0x2000,0x2000,(TAny*)EDoCPanic);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	clientThread.Resume();
 	gSleepThread.Wait();
 	User::SetJustInTime(EFalse);
@@ -2724,7 +2713,7 @@
 	CLOSE_AND_WAIT(clientThread);
 	FsBarrier();
 	r=TheFs.Delete(gLastTempFileName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 //
 //---------------------------------------------------------------------------------------------------------------------
@@ -2746,7 +2735,7 @@
 //---------------------------------------------------------------------------------------------------------------------
 	test.Next(_L("RFile::Temp EDeleteOnClose panic behaviour"));
 	r=clientThread.Create(_L("DeleteOnCloseClientThread 4"),DeleteOnCloseClientThread,KDefaultStackSize,0x2000,0x2000,(TAny*)(EDoCPanic|EDoCDeleteOnClose));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	clientThread.Resume();
 	gSleepThread.Wait();
 	User::SetJustInTime(EFalse);
@@ -2755,7 +2744,7 @@
 	CLOSE_AND_WAIT(clientThread);
 	FsBarrier();
 	r=TheFs.Delete(gLastTempFileName);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 
 //
 //---------------------------------------------------------------------------------------------------------------------
@@ -2775,10 +2764,10 @@
 //---------------------------------------------------------------------------------------------------------------------
 	test.Next(_L("RFile::Create EDeleteOnClose behaviour"));
  	r=file.Create(TheFs,_L("DoC5"),EFileRead|EFileWrite|EDeleteOnClose);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	r=TheFs.Delete(filename);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 
 //
 //---------------------------------------------------------------------------------------------------------------------
@@ -2802,16 +2791,16 @@
 //---------------------------------------------------------------------------------------------------------------------
 	test.Next(_L("DoC 6 - Multiple subsessions"));
  	r=file.Create(TheFs,filename,EFileShareAny|EFileRead|EFileWrite|EDeleteOnClose);
-	test_KErrNone(r);
+	test(r==KErrNone);
  	r=file2.Open(TheFs,filename,EFileShareAny|EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(filename);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	file2.Close();
 	r=TheFs.Delete(filename);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 
 //
 //---------------------------------------------------------------------------------------------------------------------
@@ -2829,10 +2818,10 @@
 //---------------------------------------------------------------------------------------------------------------------
 	test.Next(_L("RFile::Create existing file behaviour"));
  	r=file.Create(TheFs,filename,EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
  	r=file.Create(TheFs,filename,EFileRead|EFileWrite|EDeleteOnClose);
-	test_Value(r, r == KErrAlreadyExists);
+	test(r==KErrAlreadyExists);
 
 //
 //---------------------------------------------------------------------------------------------------------------------
@@ -2849,9 +2838,9 @@
 //---------------------------------------------------------------------------------------------------------------------
 	test.Next(_L("RFile::Open EDeleteOnClose flag validation"));
 	r=file.Open(TheFs,filename,EFileRead|EFileWrite|EDeleteOnClose);
-	test_Value(r, r == KErrArgument);
+	test(r==KErrArgument);
 	r=TheFs.Delete(filename);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	gSleepThread.Close();
 	test.End();
@@ -2880,21 +2869,21 @@
 
     //-- 1. create test file
     nRes = CreateEmptyFile(TheFs, KFile, 33);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     //-- 2. open it for write
     RFile file;
     nRes = file.Open(TheFs, KFile, EFileWrite);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     //-- 3. write a couple of bytes there. This must cause 'Archive' attribute set
     nRes = file.Write(0, _L8("a"));
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
     nRes = file.Write(10, _L8("b"));
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     nRes = TheFs.Entry(KFile, entry);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     test(entry.IsArchive());  //-- 'A' attribute must be set.
 
@@ -2902,23 +2891,23 @@
     //-- 4. set new file attributes (w/o 'A') and creation time
     const TUint newAtt = KEntryAttSystem ;
     nRes = file.SetAtt(newAtt, ~newAtt & KEntryAttMaskSupported);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     TTime newTime;
     nRes = newTime.Set(_L("19970310:101809.000000"));
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
     nRes = file.SetModified(newTime);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     //-- 5. wait 5 seconds. file server shall flush dirty data during this period.
     User::After(5*K1Sec);
 
     //-- 6. check that attributes haven't chanded because of flush
     nRes = file.Flush(); //-- this will flush attributes to the media
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     nRes = TheFs.Entry(KFile, entry);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     test(entry.iAtt == newAtt);
     test(entry.iModified.DateTime().Year() == 1997);
@@ -2927,12 +2916,12 @@
 
     //-- 7. write some data and ensure that 'A' attribute is set now and 'modified' time updated
     nRes = file.Write(12, _L8("c"));
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     file.Close(); //-- this will flush attributes to the media
 
     nRes = TheFs.Entry(KFile, entry);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
     test(entry.iAtt == (newAtt | KEntryAttArchive));
     test(entry.iModified.DateTime().Year() != 1997);
 
@@ -2948,6 +2937,8 @@
 {
     test.Next(_L("test maximal file size on FAT32\n"));
 
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
     if(!Is_Fat32(TheFs, gDriveNum))
     {
         test.Printf(_L("This test requires FAT32! skipping.\n"));
@@ -2959,7 +2950,7 @@
     //-- check disk space, it shall be > 4G
     TVolumeInfo volInfo;
     nRes = TheFs.Volume(volInfo, gDriveNum);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     const TUint32 KMaxFAT32FileSize = 0xFFFFFFFF; // 4GB-1
 
@@ -2977,17 +2968,17 @@
     //-- this file has enabled write caching by default
     test.Printf(_L("creating maximal length file, size = 0x%x\n"),KMaxFAT32FileSize);
     nRes = file64.Replace(TheFs, KFileName, EFileWrite);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     const TInt64 fileSize = KMaxFAT32FileSize;
 
     nRes = file64.SetSize(fileSize);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     test.Printf(_L("seeking to the file end...\n"));
     TInt64 filePos = 0;
     nRes = file64.Seek(ESeekEnd, filePos);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
 
     test.Printf(_L("test writing to the last bytes of the file (rel pos addressing) \n"));
@@ -2995,31 +2986,31 @@
     //-- 1. writing using relative position
     filePos = -1;
     nRes = file64.Seek(ESeekEnd, filePos);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
     test(filePos == fileSize-1);
 
     nRes = file64.Write(_L8("z")); //-- write 1 byte a pos 0xFFFFFFFE, this is the last allowed position of the FAT32 file
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     nRes = file64.Write(_L8("x")); //-- write 1 byte a pos 0xFFFFFFFF, beyond the max. allowed file size, this shall fail
-    test_Value(nRes, nRes == KErrNotSupported);
+    test(nRes == KErrNotSupported);
 
     nRes = file64.Flush();
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     //-- 1.1 check the result by reading data using rel. pos
     filePos = -1;
     nRes = file64.Seek(ESeekEnd, filePos);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
     test(filePos == fileSize-1);
 
     test.Printf(_L("reading 1 byte at pos: 0x%x\n"), filePos);
     nRes = file64.Read(buf, 1); //-- read 1 byte a pos 0xFFFFFFFE, this is the last allowed position of the FAT32 file
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
     test(buf.Length() == 1 && buf[0]=='z');
 
     nRes = file64.Read(buf, 1); //-- read 1 byte a pos 0xFFFFFFFF, beyond the max. allowed file size, this shall fail
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
     test(buf.Length() == 0);
 
     file64.Close();
@@ -3027,48 +3018,51 @@
     test.Printf(_L("test writing to the last bytes of the file (absolute pos addressing) \n"));
     //-- 2. writing using absolute position
     nRes = file64.Open(TheFs, KFileName, EFileWrite);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     filePos = fileSize-1;
 
     nRes = file64.Write(filePos-2, _L8("0"), 1); //-- write 1 byte a pos 0xFFFFFFFC
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     nRes = file64.Write(filePos, _L8("a"), 1);   //-- write 1 byte a pos 0xFFFFFFFE, this is the last allowed position of the FAT32 file
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     nRes = file64.Write(filePos+1, _L8("b"), 1); //-- write 1 byte a pos 0xFFFFFFFF, beyond the max. allowed file size, this shall fail
-    test_Value(nRes, nRes == KErrNotSupported);
+    test(nRes == KErrNotSupported);
 
     nRes = file64.Flush();
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     //-- 1.1 check the result by reading data absolute rel. position
 
     nRes = file64.Read(filePos-2, buf, 1); //-- read 1 byte a pos 0xFFFFFFFD
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
     test(buf.Length() == 1 && buf[0]=='0');
 
     nRes = file64.Read(filePos, buf, 1);   //-- read 1 byte a pos 0xFFFFFFFE, this is the last allowed position of the FAT32 file
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
     test(buf.Length() == 1 && buf[0]=='a');
 
     nRes = file64.Read(filePos+1, buf, 1);  //-- read 1 byte a pos 0xFFFFFFFF, beyond the max. allowed file size
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
     test(buf.Length() == 0);
 
     nRes = file64.Read(filePos+2, buf, 1); //buf.Len must be 0
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
     test(buf.Length() == 0);
 
     file64.Close();
 
     test.Printf(_L("deleting the huge file.\n"));
     nRes = TheFs.Delete(KFileName);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
+
+#else
 
     test.Printf(_L("RFile64 is not supported! Skipping.\n"));
 
+#endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
 
 }
 
@@ -3082,7 +3076,7 @@
     F32_Test_Utils::SetConsole(test.Console());
 
     TInt nRes=TheFs.CharToDrive(gDriveToTest, gDriveNum);
-    test_KErrNone(nRes);
+    test(nRes==KErrNone);
     
     PrintDrvInfo(TheFs, gDriveNum);
 
@@ -3091,26 +3085,26 @@
         gShortFileNamesSupported = ETrue;
     
     if(Is_Win32(TheFs, gDriveNum)) 
-    	{//-- find out if this is NTFS and if it supports short names (this feature can be switched OFF)
+    {//-- find out if this is NTFS and if it supports short names (this feature can be switched OFF)
         
         _LIT(KLongFN, "\\this is a long file name");
         nRes = CreateEmptyFile(TheFs, KLongFN, 10);   
-        test_KErrNone(nRes);
+        test(nRes==KErrNone);
 
 	    TBuf<12> shortName;
 	    nRes = TheFs.GetShortName(KLongFN, shortName);
 	    gShortFileNamesSupported = (nRes == KErrNone);
         
         nRes = TheFs.Delete(KLongFN);
-        test_KErrNone(nRes);
+        test(nRes==KErrNone);
 
         DeleteTestDirectory();
-    	}
+    }
     else
-    	{
+    {
         nRes = FormatDrive(TheFs, gDriveNum, ETrue);
-        test_KErrNone(nRes);
-    	}
+        test(nRes==KErrNone);
+    }
 
 	CreateTestDirectory(_L("\\F32-TST\\TFILE\\"));
 
--- a/kerneltest/f32test/server/t_file64bit.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_file64bit.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -25,7 +25,6 @@
 //
 
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32svr.h>
@@ -58,7 +57,7 @@
     RBuf8 buf;
     
     r = buf.CreateMax(KBufSize);
-    test_KErrNone(r);
+    test(r == KErrNone);
 
     RFile64 file;
 	TFileName fileName;
@@ -66,10 +65,10 @@
 	fileName.Append(KTestPath);
 	fileName.Append(_L("File4GBMinusOne.txt"));
 	r = file.Replace(TheFs,fileName, EFileWrite);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
     r = file.SetSize(K4GBMinusOne);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	TInt64 nNumberOfBytesToWrite = 0;
 	TInt64 nNumberOfBytesWritten = 0;
@@ -90,7 +89,7 @@
 		}
 	
 	r = file.Flush();
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test.Printf(_L("\nFile writing is completed!!"));
 	
 	
@@ -178,7 +177,7 @@
 	{
 	test.Printf(_L("%S File Replaced with %S\n"),&anOldName,&aNewName);\
 	TInt r = TheFs.Replace(anOldName,aNewName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	return(*this);
 	}
 	
@@ -191,9 +190,20 @@
 	TInt r = TheFs.ReadFileSection(aName,aPos,aBuffer,aLen);
 	TInt len = aBuffer.Length();
 	
-	test_KErrNone(r);
-	if(KFileSizeMaxLargerThan4GBMinusOne == EFalse && aPos >= K4GB) 
-		test(len == 0);
+	if(KFileSizeMaxLargerThan4GBMinusOne == EFalse)
+		{
+		if(aPos < K4GB) 
+			test(r == KErrNone);
+		else
+			{
+			test(r == KErrNone);
+			test(len == 0);				
+			}
+		}
+	else
+		{
+		test (r == KErrNone);	
+		}
 	return(*this);
 	}
 	
@@ -205,7 +215,7 @@
 	{
 	test.Printf(_L("Name of the directory for which listing is required %S\n"),&aName);	
 	TInt r = TheFs.GetDir(aName,anEntryAttMask,anEntrySortKey,anEntryList);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	return(*this);
 	}
 
@@ -216,7 +226,7 @@
 	{
 	test.Printf(_L("Name of the directory for which directory and file listing is required %S\n"),&aName);	
 	TInt r = TheFs.GetDir(aName,anEntryAttMask,anEntrySortKey,anEntryList,aDirList);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	return(*this);
 	}
 
@@ -227,7 +237,7 @@
 	{
 	test.Printf(_L("Name of the directory for which listing is required %S\n"),&aName);	
 	TInt r = TheFs.GetDir(aName,anEntryUid,anEntrySortKey,aFileList);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	return(*this);	
 	}
 		
@@ -246,7 +256,7 @@
 	{
 	test.Printf(_L("%S create %S in %d Mode\n"),&iName,&aName,aFileMode);
 	TInt r = RFile64::Create(TheFs,aName,aFileMode);
-	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+	test(r == KErrNone || r == KErrAlreadyExists);
 	return(*this);		
 	}
 	
@@ -258,7 +268,7 @@
 	{
 	test.Printf(_L("%S replace %S\n"),&iName,&aName);
 	TInt r = RFile64::Replace(TheFs,aName,EFileStream|EFileWrite);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	return(*this);
 	}
 
@@ -270,7 +280,10 @@
 	{
 	test.Printf(_L("%S replace %S in %d Mode\n"),&iName,&aName, aFileMode);
 	TInt r = RFile64::Replace(TheFs,aName,aFileMode);
-	test_Value(r, r == KErrNone || r == KErrBadName);
+	if (r == KErrNone)
+		test(r == KErrNone);
+	else
+		test(r == KErrBadName);
 	return(*this);		
 	}
 	
@@ -281,7 +294,7 @@
 	{
 	test.Printf(_L("%S open %S\n"),&iName,&aName);
 	TInt r = RFile64::Open(TheFs,aName,EFileWrite|EFileShareAny);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	return(*this);
 	}
 
@@ -292,7 +305,7 @@
 	{
 	test.Printf(_L("%S open %S in %d Mode\n"),&iName,&aName, aFileMode);
 	TInt r = RFile64::Open(TheFs,aName,aFileMode);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	return(*this);
 	}
 
@@ -303,7 +316,7 @@
 	{
 	test.Printf(_L("%S Temp file %S in %d Mode\n"),&iName,&aName, aFileMode);
 	TInt r = RFile64::Temp(TheFs,aPath,aName,aFileMode);	
-	test_KErrNone(r);
+	test(r == KErrNone);
 	return(*this);
 	}
 	
@@ -322,7 +335,7 @@
 	{
 	test.Printf(_L("%S lock   0x%lx-0x%lx\n"),&iName,aPos,aPos+aLen-1);
 	TInt r = RFile64::Lock(aPos,aLen);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	return(*this);
 	}
 
@@ -333,7 +346,7 @@
 	{
 	test.Printf(_L("%S lockE  0x%lx-0x%lx\n"),&iName,aPos,aPos+aLen-1);
 	TInt r = RFile64::Lock(aPos,aLen);
-	test_Value(r, r == KErrLocked);
+	test(r == KErrLocked);
 	return(*this);
 	}
 
@@ -344,7 +357,7 @@
 	{
 	test.Printf(_L("%S ulock  0x%lx-0x%lx\n"),&iName,aPos,aPos+aLen-1);
 	TInt r = RFile64::UnLock(aPos,aLen);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	return(*this);
 	}
 
@@ -355,7 +368,7 @@
 	{
 	test.Printf(_L("%S ulockE 0x%lx-0x%lx\n"),&iName,aPos,aPos+aLen-1);
 	TInt r = RFile64::UnLock(aPos,aLen);
-	test_Value(r, r == KErrNotFound);
+	test(r == KErrNotFound);
 	return(*this);
 	}
 
@@ -378,17 +391,13 @@
 	if(KFileSizeMaxLargerThan4GBMinusOne == EFalse)
 		{
 		if((seekPos + aDes.Length()) < K4GB)
-			{
-			test_KErrNone(r);
-			}
+			test(r == KErrNone);
 		else
-			{
-			test_Value(r, r == KErrNotSupported);
-			}
+			test(r == KErrNotSupported);
 		}
 	else
 		{
-		test_KErrNone(r);	
+		test (r == KErrNone);	
 		}
 	return(*this);
 	}
@@ -414,13 +423,10 @@
 	if(KFileSizeMaxLargerThan4GBMinusOne == EFalse)
 		{
 		if((seekPos + aDes.Length()) < K4GB)
-			{
 			test(aStatus.Int() == KErrNone);
-			}
 		else
-			{
 			test(aStatus.Int() == KErrNotSupported);
-			}
+		
 		}
 	else
 		{
@@ -446,17 +452,13 @@
 	if(KFileSizeMaxLargerThan4GBMinusOne == EFalse)
 		{
 		if((seekPos + aLength) < K4GB)
-			{
-			test_KErrNone(r);
-			}
+			test(r == KErrNone);
 		else
-			{
-			test_Value(r, r == KErrNotSupported);
-			}
+			test(r == KErrNotSupported);
 		}
 	else
 		{
-		test_KErrNone(r);
+		test(r == KErrNone);
 		}
 	return(*this);	
 	}	
@@ -506,17 +508,13 @@
 	if(KFileSizeMaxLargerThan4GBMinusOne == EFalse)
 		{
 		if ((aPos + aDes.Length()) < K4GB)
-			{
-			test_KErrNone(r);
-			}
+			test(r == KErrNone);
 		else
-			{
-			test_Value(r, r == KErrNotSupported);
-			}
+			test(r == KErrNotSupported);
 		}
 	else
 		{
-		test_KErrNone(r);
+		test(r == KErrNone);
 		}
 	return(*this);
 	}
@@ -531,7 +529,7 @@
 	TInt r = RFile64::Write(aPos,aDes);
 	if( KErrNone == r)	// this is to ensure that the written data is committed and not cached.
 		r = RFile64::Flush();
-	test_KErrNone(r);
+	test(r == KErrNone);
 	return(*this);
 	}
 
@@ -550,29 +548,19 @@
 		if ((aPos + aLen) < K4GB)
 			{
 			if (aLen < 0)
-				{
-				test_Value(r, r == KErrArgument);
-				}
+				test(r == KErrArgument);
 			else
-				{
-				test_KErrNone(r);
-				}
+				test(r == KErrNone);
 			}
 		else
-			{
-			test_Value(r, r == KErrNotSupported);
-			}
+			test(r == KErrNotSupported);
 		}
 	else
 		{
 		if (aLen < 0)
-			{
-			test_Value(r, r == KErrArgument);
-			}
+			test(r == KErrArgument);
 		else
-			{
-			test_KErrNone(r);
-			}
+			test(r == KErrNone);
 		}
 	return(*this);
 	}
@@ -587,7 +575,7 @@
 	TInt r = RFile64::Write(aPos,aDes,aLen);
 	if( KErrNone == r)	// this is to ensure that the written data is committed and not cached.
 		r = RFile64::Flush();
-	test_KErrNone(r);
+	test(r == KErrNone);
 	return(*this);
 	}
 
@@ -599,7 +587,10 @@
 	{
 	test.Printf(_L("%S writeE 0x%lx-0x%lx\n"),&iName,aPos,aPos+aLen-1);
 	TInt r = RFile64::Write(aPos,aDes,aLen);
-	test_Value(r, r == (aLen < 0) ? KErrArgument : KErrLocked);
+	if (aLen < 0)
+		test(r == KErrArgument);
+	else
+		test(r == KErrLocked);
 	return(*this);
 	}
 
@@ -710,7 +701,7 @@
 	{
 	test.Printf(_L("%S read \n"),&iName);
 	TInt r = RFile64::Read(aDes);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	return(*this);
 	}
 
@@ -779,7 +770,10 @@
 	{
 	test.Printf(_L("%S read 0x%08x bytes\n"),&iName,aLen);
 	TInt r = RFile64::Read(aDes,aLen);
-	test_Value(r, r == (aLen < 0) ? KErrArgument : KErrNone);
+	if(aLen < 0)
+		test(r == KErrArgument);
+	else
+		test(r == KErrNone);
 	return(*this);
 	}
 	
@@ -791,7 +785,10 @@
 	test.Printf(_L("%S read   0x%lx-0x%lx\n"),&iName,aPos,aPos+aLen-1);
 	TInt r = RFile64::Read(aPos,aDes,aLen);
 	TInt len = aDes.Length();
-	test_Value(r, r == (aLen < 0) ? KErrArgument : KErrNone);
+	if(aLen < 0)
+		test(r == KErrArgument);
+	else 
+		test(r == KErrNone);
 	if(KFileSizeMaxLargerThan4GBMinusOne == EFalse)
 		{	
 		if(aPos >= K4GB) 
@@ -807,7 +804,7 @@
 	{
 	test.Printf(_L("%S readE  0x%lx-0x%lx\n"),&iName,aPos,aPos+aLen-1);
 	TInt r = RFile64::Read(aPos,aDes,aLen);
-	test_Value(r, r == KErrLocked);
+	test(r == KErrLocked);
 	return(*this);
 	}
 
@@ -839,7 +836,7 @@
 	{
 	test.Printf(_L("%S read   0x%lx\n"),&iName,aPos);
 	TInt r = RFile64::Read(aPos,aDes);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	return(*this);	
 	}
 
@@ -851,7 +848,7 @@
 	{
 	test.Printf(_L("%S read   0x%lx\n"),&iName,aPos);
 	TInt r = RFile64::Read(aPos,aDes);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	return(*this);	
 	}
 
@@ -876,7 +873,10 @@
 	{
 	test.Printf(_L("%S read   0x%lx-0x%lx\n"),&iName,aPos,aPos+aLen-1);
 	TInt r = RFile64::Read(aPos,aDes,aLen);
-	test_Value(r, r == (aLen < 0) ? KErrArgument : KErrNone);
+	if(aLen < 0)
+		test(r == KErrArgument);
+	else 
+		test(r == KErrNone);
 	return(*this);
 	}
 
@@ -919,17 +919,13 @@
 	if(KFileSizeMaxLargerThan4GBMinusOne == EFalse)
 		{
 		if(aSize < K4GB)
-			{
-			test_KErrNone(r);
-			}
+			test(r == KErrNone);
 		else
-			{
-			test_Value(r, r == KErrNotSupported);
-			}
+			test(r == KErrNotSupported);
 		}
 	else
 		{
-		test_KErrNone(r);
+		test(r == KErrNone);
 		}
 	return(*this);
 	}
@@ -941,7 +937,7 @@
 	{
 	test.Printf(_L("%S sizeE: 0x%lx\n"),&iName,aSize);
 	TInt r = RFile64::SetSize(aSize);
-	test_Value(r, r == KErrLocked);
+	test(r == KErrLocked);
 	return(*this);
 	}
 
@@ -956,17 +952,13 @@
     if(KFileSizeMaxLargerThan4GBMinusOne == EFalse)
 		{
 		if(aSize < K4GB)
-			{
-			test_KErrNone(r);
-			}
+			test(r == KErrNone);
 		else
-			{
-			test_Value(r, r == KErrTooBig);
-			}
+			test(r == KErrTooBig);
 		}
 	else
 		{
-		test_KErrNone(r);
+		test(r == KErrNone);
 		}
 	return(*this);	
 
@@ -978,7 +970,10 @@
 	{
 	test.Printf(_L("Seek to pos %LD in %d Mode\n"),aPos, aMode);
 	TInt r = RFile64::Seek(aMode, aPos);
-	test_Value(r, r == (aPos < 0) ? KErrArgument : KErrNone);
+	if(aPos < 0)
+		test(r == KErrArgument);
+	else
+		test(r == KErrNone);
 	return(*this);	
 	}
 
@@ -1017,7 +1012,7 @@
 	
 	test.Next(_L("2GB File: Open"));
 	TInt r = TheFs.Entry(fileName, entry);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test((TUint) entry.iSize == testSize);
 
     TestRFile1.Open(fileName, EFileRead);
@@ -1028,7 +1023,7 @@
 	
 	TestRFile1.Close();
 	r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}
 
 /**
@@ -1065,7 +1060,7 @@
 		
 	test.Next(_L("3GB File: Open"));
 	r = TheFs.Entry(fileName, entry);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test((TUint) entry.iSize == testSize);
 	
 	TestRFile1.Open(fileName,EFileRead);
@@ -1075,7 +1070,7 @@
 	TestRFile1.Close();
 	
 	r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}
 
 /**
@@ -1112,7 +1107,7 @@
 	
 	test.Next(_L("4GB-1 File: Open"));
 	r = TheFs.Entry(fileName, entry);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	test((TUint) entry.iSize == testSize);
 	
@@ -1124,7 +1119,7 @@
 	TestRFile1.Close();
 	
 	r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}
 	
 /**
@@ -1161,7 +1156,7 @@
 	
 	test.Next(_L("4GB File: Open"));
 	r = TheFs.Entry(fileName, entry);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	if ((TUint) entry.iSize == testSize)
 		{
@@ -1172,7 +1167,7 @@
 		}
 	
 	r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 		
 	}	
 	
@@ -1259,10 +1254,10 @@
 	
 	RFile64 file64;
 	TInt r = file64.Open(TheFs,fileName,EDeleteOnClose);
-	test_Value(r, r == KErrArgument);
+	test (r == KErrArgument);
 	
 	r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	}
 
@@ -1315,7 +1310,7 @@
 	
 	test.Start(_L("Test opening a file using RFile and RFile64 in file sharing mode\n"));
 	TInt r = file.Replace(TheFs,fileName,EFileShareAny|EFileWrite);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	TBuf8<100> writeBuf;
 	TBuf8<100> readBuf;
@@ -1327,11 +1322,11 @@
 		
    	test.Next(_L("Write 100 bytes to the file\n"));
 	r = file.Write(0, writeBuf, 100);	
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	test.Next(_L("Read 100 bytes from position 0"));
 	r = file.Read(0, readBuf, 100); 
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	test.Next(_L("Compare the read data to the written data"));
 	test(readBuf == writeBuf);
@@ -1345,13 +1340,13 @@
 	
 	test.Next(_L("Query the file size using Rfile::Size()\n"));
 	r = file.Size(size);
-	test_Value(r, r == KErrTooBig);
+	test (r == KErrTooBig);
 	
 	test.Next(_L("Seek to the file position using 2GB+5 using RFile::Seek()\n"));
 	TUint seekPos1 = K2GB + 5;
 	TInt seekPos  = (TInt)seekPos1;
 	r = file.Seek(ESeekStart,seekPos);
-	test_Value(r, r == KErrArgument);
+	test(r == KErrArgument);
 	
 	test.Next(_L("Get the file size using RFile64::Size()\n"));
 	TestRFile1.Size(size64);
@@ -1379,14 +1374,14 @@
 	
 	test.Next(_L("Open the file using Rfile::Open()\n"));
 	r = file.Open(TheFs,fileName,EFileShareAny|EFileWrite);
-	test_Value(r, r == KErrTooBig);
+	test(r == KErrTooBig);
 	
 	test.Next(_L("Open the file using Rfile64::Open() and close\n"));
 	TestRFile1.Open(fileName,EFileShareAny|EFileWrite);
 	TestRFile1.Close();
 	
 	r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}
 
 /**
@@ -1430,7 +1425,7 @@
 	testDir.Append(KTestPath);
 	
 	TInt r = TheFs.MkDir(testDir);
-	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+	test(r == KErrNone || r == KErrAlreadyExists);
 	
 	TFileName fileName;
 	TestRFile1.Temp(testDir, fileName, EFileWrite|EDeleteOnClose);
@@ -1491,7 +1486,7 @@
 	
 	test.Next(_L("Delete the temporary file\n"));
 	r = TheFs.Delete(fileName);
-	test_Value(r, r == KErrNotFound);
+	test(r == KErrNotFound);
 	
 	test.Next(_L("Create a temporary file using RFile64::Temp without EDeleteOnClose flag\n"));
 	TestRFile1.Temp(testDir, fileName, EFileWrite);
@@ -1501,7 +1496,7 @@
 	
 	test.Next(_L("Delete the temporary the file\n"));	
 	r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	}
 
@@ -1630,10 +1625,10 @@
 	test.Next(_L("create a file with InvalidPath and fileName\n"));	
 	RFile64 file64;
 	TInt r = file64.Create(TheFs, _L("C:\\InvalidPathName\\FileName"),EFileWrite);
-	test_Value(r, r == KErrPathNotFound);
+	test(r == KErrPathNotFound);
 	
 	r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}	
 	
 /**
@@ -1780,10 +1775,10 @@
 	test.Next(_L("Replace a file FileLargeOne.txt with invalid path\n"));	
 	RFile64 file64;
 	TInt r = file64.Replace(TheFs,_L("C:\\InvalidPath\\FileLargeOne.Txt"),EFileWrite);
-	test_Value(r, r == KErrPathNotFound);
+	test (r == KErrPathNotFound);
 	
 	r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}
 
 /**
@@ -1875,7 +1870,7 @@
 	test.Next(_L("Close the file and delete\n"));
 	TestRFile1.Close();
 	TInt r = TheFs.Delete(fileNameReplace);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}
 
 /**
@@ -1906,39 +1901,39 @@
 
 	RProcess p;
 	TInt r = p.Create(_L("FHServer64Bit.exe"), KNullDesC);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	
 	test.Next(_L("Connect to the File server \n"));
 	RFs fs;
 	r = fs.Connect();
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	// Check the number of open file handles
 	TInt resCount = fs.ResourceCount();
 	test(resCount == 0);
 
 	r = fs.ShareProtected();
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	r = fs.CreatePrivatePath(gDrive);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = fs.SetSessionToPrivate(gDrive);
 	
 	test.Next(_L("Create a file and set the file size to 4GB-1\n"));
 	RFile64 file1;
 	r = file1.Replace(fs,KClientFileName,EFileWrite);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = file1.SetSize(K4GB-1);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	test.Next(_L("Write few bytes to the location 4GB-10, length = 9bytes\n"));
 	r = file1.Write(K4GB-10,KTestData3(),9);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	file1.Close();
 
 	r = p.SetParameter(3, gDrive);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	p.Resume();
 	
@@ -1950,39 +1945,39 @@
 		r = handsvr.Connect();
 		}
 	while(r == KErrNotFound);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	r = handsvr.SetTestDrive(gDrive);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	r = fs.SetSessionToPrivate(gDrive);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	r = file1.Open(fs,KClientFileName,EFileRead);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	// pass the file handle to FHServer
 	test.Next(_L("RFile::TransferToServer()"));
 
 	TIpcArgs ipcArgs;
 	r = file1.TransferToServer(ipcArgs, 0, 1);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	test.Next(_L("Adopt the already open file from a client using RFile64::AdoptFromClient()\n"));
 	r = handsvr.PassFileHandleProcessLargeFileClient(ipcArgs);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	// verify that the original file handle's position is unchanged
 	TInt64 pos = 0;
 	r = file1.Seek(ESeekCurrent, pos);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test(pos == 0);
 	// make sure we can still use it
 
 	test.Next(_L("Read the file from position 4GB-10 and compare the data\n"));
 	TBuf8<9> rbuf;
 	r = file1.Read(K4GB-10,rbuf);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test (rbuf == KTestData3);
 
 	// Close the file
@@ -1990,14 +1985,14 @@
 	handsvr.Exit();
 	handsvr.Close();
 	r = fs.MkDir(_L("C:\\mdir"));
-	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+	test(r == KErrNone || r == KErrAlreadyExists);
 		
 	// Check the number of open file handles
 	resCount = fs.ResourceCount();
 	test(resCount == 0);
 
 	r = fs.Delete(KClientFileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	fs.Close();
 	}
 
@@ -2036,39 +2031,39 @@
 	test.Next(_L("Create a process named FHServer64Bit.exe\n"));
 	RProcess p;
 	r = p.Create(_L("FHServer64Bit.exe"), KNullDesC);
-	test_KErrNone(r);
+	test(r == KErrNone);
 		
 	test.Next(_L("Connect to the file server\n"));
 	RFs fs;
 	r = fs.Connect();
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	// Check the number of open file handles
 	TInt resCount = fs.ResourceCount();
 	test(resCount == 0);
 
 	r = fs.ShareProtected();
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	r = fs.CreatePrivatePath(gDrive);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = fs.SetSessionToPrivate(gDrive);
 	
 	test.Next(_L("Create a file and set the file size to 4GB-1\n"));
 	RFile64 file1;
 	r = file1.Replace(fs,KClientFileName,EFileWrite);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = file1.SetSize(K4GB-1);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	test.Next(_L("Write few bytes to the location 4GB-10, length = 3bytes\n"));
 	r = file1.Write(K4GB-10,KTestData2(),3);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	file1.Close();
 
 	r = file1.Open(fs, KClientFileName, EFileWrite);
 
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	// NB slot 0 is reserved for the command line
 
@@ -2077,21 +2072,21 @@
 	r = file1.TransferToProcess(p, 1, 2);
 
 	r = p.SetParameter(3, gDrive);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	r = fs.SetSessionToPrivate(gDrive);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	// make sure we can still read from the file
 	TBuf8<3> rbuf;
 	r = file1.Read(K4GB-10,rbuf,3);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = rbuf.CompareF(KTestData2());
-	test_KErrNone(r);
+	test(r == KErrNone);
 	file1.Close();
 
 	r = fs.MkDir(_L("C:\\mdir"));
-	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+	test(r == KErrNone || r == KErrAlreadyExists);
 	
 	// Check the number of open file handles - 
 	// should be 1 (the one duplicated for the other process)
@@ -2111,13 +2106,13 @@
 		r = handsvr.Connect();
 		}
 	while(r == KErrNotFound);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = handsvr.SetTestDrive(gDrive);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	// wait for server to read the file
 	r = handsvr.PassFileHandleProcessLargeFileCreator();
-	test_KErrNone(r);
+	test (r == KErrNone);
 	
 	
 	// cleanup	
@@ -2156,37 +2151,37 @@
 	test.Next(_L("Connect to the file server\n"));
 	RFs fs;
 	r = fs.Connect();
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	// Check the number of open file handles
 	TInt resCount = fs.ResourceCount();
 	test(resCount == 0);
 
 	r = fs.ShareProtected();
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	r = fs.CreatePrivatePath(gDrive);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = fs.SetSessionToPrivate(gDrive);
 	
 	test.Next(_L("Create a file and set the file size to 4GB-1\n"));
 	RFile64 file1;
 	r = file1.Replace(fs,KClientFileName,EFileWrite);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = file1.SetSize(K4GB-1);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	
 	r = file1.Write(K4GB-10,KTestData3(),9);
-	test_KErrNone(r);
+	test(r == KErrNone);
 		
 	file1.Close();
 	r = fs.Delete(KClientFileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	RProcess p;
 	r = p.Create(_L("FHServer64Bit.exe"), KNullDesC);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	// Request an open file (write mode) from the server
 	// using RFile64::AdoptFromServer()
 	
@@ -2198,10 +2193,10 @@
 		r = handsvr.Connect();
 		}
 	while(r == KErrNotFound);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	r = handsvr.SetTestDrive(gDrive);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	TInt ssh;
 	TInt fsh = handsvr.GetFileHandleLargeFile2(ssh, EFileWrite);
@@ -2220,30 +2215,30 @@
 
 	RFile64 file;
 	r = file.AdoptFromServer(fsh, ssh);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	test.Next(_L("Read the file from position 4GB-10 and compare the data\n"));
 	TBuf8<9> rbuf;
 	r = file.Read(K4GB-10,rbuf);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	// server should write KTestData1 ("Server!!!") to file
 	test (rbuf == KTestData4);
 
 	TFileName fileName;
 	r = file.FullName(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	file.Close();
 	//cleanup
 	r = fs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 		
 	TFileName sessionPath;
 	r = fs.SessionPath(sessionPath);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	r = fs.RmDir(sessionPath);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	fs.Close();
 	
@@ -2276,7 +2271,7 @@
 	TBuf8<KBufSize> readBuf2;
 	TUint i;
 	TInt r = GenerateBigFileContents();
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	test.Next(_L("Open & Read Synchronously Large File From Diff Offset:"));
 
@@ -2906,7 +2901,7 @@
 	TestRFile1.Close();
 	
 	TInt r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}	
 
 /**
@@ -3043,7 +3038,7 @@
 	TestRFile1.Close();
 	
 	TInt r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}
 
 /**
@@ -3182,7 +3177,7 @@
 	TestRFile1.Close();
 	
 	TInt r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}
 
 /**
@@ -3347,7 +3342,7 @@
 	TestRFile1.Close();
 	
 	TInt r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}
 		
 /**
@@ -3527,7 +3522,7 @@
 	TestRFile1.Close();
 	
 	TInt r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}
 			
 /**
@@ -3599,7 +3594,7 @@
 	TestRFile1.Close();
 	
 	TInt r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}
 
 
@@ -3708,7 +3703,7 @@
 
     TestRFile2.Close();
 	TInt r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}
 
 /**
@@ -3802,7 +3797,7 @@
 	TestRFile1.Close();
 	
 	TInt r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}
 
 /**
@@ -3909,7 +3904,7 @@
 	TestRFile1.Close();
 	
 	TInt r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 }
 
 /**
@@ -4016,7 +4011,7 @@
 	TestRFile1.Close();
 	
 	TInt r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}
 
 /**
@@ -4053,9 +4048,9 @@
 	fileName.Append(_L("File4GBMinusOne.txt"));
 	
 	TInt r = file.Replace(TheFs,fileName,EFileWrite);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = file.SetSize(K4GBMinusOne);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	file.Close();
 	
 	test.Next(_L("Read from a big file using RFs::ReadFileSection() from position 3GB-1,52byte lengths of data\n"));
@@ -4086,7 +4081,7 @@
 		}
 		
 	r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}
 	
 /**
@@ -4150,11 +4145,11 @@
 	test.Next(_L("Get the directory listing, sort by size\n"));
 	RDir dir;
 	TInt r = dir.Open(TheFs, dirName, KEntryAttNormal);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	
 	TEntryArray entryArray;
 	r = dir.Read(entryArray);
-	test_Value(r, r == KErrEof);
+	test (r == KErrEof);
 
 	test.Next(_L("Check the files count in the directory. Number of files in a directory is 4\n"));
 	test(entryArray.Count() == gFilesInDirectory);
@@ -4302,12 +4297,12 @@
 	test.Next(_L("Open the directory containing large file, using RDir open()\n"));
 	RDir dir;
 	TInt r = dir.Open(TheFs, dirName, KEntryAttNormal);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	
 	test.Next(_L("Read the directory entry using TEntryArray as parameter\n"));
 	TEntryArray entryArray;
 	r = dir.Read(entryArray);
-	test_Value(r, r == KErrEof);
+	test (r == KErrEof);
 	
 	test.Next(_L("Check the count\n"));
 	test(entryArray.Count() == gFilesInDirectory);
@@ -4346,7 +4341,7 @@
 	testDir0.Append(_L("F32-TEST"));
 	
 	TInt r = TheFs.MkDir(testDir0);
-	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+	test(r == KErrNone || r == KErrAlreadyExists);
 	
 	test.Next(_L("Sort with number of entries =0\n"));
 	TestRFs.GetDir(testDir0, KEntryAttMaskSupported, ESortBySize, anEntryList);
@@ -4473,13 +4468,13 @@
 	file3GB.Append(_L("File3GB.txt"));
 	
 	TInt r = TheFs.Delete(file4GBMinusOne);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = TheFs.Delete(file2GBMinusOne);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = TheFs.Delete(file2GB);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = TheFs.Delete(file3GB);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}
 	
 /**
@@ -4526,20 +4521,20 @@
 	
 	test.Next(_L("Open test file and get the file size using RFile64::Size() and set the file handle to TFileText object\n"));
 	r = file64.Replace(TheFs,fileName,EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = file64.SetSize(sizeK3GB);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	TFileText fileText;
 	fileText.Set(file64);
 	
 	test.Next(_L("Seek to the file end using TFileText::Seek()\n"));
 	r = fileText.Seek(ESeekEnd);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	test.Next(_L("Get current file position using RFile64::Seek() and verify it is at file end.\n"));
 	TInt64 pos = 0;
 	r = file64.Seek(ESeekCurrent, pos);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test(pos == sizeK3GB);
 	
 	test.Next(_L("Write data to the file using RFile64::Write\n"));
@@ -4549,7 +4544,7 @@
 	TPtrC8 bufPtr;
 	bufPtr.Set((TUint8*)record->Ptr(),record->Size()); // Size() returns length in bytes
 	r = file64.Write(pos,bufPtr);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	test.Next(_L("Read data using TFileText::Read\n"));
 	TBuf<20> fileTextReadBuf;
@@ -4559,26 +4554,26 @@
 	
 	test.Next(_L("Seek to the file end using TFileText::Seek(ESeekEnd)\n"));
 	r = fileText.Seek(ESeekEnd);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	test.Next(_L("Write known data using TFileText::Write\n"));
 	TBuf<20> fileTextWriteBuf(_L("AAAAAAAAAA"));
 	pos = 0;
 	r = file64.Seek(ESeekCurrent,pos);
 	r = fileText.Write(fileTextWriteBuf);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	test.Next(_L("Read the data using RFile64::Read\n"));
 	TBuf8<20> file64ReadBuf;
 	file64ReadBuf.Zero();
 	r = file64.Read(pos,file64ReadBuf);
 	r = bufPtr.Compare(file64ReadBuf);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	
 	file64.Close();
 	
 	r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	User::Free(record);
 	}
 
@@ -4671,7 +4666,7 @@
 	TestRFile1.Close();
 	
 	TInt r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test.End();
 	}
 
@@ -4751,13 +4746,13 @@
 	fileName1.Append(_L("File2GB.txt"));
 	RFile64 file;
 	TInt r = file.Replace(TheFs, fileName1, EFileWrite);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	file.SetSize(K2GB);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	file.Close();
 	TestRFs.ReadFileSection(fileName1,0,readBuf,100);
 	r = TheFs.Delete(fileName1);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	test.Next(_L("Creating test pattern"));
 	
 	TBuf8<0x63> writeBuf63;
@@ -4791,7 +4786,7 @@
 	TestRFile1.Close();
 	
 	r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test.End();
 	}
 
@@ -4942,7 +4937,7 @@
 	TestRFile1.Close();
 	
 	TInt r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test.End();	
 	}	
 
@@ -5081,7 +5076,7 @@
 	TestRFile1.Close();
 	
 	TInt r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test.End();	
 	}	
 
@@ -5228,7 +5223,7 @@
 	TestRFile1.Close();
 	
 	TInt r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test.End();	
 	}	
 /**
@@ -5380,7 +5375,7 @@
 		}
 	TestRFile1.Close();
 	TInt r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test.End();	
 	}	
 /**
@@ -5464,7 +5459,7 @@
 		}
 	TestRFile1.Close();
 	TInt r = TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}
 /**
 @SYMTestCaseID      PBASE-T_FILE64BIT-2354
@@ -5592,20 +5587,20 @@
 
 	test.Next(_L("Copy the files from one folder to another using CFileMan::Copy()\n"));
 	TInt r = fileMan->Copy(filePathOld, filePathNew, CFileMan::ERecurse | CFileMan::EOverWrite);
-	test_Value(r, r == KErrNone || r == KErrTooBig);
+	test(r == KErrNone || r == KErrTooBig);
 
 	test.Next(_L("Get the directory entry and find how many files are copied\n"));
 	// check SMALL and LARGE files have been copied
 	r = dir.Open(TheFs, filePathNew, KEntryAttNormal);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	r = dir.Read(entryArray);
-	test_Value(r, r == KErrEof);
+	test (r == KErrEof);
 	test(entryArray.Count() == gFilesInDirectory);
 	dir.Close();
 	
 	// then delete the new directory
 	r = fileMan->Delete(filePathNew);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	test.Next(_L("Set file man observer\n"));
 	// attempt to copy to new directory again - this time with an observer
@@ -5613,7 +5608,7 @@
 	
 	test.Next(_L("Copy the files from one folder to another, source folder has 3 small files and a large file\n"));
 	r = fileMan->Copy(filePathOld, filePathNew, CFileMan::ERecurse | CFileMan::EOverWrite);
-	test_Value(r, r == KErrNone || r == KErrTooBig);
+	test(r == KErrNone || r == KErrTooBig);
 	
 	test.Next(_L("Check observer for number of successful copy and failed copy\n"));
 	// test that 3 small files and 1 large file were copied
@@ -5624,28 +5619,28 @@
 	test.Next(_L("Get the directory entry and find how many files copied\n"));
 	// check SMALL files have been copied
 	r = dir.Open(TheFs, filePathNew, KEntryAttNormal);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	r = dir.Read(entryArray);
-	test_Value(r, r == KErrEof);
+	test (r == KErrEof);
 
 	test(entryArray.Count() == gFilesInDirectory); 
 	dir.Close();
 	
 	// then delete the new directory
 	r = fileMan->Delete(filePathNew);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	delete observer;
 	delete fileMan;
 	
 	r = TheFs.Delete(fileSmall1);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = TheFs.Delete(fileSmall2);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = TheFs.Delete(fileSmall3);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = TheFs.Delete(fileLarge1);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}
 /**
 @SYMTestCaseID      PBASE-T_FILE64BIT-2355
@@ -5723,21 +5718,21 @@
 
 	// move to new directory
 	TInt r = fileMan->Move(filePathOld, filePathNew, CFileMan::ERecurse | CFileMan::EOverWrite);
-	test_Value(r, r == KErrNone || r == KErrTooBig);
+	test(r == KErrNone || r == KErrTooBig);
 
 	// check SMALL and LARGE files have been moved
 	RDir dir;
 	r = dir.Open(TheFs, filePathNew, KEntryAttNormal);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	TEntryArray entryArray;
 	r = dir.Read(entryArray);
-	test_Value(r, r == KErrEof);
+	test (r == KErrEof);
 	test(entryArray.Count() == 4);
 	dir.Close();
 	
 	// then delete the new directory
 	r = fileMan->Delete(filePathNew);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	delete fileMan;
 	}
 
@@ -5761,13 +5756,13 @@
 	TInt r;
 	RFs fs;
 	r = fs.Connect();
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = fs.ShareProtected();
-	test_KErrNone(r);
+	test(r == KErrNone);
 	TFileName sessionp;
 	fs.SessionPath(sessionp);
 	r = fs.MkDirAll(sessionp);
-	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+	test(r == KErrNone || r == KErrAlreadyExists);
 	fs.Close();
 	TestRFile64AdoptFromCreator();
 	TestRFile64AdoptFromClient();
@@ -5907,11 +5902,11 @@
 	
 	// If a zero length is passed into the Write function, KErrNone should be returned. 
 	r=aFile.Write(aPos,gBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	// If the length is a negative, KErrArgument should be returned. 
 	r=aFile.Write(aPos,gBuf,aLen);
-	test_Value(r, r == KErrArgument);
+	test(r==KErrArgument);
 	
 	// Test the asynchronous requests
 	aFile.Write(aPos,gBuf,aLen,status1);
@@ -5923,7 +5918,7 @@
 	
 	aFile.Close();
 	r = TheFs.Delete(_L("\\testRFile64NegLen.txt"));
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test.End();	
 	}
 //-------------------------------------------------------------------------------------------------------------------
@@ -5961,11 +5956,9 @@
         {
         KFileSizeMaxLargerThan4GBMinusOne = EFalse; //-- FAT doesn't support >= 4G files
         }
-    else if(Is_SimulatedSystemDrive(TheFs, aDrive))
-        {
-		 //-- This is the emulator's windows drive or PlatSim's HVFS.
-		 //-- The maximal file size depends on the Windows FS used for this drive.
-         //-- If it is NTFS, files >= 4G are supported.
+    else if(Is_Win32(TheFs, aDrive))
+        {//-- this is the emulator's windows drive. The maximal file size depends on the Windows FS used for this drive.
+         //-- if it is NTFS, files >= 4G are supported.   
         r = CreateEmptyFile(TheFs, _L("\\test_file"), K4GB);
         
         KFileSizeMaxLargerThan4GBMinusOne = (r == KErrNone);
@@ -5987,7 +5980,7 @@
 	{
 	TInt r;
 	r = RFs::CharToDrive(gDriveToTest, gDrive);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
     //-- set up console output 
     F32_Test_Utils::SetConsole(test.Console()); 
@@ -6036,7 +6029,7 @@
 	dirName.Append(gDriveToTest);
 	dirName.Append(KTestPath);
 	r = TheFs.RmDir(dirName);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	}
 
 
--- a/kerneltest/f32test/server/t_filecache.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_filecache.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -22,7 +22,6 @@
 #include "t_server.h"
 #include <e32twin.h>
 #include <e32rom.h>
-#include <u32hal.h>
 
 
 //----------------------------------------------------------------------------------------------
@@ -115,7 +114,7 @@
 void PrintFileCacheConfig(TFileCacheConfig& aFileCacheConfig, TBool aDisplay = ETrue)
 	{
 	TInt r = controlIo(TheFs,gDrive, KControlIoFileCacheConfig, aFileCacheConfig);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	if (!aDisplay)
 		return;
 	
@@ -251,108 +250,6 @@
 		}
 	}
 
-TInt FreeRam()
-	{
-	// wait for any async cleanup in the supervisor to finish first...
-	UserSvr::HalFunction(EHalGroupKernel, EKernelHalSupervisorBarrier, 0, 0);
-
-	TMemoryInfoV1Buf meminfo;
-	UserHal::MemoryInfo(meminfo);
-	return meminfo().iFreeRamInBytes;
-	}
-
-void LowMemoryTest()
-	{
-	TInt fileSize = 0;
-	
-	const TInt KWriteLen = 128*1024;
-	test.Next(_L("Test appending to a file with low memory"));
-	gBufPtr.SetLength(KBufSize);
-
-	RFile f;
-	TFileName testFile   = _L("TEST.BIN");
-
-	TInt r = f.Replace(TheFs, testFile, EFileWrite | EFileWriteBuffered);
-	test_KErrNone(r);
-
-	TInt pos = 0;
-
-	TPtrC8 writePtr;
-	writePtr.Set(gBufPtr.MidTPtr(pos, KWriteLen));
-
-	r = f.Write(pos, writePtr);
-	test_KErrNone(r);
-	pos+= writePtr.Length();
-
-	r = f.Size(fileSize);
-	test_KErrNone(r);
-	test_Equal(fileSize,pos);
-
-
-
-	TUint freeRam = FreeRam();
-	const TInt KPageSize=4096;
-	freeRam = (freeRam + KPageSize -1) & ~(KPageSize-1);
-	test.Printf(_L("FreeRam = %d"), freeRam);
-
-	RChunk chunk;
-	TChunkCreateInfo chunkInfo;
-	chunkInfo.SetDisconnected(0, 0, freeRam);
-	chunkInfo.SetPaging(TChunkCreateInfo::EUnpaged);
-	test_KErrNone(chunk.Create(chunkInfo));
-
-	test.Printf(_L("Gobbling all of memory..."));
-	
-	TUint commitEnd;
-	for (commitEnd = 0; commitEnd < freeRam; commitEnd += KPageSize) 
-		{
-		r = chunk.Commit(commitEnd,KPageSize);
-		if (r != KErrNone)
-			break;
-		
-		}
-	test.Printf(_L("commitEnd %d, r %d"), commitEnd, r);
-	test_Value(r, r == KErrNoMemory || r == KErrNone);
-
-	test.Printf(_L("FreeRam = %d"), FreeRam());
-
-	pos-= KSegmentSize;
-	writePtr.Set(gBufPtr.MidTPtr(pos, KWriteLen));
-
-	test.Printf(_L("Writing to file..."));
-
-	// now we have gobbled all or most of memory, the next write can fail
-	// if it does keep decommitting memory until it succeeds and then test that the file size is correct
-	commitEnd = 0;
-	do {
-
-		r = f.Write(pos, writePtr);
-		test_Value(r, r == KErrNoMemory || r == KErrNone);
-		if (r == KErrNoMemory)
-			{
-			chunk.Decommit(commitEnd,KPageSize);
-			commitEnd += KPageSize;
-			}
-		}
-	while (r == KErrNoMemory);
-
-	pos+= writePtr.Length();
-
-	test.Printf(_L("Gsetting size of file ..."));
-	r = f.Size(fileSize);
-	test_KErrNone(r);
-	test_Equal(fileSize,pos);
-
-	test.Printf(_L("Closing file ..."));
-	f.Close();
-
-	test.Printf(_L("Closing chunk ..."));
-	chunk.Close();
-
-	test.Printf(_L("FreeRam = %d"), FreeRam());
-	}
-
-
 
 LOCAL_C void UnitTests()
 //
@@ -374,7 +271,7 @@
 	TBool simulatelockFailureMode;
 	TFileCacheStats fileCacheStats;
 	r = controlIo(TheFs, gDrive, KControlIoFileCacheStats, fileCacheStats);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	test.Printf(_L("Number of files on closed queue=%d\n"),fileCacheStats.iFilesOnClosedQueue);
 	test(fileCacheStats.iFilesOnClosedQueue == 0);
 #endif
@@ -383,7 +280,7 @@
 	// turn OFF lock failure mode 
 	simulatelockFailureMode = EFalse;
 	r = controlIo(TheFs, gDrive, KControlIoSimulateLockFailureMode, simulatelockFailureMode);
-	test_KErrNone(r);
+	test (r == KErrNone);
 #endif
 
 	TFileName testFile   = _L("TEST.BIN");
@@ -402,8 +299,6 @@
 	TInt uncachedPacketsRead;
 #endif
 
-	LowMemoryTest();
-
 	// create an empty file, so that any writes overlapping segemt boundaries
 	// need a read first
 	// create a test file using directIO and then re-open it in buffered mode, 
@@ -562,9 +457,6 @@
 	r = f.Replace(TheFs, testFile, EFileReadBuffered | EFileWrite | EFileWriteBuffered);
 	test_KErrNone(r);
 
-	r = f.SetSize(gFileCacheConfig.iCacheSize);
-	test_KErrNone(r);
-
 	RTimer timer;
 	timer.CreateLocal();
 	TRequestStatus reqStat;
@@ -726,7 +618,7 @@
 
 	TInt size;
 	r = f.Size(size);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	test (size = KBufSize);
 
 	readPtr.Set(gBuf->Des());
@@ -735,7 +627,7 @@
 	// Allocate full cachelines - so we can enable hole testing
 	TBool allocateAllSegmentsInCacheLine = ETrue;
 	r = controlIo(TheFs, gDrive, KControlIoAllocateMaxSegments, allocateAllSegmentsInCacheLine);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	PrintFileCacheStats(fileCacheStats, EFalse);
 	TInt holesDetected = fileCacheStats.iHoleCount;
 	TInt lockFailures = fileCacheStats.iCommitFailureCount + fileCacheStats.iLockFailureCount;
@@ -820,7 +712,7 @@
 	// Don't allocate full cachelines any more
 	allocateAllSegmentsInCacheLine = EFalse;
 	r = controlIo(TheFs, gDrive, KControlIoAllocateMaxSegments, allocateAllSegmentsInCacheLine);
-	test_KErrNone(r);
+	test (r == KErrNone);
 #endif
 
 
@@ -920,7 +812,7 @@
 
 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
 	r = controlIo(TheFs, gDrive, KControlIoFileCacheStats, fileCacheStats);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	test.Printf(_L("Number of files on closed queue=%d\n"),fileCacheStats.iFilesOnClosedQueue);
 	test(fileCacheStats.iFilesOnClosedQueue == 1);
 #endif
@@ -954,7 +846,7 @@
 
 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
 		r = controlIo(TheFs, gDrive, KControlIoFileCacheStats, fileCacheStats);
-		test_KErrNone(r);
+		test (r == KErrNone);
 		test.Printf(_L("Number of files on closed queue=%d\n"),fileCacheStats.iFilesOnClosedQueue);
 		test(fileCacheStats.iFilesOnClosedQueue == 0);
 #endif
@@ -965,7 +857,7 @@
 
 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
 		r = controlIo(TheFs, gDrive, KControlIoFileCacheStats, fileCacheStats);
-		test_KErrNone(r);
+		test (r == KErrNone);
 		test.Printf(_L("Number of files on closed queue=%d\n"),fileCacheStats.iFilesOnClosedQueue);
 		test(fileCacheStats.iFilesOnClosedQueue == 1);
 #endif
@@ -994,7 +886,7 @@
 
 	#if defined(_DEBUG) || defined(_DEBUG_RELEASE)
 		r = controlIo(TheFs, gDrive, KControlIoFileCacheStats, fileCacheStats);
-		test_KErrNone(r);
+		test (r == KErrNone);
 		test.Printf(_L("Number of files on closed queue=%d\n"),fileCacheStats.iFilesOnClosedQueue);
 		test(fileCacheStats.iFilesOnClosedQueue == 0);
 	#endif
@@ -1004,7 +896,7 @@
 	// turn lock failure mode back ON (if enabled)
 	simulatelockFailureMode = ETrue;
 	r = controlIo(TheFs, gDrive, KControlIoSimulateLockFailureMode, simulatelockFailureMode);
-	test_KErrNone(r);
+	test (r == KErrNone);
 #endif
 
 	//**************************************************************
@@ -1030,7 +922,7 @@
 
 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
 	r = controlIo(TheFs, gDrive, KControlIoFileCacheStats, fileCacheStats);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	test.Printf(_L("Number of Write-throughs with dirty data=%d\n"),fileCacheStats.iWriteThroughWithDirtyDataCount);
 	TInt writeThroughWithDirtyDataCountOld = fileCacheStats.iWriteThroughWithDirtyDataCount;
 	TInt writeThroughWithDirtyDataCountNew = writeThroughWithDirtyDataCountOld;
@@ -1041,7 +933,7 @@
 		{
 		fileSize = 0;
 		r = f.SetSize(fileSize);
-		test_KErrNone(r);
+		test (r == KErrNone);
 		for (pos = 0; pos < KMaxFileSize; )
 			{
 			r = f.Write(pos, writePtr);
@@ -1052,11 +944,11 @@
 				test.Printf(_L("Flush returned %d"), r);
 				test(0);
 				}
-			test_KErrNone(r);
+			test(r == KErrNone);
 			pos+= writePtr.Length();
 
 			r = f.Size(fileSize);
-			test_KErrNone(r);
+			test (r == KErrNone);
 			if (fileSize != pos)
 				{
 				test.Printf(_L("Iter #%d, write pos %d != size %d"), i, pos, fileSize);
@@ -1068,7 +960,7 @@
 
 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
 			r = controlIo(TheFs, gDrive, KControlIoFileCacheStats, fileCacheStats);
-			test_KErrNone(r);
+			test (r == KErrNone);
 			writeThroughWithDirtyDataCountNew = fileCacheStats.iWriteThroughWithDirtyDataCount;
 			if (writeThroughWithDirtyDataCountNew > writeThroughWithDirtyDataCountOld)
 				{
@@ -1106,9 +998,9 @@
 
 	RFs fs;
 	TInt r = fs.Connect();
-	test_KErrNone(r);
+	test (r==KErrNone);
 	r = fs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test (r==KErrNone);
 
 
 	RFile file;
@@ -1344,7 +1236,7 @@
 
 	RFile file;
 	TInt r = file.Replace(TheFs,_L("WRITETST"),EFileStream | aFileMode);
-	test_KErrNone(r);
+	test (r == KErrNone);
 
 	TTime startTime;
 	TTime endTime;
@@ -1708,7 +1600,7 @@
 
 	TVolumeInfo volInfo;
 	TInt r = TheFs.Volume(volInfo, gDrive);
-	test_KErrNone(r);
+	test (r == KErrNone);
 
 	TFullName extName;
 	r = TheFs.ExtensionName(extName,gDrive, 0);
@@ -1743,7 +1635,7 @@
 		// turn OFF lock failure mode
 		TBool simulatelockFailureMode = EFalse;
 		r = controlIo(TheFs, gDrive, KControlIoSimulateLockFailureMode, simulatelockFailureMode);
-		test_KErrNone(r);
+		test (r == KErrNone);
 #endif
 
 		TestFileRead(EFileReadDirectIO);
@@ -1763,7 +1655,7 @@
 		// turn lock failure mode back ON (if enabled)
 		simulatelockFailureMode = ETrue;
 		r = controlIo(TheFs, gDrive, KControlIoSimulateLockFailureMode, simulatelockFailureMode);
-		test_KErrNone(r);
+		test (r == KErrNone);
 #endif
 		}	// if (gRunPerformanceTests)
 
@@ -1887,7 +1779,7 @@
 		{
 		test.Printf(_L("Writing DriveCacheFlags for drive %C = %08X\n"), (TInt) gDriveToTest, gDriveCacheFlags);
 		r = controlIo(TheFs,gDrive, KControlIoFileCacheFlagsWrite, gDriveCacheFlags);
-		test_KErrNone(r);
+		test (r == KErrNone);
 		}
 #endif
 
--- a/kerneltest/f32test/server/t_findcapall.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_findcapall.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -20,7 +20,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <e32test.h>
 #include <f32file.h>
 
@@ -48,7 +47,7 @@
 	
 	Err=FileServer.Connect();
 	
-	test_KErrNone(Err);
+	test(Err==KErrNone);
 	
     // RTest.Next is called from function "TestFind()".
     // RTest.Start is called here to start the test.
@@ -65,7 +64,7 @@
 			     _L("z:\\sys\\bin\\"),
 			     _L("nonexistingfile.txt"));
 	
-	test_Value(Err, Err == KErrNotFound);
+	test(Err==KErrNotFound);
 	
 	// Test: Find existing file in existing /sys folder
 	//
@@ -78,7 +77,7 @@
 			     _L("z:\\sys\\bin\\"),
 			     _L("t_findcaptestfile.txt"));
 	
-	test_KErrNone(Err);
+	test(Err==KErrNone);
 	
 	// Test: Find non existing file in existing / non existing /sys folder
 	//
@@ -91,7 +90,7 @@
 			     _L("c:\\sys\\"),
 			     _L("nonexisting.txt"));
 	
-	test_Value(Err, Err == KErrNotFound);
+	test(Err==KErrNotFound);
 	
 	// Test: Find existing file in /sys folder without specifying the path
 	//
@@ -104,7 +103,7 @@
 			     _L("\\sys\\bin\\"),
 			     _L("t_findcaptestfile.txt"));
 	
-	test_KErrNone(Err);
+	test(Err==KErrNone);
 	
 	// Test: Find non existing file in /sys folder without specifying the path
 	//
@@ -117,7 +116,7 @@
 			     _L("\\sys\\"),
 			     _L("nonexisting.txt"));
 	
-	test_Value(Err, Err == KErrNotFound);
+	test(Err==KErrNotFound);
 	
 	FileServer.Close();
 	
--- a/kerneltest/f32test/server/t_findcapnone.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_findcapnone.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -22,7 +22,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <e32test.h>
 #include <f32file.h>
 
@@ -50,7 +49,7 @@
 	
 	Err=FileServer.Connect();
 	
-	test_KErrNone(Err);
+	test(Err==KErrNone);
     
     // RTest.Next is called from function "TestFind()".
     // RTest.Start is called here to start the test.
@@ -67,7 +66,7 @@
 		         _L("z:\\sys\\bin\\"),
 		         _L("nonexistingfile.txt"));
 	
-	test_Value(Err, Err == KErrPermissionDenied);
+	test(Err==KErrPermissionDenied);
 	
 	// Test: Find existing file in existing /sys folder
 	//
@@ -80,7 +79,7 @@
 		         _L("z:\\sys\\bin\\"),
 		         _L("t_findcaptestfile.txt"));
 	
-	test_Value(Err, Err == KErrPermissionDenied);
+	test(Err==KErrPermissionDenied);
 	
 	// Test: Find non existing file in existing / non existing /sys folder
 	//
@@ -93,7 +92,7 @@
 		         _L("c:\\sys\\"),
 		         _L("nonexisting.txt"));
 	
-	test_Value(Err, Err == KErrPermissionDenied);
+	test(Err==KErrPermissionDenied);
 	
 	// Test: Find existing file in /sys folder without specifying the path
 	//
@@ -106,7 +105,7 @@
 		         _L("\\sys\\bin\\"),
 		         _L("t_findcaptestfile.txt"));
 	
-	test_Value(Err, Err == KErrPermissionDenied);
+	test(Err==KErrPermissionDenied);
 	
 	// Test: Find non existing file in /sys folder without specifying the path
 	//
@@ -119,7 +118,7 @@
 		         _L("\\sys\\"),
 		         _L("nonexisting.txt"));
 	
-	test_Value(Err, Err == KErrPermissionDenied);
+	test(Err==KErrPermissionDenied);
 	
 	FileServer.Close();
 	
--- a/kerneltest/f32test/server/t_fman.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_fman.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -53,7 +53,6 @@
 // Called back after each FMan tick
 //
 	{
-    (void) MFileManObserver::NotifyFileManEnded();
 	TInt lastError=iFileMan->GetLastError();
 	if (lastError!=KErrNone && lastError!=KErrBadName)
 		{
@@ -3109,6 +3108,7 @@
 	CFileMan* iFileMan;
 	};
 
+
 CFileManObserverOverWrite::CFileManObserverOverWrite(CFileMan* aFileMan)
 //
 // Constructor
@@ -3137,59 +3137,6 @@
 	return(MFileManObserver::EContinue);
 	}
 
-class CFileManObserverBytesCopied : public CBase, public MFileManObserver
-    {
-public:
-    CFileManObserverBytesCopied(CFileMan* aFileMan);
-    TControl NotifyFileManEnded();
-    TControl NotifyFileManOperation();
-    TInt iBytesToBeCopied;
-private:
-    CFileMan* iFileMan;
-    TInt iBytesCopied;
-    };
-
-CFileManObserverBytesCopied::CFileManObserverBytesCopied(CFileMan* aFileMan)
-//
-// Constructor
-//
-    {
-    __DECLARE_NAME(_S("CFileManObserverBytesCopied"));
-    iFileMan=aFileMan;
-    iBytesCopied=0;
-    }
-
-MFileManObserver::TControl CFileManObserverBytesCopied::NotifyFileManOperation()
-//
-// Observer for testBytesCopied tests
-//
-    {
-    TFileName target;
-    iFileMan->GetCurrentTarget(target);
-    TInt match = target.MatchF(_L("?:\\bytesTransferred"));
-    if(match != 0)
-        {
-        RDebug::Print(_L("CFileManObserverBytesCopied::NotifyFileManOperation - target %s, match %d"),target.PtrZ(),match);
-        return MFileManObserver::EAbort;
-        }
-    
-    iBytesCopied += iFileMan->BytesTransferredByCopyStep();
-    return(MFileManObserver::EContinue);
-    }
-
-MFileManObserver::TControl CFileManObserverBytesCopied::NotifyFileManEnded()
-//
-// Observer for testBytesCopied  tests
-//
-    {
-    if(iBytesCopied!=iBytesToBeCopied)
-        return (MFileManObserver::EAbort);
-    
-    return(MFileManObserver::EContinue);
-    }
-
-
-
 LOCAL_C void TestOverWrite()
 //
 // Test overwrite for copy and rename
@@ -3979,7 +3926,7 @@
 	MakeDir(_L("C:\\F32-TST\\TFMAN\\DRIVEMOVE\\"));
 	TInt r=gFileMan->Move(_L("C:\\F32-TST\\TFMAN\\DRIVEMOVE\\*"),trgDrive,CFileMan::ERecurse);
 	test.Printf(_L("TestMoveEmptyDirectory(),gFileMan->Move(),r=%d\n"),r);
-	test_Value(r, r == KErrNotFound);
+	test (r==KErrNotFound);
 	}
 
 LOCAL_C void TestCopyAndRename()
@@ -4359,79 +4306,6 @@
 	RmDir(_L("C:\\TestDEF130678\\"));	
 	}
 
-void TestBytesTransferredByCopyStep()
-    {
-    //
-    // Test BytesCopied
-    //
-    test.Next(_L("TestBytesTransferredByCopyStep"));
-    (void)gFileMan->Delete(_L("\\bytesTransferred"));
-    
-    RFile tempFile;
-    TFileName tempname;
-    TInt r = tempFile.Temp(TheFs,_L("\\"),tempname,EFileWrite);
-    test_KErrNone(r);
-    r = tempFile.SetSize(50);
-    test_KErrNone(r);
-    tempFile.Flush();
-    tempFile.Close();
-
-    CFileManObserverBytesCopied* fManObserver=new(ELeave) CFileManObserverBytesCopied(gFileMan);
-    CleanupStack::PushL(fManObserver);
-    gFileMan->SetObserver(fManObserver);
-    fManObserver->iBytesToBeCopied=50;
-    
-    if (!gAsynch)
-        {
-        r=gFileMan->Copy(tempname,_L("\\bytesTransferred"),CFileMan::EOverWrite);
-        test_KErrNone(r);
-        }
-    else
-        {
-        TInt r=gFileMan->Copy(tempname,_L("\\bytesTransferred"),CFileMan::EOverWrite,gStat);
-        test_KErrNone(r);
-        WaitForSuccess();
-        }
-    
-    (void)gFileMan->Delete(_L("\\bytesTransferred"));
-    (void)TheFs.Delete(tempname);
-    CleanupStack::PopAndDestroy();
-    }
-
-void TestGetMoreErrorInfo()
-    {
-    //
-     // Test GetMoreErrorInfo
-     //
-     test.Next(_L("TestGetMoreErrorInfo"));
-
-     CFileManObserver* fManObserver=new(ELeave) CFileManObserver(gFileMan);
-     CleanupStack::PushL(fManObserver);
-     gFileMan->SetObserver(fManObserver);
-     
-     if (!gAsynch)
-         {
-         TInt r=gFileMan->Copy(_L("\\SRC"),_L("\\TRG"),0);
-         if(r!=KErrNone) //correct behaviour
-             {
-             TFileManError error = gFileMan->GetMoreInfoAboutError();
-             test_Equal((TFileManError)ENoFilesProcessed,error);
-             }
-         else { test_Equal(!KErrNone,r); }
-         }
-     else
-         {
-         TInt r=gFileMan->Copy(_L("\\SRC"),_L("\\TRG"),0,gStat);
-         if(r!=KErrNone) //correct behaviour
-             {
-             TFileManError error = gFileMan->GetMoreInfoAboutError();
-             test_Equal((TFileManError)ENoFilesProcessed,error);
-             }
-         else { test_Equal(!KErrNone,r); }
-         }
-    CleanupStack::PopAndDestroy();
-    }
-
 GLDEF_C void CallTestsL()
 //
 // Do tests
@@ -4527,8 +4401,6 @@
 	TestCopyAllCancel();
 	
 	TestDEF130678(); // Test CFileMan::Move does not leak any memory
-	TestBytesTransferredByCopyStep();
-	TestGetMoreErrorInfo();
 #ifndef __WINS__
 	RThread t;
 	TThreadStackInfo stack;
@@ -4536,7 +4408,6 @@
 	TestStackUsage(0, stack);
 #endif
 
-	
 	Cleanup();
 	DeleteTestDirectory();
 	test_KErrNone(TheFs.RmDir(_L("\\F32-TST\\")));
--- a/kerneltest/f32test/server/t_fname.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_fname.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <e32test.h>
 #include <f32dbg.h>
 #include <e32debug.h>
@@ -34,7 +33,7 @@
 	path[0] = xfn[0];
 	RLibrary lib;
 	TInt r=lib.Load(_L("t_start1.dll"), path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TFileName name;
 	name=lib.FileName();
 	path += _L("t_start1.dll");
--- a/kerneltest/f32test/server/t_fnames.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_fnames.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include "t_server.h"
@@ -46,7 +45,7 @@
 	TBuf<32> badName=_L("\\< > : \" / |");
 	TParse parser;
 	TInt r=parser.Set(aName,NULL,NULL);
-	test_Value(r, r == KErrNone || r==anError);
+	test(r==KErrNone || r==anError);
 	goodName.Insert(0,parser.Drive());
 	badName.Insert(0,parser.Drive());
 	
@@ -168,7 +167,7 @@
     //-- TParse shall work correctly
     TParse parse;
     TInt err = parse.Set(dirName,NULL,NULL);
-    test_KErrNone(err);
+    test( err == KErrNone );
     
     //-- try to access a directory with a long name. This just shall not panic.
     //-- The return code can be any, on the emulator it's very likely to be KErrBadname
@@ -192,7 +191,7 @@
     //-- create a dir c:\a
     _LIT(dirName, "C:\\a\\");
     TInt err = rfs.MkDir(dirName);
-    test_Value(err, err == KErrNone || err == KErrAlreadyExists);
+    test(err == KErrNone || err == KErrAlreadyExists);
     
     if(err == KErrAlreadyExists)
         bDirExisted = ETrue;
@@ -203,7 +202,7 @@
     
     //-- try to create a directory with a very long name, checking that it doesn't get truncated to the "c:\a"
     err = rfs.MkDir(longDirName);
-    test_Value(err, err == KErrBadName);
+    test(err == KErrBadName);
 
     //-- clean up, remove created directory, otherwise some ill-designed tests can fail
     if(!bDirExisted)
--- a/kerneltest/f32test/server/t_format.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_format.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -40,7 +40,7 @@
 	RFormat format;
 	TInt count;
 	TInt r=format.Open(TheFs,b,EHighDensity,count);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	format.Close();
 	}
 
@@ -96,9 +96,9 @@
 
 	RFs fs;
 	TInt ret=fs.Connect();
-	test_KErrNone(ret);
+	test(ret==KErrNone);
 	ret=fs.SetSessionPath(gSessionPath);
-	test_KErrNone(ret);
+	test(ret==KErrNone);
 	TTestCode testCode=*(TTestCode*)&aTestCode;
 	TInt count;
 	RFormat format;
@@ -107,10 +107,10 @@
 		case ETest3:
 			{
 			ret=format.Open(fs,gSessionPath,EQuickFormat,count);
-			test_KErrNone(ret);
+			test(ret==KErrNone);
 			
             ret = DoFormatSteps(format, count);
-            test_KErrNone(ret);
+            test(ret==KErrNone);
 	
             format.Close();
 			break;
@@ -118,7 +118,7 @@
 		case ETest5:
 			{
 			ret=format.Open(fs,gSessionPath,EFullFormat,count);
-			test_KErrNone(ret);
+			test(ret==KErrNone);
 			gSleepThread.Signal();
 			User::After(100000000);		
 			break;
@@ -139,7 +139,7 @@
     
 	RRawDisk raw;
 	TInt r=raw.Open(TheFs,CurrentDrive());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	if (!Is_Lffs(TheFs, gDrive))
 		{
 		TBuf8<KSectorSize> zeroBuf(KSectorSize);
@@ -151,7 +151,7 @@
         for(TInt i=0; i<KMaxSectors; ++i)
             {
             r=raw.Write(i*KSectorSize, zeroBuf);
-		    test_KErrNone(r);
+		    test(r==KErrNone);
             }
 		}
 	else
@@ -174,7 +174,7 @@
 				// aligned 32-byte blocks, we don't need to bother that much.
 				// The device driver writes the block but fails when reading
 				// it back.
-				// test_KErrNone(r);
+				// test(r==KErrNone);
 				}
 			}
 		else if(cntlModeSize>0)
@@ -238,16 +238,16 @@
 	RFormat format;
 
 	TInt r=format.Open(TheFs,gSessionPath,EFullFormat,count);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
     r = DoFormatSteps(format, count);
-    test_KErrNone(r);
+    test(r==KErrNone);
 
 	format.Close();
 	
 	TVolumeInfo volInfo;
 	r=TheFs.Volume(volInfo);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	if (volInfo.iSize-volInfo.iFree!=0)
 		{
@@ -258,15 +258,15 @@
 		
 	test.Next(_L("Test EQuickFormat"));
 	r=format.Open(TheFs,gSessionPath,EQuickFormat,count);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
     r = DoFormatSteps(format, count);
-    test_KErrNone(r);
+    test(r==KErrNone);
 
 	format.Close();
 
 	r=TheFs.Volume(volInfo);
-	test_KErrNone(r);
+	test(r==KErrNone);
 		
 	if (volInfo.iSize-volInfo.iFree!=0)
 		{
@@ -288,16 +288,16 @@
 	test.Next(_L("Test disk cannot be formatted while a file is open"));
 	RFile f;
 	TInt r=f.Replace(TheFs,_L("BLARGME.BLARG"),EFileStream);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TInt count;
 	RFormat format;
 	r=format.Open(TheFs,gSessionPath,EFullFormat,count);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 
 	f.Close();
 	r=format.Open(TheFs,gSessionPath,EFullFormat,count);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	format.Close();
 
 	CheckFileExists(_L("BLARGME.BLARG"),KErrNone);
@@ -318,7 +318,7 @@
 	RThread clientThread;
 	TInt r=clientThread.Create(_L("ClientThread"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest3);
 	test.Printf(_L("Created helper thread #1, res=%d\n"),r);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	clientThread.Logon(gThreadLogon);
 	clientThread.Resume();
@@ -336,7 +336,7 @@
 	TheFs.NotifyChange(ENotifyAll,reqStat);
 	r=clientThread.Create(_L("ClientThread"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest3);
     test.Printf(_L("Created helper thread #2, res=%d\n"),r);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 
 	clientThread.Logon(gThreadLogon);
@@ -375,15 +375,15 @@
 
 	RFormat format;
 	TInt r=format.Open(TheFs,gSessionPath,EFullFormat,count);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	while(count)
 		{
 		RDir dir;
 		r=dir.Open(TheFs,_L("\\*.*"),KEntryAttNormal);
-		test_Value(r, r == KErrInUse);
+		test(r==KErrInUse);
 		r=format.Next(count);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	format.Close();
 
@@ -418,7 +418,7 @@
 	RThread clientThread;
 	TInt r=clientThread.Create(_L("ClientThread"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
 	test.Printf(_L("Created helper thread #1, res=%d\n"),r);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
     test.Printf(_L("Panicing formatting thread #1\n"));	
 	clientThread.Resume();
@@ -438,7 +438,7 @@
 //	}
 //	else
 //	{
-	test_Value(r, r == KErrCorrupt);
+	test(r==KErrCorrupt);
 //	}
 
     test.Printf(_L("Formatting the drive...\n"));	
@@ -446,10 +446,10 @@
 	TInt count;
 	RFormat format;
 	r=format.Open(TheFs,gSessionPath,EQuickFormat,count);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
     r = DoFormatSteps(format, count);
-    test_KErrNone(r);
+    test(r==KErrNone);
 	
     format.Close();
 
@@ -469,51 +469,51 @@
 	test.Next(_L("Test ramdrive shrinks after formatting"));
 	TVolumeInfo volInfo;
 	TInt r=TheFs.Volume(volInfo);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	if ((volInfo.iDrive.iMediaAtt&KMediaAttVariableSize)==0)
 		return;
 
 	TInt64 used=volInfo.iSize-volInfo.iFree;
 	RFile f;
 	r=f.Replace(TheFs,_L("BIGFILE.SIZE"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.SetSize(0x100000); // 1MB
 	f.Close();
 
 	r=TheFs.Volume(volInfo);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt64 used2=volInfo.iSize-volInfo.iFree;
 	test(used<used2);
 
 	r=TheFs.Delete(_L("BIGFILE.SIZE"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Volume(volInfo);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	used2=volInfo.iSize-volInfo.iFree;
 	test(used==used2);
 
 	r=f.Replace(TheFs,_L("BIGFILE.SIZE"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.SetSize(0x100000); // 1MB
 	f.Close();
 
 	r=TheFs.Volume(volInfo);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	used2=volInfo.iSize-volInfo.iFree;
 	test(used<used2);
 
 	TInt count;
 	RFormat format;
 	r=format.Open(TheFs,gSessionPath,EQuickFormat,count);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
     r = DoFormatSteps(format, count);
-    test_KErrNone(r);
+    test(r==KErrNone);
 	
     format.Close();
 
 	r=TheFs.Volume(volInfo);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	used2=volInfo.iSize-volInfo.iFree;
 	test(used>=used2);
 	}
@@ -535,7 +535,7 @@
 	
     TVolumeInfo volInfo;
 	TInt r=TheFs.Volume(volInfo);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
     if (volInfo.iDrive.iMediaAtt&KMediaAttVariableSize)
 		return; // Don't bother on internal disk
@@ -550,10 +550,10 @@
 	TInt count;
 	RFormat format;
 	r=format.Open(TheFs,gSessionPath,EQuickFormat,count);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
     r = DoFormatSteps(format, count);
-    test_KErrNone(r);
+    test(r==KErrNone);
 
 	format.Close();
 	}
@@ -585,33 +585,33 @@
 	
     TVolumeInfo volInfo;
 	TInt r=TheFs.Volume(volInfo);
-//	test_Value(r, r == KErrCorrupt);
+//	test(r==KErrCorrupt);
 	TInt count;
 	RFormat format;
 	r=format.Open(TheFs,gSessionPath,EQuickFormat,count);
 	r=TheFs.Volume(volInfo);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=format.Next(count);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TDriveList driveList;
 	r=TheFs.DriveList(driveList);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
     if(gDrive == EDriveC)
     {
 		r=TheFs.Volume(volInfo, gDrive);
-		test_Value(r, r == KErrInUse);
+		test(r==KErrInUse);
     } 
     else
     {
 		r=TheFs.Volume(volInfo,EDriveC);
-		test_KErrNone(r);
+		test(r==KErrNone);
 
 		r=TheFs.Volume(volInfo,gDrive);	
-		test_Value(r, r == KErrInUse);
+		test(r==KErrInUse);
 
     	r=TheFs.Volume(volInfo,gDrive);	
-		test_Value(r, r == KErrInUse);
+		test(r==KErrInUse);
     }
 
     
@@ -664,7 +664,7 @@
     fmtMode = EQuickFormat;
 
     nRes = format.Open(TheFs, drivePath, fmtMode, fmtCnt);
-    test_Value(nRes, nRes == KErrInUse);
+    test(nRes == KErrInUse);
     format.Close();
 
     buf8.SetLength(22);
@@ -679,7 +679,7 @@
 
     fmtMode = EQuickFormat;
     nRes = format.Open(TheFs, drivePath, fmtMode, fmtCnt);
-    test_Value(nRes, nRes == KErrInUse);
+    test(nRes == KErrInUse);
     format.Close();
 
     dir.Close();
@@ -695,9 +695,9 @@
     test_KErrNone(nRes);
 
     //-- this will mark the current Mount as "Dismounted" and will instantiate another CMountCB for formatting
-    fmtMode = EQuickFormat | EForceFormat;
+    fmtMode = EQuickFormat | EForceFormat; 
 
-    nRes = format.Open(TheFs, drivePath, fmtMode, fmtCnt);
+    nRes = format.Open(TheFs, drivePath, fmtMode, fmtCnt); 
     test_KErrNone(nRes);
     
     nRes = DoFormatSteps(format, fmtCnt);
@@ -707,11 +707,11 @@
 
  
 	nRes=TheFs.CheckDisk(gSessionPath);
-	test_Value(nRes, nRes == KErrNone||nRes==KErrNotSupported);
+	test(nRes==KErrNone||nRes==KErrNotSupported);
 
     buf8.SetLength(22);
     nRes = file1.Write(buf8);
-    test_Value(nRes, nRes == KErrDisMounted);
+    test(nRes == KErrDisMounted);
     file1.Close();  //-- this will make the previously "Dismounted" mount die.
     dir.Close();
 
@@ -734,11 +734,11 @@
     format.Close();
 
 	nRes=TheFs.CheckDisk(gSessionPath);
-	test_Value(nRes, nRes == KErrNone||nRes==KErrNotSupported);
+	test(nRes==KErrNone||nRes==KErrNotSupported);
 
     buf8.SetLength(22);
     nRes = file1.Write(buf8);
-    test_Value(nRes, nRes == KErrDisMounted);
+    test(nRes == KErrDisMounted);
     file1.Close();  //-- this will make the previously "Dismounted" mount die.
 
     //---------------------------------------------------------------------------------
@@ -754,7 +754,7 @@
 
     fmtMode = EQuickFormat;
     nRes = format.Open(TheFs, drivePath, fmtMode, fmtCnt);
-    test_Value(nRes, nRes == KErrInUse);
+    test(nRes == KErrInUse);
     format.Close();
 
     test(stat1.Int() == KRequestPending);
@@ -769,7 +769,7 @@
 
     buf8.SetLength(22);
     nRes = file1.Write(buf8);
-    test_Value(nRes, nRes == KErrDisMounted);
+    test(nRes == KErrDisMounted);
     file1.Close();  
 
     //---------------------------------------------------------------------------------
@@ -789,7 +789,7 @@
     format.Close();
 
     nRes = file1.Write(buf8);
-    test_Value(nRes, nRes == KErrDisMounted);
+    test(nRes == KErrDisMounted);
     file1.Close();  
 
 
@@ -801,11 +801,11 @@
     RFormat     format1;
 
     nRes = format1.Open(TheFs, drivePath, fmtMode, fmtCnt);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
     
     fmtMode = EQuickFormat | EForceFormat; 
     nRes = format.Open(TheFs, drivePath, fmtMode, fmtCnt); 
-    test_Value(nRes, nRes == KErrInUse);
+    test(nRes == KErrInUse);
     format.Close();
 
     format1.Close();
@@ -813,11 +813,11 @@
     //-- 5.1 check that forced formatting will fail when there are "disk access" objects opened RRawDisk
     RRawDisk    rawDisk;
     nRes = rawDisk.Open(TheFs, gDrive);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     fmtMode = EQuickFormat | EForceFormat; 
     nRes = format.Open(TheFs, drivePath, fmtMode, fmtCnt); 
-    test_Value(nRes, nRes == KErrInUse);
+    test(nRes == KErrInUse);
     format.Close();
 
     rawDisk.Close();
@@ -847,7 +847,7 @@
     {
         fmtMode = EQuickFormat | EForceFormat; 
         nRes = format.Open(TheFs, drivePath, fmtMode, fmtCnt); 
-        test_Value(nRes, nRes == KErrInUse);
+        test(nRes == KErrInUse);
         format.Close();
     }
     
@@ -867,21 +867,18 @@
 
     TInt r;
     r = TheFs.CharToDrive(gDriveToTest, gDrive);
-    test_KErrNone(r);
+    test(r == KErrNone);
 
     //-- set up console output 
     F32_Test_Utils::SetConsole(test.Console()); 
     
     TInt nRes=TheFs.CharToDrive(gDriveToTest, gDrive);
-    test_KErrNone(nRes);
+    test(nRes==KErrNone);
     
     PrintDrvInfo(TheFs, gDrive);
 
-    if(Is_SimulatedSystemDrive(TheFs, gDrive))
-    	{
-		test.Printf(_L("Skipping T_FORMAT on PlatSim/Emulator drive %C:\n"), gSessionPath[0]);
-		return;
-    	}
+    if(Is_Win32(TheFs, gDrive))
+        return; //-- emulator drive c:
 
 
 	SetSessionPath(_L("\\"));
@@ -897,7 +894,7 @@
     TestFormat_ForceDismount();
 
 	r=TheFs.CheckDisk(gSessionPath);
-	test_Value(r, r == KErrNone||r==KErrNotSupported);
+	test(r==KErrNone||r==KErrNotSupported);
 	}
 
 
--- a/kerneltest/f32test/server/t_fsched.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_fsched.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -29,11 +29,6 @@
 #include "t_server.h"
 #include <e32twin.h>
 #include <e32cmn.h>
-#include <hal.h>
-#include "tf32testtimer.h"
-#include "f32_test_utils.h"
-using namespace F32_Test_Utils;
-
 
 //----------------------------------------------------------------------------------------------
 //! @SYMTestCaseID      PBASE-T_FSCHED-0191
@@ -119,6 +114,7 @@
 HBufC8* gBufSec = NULL;
 TPtr8 gBufWritePtr(NULL, 0);	
 
+const TInt KuStomS = 1000;
 const TInt KOneK = 1024;
 const TInt KOneMeg = KOneK * 1024;
 const TInt KBigBlockSize = KOneMeg ; 
@@ -135,8 +131,8 @@
 TTimeIntervalMicroSeconds32 gTimeTakenBigBlock(0);
 TBuf16<45> gSmallFile, gBigFile;
 TInt gNextFile=0;
-
-TF32TestTimer gTestTimer;
+TTime gTime1;
+TTime gTime2;
 
 RSemaphore gSync;
 
@@ -155,9 +151,6 @@
 	ENoThreads	
 	};
 
-
-
-
 /** Generates a file name of the form FFFFF*<aPos>.TXT (aLong.3)
 
 	@param aBuffer The filename will be returned here
@@ -617,30 +610,32 @@
 	}
 
 
+
 /** Measure the time taken for a big block to be written synchronously
 */
 void TimeTakenToWriteBigBlock() 
 {
+	TTime startTime;
+	TTime endTime;
 	RFile fileWrite;
 	
 	TInt r = fileWrite.Replace(TheFs,gBigFile,EFileShareAny|EFileWrite|EFileWriteDirectIO);
 	TESTERROR(r);
 
 	// Calculate how long it takes to write a big block to be able to issue at the right time the concurrent writes
-    TF32TestTimer timer;
-	timer.Start();
+	startTime.HomeTime();
 	
 	r = fileWrite.Write(gBufWritePtr, KBigBlockSize); 
-
-    timer.Stop();
-
+	
+	endTime.HomeTime();
+	
 	fileWrite.Close();
 
 	TESTERROR(r);
 	
-	gTimeTakenBigBlock = timer.TimeInMicroSeconds()/3;
-        
-	test.Printf(_L("\nTime spent to write the big block in isolation: %d ms\n"), TF32TestTimer::TimeInMilliSeconds(gTimeTakenBigBlock));
+	gTimeTakenBigBlock = I64LOW(endTime.MicroSecondsFrom(startTime).Int64()/3);
+
+	test.Printf(_L("\nTime spent to write the big block in isolation: %d ms\n"), gTimeTakenBigBlock.Int() / KuStomS);
 }
 	
 
@@ -648,44 +643,51 @@
 */
 void TimeTakenToWriteBigFile(TInt aPos) 
 {
+	TTime startTime;
+	TTime endTime;
+	
 	test((aPos >= 0) && (aPos <= 1));
-    TF32TestTimer timer;
-    timer.Start();
-
+	startTime.HomeTime();
+	
 	WriteFile(TheFs,gBigFile, gBigFileSize, KBigBlockSize, ENoThreads);
 	
-	timer.Stop();
+	endTime.HomeTime();
 
-	gTimeTakenBigFile = timer.Time32();
-		
-	test.Printf(_L("\nTime spent to write the big file in isolation: %d ms\n"), TF32TestTimer::TimeInMilliSeconds(gTimeTakenBigFile));
+	gTimeTakenBigFile = I64LOW(endTime.MicroSecondsFrom(startTime).Int64());
+	
 	
-	gTotalTimeSync[aPos] = Max(TF32TestTimer::TimeInMilliSeconds(gTimeTakenBigFile), gTotalTimeSync[aPos]) ;
+	test.Printf(_L("\nTime spent to write the big file in isolation: %d ms\n"), gTimeTakenBigFile.Int() / KuStomS);
+	
+	gTotalTimeSync[aPos] = Max((gTimeTakenBigFile.Int()/KuStomS), gTotalTimeSync[aPos]) ;
 }
 
 /** Measure the time taken for this file to be written asynchronously
 */
 void TimeTakenToWriteBigFileAsync(TInt aPos) 
 {
+	TTime startTime;
+	TTime endTime;
+	TTime endTime2;
 	TRequestStatus status[KWaitRequestsTableSize];
 	RFile bigFile;
 	
 	test((aPos >= 0) && (aPos <= 1));
+	
+	startTime.HomeTime();
+	WriteFileAsync(TheFs, bigFile, gBigFile, gBigFileSize,KBigBlockSize,status); 
+	endTime.HomeTime();
 
-    TF32TestTimer2 timer;
-	timer.Start();
-	WriteFileAsync(TheFs, bigFile, gBigFile, gBigFileSize,KBigBlockSize,status); 
-	timer.Stop();
 	
 	WaitForAll(status, gBigFileSize, KBigBlockSize);	
-	timer.Stop2();
 	
-	gTimeTakenBigFile = timer.Time32();        
+	endTime2.HomeTime();
+	
+	gTimeTakenBigFile=I64LOW(endTime.MicroSecondsFrom(startTime).Int64());
 	bigFile.Close();
-	test.Printf(_L("\nTime to queue the blocks in isolation asynchronously: %d ms, "), timer.TimeInMilliSeconds());
-	gTimeTakenBigFile = timer.Time2();
-	test.Printf(_L("to actually write it: %d ms\n"), TF32TestTimer::TimeInMilliSeconds(gTimeTakenBigFile));
-	gTotalTimeAsync[aPos] = Max(TF32TestTimer::TimeInMilliSeconds(gTimeTakenBigFile), gTotalTimeAsync[aPos]) ; 
+	test.Printf(_L("\nTime to queue the blocks in isolation asynchronously: %d ms, "), gTimeTakenBigFile.Int() / KuStomS);
+	gTimeTakenBigFile=I64LOW(endTime2.MicroSecondsFrom(startTime).Int64());
+	test.Printf(_L("to actually write it: %d ms\n"),gTimeTakenBigFile.Int() / KuStomS);
+	gTotalTimeAsync[aPos] = Max((gTimeTakenBigFile.Int() / KuStomS), gTotalTimeAsync[aPos]) ; 
 }
 
 /**  Delete content of directory
@@ -723,7 +725,7 @@
 	TESTERROR(r);
 	
 	ReadFile(fs,gSmallFile,KBlockSize, EThreadWait);
-	gTestTimer.Start();
+	gTime2.HomeTime();
 	
 	client.Signal();
 	
@@ -748,7 +750,7 @@
 	TESTERROR(r);
 	
 	ReadFile(fs,gBigFile,KBlockSize, EThreadWait);
-	gTestTimer.Stop();
+	gTime2.HomeTime();
 	
 	client.Signal();
 		
@@ -773,7 +775,7 @@
 	TESTERROR(r);
 	
 	WriteFile(fs,gSmallFile,gSmallFileSize, KBlockSize, EThreadWait);
-	gTestTimer.Start();
+	gTime2.HomeTime();
 	
 	client.Signal();
 	
@@ -798,7 +800,7 @@
 	TESTERROR(r);
 	
 	WriteFile(fs, gBigFile, gBigFileSize, KBigBlockSize, EThreadSignal); 
-	gTestTimer.Stop();
+	gTime1.HomeTime();
 	
 	client.Signal();
 	
@@ -823,7 +825,7 @@
 	TESTERROR(r);
 	
 	WriteFile(fs, gSmallFile, gBigFileSize, KBigBlockSize, EThreadWait); 
-	gTestTimer.Stop();
+	gTime2.HomeTime();
 	
 	client.Signal();
 	
@@ -895,13 +897,19 @@
 
 */
 void TestReadingWhileWriting() 
-{	
+{
+	TInt r = 0;
+	TTime time1;
+	TTime time2;
+
+	time1.HomeTime();
+	
 	// Write the small file and take the appropriate measures
 	WriteFile(TheFs,gSmallFile,KBlockSize, KBlockSize, ENoThreads);
 
 	// Sync test
 	TBuf<20> buf=_L("Big Write");
-	TInt r = gBig.Create(buf, WriteBigFile, KDefaultStackSize, KHeapSize, KMaxHeapSize, NULL);
+	r = gBig.Create(buf, WriteBigFile, KDefaultStackSize, KHeapSize, KMaxHeapSize, NULL);
 	TEST(r == KErrNone);
 
 	buf = _L("Small Read");
@@ -917,13 +925,15 @@
 	gBig.Close();
 	gSmall.Close();
 	
-	TTimeIntervalMicroSeconds timeTaken = gTestTimer.Time();
-	test.Printf(_L("\nSync read done %d ms before the write ended\n"), TF32TestTimer::TimeInMilliSeconds(timeTaken));
+	
+	TTimeIntervalMicroSeconds timeTaken = gTime1.MicroSecondsFrom(gTime2);
+	test.Printf(_L("\nSync read done %d ms before the write ended\n"),I64LOW(timeTaken.Int64() / KuStomS));
+	TReal time=I64LOW(timeTaken.Int64() / KuStomS); 
 	#if !defined(__WINS__)
-		// If this condition fails, it means that writing the sync file while 
-        // fairscheduling a small sync read takes too long. Reading small file
-        // should complete first.
-		test(timeTaken > 0);
+	// If this condition fails, means that writing the sync file while fairscheduling a small sync read takes too long
+		test.Printf(_L("time: %f\n"), time);
+//		test((time > 0) && (((gTotalTimeSync[0]-time)>0) || ((gTotalTimeSync[1]-time)>0)) );  
+		test(time > 0);
 	#endif 
 	
 	// Async test 
@@ -935,27 +945,25 @@
 	ReadFileAsync(TheFs, smallFile, gSmallFile, KBlockSize, status2 );
 
 	WaitForAll(status2,KBlockSize , KBlockSize );
-
-    TF32TestTimer timer;
-	timer.Start();
+	time1.HomeTime(); 
 
 	WaitForAll(status,gBigFileSize, KBigBlockSize);
 
-	timer.Stop();
+	time2.HomeTime();
 	bigFile.Close();
 	smallFile.Close();
 	
-	timeTaken = timer.Time();
+	timeTaken = time2.MicroSecondsFrom(time1);
 	
-	test.Printf(_L("\nAsync read done %d ms before the write ended\n"), timer.TimeInMilliSeconds());
+	test.Printf(_L("\nAsync read done %d ms before the write ended\n"),I64LOW(timeTaken.Int64() / KuStomS));
+	time = I64LOW(timeTaken.Int64() / KuStomS); 
 
 	#if !defined(__WINS__)
-	if (!Is_HVFS(TheFs, gDrive))
-		{
-		// If this condition fails, it means that writing the async file while fairscheduling a small async read takes too long
+	// If this condition fails, means that writing the async file while fairscheduling a small async read takes too long
+		test.Printf(_L("time: %f\n"), time);
 		test.Printf(_L("gTotalTimeAsync[0] = %d , gTotalTimeAsync[1] = %d\n"),gTotalTimeAsync[0],gTotalTimeAsync[1] );
-		test(timeTaken > 0);
-		}
+//		test((time > 0) && (((gTotalTimeAsync[0]-time)>0) || ((gTotalTimeAsync[1]-time)>0)) );
+		test(time > 0);
 	#endif
 }
 
@@ -965,6 +973,8 @@
 void TestWritingWhileWriting() 
 {
 	TInt r = 0;
+	TTime time1;
+	TTime time2;
 
 	// Sync test
 	TBuf<20> buf = _L("Big Write II");
@@ -984,12 +994,14 @@
 	gBig.Close();
 	gSmall.Close();
 	
-	TTimeIntervalMicroSeconds timeTaken = gTestTimer.Time();
-	test.Printf(_L("\nSync write done %d ms before the big write ended\n"), gTestTimer.TimeInMilliSeconds());
+	TTimeIntervalMicroSeconds timeTaken = gTime1.MicroSecondsFrom(gTime2);
+	test.Printf(_L("\nSync write done %d ms before the big write ended\n"),I64LOW(timeTaken.Int64() / KuStomS));
+	TReal time=I64LOW(timeTaken.Int64() / KuStomS); 
 	#if !defined(__WINS__)
-		// If this condition fails, it means that writing the sync file while 
-        // fairscheduling a small sync write takes too long		
-		test(timeTaken > 0);
+	// If this condition fails, means that writing the sync file while fairscheduling a small sync write takes too long
+		test.Printf(_L("time: %f\n"), time);
+// 		test((time > 0) && (((gTotalTimeSync[0]-time)>0) || ((gTotalTimeSync[1]-time)>0)) ); 
+		test(time > 0);
 	#endif 
 
 	// Async test 
@@ -1000,20 +1012,19 @@
 	WriteFileAsync(TheFs, bigFile, gBigFile, gBigFileSize, KBigBlockSize, status); 
 	WriteFileAsync(TheFs,smallFile, gSmallFile,gSmallFileSize,KBlockSize,status2);
 	WaitForAll(status2,gSmallFileSize, KBlockSize);
-    TF32TestTimer timer;
-	timer.Start();
+	time1.HomeTime();
 	WaitForAll(status, gBigFileSize, KBigBlockSize);
-	timer.Stop();
+	time2.HomeTime();
 	
-	timeTaken = timer.Time();
-	test.Printf(_L("\nAsync write done %d ms before the big write ended\n"),timer.TimeInMilliSeconds());
+	timeTaken = time2.MicroSecondsFrom(time1);
+	test.Printf(_L("\nAsync write done %d ms before the big write ended\n"),I64LOW(timeTaken.Int64() / KuStomS));
+	time=I64LOW(timeTaken.Int64() / KuStomS); 
 	#if !defined(__WINS__)
-	if (!Is_HVFS(TheFs, gDrive))
-		{
-		// If this condition fails, it means that writing the async file while fairscheduling a small async write takes too long
+	// If this condition fails, means that writing the async file while fairscheduling a small async write takes too long
+		test.Printf(_L("time: %f\n"), time);
 		test.Printf(_L("gTotalTimeAsync[0] = %d , gTotalTimeAsync[1] = %d\n"),gTotalTimeAsync[0],gTotalTimeAsync[1] );
-		test(timeTaken > 0);
-		}
+//		test((time > 0) && (((gTotalTimeAsync[0]-time)>0) || ((gTotalTimeAsync[1]-time)>0)) ); 
+		test(time > 0);
 	#endif
 	bigFile.Close();
 	smallFile.Close();	
@@ -1025,6 +1036,8 @@
 void TestTwoBigOnes()
 {
 	TInt r = 0;
+	TTime time1;
+	TTime time2;
 
 	// Sync test
 	TBuf<20> buf = _L("Big Write IIII");
@@ -1044,8 +1057,8 @@
 	gBig.Close();
 	gSmall.Close();
 	
-	TTimeIntervalMicroSeconds timeTaken = gTestTimer.Time();
-	test.Printf(_L("\nSync first write ended %d ms before the second write ended (same file size)\n"),TF32TestTimer::TimeInMilliSeconds(timeTaken));
+	TTimeIntervalMicroSeconds timeTaken = gTime2.MicroSecondsFrom(gTime1);
+	test.Printf(_L("\nSync first write ended %d ms before the second write ended (same file size)\n"),I64LOW(timeTaken.Int64() / KuStomS));
 
 	// Async test 
 	TRequestStatus status[KWaitRequestsTableSize];
@@ -1055,13 +1068,12 @@
 	WriteFileAsync(TheFs, bigFile, gBigFile, gBigFileSize, KBigBlockSize, status); 
 	WriteFileAsync(TheFs, bigFile2, gSmallFile, gBigFileSize, KBigBlockSize, status2);
 	WaitForAll(status, gBigFileSize, KBigBlockSize);
-    TF32TestTimer timer;
-	timer.Start();
+	time1.HomeTime();
 	WaitForAll(status2, gBigFileSize, KBigBlockSize);
-	timer.Stop();
+	time2.HomeTime();
 	
-	timeTaken = timer.Time();
-	test.Printf(_L("\nAsync first write ended %d ms before the second write ended (same file size)\n"),TF32TestTimer::TimeInMilliSeconds(timeTaken));
+	timeTaken = time2.MicroSecondsFrom(time1);
+	test.Printf(_L("\nAsync first write ended %d ms before the second write ended (same file size)\n"),I64LOW(timeTaken.Int64() / KuStomS));
 	bigFile.Close();
 	bigFile2.Close();	
 }
@@ -1072,9 +1084,9 @@
 void TestReadingWhileWritingSameFile() 
 {
 	TInt r = 0;
-	TF32TestTimer timer;
+	TTime time1;
 	
-	timer.Start();
+	time1.HomeTime();
 	
 	// Sync test
 	TBuf<20> buf = _L("Big Write IV");
@@ -1094,8 +1106,8 @@
 	CLOSE_AND_WAIT(gBig);
 	CLOSE_AND_WAIT(gSmall);
 	
-	TTimeIntervalMicroSeconds timeTaken = gTestTimer.Time();
-	test.Printf(_L("\nSync write finished %d ms before the read ended\n"),TF32TestTimer::TimeInMilliSeconds(timeTaken));
+	TTimeIntervalMicroSeconds timeTaken = gTime2.MicroSecondsFrom(gTime1);
+	test.Printf(_L("\nSync write finished %d ms before the read ended\n"),I64LOW(timeTaken.Int64() / KuStomS));
 	
 }
 
@@ -1265,7 +1277,7 @@
 	
 	TBool simulatelockFailureMode = EFalse;
 	r = controlIo(TheFs, gDrive, KControlIoSimulateLockFailureMode, simulatelockFailureMode);
-	test_Value(r, r == KErrNone  ||  r == KErrNotSupported);
+	test (r == KErrNone  ||  r == KErrNotSupported);
 #endif
 
 	// FileNames/File generation
@@ -1324,9 +1336,9 @@
 	TestWriteOrder();
 	
 	// Format the drive to make sure no blocks are left to be erased in LFFS
-	if (!Is_Win32(TheFs, gDrive))
+	#if !defined(__WINS__)
 		Format(gDrive);	
-	
+	#endif
 	r = TheFs.MkDirAll(gSessionPath);
 	
 	TimeTakenToWriteBigFile(1);  
@@ -1354,7 +1366,7 @@
 	// turn lock failure mode back ON (if cache is enabled)
 	simulatelockFailureMode = ETrue;
 	r = controlIo(TheFs, gDrive, KControlIoSimulateLockFailureMode, simulatelockFailureMode);
-    test_Value(r, r == KErrNone  ||  r == KErrNotSupported);
+    test (r == KErrNone  ||  r == KErrNotSupported);
 #endif
 
 	test.End();
@@ -1399,7 +1411,7 @@
 	TInt r = TheFs.Volume(volInfo, gDrive);
 	TESTERROR(r);
 	
-	gMediaSize = volInfo.iFree;
+	gMediaSize = volInfo.iSize;
 	gSmallFileSize = KBlockSize;
 	gBigFileSize = KBlockSize*20;
 	
@@ -1493,9 +1505,10 @@
 		test.Printf(_L("%c: Media corruption; previous test may have aborted; else, check hardware\n"), (TUint)gDrive + 'A');
 		}
 	TESTERROR(r);
-	
-	if (!Is_Win32(TheFs, gDrive) && (volInfo.iDrive.iMediaAtt & KMediaAttFormattable))
+#if !defined(__WINS__)
+	if ((volInfo.iDrive.iMediaAtt & KMediaAttFormattable))
 		Format(gDrive);
+#endif
 
 	if(CheckForDiskSize())
 		{
--- a/kerneltest/f32test/server/t_fsrv.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_fsrv.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -99,9 +99,9 @@
 	test.Start(_L("Path test thread"));
 	RFs f;
 	TInt r=f.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.SessionPath(tPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 
 	return(KErrNone);
@@ -209,55 +209,59 @@
  	 
  	test.Printf(_L("Dismounting the Remote Drive returned %d\n"),r);
  	
- 	test_Value(r, r == KErrNone );
+ 	test(r==KErrNone );
 	}
 
 
 LOCAL_C void CreateSubstDrive()
 	{
-	test.Printf(_L("Create Substitute Drive \n"));
-
-	TDriveList driveList;   
-
-	TInt r=TheFs.SessionPath(gTestSessionPath);
-	test_KErrNone(r);
+     test.Printf(_L("Create Substitute Drive \n"));
+    
+    TDriveList driveList;   
+    TInt i ;
+      
+    TInt r=TheFs.SessionPath(gTestSessionPath);
+	test(r==KErrNone);  
  	
  	r=TheFs.DriveList(driveList, KDriveAttExclude|KDriveAttLocal);
-   	test_KErrNone(r);
+   	test( r==KErrNone );
    
 
-	for (TInt i = EDriveO; i < KMaxDrives; i++)
-		{
-		if (driveList[i] == 0)
-			{
-			if (i == EDriveQ)
-				continue;  // Q reserved to mount a virtual Remote Drive, as part of the test.
-			substDrive = i;
-			break;
-			}
-		}
-
+   	for ( i = EDriveO; i < KMaxDrives; i++) 
+      	{
+    
+      	if ( driveList[i] == 0) 
+          	{
+          	if (i == EDriveQ) continue;  // Q reserved to mount a virtual Remote Drive, as part of the test.
+        	substDrive = i;
+          	break;          
+          	}
+      	}
+           
+   
    	if (substDrive)
    		{
  		TDriveInfo driveInfo;
 		r=TheFs.Drive(driveInfo,substDrive);
-		test_KErrNone(r);
+		test(r==KErrNone);
 	
 		if (driveInfo.iDriveAtt==KDriveAttLocal)
-			{
+			{	
 			return;	//	Subst local drives fails
 			}
 	
 		TFileName n;
 		r=TheFs.Subst(n,substDrive);
-		test_KErrNone(r);
-		test_Value(n.Length(), n.Length() == 0);
+		test(r==KErrNone);
+		test(n.Length()==0);	
 		r=TheFs.SetSubst(gTestSessionPath,substDrive);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=TheFs.Subst(n,substDrive);
-		test_KErrNone(r);
-		test(n==gTestSessionPath);
+		test(r==KErrNone);
+		test(n==gTestSessionPath);   		
    		}
+
+	
 	}
 
 		
@@ -265,9 +269,9 @@
 	{
 	 	if( substDrive)
 	 		{
-	 		test.Printf(_L("Removing Substitute Drive \n"));
-	 		TInt r =TheFs.SetSubst(_L(""),substDrive);
-			test_KErrNone(r);
+	 		test.Printf(_L("Removing Substitute Drive \n"));	 	 
+	 		TInt r =TheFs.SetSubst(_L(""),substDrive);	
+			test(r ==KErrNone);	 		
 	 		}
 
 	}
@@ -280,16 +284,16 @@
 //
 	{
 
-	test_Value(anInfo.iConnectionBusType, anInfo.iConnectionBusType==EConnectionBusInternal || anInfo.iConnectionBusType==EConnectionBusUsb);
+	test(anInfo.iConnectionBusType==EConnectionBusInternal || anInfo.iConnectionBusType==EConnectionBusUsb);
 	
 	if (aDrive==EDriveZ)
 		{
 		if (anInfo.iType==EMediaNotPresent)
 			return;
 		
-		test_Value(anInfo.iMediaAtt, anInfo.iMediaAtt==KMediaAttWriteProtected);
-		test_Value(anInfo.iDriveAtt, anInfo.iDriveAtt==(KDriveAttRom|KDriveAttInternal));
-		test_Value(anInfo.iType, anInfo.iType==EMediaRom);
+		test(anInfo.iMediaAtt==KMediaAttWriteProtected);
+		test(anInfo.iDriveAtt==(KDriveAttRom|KDriveAttInternal));
+		test(anInfo.iType==EMediaRom);
 		}
 
 	else if (GetDriveLFFS()==aDrive)
@@ -297,9 +301,9 @@
         if (anInfo.iType==EMediaNotPresent)
             return;
 
-		test_Value(anInfo.iDriveAtt, anInfo.iDriveAtt&(KDriveAttLocal|KDriveAttInternal)==KDriveAttLocal|KDriveAttInternal);	// LFFS sets KDriveAttTransaction as well
-        test_Value(anInfo.iType, anInfo.iType==EMediaFlash);
-        test_Value(anInfo.iMediaAtt, anInfo.iMediaAtt==KMediaAttFormattable);
+		test(anInfo.iDriveAtt&(KDriveAttLocal|KDriveAttInternal)==KDriveAttLocal|KDriveAttInternal);	// LFFS sets KDriveAttTransaction as well
+        test(anInfo.iType==EMediaFlash);
+        test(anInfo.iMediaAtt==KMediaAttFormattable);
 		}
 /*
 Why assume certain drive letters can only refer to certain drive types?
@@ -377,17 +381,17 @@
     test.Printf(_L("Test existing DriveList \n"));
     
     err = TheFs.DriveList(driveList);
-	test_KErrNone(err);
+    test( err == KErrNone );
     
     for ( i = 0; i < KMaxDrives; i++) 
         {
         if (driveList[i]) 
             {
             err = TheFs.Drive(info, i);
-			test_KErrNone(err);
-            test_Value(info.iType, info.iType != EMediaRemote);
-            test_Value(info.iDriveAtt, !(info.iDriveAtt & KDriveAttRemote)); 
-			test_Value(info.iDriveAtt, !(info.iDriveAtt & KDriveAttHidden));
+            test( err == KErrNone );
+            test( info.iType  !=  EMediaRemote  );
+            test( !(info.iDriveAtt & KDriveAttRemote ) ); 
+			test( !(info.iDriveAtt & KDriveAttHidden ) );
             drivecount++; 
             
             if( info.iDriveAtt  & KDriveAttRemovable) 
@@ -426,13 +430,13 @@
    flags = KDriveAttAll;
    err = TheFs.DriveList(driveList, flags);
 
-	test_KErrNone(err);
+   test( err == KErrNone );
    for ( i = 0; i < KMaxDrives; i++) 
        {
        if (driveList[i]) 
            {
            err = TheFs.Drive(info,i);
-			test_KErrNone(err);
+           test( err == KErrNone );
            allDrivecount++;
            
            if( info.iDriveAtt  & KDriveAttSubsted ) 
@@ -458,6 +462,9 @@
            }
         }  
 
+ 	test(allDrivecount == drivecount + hiddenOrRemoteDriveCount);
+	test(hiddenOrRemoteDriveCount - hiddenDriveCount == 1);
+
 	test.Printf(_L("Found %d substitute drives\n"), substDriveCount);
 	test.Printf(_L("Found %d exclusively substitute  drives \n"),exclusiveSubstDriveCount);
 	test.Printf(_L("Found %d hidden drives\n"), hiddenDriveCount);
@@ -468,9 +475,6 @@
 	test.Printf(_L("Found %d physically removable drives \n"),physicallyRemovable);
 	test.Printf(_L("Found %d logically removable drives \n"),logicallyRemovableDriveCount);
   
- 	test(allDrivecount == drivecount + hiddenOrRemoteDriveCount);
-	test(hiddenOrRemoteDriveCount - hiddenDriveCount == 1);
-
   
   	//--------------------------------------------- 
 	//! @SYMTestCaseID			PBASE-T_FSRV-0546
@@ -491,22 +495,22 @@
 	
     flags = KDriveAttRemovable;
     err = TheFs.DriveList(driveList, flags);
-	test_KErrNone(err);
+    test( err == KErrNone );
     for ( i = 0; i < KMaxDrives; i++) 
         {
         if (driveList[i]) 
             {
             err = TheFs.Drive(info, i);
-			test_KErrNone(err);
-            test_Value(info.iDriveAtt, info.iDriveAtt & KDriveAttRemovable);
-            drivecount++;
+            test( err == KErrNone );
+            test( info.iDriveAtt & KDriveAttRemovable );
+            drivecount++; 
       
             printDriveAtt(i,info.iDriveAtt);
             }
 
         }
 
-	test_Value(drivecount, drivecount == removableDriveCount); // no removable drive was added
+    test( drivecount == removableDriveCount ); // no removable drive was added
 
 
   	//--------------------------------------------- 
@@ -527,14 +531,14 @@
     drivecount = 0;
     flags = KDriveAttRemovable | KDriveAttRemote;
     err = TheFs.DriveList(driveList, flags);
-	test_KErrNone(err);
+    test( err == KErrNone );
     for ( i = 0; i < KMaxDrives; i++) 
         {
         if (driveList[i]) 
             {
             err = TheFs.Drive(info, i);
-			test_KErrNone(err);
-            test_Value(info.iDriveAtt, (info.iDriveAtt & KDriveAttRemovable ) || (info.iDriveAtt & KDriveAttRemote)); 
+            test( err == KErrNone );
+            test( (info.iDriveAtt & KDriveAttRemovable ) || (info.iDriveAtt & KDriveAttRemote)); 
             drivecount++; 
            
            	printDriveAtt(i,info.iDriveAtt);
@@ -542,7 +546,7 @@
             }
 
         }
-	test_Value(drivecount, drivecount == removableDriveCount + 1 );  //contains the remote drive we mounted
+    test( drivecount == removableDriveCount + 1 );  //contains the remote drive we mounted
     
 
   	//--------------------------------------------- 
@@ -564,21 +568,21 @@
     flags = KDriveAttExclusive | KDriveAttRemote;
     TUint match = KDriveAttRemote;
     err = TheFs.DriveList(driveList, flags);
-	test_KErrNone(err);
+    test( err == KErrNone );
     for ( i = 0; i < KMaxDrives; i++) 
         {
         if (driveList[i]) 
             {
             err = TheFs.Drive(info, i);
-			test_KErrNone(err);
-            test_Value(info.iDriveAtt, (info.iDriveAtt == match)); 
+            test( err == KErrNone );
+            test( (info.iDriveAtt == match)); 
             drivecount++;
             
             printDriveAtt(i,info.iDriveAtt);
             }
 
         }
-   	test_Value(drivecount, drivecount == 1); //The remote drive we mounted.
+   	test( drivecount == 1 ); //The remote drive we mounted.
 
 
   	//--------------------------------------------- 
@@ -599,22 +603,22 @@
    drivecount = 0; 	
    flags = KDriveAttExclude | KDriveAttRemovable;
    err = TheFs.DriveList(driveList, flags);
-	test_KErrNone(err);
+   test( err == KErrNone );
    for (i = 0; i < KMaxDrives; i++) 
        {
        if (driveList[i]) 
            {
            err = TheFs.Drive(info, i);
-			test_KErrNone(err);
-           test_Value(info.iDriveAtt, (!(info.iDriveAtt & KDriveAttRemovable ) )); 
+           test( err == KErrNone );
+           test( (!(info.iDriveAtt & KDriveAttRemovable ) )); 
            drivecount++;
            
            printDriveAtt(i,info.iDriveAtt);
            }
 
        }  
-     test_Value(drivecount, drivecount == allDrivecount - removableDriveCount); 
-	 test_Value (drivecount, drivecount == nonRemovables + hiddenDriveCount + 1) ;   //The remote drive we added is non removable  
+     test ( drivecount == allDrivecount - removableDriveCount); 
+	 test ( drivecount == nonRemovables + hiddenDriveCount + 1) ;   //The remote drive we added is non removable  
 
 
 
@@ -639,21 +643,21 @@
    flags = KDriveAttExclude | KDriveAttRemovable | KDriveAttRemote;
    err = TheFs.DriveList(driveList, flags);
    
-	test_KErrNone(err);
+   test( err == KErrNone );
    
    for ( i = 0; i < KMaxDrives; i++) 
        {
        if (driveList[i]) 
            {
            err = TheFs.Drive(info,i);
-			test_KErrNone(err);
-           test_Value(info.iDriveAtt, (!(info.iDriveAtt & KDriveAttRemovable ) && (!(info.iDriveAtt & KDriveAttRemote ))));
+           test( err == KErrNone );
+           test( (!(info.iDriveAtt & KDriveAttRemovable ) && (!(info.iDriveAtt & KDriveAttRemote ))));
            drivecount++;
            
            printDriveAtt(i,info.iDriveAtt);
            }
        }
-	test_Value(drivecount, drivecount == (allDrivecount - removableDriveCount - 1)  ); // also excluding the removables and the remote drive   
+   test(drivecount == (allDrivecount - removableDriveCount - 1)  ); // also excluding the removables and the remote drive   
   
   
 
@@ -683,21 +687,21 @@
    		flags = KDriveAttExclude | KDriveAttRemote | KDriveAttSubsted;
    		err = TheFs.DriveList(driveList, flags);
    
-		test_KErrNone(err);
+   		test( err == KErrNone );
    
    		for ( i = 0; i < KMaxDrives; i++) 
        		{
        		if (driveList[i]) 
            		{
            		err = TheFs.Drive(info,i);
-			test_KErrNone(err);
-           		test_Value(info.iDriveAtt, (!(info.iDriveAtt & KDriveAttRemote )  && (!(info.iDriveAtt & KDriveAttSubsted ))));
+           		test( err == KErrNone );
+           		test( (!(info.iDriveAtt & KDriveAttRemote )  && (!(info.iDriveAtt & KDriveAttSubsted ))));
            		drivecount++;
            
            		printDriveAtt(i,info.iDriveAtt);
            		}
        		}
-		test_Value(drivecount, drivecount == (allDrivecount - substDriveCount- 1)  );    
+    	test(drivecount == (allDrivecount - substDriveCount- 1)  );    
 
 
 		
@@ -707,15 +711,15 @@
    		flags = KDriveAttExclusive | KDriveAttExclude | KDriveAttSubsted;
    		err = TheFs.DriveList(driveList, flags);
    
-		test_KErrNone(err);
+   		test( err == KErrNone );
    
    		for ( i = 0; i < KMaxDrives; i++) 
        		{
        		if (driveList[i]) 
            		{
            		err = TheFs.Drive(info,i);
-				test_KErrNone(err);
-           		test_Value(info.iDriveAtt, info.iDriveAtt != KDriveAttSubsted);
+           		test( err == KErrNone );
+           		test( info.iDriveAtt != KDriveAttSubsted );
            		drivecount++;
            
            		printDriveAtt(i,info.iDriveAtt);
@@ -723,7 +727,7 @@
    		    
    		    }
     
-		test_Value(drivecount, drivecount == (allDrivecount - exclusiveSubstDriveCount)  );        
+		test(drivecount == (allDrivecount - exclusiveSubstDriveCount)  );        
 		
 		}
 
@@ -763,14 +767,14 @@
 
 	TDriveList fullDriveList;
 	err = TheFs.DriveList(fullDriveList, KDriveAttAll);
-	test_KErrNone(err);
+	test( err == KErrNone );
 
 	for ( i = 0; i < KMaxDrives; i++) 
 		{
 		if (driveList[i]) 
 			{
 			err = TheFs.Drive(info,i);
-			test_KErrNone(err);
+			test( err == KErrNone );
 			printDriveAtt(i,info.iDriveAtt);
 			}
 		}
@@ -790,14 +794,14 @@
 			//test.Printf(_L("Expected Result : %d     \n"), testAtt == 0 ? testCombinations[matchIdx].iExpectedResultNoAtts : testCombinations[matchIdx].iExpectedResultWithAtts);
 			//test.Printf(_L("  Actual Result : 0x%08x \n"), err);
 
-			test_Value(err, err == (testAtt == 0 ? testCombinations[matchIdx].iExpectedResultNoAtts : testCombinations[matchIdx].iExpectedResultWithAtts));
+			test( err == (testAtt == 0 ? testCombinations[matchIdx].iExpectedResultNoAtts : testCombinations[matchIdx].iExpectedResultWithAtts) );
 
 			if(err == KErrNone)
 				{
 				//printDriveAtt(0, testAtt);  //Prints attributes   
 				for ( i = 0; i < KMaxDrives; i++) 
 					{
-					TBool expectMatch = EFalse;
+					TBool expectMatch = EFalse;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
 
 					switch(testCombinations[matchIdx].iMatchMask)
 						{
@@ -809,11 +813,11 @@
 							expectMatch = ETrue;
 							break;
 
-						case KDriveAttExclude:
+						case KDriveAttExclude :
 							expectMatch = (fullDriveList[i] & testAtt) == 0;
 							break;
 
-						case KDriveAttExclusive:
+						case KDriveAttExclusive :
 							expectMatch = (fullDriveList[i] == testAtt);
 							break;
 
@@ -821,14 +825,20 @@
 							expectMatch = (fullDriveList[i] != testAtt);
 							break;
 	
-						case KDriveAttAll | KDriveAttExclude:
-							// Invalid - should never get here as this returns KErrArgument for all cases
-						case KDriveAttAll | KDriveAttExclusive:
-							// Invalid - should never get here as this returns KErrArgument for all cases
-						case KDriveAttAll | KDriveAttExclude | KDriveAttExclusive:
-							// Invalid - should never get here as this returns KErrArgument for all cases
+						case KDriveAttAll | KDriveAttExclude :
+							test(0);	// Invalid - should never get here as this returns KErrArgument for all cases
+							break;
+
+						case KDriveAttAll | KDriveAttExclusive :
+							test(0);	// Invalid - should never get here as this returns KErrArgument for all cases
+							break;
+
+						case KDriveAttAll | KDriveAttExclude | KDriveAttExclusive :
+							test(0);	// Invalid - should never get here as this returns KErrArgument for all cases
+							break;
+
 						default:
-							test.Printf(_L("Unexpected or invalid Match Mask %08x"), testCombinations[matchIdx].iMatchMask);
+							test.Printf(_L("Unexpected Match Mask %08x"), testCombinations[matchIdx].iMatchMask);
 							test(0);
 							break;
 						}
@@ -836,7 +846,7 @@
 					if(expectMatch) 
 						{
 						//test.Printf(_L(" %c MATCHED OK "), 'A' + i);
-						test_Value(newDriveList[i], newDriveList[i] == fullDriveList[i]);
+						test(newDriveList[i] == fullDriveList[i]);
 						}
 					else
 						{
@@ -849,7 +859,7 @@
 							test.Printf(_L(" %c NOT MATCHED "), 'A' + i);
 							}
 						*/
-						test_Value(newDriveList[i], newDriveList[i] == 0);
+						test(newDriveList[i] == 0);
 						}
 					}
 				}
@@ -875,14 +885,14 @@
  	drivecount = 0;
     flags = KDriveAttLogicallyRemovable;
     err = TheFs.DriveList(driveList, flags);
-	test_KErrNone(err);
+    test( err == KErrNone );
     for ( i = 0; i < KMaxDrives; i++) 
         {
         if (driveList[i]) 
             {
             err = TheFs.Drive(info, i);
-			test_KErrNone(err);
-            test_Value(info.iDriveAtt, info.iDriveAtt & KDriveAttLogicallyRemovable);
+            test( err == KErrNone );
+            test( info.iDriveAtt & KDriveAttLogicallyRemovable );
             drivecount++; 
       
             printDriveAtt(i,info.iDriveAtt);
@@ -890,7 +900,8 @@
 
         }
 
-    test_Value(drivecount, drivecount == logicallyRemovableDriveCount); // no logically removable drive was added
+    test( drivecount == logicallyRemovableDriveCount ); // no logically removable drive was added
+ 
 
 	test.End();
 	}
@@ -910,7 +921,7 @@
 	test.Start(_L("The drive info"));
 	TDriveList list;
 	TInt r=TheFs.DriveList(list);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	for (TInt i=0;i<KMaxDrives;i++)
 		{
 		TInt att=list[i];
@@ -918,7 +929,7 @@
 			{
 			TDriveInfo d;
 			r=TheFs.Drive(d,i);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			printDriveInfo(i,d);
 			test.Printf(_L("\n"));
 			testDriveInfo(i,d);
@@ -937,7 +948,7 @@
 	test.Start(_L("The volume info"));
 	TDriveList list;
 	TInt r=TheFs.DriveList(list);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	for (TInt i=0;i<KMaxDrives;i++)
 		{
 		TVolumeInfo v;
@@ -1001,7 +1012,7 @@
 			}
 		else
 			r=f.Set(name,NULL,NULL);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(TPtrC(p.fullName)==f.FullName());
 		test(TPtrC(p.drive)==f.Drive());
 		test(TPtrC(p.path)==f.Path());
@@ -1021,28 +1032,28 @@
 	test.Start(_L("Test path handling"));
 	TFileName p;
 	TInt r=TheFs.SessionPath(p);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("SESSION=\"%S\"\n"),&p);
 	r=TheFs.SetSessionPath(_L("A:\\TEST\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SessionPath(p);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(p==_L("A:\\TEST\\"));
 	r=TheFs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 
 	TheFs.SetAllocFailure(gAllocFailOff);
 
 	RThread t;
 	r=t.Create(_L("PathTest"),pathTestThread,KDefaultStackSize,KHeapSize,KHeapSize,NULL);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TRequestStatus tStat;
 	t.Logon(tStat);
 	t.Resume();
 	User::WaitForRequest(tStat);
-	r = tStat.Int();
-	test_KErrNone(r);
+	test(tStat==KErrNone);
+	test(r==KErrNone);
 	t.Close();
 
 	TheFs.SetAllocFailure(gAllocFailOn);
@@ -1060,9 +1071,9 @@
 
 	TFileName old;
 	TInt r=TheFs.SessionPath(old);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetSessionPath(_L("C:\\ABCDEF\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	for (TInt i=0;i<KMaxParses;i++)
 		{
 		TInt r;
@@ -1073,7 +1084,7 @@
 			r=TheFs.Parse(name,TPtrC(p.rel),f);
 		else
 			r=TheFs.Parse(name,f);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(TPtrC(p.fullName)==f.FullName());
 		test(TPtrC(p.drive)==f.Drive());
 		test(TPtrC(p.path)==f.Path());
@@ -1081,7 +1092,7 @@
 		test(TPtrC(p.ext)==f.Ext());
 		}
 	r=TheFs.SetSessionPath(old);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.End();
 	}
@@ -1095,14 +1106,14 @@
 	test.Printf(_L("Test subst"));
 	TVolumeInfo v;
 	TInt r=TheFs.Volume(v);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TDriveInfo origDI;
 	r=TheFs.Drive(origDI);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TDriveInfo driveInfo;
 	r=TheFs.Drive(driveInfo,EDriveO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	if (driveInfo.iDriveAtt==KDriveAttLocal)
 		{	
@@ -1111,40 +1122,40 @@
 	
 	TFileName n;
 	r=TheFs.Subst(n,EDriveO);
-	test_KErrNone(r);
-	test_Value(n.Length(), n.Length()==0);
+	test(r==KErrNone);
+	test(n.Length()==0);
 	r=TheFs.SetSubst(gSessionPath,EDriveO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Subst(n,EDriveO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(n==gSessionPath);
 	TVolumeInfo w;
 	r=TheFs.Volume(w,EDriveO);
-	test_KErrNone(r);
-	test_Value(w.iDrive.iType, w.iDrive.iType==v.iDrive.iType);
-	test_Value(w.iDrive.iConnectionBusType, w.iDrive.iConnectionBusType==v.iDrive.iConnectionBusType);
-	test_Value(w.iDrive.iDriveAtt, w.iDrive.iDriveAtt==KDriveAttSubsted);
-	test_Value(w.iDrive.iMediaAtt, w.iDrive.iMediaAtt==v.iDrive.iMediaAtt);
+	test(r==KErrNone);
+	test(w.iDrive.iType==v.iDrive.iType);
+	test(w.iDrive.iConnectionBusType==v.iDrive.iConnectionBusType);
+	test(w.iDrive.iDriveAtt==KDriveAttSubsted);
+	test(w.iDrive.iMediaAtt==v.iDrive.iMediaAtt);
 	test(w.iUniqueID==v.iUniqueID);
 	test(w.iSize==v.iSize);
 	test(w.iFree==v.iFree);
 	test(w.iName==v.iName);
 	TDriveList driveList;
 	r=TheFs.DriveList(driveList);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(driveList[EDriveO]==KDriveAttSubsted);
 	TDriveInfo d;
 	r=TheFs.Drive(d,EDriveO);
-	test_KErrNone(r);
-	test_Value(d.iDriveAtt, d.iDriveAtt==KDriveAttSubsted);
-	test_Value(d.iMediaAtt, d.iMediaAtt==origDI.iMediaAtt);
-	test_Value(d.iType, d.iType==origDI.iType);
-	test_Value(d.iConnectionBusType, d.iConnectionBusType==origDI.iConnectionBusType);
+	test(r==KErrNone);
+	test(d.iDriveAtt==KDriveAttSubsted);
+	test(d.iMediaAtt==origDI.iMediaAtt);
+	test(d.iType==origDI.iType);
+	test(d.iConnectionBusType==origDI.iConnectionBusType);
 
 
 	test.Next(_L("Test real name"));
 	r=TheFs.RealName(_L("O:\\FILE.XXX"),n);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TFileName substedPath=gSessionPath;
 	substedPath.Append(_L("FILE.XXX"));
 	test(n.CompareF(substedPath)==KErrNone);
@@ -1154,25 +1165,25 @@
 	TFileName dir=gSessionPath;
 	dir+=KTurgid;
 	r=TheFs.MkDirAll(dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dir+=_L("subdir\\");
 	r=TheFs.MkDir(dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(_L("O:\\turgid\\subdir\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Rename(_L("O:\\turgid"), _L("O:\\facile"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.MkDir(_L("O:\\insipid\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Rename(_L("O:\\insipid"), _L("O:\\glib"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(_L("O:\\facile\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	_LIT(KGlib,"glib\\");
 	dir=gSessionPath;
 	dir+=KGlib;
 	r=TheFs.RmDir(dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 //	
 	test.Next(_L("Test file operations on Substed drive"));
 	_LIT(File1,"File1.txt");
@@ -1184,21 +1195,21 @@
 	name1+=File1;
 	RFile f1;
 	r=f1.Replace(TheFs,name1,EFileShareExclusive|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	name2=SubstRoot;
 	name2+=File2;
 	TBool isValid=TheFs.IsValidName(name2);
 	test(isValid);
 	r=f1.Rename(name2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f1.Close();
 	r=f1.Create(TheFs,name1,EFileShareExclusive|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f1.Close();
 	r=TheFs.Replace(name2,name1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(name1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Next(_L("Test notifications on Substed drive"));
 	name1=gSessionPath;
 	name1+=Subdir;
@@ -1209,62 +1220,58 @@
 	TRequestStatus status2;
 	TRequestStatus status3;
 	TheFs.NotifyChange(ENotifyDir,status1,name1);
-	test_Value(status1.Int(), status1==KRequestPending);
+	test(status1==KRequestPending);
 	TheFs.NotifyChange(ENotifyDir,status2,name2);
-	test_Value(status2.Int(), status2==KRequestPending);
+	test(status2==KRequestPending);
 	r=TheFs.MkDirAll(name1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(status1);
 	User::WaitForRequest(status2);
-	test_KErrNone(status1.Int());
-	test_KErrNone(status2.Int());
+	test(status1==KErrNone && status2==KErrNone);
 	TheFs.NotifyChange(ENotifyDir,status1,name1);
-	test_Value(status1.Int(), status1==KRequestPending);
+	test(status1==KRequestPending);
 	TheFs.NotifyChange(ENotifyDir,status2,name2);
-	test_Value(status2.Int(), status2==KRequestPending);
+	test(status2==KRequestPending);
 	TheFs.NotifyChange(ENotifyAll,status3,name2);
-	test_Value(status3.Int(), status3==KRequestPending);
+	test(status3==KRequestPending);
 	r=f1.Temp(TheFs,name2,n,EFileShareAny|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(status3);
-	test_KErrNone(status3.Int());
-	test_Value(status1.Int(), status1==KRequestPending);
-	test_Value(status2.Int(), status2==KRequestPending);
+	test(status3==KErrNone && status1==KRequestPending && status2==KRequestPending);
 	f1.Close();
 	TheFs.NotifyChangeCancel();
-	test_Value(status1.Int(), status1==KErrCancel);
-       	test_Value(status2.Int(), status2==KErrCancel);
+	test(status1==KErrCancel && status2==KErrCancel);
 	r=TheFs.Delete(n);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(name1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 //
 	test.Next(_L("Test file systems on Substed drive"));
 	// test cannot mount file system on substituted drive
 	TInt sessionDrv;
 	r=TheFs.CharToDrive(gSessionPath[0],sessionDrv);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.FileSystemName(n,sessionDrv);
-	test_Value(r, r == KErrNone || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotFound);
 	r=TheFs.MountFileSystem(n,EDriveO);
-	test_Value(r, r == KErrAccessDenied);
+	test(r==KErrAccessDenied);
 	// test file system name on substitued drive is null
 	r=TheFs.FileSystemName(n,EDriveO);
-	test_Value(r, r == KErrNotFound && n==KNullDesC);
+	test(r==KErrNotFound && n==KNullDesC);
 	// test cannot format a substitued drive
 	RFormat format;
 	TInt count;
 	r=format.Open(TheFs,SubstRoot,EHighDensity,count);
-	test_Value(r, r == KErrAccessDenied);
+	test(r==KErrAccessDenied);
 	
 	r=TheFs.SetSubst(_L(""),EDriveO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Subst(n,EDriveO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(n==_L(""));
 	r=TheFs.Drive(d,EDriveO);
-	test_KErrNone(r);
-	test_Value(d.iDriveAtt, d.iDriveAtt==0);
+	test(r==KErrNone);
+	test(d.iDriveAtt==0);
 	}
 
 LOCAL_C void testSetVolume()
@@ -1279,7 +1286,7 @@
 
 	TVolumeInfo v;
 	TInt r=TheFs.Volume(v,driveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TFileName n=v.iName;
 	test.Printf(_L("VOL=\"%S\"\n"),&n);
 
@@ -1293,27 +1300,27 @@
 		return;
 		}
 
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Volume(v,driveNum);
-	test_Value(r, r == KErrNone );
+	test(r==KErrNone );
+	test(v.iName==_L(""));
 	test.Printf(_L("VOL=\"%S\"\n"),&v.iName);
-	test(v.iName==_L(""));
 
 	test.Next(_L("Set volume label to ABCDEFGHIJK"));
 	r=TheFs.SetVolumeLabel(_L("ABCDEFGHIJK"),driveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Volume(v,driveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
+	test(v.iName==_L("ABCDEFGHIJK"));
 	test.Printf(_L("VOL=\"%S\"\n"),&v.iName);
-	test(v.iName==_L("ABCDEFGHIJK"));
 
 	test.Next(_L("Set volume label to ABCDE"));
 	r=TheFs.SetVolumeLabel(_L("ABCDE"),driveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Volume(v,driveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
+	test(v.iName==_L("ABCDE"));
 	test.Printf(_L("VOL=\"%S\"\n"),&v.iName);
-	test(v.iName==_L("ABCDE"));
 
 
 	test.Next(_L("Test replacement of non-ascii chars"));
@@ -1331,7 +1338,7 @@
 	uBuf[9]=0x104;
 	uBuf[10]='f';
 	r=TheFs.SetVolumeLabel(uBuf,driveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TFileName drive=_L("?:");
 	drive[0]=gSessionPath[0];
 
@@ -1341,54 +1348,56 @@
 
 	TFileName sess;
 	r=TheFs.SessionPath(sess);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Volume(v,driveNum);
-	test_KErrNone(r);
-	test.Printf(_L("VOL=\"%S\"\n"),&v.iName);
+	test(r==KErrNone);
+
 	if(Is_Fat(TheFs, gDrive)) //-- FAT doesn't support normal UNICODE in volume labels
 		test(v.iName==_L("a_b_c_d_e_f"));
 	else
 		test(v.iName == uBuf);
 
+
+	test.Printf(_L("VOL=\"%S\"\n"),&v.iName);
+
+
 	test.Next(_L("Set volume label back to nothing"));
 	r=TheFs.SetVolumeLabel(_L(""),driveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Volume(v,driveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
+	test(v.iName==_L(""));
 	test.Printf(_L("VOL=\"%S\"\n"),&v.iName);
-	test(v.iName==_L(""));
 
 	test.Next(_L("Attempt to set volume label containing illegal characters"));
 	r=TheFs.SetVolumeLabel(_L("abc>def"),driveNum);
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.SetVolumeLabel(_L("ghi*jkl"),driveNum);
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.SetVolumeLabel(_L("mno?pqr"),driveNum);
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.SetVolumeLabel(_L("stu|vwx"),driveNum);
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.SetVolumeLabel(_L("yz<abc"),driveNum);
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.SetVolumeLabel(_L("def//ghi"),driveNum);
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 
 	r=TheFs.Volume(v,driveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
+	test(v.iName==_L(""));
 	test.Printf(_L("VOL=\"%S\"\n"),&v.iName);
-	test(v.iName==_L(""));
 
 	// test volume label after remount (for removable media only)
 	test.Next(_L("Test volume label after remount"));
 
 	TDriveInfo info;
-	r = TheFs.Drive(info, driveNum);
-	test_KErrNone(r);
+	test(TheFs.Drive(info, driveNum) == KErrNone);
 
 	if((info.iDriveAtt & KDriveAttRemovable) != 0)
 		{
 		// 1. set volume label
-		r = TheFs.SetVolumeLabel(_L("XXX"), driveNum);
-		test_KErrNone(r);
+		test(TheFs.SetVolumeLabel(_L("XXX"), driveNum) == KErrNone);
 
 		// 2. change bootsector volume label
 		const TInt	offset = IsFileSystemFAT32(TheFs, driveNum)? 
@@ -1399,20 +1408,15 @@
 		RRawDisk	rdisk;
 		TPtrC8		label(_S8("Z"), 1);
 
-		r = rdisk.Open(TheFs, driveNum);
-		test_KErrNone(r);
-		r = rdisk.Write(offset, label);
-		test_KErrNone(r);
+		test(rdisk.Open(TheFs, driveNum) == KErrNone);
+		test(rdisk.Write(offset, label) == KErrNone);
 		rdisk.Close();
 
 		// 3. remount the drive
-		r = TheFs.RemountDrive(driveNum);
-		test_KErrNone(r);
+		test(TheFs.RemountDrive(driveNum) == KErrNone);
 
 		// 4. check volume label
-		r = TheFs.Volume(v, driveNum);
-		test_KErrNone(r);
-		test.Printf(_L("VOL=\"%S\"\n"),&v.iName);
+		test(TheFs.Volume(v, driveNum) == KErrNone);
 		test(v.iName == _L("XXX"));
 		test.Printf(_L("- Passed.\n"));
 		}
@@ -1422,11 +1426,11 @@
 	// clean up
 	test.Next(_L("Set volume label to original"));
 	r=TheFs.SetVolumeLabel(n,driveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Volume(v,driveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
+	test(v.iName==n);
 	test.Printf(_L("VOL=\"%S\"\n"),&v.iName);
-	test(v.iName==n);
 
 	test.End();
 	}
@@ -1440,46 +1444,45 @@
 	test.Start(_L("Test modified/SetModified functions"));
 	TTime savedTime;
 	TInt r=TheFs.Modified(_L("\\F32-TST\\TFSRV\\T_FSRV.CPP"),savedTime);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TDateTime dateTime=savedTime.DateTime();
 	test.Printf(_L("T_FSRV.CPP last modified %d/%d/%d %d:%d:%d.%-06d\n"),dateTime.Day()+1,dateTime.Month()+1,dateTime.Year(),dateTime.Hour(),dateTime.Minute(),dateTime.Second(),dateTime.MicroSecond());
 	test.Next(_L("Set modified"));
 	dateTime.Set(1993,EAugust,23,1,13,54,123456);
 	TTime newTime(dateTime);
 	r=TheFs.SetModified(_L("\\F32-TST\\TFSRV\\T_FSRV.CPP"),newTime);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TTime checkTime;
 	r=TheFs.Modified(_L("\\XXXX\\YYYY\\ZZZZ.CPP"),checkTime);
-	test_Value(r, r == KErrPathNotFound);
+	test(r==KErrPathNotFound);
 	r=TheFs.Modified(_L("\\F32-TST\\TFSRV\\T_FSRV.CPP"),checkTime);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dateTime=checkTime.DateTime();	
-	test.Printf(_L("T_FSRV.CPP last modified %d/%d/%d %d:%d:%d.%-06d\n"),dateTime.Day()+1,dateTime.Month()+1,dateTime.Year(),dateTime.Hour(),dateTime.Minute(),dateTime.Second(),dateTime.MicroSecond());
 	test(dateTime.Year()==1993);
 	test(dateTime.Month()==EAugust);
 	test(dateTime.Day()==23);
 	test(dateTime.Hour()==1);
 	test(dateTime.Minute()==13);
 	test(dateTime.Second()==54);
+	test.Printf(_L("T_FSRV.CPP last modified %d/%d/%d %d:%d:%d.%-06d\n"),dateTime.Day()+1,dateTime.Month()+1,dateTime.Year(),dateTime.Hour(),dateTime.Minute(),dateTime.Second(),dateTime.MicroSecond());
 //		test(dateTime.MicroSecond()==123456); // dos is not accurate enough
 	r=TheFs.SetModified(_L("\\F32-TST\\TFSRV\\T_FSRV.CPP"),savedTime);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Modified(_L("\\F32-TST\\TFSRV\\T_FSRV.CPP"),checkTime);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(checkTime==savedTime);
 
 	RFile f;
 	r=f.Open(TheFs,_L("\\F32-TST\\TFSRV\\T_FSRV.CPP"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	dateTime.Set(1997,EJanuary,1,2,55,51,999999);
 	newTime=dateTime;
 	r=f.SetModified(newTime);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Modified(_L("\\F32-TST\\TFSRV\\T_FSRV.CPP"),checkTime);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	dateTime=checkTime.DateTime();	
-	test.Printf(_L("T_FSRV.CPP last modified via RFs::Modified() %d/%d/%d %d:%d:%d.%-06d\n"),dateTime.Day()+1,dateTime.Month()+1,dateTime.Year(),dateTime.Hour(),dateTime.Minute(),dateTime.Second(),dateTime.MicroSecond());
 	test(dateTime.Year()==1997);
 	test(dateTime.Month()==EJanuary);
 	test(dateTime.Day()==1);
@@ -1488,10 +1491,9 @@
 	test(dateTime.Second()>=50 && dateTime.Second()<=51); // Dos stores seconds %2
 
 	r=f.Modified(checkTime);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	dateTime=checkTime.DateTime();	
-	test.Printf(_L("T_FSRV.CPP last modified via RFile::Modified() %d/%d/%d %d:%d:%d.%-06d\n"),dateTime.Day()+1,dateTime.Month()+1,dateTime.Year(),dateTime.Hour(),dateTime.Minute(),dateTime.Second(),dateTime.MicroSecond());
 	test(dateTime.Year()==1997);
 	test(dateTime.Month()==EJanuary);
 	test(dateTime.Day()==1);
@@ -1501,10 +1503,9 @@
 	f.Close();
 
 	r=TheFs.Modified(_L("\\F32-TST\\TFSRV\\T_FSRV.CPP"),checkTime);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	dateTime=checkTime.DateTime();	
-	test.Printf(_L("T_FSRV.CPP last modified via RFs::Modified() %d/%d/%d %d:%d:%d.%-06d\n"),dateTime.Day()+1,dateTime.Month()+1,dateTime.Year(),dateTime.Hour(),dateTime.Minute(),dateTime.Second(),dateTime.MicroSecond());
 	test(dateTime.Year()==1997);
 	test(dateTime.Month()==EJanuary);
 	test(dateTime.Day()==1);
@@ -1528,27 +1529,23 @@
 	RFile file;
 	
 	TInt r=file.Open(TheFs, KFileName, 0 );
-	test_KErrNone(r);
+	if (r!=KErrNone)
+		{
+		test.Printf(_L("Error %d opening file %S\n"), r, &KFileName);
+		test(0);
+		}
 	
 	TFileName fileName;
 
 	// Check RFile::Name just retuns the file name, without path and drive
 	r=file.Name(fileName);
-	test_KErrNone(r);
-	if (fileName != KFileName)
-		{
-		test.Printf(_L("%S\n"), &fileName);
-		test(0);
-		}
+	test(r==KErrNone);
+	test(fileName==KFileName());
 
 	// Check RFile::FullName returns the complete file name and path
 	r=file.FullName(fileName);
-	test_KErrNone(r);
-	if (fileName.Mid(2)!=KFileNameAndPath)	// chop off drive letter + ':'
-		{
-		test.Printf(_L("%S\n"), &fileName);
-		test(0);
-		}
+	test(r==KErrNone);
+	test(fileName.Mid(2)==KFileNameAndPath); // chop off drive letter + ':'
 	
 	file.Close();
 	
@@ -1568,7 +1565,13 @@
 	TInt r=file.Replace(TheFs,fileName,EFileWrite);
 	if (r==KErrDiskFull)
 		return(r);
-	test_KErrNone(r);
+	if (r!=KErrNone)
+		{
+		test.Printf(_L("ERROR:: Replace returned %d\n"),r);
+		test(0);
+		//test.Getch();
+		return(KErrDiskFull);
+		}
 
 	if (!IsTestingLFFS())
 		r=file.SetSize(LargeFileSize);
@@ -1585,7 +1588,14 @@
 		file.Close();
 		return(r);
 		}
-	test_KErrNone(r);
+	if (r!=KErrNone)
+		{
+		test.Printf(_L("ERROR:: SetSize/Write returned %d\n"),r);
+		test(0);
+		//test.Getch();
+		file.Close();
+		return(KErrDiskFull);
+		}
 
 	file.Close();
 //	r=TheFs.CheckDisk(fileName);
@@ -1608,12 +1618,12 @@
 	TBuf<128> fileName=aBaseName;
 	fileName.AppendNum(aX);
 	TInt r=TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 //	r=TheFs.CheckDisk(fileName);
 //	if (r!=KErrNone && r!=KErrNotSupported)
 //		{
 //		test.Printf(_L("ERROR:: CheckDisk returned %d\n"),r);
-//		test_KErrNone(r);
+//		test(r==KErrNone);
 //		}
 	test.Printf(_L("Deleted File %d\n"),aX);
 	return(KErrNone);
@@ -1627,37 +1637,43 @@
 
 	test.Start(_L("Create and delete large files"));
 	TInt r=TheFs.MkDirAll(_L("\\F32-TST\\SMALLDIRECTORY\\"));
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	TBuf<128> fileName=_L("\\F32-TST\\SMALLDIRECTORY\\FILE");
 	r=CreateFileX(fileName,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=CreateFileX(fileName,1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=DeleteFileX(fileName,0);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=CreateFileX(fileName,2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=CreateFileX(fileName,1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=CreateFileX(fileName,3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=DeleteFileX(fileName,1);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=CreateFileX(fileName,4);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=DeleteFileX(fileName,2);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=DeleteFileX(fileName,3);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=DeleteFileX(fileName,4);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=CreateFileX(fileName,1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=DeleteFileX(fileName,1);	
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.CheckDisk(fileName);
-	test_Value(r, r == KErrNone || r == KErrNotSupported);
+	if (r!=KErrNone && r!=KErrNotSupported)
+		{
+		test.Printf(_L("ERROR:: CheckDisk returned %d\n"),r);
+		test(0);
+		//test.Getch();
+		}
+	
 	test.End();
 	}
 
@@ -1669,31 +1685,43 @@
 
 	test.Start(_L("Fill disk to capacity"));
 	TInt r=TheFs.MkDirAll(_L("\\F32-TST\\BIGDIRECTORY\\"));
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	TInt count=0;
 	TFileName sessionPath;
 	r=TheFs.SessionPath(sessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf<128> fileName=_L("\\F32-TST\\BIGDIRECTORY\\FILE");
 	FOREVER
 		{
 		TInt r=CreateFileX(fileName,count);
 		if (r==KErrDiskFull)
 			break;
-		test_KErrNone(r);
+		test(r==KErrNone);
 		count++;
-		if (Is_SimulatedSystemDrive(TheFs,gDrive) && count==32)
-			break;	// Limit on disk size for emulator/PlatSim
+#if defined(__WINS__)
+		if (count==32 && sessionPath[0]=='C')
+			break;
+#endif
 		}
 
 	r=TheFs.CheckDisk(fileName);
-	test_Value(r, r == KErrNone || r == KErrNotSupported);
+	if (r!=KErrNone && r!=KErrNotSupported)
+		{
+		test.Printf(_L("ERROR:: CheckDisk returned %d\n"),r);
+		test(0);
+		//test.Getch();
+		}
 
 	while(count--)
 		DeleteFileX(fileName,count);
 
 	r=TheFs.CheckDisk(fileName);
-	test_Value(r, r == KErrNone || r == KErrNotSupported);
+	if (r!=KErrNone && r!=KErrNotSupported)
+		{
+		test.Printf(_L("ERROR:: CheckDisk returned %d\n"),r);
+		test(0);
+		//test.Getch();
+		}
 
 	test.End();
 	}
@@ -1708,31 +1736,31 @@
 	fn[0] = gExeFileName[0];
 	TParse f;
 	TInt r=TheFs.Parse(fn,f);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Next(_L("Copying file to test directory"));
 	TParse fCopy;
 	r=TheFs.Parse(f.NameAndExt(),fCopy);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RFile f1;
 	r=f1.Open(TheFs,f.FullName(),EFileStreamText|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RFile f2;
 	r=f2.Replace(TheFs,fCopy.FullName(),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf8<512> copyBuf;
 	TInt rem;
 	r=f1.Size(rem);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt pos=0;
 	while (rem)
 		{
 		TInt s=Min(rem,copyBuf.MaxSize());
 		r=f1.Read(pos,copyBuf,s);
-		test_KErrNone(r);
-		test_Value(copyBuf.Length(), copyBuf.Length() == s);
+		test(r==KErrNone);
+		test(copyBuf.Length()==s);
 		r=f2.Write(pos,copyBuf,s);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		pos+=s;
 		rem-=s;
 		}
@@ -1762,26 +1790,26 @@
     
     //==========  just create a file
     nRes = TheFs.SetErrorCondition(KMyError,0); //-- set up FS error simulation
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     //-- this shall fail immediately 
     nRes = file.Replace(TheFs, KFileName, EFileWrite);
-    test_Value(nRes, nRes == KMyError);
+    test(nRes == KMyError);
 
     nRes = TheFs.SetErrorCondition(KErrNone); //-- disable FS error simulation
     file.Close();
 
     //========== create file & duplicate a handle #1
     nRes = TheFs.SetErrorCondition(KMyError,1); //-- set up FS error simulation
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     //-- this shall succeed
     nRes = file.Replace(TheFs, KFileName, EFileWrite); //-- err cnt -> 0
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     //-- this shall fail inside RFile::Duplicate() half way through in the RFile::DuplicateHandle()
     nRes = file1.Duplicate(file);
-    test_Value(nRes, nRes == KMyError);
+    test(nRes == KMyError);
     file1.Close();
     
     nRes = TheFs.SetErrorCondition(KErrNone); //-- disable FS error simulation
@@ -1789,19 +1817,19 @@
 
     //-- check that the file isn't locked
     nRes = TheFs.Delete(KFileName);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     //========== create file & duplicate a handle #2
     nRes = TheFs.SetErrorCondition(KMyError,2); //-- set up FS error simulation
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     //-- this shall succeed
     nRes = file.Replace(TheFs, KFileName, EFileWrite); //-- err cnt -> 1
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     //-- this must not fail, because EFsFileAdopt is excluded from the erros simulation
     nRes = file1.Duplicate(file);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
     file1.Close();
     
     nRes = TheFs.SetErrorCondition(KErrNone); //-- disable FS error simulation
@@ -1809,7 +1837,7 @@
 
     //-- check that the file isn't locked
     nRes = TheFs.Delete(KFileName);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     //========== crazy loop, for DEF103757
 
@@ -1831,7 +1859,7 @@
 
     //-- check that the file isn't locked
     nRes = TheFs.Delete(KFileName);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
 
 #endif
@@ -1849,14 +1877,14 @@
     F32_Test_Utils::SetConsole(test.Console()); 
     
     TInt nRes=TheFs.CharToDrive(gDriveToTest, gDrive);
-    test_KErrNone(nRes);
+    test(nRes==KErrNone);
     
     PrintDrvInfo(TheFs, gDrive);
 
 
 	TVolumeInfo v;
 	TInt r=TheFs.Volume(v, CurrentDrive());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	LargeFileSize=Max((TUint32)I64LOW(v.iFree >> 7), (TUint32)65536u);
 
     if (gFirstTime)
--- a/kerneltest/f32test/server/t_fsy2k.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_fsy2k.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include "t_server.h"
@@ -37,11 +36,11 @@
 	MakeFile(_L("Y2KTEST.tst"));
 	
 	TInt r=TheFs.SetEntry(_L("Y2KTEST.tst"),*aTime,KEntryAttHidden,KEntryAttArchive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TEntry entry;
 	r=TheFs.Entry(_L("Y2KTEST.tst"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TDateTime checkDateTime=(entry.iModified).DateTime();
 	test(checkDateTime.Year()==aDateTime->Year());
@@ -60,14 +59,14 @@
 	test.Printf(_L("Valid date: %S\n"),&gDateBuf);
 		
 	r=TheFs.Delete(_L("Y2KTEST.tst"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	MakeDir(_L("\\Y2KTEST\\"));
 	r=TheFs.SetEntry(_L("\\Y2KTEST\\"),*aTime,KEntryAttHidden,KEntryAttArchive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Entry(_L("\\Y2KTEST\\"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	checkDateTime=(entry.iModified).DateTime();
 	test(checkDateTime.Year()==aDateTime->Year());
@@ -86,7 +85,7 @@
 	test.Printf(_L("Valid date: %S\n"),&gDateBuf);
 
 	r=TheFs.RmDir(_L("\\Y2KTEST\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	}
 
@@ -99,11 +98,11 @@
 	MakeFile(_L("Y2KTEST.tst"));
 	
 	TInt r=TheFs.SetModified(_L("Y2KTEST.tst"),*aTime);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TTime check;
 	r=TheFs.Modified(_L("Y2KTEST.tst"),check);
-	test_KErrNone(r);
+	test(r==KErrNone);
 		
 	TDateTime checkDateTime=check.DateTime();
 	
@@ -124,14 +123,14 @@
 	test.Printf(_L("Valid date: %S\n"),&gDateBuf);
 		
 	r=TheFs.Delete(_L("Y2KTEST.tst"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	MakeDir(_L("\\Y2KTEST\\"));
 	r=TheFs.SetModified(_L("\\Y2KTEST\\"),*aTime);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Modified(_L("\\Y2KTEST\\"),check);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	checkDateTime=check.DateTime();
 	test(checkDateTime.Year()==aDateTime->Year());
@@ -150,7 +149,7 @@
 	test.Printf(_L("Valid date: %S\n"),&gDateBuf);
 
 	r=TheFs.RmDir(_L("\\Y2KTEST\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 	
@@ -161,16 +160,16 @@
 	{
 	RFile file;
 	TInt r=file.Replace(TheFs,_L("Y2KTEST.tst"),0);
-	test_Value(r, r == KErrNone || r==KErrPathNotFound);	
+	test(r==KErrNone || r==KErrPathNotFound);	
 		
 	r=file.Set(*aTime,KEntryAttHidden,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	
 	TTime check;
 	file.Open(TheFs,_L("Y2KTEST.tst"),EFileWrite);
 	r=file.Modified(check);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 		
 	test.Printf(_L("Date set to "));
@@ -224,16 +223,16 @@
 	{
 	RFile file;
 	TInt r=file.Replace(TheFs,_L("Y2KTEST.tst"),0);
-	test_Value(r, r == KErrNone || r==KErrPathNotFound);	
+	test(r==KErrNone || r==KErrPathNotFound);	
 
 	r=file.SetModified(*aTime);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	
 	TTime check;
 	file.Open(TheFs,_L("Y2KTEST.tst"),EFileWrite);
 	r=file.Modified(check);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 		
 	TDateTime checkDateTime=check.DateTime();
@@ -267,11 +266,11 @@
 	CFileMan* fileMan=CFileMan::NewL(TheFs);
 		
 	TInt r=fileMan->Attribs(_L("Y2KTEST.tst"),KEntryAttHidden,KEntryAttNormal,*aTime);
-	test_KErrNone(r);
+	test(r==KErrNone);
 		
 	TEntry entry;
 	r=TheFs.Entry(_L("Y2KTEST.tst"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TTime check=entry.iModified;	
 	TDateTime checkDateTime=check.DateTime();
@@ -293,7 +292,7 @@
 	test.Printf(_L("Valid date: %S\n"),&gDateBuf);
 
 	r=TheFs.Delete(_L("Y2KTEST.tst"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	delete fileMan;
 	}
@@ -494,7 +493,7 @@
 	for (i=0;i<KMaxValidDateTimes;i++)
 		{
 		TRAPD(error,testCFileManAttribsL(tempDateTime, tempTime, ETrue));
-		test_KErrNone(error);
+		test(error==KErrNone);
 		tempDateTime++;
 		tempTime++;
 		}
@@ -567,7 +566,7 @@
 		{
 		test.Printf(_L("Invalid date: %S\n"),&invalidDates[i]);
 		TRAPD(error,testCFileManAttribsL(tempDateTime, tempTime, EFalse));	
-		test_KErrNone(error);
+		test(error==KErrNone);
 		tempDateTime++;
 		tempTime++;
 		}
@@ -591,13 +590,13 @@
 		{
 	//	Dummy time is used to initialise validDateTime[i] before calling SetX()
 		r=validDateTime[i].Set(1998,EJune,23,11,11,11,0);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=validDateTime[i].SetYear(testYearValid[i]);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=validDateTime[i].SetMonth(testMonthValid[i]);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=validDateTime[i].SetDay(testDayValid[i]);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		validTime[i]=validDateTime[i];
 		}
 
@@ -611,15 +610,15 @@
 		{
 	//	Dummy time is used to initialise validDateTime[i] before calling SetX()
 		r=invalidDateTime[i].Set(1998,EJune,22,11,11,11,0);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=invalidDateTime[i].SetYear(testYearInvalid[i]);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=invalidDateTime[i].SetMonth(testMonthInvalid[i]);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=invalidDateTime[i].SetDay(testDayInvalid[i]);
-		test_Value(r, r == KErrGeneral);		//	This will fail because it is an invalid date
+		test(r==KErrGeneral);		//	This will fail because it is an invalid date
 		r=invalidDateTime[i].SetDay(testDayInvalid[i]-1);
-		test_KErrNone(r);			//	Set it one day less 
+		test(r==KErrNone);			//	Set it one day less 
 		invalidTime[i]=invalidDateTime[i];
 		invalidTime[i]+=extraDay;	//	Add on an extra day.  This should bump the
 		}							//	date onto the next month, NOT set the day
@@ -636,7 +635,7 @@
 	{
 
 	TInt r=TheFs.MkDirAll(_L("\\F32-TST\\YEAR 2000 TESTS\\"));
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	TRAP(r,CallTests());
 	if (r==KErrNone)
 		TheFs.ResourceCountMarkEnd();
@@ -646,5 +645,5 @@
 		test(0);
 		}
 	r=TheFs.RmDir(_L("\\F32-TST\\YEAR 2000 TESTS\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
--- a/kerneltest/f32test/server/t_fsys.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_fsys.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -36,10 +36,10 @@
     for(TInt i=EDriveA;i<KMaxDrives;++i)
         {
         r=TheFs.FileSystemName(name,i);
-        test_Value(r, r == KErrNone || r==KErrNotFound);
+        test(r==KErrNone || r==KErrNotFound);
         TChar c;
         r=RFs::DriveToChar(i,c);
-        test_KErrNone(r);
+        test(r==KErrNone);
         if(name.Length())       
             test.Printf(_L("File System Name on drive %c is %S\n"),(char)c,&name);
         else
@@ -55,10 +55,10 @@
     TInt r;
     TFullName oldSess, newSess;
     r=TheFs.SessionPath(oldSess);
-    test_KErrNone(r);
+    test(r==KErrNone);
     TChar c;
     r=TheFs.DriveToChar(aDrive,c);
-    test_KErrNone(r);
+    test(r==KErrNone);
     newSess.Append(c);
     newSess.Append(':');
     newSess.Append('\\');
@@ -66,7 +66,7 @@
     TBuf<128> b;
     TDriveInfo di;
     r=TheFs.Drive(di,aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
     b.Format(_L("Test dismounting of test file system on %c: (DrvAtt:%x MedAtt:%x)"),(TUint)c,di.iDriveAtt,di.iMediaAtt);
     test.Next(b);
     
@@ -74,36 +74,36 @@
     test.Next(_L("Test cannot dismount on Rom drive"));
     TFullName zName;
     r=TheFs.FileSystemName(zName,EDriveZ);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheFs.DismountFileSystem(zName,EDriveZ);
     test.Printf(_L("r=%d"),r);
     // NB if paging is enabled on a ROFS partition which is part of the composite file system then the 
     // likelihood is that there will be a at least one file clamped: in this case there error will be KErrInUse
-    test_Value(r, r == KErrAccessDenied || r==KErrInUse);
+    test(r==KErrAccessDenied || r==KErrInUse);
 
     // Test cannot dismount on wrong drive
     test.Next(_L("Test cannot dismount on wrong drive"));
     r=TheFs.DismountFileSystem(aFs,EDriveA);
-    test_Value(r, r == KErrNotReady);
+    test(r==KErrNotReady);
 
     // Test cannot dismount with wrong name
     test.Next(_L("Test cannot dismount with wrong file system name"));
     r=TheFs.DismountFileSystem(_L("abc"),aDrive);
-    test_Value(r, r == KErrNotFound);
+    test(r==KErrNotFound);
  
     // Test cannot dismount with a file open
     test.Next(_L("Test cannot dismount with a file open"));
     r=TheFs.SetSessionPath(newSess);
     RFile file;
     r=file.Replace(TheFs,_L("abc"),EFileShareAny);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheFs.SessionPath(newSess);
     TBool open;
     r=TheFs.IsFileOpen(_L("abc"),open);
-    test_KErrNone(r);
+    test(r==KErrNone);
     test(open);
     r=TheFs.DismountFileSystem(aFs,aDrive);
-    test_Value(r, r == KErrInUse);
+    test(r==KErrInUse);
     file.Close();
 
     // Now test dismount works
@@ -116,10 +116,10 @@
         }
     TFullName n;
     r=TheFs.FileSystemName(n,aDrive);
-    test_Value(r, r == KErrNone || r==KErrNotFound);
+    test(r==KErrNone || r==KErrNotFound);
     test(!n.Length());
     r=file.Replace(TheFs,_L("abc"),EFileShareAny);
-    test_Value(r, r == KErrNotReady);
+    test(r==KErrNotReady);
     file.Close();
 
     r=TheFs.MountFileSystem(aFs,aDrive);
@@ -129,13 +129,13 @@
         test(EFalse);
         }
     r=TheFs.FileSystemName(n,aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
     test(n.Compare(aFs)==0);
     r=file.Replace(TheFs,_L("abc"),EFileShareAny); // ??? bang
-    test_KErrNone(r);
+    test(r==KErrNone);
     file.Close();
     r=TheFs.SetSessionPath(oldSess);
-    test_KErrNone(r);
+    test(r==KErrNone);
     }
 
 static void TestDismountFileSystem(TInt aDrive)
@@ -144,7 +144,7 @@
     TInt r;
     TFullName name;
     r=TheFs.FileSystemName(name,aDrive);
-    test_Value(r, r == KErrNone || r==KErrNotFound);
+    test(r==KErrNone || r==KErrNotFound);
     if(name.Length())
         CheckDismount(name,aDrive);
     }
@@ -158,10 +158,10 @@
     TBuf<64> b;
     TChar c;
     TInt r=TheFs.DriveToChar(aDrive,c);
-    test_KErrNone(r);
+    test(r==KErrNone);
     TDriveInfo di;
     r=TheFs.Drive(di,aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
     b.Format(_L("Test mounting of test file system on %c: (DrvAtt:%x MedAtt:%x)"),(TUint)c,di.iDriveAtt,di.iMediaAtt);
     test.Next(b);
 
@@ -177,7 +177,7 @@
     r=TheFs.FileSystemName(oldFs,aDrive);
 //  TFileName oldFs;
 //  r=TheFs.FileSystemName(oldFs,aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheFs.DismountFileSystem(oldFs,aDrive);
     if(r!=KErrNone)
         {
@@ -185,17 +185,17 @@
         test(EFalse);
         }
     r=TheFs.MountFileSystem(_L("Test"),aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     TFileName newFs;
     r=TheFs.FileSystemName(newFs,aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
     test(newFs.Compare(_L("Test"))==0);
 
     // Check attributes
     TDriveInfo info;
     r=TheFs.Drive(info,aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
  
     test.Printf(_L("iType=%d,iConnectionBusType=%d,iDriveAtt=%x,iMediaAtt=%x\n"),(TUint)info.iType,\
         (TUint)info.iConnectionBusType,info.iDriveAtt,info.iMediaAtt);
@@ -208,14 +208,14 @@
         test(EFalse);
         }
     r=TheFs.FileSystemName(newFs,aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
     test(newFs.Compare(_L("Test"))==0);
 
     r=TheFs.DismountFileSystem(newFs,aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
 
     r=TheFs.MountFileSystem(oldFs,aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
     }
 #endif
 
@@ -236,10 +236,10 @@
 
     r = TheFs.AddFileSystem(KFsNm);
     test.Printf(_L("afs: r = %d\n"), r);
-    test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+    test(r == KErrNone || r == KErrAlreadyExists);
     test.Next(_L("mounting FAT on drive R"));
     r = TheFs.MountFileSystem(KFileSystemName_FAT, EDriveR);
-    test_Value(r, r == KErrArgument);
+    test(r == KErrArgument);
     
     test.End();
     }
@@ -256,10 +256,10 @@
     TBuf<64> b;
     TChar c;
     TInt r=TheFs.DriveToChar(aDrive,c);
-    test_KErrNone(r);
+    test(r==KErrNone);
     TDriveInfo di;
     r=TheFs.Drive(di,aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
     b.Format(_L("Test mounting of test file system on %c: (DrvAtt:%x MedAtt:%x)"),(TUint)c,di.iDriveAtt,di.iMediaAtt);
     test.Next(b);
 
@@ -273,7 +273,7 @@
 
     TFullName oldFs;
     r=TheFs.FileSystemName(oldFs,aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheFs.DismountFileSystem(oldFs,aDrive);
     if(r!=KErrNone)
         {
@@ -281,11 +281,11 @@
         test(EFalse);
         }
     r=TheFs.MountFileSystem(_L("Test2"),aDrive);
-    test_Value(r, r == KErrCorrupt);
+    test(r == KErrCorrupt);
 
     TFileName newFs;
     r=TheFs.FileSystemName(newFs,aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
     test(newFs.Compare(_L("Test2"))==0);
 
     // Get the number of remounts by checking the volume attributes -
@@ -293,7 +293,7 @@
     TDriveInfo info;
     TInt remounts;
     r=TheFs.Drive(info,aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
     test.Printf(_L("iType=%d,iBattery=%d,iDriveAtt=%x,iMediaAtt=%x\n"),(TUint)info.iType,\
         (TUint)info.iBattery,info.iDriveAtt,info.iMediaAtt);
     remounts = (TInt) info.iBattery;
@@ -309,10 +309,10 @@
         TEntry entry;
         _LIT(KNonExistantFilename, "NONEXISTANT_FILENAME.DLL");
         r = TheFs.Entry(KNonExistantFilename, entry);
-        test_Value(r, r == KErrCorrupt);
+        test(r == KErrCorrupt);
         }
     r=TheFs.Drive(info,aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
     test.Printf(_L("iType=%d,iBattery=%d,iDriveAtt=%x,iMediaAtt=%x\n"),(TUint)info.iType,\
         (TUint)info.iBattery,info.iDriveAtt,info.iMediaAtt);
     remounts = (TInt) info.iBattery;
@@ -328,10 +328,10 @@
         TEntry entry;
         _LIT(KNonExistantFilename, "NONEXISTANT_FILENAME.DLL");
         r = TheFs.Entry(KNonExistantFilename, entry);
-        test_Value(r, r == KErrCorrupt);
+        test(r == KErrCorrupt);
         }
     r=TheFs.Drive(info,aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
     test.Printf(_L("iType=%d,iBattery=%d,iDriveAtt=%x,iMediaAtt=%x\n"),(TUint)info.iType,\
         (TUint)info.iBattery,info.iDriveAtt,info.iMediaAtt);
     remounts = (TInt) info.iBattery;
@@ -341,9 +341,9 @@
 
 
     r=TheFs.DismountFileSystem(newFs,aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheFs.MountFileSystem(oldFs,aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
     
     r=TheFs.RemoveFileSystem(_L("Test2"));
     if(r!=KErrNone)
@@ -366,7 +366,7 @@
     
     TDriveInfo drvInfo;
     nRes=TheFs.Drive(drvInfo, currDrvNum);
-    test_KErrNone(nRes);
+    test(nRes==KErrNone);
 
     if(drvInfo.iDriveAtt & (KDriveAttRom | KDriveAttRedirected | KDriveAttSubsted))
     {
@@ -385,7 +385,7 @@
             {
             // found a non-extant drive, test it...
             nRes = TheFs.GetMediaSerialNumber(serNum, drvNum);
-            test_Value(nRes, nRes == KErrNotReady);
+            test(nRes == KErrNotReady);
             break;
             }
         }
@@ -406,15 +406,15 @@
     MakeDir(substPath);
   
     nRes = TheFs.SetSubst(substPath, KSubstDrv);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     //-- an attempt to obtain Media Serial Number on a substed drive shall result in KErrNotSupported
     nRes = TheFs.GetMediaSerialNumber(serNum, KSubstDrv);
-    test_Value(nRes, nRes == KErrNotSupported);
+    test(nRes == KErrNotSupported);
 
     //-- delete substed drive
     nRes = TheFs.SetSubst(_L(""), KSubstDrv);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 }
 
 
@@ -453,19 +453,19 @@
             {
             test.Printf(_L("Tested on drive: %c.\n"), (char)(i+'A'));
             r=TheFs.Drive(driveInfo, i);
-            test_KErrNone(r);
+            test(r==KErrNone);
             
             if (driveInfo.iType==EMediaNotPresent)
                 {
                 test.Printf(_L("The media is not present.\n"));
                 r = TheFs.QueryVolumeInfoExt(i, EFileSystemSubType, subName);
-                test_Value(r, r == KErrNone || r == KErrNotReady);
+                test(r == KErrNone || r == KErrNotReady);
                 }
             else if (driveInfo.iType==EMediaCdRom)
                 {
                 test.Printf(_L("CD ROM with no media will report not ready!\n"));
                 r = TheFs.QueryVolumeInfoExt(i, EFileSystemSubType, subName);
-                test_Value(r, r == KErrNotReady);
+                test(r == KErrNotReady);
                 }
             else
                 {
@@ -474,7 +474,7 @@
 
                 //-- test EIsDriveSync command
                 r = TheFs.QueryVolumeInfoExt(i, EIsDriveSync, fDrvSyncBuf);
-                test_KErrNone(r);
+                test(r == KErrNone);
                 if(fDrvSyncBuf())
                     test.Printf(_L("The drive is Synchronous.\n"));
                 else
@@ -485,7 +485,7 @@
                 // if Fat, testing returning sub type name
                 if (fsName.CompareF(KFileSystemName_FAT)==0)
                     {
-                    test_KErrNone(r);
+                    test(r == KErrNone);
                     test(subName().CompareF(KFSSubType_FAT12)==0 ||
                          subName().CompareF(KFSSubType_FAT16)==0 ||
                          subName().CompareF(KFSSubType_FAT32)==0);
@@ -495,27 +495,27 @@
                 // if Lffs, testing returning file system name
                 if (fsName.CompareF(_L("Lffs"))==0)
                     {
-                    test_KErrNone(r);
+                    test(r == KErrNone);
                     test(subName().CompareF(_L("Lffs"))==0);
                     continue;
                     }
                 // if rofs, testing returning file system name
                 if (fsName.CompareF(_L("rofs"))==0)
                     {
-                    test_KErrNone(r);
+                    test(r == KErrNone);
                     test(subName().CompareF(_L("rofs"))==0);
                     continue;
                     }
                 // if Composite, testing returning file system name
                 if (fsName.CompareF(_L("Composite"))==0)
                     {
-                    test_KErrNone(r);
+                    test(r == KErrNone);
                     test(subName().CompareF(_L("Composite"))==0);
                     continue;
                     }
 
                 // else
-                test_KErrNone(r);
+                test(r == KErrNone);
                 test(subName().Length()!=0);
                 
                 }
@@ -554,18 +554,18 @@
             test.Printf(_L("Tested on drive: %c.\n"), (char)(i+'A'));
 
             r=TheFs.Drive(driveInfo, i);
-            test_KErrNone(r);
+            test(r==KErrNone);
             // if no media present
             if (driveInfo.iType==EMediaNotPresent)
                 {
                 r = TheFs.QueryVolumeInfoExt(i, EIOParamInfo, ioInfo);
-                test_Value(r, r == KErrNone || r == KErrNotReady);
+                test(r == KErrNone || r == KErrNotReady);
                 }
             else if (driveInfo.iType==EMediaCdRom)
                 {
                 test.Printf(_L("CD ROM with no media!\n"));
                 r = TheFs.QueryVolumeInfoExt(i, EIOParamInfo, ioInfo);
-                test_Value(r, r == KErrNone || r == KErrNotReady);
+                test(r == KErrNone || r == KErrNotReady);
                 }
             else
                 {
@@ -602,7 +602,7 @@
                         }
                         TPckg<TLocalDriveCapsV7> capsPckg(DriveCapsV7);
                         r=drive.Caps(capsPckg);
-                        test_KErrNone(r);
+                        test(r==KErrNone);
                         drive.Disconnect();
                         if(DriveCapsV7.iObjectModeSize == 0)
                         {
@@ -663,18 +663,18 @@
             {
             test.Printf(_L("Tested on drive: %c.\n"), (char)(i+'A'));
             r=TheFs.Drive(driveInfo, i);
-            test_KErrNone(r);
+            test(r==KErrNone);
             // if no media present
             if (driveInfo.iType==EMediaNotPresent)
                 {
                 r = TheFs.QueryVolumeInfoExt(i, EIOParamInfo, ioInfo);
-                test_Value(r, r == KErrNone || r == KErrNotReady);
+                test(r == KErrNone || r == KErrNotReady);
                 }
             else if (driveInfo.iType==EMediaCdRom)
                 {
                 test.Printf(_L("CD ROM with no media will report not ready!\n"));
                 r = TheFs.QueryVolumeInfoExt(i, EIOParamInfo, ioInfo);
-                test_Value(r, r == KErrNotReady);
+                test(r == KErrNotReady);
                 }
             else
                 {
@@ -725,7 +725,7 @@
                         }
                     TPckg<TLocalDriveCapsV7> capsPckg(DriveCapsV7);
                     r=drive.Caps(capsPckg);
-                    test_KErrNone(r);
+                    test(r==KErrNone);
                     if ((fsName.CompareF(_L("Lffs"))==0) && (DriveCapsV7.iObjectModeSize != 0))
                         {                   
                         test(ioInfo().iBlockSize == (TInt) DriveCapsV7.iObjectModeSize);
@@ -780,7 +780,7 @@
             test.Printf(_L("Tested on drive: %c.\n"), (char)(i+'A'));
             r = TheFs.QueryVolumeInfoExt(i, EFileSystemSubType, subName);
             r1 = TheFs.FileSystemSubType(i, subName1);
-            test_Value(r, r == r1);
+            test(r==r1);
             if (subName().Length())
                 {
                 test(subName().CompareF(subName1)==0);
@@ -822,7 +822,7 @@
             test.Printf(_L("Tested on drive: %c.\n"), (char)(i+'A'));
             r = TheFs.QueryVolumeInfoExt(i, EIOParamInfo, ioInfo);
             r1 = TheFs.VolumeIOParam(i, ioInfo1);
-            test_Value(r, r == r1);
+            test(r==r1);
             test(ioInfo().iBlockSize == ioInfo1.iBlockSize);
             test(ioInfo().iClusterSize == ioInfo1.iClusterSize);
             test(ioInfo().iRecReadBufSize == ioInfo1.iRecReadBufSize);
@@ -865,7 +865,7 @@
         }
     TFSName oldFs;
     r = TheFs.FileSystemName(oldFs,aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r = TheFs.DismountFileSystem(oldFs,aDrive);
     if (r != KErrNone)
         {
@@ -873,29 +873,29 @@
         test(EFalse);
         }
     r = TheFs.MountFileSystem(_L("Test3"),aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
     TFSName newFs;
     r = TheFs.FileSystemName(newFs,aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
     test(newFs.Compare(_L("Test3"))==0);
 
     // Sub type name query: 
     TPckgBuf<TFSName> subNameP;
     r = TheFs.QueryVolumeInfoExt(aDrive, EFileSystemSubType, subNameP);
-    test_KErrNone(r);
+    test(r==KErrNone);
     test(subNameP() == _L("Test3SubType"));
 
     // Cluster size querys:
     TPckgBuf<TVolumeIOParamInfo> ioInfoP;
     r = TheFs.QueryVolumeInfoExt(aDrive, EIOParamInfo, ioInfoP);
-    test_KErrNone(r);
+    test(r==KErrNone);
     test(ioInfoP().iClusterSize==1024);
 
     // Mount the original file system back
     r=TheFs.DismountFileSystem(newFs,aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r=TheFs.MountFileSystem(oldFs,aDrive);
-    test_KErrNone(r);
+    test(r==KErrNone);
     
     r=TheFs.RemoveFileSystem(_L("Test3"));
     if(r!=KErrNone)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/f32test/server/t_ftrace.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,423 @@
+// 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:
+// f32test\server\t_ftrace.cpp
+// 
+//
+
+#include <f32file.h>
+#include <f32tracedef.h>
+#include <e32test.h>
+#include "t_server.h"
+
+#include "../../../kernel/eka/include/d32btrace.h"
+#include "../../../kernel/eka/include/e32btrace.h"
+#include <utraceefsrv.h>
+
+RTest test(_L("T_FTRACE"));
+
+RBTrace Trace;
+
+void SetBTraceFilter(const TUint32* aNew,TUint32* aOld)
+	{
+	TUint category = 0;
+	do
+		{
+		TUint32 newBits = *aNew++;
+		TUint32 oldBits = 0;
+		do
+			{
+			oldBits >>= 1;
+			if(Trace.SetFilter(category,newBits&1))
+				oldBits |= 0x80000000u;
+			newBits >>= 1;
+			++category;
+			}
+		while(category&31);
+		if(aOld)
+			*aOld++ = oldBits;
+		}
+	while(category<256);
+	}
+
+
+
+//---------------------------------------------------------------------------------------------------------------------
+//! @SYMTestCaseID				KBASE-T_FTRACE-0001
+//! @SYMTestCaseDesc			Test File Server Tracing of RFile::Replace()
+//! @SYMTestType				UT
+//! @SYMPREQ					PREQ1617
+//! @SYMTestPriority			Medium
+//! @SYMTestActions				
+//! 	1.	Call RFile::Replace() to create a file
+//! 	2.	Get trace data from BTrace and verify that the expected trace data is present
+//! 
+//! @SYMTestExpectedResults
+//! 	1.	Trace data payload should be as expected, i.e. it should contain the file name, mode etc.
+//---------------------------------------------------------------------------------------------------------------------
+void TestRFileReplace()
+	{
+	test.Start(_L("Test trace output from creating a file"));
+	RFile file;
+	TFileName testFileName = _L("File.txt");
+
+	TheFs.Delete(testFileName);
+
+	Trace.Empty();
+
+	TInt r = file.Replace(TheFs,testFileName,EFileStreamText);
+	test(r==KErrNone);
+
+
+	TBool funcInFound = EFalse;
+	TBool funcOutFound = EFalse;
+
+	TBuf8<1024> buf;
+	for(;;)
+		{
+		TUint8* record;
+		TInt dataSize = Trace.GetData(record);
+		if(!dataSize)
+			break;
+		TUint8* end = record+dataSize;
+
+		while(record<end)
+			{
+			TUint size = record[BTrace::ESizeIndex];
+			TUint flags = record[BTrace::EFlagsIndex];
+			TUint category = record[BTrace::ECategoryIndex];
+			TUint subCategory = record[BTrace::ESubCategoryIndex];
+			TUint8* data = record+4;
+			size -= 4;
+
+			buf.Zero();
+			if(flags&(BTrace::EHeader2Present))
+				{
+				data += 4;
+				size -= 4;
+				}
+
+			if((flags&(BTrace::ETimestampPresent|BTrace::ETimestamp2Present))==(BTrace::ETimestampPresent|BTrace::ETimestamp2Present))
+				{
+				buf.AppendFormat(_L8("time:%08x:%08x "),((TUint32*)data)[1],*(TUint32*)data);
+				data += 8;
+				size -= 8;
+				}
+			else if(flags&(BTrace::ETimestampPresent|BTrace::ETimestamp2Present))
+				{
+				buf.AppendFormat(_L8("time:%08x "),*(TUint32*)data);
+				data += 4;
+				size -= 4;
+				}
+
+			if(flags&(BTrace::EContextIdPresent))
+				{
+				buf.AppendFormat(_L8("context:%08x "),*(TUint32*)data);
+				data += 4;
+				size -= 4;
+				}
+			else
+				{
+				buf.AppendFormat(_L8("                 "));
+				}
+
+			if(flags&(BTrace::EPcPresent))
+				{
+				buf.AppendFormat(_L8("pc:%08x "),*(TUint32*)data);
+				data += 4;
+				size -= 4;
+				}
+
+			if(flags&(BTrace::EExtraPresent))
+				{
+				data += 4;
+				size -= 4;
+				}
+
+			TUint32 data0 = (size>0) ? *(TUint32*)(data) : 0;
+			TUint32 data1 = (size>4) ? *(TUint32*)(data+4) : 0;
+			TPtrC8 des(0,0);
+			if(size>=8)
+				des.Set(data+8,size-8);
+
+			buf.AppendFormat(_L8("size:%d flags:%02x cat:%d,%d data: "),size,flags,category,subCategory);
+			for(TUint i=0; i<size; i+=4)
+				buf.AppendFormat(_L8("%08x "),*(TUint32*)(data+i));
+			buf.Append('\r');
+			buf.Append('\n');
+			test(buf.MaxLength() >= (buf.Length()*2));
+			RDebug::RawPrint(buf.Expand());
+
+
+			if (category == UTF::EBorder && subCategory == 0 && data0 == EF32TraceUidEfsrv)
+				{
+				if (data1 == UTraceModuleEfsrv::EFileReplace)
+					{
+					TInt sessionHandle = (size>8) ? *(TUint32*)(data+8) : 0;
+					TUint32 fileMode = (size>12) ? *(TUint32*)(data+12) : 0;
+					TInt fileNameLen = (size>16) ? *(TUint32*)(data+16) : 0;
+					fileNameLen/= 2;	// convert to unicode length
+					TText16* fileName = (TText16*) ((size>20) ? (data+20) : NULL);
+
+					test(sessionHandle == TheFs.Handle());
+					test(fileMode == EFileStreamText);
+					test(fileNameLen == testFileName.Length());
+					TPtrC16 fileNamePtr (fileName, fileNameLen);
+					test(fileName != NULL);
+					test(testFileName.Compare(fileNamePtr) == 0);
+					funcInFound = ETrue;
+					}
+				else if (data1 == UTraceModuleEfsrv::EFileReplaceReturn)
+					{
+					TInt retCode = (size>8) ? *(TUint32*)(data+8) : 0;
+					TInt subsessionHandle = (size>12) ? *(TUint32*)(data+12) : 0;
+
+					test(retCode == KErrNone);
+					test(subsessionHandle == file.SubSessionHandle());
+					funcOutFound = ETrue;
+					}
+				}
+
+			record = BTrace::NextRecord(record);
+			}
+		Trace.DataUsed();
+		}
+
+	file.Close();
+	TheFs.Delete(testFileName);
+
+	test (funcInFound);
+	test (funcOutFound);
+	}
+
+//---------------------------------------------------------------------------------------------------------------------
+//! @SYMTestCaseID				KBASE-T_FTRACE-0002
+//! @SYMTestCaseDesc			Test File Server Tracing of RFs::Rename()
+//! @SYMTestType				UT
+//! @SYMPREQ					PREQ1617
+//! @SYMTestPriority			Medium
+//! @SYMTestActions				
+//! 	1.	Call RFile::Replace() to create a file
+//! 	2.	Close the file
+//! 	3.	Call RFs::Rename to rename the file
+//! 	4.	Get trace data from BTrace and verify that the expected trace data is present
+//! 
+//! @SYMTestExpectedResults
+//! 	1.	Trace data payload should be as expected, i.e. it should contain both file names, etc.
+//---------------------------------------------------------------------------------------------------------------------
+void TestRFsRename()
+	{
+	test.Start(_L("Test trace output from renaming a file"));
+	RFile file;
+	TFileName testFileName1 = _L("File1.txt");
+	TFileName testFileName2 = _L("File2.txt");
+
+	TheFs.Delete(testFileName1);
+	TheFs.Delete(testFileName2);
+
+	TInt r = file.Replace(TheFs,testFileName1,EFileStreamText);
+	test(r==KErrNone || KErrAlreadyExists);
+	file.Close();
+
+	Trace.Empty();
+
+	r = TheFs.Rename(testFileName1, testFileName2);
+	test(r==KErrNone);
+
+
+	TBool funcInFound = EFalse;
+	TBool funcOutFound = EFalse;
+
+	TBuf8<1024> buf;
+	for(;;)
+		{
+		TUint8* record;
+		TInt dataSize = Trace.GetData(record);
+		if(!dataSize)
+			break;
+		TUint8* end = record+dataSize;
+
+		while(record<end)
+			{
+			TUint size = record[BTrace::ESizeIndex];
+			TUint flags = record[BTrace::EFlagsIndex];
+			TUint category = record[BTrace::ECategoryIndex];
+			TUint subCategory = record[BTrace::ESubCategoryIndex];
+			TUint8* data = record+4;
+			size -= 4;
+
+			buf.Zero();
+			if(flags&(BTrace::EHeader2Present))
+				{
+				data += 4;
+				size -= 4;
+				}
+
+			if((flags&(BTrace::ETimestampPresent|BTrace::ETimestamp2Present))==(BTrace::ETimestampPresent|BTrace::ETimestamp2Present))
+				{
+				buf.AppendFormat(_L8("time:%08x:%08x "),((TUint32*)data)[1],*(TUint32*)data);
+				data += 8;
+				size -= 8;
+				}
+			else if(flags&(BTrace::ETimestampPresent|BTrace::ETimestamp2Present))
+				{
+				buf.AppendFormat(_L8("time:%08x "),*(TUint32*)data);
+				data += 4;
+				size -= 4;
+				}
+
+			if(flags&(BTrace::EContextIdPresent))
+				{
+				buf.AppendFormat(_L8("context:%08x "),*(TUint32*)data);
+				data += 4;
+				size -= 4;
+				}
+			else
+				{
+				buf.AppendFormat(_L8("                 "));
+				}
+
+			if(flags&(BTrace::EPcPresent))
+				{
+				buf.AppendFormat(_L8("pc:%08x "),*(TUint32*)data);
+				data += 4;
+				size -= 4;
+				}
+
+			if(flags&(BTrace::EExtraPresent))
+				{
+				data += 4;
+				size -= 4;
+				}
+
+			TUint32 data0 = (size>0) ? *(TUint32*)(data) : 0;
+			TUint32 data1 = (size>4) ? *(TUint32*)(data+4) : 0;
+			TPtrC8 des(0,0);
+			if(size>=8)
+				des.Set(data+8,size-8);
+
+			buf.AppendFormat(_L8("size:%d flags:%02x cat:%d,%d data: "),size,flags,category,subCategory);
+			for(TUint i=0; i<size; i+=4)
+				buf.AppendFormat(_L8("%08x "),*(TUint32*)(data+i));
+			buf.Append('\r');
+			buf.Append('\n');
+			test(buf.MaxLength() >= (buf.Length()*2));
+			RDebug::RawPrint(buf.Expand());
+
+
+			if (category == UTF::EBorder && subCategory == 0 && data0 == EF32TraceUidEfsrv)
+				{
+				TUint8* recData = data+8;
+				if (data1 == UTraceModuleEfsrv::EFsRename)
+					{
+					TInt sessionHandle = *(TUint32*) recData; recData+= 4;
+
+					TInt fileNameLen1 = *(TUint32*) recData; recData+= 4;
+					TText16* fileName1 = (TText16*) recData; recData+= ((fileNameLen1 +4) & ~3);
+
+					TInt fileNameLen2 = *(TUint32*) recData; recData+= 4;
+					TText16* fileName2 = (TText16*) recData; recData+= fileNameLen2;
+
+					fileNameLen1/= 2;	// convert to unicode length
+					fileNameLen2/= 2;	// convert to unicode length
+
+
+					test(sessionHandle == TheFs.Handle());
+					
+					test(fileNameLen1 == testFileName1.Length());
+					TPtrC16 fileNamePtr1 (fileName1, fileNameLen1);
+					test(fileName1 != NULL);
+					test(testFileName1.Compare(fileNamePtr1) == 0);
+
+					test(fileNameLen2 == testFileName2.Length());
+					TPtrC16 fileNamePtr2 (fileName2, fileNameLen2);
+					test(fileName2 != NULL);
+					test(testFileName2.Compare(fileNamePtr2) == 0);
+
+					funcInFound = ETrue;
+					}
+				else if (data1 == UTraceModuleEfsrv::EFsRenameReturn)
+					{
+					TInt retCode = (size>8) ? *(TUint32*)(data+8) : 0;
+
+					test(retCode == KErrNone);
+
+					funcOutFound = ETrue;
+					}
+				}
+
+			record = BTrace::NextRecord(record);
+			}
+		Trace.DataUsed();
+		}
+
+
+	test (funcInFound);
+	test (funcOutFound);
+
+	TheFs.Delete(testFileName1);
+	TheFs.Delete(testFileName2);
+	}
+
+void CallTestsL()
+	{
+
+// By default, file server trace-points are only compiled in in debug mode
+#if defined(_DEBUG)
+	test.Title();
+	TInt r;
+
+	test.Start(_L("Open LDD"));
+	r = Trace.Open();
+	test(r == KErrNone);
+
+
+	TUint32 OldTraceFilter[8] = {0};
+
+	TUint savedMode = Trace.Mode();
+	SetBTraceFilter(OldTraceFilter,OldTraceFilter);
+
+	Trace.ResizeBuffer(0x100000);
+	Trace.Empty();
+
+	Trace.SetMode(RBTrace::EEnable | RBTrace::EFreeRunning);
+
+	TBool b;
+//	b = Trace.SetFilter(BTrace::EThreadIdentification, ETrue);
+//	test(b >= 0);
+	b = Trace.SetFilter(UTF::EPanic, ETrue);
+	test(b >= 0);
+	b = Trace.SetFilter(UTF::EError, ETrue);
+	test(b >= 0);
+	b = Trace.SetFilter(UTF::EBorder, ETrue);
+	test(b >= 0);
+
+	b = Trace.SetFilter2(EF32TraceUidEfsrv, ETrue);
+	test(b >= 0);
+
+	TestRFileReplace();
+	TestRFsRename();
+
+	// restore trace settings...
+	Trace.SetMode(0);
+	SetBTraceFilter(OldTraceFilter,OldTraceFilter);
+	Trace.SetMode(savedMode);
+
+
+	test.Next(_L("Close LDD"));
+	Trace.Close();
+
+	test.End();
+#endif
+	}
+
--- a/kerneltest/f32test/server/t_gdir.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_gdir.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -13,7 +13,6 @@
 // Description:
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include "t_server.h"
@@ -111,13 +110,13 @@
 	TPtrC fileName(aFileName.iFileName);
 	TAutoClose<RFile> file;
 	TInt r=file.iObj.Replace(TheFs,fileName,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TPtrC8 uidBuf((TUint8*)&checkedUid,sizeof(TCheckedUid));
 	r=file.iObj.Write(uidBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TPtrC8 contents(aFileName.iContents);
 	r=file.iObj.Write(contents);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 LOCAL_C void createFile(TInt anIndex)
@@ -135,11 +134,11 @@
 //
 	TAutoClose<RFile> file;
 	TInt r=file.iObj.Replace(TheFs,fName,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf8<36> b((TUint8*)"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ");
 	b.SetLength(anIndex+1);
 	r=file.iObj.Write(b);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 LOCAL_C void createDir(TInt anIndex)
@@ -156,7 +155,7 @@
     test.Next(mes);
 //
 	TInt r=TheFs.MkDir(dName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 LOCAL_C void testSetup()
@@ -168,7 +167,7 @@
 	test.Next(_L("Remove test directory"));
 	CDir* pD;
 	TInt r=TheFs.GetDir(test_dir_1,KEntryAttMaskSupported,EDirsLast,pD);
-	test_Value(r, r == KErrNone || r==KErrNotFound || r==KErrPathNotFound);
+	test(r==KErrNone || r==KErrNotFound || r==KErrPathNotFound);
 	if (r==KErrNone)
 		{
 		TInt count=pD->Count();
@@ -181,14 +180,14 @@
 				TFileName name;
 				name.Format(_L("%S%S\\"),&test_dir,&e.iName);
 				r=TheFs.RmDir(name);
-				test_KErrNone(r);
+				test(r==KErrNone);
 				}
 			else
 				{
 				TFileName name;
 				name.Format(_L("%S%S"),&test_dir,&e.iName);
 				r=TheFs.Delete(name);
-				test_KErrNone(r);
+				test(r==KErrNone);
 				}
 			}
 		}
@@ -217,28 +216,28 @@
 	test.Next(_L("Test directory handling"));
 	CDir* pD;
 	TInt r=TheFs.GetDir(test_dir_1,KEntryAttMaskSupported,EDirsLast,pD);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	displayDir(*pD,dCount,fCount);
 	test(dCount==4 && fCount==9);
 	delete pD;
 //
 	test.Next(_L("Attributes: NULL"));
 	r=TheFs.GetDir(test_dir_1,NULL,EDirsLast,pD);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	displayDir(*pD,dCount,fCount);
 	test(dCount==0 && fCount==9);
 	delete pD;
 //
 	test.Next(_L("Attributes: KEntryAttDir & EDescending sort"));
 	r=TheFs.GetDir(test_dir_1,KEntryAttDir,ESortByName|EDescending,pD);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	displayDir(*pD,dCount,fCount);
 	test(dCount==4 && fCount==9);
 	delete pD;
 //	
 	test.Next(_L("Attributes: Excl,Dir"));
 	r=TheFs.GetDir(test_dir_1,KEntryAttMatchExclusive|KEntryAttDir,ESortByName|EDescending,pD);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	displayDir(*pD,dCount,fCount);
 	test(dCount==4 && fCount==0);
 	delete pD;
@@ -247,7 +246,7 @@
 //
 	test.Next(_L("Test split directories and files"));
 	r=TheFs.GetDir(test_dir_1,KEntryAttMaskSupported,ESortByName,pD,pD2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("FileList:\n"));
 	displayDir(*pD,dCount,fCount);
 	test(dCount==4 && fCount==9);
@@ -259,7 +258,7 @@
 //
 	test.Next(_L("Attributes: NULL"));
 	r=TheFs.GetDir(test_dir_1,NULL,ESortByName,pD,pD2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("FileList:\n"));
 	displayDir(*pD,dCount,fCount);
 	test(dCount==0 && fCount==9);
@@ -271,7 +270,7 @@
 //
 	test.Next(_L("Attributes: KEntryAttDir"));
 	r=TheFs.GetDir(test_dir_1,KEntryAttDir,ESortByName,pD,pD2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("FileList:\n"));
 	displayDir(*pD,dCount,fCount);
 	test(dCount==4 && fCount==9);
@@ -283,7 +282,7 @@
 //
 	test.Next(_L("Attributes: Excl,Dir"));
 	r=TheFs.GetDir(test_dir_1,KEntryAttMatchExclusive|KEntryAttDir,ESortByName,pD,pD2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("FileList:\n"));
 	displayDir(*pD,dCount,fCount);
 	test(dCount==4 && fCount==0);
@@ -304,7 +303,7 @@
 	TInt dCount,fCount;
 	CDir* pD;
 	TInt r=TheFs.GetDir(_L("Z:\\*"),KEntryAttMaskSupported,EDirsFirst,pD);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	displayDir(*pD,dCount,fCount);
 	delete pD;
 	}
@@ -318,7 +317,7 @@
 	test.Next(_L("Display contents of current directory"));
 	CDir* pD;
 	TInt r=TheFs.GetDir(gSessionPath,KEntryAttMaskSupported,EDirsFirst,pD);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt dCount,fCount;
 	displayDir(*pD,dCount,fCount);
 	delete pD;
@@ -328,7 +327,7 @@
 	TBuf<16> noName=_L("asdf.idd");
 	parser.Set(session.Drive(),&noName,NULL);
 	r=TheFs.GetDir(parser.FullName(),KEntryAttMaskSupported,EDirsFirst,pD);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(pD->Count()==0);
 	delete pD;
 	}
@@ -350,14 +349,14 @@
 
 	RFile f;
 	TInt r=f.Open(TheFs,entry.iName,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf8<256> contents;
 	r=f.Read(sizeof(TCheckedUid),contents);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TPtrC8 uidFileContents(uidFiles[aUidFile].iContents);
 	test(contents==uidFileContents);
 	r=f.Read(contents);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(contents.Length()==0);
 	f.Close();
 	}
@@ -390,7 +389,7 @@
 	TUidType matchUid(TUid::Null(),TUid::Uid(2),TUid::Null());
 	CDir* fileList;
 	TInt r=TheFs.GetDir(matchName,matchUid,EAscending,fileList);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt count=fileList->Count();
 	test(count==1);
 	MatchUidFile(0,0,fileList);
@@ -399,7 +398,7 @@
 	matchName=_L("*.*");
 	matchUid=TUidType(TUid::Uid(1),TUid::Uid(2),TUid::Uid(731));
 	r=TheFs.GetDir(matchName,matchUid,EAscending,fileList);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=fileList->Count();
 	test(count==1);
 	MatchUidFile(0,0,fileList);
@@ -408,7 +407,7 @@
 	matchName=_L("*.*");
 	matchUid=TUidType(TUid::Null(),TUid::Uid(2),TUid::Null());
 	r=TheFs.GetDir(matchName,matchUid,ESortByName|EAscending,fileList);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=fileList->Count();
 	test(count==3);
 	MatchUidFile(0,2,fileList);
@@ -419,7 +418,7 @@
 	matchName=_L("*.*");
 	matchUid=TUidType(TUid::Null(),TUid::Null(),TUid::Uid(731));
 	r=TheFs.GetDir(matchName,matchUid,ESortByName|EAscending,fileList);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=fileList->Count();
 	test(count==3);
 	MatchUidFile(2,0,fileList);
@@ -429,7 +428,7 @@
 
 	matchName=_L("*.*");
 	r=TheFs.GetDir(matchName,KEntryAttNormal,ESortByUid|EAscending,fileList);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=fileList->Count();
 	MatchUidFile(4,0,fileList);
 	MatchUidFile(1,1,fileList);
@@ -458,7 +457,7 @@
 	TUidType matchUid(TUid::Null(),TUid::Uid(0x1000008c),TUid::Null());
 	CDir* fileList;
 	TInt r=TheFs.GetDir(PlatSec::ConfigSetting(PlatSec::EPlatSecEnforceSysBin)?_L("Z:\\SYS\\BIN\\"):_L("Z:\\SYSTEM\\BIN\\"),matchUid,EAscending,fileList);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt count=fileList->Count();
 #if defined(__WINS__)
 	test(count==0);
@@ -491,7 +490,7 @@
 	TUint onlyRO=KEntryAttReadOnly|KEntryAttMatchExclusive;
 	CDir* fileList;
 	TInt r=TheFs.GetDir(_L("\\F32-TST\\GDIR\\*.CCC"),onlyRO,EAscending,fileList);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt count=fileList->Count();
 	test(count==2);
 
@@ -505,7 +504,7 @@
 	test.Next(_L("Can match everything except read only files"));
 	TUint excludeRO=KEntryAttReadOnly|KEntryAttMatchExclude;
 	r=TheFs.GetDir(_L("\\F32-TST\\GDIR\\*.CCC"),excludeRO,EAscending,fileList);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=fileList->Count();
 	test(count==4);
 
@@ -522,7 +521,7 @@
 	test.Next(_L("Can match everything except system and readonly files"));
 	TUint excludeSystemAndRO=KEntryAttReadOnly|KEntryAttSystem|KEntryAttMatchExclude;
 	r=TheFs.GetDir(_L("\\F32-TST\\GDIR\\*.CCC"),excludeSystemAndRO,EAscending,fileList);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=fileList->Count();
 	test(count==2);
 
@@ -533,9 +532,9 @@
 	delete fileList;
 
 	r=TheFs.SetAtt(_L("\\F32-TST\\GDIR\\RONLY1.CCC"),0,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetAtt(_L("\\F32-TST\\GDIR\\RONLY2.CCC"),0,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 LOCAL_C void testGetHidden()
@@ -555,22 +554,22 @@
 	MakeDir(_L("\\F32-TST\\GDIR\\Dirhiddensystem.qqq\\"));
 
 	TInt r=TheFs.SetAtt(_L("FileHidden.qqq"),KEntryAttHidden,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetAtt(_L("Filesystem.qqq"),KEntryAttSystem,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetAtt(_L("FilehiddenSystem.qqq"),KEntryAttSystem|KEntryAttHidden,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetAtt(_L("dirhidden.qqq"),KEntryAttHidden,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetAtt(_L("dirsystem.qqq"),KEntryAttSystem,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetAtt(_L("dirhiddensystem.qqq"),KEntryAttSystem|KEntryAttHidden,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 // Files and directories not hidden or system
 	CDir* dir;
 	r=TheFs.GetDir(_L("*.qqq"),KEntryAttDir,ESortByName,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt count=dir->Count();
 	test(count==2);
 	TEntry entry;
@@ -582,7 +581,7 @@
 	
 // Files only
 	r=TheFs.GetDir(_L("*.qqq"),KEntryAttNormal,ESortByName,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=dir->Count();
 	test(count==1);
 	entry=(*dir)[0];
@@ -591,7 +590,7 @@
 
 // Directories only
 	r=TheFs.GetDir(_L("*.qqq"),KEntryAttDir|KEntryAttMatchExclusive,ESortByName,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=dir->Count();
 	test(count==1);
 	entry=(*dir)[0];
@@ -600,7 +599,7 @@
 
 // Files + hidden
 	r=TheFs.GetDir(_L("*.qqq"),KEntryAttHidden,ESortByName,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=dir->Count();
 	test(count==2);
 	entry=(*dir)[0];
@@ -611,7 +610,7 @@
 
 // Files + system
 	r=TheFs.GetDir(_L("*.qqq"),KEntryAttHidden,ESortByName,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=dir->Count();
 	test(count==2);
 	entry=(*dir)[0];
@@ -622,7 +621,7 @@
 
 // Files + hidden + system
 	r=TheFs.GetDir(_L("*.qqq"),KEntryAttHidden|KEntryAttSystem,ESortByName,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=dir->Count();
 	test(count==4);
 	entry=(*dir)[0];
@@ -637,7 +636,7 @@
 
 // Dirs + hidden
 	r=TheFs.GetDir(_L("*.qqq"),KEntryAttHidden|KEntryAttDir|KEntryAttMatchExclusive,ESortByName,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=dir->Count();
 	test(count==2);
 	entry=(*dir)[0];
@@ -648,7 +647,7 @@
 
 // Dirs + system
 	r=TheFs.GetDir(_L("*.qqq"),KEntryAttSystem|KEntryAttDir|KEntryAttMatchExclusive,ESortByName,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=dir->Count();
 	test(count==2);
 	entry=(*dir)[0];
@@ -659,7 +658,7 @@
 
 // Dirs + hidden + system
 	r=TheFs.GetDir(_L("*.qqq"),KEntryAttHidden|KEntryAttSystem|KEntryAttDir|KEntryAttMatchExclusive,ESortByName,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=dir->Count();
 	test(count==4);
 	entry=(*dir)[0];
@@ -675,7 +674,7 @@
 
 // Files + Dirs + hidden
 	r=TheFs.GetDir(_L("*.qqq"),KEntryAttHidden|KEntryAttDir,ESortByName,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=dir->Count();
 	test(count==4);
 	entry=(*dir)[0];
@@ -690,7 +689,7 @@
 
 // Files + Dirs + system
 	r=TheFs.GetDir(_L("*.qqq"),KEntryAttSystem|KEntryAttDir,ESortByName,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=dir->Count();
 	test(count==4);
 	entry=(*dir)[0];
@@ -705,7 +704,7 @@
 
 // Files + Dirs + hidden + system
 	r=TheFs.GetDir(_L("*.qqq"),KEntryAttHidden|KEntryAttSystem|KEntryAttDir,ESortByName,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=dir->Count();
 	test(count==8);
 	entry=(*dir)[0];
@@ -782,7 +781,7 @@
 	CDir* dir;
 	TUint sortOrder=ESortByName|EDirsFirst|EDescending;
 	TInt r=TheFs.GetDir(gDirDescendingBaseName,KEntryAttMaskSupported,sortOrder,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 //	TBuf8<16> result=_L("2,1,0,3,4,5");
 	TBuf<16> result=_L("2,1,0,3,4,5");
 
@@ -791,7 +790,7 @@
 // Test DirFirst - EAscending
 	sortOrder=ESortByName|EDirsFirst;
 	r=TheFs.GetDir(gDirDescendingBaseName,KEntryAttMaskSupported,sortOrder,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	result=_L("3,4,5,0,1,2");
 	TestDirDescendingOrder(result,*dir);
 	delete dir;
@@ -799,14 +798,14 @@
 // Test DirLast - EDescending
 	sortOrder=ESortByName|EDirsLast|EDescending;
 	r=TheFs.GetDir(gDirDescendingBaseName,KEntryAttMaskSupported,sortOrder,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	result=_L("3,4,5,2,1,0");
 	TestDirDescendingOrder(result,*dir);
 	delete dir;
 // Test DirLast - EAscending
 	sortOrder=ESortByName|EDirsLast;
 	r=TheFs.GetDir(gDirDescendingBaseName,KEntryAttMaskSupported,sortOrder,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	result=_L("0,1,2,3,4,5");
 	TestDirDescendingOrder(result,*dir);
 	delete dir;
@@ -814,14 +813,14 @@
 // Test DirFirst - EDirDescending
 	sortOrder=ESortByName|EDirsFirst|EDirDescending;
 	r=TheFs.GetDir(gDirDescendingBaseName,KEntryAttMaskSupported,sortOrder,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	result=_L("5,4,3,0,1,2");
 	TestDirDescendingOrder(result,*dir);
 	delete dir;
 // Test DirLast - EDirDescending
 	sortOrder=ESortByName|EDirsLast|EDirDescending;
 	r=TheFs.GetDir(gDirDescendingBaseName,KEntryAttMaskSupported,sortOrder,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	result=_L("0,1,2,5,4,3");
 	TestDirDescendingOrder(result,*dir);
 	delete dir;
@@ -829,14 +828,14 @@
 // Test DirFirst - EDescending|EDirDescending
 	sortOrder=ESortByName|EDirsFirst|EDescending|EDirDescending;
 	r=TheFs.GetDir(gDirDescendingBaseName,KEntryAttMaskSupported,sortOrder,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	result=_L("2,1,0,5,4,3");
 	TestDirDescendingOrder(result,*dir);
 	delete dir;
 // Test DirLast - EDescending|EDirDescending
 	sortOrder=ESortByName|EDirsLast|EDirDescending|EDescending;
 	r=TheFs.GetDir(gDirDescendingBaseName,KEntryAttMaskSupported,sortOrder,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	result=_L("5,4,3,2,1,0");
 	TestDirDescendingOrder(result,*dir);
 	delete dir;
@@ -844,21 +843,21 @@
 // Test DirNoOrder - EDescending|EDirDescending
 	sortOrder=ESortByName|EDescending|EDirDescending;
 	r=TheFs.GetDir(gDirDescendingBaseName,KEntryAttMaskSupported,sortOrder,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	result=_L("5,2,4,1,3,0");
 	TestDirDescendingOrder(result,*dir);
 	delete dir;
 // Test DirNoOrder - EDescending
 	sortOrder=ESortByName|EDescending;
 	r=TheFs.GetDir(gDirDescendingBaseName,KEntryAttMaskSupported,sortOrder,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	result=_L("5,2,4,1,3,0");
 	TestDirDescendingOrder(result,*dir);
 	delete dir;
 // Test DirNoOrder - EAscending
 	sortOrder=ESortByName;
 	r=TheFs.GetDir(gDirDescendingBaseName,KEntryAttMaskSupported,sortOrder,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	result=_L("0,3,1,4,2,5");
 	TestDirDescendingOrder(result,*dir);
 	delete dir;
@@ -882,7 +881,7 @@
 	MakeFile(_L("\\F32-TST\\GDIR\\DEF122894\\Xxxxxxxx1.dat"));
 	CDir* dir;
 	TInt r=TheFs.GetDir(_L("\\F32-TST\\GDIR\\DEF122894\\"),KEntryAttMaskSupported,ESortByName|EAscending,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(dir->Count() == 2);
 	TEntry entry1, entry2;
 	entry1 = (*dir)[0];
--- a/kerneltest/f32test/server/t_hungfs.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_hungfs.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -18,7 +18,6 @@
 //
 
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include "t_server.h"
@@ -150,7 +149,7 @@
 	{
 	RFs fs;
 	TInt r=fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TInt drive;
 #if defined(__WINS__)
@@ -194,7 +193,7 @@
 //
 	{
 	TInt r=aThread.Create(_L("ThreadNC"),ThreadFunctionNC,KDefaultStackSize,KMinHeapSize,KMinHeapSize,aInfo);
-	test_KErrNone(r);	
+	test(r==KErrNone);	
 	aThread.SetPriority(EPriorityMore);
 	aThread.Resume();
 	HungSemaphoreNC.Wait();
@@ -208,7 +207,7 @@
 //
 	{
 	TInt r=aThread.Create(_L("ThreadC"),ThreadFunctionC,KDefaultStackSize,KMinHeapSize,KMinHeapSize,&aBool);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	aThread.SetPriority(EPriorityMore);
 	aThread.Resume();
 	User::After(1000000);
@@ -254,18 +253,18 @@
 	// used for EFsSubClose
 	RFile file;
 	TInt r=file.Create(TheFs,File1,EFileShareAny|EFileWrite);
-	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+	test(r==KErrNone||KErrAlreadyExists);
 	if(r==KErrAlreadyExists)
 		{
 		r=file.Open(TheFs,File1,EFileShareAny|EFileWrite);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	TBuf8<16> buf=_L8("abcdefghijklmnop");
 	r=file.Write(buf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.MkDir(NotifyDir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RThread thread;
 	PutCriticalNotifier(ETrue,thread);
@@ -301,17 +300,17 @@
 	// EFsFileOpen
 	test.Next(_L("test functions that are not supported with critical notifier"));
 	r=file.Open(TheFs,File2,EFileShareAny);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	// EFsFileCreate
 	r=file.Create(TheFs,File2,EFileShareAny);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	// EFsMkDir
 	r=TheFs.MkDir(Dir1);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	// EFsVolume
 	TVolumeInfo info;
 	r=TheFs.Volume(info,gSessionDrive);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 
 	// get rid of critical notifier
 	test.Printf(_L("Press escape on the critical notifier\n"));
@@ -330,16 +329,16 @@
 	TFileName notDir=gLockedBase;
 	notDir+=NotifyDir;
 	r=TheFs.MkDir(notDir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(status==KRequestPending&&status2==KErrNone);
 	TheFs.NotifyChangeCancel();
 	test(status==KErrCancel);
 	r=TheFs.Delete(File1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(notDir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(NotifyDir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 void TestParsingFunctions()	
@@ -358,50 +357,50 @@
 	TFileName dir=gLockedBase;
 	dir+=Dir1;
 	TInt r=TheFs.MkDir(dir);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	TFileName file=gLockedPath;
 	file+=File1;
 	RFile f;
 	r=f.Create(TheFs,file,EFileShareAny);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	// Using ParsePathPtr0
 	r=TheFs.SetSubst(gLockedPath,EDriveO);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	// ValidateDrive
 	TVolumeInfo info;
 	r=TheFs.Volume(info,gLockedDrive);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 
 	TFileName origSessPath;
 	r=TheFs.SessionPath(origSessPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// test these work ok
 	r=TheFs.SetSessionPath(gLockedPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetSessionPath(origSessPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// test on different drive from notifier - the session path
 	test.Next(_L("test parsing functions on a different drive"));
 	// Using ParseSubst
 	r=TheFs.MkDir(Dir1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(Dir1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Create(TheFs,File1,EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 	r=TheFs.Delete(File1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	// Using ParsePathPtr0
 	r=TheFs.SetSubst(gSessionPath,EDriveO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetSubst(_L(""),EDriveO);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	// ValidateDrive
 	r=TheFs.Volume(info,gSessionDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// get rid of non-critical notifier
 	test.Printf(_L("Enter %S on the notifier\n"),&KPassword);
@@ -424,9 +423,9 @@
 	test.Next(_L("TestTFsFunctions"));
 	TFileName sessName,lockedName;
 	TInt r=TheFs.FileSystemName(sessName,gSessionDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.FileSystemName(lockedName,gLockedDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RThread thread;
 	PutNonCriticalNotifier(NULL,thread);
@@ -435,13 +434,13 @@
 	test.Next(_L("test TFs functions on hung drive"));
 	// TFsDismountFileSystem
 	r=TheFs.DismountFileSystem(lockedName,gLockedDrive);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	// TFsMountFileSystem
 	r=TheFs.MountFileSystem(lockedName,gLockedDrive);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	// TFsFileSystemName
 	r=TheFs.FileSystemName(lockedName,gLockedDrive);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 
 	// test functions on drive other than hung drive
 	test.Next(_L("test TFs functions on drive that is not hung"));
@@ -452,17 +451,17 @@
 		{
 #endif
 	r=TheFs.DismountFileSystem(sessName,gSessionDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	// TFsMountFileSystem
 	r=TheFs.MountFileSystem(sessName,gSessionDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 #if defined(__WINS__)
 		}
 #endif
 	// TFsFileSystemName
 	TFileName fsName;
 	r=TheFs.FileSystemName(fsName,gSessionDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(fsName==sessName);
 
 	// test functions that fail on all drives
@@ -471,16 +470,16 @@
 	CFileList* list=NULL;
 	TOpenFileScan fileScan(TheFs);
 	TRAP(r,fileScan.NextL(list));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 
 	// test functions that should pass on any drive
 	test.Next(_L("test TFs functions that pass on all drives"));
 	// TFsSetDefaultPath
 	// TFsSetSessionPath
 	r=TheFs.SetSessionPath(gLockedPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// get rid of non-critical notifier
 	test.Printf(_L("Enter %S on the notifier\n"),&KPassword);
@@ -510,20 +509,20 @@
 	TFileName fileName=gLockedPath;
 	fileName+=File1;
 	TInt r=file.Create(TheFs,fileName,EFileShareAny);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	// EFsFormatOpen
 	RFormat format;
 	TInt count;
 	r=format.Open(TheFs,gLockedPath,EHighDensity,count);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	// EFsDirOpen
 	RDir dir;
 	r=dir.Open(TheFs,gLockedPath,KEntryAttMaskSupported);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	// EFsRawDiskOpen
 	RRawDisk raw;
 	r=raw.Open(TheFs,gLockedDrive);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 
 	// get rid of non-critical notifier
 	test.Printf(_L("Enter %S on the notifier\n"),&KPassword);
@@ -536,14 +535,14 @@
 
 	// now open the subsessions
 	r=file.Create(TheFs,fileName,EFileShareAny);
-	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+	test(r==KErrNone||KErrAlreadyExists);
 	if(r==KErrAlreadyExists)
 		{
 		r=file.Open(TheFs,fileName,EFileShareAny);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	r=dir.Open(TheFs,gLockedPath,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	// put notifier back up
 	PutNonCriticalNotifier(NULL,thread);
@@ -553,16 +552,16 @@
 	// EFsFileRead
 	TBuf8<16> readBuf;
 	r=file.Read(readBuf);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	// subsession should be able to be closed ok
 	file.Close();
 	// EFsDelete
 	r=TheFs.Delete(fileName);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	// EFsDirRead
 	TEntry entry;
 	r=dir.Read(entry);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	// subsession should be able to be closed ok
 	dir.Close();
 
@@ -578,7 +577,7 @@
 	thread.Close();
 
 	r=TheFs.Delete(fileName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 //	test.End();
 	}
 
@@ -591,7 +590,7 @@
 
 	RFile file;
 	TInt r=file.Create(TheFs,File1,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// put notifier up using TheFs session
 	SNonCriticalInfo info={ETrue,0};
@@ -623,12 +622,12 @@
 	TFileName defPath;
 	// EFsCheckDisk
 	r=TheFs.CheckDisk(gSessionPath);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	// EFsFileWrite
 	_LIT8(buffer,"abc");
 	TBuf8<8> buf(buffer);
 	r=file.Write(buf);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 
 	// this file should be able to be closed
 	file.Close();
@@ -644,7 +643,7 @@
 	thread.Close();
 
 	r=TheFs.Delete(File1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 //	test.End();
 	}
 
@@ -659,7 +658,7 @@
 	_LIT(file4Name,"\\SubFile4");
 	TFileName origSession;
 	TInt r=TheFs.SessionPath(origSession);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TFileName file1Path(gLockedBase);
 	file1Path+=file1Name;
 	TFileName file2Path(file2Name);
@@ -668,24 +667,24 @@
 	TFileName file4Path(file4Name);
 	// create file that will be used to hang file server
 	r=SubFile1.Create(TheFs,file1Path,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	// create file with same session but on different drive
 	RFile subfile2;
 	r=subfile2.Create(TheFs,file2Path,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	// create file on unhung drive and with different session
 	RFs fs2;
 	r=fs2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs2.SetSessionPath(origSession);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RFile subfile3;
 	r=subfile3.Create(fs2,file3Path,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	// create file on unhung drive and with different session
 	RFile subfile4;
 	r=subfile4.Create(fs2,file4Path,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	// in a different thread cause the server to hang using one of the File1 subsession
 	// put notifier up using TheFs session
 	SNonCriticalInfo info={ETrue,ETrue};
@@ -697,16 +696,16 @@
 	TBuf8<8> buf(buffer);
 	// File1 caused hung file server
 	r=SubFile1.Write(buf);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	// file2 is same session as subsession that caused hung file server
 	r=subfile2.Write(buf);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	// file3 is opened on hung drive
 	r=subfile3.Write(buf);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	// file4 should be ok
 	r=subfile4.Write(buf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	// hard to test EFsSubClose since does not return an error value
 	test.Next(_L("test closing down the subsessions"));
 	subfile4.Close();
@@ -728,13 +727,13 @@
 	// clean up
 	fs2.Close();
 	r=TheFs.Delete(file1Path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(file2Path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(file3Path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(file4Path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 void TestExtendedNotifier()
@@ -752,9 +751,9 @@
 	test(status==KRequestPending);
 	// now do an operation on c: and test no notification
 	TInt r=TheFs.MkDir(NotifyDir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(NotifyDir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::After(1000000);
 	test(status==KRequestPending);
 	TheFs.NotifyChangeCancel(status);
@@ -772,15 +771,15 @@
 	test(status==KRequestPending);
 	// test notification does not go off with wrong path
 	r=TheFs.MkDir(NotifyDir2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(NotifyDir2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(status==KRequestPending);
 	// now do an operation on c: and test there has been a notification
 	r=TheFs.MkDir(NotifyDir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(NotifyDir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::After(1000000);
 	// request should be completed this time
 	test(status==KErrNone);
@@ -793,17 +792,17 @@
 	TRequestStatus status2;
 	TFileName origSession;
 	r=TheFs.SessionPath(origSession);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RFs fs2;
 	r=fs2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs2.SetSessionPath(origSession);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	_LIT(notifyDirZ,"z:\\test\\");
 	_LIT(notifyDirSess,"\\test\\");
 	// notifyDirZ already exists, create test dir in session path
 	r=fs2.MkDir(notifyDirSess);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fs2.NotifyChange(ENotifyDir,status2,notifyDirZ);
 	test(status2==KRequestPending);
 	TRequestStatus status3;
@@ -811,7 +810,7 @@
 	test(status3==KRequestPending);
 	// now delete session dir and test no notification
 	r=TheFs.RmDir(notifyDirSess);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(status2==KRequestPending && status3==KErrNone);
 
 	// get rid of non-critical notifier
@@ -842,11 +841,11 @@
 	test(status==KRequestPending);
 	// create directory on locked drive
 	r=TheFs.MkDir(notDir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	// test notifier goes off
 	test(status==KErrNone);
 	r=TheFs.RmDir(notDir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	// get rid of critical notifier
 	}	
 
@@ -857,15 +856,15 @@
 	{
 #if defined(__WINS__)
 	TInt r=TheFs.CharToDrive(gSessionPath[0],gSessionDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	if(gSessionDrive==EDriveX)
 		return(EFalse);
 #else
 	TInt r=TheFs.CharToDrive(gSessionPath[0],gSessionDrive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TDriveList list;
 	r=TheFs.DriveList(list);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	if((list[gSessionDrive])&KDriveAttRemovable)
 		return(EFalse);
 #endif
@@ -906,9 +905,9 @@
 		isSecureMmc=EFalse;
 
 	TInt r=HungSemaphoreC.CreateLocal(0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=HungSemaphoreNC.CreateLocal(0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// create sharable session
 	TheFs.ShareAuto();
--- a/kerneltest/f32test/server/t_localeutils_cp932.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_localeutils_cp932.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -43,7 +43,7 @@
 	{
 
     TInt nRes = ReadBootSector(TheFs, CurrentDrive(), KBootSectorNum<<KDefaultSectorLog2, aBootSector);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     if(!aBootSector.IsValid())
         {
@@ -254,7 +254,7 @@
 	_LIT(KVolumeLabelOverflow,		"\x65B0\x65B0\x65B0\x65B0\x65B0\x65B0");
 	r = TheFs.SetVolumeLabel(KVolumeLabelOverflow, driveNum);
 	// locale dll and codepage dll both return diff retrun values so check against both cases.
-	test_Value(r, (r == KErrBadName) || (r == KErrOverflow));
+	test((r == KErrBadName) || (r == KErrOverflow));
 
 	r = TheFs.Volume(vInfo, driveNum);
 	test_KErrNone(r);
@@ -702,12 +702,12 @@
 	TFileName fn = _L("\\ABCD");
 	
 	TInt r=file.Create(TheFs,fn,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	//	Assume this file is the first entry in the root directory
 	r=TheDisk.Open(TheFs,CurrentDrive());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
     //-- read the 1st dir entry, it should be a DOS entry 
     const TInt posEntry1=gBootSector.RootDirStartSector() << KDefaultSectorLog2; //-- dir entry1 position
@@ -747,9 +747,9 @@
 	
 	TEntry entry;
 	TInt err = TheFs.Entry(fn, entry);
-	test_KErrNone(err);
+	test(err==KErrNone);
 	err = TheFs.Delete(fn);
-	test_KErrNone(err);
+	test(err==KErrNone);
 #else
 	test.Printf(_L("Test only runs on DEBUG builds, see test logs of debug builds for details."));
 #endif  // _DEBUG) || _DEBUG_RELEASE
@@ -779,13 +779,13 @@
 	
 	test.Next(_L("create file \"AB\" under root directory"));
 	TInt r=file.Create(TheFs,fn,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	test.Next(_L("manually change file name to \"0x7F0x450x7F0x45\" via raw disk accessing"));
 	//	Assume this file is the first entry in the root directory
 	r=TheDisk.Open(TheFs,CurrentDrive());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
     //-- read the first dir entry, it should be a DOS entry 
     const TInt posEntry1=gBootSector.RootDirStartSector() << KDefaultSectorLog2; //-- dir entry1 position
@@ -870,15 +870,15 @@
 	_LIT(KShortName, "\x3055\x307E\x3056~1");
 	TFileName sn;
 	r = TheFs.GetShortName(fn, sn);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = sn.Compare(KShortName);
-	test_Value(r, r == 0);
+	test(r==0);
 	
 	r = TheFs.ScanDrive(_L("gSessionPath"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r = TheFs.Delete(fn);
-	test_KErrNone(r);
+	test(r == KErrNone);
 #else
 	test.Printf(_L("Test only runs on DEBUG builds, see test logs of debug builds for details."));
 #endif  // _DEBUG) || _DEBUG_RELEASE
--- a/kerneltest/f32test/server/t_locate.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_locate.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -101,15 +101,15 @@
 	for (TInt i=0;i<5;i++)
 		{
 		TInt r=TheFs.Drive(drive);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	TInt r=TheFs.MkDirAll(_L("alskdjfl"));
-	test_Value(r, r == -47);
+	test(r==-47);
 	r=TheFs.MkDirAll(_L("alskdjfl"));
-	test_Value(r, r == -47);
+	test(r==-47);
 	TheFs.SetErrorCondition(KErrNone);
 	r=TheFs.Drive(drive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 #endif
 //
 	test.Next(_L("Create LOCTEST files"));
@@ -152,7 +152,7 @@
     TDriveInfo info;
 
 	 err = TheFs.DriveList(driveList);
-    test_KErrNone(err);
+    test( err == KErrNone );
     
     for (TInt i = 0; i < KMaxDrives; i++) 
         {
@@ -160,7 +160,7 @@
         if (driveList[i]) 
             {
             err = TheFs.Drive(info, i);
-            test_KErrNone(err); 
+            test( err == KErrNone ); 
                         
             if(( info.iDriveAtt  & KDriveAttRemovable ) && !( info.iDriveAtt  & KDriveAttLogicallyRemovable ))  
             	{
@@ -198,7 +198,7 @@
     TDriveInfo info;
 
 	 err = TheFs.DriveList(driveList);
-    test_KErrNone(err);
+    test( err == KErrNone );
     
     for (TInt i = 0; i < KMaxDrives; i++) 
         {
@@ -206,7 +206,7 @@
         if (driveList[i]) 
             {
             err = TheFs.Drive(info, i);
-            test_KErrNone(err); 
+            test( err == KErrNone ); 
                         
             if( info.iDriveAtt  & KDriveAttInternal  ) 
             	{			
@@ -248,7 +248,7 @@
 		gPathRem.Append (removableDriveLetter);
 		gPathRem.Append (_L(":\\F32-TST\\") );
 		TInt r=fMan->RmDir(gPathRem);
-		test_KErrNone(r);
+		test(r==KErrNone);
 	
 		delete fMan;
 		}
@@ -269,7 +269,7 @@
 		gPathInt.Append (internalDriveLetter);
 		gPathInt.Append (_L(":\\F32-TST\\") );
 		TInt r=fMan->RmDir(gPathInt);
-		test_KErrNone(r);
+		test(r==KErrNone);
 	
 		delete fMan;
 		}
@@ -285,7 +285,7 @@
 	TInt r=TheFs.AddFileSystem(_L("CFAFSDLY"));
 	test.Printf(_L("Add remote file system\n"));
 	test.Printf(_L("AddFileSystem returned %d\n"),r);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test (r==KErrNone || r==KErrAlreadyExists);
 
 
 	r=TheFs.MountFileSystem(_L("DELAYFS"),EDriveQ);
@@ -293,7 +293,7 @@
 	
 	test.Printf(_L("Mount remote file system\n"));
 	test.Printf(_L("MountFileSystem returned %d\n"),r);
-	test_Value(r, r == KErrNone || r==KErrCorrupt || r==KErrNotReady || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrCorrupt || r==KErrNotReady || r==KErrAlreadyExists);
 
 	
 	Mf(_L("Q:\\F32-TST\\LOCTEST\\BIN\\FINDFILE.AAA"));
@@ -311,7 +311,7 @@
  	 
  	test.Printf(_L("Dismounting the Remote Drive returned %d\n"),r);
  	
- 	test_KErrNone(r);
+ 	test(r==KErrNone );
 	}
 
 
@@ -326,41 +326,41 @@
 	
 	TAutoClose<RFs> fs;
 	TInt r=fs.iObj.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TFindFile finder(fs.iObj);
 	TPtrC path=gPath1;
 	r=finder.FindByPath(_L("file1.aaa"),&path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TParse fileParse;
 	fileParse.Set(finder.File(),NULL,NULL);
 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN1\\"));
 	test(fileParse.NameAndExt()==_L("file1.aaa"));
 	r=finder.Find();
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 
 
 	path.Set(gPath2);
 	r=finder.FindByPath(_L("file1.aaa"),&path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fileParse.Set(finder.File(),NULL,NULL);
 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN1\\"));
 	test(fileParse.NameAndExt()==_L("file1.aaa"));
 	r=finder.Find();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fileParse.Set(finder.File(),NULL,NULL);
 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN1\\BIN4\\"));
 	test(fileParse.NameAndExt()==_L("file1.aaa"));
 	r=finder.Find();
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 //
 	test.Next(_L("Test FindByDir"));
 	TPtrC dir=_L("\\F32-TST\\LOCTEST\\BIN2\\");
 	r=finder.FindByDir(_L("file2.bbb"),dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TFileName defaultPath;
 	r=TheFs.SessionPath(defaultPath);
 	defaultPath.SetLength(2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fileParse.Set(finder.File(),NULL,NULL);
 	test(fileParse.Drive()==defaultPath);
 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\"));
@@ -377,7 +377,7 @@
 		test(_L("file2.bbb").MatchF(fileParse.NameAndExt())!=KErrNotFound);
 		r=finder.Find();
 		}
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	}
 
 LOCAL_C void Test2()
@@ -389,36 +389,36 @@
 	test.Next(_L("Test extremes"));
 	TAutoClose<RFs> fs;
 	TInt r=fs.iObj.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf<4> temp=_L("");
 	TFindFile finder(fs.iObj);
 	r=finder.FindByPath(_L("file1.aaa"),&temp);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=finder.Find();
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 //
 	TPtrC path=_L("blarg.7");
 	r=finder.FindByPath(_L(""),&path);	
-	test_Value(r, r == KErrArgument);
+	test(r==KErrArgument);
 	r=finder.FindByPath(_L("*"),&path);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=finder.FindByPath(_L("xmvid"),&path);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=finder.Find();
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 //
 	path.Set(_L("C:\\F32-TST\\LOCTEST\\BIN1\\;\\F32-TST\\LOCTEST\\BIN2\\;Z:\\F32-TST\\LOCTEST\\BIN1\\BIN4\\;\\F32-TST\\LOCTEST\\BIN3\\;"));
 	r=finder.FindByPath(_L(""),&path);
-	test_Value(r, r == KErrArgument);
+	test(r==KErrArgument);
 	r=finder.FindByPath(_L("xyz.abc"),&path);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=finder.Find();
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	
 	test.Next(_L("Test FindByDir with empty file spec"));
 	TPtrC dir2=_L("\\F32-TST\\LOCTEST\\");
 	r=finder.FindByDir(_L(""),dir2);
-	test_Value(r, r == KErrArgument);		
+	test(r==KErrArgument);		
 	
 	}
 
@@ -436,23 +436,23 @@
 //
 	TAutoClose<RFs> fs;
 	r=fs.iObj.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TFindFile finder(fs.iObj);
 	r=finder.FindByPath(_L("file1.aaa"),&path);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=finder.Find();
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 //
 	path.Set(_L("\\F32-TST\\LOCTEST\\BIN2\\"));
 	r=finder.FindByPath(_L("file2.bbb"),&path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TParse fileParse;
 	fileParse.Set(finder.File(),NULL,NULL);
 	test(fileParse.Drive()==defaultPath);
 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\"));
 	test(fileParse.NameAndExt()==_L("file2.bbb"));
 	r=finder.Find();
-	test_Value(r, r == KErrNotFound || r==KErrNone);
+	test(r==KErrNotFound || r==KErrNone);
 	if (r==KErrNone)
 		{
 		fileParse.Set(finder.File(),NULL,NULL);
@@ -460,23 +460,23 @@
 		test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\"));
 		test(fileParse.NameAndExt()==_L("file2.bbb"));
 		r=finder.Find();
-		test_Value(r, r == KErrNotFound);
+		test(r==KErrNotFound);
 		}
 //
 	path.Set(_L("C:\\F32-TST\\LOCTEST\\BIN1\\;;\\F32-TST\\LOCTEST\\BIN2\\;Z:\\F32-TST\\LOCTEST\\BIN1\\BIN4\\;\\F32-TST\\LOCTEST\\BIN3\\;"));
 	r=finder.FindByPath(_L("xyz.abc"),&path);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=finder.Find();
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 //
 	r=finder.FindByPath(_L("file2.bbb"),&path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fileParse.Set(finder.File(),NULL,NULL);
 	test(fileParse.Drive()==defaultPath);
 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\"));
 	test(fileParse.NameAndExt()==_L("file2.bbb"));
 	r=finder.Find();
-	test_Value(r, r == KErrNotFound || r==KErrNone);
+	test(r==KErrNotFound || r==KErrNone);
 	if (r==KErrNone)
 		{
 		fileParse.Set(finder.File(),NULL,NULL);
@@ -484,7 +484,7 @@
 		test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN2\\"));
 		test(fileParse.NameAndExt()==_L("file2.bbb"));
 		r=finder.Find();
-		test_Value(r, r == KErrNotFound);
+		test(r==KErrNotFound);
 		}
 	}
 
@@ -502,7 +502,7 @@
 	TFileName path;
 
 	TInt r=finder.FindWildByPath(_L("*.aaa"),&gPath3,dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=dir->Count();
 	test(count==3);
 	entry=(*dir)[0];
@@ -518,7 +518,7 @@
 	delete dir;
 
 	r=finder.FindWild(dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=dir->Count();
 	test(count==2);
 	entry=(*dir)[0];
@@ -531,26 +531,26 @@
 	delete dir;
 
 	r=finder.FindWild(dir);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=finder.FindWild(dir);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 
 	r=finder.FindWildByPath(_L("*FILE.AAA*"), &gPath1, dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(dir->Count()==1);
 	entry=(*dir)[0];
 	test(entry.iName.MatchF(_L("FILE.AAA"))!=KErrNotFound);
 	delete dir;
 	
 	r=finder.FindWildByPath(_L("*FILE.AAA"), &gPath1, dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(dir->Count()==1);
 	entry=(*dir)[0];
 	test(entry.iName.MatchF(_L("FILE.AAA"))!=KErrNotFound);
 	delete dir;
 	
 	r=finder.FindWildByPath(_L("FILE.AAA*"), &gPath1, dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(dir->Count()==1);
 	entry=(*dir)[0];
 	test(entry.iName.MatchF(_L("FILE.AAA"))!=KErrNotFound);
@@ -558,26 +558,26 @@
 
     
 	r=finder.FindWildByPath(_L("CONFUSED.DOG"), &gPath1, dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(dir->Count()==1);
 	entry=(*dir)[0];
 	test(entry.iName.MatchF(_L("CONFUSED.DOG"))!=KErrNotFound);
 	delete dir;
 
 	r=finder.FindWildByPath(_L("*CONFUSED.DOG"), &gPath1, dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(dir->Count()==1);
 	entry=(*dir)[0];
 	test(entry.iName.MatchF(_L("CONFUSED.DOG"))!=KErrNotFound);
 	delete dir;
 	r=finder.FindWildByPath(_L("CONFUSED.DOG*"), &gPath1, dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(dir->Count()==1);
 	entry=(*dir)[0];
 	test(entry.iName.MatchF(_L("CONFUSED.DOG"))!=KErrNotFound);
 	delete dir;
 	r=finder.FindWildByPath(_L("*CONFUSED.DOG*"), &gPath1, dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(dir->Count()==1);
 	entry=(*dir)[0];
 	test(entry.iName.MatchF(_L("CONFUSED.DOG"))!=KErrNotFound);
@@ -598,7 +598,7 @@
 	TFileName path;
 
 	TInt r=finder.FindWildByDir(_L("FILE*"),_L("\\F32-TST\\LOCTEST\\BIN3\\"),dir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=dir->Count();
 	test(count==1);
 	entry=(*dir)[0];
@@ -614,7 +614,7 @@
 	r=finder.FindWild(dir);
 	if (r==KErrNotFound)
 		return;
-	test_KErrNone(r);
+	test(r==KErrNone);
 	entry=(*dir)[0];
 	test(entry.iName.MatchF(_L("FILE3.CCC"))!=KErrNotFound);
 	fileParse.Set(finder.File(),NULL,NULL);
@@ -623,9 +623,9 @@
 	delete dir;
 
 	r=finder.FindWild(dir);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=finder.FindWild(dir);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	}
 
 LOCAL_C void Test6()
@@ -637,7 +637,7 @@
 	test.Next(_L("Test file not found"));
 	TFindFile ff(TheFs);
 	TInt r=ff.FindByDir(_L("NOEXIST.EXE"),_L("\\System\\Programs\\"));
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	}
 
 
@@ -676,7 +676,7 @@
 	
 	TAutoClose<RFs> fs;
 	TInt r=fs.iObj.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TFindFile finder(fs.iObj);
 	TPtrC path=gPath4;
 	r=finder.FindByPath(_L("findfile.aaa"),&path); 	
@@ -687,16 +687,16 @@
 	
 	if (removableFlag == 1)
 		{
-			test_KErrNone(r); 
+			test(r==KErrNone); 
 			fileParse.Set(finder.File(),NULL,NULL);
 			test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN\\"));
 			test(fileParse.NameAndExt()==_L("findfile.aaa")); //The filename.aaa in the removable Drive
 			r=finder.Find();
-			test_Value(r, r == KErrNotFound);     //remote drives are excluded by default
+			test(r==KErrNotFound);     //remote drives are excluded by default
 		
 		}
 	else
-		test_Value(r, r == KErrNotFound);
+		test(r==KErrNotFound);
 
 	
 
@@ -704,9 +704,9 @@
 
 
 	r=finder.SetFindMask(	KDriveAttAll) ;
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=finder.FindByPath(_L("findfile.aaa"),&path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fileParse.Set(finder.File(),NULL,NULL);
 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN\\"));   
 	test(fileParse.NameAndExt()==_L("findfile.aaa"));      //either the remote or removable one.
@@ -715,7 +715,7 @@
 	
 	if (removableFlag == 1)
 		{	
-		test_KErrNone(r);
+		test(r==KErrNone);
 	
 		fileParse.Set(finder.File(),NULL,NULL);
 
@@ -723,11 +723,11 @@
 		test(fileParse.NameAndExt()==_L("findfile.aaa"));         //either the remote or removable one.
 
 		r=finder.Find();
-		test_Value(r, r == KErrNotFound);
+		test(r==KErrNotFound);
 		}
 	else 
 		{
-		test_Value(r, r == KErrNotFound);	
+		test(r==KErrNotFound);	
 			
 		}
 		
@@ -735,30 +735,30 @@
 	test.Next(_L("Search exclusively in remote drives \n"));
 
 	r=finder.SetFindMask(	KDriveAttExclusive| KDriveAttRemote); 
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=finder.FindByPath(_L("findfile.aaa"),&path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fileParse.Set(finder.File(),NULL,NULL);
 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN\\"));
 	test(fileParse.NameAndExt()==_L("findfile.aaa"));
 	r=finder.Find();
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 
 	
 	test.Next(_L("Search excluding removables and remote \n"));
 
 	r=finder.SetFindMask(	KDriveAttExclude | KDriveAttRemovable |KDriveAttRemote ); 
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=finder.FindByPath(_L("findfile.aaa"),&path);   
-	test_Value(r, r == KErrNotFound);   //filename.aaa exists in the remote drive and if present to the removable one
+	test(r==KErrNotFound);   //filename.aaa exists in the remote drive and if present to the removable one
 
 
 	test.Next(_L("Search in Internal Drives \n"));
 
 	r=finder.SetFindMask(KDriveAttInternal ) ;
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=finder.FindByPath(_L("findfile.aaa"),&path);   
-	test_Value(r, r == KErrNotFound);   //filename.aaa exists only in the Removable drive and the remote one.
+	test(r==KErrNotFound);   //filename.aaa exists only in the Removable drive and the remote one.
 
 
 	}
@@ -789,16 +789,16 @@
 	
 	TAutoClose<RFs> fs;
 	TInt r=fs.iObj.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TFindFile finder(fs.iObj);
 	TPtrC path=gPath4;	
 	TParse fileParse;
 		
 
 	r=finder.SetFindMask(KDriveAttAll) ;
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=finder.FindByPath(_L("findfile.aaa"),&path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fileParse.Set(finder.File(),NULL,NULL);
 	test(fileParse.Path()==_L("\\F32-TST\\LOCTEST\\BIN\\"));   
 	test(fileParse.NameAndExt()==_L("findfile.aaa"));
@@ -838,13 +838,13 @@
 		
 		//	test.Printf(_L("\nTest mask : %d \n"),testCombinations[matchIdx].iMatchMask | testAtt );
 			
-			test_Value(r, r == (testAtt == 0 ? testCombinations[matchIdx].iExpectedResultNoAtts : testCombinations[matchIdx].iExpectedResultWithAtts) );
+			test( r == (testAtt == 0 ? testCombinations[matchIdx].iExpectedResultNoAtts : testCombinations[matchIdx].iExpectedResultWithAtts) );
 			
 			
 			if (r== KErrNone)
 				{
 				r  = finder.FindByPath(_L("findfile.aaa"),&path);
-				test_Value(r, r == KErrNone || r ==KErrNotFound);
+				test (r== KErrNone || r ==KErrNotFound);
 				}
 			
 			}
@@ -881,7 +881,7 @@
 
 	TAutoClose<RFs> fs;
 	TInt r=fs.iObj.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TFindFile finder(fs.iObj);
 	
@@ -899,9 +899,9 @@
 		test.Next(_L("FindByDir with wild filenames when a find mask is specified"));
 		
 		TInt r=finder.SetFindMask(KDriveAttRemovable);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=finder.FindWildByDir(_L("FIND*"),_L("\\F32-TST\\LOCTEST\\BIN\\"),dir);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		count=dir->Count();
 		test(count==1);
 		entry=(*dir)[0];
@@ -909,13 +909,13 @@
 		delete dir;	
 
 		r=finder.FindWild(dir);
-		test_Value(r, r == KErrNotFound);	
+		test(r==KErrNotFound);	
 		
 		
 		r=finder.SetFindMask(KDriveAttExclude| KDriveAttRemovable);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=finder.FindWildByDir(_L("FIND*"),_L("\\F32-TST\\LOCTEST\\BIN\\"),dir);
-		test_Value(r, r == KErrNotFound);
+		test(r==KErrNotFound);
 		
 		
 		test.Next(_L("Test FindByDir when a find mask is specified"));
@@ -924,12 +924,12 @@
 		TPtrC dir2=_L("\\F32-TST\\LOCTEST\\BIN\\");
 		
 		r=finder.SetFindMask(KDriveAttExclude | KDriveAttRemote );
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=finder.FindByDir(_L("findfile.aaa"),dir2);
-		test_KErrNone(r);
+		test(r==KErrNone);
 	
 		r=finder.Find();
-		test_Value(r, r == KErrNotFound);	
+		test(r==KErrNotFound);	
 		
 
 		}
@@ -965,7 +965,7 @@
 
 		
 		r=finder.FindWildByPath(_L("FIND*.AAA"), &gPath5, dir3);
- 		test_KErrNone(r);
+ 		test(r==KErrNone);
 		test(dir3->Count()==2);
 		
 		entry=(*dir3)[0];		
@@ -981,16 +981,16 @@
 		
 		
 		r=finder.SetFindMask(KDriveAttExclude| KDriveAttInternal);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=finder.FindWildByPath(_L("FIND*.AAA"), &gPath5, dir3);	
- 		test_KErrNone(r);
+ 		test(r==KErrNone);
 		test(dir3->Count()==2);
 		
 		delete dir3;
 		
 		
 		r=finder.FindWild(dir3);
-		test_Value(r, r == KErrNotFound);
+		test(r==KErrNotFound);
 				
 				
 		}
@@ -1026,7 +1026,7 @@
     
     __UHEAP_MARK;
     nRes = finder.FindWildByPath(_L("*"), &gPath1, pDir);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
     test(pDir && pDir->Count() > 1);
     delete pDir;
 
@@ -1034,7 +1034,7 @@
     for(cnt = 0; ;cnt++)
         {
         nRes =TheFs.SetErrorCondition(KMyError, cnt);
-        test_KErrNone(nRes);
+        test(nRes == KErrNone);
 
         pDir = (CDir*)0xaabbccdd;
         nRes = finder.FindWildByPath(_L("*"), &gPath1, pDir);
@@ -1070,14 +1070,14 @@
     
    __UHEAP_MARK;
    nRes = finder.FindWildByDir(_L("*"), KPath, pDir);
-   test_KErrNone(nRes);
+   test(nRes == KErrNone);
    test(pDir && pDir->Count() > 1);
    delete pDir;
    
    for(cnt = 0; ;cnt++)
         {
         nRes =TheFs.SetErrorCondition(KMyError, cnt);
-        test_KErrNone(nRes);
+        test(nRes == KErrNone);
 
         pDir = (CDir*)0xaabbccdd;
         nRes = finder.FindWildByDir(_L("*"), KPath, pDir);
--- a/kerneltest/f32test/server/t_lock.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_lock.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include "t_server.h"
@@ -62,11 +61,11 @@
 #else
 	TInt r=format.Open(TheFs,_L("C:\\"),EHighDensity,count);
 #endif
-	test_KErrNone(r);
+	test(r==KErrNone);
 	while(count)
 		{
 		r=format.Next(count);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	format.Close();
 	}
@@ -84,7 +83,7 @@
 	test.Next(_L("Formatting disk"));
 	DoFormat();
 	r=TheFs.MkDir(testDir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 RFileTest::RFileTest(const TDesC& aName)
@@ -102,7 +101,7 @@
 
 	test.Printf(_L("%S replace %S\n"),&iName,&aName);
 	TInt r=RFile::Replace(TheFs,aName,EFileStream|EFileWrite|EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	return(*this);
 	}
 
@@ -114,7 +113,7 @@
 
 	test.Printf(_L("%S open %S\n"),&iName,&aName);
 	TInt r=RFile::Open(TheFs,aName,EFileStream|EFileWrite|EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	return(*this);
 	}
 
@@ -126,7 +125,7 @@
 
 	test.Printf(_L("%S lock   %08x-%08x\n"),&iName,aPos,aPos+aLen-1);
 	TInt r=RFile::Lock(aPos,aLen);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	return(*this);
 	}
 
@@ -138,7 +137,7 @@
 
 	test.Printf(_L("%S lockE  %08x-%08x\n"),&iName,aPos,aPos+aLen-1);
 	TInt r=RFile::Lock(aPos,aLen);
-	test_Value(r, r == KErrLocked);
+	test(r==KErrLocked);
 	return(*this);
 	}
 
@@ -150,7 +149,7 @@
 
 	test.Printf(_L("%S ulock  %08x-%08x\n"),&iName,aPos,aPos+aLen-1);
 	TInt r=RFile::UnLock(aPos,aLen);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	return(*this);
 	}
 
@@ -162,7 +161,7 @@
 
 	test.Printf(_L("%S ulockE %08x-%08x\n"),&iName,aPos,aPos+aLen-1);
 	TInt r=RFile::UnLock(aPos,aLen);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	return(*this);
 	}
  
@@ -175,7 +174,7 @@
 
 	test.Printf(_L("%S lock   %08x-%08x\n"),&iName,aPos,aPos+aLen-1);
 	TInt r=RFile::Lock(aPos,aLen);
-	test_Value(r, r == KErrArgument);
+	test(r==KErrArgument);
 	return(*this);
 	}
 
@@ -187,7 +186,7 @@
 
 	test.Printf(_L("%S ulock  %08x-%08x\n"),&iName,aPos,aPos+aLen-1);
 	TInt r=RFile::UnLock(aPos,aLen);
-	test_Value(r, r == KErrArgument);
+	test(r==KErrArgument);
 	return(*this);
 	}
 
@@ -199,7 +198,7 @@
 
 	test.Printf(_L("%S write  %08x-%08x\n"),&iName,aPos,aPos+aLen-1);
 	TInt r=RFile::Write(aPos,Pattern,aLen);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	return(*this);
 	}
 
@@ -211,7 +210,7 @@
 
 	test.Printf(_L("%S writeE %08x-%08x\n"),&iName,aPos,aPos+aLen-1);
 	TInt r=RFile::Write(aPos,Pattern,aLen);
-	test_Value(r, r == KErrLocked);
+	test(r==KErrLocked);
 	return(*this);
 	}
 
@@ -223,7 +222,7 @@
 
 	test.Printf(_L("%S read   %08x-%08x\n"),&iName,aPos,aPos+aLen-1);
 	TInt r=RFile::Read(aPos,Buffer,aLen);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	return(*this);
 	}
 
@@ -235,7 +234,7 @@
 
 	test.Printf(_L("%S readE  %08x-%08x\n"),&iName,aPos,aPos+aLen-1);
 	TInt r=RFile::Read(aPos,Buffer,aLen);
-	test_Value(r, r == KErrLocked);
+	test(r==KErrLocked);
 	return(*this);
 	}
 
@@ -247,7 +246,7 @@
 
 	test.Printf(_L("%S size   %08x\n"),&iName,aSize);
 	TInt r=RFile::SetSize(aSize);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	return(*this);
 	}
 
@@ -259,7 +258,7 @@
 
 	test.Printf(_L("%S sizeE  %08x\n"),&iName,aSize);
 	TInt r=RFile::SetSize(aSize);
-	test_Value(r, r == KErrLocked);
+	test(r==KErrLocked);
 	return(*this);
 	}
 
--- a/kerneltest/f32test/server/t_main.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_main.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -24,7 +24,6 @@
 #include <f32dbg.h>
 #include "t_server.h"
 #include "t_chlffs.h"
-#include "f32_test_utils.h"
 
 GLDEF_D	RFs TheFs;
 GLDEF_D TFileName gSessionPath;
@@ -158,11 +157,14 @@
 
 		while(illegalChar)
 			{
-			if (F32_Test_Utils::Is_SimulatedSystemDrive(TheFs, CurrentDrive()))
+#if defined(__WINS__)
+			if (gSessionPath[0]=='C')
 				letter=(TChar)('A'+Math::Rand(aSeed)%26);
 			else
 				letter=(TChar)Math::Rand(aSeed)%256;
-
+#else
+			letter=(TChar)Math::Rand(aSeed)%256;
+#endif
 			TBool space=letter.IsSpace();
 			if (space && spaceChar==-1)
 				spaceChar=i;
@@ -664,12 +666,12 @@
 
 	TInt orgSessionCount;
 	r = controlIo(TheFs,theDrive, KControlIoSessionCount, orgSessionCount);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("Session count start=%d\n"),orgSessionCount);
 
 	TInt orgObjectCount;
 	r = controlIo(TheFs,theDrive, KControlIoObjectCount, orgObjectCount);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("Object count start=%d\n"),orgObjectCount);
 
 
@@ -715,7 +717,7 @@
 	// NB: This won't help if the test has opened another session & left sub-sessions open.
 	TheFs.Close();
 	r=TheFs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	// Display the file cache stats before closing the file queue
 	TFileCacheStats endFileCacheStats;
@@ -741,11 +743,11 @@
 		test_KErrNone(r);
 
 		r = controlIo(TheFs,theDrive, KControlIoSessionCount, endSessionCount);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test.Printf(_L("Session count end=%d\n"),endSessionCount);
 
 		r = controlIo(TheFs,theDrive, KControlIoObjectCount, endObjectCount);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test.Printf(_L("Object count end=%d\n"),endObjectCount);
 
 		if (endSessionCount == orgSessionCount && endObjectCount == orgObjectCount)
--- a/kerneltest/f32test/server/t_misc.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_misc.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,15 +15,10 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include "t_server.h"
 
-#include "f32_test_utils.h"
-using namespace F32_Test_Utils;
-
-
 // If there is an NFE media driver present, then because of the way EDeleteNotify requests work,
 // the data retrieved from a deleted file will not be a buffer full of zero's, but instead a buffer
 // full of decrypted zero's
@@ -34,13 +29,11 @@
     #pragma setlocale("english")
 #endif
 
-RTest test(_L("T_MISC"));
+GLDEF_D RTest test(_L("T_MISC"));
 
-
-TInt gDriveNum = -1;
 const TUint KBufLength = 0x100;
 
-static void Test1()
+LOCAL_C void Test1()
 //
 // Open, write to and read from a file
 //
@@ -48,24 +41,24 @@
 
 	test.Next(_L("Open, write to and read from a file"));
 	TInt r=TheFs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RFile file;
 	r=file.Create(TheFs,_L("Hello.Wld"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(_L8("Hello World"),11);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	r=file.Open(TheFs,_L("Hello.Wld"),EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf8<256> buf;
 	r=file.Read(buf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(buf==_L8("Hello World"));
 	file.Close();
 	}
 
-static void Test2()
+LOCAL_C void Test2()
 //
 // Open and read from a file
 //
@@ -73,20 +66,20 @@
 
 	test.Next(_L("Open and read from a file"));
 	TInt r=TheFs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RFile file;
 	r=file.Open(TheFs,_L("Hello.Wld"),EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf8<256> buf;
 	r=file.Read(buf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(buf==_L8("Hello World"));
 	file.Close();
 	r=TheFs.Delete(_L("HELLO.WLD"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
-static void Test3()
+LOCAL_C void Test3()
 //
 // Create nested directories
 //
@@ -94,28 +87,28 @@
 
 	test.Next(_L("Create nested directories"));
 	TInt r=TheFs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TheFs.ResourceCountMarkStart();
 //
 	r=TheFs.MkDir(_L("\\F32-TST\\LEFT\\A.B"));
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	r=TheFs.MkDir(_L("\\F32-TST\\RIGHT\\"));
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 //
 	r=TheFs.MkDir(_L("\\F32-TST\\LEFT\\ONE\\"));
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	r=TheFs.MkDir(_L("\\F32-TST\\LEFT\\TWO\\"));
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	r=TheFs.MkDir(_L("\\F32-TST\\LEFT\\THREE\\"));
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	r=TheFs.MkDir(_L("\\F32-TST\\LEFT\\TWO\\BOTTOM\\"));
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 //
 	r=TheFs.MkDirAll(_L("\\F32-TST\\RIGHT\\TOP\\MID\\BOT\\"));
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	}
 
-static void Test4()
+LOCAL_C void Test4()
 //
 // Test returned error values
 //
@@ -123,62 +116,62 @@
 
 	test.Next(_L("Test returned error values"));
 	TInt r=TheFs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TheFs.ResourceCountMarkStart();
 //
 	r=TheFs.MkDir(_L("\\"));
-	test_Value(r, r == KErrAlreadyExists);
+	test(r==KErrAlreadyExists);
 	r=TheFs.MkDir(_L("\\LEFT"));
-	test_Value(r, r == KErrAlreadyExists);
+	test(r==KErrAlreadyExists);
 	r=TheFs.MkDir(_L("\\F32-TST\\LEFT\\"));
-	test_Value(r, r == KErrAlreadyExists);
+	test(r==KErrAlreadyExists);
 	r=TheFs.MkDir(_L("\\F32-TST\\LEFT\\..\\NEWDIR\\"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.MkDir(_L("\\F32-TST\\NEWDIR\\SUBDIR\\"));
-	test_Value(r, r == KErrPathNotFound);
+	test(r==KErrPathNotFound);
 //
 	r=TheFs.RmDir(_L("\\"));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=TheFs.RmDir(_L("\\PROG"));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=TheFs.RmDir(_L("\\F32-TST\\"));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 
 
 	RDir dir;
 	r=dir.Open(TheFs,_L("V:\\asdf"),KEntryAttNormal);
-	test_Value(r, r == KErrNone || r==KErrNotReady || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotReady || r==KErrNotFound);
 	if (r==KErrNone)
 		dir.Close();
 	r=dir.Open(TheFs,_L("L:\\asdf"),KEntryAttNormal);
-	test_Value(r, r == KErrNone || r==KErrNotReady || r==KErrNotFound);
+	test(r==KErrNone || r==KErrNotReady || r==KErrNotFound);
 	dir.Close();
 //
 	TEntry entry;
 	r=TheFs.Entry(_L("z:\\NOTEXiSTS\\file.txt"),entry);
-	test_Value(r, r == KErrPathNotFound);
+	test(r==KErrPathNotFound);
 	r=TheFs.Entry(_L("z:\\NOTEXiSTS\\"),entry);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=TheFs.Entry(_L("z:\\SYSTEM\\"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(PlatSec::ConfigSetting(PlatSec::EPlatSecEnforceSysBin)?_L("z:\\SYS\\BIN\\ESHELL.EXE"):_L("z:\\SYSTEM\\BIN\\ESHELL.EXE"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=dir.Open(TheFs,_L("\\*"),NULL);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TEntry dirEntry;
 	r=dir.Read(dirEntry);
-	test_Value(r, r == KErrNone || r==KErrEof);
+	test(r==KErrNone || r==KErrEof);
 	if (r==KErrNone)
 		test.Printf(_L("%S\n"),&dirEntry.iName);
 	dir.Close();
 
 	r=dir.Open(TheFs,_L("A:\\*"),NULL);
-	test_Value(r, r == KErrNotReady || r==KErrNone);
+	test(r==KErrNotReady || r==KErrNone);
 	dir.Close();
 	}
 
-static void Test5()
+LOCAL_C void Test5()
 //
 // Read files directly from the rom
 //
@@ -195,13 +188,13 @@
 		{
 		RFile f;
 		r=f.Open(TheFs,KTFileCpp,EFileRead);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=f.Seek(ESeekAddress,pos);
 		TText8* ptrPos=*(TText8**)&pos;
-		test_KErrNone(r);
+		test(r==KErrNone);
 		TBuf8<1024> readBuf;
 		r=f.Read(readBuf);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(readBuf.Length()==readBuf.MaxLength());
 		TPtrC8 memBuf(ptrPos,readBuf.Length());
 		test(memBuf==readBuf);
@@ -209,10 +202,10 @@
 		ptrPos+=9913;
 		pos=9913;
 		r=f.Seek(ESeekStart,pos);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		readBuf.SetLength(0);
 		r=f.Read(readBuf);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(readBuf.Length()==readBuf.MaxLength());
 		memBuf.Set(ptrPos,readBuf.Length());
 		test(memBuf==readBuf);
@@ -221,16 +214,16 @@
 		pos=10;
 		r=f2.Open(TheFs,KTFsrvCpp,EFileRead);
 
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=f2.Seek(ESeekAddress,pos);
 		ptrPos=*(TText8**)&pos;
-		test_KErrNone(r);
+		test(r==KErrNone);
 		readBuf.SetLength(0);
 		pos=10;
 		r=f2.Seek(ESeekStart,pos);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=f2.Read(readBuf);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(readBuf.Length()==readBuf.MaxLength());
 		memBuf.Set(ptrPos,readBuf.Length());
 		test(memBuf==readBuf);
@@ -238,10 +231,10 @@
 		ptrPos+=2445;
 		pos=10+2445;
 		r=f2.Seek(ESeekStart,pos);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		readBuf.SetLength(0);
 		r=f2.Read(readBuf);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(readBuf.Length()==readBuf.MaxLength());
 		memBuf.Set(ptrPos,readBuf.Length());
 		test(memBuf==readBuf);
@@ -249,13 +242,13 @@
 		pos=0;
 		r=f.Seek(ESeekAddress,pos);
 		ptrPos=*(TText8**)&pos;
-		test_KErrNone(r);
+		test(r==KErrNone);
 		readBuf.SetLength(0);
 		pos=0;
 		r=f.Seek(ESeekStart,pos);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=f.Read(readBuf);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(readBuf.Length()==readBuf.MaxLength());
 		memBuf.Set(ptrPos,readBuf.Length());
 		test(memBuf==readBuf);
@@ -263,10 +256,10 @@
 		ptrPos+=5245;
 		pos=5245;
 		r=f.Seek(ESeekStart,pos);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		readBuf.SetLength(0);
 		r=f.Read(readBuf);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(readBuf.Length()==readBuf.MaxLength());
 		memBuf.Set(ptrPos,readBuf.Length());
 		test(memBuf==readBuf);
@@ -276,7 +269,7 @@
 		}
 	}
 
-static void Test6()
+LOCAL_C void Test6()
 //
 // Test rom return values
 //
@@ -285,17 +278,17 @@
 
 	RFile f;
 	TInt r=f.Replace(TheFs,_L("Z:\\Test\\T_Fsrv.Cpp"),EFileRead);
-	test_Value(r, r == KErrAccessDenied);
+	test(r==KErrAccessDenied);
 	r=f.Create(TheFs,_L("Z:\\Test\\newT_Fsrv.Cpp"),EFileRead);
-	test_Value(r, r == KErrAccessDenied);
+	test(r==KErrAccessDenied);
 	r=f.Open(TheFs,_L("Z:\\Test\\T_Fsrv.Cpp"),EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 	r=f.Open(TheFs,_L("Z:\\Test\\T_Fsrv.Cpp"),EFileRead|EFileWrite);
-	test_Value(r, r == KErrAccessDenied);
+	test(r==KErrAccessDenied);
 	}
 
-static void Test7()
+LOCAL_C void Test7()
 //
 // Test cache
 //
@@ -309,7 +302,7 @@
 
 	TEntry entry;
 	TInt r=TheFs.Entry(file1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iType==uid1);
 
 	TUidType uid2(TUid::Uid(4),TUid::Uid(5),TUid::Uid(6));
@@ -317,23 +310,23 @@
 	TPtrC8 uidData((TUint8*)&checkedUid,sizeof(TCheckedUid));
 	RFile f;
 	r=f.Open(TheFs,file1,EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Write(uidData);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = f.Flush();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Entry(file1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iType==uid2);
 
 	f.Close();
 	r=TheFs.Entry(file1,entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iType==uid2);
 	}
 
-static void Test8()
+LOCAL_C void Test8()
 //
 // Test IsValidName
 //
@@ -542,7 +535,7 @@
         }
 	}
 
-static void Test9()
+LOCAL_C void Test9()
 //
 // Test IsFileInRom
 //
@@ -552,7 +545,7 @@
 
 	CFileMan* fMan=CFileMan::NewL(TheFs);
 	TInt r=fMan->Copy(_L("Z:\\TEST\\T_FILE.CPP"),_L("C:\\T_FILE.CPP"));
-	test_Value(r, r == KErrNone || r==KErrAccessDenied);
+	test(r==KErrNone || r==KErrAccessDenied);
 	delete fMan;
 	TUint8* addr=TheFs.IsFileInRom(_L("C:\\ESHELL.EXE"));
 	test(addr==NULL);
@@ -569,7 +562,7 @@
 		}
 	}
 
-static void Test10()
+LOCAL_C void Test10()
 //
 // Test drive names
 //
@@ -581,7 +574,7 @@
 	for(i=0;i<KMaxDrives;i++)
 		{
 		TInt r=TheFs.GetDriveName(i,driveName);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		if (driveName.Length())
 			test.Printf(_L("Default name of %c: == %S\n"),'A'+i,&driveName);
 		}
@@ -591,32 +584,32 @@
 	TBuf<64> drive17=_L("Flibble");
 	TBuf<64> drive25=_L("RAMDRIVE");
 	TInt r=TheFs.SetDriveName(0,drive0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetDriveName(4,drive4);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetDriveName(17,drive17);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetDriveName(25,drive25);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.GetDriveName(0,driveName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(driveName==drive0);
 	r=TheFs.GetDriveName(4,driveName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(driveName==drive4);
 	r=TheFs.GetDriveName(17,driveName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(driveName==drive17);
 	r=TheFs.GetDriveName(25,driveName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(driveName==drive25);
 
 	drive0=_L("askdjflsdfourewoqiuroiuaksjdvx,cvsdhwjhjhalsjhfshfkjhslj");
 	r=TheFs.SetDriveName(0,drive0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.GetDriveName(0,driveName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(driveName==drive0);
 
 //	Test with illegal characters in drive name
@@ -626,13 +619,13 @@
 	drive25=_L("RAMD//RIVE");
 
 	r=TheFs.SetDriveName(0,drive0);
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.SetDriveName(4,drive4);
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.SetDriveName(17,drive17);
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.SetDriveName(25,drive25);
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 
 //	Test that it is OK to set the name to no characters
 
@@ -642,31 +635,31 @@
 	drive25=_L("");
 
 	r=TheFs.SetDriveName(0,drive0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetDriveName(4,drive4);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetDriveName(17,drive17);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetDriveName(25,drive25);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.GetDriveName(0,driveName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(driveName==drive0);
 	r=TheFs.GetDriveName(4,driveName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(driveName==drive4);
 	r=TheFs.GetDriveName(17,driveName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(driveName==drive17);
 	r=TheFs.GetDriveName(25,driveName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(driveName==drive25);
 
 
 	}
 
-static void Test11()
+LOCAL_C void Test11()
 //
 // Miscellaneous tests
 //
@@ -676,14 +669,14 @@
 	TVolumeInfo vol;
 	TInt r=TheFs.Volume(vol);
 	test.Printf(_L("VolumeName = %S\n"),&vol.iName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(_L("\\asdfasdf.\\"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.MkDir(_L("\\asdfasdf.\\"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	}
 
-static void Test12()
+LOCAL_C void Test12()
 //
 // Test SetNotifyUser and GetNotifyUser
 //
@@ -702,7 +695,7 @@
 	test(notifyState);
 	}
 
-static void Test13()
+LOCAL_C void Test13()
 //
 // Test return values from RFs::Volume on cf-cards
 //
@@ -711,60 +704,107 @@
 	test.Next(_L("Test RFs::Volume"));
 	TVolumeInfo vol;
 	TInt r=TheFs.Volume(vol,EDriveB);
-	test_Value(r, r == KErrNotReady || r==KErrNone || r == KErrPathNotFound);
+	test(r==KErrNotReady || r==KErrNone || KErrPathNotFound);
 	test.Printf(_L("RFs::Volume EDriveB returned %d\n"),r);
 
 	r=TheFs.Volume(vol,EDriveC);
-	test_Value(r, r == KErrNotReady || r==KErrNone || r == KErrPathNotFound);
+	test(r==KErrNotReady || r==KErrNone || KErrPathNotFound);
 	test.Printf(_L("RFs::Volume EDriveC returned %d\n"),r);
 
 	r=TheFs.Volume(vol,EDriveD);
-	test_Value(r, r == KErrNotReady || r==KErrNone || r == KErrPathNotFound);
+	test(r==KErrNotReady || r==KErrNone || KErrPathNotFound);
 	test.Printf(_L("RFs::Volume EDriveD returned %d\n"),r);
 
 	r=TheFs.Volume(vol,EDriveE);
-	test_Value(r, r == KErrNotReady || r==KErrNone || r == KErrPathNotFound);
+	test(r==KErrNotReady || r==KErrNone || KErrPathNotFound);
 	test.Printf(_L("RFs::Volume EDriveE returned %d\n"),r);
 
 	r=TheFs.Volume(vol,EDriveF);
-	test_Value(r, r == KErrNotReady || r==KErrNone || r == KErrPathNotFound);
+	test(r==KErrNotReady || r==KErrNone || KErrPathNotFound);
 	test.Printf(_L("RFs::Volume EDriveF returned %d\n"),r);
 	}
 
 
 void    DoTest14(TInt aDrvNum);
 TInt    CreateStuffedFile(RFs& aFs, const TDesC& aFileName, TUint aFileSize);
+TInt    CreateEmptyFile(RFs& aFs, const TDesC& aFileName, TUint aFileSize);
 TBool   CheckFileContents(RFs& aFs, const TDesC& aFileName);
 #ifndef __NFE_MEDIA_DRIVER_PRESENT__
 TBool   CheckBufferContents(const TDesC8& aBuffer, TUint aPrintBaseAddr=0);
 #endif
 
 /**
-    Testing unallocated data initialization vulnerability in RFile
-    This test is performed on RAM drives and non-removable media that supports DeleteNotify (KMediaAttDeleteNotify flag)
-    e.g. XSR NAND
+Testing unallocated data initialization vulnerability in RFile
+This test is performed on RAM drives and non-removable media that supports DeleteNotify (KMediaAttDeleteNotify flag)
+e.g. XSR NAND
 */
-static void Test14()
+LOCAL_C void Test14()
 {
+	TInt nRes;
 
 	test.Next(_L("Testing unallocated data initialization vulnerability in RFile"));
 
-    TDriveInfo driveInfo;
-	
-    //-- get drive info
-	test(TheFs.Drive(driveInfo, gDriveNum) == KErrNone);
+	TDriveList driveList;
+	TDriveInfo driveInfo;
+
+	//-- 1. get drives list
+	nRes=TheFs.DriveList(driveList);
+    test(nRes == KErrNone);
+
+	//-- 2. walk through all drives, performing the test only on suitable ones
+	for (TInt drvNum=0; drvNum<KMaxDrives; ++drvNum)
+    {
+	    if(!driveList[drvNum])
+	        continue;   //-- skip unexisting drive
+
+	    //-- get drive info
+	    test(TheFs.Drive(driveInfo, drvNum) == KErrNone);
+
+	    //-- select a suitable drive for the testing. It shall be RAM drive, of FLASH but not removable
+	    //-- and not read only, if it is FLASH, it shall support "Delete Notify" facility
+        switch(driveInfo.iType)
+        {
+        //-- RAM drive, OK
+        case EMediaRam:
+        break;
+
+        //-- FLASH drive, OK
+        case EMediaFlash:
+        case EMediaNANDFlash:
+            if(driveInfo.iMediaAtt & KMediaAttDeleteNotify)
+                break; //-- this type of media shall support DeleteNotify flag, otherwise this test is inconsistent
+            else continue;
 
-    const TBool bMediaSuitable = (driveInfo.iType == EMediaRam)     || //-- RAM drives should be tested
-                                 (driveInfo.iType == EMediaFlash)   || //-- NOR FLASH drives should be tested
-                                 (driveInfo.iType == EMediaNANDFlash && driveInfo.iMediaAtt & KMediaAttDeleteNotify); //-- NAND media with DeleteNotify support
-    
-    if(!bMediaSuitable)
-    {
-        test.Printf(_L("This test can't be performed on this type of the media! Skipping.\n"));
-        return;
-    }
-    
-    DoTest14(gDriveNum);
+        //break; //unreacable
+
+        default:
+            continue;
+        }//switch(driveInfo.iType)
+
+		if (driveInfo.iDriveAtt	& KDriveAttSubsted)
+			{
+			// skip subst drives.
+			continue;
+			}
+
+        TBool readOnly = driveInfo.iMediaAtt & KMediaAttWriteProtected;
+        if(readOnly)
+            continue; //-- nothing to do, can't create any file etc.
+
+        //-- skip test on the emulator's C: drive, doesn't make any sense because
+        //-- in this case we deal with WIN32 API and filesystem.
+        #ifdef __WINS__
+        if(drvNum == 2)
+        {
+             test.Printf(_L("Skipping test on emulator's C: drive\n"));
+             continue;
+        }
+        #endif
+
+        DoTest14(drvNum);
+
+    }// for (TInt drvNum=0; ...
+
 }
 
 //--------------------------------------------------------
@@ -795,17 +835,17 @@
 
     //-- 1. create an empty file
     nRes = CreateEmptyFile(TheFs, fileName, KFileSize);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
 #ifndef __NFE_MEDIA_DRIVER_PRESENT__	// can't easily check for illegitimate information if drive is encrypted
     //-- 1.1  check that this file doesn't contain illegitimate information.
     nRes = CheckFileContents(TheFs, fileName);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 #endif
 
     //-- 1.2 delete the empty file
     nRes = TheFs.Delete(fileName);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     //==============================
     //== Scenario 2.
@@ -818,25 +858,25 @@
 
     //-- 2. create file filled with some data pattern
     nRes = CreateStuffedFile(TheFs, fileName, KFileSize);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     //-- 2.1 delete this file
     TheFs.Delete(fileName);
 
     //-- 2.1 create an empty file on the place of just deleted one (hopefully)
     nRes = CreateEmptyFile(TheFs, fileName, KFileSize);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     //-- 2.2  check that this file doesn't contain illegitimate information.
     nRes = CheckFileContents(TheFs, fileName);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     //-- 2.3 delete this file
     TheFs.Delete(fileName);
 
 }
 
-static void Test15()
+LOCAL_C void Test15()
 //
 // Test IsValidName
 //
@@ -1133,11 +1173,11 @@
 	test.Next(_L("Test RFs::GetMediaSerialNumber"));	
     TInt theDrive;
     TInt r = TheFs.CharToDrive(gDriveToTest,theDrive);
-    test_KErrNone(r);
+    test(r == KErrNone);
     TMediaSerialNumber serNum;
     r = TheFs.GetMediaSerialNumber(serNum, theDrive);
 	if (r) test.Printf(_L("RFs::GetMediaSerialNumber returned error %d"), r);
-    test_Value(r, r == KErrNotSupported || r == KErrNotReady || r == KErrNone);
+    test(r == KErrNotSupported || r == KErrNotReady || r == KErrNone);
     if (r == KErrNotSupported)
         {
         test.Printf(_L("MediaSerialNumber: Not Supported\n"));
@@ -1169,6 +1209,32 @@
 
 //--------------------------------------------------------
 
+/**
+    Create an empty file of specified size.
+    @param  aFs		    ref. to the FS
+    @param  aFileName   name of the file
+    @param  aFileSize   size of the file to be created
+    @return    KErrNone on success, system-wide error code otherwise
+*/
+TInt CreateEmptyFile(RFs& aFs, const TDesC& aFileName, TUint aFileSize)
+{
+    RFile   file;
+	TInt    nRes;
+
+	nRes = file.Create(aFs, aFileName, EFileRead|EFileWrite);
+    if(nRes != KErrNone)
+        return nRes;
+
+	nRes = file.SetSize(aFileSize);
+    if(nRes != KErrNone)
+        return nRes;
+
+    file.Close();
+
+    return KErrNone;
+}
+
+//--------------------------------------------------------
 
 /**
     Create a file of specified size filled with some data pattern.
@@ -1238,7 +1304,7 @@
 
     //-- open the file
     nRes = file.Open(aFs, aFileName, EFileRead);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
     //-- check file contents
     TUint nFilePos=0;
@@ -1246,7 +1312,7 @@
     {
         //-- read data from the file into the buffer
         nRes = file.Read(buffer);
-        test_KErrNone(nRes);
+        test(nRes == KErrNone);
 
         if(buffer.Length() == 0)
         {
@@ -1297,11 +1363,11 @@
 
     //-- check if the buffer filled with allowable data (RAM page initialisation data or something similar)
     //-- but not something meaningful.
-    //-- Actually, the buffer should be filled with uniformed bytes (most probably, 0x00)
+    //-- allowable bytes: 0x00, 0x03, 0xff, 0xcc
     for(TInt i=0; i<aBuffer.Size(); ++i)
     {
         TUint8 byte = aBuffer[i];
-        if(byte != aBuffer[0])
+        if(byte != 0x00 && byte != 0x03 && byte != 0xff && byte != 0xcc )
         {
             bRes = EFalse;
             break;
@@ -1328,368 +1394,13 @@
     return bRes;
 }
 
-//--------------------------------------------------------
-/**
-    Check if the drive aDriveNo is finalised or not.
-    The "CleanShutDown" is obtained by QueryVolumeInfoExt API which is FS-agnostic.
-
-    @param  aDriveNo drive number to query.
-    @return ETrue if the drive if finalised
-*/
-static TBool IsVolumeFinalised(TInt aDriveNo)
-{
-    TInt nRes;
-    TPckgBuf<TBool> boolPckg;
-
-    //-- 1. get "Finalised" state by using the API
-    nRes = TheFs.QueryVolumeInfoExt(aDriveNo, EIsDriveFinalised, boolPckg);
-    test_KErrNone(nRes);
-    
-    return boolPckg();
-}
-
-
-//--------------------------------------------------------
-/**
-    This is a file system - agnostic test that verifies RFs::FinaliseDrive() API
-    There are also file system - specific tests that check similar functionallity (see t_mount for example)
-
-*/
-void TestDriveFinalisation()
-{
-    test.Next(_L("TestDriveFinalisation(). Testing RFs::FinaliseDrives() API\n"));    
-    
-
-    if((!Is_Fat(TheFs, gDriveNum) && !Is_ExFat(TheFs, gDriveNum)) || Is_Fat12(TheFs, gDriveNum) )
-    {
-        test.Printf(_L("This test can't be performed on current file system, skipping.\n"));
-        return;
-    }
-
-    TVolumeInfo v;
-    TInt  nRes;
-
-    nRes = TheFs.Volume(v);
-    test(nRes==KErrNone);
-
-    if(v.iDrive.iMediaAtt & KMediaAttVariableSize)
-        {
-        test.Printf(_L("Skipping. RAM drive not tested.\n"));
-        return;
-        }
-
-
-    TBool bDriveFinalised;
-
-    //============= 1. finalise the drive (RW mode) and check the result
-    nRes =TheFs.FinaliseDrive(gDriveNum, RFs::EFinal_RW);
-    test_KErrNone(nRes);
-
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(bDriveFinalised);
-
-    //-- 1.1 finalise the drive second time EFinal_RW -> EFinal_RW shall work
-    nRes =TheFs.FinaliseDrive(gDriveNum, RFs::EFinal_RW);
-    test_KErrNone(nRes);
-
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(bDriveFinalised);
-
-    //============= 2. create a file. Shall succeed (EFinal_RW), the volume shall become unfinalised
-
-    RFile file;
-    _LIT(KFileName, "\\my_file1.dat");
-    _LIT8(KSomeData, "this is some data");
-
-    nRes = CreateEmptyFile(TheFs, KFileName, 128000);
-    test_KErrNone(nRes);
-
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(!bDriveFinalised); //-- the volume has become "unfinalised"
-
-    //----------------------------------------------------------------------------------
-    //-- test volume finalisation with opened objects
-
-    //-- 2.1 having opened files should be OK for volume finalisation
-    
-    //-- 2.1.1 RW finalisation; after the volume finalised it should be possible to write to the opened file
-    nRes = file.Open(TheFs, KFileName, EFileWrite | EFileWriteDirectIO);
-    test_KErrNone(nRes);
-
-    nRes =TheFs.FinaliseDrive(gDriveNum, RFs::EFinal_RW);
-    test_KErrNone(nRes);
-
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(bDriveFinalised);
-
-    nRes = file.Write(0, KSomeData);
-    test_KErrNone(nRes);
-
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(!bDriveFinalised); //-- the volume should become "unfinalised"
-
-    //-- 2.1.2 RO finalisation; after the volume finalised it shouldn't be possible to write to the opened file
-    nRes =TheFs.FinaliseDrive(gDriveNum, RFs::EFinal_RO);
-    test_KErrNone(nRes);
-
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(bDriveFinalised);
-
-    nRes = file.Write(0, KSomeData);
-    test(nRes == KErrAccessDenied);  //-- no write access to the volume
-
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(bDriveFinalised); //-- the volume should become "unfinalised"
-
-    file.Close();
-    
-    //-- remount FS, the drive shall become RW
-    nRes = RemountFS(TheFs, gDriveNum);
-    test_KErrNone(nRes);
-    
-    
-    //-- 2.2 having opened directories should be OK for volume finalisation
-    _LIT(KDirName,  "\\Dir11235tt\\");
-    MakeDir(KDirName);
-    RDir dir;
-
-    //-- 2.2.1 RW finalisation; after the volume finalised it should be possible to have write access to it
-    nRes = dir.Open(TheFs, KDirName, KEntryAttNormal);
-    test_KErrNone(nRes);
-
-    nRes =TheFs.FinaliseDrive(gDriveNum, RFs::EFinal_RW);
-    test_KErrNone(nRes);
-
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(bDriveFinalised);
-
-    nRes = CreateEmptyFile(TheFs, KFileName, 128000);
-    test_KErrNone(nRes);
-
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(!bDriveFinalised);
-
-    //-- 2.1.2 RO finalisation; after the volume finalised it shouldn't be possible to write to it
-    nRes =TheFs.FinaliseDrive(gDriveNum, RFs::EFinal_RO);
-    test_KErrNone(nRes);
-
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(bDriveFinalised);
-
-    nRes = CreateEmptyFile(TheFs, KFileName, 128000);
-    test(nRes == KErrAccessDenied);  //-- no write access to the volume
-
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(bDriveFinalised); //-- the volume should become "unfinalised"
-
-    dir.Close();
-
-    //-- remount FS, the drive shall become RW
-    nRes = RemountFS(TheFs, gDriveNum);
-    test_KErrNone(nRes);
-    
-    //-- 2.3 having opened disk access objects, like formats or raw disks makes finalisation impossible
-    RFormat  format;
-    RRawDisk rawDisk;
-    TInt     fmtCnt;
-
-    //-- 2.3.1 format
-    nRes =TheFs.FinaliseDrive(gDriveNum, RFs::EFinal_RW);
-    test_KErrNone(nRes);
-
-    nRes = format.Open(TheFs, gSessionPath, EFullFormat, fmtCnt);
-    test_KErrNone(nRes);
-
-    nRes =TheFs.FinaliseDrive(gDriveNum, RFs::EFinal_RW);
-    test(nRes == KErrInUse);  
-
-    nRes =TheFs.FinaliseDrive(gDriveNum, RFs::EFinal_RO);
-    test(nRes == KErrInUse);  
-
-    format.Close();
 
-    nRes =TheFs.FinaliseDrive(gDriveNum, RFs::EFinal_RW);
-    test_KErrNone(nRes);
-
-    //-- 2.3.2 raw disk
-    nRes = rawDisk.Open(TheFs, gDriveNum);
-    test_KErrNone(nRes);
-
-
-    nRes =TheFs.FinaliseDrive(gDriveNum, RFs::EFinal_RW);
-    test(nRes == KErrInUse);  
-
-    nRes =TheFs.FinaliseDrive(gDriveNum, RFs::EFinal_RO);
-    test(nRes == KErrInUse);  
-    
-    rawDisk.Close();
-
-    //-- 2.4 Volume finalisation and file system dismounting
-
-    //-- 2.4.1 "graceful" dismounting should finalise the drive correctly
-
-    //-- "unfinalise the volume"
-    nRes = CreateEmptyFile(TheFs, KFileName, 128000);
-    test_KErrNone(nRes);
-
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(!bDriveFinalised);
-
-    TFSDescriptor fsDesc;
-    nRes = GetFileSystemDescriptor(TheFs, gDriveNum, fsDesc);
-    test_KErrNone(nRes);
-
-    //-- gracefully dismount the file system
-    nRes = TheFs.DismountFileSystem(fsDesc.iFsName, gDriveNum);
-    test_KErrNone(nRes);
-
-    //-- mount it back
-    nRes = MountFileSystem(TheFs, gDriveNum, fsDesc);
-    test_KErrNone(nRes);
-
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(bDriveFinalised);
-
-    //-- 2.4.2 "forced" dismounting, usually happens when "graceful doesn't work, because there are files opened on the volume.
-    //-- Should also finalise the drive correctly
-
-    //-- "unfinalise the volume"
-    nRes = CreateEmptyFile(TheFs, KFileName, 128000);
-    test_KErrNone(nRes);
-
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(!bDriveFinalised);
-
-    //-- open a file on the volume, this will prevent graceful dismounting
-    nRes = file.Open(TheFs, KFileName, EFileWrite | EFileWriteDirectIO);
-    test_KErrNone(nRes);
-
-    nRes = GetFileSystemDescriptor(TheFs, gDriveNum, fsDesc);
-    test_KErrNone(nRes);
-
-    //-- try gracefully dismount the file system
-    nRes = TheFs.DismountFileSystem(fsDesc.iFsName, gDriveNum);
-    test(nRes == KErrInUse); //-- no luck, as expected
-
-    //-- now do dismounting by force
-    TRequestStatus  rqStat;
-    TheFs.NotifyDismount(gDriveNum, rqStat, EFsDismountForceDismount);
-    User::WaitForRequest(rqStat);
-    test_KErrNone(rqStat.Int());
-
-    nRes = file.Write(0, KSomeData);
-    test(nRes == KErrNotReady);    
-
-    file.Close();
-
-    //-- mount it back
-    nRes = MountFileSystem(TheFs, gDriveNum, fsDesc);
-    test_KErrNone(nRes);
-
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(bDriveFinalised);
-
-    //============= 3. test "unfinalise API"
-    nRes =TheFs.FinaliseDrive(gDriveNum, RFs::EForceUnfinalise);
-    test_KErrNone(nRes);
-
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(!bDriveFinalised); //-- the volume has become "unfinalised"
+GLDEF_C void CallTestsL()
+//
+// Call tests that may leave
+//
+	{
 
-    //============= 4. test finalisation into RO mode
-    nRes =TheFs.FinaliseDrive(gDriveNum, RFs::EFinal_RO); //-- the volume becomes RO
-    test_KErrNone(nRes);
-
-    //-- try to write a file on RO volume; it shall fail with KErrAccessDenied
-    nRes = CreateEmptyFile(TheFs, KFileName, 128000);
-    test(nRes == KErrAccessDenied);
-    file.Close();
-
-    //-- 4.1 try to finalise into EFinal_RW mode, shall fail with KErrAccessDenied
-    nRes =TheFs.FinaliseDrive(gDriveNum, RFs::EFinal_RW);
-    test(nRes == KErrAccessDenied);
-
-    //-- 4.2 "unfinalise" the volume, it still shall remain RO
-    nRes =TheFs.FinaliseDrive(gDriveNum, RFs::EForceUnfinalise);
-    test_KErrNone(nRes);
-
-    //-- try to write a file on RO volume; it shall fail with KErrAccessDenied
-    nRes = CreateEmptyFile(TheFs, KFileName, 128000);
-    test(nRes == KErrAccessDenied);
-    file.Close();
-
-    //-- remount FS, the drive shall become RW
-    nRes = RemountFS(TheFs, gDriveNum);
-    test_KErrNone(nRes);
-
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(bDriveFinalised);
-
-    //-- try to write a file on RW volume, shall be OK
-    nRes = CreateEmptyFile(TheFs, KFileName, 128000);
-    test(nRes == KErrNone);
-    file.Close();
-
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(!bDriveFinalised);
-
-    //============= 5. test various finalisation modes
-
-    //-- 5.1  Not finalised -> EFinal_RW (KErrNone)
-    nRes =TheFs.FinaliseDrive(gDriveNum, RFs::EFinal_RW);
-    test(nRes == KErrNone);
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(bDriveFinalised);
-
-    //-- 5.2  EFinal_RW -> EFinal_RO (KErrNone)
-    nRes =TheFs.FinaliseDrive(gDriveNum, RFs::EFinal_RO);
-    test(nRes == KErrNone);
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(bDriveFinalised);
-
-    //-- 5.2  EFinal_RO -> EFinal_RW  (KErrAccessDenied)
-    nRes =TheFs.FinaliseDrive(gDriveNum, RFs::EFinal_RW);
-    test(nRes == KErrAccessDenied);
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(bDriveFinalised);
-
-    //-- 5.3 restore
-    nRes = RemountFS(TheFs, gDriveNum);
-    test_KErrNone(nRes);
-
-
-    //============= 6. test old RFs::FinaliseDrives API
-
-    nRes = CreateEmptyFile(TheFs, KFileName, 128000);
-    test(nRes == KErrNone);
-
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(!bDriveFinalised);
-
-    TheFs.FinaliseDrives(); //-- shall work as TheFs.FinaliseDrive(gDriveNum, RFs::EFinal_RW) but for ALL drives
-
-    bDriveFinalised = IsVolumeFinalised(gDriveNum);
-    test(bDriveFinalised);
-
-    nRes = CreateEmptyFile(TheFs, KFileName, 128000);
-    test(nRes == KErrNone);
-
-
-
-}
-
-
-void CallTestsL()
-	{
-    //-- set up console output
-    F32_Test_Utils::SetConsole(test.Console());
-
-    TInt nRes=TheFs.CharToDrive(gDriveToTest, gDriveNum);
-    test_KErrNone(nRes);
-    
-    PrintDrvInfo(TheFs, gDriveNum);
-
-    TestDriveFinalisation();
 	Test1();
 	Test2();
 	Test3();
@@ -1706,5 +1417,4 @@
 	Test14();
 	Test15();
     TestGetMediaSerialNumber();
-
 	}
--- a/kerneltest/f32test/server/t_mmc.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_mmc.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,6 @@
 //
 
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <f32dbg.h>
@@ -171,7 +170,7 @@
 		r = TheFs.Delete(mediaPWrdFile);
 		} while (r == KErrInUse);
 
-	test_Value(r, r == KErrNone || r == KErrNotFound);
+	test(r == KErrNone || r == KErrNotFound);
 	}
 
 
@@ -654,7 +653,7 @@
 	User::After(1 * 1000 * 1000);				// wait to finish writing
 	
 	r = TheFs.Delete(mediaPWrdFile);
-	test_Value(r, r == KErrNone || r == KErrNotFound);
+	test(r == KErrNone || r == KErrNotFound);
 	test(TBusLocalDrive::WritePasswordData(noMappings) == KErrNone);
 
 	// check contents of password file correspond to last written buffer.
@@ -817,7 +816,7 @@
 	mediaPWrdFile[0] = (TUint8) RFs::GetSystemDriveChar();
 	TParsePtrC ppc(mediaPWrdFile);
 	TInt r = TheFs.MkDir(ppc.DriveAndPath());
-	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+	test(r == KErrNone || r == KErrAlreadyExists);
 
 	// The media driver for the protected area of the SD card uses mount
 	// info. This is also used for password unlocking by the MMC media driver.
--- a/kerneltest/f32test/server/t_mvdr.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_mvdr.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -19,7 +19,6 @@
 //
 
 
-#define __E32TEST_EXTENSION__
 #include <e32test.h>
 #include <f32file.h>
 
@@ -51,7 +50,7 @@
 
 	CFileMan *fm = 0;
 	TRAPD(r, fm = CFileMan::NewL(TheFs));
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	const TInt KMaxDirs = 32;
 
@@ -80,7 +79,7 @@
 			srcDirName.SetLength(srcDirName.Length() - 1);
 			dstDirName.SetLength(dstDirName.Length() - 1);
 			r = fm->Move(srcDirName, dstDirName);
-			test_KErrNone(r);
+			test(r == KErrNone);
 			}
 		}
 
--- a/kerneltest/f32test/server/t_nmbs.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_nmbs.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -13,14 +13,10 @@
 // Description:
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include "t_server.h"
 #include "t_chlffs.h"
-#include "f32_test_utils.h"
-
-using namespace F32_Test_Utils;
 
 GLDEF_D RTest test(_L("T_NMBS"));
 
@@ -33,69 +29,69 @@
 	test.Next(_L("Test MkDir"));
 
 	TInt r=TheFs.RmDir(_L("\\F32-TST\\TNMBS\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.MkDir(_L("\\F32-TST\\TNMBS\\TEST\\"));
-	test_Value(r, r == KErrPathNotFound);
+	test(r==KErrPathNotFound);
 	r=TheFs.MkDir(_L("\\F32-TST\\TNMBS\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.MkDir(_L("\\F32-TST\\TNMBS\\TEST\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("Test RmDir 1.0"));
 	r=TheFs.RmDir(_L("\\F32-TST\\TNMBS\\TEST\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(_L("\\F32-TST\\TNMBS\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("Test MkDirAll 1.0"));
 	r=TheFs.MkDirAll(_L("\\F32-TST\\TNMBS\\TEST\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("Test RmDir 2.0"));
 	r=TheFs.RmDir(_L("\\F32-TST\\TNMBS\\TEST\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(_L("\\F32-TST\\TNMBS\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("Test MkDirAll 2.0"));
 	r=TheFs.MkDirAll(_L("\\F32-TST\\TNMBS\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.MkDirAll(_L("\\F32-TST\\TNMBS\\TEST\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("Test RmDir 3.0"));
 	r=TheFs.RmDir(_L("\\F32-TST\\TNMBS\\TEST\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(_L("\\F32-TST\\TNMBS\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("Test mkdir and rmdir on root"));
 	r=TheFs.RmDir(_L("\\File.TXT"));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=TheFs.MkDir(_L("\\asdf.ere"));
-	test_Value(r, r == KErrAlreadyExists);
+	test(r==KErrAlreadyExists);
 	r=TheFs.MkDirAll(_L("\\asdf.ere"));
-	test_Value(r, r == KErrAlreadyExists);
+	test(r==KErrAlreadyExists);
 
 	test.Next(_L("Test error code return values"));
 	r=TheFs.MkDir(_L("\\F32-TST\\\\ABCDEF\\"));
 
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 
 	test.Next(_L("Test MkDir with trailing spaces"));
 	r=TheFs.MkDir(_L("\\F32-TST\\TESTMKDIR    \\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(_L("\\F32-TST\\TESTMKDIR\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.MkDirAll(_L("\\F32-TST\\TESTMKDIR    \\NOTCREATED\\NORTHIS   \\"));
-	test_Value(r, r == KErrPathNotFound);
+	test(r==KErrPathNotFound);
 	r=TheFs.RmDir(_L("\\F32-TST\\TESTMKDIR\\NOTCREATED\\"));
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=TheFs.RmDir(_L("\\F32-TST\\TESTMKDIR\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.MkDirAll(_L("\\F32-TST\\TNMBS\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 LOCAL_C void testRename()
@@ -106,13 +102,13 @@
 
 	test.Next(_L("Test rename directories"));
 	TInt r=TheFs.MkDirAll(_L("\\F32-TST\\ABCDEF\\GPQ\\"));
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	r=TheFs.Rename(_L("\\F32-TST\\ABCDEF\\"),_L("\\F32-TST\\ABCDEF\\LMED"));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=TheFs.Rename(_L("\\F32-TST\\ABCDEF\\GPQ"),_L("\\F32-TST\\LMED"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(_L("\\F32-TST\\LMED\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	MakeDir(_L("\\F32-TST\\ABC\\"));
 	MakeFile(_L("\\F32-TST\\ABCDEF\\GPQ\\asdf.txt"));
@@ -121,124 +117,120 @@
 	test.Next(_L("Test rename directory while subfile is open"));
 	RFile f;
 	r=f.Open(TheFs,_L("\\F32-TST\\ABCDEF\\GPQ\\asdf.txt"),EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Rename(_L("\\F32-TST\\ABCDEF"),_L("\\F32-TST\\xxxyyy"));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=TheFs.Rename(_L("\\F32-TST\\ABCDEF"),_L("\\F32-TST\\xxxyyy"));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=TheFs.Rename(_L("\\F32-TST\\ABC"),_L("\\F32-TST\\XXX"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 	r=TheFs.Rename(_L("\\F32-TST\\ABCDEF"),_L("\\F32-TST\\xxxyyy"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Rename(_L("\\F32-TST\\XXX"),_L("\\F32-TST\\ABC"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Rename(_L("\\"),_L("\\BLARG"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 
 	r=f.Open(TheFs,_L("\\F32-TST\\asdf.txt"),EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Rename(_L("\\F32-TST\\xxxyyy"),_L("\\F32-TST\\ABCDEF"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Rename(_L("\\F32-TST\\"),_L("\\ABCDEF"));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	f.Close();
 
 	r=TheFs.Delete(_L("\\F32-TST\\ABCDEF\\GPQ\\asdf.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("\\F32-TST\\asdf.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(_L("\\F32-TST\\ABCDEF\\GPQ\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(_L("\\F32-TST\\ABC\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=TheFs.Rename(_L("\\TST-E32\\123456"),_L("\\F32-TST\\ABCDEF"));
-	test_Value(r, r == KErrPathNotFound);
+	test(r==KErrPathNotFound);
 	r=TheFs.Rename(_L("\\F32-TST\\123456"),_L("\\F32-TST\\ABCDEF"));
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=TheFs.Rename(_L("\\TST-E32\\123456"),_L("\\F32-TST\\FEDCBA"));
-	test_Value(r, r == KErrPathNotFound);
+	test(r==KErrPathNotFound);
 	r=TheFs.Rename(_L("\\F32-TST\\FEDCBA"),_L("\\TST-E32\\123456"));
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=TheFs.Rename(_L("\\F32-TST\\ABCDEF"),_L("\\F32-TST\\123456"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Rename(_L("\\F32-TST\\123456"),_L("\\F32-TST\\XYZABC"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("Test rename files"));
 	r=f.Create(TheFs,_L("\\F32-TST\\XYZABC\\OLDNAME.TXT"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 	r=TheFs.Rename(_L("\\F32-TST\\XYZABC\\OLDNAME.TXT"),_L("\\F32-TST\\XYZABC\\NEWNAME.TXT"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("\\F32-TST\\XYZABC\\NEWNAME.TXT"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("Test rename checks for duplicate entries"));
 	r=TheFs.MkDirAll(_L("\\F32-TST\\ABCDEF\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Rename(_L("\\F32-TST\\ABCDEF"),_L("\\F32-TST\\XYZABC"));
-	test_Value(r, r == KErrAlreadyExists);
+	test(r==KErrAlreadyExists);
 	r=f.Create(TheFs,_L("\\F32-TST\\XYZABC\\OLDNAME.TXT"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 	r=f.Create(TheFs,_L("\\F32-TST\\XYZABC\\NEWNAME.TXT"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 	r=TheFs.Rename(_L("\\F32-TST\\XYZABC\\OLDNAME.TXT"),_L("\\F32-TST\\XYZABC\\NEWNAME.TXT"));
-	test_Value(r, r == KErrAlreadyExists);
+	test(r==KErrAlreadyExists);
 
 	test.Next(_L("Test rename across directories"));
 	r=TheFs.Rename(_L("\\F32-TST\\XYZABC\\NEWNAME.TXT"),_L("\\F32-TST\\ABCDEF\\OLDNAME.TXT"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Rename(_L("\\F32-TST\\XYZABC\\NEWNAME.TXT"),_L("\\F32-TST\\ABCDEF\\OLDNAME.TXT"));
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=TheFs.Rename(_L("\\F32-TST\\XYZABC\\NEWNAME.TXT"),_L("\\F32-TST\\ABCDEF\\DIFNAME.TXT"));
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=TheFs.Rename(_L("\\F32-TST\\XYZABC"),_L("\\F32-TST\\ABCDEF\\XYZABC"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Rename(_L("\\F32-TST\\ABCDEF\\XYZABC\\OLDNAME.TXT"),_L("\\F32-TST\\ABCDEF\\NEWNAME.TXT"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Rename(_L("\\F32-TST\\ABCDEF\\NewNAME.TXT"),_L("\\F32-TST\\ABCDEF\\XYZABC\\OLDNAME.TXT"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Next(_L("Test rename across drive error code"));
 	r=TheFs.Rename(_L("Z:\\BLEG"),_L("C:\\FRUM"));
-	test_Value(r, r == KErrArgument);	
+	test(r==KErrArgument);	
 	test.Next(_L("Test rename to identical names"));
 	r=TheFs.Rename(_L("\\F32-TST\\ABCDEF\\XYZABC\\OLDNAME.TXT"),_L("\\F32-TST\\ABCDEF\\XYZABC\\OLDNAME.TXT"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckFileExists(_L("\\F32-TST\\ABCDEF\\XYZABC\\OLDNAME.TXT"),KErrNone);
 	r=TheFs.Rename(_L("\\F32-TST\\ABCDEF\\XYZABC\\OLDNAME.TXT"),_L("\\F32-TST\\ABCDEF\\XYZABC\\OLdnAME.TXT"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckFileExists(_L("\\F32-TST\\ABCDEF\\XYZABC\\OLDNAME.TXT"),KErrNone,EFalse);
 	CheckFileExists(_L("\\F32-TST\\ABCDEF\\XYZABC\\OLdnAME.TXT"),KErrNone,ETrue);
 
 	r=TheFs.Rename(_L("\\F32-TST\\ABCDEF\\XYZABC\\OLDNAME.TXT"),_L("\\F32-TST\\ABCDEF\\NEWNAME.TXT"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Next(_L("Test RmDir"));
 	r=TheFs.Delete(_L("\\F32-TST\\ABCDEF\\NEWNAME.TXT"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("\\F32-TST\\ABCDEF\\OLDNAME.TXT"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(_L("\\F32-TST\\ABCDEF\\XYZABC\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(_L("\\F32-TST\\ABCDEF\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 LOCAL_C void TestLongFileName()
 	{
-	if (Is_SimulatedSystemDrive(TheFs, CurrentDrive()))
-		{
-		// Do not perform this test for the system drive of the emulator or PlatSim
-		// as they use Windows system calls.
-		// Windows does not create a directory with length more than 244 characters
-		// (247 including <drive>:\)
-		test.Printf(_L("TestLongFileName() skipped on simulated system drive.\n"));
-		return;
-		}
+	#ifndef __EPOC32__ //emulator
+	if (gDriveToTest.GetLowerCase()=='c')
+		return;//don't perform this test for c: in emulator as emulator uses windows system calls
+		//windows doesn't create a directory with length more than 244 characters
+	#endif 
 	
-	test.Next(_L("Test renaming 257 characters directories"));
+	 test.Next(_L("Test renaming 257 characters directories"));
 	_LIT(KLongFileName256, "256dir_IncludingBackslash_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
 	_LIT(KLongFileName257, "257dir_IncludingBackslash_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
 	TBuf<260> Path;
@@ -252,11 +244,11 @@
 	TInt 	result = KErrNone;
 	//-- 1. create directory in Root which total path length is 256 symbols.	result = TheFs.MkDirAll(Path);
 	result=TheFs.MkDirAll(Path);
-	test_Value(result, (result == KErrNone)||(result==KErrAlreadyExists));
+	test((result==KErrNone)||(result==KErrAlreadyExists));
 	
 	test.Next(_L("Renaming a 265 char directory to a 257 char directory"));
 	result=TheFs.SetSessionPath(baseDir);
-	test_KErrNone(result);	
+	test(result==KErrNone);	
 	TheFs.SessionPath(baseDir);
 	test.Printf(_L("Session path was set to: %S"), &baseDir);
 
@@ -265,12 +257,12 @@
 	result = KErrNone;
 	Path.Copy(KLongFileName257);
 	result = TheFs.Rename(KLongFileName256, Path);
-	test_Value(result, result == KErrBadName);
+	test(result==KErrBadName);
 	//-- 3. try to rename this directory to one with 258 character total path length
 
 	Path.Append(_L("z"));
 	result = TheFs.Rename(KLongFileName256, Path);
-	test_Value(result, result == KErrBadName);
+	test(result==KErrBadName);
 
 	}
 LOCAL_C void testRenameCase()
@@ -282,7 +274,7 @@
 	test.Next(_L("Test rename case"));
 	MakeDir(_L("\\F32-TST\\RENAMECASE\\"));
 	TInt r=TheFs.SetSessionPath(_L("\\F32-TST\\RENAMECASE\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	MakeFile(_L("file1.txt"));
 	MakeFile(_L("FILE2.TXT"));
@@ -291,89 +283,89 @@
 
 	TEntry entry;
 	r=TheFs.Rename(_L("FILE1.TXT"),_L("FILE1.TXT"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("File1.txt"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("FILE1.TXT"));
 
 	r=TheFs.Rename(_L("file2.txt"),_L("file2.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("File2.txt"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("file2.txt"));
 
 	r=TheFs.Rename(_L("agenda."),_L("agenda.two"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("Agenda.two"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("agenda.two"));
 
 	r=TheFs.Rename(_L("AGENDA.ONE"),_L("AGENDA.ONE"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("Agenda.one"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("AGENDA.ONE"));
 
 	r=TheFs.Rename(_L("FILE1.TXT"),_L("file1.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("File1.txt"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("file1.txt"));
 
 	r=TheFs.Rename(_L("file2.txt"),_L("FILE2.TXT"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("File2.txt"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("FILE2.TXT"));
 
 	r=TheFs.Rename(_L("agenda.two"),_L("AGENDA"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("Agenda"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("AGENDA"));
 
 	r=TheFs.Rename(_L("AGENDA.ONE"),_L("agenda.one"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("Agenda.one"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("agenda.one"));
 
 	r=TheFs.Rename(_L("FILE1.TXT"),_L("FILe1.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("File1.txt"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("FILe1.txt"));
 
 	r=TheFs.Rename(_L("file2.txt"),_L("FILE3.TXT"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("File3.txt"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("FILE3.TXT"));
 
 	r=TheFs.Rename(_L("agenda."),_L("AGENDA1"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("Agenda1"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("AGENDA1"));
 
 	r=TheFs.Rename(_L("AGENDA.ONE"),_L("Agenda.One"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Entry(_L("Agenda.one"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("Agenda.One"));
 
 	r=TheFs.Delete(_L("file1.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("file3.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("Agenda1"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("AGENDA.ONE"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(_L("\\F32-TST\\RENAMECASE\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 LOCAL_C void testReplace()
@@ -384,33 +376,33 @@
 
 	test.Next(_L("Test Replace"));
 	TInt r=TheFs.MkDirAll(_L("\\F32-TST\\ABCDEF\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Replace(_L("\\TST-E32\\123456"),_L("\\F32-TST\\ABCDEF"));
-	test_Value(r, r == KErrAccessDenied); // Do not replace directories
+	test(r==KErrAccessDenied); // Do not replace directories
 	r=TheFs.Replace(_L("\\F32-TST\\123456"),_L("\\F32-TST\\ABCDEF"));
-	test_Value(r, r == KErrAccessDenied);
+	test(r==KErrAccessDenied);
 	r=TheFs.Replace(_L("\\TST-E32\\123456"),_L("\\F32-TST\\FEDCBA"));
-	test_Value(r, r == KErrPathNotFound);
+	test(r==KErrPathNotFound);
 	r=TheFs.Replace(_L("\\F32-TST\\ABCDEF"),_L("\\F32-TST\\123456"));
-	test_Value(r, r == KErrAccessDenied);
+	test(r==KErrAccessDenied);
 
 	test.Next(_L("Replace a file with itself (8.3 filename)"));
 	MakeFile(_L("\\F32-TST\\ABCDEF\\TEST1.SPR"));
 	r=TheFs.Replace(_L("\\F32-TST\\ABCDEF\\TEST1.SPR"),_L("\\F32-TST\\ABCDEF\\TEST1.SPR"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckFileExists(_L("\\F32-TST\\ABCDEF\\TEST1.SPR"),KErrNone);
 	r=TheFs.Replace(_L("\\F32-TST\\ABCDEF\\TEST1.SPR"),_L("\\F32-TST\\ABCDEF\\test1.spr"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckFileExists(_L("\\F32-TST\\ABCDEF\\TEST1.SPR"),KErrNone,ETrue); // Replace does not rename existing file
 	CheckFileExists(_L("\\F32-TST\\ABCDEF\\test1.spr"),KErrNone,EFalse);
 
 	test.Next(_L("Replace a file with itself (vfat filename)"));
 	MakeFile(_L("\\F32-TST\\ABCDEF\\TEST_SHEET(01).SPR"));
 	r=TheFs.Replace(_L("\\F32-TST\\ABCDEF\\TEST_SHEET(01).SPR"),_L("\\F32-TST\\ABCDEF\\TEST_SHEET(01).SPR"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckFileExists(_L("\\F32-TST\\ABCDEF\\TEST_SHEET(01).SPR"),KErrNone);
 	r=TheFs.Replace(_L("\\F32-TST\\ABCDEF\\TEST_SHEET(01).SPR"),_L("\\F32-TST\\ABCDEF\\test_sheet(01).spr"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckFileExists(_L("\\F32-TST\\ABCDEF\\TEST_SHEET(01).SPR"),KErrNone,ETrue); // Replace does not rename existing file
 	CheckFileExists(_L("\\F32-TST\\ABCDEF\\test_sheet(01).spr"),KErrNone,EFalse);
 
@@ -418,14 +410,14 @@
 	MakeFile(_L("\\F32-TST\\ABCDEF\\SHEET1.SPR"),_L8("Original Data"));
 	MakeFile(_L("\\F32-TST\\ABCDEF\\TEMP0001.SPR"),_L8("NewData"));
 	r=TheFs.Replace(_L("\\F32-TST\\ABCDEF\\TEMP0001.SPR"),_L("\\F32-TST\\ABCDEF\\SHEET1.SPR"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckFileContents(_L("\\F32-TST\\ABCDEF\\SHEET1.SPR"),_L8("NewData"));
 	CheckFileExists(_L("\\F32-TST\\ABCDEF\\TEMP0001.SPR"),KErrNotFound);
 
 	r=TheFs.Rename(_L("\\F32-TST\\ABCDEF\\SHEET1.SPR"),_L("\\F32-TST\\ABCDEF\\TEMP0001.SPR"));
-	test_KErrNone(r);
+	test(r==KErrNone);
     r=TheFs.Replace(_L("\\F32-TST\\ABCDEF\\TEMP0001.SPR"),_L("\\F32-TST\\ABCDEF\\SHEET1.SPR"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckFileContents(_L("\\F32-TST\\ABCDEF\\SHEET1.SPR"),_L8("NewData"));
 	CheckFileExists(_L("\\F32-TST\\ABCDEF\\TEMP0001.SPR"),KErrNotFound);
 
@@ -433,31 +425,31 @@
 	MakeFile(_L("\\F32-TST\\ABCDEF\\SHEET_TEST1.SPR"),_L8("Original Data"));
 	MakeFile(_L("\\F32-TST\\ABCDEF\\NEW_TEMP0001.SPR"),_L8("NewData"));
 	r=TheFs.Replace(_L("\\F32-TST\\ABCDEF\\NEW_TEMP0001.SPR"),_L("\\F32-TST\\ABCDEF\\SHEET_TEST1.SPR"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckFileContents(_L("\\F32-TST\\ABCDEF\\SHEET_TEST1.SPR"),_L8("NewData"));
 	CheckFileExists(_L("\\F32-TST\\ABCDEF\\NEW_TEMP0001.SPR"),KErrNotFound);
 
 	r=TheFs.Rename(_L("\\F32-TST\\ABCDEF\\SHEET_TEST1.SPR"),_L("\\F32-TST\\ABCDEF\\NEW_TEMP0001.SPR"));
-	test_KErrNone(r);
+	test(r==KErrNone);
     r=TheFs.Replace(_L("\\F32-TST\\ABCDEF\\NEW_TEMP0001.SPR"),_L("\\F32-TST\\ABCDEF\\SHEET_TEST1.SPR"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckFileContents(_L("\\F32-TST\\ABCDEF\\SHEET_TEST1.SPR"),_L8("NewData"));
 	CheckFileExists(_L("\\F32-TST\\ABCDEF\\NEW_TEMP0001.SPR"),KErrNotFound);
 
 	r=TheFs.RmDir(_L("\\F32-TST\\ABCDEF\\"));
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	r=TheFs.RmDir(_L("\\F32-TST\\ABCDEF\\SHEET1.SPR\\"));
-	test_Value(r, r == KErrPathNotFound);
+	test(r==KErrPathNotFound);
 	r=TheFs.Delete(_L("\\F32-TST\\ABCDEF\\SHEET1.SPR"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("\\F32-TST\\ABCDEF\\SHEET_TEST1.SPR"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("\\F32-TST\\ABCDEF\\TEST1.SPR"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("\\F32-TST\\ABCDEF\\TEST_SHEET(01).SPR"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(_L("\\F32-TST\\ABCDEF\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("Check file date is retained"));
 	MakeFile(_L("OldFile.Old"));
@@ -467,11 +459,11 @@
 	TTime newTime(newDate);
 	
 	r=TheFs.SetEntry(_L("NewFile.new"),newTime,0,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TEntry entry;
 	r=TheFs.Entry(_L("NewFile.new"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TTime checkReturnedTime=entry.iModified;
 	TDateTime dateTime=checkReturnedTime.DateTime();
@@ -481,13 +473,13 @@
 	TDateTime oldDate(1996,(TMonth)2,3,23,0,0,0);
 	TTime oldTime(oldDate);
 	r=TheFs.SetEntry(_L("OldFile.old"),oldTime,0,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.Replace(_L("NewFile.new"),_L("OldFile.old"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TTime check;
 	r=TheFs.Modified(_L("OldFile.old"),check);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TDateTime checkDateTime=check.DateTime();
 	
 	test(checkDateTime.Year()==dateTime.Year());
@@ -500,28 +492,28 @@
 	test.Next(_L("Replace 'Agenda' with 'Agenda.'"));
 	MakeFile(_L("Agenda"));
 	r=TheFs.Replace(_L("Agenda"),_L("Agenda."));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckFileExists(_L("Agenda"),KErrNone,ETrue);
 	CheckFileExists(_L("Agenda."),KErrNone,ETrue);
 	CheckFileExists(_L("AGENDA"),KErrNone,EFalse);
 	CheckFileExists(_L("AGENDA."),KErrNone,EFalse);
 
 	r=TheFs.Replace(_L("Agenda"),_L("Agenda."));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckFileExists(_L("Agenda"),KErrNone,ETrue);
 	CheckFileExists(_L("Agenda."),KErrNone,ETrue);
 	CheckFileExists(_L("AGENDA"),KErrNone,EFalse);
 	CheckFileExists(_L("AGENDA."),KErrNone,EFalse);
 
 	r=TheFs.Replace(_L("Agenda."),_L("AGENDA"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckFileExists(_L("Agenda"),KErrNone,ETrue);  // Replace does not rename existing file
 	CheckFileExists(_L("Agenda."),KErrNone,ETrue);
 	CheckFileExists(_L("AGENDA"),KErrNone,EFalse);
 	CheckFileExists(_L("AGENDA."),KErrNone,EFalse);
 
 	r=TheFs.Replace(_L("AGENDA."),_L("AGENDA.")); // Unchanged, ie still 'Agenda'
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckFileExists(_L("Agenda"),KErrNone,ETrue);
 	CheckFileExists(_L("Agenda."),KErrNone,ETrue);
 	CheckFileExists(_L("AGENDA"),KErrNone,EFalse);
@@ -537,16 +529,16 @@
 	test.Next(_L("Get directory entry"));
 	TEntry entry;
 	TInt r=TheFs.Entry(_L("\\BLEERRG\\"),entry);
-	test_Value(r, r == KErrNotFound); // BLEERRG does not exist
+	test(r==KErrNotFound); // BLEERRG does not exist
 	r=TheFs.Entry(_L("\\F32-TST"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("F32-TST")||entry.iName==_L("F32-TST."));
 	if (IsTestingLFFS())
 		{
 		r=TheFs.Rename(_L("\\F32-TST.\\"),_L("\\F32-TST\\"));
-		test_Value(r, r == KErrBadName);
+		test(r==KErrBadName);
 		r=TheFs.Entry(_L("\\F32-TST"),entry);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	test(entry.iName==_L("F32-TST"));
 	test(entry.IsDir());
@@ -554,18 +546,18 @@
 	test.Next(_L("Get file entry"));
 	RFile f;
 	r=f.Replace(TheFs,_L("ENTRY.TXT"),EFileStream);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f.Write(_L8("Entry data"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 	r=TheFs.Entry(_L("\\F32-TST\\TNMBS\\ENTRY.TXT"),entry);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(entry.iName==_L("ENTRY.TXT"));
 	test(!entry.IsDir());
 
 	test.Next(_L("Get the root directory"));
 	r=TheFs.Entry(_L("\\"),entry);
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	}
 
 LOCAL_C void testRenameRegression()
@@ -577,14 +569,14 @@
 	test.Next(_L("More rename tests"));
 	MakeFile(_L("\\F32-TST\\asdf"));
 	TInt r=TheFs.Rename(_L("\\F32-TST\\asdf"),_L("*"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.Rename(_L("\\F32-TST\\"),_L("*"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=TheFs.Rename(_L("\\F32-TST\\"),_L("\\F32-TST.\\"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	CheckFileExists(_L("\\F32-TST\\asdf"),KErrNone);
 	r=TheFs.Rename(_L("\\F32-TST\\asdf"),_L("\\F32-TST\\Asdf."));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckFileExists(_L("\\F32-TST\\asdf"),KErrNone,EFalse);
 	CheckFileExists(_L("\\F32-TST\\Asdf"),KErrNone,ETrue);
 
@@ -592,11 +584,11 @@
 	shortName.SetLength(1);
 	shortName[0]=0xff;
 	r=TheFs.Rename(_L("\\F32-TST\\asdf"),shortName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("\\F32-TST\\Asdf"));
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	r=TheFs.Delete(shortName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 LOCAL_C void testMaxNameLength()
@@ -615,7 +607,7 @@
 	longName.Append(_L("\\"));
 
 	TInt r=TheFs.MkDirAll(longName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TInt i=0;
 	FOREVER
@@ -630,16 +622,16 @@
 	
 	longName.SetLength(longName.Length()-2);
 	r=TheFs.RmDir(longName);
-	test_KErrNone(r); // Make room for file
+	test(r==KErrNone); // Make room for file
 	longName.SetLength(longName.Length()-2);
 
 	TFullName oldSessionPath;
 	r=TheFs.SessionPath(oldSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetSessionPath(longName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SessionPath(longName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Printf(_L("MaxPathLength achieved = %d chars\n"),longName.Length());
 	TBuf<32> fileName=_L("012345678901234567890");
@@ -655,18 +647,18 @@
 	f.Close();
 	test.Printf(_L("Added filename %S\n"),&fileName);
 	r=f.Open(TheFs,fileName,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	f.Close();
 
 	CFileMan* fMan=CFileMan::NewL(TheFs);
 	r=fMan->RmDir(_L("\\F32-TST\\MAXNAMELEN\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	delete fMan;
 
 	r=f.Open(TheFs,fileName,EFileRead);
-	test_Value(r, r == KErrPathNotFound);
+	test(r==KErrPathNotFound);
 	r=TheFs.SetSessionPath(oldSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 LOCAL_C void testErrorReturnValues()
@@ -681,43 +673,43 @@
     if (!IsTestingLFFS())
         { //FIXME: Bad error codes from LFFS
 	    r=TheFs.MkDir(_L("\\BLUE\\"));
-        test_Value(r, r == KErrAccessDenied);
+        test(r==KErrAccessDenied);
         MakeFile(_L("\\RED\\BLUE"));
         r=TheFs.MkDir(_L("\\RED\\BLUE\\"));
-        test_Value(r, r == KErrAccessDenied);
+        test(r==KErrAccessDenied);
         r=TheFs.MkDirAll(_L("\\BLUE\\GREEN\\ORANGE\\"));
-        test_Value(r, r == KErrAccessDenied);
+        test(r==KErrAccessDenied);
         }
 
 	test.Next(_L("Create folder with the name of an existing folder"));
 	MakeDir(_L("\\VOLVO\\"));
 	r=TheFs.MkDir(_L("\\VOLVO\\"));
-	test_Value(r, r == KErrAlreadyExists);
+	test(r==KErrAlreadyExists);
 	MakeDir(_L("\\FORD\\VOLKSWAGEN\\"));
 	r=TheFs.MkDirAll(_L("\\ford\\volkswagen\\"));
-	test_Value(r, r == KErrAlreadyExists);
+	test(r==KErrAlreadyExists);
 
 	RFile f;
     if (!IsTestingLFFS())
         { //FIXME Bad error codes from LFFS
 	    test.Next(_L("Create a file with the name of an existing folder"));
 	    r=f.Create(TheFs,_L("\\VOLVO"),EFileRead|EFileWrite);
-	    test_Value(r, r == KErrAccessDenied);
+	    test(r==KErrAccessDenied);
 	    r=f.Replace(TheFs,_L("\\VOLVO"),EFileRead|EFileWrite);
-	    test_Value(r, r == KErrAccessDenied);
+	    test(r==KErrAccessDenied);
 	    r=f.Open(TheFs,_L("\\VOLVO"),EFileRead|EFileWrite);
-	    test_Value(r, r == KErrAccessDenied);
+	    test(r==KErrAccessDenied);
 	    r=f.Create(TheFs,_L("\\FORD\\VOLKSWAGEN"),EFileRead|EFileWrite);
-	    test_Value(r, r == KErrAccessDenied);
+	    test(r==KErrAccessDenied);
 	    r=f.Replace(TheFs,_L("\\FORD\\VOLKSWAGEN"),EFileRead|EFileWrite);
-	    test_Value(r, r == KErrAccessDenied);
+	    test(r==KErrAccessDenied);
 	    r=f.Open(TheFs,_L("\\FORD\\VOLKSWAGEN"),EFileRead|EFileWrite);
-	    test_Value(r, r == KErrAccessDenied);
+	    test(r==KErrAccessDenied);
         }
 
 	test.Next(_L("Create a file with the name of an existing file"));
 	r=f.Create(TheFs,_L("\\BLUE"),EFileRead|EFileWrite);
-	test_Value(r, r == KErrAlreadyExists);
+	test(r==KErrAlreadyExists);
 	}
 
 LOCAL_C void testSetEntry()
@@ -734,124 +726,124 @@
 	
 	RFile f;
 	TInt r=f.Open(TheFs,_L("dumentry"),EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetEntry(_L("dumentry."),time,KEntryAttReadOnly,KEntryAttArchive);
-	test_Value(r, r == KErrInUse);
+	test(r==KErrInUse);
 	f.Close();
 	
 	r=TheFs.SetEntry(_L("dumentry."),time,KEntryAttReadOnly,KEntryAttArchive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),KEntryAttReadOnly,TTime(dateTime));
 	r=TheFs.SetEntry(_L("dumentry."),time,0,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));
 	r=TheFs.SetEntry(_L("dumentry."),time,KEntryAttDir,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));
 	r=TheFs.SetEntry(_L("dumentry."),time,KEntryAttVolume,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));
 	r=TheFs.SetEntry(_L("dumentry."),time,KEntryAttRemote,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));
 	r=TheFs.SetEntry(_L("dumentry."),time,KEntryAttDir|KEntryAttVolume,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));
 	r=TheFs.SetEntry(_L("dumentry."),time,KEntryAttDir|KEntryAttRemote,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));
 	r=TheFs.SetEntry(_L("dumentry."),time,KEntryAttVolume|KEntryAttRemote,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));
 	r=TheFs.SetEntry(_L("dumentry."),time,KEntryAttDir|KEntryAttVolume|KEntryAttRemote,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));
 	r=TheFs.SetEntry(_L("dumentry."),time,0,KEntryAttDir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));
 	r=TheFs.SetEntry(_L("dumentry."),time,0,KEntryAttVolume);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));
 	r=TheFs.SetEntry(_L("dumentry."),time,0,KEntryAttRemote);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));
 	r=TheFs.SetEntry(_L("dumentry."),time,0,KEntryAttDir|KEntryAttVolume);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));
 	r=TheFs.SetEntry(_L("dumentry."),time,0,KEntryAttDir|KEntryAttRemote);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));
 	r=TheFs.SetEntry(_L("dumentry."),time,0,KEntryAttVolume|KEntryAttRemote);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));
 	r=TheFs.SetEntry(_L("dumentry."),time,0,KEntryAttDir|KEntryAttVolume|KEntryAttRemote);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));
 	r=TheFs.SetEntry(_L("dumentry."),time,KEntryAttDir,KEntryAttVolume);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));
 	r=TheFs.SetEntry(_L("dumentry."),time,KEntryAttDir,KEntryAttRemote);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));	
 	r=TheFs.SetEntry(_L("dumentry."),time,KEntryAttVolume,KEntryAttDir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));
 	r=TheFs.SetEntry(_L("dumentry."),time,KEntryAttVolume,KEntryAttRemote);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));
 	r=TheFs.SetEntry(_L("dumentry."),time,KEntryAttRemote,KEntryAttDir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));
 	r=TheFs.SetEntry(_L("dumentry."),time,KEntryAttRemote,KEntryAttVolume);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));
 
 	r=f.Open(TheFs,_L("dumentry"),EFileWrite);
-	test_KErrNone(r);	
+	test(r==KErrNone);	
 
 	r=f.SetAtt(KEntryAttDir,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));
 	r=f.SetAtt(KEntryAttVolume,KEntryAttDir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("DUMEntry"),0,TTime(dateTime));
 	f.Close();
 	r=TheFs.Delete(_L("dumEntry."));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	MakeDir(_L("\\DumEntry\\"));
 	r=TheFs.SetEntry(_L("\\dumentry\\"),time,KEntryAttReadOnly,KEntryAttArchive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("\\DUMEntry"),KEntryAttReadOnly|KEntryAttDir,TTime(dateTime));
 	r=TheFs.SetEntry(_L("\\dumentry."),time,0,KEntryAttReadOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("\\DUMEntry"),KEntryAttDir,TTime(dateTime));
 	r=TheFs.SetEntry(_L("\\dumentry"),time,KEntryAttDir,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("\\DUMEntry"),KEntryAttDir,TTime(dateTime));
 	r=TheFs.SetEntry(_L("\\dumentry"),time,KEntryAttVolume,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("\\DUMEntry"),KEntryAttDir,TTime(dateTime));
 	r=TheFs.SetEntry(_L("\\dumentry"),time,KEntryAttVolume|KEntryAttDir,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("\\DUMEntry"),KEntryAttDir,TTime(dateTime));
 	r=TheFs.SetEntry(_L("\\dumentry"),time,0,KEntryAttVolume|KEntryAttDir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("\\DUMEntry"),KEntryAttDir,TTime(dateTime));
 	r=TheFs.SetEntry(_L("\\dumentry"),time,0,KEntryAttVolume);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("\\DUMEntry"),KEntryAttDir,TTime(dateTime));
 	r=TheFs.SetEntry(_L("\\dumentry"),time,0,KEntryAttDir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("\\DUMEntry"),KEntryAttDir,TTime(dateTime));
 	r=TheFs.SetEntry(_L("\\dumentry"),time,KEntryAttVolume,KEntryAttDir);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("\\DUMEntry"),KEntryAttDir,TTime(dateTime));
 	r=TheFs.SetEntry(_L("\\dumentry"),time,KEntryAttDir,KEntryAttVolume);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckEntry(_L("\\DUMEntry"),KEntryAttDir,TTime(dateTime));
 	r=TheFs.RmDir(_L("\\dumEntry\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 	
@@ -867,83 +859,83 @@
 //	Create a file "TEMPFILE.TMP" and set attributes to hidden	
 	RFile file;
 	TInt r=file.Replace(TheFs,_L("TEMPFILE.TMP"),0);
-	test_Value(r, r == KErrNone || r==KErrPathNotFound);	
+	test(r==KErrNone || r==KErrPathNotFound);	
 	r=file.SetAtt(KEntryAttHidden,0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 //	Check attributes are as set
 	file.Open(TheFs,_L("TEMPFILE.TMP"),EFileWrite);
 	TUint atts;
 	r=file.Att(atts);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	test(atts&KEntryAttHidden);
 
 //	Change attributes from hidden to system	
 	file.Open(TheFs,_L("TEMPFILE.TMP"),EFileWrite);
 	r=file.SetAtt(KEntryAttSystem,KEntryAttHidden);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 //	Check attributes have been changed
 	file.Open(TheFs,_L("TEMPFILE.TMP"),EFileWrite);
 	r=file.Att(atts);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
-	test_Value((TInt)atts, atts&KEntryAttSystem);
+	test(atts&KEntryAttSystem);
 
 //	Change attributes to normal
 	file.Open(TheFs,_L("TEMPFILE.TMP"),EFileWrite);
 	r=file.SetAtt(KEntryAttNormal,KEntryAttSystem|KEntryAttArchive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 //	Check attributes have been changed
 	file.Open(TheFs,_L("TEMPFILE.TMP"),EFileWrite);
 	r=file.Att(atts);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
-	test_Value((TInt)atts, atts==KEntryAttNormal);
+	test(atts==KEntryAttNormal);
 
 //	Attempt to change attributes from normal file to directory	
 	file.Open(TheFs,_L("TEMPFILE.TMP"),EFileWrite);
 	r=file.SetAtt(KEntryAttDir,KEntryAttNormal);
-	test_KErrNone(r);	//	Returns KErrNone but DOESN'T change the file to a directory
+	test(r==KErrNone);	//	Returns KErrNone but DOESN'T change the file to a directory
 	file.Close();
 
 //	Check the file has not been changed to a directory
 	file.Open(TheFs,_L("TEMPFILE.TMP"),EFileWrite);
 	r=file.Att(atts);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
-	test_Value((TInt)atts, (TInt)(atts&KEntryAttDir)==KErrNone);
+	test((TInt)(atts&KEntryAttDir)==KErrNone);
 
 //	Change the attributes from normal file to hidden file
 	file.Open(TheFs,_L("TEMPFILE.TMP"),EFileWrite);
 	r=file.SetAtt(KEntryAttHidden,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 //	Check the attributes have been changed
 	file.Open(TheFs,_L("TEMPFILE.TMP"),EFileWrite);
 	r=file.Att(atts);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
-	test_Value((TInt)atts, atts&KEntryAttHidden);
+	test(atts&KEntryAttHidden);
 
 //	Try to change the attributes from hidden file to volume	
 	file.Open(TheFs,_L("TEMPFILE.TMP"),EFileWrite);
 	r=file.SetAtt(KEntryAttVolume,KEntryAttHidden);
-	test_KErrNone(r);	//	Returns KErrNone but DOESN'T change the file to a volume
+	test(r==KErrNone);	//	Returns KErrNone but DOESN'T change the file to a volume
 	file.Close();
 
 //	Check that the hidden file has not been changed to a volume
 	file.Open(TheFs,_L("TEMPFILE.TMP"),EFileWrite);
 	r=file.Att(atts);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
-	test_Value((TInt)atts, (TInt)(atts&KEntryAttVolume)==KErrNone);
+	test((TInt)(atts&KEntryAttVolume)==KErrNone);
 
 //	Test RFile::Set() function	
 	
@@ -952,9 +944,9 @@
 //	Check attributes 
 	file.Open(TheFs,_L("TEMPFILE.TMP"),EFileWrite);
 	r=file.Att(atts);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
-	test_Value((TInt)atts, atts==KEntryAttNormal);
+	test(atts==KEntryAttNormal);
 
 //	Change attributes from hidden to system	- and change modification time
 	TDateTime dateTime(1998,EMay,25,18,23,0,0);
@@ -962,17 +954,17 @@
 	TTime retTime;
 	file.Open(TheFs,_L("TEMPFILE.TMP"),EFileWrite);
 	r=file.Set(modTime1,KEntryAttSystem,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 //	Check attributes have been changed
 	file.Open(TheFs,_L("TEMPFILE.TMP"),EFileWrite);
 	r=file.Att(atts);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Modified(retTime);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
-	test_Value((TInt)atts, atts&KEntryAttSystem);
+	test(atts&KEntryAttSystem);
 	test(retTime==modTime1);
 
 //	Change attributes to normal - and change modification time
@@ -980,64 +972,64 @@
 	TTime modTime2(dateTime);
 	file.Open(TheFs,_L("TEMPFILE.TMP"),EFileWrite);
 	r=file.Set(modTime2,KEntryAttNormal,KEntryAttSystem|KEntryAttArchive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 //	Check attributes have been changed
 	file.Open(TheFs,_L("TEMPFILE.TMP"),EFileWrite);
 	r=file.Att(atts);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Modified(retTime);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
-	test_Value((TInt)atts, atts==KEntryAttNormal);
+	test(atts==KEntryAttNormal);
 	test(retTime==modTime2);
 
 //	Attempt to change attributes from normal file to directory	
 	file.Open(TheFs,_L("TEMPFILE.TMP"),EFileWrite);
 	r=file.Set(modTime1,KEntryAttDir,KEntryAttNormal);
-	test_KErrNone(r);	//	Returns KErrNone but DOESN'T change the file to a directory
+	test(r==KErrNone);	//	Returns KErrNone but DOESN'T change the file to a directory
 	file.Close();
 
 //	Check the file has not been changed to a directory
 	file.Open(TheFs,_L("TEMPFILE.TMP"),EFileWrite);
 	r=file.Att(atts);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Modified(retTime);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
-	test_Value((TInt)atts, (TInt)(atts&KEntryAttDir)==KErrNone);
+	test((TInt)(atts&KEntryAttDir)==KErrNone);
 	test(retTime==modTime1);//	Modification time should have been set successfully
 
 //	Change the attributes from normal file to hidden file - and change modification time
 	file.Open(TheFs,_L("TEMPFILE.TMP"),EFileWrite);
 	r=file.Set(modTime1,KEntryAttHidden,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 //	Check the attributes have been changed
 	file.Open(TheFs,_L("TEMPFILE.TMP"),EFileWrite);
 	r=file.Att(atts);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Modified(retTime);
 	file.Close();
-	test_Value((TInt)atts, atts&KEntryAttHidden);
+	test(atts&KEntryAttHidden);
 	test(retTime==modTime1);
 
 //	Try to change the attributes from hidden file to volume	
 	file.Open(TheFs,_L("TEMPFILE.TMP"),EFileWrite);
 	r=file.Set(modTime2,KEntryAttVolume,KEntryAttHidden);
-	test_KErrNone(r);	//	Returns KErrNone but DOESN'T change the file to a volume
+	test(r==KErrNone);	//	Returns KErrNone but DOESN'T change the file to a volume
 	file.Close();
 
 //	Check that the hidden file has not been changed to a volume
 	file.Open(TheFs,_L("TEMPFILE.TMP"),EFileWrite);
 	r=file.Att(atts);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Modified(retTime);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
-	test_Value((TInt)atts, (TInt)(atts&KEntryAttVolume)==KErrNone);
+	test((TInt)(atts&KEntryAttVolume)==KErrNone);
 	test(retTime==modTime2);	//	Modification time should have been set successfully
 	
 	r=TheFs.Delete(_L("TEMPFILE.TMP"));
--- a/kerneltest/f32test/server/t_notifier.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_notifier.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32svr.h>
@@ -165,7 +164,7 @@
 	{
 	RFs fs;
 	TInt r = fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	CFsNotify* notify = NULL;
 	TRAP(r,notify= CFsNotify::NewL(fs,KMinNotificationBufferSize));
@@ -178,11 +177,11 @@
 	filename.Append(_L("media.change1"));
 	
 	r = notify->AddNotification((TUint)TFsNotification::ECreate,path,filename);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TRequestStatus status;
 	r = notify->RequestNotifications(status);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	test.Printf(_L("*****************************************************************\n"));
 	test.Printf(_L("Waiting 10 seconds.\n"));
@@ -192,7 +191,7 @@
 	test.Printf(_L("*****************************************************************\n"));
 	RTimer timer1;
 	r = timer1.CreateLocal();
-	test_KErrNone(r);
+	test(r == KErrNone);
 	TRequestStatus timeout;
 	TTimeIntervalMicroSeconds32 time = 10000000;
 	timer1.After(timeout,time);
@@ -210,9 +209,9 @@
 	drive.Append(_L(":"));
 	TPtrC drivePtr;
 	r = notification->Path(drivePtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = drivePtr.Compare(drive);
-	test_Value(r, r == 0);
+	test(r==0);
 	
 	test.Printf(_L("*****************************************************************\n"));
 	test.Printf(_L("Waiting 10 seconds.\n"));
@@ -227,7 +226,7 @@
 		notify->RequestNotifications(status);
 		RTimer timer2;
 		r = timer2.CreateLocal();
-		test_KErrNone(r);
+		test(r == KErrNone);
 		TRequestStatus timeout2;
 		timer2.After(timeout2,time);
 		User::WaitForRequest(timeout2,status);
@@ -250,7 +249,7 @@
 	{
 	RFs fs;
 	TInt r = fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	CFsNotify* notify1 = NULL;
 	CFsNotify* notify2 = NULL;
@@ -261,7 +260,7 @@
 		{
 		delete notify1;
 		delete notify2;
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 	
 	TBuf<40> path;
@@ -276,15 +275,15 @@
 	fullname.Append(filename);
 	
 	r = notify1->AddNotification((TUint)TFsNotification::ECreate,path,filename);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = notify2->AddNotification((TUint)TFsNotification::ECreate,path,filename);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	delete notify1; //Delete notify1 and ensure we still get notification on notify2
 	
 	TRequestStatus status;
 	r = notify2->RequestNotifications(status);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	RFile file;
 	file.Replace(fs,fullname,EFileWrite); //Replace produces Create notification
@@ -292,7 +291,7 @@
 	
 	RTimer tim;
 	r = tim.CreateLocal();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TRequestStatus timStatus;
 	TTimeIntervalMicroSeconds32 time = 10000000; //10 seconds
@@ -302,7 +301,7 @@
 	test(status!=KRequestPending);
 	
 	r = fs.Delete(fullname);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	delete notify2;
 	tim.Close();
@@ -325,7 +324,7 @@
 	CFsNotify* notify = NULL;
 	
 	TRAPD(r,notify = CFsNotify::NewL(fs,KMinNotificationBufferSize););
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(notify!=NULL);
 	
 	TBuf<40> path;
@@ -336,18 +335,18 @@
 	filename.Append(_L("*"));
 	
 	r = notify->AddNotification((TUint)TFsNotification::ECreate,path,filename);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TRequestStatus status;
 	r = notify->RequestNotifications(status);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	RFile file;
 	TBuf<40> filePath;
 	filePath.Append((TChar)gDriveToTest);
 	filePath.Append(_L(":\\file.root"));
 	r = file.Replace(fs,filePath,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	
 	TRequestStatus s2;
@@ -1327,7 +1326,7 @@
 		    
 		    CFileMan* cfman = NULL;
 		    TRAP(r, cfman = CFileMan::NewL(fs);)
-		    test_KErrNone(r);
+		    test(r == KErrNone);
             test(cfman != NULL);
             TBuf<40> unmonitored_path;
             unmonitored_path.Append(gDriveToTest);
@@ -1397,13 +1396,13 @@
 	TUidType uid;
 	TPtrC command((TText*)&gDriveToTest,1);
 	TInt r = process.Create(aProcessName,command,uid);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	process.Resume();
 	TRequestStatus s1;
 	TRequestStatus s2;
 	RTimer tim;
 	r = tim.CreateLocal();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TTimeIntervalMicroSeconds32 delay = 5000000; //5 seconds
 	tim.After(s1,delay);
 	process.Logon(s2);
@@ -1959,9 +1958,9 @@
 	RThread doer;
 	
 	TInt r = watcher.Create(_L("TestTwoNotificationsWatcherThread"),MultipleNotificationsTFWatcher,KDefaultStackSize,KMinHeapSize,KMaxHeapSize,&package);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = doer.Create(_L("TestTwoNotificationsDoerThread"),TwoNotificationsTFDoer,KDefaultStackSize,KMinHeapSize,KMaxHeapSize,&package);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Next(_L("TestTwoNotifications - Resume Watcher"));
 	watcher.Resume();
 	test.Next(_L("TestTwoNotifications - Wait for Watcher to be ready"));
@@ -2623,9 +2622,9 @@
 	RThread doer;
 
 	TInt r = watcher.Create(_L("TestCancelNotification-WatcherThread"),TestCancelNotificationWatcher,KDefaultStackSize*2,KMinHeapSize,KMaxHeapSize,&package);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	r = doer.Create(_L("TestCancelNotification-DoerThread"),SimpleSingleNotificationTFDoer,KDefaultStackSize*2,KMinHeapSize,KMaxHeapSize,&package);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test.Printf(_L("TestCancelNotificationL - Watcher.Resume()"));
 	watcher.Resume();
 	test.Printf(_L("TestCancelNotificationL - Waiting on package.iBarrier.Wait()"));
@@ -2646,7 +2645,7 @@
 	
 	RTimer tim;
 	r = tim.CreateLocal();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TRequestStatus timStatus;
 	TTimeIntervalMicroSeconds32 time = 10000000; //10 seconds
@@ -2730,7 +2729,7 @@
 			
 			RDebug::Printf("TestSessionCloseTF - Case 2 - Add Notification\n");
 			r = notify->AddNotification((TUint)TFsNotification::ECreate,path,filename);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			
 			RDebug::Printf("TestSessionCloseTF - Case 2 - Fs.Close\n");
 			fs.Close();
@@ -2780,7 +2779,7 @@
 	User::WaitForRequest(status);
 	test.Printf(_L("Kern-Exec 0 is EXPECTED\n"));
 	TInt err = thread.ExitReason();
-	test_KErrNone(err);
+	test(err == KErrNone);
 	TExitType et = thread.ExitType();
 	test(et == EExitPanic);
 	CLOSE_AND_WAIT(thread);
@@ -2860,7 +2859,7 @@
 	//Except the first one will still be in the buffer
 	// (as we've not called RequestNotification yet) so we'll only actually get 5.
 	TRAPD(r, notify = CFsNotify::NewL(fs,(80*7)-4));
-	test_KErrNone(r);
+	test(r == KErrNone);
 	User::LeaveIfNull(notify);
 	notify->AddNotification(TFsNotification::EFileChange,path,filename);
 	notify->RequestNotifications(status);
@@ -2942,7 +2941,7 @@
 	test.Next(_L("TestOverflow"));
 	RFs fs;
 	TInt r = fs.Connect();
-	test_KErrNone(r);
+	test(r == KErrNone);
 	_LIT(KFileName,"over.flow");
 	SThreadPackage doerPkg;
 	doerPkg.iFileName = KFileName;
@@ -2984,7 +2983,7 @@
 	
 	RTimer tim;
 	r = tim.CreateLocal();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TRequestStatus timStatus;
 	
 	test.Next(_L("TestOverflow - Wait for watcher1 thread death"));
@@ -3061,7 +3060,7 @@
     {
     TRequestStatus status;
     TInt r = aNotify->RequestNotifications(status);
-    test_KErrNone(r);
+    test(r == KErrNone);
     //Signal that overflow has been found (W4)
     aPackage.iBarrier.Signal();
     
@@ -3087,7 +3086,7 @@
         if(notification == NULL)
             {
             r = aNotify->RequestNotifications(status);
-            test_KErrNone(r);
+            test(r == KErrNone);
             User::WaitForRequest(status);
             notification = aNotify->NextNotification();
             }
@@ -3128,7 +3127,7 @@
     //Except the first one will still be in the buffer
     // (as we've not called RequestNotification yet) so we'll only actually get 5.
     TRAPD(r, notify = CFsNotify::NewL(fs,(80*7)-4));
-    test_KErrNone(r);
+    test(r == KErrNone);
     User::LeaveIfNull(notify);
     notify->AddNotification(TFsNotification::EFileChange,path,filename);
     notify->RequestNotifications(status);
@@ -3197,7 +3196,7 @@
     test.Next(_L("TestPostOverflowNotifications"));
     RFs fs;
     TInt r = fs.Connect();
-    test_KErrNone(r);
+    test(r == KErrNone);
     _LIT(KFileName,"post.over");
     SThreadPackage doerPkg;
     doerPkg.iFileName = KFileName;
@@ -3252,21 +3251,21 @@
     path.Append(watcher1Pkg.iFileName);
     RFile file;
     r = file.Open(fs,path,EFileWrite);
-    test_KErrNone(r);
+    test(r==KErrNone);
     
     r = file.SetSize(1);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r = file.SetSize(2);
-    test_KErrNone(r);
+    test(r==KErrNone);
     r = file.SetSize(3);
-    test_KErrNone(r);
+    test(r==KErrNone);
     file.Close();
     
     watcher1Pkg.iBarrier.Signal(); // Signal post operations complete (Sx)
     
     RTimer tim;
     r = tim.CreateLocal();
-    test_KErrNone(r);
+    test(r==KErrNone);
     TRequestStatus timStatus;
     
     test.Next(_L("TestOverflow - Wait for watcher1 thread death"));
@@ -3308,11 +3307,11 @@
 	test.Next(_L("TestNonDriveFilters"));
 	RFs fs;
 	TInt r = fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TDriveList drives;
 	r = fs.DriveList(drives);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	CFsNotify* notify = NULL;
 	TRAP(r,notify= CFsNotify::NewL(fs,KMinNotificationBufferSize));
@@ -3321,11 +3320,11 @@
 	testfile.Append(_L("test.file"));
 	
 	r = notify->AddNotification((TUint)TFsNotification::ECreate,_L(""),testfile);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TRequestStatus status;
 	r = notify->RequestNotifications(status);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TBuf<40> path;
 	path.Append((TChar)gDriveToTest);
@@ -3337,9 +3336,9 @@
 	
 	RFile file;
 	r = fs.MkDirAll(path);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	r = file.Replace(fs,fullname,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	
 	fs.Delete(fullname);
@@ -3363,14 +3362,14 @@
 		}
 	
 	r = fs.MkDirAll(fullname);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	r = file.Replace(fs,fullname,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	
 	RTimer timer1;
 	r = timer1.CreateLocal();
-	test_KErrNone(r);
+	test(r == KErrNone);
 	TRequestStatus timeout;
 	TTimeIntervalMicroSeconds32 time = 10000000;    //10 seconds
 	timer1.After(timeout,time);
@@ -3383,7 +3382,7 @@
 	test(notification != NULL);
 	TPtrC _path;
 	r = notification->Path(_path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TChar driveletter = _path[0];
 	driveletter.UpperCase();
 	test(driveletter ==  (TChar)gDriveToTest);
@@ -3392,11 +3391,11 @@
 		{
 		TRequestStatus status2;
 		r = notify->RequestNotifications(status2);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		
 		RTimer timer2;
 		r = timer2.CreateLocal();
-		test_KErrNone(r);
+		test(r == KErrNone);
 		TRequestStatus timeout2;
 		TTimeIntervalMicroSeconds32 time2 = 10000000;    //10 seconds
 		timer2.After(timeout2,time2);
@@ -3409,7 +3408,7 @@
 		}
 	test(notification != NULL);
 	r = notification->Path(_path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	driveletter = _path[0];
 	driveletter.UpperCase();
 	test(driveletter == (TChar)'C');	
@@ -3424,7 +3423,7 @@
 	{
 	RFs fs;
 	TInt r = fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	CFsNotify* notify = NULL;
 	TRAP(r,notify= CFsNotify::NewL(fs,KMinNotificationBufferSize));
@@ -3433,14 +3432,14 @@
 	path.Append((TChar)gDriveToTest);
 	path.Append(_L(":\\F32-TST\\T_NOTIFIER\\"));
 	r = fs.MkDirAll(path);
-	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+	test(r == KErrNone || r == KErrAlreadyExists);
 	
 	r = notify->AddNotification((TUint)TFsNotification::ECreate,path,_L(""));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TRequestStatus status;
 	r = notify->RequestNotifications(status);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TBuf<40> filename;
 	filename.Append((TChar)gDriveToTest);
@@ -3448,12 +3447,12 @@
 	
 	RFile file;
 	r = file.Replace(fs,filename,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	
 	RTimer timer1;
 	r = timer1.CreateLocal();
-	test_KErrNone(r);
+	test(r == KErrNone);
 	TRequestStatus timeout;
 	TTimeIntervalMicroSeconds32 time = 2000000;    //2 seconds
 	timer1.After(timeout,time);
@@ -3480,7 +3479,7 @@
 	RFs fs;
 	CFsNotify* notify = NULL;
 	TInt r = fs.Connect();
-	test_KErrNone(r);
+	test(r == KErrNone);
 	TRAP(r,notify = CFsNotify::NewL(fs,0));
 	test(notify != NULL);
 	delete notify;
@@ -3495,7 +3494,7 @@
 
 	test.Printf(_L("NegativeTests() C\n"));
 	TRAP(r,notify = CFsNotify::NewL(fs,KMaxTInt));
-	test_Value(r, r == KErrArgument);
+	test(r==KErrArgument);
 	test(notify==NULL);
 	
 	//3
@@ -3506,34 +3505,34 @@
 	TBuf<20> filename;
 	filename.Append(_L("file.txt"));
 	TRAP(r,notify = CFsNotify::NewL(fs,KMinNotificationBufferSize));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(notify!=NULL);
 	r = notify->AddNotification(0,path,filename);
-	test_Value(r, r == KErrArgument);
+	test(r == KErrArgument);
 	
 	test.Printf(_L("NegativeTests() E\n"));
 	r = notify->AddNotification((TUint)0x8000,path,filename); //invalid value
-	test_Value(r, r == KErrArgument);
+	test(r == KErrArgument);
 	
 	test.Printf(_L("NegativeTests() F\n"));
 	TBuf<40> invalidPath;
 	invalidPath.Append(_L("1:\\*"));
 	r = notify->AddNotification((TUint)TFsNotification::ECreate,invalidPath,filename);
-	test_Value(r, r == KErrNotFound || r == KErrPathNotFound);
+	test(r == KErrNotFound || r == KErrPathNotFound);
 	
 	//4
 	test.Printf(_L("NegativeTests() G\n"));
 	TRequestStatus wrongStatus;
 	wrongStatus = KRequestPending;
 	r = notify->RequestNotifications(wrongStatus);
-	test_Value(r, r == KErrInUse);
+	test(r == KErrInUse);
 	
 	test.Printf(_L("NegativeTests() H\n"));
 	TRequestStatus status;
 	r = notify->RequestNotifications(status);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = notify->CancelNotifications(wrongStatus);
-	test_Value(r, r == KErrInUse);
+	test(r == KErrInUse);
 	
 	delete notify;
 	notify = NULL;
@@ -3594,7 +3593,7 @@
 TInt TestNotificationsWithFServPlugins()
 	{
 	TInt r = TheFs.AddPlugin(KNotifyPluginFileName);
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	r = TheFs.MountPlugin(KNotifyPluginName,(TUint)gDriveToTest.GetUpperCase() - 65);
 	if (r == KErrNotSupported)
 		{
@@ -3654,12 +3653,12 @@
 	__UHEAP_MARK;
 	r = TestNewDeleteCFsNotify(1);
 	__UHEAP_MARKEND;
-	test_KErrNone(r);	
+	test(r==KErrNone);	
 	//Creates and Deletes 50 CFsNotifys
 	__UHEAP_MARK;
 	r = TestNewDeleteCFsNotify(50);
 	__UHEAP_MARKEND;
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("------- End of User Heap Tests ---------------------------------------\n"));
 	//
 	// 2.	Add notification for creating a file
@@ -3669,7 +3668,7 @@
 	__UHEAP_MARK;
 	r = SimpleCreateTestL();
 	__UHEAP_MARKEND;
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("------- End of CFsNotify Creation and Delete Tests -------------------\n"));
 	//
 	// 3.	Add notification at the root of a drive
@@ -3695,7 +3694,7 @@
 	__UHEAP_MARK;
 	r = TestTwoDoersL();
 	__UHEAP_MARKEND;
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("------- End of TwoDoers Test -----------------------------------------\n"));
 	//
 	// 6.	Create 2 file server sessions
@@ -3706,7 +3705,7 @@
 	__UHEAP_MARK;
 	r = TestTwoWatchersL();
 	__UHEAP_MARKEND;
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("------- End of TwoWatchers Test --------------------------------------\n"));
 	//
 	// 7.	Create 2 file server sessions and 2 clients
@@ -3717,7 +3716,7 @@
 	__UHEAP_MARK;
 	r = TestTwoWatchersTwoDoersL();
 	__UHEAP_MARKEND;
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("------- End of TwoWatchersTwoDoers Test ------------------------------\n"));
 	//
 	// 8.	Add notification for a specific file creation
@@ -3728,7 +3727,7 @@
 	__UHEAP_MARK;
 	r =  TestCancelNotificationL();
 	__UHEAP_MARKEND;
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("------- End of CancelNotification Test -------------------------------\n"));
 	//
 	// 9.	Create 2 file server sessions
@@ -3741,7 +3740,7 @@
 	__UHEAP_MARK;
 	r = TestClientRemovalL();
 	__UHEAP_MARKEND;
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("------- End of TestClientRemoval Test --------------------------------\n"));
 	//
 	// 10.	Create a CFsNotify object
@@ -3778,7 +3777,7 @@
 	test.Next(_L("EFileCreate Tests"));
 	_LIT(KFilename3,"file.create");
 	r = TestMultipleNotificationsL(_L(""),KFilename3,5,5,t_notification::EFileCreate,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("------- End of EFileCreate Tests -------------------------------------\n"));
 	//
 	// RFs::MkDir
@@ -3789,7 +3788,7 @@
 	test.Next(_L("EFsMkDir Test"));
 	_LIT(KDirName1,"dirCreate\\");
 	r = TestMultipleNotificationsL(KDirName1,_L(""),1,1,t_notification::EFsMkDir,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("------- End of EFsMkDir Test -----------------------------------------\n"));
 	//
 	// RFile::Replace
@@ -3799,7 +3798,7 @@
 	PrintLine();
 	test.Next(_L("EFileReplace Test"));
 	r = TestMultipleNotificationsL(_L(""),KFilename3,1,1,t_notification::EFileReplace,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("------- End of EFileReplace Test -------------------------------------\n"));
 	//
 	// 4.  Add notification for a specific file creation
@@ -3810,7 +3809,7 @@
 	__UHEAP_MARK;
 	r =  TestAddRemoveNotificationL();
 	__UHEAP_MARKEND;
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("------- End of Add and Remove Notification Test ----------------------\n"));
 	//
 	// Wildcard Create Tests
@@ -3824,29 +3823,29 @@
 	// Wildcard Name
 	_LIT(KWildcardName1,"*");
 	r = TestMultipleNotificationsL(_L(""),KWildcardName1,1,1,t_notification::EFileCreate,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = TestMultipleNotificationsL(KWildcardName1,KWildcardName1,1,1,t_notification::EFileCreate_subs,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = TestMultipleNotificationsL(KWildcardName1,KWildcardName1,1,1,t_notification::EFileCreate_subs_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)ETrue,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	//
 	// Wildcard including Subdirectories
 	_LIT(KWildcardName2,"*\\");
 	r = TestMultipleNotificationsL(KWildcardName2,KWildcardName1,1,1,t_notification::EFileCreate,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)ETrue,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = TestMultipleNotificationsL(KWildcardName2,KWildcardName1,1,1,t_notification::EFileCreate_subs_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	_LIT(KDirName2,"SubDir\\");
 	_LIT(KWildcardName3,"?");
 	r = TestMultipleNotificationsL(KDirName2,KWildcardName3,1,1,t_notification::EFileCreate_subs_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	//
 	// Wildcard Type
 	_LIT(KWildcardName4,"*.*");
 	r = TestMultipleNotificationsL(_L(""),KWildcardName4,1,1,t_notification::EFileCreate_txt_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = TestMultipleNotificationsL(_L(""),KWildcardName4,1,1,t_notification::EFileCreate_subs_nowatch,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)ETrue,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	//
 	// 6.  Add notification for file creation for a specific type
 	//     Create file with that type
@@ -3854,7 +3853,7 @@
 	//
 	_LIT(KWildcardName5,"*.txt");
 	r = TestMultipleNotificationsL(_L(""),KWildcardName5,1,1,t_notification::EFileCreate_txt,TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("------- End of Wildcard Create Tests ---------------------------------\n"));
 	
 	
@@ -3876,11 +3875,11 @@
 	test.Next(_L("Attribute Tests"));
 	_LIT(KFilename4,"file.setatts");
 	r = TestMultipleNotificationsL(_L(""),KFilename4,1,1,t_notification::EFileSetAtt,TFsNotification::EAttribute,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = TestMultipleNotificationsL(_L(""),KFilename4,1,1,t_notification::EFileSet,TFsNotification::EAttribute,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = TestMultipleNotificationsL(_L(""),KFilename4,1,1,t_notification::EFsSetEntry,TFsNotification::EAttribute,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	//
 	// Wildcard Attribute Test including subdirectories
 	// 2.  Add notification for file attribute change using wildcard name
@@ -3888,7 +3887,7 @@
 	//     Change attributes of some files
 	//
 	r = TestMultipleNotificationsL(KWildcardName2,_L("*"),3,3,t_notification::EFileSetAtt_subs,TFsNotification::EAttribute,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("------- End of Attribute Tests ---------------------------------------\n"));
 	
 	
@@ -3910,25 +3909,25 @@
 	test.Next(_L("Rename Tests"));
 	_LIT(KFilename5,"file.rename");
 	r = TestMultipleNotificationsL(_L(""),KFilename5,1,1,t_notification::EFsReplace,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = TestMultipleNotificationsL(_L(""),KFilename5,1,1,t_notification::EFsRename,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = TestMultipleNotificationsL(_L(""),KFilename5,1,1,t_notification::EFileRename,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	//
 	// 2.  Add notification for a specific directory rename
 	//     Rename that directory
 	//
 	_LIT(KDirName3,"dirRename\\");
 	r = TestMultipleNotificationsL(KDirName3,_L(""),1,1,t_notification::EFsRename_dir,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	//
 	// 3.  Add notification for file rename using wildcard name
 	//     Create file that match the notification
 	//     Repeatedly rename the file
 	//
 	r = TestMultipleNotificationsL(_L(""),KWildcardName1,3,3,t_notification::EFileRename_wild,TFsNotification::ERename,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("------- End of Rename Tests ------------------------------------------\n"));
 	
 	
@@ -3950,7 +3949,7 @@
 	test.Next(_L("EFsDelete Test"));
 	_LIT(KFilename6,"file.delete");
 	r = TestMultipleNotificationsL(_L(""),KFilename6,1,1,t_notification::EFsDelete,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);	
+	test(r==KErrNone);	
 	//
 	// RFs::RmDir
 	// 2.  Add notification for a specific directory delete
@@ -3960,7 +3959,7 @@
 	test.Next(_L("EFsRmDir Tests"));
 	_LIT(KDirName4,"dirRemove\\");
 	r = TestMultipleNotificationsL(KDirName4,_L(""),1,1,t_notification::EFsRmDir,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
     //
     // This test should not receive any notifications because a non-empty directory cannot be removed
     // 3.  Add notification for specific directory delete
@@ -3969,7 +3968,7 @@
     //
     _LIT(KDirName5,"dirRmNonEmp\\");
     r = TestMultipleNotificationsL(KDirName5,_L(""),1,1,t_notification::EFsRmDir_nonEmpty,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)ETrue,__LINE__);
-    test_KErrNone(r);	
+    test(r==KErrNone);	
     //
     // Wildcard Name ("*")
     // 4.  Add notification for directory delete using wildcard name
@@ -3977,7 +3976,7 @@
 	//	   Delete that directory
     //
     r = TestMultipleNotificationsL(KWildcardName1,_L(""),1,1,t_notification::EFsRmDir_wild,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-    test_KErrNone(r);	
+    test(r==KErrNone);	
     //
     // Wildcard Type ("*.txt")
     // Creates files with different types and should only receive notifications from "*.txt" file deletions
@@ -3986,7 +3985,7 @@
     //     Delete those files
     //
     r = TestMultipleNotificationsL(_L(""),KWildcardName4,3,3,t_notification::EFsDelete,TFsNotification::EDelete,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-    test_KErrNone(r);
+    test(r==KErrNone);
     test.Printf(_L("------- End of Delete Tests ------------------------------------------\n"));
 	
 	
@@ -4014,7 +4013,7 @@
 	__UHEAP_MARK;
 	r = TestMultipleNotificationsL(_L(""),KFilename7,7,7,t_notification::EFileWrite,TFsNotification::EFileChange,3*KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
 	__UHEAP_MARKEND;
-	test_KErrNone(r);
+	test(r==KErrNone);
 	//
 	// 2.  Add notification for a specific file change
 	//     Write to the specified file a number of times without changing its size
@@ -4023,7 +4022,7 @@
 	//     aMaxNotifications = 1 + aIterations
 	//
 	r = TestMultipleNotificationsL(_L(""),KFilename7,3,4,t_notification::EFileWrite_samesize,TFsNotification::EFileChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("------- End of EFileWrite Tests --------------------------------------\n"));
 	//
 	// 3.  Add notification for a specific file change
@@ -4035,7 +4034,7 @@
 	__UHEAP_MARK;
 	r = TestMultipleNotificationsL(_L(""),KFilename8,4,4,t_notification::EFileWrite_async,TFsNotification::EFileChange,2*KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
 	__UHEAP_MARKEND;
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("------- End of EFileWrite_async Tests --------------------------------\n"));	
 	//
 	// File Set Size
@@ -4049,7 +4048,7 @@
 	test.Next(_L("EFileSetSize Tests"));
 	_LIT(KFilename9,"file.setsize");
 	r = TestMultipleNotificationsL(_L(""),KFilename9,5,9,t_notification::EFileSetSize,TFsNotification::EFileChange,3*KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("------- End of EFileSetSize Tests ------------------------------------\n"));
 
 
@@ -4059,7 +4058,7 @@
 	_LIT(KFilenameCFMan,"cf1le.man");
 	TUint notificationTypes = (TUint)TFsNotification::ECreate|TFsNotification::EFileChange|TFsNotification::EAttribute|TFsNotification::EDelete|TFsNotification::ERename;
 	r = TestMultipleNotificationsL(_L(""),KFilenameCFMan,1,5,t_notification::ECFileManMove,notificationTypes,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("------- End of CFileMan Tests -------------------------------------\n"));
 	
 	
@@ -4082,16 +4081,16 @@
 	test.Next(_L("Mount Tests"));
 	TFullName filesystemName;
 	r = TheFs.FileSystemName(filesystemName,globalDriveNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r = TestMultipleNotificationsL(filesystemName,1,1,t_notification::EDismount,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	//
 	// RFs::MountFileSystem
 	// 2.  Add notification for media change
 	//     Mount the file system
 	//
 	r = TestMultipleNotificationsL(filesystemName,1,1,t_notification::EMount,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	//
 	// Repeatedly mount and dismount the file system
 	// 3.  Add notification for media change
@@ -4101,7 +4100,7 @@
 	//     aMaxNotifications = 2*aIterations
 	//
 	r = TestMultipleNotificationsL(filesystemName,5,10,t_notification::EMountDismount,TFsNotification::EMediaChange,3*KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	//
 	// RFs::MountFileSystemAndScan
 	// 4.  Add notification for media change
@@ -4112,14 +4111,14 @@
 	//
 //#ifndef __WINS__
 //    r = TestMultipleNotificationsL(filesystemName,1,2,t_notification::EMountScan,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-//    test_KErrNone(r);
+//    test(r==KErrNone);
 //#endif
 	test.Printf(_L("------- End of Mount Tests -------------------------------------------\n"));
 	TDriveInfo drvInfo;
 	TInt driveNum;
 	TheFs.CharToDrive(gDriveToTest,driveNum);
 	r = TheFs.Drive(drvInfo,driveNum);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	TPtrC driveDes((TText*)&gDriveToTest,1);
 	//
 	// Manual Tests - Will only run on removable drives
@@ -4133,13 +4132,13 @@
 		PrintLine();
 		test.Next(_L("Media Card Removal/Insertion Tests"));
 		r = TestMultipleNotificationsL(driveDes,1,1,t_notification::EMediaCardRemoval,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		//
 		// 6. Add notification for media change
 		//    Insert media card manually
 		//
 		r = TestMultipleNotificationsL(driveDes,1,1,t_notification::EMediaCardInsertion,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test.Printf(_L("------- End of Media Card Removal/Insertion Tests --------------------\n"));
 		//
 		// We should receive an EMediaChange notification even though we did not register for it
@@ -4162,7 +4161,7 @@
         PrintLine();
         test.Next(_L("RRawDisk::Write Tests"));
         r = TestMultipleNotificationsL(driveDes,1,1,t_notification::ERawDiskWrite,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-        test_KErrNone(r);
+        test(r==KErrNone);
         test.Printf(_L("------- End of RRawDisk::Write Test ------------------------------  \n"));
         }	
 	
@@ -4187,13 +4186,13 @@
 	PrintLine();
 	test.Next(_L("DriveName Test"));
 	r = TestMultipleNotificationsL(driveDes,1,2,t_notification::ESetDriveName,TFsNotification::EDriveName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	//
 	// 2.  Add notification for a specific drive name change
 	//     Repeatedly rename the drive
 	//
 	r = TestMultipleNotificationsL(driveDes,3,6,t_notification::ESetDriveName,TFsNotification::EDriveName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("------- End of DriveName Test ----------------------------------------\n"));
 	
 	
@@ -4219,13 +4218,13 @@
 	//     Change the volume name
 	//
 	r = TestMultipleNotificationsL(driveDes,1,2,t_notification::ESetVolumeLabel,TFsNotification::EVolumeName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	//
 	// 2.  Add notification for a specific volume name change
 	//     Repeatedly rename the volume
 	//
 	r = TestMultipleNotificationsL(driveDes,3,6,t_notification::ESetVolumeLabel,TFsNotification::EVolumeName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("------- End of VolumeName Test ---------------------------------------\n"));
 #endif
 		
@@ -4251,7 +4250,7 @@
 	//
 	_LIT(KFilename10,"file.allops");
 	r = TestMultipleNotificationsL(_L(""),KFilename10,4,8,t_notification::EAllOps1,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	//
 	// 2.	Add notification for all operations
 	//		Create a file
@@ -4262,7 +4261,7 @@
 	// 		aMaxNotification = 2 + aIterations (See File Write Tests)
 	//
 	r = TestMultipleNotificationsL(_L(""),KFilename10,4,6,t_notification::EAllOps2,(TUint)TFsNotification::EAllOps,2*KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	//
 	// 3.	Add notification for all operations
 	//		Create a file
@@ -4274,7 +4273,7 @@
 	//     aMaxNotifications = 1 + 2*aIterations
 	//
 	r = TestMultipleNotificationsL(_L(""),KFilename10,4,9,t_notification::EAllOps3,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize*2,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	//
 	// 4.	Add notification for all operations
 	//		Create a file
@@ -4285,7 +4284,7 @@
 	// 		aMaxNotification = 3
 	//
 	r = TestMultipleNotificationsL(_L(""),KFilename10,1,3,t_notification::EAllOps4,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	//
 	// 5.	Add notification for all operations
 	//		Create a file
@@ -4295,7 +4294,7 @@
 	// 		aMaxNotification = 2
 	//
 	r = TestMultipleNotificationsL(_L(""),KFilename10,1,2,t_notification::EAllOps5,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	//
 	// 6.	Add notification for all operations
 	//		Change drive name
@@ -4307,7 +4306,7 @@
 	//
 #ifndef __WINS__
 	r = TestMultipleNotificationsL(driveDes,1,2,t_notification::EAllOps6,(TUint)TFsNotification::EAllOps,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 #endif
 	test.Printf(_L("------- End of AllOps Tests ------------------------------------------\n"));
 	
@@ -4332,7 +4331,7 @@
 	//
 	_LIT(KFilename11,"file.mulfil");
 	r = TestMultipleNotificationsL(_L(""),KFilename11,3,6,t_notification::EAllOps1,TFsNotification::ECreate | TFsNotification::EDelete,2*KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	//
 	// TFsNotification::EDelete | TFsNotification::ECreate | TFsNotification::EFileChange
 	// 2.	Add notification for create, file change and delete for a specific file
@@ -4345,7 +4344,7 @@
 	//     aMaxNotifications = 1 + 2*aIterations
 	//
 	r = TestMultipleNotificationsL(_L(""),KFilename11,4,9,t_notification::EAllOps3,TFsNotification::EDelete | TFsNotification::ECreate | TFsNotification::EFileChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	//
 	// TFsNotification::EAttribute | TFsNotification::EDelete | TFsNotification::ECreate
 	// 3.	Add notification for create, attribute change and delete for a specific file
@@ -4357,7 +4356,7 @@
 	// 		aMaxNotification = 3
 	//
 	r = TestMultipleNotificationsL(_L(""),KFilename11,1,3,t_notification::EAllOps4,TFsNotification::EAttribute | TFsNotification::EDelete | TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	//
 	// TFsNotification::ERename | TFsNotification::ECreate
 	// 4.	Add notification for create and rename for a specific file
@@ -4368,7 +4367,7 @@
 	// 		aMaxNotification = 2
 	//
 	r = TestMultipleNotificationsL(_L(""),KFilename11,1,2,t_notification::EAllOps5,TFsNotification::ERename | TFsNotification::ECreate,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	//
 	// TFsNotification::EVolumeName | TFsNotification::EDriveName
 	// 5.	Add notification for drive and volume name change for a specific drive
@@ -4381,7 +4380,7 @@
 	//
 #ifndef __WINS__
 	r = TestMultipleNotificationsL(driveDes,1,2,t_notification::EAllOps6,TFsNotification::EVolumeName | TFsNotification::EDriveName,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-	test_KErrNone(r);
+	test(r==KErrNone);
 #endif
 	test.Printf(_L("------- End of Multiple-Filter Tests ---------------------------------\n"));
 	
@@ -4401,12 +4400,12 @@
 	//
 	PrintLine();
 	r = TestOverflowL();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	//For DEF140387
 	PrintLine();
 	r= TestPostOverflowNotifications();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("------- End of Overflow Test -----------------------------------------\n"));
 	
 	
@@ -4455,7 +4454,7 @@
 	//=============================================================================
 	PrintLine();
 	r = TestNotificationsWithFServPlugins();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.Printf(_L("------- End of Plugin Tests ------------------------------------------\n"));
 		
 	
@@ -4482,7 +4481,7 @@
 		PrintLine();
 		test.Next(_L("Format Tests"));
 		r = TestMultipleNotificationsL(driveDes,1,1,t_notification::EFormat,TFsNotification::EMediaChange,KMinNotificationBufferSize,(TBool)EFalse,__LINE__);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test.Printf(_L("------- End of Format Tests ------------------------------------------\n"));
 		}
 	
@@ -4504,15 +4503,15 @@
 	PrintLine();
 	test.Next(_L("Test T_NOTIFIER_NOCAPS.EXE"));
 	r = TestProcessCapabilities(_L("T_NOTIFIER_NOCAPS.EXE"));
-	test_Value(r, r == KErrPermissionDenied); //Failure on emulator -> Did you forget to do a wintest?
+	test(r == KErrPermissionDenied); //Failure on emulator -> Did you forget to do a wintest?
 	
 	test.Next(_L("Test T_NOTIFIER_ALLFILES.EXE"));
 	r = TestProcessCapabilities(_L("T_NOTIFIER_ALLFILES.EXE"));
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	test.Next(_L("Test T_NOTIFIER_BELONGS.EXE"));
 	r = TestProcessCapabilities(_L("T_NOTIFIER_BELONGS.EXE"));
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test.Printf(_L("------- End of Data-Caging Tests -------------------------------------\n"));
 	
 	
--- a/kerneltest/f32test/server/t_notify.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_notify.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,15 +15,11 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32svr.h>
 #include <hal.h>
 #include "t_server.h"
-#include "f32_test_utils.h"
-
-using namespace F32_Test_Utils;
 
 const TInt KHeapSize=0x200;
 
@@ -113,9 +109,9 @@
 	{
 	RFs fs;
 	TInt r=fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TTestCode testCode=*(TTestCode*)&aTestCode;
 	RFile f;
 	switch (testCode)
@@ -123,26 +119,26 @@
 
 	case ETest1:
 		r=f.Replace(fs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileStream);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		f.Close();
 		break;
 
 	case ETest2:
 		r=f.Replace(fs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileStream);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		f.Close();
 		break;
 
 	case ETest3:
 		r=fs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\SCARECROW\\"));
-		test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+		test((r==KErrNone)||(r==KErrAlreadyExists));
 		break;
 
 	case ETest4:
 		{
 		TRequestStatus s;
 		fs.NotifyChange(ENotifyAll,s);
-		test_Value(s.Int(), s==KRequestPending);
+		test(s==KRequestPending);
 		gSleepThread.Signal();
 		User::After(100000000);
 		}
@@ -152,34 +148,34 @@
 		{
 		RFile file;
 		TInt r=file.Open(fs,_L("\\F32-TST\\NOTIFY\\kangaroo.txt"),EFileRead|EFileWrite);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file.SetSize(sizeof(TCheckedUid));
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file.Write(sizeof(TCheckedUid),_L8("012345678912"));
-		test_KErrNone(r);
+		test(r==KErrNone);
 		TBuf8<64> dum;
 		r=file.Read(0,dum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		file.Close();
 
 		r=file.Open(fs,_L("\\F32-TST\\NOTIFY\\koala.txt"),EFileRead|EFileWrite);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file.SetSize(50);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file.Write(sizeof(TCheckedUid),_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file.Read(0,dum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		file.Close();
 
 		r=file.Open(fs,_L("\\F32-TST\\NOTIFY\\dingo.txt"),EFileRead|EFileWrite);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file.SetSize(50);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file.Write(sizeof(TCheckedUid),_L8("01234567890123456789"));
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file.Read(0,dum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		file.Close();
 		gSleepThread.Signal();
 		}
@@ -197,9 +193,9 @@
 		{
 		RFile file;
 		TInt r=file.Open(fs,_L("\\F32-TST\\NOTIFY\\NewFILE.TXT"),EFileRead|EFileWrite);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=file.Write(_L8("asdfasdfasdf"));
-		test_KErrNone(r);
+		test(r==KErrNone);
 		file.Close();
 		gSleepThread.Signal();
 		}
@@ -208,7 +204,7 @@
 	case ETest8:
 		{
 		r=f.Open(fs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\WickedWitch.msg"),EFileRead|EFileWrite);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		f.SetSize(500);
 		f.Close();
 		break;
@@ -219,7 +215,7 @@
 		TRequestStatus s;
 		TFileName path=_L("\\F32-TST\\NOTIFY\\");
 		fs.NotifyChange(ENotifyAll,s,path);
-		test_Value(s.Int(), s==KRequestPending);
+		test(s==KRequestPending);
 		gSleepThread.Signal();
 		User::After(100000000);
 		}
@@ -228,7 +224,7 @@
 		{
 		TFileName path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\");
 		r=fs.MkDir(path);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		break;
 		}
 	case ETest11:
@@ -236,7 +232,7 @@
 		TFileName path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\PayNoAttention.man");
 		RFile file;
 		r=file.Replace(fs,path,EFileStream);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		file.Close();
 		break;
 		}
@@ -244,12 +240,12 @@
 		{
 		RFile writer;
 		TInt r=writer.Open(fs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileWrite|EFileShareAny);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		TInt i;
 		for(i=0; i<10; i++)
 			{
 			r=writer.Write(_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
-			test_KErrNone(r);
+			test(r==KErrNone);
 			User::After(1000000);
 			}
 		writer.Close();
@@ -292,58 +288,58 @@
 	TheFs.NotifyChange(ENotifyEntry,reqStat);
 	RThread thread;
 	r=thread.Create(_L("MyThread"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread.Logon(thrdStat);
 	thread.Resume();
 	User::WaitForRequest(thrdStat);
-	test_KErrNone(thrdStat.Int());
+	test(thrdStat==KErrNone);
 	thread.Close();
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 	RFile file;
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileWrite|EFileShareExclusive);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Write(_L8("Somewhere over the rainbow..."),reqStat);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	TBuf8<256> buf;
 	file.Read(0, buf,reqStat);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	file.Close();
 
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareExclusive);
-	test_Value(r, r == KErrArgument);
+	test(r==KErrArgument);
 
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareReadersOnly);
-	test_Value(r, r == KErrArgument);
+	test(r==KErrArgument);
 
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Read(0, buf, 100, reqStat);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	file.Close();
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Read(0, buf, 100, reqStat);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	file.ReadCancel(reqStat);
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 	file.Close();
 
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileWrite|EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Read(0, buf, 100, reqStat);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	file.SetSize(100);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
-	test_Equal(100, buf.Length());
+	test(reqStat==KErrNone);
+	test(buf.Length() == 100);
 	file.Close();
 
 	test.Next(_L("Repeat Test notification of an entry change"));
@@ -352,10 +348,15 @@
 	thread.Logon(thrdStat);
 	thread.Resume();
 	User::WaitForRequest(thrdStat);
-	test_KErrNone(thrdStat.Int());
+	test(thrdStat==KErrNone);
 	thread.Close();
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	if (reqStat!=KErrNone)
+		{
+		test.Printf(_L("ReqStat=%d\n"),reqStat.Int());
+		//test.Getch();
+		}
+	test(reqStat==KErrNone);
 
 	test.Next(_L("Test Notify cancel"));
 	TheFs.NotifyChange(ENotifyEntry,reqStat);
@@ -368,10 +369,10 @@
 	thread.Logon(thrdStat);
 	thread.Resume();
 	User::WaitForRequest(thrdStat);
-	test_KErrNone(thrdStat.Int());
+	test(thrdStat==KErrNone);
 	thread.Close();
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	}
 
 static void Test2()
@@ -385,23 +386,23 @@
 	TRequestStatus reqStat1(KRequestPending);
 	RFs fs1;
 	TInt r=fs1.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fs1.NotifyChange(ENotifyEntry,reqStat1);
 
 	TRequestStatus reqStat2(KRequestPending);
 	RFs fs2;
 	r=fs2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fs2.NotifyChange(ENotifyEntry,reqStat2);
 
-	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
+	test(reqStat1==KRequestPending);
+	test(reqStat2==KRequestPending);
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\NEWFILE.TXT"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat1);
 	User::WaitForRequest(reqStat2);
-	test_KErrNone(reqStat1.Int());
-	test_KErrNone(reqStat2.Int());
+	test(reqStat1==KErrNone);
+	test(reqStat2==KErrNone);
 	}
 
 static void Test3()
@@ -413,7 +414,7 @@
 	test.Next(_L("Cancel notification"));
 	RFs fs1;
 	TInt r=fs1.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TRequestStatus status1;
 	TRequestStatus status2;
@@ -426,25 +427,25 @@
 	fs1.NotifyChange(ENotifyAll,status3);
 	fs1.NotifyChange(ENotifyAll,status4);
 	fs1.NotifyChange(ENotifyAll,status5);
-	test_Value(status1.Int(), status1==KRequestPending);
-	test_Value(status2.Int(), status2==KRequestPending);
-	test_Value(status3.Int(), status3==KRequestPending);
-	test_Value(status4.Int(), status4==KRequestPending);
-	test_Value(status5.Int(), status5==KRequestPending);
+	test(status1==KRequestPending);
+	test(status2==KRequestPending);
+	test(status3==KRequestPending);
+	test(status4==KRequestPending);
+	test(status5==KRequestPending);
 
 	test.Next(_L("RFs::NotifyCancel()"));
 //	Test that one call to RFs::NotifyCancel() cancels all outstanding requests
 	fs1.NotifyChangeCancel();
 	User::WaitForRequest(status1);
-	test_Value(status1.Int(), status1==KErrCancel);
+	test(status1==KErrCancel);
 	User::WaitForRequest(status2);
-	test_Value(status2.Int(), status2==KErrCancel);
+	test(status2==KErrCancel);
 	User::WaitForRequest(status3);
-	test_Value(status3.Int(), status3==KErrCancel);
+	test(status3==KErrCancel);
 	User::WaitForRequest(status4);
-	test_Value(status4.Int(), status4==KErrCancel);
+	test(status4==KErrCancel);
 	User::WaitForRequest(status5);
-	test_Value(status5.Int(), status5==KErrCancel);
+	test(status5==KErrCancel);
 //	Call the cancel function again to check no further action
 	fs1.NotifyChangeCancel();
 
@@ -455,49 +456,49 @@
 	fs1.NotifyChange(ENotifyAll,status3);
 	fs1.NotifyChange(ENotifyAll,status4);
 	fs1.NotifyChange(ENotifyAll,status5);
-	test_Value(status1.Int(), status1==KRequestPending);
-	test_Value(status2.Int(), status2==KRequestPending);
-	test_Value(status3.Int(), status3==KRequestPending);
-	test_Value(status4.Int(), status4==KRequestPending);
-	test_Value(status5.Int(), status5==KRequestPending);
+	test(status1==KRequestPending);
+	test(status2==KRequestPending);
+	test(status3==KRequestPending);
+	test(status4==KRequestPending);
+	test(status5==KRequestPending);
 
 //	Cancel the outstanding request with status5
 	test.Next(_L("RFs::NotifyCancel()"));
 	fs1.NotifyChangeCancel(status5);
 	User::WaitForRequest(status5);
-	test_Value(status1.Int(), status1==KRequestPending);
-	test_Value(status2.Int(), status2==KRequestPending);
-	test_Value(status3.Int(), status3==KRequestPending);
-	test_Value(status4.Int(), status4==KRequestPending);
-	test_Value(status5.Int(), status5==KErrCancel);
+	test(status1==KRequestPending);
+	test(status2==KRequestPending);
+	test(status3==KRequestPending);
+	test(status4==KRequestPending);
+	test(status5==KErrCancel);
 
 	fs1.NotifyChangeCancel(status2);
 	User::WaitForRequest(status2);
 
-	test_Value(status1.Int(), status1==KRequestPending);
-	test_Value(status2.Int(), status2==KErrCancel);
-	test_Value(status3.Int(), status3==KRequestPending);
-	test_Value(status4.Int(), status4==KRequestPending);
+	test(status1==KRequestPending);
+	test(status2==KErrCancel);
+	test(status3==KRequestPending);
+	test(status4==KRequestPending);
 
 	fs1.NotifyChangeCancel(status4);
 	User::WaitForRequest(status4);
-	test_Value(status1.Int(), status1==KRequestPending);
-	test_Value(status3.Int(), status3==KRequestPending);
-	test_Value(status4.Int(), status4==KErrCancel);
-
-	fs1.NotifyChangeCancel(status4);				//	Test no side effects on trying to cancel a request
-	test_Value(status4.Int(), status4==KErrCancel);	//	that has already been cancelled
+	test(status1==KRequestPending);
+	test(status3==KRequestPending);
+	test(status4==KErrCancel);
+
+	fs1.NotifyChangeCancel(status4);	//	Test no side effects on trying to cancel a request
+	test(status4==KErrCancel);			//	that has already been cancelled
 
 	fs1.NotifyChangeCancel(status1);
 	User::WaitForRequest(status1);
-	test_Value(status1.Int(), status1==KErrCancel);
-	test_Value(status3.Int(), status3==KRequestPending);
+	test(status1==KErrCancel);
+	test(status3==KRequestPending);
 	fs1.NotifyChangeCancel(status1);	//	Test no side effects on trying to cancel a request
-	test_Value(status1.Int(), status1==KErrCancel);			//	that has already been cancelled
+	test(status1==KErrCancel);			//	that has already been cancelled
 
 	fs1.NotifyChangeCancel(status3);
 	User::WaitForRequest(status3);
-	test_Value(status3.Int(), status3==KErrCancel);
+	test(status3==KErrCancel);
 
 	fs1.Close();
 	}
@@ -510,7 +511,7 @@
 
 	test.Next(_L("Kill client"));
 	TInt r=gSleepThread.CreateLocal(0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RThread clientThread;
 	r=clientThread.Create(_L("ClientThread"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest4);
 	if (r!=KErrNone)
@@ -531,7 +532,7 @@
 	clientThread.Close();
 
 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\"));
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	MakeFile(_L("\\F32-TST\\NOTIFY\\NewFile.Txt"));
 	User::After(1000);
 	}
@@ -547,37 +548,37 @@
 
 	RFile file;
 	TInt r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\kangaroo.txt"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\koala.txt"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\dingo.txt"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	TRequestStatus reqStat=0;
 	TheFs.NotifyChange(ENotifyEntry,reqStat);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 
 	r=gSleepThread.CreateLocal(0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RThread clientThread;
 	r=clientThread.Create(_L("Test5Thread"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	clientThread.Resume();
 	gSleepThread.Wait();
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\kangaroo.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\koala.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\dingo.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 
 
@@ -593,7 +594,7 @@
 	{
 	TDriveInfo driveInfo;
 	TInt r=TheFs.Drive(driveInfo,CurrentDrive());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	// only test on removable media
 	if (driveInfo.iDriveAtt&KDriveAttRemovable)
         {
@@ -603,16 +604,16 @@
         TRequestStatus reqStat=0;
         TInt r;
         TheFs.NotifyChange(ENotifyEntry,reqStat);
-        test_Value(reqStat.Int(), reqStat==KRequestPending);
+        test(reqStat==KRequestPending);
         r=gSleepThread.CreateLocal(0);
-        test_KErrNone(r);
+        test(r==KErrNone);
         RThread clientThread;
         r=clientThread.Create(_L("Test6Thread"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest6);
-        test_KErrNone(r);
+        test(r==KErrNone);
         clientThread.Resume();
         gSleepThread.Wait();
         TInt reqInt=reqStat.Int();
-        test_KErrNone(reqInt);
+        test(reqInt==KErrNone);
         User::WaitForRequest(reqStat);
         WaitForMediaChange();
         gSleepThread.Close();
@@ -622,7 +623,7 @@
         //-- it seems that after generating media change the meia driver isn't ready for some time
         User::After(2000000);
 	    r=TheFs.Drive(driveInfo,CurrentDrive());
-	    test_KErrNone(r);
+	    test(r==KErrNone);
 
     
     }
@@ -639,19 +640,19 @@
 	MakeFile(_L("NewFile.TXT"));
 	TInt r;
 	TheFs.NotifyChange(ENotifyEntry,reqStat);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 
 	r=gSleepThread.CreateLocal(0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RThread clientThread;
 	r=clientThread.Create(_L("Test7Thread"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest7);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	clientThread.Resume();
 	gSleepThread.Wait();
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 
 	r=TheFs.Delete(_L("Newfile.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	User::WaitForRequest(reqStat);
 
@@ -668,7 +669,7 @@
 	{
 	TDriveInfo driveInfo;
 	TInt r=TheFs.Drive(driveInfo,CurrentDrive());
-	test_KErrNone(r);
+	test(r==KErrNone);
 	// only test on removable media
 	if (driveInfo.iDriveAtt&KDriveAttRemovable)
 		{
@@ -677,17 +678,17 @@
 		TFileName path = _L("\\F32-tst\\NOTIFY\\");
 		TInt r;
 		TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-		test_Value(reqStat.Int(), reqStat==KRequestPending);
+		test(reqStat==KRequestPending);
 		r=gSleepThread.CreateLocal(0);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		RThread clientThread;
 		gSocketNumber=0;
 		r=clientThread.Create(_L("Test6Thread1"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest6);	//only generates a media change on removable media
-		test_KErrNone(r);
+		test(r==KErrNone);
 		clientThread.Resume();
 		gSleepThread.Wait();
 		User::WaitForRequest(reqStat);
-		test_KErrNone(reqStat.Int());
+		test(reqStat==KErrNone);
 		WaitForMediaChange();
 		gSleepThread.Close();
 		clientThread.Close();
@@ -695,19 +696,19 @@
         //-- it seems that after generating media change the meia driver isn't ready for some time
         User::After(2000000);
 	    r=TheFs.Drive(driveInfo,CurrentDrive());
-	    test_KErrNone(r);
+	    test(r==KErrNone);
 
 
 		TheFs.NotifyChange(ENotifyDisk,reqStat,path);
-		test_Value(reqStat.Int(), reqStat==KRequestPending);
+		test(reqStat==KRequestPending);
 		r=gSleepThread.CreateLocal(0);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=clientThread.Create(_L("Test6Thread2"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest6);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		clientThread.Resume();
 		gSleepThread.Wait();
 		User::WaitForRequest(reqStat);
-		test_KErrNone(reqStat.Int());
+		test(reqStat==KErrNone);
 		WaitForMediaChange();
 		gSleepThread.Close();
 		clientThread.Close();
@@ -715,18 +716,18 @@
         //-- it seems that after generating media change the meia driver isn't ready for some time
         User::After(2000000);
 	    r=TheFs.Drive(driveInfo,CurrentDrive());
-	    test_KErrNone(r);
+	    test(r==KErrNone);
 
 		TheFs.NotifyChange(ENotifyWrite,reqStat,path);
-		test_Value(reqStat.Int(), reqStat==KRequestPending);
+		test(reqStat==KRequestPending);
 		r=gSleepThread.CreateLocal(0);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		r=clientThread.Create(_L("Test6Thread3"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest6);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		clientThread.Resume();
 		gSleepThread.Wait();
 		User::WaitForRequest(reqStat);
-		test_KErrNone(reqStat.Int());
+		test(reqStat==KErrNone);
 		WaitForMediaChange();
 		gSleepThread.Close();
 		clientThread.Close();
@@ -734,7 +735,7 @@
         //-- it seems that after generating media change the meia driver isn't ready for some time
         User::After(2000000);
 	    r=TheFs.Drive(driveInfo,CurrentDrive());
-	    test_KErrNone(r);
+	    test(r==KErrNone);
 
 		}
 	}
@@ -749,153 +750,153 @@
 //	First a simple example
 
 	TInt r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\"));
-	test_Value(r, (r == KErrNotFound)||(r==KErrPathNotFound)||(r==KErrNone));
+	test((r==KErrNotFound)||(r==KErrPathNotFound)||(r==KErrNone));
 
 	TFileName path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\");
 	TRequestStatus reqStat(KRequestPending);
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 
 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 	path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\PayNoAttention.man");
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 
 	RFile file;
 	r=file.Replace(TheFs,path,EFileStream);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 	r=TheFs.Delete(path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 //	Now cancel the outstanding request
 	TheFs.NotifyChangeCancel(reqStat);
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 
 //	Repeat with a ENotifyFile request
 	TheFs.NotifyChange(ENotifyFile,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 
 	r=file.Replace(TheFs,path,EFileStream);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 	r=TheFs.Delete(path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyFile,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 //	Now cancel the outstanding request
 	TheFs.NotifyChangeCancel(reqStat);
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 
 //	Repeat with an ENotifyAttributes request
 	TheFs.NotifyChange(ENotifyAttributes,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 
 	r=file.Replace(TheFs,path,EFileStream);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());	//	Monitoring attributes but informed anyway
+	test(reqStat==KErrNone);	//	Monitoring attributes but informed anyway
 
 	r=TheFs.Delete(path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyAttributes,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 //	Now cancel the outstanding request
 	TheFs.NotifyChangeCancel(reqStat);
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 
 //	Repeat with an ENotifyWrite request
 	TheFs.NotifyChange(ENotifyWrite,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 
 	r=file.Replace(TheFs,path,EFileStream);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());	//	Monitoring file writing but informed anyway
+	test(reqStat==KErrNone);	//	Monitoring file writing but informed anyway
 
 	r=TheFs.Delete(path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyWrite,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 //	Now cancel the outstanding request
 	TheFs.NotifyChangeCancel(reqStat);
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 
 //	Repeat with an ENotifyDisk request
 	TheFs.NotifyChange(ENotifyDisk,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 
 	r=file.Replace(TheFs,path,EFileStream);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());	//	Monitoring disk activity but informed anyway
+	test(reqStat==KErrNone);	//	Monitoring disk activity but informed anyway
 
 	r=TheFs.Delete(path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyAttributes,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 //	Now cancel the outstanding request
 	TheFs.NotifyChangeCancel(reqStat);
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 
 //	Now do much the same with directory monitoring
 	path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\");
 	TheFs.RmDir(path);
 
 	TheFs.NotifyChange(ENotifyDir,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 
 	TheFs.MkDir(path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 	TheFs.RmDir(path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyDir,reqStat,path);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 
 //	Now cancel the outstanding request
 	TheFs.NotifyChangeCancel(reqStat);
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 
 	TheFs.NotifyChange(ENotifyDir,reqStat,path);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 
 //	Get a separate thread to create the directory
 	RThread thread;
@@ -906,19 +907,19 @@
 	thread.Close();
 
 	User::WaitForRequest(thrdStat);
-	test_KErrNone(thrdStat.Int());
+	test(thrdStat==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 	TheFs.RmDir(path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 //	Check that notification is not received for a non-existent file if only the previously
 //	non existent directory that contains it is created
 	path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\PayNoAttention.man");
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 
 	thread.Create(_L("RequestAheadThread"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest10);
 	thread.Logon(thrdStat);
@@ -926,35 +927,35 @@
 	thread.Close();
 
 	User::WaitForRequest(thrdStat);
-	test_KErrNone(thrdStat.Int());
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(thrdStat==KErrNone);
+	test(reqStat==KRequestPending);
 
 //	Now get a thread to create the file
 	thread.Create(_L("RequestAhead"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest11);
 	thread.Logon(thrdStat);
 	thread.Resume();
 	User::WaitForRequest(thrdStat);
-	test_KErrNone(thrdStat.Int());
+	test(thrdStat==KErrNone);
 	thread.Close();
 
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 	TheFs.Delete(path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 
 //	Now cancel the outstanding request
 	TheFs.NotifyChangeCancel(reqStat);
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 
 	path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\");
 	TheFs.RmDir(path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 
@@ -970,52 +971,52 @@
 	TFileName path=(_L("\\F32-TST\\"));
 
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	RThread thread;
 	TInt r=thread.Create(_L("MyThread"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread.Logon(thrdStat);
 	thread.Resume();
 	User::WaitForRequest(thrdStat);
-	test_KErrNone(thrdStat.Int());
+	test(thrdStat==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	thread.Close();
 
 //	Repeat the test
 	test.Next(_L("Repeat Test notification of an entry change"));
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=thread.Create(_L("MyThread2"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread.Logon(thrdStat);
 	thread.Resume();
 	User::WaitForRequest(thrdStat);
-	test_KErrNone(thrdStat.Int());
+	test(thrdStat==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	thread.Close();
 
 //	Test it can be cancelled
 	test.Next(_L("Test Notify cancel"));
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	TheFs.NotifyChangeCancel();
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 
 //	Test it can be notified again
 	test.Next(_L("Test notification still works"));
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=thread.Create(_L("MyThread3"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread.Logon(thrdStat);
 	thread.Resume();
 	User::WaitForRequest(thrdStat);
-	test_KErrNone(thrdStat.Int());
+	test(thrdStat==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	thread.Close();
 
 //	Test notification doesn't occur when a change occurs above the directory monitored
@@ -1023,200 +1024,200 @@
 //	will occur - this is tested for in Test18())
 	test.Next(_L("Test changing above monitored directory"));
 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"));
-	test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+	test((r==KErrNone)||(r==KErrAlreadyExists));
 	path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\");
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=thread.Create(_L("MyThread4"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread.Logon(thrdStat);
 	thread.Resume();
 	User::WaitForRequest(thrdStat);
-	test_KErrNone(thrdStat.Int());
+	test(thrdStat==KErrNone);
 	User::After(500000);
 	thread.Close();
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	TheFs.NotifyChangeCancel();
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 
 //	Test notification occurs when a change is made to the subdirectory monitored
 	test.Next(_L("Create a file in monitored subdirectory"));
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=thread.Create(_L("MyThread5"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread.Logon(thrdStat);
 	thread.Resume();
 	User::WaitForRequest(thrdStat);
-	test_KErrNone(thrdStat.Int());
+	test(thrdStat==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	thread.Close();
 
 	test.Next(_L("Create a directory in monitored subdirectory"));
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=thread.Create(_L("MyThread6"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest3);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread.Logon(thrdStat);
 	thread.Resume();
 	User::WaitForRequest(thrdStat);
-	test_KErrNone(thrdStat.Int());
+	test(thrdStat==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	thread.Close();
 
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\SCARECROW\\TINMAN\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 
 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\SCARECROW\\TINMAN\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\SCARECROW\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 //	Test again that notification doesn't occur above the subdirectory being monitored
 	test.Next(_L("Test changing above monitored directory"));
 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"));
-	test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+	test((r==KErrNone)||(r==KErrAlreadyExists));
 	path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\");
 
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=thread.Create(_L("MyThread7"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread.Logon(thrdStat);
 	thread.Resume();
 	User::WaitForRequest(thrdStat);
-	test_KErrNone(thrdStat.Int());
+	test(thrdStat==KErrNone);
 	User::After(500000);
 	thread.Close();
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	TheFs.NotifyChangeCancel();
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 
 //	Test notification occurs when a change is made to the subdirectory monitored
 	test.Next(_L("Delete a file in monitored subdirectory"));
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 	RFile file;
 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\WickedWitch.msg"),EFileStream);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 //	Test notification on a specific file
 	test.Next(_L("Monitor changes to a specific file"));
 	path+=_L("WickedWitch.msg");
 	TheFs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=thread.Create(_L("MyThread8"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest8);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread.Logon(thrdStat);
 	thread.Resume();
 	User::WaitForRequest(thrdStat);
-	test_KErrNone(thrdStat.Int());
+	test(thrdStat==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	thread.Close();
 
 //	Test notification does not occur if a change is made above the file
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	thread.Create(_L("MyThread9"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest2);
 	thread.Logon(thrdStat);
 	thread.Resume();
 	User::WaitForRequest(thrdStat);
-	test_KErrNone(thrdStat.Int());
+	test(thrdStat==KErrNone);
 	User::After(500000);
 	thread.Close();
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	TheFs.NotifyChangeCancel();
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 
 //	Test notification occurs when a change is made to the file
 	test.Next(_L("Delete monitored file"));
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\WickedWitch.Msg"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	Test notification request is now submitted on the non existent path successfully
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	TheFs.NotifyChangeCancel(reqStat);
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 
 	path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.Doc");
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.Doc"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 	path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\");
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	Submit a request for a path which does not yet exist
 	path=_L("\\F32-TST\\NOTIFY\\GOOD_WITCH\\");
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 //	Now create the directory we are waiting on
 	r=TheFs.MkDir(path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 //	Make sure the notification has now been received
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	Submit a request for a file which does not yet exist
 	path=_L("\\F32-TST\\NOTIFY\\GOOD_WITCH\\Red-Shoes.red");
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 //	Now create the file we are waiting on
 	r=file.Replace(TheFs,path,EFileStream);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 //	Make sure the notification has now been received
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 //	Submit another notification request and delete the file
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.Delete(path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	path=_L("\\F32-TST\\NOTIFY\\GOOD_WITCH\\");
 	TheFs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.RmDir(path);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	// test passing in an empty string
 	TheFs.NotifyChange(ENotifyEntry,reqStat,_L(""));
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrArgument);
+	test(reqStat==KErrArgument);
 	}
 
 static void Test9()
@@ -1230,13 +1231,13 @@
 //	Create five sessions monitoring various levels of a directory tree
 
 	TInt r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\ANIMAL\\"));
-	test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists));
+	test((r==KErrNone)||(r==KErrAlreadyExists));
 	RFile file;
 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\ANIMAL\\cat.txt"),EFileStream);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\ANIMAL\\dog.txt"),EFileStream);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	TFileName path1=_L("\\F32-TST\\");
@@ -1249,127 +1250,127 @@
 	TRequestStatus reqStat1(KRequestPending);
 	RFs fs1;
 	r=fs1.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs1.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fs1.NotifyChange(ENotifyEntry,reqStat1,path1);
 
 	TRequestStatus reqStat2(KRequestPending);
 	RFs fs2;
 	r=fs2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs2.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fs2.NotifyChange(ENotifyEntry,reqStat2,path2);
 
 	TRequestStatus reqStat3(KRequestPending);
 	RFs fs3;
 	r=fs3.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs3.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fs3.NotifyChange(ENotifyEntry,reqStat3,path3);
 
 	TRequestStatus reqStat4(KRequestPending);
 	RFs fs4;
 	r=fs4.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs4.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fs4.NotifyChange(ENotifyEntry,reqStat4,path4);
 
 	TRequestStatus reqStat5(KRequestPending);
 	RFs fs5;
 	r=fs5.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs5.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fs5.NotifyChange(ENotifyEntry,reqStat5,path5);
 
 	TRequestStatus reqStat6(KRequestPending);
 	RFs fs6;
 	r=fs6.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs6.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
 
-	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
-	test_Value(reqStat5.Int(), reqStat5==KRequestPending);
-	test_Value(reqStat6.Int(), reqStat6==KRequestPending);
+	test(reqStat1==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
+	test(reqStat5==KRequestPending);
+	test(reqStat6==KRequestPending);
 
 //	Make a change a the top level and check that only the session monitoring
 //	that level is notified
 	test.Next(_L("Test only client monitoring top level is notified"));
 	r=file.Replace(TheFs,_L("\\F32-TST\\NewFile.txt"),EFileStream);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	User::WaitForRequest(reqStat1);
-	test_KErrNone(reqStat1.Int());
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
-	test_Value(reqStat5.Int(), reqStat5==KRequestPending);
+	test(reqStat1==KErrNone);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
+	test(reqStat5==KRequestPending);
 	User::WaitForRequest(reqStat6);
-	test_KErrNone(reqStat6.Int());
+	test(reqStat6==KErrNone);
 
 	r=TheFs.Delete(_L("\\F32-TST\\NewFile.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 //	Renew the notify request at the top level and make a change one step lower
 	fs1.NotifyChange(ENotifyEntry,reqStat1,path1);
 	fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
-	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
-	test_Value(reqStat6.Int(), reqStat6==KRequestPending);
+	test(reqStat1==KRequestPending);
+	test(reqStat6==KRequestPending);
 
 	test.Next(_L("Test clients monitoring levels 1 and 2 are notified"));
 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileStream);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	User::WaitForRequest(reqStat1);
 	User::WaitForRequest(reqStat2);
-	test_KErrNone(reqStat1.Int());
-	test_KErrNone(reqStat2.Int());
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
-	test_Value(reqStat5.Int(), reqStat5==KRequestPending);
+	test(reqStat1==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
+	test(reqStat5==KRequestPending);
 	User::WaitForRequest(reqStat6);
-	test_KErrNone(reqStat6.Int());
+	test(reqStat6==KErrNone);
 
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\NewFile.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 //	Renew the notify request at the top and second levels and make a change
 //	one step lower still
 	fs1.NotifyChange(ENotifyEntry,reqStat1,path1);
 	fs2.NotifyChange(ENotifyEntry,reqStat2,path2);
 	fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
-	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat6.Int(), reqStat6==KRequestPending);
+	test(reqStat1==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat6==KRequestPending);
 
 	test.Next(_L("Test clients monitoring levels 1,2 and 3 are notified"));
 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\ANIMAL\\NewFile.txt"),EFileStream);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	User::WaitForRequest(reqStat1);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat1.Int());
-	test_KErrNone(reqStat2.Int());
-	test_KErrNone(reqStat3.Int());
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
-	test_Value(reqStat5.Int(), reqStat5==KRequestPending);
+	test(reqStat1==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KErrNone);
+	test(reqStat4==KRequestPending);
+	test(reqStat5==KRequestPending);
 	User::WaitForRequest(reqStat6);
-	test_KErrNone(reqStat6.Int());
+	test(reqStat6==KErrNone);
 
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\ANIMAL\\NewFile.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 //	Renew the notify request at the top, second and third levels and make a change
 //	one step lower still
@@ -1377,25 +1378,25 @@
 	fs2.NotifyChange(ENotifyEntry,reqStat2,path2);
 	fs3.NotifyChange(ENotifyEntry,reqStat3,path3);
 	fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
-	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat6==KRequestPending);
+	test(reqStat1==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat6==KRequestPending);
 
 	test.Next(_L("Test clients monitoring levels 1 - 4 are notified"));
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\ANIMAL\\cat.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat1);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat3);
 	User::WaitForRequest(reqStat4);
-	test_KErrNone(reqStat1.Int());
-	test_KErrNone(reqStat2.Int());
-	test_KErrNone(reqStat3.Int());
-	test_KErrNone(reqStat4.Int());
-	test_Value(reqStat5.Int(), reqStat5==KRequestPending);
+	test(reqStat1==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KErrNone);
+	test(reqStat4==KErrNone);
+	test(reqStat5==KRequestPending);
 	User::WaitForRequest(reqStat6);
-	test_KErrNone(reqStat6.Int());
+	test(reqStat6==KErrNone);
 
 //	Renew the notify request at the top, second and third levels and on the file deleted above
 //	which will be successful, but will not complete (for obvious reasons)
@@ -1406,31 +1407,31 @@
 	fs3.NotifyChange(ENotifyEntry,reqStat3,path3);
 	fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
 	fs4.NotifyChange(ENotifyEntry,reqStat4,path4);
-	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
-	test_Value(reqStat6.Int(), reqStat6==KRequestPending);
+	test(reqStat1==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
+	test(reqStat6==KRequestPending);
 
 	test.Next(_L("Test clients monitoring levels 1 - 3 and 5 are notified"));
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\ANIMAL\\dog.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat1);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat3);
 //	Don't wait for reqStat4
 	User::WaitForRequest(reqStat5);
 	User::WaitForRequest(reqStat6);
-	test_KErrNone(reqStat1.Int());
-	test_KErrNone(reqStat2.Int());
-	test_KErrNone(reqStat3.Int());
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);	//	File does not exist
-	test_KErrNone(reqStat5.Int());
-	test_KErrNone(reqStat6.Int());
+	test(reqStat1==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KErrNone);
+	test(reqStat4==KRequestPending);	//	File does not exist
+	test(reqStat5==KErrNone);
+	test(reqStat6==KErrNone);
 
 	fs4.NotifyChangeCancel(reqStat4);
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+	test(reqStat4==KErrCancel);
 //	Renew the notify request at the top, second and third levels and attempt to renew
 //	the request on the files deleted above (which will fail).
 
@@ -1441,25 +1442,25 @@
 	fs4.NotifyChange(ENotifyEntry,reqStat4,path4);
 	fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
 	fs5.NotifyChange(ENotifyEntry,reqStat5,path5);
-	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
-	test_Value(reqStat5.Int(), reqStat5==KRequestPending);
-	test_Value(reqStat6.Int(), reqStat6==KRequestPending);
+	test(reqStat1==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
+	test(reqStat5==KRequestPending);
+	test(reqStat6==KRequestPending);
 
 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\ANIMAL\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat1);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat1.Int());
-	test_KErrNone(reqStat2.Int());
-	test_KErrNone(reqStat3.Int());
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
-	test_Value(reqStat5.Int(), reqStat5==KRequestPending);
+	test(reqStat1==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KErrNone);
+	test(reqStat4==KRequestPending);
+	test(reqStat5==KRequestPending);
 	User::WaitForRequest(reqStat6);
-	test_KErrNone(reqStat6.Int());
+	test(reqStat6==KErrNone);
 
 //	Renew the notify request at the top and second levels on the third level
 //	which was removed - it'll succeed but won't complete.
@@ -1471,12 +1472,12 @@
 	fs3.NotifyChange(ENotifyEntry,reqStat3,path3);
 	fs6.NotifyChange(ENotifyEntry,reqStat6,path6);
 
-	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
-	test_Value(reqStat5.Int(), reqStat5==KRequestPending);
-	test_Value(reqStat6.Int(), reqStat6==KRequestPending);
+	test(reqStat1==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
+	test(reqStat5==KRequestPending);
+	test(reqStat6==KRequestPending);
 
 	fs1.NotifyChangeCancel();
 	fs2.NotifyChangeCancel();
@@ -1508,9 +1509,9 @@
 	TFileName path=_L("\\F32-TST\\NOTIFY\\");
 	RFs fs1;
 	TInt r=fs1.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs1.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TRequestStatus status1;
 	TRequestStatus status2;
@@ -1523,25 +1524,25 @@
 	fs1.NotifyChange(ENotifyAll,status3,path);
 	fs1.NotifyChange(ENotifyAll,status4,path);
 	fs1.NotifyChange(ENotifyAll,status5,path);
-	test_Value(status1.Int(), status1==KRequestPending);
-	test_Value(status2.Int(), status2==KRequestPending);
-	test_Value(status3.Int(), status3==KRequestPending);
-	test_Value(status4.Int(), status4==KRequestPending);
-	test_Value(status5.Int(), status5==KRequestPending);
+	test(status1==KRequestPending);
+	test(status2==KRequestPending);
+	test(status3==KRequestPending);
+	test(status4==KRequestPending);
+	test(status5==KRequestPending);
 
 	test.Next(_L("RFs::NotifyCancel()"));
 //	Test that one call to RFs::NotifyCancel() cancels all outstanding requests
 	fs1.NotifyChangeCancel();
 	User::WaitForRequest(status1);
-	test_Value(status1.Int(), status1==KErrCancel);
+	test(status1==KErrCancel);
 	User::WaitForRequest(status2);
-	test_Value(status2.Int(), status2==KErrCancel);
+	test(status2==KErrCancel);
 	User::WaitForRequest(status3);
-	test_Value(status3.Int(), status3==KErrCancel);
+	test(status3==KErrCancel);
 	User::WaitForRequest(status4);
-	test_Value(status4.Int(), status4==KErrCancel);
+	test(status4==KErrCancel);
 	User::WaitForRequest(status5);
-	test_Value(status5.Int(), status5==KErrCancel);
+	test(status5==KErrCancel);
 //	Call the cancel function again to check no further action
 	fs1.NotifyChangeCancel();
 
@@ -1552,62 +1553,62 @@
 	fs1.NotifyChange(ENotifyAll,status3,path);
 	fs1.NotifyChange(ENotifyAll,status4,path);
 	fs1.NotifyChange(ENotifyAll,status5,path);
-	test_Value(status1.Int(), status1==KRequestPending);
-	test_Value(status2.Int(), status2==KRequestPending);
-	test_Value(status3.Int(), status3==KRequestPending);
-	test_Value(status4.Int(), status4==KRequestPending);
-	test_Value(status5.Int(), status5==KRequestPending);
+	test(status1==KRequestPending);
+	test(status2==KRequestPending);
+	test(status3==KRequestPending);
+	test(status4==KRequestPending);
+	test(status5==KRequestPending);
 
 //	Cancel the outstanding request with status5
 	test.Next(_L("RFs::NotifyCancel()"));
 	fs1.NotifyChangeCancel(status5);
 	User::WaitForRequest(status5);
-	test_Value(status1.Int(), status1==KRequestPending);
-	test_Value(status2.Int(), status2==KRequestPending);
-	test_Value(status3.Int(), status3==KRequestPending);
-	test_Value(status4.Int(), status4==KRequestPending);
-	test_Value(status5.Int(), status5==KErrCancel);
+	test(status1==KRequestPending);
+	test(status2==KRequestPending);
+	test(status3==KRequestPending);
+	test(status4==KRequestPending);
+	test(status5==KErrCancel);
 
 	r=TheFs.MkDir(_L("\\F32-TST\\TROPICANA\\"));
-	test_KErrNone(r);
-	test_Value(status1.Int(), status1==KRequestPending);
-	test_Value(status2.Int(), status2==KRequestPending);
-	test_Value(status3.Int(), status3==KRequestPending);
-	test_Value(status4.Int(), status4==KRequestPending);
+	test(r==KErrNone);
+	test(status1==KRequestPending);
+	test(status2==KRequestPending);
+	test(status3==KRequestPending);
+	test(status4==KRequestPending);
 
 	fs1.NotifyChangeCancel(status2);
 	User::WaitForRequest(status2);
 
-	test_Value(status1.Int(), status1==KRequestPending);
-	test_Value(status2.Int(), status2==KErrCancel);
-	test_Value(status3.Int(), status3==KRequestPending);
-	test_Value(status4.Int(), status4==KRequestPending);
+	test(status1==KRequestPending);
+	test(status2==KErrCancel);
+	test(status3==KRequestPending);
+	test(status4==KRequestPending);
 
 	r=TheFs.RmDir(_L("\\F32-TST\\TROPICANA\\"));
-	test_KErrNone(r);
-	test_Value(status1.Int(), status1==KRequestPending);
-	test_Value(status3.Int(), status3==KRequestPending);
-	test_Value(status4.Int(), status4==KRequestPending);
+	test(r==KErrNone);
+	test(status1==KRequestPending);
+	test(status3==KRequestPending);
+	test(status4==KRequestPending);
 
 	fs1.NotifyChangeCancel(status4);
 	User::WaitForRequest(status4);
-	test_Value(status1.Int(), status1==KRequestPending);
-	test_Value(status3.Int(), status3==KRequestPending);
-	test_Value(status4.Int(), status4==KErrCancel);
+	test(status1==KRequestPending);
+	test(status3==KRequestPending);
+	test(status4==KErrCancel);
 
 	fs1.NotifyChangeCancel(status4);	//	Test no side effects on trying to cancel a request
-	test_Value(status4.Int(), status4==KErrCancel);			//	that has already been cancelled
+	test(status4==KErrCancel);			//	that has already been cancelled
 
 	fs1.NotifyChangeCancel(status1);
 	User::WaitForRequest(status1);
-	test_Value(status1.Int(), status1==KErrCancel);
-	test_Value(status3.Int(), status3==KRequestPending);
+	test(status1==KErrCancel);
+	test(status3==KRequestPending);
 	fs1.NotifyChangeCancel(status1);	//	Test no side effects on trying to cancel a request
-	test_Value(status1.Int(), status1==KErrCancel);			//	that has already been cancelled
+	test(status1==KErrCancel);			//	that has already been cancelled
 
 	fs1.NotifyChangeCancel(status3);
 	User::WaitForRequest(status3);
-	test_Value(status3.Int(), status3==KErrCancel);
+	test(status3==KErrCancel);
 
 	fs1.Close();
 	}
@@ -1621,11 +1622,11 @@
 	test.Next(_L("Kill client while it is monitoring changes to a directory"));
 //	Call CreateLocal to create RSemaphore gSleepThread which is local to this process
 	TInt r=gSleepThread.CreateLocal(0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RThread clientThread;
 	r=clientThread.Create(_L("ClientThread"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest9);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	clientThread.Resume();
 	gSleepThread.Wait();	//	Wait for gSleepThread to be signalled
 							//	Client thread is waiting for notification of changes
@@ -1640,7 +1641,7 @@
 
 //	Make a change and check there's no disaster
 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\"));
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 	MakeFile(_L("\\F32-TST\\NOTIFY\\NewFile.Txt"));
 	User::After(1000);
 	}
@@ -1657,95 +1658,95 @@
 
 	RFile file;
 	TInt r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\kangaroo.txt"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\koala.txt"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\dingo.txt"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	TFileName path=_L("\\F32-TST\\NOTIFY\\");
 	TRequestStatus reqStat1(KRequestPending);
 	RFs fs1;
 	r=fs1.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs1.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fs1.NotifyChange(ENotifyEntry,reqStat1,path);
 
 	TRequestStatus reqStat2(KRequestPending);
 	RFs fs2;
 	r=fs2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs2.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fs2.NotifyChange(ENotifyEntry,reqStat2,path);
 
 	TRequestStatus reqStat3(KRequestPending);
 	RFs fs3;
 	r=fs3.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs3.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fs3.NotifyChange(ENotifyEntry,reqStat3,path);
 
-	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+	test(reqStat1==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
 
 	r=gSleepThread.CreateLocal(0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RThread thread1;
 	r=thread1.Create(_L("TestThread1"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread1.Resume();
 	gSleepThread.Wait();
 
-	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+	test(reqStat1==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
 
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\kangaroo.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat1);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat1.Int());	//	All three notifications occur because they
-	test_KErrNone(reqStat2.Int());	//	are all monitoring the top level directory
-	test_KErrNone(reqStat3.Int());	//	Later, we'll test monitoring individual files...
+	test(reqStat1==KErrNone);	//	All three notifications occur because they
+	test(reqStat2==KErrNone);	//	are all monitoring the top level directory
+	test(reqStat3==KErrNone);	//	Later, we'll test monitoring individual files...
 
 	gSleepThread.Close();
 	thread1.Close();
 
 	test.Next(_L("Test reads and writes do cause notification under ENotifyAll"));
 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\kangaroo.txt"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	fs1.NotifyChange(ENotifyAll,reqStat1,path);
 	fs2.NotifyChange(ENotifyAll,reqStat2,path);
 	fs3.NotifyChange(ENotifyAll,reqStat3,path);
 
-	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+	test(reqStat1==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
 
 	r=gSleepThread.CreateLocal(0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RThread thread2;
 	r=thread2.Create(_L("TestThread2"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread2.Resume();
 	gSleepThread.Wait();
 
 	User::WaitForRequest(reqStat1);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat1.Int());
-	test_KErrNone(reqStat2.Int());
-	test_KErrNone(reqStat3.Int());
+	test(reqStat1==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KErrNone);
 
 	gSleepThread.Close();
 	thread2.Close();
@@ -1762,33 +1763,33 @@
 	fs2.NotifyChange(ENotifyEntry,reqStat2,path2);
 	fs3.NotifyChange(ENotifyAll,reqStat3,path3);
 
-	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+	test(reqStat1==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
 
 	r=gSleepThread.CreateLocal(0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RThread thread3;
 	r=thread3.Create(_L("TestThread3"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread3.Resume();
 	gSleepThread.Wait();
 
 	User::WaitForRequest(reqStat1);
-	test_KErrNone(reqStat1.Int());
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);	//	Monitoring with ENotifyEntry
+	test(reqStat1==KErrNone);
+	test(reqStat2==KRequestPending);	//	Monitoring with ENotifyEntry
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat3.Int());
+	test(reqStat3==KErrNone);
 
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\koala.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat2);
-	test_KErrNone(reqStat2.Int());
+	test(reqStat2==KErrNone);
 
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\kangaroo.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\dingo.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	gSleepThread.Close();
 	thread3.Close();
@@ -1805,17 +1806,17 @@
 	{
 	RFs fs;	//	Session to be notified of any changes
 	TInt r=fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 
 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"));
-	test_Value(r, r == KErrNone||r==KErrAlreadyExists);
+	test(r==KErrNone||r==KErrAlreadyExists);
 
 	RFile file;
 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\WickedWitch.msg"),EFileStream);
-	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+	test(r==KErrNone||KErrAlreadyExists);
 	file.Close();
 
 //	Test notification on a specific file
@@ -1824,48 +1825,48 @@
 	TRequestStatus reqStat(KRequestPending);
 	TRequestStatus thrdStat(KRequestPending);
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	RThread thread;
 	r=thread.Create(_L("MyThread7"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest8);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread.Logon(thrdStat);
 	thread.Resume();
 	User::WaitForRequest(thrdStat);
-	test_KErrNone(thrdStat.Int());
+	test(thrdStat==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	thread.Close();
 //	Test notification does not occur if a change is made above the file
 	fs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=thread.Create(_L("MyThread8"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread.Logon(thrdStat);
 	thread.Resume();
 	User::WaitForRequest(thrdStat);
-	test_KErrNone(thrdStat.Int());
+	test(thrdStat==KErrNone);
 	User::After(500000);
 	thread.Close();
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\NEWFILE.TXT"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 //	Test notification does not occur if a change is made to another file
 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Lion.log"),EFileStream);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	file.Close();
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Lion.log"));
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 
 
 //	Test notification occurs when a change is made to the file
 	test.Next(_L("Delete monitored file"));
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\WickedWitch.Msg"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 	fs.Close();
 	}
@@ -1879,9 +1880,9 @@
 //
 	RFs fs;
 	TInt r=fs.Connect();	//	Session to be notified of any changes
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 //	RFile::Write() to a file within the monitored directory
 	test.Next(_L("RFile::Write()"));
@@ -1891,178 +1892,178 @@
 	RFile file;
 
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=file.Write(0,_L8("Pay no attention to the man behind the curtain"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFile::Read() a file within the monitored directory - no notification for reads
 	path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\");
 	TBuf8<100> temp;
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	r=file.Read(0,temp,100);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 
 //	RFile::SetAtt() of a file within the monitored directory
 	test.Next(_L("RFile::SetAtt()"));
 	r=file.SetAtt(KEntryAttSystem,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 
 //	RFile::SetSize() of a file within the monitored directory
 	test.Next(_L("RFile::SetSize()"));
 	r=file.SetSize(256);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	file.Close();
 
 //	RFile::Temp() to create a temp file within the monitored directory
 	test.Next(_L("RFile::Temp()"));
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	TFileName fileName;
 	r=file.Temp(TheFs,path,fileName,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	file.Close();
 
 //	RFile::SetModified() to change modification time of a file within monitored dir
 	test.Next(_L("RFile::SetModified()"));
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	TTime now;
 	now.HomeTime();
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	file.SetModified(now);
 	file.Close();
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFs::SetEntry() to change a directory entry within the monitored directory
 	test.Next(_L("RFs::SetEntry()"));
 	TEntry entry;
 	fs.NotifyChange(ENotifyAll,reqStat,path);
 	r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),entry);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	now.HomeTime();
 	r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),now,KEntryAttHidden,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFile::Set() to change file's modification time and attributes
 	test.Next(_L("RFile::Set()"));
 	fs.NotifyChange(ENotifyAll,reqStat,path);
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	now.HomeTime();
 	r=file.Set(now,KEntryAttNormal,KEntryAttHidden);
 	file.Close();
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFs::SetDriveName()
 	test.Next(_L("RFs::SetDriveName()"));
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	User::After(KNotifyChangeAfter);
 	r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	fs.NotifyChange(ENotifyEntry,reqStat,path);
 	User::After(KNotifyChangeAfter);
 	r=TheFs.SetDriveName(KDefaultDrive,_L("TEST"));
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	fs.NotifyChangeCancel(reqStat);
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 	fs.NotifyChange(ENotifyDisk,reqStat,path);
 	User::After(KNotifyChangeAfter);
 	r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVE"));
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	fs.NotifyChangeCancel(reqStat);
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 
 
 //	RFs::MkDir()
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	test.Next(_L("RFs::MkDir()"));
 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFs::RmDir()
 	test.Next(_L("RFs::RmDir()"));
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFile::Create()
 	test.Next(_L("RFile::Create()"));
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	file.Close();
 
 //	RFs::Delete()
 	test.Next(_L("RFs::Delete()"));
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFile::Replace()
 	test.Next(_L("RFile::Replace()"));
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	file.Close();
 
 //	RFs::Delete()
 	test.Next(_L("RFs::Delete()"));
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFs::SetVolumeLabel() - should only be notification when monitoring relevant TNotifyTypes
 	test.Next(_L("RFs::SetVolumeLabel"));
@@ -2073,52 +2074,52 @@
 	TFileName currentVolName;
 
 	r=TheFs.Volume(volInfo,driveNum);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	currentVolName=volInfo.iName;
 
 	r=TheFs.SetVolumeLabel(_L("VOL"),driveNum);
 	if (r==KErrNone)
 		{
 		User::WaitForRequest(reqStat);
-		test_KErrNone(reqStat.Int());
+		test(reqStat==KErrNone);
 		r=TheFs.Volume(volInfo,driveNum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(volInfo.iName==_L("VOL"));
 	//	Test notification occurs under ENotifyDisk
 		fs.NotifyChange(ENotifyDisk,reqStat,path);
-		test_Value(reqStat.Int(), reqStat==KRequestPending);
+		test(reqStat==KRequestPending);
 		r=TheFs.SetVolumeLabel(_L("ABCDEFGHIJK"),driveNum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		User::WaitForRequest(reqStat);
-		test_KErrNone(reqStat.Int());
+		test(reqStat==KErrNone);
 		r=TheFs.Volume(volInfo,driveNum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 
 		test(volInfo.iName==_L("ABCDEFGHIJK"));
 
 	//	Test notification does not occur under ENotifyAttributes
 		fs.NotifyChange(ENotifyAttributes,reqStat,path);
 		r=TheFs.SetVolumeLabel(_L("TROPICANA"),driveNum);
-		test_KErrNone(r);
-		test_Value(reqStat.Int(), reqStat==KRequestPending);
+		test(r==KErrNone);
+		test(reqStat==KRequestPending);
 		r=TheFs.Volume(volInfo,driveNum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 
 		test(volInfo.iName==_L("TROPICANA"));
 
 		fs.NotifyChangeCancel(reqStat);
 		User::WaitForRequest(reqStat);
-		test_Value(reqStat.Int(), reqStat==KErrCancel);
+		test(reqStat==KErrCancel);
 	//	Test notification occurs under ENotifyEntry
 		fs.NotifyChange(ENotifyEntry,reqStat,path);
-		test_Value(reqStat.Int(), reqStat==KRequestPending);
+		test(reqStat==KRequestPending);
 		r=TheFs.SetVolumeLabel(currentVolName,driveNum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		User::WaitForRequest(reqStat);
-		test_KErrNone(reqStat.Int());
+		test(reqStat==KErrNone);
 		r=TheFs.Volume(volInfo,driveNum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(volInfo.iName==currentVolName);
 		}
 
@@ -2134,29 +2135,31 @@
 
 	test.Next(_L("RFs::Rename()"));
 	fs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Toto.doc"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Toto.doc"),_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"));
-	test_KErrNone(r);
-
-	if(!Is_SimulatedSystemDrive(TheFs,driveNum))
-		{// Skip emulator/PlatSim drive C:
+	test(r==KErrNone);
+
+#if defined(__WINS__)
+	if(gSessionPath[0]=='Y'||gSessionPath[0]=='X')
+#endif
+		{
 		test.Next(_L("RFs::Rename() with max path length"));
 		TFileName longName=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\");
 		while(longName.Length()<(KMaxFileName-2))
 			longName+=_L("a");
 		r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),longName);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		fs.NotifyChange(ENotifyEntry,reqStat,longName);
-		test_Value(reqStat.Int(), reqStat==KRequestPending);
+		test(reqStat==KRequestPending);
 		r=TheFs.Rename(longName,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"));
-		test_KErrNone(r);
+		test(r==KErrNone);
 		User::WaitForRequest(reqStat);
-		test_KErrNone(reqStat.Int());
+		test(reqStat==KErrNone);
 		}
 
 	fs.Close();
@@ -2172,9 +2175,9 @@
 //
 	RFs fs;					//	Session to be notified when a change occurs
 	TInt r=fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 //	RFile::Write() to a file in the subtree
 	test.Next(_L("RFile::Write()"));
@@ -2184,48 +2187,48 @@
 
 	RFile file;
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	r=file.Write(0,_L8("Pay no attention to the man behind the curtain"));
 	file.Close();
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFile::Read() a file within the monitored directory - no notification for reads
 	fs.NotifyChange(ENotifyAll,reqStat,path);
 	TBuf8<100> temp;
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	r=file.Read(0,temp,100);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 
 //	RFile::SetAtt() of a file within the monitored directory
 	test.Next(_L("RFile::SetAtt()"));
 	r=file.SetAtt(KEntryAttNormal,KEntryAttHidden);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFile::SetSize() of a file within the monitored directory
 	test.Next(_L("RFile::SetSize()"));
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=file.SetSize(256);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	file.Close();
 
 //	RFile::Temp() to create a temp file in the subtree
 	test.Next(_L("RFile::Temp()"));
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	TFileName fileName;
 	r=file.Temp(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"),fileName,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	file.Close();
 
 //	RFile::SetModified() to change modification time of a file within monitored dir
@@ -2234,118 +2237,118 @@
 	TTime now;
 	now.HomeTime();
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	file.SetModified(now);
 	file.Close();
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFs::Entry() to change a directory entry within the monitored directory
 	test.Next(_L("RFs::Entry()"));
 	fs.NotifyChange(ENotifyAll,reqStat,path);
 	TEntry entry;
 	r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),entry);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	now.HomeTime();
 	r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),now,KEntryAttHidden,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFile::Set() to change file's modification time and attributes
 	test.Next(_L("RFile::Set()"));
 	fs.NotifyChange(ENotifyAll,reqStat,path);
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	now.HomeTime();
 	r=file.Set(now,KEntryAttNormal,KEntryAttHidden);
 	file.Close();
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFs::SetDriveName()
 	test.Next(_L("RFs::SetDriveName()"));
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	User::After(KNotifyChangeAfter);
 	r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	fs.NotifyChange(ENotifyEntry,reqStat,path);
 	r=TheFs.SetDriveName(KDefaultDrive,_L("TEST"));
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	User::After(KNotifyChangeAfter);
 	fs.NotifyChangeCancel(reqStat);
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 	fs.NotifyChange(ENotifyDisk,reqStat,path);
 	User::After(KNotifyChangeAfter);
 	r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVE"));
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	fs.NotifyChangeCancel(reqStat);
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 
 //	RFs::MkDir()
 	test.Next(_L("RFs::MkDir()"));
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFs::RmDir()
 	test.Next(_L("RFs::RmDir()"));
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFile::Create()
 	test.Next(_L("RFile::Create()"));
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	file.Close();
 
 //	RFs::Delete()
 	test.Next(_L("RFs::Delete()"));
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFile::Replace()
 	test.Next(_L("RFile::Replace()"));
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	file.Close();
 
 //	RFs::Delete()
 	test.Next(_L("RFs::Delete()"));
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFs::SetVolumeLabel() - should be notification under relevant TNotifyType monitoring
 //	The operation is non-path specific so all outstanding interested requests are notified
@@ -2357,52 +2360,52 @@
 	TVolumeInfo volInfo;
 	TFileName currentVolName;
 	r=TheFs.Volume(volInfo,driveNum);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	currentVolName=volInfo.iName;
 
 	r=TheFs.SetVolumeLabel(_L("VOL"),driveNum);
 	if (r==KErrNone)
 		{
 		User::WaitForRequest(reqStat);
-		test_KErrNone(reqStat.Int());
+		test(reqStat==KErrNone);
 		r=TheFs.Volume(volInfo,driveNum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(volInfo.iName==_L("VOL"));
 	//	Test notification occurs under ENotifyDisk
 		fs.NotifyChange(ENotifyDisk,reqStat,path);
-		test_Value(reqStat.Int(), reqStat==KRequestPending);
+		test(reqStat==KRequestPending);
 		r=TheFs.SetVolumeLabel(_L("ABCDEFGHIJK"),driveNum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		User::WaitForRequest(reqStat);
-		test_KErrNone(reqStat.Int());
+		test(reqStat==KErrNone);
 		r=TheFs.Volume(volInfo,driveNum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 
 		test(volInfo.iName==_L("ABCDEFGHIJK"));
 
 	//	Test notification does not occur under ENotifyAttributes
 		fs.NotifyChange(ENotifyAttributes,reqStat,path);
 		r=TheFs.SetVolumeLabel(_L("TROPICANA"),driveNum);
-		test_KErrNone(r);
-		test_Value(reqStat.Int(), reqStat==KRequestPending);
+		test(r==KErrNone);
+		test(reqStat==KRequestPending);
 		r=TheFs.Volume(volInfo,driveNum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 
 		test(volInfo.iName==_L("TROPICANA"));
 
 		fs.NotifyChangeCancel(reqStat);
 		User::WaitForRequest(reqStat);
-		test_Value(reqStat.Int(), reqStat==KErrCancel);
+		test(reqStat==KErrCancel);
 	//	Test notification occurs under ENotifyEntry
 		fs.NotifyChange(ENotifyEntry,reqStat,path);
-		test_Value(reqStat.Int(), reqStat==KRequestPending);
+		test(reqStat==KRequestPending);
 		r=TheFs.SetVolumeLabel(currentVolName,driveNum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		User::WaitForRequest(reqStat);
-		test_KErrNone(reqStat.Int());
+		test(reqStat==KErrNone);
 		r=TheFs.Volume(volInfo,driveNum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(volInfo.iName==currentVolName);
 		}
 
@@ -2417,18 +2420,18 @@
 
 //	Test that notification is made when change is made to monitored directory
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	fs.Close();
 	}
 
@@ -2442,9 +2445,9 @@
 //
 	RFs fs;
 	TInt r=fs.Connect();	//	Session to be notified when a change occurs
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 //	RFile::Write() to a file in the subtree
 	TFileName path=_L("\\F32-TST\\NOTIFY\\");
@@ -2453,35 +2456,35 @@
 
 	RFile file;
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	r=file.Write(0,_L8("Pay no attention to the man behind the curtain"));
 	file.Close();
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFile::Read() a file within the monitored directory - no notification for reads
 	fs.NotifyChange(ENotifyAll,reqStat,path);
 	TBuf8<100> temp;
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	r=file.Read(0,temp,100);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 
 //	RFile::SetAtt() of a file within the monitored directory
 	r=file.SetAtt(KEntryAttNormal,KEntryAttHidden);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFile::SetSize() of a file within the monitored directory
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=file.SetSize(256);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	file.Close();
 
 
@@ -2490,109 +2493,109 @@
 	TTime now;
 	now.HomeTime();
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	file.SetModified(now);
 	file.Close();
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFs::Entry() to change a directory entry within the monitored directory
 	fs.NotifyChange(ENotifyAll,reqStat,path);
 	TEntry entry;
 	r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),entry);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	now.HomeTime();
 	r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),now,KEntryAttHidden,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFile::Set() to change file's modification time and attributes
 	fs.NotifyChange(ENotifyAll,reqStat,path);
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	now.HomeTime();
 	r=file.Set(now,KEntryAttNormal,KEntryAttHidden);
 	file.Close();
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFs::SetDriveName() - should be no notification ever with extended notification
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	User::After(KNotifyChangeAfter);
 	r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	fs.NotifyChange(ENotifyEntry,reqStat,path);
 	User::After(KNotifyChangeAfter);
 	r=TheFs.SetDriveName(KDefaultDrive,_L("TEST"));
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	fs.NotifyChangeCancel(reqStat);
 	User::WaitForRequest(reqStat);
 	fs.NotifyChange(ENotifyDisk,reqStat,path);
 	User::After(KNotifyChangeAfter);
 	r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVE"));
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	fs.NotifyChangeCancel(reqStat);
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 
 
 //	RFs::MkDir()
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFs::RmDir()
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFile::Create()
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	file.Close();
 
 //	RFs::Delete()
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFile::Replace()
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	file.Close();
 
 //	RFs::Delete()
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	RFs::SetVolumeLabel()
 //	Not path specific, so all outstanding requests of correct TNotifyType are notified
@@ -2601,52 +2604,52 @@
 	TVolumeInfo volInfo;
 	TFileName currentVolName;
 	r=TheFs.Volume(volInfo,driveNum);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	currentVolName=volInfo.iName;
 
 	r=TheFs.SetVolumeLabel(_L("VOL"),driveNum);
 	if (r==KErrNone)
 		{
 		User::WaitForRequest(reqStat);
-		test_KErrNone(reqStat.Int());
+		test(reqStat==KErrNone);
 		r=TheFs.Volume(volInfo,driveNum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(volInfo.iName==_L("VOL"));
 	//	Test notification occurs under ENotifyDisk
 		fs.NotifyChange(ENotifyDisk,reqStat,path);
-		test_Value(reqStat.Int(), reqStat==KRequestPending);
+		test(reqStat==KRequestPending);
 		r=TheFs.SetVolumeLabel(_L("ABCDEFGHIJK"),driveNum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		User::WaitForRequest(reqStat);
-		test_KErrNone(reqStat.Int());
+		test(reqStat==KErrNone);
 		r=TheFs.Volume(volInfo,driveNum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 
 		test(volInfo.iName==_L("ABCDEFGHIJK"));
 
 	//	Test notification does not occur under ENotifyAttributes
 		fs.NotifyChange(ENotifyAttributes,reqStat,path);
 		r=TheFs.SetVolumeLabel(_L("TROPICANA"),driveNum);
-		test_KErrNone(r);
-		test_Value(reqStat.Int(), reqStat==KRequestPending);
+		test(r==KErrNone);
+		test(reqStat==KRequestPending);
 		r=TheFs.Volume(volInfo,driveNum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 
 		test(volInfo.iName==_L("TROPICANA"));
 
 		fs.NotifyChangeCancel(reqStat);
 		User::WaitForRequest(reqStat);
-		test_Value(reqStat.Int(), reqStat==KErrCancel);
+		test(reqStat==KErrCancel);
 	//	Test notification occurs under ENotifyEntry
 		fs.NotifyChange(ENotifyEntry,reqStat,path);
-		test_Value(reqStat.Int(), reqStat==KRequestPending);
+		test(reqStat==KRequestPending);
 		r=TheFs.SetVolumeLabel(currentVolName,driveNum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		User::WaitForRequest(reqStat);
-		test_KErrNone(reqStat.Int());
+		test(reqStat==KErrNone);
 		r=TheFs.Volume(volInfo,driveNum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(volInfo.iName==currentVolName);
 		}
 
@@ -2659,26 +2662,26 @@
 
 //	RFs::Rename()
 	fs.NotifyChange(ENotifyEntry,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Toto.doc"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 //	Test that notification is made when change is made to monitored directory
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 	fs.Close();
 	}
 
@@ -2693,20 +2696,20 @@
 
 	RFile file;
 	TInt r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\kangaroo.txt"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\koala.txt"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\dingo.txt"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	RFs fs;
 	r=fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TRequestStatus reqStat1(KRequestPending);
 	TFileName path1=_L("\\F32-TST\\NOTIFY\\");
@@ -2756,66 +2759,66 @@
 
 
 	r=gSleepThread.CreateLocal(0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RThread thread1;
 	r=thread1.Create(_L("TestThread1"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread1.Resume();
 	gSleepThread.Wait();
 
-	test_Value(status1.Int(), status1==KRequestPending);
-	test_Value(status2.Int(), status2==KRequestPending);
-	test_Value(status3.Int(), status3==KRequestPending);
-	test_Value(status4.Int(), status4==KRequestPending);
-	test_Value(status5.Int(), status5==KRequestPending);
-	test_Value(status6.Int(), status6==KRequestPending);
-
-	test_Value(statusExtended1.Int(), statusExtended1==KRequestPending);
-	test_Value(statusExtended2.Int(), statusExtended2==KRequestPending);
-	test_Value(statusExtended3.Int(), statusExtended3==KRequestPending);
-	test_Value(statusExtended4.Int(), statusExtended4==KRequestPending);
-	test_Value(statusExtended5.Int(), statusExtended5==KRequestPending);
-	test_Value(statusExtended6.Int(), statusExtended6==KRequestPending);
-
-	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(status1==KRequestPending);
+	test(status2==KRequestPending);
+	test(status3==KRequestPending);
+	test(status4==KRequestPending);
+	test(status5==KRequestPending);
+	test(status6==KRequestPending);
+
+	test(statusExtended1==KRequestPending);
+	test(statusExtended2==KRequestPending);
+	test(statusExtended3==KRequestPending);
+	test(statusExtended4==KRequestPending);
+	test(statusExtended5==KRequestPending);
+	test(statusExtended6==KRequestPending);
+
+	test(reqStat1==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\kangaroo.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat1);
-	test_KErrNone(reqStat1.Int());
+	test(reqStat1==KErrNone);
 	User::WaitForRequest(status1);
-	test_KErrNone(status1.Int());
+	test(status1==KErrNone);
 	User::WaitForRequest(status2);
-	test_KErrNone(status2.Int());
+	test(status2==KErrNone);
 	User::WaitForRequest(status3);
-	test_KErrNone(status3.Int());
+	test(status3==KErrNone);
 	User::WaitForRequest(status4);
-	test_KErrNone(status4.Int());
+	test(status4==KErrNone);
 	User::WaitForRequest(status5);
-	test_KErrNone(status5.Int());
+	test(status5==KErrNone);
 	User::WaitForRequest(status6);
-	test_KErrNone(status6.Int());
+	test(status6==KErrNone);
 
 	User::WaitForRequest(statusExtended1);
-	test_KErrNone(statusExtended1.Int());
+	test(statusExtended1==KErrNone);
 	User::WaitForRequest(statusExtended2);
-	test_KErrNone(statusExtended2.Int());
+	test(statusExtended2==KErrNone);
 	User::WaitForRequest(statusExtended3);
-	test_KErrNone(statusExtended3.Int());
+	test(statusExtended3==KErrNone);
 	User::WaitForRequest(statusExtended4);
-	test_KErrNone(statusExtended4.Int());
+	test(statusExtended4==KErrNone);
 	User::WaitForRequest(statusExtended5);
-	test_KErrNone(statusExtended5.Int());
+	test(statusExtended5==KErrNone);
 	User::WaitForRequest(statusExtended6);
-	test_KErrNone(statusExtended6.Int());
+	test(statusExtended6==KErrNone);
 
 	User::WaitForRequest(reqStat2);
-	test_KErrNone(reqStat2.Int());
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 	fs.NotifyChangeCancel();	//	Cancels both remaining notification requests
 
 	User::WaitForRequest(reqStat3);
@@ -2826,32 +2829,32 @@
 
 	test.Next(_L("Test reads and writes do cause notification under ENotifyAll"));
 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\kangaroo.txt"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	fs.NotifyChange(ENotifyAll,reqStat1,path1);
 	fs.NotifyChange(ENotifyEntry,reqStat2,path2);
 	fs.NotifyChange(ENotifyAll,reqStat3,path3);
 	fs.NotifyChange(ENotifyEntry,reqStat4,path4);
-	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat1==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	r=gSleepThread.CreateLocal(0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RThread thread2;
 	r=thread2.Create(_L("TestThread2"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread2.Resume();
 	gSleepThread.Wait();
 
 	User::WaitForRequest(reqStat1);
-	test_KErrNone(reqStat1.Int());
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
+	test(reqStat1==KErrNone);
+	test(reqStat2==KRequestPending);
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat3.Int());
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat3==KErrNone);
+	test(reqStat4==KRequestPending);
 
 	gSleepThread.Close();
 	thread2.Close();
@@ -2859,55 +2862,55 @@
 	fs.NotifyChange(ENotifyAll,reqStat1,path1);
 	fs.NotifyChange(ENotifyAll,reqStat3,path3);
 
-	test_Value(reqStat1.Int(), reqStat1==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat1==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	r=gSleepThread.CreateLocal(0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RThread thread3;
 	r=thread3.Create(_L("TestThread3"),ThreadEntryPoint,0x4000,KHeapSize,KHeapSize,(TAny*)ETest5);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread3.Resume();
 	gSleepThread.Wait();
 
 	User::WaitForRequest(reqStat1);
-	test_KErrNone(reqStat1.Int());
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);	//	Monitoring with ENotifyEntry
+	test(reqStat1==KErrNone);
+	test(reqStat2==KRequestPending);	//	Monitoring with ENotifyEntry
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat3.Int());
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);	//	Monitoring with ENotifyEntry
+	test(reqStat3==KErrNone);
+	test(reqStat4==KRequestPending);	//	Monitoring with ENotifyEntry
 
 	RFs fs2;
 	r=fs2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs2.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TRequestStatus reqStat(KRequestPending);
 	fs2.NotifyChange(ENotifyEntry,reqStat);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\kangaroo.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat2);
-	test_KErrNone(reqStat2.Int());
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat2==KErrNone);
+	test(reqStat4==KRequestPending);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
+	test(reqStat==KErrNone);
 
 	fs2.NotifyChange(ENotifyAll,reqStat);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\koala.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KErrNone);
+	test(reqStat4==KRequestPending);
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\dingo.txt"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat4);
-	test_KErrNone(reqStat4.Int());
+	test(reqStat4==KErrNone);
 
 	gSleepThread.Close();
 	thread3.Close();
@@ -2925,9 +2928,9 @@
 //
 	RFs fs;
 	TInt r=fs.Connect();	//	Session to be notified of any changes
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs.SetSessionPath(gSessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 //	RFile::Write() to a file within the monitored directory
 	test.Next(_L("RFile::Write()"));
@@ -2943,7 +2946,7 @@
 
 	RFile file;
 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	fs.NotifyChange(ENotifyAll,reqStat,path);
 	fs.NotifyChange(ENotifyFile,reqStat2,path);
@@ -2954,43 +2957,43 @@
 	fs.NotifyChange(ENotifyDisk,reqStat7,path);
 
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrArgument); //	Cannot monitor a file with ENotifyDir
-	test_Value(reqStat5.Int(), reqStat5==KRequestPending);
-	test_Value(reqStat6.Int(), reqStat6==KRequestPending);
+	test(reqStat4==KErrArgument); //	Cannot monitor a file with ENotifyDir
+	test(reqStat5==KRequestPending);
+	test(reqStat6==KRequestPending);
 	fs.NotifyChange(ENotifyEntry,reqStat4,path);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	r=file.Write(0,_L8("Pay no attention to the man behind the curtain"));
 	file.Close();
 
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);	//	Monitoring with ENotifyFile
+	test(reqStat==KErrNone);
+	test(reqStat2==KRequestPending);	//	Monitoring with ENotifyFile
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat3.Int());
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);	//	Monitoring with ENotifyEntry
-	test_Value(reqStat5.Int(), reqStat5==KRequestPending);
-	test_Value(reqStat6.Int(), reqStat6==KRequestPending);
-	test_Value(reqStat7.Int(), reqStat7==KRequestPending);
+	test(reqStat3==KErrNone);
+	test(reqStat4==KRequestPending);	//	Monitoring with ENotifyEntry
+	test(reqStat5==KRequestPending);
+	test(reqStat6==KRequestPending);
+	test(reqStat7==KRequestPending);
 	fs.NotifyChangeCancel();			//	Cancels all outstanding notification requests
 
 	User::WaitForRequest(reqStat2);
-	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+	test(reqStat2==KErrCancel);
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+	test(reqStat4==KErrCancel);
 	User::WaitForRequest(reqStat5);
-	test_Value(reqStat5.Int(), reqStat5==KErrCancel);
+	test(reqStat5==KErrCancel);
 	User::WaitForRequest(reqStat6);
-	test_Value(reqStat6.Int(), reqStat6==KErrCancel);
+	test(reqStat6==KErrCancel);
 	User::WaitForRequest(reqStat7);
-	test_Value(reqStat7.Int(), reqStat7==KErrCancel);
+	test(reqStat7==KErrCancel);
 
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 //	RFile::SetAtt() of a file within the monitored directory
 	fs.NotifyChange(ENotifyAll,reqStat,path);
@@ -3001,88 +3004,88 @@
 	fs.NotifyChange(ENotifyWrite,reqStat6,path);
 	fs.NotifyChange(ENotifyDisk,reqStat7,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 	User::WaitForRequest(reqStat5);
-	test_Value(reqStat5.Int(), reqStat5==KErrArgument);
-	test_Value(reqStat6.Int(), reqStat6==KRequestPending);
-	test_Value(reqStat7.Int(), reqStat7==KRequestPending);
+	test(reqStat5==KErrArgument);
+	test(reqStat6==KRequestPending);
+	test(reqStat7==KRequestPending);
 
 	test.Next(_L("RFile::SetAtt()"));
 	r=file.SetAtt(KEntryAttSystem,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat4);
-	test_KErrNone(reqStat.Int());
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);	//	Monitoring with ENotifyFile
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);	//	Monitoring with ENotifyEntry
-	test_KErrNone(reqStat4.Int());				//	Monitoring a file - can't use ENotifyDir
-	test_Value(reqStat6.Int(), reqStat6==KRequestPending);
-	test_Value(reqStat7.Int(), reqStat7==KRequestPending);
+	test(reqStat==KErrNone);
+	test(reqStat2==KRequestPending);	//	Monitoring with ENotifyFile
+	test(reqStat3==KRequestPending);	//	Monitoring with ENotifyEntry
+	test(reqStat4==KErrNone);				//	Monitoring a file - can't use ENotifyDir
+	test(reqStat6==KRequestPending);
+	test(reqStat7==KRequestPending);
 
 	fs.NotifyChange(ENotifyWrite,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	fs.NotifyChange(ENotifyDir,reqStat4,path);
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrArgument);
+	test(reqStat4==KErrArgument);
 	r=file.SetAtt(KEntryAttNormal,KEntryAttSystem);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);		//	Monitoring with ENotifyWrite
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);		//	Monitoring with ENotifyWrite
 	fs.NotifyChangeCancel();	//	Cancel outstanding notification request
 
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 	User::WaitForRequest(reqStat2);
-	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+	test(reqStat2==KErrCancel);
 	User::WaitForRequest(reqStat3);
-	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+	test(reqStat3==KErrCancel);
 	User::WaitForRequest(reqStat6);
-	test_Value(reqStat6.Int(), reqStat6==KErrCancel);
+	test(reqStat6==KErrCancel);
 	User::WaitForRequest(reqStat7);
-	test_Value(reqStat7.Int(), reqStat7==KErrCancel);
+	test(reqStat7==KErrCancel);
 
 	fs.NotifyChange(ENotifyAll,reqStat,path);
 	fs.NotifyChange(ENotifyFile,reqStat2,path);
 	fs.NotifyChange(ENotifyEntry,reqStat3,path);
 	fs.NotifyChange(ENotifyAttributes,reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 //	RFile::SetSize() of a file within the monitored directory
 	test.Next(_L("RFile::SetSize()"));
 	r=file.SetSize(256);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat4);
-	test_KErrNone(reqStat.Int());
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);	//	Monitoring with ENotifyFile
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);	//	Monitoring with ENotifyEntry
-	test_KErrNone(reqStat4.Int());
+	test(reqStat==KErrNone);
+	test(reqStat2==KRequestPending);	//	Monitoring with ENotifyFile
+	test(reqStat3==KRequestPending);	//	Monitoring with ENotifyEntry
+	test(reqStat4==KErrNone);
 
 	fs.NotifyChange(ENotifyWrite,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	fs.NotifyChange(ENotifyDir,reqStat4,path);
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrArgument);
+	test(reqStat4==KErrArgument);
 	r=file.SetSize(200);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::After(1000000);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);		//	Monitoring with ENotifyWrite
+	test(reqStat==KRequestPending);		//	Monitoring with ENotifyWrite
 
 	file.Close();
 	fs.NotifyChangeCancel();			//	Cancels all outstanding notification requests
 
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 	User::WaitForRequest(reqStat2);
-	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+	test(reqStat2==KErrCancel);
 	User::WaitForRequest(reqStat3);
-	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+	test(reqStat3==KErrCancel);
 
 //	RFile::Temp() to create a temp file within the monitored directory
 	test.Next(_L("RFile::Temp()"));
@@ -3093,47 +3096,47 @@
 	fs.NotifyChange(ENotifyEntry,reqStat3,path);
 	fs.NotifyChange(ENotifyAttributes,reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	TFileName fileName;
 	r=file.Temp(TheFs,path,fileName,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);	//	Monitoring ENotifyEntry
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);	//	Monitoring ENotifyAttributes
+	test(reqStat==KErrNone);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);	//	Monitoring ENotifyEntry
+	test(reqStat4==KRequestPending);	//	Monitoring ENotifyAttributes
 	file.Close();
 	fs.NotifyChangeCancel();
 
 	User::WaitForRequest(reqStat2);
-	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+	test(reqStat2==KErrCancel);
 	User::WaitForRequest(reqStat3);
-	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+	test(reqStat3==KErrCancel);
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+	test(reqStat4==KErrCancel);
 
 	fs.NotifyChange(ENotifyFile,reqStat,path);
 	fs.NotifyChange(ENotifyDisk,reqStat2,path);
 	fs.NotifyChange(ENotifyWrite,reqStat3,path);
 	r=file.Temp(TheFs,path,fileName,EFileWrite);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);	//	Monitoring ENotifyFile
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);	//	Monitoring ENotifyDisk
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);	//	Monitoring ENotifyWrite
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);		//	Monitoring ENotifyFile
+	test(reqStat2==KRequestPending);	//	Monitoring ENotifyDisk
+	test(reqStat3==KRequestPending);	//	Monitoring ENotifyWrite
 	file.Close();
 
 	fs.NotifyChangeCancel();	//	Cancels all outstanding notification requests
 
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 	User::WaitForRequest(reqStat2);
-	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+	test(reqStat2==KErrCancel);
 	User::WaitForRequest(reqStat3);
-	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+	test(reqStat3==KErrCancel);
 
 //	RFile::SetModified() to change modification time of a file within monitored dir
 	test.Next(_L("RFile::SetModified()"));
@@ -3143,30 +3146,30 @@
 	fs.NotifyChange(ENotifyAttributes,reqStat3,path);
 	fs.NotifyChange(ENotifyFile,reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	TTime now;
 	now.HomeTime();
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileWrite);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	file.SetModified(now);
 	file.Close();
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
+	test(reqStat==KErrNone);
+	test(reqStat2==KRequestPending);
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat3.Int());
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat3==KErrNone);
+	test(reqStat4==KRequestPending);
 	fs.NotifyChangeCancel();
 
 	User::WaitForRequest(reqStat2);
-	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+	test(reqStat2==KErrCancel);
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+	test(reqStat4==KErrCancel);
 
 //	RFs::SetEntry() to change a directory entry within the monitored directory
 	test.Next(_L("RFs::SetEntry()"));
@@ -3176,28 +3179,28 @@
 	fs.NotifyChange(ENotifyAttributes,reqStat3,path);
 	fs.NotifyChange(ENotifyDisk,reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\NewFile.txt"),entry);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	now.HomeTime();
 	r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\NewFile.txt"),now,KEntryAttHidden,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat.Int());
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_KErrNone(reqStat3.Int());
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KErrNone);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KErrNone);
+	test(reqStat4==KRequestPending);
 	fs.NotifyChangeCancel();
 
 	User::WaitForRequest(reqStat2);
-	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+	test(reqStat2==KErrCancel);
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+	test(reqStat4==KErrCancel);
 
 //	RFile::Set() to change file's modification time and attributes
 	test.Next(_L("RFile::Set()"));
@@ -3206,29 +3209,29 @@
 	fs.NotifyChange(ENotifyAttributes,reqStat3,path);
 	fs.NotifyChange(ENotifyWrite,reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileWrite);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	now.HomeTime();
 	r=file.Set(now,KEntryAttNormal,KEntryAttHidden);
 	file.Close();
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat.Int());
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_KErrNone(reqStat3.Int());
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KErrNone);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KErrNone);
+	test(reqStat4==KRequestPending);
 	fs.NotifyChangeCancel();
 
 	User::WaitForRequest(reqStat2);
-	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+	test(reqStat2==KErrCancel);
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+	test(reqStat4==KErrCancel);
 
 //	RFs::SetDriveName()
 
@@ -3238,27 +3241,27 @@
 	fs.NotifyChange(ENotifyDisk,reqStat3,path);
 	fs.NotifyChange(ENotifyAttributes,reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 	User::After(KNotifyChangeAfter);
 
 	r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
-	test_KErrNone(reqStat.Int());
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KErrNone);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 	fs.NotifyChangeCancel();
 
 	User::WaitForRequest(reqStat2);
-	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+	test(reqStat2==KErrCancel);
 	User::WaitForRequest(reqStat3);
-	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+	test(reqStat3==KErrCancel);
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+	test(reqStat4==KErrCancel);
 
 //	RFs::MkDir()
 	test.Next(_L("RFs::MkDir()"));
@@ -3269,20 +3272,20 @@
 	fs.NotifyChange(ENotifyDir,reqStat3,path);
 	fs.NotifyChange(ENotifyFile,reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat.Int());
-	test_KErrNone(reqStat2.Int());
-	test_KErrNone(reqStat3.Int());
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KErrNone);
+	test(reqStat4==KRequestPending);
 
 //	RFs::RmDir()
 	test.Next(_L("RFs::RmDir()"));
@@ -3290,24 +3293,24 @@
 	fs.NotifyChange(ENotifyDir,reqStat2,path);
 	fs.NotifyChange(ENotifyWrite,reqStat3,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
 
 	r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat2);
-	test_KErrNone(reqStat.Int());
-	test_KErrNone(reqStat2.Int());
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 	fs.NotifyChangeCancel();
 
 	User::WaitForRequest(reqStat3);
-	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+	test(reqStat3==KErrCancel);
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+	test(reqStat4==KErrCancel);
 
 //	RFile::Create()
 	test.Next(_L("RFile::Create()"));
@@ -3316,20 +3319,20 @@
 	fs.NotifyChange(ENotifyDir,reqStat3,path);
 	fs.NotifyChange(ENotifyFile,reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\Good_Witch.bat"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat4);
-	test_KErrNone(reqStat.Int());
-	test_KErrNone(reqStat2.Int());
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);	//	Monitoring ENotifyDir
-	test_KErrNone(reqStat4.Int());
+	test(reqStat==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KRequestPending);	//	Monitoring ENotifyDir
+	test(reqStat4==KErrNone);
 	file.Close();
 	fs.NotifyChangeCancel(reqStat3);
 	User::WaitForRequest(reqStat3);
@@ -3339,26 +3342,26 @@
 	fs.NotifyChange(ENotifyDisk,reqStat3,path);
 	fs.NotifyChange(ENotifyWrite,reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\Bad_Witch.bat"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat2);
-	test_KErrNone(reqStat.Int());
-	test_KErrNone(reqStat2.Int());
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 	file.Close();
 	fs.NotifyChangeCancel();
 
 	User::WaitForRequest(reqStat3);
-	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+	test(reqStat3==KErrCancel);
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+	test(reqStat4==KErrCancel);
 
 //	RFs::Delete()
 	test.Next(_L("RFs::Delete()"));
@@ -3367,46 +3370,46 @@
 	fs.NotifyChange(ENotifyDir,reqStat3,path);
 	fs.NotifyChange(ENotifyFile,reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Good_Witch.bat"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat4);
-	test_KErrNone(reqStat.Int());
-	test_KErrNone(reqStat2.Int());
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);	//	Monitoring ENotifyDir
-	test_KErrNone(reqStat4.Int());
+	test(reqStat==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KRequestPending);	//	Monitoring ENotifyDir
+	test(reqStat4==KErrNone);
 	fs.NotifyChangeCancel(reqStat3);
 	User::WaitForRequest(reqStat3);
-	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+	test(reqStat3==KErrCancel);
 
 	fs.NotifyChange(ENotifyAll,reqStat,path);
 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
 	fs.NotifyChange(ENotifyAttributes,reqStat3,path);
 	fs.NotifyChange(ENotifyAll,reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Bad_Witch.bat"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat4);
-	test_KErrNone(reqStat.Int());
-	test_KErrNone(reqStat2.Int());
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_KErrNone(reqStat4.Int());
+	test(reqStat==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KErrNone);
 	fs.NotifyChangeCancel(reqStat3);
 	User::WaitForRequest(reqStat3);
-	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+	test(reqStat3==KErrCancel);
 
 //	RFile::Replace()
 	test.Next(_L("RFile::Replace()"));
@@ -3415,28 +3418,28 @@
 	fs.NotifyChange(ENotifyFile,reqStat3,path);
 	fs.NotifyChange(ENotifyDir,reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\Good_Witch.bat"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat.Int());
-	test_KErrNone(reqStat2.Int());
-	test_KErrNone(reqStat3.Int());
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KErrNone);
+	test(reqStat4==KRequestPending);
 	file.Close();
 	fs.NotifyChangeCancel();
 
-	test_KErrNone(reqStat.Int());
-	test_KErrNone(reqStat2.Int());
-	test_KErrNone(reqStat3.Int());
+	test(reqStat==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KErrNone);
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+	test(reqStat4==KErrCancel);
 
 //	RFs::Delete()
 	test.Next(_L("RFs::Delete()"));
@@ -3446,21 +3449,21 @@
 	fs.NotifyChange(ENotifyFile,reqStat3,path);
 	fs.NotifyChange(ENotifyDir,reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrArgument);
+	test(reqStat4==KErrArgument);
 
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Good_Witch.bat"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat.Int());
-	test_KErrNone(reqStat2.Int());
-	test_KErrNone(reqStat3.Int());
-	test_Value(reqStat4.Int(), reqStat4==KErrArgument);
+	test(reqStat==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KErrNone);
+	test(reqStat4==KErrArgument);
 
 //	RFs::SetVolumeLabel()
 	test.Next(_L("RFs::SetVolumeLabel()"));
@@ -3473,20 +3476,20 @@
 	fs.NotifyChange(ENotifyAttributes,reqStat6,path);
 	fs.NotifyChange(ENotifyDisk,reqStat7,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
-	test_Value(reqStat5.Int(), reqStat5==KRequestPending);
-	test_Value(reqStat6.Int(), reqStat6==KRequestPending);
-	test_Value(reqStat7.Int(), reqStat7==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
+	test(reqStat5==KRequestPending);
+	test(reqStat6==KRequestPending);
+	test(reqStat7==KRequestPending);
 
 	TInt driveNum=CurrentDrive();
 	TVolumeInfo volInfo;
 	TFileName currentVolName;
 	r=TheFs.Volume(volInfo,driveNum);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	currentVolName=volInfo.iName;
 
 	r=TheFs.SetVolumeLabel(_L("VOL"),driveNum);
@@ -3496,51 +3499,51 @@
 		User::WaitForRequest(reqStat2);
 		User::WaitForRequest(reqStat7);
 
-		test_KErrNone(reqStat.Int());
-		test_KErrNone(reqStat2.Int());
-		test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-		test_Value(reqStat4.Int(), reqStat4==KRequestPending);
-		test_Value(reqStat5.Int(), reqStat5==KRequestPending);
-		test_Value(reqStat6.Int(), reqStat6==KRequestPending);
-		test_KErrNone(reqStat7.Int());
+		test(reqStat==KErrNone);
+		test(reqStat2==KErrNone);
+		test(reqStat3==KRequestPending);
+		test(reqStat4==KRequestPending);
+		test(reqStat5==KRequestPending);
+		test(reqStat6==KRequestPending);
+		test(reqStat7==KErrNone);
 
 		fs.NotifyChange(ENotifyAll,reqStat,path);
 		fs.NotifyChange(ENotifyEntry,reqStat2,path);
 		fs.NotifyChange(ENotifyDisk,reqStat7,path);
 
-		test_Value(reqStat.Int(), reqStat==KRequestPending);
-		test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-		test_Value(reqStat7.Int(), reqStat7==KRequestPending);
+		test(reqStat==KRequestPending);
+		test(reqStat2==KRequestPending);
+		test(reqStat7==KRequestPending);
 
 		r=TheFs.SetVolumeLabel(currentVolName,driveNum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 
 		User::WaitForRequest(reqStat);
 		User::WaitForRequest(reqStat2);
 		User::WaitForRequest(reqStat7);
 
-		test_KErrNone(reqStat.Int());
-		test_KErrNone(reqStat2.Int());
-		test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-		test_Value(reqStat4.Int(), reqStat4==KRequestPending);
-		test_Value(reqStat5.Int(), reqStat5==KRequestPending);
-		test_Value(reqStat6.Int(), reqStat6==KRequestPending);
-		test_KErrNone(reqStat7.Int());
+		test(reqStat==KErrNone);
+		test(reqStat2==KErrNone);
+		test(reqStat3==KRequestPending);
+		test(reqStat4==KRequestPending);
+		test(reqStat5==KRequestPending);
+		test(reqStat6==KRequestPending);
+		test(reqStat7==KErrNone);
 
 		r=TheFs.Volume(volInfo,driveNum);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		test(volInfo.iName==currentVolName);
 
 		fs.NotifyChangeCancel();
 
 		User::WaitForRequest(reqStat3);
-		test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+		test(reqStat3==KErrCancel);
 		User::WaitForRequest(reqStat4);
-		test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+		test(reqStat4==KErrCancel);
 		User::WaitForRequest(reqStat5);
-		test_Value(reqStat5.Int(), reqStat5==KErrCancel);
+		test(reqStat5==KErrCancel);
 		User::WaitForRequest(reqStat6);
-		test_Value(reqStat6.Int(), reqStat6==KErrCancel);
+		test(reqStat6==KErrCancel);
 		}
 
 	else	//	RFs::SetVolumeLabel() doesn't work on subst drives
@@ -3567,49 +3570,49 @@
 	fs.NotifyChange(ENotifyFile,reqStat3,path);
 	fs.NotifyChange(ENotifyDir,reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	r=file.Rename(_L("\\F32-TST\\NOTIFY\\OldFile.abc"));
-	test_Value(r, r == KErrNone||r==KErrAlreadyExists);
+	test(r==KErrNone||r==KErrAlreadyExists);
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat.Int());
-	test_KErrNone(reqStat2.Int());
-	test_KErrNone(reqStat3.Int());
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);	//	Monitoring ENotifyDir
+	test(reqStat==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KErrNone);
+	test(reqStat4==KRequestPending);	//	Monitoring ENotifyDir
 	file.Close();
 	fs.NotifyChangeCancel();
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+	test(reqStat4==KErrCancel);
 
 	path=_L("\\F32-TST\\NOTIFY\\OldFile.abc");
 
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\OldFile.abc"),EFileShareExclusive|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fs.NotifyChange(ENotifyAll,reqStat,path);
 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
 	fs.NotifyChange(ENotifyFile,reqStat3,path);
 	fs.NotifyChange(ENotifyDir,reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrArgument);
+	test(reqStat4==KErrArgument);
 
 	r=file.Rename(_L("\\F32-TST\\NOTIFY\\NewFile.xyz"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat.Int());
-	test_KErrNone(reqStat2.Int());
-	test_KErrNone(reqStat3.Int());
-	test_Value(reqStat4.Int(), reqStat4==KErrArgument);
+	test(reqStat==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KErrNone);
+	test(reqStat4==KErrArgument);
 	file.Close();
 
 //	RFs::Rename()
@@ -3620,27 +3623,27 @@
 	fs.NotifyChange(ENotifyFile,reqStat3,path);
 	fs.NotifyChange(ENotifyDir,reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\NewFile.xyz"),_L("\\F32-TST\\NOTIFY\\NewerFile.cat"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat.Int());
-	test_KErrNone(reqStat2.Int());
-	test_KErrNone(reqStat3.Int());
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);	//	Changed a file not a directory entry
+	test(reqStat==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KErrNone);
+	test(reqStat4==KRequestPending);	//	Changed a file not a directory entry
 	fs.NotifyChangeCancel();
 
-	test_KErrNone(reqStat.Int());
-	test_KErrNone(reqStat2.Int());
-	test_KErrNone(reqStat3.Int());
+	test(reqStat==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KErrNone);
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+	test(reqStat4==KErrCancel);
 
 	path=_L("\\F32-TST\\NOTIFY\\NewerFile.cat");
 	fs.NotifyChange(ENotifyAll,reqStat,path);
@@ -3648,20 +3651,20 @@
 	fs.NotifyChange(ENotifyFile,reqStat3,path);
 	fs.NotifyChange(ENotifyDir,reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrArgument);
+	test(reqStat4==KErrArgument);
 
 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\NewerFile.cat"),_L("\\F32-TST\\NOTIFY\\Original.dog"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat.Int());
-	test_KErrNone(reqStat2.Int());
-	test_KErrNone(reqStat3.Int());
+	test(reqStat==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KErrNone);
 
 	path=_L("\\F32-TST\\NOTIFY\\");
 	fs.NotifyChange(ENotifyAll,reqStat,path);
@@ -3669,22 +3672,22 @@
 	fs.NotifyChange(ENotifyFile,reqStat3,path);
 	fs.NotifyChange(ENotifyDir,reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\"),_L("\\F32-TST\\NOTIFY_TEMP\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat3);
 	User::WaitForRequest(reqStat4);
-	test_KErrNone(reqStat.Int());
-	test_KErrNone(reqStat2.Int());
-	test_KErrNone(reqStat3.Int());	//	Changed a directory entry but notified anyway despite
-	test_KErrNone(reqStat4.Int());	//	requesting file notification only because the path we
-									//	were monitoring has changed
+	test(reqStat==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KErrNone);	//	Changed a directory entry but notified anyway despite
+	test(reqStat4==KErrNone);	//	requesting file notification only because the path we
+								//	were monitoring has changed
 
 	path=_L("\\F32-TST\\NOTIFY_TEMP\\Original.dog");
 	fs.NotifyChange(ENotifyAll,reqStat,path);
@@ -3692,113 +3695,113 @@
 	fs.NotifyChange(ENotifyFile,reqStat3,path);
 	fs.NotifyChange(ENotifyDir,reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrArgument);
+	test(reqStat4==KErrArgument);
 
 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY_TEMP\\"),_L("\\F32-TST\\NOTIFY\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat.Int());			//	Modified a directory above the level at which we
-	test_KErrNone(reqStat2.Int());			//	are monitoring for changes - we must be notified
-	test_KErrNone(reqStat3.Int());			//	anyway because the path has changed
+	test(reqStat==KErrNone);			//	Modified a directory above the level at which we
+	test(reqStat2==KErrNone);			//	are monitoring for changes - we must be notified
+	test(reqStat3==KErrNone);			//	anyway because the path has changed
 
 	fs.NotifyChange(ENotifyAll,reqStat,path);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
+	test(reqStat2==KRequestPending);
 	fs.NotifyChange(ENotifyFile,reqStat3,path);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+	test(reqStat3==KRequestPending);
 
 	fs.NotifyChangeCancel(reqStat);
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 	fs.NotifyChangeCancel(reqStat2);
 	User::WaitForRequest(reqStat2);
-	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+	test(reqStat2==KErrCancel);
 	fs.NotifyChangeCancel(reqStat3);
 	User::WaitForRequest(reqStat3);
-	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+	test(reqStat3==KErrCancel);
 
 	path=_L("\\F32-TST\\NOTIFY\\Original.dog");
 	fs.NotifyChange(ENotifyAll,reqStat,path);
 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
 	fs.NotifyChange(ENotifyFile,reqStat3,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
 
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Original.dog"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat.Int());
-	test_KErrNone(reqStat2.Int());
-	test_KErrNone(reqStat3.Int());
+	test(reqStat==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KErrNone);
 
 	path=_L("\\F32-TST\\NOTIFY\\");
 	fs.NotifyChange(ENotifyAll,reqStat,path);
 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
 	fs.NotifyChange(ENotifyDir,reqStat3,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
 
 	r=TheFs.Rename(_L("\\F32-TST\\"),_L("\\F32-TEST\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat.Int());			//	Modified a directory above the level at which we
-	test_KErrNone(reqStat2.Int());			//	are monitoring for changes but we receive notification
-	test_KErrNone(reqStat3.Int());			//	because the notification path has been changed
+	test(reqStat==KErrNone);			//	Modified a directory above the level at which we
+	test(reqStat2==KErrNone);			//	are monitoring for changes but we receive notification
+	test(reqStat3==KErrNone);			//	because the notification path has been changed
 
 	fs.NotifyChange(ENotifyAll,reqStat,path);
 	//	Notification request is submitted, despite the subject's disappearance
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
 	//	Notification request is submitted, despite the subject's disappearance
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
+	test(reqStat2==KRequestPending);
 	fs.NotifyChange(ENotifyFile,reqStat3,path);
 	//	Notification request is submitted, despite the subject's disappearance
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+	test(reqStat3==KRequestPending);
 
 	fs.NotifyChangeCancel(reqStat);
 	User::WaitForRequest(reqStat);
-	test_Value(reqStat.Int(), reqStat==KErrCancel);
+	test(reqStat==KErrCancel);
 	fs.NotifyChangeCancel(reqStat2);
 	User::WaitForRequest(reqStat2);
-	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+	test(reqStat2==KErrCancel);
 	fs.NotifyChangeCancel(reqStat3);
 	User::WaitForRequest(reqStat3);
-	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+	test(reqStat3==KErrCancel);
 
 	path=_L("\\F32-TEST\\NOTIFY\\");
 	fs.NotifyChange(ENotifyAll,reqStat,path);
 	fs.NotifyChange(ENotifyEntry,reqStat2,path);
 	fs.NotifyChange(ENotifyDir,reqStat3,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
 
 	r=TheFs.Rename(_L("\\F32-TEST\\NOTIFY\\"),_L("\\F32-TEST\\NOTIFY_CHANGED\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat3);
 
-	test_KErrNone(reqStat.Int());			//	Rename the directory we were monitoring
-	test_KErrNone(reqStat2.Int());
-	test_KErrNone(reqStat3.Int());
+	test(reqStat==KErrNone);			//	Rename the directory we were monitoring
+	test(reqStat2==KErrNone);
+	test(reqStat3==KErrNone);
 
 //	Tidy up the test directory before continuing (while testing notifications of renaming to the monitored directory)
 
@@ -3808,26 +3811,26 @@
 	fs.NotifyChange(ENotifyDir,reqStat3,path);
 	fs.NotifyChange(ENotifyFile,reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	r=TheFs.Rename(_L("\\F32-TEST\\"),_L("\\F32-TST\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat3);
 
-	test_KErrNone(reqStat.Int());			//	Renaming to (under) the directory we were monitoring
-	test_KErrNone(reqStat2.Int());
-	test_KErrNone(reqStat3.Int());
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KErrNone);			//	Renaming to (under) the directory we were monitoring
+	test(reqStat2==KErrNone);
+	test(reqStat3==KErrNone);
+	test(reqStat4==KRequestPending);
 
 	fs.NotifyChangeCancel(reqStat4);
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+	test(reqStat4==KErrCancel);
 
 	path=_L("\\F32-TST\\NOTIFY\\");
 	fs.NotifyChange(ENotifyAll,reqStat,path);
@@ -3835,26 +3838,26 @@
 	fs.NotifyChange(ENotifyDir,reqStat3,path);
 	fs.NotifyChange(ENotifyFile,reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	r=TheFs.Rename(_L("\\F32-TST\\NOTIFY_CHANGED\\"),_L("\\F32-TST\\NOTIFY\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat3);
 
-	test_KErrNone(reqStat.Int());			//	Renaming to the directory we were monitoring
-	test_KErrNone(reqStat2.Int());
-	test_KErrNone(reqStat3.Int());
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KErrNone);			//	Renaming to the directory we were monitoring
+	test(reqStat2==KErrNone);
+	test(reqStat3==KErrNone);
+	test(reqStat4==KRequestPending);
 
 	fs.NotifyChangeCancel(reqStat4);
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+	test(reqStat4==KErrCancel);
 
 //	Test combinations of notify types
 	test.Next(_L("Test combinations of notify types"));
@@ -3865,24 +3868,24 @@
 	fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyFile),reqStat3,path);
 	fs.NotifyChange((TNotifyType)(ENotifyDisk|ENotifyAttributes),reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\Munchkin.msg"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat.Int());
-	test_KErrNone(reqStat2.Int());
-	test_KErrNone(reqStat3.Int());
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);	//	Monitoring ENotifyAttributes|ENotifyDisk
+	test(reqStat==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KErrNone);
+	test(reqStat4==KRequestPending);	//	Monitoring ENotifyAttributes|ENotifyDisk
 	file.Close();
 	fs.NotifyChangeCancel(reqStat4);
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+	test(reqStat4==KErrCancel);
 
 //	RFile::SetModified()
 	fs.NotifyChange(ENotifyAll,reqStat,path);
@@ -3890,28 +3893,28 @@
 	fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyFile),reqStat3,path);
 	fs.NotifyChange((TNotifyType)(ENotifyDisk|ENotifyAttributes),reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	TTime nowTime;
 	nowTime.HomeTime();
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\Munchkin.msg"),EFileRead|EFileWrite);
-	test_KErrNone(r);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(r==KErrNone);
+	test(reqStat==KRequestPending);
 	file.SetModified(now);
 	file.Close();
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat4);
-	test_KErrNone(reqStat.Int());
-	test_KErrNone(reqStat2.Int());
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_KErrNone(reqStat4.Int());
+	test(reqStat==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KErrNone);
 	fs.NotifyChangeCancel();
 	User::WaitForRequest(reqStat3);
-	test_Value(reqStat3.Int(), reqStat3==KErrCancel);
+	test(reqStat3==KErrCancel);
 
 //	RFile::Write()
 	fs.NotifyChange(ENotifyAll,reqStat,path);
@@ -3919,25 +3922,25 @@
 	fs.NotifyChange((TNotifyType)(ENotifyFile|ENotifyWrite),reqStat3,path);
 	fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyWrite),reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\Munchkin.msg"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(0,_L8("Pay no attention to the man behind the curtain"));
 	file.Close();
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat3);
 	User::WaitForRequest(reqStat4);
-	test_KErrNone(reqStat.Int());
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_KErrNone(reqStat3.Int());
-	test_KErrNone(reqStat4.Int());
+	test(reqStat==KErrNone);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KErrNone);
+	test(reqStat4==KErrNone);
 	fs.NotifyChangeCancel(reqStat2);	//	Cancels all outstanding notification requests
 	User::WaitForRequest(reqStat2);
-	test_Value(reqStat2.Int(), reqStat2==KErrCancel);
+	test(reqStat2==KErrCancel);
 
 //	RFs::Delete()
 	test.Next(_L("RFs::Delete()"));
@@ -3946,23 +3949,23 @@
 	fs.NotifyChange((TNotifyType)(ENotifyFile|ENotifyWrite),reqStat3,path);
 	fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyWrite),reqStat4,path);
 
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
-	test_Value(reqStat2.Int(), reqStat2==KRequestPending);
-	test_Value(reqStat3.Int(), reqStat3==KRequestPending);
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KRequestPending);
+	test(reqStat2==KRequestPending);
+	test(reqStat3==KRequestPending);
+	test(reqStat4==KRequestPending);
 
 	r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Munchkin.msg"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(reqStat);
 	User::WaitForRequest(reqStat2);
 	User::WaitForRequest(reqStat3);
-	test_KErrNone(reqStat.Int());
-	test_KErrNone(reqStat2.Int());
-	test_KErrNone(reqStat3.Int());
-	test_Value(reqStat4.Int(), reqStat4==KRequestPending);
+	test(reqStat==KErrNone);
+	test(reqStat2==KErrNone);
+	test(reqStat3==KErrNone);
+	test(reqStat4==KRequestPending);
 	fs.NotifyChangeCancel(reqStat4);
 	User::WaitForRequest(reqStat4);
-	test_Value(reqStat4.Int(), reqStat4==KErrCancel);
+	test(reqStat4==KErrCancel);
 
 	fs.Close();
 	}
@@ -3980,48 +3983,48 @@
 
 	RFs fs;
 	TInt r=fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	TDriveInfo driveInfo;
 	TInt driveNum = EDriveC + SocketToDrive[gSocketNumber];
 
 	// verify TDriveInfo.iType == EMediaHardDisk
 	r = fs.Drive(driveInfo, driveNum);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	test.Printf(_L("iType = %d\n"), driveInfo.iType);
 	test(driveInfo.iType == EMediaHardDisk);
 
 
 	// ask the user to eject the media
 	TheFs.NotifyChange(ENotifyEntry,reqStat);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	test.Printf(_L("Please eject media on drive %C...\n"), 'A' + driveNum);
 	User::WaitForRequest(reqStat);
 	test.Printf(_L("Done.\n"));
 	TInt reqInt=reqStat.Int();
-	test_KErrNone(reqInt);
+	test(reqInt==KErrNone);
 	User::WaitForRequest(reqStat);
 
 	// verify TDriveInfo.iType == EMediaNotPresent
 	r = fs.Drive(driveInfo, driveNum);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	test.Printf(_L("iType = %d\n"), driveInfo.iType);
 	test(driveInfo.iType == EMediaNotPresent);
 
 
 	// ask the user to re-insert the media
 	TheFs.NotifyChange(ENotifyEntry,reqStat);
-	test_Value(reqStat.Int(), reqStat==KRequestPending);
+	test(reqStat==KRequestPending);
 	test.Printf(_L("Please re-insert media...\n"));
 	User::WaitForRequest(reqStat);
 	test.Printf(_L("Done.\n"));
 	reqInt = reqStat.Int();
-	test_KErrNone(reqInt);
+	test(reqInt==KErrNone);
 	User::WaitForRequest(reqStat);
 
 	// verify TDriveInfo.iType == EMediaHardDisk
 	r = fs.Drive(driveInfo, driveNum);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	test.Printf(_L("iType = %d\n"), driveInfo.iType);
 	test(driveInfo.iType == EMediaHardDisk);
 
@@ -4055,39 +4058,39 @@
 	test.Next(_L("Test original behaviour of asynchronous read API"));
 	RFile reader;
 	TInt r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TBuf8<596> readBuf;
 	reader.Read(0, readBuf, 100, readStat1);
 	User::WaitForRequest(readStat1);
-	test_KErrNone(readStat1.Int());
-	test_Equal(0, readBuf.Length());
+	test(readStat1==KErrNone);
+	test(readBuf.Length()==0);
 	reader.Close();
 
 	test.Next(_L("Test asynchronous read fails in EFileShareExclusive mode"));
 	r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareExclusive);
-	test_Value(r, r == KErrArgument);
+	test(r==KErrArgument);
 
 	test.Next(_L("Test asynchronous read fails in EFileShareReadersOnly mode"));
 	r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareReadersOnly);
-	test_Value(r, r == KErrArgument);
+	test(r==KErrArgument);
 
 	test.Next(_L("Test asynchronous read is cancelled when file is closed"));
 	r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	reader.Read(0, readBuf, 100, readStat1);
-	test_Value(readStat1.Int(), readStat1==KRequestPending);
+	test(readStat1==KRequestPending);
 	reader.Close();
 	User::WaitForRequest(readStat1);
-	test_Value(readStat1.Int(), readStat1==KErrCancel);
+	test(readStat1==KErrCancel);
 
 	test.Next(_L("Test asynchronous read can be cancelled"));
 	r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	reader.Read(0, readBuf, 100, readStat1);
-	test_Value(readStat1.Int(), readStat1==KRequestPending);
+	test(readStat1==KRequestPending);
 	reader.ReadCancel(readStat1);
 	User::WaitForRequest(readStat1);
-	test_Value(readStat1.Int(), readStat1==KErrCancel);
+	test(readStat1==KErrCancel);
 	reader.Close();
 
 	// DEF105438: File server thread safety issues
@@ -4095,63 +4098,63 @@
 	// runs (to test whether cancelling still works...)
 	test.Next(_L("Test asynchronous read is cancelled when running at high priority"));
 	r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RThread	thisThread;
 	thisThread.SetPriority(EPriorityRealTime);
 	reader.Read(0, readBuf, 100, readStat1);
-	test_Value(readStat1.Int(), readStat1==KRequestPending);
+	test(readStat1==KRequestPending);
 	reader.ReadCancel(readStat1);
 	test.Printf(_L("readStat1 %d"), readStat1.Int());
 	User::WaitForRequest(readStat1);
-	test_Value(readStat1.Int(), readStat1==KErrCancel);
+	test(readStat1==KErrCancel);
 	reader.Close();
 	thisThread.SetPriority(EPriorityNormal);
 
 	test.Next(_L("Test asynchronous read is notified due to RFile::SetSize()"));
 	r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileWrite|EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	reader.Read(0, readBuf, 100, readStat1);
-	test_Value(readStat1.Int(), readStat1==KRequestPending);
+	test(readStat1==KRequestPending);
 	r = reader.SetSize(100);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	User::WaitForRequest(readStat1);
-	test_KErrNone(readStat1.Int());
-	test_Equal(100, readBuf.Length());
+	test(readStat1==KErrNone);
+	test(readBuf.Length() == 100);
 	r=reader.SetSize(0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	reader.Close();
 
 	test.Next(_L("Test asynchronous read is notified due to RFile::Write()"));
 	r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileWrite|EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	reader.Read(0, readBuf, 26, readStat1);
-	test_Value(readStat1.Int(), readStat1==KRequestPending);
+	test(readStat1==KRequestPending);
 	RFile writer;
 	r=writer.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileWrite|EFileShareAny);
 	writer.Write(_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
 	User::WaitForRequest(readStat1);
-	test_KErrNone(readStat1.Int());
-	test_Equal(26, readBuf.Length());
+	test(readStat1==KErrNone);
+	test(readBuf.Length() == 26);
 	reader.Close();
 	writer.Close();
 
 	test.Next(_L("Test multiple asynchronous readers notified from separate thread"));
 	r=reader.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileReadAsyncAll|EFileWrite|EFileShareAny);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=reader.SetSize(0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	const TInt KReadLen = 26;
 	test.Printf(_L(">Read%d[%d]\n"), 0, KReadLen);
 	reader.Read(0, readBuf, KReadLen, readStat1);
 	TBuf8<596> readBuf2;
 	test.Printf(_L(">Read%d[%d]\n"), 1, KReadLen);
 	reader.Read(KReadLen, readBuf2, KReadLen, readStat2);
-	test_Value(readStat1.Int(), readStat1==KRequestPending);
-	test_Value(readStat2.Int(), readStat2==KRequestPending);
+	test(readStat1==KRequestPending);
+	test(readStat2==KRequestPending);
 
 	RThread thread;
 	r=thread.Create(_L("MyThread"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest12);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	thread.Logon(thrdStat);
 	thread.Resume();
 	thread.Close();
@@ -4160,7 +4163,7 @@
 	TRequestStatus timerStat(KRequestPending);
 	timer.CreateLocal();
 	timer.After(timerStat, 30000000);	// 30 seconds timeout (the following async test should take 10 seconds)
-	test_Value(timerStat.Int(), timerStat==KRequestPending);
+	test(timerStat==KRequestPending);
 
 	#define ODDPASS  (pass&0x01)
 	#define REQSTAT  (ODDPASS ? readStat2 : readStat1)
@@ -4174,13 +4177,13 @@
 	FOREVER
 		{
         User::WaitForRequest(REQSTAT, timerStat);
-		test_KErrNone(REQSTAT.Int());
-		test_Value(timerStat.Int(), timerStat==KRequestPending);
-		test_Equal(COMPLEN, READBUF.Length());
+		test(REQSTAT==KErrNone);
+		test(timerStat==KRequestPending);
+		test(READBUF.Length() == COMPLEN);
 		test(READBUF.Right(KReadLen) == _L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
 		test.Printf(_L(">Read%d[%d]\n"), pass&0x01, READLEN);
 		reader.Read(READPOS, READBUF, READLEN, REQSTAT);
-		test_Value(REQSTAT.Int(), REQSTAT==KRequestPending);
+		test(REQSTAT==KRequestPending);
 		if(++pass==10)
 			break;
 		}
@@ -4190,12 +4193,12 @@
 	User::WaitForRequest(timerStat);
 	reader.Close();
 	User::WaitForRequest(readStat1);
-	test_Value(readStat1.Int(), readStat1==KErrCancel);
+	test(readStat1==KErrCancel);
 	User::WaitForRequest(readStat2);
-	test_Value(readStat2.Int(), readStat2==KErrCancel);
+	test(readStat2==KErrCancel);
 
 	User::WaitForRequest(thrdStat);
-	test_KErrNone(thrdStat.Int());
+	test(thrdStat==KErrNone);
 	}
 
 
@@ -4215,7 +4218,7 @@
 
     //-- set up notifier
     TheFs.NotifyChange(ENotifyAll, reqStatNotify1, KTestPath);
-    test_Value(reqStatNotify1.Int(), reqStatNotify1 == KRequestPending);
+    test(reqStatNotify1.Int() == KRequestPending);
 
     //-- create a file in the root dir
     RFile       file;
@@ -4224,12 +4227,12 @@
     fileName.Append(_L("TestFile.tst"));
 
     nRes=file.Replace(TheFs, fileName, EFileWrite|EFileRead);
-    test_Value(nRes, nRes == KErrNone || nRes ==KErrAlreadyExists);
+    test(nRes == KErrNone || nRes ==KErrAlreadyExists);
     file.Close();
 
     //-- check that the notifier worked
     User::WaitForRequest(reqStatNotify1);
-    test_KErrNone(reqStatNotify1.Int());
+    test(reqStatNotify1.Int() == KErrNone);
 
 }
 
@@ -4284,7 +4287,7 @@
 		if (r == KErrNotSupported)
 			continue;
 
-		test_KErrNone(r);
+		test(r==KErrNone);
 		TInt sockNum = 0;
 		if (d.IsRemovable(sockNum)>0)
 			{
@@ -4320,7 +4323,7 @@
 
 //	Test RFs::NotifyChange() extended notification
 	TInt uid;
-	test_KErrNone(HAL::Get(HAL::EMachineUid,uid));
+	test(HAL::Get(HAL::EMachineUid,uid)==KErrNone);
 	if(uid!=HAL::EMachineUid_Cogent && uid!=HAL::EMachineUid_IQ80310 &&
 				uid != HAL::EMachineUid_Integrator && uid!=HAL::EMachineUid_X86PC)
 		MediaChangeExtendedNotification();
--- a/kerneltest/f32test/server/t_notifydismount.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_notifydismount.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32hal.h>
@@ -47,12 +46,12 @@
 	test.Next( _L("Test File Handle Closure"));
 
 	TInt r = file.Replace(TheFs, fn, EFileWrite); 
-	test_KErrNone(r); 
+	test(r == KErrNone); 
 	r = TheFs.FileSystemName(fsname,aDrvNum);
-	test_KErrNone(r); 
+	test(r == KErrNone); 
 	buf = _L8("handle test23456");
 	r = file.Write(buf); 
-	test_KErrNone(r); 
+	test(r == KErrNone); 
 	TheFs.NotifyDismount(aDrvNum, stat, EFsDismountForceDismount); 
 	User::WaitForRequest(stat);         
 	test(stat.Int() == KErrNone);
@@ -60,13 +59,13 @@
 	// PDEF137626 Connectivity: Phone reboots automatically when connecting to PC via USB after pl 
 	// Check that writing data to a file when the drive is dismounted doesn't upset the file server
 	r = file.Write(buf); 
-	test_Value(r, r == KErrNotReady || r == KErrDisMounted); 
+	test(r == KErrNotReady || r == KErrDisMounted); 
 
 	// PDEF091956 was a file server fault EFsDriveThreadError when the file 
 	// handle was closed
 	file.Close(); 
 	r = TheFs.MountFileSystem(fsname,aDrvNum);
-	test_KErrNone(r); 
+	test(r == KErrNone); 
 }
 
 
@@ -79,13 +78,13 @@
 	test.Next( _L("Test Request Cancelling") );
 
 	TInt r = TheFs.FileSystemName(fsname,aDrvNum);
-	test_KErrNone(r); 
+	test(r == KErrNone); 
 	
 	//***************************************
 	// first test with an open file handle
 	//***************************************
 	r = file.Replace(TheFs, fn, EFileWrite); 
-	test_KErrNone(r); 
+	test(r == KErrNone); 
 
 	// up the priority of this thread so that we can queue 2 requests onto the drive thread - 
 	// i.e. a TFsNotifyDismount and a TFsCloseObject
@@ -107,7 +106,7 @@
 	thisThread.SetPriority(EPriorityNormal);
 
 	r = TheFs.MountFileSystem(fsname,aDrvNum);
-	test_KErrNone(r); 
+	test(r == KErrNone); 
 
 
 	//***************************************
@@ -117,11 +116,11 @@
 	RDir dir;
 	TFileName sessionPath;
 	r=TheFs.SessionPath(sessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TFileName path=_L("?:\\*");
 	path[0]=sessionPath[0];
 	r=dir.Open(TheFs,path,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	thisThread.SetPriority(EPriorityRealTime);
 	TheFs.NotifyDismount(aDrvNum, stat, EFsDismountForceDismount); 
@@ -133,7 +132,7 @@
 	thisThread.SetPriority(EPriorityNormal);
 
 	r = TheFs.MountFileSystem(fsname,aDrvNum);
-	test_KErrNone(r); 
+	test(r == KErrNone); 
 	}
 
 
@@ -147,25 +146,25 @@
 
 	TInt size = 0;
 	TInt r = file.Replace(TheFs, fn, EFileWrite); 
-	test_KErrNone(r); 
+	test(r == KErrNone); 
 	r = TheFs.FileSystemName(fsname,aDrvNum);
-	test_KErrNone(r); 
+	test(r == KErrNone); 
 	buf = _L8("size test9123456"); 
 	r = file.Write(buf); 
-	test_KErrNone(r); 
+	test(r == KErrNone); 
 	r = file.Flush(); 
-	test_KErrNone(r); 
+	test(r == KErrNone); 
 	r = file.Write(buf); 
-	test_KErrNone(r); 
+	test(r == KErrNone); 
 	TheFs.NotifyDismount(aDrvNum, stat, EFsDismountForceDismount); 
 	User::WaitForRequest(stat);         
 	test(stat.Int() == KErrNone);
 	file.Close();
 	r = TheFs.MountFileSystem(fsname,aDrvNum);
-	test_KErrNone(r); 
+	test(r == KErrNone); 
 	file.Open(TheFs, fn, EFileWrite);
 	r = file.Size(size); 
-	test_KErrNone(r); 
+	test(r == KErrNone); 
 	// PDEF091956 was, for example, a file size of 16 rather than 32. new file sizes were
 	// not flushed for the forced dismount. this was only a problem with rugged fat off.
 	test(size == 32);
@@ -174,13 +173,13 @@
 	test.Next( _L("Test File Size Flushing with EFsDismountNotifyClients") );
 	size = 0;
 	r = file.Replace(TheFs, fn, EFileWrite); 
-	test_KErrNone(r); 
+	test(r == KErrNone); 
 
 	r = file.Write(buf); 
-	test_KErrNone(r); 
+	test(r == KErrNone); 
 
 	r = file.Write(buf); 
-	test_KErrNone(r); 
+	test(r == KErrNone); 
 
 	TheFs.NotifyDismount(aDrvNum, stat, EFsDismountNotifyClients); 
 	User::WaitForRequest(stat);
@@ -189,10 +188,10 @@
 	file.Close();
 
 	r = TheFs.MountFileSystem(fsname,aDrvNum);
-	test_KErrNone(r); 
+	test(r == KErrNone); 
 	file.Open(TheFs, fn, EFileWrite);
 	r = file.Size(size); 
-	test_KErrNone(r); 
+	test(r == KErrNone); 
 	test(size == 32);
 	file.Close();
 	}
@@ -229,7 +228,7 @@
 	TInt drvNum, r;
 
 	r=TheFs.CharToDrive(gDriveToTest,drvNum);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 
 	// dismounting with file system extension present doesn't seem to work
@@ -269,11 +268,11 @@
 		TUint8 isRugged;
 		TPtr8 pRugged(&isRugged,1,1);
 		r=TheFs.ControlIo(drvNum,KControlIoIsRugged,pRugged);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		if(isRugged)
 			{
 			r=TheFs.ControlIo(drvNum,KControlIoRuggedOff);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			}
 
 		TestFileSizeFlushing(drvNum);
@@ -282,7 +281,7 @@
 		if(isRugged)
 			{
 			r=TheFs.ControlIo(drvNum,KControlIoRuggedOn);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			}	
 		}
 	else
--- a/kerneltest/f32test/server/t_open.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_open.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include "t_server.h"
@@ -75,18 +74,18 @@
 	RFile file1,file2,file3;
 	
 	TInt r=file1.Open(TheFs,filename1,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file2.Open(TheFs,filename2,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file3.Open(TheFs,filename1,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	CFileList* list=NULL;
 	TOpenFileScan fileScan(TheFs);
 	TRAP(r,fileScan.NextL(list));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	if (gRunByBatch)
 		{
@@ -134,24 +133,24 @@
 
 	RFs fs1,fs2,fs3,fs4;
 	TInt r=fs1.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs3.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs4.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RFile file1,file2,file3;
 	
 	r=file1.Open(fs2,filename1,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file2.Open(fs2,filename2,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file3.Open(fs2,filename1,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	CFileList* list;
 	TOpenFileScan fileScan(TheFs);
@@ -204,33 +203,33 @@
 
 	RFs fs1,fs2,fs3,fs4;
 	TInt r=fs1.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs3.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs4.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RFile file1,file2,file3;
 	
 	r=file1.Open(fs2,filename1,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file2.Open(fs2,filename2,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file3.Open(fs2,filename1,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file1.Open(fs4,filename1,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file2.Open(fs4,filename2,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=file3.Open(fs4,filename1,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	CFileList* list;
 	TOpenFileScan fileScan(TheFs);
@@ -297,41 +296,41 @@
 
 	RFs fs1,fs2,fs3,fs4;
 	TInt r=fs1.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs2.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs3.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=fs4.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RDir dir1,dir2,dir3,dir4;
 	r=dir1.Open(TheFs,dirname1,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=dir2.Open(TheFs,dirname1,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=dir3.Open(TheFs,dirname1,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=dir4.Open(TheFs,dirname1,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RFile file1,file2,file3;
 	r=file1.Open(fs2,filename1,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file2.Open(fs2,filename2,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file3.Open(fs2,filename1,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	RDir dir5,dir6,dir7,dir8;
 	r=dir5.Open(fs4,dirname1,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=dir6.Open(fs4,dirname1,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=dir7.Open(fs4,dirname1,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=dir8.Open(fs4,dirname1,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	CFileList* list;
 	TOpenFileScan fileScan(TheFs);
@@ -386,21 +385,21 @@
 
 	RFile file1,file2,file3;
 	TInt r=file1.Open(TheFs,filename1,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file2.Open(TheFs,filename2,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file3.Open(TheFs,filename1,EFileRead|EFileShareReadersOnly);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	RDir dir1,dir2,dir3,dir4;
 	r=dir1.Open(TheFs,dirname1,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=dir2.Open(TheFs,dirname1,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=dir3.Open(TheFs,dirname1,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=dir4.Open(TheFs,dirname1,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	CFileList* list;
 	TOpenFileScan fileScan(TheFs);
--- a/kerneltest/f32test/server/t_parse.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_parse.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include "t_server.h"
@@ -34,7 +33,7 @@
 	TBuf<16> defaultPath(_L("C:\\"));
 	TParse parser;
 	TInt r=parser.Set(_L("\\WWW\\XXX\\YYY\\ZZZ\\AAA"),&relatedFiles,&defaultPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("C:\\WWW\\XXX\\YYY\\ZZZ\\AAA.CCC"));
 	test(parser.Drive()==_L("C:"));
 	test(parser.Path()==_L("\\WWW\\XXX\\YYY\\ZZZ\\"));
@@ -52,7 +51,7 @@
 	test(parser.IsNameWild()==EFalse);
 	test(parser.IsExtWild()==EFalse);
 	r=parser.SetNoWild(_L("\\WWW\\XXX\\YYY\\ZZZ\\AAA.EXT"),&relatedFiles,&defaultPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.PopDir()==KErrNone);
 	test(parser.AddDir(_L("BBB"))==KErrNone);
 	test.End();
@@ -68,21 +67,21 @@
 	TParse parser;
 	TInt r=parser.Set(_L("\\WWW\\XXX\\YYY\\ZZZ\\"),NULL,NULL);
 //	TParsePtrC parser(_L("\\WWW\\XXX\\YYY\\ZZZ\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=parser.PopDir();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.Path()==_L("\\WWW\\XXX\\YYY\\"));
 	r=parser.PopDir();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.Path()==_L("\\WWW\\XXX\\"));
 	r=parser.PopDir();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.Path()==_L("\\WWW\\"));
 	r=parser.PopDir();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.Path()==_L("\\"));
 	r=parser.PopDir();
-	test_Value(r, r == KErrGeneral);
+	test(r==KErrGeneral);
 //
 	test(parser.Set(_L("C:\\Documents\\.TXT"),NULL,NULL)==KErrNone);
 	test(parser.PopDir()==KErrNone);
@@ -104,31 +103,31 @@
     TPtrC x2=_L("X:\\");
     TPtrC z=_L("Z:");
 	TInt r=parser.Set(_L("Z:\\Hello"),&one,&null);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("Z:\\Hello"));
     TPtrC sht=_L("*.SHT");
     r=parser.Set(_L("Z:"),&sht,&x);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("Z:*.SHT"));
 	r=parser.Set(_L("Hello"),&z,&x2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("Z:\\Hello"));
 	r=parser.Set(_L("W:\\Hello"),&z,&x2);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("W:\\Hello"));
     TPtrC abcdefg=_L("abcdefg");
     TPtrC onetwo=_L("X:\\ONE\\TWO\\.CCC");
 	r=parser.Set(_L("W:"),&abcdefg,&onetwo);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("W:\\ONE\\TWO\\abcdefg.CCC"));
     TPtrC y=_L("Y:");
     TPtrC xhello=_L("X:\\HELLO\\");
     r=parser.Set(_L("World"),&y,&xhello);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("Y:\\HELLO\\World"));
     TPtrC xhelloext=_L("X:\\HELLO\\.EXT");
     r=parser.Set(_L("World"),&y,&xhelloext);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("Y:\\HELLO\\World.EXT"));
 	test.End();
 	}
@@ -144,24 +143,24 @@
     TPtrC xone=_L("X:\\ONE\\");
     TPtrC y=_L("Y:\\");
 	TInt r=parser.Set(_L("Z:\\Hello"),&xone,&y);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("Z:\\Hello"));
     TPtrC zone=_L("Z:\\ONE\\");
     TPtrC xnew=_L("X:\\NEW\\");
     r=parser.Set(_L("\\Hello"),&zone,&xnew);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("Z:\\Hello"));
     TPtrC aone=_L("A:\\ONE\\");
     TPtrC anew=_L("A:\\NEW\\");
     r=parser.Set(_L("A:Hello"),&aone,&anew);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("A:\\ONE\\Hello"));
     TPtrC a=_L("A:\\");
     r=parser.Set(_L("Hello"),&a,&xnew);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("A:\\Hello"));
 	r=parser.Set(_L("Hello"),&aone,&xnew);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("A:\\ONE\\Hello"));
 	test.End();
 	}
@@ -176,9 +175,9 @@
 	test.Start(_L("Test errors returned by illegal paths"));
 	TParse parser;
 	TInt r=parser.Set(_L("FOO\\"),NULL,NULL);
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=parser.Set(_L("C:\\FOO\\\\"),NULL,NULL);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test.End();
 	}
 
@@ -304,67 +303,67 @@
 	TBuf<16> pathBuf=_L("\\PATH\\");
 	
 	TInt r=parser.Set(pathBuf,NULL,&nameBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("\\PATH\\   name.txt"));
 	r=parser.Set(_L(""),&nameBuf,&pathBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("\\PATH\\   name.txt"));
 	r=parser.Set(_L("   name.txt"),NULL,&pathBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("\\PATH\\   name.txt"));
 	r=parser.Set(nameBuf,&pathBuf,NULL);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("\\PATH\\   name.txt"));
 	
 	TBuf<16> badPath=_L("   \\PATH\\");
 	r=parser.Set(_L("C:\\"),NULL,&badPath);
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	r=parser.Set(_L("C:\\"),&badPath,NULL);
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 
 	TBuf<16> spacePath=_L("\\  PATH\\");
 	r=parser.Set(_L("C:"),&nameBuf,&spacePath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("C:\\  PATH\\   name.txt"));
 
 	TBuf<32> spacename=_L("\\  name   .   txt  ");
 	r=parser.Set(_L("C:"),&spacename,NULL);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("C:\\  name   .   txt"));
 
 // Illegal (?) values
 
 	TBuf<16> pureSpace=_L("     ");
 	r=parser.Set(_L("C:\\NAME\\"),NULL,&pureSpace);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("C:\\NAME\\")); // Trims right off name
 	r=parser.Set(_L("C:\\NAME\\   "),NULL,NULL);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("C:\\NAME\\"));
 
 	TBuf<16> spacePlusExt=_L("    .   ext  ");
 	r=parser.Set(_L("C:\\NAME\\"),NULL,&spacePlusExt);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("C:\\NAME\\    .   ext")); // Trims right off ext
 	r=parser.Set(_L("C:\\NAME\\    .   ext   "),NULL,NULL);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("C:\\NAME\\    .   ext"));
 
 	TBuf<32> pathSpace=_L("\\asdf\\zxcv\\   \\asdf\\");
 	r=parser.Set(_L("C:"),NULL,&pathSpace);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("C:\\asdf\\zxcv\\   \\asdf\\")); // Leaves spaces in path
 	r=parser.Set(_L("C:\\NAME\\ \\alt.sdf"),NULL,NULL);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("C:\\NAME\\ \\alt.sdf"));
 
 
 	TBuf<32> zeroPath=_L("\\asdf\\wqer\\\\asdf\\");
 	r=parser.Set(_L("NAME.TXT"),NULL,&zeroPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("\\asdf\\wqer\\\\asdf\\NAME.TXT")); // Leaves zerolength path
 	r=parser.Set(_L("C:\\NAME\\\\alt.sdf"),NULL,NULL);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parser.FullName()==_L("C:\\NAME\\\\alt.sdf"));
 	test.End();
 	}
@@ -384,10 +383,10 @@
 
 	RFs fs;
 	TInt r=fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TParse parse;
 	r=fs.Parse(testPath,parse);
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 	fs.Close();
 
 	TFileName longFileName;
@@ -397,21 +396,21 @@
 	longFileName[0]='\\';
 	longFileName[253]='\\';
 	r=parse.Set(longFileName,&test_string,NULL);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=parse.PopDir();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	longFileName[123]='\\';
 	r=parse.Set(longFileName,&test_string,NULL);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=parse.PopDir();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TPtrC startPath((TText*)longFileName.Ptr(),124);
 	test(parse.Path()==startPath);
 
 	TPtrC endPath((TText*)longFileName.Ptr()+124,252-124+1);
 	r=parse.AddDir(endPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(parse.Path()==longFileName);
 	}
 
--- a/kerneltest/f32test/server/t_proxydrive1.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_proxydrive1.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -24,7 +24,7 @@
 using namespace F32_Test_Utils;
 
 
-RTest test(_L("T_PROXYDRIVE1"));
+GLDEF_D RTest test(_L("T_PROXYDRIVE1"));
 
 
 TInt GetRemovableDrive(TInt aDriveNumber)
@@ -81,7 +81,7 @@
 
 
 
-void CallTestsL()
+GLDEF_C void CallTestsL()
 	{
     TInt drive;
 	TInt err=RFs::CharToDrive(gDriveToTest,drive);
@@ -96,7 +96,7 @@
 
 	TInt r;
 
-	TInt localDriveNumber = GetRemovableDrive(drive); //-- local _physical_ drive number
+	TInt localDriveNumber = GetRemovableDrive(drive);
 	if (localDriveNumber < 0)
 		{
 		test.Printf(_L("Not a removable drive, skipping test\n"));
@@ -113,25 +113,16 @@
 	TBuf<1> p2;
 	TInt driveNumber = EDriveM;
 
-    //-- this is a hack - mount the proxy drive to the existing one with alive file system just to check
-    //-- that it works.
-
 	r = TheFs.MountProxyDrive(driveNumber, KBitProxyDrive, &p1, &p2);
 	test.Printf(_L("MountProxyDrive(%d, %S) r %d\n"), driveNumber, &KBitProxyDrive, r);
 	test (r >= 0);
 
-    //-- query existing file system name on the drive that we are be parasiting on.
-    TFSName fsName;
-    r = TheFs.FileSystemName(fsName, drive);
-    test(r == KErrNone);
-
-
-	r = TheFs.MountFileSystem(fsName, driveNumber);
-	test.Printf(_L("MountFileSystem(%S) r %d\n"), &fsName, r);
+	_LIT(KFileSystem, "FAT");
+	r = TheFs.MountFileSystem(KFileSystem, driveNumber);
+	test.Printf(_L("MountFileSystem(%S) r %d\n"), &KFileSystem, r);
 	test(r == KErrNone);
 
 
-
 	RFs fs;
 	r = fs.Connect();
 	test(r == KErrNone);
@@ -144,8 +135,8 @@
 	test.Printf(_L("RDir::Open(%S) r %d\n"), &dirPath, r);
 
 
-	r = TheFs.DismountFileSystem(fsName, driveNumber);
-	test.Printf(_L("DismountFileSystem(%S) r %d\n"), &fsName, r);
+	r = TheFs.DismountFileSystem(KFileSystem, driveNumber);
+	test.Printf(_L("DismountFileSystem(%S) r %d\n"), &KFileSystem, r);
 	test (r == KErrInUse);
 
 	// dismount failed - attempt a forced dismount
@@ -153,7 +144,7 @@
 	TheFs.NotifyDismount(driveNumber, stat, EFsDismountForceDismount);
 	User::WaitForRequest(stat);
 	r = stat.Int();
-	test.Printf(_L("DismountFileSystem(%S, EFsDismountForceDismount) r %d\n"), &fsName, r);
+	test.Printf(_L("DismountFileSystem(%S, EFsDismountForceDismount) r %d\n"), &KFileSystem, r);
 	test (r == KErrNone);
 
 	r = TheFs.DismountProxyDrive(driveNumber);
--- a/kerneltest/f32test/server/t_pwstr.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_pwstr.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-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"
@@ -18,7 +18,6 @@
 
 //#include <p32mmc.h>
 
-#define __E32TEST_EXTENSION__
 #include <e32test.h>
 #include <f32fsys.h>
 #include <e32def.h>
@@ -101,7 +100,6 @@
 							// integrator, TBLDNum should be set to 3.
 
 LOCAL_D TInt RFsDNum = -1;	// File Server Drive number
-LOCAL_D TBool gManual = EFalse; // Manual Tests enabled
 
 struct TTestMapping
 	{
@@ -391,13 +389,9 @@
 		wStore.SetLength(i);
 		TInt r(TBLD.WritePasswordData(wStore));
 		if (i == 0 || i == mapSizes[0][0] || i == mapSizes[0][0] + mapSizes[1][1])
-			{
-			test_KErrNone(r);
-			}
+			test(r == KErrNone);
 		else
-			{
-			test_Value(r, r == KErrCorrupt && TBLD.PasswordStoreLengthInBytes() == 0);
-			}
+			test(r == KErrCorrupt && TBLD.PasswordStoreLengthInBytes() == 0);
 		}
 
 	test.Next(_L("Exceeding password store size"));	
@@ -415,13 +409,9 @@
 		const TInt r = TBLD.WritePasswordData(wStore);
 		test.Printf(_L("WritePasswordData() --> ret=%d\n"), r);
 	 	if(n==KMaxNumOfStoreEntries)
-			{
-	 		test_Value(r, r == KErrOverflow);
-			}
+	 		test(r == KErrOverflow);
 	 	else
-			{
-	 		test_KErrNone(r);
-			}
+	 		test(r == KErrNone);	
 		}
 
 
@@ -471,7 +461,7 @@
 
 				if ((r = TBLD.WritePasswordData(wStore)) != KErrNone)
 					{
-					test_Value(r, r == KErrNoMemory);
+					test(r == KErrNoMemory);
 					test(TBLD.PasswordStoreLengthInBytes() == 0);
 					}
 				else
@@ -610,7 +600,7 @@
 		mp.iCIDIdx = cidIdx;
 		mp.iPWDIdx = pwdIdx;
 		TRAP(r, aMP->InsertL(0, mp));
-		test_KErrNone(r);
+		test(r == KErrNone);
 
 		iBIdx += KMMCCIDLength + sizeof(TInt32) + pwd_len;
 		}
@@ -753,7 +743,7 @@
 	TInt r = AccessDisk();
 	if (r != KErrLocked)
 		test.Printf(_L("AccessDisk() returned %d\n"), r);
-	test_Value(r, r == KErrLocked);
+	test(r == KErrLocked);
 	test(TBLD.Unlock(aPWD, aStore) == KErrNone);
 	}
 
@@ -1232,41 +1222,25 @@
 	test.Next(_L("open connection"));
 	RFs theFs;
 	test(theFs.Connect() == KErrNone);
+
 	
-	// So that we are in a consistant state lets
-	// Remove the password file first. i.e. could be passwords left over from previous test failures
-    test.Next(_L("tidy up"));
-    TEntry theEntry;
-    TBuf<sizeof(KMediaPWrdFile)> mediaPWrdFile(KMediaPWrdFile);
-    mediaPWrdFile[0] = (TUint8) RFs::GetSystemDriveChar();
-    test.Printf(_L("password file : %S\n"),&mediaPWrdFile);
-    error = theFs.Delete(mediaPWrdFile);
-    // Should be either KErrNone, KErrPathNotFound or KErrNotFound
-    test.Printf(_L("password file deleted: %d\n"),error);
 	
 	// Now set the first password that we will use
 	test.Next(_L("lock the media card"));	
 	TMediaPassword& nulPWrd = *PWDs[0];
 	TMediaPassword& oldPWrd = *PWDs[1];
 	error = theFs.LockDrive(KDriveNum, nulPWrd, oldPWrd, ETrue);
+	test(KErrNone == error);
 
-	if (KErrNotSupported == error)
-	    {
-        // Appears that passwords aren't supported on this drive config (i.e. NFE)
-        theFs.Close();
-        test.End();
-        return;
-	    }
-	test_KErrNone(error);
 
 	// Verify that the password file does exist and is in the correct place
 	test.Next(_L("check password file exists"));
+	TEntry theEntry;
+	TBuf<sizeof(KMediaPWrdFile)> mediaPWrdFile(KMediaPWrdFile);
+	mediaPWrdFile[0] = (TUint8) RFs::GetSystemDriveChar();
 	error = theFs.Entry(mediaPWrdFile, theEntry);
-	test.Printf(_L("password file exists: %d\n"),error);
-	if (error != KErrNone && error != KErrNotFound)
-	    {
-        test(0);
-	    }	
+	test (KErrNone == error);
+
 	
 	// Attempt to set a new password without specifying the current one
 	test.Next(_L("change password failure"));	
@@ -1278,44 +1252,27 @@
 	// Change the password for a new one...
 	test.Next(_L("change password success"));	
 	error = theFs.LockDrive(KDriveNum, oldPWrd, newPWrd, ETrue);
-	test_KErrNone(error);
+	test(KErrNone == error);
 
 	
 	// Clear the password
-	// NB The file server uses a separate thread to write to the password file,
-	// so we may need to wait a short while to see any change...
 	test.Next(_L("clear the password"));	
 	error = theFs.ClearPassword(KDriveNum, newPWrd);
-	test_KErrNone(error);
+	test(KErrNone == error);
 
 
 	// Check that the password has been removed from the file
 	// (KMediaPWrdFile should now be zero bytes in size)
 	test.Next(_L("check password removal"));
-	theEntry.iSize = KMaxTInt;
-	TInt n;
-	for (n=0; theEntry.iSize > 0 && n<10; n++)
-		{
-		error = theFs.Entry(mediaPWrdFile, theEntry);
-	test_KErrNone(error);
-		test.Printf(_L("Password file size is %d\n"), theEntry.iSize);
-		if (theEntry.iSize > 0)
-			User::After(1000000);
-		}
-	test (theEntry.iSize == 0);
+	error = theFs.Entry(mediaPWrdFile, theEntry);
+	test (KErrNone == error);
+	test (0 == theEntry.iSize);
 
 	
 	// Remove the password file
 	test.Next(_L("tidy up"));
-	error = KErrInUse;
-	for (n=0; error == KErrInUse && n<10; n++)
-		{
-		error = theFs.Delete(mediaPWrdFile);
-		test.Printf(_L("Deleting %S, Iter %d, r %d\n"), &mediaPWrdFile, n, error);
-		if (error == KErrInUse)
-			User::After(1000000);
-		}
-	test_KErrNone(error);
+	error = theFs.Delete(mediaPWrdFile);
+	test (KErrNone == error);
 
 
 	theFs.Close();
@@ -1359,7 +1316,7 @@
 	r = fs.LockDrive(RFsDNum, nulPWrd, oldPWrd, EFalse);
 	if (r != KErrNone)
 		test.Printf(_L("RFs::LockDrive() returned %d\n"), r);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	RemountMedia();		// card is now locked
 
@@ -1372,7 +1329,7 @@
 	r = fmt.Open(fs, driveName, EHighDensity, stepPkg());
 	if (r != KErrLocked)
 		test.Printf(_L("RFormat::Next() returned %d\n"), r);
-	test_Value(r, r == KErrLocked);
+	test(r == KErrLocked);
 
 	test.Printf(_L("\n"));
 	fmt.Close();
@@ -1382,7 +1339,7 @@
 	r = fmt.Open(fs, driveName, EHighDensity | EForceErase, stepPkg());
 	if (r != KErrNone)
 		test.Printf(_L("RFormat::Open() returned %d\n"), r);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	
 	while (stepPkg() > 0)
 		{
@@ -1431,7 +1388,7 @@
 	test.Next(_L("lock card"));
 	test.Next(_L("assign test password"));
 	r = TBLD.SetPassword(nulPWrd, testPassword, EFalse);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	RemountMedia();		// card is now locked
 
@@ -1442,7 +1399,7 @@
 	r = TBLD.Caps(driveCapsPkg);
 	test.Printf(_L("Caps() returned %d , iMediaAtt %08x\n"), r, driveCaps.iMediaAtt);
 
-	test_KErrNone(r);
+	test (r == KErrNone);
 	test ((driveCaps.iMediaAtt & KMediaAttLocked) != 0);
 
 	// Write correct password to store
@@ -1456,14 +1413,14 @@
 
 	test.Printf(_L("WritePasswordData() returned %d\n"), r);
 	
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	// test Caps() reports that card is unlocked
 	test.Next(_L("test card is unlocked"));
 	r = TBLD.Caps(driveCapsPkg);
 	test.Printf(_L("Caps() returned %d , iMediaAtt %08x\n"), r, driveCaps.iMediaAtt);
 
-	test_KErrNone(r);
+	test (r == KErrNone);
 	test ((driveCaps.iMediaAtt & KMediaAttLocked) == 0);
 
 	// Clear the password, remount and test card is unlocked
@@ -1476,7 +1433,7 @@
 	r = TBLD.Caps(driveCapsPkg);
 	test.Printf(_L("Caps() returned %d , iMediaAtt %08x\n"), r, driveCaps.iMediaAtt);
 
-	test_KErrNone(r);
+	test (r == KErrNone);
 	test ((driveCaps.iMediaAtt & KMediaAttLocked) == 0);
 
 
@@ -1500,18 +1457,15 @@
 	UserHal::DriveInfo(diBuf);
 	TDriveInfoV1 &di=diBuf();
 
-	test.Printf(_L(" iRegisteredDriveBitmask 0x%08X\n"), di.iRegisteredDriveBitmask);
+	test.Printf(_L(" iRegisteredDriveBitmask 0x%08X"), di.iRegisteredDriveBitmask);
 
 	aDrive  = -1;
 	
 	TLocalDriveCapsV5Buf capsBuf;
 	TBusLocalDrive TBLD;
 	TLocalDriveCapsV5& caps = capsBuf();
-	
 	TPtrC8 localSerialNum;
 	TInt registeredDriveNum = 0;
-		
-	// Find a Drive that has Password support.
 	for(aDrive=0; aDrive < KMaxLocalDrives; aDrive++)
 		{
 		TInt driveNumberMask = 1 << aDrive;
@@ -1520,29 +1474,27 @@
 
 		test.Printf(_L(" Drive %d -  %S\r\n"), aDrive, &di.iDriveName[registeredDriveNum]);
 
-        TBool TBLDChangedFlag;
-        TInt r = TBLD.Connect(aDrive, TBLDChangedFlag);
+		// check that the card is readable (so we can ignore for empty card slots)
+		if ((di.iDriveName[registeredDriveNum].MatchF(_L("MultiMediaCard0")) == KErrNone) ||
+		    (di.iDriveName[registeredDriveNum].MatchF(_L("SDIOCard0")) == KErrNone))
+			{
+			
+			TBool TBLDChangedFlag;
+			TInt r = TBLD.Connect(aDrive, TBLDChangedFlag);
 //test.Printf(_L(" Connect returned %d\n"), r);
-        if (r == KErrNone)
-            {
-            r = TBLD.Caps(capsBuf);
-            
-            //Check media is lockable if not carry on			
-            if (caps.iMediaAtt & KMediaAttLockable)
-                {
-                test.Printf(_L("Drive %d is Lockable\n"),aDrive);
-                localSerialNum.Set(caps.iSerialNum, caps.iSerialNumLength);
-                const TInt KSectSize = 512;
-                TBuf8<KSectSize> sect;
-                r = TBLD.Read(0, KSectSize, sect);
+			if (r == KErrNone)
+				{
+				r = TBLD.Caps(capsBuf);
+				localSerialNum.Set(caps.iSerialNum, caps.iSerialNumLength);
+				const TInt KSectSize = 512;
+				TBuf8<KSectSize> sect;
+				r = TBLD.Read(0, KSectSize, sect);
 //test.Printf(_L(" Read returned %d\n"), r);
 				
 				TBLD.Disconnect();
 				if (r == KErrNone)
 					break;
 				}
-
-			TBLD.Disconnect();				
 			}
 		registeredDriveNum++;
 		}
@@ -1652,7 +1604,7 @@
     TDriveInfo info;
 
 	TInt r = aFs.Drive(info, aTheMemoryCardDrive);
-	test_KErrNone(r);
+	test (r == KErrNone);
 
 	return (info.iMediaAtt & KMediaAttLocked)?(TBool)ETrue:(TBool)EFalse;
 	}
@@ -1664,9 +1616,7 @@
 	for (n=0; n<30 && !TestLocked(aFs, aTheMemoryCardDrive); n++)
 		{
 		User::After(1000000);
-		test.Printf(_L("."));
 		}
-	test.Printf(_L("\n"));
 	test(n < 30);
 	test(TestLocked(aFs, aTheMemoryCardDrive));	// should now be locked
 	}
@@ -1707,7 +1657,7 @@
 
 	test.Next(_L("Locking card (Successful)"))	;
 	r = TestLockCard(fs, RFsDNum, oldpassword, password, ETrue);
-	test_KErrNone(r); 
+	test(r == KErrNone); 
 		
 	test(!TestLocked(fs, RFsDNum));	// not locked yet as stack hasn't powered down
 
@@ -1715,7 +1665,7 @@
 	r = TBLD.Caps(driveCapsPkg);
 	test.Printf(_L("\tCaps() returned %d , iMediaAtt %08x\n"), r, driveCaps.iMediaAtt);
 
-	test_KErrNone(r);
+	test (r == KErrNone);
 	test ((driveCaps.iMediaAtt & KMediaAttLocked) == 0);
 
 	WaitForPowerDownUnlock(fs, RFsDNum);
@@ -1724,19 +1674,19 @@
 	r = TBLD.Caps(driveCapsPkg);
 	test.Printf(_L("\tCaps() returned %d , iMediaAtt %08x\n"), r, driveCaps.iMediaAtt);
 
-	test_KErrNone(r);
+	test (r == KErrNone);
 	test ((driveCaps.iMediaAtt & KMediaAttLocked) == 0);
 	
 	test.Next(_L("Clear password (Successful)"));
 	r = TestClearPassword(fs, RFsDNum, password);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 // Lock card (without password in store)
 	test.Next(_L("Locking card - Password NOT Stored"));
 
 	test.Next(_L("Locking card (Successful)"));
 	r = TestLockCard(fs, RFsDNum, oldpassword, password, EFalse);
-	test_KErrNone(r); 
+	test(r == KErrNone); 
 		
 	test(!TestLocked(fs, RFsDNum));	// not locked yet as stack hasn't powered down
 	
@@ -1744,7 +1694,7 @@
 	r = TBLD.Caps(driveCapsPkg);
 	test.Printf(_L("\tCaps() returned %d , iMediaAtt %08x\n"), r, driveCaps.iMediaAtt);
 
-	test_KErrNone(r);
+	test (r == KErrNone);
 	test ((driveCaps.iMediaAtt & KMediaAttLocked) == 0);
 
 	WaitForPowerDownLock(fs, RFsDNum);
@@ -1753,7 +1703,7 @@
 	r = TBLD.Caps(driveCapsPkg);
 	test.Printf(_L("\tCaps() returned %d , iMediaAtt %08x\n"), r, driveCaps.iMediaAtt);
 
-	test_KErrNone(r);
+	test (r == KErrNone);
 	test ((driveCaps.iMediaAtt & KMediaAttLocked) != 0);
 	
 // Unlock card
@@ -1761,14 +1711,14 @@
 	
 	test.Next(_L("Unlocking card (Successful)"))	;
 	r = TestUnlockCard(fs, RFsDNum, password, ETrue);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test (!TestLocked(fs, RFsDNum)); // not locked as stack hasn't powered down
 	
 	test.Next(_L("Card reports unlocked - before PowerDown"));
 	r = TBLD.Caps(driveCapsPkg);
 	test.Printf(_L("\tCaps() returned %d , iMediaAtt %08x\n"), r, driveCaps.iMediaAtt);
 
-	test_KErrNone(r);
+	test (r == KErrNone);
 	test ((driveCaps.iMediaAtt & KMediaAttLocked) == 0);
 
 	WaitForPowerDownUnlock(fs, RFsDNum);
@@ -1777,12 +1727,12 @@
 	r = TBLD.Caps(driveCapsPkg);
 	test.Printf(_L("\tCaps() returned %d , iMediaAtt %08x\n"), r, driveCaps.iMediaAtt);
 
-	test_KErrNone(r);
+	test (r == KErrNone);
 	test ((driveCaps.iMediaAtt & KMediaAttLocked) == 0);
 	
 	test.Next(_L("Clearing Password (Successful)"));
 	r = TestClearPassword(fs, RFsDNum, password);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	
 	fs.Close();
 	
@@ -1807,22 +1757,22 @@
 	TMediaPassword wrongpwd = (TUint8*) "failtest";
 
 	r = TestLockCard(fs, RFsDNum, oldpassword, newpassword, EFalse);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test(!TestLocked(fs, RFsDNum));	// not locked yet as stack hasn't powered down
 
 	test.Next(_L("test unlocking fails if still powered up"));
 	r = TestUnlockCard(fs, RFsDNum, newpassword, EFalse);
-	test_Value(r, r == KErrAlreadyExists);		// already unlocked (as stack won't have powered down yet)
+	test(r == KErrAlreadyExists);		// already unlocked (as stack won't have powered down yet)
 	test (!TestLocked(fs, RFsDNum));
 
 	test.Next(_L("test clearing succeeds if still powered up"));
 	r = TestClearPassword(fs, RFsDNum, newpassword);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test(!TestLocked(fs, RFsDNum));
 	
 	test.Next(_L("test locking card again"));
 	r = TestLockCard(fs, RFsDNum, oldpassword, newpassword, EFalse);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test(!TestLocked(fs, RFsDNum));	// not locked yet as stack hasn't powered down
 
 	WaitForPowerDownLock(fs, RFsDNum);
@@ -1838,17 +1788,17 @@
 	sessionPath=_L("?:\\");
 	TChar driveLetter;
 	r = fs.DriveToChar(RFsDNum,driveLetter);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	sessionPath[0]=(TText)driveLetter;
 	r = fs.CheckDisk(sessionPath);
-	test_Value(r, r == KErrNone || r == KErrLocked);
+	test(r == KErrNone || r == KErrLocked);
 	WaitForPowerDownLock(fs, RFsDNum);
 
 
 	// DEF111700: Formatting a locked SD/MMC leaves it in a bad state (causes panics later)
 	// This was caused by format calling TDrive::MountMedia(ETrue) and then not dismounting
 	r = fs.RemountDrive(RFsDNum);
-	test_KErrNone(r);
+	test (r == KErrNone);
 	RFormat fmt;
 	TPckgBuf<TInt> stepPkg;
 	TDriveUnit driveUnit(RFsDNum);
@@ -1857,63 +1807,63 @@
 	r = fmt.Open(fs, driveName, EHighDensity, stepPkg());
 	if (r != KErrLocked)
 		test.Printf(_L("RFormat::Next() returned %d\n"), r);
-	test_Value(r, r == KErrLocked);
+	test(r == KErrLocked);
 	test.Printf(_L("\n"));
 	fmt.Close();
 	r = fs.CheckDisk(sessionPath);
-	test_Value(r, r == KErrLocked);
+	test(r == KErrLocked);
 
 
 	test.Next(_L("test unlocking fails after powered down & unlocked with wrong password"));
 	r = TestUnlockCard(fs, RFsDNum, wrongpwd, EFalse);
-	test_Value(r, r == KErrAccessDenied);		// unlocked should now fail
+	test(r == KErrAccessDenied);		// unlocked should now fail
 
 	test.Next(_L("test unlocking succeeds for correct password after powered down & locked"));
 	r = TestUnlockCard(fs, RFsDNum, newpassword, EFalse);
-	test_KErrNone(r);		// unlocked should now succeed
+	test(r == KErrNone);		// unlocked should now succeed
 
 	test.Next(_L("test unlocking fails after successful unlock"));
 	r = TestUnlockCard(fs, RFsDNum, wrongpwd, EFalse);
-	test_Value(r, r == KErrAlreadyExists);		// unlocked should now succeed
+	test(r == KErrAlreadyExists);		// unlocked should now succeed
 	test(!TestLocked(fs, RFsDNum));	// not locked yet as stack hasn't powered down
 
 	test.Next(_L("test locking card with new password (with wrong password as old password)"));
 	r = TestLockCard(fs, RFsDNum, wrongpwd, newpassword, EFalse);
-	test_Value(r, r == KErrAccessDenied);
+	test(r == KErrAccessDenied);
 	test(!TestLocked(fs, RFsDNum));	// not locked yet as stack hasn't powered down
 
 	test.Next(_L("test locking card with new password (with right password as old password)"));
 	r = TestLockCard(fs, RFsDNum, newpassword, wrongpwd, EFalse);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test(!TestLocked(fs, RFsDNum));	// not locked yet as stack hasn't powered down
 
 	WaitForPowerDownLock(fs, RFsDNum);
 	
 	test.Next(_L("test clearing fails with wrong password if powered down & locked"));
 	r = TestClearPassword(fs, RFsDNum, newpassword); // Note: we have set the wrong password as the new password
-	test_Value(r, r == KErrAccessDenied);
+	test(r == KErrAccessDenied);
 	test(TestLocked(fs, RFsDNum));
 
 	test.Next(_L("test clearing succeeds with right password if powered down & locked"));
 	r = TestClearPassword(fs, RFsDNum, wrongpwd);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test(!TestLocked(fs, RFsDNum));
 
 	test.Next(_L("test locking card again"));
 	r = TestLockCard(fs, RFsDNum, oldpassword, newpassword, EFalse);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test(!TestLocked(fs, RFsDNum));		// not locked yet as stack hasn't powered down
 
 	test.Next(_L("test forced erase fails if still powered up"));
 	r = ExecuteForcedEraseTestL(fs, RFsDNum);
-	test_Value(r, r == KErrAccessDenied);		// fails because card is not yet locked
+	test(r == KErrAccessDenied);		// fails because card is not yet locked
 
 	WaitForPowerDownLock(fs, RFsDNum);
 
 
 	test.Next(_L("test forced erase succeeds if powered down & locked"));
 	r = ExecuteForcedEraseTestL(fs, RFsDNum);
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	fs.Close();
 	test.End();
@@ -1934,16 +1884,16 @@
 	sessionPath=_L("?:\\");
 	TChar driveLetter;
 	TInt r=fs.DriveToChar(RFsDNum,driveLetter);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	sessionPath[0]=(TText)driveLetter;
 	r=fs.SetSessionPath(sessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
     
 	TInt nRes;
     TDriveInfo dInfo;
 
     nRes = fs.Drive(dInfo, RFsDNum);
-	test_KErrNone(nRes);
+	test(nRes == KErrNone);
 	if (!(dInfo.iMediaAtt & KMediaAttLockable))
 		{
 		test.Printf(_L("Drive %d is not lockable %d\n"), RFsDNum);
@@ -1955,7 +1905,7 @@
 	TMediaPassword oldPassword;
 	TMediaPassword newPassword = (TUint8*) "salasana";
     nRes = fs.LockDrive(RFsDNum, oldPassword, newPassword, EFalse );
-	test_KErrNone(nRes);
+	test(nRes == KErrNone);
 
 	WaitForPowerDownLock(fs, RFsDNum);
 
@@ -1974,7 +1924,7 @@
     test(reqStatNotify1.Int() == KErrNone);
 
 	r = TestClearPassword(fs, RFsDNum, newPassword);
-	test_KErrNone(r);
+	test(r == KErrNone);
 	test(!TestLocked(fs, RFsDNum));
 	
 	
@@ -1982,6 +1932,7 @@
 	fs.Close();
 	}
 
+
 LOCAL_C void RunTests()
 //
 // Main test routine.  Calls other test functions.
@@ -2004,47 +1955,34 @@
 	test.Next(_L("Allocating test data"));
 	AllocateTestData();
 
-    if (gManual)
-        {
-		test.Next(_L("Testing locking / unlocking using file server APIs"));
-		TestFsLockUnlock();
+	test.Next(_L("Testing locking / unlocking using file server APIs"));
+	TestFsLockUnlock();
 	
-		test.Next(_L("Testing Power Down Status Reporting using file server APIs"));
-		TestPowerDownStatus();
+	test.Next(_L("Testing Power Down Status Reporting using file server APIs"));
+	TestPowerDownStatus();
 
-	    test.Next(_L("Testing RFs::NotifyChange() with RFs::UnlockDrive()"));
-		TestUnlockDriveNotifyChange();
+    test.Next(_L("Testing RFs::NotifyChange() with RFs::UnlockDrive()"));
+	TestUnlockDriveNotifyChange();
 
-		test.Next(_L("Forced Erase"));
-		TestFormatErase();
-		}
-		
+	test.Next(_L("Forced Erase"));
+	TestFormatErase();
 	test.Next(_L("Testing store management"));
 	TestStaticStore();
-
-    if (gManual)
-        {		
-		test.Next(_L("Testing locking functions"));
-		TestLockUnlock();
-		test.Next(_L("Testing Elide Passwords"));
-		TestElidePasswords();		
-		test.Next(_L("Testing Null Passwords"));
-		TestNullPasswords();
-		test.Next(_L("Testing controller store"));
-		TestControllerStore();
-		test.Next(_L("Testing auto unlock"));
-		TestAutoUnlock();
-		}
-		
+	test.Next(_L("Testing locking functions"));
+	TestLockUnlock();
+	test.Next(_L("Testing Elide Passwords"));
+	TestElidePasswords();
+	test.Next(_L("Testing Null Passwords"));
+	TestNullPasswords();
+	test.Next(_L("Testing controller store"));
+	TestControllerStore();
+	test.Next(_L("Testing auto unlock"));
+	TestAutoUnlock();
 	test.Next(_L("Testing password file"));
 	TestPasswordFile();
-	
-    if (gManual)
-        {		
-		test.Next(_L("Testing writing a valid password to store unlocks card"));
-		TestWriteToPasswordStoreUnlocksCard();
-		}
-    
+	test.Next(_L("Testing writing a valid password to store unlocks card"));
+	TestWriteToPasswordStoreUnlocksCard();
+
 	test.Next(_L("Disconnecting TBLD"));
 	TBLD.Disconnect();
 
@@ -2054,43 +1992,15 @@
 	__UHEAP_MARKEND;
 	}
 
-LOCAL_D void ParseCommandLineArgs()
-    {
-    
-    TBuf<0x100> cmd;
-    User::CommandLine(cmd);
-    TLex lex(cmd);
-
-    for (TPtrC token=lex.NextToken(); token.Length() != 0;token.Set(lex.NextToken()))
-        {
-        if (token.CompareF(_L("-m"))== 0)
-            {
-            gManual = ETrue;
-            continue;
-            }
-        }
-    }
 
 TInt E32Main()
 	{
 	
 	test.Title();
-	test.Start(_L("T_PWSTR"));
+	test.Start(_L("E32Main"));
+	
+	RunTests();
 
-#if defined(__WINS__)
-	if (!gManual)
-	    {
-        test.Printf(_L("Automated T_PWSTR not supported on emulated devices\n"));
-	    }
-	else
-#endif
-	    {
-        ParseCommandLineArgs();	
-        
-        RunTests();
-	    }
-
-	
 	test.End();
 	test.Close();
 
--- a/kerneltest/f32test/server/t_rand.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_rand.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32math.h>
@@ -44,7 +43,7 @@
 	testBuf.SetLength(testBuf.MaxSize());
 	Mem::Fill(bufPtr,testBuf.MaxSize(),aCluster);
 	TInt r=aFile.Write(testBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 LOCAL_C void SeekToCluster(RFile& aFile,TInt aCluster)
@@ -54,7 +53,7 @@
 	{
 	TBuf8<508> seekBuf(508);
 	TInt r=aFile.Read(aCluster*testBuf.MaxSize(),seekBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(seekBuf[0]==(TUint8)aCluster && seekBuf[507]==(TUint8)aCluster);
 	}
 
@@ -65,10 +64,10 @@
 	{
 	TBuf8<508> seekBuf(508);
 	TInt r=aFile.Read(aCluster1*testBuf.MaxSize(),seekBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(seekBuf[0]==(TUint8)aCluster1 && seekBuf[507]==(TUint8)aCluster1);
 	r=aFile.Read(aCluster2*testBuf.MaxSize(),seekBuf);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(seekBuf[0]==(TUint8)aCluster2 && seekBuf[507]==(TUint8)aCluster2);
 	}
 
@@ -101,9 +100,9 @@
 	RFile f1,f2;
 //
 	TInt r=f1.Replace(TheFs,_L("BIGFILE1.TST"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f2.Replace(TheFs,_L("BIGFILE2.TST"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 //
 	TInt maxListLength=4;
 	TInt i=0,k=0;
@@ -148,9 +147,9 @@
 	f1.Close();
 	f2.Close();
 	r=TheFs.Delete(_L("BIGFile1.tst"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("BIGFile2.tst"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckDisk();
 	}
 
@@ -164,9 +163,9 @@
 	RFile f1,f2;
 //
 	TInt r=f1.Replace(TheFs,_L("BIGFILE1.TST"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f2.Replace(TheFs,_L("BIGFILE2.TST"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 //
 	WriteCluster(f1,0);
 	WriteCluster(f1,1);
@@ -183,9 +182,9 @@
 	f1.Close();
 	f2.Close();
 	r=TheFs.Delete(_L("BIGFile1.tst"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.Delete(_L("BIGFile2.tst"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CheckDisk();
 	}
 
@@ -201,10 +200,10 @@
 	TInt i=0,j=0;
 //
 	TInt r=f1.Replace(TheFs,_L("BIGFILE1.TST"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	r=f1.SetSize(65534);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	for(i=0;i<=15;i++)
 		WriteCluster(f1,i);
@@ -218,7 +217,7 @@
 
 	test.Next(_L("Increase Size"));
 	r=f1.SetSize(1048577);
-	test_Value(r, r == KErrNone || r==KErrDiskFull);
+	test(r==KErrNone || r==KErrDiskFull);
 	if (r==KErrDiskFull)
 		{
 		test.Printf(_L("File too big\n"));
@@ -236,7 +235,7 @@
 
 	TInt newPos=8192;
 	r=f1.Seek(ESeekStart,newPos);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("Write more data"));
 	for(i=16;i<83;i++)
@@ -252,7 +251,7 @@
 
 	test.Next(_L("Reduce file size"));
 	r=f1.SetSize(135000);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("Test data still present"));
 	for (j=0;j<200;j++)
@@ -285,7 +284,7 @@
 	{
 
 	TInt r=iFile.Read(0,iData);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 void TFileReader::Next(TUint8& aVal,TInt& aLength)
@@ -297,7 +296,7 @@
 	if (iPos==iData.Length())
 		{
 		TInt r=iFile.Read(iData);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		iPos=0;
 		if (iData.Length()==0)
 			{
@@ -427,13 +426,13 @@
 	HBufC8* dataBuf=HBufC8::NewL(KMaxBufferLength);
 
 	TInt r=f[0].Replace(TheFs,_L("TEST1.DAT"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f[1].Replace(TheFs,_L("TEST2.DAT"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f[2].Replace(TheFs,_L("TEST3.DAT"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=f[3].Replace(TheFs,_L("TEST4.DAT"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 	TInt size=0;
 	TInt iteration=0;
@@ -458,7 +457,7 @@
 			TInt s=len*mult[fileNum];
 			TInt filePos=pos*mult[fileNum];
 			r=f[fileNum].Seek(ESeekStart,filePos);
-			test_KErrNone(r);
+			test(r==KErrNone);
 
 			while(s>0)
 				{
@@ -472,7 +471,7 @@
 			
 				if (r==KErrDiskFull)
 					goto End;
-				test_KErrNone(r);
+				test(r==KErrNone);
 				s-=l;
 				}
 			
@@ -493,7 +492,7 @@
 				{
 				TInt fileNum=(order+i)%KMaxFiles;
 				r=f[fileNum].SetSize(size*mult[fileNum]);
-				test_KErrNone(r);
+				test(r==KErrNone);
 				}
 			CheckFileContents(&f[0]);
 			}
--- a/kerneltest/f32test/server/t_rcache.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_rcache.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1684,7 +1684,7 @@
 	TVolumeInfo volInfo;
 	TInt r = TheFs.Volume(volInfo, gDrive);
 	test_KErrNone(r);
-	gMediaSize = volInfo.iFree;
+	gMediaSize = volInfo.iSize;
 	gSecondFileSize = KBlockSize*92;
 	gFirstFileSize = KBlockSize*(256);
 	while(((2*gFirstFileSize)+KOneMeg) > gMediaSize )
--- a/kerneltest/f32test/server/t_rcount.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_rcount.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 
@@ -41,7 +40,7 @@
 	name[0] = gExeFileName[0];
 	test.Printf(_L("%S\n"),&name);
 	TInt r=file.Open(TheFs,name,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	count=TheFs.ResourceCount();
 	test(count==1);
 	file.Close();
@@ -60,14 +59,14 @@
 	User::SetJustInTime(EFalse);
 	RFs fs;
 	TInt r=fs.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RFile file;
 	fs.ResourceCountMarkStart();
 	TFileName name=_L("Z:\\Test\\T_FILE.CPP");
 	name[0] = gExeFileName[0];
 
 	r=file.Open(fs,name,EFileRead);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TInt count=fs.ResourceCount();
 	test(count==1);
 	fs.ResourceCountMarkEnd(); // MarkEnd without close
@@ -85,7 +84,7 @@
 	TRequestStatus stat;	
 	RThread t;
 	TInt r=t.Create(_L("TestPanicThread"),TestPanic,KDefaultStackSize,KHeapSize,KHeapSize,NULL);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	t.Logon(stat);
 	t.Resume();
 	User::WaitForRequest(stat);	
@@ -155,11 +154,11 @@
 	{
 	RFs f;
 	TInt r = f.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RFile a;
 	r=a.Replace(f,KFileName1,EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RFile b(a);
 	a.Close();
 	
@@ -182,11 +181,11 @@
 	{
 	RFs f;
 	TInt r = f.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RDir a;
 	r=a.Open(f,KDirName1,KEntryAttNormal);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RDir b(a);
 	a.Close();
 	
@@ -216,12 +215,12 @@
 
 	RFs f;
 	TInt r = f.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RFormat a;
 	TInt count;
 	r=a.Open(f,KDrive1,EQuickFormat,count);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RFormat b(a);
 	a.Close();
 	
@@ -251,12 +250,12 @@
 	
 	RFs f;
 	TInt r = f.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RRawDisk a;
     r=a.Open(f,KDrive1);
 
-	test_KErrNone(r);
+	test(r==KErrNone);
 	RRawDisk b(a);
 	a.Close();
 	TBuf8<19> buffer;
--- a/kerneltest/f32test/server/t_rdsect.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_rdsect.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -73,7 +73,7 @@
 
 	test.Next(_L("Create test files"));
 	TInt r=TheFs.MkDir(_L("\\F32-TST\\"));
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 
 	RFile file;
 
@@ -208,7 +208,7 @@
 //	First, test for non-existant file
 	TBuf<256> testDes;
 	TInt r=TheFs.ReadFileSection(_L("\\F32-tst\\NonExistantFile.txt"),0,testDes,52);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	test(testDes.Length()==0);
 
 //	Test with file closed
@@ -400,7 +400,7 @@
 	TBuf8<256> testDesN;
 	test.Next(_L("Check for null file name"));
  	r=TheFs.ReadFileSection(_L(""),0,testDesN,26);
- 	test_Value(r, r == KErrBadName);
+ 	test(r==KErrBadName);
  	
 	// Check the lentgh of descriptor.	
  	TInt x = testDesN.Length();
@@ -409,7 +409,7 @@
  	test.Next(_L("Check for non existing file"));
 	r=TheFs.ReadFileSection(_L("sdfsd.dfg"),0,testDesN,26);
  	test.Printf(_L("Return %d"),r);
- 	test_Value(r, (r == KErrNotFound) || (r == KErrPathNotFound));
+ 	test((r==KErrNotFound) || (r == KErrPathNotFound));
  	
 	// Check the lentgh of descriptor.	
  	x = testDesN.Length();
@@ -546,7 +546,7 @@
 //	__ASSERT_ALWAYS(aDes.MaxLength()>=aLength,Panic(EBadLength));
 
 	r=TheFs.ReadFileSection(_L("\\F32-tst\\ReadFileSection1.txt"),2000,testDes,-20);
-	test_Value(r, r == KErrArgument);
+	test(r==KErrArgument);
 
 //	Test that specifying a position and length which extends beyond the end of
 //	the	file returns a zero length descriptor and KErrNone
@@ -617,7 +617,7 @@
 	//	First, test for non-existant file
 	TBuf8<256> testDes;
 	TInt r=TheFs.ReadFileSection(_L("\\F32-tst\\NonExistantFile.txt"),0,testDes,52);
-	test_Value(r, r == KErrNotFound);
+	test(r==KErrNotFound);
 	test(testDes.Length()==0);
 	
 	//	Test with file closed
@@ -640,7 +640,7 @@
 	TBuf8<256> testDesN;
 	test.Next(_L("Check for null file name"));
  	r=TheFs.ReadFileSection(_L(""),0,testDesN,26);
- 	test_Value(r, r == KErrBadName);
+ 	test(r==KErrBadName);
  	
 	//  Check the lentgh of descriptor.	
  	TInt x = testDesN.Length();
@@ -649,7 +649,7 @@
  	test.Next(_L("Check for non existing file"));
 	r=TheFs.ReadFileSection(_L("sdfsd.dfg"),0,testDesN,26);
  	test.Printf(_L("Return %d"),r);
- 	test_Value(r, (r == KErrNotFound) || (r == KErrPathNotFound));
+ 	test((r==KErrNotFound) || (r == KErrPathNotFound));
  	
 	//  Check the lentgh of descriptor.	
  	x = testDesN.Length();
@@ -657,27 +657,27 @@
 
     //  Test for Empty directory  
     r=TheFs.ReadFileSection(_L("\\F32-tst\\"),0,testDesN,52);
-    test_Value(r, r == KErrBadName);
+    test(r==KErrBadName);
     test(testDesN.Length()==0);
 
     //  Test for File with wildcard name 
     r=TheFs.ReadFileSection(_L("\\F32-tst\\*.txt"),0,testDesN,52);
-    test_Value(r, r == KErrBadName);
+    test(r==KErrBadName);
     test(testDesN.Length()==0);
 
     //  Test for Folder with wildcard name 
     r=TheFs.ReadFileSection(_L("\\F32-tst*\\ReadFileSection1.txt"),0,testDesN,52);
-    test_Value(r, r == KErrBadName);
+    test(r==KErrBadName);
     test(testDesN.Length()==0);
       
     //  Test for Root directory
     r=TheFs.ReadFileSection(_L("\\"),0,testDesN,52);
-    test_Value(r, r == KErrBadName);
+    test(r==KErrBadName);
     test(testDesN.Length()==0);
 
     //  Test for no file being specified.
     r=TheFs.ReadFileSection(_L(""),0,testDesN,26);
-    test_Value(r, r == KErrBadName);
+    test(r==KErrBadName);
     test(testDesN.Length()==0); 
 
 
@@ -857,7 +857,7 @@
 
 
 	r=TheFs.ReadFileSection(_L("\\F32-tst\\ReadFileSection1.txt"),2000,testDes2,-20);
-	test_Value(r, r == KErrArgument);
+	test(r==KErrArgument);
 
 //	Test that specifying a position and length which extends beyond the end of
 //	the	file returns a zero length descriptor and KErrNone
--- a/kerneltest/f32test/server/t_rename.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_rename.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -37,29 +37,29 @@
 	{
 	test.Next(_L("Create test files"));
 	TInt r=TheFs.MkDir(_L("\\F32-TST\\"));
-	test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+	test(r==KErrNone || r==KErrAlreadyExists);
 
 	RFile file;
 
 //	Create \\SessionPath\\testfile
 	r=file.Replace(TheFs,_L("\\F32-TST\\testfile"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(BeckPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	
 //	Create \\SessionPath\\rfsfile
 	r=file.Replace(TheFs,_L("\\F32-TST\\rfsfile"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(BeckPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 //	Create \\SessionPath\\eikfile
 	r=file.Replace(TheFs,_L("\\F32-TST\\eikfile"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(BeckPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	}
@@ -73,7 +73,7 @@
     RDir dir;
 	TFileName sessionPath;
 	TInt r=TheFs.SessionPath(sessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TFileName path=_L("?:");
 	path[0]=sessionPath[0];
 	path+=aDirectory;
@@ -83,11 +83,11 @@
 		path.Append(_L("\\*"));
 		
 	r=dir.Open(TheFs,path,KEntryAttMaskSupported);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	CDir* anEntryList;
 	r=TheFs.GetDir(path,KEntryAttMaskSupported,ESortByName,anEntryList);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 //	Sets the new length of path to the position of the last path delimiter +1
 	path.SetLength(path.LocateReverse(KPathDelimiter)+1);
@@ -117,19 +117,19 @@
 	RFile file;
 	
 	r=file.Open(TheFs,_L("\\F32-TST\\testfile"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file.Rename(_L("\\F32-TST\\TESTFILE"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	file.Close();
 
 	test.Next(_L("Write in some data"));
 	r=file.Open(TheFs,_L("\\F32-TST\\TESTFILE"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file.Write(alphaPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	file.Close();
 	}
@@ -144,15 +144,15 @@
 	TInt r;
 		
 	r=TheFs.Rename(_L("\\F32-TST\\rfsfile"),_L("\\F32-TST\\RFSFILE"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	RFile file;
 	test.Next(_L("Write in some data"));
 	r=file.Open(TheFs,_L("\\F32-TST\\RFSFILE"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file.Write(alphaPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	file.Close();
 	}
@@ -168,19 +168,19 @@
 	
 	test.Next(_L("Create a new file with DOS compatible equivalent name"));
 	r=file.Create(TheFs,_L("\\F32-TST\\EIKFILE"),EFileRead|EFileWrite);
-	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
+	test((r==KErrNone)||(r==KErrAlreadyExists));
 	file.Close();
 
 	test.Next(_L("Copy data from original file into new file"));
 	r=TheFs.Replace(_L("\\F32-TST\\eikfile"),_L("\\F32-TST\\EIKFILE"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	test.Next(_L("Open the new file and write into it"));
 	r=file.Open(TheFs,_L("\\F32-TST\\EIKFILE"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file.Write(alphaPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	file.Close();
 	}
@@ -198,17 +198,17 @@
 //	First test with a non DOS compatible name renamed to a DOS compatible name
 	test.Next(_L("Rename test to TEST and replace temp with TEST"));
 	r=file.Replace(TheFs,_L("\\F32-TST\\test"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(BeckPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	r=TheFs.Rename(_L("\\F32-TST\\test"),_L("\\F32-TST\\TEST"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Replace(TheFs,_L("\\F32-TST\\temp"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(alphaPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 //	Replace(oldName, newName)	
@@ -217,183 +217,183 @@
 //	then temp is deleted.  If it does exist, it must be closed
 //	The bug created a second file of the same name	
 	r=TheFs.Replace(_L("\\F32-TST\\temp"),_L("\\F32-TST\\TEST"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 //	Check that there's only one file named TEST
 	TInt fileCount=0;
 	fileCount=CountFiles(_L("\\F32-TST\\"),_L("TEST"));
 	test(fileCount==1);
 	r=TheFs.Delete(_L("\\F32-TST\\TEST"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fileCount=CountFiles(_L("\\F32-TST\\"),_L("TEST"));
 	test(fileCount==0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	
 
 //*****************************************************
 //	The same test but with different source directories
 	test.Next(_L("Rename test to and replace \\SYSTEM\\temp with TEST"));
 	r=file.Replace(TheFs,_L("\\F32-TST\\test"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(BeckPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	r=TheFs.Rename(_L("\\F32-TST\\test"),_L("\\F32-TST\\TEST"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Replace(TheFs,_L("\\F32-TST\\SYSTEM\\temp"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(alphaPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	
 //	The bug created a second file of the same name	
 	r=TheFs.Replace(_L("\\F32-TST\\SYSTEM\\temp"),_L("\\F32-TST\\TEST"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	fileCount=0;
 	fileCount=CountFiles(_L("\\F32-TST\\"),_L("TEST"));
 	test(fileCount==1);
 	r=TheFs.Delete(_L("\\F32-TST\\TEST"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fileCount=CountFiles(_L("\\F32-TST\\"),_L("TEST"));
 	test(fileCount==0);
 //	Test that system directory is now empty	
 	fileCount=0;
 	fileCount=CountFiles(_L("\\F32-TST\\SYSTEM\\"),_L("temp"));
 	test(fileCount==0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 //	*************************************************************************
 //	Test with a DOS compatible name renamed to a different DOS compatible name
 	test.Next(_L("Rename little to BIG and replace temp with BIG"));
 	r=file.Replace(TheFs,_L("\\F32-TST\\little"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(BeckPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	// Test a long path (>250 chrs)
 	r=TheFs.Rename(_L("\\F32-TST\\little"),_L("\\F32-TST\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\0495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\PLATTEST\\FileStore\\TestData\\20495_Folder\\middle.gif"));
-	test_Value(r, r == KErrBadName);
+	test(r==KErrBadName);
 
 	r=TheFs.Rename(_L("\\F32-TST\\little"),_L("\\F32-TST\\BIG"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Replace(TheFs,_L("\\F32-TST\\temp"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(alphaPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	
 	r=TheFs.Replace(_L("\\F32-TST\\temp"),_L("\\F32-TST\\BIG"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	fileCount=0;
 	fileCount=CountFiles(_L("\\F32-TST\\"),_L("BIG"));
 	test(fileCount==1);
 	r=TheFs.Delete(_L("\\F32-TST\\BIG"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fileCount=CountFiles(_L("\\F32-TST\\"),_L("BIG"));
 	test(fileCount==0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 //	***********************************	
 //	Test with a non-DOS compatible name
 	test.Next(_L("Rename veryLongFileName to VERYLONGFILENAME"));
 	r=file.Replace(TheFs,_L("\\F32-TST\\veryLongFileName"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(BeckPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	r=TheFs.Rename(_L("\\F32-TST\\veryLongFileName"),_L("\\F32-TST\\VERYLONGFILENAME"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Replace(TheFs,_L("\\F32-TST\\temp"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(alphaPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	
 	r=TheFs.Replace(_L("\\F32-TST\\temp"),_L("\\F32-TST\\VERYLONGFILENAME"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	fileCount=0;
 	fileCount=CountFiles(_L("\\F32-TST\\"),_L("VERYLONGFILENAME"));
 	test(fileCount==1);
 	r=TheFs.Delete(_L("\\F32-TST\\VERYLONGFILENAME"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fileCount=CountFiles(_L("\\F32-TST\\"),_L("VERYLONGFILENAME"));
 	test(fileCount==0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 //	*******************************
 //	Test with a DOS compatible name
 	test.Next(_L("Rename FILE to FILE and replace temp with FILE"));
 	r=file.Replace(TheFs,_L("\\F32-TST\\FILE"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(BeckPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	r=TheFs.Rename(_L("\\F32-TST\\FILE"),_L("\\F32-TST\\FILE"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Replace(TheFs,_L("\\F32-TST\\temp"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(alphaPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	
 	r=TheFs.Replace(_L("\\F32-TST\\temp"),_L("\\F32-TST\\FILE"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	fileCount=0;
 	fileCount=CountFiles(_L("\\F32-TST\\"),_L("FILE"));
 	test(fileCount==1);
 	r=TheFs.Delete(_L("\\F32-TST\\FILE"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fileCount=CountFiles(_L("\\F32-TST\\"),_L("FILE"));
 	test(fileCount==0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 //	**************************************************
 //	Test with a DOS compatible name which is kept open
 	test.Next(_L("Rename test1 to TEST1 and replace temp1 with TEST1 while it's open"));
 	r=file.Replace(TheFs,_L("\\F32-TST\\test1"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(BeckPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 
 	r=TheFs.Rename(_L("\\F32-TST\\test1"),_L("\\F32-TST\\TEST1"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 //	Try with the file open
 	RFile openFile;
 	r=openFile.Open(TheFs,_L("\\F32-TST\\TEST1"),EFileRead|EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	r=file.Replace(TheFs,_L("\\F32-TST\\temp"),EFileWrite);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=file.Write(alphaPtr);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	file.Close();
 	
 	r=TheFs.Replace(_L("\\F32-TST\\temp"),_L("\\F32-TST\\TEST1"));
-	test_Value(r, r == KErrInUse);	//	Fails as it should!  But not intuitive bearing in mind the other bug...
+	test(r==KErrInUse);	//	Fails as it should!  But not intuitive bearing in mind the other bug...
 
 	openFile.Close();
 	
 	r=TheFs.Replace(_L("\\F32-TST\\temp"),_L("\\F32-TST\\TEST1"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	fileCount=0;
 	fileCount=CountFiles(_L("\\F32-TST\\"),_L("TEST1"));
 	test(fileCount==1);
 	r=TheFs.Delete(_L("\\F32-TST\\TEST1"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	fileCount=CountFiles(_L("\\F32-TST\\"),_L("TEST1"));
 	test(fileCount==0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 
 	}
 
@@ -453,7 +453,7 @@
 
    fName.Format(_L("%c:"), gDriveNum+'A');
    nRes = TheFs.CheckDisk(fName);
-   test_Value(nRes, nRes == KErrNone || nRes == KErrNotSupported);
+   test(nRes == KErrNone || nRes == KErrNotSupported);
 
    //-- clean up
     for(i=0; i<KNumFiles; ++i)
@@ -465,11 +465,11 @@
 
    fName.Format(_L("%c:"), gDriveNum+'A');
    nRes = TheFs.CheckDisk(fName);
-   test_Value(nRes, nRes == KErrNone || nRes == KErrNotSupported);
+   test(nRes == KErrNone || nRes == KErrNotSupported);
 
 
    nRes = TheFs.RmDir(KDir);
-   test_KErrNone(nRes);
+   test(nRes == KErrNone);
 
 
 }
@@ -485,14 +485,14 @@
     F32_Test_Utils::SetConsole(test.Console());
 
     TInt nRes=TheFs.CharToDrive(gDriveToTest, gDriveNum);
-    test_KErrNone(nRes);
+    test(nRes==KErrNone);
     
     PrintDrvInfo(TheFs, gDriveNum);
 
     if(!Is_Win32(TheFs, gDriveNum))
         {
         nRes = FormatDrive(TheFs, gDriveNum, ETrue);
-        test_KErrNone(nRes);
+        test(nRes==KErrNone);
         }
     
 
@@ -507,7 +507,7 @@
     if(!Is_Win32(TheFs, gDriveNum))
         {
         nRes = FormatDrive(TheFs, gDriveNum, ETrue);
-        test_KErrNone(nRes);
+        test(nRes==KErrNone);
         }
 
 	test.End();
--- a/kerneltest/f32test/server/t_resize.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_resize.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -20,7 +20,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <e32test.h>
 #include <f32file.h>
 #include <hal.h>
@@ -57,7 +56,7 @@
 	test.Next(_L("Connecting to file server."));
 	TInt r;
 	r = TheFs.Connect();
-	test_KErrNone(r);
+	test(r == KErrNone);
 
 	if ( !gDriveToTest.IsLower() )
 		{
@@ -172,13 +171,13 @@
 	TInt isFat, isValid;
     TInt machUid;
     r=HAL::Get(HAL::EMachineUid,machUid);
-    test_KErrNone(r);
+    test(r==KErrNone);
 //	test.Printf(_L("machUid = %08x.\n"), machUid);
 
 	TBuf<16> fsName;							// _?_ length
         
     r = TheFs.FileSystemName(fsName, aDrive);
-    test_Value(r, r == KErrNone || r == KErrNotFound);
+    test(r == KErrNone || r == KErrNotFound);
 	test.Printf(_L("fsName = \"%S\".\n"), &fsName);
 
 	if (machUid == HAL::EMachineUid_Brutus)
--- a/kerneltest/f32test/server/t_scan.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_scan.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -13,7 +13,6 @@
 // Description:
 //
 
-#define	__E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include "t_server.h"
@@ -58,11 +57,11 @@
 
 	TInt r;
 	r=TheFs.SetAtt(_L("\\F32-TST\\SCANTEST\\Left\\Dir3\\Dir4\\Hidden"), KEntryAttHidden, 0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetAtt(_L("\\F32-TST\\SCANTEST\\Left\\Dir3\\Dir4\\Hidden\\HiddenFile"), KEntryAttHidden, 0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetAtt(_L("\\F32-TST\\SCANTEST\\Left\\Dir3\\Dir4\\Hidden\\System"), KEntryAttSystem, 0);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	}
 
 LOCAL_C void Test1()
@@ -237,12 +236,12 @@
 	TheFs.SetAllocFailure(gAllocFailOff);
 	TFileName sessionPath;
 	TInt r=TheFs.SessionPath(sessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	r=TheFs.SetSessionPath(_L("N:\\"));
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TAutoClose<RFs> fs;
 	r=fs.iObj.Connect();
-	test_KErrNone(r);
+	test(r==KErrNone);
 	CDirScan* scanner=CDirScan::NewL(fs.iObj);
 	TParse dirName;
 	TheFs.Parse(sessionPath,dirName);
@@ -265,7 +264,7 @@
 		}
 	delete scanner;
 	r=TheFs.SetSessionPath(sessionPath);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	TheFs.SetAllocFailure(gAllocFailOn);
 	}
 
@@ -388,7 +387,7 @@
 	TPtrC romPath(_L("Z:\\"));
 	TParse dirName;
 	TInt r=TheFs.Parse(romPath,dirName);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	scanner->SetScanDataL(dirName.FullName(),KEntryAttDir,ESortByName);
 	CDir* entryList;
 	FOREVER
--- a/kerneltest/f32test/server/t_vfat.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_vfat.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,7 +15,6 @@
 // 
 //
 
-#define __E32TEST_EXTENSION__
 #include <f32file.h>
 #include <e32test.h>
 #include <e32math.h>
@@ -57,15 +56,15 @@
 		TBuf<32> longName=namelong;
 		longName.AppendNum(fileNum);
 		TInt r=TheFs.Rename(shortName,longName);
-		test_KErrNone(r);
+		test(r==KErrNone);
 		}
 
 	TInt r=TheFs.CheckDisk(gSessionPath);
-	test_Value(r, r == KErrNone || r==KErrNotSupported);
+	test(r==KErrNone || r==KErrNotSupported);
 
 	CDir* dirList;
 	r=TheFs.GetDir(_L("*.*"),KEntryAttMaskSupported,ESortBySize,dirList);
-	test_KErrNone(r);
+	test(r==KErrNone);
 	test(dirList->Count()==totalFiles);
 	for (i=0;i<totalFiles;i++)
 		{
@@ -130,7 +129,7 @@
 			if (fileName==_L(""))
 				goto End;
 			r=TheFs.Delete(fileName);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			gFileName[fileNum]=_L("");
 			goto End;
 		default:
@@ -143,14 +142,14 @@
 			TInt r;
 			RFile thing;
 			r=thing.Open(TheFs, fileName, EFileShareAny);
-			test_Value(r, r == KErrNone || r==KErrNotFound);
+			test (r==KErrNone || r==KErrNotFound);
 			if (r==KErrNone)
 				{
 				TInt s;
 				test (thing.Size(s) == KErrNone);
 				thing.Close();
 				r=TheFs.Delete(fileName);
-				test_KErrNone(r);
+				test (r==KErrNone);
 				gFileName[s]=_L("");
 				}
 			else
@@ -169,7 +168,7 @@
 			TInt r=TheFs.Rename(gFileName[fileNum],fileName);
             if (r != KErrNone && r != KErrAlreadyExists)
                 test.Printf(_L("Rename returned %d at line %d"), r, __LINE__);
-			test_Value(r, r == KErrNone || r==KErrAlreadyExists);
+			test(r==KErrNone || r==KErrAlreadyExists);
 			if (r==KErrNone)
 				gFileName[fileNum]=fileName;
 			}
@@ -178,11 +177,11 @@
 			{
 			test.Printf(_L("Iteration %d    \r"),gMaxIterations-maxIterations);
 			TInt r=TheFs.CheckDisk(gSessionPath);
-			test_Value(r, r == KErrNone || r==KErrNotSupported);
+			test(r==KErrNone || r==KErrNotSupported);
 			TInt count=0;
 			CDir* dirList;
 			r=TheFs.GetDir(_L("*.*"),KEntryAttMaskSupported,ESortBySize,dirList);
-			test_KErrNone(r);
+			test(r==KErrNone);
 			for(i=0;i<gMaxFiles;i++)
 				{
 				if (gFileName[i]==_L(""))
@@ -232,19 +231,19 @@
     TEntry  entry;
 
     nRes = TheFs.Entry(KName1, entry);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
     test(entry.iName.CompareF(KExpectedName) == 0);
 
     nRes = TheFs.Entry(KName2, entry);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
     test(entry.iName.CompareF(KExpectedName) == 0);
 
     nRes = TheFs.Entry(KName3, entry);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
     test(entry.iName.CompareF(KExpectedName) == 0);
 
     nRes = TheFs.Entry(KName3, entry);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
     test(entry.iName.CompareF(KExpectedName) == 0);
 }
 
@@ -274,46 +273,46 @@
 
     //----- create and check "\\file1"
     nRes = file.Replace(TheFs, KName1, EFileWrite);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
     file.Close();
     
     DoCheckTD_FN();
 
     nRes = TheFs.Delete(KName1);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
 
     //----- create and check "\\file1."
     nRes = file.Replace(TheFs, KName2, EFileWrite);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
     file.Close();
     
     DoCheckTD_FN();
 
     nRes = TheFs.Delete(KName2);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
 
     //----- create and check "\\file1.."
     nRes = file.Replace(TheFs, KName3, EFileWrite);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
     file.Close();
     
     DoCheckTD_FN();
 
     nRes = TheFs.Delete(KName3);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
 
     //----- create and check "\\file1..."
     nRes = file.Replace(TheFs, KName4, EFileWrite);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
     file.Close();
     
     DoCheckTD_FN();
     
     nRes = TheFs.Delete(KName4);
-    test_KErrNone(nRes);
+    test(nRes == KErrNone);
 
 
 }
--- a/kerneltest/f32test/server/t_wcache.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/server/t_wcache.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -28,8 +28,6 @@
 #include <f32dbg.h>
 #include "t_server.h"
 #include <e32twin.h>
-#include <hal.h>
-#include "tf32testtimer.h"
 
 const TInt KTotalCacheSize = 32 * 1024 * 1024;
 const TInt KDefaultCacheSize = (128 + 12) * 1024; 	// This size is the default configuration size
@@ -91,6 +89,7 @@
 const TInt KOneMeg = KOneK * 1024;
 const TInt KBlockSize = KOneK;
 const TInt KWaitRequestsTableSize = 256;
+const TInt KMs = 1000; 
 
 TInt gSecondFileSize = 0; 
 TInt gFirstFileSize = 0;
@@ -103,6 +102,9 @@
 TBuf16<25> gCurrentFile;
 
 TInt gNextFile = 0;
+TTime gTime1;
+TTime gTime2;
+
 
 // Concurrent Threads
 RThread gThread1;
@@ -511,22 +513,25 @@
 	
 	@return time taken to perform the operation in uS
 */
-TTimeIntervalMicroSeconds WriteTestFile(RFile& aFile, TDes16& aFileName, TInt aSize, TInt aBlockSize, TInt aMode) 
+TInt WriteTestFile(RFile& aFile, TDes16& aFileName, TInt aSize, TInt aBlockSize, TInt aMode) 
 	{
 	RTest test(_L("T_WCACHE"));
 
+	TTime startTime;
+	TTime endTime;
 	TInt r = 0;
-
-    TF32TestTimer timer;
-	timer.Start();
+	
+	startTime.HomeTime();
 	
 	r = WriteFile(gTheFs,aFile, aFileName , aSize * KOneK, aBlockSize, gBufWritePtr, aMode);
 	test_KErrNone(r);
-
-	timer.Stop();	
-	gTimeTakenBigFile = timer.Time();
+	
+	endTime.HomeTime();
+	
+	gTimeTakenBigFile = I64LOW(endTime.MicroSecondsFrom(startTime).Int64());
+	
 	test.Close();
-	return timer.Time();        
+	return I64LOW(gTimeTakenBigFile.Int64());
 	}
 
 /** Measure the time taken for this file to be read synchronously
@@ -540,16 +545,18 @@
 	@return time taken to perform the operation in uS
 
 */
-TTimeIntervalMicroSeconds ReadTestFile(RFile& aFile, TDes16& aFileName, TInt aSize, TInt aBlockSize, TInt aMode) 
+TInt ReadTestFile(RFile& aFile, TDes16& aFileName, TInt aSize, TInt aBlockSize, TInt aMode) 
 	{
-    TF32TestTimer timer;
-	timer.Start();
+	TTime startTime;
+	TTime endTime;
+	
+	startTime.HomeTime();
 	ReadFile(gTheFs,aFile, aFileName, aSize * KOneK, aBlockSize, aMode);
-	timer.Stop();
+	endTime.HomeTime();
 	
-	gTimeTakenBigFile = timer.Time();
-        	
-	return timer.Time();
+	gTimeTakenBigFile = I64LOW(endTime.MicroSecondsFrom(startTime).Int64());
+	
+	return I64LOW(gTimeTakenBigFile.Int64()) ;
 	}
 
 /** Read asynchronously the test file from the disc
@@ -562,19 +569,22 @@
 
 	@return time taken to perform the operation in uS
 */
-TTimeIntervalMicroSeconds ReadAsyncTestFile(RFile& file, TDes16& aFile, TInt aSize, TInt aBlockSize, TInt aMode) 
+TInt ReadAsyncTestFile(RFile& file, TDes16& aFile, TInt aSize, TInt aBlockSize, TInt aMode) 
 	{
+	TTime startTime;
+	TTime endTime;
 	TRequestStatus status[KWaitRequestsTableSize];
-    TF32TestTimer timer;
-	timer.Start();
+	
+	startTime.HomeTime();
 	
 	ReadFileAsync(gTheFs, file, aFile, aSize * KOneK, aBlockSize, status, aMode);
 	WaitForAll(status,  (aSize * KOneK)/KBlockSize);
-	timer.Stop();	
-		
-	gTimeTakenBigFile = timer.Time();
+	
+	endTime.HomeTime();
 	
-	return timer.Time();
+	gTimeTakenBigFile = I64LOW(endTime.MicroSecondsFrom(startTime).Int64());
+	
+	return I64LOW(gTimeTakenBigFile.Int64());
 	}
 
 /** Read asynchronously the test file from the disc
@@ -586,19 +596,22 @@
 
 	@return time taken to perform the operation in uS
 */
-TTimeIntervalMicroSeconds WriteAsyncTestFile(RFile& aFile, TDes16& aFileName, TInt aSize, TInt aMode) 
+TInt WriteAsyncTestFile(RFile& aFile, TDes16& aFileName, TInt aSize, TInt aMode) 
 	{
+	TTime startTime;
+	TTime endTime;
 	TRequestStatus status[KWaitRequestsTableSize];
-    TF32TestTimer timer;
-    timer.Start();
+	
+	startTime.HomeTime();
 	
 	WriteFileAsync(gTheFs, aFile, aFileName, aSize * KOneK, aMode, status );
 	WaitForAll(status, (aSize * KOneK)/KBlockSize);
-	timer.Stop();	
+	
+	endTime.HomeTime();
 	
-	gTimeTakenBigFile = timer.Time();
+	gTimeTakenBigFile = I64LOW(endTime.MicroSecondsFrom(startTime).Int64());
 	
-	return timer.Time();
+	return I64LOW(gTimeTakenBigFile.Int64());
 	}
 
 /**  Test Boundaries
@@ -608,9 +621,9 @@
 void TestBoundaries()
 	{
 	TInt r = 0;
-	TTimeIntervalMicroSeconds time = 0;
-	TTimeIntervalMicroSeconds rtime = 0;
-	TTimeIntervalMicroSeconds tcreate = 0;
+	TInt time = 0;
+	TInt rtime = 0;
+	TInt tcreate = 0;
 	RFile fileWriter;
 	RFile fileWriter2;
 	RFile fileReader;
@@ -628,22 +641,21 @@
 		test.Printf(_L("\nSync: Write from 1 K to %d K \n"), i); 
 
 		tcreate = WriteTestFile(fileWriter, gSecondFile, i, KBlockSize, EFileShareAny|EFileWrite|EFileWriteDirectIO);
-		test.Printf(_L("Time to write %d K without caching: %d mS\n"), i, TF32TestTimer::TimeInMilliSeconds(tcreate));	
+		test.Printf(_L("Time to write %d K without caching: %d mS\n"), i, tcreate/KMs);	
 		fileWriter.Close();
 
 		time =  WriteTestFile(fileWriter2, gFirstFile, i, KBlockSize, EFileShareAny|EFileWrite|EFileWriteBuffered);
-		test.Printf(_L("Time to write %d K WITH caching: %d mS\n"), i, TF32TestTimer::TimeInMilliSeconds(time));
+		test.Printf(_L("Time to write %d K WITH caching: %d mS\n"), i, time/KMs);
 
 		rtime = ReadTestFile(fileReader, gFirstFile, i, KBlockSize, EFileShareAny|EFileRead|EFileReadBuffered);
-		test.Printf(_L("Time to read %d K from the cache: %d mS\n"), i, TF32TestTimer::TimeInMilliSeconds(rtime));
+		test.Printf(_L("Time to read %d K from the cache: %d mS\n"), i, rtime/KMs);
+
 
 		fileReader.Close();	
 		fileWriter2.Close();
 		
 		#if !defined(__WINS__)
-            test(tcreate > TTimeIntervalMicroSeconds(0));  // test measured time is correct
-			test(tcreate > time);
-            test(tcreate > rtime); 
+			test((tcreate > time) || (tcreate > rtime)); 
 		#endif
 
 		r = gTheFs.Delete(gFirstFile);
@@ -664,23 +676,21 @@
 		test.Printf(_L("\nAsync: Write from 1 K to %d K \n"), i); 
 
 		tcreate = WriteAsyncTestFile(fileWriter, gSecondFile, i, EFileShareAny|EFileWrite|EFileWriteDirectIO);
-		test.Printf(_L("Time to write %d K without caching: %d mS\n"), i, TF32TestTimer::TimeInMilliSeconds(tcreate));
+		test.Printf(_L("Time to write %d K without caching: %d mS\n"), i, tcreate/KMs);	
 		fileWriter.Close();
 
 		time =  WriteAsyncTestFile(fileWriter2, gFirstFile, i,EFileShareAny|EFileWrite|EFileWriteBuffered);
-		test.Printf(_L("Time to write %d K WITH caching: %d mS\n"), i, TF32TestTimer::TimeInMilliSeconds(time));
+		test.Printf(_L("Time to write %d K WITH caching: %d mS\n"), i, time/KMs);
 
 
 		rtime = ReadAsyncTestFile(fileReader, gFirstFile, i, KBlockSize, EFileShareAny|EFileRead|EFileReadBuffered);
-		test.Printf(_L("Time to read %d K from the cache: %d mS\n"), i, TF32TestTimer::TimeInMilliSeconds(rtime));
+		test.Printf(_L("Time to read %d K from the cache: %d mS\n"), i, rtime/KMs);
 
 		fileReader.Close();	
 		fileWriter2.Close();
 		
 		#if !defined(__WINS__)
-            test(tcreate > TTimeIntervalMicroSeconds(0));  // test measured time is correct
-			test(tcreate > time);
-            test(tcreate > rtime);
+			test((tcreate > time) || (tcreate > rtime));  
 		#endif
 
 		r = gTheFs.Delete(gFirstFile);
@@ -739,16 +749,17 @@
 	
 	@return returns the time that took to do the verification in mS, fails if the file is not corrupted/modified
 */
-TTimeIntervalMicroSeconds ReadTestFileVerif(TDes16& aFile)
+TInt ReadTestFileVerif(TDes16& aFile)
 	{
+	TTime startTime;
+	TTime endTime;
 	TInt r = 0;
 	TInt size = 0;
 	RFile fileRead;
 	TInt corrupt = 0;
 	TBool isFat=IsFSFAT(gTheFs,gDrive);
-
-    TF32TestTimer timer;
-	timer.Start();
+	
+	startTime.HomeTime();
 	
 	r = fileRead.Open(gTheFs,aFile,EFileShareAny|EFileRead|EFileReadBuffered|EFileReadAheadOff);
 	test_KErrNone(r);
@@ -780,11 +791,12 @@
 	fileRead.Close();
 	
 	test(corrupt>0); // Ensure the cache returns the changed content 
-	timer.Stop();	
+	
+	endTime.HomeTime();
 	
-	gTimeTakenBigFile = timer.Time();
+	gTimeTakenBigFile = I64LOW(endTime.MicroSecondsFrom(startTime).Int64());
 	
-	return timer.Time();
+	return I64LOW(gTimeTakenBigFile.Int64()) / KMs;
 	}
 
 /**  Modifies the second file
@@ -798,7 +810,7 @@
 	TPtr8 dummyPtr(NULL, 0);	
 
 	TRAPD(res,dummy = HBufC8::NewL(4));
-	test_Value(res, res == KErrNone && dummy != NULL);
+	test(res == KErrNone && dummy != NULL);
 		
 	dummyPtr.Set(dummy->Des());
 	FillBuffer(dummyPtr, 4, '1');
@@ -828,8 +840,8 @@
 LOCAL_C void TestIntegrity()
 	{
 	TInt r = 0;
-	TTimeIntervalMicroSeconds time;
-	TTimeIntervalMicroSeconds tcreate = 0;
+	TInt time;
+	TInt tcreate = 0;
 	RFile file;
 	
 	// Modify file in some position 
@@ -838,14 +850,14 @@
 	test.Printf(_L("\nSync: Write from 1 K to %d K \n"), 255); 
 
 	tcreate = WriteTestFile(file, gSecondFile, 255, KBlockSize, EFileShareAny|EFileWrite|EFileWriteBuffered);
-	test.Printf(_L("Time to write %d K with caching: %d mS\n"), 255, TF32TestTimer::TimeInMilliSeconds(tcreate));	
+	test.Printf(_L("Time to write %d K with caching: %d mS\n"), 255, tcreate/KMs);	
 	file.Close();
 
 	test.Printf(_L("Mess the content that is still in the cache\n"));
 	CorruptSecondFile(); 
 	
 	time = ReadTestFileVerif(gSecondFile);	
-	test.Printf(_L("Time taken to verify: %ld\n"),time.Int64());
+	test.Printf(_L("Time taken to verify: %d\n"),time);
 	
 	test.Printf(_L("Integrity verified\n"));
 
@@ -881,7 +893,7 @@
 	TInt KBigBifferSize = 32 * KOneK;
 	
 	TRAPD(res,bigBuf = HBufC8::NewL(KBigBifferSize));
-	test_Value(res, res == KErrNone && bigBuf != NULL);
+	test(res == KErrNone && bigBuf != NULL);
 		
 	TPtr8 bigBufWritePtr(NULL, 0);	
 	bigBufWritePtr.Set(bigBuf->Des());
@@ -947,7 +959,7 @@
 	HBufC8* bigBuf = NULL;
 	const TInt KBigBifferSize = 32 * 1024;
 	TRAPD(res,bigBuf = HBufC8::NewL(KBigBifferSize));
-	test_Value(res, res == KErrNone && bigBuf != NULL);
+	test(res == KErrNone && bigBuf != NULL);
 		
 	TPtr8 bigBufWritePtr(NULL, 0);	
 	bigBufWritePtr.Set(bigBuf->Des());
@@ -1004,7 +1016,7 @@
 	TPtr8 bufPtr(NULL, 0);	
 	
 	TRAPD(res,buf = HBufC8::NewL(2));
-	test_Value(res, res == KErrNone && buf != NULL);
+	test(res == KErrNone && buf != NULL);
 	bufPtr.Set(buf->Des());
 	
 	directory = gSessionPath;
@@ -1166,7 +1178,7 @@
 */
 void TestRemoval()
 	{	
-	TTimeIntervalMicroSeconds time = 0, rtime = 0;
+	TInt time = 0, rtime = 0;
 	RFile file1, file2;
 	
 		 	
@@ -1202,7 +1214,7 @@
 
 
 	TRAPD(res,gBuf = HBufC8::NewL(KBlockSize+1));
-	test_Value(res, res == KErrNone && gBuf != NULL);
+	test(res == KErrNone && gBuf != NULL);
 		
 	gBufWritePtr.Set(gBuf->Des());
 	FillBuffer(gBufWritePtr, KBlockSize, 'A');
@@ -1215,7 +1227,7 @@
 	test.Printf(_L("\nSync: Write from 1 K to 254 K \n")); 
 
 	time =  WriteTestFile(file1, gSecondFile, KMinSize, KBlockSize, EFileShareAny|EFileWrite|EFileWriteBuffered);
-	test.Printf(_L("Time to write %d K WITH caching: %d mS\n"), KMinSize, TF32TestTimer::TimeInMilliSeconds(time));
+	test.Printf(_L("Time to write %d K WITH caching: %d mS\n"), KMinSize, time/KMs);
 	test.Printf(_L("Remove MMC card,! and then press a key\n"));
 	test.Getch();
 
@@ -1223,7 +1235,7 @@
 	test.Getch();
 
 	rtime = ReadTestFile(file2, gSecondFile, KMinSize, KBlockSize, EFileShareAny|EFileRead|EFileReadBuffered);
-	test.Printf(_L("Time to read %d K from the cache: %d mS\n"), KMinSize, TF32TestTimer::TimeInMilliSeconds(rtime));
+	test.Printf(_L("Time to read %d K from the cache: %d mS\n"), KMinSize, rtime/KMs);
 
 	test.Printf(_L("Remove MMC card! and then press a key\n"));
 	test.Getch();
@@ -1235,7 +1247,7 @@
 	test.Printf(_L("\nSync: Write from 1 K to 255 K \n")); 
 
 	time =  WriteTestFile(file1, gFirstFile, KMinSize + 1 , KBlockSize, EFileShareAny|EFileWrite|EFileWriteBuffered);
-	test.Printf(_L("Time to write %d K WITH caching: %d mS\n"), KMinSize + 1, TF32TestTimer::TimeInMilliSeconds(time));
+	test.Printf(_L("Time to write %d K WITH caching: %d mS\n"), KMinSize + 1, time/KMs);
 	test.Printf(_L("Remove MMC card and delete the file //F32-TST//FFFFFFF0.TXT and then press a key\n"));
 	test.Getch();
 
@@ -1243,7 +1255,7 @@
 	test.Getch();
 
 	rtime = ReadTestFile(file2, gFirstFile, KMinSize + 1, KBlockSize, EFileShareAny|EFileRead|EFileReadBuffered);
-	test.Printf(_L("Time to read %d K from the cache: %d mS\n"), KMinSize + 1, TF32TestTimer::TimeInMilliSeconds(rtime));
+	test.Printf(_L("Time to read %d K from the cache: %d mS\n"), KMinSize + 1, rtime/KMs);
 
 	test.Printf(_L("Remove MMC card! and then press a key\n"));
 	test.Getch();
@@ -1287,7 +1299,7 @@
 
 
 	TRAPD(res,gBuf = HBufC8::NewL(KBlockSize+1));
-	test_Value(res, res == KErrNone && gBuf != NULL);
+	test(res == KErrNone && gBuf != NULL);
 		
 	gBufWritePtr.Set(gBuf->Des());
 	FillBuffer(gBufWritePtr, KBlockSize, 'A');
@@ -1355,8 +1367,10 @@
 	TVolumeInfo volInfo;
 	TInt r = gTheFs.Volume(volInfo, gDrive);
 	test_KErrNone(r);
-	gMediaSize = volInfo.iFree;	
-	test.Printf(_L("\nMedia free space: %d MB\n"), gMediaSize/KOneMeg);
+	gMediaSize = volInfo.iSize;
+	
+	test.Printf(_L("\nMedia size: %d MB\n"), gMediaSize/KOneMeg  );
+	
 	return ETrue;
 	}
 
--- a/kerneltest/f32test/smassstorage/scsiprot/t_ms_scsi.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/smassstorage/scsiprot/t_ms_scsi.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -591,30 +591,31 @@
 : iMount(aMount)
 	{}
 
-EXPORT_C TInt CProxyDrive::ControlIO(const RMessagePtr2&, TInt, TAny*, TAny*)
+TInt CProxyDrive::ControlIO(const RMessagePtr2&, TInt, TAny*, TAny*)
 	{ return KErrNone; }
 
-EXPORT_C TInt CProxyDrive::Read (TInt64 aPos, TInt aLength, const TAny* aTrg, TInt, TInt, TInt)
+TInt CProxyDrive::Read (TInt64 aPos, TInt aLength, const TAny* aTrg, TInt, TInt, TInt)
 	{ return Read(aPos, aLength, *(TDes8*)aTrg); }
 
-EXPORT_C TInt CProxyDrive::Write (TInt64 aPos, TInt, const TAny* aSrc, TInt, TInt, TInt)
+TInt CProxyDrive::Write (TInt64 aPos, TInt, const TAny* aSrc, TInt, TInt, TInt)
 	{ return Write(aPos, *(TDesC8*)aSrc); }
 
 // Implemented the GetInterface method here as this are usually 
 // exported by EFILE, but these unit tests don't link to it.
 
-EXPORT_C TInt CProxyDrive::GetInterface(TInt /*aInterfaceId*/, TAny*& /*aInterface*/, TAny* /*aInput*/)
+TInt CProxyDrive::GetInterface(TInt /*aInterfaceId*/, TAny*& /*aInterface*/, TAny* /*aInput*/)
 	{ return KErrNotSupported; }
 
 // Implemented the GetLastErrorInfo method here as this is usually 
 // exported by EFILE, but these unit tests don't link to it.
-EXPORT_C TInt CProxyDrive::GetLastErrorInfo(TDes8& /*anErrorInfo*/)
+TInt CProxyDrive::GetLastErrorInfo(TDes8& /*anErrorInfo*/)
 	{ return KErrNotSupported; }
 
 CProxyDrive::~CProxyDrive()
 	{ }
 
-EXPORT_C TInt CProxyDrive::DeleteNotify(TInt64, TInt)
+
+TInt CProxyDrive::DeleteNotify(TInt64, TInt)
 	{ return KErrNone; }
 
 
--- a/kerneltest/f32test/smassstorage/src/t_ms_fsunit.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kerneltest/f32test/smassstorage/src/t_ms_fsunit.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -195,10 +195,10 @@
 	return KErrNone;
 	}
 //------------------------------------	
-EXPORT_C CFileSystem::CFileSystem(void)
+CFileSystem::CFileSystem(void)
 	{
 	}
-EXPORT_C CFileSystem::~CFileSystem(void)
+CFileSystem::~CFileSystem(void)
 	{
 	}
 	
@@ -295,7 +295,7 @@
 CFsDispatchObject::~CFsDispatchObject()
 	{
 	}
-EXPORT_C int CFsDispatchObject::IsCorrectThread(void)
+int CFsDispatchObject::IsCorrectThread(void)
 	{
 	return ETrue;
 	}
@@ -309,12 +309,12 @@
 	aFileStart=NULL;
 	}
 
-EXPORT_C int CLocDrvMountCB::CreateLocalDrive(class TBusLocalDrive &) 
+int CLocDrvMountCB::CreateLocalDrive(class TBusLocalDrive &) 
 
 	{
 	return KErrNone;
 	}
-EXPORT_C void CLocDrvMountCB::DismountedLocalDrive(void) 
+void CLocDrvMountCB::DismountedLocalDrive(void) 
 	{
 	}
 	
@@ -325,12 +325,12 @@
 // Implement the GetInterface methods here as these are usually 
 // exported by EFILE, but these unit tests don't link to it.
 
-EXPORT_C TInt CMountCB::GetInterface(TInt /*aInterfaceId*/, TAny*& /*aInterface*/, TAny* /*aInput*/)
+TInt CMountCB::GetInterface(TInt /*aInterfaceId*/, TAny*& /*aInterface*/, TAny* /*aInput*/)
 	{
 	return KErrNotSupported;
 	}
 
-EXPORT_C TInt CFileSystem::GetInterface(TInt /*aInterfaceId*/, TAny*& /*aInterface*/, TAny* /*aInput*/)
+TInt CFileSystem::GetInterface(TInt /*aInterfaceId*/, TAny*& /*aInterface*/, TAny* /*aInput*/)
 	{
 	return KErrNotSupported;
 	}
--- a/package_definition.xml	Tue Aug 31 16:34:26 2010 +0300
+++ b/package_definition.xml	Wed Sep 01 12:34:56 2010 +0100
@@ -26,12 +26,6 @@
       <component id="f32test" name="File Server Tests" purpose="development">
         <unit bldFile="kerneltest/f32test/group" mrp="kerneltest/f32test/group/base_f32test.mrp"/>
       </component>
-      <component id="rofstests" name="Read Only File System Tests" purpose="development">
-        <unit bldFile="kerneltest/f32test/rofs" mrp="kerneltest/f32test/rofs/rofs_tests.mrp"/>
-      </component>
-      <component id="loadertest" name="Loader Tests" purpose="development">
-        <unit bldFile="kerneltest/f32test/loader" mrp="kerneltest/f32test/loader/base_loader.mrp"/>
-      </component>
     </collection>
     <collection id="ldds" name="Logical Device Drivers" level="adaptation">
       <component id="ethernetldd" name="Ethernet Drivers" purpose="optional">
@@ -50,12 +44,15 @@
         <!-- these are LDDs for storage media-->
         <unit bldFile="kernel/eka/drivers/locmedia" mrp="kernel/eka/drivers/locmedia/base_e32_drivers_locmedia.mrp"/>
       </component>
-      <component id="stopmodedebugdriver" name="Stop Mode Debug Driver" purpose="mandatory">
+      <component id="runmodedebugger" name="Run Mode Debugger" purpose="mandatory">
 		<unit bldFile="kernel/eka/drivers/debug/group" mrp="kernel/eka/drivers/debug/group/base_e32_drivers_debug.mrp"/>	    
       </component>
       <component id="btrace" name="Kernel Trace Tool" purpose="mandatory">
         <unit bldFile="kernel/eka/drivers/trace" mrp="kernel/eka/drivers/trace/base_e32_drivers_trace.mrp"/>
       </component>
+      <component id="cameraldd" name="Camera Drivers" introduced="^3" purpose="optional">
+        <unit bldFile="kernel/eka/drivers/camerasc" mrp="kernel/eka/drivers/camerasc/base_drivers_camerasc.mrp"/>
+      </component>
       <component id="displayldd" name="Display Drivers" introduced="^3" purpose="optional">
         <!-- owned and maintained by graphics package. To be moved there as soon as technical limitations are resolved -->
         <unit bldFile="kernel/eka/drivers/display" mrp="kernel/eka/drivers/display/base_e32_drivers_display.mrp"/>
--- a/package_map.xml	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-<PackageMap root="sf" layer="os"/>
--- a/userlibandfileserver/fileserver/automounter/base_f32_automounter.mrp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/automounter/base_f32_automounter.mrp	Wed Sep 01 12:34:56 2010 +0100
@@ -1,4 +1,4 @@
-# component name "Automounter File System"
+# component name "exFAT File System"
 
 component   base_f32_automounter
 
--- a/userlibandfileserver/fileserver/bmarm/efileu.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/bmarm/efileu.def	Wed Sep 01 12:34:56 2010 +0100
@@ -240,5 +240,5 @@
 	DriveInfo__C11CFileSystemR10TDriveInfoi @ 239 NONAME R3UNUSED ; CFileSystem::DriveInfo(TDriveInfo &, int) const
 	GetDriveInfo__FR10TDriveInfoi @ 240 NONAME R3UNUSED ; GetDriveInfo(TDriveInfo &, int)
 	Volume__C9RFsPluginR11TVolumeInfoi @ 241 NONAME R3UNUSED ; RFsPlugin::Volume(TVolumeInfo &, int) const
-	IsSequentialMode__C7CFileCB @ 242 NONAME R3UNUSED ; CFileCB::IsSequentialMode(void) const
-	DirectIOMode__7CFileCBRC12RMessagePtr2 @ 243 NONAME R3UNUSED ; CFileCB::DirectIOMode(RMessagePtr2 const &)
+	DirectIOMode__7CFileCBRC12RMessagePtr2 @ 242 NONAME R3UNUSED ; CFileCB::DirectIOMode(RMessagePtr2 const &)
+
--- a/userlibandfileserver/fileserver/bwins/efileu.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/bwins/efileu.def	Wed Sep 01 12:34:56 2010 +0100
@@ -241,5 +241,5 @@
 	?DriveInfo@CFileSystem@@UBEXAAVTDriveInfo@@H@Z @ 240 NONAME ; void CFileSystem::DriveInfo(class TDriveInfo &, int) const
 	?GetDriveInfo@@YAXAAVTDriveInfo@@H@Z @ 241 NONAME ; void GetDriveInfo(class TDriveInfo &, int)
 	?Volume@RFsPlugin@@QBEHAAVTVolumeInfo@@H@Z @ 242 NONAME ; int RFsPlugin::Volume(class TVolumeInfo &, int) const
-	?IsSequentialMode@CFileCB@@QBEHXZ @ 243 NONAME ; int CFileCB::IsSequentialMode(void) const
-	?DirectIOMode@CFileCB@@QAEHABVRMessagePtr2@@@Z @ 244 NONAME ; int CFileCB::DirectIOMode(class RMessagePtr2 const &)
+	?DirectIOMode@CFileCB@@QAEHABVRMessagePtr2@@@Z @ 243 NONAME ; int CFileCB::DirectIOMode(class RMessagePtr2 const &)
+
--- a/userlibandfileserver/fileserver/bx86/efileu.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/bx86/efileu.def	Wed Sep 01 12:34:56 2010 +0100
@@ -241,6 +241,4 @@
 	?DriveInfo@CFileSystem@@UBEXAAVTDriveInfo@@H@Z @ 240 NONAME ; public: virtual void __thiscall CFileSystem::DriveInfo(class TDriveInfo &,int)const 
 	?GetDriveInfo@@YAXAAVTDriveInfo@@H@Z @ 241 NONAME ; void __cdecl GetDriveInfo(class TDriveInfo &,int)
 	?Volume@RFsPlugin@@QBEHAAVTVolumeInfo@@H@Z @ 242 NONAME ; public: int __thiscall RFsPlugin::Volume(class TVolumeInfo &,int)const 
-	?IsSequentialMode@CFileCB@@QBEHXZ @ 243 NONAME ; public: int __thiscall CFileCB::IsSequentialMode(void)const 
-	?DirectIOMode@CFileCB@@QAEHABVRMessagePtr2@@@Z @ 244 NONAME ; int CFileCB::DirectIOMode(class RMessagePtr2 const &)
-
+	?DirectIOMode@CFileCB@@QAEHABVRMessagePtr2@@@Z @ 243 NONAME ; int CFileCB::DirectIOMode(class RMessagePtr2 const &)
\ No newline at end of file
--- a/userlibandfileserver/fileserver/eabi/efileu.def	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/eabi/efileu.def	Wed Sep 01 12:34:56 2010 +0100
@@ -313,6 +313,5 @@
 	_Z12GetDriveInfoR10TDriveInfoi @ 312 NONAME
 	_ZNK11CFileSystem9DriveInfoER10TDriveInfoi @ 313 NONAME
 	_ZNK9RFsPlugin6VolumeER11TVolumeInfoi @ 314 NONAME
-	_ZNK7CFileCB16IsSequentialModeEv @ 315 NONAME
-	_ZN7CFileCB12DirectIOModeERK12RMessagePtr2 @ 316 NONAME
+	_ZN7CFileCB12DirectIOModeERK12RMessagePtr2 @ 315 NONAME
 
--- a/userlibandfileserver/fileserver/etshell/ts_com.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/etshell/ts_com.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -42,7 +42,6 @@
 //	lint -e40,e30
 const TShellCommand CShell::iCommand[ENoShellCommands]=
 	{
-//	TShellCommand(_L("BLANK"),_L("Help"),_L("-?"),TShellCommand::EDSwitch,ShellFunction::BLANK),
 	TShellCommand(_L("ATTRIB"),_L("Displays or changes file attributes"),_L("[drive:][path][filename] [+R | -R] [+H |-H] [+S | -S] [+A | -A] [/p]\n\n  /p - Pause after each screen of information"), TShellCommand::EPSwitch, ShellFunction::Attrib),
 	TShellCommand(_L("CD"),_L("Change the current directory for a drive"),_L("[path] [/d]\n\n  /d - Change drive"),TShellCommand::EDSwitch,ShellFunction::Cd),
 	TShellCommand(_L("CHKDEPS"),_L("Check the dependencies of an executable or a Dll (ARM only)"),_L("[Filename.EXE] or [Filename.DLL]"),0,ShellFunction::ChkDeps),
@@ -50,7 +49,6 @@
 	TShellCommand(_L("COPY"),_L("Copy one (or more) file(s), overwriting existing one(s)"),_L("source [destination]"),TShellCommand::ESSwitch,ShellFunction::Copy),
 	TShellCommand(_L("DEL"),_L("Delete one file"),_L("[drive:][path][filename]"),TShellCommand::ESSwitch,ShellFunction::Del),
 	TShellCommand(_L("DIR"),_L("Show directory contents"),_L("[drive:][path][filename] [/p][/w]\n\n  /p - Pause after each screen of information\n  /w - Wide format"),TShellCommand::EPSwitch|TShellCommand::EWSwitch|TShellCommand::EASwitch,ShellFunction::Dir),
-//	TShellCommand(_L("EDLIN"),_L("Edit a text file"),_L("[drive:][path][filename] [/p]\n\n  /p - Pause after each screen of information"),TShellCommand::EPSwitch,ShellFunction::Edit),
     TShellCommand(_L("FORMAT"),_L("Format a disk"),ptrFormatHelp,TShellCommand::EQSwitch|TShellCommand::ESSwitch|TShellCommand::EESwitch|TShellCommand::EFSwitch,ShellFunction::Format),
     TShellCommand(_L("GOBBLE"),_L("Create a file"),_L("[filename] size [/e]\n\n /e - create an empty file, without writing any data"),TShellCommand::EESwitch,ShellFunction::Gobble),
 	TShellCommand(_L("HEXDUMP"),_L("Display the contents of a file in hexadecimal"),_L("[drive:][path][filename] [/p]\n\n  /p - Pause after each screen of information\n\n  Hit escape to exit from hexdump "),TShellCommand::EPSwitch,ShellFunction::Hexdump),
@@ -498,13 +496,15 @@
 	TInt r=CShell::TheFs.CharToDrive(CShell::currentPath[0], drive);
 	if (r!=KErrNone)
 		return(r);
+	
 	if (aPath.Length()==0)
 		{
 		r=CShell::TheFs.Volume(vol, drive);
 		if (r==KErrNone)
-			CShell::TheConsole->Printf(_L("Volume = %S\n"),&vol.iName);
+			CShell::Printf(_L("Volume Label:%S\n"),&vol.iName);
 		return(r);
 		}
+	
 	r=CShell::TheFs.SetVolumeLabel(aPath, drive);
 	return(r);
 	}
@@ -582,21 +582,39 @@
 
 }
 
-
-void ShellFunction::OutputContentsToConsole(RPointerArray<HBufC>& aText,TUint aSwitches)
-//outputs content of the buffer to console according to settings passed in aSwitches
+/**
+    outputs content of the buffer to console according to settings passed in aSwitches
+    @return ETrue if the user pressed Esc key 
+*/
+TBool ShellFunction::OutputContentsToConsole(RPointerArray<HBufC>& aText,TUint aSwitches)
 	{
 	if ((aText.Count()>0)&&((aSwitches&TShellCommand::EWSwitch)!=0))
 		AlignTextIntoColumns(aText);
 
-	for (TInt i=0;i<aText.Count();i++)
-		{
-		CShell::OutputStringToConsole(((aSwitches&TShellCommand::EPSwitch)!=0),*aText[i]);
-		CShell::OutputStringToConsole(EFalse,_L("\n"));
+	TKeyCode key=EKeyNull;
+    TInt i;
+
+    for(i=0;i<aText.Count();i++)
+		{                                             
+		key = CShell::WriteBufToConsole(((aSwitches&TShellCommand::EPSwitch)!=0),*aText[i]);
+		if(key == EKeyEscape)
+            break;
+        
+        key = CShell::WriteBufToConsole(EFalse,_L("\n"));
+		if(key == EKeyEscape)
+            break;
+
+		}
+    
+    //-- clean up string array
+    for(i=0; i<aText.Count(); i++)
+        {
 		delete aText[i];
 		}
-	//empty string array
+	
 	aText.Reset();
+
+    return (key == EKeyEscape);
 	}
 
 
@@ -606,6 +624,7 @@
 	TInt count=aDirList->Count();
 	TInt fileCount=0, dirCount=0, printCount=0;
 	TInt64 byteCount=0;
+    TBool bBreak=EFalse;
 
 	//compose an array of strings describing entries in the directory
 	for (TInt j=0;j<count;j++)
@@ -641,42 +660,76 @@
 			TPtr name=buf->Des();
 			name=entry.iName;
 
+            const TPtrC desName(entry.iName);
+            const TBool bNameCut = desName.Length() > 26;
+
+            _LIT(KDots, ">.."); //-- will be displayed if the name is longer than 26 characters
+            _LIT(KSpc,  "   ");
+			
+            
 			if (entry.IsDir())
 				{
 				dirCount++;
-				name.Format(_L(" %- 26S   <DIR>         %+02d/%+02d/%- 4d  %02d:%02d:%02d.%06d"),
-											&entry.iName,modTime.Day()+1,modTime.Month()+1,modTime.Year(),modTime.Hour(),modTime.Minute(),modTime.Second(),modTime.MicroSecond());
+				
+                name.Format(_L(" %- 26S%S<DIR>         %+02d/%+02d/%- 4d  %02d:%02d:%02d.%03d"),
+				    &desName,
+                    bNameCut ? &KDots : &KSpc,
+                    modTime.Day()+1,modTime.Month()+1,modTime.Year(),modTime.Hour(),modTime.Minute(),modTime.Second(),modTime.MicroSecond());
+				
+                //name.Format(_L(" %- 26S   <DIR>         %+02d/%+02d/%- 4d  %02d:%02d:%02d.%06d"),
+				//							&entry.iName,modTime.Day()+1,modTime.Month()+1,modTime.Year(),modTime.Hour(),modTime.Minute(),modTime.Second(),modTime.MicroSecond());
 				}
 			else
 				{
 				TInt64 entrySize = entry.FileSize();
 				byteCount+=entrySize;
 				fileCount++;
- 				name.Format(_L(" %- 32S%+ 15Lu   %+02d/%+02d/%- 4d  %02d:%02d:%02d.%06d"),
- 											&entry.iName,entrySize,modTime.Day()+1,modTime.Month()+1,modTime.Year(),modTime.Hour(),modTime.Minute(),modTime.Second(),modTime.MicroSecond());
+
+                name.Format(_L(" %- 26S%S%-11Lu   %+02d/%+02d/%- 4d  %02d:%02d:%02d.%03d"),
+ 				    &desName,
+                    bNameCut ? &KDots : &KSpc,
+                    entrySize,
+                    modTime.Day()+1,modTime.Month()+1,modTime.Year(),modTime.Hour(),modTime.Minute(),modTime.Second(),modTime.MicroSecond());
+ 				
+                //name.Format(_L(" %- 32S%+ 15Lu   %+02d/%+02d/%- 4d  %02d:%02d:%02d.%06d"),
+ 				//							&entry.iName,entrySize,modTime.Day()+1,modTime.Month()+1,modTime.Year(),modTime.Hour(),modTime.Minute(),modTime.Second(),modTime.MicroSecond());
 				}
 			}
 		User::LeaveIfError(aText.Append(buf ));
 		printCount++;
+		
 		//print the contents if a screen size of data is available. This will prevent huge buffer allocation.
 		if(printCount == CShell::TheConsole->ScreenSize().iHeight)
 			{
-			OutputContentsToConsole(aText,aSwitches);
+			bBreak = OutputContentsToConsole(aText,aSwitches);
 			printCount=0;
 			}
+		
 		CleanupStack::Pop();
 
+        if(bBreak)
+            break;    
 		}
+	
+    if(bBreak)
+        return; //-- the user has interrupted the listing
+
+    
 	OutputContentsToConsole(aText,aSwitches);
 
-	//output summary information
-	CShell::OutputStringToConsole(((aSwitches&TShellCommand::EPSwitch)!=0),_L("    %d File%c\n"),fileCount,(fileCount==1)?' ':'s');
-	if (fileCount!=0)
+	//---------------------------------
+    //-- print out summary information
+	TBuf<100> buf;
+    buf.Format(_L("    %d File%c"), fileCount, (fileCount==1) ? ' ':'s');
+    if(fileCount > 0)
 		{
-		CShell::OutputStringToConsole(((aSwitches&TShellCommand::EPSwitch)!=0),_L("  %lu byte%c\n"),byteCount,(fileCount==1)?' ':'s');
+        buf.AppendFormat(_L(", %LU bytes"), byteCount);
 		}
 
-	TBuf<50> buf;// allocate string long enough for additional information(number of directories)
+    buf.Append(KNl);
+    
+    CShell::OutputStringToConsole(((aSwitches&TShellCommand::EPSwitch)!=0), buf);
+    
 	buf.Format(_L("    %d Director"),dirCount);
 	if (dirCount==1)
 		buf.AppendFormat(_L("y\n"));
@@ -684,6 +737,8 @@
 		buf.AppendFormat(_L("ies\n"));
 
 	CShell::OutputStringToConsole(((aSwitches&TShellCommand::EPSwitch)!=0),buf);
+
+    
 	}
 
 TInt ShellFunction::Dir(TDes& aPath,TUint aSwitches)
@@ -709,7 +764,7 @@
 	TInt r=dir.Open(TheShell->TheFs,aPath,KEntryAttMaskSupported);
 	if (r!=KErrNone)
 		{
-		CShell::TheConsole->Printf(_L("File or directory not found\n"));
+		CShell::Printf(_L("File or directory not found\n"));
 		return(KErrNone);
 		}
 
@@ -724,7 +779,7 @@
 
 	//Sets the new length of path to the position of the last path delimiter +1
 	aPath.SetLength(aPath.LocateReverse(KPathDelimiter)+1);
-	CShell::TheConsole->Printf(_L("Directory of %S\n"),&aPath);
+	CShell::Printf(_L("Directory of %S\n"),&aPath);
 
 	//allocate array to be used as an output buffer
 	RPointerArray<HBufC>* text=new(ELeave) RPointerArray<HBufC>();
@@ -742,13 +797,6 @@
 	};
 
 
-TInt ShellFunction::Edit(TDes& /*aPath*/,TUint /*aSwitches*/)
-//
-//	Dummy, used by edlin (now retired)
-//
-	{
-	return(KErrNone);
-	}
 
 
 TInt ShellFunction::Attrib(TDes& aPath,TUint aSwitches)
@@ -1007,14 +1055,14 @@
         if(aDrvInfo.iDriveAtt & KDriveAttRedirected)    aPrintBuf.Append(_L("KDriveAttRedirected,"));
         if(aDrvInfo.iDriveAtt & KDriveAttSubsted)       aPrintBuf.Append(_L("KDriveAttSubsted,"));
         if(aDrvInfo.iDriveAtt & KDriveAttInternal)      aPrintBuf.Append(_L("KDriveAttInternal,"));
-        if(aDrvInfo.iDriveAtt & KDriveAttRemovable)     aPrintBuf.Append(_L("KDriveAttRemovable"));
-
-        if(aDrvInfo.iDriveAtt & KDriveAttRemote)        aPrintBuf.Append(_L("KDriveAttRemote"));
-        if(aDrvInfo.iDriveAtt & KDriveAttTransaction)   aPrintBuf.Append(_L("KDriveAttTransaction"));
-
-        if(aDrvInfo.iDriveAtt & KDriveAttPageable)              aPrintBuf.Append(_L("KDriveAttPageable"));
-        if(aDrvInfo.iDriveAtt & KDriveAttLogicallyRemovable)    aPrintBuf.Append(_L("KDriveAttLogicallyRemovable"));
-        if(aDrvInfo.iDriveAtt & KDriveAttHidden)                aPrintBuf.Append(_L("KDriveAttHidden"));
+        if(aDrvInfo.iDriveAtt & KDriveAttRemovable)     aPrintBuf.Append(_L("KDriveAttRemovable,"));
+
+        if(aDrvInfo.iDriveAtt & KDriveAttRemote)        aPrintBuf.Append(_L("KDriveAttRemote,"));
+        if(aDrvInfo.iDriveAtt & KDriveAttTransaction)   aPrintBuf.Append(_L("KDriveAttTransaction,"));
+
+        if(aDrvInfo.iDriveAtt & KDriveAttPageable)              aPrintBuf.Append(_L("KDriveAttPageable,"));
+        if(aDrvInfo.iDriveAtt & KDriveAttLogicallyRemovable)    aPrintBuf.Append(_L("KDriveAttLogicallyRemovable,"));
+        if(aDrvInfo.iDriveAtt & KDriveAttHidden)                aPrintBuf.Append(_L("KDriveAttHidden,"));
 
         aPrintBuf.Append(_L("\n"));
     }
@@ -1036,12 +1084,12 @@
         if(aDrvInfo.iMediaAtt & KMediaAttFormattable)       aPrintBuf.Append(_L("KMediaAttFormattable,"));
         if(aDrvInfo.iMediaAtt & KMediaAttWriteProtected)    aPrintBuf.Append(_L("KMediaAttWriteProtected,"));
         if(aDrvInfo.iMediaAtt & KMediaAttLockable)          aPrintBuf.Append(_L("KMediaAttLockable,"));
-        if(aDrvInfo.iMediaAtt & KMediaAttLocked)            aPrintBuf.Append(_L("KMediaAttLocked"));
-
-        if(aDrvInfo.iMediaAtt & KMediaAttHasPassword)       aPrintBuf.Append(_L("KMediaAttHasPassword"));
-        if(aDrvInfo.iMediaAtt & KMediaAttReadWhileWrite)    aPrintBuf.Append(_L("KMediaAttReadWhileWrite"));
-        if(aDrvInfo.iMediaAtt & KMediaAttDeleteNotify)      aPrintBuf.Append(_L("KMediaAttDeleteNotify"));
-        if(aDrvInfo.iMediaAtt & KMediaAttPageable)          aPrintBuf.Append(_L("KMediaAttPageable"));
+        if(aDrvInfo.iMediaAtt & KMediaAttLocked)            aPrintBuf.Append(_L("KMediaAttLocked,"));
+
+        if(aDrvInfo.iMediaAtt & KMediaAttHasPassword)       aPrintBuf.Append(_L("KMediaAttHasPassword,"));
+        if(aDrvInfo.iMediaAtt & KMediaAttReadWhileWrite)    aPrintBuf.Append(_L("KMediaAttReadWhileWrite,"));
+        if(aDrvInfo.iMediaAtt & KMediaAttDeleteNotify)      aPrintBuf.Append(_L("KMediaAttDeleteNotify,"));
+        if(aDrvInfo.iMediaAtt & KMediaAttPageable)          aPrintBuf.Append(_L("KMediaAttPageable,"));
         
 
         aPrintBuf.Append(_L("\n"));
@@ -1163,8 +1211,8 @@
 
             CShell::Printf(_L("Mounted FS:%S\n"), &Buf);
 
-            //-- print out the list of supported file systems if there are more than 1
-            nRes = aFs.SupportedFileSystemName(fsName, aDrvNum, 0+1); //-- try to get 2nd child name
+            //-- print out the list of supported file systems if there are more than 0
+            nRes = aFs.SupportedFileSystemName(fsName, aDrvNum, 0); //-- try to get 1st child name
             if(nRes == KErrNone)
             {
                 Buf.Copy(_L("Supported FS: "));
@@ -1436,16 +1484,16 @@
     {//-- gaceful attempt to dismount the FS
     nRes = aFs.DismountFileSystem(fsName, aDrvNum);
     if(nRes != KErrNone)
-        {
+    {
         CShell::TheConsole->Printf(_L("Can't dismount FS!\n"));
         return nRes;
-        }
+    }
     else
-        {
-        CShell::TheConsole->Printf(_L("'%S' filesystem dismounted from drive %c:\n"), &fsName, 'A'+aDrvNum);
-        return KErrNone;
-        }
+    {
+    CShell::TheConsole->Printf(_L("'%S' filesystem dismounted from drive %c:\n"), &fsName, 'A'+aDrvNum);
+    return KErrNone;
     }
+}
     else
     {//-- dismount by force
         TRequestStatus rqStat;
@@ -2006,52 +2054,60 @@
     }
 
 //-----------------------------------------------------------------------------------------------------------------------
-
+/**
+    Hex Dump of a file
+*/
 TInt ShellFunction::Hexdump(TDes& aPath,TUint aSwitches)
 	{
 	ShellFunction::StripQuotes(aPath);
 
 	ParsePath(aPath);
+	
 	RFile64 file;
 	TInt r=file.Open(TheShell->TheFs,aPath,EFileStream);
 	if (r!=KErrNone)
 		return(r);
 
-	TInt offset=0;
+		const TInt KLineLength = 16;
+    TBuf<0x100> buf;
+    TBuf<KLineLength> asciiBuf;
+		TBuf8<KLineLength> line;
+
 	for (;;)
 		{
-		const TInt KLineLength = 16;
-
-		TBuf8<KLineLength> line;
 		r=file.Read(line);
 		if (r != KErrNone || line.Length() == 0)
 			break;
 
-		TBuf<KLineLength*3+2> hexaRep;
-		TBuf<KLineLength> asciiRep;
+		buf.Zero();
+        asciiBuf.Zero();
+		
 		for (TInt i=0; i<KLineLength; i++)
 			{
 			if (i == KLineLength/2)
 				{
-				hexaRep.Append(' ');
-				hexaRep.Append(i<line.Length() ? '|' : ' ');
+				buf.Append(' ');
+				buf.Append(i<line.Length() ? '|' : ' ');
 				}
 
-			hexaRep.Append(' ');
+            buf.Append(' ');
 
 			if (i<line.Length())
 				{
-				hexaRep.AppendNumFixedWidth(line[i], EHex, 2);
-				asciiRep.Append(TChar(line[i]).IsPrint() ? line[i] : '.');
+				buf.AppendNumFixedWidth(line[i], EHex, 2);
+				asciiBuf.Append(TChar(line[i]).IsPrint() ? line[i] : '.');
 				}
 			else
-				hexaRep.AppendFill(' ', 2);
+				buf.AppendFill(' ', 2);
 			}
 
 		_LIT(KPrompt , " Hit escape to quit hexdump or any other key to continue\n");
-		_LIT(KLineFmt, " %+07x0:%S %S\n");
-		TKeyCode key=CShell::OutputStringToConsole(KPrompt ,(aSwitches&TShellCommand::EPSwitch)!=0,KLineFmt, offset++,&hexaRep, &asciiRep);
-
+		
+        buf.Append(_L(" "));
+        buf.Append(asciiBuf);
+        buf.Append(KNl);
+
+        TKeyCode key= CShell::WriteBufToConsole((aSwitches&TShellCommand::EPSwitch)!=0, buf, KPrompt);
 		if (key==EKeyEscape)
 				break;
 		}
@@ -2155,7 +2211,7 @@
 
 
     if(!(aSwitches&TShellCommand::EESwitch))
-    {//-- fill created file with randomn data
+    {//-- fill created file with random data
 
 	    while(rem)
 	    {
@@ -2378,22 +2434,22 @@
 	TInt DisplayHelp();
 	TInt DisplayMessage(const TFullName& aName);
 	TInt DisplayCmdUnknown();
-	TInt GetAll(const TDes& aName);
-	TInt GetProcesses(const TDes& aName);
-	TInt GetThreads(const TDes& aName);
-	TInt GetChunks(const TDes& aName);
-	TInt GetServers(const TDes& aName);
+	void GetAll(const TDes& aName);
+	void GetProcesses(const TDes& aName);
+	void GetThreads(const TDes& aName);
+	void GetChunks(const TDes& aName);
+	void GetServers(const TDes& aName);
 //	TInt GetSessions(const TDes& aName);
-	TInt GetLibraries(const TDes& aName);
+	void GetLibraries(const TDes& aName);
 //	TInt GetLogicalChannels(const TDes& aName);
-	TInt GetLogicalDevices(const TDes& aName);
-	TInt GetPhysicalDevices(const TDes& aName);
-	TInt GetSemaphores(const TDes& aName);
-	TInt GetMutexes(const TDes& aName);
+	void GetLogicalDevices(const TDes& aName);
+	void GetPhysicalDevices(const TDes& aName);
+	void GetSemaphores(const TDes& aName);
+	void GetMutexes(const TDes& aName);
 private:
 	void DisplayHelpLine(const TDesC& aCommand, const TDesC& aDescription);
-	TInt Prepare(const TFullName& aName);
-	TInt Prepare(const TFullName& aName,TCallBack& aCallBack);
+	TBool Prepare(const TFullName& aName);
+	TBool Prepare(const TFullName& aName,TCallBack& aCallBack);
 	TInt Display(TFullName& aName);
 	TFullName iPrevName;
 	TCallBack iCallBack;
@@ -2435,9 +2491,8 @@
 	return KErrNone;
 	}
 
-TInt TShowProcInfo::GetAll(const TDes& aName)
+void TShowProcInfo::GetAll(const TDes& aName)
 	{
-
 	GetProcesses(aName);
 	GetThreads(aName);
 	GetChunks(aName);
@@ -2449,24 +2504,27 @@
 	GetPhysicalDevices(aName);
 	GetSemaphores(aName);
 	GetMutexes(aName);
-	return KErrNone;
+
 	}
 
-TInt TShowProcInfo::GetProcesses(const TDes& aName)
+void TShowProcInfo::GetProcesses(const TDes& aName)
 	{
 
 	TFindProcess findHb;
 	findHb.Find(aName);
 	TFullName name;
-	Prepare(_L("PROCESSES"));
+	
+    if(!Prepare(_L("PROCESSES")))
+       return;
+
 	while (findHb.Next(name)==KErrNone)
 		{
 		Display(name);
 		}
-	return KErrNone;
+
 	}
 
-TInt TShowProcInfo::GetThreads(const TDes& aName)
+void TShowProcInfo::GetThreads(const TDes& aName)
 	{
 	TInt threads=0;
 	TFindThread findHb;
@@ -2476,7 +2534,10 @@
 
 //	Modified by WR, November 1997
 	TCallBack threadCallBack(GetThreadInfo,findPtr);
-	Prepare(_L("THREADS"),threadCallBack);
+	
+    if(!Prepare(_L("THREADS"),threadCallBack))
+        return;
+
 	while (findHb.Next(name)==KErrNone)
 		{
 		Display(name);
@@ -2488,12 +2549,12 @@
 		message.Format(_L("? No threads called %S"), &aName);
 		DisplayMessage(message);
 		}
-	return KErrNone;
-//	End of modification
+	
+    
 	}
 
 
-TInt TShowProcInfo::GetChunks(const TDes& aName)
+void TShowProcInfo::GetChunks(const TDes& aName)
 	{
 
 	TFindChunk findHb;
@@ -2501,7 +2562,10 @@
 	TFullName name;
 	TAny* namePtr=(TAny*)&name;
 	TCallBack chunkCallBack(GetChunkInfo,namePtr);
-	Prepare(_L("CHUNKS & SIZES"),chunkCallBack);
+	
+    if(!Prepare(_L("CHUNKS & SIZES"),chunkCallBack))
+        return;
+
 	TInt totalChunkSize=0;
 	TInt protectedChunks = 0;
 	while (findHb.Next(name)==KErrNone)
@@ -2528,21 +2592,23 @@
 	CShell::OutputStringToConsole(ETrue,_L("  Total Chunk Size = %dk\n"),totalChunkSize);
 	if(protectedChunks)
 		CShell::OutputStringToConsole(ETrue,_L("  %d Protected chunks not counted\n"),protectedChunks);
-	return KErrNone;
+	
+    
 	}
 
-TInt TShowProcInfo::GetServers(const TDes& aName)
+void TShowProcInfo::GetServers(const TDes& aName)
 	{
 
 	TFindServer findHb;
 	findHb.Find(aName);
 	TFullName name;
-	Prepare(_L("SERVERS"));
+	if(!Prepare(_L("SERVERS")))
+        return;
+
 	while (findHb.Next(name)==KErrNone)
 		{
 		Display(name);
 		}
-	return KErrNone;
 	}
 
 /*	TInt TShowProcInfo::GetSessions(const TDes& aName)
@@ -2559,18 +2625,20 @@
 	return KErrNone;
 	}
 */
-TInt TShowProcInfo::GetLibraries(const TDes& aName)
+void TShowProcInfo::GetLibraries(const TDes& aName)
 	{
 
 	TFindLibrary findHb;
 	findHb.Find(aName);
 	TFullName name;
-	Prepare(_L("LIBRARIES"));
+	if(!Prepare(_L("LIBRARIES")))
+        return;
+
 	while (findHb.Next(name)==KErrNone)
 		{
 		Display(name);
 		}
-	return KErrNone;
+	
 	}
 /*
 TInt TShowProcInfo::GetLogicalChannels(const TDes& aName)
@@ -2588,59 +2656,68 @@
 	}
 */
 
-TInt TShowProcInfo::GetLogicalDevices(const TDes& aName)
+void TShowProcInfo::GetLogicalDevices(const TDes& aName)
 	{
 
 	TFindLogicalDevice findHb;
 	findHb.Find(aName);
 	TFullName name;
-	Prepare(_L("LOGICAL DEVICES"));
+
+	if(!Prepare(_L("LOGICAL DEVICES")))
+        return;
+
 	while (findHb.Next(name)==KErrNone)
 		{
 		Display(name);
 		}
-	return KErrNone;
+	
 	}
 
-TInt TShowProcInfo::GetPhysicalDevices(const TDes& aName)
+void TShowProcInfo::GetPhysicalDevices(const TDes& aName)
 	{
 
 	TFindPhysicalDevice findHb;
 	findHb.Find(aName);
 	TFullName name;
-	Prepare(_L("PHYSICAL DEVICES"));
+	
+    if(!Prepare(_L("PHYSICAL DEVICES")))
+        return;
+
 	while (findHb.Next(name)==KErrNone)
 		{
 		Display(name);
 		}
-	return KErrNone;
+	
 	}
 
-TInt TShowProcInfo::GetSemaphores(const TDes& aName)
+void TShowProcInfo::GetSemaphores(const TDes& aName)
 	{
 	TFindSemaphore findHb;
 	findHb.Find(aName);
 	TFullName name;
-	Prepare(_L("SEMAPHORES"));
+	if(!Prepare(_L("SEMAPHORES")))
+        return;
+
 	while (findHb.Next(name)==KErrNone)
 		{
 		Display(name);
 		}
-	return KErrNone;
+	
 	}
 
-TInt TShowProcInfo::GetMutexes(const TDes& aName)
+void TShowProcInfo::GetMutexes(const TDes& aName)
 	{
 
 	TFindMutex findHb;
 	findHb.Find(aName);
 	TFullName name;
-	Prepare(_L("MUTEXES"));
+	if(!Prepare(_L("MUTEXES")))
+        return;
 	while (findHb.Next(name)==KErrNone)
 		{
 		Display(name);
 		}
-	return KErrNone;
+	
 	}
 
 void TShowProcInfo::DisplayHelpLine(const TDesC& aCommand, const TDesC& aDescription)
@@ -2649,23 +2726,32 @@
 	}
 
 
-TInt TShowProcInfo::Prepare(const TFullName& aName)
+TBool TShowProcInfo::Prepare(const TFullName& aName)
 	{
 
 	iPrevName=_L("");
-	CShell::OutputStringToConsole(ETrue,_L("--%S-->\n"),&aName);
+	TKeyCode key = CShell::OutputStringToConsole(ETrue,_L("--%S-->\n"),&aName);
+    
+    if(key==EKeyEscape)
+        return EFalse;
+
 	useCallBack=EFalse;
-	return KErrNone;
+    return ETrue;
 	}
 
-TInt TShowProcInfo::Prepare(const TFullName& aName,TCallBack& aCallBack)
+TBool  TShowProcInfo::Prepare(const TFullName& aName,TCallBack& aCallBack)
 	{
-
 	iPrevName=_L("");
-	CShell::OutputStringToConsole(ETrue,_L("--%S-->\n"),&aName);
+	TKeyCode key = CShell::OutputStringToConsole(ETrue,_L("--%S-->\n"),&aName);
+
+    if(key==EKeyEscape)
+        return EFalse;
+	
+    
 	useCallBack=ETrue;
 	iCallBack=aCallBack;
-	return KErrNone;
+	
+    return ETrue;
 	}
 
 TInt TShowProcInfo::Display(TFullName& aName)
@@ -2698,7 +2784,11 @@
 		while (posA>=0)
 			{
 			TPtrC16 temp_desc=aName.Left(posA);
-			CShell::OutputStringToConsole(ETrue,_L("%+ *S\n"),toTab+temp_desc.Left(posA).Length(),&temp_desc);
+			
+            TKeyCode key = CShell::OutputStringToConsole(ETrue,_L("%+ *S\n"),toTab+temp_desc.Left(posA).Length(),&temp_desc);
+			if (key==EKeyEscape)
+			    break;
+
 			toTab+=3;
 			aName.Delete(0,posA+2);
 			posA=aName.Match(_L("*::*"));
@@ -2729,7 +2819,7 @@
 	TBool abort=EFalse;
 	TBool processSelected=EFalse;
 	TBuf<0x16> prompt=_L("ps>");
-	r=showProcInfo.GetProcesses(processPrefix);
+	showProcInfo.GetProcesses(processPrefix);
 	do
 		{
 		TBuf<0x10> command;
@@ -2791,7 +2881,7 @@
 						if (findP.Next(findName)==KErrNone)
 							{
 							r=showProcInfo.DisplayMessage(_L("command prefixes more than one process"));
-							r=showProcInfo.GetProcesses(chosenP);
+							showProcInfo.GetProcesses(chosenP);
 							}
 						else
 							{
@@ -2805,42 +2895,42 @@
 					break;
 				case 'A':
 					{
-					r=showProcInfo.GetAll(processPrefix);
+					showProcInfo.GetAll(processPrefix);
 					command.Zero();
 					}
 					break;
 				case 'P':
-					r=showProcInfo.GetProcesses(asterisk);
+					showProcInfo.GetProcesses(asterisk);
 					break;
 				case 'T':
-					r=showProcInfo.GetThreads(processPrefix);
+					showProcInfo.GetThreads(processPrefix);
 					break;
 				case 'C':
-					r=showProcInfo.GetChunks(processPrefix);
+					showProcInfo.GetChunks(processPrefix);
 					break;
 				case 'S':
-					r=showProcInfo.GetServers(processPrefix);
+					showProcInfo.GetServers(processPrefix);
 					break;
 /*				case 'I':
 					r=showProcInfo.GetSessions(processPrefix);
 					break;
 */				case 'L':
-					r=showProcInfo.GetLibraries(processPrefix);
+					showProcInfo.GetLibraries(processPrefix);
 					break;
 //				case 'G':
 //					r=showProcInfo.GetLogicalChannels(processPrefix);
 //					break;
 				case 'V':
-					r=showProcInfo.GetLogicalDevices(processPrefix);
+					showProcInfo.GetLogicalDevices(processPrefix);
 					break;
 				case 'D':
-					r=showProcInfo.GetPhysicalDevices(processPrefix);
+					showProcInfo.GetPhysicalDevices(processPrefix);
 					break;
 				case 'E':
-					r=showProcInfo.GetSemaphores(processPrefix);
+					showProcInfo.GetSemaphores(processPrefix);
 					break;
 				case 'M':
-					r=showProcInfo.GetMutexes(processPrefix);
+					showProcInfo.GetMutexes(processPrefix);
 					break;
 				default:
 					{
@@ -3144,7 +3234,6 @@
 		c=*p, *p=p[1], p[1]=c;
 	}
 
-_LIT(KLitPercentS, "%S");
 TInt ShellFunction::Type(TDes& aPath,TUint aSwitches)
 	{
 	ParsePath(aPath);
@@ -3206,7 +3295,7 @@
 			{
 			nchars=0;
 			TPtrC bufLeft=buf.Left(r+1);
-			key = CShell::OutputStringToConsole((aSwitches&TShellCommand::EPSwitch)!=0,KLitPercentS(), &bufLeft);
+            key = CShell::WriteBufToConsole((aSwitches&TShellCommand::EPSwitch)!=0, bufLeft);
 			buf.Set(buf.Mid(r+1));
 	
     		if(key == EKeyEscape) 
@@ -3216,7 +3305,8 @@
 		nchars=buf.Length();
 		if (nchars)
 			{
-            key = CShell::OutputStringToConsole((aSwitches&TShellCommand::EPSwitch)!=0,KLitPercentS(), &buf);
+    		key = CShell::WriteBufToConsole((aSwitches&TShellCommand::EPSwitch)!=0, buf);
+
     		if(key == EKeyEscape) 
                 goto exit;
 
@@ -3635,9 +3725,35 @@
 
 
 //----------------------------------------------------------------------
+void CShell::Print(const TDesC16& aBuf)
+{
+
+    TheConsole->Write(aBuf);
+
+    if(iDbgPrint)
+    {
+        const TInt bufLen = aBuf.Length();
+        
+        if(bufLen >1 && aBuf[bufLen-1] == '\n' && aBuf[bufLen-2] != '\r')
+            {
+            RDebug::RawPrint(aBuf.Left(bufLen-1));            
+            RDebug::RawPrint(_L8("\r\n"));
+            }
+        else if(bufLen == 1 && aBuf[bufLen-1] == '\n')
+            {
+            RDebug::RawPrint(_L8("\r\n"));
+            }
+        else
+            {
+            RDebug::RawPrint(aBuf);
+            }
+    }
+
+}
+
 void CShell::Printf(TRefByValue<const TDesC16> aFmt, ...)
 {
-	TBuf<256> buf;
+	TBuf<0x200> buf;
 	VA_LIST list;					
 	VA_START(list, aFmt);
 	// coverity[uninit_use_in_call]
@@ -3646,24 +3762,12 @@
     if(!buf.Length())
         return;
 
-    TheConsole->Printf(buf);
-
-    if(iDbgPrint)
-    {
-        const TInt bufLen = buf.Length();
-        if(buf[bufLen-1] == '\n')
-        {
-            buf.Insert(bufLen-1, _L("\r"));
-        }
-    
-        RDebug::RawPrint(buf);
-    }
-
+    Print(buf);
 }
 
 void SIPrintf(TRefByValue<const TDesC16> aFmt, ...)
 	{
-	TBuf<256> buf;
+	TBuf<0x200> buf;
 	VA_LIST list;					
 	VA_START(list, aFmt);
 	// coverity[uninit_use_in_call]
@@ -3738,7 +3842,7 @@
 		aProg.Append(_L(".EXE"));
 
 #ifdef _DEBUG
-	SIPrintf(_L("RUNEXEC: command %S, parameters %S, count %d, forever %d, issecs %d, exiterr %d"),
+	CShell::Printf(_L("RUNEXEC: command %S, parameters %S, count %d, forever %d, issecs %d, exiterr %d"),
 		&aProg, &parameters, count, forever, countIsSecs, exitOnErr); 
 #endif
 	TInt i=0;
@@ -3753,7 +3857,7 @@
 		r = newProcess.Create(aProg, parameters);
 		if (r != KErrNone)
 			{
-			SIPrintf(KRunExecFailedProcessCreate, &aProg, r);
+			CShell::Printf(KRunExecFailedProcessCreate, &aProg, r);
 			return (r);						// this is systematic - must return
 			}
 		newProcess.Logon(status);
@@ -3767,7 +3871,7 @@
 		timeCurrent.HomeTime();
 		timeTaken = timeCurrent.MicroSecondsFrom(timeStart);
 		TInt msecs = I64LOW(timeTaken.Int64() / 1000);
-		SIPrintf(KRunExecReportStatusAndTime, msecs, i+1, exitType, retcode, &exitCat);
+		CShell::Printf(KRunExecReportStatusAndTime, msecs, i+1, exitType, retcode, &exitCat);
 
 		if (resetDebugRegs)
 			{
--- a/userlibandfileserver/fileserver/etshell/ts_edshl.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/etshell/ts_edshl.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -532,6 +532,17 @@
 		}
 	}
 
+
+//-------------------------------------------------------------------------
+//-- generic shell commands that don't require sophisticated processing
+
+_LIT(KCmd_Help, "HELP");    ///< displays help
+_LIT(KCmd_Cls,  "CLS");     ///< clears the screen
+_LIT(KCmd_Rem,  "REM");     ///< *.bat processing - commented out line
+_LIT(KCmd_Break,"BREAK");   ///< stops *.bat file execution
+_LIT(KCmd_Exit, "EXIT");    ///< exit the shell
+
+//-------------------------------------------------------------------------
 //////////////////////////////////////
 //CShell
 //////////////////////////////////////
@@ -728,7 +739,7 @@
 				tabCount = 0;
 				
 #if !defined(_EPOC)
-				if(commandText.CompareF(_L("EXIT")) == 0)
+				if(commandText.CompareF(KCmd_Exit) == 0)
 					{
 					exit = ETrue;
 					break;
@@ -816,6 +827,10 @@
 	CleanupStack::PopAndDestroy(fileManObserver);
 	}
 
+
+
+//-------------------------------------------------------------------------
+
 void CShell::DoCommand(TDes& aCommand)
 //
 // Evaluate the commandline and run the command or file
@@ -884,10 +899,13 @@
 		{
 		TInt r;
 		
-		if (aCommand.CompareF(_L("HELP"))==0)
+		if (aCommand.CompareF(KCmd_Help)==0)
 			PrintHelp();
-		else if (aCommand.CompareF(_L("CLS"))==0)
+		else if (aCommand.CompareF(KCmd_Cls)==0)
 			TheConsole->ClearScreen(); 
+		else if (aCommand.CompareF(KCmd_Break)==0)
+			{//-- "break" command, do nothing
+            }
 		else if (aCommand.Length()==2 && TChar(aCommand[0]).IsAlpha() && aCommand[1]==':')
 			ChangeDrive(aCommand[0]);
 		else if (aCommand.Length()!=0)
@@ -1063,10 +1081,17 @@
 			else 
 			PrintError(KErrNotFound);
 			}
-			
-		else if (readBuf.Length()<3 || readBuf.Left(3).CompareF(_L("REM"))!=0)
+		else if (readBuf.Length()<3 || readBuf.Left(3).CompareF(KCmd_Rem)!=0)
+            {
+			//-- check if it is a "break" command. stop execution in this case
+            if(readBuf.CompareF(KCmd_Break) ==0)
+                break; //-- terminate batch file execution        
+            else
 			DoCommand(readBuf);
 		}
+		}
+	
+    
 	file.Close();
 	return KErrNone;
 	}
@@ -1218,7 +1243,7 @@
 	drivePaths[drvNum]=aDrivePath;
 	}
 
-
+//----------------------------------------------------------------------
 TKeyCode CShell::OutputStringToConsole(TBool aPageSwitch,TRefByValue<const TDesC> aFmt,... )
 //function for output of a sring to console
 //aPageSwitch flag indicates that output should be page-by-page 
@@ -1239,6 +1264,7 @@
 	return OutputStringToConsole(KPrompt,aPageSwitch,_L("%S"),&aBuf);
 	}
 
+//----------------------------------------------------------------------
 TKeyCode CShell::OutputStringToConsole(const TDesC& aNotification,TBool aPageSwitch,TRefByValue<const TDesC> aFmt,...)
 	//function for output of a string to console aPageSwitch flag indicates that output should be page-by-page 
 	//if aPageSwitch==ETrue user will be prompted with the message passed as aNotification
@@ -1251,10 +1277,8 @@
 	
 	VA_LIST list;
 	VA_START(list,aFmt);
-	
 	TBuf<0x200> aBuf;
 	//format output string using argumen list
-	
 	//coverity[uninit_use_in_call]
 	TRAP_IGNORE(aBuf.AppendFormatList(aFmt,list,&overflow)); // ignore leave in TTimeOverflowLeave::Overflow()
 	//if we are requested to wait for the user input at the end of each page, we check whether output of next piece of text will fit into the screen
@@ -1263,27 +1287,36 @@
 		key=PageSwitchDisplay(aNotification);				
 		}
 	//output current string
-	TheConsole->Write(aBuf);
+	
+	Print(aBuf);
+    
 	return key;			
 	}
 
-TKeyCode CShell::OutputStringToConsole(TBool aPageSwitch, const TDesC& aBuf)
+//----------------------------------------------------------------------
+TKeyCode CShell::WriteBufToConsole(TBool aPageSwitch, const TDesC& aBuf)
 	{
 	_LIT(KPrompt , "Press any key to continue\n");
+    return WriteBufToConsole(aPageSwitch, aBuf, KPrompt);
+	}
 	
+//----------------------------------------------------------------------
+TKeyCode CShell::WriteBufToConsole(TBool aPageSwitch, const TDesC& aBuf, const TDesC& aNotification)
+    {
     TKeyCode key=EKeyNull;	
 
 	//if we are requested to wait for the user input at the end of each page, we check whether output of next piece of text will fit into the screen
 	if (aPageSwitch)
 		{
-		key = PageSwitchDisplay(KPrompt);				
+		key = PageSwitchDisplay(aNotification);				
 		}
-	//output current string
-	TheConsole->Write(aBuf);
+
+    Print(aBuf);
 	
     return key;
 	}
 
+
 TKeyCode CShell::PageSwitchDisplay(const TDesC& aNotification)
 	{
 	//create variable to store code of the key pressed by the user
@@ -1313,3 +1346,9 @@
 		}						
 	return key;			
 	}
+
+
+
+
+
+
--- a/userlibandfileserver/fileserver/etshell/ts_std.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/etshell/ts_std.h	Wed Sep 01 12:34:56 2010 +0100
@@ -144,10 +144,14 @@
 	void SetDrivePath(const TDesC& aDes);
 	static void NewLine();
 	static TKeyCode OutputStringToConsole(TBool aPageSwitch,TRefByValue<const TDesC> aFmt,...);
-	static TKeyCode OutputStringToConsole(TBool aPageSwitch, const TDesC& aBuf);
 	static TKeyCode OutputStringToConsole(const TDesC& aNotification,TBool aPageSwitch,TRefByValue<const TDesC> aFmt,...);
 
+    static TKeyCode WriteBufToConsole(TBool aPageSwitch, const TDesC& aBuf);
+    static TKeyCode WriteBufToConsole(TBool aPageSwitch, const TDesC& aBuf, const TDesC& aNotification);
+
+
     static void Printf(TRefByValue<const TDesC16> aFmt, ...);
+    static void Print(const TDesC16& aBuf);
     static void SetDbgConsoleEcho(TBool aOn) {iDbgPrint = aOn;}
 
 public:
@@ -274,7 +278,7 @@
 private:		
 	static TInt ShowDirectoryTree(TDes& aPath,TUint aSwitches,TDes& aTreeGraph);
 	static TBool Certain();	
-	static void OutputContentsToConsole(RPointerArray<HBufC>& aText,TUint aSwitches);
+	static TBool OutputContentsToConsole(RPointerArray<HBufC>& aText,TUint aSwitches);
 	static void OutputDirContentL(CDir* aDirList,RPointerArray<HBufC>& aText,TUint aSwitches);	
 	};
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/fileserver/ftrace/d_ftrace.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,215 @@
+/*
+* 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:
+*
+*/
+// D_FTRACE.CPP
+//
+//
+//
+#include "plat_priv.h"
+#include <kernel/kernel.h>
+
+#include "f32trace.h"
+
+DMutex* TheTraceMutex = NULL;
+_LIT(KLitTraceMutexName, "FTRACE_MUTEX");
+
+const TInt KMajorVersionNumber=1;
+const TInt KMinorVersionNumber=0;
+const TInt KBuildVersionNumber=0;
+
+
+class DLddFactoryFTrace : public DLogicalDevice
+	{
+public:
+	DLddFactoryFTrace();
+	virtual ~DLddFactoryFTrace();
+	virtual TInt Install();
+	virtual void GetCaps(TDes8 &aDes) const;
+	virtual TInt Create(DLogicalChannelBase*& aChannel); 	//overriding pure virtual
+	};
+
+class DLddFTrace : public DLogicalChannelBase
+	{
+public:
+	DLddFTrace();
+	~DLddFTrace();
+protected:
+	virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
+
+	virtual TInt Request(TInt aReqNo, TAny* a1, TAny* a2);
+
+private:
+	void DoCancel(TInt aReqNo);
+	TInt DoRequest(TInt aReqNo, TRequestStatus* aStatus, TAny* a1, TAny* a2);
+	TInt DoControl(TInt aFunction, TAny* a1, TAny* a2);
+
+private:
+    };
+
+DECLARE_STANDARD_LDD()
+	{
+	TInt r = Kern::MutexCreate(TheTraceMutex,  KLitTraceMutexName, KMutexOrdNone);
+	if (r != KErrNone)
+		return NULL;
+
+	return new DLddFactoryFTrace;
+	}
+
+DLddFactoryFTrace::DLddFactoryFTrace()
+	{
+
+    iParseMask=KDeviceAllowUnit;  // Pass stack number as unit
+	iUnitsMask=0xffffffff;
+	iVersion=TVersion(KMajorVersionNumber,KMinorVersionNumber,KBuildVersionNumber);
+	}
+
+TInt DLddFactoryFTrace::Create(DLogicalChannelBase*& aChannel)
+	{
+	aChannel=new DLddFTrace;
+	return aChannel ? KErrNone : KErrNoMemory;
+	}
+
+TInt DLddFactoryFTrace::Install()
+	{
+    TPtrC name=_L("FTrace");
+	return(SetName(&name));
+	}
+
+void DLddFactoryFTrace::GetCaps(TDes8& /*aDes*/) const
+	{
+	}
+
+DLddFactoryFTrace::~DLddFactoryFTrace()
+	{
+	}
+
+DLddFTrace::DLddFTrace()
+	{
+    }
+
+DLddFTrace::~DLddFTrace()
+	{
+    }
+
+TInt DLddFTrace::DoCreate(TInt /*aUnit*/, const TDesC8* /*aInfo*/, const TVersion& aVer)
+	{
+
+	if (!Kern::QueryVersionSupported(TVersion(KMajorVersionNumber,KMinorVersionNumber,KBuildVersionNumber),aVer))
+		return(KErrNotSupported);
+
+    return(KErrNone);
+	}
+
+void DLddFTrace::DoCancel(TInt /*aReqNo*/)
+	{
+	}
+
+TInt DLddFTrace::Request(TInt aReqNo, TAny* a1, TAny* a2)
+	{
+	NKern::ThreadEnterCS();
+	Kern::MutexWait(*TheTraceMutex);
+	TInt r = DoControl(aReqNo, a1, a2);
+	Kern::MutexSignal(*TheTraceMutex);
+	NKern::ThreadLeaveCS();
+
+	return r;
+	}
+
+
+const TUint KTraceBufferSize = 4096;
+TUint8 gTraceBuffer[KTraceBufferSize];
+
+
+#define MIN(a,b)			((a) < (b) ? (a) : (b))
+
+TInt DLddFTrace::DoControl(TInt aFunction, TAny* a1, TAny* a2)
+//
+// Mostly requests (but some kernel server async ones)
+//
+	{
+	TInt r=KErrNotSupported;
+	switch (aFunction)
+		{
+        case RFTrace::ETraceMultiple:
+            {
+			typedef struct {
+				TClassification iCategory;
+				TUint8 iPadding1[sizeof(TUint) - sizeof(TClassification)];
+
+				TFormatId iFormatId;
+				TUint8 iPadding2[sizeof(TUint) - sizeof(TFormatId)];
+
+				TUint32 iUid;
+				TInt iDescriptorCount;
+				} TraceArgs;
+
+			TraceArgs args={0};
+
+			XTRAP(r, XT_DEFAULT, kumemget32(&args, a1, sizeof(args)));
+			if (r != KErrNone)
+				return r;
+
+			// current descriptor - MUST be either a TPtr8 or a TBuf8<4>
+			TUint32 desc[2] = {0, 0};
+			TUint32& desLength = desc[0];
+
+			TUint offset = 0;
+
+			*((TUint*) (gTraceBuffer+offset)) = args.iFormatId;
+			offset+= sizeof(TUint);
+
+			TDesC8* des = (TDesC8*) ((TUint8*) a2);
+			const TInt desSize = sizeof(TPtrC8);
+			for (TInt n=0; n< args.iDescriptorCount; n++, des = (TDesC8*) (((TUint8*) des) + desSize) )
+				{
+
+				XTRAP(r, XT_DEFAULT, kumemget32(desc, des, sizeof(desc)));
+				TUint32 desType = desLength >> KShiftDesType;
+				desLength &= (TUint) (KMaskDesLength);
+				if (desType == EPtrC)
+					{
+					*((TUint*) (gTraceBuffer+offset)) = desLength;
+					desLength = (desLength+3)&~3;
+					offset+= sizeof(TUint);
+					}
+				else if (desType == EBufC)
+					{
+					*((TUint*) (gTraceBuffer+offset)) = desc[1];
+					offset+= sizeof(TUint);
+					if (desLength > 4)
+						return KErrArgument;
+					desLength = 0;
+					continue;
+					}
+				else
+					return KErrArgument;
+
+				TUint len = MIN(KTraceBufferSize - offset, desLength);
+				XTRAP(r, XT_DEFAULT, kumemget(gTraceBuffer+offset, (const TUint8*) desc[1], len));
+				offset+= len;
+
+				}
+
+			BTrace::OutFilteredBig
+				(BTRACE_HEADER_C(8,args.iCategory, 0), args.iUid, gTraceBuffer, offset);
+
+			r=KErrNone;
+			break;
+            }
+		}
+	return(r);
+	}
+
--- a/userlibandfileserver/fileserver/ftrace/f32trace.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/ftrace/f32trace.h	Wed Sep 01 12:34:56 2010 +0100
@@ -22,6 +22,20 @@
 #if !defined(__FTRACE_H__)
 #define __FTRACE_H__
 
+#include <e32cmn.h>
+#include <e32btrace.h>
+
+
+#ifndef __KERNEL_MODE__
+	#include <e32std.h>
+#endif
+
+#include "f32tracedef.h"
+
+#if defined(__EABI__)
+#pragma diag_suppress 1446		// non-POD class type passed through ellipsis
+#endif
+
 /**
 @internalComponent
 @prototype
@@ -29,41 +43,218 @@
 
 #if ((defined (_DEBUG) && defined (SYMBIAN_FTRACE_ENABLE_UDEB)) ||		\
 	(!defined(_DEBUG) && defined (SYMBIAN_FTRACE_ENABLE_UREL)))
-	#include "OstTraceDefinitions.h"			// may or may not define OST_TRACE_COMPILER_IN_USE
-#else
-	#undef OST_TRACE_COMPILER_IN_USE
-	#undef OST_TRACE_CATEGORY
-	#define OST_TRACE_CATEGORY OST_TRACE_CATEGORY_NONE
-
-	#undef OstTrace0
-	#undef OstTrace1
-	#undef OstTraceData
-	#undef OstTraceExt1
-	#undef OstTraceExt2
-	#undef OstTraceExt3
-	#undef OstTraceExt4
-	#undef OstTraceExt5
-
-	#define OstTrace0( aGroupName, aTraceName, aTraceText )
-	#define OstTrace1( aGroupName, aTraceName, aTraceText, aParam )
-	#define OstTraceData( aGroupName, aTraceName, aTraceText, aPtr, aLength )
-	#define OstTraceExt1( aGroupName, aTraceName, aTraceText, aParam )
-	#define OstTraceExt2( aGroupName, aTraceName, aTraceText, aParam1, aParam2 )
-	#define OstTraceExt3( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3 )
-	#define OstTraceExt4( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4 )
-	#define OstTraceExt5( aGroupName, aTraceName, aTraceText, aParam1, aParam2, aParam3, aParam4, aParam5 )
+	#define SYMBIAN_FTRACE_ENABLE
 #endif
 
 
-#if defined (OST_TRACE_COMPILER_IN_USE)
-	// This class is used to reconstruct an RMessage2 object from a message handle so that we can 
-	// call RMessagePtr2::Client() and then RThread::Id() to retrieve the client's thread Id.
-	// This is useful for matching client requests to calls to the proxydrive
-	class RDummyMessage : public RMessage2
+
+inline TBool Trace1(TClassification aClassification, TFormatId aFormatId, TModuleUid aUid, TUint a1)
+	{
+	return BTraceFilteredContext12(
+		aClassification,					// Category
+		0,								// Sub-category
+		aUid,		// UID
+		aFormatId,
+		a1);							
+	}
+
+inline TBool TraceN(TClassification aClassification, TFormatId aFormatId,  TModuleUid aUid, TInt aArgCount, TUint a1, ...)
+	{
+	const TInt KMaxArgs = 8;
+	if (aArgCount > KMaxArgs)
+		return EFalse;
+	TUint args[KMaxArgs];
+	TInt argLen = aArgCount << 2;
+	memcpy(args, &a1, argLen);
+	
+	return BTraceFilteredContextN(
+		aClassification,					// Category
+		0,									// Sub-category
+		aUid,		// UID
+		aFormatId,
+		args,
+		argLen);								
+	}
+
+
+inline TBool TraceStr(TClassification aClassification, TFormatId aFormatId,  TModuleUid aUid, const TAny* aData, TInt aDataSize)
+	{
+	// NB This will truncate the data (!!!) - 
+	// we can't use BTraceFilteredContextBig for this as it doesn't have room for the format Id
+	return BTraceFilteredContextN(		
+		aClassification,					// Category
+		0,								// Sub-category
+		aUid,		// UID
+		aFormatId,
+		aData, 
+		aDataSize);							
+	}
+
+
+
+
+
+
+
+class RFTrace : public RBusLogicalChannel
+	{
+public:
+	enum {EMajorVersionNumber=1,EMinorVersionNumber=0,EBuildVersionNumber=1};
+	enum TControl
+        {
+		ETraceMultiple,
+		};
+
+#ifndef __KERNEL_MODE__
+
+public:
+	inline TInt Open(TOwnerType aType)
+		{return DoCreate(_L("FTrace"),TVersion(),0,NULL,NULL,aType);}
+
+	inline 	TBool TraceMultiple(TClassification aClassification, TFormatId aFormatId, TUint32 aUid, TInt aDescriptorCount, TUint64 aParam1, ...)
 		{
-	public:
-		inline RDummyMessage(TInt aHandle) {iHandle = aHandle; iFunction=-1;}
-		};
+		if (Handle() == NULL)
+			return EFalse;
+		// ARM passes first 4 parameters in registers, so....
+		// parcel-up the first four parameters in an array and pass a pointer to the array to the LDD; 
+		// the next parameter(s) should be on the stack, so we can just pass a pointer to the first element 
+		TUint args[4] = {aClassification, aFormatId, aUid, aDescriptorCount};
+		TUint64* pArg1 = &aParam1;
+		TInt r = DoControl(ETraceMultiple, (TAny*) args, pArg1);
+		if (r |= KErrNone)
+			User::Panic(_L("FSCLIENT Trace panic"), 0);
+		return ETrue;
+		}
+
+	static inline TUint64 PkgData(const TDesC16& aDes)	{return MAKE_TUINT64( ((TUint) aDes.Ptr()), (aDes.Length()<<1) | (EPtrC<<KShiftDesType));}
+	static inline TUint64 PkgData(const TDesC8& aDes)	{return MAKE_TUINT64( ((TUint) aDes.Ptr()), aDes.Length() | (EPtrC<<KShiftDesType));}
+
+	static inline TUint64 PkgData(TChar aVal)			{return MAKE_TUINT64(aVal, sizeof(aVal));}
+	static inline TUint64 PkgData(TUint8 aVal)			{return MAKE_TUINT64(aVal, sizeof(aVal));}
+	static inline TUint64 PkgData(TInt8 aVal)			{return MAKE_TUINT64(aVal, sizeof(aVal));}
+	static inline TUint64 PkgData(TUint16 aVal)			{return MAKE_TUINT64(aVal, sizeof(aVal));}
+	static inline TUint64 PkgData(TInt16 aVal)			{return MAKE_TUINT64(aVal, sizeof(aVal));}
+	static inline TUint64 PkgData(TUint32 aVal)			{return MAKE_TUINT64(aVal, sizeof(aVal));}
+	static inline TUint64 PkgData(TInt32 aVal)			{return MAKE_TUINT64(aVal, sizeof(aVal));}
+	static inline TUint64 PkgData(TUint aVal)			{return MAKE_TUINT64(aVal, sizeof(aVal));}
+	static inline TUint64 PkgData(TInt aVal)			{return MAKE_TUINT64(aVal, sizeof(aVal));}
+	
+#endif	// __KERNEL_MODE__
+
+private:
+
+	};
+
+// This class is used to reconstruct an RMessage2 object from a message handle so that we can 
+// call RMessagePtr2::Client() and then RThread::Id() to retrieve the client's thread Id.
+// This is useful for matching client requests to calls to the proxydrive
+class RDummyMessage : public RMessage2
+	{
+public:
+	inline RDummyMessage(TInt aHandle) {iHandle = aHandle; iFunction=-1;}
+	};
+
+
+
+#ifdef SYMBIAN_FTRACE_ENABLE
+
+	// Use these macros for tracing 1-8 TUints...
+	#define TRACE0(aClassification, aFormatId, aUid)								Trace1(aClassification, aFormatId, aUid, 0)
+	#define TRACE1(aClassification, aFormatId, aUid, a1)							Trace1(aClassification, aFormatId, aUid, (TUint) a1)
+	#define TRACE2(aClassification, aFormatId, aUid, a1, a2)						TraceN(aClassification, aFormatId, aUid, 2, (TUint) a1, (TUint) a2)
+	#define TRACE3(aClassification, aFormatId, aUid, a1, a2, a3)					TraceN(aClassification, aFormatId, aUid, 3, (TUint) a1, (TUint) a2, (TUint) a3)
+	#define TRACE4(aClassification, aFormatId, aUid, a1, a2, a3, a4)				TraceN(aClassification, aFormatId, aUid, 4, (TUint) a1, (TUint) a2, (TUint) a3, (TUint) a4)
+	#define TRACE5(aClassification, aFormatId, aUid, a1, a2, a3, a4, a5)			TraceN(aClassification, aFormatId, aUid, 5, (TUint) a1, (TUint) a2, (TUint) a3, (TUint) a4, (TUint) a5)
+	#define TRACE6(aClassification, aFormatId, aUid, a1, a2, a3, a4, a5, a6)		TraceN(aClassification, aFormatId, aUid, 6, (TUint) a1, (TUint) a2, (TUint) a3, (TUint) a4, (TUint) a5, (TUint) a6)
+	#define TRACE7(aClassification, aFormatId, aUid, a1, a2, a3, a4, a5, a6, a7)	TraceN(aClassification, aFormatId, aUid, 7, (TUint) a1, (TUint) a2, (TUint) a3, (TUint) a4, (TUint) a5, (TUint) a6, (TUint) a7)
+	#define TRACE8(aClassification, aFormatId, aUid, a1, a2, a3, a4, a5, a6, a7, a8)TraceN(aClassification, aFormatId, aUid, 8, (TUint) a1, (TUint) a2, (TUint) a3, (TUint) a4, (TUint) a5, (TUint) a6, (TUint) a7, (TUint) a8)
+
+	#define TRACESTR(aClassification, aFormatId, aUid, aData, aDataSize)			TraceStr(aClassification, aFormatId, aUid, aData, aDataSize)
+
+	#define RFTRACE_LOAD							\
+		User::LoadLogicalDevice(_L("D_FTRACE"));	
+
+	// macros for opening and closing the trace LDD, which is used for tracing arbitrary data types....
+#if defined(__DLL__)
+	#define RFTRACE_OPEN							\
+		RFTrace TheFtrace;							\
+		TheFtrace.SetHandle((TInt) Dll::Tls());		\
+		if (TheFtrace.Handle() == NULL)				\
+			{										\
+			TheFtrace.Open(EOwnerThread);			\
+			Dll::SetTls((TAny*) TheFtrace.Handle());\
+			}
+
+	#define RFTRACE_CLOSE							\
+		{											\
+		RFTrace ftrace;								\
+		TInt handle = (TInt) Dll::Tls();			\
+		ftrace.SetHandle(handle);					\
+		ftrace.Close();								\
+		Dll::SetTls(NULL);							\
+		}		
+#else
+	extern RFTrace TheFtrace;
+	#define RFTRACE_OPEN
+	#define RFTRACE_CLOSE 
+#endif
+	
+	// Use these macros for tracing 1-8 arbitrary data types....
+	#define TRACEMULT1(aClassification, aFormatId, aUid, a1)						\
+		if (BTrace::CheckFilter2(aClassification, aUid))								\
+			{																			\
+			RFTRACE_OPEN																\
+			TheFtrace.TraceMultiple(aClassification,aFormatId,aUid,1,RFTrace::PkgData(a1));	\
+			}
+
+	#define TRACEMULT2(aClassification, aFormatId, aUid, a1, a2)					\
+		if (BTrace::CheckFilter2(aClassification, aUid))								\
+			{																			\
+			RFTRACE_OPEN																\
+			TheFtrace.TraceMultiple(aClassification,aFormatId,aUid,2,RFTrace::PkgData(a1),RFTrace::PkgData(a2));	\
+			}
+
+	#define TRACEMULT3(aClassification, aFormatId, aUid, a1, a2, a3)				\
+		if (BTrace::CheckFilter2(aClassification, aUid))								\
+			{																			\
+			RFTRACE_OPEN																\
+			TheFtrace.TraceMultiple(aClassification,aFormatId,aUid,3,RFTrace::PkgData(a1),RFTrace::PkgData(a2),RFTrace::PkgData(a3)); \
+			}
+
+	#define TRACEMULT4(aClassification, aFormatId, aUid, a1, a2, a3, a4)			\
+		if (BTrace::CheckFilter2(aClassification, aUid))								\
+			{																			\
+			RFTRACE_OPEN																\
+			TheFtrace.TraceMultiple(aClassification,aFormatId,aUid,4,RFTrace::PkgData(a1),RFTrace::PkgData(a2),RFTrace::PkgData(a3),RFTrace::PkgData(a4)); \
+			}
+
+	#define TRACEMULT5(aClassification, aFormatId, aUid, a1, a2, a3, a4, a5)		\
+		if (BTrace::CheckFilter2(aClassification, aUid))								\
+			{																			\
+			RFTRACE_OPEN																\
+			TheFtrace.TraceMultiple(aClassification,aFormatId,aUid,5,RFTrace::PkgData(a1),RFTrace::PkgData(a2),RFTrace::PkgData(a3),RFTrace::PkgData(a4),RFTrace::PkgData(a5)); \
+			}
+
+	#define TRACEMULT6(aClassification, aFormatId, aUid, a1, a2, a3, a4, a5, a6)	\
+		if (BTrace::CheckFilter2(aClassification, aUid))								\
+			{																			\
+			RFTRACE_OPEN																\
+			TheFtrace.TraceMultiple(aClassification,aFormatId,aUid,6,RFTrace::PkgData(a1),RFTrace::PkgData(a2),RFTrace::PkgData(a3),RFTrace::PkgData(a4),RFTrace::PkgData(a5),RFTrace::PkgData(a6)); \
+			}
+
+	#define TRACEMULT7(aClassification, aFormatId, aUid, a1, a2, a3, a4, a5, a6, a7)\
+		if (BTrace::CheckFilter2(aClassification, aUid))								\
+			{																			\
+			RFTRACE_OPEN																\
+			TheFtrace.TraceMultiple(aClassification,aFormatId,aUid,7,RFTrace::PkgData(a1),RFTrace::PkgData(a2),RFTrace::PkgData(a3),RFTrace::PkgData(a4),RFTrace::PkgData(a5),RFTrace::PkgData(a6),RFTrace::PkgData(a7)); \
+			}
+
+	#define TRACEMULT8(aClassification, aFormatId, aUid, a1, a2, a3, a4, a5, a6, a7, a8)\
+		if (BTrace::CheckFilter2(aClassification, aUid))								\
+			{																			\
+			RFTRACE_OPEN																\
+			TheFtrace.TraceMultiple(aClassification,aFormatId,aUid,8,RFTrace::PkgData(a1),RFTrace::PkgData(a2),RFTrace::PkgData(a3),RFTrace::PkgData(a4),RFTrace::PkgData(a5),RFTrace::PkgData(a6),RFTrace::PkgData(a7),RFTrace::PkgData(a8)); \
+			}
 
 
 	// This macro retrieves the client thread ID from a message, which is useful for 
@@ -85,18 +276,78 @@
 		RDummyMessage msg(aMsgHandle);			\
 		TRACETHREADID(msg);		
 
-#else	// #if defined (OST_TRACE_COMPILER_IN_USE)
+
+	// Use these macros for tracing a return code followed by 1-7 TUints...
+	// If the return code is negative the UTF::EError classification is used IF ENABLED  - otherwise the passed classification is used
+	#define TRACERET1(aClassification, aFormatId, aUid, r)								TRACE1( (TClassification) ((r < 0 && BTrace::CheckFilter2(UTF::EError, aUid)) ? UTF::EError : aClassification), aFormatId, aUid, r);
+	#define TRACERET2(aClassification, aFormatId, aUid, r, a2)							TRACE2( (TClassification) ((r < 0 && BTrace::CheckFilter2(UTF::EError, aUid)) ? UTF::EError : aClassification), aFormatId, aUid, r, a2)
+	#define TRACERET3(aClassification, aFormatId, aUid, r, a2, a3)						TRACE3( (TClassification) ((r < 0 && BTrace::CheckFilter2(UTF::EError, aUid)) ? UTF::EError : aClassification), aFormatId, aUid, r, a2, a3)
+	#define TRACERET4(aClassification, aFormatId, aUid, r, a2, a3, a4)					TRACE4( (TClassification) ((r < 0 && BTrace::CheckFilter2(UTF::EError, aUid)) ? UTF::EError : aClassification), aFormatId, aUid, r, a2, a3, a4)
+	#define TRACERET5(aClassification, aFormatId, aUid, r, a2, a3, a4, a5)				TRACE5( (TClassification) ((r < 0 && BTrace::CheckFilter2(UTF::EError, aUid)) ? UTF::EError : aClassification), aFormatId, aUid, r, a2, a3, a4, a5)
+	#define TRACERET6(aClassification, aFormatId, aUid, r, a2, a3, a4, a5, a6)			TRACE6( (TClassification) ((r < 0 && BTrace::CheckFilter2(UTF::EError, aUid)) ? UTF::EError : aClassification), aFormatId, aUid, r, a2, a3, a4, a5, a6)
+	#define TRACERET7(aClassification, aFormatId, aUid, r, a2, a3, a4, a5, a6, a7)		TRACE7( (TClassification) ((r < 0 && BTrace::CheckFilter2(UTF::EError, aUid)) ? UTF::EError : aClassification), aFormatId, aUid, r, a2, a3, a4, a5, a6, a7)
+	#define TRACERET8(aClassification, aFormatId, aUid, r, a2, a3, a4, a5, a6, a7, a8)	TRACE8( (TClassification) ((r < 0 && BTrace::CheckFilter2(UTF::EError, aUid)) ? UTF::EError : aClassification), aFormatId, aUid, r, a2, a3, a4, a5, a6, a7, a8)
+
+	// Use these macros for tracing a return code followed by 1-7 arbitrary data types....
+	// If the return code is negative the UTF::EError classification is used IF ENABLED  - otherwise the passed classification is used
+	#define TRACERETMULT1(aClassification, aFormatId, aUid, r)								TRACEMULT1( (TClassification) ((r < 0 && BTrace::CheckFilter2(UTF::EError, aUid)) ? UTF::EError : aClassification), aFormatId, aUid, r);
+	#define TRACERETMULT2(aClassification, aFormatId, aUid, r, a2)							TRACEMULT2( (TClassification) ((r < 0 && BTrace::CheckFilter2(UTF::EError, aUid)) ? UTF::EError : aClassification), aFormatId, aUid, r, a2)
+	#define TRACERETMULT3(aClassification, aFormatId, aUid, r, a2, a3)						TRACEMULT3( (TClassification) ((r < 0 && BTrace::CheckFilter2(UTF::EError, aUid)) ? UTF::EError : aClassification), aFormatId, aUid, r, a2, a3)
+	#define TRACERETMULT4(aClassification, aFormatId, aUid, r, a2, a3, a4)					TRACEMULT4( (TClassification) ((r < 0 && BTrace::CheckFilter2(UTF::EError, aUid)) ? UTF::EError : aClassification), aFormatId, aUid, r, a2, a3, a4)
+	#define TRACERETMULT5(aClassification, aFormatId, aUid, r, a2, a3, a4, a5)				TRACEMULT5( (TClassification) ((r < 0 && BTrace::CheckFilter2(UTF::EError, aUid)) ? UTF::EError : aClassification), aFormatId, aUid, r, a2, a3, a4, a5)
+	#define TRACERETMULT6(aClassification, aFormatId, aUid, r, a2, a3, a4, a5, a6)			TRACEMULT6( (TClassification) ((r < 0 && BTrace::CheckFilter2(UTF::EError, aUid)) ? UTF::EError : aClassification), aFormatId, aUid, r, a2, a3, a4, a5, a6)
+	#define TRACERETMULT7(aClassification, aFormatId, aUid, r, a2, a3, a4, a5, a6, a7)		TRACEMULT7( (TClassification) ((r < 0 && BTrace::CheckFilter2(UTF::EError, aUid)) ? UTF::EError : aClassification), aFormatId, aUid, r, a2, a3, a4, a5, a6, a7)
+	#define TRACERETMULT8(aClassification, aFormatId, aUid, r, a2, a3, a4, a5, a6, a7, a8)	TRACEMULT8( (TClassification) ((r < 0 && BTrace::CheckFilter2(UTF::EError, aUid)) ? UTF::EError : aClassification), aFormatId, aUid, r, a2, a3, a4, a5, a6, a7, a8)
+
 
+#else		// #ifdef SYMBIAN_FTRACE_ENABLE
+	#define TRACE0(aClassification, aFormatId, aUid)
+	#define TRACE1(aClassification, aFormatId, aUid, a1)
+	#define TRACE2(aClassification, aFormatId, aUid, a1, a2)
+	#define TRACE3(aClassification, aFormatId, aUid, a1, a2, a3)
+	#define TRACE4(aClassification, aFormatId, aUid, a1, a2, a3, a4)
+	#define TRACE5(aClassification, aFormatId, aUid, a1, a2, a3, a4, a5)
+	#define TRACE6(aClassification, aFormatId, aUid, a1, a2, a3, a4, a5, a6)
+	#define TRACE7(aClassification, aFormatId, aUid, a1, a2, a3, a4, a5, a6, a7)
+	#define TRACE8(aClassification, aFormatId, aUid, a1, a2, a3, a4, a5, a6, a7, a8)
+	#define TRACESTR(aClassification, aFormatId, aUid, aData, aDataSize)
+
+	#define RFTRACE_LOAD
+	#define RFTRACE_OPEN
+	#define RFTRACE_CLOSE
+
+	#define TRACEMULT1(aClassification, aFormatId, aUid, a1)
+	#define TRACEMULT2(aClassification, aFormatId, aUid, a1, a2)
+	#define TRACEMULT3(aClassification, aFormatId, aUid, a1, a2, a3)
+	#define TRACEMULT4(aClassification, aFormatId, aUid, a1, a2, a3, a4)
+	#define TRACEMULT5(aClassification, aFormatId, aUid, a1, a2, a3, a4, a5)
+	#define TRACEMULT6(aClassification, aFormatId, aUid, a1, a2, a3, a4, a5, a6)
+	#define TRACEMULT7(aClassification, aFormatId, aUid, a1, a2, a3, a4, a5, a6, a7)
+	#define TRACEMULT8(aClassification, aFormatId, aUid, a1, a2, a3, a4, a5, a6, a7, a8)
 	#define TRACETHREADID(aMsg)
 	#define TRACETHREADIDH(aMsgHandle)
 
-#endif	// #if defined (OST_TRACE_COMPILER_IN_USE)
+	#define TRACERET1(aClassification, aFormatId, aUid, r)
+	#define TRACERET2(aClassification, aFormatId, aUid, r, a2)
+	#define TRACERET3(aClassification, aFormatId, aUid, r, a2, a3)
+	#define TRACERET4(aClassification, aFormatId, aUid, r, a2, a3, a4)
+	#define TRACERET5(aClassification, aFormatId, aUid, r, a2, a3, a4, a5)
+	#define TRACERET6(aClassification, aFormatId, aUid, r, a2, a3, a4, a5, a6)
+	#define TRACERET7(aClassification, aFormatId, aUid, r, a2, a3, a4, a5, a6, a7)
+	#define TRACERET8(aClassification, aFormatId, aUid, r, a2, a3, a4, a5, a6, a7, a8)
+
+	#define TRACERETMULT1(aClassification, aFormatId, aUid, r)
+	#define TRACERETMULT2(aClassification, aFormatId, aUid, r, a2)
+	#define TRACERETMULT3(aClassification, aFormatId, aUid, r, a2, a3)
+	#define TRACERETMULT4(aClassification, aFormatId, aUid, r, a2, a3, a4)
+	#define TRACERETMULT5(aClassification, aFormatId, aUid, r, a2, a3, a4, a5)
+	#define TRACERETMULT6(aClassification, aFormatId, aUid, r, a2, a3, a4, a5, a6)
+	#define TRACERETMULT7(aClassification, aFormatId, aUid, r, a2, a3, a4, a5, a6, a7)
+	#define TRACERETMULT8(aClassification, aFormatId, aUid, r, a2, a3, a4, a5, a6, a7, a8)
+#endif
 
 
 
 
-
+#endif
 
-#endif	// #if !defined(__FTRACE_H__)
-
-
--- a/userlibandfileserver/fileserver/group/bld.inf	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/group/bld.inf	Wed Sep 01 12:34:56 2010 +0100
@@ -43,16 +43,20 @@
 ../inc/rofs.h									SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(rofs.h)
 ../inc/ftlcontrolio.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(ftlcontrolio.h)
 ../inc/f32pluginUtils.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(f32pluginutils.h)
-../inc/f32plugin.h								SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(f32plugin.h)
+../inc/F32plugin.h								SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(f32plugin.h)
 ../inc/f32plugin.inl							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(f32plugin.inl)
 
+../inc/f32tracedef.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(f32tracedef.h)
+../inc/utraceefsrv.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(utraceefsrv.h)
+../inc/utraceefile.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(utraceefile.h)
 ../rom/f32.iby	 		/epoc32/rom/f32/f32.iby
 
 PRJ_MMPFILES
 
 #if !defined(SMP)
-../sfsrv/efsrv
-../sfile/efile
+efsrv
+efile
 runtests
 #endif
 
+ftrace
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/fileserver/group/efile.mmh	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,106 @@
+// Copyright (c) 1996-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:
+// f32\group\efile.mmp
+// efile.exe File Server
+// 
+//
+
+/**
+ @file
+*/
+
+
+SOURCEPATH	../sfsrv
+USERINCLUDE	../sfsrv
+USERINCLUDE	../ftrace
+SOURCE			 cl_file.cpp
+SOURCE			 cl_cli.cpp
+SOURCE			 cl_dir.cpp
+
+SOURCEPATH	../sfile
+USERINCLUDE	.
+SOURCE			 sf_amh.cpp sf_dat.cpp sf_debug.cpp sf_dir.cpp
+SOURCE			 sf_drv.cpp sf_file.cpp sf_fmt.cpp
+SOURCE			 sf_ldr.cpp sf_main.cpp sf_nbs.cpp sf_ses.cpp
+SOURCE			 sf_svr.cpp sf_sys.cpp sf_utl.cpp sf_mnt.cpp
+SOURCE			 sf_raw.cpp sf_prel.cpp sf_disk.cpp
+SOURCE			 sf_request.cpp sf_ops.cpp sf_notify.cpp
+SOURCE			 sf_thread.cpp sf_local.cpp sf_obj.cpp
+SOURCE			 sf_ext.cpp sf_hash.cpp
+SOURCE			 sf_plugin.cpp sf_plugin_ops.cpp sf_plugin_man.cpp
+SOURCE			 Sf_plugin_util.cpp
+SOURCE			 sf_cache_man.cpp sf_cache_client.cpp
+SOURCE			 sf_file_cache.cpp
+SOURCE			 sf_memory_man.cpp sf_memory_client.cpp
+SOURCE			 sf_plugin_shim.cpp
+SOURCE			 sf_notifier_handlers.cpp
+#ifdef SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION
+SOURCE			 sf_pool.cpp sf_notifier.cpp
+#endif
+
+#ifdef WINS
+SOURCE			 sf_lwins.cpp
+
+library			emulator.lib
+#else
+SOURCE			 sf_lepoc.cpp  sf_inflate.cpp sf_cache.cpp sf_decomp.cpp
+SOURCE			 sf_pgcompr.cpp
+
+#ifdef MARM
+SOURCEPATH	../../../kernel/eka/kernel/arm
+SOURCE			 byte_pair.cia
+#else
+SOURCEPATH	../../../kernel/eka/kernel
+SOURCE			 byte_pair.cpp
+#endif
+
+
+SOURCEPATH	../srom
+SOURCE			 sr_rom.cpp
+#endif
+
+STRICTDEPEND
+
+SOURCEPATH	.
+DOCUMENT		 release.txt
+
+TARGETTYPE		exexp
+
+DEFFILE			efile.def
+
+USERINCLUDE	../inc
+#ifdef SYMBIAN_OLD_EXPORT_LOCATION
+SYSTEMINCLUDE	../inc
+#endif
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+USERINCLUDE	../../../kernel/eka/include
+
+LIBRARY			 efsrv.lib euser.lib hal.lib btracec.lib
+
+EPOCSTACKSIZE	0x6000
+EPOCHEAPSIZE	0x00001000	0x800000
+
+START WINS
+BASEADDRESS		0x62000000
+WIN32_LIBRARY	kernel32.lib
+END
+UID		0x1000008c 0x100039e3
+VENDORID 0x70000001
+
+unpagedcode
+unpageddata
+
+SMPSAFE
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/fileserver/group/efile.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,41 @@
+// Copyright (c) 1996-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:
+// f32/group/efile.mmp
+// efile.exe File Server
+// 
+//
+
+/**
+ @file
+*/
+
+
+TARGET			efile.exe
+
+#include "f32caps.mmh"  // Capabilities of File Server process
+#include "f32.mmh"  	// Generic definitions for the whole f32 component
+
+MACRO			SYMBIAN_PRIVATE_EFSRV
+
+#ifdef SYMBIAN_TRACE_SYSTEM_INCLUDE
+	macro SYMBIAN_FTRACE_ENABLE_UDEB
+//	macro SYMBIAN_FTRACE_ENABLE_UREL
+#endif
+
+#include "efile.mmh"
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/fileserver/group/efile_instrumented.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,37 @@
+// Copyright (c) 1996-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:
+// f32/group/efile.mmp
+// efile_instrumented.exe Instrumented version of the File Server
+// 
+//
+
+/**
+ @file
+*/
+
+
+TARGET			efile_instrumented.exe
+
+#include "f32caps.mmh"  // Capabilities of File Server process
+#include "f32.mmh"  	// Generic definitions for the whole f32 component
+
+MACRO			SYMBIAN_PRIVATE_EFSRV
+
+#ifdef SYMBIAN_TRACE_SYSTEM_INCLUDE
+	macro SYMBIAN_FTRACE_ENABLE_UDEB
+	macro SYMBIAN_FTRACE_ENABLE_UREL
+#endif
+
+#include "efile.mmh"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/fileserver/group/efsrv.mmh	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,61 @@
+// Copyright (c) 1996-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:
+// f32\group\efsrv.mmp
+// efsrv.dll File Server client-side library
+// 
+//
+
+/**
+ @file
+*/
+
+
+
+USERINCLUDE		../ftrace
+
+SOURCEPATH		../sfsrv
+SOURCE			 cl_cdir.cpp cl_cli.cpp cl_debug.cpp cl_dir.cpp
+SOURCE			 cl_drive.cpp cl_entry.cpp cl_file.cpp cl_find.cpp
+SOURCE			 cl_fman.cpp cl_fmt.cpp cl_fraw.cpp cl_ftext.cpp
+SOURCE			 cl_main.cpp cl_parse.cpp cl_scan.cpp cl_insecure.cpp
+SOURCE			 cl_plugin.cpp cl_blockmap.cpp cl_clamp.cpp
+SOURCE			 cl_shim.cpp
+SOURCE			 cl_notification.cpp
+SOURCEPATH	.
+DOCUMENT		 release.txt
+
+TARGETTYPE		dll
+
+DEFFILE			 efsrv.def
+
+USERINCLUDE	../inc
+#ifdef SYMBIAN_OLD_EXPORT_LOCATION
+SYSTEMINCLUDE	../inc
+#endif
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+LIBRARY			 euser.lib hal.lib
+
+START WINS
+BASEADDRESS		0x66000000
+END
+
+UID		0x1000008d 0x100039e4
+VENDORID 0x70000001
+CAPABILITY	All
+
+unpagedcode
+
+SMPSAFE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/fileserver/group/efsrv.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,34 @@
+// Copyright (c) 1996-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:
+// f32/group/efsrv.mmp
+// efsrv.dll File Server client-side library
+// 
+//
+
+/**
+ @file
+*/
+
+
+TARGET			efsrv.dll
+
+#include "f32.mmh"  	// Generic definitions for the whole f32 component
+
+#ifdef SYMBIAN_TRACE_SYSTEM_INCLUDE
+	macro SYMBIAN_FTRACE_ENABLE_UDEB
+//	macro SYMBIAN_FTRACE_ENABLE_UREL
+#endif
+
+
+#include "efsrv.mmh"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/fileserver/group/efsrv_instrumented.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,34 @@
+// Copyright (c) 1996-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:
+// f32/group/efsrv.mmp
+// efsrv_instrumented.dll Instrumented version of the File Server client-side library
+// 
+//
+
+/**
+ @file
+*/
+
+
+TARGET			efsrv_instrumented.dll
+
+#include "f32.mmh"  	// Generic definitions for the whole f32 component
+
+#ifdef SYMBIAN_TRACE_SYSTEM_INCLUDE
+	macro SYMBIAN_FTRACE_ENABLE_UDEB
+	macro SYMBIAN_FTRACE_ENABLE_UREL
+#endif
+
+
+#include "efsrv.mmh"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/fileserver/group/ftrace.mmp	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,38 @@
+// 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:
+//
+
+#include "kernel/kern_ext.mmh"
+#include "f32.mmh"
+
+USERINCLUDE		../inc
+
+TARGET         d_ftrace.ldd
+TARGETTYPE     LDD
+SOURCEPATH	../ftrace
+SOURCE         d_ftrace.cpp
+
+epocallowdlldata
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+start wins
+win32_headers
+end
+
+capability	all
+VENDORID 0x70000001
+
+UNPAGED
+SMPSAFE
--- a/userlibandfileserver/fileserver/group/release.txt	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/group/release.txt	Wed Sep 01 12:34:56 2010 +0100
@@ -1,539 +1,386 @@
-Version 2.00.3058
-=================
-(Made by fadhliM 30/07/2010)
-
-1.	niccox
-	1.	ou1cimx1#393936 Incorrect update of progress bar with format of Usb Mass Storage 
-	2.	ou1cimx1#500789 ENV : F32Test T_WCACHE - Incorrect Check for Disk Size
-
-
-Version 2.00.3057
-=================
-(Made by fadhliM 27/07/2010)
-
-1.	niccox
-	1.	ou1cimx1#393936 Incorrect update of progress bar with format of Usb Mass Storage 
-	2.	ou1cimx1#493805 USB Host MS does not recognise NTFS partition info
-
-2.	h14jiang
-	1.	ou1cimx1#495683 FileServer - Bad usage of RArray::Append() and RPointerArray::Append()
-
-
-Version 2.00.3056
+Version 2.00.2505
 =================
 (Made by fadhliM 26/07/2010)
 
+1.	h14jiang
+	1.	ou1cimx1#495678 FileServer - Bad usage of RArray::Append() and RPointerArray::Append()
+
+2.	michcox
+	1.	MINOR_CHANGE 9.2 change includes from <F32Plugin.h> to <f32plugin.h> (i.e. case correction)
+
+
+Version 2.00.2504
+=================
+(Made by fadhliM 21/07/2010)
+
 1.	dlyokhin
-	1.	ou1cimx1#481268 ENV: F32TEST T_FILE Fails during testMultipleReadFile()
-
-2.	necliffo
-	1.	ou1cimx1#456106 [DEV] Improve MedMMC and PBus Coverage
-
-3.	martai
-	1.	ou1cimx1#493927 ENV : E32TEST T_SHADOW Fails during testMultipleReadFile()
-
-4.	migubarr
-	1.	ou1cimx1#469293 t_pwstr failures
-	2.	ou1cimx1#488785 SD stack: formatting a card on a multiple-card stack can fail with KErrNotReady
-	3.	ou1cimx1#485015 Internal file server attribute (KEntryAttModified) can be returned to the client
-	4.	ou1cimx1#459805 Querying the attributes of an open file on the emulator's Z: drive returns incorrect attributes
-
-5.	michcox
-	1.	ou1cimx1#455757 MINOR_CHANGE - t_fman test fail error code print out
-	2.	MINOR_CHANGE MCL change includes from <F32Plugin.h> to <f32plugin.h> (i.e. case correction)
-
-
-Version 2.00.3055
-=================
-(Made by fadhliM 23/07/2010)
-
-1.	michcox
-	1.	ou1cimx1#488769 Race condition in file server plugins
-	2.	ou1cimx1#502970 [ENV] Fileserver Coverity Defects
-
-2.	niccox
-	1.	ou1cimx1#486762 ENV T_FSCHED.EXE failure: line 936, after "Sync read done 0 ms before the write ended"
-
-
-Version 2.00.3054
+	1.	ou1cimx1#491761 ENV 92 : CAtaFatTable::DataPositionInBytes() Should Fail 'Gracefully' if Cluster is Invalid (Corrupted Media)
+
+
+Version 2.00.2503
 =================
 (Made by fadhliM 19/07/2010)
 
 1.	migubarr
+	1.	ou1cimx1#485027 Internal file server attribute (KEntryAttModified) can be returned to the client
+	2.	ou1cimx1#493751 Querying the attributes of an open file on the emulator's Z: drive returns incorrect attributes
+
+
+Version 2.00.2502
+=================
+(Made by famustaf 14/07/2010)
+
+1.	frhofman
+	1.	ou1cimx1#489934 ENV F32TEST T_RCACHE test failure investigation (t_rcache.cpp:1556)
+
+2.	migubarr
 	1.	ou1cimx1#476545 Inefficiencies in RFile::SetSize() & RFile::Write()
 
 
-Version 2.00.3053
-=================
-(Made by famustaf 12/07/2010)
+Version 2.00.2501
+=================
+(Made by famustaf 07/07/2010)
+
+1.	migubarr
+	1.	REQ 415-7212 NFE drive encryption on Demand Paging-enabled device
+
+
+Version 2.00.2500
+=================
+(Made by vfebvre 29/06/2010)
 
 1.	h14jiang
-	1.	ou1cimx1#428840 Not getting any Notification from RFs::NotifyDiskSpace() for E and F drive when when tested multiple time.
-
-2.	famustaf
-	1.	ou1cimx1#466351 Modify t_nmbs for Platsim's HVFS
-
-3.	migubarr
-	1.	ou1cimx1#437919 File Server flushes FAT metadata too often
-
-
-Version 2.00.3052
-=================
-(Made by famustaf 01/07/2010)
-
-1.	dlyokhin
-	1.	ou1cimx1#424702 FAT, exFAT should allow volume finalisation even if it has opened files or directories
-
-
-Version 2.00.3051
-=================
-(Made by vfebvre 21/06/2010)
-
-1.	michcox
-	1.	ou1cimx1#439295 [DEV] MCL Improve Code Coverage in MFS Code - Improve CFileMan observer
-
-
-Version 2.00.3050
+	1.	ou1cimx1#428824 Not getting any Notification from RFs::NotifyDiskSpace() for E and F drive when when tested multiple time.
+
+
+Version 2.00.2065
 =================
 (Made by vfebvre 18/06/2010)
 
-1.	shubmurt
-	1.	ou1cimx1#428765 Case and Slash fix for Linux Build
-
-2.	dlyokhin
-	1.	ou1cimx1#423737 FAT FS can report incorrect volume size
-
-
-Version 2.00.3049
+1.	erifung
+	1.	ou1cimx1#435443 ENV F32TEST T_LDRCHECK test failure investigation (t_ldrcheck.cpp:714)
+
+
+Version 2.00.2064
 =================
 (Made by vfebvre 15/06/2010)
 
 1.	migubarr
-	1.	ou1cimx1#393016 Crash when usb memory is dismounted during copy
+	1.	ou1cimx1#441149 File Server flushes FAT metadata too often
 
 2.	michcox
-	1.	ou1cimx1#419149 MCL fix CDirStack array panic
-
-
-Version 2.00.3048
-=================
-(Made by vfebvre 14/06/2010)
+	1.	ou1cimx1#418214 9.2 fix CDirStack array panic
+
+
+Version 2.00.2063
+=================
+(Made by vfebvre 11/06/2010)
 
 1.	migubarr
-	1.	ou1cimx1#420772 File Server flushes FAT metadata too often
-
-
-Version 2.00.3047
-=================
-(Made by vfebvre 11/06/2010)
-
-1.	dlyokhin
-	1.	ou1cimx1#423683 IT__BITO_SSS - 92_201019_hw79- \sf\os\kernelhwsrv\- Bad usage of RXXX::Connect() derived from RSessionBase
-
-2.	paconway
-	1.	DEF144802 CDynamicDirCache tests should be automated
-	2.	DEF144801 CDynamicDirCache leaks cache pages occasionally
-
-
-Version 2.00.3046
+	1.	ou1cimx1#424879 Phone resets sometimes when disconnecting OTG cable during playback
+
+
+Version 2.00.2062
 =================
 (Made by vfebvre 07/06/2010)
 
 1.	davegord
-	1.	ou1cimx1#414735 Occasional Loader crashes observed during T_WSD_TST_* tests
+	1.	ou1cimx1#414834 TB92 Occasional Loader crashes observed during T_WSD_TST_* tests
 		Crash caused by interrupt occurring during handling of SWI called from
 		SVC mode -- which is not supported. Fix is for Loader not to call RDebug
 		methods while executing in supervisor mode.
 
 
-Version 2.00.3045
-=================
-(Made by vfebvre 04/06/2010)
-
-1.	famustaf
-	1.	ou1cimx1#383105 Modify F32 Tests for Platsim's HVFS
-
-
-Version 2.00.3044
+Version 2.00.2061
 =================
 (Made by vfebvre 27/05/2010)
 
 1.	vfebvre
-	1.	ou1cimx1#400806 Warnings reported by the Symbian Foundation license checker
-
-2.	h14jiang
-	1.	DEF145205 File server crash observed when running F32TEST T_PLUGIN_V2
-
-3.	michcox
-	1.	ou1cimx1#378866 MCL Symbian.org Bug 2544 -  Possible deadlocks on f32 plugin chains
-
-4.	vinjose
-	1.	ou1cimx1#394794 Raptor creates incorrect .iby files for f32test/loader
-
-
-Version 2.00.3043
-=================
-(Made by vfebvre 27/05/2010)
-
-1.	paconway
-	1.	REQ 417-56766 MBBMS over CMMB for TD-SCDMA Gen. 2 MobileTv
-		PackageReleaseID=497412 FeatureReleaseID=494378
-
-
-Version 2.00.3042
-=================
-(Made by vfebvre 14/05/2010)
+	1.	ou1cimx1#400807 Warnings reported by the Symbian Foundation license checker
+
+
+Version 2.00.2060
+=================
+(Made by vfebvre 25/05/2010)
 
 1.	migubarr
-	1.	REQ 428-1297 Migrate File Server Tracing from UTF to OST
-		PackageReleaseID=495120
-
-
-Version 2.00.3041
-=================
-(Made by vfebvre 13/05/2010)
+	1.	ou1cimx1#393012 Crash when usb memory is dismounted during copy
+
+2.	michcox
+	1.	ou1cimx1#378895 TB92 Symbian.org Bug 2544 -  Possible deadlocks on f32 plugin chains
+
+
+Version 2.00.2059
+=================
+(Made by vfebvre 21/05/2010)
+
+1.	niccox
+	1.	ou1cimx1#391109 Incorrect update of progress bar with format of Usb Mass Storage
+
+
+Version 2.00.2058
+=================
+(Made by vfebvre 14/05/2010)
 
 1.	famustaf
-	1.	ou1cimx1#380321 Build on Linux - Incorrect slash in #include in sf_sys.cpp
-
-
-Version 2.00.3040
-=================
-(Made by vfebvre 12/05/2010)
-
-1.	cnotton
-	1.	MINOR_CHANGE Corrected MRP comment text
-
-2.	hengrant
-	1.	ou1cimx1#370931 Memory card gets locked by itself MCL
-
-
-Version 2.00.3039
-=================
-(Made by vfebvre 06/05/2010)
+	1.	ou1cimx1#380187 Build on Linux - Incorrect slash in #include in sf_sys.cpp
+		Changed backslash to forward slash.
+
+
+Version 2.00.2057
+=================
+(Made by vfebvre 07/05/2010)
 
 1.	famustaf
-	1.	ou1cimx1#372432 CFileMan malfunctioning in copying
+	1.	ou1cimx1#372053 CFileMan malfunctioning in copying
 
 2.	dlyokhin
-	1.	ou1cimx1#372220 File server may request more free space on the volume than necessary
-
-
-Version 2.00.3038
+	1.	ou1cimx1#372172 File server may request more free space on the volume than necessary
+
+
+Version 2.00.2056
 =================
 (Made by vfebvre 05/05/2010)
 
 1.	niccox
-	1.	ou1cimx1#371028 shostmassstorage capabilities are too high
-
-
-Version 2.00.3037
+	1.	ou1cimx1#371021 shostmassstorage capabilities are too high
+
+
+Version 2.00.2055
 =================
 (Made by vfebvre 30/04/2010)
 
-1.	vfebvre
-	1.	ou1cimx1#357360 Some test binaries are targeted by several bld.inf files
-
-2.	frhofman
-	1.	ou1cimx1#367552 BC Drivers: Os/KernelHwSrv: 2 failures in Base API on Vasco
-
-3.	michcox
-	1.	ou1cimx1#357494 Maps 3.04: File mode EFileWrite (defined in f32file.h) corrupts memory of other processes under certain conditions on 5.0 devices
-	2.	ou1cimx1#367062 Update T_filecache for ou1cimx1#357494
-
-
-Version 2.00.3036
-=================
-(Made by vfebvre 27/04/2010)
-
-1.	erifung
-	1.	DEF144399 Frequent T_LDRCHECK failures on the H4
-
-
-Version 2.00.3035
+1.	frhofman
+	1.	ou1cimx1#360143 BC Drivers: Os/KernelHwSrv: 2 failures in Base API on Vasco
+
+
+Version 2.00.2054
 =================
 (Made by vfebvre 23/04/2010)
 
+1.	michcox
+	1.	ou1cimx1#357507 TB92 Maps 3.04: File mode EFileWrite (defined in f32file.h) corrupts memory of other processes under certain conditions on 5.0 devices
+
+
+Version 2.00.2053
+=================
+(Made by vfebvre 22/04/2010)
+
 1.	niccox
-	1.	ou1cimx1#357492 Disconnecting memory card reader/writer from phone causes phone crash
-
-
-Version 2.00.3034
-=================
-(Made by vfebvre 20/04/2010)
-
-1.	vfebvre
-	1.	REQ417-62711 Sirocco: Build and Test Systems Migration
-		PackageReleaseID=487623 FeaturePlanID=457782
-
-
-Version 2.00.3033
-=================
-(Made by vfebvre 16/04/2010)
-
-1.	niccox
-	1.	DEF145330 Error in mass storage note when connecting SanDisk 16GB stick to phone
-
-
-Version 2.00.3032
-=================
-(Made by vfebvre 16/04/2010)
-
-1.	vfebvre
-	1.	No change
-
-
-Version 2.00.3031
-=================
-(Made by vfebvre 15/04/2010)
-
-1.	migubarr
-	1.	REQ 415-7212 NFE drive encryption on Demand Paging-enabled device, kernelhwsrv/MCL
-		PackageReleaseID=453228 FeatureReleaseID=447937
-
-
-Version 2.00.3030
+	1.	ou1cimx1#356808 Disconnecting memory card reader/writer from phone causes phone crash
+
+
+Version 2.00.2052
 =================
 (Made by vfebvre 14/04/2010)
 
 1.	famustaf
-	1.	DEF145043 F32TEST T_FSYS test failure investigation
-		Added the KMediaRemountForceMediaChange flag in the call to RemountDrive() to
-		simulate ejecting and re-inserting the media.
-
-
-Version 2.00.3029
-=================
-(Made by vfebvre 12/04/2010)
-
-1.	kmetherm
-	1.	REQ 417-57581 RVCT 4 compatible software codebase (SSS)
-		PackageReleaseID=476546 FeaturePlanID=444184
-
-
-Version 2.00.3028
+	1.	PDEF145305 F32TEST T_FSYS test failure investigation
+
+
+Version 2.00.2051
 =================
 (Made by vfebvre 09/04/2010)
 
+1.	niccox
+	1.	DEF145248 Error in mass storage note when connecting SanDisk 16GB stick to phone
+
+
+Version 2.00.2050
+=================
+(Made by vfebvre 24/03/2010)
+
 1.	fagortz
-	1.	PDEF145219 TTPA-83EAYU: Partition handling for USB drives with 4K block size is incorrect
-
-
-Version 2.00.3027
-=================
-(Made by vfebvre 08/04/2010)
-
-1.	frhofman
-	1.	DEF145044: F32TEST T_HANDSHARE test failure investigation
-
-
-Version 2.00.3026
-=================
-(Made by vfebvre 30/03/2010)
+	1.	DEF145067: TTPA-83EAYU: Partition handling for USB drives with 4K block size is incorrect
+
+
+Version 2.00.2049
+=================
+(Made by vfebvre 22/03/2010)
 
 1.	michcox
-	1.	DEF145235 DNAK-83X92C Symbian^3 SDK : Compilation error in Error in "f32notification.h"
-
-
-Version 2.00.3025
-=================
-(Made by vfebvre 26/03/2010)
-
-1.	famustaf
-	1.	REQ 417-52995 Improved rugged FAT performance
-		PackageReleaseID=419439 FeatureReleaseID=419437
-
-
-Version 2.00.3024
-=================
-(Made by vfebvre 22/03/2010)
-
-1.	migubarr
-	1.	DEF144423 Frequent T_RCACHE failures on the H2/H6 (line 1556)
-
-2.	michcox
-	1.	PDEF145110 File server does not check return result of some User::ReAlloc()'s 
-
-
-Version 2.00.3023
+	1.	DEF145080 SMAD-83NJMP: File server does not check return result of some User::ReAlloc()'s
+
+
+Version 2.00.2048
 =================
 (Made by vfebvre 15/03/2010)
 
 1.	niccox
-	1.	DEF145021 Improper Mass Storage Error Code for Empty Drive case
-
-2.	shamaden
-	1.	PDEF144922 TRAI-82RJFS Crash when usb memory is dismounted during copy 
-
-
-Version 2.00.3022
+	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
 
-2.	michcox
-	1.	DEF144912 T_EXT1 fails under platsim as it doesn't support fsys extensions 
-
-
-Version 2.00.3021
-=================
-(Made by vfebvre 11/03/2010)
+
+Version 2.00.2046
+=================
+(Made by vfebvre 10/03/2010)
 
 1.	frhofman
-	1.	PDEF144919: SALM-82WCVK: efile.exe crashes in dynamic dir cache code when out-of-memory
-
-
-Version 2.00.3020
+	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.	PDEF144805 Transcend flash drive not recognised 
-
-2.	dlyokhin
-	1.	PDEF144751 FAT: unable to mount volume larger than 1TB  
-
-
-Version 2.00.3019
+	1.	DEF144749 Transcend flash drive not recognised 
+
+
+Version 2.00.2043
 =================
 (Made by vfebvre 04/03/2010)
 
 1.	dlyokhin
-	1.	PDEF144780  exFAT: T_chkUID test failure  
-
-
-Version 2.00.3018
+	1.	DEF144779 exFAT: T_chkUID test failure  
+
+
+Version 2.00.2042
 =================
 (Made by vfebvre 03/03/2010)
 
 1.	niccox
-	1.	DEF144738 Initialisation of MaxLun if USB device stalls request
-
-
-Version 2.00.3017
+	1.	DEF144548 Initialisation of MaxLun if USB device stalls request
+
+
+Version 2.00.2041
 =================
 (Made by vfebvre 02/03/2010)
 
 1.	dlyokhin
-	1.	DEF144683 TUint32 overflow in CFatFileCB::DoExpandFileL()
-
-
-Version 2.00.3016
+	1.	DEF144598 FAT leaf directory cache should be enabled by default  
+
+
+Version 2.00.2040
 =================
 (Made by vfebvre 26/02/2010)
 
 1.	famustaf
-	1.	PDEF144638 Missing Trap in a non-leaving function.
-
-2.	frhofman
-	1.	DEF144651: Revert IsFileOpen() behaviour to perform file existance check
-
-3.	dlyokhin
-	1.	PDEF144599 FAT leaf directory cache should be enabled by default  
-	2.	DEF144629 Better checks in CFat16FixedCache code  
-
-
-Version 2.00.3015
-=================
-(Made by vfebvre 25/02/2010)
+	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)
 
 1.	niccox
-	1.	DEF144571 remove redundant bootsector code from smassstorage
-
-
-Version 2.00.3014
-=================
-(Made by vfebvre 23/02/2010)
-
-1.	jsucksmi
-	1.	PDEF144223:Emulated removable drive X is not present in tb10.1(MSF00326) and tb9.2(1014) 
-
-
-Version 2.00.3013
-=================
-(Made by vfebvre 19/02/2010)
-
-1.	dlyokhin
-	1.	DEF144487: FAT FS should allow skipping file timestamp update on data flushing
-
-
-Version 2.00.3012
+	1.	DEF144323 remove redundant bootsector code from smassstorage
+
+
+Version 2.00.2038
 =================
 (Made by vfebvre 18/02/2010)
 
 1.	famustaf
-	1.	DEF144437 Optimise TParseBase::AddDir() to not use TFileName
+	1.	PDEF144438 Optimise TParseBase::AddDir() to not use TFileName
 
 2.	migubarr
-	1.	PDEF144408: File Server request cache is not big enough for S60 
-
-
-Version 2.00.3011
+	1.	DEF144407: File Server request cache is not big enough for S60
+
+
+Version 2.00.2037
 =================
 (Made by vfebvre 11/02/2010)
 
 1.	dlyokhin
-	1.	PDEF144357 VFAT interoperability: LFN entries padding is wrong
-
-
-Version 2.00.3010
+	1.	DEF144356 VFAT interoperability: LFN entries padding is wrong
+
+
+Version 2.00.2036
 =================
 (Made by vfebvre 09/02/2010)
 
 1.	kaduan
-	1.	DEF144138:  Unwanted directory cache change caused performance regression 
+	1.	PDEF144352:  Unwanted directory cache change caused performance regression 
 
 2.	dlyokhin
-	1.	PDEF144270 potential memory leak in TFindFile::FindWildByDir()  
-
-
-Version 2.00.3009
+	1.	DEF144134 potential memory leak in TFindFile::FindWildByDir()  
+
+
+Version 2.00.2035
 =================
 (Made by vfebvre 05/02/2010)
 
 1.	niccox
-	1.	PDEF144293 Add ModeSense10 support to USB MS Client
-
-
-Version 2.00.3008
+	1.	DEF144268 Add ModeSense10 support to USB MS Client
+
+
+Version 2.00.2034
 =================
 (Made by vfebvre 03/02/2010)
 
 1.	migubarr
-	1.	PDEF144173: Small FAT32 partitions on large media can sometimes be formatted incorrectly 
-
-
-Version 2.00.3007
+	1.	DEF144172: Small FAT32 partitions on large media can sometimes be formatted incorrectly 
+
+
+Version 2.00.2033
+=================
+(Made by vfebvre 01/02/2010)
+
+1.	jsucksmi
+	1.	DEF144003 Emulated removable drive X is not present in tb10.1(MSF00326) and tb9.2(1014) 
+
+
+Version 2.00.2032
 =================
 (Made by vfebvre 28/01/2010)
 
 1.	famustaf
-	1.	DEF144032 Change tests in t_fman to use __E32TEST_EXTENSION__
+	1.	PDEF144033 Change tests in t_fman to use __E32TEST_EXTENSION__
 
 2.	hengrant
-	1.	DEFECT FIX: DEF144005 New Memory & File Server Coverity Defects
-		Fix 3 Coverity Issues
-
-
-Version 2.00.3006
+	1.	PDEF144090 New Memory & File Server Coverity Defects
+		3 Coverity Fixes
+
+
+Version 2.00.2031
+=================
+(Made by vfebvre 26/01/2010)
+
+1.	famustaf
+	1.	MINOR_CHANGE Add documentation to 'Copy' in Text Shell (TB9.2)
+		Added documentation to state that ShellFunction::Copy will overwrite existing file(s)
+
+
+Version 2.00.2030
 =================
 (Made by vfebvre 21/01/2010)
 
 1.	dlyokhin
-	1.	PDEF143792 FAT: renaming many files in a directory corrupts short file names  
-
-
-Version 2.00.3005
+	1.	PDEF143791 FAT: renaming many files in a directory corrupts short file names
+
+
+Version 2.00.2029
 =================
 (Made by vfebvre 19/01/2010)
 
 1.	necliffo
-	1.	DEF143911 WDP: T_locate fails on VASCO 
-
-
-Version 2.00.3004
+	1.	PDEF143913 WDP: T_locate fails on VASCO 
+
+
+Version 2.00.2028
 =================
 (Made by vfebvre 15/01/2010)
 
@@ -541,46 +388,25 @@
 	1.	PDEF143832 t_falsespace should not be run on drive if media type is EMediaRAM
 
 
-Version 2.00.3003
+Version 2.00.2027
 =================
 (Made by vfebvre 15/01/2010)
 
 1.	niccox
-	1.	DEF143785 USB Host MS does not handle non-mass-storage drive correctly
-	2.	MINOR_CHANGE hostusbmsapp support for different screen sizes
+	1.	PDEF143508 Host USB ModeSense10 command does not decode ModeDataLength
+	2.	MINOR_CHANGE usbtestclient corrections
+	3.	MINOR_CHANGE hostusbmsapp support for different screen sizes
+	4.	DEF143785 USB Host MS does not handle non-mass-storage drive correctly
 
 2.	kaduan
-	1.	PDEF143820: File system caching should be turned off on the S60 emulator 
+	1.	DEF143211 File system caching should be turned off on the S60 emulator
+	2.	DEF136627:  T_HANDSHARE failed on NE1_TB_ARMV5.UDEB.SMPPAGE image 
 
 3.	migubarr
-	1.	PDEF143787: t_ms_mountstart fails on H4 and VASCO
-
-
-Version 2.00.3002
-=================
-(Made by vfebvre 13/01/2010)
-
-1.	kaduan
-	1.	PDEF143778 T_HANDSHARE failed on NE1_TB_ARMV5.UDEB.SMPPAGE image
-
-2.	dlyokhin
-	1.	DEF143404 FAT: deleting VFAT entryset is not optimal
-
-
-Version 2.00.3001
-=================
-(Made by vfebvre 12/01/2010)
-
-1.	niccox
-	1.	MINOR_CHANGE usbtestclient corrections
-
-
-Version 2.00.3000
-=================
-(Made by vfebvre 07/01/2010)
-
-1.	niccox
-	1.	DEF143508 Host USB ModeSense10 command does not decode ModeDataLength
+	1.	DEF143592: t_ms_mountstart fails on H4 and VASCO 
+
+4.	dlyokhin
+	1.	PDEF143794  FAT: deleting VFAT entryset is not optimal
 
 
 Version 2.00.2026
--- a/userlibandfileserver/fileserver/inc/F32plugin.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/inc/F32plugin.h	Wed Sep 01 12:34:56 2010 +0100
@@ -448,7 +448,7 @@
 	//Overloaded function - checks all types of TInterceptAtts
 	TBool IsRegistered(TInt aMessage);
 	TBool IsRegistered(TInt aMessage, TInterceptAtts aInterceptAtts);
-	TBool OriginatedFromPlugin(CFsRequest& aMessage);
+	TBool IsPluginThread(CFsRequest& aMessage);
 	TBool IsMounted(TInt aDrive);
 
 private:
--- a/userlibandfileserver/fileserver/inc/f32dbg.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/inc/f32dbg.h	Wed Sep 01 12:34:56 2010 +0100
@@ -187,14 +187,6 @@
 const TInt KControlIoSessionCount=KMaxTInt-21;
 const TInt KControlIoObjectCount=KMaxTInt-22;
 
-const TInt KControlIoIsFileSequential=KMaxTInt-23;
-const TInt KControlIoGlobalCacheConfig=KMaxTInt-24;
-const TInt KControlIoGlobalCacheInfo=KMaxTInt-25;
-const TInt KControlIoDirCacheConfig=KMaxTInt-26;
-const TInt KControlIoDirCacheInfo=KMaxTInt-27;
-const TInt KControlIoSimulateMemoryLow=KMaxTInt-28;
-const TInt KControlIoStopSimulateMemoryLow=KMaxTInt-29;
-
 const TInt KNCDebugNotifierValue=-500000;	// between 0 and 1 second
 
 GLREF_D TInt DebugNCNotifier;
@@ -262,88 +254,6 @@
 
 extern TBool EnableFatUtilityFunctions;
 
-class TGlobalCacheConfig
-    {
-public:
-    TInt32 iGlobalCacheSizeInBytes;      		// in bytes 
-    TInt32 iGlobalLowMemoryThreshold;         	// in percentage
-    };
-
-class TGlobalCacheInfo
-    {
-public:
-    TInt32 iGlobalCacheSizeInBytes;     		// in bytes 
-    TInt32 iGlobalLowMemoryThreshold;   		// in percentage
-    };
-
-class TDirCacheConfig
-    {
-public:
-    TInt iDrive;
-
-    TInt32 iLeafDirCacheSize;           // in number of most recently visited leaf directories
-    TInt32 iDirCacheSizeMin;            // in bytes
-    TInt32 iDirCacheSizeMax;            // in bytes
-    };
-
-class TDirCacheInfo
-    {
-public:
-    TInt iDrive;
-
-    /**
-    Segment size in bytes. A memory segment is the smallest memory unit that Kernel manages through RChunk.
-    */
-    TInt32 iMemorySegmentSize;
-
-    /**
-    Size of memory a page occupies, in bytes.
-    Note: following restrictions may result a difference between page size in memory & page size in data:
-        1. page size can not be smaller than segment size
-        2. one page can not contain data from two different clusters
-    */
-    TInt32 iPageSizeInMemory;
-
-    /**
-    Size of actual data a page contains, in bytes.
-    Note: following restrictions may result a difference between page size in memory & page size in data:
-        1. page size can not be smaller than segment size
-        2. one page can not contain data from two different clusters
-    */
-    TInt32 iPageSizeInData;
-    
-    /**
-    The minimum number of pages that the cache can contain, even under low memory conditions.
-    */
-    TInt32 iMinCacheSizeInPages;
-
-    /**
-    The maximum number of pages that the cache can contain, when there is enough free memory in the system.
-    */
-    TInt32 iMaxCacheSizeInPages;
-    
-    /**
-    The minimum cache size in memory. In bytes.
-    */
-    TInt32 iMinCacheSizeInMemory;
-
-    /**
-    The maximum cache size in memroy. In bytes.
-    */
-    TInt32 iMaxCacheSizeInMemory;
-    
-    /**
-    Current count of the locked pages.
-    */
-    TInt32 iLockedPageNumber;
-
-    /**
-    Current count of the unlocked pages.
-    */
-    TInt32 iUnlockedPageNumber;
-    
-    };
-
 #endif
 
 enum TLoaderDebugFunction
--- a/userlibandfileserver/fileserver/inc/f32file.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/inc/f32file.h	Wed Sep 01 12:34:56 2010 +0100
@@ -680,15 +680,6 @@
     ETrue value means that the drive is finalised
     */
     EIsDriveFinalised,
-    
-    /**
-    Query the volume to ascertain whether File system extensions
-    are supported on this volume.
-    A boolean value is returned within the buffer defined as TPckgBuf<TBool>. 
-    ETrue value means that extensions are supported.
-    EFalse means they are not supported.
-     */
-    EFSysExtensionsSupported,
 	};
 
 /**
@@ -1150,32 +1141,7 @@
 	@internalTechnology
 	
 	*/
-	EFileBigFile        =0x00040000,
-	
-	/**
-	Using this flag implies that the client is making large sequential reads and/or writes
-	and it is interested in maximising the performance of the large reads and/or writes.
-	
-	The flag gives a hint to the file server and filesystem to adjust to a streaming
-	data pattern and try their best to make it optimal.
-	
-	Some conditions apply:
-	- This does not guarantee that the performance of read/write operations will increase.
-	- Using this flag for other purposes other than data streaming may lead to performance degradation.
-	- This may sacrifice user data integrity for the sake of performance.
-	
-	If a file is opened by Client A with EFileSequential, and the file is then opened
-	without EFileSequential by Client B, then this file mode will be disabled.
-	When the file handle is closed by Client B, then the EFileSequential file mode
-	will be enabled again.
-	Therefore, this mode will only be enabled if all clients set the file as such,
-	otherwise the file mode will be disabled.
-	
-	FAT file system specific information:
-	This flag improves write and file expansion performance whilst decreasing robustness
-	on a "Rugged-FAT" file system, which is applicable to internal non-removable drives.
-	*/
-	EFileSequential		=0x00080000
+	EFileBigFile        =0x00040000
 
 	};
 
@@ -2942,6 +2908,7 @@
 	IMPORT_C TInt Copy(const RFile& anOld,const TDesC& aNew,TUint aSwitches,TRequestStatus& aStatus);
 protected:
 	CFileMan(RFs& aFs);
+	TInt RenameInvalidEntry(const TDesC& anOld,const TDesC& aNew,TUint aSwitch=EOverWrite);
 private:
 	/**
 	This is an internal enumeration for CFileMan implementation. 
--- a/userlibandfileserver/fileserver/inc/f32fsys.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/inc/f32fsys.h	Wed Sep 01 12:34:56 2010 +0100
@@ -556,10 +556,6 @@
 	
 	friend class LocalDrives;			// for access to iChanged flag
 	friend class CExtNotifyMediaChange; // for access to iChanged flag
-	
-#if defined(_USE_CONTROLIO) || defined(_DEBUG) || defined(_DEBUG_RELEASE)
-	friend class TFsControlIo;			// for access to LocateDrives()
-#endif
 	};
 
 class CFileCB;
@@ -1618,6 +1614,7 @@
 	TBool DeleteOnClose() const;
  
 	
+
 	void SetNotifyAsyncReadersPending(TBool aNotifyAsyncReadersPending);
 	TBool NotifyAsyncReadersPending() const;
 	TInt CancelAsyncReadRequest(CFileShare* aShareP, TRequestStatus* aStatusP);
@@ -1642,17 +1639,6 @@
 	TInt RemoveLock64(CFileShare* aFileShare,TInt64 aPos,TInt64 aLength);
 	TInt CheckLock64(CFileShare* aFileShare,TInt64 aPos,TInt64 aLength);
 
-	/** Sequential mode */
-	
-	IMPORT_C TBool IsSequentialMode() const;
-	void SetSequentialMode(TBool aSequential);
-
-	/**
-	The FileShare List contains the file shares of an open file.
-	*/
-	TDblQue<CFileShare>& FileShareList() const;
-	void AddShare(CFileShare& aFileShare);
-
     /**
     Renames the file with the full file name provided.
 
@@ -1969,12 +1955,12 @@
 public:
 
 	/**
-	The full name of the file, including its extension.
+	The full name of the file, including drive and extensions.
 	*/
 	HBufC* iFileName;
 
 	/**
-	The full name of the file, including its extension - Folded.
+	The full name of the file, including drive and extensions - Folded.
 	*/
 	HBufC* iFileNameF;
 
@@ -1983,9 +1969,11 @@
 	TDrive*             iCreatedDrive;
 	TDrive*             iDrive;
 	CMountCB*           iMount;
-	TFileLocksArray*    iFileLocks;		// An array of file position locks
+	TFileLocksArray*    iFileLocks; ///< an array of file position locks
 	TDblQueLink         iMountLink;
-	CFileBody*			iBody;
+	
+private:
+	CFileBody* iBody;
 
 	friend class TDrive;
 	friend class CMountCB;
@@ -2038,7 +2026,7 @@
 	void InitL();
 	inline CFileCB& File();
 
-	// For serialising async requests 
+	// For serialising aync requests 
 	TBool RequestStart(CFsMessageRequest* aRequest);
 	void RequestEnd(CFsMessageRequest* aRequest);
 	TBool RequestInProgress() const;
@@ -2063,13 +2051,8 @@
 
 	// A pointer to the current request. Used for serializing client 
 	// async read/write requests which might otherwise be processed out
-	// of order due to fair scheduling.
-	CFsMessageRequest* iCurrentRequest;
-	
-	// The FileShare List link object.
-	TDblQueLink iShareLink;
-
-friend class CFileBody;	// For access to iShareLink
+	// of order due to fair scheduling
+	CFsMessageRequest* iCurrentRequest;	
 	};
 
 
--- a/userlibandfileserver/fileserver/inc/f32fsys.inl	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/inc/f32fsys.inl	Wed Sep 01 12:34:56 2010 +0100
@@ -270,48 +270,53 @@
 	__IS_DRIVETHREAD();
 	iDriveFlags |= ENotifyOff;
 	}
+/**
 
-/**
 Locks the drive.This function acquires iLock mutex.
+
 */
 inline void TDrive::Lock()
 	{iLock.Wait();}
+/**
 
-/**
 UnLocks the drive.This function signals the iLock mutex.
+
 */
+
 inline void TDrive::UnLock()
 	{iLock.Signal();}
 
 
 /**
+
+Gets the reserved space of a drive
+
 @return	Amount of space reserved in bytes.
+
 */
+
 inline TInt TDrive::ReservedSpace() const
-	{
-    return iReservedSpace;
-    }
+	{return iReservedSpace;}
 
 /**
-    Reserves space on a drive. The amount of 'reserved space' is subtracted  
-    from the amount of available free space on the volume reported by file system, when the user 
-    queries it.
+
+Reserves a space of a drive.
 
-    @param	aReservedSpace	Amount of space to reserve in bytes.
+@param	aReservedSpace	Amount of space to reserve in bytes.
+
 */
 inline void TDrive::SetReservedSpace(const TInt aReservedSpace)
-	{
-    iReservedSpace=aReservedSpace; 
-    }
+	{iReservedSpace=aReservedSpace; }
 
 /**
-    Sets the 'rugged mode' flag in the drive object. The file system associated with this TDrive object 
-    can use this flag for changing its behaviour.
-    For example, FAT file system if this flag is set, operates in 'Rugged FAT' mode, when the performance is 
-    sacrificed for the sake of reliability. 
+
+Sets the rugged flag in the drive object.
 
-    @param aIsRugged  the 'rugged mode' flag.
+@param Flag to set or clear the rugged flag.
+@see	IsRugged()
+
 */
+
 inline void TDrive::SetRugged(TBool aIsRugged)
 	{
 	if (!aIsRugged)
@@ -321,13 +326,17 @@
 	}
 
 /**
-    @return 'Is rugged' flag.
-    See TDrive::SetRugged()
+
+Returns whether the current drive is running as rugged Fat
+or not.If IsRugged flag is set then in the event of power 
+failure fat/metadata will be in a valid state if the scandrive 
+utility is run immediately after.
+
+@return Is rugged fat flag.
 */
+
 inline TBool TDrive::IsRugged() const
-	{
-    return !(iDriveFlags & ENotRugged); 
-    }
+	{return !(iDriveFlags & ENotRugged); }
 
 
 /**
@@ -442,69 +451,64 @@
 	{Drive().SetNotifyOff();}
 
 
-//---------------------------------------------------------------------------------------------------------------------------------
 
-/**
-
-    Increment mount's lock counter. This happens on following events:
-        - RemoveResource() call, when file (share) or directory is closed
-        - AddDiskAccess() call,  when disk access object (like Format or RawDisk access) is opened on the mount.
-
-    See also: CMountCB::LockStatus()   
-*/
-inline void CMountCB::IncLock()
-	{
-    iLockMount++;
-    }
-
-
-//---------------------------------------------------------------------------------------------------------------------------------
 
 /**
-    Decrement mount's lock counter. This happens on following events:
-
-    AddResource()       call when file (share) or directory is opened on the mount 
-    RemoveDiskAccess()  call when disk access object (like Format or RawDisk access) is closed.
-
-    See also: CMountCB::LockStatus()   
-*/
-inline void CMountCB::DecLock()
-	{
-    iLockMount--;
-    }
+Locks the mount by incrementing the internal lock counter.
 
-//---------------------------------------------------------------------------------------------------------------------------------
+The mount becomes locked on formatting or on the opening of a resource
+(a file or a directory) or raw disk subsession.
+A format, resource or raw disk subsession can only be opened if the mount
+is not locked.
+*/
+inline void CMountCB::IncLock()
+	{iLockMount++;}
 
-/**
-    @return value of the Mount's lock counter value.
-    
-    The meaning of 'iLockMount' is overloaded a bit, it's value is:
-        0   when there are no files, directories, formats and any other objects opened on the mount
-        >0  when there are disk access objects opened (raw disk access or format)
-        <0  when there are files or directories opened on the mount, and the value reflects their total number 
-*/
-inline TInt CMountCB::LockStatus() const
-	{
-    return iLockMount;
-    }
 
 
 
-//---------------------------------------------------------------------------------------------------------------------------------
+/**
+Unlocks the mount by decrementing the internal lock counter.
+
+The mount becomes locked on formatting or on the opening of a resource
+(a file or a directory) or raw disk subsession.
+A format, resource or raw disk subsession can only be opened if the mount
+is not locked.
+*/
+inline void CMountCB::DecLock()
+	{iLockMount--;}
+
+
+
+
+/**
+Gets the current lock status.
+
+It delivers the current lock status by returning the internal lock counter.
+
+@return The current lock status.
+*/
+inline TInt CMountCB::LockStatus() const
+	{return(iLockMount);}
+
+
+
+
 /**
 Tests whether the mount is currently locked. 
 
 A mount is locked when the internal lock counter is greater than zero.
-    This happens when a format, resource or raw disk subsession is opened on the mount.
+On creation, the lock counter is set to zero.
 
-    See also: CMountCB::LockStatus()   
+The mount becomes locked on formatting or on the opening of a resource
+(a file or a directory) or raw disk subsession.
+A format, resource or raw disk subsession can only be opened if the mount
+is not locked.
 
-    @return True if the mount is locked by having disk access objects opened
+@return True if the mount is locked, false, otherwise.
 */
 inline TBool CMountCB::Locked() const
-	{
-    return iLockMount > 0; 
-    }
+	{return iLockMount>0; }
 
 
 
@@ -533,9 +537,7 @@
 /**
 */
 inline TInt64 CMountCB::Size() const
-	{
-    return iSize;
-    }
+	{return(iSize);}
 
 
 
@@ -545,19 +547,14 @@
 @param aMountNumber - The unique mount number
 */
 const TInt KMountDismounted = 0x80000000;
-
 inline void CMountCB::SetMountNumber(TInt aMountNumber)
-	{ 
-    iMountNumber = (aMountNumber & ~KMountDismounted); 
-    }
+	{ iMountNumber = (aMountNumber &~ KMountDismounted); }
 
 
 
 
 /**
-    Set the mount flag indicating that it is in 'dismounted' state.
-    The CMountCB object in this case is still alive, but any attempts to access resources on this 
-    mount result in KErrDismounted.
+Set the mount to be dismounted
 */
 inline void CMountCB::SetDismounted(TBool aDismounted)
 	{
@@ -571,23 +568,21 @@
 
 
 /**
+Returns the unique mount number
 @return The unique mount number
 */
 inline TInt CMountCB::MountNumber() const
-	{ 
-    return(iMountNumber &~ KMountDismounted); 
-    }
+	{ return(iMountNumber &~ KMountDismounted); }
 
 
 
 
 /**
+Returns ETrue if the mount is flagged as dismounted.
 @return ETrue if the mount is flagged as dismounted
 */
 inline TBool CMountCB::IsDismounted() const
-	{ 
-    return(iMountNumber & KMountDismounted); 
-    }
+	{ return(iMountNumber & KMountDismounted); }
 
 
 
--- a/userlibandfileserver/fileserver/inc/f32notification.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/inc/f32notification.h	Wed Sep 01 12:34:56 2010 +0100
@@ -17,8 +17,6 @@
 #ifndef __F32NOTIFICATION_H__
 #define __F32NOTIFICATION_H__
 
-#include <f32file.h> //For clients that include F32Notification.h first.
-
 /*
  * This class is not intended for instantiation neither on the stack
  * nor on the heap.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/fileserver/inc/f32tracedef.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,71 @@
+/*
+* 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:
+*
+* WARNING: This file contains some APIs which are internal and are subject
+*          to change without notice. Such APIs should therefore not be used
+*          outside the Kernel and Hardware Services package.
+*/
+// F32TRACEDEF.H
+//
+
+#if !defined(__F32TRACEDEF_H__)
+#define __F32TRACEDEF_H__
+
+//*********************************
+// from e32utrace_basic_types.h
+//*********************************
+typedef TUint8  TClassification;	// same as BTrace::TCategory
+typedef TUint32 TModuleUid;			
+typedef TUint16 TFormatId;			// 2 bytes occupying first 32-bit word of data
+
+namespace UTF
+	{
+	const static TFormatId KInitialClientFormat = 512; 
+	const static TFormatId KMaxFormatId = KMaxTUint16;		// 0xFFFF
+
+	enum TClassificationAll
+		{
+		EPanic = 192,
+		EError = 193,
+		EWarning = 194, 
+		EBorder = 195, 
+		EState = 196, 
+		EInternals = 197, 
+		EDump = 198, 
+		EFlow = 199, 
+		ESystemCharacteristicMetrics = 200, 
+		EAdhoc = 201,
+		EClassificationAllHighWaterMark, 
+		};
+	}	// namespace UTF
+
+
+enum TF32TraceFormatUids
+	{
+	EF32TraceUidEfsrv		=	0x100039e4,	// 268450276
+	EF32TraceUidFirst		=	0x10286575,	// 271082869
+	EF32TraceUidLast		=	0x10286594,	// 271082900
+	
+	EF32TraceUidFileSys		=	0x10286575,	// 271082869
+	EF32TraceUidProxyDrive	=	0x10286576,	// 271082870
+
+    // Provided to allow the following compile time assert.
+    ETraceUidHighWaterMark,
+    };
+    __ASSERT_COMPILE(ETraceUidHighWaterMark <= (EF32TraceUidLast + 1));
+	
+
+#endif
+
--- a/userlibandfileserver/fileserver/inc/f32ver.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/inc/f32ver.h	Wed Sep 01 12:34:56 2010 +0100
@@ -58,6 +58,6 @@
 
 @see TVersion
 */
-const TInt KF32BuildVersionNumber=3058;
+const TInt KF32BuildVersionNumber=2504;
 //
 #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/fileserver/inc/utraceefile.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,603 @@
+
+// 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:
+// File Server tracing
+// 
+//
+
+/**
+ @file
+ @publishedPartner
+ @prototype
+*/
+
+#ifndef UTRACEEFILE_H
+#define UTRACEEFILE_H
+
+
+#include <f32tracedef.h>
+
+/**
+This defines trace attributes to be used by file-system tracing
+
+*/
+namespace UTraceModuleFileSys
+    {
+
+	/** 
+	@SYMTraceFormatCategory EF32TraceUidFileSys 
+    @SYMTraceFormatId
+    */
+    enum TFormatId
+        {
+		EReserved = UTF::KInitialClientFormat-1,
+
+        /** @SYMTraceFormatString "+CFileSystem::CFileSystem()" */
+		ECFileSystemConstructor,
+        /** @SYMTraceFormatString "-CFileSystem::CFileSystem()" */
+        ECFileSystemConstructorReturn,
+
+        /** @SYMTraceFormatString "+~CFileSystem::CFileSystem()" */
+		ECFileSystemDestructor,
+        /** @SYMTraceFormatString "-~CFileSystem::CFileSystem()" */
+        ECFileSystemDestructorReturn,
+
+        /** @SYMTraceFormatString "+CFileSystem::New() handle %x" */
+		ECFileSystemNew,
+        /** @SYMTraceFormatString "-CFileSystem::New() fileSystem %x" */
+        ECFileSystemNewRet,
+
+        /** @SYMTraceFormatString "+CFileSystem::Remove() this %x" */
+		ECFileSystemRemove,
+        /** @SYMTraceFormatString "-CFileSystem::Remove()" */
+        ECFileSystemRemoveRet,
+
+        /** @SYMTraceFormatString "CFileSystem::IsExtensionSupported() this %x r %d" */
+		ECFileSystemIsExtensionSupported,
+
+		/** @SYMTraceFormatString "+CFileSystem::Install() this %x" */
+		ECFileSystemInstall,
+        /** @SYMTraceFormatString "-CFileSystem::Install() r %d Name %*S" */
+        ECFileSystemInstallRet,
+
+		/** @SYMTraceFormatString "+CFileSystem::NewMountL() this %x drive %d" */
+		ECFileSystemNewMountL,
+        /** @SYMTraceFormatString "-CFileSystem::NewMountL() r %d CMountCB %x" */
+        ECFileSystemNewMountLRet,
+
+		/** @SYMTraceFormatString "+CFileSystem::NewFileL() this %x drive %d" */
+		ECFileSystemNewFileL,
+        /** @SYMTraceFormatString "-CFileSystem::NewFileL() r %d CFileCB %x" */
+        ECFileSystemNewFileLRet,
+
+		/** @SYMTraceFormatString "+CFileSystem::NewDirL() this %x drive %d" */
+		ECFileSystemNewDirL,
+        /** @SYMTraceFormatString "-CFileSystem::NewDirL() r %d CDirCB %x" */
+        ECFileSystemNewDirLRet,
+
+		/** @SYMTraceFormatString "+CFileSystem::NewFormatL() this %x drive %d" */
+		ECFileSystemNewFormatL,
+        /** @SYMTraceFormatString "-CFileSystem::NewFormatL() r %d CFormatCB %x" */
+        ECFileSystemNewFormatLRet,
+
+		/** @SYMTraceFormatString "+CFileSystem::DriveInfo() this %x aDriveNumber %d" */
+		ECFileSystemDriveInfo,
+        /** @SYMTraceFormatString "-CFileSystem::DriveInfo() type %d driveAtt %x mediaAtt %x" */
+        ECFileSystemDriveInfoRet,
+
+
+        
+		/** @SYMTraceFormatString "+CMountCB::ReMount() drive %d" */
+		ECMountCBReMount,
+        /** @SYMTraceFormatString "-CMountCB::ReMount() success %d" */
+        ECMountCBReMountRet,
+
+		/** @SYMTraceFormatString "+CMountCB::Dismounted() drive %d" */
+		ECMountCBDismounted,
+        /** @SYMTraceFormatString "-CMountCB::Dismounted()" */
+        ECMountCBDismountedRet,
+
+
+		/** @SYMTraceFormatString "+CMountCB::VolumeL() drive %d" */
+		ECMountCBVolumeL,
+        /** @SYMTraceFormatString "-CMountCB::VolumeL() r %d iUniqueID %x iSize %ld iFree %ld iFileCacheFlags %x" */
+        ECMountCBVolumeLRet,
+
+		/** @SYMTraceFormatString "+CMountCB::SetVolumeL() drive %d aName %*S" */
+		ECMountCBSetVolumeL,
+        /** @SYMTraceFormatString "-CMountCB::SetVolumeL() r %d" */
+        ECMountCBSetVolumeLRet,
+
+		/** @SYMTraceFormatString "+CMountCB::MkDirL() drive %d aName %*S" */
+		ECMountCBMkDirL,
+        /** @SYMTraceFormatString "-CMountCB::MkDirL() r %d" */
+        ECMountCBMkDirLRet,
+
+		/** @SYMTraceFormatString "+CMountCB::RmDirL() drive %d aName %*S" */
+		ECMountCBRmDirL,
+        /** @SYMTraceFormatString "-CMountCB::RmDirL() r %d" */
+        ECMountCBRmDirLRet,
+
+		/** @SYMTraceFormatString "+CMountCB::DeleteL() drive %d aName %*S" */
+		ECMountCBDeleteL,
+        /** @SYMTraceFormatString "-CMountCB::DeleteL() r %d" */
+        ECMountCBDeleteLRet,
+
+		/** @SYMTraceFormatString "+CMountCB::RenameL() drive %d anOldName %*S anNewName *S" */
+		ECMountCBRenameL,
+        /** @SYMTraceFormatString "-CMountCB::RenameL() r %d" */
+        ECMountCBRenameLRet,
+
+		/** @SYMTraceFormatString "+CMountCB::ReplaceL() drive %d anOldName %*S anNewName *S" */
+		ECMountCBReplaceL,
+        /** @SYMTraceFormatString "-CMountCB::ReplaceL() r %d" */
+        ECMountCBReplaceLRet,
+
+		/** @SYMTraceFormatString "+CMountCB::EntryL() drive %d aName %*S" */
+		ECMountCBEntryL,
+        /** @SYMTraceFormatString "-CMountCB::EntryL() r %d att %x modified %lx size %d" */
+        ECMountCBEntryLRet,
+
+		/** @SYMTraceFormatString "+CMountCB::SetEntryL() drive %d aName %*S aTime %lx aSetAttMask %x aClearAttMask %x" */
+		ECMountCBSetEntryL,
+        /** @SYMTraceFormatString "-CMountCB::SetEntryL() r %d" */
+        ECMountCBSetEntryLRet,
+
+        /** @SYMTraceFormatString "+CMountCB::FileOpenL() drive %d aName %*S aMode %x anOpen %d aFile %x" */
+		ECMountCBFileOpenL,
+        /** @SYMTraceFormatString "-CMountCB::FileOpenL() r %d" */
+        ECMountCBFileOpenLRet,
+
+        /** @SYMTraceFormatString "+CMountCB::DirOpenL() drive %d aName %*S aDir %x" */
+		ECMountCBDirOpenL,
+        /** @SYMTraceFormatString "-CMountCB::DirOpenL() r %d" */
+        ECMountCBDirOpenLRet,
+
+		/** @SYMTraceFormatString "+CMountCB::RawReadL() drive %d aPos %ld aLength %d aTrg %x anOffset %x threadId %x" */
+		ECMountCBRawReadL,
+        /** @SYMTraceFormatString "-CMountCB::RawReadL() r %d" */
+        ECMountCBRawReadLRet,
+
+		/** @SYMTraceFormatString "+CMountCB::RawWriteL() drive %d aPos %ld aLength %d aTrg %x anOffset %x threadId %x" */
+		ECMountCBRawWriteL,
+        /** @SYMTraceFormatString "-CMountCB::RawWriteL() r %d" */
+        ECMountCBRawWriteLRet,
+
+		/** @SYMTraceFormatString "+CMountCB::GetShortNameL() drive %d aLongName %*S" */
+		ECMountCBGetShortNameL,
+        /** @SYMTraceFormatString "-CMountCB::GetShortNameL() r %d aShortName %*S" */
+        ECMountCBGetShortNameLRet,
+
+		/** @SYMTraceFormatString "+CMountCB::GetLongNameL() drive %d aShortName %*S" */
+		ECMountCBGetLongNameL,
+        /** @SYMTraceFormatString "-CMountCB::GetLongNameL() r %d aLongName %*S" */
+        ECMountCBGetLongNameLRet,
+
+		/** @SYMTraceFormatString "+CMountCB::ReadFileSectionL() drive %d aName %*S aPos %ld aTrg %x aLength %d threadId %x" */
+		ECMountCBReadFileSectionL,
+        /** @SYMTraceFormatString "-CMountCB::ReadFileSectionL() r %d" */
+        ECMountCBReadFileSectionLRet,
+
+		/** @SYMTraceFormatString "+CMountCB::CheckDisk1() drive %d" */
+		ECMountCBCheckDisk1,
+        /** @SYMTraceFormatString "-CMountCB::CheckDisk1() r %d" */
+        ECMountCBCheckDisk1Ret,
+
+		/** @SYMTraceFormatString "+CMountCB::CheckDisk2() drive %d aOperation %d aParam1 %x aParam2 %x" */
+		ECMountCBCheckDisk2,
+        /** @SYMTraceFormatString "-CMountCB::CheckDisk2() r %d" */
+        ECMountCBCheckDisk2Ret,
+
+		/** @SYMTraceFormatString "+CMountCB::ScanDrive1() drive %d" */
+		ECMountCBScanDrive1,
+        /** @SYMTraceFormatString "-CMountCB::ScanDrive1() r %d" */
+        ECMountCBScanDrive1Ret,
+
+		/** @SYMTraceFormatString "+CMountCB::ScanDrive2() drive %d aOperation %d aParam1 %x aParam2 %x" */
+		ECMountCBScanDrive2,
+        /** @SYMTraceFormatString "-CMountCB::ScanDrive2() r %d" */
+        ECMountCBScanDrive2Ret,
+
+		/** @SYMTraceFormatString "+CMountCB::ControlIO() drive %d aCommand %d aParam1 %x aParam2 %x threadId %x" */
+		ECMountCBControlIO,
+        /** @SYMTraceFormatString "-CMountCB::ControlIO() r %d" */
+        ECMountCBControlIORet,
+
+		/** @SYMTraceFormatString "+CMountCB::Lock() drive %d aStore %d" */
+		ECMountCBLock,
+        /** @SYMTraceFormatString "-CMountCB::Lock() r %d" */
+        ECMountCBLockRet,
+
+		/** @SYMTraceFormatString "+CMountCB::Unlock() drive %d aStore %d" */
+		ECMountCBUnlock,
+        /** @SYMTraceFormatString "-CMountCB::Unlock() r %d" */
+        ECMountCBUnlockRet,
+
+		/** @SYMTraceFormatString "+CMountCB::ClearPassword() drive %d" */
+		ECMountCBClearPassword,
+        /** @SYMTraceFormatString "-CMountCB::ClearPassword() r %d" */
+        ECMountCBClearPasswordRet,
+
+		/** @SYMTraceFormatString "+CMountCB::ForceRemountDrive() drive %d aMountInfo %x aMountInfoMessageHandle %x aFlags %x" */
+		ECMountCBForceRemountDrive,
+        /** @SYMTraceFormatString "-CMountCB::ForceRemountDrive() r %d" */
+        ECMountCBForceRemountDriveRet,
+
+		/** @SYMTraceFormatString "+CMountCB::FinaliseMount1() drive %d" */
+		ECMountCBFinaliseMount1,
+        /** @SYMTraceFormatString "-CMountCB::FinaliseMount1() r %d" */
+        ECMountCBFinaliseMount1Ret,
+
+		/** @SYMTraceFormatString "+CMountCB::FinaliseMount2() drive %d" */
+		ECMountCBFinaliseMount2,
+        /** @SYMTraceFormatString "-CMountCB::FinaliseMount2() r %d" */
+        ECMountCBFinaliseMount2Ret,
+
+		/** @SYMTraceFormatString "+CMountCB::MountControl() drive %d aLevel %d aOption %x aParam %x" */
+		ECMountCBMountControl,
+        /** @SYMTraceFormatString "-CMountCB::MountControl() r %d" */
+        ECMountCBMountControlRet,
+
+		/** @SYMTraceFormatString "+CMountCB::ESQ_RequestFreeSpace() drive %d" */
+		ECMountCBFreeSpace,
+        /** @SYMTraceFormatString "-CMountCB::ESQ_RequestFreeSpace() r %d FreeSpace %ld" */
+        ECMountCBFreeSpaceRet,
+
+		/** @SYMTraceFormatString "+CMountCB::ESQ_GetCurrentFreeSpace() drive %d" */
+		ECMountCBCurrentFreeSpace,
+        /** @SYMTraceFormatString "-CMountCB::ESQ_GetCurrentFreeSpace() r %d FreeSpace %ld" */
+        ECMountCBCurrentFreeSpaceRet,
+
+		/** @SYMTraceFormatString "+CMountCB::ESQ_MountedVolumeSize() drive %d" */
+		ECMountCBVolumeSize,
+        /** @SYMTraceFormatString "-CMountCB::ESQ_MountedVolumeSize() r %d size %ld" */
+        ECMountCBVolumeSizeRet,
+
+		/** @SYMTraceFormatString "+CMountCB::ErasePassword() drive %d" */
+		ECMountCBErasePassword,
+        /** @SYMTraceFormatString "-CMountCB::ErasePassword() r %d" */
+        ECMountCBErasePasswordRet,
+
+		/** @SYMTraceFormatString "+CMountCB::GetInterface() drive %d aInterfaceId %d aInput %x" */
+		ECMountCBGetInterface,
+        /** @SYMTraceFormatString "-CMountCB::GetInterface() r %d aInterface %x" */
+        ECMountCBGetInterfaceRet,
+
+		/** @SYMTraceFormatString "+CFileCB::RenameL() this %x aNewName %*S" */
+		ECFileCBRenameL,
+        /** @SYMTraceFormatString "-CFileCB::RenameL() r %d" */
+        ECFileCBRenameLRet,
+
+		/** @SYMTraceFormatString "+CFileCB::ReadL() this %x aPos %ld aLength %d aDes %x threadId %x aOffset %x" */
+		ECFileCBReadL,
+        /** @SYMTraceFormatString "-CFileCB::ReadL() r %d" */
+        ECFileCBReadLRet,
+
+		/** @SYMTraceFormatString "+CFileCB::WriteL() this %x aPos %ld aLength %d aDes %x threadId %x aOffset %x" */
+		ECFileCBWriteL,
+        /** @SYMTraceFormatString "-CFileCB::WriteL() r %d" */
+        ECFileCBWriteLRet,
+
+		/** @SYMTraceFormatString "+CFileCB::SetSizeL() this %x aSize %ld" */
+		ECFileCBSetSizeL,
+        /** @SYMTraceFormatString "-CFileCB::SetSizeL() r %d" */
+        ECFileCBSetSizeLRet,
+
+		/** @SYMTraceFormatString "+CFileCB::SetEntryL() this %x aTime %lx aSetAttMask %x aClearAttMask %x" */
+		ECFileCBSetEntryL,
+        /** @SYMTraceFormatString "-CFileCB::SetEntryL() r %d" */
+        ECFileCBSetEntryLRet,
+
+		/** @SYMTraceFormatString "+CFileCB::FlushDataL() this %x" */
+		ECFileCBFlushDataL,
+        /** @SYMTraceFormatString "-CFileCB::FlushDataL() r %d" */
+        ECFileCBFlushDataLRet,
+
+		/** @SYMTraceFormatString "+CFileCB::GetInterface() aInterfaceId %d aInput %x" */
+		ECFileCBGetInterface,
+        /** @SYMTraceFormatString "-CFileCB::GetInterface() r %d aInterface %x" */
+        ECFileCBGetInterfaceRet,
+
+
+		/** @SYMTraceFormatString "+CDirCB::ReadL() this %x" */
+		ECDirCBReadL,
+        /** @SYMTraceFormatString "-CDirCB::ReadL() r %d att %x modified %lx size %d" */
+        ECDirCBReadLRet,
+
+		/** @SYMTraceFormatString "+CDirCB::StoreLongEntryNameL() this %x" */
+		ECDirCBStoreLongEntryNameL,
+        /** @SYMTraceFormatString "-CDirCB::StoreLongEntryNameL() r %d" */
+        ECDirCBStoreLongEntryNameLRet,
+
+
+		/** @SYMTraceFormatString "+CFormatCB::DoFormatStepL() this %x" */
+		ECFormatCBDoFormatStepL,
+        /** @SYMTraceFormatString "-CFormatCB::DoFormatStepL() r %d  iCurrentStep %d" */
+        ECFormatCBDoFormatStepLRet,
+
+
+
+
+
+        /**
+        Provided to allow the following compile time assert.
+        */
+        EFormatIdHighWaterMark,
+        };
+    __ASSERT_COMPILE(EFormatIdHighWaterMark <= (UTF::KMaxFormatId + 1));
+	}
+
+namespace UTraceModuleProxyDrive
+    {
+	/** 
+	@SYMTraceFormatCategory EF32TraceUidProxyDrive 
+    @SYMTraceFormatId
+    */
+    enum TFormatId
+        {
+		EReserved = UTF::KInitialClientFormat-1,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::New() aMount %x drive %d" */
+		ECLocalProxyDriveNew,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::New() proxyDrive %x" */
+        ECLocalProxyDriveNewRet,
+
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::Initialise() this %x" */
+		ECBaseExtProxyDriveInitialise,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::Initialise() r %d" */
+        ECBaseExtProxyDriveInitialiseRet,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::Initialise() this %x" */
+		ECLocalProxyDriveInitialise,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::Initialise() r %d" */
+        ECLocalProxyDriveInitialiseRet,
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::ControlIO() this %x" */
+		ECBaseExtProxyDriveControlIO,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::ControlIO() r %d" */
+        ECBaseExtProxyDriveControlIORet,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::ControlIO() this %x" */
+		ECLocalProxyDriveControlIO,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::ControlIO() r %d" */
+        ECLocalProxyDriveControlIORet,
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::Read1() this %x aPos %ld aLength %d aTrg %x threadId %x aOffset %x aFlags %x" */
+		ECBaseExtProxyDriveRead1,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::Read1() r %d" */
+        ECBaseExtProxyDriveRead1Ret,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::Read1() this %x aPos %ld aLength %d aTrg %x threadId %x aOffset %x aFlags %x" */
+		ECLocalProxyDriveRead1,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::Read1() r %d" */
+        ECLocalProxyDriveRead1Ret,
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::Read2() this %x aPos %ld aLength %d aTrg %x threadId %x aOffset %x" */
+		ECBaseExtProxyDriveRead2,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::Read2() r %d" */
+        ECBaseExtProxyDriveRead2Ret,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::Read2() this %x aPos %ld aLength %d aTrg %x threadId %x aOffset %x" */
+		ECLocalProxyDriveRead2,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::Read2() r %d" */
+        ECLocalProxyDriveRead2Ret,
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::Read3() this %x aPos %ld aLength %d aTrg %x" */
+		ECBaseExtProxyDriveRead3,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::Read3() r %d" */
+        ECBaseExtProxyDriveRead3Ret,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::Read3() this %x aPos %ld aLength %d aTrg %x" */
+		ECLocalProxyDriveRead3,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::Read3() r %d" */
+        ECLocalProxyDriveRead3Ret,
+
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::Write1() this %x aPos %ld aLength %d aSrc %x threadId %x aOffset %x aFlags %x" */
+		ECBaseExtProxyDriveWrite1,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::Write1() r %d" */
+        ECBaseExtProxyDriveWrite1Ret,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::Write1() this %x aPos %ld aLength %d aSrc %x threadId %x aOffset %x aFlags %x" */
+		ECLocalProxyDriveWrite1,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::Write1() r %d" */
+        ECLocalProxyDriveWrite1Ret,
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::Write2() this %x aPos %ld aLength %d aSrc %x threadId %x aOffset %x" */
+		ECBaseExtProxyDriveWrite2,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::Write2() r %d" */
+        ECBaseExtProxyDriveWrite2Ret,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::Write2() this %x aPos %ld aLength %d aSrc %x threadId %x aOffset %x" */
+		ECLocalProxyDriveWrite2,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::Write2() r %d" */
+        ECLocalProxyDriveWrite2Ret,
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::Write3() this %x aPos %ld aLength %d aSrc %x" */
+		ECBaseExtProxyDriveWrite3,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::Write3() r %d" */
+        ECBaseExtProxyDriveWrite3Ret,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::Write3() this %x aPos %ld aLength %d aSrc %x" */
+		ECLocalProxyDriveWrite3,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::Write3() r %d" */
+        ECLocalProxyDriveWrite3Ret,
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::Dismounted() this %x" */
+		ECBaseExtProxyDriveDismounted,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::Dismounted() r %d" */
+        ECBaseExtProxyDriveDismountedRet,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::Dismounted() this %x" */
+		ECLocalProxyDriveDismounted,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::Dismounted() r %d" */
+        ECLocalProxyDriveDismountedRet,
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::Enlarge() this %x aLength %d" */
+		ECBaseExtProxyDriveEnlarge,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::Enlarge() r %d" */
+        ECBaseExtProxyDriveEnlargeRet,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::Enlarge() this %x aLength %d" */
+		ECLocalProxyDriveEnlarge,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::Enlarge() r %d" */
+        ECLocalProxyDriveEnlargeRet,
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::ReduceSize() this %x aPos %d aLength %d" */
+		ECBaseExtProxyDriveReduceSize,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::ReduceSize() r %d" */
+        ECBaseExtProxyDriveReduceSizeRet,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::ReduceSize() this %x aPos %d aLength %d" */
+		ECLocalProxyDriveReduceSize,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::ReduceSize() r %d" */
+        ECLocalProxyDriveReduceSizeRet,
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::Caps() this %x" */
+		ECBaseExtProxyDriveCaps,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::Caps() r %d" */
+        ECBaseExtProxyDriveCapsRet,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::Caps() this %x" */
+		ECLocalProxyDriveCaps,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::Caps() r %d" */
+        ECLocalProxyDriveCapsRet,
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::Format1() this %x" */
+		ECBaseExtProxyDriveFormat1,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::Format1() r %d iFormatIsCurrent %d i512ByteSectorsFormatted %d iMaxBytesPerFormat %d" */
+        ECBaseExtProxyDriveFormat1Ret,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::Format1() this %x" */
+		ECLocalProxyDriveFormat1,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::Format1() r %d iFormatIsCurrent %d i512ByteSectorsFormatted %d iMaxBytesPerFormat %d" */
+        ECLocalProxyDriveFormat1Ret,
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::Format2() this %x aPos %ld aLength %d" */
+		ECBaseExtProxyDriveFormat2,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::Format2() r %d" */
+        ECBaseExtProxyDriveFormat2Ret,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::Format2() this %x aPos %ld aLength %d" */
+		ECLocalProxyDriveFormat2,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::Format2() r %d" */
+        ECLocalProxyDriveFormat2Ret,
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::SetMountInfo() this %x" */
+		ECBaseExtProxyDriveSetMountInfo,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::SetMountInfo() r %d" */
+        ECBaseExtProxyDriveSetMountInfoRet,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::SetMountInfo() this %x" */
+		ECLocalProxyDriveSetMountInfo,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::SetMountInfo() r %d" */
+        ECLocalProxyDriveSetMountInfoRet,
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::ForceRemount() this %x" */
+		ECBaseExtProxyDriveForceRemount,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::ForceRemount() r %d" */
+        ECBaseExtProxyDriveForceRemountRet,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::ForceRemount() this %x" */
+		ECLocalProxyDriveForceRemount,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::ForceRemount() r %d" */
+        ECLocalProxyDriveForceRemountRet,
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::Unlock() this %x aPassword %d" */
+		ECBaseExtProxyDriveUnlock,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::Unlock() r %d" */
+        ECBaseExtProxyDriveUnlockRet,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::Unlock() this %x aPassword %d" */
+		ECLocalProxyDriveUnlock,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::Unlock() r %d" */
+        ECLocalProxyDriveUnlockRet,
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::Lock() this %x aPassword %d" */
+		ECBaseExtProxyDriveLock,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::Lock() r %d" */
+        ECBaseExtProxyDriveLockRet,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::Lock() this %x aPassword %d" */
+		ECLocalProxyDriveLock,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::Lock() r %d" */
+        ECLocalProxyDriveLockRet,
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::Clear() this %x" */
+		ECBaseExtProxyDriveClear,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::Clear() r %d" */
+        ECBaseExtProxyDriveClearRet,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::Clear() this %x" */
+		ECLocalProxyDriveClear,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::Clear() r %d" */
+        ECLocalProxyDriveClearRet,
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::ErasePassword() this %x" */
+		ECBaseExtProxyDriveErasePassword,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::ErasePassword() r %d" */
+        ECBaseExtProxyDriveErasePasswordRet,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::ErasePassword() this %x" */
+		ECLocalProxyDriveErasePassword,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::ErasePassword() r %d" */
+        ECLocalProxyDriveErasePasswordRet,
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::DeleteNotify() this %x aPos %ld aLength %d" */
+		ECBaseExtProxyDriveDeleteNotify,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::DeleteNotify() r %d" */
+        ECBaseExtProxyDriveDeleteNotifyRet,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::DeleteNotify() this %x aPos %ld aLength %d" */
+		ECLocalProxyDriveDeleteNotify,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::DeleteNotify() r %d" */
+        ECLocalProxyDriveDeleteNotifyRet,
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::GetLastErrorInfo() this %x" */
+		ECBaseExtProxyDriveGetLastErrorInfo,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::GetLastErrorInfo() r %d" */
+        ECBaseExtProxyDriveGetLastErrorInfoRet,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::GetLastErrorInfo() this %x" */
+		ECLocalProxyDriveGetLastErrorInfo,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::GetLastErrorInfo() r %d" */
+        ECLocalProxyDriveGetLastErrorInfoRet,
+
+		/** @SYMTraceFormatString "+CBaseExtProxyDrive::GetInterface() this %x aInterfaceId %d aInput %x" */
+		ECBaseExtProxyDriveGetInterface,
+        /** @SYMTraceFormatString "-CBaseExtProxyDrive::GetInterface() r %d aInterface %x" */
+        ECBaseExtProxyDriveGetInterfaceRet,
+
+		/** @SYMTraceFormatString "+CLocalProxyDrive::GetInterface() this %x aInterfaceId %d aInput %x" */
+		ECLocalProxyDriveGetInterface,
+        /** @SYMTraceFormatString "-CLocalProxyDrive::GetInterface() r %d aInterface %x" */
+        ECLocalProxyDriveGetInterfaceRet,
+
+
+
+
+        /**
+        Provided to allow the following compile time assert.
+        */
+        EFormatIdHighWaterMark,
+        };
+    __ASSERT_COMPILE(EFormatIdHighWaterMark <= (UTF::KMaxFormatId + 1));
+
+
+
+    } // end of namespace UTraceModuleFileSys
+
+	
+#endif // UTRACEEFILE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/fileserver/inc/utraceefsrv.h	Wed Sep 01 12:34:56 2010 +0100
@@ -0,0 +1,995 @@
+
+// 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:
+// File Server client-side tracing
+// 
+//
+
+/**
+ @file
+ @publishedPartner
+ @prototype
+*/
+
+#ifndef UTRACEEFSRV_H
+#define UTRACEEFSRV_H
+
+
+#include <f32tracedef.h>
+
+#define MODULEUID EF32TraceUidEfsrv
+
+
+/**
+This defines trace attributes to be used by trace points within the efsrv.dll executable.
+*/
+namespace UTraceModuleEfsrv
+    {
+
+	/** 
+	@SYMTraceFormatCategory EF32TraceUidEfsrv 
+	*/
+
+
+
+    /**
+    @SYMTraceFormatId
+    */
+    enum TFormatId
+        {
+		EReserved = UTF::KInitialClientFormat-1,
+
+        /** @SYMTraceFormatString "+RFile::Replace() sess %x mode %x FileName %*S" */
+		EFileReplace,
+        /** @SYMTraceFormatString "-RFile::Replace() r %d subs %x" */
+        EFileReplaceReturn,
+
+        /** @SYMTraceFormatString "+RFile::Create() sess %x mode %x FileName %*S" */
+		EFileCreate,
+        /** @SYMTraceFormatString "-RFile::Create() r %d subs %x" */
+        EFileCreateReturn,
+
+        /** @SYMTraceFormatString "+RFile::Open() sess %x mode %x FileName %*S" */
+		EFileOpen,
+        /** @SYMTraceFormatString "-RFile::Open() r %d subs %x" */
+        EFileOpenReturn,
+
+        /** @SYMTraceFormatString "+RFile::Adopt() sess %x subs %x" */
+        EFileAdopt,
+        /** @SYMTraceFormatString "-RFile::Adopt() r %d sess %x subs %x" */
+        EFileAdoptReturn,
+
+        /** @SYMTraceFormatString "+RFile::AdoptFromServer() sess %x subs %x" */
+        EFileAdoptFromServer,
+        /** @SYMTraceFormatString "-RFile::AdoptFromServer() r %d sess %x subs %x" */
+        EFileAdoptFromServerReturn,
+
+        /** @SYMTraceFormatString "+RFile::AdoptFromClient() sess %x subs %x aFsHandleIndex %d aFileHandleIndex %d " */
+        EFileAdoptFromClient,
+        /** @SYMTraceFormatString "-RFile::AdoptFromClient() r %d sess %x subs %x" */
+        EFileAdoptFromClientReturn,
+
+        /** @SYMTraceFormatString "+RFile::AdoptFromCreator() subs %x aFsHandleIndex %d aFileHandleIndex %d" */
+        EFileAdoptFromCreator,
+        /** @SYMTraceFormatString "-RFile::AdoptFromCreator() r %d sess %x subs %x" */
+        EFileAdoptFromCreatorReturn,
+
+        /** @SYMTraceFormatString "+RFile::Duplicate() sess %x subs %x aType %d" */
+        EFileDuplicate,
+        /** @SYMTraceFormatString "-RFile::Duplicate() r %d sess %x subs %x" */
+        EFileDuplicateReturn,
+
+        
+        /** @SYMTraceFormatString "+RFile::TransferToServer() sess %x subs %x aFsHandleIndex %d aFileHandleIndex %d" */
+        EFileTransferToServer,
+        /** @SYMTraceFormatString "-RFile::TransferToServer() r %d" */
+        EFileTransferToServerReturn,
+
+        /** @SYMTraceFormatString "+RFile::TransferToClient() sess %x subs %x aFileHandleIndex %d" */
+        EFileTransferToClient,
+        /** @SYMTraceFormatString "-RFile::TransferToClient() r %d" */
+        EFileTransferToClientReturn,
+
+        /** @SYMTraceFormatString "+RFile::TransferToProcess() sess %x subs %x aFsHandleIndex %d aFileHandleIndex %d" */
+        EFileTransferToProcess,
+        /** @SYMTraceFormatString "-RFile::TransferToProcess() r %d" */
+        EFileTransferToProcessReturn,
+
+		
+		/** @SYMTraceFormatString "+RFile::Name() sess %x subs %x" */
+        EFileName,
+		/** @SYMTraceFormatString "-RFile::Name() r %d aName %*S" */
+        EFileNameReturn,
+
+		/** @SYMTraceFormatString "+RFile::FullName() sess %x subs %x" */
+        EFileFullName,
+		/** @SYMTraceFormatString "-RFile::FullName() r %d aName %*S" */
+        EFileFullNameReturn,
+
+		
+		
+		/** @SYMTraceFormatString "+RFile::Temp() sess %x aPath %*S aMode %x" */
+        EFileTemp,
+        /** @SYMTraceFormatString "-RFile::Temp() r %d subs %x aName %*S" */
+        EFileTempReturn,
+
+
+        /** @SYMTraceFormatString "+RFile::Write1() sess %x subs %x len %d" */
+        EFileWrite1,
+		/** @SYMTraceFormatString "-RFile::Write1() r %d" */
+        EFileWrite1Return,
+		
+        /** @SYMTraceFormatString "+RFile::Write2() sess %x subs %x len %d status %x" */
+        EFileWrite2,
+		/** @SYMTraceFormatString "-RFile::Write2()" */
+        EFileWrite2Return,
+		
+        /** @SYMTraceFormatString "+RFile::Write3() sess %x subs %x pos %ld len %d" */
+        EFileWrite3,
+		/** @SYMTraceFormatString "-RFile::Write3() r %d" */
+        EFileWrite3Return,
+		
+        /** @SYMTraceFormatString "+RFile::Write4() sess %x subs %x pos %ld len %d status %x" */
+        EFileWrite4,
+		/** @SYMTraceFormatString "-RFile::Write4()" */
+        EFileWrite4Return,
+		
+
+
+
+        /** @SYMTraceFormatString "+RFile::Read1() sess %x subs %x maxlen %d" */
+        EFileRead1,
+		/** @SYMTraceFormatString "-RFile::Read1() r %d len %d" */
+        EFileRead1Return,
+
+        /** @SYMTraceFormatString "+RFile::Read2() sess %x subs %x maxlen %d status %x" */
+        EFileRead2,
+		/** @SYMTraceFormatString "-RFile::Read2()" */
+        EFileRead2Return,
+
+        /** @SYMTraceFormatString "+RFile::Read3() sess %x subs %x aPos %ld maxlen %d" */
+        EFileRead3,
+		/** @SYMTraceFormatString "-RFile::Read3() r %d len %d" */
+        EFileRead3Return,
+
+        /** @SYMTraceFormatString "+RFile::Read4() sess %x subs %x aPos %ld maxlen %d status %x" */
+        EFileRead4,
+		/** @SYMTraceFormatString "-RFile::Read4()" */
+        EFileRead4Return,
+
+
+
+
+
+		/** @SYMTraceFormatString "+RFile::Lock() sess %x subs %x aPos %ld aLength %d" */
+        EFileLock,
+        /** @SYMTraceFormatString "-RFile::Lock() r %d" */
+        EFileLockReturn,
+
+		/** @SYMTraceFormatString "+RFile::UnLock() sess %x subs %x aPos %ld aLength %d" */
+        EFileUnLock,
+        /** @SYMTraceFormatString "-RFile::UnLock() r %d" */
+        EFileUnLockReturn,
+
+		/** @SYMTraceFormatString "+RFile::Seek() sess %x subs %x aMode %x aPos %ld" */
+        EFileSeek,
+        /** @SYMTraceFormatString "-RFile::Seek() r %d" */
+        EFileSeekReturn,
+
+		/** @SYMTraceFormatString "+RFile::Flush() sess %x subs %x status %x" */
+        EFileFlush,
+        /** @SYMTraceFormatString "-RFile::Flush() r %d" */
+        EFileFlushReturn,
+
+		/** @SYMTraceFormatString "+RFile::Size1() sess %x subs %x" */
+        EFileSize,
+        /** @SYMTraceFormatString "-RFile::Size1() r %d aSize %d" */
+        EFileSizeReturn,
+
+		/** @SYMTraceFormatString "+RFile::Size2() sess %x subs %x" */
+        EFileSize2,
+        /** @SYMTraceFormatString "-RFile::Size2() r %d aSize %ld" */
+        EFileSize2Return,
+
+		/** @SYMTraceFormatString "+RFile::SetSize() sess %x subs %x aSize %ld" */
+        EFileSetSize,
+        /** @SYMTraceFormatString "-RFile::SetSize() r %d" */
+        EFileSetSizeReturn,
+
+		/** @SYMTraceFormatString "+RFile::Att() sess %x subs %x" */
+        EFileAtt,
+        /** @SYMTraceFormatString "-RFile::Att() r %d aVal %x" */
+        EFileAttReturn,
+
+		/** @SYMTraceFormatString "+RFile::SetAtt() sess %x subs %x aSetAttMask %x aClearAttMask %x" */
+        EFileSetAtt,
+        /** @SYMTraceFormatString "-RFile::SetAtt() r %d" */
+        EFileSetAttReturn,
+
+		/** @SYMTraceFormatString "+RFile::Modified() sess %x subs %x" */
+        EFileModified,
+        /** @SYMTraceFormatString "-RFile::Modified() r %d aTime %lx" */
+        EFileModifiedReturn,
+
+		/** @SYMTraceFormatString "+RFile::SetModified() sess %x subs %x aTime %lx" */
+        EFileSetModified,
+        /** @SYMTraceFormatString "-RFile::SetModified() r %d" */
+        EFileSetModifiedReturn,
+
+		/** @SYMTraceFormatString "+RFile::Set() sess %x subs %x aTime %lx aSetAttMask %x aClearAttMask %x" */
+        EFileSet,
+        /** @SYMTraceFormatString "-RFile::Set() r %d" */
+        EFileSetReturn,
+
+		/** @SYMTraceFormatString "+RFile::ChangeMode() sess %x subs %x aNewMode %x" */
+        EFileChangeMode,
+        /** @SYMTraceFormatString "-RFile::ChangeMode() r %d" */
+        EFileChangeModeReturn,
+
+		/** @SYMTraceFormatString "+RFile::Rename() sess %x subs %x aNewName %*S" */
+        EFileRename,
+        /** @SYMTraceFormatString "-RFile::Rename() r %d" */
+        EFileRenameReturn,
+
+		/** @SYMTraceFormatString "+RFile::Drive() sess %x subs %x" */
+        EFileDrive,
+        /** @SYMTraceFormatString "-RFile::Drive() r %d driveAtt %x mediaAtt %x type %x" */
+        EFileDriveReturn,
+
+		/** @SYMTraceFormatString "+RFile::Clamp() sess %x subs %x" */
+        EFileClamp,
+        /** @SYMTraceFormatString "-RFile::Clamp() r %d" */
+        EFileClampReturn,
+
+		/** @SYMTraceFormatString "+RFile::BlockMap() sess %x subs %x aStartPos %ld aEndPos %ld aBlockMapusage %d" */
+        EFileBlockMap,
+        /** @SYMTraceFormatString "-RFile::BlockMap() r %d" */
+        EFileBlockMapReturn,
+
+		/** @SYMTraceFormatString "+RFile::Close() sess %x subs %x" */
+        EFileClose,
+        /** @SYMTraceFormatString "-RFile::Close()" */
+        EFileCloseReturn,
+
+
+
+		/** @SYMTraceFormatString "+RFS::DriveToChar() aDrive %d" */
+		EFsDriveToChar,
+		/** @SYMTraceFormatString "-RFs::DriveToChar() r %d aChar %c" */
+		EFsDriveToCharReturn,
+		/** @SYMTraceFormatString "+RFs::IsRomAddress() aPtr %x" */
+		EFsIsRomAddress,
+		/** @SYMTraceFormatString "-RFS::IsRomAddress() r %d" */
+		EFsIsRomAddressReturn,
+		/** @SYMTraceFormatString "+RFs::GetSystemDrive()" */
+		EFsGetSystemDrive,
+		/** @SYMTraceFormatString "-RFs::GetSystemDrive() r %d" */
+		EFsGetSystemDriveReturn,
+		/** @SYMTraceFormatString "+RFs::GetSystemDriveChar()" */
+		EFsGetSystemDriveChar,
+		/** @SYMTraceFormatString "-RFs::GetSystemDriveChar() r %c" */
+		EFsGetSystemDriveCharReturn,
+		/** @SYMTraceFormatString "+RFs::SetSystemDrive() sess %x" */
+		EFsSetSystemDrive,
+		/** @SYMTraceFormatString "-RFs::SetSystemDrive() r %d" */
+		EFsSetSystemDriveReturn,
+		/** @SYMTraceFormatString "+RFs::Connect()" */
+		EFsConnect,
+		/** @SYMTraceFormatString "-RFs::Connect() r %d sess %x" */
+		EFsConnectReturn,
+		/** @SYMTraceFormatString "+RFs::SetSessionToPrivate() sess %x" */
+		EFsSetSessionToPrivate,
+		/** @SYMTraceFormatString "-RFs::SetSessionToPrivate() r %d" */
+		EFsSetSessionToPrivateReturn,
+		/** @SYMTraceFormatString "+RFs::PrivatePath() sess %x" */
+		EFsPrivatePath,
+		/** @SYMTraceFormatString "-RFs::PrivatePath() r %d aPath %*S" */
+		EFsPrivatePathReturn,
+		/** @SYMTraceFormatString "+RFs::CreatePrivatePath() sess %x aDrive %d" */
+		EFsCreatePrivatePath,
+		/** @SYMTraceFormatString "-RFs::CreatePrivatePath() r %d" */
+		EFsCreatePrivatePathReturn,
+		/** @SYMTraceFormatString "+RFs::Version() sess %x" */
+		EFsVersion,
+		/** @SYMTraceFormatString "-RFs::Version() iMajor %d iMinor %d iBuild %d" */
+		EFsVersionReturn,
+		/** @SYMTraceFormatString "+RFs::AddFileSystem() sess %x aFileName %*S" */
+		EFsAddFileSystem,
+		/** @SYMTraceFormatString "-RFs::AddFileSystem() r %d" */
+		EFsAddFileSystemReturn,
+		/** @SYMTraceFormatString "+RFs::RemoveFileSystem() sess %x aFileName %*S" */
+		EFsRemoveFileSystem,
+		/** @SYMTraceFormatString "-RFs::RemoveFileSystem() r %d" */
+		EFsRemoveFileSystemReturn,
+		/** @SYMTraceFormatString "+RFs::MountFileSystem1() sess %x aFileSystemName %*S aDrive %d" */
+		EFsMountFileSystem1,
+		/** @SYMTraceFormatString "-RFs::MountFileSystem1() r %d" */
+		EFsMountFileSystem1Return,
+		/** @SYMTraceFormatString "+RFs::MountFileSystem2() sess %x aFileSystemName %*S aDrive %d aIsSync %d" */
+		EFsMountFileSystem2,
+		/** @SYMTraceFormatString "-RFs::MountFileSystem2() r %d" */
+		EFsMountFileSystem2Return,
+		/** @SYMTraceFormatString "+RFs::MountFileSystem3() sess %x aFileSystemName %*S aExtensionName %*S aDrive %d" */
+		EFsMountFileSystem3,
+		/** @SYMTraceFormatString "-RFs::MountFileSystem3() r %d" */
+		EFsMountFileSystem3Return,
+		/** @SYMTraceFormatString "+RFs::MountFileSystem4() sess %x aFileSystemName %*S aExtensionName %*S aDrive %d aIsSync %d" */
+		EFsMountFileSystem4,
+		/** @SYMTraceFormatString "-RFs::MountFileSystem4() r %d" */
+		EFsMountFileSystem4Return,
+		/** @SYMTraceFormatString "+RFs::MountFileSystemAndScan1() sess %x aFileSystemName %*S aDrive %d" */
+		EFsMountFileSystemAndScan1,
+		/** @SYMTraceFormatString "-RFs::MountFileSystemAndScan1() r %d" */
+		EFsMountFileSystemAndScan1Return,
+		/** @SYMTraceFormatString "+RFs::MountFileSystemAndScan2() sess %x aFileSystemName %*S aExtensionName %*S aDrive %d " */
+		EFsMountFileSystemAndScan2,
+		/** @SYMTraceFormatString "-RFs::MountFileSystemAndScan2() r %d aIsMountSuccess %d" */
+		EFsMountFileSystemAndScan2Return,
+		/** @SYMTraceFormatString "+RFs::DismountFileSystem() sess %x aFileSystemName %*S aDrive %d" */
+		EFsDismountFileSystem,
+		/** @SYMTraceFormatString "-RFs::DismountFileSystem() r %d" */
+		EFsDismountFileSystemReturn,
+		/** @SYMTraceFormatString "+RFs::FileSystemName() sess %x aDrive %d" */
+		EFsFileSystemName,
+		/** @SYMTraceFormatString "-RFs::FileSystemName() r %d aName %*S" */
+		EFsFileSystemNameReturn,
+		/** @SYMTraceFormatString "+RFs::AddExtension() sess %x aFileName %*S" */
+		EFsAddExtension,
+		/** @SYMTraceFormatString "-RFs::AddExtension() r %d" */
+		EFsAddExtensionReturn,
+		/** @SYMTraceFormatString "+RFs::MountExtension() sess %x aExtensionName %*S aDrive %d" */
+		EFsMountExtension,
+		/** @SYMTraceFormatString "-RFs::MountExtension() r %d" */
+		EFsMountExtensionReturn,
+		/** @SYMTraceFormatString "+RFs::DismountExtension() sess %x aExtensionName %*S aDrive %d" */
+		EFsDismountExtension,
+		/** @SYMTraceFormatString "-RFs::DismountExtension() r %d" */
+		EFsDismountExtensionReturn,
+		/** @SYMTraceFormatString "+RFs::RemoveExtension() sess %x aExtensionName %*S" */
+		EFsRemoveExtension,
+		/** @SYMTraceFormatString "-RFs::RemoveExtension() r %d" */
+		EFsRemoveExtensionReturn,
+		/** @SYMTraceFormatString "+RFs::ExtensionName() sess %x aExtensionName %*S aDrive %d aPos %d" */
+		EFsExtensionName,
+		/** @SYMTraceFormatString "-RFs::ExtensionName() r %d" */
+		EFsExtensionNameReturn,
+		/** @SYMTraceFormatString "+RFs::RemountDrive() sess %x aDrive %d aMountInfo %x aFlags %x" */
+		EFsRemountDrive,
+		/** @SYMTraceFormatString "-RFs::RemountDrive() r %d" */
+		EFsRemountDriveReturn,
+		/** @SYMTraceFormatString "+RFs::NotifyChange1() sess %x aType %x status %x" */
+		EFsNotifyChange1,
+		/** @SYMTraceFormatString "-RFs::NotifyChange1() r %d" */
+		EFsNotifyChange1Return,
+		/** @SYMTraceFormatString "+RFs::NotifyChange2() sess %x aType %x status %x aPathName %*S" */
+		EFsNotifyChange2,
+		/** @SYMTraceFormatString "-RFs::NotifyChange2() r %d" */
+		EFsNotifyChange2Return,
+		/** @SYMTraceFormatString "+RFs::NotifyChangeCancel1() sess %x" */
+		EFsNotifyChangeCancel1,
+		/** @SYMTraceFormatString "-RFs::NotifyChangeCancel1() r %d" */
+		EFsNotifyChangeCancel1Return,
+		/** @SYMTraceFormatString "+RFs::NotifyChangeCancel2() sess %x status %x" */
+		EFsNotifyChangeCancel2,
+		/** @SYMTraceFormatString "-RFs::NotifyChangeCancel2() r %d" */
+		EFsNotifyChangeCancel2Return,
+		/** @SYMTraceFormatString "+RFs::NotifyDiskSpace() sess %x aThreshold %ld aDrive %d status %x" */
+		EFsNotifyDiskSpace,
+		/** @SYMTraceFormatString "-RFs::NotifyDiskSpace() r %d" */
+		EFsNotifyDiskSpaceReturn,
+		/** @SYMTraceFormatString "+RFs::NotifyDiskSpaceCancel1() sess %x status %x" */
+		EFsNotifyDiskSpaceCancel1,
+		/** @SYMTraceFormatString "-RFs::NotifyDiskSpaceCancel1() r %d" */
+		EFsNotifyDiskSpaceCancel1Return,
+		/** @SYMTraceFormatString "+RFs::NotifyDiskSpaceCancel2() sess %x" */
+		EFsNotifyDiskSpaceCancel2,
+		/** @SYMTraceFormatString "-RFs::NotifyDiskSpaceCancel2() r %d" */
+		EFsNotifyDiskSpaceCancel2Return,
+		/** @SYMTraceFormatString "+RFs::DriveList1() sess %x" */
+		EFsDriveList1,
+		/** @SYMTraceFormatString "-RFs::DriveList1() r %d" */
+		EFsDriveList1Return,
+		/** @SYMTraceFormatString "+RFs::DriveList2() sess %x aFlags %x" */
+		EFsDriveList2,
+		/** @SYMTraceFormatString "-RFs::DriveList2() r %d" */
+		EFsDriveList2Return,
+		/** @SYMTraceFormatString "+RFs::Drive() sess %x aDrive %d" */
+		EFsDrive,
+		/** @SYMTraceFormatString "-RFs::Drive() r %d driveAtt %x mediaAtt %x type %x" */
+		EFsDriveReturn,
+		/** @SYMTraceFormatString "+RFs::Volume1() sess %x aDrive %d" */
+		EFsVolume1,
+		/** @SYMTraceFormatString "-RFs::Volume1() r %d iUniqueID %x iSize %ld iFree %ld iFileCacheFlags %x" */
+		EFsVolume1Return,
+		/** @SYMTraceFormatString "+RFs::Volume2() sess %x aDrive %d status %x" */
+		EFsVolume2,
+		/** @SYMTraceFormatString "-RFs::Volume2() r %d" */
+		EFsVolume2Return,
+		/** @SYMTraceFormatString "+RFs::SetVolumeLabel() sess %x aName %*S aDrive %d" */
+		EFsSetVolumeLabel,
+		/** @SYMTraceFormatString "-RFs::SetVolumeLabel() r %d" */
+		EFsSetVolumeLabelReturn,
+		/** @SYMTraceFormatString "+RFs::Subst() sess %x aPath %*S aDrive %d" */
+		EFsSubst,
+		/** @SYMTraceFormatString "-RFs::Subst() r %d" */
+		EFsSubstReturn,
+		/** @SYMTraceFormatString "+RFs::SetSubst() sess %x aPath %%S aDrive %d" */
+		EFsSetSubst,
+		/** @SYMTraceFormatString "-RFs::SetSubst() r %d" */
+		EFsSetSubstReturn,
+		/** @SYMTraceFormatString "+RFs::RealName() sess %x aName %*S" */
+		EFsRealName,
+		/** @SYMTraceFormatString "-RFs::RealName() r %d aResult %*S" */
+		EFsRealNameReturn,
+		/** @SYMTraceFormatString "+RFs::GetMediaSerialNumber() sess %x aDrive %d" */
+		EFsGetMediaSerialNumber,
+		/** @SYMTraceFormatString "-RFs::GetMediaSerialNumber() r %d aSerialNum %*x" */
+		EFsGetMediaSerialNumberReturn,
+		/** @SYMTraceFormatString "+RFs::SessionPath() sess %x" */
+		EFsSessionPath,
+		/** @SYMTraceFormatString "-RFs::SessionPath() r %d aPath %*S" */
+		EFsSessionPathReturn,
+		/** @SYMTraceFormatString "+RFs::SetSessionPath() sess %x aPath %*S" */
+		EFsSetSessionPath,
+		/** @SYMTraceFormatString "-RFs::SetSessionPath() r %d" */
+		EFsSetSessionPathReturn,
+		/** @SYMTraceFormatString "+RFs::MkDir() sess %x aPath %*S" */
+		EFsMkDir,
+		/** @SYMTraceFormatString "-RFs::MkDir() r %d" */
+		EFsMkDirReturn,
+		/** @SYMTraceFormatString "+RFs::MkDirAll() sess %x aPath %*S" */
+		EFsMkDirAll,
+		/** @SYMTraceFormatString "-RFs::MkDirAll() r %d" */
+		EFsMkDirAllReturn,
+		/** @SYMTraceFormatString "+RFs::RmDir() sess %x aPath %*S" */
+		EFsRmDir,
+		/** @SYMTraceFormatString "-RFs::RmDir() r %d" */
+		EFsRmDirReturn,
+		/** @SYMTraceFormatString "+RFs::GetDir1() sess %x aName %*S aUidType0 %x aUidType1 %x aUidType2 %x aKey %x" */
+		EFsGetDir1,
+		/** @SYMTraceFormatString "-RFs::GetDir1() r %d" */
+		EFsGetDir1Return,
+		/** @SYMTraceFormatString "+RFs::GetDir2() sess %x aName %*S anAttMask %x aKey %x" */
+		EFsGetDir2,
+		/** @SYMTraceFormatString "-RFs::GetDir2() r %d" */
+		EFsGetDir2Return,
+		/** @SYMTraceFormatString "+RFs::GetDir3() sess %x aName %*S anAttMask %x aKey %x" */
+		EFsGetDir3,
+		/** @SYMTraceFormatString "-RFs::GetDir3() r %d" */
+		EFsGetDir3Return,
+		/** @SYMTraceFormatString "+RFs::Parse1() sess %x aName %*S" */
+		EFsParse1,
+		/** @SYMTraceFormatString "-RFs::Parse1() r %d" */
+		EFsParse1Return,
+		/** @SYMTraceFormatString "+RFs::Parse2() sess %x aName %*S aRelated %*S" */
+		EFsParse2,
+		/** @SYMTraceFormatString "-RFs::Parse2() r %d" */
+		EFsParse2Return,
+		/** @SYMTraceFormatString "+RFs::Delete() sess %x aName %*S" */
+		EFsDelete,
+		/** @SYMTraceFormatString "-RFs::Delete() r %d" */
+		EFsDeleteReturn,
+		/** @SYMTraceFormatString "+RFs::Rename() sess %x anOldName %*S aNewName %*S" */
+		EFsRename,
+		/** @SYMTraceFormatString "-RFs::Rename() r %d" */
+		EFsRenameReturn,
+		/** @SYMTraceFormatString "+RFs::Replace() sess %x anOldName %*S aNewName %*S" */
+		EFsReplace,
+		/** @SYMTraceFormatString "-RFs::Replace() r %d" */
+		EFsReplaceReturn,
+		/** @SYMTraceFormatString "+RFs::Att() sess %x aName %*S" */
+		EFsAtt,
+		/** @SYMTraceFormatString "-RFs::Att() r %d aVal %x" */
+		EFsAttReturn,
+		/** @SYMTraceFormatString "+RFs::SetAtt() sess %x aName %*S aSetAttMask %x aClearAttMask %x" */
+		EFsSetAtt,
+		/** @SYMTraceFormatString "-RFs::SetAtt() r %d" */
+		EFsSetAttReturn,
+		/** @SYMTraceFormatString "+RFs::Modified() sess %x aName %*S" */
+		EFsModified,
+		/** @SYMTraceFormatString "-RFs::Modified() r %d aTime %lx" */
+		EFsModifiedReturn,
+		/** @SYMTraceFormatString "+RFs::SetModified() sess %x aName %*S aTime %lx" */
+		EFsSetModified,
+		/** @SYMTraceFormatString "-RFs::SetModified() r %d" */
+		EFsSetModifiedReturn,
+		/** @SYMTraceFormatString "+RFs::Entry() sess %x aName %*S" */
+		EFsEntry,
+		/** @SYMTraceFormatString "-RFs::Entry() r %d att %x modified %lx size %d" */
+		EFsEntryReturn,
+		/** @SYMTraceFormatString "+RFs::SetEntry() sess %x aName %*S aTime %lx aSetAttMask %x aClearAttMask %x" */
+		EFsSetEntry,
+		/** @SYMTraceFormatString "-RFs::SetEntry() r %d" */
+		EFsSetEntryReturn,
+		/** @SYMTraceFormatString "+RFs::ReadFileSection() sess %x aName %*S aPos %ld aLength %d" */
+		EFsReadFileSection,
+		/** @SYMTraceFormatString "-RFs::ReadFileSection() r %d" */
+		EFsReadFileSectionReturn,
+		/** @SYMTraceFormatString "+RFs::ResourceCountMarkStart() sess %x" */
+		EFsResourceCountMarkStart,
+		/** @SYMTraceFormatString "-RFs::ResourceCountMarkStart() r %d" */
+		EFsResourceCountMarkStartReturn,
+		/** @SYMTraceFormatString "+RFs::ResourceCountMarkEnd() sess %x" */
+		EFsResourceCountMarkEnd,
+		/** @SYMTraceFormatString "-RFs::ResourceCountMarkEnd() r %d" */
+		EFsResourceCountMarkEndReturn,
+		/** @SYMTraceFormatString "+RFs::ResourceCount() sess %x" */
+		EFsResourceCount,
+		/** @SYMTraceFormatString "-RFs::ResourceCount() r %d" */
+		EFsResourceCountReturn,
+		/** @SYMTraceFormatString "+RFs::CheckDisk() sess %x aDrive %*S" */
+		EFsCheckDisk,
+		/** @SYMTraceFormatString "-RFs::CheckDisk() r %d" */
+		EFsCheckDiskReturn,
+		/** @SYMTraceFormatString "+RFs::ScanDrive() sess %x aDrive %*S" */
+		EFsScanDrive,
+		/** @SYMTraceFormatString "-RFs::ScanDrive() r %d" */
+		EFsScanDriveReturn,
+		/** @SYMTraceFormatString "+RFs::GetShortName() sess %x aLongName %*S" */
+		EFsGetShortName,
+		/** @SYMTraceFormatString "-RFs::GetShortName() r %d aShortName %*S" */
+		EFsGetShortNameReturn,
+		/** @SYMTraceFormatString "+RFs::GetLongName() sess %x aShortName %*S" */
+		EFsGetLongName,
+		/** @SYMTraceFormatString "-RFs::GetLongName() r %d aLongName %*S" */
+		EFsGetLongNameReturn,
+		/** @SYMTraceFormatString "+RFs::IsFileOpen() sess %x aFileName %*S" */
+		EFsIsFileOpen,
+		/** @SYMTraceFormatString "-RFs::IsFileOpen() r %d anAnswer %d" */
+		EFsIsFileOpenReturn,
+		/** @SYMTraceFormatString "+RFs::GetNotifyUser() sess %x" */
+		EFsGetNotifyUser,
+		/** @SYMTraceFormatString "-RFs::GetNotifyUser() r %d" */
+		EFsGetNotifyUserReturn,
+		/** @SYMTraceFormatString "+RFs::SetNotifyUser() sess %x aValue %d" */
+		EFsSetNotifyUser,
+		/** @SYMTraceFormatString "-RFs::SetNotifyUser() r %d" */
+		EFsSetNotifyUserReturn,
+		/** @SYMTraceFormatString "+RFs::IsFileInRom() sess %x aFileName %*S" */
+		EFsIsFileInRom,
+		/** @SYMTraceFormatString "-RFs::IsFileInRom() r %d" */
+		EFsIsFileInRomReturn,
+		/** @SYMTraceFormatString "+RFs::IsValidName1() sess %x aFileName %*S" */
+		EFsIsValidName1,
+		/** @SYMTraceFormatString "-RFs::IsValidName1() r %d" */
+		EFsIsValidName1Return,
+		/** @SYMTraceFormatString "+RFs::IsValidName2() sess %x aFileName %*S" */
+		EFsIsValidName2,
+		/** @SYMTraceFormatString "-RFs::IsValidName2() r %d aBadChar %c" */
+		EFsIsValidName2Return,
+		/** @SYMTraceFormatString "+RFs::IsValidName3() sess %x aFileName %*S" */
+		EFsIsValidName3,
+		/** @SYMTraceFormatString "-RFs::IsValidName3() r %d err %d" */
+		EFsIsValidName3Return,
+		/** @SYMTraceFormatString "+RFs::GetDriveName() sess %x aDrive %d" */
+		EFsGetDriveName,
+		/** @SYMTraceFormatString "-RFs::GetDriveName() r %d aDriveName %*S" */
+		EFsGetDriveNameReturn,
+		/** @SYMTraceFormatString "+RFs::SetDriveName() sess %x aDrive %d aDriveName %*S" */
+		EFsSetDriveName,
+		/** @SYMTraceFormatString "-RFs::SetDriveName() r %d" */
+		EFsSetDriveNameReturn,
+		/** @SYMTraceFormatString "+RFs::LockDrive() sess %x aDrv %d aStore %d" */
+		EFsLockDrive,
+		/** @SYMTraceFormatString "-RFs::LockDrive() r %d" */
+		EFsLockDriveReturn,
+		/** @SYMTraceFormatString "+RFs::UnlockDrive() sess %x aDrv %d aStore %d" */
+		EFsUnlockDrive,
+		/** @SYMTraceFormatString "-RFs::UnlockDrive() r %d" */
+		EFsUnlockDriveReturn,
+		/** @SYMTraceFormatString "+RFs::ClearPassword() sess %x aDrv %d" */
+		EFsClearPassword,
+		/** @SYMTraceFormatString "-RFs::ClearPassword() r %d" */
+		EFsClearPasswordReturn,
+		/** @SYMTraceFormatString "+RFs::ErasePassword() sess %x aDrv %d" */
+		EFsErasePassword,
+		/** @SYMTraceFormatString "-RFs::ErasePassword() r %d" */
+		EFsErasePasswordReturn,
+		/** @SYMTraceFormatString "+RFs::StartupInitComplete() sess %x status %x" */
+		EFsStartupInitComplete,
+		/** @SYMTraceFormatString "-RFs::StartupInitComplete() r %d" */
+		EFsStartupInitCompleteReturn,
+		/** @SYMTraceFormatString "+RFs::SetLocalDriveMapping() sess %x aMapping %*x" */
+		EFsSetLocalDriveMapping,
+		/** @SYMTraceFormatString "-RFs::SetLocalDriveMapping() r %d" */
+		EFsSetLocalDriveMappingReturn,
+		/** @SYMTraceFormatString "+RFs::FinaliseDrive() sess %x aDriveNo %d aMode %d" */
+		EFsFinaliseDrive,
+		/** @SYMTraceFormatString "-RFs::FinaliseDrive() r %d" */
+		EFsFinaliseDriveReturn,
+		/** @SYMTraceFormatString "+RFs::FinaliseDrives() sess %x" */
+		EFsFinaliseDrives,
+		/** @SYMTraceFormatString "-RFs::FinaliseDrives() r %d" */
+		EFsFinaliseDrivesReturn,
+		/** @SYMTraceFormatString "+RFs::SwapFileSystem() sess %x aOldFileSystemName %*S aNewFileSystemName %*S aDrive %d" */
+		EFsSwapFileSystem,
+		/** @SYMTraceFormatString "-RFs::SwapFileSystem() r %d" */
+		EFsSwapFileSystemReturn,
+		/** @SYMTraceFormatString "+RFs::AddCompositeMount() sess %x aFileSystemName %*S aLocalDriveToMount %d aCompositeDrive %d aSync %d" */
+		EFsAddCompositeMount,
+		/** @SYMTraceFormatString "-RFs::AddCompositeMount() r %d" */
+		EFsAddCompositeMountReturn,
+		/** @SYMTraceFormatString "+RFs::ReserveDriveSpace() sess %x aDriveNo %d aSpace %d" */
+		EFsReserveDriveSpace,
+		/** @SYMTraceFormatString "-RFs::ReserveDriveSpace() r %d" */
+		EFsReserveDriveSpaceReturn,
+		/** @SYMTraceFormatString "+RFs::GetReserveAccess() sess %x aDriveNo %d" */
+		EFsGetReserveAccess,
+		/** @SYMTraceFormatString "-RFs::GetReserveAccess() r %d" */
+		EFsGetReserveAccessReturn,
+		/** @SYMTraceFormatString "+RFs::ReleaseReserveAccess() sess %x aDriveNo %d" */
+		EFsReleaseReserveAccess,
+		/** @SYMTraceFormatString "-RFs::ReleaseReserveAccess() r %d" */
+		EFsReleaseReserveAccessReturn,
+		/** @SYMTraceFormatString "+RFs::NotifyDismount() sess %x aDrive %d stauts %x aMode %d" */
+		EFsNotifyDismount,
+		/** @SYMTraceFormatString "-RFs::NotifyDismount() r %d" */
+		EFsNotifyDismountReturn,
+		/** @SYMTraceFormatString "+RFs::NotifyDismountCancel1() sess %x status %x" */
+		EFsNotifyDismountCancel1,
+		/** @SYMTraceFormatString "-RFs::NotifyDismountCancel1() r %d" */
+		EFsNotifyDismountCancel1Return,
+		/** @SYMTraceFormatString "+RFs::NotifyDismountCancel2() sess %x" */
+		EFsNotifyDismountCancel2,
+		/** @SYMTraceFormatString "-RFs::NotifyDismountCancel2() r %d" */
+		EFsNotifyDismountCancel2Return,
+		/** @SYMTraceFormatString "+RFs::AllowDismount() sess %x aDrive %d" */
+		EFsAllowDismount,
+		/** @SYMTraceFormatString "-RFs::AllowDismount() r %d" */
+		EFsAllowDismountReturn,
+		/** @SYMTraceFormatString "+RFs::SetStartupConfiguration() sess %x aCommand %d aParam1 %x aParam2 %x" */
+		EFsSetStartupConfiguration,
+		/** @SYMTraceFormatString "-RFs::SetStartupConfiguration() r %d" */
+		EFsSetStartupConfigurationReturn,
+		/** @SYMTraceFormatString "+RFs::SetNotifyChange() sess %x aNotifyChange %d" */
+		EFsSetNotifyChange,
+		/** @SYMTraceFormatString "-RFs::SetNotifyChange() r %d" */
+		EFsSetNotifyChangeReturn,
+		/** @SYMTraceFormatString "+RFs::InitialisePropertiesFile() sess %x filePtr %x fileLen %d" */
+		EFsInitialisePropertiesFile,
+		/** @SYMTraceFormatString "-RFs::InitialisePropertiesFile() r %d" */
+		EFsInitialisePropertiesFileReturn,
+		/** @SYMTraceFormatString "+RFs::QueryVolumeInfoExt() sess %x aDrive %d aCommand %d" */
+		EFsQueryVolumeInfoExt,
+		/** @SYMTraceFormatString "-RFs::QueryVolumeInfoExt() r %d" */
+		EFsQueryVolumeInfoExtReturn,
+		/** @SYMTraceFormatString "+RFs::VolumeIOParam() sess %x aDrive %d" */
+		EFsVolumeIOParam,
+		/** @SYMTraceFormatString "-RFs::VolumeIOParam() r %d iBlockSize %d iClusterSize %d iRecReadBufSize %d iRecWriteBufSize %d" */
+		EFsVolumeIOParamReturn,
+		/** @SYMTraceFormatString "+RFs::FileSystemSubType() sess %x aDrive %d aName %*S" */
+		EFsFileSystemSubType,
+		/** @SYMTraceFormatString "-RFs::FileSystemSubType() r %d" */
+		EFsFileSystemSubTypeReturn,
+
+		/** @SYMTraceFormatString "+RFs::AddPlugin() sess %x aFileName %*S" */
+        EFsAddPlugin,
+        /** @SYMTraceFormatString "-RFs::AddPlugin() r %d" */
+        EFsAddPluginReturn,
+
+		/** @SYMTraceFormatString "+RFs::RemovePlugin() sess %x aPluginName %*S" */
+        EFsRemovePlugin,
+        /** @SYMTraceFormatString "-RFs::RemovePlugin() r %d" */
+        EFsRemovePluginReturn,
+
+		/** @SYMTraceFormatString "+RFs::MountPlugin1() sess %x aPluginName %*S" */
+        EFsMountPlugin1,
+        /** @SYMTraceFormatString "-RFs::MountPlugin1() r %d" */
+        EFsMountPlugin1Return,
+
+		/** @SYMTraceFormatString "+RFs::MountPlugin2() sess %x aPluginName %*S aDrive %d" */
+        EFsMountPlugin2,
+        /** @SYMTraceFormatString "-RFs::MountPlugin2() r %d" */
+        EFsMountPlugin2Return,
+
+		/** @SYMTraceFormatString "+RFs::MountPlugin3() sess %x aPluginName %*S aDrive %d aPos %d" */
+        EFsMountPlugin3,
+        /** @SYMTraceFormatString "-RFs::MountPlugin3() r %d" */
+        EFsMountPlugin3Return,
+
+		/** @SYMTraceFormatString "+RFs::DismountPlugin() sess %x aPluginName %*S" */
+        EFsDismountPlugin1,
+        /** @SYMTraceFormatString "-RFs::DismountPlugin() r %d" */
+        EFsDismountPlugin1Return,
+
+		/** @SYMTraceFormatString "+RFs::DismountPlugin2() sess %x aPluginName %*S aDrive %d" */
+        EFsDismountPlugin2,
+        /** @SYMTraceFormatString "-RFs::DismountPlugin2() r %d" */
+        EFsDismountPlugin2Return,
+
+		/** @SYMTraceFormatString "+RFs::DismountPlugin3() sess %x aPluginName %*S aDrive %d aPos %d" */
+        EFsDismountPlugin3,
+        /** @SYMTraceFormatString "-RFs::DismountPlugin3() r %d" */
+        EFsDismountPlugin3Return,
+
+		/** @SYMTraceFormatString "+RFs::PluginName() sess %x aDrive %d aPos %d" */
+        EFsPluginName,
+        /** @SYMTraceFormatString "-RFs::PluginName() r %d aName %*S" */
+        EFsPluginNameReturn,
+
+		/** @SYMTraceFormatString "+RFs::Close() sess %x" */
+		EFsClose,
+		/** @SYMTraceFormatString "-RFs::Close() r %d" */
+		EFsCloseReturn,
+
+
+		/** @SYMTraceFormatString "+RDir::Open1() sess %x aName %*S aUidType0 %x aUidType1 %x aUidType2 %x" */
+        EDirOpen1,
+        /** @SYMTraceFormatString "-RDir::Open1() r %d subs %x" */
+        EDirOpen1Return,
+
+		/** @SYMTraceFormatString "+RDir::Open2() sess %x aName %*S anAttMask %x" */
+        EDirOpen2,
+        /** @SYMTraceFormatString "-RDir::Open2() r %d subs %x" */
+        EDirOpen2Return,
+
+		/** @SYMTraceFormatString "+RDir::Close() sess %x subs %x" */
+        EDirClose,
+        /** @SYMTraceFormatString "-RDir::Close()" */
+        EDirCloseReturn,
+
+		/** @SYMTraceFormatString "+RDir::Read1() sess %x subs %x" */
+        EDirRead1,
+        /** @SYMTraceFormatString "-RDir::Read1() r %d count %d" */
+        EDirRead1Return,
+
+		/** @SYMTraceFormatString "+RDir::Read2() sess %x subs %x status %x" */
+        EDirRead2,
+        /** @SYMTraceFormatString "-RDir::Read2()" */
+        EDirRead2Return,
+
+		/** @SYMTraceFormatString "+RDir::Read3() sess %x subs %x" */
+        EDirRead3,
+        /** @SYMTraceFormatString "-RDir::Read3() r %d" */
+        EDirRead3Return,
+
+		/** @SYMTraceFormatString "+RDir::Read4() sess %x subs %x status %x" */
+        EDirRead4,
+        /** @SYMTraceFormatString "-RDir::Read4()" */
+        EDirRead4Return,
+
+
+		/** @SYMTraceFormatString "+RFormat::Open1() sess %x aName %*S aFormatMode %x" */
+        EFormat1Open,
+        /** @SYMTraceFormatString "-RFormat::Open1() r %d subs %x aCount %d" */
+        EFormatOpen1Return,
+
+		/** @SYMTraceFormatString "+RFormat::Open2() sess %x aName %*S aFormatMode %x aInfo %x" */
+        EFormat2Open,
+        /** @SYMTraceFormatString "-RFormat::Open2() r %d subs %x aCount %d" */
+        EFormatOpen2Return,
+
+		/** @SYMTraceFormatString "+RFormat::Close() sess %x subs %x" */
+        EFormatClose,
+        /** @SYMTraceFormatString "-RFormat::Close()" */
+        EFormatCloseReturn,
+
+		/** @SYMTraceFormatString "+RFormat::Next1() sess %x subs %x" */
+        EFormatNext1,
+        /** @SYMTraceFormatString "-RFormat::Next1() r %d aStep %d" */
+        EFormatNext1Return,
+
+		/** @SYMTraceFormatString "+RFormat::Next2() sess %x subs %x status %x" */
+        EFormatNext2,
+        /** @SYMTraceFormatString "-RFormat::Next2()" */
+        EFormatNext2Return,
+
+
+
+		/** @SYMTraceFormatString "+RPlugin::Open() aPos %d" */
+        EPluginOpen,
+        /** @SYMTraceFormatString "-RPlugin::Open() r %d subs %x" */
+        EPluginOpenReturn,
+
+		/** @SYMTraceFormatString "+RPlugin::Close() sess %x subs %x" */
+        EPluginClose,
+        /** @SYMTraceFormatString "-RPlugin::Close() r %d" */
+        EPluginCloseReturn,
+
+		/** @SYMTraceFormatString "+RPlugin::DoRequest1() sess %x subs %x aReqNo %d status %x" */
+        EPluginDoRequest1,
+        /** @SYMTraceFormatString "-RPlugin::DoRequest1()" */
+        EPluginDoRequest1Return,
+
+		/** @SYMTraceFormatString "+RPlugin::DoRequest2() sess %x subs %x aReqNo %d status %x a1 %x" */
+        EPluginDoRequest2,
+        /** @SYMTraceFormatString "-RPlugin::DoRequest2()" */
+        EPluginDoRequest2Return,
+
+		/** @SYMTraceFormatString "+RPlugin::DoRequest3() sess %x subs %x aReqNo %d status %x a1 %x a2 %x" */
+        EPluginDoRequest3,
+        /** @SYMTraceFormatString "-RPlugin::DoRequest3()" */
+        EPluginDoRequest3Return,
+
+		/** @SYMTraceFormatString "+RPlugin::DoControl() sess %x subs %x aFunction %d" */
+        EPluginDoControl1,
+        /** @SYMTraceFormatString "-RPlugin::DoControl() r %d" */
+        EPluginDoControl1Return,
+
+		/** @SYMTraceFormatString "+RPlugin::DoControl2() sess %x subs %x aFunction %d a1 %x" */
+        EPluginDoControl2,
+        /** @SYMTraceFormatString "-RPlugin::DoControl2() r %d" */
+        EPluginDoControl2Return,
+
+		/** @SYMTraceFormatString "+RPlugin::DoControl3() sess %x subs %x aFunction %d a1 %x a2 %x" */
+        EPluginDoControl3,
+        /** @SYMTraceFormatString "-RPlugin::DoControl3() r %d" */
+        EPluginDoControl3Return,
+
+		/** @SYMTraceFormatString "+RPlugin::DoCancel() sess %x subs %x aReqMask %x" */
+        EPluginDoCancel,
+        /** @SYMTraceFormatString "-RPlugin::DoCancel()" */
+        EPluginDoCancelReturn,
+
+
+		/** @SYMTraceFormatString "+CFileMan::NewL1() sess %x" */
+        ECFileManNewL1,
+        /** @SYMTraceFormatString "-CFileMan::NewL1() CFileMan* %x" */
+        ECFileManNewL1Return,
+
+		/** @SYMTraceFormatString "+CFileMan::NewL2() sess %x anObserver %x" */
+        ECFileManNewL2,
+        /** @SYMTraceFormatString "-CFileMan::NewL2() CFileMan* %x" */
+        ECFileManNewL2Return,
+
+		/** @SYMTraceFormatString "+CFileMan::~CFileMan() this %x" */
+        ECFileManDestructor,
+        /** @SYMTraceFormatString "-CFileMan::~CFileMan()" */
+        ECFileManDestructorReturn,
+
+		/** @SYMTraceFormatString "+CFileMan::CurrentAction() this %x" */
+        ECFileManCurrentAction,
+        /** @SYMTraceFormatString "-CFileMan::CurrentAction() action %d" */
+        ECFileManCurrentActionReturn,
+
+		/** @SYMTraceFormatString "+CFileMan::GetCurrentTarget() this %x" */
+        ECFileManGetCurrentTarget,
+        /** @SYMTraceFormatString "-CFileMan::GetCurrentTarget() aTrgName %*S" */
+        ECFileManGetCurrentTargetReturn,
+
+		/** @SYMTraceFormatString "+CFileMan::GetCurrentSource() this %x" */
+        ECFileManGetCurrentSource,
+        /** @SYMTraceFormatString "-CFileMan::GetCurrentSource() aSrcName %*S" */
+        ECFileManGetCurrentSourceReturn,
+
+		/** @SYMTraceFormatString ".CFileMan::BytesTransferredByCopyStep() this %x BytesTransferred %d" */
+        ECFileManBytesTransferredByCopyStep,
+
+		/** @SYMTraceFormatString "+CFileMan::Attribs1() this %x aName %*S aSetMask %x aClearMask %x aTime %lx aSwitches %d, status %x" */
+        ECFileManAttribs1,
+        /** @SYMTraceFormatString "-CFileMan::Attribs1() r %d" */
+        ECFileManAttribs1Return,
+
+		/** @SYMTraceFormatString "+CFileMan::Attribs2() this %x aName %*S aSetMask %x aClearMask %x aTime %lx aSwitches %d" */
+        ECFileManAttribs2,
+        /** @SYMTraceFormatString "-CFileMan::Attribs2() r %d" */
+        ECFileManAttribs2Return,
+
+		/** @SYMTraceFormatString "+CFileMan::Copy1() this %x anOld %*S aNew %*S aSwitches %d status %x" */
+        ECFileManCopy1,
+        /** @SYMTraceFormatString "-CFileMan::Copy1() r %d" */
+        ECFileManCopy1Return,
+
+		/** @SYMTraceFormatString "+CFileMan::Copy2() this %x anOld %*S aNew %*S aSwitches %d" */
+        ECFileManCopy2,
+        /** @SYMTraceFormatString "-CFileMan::Copy2() r %d" */
+        ECFileManCopy2Return,
+
+		/** @SYMTraceFormatString "+CFileMan::Copy3() this %x anOldSubs %x aNew %*S aSwitches %d" */
+        ECFileManCopy3,
+        /** @SYMTraceFormatString "-CFileMan::Copy3() r %d" */
+        ECFileManCopy3Return,
+
+		/** @SYMTraceFormatString "+CFileMan::Copy4() this %x anOldSubs %x aNew %*S aSwitches %dstatus %x" */
+        ECFileManCopy4,
+        /** @SYMTraceFormatString "-CFileMan::Copy4() r %d" */
+        ECFileManCopy4Return,
+		
+		/** @SYMTraceFormatString "+CFileMan::Delete1() this %x aName %*S aSwitches %d status %x" */
+        ECFileManDelete1,
+        /** @SYMTraceFormatString "-CFileMan::Delete1() r %d" */
+        ECFileManDelete1Return,
+
+		/** @SYMTraceFormatString "+CFileMan::Delete2() this %x aName %*S aSwitches %d" */
+        ECFileManDelete2,
+        /** @SYMTraceFormatString "-CFileMan::Delete2() r %d" */
+        ECFileManDelete2Return,
+
+		/** @SYMTraceFormatString "+CFileMan::Move1() this %x anOld %*S aNew %*S aSwitches %d status %x" */
+        ECFileManMove1,
+        /** @SYMTraceFormatString "-CFileMan::Move1() r %d" */
+        ECFileManMove1Return,
+
+		/** @SYMTraceFormatString "+CFileMan::Move2() this %x anOld %*S aNew %*S aSwitches %d" */
+        ECFileManMove2,
+        /** @SYMTraceFormatString "-CFileMan::Move2() r %d" */
+        ECFileManMove2Return,
+
+		/** @SYMTraceFormatString "+CFileMan::Rename1() this %x anOld %*S aNew %*S aSwitches %d status %x" */
+        ECFileManRename1,
+        /** @SYMTraceFormatString "-CFileMan::Rename1() r %d" */
+        ECFileManRename1Return,
+
+		/** @SYMTraceFormatString "+CFileMan::Rename2() this %x anOld %*S aNew %*S aSwitches %d" */
+        ECFileManRename2,
+        /** @SYMTraceFormatString "-CFileMan::Rename2() r %d" */
+        ECFileManRename2Return,
+
+		/** @SYMTraceFormatString "+CFileMan::RmDir1() this %x aDirName %*S status %x" */
+        ECFileManRmDir1,
+        /** @SYMTraceFormatString "-CFileMan::RmDir1() r %d" */
+        ECFileManRmDir1Return,
+
+		/** @SYMTraceFormatString "+CFileMan::RmDir2() this %x aDirName %*S" */
+        ECFileManRmDir2,
+        /** @SYMTraceFormatString "-CFileMan::RmDir2() r %d" */
+        ECFileManRmDir2Return,
+
+
+
+
+
+		/** @SYMTraceFormatString "+CDirScan::NewL() sess %x" */
+        ECDirScanNewL,
+        /** @SYMTraceFormatString "-CDirScan::NewL() CDirScan* %x" */
+        ECDirScanNewLReturn,
+
+		/** @SYMTraceFormatString "+CDirScan::NewLC() sess %x" */
+        ECDirScanNewLC,
+        /** @SYMTraceFormatString "-CDirScan::NewLC() CDirScan* %x" */
+        ECDirScanNewLCReturn,
+
+		/** @SYMTraceFormatString "+CDirScan::~CDirScan() this %x" */
+        ECDirScanDestructor,
+        /** @SYMTraceFormatString "-CDirScan::~CDirScan()" */
+        ECDirScanDestructorReturn,
+
+		/** @SYMTraceFormatString "+CDirScan::SetScanDataL() this %x aMatchName %*S anEntryAttMask %x anEntrySortKey %d aScanDir %d" */
+        ECDirScanSetScanDataL,
+        /** @SYMTraceFormatString "-CDirScan::SetScanDataL() r %d" */
+        ECDirScanSetScanDataLReturn,
+
+		/** @SYMTraceFormatString "+CDirScan::NextL() this %x" */
+        ECDirScanNextL,
+        /** @SYMTraceFormatString "-CDirScan::NextL() r %d DirEntries %d" */
+        ECDirScanNextLReturn,
+
+        /** @SYMTraceFormatString "-CDirScan Leave r %d" */
+        ECDirScanLeave,
+
+
+
+
+
+
+        /** @SYMTraceFormatString "Efsrv.dll Panic r %d" */
+        EPanic,
+
+        
+		/** @SYMTraceFormatString "TimeStamp" */
+        ETimeStamp,
+
+        /**
+        Provided to allow the following compile time assert.
+        */
+        EFormatIdHighWaterMark,
+        };
+    __ASSERT_COMPILE(EFormatIdHighWaterMark <= (UTF::KMaxFormatId + 1));
+
+
+
+    } // end of namespace UTraceModuleEfsrv
+
+	
+#endif // UTRACEEFSRV_H
--- a/userlibandfileserver/fileserver/rom/f32.iby	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/rom/f32.iby	Wed Sep 01 12:34:56 2010 +0100
@@ -17,6 +17,8 @@
 secondary=\Epoc32\Release\##MAIN##\##BUILD##\efile.exe  sys\bin\efile.exe  FIXED HEAPMAX(0x80000)
 file=\Epoc32\Release\##MAIN##\##BUILD##\efsrv.dll       sys\bin\efsrv.dll
 
+device[VARID]=\Epoc32\Release\##KMAIN##\##BUILD##\d_ftrace.ldd          sys\bin\d_ftrace.ldd
+
 #ifdef WITH_EXFAT
 file=\Epoc32\Release\##MAIN##\##BUILD##\exfat.fsy       sys\bin\exfat.fsy
 #endif
@@ -78,7 +80,7 @@
 file=\Epoc32\Release\##SMAIN##\##BUILD##\erofs.fsy  sys\bin\erofs.fsy
 #endif
 
-#ifndef __USB
+#ifdef SYMBIAN_EXCLUDE_USB
 REM Feature USB is not included in this ROM
 #else
 #ifdef WITH_MASS_STORAGE
@@ -93,4 +95,4 @@
 file=\epoc32\release\##MAIN##\##BUILD##\usbhostmssrv.exe    sys\bin\usbhostmssrv.exe
 #endif //SYMBIAN_INCLUDE_USB_OTG_HOST
 #endif //WITH_MASS_STORAGE
-#endif //__USB
+#endif //SYMBIAN_EXCLUDE_USB
--- a/userlibandfileserver/fileserver/sfat32/fat_table32.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/fat_table32.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -402,7 +402,7 @@
     Notify the media drive about media areas that shall be treated as "deleted" if this feature is supported.
     @param aFreedClusters array with FAT numbers of clusters that shall be marked as "deleted"
 */
-void CFatTable::DoFreedClustersNotify(RClusterArray &aFreedClusters)
+void CFatTable::DoFreedClustersNotifyL(RClusterArray &aFreedClusters)
 {
     ASSERT(iMediaAtt & KMediaAttDeleteNotify);
 
@@ -423,7 +423,7 @@
         const TUint currCluster = aFreedClusters[i];
         
         if (deleteLen == 0)
-		    byteAddress = DataPositionInBytes(currCluster); //-- start of the media range
+		    byteAddress = DataPositionInBytesL(currCluster); //-- start of the media range
         
         deleteLen += bytesPerCluster;
 
@@ -438,7 +438,7 @@
                 {//-- if DeleteNotify() failed, it means that something terribly wrong happened to the NAND media; 
                  //-- in normal circumstances it can not happen. One of the reasons: totally worn out media.
                 const TBool platSecEnabled = PlatSec::ConfigSetting(PlatSec::EPlatSecEnforcement);
-                __PRINT3(_L("CFatTable::DoFreedClustersNotify() DeleteNotify failure! drv:%d err:%d, PlatSec:%d"),iOwner->DriveNumber(), r, platSecEnabled);
+                __PRINT3(_L("CFatTable::DoFreedClustersNotifyL() DeleteNotify failure! drv:%d err:%d, PlatSec:%d"),iOwner->DriveNumber(), r, platSecEnabled);
 
                 if(platSecEnabled)
                     {
@@ -521,7 +521,7 @@
             cntFreedClusters = 0;
 
             SetFreeClusterHint(lastKnownFreeCluster);
-            DoFreedClustersNotify(deletedClusters);
+            DoFreedClustersNotifyL(deletedClusters);
         }
 
     }
@@ -531,7 +531,7 @@
     SetFreeClusterHint(lastKnownFreeCluster);
     
     if(bFreeClustersNotify)
-        DoFreedClustersNotify(deletedClusters);
+        DoFreedClustersNotifyL(deletedClusters);
 
 	CleanupStack::PopAndDestroy(&deletedClusters);
 	}
@@ -671,14 +671,6 @@
     return (NumberOfFreeClusters() >= aClustersRequired);
     }
 
-//-----------------------------------------------------------------------------
-/**
-    @return ETrue if the cluster number aClusterNo is valid, i.e. belongs to the FAT table
-*/
-TBool CFatTable::ClusterNumberValid(TUint32 aClusterNo) const 
-    {
-    return (aClusterNo >= KFatFirstSearchCluster) && (aClusterNo < iMaxEntries); 
-    }
     
 
 
@@ -692,7 +684,7 @@
 CAtaFatTable::CAtaFatTable(CFatMountCB& aOwner)
              :CFatTable(aOwner), iDriveInteface(aOwner.DriveInterface())
     {
-    iState = ENotInitialised;
+        iState = ENotInitialised;
     }
 
 
@@ -1044,16 +1036,10 @@
             //-- create helper thread object and start the thread
             ipHelperThread = CFat32BitCachePopulator::NewL(*this);
 
-            if(ipHelperThread->Launch() != KErrNone)
-                {//-- failed for some reason
-                DestroyHelperThread();
-                }
-                else
-                {
-                //-- background FAT bit cache populating thread is running now.
-                //-- the result of thread start up and completion isn't very interesting: If it fails to 
-                //-- properly populate the cache, nothing fatal will happen.
-                }
+            ipHelperThread->Launch(); 
+            //-- background FAT bit cache populating thread is running now.
+            //-- the result of thread start up and completion isn't very interesting: If it fails to 
+            //-- properly populate the cache, nothing fatal will happen.
             }
 
         //-- CFat32BitCachePopulator doesn't affect FAT table state. 
@@ -1486,7 +1472,7 @@
                 {//-- test property for this drive is defined
                     if(nMntDebugFlags & KMntDisable_FatBkGndScan)
                     {
-                    __PRINT(_L("#- FAT32 BkGnd scan is disabled by debug interface."));
+                    __PRINT(_L("#- FAT32 BkGnd scan is disabled is disabled by debug interface."));
                     bFat32BkGndScan = EFalse;
                     }
             
@@ -1550,8 +1536,7 @@
     
     SetState(EFreeClustersScan);
     
-    User::LeaveIfError(ipHelperThread->Launch()); 
-    
+    ipHelperThread->Launch(); 
     //-- background FAT scanning thread is running now
     }
 
@@ -1796,17 +1781,20 @@
 
 
 /**
-    Return the location of a Cluster in the data section of the media
+    Return media position in bytes of the cluster start
 
     @param aCluster to find location of
     @return Byte offset of the cluster data 
 */
-TInt64 CAtaFatTable::DataPositionInBytes(TUint32 aCluster) const
+TInt64 CAtaFatTable::DataPositionInBytesL(TUint32 aCluster) const
 	{
-
-    __ASSERT_DEBUG(ClusterNumberValid(aCluster), Fault(EFatTable_InvalidIndex));
-
-    const TInt clusterBasePosition=iOwner->ClusterBasePosition();
+    if(!ClusterNumberValid(aCluster))
+        {
+        __ASSERT_DEBUG(0, Fault(EFatTable_InvalidIndex));
+        User::Leave(KErrCorrupt);
+        }
+
+    const TUint32 clusterBasePosition=iOwner->ClusterBasePosition();
 	return(((TInt64(aCluster)-KFatFirstSearchCluster) << iOwner->ClusterSizeLog2()) + clusterBasePosition);
 	}
 
@@ -1971,8 +1959,8 @@
         return nRes;
         }
 
-    //-- Helper FAT thread is running now
-    return KErrNone; 
+   //-- Helper FAT thread is running now
+   return KErrNone; 
     }
 
 
@@ -1990,8 +1978,7 @@
 
 /**
     Launches the FAT32_ScanThread scaner thread.
-    @return  KErrNone if the thread launched OK
-             standard error code otherwise
+    @return  standard error code
 */
 TInt CFat32ScanThread::Launch()
     {
--- a/userlibandfileserver/fileserver/sfat32/inc/fat_table32.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/inc/fat_table32.h	Wed Sep 01 12:34:56 2010 +0100
@@ -50,7 +50,7 @@
     void WriteL(TUint32 aFatIndex, TUint32 aValue);
     void MountL(const TMountParams& aMountParam);
 
-    TInt64 DataPositionInBytes(TUint32 aCluster) const;
+    TInt64 DataPositionInBytesL(TUint32 aCluster) const;
 
     void InitializeL();
     void Dismount(TBool aDiscardDirtyData);
@@ -157,7 +157,7 @@
 
     TUint32 ReadL(TUint32 aFatIndex) const;
     void WriteL(TUint32 aFatIndex, TUint32 aValue);
-    TInt64 DataPositionInBytes(TUint32 aCluster) const;
+    TInt64 DataPositionInBytesL(TUint32 aCluster) const;
     void FreeClusterListL(TUint32 aCluster);
     TUint32 AllocateSingleClusterL(TUint32 aNearestCluster);
     void ExtendClusterListL(TUint32 aNumber, TUint32& aCluster);
@@ -176,7 +176,7 @@
     inline void WriteIndirectionTable(TInt aFatIndex,TInt aValue);
     inline TUint8* MemCopy(TAny* aTrg,const TAny* aSrc,TInt aLength);
     inline TUint8* MemCopyFillZ(TAny* aTrg, TAny* aSrc, TInt aLength);
-    inline void ZeroFillCluster(TInt aCluster);
+    inline void ZeroFillClusterL(TInt aCluster);
     
     void UpdateIndirectionTable(TUint32 aStartCluster,TUint32 anEndCluster,TInt aNum);
 
--- a/userlibandfileserver/fileserver/sfat32/inc/sl_scandrv.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/inc/sl_scandrv.h	Wed Sep 01 12:34:56 2010 +0100
@@ -134,7 +134,6 @@
 	
 	void FixPartEntryL();
 	void FixMatchingEntryL();
-	void FixHangingClusterChainL(TUint32 aFatEocIndex);
 	void MovePastEntriesL(TEntryPos& aEntryPos,TFatDirEntry& aEntry,TInt aToMove,TInt& aDirEntries);
 	void AddToClusterListL(TInt aCluster);
 	inline TBool AlreadyExistsL(TInt aCluster)const;
@@ -151,39 +150,37 @@
 protected:
 	
     /**
-    Internal ScanDrive mode specific errors.
-    In Rugged FAT mode (current implementation) any type of error of this kind can occur only once and it will be fixed.
-    Otherwise the FS is considered to be corrupted.
+    Internal ScanDrive mode specific errors. In Rugged FAT mode (current implementatio) any type of error of this kind can occur only once and it will be fixed.
+    Othersise the FS is considered to be corrupted
     */
     enum TDirError 
         {
-        ENoDirError= 0,         ///< No errors found
+        ENoDirError= 0,         ///< no errors found
         EScanMatchingEntry=1,   ///< Two entries pointing to the same cluster chain; Rugged FAT rename/replace artefact
         EScanPartEntry,         ///< Deleted DOS entry and orphaned VFAT ones from the same entryset; Rugged FAT 'file/dir delete' artefact
         };
 
 
 private:
-	CFatMountCB*            iMount;             ///< The owning FAT mount
+	CFatMountCB*            iMount;             ///< The owning Fat mount
 	
-    TPartVFatEntry          iPartEntry;         ///< Storage for a partial VFAT entry set error, see EScanPartEntry
+    TPartVFatEntry          iPartEntry;         ///< Storage for a partial VFat entry set error, see EScanPartEntry
 	TMatchingStartCluster   iMatching;          ///< Storage for Matching start cluster error, see EScanMatchingEntry
 	
-    TDirError               iDirError;          ///< Indicates the error type found also used to indicate if an error has occured
-	TUint32                 iHangingClusters;	///< Number of hanging clusters found (and marked as EOF by ScanDrive), at which cluster chain
-												///< truncation should take place; Rugged FAT 'file shrinking/expanding' artefact
+    TDirError               iDirError;          ///< Indicates the error tpye found also used to indicate if an error has occured
     TInt                    iDirsChecked;       ///< Count of the number of directories checked
 	TInt                    iRecursiveDepth;    ///< Depth of recursion the scan has reached
-	RArray<TInt>*           iClusterListArray[KMaxArrayDepth]; ///< Size in bytes of the bit packed FAT	cluster list array used when maximum depth
-															   ///< has been reached so that directory may be re-visited. Avoid stack overflow.
+	RArray<TInt>*           iClusterListArray[KMaxArrayDepth]; ///< Size in bytes of the bit packed Fat	Cluster list array used when maximum depth has been reached so that directory may be re-visited. Avoid stack overflow
+	
     TUint                   iListArrayIndex;    ///< Current position into cluster list array
+	TUint32                 iTruncationCluster; ///< Cluster at which cluster chain truncation should take place, used for truncation errors
 	TUint32                 iMaxClusters;       ///< Max. amount of clusters on the volume
 
-    RBitVector              iMediaFatBits;      ///< Storage for bit packed FAT read from media 
-    RBitVector              iScanFatBits;       ///< Storage for bit packed FAT built up by the scan
+    RBitVector              iMediaFatBits;      ///< Storage for bit packed Fat read from media 
+    RBitVector              iScanFatBits;       ///< Storage for bit packed Fat built up by the scan
 
     TGenericError           iGenericError;      ///< FS error that is discovered by scanning in any mode  
-    TScanDriveMode          iScanDriveMode;     ///< Mode of operation
+    TScanDriveMode          iScanDriveMode;     ///< mode of operation
 	};
 
 
--- a/userlibandfileserver/fileserver/sfat32/inc/sl_std.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/inc/sl_std.h	Wed Sep 01 12:34:56 2010 +0100
@@ -58,7 +58,7 @@
 class CFatFileSystem;
 
 /**
-Represents the position of a directory entry in terms of a cluster and offset into it
+Represents the position of a directory entery in terms of a cluster and off set into it
 */
 class TEntryPos
 	{
@@ -192,7 +192,7 @@
     //-- pure virtual interface
     virtual TUint32 ReadL(TUint32 aFatIndex) const = 0;
 	virtual void WriteL(TUint32 aFatIndex, TUint32 aValue) = 0;
-	virtual TInt64 DataPositionInBytes(TUint32 aCluster) const = 0;
+	virtual TInt64 DataPositionInBytesL(TUint32 aCluster) const = 0;
     virtual void MountL(const TMountParams& aMountParam) = 0;
     //-----------------------------------------------------------------
     //-- just virtual interface
@@ -266,7 +266,7 @@
     inline TBool ClusterNumberValid(TUint32 aClusterNo) const;
 
     typedef RArray<TUint> RClusterArray;
-    void DoFreedClustersNotify(RClusterArray &aFreedClusters);
+    void DoFreedClustersNotifyL(RClusterArray &aFreedClusters);
 
 
 protected:
@@ -428,7 +428,7 @@
 
 
 /**
-Fat file system mount implementation, provides all that is required of a plug in
+Fat file system mount implmentation, provides all that is required of a plug in
 file system mount as well as Fat mount specific functionality 
 */
 class CFatMountCB : public CLocDrvMountCB, 
@@ -750,7 +750,6 @@
     void    DoReMountL();
     void    SetFatType(TFatType aFatType);
 
-    TUint64 VolumeSizeInBytes() const;
 
 private:
 	
@@ -768,10 +767,10 @@
     TBool iRamDrive         : 1;///< true if this is a RAM drive    
     TBool iMainBootSecValid : 1;///< true if the main boot sector is valid, if false, a backup boot sector may be in use. 
 
-    TFatMntState iState;            ///< this mounnt internal state
+    TFatMntState iState;        ///< this mounnt internal state
 
-    TFatType iFatType;              ///< FAT type, FAT12,16 or 32
-    TUint32  iFatEocCode;           ///< End Of Cluster Chain code, 0xff8 for FAT12, 0xfff8 for FAT16, and 0xffffff8 for FAT32 
+    TFatType iFatType;          ///< FAT type, FAT12,16 or 32
+    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
 
@@ -783,7 +782,7 @@
     CFatTable* iFatTable;           ///< Pointer to the volume Fat 
 	CRawDisk*  iRawDisk;            ///< Pointer to the raw data interface class
 	
-    CAsyncNotifier* iNotifier;      ///< Async notifier for notifying user of Fat error conditions 
+    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
 	TFatConfig      iFatConfig;       ///< FAT parametrers from estart.txt
@@ -900,10 +899,10 @@
     TUint     iStartCluster;     ///< Start cluster number of file
 	TEntryPos iCurrentPos;  ///< Current position in file data
 	
-    TEntryPos iFileDosEntryPos;	///< File DOS dir. entry position
+    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())
+    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())
 
 	};
 
--- a/userlibandfileserver/fileserver/sfat32/inc/sl_std.inl	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/inc/sl_std.inl	Wed Sep 01 12:34:56 2010 +0100
@@ -178,14 +178,14 @@
     }
 
 
-/** @return reference to the fat table owned by the mount */
+/** @return refrence to the fat table owned by the mount */
 CFatTable& CFatMountCB::FAT() const
 	{
     return(*iFatTable);
     }
 
 /**
-    @return reference to the file system object that has produced this CFatMountCB
+    @return refrence to the file system object that has produced this CFatMountCB
 */
 CFatFileSystem& CFatMountCB::FatFileSystem() const
 	{
@@ -495,7 +495,7 @@
 /**
 Returns the fat table used by the file system for this mount
 
-@return Reference to the Fat table owned by the mount
+@return Refrence to the Fat table owned by the mount
 */
 CFatTable& CFatFileCB::FAT()
 	{return(FatMount().FAT());}
@@ -523,9 +523,9 @@
     }  
 
 void CFatFileCB::IndicateFileSizeModified(TBool aModified) 
-	{
-	iFileSizeModified = aModified;
-	}
+    {
+    iFileSizeModified = aModified;
+    }
 
 //-----------------------------------------------------------------------------
 /** @return ETrue if file attributes' 'Modified' flag is set*/
@@ -645,13 +645,23 @@
     }
 
 
+//-----------------------------------------------------------------------------
+/**
+    @return ETrue if the cluster number aClusterNo is valid, i.e. belongs to the FAT table
+*/
+inline TBool CFatTable::ClusterNumberValid(TUint32 aClusterNo) const 
+    {
+    return (aClusterNo >= KFatFirstSearchCluster) && (aClusterNo < iMaxEntries); 
+    }
+
+
 /**
 @return Maximal number of addresable FAT entries. This value is taken from the owning mount
 */
 inline TUint32 CFatTable::MaxEntries() const
     {
-        ASSERT(iMaxEntries > 0);
-        return iMaxEntries;
+    ASSERT(iMaxEntries > 0);
+    return iMaxEntries;
     }
 
 
--- a/userlibandfileserver/fileserver/sfat32/ram_fat_table32.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/ram_fat_table32.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -343,9 +343,9 @@
     Zero fill RAM area corresponding to the cluster number aCluster
     @param  aCluster a cluster number to be zero-filled
 */
-void CRamFatTable::ZeroFillCluster(TInt aCluster)
+void CRamFatTable::ZeroFillClusterL(TInt aCluster)
     {
-    TLinAddr clusterPos= I64LOW(DataPositionInBytes(aCluster));
+    TLinAddr clusterPos= I64LOW(DataPositionInBytesL(aCluster));
     Mem::FillZ(iRamDiskBase+clusterPos, 1<< iOwner->ClusterSizeLog2());     
     }
 
@@ -356,9 +356,15 @@
 @param aCluster to find location of
 @return Byte offset of the cluster data 
 */
-TInt64 CRamFatTable::DataPositionInBytes(TUint32 aCluster) const
+TInt64 CRamFatTable::DataPositionInBytesL(TUint32 aCluster) const
     {
     //__PRINT(_L("CRamFatTable::DataPositionInBytes"));
+    if(!ClusterNumberValid(aCluster))
+        {
+        __ASSERT_DEBUG(0, Fault(EFatTable_InvalidIndex));
+        User::Leave(KErrCorrupt);
+        }
+
     ReadIndirectionTable(aCluster);
     return(aCluster<<iOwner->ClusterSizeLog2());
     }
@@ -417,7 +423,7 @@
     __PRINT(_L("CRamFatTable::AllocateSingleClusterL"));
     iOwner->EnlargeL(1<<iOwner->ClusterSizeLog2()); //  First enlarge the RAM drive
     TInt fileAllocated=CFatTable::AllocateSingleClusterL(aNearestCluster); //   Now update the free cluster and fat/fit
-    ZeroFillCluster(fileAllocated);  //-- zero-fill allocated cluster 
+    ZeroFillClusterL(fileAllocated);  //-- zero-fill allocated cluster 
     return(fileAllocated);
     }   
 
@@ -458,7 +464,7 @@
         DecrementFreeClusterCount(1);
         WriteL(aCluster,freeCluster);
         aCluster=freeCluster;
-        ZeroFillCluster(freeCluster); //-- zero fill just allocated cluster (RAM area)
+        ZeroFillClusterL(freeCluster); //-- zero fill just allocated cluster (RAM area)
         }
 
     SetFreeClusterHint(aCluster); 
@@ -493,7 +499,7 @@
                 endCluster=EOF_32Bit;   // endCluster==0 -> file contained FAT loop
 
         //  Real position in bytes of the start cluster in the data area
-            TLinAddr startClusterPos=I64LOW(DataPositionInBytes(startCluster));
+            TLinAddr startClusterPos=I64LOW(DataPositionInBytesL(startCluster));
         //  Sliding value when more than one block is freed
             TLinAddr trg=startClusterPos-(totalFreed<<clusterShift);
             __PRINT1(_L("trg=0x%x"),trg);
@@ -515,7 +521,7 @@
                 __PRINT1(_L("srcEnd=0x%x"),srcEnd);
                 }
             else                        //  Just move up to the next part of the chain
-                srcEnd=I64LOW(DataPositionInBytes(endCluster));
+                srcEnd=I64LOW(DataPositionInBytesL(endCluster));
 
         //-- Copy (srcEnd-srcStart) bytes from iRamDiskBase+srcStart onto iRamDiskBase+trg
         //-- zero-filling free space to avoid leaving something important there
@@ -545,7 +551,7 @@
                 endCluster=EOF_16Bit;   // endCluster==0 -> file contained FAT loop
 
         //  Real position in bytes of the start cluster in the data area
-            TLinAddr startClusterPos=I64LOW(DataPositionInBytes(startCluster));
+            TLinAddr startClusterPos=I64LOW(DataPositionInBytesL(startCluster));
         //  Sliding value when more than one block is freed
             TLinAddr trg=startClusterPos-(totalFreed<<clusterShift);
             __PRINT1(_L("trg=0x%x"),trg);
@@ -567,7 +573,7 @@
                 __PRINT1(_L("srcEnd=0x%x"),srcEnd);
                 }
             else                        //  Just move up to the next part of the chain
-                srcEnd=I64LOW(DataPositionInBytes(endCluster));
+                srcEnd=I64LOW(DataPositionInBytesL(endCluster));
 
         //-- Copy (srcEnd-srcStart) bytes from iRamDiskBase+srcStart onto iRamDiskBase+trg
         //-- zero-filling free space to avoid leaving something important there
@@ -633,12 +639,12 @@
 	__PRINT2(_L("CRamFatTable::CountContiguousClustersL() start:%d, max:%d"),aStartCluster, aMaxCount);
 	TUint32 clusterListLen=1;
 	TUint32 endCluster=aStartCluster;
-	TInt64 endClusterPos=DataPositionInBytes(endCluster);
+	TInt64 endClusterPos=DataPositionInBytesL(endCluster);
 	while (clusterListLen<aMaxCount)
 		{
 		TInt oldCluster=endCluster;
 		TInt64 oldClusterPos=endClusterPos;
-		if (GetNextClusterL(endCluster)==EFalse || (endClusterPos=DataPositionInBytes(endCluster))!=(oldClusterPos+(1<<iOwner->ClusterSizeLog2())))
+		if (GetNextClusterL(endCluster)==EFalse || (endClusterPos=DataPositionInBytesL(endCluster))!=(oldClusterPos+(1<<iOwner->ClusterSizeLog2())))
 			{
 			endCluster=oldCluster;
 			break;
--- a/userlibandfileserver/fileserver/sfat32/sl_dir_cache.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/sl_dir_cache.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -113,7 +113,6 @@
                   iMinSizeInPages(aMinPageNum),
                   iMaxSizeInPages(aMaxPageNum),
                   iDrive(aDrive),
-				  iLastVisitedPage(NULL),
                   iLockedQ(_FOFF(TDynamicDirCachePage, iLink)),
                   iUnlockedQ(_FOFF(TDynamicDirCachePage, iLink)),
                   iLockedQCount(0),
@@ -159,19 +158,19 @@
 
 	// 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)
-    const TUint KThreadCount = 1;
-    iPermanentlyAllocatedPageCount = KThreadCount; 
+	//-- At present moment the size of TDrive thread pool is 1 (1 drive thread in a pool)
+	const TUint KThreadCount = 1;
+	iPermanentlyAllocatedPageCount = KThreadCount + 1; 
 
 	if (iPermanentlyAllocatedPageCount > iMinSizeInPages)
 		iMinSizeInPages = iPermanentlyAllocatedPageCount;
 
 	for (TUint n=0; n<iPermanentlyAllocatedPageCount; n++)
 		{
-        TDynamicDirCachePage* pPage = AllocateAndLockNewPage();
-        ASSERT(pPage);
-        if (!pPage)
-            User::Leave(KErrNoMemory);
+		TDynamicDirCachePage* pPage = AllocateAndLockNewPage(0);
+		ASSERT(pPage);
+		if (!pPage)
+			User::Leave(KErrNoMemory);
 		AddFirstOntoQueue(pPage, TDynamicDirCachePage::ELocked);
 		LookupTblAdd(pPage);
 		}
@@ -192,6 +191,42 @@
     }
 
 /**
+Insert an unlocked page into the last position of the locked queue, may squeeze the original last page into
+the unlocked queue.
+This function is used on last visited but 'unlocked' pages to avoid excessive lock/unlock calls to cache memory
+manager as contiguous entry reading/writing often happens on the same page.
+@param	aPage	the page to be inserted.
+@pre	the page type of aPage should only be TDynamicDirCachePage::EUnknown
+*/
+void CDynamicDirCache::MakePageLastLocked(TDynamicDirCachePage* aPage)
+	{
+	// this function should not be called on active pages
+	ASSERT(aPage->iType == TDynamicDirCachePage::EUnknown);
+
+	if (iLockedQ.IsEmpty())
+		{
+		// if locked queue is empty, add it onto the locked queue directly
+		AddFirstOntoQueue(aPage, TDynamicDirCachePage::ELocked);
+		}
+	else
+		{
+		// otherwise, we squeeze for the last position on locked queue
+		while (iLockedQCount + 1 >= iMinSizeInPages)
+			{
+			TDynamicDirCachePage* last = iLockedQ.Last();
+			DeQueue(last);
+			UnlockPage(last);
+			AddFirstOntoQueue(last, TDynamicDirCachePage::EUnlocked);
+			}
+
+		// iLockedQCount + 1 < iMinSizeInPages
+		iLockedQ.AddLast(*aPage);
+		aPage->SetPageType(TDynamicDirCachePage::ELocked);
+		iLockedQCount++;
+		}
+	}
+
+/**
     Read data from a single page. If the page is not found or not valid anymore, read media onto iActive page first.
     The data will be _Appended_ the the descriptor aDes. The caller is responsible for maintaining this descriptor.
 
@@ -213,19 +248,13 @@
             aDes.Append(pPage->PtrInPage(aPos), aLength);
 
 
-            // if page is from unlocked queue, try to keep it locked until we move to a 
-            //  different page from the unlocked queue 
-            // this is to avoid excessive locking and unlocking operations that is
-            //  highly likely to happen when DoFindL() linearly scan through the directory
-            if (pPage->PageType() == TDynamicDirCachePage::EUnlocked
-                && iLastVisitedPage != pPage)
-                {
-                // Note: iLastVisitedPage may have been moved from unlocked queue to locked queue
-                if(iLastVisitedPage && iLastVisitedPage->PageType() == TDynamicDirCachePage::EUnlocked)
-                    {
-                    User::LeaveIfError(UnlockPage(iLastVisitedPage));
-                    }
-                iLastVisitedPage = pPage;
+            // if page is from unlocked queue, insert it onto the last page of the locked
+            //  queue. this is to avoid excessive locking and unlocking operations that is
+            //  highly likely to happen for following reads.
+            if (pPage->PageType() == TDynamicDirCachePage::EUnlocked)
+            	{
+            	DeQueue(pPage);
+            	MakePageLastLocked(pPage);
             	}
     		}
     	else	// page locking failed
@@ -595,32 +624,23 @@
         case EDumpCache:
         	{
         	RFs fs;
-        	r = fs.Connect();
-            if(r != KErrNone)
-                break;
-
+        	fs.Connect();
         	const TUint32 debugRegister = DebugRegister();
         	fs.SetDebugRegister(debugRegister|KFSYS);
         	Dump();
         	fs.SetDebugRegister(debugRegister);
         	fs.Close();
-        	r = KErrNone;
         	break;
         	}
         case ECacheInfo:
         	{
         	RFs fs;
-        	r = fs.Connect();
-            if(r != KErrNone)
-                break;
-        	
+        	fs.Connect();
         	const TUint32 debugRegister = DebugRegister();
         	fs.SetDebugRegister(debugRegister|KFSYS);
-            TDirCacheInfo* aInfo = static_cast<TDirCacheInfo*>(aParam2);
-            Info(aInfo);
+        	Info();
         	fs.SetDebugRegister(debugRegister);
         	fs.Close();
-        	r = KErrNone;
         	break;
         	}
 
@@ -663,14 +683,14 @@
 	{
 //	__PRINT1(_L("MakePageMRU (%lx)"), aPos);
 //	__PRINT4(_L("Current Cache State: iLockedQCount=%d, iUnlockedQCount=%d, iLookupTbl=%d, iMaxSizeInPages=%d"), iLockedQCount, iUnlockedQCount, iLookupTable.Count(), iMaxSizeInPages);
-	// check there are at least one locked pages
-	ASSERT(iLockedQCount > 0);
+	// check there are at least two locked pages
+	ASSERT(iLockedQCount > 1);
 	
 	// check the MRU page first, if it is already the MRU page, we can return immediately
 	TInt64 pageStartMedPos = CalcPageStartPos(aPos);
 	if (!iLockedQ.IsEmpty())
 		{
-        if (iLockedQCount > 1 && iLockedQ.First()->StartPos() == pageStartMedPos)
+		if (iLockedQ.First()->StartPos() == pageStartMedPos)
 			{
 			return;
 			}
@@ -683,7 +703,7 @@
 		// lock page before make it MRU
 		if (pPage->PageType() == TDynamicDirCachePage::EUnlocked)
 			{
-            ASSERT(!pPage->IsLocked() || (pPage->IsLocked() && pPage == iLastVisitedPage));
+			ASSERT(!pPage->IsLocked());
 			if (LockPage(pPage) == NULL)
 				{
 				DeQueue(pPage);
@@ -699,7 +719,6 @@
 			ASSERT(LockPage(pPage) != NULL);
 			}
 		}
-
 	// if page not found or page data not valid anymore, use active page to read data
 	if (!pPage)
 		{
@@ -715,9 +734,8 @@
 	ASSERT(pPage && pPage->IsValid() && pPage->IsLocked());
 
 
-
-    TBool makeNewPageMRU = pPage == iLockedQ.Last();
-
+	// if we used the active page (last on the queue), try to grow the cache.
+	TBool growCache = pPage == iLockedQ.Last();
 
 	switch (pPage->PageType())
 		{
@@ -745,27 +763,16 @@
 			ASSERT(0);
 		}
 
-    if (!makeNewPageMRU)
-        return;
-    
-    // when cache is full and a new MRU page is about to be added, we will need to evict the LRU page
-    //  accordingly
-    if (CacheIsFull())
-        {
-        TUint32& queueCnt = iMaxSizeInPages - iMinSizeInPages > 0 ? iUnlockedQCount : iLockedQCount;
-        queueCnt++;
-        CheckThresholds();
-        queueCnt--;
-        }
+	if (CacheIsFull() || !growCache)
+		return;
 
-    // attempt to grow the cache by appending a clean, new page at the end of the locked page queue.
-    // This can fail when out of memory; the LRU mechanism then makes sure the oldest page will be re-used.
-    TDynamicDirCachePage* nPage = AllocateAndLockNewPage();
-    if (!nPage)
-        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 the new active page, force the locked queue to evict the existing last page to make room 
-    //  for the new active page 
+	// about to add a page to end of locked queue, so lie about iLockedQCount
 	iLockedQCount++;
 	CheckThresholds();
 	iLockedQCount--;
@@ -773,6 +780,7 @@
 	iLockedQ.AddLast(*nPage);
 	nPage->SetPageType(TDynamicDirCachePage::ELocked);
 	++iLockedQCount;
+	LookupTblAdd(nPage);
 	}
 
 /**
@@ -848,7 +856,7 @@
 */
 void CDynamicDirCache::CheckThresholds()
 	{
-    while (iLockedQCount > iMinSizeInPages)
+	while (iLockedQCount + 1 > iMinSizeInPages)
 		{
 		TDynamicDirCachePage* movePage = iLockedQ.Last();
 		UnlockPage(movePage);
@@ -888,67 +896,66 @@
 Try to create a new page and lock the page content when it is created. This function should only be called
 when creating iActive page or making a page MRU (which might result in page evictions).
 @return	the pointer of the newly created page, or NULL if allocation failed.
+@param	aStartMedPos	the starting media address of the page to be created.
+@pre	aStartMedPos should not already be existing in the cache.
 */
-TDynamicDirCachePage* CDynamicDirCache::AllocateAndLockNewPage(/*TInt64 aStartMedPos*/)
-    {
-    __PRINT(_L("CDynamicDirCache::AllocateAndLockNewPage()"));
+TDynamicDirCachePage* CDynamicDirCache::AllocateAndLockNewPage(TInt64 aStartMedPos)
+	{
+	__PRINT1(_L("CDynamicDirCache::AllocateAndLockNewPage(aStartMedPos=%lx)"), aStartMedPos);
 
-    TUint8* startRamAddr = iCacheMemoryClient->AllocateAndLockSegments(PageSizeInSegs());
-
-    if (!startRamAddr)
-        return NULL;
+	TUint8* startRamAddr = iCacheMemoryClient->AllocateAndLockSegments(PageSizeInSegs());
 
-    TDynamicDirCachePage* pPage = TDynamicDirCachePage::CreateCachePage(this, 0, 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)
-        {
-        iCacheMemoryClient->DecommitSegments(startRamAddr, PageSizeInSegs());
-        return NULL;
-        }
+	// 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)
+		{
+		iCacheMemoryClient->DecommitSegments(startRamAddr, PageSizeInSegs());
+		return NULL;
+		}
 
 	pPage->SetLocked(ETrue);
 	pPage->SetValid(EFalse);
 	return pPage;
 	}
 
-#if defined(_DEBUG) || defined(_DEBUG_RELEASE)
+
+#ifdef _DEBUG
 /**
 Dump cache information, only enabled in debug mode.
 @see CDynamicDirCache::Control()
 */
-void CDynamicDirCache::Info(TDirCacheInfo* aInfo) const
-    {
-    __PRINT(_L("======== CDynamicDirCache::Info ========="));
-    const TUint32 SegmentSizeInBytesLog2 = CCacheMemoryManagerFactory::CacheMemoryManager()->SegmentSizeInBytesLog2();
-    const TUint32 pageMemSizeLog2 = iPageSizeLog2 > SegmentSizeInBytesLog2 ? iPageSizeLog2 : SegmentSizeInBytesLog2;
-    // page size
-    __PRINT1(_L("=== Segment size:             [%d Bytes]"), 1 << SegmentSizeInBytesLog2);
-    __PRINT1(_L("=== Page data size:           [%d Bytes]"), iPageSizeInBytes);
-    __PRINT1(_L("=== Page mem size:            [%d Bytes]"), 1 << pageMemSizeLog2);
+void CDynamicDirCache::Info() const
+	{
+	__PRINT(_L("======== CDynamicDirCache::Info ========="));
+	const TUint32 SegmentSizeInBytesLog2 = CCacheMemoryManagerFactory::CacheMemoryManager()->SegmentSizeInBytesLog2();
+	// page size
+	__PRINT1(_L("=== Pages size:               [%d Bytes]"), iPageSizeInBytes);
+	__PRINT1(_L("=== Segment size:             [%d Bytes]"), 1 << SegmentSizeInBytesLog2);
 
-    // cache size in pages
-    __PRINT1(_L("=== Min cache size in pages:  [%d]"), iMinSizeInPages);
-    __PRINT1(_L("=== Max cache size in pages:  [%d]"), iMaxSizeInPages);
+	// data size:
+	__PRINT1(_L("=== Min data size:            [%d Bytes]"), iMinSizeInPages << iPageSizeLog2);
+	__PRINT1(_L("=== Max data size:            [%d Bytes]"), iMaxSizeInPages << iPageSizeLog2);
 
-    // locked page num
-    __PRINT1(_L("=== Number of pages locked:   [%d]"), iLockedQCount);
-    // unlocked page num
-    __PRINT1(_L("=== Number of pages unlocked: [%d]"), iUnlockedQCount);
-    __PRINT(_L("=========================================\n"));
-    
-    ASSERT(aInfo);
-    aInfo->iMemorySegmentSize       = 1 << SegmentSizeInBytesLog2;
-    aInfo->iPageSizeInMemory        = PageSizeInSegs() << SegmentSizeInBytesLog2;
-    aInfo->iPageSizeInData          = iPageSizeInBytes;
-    aInfo->iMinCacheSizeInPages     = iMinSizeInPages;
-    aInfo->iMaxCacheSizeInPages     = iMaxSizeInPages;
-    aInfo->iMinCacheSizeInMemory    = iMinSizeInPages * aInfo->iPageSizeInMemory;
-    aInfo->iMaxCacheSizeInMemory    = iMaxSizeInPages * aInfo->iPageSizeInMemory;
-    aInfo->iLockedPageNumber        = iLockedQCount;
-    aInfo->iUnlockedPageNumber      = iUnlockedQCount;
-    }
+	// memory size:
+	const TUint32 pageMemSizeLog2 = iPageSizeLog2 > SegmentSizeInBytesLog2 ? iPageSizeLog2 : SegmentSizeInBytesLog2;
+	__PRINT1(_L("=== Min memory size:          [%d Bytes]"), iMinSizeInPages << pageMemSizeLog2);
+	__PRINT1(_L("=== Max memory size:          [%d Bytes]"), iMaxSizeInPages << pageMemSizeLog2);
+
+	// reserved pages
+	__PRINT1(_L("=== Number of pages reserved: [%d]"), iMinSizeInPages);
+	__PRINT1(_L("=== Reserved memory:          [%d Bytes]"), (iMinSizeInPages * PageSizeInSegs()) << SegmentSizeInBytesLog2);
+	// locked page num
+	__PRINT1(_L("=== Number of pages locked:   [%d]"), iLockedQCount);
+	__PRINT1(_L("=== Locked memory:            [%d Bytes]"), (iLockedQCount * PageSizeInSegs()) << SegmentSizeInBytesLog2);
+	// unlocked page num
+	__PRINT1(_L("=== Number of pages unlocked: [%d]"), iUnlockedQCount);
+	__PRINT1(_L("=== Unlocked memory:          [%d Bytes]"), (iUnlockedQCount * PageSizeInSegs()) << SegmentSizeInBytesLog2);
+	}
 
 /**
 Dump cache content, only enabled in debug mode.
@@ -998,7 +1005,7 @@
         }
     __PRINT(_L("===========================================\n"));
     }
-#endif //#if defined(_DEBUG) || defined(_DEBUG_RELEASE)
+#endif //_DEBUG
 
 /**
 Lock an unlocked page, or do nothing if the page is already locked.
@@ -1030,17 +1037,14 @@
 	{
 	ASSERT(aPage != NULL);
 	__PRINT1(_L("CDynamicDirCache::UnlockPage(%lx)"), aPage->StartPos());
-    if (aPage)
-        {
-		TInt r = iCacheMemoryClient->UnlockSegments(aPage->StartPtr(), PageSizeInSegs());
-		if (r == KErrNone)
-			{
-			aPage->SetLocked(EFalse);
-			}
-		return r;
+	TInt r = iCacheMemoryClient->UnlockSegments(aPage->StartPtr(), PageSizeInSegs());
+	if (r == KErrNone)
+		{
+		aPage->SetLocked(EFalse);
 		}
-    return KErrArgument;
-    }
+	return r;
+	}
+
 /**
 Decommit a locked or unlocked page.
 @return	TInt	KErrNone if decommition was successful, otherwise system-wide error code.
--- a/userlibandfileserver/fileserver/sfat32/sl_dir_cache.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/sl_dir_cache.h	Wed Sep 01 12:34:56 2010 +0100
@@ -27,7 +27,6 @@
 #include "sf_memory_client.h"
 #include "sl_cache.h"
 #include <e32hashtab.h>
-#include <f32dbg.h>
 
 //---------------------------------------------------------------------------------------------------------------------------------
 class 	CDynamicDirCache;
@@ -133,11 +132,9 @@
 	
 	TUint32 PageSizeInSegs() const;
 
-#if defined(_DEBUG) || defined(_DEBUG_RELEASE)
     // Debugging functions
 	void Dump();
-	void Info(TDirCacheInfo* aInfo) const;
-#endif //#if defined(_DEBUG) || defined(_DEBUG_RELEASE)
+	void Info() const;
 
 protected:
 	CDynamicDirCache(TDriveInterface& aDrive, TUint32 aMinSizeInBytes, TUint32 aMaxSizeInBytes, TUint32 aPageSizeInBytesLog2, TUint32 aWrGranularityLog2);
@@ -148,7 +145,7 @@
 
 	TDynamicDirCachePage* FindPageByPos(TInt64 aPos);
 	TDynamicDirCachePage* UpdateActivePageL(TInt64 aPos);
-	TDynamicDirCachePage* AllocateAndLockNewPage(/*TInt64 aStartMedPos*/);
+	TDynamicDirCachePage* AllocateAndLockNewPage(TInt64 aStartMedPos);
 	TUint8* LockPage(TDynamicDirCachePage* aPage);
 	TInt 	UnlockPage(TDynamicDirCachePage* aPage);
 	TInt 	DecommitPage(TDynamicDirCachePage* aPage);
@@ -162,6 +159,7 @@
 	TInt LookupTblAdd(TDynamicDirCachePage* aPage);
 	TDynamicDirCachePage* LookupTblFind(TInt64 aPos);
 	TInt ResetPagePos(TDynamicDirCachePage* aPage);
+	void MakePageLastLocked(TDynamicDirCachePage* aPage);
 	void DoMakePageMRU(TInt64 aPos);
 	void DoInvalidateCache(void);
 	
@@ -179,9 +177,6 @@
 	TDriveInterface&    iDrive;        		///< reference to the driver for media access
 	TUint32             iCacheDisabled : 1; ///< if not 0 the cache is disabled totally and all reads and writes go via TDriveInterface directly
 
-	TDynamicDirCachePage* iLastVisitedPage; ///< a pointer to the last visited page, we always keep it locked
-                                            ///<  to avoid excessive lock/unlock activities when we are scanning
-                                            ///<  a page on the UnlockedQueue
 	
 	// data structures for LRU page list	
 	TCachePageList 	iLockedQ;				///< the locked queue that manages all locked pages, limited by minimum page number
--- a/userlibandfileserver/fileserver/sfat32/sl_dir_cache.inl	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/sl_dir_cache.inl	Wed Sep 01 12:34:56 2010 +0100
@@ -194,7 +194,7 @@
 TBool CDynamicDirCache::CacheIsFull() const
 	{
 	// active page, locked page and unlocked page
-	return (iLockedQCount + iUnlockedQCount >= iMaxSizeInPages);
+	return (iLockedQCount + iUnlockedQCount + 1 >= iMaxSizeInPages);
 	}
 
 /**
--- a/userlibandfileserver/fileserver/sfat32/sl_disk.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/sl_disk.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -293,6 +293,7 @@
 	User::LeaveIfError(iDrive.ReadNonCritical(aPos,aLength,aTrg,aMessage,anOffset, aFlag));
 	}
 
+
 //-------------------------------------------------------------------------------------
 
 /**
@@ -326,6 +327,7 @@
 
 	}
 
+
 //-------------------------------------------------------------------------------------
 
 /** Get information for last disk error */
@@ -453,6 +455,7 @@
 	aMessage.WriteL(0,buf,anOffset);
 	}
 
+	
 //-------------------------------------------------------------------------------------
 //
 // Write from thread relative descriptor into ramDrive
@@ -475,20 +478,3 @@
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
--- a/userlibandfileserver/fileserver/sfat32/sl_drv.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/sl_drv.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -46,12 +46,13 @@
     Close the interface to the media driver
 */
 void TDriveInterface::Close()
-{	 
+{
 	 if((iMount != NULL) && (iMount->LocalDrive() != NULL))
 		{
 		ASSERT(iMount->LocalDrive()->Mount() == NULL || iMount->LocalDrive()->Mount() == iMount);
 		iMount->LocalDrive()->SetMount(NULL);
-		}
+        }
+
      iMount = NULL;
 }
 
@@ -550,7 +551,7 @@
     LeaveCriticalSection();
     return nRes;
 }
-       
+
 TInt TDriveInterface::XProxyDriveWrapper::Read(TInt64 aPos,TInt aLength,TDes8& aTrg) const
 {
     EnterCriticalSection();
--- a/userlibandfileserver/fileserver/sfat32/sl_fatcache32.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/sl_fatcache32.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -699,7 +699,6 @@
 
 /**
     Writes FAT cache page sector to the media (to all copies of the FAT)
-
     @param  aSector page sector number
 */
 void CFat32LruCachePage::DoWriteSectorL(TUint32 aSector)
--- a/userlibandfileserver/fileserver/sfat32/sl_file.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/sl_file.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -11,7 +11,7 @@
 // Contributors:
 //
 // Description:
-// f32\sfat32\sl_file.cpp
+// f32\sfat\sl_file.cpp
 // 
 //
 
@@ -24,13 +24,13 @@
 const TInt KFirstClusterNum=2;
 
 CFatFileCB::CFatFileCB()
-    {
-    __PRINT1(_L("CFatFileCB created 0x%x"),this);
-    }
+	{
+	__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()
@@ -42,125 +42,125 @@
             {
             IndicateFileTimeModified(ETrue); //-- this will force writing file modification time to the media on Flush
             TRAP_IGNORE(FlushAllL());
-            }
+	        }
         }
 
     delete[] iSeekIndex;
-    }
+	}
 
 
 void CFatFileCB::CreateSeekIndex()
 //
 // Create a seek index
 //
-    {
+	{
 
-    iSeekIndex = new TUint32[KSeekIndexSize];
-    if (iSeekIndex == NULL)
-        return;
+	iSeekIndex = new TUint32[KSeekIndexSize];
+	if (iSeekIndex == NULL)
+		return;
 
-    Mem::FillZ(iSeekIndex, sizeof(TUint32) * KSeekIndexSize);
+	Mem::FillZ(iSeekIndex, sizeof(TUint32) * KSeekIndexSize);
 
-    iSeekIndexSize=CalcSeekIndexSize(FCB_FileSize());
-    }
+	iSeekIndexSize=CalcSeekIndexSize(FCB_FileSize());
+	}
 
 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
 //
-    {
-    TInt clusterOffset=aClusterOffset;
-    TInt seekPos=(aNewRelCluster>>iSeekIndexSize)-1;
-    __ASSERT_DEBUG(seekPos<KSeekIndexSize,Fault(EFatFileSeekIndexTooSmall));
+	{
+	TInt clusterOffset=aClusterOffset;
+	TInt seekPos=(aNewRelCluster>>iSeekIndexSize)-1;
+	__ASSERT_DEBUG(seekPos<KSeekIndexSize,Fault(EFatFileSeekIndexTooSmall));
 
-    while(seekPos>=0 && iSeekIndex[seekPos]==0 && clusterOffset!=0)
-        {
-        seekPos--;
-        clusterOffset--;
-        }
-    if (clusterOffset==0) // Counted back to the current cluster
-        return(aClusterOffset);
-    if (seekPos<0)
-        {
-        iCurrentPos.iCluster=FCB_StartCluster();
-        return(aNewRelCluster);
-        }
+	while(seekPos>=0 && iSeekIndex[seekPos]==0 && clusterOffset!=0)
+		{
+		seekPos--;
+		clusterOffset--;
+		}
+	if (clusterOffset==0) // Counted back to the current cluster
+		return(aClusterOffset);
+	if (seekPos<0)
+		{
+		iCurrentPos.iCluster=FCB_StartCluster();
+		return(aNewRelCluster);
+		}
 
-    iCurrentPos.iCluster=iSeekIndex[seekPos];
-    return(aNewRelCluster-((seekPos+1)<<iSeekIndexSize));
-    }
+	iCurrentPos.iCluster=iSeekIndex[seekPos];
+	return(aNewRelCluster-((seekPos+1)<<iSeekIndexSize));
+	}
 
 void CFatFileCB::SetSeekIndexValueL(TUint aRelCluster, TUint aStoredCluster)
 //
 // Sets a value in the seekindex
 //
-    {
+	{
 
-    TInt seekPos=(aRelCluster>>iSeekIndexSize)-1;
-    __ASSERT_DEBUG(seekPos<KSeekIndexSize,Fault(EFatFileSeekIndexTooSmall));
-    __ASSERT_DEBUG(seekPos>=0,Fault(EFatFileSeekIndexTooSmall2));
-    iSeekIndex[seekPos] = aStoredCluster;
-    }
+	TInt seekPos=(aRelCluster>>iSeekIndexSize)-1;
+	__ASSERT_DEBUG(seekPos<KSeekIndexSize,Fault(EFatFileSeekIndexTooSmall));
+	__ASSERT_DEBUG(seekPos>=0,Fault(EFatFileSeekIndexTooSmall2));
+	iSeekIndex[seekPos] = aStoredCluster;
+	}
 
 void CFatFileCB::CheckPosL(TUint aPos)
 //
 // Check that the file is positioned correctly.
 // If aPos<currentPos attempt to guess the new position.
 //
-    {
-    __PRINT1(_L("CFatFileCB::CheckPosL(%d)"), aPos);
-    if (aPos==iCurrentPos.iPos)
-        return;
+	{
+	__PRINT1(_L("CFatFileCB::CheckPosL(%d)"), aPos);
+	if (aPos==iCurrentPos.iPos)
+		return;
     __ASSERT_DEBUG(aPos <= FCB_FileSize(), Fault(EFatFilePosBeyondEnd));
 
-    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;
-    TUint32 oldCluster=iCurrentPos.iCluster;
+	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;
+	TUint32 oldCluster=iCurrentPos.iCluster;
 
-    iCurrentPos.iPos=aPos;
-    if (clusterOffset==0)
-        return;
-    TInt seekOffset=clusterOffset;
-    if (iSeekIndex!=NULL)
-        { // Can alter iCurrentPos.iCluster
-        seekOffset=SeekToPosition(newRelCluster,seekOffset);
-        if (seekOffset==0)
-            return;
-        }
-    if (clusterOffset==-1 && seekOffset!=1)
-        { // Check previous cluster
-        TUint32 cluster=oldCluster-1;
-        if (FAT().GetNextClusterL(cluster) && cluster==oldCluster)
-            {
+	iCurrentPos.iPos=aPos;
+	if (clusterOffset==0)
+		return;
+	TInt seekOffset=clusterOffset;
+	if (iSeekIndex!=NULL)
+		{ // Can alter iCurrentPos.iCluster
+		seekOffset=SeekToPosition(newRelCluster,seekOffset);
+		if (seekOffset==0)
+			return;
+		}
+	if (clusterOffset==-1 && seekOffset!=1)
+		{ // Check previous cluster
+		TUint32 cluster=oldCluster-1;
+		if (FAT().GetNextClusterL(cluster) && cluster==oldCluster)
+			{
             iCurrentPos.iCluster=oldCluster-1;
-            return;
-            }
-        }
-    if (seekOffset<0)
-        {
-        seekOffset=newRelCluster;
-        iCurrentPos.iCluster=FCB_StartCluster();
-        }
-    while (seekOffset--)
-        {
+			return;
+			}
+		}
+	if (seekOffset<0)
+		{
+		seekOffset=newRelCluster;
+		iCurrentPos.iCluster=FCB_StartCluster();
+		}
+	while (seekOffset--)
+		{
         if (!FAT().GetNextClusterL(iCurrentPos.iCluster))
             {
             __PRINT(_L("CFatFileCB::CheckPosL() corrupt#1"));
             User::Leave(KErrCorrupt);
             }
         TInt cluster=newRelCluster-seekOffset;
-        if (iSeekIndex!=NULL && cluster && (cluster>>iSeekIndexSize)<<iSeekIndexSize==cluster)
-            SetSeekIndexValueL(cluster,iCurrentPos.iCluster);
-        }
-    }
+		if (iSeekIndex!=NULL && cluster && (cluster>>iSeekIndexSize)<<iSeekIndexSize==cluster)
+			SetSeekIndexValueL(cluster,iCurrentPos.iCluster);
+		}
+	}
 
 //-----------------------------------------------------------------------------
 /** 
@@ -170,21 +170,21 @@
     @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);
-    
+	{
+	__PRINT1(_L("CFatFileCB::SetupL[0x%x]"), this);
+	
 
     //-- set up a file control block
-    iCurrentPos.iCluster= FatMount().StartCluster(aFatDirEntry);
-    iCurrentPos.iPos=0;
-    
+	iCurrentPos.iCluster= FatMount().StartCluster(aFatDirEntry);
+	iCurrentPos.iPos=0;
+	
     SetAtt(aFatDirEntry.Attributes());
-    SetModified(aFatDirEntry.Time(FatMount().TimeOffset()));
+	SetModified(aFatDirEntry.Time(FatMount().TimeOffset()));
     
     FCB_SetStartCluster(iCurrentPos.iCluster);
     FCB_SetFileSize(aFatDirEntry.Size()); 
 
-    iFileDosEntryPos = aFileDosEntryPos;
+	iFileDosEntryPos = aFileDosEntryPos;
 
     SetMaxSupportedSize(KMaxSupportedFatFileSize);
 
@@ -198,7 +198,7 @@
     IndicateFileAttModified(EFalse);
     IndicateFileSizeModified(EFalse);
     IndicateFileTimeModified(EFalse);
-    }
+	}
 
 //-----------------------------------------------------------------------------
 /**
@@ -214,22 +214,22 @@
 
 */
 void CFatFileCB::ReadL(TInt64 aPos,TInt& aLength, TDes8* aDes, const RMessagePtr2& aMessage, TInt aOffset)
-    {
-    __PRINT3(_L("CFatFileCB::ReadL[0x%x] pos=%LU len=%d"), this, 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
 
     FatMount().CheckStateConsistentL();
     
-    CheckPosL(I64LOW(aPos));
-    
-    const TUint startPos = iCurrentPos.iPos;
-    const TUint curSize  = FCB_FileSize();
-    const TUint length   = (TUint)aLength;
-    
-    if((startPos + length > curSize) || (startPos > startPos + length) )
-        aLength=curSize-startPos;
+	CheckPosL(I64LOW(aPos));
+	
+	const TUint startPos = iCurrentPos.iPos;
+	const TUint curSize  = FCB_FileSize();
+	const TUint length   = (TUint)aLength;
+	
+	if((startPos + length > curSize) || (startPos > startPos + length) )
+		aLength=curSize-startPos;
 		
 	TUint flag = DirectIOMode(aMessage) ? RLocalDrive::ELocDrvDirectIO : 0;
 	
@@ -239,9 +239,9 @@
 
 
 void CFatFileCB::ReadL(TInt aFilePos,TInt& aLength,const TAny* aTrg,const RMessagePtr2& aMessage)
-    {
-    ReadL(TInt64(aFilePos),aLength,(TDes8*) aTrg,aMessage, 0);
-    }
+	{
+	ReadL(TInt64(aFilePos),aLength,(TDes8*) aTrg,aMessage, 0);
+	}
 
 //-----------------------------------------------------------------------------
 /**
@@ -257,117 +257,118 @@
 
 */
 void CFatFileCB::WriteL(TInt64 aPos,TInt& aLength,const TDesC8* aSrc,const RMessagePtr2& aMessage, TInt aOffset)
-    {
-    __PRINT3(_L("CFatFileCB::WriteL[0x%x] pos=%LU len=%d"), this, 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)
-        User::Leave(KErrNotSupported);
-    
+	// FAT supports 32 bits only for file size
+   	TUint64 endPos = aPos + aLength;
+   	if(endPos > KMaxSupportedFatFileSize)
+   		User::Leave(KErrNotSupported);
+   	
     FatMount().CheckStateConsistentL();
     FatMount().CheckWritableL();
     const TUint pos = I64LOW(aPos);
-    CheckPosL(pos);
-    
-    const TUint startCluster = FCB_StartCluster();
-    const TUint length       = (TUint)aLength;
-    
-    endPos = iCurrentPos.iPos + length; 
-    if ((endPos           > FCB_FileSize()) ||
-        (iCurrentPos.iPos > endPos)         ) // Overflow condition 
-        DoSetSizeL(iCurrentPos.iPos+length,EFalse);
-    
-    TUint startPos=iCurrentPos.iPos;
-    TUint badcluster=0;
-    TUint goodcluster=0;
+  	CheckPosL(pos);
+  	
+	const TUint startCluster = FCB_StartCluster();
+	const TUint length       = (TUint)aLength;
+	
+	endPos = iCurrentPos.iPos + length; 
+	if ((endPos           > FCB_FileSize()) ||
+	    (iCurrentPos.iPos > endPos)         ) // Overflow condition 
+		DoSetSizeL(iCurrentPos.iPos+length,EFalse);
+   	
+	TUint startPos=iCurrentPos.iPos;
+	TUint badcluster=0;
+	TUint goodcluster=0;
    	
 	TUint flag = DirectIOMode(aMessage) ? RLocalDrive::ELocDrvDirectIO : 0;
 	
 	TRAPD(ret, FatMount().WriteToClusterListL(iCurrentPos,aLength,aSrc,aMessage,aOffset,badcluster, goodcluster, flag));
    	
-    if (ret == KErrCorrupt || ret == KErrDied)
-        {
+	if (ret == KErrCorrupt || ret == KErrDied)
+		{
         if(startCluster == 0)
-            { //Empty File, revert all the clusters allocated.
-            const TUint32 cluster = FCB_StartCluster();
-            FCB_SetStartCluster(0);
-            FCB_SetFileSize(0);
-            IndicateFileSizeModified(ETrue);
+			{ //Empty File, revert all the clusters allocated.
+			const TUint32 cluster = FCB_StartCluster();
+			FCB_SetStartCluster(0);
+			FCB_SetFileSize(0);
+			IndicateFileSizeModified(ETrue);
             
-            FlushAllL();
+			FlushAllL();
 
-            iCurrentPos.iCluster = 0;
-            iCurrentPos.iPos = 0;
+			iCurrentPos.iCluster = 0;
+			iCurrentPos.iPos = 0;
 
-            FAT().FreeClusterListL(cluster);
-            FAT().FlushL();
-            }
-        else
-            { //Calculate the clusters required based on file size, revert extra clusters if allocated.
-            const TUint curSize = FCB_FileSize();
-            TUint ClustersNeeded = curSize >> ClusterSizeLog2();
-            if(curSize > (ClustersNeeded << ClusterSizeLog2()))
-                {
-                ClustersNeeded++;
-                }
+			FAT().FreeClusterListL(cluster);
+			FAT().FlushL();
+			}
+		else
+			{ //Calculate the clusters required based on file size, revert extra clusters if allocated.
+			const TUint curSize = FCB_FileSize();
+			TUint ClustersNeeded = curSize >> ClusterSizeLog2();
+			if(curSize > (ClustersNeeded << ClusterSizeLog2()))
+				{
+				ClustersNeeded++;
+				}
 
-            TUint32 cluster = FCB_StartCluster();
-            while(--ClustersNeeded)
-                {
-                FAT().GetNextClusterL(cluster);
-                }
+			TUint32 cluster = FCB_StartCluster();
+			while(--ClustersNeeded)
+				{
+				FAT().GetNextClusterL(cluster);
+				}
                 
-            iCurrentPos.iCluster = cluster;
+			iCurrentPos.iCluster = cluster;
 
-            if (FAT().GetNextClusterL(cluster))
-                {
-                FAT().FreeClusterListL(cluster);
-                }
+			if (FAT().GetNextClusterL(cluster))
+				{
+				FAT().FreeClusterListL(cluster);
+				}
 
-            FAT().WriteFatEntryEofL(iCurrentPos.iCluster);
-            FAT().FlushL();
-            }
-        }
+			FAT().WriteFatEntryEofL(iCurrentPos.iCluster);
+			FAT().FlushL();
+			}
+		}
 
-    User::LeaveIfError(ret);
+	User::LeaveIfError(ret);
 
-    if(badcluster != 0)
-        {
-        if(FCB_StartCluster() == badcluster)
-            {
+	if(badcluster != 0)
+		{
+		if(FCB_StartCluster() == badcluster)
+			{
             FCB_SetStartCluster(goodcluster);
-            FlushStartClusterL();
-            }
-        else
-            {
-            TUint32 aCluster = FCB_StartCluster();
-            do
-                {
+			FlushStartClusterL();
+			}
+		else
+			{
+			TUint32 aCluster = FCB_StartCluster();
+			do
+				{
                 if((TUint)badcluster == FAT().ReadL(aCluster))
-                    {
-                    FAT().WriteL(aCluster, goodcluster);
-                    FAT().FlushL();
-                    break;
-                    }
-                }
-            while(FAT().GetNextClusterL(aCluster));
-            }
-        }
-    aLength=iCurrentPos.iPos-startPos;
+					{
+					FAT().WriteL(aCluster, goodcluster);
+					FAT().FlushL();
+					break;
+					}
+				}
+			while(FAT().GetNextClusterL(aCluster));
+			}
+		}
+	aLength=iCurrentPos.iPos-startPos;
 
-    if(!IsSequentialMode() && FatMount().IsRuggedFSys() && pos+(TUint)aLength > FCB_FileSize())
-        {
-        WriteFileSizeL(pos+aLength);
-        }
+	if(FatMount().IsRuggedFSys() && pos+(TUint)aLength > FCB_FileSize())
+		{
+		WriteFileSizeL(pos+aLength);
+		}
 
-    }
+	}
 
 
 void CFatFileCB::WriteL(TInt aFilePos,TInt& aLength,const TAny* aSrc,const RMessagePtr2& aMessage)
-    {
-    WriteL(TInt64(aFilePos),aLength,(TDesC8*) aSrc,aMessage, 0);
-    }
+	{
+	WriteL(TInt64(aFilePos),aLength,(TDesC8*) aSrc,aMessage, 0);
+	}
+
 
 
 //-----------------------------------------------------------------------------
@@ -377,58 +378,58 @@
 // Resize the seek index to accomodate a larger or smaller filesize
 // Assumes KSeekIndexSize is a power of 2.
 //
-    {
+	{
 
-    TInt maxNewIndex=aNewSize>>(ClusterSizeLog2()+aNewMult);
+	TInt maxNewIndex=aNewSize>>(ClusterSizeLog2()+aNewMult);
 
 
-    TInt    index=0;
-    TInt    indexEnd=KSeekIndexSize;
-    TInt    newValEnd=maxNewIndex;
+	TInt    index=0;
+	TInt	indexEnd=KSeekIndexSize;
+	TInt	newValEnd=maxNewIndex;
 
-    if (iSeekIndexSize<aNewMult)
-        {
-        TInt newVal=index;
-        TInt step=1<<(aNewMult-iSeekIndexSize);
-        index+=step-1;
-        while(index<indexEnd && newVal<newValEnd)
-            {
-            iSeekIndex[newVal] =  iSeekIndex[index];
-            newVal++;
-            index+=step;
-            }
-        while(newVal<indexEnd)
-            iSeekIndex[newVal++] =  0;
-        }
-    else
-        {
-        TInt diffSize = iSeekIndexSize-aNewMult;
-        TInt oldVal=(KSeekIndexSize>>diffSize) - 1;
-        TInt newVal=indexEnd-1;
-        TInt skip=(1<<diffSize)-1;
+	if (iSeekIndexSize<aNewMult)
+		{
+		TInt newVal=index;
+		TInt step=1<<(aNewMult-iSeekIndexSize);
+		index+=step-1;
+		while(index<indexEnd && newVal<newValEnd)
+			{
+			iSeekIndex[newVal] =  iSeekIndex[index];
+			newVal++;
+			index+=step;
+			}
+		while(newVal<indexEnd)
+			iSeekIndex[newVal++] =  0;
+		}
+	else
+		{
+		TInt diffSize = iSeekIndexSize-aNewMult;
+		TInt oldVal=(KSeekIndexSize>>diffSize) - 1;
+		TInt newVal=indexEnd-1;
+		TInt skip=(1<<diffSize)-1;
 
-        if ((iSeekIndexSize - aNewMult) > KSeekIndexSizeLog2)
-            {
+		if ((iSeekIndexSize - aNewMult) > KSeekIndexSizeLog2)
+			{
             ClearIndex(0); //-- Invalidate every entry.
-            }
-        else
-            {
-            while(newVal>=index)
-                {
+			}
+		else
+			{
+			while(newVal>=index)
+				{
 
-                iSeekIndex[newVal--] =  iSeekIndex[oldVal--];
+				iSeekIndex[newVal--] =  iSeekIndex[oldVal--];
 
 
-                for(TInt i=skip;i>0;i--)
-                    {   
-                    iSeekIndex[newVal--] = 0;
+				for(TInt i=skip;i>0;i--)
+					{	
+					iSeekIndex[newVal--] = 0;
 
-                    }
-                }
-            }
-        }
-    iSeekIndexSize=aNewMult;
-    }
+					}
+				}
+			}
+		}
+	iSeekIndexSize=aNewMult;
+	}
 
 
 /**
@@ -438,44 +439,44 @@
             if = 0  all existing index will be zero filled
 */ 
 void CFatFileCB::ClearIndex(TUint aNewSize)
-    {
+	{
 
-    if (!iSeekIndex)
-        return;
+	if (!iSeekIndex)
+	    return;
 
     if(aNewSize==0)
-        {
-        //-- zero fill all the array
+    	{
+    	//-- zero fill all the array
         Mem::FillZ(iSeekIndex, KSeekIndexSize*sizeof(TUint32));
-        return;
-        }
+		return;
+    	}
 
-    // Files that fill up a cluster exactly do not have a trailing empty
-    // cluster. So the entry for that position must also be invalidated
-    aNewSize--;
-    TInt firstInvalidIndex=aNewSize>>(iSeekIndexSize+ClusterSizeLog2());
-        
-    TInt indexLen=KSeekIndexSize-firstInvalidIndex;
+	// Files that fill up a cluster exactly do not have a trailing empty
+	// cluster. So the entry for that position must also be invalidated
+	aNewSize--;
+	TInt firstInvalidIndex=aNewSize>>(iSeekIndexSize+ClusterSizeLog2());
+		
+	TInt indexLen=KSeekIndexSize-firstInvalidIndex;
 
-    Mem::FillZ(iSeekIndex+firstInvalidIndex, indexLen * sizeof(TUint32));
-    }
+	Mem::FillZ(iSeekIndex+firstInvalidIndex, indexLen * sizeof(TUint32));
+	}
 
 TInt CFatFileCB::CalcSeekIndexSize(TUint aSize)
 //
 // Find the nearest power of 2 > aSize
 //
-    {
-    TInt count = 0;
-    const TUint indexSize=KSeekIndexSize<<ClusterSizeLog2();//KSeekIndexSize=128
-    if (aSize<=indexSize)
-      return(count);
-    
-    while((aSize>>=1)>0)
-        {
-        count++;
-        }
-    return (count - (KSeekIndexSizeLog2 + ClusterSizeLog2()) + 1);
-    }
+	{
+	TInt count = 0;
+	const TUint indexSize=KSeekIndexSize<<ClusterSizeLog2();//KSeekIndexSize=128
+	if (aSize<=indexSize)
+	  return(count);
+	
+	while((aSize>>=1)>0)
+		{
+		count++;
+		}
+	return (count - (KSeekIndexSizeLog2 + ClusterSizeLog2()) + 1);
+	}
 
 //-----------------------------------------------------------------------------
 /**
@@ -483,21 +484,21 @@
     @param aSize new file size.
 */
 void CFatFileCB::SetSizeL(TInt64 aSize)
-    {
-    __PRINT2(_L("CFatFileCB::SetSizeL[0x%x] sz=%LU"), this, aSize);
-    
-    //-- max. file size for FAT is 4GB-1
-    if (I64HIGH(aSize))
-        User::Leave(KErrNotSupported);
+	{
+	__PRINT2(_L("CFatFileCB::SetSizeL[0x%x] sz=%LU"), this, aSize);
+	
+	//-- max. file size for FAT is 4GB-1
+	if (I64HIGH(aSize))
+		User::Leave(KErrNotSupported);
 
     DoSetSizeL(I64LOW(aSize), FatMount().IsRuggedFSys());
-    }
+	}
 
 
 void CFatFileCB::SetSizeL(TInt aSize)
-    {
-    SetSizeL(TInt64(aSize));
-    }
+	{
+	SetSizeL(TInt64(aSize));
+	}
 
 //-----------------------------------------------------------------------------
 /**
@@ -505,22 +506,22 @@
 */
 void CFatFileCB::DoShrinkFileToZeroSizeL()
     {
-        ASSERT(FCB_FileSize());
+	    ASSERT(FCB_FileSize());
         ASSERT(FileSizeModified());
         
-        ClearIndex(0); // Clear seek index array
-        
+            ClearIndex(0); //-- clear seek index array
+		
         //-- update file dir. entry
         const TUint32 cluster = FCB_StartCluster();
-        FCB_SetStartCluster(0);
-        FCB_SetFileSize(0);
-            FlushAllL();
-        
+		FCB_SetStartCluster(0);
+		FCB_SetFileSize(0);
+			FlushAllL();
+		
         //-- free cluster list. 
-            CheckPosL(0);
-            FAT().FreeClusterListL(cluster);
-            FAT().FlushL();
-            }
+			CheckPosL(0);
+			FAT().FreeClusterListL(cluster);
+			FAT().FlushL();
+			}
 
 //-----------------------------------------------------------------------------
 /*
@@ -530,36 +531,35 @@
     @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)       
+	
+    if(aForceCachesFlush)		
         WriteFileSizeL(aNewSize); //-- write file size directly to its dir. entry
 
-    CheckPosL(aNewSize);
-
+	CheckPosL(aNewSize);
+	
     TUint32 cluster=iCurrentPos.iCluster;
-    
-    if (FAT().GetNextClusterL(cluster))
-        {//-- truncate the cluster chain
-        FAT().WriteFatEntryEofL(iCurrentPos.iCluster);
-        FAT().FreeClusterListL(cluster);
-        }
-        
+		if (FAT().GetNextClusterL(cluster))
+	    {//-- truncate the cluster chain
+			FAT().WriteFatEntryEofL(iCurrentPos.iCluster);
+			FAT().FreeClusterListL(cluster);
+			}
+		
     ClearIndex(aNewSize);
-    FAT().FlushL();
-    }
-    
+		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());
 
@@ -567,41 +567,41 @@
     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)
+	//-- 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();
+		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);
+		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(!IsSequentialMode() && aForceCachesFlush)    // Write file size directly to its dir. entry if a cache flush
-            WriteFileSizeL(aNewSize);               // is needed and rugged FAT is not ignored by client
-        }
+		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);
+		}
 
-    }
+	}
 
 //-----------------------------------------------------------------------------
 /**
@@ -611,18 +611,18 @@
                                 it is used in Rugged FAT mode.
 */
 void CFatFileCB::DoSetSizeL(TUint aSize, TBool aForceCachesFlush)
-    {
-    __PRINT4(_L("CFatFileCB::DoSetSizeL[0x%x] sz:%d, oldSz:%d, flush:%d"), this, aSize, FCB_FileSize(), aForceCachesFlush);
+	{
+	__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,FCB_StartCluster())) > 0)
-        User::Leave(KErrInUse);
-    
-    if(aSize == FCB_FileSize())
+	
+	// Can not change the file size if it is clamped
+	if(Mount().IsFileClamped(MAKE_TINT64(0,FCB_StartCluster())) > 0)
+		User::Leave(KErrInUse);
+	
+	if(aSize == FCB_FileSize())
         return;
 
     IndicateFileSizeModified(ETrue);
@@ -641,18 +641,18 @@
         }
 
     //-------------------------------------------
-    //-- shrinking file to non-zero size
+	//-- shrinking file to non-zero size
     if (aSize < FCB_FileSize())
-        {
+		{
         DoShrinkFileL(aSize, aForceCachesFlush);
         return;
         }
     
     //-------------------------------------------
-    //-- expanding a file
+	//-- expanding a file
     DoExpandFileL(aSize, aForceCachesFlush);
 
-    }
+	}
 
 //-----------------------------------------------------------------------------
 /**
@@ -666,8 +666,8 @@
 
 */
 void CFatFileCB::SetEntryL(const TTime& aTime,TUint aSetAttMask,TUint aClearAttMask)
-    {
-    __PRINT1(_L("CFatFileCB::SetEntryL[0x%x]"), this);
+	{
+	__PRINT1(_L("CFatFileCB::SetEntryL[0x%x]"), this);
     
     FatMount().CheckStateConsistentL();
     FatMount().CheckWritableL();
@@ -696,7 +696,7 @@
         IndicateFileTimeModified(ETrue); //-- this will force writing file mod. time to the media on Flush
         }
 
-    }
+	}
 
 
 //-----------------------------------------------------------------------------
@@ -704,39 +704,39 @@
     The same as FlushAllL(). This method is called from RFile::Flush()
 */
 void CFatFileCB::FlushDataL()
-    {
-    __PRINT1(_L("CFatFileCB::FlushDataL[0x%x]"), this);
+	{
+	__PRINT1(_L("CFatFileCB::FlushDataL[0x%x]"), this);
     FlushAllL();
-    }
+	}
 
 //-----------------------------------------------------------------------------
 /** 
     Flush the fide directory entry data: files size, attributes, time etc. 
 */
 void 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);
+	__PRINT1(_L("CFatFileCB::FlushAllL[0x%x]"), this);
 
     if (Mount().IsCurrentMount()==EFalse)
-        User::Leave(KErrDisMounted);
+		User::Leave(KErrDisMounted);
 
     FatMount().CheckStateConsistentL();
     FatMount().CheckWritableL();
 
-    if(!FileSizeModified() && !FileAttModified() && !FileTimeModified())
+	if(!FileSizeModified() && !FileAttModified() && !FileTimeModified())
         return; //-- nothing has changed in the file entry at all
 
 
     //-- read file dir. entry
-    TFatDirEntry entry;
-    FatMount().ReadDirEntryL(iFileDosEntryPos,entry);
-    __ASSERT_ALWAYS(entry.IsEndOfDirectory()==EFalse,User::Leave(KErrCorrupt));
+	TFatDirEntry entry;
+	FatMount().ReadDirEntryL(iFileDosEntryPos,entry);
+	__ASSERT_ALWAYS(entry.IsEndOfDirectory()==EFalse,User::Leave(KErrCorrupt));
 
     //-- 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
@@ -767,35 +767,35 @@
 
     if(bUpdateDirEntry)
         {//-- write entry to the media
-        __PRINT(_L("  CFatFileCB::FlushAllL #1"));
+	    __PRINT(_L("  CFatFileCB::FlushAllL #1"));
         entry.SetAttributes(Att() & KEntryAttMaskSupported);
-        entry.SetSize(FCB_FileSize());
-        entry.SetTime(iModified, timeOffset);
-        
+	    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
-			}
+	if(setNotify)
+		{
+		FatMount().SetNotifyOff();	// do not launch a notifier
+		}
 
-			TRAPD(ret, FatMount().WriteDirEntryL(iFileDosEntryPos,entry));
-		
-		if(setNotify)
-			{
-			FatMount().SetNotifyOn();
-			}
+	    TRAPD(ret, FatMount().WriteDirEntryL(iFileDosEntryPos,entry));
+	
+	if(setNotify)
+		{
+		FatMount().SetNotifyOn();
+		}
 
-		User::LeaveIfError(ret);
+	User::LeaveIfError(ret);
 
-		IndicateFileSizeModified(EFalse);
-		IndicateFileTimeModified(EFalse);
+        IndicateFileSizeModified(EFalse);
+        IndicateFileTimeModified(EFalse);
 	    }
 
 
-    //-- KEntryAttModified must be reset anyway
-    IndicateFileAttModified(EFalse); 
+        //-- KEntryAttModified must be reset anyway
+        IndicateFileAttModified(EFalse); 
 	}
 
 //-----------------------------------------------------------------------------
@@ -805,7 +805,7 @@
     @param  aNewName new file name; all trailing dots from the name will be removed
 */
 void CFatFileCB::RenameL(const TDesC& aNewName)
-    {
+	{
     __PRINT2(_L("CFatFileCB::RenameL[0x%x], name:%S"),this, &aNewName);
 
     FatMount().CheckStateConsistentL();
@@ -814,97 +814,105 @@
     const TPtrC fileName = RemoveTrailingDots(aNewName); //-- remove trailing dots from the name
 
 
-    FatMount().DoRenameOrReplaceL(*iFileName, fileName, CFatMountCB::EModeRename, iFileDosEntryPos);
-    
+	FatMount().DoRenameOrReplaceL(*iFileName, fileName, CFatMountCB::EModeRename, iFileDosEntryPos);
+	
     AllocBufferL(iFileName, fileName);
-    
-    if(!FatMount().IsRuggedFSys())
-        FAT().FlushL();
-    }
+	
+	if(!FatMount().IsRuggedFSys())
+		FAT().FlushL();
+	}
 
 
 //***********************************************************
 //* BlockMap interface
 //***********************************************************
-    
+	
 TInt CFatFileCB::BlockMap(SBlockMapInfo& aInfo, TInt64& aStartPos, TInt64 aEndPos)
 //
 // Retrieves the block map of a given section of the file, in the FAT file system.
-//  
-    {
-    __PRINT2(_L("CFatFileCB::BlockMap aStartPos=%ld aEndPos=%ld"), aStartPos, aEndPos);
-    
-    if ( I64HIGH(aStartPos) || I64HIGH(aEndPos) )
-        return KErrNotSupported;
+//	
+	{
+	__PRINT2(_L("CFatFileCB::BlockMap aStartPos=%ld aEndPos=%ld"), aStartPos, aEndPos);
+	
+	if ( I64HIGH(aStartPos) || I64HIGH(aEndPos) )
+		return KErrNotSupported;
 
     TUint startPos = I64LOW(aStartPos);
-    TUint endPos = I64LOW(aEndPos);
+	TUint endPos = I64LOW(aEndPos);
 
-    // aEndPos will always be >=0 at this point
-    const TUint length = endPos - startPos;
-    
-    // Store the position of cluster zero in aInfo
-    CFatMountCB& fatMount = FatMount();
+	// aEndPos will always be >=0 at this point
+	const TUint length = endPos - startPos;
+	
+	// Store the position of cluster zero in aInfo
+	CFatMountCB& fatMount = FatMount();
 
-    TInt drvNo=-1;
-    TBusLocalDrive* locDrv;
-    if((fatMount.LocalDrive()->GetLocalDrive(locDrv)==KErrNone) && ((drvNo=GetLocalDriveNumber(locDrv))>=0) && (drvNo<KMaxLocalDrives))
-        aInfo.iLocalDriveNumber=drvNo;
-    else
-        return KErrNotSupported;
+	TInt drvNo=-1;
+	TBusLocalDrive* locDrv;
+	if((fatMount.LocalDrive()->GetLocalDrive(locDrv)==KErrNone) && ((drvNo=GetLocalDriveNumber(locDrv))>=0) && (drvNo<KMaxLocalDrives))
+		aInfo.iLocalDriveNumber=drvNo;
+	else
+		return KErrNotSupported;
 
+    TInt r;
+	
     // Fetch the address of cluster 0
-    aInfo.iStartBlockAddress = fatMount.FAT().DataPositionInBytes(KFirstClusterNum);
+	TRAP(r, aInfo.iStartBlockAddress = fatMount.FAT().DataPositionInBytesL(KFirstClusterNum));
+	if (r != KErrNone)
+		return r;
 
-    TRAPD(r, CheckPosL(startPos));
-    if (r != KErrNone)
-        return r;
+
+	TRAP(r, CheckPosL(startPos));
+	if (r != KErrNone)
+		return r;
 
-    aInfo.iBlockStartOffset = fatMount.ClusterRelativePos(iCurrentPos.iPos);
-    aInfo.iBlockGranularity = 1 << FatMount().ClusterSizeLog2();
-    const TUint myStartPos = iCurrentPos.iPos;
-    if ( myStartPos + length > FCB_FileSize())
-        return KErrArgument;
+	aInfo.iBlockStartOffset = fatMount.ClusterRelativePos(iCurrentPos.iPos);
+	aInfo.iBlockGranularity = 1 << FatMount().ClusterSizeLog2();
+	const TUint myStartPos = iCurrentPos.iPos;
+	if ( myStartPos + length > FCB_FileSize())
+		return KErrArgument;
 
-    TRAP(r, FatMount().BlockMapReadFromClusterListL(iCurrentPos, length, aInfo));
-    if (r != KErrNone)
-        return r;
+	TRAP(r, FatMount().BlockMapReadFromClusterListL(iCurrentPos, length, aInfo));
+	if (r != KErrNone)
+		return r;
 
-    aStartPos = iCurrentPos.iPos;
-    if ((I64LOW(aStartPos) == FCB_FileSize()) || ( I64LOW(aStartPos) == (myStartPos + length)))
-        return KErrCompletion;
-    else
-        return KErrNone;
-    }
+	aStartPos = iCurrentPos.iPos;
+	if ((I64LOW(aStartPos) == FCB_FileSize()) || ( I64LOW(aStartPos) == (myStartPos + length)))
+		return KErrCompletion;
+	else
+		return KErrNone;
+	}
+
 
 
 TInt CFatFileCB::GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput)
-    {
-    switch(aInterfaceId)
-        {
-        case EExtendedFileInterface:
-            ((CFileCB::MExtendedFileInterface*&) aInterface) = this;
-            return KErrNone;
+	{
+	switch(aInterfaceId)
+		{
+		case EExtendedFileInterface:
+			((CFileCB::MExtendedFileInterface*&) aInterface) = this;
+			return KErrNone;
 
-        case EBlockMapInterface:
-            aInterface = (CFileCB::MBlockMapInterface*) this;
-            return KErrNone;
+		case EBlockMapInterface:
+			aInterface = (CFileCB::MBlockMapInterface*) this;
+			return KErrNone;
+
+		case EGetLocalDrive:
+			return FatMount().LocalDrive()->GetLocalDrive((TBusLocalDrive*&) aInterface);
 
-        case EGetLocalDrive:
-            return FatMount().LocalDrive()->GetLocalDrive((TBusLocalDrive*&) aInterface);
+		default:
+			return CFileCB::GetInterface(aInterfaceId,aInterface,aInput);
+		}
+	}
 
-        default:
-            return CFileCB::GetInterface(aInterfaceId,aInterface,aInput);
-        }
-    }
+
 
 
 /**
     Overwrites file's start cluster (iStartCluster) in its directory entry.
 */
 void CFatFileCB::FlushStartClusterL()
-    {
-    __PRINT1(_L("CFatFileCB::FlushStartClusterL[0x%x]"), this);
+	{
+	__PRINT1(_L("CFatFileCB::FlushStartClusterL[0x%x]"), this);
 
     CFatMountCB& mount = FatMount();
     TFatDirEntry dirEntry;
@@ -912,15 +920,15 @@
     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);
+	{
+	__PRINT2(_L("CFatFileCB::WriteFileSizeL[0x%x], sz:%d"), this, aSize);
 
     CFatMountCB& mount = FatMount();
     TFatDirEntry dirEntry;
--- a/userlibandfileserver/fileserver/sfat32/sl_leafdir_cache.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/sl_leafdir_cache.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -974,10 +974,7 @@
 	{
 	RPointerArray<CLeafDirTreeNode>* nodeStack = new(ELeave) RPointerArray<CLeafDirTreeNode>(4);
 	RFs fs;
-	
-    TInt nRes = fs.Connect();
-    User::LeaveIfError(nRes);
-
+	fs.Connect();
 	const TUint32 debugRegister = DebugRegister();
 	fs.SetDebugRegister(debugRegister|KFSYS);
 	if (iRoot != NULL)
--- a/userlibandfileserver/fileserver/sfat32/sl_mnt.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/sl_mnt.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -26,7 +26,6 @@
 #include "sl_dir_cache.h"
 #include "sl_scandrv.h"
 #include <hal.h>
-#include <f32dbg.h>
 
 TShortName DoGenerateShortNameL(const TDesC& aLongName,TInt& aNum,TBool aUseTildeSelectively);
 
@@ -551,8 +550,10 @@
         return;
         }
 
-    if(Locked())
-        {//-- can't finalise the volume if it has opened disk access objects, like Format or RawAccess
+    if(LockStatus() != 0)
+        {//-- can't finalise the volume if it has opened objects and not in the consistent state.
+         //-- Theoretically, we can finalise the mount if we have files opened only for read, but at present,
+         //-- it's impossible to detect such situation.
         User::Leave(KErrInUse);
         }
 
@@ -611,23 +612,10 @@
 */
 TBool CFatMountCB::VolCleanFlagSupported() const
     {
-    const TFatType fatType=FatType();
-
-    ASSERT(fatType == EFat12 || fatType == EFat16 || fatType == EFat32);
-    return (fatType != EFat12);
-    }
-
-
-//-----------------------------------------------------------------------------------------
-/**
-    @return Volume size in bytes according to the number of usable clusters.
-    This approach is not applicable to RAM drive, because its size isn't fixed and can be adjusted by the system.
-*/
-TUint64 CFatMountCB::VolumeSizeInBytes() const
-    {
-    ASSERT(ConsistentState());
-    ASSERT(!iRamDrive);
-    return ((TUint64)UsableClusters()) << ClusterSizeLog2();
+        const TFatType fatType=FatType();
+
+        ASSERT(fatType == EFat12 || fatType == EFat16 || fatType == EFat32);
+        return (fatType != EFat12);
     }
 
 //-----------------------------------------------------------------------------------------
@@ -692,21 +680,16 @@
 
 
     const TUint32 freeClusters = FAT().NumberOfFreeClusters(bSyncOp);
-    aVolume.iFree = (TInt64)freeClusters << ClusterSizeLog2();
+
     __PRINT1(_L("CFatMountCB::VolumeL() free clusters:%d"), freeClusters);
 
-
-    if(drvInfo.iType==EMediaRam)
-        {//-- a special case. RAM drive size is variable and adjustable. It should be calculated from aVolume.iFree and CMountCB::iFree
-        ASSERT(iRamDrive);
+    aVolume.iFree = (TInt64)freeClusters << ClusterSizeLog2();
+
+    if (drvInfo.iType==EMediaRam)
         aVolume.iSize=aVolume.iFree+iSize;
-        aVolume.iSize-=ClusterBasePosition(); // Allow for bytes used by FAT etc
-        aVolume.iSize=(aVolume.iSize >> ClusterSizeLog2()) << ClusterSizeLog2();  //-- round down to cluster size
-        }
-    else
-        {//-- normal case; the volume size is determined by amount of usable clusters
-        aVolume.iSize = VolumeSizeInBytes();
-        }
+
+    aVolume.iSize-=ClusterBasePosition(); // Allow for bytes used by FAT etc
+    aVolume.iSize=(aVolume.iSize >> ClusterSizeLog2()) << ClusterSizeLog2();  //-- round down to cluster size
 
     }
 
@@ -1639,7 +1622,7 @@
     const TInt maxClusters=((aLength+clusterRelativePos-1)>>ClusterSizeLog2())+1;
     const TInt clusterListLen=FAT().CountContiguousClustersL(aPos.iCluster,endCluster,maxClusters);
     const TInt writeLength=Min(aLength,(clusterListLen<<ClusterSizeLog2())-clusterRelativePos);
-    TInt64 dataStart=FAT().DataPositionInBytes(aPos.iCluster)+clusterRelativePos;
+    TInt64 dataStart=FAT().DataPositionInBytesL(aPos.iCluster)+clusterRelativePos;
 
     TRAPD(r, iRawDisk->WriteL(dataStart,writeLength,aSrc,aMessage,anOffset, aFlag));
 
@@ -1670,7 +1653,7 @@
         if((aPos.iPos != 0) && (badcluster == aPos.iCluster) && (aLastcluster == 0) && (aPos.iCluster == cluster))
             { //Copy the contents already present in this cluster to new cluster allocated.
             const TInt sizeToRead = aPos.iPos - ((aPos.iPos >> ClusterSizeLog2()) << ClusterSizeLog2());
-            dataStart = FAT().DataPositionInBytes(aPos.iCluster) + ClusterRelativePos((aPos.iPos - sizeToRead));
+            dataStart = FAT().DataPositionInBytesL(aPos.iCluster) + ClusterRelativePos((aPos.iPos - sizeToRead));
 
 
             //-- Allocate the buffer required to copy the contents from bad cluster
@@ -1699,7 +1682,7 @@
                 {
                 //Calculate and copy the contents to new cluster.
                 aPos.iCluster = goodcluster;
-                dataStart = FAT().DataPositionInBytes(aPos.iCluster) + ClusterRelativePos(aPos.iPos - sizeToRead);
+                dataStart = FAT().DataPositionInBytesL(aPos.iCluster) + ClusterRelativePos(aPos.iPos - sizeToRead);
 
                 r = LocalDrive()->Write(dataStart, clustBuf);
                 if(r == KErrNone)
@@ -1807,7 +1790,7 @@
     const TInt maxClusters=((aLength+clusterRelativePos-1)>>ClusterSizeLog2())+1;
     const TInt clusterListLen=FAT().CountContiguousClustersL(aPos.iCluster,endCluster,maxClusters);
     const TInt readLength=Min(aLength,(clusterListLen<<ClusterSizeLog2())-clusterRelativePos);
-    const TInt64 dataStart=FAT().DataPositionInBytes(aPos.iCluster)+clusterRelativePos;
+    const TInt64 dataStart=FAT().DataPositionInBytesL(aPos.iCluster)+clusterRelativePos;
 
     TRAPD(r, iRawDisk->ReadL(dataStart,readLength,aTrg,aMessage,anOffset, aFlag));
 
@@ -3171,7 +3154,7 @@
         User::Leave(KErrCorrupt);
 
     TBuf8<sizeof(TCheckedUid)> uidBuf;
-    iRawDisk->ReadCachedL(FAT().DataPositionInBytes(aCluster),sizeof(TCheckedUid),uidBuf);
+    iRawDisk->ReadCachedL(FAT().DataPositionInBytesL(aCluster),sizeof(TCheckedUid),uidBuf);
     __ASSERT_DEBUG(uidBuf.Length()==sizeof(TCheckedUid),Fault(EFatReadUidFailed));
     TCheckedUid uid(uidBuf);
     anEntry.iType=uid.UidType();
@@ -3247,7 +3230,7 @@
 			//  Read the remaining length or the entire cluster block whichever is smaller
 			TInt readLength = Min(aLength-readTotal,(clusterListLen<<ClusterSizeLog2())-pos);
 			__ASSERT_DEBUG(readLength>0,Fault(EReadFileSectionFailed));
-			TInt64 dataAddress=(FAT().DataPositionInBytes(cluster))+pos;
+			TInt64 dataAddress=(FAT().DataPositionInBytesL(cluster))+pos;
 			iRawDisk->ReadL(dataAddress,readLength,aTrg,aMessage,readTotal, 0);
 			readTotal += readLength;
 
@@ -3451,7 +3434,7 @@
     if (!IsRootDir(aPos))
         {
         TInt relPos=ClusterRelativePos(aPos.iPos);
-        return FAT().DataPositionInBytes(aPos.iCluster)+relPos;
+        return FAT().DataPositionInBytesL(aPos.iCluster)+relPos;
         }
     if (aPos.iPos+StartOfRootDirInBytes()>=RootDirEnd())
         User::Leave(KErrDirFull); // Past last root dir entry
@@ -3643,36 +3626,23 @@
 		case EDisableFATDirCache:
 			{
 		    MWTCacheInterface* pDirCache = iRawDisk->DirCacheInterface();
-		    TUint32 KEDisableFATDirCache = MWTCacheInterface::EDisableCache;
+		    TUint32 KEDisableFATDirCache = CDynamicDirCache::EDisableCache;
 		    pDirCache->Control(KEDisableFATDirCache, (TUint32) aParam1, NULL);
 			break;
 			}
 		case EDumpFATDirCache:
 			{
 		    MWTCacheInterface* pDirCache = iRawDisk->DirCacheInterface();
-		    if (pDirCache)
-		        {
-	            TUint32 KEDumpFATDirCache = MWTCacheInterface::EDumpCache;
-	            pDirCache->Control(KEDumpFATDirCache, 0, NULL);
-		        }
+		    TUint32 KEDumpFATDirCache = CDynamicDirCache::EDumpCache;
+		    pDirCache->Control(KEDumpFATDirCache, 0, NULL);
 			break;
 			}
 		case EFATDirCacheInfo:
 			{
-			MWTCacheInterface* pDCache = iRawDisk->DirCacheInterface();
-		    if (pDCache)
-		        {
-	            TUint32 KEFATDirCacheInfo = MWTCacheInterface::ECacheInfo;
-	            TDirCacheInfo aInfo;
-	            TInt r = pDCache->Control(KEFATDirCacheInfo, 0, static_cast<TAny*>(&aInfo));
-	            if (r == KErrNone)
-	                {
-	                TPckgBuf<TDirCacheInfo> pkgBuf(aInfo);
-	                r = aMessage.Write(2,pkgBuf);
-	                }
-                return r;
-		        }
-		    return KErrNotSupported;
+		    MWTCacheInterface* pDirCache = iRawDisk->DirCacheInterface();
+		    TUint32 KEFATDirCacheInfo = CDynamicDirCache::ECacheInfo;
+		    pDirCache->Control(KEFATDirCacheInfo, 0, NULL);
+			break;
 			}
 
 
@@ -4100,7 +4070,7 @@
             User::LeaveIfError(r);
         if ( caps().iType&EMediaRam )
             {
-            realPosition = FAT().DataPositionInBytes( aPos.iCluster );
+            realPosition = FAT().DataPositionInBytesL( aPos.iCluster );
             aPos.iCluster = I64LOW((realPosition - aInfo.iStartBlockAddress)>>ClusterSizeLog2());
             blockMapEntry.SetStartBlock( aPos.iCluster );
             }
@@ -4213,7 +4183,7 @@
     if(bProblemsFound && chkDskRes == CScanDrive::ENoErrors)
         {//-- ScanDrive in this mode can leave unexpectedly without setting an error code that is returned by ProblemsDiscovered();
          //-- leave itself means a problem
-        chkDskRes = nScnDrvRes == KErrNone ? CScanDrive::EUnknownError : (CScanDrive::TGenericError) nScnDrvRes;
+        chkDskRes = CScanDrive::EUnknownError;
         }
 
     delete pScnDrv;
@@ -4293,7 +4263,7 @@
     TInt nRes;
 
     if(LockStatus()!=0)
-        {//-- can't run if the volume has opened objects, like files, directories, formats etc.
+        {
 		__PRINT(_L("CFatMountCB::ScanDrive() locked!\n"));
         return KErrInUse;
         }
--- a/userlibandfileserver/fileserver/sfat32/sl_mnt32.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/sl_mnt32.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -218,8 +218,8 @@
 void CFatMountCB::SetVolumeCleanL(TBool aClean) 
     {
 
-	//-- The volume can't be set clean if there are disk access objects opened on it. This precondition must be checked before calling this function
-    if(aClean && Locked())
+	//-- The volume can't be set clean if there are objects opened on it. This precondition must be checked before calling this function
+    if(aClean && LockStatus()!=0)
         {
         __PRINT1(_L("#- CFatMountCB::SetVolumeCleanL drive:%d isn't free!"),DriveNumber());
         ASSERT(0);
@@ -892,12 +892,8 @@
     if(aLevel == EMountVolParamQuery)
         {
         ASSERT(ConsistentState()); //-- volume state shall be consistent, otherwise its parameters do not make sense
-
-		// Ram Drives calculate their total / free space based on querying HAL parameters
-		// in ::VolumeL(). To make all interfaces return consistent results, we need to force
-		// a fallback to that for RAM drives.
-		if (iRamDrive)
-			return (KErrNotSupported);
+		if(iRamDrive)
+			return KErrNotSupported; //-- it requires knowledge of free space on the volume
 
         switch(aOption)
             {
@@ -935,7 +931,12 @@
             case ESQ_MountedVolumeSize:
                 {
                 TUint64* pVal = (TUint64*)aParam; 
-                *pVal = VolumeSizeInBytes();
+                *pVal = iSize; //-- physical drive size
+
+                //-- take into account space occupied by FAT table, etc.
+                *pVal -= ClusterBasePosition(); 
+                *pVal=(*pVal >> ClusterSizeLog2()) << ClusterSizeLog2();  //-- round down to cluster size
+
                 __PRINT1(_L("MountControl() MountedVolumeSize:%LU"), *pVal);
                 return KErrNone;
                 }
@@ -1067,7 +1068,7 @@
 			//  Read the remaining length or the entire cluster block whichever is smaller
 			TInt readLength = (TInt)Min((TInt64)(aLength-readTotal),(clusterListLen<<ClusterSizeLog2())-pos);
 			__ASSERT_DEBUG(readLength>0,Fault(EReadFileSectionFailed));
-			TInt64 dataAddress=(FAT().DataPositionInBytes(cluster))+pos;
+			TInt64 dataAddress=(FAT().DataPositionInBytesL(cluster))+pos;
 			iRawDisk->ReadL(dataAddress,readLength,aTrg,aMessage,readTotal, 0);
 			readTotal += readLength;
 
--- a/userlibandfileserver/fileserver/sfat32/sl_scan32.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/sl_scan32.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -72,11 +72,10 @@
     ASSERT(aMount);
 
     //--- setting up 
-	iMount			 = aMount;
-	iGenericError	 = ENoErrors;
-	iDirError		 = ENoDirError;
-	iHangingClusters = 0;
-	iMaxClusters	 = iMount->UsableClusters()+KFatFirstSearchCluster; //-- UsableClusters() doesn't count first 2 unused clusers
+    iMount=aMount;
+    iGenericError = ENoErrors;
+    iDirError     = ENoDirError;  
+    iMaxClusters  = iMount->UsableClusters()+KFatFirstSearchCluster; //-- UsableClusters() doesn't count first 2 unused clusers
     //------------------------------
 	
     //-- create bit vectors that will represent FAT on media and reconstructed by ScanDrive. Each bit in the vector represents 1 FAT cluster.
@@ -110,7 +109,7 @@
         const TUint32 nFatEntry = ReadFatL(i);
        
         //-- each '1' bit represents a used cluster 
-        if(nFatEntry != KSpareCluster)
+        if(nFatEntry != KSpareCluster) 
             iMediaFatBits.SetBit(i);
 	    }
     }
@@ -126,7 +125,7 @@
     ASSERT((aBuf.Size() & (sizeof(TFat32Entry)-1)) == 0);
     
     const TInt KNumEntries = aBuf.Size() >> KFat32EntrySzLog2;
-    const TFat32Entry* const pFatEntry = (const TFat32Entry*)(aBuf.Ptr());
+    const TFat32Entry* const pFatEntry = (const TFat32Entry*)(aBuf.Ptr()); 
 
     for(TInt i=0; i<KNumEntries; ++i)
         {
@@ -162,11 +161,11 @@
 
     iMediaFatBits.Fill(0);
 
-    RBuf8 fatParseBuf;
-    CleanupClosePushL(fatParseBuf);
+    RBuf8 buf;
+    CleanupClosePushL(buf);
 
     //-- allocate memory for FAT parse buffer
-    fatParseBuf.CreateMaxL(KFatBufSz);
+    buf.CreateMaxL(KFatBufSz);
 
     //-- read FAT directly from the media into the large buffer and parse it
     TUint32 rem = KFatSize;
@@ -176,10 +175,10 @@
     while(rem)
         {
         const TUint32 bytesToRead=Min(rem, KFatBufSz);
-        TPtrC8 ptrData(fatParseBuf.Ptr(), bytesToRead);
+        TPtrC8 ptrData(buf.Ptr(), bytesToRead);
 
         //-- read portion of the FAT into buffer
-        User::LeaveIfError(iMount->LocalDrive()->Read(mediaPos, bytesToRead, fatParseBuf)); 
+        User::LeaveIfError(iMount->LocalDrive()->Read(mediaPos, bytesToRead, buf)); 
 
         //-- parse the buffer and populate bit vector
         DoParseFat32Buf(ptrData, currFatEntry);
@@ -188,8 +187,8 @@
         rem -= bytesToRead;
         }
 
-    fatParseBuf.Close();
-    CleanupStack::PopAndDestroy(&fatParseBuf); 
+    buf.Close();
+    CleanupStack::PopAndDestroy(&buf); 
     }
 
 
@@ -242,7 +241,7 @@
 }
 
 /**
-    Sets the flag indicating that there are errors in filesystem structure
+    Sets the flag indicating than there are errors in filesystem structure
     See ProblemsDiscovered()
 
     @param  aError a code describing the error
@@ -301,6 +300,7 @@
 
 	PrintErrors();
 
+
     timeEnd.UniversalTime(); //-- take end time
     const TInt elapsedTime = (TInt)( (timeEnd.MicroSecondsFrom(timeStart)).Int64() / K1mSec);
     (void)elapsedTime;
@@ -478,7 +478,7 @@
 	{
 	CheckDirL(iMount->RootIndicator());
 	// Due to recursive nature of CheckDirL when a depth of
-	// KMaxScanDepth is reached, clusters are stored in a list
+	// KMaxScanDepth is reached clusters are stored in a list
 	// and passed into CheckDirL afresh
 
 	for(TUint i=0;i<KMaxArrayDepth && iClusterListArray[i]!=NULL;++i)
@@ -518,7 +518,7 @@
 
 	TEntryPos entryPos(aCluster,0);
 	TInt dirEntries=0;
-	for(;;)
+	FOREVER
 		{
 		TFatDirEntry entry;
 		ReadDirEntryL(entryPos,entry);
@@ -660,11 +660,11 @@
 		{
         if(IsClusterUsedL(aCluster))
 			{//-- this cluster already seems to belong to some other object; crosslinked cluster chain. Can't fix it.
-            __PRINT1(_L("CScanDrive::RecordClusterChainL #1 %d"),aCluster); 
+                __PRINT1(_L("CScanDrive::RecordClusterChainL #1 %d"),aCluster); 
             
             if(CheckDiskMode())
-                {//-- in check disk mode this is an FS error; Indicate error and abort further scanning
-                __PRINT(_L("CScanDrive::RecordClusterChainL #1.1"));
+                {//-- in check disk mode this is a FS error; Indicate error and abort furter scanning
+                __PRINT(_L("CScanDrive::RecordClusterChainL #1.1")); 
                 IndicateErrorsFound(EClusterAlreadyInUse);
                 User::Leave(KErrCorrupt);
                 }
@@ -687,26 +687,16 @@
         if(clusterCount==1)
 			{//-- we have reached the end of the cluster chain
 			if(!iMount->IsEndOfClusterCh(ReadFatL(aCluster)))
-				{
-				// According to the directory entry, we have reached the end of the cluster chain,
-				// whereas in the media FAT, it is not.
-				// This is a rugged FAT artefact; hanging cluster chain:
-				// 	A cluster chain which is longer in the FAT table than is recorded in the corresponding directory entry 
-				// 	or not terminated by an EOC entry in FAT.
-				// This is caused by:
-				//  - File truncation failing.
-				//	- OR file expanding failing during flushing to the media FAT.
+				{//-- 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())
-                    {//-- in check disk mode this is an FS error; Indicate error and abort further scanning
-                    __PRINT1(_L("CScanDrive::RecordClusterChainL #2 Hanging cluster=%d"),aCluster);
+                    {//-- in check disk mode this is a FS error; Indicate error and abort furter scanning
+                    __PRINT1(_L("CScanDrive::RecordClusterChainL #2 %d"),aCluster); 
                     IndicateErrorsFound(EInvalidEntrySize);
                     User::Leave(KErrCorrupt);
                     }
-				
-				// The chain will be truncated to the size recorded in the file's DOS entry and
-				// the remaining lost cluster chain will be fixed later in CompareAndFixFatsL().
-				FixHangingClusterChainL(aCluster);
                 }
 
             //__PRINT1(_L("#--: %d -> EOC"), aCluster); 
@@ -773,8 +763,8 @@
         if(!IsValidVFatEntry(aEntry,toFollow))
 			return(EFalse);
 		}
-	// A sequence of VFat entries must end with a Dos entry to be valid.
-	return(IsDosEntry(aEntry));
+	
+    return(IsDosEntry(aEntry));
 	}
 
 //----------------------------------------------------------------------------------------------------
@@ -855,7 +845,7 @@
 
 //----------------------------------------------------------------------------------------------------
 /**
-    Scan for differences in the new and old FAT table writing them to media if discovered
+    Scan for differnces in the new and old FAT table writing them to media if discovered
     It is supposed to be called in 'ScanDrive' mode only
 
     @leave System wide error codes
@@ -895,10 +885,9 @@
                     continue;
                     }
          
-                //-- Here we found a lost cluster. Its FAT entry will be replaced with KSpareCluster.
-                //-- In the case of multiple lost clusters FAT table will be flushed on media sector basis.
-                //-- It is much faster than flushing FAT after every write and will guarantee
-                //-- that FAT won't be corrupted if the media driver provides atomic sector write. 
+                //-- here we found a lost cluster. Its FAT entry will be replaced with KSpareCluster. In the case of multiple lost clusters FAT table will
+                //-- be flushed on media sector basis. It is much faster than flushing FAT after every write and will
+                //-- guarantee that FAT won't be corrupted if the media driver provides atomic sector write. 
                 if(nClustersFixed == 0)
                     {//-- this is the first lost cluster entry we found
                     
@@ -913,7 +902,7 @@
                     const TUint32 fatSec = iMount->FAT().PosInBytes(i) >> KSectorSzLog2; 
 
                     if(fatSec != dirtyFatSector)
-                        {//-- we are going to write to a different media sector
+                        {//-- we are going to write to a differrent media sector
                         iMount->FAT().FlushL();
                         iMount->FAT().WriteL(i, KSpareCluster); //-- fix lost cluster
                         dirtyFatSector = fatSec;
@@ -939,11 +928,18 @@
     
     //------
 
-	
-	// Add the number of hanging clusters fixed by ScanDrive
-	nClustersFixed += iHangingClusters;
+    if(iTruncationCluster != 0)
+        {
+	    iMount->FAT().WriteFatEntryEofL(iTruncationCluster); 
+		iMount->FAT().FlushL();
+		
+        //-- indicate that there are some problems in FAT. and we probably wrote something there.
+        IndicateErrorsFound(EScanDriveDirError); //-- indicate that we have found errors
+
+        ++nClustersFixed;
+        }
     
-    __PRINT3(_L("CScanDrive::WriteNewFatsL() fixed clusters=%d,hanging clusters=%d,bad clusters=%d"),nClustersFixed,iHangingClusters,nBadClusters);
+    __PRINT2(_L("CScanDrive::WriteNewFatsL() fixed:%d, bad:%d"), nClustersFixed, nBadClusters);
     }
 
 //----------------------------------------------------------------------------------------------------
@@ -1019,28 +1015,6 @@
 
 //----------------------------------------------------------------------------------------------------
 /**
-	Fix a hanging cluster chain.
-	Writes EOF to the corresponding FAT entry, making this cluster chain length correspond to the 
-	real file size recorded in the directory entry.
-	The remainder of the chain will be cleaned up later in CompareAndFixFatsL().
-	
-	@leave	System wide error code
-*/
-void CScanDrive::FixHangingClusterChainL(TUint32 aFatEofIndex)
-	{
-	__PRINT1(_L("CScanDrive::FixHangingClusterL() Hanging cluster=%d"), aFatEofIndex);
-	
-	iMount->FAT().WriteFatEntryEofL(aFatEofIndex);
-	iMount->FAT().FlushL();
-	iHangingClusters++;
-	
-	// Indicate that we have found an error
-	IndicateErrorsFound(EScanDriveDirError);
-	}
-
-
-//----------------------------------------------------------------------------------------------------
-/**
     Move past specified number of entries
 
     @param aEntryPos Start position to move from, updated as move takes place
@@ -1113,26 +1087,35 @@
 		if(BoolXOR(bRealFatEntry, bNewFatEntry))
 		    {//-- mismatch between FAT on the media and the FAT bitmap restored by walking directory structure
 
-			if(bRealFatEntry)
-				{//-- FAT[i] on the media is marked as occupied, but restored FAT bitmap shows that it is free
-				if(iMount->IsBadCluster(ReadFatL(i)))
-					continue; //-- this is a BAD cluster it can't be occupied by the FS object, OK.
+			    if(bRealFatEntry)
+                {//-- FAT[i] on the media is marked as occupied, but retored FAT bitmap shows that it is free
+                    if(iMount->IsBadCluster(ReadFatL(i)))
+                        continue; //-- this is a BAD cluster it can't be occupied by the FS object, OK.
 
-				__PRINT2(_L("FAT[%d] = %d\n"), i, ReadFatL(i));
-				
-				//-- this is a Rugged FAT artefact; a lost cluster
-				__PRINT1(_L("Lost cluster=%d\n"),i);
-				
-				IndicateErrorsFound(EBadClusterValue);
-				}
-			else
-				{//-- FAT[i] on the media is marked as free, but restored FAT bitmap shows that it is occupied by some object
-				IndicateErrorsFound(EClusterAlreadyInUse);
-				__PRINT1(_L("Unflushed cluster = %d\n"),i);
-				}
+                    __PRINT2(_L("FAT[%d] = %d\n"), i, ReadFatL(i));        
+                    __PRINT1(_L("iTruncationCluster = %d\n"), iTruncationCluster);        
+                    
+                    //-- this is a lost cluster
+                    if(!IsEofF(ReadFatL(i)) && (i==iTruncationCluster))
+                        {//-- seems to be a Rugged FAT ertefact
+                        __PRINT1(_L("Hanging cluster = %d\n"),i);        
+                        }
+                    else
+                        {
+                        __PRINT1(_L("Lost cluster=%d\n"),i);
+                        }
+                    
+                    
+                    IndicateErrorsFound(EBadClusterValue);
+                }
+                else
+                {//-- FAT[i] on the media is marked as free, but retored FAT bitmap shows that it is occupied by some object
+                    IndicateErrorsFound(EClusterAlreadyInUse);
+                    __PRINT1(_L("Unflushed cluster = %d\n"),i);
+                }
 
-		 if(aStopOnFirstErrorFound)
-			 break; //-- not asked to check for errors further
+             if(aStopOnFirstErrorFound)
+                 break; //-- not asked to check for errors further
 
             }
 		
@@ -1204,13 +1187,13 @@
 	}	
 
 /**
-    Read a cluster from the Media Fat if scan run in a separate thread read from scan Fat table
+    Read a cluster from the Media Fat if scan run in a seperate thread read from scan fat table
     otherwise read from mount owned Fat table
 
     @param aClusterNum Cluster to read
     @return Value of cluster read from Fat
 */
-TUint32 CScanDrive::ReadFatL(TUint aClusterNum)
+TUint32 CScanDrive::ReadFatL(TUint aClusterNum) 
 	{
 	if(aClusterNum < KFatFirstSearchCluster || aClusterNum >= MaxClusters())
         {
--- a/userlibandfileserver/fileserver/sfat32/sl_vfat.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfat32/sl_vfat.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -29,7 +29,7 @@
 // use second half of ISO Latin 1 character set for extended chars
 const TUint KExtendedCharStart=0x80;
 const TUint KExtendedCharEnd=0xff;
-#define KMaxVFatEntries 21 ///< Max possible number of entries in the VFAT entryset
+const TUint KMaxVFatEntries = 21; ///< Max possible number of entries in the VFAT entryset
 
 
 //-----------------------------------------------------------------------------
--- a/userlibandfileserver/fileserver/sfile/efile.mmh	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-// Copyright (c) 1996-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:
-// f32\sfile\efile.mmp
-// efile.exe File Server
-// 
-//
-
-/**
- @file
-*/
-
-
-SOURCEPATH		../sfsrv
-USERINCLUDE		../sfsrv
-
-USERINCLUDE		../ftrace
-USERINCLUDE		../sfile/traces
-
-SOURCE			 cl_file.cpp
-SOURCE			 cl_cli.cpp
-SOURCE			 cl_dir.cpp
-
-SOURCEPATH		../sfile
-USERINCLUDE		.
-SOURCE			 sf_amh.cpp sf_dat.cpp sf_debug.cpp sf_dir.cpp
-SOURCE			 sf_drv.cpp sf_file.cpp sf_fmt.cpp
-SOURCE			 sf_ldr.cpp sf_main.cpp sf_nbs.cpp sf_ses.cpp
-SOURCE			 sf_svr.cpp sf_sys.cpp sf_utl.cpp sf_mnt.cpp
-SOURCE			 sf_raw.cpp sf_prel.cpp sf_disk.cpp
-SOURCE			 sf_request.cpp sf_ops.cpp sf_notify.cpp
-SOURCE			 sf_thread.cpp sf_local.cpp sf_obj.cpp
-SOURCE			 sf_ext.cpp sf_hash.cpp
-SOURCE			 sf_plugin.cpp sf_plugin_ops.cpp sf_plugin_man.cpp
-SOURCE			 Sf_plugin_util.cpp
-SOURCE			 sf_cache_man.cpp sf_cache_client.cpp
-SOURCE			 sf_file_cache.cpp
-SOURCE			 sf_memory_man.cpp sf_memory_client.cpp
-SOURCE			 sf_plugin_shim.cpp
-SOURCE			 sf_notifier_handlers.cpp
-#ifdef SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION
-SOURCE			 sf_pool.cpp sf_notifier.cpp
-#endif
-
-#ifdef WINS
-SOURCE			 sf_lwins.cpp
-
-library			emulator.lib
-#else
-SOURCE			 sf_lepoc.cpp  sf_inflate.cpp sf_cache.cpp sf_decomp.cpp
-SOURCE			 sf_pgcompr.cpp
-
-#ifdef MARM
-SOURCEPATH	../../../kernel/eka/kernel/arm
-SOURCE			 byte_pair.cia
-#else
-SOURCEPATH	../../../kernel/eka/kernel
-SOURCE			 byte_pair.cpp
-#endif
-
-
-SOURCEPATH	../srom
-SOURCE			 sr_rom.cpp
-#endif
-
-STRICTDEPEND
-
-SOURCEPATH	.
-DOCUMENT		 ../group/release.txt
-
-TARGETTYPE		exexp
-
-DEFFILE			efile.def
-
-USERINCLUDE	../inc ../sfsrv/traces
-#ifdef SYMBIAN_OLD_EXPORT_LOCATION
-SYSTEMINCLUDE	../inc
-#endif
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-USERINCLUDE	../../../kernel/eka/include
-
-LIBRARY			 efsrv.lib euser.lib hal.lib
-
-EPOCSTACKSIZE	0x6000
-EPOCHEAPSIZE	0x00001000	0x800000
-
-START WINS
-BASEADDRESS		0x62000000
-WIN32_LIBRARY	kernel32.lib
-END
-UID		0x1000008c 0x100039e3
-VENDORID 0x70000001
-
-unpagedcode
-unpageddata
-
-SMPSAFE
-
-
--- a/userlibandfileserver/fileserver/sfile/efile.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-// Copyright (c) 1996-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:
-// f32/sfile/efile.mmp
-// efile.exe File Server
-// 
-//
-
-/**
- @file
-*/
-
-
-TARGET			efile.exe
-
-#include "f32caps.mmh"  // Capabilities of File Server process
-#include "f32.mmh"  	// Generic definitions for the whole f32 component
-
-MACRO			SYMBIAN_PRIVATE_EFSRV
-
-// By default, tracepoints are compiled in to UDEB version only
-#ifdef SYMBIAN_TRACE_SYSTEM_INCLUDE
-macro SYMBIAN_FTRACE_ENABLE_UDEB
-//macro SYMBIAN_FTRACE_ENABLE_UREL
-#endif
-
-#include "efile.mmh"
-
-
-
-
-
--- a/userlibandfileserver/fileserver/sfile/sf_cache.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_cache.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -612,8 +612,8 @@
 
 	iCache = (TFileCacheRecord**)User::ReAlloc(pIndexes,sizeof(TFileCacheRecord*)*currentIndex);
 	if(!iCache)
-	    return KErrNoMemory;
-	
+		return KErrNoMemory;
+		
 	iNotPresent = EFalse;
 	iRecordCount = currentIndex;
 	if (currentIndex>1)
--- a/userlibandfileserver/fileserver/sfile/sf_cache_client.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_cache_client.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -635,13 +635,6 @@
 	return EFalse;
 	}
 
-// return true if more than half of the segments in this file are locked
-TBool CCacheClient::LockedSegmentsHalfUsed()
-	{
-	if (LockedBytes() > (iMaxBytesCached >> 1))
-		return ETrue;
-	return EFalse;
-	}
 
 TInt CCacheClient::CachedBytes()
 	{
--- a/userlibandfileserver/fileserver/sfile/sf_cache_client.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_cache_client.h	Wed Sep 01 12:34:56 2010 +0100
@@ -57,7 +57,6 @@
 	TBool SegmentEmpty(TInt64 aPos);
 	TBool SegmentDirty(TInt64 aPos);
 	TBool TooManyLockedSegments();
-	TBool LockedSegmentsHalfUsed();
 
 	inline TInt CacheOffset(TInt64 aLinAddr) const \
 		{return(I64LOW(aLinAddr)& ((1 << iManager.SegmentSizeLog2())-1));}
--- a/userlibandfileserver/fileserver/sfile/sf_dat.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_dat.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -51,6 +51,7 @@
 TBool StartupInitCompleted;
 TBool LocalDriveMappingSet;
 CKernEventNotifier* TheKernEventNotifier;
+RFTrace TheFtrace;
 
 
 GLDEF_D TCodePageUtils TheCodePage;
--- a/userlibandfileserver/fileserver/sfile/sf_debug.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_debug.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -19,9 +19,8 @@
 #include <f32dbg.h>
 #include "f32image.h"
 #include <f32plugin.h>
-#include <filesystem_fat.h>
 #include "sf_file_cache.h"
-#include "sf_memory_man.h"
+
 
 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
 
@@ -622,128 +621,6 @@
             TInt r=aRequest->Write(2,pkgBuf);
             return r;
             }
-        // Check if the file is in 'file sequential/non-rugged file' mode
-        case KControlIoIsFileSequential:
-        	{
-        	TDrive* drive = aRequest->Drive();
-        	if(!drive)
-        		return KErrNotSupported;
-        	
-        	// RFs::ControlIO uses narrow descriptors, so convert narrow back to wide
-        	TBuf8<KMaxPath> fileNameNarrow;
-        	TInt r = aRequest->Read(2, fileNameNarrow);
-        	if (r != KErrNone)
-        		return r;
-        	TFileName fileNameWide;
-        	fileNameWide.Copy(fileNameNarrow);
-        	
-        	// Locate the file
-        	CFileCB* file = drive->LocateFile(fileNameWide);
-        	if(!file)
-        		return KErrNotFound;
-        	
-        	// isFileSequential = 1 or 0 for EFileSequential mode enabled or disabled respectively
-        	TUint8 isFileSequential = (file->IsSequentialMode() != 0);
-        	TPtr8 pkgBuf(&isFileSequential,1,1);
-        	aRequest->Write(3, pkgBuf);
-        	
-        	return KErrNone;
-        	}
-        case KControlIoGlobalCacheConfig:
-		// read ESTART.TXT file for global memory settings
-            {
-            TGlobalCacheConfig globalCacheConfig;
-            TInt32 rel;
-            
-            const TInt KByteToByteShift = 10;
-            _LIT8(KLitSectionNameCacheMemory,"CacheMemory");
-            
-            if (F32Properties::GetInt(KLitSectionNameCacheMemory, _L8("GlobalCacheMemorySize"), rel))
-                globalCacheConfig.iGlobalCacheSizeInBytes = rel << KByteToByteShift;
-            else
-                globalCacheConfig.iGlobalCacheSizeInBytes = KErrNotFound;
-
-            if (F32Properties::GetInt(KLitSectionNameCacheMemory, _L8("LowMemoryThreshold"), rel))
-                globalCacheConfig.iGlobalLowMemoryThreshold = rel;
-            else
-                globalCacheConfig.iGlobalLowMemoryThreshold = KErrNotFound;
-
-            TPckgBuf<TGlobalCacheConfig> pkgBuf(globalCacheConfig);
-            TInt r=aRequest->Write(2,pkgBuf);
-            return r;
-            }
-        case KControlIoGlobalCacheInfo:
-    	// get system's current global cache memory info
-            {
-            TGlobalCacheInfo info;
-            info.iGlobalCacheSizeInBytes = TGlobalCacheMemorySettings::CacheSize();
-            info.iGlobalLowMemoryThreshold = TGlobalCacheMemorySettings::LowMemoryThreshold();
-            TPckgBuf<TGlobalCacheInfo> pkgBuf(info);
-            TInt r=aRequest->Write(2,pkgBuf);
-            return r;
-            }
-         case KControlIoDirCacheConfig:
-         // read ESTART.TXT file for per-drive directory cache settings
-            {
-            TInt driveNumber = aRequest->Drive()->DriveNumber();
-            TDirCacheConfig dirCacheConfig;
-            TInt32 rel;
-            dirCacheConfig.iDrive = driveNumber;
-            TBuf8<32> driveSection;
-            driveSection.Format(_L8("Drive%c"), 'A' + driveNumber);
-            
-            if (F32Properties::GetInt(driveSection, _L8("FAT_LeafDirCacheSize"), rel))
-                dirCacheConfig.iLeafDirCacheSize = rel;
-            else
-                dirCacheConfig.iLeafDirCacheSize = KErrNotFound;
-
-            if (F32Properties::GetInt(driveSection, _L8("FAT_DirCacheSizeMin"), rel))
-                dirCacheConfig.iDirCacheSizeMin = rel << KByteToByteShift;
-            else
-                dirCacheConfig.iDirCacheSizeMin = KErrNotFound;
-
-            if (F32Properties::GetInt(driveSection, _L8("FAT_DirCacheSizeMax"), rel))
-                dirCacheConfig.iDirCacheSizeMax = rel << KByteToByteShift;
-            else
-                dirCacheConfig.iDirCacheSizeMax = KErrNotFound;
-
-            TPckgBuf<TDirCacheConfig> pkgBuf(dirCacheConfig);
-            TInt r=aRequest->Write(2,pkgBuf);
-            return r;
-            }
-         case KControlIoDirCacheInfo:
-         // get system's current per-drive directory cache settings
-		 //  currently only supports FAT file system
-             {
-             TFSName fsName;
-             aRequest->Drive()->CurrentMount().FileSystemName(fsName);
-             if (fsName.CompareF(KFileSystemName_FAT) == 0)
-                 {
-                 // 16 is the control cmd used for FAT
-                 //  see EFATDirCacheInfo in FAT code please. 
-                 const TInt KFATDirCacheInfo = 16;
-                 return(aRequest->Drive()->ControlIO(aRequest->Message(),KFATDirCacheInfo,param1,param2));
-                 }
-             return KErrNotSupported;
-             }
-         case KControlIoSimulateMemoryLow:
-             {
-             CCacheMemoryManager* cacheMemManager = CCacheMemoryManagerFactory::CacheMemoryManager();
-             if (cacheMemManager)
-                 cacheMemManager->SetMemoryLow(ETrue);
-             else
-                 return KErrNotSupported;
-             return KErrNone;
-             }
-         case KControlIoStopSimulateMemoryLow:
-             {
-             CCacheMemoryManager* cacheMemManager = CCacheMemoryManagerFactory::CacheMemoryManager();
-             if (cacheMemManager)
-                 cacheMemManager->SetMemoryLow(EFalse);
-             else
-                 return KErrNotSupported;
-             return KErrNone;
-             }
 		
 		}
 #endif
--- a/userlibandfileserver/fileserver/sfile/sf_dir.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_dir.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -17,10 +17,6 @@
 
 #include "sf_std.h"
 
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "sf_dirTraces.h"
-#endif
-
 LOCAL_C CDirCB* GetDirFromHandle(TInt aHandle,CSessionFs* aSession)
 //
 // Get the dir control block from its handle.
@@ -56,18 +52,19 @@
 		{
 		TEntry e;
 
-		OstTrace1(TRACE_FILESYSTEM, FSYS_ECDIRCBREADL2, "fsDirReadPacked this %x", &aDir);
+		TRACE1(UTF::EBorder, UTraceModuleFileSys::ECDirCBReadL, EF32TraceUidFileSys, &aDir);
 		aDir.ReadL(e);
-		OstTraceExt5(TRACE_FILESYSTEM, FSYS_ECDIRCBREADL2RET, "fsDirReadPacked r %d att %x modified %x:%x  size %d", (TUint) KErrNone, (TUint) e.iAtt, (TUint) I64HIGH(e.iModified.Int64()), (TUint) I64LOW(e.iModified.Int64()), (TUint) e.iSize);
+		TRACE5(UTF::EBorder, UTraceModuleFileSys::ECDirCBReadLRet, EF32TraceUidFileSys, 
+			KErrNone, e.iAtt, I64LOW(e.iModified.Int64()), I64HIGH(e.iModified.Int64()), e.iSize);
 		TInt len=EntrySize(e, EFalse);
 		TInt rLen=EntrySize(e, ETrue);
 		TEntry* pX=PtrAdd(pE,rLen);
 		if (pX>pEnd)
 			{
 
-			OstTrace1(TRACE_FILESYSTEM, FSYS_ECDIRCBSTORELONGENTRYNAMEL, "fsDirReadPacked this %x", &aDir);
+			TRACE1(UTF::EBorder, UTraceModuleFileSys::ECDirCBStoreLongEntryNameL, EF32TraceUidFileSys, &aDir);
 			aDir.StoreLongEntryNameL(e.iName);
-			OstTrace1(TRACE_FILESYSTEM, FSYS_ECDIRCBSTORELONGENTRYNAMELRET, "fsDirReadPacked r %d", KErrNone);
+			TRACE1(UTF::EBorder, UTraceModuleFileSys::ECDirCBStoreLongEntryNameLRet, EF32TraceUidFileSys, KErrNone);
 
 			aDir.SetPending(ETrue);
 			break;
@@ -116,8 +113,7 @@
 	CFsPlugin* plugin = NULL;
 	//Get the next plugin which is mounted on this drive (IsMounted called in NextPlugin)
 	//Do not check whether we're registered for current operation (in case not registered for EFsDirOpen)
-	FsPluginManager::ReadLockChain();                                      //!Check operation
-	while(FsPluginManager::NextPlugin(plugin,(CFsMessageRequest*)aRequest,(TBool)EFalse)==KErrNone && plugin)
+	while(FsPluginManager::NextPlugin(plugin,(CFsMessageRequest*)aRequest,(TBool)ETrue,(TBool)EFalse)==KErrNone && plugin)
 		{
 		if(plugin->IsRegistered(EFsDirReadOne) ||
 			plugin->IsRegistered(EFsDirReadPacked) ||
@@ -130,7 +126,6 @@
 			break;
 			}
 		}
-	FsPluginManager::UnlockChain();
 	
 	TPtrC8 pH((TUint8*)&h,sizeof(TInt));
 	TRAP(r,aRequest->WriteL(KMsgPtr3,pH))
@@ -168,10 +163,10 @@
 		return(r);
 	TEntry e;
 
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECDIRCBREADL1, "this %x", &dir);
+	TRACE1(UTF::EBorder, UTraceModuleFileSys::ECDirCBReadL, EF32TraceUidFileSys, &dir);
 	TRAP(r,dir->ReadL(e))
-	OstTraceExt5(TRACE_FILESYSTEM, FSYS_ECDIRCBREADL1RET, "r %d att %x modified %x:%x  size %d", (TUint) KErrNone, (TUint) e.iAtt, (TUint) I64HIGH(e.iModified.Int64()), (TUint) I64LOW(e.iModified.Int64()), (TUint) e.iSize);
-		
+	TRACE5(UTF::EBorder, UTraceModuleFileSys::ECDirCBReadLRet, EF32TraceUidFileSys, 
+		KErrNone, e.iAtt, I64LOW(e.iModified.Int64()), I64HIGH(e.iModified.Int64()), e.iSize);
 
 
 	if (r==KErrNone)
--- a/userlibandfileserver/fileserver/sfile/sf_drv.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_drv.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -17,9 +17,8 @@
 
 #include "sf_std.h"
 #include "sf_file_cache.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "sf_drvTraces.h"
-#endif
+
+
 //const TInt KMaxNotifierAttempts=4; // not used anywhere
 
 static TPtrC StripBackSlash(const TDesC& aName)
@@ -283,12 +282,12 @@
 	if (!aMount.IsDismounted() && !aMount.ProxyDriveDismounted())
 		{
 		aMount.SetDrive(this);
-		OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBREMOUNT1, "drive %d", DriveNumber());
+		TRACE1(UTF::EBorder, UTraceModuleFileSys::ECMountCBReMount, EF32TraceUidFileSys, DriveNumber());
 		
         //-- actually, this is asking CMountCB to see if it belongs to the current media. 
         iReason = aMount.ReMount();
 
-		OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBREMOUNT1RET, "success %d", iReason);
+		TRACE1(UTF::EBorder, UTraceModuleFileSys::ECMountCBReMountRet, EF32TraceUidFileSys, iReason);
 		
         if (iReason == KErrNone)	//	ReMount succeeded
 			{
@@ -324,13 +323,13 @@
     
     apMount = NULL;
 
-    OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMNEWMOUNTL, "this %x drive %d", (TUint) &FSys(), (TUint) DriveNumber());
+    TRACE2(UTF::EBorder, UTraceModuleFileSys::ECFileSystemNewMountL, EF32TraceUidFileSys, &FSys(), DriveNumber());
    
     //-- construct a new CmountCB object.
     //-- on return pMountsFs will be the pointer to the factory object of CFileSystem that produced this mount
     apMount = FSys().NewMountExL(this, &pMountsFs, aForceMount, aFsNameHash);
 
-	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMNEWMOUNTLRET, "r %d CMountCB %x", (TUint) KErrNone, (TUint) apMount);
+	TRACE2(UTF::EBorder, UTraceModuleFileSys::ECFileSystemNewMountLRet, EF32TraceUidFileSys, KErrNone, apMount);
 	__PRINT2(_L("TDrive::MountMediaL created mount:0x%x FileSys:0x%x"), apMount, pMountsFs);
 
     ASSERT(pMountsFs && apMount);
@@ -399,10 +398,10 @@
 */
 TInt TDrive::MountControl(TInt aLevel, TInt aOption, TAny* aParam)
     {
-	OstTraceExt4(TRACE_FILESYSTEM, FSYS_ECMOUNTCBMOUNTCONTROL, "drive %d aLevel %d aOption %x aParam %x", (TUint) DriveNumber(), (TUint) aLevel, (TUint) aOption, (TUint) aParam);
+	TRACE4(UTF::EBorder, UTraceModuleFileSys::ECMountCBMountControl, EF32TraceUidFileSys, DriveNumber(), aLevel, aOption, aParam);
     TInt r = CurrentMount().MountControl(aLevel, aOption, aParam);
-	
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBMOUNTCONTROLRET, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBMountControlRet, EF32TraceUidFileSys, r);
+
 	return r;
     }
 
@@ -431,9 +430,9 @@
     //-- the caller will be suspended until aFreeSpaceRequired bytes is available or scanning process finishes
     {
         TUint64 freeSpaceReq = aFreeSpaceRequired;
-		OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBFREESPACE, "drive %d", DriveNumber());
+		TRACE1(UTF::EBorder, UTraceModuleFileSys::ECMountCBFreeSpace, EF32TraceUidFileSys, DriveNumber());
         nRes = CurrentMount().RequestFreeSpace(freeSpaceReq);
-		OstTraceExt3(TRACE_FILESYSTEM, FSYS_ECMOUNTCBFREESPACERET, "r %d FreeSpace %x:%x", (TUint) nRes, (TUint) I64HIGH(freeSpaceReq), (TUint) I64LOW(freeSpaceReq));
+		TRACERET3(UTF::EBorder, UTraceModuleFileSys::ECMountCBFreeSpaceRet, EF32TraceUidFileSys, nRes, I64LOW(freeSpaceReq), I64HIGH(freeSpaceReq));
         if(nRes == KErrNone)
             {
             return (freeSpaceReq >= aFreeSpaceRequired) ? KErrNone : KErrDiskFull;
@@ -463,10 +462,11 @@
     nRes = CheckMount();
     if(nRes != KErrNone)
         return nRes;
+
     //-- 1. Try mount-specific request first. It won't block this call as CMountCB::VolumeL() can do if some background activity is going on the mount
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBVOLUMESIZE, "drive %d", DriveNumber());
+	TRACE1(UTF::EBorder, UTraceModuleFileSys::ECMountCBVolumeSize, EF32TraceUidFileSys, DriveNumber());
     nRes = CurrentMount().MountedVolumeSize(aSize);
-	OstTraceExt3(TRACE_FILESYSTEM, FSYS_ECMOUNTCBVOLUMESIZERET, "r %d aSize %x:%x", (TUint) nRes, (TUint) I64HIGH(aSize), (TUint) I64LOW(aSize));
+	TRACERET3(UTF::EBorder, UTraceModuleFileSys::ECMountCBVolumeSize, EF32TraceUidFileSys, nRes, I64LOW(aSize), I64HIGH(aSize));
     if(nRes == KErrNone)
         return nRes;
 
@@ -499,9 +499,9 @@
         return nRes;
 
     //-- 1. Try mount-specific request first. It won't block this call as CMountCB::VolumeL() can do 
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBCURRENTFREESPACE, "drive %d", DriveNumber());
+	TRACE1(UTF::EBorder, UTraceModuleFileSys::ECMountCBCurrentFreeSpace, EF32TraceUidFileSys, DriveNumber());
     nRes = CurrentMount().GetCurrentFreeSpaceAvailable(aFreeDiskSpace);
-	OstTraceExt3(TRACE_FILESYSTEM, FSYS_ECMOUNTCBCURRENTFREESPACERET, "r %d FreeSpace %x:%x", (TUint) nRes, (TUint) I64HIGH(aFreeDiskSpace), (TUint) I64LOW(aFreeDiskSpace));
+	TRACERET3(UTF::EBorder, UTraceModuleFileSys::ECMountCBCurrentFreeSpaceRet, EF32TraceUidFileSys, nRes, I64LOW(aFreeDiskSpace), I64HIGH(aFreeDiskSpace));
     if(nRes == KErrNone)
         return nRes;
 
@@ -539,9 +539,9 @@
 	if(IsWriteProtected())
 		return(KErrAccessDenied);
 
-	OstTraceExt4(TRACE_FILESYSTEM, FSYS_ECMOUNTCBFINALISEMOUNT2, "drive %d aOperation %d aParam1 %x aParam2 %x", (TUint) DriveNumber(), (TUint) aOperation, (TUint) aParam1, (TUint) aParam2);
+	TRACE4(UTF::EBorder, UTraceModuleFileSys::ECMountCBFinaliseMount2, EF32TraceUidFileSys, DriveNumber(), aOperation, aParam1, aParam2);
 	TRAP(r,CurrentMount().FinaliseMountL(aOperation, aParam1, aParam2));
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBFINALISEMOUNT2RET, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBFinaliseMount2Ret, EF32TraceUidFileSys, r);
 	
 	// Pass FinaliseDrive notification down to media driver
 	TInt driveNumber = DriveNumber();
@@ -574,10 +574,9 @@
 	if(IsWriteProtected())
 		return(KErrAccessDenied);
 
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBFINALISEMOUNT1, "drive %d", DriveNumber());
+	TRACE1(UTF::EBorder, UTraceModuleFileSys::ECMountCBFinaliseMount1, EF32TraceUidFileSys, DriveNumber());
 	TRAP(r,CurrentMount().FinaliseMountL());
-	
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBFINALISEMOUNT1RET, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBFinaliseMount1Ret, EF32TraceUidFileSys, r);
 	
     return r;
 	}
@@ -825,7 +824,7 @@
 // Check that the sharing rules are obeyed.
 //
 	{
-	// Check the correct share modes are passed in
+
 	switch (aReqShare)
 		{
 	case EFileShareExclusive:
@@ -834,46 +833,47 @@
 	case EFileShareReadersOrWriters:
 		break;
 	default:
-		return KErrArgument;
+		return(KErrArgument);
 		}
-	
-	// Check the share mode of the file
 	switch (aFile.iShare)
 		{
 	case EFileShareExclusive:
-		return KErrInUse;
+		return(KErrInUse);
 
 	case EFileShareReadersOnly:
 	case EFileShareAny:
 		if (aReqShare != aFile.iShare && aReqShare != EFileShareReadersOrWriters)
-		    {
-            return KErrInUse;
-		    }
+			return(KErrInUse);
 		break;
 
 	case EFileShareReadersOrWriters:
-		if (aReqShare == EFileShareExclusive)
-		    {
-            return KErrInUse;
-		    }
+		if (aReqShare==EFileShareExclusive)
+			return(KErrInUse);
 		//
-		// If the file is currently opened as EFileShareReadersOrWriters then
+		// If the file is currently open as EFileShareReadersOrWriters then
 		// promote the share to the requested share mode.
-		// 
-		// If the requested share is EFileShareReadersOnly, verify that no
-		// other share has the file opened for writing.
 		//
+		// If the requested share is EFileShareReadersOnly, verfiy that no
+		// other share has the file open for writing.
+		//
+
 		if (aReqShare == EFileShareReadersOnly)
 			{
-			TDblQueIter<CFileShare> fileShareIter(aFile.FileShareList());
-			CFileShare* pFileShare;
-			while ((pFileShare = fileShareIter++) != NULL)
+			FileShares->Lock();
+			TInt count = FileShares->Count();
+			while(count--)
 				{
-				if(pFileShare->iMode & EFileWrite)
+				CFileShare* share = (CFileShare*)(*FileShares)[count];
+				if (&share->File() == &aFile)
 					{
-					return KErrInUse;
+					if(share->iMode & EFileWrite)
+						{
+						FileShares->Unlock();
+						return KErrInUse;
+						}
 					}
 				}
+			FileShares->Unlock();
 			}
 		break;
     
@@ -881,9 +881,9 @@
 		Fault(EDrvIllegalShareValue);
         break;
 		}
-
-	return KErrNone;
+	return(KErrNone);
 	}
+
 void TDrive::DriveInfo(TDriveInfo& anInfo)
 //
 // Get the drive info.
@@ -896,9 +896,10 @@
 
 	if(iFSys)
 		{
-		OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMDRIVEINFO, "this %x aDriveNumber %d", (TUint) &FSys(), (TUint) DriveNumber());
+		TRACE2(UTF::EBorder, UTraceModuleFileSys::ECFileSystemDriveInfo, EF32TraceUidFileSys, &FSys(), DriveNumber());
 		FSys().DriveInfo(anInfo,DriveNumber());
-		OstTraceExt3(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMDRIVEINFORET, "type %d driveAtt %x mediaAtt %x", (TUint) anInfo.iType, (TUint) anInfo.iDriveAtt, (TUint) anInfo.iMediaAtt);
+		TRACE3(UTF::EBorder, UTraceModuleFileSys::ECFileSystemDriveInfoRet, EF32TraceUidFileSys, 
+			anInfo.iType, anInfo.iDriveAtt, anInfo.iMediaAtt);
 		}
 
 	anInfo.iDriveAtt=Att();
@@ -918,10 +919,12 @@
 		aVolume.iUniqueID=m.iUniqueID;
 		aVolume.iSize=m.iSize;
 
-		OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBVOLUMEL, "drive %d", DriveNumber());
+		TRACE1(UTF::EBorder, UTraceModuleFileSys::ECMountCBVolumeL, EF32TraceUidFileSys, DriveNumber());
 		TRAP(r,m.VolumeL(aVolume))
-		OstTraceExt5(TRACE_FILESYSTEM, FSYS_ECMOUNTCBVOLUMELRETA, "r %d iSize %x:%x iFree %x:%x", (TUint) r, (TUint) I64HIGH(aVolume.iSize), (TUint) I64LOW(aVolume.iSize), (TUint) I64HIGH(aVolume.iFree), (TUint) I64LOW(aVolume.iFree));
-		OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECMOUNTCBVOLUMELRETB, "iUniqueID %x iFileCacheFlags %x", (TUint) aVolume.iUniqueID, (TUint) aVolume.iFileCacheFlags);
+		TRACE7(UTF::EBorder, UTraceModuleFileSys::ECMountCBVolumeLRet, EF32TraceUidFileSys, 
+			r, aVolume.iUniqueID, I64LOW(aVolume.iSize), I64HIGH(aVolume.iSize),
+			I64LOW(aVolume.iFree), I64HIGH(aVolume.iFree), aVolume.iFileCacheFlags);
+
 		}
 	return(r);
 	}
@@ -935,11 +938,12 @@
 	__CHECK_DRIVETHREAD(iDriveNumber);
 	aBuf=aName.AllocL();
 	TPtr volumeName=aBuf->Des();
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBSETVOLUMEL, "drive %d", DriveNumber());
-	OstTraceData(TRACE_FILESYSTEM, FSYS_EVOLUMENAME, "VolumeName %S", aName.Ptr(), aName.Length()<<1);
-	
+
+	TRACEMULT2(UTF::EBorder, UTraceModuleFileSys::ECMountCBSetVolumeL, EF32TraceUidFileSys, DriveNumber(), aName);
 	CurrentMount().SetVolumeL(volumeName);
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBSETVOLUMELRET, "r %d", KErrNone);
+	TRACE1(UTF::EBorder, UTraceModuleFileSys::ECMountCBSetVolumeLRet, EF32TraceUidFileSys, KErrNone);
+
+
 	delete &CurrentMount().VolumeName();
 	CurrentMount().SetVolumeName(aBuf);
 	}
@@ -974,12 +978,14 @@
 		return(KErrAccessDenied);
 	TParse newDirName;
 	newDirName.Set(aName,NULL,NULL);
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBMKDIRL, "drive %d", DriveNumber());
-	OstTraceData(TRACE_FILESYSTEM, FSYS_ECMOUNTCBMKDIRLYS_EDIRNAME, "Dir %S", aName.Ptr(), aName.Length()<<1);
+
+	TRACEMULT2(UTF::EBorder, UTraceModuleFileSys::ECMountCBMkDirL, EF32TraceUidFileSys, DriveNumber(), aName);
 	TRAP(r,CurrentMount().MkDirL(newDirName.FullName()))
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBMKDIRLRET, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBMkDirLRet, EF32TraceUidFileSys, r);
+
 	return(r);
 	}
+
 TInt TDrive::RmDir(const TDesC& aName)
 //
 // Remove a directory.
@@ -996,10 +1002,11 @@
 		return(KErrPathNotFound);
 	if ((entry.iAtt&KEntryAttReadOnly) || IsWriteProtected())
 		return(KErrAccessDenied);
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBRMDIRL, "drive %d", DriveNumber());
-	OstTraceData(TRACE_FILESYSTEM, FSYS_ECMOUNTCBRMDIRLYS_EDIRNAME, "Dir %S", aName.Ptr(), aName.Length()<<1);
+
+	TRACEMULT2(UTF::EBorder, UTraceModuleFileSys::ECMountCBRmDirL, EF32TraceUidFileSys, DriveNumber(), aName);
 	TRAP(r,CurrentMount().RmDirL(aName))
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBRMDIRLRET, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBRmDirLRet, EF32TraceUidFileSys, r);
+
 	return(r);
 	}
 
@@ -1020,10 +1027,12 @@
 
     if (IsWriteProtected())
 		return(KErrAccessDenied);
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBDELETEL1, "drive %d", DriveNumber());
-	OstTraceData(TRACE_FILESYSTEM, FSYS_ECMOUNTCBDELETEL1_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
+
+    //-- filesystems' CMountCB::DeleteL() implementations shall check the entry attributes themeselves. 
+	TRACEMULT2(UTF::EBorder, UTraceModuleFileSys::ECMountCBDeleteL, EF32TraceUidFileSys, DriveNumber(), aName);
 	TRAP(r,CurrentMount().DeleteL(aName))
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBDELETEL1_RET, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBDeleteLRet, EF32TraceUidFileSys, r);
+
 	return r;
 	}
 
@@ -1094,11 +1103,11 @@
 	// remove from closed queue
 	LocateClosedFile(anOldName, EFalse);
 	LocateClosedFile(aNewName, EFalse);
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBRENAMEL, "drive %d", DriveNumber());
-	OstTraceData(TRACE_FILESYSTEM, FSYS_ECMOUNTCBRENAMELYS_EOLDNAME, "OldName %S", oldEntryName.Ptr(), oldEntryName.Length()<<1);
-	OstTraceData(TRACE_FILESYSTEM, FSYS_ECMOUNTCBRENAMELYS_ENEWNAME, "NewName %S", newEntryName.Ptr(), newEntryName.Length()<<1);
+
+	TRACEMULT3(UTF::EBorder, UTraceModuleFileSys::ECMountCBRenameL, EF32TraceUidFileSys, DriveNumber(), oldEntryName,newEntryName);
 	TRAP(r,CurrentMount().RenameL(oldEntryName,newEntryName))
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBRENAMELRET, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBRenameLRet, EF32TraceUidFileSys, r);
+
 	return(r);
 	}
 
@@ -1132,11 +1141,11 @@
 	// remove from closed queue
 	LocateClosedFile(anOldName, EFalse);
 	LocateClosedFile(aNewName, EFalse);
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBREPLACEL, "drive %d", DriveNumber());
-	OstTraceData(TRACE_FILESYSTEM, FSYS_ECMOUNTCBREPLACEL_EOLDNAME, "OldName %S", anOldName.Ptr(), anOldName.Length()<<1);
-	OstTraceData(TRACE_FILESYSTEM, FSYS_ECMOUNTCBREPLACEL_ENEWNAME, "NewName %S", aNewName.Ptr(), aNewName.Length()<<1);
+
+	TRACEMULT3(UTF::EBorder, UTraceModuleFileSys::ECMountCBReplaceL, EF32TraceUidFileSys, DriveNumber(), anOldName, aNewName);
 	TRAP(r,CurrentMount().ReplaceL(anOldName,aNewName))
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBREPLACELRET, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBReplaceLRet, EF32TraceUidFileSys, r);
+
 	return(r);
 	}
 
@@ -1165,8 +1174,7 @@
 // Get entry details
 //
 	{
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBENTRYL, "drive %d", DriveNumber());
-	OstTraceData(TRACE_FILESYSTEM, FSYS_ECMOUNTCBENTRYL_EFILEPATH, "FilePath %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleFileSys::ECMountCBEntryL, EF32TraceUidFileSys, DriveNumber(), aName);
 	CurrentMount().EntryL(aName,anEntry);
 
 	// If the file is already open then read the file attributes directly from the file
@@ -1194,7 +1202,11 @@
 		}
 
 
-	OstTraceExt5(TRACE_FILESYSTEM, FSYS_ECMOUNTCBENTRYLRET, "att %x modified %x:%x  size %x:%x", (TUint) anEntry.iAtt, (TUint) I64HIGH(anEntry.iModified.Int64()), (TUint) I64LOW(anEntry.iModified.Int64()), (TUint) I64HIGH(anEntry.FileSize()), (TUint) anEntry.FileSize());
+	TRACE5(UTF::EBorder, UTraceModuleFileSys::ECMountCBEntryLRet, EF32TraceUidFileSys, 
+		KErrNone, anEntry.iAtt, 
+		I64LOW(anEntry.iModified.Int64()), I64HIGH(anEntry.iModified.Int64()), 
+		anEntry.iSize);
+
 	}
 
 TInt TDrive::CheckAttributes(TUint& aSetAttMask,TUint& aClearAttMask)
@@ -1227,11 +1239,11 @@
 	TTime nullTime(0);
 	if (aTime!=nullTime)
 		aSetAttMask|=KEntryAttModified;
-	OstTraceExt5(TRACE_FILESYSTEM, FSYS_ECMOUNTCBSETENTRYL, "drive %d aTime %x:%x  aSetAttMask %x aClearAttMask %x", (TUint) DriveNumber(), (TUint) I64HIGH(aTime.Int64()), (TUint) I64LOW(aTime.Int64()), (TUint) aSetAttMask, (TUint) aClearAttMask);
-	OstTraceData(TRACE_FILESYSTEM, FSYS_ECMOUNTCBSETENTRYL_EFILEPATH, "FilePath %S", aName.Ptr(), aName.Length()<<1);
+
+	TRACEMULT6(UTF::EBorder, UTraceModuleFileSys::ECMountCBSetEntryL, EF32TraceUidFileSys, 
+		DriveNumber(), aName, I64LOW(aTime.Int64()), I64HIGH(aTime.Int64()), aSetAttMask, aClearAttMask);
 	TRAP(r,CurrentMount().SetEntryL(entryName,aTime,aSetAttMask,aClearAttMask))
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBSETENTRYLRET, "r %d", r);
-
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBSetEntryLRet, EF32TraceUidFileSys, r);
 	// If the file is already open then write the file attributes directly to the file
 	TFileName foldedName;
 	TUint32 nameHash=0;
@@ -1373,89 +1385,88 @@
 	if ((aMode & EDeleteOnClose) && (anOpen!=EFileCreate))
 		User::Leave(KErrArgument);
 
-	CFileCB* pFile=LocateFile(aName);
+	CFileCB* pF=LocateFile(aName);
 	CFileCache* pFileCache = NULL;
-	TBool openFile=EFalse;	// True if file is being opened for the first time
-	if (pFile!=NULL)		// File is already opened on the drive
+	TBool openFile=EFalse;
+	if (pF!=NULL)
 		{
-		if (pFile->iShare==EFileShareReadersOnly && (aMode&EFileWrite))
+		if (pF->iShare==EFileShareReadersOnly && (aMode&EFileWrite)!=0)
 			User::Leave(KErrInUse);
 		if (anOpen==EFileCreate)
 			User::Leave(KErrAlreadyExists);
-		TInt r=ValidateShare(*pFile,share);
+		TInt r=ValidateShare(*pF,share);
 		if (r!=KErrNone)
 			User::Leave(r);
-		if ((r=pFile->Open())!=KErrNone)
+		if ((r=pF->Open())!=KErrNone)
 			User::Leave(r);
-		
-		aFileCB=pFile;
-		pFileCache = pFile->FileCache();
+		aFileCB=pF;
+		pFileCache = pF->FileCache();
 		}
 	else
 		{
-		OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMNEWFILEL, "this %x drive %d", (TUint) &FSys(), (TUint) DriveNumber());
+		TRACE2(UTF::EBorder, UTraceModuleFileSys::ECFileSystemNewFileL, EF32TraceUidFileSys, &FSys(), DriveNumber());
+
         //-- construct CFileCB object, belonging to the corresponding mount
-        pFile = aFileCB = CurrentMount().NewFileL();
-
-		OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMNEWFILELRET, "r %d CFileCB %x", (TUint) r, (TUint) pFile);
+        pF = aFileCB = CurrentMount().NewFileL();
+
+		TRACERET2(UTF::EBorder, UTraceModuleFileSys::ECFileSystemNewFileLRet, EF32TraceUidFileSys, r, pF);
 		TDrive* createdDrive=!aRequest->SubstedDrive() ? this : aRequest->SubstedDrive();
 
     	HBufC* fileName = CreateFileNameL(aName);
 
-        pFile->InitL(this, createdDrive, fileName);
-
-		pFile->iShare = share;
-		pFile->SetSequentialMode(aMode & EFileSequential);
+        pF->InitL(this, createdDrive, fileName);
+
+
+		pF->iShare = share;
 		openFile=ETrue;
-		CurrentMount().iMountQ.AddLast(*pFile);
-		Files->AddL(pFile,ETrue);
-		__PRINT1(_L("TDrive::FileOpenL - CFileCB->IsSequentialMode = %d"), pFile->IsSequentialMode());
+		CurrentMount().iMountQ.AddLast(*pF);
+		Files->AddL(pF,ETrue);
 		}
 	
-    CFileShare* pFileShare=aFileShare=new(ELeave) CFileShare(pFile);
+    CFileShare* pS=aFileShare=new(ELeave) CFileShare(pF);
 
 	// We need to call CFileCB::PromoteShare immediately after the CFileShare 
 	// instance is created since the destructor calls CFileCB::DemoteShare()
 	// which checks the share count is non-zero
-	pFileShare->iMode=aMode;
-	pFile->PromoteShare(pFileShare);
-
-	pFileShare->InitL();
+	pS->iMode=aMode;
+	pF->PromoteShare(pS);
+
+	pS->InitL();
 	aFileCB=NULL; 
-	FileShares->AddL(pFileShare,ETrue);
-	aHandle=aRequest->Session()->Handles().AddL(pFileShare,ETrue);
+	FileShares->AddL(pS,ETrue);
+	aHandle=aRequest->Session()->Handles().AddL(pS,ETrue);
 
 
 	if (openFile)
 		{
-		OstTraceExt4(TRACE_FILESYSTEM, FSYS_ECMOUNTCBFILEOPENL, "drive %d aMode %x anOpen %d aFile %x", (TUint) DriveNumber(), (TUint) aMode, (TUint) anOpen, (TUint) pFile);
-		OstTraceData(TRACE_FILESYSTEM, FSYS_ECMOUNTCBFILEOPENL_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
-		CurrentMount().FileOpenL(aName,aMode,anOpen,pFile);
-		OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBFILEOPENLRET, "r %d", KErrNone);
+		TRACEMULT5(UTF::EBorder, UTraceModuleFileSys::ECMountCBFileOpenL, EF32TraceUidFileSys, DriveNumber(), aName, aMode, (TUint) anOpen, (TUint) pF);
+		CurrentMount().FileOpenL(aName,aMode,anOpen,pF);
+		TRACE1(UTF::EBorder, UTraceModuleFileSys::ECMountCBFileOpenLRet, EF32TraceUidFileSys, KErrNone);
+
 		// Delete on close may now be safely flagged if required.
 		// The file did not exist on the media prior to the
 		// CMountCB::FileOpenL() call for the case of a create.
 		if ((aMode & EDeleteOnClose) && (anOpen==EFileCreate))
-			pFile->SetDeleteOnClose();
-
-		TBool localBufferSuppport = (CurrentMount().LocalBufferSupport(pFile) == KErrNone)?(TBool)ETrue:(TBool)EFalse;
-		pFile->SetLocalBufferSupport(localBufferSuppport);
+			pF->SetDeleteOnClose();
+
+		TBool localBufferSuppport = (CurrentMount().LocalBufferSupport(pF) == KErrNone)?(TBool)ETrue:(TBool)EFalse;
+		pF->SetLocalBufferSupport(localBufferSuppport);
 		if (localBufferSuppport)
 			{
-			// If file exists on closed queue resurrect it or discard it,
+			// if file exists on closed queue resurrect it or discard it,
 			// depending on the file open mode
 			pFileCache = LocateClosedFile(aName, anOpen == EFileOpen?(TBool)ETrue:(TBool)EFalse);
 			if (pFileCache)
 				{
-				pFileCache = pFileCache->ReNewL(*pFileShare);	// NB may return NULL if caching not enabled
+				pFileCache = pFileCache->ReNewL(*pS);	// NB may return NULL if caching not enabled
 				}
 			else
 				{
-				pFileCache = CFileCache::NewL(*pFileShare);		// NB may return NULL if caching not enabled
+				pFileCache = CFileCache::NewL(*pS);		// NB may return NULL if caching not enabled
 				}
 			if (pFileCache)
-				// Set the cached size to be the same as the uncached size
-				pFile->SetCachedSize64(pFile->Size64());
+				// set the cached size to be the same as the uncached size
+				pF->SetCachedSize64(pF->Size64());
 			}
 		else
 			{
@@ -1463,9 +1474,9 @@
 			}
 		}
 
-	// Initialize share mode flags
+	// initialize share mode flags
 	if (pFileCache != NULL)
-		pFileCache->Init(*pFileShare);
+		pFileCache->Init(*pS);
 	}
 
 TInt TDrive::FileOpen(CFsRequest* aRequest,TInt& aHandle,const TDesC& aName,TUint aMode,TFileOpen anOpen)
@@ -1477,7 +1488,7 @@
 	CFileCB* pF=NULL;
 	CFileShare* pS=NULL;
 	aHandle=0;
-	TRAPD(r,FileOpenL(aRequest,aHandle,aName,aMode,anOpen,pF,pS));
+	TRAPD(r,FileOpenL(aRequest,aHandle,aName,aMode,anOpen,pF,pS))
 
 	// Allow files > 2GB-1 to be opened only if EFileBigFile is specified in iMode
 	if (r == KErrNone && pS && ((TUint64)pS->File().Size64() > KMaxLegacyFileSize) && (!(pS->IsFileModeBig())))
@@ -1502,10 +1513,11 @@
 // Open a directory listing. Leave on error.
 //
 	{
-	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMNEWDIRL, "this %x drive %d", (TUint) &FSys(), (TUint) DriveNumber());
+	TRACE2(UTF::EBorder, UTraceModuleFileSys::ECFileSystemNewDirL, EF32TraceUidFileSys, &FSys(), DriveNumber());
+
     CDirCB* pD = aDir = CurrentMount().NewDirL(); //-- construct CDirCB object, belonging to the corresponding mount
 
-	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMNEWDIRLRET, "r %d CDirCB %x", (TUint) KErrNone, (TUint) pD);
+	TRACE2(UTF::EBorder, UTraceModuleFileSys::ECFileSystemNewDirLRet, EF32TraceUidFileSys, KErrNone, pD);
 	pD->InitL(this);
 	// modify resource counter after initialisation to ensure correct cleanup
 	AddResource(CurrentMount());
@@ -1513,10 +1525,10 @@
 	pD->iUidType=aUidType;
 	Dirs->AddL(pD,ETrue);
 	aHandle=aSession->Handles().AddL(pD,ETrue);
-	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECMOUNTCBDIROPENL, "drive %d aDir %x", (TUint) DriveNumber(), (TUint) pD);
-	OstTraceData(TRACE_FILESYSTEM, FSYS_ECMOUNTCBDIROPENL_EDIRNAME, "Dir %S", aName.Ptr(), aName.Length()<<1);
+
+	TRACEMULT3(UTF::EBorder, UTraceModuleFileSys::ECMountCBDirOpenL, EF32TraceUidFileSys, DriveNumber(), aName, (TUint) pD);
 	CurrentMount().DirOpenL(aName,pD);
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBDIROPENLRET, "r %d", KErrNone);
+	TRACE1(UTF::EBorder, UTraceModuleFileSys::ECMountCBDirOpenLRet, EF32TraceUidFileSys, KErrNone);
 	}
 
 TInt TDrive::DirOpen(CSessionFs* aSession,TInt& aHandle,const TDesC& aName,TUint anAtt,const TUidType& aUidType)
@@ -1575,11 +1587,13 @@
 	if (r!=KErrNone)
 		return(r);
 	TPtrC entryName(StripBackSlash(aName));
+
 	TRACETHREADID(aMessage);
-	OstTraceExt5(TRACE_FILESYSTEM, FSYS_ECMOUNTCBREADFILESECTIONL, "drive %d clientThreadId %x aPos %x:%x aLength %d", (TUint) DriveNumber(), (TUint) threadId, (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), (TUint) aLength);
-	OstTraceData(TRACE_FILESYSTEM, FSYS_ECMOUNTCBREADFILESECTIONL_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT7(UTF::EBorder, UTraceModuleFileSys::ECMountCBReadFileSectionL, EF32TraceUidFileSys, 
+		DriveNumber(), aName, I64LOW(aPos), I64HIGH(aPos), (TUint) aTrg, aLength, I64LOW(threadId));
 	TRAP(r,ReadSectionL(entryName,aPos,aTrg,aLength,aMessage));
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBREADFILESECTIONLRET, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBReadFileSectionLRet, EF32TraceUidFileSys, r);
+
 	if (r==KErrHidden)
 		r=KErrNotFound;	
 	else if (r==KErrPathHidden)
@@ -1611,9 +1625,9 @@
 		TRAP(r,FlushCachedFileInfoL());
 	if (r==KErrNone)
 		{
-		OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBCHECKDISK1, "drive %d", DriveNumber());
+		TRACE1(UTF::EBorder, UTraceModuleFileSys::ECMountCBCheckDisk1, EF32TraceUidFileSys, DriveNumber());
 		r=CurrentMount().CheckDisk();
-		OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBCHECKDISK1RET, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBCheckDisk1Ret, EF32TraceUidFileSys, r);
 		}
 	return(r);
 	}
@@ -1628,9 +1642,9 @@
 		TRAP(r,FlushCachedFileInfoL());
 	if (r==KErrNone)
 		{
-		OstTraceExt4(TRACE_FILESYSTEM, FSYS_ECMOUNTCBCHECKDISK2, "drive %d aOperation %d aParam1 %x aParam2 %x", (TUint) DriveNumber(), (TUint) aOperation, (TUint) aParam1, (TUint) aParam2);
+		TRACE4(UTF::EBorder, UTraceModuleFileSys::ECMountCBCheckDisk2, EF32TraceUidFileSys, DriveNumber(), aOperation, aParam1, aParam2);
 		r=CurrentMount().CheckDisk(aOperation, aParam1, aParam2);
-		OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBCHECKDISK2RET, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBCheckDisk2Ret, EF32TraceUidFileSys, r);
 		}
 
 	return(r);
@@ -1652,9 +1666,10 @@
 	// Empty closed file queue
 	TClosedFileUtils::Remove(DriveNumber());
 
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBSCANDRIVE1, "drive %d", DriveNumber());
+	TRACE1(UTF::EBorder, UTraceModuleFileSys::ECMountCBScanDrive1, EF32TraceUidFileSys, DriveNumber());
 	r = CurrentMount().ScanDrive();
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBSCANDRIVE1RET, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBScanDrive1Ret, EF32TraceUidFileSys, r);
+
 	return r;
 	}
 
@@ -1678,9 +1693,10 @@
 	// Empty closed file queue
 	TClosedFileUtils::Remove(DriveNumber());
 
-	OstTraceExt4(TRACE_FILESYSTEM, FSYS_ECMOUNTCBSCANDRIVE2, "drive %d aOperation %d aParam1 %x aParam2 %x", (TUint) DriveNumber(), (TUint) aOperation, (TUint) aParam1, (TUint) aParam2);
+	TRACE4(UTF::EBorder, UTraceModuleFileSys::ECMountCBScanDrive2, EF32TraceUidFileSys, DriveNumber(), aOperation, aParam1, aParam2);
 	r = CurrentMount().ScanDrive(aOperation, aParam1, aParam2);
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBSCANDRIVE2RET, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBScanDrive2Ret, EF32TraceUidFileSys, r);
+
 	return r;
 	}
 
@@ -1694,11 +1710,11 @@
 	if (r!=KErrNone)
 		return(r);
 	TPtrC entryName(StripBackSlash(aName));
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBGETSHORTNAMEL, "drive %d", DriveNumber());
-	OstTraceData(TRACE_FILESYSTEM, FSYS_ECMOUNTCBGETSHORTNAMEL_ELONGNAME, "LongName %S", entryName.Ptr(), entryName.Length()<<1);
+
+	TRACEMULT2(UTF::EBorder, UTraceModuleFileSys::ECMountCBGetShortNameL, EF32TraceUidFileSys, DriveNumber(), entryName);
 	TRAP(r,CurrentMount().GetShortNameL(entryName,aShortName));
-	OstTraceData(TRACE_FILESYSTEM, FSYS_ECMOUNTCBGETSHORTNAMEL_ESHORTNAME, "ShortName %S", aShortName.Ptr(), aShortName.Length()<<1);
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBGETSHORTNAMEL_ECMOUNTCBGETSHORTNAMELRET, "r %d", r);
+	TRACERETMULT2(UTF::EBorder, UTraceModuleFileSys::ECMountCBGetShortNameLRet, EF32TraceUidFileSys, r, aShortName);
+
 	return(r);
 	}
 
@@ -1711,11 +1727,11 @@
 	if (r!=KErrNone)
 		return(r);
 	TPtrC entryName(StripBackSlash(aShortName));
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBGETLONGNAMEL, "drive %d", DriveNumber());
-	OstTraceData(TRACE_FILESYSTEM, FSYS_ECMOUNTCBGETLONGNAMEL_ESHORTNAME, "ShortName %S", entryName.Ptr(), entryName.Length()<<1);
+
+	TRACEMULT2(UTF::EBorder, UTraceModuleFileSys::ECMountCBGetLongNameL, EF32TraceUidFileSys, DriveNumber(), entryName);
 	TRAP(r,CurrentMount().GetLongNameL(entryName,aLongName));
-	OstTraceData(TRACE_FILESYSTEM, FSYS_ECMOUNTCBGETLONGNAMEL_ELONGNAME, "LongName %S", aLongName.Ptr(), aLongName.Length()<<1);
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBGETLONGNAMELRET, "r %d", r);
+	TRACERETMULT2(UTF::EBorder, UTraceModuleFileSys::ECMountCBGetLongNameLRet, EF32TraceUidFileSys, r, aLongName);
+
 	return(r);
 	}
 
@@ -1879,18 +1895,22 @@
 		return(KErrNotReady);
 	TInt r;
 	CMountCB* pM=NULL;
-	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMNEWMOUNTL1, "this %x drive %d", (TUint) &FSys(), (TUint) DriveNumber());
+	TRACE2(UTF::EBorder, UTraceModuleFileSys::ECFileSystemNewMountL, EF32TraceUidFileSys, &FSys(), DriveNumber());
 	TRAP(r,pM=FSys().NewMountL());
-	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMNEWMOUNTL1RET, "r %d CMountCB %x", (TUint) r, (TUint) pM);
+	TRACERET2(UTF::EBorder, UTraceModuleFileSys::ECFileSystemNewMountLRet, EF32TraceUidFileSys, r, pM);
 	if(r!=KErrNone)
 		return(r);
 	pM->SetDrive(this);
-	OstTraceExt4(TRACE_FILESYSTEM, FSYS_ECMOUNTCBFORCEREMOUNTDRIVE, "drive %d aMountInfo %x aMountInfoMessageHandle %x aFlags %x", (TUint) DriveNumber(), (TUint) aMountInfo, (TUint) aMountInfoMessageHandle, (TUint) aFlags);
+
+	TRACE4(UTF::EBorder, UTraceModuleFileSys::ECMountCBForceRemountDrive, EF32TraceUidFileSys, 
+		DriveNumber(), aMountInfo, aMountInfoMessageHandle, aFlags);
 	r=pM->ForceRemountDrive(aMountInfo,aMountInfoMessageHandle,aFlags);
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBFORCEREMOUNTDRIVERET, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBForceRemountDriveRet, EF32TraceUidFileSys, r);
+
 	pM->Close();
 	return(r);
 	}
+
 TBool TDrive::IsExtensionMounted(CProxyDriveFactory* aFactory)
 //
 // return ETrue if extension mounted on the drive
@@ -1903,6 +1923,7 @@
 		}
 	return(EFalse);
 	}
+
 TInt TDrive::MountExtension(CProxyDriveFactory* aFactory,TBool aIsPrimary)
 //
 // Mount an extension
@@ -1926,7 +1947,7 @@
 	if(iFSys==NULL)
 		return(KErrNotReady);
 	TBool extSupported = iFSys->IsExtensionSupported();
-	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMISEXTENSIONSUPPORTED1, "%x r %d", (TUint) iFSys, (TUint) extSupported);
+	TRACE1(UTF::EBorder, UTraceModuleFileSys::ECFileSystemIsExtensionSupported, EF32TraceUidFileSys, extSupported);
 	if(!extSupported)
 		return(KErrNotSupported);
 	if(IsExtensionMounted(aFactory))
@@ -2014,16 +2035,17 @@
 		return(KErrNotReady);
 	TInt r;
 	CMountCB* pM=NULL;
-	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMNEWMOUNTL2, "this %x drive %d", (TUint) &FSys(), (TUint) DriveNumber());
+	TRACE2(UTF::EBorder, UTraceModuleFileSys::ECFileSystemNewMountL, EF32TraceUidFileSys, &FSys(), DriveNumber());
 	TRAP(r,pM=FSys().NewMountL());
-	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMNEWMOUNTL2RET, "r %d CMountCB %x", (TUint) r, (TUint) pM);
+	TRACERET2(UTF::EBorder, UTraceModuleFileSys::ECFileSystemNewMountLRet, EF32TraceUidFileSys, r, pM);
 	if(r!=KErrNone)
 		return(r);
 	pM->SetDrive(this);
 
-	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECMOUNTCBLOCK, "drive %d aStore %d", (TUint) DriveNumber(), (TUint) aStore);
+	TRACE2(UTF::EBorder, UTraceModuleFileSys::ECMountCBLock, EF32TraceUidFileSys, DriveNumber(), aStore);
 	r=pM->Lock(aOld,aNew,aStore);
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBLOCKRET, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBLockRet, EF32TraceUidFileSys, r);
+
 	pM->Close();
 	return(r);
 	}
@@ -2039,9 +2061,9 @@
 		return(KErrNotReady);
 	TInt r;
 	CMountCB* pM=NULL;
-	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMNEWMOUNTL3, "this %x drive %d", (TUint) &FSys(), (TUint) DriveNumber());
+	TRACE2(UTF::EBorder, UTraceModuleFileSys::ECFileSystemNewMountL, EF32TraceUidFileSys, &FSys(), DriveNumber());
 	TRAP(r,pM=FSys().NewMountL());
-	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMNEWMOUNTL3RET, "r %d CMountCB %x", (TUint) r, (TUint) pM);
+	TRACERET2(UTF::EBorder, UTraceModuleFileSys::ECFileSystemNewMountLRet, EF32TraceUidFileSys, r, pM);
 	if(r!=KErrNone)
 		return(r);
 
@@ -2050,9 +2072,10 @@
 
 	pM->SetDrive(this);
 
-	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECMOUNTCBUNLOCK, "drive %d aStore %d", (TUint) DriveNumber(), (TUint) aStore);
+	TRACE2(UTF::EBorder, UTraceModuleFileSys::ECMountCBUnlock, EF32TraceUidFileSys, DriveNumber(), aStore);
 	r=pM->Unlock(aPassword,aStore);
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBUNLOCKRET, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBUnlockRet, EF32TraceUidFileSys, r);
+
 	pM->Close();
 	return(r);
 	}
@@ -2068,9 +2091,9 @@
 		return(KErrNotReady);
 	TInt r;
 	CMountCB* pM=NULL;
-	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMNEWMOUNTL4, "this %x drive %d", (TUint) &FSys(), (TUint) DriveNumber());
+	TRACE2(UTF::EBorder, UTraceModuleFileSys::ECFileSystemNewMountL, EF32TraceUidFileSys, &FSys(), DriveNumber());
 	TRAP(r,pM=FSys().NewMountL());
-	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMNEWMOUNTL4RET, "r %d CMountCB %x", (TUint) r, (TUint) pM);
+	TRACERET2(UTF::EBorder, UTraceModuleFileSys::ECFileSystemNewMountLRet, EF32TraceUidFileSys, r, pM);
 	if(r!=KErrNone)
 		return(r);
 	pM->SetDrive(this);
@@ -2084,9 +2107,10 @@
 	if (info.iMediaAtt & KMediaAttLocked)
 		UnlockDevice(aPassword, EFalse);
 
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBCLEARPASSWORD, "drive %d", DriveNumber());
+	TRACE1(UTF::EBorder, UTraceModuleFileSys::ECMountCBClearPassword, EF32TraceUidFileSys, DriveNumber());
 	r=pM->ClearPassword(aPassword);
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBCLEARPASSWORDRET, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBClearPasswordRet, EF32TraceUidFileSys, r);
+
 	pM->Close();
 	return(r);
 	}
@@ -2102,16 +2126,17 @@
 		return(KErrNotReady);
 	TInt r;
 	CMountCB* pM=NULL;
-	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMNEWMOUNTL5, "this %x drive %d", (TUint) &FSys(), (TUint) DriveNumber());
+	TRACE2(UTF::EBorder, UTraceModuleFileSys::ECFileSystemNewMountL, EF32TraceUidFileSys, &FSys(), DriveNumber());
 	TRAP(r,pM=FSys().NewMountL());
-	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMNEWMOUNTL5RET, "r %d CMountCB %x", (TUint) r, (TUint) pM);
+	TRACERET2(UTF::EBorder, UTraceModuleFileSys::ECFileSystemNewMountLRet, EF32TraceUidFileSys, r, pM);
 	if(r!=KErrNone)
 		return(r);
 	pM->SetDrive(this);
 
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBERASEPASSWORD, "drive %d", DriveNumber());
+	TRACE1(UTF::EBorder, UTraceModuleFileSys::ECMountCBErasePassword, EF32TraceUidFileSys, DriveNumber());
 	r=pM->ErasePassword();
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBERASEPASSWORDRET, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBErasePasswordRet, EF32TraceUidFileSys, r);
+
 	pM->Close();
 	return(r);
 	}
@@ -2196,9 +2221,8 @@
 
 
 /**
-    Gracefully dismounts the current mount. This is method is called from outside, so do some finalisation work on mount.
+Dismounts the current mount. This is method is called from outside, so do some finalisation work on mount.
 After calling this function there is no current mount on the drive.
-
 */
 EXPORT_C void TDrive::Dismount()
 	{
@@ -2208,12 +2232,10 @@
 	if (!iCurrentMount)
 		return;
 
-    //-- try to do the best flushing file caches
     TRAP_IGNORE(FlushCachedFileInfoL());
 
     //-- try our best to finalise the mount (the mount can decide to do some job during finalisation, e.g. write some data)
-    //-- finalise the mount in RO mode, we are dismounting the FS anyway
-    TRAP_IGNORE(iCurrentMount->FinaliseMountL(RFs::EFinal_RO));
+    TRAP_IGNORE(iCurrentMount->FinaliseMountL());
     
     DoDismount();
 	}
@@ -2222,7 +2244,8 @@
 
 
 /**
-    Dismounts the current mount by force.
+Forcibly dismounts the current mount and prevents it being remounted.
+After calling this function there is no current mount on the drive.
 */
 void TDrive::ForceDismount()
 	{
@@ -2234,15 +2257,7 @@
 		return;
   
 	TRAP_IGNORE(FlushCachedFileInfoL());
-
-    //-- try our best to finalise the mount (the mount can decide to do some job during finalisation, e.g. write some data)
-    //-- finalise the mount in RO mode, we are dismounting the FS anyway
-    TRAP_IGNORE(iCurrentMount->FinaliseMountL(RFs::EFinal_RO));
-
-    //-- mark the mount as 'Dismounted'; this invalidates all object handles until the mount is successfully "remounted". 
-    //-- if there are still some objects opened on this mount, CMountCB::Close() won't destroy it until all objects are closed.
-    iCurrentMount->SetDismounted(); 
-    
+	iCurrentMount->SetDismounted(); //! this affects TDrive::ReMount()
     DoDismount();
 	}
 
@@ -2260,9 +2275,10 @@
 	if (!iCurrentMount)
 		return;
 
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBDISMOUNTED, "drive %d", DriveNumber());
+	TRACE1(UTF::EBorder, UTraceModuleFileSys::ECMountCBDismounted, EF32TraceUidFileSys, DriveNumber());
     iCurrentMount->Dismounted();
-	OstTrace0(TRACE_FILESYSTEM, FSYS_ECMOUNTCBDISMOUNTEDRET, "");
+	TRACE0(UTF::EBorder, UTraceModuleFileSys::ECMountCBDismountedRet, EF32TraceUidFileSys);
+
 	iCurrentMount->Close();
 	iCurrentMount=NULL;
     }
@@ -2359,6 +2375,7 @@
 	}
 
 
+
 TInt TDrive::ControlIO(const RMessagePtr2& aMessage,TInt aCommand,TAny* aParam1,TAny* aParam2)
 //
 // General purpose test interface - .FSY specific.
@@ -2368,9 +2385,10 @@
 	if(r==KErrNone || (r==KErrInUse && iReason==KErrNone))
 		{
 		TRACETHREADID(aMessage);
-		OstTraceExt5(TRACE_FILESYSTEM, FSYS_ECMOUNTCBCONTROLIO, "drive %d aCommand %d aParam1 %x aParam2 %x clientThreadId %x", (TUint) DriveNumber(), (TUint) aCommand, (TUint) aParam1, (TUint) aParam2, (TUint) threadId);
+		TRACE5(UTF::EBorder, UTraceModuleFileSys::ECMountCBControlIO, EF32TraceUidFileSys, 
+			DriveNumber(), aCommand, aParam1, aParam2, I64LOW(threadId));
 		r=CurrentMount().ControlIO(aMessage,aCommand,aParam1,aParam2);
-		OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBCONTROLIORET, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBControlIORet, EF32TraceUidFileSys, r);
 		}
 	return(r);
 	}
@@ -2587,10 +2605,11 @@
     {
     ASSERT(!(apLDFormatInfo && apVolFormatParam));  //-- these parameters are mutually exclusive
     
-    OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMNEWFORMATL, "this %x drive %d", (TUint) &FSys(), (TUint) DriveNumber()); 
+    TRACE2(UTF::EBorder, UTraceModuleFileSys::ECFileSystemNewFormatL, EF32TraceUidFileSys, &FSys(), DriveNumber()); 
+
     CFormatCB* pFormat = CurrentMount().NewFormatL(); 
 
-	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMNEWFORMATLRET, "r %d CFormatCB %x", (TUint) KErrNone, (TUint) pFormat); 
+	TRACE2(UTF::EBorder, UTraceModuleFileSys::ECFileSystemNewFormatLRet, EF32TraceUidFileSys, KErrNone, pFormat); 
 	
     Formats->AddL(pFormat, ETrue); 
 	pFormat->InitL(this, aFmtMode); 
--- a/userlibandfileserver/fileserver/sfile/sf_ext.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_ext.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,10 +15,9 @@
 // 
 //
 
+
 #include "sf_std.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "sf_extTraces.h"
-#endif
+
 typedef CProxyDriveFactory*(*TExtensionNew)();
 typedef CExtProxyDriveFactory*(*TProxyDriveNew)();
 
@@ -327,10 +326,12 @@
 */
 CLocalProxyDrive* CLocalProxyDrive::New(CMountCB* aMount,TBusLocalDrive& aLocDrv)
 	{
-	OstTraceExt2(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVENEW, "aMount %x drive %d", (TUint) aMount, (TUint) aMount->DriveNumber());
+	TRACE2(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveNew, EF32TraceUidProxyDrive, 
+		aMount, aMount->DriveNumber());
+
 	CLocalProxyDrive* proxyDrive = new CLocalProxyDrive(aMount,aLocDrv);
 	
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVENEWRET, "proxyDrive %x", proxyDrive);
+	TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveNewRet, EF32TraceUidProxyDrive, proxyDrive);
 	return proxyDrive;
 	}
 
@@ -356,8 +357,9 @@
 */
 TInt CLocalProxyDrive::Initialise()
 	{
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEINITIALISE, "this %x", this);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEINITIALISERET, "r %d", KErrNone);
+	TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveInitialise, EF32TraceUidProxyDrive, this);
+	TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveInitialiseRet, EF32TraceUidProxyDrive, KErrNone);
+
 	return(KErrNone);
 	}
 
@@ -371,8 +373,9 @@
 */
 TInt CLocalProxyDrive::Dismounted()
 	{
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEDISMOUNTED, "this %x", this);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEDISMOUNTEDRET, "r %d", KErrNone);
+	TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveDismounted, EF32TraceUidProxyDrive, this);
+	TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveDismountedRet, EF32TraceUidProxyDrive, KErrNone);
+
 	return(KErrNone);
 	}
 
@@ -386,9 +389,11 @@
 */
 TInt CLocalProxyDrive::Enlarge(TInt aLength)
 	{
-	OstTraceExt2(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEENLARGE, "this %x aLength %d", (TUint) this, (TUint) aLength);
+	TRACE2(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveEnlarge, EF32TraceUidProxyDrive, this, aLength);
+
 	TInt r = iLocDrv.Enlarge(aLength);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEENLARGERET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveEnlargeRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -406,9 +411,11 @@
 */
 TInt CLocalProxyDrive::ReduceSize(TInt aPos, TInt aLength)
 	{
-	OstTraceExt3(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEREDUCESIZE, "this %x aPos %x aLength %d", (TUint) this, (TUint) aPos, (TUint) aLength);
+	TRACE3(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveReduceSize, EF32TraceUidProxyDrive, this, aPos, aLength);
+
 	TInt r = iLocDrv.ReduceSize(aPos,aLength);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEREDUCESIZERET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveReduceSizeRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -428,9 +435,12 @@
 TInt CLocalProxyDrive::Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt aOffset, TInt aFlags)
 	{
 	TRACETHREADIDH(aThreadHandle);
-	OstTraceExt5(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEREAD1, "this %x clientThreadId %x aPos %x:%x aLength %d", (TUint) this, (TUint) threadId, (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), aLength);
+	TRACE8(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveRead1, EF32TraceUidProxyDrive, 
+		this, I64LOW(aPos), I64HIGH(aPos), aLength, aTrg, threadId, aOffset, aFlags);
+
 	TInt r = iLocDrv.Read(aPos,aLength,aTrg,aThreadHandle,aOffset,aFlags);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEREAD1RET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveRead1Ret, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -448,9 +458,12 @@
 TInt CLocalProxyDrive::Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt anOffset)
 	{
 	TRACETHREADIDH(aThreadHandle);
-	OstTraceExt5(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEREAD2, "this %x clientThreadId %x aPos %x:%x aLength %d", (TUint) this, (TUint) threadId, (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), aLength);
+	TRACE7(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveRead2, EF32TraceUidProxyDrive, 
+		this, I64LOW(aPos), I64HIGH(aPos), aLength, aTrg, threadId, anOffset);
+
 	TInt r = iLocDrv.Read(aPos,aLength,aTrg,aThreadHandle,anOffset);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEREAD2RET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveRead2Ret, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -465,9 +478,12 @@
 */
 TInt CLocalProxyDrive::Read(TInt64 aPos,TInt aLength,TDes8& aTrg)
 	{
-	OstTraceExt5(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEREAD3, "this %x aPos %x:%x aLength %d aTrg %x", (TUint) this, (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), aLength, (TUint) &aTrg);
+	TRACE5(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveRead3, EF32TraceUidProxyDrive, 
+		this, I64LOW(aPos), I64HIGH(aPos), aLength, &aTrg);
+
 	TInt r = iLocDrv.Read(aPos,aLength,aTrg);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEREAD3RET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveRead3Ret, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -487,9 +503,13 @@
 TInt CLocalProxyDrive::Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt aOffset,TInt aFlags)
 	{
 	TRACETHREADIDH(aThreadHandle);
-	OstTraceExt5(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEWRITE1, "this %x clientThreadId %x aPos %x:%x aLength %d", (TUint) this, (TUint) threadId, (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), aLength);
+	TRACE8(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveWrite1, EF32TraceUidProxyDrive, 
+		this, I64LOW(aPos), I64HIGH(aPos), aLength, aSrc, threadId, aOffset, aFlags);
+
 	TInt r = iLocDrv.Write(aPos,aLength,aSrc,aThreadHandle,aOffset,aFlags);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEWRITE1RET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveWrite1Ret, EF32TraceUidProxyDrive, r);
+
 	return r;
 	}
 
@@ -508,9 +528,12 @@
 TInt CLocalProxyDrive::Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt anOffset)
 	{
 	TRACETHREADIDH(aThreadHandle);
-	OstTraceExt5(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEWRITE2, "this %x clientThreadId %x aPos %x:%x aLength %d", (TUint) this, (TUint) threadId, (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), aLength);
+	TRACE7(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveWrite2, EF32TraceUidProxyDrive, 
+		this, I64LOW(aPos), I64HIGH(aPos), aLength, aSrc, threadId, anOffset);
+
 	TInt r = iLocDrv.Write(aPos,aLength,aSrc,aThreadHandle,anOffset);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEWRITE2RET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveWrite2Ret, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -525,9 +548,12 @@
 */
 TInt CLocalProxyDrive::Write(TInt64 aPos,const TDesC8& aSrc)
 	{
-	OstTraceExt5(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEWRITE3, "this %x aPos %x:%x aLength %d aSrc %x", (TUint) this, (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), aSrc.Length(), (TUint) &aSrc);
+	TRACE5(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveWrite3, EF32TraceUidProxyDrive, 
+		this, I64LOW(aPos), I64HIGH(aPos), aSrc.Length(), &aSrc);
+
 	TInt r = iLocDrv.Write(aPos,aSrc);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEWRITE3RET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveWrite3Ret, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 	
@@ -541,9 +567,11 @@
 */
 TInt CLocalProxyDrive::Caps(TDes8& anInfo)
 	{
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVECAPS, "this %x", this);
+	TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveCaps, EF32TraceUidProxyDrive, this);
+
 	TInt r = iLocDrv.Caps(anInfo);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVECAPSRET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveCapsRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -557,9 +585,12 @@
 */
 TInt CLocalProxyDrive::Format(TFormatInfo& anInfo)
 	{
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEFORMAT1, "this %x", this);
+	TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveFormat1, EF32TraceUidProxyDrive, this);
+
 	TInt r = iLocDrv.Format(anInfo);
-	OstTraceExt4(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEFORMAT1RET, "r %d iFormatIsCurrent %d i512ByteSectorsFormatted %d iMaxBytesPerFormat %d", (TUint) r, (TUint) anInfo.iFormatIsCurrent, (TUint) anInfo.i512ByteSectorsFormatted, (TUint) anInfo.iMaxBytesPerFormat);
+
+	TRACE4(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveFormat1Ret, EF32TraceUidProxyDrive, 
+		r, anInfo.iFormatIsCurrent, anInfo.i512ByteSectorsFormatted, anInfo.iMaxBytesPerFormat);
 	return r;
 	}
 
@@ -574,9 +605,12 @@
 */
 TInt CLocalProxyDrive::Format(TInt64 aPos,TInt aLength)
 	{
-	OstTraceExt4(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEFORMAT2, "this %x aPos %x:%x aLength %d", (TUint) this, (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), (TUint) aLength);
+	TRACE4(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveFormat2, EF32TraceUidProxyDrive, 
+		this, I64LOW(aPos), I64HIGH(aPos), aLength);
+
 	TInt r = iLocDrv.Format(aPos,aLength);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEFORMAT2RET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveFormat2Ret, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -591,9 +625,11 @@
 */
 TInt CLocalProxyDrive::SetMountInfo(const TDesC8* aMountInfo,TInt aMountInfoThreadHandle)
 	{
-	OstTraceExt3(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVESETMOUNTINFO, "this %x aMountInfo %x aMountInfoThreadHandle %d", (TUint) this, (TUint) aMountInfo, (TUint) aMountInfoThreadHandle);
+	TRACE3(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveSetMountInfo, EF32TraceUidProxyDrive, this, aMountInfo, aMountInfoThreadHandle);
+
 	TInt r = iLocDrv.SetMountInfo(aMountInfo,aMountInfoThreadHandle);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVESETMOUNTINFORET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveSetMountInfoRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -607,9 +643,11 @@
 */
 TInt CLocalProxyDrive::ForceRemount(TUint aFlags)
 	{
-	OstTraceExt2(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEFORCEREMOUNT, "this %x aFlags %x", (TUint) this, (TUint) aFlags);
+	TRACE2(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveForceRemount, EF32TraceUidProxyDrive, this, aFlags);
+
 	TInt r = iLocDrv.ForceRemount(aFlags);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEFORCEREMOUNTRET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveForceRemountRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -626,9 +664,11 @@
 */
 TInt CLocalProxyDrive::ControlIO(const RMessagePtr2& /*aMessage*/,TInt aCommand,TAny* aParam1,TAny* aParam2)
 	{
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVECONTROLIO, "this %x", this);
+	TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveControlIO, EF32TraceUidProxyDrive, this);
+
 	TInt r = iLocDrv.ControlIO(aCommand,aParam1,aParam2);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVECONTROLIORET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveControlIORet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 	
@@ -643,9 +683,11 @@
 */
 TInt CLocalProxyDrive::Unlock(TMediaPassword &aPassword, TBool aStorePassword)
 	{
-	OstTraceExt2(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEUNLOCK, "this %x aPassword %d", (TUint) this, (TUint) aStorePassword);
+	TRACE2(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveUnlock, EF32TraceUidProxyDrive, this, aStorePassword);
+
 	TInt r = iLocDrv.Unlock(aPassword,aStorePassword);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEUNLOCKRET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveUnlockRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -661,9 +703,11 @@
 */
 TInt CLocalProxyDrive::Lock(TMediaPassword &aOldPassword, TMediaPassword &aNewPassword, TBool aStorePassword)
 	{
-	OstTraceExt2(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVELOCK, "this %x aPassword %d", (TUint) this, (TUint) aStorePassword);
+	TRACE2(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveLock, EF32TraceUidProxyDrive, this, aStorePassword);
+
 	TInt r = iLocDrv.SetPassword(aOldPassword,aNewPassword,aStorePassword);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVELOCKRET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveLockRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -677,9 +721,11 @@
 */
 TInt CLocalProxyDrive::Clear(TMediaPassword &aPassword)
 	{
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVECLEAR, "this %x", this);
+	TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveClear, EF32TraceUidProxyDrive, this);
+
 	TInt r = iLocDrv.Clear(aPassword);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVECLEARRET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveClearRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -690,9 +736,11 @@
 */
 TInt CLocalProxyDrive::ErasePassword()
 	{
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEERASEPASSWORD, "this %x", this);
+	TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveErasePassword, EF32TraceUidProxyDrive, this);
+
 	TInt r = iLocDrv.ErasePassword();
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEERASEPASSWORDRET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveErasePasswordRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -702,13 +750,17 @@
 
 @param aPos    The position of the data which is being deleted.
 @param aLength The length of the data which is being deleted.
+
 @return System wide error code.
 */
 TInt CLocalProxyDrive::DeleteNotify(TInt64 aPos, TInt aLength)
 	{
-	OstTraceExt4(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEDELETENOTIFY, "this %x aPos %x:%x aLength %d", (TUint) this, (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), (TUint) aLength);
+	TRACE4(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveDeleteNotify, EF32TraceUidProxyDrive, 
+		this, I64LOW(aPos), I64HIGH(aPos), aLength);
+
 	TInt r = iLocDrv.DeleteNotify(aPos, aLength);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEDELETENOTIFYRET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveDeleteNotifyRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -722,16 +774,20 @@
 */	
 TInt CLocalProxyDrive::GetLastErrorInfo(TDes8 &aErrorInfo)
 	{
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEGETLASTERRORINFO, "this %x", this);
+	TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveGetLastErrorInfo, EF32TraceUidProxyDrive, this);
+
 	TInt r = iLocDrv.GetLastErrorInfo(aErrorInfo);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEGETLASTERRORINFORET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveGetLastErrorInfoRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
 
 TInt CLocalProxyDrive::GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput)
 	{
-	OstTraceExt3(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEGETINTERFACE, "this %x aInterfaceId %d aInput %x", (TUint) this, (TUint) aInterfaceId, (TUint) aInput);
+	TRACE3(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveGetInterface, EF32TraceUidProxyDrive, 
+		this, aInterfaceId, aInput);
+
 	TInt r;
 	switch(aInterfaceId)
 		{
@@ -749,7 +805,8 @@
 		default:
 			r= CProxyDrive::GetInterface(aInterfaceId,aInterface,aInput);
 		}
-	OstTraceExt2(TRACE_DRIVE, PROXYDRIVE_ECLOCALPROXYDRIVEGETINTERFACERET, "r %d aInterface %x", (TUint) r, (TUint) aInterface);
+
+	TRACERET2(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveGetInterfaceRet, EF32TraceUidProxyDrive, r, aInterface);
 	return r;
 	}
 
@@ -786,9 +843,11 @@
 */
 EXPORT_C TInt CBaseExtProxyDrive::Initialise()
 	{
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEINITIALISE, "this %x", this);
+	TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveInitialise, EF32TraceUidProxyDrive, this);
+
 	TInt r = iProxy->Initialise();
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEINITIALISERET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveInitialiseRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -800,9 +859,11 @@
 */
 EXPORT_C TInt CBaseExtProxyDrive::Dismounted()
 	{
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEDISMOUNTED, "this %x", this);
+	TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveDismounted, EF32TraceUidProxyDrive, this);
+
 	TInt r = iProxy->Dismounted();
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEDISMOUNTEDRET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveDismountedRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -815,9 +876,11 @@
 */
 EXPORT_C TInt CBaseExtProxyDrive::Enlarge(TInt aLength)
 	{
-	OstTraceExt2(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEENLARGE, "this %x aLength %d", (TUint) this, (TUint) aLength);
+	TRACE2(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveEnlarge, EF32TraceUidProxyDrive, this, aLength);
+
 	TInt r = iProxy->Enlarge(aLength);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEENLARGERET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveEnlargeRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -835,9 +898,11 @@
 */
 EXPORT_C TInt CBaseExtProxyDrive::ReduceSize(TInt aPos, TInt aLength)
 	{
-	OstTraceExt3(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEREDUCESIZE, "this %x aPos %x aLength %d", (TUint) this, (TUint) aPos, (TUint) aLength);
+	TRACE3(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveReduceSize, EF32TraceUidProxyDrive, this, aPos, aLength);
+
 	TInt r = iProxy->ReduceSize(aPos,aLength);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEREDUCESIZERET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveReduceSizeRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -857,9 +922,13 @@
 EXPORT_C TInt CBaseExtProxyDrive::Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt aOffset,TInt aFlags)
 	{
 	TRACETHREADIDH(aThreadHandle);
-	OstTraceExt5(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEREAD1, "this %x clientThreadId %x aPos %x:%x aLength %d", (TUint) this, (TUint) threadId, (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), aLength);
+	TRACE8(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveRead1, EF32TraceUidProxyDrive, 
+		this, I64LOW(aPos), I64HIGH(aPos), aLength, aTrg, threadId, aOffset, aFlags);
+
 	TInt r = iProxy->Read(aPos,aLength,aTrg,aThreadHandle,aOffset,aFlags);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEREAD1RET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveRead1Ret, EF32TraceUidProxyDrive, r);
+
 	return r;
 	}
 
@@ -878,9 +947,12 @@
 EXPORT_C TInt CBaseExtProxyDrive::Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt anOffset)
 	{
 	TRACETHREADIDH(aThreadHandle);
-	OstTraceExt5(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEREAD2, "this %x clientThreadId %x aPos %x:%x aLength %d", (TUint) this, (TUint) threadId, (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), aLength);
+	TRACE7(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveRead2, EF32TraceUidProxyDrive, 
+		this, I64LOW(aPos), I64HIGH(aPos), aLength, aTrg, threadId, anOffset);
+
 	TInt r = iProxy->Read(aPos,aLength,aTrg,aThreadHandle,anOffset);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEREAD2RET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveRead2Ret, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -896,10 +968,12 @@
 */
 EXPORT_C TInt CBaseExtProxyDrive::Read(TInt64 aPos,TInt aLength,TDes8& aTrg)
 	{
-	OstTraceExt5(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEREAD3, "this %x aPos %x:%x aLength %d aTrg %x", (TUint) this, (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), aLength, (TUint) &aTrg);
-		
+	TRACE5(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveRead3, EF32TraceUidProxyDrive, 
+		this, I64LOW(aPos), I64HIGH(aPos), aLength, &aTrg);
+
 	TInt r = iProxy->Read(aPos,aLength,aTrg);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEREAD3RET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveRead3Ret, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -919,9 +993,12 @@
 EXPORT_C TInt CBaseExtProxyDrive::Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt aOffset,TInt aFlags)
 	{
 	TRACETHREADIDH(aThreadHandle);
-	OstTraceExt5(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEWRITE1, "this %x clientThreadId %x aPos %x:%x aLength %d", (TUint) this, (TUint) threadId, (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), aLength);
+	TRACE8(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveWrite1, EF32TraceUidProxyDrive, 
+		this, I64LOW(aPos), I64HIGH(aPos), aLength, aSrc, threadId, aOffset, aFlags);
+
 	TInt r = iProxy->Write(aPos,aLength,aSrc,aThreadHandle,aOffset,aFlags);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEWRITE1RET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveWrite1Ret, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -940,9 +1017,12 @@
 EXPORT_C TInt CBaseExtProxyDrive::Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt anOffset)
 	{
 	TRACETHREADIDH(aThreadHandle);
-	OstTraceExt5(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEWRITE2, "this %x clientThreadId %x aPos %x:%x aLength %d", (TUint) this, (TUint) threadId, (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), aLength);
+	TRACE7(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveWrite2, EF32TraceUidProxyDrive, 
+		this, I64LOW(aPos), I64HIGH(aPos), aLength, aSrc, threadId, anOffset);
+
 	TInt r = iProxy->Write(aPos,aLength,aSrc,aThreadHandle,anOffset);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEWRITE2RET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveWrite2Ret, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -957,9 +1037,12 @@
 */
 EXPORT_C TInt CBaseExtProxyDrive::Write(TInt64 aPos,const TDesC8& aSrc)
 	{
-	OstTraceExt5(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEWRITE3, "this %x aPos %x:%x aLength %d aSrc %x", (TUint) this, (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), aSrc.Length(), (TUint) &aSrc);
+	TRACE5(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveWrite3, EF32TraceUidProxyDrive, 
+		this, I64LOW(aPos), I64HIGH(aPos), aSrc.Length(), &aSrc);
+
 	TInt r = iProxy->Write(aPos,aSrc);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEWRITE3RET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveWrite3Ret, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -973,9 +1056,11 @@
 */
 EXPORT_C TInt CBaseExtProxyDrive::Caps(TDes8& anInfo)
 	{
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVECAPS, "this %x", this);
+	TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveCaps, EF32TraceUidProxyDrive, this);
+
 	TInt r = iProxy->Caps(anInfo);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVECAPSRET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveCapsRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -989,9 +1074,12 @@
 */
 EXPORT_C TInt CBaseExtProxyDrive::Format(TFormatInfo& anInfo)
 	{
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEFORMAT1, "this %x", this);
+	TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveFormat1, EF32TraceUidProxyDrive, this);
+
 	TInt r = iProxy->Format(anInfo);
-	OstTraceExt4(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEFORMAT1RET, "r %d iFormatIsCurrent %d i512ByteSectorsFormatted %d iMaxBytesPerFormat %d", (TUint) r, (TUint) anInfo.iFormatIsCurrent, (TUint) anInfo.i512ByteSectorsFormatted, (TUint) anInfo.iMaxBytesPerFormat);
+
+	TRACE4(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveFormat1Ret, EF32TraceUidProxyDrive, 
+		r, anInfo.iFormatIsCurrent, anInfo.i512ByteSectorsFormatted, anInfo.iMaxBytesPerFormat);
 	return r;
 	}
 
@@ -1006,9 +1094,12 @@
 */
 EXPORT_C TInt CBaseExtProxyDrive::Format(TInt64 aPos,TInt aLength)
 	{
-	OstTraceExt4(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEFORMAT2, "this %x aPos %x:%x aLength %d", (TUint) this, (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), (TUint) aLength);
+	TRACE4(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveFormat2, EF32TraceUidProxyDrive, 
+		this, I64LOW(aPos), I64HIGH(aPos), aLength);
+
 	TInt r = iProxy->Format(aPos,aLength);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEFORMAT2RET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveFormat2Ret, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -1023,9 +1114,11 @@
 */
 EXPORT_C TInt CBaseExtProxyDrive::SetMountInfo(const TDesC8* aMountInfo,TInt aMountInfoThreadHandle)
 	{
-	OstTraceExt3(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVESETMOUNTINFO, "this %x aMountInfo %x aMountInfoThreadHandle %x", (TUint) this, (TUint) aMountInfo, (TUint) aMountInfoThreadHandle);
+	TRACE3(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveSetMountInfo, EF32TraceUidProxyDrive, this, aMountInfo, aMountInfoThreadHandle);
+
 	TInt r = iProxy->SetMountInfo(aMountInfo,aMountInfoThreadHandle);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVESETMOUNTINFORET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveSetMountInfoRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -1039,9 +1132,11 @@
 */
 EXPORT_C TInt CBaseExtProxyDrive::ForceRemount(TUint aFlags)
 	{
-	OstTraceExt2(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEFORCEREMOUNT, "this %x aFlags%x", (TUint) this, (TUint) aFlags);
+	TRACE2(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveForceRemount, EF32TraceUidProxyDrive, this, aFlags);
+
 	TInt r = iProxy->ForceRemount(aFlags);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEFORCEREMOUNTRET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveForceRemountRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -1056,9 +1151,11 @@
 */
 EXPORT_C TInt CBaseExtProxyDrive::Unlock(TMediaPassword &aPassword, TBool aStorePassword)
 	{
-	OstTraceExt2(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEUNLOCK, "this %x aPassword %d", (TUint) this, (TUint) aStorePassword);
+	TRACE2(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveUnlock, EF32TraceUidProxyDrive, this, aStorePassword);
+
 	TInt r = iProxy->Unlock(aPassword,aStorePassword);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEUNLOCKRET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveUnlockRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -1074,9 +1171,11 @@
 */
 EXPORT_C TInt CBaseExtProxyDrive::Lock(TMediaPassword &aOldPassword, TMediaPassword &aNewPassword, TBool aStorePassword)
 	{
-	OstTraceExt2(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVELOCK, "this %x aPassword %d", (TUint) this, (TUint) aStorePassword);
+	TRACE2(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveLock, EF32TraceUidProxyDrive, this, aStorePassword);
+
 	TInt r = iProxy->Lock(aOldPassword,aNewPassword,aStorePassword);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVELOCKRET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveLockRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -1090,9 +1189,11 @@
 */
 EXPORT_C TInt CBaseExtProxyDrive::Clear(TMediaPassword &aPassword)
 	{
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVECLEAR, "this %x", this);
+	TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveClear, EF32TraceUidProxyDrive, this);
+
 	TInt r = iProxy->Clear(aPassword);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVECLEARRET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveClearRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -1103,9 +1204,11 @@
 */
 EXPORT_C TInt CBaseExtProxyDrive::ErasePassword()
 	{
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEERASEPASSWORD, "this %x", this);
+	TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveErasePassword, EF32TraceUidProxyDrive, this);
+
 	TInt r = iProxy->ErasePassword();
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEERASEPASSWORDRET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveErasePasswordRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -1122,9 +1225,11 @@
 */
 EXPORT_C TInt CBaseExtProxyDrive::ControlIO(const RMessagePtr2& aMessage,TInt aCommand,TAny* aParam1,TAny* aParam2)
 	{
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVECONTROLIO, "this %x", this);
+	TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveControlIO, EF32TraceUidProxyDrive, this);
+
 	TInt r = iProxy->ControlIO(aMessage,aCommand,aParam1,aParam2);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVECONTROLIORET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveControlIORet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -1140,8 +1245,9 @@
 */	
 EXPORT_C TInt CBaseExtProxyDrive::GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput)
 	{
-	OstTraceExt3(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEGETINTERFACE, "this %x aInterfaceId %d aInput %x", (TUint) this, (TUint) aInterfaceId, (TUint) aInput);
-		
+	TRACE3(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveGetInterface, EF32TraceUidProxyDrive, 
+		this, aInterfaceId, aInput);
+
 	TInt r;
 	if (aInterfaceId==EGetLocalDrive)
 		{
@@ -1149,7 +1255,8 @@
 		}
 	else	
 		r = CProxyDrive::GetInterface(aInterfaceId,aInterface,aInput);
-	OstTraceExt2(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEGETINTERFACERET, "r %d aInterface %x", (TUint) r, (TUint) aInterface);
+
+	TRACERET2(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveGetInterfaceRet, EF32TraceUidProxyDrive, r, aInterface);
 	return r;
 	}	
 
@@ -1163,9 +1270,11 @@
 */
 EXPORT_C TInt CBaseExtProxyDrive::GetLastErrorInfo(TDes8 &aErrorInfo)
 	{
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEGETLASTERRORINFO, "this %x", this);
+	TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveGetLastErrorInfo, EF32TraceUidProxyDrive, this);
+
 	TInt r = iProxy->GetLastErrorInfo(aErrorInfo);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEGETLASTERRORINFORET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveGetLastErrorInfoRet, EF32TraceUidProxyDrive, r);
 	return r;
 	}
 
@@ -1181,9 +1290,12 @@
 */
 EXPORT_C TInt CBaseExtProxyDrive::DeleteNotify(TInt64 aPos, TInt aLength)
     {
-	OstTraceExt4(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEDELETENOTIFY, "this %x aPos %x:%x aLength %d", (TUint) this, (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), (TUint) aLength);
+	TRACE4(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveDeleteNotify, EF32TraceUidProxyDrive, 
+		this, I64LOW(aPos), I64HIGH(aPos), aLength);
+
     TInt r = iProxy->DeleteNotify(aPos, aLength);
-	OstTrace1(TRACE_DRIVE, PROXYDRIVE_ECBASEEXTPROXYDRIVEDELETENOTIFYRET, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveDeleteNotifyRet, EF32TraceUidProxyDrive, r);
 	return r;
     }
 
@@ -1256,7 +1368,7 @@
 		return(aConcreteDrive);
 
 	TBool extSupported = drive.FSys().IsExtensionSupported();
-	OstTraceExt2(TRACE_DRIVE, FSYS_ECFILESYSTEMISEXTENSIONSUPPORTED2, "%x r %d", (TUint) &drive.FSys(), (TUint) extSupported);
+	TRACE1(UTF::EBorder, UTraceModuleFileSys::ECFileSystemIsExtensionSupported, EF32TraceUidProxyDrive, extSupported);
 	if(!extSupported)
 		{
 		delete(aConcreteDrive);
--- a/userlibandfileserver/fileserver/sfile/sf_file.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_file.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -16,9 +16,7 @@
 #include "sf_std.h"
 #include "sf_file_cache.h"
 #include "cl_std.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "sf_fileTraces.h"
-#endif
+
 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
 
 TInt OutputTraceInfo(CFsRequest* aRequest,TCorruptNameRec* aNameRec)
@@ -1509,9 +1507,11 @@
 	r=share->CheckMount();
 	if (r!=KErrNone)
 		return(r);
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILECBFLUSHDATAL1, "this %x", &share->File());
+
+	TRACE1(UTF::EBorder, UTraceModuleFileSys::ECFileCBFlushDataL, EF32TraceUidFileSys, &share->File());
 	TRAP(r,share->File().FlushDataL());
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILECBFLUSHDATAL1RET, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECFileCBFlushDataLRet, EF32TraceUidFileSys, r);
+
 	return(r);
 	}
 
@@ -1679,9 +1679,11 @@
     TUint setAttMask=(TUint)(aRequest->Message().Int0());
 	TUint clearAttMask=(TUint)aRequest->Message().Int1();
 	ValidateAtts(setAttMask,clearAttMask);
-	OstTraceExt3(TRACE_FILESYSTEM, FSYS_ECFILECBSETENTRYL1, "this %x aSetAttMask %x aClearAttMask %x", (TUint) &share->File(), (TUint) setAttMask, (TUint) clearAttMask);
+
+	TRACE5(UTF::EBorder, UTraceModuleFileSys::ECFileCBSetEntryL, EF32TraceUidFileSys, &share->File(), 0, 0, setAttMask,clearAttMask);
 	TRAP(r,share->File().SetEntryL(share->File().Modified(),setAttMask,clearAttMask))
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILECBSETENTRYL1RET, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECFileCBSetEntryLRet, EF32TraceUidFileSys, r);
+
 	return(r);
 	}
 
@@ -1743,9 +1745,11 @@
 	TTime time;
 	TPtr8 t((TUint8*)&time,sizeof(TTime));
 	aRequest->ReadL(KMsgPtr0,t);
-	OstTraceExt3(TRACE_FILESYSTEM, FSYS_ECFILECBSETENTRYL2, "this %x aSetAttMask %x aClearAttMask %x", (TUint) &share->File(), (TUint) KEntryAttModified, (TUint) 0);
+
+	TRACE5(UTF::EBorder, UTraceModuleFileSys::ECFileCBSetEntryL, EF32TraceUidFileSys, &share->File(), 0, 0, KEntryAttModified,0);
 	TRAP(r,share->File().SetEntryL(time,KEntryAttModified,0))
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILECBSETENTRYL2RET, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECFileCBSetEntryLRet, EF32TraceUidFileSys, r);
+
 	return(r);
 	}
 
@@ -1790,9 +1794,10 @@
 	TUint clearAttMask=(TUint)aRequest->Message().Int2();
 	ValidateAtts(setAttMask,clearAttMask);//	Validate attributes
 
-	OstTraceExt3(TRACE_FILESYSTEM, FSYS_ECFILECBSETENTRYL3, "this %x aSetAttMask %x aClearAttMask %x", (TUint) &share->File(), (TUint) setAttMask, (TUint) clearAttMask);
+	TRACE5(UTF::EBorder, UTraceModuleFileSys::ECFileCBSetEntryL, EF32TraceUidFileSys, &share->File(), 0, 0, setAttMask,clearAttMask);
 	TRAP(r,share->File().SetEntryL(time,setAttMask|KEntryAttModified,clearAttMask))
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILECBSETENTRYL3RET, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECFileCBSetEntryLRet, EF32TraceUidFileSys, r);
+
 	return(r);
 	}
 
@@ -1837,13 +1842,26 @@
 		// check if an attempt is made to change the share mode to EFileShareExclusive
 		// while the file has multiple readers
 	if (newMode == EFileShareExclusive && (currentMode & KFileShareMask) != EFileShareExclusive)
-		{
-		// Check that this is the file's only fileshare/client
-		TDblQue<CFileShare>& aShareList = (&share->File())->FileShareList();
-		if (!(aShareList.IsFirst(share) && aShareList.IsLast(share)))
-			return KErrAccessDenied;
+		{ 
+		// Check no other CFileCB is reading the file.
+		FileShares->Lock();
+		TInt count=FileShares->Count();
+		TBool found=EFalse;
+		while(count--)
+			{
+			CFileShare* fileShare=(CFileShare*)(*FileShares)[count];
+			if (&fileShare->File()==&share->File())
+				{
+				if (found)
+					{
+					FileShares->Unlock();
+					return(KErrAccessDenied);
+					}
+				found=ETrue;
+				}
+			}
+		FileShares->Unlock();
 		}
-	
 	share->iMode&=~KFileShareMask;
 	share->iMode|=newMode;
 	share->File().SetShare(newMode);
@@ -1894,10 +1912,12 @@
 
 	TPtrC filePath = aRequest->Dest().FullName().Mid(2);
 	CFileCB& file = share->File();
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILECBRENAMEL, "this %x", (TUint) &file);
-	OstTraceData(TRACE_FILESYSTEM, FSYS_ECFILECBRENAMELYS_EFILENAME, "FileName %S", filePath.Ptr(), filePath.Length()<<1);
+
+	TRACEMULT2(UTF::EBorder, UTraceModuleFileSys::ECFileCBRenameL, EF32TraceUidFileSys, 
+		(TUint) &file, filePath);
 	TRAP(r,file.RenameL(filePath));
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILECBRENAMELRET, "r %d", r);
+	TRACERETMULT1(UTF::EBorder, UTraceModuleFileSys::ECFileCBRenameLRet, EF32TraceUidFileSys, r);
+
 	// Re-write the file's folded name & re-calculate the hash
 	if (r == KErrNone)
 		{
@@ -2342,11 +2362,10 @@
 		FileCache()->Close();
 	if (iBody && iBody->iDeleteOnClose)
 		{
-		OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBDELETEL2, "drive %d", DriveNumber());
-		OstTraceData(TRACE_FILESYSTEM, FSYS_ECMOUNTCBDELETEL2_EFILENAME, "FileName %S", FileName().Ptr(), FileName().Length()<<1);
+		TRACEMULT2(UTF::EBorder, UTraceModuleFileSys::ECMountCBDeleteL, EF32TraceUidFileSys, DriveNumber(), FileName());
 		TInt r;
 		TRAP(r, iMount->DeleteL(FileName()));
-		OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBDELETEL2RET, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBDeleteLRet, EF32TraceUidFileSys, r);
 		}
 
 	if(iMount)
@@ -2444,18 +2463,14 @@
 
 
 void CFileCB::PromoteShare(CFileShare* aShare)
-/**
-	Manages share promotion and checks the EFileSequential file mode
-	after the share has been added to the FileShares container.
-	
-	It assumes the share has already been validated using ValidateShare().
-	
-	The count of promoted shares (ie - non-EFileShareReadersOrWriters) is incremented
-	to allow the share mode to be demoted when the last promoted share is closed.
-	
-	Similarly, the count of non-EFileSequential file modes is incremented to allow
-	the file mode to be enabled when the last non-EFileSequential share is closed.
- */
+//
+// Manages share promotion after the share has been added to the FilsShares container.
+//
+//  - Assumes the share has already been validated using ValidateShare()
+//
+//  - The count of promoted shares (ie - non-EFileShareReadersOrWriters) is incremented
+//	  to allow the share mode to be demoted when the last promoted share is closed.
+//
 	{
 	TShare reqShare = (TShare)(aShare->iMode & KFileShareMask);
 	if(reqShare != EFileShareReadersOrWriters)
@@ -2463,48 +2478,29 @@
 		iBody->iPromotedShares++;
 		iShare = reqShare;
 		}
-	
-	// If the file mode is not EFileSequential, then disable the 'Sequential' flag
-	if(!(aShare->iMode & EFileSequential))
-		{
-		iBody->iNonSequentialFileModes++;
-		SetSequentialMode(EFalse);
-		__PRINT(_L("CFileCB::PromoteShare - FileSequential mode is off"));
-		}
 	}
 
 
 void CFileCB::DemoteShare(CFileShare* aShare)
-/**
-	Manages share demotion and checks the EFileSequential file mode
-	after the share has been removed from the FileShares container.
-	
-	If the share being removed is not EFileShareReadersOrWriters, then the current
-	share mode may require demotion back to EFileShareReadersOrWriters.
-	This is determined by the iPromotedShares count, incremented in PromoteShare().
-	
-	Similarly, if the share being removed is non-EFileSequential,
-	then the EFileSequential flag may need to be enabled,
-	which is determined by the iNonSequentialFileModes count.
- */
+//
+// Manages share demotion after the share has been removed from the FileShares container.
+//
+//  - If the share being removed is not EFileShareReadersOrWriters, then the current
+//	  share mode may require demotion back to EFileShareReadersOrWriters.
+//
+//	- This is determined by the iPromotedShares count, incremented in PromoteShare()
+//
 	{
-	if((aShare->iMode & KFileShareMask) != EFileShareReadersOrWriters
-		&& --iBody->iPromotedShares == 0)
+	if((aShare->iMode & KFileShareMask) != EFileShareReadersOrWriters)
 		{
-		// Don't worry if the file has never been opened as EFileShareReadersOrWriters
-		//  - in this case the CFileCB object is about to be closed anyway.
-		iShare = EFileShareReadersOrWriters;
+		if(--iBody->iPromotedShares == 0)
+			{
+			// Don't worry if the file has never been opened as EFileShareReadersOrWriters
+			//  - in this case the CFileCB object is about to be closed anyway.
+			iShare = EFileShareReadersOrWriters;
+			}
 		}
-	__ASSERT_DEBUG(iBody->iPromotedShares>=0, Fault(EFileShareBadPromoteCount));
-	
-	if(!(aShare->iMode & EFileSequential) && --iBody->iNonSequentialFileModes == 0)
-		{
-		// As above, if the file has never been opened as EFileSequential,
-		// it implies that the CFileCB object is about to be closed anyway.
-		SetSequentialMode(ETrue);
-		__PRINT(_L("CFileCB::PromoteShare - FileSequential mode is enabled"));
-		}
-	__ASSERT_DEBUG(iBody->iNonSequentialFileModes>=0, Fault(EFileShareBadPromoteCount));
+	__ASSERT_DEBUG(iBody->iPromotedShares>=0,Fault(EFileShareBadPromoteCount));
 	}
 
 
@@ -2739,8 +2735,7 @@
 
 /**
 Constructor.
-Locks the mount resource to which the shared file resides
-and adds the share to the file's FileShare List.
+Locks the mount resource to which the shared file resides.
 
 @param aFileCB File to be shared.
 */
@@ -2748,14 +2743,12 @@
 	: iFile(aFileCB)
 	{
 	AddResource(iFile->Mount());
-	iFile->AddShare(*this);
 	}
 
 /**
 Destructor.
 
 Frees mount resource to which the shared file resides,
-removes the share from the file's FileShare List,
 removes share status from the shared file and finally closes
 the file.
 */
@@ -2765,7 +2758,6 @@
 	__ASSERT_DEBUG(iCurrentRequest == NULL, Fault(ERequestQueueNotEmpty));
 
 	RemoveResource(iFile->Mount());
-	iShareLink.Deque();
 	iFile->RemoveLocks(this);
 	iFile->DemoteShare(this);
 	iFile->CancelAsyncReadRequest(this, NULL);
@@ -2964,25 +2956,32 @@
 void CFileCB::ReadL(TInt64 aPos,TInt& aLength,TDes8* aDes,const RMessagePtr2& aMessage, TInt aOffset)
 	{
 	TRACETHREADID(aMessage);
-	OstTraceExt5(TRACE_FILESYSTEM, FSYS_ECFILECBREADLA, "this %x clientThreadId %x aPos %x:%x aLength %d", (TUint) this, (TUint) threadId, (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), (TUint) aLength);
+	TRACE7(UTF::EBorder, UTraceModuleFileSys::ECFileCBReadL, EF32TraceUidFileSys, 
+		this, I64LOW(aPos), I64HIGH(aPos), aLength, aDes, threadId, aOffset);
+
 	iBody->iExtendedFileInterface->ReadL(aPos,aLength,aDes,aMessage,aOffset);
 
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILECBREADLRET, "r %d", KErrNone);
+	TRACE1(UTF::EBorder, UTraceModuleFileSys::ECFileCBReadLRet, EF32TraceUidFileSys, KErrNone);
 	}
 
 void CFileCB::WriteL(TInt64 aPos,TInt& aLength,const TDesC8* aDes,const RMessagePtr2& aMessage, TInt aOffset)
 	{
 	TRACETHREADID(aMessage);
-	OstTraceExt5(TRACE_FILESYSTEM, FSYS_ECFILECBWRITEL, "this %x clientThreadId %x aPos %x:%x aLength %d", (TUint) this, (TUint) threadId, (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), (TUint) aLength);
+	TRACE7(UTF::EBorder, UTraceModuleFileSys::ECFileCBWriteL, EF32TraceUidFileSys, 
+		this, I64LOW(aPos), I64HIGH(aPos), aLength, aDes, threadId, aOffset);
+
 	iBody->iExtendedFileInterface->WriteL(aPos,aLength,aDes,aMessage,aOffset);
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILECBWRITELRET, "r %d", KErrNone);
+
+	TRACE1(UTF::EBorder, UTraceModuleFileSys::ECFileCBWriteLRet, EF32TraceUidFileSys, KErrNone);
 	}
 
 void CFileCB::SetSizeL(TInt64 aSize)
 	{
-	OstTraceExt3(TRACE_FILESYSTEM, FSYS_ECFILECBSETSIZEL, "this %x aSize %x:%x", (TUint) this, (TUint) I64HIGH(aSize), (TUint) I64LOW(aSize));
+	TRACE3(UTF::EBorder, UTraceModuleFileSys::ECFileCBSetSizeL, EF32TraceUidFileSys, this, I64LOW(aSize), I64HIGH(aSize));
+
 	iBody->iExtendedFileInterface->SetSizeL(aSize);
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILECBSETSIZELRET, "r %d", KErrNone);
+
+	TRACE1(UTF::EBorder, UTraceModuleFileSys::ECFileCBSetSizeLRet, EF32TraceUidFileSys, KErrNone);
 	}
 
 TBool CFileCB::ExtendedFileInterfaceSupported()
@@ -3028,16 +3027,18 @@
 
 TInt CFileCB::GetInterfaceTraced(TInt aInterfaceId, TAny*& aInterface, TAny* aInput)
 	{
-	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFILECBGETINTERFACE, "aInterfaceId %d aInput %x", (TUint) aInterfaceId, (TUint) aInput);
+	TRACE2(UTF::EBorder, UTraceModuleFileSys::ECFileCBGetInterface, EF32TraceUidFileSys, aInterfaceId, aInput);
+
 	TInt r = GetInterface(aInterfaceId, aInterface, aInput);
-	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFILECBGETINTERFACERET, "r %d aInterface %x", (TUint) r, (TUint) aInterface);
+
+	TRACERET2(UTF::EBorder, UTraceModuleFileSys::ECFileCBGetInterfaceRet, EF32TraceUidFileSys, r, aInterface);
+
 	return r;
 	}
 
 CFileBody::CFileBody(CFileCB* aFileCB, CFileCB::MExtendedFileInterface* aExtendedFileInterface)
   : iFileCB(aFileCB),
 	iExtendedFileInterface(aExtendedFileInterface ? aExtendedFileInterface : this),
-	iShareList(_FOFF(CFileShare,iShareLink)),
 	iSizeHigh(0)
 	{
 	iFairSchedulingLen = TFileCacheSettings::FairSchedulingLen(iFileCB->DriveNumber());
@@ -3111,9 +3112,11 @@
 		r=share->CheckMount();
 		if (r!=KErrNone)
 			return(r);
-		OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILECBFLUSHDATAL2, "this %x", &share->File());
+
+		TRACE1(UTF::EBorder, UTraceModuleFileSys::ECFileCBFlushDataL, EF32TraceUidFileSys, &share->File());
 		TRAP(r,share->File().FlushDataL());
-		OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILECBFLUSHDATAL2RET, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECFileCBFlushDataLRet, EF32TraceUidFileSys, r);
+
 		if(r!=KErrNone)
 			return(r);
 		}
@@ -3587,45 +3590,6 @@
 	}
 
 
-//---------------------------------------------------------------------------------------------------------------------
-/**
-Gets the 'Sequential' mode of the file.
-
-@return	ETrue, if the file is in 'Sequential' mode
-*/
-EXPORT_C TBool CFileCB::IsSequentialMode() const
-	{
-	return iBody->iSequential;
-	}
-
-/**
-Sets the 'Sequential' mode of the file.
- */
-void CFileCB::SetSequentialMode(TBool aSequential)
-	{
-	iBody->iSequential = aSequential;
-	}
-
-//---------------------------------------------------------------------------------------------------------------------
-/**
-Gets the list containing the shares associated with the file.
-
-@return	The FileShare List
-*/
-TDblQue<CFileShare>& CFileCB::FileShareList() const
-	{
-	return iBody->iShareList;
-	}
-
-/**
-Adds the share to the end of the FileShare List.
-*/
-void CFileCB::AddShare(CFileShare& aFileShare)
-	{
-	iBody->iShareList.AddLast(aFileShare);
-	}
-
-
 //#####################################################################################################################
 //#  TFileShareLock class implementation
 //#####################################################################################################################
@@ -3674,12 +3638,13 @@
 
 
 
+
 EXPORT_C TBool CFileCB::DirectIOMode(const RMessagePtr2& aMessage)
 	{
 	CFsMessageRequest* msgRequest = CFsMessageRequest::RequestFromMessage(aMessage);
 
 	TInt func = msgRequest->Operation()->Function();
-	ASSERT(func == EFsFileRead || func == EFsFileWrite || func == EFsFileWriteDirty || func == EFsReadFileSection);
+	ASSERT(func == EFsFileRead || func == EFsFileWrite || func == EFsFileWriteDirty  || func == EFsReadFileSection);
 
 	CFileShare* share;
 	CFileCB* file;
--- a/userlibandfileserver/fileserver/sfile/sf_file_cache.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_file_cache.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -32,10 +32,6 @@
 #include "sf_cache_client.h"
 #include "sf_file_cache_defs.h"
 
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "sf_file_cacheTraces.h"
-#endif
-
 
 // disables flushing of stale cachelines before each write
 #define LAZY_WRITE
@@ -84,10 +80,6 @@
 
 const TInt KMinSequentialReadsBeforeReadAhead = 3;
 
-#ifdef DOUBLE_BUFFERED_WRITING
-const TInt KMinSequentialAppendsBeforeFlush = 3;
-#endif
-
 //************************************
 // CFileCache
 //************************************
@@ -1171,18 +1163,6 @@
 					currentPos = iSize64;
 				iInitialSize = iSize64;
 
-
-#ifdef DOUBLE_BUFFERED_WRITING
-				// count the number of sequential write-appends
-				if (currentOperation->iClientRequest)
-					{
-					if (currentPos == iSize64)
-						iSequentialAppends++;
-					else
-						iSequentialAppends = 0;
-					}
-#endif // DOUBLE_BUFFERED_WRITING
-
 				// if EFileWriteDirectIO OR 
 				// (caching writes and requested write len > size of the cache), 
 				// flush the write cache
@@ -1291,13 +1271,6 @@
 						lastError = r;
 					}
 #endif
-#ifdef DOUBLE_BUFFERED_WRITING
-				if (cachingWrites && lastError == KErrNone && 
-					iSequentialAppends >= KMinSequentialAppendsBeforeFlush && iCacheClient->LockedSegmentsHalfUsed())
-					{
-					DoFlushDirty(aNewRequest, &aMsgRequest, EFlushHalf);
-					}
-#endif
 				// if no cacheline found & write caching is enabled, allocate a new cacheline
 				if (cachingWrites && addr == NULL && lastError == KErrNone)
 					{
@@ -1630,13 +1603,17 @@
 
 void CFileCache::PropagateFlushErrorToAllFileShares()
 	{
-	ASSERT(IsDriveThread());
-	TDblQueIter<CFileShare> fileShareIter(iFileCB->FileShareList());
-	CFileShare* pFileShare;
-	while ((pFileShare = fileShareIter++) != NULL)
+	FileShares->Lock();
+	TInt count = FileShares->Count();
+	while(count--)
 		{
-		pFileShare->iFlushError = iFlushError;
+		CFileShare* share = (CFileShare*)(*FileShares)[count];
+		if (&share->File() == iFileCB)
+			{
+			share->iFlushError = iFlushError;
+			}
 		}
+	FileShares->Unlock();
 	}
 
 /**
@@ -1838,7 +1815,7 @@
 
 #ifdef SETSIZE_BEFORE_WRITE	
 				TInt64 physicalFileSize = iFileCB->Size64();
-				if ((pos + (TInt64) len) > physicalFileSize)
+				if ( (!iDrive->IsRugged()) && ((pos + (TInt64) len) > physicalFileSize))
 					{
 					// Need to switch to drive thread before calling CFileCB::SetSizeL()
 					if (!IsDriveThread())
@@ -1956,12 +1933,6 @@
 					case EFlushSingle:
 						currentOperation->iState = EStEnd;
 						break;
-					case EFlushHalf:
-						if (iCacheClient->LockedSegmentsHalfUsed())
-							currentOperation->iState = EStWriteToDisk;
-						else
-							currentOperation->iState = EStEnd;
-						break;
 					case EFlushAll:
 						currentOperation->iState = EStWriteToDisk;
 						break;
@@ -2063,11 +2034,11 @@
 			// However if the write error is to the bootsector remounting will always fail because the boot
 			// sector will have changed and hence the disk is useless.
 			// 
-			OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBREMOUNT2, "drive %d", DriveNumber());
+			TRACE1(UTF::EBorder, UTraceModuleFileSys::ECMountCBReMount, EF32TraceUidFileSys, DriveNumber());
 
 			TInt remountSuccess = iDrive->ReMount(*iMount);
 
-			OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBREMOUNT2RET, "success %d", remountSuccess);
+			TRACE1(UTF::EBorder, UTraceModuleFileSys::ECMountCBReMountRet, EF32TraceUidFileSys, remountSuccess);
 			if (!remountSuccess)
 				continue;
 			
--- a/userlibandfileserver/fileserver/sfile/sf_file_cache.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_file_cache.h	Wed Sep 01 12:34:56 2010 +0100
@@ -28,9 +28,6 @@
 
 //#define _DEBUG_READ_AHEAD
 
-// if writing sequentially, start flushing dirty data when the cache is half full
-//#define DOUBLE_BUFFERED_WRITING
-
 
 NONSHARABLE_CLASS(CFileCache) : public CFsDispatchObject
 	{
@@ -78,7 +75,7 @@
 
 	TInt DoReadBuffered(CFsMessageRequest& aMsgRequest, TUint aMode, CFsClientMessageRequest*& aNewRequest);
 	TInt DoWriteBuffered(CFsMessageRequest& aMsgRequest, CFsClientMessageRequest*& aNewRequest, TUint aMode);
-	enum TFlushMode {EFlushSingle, EFlushHalf, EFlushAll};
+	enum TFlushMode {EFlushSingle, EFlushAll};
 	TInt DoFlushDirty(CFsClientMessageRequest*& aNewRequest, CFsRequest* aOldRequest, TFlushMode aFlushMode);
 
 
@@ -160,11 +157,6 @@
 	TBool iFileCacheReadAsync;
 	CFsClientMessageRequest* iReadAheadRequest;
 
-#ifdef DOUBLE_BUFFERED_WRITING
-	// sequential append-write detection
-	TInt iSequentialAppends;
-#endif
-
 	friend class TClosedFileUtils;
 	friend class TFsFileWriteDirty;
 	};
--- a/userlibandfileserver/fileserver/sfile/sf_fmt.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_fmt.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -17,10 +17,6 @@
 
 #include "sf_std.h"
 
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "sf_fmtTraces.h"
-#endif
-
 LOCAL_C CFormatCB* GetFormatFromHandle(TInt aHandle,CSessionFs* aSession)
 //
 // Get the format control block from aHandle
@@ -470,11 +466,9 @@
 	TPtr8 pStep((TUint8*)&format->CurrentStep(),sizeof(TInt));
 	aRequest->ReadL(KMsgPtr0,pStep);
 
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECFORMATCBDOFORMATSTEPL, "this %x", format);
-
+	TRACE1(UTF::EBorder, UTraceModuleFileSys::ECFormatCBDoFormatStepL, EF32TraceUidFileSys, format);
 	TRAP(r,format->DoFormatStepL());
-
-	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFORMATCBDOFORMATSTEPLRET, "r %d  iCurrentStep %d", r, (TUint) format->CurrentStep());
+	TRACERET2(UTF::EBorder, UTraceModuleFileSys::ECFormatCBDoFormatStepLRet, EF32TraceUidFileSys, r, format->CurrentStep());
 
 	if (r==KErrNone)
 		aRequest->WriteL(KMsgPtr0,pStep);
--- a/userlibandfileserver/fileserver/sfile/sf_main.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_main.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -26,6 +26,9 @@
 #endif
 #include "d32btrace.h"
 
+// define this macro to enable tracing very early on in the boot sequence
+//#define __ENABLE_TRACE__
+
 #ifdef __EPOC32__
 _LIT(KStartupExeSysBinName,"Z:\\Sys\\Bin\\ESTART.EXE");
 #else
@@ -283,6 +286,35 @@
 	User::SetCritical(User::ESystemCritical);
 
 	TInt r;
+#ifdef SYMBIAN_FTRACE_ENABLE
+	r = User::LoadLogicalDevice(_L("D_FTRACE"));	
+	__PRINT1(_L("User::LoadLogicalDevice(D_FTRACE) returns %d"),r);
+	__ASSERT_ALWAYS(r==KErrNone || r==KErrAlreadyExists,Fault(ETraceLddLoadFailure));
+
+	r = TheFtrace.Open(EOwnerProcess);
+	__ASSERT_ALWAYS(r==KErrNone || r==KErrAlreadyExists,Fault(ETraceLddLoadFailure));
+#endif
+
+#if defined (__ENABLE_TRACE__)
+		{
+		RBTrace trace;
+		
+		trace.Open();
+		
+//		trace.SetMode(RBTrace::EEnable + RBTrace::EFreeRunning);
+		trace.SetFilter(BTrace::EThreadIdentification,1);
+
+		trace.SetFilter(UTF::EBorder,1);
+		trace.SetFilter(UTF::EError,1);
+
+		trace.SetFilter2(EF32TraceUidEfsrv,1);
+//		trace.SetFilter2(EF32TraceUidFileSys,1);
+//		trace.SetFilter2(EF32TraceUidProxyDrive,1);
+
+		trace.Close();	
+		}
+
+#endif
 
 //
 // Load the file system's device driver
--- a/userlibandfileserver/fileserver/sfile/sf_memory_client.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_memory_client.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -144,7 +144,7 @@
 
 	iTouchedRegionFlag = 0;
 	iReusablePagePool.Close();
-	r = iReusablePagePool.Reserve(iReservedRegionMarkInSegs);
+	iReusablePagePool.Reserve(iReservedRegionMarkInSegs);
     if (r != KErrNone)
         {
         ASSERT(0);
@@ -174,8 +174,7 @@
        	return addr;
        	}
     
-    TBool touchedMore = EFalse;
-	// if we have touched beyond reserved region, get new pages from reusable pool first
+	// if we have used up reserved region, get new pages from reusable pool first
     if (iReusablePagePool.Count())
     	{
 		addr = iReusablePagePool[0];
@@ -186,7 +185,7 @@
     else
     	{
     	addr = iBase + (iTouchedRegionFlag << iSegSizeInBytesLog2);
-    	touchedMore = ETrue;
+    	iTouchedRegionFlag += aSegmentCount;
 //       	__PRINT2(_L("!! GROW TOUCHED SEGS: addr=0x%x, touched=%d"), addr, iTouchedRegionFlag);
     	}
 	
@@ -202,10 +201,6 @@
 	if (r != KErrNone)
 		return NULL;
 
-	if (touchedMore)
-	    {
-	    iTouchedRegionFlag += aSegmentCount;
-	    }
 	return addr;
 	}
 
--- a/userlibandfileserver/fileserver/sfile/sf_memory_man.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_memory_man.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -81,7 +81,7 @@
 	TInt r = UserHal::MemoryInfo(meminfo);
 	ASSERT(r==KErrNone);
 	User::LeaveIfError(r);
-	iLowMemoryThreshold = (TInt) (meminfo().iTotalRamInBytes * (TGlobalCacheMemorySettings::LowMemoryThreshold() / 100.00));
+	iLowMemoryThreshold = (meminfo().iTotalRamInBytes * TGlobalCacheMemorySettings::LowMemoryThreshold()) / 100;
 	TChunkCreateInfo createInfo;
 	createInfo.SetCache(iSizeInBytes);
 	createInfo.SetOwner(EOwnerProcess);
@@ -287,10 +287,6 @@
 */
 void CCacheMemoryManagerFactory::CreateL()
 	{
-	// Panic in DEBUG mode when GlobalCacheMemorySize is set as a negative value.  
-	ASSERT(TGlobalCacheMemorySettings::CacheSize() >= 0);
-	ASSERT(TGlobalCacheMemorySettings::LowMemoryThreshold() >= 0);
-	
 	if (TGlobalCacheMemorySettings::CacheSize() > 0)
 	    iCacheMemoryManager = CCacheMemoryManager::NewL(TGlobalCacheMemorySettings::CacheSize());
 	else
@@ -341,12 +337,12 @@
 		iLowMemoryThreshold = lowMemoryThreshold;
 	}
 
-TInt32 TGlobalCacheMemorySettings::CacheSize()
+TInt TGlobalCacheMemorySettings::CacheSize()
 	{
 	return iCacheSizeInBytes;
 	}
 
-TInt32 TGlobalCacheMemorySettings::LowMemoryThreshold()
+TInt TGlobalCacheMemorySettings::LowMemoryThreshold()
 	{
 	return iLowMemoryThreshold;
 	}
--- a/userlibandfileserver/fileserver/sfile/sf_memory_man.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_memory_man.h	Wed Sep 01 12:34:56 2010 +0100
@@ -47,10 +47,6 @@
 	TUint8* Base();
 	void 	FreeMemoryChanged(TBool aIsMemoryLow);
 
-#if defined(_DEBUG) || defined(_DEBUG_RELEASE)
-	void    SetMemoryLow(TBool aSetMemoryLow) {isMemoryLow = aSetMemoryLow;}; 
-#endif //defined(_DEBUG) || defined(_DEBUG_RELEASE)
-
 private:
 	~CCacheMemoryManager();
 	CCacheMemoryManager(TUint32 aMaxSize);
@@ -95,8 +91,8 @@
 public:
 	static void ReadPropertiesFile();
 
-	static TInt32 CacheSize();
-	static TInt32 LowMemoryThreshold();
+	static TInt CacheSize();
+	static TInt LowMemoryThreshold();
 private:
 	static TInt32 iCacheSizeInBytes;
 	static TInt32 iLowMemoryThreshold;
--- a/userlibandfileserver/fileserver/sfile/sf_mnt.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_mnt.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,10 +15,6 @@
 
 #include "sf_std.h"
 
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "sf_mntTraces.h"
-#endif
-
 
 
 
@@ -373,11 +369,12 @@
 
 TInt CMountCB::GetInterfaceTraced(TInt aInterfaceId, TAny*& aInterface, TAny* aInput)
 	{
-	OstTraceExt3(TRACE_FILESYSTEM, FSYS_ECMOUNTCBGETINTERFACE, "drive %d aInterfaceId %d aInput %x", (TUint) DriveNumber(), (TUint) aInterfaceId, (TUint) aInput);
+	TRACE3(UTF::EBorder, UTraceModuleFileSys::ECMountCBGetInterface, EF32TraceUidFileSys, 
+		DriveNumber(), aInterfaceId, aInput);
 
 	TInt r = GetInterface(aInterfaceId, aInterface, aInput);
 
-	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECMOUNTCBGETINTERFACERET, "r %d aInterface %x", (TUint) r, (TUint) aInterface);
+	TRACERET2(UTF::EBorder, UTraceModuleFileSys::ECMountCBGetInterfaceRet, EF32TraceUidFileSys, r, aInterface);
 
 	return r;
 	}
--- a/userlibandfileserver/fileserver/sfile/sf_obj.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_obj.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -131,10 +131,7 @@
 				if (newAlloc)
 				    {
 					iContainers=(CFsObjectCon**)User::ReAlloc(iContainers,newAlloc*sizeof(CFsObjectCon*));
-					if(!iContainers)
-					    {
-					    Fault(EContainerHeapCorruptionOnRemove);
-					    }
+					__ASSERT_DEBUG(iContainers,User::Panic(_L("FS_LDR panic"),ELdrHeapCorruptionOnRemove));
 				    }
 				else
 					{
@@ -497,10 +494,7 @@
 			if (newAlloc)
 			    {
 				iObjects=(SFsObjectIxRec*)User::ReAlloc(iObjects,newAlloc*sizeof(SFsObjectIxRec));
-				if(!iObjects)
-				    {
-                    Fault(EContainerHeapCorruptionOnRemove);
-				    }
+				__ASSERT_DEBUG(iObjects,User::Panic(_L("FS_LDR panic"),ELdrHeapCorruptionOnRemove));
 			    }
 			else
 				{
@@ -693,10 +687,7 @@
 				if (newAlloc)
 				    {
 					iObjects=(CFsObject**)User::ReAlloc(iObjects,newAlloc*sizeof(CFsObject*));
-					if(!iObjects)
-					    {
-					    Fault(EContainerHeapCorruptionOnRemove);
-					    }
+					__ASSERT_DEBUG(iObjects,User::Panic(_L("FS_LDR panic"),ELdrHeapCorruptionOnRemove));
 				    }
 				else
 					{
--- a/userlibandfileserver/fileserver/sfile/sf_ops.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_ops.h	Wed Sep 01 12:34:56 2010 +0100
@@ -135,7 +135,7 @@
 		{	EFsAddPlugin,				ESync,					&TFsAddPlugin::Initialise,					NULL,								&TFsAddPlugin::DoRequestL					},
 		{	EFsRemovePlugin,			ESync,					&TFsRemovePlugin::Initialise,				NULL,								&TFsRemovePlugin::DoRequestL				},
 		{	EFsMountPlugin,				ESync,					&TFsMountPlugin::Initialise,				NULL,								&TFsMountPlugin::DoRequestL					},
-		{	EFsDismountPlugin,			0, /*PluginThrdContxt*/	&TFsDismountPlugin::Initialise,				NULL,								&TFsDismountPlugin::DoRequestL				},
+		{	EFsDismountPlugin,			0,						&TFsDismountPlugin::Initialise,				NULL,								&TFsDismountPlugin::DoRequestL				},
 		{	EFsPluginName,				ESync,					&TFsPluginName::Initialise,					NULL,								&TFsPluginName::DoRequestL					},
 		{	EFsPluginOpen,				ESync | EParseSrc,		&TFsPluginOpen::Initialise,					NULL,								&TFsPluginOpen::DoRequestL					},
 		{	EFsPluginSubClose,			ESync,					&TFsSubClose::Initialise,					NULL,								&TFsSubClose::DoRequestL					},
--- a/userlibandfileserver/fileserver/sfile/sf_plugin.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_plugin.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -247,9 +247,9 @@
 	}
 
 /**
-   Return ETrue if the request originated from this plugin
+   Return ETrue if the calling thread is the plugin thread
 */
-TBool CFsPlugin::OriginatedFromPlugin(CFsRequest& aRequest)
+TBool CFsPlugin::IsPluginThread(CFsRequest& aRequest)
 	{
 	if(aRequest.iOwnerPlugin == this)
 		return ETrue;
@@ -361,11 +361,9 @@
 
 
 	CFsPlugin* plugin = this;
-	FsPluginManager::ReadLockChain();
-	FsPluginManager::NextPlugin(plugin, &msgRequest);
+	FsPluginManager::NextPlugin(plugin, &msgRequest,(TBool)ETrue);
 	msgRequest.iCurrentPlugin = plugin;
 	msgRequest.Dispatch();
-	FsPluginManager::UnlockChain();
 	iThreadP->OperationLockWait();
 
 	aDes.SetLength(len);
--- a/userlibandfileserver/fileserver/sfile/sf_plugin.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_plugin.h	Wed Sep 01 12:34:56 2010 +0100
@@ -60,20 +60,19 @@
 	static TInt InstallPluginFactory(CFsPluginFactory* aFactory,RLibrary aLib);
 	static CFsPluginFactory* GetPluginFactory(const TDesC& aName);
 
-	static TInt NextPlugin(CFsPlugin*& aPlugin, CFsMessageRequest* aMsgRequest, TBool aCheckCurrentOperation=ETrue);
-	static TInt PrevPlugin(CFsPlugin*& aPlugin, CFsMessageRequest* aMsgRequest);
+	static TInt NextPlugin(CFsPlugin*& aPlugin, CFsMessageRequest* aMsgRequest, TBool aLock, TBool aCheckCurrentOperation=ETrue);
+	static TInt PrevPlugin(CFsPlugin*& aPlugin, CFsMessageRequest* aMsgRequest, TBool aLock);
 	static TInt InsertInPluginStack(CFsPlugin*& aPlugin,TInt aPos);
 	static TInt IsInChain(TInt aUPos, TInt aPos,TInt aDrive, CFsPluginFactory* aPluginFactory);
 	static CFsPlugin* FindByUniquePosition(TInt aPos);
 
-	static TInt InitPlugin(CFsPlugin& aPlugin, RLibrary aLibrary);
+	static TInt InitPlugin(CFsPlugin& aPlugin);
 	static void TransferRequests(CPluginThread* aPluginThread);
 	static void CancelPlugin(CFsPlugin* aPlugin,CSessionFs* aSession);
 	static TInt ChainCount();
 	static TInt Plugin(CFsPlugin*& aPlugin, TInt aPos);
 
-	static void ReadLockChain();
-	static void WriteLockChain();
+	static void LockChain();
 	static void UnlockChain();
 
 	static CFsPluginConn* CreatePluginConnL(TInt aUniquePosition, TUint aClientId);
@@ -92,7 +91,7 @@
 	static CFsObjectCon* iPluginConns;
 
 	static RPointerArray<CFsPlugin> iPluginChain;
-	static RReadWriteLock iChainLock;
+	static RFastLock iChainLock;
 
 	static CFsSyncMessageScheduler* iScheduler;
 
--- a/userlibandfileserver/fileserver/sfile/sf_plugin_man.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_plugin_man.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,7 +21,7 @@
 
 CFsObjectCon* FsPluginManager::iPluginFactories = NULL;
 CFsObjectCon* FsPluginManager::iPluginConns     = NULL;
-RReadWriteLock FsPluginManager::iChainLock;
+RFastLock FsPluginManager::iChainLock;
 RPointerArray<CFsPlugin> FsPluginManager::iPluginChain;
 CFsSyncMessageScheduler* FsPluginManager::iScheduler = NULL;
 
@@ -153,7 +153,7 @@
 		return err;
 		}
 
-	WriteLockChain();
+	LockChain();
 	err = InsertInPluginStack(pP,aPos);
 	UnlockChain();
 	if(err != KErrNone)
@@ -162,7 +162,7 @@
 		return err;
 		}
 
-	err = InitPlugin(*pP, aPluginFactory.Library());
+	err = InitPlugin(*pP);
 	if(err != KErrNone)
 		{
 		return err;
@@ -235,7 +235,7 @@
 Transfer any outstanding requests to next/previous plugin depending on
 if it is post filter or not
 
-Must be called with the plugin chain write-locked.
+Must be called with the plugin chain locked.
 Attains plugin-thread's listlock.
 */
 void FsPluginManager::TransferRequests(CPluginThread* aPluginThread)
@@ -315,12 +315,12 @@
 	        if(pR->IsPostOperation())
 	            {
 	            //[set the plugin to] pass the request backwards in the chain
-	            PrevPlugin(pR->iCurrentPlugin, &mR);
+	            PrevPlugin(pR->iCurrentPlugin, &mR, EFalse);
 	            }
 	        else //IsPreOperations
 	            {
 	            //[set the plugin to] pass the request forwards in the chain
-	            NextPlugin(pR->iCurrentPlugin, &mR);
+	            NextPlugin(pR->iCurrentPlugin, &mR, EFalse);
 	            }
 
 	        if(pR->iCurrentPlugin)
@@ -386,18 +386,19 @@
 /**
 Find the next plugin that supports the operation
 
-Must be called with the plugin chain (at least read-) locked.
-
 @param aPlugin - On calling the function this may contain either NULL or the current plugin.
                  If it is called with NULL, then we start to look for plugins from the beginning of the chain.
                  If is is called with a plugin then we start to look after that plugin for the next one.
                  On return, aPlugin shall contain either a plugin or NULL.
                  
+@param aLock - If this is set to ETRUE, then the function shall lock the plugin chain.
+               If this is set to EFALSE, then the caller of the function MUST already hold the lock.
+
 @param aCheckCurrentOperation - Optional, if false, will return the next plugin,
  								whether the plugin is currently registered
 								for the current function or not. (so long as mounted on the current drive)
 */
-TInt FsPluginManager::NextPlugin(CFsPlugin*& aPlugin, CFsMessageRequest* aMsgRequest, TBool aCheckCurrentOperation)
+TInt FsPluginManager::NextPlugin(CFsPlugin*& aPlugin, CFsMessageRequest* aMsgRequest,TBool aLock, TBool aCheckCurrentOperation)
 	{
 	if(aMsgRequest->DirectToDrive())
 		{
@@ -409,6 +410,9 @@
 	TInt function = aMsgRequest->Operation()->Function();
 	TInt drive = aMsgRequest->DriveNumber();
 
+	if(aLock)
+	    LockChain();
+	
 	//the plugin chain lock must be held by this point.
 	TInt count = iPluginChain.Count();
 
@@ -427,22 +431,25 @@
 					{
 
 					aPlugin = iPluginChain[i];
+					if(aLock)
+					    UnlockChain();
 					return KErrNone;
 					}
 				}
 			}
 		}
 	aPlugin = NULL;
+	if(aLock)
+	    UnlockChain();
 	return KErrNotFound;
 	}
 
 /**
 Find the next plugin that supports the operation
-Must be called with the plugin chain (at least read-) locked.
 
 @see FsPluginManager::NextPlugin
 */
-TInt FsPluginManager::PrevPlugin(CFsPlugin*& aPlugin, CFsMessageRequest* aMsgRequest)
+TInt FsPluginManager::PrevPlugin(CFsPlugin*& aPlugin, CFsMessageRequest* aMsgRequest, TBool aLock)
 	{
 	if(aMsgRequest->DirectToDrive() && (aMsgRequest->CurrentOperationPtr() != NULL))
 		{
@@ -453,6 +460,9 @@
 	TInt start;
 	TInt function = aMsgRequest->Operation()->Function();
 	TInt drive = aMsgRequest->DriveNumber();
+
+	if(aLock)
+	    LockChain();
 	
 	//the plugin chain lock must be held by this point.
 	TInt count= iPluginChain.Count();
@@ -476,12 +486,16 @@
 					{
 
 					aPlugin = iPluginChain[i];
+					if(aLock)
+					    UnlockChain();
 					return KErrNone;
 					}
 				}
 			}
 		}
 	aPlugin = NULL;
+	if(aLock)
+	    UnlockChain();
 	return KErrNotFound;
 	}
 /**
@@ -570,7 +584,7 @@
 */
 CFsPlugin* FsPluginManager::FindByUniquePosition(TInt aUniquePosition)
 	{
-	ReadLockChain();
+	LockChain();
 	CFsPlugin* plugin = NULL;
 	TInt count= iPluginChain.Count();
 	for(TInt i=0;i<count;i++)
@@ -610,13 +624,13 @@
 Create a plugin thread
 Should only by called from main file server thread with plugin thread unavailable
 */
-TInt FsPluginManager::InitPlugin(CFsPlugin& aPlugin, RLibrary aLibrary)
+TInt FsPluginManager::InitPlugin(CFsPlugin& aPlugin)
 	{
 	TInt err = KErrNone;
 
 	if(!aPlugin.iThreadP)
 		{
-		TRAP(err,aPlugin.iThreadP=CPluginThread::NewL(aPlugin, aLibrary));
+		TRAP(err,aPlugin.iThreadP=CPluginThread::NewL(aPlugin));
 		if(err!=KErrNone)
 			return err;
 		}
@@ -657,27 +671,19 @@
 	}
 
 /**
-Locks the chain for reading
+Locks the chain
 */
-void FsPluginManager::ReadLockChain()
+void FsPluginManager::LockChain()
 	{
-    iChainLock.ReadLock();
+	iChainLock.Wait();
 	}
 
 /**
-Locks the chain for writing
-*/
-void FsPluginManager::WriteLockChain()
-    {
-    iChainLock.WriteLock();
-    }
-
-/**
 Unlocks the chain
 */
 void FsPluginManager::UnlockChain()
 	{
-    iChainLock.Unlock();
+	iChainLock.Signal();
 	}
 
 /**
@@ -737,7 +743,7 @@
 	// Iterate through all plugins, cancelling outstanding session requests
 	aRequest->Set(CancelPluginOp, aSession);
 
-	FsPluginManager::ReadLockChain();
+	FsPluginManager::LockChain();
 	TInt count = FsPluginManager::ChainCount();
 	TInt oldCount = count;
 	TInt i;
@@ -753,7 +759,7 @@
 	    //so hopefully this wont take too long.
 	    FsPluginManager::UnlockChain();
 	    User::WaitForRequest(aRequest->Status());
-	    FsPluginManager::ReadLockChain();
+	    FsPluginManager::LockChain();
 	    __ASSERT_ALWAYS(aRequest->Status().Int()==KErrNone||aRequest->Status().Int()==KErrCancel,Fault(ESessionDisconnectThread2));
 	    count = FsPluginManager::ChainCount();
 	    //If a plugin was removed whilst the chain was unlocked we need to make sure we don't skip any plugins
--- a/userlibandfileserver/fileserver/sfile/sf_plugin_ops.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_plugin_ops.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -153,7 +153,7 @@
 	if(pF->IsDriveSupported(drive) == EFalse)
 		return KErrNotSupported;
 
-	FsPluginManager::ReadLockChain();
+	FsPluginManager::LockChain();
 	err = FsPluginManager::IsInChain(pF->UniquePosition(),aRequest->Message().Int2(),aRequest->Message().Int1(), pF);
 
 	// plugin might have been mounted in different pos and drive. Find the right one
@@ -209,7 +209,7 @@
 
 	TInt drive = aRequest->Message().Int1();
 
-	FsPluginManager::WriteLockChain();
+	FsPluginManager::LockChain();
 
 	TInt err = FsPluginManager::IsInChain(pF->UniquePosition(),aRequest->Message().Int2(),drive, pF);
 	if(err >= 0)
@@ -219,8 +219,11 @@
 		err = FsPluginManager::Plugin(plugin, pos);
 		if(err == KErrNone)
 			{
-			FsPluginManager::DismountPlugin(*pF,pos);
-			aRequest->SetScratchValue(0);
+			if(aRequest->iCurrentPlugin == plugin)
+				{
+				FsPluginManager::DismountPlugin(*pF,pos);
+				aRequest->SetScratchValue(0);
+				}
 			}
 		}
 	FsPluginManager::UnlockChain();
@@ -247,7 +250,7 @@
 TInt TFsPluginName::DoRequestL(CFsRequest* aRequest)
 	{
 	CFsPlugin* plugin=NULL;
-	FsPluginManager::ReadLockChain();
+	FsPluginManager::LockChain();
 	TInt err = FsPluginManager::Plugin(plugin, aRequest->Message().Int2());
 	if(err != KErrNone) //should be ok but just in case
 	    {
--- a/userlibandfileserver/fileserver/sfile/sf_plugin_shim.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_plugin_shim.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -703,6 +703,11 @@
 	TPckgBuf<TInt> reply;
 	args.Set(3,&reply);
 
+	// copy session pointer
+	RLocalMessage message = iMessage;
+	message.SetFunction(aFunction);
+	message.SetArgs(args);
+
 	TInt err = Dispatch(aFunction, args);
 	if (err == KErrNone)
 		*aReply = reply();
--- a/userlibandfileserver/fileserver/sfile/sf_prel.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_prel.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -242,15 +242,10 @@
 void CreateCorruptFileNamesList()
 	{
 	RFs fs;
-	
-    TInt r = fs.Connect();
+	fs.Connect();
+	TInt r=FindHitListFile(fs);
 	if(r!=KErrNone)
 		return;
-	
-    r=FindHitListFile(fs);
-	if(r!=KErrNone)
-		return;
-	
 	RFile f;
 	r=f.Open(fs,*gCorruptFileNamesListFile,EFileShareExclusive|EFileStreamText|EFileRead);
 	if(r!=KErrNone)
--- a/userlibandfileserver/fileserver/sfile/sf_raw.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_raw.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -18,10 +18,6 @@
 #include "sf_std.h"
 #include "sf_file_cache.h"
 
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "sf_rawTraces.h"
-#endif
-
 LOCAL_C CRawDiskCB* GetRawDiskFromHandle(TInt aHandle, CSessionFs* aSession)
 //
 // Get the rawdisk control block from aHandle
@@ -116,11 +112,10 @@
 	const TAny* pDes=aRequest->Message().Ptr0();
 
 	TRACETHREADID(aRequest->Message());
-	OstTraceExt5(TRACE_FILESYSTEM, FSYS_ECMOUNTCBRAWREADL, "drive %d clientThreadId %x aPos %x:%x aLength %d", (TUint) aRequest->DriveNumber(), (TUint) threadId, (TUint) I64HIGH(pos), (TUint) I64LOW(pos), (TUint) length);
-
+	TRACE7(UTF::EBorder, UTraceModuleFileSys::ECMountCBRawReadL, EF32TraceUidFileSys, 
+		aRequest->DriveNumber(), I64LOW(pos), I64HIGH(pos), length, pDes, 0, I64LOW(threadId));
 	TRAP(r,rawDisk->Mount().RawReadL(pos,length,pDes,0,aRequest->Message()));
-
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBRAWREADLRET, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBRawReadLRet, EF32TraceUidFileSys, r);
 
 	return(r);
 	}
@@ -164,11 +159,10 @@
 	const TAny* pDes=aRequest->Message().Ptr0();
 
 	TRACETHREADID(aRequest->Message());
-	OstTraceExt5(TRACE_FILESYSTEM, FSYS_ECMOUNTCBRAWWRITEL, "drive %d clientThreadId %x aPos %x:%x aLength %d", (TUint) aRequest->DriveNumber(), (TUint) threadId, (TUint) I64HIGH(pos), (TUint) I64LOW(pos), (TUint) length);
-
+	TRACE7(UTF::EBorder, UTraceModuleFileSys::ECMountCBRawWriteL, EF32TraceUidFileSys, 
+		aRequest->DriveNumber(), I64LOW(pos), I64HIGH(pos), length, pDes, 0, I64LOW(threadId));
 	TRAP(r,rawDisk->Mount().RawWriteL(pos,length,pDes,0,aRequest->Message()));
-
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBRAWWRITELRET, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECMountCBRawWriteLRet, EF32TraceUidFileSys, r);
 
 	rawDisk->SetChanged();
 	return(r);
--- a/userlibandfileserver/fileserver/sfile/sf_request.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_request.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -974,7 +974,7 @@
 //
 	{
 	TInt err = KErrNone;
-	if(!iCurrentPlugin->OriginatedFromPlugin(*this))
+	if(!iCurrentPlugin->IsPluginThread(*this))
 		{
 		// The request hasn't come from this plugin so it's safe to dispatch		
 		TFsPluginRequest request(this);
@@ -997,17 +997,14 @@
 	
 	// Find the previous plugin in the chain and dispatch
 	//  - If no more plugins are interested in this message, then complete
-	FsPluginManager::ReadLockChain();
-	FsPluginManager::PrevPlugin(iCurrentPlugin, this);
+	FsPluginManager::PrevPlugin(iCurrentPlugin, this, ETrue);
 	if(iCurrentPlugin == NULL)
 		{
-	    FsPluginManager::UnlockChain();
 		Complete(GetError());
 		return;
 		}
 
 	Dispatch();
-	FsPluginManager::UnlockChain();
 	return;
 	}
 	
@@ -1018,7 +1015,7 @@
 //
 	{
 	TInt err = KErrNone;
-	if(!iCurrentPlugin->OriginatedFromPlugin(*this))
+	if(!iCurrentPlugin->IsPluginThread(*this))
 		{
 		// The request hasn't come from this plugin so it's safe to dispatch		
 		TFsPluginRequest request(this);		
@@ -1027,7 +1024,7 @@
 
 		if((iOperation->Function() == EFsDismountPlugin) && (err !=  KErrPermissionDenied))
 			{
-		    err = KErrNone;
+			TRAP(leaveValue, err = iOperation->DoRequestL(this));
 			}
 
 		if(leaveValue != KErrNone)
@@ -1045,12 +1042,10 @@
 		// Find the next plugin in the chain and dispatch
 		//  - If no more plugins are interested in this message, 
 		//	  then Dispatch() will process the request in drive/main thread context.
-	    FsPluginManager::ReadLockChain();
-		FsPluginManager::NextPlugin(iCurrentPlugin, this);
+		FsPluginManager::NextPlugin(iCurrentPlugin, this,(TBool)ETrue);
 		if(iCurrentPlugin && IsPostOperation())
 			SetPostOperation(EFalse);
 		Dispatch();
-		FsPluginManager::UnlockChain();
 		return;
 		}
 	// KErrCompletion may be returned by the plugin to 
@@ -1059,21 +1054,18 @@
 		{
 		// Find the previous plugin in the chain and dispatch
 		//  - If no more plugins are interested in this message, then complete
-	    FsPluginManager::ReadLockChain();
-		FsPluginManager::PrevPlugin(iCurrentPlugin, this);
+		FsPluginManager::PrevPlugin(iCurrentPlugin, this,(TBool)ETrue);
 		if(iCurrentPlugin != NULL)
 			{
 			SetPostOperation(ETrue);
 			err = KErrNone;
 			Dispatch();
-			FsPluginManager::UnlockChain();
 			return;
 			}
 		else
 			{
 			err = KErrNone;	
 			}
-		FsPluginManager::UnlockChain();
 		}
 		
 	Complete(err);
@@ -1132,18 +1124,13 @@
 	iCurrentPlugin = NULL;
 	if (PostInterceptEnabled())
 		{
-	    FsPluginManager::ReadLockChain();
-		FsPluginManager::PrevPlugin(iCurrentPlugin, this);
-		if(iCurrentPlugin && !iCurrentPlugin->OriginatedFromPlugin(*this))
+		FsPluginManager::PrevPlugin(iCurrentPlugin, this,(TBool)ETrue);
+		if(iCurrentPlugin && !iCurrentPlugin->IsPluginThread(*this))
 			{
 			SetPostOperation(ETrue);
 			if (DispatchToPlugin())
-			    {
-		        FsPluginManager::UnlockChain();  
 				return;
-			    }
 			}
-		FsPluginManager::UnlockChain();		
 		}		
 
 	Complete(GetError());
@@ -1422,16 +1409,13 @@
 		iCurrentPlugin = NULL;
 		if (PostInterceptEnabled())
 			{
-		    FsPluginManager::ReadLockChain();
-			FsPluginManager::PrevPlugin(iCurrentPlugin, this);
-			if(iCurrentPlugin && !iCurrentPlugin->OriginatedFromPlugin(*this))
+			FsPluginManager::PrevPlugin(iCurrentPlugin, this,(TBool)ETrue);
+			if(iCurrentPlugin && !iCurrentPlugin->IsPluginThread(*this))
 				{
 				SetPostOperation(ETrue);
 				Dispatch();
-				FsPluginManager::UnlockChain();
 				return r;	// EReqActionComplete
 				}
-			FsPluginManager::UnlockChain();
 			}		
 
 		Complete(KErrNone);
@@ -1459,7 +1443,6 @@
 	__THRD_PRINT1(_L("CFsMessageRequest::Dispatch() req %08x"), this);
 
 	TInt r = KErrNone;
-	TBool pluginChainLocked = EFalse;
 
 	if (iReqState == EReqStateInitialise && aInitialise)
 		{
@@ -1479,18 +1462,16 @@
 			}
 		if(!IsPluginSpecific() && (iOwnerPlugin == NULL))
 			{
-		    FsPluginManager::ReadLockChain(); // Unlocked in DispatchToPlugin
-		    pluginChainLocked = ETrue;
 			iCurrentPlugin = NULL;
 			iClientThreadId = 0;
-			FsPluginManager::NextPlugin(iCurrentPlugin, this);
+			FsPluginManager::NextPlugin(iCurrentPlugin, this, (TBool)ETrue);
 
 			// find out whether there is a plugin registered to post intercept this message
 			CFsPlugin* postInterceptPlugin = NULL;
 			if (iCurrentPlugin == NULL)
-				FsPluginManager::PrevPlugin(postInterceptPlugin, this);
+				FsPluginManager::PrevPlugin(postInterceptPlugin, this, (TBool)ETrue);
 
-			// Save the client's thread Id for subsequent testing by CFsPlugin::OriginatedFromPlugin() - doing so on the fly 
+			// Save the client's thread Id for subsequent testing by CFsPlugin::IsPluginThread() - doing so on the fly 
 			// is risky because some messages are completed early in which case Message().Client() will result in a panic
 			if ((iCurrentPlugin || postInterceptPlugin) && Message().Handle() != NULL && Message().Handle() != KLocalMessageHandle)
 				{
@@ -1509,23 +1490,16 @@
 		__PLUGIN_PRINT1(_L("PLUGIN: CFsMessageRequest %x dispatched to plugin (async)"), this);
 		// The request has been delivered to the plugin thread
 		//  - leave the main thread now and await asynchronous completion
-		if(pluginChainLocked)
-		    FsPluginManager::UnlockChain();
 		return;
 		}
 
-	//DispatchToPlugin didn't (deliver then unlock) so make sure we unlock here.
-    if(pluginChainLocked)
-        FsPluginManager::UnlockChain();
 
 	// Is there a PostInitialise function ?
 	if (iReqState ==  EReqStatePostInitialise && aInitialise && r == KErrNone)
 		{
 		TInt r = PostInitialise();
 		if (r == EReqActionComplete)
-		    {
 			return;
-		    }
 		else if (r == EReqActionBusy)				// request postponed ?
 			SetState(EReqStatePostInitialise);		// reinitialize when request is next processed
 		}
@@ -1585,7 +1559,6 @@
 //
 // Common route: Receive -> Process -> Dispatch -> DispatchToPlugin
 //
-// (Is called with FsPluginManager ReadLocked)
 	{
 	TInt drivenumber = DriveNumber();
 	if(iCurrentPlugin)
@@ -1599,16 +1572,16 @@
 				iCurrentPlugin = NULL;
 				}
 
-			while(iCurrentPlugin && iCurrentPlugin->OriginatedFromPlugin(*this))
+			while(iCurrentPlugin && iCurrentPlugin->IsPluginThread(*this))
 				{
 				// Skip the current plugin if the request originated from the plugin
 				if(IsPostOperation())
 					{
-					FsPluginManager::PrevPlugin(iCurrentPlugin, this);
+					FsPluginManager::PrevPlugin(iCurrentPlugin, this,(TBool)ETrue);
 					}
 				else
 					{
-					FsPluginManager::NextPlugin(iCurrentPlugin, this);
+					FsPluginManager::NextPlugin(iCurrentPlugin, this,(TBool)ETrue);
 					}
 				}
 				
@@ -1638,7 +1611,7 @@
 					//  - Pass the message on to the next plugin
 					if(FsFunction() != EFsPluginOpen)
 					    {
-	                    FsPluginManager::NextPlugin(iCurrentPlugin, this);
+	                    FsPluginManager::NextPlugin(iCurrentPlugin, this,(TBool)ETrue);
 	                    continue;
 					    }
 					else // FsFunction == EFsPluginOpen
@@ -1646,6 +1619,7 @@
 					    /* 
 					     * PluginOpen requests should not be passed down the plugin stack.
 					     * 
+
 					     */
 					    iCurrentPlugin = NULL;
 					    continue;
@@ -1656,7 +1630,7 @@
 					// The plugin has processed synchronously (case 2)
 					//  - Pass the message back up the stack
 					SetPostOperation(ETrue);
-					FsPluginManager::PrevPlugin(iCurrentPlugin, this);
+					FsPluginManager::PrevPlugin(iCurrentPlugin, this,(TBool)ETrue);
 					continue;
 					}
 				_LIT(KPanic,"Panic: F32-BAD-PLUGIN-ERROR");
@@ -1678,17 +1652,13 @@
 			}			
 		}
 
-	/*
-	 * Special case- DismountPlugin runs in the context of the plugin thread
-	 */
 	if(iOperation->Function() == EFsDismountPlugin)
 		{
 		// Don't pass plugin dismounts to the drive thread
-	    FsPluginManager::UnlockChain();
 		Process();
-		FsPluginManager::ReadLockChain(); //inverted unlock/lock to get around dismount plugin being a special case
 		return(ETrue);
 		}
+		
 	return EFalse;
 	}
 
--- a/userlibandfileserver/fileserver/sfile/sf_std.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_std.h	Wed Sep 01 12:34:56 2010 +0100
@@ -34,6 +34,7 @@
 #include "sf_func.h"
 #include <f32plugin.h>
 #include "f32trace.h"
+#include <utraceefile.h>
 
 #define __PRINT1TEMP_ALWAYS(t,a) {{TBuf<KMaxFileName>temp(a);RDebug::Print(t,&temp);}}
 #define __PRINT2TEMP_ALWAYS(t,a,b) {{TBuf<KMaxFileName>temp(b);RDebug::Print(t,a,&temp);}}
@@ -243,7 +244,8 @@
 
 enum TFsPanic
 	{
-	ELdrImportedOrdinalDoesNotExist	
+	ELdrImportedOrdinalDoesNotExist,
+	ELdrHeapCorruptionOnRemove
 	};
 //
 enum TFsFault
@@ -451,8 +453,7 @@
 	ETraceLddLoadFailure,				//200
 	ETooManyDrivesPerSocket,
 	ENotificationFault,
-	EFsObjectOpen,
-	EContainerHeapCorruptionOnRemove
+	EFsObjectOpen
 	};
 
 
@@ -809,7 +810,7 @@
 NONSHARABLE_CLASS(CPluginThread) : public CRequestThread
 	{
 public:
-	CPluginThread(CFsPlugin& aPlugin, RLibrary aLibrary);
+	CPluginThread(CFsPlugin& aPlugin);
 	~CPluginThread();
 	
 	void CompleteSessionRequests(CSessionFs* aSession, TInt aValue);
@@ -821,7 +822,7 @@
 	void OperationLockSignal();
 
 private:
-	static CPluginThread* NewL(CFsPlugin& aPlugin, RLibrary aLibrary);
+	static CPluginThread* NewL(CFsPlugin& aPlugin);
 	TUint StartL();
 	virtual TInt DoThreadInitialise();
 private:
@@ -830,7 +831,6 @@
 	/** @prototype */
 	RSemaphore iOperationLock;
 
-	RLibrary iLib;	// contains a handle to the library	which created the plugin
 friend class FsPluginManager;
 	};
 
@@ -1716,6 +1716,7 @@
 extern HBufC* TheDriveNames[];
 extern TDrive TheDrives[KMaxDrives];
 extern TFileName TheDefaultPath;
+extern RFTrace TheFtrace;
 
 extern SCapabilitySet AllCapabilities;
 extern SCapabilitySet DisabledCapabilities;
@@ -1874,7 +1875,6 @@
 	TInt iFairSchedulingLen;
 	TBool iNotifyAsyncReadersPending;
 	TBool iDeleteOnClose;
-	TDblQue<CFileShare> iShareList;	// A list containing the CFileShare objects associated with the file
 
 protected:
 	TInt iPromotedShares;
@@ -1884,14 +1884,11 @@
 
     /** 
     maximum file size supported by the filesystem that instantiates the CFileCB, associated with this object.
-    For example, FAT32 supports files not larger than 4GB-1. Other file systems can support larger files.
+    For example, FAT32 supports files not larger than 4GB-1. Other file systems can support larger files. 
     This member allows file server to know maximum allowed position in the file.
     The default value is KMaxTUint64
     */
-    TUint64 iMaxSupportedFileSize;
-    
-    TInt iNonSequentialFileModes;	// Count of clients without the 'Sequential' mode enabled
-	TBool iSequential;				// Indicates whether the file is in 'Sequential' mode
+    TUint64 iMaxSupportedFileSize; 
 
 public:
 	// Provides support for large file size ( file size > 4GB - 1)
@@ -1961,6 +1958,7 @@
 	RLibrary iLibrary;
 	};
 
+
 #include "sf_ops.h"
 #include "sf_std.inl"
 
--- a/userlibandfileserver/fileserver/sfile/sf_svr.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_svr.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -1314,13 +1314,8 @@
 
                 return KErrNone;
             }
-            case EFSysExtensionsSupported:
-            {
-                TBool supported = pDrive->GetFSys()->IsExtensionSupported();
-                TPckgBuf<TBool> data(supported);
-                aRequest->WriteL(KMsgPtr2,data);
-                return KErrNone;
-            }
+
+            
 		default:
 			{
 			return KErrNotSupported;
--- a/userlibandfileserver/fileserver/sfile/sf_sys.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_sys.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -21,10 +21,6 @@
 #include <kernel/localise.h>
 #include <f32file.h>
 
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "sf_sysTraces.h"
-#endif
-
 typedef CFileSystem*(*TFileSystemNew)();
 extern CProxyDriveFactory* GetExtension(const TDesC& aName);
 
@@ -43,8 +39,8 @@
 */
 EXPORT_C CFileSystem::CFileSystem()
 	{
-	OstTrace0(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMCONSTRUCTOR, "");
-	OstTrace0(TRACE_FILESYSTEM,FILESYS_ECFILESYSTEMCONSTRUCTORRETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleFileSys::ECFileSystemConstructor, EF32TraceUidFileSys);
+	TRACE0(UTF::EBorder, UTraceModuleFileSys::ECFileSystemConstructorReturn, EF32TraceUidFileSys);
 	}
 
 /**
@@ -52,8 +48,8 @@
 */
 EXPORT_C CFileSystem::~CFileSystem()
 	{
-	OstTrace0(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMDESTRUCTOR, "");
-	OstTrace0(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMDESTRUCTORRETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleFileSys::ECFileSystemDestructor, EF32TraceUidFileSys);
+	TRACE0(UTF::EBorder, UTraceModuleFileSys::ECFileSystemDestructorReturn, EF32TraceUidFileSys);
 	}
 
 /**
@@ -270,25 +266,22 @@
 //
 	{
 
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMINSTALL, "this %x", aSys);
-
+	TRACE1(UTF::EBorder, UTraceModuleFileSys::ECFileSystemInstall, EF32TraceUidFileSys, aSys);
 	TInt r=aSys->Install();
-
-	OstTraceData(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMINSTALLYS_EFILESYSTEMNAME, "FileSystemName %S", aSys->Name().Ptr(), aSys->Name().Length()<<1);
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMINSTALLRET, "r %d", r);
+	TRACERETMULT2(UTF::EBorder, UTraceModuleFileSys::ECFileSystemInstallRet, EF32TraceUidFileSys, r, aSys->Name());
 
 	__PRINT1TEMP(_L("InstallFileSystem %S"),aSys->Name());
 	if (r==KErrNone)
 		{TRAP(r,FileSystems->AddL(aSys,ETrue))}
 	if (r!=KErrNone)
 		{
-		OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMREMOVE1, "this %x", aSys);
-#ifdef OST_TRACE_COMPILER_IN_USE
+		TRACE1(UTF::EBorder, UTraceModuleFileSys::ECFileSystemRemove, EF32TraceUidFileSys, aSys);
+#ifdef SYMBIAN_FTRACE_ENABLE
 		TInt r = 
 #endif
 			aSys->Remove();
 		
-		OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMREMOVE1RET, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECFileSystemRemoveRet, EF32TraceUidFileSys, r);
 		}
 	if (r==KErrNone)
 		aSys->SetLibrary(aLib);
@@ -327,9 +320,9 @@
 	if (!f)
 		return KErrCorrupt;
 	
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMNEW, "handle %x", lib.Handle());
+	TRACE1(UTF::EBorder, UTraceModuleFileSys::ECFileSystemNew, EF32TraceUidFileSys, lib.Handle());
 	CFileSystem* pS=(*f)();
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMNEWRET, "fileSystem %x", pS);
+	TRACE1(UTF::EBorder, UTraceModuleFileSys::ECFileSystemNewRet, EF32TraceUidFileSys, pS);
 	if (!pS)
 		return KErrNoMemory;
 	TInt r=InstallFileSystem(pS,lib);
@@ -381,12 +374,9 @@
 			return KErrInUse;
 		}
 	
-    OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMREMOVE2, "this %x", pF);
-
+    TRACE1(UTF::EBorder, UTraceModuleFileSys::ECFileSystemRemove, EF32TraceUidFileSys, pF);
 	TInt r=pF->Remove();
-
-	OstTrace1(TRACE_FILESYSTEM, FSYS_ECFILESYSTEMREMOVE2RET, "r %d", r);
-
+	TRACERET1(UTF::EBorder, UTraceModuleFileSys::ECFileSystemRemoveRet, EF32TraceUidFileSys, r);
 	if (r!=KErrNone)
 		return(r);
 	
--- a/userlibandfileserver/fileserver/sfile/sf_thread.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_thread.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -925,34 +925,24 @@
 	}
 
 
-CPluginThread::CPluginThread(CFsPlugin& aPlugin, RLibrary aLibrary)
-  : iPlugin(aPlugin), iLib(aLibrary)
+CPluginThread::CPluginThread(CFsPlugin& aPlugin)
+  : iPlugin(aPlugin)
 	{
 	/** @prototype */
 	iOperationLock.Close();
 	iPlugin.Open();
-	
-    /* 
-    Duplicate the handle to the DLL which created the plugin to prevent 
-    TFsRemovePlugin::DoRequestL() from unmapping the DLL's code segment before
-    this thread's destructor has been called as the destructor closes the plugin 
-    which results in a call to the plugin's derived destructor contained in the DLL (!)
-    */ 
-    TInt r = iLib.Duplicate(iThread, EOwnerProcess);
-    __ASSERT_ALWAYS(r==KErrNone, Fault(EFsThreadConstructor));
 	}
 
 CPluginThread::~CPluginThread()
     {
     iPlugin.Close();
-	iLib.Close();
     }
 
 
-CPluginThread* CPluginThread::NewL(CFsPlugin& aPlugin, RLibrary aLibrary)
+CPluginThread* CPluginThread::NewL(CFsPlugin& aPlugin)
 	{
 	__PRINT(_L("CPluginThread::NewL()"));
-	CPluginThread* pT=new(ELeave) CPluginThread(aPlugin, aLibrary);
+	CPluginThread* pT=new(ELeave) CPluginThread(aPlugin);
 	TInt r=pT->Initialise();
 
 	/** @prototype */
--- a/userlibandfileserver/fileserver/sfile/sf_utl.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfile/sf_utl.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -613,11 +613,9 @@
 	}
 
 
-
-/**
-    @return ETrue if aDes only contains spaces or is zero length
-    Note that _all_ UNICODE space characters are treated as usual spaces
-*/
+//
+// Returns ETrue if aDes only contains spaces or is zero length
+//
 static TBool IsSpace(const TDesC& aDes)
 	{
 
@@ -892,43 +890,38 @@
 	return powerGood;
 	}
 
-//---------------------------------------------------------------------------------------------------------------------------------
-/**
-    Decrement mount's lock counter when the mount resource, like a file or directory is opened. 
-    See also: CMountCB::LockStatus()   
-*/
 void AddResource(CMountCB& aMount)
+//
+// Decrement resource counters
+//
 	{
 	__CHECK_DRIVETHREAD(aMount.Drive().DriveNumber());
 	__ASSERT_DEBUG(aMount.LockStatus()<=0,Fault(ERawDiskBadAccessCount2));
 	aMount.DecLock();
 	}
 
-/**
-    Increment mount's lock counter when the mount resource, like a file or directory is closed. 
-    See also: CMountCB::LockStatus()   
-*/
 void RemoveResource(CMountCB& aMount)
+//
+// Increment resource counters
+//
 	{
 	__ASSERT_DEBUG(aMount.LockStatus()<0,Fault(ERawDiskBadAccessCount1));
 	aMount.IncLock();
 	}
 
 
-/**
-    Increment mount's lock counter when the disk access (Format, Raw disk) is opened on the mount
-    See also: CMountCB::LockStatus()   
-*/
 void AddDiskAccess(CMountCB& aMount)
+//
+// Increment resource counters
+//
 	{
 	aMount.IncLock();
 	}
 
-/**
-    Decrement mount's lock counter when the disk access (Format, Raw disk) is closed on the mount
-    See also: CMountCB::LockStatus()   
-*/
 void RemoveDiskAccess(CMountCB& aMount)
+//
+// Decrement resource counters
+//
 	{
 	aMount.DecLock();
 	}
--- a/userlibandfileserver/fileserver/sfile/traces/OstTraceDefinitions.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +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:
-
-#ifndef __OSTTRACEDEFINITIONS_H__
-#define __OSTTRACEDEFINITIONS_H__
-// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
-// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
-//#define OST_TRACE_COMPILER_IN_USE
-#include <OpenSystemTrace.h>
-#endif
--- a/userlibandfileserver/fileserver/sfile/traces/fixed_id.definitions	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,740 +0,0 @@
-#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
-[GROUP]TRACE_BORDER=0x42
-[GROUP]TRACE_DRIVE=0x41
-[GROUP]TRACE_FILESYSTEM=0x40
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EDIRCLOSE=0x124
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EDIRCLOSERETURN=0x125
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EDIROPEN1=0x11e
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EDIROPEN1RETURN=0x120
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EDIROPEN1_EDIRNAME=0x11f
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EDIROPEN2=0x121
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EDIROPEN2RETURN=0x123
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EDIROPEN2_EDIRNAME=0x122
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EDIRREAD1=0x126
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EDIRREAD1RETURN=0x127
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EDIRREAD2=0x128
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EDIRREAD2RETURN=0x129
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EDIRREAD3=0x12a
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EDIRREAD3RETURN=0x12b
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EDIRREAD4=0x12c
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EDIRREAD4RETURN=0x12d
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64ADOPTFROMCLIENT=0x1b1
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64ADOPTFROMCLIENTRETURN1=0x1b2
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64ADOPTFROMCLIENTRETURN2=0x1b3
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64ADOPTFROMCLIENTRETURN3=0x1b4
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64ADOPTFROMCREATOR=0x1b8
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64ADOPTFROMCREATORRETURN1=0x1b9
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64ADOPTFROMCREATORRETURN2=0x1ba
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64ADOPTFROMCREATORRETURN3=0x1bb
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64ADOPTFROMSERVER=0x1b5
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64ADOPTFROMSERVERRETURN1=0x1b6
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64ADOPTFROMSERVERRETURN2=0x1b7
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64CREATE=0x1a7
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64CREATERETURN=0x1a9
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64CREATE_EFILENAME=0x1a8
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64LOCK=0x1d2
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64LOCKRETURN=0x1d3
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64OPEN=0x1a4
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64OPENRETURN=0x1a6
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64OPEN_EFILENAME=0x1a5
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64READ10=0x1be
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64READ10RETURN=0x1bf
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64READ11=0x1c2
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64READ11RETURN=0x1c3
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64READ12=0x1d8
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64READ12RETURN=0x1d9
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64READ13=0x1dc
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64READ13RETURN=0x1dd
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64READ14=0x1d6
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64READ14RETURN=0x1d7
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64READ15=0x1c0
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64READ15RETURN=0x1c1
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64READ16=0x1da
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64READ16RETURN=0x1db
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64READ8=0x1bc
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64READ8RETURN=0x1bd
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64REPLACE=0x1aa
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64REPLACERETURN=0x1ac
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64REPLACE_EFILENAME=0x1ab
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64SEEK2=0x1cc
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64SEEK2RETURN=0x1cd
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64SETSIZE2=0x1d0
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64SETSIZE2RETURN=0x1d1
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64SIZE2=0x1ce
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64SIZE2RETURN=0x1cf
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64TEMP=0x1ad
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64TEMPRETURN=0x1b0
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64TEMP_EDIRNAME=0x1ae
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64TEMP_EFILENAME=0x1af
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64UNLOCK=0x1d4
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64UNLOCKRETURN=0x1d5
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64WRITE11=0x1ca
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64WRITE11RETURN=0x1cb
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64WRITE12=0x1e4
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64WRITE12RETURN=0x1e5
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64WRITE13=0x1c4
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64WRITE13RETURN=0x1c5
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64WRITE14=0x1de
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64WRITE14RETURN=0x1df
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64WRITE15=0x1c6
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64WRITE15RETURN=0x1c7
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64WRITE16=0x1e0
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64WRITE16RETURN=0x1e1
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64WRITE7=0x1c8
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64WRITE7RETURN=0x1c9
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64WRITE8=0x1e2
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILE64WRITE8RETURN=0x1e3
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEADOPT=0x12e
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEADOPTFROMCLIENT=0x135
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEADOPTFROMCLIENTRETURN1=0x136
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEADOPTFROMCLIENTRETURN2=0x137
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEADOPTFROMCLIENTRETURN3=0x138
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEADOPTFROMCREATOR=0x139
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEADOPTFROMCREATORRETURN1=0x13a
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEADOPTFROMCREATORRETURN2=0x13b
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEADOPTFROMCREATORRETURN3=0x13c
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEADOPTFROMSERVER=0x132
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEADOPTFROMSERVERRETURN1=0x133
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEADOPTFROMSERVERRETURN2=0x134
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEADOPTRETURN1=0x12f
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEADOPTRETURN2=0x130
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEADOPTRETURN3=0x131
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEATT=0x18d
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEATTRETURN=0x18e
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEBLOCKMAPA=0x1a1
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEBLOCKMAPB=0x1a2
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEBLOCKMAPRETURN=0x1a3
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILECHANGEMODE=0x198
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILECHANGEMODERETURN=0x199
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILECLAMP=0x19f
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILECLAMPRETURN=0x1a0
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILECLOSE=0x153
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILECLOSERETURN=0x154
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILECREATE=0x155
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILECREATERETURN=0x157
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILECREATE_EFILENAME=0x156
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEDRIVE=0x19d
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEDRIVERETURN=0x19e
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEDUPLICATE=0x13d
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEDUPLICATERETURN1=0x13e
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEDUPLICATERETURN2=0x13f
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEDUPLICATERETURN3=0x140
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEFLUSH1=0x185
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEFLUSH1RETURN=0x186
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEFLUSH2=0x187
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEFLUSH2RETURN=0x188
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEFULLNAME=0x14d
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEFULLNAMERETURN=0x14f
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEFULLNAME_EFILENAME=0x14e
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEGETNAME=0x14a
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEGETNAMERETURN=0x14c
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEGETNAME_EFILENAME=0x14b
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILELOCK=0x17f
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILELOCKRETURN=0x180
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEMODIFIED=0x191
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEMODIFIEDRETURN=0x192
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEOPEN=0x150
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEOPENRETURN=0x152
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEOPEN_EFILENAME=0x151
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEREAD1=0x15f
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEREAD1RETURN=0x160
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEREAD2=0x161
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEREAD2RETURN=0x162
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEREAD3=0x167
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEREAD3RETURN=0x168
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEREAD4=0x169
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEREAD4RETURN=0x16a
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEREAD5=0x163
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEREAD5RETURN=0x164
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEREAD6=0x165
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEREAD6RETURN=0x166
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEREAD7=0x16b
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEREAD7RETURN=0x16c
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEREAD9=0x16d
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEREAD9RETURN=0x16e
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILERENAME=0x19a
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILERENAMERETURN=0x19c
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILERENAME_ENEWNAME=0x19b
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEREPLACE=0x158
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEREPLACERETURN=0x15a
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEREPLACE_EFILENAME=0x159
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILESEEK1=0x183
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILESEEK1RETURN=0x184
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILESETA=0x195
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILESETATT=0x18f
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILESETATTRETURN=0x190
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILESETB=0x196
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILESETMODIFIED=0x193
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILESETMODIFIEDRETURN=0x194
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILESETRETURN=0x197
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILESETSIZE1=0x18b
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILESETSIZE1RETURN=0x18c
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILESIZE=0x189
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILESIZERETURN=0x18a
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILETEMP=0x15b
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILETEMPRETURN=0x15e
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILETEMP_EDIRNAME=0x15c
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILETEMP_EFILENAME=0x15d
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILETRANSFERTOCLIENT=0x144
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILETRANSFERTOCLIENTRETURN1=0x145
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILETRANSFERTOCLIENTRETURN2=0x146
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILETRANSFERTOCLIENTRETURN3=0x147
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILETRANSFERTOPROCESS=0x148
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILETRANSFERTOPROCESSRETURN=0x149
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILETRANSFERTOSERVER=0x141
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILETRANSFERTOSERVERRETURN1=0x142
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILETRANSFERTOSERVERRETURN2=0x143
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEUNLOCK=0x181
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEUNLOCKRETURN=0x182
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEWRITE1=0x16f
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEWRITE10=0x17d
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEWRITE10RETURN=0x17e
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEWRITE1RETURN=0x170
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEWRITE2=0x171
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEWRITE2RETURN=0x172
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEWRITE3=0x177
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEWRITE3RETURN=0x178
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEWRITE4=0x179
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEWRITE4RETURN=0x17a
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEWRITE5=0x173
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEWRITE5RETURN=0x174
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEWRITE6=0x17b
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEWRITE6RETURN=0x17c
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEWRITE9=0x175
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFILEWRITE9RETURN=0x176
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSADDCOMPOSITEMOUNT=0xfe
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSADDCOMPOSITEMOUNTRETURN=0x100
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSADDCOMPOSITEMOUNT_EFILESYSTEMNAME=0xff
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSADDEXTENSION=0x3b
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSADDEXTENSIONRETURN=0x3d
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSADDEXTENSION_EEXTENSIONNAME=0x3c
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSADDFILESYSTEM=0x17
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSADDFILESYSTEMRETURN=0x19
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSADDFILESYSTEM_EFILENAME=0x18
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSALLOWDISMOUNT=0x10d
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSALLOWDISMOUNTRETURN=0x10e
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSATT=0xa0
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSATTRETURN=0xa2
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSATT_EFILENAME=0xa1
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSCHECKDISK=0xc1
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSCHECKDISKRETURN=0xc3
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSCHECKDISK_EDIRNAME=0xc2
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSCLEARPASSWORD=0xec
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSCLEARPASSWORDRETURN=0xed
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSCLOSE=0x11c
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSCLOSERETURN=0x11d
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSCONNECT=0xc
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSCONNECTRETURN=0xd
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSCREATEPRIVATEPATH=0x13
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSCREATEPRIVATEPATHRETURN=0x14
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSDELETE=0x95
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSDELETERETURN=0x97
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSDELETE_EFILENAME=0x96
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSDISMOUNTEXTENSION=0x41
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSDISMOUNTEXTENSIONRETURN=0x43
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSDISMOUNTEXTENSION_EEXTENSIONNAME=0x42
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSDISMOUNTFILESYSTEM=0x32
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSDISMOUNTFILESYSTEMRETURN=0x34
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSDISMOUNTFILESYSTEM_EFILESYSTEMNAME=0x33
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSDRIVE=0x5f
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSDRIVELIST1=0x5b
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSDRIVELIST1RETURN=0x5c
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSDRIVELIST2=0x5d
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSDRIVELIST2RETURN=0x5e
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSDRIVERETURN=0x60
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSDRIVETOCHAR=0x1
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSDRIVETOCHARRETURN=0x2
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSENTRY=0xac
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSENTRYRETURN=0xae
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSENTRY_EFILENAME=0xad
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSERASEPASSWORD=0xee
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSERASEPASSWORDRETURN=0xef
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSEXTENSIONNAME=0x47
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSEXTENSIONNAMERETURN=0x49
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSEXTENSIONNAME_EEXTENSIONNAME=0x48
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSFILESYSTEMNAME=0x35
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSFILESYSTEMNAMERETURN=0x37
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSFILESYSTEMNAME_EFILESYSTEMNAME=0x36
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSFILESYSTEMNAME_ESUPPORTEDFILESYSTEMNAME=0x39
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSFILESYSTEMSUBTYPE=0x119
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSFILESYSTEMSUBTYPERETURN=0x11b
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSFILESYSTEMSUBTYPE_EFILESYSTEMNAME=0x11a
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSFINALISEDRIVE=0xf5
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSFINALISEDRIVERETURN=0xf6
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSFINALISEDRIVES=0xf7
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSFINALISEDRIVESRETURN1=0xf8
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSFINALISEDRIVESRETURN2=0xf9
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETDIR1=0x85
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETDIR1RETURN=0x87
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETDIR1_EDIRNAME=0x86
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETDIR2=0x88
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETDIR2RETURN=0x8a
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETDIR2_EDIRNAME=0x89
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETDIR3=0x8b
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETDIR3RETURN=0x8d
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETDIR3_EDIRNAME=0x8c
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETDRIVENAME=0xe2
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETDRIVENAMERETURN=0xe4
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETDRIVENAME_EDRIVENAME=0xe3
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETLONGNAME=0xcb
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETLONGNAMERETURN=0xce
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETLONGNAME_ELONGNAME=0xcd
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETLONGNAME_ESHORTNAME=0xcc
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETMEDIASERIALNUMBER=0x73
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETMEDIASERIALNUMBERRETURN=0x74
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETMEDIASERIALNUMBER_ESERIALNUMBER=0x75
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETNOTIFYUSER=0xd2
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETNOTIFYUSERRETURN=0xd3
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETRESERVEACCESS=0x103
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETRESERVEACCESSRETURN=0x104
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETSHORTNAME=0xc7
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETSHORTNAMERETURN=0xca
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETSHORTNAME_ELONGNAME=0xc8
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETSHORTNAME_ESHORTNAME=0xc9
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETSYSTEMDRIVE=0x5
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETSYSTEMDRIVECHAR=0x8
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETSYSTEMDRIVECHARRETURN=0x9
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETSYSTEMDRIVERETURN1=0x6
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSGETSYSTEMDRIVERETURN2=0x7
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSINITIALISEPROPERTIESFILE=0x113
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSINITIALISEPROPERTIESFILERETURN=0x114
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSISFILEINROM=0xd6
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSISFILEINROMRETURN=0xd8
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSISFILEINROM_EFILENAME=0xd7
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSISFILEOPEN=0xcf
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSISFILEOPENRETURN=0xd1
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSISFILEOPEN_EFILENAME=0xd0
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSISROMADDRESS=0x3
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSISROMADDRESSRETURN=0x4
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSISVALIDNAME1=0xd9
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSISVALIDNAME1RETURN=0xdb
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSISVALIDNAME1_EFILENAME=0xda
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSISVALIDNAME2=0xdc
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSISVALIDNAME2RETURN=0xde
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSISVALIDNAME2_EFILENAME=0xdd
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSISVALIDNAME3=0xdf
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSISVALIDNAME3RETURN=0xe1
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSISVALIDNAME3_EFILENAME=0xe0
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSLOCKDRIVE=0xe8
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSLOCKDRIVERETURN=0xe9
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMKDIR=0x7c
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMKDIRALL=0x7f
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMKDIRALLRETURN=0x81
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMKDIRALL_EDIRNAME=0x80
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMKDIRRETURN=0x7e
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMKDIR_EDIRNAME=0x7d
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMODIFIED=0xa6
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMODIFIEDRETURN=0xa8
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMODIFIED_EFILENAME=0xa7
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTEXTENSION=0x3e
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTEXTENSIONRETURN=0x40
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTEXTENSION_EEXTENSIONNAME=0x3f
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTFILESYSTEM1=0x1d
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTFILESYSTEM1RETURN=0x1f
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTFILESYSTEM1_EFILESYSTEMNAME=0x1e
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTFILESYSTEM2=0x20
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTFILESYSTEM2RETURN=0x22
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTFILESYSTEM2_EFILESYSTEMNAME=0x21
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTFILESYSTEM3=0x23
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTFILESYSTEM3RETURN=0x26
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTFILESYSTEM3_EEXTENSIONNAME=0x24
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTFILESYSTEM3_EFILESYSTEMNAME=0x25
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTFILESYSTEM4=0x27
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTFILESYSTEM4RETURN=0x2a
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTFILESYSTEM4_EEXTENSIONNAME=0x29
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTFILESYSTEM4_EFILESYSTEMNAME=0x28
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTFILESYSTEMANDSCAN1=0x2b
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTFILESYSTEMANDSCAN1RETURN=0x2d
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTFILESYSTEMANDSCAN1_EFILESYSTEMNAME=0x2c
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTFILESYSTEMANDSCAN2=0x2e
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTFILESYSTEMANDSCAN2RETURN=0x31
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTFILESYSTEMANDSCAN2_EEXTENSIONNAME=0x30
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSMOUNTFILESYSTEMANDSCAN2_EFILESYSTEMNAME=0x2f
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSNOTIFYCHANGE1=0x4c
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSNOTIFYCHANGE1RETURN=0x4d
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSNOTIFYCHANGE2=0x4e
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSNOTIFYCHANGE2RETURN=0x50
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSNOTIFYCHANGE2_EDIRNAME=0x4f
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSNOTIFYCHANGECANCEL1=0x51
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSNOTIFYCHANGECANCEL1RETURN=0x52
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSNOTIFYCHANGECANCEL2=0x53
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSNOTIFYCHANGECANCEL2RETURN=0x54
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSNOTIFYDISKSPACE=0x55
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSNOTIFYDISKSPACECANCEL1=0x57
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSNOTIFYDISKSPACECANCEL1RETURN=0x58
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSNOTIFYDISKSPACECANCEL2=0x59
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSNOTIFYDISKSPACECANCEL2RETURN=0x5a
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSNOTIFYDISKSPACERETURN=0x56
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSNOTIFYDISMOUNT=0x107
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSNOTIFYDISMOUNTCANCEL1=0x109
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSNOTIFYDISMOUNTCANCEL1RETURN=0x10a
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSNOTIFYDISMOUNTCANCEL2=0x10b
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSNOTIFYDISMOUNTCANCEL2RETURN=0x10c
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSNOTIFYDISMOUNTRETURN=0x108
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSPARSE1=0x8e
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSPARSE1RETURN=0x90
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSPARSE1_EFILEPATH=0x8f
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSPARSE2=0x91
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSPARSE2RETURN=0x94
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSPARSE2_EFILENAME=0x92
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSPARSE2_ERELATED=0x93
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSPRIVATEPATH=0x10
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSPRIVATEPATHRETURN=0x12
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSPRIVATEPATH_EDIRNAME=0x11
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSQUERYVOLUMEINFOEXT=0x115
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSQUERYVOLUMEINFOEXTRETURN=0x116
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREADFILESECTION=0xb2
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREADFILESECTIONRETURN1=0xb4
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREADFILESECTIONRETURN2=0xb5
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREADFILESECTIONRETURN3=0xb6
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREADFILESECTION_EFILENAME=0xb3
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREADFILESECTION_RESERVED=0xb7
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREADFILESECTION_RESERVED_EFILENAME=0xb8
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREADFILESECTION_RESERVED_RETURN1=0xb9
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREADFILESECTION_RESERVED_RETURN2=0xba
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREALNAME=0x6f
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREALNAMERETURN=0x72
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREALNAME_EFILENAME1=0x70
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREALNAME_EFILENAME2=0x71
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSRELEASERESERVEACCESS=0x105
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSRELEASERESERVEACCESSRETURN=0x106
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREMOUNTDRIVE=0x4a
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREMOUNTDRIVERETURN=0x4b
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREMOVEEXTENSION=0x44
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREMOVEEXTENSIONRETURN=0x46
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREMOVEEXTENSION_EEXTENSIONNAME=0x45
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREMOVEFILESYSTEM=0x1a
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREMOVEFILESYSTEMRETURN=0x1c
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREMOVEFILESYSTEM_EFILESYSTEMNAME=0x1b
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSRENAME=0x98
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSRENAMERETURN=0x9b
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSRENAME_ENEWNAME=0x9a
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSRENAME_EOLDNAME=0x99
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREPLACE=0x9c
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREPLACERETURN=0x9f
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREPLACE_ENEWNAME=0x9e
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSREPLACE_EOLDNAME=0x9d
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSRESERVEDRIVESPACE=0x101
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSRESERVEDRIVESPACERETURN=0x102
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSRESOURCECOUNT=0xbf
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSRESOURCECOUNTMARKEND=0xbd
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSRESOURCECOUNTMARKENDRETURN=0xbe
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSRESOURCECOUNTMARKSTART=0xbb
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSRESOURCECOUNTMARKSTARTRETURN=0xbc
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSRESOURCECOUNTRETURN=0xc0
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSRMDIR=0x82
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSRMDIRRETURN=0x84
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSRMDIR_EDIRNAME=0x83
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSCANDRIVE=0xc4
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSCANDRIVERETURN=0xc6
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSCANDRIVE_EDIRNAME=0xc5
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSESSIONPATH=0x76
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSESSIONPATHRETURN=0x77
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSESSIONPATH_EDIRNAME=0x78
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETATT=0xa3
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETATTRETURN=0xa5
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETATT_EFILENAME=0xa4
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETDRIVENAME=0xe5
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETDRIVENAMERETURN=0xe7
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETDRIVENAME_EDRIVENAME=0xe6
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETENTRY=0xaf
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETENTRYRETURN=0xb1
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETENTRY_EFILENAME=0xb0
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETLOCALDRIVEMAPPING=0xf2
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETLOCALDRIVEMAPPINGRETURN=0xf4
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETLOCALDRIVEMAPPING_ELOCALDRIVEMAPPING=0xf3
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETMODIFIED=0xa9
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETMODIFIEDRETURN=0xab
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETMODIFIED_EFILENAME=0xaa
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETNOTIFYCHANGE=0x111
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETNOTIFYCHANGERETURN=0x112
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETNOTIFYUSER=0xd4
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETNOTIFYUSERRETURN=0xd5
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETSESSIONPATH=0x79
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETSESSIONPATHRETURN=0x7b
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETSESSIONPATH_EDIRNAME=0x7a
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETSESSIONTOPRIVATE=0xe
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETSESSIONTOPRIVATERETURN=0xf
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETSTARTUPCONFIGURATION=0x10f
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETSTARTUPCONFIGURATIONRETURN=0x110
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETSUBST=0x6c
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETSUBSTRETURN=0x6e
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETSUBST_EDIRNAME=0x6d
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETSYSTEMDRIVE=0xa
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETSYSTEMDRIVERETURN=0xb
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETVOLUMELABEL=0x66
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETVOLUMELABELRETURN=0x68
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSETVOLUMELABEL_EVOLUMENAME=0x67
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSTARTUPINITCOMPLETE=0xf0
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSTARTUPINITCOMPLETERETURN=0xf1
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSUBST=0x69
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSUBSTRETURN=0x6b
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSUBST_EDIRNAME=0x6a
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSUPPORTEDFILESYSTEMNAME=0x38
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSUPPORTEDFILESYSTEMNAMERETURN=0x3a
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSWAPFILESYSTEM=0xfa
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSWAPFILESYSTEMRETURN=0xfd
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSWAPFILESYSTEM_ENEWNAME=0xfc
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSSWAPFILESYSTEM_EOLDNAME=0xfb
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSUNLOCKDRIVE=0xea
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSUNLOCKDRIVERETURN=0xeb
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSVERSION=0x15
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSVERSIONRETURN=0x16
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSVOLUME1=0x61
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSVOLUME1RETURNA=0x62
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSVOLUME1RETURNB=0x63
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSVOLUME2=0x64
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSVOLUME2RETURN=0x65
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSVOLUMEIOPARAM=0x117
-[TRACE]TRACE_BORDER[0x42]_EFSRV_EFSVOLUMEIOPARAMRETURN=0x118
-[TRACE]TRACE_DRIVE[0x41]_FSYS_ECFILESYSTEMISEXTENSIONSUPPORTED2=0x5f
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVECAPS=0x45
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVECAPSRET=0x46
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVECLEAR=0x53
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVECLEARRET=0x54
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVECONTROLIO=0x57
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVECONTROLIORET=0x58
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEDELETENOTIFY=0x5d
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEDELETENOTIFYRET=0x5e
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEDISMOUNTED=0x33
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEDISMOUNTEDRET=0x34
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEENLARGE=0x35
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEENLARGERET=0x36
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEERASEPASSWORD=0x55
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEERASEPASSWORDRET=0x56
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEFORCEREMOUNT=0x4d
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEFORCEREMOUNTRET=0x4e
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEFORMAT1=0x47
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEFORMAT1RET=0x48
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEFORMAT2=0x49
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEFORMAT2RET=0x4a
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEGETINTERFACE=0x59
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEGETINTERFACERET=0x5a
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEGETLASTERRORINFO=0x5b
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEGETLASTERRORINFORET=0x5c
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEINITIALISE=0x31
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEINITIALISERET=0x32
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVELOCK=0x51
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVELOCKRET=0x52
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEREAD1=0x39
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEREAD1RET=0x3a
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEREAD2=0x3b
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEREAD2RET=0x3c
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEREAD3=0x3d
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEREAD3RET=0x3e
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEREDUCESIZE=0x37
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEREDUCESIZERET=0x38
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVESETMOUNTINFO=0x4b
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVESETMOUNTINFORET=0x4c
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEUNLOCK=0x4f
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEUNLOCKRET=0x50
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEWRITE1=0x3f
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEWRITE1RET=0x40
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEWRITE2=0x41
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEWRITE2RET=0x42
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEWRITE3=0x43
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECBASEEXTPROXYDRIVEWRITE3RET=0x44
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVECAPS=0x17
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVECAPSRET=0x18
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVECLEAR=0x27
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVECLEARRET=0x28
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVECONTROLIO=0x21
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVECONTROLIORET=0x22
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEDELETENOTIFY=0x2b
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEDELETENOTIFYRET=0x2c
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEDISMOUNTED=0x5
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEDISMOUNTEDRET=0x6
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEENLARGE=0x7
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEENLARGERET=0x8
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEERASEPASSWORD=0x29
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEERASEPASSWORDRET=0x2a
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEFORCEREMOUNT=0x1f
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEFORCEREMOUNTRET=0x20
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEFORMAT1=0x19
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEFORMAT1RET=0x1a
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEFORMAT2=0x1b
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEFORMAT2RET=0x1c
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEGETINTERFACE=0x2f
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEGETINTERFACERET=0x30
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEGETLASTERRORINFO=0x2d
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEGETLASTERRORINFORET=0x2e
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEINITIALISE=0x3
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEINITIALISERET=0x4
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVELOCK=0x25
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVELOCKRET=0x26
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVENEW=0x1
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVENEWRET=0x2
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEREAD1=0xb
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEREAD1RET=0xc
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEREAD2=0xd
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEREAD2RET=0xe
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEREAD3=0xf
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEREAD3RET=0x10
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEREDUCESIZE=0x9
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEREDUCESIZERET=0xa
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVESETMOUNTINFO=0x1d
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVESETMOUNTINFORET=0x1e
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEUNLOCK=0x23
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEUNLOCKRET=0x24
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEWRITE1=0x11
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEWRITE1RET=0x12
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEWRITE2=0x13
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEWRITE2RET=0x14
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEWRITE3=0x15
-[TRACE]TRACE_DRIVE[0x41]_PROXYDRIVE_ECLOCALPROXYDRIVEWRITE3RET=0x16
-[TRACE]TRACE_FILESYSTEM[0x40]_FILESYS_ECFILESYSTEMCONSTRUCTORRETURN=0x91
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECDIRCBREADL1=0x5
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECDIRCBREADL1RET=0x6
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECDIRCBREADL2=0x1
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECDIRCBREADL2RET=0x2
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECDIRCBSTORELONGENTRYNAMEL=0x3
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECDIRCBSTORELONGENTRYNAMELRET=0x4
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILECBFLUSHDATAL1=0x6e
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILECBFLUSHDATAL1RET=0x6f
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILECBFLUSHDATAL2=0x84
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILECBFLUSHDATAL2RET=0x85
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILECBGETINTERFACE=0x82
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILECBGETINTERFACERET=0x83
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILECBREADLA=0x7c
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILECBREADLRET=0x7d
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILECBRENAMEL=0x76
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILECBRENAMELRET=0x78
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILECBRENAMELYS_EFILENAME=0x77
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILECBSETENTRYL1=0x70
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILECBSETENTRYL1RET=0x71
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILECBSETENTRYL2=0x72
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILECBSETENTRYL2RET=0x73
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILECBSETENTRYL3=0x74
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILECBSETENTRYL3RET=0x75
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILECBSETSIZEL=0x80
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILECBSETSIZELRET=0x81
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILECBWRITEL=0x7e
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILECBWRITELRET=0x7f
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMCONSTRUCTOR=0x90
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMDESTRUCTOR=0x92
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMDESTRUCTORRETURN=0x93
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMDRIVEINFO=0x17
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMDRIVEINFORET=0x18
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMINSTALL=0x94
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMINSTALLRET=0x96
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMINSTALLYS_EFILESYSTEMNAME=0x95
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMISEXTENSIONSUPPORTED1=0x57
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMNEW=0x99
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMNEWDIRL=0x3b
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMNEWDIRLRET=0x3c
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMNEWFILEL=0x36
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMNEWFILELRET=0x37
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMNEWFORMATL=0x6c
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMNEWFORMATLRET=0x6d
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMNEWMOUNTL=0x9
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMNEWMOUNTL1=0x53
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMNEWMOUNTL1RET=0x54
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMNEWMOUNTL2=0x58
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMNEWMOUNTL2RET=0x59
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMNEWMOUNTL3=0x5c
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMNEWMOUNTL3RET=0x5d
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMNEWMOUNTL4=0x60
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMNEWMOUNTL4RET=0x61
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMNEWMOUNTL5=0x64
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMNEWMOUNTL5RET=0x65
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMNEWMOUNTLRET=0xa
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMNEWRET=0x9a
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMREMOVE1=0x97
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMREMOVE1RET=0x98
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMREMOVE2=0x9b
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFILESYSTEMREMOVE2RET=0x9c
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFORMATCBDOFORMATSTEPL=0x88
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECFORMATCBDOFORMATSTEPLRET=0x89
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBCHECKDISK1=0x43
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBCHECKDISK1RET=0x44
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBCHECKDISK2=0x45
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBCHECKDISK2RET=0x46
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBCLEARPASSWORD=0x62
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBCLEARPASSWORDRET=0x63
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBCONTROLIO=0x6a
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBCONTROLIORET=0x6b
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBCURRENTFREESPACE=0x11
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBCURRENTFREESPACERET=0x12
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBDELETEL1=0x25
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBDELETEL1_EFILENAME=0x26
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBDELETEL1_RET=0x27
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBDELETEL2=0x79
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBDELETEL2RET=0x7b
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBDELETEL2_EFILENAME=0x7a
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBDIROPENL=0x3d
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBDIROPENLRET=0x3f
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBDIROPENL_EDIRNAME=0x3e
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBDISMOUNTED=0x68
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBDISMOUNTEDRET=0x69
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBENTRYL=0x30
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBENTRYLRET=0x32
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBENTRYL_EFILEPATH=0x31
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBERASEPASSWORD=0x66
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBERASEPASSWORDRET=0x67
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBFILEOPENL=0x38
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBFILEOPENLRET=0x3a
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBFILEOPENL_EFILENAME=0x39
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBFINALISEMOUNT1=0x15
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBFINALISEMOUNT1RET=0x16
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBFINALISEMOUNT2=0x13
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBFINALISEMOUNT2RET=0x14
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBFORCEREMOUNTDRIVE=0x55
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBFORCEREMOUNTDRIVERET=0x56
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBFREESPACE=0xd
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBFREESPACERET=0xe
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBGETINTERFACE=0x8a
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBGETINTERFACERET=0x8b
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBGETLONGNAMEL=0x4f
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBGETLONGNAMELRET=0x52
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBGETLONGNAMEL_ELONGNAME=0x51
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBGETLONGNAMEL_ESHORTNAME=0x50
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBGETSHORTNAMEL=0x4b
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBGETSHORTNAMEL_ECMOUNTCBGETSHORTNAMELRET=0x4e
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBGETSHORTNAMEL_ELONGNAME=0x4c
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBGETSHORTNAMEL_ESHORTNAME=0x4d
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBLOCK=0x5a
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBLOCKRET=0x5b
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBMKDIRL=0x1f
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBMKDIRLRET=0x21
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBMKDIRLYS_EDIRNAME=0x20
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBMOUNTCONTROL=0xb
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBMOUNTCONTROLRET=0xc
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBRAWREADL=0x8c
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBRAWREADLRET=0x8d
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBRAWWRITEL=0x8e
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBRAWWRITELRET=0x8f
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBREADFILESECTIONL=0x40
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBREADFILESECTIONLRET=0x42
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBREADFILESECTIONL_EFILENAME=0x41
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBREMOUNT1=0x7
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBREMOUNT1RET=0x8
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBREMOUNT2=0x86
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBREMOUNT2RET=0x87
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBRENAMEL=0x28
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBRENAMELRET=0x2b
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBRENAMELYS_ENEWNAME=0x2a
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBRENAMELYS_EOLDNAME=0x29
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBREPLACEL=0x2c
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBREPLACELRET=0x2f
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBREPLACEL_ENEWNAME=0x2e
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBREPLACEL_EOLDNAME=0x2d
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBRMDIRL=0x22
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBRMDIRLRET=0x24
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBRMDIRLYS_EDIRNAME=0x23
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBSCANDRIVE1=0x47
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBSCANDRIVE1RET=0x48
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBSCANDRIVE2=0x49
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBSCANDRIVE2RET=0x4a
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBSETENTRYL=0x33
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBSETENTRYLRET=0x35
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBSETENTRYL_EFILEPATH=0x34
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBSETVOLUMEL=0x1c
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBSETVOLUMELRET=0x1e
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBUNLOCK=0x5e
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBUNLOCKRET=0x5f
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBVOLUMEL=0x19
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBVOLUMELRETA=0x1a
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBVOLUMELRETB=0x1b
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBVOLUMESIZE=0xf
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_ECMOUNTCBVOLUMESIZERET=0x10
-[TRACE]TRACE_FILESYSTEM[0x40]_FSYS_EVOLUMENAME=0x1d
--- a/userlibandfileserver/fileserver/sfsrv/cl_cli.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfsrv/cl_cli.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -17,9 +17,13 @@
 
 #include "cl_std.h"
 #include <f32fsys.h>
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "cl_cliTraces.h"
-#endif
+
+
+
+
+
+
+
 EFSRV_EXPORT_C TBool RFs::IsValidDrive(TInt aDrive)
 /**
 Tests whether the specified drive number is valid.
@@ -93,7 +97,7 @@
 
 	if (aDrive==KDefaultDrive)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_EFSDRIVETOCHAR, "aDrive %d", aDrive);
+		TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsDriveToChar, MODULEUID, aDrive);
 		RFs fs;
 		TFileName path;
 		TInt r=fs.Connect();
@@ -104,7 +108,7 @@
 		if (r!=KErrNone)
 			return(r);
 		aChar=path[0];
-		OstTraceExt2(TRACE_BORDER, EFSRV_EFSDRIVETOCHARRETURN, "r %d aChar %x", (TUint) KErrNone, (TUint) aChar);
+		TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsDriveToCharReturn, MODULEUID, KErrNone, aChar);
 		return(KErrNone);
 		}
 	if (!IsValidDrive(aDrive))
@@ -125,12 +129,14 @@
 @return True, if the address is in ROM; false, if not.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSISROMADDRESS, "aPtr %x", aPtr);
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsIsRomAddress, MODULEUID, aPtr);
+
 	TBool res;
 	TInt r=User::IsRomAddress(res,aPtr); // Only returns error on WINS
 	if (r!=KErrNone)
 		res=EFalse;
-	OstTrace1(TRACE_BORDER, EFSRV_EFSISROMADDRESSRETURN, "r %d", res);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsIsRomAddressReturn, MODULEUID, res);
 	return(res);
 	}
 
@@ -160,18 +166,19 @@
  */
 EFSRV_EXPORT_C TDriveNumber RFs::GetSystemDrive()
     {
-	OstTrace0(TRACE_BORDER, EFSRV_EFSGETSYSTEMDRIVE, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsGetSystemDrive, MODULEUID);
     TInt drive;
 	TInt err = RProperty::Get(TSecureId(KFileServerUidValue), KSystemDriveKey, drive);
     if(err==KErrNone)
         {
         if((drive>=EDriveA) && (drive<=EDriveZ))
             {
-			OstTrace1(TRACE_BORDER, EFSRV_EFSGETSYSTEMDRIVERETURN1, "r %d", drive);
+			TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsGetSystemDriveReturn, MODULEUID, drive);
             return static_cast<TDriveNumber>(drive);
             }
         }
-	OstTrace1(TRACE_BORDER, EFSRV_EFSGETSYSTEMDRIVERETURN2, "r %d", EDriveC);
+
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsGetSystemDriveReturn, MODULEUID, EDriveC);
     return EDriveC;
 	}
     
@@ -186,9 +193,11 @@
 */
 EFSRV_EXPORT_C TChar RFs::GetSystemDriveChar()
 	{
-	OstTrace0(TRACE_BORDER, EFSRV_EFSGETSYSTEMDRIVECHAR, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsGetSystemDriveChar, MODULEUID);
+
 	TInt r = 'A' + GetSystemDrive();
-	OstTrace1(TRACE_BORDER, EFSRV_EFSGETSYSTEMDRIVECHARRETURN, "RFs::GetSystemDriveChar() r %x", (char) r);
+
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsGetSystemDriveCharReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -208,9 +217,10 @@
 */
 EFSRV_EXPORT_C TInt RFs::SetSystemDrive(TDriveNumber aSystemDrive)
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSETSYSTEMDRIVE, "sess %x aSystemDrive %d", (TUint) Handle(), (TUint) aSystemDrive);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsSetSystemDrive, MODULEUID, Handle(), aSystemDrive);
     TInt r = SendReceive(EFsSetSystemDrive, TIpcArgs(aSystemDrive));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSSETSYSTEMDRIVERETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetSystemDriveReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -237,10 +247,11 @@
         error codes.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSCONNECT, "aMessageSlots %d", aMessageSlots);
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsConnect, MODULEUID, aMessageSlots);
 	_LIT(KFileServerName,"!FileServer");
 	TInt r = CreateSession(KFileServerName,Version(),aMessageSlots);
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSCONNECTRETURN, "r %d sess %x", (TUint) r, (TUint) Handle());
+
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFsConnectReturn, MODULEUID, r, Handle());
 	return r;
 	}
 
@@ -264,9 +275,10 @@
         error codes.
 */
 	{	
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSETSESSIONTOPRIVATE, "sess %x  aDrive %d", (TUint) Handle(), (TUint) aDrive);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsSetSessionToPrivate, MODULEUID, Handle(), aDrive);
 	TInt r = SendReceive(EFsSessionToPrivate,TIpcArgs(aDrive));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSSETSESSIONTOPRIVATERETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetSessionToPrivateReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -282,10 +294,10 @@
 @param aPath On successful return, contains the private path for a process.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSPRIVATEPATH, "sess %x", Handle());
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsPrivatePath, MODULEUID, Handle());
 	TInt r = SendReceive(EFsPrivatePath,TIpcArgs(&aPath));
-	OstTraceData(TRACE_BORDER, EFSRV_EFSPRIVATEPATH_EDIRNAME, "Dir %S", aPath.Ptr(), aPath.Length()<<1);
-	OstTrace1(TRACE_BORDER, EFSRV_EFSPRIVATEPATHRETURN, "r %d", r);
+
+	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsPrivatePathReturn, MODULEUID, r, aPath);
 	return r;
 	}
 
@@ -306,9 +318,10 @@
         error codes.
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSCREATEPRIVATEPATH, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsCreatePrivatePath, MODULEUID, Handle(), aDrive);
 	TInt r = SendReceive(EFsCreatePrivatePath,TIpcArgs(aDrive));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSCREATEPRIVATEPATHRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsCreatePrivatePathReturn, MODULEUID, r);
 	return r;
 	}	
 
@@ -322,9 +335,11 @@
 @return The client side version number.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSVERSION, "sess %x", Handle());
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsVersion, MODULEUID, Handle());
+
 	TVersion r = TVersion(KF32MajorVersionNumber,KF32MinorVersionNumber,KF32BuildVersionNumber);
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSVERSIONRETURN, "iMajor %d iMinor %d iBuild %d", (TUint) r.iMajor, (TUint) r.iMinor, (TUint) r.iBuild);
+
+	TRACERET3(UTF::EBorder, UTraceModuleEfsrv::EFsVersionReturn, MODULEUID, r.iMajor, r.iMinor, r.iBuild);
 	return r;
 	}
 
@@ -349,8 +364,7 @@
 @see RFs::MountFileSystem        
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSADDFILESYSTEM, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSADDFILESYSTEM_EFILENAME, "FileName %S", aFileName.Ptr(), aFileName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsAddFileSystem, MODULEUID, Handle(), aFileName);
 	RLoader loader;
 	TInt r = loader.Connect();
 	if (r==KErrNone)
@@ -358,7 +372,8 @@
 		r = loader.SendReceive(ELoadFileSystem, TIpcArgs(0, &aFileName, 0));
 		loader.Close();
 		}
-	OstTrace1(TRACE_BORDER, EFSRV_EFSADDFILESYSTEMRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsAddFileSystemReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -380,10 +395,10 @@
 
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSREMOVEFILESYSTEM, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSREMOVEFILESYSTEM_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsRemoveFileSystem, MODULEUID, Handle(), aFileSystemName);
 	TInt r = SendReceive(EFsRemoveFileSystem,TIpcArgs(&aFileSystemName));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSREMOVEFILESYSTEMRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsRemoveFileSystemReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -408,10 +423,10 @@
 @see RFs::FileSystemName
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM1, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM1_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystem1, MODULEUID, Handle(), aFileSystemName, aDrive);
 	TInt r = SendReceive(EFsMountFileSystem,TIpcArgs(&aFileSystemName,aDrive,NULL,EFalse));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM1RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystem1Return, MODULEUID, r);
 	return r;
 	}
 
@@ -439,14 +454,16 @@
 
 @return KErrNone if successful, otherwise one of the other system-wide error codes.
 @capability DiskAdmin
+
 @see RFs::AddFileSystem
 @see RFs::FileSystemName
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM2, "sess %x aDrive %d aIsSync %d", (TUint) Handle(), (TUint) aDrive, (TUint) aIsSync);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM2_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
+	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystem2, MODULEUID, Handle(), aFileSystemName, aDrive, aIsSync);
+
 	TInt r = SendReceive(EFsMountFileSystem,TIpcArgs(&aFileSystemName,aDrive,NULL,aIsSync));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM2RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystem2Return, MODULEUID, r);
 	return r;
 	}
 
@@ -472,11 +489,11 @@
 @see RFs::FileSystemName
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM3, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM3_EEXTENSIONNAME, "ExtensionName %S", aExtensionName.Ptr(), aExtensionName.Length()<<1);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM3_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
+	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystem3, MODULEUID, Handle(), aFileSystemName, aExtensionName, aDrive);
+
 	TInt r = SendReceive(EFsMountFileSystem,TIpcArgs(&aFileSystemName,aDrive,&aExtensionName,EFalse));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM3RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystem3Return, MODULEUID, r);
 	return r;
 	}
 
@@ -511,11 +528,10 @@
 @see RFs::FileSystemName
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM4, "sess %x aDrive %d aIsSync %d", (TUint) Handle(), (TUint) aDrive, (TUint) aIsSync);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM4_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM4_EEXTENSIONNAME, "ExtensionName %S", aExtensionName.Ptr(), aExtensionName.Length()<<1);
+	TRACEMULT5(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystem4, MODULEUID, Handle(), aFileSystemName, aExtensionName, aDrive, aIsSync);
 	TInt r = SendReceive(EFsMountFileSystem,TIpcArgs(&aFileSystemName,aDrive,&aExtensionName,aIsSync));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM4RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystem4Return, MODULEUID, r);
 	return r;
 	}
 
@@ -544,12 +560,12 @@
 @see RFs::FileSystemName
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN1, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN1_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystemAndScan1, MODULEUID, Handle(), aFileSystemName, aDrive);
 	aIsMountSuccess=EFalse;
 	TPckg<TInt> pckg(aIsMountSuccess);
 	TInt r = SendReceive(EFsMountFileSystemScan,TIpcArgs(&aFileSystemName,aDrive,NULL,&pckg));
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN1RETURN, "r %d aIsMountSuccess %d", (TUint) r, (TUint) aIsMountSuccess);
+
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystemAndScan1Return, MODULEUID, r, aIsMountSuccess);
 	return r;
 	}
 
@@ -582,13 +598,14 @@
 @see RFs::FileSystemName
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN2, "sess %x aDrive %d aIsMountSuccess %d", (TUint) Handle(), (TUint) aDrive, (TUint) aIsMountSuccess);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN2_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN2_EEXTENSIONNAME, "ExtensionName %S", aExtensionName.Ptr(), aExtensionName.Length()<<1);
+	TRACEMULT5(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystemAndScan2, MODULEUID, 
+		Handle(), aFileSystemName, aExtensionName, aDrive, aIsMountSuccess);
+
 	aIsMountSuccess=EFalse;
 	TPckg<TInt> pckg(aIsMountSuccess);
 	TInt r = SendReceive(EFsMountFileSystemScan,TIpcArgs(&aFileSystemName,aDrive,&aExtensionName,&pckg));
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN2RETURN, "r %d aIsMountSuccess %d", (TUint) r, (TUint) aIsMountSuccess);
+
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystemAndScan2Return, MODULEUID, r, aIsMountSuccess);
 	return r;
 	}
 
@@ -615,10 +632,10 @@
 @see RFs::FileSystemName 		
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSDISMOUNTFILESYSTEM, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSDISMOUNTFILESYSTEM_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsDismountFileSystem, MODULEUID, Handle(), aFileSystemName, aDrive);
 	TInt r = SendReceive(EFsDismountFileSystem,TIpcArgs(&aFileSystemName,aDrive));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSDISMOUNTFILESYSTEMRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsDismountFileSystemReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -644,11 +661,12 @@
 */
 EFSRV_EXPORT_C TInt RFs::FileSystemName(TDes& aName,TInt aDrive) const
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSFILESYSTEMNAME, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsFileSystemName, MODULEUID, Handle(), aDrive);
+
 	//-- ipc argument "-1" here is to indicate legacy FileSystemName() API
     TInt r = SendReceive(EFsFileSystemName,TIpcArgs(&aName, aDrive, -1)); 
-	OstTraceData(TRACE_BORDER, EFSRV_EFSFILESYSTEMNAME_EFILESYSTEMNAME, "FileSystemName %S", aName.Ptr(), aName.Length()<<1);
-	OstTrace1(TRACE_BORDER, EFSRV_EFSFILESYSTEMNAMERETURN, "r %d", r);
+
+	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsFileSystemNameReturn, MODULEUID, r, aName);
 	return r;
 	}
 
@@ -683,11 +701,12 @@
     {
 	if(aFsEnumerator < 0)
         return KErrArgument; //-- see RFs::FileSystemName(). "-1" is a reserved value
-    OstTraceExt2(TRACE_BORDER, EFSRV_EFSSUPPORTEDFILESYSTEMNAME, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
+
+    TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsFileSystemName, MODULEUID, Handle(), aDrive);
     
     TInt r = SendReceive(EFsFileSystemName,TIpcArgs(&aName, aDrive, aFsEnumerator));
-	OstTraceData(TRACE_BORDER, EFSRV_EFSFILESYSTEMNAME_ESUPPORTEDFILESYSTEMNAME, "SupportedFileSystemName %S", aName.Ptr(), aName.Length()<<1);
-	OstTrace1(TRACE_BORDER, EFSRV_EFSSUPPORTEDFILESYSTEMNAMERETURN, "r %d", r);
+
+	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsFileSystemNameReturn, MODULEUID, r, aName);
 	return r;
     }
 
@@ -704,8 +723,7 @@
 @return KErrNone, if successful; otherwise one of the other system wide error codes.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSADDEXTENSION, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSADDEXTENSION_EEXTENSIONNAME, "ExtensionName %S", aFileName.Ptr(), aFileName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsAddExtension, MODULEUID, Handle(), aFileName);
 	RLoader loader;
 	TInt r = loader.Connect();
 	if (r==KErrNone)
@@ -713,7 +731,8 @@
 		r = loader.SendReceive(ELoadFSExtension, TIpcArgs(0, &aFileName, 0));
 		loader.Close();
 		}
-	OstTrace1(TRACE_BORDER, EFSRV_EFSADDEXTENSIONRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsAddExtensionReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -737,10 +756,10 @@
 @see RFs::ExtensionName
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTEXTENSION, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTEXTENSION_EEXTENSIONNAME, "ExtensionName %S", aExtensionName.Ptr(), aExtensionName.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsMountExtension, MODULEUID, Handle(), aExtensionName, aDrive);
 	TInt r = SendReceive(EFsMountExtension,TIpcArgs(&aExtensionName,aDrive));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSMOUNTEXTENSIONRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMountExtensionReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -761,10 +780,10 @@
 */
 EFSRV_EXPORT_C TInt RFs::DismountExtension(const TDesC& aExtensionName,TInt aDrive)
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSDISMOUNTEXTENSION, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSDISMOUNTEXTENSION_EEXTENSIONNAME, "ExtensionName %S", aExtensionName.Ptr(), aExtensionName.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsDismountExtension, MODULEUID, Handle(), aExtensionName, aDrive);
 	TInt r = SendReceive(EFsDismountExtension,TIpcArgs(&aExtensionName,aDrive));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSDISMOUNTEXTENSIONRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsDismountExtensionReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -781,10 +800,10 @@
         otrherwise one of the other system-wide error codes.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSREMOVEEXTENSION, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSREMOVEEXTENSION_EEXTENSIONNAME, "ExtensionName %S", aExtensionName.Ptr(), aExtensionName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsRemoveExtension, MODULEUID, Handle(), aExtensionName);
 	TInt r = SendReceive(EFsRemoveExtension,TIpcArgs(&aExtensionName));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSREMOVEEXTENSIONRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsRemoveExtensionReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -804,10 +823,10 @@
         KErrNotFound if the extension name is not found;
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSEXTENSIONNAME, "sess %x aDrive %d aPos %x", (TUint) Handle(), (TUint) aDrive, (TUint) aPos);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSEXTENSIONNAME_EEXTENSIONNAME, "ExtensionName %S", aExtensionName.Ptr(), aExtensionName.Length()<<1);
+	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsExtensionName, MODULEUID, Handle(), aExtensionName, aDrive, aPos);
 	TInt r = SendReceive(EFsExtensionName,TIpcArgs(&aExtensionName,aDrive,aPos));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSEXTENSIONNAMERETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsExtensionNameReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -831,9 +850,10 @@
         the other system wide error codes.
 */
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFSREMOUNTDRIVE, "sess %x aDrive %d aMountInfo %x aFlags %x", (TUint) Handle(), aDrive, (TUint) aMountInfo, (TUint) aFlags);
+	TRACE4(UTF::EBorder, UTraceModuleEfsrv::EFsRemountDrive, MODULEUID, Handle(), aDrive, aMountInfo, aFlags);
 	TInt r = SendReceive(EFsRemountDrive,TIpcArgs(aDrive,aMountInfo,aFlags));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSREMOUNTDRIVERETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsRemountDriveReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -879,7 +899,7 @@
 
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSNOTIFYCHANGE1, "sess %x aType %x status %x", (TUint) Handle(), (TUint) aType, (TUint) &aStat);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyChange1, MODULEUID, Handle(), aType, &aStat);
 	aStat=KRequestPending;
 	// for backward compatibility
 	TNotifyType type = (aType == 0 ? ENotifyEntry : aType);
@@ -887,7 +907,7 @@
 	//This call is to synchronise with the file server when this functions stack varibles can go out of scope
 	SendReceive(EFsSynchroniseDriveThread, TIpcArgs(-1));		
 
-	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYCHANGE1RETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyChange1Return, MODULEUID);
 	}
 
 
@@ -946,8 +966,7 @@
 
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSNOTIFYCHANGE2, "sess %x aType %x status %x", (TUint) Handle(), (TUint) aType, (TUint) &aStat);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSNOTIFYCHANGE2_EDIRNAME, "Dir %S", aPathName.Ptr(), aPathName.Length()<<1);
+	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyChange2, MODULEUID, Handle(), (TUint) aType, (TUint) &aStat, aPathName);
 	aStat=KRequestPending;
 	// for backward compatibility
 	TNotifyType type = (aType == 0 ? ENotifyEntry : aType);
@@ -955,7 +974,7 @@
 	//This call is to synchronise with the file server when this functions stack varibles can go out of scope
 	SendReceive(EFsSynchroniseDriveThread, TIpcArgs(-1));
 
-	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYCHANGE2RETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyChange2Return, MODULEUID);
 	}
 
 
@@ -972,10 +991,10 @@
 
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSNOTIFYCHANGECANCEL1, "sess %x", Handle());
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyChangeCancel1, MODULEUID, Handle());
 	RSessionBase::SendReceive(EFsNotifyChangeCancel);
 
-	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYCHANGECANCEL1RETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyChangeCancel1Return, MODULEUID);
 	}
 
 
@@ -996,11 +1015,11 @@
 
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSNOTIFYCHANGECANCEL2, "sess %x status %x", (TUint) Handle(), (TUint) &aStat);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyChangeCancel2, MODULEUID, Handle(), &aStat);
 	if (aStat==KRequestPending)			//	May be better to ASSERT this?
 		SendReceive(EFsNotifyChangeCancelEx,TIpcArgs(&aStat));
 
-	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYCHANGECANCEL2RETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyChangeCancel2Return, MODULEUID);
 	}
 
 
@@ -1051,8 +1070,8 @@
 @see TDriveNumber
 */
 	{
-	OstTraceExt5(TRACE_BORDER, EFSRV_EFSNOTIFYDISKSPACE, "sess %x aThreshold %x:%x aDrive %d status %x", (TUint) Handle(), (TUint) I64HIGH(aThreshold), (TUint) I64LOW(aThreshold), (TUint) aDrive, (TUint) &aStat);
-		
+	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDiskSpace, MODULEUID, 
+		Handle(), I64LOW(aThreshold),I64HIGH(aThreshold), aDrive,(TUint) &aStat);
 	aStat=KRequestPending;
 	TPtrC8 tBuf((TUint8*)&aThreshold,sizeof(TInt64));
 	RSessionBase::SendReceive(EFsNotifyDiskSpace,TIpcArgs(&tBuf,aDrive,&aStat), aStat);
@@ -1062,7 +1081,7 @@
 	SendReceive(EFsSynchroniseDriveThread, TIpcArgs(aDrive));
 
 
-	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYDISKSPACERETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDiskSpaceReturn, MODULEUID);
 	}
 
 
@@ -1079,12 +1098,12 @@
 			 notification request.
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSNOTIFYDISKSPACECANCEL1, "sess %x status %x", (TUint) Handle(), (TUint) &aStat);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDiskSpaceCancel1, MODULEUID, Handle(), &aStat);
 	
 	if(aStat==KRequestPending)
 		SendReceive(EFsNotifyDiskSpaceCancel,TIpcArgs(&aStat));
 
-	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYDISKSPACECANCEL1RETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDiskSpaceCancel1Return, MODULEUID);
 	}
 
 
@@ -1098,10 +1117,10 @@
 Outstanding requests complete with KErrCancel.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSNOTIFYDISKSPACECANCEL2, "sess %x", Handle());
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDiskSpaceCancel2, MODULEUID, Handle());
 	SendReceive(EFsNotifyDiskSpaceCancel,TIpcArgs(NULL));
 
-	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYDISKSPACECANCEL2RETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDiskSpaceCancel2Return, MODULEUID);
 	}
 
 
@@ -1127,9 +1146,10 @@
 @return KErrNone, successful, otherwise one of the other system-wide error codes.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSDRIVELIST1, "sess %x", Handle());
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsDriveList1, MODULEUID, Handle());
 	TInt r = SendReceive(EFsDriveList,TIpcArgs(&aList, KDriveAttExclude|KDriveAttRemote|KDriveAttHidden));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSDRIVELIST1RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsDriveList1Return, MODULEUID, r);
 	return r;
 	}
 
@@ -1160,9 +1180,10 @@
 		KErrArgument, If aFlags contains an invalid attribute combination.
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSDRIVELIST2, "sess %x aFlags %x", (TUint) Handle(), (TUint) aFlags);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsDriveList2, MODULEUID, Handle(), aFlags);
 	TInt r = SendReceive(EFsDriveList,TIpcArgs(&aList,aFlags));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSDRIVELIST2RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsDriveList2Return, MODULEUID, r);
 	return r;
 	}
 
@@ -1192,10 +1213,12 @@
 @see RFs::Volume
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSDRIVE, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsDrive, MODULEUID, Handle(), aDrive);
+
 	TPckg<TDriveInfo> m(anInfo);
 	TInt r = SendReceive(EFsDrive,TIpcArgs(&m,aDrive));
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFSDRIVERETURN, "r %d driveAtt %x mediaAtt %x type %x", r, (TUint) anInfo.iDriveAtt, (TUint) anInfo.iMediaAtt, (TUint) anInfo.iType);
+
+	TRACERET4(UTF::EBorder, UTraceModuleEfsrv::EFsDriveReturn, MODULEUID, r, anInfo.iDriveAtt, anInfo.iMediaAtt, anInfo.iType);
 	return r;
 	}
 
@@ -1227,11 +1250,13 @@
 @see RFs::Drive
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSVOLUME1, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsVolume1, MODULEUID, Handle(), aDrive);
 	TPckg<TVolumeInfo> v(aVol);
     TInt r = SendReceive(EFsVolume,TIpcArgs(&v,aDrive,NULL));
-	OstTraceExt5(TRACE_BORDER, EFSRV_EFSVOLUME1RETURNA, "r %d iSize %x:%x iFree %x:%x", (TUint) r, (TUint) I64HIGH(aVol.iSize), (TUint) I64LOW(aVol.iSize), (TUint) I64HIGH(aVol.iFree), (TUint) I64LOW(aVol.iFree));
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSVOLUME1RETURNB, "iUniqueID %x iFileCacheFlags %x", (TUint) aVol.iUniqueID, (TUint) aVol.iFileCacheFlags);
+
+	TRACE7(UTF::EBorder, UTraceModuleEfsrv::EFsVolume1Return, MODULEUID, 
+		r, aVol.iUniqueID, I64LOW(aVol.iSize), I64HIGH(aVol.iSize),
+		I64LOW(aVol.iFree), I64HIGH(aVol.iFree), aVol.iFileCacheFlags);
 	return r;
 	}
 
@@ -1254,12 +1279,12 @@
 */
 EFSRV_EXPORT_C void RFs::Volume(TVolumeInfo& aVol,TInt aDrive, TRequestStatus& aStat) const
     {
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSVOLUME2, "sess %x aDrive %d status %x", (TUint) Handle(), (TUint) aDrive, (TUint) &aStat);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFsVolume2, MODULEUID, Handle(), aDrive, &aStat);
 	TPckg<TVolumeInfo> v(aVol);
     aStat=KRequestPending;
     RSessionBase::SendReceive(EFsVolume,TIpcArgs(&v,aDrive,&aStat), aStat);
 
-	OstTrace0(TRACE_BORDER, EFSRV_EFSVOLUME2RETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsVolume2Return, MODULEUID);
     }
 
 
@@ -1289,11 +1314,12 @@
 @see RFs::Volume
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSETVOLUMELABEL, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
-		
-	OstTraceData(TRACE_BORDER, EFSRV_EFSSETVOLUMELABEL_EVOLUMENAME, "VolumeName %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsSetVolumeLabel, MODULEUID, 
+		Handle(), aName, aDrive);
+
 	TInt r = SendReceive(EFsSetVolume,TIpcArgs(&aName,aDrive));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSSETVOLUMELABELRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetVolumeLabelReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -1324,10 +1350,10 @@
 @see RFs::Drive
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSUBST, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSSUBST_EDIRNAME, "Dir %S", aPath.Ptr(), aPath.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsSubst, MODULEUID, Handle(), aPath, aDrive);
 	TInt r = SendReceive(EFsSubst,TIpcArgs(&aPath,aDrive));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSSUBSTRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSubstReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -1376,10 +1402,10 @@
 @capability Dependent If aPath is /Resource then Tcb capability is required.
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSETSUBST, "sess %x aPath %d", (TUint) Handle(), (TUint) aDrive);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSSETSUBST_EDIRNAME, "Dir %S", aPath.Ptr(), aPath.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsSetSubst, MODULEUID, Handle(), aPath, aDrive);
 	TInt r = SendReceive(EFsSetSubst,TIpcArgs(&aPath,aDrive));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSSETSUBSTRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetSubstReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -1407,11 +1433,10 @@
 
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSREALNAME, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSREALNAME_EFILENAME1, "FileName %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsRealName, MODULEUID, Handle(), aName);
 	TInt r = SendReceive(EFsRealName,TIpcArgs(&aName,&aResult));
-	OstTraceData(TRACE_BORDER, EFSRV_EFSREALNAME_EFILENAME2, "FileName %S", aResult.Ptr(), aResult.Length()<<1);
-	OstTrace1(TRACE_BORDER, EFSRV_EFSREALNAMERETURN, "r %d", r);
+
+	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsRealNameReturn, MODULEUID, r, aResult);
 	return r;
 	}
 
@@ -1435,10 +1460,10 @@
 */
 EFSRV_EXPORT_C TInt RFs::GetMediaSerialNumber(TMediaSerialNumber& aSerialNum, TInt aDrive)
     {
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSGETMEDIASERIALNUMBER, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsGetMediaSerialNumber, MODULEUID, Handle(), aDrive);
     TInt r = SendReceive(EFsGetMediaSerialNumber, TIpcArgs(&aSerialNum, aDrive));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSGETMEDIASERIALNUMBERRETURN, "r %d", r);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSGETMEDIASERIALNUMBER_ESERIALNUMBER, "SerialNum %x", aSerialNum.Ptr(), aSerialNum.Length());
+
+	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsGetMediaSerialNumberReturn, MODULEUID, r, aSerialNum);
 	return r;
     }
 
@@ -1460,10 +1485,10 @@
         system-wide error codes.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSSESSIONPATH, "sess %x", Handle());
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsSessionPath, MODULEUID, Handle());
 	TInt r = SendReceive(EFsSessionPath,TIpcArgs(&aPath));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSSESSIONPATHRETURN, "r %d", r);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSSESSIONPATH_EDIRNAME, "Dir %S", aPath.Ptr(), aPath.Length()<<1);
+
+	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsSessionPathReturn, MODULEUID, r, aPath);
 	return r;
 	}
 
@@ -1501,10 +1526,10 @@
 
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSSETSESSIONPATH, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSSETSESSIONPATH_EDIRNAME, "Dir %S", aPath.Ptr(), aPath.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsSetSessionPath, MODULEUID, Handle(), aPath);
 	TInt r = SendReceive(EFsSetSessionPath,TIpcArgs(&aPath));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSSETSESSIONPATHRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetSessionPathReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -1578,10 +1603,10 @@
 */
 EFSRV_EXPORT_C TInt RFs::MkDir(const TDesC& aPath)
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSMKDIR, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSMKDIR_EDIRNAME, "Dir %S", aPath.Ptr(), aPath.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsMkDir, MODULEUID, Handle(), aPath);
 	TInt r = SendReceive(EFsMkDir,TIpcArgs(&aPath,NULL));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSMKDIRRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMkDirReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -1628,10 +1653,10 @@
 */
 EFSRV_EXPORT_C TInt RFs::MkDirAll(const TDesC& aPath)
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSMKDIRALL, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSMKDIRALL_EDIRNAME, "Dir %S", aPath.Ptr(), aPath.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsMkDirAll, MODULEUID, Handle(), aPath);
 	TInt r = SendReceive(EFsMkDir,TIpcArgs(&aPath,TRUE));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSMKDIRALLRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMkDirAllReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -1682,10 +1707,10 @@
 @see CFileMan
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSRMDIR, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSRMDIR_EDIRNAME, "Dir %S", aPath.Ptr(), aPath.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsRmDir, MODULEUID, Handle(), aPath);
 	TInt r = SendReceive(EFsRmDir,TIpcArgs(&aPath));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSRMDIRRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsRmDirReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -1800,8 +1825,9 @@
 @see TEntryKey
 */
 	{
-	OstTraceExt5(TRACE_BORDER, EFSRV_EFSGETDIR1, "sess %x aUidType0 %x aUidType1 %x aUidType2 %x aKey %x", (TUint) Handle(), (TUint) aUidType[0].iUid, (TUint) aUidType[1].iUid, (TUint) aUidType[2].iUid, (TUint) aKey);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSGETDIR1_EDIRNAME, "Dir %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT6(UTF::EBorder, UTraceModuleEfsrv::EFsGetDir1, MODULEUID, 
+		Handle(), aName, aUidType[0].iUid, aUidType[1].iUid, aUidType[2].iUid, aKey);
+
 	RDir d;
 	TRAPD(r,GetDirL(aName,aUidType,aKey,aFileList,d))
 	d.Close();
@@ -1810,7 +1836,8 @@
 		delete aFileList;
 		aFileList=NULL;
 		}
-	OstTrace1(TRACE_BORDER, EFSRV_EFSGETDIR1RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsGetDir1Return, MODULEUID, r);
 	return r;
 	}
 
@@ -1856,8 +1883,8 @@
 @see TEntryKey
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSGETDIR2, "sess %x anAttMask %x aKey %x", (TUint) Handle(), (TUint) anAttMask, (TUint) aKey);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSGETDIR2_EDIRNAME, "Dir %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsGetDir2, MODULEUID, Handle(), aName, anAttMask, aKey);
+
 	RDir d;
 	if ((aKey&0xff)==ESortByUid)
 		anAttMask|=KEntryAttAllowUid;
@@ -1868,7 +1895,8 @@
 		delete aFileList;
 		aFileList=NULL;
 		}
-	OstTrace1(TRACE_BORDER, EFSRV_EFSGETDIR2RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsGetDir2Return, MODULEUID, r);
 	return r;
 	}
 
@@ -1921,8 +1949,8 @@
 @see TEntryKey
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSGETDIR3, "sess %x anAttMask %x aKey %x", (TUint) Handle(), (TUint) anAttMask, (TUint) aKey);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSGETDIR3_EDIRNAME, "Dir %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsGetDir3, MODULEUID, Handle(), aName, anAttMask, aKey);
+
 	RDir d;
 	if (aKey&ESortByUid)
 		anAttMask|=KEntryAttAllowUid;
@@ -1935,7 +1963,8 @@
 		delete aDirList;
 		aDirList=NULL;
 		}
-	OstTrace1(TRACE_BORDER, EFSRV_EFSGETDIR3RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsGetDir3Return, MODULEUID, r);
 	return r;
 	}
 
@@ -1982,13 +2011,13 @@
         system-wide error codes.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSPARSE1, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSPARSE1_EFILEPATH, "FilePath %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsParse1, MODULEUID, Handle(), aName);
 	TFileName session_path;
 	TInt r = SessionPath(session_path);
 	if (r==KErrNone)
 		r = aParse.Set(aName, NULL, &session_path);
-	OstTrace1(TRACE_BORDER, EFSRV_EFSPARSE1RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsParse1Return, MODULEUID, r);
 	return r;
 	}
 
@@ -2037,14 +2066,13 @@
         system-wide error codes.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSPARSE2, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSPARSE2_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSPARSE2_ERELATED, "Related %S", aRelated.Ptr(), aRelated.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsParse2, MODULEUID, Handle(), aName, aRelated);
 	TFileName session_path;
 	TInt r = SessionPath(session_path);
 	if (r==KErrNone)
 		r = aParse.Set(aName, &aRelated, &session_path);
-	OstTrace1(TRACE_BORDER, EFSRV_EFSPARSE2RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsParse2Return, MODULEUID, r);
 	return r;
 	}
 
@@ -2077,10 +2105,10 @@
 @see CFileMan        
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSDELETE, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSDELETE_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsDelete, MODULEUID, Handle(), aName);
 	TInt r = SendReceive(EFsDelete,TIpcArgs(&aName));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSDELETERETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsDeleteReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -2139,15 +2167,15 @@
 @see CFileMan        
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSRENAME, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSRENAME_EOLDNAME, "OldName %S", anOldName.Ptr(), anOldName.Length()<<1);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSRENAME_ENEWNAME, "NewName %S", aNewName.Ptr(), aNewName.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsRename, MODULEUID, Handle(), anOldName, aNewName);
+
 	TInt r;
 	if (anOldName.Length() <= 0 || aNewName.Length() <= 0 )
 		r = KErrBadName;
 	else
 		r = SendReceive(EFsRename,TIpcArgs(&anOldName,&aNewName));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSRENAMERETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsRenameReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -2198,11 +2226,10 @@
 
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSREPLACE, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSREPLACE_EOLDNAME, "OldName %S", anOldName.Ptr(), anOldName.Length()<<1);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSREPLACE_ENEWNAME, "NewName %S", aNewName.Ptr(), aNewName.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsReplace, MODULEUID, Handle(), anOldName, aNewName);
 	TInt r = SendReceive(EFsReplace,TIpcArgs(&anOldName,&aNewName));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSREPLACERETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsReplaceReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -2229,13 +2256,14 @@
 @see KEntryAttNormal
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSATT, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSATT_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsAtt, MODULEUID, Handle(), aName);
+
 	TEntry e;
 	TInt r=Entry(aName,e);
 	if (r==KErrNone)
 		aVal=e.iAtt;
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSATTRETURN, "r %d aVal %x", (TUint) r, (TUint) aVal);
+
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFsAttReturn, MODULEUID, r, aVal);
 	return r;
 	}
 
@@ -2275,10 +2303,12 @@
 
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSSETATT, "sess %x aSetAttMask %x aClearAttMask %x", (TUint) Handle(), (TUint) aSetAttMask, (TUint) aClearAttMask);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSSETATT_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsSetAtt, MODULEUID, 
+		Handle(), aName, aSetAttMask, aClearAttMask);
+
  	TInt r = SetEntry(aName,TTime(0),aSetAttMask,aClearAttMask);
-	OstTrace1(TRACE_BORDER, EFSRV_EFSSETATTRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetAttReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -2306,13 +2336,14 @@
 
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSMODIFIED, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSMODIFIED_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsModified, MODULEUID, Handle(), aName);
+
 	TEntry e;
 	TInt r=Entry(aName,e);
 	if (r==KErrNone)
 		aTime=e.iModified;
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSMODIFIEDRETURN, "r %d aTime %x:%x ", (TUint) r, (TUint) I64HIGH(aTime.Int64()), (TUint) I64LOW(aTime.Int64()));
+
+	TRACERET3(UTF::EBorder, UTraceModuleEfsrv::EFsModifiedReturn, MODULEUID, r, I64LOW(aTime.Int64()), I64HIGH(aTime.Int64()));
 	return r;
 	}
 
@@ -2339,10 +2370,11 @@
 
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSSETMODIFIED, "sess %x aTime %x:%x ", (TUint) Handle(), (TUint) I64HIGH(aTime.Int64()), (TUint) I64LOW(aTime.Int64()) );
-	OstTraceData(TRACE_BORDER, EFSRV_EFSSETMODIFIED_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsSetModified, MODULEUID, Handle(), aName, I64LOW(aTime.Int64()), I64HIGH(aTime.Int64()) );
+
 	TInt r = SetEntry(aName,aTime,KEntryAttModified,0);
-	OstTrace1(TRACE_BORDER, EFSRV_EFSSETMODIFIEDRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetModifiedReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -2371,11 +2403,14 @@
 					  readable with AllFiles capability or if <n> matches the process' SID.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSENTRY, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSENTRY_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsEntry, MODULEUID, Handle(), aName);
 	TPckg<TEntry> e(anEntry);
 	TInt r = SendReceive(EFsEntry,TIpcArgs(&aName,&e));
-	OstTraceExt5(TRACE_BORDER, EFSRV_EFSENTRYRETURN, "r %d att %x modified %x:%x  size %d", (TUint) r, (TUint) anEntry.iAtt, (TUint) I64HIGH(anEntry.iModified.Int64()), (TUint) I64LOW(anEntry.iModified.Int64()), (TUint) anEntry.iSize);
+
+	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EFsEntryReturn, MODULEUID, 
+		r, anEntry.iAtt, 
+		I64LOW(anEntry.iModified.Int64()), I64HIGH(anEntry.iModified.Int64()), 
+		anEntry.iSize);
 	return r;
 	}
 
@@ -2415,12 +2450,16 @@
 @see KEntryAttVolume
 */
 	{
-	OstTraceExt5(TRACE_BORDER, EFSRV_EFSSETENTRY, "sess %x aTime %x:%x  aSetAttMask %x aClearAttMask %x", (TUint) Handle(), (TUint) I64HIGH(aTime.Int64()), (TUint) I64LOW(aTime.Int64()), (TUint) aSetAttMask, (TUint) aClearAttMask);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSSETENTRY_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT6(UTF::EBorder, UTraceModuleEfsrv::EFsSetEntry, MODULEUID, 
+		Handle(), aName, 
+		I64LOW(aTime.Int64()), I64HIGH(aTime.Int64()), 
+		aSetAttMask, aClearAttMask);
+
 	__ASSERT_ALWAYS((aSetAttMask&aClearAttMask)==0,Panic(EAttributesIllegal));
 	TPtrC8 timeBuf((TUint8*)&aTime,sizeof(TTime));
 	TInt r = SendReceive(EFsSetEntry,TIpcArgs(&aName,&timeBuf,aSetAttMask,aClearAttMask));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSSETENTRYRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetEntryReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -2457,14 +2496,15 @@
 */
 EFSRV_EXPORT_C TInt RFs::ReadFileSection(const TDesC& aName,TInt64 aPos,TDes8& aDes,TInt aLength) const
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFSREADFILESECTION, "sess %x aPos %x:%x aLength %d", (TUint) Handle(), (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), aLength);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSREADFILESECTION_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT5(UTF::EBorder, UTraceModuleEfsrv::EFsReadFileSection, MODULEUID, 
+		Handle(), aName, I64LOW(aPos), I64HIGH(aPos), aLength);
+
 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
 	
 #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
 	if(aPos > KMaxTInt)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_EFSREADFILESECTIONRETURN1, "r %d", KErrTooBig);
+		TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsReadFileSectionReturn, MODULEUID, KErrTooBig);
 		return KErrTooBig;
 		}
 	if((aPos + aLength) > KMaxTInt)
@@ -2477,7 +2517,7 @@
 	else
 		{
 		aDes.Zero();
-		OstTrace1(TRACE_BORDER, EFSRV_EFSREADFILESECTIONRETURN2, "r %d", KErrNone);
+		TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsReadFileSectionReturn, MODULEUID, KErrNone);
 		return(KErrNone);
 		}
 		
@@ -2493,17 +2533,19 @@
 		TPckgC<TInt64> pkPos(aPos);
 		r = SendReceive(EFsReadFileSection|KIpcArgSlot2Desc,TIpcArgs(&aDes,&aName,&pkPos,aLength));
 		}
-	OstTrace1(TRACE_BORDER, EFSRV_EFSREADFILESECTIONRETURN3, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsReadFileSectionReturn, MODULEUID, r);
 	return r;
 	}
 /**
 Maintained for BC
+
 @internalTechnology
 */
 EFSRV_EXPORT_C TInt RFs::ReadFileSection_RESERVED(const TDesC& aName,TInt aPos,TDes8& aDes,TInt aLength) const
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSREADFILESECTION_RESERVED, "sess %x aPos %x aLength %d", (TUint) Handle(), (TUint) aPos, aLength);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSREADFILESECTION_RESERVED_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT5(UTF::EBorder, UTraceModuleEfsrv::EFsReadFileSection, MODULEUID, 
+		Handle(), aName, aPos, 0, aLength);
+
 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
 	
 	if (aLength)	//	Number of characters to read
@@ -2513,14 +2555,15 @@
 	else
 		{
 		aDes.Zero();
-		OstTrace1(TRACE_BORDER, EFSRV_EFSREADFILESECTION_RESERVED_RETURN1, "r %d", KErrNone);
+		TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsReadFileSectionReturn, MODULEUID, KErrNone);
 		return(KErrNone);
 		}
 		
 	__ASSERT_ALWAYS(aDes.MaxLength()>=aLength,Panic(EBadLength));
 		
 	TInt r = SendReceive(EFsReadFileSection,TIpcArgs(&aDes,&aName,aPos,aLength));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSREADFILESECTION_RESERVED_RETURN2, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsReadFileSectionReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -2535,11 +2578,11 @@
 to the file server, and before any resources are opened.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSRESOURCECOUNTMARKSTART, "sess %x", Handle());
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsResourceCountMarkStart, MODULEUID, Handle());
 	
 	RSessionBase::SendReceive(EFsResourceCountMarkStart);
 
-	OstTrace0(TRACE_BORDER, EFSRV_EFSRESOURCECOUNTMARKSTARTRETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsResourceCountMarkStartReturn, MODULEUID);
 	}
 
 
@@ -2554,10 +2597,11 @@
        count checking is not equal to the number of resources closed.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSRESOURCECOUNTMARKEND, "sess %x", Handle());
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsResourceCountMarkEnd, MODULEUID, Handle());
+
 	RSessionBase::SendReceive(EFsResourceCountMarkEnd);
 
-	OstTrace0(TRACE_BORDER, EFSRV_EFSRESOURCECOUNTMARKENDRETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsResourceCountMarkEndReturn, MODULEUID);
 	}
 
 
@@ -2574,12 +2618,14 @@
 @return The number of resources currently open.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSRESOURCECOUNT, "sess %x", Handle());
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsResourceCount, MODULEUID, Handle());
+
 	TInt count;
 	TPckg<TInt> pckg(count);
 	SendReceive(EFsResourceCount,TIpcArgs(&pckg));
 	TInt r = *(TInt*)pckg.Ptr();
-	OstTrace1(TRACE_BORDER, EFSRV_EFSRESOURCECOUNTRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsResourceCountReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -2618,10 +2664,10 @@
 */
 EFSRV_EXPORT_C TInt RFs::CheckDisk(const TDesC& aDrive) const
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSCHECKDISK, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSCHECKDISK_EDIRNAME, "Dir %S", aDrive.Ptr(), aDrive.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsCheckDisk, MODULEUID, Handle(), aDrive);
 	TInt r = SendReceive(EFsCheckDisk,TIpcArgs(&aDrive));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSCHECKDISKRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsCheckDiskReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -2668,10 +2714,10 @@
 Therefore, do not treat ScanDrive on removable media as a generic "disk repair utility".
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSSCANDRIVE, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSSCANDRIVE_EDIRNAME, "Dir %S", aDrive.Ptr(), aDrive.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsScanDrive, MODULEUID, Handle(), aDrive);
 	TInt r = SendReceive(EFsScanDrive,TIpcArgs(&aDrive));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSSCANDRIVERETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsScanDriveReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -2700,11 +2746,10 @@
 					  have the relevant SID capability AllFiles is required
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSGETSHORTNAME, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSGETSHORTNAME_ELONGNAME, "LongName %S", aLongName.Ptr(), aLongName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsGetShortName, MODULEUID, Handle(), aLongName);
 	TInt r = SendReceive(EFsGetShortName,TIpcArgs(&aLongName,&aShortName));
-	OstTraceData(TRACE_BORDER, EFSRV_EFSGETSHORTNAME_ESHORTNAME, "ShortName %S", aShortName.Ptr(), aShortName.Length()<<1);
-	OstTrace1(TRACE_BORDER, EFSRV_EFSGETSHORTNAMERETURN, "r %d", r);
+
+	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsGetShortNameReturn, MODULEUID, r, aShortName);
 	return r;
 	}
 
@@ -2733,11 +2778,10 @@
 
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSGETLONGNAME, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSGETLONGNAME_ESHORTNAME, "ShortName %S", aShortName.Ptr(), aShortName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsGetLongName, MODULEUID, Handle(), aShortName);
 	TInt r = SendReceive(EFsGetLongName,TIpcArgs(&aShortName,&aLongName));
-	OstTraceData(TRACE_BORDER, EFSRV_EFSGETLONGNAME_ELONGNAME, "LongName %S", aLongName.Ptr(), aLongName.Length()<<1);
-	OstTrace1(TRACE_BORDER, EFSRV_EFSGETLONGNAMERETURN, "r %d", r);
+
+	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsGetLongNameReturn, MODULEUID, r, aLongName);
 	return r;
 	}
 
@@ -2770,11 +2814,11 @@
 @see RFs::Replace
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSISFILEOPEN, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSISFILEOPEN_EFILENAME, "FileName %S", aFileName.Ptr(), aFileName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsIsFileOpen, MODULEUID, Handle(), aFileName);
 	TPckg<TBool> b(anAnswer);
 	TInt r = SendReceive(EFsIsFileOpen,TIpcArgs(&aFileName,&b));
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSISFILEOPENRETURN, "r %d anAnswer %d", (TUint) r, (TUint) anAnswer);
+
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFsIsFileOpenReturn, MODULEUID, r, anAnswer);
 	return r;
 	}
 
@@ -2806,12 +2850,14 @@
 @return True if notification in effect, false if not.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSGETNOTIFYUSER, "sess %x", Handle());
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsGetNotifyUser, MODULEUID, Handle());
+
 	TInt notifyUser;
 	TPckg<TInt> pckgNotify(notifyUser);
 	SendReceive(EFsGetNotifyUser,TIpcArgs(&pckgNotify));
 	TBool r = notifyUser;
-	OstTrace1(TRACE_BORDER, EFSRV_EFSGETNOTIFYUSERRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsGetNotifyUserReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -2828,10 +2874,10 @@
               EFalse, for no notification.
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSETNOTIFYUSER, "sess %x aValue %d", (TUint) Handle(), (TUint) aValue);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsSetNotifyUser, MODULEUID, Handle(), aValue);
 	SendReceive(EFsSetNotifyUser,TIpcArgs(aValue));
 
-	OstTrace0(TRACE_BORDER, EFSRV_EFSSETNOTIFYUSERRETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsSetNotifyUserReturn, MODULEUID);
 	}
 
 
@@ -2861,8 +2907,8 @@
 
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSISFILEINROM, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSISFILEINROM_EFILENAME, "FileName %S", aFileName.Ptr(), aFileName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsIsFileInRom, MODULEUID, Handle(), aFileName);
+
 	TPckgBuf<TUint8*> start;
 
 	TUint8* r;
@@ -2871,7 +2917,7 @@
 	else
 		r = start();
 
-	OstTrace1(TRACE_BORDER, EFSRV_EFSISFILEINROMRETURN, "r %d", r);
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsIsFileInRomReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -2911,8 +2957,7 @@
 */
 EFSRV_EXPORT_C TBool RFs::IsValidName(const TDesC& aFileName) const
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSISVALIDNAME1, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSISVALIDNAME1_EFILENAME, "FileName %S", aFileName.Ptr(), aFileName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsIsValidName1, MODULEUID, Handle(), aFileName);
 	TBool returnInvalidChar=EFalse;
 	TPckg<TBool> bPckg(returnInvalidChar);
 	TBool b;
@@ -2920,7 +2965,7 @@
 		b = EFalse;
 	else
 		b = ETrue;
-	OstTrace1(TRACE_BORDER, EFSRV_EFSISVALIDNAME1RETURN, "r %d", b);
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsIsValidName1Return, MODULEUID, b);
 	return b;
 	}
 
@@ -2963,8 +3008,7 @@
 */
 EFSRV_EXPORT_C TBool RFs::IsValidName(const TDesC& aFileName,TText& aBadChar) const
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSISVALIDNAME2, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSISVALIDNAME2_EFILENAME, "FileName %S", aFileName.Ptr(), aFileName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsIsValidName2, MODULEUID, Handle(), aFileName);
 	TBool returnInvalidChar=ETrue;
 	TPckg<TBool> boolPckg(returnInvalidChar);
 	TPckg<TText> textPckg(aBadChar);
@@ -2973,7 +3017,7 @@
 		b = EFalse;
 	else 
 		b = ETrue;
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSISVALIDNAME2RETURN, "r %d aBadChar %x", (TUint) b, (TUint) aBadChar);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsIsValidName2Return, MODULEUID, b, aBadChar);
 	return b;
 	}
 /**
@@ -3022,15 +3066,14 @@
 */
 EFSRV_EXPORT_C TBool RFs::IsValidName(const TDesC& aName, TNameValidParam& aParam )
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSISVALIDNAME3, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSISVALIDNAME3_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsIsValidName3, MODULEUID, Handle(), aName);
 	TPckg<TNameValidParam> paramPckg(aParam);
 	TBool b;
 	if (SendReceive(EFsIsValidName,TIpcArgs(&aName,NULL,NULL,&paramPckg))!=KErrNone)
 		b = EFalse;
 	else
 		b = ETrue;
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSISVALIDNAME3RETURN, "r %d err %d", (TUint) b, (TUint) aParam.ErrorCode());
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsIsValidName3Return, MODULEUID, b, aParam.ErrorCode());
 	return b;
 	}
 
@@ -3056,10 +3099,10 @@
 @see TDriveNumber
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSGETDRIVENAME, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsGetDriveName, MODULEUID, Handle(), aDrive);
 	TInt r = SendReceive(EFsGetDriveName,TIpcArgs(aDrive,&aDriveName));
-	OstTraceData(TRACE_BORDER, EFSRV_EFSGETDRIVENAME_EDRIVENAME, "DriveName %S", aDriveName.Ptr(), aDriveName.Length()<<1);
-	OstTrace1(TRACE_BORDER, EFSRV_EFSGETDRIVENAMERETURN, "r %d", r);
+
+	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsGetDriveNameReturn, MODULEUID, r, aDriveName);
 	return r;
 	}
 
@@ -3087,10 +3130,10 @@
 
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSETDRIVENAME, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSSETDRIVENAME_EDRIVENAME, "DriveName %S", aDriveName.Ptr(), aDriveName.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsSetDriveName, MODULEUID, Handle(), aDrive, aDriveName);
 	TInt r = SendReceive(EFsSetDriveName,TIpcArgs(aDrive,&aDriveName));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSSETDRIVENAMERETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetDriveNameReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -3121,9 +3164,10 @@
 
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSLOCKDRIVE, "sess %x aDrv %d aStore %d", (TUint) Handle(), (TUint) aDrv, (TUint) aStore);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFsLockDrive, MODULEUID, Handle(), aDrv, aStore);
 	TInt r = SendReceive(EFsLockDrive,TIpcArgs(aDrv,&aOld,&aNew,aStore));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSLOCKDRIVERETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsLockDriveReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -3152,9 +3196,10 @@
 
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSUNLOCKDRIVE, "sess %x aDrv %d aStore %d", (TUint) Handle(), (TUint) aDrive, (TUint) aStore);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFsUnlockDrive, MODULEUID, Handle(), aDrive, aStore);
 	TInt r = SendReceive(EFsUnlockDrive,TIpcArgs(aDrive,&aPassword,aStore));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSUNLOCKDRIVERETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsUnlockDriveReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -3180,9 +3225,10 @@
 
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSCLEARPASSWORD, "sess %x aDrv %d", (TUint) Handle(), (TUint) aDrv);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsClearPassword, MODULEUID, Handle(), aDrv);
 	TInt r = SendReceive(EFsClearPassword,TIpcArgs(aDrv,&aPswd));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSCLEARPASSWORDRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsClearPasswordReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -3207,9 +3253,10 @@
 
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSERASEPASSWORD, "sess %x aDrv %d", (TUint) Handle(), (TUint) aDrv);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsErasePassword, MODULEUID, Handle(), aDrv);
 	TInt r = SendReceive(EFsErasePassword,TIpcArgs(aDrv));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSERASEPASSWORDRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsErasePasswordReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -3226,11 +3273,11 @@
 // Notify file server that startup initialisation has been completed
 //
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSTARTUPINITCOMPLETE, "sess %x status %x", (TUint) Handle(), (TUint) &aStat);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsStartupInitComplete, MODULEUID, Handle(), &aStat);
 	aStat=KRequestPending;
 	RSessionBase::SendReceive(EFsStartupInitComplete,aStat);
 
-	OstTrace0(TRACE_BORDER, EFSRV_EFSSTARTUPINITCOMPLETERETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsStartupInitCompleteReturn, MODULEUID);
 	}
 
 
@@ -3241,11 +3288,11 @@
 // Set the local drive mapping
 //
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSSETLOCALDRIVEMAPPING, "sess %x", Handle());
-	
-	OstTraceData( TRACE_BORDER, EFSRV_EFSSETLOCALDRIVEMAPPING_ELOCALDRIVEMAPPING, "aMapping %{int32[]}", aMapping.Ptr(), aMapping.Length());
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsSetLocalDriveMapping, MODULEUID, Handle(), aMapping);
+
 	TInt r = SendReceive(EFsSetLocalDriveMapping,TIpcArgs(&aMapping));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSSETLOCALDRIVEMAPPINGRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetLocalDriveMappingReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -3259,7 +3306,7 @@
 
     @return KErrNone on success,
             KErrArgument if the function arguments are invalid
-            KErrInUse    if the drive has opened disk access objects (format, raw disk access, etc) and therefore can not be finalised
+            KErrInUse    if the drive has opened objects (files, directories etc.) and therefore can not be finalised
             KErrCorrupt  if the drive is corrupt.
             System wide error codes otherwise.
 
@@ -3267,9 +3314,10 @@
 */
 EFSRV_EXPORT_C TInt RFs::FinaliseDrive(TInt aDriveNo, TFinaliseDrvMode aMode) const
     {
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSFINALISEDRIVE, "sess %x aDriveNo %d aMode %d", (TUint) Handle(), (TUint) aDriveNo, (TUint) aMode);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFsFinaliseDrive, MODULEUID, Handle(), aDriveNo, aMode);
     TInt r = SendReceive(EFsFinaliseDrive,TIpcArgs(aDriveNo, (TInt)aMode));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSFINALISEDRIVERETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsFinaliseDriveReturn, MODULEUID, r);
 	return r;
     }
 
@@ -3285,7 +3333,7 @@
 */
 EFSRV_EXPORT_C TInt RFs::FinaliseDrives()
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSFINALISEDRIVES, "sess %x", Handle());
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsFinaliseDrives, MODULEUID, Handle());
 	TInt nRes;
 	TDriveList driveList;
 	TDriveInfo driveInfo;
@@ -3293,7 +3341,7 @@
 	nRes=DriveList(driveList);
 	if(nRes != KErrNone)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_EFSFINALISEDRIVESRETURN1, "r %d", nRes);
+		TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsFinaliseDrivesReturn, MODULEUID, nRes);
 	    return nRes; //-- unable to obtain drives list
 		}
 	
@@ -3315,7 +3363,7 @@
 	    }
 	
 
-	OstTrace1(TRACE_BORDER, EFSRV_EFSFINALISEDRIVESRETURN2, "r %d", KErrNone);
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsFinaliseDrivesReturn, MODULEUID, KErrNone);
 	return 	KErrNone;
 	}
 
@@ -3342,11 +3390,10 @@
 @capability DiskAdmin
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSWAPFILESYSTEM, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSSWAPFILESYSTEM_EOLDNAME, "OldName %S", aOldFileSystemName.Ptr(), aOldFileSystemName.Length()<<1);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSSWAPFILESYSTEM_ENEWNAME, "NewName %S", aNewFileSystemName.Ptr(), aNewFileSystemName.Length()<<1);
+	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsSwapFileSystem, MODULEUID, Handle(), aOldFileSystemName, aNewFileSystemName, aDrive);
 	TInt r = SendReceive(EFsSwapFileSystem,TIpcArgs(&aNewFileSystemName,aDrive,&aOldFileSystemName));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSSWAPFILESYSTEMRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSwapFileSystemReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -3371,10 +3418,11 @@
 @capability DiskAdmin
 */
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFSADDCOMPOSITEMOUNT, "sess %x aLocalDriveToMount %d aCompositeDrive %d aSync %d", (TUint) Handle(), aLocalDriveToMount, aCompositeDrive, aSync);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSADDCOMPOSITEMOUNT_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
+	TRACEMULT5(UTF::EBorder, UTraceModuleEfsrv::EFsAddCompositeMount, MODULEUID, 
+		Handle(), aFileSystemName, aLocalDriveToMount, aCompositeDrive, aSync);
 	TInt r = SendReceive(EFsAddCompositeMount,TIpcArgs(&aFileSystemName,aLocalDriveToMount,aCompositeDrive,aSync));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSADDCOMPOSITEMOUNTRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsAddCompositeMountReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -3413,9 +3461,10 @@
         any of the possible error return codes from TDrive::Volume()
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSRESERVEDRIVESPACE, "sess %x aDriveNo %d aSpace %d", (TUint) Handle(), (TUint) aDriveNo, (TUint) aSpace);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFsReserveDriveSpace, MODULEUID, Handle(), aDriveNo, aSpace);
 	TInt r = SendReceive(EFsReserveDriveSpace, TIpcArgs(aDriveNo, aSpace));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSRESERVEDRIVESPACERETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsReserveDriveSpaceReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -3433,9 +3482,10 @@
         KErrPermissionDenied if the drive has no spare reserved space
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSGETRESERVEACCESS, "sess %x aDriveNo %d", (TUint) Handle(), (TUint) aDriveNo);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsGetReserveAccess, MODULEUID, Handle(), aDriveNo);
 	TInt r = SendReceive(EFsGetReserveAccess, TIpcArgs(aDriveNo));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSGETRESERVEACCESSRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsGetReserveAccessReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -3449,9 +3499,10 @@
 
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSRELEASERESERVEACCESS, "sess %x aDriveNo %d", (TUint) Handle(), (TUint) aDriveNo);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsReleaseReserveAccess, MODULEUID, Handle(), aDriveNo);
 	TInt r = SendReceive(EFsReleaseReserveAccess, TIpcArgs(aDriveNo));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSRELEASERESERVEACCESSRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsReleaseReserveAccessReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -3508,7 +3559,7 @@
 */
 EFSRV_EXPORT_C void RFs::NotifyDismount(TInt aDrive, TRequestStatus& aStat, TNotifyDismountMode aMode /*=EFsDismountRegisterClient*/) const
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFSNOTIFYDISMOUNT, "sess %x aDrive %d status %x aMode %d", (TUint) Handle(), aDrive, (TUint) &aStat, (TInt) aMode);
+	TRACE4(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDismount, MODULEUID, Handle(), aDrive, &aStat, aMode);
 	aStat = KRequestPending;
 	RSessionBase::SendReceive(EFsNotifyDismount, TIpcArgs(aDrive,aMode,&aStat), aStat);
 	// This call is to synchronise with the driver thread as the corresponding cancel function (NotifyDismountCancel)
@@ -3516,7 +3567,7 @@
 	// This call guarantees that the notify request has been added to queue.
 	SendReceive(EFsSynchroniseDriveThread, TIpcArgs(aDrive));
 
-	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYDISMOUNTRETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDismountReturn, MODULEUID);
 	}
 
 
@@ -3531,12 +3582,12 @@
 */
 EFSRV_EXPORT_C void RFs::NotifyDismountCancel(TRequestStatus& aStat) const
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSNOTIFYDISMOUNTCANCEL1, "sess %x status %x", (TUint) Handle(), (TUint) &aStat);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDismountCancel1, MODULEUID, Handle(), &aStat);
 	
 	if (aStat == KRequestPending)
 		SendReceive(EFsNotifyDismountCancel, TIpcArgs(&aStat));
 
-	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYDISMOUNTCANCEL1RETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDismountCancel1Return, MODULEUID);
 	}
 
 
@@ -3548,10 +3599,11 @@
 */
 EFSRV_EXPORT_C void RFs::NotifyDismountCancel() const
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSNOTIFYDISMOUNTCANCEL2, "sess %x", Handle());
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDismountCancel2, MODULEUID, Handle());
+
 	SendReceive(EFsNotifyDismountCancel, TIpcArgs(NULL));
 
-	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYDISMOUNTCANCEL2RETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDismountCancel2Return, MODULEUID);
 	}
 
 
@@ -3571,9 +3623,10 @@
 */
 EFSRV_EXPORT_C TInt RFs::AllowDismount(TInt aDrive) const
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSALLOWDISMOUNT, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsAllowDismount, MODULEUID, Handle(), aDrive);
 	TInt r = SendReceive(EFsAllowDismount, TIpcArgs(aDrive));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSALLOWDISMOUNTRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsAllowDismountReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -3594,9 +3647,10 @@
 @return KErrNone if successful, KErrPermissionDenied if called outside estart
 */
     {
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFSSETSTARTUPCONFIGURATION, "sess %x aCommand %d aParam1 %x aParam2 %x", (TUint) Handle(), aCommand, (TUint) aParam1, (TUint) aParam2);
+	TRACE4(UTF::EBorder, UTraceModuleEfsrv::EFsSetStartupConfiguration, MODULEUID, Handle(), aCommand, aParam1, aParam2);
     TInt r = SendReceive(EFsSetStartupConfiguration, TIpcArgs(aCommand,aParam1,aParam2));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSSETSTARTUPCONFIGURATIONRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetStartupConfigurationReturn, MODULEUID, r);
 	return r;
     }
 
@@ -3616,9 +3670,10 @@
 @see RFs::NotifyChange
  */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSETNOTIFYCHANGE, "sess %x aNotifyChange %d", (TUint) Handle(), (TUint) aNotifyChange);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsSetNotifyChange, MODULEUID, Handle(), aNotifyChange);
 	TInt r = SendReceive(EFsSetSessionFlags, TIpcArgs(aNotifyChange ? EFsSessionNotifyChange: 0, aNotifyChange ? 0 : EFsSessionNotifyChange));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSSETNOTIFYCHANGERETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetNotifyChangeReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -3652,9 +3707,10 @@
 @capability KDiskAdmin
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSINITIALISEPROPERTIESFILE, "sess %x filePtr %x fileLen %d", (TUint) Handle(), (TUint) aPtr.Ptr(), (TUint) aPtr.Length());
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFsInitialisePropertiesFile, MODULEUID, Handle(), aPtr.Ptr(), aPtr.Length());
 	TInt r = SendReceive(EFsInitialisePropertiesFile, TIpcArgs(aPtr.Ptr(), aPtr.Length(), ETrue));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSINITIALISEPROPERTIESFILERETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsInitialisePropertiesFileReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -3673,9 +3729,10 @@
 @see TVolumeIOParamInfo
  */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSQUERYVOLUMEINFOEXT, "sess %x aDrive %d aCommand %d", (TUint) Handle(), (TUint) aDrive, (TUint) aCommand);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFsQueryVolumeInfoExt, MODULEUID, Handle(), aDrive, aCommand);
 	TInt r = SendReceive(EFsQueryVolumeInfoExt, TIpcArgs(aDrive, aCommand, &aInfo));
-	OstTrace1(TRACE_BORDER, EFSRV_EFSQUERYVOLUMEINFOEXTRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsQueryVolumeInfoExtReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -3694,7 +3751,8 @@
 @return KErrNone if successful; otherwise, another system wide error code is returned.
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSVOLUMEIOPARAM, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsVolumeIOParam, MODULEUID, Handle(), aDrive);
+
 	TInt r = KErrNone;
 
 	if (!IsValidDrive(aDrive))
@@ -3707,8 +3765,9 @@
 		if (r == KErrNone)
 			aParamInfo = infoPckg();
 		}
-	OstTraceExt5(TRACE_BORDER, EFSRV_EFSVOLUMEIOPARAMRETURN, "r %d iBlockSize %d iClusterSize %d iRecReadBufSize %d iRecWriteBufSize %d", (TUint) r, (TUint) aParamInfo.iBlockSize, (TUint) aParamInfo.iClusterSize, (TUint) aParamInfo.iRecReadBufSize, (TUint) aParamInfo.iRecWriteBufSize);
-		
+
+	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EFsVolumeIOParamReturn, MODULEUID, 
+		r, aParamInfo.iBlockSize, aParamInfo.iClusterSize, aParamInfo.iRecReadBufSize, aParamInfo.iRecWriteBufSize);
 	return r;
 	}
 
@@ -3737,7 +3796,7 @@
 */
 EFSRV_EXPORT_C TInt RFs::FileSystemSubType(TInt aDrive, TDes& aName) const
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSFILESYSTEMSUBTYPE, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsFileSystemSubType, MODULEUID, Handle(), aDrive, aName);
 
 	TInt r = KErrNone;
 
@@ -3751,11 +3810,8 @@
 		if (r == KErrNone || r == KErrNotSupported)
 			aName = namePckg();
 		}
-	
-	OstTraceData(TRACE_BORDER, EFSRV_EFSFILESYSTEMSUBTYPE_EFILESYSTEMNAME, "FileSystemName %S", aName.Ptr(), aName.Length()<<1);
-
-	OstTrace1(TRACE_BORDER, EFSRV_EFSFILESYSTEMSUBTYPERETURN, "r %d", r);
-
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsFileSystemSubTypeReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -3838,21 +3894,14 @@
 	return SendReceive(EFsDismountProxyDrive,TIpcArgs(aProxyDriveNumber));
 	}
 
-
-/**
-Closes the file server session.
-
-NB This function was added to support tracing and was not present in earlier versions of Symbian OS.
-For this reason no extra funcitonality should be added to this function.
-
-*/
 EFSRV_EXPORT_C void RFs::Close()
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSCLOSE, "sess %x", Handle());
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsClose, MODULEUID, Handle());
+	RFTRACE_CLOSE;
 
 	RSessionBase::Close();
 
-	OstTrace0(TRACE_BORDER, EFSRV_EFSCLOSERETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsCloseReturn, MODULEUID);
 	}
 
 
--- a/userlibandfileserver/fileserver/sfsrv/cl_dir.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfsrv/cl_dir.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -17,10 +17,6 @@
 
 #include "cl_std.h"
 
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "cl_dirTraces.h"
-#endif
-
 
 
 
@@ -52,14 +48,13 @@
 
 */
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EDIROPEN1, "sess %x aUidType0 %x aUidType1 %x aUidType2 %x", (TUint) Session().Handle(), (TUint) aUidType[0].iUid, (TUint) aUidType[1].iUid, (TUint) aUidType[2].iUid);
-	OstTraceData(TRACE_BORDER, EFSRV_EDIROPEN1_EDIRNAME, "Dir %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT5(UTF::EBorder, UTraceModuleEfsrv::EDirOpen1, MODULEUID,
+		Session().Handle(), aName, aUidType[0].iUid, aUidType[1].iUid, aUidType[2].iUid);
 
 	TPckgC<TUidType> pckgUid(aUidType);
 	TInt r = CreateSubSession(aFs,EFsDirOpen,TIpcArgs(&aName,KEntryAttAllowUid,&pckgUid));
 
-	OstTraceExt2(TRACE_BORDER, EFSRV_EDIROPEN1RETURN, "r %d subs %x", (TUint) r, (TUint) SubSessionHandle());
-
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EDirOpen1Return, MODULEUID, r, SubSessionHandle());
 	return r;
 	}
 
@@ -97,15 +92,13 @@
 
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EDIROPEN2, "sess %x anAttMask %x", (TUint) Session().Handle(), (TUint) anAttMask);
-	OstTraceData(TRACE_BORDER, EFSRV_EDIROPEN2_EDIRNAME, "Dir %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EDirOpen2, MODULEUID, Session().Handle(), aName, anAttMask);
 
 	TUidType uidType(TUid::Null(),TUid::Null(),TUid::Null());
 	TPckgC<TUidType> pckgUid(uidType);
 	TInt r = CreateSubSession(aFs,EFsDirOpen,TIpcArgs(&aName,anAttMask,&pckgUid));
 
-	OstTraceExt2(TRACE_BORDER, EFSRV_EDIROPEN2RETURN, "r %d subs %x", (TUint) r, (TUint) SubSessionHandle());
-
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EDirOpen2Return, MODULEUID, r, SubSessionHandle());
 	return r;
 	}
 
@@ -119,11 +112,11 @@
 it completed successfully or not.
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EDIRCLOSE, "sess %x subs %x", (TUint) Session().Handle(), (TUint) SubSessionHandle());
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EDirClose, MODULEUID, Session().Handle(), SubSessionHandle());
 
 	CloseSubSession(EFsDirSubClose);
 
-	OstTrace0(TRACE_BORDER, EFSRV_EDIRCLOSERETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EDirCloseReturn, MODULEUID);
 	}
 
 
@@ -147,13 +140,12 @@
         (e.g. KErrCorrupt, KErrNoMemory etc).
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EDIRREAD1, "sess %x subs %x", (TUint) Session().Handle(), (TUint) SubSessionHandle());
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EDirRead1, MODULEUID, Session().Handle(), SubSessionHandle());
 
 	anArray.iCount=KCountNeeded;
 	TInt r = SendReceive(EFsDirReadPacked,TIpcArgs(&anArray.iBuf));
 
-	OstTraceExt2(TRACE_BORDER, EFSRV_EDIRREAD1RETURN, "r %d count %d", (TUint) r, (TUint) anArray.Count());
-
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EDirRead1Return, MODULEUID, r, anArray.Count());
 	return r;
 	}
 
@@ -179,12 +171,12 @@
                (e.g. KErrCorrupt, KErrNoMemory etc).
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EDIRREAD2, "sess %x subs %x status %x", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) &aStatus);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EDirRead2, MODULEUID, Session().Handle(), SubSessionHandle(), &aStatus);
 
 	anArray.iCount=KCountNeeded;
 	RSubSessionBase::SendReceive(EFsDirReadPacked,TIpcArgs(&anArray.iBuf),aStatus);
 
-	OstTrace0(TRACE_BORDER, EFSRV_EDIRREAD2RETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EDirRead2Return, MODULEUID);
 	}
 
 
@@ -202,13 +194,12 @@
         codes.
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EDIRREAD3, "sess %x subs %x", (TUint) Session().Handle(), (TUint) SubSessionHandle());
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EDirRead3, MODULEUID, Session().Handle(), SubSessionHandle());
 
 	TPckg<TEntry> e(anEntry);
 	TInt r = SendReceive(EFsDirReadOne,TIpcArgs(&e));
 
-	OstTrace1(TRACE_BORDER, EFSRV_EDIRREAD3RETURN, "r %d", r);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EDirRead3Return, MODULEUID, r);
 	return r;
 	}
 
@@ -227,9 +218,9 @@
                error codes.
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EDIRREAD4, "sess %x subs %x status %x", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) &aStatus);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EDirRead4, MODULEUID, Session().Handle(), SubSessionHandle(), &aStatus);
 
 	RSubSessionBase::SendReceive(EFsDirReadOne,TIpcArgs(&anEntry),aStatus);
 
-	OstTrace0(TRACE_BORDER, EFSRV_EDIRREAD4RETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EDirRead4Return, MODULEUID);
 	}
--- a/userlibandfileserver/fileserver/sfsrv/cl_file.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfsrv/cl_file.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -16,9 +16,7 @@
 //
 
 #include "cl_std.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "cl_fileTraces.h"
-#endif
+
 static _LIT_SECURITY_POLICY_S1(KFileServerPolicy,KFileServerUidValue,ECapabilityTCB);
 
 EFSRV_EXPORT_C TInt RFile::Adopt(RFs& aFs, TInt aHandle)
@@ -36,23 +34,26 @@
 */
 	{
 
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILEADOPT, "sess %x subs %x", (TUint) aFs.Handle(), (TUint) aHandle);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFileAdopt, MODULEUID, aFs.Handle(), aHandle);
+
 	// duplicate the sub-session handle; don't panic if it's invalid.
 	RFile file;
 	TInt r = file.CreateSubSession(aFs, EFsFileDuplicate, TIpcArgs(aHandle, EFalse));
 	if (r == KErrArgument)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_EFILEADOPTRETURN1, "r %d", KErrBadHandle);
+		TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptReturn, MODULEUID, KErrBadHandle);
 		return KErrBadHandle;
 		}
 	else if (r != KErrNone)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_EFILEADOPTRETURN2, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptReturn, MODULEUID, r);
 		return r;
 		}
 	// adopt the duplicated handle
 	r = CreateAutoCloseSubSession(aFs, EFsFileAdopt, TIpcArgs(file.SubSessionHandle(), KFileAdopt32));
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILEADOPTRETURN3, "r %d sess %x subs %x", (TUint) r, (TUint) Session().Handle(), (TUint) SubSessionHandle());
+
+	TRACERET3(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptReturn, MODULEUID, r, Session().Handle(), SubSessionHandle());
+
 	return r;
 	}
 
@@ -76,16 +77,19 @@
         error codes.
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILEADOPTFROMSERVER, "sess %x subs %x", (TUint) aFsHandle, (TUint) aFileHandle);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptFromServer, MODULEUID, aFsHandle, aFileHandle);
+
 	RFs fs;
 	TInt r = fs.SetReturnedHandle(aFsHandle, KFileServerPolicy);
 	if (r != KErrNone)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_EFILEADOPTFROMSERVERRETURN1, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptFromServerReturn, MODULEUID, r);
 		return r;
 		}
 	r = CreateAutoCloseSubSession(fs, EFsFileAdopt, TIpcArgs(aFileHandle, KFileAdopt32));
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILEADOPTFROMSERVERRETURN2, "r %d sess %x subs %x", (TUint) r, (TUint) Session().Handle(), (TUint) SubSessionHandle());
+
+	TRACERET3(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptFromServerReturn, MODULEUID, r, Session().Handle(), SubSessionHandle());
+
 	return r;
 	}
 
@@ -126,7 +130,7 @@
 	else
 		r = KErrArgument;
 
-#ifdef OST_TRACE_COMPILER_IN_USE
+#ifdef SYMBIAN_FTRACE_ENABLE
 	TInt handle = NULL;
 	if (aFsHandleIndex == 0)
 		handle = aMsg.Int0();
@@ -136,12 +140,12 @@
 		handle = aMsg.Int2();
 	else if (aFsHandleIndex == 3)
 		handle = aMsg.Int3();
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILEADOPTFROMCLIENT, "sess %x subs %x aFsHandleIndex %d aFileHandleIndex %d ", (TUint) handle, (TUint) fileHandle, (TUint) aFsHandleIndex, (TUint) aFileHandleIndex);
+	TRACE4(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptFromClient, MODULEUID, handle, fileHandle, aFsHandleIndex, aFileHandleIndex);
 #endif
 
 	if (r != KErrNone)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_EFILEADOPTFROMCLIENTRETURN1, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptFromClientReturn, MODULEUID, r);
 		return r;
 		}
 
@@ -151,12 +155,14 @@
 	r = fs.Open(aMsg, aFsHandleIndex, KFileServerPolicy);
 	if (r != KErrNone)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_EFILEADOPTFROMCLIENTRETURN2, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptFromClientReturn, MODULEUID, r);
 		return r;
 		}
 
 	r = CreateAutoCloseSubSession(fs, EFsFileAdopt, TIpcArgs(fileHandle, KFileAdopt32));
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILEADOPTFROMCLIENTRETURN3, "r %d sess %x subs %x", (TUint) r, (TUint) Session().Handle(), (TUint) SubSessionHandle());
+
+	TRACERET3(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptFromClientReturn, MODULEUID, r, Session().Handle(), SubSessionHandle());
+
 	return r;
 	}
 
@@ -187,10 +193,11 @@
 
 	TInt r = User::GetTIntParameter(aFileHandleIndex,  fileHandle);
 
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILEADOPTFROMCREATOR, "subs %x aFsHandleIndex %d aFileHandleIndex %d", (TUint) fileHandle, (TUint) aFsHandleIndex, (TUint) aFileHandleIndex);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptFromCreator, MODULEUID, fileHandle, aFsHandleIndex, aFileHandleIndex);
+
 	if (r != KErrNone)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_EFILEADOPTFROMCREATORRETURN1, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptFromCreatorReturn, MODULEUID, r);
 		return r;
 		}
 
@@ -201,12 +208,14 @@
 	r = fs.Open(aFsHandleIndex, KFileServerPolicy);
 	if (r != KErrNone)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_EFILEADOPTFROMCREATORRETURN2, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptFromCreatorReturn, MODULEUID, r);
 		return r;
 		}
 
 	r = CreateAutoCloseSubSession(fs, EFsFileAdopt, TIpcArgs(fileHandle, KFileAdopt32));
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILEADOPTFROMCREATORRETURN3, "r %d sess %x subs %x", (TUint) r, (TUint) Session().Handle(), (TUint) SubSessionHandle());
+
+	TRACERET3(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptFromCreatorReturn, MODULEUID, r, Session().Handle(), SubSessionHandle());
+
 	return r;
 	}
 
@@ -228,7 +237,8 @@
 */
 EFSRV_EXPORT_C TInt RFile::Duplicate(const RFile& aFile, TOwnerType aType)
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILEDUPLICATE, "sess %x subs %x aType %d", (TUint) aFile.Session().Handle(), (TUint) aFile.SubSessionHandle(), (TUint) aType);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFileDuplicate, MODULEUID, aFile.Session().Handle(), aFile.SubSessionHandle(), aType);
+
 	RFs fs;
 	fs.SetHandle(aFile.Session().Handle());
 
@@ -237,7 +247,7 @@
 	TInt r = fs.Duplicate(RThread(), aType);
 	if (r != KErrNone)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_EFILEDUPLICATERETURN1, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileDuplicateReturn, MODULEUID, r);
 		return r;
 		}
 	
@@ -246,14 +256,15 @@
 	r = aFile.DuplicateHandle(dupSubSessionHandle);
 	if (r != KErrNone)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_EFILEDUPLICATERETURN2, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileDuplicateReturn, MODULEUID, r);
 		return r;
 		}
 
 	// adopt the duplicated sub-session handle
 	r = CreateAutoCloseSubSession(fs, EFsFileAdopt, TIpcArgs(dupSubSessionHandle, KFileDuplicate));
 
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILEDUPLICATERETURN3, "r %d sess %x subs %x", (TUint) r, (TUint) Session().Handle(), (TUint) SubSessionHandle());
+	TRACERET3(UTF::EBorder, UTraceModuleEfsrv::EFileDuplicateReturn, MODULEUID, r, Session().Handle(), SubSessionHandle());
+
 	return r;
 	}
 
@@ -310,10 +321,11 @@
 */
 EFSRV_EXPORT_C TInt RFile::TransferToServer(TIpcArgs& aIpcArgs, TInt aFsHandleIndex, TInt aFileHandleIndex) const
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILETRANSFERTOSERVER, "sess %x subs %x aFsHandleIndex %d aFileHandleIndex %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aFsHandleIndex, (TUint) aFileHandleIndex);
+	TRACE4(UTF::EBorder, UTraceModuleEfsrv::EFileTransferToServer, MODULEUID, Session().Handle(), SubSessionHandle(), aFsHandleIndex, aFileHandleIndex);
+
 	if ((aFsHandleIndex < 0) || (aFsHandleIndex > (KMaxMessageArguments-2)))
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_EFILETRANSFERTOSERVERRETURN1, "r %d",  (TUint) KErrArgument);
+		TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFileTransferToServerReturn, MODULEUID,  (TUint) KErrArgument);
 		return KErrArgument;
 		}
 
@@ -324,7 +336,8 @@
 		aIpcArgs.Set(aFsHandleIndex, Session());
 		aIpcArgs.Set(aFileHandleIndex, dupSubSessionHandle);
 		}
-	OstTrace1(TRACE_BORDER, EFSRV_EFILETRANSFERTOSERVERRETURN2, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileTransferToServerReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -355,10 +368,11 @@
 */
 EFSRV_EXPORT_C TInt RFile::TransferToClient(const RMessage2& aMsg, TInt aFileHandleIndex) const
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILETRANSFERTOCLIENT, "sess %x subs %x aFileHandleIndex %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aFileHandleIndex);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFileTransferToClient, MODULEUID, Session().Handle(), SubSessionHandle(), aFileHandleIndex);
+
 	if (TUint(aFileHandleIndex) >= TUint(KMaxMessageArguments))
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_EFILETRANSFERTOCLIENTRETURN1, "r %d",  (TUint) KErrArgument);
+		TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFileTransferToClientReturn, MODULEUID,  (TUint) KErrArgument);
 		return KErrArgument;
 		}
 
@@ -369,13 +383,14 @@
 
 	if (r != KErrNone)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_EFILETRANSFERTOCLIENTRETURN2, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileTransferToClientReturn, MODULEUID, r);
 		return r;
 		}
 
 	aMsg.Complete(Session());
 	
-	OstTrace1(TRACE_BORDER, EFSRV_EFILETRANSFERTOCLIENTRETURN3, "r %d", r);
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFileTransferToClientReturn, MODULEUID, r);
+
 	return r;
 	}
 
@@ -408,7 +423,8 @@
 // NB slot 0 is reserved for the command line
 EFSRV_EXPORT_C TInt RFile::TransferToProcess(RProcess& aProcess, TInt aFsHandleIndex, TInt aFileHandleIndex) const
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILETRANSFERTOPROCESS, "sess %x subs %x aFsHandleIndex %d aFileHandleIndex %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aFsHandleIndex, (TUint) aFileHandleIndex);
+	TRACE4(UTF::EBorder, UTraceModuleEfsrv::EFileTransferToProcess, MODULEUID, Session().Handle(), SubSessionHandle(), aFsHandleIndex, aFileHandleIndex);
+
 	TInt dupSubSessionHandle;
 	TInt r = DuplicateHandle(dupSubSessionHandle);
 
@@ -417,7 +433,9 @@
 	
 	if (r == KErrNone)
 		r = aProcess.SetParameter(aFileHandleIndex, dupSubSessionHandle);
-	OstTrace1(TRACE_BORDER, EFSRV_EFILETRANSFERTOPROCESSRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileTransferToProcessReturn, MODULEUID, r);
+
 	return r;
 	}
 
@@ -437,10 +455,12 @@
 
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILEGETNAME, "sess %x subs %x", (TUint) Session().Handle(), (TUint) SubSessionHandle());
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFileName, MODULEUID, Session().Handle(), SubSessionHandle());
+
 	TInt r = SendReceive(EFsFileName, TIpcArgs(&aName));
-	OstTraceData(TRACE_BORDER, EFSRV_EFILEGETNAME_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
-	OstTrace1(TRACE_BORDER, EFSRV_EFILEGETNAMERETURN, "r %d", r);
+
+	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFileNameReturn, MODULEUID, r, aName);
+
 	return r;
 	}
 
@@ -460,10 +480,12 @@
 
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILEFULLNAME, "sess %x subs %x", (TUint) Session().Handle(), (TUint) SubSessionHandle());
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFileFullName, MODULEUID, Session().Handle(), SubSessionHandle());
+
 	TInt r = SendReceive(EFsFileFullName, TIpcArgs(&aName));
-	OstTraceData(TRACE_BORDER, EFSRV_EFILEFULLNAME_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
-	OstTrace1(TRACE_BORDER, EFSRV_EFILEFULLNAMERETURN, "r %d", r);
+
+	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFileFullNameReturn, MODULEUID, r, aName);
+
 	return r;
 	}
 
@@ -518,11 +540,13 @@
 
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILEOPEN, "sess %x mode %x", (TUint) aFs.Handle(), (TUint) aMode);
-	OstTraceData(TRACE_BORDER, EFSRV_EFILEOPEN_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFileOpen, MODULEUID, aFs.Handle(), aMode, aName);
+
 	aMode &= ~EFileBigFile;
 	TInt r = CreateSubSession(aFs,EFsFileOpen,TIpcArgs(&aName,aMode));
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILEOPENRETURN, "r %d subs %x", (TUint) r, (TUint) SubSessionHandle());
+
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFileOpenReturn, MODULEUID, r, SubSessionHandle());
+
 	return r;
 	}
 
@@ -540,11 +564,22 @@
 no-operation.
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILECLOSE, "sess %x subs %x", (TUint) Session().Handle(), (TUint) SubSessionHandle());
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFileClose, MODULEUID, Session().Handle(), SubSessionHandle());
 	
+#if defined (SYMBIAN_FTRACE_ENABLE) && defined(__DLL__)
+	// Need to close the handle to the trace LDD if this is an auto-close subsession
+	// as these close their parent session by calling RHandleBase::Close(), i.e. they
+	// bypass RFs::Close() which would normally be responsible for closing the LDD
+	TInt h = Session().Handle() ^ CObjectIx::ENoClose;
+	if ( h != NULL && (!(h & CObjectIx::ENoClose)) ) 
+		{
+		RFTRACE_CLOSE;
+		}
+#endif
+
 	CloseSubSession(EFsFileSubClose);
 
-	OstTrace0(TRACE_BORDER, EFSRV_EFILECLOSERETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFileCloseReturn, MODULEUID);
 	}
 
 
@@ -588,10 +623,13 @@
 */
 	{
 	aMode &= ~EFileBigFile;
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILECREATE, "sess %x mode %x", (TUint) aFs.Handle(), (TUint) aMode);
-	OstTraceData(TRACE_BORDER, EFSRV_EFILECREATE_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
+
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFileCreate, MODULEUID, aFs.Handle(), aMode, aName);
+
 	TInt r = CreateSubSession(aFs,EFsFileCreate,TIpcArgs(&aName,aMode));
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILECREATERETURN, "r %d subs %x", (TUint) r, (TUint) SubSessionHandle());
+
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFileCreateReturn, MODULEUID, r, SubSessionHandle());
+
 	return r;
 	}
 
@@ -642,11 +680,10 @@
 
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILEREPLACE, "sess %x mode %x", (TUint) aFs.Handle(), (TUint) aMode);
-	OstTraceData(TRACE_BORDER, EFSRV_EFILEREPLACE_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFileReplace, MODULEUID, aFs.Handle(), aMode, aName);
 	aMode &= ~EFileBigFile;
 	TInt r = CreateSubSession(aFs,EFsFileReplace,TIpcArgs(&aName,aMode));
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILEREPLACERETURN, "r %d subs %x", (TUint) r, (TUint) SubSessionHandle());
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFileReplaceReturn, MODULEUID, r, SubSessionHandle());
 	return r;
 	}
 
@@ -680,13 +717,10 @@
 					  SID then AllFiles capability is required.
 */
 	{
-   	OstTraceExt2(TRACE_BORDER, EFSRV_EFILETEMP, "sess %x aMode %x", (TUint) aFs.Handle(), (TUint) aMode);
-	OstTraceData(TRACE_BORDER, EFSRV_EFILETEMP_EDIRNAME, "Dir %S", aPath.Ptr(), aPath.Length()<<1);
+   	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFileTemp, MODULEUID, aFs.Handle(), aPath, aMode);
 	aMode &= ~EFileBigFile;
 	TInt r = CreateSubSession(aFs,EFsFileTemp,TIpcArgs(&aPath,aMode,&aName));
-	OstTraceData(TRACE_BORDER, EFSRV_EFILETEMP_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILETEMPRETURN, "r %d subs %x", (TUint) r, (TUint) SubSessionHandle());
-	
+	TRACERETMULT3(UTF::EBorder, UTraceModuleEfsrv::EFileTempReturn, MODULEUID, r, SubSessionHandle(), aName);
 	return r;
 	}
 
@@ -714,9 +748,12 @@
 @see TDesC8::Length
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILEREAD1, "sess %x subs %x desmaxlen %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aDes.MaxLength());
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFileRead1, MODULEUID, Session().Handle(), SubSessionHandle(), aDes.MaxLength());
+
 	TInt r = SendReceive(EFsFileRead,TIpcArgs(&aDes,aDes.MaxLength(),I64LOW(KCurrentPosition64)));
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILEREAD1RETURN, "r %d len %d", (TUint) r, (TUint) aDes.Length());
+
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFileRead1Return, MODULEUID, r, aDes.Length());
+
 	return r;
 	}
 
@@ -750,10 +787,11 @@
 @see TDesC8::Length       
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILEREAD2, "sess %x subs %x maxdeslen %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aDes.MaxLength());
+	TRACE4(UTF::EBorder, UTraceModuleEfsrv::EFileRead2, MODULEUID, Session().Handle(), SubSessionHandle(), aDes.MaxLength(), &aStatus);
+
     RSubSessionBase::SendReceive(EFsFileRead,TIpcArgs(&aDes,aDes.MaxLength(),I64LOW(KCurrentPosition64)),aStatus);
 
-	OstTrace0(TRACE_BORDER, EFSRV_EFILEREAD2RETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFileRead2Return, MODULEUID);
 	}
 
 
@@ -788,7 +826,8 @@
         codes.
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILEREAD5, "sess %x subs %x aLength %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aLength);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFileRead1, MODULEUID, Session().Handle(), SubSessionHandle(), aLength);
+
 	if (aLength==0)
 		{
 		aDes.Zero();
@@ -799,7 +838,9 @@
 		return(KErrOverflow);
 		}
 	TInt r = SendReceive(EFsFileRead,TIpcArgs(&aDes,aLength,I64LOW(KCurrentPosition64)));
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILEREAD5RETURN, "r %d len %d", (TUint) r, (TUint) aDes.Length());
+
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFileRead1Return, MODULEUID, r, aDes.Length());
+
 	return r;
 	}
 
@@ -839,7 +880,8 @@
                otherwise one of the other system-wide error codes.
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILEREAD6, "sess %x subs %x aLength %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aLength);
+	TRACE4(UTF::EBorder, UTraceModuleEfsrv::EFileRead2, MODULEUID, Session().Handle(), SubSessionHandle(), aLength, &aStatus);
+
 	if (aLength==0)
 		{
 		aDes.Zero();
@@ -855,7 +897,8 @@
 		}
 		
 	RSubSessionBase::SendReceive(EFsFileRead,TIpcArgs(&aDes,aLength,I64LOW(KCurrentPosition64)),aStatus);
-	OstTrace0(TRACE_BORDER, EFSRV_EFILEREAD6RETURN, "");
+
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFileRead2Return, MODULEUID);
 	}
 
 
@@ -889,11 +932,14 @@
 @panic FSCLIENT 19 if aPos is negative.        
 */
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILEREAD3, "sess %x subs %x aPos %x maxdeslen %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aPos, (TUint) aDes.MaxLength());
+	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EFileRead3, MODULEUID, Session().Handle(), SubSessionHandle(), aPos, 0, aDes.MaxLength());
+
 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
 
 	TInt r = SendReceive(EFsFileRead,TIpcArgs(&aDes,aDes.MaxLength(),aPos));
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILEREAD3RETURN, "r %d len %d", (TUint) r, (TUint) aDes.Length());
+
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFileRead3Return, MODULEUID, r, aDes.Length());
+
 	return r;
 	}
 
@@ -933,11 +979,12 @@
 @panic FSCLIENT 19 if aPos is negative.        
 */
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILEREAD4, "sess %x subs %x aPos %x maxdeslen %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aPos, (TUint) aDes.MaxLength());
+	TRACE6(UTF::EBorder, UTraceModuleEfsrv::EFileRead4, MODULEUID, Session().Handle(), SubSessionHandle(), aPos, 0, aDes.MaxLength(), &aStatus);
+
 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
 	RSubSessionBase::SendReceive(EFsFileRead,TIpcArgs(&aDes,aDes.MaxLength(),aPos),aStatus);
 
-	OstTrace0(TRACE_BORDER, EFSRV_EFILEREAD4RETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFileRead4Return, MODULEUID);
 	}
 
 
@@ -979,7 +1026,8 @@
 @panic FSCLIENT 19 if aPos is negative.        
 */
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILEREAD7, "sess %x subs %x aPos %x aLength %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aPos, (TUint) aLength);
+	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EFileRead3, MODULEUID, Session().Handle(), SubSessionHandle(), aPos, 0, aLength);
+
 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
 	if (aLength==0)
 		{
@@ -992,7 +1040,9 @@
 		}
 		
 	TInt r = SendReceive(EFsFileRead,TIpcArgs(&aDes,aLength,aPos));
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILEREAD7RETURN, "r %d len %d", (TUint) r, (TUint) aDes.Length());
+
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFileRead3Return, MODULEUID, r, aDes.Length());
+
 	return r;
 	}
 
@@ -1041,7 +1091,8 @@
 @panic FSCLIENT 19 if aPos is negative.                       
 */
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILEREAD9, "sess %x subs %x aPos %x maxlen %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aPos, (TUint) aLength);
+	TRACE6(UTF::EBorder, UTraceModuleEfsrv::EFileRead4, MODULEUID, Session().Handle(), SubSessionHandle(), aPos, 0, aLength, &aStatus);
+
 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
 	if (aLength==0)
 		{
@@ -1058,7 +1109,8 @@
 		}
 		
 	RSubSessionBase::SendReceive(EFsFileRead,TIpcArgs(&aDes,aLength,aPos),aStatus);
-	OstTrace0(TRACE_BORDER, EFSRV_EFILEREAD9RETURN, "");
+
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFileRead4Return, MODULEUID);
 	}
 
 
@@ -1110,9 +1162,9 @@
         codes.
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILEWRITE1, "sess %x subs %x deslen %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aDes.Length());
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFileWrite1, MODULEUID, Session().Handle(), SubSessionHandle(), aDes.Length());
 	TInt r = SendReceive(EFsFileWrite,TIpcArgs(&aDes,aDes.Length(),I64LOW(KCurrentPosition64)));
-	OstTrace1(TRACE_BORDER, EFSRV_EFILEWRITE1RETURN, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileWrite1Return, MODULEUID, r);
 	return r;
 	}
 
@@ -1137,9 +1189,10 @@
                otherwise one of the other system-wide error codes.
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILEWRITE2, "sess %x subs %x deslen %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aDes.Length());
+	TRACE4(UTF::EBorder, UTraceModuleEfsrv::EFileWrite2, MODULEUID, Session().Handle(), SubSessionHandle(), aDes.Length(), &aStatus);
+
 	RSubSessionBase::SendReceive(EFsFileWrite,TIpcArgs(&aDes,aDes.Length(),I64LOW(KCurrentPosition64)),aStatus);
-	OstTrace0(TRACE_BORDER, EFSRV_EFILEWRITE2RETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFileWrite2Return, MODULEUID);
 	}
 
 
@@ -1166,10 +1219,12 @@
        of the descriptor aDes.  
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILEWRITE5, "sess %x subs %x aLength %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aLength);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFileWrite1, MODULEUID, Session().Handle(), SubSessionHandle(), aLength);
+
 	__ASSERT_DEBUG(aDes.Length()>=aLength,Panic(EBadLength));
 	TInt r = SendReceive(EFsFileWrite,TIpcArgs(&aDes,aLength,I64LOW(KCurrentPosition64)));
-	OstTrace1(TRACE_BORDER, EFSRV_EFILEWRITE5RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileWrite1Return, MODULEUID, r);
 	return r;
 	}
 
@@ -1202,10 +1257,11 @@
 
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILEWRITE9, "sess %x subs %x aLength %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aLength);
+	TRACE4(UTF::EBorder, UTraceModuleEfsrv::EFileWrite2, MODULEUID, Session().Handle(), SubSessionHandle(), aLength, &aStatus);
 		
 	RSubSessionBase::SendReceive(EFsFileWrite,TIpcArgs(&aDes,aLength,I64LOW(KCurrentPosition64)),aStatus);
-	OstTrace0(TRACE_BORDER, EFSRV_EFILEWRITE9RETURN, "");
+
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFileWrite2Return, MODULEUID);
 	}
 
 
@@ -1235,10 +1291,12 @@
 @panic FSCLIENT 19 if aPos is negative.                       
 */
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILEWRITE3, "sess %x subs %x aPos %x len %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aPos, (TUint) aDes.Length());
+	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EFileWrite3, MODULEUID, Session().Handle(), SubSessionHandle(), aPos, 0, aDes.Length());
+
 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
 	TInt r = SendReceive(EFsFileWrite,TIpcArgs(&aDes,aDes.Length(),aPos));
-	OstTrace1(TRACE_BORDER, EFSRV_EFILEWRITE3RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileWrite3Return, MODULEUID, r);
 	return r;
 	}
 
@@ -1273,10 +1331,11 @@
 @panic FSCLIENT 19 if aPos is negative.                       
 */
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILEWRITE4, "sess %x subs %x aPos %x deslen %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aPos, (TUint) aDes.Length());
+	TRACE6(UTF::EBorder, UTraceModuleEfsrv::EFileWrite4, MODULEUID, Session().Handle(), SubSessionHandle(), aPos, 0, aDes.Length(), &aStatus);
+
 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
 	RSubSessionBase::SendReceive(EFsFileWrite,TIpcArgs(&aDes,aDes.Length(),aPos),aStatus);
-	OstTrace0(TRACE_BORDER, EFSRV_EFILEWRITE4RETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFileWrite4Return, MODULEUID);
 	}
 
 
@@ -1306,10 +1365,12 @@
 @panic FSCLIENT 19 if aPos is negative.                       
 */
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILEWRITE6, "sess %x subs %x aPos %x aLength %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aPos, (TUint) aLength);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFileWrite1, MODULEUID, Session().Handle(), SubSessionHandle(), aLength);
+
 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
 	TInt r = SendReceive(EFsFileWrite,TIpcArgs(&aDes,aLength,aPos));
-	OstTrace1(TRACE_BORDER, EFSRV_EFILEWRITE6RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileWrite1Return, MODULEUID, r);
 	return r;
 	}
 
@@ -1347,10 +1408,11 @@
 @panic FSCLIENT 19 if aPos is negative.                       
 */
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILEWRITE10, "sess %x subs %x aPos %x aLength %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aPos, (TUint) aLength);
+	TRACE6(UTF::EBorder, UTraceModuleEfsrv::EFileWrite2, MODULEUID, Session().Handle(), SubSessionHandle(), aPos, 0, aLength, &aStatus);
+
 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
 	RSubSessionBase::SendReceive(EFsFileWrite,TIpcArgs(&aDes,aLength,aPos),aStatus);
-	OstTrace0(TRACE_BORDER, EFSRV_EFILEWRITE10RETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFileWrite2Return, MODULEUID);
 	}
 
 
@@ -1384,10 +1446,13 @@
 
 */
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILELOCK, "RFile::Lock() sess %x subs %x aPos %x aLength %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aPos, (TUint) aLength);
+	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EFileLock, MODULEUID, Session().Handle(), SubSessionHandle(), aPos, 0, aLength);
+
 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
+
 	TInt r = SendReceive(EFsFileLock,TIpcArgs(aPos,aLength));
-	OstTrace1(TRACE_BORDER, EFSRV_EFILELOCKRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileLockReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -1415,10 +1480,12 @@
 @panic FSCLIENT 19 if aPos is negative. 
 */
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILEUNLOCK, "RFile::UnLock() sess %x subs %x aPos %x aLength %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aPos, (TUint) aLength);
+	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EFileUnLock, MODULEUID, Session().Handle(), SubSessionHandle(), aPos, 0, aLength);
+
 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
 	TInt r = SendReceive(EFsFileUnLock,TIpcArgs(aPos,aLength));
-	OstTrace1(TRACE_BORDER, EFSRV_EFILEUNLOCKRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileUnLockReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -1462,13 +1529,15 @@
         codes.
 */
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILESEEK1, "sess %x subs %x aMode %x aPos %x", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aMode, (TUint) aPos);
+	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EFileSeek, MODULEUID, Session().Handle(), SubSessionHandle(), aMode, aPos, 0);
+
 	TInt64 newPos = aPos;
 	TPckg<TInt64>  pkNewPos(newPos);
 	TInt r = SendReceive(EFsFileSeek|KIpcArgSlot2Desc,TIpcArgs(aPos,aMode,&pkNewPos));
 	if(KErrNone == r)
 		aPos = I64LOW(newPos);
-	OstTrace1(TRACE_BORDER, EFSRV_EFILESEEK1RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileSeekReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -1490,9 +1559,11 @@
         codes.
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILEFLUSH1, "sess %x subs %x status %x", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) NULL);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFileFlush, MODULEUID, Session().Handle(), SubSessionHandle(), NULL);
+
 	TInt r = RSubSessionBase::SendReceive(EFsFileFlush);
-	OstTrace1(TRACE_BORDER, EFSRV_EFILEFLUSH1RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileFlushReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -1514,9 +1585,11 @@
                otherwise one of the other system-wide error codes.
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILEFLUSH2, "sess %x subs %x status %x", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) &aStatus);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFileFlush, MODULEUID, Session().Handle(), SubSessionHandle(), &aStatus);
+
 	RSubSessionBase::SendReceive(EFsFileFlush, aStatus);
-	OstTrace0(TRACE_BORDER, EFSRV_EFILEFLUSH2RETURN, "");
+
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFileFlushReturn, MODULEUID);
 	}
 
 
@@ -1532,7 +1605,8 @@
         codes.
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILESIZE, "sess %x subs %x", (TUint) Session().Handle(), (TUint) SubSessionHandle());
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFileSize, MODULEUID, Session().Handle(), SubSessionHandle());
+
 	TInt64 size = aSize;
 	TPckg<TInt64> pkSize(size);
 	TInt r = SendReceive(EFsFileSize|KIpcArgSlot0Desc,TIpcArgs(&pkSize));
@@ -1543,7 +1617,8 @@
 	if (size > KMaxTInt)
 		return (KErrTooBig);
 #endif
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILESIZERETURN, "r %d aSize %d", (TUint) r, (TUint) aSize);
+
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFileSizeReturn, MODULEUID, r, aSize);
 	return r;
 	}
 
@@ -1575,9 +1650,11 @@
 
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILESETSIZE1, "sess %x subs %x aSize %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aSize);
+	TRACE4(UTF::EBorder, UTraceModuleEfsrv::EFileSetSize, MODULEUID, Session().Handle(), SubSessionHandle(), aSize, 0);
+
 	TInt r = SendReceive(EFsFileSetSize,TIpcArgs(aSize));
-	OstTrace1(TRACE_BORDER, EFSRV_EFILESETSIZE1RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileSetSizeReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -1598,11 +1675,13 @@
 @see KEntryAttNormal        
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILEATT, "sess %x subs %x", (TUint) Session().Handle(), (TUint) SubSessionHandle());
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFileAtt, MODULEUID, Session().Handle(), SubSessionHandle());
+
 	TPtr8 a((TUint8*)&aVal,sizeof(TUint));
 	
 	TInt r = SendReceive(EFsFileAtt,TIpcArgs(&a));
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILEATTRETURN, "r %d aVal %x", (TUint) r, (TUint) aVal);
+
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFileAttReturn, MODULEUID, r, aVal);
 	return r;
 	}
 
@@ -1639,11 +1718,13 @@
 @panic FSCLIENT 21 if the same attribute bit is set in both bitmasks.
 */
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILESETATT, "sess %x subs %x aSetAttMask %x aClearAttMask %x", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aSetAttMask, (TUint) aClearAttMask);
+	TRACE4(UTF::EBorder, UTraceModuleEfsrv::EFileSetAtt, MODULEUID, Session().Handle(), SubSessionHandle(), aSetAttMask, aClearAttMask);
+
 	__ASSERT_ALWAYS((aSetAttMask&aClearAttMask)==0,Panic(EAttributesIllegal));
 
 	TInt r = SendReceive(EFsFileSetAtt,TIpcArgs(aSetAttMask,aClearAttMask));
-	OstTrace1(TRACE_BORDER, EFSRV_EFILESETATTRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileSetAttReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -1660,10 +1741,12 @@
         codes.
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILEMODIFIED, "sess %x subs %x", (TUint) Session().Handle(), (TUint) SubSessionHandle());
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFileModified, MODULEUID, Session().Handle(), SubSessionHandle());
+
 	TPtr8 t((TUint8*)&aTime,sizeof(TTime));
 	TInt r = SendReceive(EFsFileModified,TIpcArgs(&t));
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILEMODIFIEDRETURN, "r %d aTime %x:%x ", (TUint) r, (TUint) I64HIGH(aTime.Int64()), (TUint) I64LOW(aTime.Int64()));
+
+	TRACERET3(UTF::EBorder, UTraceModuleEfsrv::EFileModifiedReturn, MODULEUID, r, I64LOW(aTime.Int64()), I64HIGH(aTime.Int64()));
 	return r;
 	}
 
@@ -1687,10 +1770,12 @@
         codes.
 */
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILESETMODIFIED, "sess %x subs %x aTime %x:%x ", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) I64HIGH(aTime.Int64()), (TUint) I64LOW(aTime.Int64()));
+	TRACE4(UTF::EBorder, UTraceModuleEfsrv::EFileSetModified, MODULEUID, Session().Handle(), SubSessionHandle(), I64LOW(aTime.Int64()), I64HIGH(aTime.Int64()));
+
 	TPtrC8 t((TUint8*)&aTime,sizeof(TTime));
 	TInt r = SendReceive(EFsFileSetModified,TIpcArgs(&t));
-	OstTrace1(TRACE_BORDER, EFSRV_EFILESETMODIFIEDRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileSetModifiedReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -1721,12 +1806,14 @@
 @see RFile::SetAtt
 */
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILESETA, "sess %x subs %x aSetAttMask %x aClearAttMask %x", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aMask, (TUint) aVal);
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILESETB, "aTime %x:%x ", (TUint) I64HIGH(aTime.Int64()), (TUint) I64LOW(aTime.Int64()));
+	TRACE6(UTF::EBorder, UTraceModuleEfsrv::EFileSet, MODULEUID, 
+		Session().Handle(), SubSessionHandle(), I64LOW(aTime.Int64()), I64HIGH(aTime.Int64()), aMask, aVal);
+
 	__ASSERT_ALWAYS((aVal&aMask)==0,Panic(EAttributesIllegal));
 	TPtrC8 t((TUint8*)&aTime,sizeof(TTime));
 	TInt r = SendReceive(EFsFileSet,TIpcArgs(&t,aMask,aVal));
-	OstTrace1(TRACE_BORDER, EFSRV_EFILESETRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileSetReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -1755,11 +1842,13 @@
 
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILECHANGEMODE, "sess %x subs %x aNewMode %x", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aNewMode);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFileChangeMode, MODULEUID, Session().Handle(), SubSessionHandle(), aNewMode);
+
 	if (aNewMode!=EFileShareExclusive && aNewMode!=EFileShareReadersOnly)
 		return(KErrArgument);
 	TInt r = SendReceive(EFsFileChangeMode,TIpcArgs(aNewMode));
-	OstTrace1(TRACE_BORDER, EFSRV_EFILECHANGEMODERETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileChangeModeReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -1805,10 +1894,11 @@
 
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILERENAME, "sess %x subs %x", (TUint) Session().Handle(), (TUint) SubSessionHandle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFILERENAME_ENEWNAME, "NewName %S", aNewName.Ptr(), aNewName.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFileRename, MODULEUID, Session().Handle(), SubSessionHandle(), aNewName);
+
 	TInt r = SendReceive(EFsFileRename,TIpcArgs(&aNewName));
-	OstTrace1(TRACE_BORDER, EFSRV_EFILERENAMERETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileRenameReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -1831,11 +1921,13 @@
 @see RFs::Drive
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILEDRIVE, "sess %x subs %x", (TUint) Session().Handle(), (TUint) SubSessionHandle());
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFileDrive, MODULEUID, Session().Handle(), SubSessionHandle());
+
 	TPckg<TInt> pki(aDriveNumber);
 	TPckg<TDriveInfo> pkdi(aDriveInfo);
 	TInt r = SendReceive(EFsFileDrive,TIpcArgs(&pki,&pkdi));
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILEDRIVERETURN, "r %d driveAtt %x mediaAtt %x type %x", (TUint) r, (TUint) aDriveInfo.iDriveAtt, (TUint) aDriveInfo.iMediaAtt, (TUint) aDriveInfo.iType);
+
+	TRACERET4(UTF::EBorder, UTraceModuleEfsrv::EFileDriveReturn, MODULEUID, r, aDriveInfo.iDriveAtt, aDriveInfo.iMediaAtt, aDriveInfo.iType);
 	return r;
 	}
 
@@ -1852,10 +1944,12 @@
 @see RFs::Unclamp
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILECLAMP, "sess %x subs %x", (TUint) Session().Handle(), (TUint) SubSessionHandle());
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFileClamp, MODULEUID, Session().Handle(), SubSessionHandle());
+
 	TPckg<RFileClamp> pkHandle(aHandle);
 	TInt r = SendReceive(EFsFileClamp,TIpcArgs(& pkHandle));
-	OstTrace1(TRACE_BORDER, EFSRV_EFILECLAMPRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileClampReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -1885,8 +1979,9 @@
 */
 EFSRV_EXPORT_C TInt RFile::BlockMap(SBlockMapInfo& aInfo, TInt64& aStartPos, TInt64 aEndPos, TInt aBlockMapUsage) const
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILEBLOCKMAPA, "sess %x subs %x", (TUint) Session().Handle(), (TUint) SubSessionHandle());
-	OstTraceExt5(TRACE_BORDER, EFSRV_EFILEBLOCKMAPB, "RFile::BlockMap() aStartPos %x:%x aEndPos %x:%x aBlockMapusage %d", (TUint) I64HIGH(aStartPos), (TUint) I64LOW(aStartPos), (TUint) I64HIGH(aEndPos), (TUint) I64LOW(aEndPos), (TUint) aBlockMapUsage);
+	TRACE7(UTF::EBorder, UTraceModuleEfsrv::EFileBlockMap, MODULEUID, 
+		Session().Handle(), SubSessionHandle(), I64LOW(aStartPos), I64HIGH(aEndPos), I64LOW(aEndPos), I64HIGH(aEndPos), aBlockMapUsage);
+
 	SBlockMapArgs args;
 	args.iStartPos = aStartPos;
 	args.iEndPos = aEndPos;
@@ -1895,7 +1990,8 @@
  	TInt r = SendReceive(EFsBlockMap, TIpcArgs(&pkInfo, &pkArgs, aBlockMapUsage));
 	if(r==KErrNone)
 		aStartPos = args.iStartPos;
-	OstTrace1(TRACE_BORDER, EFSRV_EFILEBLOCKMAPRETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileBlockMapReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -1948,12 +2044,11 @@
 */
 EFSRV_EXPORT_C TInt RFile64::Open(RFs& aFs,const TDesC& aName,TUint aFileMode)
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILE64OPEN, "sess %x mode %x", (TUint) aFs.Handle(), (TUint) aFileMode);
-	OstTraceData(TRACE_BORDER, EFSRV_EFILE64OPEN_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFileOpen, MODULEUID, aFs.Handle(), aFileMode, aName);
 	
 	TInt r = CreateSubSession(aFs,EFsFileOpen,TIpcArgs(&aName,aFileMode|EFileBigFile));
 	
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILE64OPENRETURN, "r %d subs %x", (TUint) r, (TUint) SubSessionHandle());
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFileOpenReturn, MODULEUID, r, SubSessionHandle());
 	return r;
 	}
 
@@ -1998,10 +2093,11 @@
 */
 EFSRV_EXPORT_C TInt RFile64::Create(RFs& aFs,const TDesC& aName,TUint aFileMode)
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILE64CREATE, "sess %x mode %x", (TUint) aFs.Handle(), (TUint) aFileMode);
-	OstTraceData(TRACE_BORDER, EFSRV_EFILE64CREATE_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFileCreate, MODULEUID, aFs.Handle(), aFileMode, aName);
+
 	TInt r = CreateSubSession(aFs,EFsFileCreate,TIpcArgs(&aName,aFileMode|EFileBigFile));
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILE64CREATERETURN, "r %d subs %x", (TUint) r, (TUint) SubSessionHandle());
+
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFileCreateReturn, MODULEUID, r, SubSessionHandle());
 	return r;
 	}
 
@@ -2052,10 +2148,11 @@
 */
 EFSRV_EXPORT_C TInt RFile64::Replace(RFs& aFs,const TDesC& aName,TUint aFileMode)
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILE64REPLACE, "sess %x mode %x", (TUint) aFs.Handle(), (TUint) aFileMode);
-	OstTraceData(TRACE_BORDER, EFSRV_EFILE64REPLACE_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFileReplace, MODULEUID, aFs.Handle(), aFileMode, aName);
+
 	TInt r = CreateSubSession(aFs,EFsFileReplace,TIpcArgs(&aName,aFileMode|EFileBigFile));
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILE64REPLACERETURN, "r %d subs %x", (TUint) r, (TUint) SubSessionHandle());
+
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFileReplaceReturn, MODULEUID, r, SubSessionHandle());
 	return r;
 	}
 
@@ -2092,12 +2189,9 @@
 */
 EFSRV_EXPORT_C TInt RFile64::Temp(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode)
 	{
-   	OstTraceExt2(TRACE_BORDER, EFSRV_EFILE64TEMP, "sess %x aMode %x", (TUint) aFs.Handle(), (TUint) aFileMode);
-	OstTraceData(TRACE_BORDER, EFSRV_EFILE64TEMP_EDIRNAME, "Dir %S", aPath.Ptr(), aPath.Length()<<1);
+   	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFileTemp, MODULEUID, aFs.Handle(), aPath, aFileMode);
 	TInt r = CreateSubSession(aFs,EFsFileTemp,TIpcArgs(&aPath,aFileMode|EFileBigFile,&aName));
-	OstTraceData(TRACE_BORDER, EFSRV_EFILE64TEMP_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILE64TEMPRETURN, "r %d subs %x", (TUint) r, (TUint) SubSessionHandle());
-	
+	TRACERETMULT3(UTF::EBorder, UTraceModuleEfsrv::EFileTempReturn, MODULEUID, r, SubSessionHandle(), aName);
 	return r;
 	}
 
@@ -2149,7 +2243,7 @@
 	else
 		r = KErrArgument;
 
-#ifdef OST_TRACE_COMPILER_IN_USE
+#ifdef SYMBIAN_FTRACE_ENABLE
 	TInt handle = NULL;
 	if (aFsHandleIndex == 0)
 		handle = aMsg.Int0();
@@ -2159,27 +2253,31 @@
 		handle = aMsg.Int2();
 	else if (aFsHandleIndex == 3)
 		handle = aMsg.Int3();
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILE64ADOPTFROMCLIENT, "sess %x subs %x aFsHandleIndex %d aFileHandleIndex %d ", (TUint) handle, (TUint) fileHandle, (TUint) aFsHandleIndex, (TUint) aFileHandleIndex);
+	TRACE4(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptFromClient, MODULEUID, handle, fileHandle, aFsHandleIndex, aFileHandleIndex);
 #endif
+
 	if (r != KErrNone)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_EFILE64ADOPTFROMCLIENTRETURN1, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptFromClientReturn, MODULEUID, r);
 		return r;
 		}
+
 	// Duplicates the file server (RFs) session handle identified by an 
 	// existing handle contained in the message slot at index aFsHandleIndex
 	RFs fs;
 	r = fs.Open(aMsg, aFsHandleIndex, KFileServerPolicy);
 	if (r != KErrNone)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_EFILE64ADOPTFROMCLIENTRETURN2, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptFromClientReturn, MODULEUID, r);
 		return r;
 		}
 
 	//return CreateAutoCloseSubSession(fs, EFsFileAdopt, TIpcArgs(fileHandle));
 	// Slot 1: Indicate Large File Supportis required.
 	r = CreateAutoCloseSubSession(fs, EFsFileAdopt, TIpcArgs(fileHandle, KFileAdopt64));
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILE64ADOPTFROMCLIENTRETURN3, "r %d sess %x subs %x", (TUint) r, (TUint) Session().Handle(), (TUint) SubSessionHandle());
+
+	TRACERET3(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptFromClientReturn, MODULEUID, r, Session().Handle(), SubSessionHandle());
+
 	return r;
 	}
 
@@ -2213,19 +2311,22 @@
 */
 EFSRV_EXPORT_C TInt RFile64::AdoptFromServer(TInt aFsHandle, TInt aFileHandle)
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILE64ADOPTFROMSERVER, "sess %x subs %x", (TUint) aFsHandle, (TUint) aFileHandle);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptFromServer, MODULEUID, aFsHandle, aFileHandle);
+
 	RFs fs;
 	TInt r = fs.SetReturnedHandle(aFsHandle, KFileServerPolicy);
 	if (r != KErrNone)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_EFILE64ADOPTFROMSERVERRETURN1, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptFromServerReturn, MODULEUID, r);
 		return r;
 		}
 
 	//return(CreateAutoCloseSubSession(fs, EFsFileAdopt, TIpcArgs(aFileHandle)));
 	// Slot 1: Indicate Large File Supportis required.
 	r = CreateAutoCloseSubSession(fs, EFsFileAdopt, TIpcArgs(aFileHandle, KFileAdopt64));
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILE64ADOPTFROMSERVERRETURN2, "r %d sess %x subs %x", (TUint) r, (TUint) Session().Handle(), (TUint) SubSessionHandle());
+
+	TRACERET3(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptFromServerReturn, MODULEUID, r, Session().Handle(), SubSessionHandle());
+
 	return r;
 	}
 
@@ -2267,10 +2368,11 @@
 	TInt fileHandle;
 	TInt r = User::GetTIntParameter(aFileHandleIndex,  fileHandle);
 
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILE64ADOPTFROMCREATOR, "subs %x aFsHandleIndex %d aFileHandleIndex %d", (TUint) fileHandle, (TUint) aFsHandleIndex, (TUint) aFileHandleIndex);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptFromCreator, MODULEUID, fileHandle, aFsHandleIndex, aFileHandleIndex);
+
 	if (r != KErrNone)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_EFILE64ADOPTFROMCREATORRETURN1, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptFromCreatorReturn, MODULEUID, r);
 		return r;
 		}
 
@@ -2281,14 +2383,16 @@
 	r = fs.Open(aFsHandleIndex, KFileServerPolicy);
 	if (r != KErrNone)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_EFILE64ADOPTFROMCREATORRETURN2, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptFromCreatorReturn, MODULEUID, r);
 		return r;
 		}
 
 	//return(CreateAutoCloseSubSession(fs, EFsFileAdopt, TIpcArgs(fileHandle)));
 	// Slot 1: Indicate Large File Supportis required.
 	r = CreateAutoCloseSubSession(fs, EFsFileAdopt, TIpcArgs(fileHandle, KFileAdopt64));
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILE64ADOPTFROMCREATORRETURN3, "r %d sess %x subs %x", (TUint) r, (TUint) Session().Handle(), (TUint) SubSessionHandle());
+
+	TRACERET3(UTF::EBorder, UTraceModuleEfsrv::EFileAdoptFromCreatorReturn, MODULEUID, r, Session().Handle(), SubSessionHandle());
+
 	return r;
 	}
 
@@ -2327,7 +2431,8 @@
 */
 EFSRV_EXPORT_C TInt RFile64::Read(TInt64 aPos, TDes8& aDes) const
 	{
-	OstTraceExt5(TRACE_BORDER, EFSRV_EFILE64READ8, "RFile::Read() sess %x subs %x aPos %x:%x maxdeslen %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), (TUint) aDes.MaxLength());
+	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EFileRead3, MODULEUID, Session().Handle(), SubSessionHandle(), I64LOW(aPos), I64HIGH(aPos), aDes.MaxLength());
+
 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
 
 	TInt r;
@@ -2340,7 +2445,9 @@
 		TPckgC<TInt64> pkPos(aPos);
  		r = SendReceive(EFsFileRead|KIpcArgSlot2Desc,TIpcArgs(&aDes,aDes.MaxLength(),&pkPos));
 		}
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILE64READ8RETURN, "r %d len %d", (TUint) r, (TUint) aDes.Length());
+
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFileRead3Return, MODULEUID, r, aDes.Length());
+
 	return r;
 	}
 
@@ -2384,7 +2491,8 @@
 */
 EFSRV_EXPORT_C void RFile64::Read(TInt64 aPos, TDes8& aDes, TRequestStatus& aStatus) const
 	{
-	OstTraceExt5(TRACE_BORDER, EFSRV_EFILE64READ10, "RFile::Read() sess %x subs %x aPos %x:%x maxlen %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), (TUint) aDes.MaxLength());
+	TRACE6(UTF::EBorder, UTraceModuleEfsrv::EFileRead4, MODULEUID, Session().Handle(), SubSessionHandle(), I64LOW(aPos), I64HIGH(aPos), aDes.MaxLength(), &aStatus);
+
 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
 	if (!(I64HIGH(aPos+1)))
 		{
@@ -2395,7 +2503,8 @@
 		TPckgC<TInt64> pkPos(aPos);
 		RSubSessionBase::SendReceive(EFsFileRead|KIpcArgSlot2Desc,TIpcArgs(&aDes,aDes.MaxLength(),&pkPos),aStatus);
 		}
-	OstTrace0(TRACE_BORDER, EFSRV_EFILE64READ10RETURN, "");
+
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFileRead4Return, MODULEUID);
 	}
 
 
@@ -2441,7 +2550,8 @@
 */    	
 EFSRV_EXPORT_C TInt RFile64::Read(TInt64 aPos, TDes8& aDes, TInt aLength) const
 	{
-	OstTraceExt5(TRACE_BORDER, EFSRV_EFILE64READ15, "RFile::Read() sess %x subs %x aPos %x:%x aLength %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), (TUint) aLength);
+	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EFileRead3, MODULEUID, Session().Handle(), SubSessionHandle(), I64LOW(aPos), I64HIGH(aPos), aLength);
+
 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
 	if (aLength==0)
 		{
@@ -2463,7 +2573,9 @@
 		TPckgC<TInt64> pkPos(aPos);
 		r = SendReceive(EFsFileRead|KIpcArgSlot2Desc,TIpcArgs(&aDes,aLength,&pkPos));
 		}
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILE64READ15RETURN, "r %d len %d", (TUint) r, (TUint) aDes.Length());
+
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFileRead3Return, MODULEUID, r, aDes.Length());
+
 	return r;
 	}
 
@@ -2516,7 +2628,8 @@
 */
 EFSRV_EXPORT_C void RFile64::Read(TInt64 aPos, TDes8& aDes, TInt aLength,TRequestStatus& aStatus) const
 	{
-	OstTraceExt5(TRACE_BORDER, EFSRV_EFILE64READ11, "RFile::Read() sess %x subs %x aPos %x:%x aLength %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), (TUint) aLength);
+	TRACE6(UTF::EBorder, UTraceModuleEfsrv::EFileRead4, MODULEUID, Session().Handle(), SubSessionHandle(), I64LOW(aPos), I64HIGH(aPos), aLength, &aStatus);
+
 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
 	if (aLength==0)
 		{
@@ -2541,7 +2654,8 @@
 		TPckgC<TInt64> pkPos(aPos);
 		RSubSessionBase::SendReceive(EFsFileRead|KIpcArgSlot2Desc,TIpcArgs(&aDes,aLength,&pkPos),aStatus);
 		}
-	OstTrace0(TRACE_BORDER, EFSRV_EFILE64READ11RETURN, "");
+
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFileRead4Return, MODULEUID);
 	}
 
 
@@ -2573,7 +2687,8 @@
 */
 EFSRV_EXPORT_C TInt RFile64::Write(TInt64 aPos, const TDesC8& aDes)
 	{
-	OstTraceExt5(TRACE_BORDER, EFSRV_EFILE64WRITE13, "RFile::Write() sess %x subs %x aPos %x:%x deslen %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), (TUint) aDes.Length());
+	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EFileWrite3, MODULEUID, Session().Handle(), SubSessionHandle(), I64LOW(aPos), I64HIGH(aPos), aDes.Length());
+
 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
 
 	TInt r;
@@ -2586,7 +2701,8 @@
 		TPckgC<TInt64> pkPos(aPos);
 		r = SendReceive(EFsFileWrite|KIpcArgSlot2Desc,TIpcArgs(&aDes,aDes.Length(),&pkPos));
 		}
-	OstTrace1(TRACE_BORDER, EFSRV_EFILE64WRITE13RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileWrite3Return, MODULEUID, r);
 	return r;
 	}
 
@@ -2624,7 +2740,8 @@
 */
 EFSRV_EXPORT_C void RFile64::Write(TInt64 aPos, const TDesC8& aDes,TRequestStatus& aStatus)
 	{
-	OstTraceExt5(TRACE_BORDER, EFSRV_EFILE64WRITE15, "RFile::Write() sess %x subs %x pos %x:%x len %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), (TUint) aDes.Length());
+	TRACE4(UTF::EBorder, UTraceModuleEfsrv::EFileWrite4, MODULEUID, Session().Handle(), SubSessionHandle(), aDes.Length(), &aStatus);
+
 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
 	
 	if (!(I64HIGH(aPos+1)))
@@ -2636,7 +2753,8 @@
 		TPckgC<TInt64> pkPos(aPos);
 		RSubSessionBase::SendReceive(EFsFileWrite|KIpcArgSlot2Desc,TIpcArgs(&aDes,aDes.Length(),&pkPos),aStatus);
 		}
-	OstTrace0(TRACE_BORDER, EFSRV_EFILE64WRITE15RETURN, "");
+
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFileWrite4Return, MODULEUID);
 	}
 
 
@@ -2668,7 +2786,8 @@
 */
 EFSRV_EXPORT_C TInt RFile64::Write(TInt64 aPos, const TDesC8& aDes,TInt aLength)
 	{
-	OstTraceExt5(TRACE_BORDER, EFSRV_EFILE64WRITE7, "RFile::Write() sess %x subs %x aPos %x:%x aLength %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), (TUint) aLength);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFileWrite1, MODULEUID, Session().Handle(), SubSessionHandle(), aLength);
+
 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
 	
 	TInt r;
@@ -2681,7 +2800,8 @@
 		TPckgC<TInt64> pkPos(aPos);
 		r = SendReceive(EFsFileWrite|KIpcArgSlot2Desc,TIpcArgs(&aDes,aLength,&pkPos));
 		}
-	OstTrace1(TRACE_BORDER, EFSRV_EFILE64WRITE7RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileWrite1Return, MODULEUID, r);
 	return r;
 	}
 
@@ -2721,7 +2841,8 @@
 */
 EFSRV_EXPORT_C void RFile64::Write(TInt64 aPos, const TDesC8& aDes,TInt aLength,TRequestStatus& aStatus)
 	{
-	OstTraceExt5(TRACE_BORDER, EFSRV_EFILE64WRITE11, "RFile::Write() sess %x subs %x aPos %x:%x aLength %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), (TUint) aLength);
+	TRACE6(UTF::EBorder, UTraceModuleEfsrv::EFileWrite2, MODULEUID, Session().Handle(), SubSessionHandle(), I64LOW(aPos), I64HIGH(aPos), aLength, &aStatus);
+
 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
 	
 	if (!(I64HIGH(aPos+1)))
@@ -2733,7 +2854,8 @@
 		TPckgC<TInt64> pkPos(aPos);
 		RSubSessionBase::SendReceive(EFsFileWrite|KIpcArgSlot2Desc,TIpcArgs(&aDes,aLength,&pkPos),aStatus);
 		}
-	OstTrace0(TRACE_BORDER, EFSRV_EFILE64WRITE11RETURN, "");
+
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFileWrite2Return, MODULEUID);
 	}
 
 
@@ -2780,11 +2902,13 @@
 */
 EFSRV_EXPORT_C TInt RFile64::Seek(TSeek aMode, TInt64& aPos) const
 	{
-	OstTraceExt5(TRACE_BORDER, EFSRV_EFILE64SEEK2, "RFile::Seek() sess %x subs %x aMode %x aPos %x:%x", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aMode, (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos));
+	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EFileSeek, MODULEUID, Session().Handle(), SubSessionHandle(), aMode, aPos, 0);
+
 	TPckgC<TInt64> pkOffset(aPos);
 	TPckg<TInt64> pkNewPos(aPos);
  	TInt r = SendReceive(EFsFileSeek|KIpcArgSlot0Desc|KIpcArgSlot2Desc,TIpcArgs(&pkOffset,aMode,&pkNewPos));
-	OstTrace1(TRACE_BORDER, EFSRV_EFILE64SEEK2RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileSeekReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -2806,10 +2930,12 @@
 */
 EFSRV_EXPORT_C TInt RFile64::Size(TInt64& aSize) const
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILE64SIZE2, "sess %x subs %x", (TUint) Session().Handle(), (TUint) SubSessionHandle());
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFileSize2, MODULEUID, Session().Handle(), SubSessionHandle());
+
 	TPckg<TInt64> pkSize(aSize);
 	TInt r = SendReceive(EFsFileSize|KIpcArgSlot0Desc,TIpcArgs(&pkSize));
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFILE64SIZE2RETURN, "r %d aSize %x:%x", (TUint) r, (TUint) I64HIGH(aSize), (TUint) I64LOW(aSize));
+
+	TRACERET3(UTF::EBorder, UTraceModuleEfsrv::EFileSize2Return, MODULEUID, r, I64LOW(aSize), I64HIGH(aSize));
 	return r;
 	}
 
@@ -2845,10 +2971,12 @@
 */
 EFSRV_EXPORT_C TInt RFile64::SetSize(TInt64 aSize)
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILE64SETSIZE2, "sess %x subs %x aSize %x:%x", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) I64HIGH(aSize), (TUint) I64LOW(aSize));
+	TRACE4(UTF::EBorder, UTraceModuleEfsrv::EFileSetSize, MODULEUID, Session().Handle(), SubSessionHandle(), I64LOW(aSize), I64HIGH(aSize));
+
 	TPckgC<TInt64> pkSize(aSize);
 	TInt r = SendReceive(EFsFileSetSize|KIpcArgSlot0Desc, TIpcArgs(&pkSize));
-	OstTrace1(TRACE_BORDER, EFSRV_EFILE64SETSIZE2RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileSetSizeReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -2885,7 +3013,8 @@
 */
 EFSRV_EXPORT_C TInt RFile64::Lock(TInt64 aPos, TInt64 aLength) const
 	{
-	OstTraceExt5(TRACE_BORDER, EFSRV_EFILE64LOCK, "RFile::Lock() sess %x subs %x aPos %x:%x aLength %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), (TUint) aLength);
+	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EFileLock, MODULEUID, Session().Handle(), SubSessionHandle(), I64LOW(aPos), I64HIGH(aPos), aLength);
+
 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
 	TPckgC<TInt64> pkPos(aPos);
 	TPckgC<TInt64> pkLength(aLength);
@@ -2900,7 +3029,7 @@
 		r = SendReceive(EFsFileLock|KIpcArgSlot0Desc,TIpcArgs(&pkPos, I64LOW(aLength)));
 	else 
 		r = SendReceive(EFsFileLock|KIpcArgSlot0Desc|KIpcArgSlot1Desc,TIpcArgs(&pkPos, &pkLength));
-	OstTrace1(TRACE_BORDER, EFSRV_EFILE64LOCKRETURN, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileLockReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -2931,7 +3060,8 @@
 */
 EFSRV_EXPORT_C TInt RFile64::UnLock(TInt64 aPos, TInt64 aLength) const
 	{
-	OstTraceExt5(TRACE_BORDER, EFSRV_EFILE64UNLOCK, "RFile::UnLock() sess %x subs %x aPos %x:%x aLength %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), (TUint) aLength);
+	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EFileUnLock, MODULEUID, Session().Handle(), SubSessionHandle(), I64LOW(aPos), I64HIGH(aPos), aLength);
+
 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
 	
 	TPckgC<TInt64> pkPos(aPos);
@@ -2948,7 +3078,7 @@
 	else 
 		r = SendReceive(EFsFileUnLock|KIpcArgSlot0Desc|KIpcArgSlot1Desc,TIpcArgs(&pkPos, &pkLength));
 	
-	OstTrace1(TRACE_BORDER, EFSRV_EFILE64UNLOCKRETURN, "r %d", r);
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileUnLockReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -2992,7 +3122,8 @@
 */
 EFSRV_EXPORT_C TInt RFile64::Read(TUint aPos,TDes8& aDes) const
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILE64READ14, "sess %x subs %x aPos %x maxlen %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aPos, (TUint) aDes.MaxLength());
+	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EFileRead3, MODULEUID, Session().Handle(), SubSessionHandle(), aPos, 0, aDes.MaxLength());
+
 	TInt r;
 	if(!(aPos + 1))
 		{
@@ -3004,7 +3135,9 @@
 		TPckgC<TInt64> pkPos(pos);
  		r = SendReceive(EFsFileRead|KIpcArgSlot2Desc,TIpcArgs(&aDes,aDes.MaxLength(),&pkPos));
 		}
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILE64READ14RETURN, "r %d len %d", (TUint) r, (TUint) aDes.Length());
+
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFileRead3Return, MODULEUID, r, aDes.Length());
+
 	return r;
 	}
 
@@ -3053,7 +3186,8 @@
 */
 EFSRV_EXPORT_C void RFile64::Read(TUint aPos,TDes8& aDes,TRequestStatus& aStatus) const
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILE64READ12, "sess %x subs %x aPos %x maxlen %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aPos, (TUint) aDes.MaxLength());
+	TRACE6(UTF::EBorder, UTraceModuleEfsrv::EFileRead4, MODULEUID, Session().Handle(), SubSessionHandle(), aPos, 0, aDes.MaxLength(), &aStatus);
+
 	if(!(aPos + 1))
 		{
 		RSubSessionBase::SendReceive(EFsFileRead,TIpcArgs(&aDes,aDes.MaxLength(),aPos),aStatus);
@@ -3064,7 +3198,8 @@
 		TPckgC<TInt64> pkPos(pos);
 		RSubSessionBase::SendReceive(EFsFileRead|KIpcArgSlot2Desc,TIpcArgs(&aDes,aDes.MaxLength(),&pkPos),aStatus);
 		}
-	OstTrace0(TRACE_BORDER, EFSRV_EFILE64READ12RETURN, "");
+
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFileRead4Return, MODULEUID);
 	}
 
 
@@ -3116,7 +3251,8 @@
 */    
 EFSRV_EXPORT_C TInt RFile64::Read(TUint aPos,TDes8& aDes,TInt aLength) const
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILE64READ16, "sess %x subs %x aPos %x aLength %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aPos, (TUint) aLength);
+	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EFileRead3, MODULEUID, Session().Handle(), SubSessionHandle(), aPos, 0, aLength);
+
 	if (aLength==0)
 		{
 		aDes.Zero();
@@ -3138,7 +3274,9 @@
 		TPckgC<TInt64> pkPos(pos);
 		r = SendReceive(EFsFileRead|KIpcArgSlot2Desc,TIpcArgs(&aDes,aLength,&pkPos));
 		}
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFILE64READ16RETURN, "r %d len %d", (TUint) r, (TUint) aDes.Length());
+
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFileRead3Return, MODULEUID, r, aDes.Length());
+
 	return r;
 	}
 
@@ -3197,7 +3335,8 @@
 */
 EFSRV_EXPORT_C void RFile64::Read(TUint aPos,TDes8& aDes,TInt aLength,TRequestStatus& aStatus) const
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILE64READ13, "sess %x subs %x aPos %x aLength %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aPos, (TUint) aLength);
+	TRACE6(UTF::EBorder, UTraceModuleEfsrv::EFileRead4, MODULEUID, Session().Handle(), SubSessionHandle(), aPos, 0, aLength, &aStatus);
+
 	if (aLength==0)
 		{
 		aDes.Zero();
@@ -3222,7 +3361,8 @@
 		TPckgC<TInt64> pkPos(pos);
 		RSubSessionBase::SendReceive(EFsFileRead|KIpcArgSlot2Desc,TIpcArgs(&aDes,aLength,&pkPos),aStatus);
 		}
-	OstTrace0(TRACE_BORDER, EFSRV_EFILE64READ13RETURN, "");
+
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFileRead4Return, MODULEUID);
 	}
 
 
@@ -3260,7 +3400,8 @@
 */
 EFSRV_EXPORT_C TInt RFile64::Write(TUint aPos,const TDesC8& aDes)
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILE64WRITE14, "sess %x subs %x aPos %x len %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aPos, (TUint) aDes.Length());
+	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EFileWrite3, MODULEUID, Session().Handle(), SubSessionHandle(), aPos, 0, aDes.Length());
+
 	TInt r;
 	if(!(aPos + 1))
 		{
@@ -3272,7 +3413,8 @@
 		TPckgC<TInt64> pkPos(pos);
 		r = SendReceive(EFsFileWrite|KIpcArgSlot2Desc,TIpcArgs(&aDes,aDes.Length(),&pkPos));
 		}
-	OstTrace1(TRACE_BORDER, EFSRV_EFILE64WRITE14RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileWrite3Return, MODULEUID, r);
 	return r;
 	}
 
@@ -3316,7 +3458,8 @@
 */
 EFSRV_EXPORT_C void RFile64::Write(TUint aPos,const TDesC8& aDes,TRequestStatus& aStatus)
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILE64WRITE16, "sess %x subs %x pos %x len %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aPos, (TUint) aDes.Length());
+	TRACE6(UTF::EBorder, UTraceModuleEfsrv::EFileWrite4, MODULEUID, Session().Handle(), SubSessionHandle(), aPos, 0, aDes.Length(), &aStatus);
+
 	if(!(aPos + 1))
 		{
 		RSubSessionBase::SendReceive(EFsFileWrite,TIpcArgs(&aDes,aDes.Length(),aPos),aStatus);
@@ -3327,7 +3470,7 @@
 		TPckgC<TInt64> pkPos(pos);
 		RSubSessionBase::SendReceive(EFsFileWrite|KIpcArgSlot2Desc,TIpcArgs(&aDes,aDes.Length(),&pkPos),aStatus);
 		}
-	OstTrace0(TRACE_BORDER, EFSRV_EFILE64WRITE16RETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFileWrite4Return, MODULEUID);
 	}
 
 
@@ -3365,7 +3508,8 @@
 */
 EFSRV_EXPORT_C TInt RFile64::Write(TUint aPos,const TDesC8& aDes,TInt aLength)
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILE64WRITE8, "sess %x subs %x aPos %x aLength %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aPos, (TUint) aLength);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFileWrite1, MODULEUID, Session().Handle(), SubSessionHandle(), aLength);
+
 	TInt r;
 	if(!(aPos + 1))
 		{
@@ -3377,7 +3521,8 @@
 		TPckgC<TInt64> pkPos(pos);
 		r = SendReceive(EFsFileWrite|KIpcArgSlot2Desc,TIpcArgs(&aDes,aLength,&pkPos));
 		}
-	OstTrace1(TRACE_BORDER, EFSRV_EFILE64WRITE8RETURN, "r %d", r);
+
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFileWrite1Return, MODULEUID, r);
 	return r;
 	}
 
@@ -3424,7 +3569,8 @@
 */
 EFSRV_EXPORT_C void RFile64::Write(TUint aPos,const TDesC8& aDes,TInt aLength,TRequestStatus& aStatus)
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EFILE64WRITE12, "sess %x subs %x aPos %x len %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aPos, (TUint) aLength);
+	TRACE6(UTF::EBorder, UTraceModuleEfsrv::EFileWrite2, MODULEUID, Session().Handle(), SubSessionHandle(), aPos, 0, aLength, &aStatus);
+
 	if(!(aPos + 1))
 		{
 		RSubSessionBase::SendReceive(EFsFileWrite,TIpcArgs(&aDes,aLength,aPos),aStatus);
@@ -3435,7 +3581,7 @@
 		TPckgC<TInt64> pkPos(pos);
 		RSubSessionBase::SendReceive(EFsFileWrite|KIpcArgSlot2Desc,TIpcArgs(&aDes,aLength,&pkPos),aStatus);
 		}
-	OstTrace0(TRACE_BORDER, EFSRV_EFILE64WRITE12RETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFileWrite2Return, MODULEUID);
 	}
 #else
 EFSRV_EXPORT_C TInt RFile64::Open(RFs& /*aFs*/,const TDesC& /*aName*/,TUint /*aFileMode*/)
--- a/userlibandfileserver/fileserver/sfsrv/cl_fman.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfsrv/cl_fman.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -15,10 +15,21 @@
 
 #include "cl_std.h"
 
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "cl_fmanTraces.h"
-#endif
-
+#define RETURNIFERROR(a,b,t)  					\
+	{											\
+	if ((a=b)!=KErrNone)						\
+		{										\
+		if(iStatus)								\
+			User::RequestComplete(iStatus,a);	\
+		TInt _t = t;							\
+		if (_t)	{TRACE1(UTF::EBorder, t, MODULEUID, a);}	\
+		return(a);								\
+		}										\
+	}
+
+#define RETURNIFERRORD(a,b,t)  		 			\
+	TInt a; 									\
+	RETURNIFERROR(a,b,t)
 
 const TUint KRecurseFlag	=	0x40000000;
 const TUint KScanDownFlag	=	0x20000000;
@@ -517,14 +528,14 @@
 @return Newly created CFileMan object.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANNEWL1, "sess %x", aFs.Handle());
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECFileManNewL1, MODULEUID, aFs.Handle());
 
 	CFileMan* fileMan=new(ELeave) CFileMan(aFs);
 	CleanupStack::PushL(fileMan);
 	fileMan->CFileBase::ConstructL();
 	CleanupStack::Pop();
 
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANNEWL1RETURN, "CFileMan* %x", fileMan);
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECFileManNewL1Return, MODULEUID, fileMan);
 	return fileMan;
 	}
 
@@ -541,7 +552,7 @@
 @return Newly created CFileMan object.
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_ECFILEMANNEWL2, "sess %x anObserver %x", (TUint) aFs.Handle(), (TUint) anObserver);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::ECFileManNewL2, MODULEUID, aFs.Handle(), anObserver);
 
 	CFileMan* fileMan=new(ELeave) CFileMan(aFs);
 	CleanupStack::PushL(fileMan);
@@ -549,7 +560,7 @@
 	CleanupStack::Pop();
 	fileMan->SetObserver(anObserver);
 
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANNEWL2RETURN, "CFileMan* %x", fileMan);
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECFileManNewL2Return, MODULEUID, fileMan);
 	return fileMan;
 	}
 
@@ -565,9 +576,9 @@
 	}
 CFileMan::~CFileMan()
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANDESTRUCTOR, "this %x", this);
-
-	OstTrace0(TRACE_BORDER, EFSRV_ECFILEMANDESTRUCTORRETURN, "");
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECFileManDestructor, MODULEUID, this);
+
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::ECFileManDestructorReturn, MODULEUID);
 	}
 
 
@@ -578,7 +589,7 @@
 @return The action which CFileMan is carrying out.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCURRENTACTION, "this %x", this);
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECFileManCurrentAction, MODULEUID, this);
 
 	TAction action = ENone;
 
@@ -617,7 +628,7 @@
 		Panic(EFManUnknownAction);
 		}
 
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCURRENTACTIONRETURN, "action %d", action);
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECFileManCurrentActionReturn, MODULEUID, action);
 	return (action);
 	}
 
@@ -635,12 +646,11 @@
                 the current CFileMan operation
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANGETCURRENTTARGET, "this %x", this);
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECFileManGetCurrentTarget, MODULEUID, this);
 
 	GetSrcAndTrg(iTmpParse, aTrgName);
 
-	OstTrace0(TRACE_BORDER, EFSRV_ECFILEMANGETCURRENTTARGETRETURN, "");
-	OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANGETCURRENTTARGET_EFILENAME, "FileName %S", aTrgName.Ptr(), aTrgName.Length()<<1);
+	TRACEMULT1(UTF::EBorder, UTraceModuleEfsrv::ECFileManGetCurrentTargetReturn, MODULEUID, aTrgName);
 	}
 
 
@@ -657,14 +667,13 @@
                 CFileMan operation.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANGETCURRENTSOURCE, "this %x", this);
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECFileManGetCurrentSource, MODULEUID, this);
 
     TPtrC fullPath(FullPath());
 	iTmpParse.Set(CurrentEntry().iName, &fullPath, NULL);
 	aSrcName = iTmpParse.FullName();
 
-	OstTrace0(TRACE_BORDER, EFSRV_ECFILEMANGETCURRENTSOURCERETURN, "");
-	OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANGETCURRENTSOURCE_EFILENAME, "FileName %S", aSrcName.Ptr(), aSrcName.Length()<<1);
+	TRACEMULT1(UTF::EBorder, UTraceModuleEfsrv::ECFileManGetCurrentSourceReturn, MODULEUID, aSrcName);
 	}
 
 void CFileMan::GetSrcAndTrg(TParse& aSrcName,TFileName& aTrgName)
@@ -725,7 +734,7 @@
 @return The number of bytes transferred.
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_ECFILEMANBYTESTRANSFERREDBYCOPYSTEP, "this %x BytesTransferred %d", (TUint) this, (TUint) iBytesTransferred);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::ECFileManBytesTransferredByCopyStep, MODULEUID, this, iBytesTransferred);
 
 	return(iBytesTransferred);
 	}
@@ -895,9 +904,8 @@
 
 */
 	{
-	OstTraceExt5(TRACE_BORDER, EFSRV_ECFILEMANATTRIBS1A, "this %x aSetMask %x aClearMask %x aSwitches %d status %x", (TUint) this, (TUint) aSetMask, (TUint) aClearMask, (TUint) aSwitches, (TUint) &aStatus);
-	OstTraceExt2(TRACE_BORDER, EFSRV_ECFILEMANATTRIBS1B, "aTime %x:%x ", (TUint) I64HIGH(aTime.Int64()), (TUint) I64LOW(aTime.Int64()));
-	OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANATTRIBS1A_EFILEPATH, "FilePath %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT8(UTF::EBorder, UTraceModuleEfsrv::ECFileManAttribs1, MODULEUID,
+		(TUint) this, aName, aSetMask, aClearMask, I64LOW(aTime.Int64()), I64HIGH(aTime.Int64()), aSwitches, (TUint) &aStatus);
 
 	TInt r;
 	if (iSwitches&KFManBusyFlag)
@@ -910,8 +918,7 @@
 		r = Attribs(aName,aSetMask,aClearMask,aTime,aSwitches);
 		}
 
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANATTRIBS1RETURN, "r %d", r);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManAttribs1Return, MODULEUID, r);
 	return r;
 	}
 
@@ -967,9 +974,8 @@
 
 */
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_ECFILEMANATTRIBS2A, "this %x aSetMask %x aClearMask %x aSwitches %x", (TUint) this, (TUint) aSetMask, (TUint) aClearMask, (TUint) aSwitches);
-	OstTraceExt2(TRACE_BORDER, EFSRV_ECFILEMANATTRIBS2B, "aTime %x:%x ", (TUint) I64HIGH(aTime.Int64()), (TUint) I64LOW(aTime.Int64()));
-	OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANATTRIBS2A_EFILEPATH, "FilePath %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT7(UTF::EBorder, UTraceModuleEfsrv::ECFileManAttribs2, MODULEUID,
+		(TUint) this, aName, aSetMask, aClearMask, I64LOW(aTime.Int64()), I64HIGH(aTime.Int64()), aSwitches);
 
 	TInt ret;
 	if (iSwitches&KFManBusyFlag)
@@ -979,15 +985,7 @@
 	else
 		{
 		SetFlags(aSwitches&EOverWrite,aSwitches&ERecurse,ETrue,EFalse);
-		TInt r;
-		if ((r = iFs.Parse(aName,iSrcFile)) != KErrNone)
-			{
-			if(iStatus)
-				User::RequestComplete(iStatus,r);
-			OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANATTRIBS2RETURN1, "r %d", r);
-			return r;
-			}
-
+		RETURNIFERRORD(r,iFs.Parse(aName,iSrcFile),UTraceModuleEfsrv::ECFileManAttribs2Return);
 		iSetMask=aSetMask;
 		iClearMask=aClearMask;
 		iTime=aTime;
@@ -999,8 +997,7 @@
 		DoSynchronize(r);
 		}
 
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANATTRIBS2RETURN2, "r %d", ret);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManAttribs2Return, MODULEUID, ret);
 	return(ret);
 	}
 
@@ -1040,9 +1037,8 @@
 
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_ECFILEMANCOPY1, "this %x aSwitches %x status %x", (TUint) this, (TUint) aSwitches, (TUint) &aStatus);
-	OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANCOPY1_EOLDNAME, "OldName %S", anOld.Ptr(), anOld.Length()<<1);
-	OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANCOPY1_ENEWNAME, "NewName %S", aNew.Ptr(), aNew.Length()<<1);
+	TRACEMULT5(UTF::EBorder, UTraceModuleEfsrv::ECFileManCopy1, MODULEUID,
+		(TUint) this, anOld, aNew, aSwitches, (TUint) &aStatus);
 
 	TInt r;
 	if (iSwitches&KFManBusyFlag)
@@ -1053,8 +1049,7 @@
 		r = Copy(anOld,aNew,aSwitches);
 		}
 
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCOPY1RETURN, "r %d", r);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManCopy1Return, MODULEUID, r);
 	return(r);
 	}
 
@@ -1094,7 +1089,7 @@
 including any directories in the path specified by aNew which do not
 already exist.
 
-If the source (anOld) is a FILE and the recursive operation is set,
+If the source (anOld) is a file and the recursive operation is set,
 then all the files with the same name as anOld in the source directory
 including those in subdirectories will be copied to the destination.
 
@@ -1183,38 +1178,21 @@
 
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_ECFILEMANCOPY2, "this %x aSwitches %d", (TUint) this, (TUint) aSwitches);
-	OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANCOPY2_EOLDNAME, "OldName %S", anOld.Ptr(), anOld.Length()<<1);
-	OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANCOPY2_ENEWNAME, "NewName %S", aNew.Ptr(), aNew.Length()<<1);
+	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::ECFileManCopy2, MODULEUID, (TUint) this, anOld, aNew, aSwitches);
 
 	if (iSwitches&KFManBusyFlag)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCOPY2RETURN1, "r %d", KErrInUse);
+		TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECFileManCopy2Return, MODULEUID, KErrInUse);
 		return(KErrInUse);
 		}
 	SetFlags(aSwitches&EOverWrite,aSwitches&ERecurse,ETrue,EFalse);
-	TInt r;
-	if ((r = iFs.Parse(anOld,iSrcFile)) != KErrNone)
-		{
-		if(iStatus)
-			User::RequestComplete(iStatus,r);
-		OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCOPY2RETURN2, "r %d", r);
-		return r;
-		}
-
-	if ((r = iFs.Parse(aNew,_L("*"),iTrgFile)) != KErrNone)
-		{
-		if(iStatus)
-			User::RequestComplete(iStatus,r);
-		OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCOPY2RETURN3, "r %d", r);
-		return r;
-		}
-
+	RETURNIFERRORD(r,iFs.Parse(anOld,iSrcFile),UTraceModuleEfsrv::ECFileManCopy2Return);
+	RETURNIFERROR(r,iFs.Parse(aNew,_L("*"),iTrgFile),UTraceModuleEfsrv::ECFileManCopy2Return);
 	CheckForDirectory();
 
 	if((iSwitches&KRecurseFlag) && iTrgFile.DriveAndPath().MatchF(iSrcFile.FullName()) != KErrNotFound)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCOPY2RETURN4, "r %d", KErrArgument);
+		TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECFileManCopy2Return, MODULEUID, KErrArgument);
 		return(KErrArgument);
 		}
 
@@ -1225,8 +1203,7 @@
 	TInt ret=(r==KErrNone) ? iLastError : r;
 	DoSynchronize(r);
 
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCOPY2RETURN5, "r %d", ret);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManCopy2Return, MODULEUID, ret);
 	return(ret);
 	}
 
@@ -1266,8 +1243,7 @@
 @see KNullDesC
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_ECFILEMANDELETE1, "this %x aSwitches %x status %x", (TUint) this, (TUint) aSwitches, (TUint) &aStatus);
-	OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANDELETE1_EFILEPATH, "FilePath %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::ECFileManDelete1, MODULEUID, (TUint) this, aName, aSwitches, (TUint) &aStatus);
 
 	TInt r;
 	if (iSwitches&KFManBusyFlag)
@@ -1280,8 +1256,7 @@
 		r = Delete(aName,aSwitches);
 		}
 
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANDELETE1RETURN, "r %d", r);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManDelete1Return, MODULEUID, r);
 	return(r);
 	}
 
@@ -1328,8 +1303,7 @@
 @see KNullDesC
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_ECFILEMANDELETE2, "this %x aSwitches %d", (TUint) this, (TUint) aSwitches);
-	OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANDELETE2_EFILEPATH, "FilePath %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::ECFileManDelete2, MODULEUID, (TUint) this, aName, aSwitches);
 
 	TInt ret;
 	if (iSwitches&KFManBusyFlag)
@@ -1339,15 +1313,7 @@
 	else
 		{
 		SetFlags(aSwitches&EOverWrite,aSwitches&ERecurse,ETrue,EFalse);
-		TInt r;
-		if ((r = iFs.Parse(aName,iSrcFile)) != KErrNone)
-			{
-			if(iStatus)
-				User::RequestComplete(iStatus,r);
-			OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANDELETE2RETURN1, "() r %d", r);
-			return r;
-			}
-
+		RETURNIFERRORD(r,iFs.Parse(aName,iSrcFile),UTraceModuleEfsrv::ECFileManDelete2Return);
 		iAction = EInternalDelete;
 		iMatchEntry=KEntryAttHidden|KEntryAttMatchExclude|KEntryAttDir;
 	//	Exclude directories and system files - include hidden files
@@ -1357,8 +1323,7 @@
 		DoSynchronize(r);
 		}
 
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANDELETE2RETURN2, "() r %d", ret);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManDelete2Return, MODULEUID, ret);
 	return(ret);
 	}
 
@@ -1402,9 +1367,8 @@
 
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_ECFILEMANMOVE1, "this %x aSwitches %x status %x", (TUint) this, (TUint) aSwitches, (TUint) &aStatus);
-	OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANMOVE1_EOLDNAME, "OldName %S", anOld.Ptr(), anOld.Length()<<1);
-	OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANMOVE1_ENEWNAME, "NewName %S", aNew.Ptr(), aNew.Length()<<1);
+	TRACEMULT5(UTF::EBorder, UTraceModuleEfsrv::ECFileManMove1, MODULEUID,
+		(TUint) this, anOld, aNew, aSwitches, (TUint) &aStatus);
 
 	TInt r;
 	if (iSwitches&KFManBusyFlag)
@@ -1417,8 +1381,7 @@
 		r = Move(anOld,aNew,aSwitches);
 		}
 
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANMOVE1RETURN, "r %d", r);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManMove1Return, MODULEUID, r);
 	return r;
 	}
 
@@ -1498,7 +1461,7 @@
 fm->Move(_L("C:\\a\\b"), _L("C:\\x\\y\\"), CFileMan::ERecurse);
 @endcode
 
-If the source (anOld) is a FILE and the recursive operation is set,
+If the source (anOld) is a file and the recursive operation is set,
 then all the files with the same name as anOld in the source directory
 including those in subdirectories will be moved to the destination.
 
@@ -1558,36 +1521,20 @@
 @see CFileBase::GetLastError()
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_ECFILEMANMOVE2, "this %x aSwitches %d", (TUint) this, (TUint) aSwitches);
-	OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANMOVE2_EOLDNAME, "OldName %S", anOld.Ptr(), anOld.Length()<<1);
-	OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANMOVE2_ENEWNAME, "NewName %S", aNew.Ptr(), aNew.Length()<<1);
+	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::ECFileManMove2, MODULEUID,
+		(TUint) this, anOld, aNew, aSwitches);
 
 
 	if (iSwitches&KFManBusyFlag)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANMOVE2RETURN1, "r %d", KErrInUse);
+		TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECFileManMove2Return, MODULEUID, KErrInUse);
 		return(KErrInUse);
 		}
 
 	iNumberOfFilesProcessed = 0;
 
-	TInt r;
-	if ((r = iFs.Parse(anOld,iSrcFile)) != KErrNone)
-		{
-		if(iStatus)
-			User::RequestComplete(iStatus,r);
-		OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANMOVE2RETURN2, "r %d", r);
-		return r;
-		}
-
-	if ((r = iFs.Parse(aNew,_L("*"),iTrgFile)) != KErrNone)
-		{
-		if(iStatus)
-			User::RequestComplete(iStatus,r);
-		OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANMOVE2RETURN3, "r %d", r);
-		return r;
-		}
-
+	RETURNIFERRORD(r,iFs.Parse(anOld,iSrcFile),UTraceModuleEfsrv::ECFileManMove2Return);
+	RETURNIFERROR(r,iFs.Parse(aNew,_L("*"),iTrgFile),UTraceModuleEfsrv::ECFileManMove2Return);
 
 	TInt ret = KErrNone;
 	TBool aComplete = EFalse;
@@ -1606,7 +1553,7 @@
 			{
 			User::RequestComplete(iStatus, ret);
 			}
-		OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANMOVE2RETURN4, "r %d", ret);
+		TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManMove2Return, MODULEUID, ret);
 		return(ret);
 		}
 
@@ -1621,8 +1568,7 @@
 	ret = (r==KErrNone) ? iLastError : r;
 	DoSynchronize(r);
 
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANMOVE2RETURN5, "r %d", ret);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManMove2Return, MODULEUID, ret);
 	return(ret);
 	}
 
@@ -1926,6 +1872,15 @@
 	return(KErrNone);
 	}
 
+TInt CFileMan::RenameInvalidEntry(const TDesC& /*aName*/,const TDesC& /*aNewName*/,TUint /*aSwitches*/)
+//
+// Start rename operation
+//
+	{
+	return KErrNotSupported;
+	}
+
+
 
 
 EXPORT_C TInt CFileMan::Rename(const TDesC& aName,const TDesC& aNewName,TUint aSwitches,TRequestStatus& aStatus)
@@ -1960,9 +1915,8 @@
 
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_ECFILEMANRENAME1, "this %x aSwitches %x status %x", (TUint) this, (TUint) aSwitches, (TUint) &aStatus);
-	OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANRENAME1_EOLDNAME, "OldName %S", aName.Ptr(), aName.Length()<<1);
-	OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANRENAME1_ENEWNAME, "NewName %S", aNewName.Ptr(), aNewName.Length()<<1);
+	TRACEMULT5(UTF::EBorder, UTraceModuleEfsrv::ECFileManRename1, MODULEUID,
+		(TUint) this, aName, aNewName, aSwitches, (TUint) &aStatus);
 
 	TInt r;
 	if (iSwitches&KFManBusyFlag)
@@ -1975,8 +1929,7 @@
 		r = Rename(aName,aNewName,aSwitches);
 		}
 
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANRENAME1RETURN, "r %d", r);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManRename1Return, MODULEUID, r);
 	return(r);
 	}
 
@@ -2142,9 +2095,8 @@
 
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_ECFILEMANRENAME2, "this %x aSwitches %d", (TUint) this, (TUint) aSwitches);
-	OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANRENAME2_EOLDNAME, "OldName %S", aName.Ptr(), aName.Length()<<1);
-	OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANRENAME2_ENEWNAME, "NewName %S", aNewName.Ptr(), aNewName.Length()<<1);
+	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::ECFileManRename2, MODULEUID,
+		(TUint) this, aName, aNewName, aSwitches);
 
 	TInt ret;
 	if (iSwitches&KFManBusyFlag)
@@ -2154,22 +2106,8 @@
 	else
 		{
 		SetFlags(aSwitches&EOverWrite,EFalse,ETrue,EFalse);
-		TInt r;
-		if ((r = iFs.Parse(aName,iSrcFile)) != KErrNone)
-			{
-			if(iStatus)
-				User::RequestComplete(iStatus,r);
-			OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANRENAME2RETURN1, "r %d", r);
-			return r;
-			}
-
-		if ((r = iFs.Parse(aNewName,_L("*"),iTrgFile)) != KErrNone)
-			{
-			if(iStatus)
-				User::RequestComplete(iStatus,r);
-			OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANRENAME2RETURN2, "r %d", r);
-			return r;
-			}
+		RETURNIFERRORD(r,iFs.Parse(aName,iSrcFile),UTraceModuleEfsrv::ECFileManRename2Return);
+		RETURNIFERROR(r,iFs.Parse(aNewName,_L("*"),iTrgFile),UTraceModuleEfsrv::ECFileManRename2Return);
 
 		iAction = EInternalRename;
 		iMatchEntry=KEntryAttMaskSupported;
@@ -2179,8 +2117,7 @@
 		DoSynchronize(r);
 		}
 
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANRENAME2RETURN3, "r %d", ret);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManRename2Return, MODULEUID, ret);
 	return(ret);
 	}
 
@@ -2210,8 +2147,7 @@
 
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_ECFILEMANRMDIR1, "this %x status %x", (TUint) this, (TUint) &aStatus);
-	OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANRMDIR1_EDIRNAME, "Dir %S", aDirName.Ptr(), aDirName.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::ECFileManRmDir1, MODULEUID, (TUint) this, aDirName, (TUint) &aStatus);
 
 	TInt r;
 	if (iSwitches&KFManBusyFlag)
@@ -2224,8 +2160,7 @@
 		r = RmDir(aDirName);
 		}
 
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANRMDIR1RETURN, "r %d", r);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManRmDir1Return, MODULEUID, r);
 	return r;
 	}
 
@@ -2260,8 +2195,7 @@
 
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANRMDIR2, "this %x", (TUint) this);
-	OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANRMDIR2_EDIRNAME, "Dir %S", aDirName.Ptr(), aDirName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::ECFileManRmDir2, MODULEUID, (TUint) this, aDirName);
 
 	TInt ret;
 	if (iSwitches&KFManBusyFlag)
@@ -2271,15 +2205,7 @@
 	else
 		{
 		SetFlags(ETrue,ETrue,EFalse,EFalse);
-		TInt r;
-		if ((r = iFs.Parse(aDirName,iTrgFile)) != KErrNone)
-			{
-			if(iStatus)
-				User::RequestComplete(iStatus,r);
-			OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANRMDIR2RETURN1, "r %d", r);
-			return r;
-			}
-
+		RETURNIFERRORD(r,iFs.Parse(aDirName,iTrgFile),UTraceModuleEfsrv::ECFileManRmDir2Return);
 		iSrcFile.Set(iTrgFile.DriveAndPath(),NULL,NULL);
 		iAction = EInternalRmDir;
 		iMatchEntry=KEntryAttMaskSupported;
@@ -2289,8 +2215,7 @@
 		ret = (r!=KErrNone) ? iLastError : KErrNone;
 		}
 
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANRMDIR2RETURN2, "r %d", ret);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManRmDir2Return, MODULEUID, ret);
 	return ret;
 	}
 
@@ -2688,8 +2613,8 @@
 @capability Dependent If the path for aNew begins with /Resource then Tcb capability is required.
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_ECFILEMANCOPY3, "this %x anOldSubs %x aSwitches %x", (TUint) this, (TUint) anOld.SubSessionHandle(), (TUint) aSwitches);
-	OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANCOPY3_ENEWNAME, "NewName %S", aNew.Ptr(), aNew.Length()<<1);
+	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::ECFileManCopy3, MODULEUID,
+		(TUint) this, anOld.SubSessionHandle(), aNew, aSwitches);
 
 	TInt ret;
 	if (iSwitches&KFManBusyFlag)
@@ -2711,23 +2636,11 @@
 		iSwitches|= KCopyFromHandle;
 
 		TInt r;
-		if ((r = iFs.Parse(aNew, iTrgFile)) != KErrNone)
-			{
-			if(iStatus)
-				User::RequestComplete(iStatus,r);
-			OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCOPY3RETURN1, "r %d", r);
-			return r;
-			}
+		RETURNIFERROR(r, iFs.Parse(aNew, iTrgFile),UTraceModuleEfsrv::ECFileManCopy3Return);
 
 		// Need to duplicate the RFile handle so that any threads owned
 		// by this process can use it - i.e. the worker thread
-		if ((r = iSrcFileHandle.Duplicate(anOld, EOwnerProcess)) != KErrNone)
-			{
-			if(iStatus)
-				User::RequestComplete(iStatus,r);
-			OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCOPY3RETURN2, "r %d", r);
-			return r;
-			}
+		RETURNIFERROR(r, iSrcFileHandle.Duplicate(anOld, EOwnerProcess),UTraceModuleEfsrv::ECFileManCopy3Return);
 
 		iAction = EInternalCopyFromHandle;
 		iNumberOfFilesProcessed = 0;
@@ -2736,8 +2649,7 @@
 		DoSynchronize(r);
 		}
 
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCOPY3RETURN3, "r %d", ret);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManCopy3Return, MODULEUID, ret);
 	return(ret);
 	}
 
@@ -2773,8 +2685,8 @@
 @capability Dependent If the path for aNew begins with /Resource then Tcb capability is required.
 */
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_ECFILEMANCOPY4, "this %x anOldSubs %x aSwitches %dstatus %x", (TUint) this, (TUint) anOld.SubSessionHandle(), (TUint) aSwitches, (TUint) &aStatus);
-	OstTraceData(TRACE_BORDER, EFSRV_ECFILEMANCOPY4_ENEWNAME, "NewName %S", aNew.Ptr(), aNew.Length()<<1);
+	TRACEMULT5(UTF::EBorder, UTraceModuleEfsrv::ECFileManCopy4, MODULEUID,
+		(TUint) this, anOld.SubSessionHandle(), aNew, aSwitches, (TUint) &aStatus);
 
 	TInt r;
 	if (iSwitches&KFManBusyFlag)
@@ -2787,8 +2699,7 @@
 		r = Copy(anOld,aNew,aSwitches);
 		}
 
-	OstTrace1(TRACE_BORDER, EFSRV_ECFILEMANCOPY4RETURN, "r %d", r);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECFileManCopy4Return, MODULEUID, r);
 	return(r);
 	}
 
@@ -2850,21 +2761,8 @@
 	{
 	TInt64 rem;
 #endif
-	TInt r;
-	if ((r = aSrcFile.Size(rem)) != KErrNone)
-		{
-		if(iStatus)
-			User::RequestComplete(iStatus,r);
-		return r;
-		}
-
-
-	if ((r = aDstFile.SetSize(rem)) != KErrNone)
-		{
-		if(iStatus)
-			User::RequestComplete(iStatus,r);
-		return r;
-		}
+	RETURNIFERRORD(r,aSrcFile.Size(rem),EFalse);
+	RETURNIFERROR(r, aDstFile.SetSize(rem),EFalse);
 
 	HBufC8* bufPtr = NULL;
 	bufPtr = AllocateBuffer(rem);
--- a/userlibandfileserver/fileserver/sfsrv/cl_fmt.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfsrv/cl_fmt.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -17,10 +17,6 @@
 
 #include "cl_std.h"
 
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "cl_fmtTraces.h"
-#endif
-
 
 
 
@@ -52,14 +48,12 @@
 
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFORMAT1OPEN, "sess %x aFormatMode %x", (TUint) aFs.Handle(), (TUint) aFormatMode);
-	OstTraceData(TRACE_BORDER, EFSRV_EFORMAT1OPEN_EDRIVENAME, "DriveName %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFormat1Open, MODULEUID, aFs.Handle(), aName, aFormatMode);
 
 	TPtr8 c((TUint8*)&aCount,sizeof(TUint),sizeof(TUint));
 	TInt r = CreateSubSession(aFs,EFsFormatOpen,TIpcArgs(&aName,aFormatMode,&c));
 
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFORMATOPEN1RETURN, "r %d subs %x aCount %d", (TUint) r, (TUint) SubSessionHandle(), (TUint) aCount);
-
+	TRACERET3(UTF::EBorder, UTraceModuleEfsrv::EFormatOpen1Return, MODULEUID, r, SubSessionHandle(), aCount);
 	return r;
 	}
 
@@ -92,8 +86,7 @@
 @capability DiskAdmin
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFORMAT2OPEN, "sess %x aFormatMode %x aInfo %x", (TUint) aFs.Handle(), (TUint) aFormatMode, (TUint) TUint(&aInfo));
-	OstTraceData(TRACE_BORDER, EFSRV_EFORMAT2OPEN_EDRIVENAME, "DriveName %S", aName.Ptr(), aName.Length()<<1);
+	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFormat2Open, MODULEUID, aFs.Handle(), aName, aFormatMode, TUint(&aInfo));
 
 	TInt size = sizeof(TUint)+aInfo.Length();
 	TUint8* buf = new TUint8[size];
@@ -113,8 +106,7 @@
 		delete[] buf;
 		}
 
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFORMATOPEN2RETURN, "r %d subs %x aCount %d", (TUint) r, (TUint) SubSessionHandle(), (TUint) aCount);
-
+	TRACERET3(UTF::EBorder, UTraceModuleEfsrv::EFormatOpen2Return, MODULEUID, r, SubSessionHandle(), aCount);
 	return r;
 	}
 
@@ -130,11 +122,11 @@
 it completed successfully or not.
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFORMATCLOSE, "sess %x subs %x", (TUint) Session().Handle(), (TUint) SubSessionHandle());
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFormatClose, MODULEUID, Session().Handle(), SubSessionHandle());
 
 	CloseSubSession(EFsFormatSubClose);
 	
-	OstTrace0(TRACE_BORDER, EFSRV_EFORMATCLOSERETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFormatCloseReturn, MODULEUID);
 	}
 
 
@@ -160,13 +152,12 @@
 
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFORMATNEXT1, "sess %x subs %x", (TUint) Session().Handle(), (TUint) SubSessionHandle());
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFormatNext1, MODULEUID, Session().Handle(), SubSessionHandle());
 
 	TPckg<TInt> e(aStep);
 	TInt r = SendReceive(EFsFormatNext,TIpcArgs(&e));
 
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFORMATNEXT1RETURN, "r %d aStep %d", (TUint) r, (TUint) aStep);
-
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFormatNext1Return, MODULEUID, r, aStep);
 	return r;
 	}
 
@@ -196,9 +187,9 @@
 
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFORMATNEXT2, "sess %x subs %x status %x", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) &aStatus);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFormatNext2, MODULEUID, Session().Handle(), SubSessionHandle(), &aStatus);
 
 	SendReceive(EFsFormatNext,TIpcArgs(&aStep),aStatus);
 
-	OstTrace0(TRACE_BORDER, EFSRV_EFORMATNEXT2RETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFormatNext2Return, MODULEUID);
 	}
--- a/userlibandfileserver/fileserver/sfsrv/cl_main.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfsrv/cl_main.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -17,16 +17,12 @@
 
 #include "cl_std.h"
 
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "cl_mainTraces.h"
-#endif
-
 GLDEF_C void Panic(TClientPanic aPanic)
 //
 // Panic the current client with a file server client side panic.
 //
 	{
-	OstTrace1(TRACE_PANIC, EFSRV_EPANIC, "%d", aPanic);
+	TRACE1(UTF::EPanic, UTraceModuleEfsrv::EPanic, MODULEUID, aPanic);
 
 	User::Panic(_L("FSCLIENT panic"),aPanic);
 	}
--- a/userlibandfileserver/fileserver/sfsrv/cl_plugin.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfsrv/cl_plugin.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -17,10 +17,6 @@
 
 #include "cl_std.h"
 
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "cl_pluginTraces.h"
-#endif
-
  
 EXPORT_C TInt RFs::AddPlugin(const TDesC& aFileName) const
 /**
@@ -35,8 +31,7 @@
 @capability DiskAdmin
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSADDPLUGIN, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSADDPLUGIN_EFILENAME, "FileName %S", aFileName.Ptr(), aFileName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsAddPlugin, MODULEUID, Handle(), aFileName);
 
 	RLoader loader;
 	TInt r = loader.Connect();
@@ -46,8 +41,7 @@
 		loader.Close();
 		}
 
-	OstTrace1(TRACE_BORDER, EFSRV_EFSADDPLUGINRETURN, "r %d", r);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsAddPluginReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -66,13 +60,11 @@
 @capability DiskAdmin
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSREMOVEPLUGIN, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSREMOVEPLUGIN_EPLUGINNAME, "PluginName %S", aPluginName.Ptr(), aPluginName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsRemovePlugin, MODULEUID, Handle(), aPluginName);
 
 	TInt r = SendReceive(EFsRemovePlugin,TIpcArgs(&aPluginName));
 
-	OstTrace1(TRACE_BORDER, EFSRV_EFSREMOVEPLUGINRETURN, "r %d", r);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsRemovePluginReturn, MODULEUID, r);
 	return r;
 	}
 
@@ -103,13 +95,11 @@
 @capability DiskAdmin      
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSMOUNTPLUGIN1, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTPLUGIN1_EPLUGINNAME, "PluginName %S", aPluginName.Ptr(), aPluginName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsMountPlugin1, MODULEUID, Handle(), aPluginName);
 
 	TInt r = SendReceive(EFsMountPlugin,TIpcArgs(&aPluginName,KPluginAutoAttach,KPluginAutoLocate));
 
-	OstTrace1(TRACE_BORDER, EFSRV_EFSMOUNTPLUGIN1RETURN, "r %d", r);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMountPlugin1Return, MODULEUID, r);
 	return r;
 	}
 
@@ -141,13 +131,11 @@
 @capability DiskAdmin      
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTPLUGIN2, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTPLUGIN2_EPLUGINNAME, "PluginName %S", aPluginName.Ptr(), aPluginName.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsMountPlugin2, MODULEUID, Handle(), aPluginName, aDrive);
 
 	TInt r = SendReceive(EFsMountPlugin,TIpcArgs(&aPluginName,aDrive,KPluginAutoLocate));
 
-	OstTrace1(TRACE_BORDER, EFSRV_EFSMOUNTPLUGIN2RETURN, "r %d", r);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMountPlugin2Return, MODULEUID, r);
 	return r;
 	}
 
@@ -187,13 +175,11 @@
 @capability DiskAdmin        
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSMOUNTPLUGIN3, "sess %x aDrive %d aPos %x", (TUint) Handle(), (TUint) aDrive, (TUint) aPos);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTPLUGIN3_EPLUGINNAME, "PluginName %S", aPluginName.Ptr(), aPluginName.Length()<<1);
+	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsMountPlugin3, MODULEUID, Handle(), aPluginName, aDrive, aPos);
 
 	TInt r = SendReceive(EFsMountPlugin,TIpcArgs(&aPluginName,aDrive,aPos));
 
-	OstTrace1(TRACE_BORDER, EFSRV_EFSMOUNTPLUGIN3RETURN, "r %d", r);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMountPlugin3Return, MODULEUID, r);
 	return r;
 	}
 
@@ -214,13 +200,11 @@
 @capability DiskAdmin       
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_EFSDISMOUNTPLUGIN1, "sess %x", Handle());
-	OstTraceData(TRACE_BORDER, EFSRV_EFSDISMOUNTPLUGIN1_EPLUGINNAME, "PluginName %S", aPluginName.Ptr(), aPluginName.Length()<<1);
+	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsDismountPlugin1, MODULEUID, Handle(), aPluginName);
 
 	TInt r = SendReceive(EFsDismountPlugin,TIpcArgs(&aPluginName,KPluginAutoAttach,KPluginAutoLocate));
 
-	OstTrace1(TRACE_BORDER, EFSRV_EFSDISMOUNTPLUGIN1RETURN, "r %d", r);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsDismountPlugin1Return, MODULEUID, r);
 	return r;
 	}
 
@@ -249,13 +233,11 @@
 @capability DiskAdmin       
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EFSDISMOUNTPLUGIN2, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSDISMOUNTPLUGIN2_EPLUGINNAME, "PluginName %S", aPluginName.Ptr(), aPluginName.Length()<<1);
+	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsDismountPlugin2, MODULEUID, Handle(), aPluginName, aDrive);
 
 	TInt r = SendReceive(EFsDismountPlugin,TIpcArgs(&aPluginName,aDrive,KPluginAutoLocate));
 
-	OstTrace1(TRACE_BORDER, EFSRV_EFSDISMOUNTPLUGIN2RETURN, "r %d", r);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsDismountPlugin2Return, MODULEUID, r);
 	return r;
 	}
 
@@ -287,13 +269,11 @@
 @capability DiskAdmin      
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSDISMOUNTPLUGIN3, "sess %x aDrive %d aPos %x", (TUint) Handle(), (TUint) aDrive, (TUint) aPos);
-	OstTraceData(TRACE_BORDER, EFSRV_EFSDISMOUNTPLUGIN3_EPLUGINNAME, "PluginName %S", aPluginName.Ptr(), aPluginName.Length()<<1);
+	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsDismountPlugin3, MODULEUID, Handle(), aPluginName, aDrive, aPos);
 
 	TInt r = SendReceive(EFsDismountPlugin,TIpcArgs(&aPluginName,aDrive,aPos));
 
-	OstTrace1(TRACE_BORDER, EFSRV_EFSDISMOUNTPLUGIN3RETURN, "r %d", r);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsDismountPlugin3Return, MODULEUID, r);
 	return r;
 	}
 
@@ -313,14 +293,11 @@
         KErrNotFound if the plugin name is not found;
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EFSPLUGINNAME, "sess %x aDrive %d aPos %x", (TUint) Handle(), (TUint) aDrive, (TUint) aPos);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFsPluginName, MODULEUID, Handle(), aDrive, aPos);
 
 	TInt r = SendReceive(EFsPluginName,TIpcArgs(&aPluginName,aDrive,aPos));
 
-	OstTraceData(TRACE_BORDER, EFSRV_EFSPLUGINNAME_EPLUGINNAME, "PluginName %S", aPluginName.Ptr(), aPluginName.Length()<<1);
-
-	OstTrace1(TRACE_BORDER, EFSRV_EFSPLUGINNAMERETURN, "r %d", r);
-
+	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsPluginName, MODULEUID, r, aPluginName);
 	return r;
 	}
 
@@ -336,12 +313,11 @@
 
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EPLUGINOPEN, "sess %x aPos %x", (TUint) aFs.Handle(), (TUint) aPos);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EPluginOpen, MODULEUID, aFs.Handle(), aPos);
 
 	TInt r = CreateSubSession(aFs,EFsPluginOpen,TIpcArgs(aPos,0,0));
 
-	OstTraceExt2(TRACE_BORDER, EFSRV_EPLUGINOPENRETURN, "r %d subs %x", (TUint) r, (TUint) SubSessionHandle());
-
+	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EPluginOpenReturn, MODULEUID, r, SubSessionHandle());
 	return r;
 	}
 
@@ -352,11 +328,11 @@
 Closes a plugin 
 */
 	{
-	OstTraceExt2(TRACE_BORDER, EFSRV_EPLUGINCLOSE, "sess %x subs %x", (TUint) Session().Handle(), (TUint) SubSessionHandle());
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EPluginClose, MODULEUID, Session().Handle(), SubSessionHandle());
 
 	CloseSubSession(EFsPluginSubClose);
 
-	OstTrace0(TRACE_BORDER, EFSRV_EPLUGINCLOSERETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EPluginCloseReturn, MODULEUID);
 	}
 
 EXPORT_C void RPlugin::DoRequest(TInt aReqNo, TRequestStatus& aStatus) const
@@ -369,12 +345,12 @@
 @param aStatus: status of the request
 */
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EPLUGINDOREQUEST1, "sess %x subs %x aReqNo %d status %x", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aReqNo, (TUint) &aStatus);
+	TRACE4(UTF::EBorder, UTraceModuleEfsrv::EPluginDoRequest1, MODULEUID, Session().Handle(), SubSessionHandle(), aReqNo, &aStatus);
 
 	aStatus=KRequestPending;
 	SendReceive(EFsPluginDoRequest, TIpcArgs(aReqNo, NULL, NULL), aStatus);
 
-	OstTrace0(TRACE_BORDER, EFSRV_EPLUGINDOREQUEST1RETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EPluginDoRequest1Return, MODULEUID);
 	}
 
 EXPORT_C void RPlugin::DoRequest(TInt aReqNo, TRequestStatus& aStatus, TDes8& a1) const
@@ -388,12 +364,12 @@
 @param a1: returning value from plugin
 */
 	{
-	OstTraceExt5(TRACE_BORDER, EFSRV_EPLUGINDOREQUEST2, "sess %x subs %x aReqNo %d status %x a1 %x", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aReqNo, (TUint) &aStatus, (TUint) &a1);
+	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EPluginDoRequest2, MODULEUID, Session().Handle(), SubSessionHandle(), aReqNo, &aStatus, &a1);
 
 	aStatus=KRequestPending;
 	SendReceive(EFsPluginDoRequest, TIpcArgs(aReqNo, &a1, NULL), aStatus);
 
-	OstTrace0(TRACE_BORDER, EFSRV_EPLUGINDOREQUEST2RETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EPluginDoRequest2Return, MODULEUID);
 	}
 
 EXPORT_C void RPlugin::DoRequest(TInt aReqNo, TRequestStatus& aStatus, TDes8& a1, TDes8& a2) const
@@ -406,12 +382,12 @@
 @param a2: 2nd returning value from plugin
 */
 	{
-	OstTraceExt5(TRACE_BORDER, EFSRV_EPLUGINDOREQUEST3, "sess %x subs %x aReqNo %d a1 %x a2 %x", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aReqNo, (TUint) &a1, (TUint) &a2);
+	TRACE6(UTF::EBorder, UTraceModuleEfsrv::EPluginDoRequest3, MODULEUID, Session().Handle(), SubSessionHandle(), aReqNo, &aStatus, &a1, &a2);
 
 	aStatus=KRequestPending;
 	SendReceive(EFsPluginDoRequest, TIpcArgs(aReqNo, &a1, &a2), aStatus);
 
-	OstTrace0(TRACE_BORDER, EFSRV_EPLUGINDOREQUEST3RETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EPluginDoRequest3Return, MODULEUID);
 	}
 
 EXPORT_C TInt RPlugin::DoControl(TInt aFunction) const
@@ -423,12 +399,11 @@
 @param	aFunction: The operation to be handled
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EPLUGINDOCONTROL1, "sess %x subs %x aFunction %d", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aFunction);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EPluginDoControl1, MODULEUID, Session().Handle(), SubSessionHandle(), aFunction);
 
 	TInt r = SendReceive(EFsPluginDoControl,TIpcArgs(aFunction,0,0));
 
-	OstTrace1(TRACE_BORDER, EFSRV_EPLUGINDOCONTROL1RETURN, "r %d", r);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EPluginDoControl1Return, MODULEUID, r);
 	return r;
 	}
 
@@ -442,12 +417,11 @@
 @param	a1: returned buffer from plugin on completion of the request
 */
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_EPLUGINDOCONTROL2, "sess %x subs %x aFunction %d a1 %x", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aFunction, (TUint) &a1);
+	TRACE4(UTF::EBorder, UTraceModuleEfsrv::EPluginDoControl2, MODULEUID, Session().Handle(), SubSessionHandle(), aFunction, &a1);
 
 	TInt r = SendReceive(EFsPluginDoControl,TIpcArgs(aFunction,&a1,0));
 
-	OstTrace1(TRACE_BORDER, EFSRV_EPLUGINDOCONTROL2RETURN, "r %d", r);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EPluginDoControl2Return, MODULEUID, r);
 	return r;
 	}
 
@@ -462,12 +436,11 @@
 @param  a2: 2nd returned buffer from plugin on completion of the request
 */
 	{
-	OstTraceExt5(TRACE_BORDER, EFSRV_EPLUGINDOCONTROL3, "sess %x subs %x aFunction %d a1 %x a2 %x", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aFunction, (TUint) &a1, (TUint) &a2);
+	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EPluginDoControl3, MODULEUID, Session().Handle(), SubSessionHandle(), aFunction, &a1, &a2);
 
 	TInt r = SendReceive(EFsPluginDoControl,TIpcArgs(aFunction,&a1,&a2));
 
-	OstTrace1(TRACE_BORDER, EFSRV_EPLUGINDOCONTROL3RETURN, "r %d", r);
-
+	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EPluginDoControl3Return, MODULEUID, r);
 	return r;
 	}
 
@@ -480,10 +453,10 @@
 @param	aReqMask: the bit mask for the operation to be cancelled
 */
 	{
-	OstTraceExt3(TRACE_BORDER, EFSRV_EPLUGINDOCANCEL, "sess %x subs %x aReqMask %x", (TUint) Session().Handle(), (TUint) SubSessionHandle(), (TUint) aReqMask);
+	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EPluginDoCancel, MODULEUID, Session().Handle(), SubSessionHandle(), aReqMask);
 
 	SendReceive(EFsPluginDoCancel,TIpcArgs(KMaxTInt,aReqMask,0));
 
-	OstTrace0(TRACE_BORDER, EFSRV_EPLUGINDOCANCELRETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EPluginDoCancelReturn, MODULEUID);
 	}
 
--- a/userlibandfileserver/fileserver/sfsrv/cl_scan.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfsrv/cl_scan.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -16,10 +16,6 @@
 #include "cl_std.h"
 #include "cl_scan.h"
 
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "cl_scanTraces.h"
-#endif
-
 const TInt KDirStackGranularity=8;
 
 /** Replace long names in path and filename with their sohrter version (if exists). Optionally appends
@@ -119,13 +115,13 @@
 @return A pointer to the new directory scan object.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_ECDIRSCANNEWLC, "sess %x", aFs.Handle());
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECDirScanNewLC, MODULEUID, aFs.Handle());
 
 	CDirScan* scan=new(ELeave) CDirScan(aFs);
 	CleanupStack::PushL(scan);
 	scan->iStack=CDirStack::NewL();
 
-	OstTrace1(TRACE_BORDER, EFSRV_ECDIRSCANNEWLCRETURN, "CDirScan* %x", scan);
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECDirScanNewLCReturn, MODULEUID, scan);
 	return scan;
 	}
 
@@ -141,12 +137,12 @@
 @return A pointer to the new directory scan object.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_ECDIRSCANNEWL, "sess %x", aFs.Handle());
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECDirScanNewL, MODULEUID, aFs.Handle());
 
 	CDirScan* scan=CDirScan::NewLC(aFs);
 	CleanupStack::Pop();
 
-	OstTrace1(TRACE_BORDER, EFSRV_ECDIRSCANNEWLRETURN, "CDirScan* %x", scan);
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECDirScanNewLReturn, MODULEUID, scan);
 	return scan;
 	}
 
@@ -160,11 +156,11 @@
 Frees all resources owned by the object, prior to its destruction.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_ECDIRSCANDESTRUCTOR, "this %x", this);
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECDirScanDestructor, MODULEUID, this);
 
 	delete iStack;
 
-	OstTrace0(TRACE_BORDER, EFSRV_ECDIRSCANDESTRUCTORRETURN, "");
+	TRACE0(UTF::EBorder, UTraceModuleEfsrv::ECDirScanDestructorReturn, MODULEUID);
 	}
 
 
@@ -218,13 +214,13 @@
 @param aScanDir       The direction of the scan. The default is downwards.
 */
 	{
-	OstTraceExt4(TRACE_BORDER, EFSRV_ECDIRSCANSETSCANDATAL, "this %x anEntryAttMask %x anEntrySortKey %d aScanDir %d", (TUint) this, (TUint) anEntryAttMask, (TUint) anEntrySortKey, (TUint) aScanDir);
-	OstTraceData(TRACE_BORDER, EFSRV_ECDIRSCANSETSCANDATAL_EFILEPATH, "FilePath %S", aMatchName.Ptr(), aMatchName.Length()<<1);
+	TRACEMULT5(UTF::EBorder, UTraceModuleEfsrv::ECDirScanSetScanDataL, MODULEUID, (TUint) 
+		this, aMatchName, anEntryAttMask, anEntrySortKey, (TUint) aScanDir);
 
 	TInt r = Fs().Parse(aMatchName,iFullPath);
 	if (r != KErrNone)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_ECDIRSCANSETSCANDATALRETURN1, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECDirScanSetScanDataLReturn, MODULEUID, r);
 		User::Leave(r);
 		}
 
@@ -238,7 +234,7 @@
 	if (aScanDir==EScanDownTree)
 		iFullPath.PopDir();
 
-	OstTrace1(TRACE_BORDER, EFSRV_ECDIRSCANSETSCANDATALRETURN2, "r %d", KErrNone);
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECDirScanSetScanDataLReturn, MODULEUID, KErrNone);
 	}
 
 void CDirScan::UpdateAbbreviatedPath()
@@ -282,14 +278,15 @@
                    no more directories in the structure.
 */
 	{
-	OstTrace1(TRACE_BORDER, EFSRV_ECDIRSCANNEXTL, "this %x", this);
+	TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECDirScanNextL, MODULEUID, this);
 
 	if (iScanDir==EScanUpTree)
 		ScanUpTreeL(aDirEntries);
 	else
 		ScanDownTreeL(aDirEntries);
 
-	OstTraceExt2(TRACE_BORDER, EFSRV_ECDIRSCANNEXTLRETURN, "r %d DirEntries %d", (TUint) KErrNone, (TUint) aDirEntries ? (*aDirEntries).Count() : 0);
+	TRACE2(UTF::EBorder, UTraceModuleEfsrv::ECDirScanNextLReturn, MODULEUID, 
+		KErrNone, aDirEntries ? (*aDirEntries).Count() : 0);
 	}
 
 void CDirScan::ScanUpTreeL(CDir*& aDirEntries)
@@ -340,7 +337,7 @@
 			}
 		if (r != KErrNone)
 			{
-			OstTrace1(TRACE_BORDER, EFSRV_ECDIRSCANLEAVE1, "r %d", r);
+			TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECDirScanLeave, MODULEUID, r);
 			User::LeaveIfError(r);
 			}
 
@@ -358,7 +355,7 @@
 		else if (r != KErrNone)
 			{
 			iScanning = EFalse;
-			OstTrace1(TRACE_BORDER, EFSRV_ECDIRSCANLEAVE2, "r %d", r);
+			TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECDirScanLeave, MODULEUID, r);
 			User::Leave(r);
 			}
 		
@@ -396,7 +393,7 @@
 	TInt r = Fs().GetDir(iFullPath.FullName(),iEntryAttMask,iEntrySortMask,aDirEntries);
 	if (r != KErrNone)
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_ECDIRSCANLEAVE3, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECDirScanLeave, MODULEUID, r);
 		User::Leave(r);
 		}
 	}
@@ -410,8 +407,8 @@
 	CDir* dirEntries = NULL;
 	TInt r;
 	aDirEntries=NULL;
-	
-	if(iStack->IsEmpty())
+		
+	if(iStack && iStack->IsEmpty())
 	    return;
 	
 	CDirList* list=iStack->Peek();
@@ -432,7 +429,7 @@
 	r=iFullPath.AddDir(dirName);
 	if (r==KErrGeneral)	//	Adding dirName makes iFullPath>256 characters
 		{
-		OstTrace1(TRACE_BORDER, EFSRV_ECDIRSCANLEAVE4, "r %d", KErrTooBig);
+		TRACE1(UTF::EBorder, UTraceModuleEfsrv::ECDirScanLeave, MODULEUID, KErrTooBig);
 		User::Leave(KErrTooBig);
 		}
 
@@ -454,7 +451,7 @@
 									   iEntrySortMask,dirList);
 		if (r != KErrNone)
 			{
-			OstTrace1(TRACE_BORDER, EFSRV_ECDIRSCANLEAVE5, "r %d", r);
+			TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECDirScanLeave, MODULEUID, r);
 			User::Leave(r);
 			}
 		iStack->PushL(*dirList);
@@ -471,7 +468,7 @@
 	else
 		{
 		iScanning = EFalse;
-		OstTrace1(TRACE_BORDER, EFSRV_ECDIRSCANLEAVE6, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECDirScanLeave, MODULEUID, r);
 		User::Leave(r);
 		}
 	}
@@ -575,7 +572,7 @@
 	if (r!=KErrNone)
 		{
 		delete nextLevel;
-		OstTrace1(TRACE_BORDER, EFSRV_ECDIRSCANLEAVE7, "r %d", r);
+		TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECDirScanLeave, MODULEUID, r);
 		User::Leave(r);
 		}
 	}
@@ -713,7 +710,7 @@
 		TInt r = iFs->GetOpenFileList(iScanPos,iEntryListPos,theId,array);
 		if (r != KErrNone)
 			{
-			OstTrace1(TRACE_BORDER, EFSRV_ECDIRSCANLEAVE8, "r %d", r);
+			TRACERET1(UTF::EBorder, UTraceModuleEfsrv::ECDirScanLeave, MODULEUID, r);
 			User::Leave(r);
 			}
 		TInt count=array.Count();
--- a/userlibandfileserver/fileserver/sfsrv/cl_std.h	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/sfsrv/cl_std.h	Wed Sep 01 12:34:56 2010 +0100
@@ -26,6 +26,7 @@
 #include <f32ver.h>
 #include <e32svr.h>
 #include <f32plugin.h>
+#include <utraceefsrv.h>
 #include "f32trace.h"
 
 enum TClientPanic
--- a/userlibandfileserver/fileserver/sfsrv/efsrv.mmh	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-// Copyright (c) 1996-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:
-// f32\group\efsrv.mmp
-// efsrv.dll File Server client-side library
-// 
-//
-
-/**
- @file
-*/
-
-
-
-USERINCLUDE		../ftrace
-
-USERINCLUDE		../sfsrv/traces
-
-SOURCEPATH		../sfsrv
-SOURCE			 cl_cdir.cpp cl_cli.cpp cl_debug.cpp cl_dir.cpp
-SOURCE			 cl_drive.cpp cl_entry.cpp cl_file.cpp cl_find.cpp
-SOURCE			 cl_fman.cpp cl_fmt.cpp cl_fraw.cpp cl_ftext.cpp
-SOURCE			 cl_main.cpp cl_parse.cpp cl_scan.cpp cl_insecure.cpp
-SOURCE			 cl_plugin.cpp cl_blockmap.cpp cl_clamp.cpp
-SOURCE			 cl_shim.cpp
-SOURCE			 cl_notification.cpp
-SOURCEPATH	../group
-DOCUMENT		 release.txt
-
-TARGETTYPE		dll
-
-DEFFILE			 efsrv.def
-
-USERINCLUDE	../inc
-#ifdef SYMBIAN_OLD_EXPORT_LOCATION
-SYSTEMINCLUDE	../inc
-#endif
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-LIBRARY			 euser.lib hal.lib
-
-START WINS
-BASEADDRESS		0x66000000
-END
-
-UID		0x1000008d 0x100039e4
-VENDORID 0x70000001
-CAPABILITY	All
-
-unpagedcode
-
-SMPSAFE
-
--- a/userlibandfileserver/fileserver/sfsrv/efsrv.mmp	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 1996-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:
-// f32/sfsrv/efsrv.mmp
-// efsrv.dll File Server client-side library
-// 
-//
-
-/**
- @file
-*/
-
-
-TARGET			efsrv.dll
-
-#include "f32.mmh"  	// Generic definitions for the whole f32 component
-
-// By default, tracepoints are compiled in to UDEB version only
-#ifdef SYMBIAN_TRACE_SYSTEM_INCLUDE
-	macro SYMBIAN_FTRACE_ENABLE_UDEB
-//	macro SYMBIAN_FTRACE_ENABLE_UREL
-#endif
-
-
-#include "efsrv.mmh"
--- a/userlibandfileserver/fileserver/sfsrv/traces/OstTraceDefinitions.h	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +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:
-
-#ifndef __OSTTRACEDEFINITIONS_H__
-#define __OSTTRACEDEFINITIONS_H__
-// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
-// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
-//#define OST_TRACE_COMPILER_IN_USE
-#include <OpenSystemTrace.h>
-#endif
--- a/userlibandfileserver/fileserver/sfsrv/traces/fixed_id.definitions	Tue Aug 31 16:34:26 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,646 +0,0 @@
-#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
-[GROUP]TRACE_BORDER=0x40
-[GROUP]TRACE_PANIC=0x41
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECDIRSCANDESTRUCTOR=0x273
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECDIRSCANDESTRUCTORRETURN=0x274
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECDIRSCANLEAVE1=0x27b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECDIRSCANLEAVE2=0x27c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECDIRSCANLEAVE3=0x27d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECDIRSCANLEAVE4=0x27e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECDIRSCANLEAVE5=0x27f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECDIRSCANLEAVE6=0x280
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECDIRSCANLEAVE7=0x281
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECDIRSCANLEAVE8=0x282
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECDIRSCANNEWL=0x271
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECDIRSCANNEWLC=0x26f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECDIRSCANNEWLCRETURN=0x270
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECDIRSCANNEWLRETURN=0x272
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECDIRSCANNEXTL=0x279
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECDIRSCANNEXTLRETURN=0x27a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECDIRSCANSETSCANDATAL=0x275
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECDIRSCANSETSCANDATALRETURN1=0x277
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECDIRSCANSETSCANDATALRETURN2=0x278
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECDIRSCANSETSCANDATAL_EFILEPATH=0x276
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANATTRIBS1A=0x1f5
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANATTRIBS1A_EFILEPATH=0x1f7
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANATTRIBS1B=0x1f6
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANATTRIBS1RETURN=0x1f8
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANATTRIBS2A=0x1f9
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANATTRIBS2A_EFILEPATH=0x1fb
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANATTRIBS2B=0x1fa
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANATTRIBS2RETURN1=0x1fc
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANATTRIBS2RETURN2=0x1fd
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANBYTESTRANSFERREDBYCOPYSTEP=0x1f4
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANCOPY1=0x1fe
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANCOPY1RETURN=0x201
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANCOPY1_ENEWNAME=0x200
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANCOPY1_EOLDNAME=0x1ff
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANCOPY2=0x202
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANCOPY2RETURN1=0x205
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANCOPY2RETURN2=0x206
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANCOPY2RETURN3=0x207
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANCOPY2RETURN4=0x208
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANCOPY2RETURN5=0x209
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANCOPY2_ENEWNAME=0x204
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANCOPY2_EOLDNAME=0x203
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANCOPY3=0x22e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANCOPY3RETURN1=0x230
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANCOPY3RETURN2=0x231
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANCOPY3RETURN3=0x232
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANCOPY3_ENEWNAME=0x22f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANCOPY4=0x233
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANCOPY4RETURN=0x235
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANCOPY4_ENEWNAME=0x234
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANCURRENTACTION=0x1ec
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANCURRENTACTIONRETURN=0x1ed
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANDELETE1=0x20a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANDELETE1RETURN=0x20c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANDELETE1_EFILEPATH=0x20b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANDELETE2=0x20d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANDELETE2RETURN1=0x20f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANDELETE2RETURN2=0x210
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANDELETE2_EFILEPATH=0x20e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANDESTRUCTOR=0x1ea
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANDESTRUCTORRETURN=0x1eb
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANGETCURRENTSOURCE=0x1f1
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANGETCURRENTSOURCERETURN=0x1f2
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANGETCURRENTSOURCE_EFILENAME=0x1f3
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANGETCURRENTTARGET=0x1ee
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANGETCURRENTTARGETRETURN=0x1ef
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANGETCURRENTTARGET_EFILENAME=0x1f0
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANMOVE1=0x211
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANMOVE1RETURN=0x214
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANMOVE1_ENEWNAME=0x213
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANMOVE1_EOLDNAME=0x212
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANMOVE2=0x215
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANMOVE2RETURN1=0x218
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANMOVE2RETURN2=0x219
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANMOVE2RETURN3=0x21a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANMOVE2RETURN4=0x21b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANMOVE2RETURN5=0x21c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANMOVE2_ENEWNAME=0x217
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANMOVE2_EOLDNAME=0x216
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANNEWL1=0x1e6
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANNEWL1RETURN=0x1e7
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANNEWL2=0x1e8
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANNEWL2RETURN=0x1e9
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANRENAME1=0x21d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANRENAME1RETURN=0x220
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANRENAME1_ENEWNAME=0x21f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANRENAME1_EOLDNAME=0x21e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANRENAME2=0x221
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANRENAME2RETURN1=0x224
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANRENAME2RETURN2=0x225
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANRENAME2RETURN3=0x226
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANRENAME2_ENEWNAME=0x223
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANRENAME2_EOLDNAME=0x222
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANRMDIR1=0x227
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANRMDIR1RETURN=0x229
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANRMDIR1_EDIRNAME=0x228
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANRMDIR2=0x22a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANRMDIR2RETURN1=0x22c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANRMDIR2RETURN2=0x22d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_ECFILEMANRMDIR2_EDIRNAME=0x22b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EDIRCLOSE=0x124
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EDIRCLOSERETURN=0x125
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EDIROPEN1=0x11e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EDIROPEN1RETURN=0x120
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EDIROPEN1_EDIRNAME=0x11f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EDIROPEN2=0x121
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EDIROPEN2RETURN=0x123
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EDIROPEN2_EDIRNAME=0x122
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EDIRREAD1=0x126
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EDIRREAD1RETURN=0x127
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EDIRREAD2=0x128
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EDIRREAD2RETURN=0x129
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EDIRREAD3=0x12a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EDIRREAD3RETURN=0x12b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EDIRREAD4=0x12c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EDIRREAD4RETURN=0x12d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64ADOPTFROMCLIENT=0x1b1
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64ADOPTFROMCLIENTRETURN1=0x1b2
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64ADOPTFROMCLIENTRETURN2=0x1b3
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64ADOPTFROMCLIENTRETURN3=0x1b4
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64ADOPTFROMCREATOR=0x1b8
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64ADOPTFROMCREATORRETURN1=0x1b9
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64ADOPTFROMCREATORRETURN2=0x1ba
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64ADOPTFROMCREATORRETURN3=0x1bb
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64ADOPTFROMSERVER=0x1b5
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64ADOPTFROMSERVERRETURN1=0x1b6
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64ADOPTFROMSERVERRETURN2=0x1b7
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64CREATE=0x1a7
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64CREATERETURN=0x1a9
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64CREATE_EFILENAME=0x1a8
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64LOCK=0x1d2
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64LOCKRETURN=0x1d3
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64OPEN=0x1a4
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64OPENRETURN=0x1a6
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64OPEN_EFILENAME=0x1a5
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64READ10=0x1be
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64READ10RETURN=0x1bf
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64READ11=0x1c2
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64READ11RETURN=0x1c3
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64READ12=0x1d8
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64READ12RETURN=0x1d9
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64READ13=0x1dc
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64READ13RETURN=0x1dd
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64READ14=0x1d6
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64READ14RETURN=0x1d7
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64READ15=0x1c0
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64READ15RETURN=0x1c1
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64READ16=0x1da
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64READ16RETURN=0x1db
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64READ8=0x1bc
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64READ8RETURN=0x1bd
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64REPLACE=0x1aa
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64REPLACERETURN=0x1ac
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64REPLACE_EFILENAME=0x1ab
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64SEEK2=0x1cc
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64SEEK2RETURN=0x1cd
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64SETSIZE2=0x1d0
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64SETSIZE2RETURN=0x1d1
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64SIZE2=0x1ce
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64SIZE2RETURN=0x1cf
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64TEMP=0x1ad
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64TEMPRETURN=0x1b0
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64TEMP_EDIRNAME=0x1ae
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64TEMP_EFILENAME=0x1af
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64UNLOCK=0x1d4
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64UNLOCKRETURN=0x1d5
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64WRITE11=0x1ca
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64WRITE11RETURN=0x1cb
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64WRITE12=0x1e4
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64WRITE12RETURN=0x1e5
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64WRITE13=0x1c4
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64WRITE13RETURN=0x1c5
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64WRITE14=0x1de
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64WRITE14RETURN=0x1df
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64WRITE15=0x1c6
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64WRITE15RETURN=0x1c7
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64WRITE16=0x1e0
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64WRITE16RETURN=0x1e1
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64WRITE7=0x1c8
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64WRITE7RETURN=0x1c9
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64WRITE8=0x1e2
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILE64WRITE8RETURN=0x1e3
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEADOPT=0x12e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEADOPTFROMCLIENT=0x135
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEADOPTFROMCLIENTRETURN1=0x136
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEADOPTFROMCLIENTRETURN2=0x137
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEADOPTFROMCLIENTRETURN3=0x138
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEADOPTFROMCREATOR=0x139
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEADOPTFROMCREATORRETURN1=0x13a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEADOPTFROMCREATORRETURN2=0x13b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEADOPTFROMCREATORRETURN3=0x13c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEADOPTFROMSERVER=0x132
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEADOPTFROMSERVERRETURN1=0x133
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEADOPTFROMSERVERRETURN2=0x134
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEADOPTRETURN1=0x12f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEADOPTRETURN2=0x130
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEADOPTRETURN3=0x131
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEATT=0x18d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEATTRETURN=0x18e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEBLOCKMAPA=0x1a1
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEBLOCKMAPB=0x1a2
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEBLOCKMAPRETURN=0x1a3
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILECHANGEMODE=0x198
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILECHANGEMODERETURN=0x199
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILECLAMP=0x19f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILECLAMPRETURN=0x1a0
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILECLOSE=0x153
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILECLOSERETURN=0x154
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILECREATE=0x155
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILECREATERETURN=0x157
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILECREATE_EFILENAME=0x156
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEDRIVE=0x19d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEDRIVERETURN=0x19e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEDUPLICATE=0x13d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEDUPLICATERETURN1=0x13e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEDUPLICATERETURN2=0x13f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEDUPLICATERETURN3=0x140
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEFLUSH1=0x185
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEFLUSH1RETURN=0x186
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEFLUSH2=0x187
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEFLUSH2RETURN=0x188
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEFULLNAME=0x14d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEFULLNAMERETURN=0x14f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEFULLNAME_EFILENAME=0x14e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEGETNAME=0x14a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEGETNAMERETURN=0x14c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEGETNAME_EFILENAME=0x14b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILELOCK=0x17f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILELOCKRETURN=0x180
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEMODIFIED=0x191
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEMODIFIEDRETURN=0x192
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEOPEN=0x150
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEOPENRETURN=0x152
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEOPEN_EFILENAME=0x151
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEREAD1=0x15f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEREAD1RETURN=0x160
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEREAD2=0x161
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEREAD2RETURN=0x162
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEREAD3=0x167
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEREAD3RETURN=0x168
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEREAD4=0x169
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEREAD4RETURN=0x16a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEREAD5=0x163
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEREAD5RETURN=0x164
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEREAD6=0x165
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEREAD6RETURN=0x166
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEREAD7=0x16b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEREAD7RETURN=0x16c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEREAD9=0x16d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEREAD9RETURN=0x16e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILERENAME=0x19a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILERENAMERETURN=0x19c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILERENAME_ENEWNAME=0x19b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEREPLACE=0x158
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEREPLACERETURN=0x15a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEREPLACE_EFILENAME=0x159
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILESEEK1=0x183
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILESEEK1RETURN=0x184
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILESETA=0x195
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILESETATT=0x18f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILESETATTRETURN=0x190
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILESETB=0x196
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILESETMODIFIED=0x193
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILESETMODIFIEDRETURN=0x194
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILESETRETURN=0x197
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILESETSIZE1=0x18b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILESETSIZE1RETURN=0x18c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILESIZE=0x189
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILESIZERETURN=0x18a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILETEMP=0x15b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILETEMPRETURN=0x15e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILETEMP_EDIRNAME=0x15c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILETEMP_EFILENAME=0x15d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILETRANSFERTOCLIENT=0x144
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILETRANSFERTOCLIENTRETURN1=0x145
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILETRANSFERTOCLIENTRETURN2=0x146
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILETRANSFERTOCLIENTRETURN3=0x147
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILETRANSFERTOPROCESS=0x148
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILETRANSFERTOPROCESSRETURN=0x149
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILETRANSFERTOSERVER=0x141
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILETRANSFERTOSERVERRETURN1=0x142
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILETRANSFERTOSERVERRETURN2=0x143
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEUNLOCK=0x181
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEUNLOCKRETURN=0x182
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEWRITE1=0x16f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEWRITE10=0x17d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEWRITE10RETURN=0x17e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEWRITE1RETURN=0x170
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEWRITE2=0x171
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEWRITE2RETURN=0x172
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEWRITE3=0x177
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEWRITE3RETURN=0x178
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEWRITE4=0x179
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEWRITE4RETURN=0x17a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEWRITE5=0x173
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEWRITE5RETURN=0x174
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEWRITE6=0x17b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEWRITE6RETURN=0x17c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEWRITE9=0x175
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFILEWRITE9RETURN=0x176
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFORMAT1OPEN=0x236
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFORMAT1OPEN_EDRIVENAME=0x237
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFORMAT2OPEN=0x239
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFORMAT2OPEN_EDRIVENAME=0x23a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFORMATCLOSE=0x23c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFORMATCLOSERETURN=0x23d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFORMATNEXT1=0x23e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFORMATNEXT1RETURN=0x23f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFORMATNEXT2=0x240
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFORMATNEXT2RETURN=0x241
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFORMATOPEN1RETURN=0x238
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFORMATOPEN2RETURN=0x23b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSADDCOMPOSITEMOUNT=0xfe
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSADDCOMPOSITEMOUNTRETURN=0x100
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSADDCOMPOSITEMOUNT_EFILESYSTEMNAME=0xff
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSADDEXTENSION=0x3b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSADDEXTENSIONRETURN=0x3d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSADDEXTENSION_EEXTENSIONNAME=0x3c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSADDFILESYSTEM=0x17
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSADDFILESYSTEMRETURN=0x19
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSADDFILESYSTEM_EFILENAME=0x18
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSADDPLUGIN=0x242
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSADDPLUGINRETURN=0x244
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSADDPLUGIN_EFILENAME=0x243
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSALLOWDISMOUNT=0x10d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSALLOWDISMOUNTRETURN=0x10e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSATT=0xa0
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSATTRETURN=0xa2
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSATT_EFILENAME=0xa1
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSCHECKDISK=0xc1
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSCHECKDISKRETURN=0xc3
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSCHECKDISK_EDIRNAME=0xc2
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSCLEARPASSWORD=0xec
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSCLEARPASSWORDRETURN=0xed
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSCLOSE=0x11c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSCLOSERETURN=0x11d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSCONNECT=0xc
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSCONNECTRETURN=0xd
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSCREATEPRIVATEPATH=0x13
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSCREATEPRIVATEPATHRETURN=0x14
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDELETE=0x95
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDELETERETURN=0x97
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDELETE_EFILENAME=0x96
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDISMOUNTEXTENSION=0x41
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDISMOUNTEXTENSIONRETURN=0x43
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDISMOUNTEXTENSION_EEXTENSIONNAME=0x42
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDISMOUNTFILESYSTEM=0x32
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDISMOUNTFILESYSTEMRETURN=0x34
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDISMOUNTFILESYSTEM_EFILESYSTEMNAME=0x33
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDISMOUNTPLUGIN1=0x251
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDISMOUNTPLUGIN1RETURN=0x253
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDISMOUNTPLUGIN1_EPLUGINNAME=0x252
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDISMOUNTPLUGIN2=0x254
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDISMOUNTPLUGIN2RETURN=0x256
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDISMOUNTPLUGIN2_EPLUGINNAME=0x255
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDISMOUNTPLUGIN3=0x257
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDISMOUNTPLUGIN3RETURN=0x259
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDISMOUNTPLUGIN3_EPLUGINNAME=0x258
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDRIVE=0x5f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDRIVELIST1=0x5b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDRIVELIST1RETURN=0x5c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDRIVELIST2=0x5d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDRIVELIST2RETURN=0x5e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDRIVERETURN=0x60
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDRIVETOCHAR=0x1
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSDRIVETOCHARRETURN=0x2
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSENTRY=0xac
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSENTRYRETURN=0xae
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSENTRY_EFILENAME=0xad
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSERASEPASSWORD=0xee
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSERASEPASSWORDRETURN=0xef
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSEXTENSIONNAME=0x47
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSEXTENSIONNAMERETURN=0x49
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSEXTENSIONNAME_EEXTENSIONNAME=0x48
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSFILESYSTEMNAME=0x35
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSFILESYSTEMNAMERETURN=0x37
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSFILESYSTEMNAME_EFILESYSTEMNAME=0x36
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSFILESYSTEMNAME_ESUPPORTEDFILESYSTEMNAME=0x39
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSFILESYSTEMSUBTYPE=0x119
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSFILESYSTEMSUBTYPERETURN=0x11b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSFILESYSTEMSUBTYPE_EFILESYSTEMNAME=0x11a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSFINALISEDRIVE=0xf5
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSFINALISEDRIVERETURN=0xf6
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSFINALISEDRIVES=0xf7
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSFINALISEDRIVESRETURN1=0xf8
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSFINALISEDRIVESRETURN2=0xf9
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETDIR1=0x85
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETDIR1RETURN=0x87
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETDIR1_EDIRNAME=0x86
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETDIR2=0x88
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETDIR2RETURN=0x8a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETDIR2_EDIRNAME=0x89
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETDIR3=0x8b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETDIR3RETURN=0x8d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETDIR3_EDIRNAME=0x8c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETDRIVENAME=0xe2
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETDRIVENAMERETURN=0xe4
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETDRIVENAME_EDRIVENAME=0xe3
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETLONGNAME=0xcb
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETLONGNAMERETURN=0xce
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETLONGNAME_ELONGNAME=0xcd
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETLONGNAME_ESHORTNAME=0xcc
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETMEDIASERIALNUMBER=0x73
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETMEDIASERIALNUMBERRETURN=0x74
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETMEDIASERIALNUMBER_ESERIALNUMBER=0x75
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETNOTIFYUSER=0xd2
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETNOTIFYUSERRETURN=0xd3
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETRESERVEACCESS=0x103
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETRESERVEACCESSRETURN=0x104
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETSHORTNAME=0xc7
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETSHORTNAMERETURN=0xca
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETSHORTNAME_ELONGNAME=0xc8
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETSHORTNAME_ESHORTNAME=0xc9
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETSYSTEMDRIVE=0x5
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETSYSTEMDRIVECHAR=0x8
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETSYSTEMDRIVECHARRETURN=0x9
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETSYSTEMDRIVERETURN1=0x6
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSGETSYSTEMDRIVERETURN2=0x7
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSINITIALISEPROPERTIESFILE=0x113
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSINITIALISEPROPERTIESFILERETURN=0x114
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSISFILEINROM=0xd6
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSISFILEINROMRETURN=0xd8
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSISFILEINROM_EFILENAME=0xd7
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSISFILEOPEN=0xcf
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSISFILEOPENRETURN=0xd1
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSISFILEOPEN_EFILENAME=0xd0
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSISROMADDRESS=0x3
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSISROMADDRESSRETURN=0x4
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSISVALIDNAME1=0xd9
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSISVALIDNAME1RETURN=0xdb
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSISVALIDNAME1_EFILENAME=0xda
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSISVALIDNAME2=0xdc
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSISVALIDNAME2RETURN=0xde
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSISVALIDNAME2_EFILENAME=0xdd
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSISVALIDNAME3=0xdf
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSISVALIDNAME3RETURN=0xe1
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSISVALIDNAME3_EFILENAME=0xe0
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSLOCKDRIVE=0xe8
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSLOCKDRIVERETURN=0xe9
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMKDIR=0x7c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMKDIRALL=0x7f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMKDIRALLRETURN=0x81
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMKDIRALL_EDIRNAME=0x80
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMKDIRRETURN=0x7e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMKDIR_EDIRNAME=0x7d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMODIFIED=0xa6
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMODIFIEDRETURN=0xa8
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMODIFIED_EFILENAME=0xa7
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTEXTENSION=0x3e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTEXTENSIONRETURN=0x40
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTEXTENSION_EEXTENSIONNAME=0x3f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTFILESYSTEM1=0x1d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTFILESYSTEM1RETURN=0x1f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTFILESYSTEM1_EFILESYSTEMNAME=0x1e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTFILESYSTEM2=0x20
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTFILESYSTEM2RETURN=0x22
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTFILESYSTEM2_EFILESYSTEMNAME=0x21
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTFILESYSTEM3=0x23
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTFILESYSTEM3RETURN=0x26
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTFILESYSTEM3_EEXTENSIONNAME=0x24
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTFILESYSTEM3_EFILESYSTEMNAME=0x25
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTFILESYSTEM4=0x27
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTFILESYSTEM4RETURN=0x2a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTFILESYSTEM4_EEXTENSIONNAME=0x29
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTFILESYSTEM4_EFILESYSTEMNAME=0x28
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTFILESYSTEMANDSCAN1=0x2b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTFILESYSTEMANDSCAN1RETURN=0x2d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTFILESYSTEMANDSCAN1_EFILESYSTEMNAME=0x2c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTFILESYSTEMANDSCAN2=0x2e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTFILESYSTEMANDSCAN2RETURN=0x31
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTFILESYSTEMANDSCAN2_EEXTENSIONNAME=0x30
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTFILESYSTEMANDSCAN2_EFILESYSTEMNAME=0x2f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTPLUGIN1=0x248
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTPLUGIN1RETURN=0x24a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTPLUGIN1_EPLUGINNAME=0x249
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTPLUGIN2=0x24b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTPLUGIN2RETURN=0x24d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTPLUGIN2_EPLUGINNAME=0x24c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTPLUGIN3=0x24e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTPLUGIN3RETURN=0x250
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSMOUNTPLUGIN3_EPLUGINNAME=0x24f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSNOTIFYCHANGE1=0x4c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSNOTIFYCHANGE1RETURN=0x4d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSNOTIFYCHANGE2=0x4e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSNOTIFYCHANGE2RETURN=0x50
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSNOTIFYCHANGE2_EDIRNAME=0x4f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSNOTIFYCHANGECANCEL1=0x51
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSNOTIFYCHANGECANCEL1RETURN=0x52
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSNOTIFYCHANGECANCEL2=0x53
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSNOTIFYCHANGECANCEL2RETURN=0x54
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSNOTIFYDISKSPACE=0x55
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSNOTIFYDISKSPACECANCEL1=0x57
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSNOTIFYDISKSPACECANCEL1RETURN=0x58
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSNOTIFYDISKSPACECANCEL2=0x59
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSNOTIFYDISKSPACECANCEL2RETURN=0x5a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSNOTIFYDISKSPACERETURN=0x56
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSNOTIFYDISMOUNT=0x107
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSNOTIFYDISMOUNTCANCEL1=0x109
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSNOTIFYDISMOUNTCANCEL1RETURN=0x10a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSNOTIFYDISMOUNTCANCEL2=0x10b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSNOTIFYDISMOUNTCANCEL2RETURN=0x10c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSNOTIFYDISMOUNTRETURN=0x108
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSPARSE1=0x8e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSPARSE1RETURN=0x90
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSPARSE1_EFILEPATH=0x8f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSPARSE2=0x91
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSPARSE2RETURN=0x94
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSPARSE2_EFILENAME=0x92
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSPARSE2_ERELATED=0x93
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSPLUGINNAME=0x25a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSPLUGINNAMERETURN=0x25c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSPLUGINNAME_EPLUGINNAME=0x25b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSPRIVATEPATH=0x10
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSPRIVATEPATHRETURN=0x12
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSPRIVATEPATH_EDIRNAME=0x11
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSQUERYVOLUMEINFOEXT=0x115
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSQUERYVOLUMEINFOEXTRETURN=0x116
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREADFILESECTION=0xb2
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREADFILESECTIONRETURN1=0xb4
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREADFILESECTIONRETURN2=0xb5
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREADFILESECTIONRETURN3=0xb6
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREADFILESECTION_EFILENAME=0xb3
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREADFILESECTION_RESERVED=0xb7
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREADFILESECTION_RESERVED_EFILENAME=0xb8
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREADFILESECTION_RESERVED_RETURN1=0xb9
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREADFILESECTION_RESERVED_RETURN2=0xba
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREALNAME=0x6f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREALNAMERETURN=0x72
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREALNAME_EFILENAME1=0x70
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREALNAME_EFILENAME2=0x71
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSRELEASERESERVEACCESS=0x105
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSRELEASERESERVEACCESSRETURN=0x106
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREMOUNTDRIVE=0x4a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREMOUNTDRIVERETURN=0x4b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREMOVEEXTENSION=0x44
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREMOVEEXTENSIONRETURN=0x46
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREMOVEEXTENSION_EEXTENSIONNAME=0x45
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREMOVEFILESYSTEM=0x1a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREMOVEFILESYSTEMRETURN=0x1c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREMOVEFILESYSTEM_EFILESYSTEMNAME=0x1b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREMOVEPLUGIN=0x245
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREMOVEPLUGINRETURN=0x247
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREMOVEPLUGIN_EPLUGINNAME=0x246
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSRENAME=0x98
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSRENAMERETURN=0x9b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSRENAME_ENEWNAME=0x9a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSRENAME_EOLDNAME=0x99
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREPLACE=0x9c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREPLACERETURN=0x9f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREPLACE_ENEWNAME=0x9e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSREPLACE_EOLDNAME=0x9d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSRESERVEDRIVESPACE=0x101
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSRESERVEDRIVESPACERETURN=0x102
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSRESOURCECOUNT=0xbf
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSRESOURCECOUNTMARKEND=0xbd
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSRESOURCECOUNTMARKENDRETURN=0xbe
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSRESOURCECOUNTMARKSTART=0xbb
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSRESOURCECOUNTMARKSTARTRETURN=0xbc
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSRESOURCECOUNTRETURN=0xc0
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSRMDIR=0x82
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSRMDIRRETURN=0x84
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSRMDIR_EDIRNAME=0x83
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSCANDRIVE=0xc4
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSCANDRIVERETURN=0xc6
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSCANDRIVE_EDIRNAME=0xc5
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSESSIONPATH=0x76
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSESSIONPATHRETURN=0x77
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSESSIONPATH_EDIRNAME=0x78
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETATT=0xa3
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETATTRETURN=0xa5
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETATT_EFILENAME=0xa4
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETDRIVENAME=0xe5
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETDRIVENAMERETURN=0xe7
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETDRIVENAME_EDRIVENAME=0xe6
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETENTRY=0xaf
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETENTRYRETURN=0xb1
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETENTRY_EFILENAME=0xb0
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETLOCALDRIVEMAPPING=0xf2
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETLOCALDRIVEMAPPINGRETURN=0xf4
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETLOCALDRIVEMAPPING_ELOCALDRIVEMAPPING=0xf3
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETMODIFIED=0xa9
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETMODIFIEDRETURN=0xab
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETMODIFIED_EFILENAME=0xaa
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETNOTIFYCHANGE=0x111
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETNOTIFYCHANGERETURN=0x112
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETNOTIFYUSER=0xd4
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETNOTIFYUSERRETURN=0xd5
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETSESSIONPATH=0x79
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETSESSIONPATHRETURN=0x7b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETSESSIONPATH_EDIRNAME=0x7a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETSESSIONTOPRIVATE=0xe
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETSESSIONTOPRIVATERETURN=0xf
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETSTARTUPCONFIGURATION=0x10f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETSTARTUPCONFIGURATIONRETURN=0x110
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETSUBST=0x6c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETSUBSTRETURN=0x6e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETSUBST_EDIRNAME=0x6d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETSYSTEMDRIVE=0xa
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETSYSTEMDRIVERETURN=0xb
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETVOLUMELABEL=0x66
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETVOLUMELABELRETURN=0x68
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSETVOLUMELABEL_EVOLUMENAME=0x67
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSTARTUPINITCOMPLETE=0xf0
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSTARTUPINITCOMPLETERETURN=0xf1
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSUBST=0x69
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSUBSTRETURN=0x6b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSUBST_EDIRNAME=0x6a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSUPPORTEDFILESYSTEMNAME=0x38
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSUPPORTEDFILESYSTEMNAMERETURN=0x3a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSWAPFILESYSTEM=0xfa
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSWAPFILESYSTEMRETURN=0xfd
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSWAPFILESYSTEM_ENEWNAME=0xfc
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSSWAPFILESYSTEM_EOLDNAME=0xfb
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSUNLOCKDRIVE=0xea
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSUNLOCKDRIVERETURN=0xeb
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSVERSION=0x15
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSVERSIONRETURN=0x16
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSVOLUME1=0x61
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSVOLUME1RETURNA=0x62
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSVOLUME1RETURNB=0x63
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSVOLUME2=0x64
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSVOLUME2RETURN=0x65
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSVOLUMEIOPARAM=0x117
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EFSVOLUMEIOPARAMRETURN=0x118
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EPLUGINCLOSE=0x25f
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EPLUGINCLOSERETURN=0x260
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EPLUGINDOCANCEL=0x26d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EPLUGINDOCANCELRETURN=0x26e
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EPLUGINDOCONTROL1=0x267
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EPLUGINDOCONTROL1RETURN=0x268
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EPLUGINDOCONTROL2=0x269
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EPLUGINDOCONTROL2RETURN=0x26a
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EPLUGINDOCONTROL3=0x26b
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EPLUGINDOCONTROL3RETURN=0x26c
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EPLUGINDOREQUEST1=0x261
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EPLUGINDOREQUEST1RETURN=0x262
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EPLUGINDOREQUEST2=0x263
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EPLUGINDOREQUEST2RETURN=0x264
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EPLUGINDOREQUEST3=0x265
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EPLUGINDOREQUEST3RETURN=0x266
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EPLUGINOPEN=0x25d
-[TRACE]TRACE_BORDER[0x40]_EFSRV_EPLUGINOPENRETURN=0x25e
-[TRACE]TRACE_PANIC[0x41]_EFSRV_EPANIC=0x1
--- a/userlibandfileserver/fileserver/shostmassstorage/msproxy/hostusbmsproxy.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/userlibandfileserver/fileserver/shostmassstorage/msproxy/hostusbmsproxy.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -55,10 +55,10 @@
         partitionInfo.Close();
 		return r;
         }
-	TUint8* buffer = const_cast<TUint8*>(partitionInfo.Ptr());
+	TUint8 *iIntBuf = (TUint8 *) partitionInfo.Ptr();
 
 	// Read of the first sector successful so check for a Master Boot Record
-	if (*(reinterpret_cast<TUint16*>(&buffer[KMBRSignatureOffset]))!= KMBRSignature)
+	if (*(TUint16*)(&iIntBuf[KMBRSignatureOffset])!= KMBRSignature)
 		{
 		__PXYPRINT(_L("MBR not present"));
         iMsDataMemMap.Reset();
@@ -66,16 +66,16 @@
 	else
 		{
 		// Move the partition entries to a 4 byte boundary
-		memcpy(&buffer[0],&buffer[KMBRFirstPartitionOffset],(sizeof(TMBRPartitionEntry)<<2));
+		memcpy(&iIntBuf[0],&iIntBuf[KMBRFirstPartitionOffset],(sizeof(TMBRPartitionEntry)<<2));
 		// Search for a x86 default boot partition - let this be the first
-		TMBRPartitionEntry* pe = reinterpret_cast<TMBRPartitionEntry*>(&buffer[0]);
+		TMBRPartitionEntry* pe = (TMBRPartitionEntry*)(&iIntBuf[0]);
 
 		TInt firstValidPartitionCount = -1;
 		TInt defaultPartitionNumber = -1;
 		TInt partitionCount = 0;
 		for (TInt i = 0; i < KMBRMaxPrimaryPartitions; i++, pe++)
 			{
-			if (pe->IsValidDosPartition() || pe->IsValidFAT32Partition() || pe->IsValidExFATPartition())
+			if (pe->IsValidDosPartition() || pe->IsValidFAT32Partition())
 				{
 				__PXYPRINT(_L("Found a Valid Partition"));
 				partitionCount++;
@@ -99,7 +99,7 @@
 	    if (partitionCount > 0)
 		    {
             __PXYPRINT1(_L("Using Partition %d"), partitionCount);
-			pe = reinterpret_cast<TMBRPartitionEntry*>(&buffer[0]);
+			pe = (TMBRPartitionEntry*)(&iIntBuf[0]);
             TInt partitionIndex = firstValidPartitionCount;
             if (defaultPartitionNumber > 0)
                 {